import { M as ModelKey } from './client-BJoZff-p.js'; export { A as AIBatch, a as AIBatchHandle, b as AIBatchProvider, c as AIBatchRequest, d as AIBatchResult, e as AICallType, f as AIEmbedResult, g as AIHelper, h as AIObjectResult, i as AIStreamResult, j as AITextResult, k as AVAILABLE_MODELS, l as AsyncBatchStageDefinition, B as BatchLogFn, D as DEFAULT_MODEL_KEY, E as EmbedOptions, m as EnhancedStageContext, I as InferInput, L as LogContext, n as ModelConfig, o as ModelRegistry, p as ModelStats, q as ModelStatsTracker, r as ModelSyncConfig, N as NoInputSchema, O as ObjectOptions, R as RecordCallParams, S as SimpleStageResult, s as StreamOptions, t as SyncStageDefinition, T as TextOptions, u as calculateCost, v as createAIHelper, w as defineAsyncBatchStage, x as defineStage, y as getDefaultModel, z as getModel, C as getModelById, F as getRegisteredModel, G as listModels, H as listRegisteredModels, J as modelSupportsBatch, K as printAvailableModels, P as registerEmbeddingProvider, Q as registerModels, U as requireStageOutput } from './client-BJoZff-p.js'; export { a as Stage } from './stage-DHgQdIcT.js'; import { B as Workflow } from './plugins-6FkZgj10.js'; export { C as CommandResult, I as IdempotencyInProgressError, D as InferWorkflowStageIds, J as JobExecuteCommand, a as JobExecuteResult, b as Kernel, d as KernelCommand, e as KernelCommandType, f as KernelConfig, W as KernelWorkflowRegistry, L as LeaseReapStaleCommand, g as LeaseReapStaleResult, O as OutboxFlushCommand, h as OutboxFlushResult, P as PluginDefinition, i as PluginReplayDLQCommand, j as PluginReplayDLQResult, k as PluginRunner, l as PluginRunnerConfig, R as RunCancelCommand, m as RunCancelResult, n as RunClaimPendingCommand, o as RunClaimPendingResult, q as RunCreateCommand, r as RunCreateResult, s as RunRerunFromCommand, t as RunRerunFromResult, u as RunTransitionCommand, v as RunTransitionResult, S as StagePollSuspendedCommand, w as StagePollSuspendedResult, E as WorkflowBuilder, x as createKernel, y as createPluginRunner, z as definePlugin } from './plugins-6FkZgj10.js'; import { L as LogLevel } from './types-ByGg__Kd.js'; export { S as StageResult } from './types-ByGg__Kd.js'; import z$1, { z } from 'zod'; export { j as AICallLogger, m as AICallRecord, l as AIHelperStats, w as ArtifactType, k as CreateAICallInput, e as CreateLogInput, h as CreateOutboxEventInput, C as CreateRunInput, a as CreateStageInput, D as DequeueResult, E as EnqueueJobInput, I as IdempotencyRecord, J as JobQueue, n as JobRecord, L as LogLevel, O as OutboxRecord, s as SaveArtifactInput, x as StaleVersionError, S as Status, U as UpdateRunInput, d as UpdateStageInput, c as UpsertStageInput, t as WorkflowArtifactRecord, u as WorkflowLogRecord, p as WorkflowPersistence, W as WorkflowRunRecord, b as WorkflowStageRecord } from './interface-DMzwv0lD.js'; export { P as PrismaAICallLogger, a as PrismaJobQueue, c as PrismaWorkflowPersistence, e as createPrismaAICallLogger, f as createPrismaJobQueue, g as createPrismaWorkflowPersistence } from './index-DM38nip0.js'; import { ToolSet } from 'ai'; export { K as KernelEvent, a as KernelEventType } from './events-B3XPPu0c.js'; export { B as BlobStore, C as Clock, E as EventSink, J as JobTransport, P as Persistence, S as Scheduler } from './ports-HqlAB_lY.js'; import '@ai-sdk/provider'; /** * Stage ID Utilities - Type-safe stage ID management * * Provides utilities for creating type-safe stage ID constants and * branded types to prevent typos in stage ID references. * * ## Usage Patterns * * ### Pattern 1: Create Stage IDs from a Workflow (Recommended) * * ```typescript * import { createStageIds } from "~/lib/workflow-v2/core/stage-ids"; * * export const STAGE_IDS = createStageIds(certificateWorkflow); * // = { * // DATA_EXTRACTION: "data-extraction", * // GUIDELINES: "guidelines", * // GENERATOR: "generator", * // } as const * * // Use in stage definitions * dependencies: [STAGE_IDS.DATA_EXTRACTION], // Autocomplete! * ``` * * ### Pattern 2: Define Stage IDs First (For Complex Workflows) * * ```typescript * export const CERTIFICATE_STAGES = defineStageIds([ * "data-extraction", * "guidelines", * "legal-guidance", * "unified-smart-retrieval", * "analysis-synthesis", * "generator", * ] as const); * * // Type: { DATA_EXTRACTION: "data-extraction", ... } * // With validation that stages match workflow definition * ``` * * ### Pattern 3: Use with InferWorkflowStageIds * * ```typescript * import type { InferWorkflowStageIds } from "~/lib/workflow-v2/core/workflow"; * * type CertificateStageId = InferWorkflowStageIds; * // = "data-extraction" | "guidelines" | "generator" | ... * * function requireStage(stageId: CertificateStageId) { ... } * ``` */ /** * Create a type-safe stage ID constants object from a workflow * * Extracts all stage IDs from a workflow and creates a frozen object * with SCREAMING_SNAKE_CASE keys for autocomplete and type safety. * * @example * ```typescript * import { certificateWorkflow } from "./certificate-workflow"; * * export const STAGE_IDS = createStageIds(certificateWorkflow); * // = { * // DATA_EXTRACTION: "data-extraction", * // GUIDELINES: "guidelines", * // LEGAL_GUIDANCE: "legal-guidance", * // GENERATOR: "generator", * // } as const * * // Use in code with autocomplete: * const data = ctx.require(STAGE_IDS.DATA_EXTRACTION); * ``` */ declare function createStageIds>(workflow: W): StageIdConstants; /** * Define stage IDs from a tuple of string literals * * Use this when you want to define stage IDs before building the workflow, * or when you need to share stage IDs across multiple files. * * @example * ```typescript * // Define stage IDs first * export const CERTIFICATE_STAGES = defineStageIds([ * "data-extraction", * "guidelines", * "legal-guidance", * "generator", * ] as const); * * // Use in stage definitions * dependencies: [CERTIFICATE_STAGES.DATA_EXTRACTION], * * // Type-safe access * type StageId = typeof CERTIFICATE_STAGES[keyof typeof CERTIFICATE_STAGES]; * // = "data-extraction" | "guidelines" | ... * ``` */ declare function defineStageIds(stageIds: T): DefineStageIdsResult; /** * Validate that a stage ID exists in a workflow * * Use this for runtime validation when the stage ID comes from user input. * * @example * ```typescript * const stageId = request.params.stageId; * * if (!isValidStageId(certificateWorkflow, stageId)) { * throw new Error(`Invalid stage ID: ${stageId}`); * } * ``` */ declare function isValidStageId>(workflow: W, stageId: string): stageId is WorkflowStageId; /** * Assert that a stage ID exists in a workflow * * Throws an error with helpful message if the stage ID is invalid. * * @example * ```typescript * assertValidStageId(certificateWorkflow, stageId); * // Now TypeScript knows stageId is a valid stage ID * ``` */ declare function assertValidStageId>(workflow: W, stageId: string): asserts stageId is WorkflowStageId; /** * Extract stage IDs as a string union from a Workflow type * * @example * ```typescript * type StageId = WorkflowStageId; * // = "data-extraction" | "guidelines" | "generator" | ... * ``` */ type WorkflowStageId> = W extends Workflow ? keyof C & string : never; /** * Result type for createStageIds function * * Maps each stage ID to a SCREAMING_SNAKE_CASE key. */ type StageIdConstants> = { readonly [K in WorkflowStageId as Uppercase : never>]: K; }; /** * Result type for defineStageIds function */ type DefineStageIdsResult = { readonly [K in T[number] as Uppercase : never>]: K; }; /** * Helper type to replace hyphens with underscores */ type ReplaceHyphens = S extends `${infer Head}-${infer Tail}` ? `${Head}_${ReplaceHyphens}` : S; /** * Validate that stage IDs match a workflow's expected stages * * Use this to ensure stage ID constants are in sync with the workflow. * * @example * ```typescript * // This will cause a compile error if stage IDs don't match * const STAGE_IDS: ValidateStageIds< * typeof certificateWorkflow, * typeof CERTIFICATE_STAGES * > = CERTIFICATE_STAGES; * ``` */ type ValidateStageIds, T extends Record> = { [K in keyof T]: T[K] extends WorkflowStageId ? T[K] : `Error: "${T[K] & string}" is not a valid stage ID in workflow`; }; /** * Config Presets - Common configuration patterns for workflow stages * * These presets provide standardized schemas for common stage configurations, * reducing boilerplate and ensuring consistency across stages. * * @example * ```typescript * import { defineStage } from "./stage-factory"; * import { withAIConfig, withStandardConfig } from "./config-presets"; * * // Use AI-focused config preset * const myStage = defineStage({ * id: "my-stage", * name: "My Stage", * schemas: { * input: z.object({ data: z.string() }), * output: z.object({ result: z.string() }), * config: withAIConfig(z.object({ * customField: z.string(), * })), * }, * async execute(ctx) { * // ctx.config.model, ctx.config.temperature available * // plus ctx.config.customField * }, * }); * * // Use standard config preset (includes AI + concurrency + feature flags) * const fullStage = defineStage({ * id: "full-stage", * name: "Full Stage", * schemas: { * input: "none", * output: z.object({ result: z.string() }), * config: withStandardConfig(z.object({ * specificOption: z.boolean().default(true), * })), * }, * async execute(ctx) { * // All standard config + custom fields available * }, * }); * ``` */ /** * AI/LLM configuration options */ declare const AIConfigSchema: z.ZodObject<{ model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; }, z.core.$strip>; type AIConfig = z.infer; /** * Concurrency and rate limiting configuration */ declare const ConcurrencyConfigSchema: z.ZodObject<{ concurrency: z.ZodDefault; delayMs: z.ZodDefault; maxRetries: z.ZodDefault; }, z.core.$strip>; type ConcurrencyConfig = z.infer; /** * Feature flag configuration for conditional behavior */ declare const FeatureFlagsConfigSchema: z.ZodObject<{ featureFlags: z.ZodDefault>; }, z.core.$strip>; type FeatureFlagsConfig = z.infer; /** * Logging and debugging configuration */ declare const DebugConfigSchema: z.ZodObject<{ verbose: z.ZodDefault; dryRun: z.ZodDefault; }, z.core.$strip>; type DebugConfig = z.infer; /** * Add AI configuration to any schema * * @example * ```typescript * const myConfig = withAIConfig(z.object({ * customField: z.string(), * })); * // Result has: model, temperature, maxTokens, customField * ``` */ declare function withAIConfig(schema: z.ZodObject): z.ZodObject<(keyof T & ("model" | "temperature" | "maxTokens") extends never ? T & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; } : { [K in keyof T as K extends "model" | "temperature" | "maxTokens" ? never : K]: T[K]; } & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; }) extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.core.$strip>; /** * Add concurrency configuration to any schema * * @example * ```typescript * const myConfig = withConcurrency(z.object({ * items: z.array(z.string()), * })); * // Result has: concurrency, delayMs, maxRetries, items * ``` */ declare function withConcurrency(schema: z.ZodObject): z.ZodObject<(keyof T & ("concurrency" | "delayMs" | "maxRetries") extends never ? T & { concurrency: z.ZodDefault; delayMs: z.ZodDefault; maxRetries: z.ZodDefault; } : { [K in keyof T as K extends "concurrency" | "delayMs" | "maxRetries" ? never : K]: T[K]; } & { concurrency: z.ZodDefault; delayMs: z.ZodDefault; maxRetries: z.ZodDefault; }) extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.core.$strip>; /** * Add feature flags configuration to any schema * * @example * ```typescript * const myConfig = withFeatureFlags(z.object({ * setting: z.boolean(), * })); * // Result has: featureFlags, setting * ``` */ declare function withFeatureFlags(schema: z.ZodObject): z.ZodObject<(keyof T & "featureFlags" extends never ? T & { featureFlags: z.ZodDefault>; } : { [K in keyof T as K extends "featureFlags" ? never : K]: T[K]; } & { featureFlags: z.ZodDefault>; }) extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.core.$strip>; /** * Standard config preset combining AI + Concurrency + Feature Flags * * This is the recommended preset for most stages that need: * - AI/LLM operations * - Parallel processing * - Feature flagging * * @example * ```typescript * const myConfig = withStandardConfig(z.object({ * customOption: z.boolean().default(true), * })); * // Result has all standard fields plus customOption * ``` */ declare function withStandardConfig(schema: z.ZodObject): z.ZodObject<(keyof (keyof (keyof T & ("model" | "temperature" | "maxTokens") extends never ? T & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; } : { [K in keyof T as K extends "model" | "temperature" | "maxTokens" ? never : K]: T[K]; } & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; }) & ("concurrency" | "delayMs" | "maxRetries") extends never ? ((keyof T & ("model" | "temperature" | "maxTokens") extends never ? T & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; } : { [K in keyof T as K extends "model" | "temperature" | "maxTokens" ? never : K]: T[K]; } & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; }) extends infer T_2 ? { [k_1 in keyof T_2]: T_2[k_1]; } : never) & { concurrency: z.ZodDefault; delayMs: z.ZodDefault; maxRetries: z.ZodDefault; } : (((keyof T & ("model" | "temperature" | "maxTokens") extends never ? T & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; } : { [K in keyof T as K extends "model" | "temperature" | "maxTokens" ? never : K]: T[K]; } & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; }) extends infer T_4 ? { [k_1 in keyof T_4]: T_4[k_1]; } : never) extends infer T_3 extends z.core.util.SomeObject ? { [K_1 in keyof T_3 as K_1 extends "concurrency" | "delayMs" | "maxRetries" ? never : K_1]: T_3[K_1]; } : never) & { concurrency: z.ZodDefault; delayMs: z.ZodDefault; maxRetries: z.ZodDefault; }) & "featureFlags" extends never ? ((keyof (keyof T & ("model" | "temperature" | "maxTokens") extends never ? T & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; } : { [K in keyof T as K extends "model" | "temperature" | "maxTokens" ? never : K]: T[K]; } & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; }) & ("concurrency" | "delayMs" | "maxRetries") extends never ? ((keyof T & ("model" | "temperature" | "maxTokens") extends never ? T & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; } : { [K in keyof T as K extends "model" | "temperature" | "maxTokens" ? never : K]: T[K]; } & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; }) extends infer T_6 ? { [k_1 in keyof T_6]: T_6[k_1]; } : never) & { concurrency: z.ZodDefault; delayMs: z.ZodDefault; maxRetries: z.ZodDefault; } : (((keyof T & ("model" | "temperature" | "maxTokens") extends never ? T & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; } : { [K in keyof T as K extends "model" | "temperature" | "maxTokens" ? never : K]: T[K]; } & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; }) extends infer T_8 ? { [k_1 in keyof T_8]: T_8[k_1]; } : never) extends infer T_7 extends z.core.util.SomeObject ? { [K_1 in keyof T_7 as K_1 extends "concurrency" | "delayMs" | "maxRetries" ? never : K_1]: T_7[K_1]; } : never) & { concurrency: z.ZodDefault; delayMs: z.ZodDefault; maxRetries: z.ZodDefault; }) extends infer T_5 ? { [k_2 in keyof T_5]: T_5[k_2]; } : never) & { featureFlags: z.ZodDefault>; } : (((keyof (keyof T & ("model" | "temperature" | "maxTokens") extends never ? T & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; } : { [K in keyof T as K extends "model" | "temperature" | "maxTokens" ? never : K]: T[K]; } & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; }) & ("concurrency" | "delayMs" | "maxRetries") extends never ? ((keyof T & ("model" | "temperature" | "maxTokens") extends never ? T & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; } : { [K in keyof T as K extends "model" | "temperature" | "maxTokens" ? never : K]: T[K]; } & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; }) extends infer T_11 ? { [k_1 in keyof T_11]: T_11[k_1]; } : never) & { concurrency: z.ZodDefault; delayMs: z.ZodDefault; maxRetries: z.ZodDefault; } : (((keyof T & ("model" | "temperature" | "maxTokens") extends never ? T & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; } : { [K in keyof T as K extends "model" | "temperature" | "maxTokens" ? never : K]: T[K]; } & { model: z.ZodDefault>>; temperature: z.ZodDefault; maxTokens: z.ZodOptional; }) extends infer T_13 ? { [k_1 in keyof T_13]: T_13[k_1]; } : never) extends infer T_12 extends z.core.util.SomeObject ? { [K_1 in keyof T_12 as K_1 extends "concurrency" | "delayMs" | "maxRetries" ? never : K_1]: T_12[K_1]; } : never) & { concurrency: z.ZodDefault; delayMs: z.ZodDefault; maxRetries: z.ZodDefault; }) extends infer T_10 ? { [k_2 in keyof T_10]: T_10[k_2]; } : never) extends infer T_9 extends z.core.util.SomeObject ? { [K_2 in keyof T_9 as K_2 extends "featureFlags" ? never : K_2]: T_9[K_2]; } : never) & { featureFlags: z.ZodDefault>; }) extends infer T_1 ? { [k in keyof T_1]: T_1[k]; } : never, z.core.$strip>; /** * Model Mapping for Batch Providers * * Dynamically maps models from the registry to provider-specific batch API identifiers. * Uses the `supportsAsyncBatch` flag and OpenRouter ID prefix to determine compatibility. */ declare const BatchProviderName: z$1.ZodEnum<{ google: "google"; anthropic: "anthropic"; openai: "openai"; }>; type BatchProviderName = z$1.infer; /** * Get the provider-specific model ID, with fallback to default * * @param modelKey - The ModelKey from model-helper.ts (optional) * @param provider - The batch provider * @returns Provider-specific model ID * @throws Error if model is not supported by the provider */ declare function resolveModelForProvider(modelKey: ModelKey | undefined, provider: BatchProviderName): string; /** * Get the best provider for a given ModelKey * Returns the provider that natively supports the model */ declare function getBestProviderForModel(modelKey: ModelKey): BatchProviderName | undefined; /** * Low-Level Batch Provider Types * * These types are used internally by batch providers (Google, Anthropic, OpenAI). * They have more fields than the high-level user-facing types in ai/ai-helper.ts. * * For the user-facing batch API, see: * - AIBatchRequest - simple request with id, prompt, schema * - AIBatchResult - result with id, result, tokens * - AIBatchHandle - handle with id, status, provider * * These provider-level types include additional fields like: * - BatchHandle: requestCount, createdAt, metadata * - BaseBatchRequest: model, system, maxTokens, temperature, tools * - RawBatchResult: raw text before parsing, index */ /** Tool choice options compatible with AI SDK */ type BatchToolChoice = "auto" | "required" | "none" | { type: "tool"; toolName: string; }; /** * Handle returned when a batch is submitted */ interface BatchHandle { /** Unique identifier for the batch (provider-specific format) */ id: string; /** Provider name (google, anthropic, openai) */ provider: string; /** Number of requests in the batch */ requestCount: number; /** When the batch was created */ createdAt: Date; /** Provider-specific metadata */ metadata?: Record; } /** * Status of a batch job */ interface BatchStatus { /** Current state of the batch */ state: BatchState; /** Number of requests processed so far */ processedCount: number; /** Total number of requests in the batch */ totalCount: number; /** Number of successful requests (if available) */ succeededCount?: number; /** Number of failed requests (if available) */ failedCount?: number; /** Error message if batch failed */ error?: string; /** Estimated completion time (if available) */ estimatedCompletion?: Date; /** Total input tokens used (available when batch is complete) */ totalInputTokens?: number; /** Total output tokens used (available when batch is complete) */ totalOutputTokens?: number; } type BatchState = "pending" | "processing" | "completed" | "failed" | "cancelled"; /** * Raw result from a provider (before schema validation) */ interface RawBatchResult { index: number; customId?: string; text: string; inputTokens: number; outputTokens: number; error?: string; } /** * Base request configuration shared across providers */ interface BaseBatchRequest { /** The prompt/content to send */ prompt: string; /** Optional custom ID for tracking */ customId?: string; /** Model to use - accepts ModelKey from model-helper.ts */ model?: ModelKey; /** System prompt (if supported) */ system?: string; /** Maximum tokens to generate */ maxTokens?: number; /** Temperature for generation */ temperature?: number; /** Optional Zod schema for structured output */ schema?: z.ZodTypeAny; /** Tool definitions (same as AI SDK generateText/streamText) */ tools?: ToolSet; /** Tool choice mode */ toolChoice?: BatchToolChoice; } /** * Request with schema for structured output */ interface BatchRequestWithSchema extends BaseBatchRequest { schema: TSchema; } /** * Request without schema (plain text output) */ interface BatchRequestText extends BaseBatchRequest { schema?: never; } /** * Interface that all batch providers must implement */ interface BatchProvider { /** Provider name (google, anthropic, openai) */ readonly name: string; /** Whether this provider supports batching */ readonly supportsBatching: boolean; /** * Submit requests to batch processing * @param requests Array of requests to process * @param options Provider-specific options * @returns Handle to track the batch */ submit(requests: TRequest[], options?: BatchSubmitOptions): Promise; /** * Check the status of a batch * @param handle Batch handle from submit() * @returns Current status */ checkStatus(handle: BatchHandle): Promise; /** * Retrieve results from a completed batch * @param handle Batch handle from submit() * @returns Array of raw results */ getResults(handle: BatchHandle): Promise; /** * Cancel a running batch (optional - not all providers support this) * @param handle Batch handle from submit() */ cancel?(handle: BatchHandle): Promise; } interface BatchSubmitOptions { /** Display name for the batch (if supported) */ displayName?: string; /** Completion window (e.g., "24h" for OpenAI) */ completionWindow?: string; /** Custom metadata to attach */ metadata?: Record; } /** * Serialized batch for persistence during workflow suspension */ interface SerializedBatch { handle: BatchHandle; providerName: string; /** Serialized schema definitions (if any) */ schemaDefinitions?: unknown[]; } /** * Logger interface for batch operations */ interface BatchLogger { log: (level: LogLevel, message: string, meta?: Record) => void; } /** * Aggregated metrics for a batch */ interface BatchMetrics { provider: string; model: string; requestCount: number; totalInputTokens: number; totalOutputTokens: number; estimatedCost: number; actualDuration: number; successRate: number; } interface GoogleBatchRequest extends BaseBatchRequest { } interface AnthropicBatchRequest extends BaseBatchRequest { } interface OpenAIBatchRequest extends BaseBatchRequest { } /** * Google Batch Provider * * Implements batch processing using Google's GenAI Batch API. * Uses inline requests for simpler API. */ interface GoogleBatchProviderConfig { apiKey?: string; } declare class GoogleBatchProvider implements BatchProvider { readonly name = "google"; readonly supportsBatching = true; private ai; private logger?; constructor(config?: GoogleBatchProviderConfig, logger?: BatchLogger); submit(requests: GoogleBatchRequest[], options?: BatchSubmitOptions): Promise; checkStatus(handle: BatchHandle): Promise; getResults(handle: BatchHandle, customIds?: string[]): Promise; cancel(handle: BatchHandle): Promise; private mapState; } /** * Anthropic Batch Provider * * Implements batch processing using Anthropic's Message Batches API. * Supports up to 10,000 requests per batch with 24h processing window. */ interface AnthropicBatchProviderConfig { apiKey?: string; } declare class AnthropicBatchProvider implements BatchProvider { readonly name = "anthropic"; readonly supportsBatching = true; private client; private logger?; constructor(config?: AnthropicBatchProviderConfig, logger?: BatchLogger); submit(requests: AnthropicBatchRequest[], options?: BatchSubmitOptions): Promise; checkStatus(handle: BatchHandle): Promise; getResults(handle: BatchHandle): Promise; cancel(handle: BatchHandle): Promise; private mapStatus; } /** * OpenAI Batch Provider * * Implements batch processing using OpenAI's Batch API. * Note: OpenAI requires JSONL file uploads for batches. * Supports up to 50,000 requests per batch with 24h processing window. */ interface OpenAIBatchProviderConfig { apiKey?: string; } declare class OpenAIBatchProvider implements BatchProvider { readonly name = "openai"; readonly supportsBatching = true; private client; private logger?; constructor(config?: OpenAIBatchProviderConfig, logger?: BatchLogger); submit(requests: OpenAIBatchRequest[], options?: BatchSubmitOptions): Promise; checkStatus(handle: BatchHandle): Promise; getResults(handle: BatchHandle): Promise; cancel(handle: BatchHandle): Promise; private mapStatus; } export { type AIConfig, AIConfigSchema, AnthropicBatchProvider, type AnthropicBatchProviderConfig, type AnthropicBatchRequest, type BaseBatchRequest, type BatchLogger, type BatchMetrics, type BatchRequestText, type BatchRequestWithSchema, type BatchState, type BatchStatus, type BatchSubmitOptions, type ConcurrencyConfig, ConcurrencyConfigSchema, type DebugConfig, DebugConfigSchema, type FeatureFlagsConfig, FeatureFlagsConfigSchema, GoogleBatchProvider, type GoogleBatchProviderConfig, type GoogleBatchRequest, ModelKey, OpenAIBatchProvider, type OpenAIBatchProviderConfig, type OpenAIBatchRequest, type RawBatchResult, type SerializedBatch, type ValidateStageIds, Workflow, type WorkflowStageId, assertValidStageId, createStageIds, defineStageIds, getBestProviderForModel, isValidStageId, resolveModelForProvider, withAIConfig, withConcurrency, withFeatureFlags, withStandardConfig };