UNPKG

mlld

Version:

mlld: llm scripting language

1 lines 3.61 kB
{"version":3,"sources":["../interpreter/eval/pipeline/index.ts"],"names":["executePipeline","baseOutput","pipeline","env","location","format","isRetryable","sourceFunction","hasSyntheticSource","parallelCap","delayMs","options","executor","PipelineExecutor","returnStructured","execute"],"mappings":";;;;AAgDA,eAAsBA,eACpBC,CAAAA,UAAAA,EACAC,QACAC,EAAAA,GAAAA,EACAC,QACAC,EAAAA,MAAAA,EACAC,WAAuB,GAAA,KAAA,EACvBC,cACAC,EAAAA,kBAAAA,GAA8B,KAC9BC,EAAAA,WAAAA,EACAC,SACAC,OAAwB,EAAA;AAExB,EAAMC,MAAAA,QAAAA,GAAW,IAAIC,gBAAAA,CAAiBX,QAAUC,EAAAA,GAAAA,EAAKE,QAAQC,WAAaC,EAAAA,cAAAA,EAAgBC,kBAAoBC,EAAAA,WAAAA,EAAaC,OAAAA,CAAAA;AAC3H,EAAA,IAAIC,SAASG,gBAAkB,EAAA;AAC7B,IAAO,OAAA,MAAMF,QAASG,CAAAA,OAAAA,CAAQd,UAAY,EAAA;MAAEa,gBAAkB,EAAA;KAAK,CAAA;AACrE;AACA,EAAO,OAAA,MAAMF,QAASG,CAAAA,OAAAA,CAAQd,UAAAA,CAAAA;AAChC;AAlBsBD,MAAAA,CAAAA,eAAAA,EAAAA,iBAAAA,CAAAA","file":"pipeline-6P6GNLL2.mjs","sourcesContent":["import type { Environment } from '../../env/Environment';\nimport type { PipelineStage } from '@core/types';\nimport { PipelineExecutor, type ExecuteOptions } from './executor';\nimport type { StructuredValue } from '../../utils/structured-value';\n\n// Re-export types\nexport type * from './types';\nexport { PipelineStateMachine } from './state-machine';\nexport { PipelineExecutor } from './executor';\n\n/**\n * Execute a pipeline of transformation commands with @input threading\n * This is the main public API that replaces the old executePipeline function\n * \n * @param baseOutput - The initial input string for the pipeline\n * @param pipeline - Array of pipeline commands to execute\n * @param env - The environment for variable resolution\n * @param location - Optional source location for error reporting\n * @param format - Optional format specification for pipeline input\n * @param isRetryable - Whether the initial input is retryable (came from a function)\n * @param sourceFunction - Optional function to re-execute for stage 0 retries\n * @param hasSyntheticSource - Whether the pipeline has a synthetic __source__ stage at position 0\n */\nexport async function executePipeline(\n baseOutput: string | StructuredValue,\n pipeline: PipelineStage[],\n env: Environment,\n location?: any,\n format?: string,\n isRetryable?: boolean,\n sourceFunction?: () => Promise<string | StructuredValue>,\n hasSyntheticSource?: boolean,\n parallelCap?: number,\n delayMs?: number\n): Promise<string>;\nexport async function executePipeline(\n baseOutput: string | StructuredValue,\n pipeline: PipelineStage[],\n env: Environment,\n location: any,\n format: string | undefined,\n isRetryable: boolean,\n sourceFunction: (() => Promise<string | StructuredValue>) | undefined,\n hasSyntheticSource: boolean,\n parallelCap: number | undefined,\n delayMs: number | undefined,\n options: ExecuteOptions & { returnStructured: true }\n): Promise<StructuredValue>;\nexport async function executePipeline(\n baseOutput: string | StructuredValue,\n pipeline: PipelineStage[],\n env: Environment,\n location?: any,\n format?: string,\n isRetryable: boolean = false,\n sourceFunction?: () => Promise<string | StructuredValue>,\n hasSyntheticSource: boolean = false,\n parallelCap?: number,\n delayMs?: number,\n options?: ExecuteOptions\n): Promise<string | StructuredValue> {\n const executor = new PipelineExecutor(pipeline, env, format, isRetryable, sourceFunction, hasSyntheticSource, parallelCap, delayMs);\n if (options?.returnStructured) {\n return await executor.execute(baseOutput, { returnStructured: true });\n }\n return await executor.execute(baseOutput);\n}\n"]}