@workglow/task-graph 0.0.101 → 0.0.102

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/node.js.map CHANGED
@@ -3,13 +3,13 @@
3
3
  "sources": ["../src/task-graph/Dataflow.ts", "../src/task/TaskTypes.ts", "../src/task-graph/TaskGraph.ts", "../src/task/GraphAsTask.ts", "../src/task-graph/TaskGraphRunner.ts", "../src/storage/TaskOutputRepository.ts", "../src/task/ConditionUtils.ts", "../src/task/Task.ts", "../src/task/TaskError.ts", "../src/task/TaskRunner.ts", "../src/task/InputResolver.ts", "../src/task/StreamTypes.ts", "../src/task/ConditionalTask.ts", "../src/task-graph/TaskGraphScheduler.ts", "../src/task/GraphAsTaskRunner.ts", "../src/task-graph/Workflow.ts", "../src/task-graph/Conversions.ts", "../src/task-graph/TaskGraphEvents.ts", "../src/task/IteratorTaskRunner.ts", "../src/task/IteratorTask.ts", "../src/task/WhileTaskRunner.ts", "../src/task/WhileTask.ts", "../src/task/iterationSchema.ts", "../src/task/JobQueueFactory.ts", "../src/task/JobQueueTask.ts", "../src/task/TaskQueueRegistry.ts", "../src/task/MapTask.ts", "../src/task/ReduceTask.ts", "../src/task/TaskRegistry.ts", "../src/task/TaskJSON.ts", "../src/task/index.ts", "../src/storage/TaskGraphRepository.ts", "../src/storage/TaskGraphTabularRepository.ts", "../src/storage/TaskOutputTabularRepository.ts"],
4
4
  "sourcesContent": [
5
5
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { areSemanticallyCompatible, EventEmitter } from \"@workglow/util\";\nimport { type StreamEvent } from \"../task/StreamTypes\";\nimport { TaskError } from \"../task/TaskError\";\nimport { DataflowJson } from \"../task/TaskJSON\";\nimport { TaskIdType, TaskOutput, TaskStatus } from \"../task/TaskTypes\";\nimport {\n DataflowEventListener,\n DataflowEventListeners,\n DataflowEventParameters,\n DataflowEvents,\n} from \"./DataflowEvents\";\nimport { TaskGraph } from \"./TaskGraph\";\n\nexport type DataflowIdType = `${string}[${string}] ==> ${string}[${string}]`;\n\nexport const DATAFLOW_ALL_PORTS = \"*\";\nexport const DATAFLOW_ERROR_PORT = \"[error]\";\n\n/**\n * Represents a data flow between two tasks, indicating how one task's output is used as input for another task\n */\nexport class Dataflow {\n constructor(\n public sourceTaskId: TaskIdType,\n public sourceTaskPortId: string,\n public targetTaskId: TaskIdType,\n public targetTaskPortId: string\n ) {}\n public static createId(\n sourceTaskId: TaskIdType,\n sourceTaskPortId: string,\n targetTaskId: TaskIdType,\n targetTaskPortId: string\n ): DataflowIdType {\n return `${sourceTaskId}[${sourceTaskPortId}] ==> ${targetTaskId}[${targetTaskPortId}]`;\n }\n get id(): DataflowIdType {\n return Dataflow.createId(\n this.sourceTaskId,\n this.sourceTaskPortId,\n this.targetTaskId,\n this.targetTaskPortId\n );\n }\n public value: any = undefined;\n public status: TaskStatus = TaskStatus.PENDING;\n public error: TaskError | undefined;\n\n /**\n * Active stream for this dataflow edge.\n * Set when a streaming upstream task begins producing chunks.\n * Multiple downstream consumers can each get an independent reader via tee().\n */\n public stream: ReadableStream<StreamEvent> | undefined = undefined;\n\n /**\n * Sets the active stream on this dataflow.\n * @param stream The ReadableStream of StreamEvents from the upstream task\n */\n public setStream(stream: ReadableStream<StreamEvent>): void {\n this.stream = stream;\n }\n\n /**\n * Gets the active stream from this dataflow, or undefined if not streaming.\n */\n public getStream(): ReadableStream<StreamEvent> | undefined {\n return this.stream;\n }\n\n /**\n * Consumes the active stream to completion and materializes the value.\n *\n * Accumulation of text-delta chunks is the responsibility of the **source\n * task** (via TaskRunner.executeStreamingTask when shouldAccumulate=true).\n * When accumulation is needed the source task emits an enriched finish event\n * that carries the fully-assembled port data. All downstream edges share that\n * enriched event through tee'd ReadableStreams, so no edge needs to\n * re-accumulate independently.\n *\n * This method therefore only reads snapshot and finish events:\n * - **snapshot**: used for replace-mode tasks that emit incremental snapshots.\n * - **finish**: the primary materialization path; carries complete data when\n * the source task accumulated, or provider-level data otherwise.\n * - text-delta / object-delta: ignored here (handled by source task).\n *\n * After consumption the stream reference is cleared. Calling this method on\n * a dataflow that has no stream is a no-op.\n */\n public async awaitStreamValue(): Promise<void> {\n if (!this.stream) return;\n\n const reader = this.stream.getReader();\n let lastSnapshotData: any = undefined;\n let finishData: any = undefined;\n let streamError: Error | undefined;\n\n try {\n while (true) {\n const { done, value: event } = await reader.read();\n if (done) break;\n\n switch (event.type) {\n case \"snapshot\":\n lastSnapshotData = event.data;\n break;\n case \"finish\":\n finishData = event.data;\n break;\n case \"error\":\n streamError = event.error;\n break;\n // text-delta, object-delta: source task handles accumulation\n }\n }\n } finally {\n reader.releaseLock();\n this.stream = undefined;\n }\n\n if (streamError) {\n this.error = streamError as TaskError;\n this.setStatus(TaskStatus.FAILED);\n throw streamError;\n }\n\n // Priority: snapshot > finish.\n // The source task enriches the finish event with accumulated text when\n // shouldAccumulate=true, so finishData carries complete port data.\n if (lastSnapshotData !== undefined) {\n this.setPortData(lastSnapshotData);\n } else if (finishData !== undefined) {\n this.setPortData(finishData);\n }\n }\n\n public reset() {\n this.status = TaskStatus.PENDING;\n this.error = undefined;\n this.value = undefined;\n this.stream = undefined;\n this.emit(\"reset\");\n this.emit(\"status\", this.status);\n }\n\n public setStatus(status: TaskStatus) {\n if (status === this.status) return;\n this.status = status;\n switch (status) {\n case TaskStatus.PROCESSING:\n this.emit(\"start\");\n break;\n case TaskStatus.STREAMING:\n this.emit(\"streaming\");\n break;\n case TaskStatus.COMPLETED:\n this.emit(\"complete\");\n break;\n case TaskStatus.ABORTING:\n this.emit(\"abort\");\n break;\n case TaskStatus.PENDING:\n this.emit(\"reset\");\n break;\n case TaskStatus.FAILED:\n this.emit(\"error\", this.error!);\n break;\n case TaskStatus.DISABLED:\n this.emit(\"disabled\");\n break;\n }\n this.emit(\"status\", this.status);\n }\n\n setPortData(entireDataBlock: any) {\n if (this.sourceTaskPortId === DATAFLOW_ALL_PORTS) {\n this.value = entireDataBlock;\n } else if (this.sourceTaskPortId === DATAFLOW_ERROR_PORT) {\n this.error = entireDataBlock;\n } else {\n this.value = entireDataBlock[this.sourceTaskPortId];\n }\n }\n\n getPortData(): TaskOutput {\n let result: TaskOutput;\n if (this.targetTaskPortId === DATAFLOW_ALL_PORTS) {\n result = this.value;\n } else if (this.targetTaskPortId === DATAFLOW_ERROR_PORT) {\n result = { [DATAFLOW_ERROR_PORT]: this.error };\n } else {\n result = { [this.targetTaskPortId]: this.value };\n }\n return result;\n }\n\n toJSON(): DataflowJson {\n return {\n sourceTaskId: this.sourceTaskId,\n sourceTaskPortId: this.sourceTaskPortId,\n targetTaskId: this.targetTaskId,\n targetTaskPortId: this.targetTaskPortId,\n };\n }\n\n semanticallyCompatible(\n graph: TaskGraph,\n dataflow: Dataflow\n ): \"static\" | \"runtime\" | \"incompatible\" {\n // TODO(str): this is inefficient\n const targetSchema = graph.getTask(dataflow.targetTaskId)!.inputSchema();\n const sourceSchema = graph.getTask(dataflow.sourceTaskId)!.outputSchema();\n\n if (typeof targetSchema === \"boolean\") {\n if (targetSchema === false) {\n return \"incompatible\";\n }\n return \"static\";\n }\n if (typeof sourceSchema === \"boolean\") {\n if (sourceSchema === false) {\n return \"incompatible\";\n }\n return \"runtime\";\n }\n\n let targetSchemaProperty =\n DATAFLOW_ALL_PORTS === dataflow.targetTaskPortId\n ? true // Accepts any schema (equivalent to Type.Any())\n : (targetSchema.properties as any)?.[dataflow.targetTaskPortId];\n // If the specific property doesn't exist but additionalProperties is true,\n // treat it as accepting any schema\n if (targetSchemaProperty === undefined && targetSchema.additionalProperties === true) {\n targetSchemaProperty = true;\n }\n let sourceSchemaProperty =\n DATAFLOW_ALL_PORTS === dataflow.sourceTaskPortId\n ? true // Accepts any schema (equivalent to Type.Any())\n : (sourceSchema.properties as any)?.[dataflow.sourceTaskPortId];\n // If the specific property doesn't exist but additionalProperties is true,\n // treat it as outputting any schema\n if (sourceSchemaProperty === undefined && sourceSchema.additionalProperties === true) {\n sourceSchemaProperty = true;\n }\n\n const semanticallyCompatible = areSemanticallyCompatible(\n sourceSchemaProperty,\n targetSchemaProperty\n );\n\n return semanticallyCompatible;\n }\n\n // ========================================================================\n // Event handling methods\n // ========================================================================\n\n /**\n * Event emitter for dataflow events\n */\n public get events(): EventEmitter<DataflowEventListeners> {\n if (!this._events) {\n this._events = new EventEmitter<DataflowEventListeners>();\n }\n return this._events;\n }\n protected _events: EventEmitter<DataflowEventListeners> | undefined;\n\n public subscribe<Event extends DataflowEvents>(\n name: Event,\n fn: DataflowEventListener<Event>\n ): () => void {\n return this.events.subscribe(name, fn);\n }\n\n /**\n * Registers an event listener\n */\n public on<Event extends DataflowEvents>(name: Event, fn: DataflowEventListener<Event>): void {\n this.events.on(name, fn);\n }\n\n /**\n * Removes an event listener\n */\n public off<Event extends DataflowEvents>(name: Event, fn: DataflowEventListener<Event>): void {\n this.events.off(name, fn);\n }\n\n /**\n * Registers a one-time event listener\n */\n public once<Event extends DataflowEvents>(name: Event, fn: DataflowEventListener<Event>): void {\n this.events.once(name, fn);\n }\n\n /**\n * Returns a promise that resolves when the specified event is emitted\n */\n public waitOn<Event extends DataflowEvents>(\n name: Event\n ): Promise<DataflowEventParameters<Event>> {\n return this.events.waitOn(name) as Promise<DataflowEventParameters<Event>>;\n }\n\n /**\n * Emits an event\n */\n public emit<Event extends DataflowEvents>(\n name: Event,\n ...args: DataflowEventParameters<Event>\n ): void {\n this._events?.emit(name, ...args);\n }\n}\n\n/**\n * Represents a data flow between two tasks, indicating how one task's output is used as input for another task\n *\n * This is a helper class that parses a data flow id string into a Dataflow object\n *\n * @param dataflow - The data flow string, e.g. \"sourceTaskId[sourceTaskPortId] ==> targetTaskId[targetTaskPortId]\"\n */\nexport class DataflowArrow extends Dataflow {\n constructor(dataflow: DataflowIdType) {\n // Parse the dataflow string using regex\n const pattern =\n /^([a-zA-Z0-9-]+?)\\[([a-zA-Z0-9-]+?)\\] ==> ([a-zA-Z0-9-]+?)\\[([a-zA-Z0-9-]+?)\\]$/;\n const match = dataflow.match(pattern);\n\n if (!match) {\n throw new Error(`Invalid dataflow format: ${dataflow}`);\n }\n\n const [, sourceTaskId, sourceTaskPortId, targetTaskId, targetTaskPortId] = match;\n super(sourceTaskId, sourceTaskPortId, targetTaskId, targetTaskPortId);\n }\n}\n",
6
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type DataPortSchema, type FromSchema, StripJSONSchema } from \"@workglow/util\";\nimport type { Task } from \"./Task\";\n\n/**\n * Enum representing the possible states of a task\n *\n * PENDING -> PROCESSING -> COMPLETED\n * PENDING -> PROCESSING -> STREAMING -> COMPLETED\n * PENDING -> PROCESSING -> ABORTING -> FAILED\n * PENDING -> PROCESSING -> FAILED\n * PENDING -> DISABLED\n */\nexport type TaskStatus =\n | \"PENDING\"\n | \"DISABLED\"\n | \"PROCESSING\"\n | \"STREAMING\"\n | \"COMPLETED\"\n | \"ABORTING\"\n | \"FAILED\";\n\nexport const TaskStatus = {\n /** Task is created but not yet started */\n PENDING: \"PENDING\",\n /** Task is disabled due to conditional logic */\n DISABLED: \"DISABLED\",\n /** Task is currently running */\n PROCESSING: \"PROCESSING\",\n /** Task has begun producing streaming output chunks */\n STREAMING: \"STREAMING\",\n /** Task has completed successfully */\n COMPLETED: \"COMPLETED\",\n /** Task is in the process of being aborted */\n ABORTING: \"ABORTING\",\n /** Task has failed */\n FAILED: \"FAILED\",\n} as const satisfies Record<TaskStatus, TaskStatus>;\n\n// ========================================================================\n// Core Task Data Types\n// ========================================================================\n\nexport interface DataPorts extends StripJSONSchema<Record<string, any>> {\n [key: string]: unknown;\n}\n\n/** Type for task input data */\nexport type TaskInput = DataPorts;\n\n/** Type for task output data */\nexport type TaskOutput = DataPorts;\n\nexport type CompoundTaskOutput =\n | {\n outputs: TaskOutput[];\n }\n | {\n [key: string]: unknown | unknown[] | undefined;\n };\n\n/** Type for task type names */\nexport type TaskTypeName = string;\n\n// ========================================================================\n// Task Configuration Schema and Types\n// ========================================================================\n\n/**\n * Base JSON Schema for task configuration.\n * Exported so subclasses can compose their own schema with:\n * `...TaskConfigSchema[\"properties\"]`\n *\n * Fields:\n * - id: unique task identifier (any type)\n * - title: human-readable name for the task instance (overrides static title)\n * - description: human-readable description (overrides static description)\n * - cacheable: design-time cache flag (runtime override goes in IRunConfig)\n * - inputSchema: dynamic input schema override (for tasks like InputTask)\n * - outputSchema: dynamic output schema override (for tasks like OutputTask)\n * - extras: arbitrary user data serialized with the task JSON\n */\nexport const TaskConfigSchema = {\n type: \"object\",\n properties: {\n id: {},\n title: { type: \"string\" },\n description: { type: \"string\" },\n cacheable: { type: \"boolean\" },\n inputSchema: { type: \"object\", properties: {}, additionalProperties: true },\n outputSchema: { type: \"object\", properties: {}, additionalProperties: true },\n extras: {\n type: \"object\",\n additionalProperties: true,\n },\n },\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\ntype BaseFromSchema = FromSchema<typeof TaskConfigSchema>;\n\n/**\n * Base type for task configuration, derived from TaskConfigSchema.\n * Use `TaskConfigSchema` when building JSON schemas in subclasses.\n * Use this type when declaring the Config generic parameter.\n */\nexport type TaskConfig = Omit<BaseFromSchema, \"id\" | \"inputSchema\" | \"outputSchema\"> & {\n /** Unique identifier for the task (uuid4 by default) */\n id?: unknown;\n /** Dynamic input schema override for the task instance */\n inputSchema?: DataPortSchema;\n /** Dynamic output schema override for the task instance */\n outputSchema?: DataPortSchema;\n};\n\n/** Type for task ID */\nexport type TaskIdType = Task<TaskInput, TaskOutput, TaskConfig>[\"config\"][\"id\"];\n",
6
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type DataPortSchema, type FromSchema, StripJSONSchema } from \"@workglow/util\";\nimport type { Task } from \"./Task\";\n\n/**\n * Enum representing the possible states of a task\n *\n * PENDING -> PROCESSING -> COMPLETED\n * PENDING -> PROCESSING -> STREAMING -> COMPLETED\n * PENDING -> PROCESSING -> ABORTING -> FAILED\n * PENDING -> PROCESSING -> FAILED\n * PENDING -> DISABLED\n */\nexport type TaskStatus =\n | \"PENDING\"\n | \"DISABLED\"\n | \"PROCESSING\"\n | \"STREAMING\"\n | \"COMPLETED\"\n | \"ABORTING\"\n | \"FAILED\";\n\nexport const TaskStatus = {\n /** Task is created but not yet started */\n PENDING: \"PENDING\",\n /** Task is disabled due to conditional logic */\n DISABLED: \"DISABLED\",\n /** Task is currently running */\n PROCESSING: \"PROCESSING\",\n /** Task has begun producing streaming output chunks */\n STREAMING: \"STREAMING\",\n /** Task has completed successfully */\n COMPLETED: \"COMPLETED\",\n /** Task is in the process of being aborted */\n ABORTING: \"ABORTING\",\n /** Task has failed */\n FAILED: \"FAILED\",\n} as const satisfies Record<TaskStatus, TaskStatus>;\n\n// ========================================================================\n// Core Task Data Types\n// ========================================================================\n\nexport interface DataPorts extends StripJSONSchema<Record<string, any>> {\n [key: string]: unknown;\n}\n\n/** Type for task input data */\nexport type TaskInput = DataPorts;\n\n/** Type for task output data */\nexport type TaskOutput = DataPorts;\n\nexport type CompoundTaskOutput =\n | {\n outputs: TaskOutput[];\n }\n | {\n [key: string]: unknown | unknown[] | undefined;\n };\n\n/** Type for task type names */\nexport type TaskTypeName = string;\n\n// ========================================================================\n// Task Configuration Schema and Types\n// ========================================================================\n\n/**\n * Base JSON Schema for task configuration.\n * Exported so subclasses can compose their own schema with:\n * `...TaskConfigSchema[\"properties\"]`\n *\n * Fields:\n * - id: unique task identifier (any type)\n * - title: human-readable name for the task instance (overrides static title)\n * - description: human-readable description (overrides static description)\n * - cacheable: design-time cache flag (runtime override goes in IRunConfig)\n * - inputSchema: dynamic input schema override (for tasks like InputTask)\n * - outputSchema: dynamic output schema override (for tasks like OutputTask)\n * - extras: arbitrary user data serialized with the task JSON\n */\nexport const TaskConfigSchema = {\n type: \"object\",\n properties: {\n id: {\n \"x-ui-hidden\": true,\n },\n title: { type: \"string\" },\n description: { type: \"string\" },\n cacheable: { type: \"boolean\" },\n inputSchema: {\n type: \"object\",\n properties: {},\n additionalProperties: true,\n \"x-ui-hidden\": true,\n },\n outputSchema: {\n type: \"object\",\n properties: {},\n additionalProperties: true,\n \"x-ui-hidden\": true,\n },\n extras: {\n type: \"object\",\n additionalProperties: true,\n \"x-ui-hidden\": true,\n },\n },\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\ntype BaseFromSchema = FromSchema<typeof TaskConfigSchema>;\n\n/**\n * Base type for task configuration, derived from TaskConfigSchema.\n * Use `TaskConfigSchema` when building JSON schemas in subclasses.\n * Use this type when declaring the Config generic parameter.\n */\nexport type TaskConfig = Omit<BaseFromSchema, \"id\" | \"inputSchema\" | \"outputSchema\"> & {\n /** Unique identifier for the task (uuid4 by default) */\n id?: unknown;\n /** Dynamic input schema override for the task instance */\n inputSchema?: DataPortSchema;\n /** Dynamic output schema override for the task instance */\n outputSchema?: DataPortSchema;\n};\n\n/** Type for task ID */\nexport type TaskIdType = Task<TaskInput, TaskOutput, TaskConfig>[\"config\"][\"id\"];\n",
7
7
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { DirectedAcyclicGraph, EventEmitter, ServiceRegistry, uuid4 } from \"@workglow/util\";\nimport { TaskOutputRepository } from \"../storage/TaskOutputRepository\";\nimport type { ITask } from \"../task/ITask\";\nimport type { StreamEvent } from \"../task/StreamTypes\";\nimport { JsonTaskItem, TaskGraphJson } from \"../task/TaskJSON\";\nimport type { TaskIdType, TaskInput, TaskOutput, TaskStatus } from \"../task/TaskTypes\";\nimport { ensureTask, type PipeFunction } from \"./Conversions\";\nimport { Dataflow, type DataflowIdType } from \"./Dataflow\";\nimport type { ITaskGraph } from \"./ITaskGraph\";\nimport {\n EventTaskGraphToDagMapping,\n GraphEventDagEvents,\n GraphEventDagParameters,\n TaskGraphEventListener,\n TaskGraphEvents,\n TaskGraphEventStatusParameters,\n TaskGraphStatusEvents,\n TaskGraphStatusListeners,\n} from \"./TaskGraphEvents\";\nimport {\n CompoundMergeStrategy,\n GraphResult,\n type GraphResultArray,\n TaskGraphRunner,\n} from \"./TaskGraphRunner\";\n\n/**\n * Configuration for running a task graph\n */\nexport interface TaskGraphRunConfig {\n /** Optional output cache to use for this task graph */\n outputCache?: TaskOutputRepository | boolean;\n /** Optional signal to abort the task graph */\n parentSignal?: AbortSignal;\n /** Optional service registry to use for this task graph (creates child from global if not provided) */\n registry?: ServiceRegistry;\n /**\n * When true, streaming leaf tasks (no outgoing edges) accumulate their full\n * output so the workflow return value is complete. Defaults to true.\n * Pass false for subgraph runs where the parent handles streaming via\n * subscriptions and does not rely on the return value for stream data.\n */\n accumulateLeafOutputs?: boolean;\n}\n\nclass TaskGraphDAG extends DirectedAcyclicGraph<\n ITask<any, any, any>,\n Dataflow,\n TaskIdType,\n DataflowIdType\n> {\n constructor() {\n super(\n (task: ITask<any, any, any>) => task.config.id,\n (dataflow: Dataflow) => dataflow.id\n );\n }\n}\n\ninterface TaskGraphConstructorConfig {\n outputCache?: TaskOutputRepository;\n dag?: TaskGraphDAG;\n}\n\n/**\n * Represents a task graph, a directed acyclic graph of tasks and data flows\n */\nexport class TaskGraph implements ITaskGraph {\n /** Optional output cache to use for this task graph */\n public outputCache?: TaskOutputRepository;\n\n /**\n * Constructor for TaskGraph\n * @param config Configuration for the task graph\n */\n constructor({ outputCache, dag }: TaskGraphConstructorConfig = {}) {\n this.outputCache = outputCache;\n this._dag = dag || new TaskGraphDAG();\n }\n\n private _dag: TaskGraphDAG;\n\n private _runner: TaskGraphRunner | undefined;\n public get runner(): TaskGraphRunner {\n if (!this._runner) {\n this._runner = new TaskGraphRunner(this, this.outputCache);\n }\n return this._runner;\n }\n\n // ========================================================================\n // Public methods\n // ========================================================================\n\n /**\n * Runs the task graph\n * @param config Configuration for the graph run\n * @returns A promise that resolves when all tasks are complete\n * @throws TaskError if any tasks have failed\n */\n public run<ExecuteOutput extends TaskOutput>(\n input: TaskInput = {} as TaskInput,\n config: TaskGraphRunConfig = {}\n ): Promise<GraphResultArray<ExecuteOutput>> {\n return this.runner.runGraph<ExecuteOutput>(input, {\n outputCache: config?.outputCache || this.outputCache,\n parentSignal: config?.parentSignal || undefined,\n accumulateLeafOutputs: config?.accumulateLeafOutputs,\n });\n }\n\n /**\n * Runs the task graph reactively\n * @returns A promise that resolves when all tasks are complete\n * @throws TaskError if any tasks have failed\n */\n public runReactive<Output extends TaskOutput>(\n input: TaskInput = {} as TaskInput\n ): Promise<GraphResultArray<Output>> {\n return this.runner.runGraphReactive<Output>(input);\n }\n\n /**\n * Merges the execute output to the run output\n * @param results The execute output\n * @param compoundMerge The compound merge strategy to use\n * @returns The run output\n */\n\n public mergeExecuteOutputsToRunOutput<\n ExecuteOutput extends TaskOutput,\n Merge extends CompoundMergeStrategy = CompoundMergeStrategy,\n >(\n results: GraphResultArray<ExecuteOutput>,\n compoundMerge: Merge\n ): GraphResult<ExecuteOutput, Merge> {\n return this.runner.mergeExecuteOutputsToRunOutput(results, compoundMerge);\n }\n\n /**\n * Aborts the task graph\n */\n public abort() {\n this.runner.abort();\n }\n\n /**\n * Disables the task graph\n */\n public async disable() {\n await this.runner.disable();\n }\n\n /**\n * Retrieves a task from the task graph by its id\n * @param id The id of the task to retrieve\n * @returns The task with the given id, or undefined if not found\n */\n public getTask(id: TaskIdType): ITask<any, any, any> | undefined {\n return this._dag.getNode(id);\n }\n\n /**\n * Retrieves all tasks in the task graph\n * @returns An array of tasks in the task graph\n */\n public getTasks(): ITask<any, any, any>[] {\n return this._dag.getNodes();\n }\n\n /**\n * Retrieves all tasks in the task graph topologically sorted\n * @returns An array of tasks in the task graph topologically sorted\n */\n public topologicallySortedNodes(): ITask<any, any, any>[] {\n return this._dag.topologicallySortedNodes();\n }\n\n /**\n * Adds a task to the task graph\n * @param task The task to add\n * @returns The current task graph\n */\n public addTask(fn: PipeFunction<any, any>, config?: any): unknown;\n public addTask(task: ITask<any, any, any>): unknown;\n public addTask(task: ITask<any, any, any> | PipeFunction<any, any>, config?: any): unknown {\n return this._dag.addNode(ensureTask(task, config));\n }\n\n /**\n * Adds multiple tasks to the task graph\n * @param tasks The tasks to add\n * @returns The current task graph\n */\n public addTasks(tasks: PipeFunction<any, any>[]): unknown[];\n public addTasks(tasks: ITask<any, any, any>[]): unknown[];\n public addTasks(tasks: ITask<any, any, any>[] | PipeFunction<any, any>[]): unknown[] {\n return this._dag.addNodes(tasks.map(ensureTask));\n }\n\n /**\n * Adds a data flow to the task graph\n * @param dataflow The data flow to add\n * @returns The current task graph\n */\n public addDataflow(dataflow: Dataflow) {\n return this._dag.addEdge(dataflow.sourceTaskId, dataflow.targetTaskId, dataflow);\n }\n\n /**\n * Adds multiple data flows to the task graph\n * @param dataflows The data flows to add\n * @returns The current task graph\n */\n public addDataflows(dataflows: Dataflow[]) {\n const addedEdges = dataflows.map<[s: unknown, t: unknown, e: Dataflow]>((edge) => {\n return [edge.sourceTaskId, edge.targetTaskId, edge];\n });\n return this._dag.addEdges(addedEdges);\n }\n\n /**\n * Retrieves a data flow from the task graph by its id\n * @param id The id of the data flow to retrieve\n * @returns The data flow with the given id, or undefined if not found\n */\n public getDataflow(id: DataflowIdType): Dataflow | undefined {\n // @ts-ignore\n for (const i in this._dag.adjacency) {\n // @ts-ignore\n for (const j in this._dag.adjacency[i]) {\n // @ts-ignore\n const maybeEdges = this._dag.adjacency[i][j];\n if (maybeEdges !== null) {\n for (const edge of maybeEdges) {\n // @ts-ignore\n if (this._dag.edgeIdentity(edge, \"\", \"\") == id) {\n return edge;\n }\n }\n }\n }\n }\n }\n\n /**\n * Retrieves all data flows in the task graph\n * @returns An array of data flows in the task graph\n */\n public getDataflows(): Dataflow[] {\n return this._dag.getEdges().map((edge) => edge[2]);\n }\n\n /**\n * Removes a data flow from the task graph\n * @param dataflow The data flow to remove\n * @returns The current task graph\n */\n public removeDataflow(dataflow: Dataflow) {\n return this._dag.removeEdge(dataflow.sourceTaskId, dataflow.targetTaskId, dataflow.id);\n }\n\n /**\n * Retrieves the data flows that are sources of a given task\n * @param taskId The id of the task to retrieve sources for\n * @returns An array of data flows that are sources of the given task\n */\n public getSourceDataflows(taskId: unknown): Dataflow[] {\n return this._dag.inEdges(taskId).map(([, , dataflow]) => dataflow);\n }\n\n /**\n * Retrieves the data flows that are targets of a given task\n * @param taskId The id of the task to retrieve targets for\n * @returns An array of data flows that are targets of the given task\n */\n public getTargetDataflows(taskId: unknown): Dataflow[] {\n return this._dag.outEdges(taskId).map(([, , dataflow]) => dataflow);\n }\n\n /**\n * Retrieves the tasks that are sources of a given task\n * @param taskId The id of the task to retrieve sources for\n * @returns An array of tasks that are sources of the given task\n */\n public getSourceTasks(taskId: unknown): ITask<any, any, any>[] {\n return this.getSourceDataflows(taskId).map((dataflow) => this.getTask(dataflow.sourceTaskId)!);\n }\n\n /**\n * Retrieves the tasks that are targets of a given task\n * @param taskId The id of the task to retrieve targets for\n * @returns An array of tasks that are targets of the given task\n */\n public getTargetTasks(taskId: unknown): ITask<any, any, any>[] {\n return this.getTargetDataflows(taskId).map((dataflow) => this.getTask(dataflow.targetTaskId)!);\n }\n\n /**\n * Removes a task from the task graph\n * @param taskId The id of the task to remove\n * @returns The current task graph\n */\n public removeTask(taskId: unknown) {\n return this._dag.removeNode(taskId);\n }\n\n public resetGraph() {\n this.runner.resetGraph(this, uuid4());\n }\n\n /**\n * Converts the task graph to a JSON format suitable for dependency tracking\n * @returns An array of JsonTaskItem objects, each representing a task and its dependencies\n */\n public toJSON(): TaskGraphJson {\n const tasks = this.getTasks().map((node) => node.toJSON());\n const dataflows = this.getDataflows().map((df) => df.toJSON());\n return {\n tasks,\n dataflows,\n };\n }\n\n /**\n * Converts the task graph to a JSON format suitable for dependency tracking\n * @returns An array of JsonTaskItem objects, each representing a task and its dependencies\n */\n public toDependencyJSON(): JsonTaskItem[] {\n const tasks = this.getTasks().flatMap((node) => node.toDependencyJSON());\n this.getDataflows().forEach((df) => {\n const target = tasks.find((node) => node.id === df.targetTaskId)!;\n if (!target.dependencies) {\n target.dependencies = {};\n }\n const targetDeps = target.dependencies[df.targetTaskPortId];\n if (!targetDeps) {\n target.dependencies[df.targetTaskPortId] = {\n id: df.sourceTaskId,\n output: df.sourceTaskPortId,\n };\n } else {\n if (Array.isArray(targetDeps)) {\n targetDeps.push({\n id: df.sourceTaskId,\n output: df.sourceTaskPortId,\n });\n } else {\n target.dependencies[df.targetTaskPortId] = [\n targetDeps,\n { id: df.sourceTaskId, output: df.sourceTaskPortId },\n ];\n }\n }\n });\n return tasks;\n }\n\n // ========================================================================\n // Event handling\n // ========================================================================\n\n /**\n * Event emitter for task lifecycle events\n */\n public get events(): EventEmitter<TaskGraphStatusListeners> {\n if (!this._events) {\n this._events = new EventEmitter<TaskGraphStatusListeners>();\n }\n return this._events;\n }\n protected _events: EventEmitter<TaskGraphStatusListeners> | undefined;\n\n /**\n * Subscribes to an event\n * @param name - The event name to listen for\n * @param fn - The callback function to execute when the event occurs\n * @returns a function to unsubscribe from the event\n */\n public subscribe<Event extends TaskGraphEvents>(\n name: Event,\n fn: TaskGraphEventListener<Event>\n ): () => void {\n this.on(name, fn);\n return () => this.off(name, fn);\n }\n\n /**\n * Subscribes to status changes on all tasks (existing and future)\n * @param callback - Function called when any task's status changes\n * @param callback.taskId - The ID of the task whose status changed\n * @param callback.status - The new status of the task\n * @returns a function to unsubscribe from all task status events\n */\n public subscribeToTaskStatus(\n callback: (taskId: TaskIdType, status: TaskStatus) => void\n ): () => void {\n const unsubscribes: (() => void)[] = [];\n\n // Subscribe to status events on all existing tasks\n const tasks = this.getTasks();\n tasks.forEach((task) => {\n const unsub = task.subscribe(\"status\", (status) => {\n callback(task.config.id, status);\n });\n unsubscribes.push(unsub);\n });\n\n const handleTaskAdded = (taskId: TaskIdType) => {\n const task = this.getTask(taskId);\n if (!task || typeof task.subscribe !== \"function\") return;\n\n const unsub = task.subscribe(\"status\", (status) => {\n callback(task.config.id, status);\n });\n unsubscribes.push(unsub);\n };\n\n const graphUnsub = this.subscribe(\"task_added\", handleTaskAdded);\n unsubscribes.push(graphUnsub);\n\n // Return unsubscribe function\n return () => {\n unsubscribes.forEach((unsub) => unsub());\n };\n }\n\n /**\n * Subscribes to progress updates on all tasks (existing and future)\n * @param callback - Function called when any task reports progress\n * @param callback.taskId - The ID of the task reporting progress\n * @param callback.progress - The progress value (0-100)\n * @param callback.message - Optional progress message\n * @param callback.args - Additional arguments passed with the progress update\n * @returns a function to unsubscribe from all task progress events\n */\n public subscribeToTaskProgress(\n callback: (taskId: TaskIdType, progress: number, message?: string, ...args: any[]) => void\n ): () => void {\n const unsubscribes: (() => void)[] = [];\n\n // Subscribe to progress events on all existing tasks\n const tasks = this.getTasks();\n tasks.forEach((task) => {\n const unsub = task.subscribe(\"progress\", (progress, message, ...args) => {\n callback(task.config.id, progress, message, ...args);\n });\n unsubscribes.push(unsub);\n });\n\n const handleTaskAdded = (taskId: TaskIdType) => {\n const task = this.getTask(taskId);\n if (!task || typeof task.subscribe !== \"function\") return;\n\n const unsub = task.subscribe(\"progress\", (progress, message, ...args) => {\n callback(task.config.id, progress, message, ...args);\n });\n unsubscribes.push(unsub);\n };\n\n const graphUnsub = this.subscribe(\"task_added\", handleTaskAdded);\n unsubscribes.push(graphUnsub);\n\n // Return unsubscribe function\n return () => {\n unsubscribes.forEach((unsub) => unsub());\n };\n }\n\n /**\n * Subscribes to status changes on all dataflows (existing and future)\n * @param callback - Function called when any dataflow's status changes\n * @param callback.dataflowId - The ID of the dataflow whose status changed\n * @param callback.status - The new status of the dataflow\n * @returns a function to unsubscribe from all dataflow status events\n */\n public subscribeToDataflowStatus(\n callback: (dataflowId: DataflowIdType, status: TaskStatus) => void\n ): () => void {\n const unsubscribes: (() => void)[] = [];\n\n // Subscribe to status events on all existing dataflows\n const dataflows = this.getDataflows();\n dataflows.forEach((dataflow) => {\n const unsub = dataflow.subscribe(\"status\", (status) => {\n callback(dataflow.id, status);\n });\n unsubscribes.push(unsub);\n });\n\n const handleDataflowAdded = (dataflowId: DataflowIdType) => {\n const dataflow = this.getDataflow(dataflowId);\n if (!dataflow || typeof dataflow.subscribe !== \"function\") return;\n\n const unsub = dataflow.subscribe(\"status\", (status) => {\n callback(dataflow.id, status);\n });\n unsubscribes.push(unsub);\n };\n\n const graphUnsub = this.subscribe(\"dataflow_added\", handleDataflowAdded);\n unsubscribes.push(graphUnsub);\n\n // Return unsubscribe function\n return () => {\n unsubscribes.forEach((unsub) => unsub());\n };\n }\n\n /**\n * Subscribes to streaming events on the task graph.\n * Listens for task_stream_start, task_stream_chunk, and task_stream_end\n * events emitted by the TaskGraphRunner during streaming task execution.\n *\n * @param callbacks - Object with optional callbacks for each streaming event\n * @returns a function to unsubscribe from all streaming events\n */\n public subscribeToTaskStreaming(callbacks: {\n onStreamStart?: (taskId: TaskIdType) => void;\n onStreamChunk?: (taskId: TaskIdType, event: StreamEvent) => void;\n onStreamEnd?: (taskId: TaskIdType, output: Record<string, any>) => void;\n }): () => void {\n const unsubscribes: (() => void)[] = [];\n\n if (callbacks.onStreamStart) {\n const unsub = this.subscribe(\"task_stream_start\", callbacks.onStreamStart);\n unsubscribes.push(unsub);\n }\n\n if (callbacks.onStreamChunk) {\n const unsub = this.subscribe(\"task_stream_chunk\", callbacks.onStreamChunk);\n unsubscribes.push(unsub);\n }\n\n if (callbacks.onStreamEnd) {\n const unsub = this.subscribe(\"task_stream_end\", callbacks.onStreamEnd);\n unsubscribes.push(unsub);\n }\n\n return () => {\n unsubscribes.forEach((unsub) => unsub());\n };\n }\n\n /**\n * Registers an event listener for the specified event\n * @param name - The event name to listen for\n * @param fn - The callback function to execute when the event occurs\n */\n on<Event extends TaskGraphEvents>(name: Event, fn: TaskGraphEventListener<Event>) {\n const dagEvent = EventTaskGraphToDagMapping[name as keyof typeof EventTaskGraphToDagMapping];\n if (dagEvent) {\n // Safe cast: TaskGraph dag events (task_added, etc.) have the same signature as\n // the underlying DAG events (node-added, etc.) - both pass IDs, not full objects\n return this._dag.on(dagEvent, fn as Parameters<typeof this._dag.on>[1]);\n }\n return this.events.on(\n name as TaskGraphStatusEvents,\n fn as TaskGraphEventListener<TaskGraphStatusEvents>\n );\n }\n\n /**\n * Removes an event listener for the specified event\n * @param name - The event name to listen for\n * @param fn - The callback function to execute when the event occurs\n */\n off<Event extends TaskGraphEvents>(name: Event, fn: TaskGraphEventListener<Event>) {\n const dagEvent = EventTaskGraphToDagMapping[name as keyof typeof EventTaskGraphToDagMapping];\n if (dagEvent) {\n // Safe cast: TaskGraph dag events (task_added, etc.) have the same signature as\n // the underlying DAG events (node-added, etc.) - both pass IDs, not full objects\n return this._dag.off(dagEvent, fn as Parameters<typeof this._dag.off>[1]);\n }\n return this.events.off(\n name as TaskGraphStatusEvents,\n fn as TaskGraphEventListener<TaskGraphStatusEvents>\n );\n }\n\n /**\n * Emits an event for the specified event\n * @param name - The event name to emit\n * @param args - The arguments to pass to the event listener\n */\n emit<E extends GraphEventDagEvents>(name: E, ...args: GraphEventDagParameters<E>): void;\n emit<E extends TaskGraphStatusEvents>(name: E, ...args: TaskGraphEventStatusParameters<E>): void;\n emit(name: string, ...args: any[]): void {\n const dagEvent = EventTaskGraphToDagMapping[name as keyof typeof EventTaskGraphToDagMapping];\n if (dagEvent) {\n // @ts-ignore\n return this.emit_dag(name, ...args);\n } else {\n // @ts-ignore\n return this.emit_local(name, ...args);\n }\n }\n\n /**\n * Emits an event for the specified event\n * @param name - The event name to emit\n * @param args - The arguments to pass to the event listener\n */\n protected emit_local<Event extends TaskGraphStatusEvents>(\n name: Event,\n ...args: TaskGraphEventStatusParameters<Event>\n ) {\n return this.events?.emit(name, ...args);\n }\n\n /**\n * Emits an event for the specified event\n * @param name - The event name to emit\n * @param args - The arguments to pass to the event listener\n */\n protected emit_dag<Event extends GraphEventDagEvents>(\n name: Event,\n ...args: GraphEventDagParameters<Event>\n ) {\n const dagEvent = EventTaskGraphToDagMapping[name as keyof typeof EventTaskGraphToDagMapping];\n // Safe cast: GraphEventDagParameters matches the DAG's emit parameters (both are ID-based)\n return this._dag.emit(dagEvent, ...(args as unknown as [unknown]));\n }\n}\n\n/**\n * Super simple helper if you know the input and output handles, and there is only one each\n *\n * @param tasks\n * @param inputHandle\n * @param outputHandle\n * @returns\n */\nfunction serialGraphEdges(\n tasks: ITask<any, any, any>[],\n inputHandle: string,\n outputHandle: string\n): Dataflow[] {\n const edges: Dataflow[] = [];\n for (let i = 0; i < tasks.length - 1; i++) {\n edges.push(new Dataflow(tasks[i].config.id, inputHandle, tasks[i + 1].config.id, outputHandle));\n }\n return edges;\n}\n\n/**\n * Super simple helper if you know the input and output handles, and there is only one each\n *\n * @param tasks\n * @param inputHandle\n * @param outputHandle\n * @returns\n */\nexport function serialGraph(\n tasks: ITask<any, any, any>[],\n inputHandle: string,\n outputHandle: string\n): TaskGraph {\n const graph = new TaskGraph();\n graph.addTasks(tasks);\n graph.addDataflows(serialGraphEdges(tasks, inputHandle, outputHandle));\n return graph;\n}\n",
8
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DataPortSchema } from \"@workglow/util\";\nimport { compileSchema, SchemaNode } from \"@workglow/util\";\nimport { DATAFLOW_ALL_PORTS } from \"../task-graph/Dataflow\";\nimport { TaskGraph } from \"../task-graph/TaskGraph\";\nimport { CompoundMergeStrategy, PROPERTY_ARRAY } from \"../task-graph/TaskGraphRunner\";\nimport { GraphAsTaskRunner } from \"./GraphAsTaskRunner\";\nimport type { IExecuteContext } from \"./ITask\";\nimport type { StreamEvent, StreamFinish } from \"./StreamTypes\";\nimport { Task } from \"./Task\";\nimport type { JsonTaskItem, TaskGraphItemJson } from \"./TaskJSON\";\nimport {\n TaskConfigSchema,\n type TaskConfig,\n type TaskIdType,\n type TaskInput,\n type TaskOutput,\n type TaskTypeName,\n} from \"./TaskTypes\";\n\nexport const graphAsTaskConfigSchema = {\n type: \"object\",\n properties: {\n ...TaskConfigSchema[\"properties\"],\n compoundMerge: { type: \"string\" },\n },\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type GraphAsTaskConfig = TaskConfig & {\n /** subGraph is extracted in the constructor before validation — not in the JSON schema */\n subGraph?: TaskGraph;\n compoundMerge?: CompoundMergeStrategy;\n};\n\n/**\n * A task that contains a subgraph of tasks\n */\nexport class GraphAsTask<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends GraphAsTaskConfig = GraphAsTaskConfig,\n> extends Task<Input, Output, Config> {\n // ========================================================================\n // Static properties - should be overridden by subclasses\n // ========================================================================\n\n public static type: TaskTypeName = \"GraphAsTask\";\n public static title: string = \"Group\";\n public static description: string = \"A group of tasks that are executed together\";\n public static category: string = \"Flow Control\";\n public static compoundMerge: CompoundMergeStrategy = PROPERTY_ARRAY;\n\n /** This task has dynamic schemas that change based on the subgraph structure */\n public static hasDynamicSchemas: boolean = true;\n\n // ========================================================================\n // Constructor\n // ========================================================================\n\n constructor(input: Partial<Input> = {}, config: Partial<Config> = {}) {\n const { subGraph, ...rest } = config;\n super(input, rest as Config);\n if (subGraph) {\n this.subGraph = subGraph;\n }\n this.regenerateGraph();\n }\n\n // ========================================================================\n // TaskRunner delegation - Executes and manages the task\n // ========================================================================\n\n declare _runner: GraphAsTaskRunner<Input, Output, Config>;\n\n /**\n * Task runner for handling the task execution\n */\n override get runner(): GraphAsTaskRunner<Input, Output, Config> {\n if (!this._runner) {\n this._runner = new GraphAsTaskRunner<Input, Output, Config>(this);\n }\n return this._runner;\n }\n\n // ========================================================================\n // Static to Instance conversion methods\n // ========================================================================\n\n public static configSchema(): DataPortSchema {\n return graphAsTaskConfigSchema;\n }\n\n public get compoundMerge(): CompoundMergeStrategy {\n return this.config?.compoundMerge || (this.constructor as typeof GraphAsTask).compoundMerge;\n }\n\n public get cacheable(): boolean {\n return (\n this.runConfig?.cacheable ??\n this.config?.cacheable ??\n ((this.constructor as typeof GraphAsTask).cacheable && !this.hasChildren())\n );\n }\n\n // ========================================================================\n // Input/Output handling\n // ========================================================================\n\n /**\n * Override inputSchema to compute it dynamically from the subgraph at runtime\n * The input schema is the union of all unconnected inputs from starting nodes\n * (nodes with zero incoming connections)\n */\n public inputSchema(): DataPortSchema {\n // If there's no subgraph or it has no children, fall back to the static schema\n if (!this.hasChildren()) {\n return (this.constructor as typeof Task).inputSchema();\n }\n\n const properties: Record<string, any> = {};\n const required: string[] = [];\n\n // Get all tasks in the graph\n const tasks = this.subGraph.getTasks();\n\n // Identify starting nodes: tasks with no incoming dataflows\n const startingNodes = tasks.filter(\n (task) => this.subGraph.getSourceDataflows(task.config.id).length === 0\n );\n\n // For starting nodes only, collect their unconnected inputs\n for (const task of startingNodes) {\n const taskInputSchema = task.inputSchema();\n if (typeof taskInputSchema === \"boolean\") {\n if (taskInputSchema === false) {\n continue;\n }\n if (taskInputSchema === true) {\n properties[DATAFLOW_ALL_PORTS] = {};\n continue;\n }\n }\n const taskProperties = taskInputSchema.properties || {};\n\n // Add all inputs from starting nodes to the graph's input schema\n for (const [inputName, inputProp] of Object.entries(taskProperties)) {\n // If the same input name exists in multiple nodes, we use the first one\n // In a more sophisticated implementation, we might want to merge or validate compatibility\n if (!properties[inputName]) {\n properties[inputName] = inputProp;\n\n // Check if this input is required\n if (taskInputSchema.required && taskInputSchema.required.includes(inputName)) {\n required.push(inputName);\n }\n }\n }\n }\n\n return {\n type: \"object\",\n properties,\n ...(required.length > 0 ? { required } : {}),\n additionalProperties: false,\n } as const satisfies DataPortSchema;\n }\n\n protected _inputSchemaNode: SchemaNode | undefined;\n /**\n * Gets the compiled input schema\n */\n protected override getInputSchemaNode(type: TaskTypeName): SchemaNode {\n // every graph as task is different, so we need to compile the schema for each one\n if (!this._inputSchemaNode) {\n const dataPortSchema = this.inputSchema();\n const schemaNode = Task.generateInputSchemaNode(dataPortSchema);\n try {\n this._inputSchemaNode = schemaNode;\n } catch (error) {\n // If compilation fails, fall back to accepting any object structure\n // This is a safety net for schemas that json-schema-library can't compile\n console.warn(\n `Failed to compile input schema for ${type}, falling back to permissive validation:`,\n error\n );\n this._inputSchemaNode = compileSchema({});\n }\n }\n return this._inputSchemaNode!;\n }\n\n /**\n * Calculates the depth (longest path from any starting node) for each task in the graph\n * @returns A map of task IDs to their depths\n */\n private calculateNodeDepths(): Map<TaskIdType, number> {\n const depths = new Map<TaskIdType, number>();\n const tasks = this.subGraph.getTasks();\n\n // Initialize all depths to 0\n for (const task of tasks) {\n depths.set(task.config.id, 0);\n }\n\n // Use topological sort to calculate depths in order\n const sortedTasks = this.subGraph.topologicallySortedNodes();\n\n for (const task of sortedTasks) {\n const currentDepth = depths.get(task.config.id) || 0;\n const targetTasks = this.subGraph.getTargetTasks(task.config.id);\n\n // Update depths of all target tasks\n for (const targetTask of targetTasks) {\n const targetDepth = depths.get(targetTask.config.id) || 0;\n depths.set(targetTask.config.id, Math.max(targetDepth, currentDepth + 1));\n }\n }\n\n return depths;\n }\n\n /**\n * Override outputSchema to compute it dynamically from the subgraph at runtime\n * The output schema depends on the compoundMerge strategy and the nodes at the last level\n */\n public override outputSchema(): DataPortSchema {\n // If there's no subgraph or it has no children, fall back to the static schema\n if (!this.hasChildren()) {\n return (this.constructor as typeof Task).outputSchema();\n }\n\n const properties: Record<string, any> = {};\n const required: string[] = [];\n\n // Find all ending nodes (nodes with no outgoing dataflows)\n const tasks = this.subGraph.getTasks();\n const endingNodes = tasks.filter(\n (task) => this.subGraph.getTargetDataflows(task.config.id).length === 0\n );\n\n // Calculate depths for all nodes\n const depths = this.calculateNodeDepths();\n\n // Find the maximum depth among ending nodes\n const maxDepth = Math.max(...endingNodes.map((task) => depths.get(task.config.id) || 0));\n\n // Filter ending nodes to only those at the maximum depth (last level)\n const lastLevelNodes = endingNodes.filter((task) => depths.get(task.config.id) === maxDepth);\n\n // ONLY handle PROPERTY_ARRAY strategy\n // Count how many ending nodes produce each property\n const propertyCount: Record<string, number> = {};\n const propertySchema: Record<string, any> = {};\n\n for (const task of lastLevelNodes) {\n const taskOutputSchema = task.outputSchema();\n if (typeof taskOutputSchema === \"boolean\") {\n if (taskOutputSchema === false) {\n continue;\n }\n if (taskOutputSchema === true) {\n properties[DATAFLOW_ALL_PORTS] = {};\n continue;\n }\n }\n const taskProperties = taskOutputSchema.properties || {};\n\n for (const [outputName, outputProp] of Object.entries(taskProperties)) {\n propertyCount[outputName] = (propertyCount[outputName] || 0) + 1;\n // Store the first schema we encounter for each property\n if (!propertySchema[outputName]) {\n propertySchema[outputName] = outputProp;\n }\n }\n }\n\n // Build the final schema: properties produced by multiple nodes become arrays\n for (const [outputName, count] of Object.entries(propertyCount)) {\n const outputProp = propertySchema[outputName];\n\n if (lastLevelNodes.length === 1) {\n // Single ending node: use property as-is\n properties[outputName] = outputProp;\n } else {\n // Multiple ending nodes: all properties become arrays due to collectPropertyValues\n properties[outputName] = {\n type: \"array\",\n items: outputProp as any,\n };\n }\n }\n\n return {\n type: \"object\",\n properties,\n ...(required.length > 0 ? { required } : {}),\n additionalProperties: false,\n } as DataPortSchema;\n }\n\n /**\n * Resets input data to defaults\n */\n public resetInputData(): void {\n super.resetInputData();\n if (this.hasChildren()) {\n this.subGraph!.getTasks().forEach((node) => {\n node.resetInputData();\n });\n this.subGraph!.getDataflows().forEach((dataflow) => {\n dataflow.reset();\n });\n }\n }\n\n // ========================================================================\n // Streaming pass-through\n // ========================================================================\n\n /**\n * Stream pass-through for compound tasks: runs the subgraph and forwards\n * streaming events from ending nodes to the outer graph. Also re-yields\n * any input streams from upstream for cases where this GraphAsTask is\n * itself downstream of another streaming task.\n */\n async *executeStream(input: Input, context: IExecuteContext): AsyncIterable<StreamEvent<Output>> {\n // Forward upstream input streams first (pass-through from outer graph)\n if (context.inputStreams) {\n for (const [, stream] of context.inputStreams) {\n const reader = stream.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n if (value.type === \"finish\") continue;\n yield value as StreamEvent<Output>;\n }\n } finally {\n reader.releaseLock();\n }\n }\n }\n\n // Run the subgraph and forward streaming events from ending nodes\n if (this.hasChildren()) {\n const endingNodeIds = new Set<unknown>();\n const tasks = this.subGraph.getTasks();\n for (const task of tasks) {\n if (this.subGraph.getTargetDataflows(task.config.id).length === 0) {\n endingNodeIds.add(task.config.id);\n }\n }\n\n const eventQueue: StreamEvent<Output>[] = [];\n let resolveWaiting: (() => void) | undefined;\n let subgraphDone = false;\n\n const unsub = this.subGraph.subscribeToTaskStreaming({\n onStreamChunk: (taskId, event) => {\n if (endingNodeIds.has(taskId) && event.type !== \"finish\") {\n eventQueue.push(event as StreamEvent<Output>);\n resolveWaiting?.();\n }\n },\n });\n\n const runPromise = this.subGraph\n .run<Output>(input, { parentSignal: context.signal, accumulateLeafOutputs: false })\n .then((results) => {\n subgraphDone = true;\n resolveWaiting?.();\n return results;\n });\n\n // Yield events as they arrive from ending nodes\n while (!subgraphDone) {\n if (eventQueue.length === 0) {\n await new Promise<void>((resolve) => {\n resolveWaiting = resolve;\n });\n }\n while (eventQueue.length > 0) {\n yield eventQueue.shift()!;\n }\n }\n // Drain any remaining events\n while (eventQueue.length > 0) {\n yield eventQueue.shift()!;\n }\n\n unsub();\n\n const results = await runPromise;\n const mergedOutput = this.subGraph.mergeExecuteOutputsToRunOutput(\n results,\n this.compoundMerge\n ) as Output;\n yield { type: \"finish\", data: mergedOutput } as StreamFinish<Output>;\n } else {\n yield { type: \"finish\", data: input as unknown as Output } as StreamFinish<Output>;\n }\n }\n\n // ========================================================================\n // Compound task methods\n // ========================================================================\n\n /**\n * Regenerates the subtask graph and emits a \"regenerate\" event\n *\n * Subclasses should override this method to implement the actual graph\n * regeneration logic, but all they need to do is call this method to\n * emit the \"regenerate\" event.\n */\n public regenerateGraph(): void {\n this._inputSchemaNode = undefined;\n this.events.emit(\"regenerate\");\n }\n\n // ========================================================================\n // Serialization methods\n // ========================================================================\n\n /**\n * Serializes the task and its subtasks into a format that can be stored\n * @returns The serialized task and subtasks\n */\n public toJSON(): TaskGraphItemJson {\n let json = super.toJSON();\n const hasChildren = this.hasChildren();\n if (hasChildren) {\n json = {\n ...json,\n merge: this.compoundMerge,\n subgraph: this.subGraph!.toJSON(),\n };\n }\n return json;\n }\n\n /**\n * Converts the task to a JSON format suitable for dependency tracking\n * @returns The task and subtasks in JSON thats easier for humans to read\n */\n public toDependencyJSON(): JsonTaskItem {\n const json = this.toJSON();\n if (this.hasChildren()) {\n if (\"subgraph\" in json) {\n delete json.subgraph;\n }\n return { ...json, subtasks: this.subGraph!.toDependencyJSON() };\n }\n return json;\n }\n}\n",
8
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DataPortSchema } from \"@workglow/util\";\nimport { compileSchema, SchemaNode } from \"@workglow/util\";\nimport { DATAFLOW_ALL_PORTS } from \"../task-graph/Dataflow\";\nimport { TaskGraph } from \"../task-graph/TaskGraph\";\nimport { CompoundMergeStrategy, PROPERTY_ARRAY } from \"../task-graph/TaskGraphRunner\";\nimport { GraphAsTaskRunner } from \"./GraphAsTaskRunner\";\nimport type { IExecuteContext } from \"./ITask\";\nimport type { StreamEvent, StreamFinish } from \"./StreamTypes\";\nimport { Task } from \"./Task\";\nimport type { JsonTaskItem, TaskGraphItemJson } from \"./TaskJSON\";\nimport {\n TaskConfigSchema,\n type TaskConfig,\n type TaskIdType,\n type TaskInput,\n type TaskOutput,\n type TaskTypeName,\n} from \"./TaskTypes\";\n\nexport const graphAsTaskConfigSchema = {\n type: \"object\",\n properties: {\n ...TaskConfigSchema[\"properties\"],\n compoundMerge: { type: \"string\", \"x-ui-hidden\": true },\n },\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\nexport type GraphAsTaskConfig = TaskConfig & {\n /** subGraph is extracted in the constructor before validation — not in the JSON schema */\n subGraph?: TaskGraph;\n compoundMerge?: CompoundMergeStrategy;\n};\n\n/**\n * A task that contains a subgraph of tasks\n */\nexport class GraphAsTask<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends GraphAsTaskConfig = GraphAsTaskConfig,\n> extends Task<Input, Output, Config> {\n // ========================================================================\n // Static properties - should be overridden by subclasses\n // ========================================================================\n\n public static type: TaskTypeName = \"GraphAsTask\";\n public static title: string = \"Group\";\n public static description: string = \"A group of tasks that are executed together\";\n public static category: string = \"Flow Control\";\n public static compoundMerge: CompoundMergeStrategy = PROPERTY_ARRAY;\n\n /** This task has dynamic schemas that change based on the subgraph structure */\n public static hasDynamicSchemas: boolean = true;\n\n // ========================================================================\n // Constructor\n // ========================================================================\n\n constructor(input: Partial<Input> = {}, config: Partial<Config> = {}) {\n const { subGraph, ...rest } = config;\n super(input, rest as Config);\n if (subGraph) {\n this.subGraph = subGraph;\n }\n this.regenerateGraph();\n }\n\n // ========================================================================\n // TaskRunner delegation - Executes and manages the task\n // ========================================================================\n\n declare _runner: GraphAsTaskRunner<Input, Output, Config>;\n\n /**\n * Task runner for handling the task execution\n */\n override get runner(): GraphAsTaskRunner<Input, Output, Config> {\n if (!this._runner) {\n this._runner = new GraphAsTaskRunner<Input, Output, Config>(this);\n }\n return this._runner;\n }\n\n // ========================================================================\n // Static to Instance conversion methods\n // ========================================================================\n\n public static configSchema(): DataPortSchema {\n return graphAsTaskConfigSchema;\n }\n\n public get compoundMerge(): CompoundMergeStrategy {\n return this.config?.compoundMerge || (this.constructor as typeof GraphAsTask).compoundMerge;\n }\n\n public get cacheable(): boolean {\n return (\n this.runConfig?.cacheable ??\n this.config?.cacheable ??\n ((this.constructor as typeof GraphAsTask).cacheable && !this.hasChildren())\n );\n }\n\n // ========================================================================\n // Input/Output handling\n // ========================================================================\n\n /**\n * Override inputSchema to compute it dynamically from the subgraph at runtime\n * The input schema is the union of all unconnected inputs from starting nodes\n * (nodes with zero incoming connections)\n */\n public inputSchema(): DataPortSchema {\n // If there's no subgraph or it has no children, fall back to the static schema\n if (!this.hasChildren()) {\n return (this.constructor as typeof Task).inputSchema();\n }\n\n const properties: Record<string, any> = {};\n const required: string[] = [];\n\n // Get all tasks in the graph\n const tasks = this.subGraph.getTasks();\n\n // Identify starting nodes: tasks with no incoming dataflows\n const startingNodes = tasks.filter(\n (task) => this.subGraph.getSourceDataflows(task.config.id).length === 0\n );\n\n // For starting nodes only, collect their unconnected inputs\n for (const task of startingNodes) {\n const taskInputSchema = task.inputSchema();\n if (typeof taskInputSchema === \"boolean\") {\n if (taskInputSchema === false) {\n continue;\n }\n if (taskInputSchema === true) {\n properties[DATAFLOW_ALL_PORTS] = {};\n continue;\n }\n }\n const taskProperties = taskInputSchema.properties || {};\n\n // Add all inputs from starting nodes to the graph's input schema\n for (const [inputName, inputProp] of Object.entries(taskProperties)) {\n // If the same input name exists in multiple nodes, we use the first one\n // In a more sophisticated implementation, we might want to merge or validate compatibility\n if (!properties[inputName]) {\n properties[inputName] = inputProp;\n\n // Check if this input is required\n if (taskInputSchema.required && taskInputSchema.required.includes(inputName)) {\n required.push(inputName);\n }\n }\n }\n }\n\n return {\n type: \"object\",\n properties,\n ...(required.length > 0 ? { required } : {}),\n additionalProperties: false,\n } as const satisfies DataPortSchema;\n }\n\n protected _inputSchemaNode: SchemaNode | undefined;\n /**\n * Gets the compiled input schema\n */\n protected override getInputSchemaNode(type: TaskTypeName): SchemaNode {\n // every graph as task is different, so we need to compile the schema for each one\n if (!this._inputSchemaNode) {\n const dataPortSchema = this.inputSchema();\n const schemaNode = Task.generateInputSchemaNode(dataPortSchema);\n try {\n this._inputSchemaNode = schemaNode;\n } catch (error) {\n // If compilation fails, fall back to accepting any object structure\n // This is a safety net for schemas that json-schema-library can't compile\n console.warn(\n `Failed to compile input schema for ${type}, falling back to permissive validation:`,\n error\n );\n this._inputSchemaNode = compileSchema({});\n }\n }\n return this._inputSchemaNode!;\n }\n\n /**\n * Calculates the depth (longest path from any starting node) for each task in the graph\n * @returns A map of task IDs to their depths\n */\n private calculateNodeDepths(): Map<TaskIdType, number> {\n const depths = new Map<TaskIdType, number>();\n const tasks = this.subGraph.getTasks();\n\n // Initialize all depths to 0\n for (const task of tasks) {\n depths.set(task.config.id, 0);\n }\n\n // Use topological sort to calculate depths in order\n const sortedTasks = this.subGraph.topologicallySortedNodes();\n\n for (const task of sortedTasks) {\n const currentDepth = depths.get(task.config.id) || 0;\n const targetTasks = this.subGraph.getTargetTasks(task.config.id);\n\n // Update depths of all target tasks\n for (const targetTask of targetTasks) {\n const targetDepth = depths.get(targetTask.config.id) || 0;\n depths.set(targetTask.config.id, Math.max(targetDepth, currentDepth + 1));\n }\n }\n\n return depths;\n }\n\n /**\n * Override outputSchema to compute it dynamically from the subgraph at runtime\n * The output schema depends on the compoundMerge strategy and the nodes at the last level\n */\n public override outputSchema(): DataPortSchema {\n // If there's no subgraph or it has no children, fall back to the static schema\n if (!this.hasChildren()) {\n return (this.constructor as typeof Task).outputSchema();\n }\n\n const properties: Record<string, any> = {};\n const required: string[] = [];\n\n // Find all ending nodes (nodes with no outgoing dataflows)\n const tasks = this.subGraph.getTasks();\n const endingNodes = tasks.filter(\n (task) => this.subGraph.getTargetDataflows(task.config.id).length === 0\n );\n\n // Calculate depths for all nodes\n const depths = this.calculateNodeDepths();\n\n // Find the maximum depth among ending nodes\n const maxDepth = Math.max(...endingNodes.map((task) => depths.get(task.config.id) || 0));\n\n // Filter ending nodes to only those at the maximum depth (last level)\n const lastLevelNodes = endingNodes.filter((task) => depths.get(task.config.id) === maxDepth);\n\n // ONLY handle PROPERTY_ARRAY strategy\n // Count how many ending nodes produce each property\n const propertyCount: Record<string, number> = {};\n const propertySchema: Record<string, any> = {};\n\n for (const task of lastLevelNodes) {\n const taskOutputSchema = task.outputSchema();\n if (typeof taskOutputSchema === \"boolean\") {\n if (taskOutputSchema === false) {\n continue;\n }\n if (taskOutputSchema === true) {\n properties[DATAFLOW_ALL_PORTS] = {};\n continue;\n }\n }\n const taskProperties = taskOutputSchema.properties || {};\n\n for (const [outputName, outputProp] of Object.entries(taskProperties)) {\n propertyCount[outputName] = (propertyCount[outputName] || 0) + 1;\n // Store the first schema we encounter for each property\n if (!propertySchema[outputName]) {\n propertySchema[outputName] = outputProp;\n }\n }\n }\n\n // Build the final schema: properties produced by multiple nodes become arrays\n for (const [outputName, count] of Object.entries(propertyCount)) {\n const outputProp = propertySchema[outputName];\n\n if (lastLevelNodes.length === 1) {\n // Single ending node: use property as-is\n properties[outputName] = outputProp;\n } else {\n // Multiple ending nodes: all properties become arrays due to collectPropertyValues\n properties[outputName] = {\n type: \"array\",\n items: outputProp as any,\n };\n }\n }\n\n return {\n type: \"object\",\n properties,\n ...(required.length > 0 ? { required } : {}),\n additionalProperties: false,\n } as DataPortSchema;\n }\n\n /**\n * Resets input data to defaults\n */\n public resetInputData(): void {\n super.resetInputData();\n if (this.hasChildren()) {\n this.subGraph!.getTasks().forEach((node) => {\n node.resetInputData();\n });\n this.subGraph!.getDataflows().forEach((dataflow) => {\n dataflow.reset();\n });\n }\n }\n\n // ========================================================================\n // Streaming pass-through\n // ========================================================================\n\n /**\n * Stream pass-through for compound tasks: runs the subgraph and forwards\n * streaming events from ending nodes to the outer graph. Also re-yields\n * any input streams from upstream for cases where this GraphAsTask is\n * itself downstream of another streaming task.\n */\n async *executeStream(input: Input, context: IExecuteContext): AsyncIterable<StreamEvent<Output>> {\n // Forward upstream input streams first (pass-through from outer graph)\n if (context.inputStreams) {\n for (const [, stream] of context.inputStreams) {\n const reader = stream.getReader();\n try {\n while (true) {\n const { done, value } = await reader.read();\n if (done) break;\n if (value.type === \"finish\") continue;\n yield value as StreamEvent<Output>;\n }\n } finally {\n reader.releaseLock();\n }\n }\n }\n\n // Run the subgraph and forward streaming events from ending nodes\n if (this.hasChildren()) {\n const endingNodeIds = new Set<unknown>();\n const tasks = this.subGraph.getTasks();\n for (const task of tasks) {\n if (this.subGraph.getTargetDataflows(task.config.id).length === 0) {\n endingNodeIds.add(task.config.id);\n }\n }\n\n const eventQueue: StreamEvent<Output>[] = [];\n let resolveWaiting: (() => void) | undefined;\n let subgraphDone = false;\n\n const unsub = this.subGraph.subscribeToTaskStreaming({\n onStreamChunk: (taskId, event) => {\n if (endingNodeIds.has(taskId) && event.type !== \"finish\") {\n eventQueue.push(event as StreamEvent<Output>);\n resolveWaiting?.();\n }\n },\n });\n\n const runPromise = this.subGraph\n .run<Output>(input, { parentSignal: context.signal, accumulateLeafOutputs: false })\n .then((results) => {\n subgraphDone = true;\n resolveWaiting?.();\n return results;\n });\n\n // Yield events as they arrive from ending nodes\n while (!subgraphDone) {\n if (eventQueue.length === 0) {\n await new Promise<void>((resolve) => {\n resolveWaiting = resolve;\n });\n }\n while (eventQueue.length > 0) {\n yield eventQueue.shift()!;\n }\n }\n // Drain any remaining events\n while (eventQueue.length > 0) {\n yield eventQueue.shift()!;\n }\n\n unsub();\n\n const results = await runPromise;\n const mergedOutput = this.subGraph.mergeExecuteOutputsToRunOutput(\n results,\n this.compoundMerge\n ) as Output;\n yield { type: \"finish\", data: mergedOutput } as StreamFinish<Output>;\n } else {\n yield { type: \"finish\", data: input as unknown as Output } as StreamFinish<Output>;\n }\n }\n\n // ========================================================================\n // Compound task methods\n // ========================================================================\n\n /**\n * Regenerates the subtask graph and emits a \"regenerate\" event\n *\n * Subclasses should override this method to implement the actual graph\n * regeneration logic, but all they need to do is call this method to\n * emit the \"regenerate\" event.\n */\n public regenerateGraph(): void {\n this._inputSchemaNode = undefined;\n this.events.emit(\"regenerate\");\n }\n\n // ========================================================================\n // Serialization methods\n // ========================================================================\n\n /**\n * Serializes the task and its subtasks into a format that can be stored\n * @returns The serialized task and subtasks\n */\n public toJSON(): TaskGraphItemJson {\n let json = super.toJSON();\n const hasChildren = this.hasChildren();\n if (hasChildren) {\n json = {\n ...json,\n merge: this.compoundMerge,\n subgraph: this.subGraph!.toJSON(),\n };\n }\n return json;\n }\n\n /**\n * Converts the task to a JSON format suitable for dependency tracking\n * @returns The task and subtasks in JSON thats easier for humans to read\n */\n public toDependencyJSON(): JsonTaskItem {\n const json = this.toJSON();\n if (this.hasChildren()) {\n if (\"subgraph\" in json) {\n delete json.subgraph;\n }\n return { ...json, subtasks: this.subGraph!.toDependencyJSON() };\n }\n return json;\n }\n}\n",
9
9
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n collectPropertyValues,\n ConvertAllToOptionalArray,\n globalServiceRegistry,\n ServiceRegistry,\n uuid4,\n} from \"@workglow/util\";\nimport { TASK_OUTPUT_REPOSITORY, TaskOutputRepository } from \"../storage/TaskOutputRepository\";\nimport { ConditionalTask } from \"../task/ConditionalTask\";\nimport { ITask } from \"../task/ITask\";\nimport {\n edgeNeedsAccumulation,\n getOutputStreamMode,\n getStreamingPorts,\n isTaskStreamable,\n type StreamEvent,\n} from \"../task/StreamTypes\";\nimport { Task } from \"../task/Task\";\nimport { TaskAbortedError, TaskConfigurationError, TaskError } from \"../task/TaskError\";\nimport { TaskInput, TaskOutput, TaskStatus } from \"../task/TaskTypes\";\nimport { DATAFLOW_ALL_PORTS } from \"./Dataflow\";\nimport { TaskGraph, TaskGraphRunConfig } from \"./TaskGraph\";\nimport { DependencyBasedScheduler, TopologicalScheduler } from \"./TaskGraphScheduler\";\n\nexport type GraphSingleTaskResult<T> = {\n id: unknown;\n type: String;\n data: T;\n};\nexport type GraphResultArray<T> = Array<GraphSingleTaskResult<T>>;\nexport type PropertyArrayGraphResult<T> = ConvertAllToOptionalArray<T>;\nexport type AnyGraphResult<T> = PropertyArrayGraphResult<T> | GraphResultArray<T>;\n\nexport const PROPERTY_ARRAY = \"PROPERTY_ARRAY\" as const;\nexport const GRAPH_RESULT_ARRAY = \"GRAPH_RESULT_ARRAY\" as const;\n\nexport type GraphResultMap<T> = {\n // array of results with id for tasks that created them -- output is an array of {id, type, data}[]\n [GRAPH_RESULT_ARRAY]: GraphResultArray<T>;\n // property-array -- output is consolidation of each output property, with duplicate properties turned into an array\n [PROPERTY_ARRAY]: PropertyArrayGraphResult<T>;\n};\n\n/**\n * Enum representing the possible compound merge strategies\n */\nexport type CompoundMergeStrategy = typeof PROPERTY_ARRAY | typeof GRAPH_RESULT_ARRAY;\n\nexport type GraphResult<\n Output,\n Merge extends CompoundMergeStrategy,\n> = GraphResultMap<Output>[Merge];\n\n/**\n * Class for running a task graph\n * Manages the execution of tasks in a task graph, including caching\n */\nexport class TaskGraphRunner {\n /**\n * Whether the task graph is currently running\n */\n protected running = false;\n protected reactiveRunning = false;\n\n /**\n * The task graph to run\n */\n public readonly graph: TaskGraph;\n\n /**\n * Output cache repository\n */\n protected outputCache?: TaskOutputRepository;\n /**\n * Whether leaf tasks (no outgoing edges) should accumulate their streaming\n * output. True by default so workflow return values are complete.\n */\n protected accumulateLeafOutputs: boolean = true;\n /**\n * Service registry for this graph run\n */\n protected registry: ServiceRegistry = globalServiceRegistry;\n /**\n * AbortController for cancelling graph execution\n */\n protected abortController: AbortController | undefined;\n\n /**\n * Maps to track task execution state\n */\n protected inProgressTasks: Map<unknown, Promise<TaskOutput>> = new Map();\n protected inProgressFunctions: Map<unknown, Promise<any>> = new Map();\n protected failedTaskErrors: Map<unknown, TaskError> = new Map();\n\n /**\n * Constructor for TaskGraphRunner\n * @param graph The task graph to run\n * @param outputCache The task output repository to use for caching task outputs\n * @param processScheduler The scheduler to use for task execution\n * @param reactiveScheduler The scheduler to use for reactive task execution\n */\n constructor(\n graph: TaskGraph,\n outputCache?: TaskOutputRepository,\n protected processScheduler = new DependencyBasedScheduler(graph),\n protected reactiveScheduler = new TopologicalScheduler(graph)\n ) {\n this.graph = graph;\n graph.outputCache = outputCache;\n this.handleProgress = this.handleProgress.bind(this);\n }\n\n // ========================================================================\n // Public methods\n // ========================================================================\n\n public async runGraph<ExecuteOutput extends TaskOutput>(\n input: TaskInput = {} as TaskInput,\n config?: TaskGraphRunConfig\n ): Promise<GraphResultArray<ExecuteOutput>> {\n await this.handleStart(config);\n\n const results: GraphResultArray<ExecuteOutput> = [];\n let error: TaskError | undefined;\n\n try {\n // TODO: A different graph runner may chunk tasks that are in parallel\n // rather them all currently available\n for await (const task of this.processScheduler.tasks()) {\n if (this.abortController?.signal.aborted) {\n break;\n }\n\n if (this.failedTaskErrors.size > 0) {\n break;\n }\n\n const isRootTask = this.graph.getSourceDataflows(task.config.id).length === 0;\n\n const runAsync = async () => {\n try {\n // Only filter input for non-root tasks; root tasks get the full input\n const taskInput = isRootTask ? input : this.filterInputForTask(task, input);\n\n const taskPromise = this.runTask(task, taskInput);\n this.inProgressTasks!.set(task.config.id, taskPromise);\n const taskResult = await taskPromise;\n\n if (this.graph.getTargetDataflows(task.config.id).length === 0) {\n // we save the results of all the leaves\n results.push(taskResult as GraphSingleTaskResult<ExecuteOutput>);\n }\n } catch (error) {\n this.failedTaskErrors.set(task.config.id, error as TaskError);\n } finally {\n // IMPORTANT: Push status to edges BEFORE notifying scheduler\n // This ensures dataflow statuses (including DISABLED) are set\n // before the scheduler checks which tasks are ready\n this.pushStatusFromNodeToEdges(this.graph, task);\n this.pushErrorFromNodeToEdges(this.graph, task);\n this.processScheduler.onTaskCompleted(task.config.id);\n }\n };\n\n // Start task execution without awaiting\n // so we can have many tasks running in parallel\n // but keep track of them to make sure they get awaited\n // otherwise, things will finish after this promise is resolved\n this.inProgressFunctions.set(Symbol(task.config.id as string), runAsync());\n }\n } catch (err) {\n error = err as Error;\n }\n // Wait for all tasks to complete since we did not await runAsync()/this.runTaskWithProvenance()\n await Promise.allSettled(Array.from(this.inProgressTasks.values()));\n // Clean up stragglers to avoid unhandled promise rejections\n await Promise.allSettled(Array.from(this.inProgressFunctions.values()));\n\n if (this.failedTaskErrors.size > 0) {\n const latestError = this.failedTaskErrors.values().next().value!;\n this.handleError(latestError);\n throw latestError;\n }\n if (this.abortController?.signal.aborted) {\n await this.handleAbort();\n throw new TaskAbortedError();\n }\n\n await this.handleComplete();\n\n return results;\n }\n\n /**\n * Runs the task graph in a reactive manner\n * @param input Optional input to pass to root tasks (tasks with no incoming dataflows)\n * @returns A promise that resolves when all tasks are complete\n * @throws TaskConfigurationError if the graph is already running reactively\n */\n public async runGraphReactive<Output extends TaskOutput>(\n input: TaskInput = {} as TaskInput\n ): Promise<GraphResultArray<Output>> {\n await this.handleStartReactive();\n\n const results: GraphResultArray<Output> = [];\n try {\n for await (const task of this.reactiveScheduler.tasks()) {\n const isRootTask = this.graph.getSourceDataflows(task.config.id).length === 0;\n\n if (task.status === TaskStatus.PENDING) {\n task.resetInputData();\n this.copyInputFromEdgesToNode(task);\n // TODO: cacheable here??\n // if (task.cacheable) {\n // const results = await this.outputCache?.getOutput(\n // (task.constructor as any).type,\n // task.runInputData\n // );\n // if (results) {\n // task.runOutputData = results;\n // }\n // }\n }\n\n // For root tasks (no incoming dataflows), apply the input parameter\n // This is important for GraphAsTask subgraphs where the InputTask needs\n // to receive the parent's input values\n const taskInput = isRootTask ? input : {};\n\n const taskResult = await task.runReactive(taskInput);\n\n await this.pushOutputFromNodeToEdges(task, taskResult);\n if (this.graph.getTargetDataflows(task.config.id).length === 0) {\n results.push({\n id: task.config.id,\n type: (task.constructor as any).runtype || (task.constructor as any).type,\n data: taskResult as Output,\n });\n }\n }\n await this.handleCompleteReactive();\n return results;\n } catch (error) {\n await this.handleErrorReactive();\n throw error;\n }\n }\n\n /**\n * Aborts the task graph execution\n */\n public abort(): void {\n this.abortController?.abort();\n }\n\n /**\n * Disables the task graph execution\n */\n public async disable(): Promise<void> {\n await this.handleDisable();\n }\n\n /**\n * Filters graph-level input to only include properties that are not connected via dataflows for a given task\n * @param task The task to filter input for\n * @param input The graph-level input\n * @returns Filtered input containing only unconnected properties\n */\n protected filterInputForTask(task: ITask, input: TaskInput): TaskInput {\n // Get all inputs that are connected to this task via dataflows\n const sourceDataflows = this.graph.getSourceDataflows(task.config.id);\n const connectedInputs = new Set(sourceDataflows.map((df) => df.targetTaskPortId));\n\n // If DATAFLOW_ALL_PORTS (\"*\") is in the set, all inputs are connected\n const allPortsConnected = connectedInputs.has(DATAFLOW_ALL_PORTS);\n\n // Filter out connected inputs from the graph input\n const filteredInput: TaskInput = {};\n for (const [key, value] of Object.entries(input)) {\n // Skip this input if it's explicitly connected OR if all ports are connected\n if (!connectedInputs.has(key) && !allPortsConnected) {\n filteredInput[key] = value;\n }\n }\n\n return filteredInput;\n }\n\n /**\n * Adds input data to a task.\n * Delegates to {@link Task.addInput} for the actual merging logic.\n *\n * @param task The task to add input data to\n * @param overrides The input data to override (or add to if an array)\n */\n public addInputData(task: ITask, overrides: Partial<TaskInput> | undefined): void {\n if (!overrides) return;\n\n const changed = task.addInput(overrides);\n\n // TODO(str): This is a hack.\n if (changed && \"regenerateGraph\" in task && typeof task.regenerateGraph === \"function\") {\n task.regenerateGraph();\n }\n }\n\n // ========================================================================\n // Protected Handlers\n // ========================================================================\n public mergeExecuteOutputsToRunOutput<\n ExecuteOutput extends TaskOutput,\n Merge extends CompoundMergeStrategy = CompoundMergeStrategy,\n >(\n results: GraphResultArray<ExecuteOutput>,\n compoundMerge: Merge\n ): GraphResult<ExecuteOutput, Merge> {\n if (compoundMerge === GRAPH_RESULT_ARRAY) {\n return results as GraphResult<ExecuteOutput, Merge>;\n }\n\n if (compoundMerge === PROPERTY_ARRAY) {\n let fixedOutput = {} as PropertyArrayGraphResult<ExecuteOutput>;\n const outputs = results.map((result: any) => result.data);\n if (outputs.length === 1) {\n fixedOutput = outputs[0];\n } else if (outputs.length > 1) {\n const collected = collectPropertyValues<ExecuteOutput>(outputs as ExecuteOutput[]);\n if (Object.keys(collected).length > 0) {\n fixedOutput = collected;\n }\n }\n return fixedOutput as GraphResult<ExecuteOutput, Merge>;\n }\n throw new TaskConfigurationError(`Unknown compound merge strategy: ${compoundMerge}`);\n }\n\n /**\n * Copies input data from edges to a task\n * @param task The task to copy input data to\n */\n protected copyInputFromEdgesToNode(task: ITask) {\n const dataflows = this.graph.getSourceDataflows(task.config.id);\n for (const dataflow of dataflows) {\n this.addInputData(task, dataflow.getPortData());\n }\n }\n\n /**\n * Pushes the output of a task to its target tasks\n * @param node The task that produced the output\n * @param results The output of the task\n */\n protected async pushOutputFromNodeToEdges(node: ITask, results: TaskOutput) {\n const dataflows = this.graph.getTargetDataflows(node.config.id);\n for (const dataflow of dataflows) {\n const compatibility = dataflow.semanticallyCompatible(this.graph, dataflow);\n // console.log(\"pushOutputFromNodeToEdges\", dataflow.id, compatibility, Object.keys(results));\n if (compatibility === \"static\") {\n dataflow.setPortData(results);\n } else if (compatibility === \"runtime\") {\n const task = this.graph.getTask(dataflow.targetTaskId)!;\n const narrowed = await task.narrowInput({ ...results }, this.registry);\n dataflow.setPortData(narrowed);\n } else {\n // don't push incompatible data\n }\n }\n }\n\n /**\n * Pushes the status of a task to its target edges\n * @param node The task that produced the status\n *\n * For ConditionalTask, this method handles selective dataflow status:\n * - Active branch dataflows get COMPLETED status\n * - Inactive branch dataflows get DISABLED status\n */\n protected pushStatusFromNodeToEdges(graph: TaskGraph, node: ITask, status?: TaskStatus): void {\n if (!node?.config?.id) return;\n\n const dataflows = graph.getTargetDataflows(node.config.id);\n const effectiveStatus = status ?? node.status;\n\n // Check if this is a ConditionalTask with selective branching\n if (node instanceof ConditionalTask && effectiveStatus === TaskStatus.COMPLETED) {\n // Build a map of output port -> branch ID for lookup\n const branches = node.config.branches ?? [];\n const portToBranch = new Map<string, string>();\n for (const branch of branches) {\n portToBranch.set(branch.outputPort, branch.id);\n }\n\n const activeBranches = node.getActiveBranches();\n\n for (const dataflow of dataflows) {\n const branchId = portToBranch.get(dataflow.sourceTaskPortId);\n if (branchId !== undefined) {\n // This dataflow is from a branch port\n if (activeBranches.has(branchId)) {\n // Branch is active - dataflow gets completed status\n dataflow.setStatus(TaskStatus.COMPLETED);\n } else {\n // Branch is inactive - dataflow gets disabled status\n dataflow.setStatus(TaskStatus.DISABLED);\n }\n } else {\n // Not a branch port (e.g., _activeBranches metadata) - use normal status\n dataflow.setStatus(effectiveStatus);\n }\n }\n\n // Cascade disabled status to downstream tasks\n this.propagateDisabledStatus(graph);\n return;\n }\n\n // Default behavior for non-conditional tasks\n dataflows.forEach((dataflow) => {\n dataflow.setStatus(effectiveStatus);\n });\n }\n\n /**\n * Pushes the error of a task to its target edges\n * @param node The task that produced the error\n */\n protected pushErrorFromNodeToEdges(graph: TaskGraph, node: ITask): void {\n if (!node?.config?.id) return;\n graph.getTargetDataflows(node.config.id).forEach((dataflow) => {\n dataflow.error = node.error;\n });\n }\n\n /**\n * Propagates DISABLED status through the graph.\n *\n * When a task's ALL incoming dataflows are DISABLED, that task becomes unreachable\n * and should also be disabled. This cascades through the graph until no more\n * tasks can be disabled.\n *\n * This is used by ConditionalTask to disable downstream tasks on inactive branches.\n *\n * @param graph The task graph to propagate disabled status through\n */\n protected propagateDisabledStatus(graph: TaskGraph): void {\n let changed = true;\n\n // Keep iterating until no more changes (fixed-point iteration)\n while (changed) {\n changed = false;\n\n for (const task of graph.getTasks()) {\n // Only consider tasks that are still pending\n if (task.status !== TaskStatus.PENDING) {\n continue;\n }\n\n const incomingDataflows = graph.getSourceDataflows(task.config.id);\n\n // Skip tasks with no incoming dataflows (root tasks)\n if (incomingDataflows.length === 0) {\n continue;\n }\n\n // Check if ALL incoming dataflows are DISABLED\n const allDisabled = incomingDataflows.every((df) => df.status === TaskStatus.DISABLED);\n\n if (allDisabled) {\n // This task is unreachable - disable it synchronously\n // Set status directly to avoid async issues\n task.status = TaskStatus.DISABLED;\n task.progress = 100;\n task.completedAt = new Date();\n task.emit(\"disabled\");\n task.emit(\"status\", task.status);\n\n // Propagate disabled status to its outgoing dataflows\n graph.getTargetDataflows(task.config.id).forEach((dataflow) => {\n dataflow.setStatus(TaskStatus.DISABLED);\n });\n\n // Mark as completed in scheduler so it doesn't wait for this task\n this.processScheduler.onTaskCompleted(task.config.id);\n\n changed = true;\n }\n }\n }\n }\n\n /**\n * Determines whether a streaming task needs to accumulate its text-delta\n * chunks into an enriched finish event. Accumulation is needed when:\n *\n * 1. Output caching is active (the cached value must be fully materialised).\n * 2. Any outgoing dataflow edge connects a streaming output port to an input\n * port that is not streaming with the same mode (i.e. the downstream task\n * cannot consume a raw stream and needs a completed value).\n *\n * When accumulation is required the source task runs with shouldAccumulate=true,\n * emitting an enriched finish event that carries all accumulated port text.\n * All downstream dataflow edges share that event via tee'd streams so no\n * edge needs to re-accumulate independently.\n */\n protected taskNeedsAccumulation(task: ITask): boolean {\n if (this.outputCache) return true;\n\n const outEdges = this.graph.getTargetDataflows(task.config.id);\n if (outEdges.length === 0) return this.accumulateLeafOutputs;\n\n const outSchema = task.outputSchema();\n\n for (const df of outEdges) {\n if (df.sourceTaskPortId === DATAFLOW_ALL_PORTS) {\n // Conservative: if any streaming output port exists, accumulate.\n // This covers the case where all-ports edges fan into non-streaming tasks.\n if (getStreamingPorts(outSchema).length > 0) return true;\n continue;\n }\n\n const targetTask = this.graph.getTask(df.targetTaskId);\n if (!targetTask) continue;\n const inSchema = targetTask.inputSchema();\n\n if (edgeNeedsAccumulation(outSchema, df.sourceTaskPortId, inSchema, df.targetTaskPortId)) {\n return true;\n }\n }\n\n return false;\n }\n\n /**\n * Runs a task\n * @param task The task to run\n * @param input The input for the task\n * @returns The output of the task\n */\n protected async runTask<T>(task: ITask, input: TaskInput): Promise<GraphSingleTaskResult<T>> {\n const isStreamable = isTaskStreamable(task);\n\n // For pass-through streaming tasks: if the task is streamable and has\n // streaming input edges, tee each stream so one copy is forwarded to\n // the task's executeStream() (via inputStreams) while the other stays\n // on the edge for materialization by awaitStreamInputs.\n if (isStreamable) {\n const dataflows = this.graph.getSourceDataflows(task.config.id);\n const streamingEdges = dataflows.filter((df) => df.stream !== undefined);\n if (streamingEdges.length > 0) {\n const inputStreams = new Map<string, ReadableStream<StreamEvent>>();\n for (const df of streamingEdges) {\n const stream = df.stream!;\n const [forwardCopy, materializeCopy] = stream.tee();\n inputStreams.set(df.targetTaskPortId, forwardCopy);\n df.setStream(materializeCopy);\n }\n task.runner.inputStreams = inputStreams;\n }\n }\n\n // Await any active streams on input dataflow edges so their values\n // are materialized before we read them. This applies to ALL downstream\n // tasks (both streaming and non-streaming) because copyInputFromEdgesToNode\n // reads via getPortData() which requires materialized values.\n // Streaming downstream tasks are still unblocked early by the scheduler\n // (they can start setup while upstream is streaming), but their actual\n // input data waits for upstream completion.\n await this.awaitStreamInputs(task);\n\n this.copyInputFromEdgesToNode(task);\n\n if (isStreamable) {\n return this.runStreamingTask<T>(task, input);\n }\n\n const results = await task.runner.run(input, {\n // Pass `false` when no cache so TaskRunner.handleStart explicitly clears\n // its own cached reference (undefined would leave the old value intact).\n outputCache: this.outputCache ?? false,\n updateProgress: async (task: ITask, progress: number, message?: string, ...args: any[]) =>\n await this.handleProgress(task, progress, message, ...args),\n registry: this.registry,\n });\n\n await this.pushOutputFromNodeToEdges(task, results);\n\n return {\n id: task.config.id,\n type: (task.constructor as any).runtype || (task.constructor as any).type,\n data: results as T,\n };\n }\n\n /**\n * For non-streaming downstream tasks, awaits completion of any active\n * streams on input dataflow edges, materializing their values.\n *\n * Streaming upstream tasks set a ReadableStream on outgoing edges.\n * Non-streaming downstream tasks cannot consume streams directly, so\n * this method reads each stream to completion and accumulates the\n * value (via Dataflow.awaitStreamValue) before the task reads its\n * inputs through the normal getPortData() path.\n */\n protected async awaitStreamInputs(task: ITask): Promise<void> {\n const dataflows = this.graph.getSourceDataflows(task.config.id);\n const streamPromises = dataflows\n .filter((df) => df.stream !== undefined)\n .map((df) => df.awaitStreamValue());\n if (streamPromises.length > 0) {\n await Promise.all(streamPromises);\n }\n }\n\n /**\n * Runs a streaming task within the DAG.\n * Listens for stream events to:\n * - Notify the scheduler when streaming begins (unblocking downstream streamable tasks)\n * - Push stream data to outgoing dataflow edges\n * - Have the source task accumulate and emit enriched finish events for\n * non-streaming downstream tasks (when taskNeedsAccumulation() is true)\n */\n protected async runStreamingTask<T>(\n task: ITask,\n input: TaskInput\n ): Promise<GraphSingleTaskResult<T>> {\n const streamMode = getOutputStreamMode(task.outputSchema());\n const shouldAccumulate = this.taskNeedsAccumulation(task);\n\n let streamingNotified = false;\n\n const onStatus = (status: TaskStatus) => {\n if (status === TaskStatus.STREAMING && !streamingNotified) {\n streamingNotified = true;\n this.pushStatusFromNodeToEdges(this.graph, task, TaskStatus.STREAMING);\n this.pushStreamToEdges(task, streamMode);\n this.processScheduler.onTaskStreaming(task.config.id);\n }\n };\n\n const onStreamStart = () => {\n this.graph.emit(\"task_stream_start\", task.config.id);\n };\n\n const onStreamChunk = (event: StreamEvent) => {\n this.graph.emit(\"task_stream_chunk\", task.config.id, event);\n };\n\n const onStreamEnd = (output: Record<string, any>) => {\n this.graph.emit(\"task_stream_end\", task.config.id, output);\n };\n\n task.on(\"status\", onStatus);\n task.on(\"stream_start\", onStreamStart);\n task.on(\"stream_chunk\", onStreamChunk);\n task.on(\"stream_end\", onStreamEnd);\n\n try {\n const results = await task.runner.run(input, {\n outputCache: this.outputCache ?? false,\n shouldAccumulate,\n updateProgress: async (task: ITask, progress: number, message?: string, ...args: any[]) =>\n await this.handleProgress(task, progress, message, ...args),\n registry: this.registry,\n });\n\n await this.pushOutputFromNodeToEdges(task, results);\n\n return {\n id: task.config.id,\n type: (task.constructor as any).runtype || (task.constructor as any).type,\n data: results as T,\n };\n } finally {\n task.off(\"status\", onStatus);\n task.off(\"stream_start\", onStreamStart);\n task.off(\"stream_chunk\", onStreamChunk);\n task.off(\"stream_end\", onStreamEnd);\n }\n }\n\n /**\n * Returns true if an event carries a port-specific delta (text-delta or object-delta).\n */\n private static isPortDelta(event: StreamEvent): event is StreamEvent & { port: string } {\n return event.type === \"text-delta\" || event.type === \"object-delta\";\n }\n\n /**\n * Creates a ReadableStream from task streaming events, optionally filtered\n * to a single port. When `portId` is undefined (DATAFLOW_ALL_PORTS), all\n * events pass through. When set, only delta events matching the port plus\n * control events (finish, error, snapshot) are enqueued.\n */\n private createStreamFromTaskEvents(task: ITask, portId?: string): ReadableStream<StreamEvent> {\n return new ReadableStream<StreamEvent>({\n start: (controller) => {\n const onChunk = (event: StreamEvent) => {\n try {\n if (\n portId !== undefined &&\n TaskGraphRunner.isPortDelta(event) &&\n event.port !== portId\n ) {\n return;\n }\n controller.enqueue(event);\n } catch {\n // Stream may be closed\n }\n };\n const onEnd = () => {\n try {\n controller.close();\n } catch {\n // Stream may already be closed\n }\n task.off(\"stream_chunk\", onChunk);\n task.off(\"stream_end\", onEnd);\n };\n task.on(\"stream_chunk\", onChunk);\n task.on(\"stream_end\", onEnd);\n },\n });\n }\n\n /**\n * Pushes stream events from a streaming task to its outgoing dataflow edges.\n * Creates per-port filtered ReadableStreams for specific-port edges and\n * unfiltered streams for DATAFLOW_ALL_PORTS edges. Within each port group,\n * uses tee() for fan-out to multiple consumers.\n */\n protected pushStreamToEdges(task: ITask, streamMode: string): void {\n const targetDataflows = this.graph.getTargetDataflows(task.config.id);\n if (targetDataflows.length === 0) return;\n\n // Group edges by their source port\n const groups = new Map<string, typeof targetDataflows>();\n for (const df of targetDataflows) {\n const key = df.sourceTaskPortId;\n let group = groups.get(key);\n if (!group) {\n group = [];\n groups.set(key, group);\n }\n group.push(df);\n }\n\n for (const [portKey, edges] of groups) {\n const filterPort = portKey === DATAFLOW_ALL_PORTS ? undefined : portKey;\n const stream = this.createStreamFromTaskEvents(task, filterPort);\n\n if (edges.length === 1) {\n edges[0].setStream(stream);\n } else {\n let currentStream = stream;\n for (let i = 0; i < edges.length; i++) {\n if (i === edges.length - 1) {\n edges[i].setStream(currentStream);\n } else {\n const [s1, s2] = currentStream.tee();\n edges[i].setStream(s1);\n currentStream = s2;\n }\n }\n }\n }\n }\n\n /**\n * Resets a task\n * @param graph The task graph to reset\n * @param task The task to reset\n * @param runId The run ID\n */\n protected resetTask(graph: TaskGraph, task: ITask, runId: string) {\n task.status = TaskStatus.PENDING;\n task.resetInputData();\n task.runOutputData = {};\n task.error = undefined;\n task.progress = 0;\n task.runConfig = { ...task.runConfig, runnerId: runId };\n this.pushStatusFromNodeToEdges(graph, task);\n this.pushErrorFromNodeToEdges(graph, task);\n task.emit(\"reset\");\n task.emit(\"status\", task.status);\n }\n\n /**\n * Resets the task graph, recursively\n * @param graph The task graph to reset\n */\n public resetGraph(graph: TaskGraph, runnerId: string) {\n graph.getTasks().forEach((node) => {\n this.resetTask(graph, node, runnerId);\n node.regenerateGraph();\n if (node.hasChildren()) {\n this.resetGraph(node.subGraph, runnerId);\n }\n });\n graph.getDataflows().forEach((dataflow) => {\n dataflow.reset();\n });\n }\n\n /**\n * Handles the start of task graph execution\n * @param parentSignal Optional abort signal from parent\n */\n protected async handleStart(config?: TaskGraphRunConfig): Promise<void> {\n // Setup registry - create child from global if not provided\n if (config?.registry !== undefined) {\n this.registry = config.registry;\n } else {\n // Create a child container that inherits from global but allows overrides\n this.registry = new ServiceRegistry(globalServiceRegistry.container.createChildContainer());\n }\n\n this.accumulateLeafOutputs = config?.accumulateLeafOutputs !== false;\n\n if (config?.outputCache !== undefined) {\n if (typeof config.outputCache === \"boolean\") {\n if (config.outputCache === true) {\n this.outputCache = this.registry.get(TASK_OUTPUT_REPOSITORY);\n } else {\n this.outputCache = undefined;\n }\n } else {\n this.outputCache = config.outputCache;\n }\n this.graph.outputCache = this.outputCache;\n }\n // Prevent reentrancy\n if (this.running || this.reactiveRunning) {\n throw new TaskConfigurationError(\"Graph is already running\");\n }\n\n this.running = true;\n this.abortController = new AbortController();\n this.abortController.signal.addEventListener(\"abort\", () => {\n this.handleAbort();\n });\n\n if (config?.parentSignal?.aborted) {\n this.abortController.abort(); // Immediately abort if the parent is already aborted\n return;\n } else {\n config?.parentSignal?.addEventListener(\n \"abort\",\n () => {\n this.abortController?.abort();\n },\n { once: true }\n );\n }\n\n this.resetGraph(this.graph, uuid4());\n this.processScheduler.reset();\n this.inProgressTasks.clear();\n this.inProgressFunctions.clear();\n this.failedTaskErrors.clear();\n this.graph.emit(\"start\");\n }\n\n protected async handleStartReactive(): Promise<void> {\n if (this.reactiveRunning) {\n throw new TaskConfigurationError(\"Graph is already running reactively\");\n }\n this.reactiveScheduler.reset();\n this.reactiveRunning = true;\n }\n\n /**\n * Handles the completion of task graph execution\n */\n protected async handleComplete(): Promise<void> {\n this.running = false;\n this.graph.emit(\"complete\");\n }\n\n protected async handleCompleteReactive(): Promise<void> {\n this.reactiveRunning = false;\n }\n\n /**\n * Handles errors during task graph execution\n */\n protected async handleError(error: TaskError): Promise<void> {\n await Promise.allSettled(\n this.graph.getTasks().map(async (task: ITask) => {\n if (task.status === TaskStatus.PROCESSING || task.status === TaskStatus.STREAMING) {\n task.abort();\n }\n })\n );\n this.running = false;\n this.graph.emit(\"error\", error);\n }\n\n protected async handleErrorReactive(): Promise<void> {\n this.reactiveRunning = false;\n }\n\n /**\n * Handles task graph abortion\n */\n protected async handleAbort(): Promise<void> {\n this.graph.getTasks().map(async (task: ITask) => {\n if (task.status === TaskStatus.PROCESSING || task.status === TaskStatus.STREAMING) {\n task.abort();\n }\n });\n this.running = false;\n this.graph.emit(\"abort\");\n }\n\n protected async handleAbortReactive(): Promise<void> {\n this.reactiveRunning = false;\n }\n\n /**\n * Handles task graph disabling\n */\n protected async handleDisable(): Promise<void> {\n await Promise.allSettled(\n this.graph.getTasks().map(async (task: ITask) => {\n if (task.status === TaskStatus.PENDING) {\n return task.disable();\n }\n })\n );\n this.running = false;\n this.graph.emit(\"disabled\");\n }\n\n /**\n * Handles progress updates for the task graph\n * Currently not implemented at the graph level\n * @param progress Progress value (0-100)\n * @param message Optional message\n * @param args Additional arguments\n */\n protected async handleProgress(\n task: ITask,\n progress: number,\n message?: string,\n ...args: any[]\n ): Promise<void> {\n const total = this.graph.getTasks().length;\n if (total > 1) {\n const completed = this.graph.getTasks().reduce((acc, t) => acc + t.progress, 0);\n progress = Math.round(completed / total);\n }\n this.pushStatusFromNodeToEdges(this.graph, task);\n await this.pushOutputFromNodeToEdges(task, task.runOutputData);\n this.graph.emit(\"graph_progress\", progress, message, args);\n }\n}\n",
10
10
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createServiceToken, EventEmitter, EventParameters } from \"@workglow/util\";\nimport { TaskInput, TaskOutput } from \"../task/TaskTypes\";\n\n/**\n * Service token for TaskOutputRepository\n */\nexport const TASK_OUTPUT_REPOSITORY = createServiceToken<TaskOutputRepository>(\n \"taskgraph.taskOutputRepository\"\n);\n\nexport type TaskOutputEventListeners = {\n output_saved: (taskType: string) => void;\n output_retrieved: (taskType: string) => void;\n output_cleared: () => void;\n output_pruned: () => void;\n};\n\nexport type TaskOutputEvents = keyof TaskOutputEventListeners;\n\nexport type TaskOutputEventListener<Event extends TaskOutputEvents> =\n TaskOutputEventListeners[Event];\n\nexport type TaskOutputEventParameters<Event extends TaskOutputEvents> = EventParameters<\n TaskOutputEventListeners,\n Event\n>;\n\n/**\n * Abstract class for managing task outputs in a repository\n * Provides methods for saving, retrieving, and clearing task outputs\n */\nexport abstract class TaskOutputRepository {\n /**\n * Whether to compress the output\n */\n outputCompression: boolean;\n\n /**\n * Constructor for the TaskOutputRepository\n * @param options The options for the repository\n */\n constructor({ outputCompression = true }) {\n this.outputCompression = outputCompression;\n }\n\n private get events() {\n if (!this._events) {\n this._events = new EventEmitter<TaskOutputEventListeners>();\n }\n return this._events;\n }\n private _events: EventEmitter<TaskOutputEventListeners> | undefined;\n\n /**\n * Registers an event listener for a specific event\n * @param name The event name to listen for\n * @param fn The callback function to execute when the event occurs\n */\n on<Event extends TaskOutputEvents>(name: Event, fn: TaskOutputEventListener<Event>) {\n this.events.on(name, fn);\n }\n\n /**\n * Removes an event listener for a specific event\n * @param name The event name to stop listening for\n * @param fn The callback function to remove\n */\n off<Event extends TaskOutputEvents>(name: Event, fn: TaskOutputEventListener<Event>) {\n this.events.off(name, fn);\n }\n\n /**\n * Returns a promise that resolves when the event is emitted\n * @param name The event name to listen for\n * @returns a promise that resolves to the event parameters\n */\n waitOn<Event extends TaskOutputEvents>(name: Event) {\n return this.events.waitOn(name) as Promise<TaskOutputEventParameters<Event>>;\n }\n\n /**\n * Emits an event (if there are listeners)\n * @param name The event name to emit\n * @param args The event parameters\n */\n emit<Event extends TaskOutputEvents>(name: Event, ...args: TaskOutputEventParameters<Event>) {\n this._events?.emit(name, ...args);\n }\n\n /**\n * Saves a task output to the repository\n * @param taskType The type of task to save the output for\n * @param inputs The input parameters for the task\n * @param output The task output to save\n */\n abstract saveOutput(\n taskType: string,\n inputs: TaskInput,\n output: TaskOutput,\n createdAt?: Date // for testing purposes\n ): Promise<void>;\n\n /**\n * Retrieves a task output from the repository\n * @param taskType The type of task to retrieve the output for\n * @param inputs The input parameters for the task\n * @returns The retrieved task output, or undefined if not found\n */\n abstract getOutput(taskType: string, inputs: TaskInput): Promise<TaskOutput | undefined>;\n\n /**\n * Clears all task outputs from the repository\n * @emits output_cleared when the operation completes\n */\n abstract clear(): Promise<void>;\n\n /**\n * Returns the number of task outputs stored in the repository\n * @returns The count of stored task outputs\n */\n abstract size(): Promise<number>;\n\n /**\n * Clear all task outputs from the repository that are older than the given date\n * @param olderThanInMs The time in milliseconds to clear task outputs older than\n */\n abstract clearOlderThan(olderThanInMs: number): Promise<void>;\n}\n",
11
11
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Comparison operators supported by the UI condition builder.\n */\nexport type ComparisonOperator =\n | \"equals\"\n | \"not_equals\"\n | \"greater_than\"\n | \"greater_or_equal\"\n | \"less_than\"\n | \"less_or_equal\"\n | \"contains\"\n | \"starts_with\"\n | \"ends_with\"\n | \"is_empty\"\n | \"is_not_empty\"\n | \"is_true\"\n | \"is_false\";\n\n/**\n * Serialized condition branch configuration from the UI builder.\n * Used by ConditionalTask to auto-build runtime condition functions.\n */\nexport interface UIConditionBranch {\n id: string;\n field: string;\n operator: ComparisonOperator;\n value: string;\n}\n\n/**\n * Serialized condition configuration from the UI builder.\n * Used by ConditionalTask to auto-build runtime branch configs.\n */\nexport interface UIConditionConfig {\n branches: UIConditionBranch[];\n exclusive: boolean;\n defaultBranch?: string;\n}\n\n/**\n * Evaluates a condition based on operator type.\n *\n * @param fieldValue - The value of the field being tested\n * @param operator - The comparison operator to apply\n * @param compareValue - The value to compare against (always a string from the UI)\n * @returns true if the condition is met, false otherwise\n */\nexport function evaluateCondition(\n fieldValue: unknown,\n operator: ComparisonOperator,\n compareValue: string\n): boolean {\n // Handle null/undefined\n if (fieldValue === null || fieldValue === undefined) {\n switch (operator) {\n case \"is_empty\":\n return true;\n case \"is_not_empty\":\n return false;\n case \"is_true\":\n return false;\n case \"is_false\":\n return true;\n default:\n return false;\n }\n }\n\n const strValue = String(fieldValue);\n const numValue = Number(fieldValue);\n\n switch (operator) {\n case \"equals\":\n // Try numeric comparison first, then string\n if (!isNaN(numValue) && !isNaN(Number(compareValue))) {\n return numValue === Number(compareValue);\n }\n return strValue === compareValue;\n\n case \"not_equals\":\n if (!isNaN(numValue) && !isNaN(Number(compareValue))) {\n return numValue !== Number(compareValue);\n }\n return strValue !== compareValue;\n\n case \"greater_than\":\n return numValue > Number(compareValue);\n\n case \"greater_or_equal\":\n return numValue >= Number(compareValue);\n\n case \"less_than\":\n return numValue < Number(compareValue);\n\n case \"less_or_equal\":\n return numValue <= Number(compareValue);\n\n case \"contains\":\n return strValue.toLowerCase().includes(compareValue.toLowerCase());\n\n case \"starts_with\":\n return strValue.toLowerCase().startsWith(compareValue.toLowerCase());\n\n case \"ends_with\":\n return strValue.toLowerCase().endsWith(compareValue.toLowerCase());\n\n case \"is_empty\":\n return strValue === \"\" || (Array.isArray(fieldValue) && fieldValue.length === 0);\n\n case \"is_not_empty\":\n return strValue !== \"\" && !(Array.isArray(fieldValue) && fieldValue.length === 0);\n\n case \"is_true\":\n return Boolean(fieldValue) === true;\n\n case \"is_false\":\n return Boolean(fieldValue) === false;\n\n default:\n return false;\n }\n}\n\n/**\n * Get a value from a nested object using dot notation.\n * e.g., \"user.name\" would get obj.user.name\n *\n * @param obj - The object to read from\n * @param path - Dot-separated path to the value\n * @returns The value at the path, or undefined if any segment is missing\n */\nexport function getNestedValue(obj: Record<string, unknown>, path: string): unknown {\n const parts = path.split(\".\");\n let current: unknown = obj;\n\n for (const part of parts) {\n if (current === null || current === undefined || typeof current !== \"object\") {\n return undefined;\n }\n current = (current as Record<string, unknown>)[part];\n }\n\n return current;\n}\n",
12
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n compileSchema,\n deepEqual,\n EventEmitter,\n SchemaNode,\n uuid4,\n type DataPortSchema,\n type ServiceRegistry,\n} from \"@workglow/util\";\nimport { DATAFLOW_ALL_PORTS } from \"../task-graph/Dataflow\";\nimport { TaskGraph } from \"../task-graph/TaskGraph\";\nimport type { IExecuteContext, IExecuteReactiveContext, IRunConfig, ITask } from \"./ITask\";\nimport {\n TaskAbortedError,\n TaskConfigurationError,\n TaskError,\n TaskInvalidInputError,\n} from \"./TaskError\";\nimport {\n type TaskEventListener,\n type TaskEventListeners,\n type TaskEventParameters,\n type TaskEvents,\n} from \"./TaskEvents\";\nimport type { JsonTaskItem, TaskGraphItemJson } from \"./TaskJSON\";\nimport { TaskRunner } from \"./TaskRunner\";\nimport {\n TaskConfigSchema,\n TaskStatus,\n type TaskConfig,\n type TaskIdType,\n type TaskInput,\n type TaskOutput,\n type TaskTypeName,\n} from \"./TaskTypes\";\n\n/**\n * Base class for all tasks that implements the ITask interface.\n * This abstract class provides common functionality for both simple and compound tasks.\n *\n * The Task class is responsible for:\n * 1. Defining what a task is (inputs, outputs, configuration)\n * 2. Providing the execution logic (via execute and executeReactive)\n * 3. Delegating the running logic to a TaskRunner\n */\nexport class Task<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends TaskConfig = TaskConfig,\n> implements ITask<Input, Output, Config> {\n // ========================================================================\n // Static properties - should be overridden by subclasses\n // ========================================================================\n\n /**\n * The type identifier for this task class\n */\n public static type: TaskTypeName = \"Task\";\n\n /**\n * The category this task belongs to\n */\n public static category: string = \"Hidden\";\n\n /**\n * The title of this task\n */\n public static title: string = \"\";\n\n /**\n * The description of this task\n */\n public static description: string = \"\";\n\n /**\n * Whether this task has side effects\n */\n public static cacheable: boolean = true;\n\n /**\n * Whether this task has dynamic input/output schemas that can change at runtime.\n * Tasks with dynamic schemas should override instance methods for inputSchema() and/or outputSchema()\n * and emit 'schemaChange' events when their schemas change.\n */\n public static hasDynamicSchemas: boolean = false;\n\n /**\n * When true, dynamically added input ports (via the universal \"Add Input\" handle in the builder)\n * are mirrored as output ports of the same name and type. Set this on pass-through tasks that\n * forward their additional inputs to their outputs unchanged.\n */\n public static passthroughInputsToOutputs: boolean = false;\n\n /**\n * Input schema for this task\n */\n public static inputSchema(): DataPortSchema {\n return {\n type: \"object\",\n properties: {},\n additionalProperties: false,\n } as const satisfies DataPortSchema;\n }\n\n /**\n * Output schema for this task\n */\n public static outputSchema(): DataPortSchema {\n return {\n type: \"object\",\n properties: {},\n additionalProperties: false,\n } as const satisfies DataPortSchema;\n }\n\n /**\n * Config schema for this task. Subclasses that add config properties MUST override this\n * and spread TaskConfigSchema[\"properties\"] into their own properties object.\n */\n public static configSchema(): DataPortSchema {\n return TaskConfigSchema;\n }\n\n // ========================================================================\n // Task Execution Methods - Core logic provided by subclasses\n // ========================================================================\n\n /**\n * The actual task execution logic for subclasses to override\n *\n * @param input The input to the task\n * @param config The configuration for the task\n * @throws TaskError if the task fails\n * @returns The output of the task or undefined if no changes\n */\n public async execute(_input: Input, context: IExecuteContext): Promise<Output | undefined> {\n if (context.signal?.aborted) {\n throw new TaskAbortedError(\"Task aborted\");\n }\n return undefined;\n }\n\n /**\n * Default implementation of executeReactive that does nothing.\n * Subclasses should override this to provide actual reactive functionality.\n *\n * This is generally for UI updating, and should be lightweight.\n * @param input The input to the task\n * @param output The current output of the task\n * @returns The updated output of the task or undefined if no changes\n */\n public async executeReactive(\n _input: Input,\n output: Output,\n _context: IExecuteReactiveContext\n ): Promise<Output | undefined> {\n return output;\n }\n\n // ========================================================================\n // TaskRunner delegation - Executes and manages the task\n // ========================================================================\n\n /**\n * Task runner for handling the task execution\n */\n protected _runner: TaskRunner<Input, Output, Config> | undefined;\n\n /**\n * Gets the task runner instance\n * Creates a new one if it doesn't exist\n */\n public get runner(): TaskRunner<Input, Output, Config> {\n if (!this._runner) {\n this._runner = new TaskRunner<Input, Output, Config>(this);\n }\n return this._runner;\n }\n\n /**\n * Runs the task and returns the output\n * Delegates to the task runner\n *\n * @param overrides Optional input overrides\n * @param runConfig Optional per-call run configuration (merged with task's runConfig)\n * @throws TaskError if the task fails\n * @returns The task output\n */\n async run(overrides: Partial<Input> = {}, runConfig: Partial<IRunConfig> = {}): Promise<Output> {\n return this.runner.run(overrides, { ...this.runConfig, ...runConfig });\n }\n\n /**\n * Runs the task in reactive mode\n * Delegates to the task runner\n *\n * @param overrides Optional input overrides\n * @returns The task output\n */\n public async runReactive(overrides: Partial<Input> = {}): Promise<Output> {\n return this.runner.runReactive(overrides);\n }\n\n /**\n * Aborts task execution\n * Delegates to the task runner\n */\n public abort(): void {\n this.runner.abort();\n }\n\n /**\n * Disables task execution\n * Delegates to the task runner\n */\n public async disable(): Promise<void> {\n await this.runner.disable();\n }\n\n // ========================================================================\n // Static to Instance conversion methods\n // ========================================================================\n\n /**\n * Gets input schema for this task\n */\n public inputSchema(): DataPortSchema {\n return (this.constructor as typeof Task).inputSchema();\n }\n\n /**\n * Gets output schema for this task\n */\n public outputSchema(): DataPortSchema {\n return (this.constructor as typeof Task).outputSchema();\n }\n\n /**\n * Gets config schema for this task\n */\n public configSchema(): DataPortSchema {\n return (this.constructor as typeof Task).configSchema();\n }\n\n public get type(): TaskTypeName {\n return (this.constructor as typeof Task).type;\n }\n\n public get category(): string {\n return (this.constructor as typeof Task).category;\n }\n\n public get title(): string {\n return this.config?.title ?? (this.constructor as typeof Task).title;\n }\n\n public get description(): string {\n return this.config?.description ?? (this.constructor as typeof Task).description;\n }\n\n public get cacheable(): boolean {\n return (\n this.runConfig?.cacheable ??\n this.config?.cacheable ??\n (this.constructor as typeof Task).cacheable\n );\n }\n\n // ========================================================================\n // Instance properties using @template types\n // ========================================================================\n\n /**\n * Default input values for this task.\n * If no overrides at run time, then this would be equal to the input.\n * resetInputData() will reset inputs to these defaults.\n */\n defaults: Record<string, any>;\n\n /**\n * The input to the task at the time of the task run.\n * This takes defaults from construction time and overrides from run time.\n * It is the input that created the output.\n */\n runInputData: Record<string, any> = {};\n\n /**\n * The output of the task at the time of the task run.\n * This is the result of the task execution.\n */\n runOutputData: Record<string, any> = {};\n\n // ========================================================================\n // Task state properties\n // ========================================================================\n\n /**\n * The configuration of the task\n */\n config: Config;\n\n /**\n * Runtime configuration (not serialized with the task).\n * Set via the constructor's third argument or mutated by the graph runner.\n */\n runConfig: Partial<IRunConfig> = {};\n\n /**\n * Current status of the task\n */\n status: TaskStatus = TaskStatus.PENDING;\n\n /**\n * Progress of the task (0-100)\n */\n progress: number = 0;\n\n /**\n * When the task was created\n */\n createdAt: Date = new Date();\n\n /**\n * When the task started execution\n */\n startedAt?: Date;\n\n /**\n * When the task completed execution\n */\n completedAt?: Date;\n\n /**\n * Error that occurred during task execution, if any\n */\n error?: TaskError;\n\n /**\n * Event emitter for task lifecycle events\n */\n public get events(): EventEmitter<TaskEventListeners> {\n if (!this._events) {\n this._events = new EventEmitter<TaskEventListeners>();\n }\n return this._events;\n }\n protected _events: EventEmitter<TaskEventListeners> | undefined;\n\n /**\n * Creates a new task instance\n *\n * @param callerDefaultInputs Default input values provided by the caller\n * @param config Configuration for the task\n */\n constructor(\n callerDefaultInputs: Partial<Input> = {},\n config: Partial<Config> = {},\n runConfig: Partial<IRunConfig> = {}\n ) {\n // Initialize input defaults\n const inputDefaults = this.getDefaultInputsFromStaticInputDefinitions();\n const mergedDefaults = Object.assign(inputDefaults, callerDefaultInputs);\n // Strip symbol properties (like [$JSONSchema]) before storing defaults\n this.defaults = this.stripSymbols(mergedDefaults) as Record<string, any>;\n this.resetInputData();\n\n // Setup configuration defaults (title comes from static class property as fallback)\n const title = (this.constructor as typeof Task).title || undefined;\n const baseConfig = Object.assign(\n {\n id: uuid4(),\n ...(title ? { title } : {}),\n },\n config\n ) as Config;\n this.config = this.validateAndApplyConfigDefaults(baseConfig);\n\n // Store runtime configuration\n this.runConfig = runConfig;\n }\n\n // ========================================================================\n // Input/Output handling\n // ========================================================================\n\n /**\n * Gets default input values from input schema\n */\n getDefaultInputsFromStaticInputDefinitions(): Partial<Input> {\n const schema = this.inputSchema();\n if (typeof schema === \"boolean\") {\n return {};\n }\n try {\n const compiledSchema = this.getInputSchemaNode(this.type);\n const defaultData = compiledSchema.getData(undefined, {\n addOptionalProps: true,\n removeInvalidData: false,\n useTypeDefaults: false,\n });\n return (defaultData || {}) as Partial<Input>;\n } catch (error) {\n console.warn(\n `Failed to compile input schema for ${this.type}, falling back to manual extraction:`,\n error\n );\n // Fallback to manual extraction if compilation fails\n return Object.entries(schema.properties || {}).reduce<Record<string, any>>(\n (acc, [id, prop]) => {\n const defaultValue = (prop as any).default;\n if (defaultValue !== undefined) {\n acc[id] = defaultValue;\n }\n return acc;\n },\n {}\n ) as Partial<Input>;\n }\n }\n\n /**\n * Resets input data to defaults\n */\n public resetInputData(): void {\n this.runInputData = this.smartClone(this.defaults) as Record<string, any>;\n }\n\n /**\n * Smart clone that deep-clones plain objects and arrays while preserving\n * class instances (objects with non-Object prototype) by reference.\n * Detects and throws an error on circular references.\n *\n * This is necessary because:\n * - structuredClone cannot clone class instances (methods are lost)\n * - JSON.parse/stringify loses methods and fails on circular references\n * - Class instances like repositories should be passed by reference\n *\n * This breaks the idea of everything being json serializable, but it allows\n * more efficient use cases. Do be careful with this though! Use sparingly.\n *\n * @param obj The object to clone\n * @param visited Set of objects in the current cloning path (for circular reference detection)\n * @returns A cloned object with class instances preserved by reference\n */\n private smartClone(obj: any, visited: WeakSet<object> = new WeakSet()): any {\n if (obj === null || obj === undefined) {\n return obj;\n }\n\n // Primitives (string, number, boolean, symbol, bigint) are returned as-is\n if (typeof obj !== \"object\") {\n return obj;\n }\n\n // Check for circular references\n if (visited.has(obj)) {\n throw new TaskConfigurationError(\n \"Circular reference detected in input data. \" +\n \"Cannot clone objects with circular references.\"\n );\n }\n\n // Clone TypedArrays (Float32Array, Int8Array, etc.) to avoid shared-mutation\n // between defaults and runInputData, while preserving DataView by reference.\n if (ArrayBuffer.isView(obj)) {\n // Preserve DataView instances by reference (constructor signature differs)\n if (typeof DataView !== \"undefined\" && obj instanceof DataView) {\n return obj;\n }\n // For TypedArrays, create a new instance with the same data\n const typedArray = obj as any;\n return new (typedArray.constructor as any)(typedArray);\n }\n\n // Preserve class instances (objects with non-Object/non-Array prototype)\n // This includes repository instances, custom classes, etc.\n if (!Array.isArray(obj)) {\n const proto = Object.getPrototypeOf(obj);\n if (proto !== Object.prototype && proto !== null) {\n return obj; // Pass by reference\n }\n }\n\n // Add object to visited set before recursing\n visited.add(obj);\n\n try {\n // Deep clone arrays, preserving class instances within\n if (Array.isArray(obj)) {\n return obj.map((item) => this.smartClone(item, visited));\n }\n\n // Deep clone plain objects\n const result: Record<string, any> = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n result[key] = this.smartClone(obj[key], visited);\n }\n }\n return result;\n } finally {\n // Remove from visited set after processing to allow the same object\n // in different branches (non-circular references)\n visited.delete(obj);\n }\n }\n\n /**\n * Sets the default input values for the task\n *\n * @param defaults The default input values to set\n */\n public setDefaults(defaults: Record<string, any>): void {\n // Strip symbol properties (like [$JSONSchema]) before storing defaults\n this.defaults = this.stripSymbols(defaults) as Record<string, any>;\n }\n\n /**\n * Sets input values for the task\n *\n * @param input Input values to set\n */\n public setInput(input: Record<string, any>): void {\n const schema = this.inputSchema();\n if (typeof schema === \"boolean\") {\n if (schema === true) {\n for (const [inputId, value] of Object.entries(input)) {\n if (value !== undefined) {\n this.runInputData[inputId] = value;\n }\n }\n }\n return;\n }\n const properties = schema.properties || {};\n\n // Copy explicitly defined properties\n for (const [inputId, prop] of Object.entries(properties)) {\n if (input[inputId] !== undefined) {\n this.runInputData[inputId] = input[inputId];\n } else if (this.runInputData[inputId] === undefined && (prop as any).default !== undefined) {\n this.runInputData[inputId] = (prop as any).default;\n }\n }\n\n // If additionalProperties is true, also copy any additional input properties\n if (schema.additionalProperties === true) {\n for (const [inputId, value] of Object.entries(input)) {\n if (!(inputId in properties)) {\n this.runInputData[inputId] = value;\n }\n }\n }\n }\n\n /**\n * Adds/merges input data during graph execution.\n * Unlike {@link setInput}, this method:\n * - Detects changes using deep equality\n * - Accumulates array values (appends rather than replaces)\n * - Handles DATAFLOW_ALL_PORTS for pass-through\n * - Handles additionalProperties for dynamic schemas\n *\n * @param overrides The input data to merge\n * @returns true if any input data was changed, false otherwise\n */\n public addInput(overrides: Partial<Input> | undefined): boolean {\n if (!overrides) return false;\n\n let changed = false;\n const inputSchema = this.inputSchema();\n\n if (typeof inputSchema === \"boolean\") {\n if (inputSchema === false) {\n return false;\n }\n // Schema is `true` - accept any input\n for (const [key, value] of Object.entries(overrides)) {\n if (!deepEqual(this.runInputData[key], value)) {\n this.runInputData[key] = value;\n changed = true;\n }\n }\n return changed;\n }\n\n const properties = inputSchema.properties || {};\n\n for (const [inputId, prop] of Object.entries(properties)) {\n if (inputId === DATAFLOW_ALL_PORTS) {\n this.runInputData = { ...this.runInputData, ...overrides };\n changed = true;\n } else {\n if (overrides[inputId] === undefined) continue;\n const isArray =\n (prop as any)?.type === \"array\" ||\n ((prop as any)?.type === \"any\" &&\n (Array.isArray(overrides[inputId]) || Array.isArray(this.runInputData[inputId])));\n\n if (isArray) {\n const existingItems = Array.isArray(this.runInputData[inputId])\n ? this.runInputData[inputId]\n : [this.runInputData[inputId]];\n const newitems = [...existingItems];\n\n const overrideItem = overrides[inputId];\n if (Array.isArray(overrideItem)) {\n newitems.push(...overrideItem);\n } else {\n newitems.push(overrideItem);\n }\n this.runInputData[inputId] = newitems;\n changed = true;\n } else {\n if (!deepEqual(this.runInputData[inputId], overrides[inputId])) {\n this.runInputData[inputId] = overrides[inputId];\n changed = true;\n }\n }\n }\n }\n\n // If additionalProperties is true, also accept any additional input properties\n if (inputSchema.additionalProperties === true) {\n for (const [inputId, value] of Object.entries(overrides)) {\n if (!(inputId in properties)) {\n if (!deepEqual(this.runInputData[inputId], value)) {\n this.runInputData[inputId] = value;\n changed = true;\n }\n }\n }\n }\n\n return changed;\n }\n\n /**\n * Stub for narrowing input. Override in subclasses for custom logic.\n * @param input The input to narrow\n * @param _registry Optional service registry for lookups\n * @returns The (possibly narrowed) input\n */\n public async narrowInput(\n input: Record<string, any>,\n _registry: ServiceRegistry\n ): Promise<Record<string, any>> {\n return input;\n }\n\n // ========================================================================\n // Event handling methods\n // ========================================================================\n\n /**\n * Subscribes to an event\n */\n public subscribe<Event extends TaskEvents>(\n name: Event,\n fn: TaskEventListener<Event>\n ): () => void {\n return this.events.subscribe(name, fn);\n }\n\n /**\n * Registers an event listener\n */\n public on<Event extends TaskEvents>(name: Event, fn: TaskEventListener<Event>): void {\n this.events.on(name, fn);\n }\n\n /**\n * Removes an event listener\n */\n public off<Event extends TaskEvents>(name: Event, fn: TaskEventListener<Event>): void {\n this.events.off(name, fn);\n }\n\n /**\n * Registers a one-time event listener\n */\n public once<Event extends TaskEvents>(name: Event, fn: TaskEventListener<Event>): void {\n this.events.once(name, fn);\n }\n\n /**\n * Returns a promise that resolves when the specified event is emitted\n */\n public waitOn<Event extends TaskEvents>(name: Event): Promise<TaskEventParameters<Event>> {\n return this.events.waitOn(name) as Promise<TaskEventParameters<Event>>;\n }\n\n /**\n * Emits an event\n */\n public emit<Event extends TaskEvents>(name: Event, ...args: TaskEventParameters<Event>): void {\n // this one is not like the others. Listeners will cause a lazy load of the event emitter.\n // but no need to emit if no one is listening, so we don't want to create the event emitter if not needed\n this._events?.emit(name, ...args);\n }\n\n /**\n * Emits a schemaChange event when the task's input or output schema changes.\n * This should be called by tasks with dynamic schemas when their configuration\n * changes in a way that affects their schemas.\n *\n * @param inputSchema - The new input schema (optional, will use current schema if not provided)\n * @param outputSchema - The new output schema (optional, will use current schema if not provided)\n */\n protected emitSchemaChange(inputSchema?: DataPortSchema, outputSchema?: DataPortSchema): void {\n const finalInputSchema = inputSchema ?? this.inputSchema();\n const finalOutputSchema = outputSchema ?? this.outputSchema();\n this.emit(\"schemaChange\", finalInputSchema, finalOutputSchema);\n }\n\n // ========================================================================\n // Input validation methods\n // ========================================================================\n\n /**\n * The compiled config schema (cached per task type)\n */\n private static _configSchemaNode: Map<string, SchemaNode> = new Map();\n\n /**\n * Gets the compiled config schema node, or undefined if no configSchema is defined.\n */\n private static getConfigSchemaNode(type: TaskTypeName): SchemaNode | undefined {\n const schema = this.configSchema();\n if (!schema) return undefined;\n if (!this._configSchemaNode.has(type)) {\n try {\n const schemaNode =\n typeof schema === \"boolean\"\n ? compileSchema(schema ? {} : { not: {} })\n : compileSchema(schema);\n this._configSchemaNode.set(type, schemaNode);\n } catch (error) {\n console.warn(`Failed to compile config schema for ${this.type}:`, error);\n return undefined;\n }\n }\n return this._configSchemaNode.get(type);\n }\n\n /**\n * Validates config against configSchema.\n * Returns config as-is; throws on validation errors.\n * Returns config as-is if no configSchema is defined.\n */\n private validateAndApplyConfigDefaults(config: Config): Config {\n const ctor = this.constructor as typeof Task;\n const schemaNode = ctor.getConfigSchemaNode(this.type);\n if (!schemaNode) return config;\n\n const result = schemaNode.validate(config);\n if (!result.valid) {\n const errorMessages = result.errors.map((e) => {\n const path = (e as any).data?.pointer || \"\";\n return `${e.message}${path ? ` (${path})` : \"\"}`;\n });\n throw new TaskConfigurationError(\n `[${ctor.name}] Configuration Error: ${errorMessages.join(\", \")}`\n );\n }\n\n return config;\n }\n\n /**\n * The compiled input schema\n */\n private static _inputSchemaNode: Map<string, SchemaNode> = new Map();\n\n protected static generateInputSchemaNode(schema: DataPortSchema) {\n if (typeof schema === \"boolean\") {\n if (schema === false) {\n return compileSchema({ not: {} });\n }\n return compileSchema({});\n }\n return compileSchema(schema);\n }\n\n /**\n * Gets the compiled input schema\n */\n protected static getInputSchemaNode(type: TaskTypeName): SchemaNode {\n if (!this._inputSchemaNode.has(type)) {\n const dataPortSchema = this.inputSchema();\n const schemaNode = this.generateInputSchemaNode(dataPortSchema);\n try {\n this._inputSchemaNode.set(type, schemaNode);\n } catch (error) {\n // If compilation fails, fall back to accepting any object structure\n // This is a safety net for schemas that json-schema-library can't compile\n console.warn(\n `Failed to compile input schema for ${this.type}, falling back to permissive validation:`,\n error\n );\n this._inputSchemaNode.set(type, compileSchema({}));\n }\n }\n return this._inputSchemaNode.get(type)!;\n }\n\n protected getInputSchemaNode(type: TaskTypeName): SchemaNode {\n return (this.constructor as typeof Task).getInputSchemaNode(type);\n }\n\n /**\n * Validates an input data object against the task's input schema\n */\n public async validateInput(input: Partial<Input>): Promise<boolean> {\n const schemaNode = this.getInputSchemaNode(this.type);\n const result = schemaNode.validate(input);\n\n if (!result.valid) {\n const errorMessages = result.errors.map((e) => {\n const path = e.data.pointer || \"\";\n return `${e.message}${path ? ` (${path})` : \"\"}`;\n });\n throw new TaskInvalidInputError(\n `Input ${JSON.stringify(Object.keys(input))} does not match schema: ${errorMessages.join(\", \")}`\n );\n }\n\n return true;\n }\n\n /**\n * Gets the task ID from the config\n */\n public id(): unknown {\n return this.config.id;\n }\n\n // ========================================================================\n // Serialization methods\n // ========================================================================\n\n /**\n * Strips symbol properties from an object to make it serializable\n * @param obj The object to strip symbols from\n * @returns A new object without symbol properties\n */\n private stripSymbols(obj: any): any {\n if (obj === null || obj === undefined) {\n return obj;\n }\n // Preserve TypedArrays (Float32Array, Int8Array, etc.)\n if (ArrayBuffer.isView(obj)) {\n return obj;\n }\n if (Array.isArray(obj)) {\n return obj.map((item) => this.stripSymbols(item));\n }\n if (typeof obj === \"object\") {\n const result: Record<string, any> = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n result[key] = this.stripSymbols(obj[key]);\n }\n }\n return result;\n }\n return obj;\n }\n\n /**\n * Serializes the task and its subtasks into a format that can be stored\n * @returns The serialized task and subtasks\n */\n public toJSON(): TaskGraphItemJson {\n const extras = this.config.extras;\n const json: TaskGraphItemJson = this.stripSymbols({\n id: this.config.id,\n type: this.type,\n defaults: this.defaults,\n config: {\n ...(this.config.title ? { title: this.config.title } : {}),\n ...(this.config.inputSchema ? { inputSchema: this.config.inputSchema } : {}),\n ...(this.config.outputSchema ? { outputSchema: this.config.outputSchema } : {}),\n ...(extras && Object.keys(extras).length ? { extras } : {}),\n },\n });\n return json;\n }\n\n /**\n * Converts the task to a JSON format suitable for dependency tracking\n * @returns The task and subtasks in JSON thats easier for humans to read\n */\n public toDependencyJSON(): JsonTaskItem {\n const json = this.toJSON();\n return json;\n }\n\n // ========================================================================\n // Internal graph methods\n // ========================================================================\n\n /**\n * Checks if the task has children. Useful to gate to use of the internal subGraph\n * as this will return without creating a new graph if graph is non-existent .\n *\n * @returns True if the task has children, otherwise false\n */\n public hasChildren(): boolean {\n return (\n this._subGraph !== undefined &&\n this._subGraph !== null &&\n this._subGraph.getTasks().length > 0\n );\n }\n\n private _taskAddedListener: (taskId: TaskIdType) => void = () => {\n this.emit(\"regenerate\");\n };\n\n /**\n * The internal task graph containing subtasks\n *\n * In the base case, these may just be incidental tasks that are not part of the task graph\n * but are used to manage the task's state as part of task execution. Therefore, the graph\n * is not used by the default runner.\n */\n protected _subGraph: TaskGraph | undefined = undefined;\n\n /**\n * Sets the subtask graph for the compound task\n * @param subGraph The subtask graph to set\n */\n set subGraph(subGraph: TaskGraph) {\n if (this._subGraph) {\n this._subGraph.off(\"task_added\", this._taskAddedListener);\n }\n this._subGraph = subGraph;\n this._subGraph.on(\"task_added\", this._taskAddedListener);\n }\n\n /**\n * The internal task graph containing subtasks\n *\n * In the base case, these may just be incidental tasks that are not part of the task graph\n * but are used to manage the task's state as part of task execution. Therefore, the graph\n * is not used by the default runner.\n *\n * Creates a new graph if one doesn't exist.\n *\n * @returns The task graph\n */\n get subGraph(): TaskGraph {\n if (!this._subGraph) {\n this._subGraph = new TaskGraph();\n this._subGraph.on(\"task_added\", this._taskAddedListener);\n }\n return this._subGraph;\n }\n\n /**\n * Regenerates the task graph, which is internal state to execute() with config.own()\n *\n * This is a destructive operation that removes all dataflows and tasks from the graph.\n * It is used to reset the graph to a clean state.\n *\n * GraphAsTask and others override this and do not call super\n */\n public regenerateGraph(): void {\n if (this.hasChildren()) {\n for (const dataflow of this.subGraph.getDataflows()) {\n this.subGraph.removeDataflow(dataflow);\n }\n for (const child of this.subGraph.getTasks()) {\n this.subGraph.removeTask(child.config.id);\n }\n }\n this.events.emit(\"regenerate\");\n }\n}\n",
12
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n compileSchema,\n deepEqual,\n EventEmitter,\n SchemaNode,\n uuid4,\n type DataPortSchema,\n type ServiceRegistry,\n} from \"@workglow/util\";\nimport { DATAFLOW_ALL_PORTS } from \"../task-graph/Dataflow\";\nimport { TaskGraph } from \"../task-graph/TaskGraph\";\nimport type { IExecuteContext, IExecuteReactiveContext, IRunConfig, ITask } from \"./ITask\";\nimport {\n TaskAbortedError,\n TaskConfigurationError,\n TaskError,\n TaskInvalidInputError,\n} from \"./TaskError\";\nimport {\n type TaskEventListener,\n type TaskEventListeners,\n type TaskEventParameters,\n type TaskEvents,\n} from \"./TaskEvents\";\nimport type { JsonTaskItem, TaskGraphItemJson } from \"./TaskJSON\";\nimport { TaskRunner } from \"./TaskRunner\";\nimport {\n TaskConfigSchema,\n TaskStatus,\n type TaskConfig,\n type TaskIdType,\n type TaskInput,\n type TaskOutput,\n type TaskTypeName,\n} from \"./TaskTypes\";\n\n/**\n * Base class for all tasks that implements the ITask interface.\n * This abstract class provides common functionality for both simple and compound tasks.\n *\n * The Task class is responsible for:\n * 1. Defining what a task is (inputs, outputs, configuration)\n * 2. Providing the execution logic (via execute and executeReactive)\n * 3. Delegating the running logic to a TaskRunner\n */\nexport class Task<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends TaskConfig = TaskConfig,\n> implements ITask<Input, Output, Config> {\n // ========================================================================\n // Static properties - should be overridden by subclasses\n // ========================================================================\n\n /**\n * The type identifier for this task class\n */\n public static type: TaskTypeName = \"Task\";\n\n /**\n * The category this task belongs to\n */\n public static category: string = \"Hidden\";\n\n /**\n * The title of this task\n */\n public static title: string = \"\";\n\n /**\n * The description of this task\n */\n public static description: string = \"\";\n\n /**\n * Whether this task has side effects\n */\n public static cacheable: boolean = true;\n\n /**\n * Whether this task has dynamic input/output schemas that can change at runtime.\n * Tasks with dynamic schemas should override instance methods for inputSchema() and/or outputSchema()\n * and emit 'schemaChange' events when their schemas change.\n */\n public static hasDynamicSchemas: boolean = false;\n\n /**\n * When true, dynamically added input ports (via the universal \"Add Input\" handle in the builder)\n * are mirrored as output ports of the same name and type. Set this on pass-through tasks that\n * forward their additional inputs to their outputs unchanged.\n */\n public static passthroughInputsToOutputs: boolean = false;\n\n /**\n * When true, this task can be saved as a custom task with a preset configuration.\n * Tasks that have meaningful user-facing config options beyond the base fields should set this.\n */\n public static customizable: boolean = false;\n\n /**\n * Input schema for this task\n */\n public static inputSchema(): DataPortSchema {\n return {\n type: \"object\",\n properties: {},\n additionalProperties: false,\n } as const satisfies DataPortSchema;\n }\n\n /**\n * Output schema for this task\n */\n public static outputSchema(): DataPortSchema {\n return {\n type: \"object\",\n properties: {},\n additionalProperties: false,\n } as const satisfies DataPortSchema;\n }\n\n /**\n * Config schema for this task. Subclasses that add config properties MUST override this\n * and spread TaskConfigSchema[\"properties\"] into their own properties object.\n */\n public static configSchema(): DataPortSchema {\n return TaskConfigSchema;\n }\n\n // ========================================================================\n // Task Execution Methods - Core logic provided by subclasses\n // ========================================================================\n\n /**\n * The actual task execution logic for subclasses to override\n *\n * @param input The input to the task\n * @param config The configuration for the task\n * @throws TaskError if the task fails\n * @returns The output of the task or undefined if no changes\n */\n public async execute(_input: Input, context: IExecuteContext): Promise<Output | undefined> {\n if (context.signal?.aborted) {\n throw new TaskAbortedError(\"Task aborted\");\n }\n return undefined;\n }\n\n /**\n * Default implementation of executeReactive that does nothing.\n * Subclasses should override this to provide actual reactive functionality.\n *\n * This is generally for UI updating, and should be lightweight.\n * @param input The input to the task\n * @param output The current output of the task\n * @returns The updated output of the task or undefined if no changes\n */\n public async executeReactive(\n _input: Input,\n output: Output,\n _context: IExecuteReactiveContext\n ): Promise<Output | undefined> {\n return output;\n }\n\n // ========================================================================\n // TaskRunner delegation - Executes and manages the task\n // ========================================================================\n\n /**\n * Task runner for handling the task execution\n */\n protected _runner: TaskRunner<Input, Output, Config> | undefined;\n\n /**\n * Gets the task runner instance\n * Creates a new one if it doesn't exist\n */\n public get runner(): TaskRunner<Input, Output, Config> {\n if (!this._runner) {\n this._runner = new TaskRunner<Input, Output, Config>(this);\n }\n return this._runner;\n }\n\n /**\n * Runs the task and returns the output\n * Delegates to the task runner\n *\n * @param overrides Optional input overrides\n * @param runConfig Optional per-call run configuration (merged with task's runConfig)\n * @throws TaskError if the task fails\n * @returns The task output\n */\n async run(overrides: Partial<Input> = {}, runConfig: Partial<IRunConfig> = {}): Promise<Output> {\n return this.runner.run(overrides, { ...this.runConfig, ...runConfig });\n }\n\n /**\n * Runs the task in reactive mode\n * Delegates to the task runner\n *\n * @param overrides Optional input overrides\n * @returns The task output\n */\n public async runReactive(overrides: Partial<Input> = {}): Promise<Output> {\n return this.runner.runReactive(overrides);\n }\n\n /**\n * Aborts task execution\n * Delegates to the task runner\n */\n public abort(): void {\n this.runner.abort();\n }\n\n /**\n * Disables task execution\n * Delegates to the task runner\n */\n public async disable(): Promise<void> {\n await this.runner.disable();\n }\n\n // ========================================================================\n // Static to Instance conversion methods\n // ========================================================================\n\n /**\n * Gets input schema for this task\n */\n public inputSchema(): DataPortSchema {\n return (this.constructor as typeof Task).inputSchema();\n }\n\n /**\n * Gets output schema for this task\n */\n public outputSchema(): DataPortSchema {\n return (this.constructor as typeof Task).outputSchema();\n }\n\n /**\n * Gets config schema for this task\n */\n public configSchema(): DataPortSchema {\n return (this.constructor as typeof Task).configSchema();\n }\n\n public get type(): TaskTypeName {\n return (this.constructor as typeof Task).type;\n }\n\n public get category(): string {\n return (this.constructor as typeof Task).category;\n }\n\n public get title(): string {\n return this.config?.title ?? (this.constructor as typeof Task).title;\n }\n\n public get description(): string {\n return this.config?.description ?? (this.constructor as typeof Task).description;\n }\n\n public get cacheable(): boolean {\n return (\n this.runConfig?.cacheable ??\n this.config?.cacheable ??\n (this.constructor as typeof Task).cacheable\n );\n }\n\n // ========================================================================\n // Instance properties using @template types\n // ========================================================================\n\n /**\n * Default input values for this task.\n * If no overrides at run time, then this would be equal to the input.\n * resetInputData() will reset inputs to these defaults.\n */\n defaults: Record<string, any>;\n\n /**\n * The input to the task at the time of the task run.\n * This takes defaults from construction time and overrides from run time.\n * It is the input that created the output.\n */\n runInputData: Record<string, any> = {};\n\n /**\n * The output of the task at the time of the task run.\n * This is the result of the task execution.\n */\n runOutputData: Record<string, any> = {};\n\n // ========================================================================\n // Task state properties\n // ========================================================================\n\n /**\n * The configuration of the task\n */\n config: Config;\n\n /**\n * Runtime configuration (not serialized with the task).\n * Set via the constructor's third argument or mutated by the graph runner.\n */\n runConfig: Partial<IRunConfig> = {};\n\n /**\n * Current status of the task\n */\n status: TaskStatus = TaskStatus.PENDING;\n\n /**\n * Progress of the task (0-100)\n */\n progress: number = 0;\n\n /**\n * When the task was created\n */\n createdAt: Date = new Date();\n\n /**\n * When the task started execution\n */\n startedAt?: Date;\n\n /**\n * When the task completed execution\n */\n completedAt?: Date;\n\n /**\n * Error that occurred during task execution, if any\n */\n error?: TaskError;\n\n /**\n * Event emitter for task lifecycle events\n */\n public get events(): EventEmitter<TaskEventListeners> {\n if (!this._events) {\n this._events = new EventEmitter<TaskEventListeners>();\n }\n return this._events;\n }\n protected _events: EventEmitter<TaskEventListeners> | undefined;\n\n /**\n * Creates a new task instance\n *\n * @param callerDefaultInputs Default input values provided by the caller\n * @param config Configuration for the task\n */\n constructor(\n callerDefaultInputs: Partial<Input> = {},\n config: Partial<Config> = {},\n runConfig: Partial<IRunConfig> = {}\n ) {\n // Initialize input defaults\n const inputDefaults = this.getDefaultInputsFromStaticInputDefinitions();\n const mergedDefaults = Object.assign(inputDefaults, callerDefaultInputs);\n // Strip symbol properties (like [$JSONSchema]) before storing defaults\n this.defaults = this.stripSymbols(mergedDefaults) as Record<string, any>;\n this.resetInputData();\n\n // Setup configuration defaults (title comes from static class property as fallback)\n const title = (this.constructor as typeof Task).title || undefined;\n const baseConfig = Object.assign(\n {\n id: uuid4(),\n ...(title ? { title } : {}),\n },\n config\n ) as Config;\n this.config = this.validateAndApplyConfigDefaults(baseConfig);\n\n // Store runtime configuration\n this.runConfig = runConfig;\n }\n\n // ========================================================================\n // Input/Output handling\n // ========================================================================\n\n /**\n * Gets default input values from input schema\n */\n getDefaultInputsFromStaticInputDefinitions(): Partial<Input> {\n const schema = this.inputSchema();\n if (typeof schema === \"boolean\") {\n return {};\n }\n try {\n const compiledSchema = this.getInputSchemaNode(this.type);\n const defaultData = compiledSchema.getData(undefined, {\n addOptionalProps: true,\n removeInvalidData: false,\n useTypeDefaults: false,\n });\n return (defaultData || {}) as Partial<Input>;\n } catch (error) {\n console.warn(\n `Failed to compile input schema for ${this.type}, falling back to manual extraction:`,\n error\n );\n // Fallback to manual extraction if compilation fails\n return Object.entries(schema.properties || {}).reduce<Record<string, any>>(\n (acc, [id, prop]) => {\n const defaultValue = (prop as any).default;\n if (defaultValue !== undefined) {\n acc[id] = defaultValue;\n }\n return acc;\n },\n {}\n ) as Partial<Input>;\n }\n }\n\n /**\n * Resets input data to defaults\n */\n public resetInputData(): void {\n this.runInputData = this.smartClone(this.defaults) as Record<string, any>;\n }\n\n /**\n * Smart clone that deep-clones plain objects and arrays while preserving\n * class instances (objects with non-Object prototype) by reference.\n * Detects and throws an error on circular references.\n *\n * This is necessary because:\n * - structuredClone cannot clone class instances (methods are lost)\n * - JSON.parse/stringify loses methods and fails on circular references\n * - Class instances like repositories should be passed by reference\n *\n * This breaks the idea of everything being json serializable, but it allows\n * more efficient use cases. Do be careful with this though! Use sparingly.\n *\n * @param obj The object to clone\n * @param visited Set of objects in the current cloning path (for circular reference detection)\n * @returns A cloned object with class instances preserved by reference\n */\n private smartClone(obj: any, visited: WeakSet<object> = new WeakSet()): any {\n if (obj === null || obj === undefined) {\n return obj;\n }\n\n // Primitives (string, number, boolean, symbol, bigint) are returned as-is\n if (typeof obj !== \"object\") {\n return obj;\n }\n\n // Check for circular references\n if (visited.has(obj)) {\n throw new TaskConfigurationError(\n \"Circular reference detected in input data. \" +\n \"Cannot clone objects with circular references.\"\n );\n }\n\n // Clone TypedArrays (Float32Array, Int8Array, etc.) to avoid shared-mutation\n // between defaults and runInputData, while preserving DataView by reference.\n if (ArrayBuffer.isView(obj)) {\n // Preserve DataView instances by reference (constructor signature differs)\n if (typeof DataView !== \"undefined\" && obj instanceof DataView) {\n return obj;\n }\n // For TypedArrays, create a new instance with the same data\n const typedArray = obj as any;\n return new (typedArray.constructor as any)(typedArray);\n }\n\n // Preserve class instances (objects with non-Object/non-Array prototype)\n // This includes repository instances, custom classes, etc.\n if (!Array.isArray(obj)) {\n const proto = Object.getPrototypeOf(obj);\n if (proto !== Object.prototype && proto !== null) {\n return obj; // Pass by reference\n }\n }\n\n // Add object to visited set before recursing\n visited.add(obj);\n\n try {\n // Deep clone arrays, preserving class instances within\n if (Array.isArray(obj)) {\n return obj.map((item) => this.smartClone(item, visited));\n }\n\n // Deep clone plain objects\n const result: Record<string, any> = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n result[key] = this.smartClone(obj[key], visited);\n }\n }\n return result;\n } finally {\n // Remove from visited set after processing to allow the same object\n // in different branches (non-circular references)\n visited.delete(obj);\n }\n }\n\n /**\n * Sets the default input values for the task\n *\n * @param defaults The default input values to set\n */\n public setDefaults(defaults: Record<string, any>): void {\n // Strip symbol properties (like [$JSONSchema]) before storing defaults\n this.defaults = this.stripSymbols(defaults) as Record<string, any>;\n }\n\n /**\n * Sets input values for the task\n *\n * @param input Input values to set\n */\n public setInput(input: Record<string, any>): void {\n const schema = this.inputSchema();\n if (typeof schema === \"boolean\") {\n if (schema === true) {\n for (const [inputId, value] of Object.entries(input)) {\n if (value !== undefined) {\n this.runInputData[inputId] = value;\n }\n }\n }\n return;\n }\n const properties = schema.properties || {};\n\n // Copy explicitly defined properties\n for (const [inputId, prop] of Object.entries(properties)) {\n if (input[inputId] !== undefined) {\n this.runInputData[inputId] = input[inputId];\n } else if (this.runInputData[inputId] === undefined && (prop as any).default !== undefined) {\n this.runInputData[inputId] = (prop as any).default;\n }\n }\n\n // If additionalProperties is true, also copy any additional input properties\n if (schema.additionalProperties === true) {\n for (const [inputId, value] of Object.entries(input)) {\n if (!(inputId in properties)) {\n this.runInputData[inputId] = value;\n }\n }\n }\n }\n\n /**\n * Adds/merges input data during graph execution.\n * Unlike {@link setInput}, this method:\n * - Detects changes using deep equality\n * - Accumulates array values (appends rather than replaces)\n * - Handles DATAFLOW_ALL_PORTS for pass-through\n * - Handles additionalProperties for dynamic schemas\n *\n * @param overrides The input data to merge\n * @returns true if any input data was changed, false otherwise\n */\n public addInput(overrides: Partial<Input> | undefined): boolean {\n if (!overrides) return false;\n\n let changed = false;\n const inputSchema = this.inputSchema();\n\n if (typeof inputSchema === \"boolean\") {\n if (inputSchema === false) {\n return false;\n }\n // Schema is `true` - accept any input\n for (const [key, value] of Object.entries(overrides)) {\n if (!deepEqual(this.runInputData[key], value)) {\n this.runInputData[key] = value;\n changed = true;\n }\n }\n return changed;\n }\n\n const properties = inputSchema.properties || {};\n\n for (const [inputId, prop] of Object.entries(properties)) {\n if (inputId === DATAFLOW_ALL_PORTS) {\n this.runInputData = { ...this.runInputData, ...overrides };\n changed = true;\n } else {\n if (overrides[inputId] === undefined) continue;\n const isArray =\n (prop as any)?.type === \"array\" ||\n ((prop as any)?.type === \"any\" &&\n (Array.isArray(overrides[inputId]) || Array.isArray(this.runInputData[inputId])));\n\n if (isArray) {\n const existingItems = Array.isArray(this.runInputData[inputId])\n ? this.runInputData[inputId]\n : [this.runInputData[inputId]];\n const newitems = [...existingItems];\n\n const overrideItem = overrides[inputId];\n if (Array.isArray(overrideItem)) {\n newitems.push(...overrideItem);\n } else {\n newitems.push(overrideItem);\n }\n this.runInputData[inputId] = newitems;\n changed = true;\n } else {\n if (!deepEqual(this.runInputData[inputId], overrides[inputId])) {\n this.runInputData[inputId] = overrides[inputId];\n changed = true;\n }\n }\n }\n }\n\n // If additionalProperties is true, also accept any additional input properties\n if (inputSchema.additionalProperties === true) {\n for (const [inputId, value] of Object.entries(overrides)) {\n if (!(inputId in properties)) {\n if (!deepEqual(this.runInputData[inputId], value)) {\n this.runInputData[inputId] = value;\n changed = true;\n }\n }\n }\n }\n\n return changed;\n }\n\n /**\n * Stub for narrowing input. Override in subclasses for custom logic.\n * @param input The input to narrow\n * @param _registry Optional service registry for lookups\n * @returns The (possibly narrowed) input\n */\n public async narrowInput(\n input: Record<string, any>,\n _registry: ServiceRegistry\n ): Promise<Record<string, any>> {\n return input;\n }\n\n // ========================================================================\n // Event handling methods\n // ========================================================================\n\n /**\n * Subscribes to an event\n */\n public subscribe<Event extends TaskEvents>(\n name: Event,\n fn: TaskEventListener<Event>\n ): () => void {\n return this.events.subscribe(name, fn);\n }\n\n /**\n * Registers an event listener\n */\n public on<Event extends TaskEvents>(name: Event, fn: TaskEventListener<Event>): void {\n this.events.on(name, fn);\n }\n\n /**\n * Removes an event listener\n */\n public off<Event extends TaskEvents>(name: Event, fn: TaskEventListener<Event>): void {\n this.events.off(name, fn);\n }\n\n /**\n * Registers a one-time event listener\n */\n public once<Event extends TaskEvents>(name: Event, fn: TaskEventListener<Event>): void {\n this.events.once(name, fn);\n }\n\n /**\n * Returns a promise that resolves when the specified event is emitted\n */\n public waitOn<Event extends TaskEvents>(name: Event): Promise<TaskEventParameters<Event>> {\n return this.events.waitOn(name) as Promise<TaskEventParameters<Event>>;\n }\n\n /**\n * Emits an event\n */\n public emit<Event extends TaskEvents>(name: Event, ...args: TaskEventParameters<Event>): void {\n // this one is not like the others. Listeners will cause a lazy load of the event emitter.\n // but no need to emit if no one is listening, so we don't want to create the event emitter if not needed\n this._events?.emit(name, ...args);\n }\n\n /**\n * Emits a schemaChange event when the task's input or output schema changes.\n * This should be called by tasks with dynamic schemas when their configuration\n * changes in a way that affects their schemas.\n *\n * @param inputSchema - The new input schema (optional, will use current schema if not provided)\n * @param outputSchema - The new output schema (optional, will use current schema if not provided)\n */\n protected emitSchemaChange(inputSchema?: DataPortSchema, outputSchema?: DataPortSchema): void {\n const finalInputSchema = inputSchema ?? this.inputSchema();\n const finalOutputSchema = outputSchema ?? this.outputSchema();\n this.emit(\"schemaChange\", finalInputSchema, finalOutputSchema);\n }\n\n // ========================================================================\n // Input validation methods\n // ========================================================================\n\n /**\n * The compiled config schema (cached per task type)\n */\n private static _configSchemaNode: Map<string, SchemaNode> = new Map();\n\n /**\n * Gets the compiled config schema node, or undefined if no configSchema is defined.\n */\n private static getConfigSchemaNode(type: TaskTypeName): SchemaNode | undefined {\n const schema = this.configSchema();\n if (!schema) return undefined;\n if (!this._configSchemaNode.has(type)) {\n try {\n const schemaNode =\n typeof schema === \"boolean\"\n ? compileSchema(schema ? {} : { not: {} })\n : compileSchema(schema);\n this._configSchemaNode.set(type, schemaNode);\n } catch (error) {\n console.warn(`Failed to compile config schema for ${this.type}:`, error);\n return undefined;\n }\n }\n return this._configSchemaNode.get(type);\n }\n\n /**\n * Validates config against configSchema.\n * Returns config as-is; throws on validation errors.\n * Returns config as-is if no configSchema is defined.\n */\n private validateAndApplyConfigDefaults(config: Config): Config {\n const ctor = this.constructor as typeof Task;\n const schemaNode = ctor.getConfigSchemaNode(this.type);\n if (!schemaNode) return config;\n\n const result = schemaNode.validate(config);\n if (!result.valid) {\n const errorMessages = result.errors.map((e) => {\n const path = (e as any).data?.pointer || \"\";\n return `${e.message}${path ? ` (${path})` : \"\"}`;\n });\n throw new TaskConfigurationError(\n `[${ctor.name}] Configuration Error: ${errorMessages.join(\", \")}`\n );\n }\n\n return config;\n }\n\n /**\n * The compiled input schema\n */\n private static _inputSchemaNode: Map<string, SchemaNode> = new Map();\n\n protected static generateInputSchemaNode(schema: DataPortSchema) {\n if (typeof schema === \"boolean\") {\n if (schema === false) {\n return compileSchema({ not: {} });\n }\n return compileSchema({});\n }\n return compileSchema(schema);\n }\n\n /**\n * Gets the compiled input schema\n */\n protected static getInputSchemaNode(type: TaskTypeName): SchemaNode {\n if (!this._inputSchemaNode.has(type)) {\n const dataPortSchema = this.inputSchema();\n const schemaNode = this.generateInputSchemaNode(dataPortSchema);\n try {\n this._inputSchemaNode.set(type, schemaNode);\n } catch (error) {\n // If compilation fails, fall back to accepting any object structure\n // This is a safety net for schemas that json-schema-library can't compile\n console.warn(\n `Failed to compile input schema for ${this.type}, falling back to permissive validation:`,\n error\n );\n this._inputSchemaNode.set(type, compileSchema({}));\n }\n }\n return this._inputSchemaNode.get(type)!;\n }\n\n protected getInputSchemaNode(type: TaskTypeName): SchemaNode {\n return (this.constructor as typeof Task).getInputSchemaNode(type);\n }\n\n /**\n * Validates an input data object against the task's input schema\n */\n public async validateInput(input: Partial<Input>): Promise<boolean> {\n const ctor = this.constructor as typeof Task;\n let schemaNode: SchemaNode;\n if (ctor.hasDynamicSchemas) {\n // Dynamic-schema tasks use instance inputSchema() (e.g. config.inputSchema), not the static fallback.\n // The cached getInputSchemaNode uses static inputSchema() which would reject valid instance-specific inputs.\n const instanceSchema = this.inputSchema();\n schemaNode = ctor.generateInputSchemaNode(instanceSchema);\n } else {\n schemaNode = this.getInputSchemaNode(this.type);\n }\n const result = schemaNode.validate(input);\n\n if (!result.valid) {\n const errorMessages = result.errors.map((e) => {\n const path = e.data.pointer || \"\";\n return `${e.message}${path ? ` (${path})` : \"\"}`;\n });\n throw new TaskInvalidInputError(\n `Input ${JSON.stringify(Object.keys(input))} does not match schema: ${errorMessages.join(\", \")}`\n );\n }\n\n return true;\n }\n\n /**\n * Gets the task ID from the config\n */\n public id(): unknown {\n return this.config.id;\n }\n\n // ========================================================================\n // Serialization methods\n // ========================================================================\n\n /**\n * Strips symbol properties from an object to make it serializable\n * @param obj The object to strip symbols from\n * @returns A new object without symbol properties\n */\n private stripSymbols(obj: any): any {\n if (obj === null || obj === undefined) {\n return obj;\n }\n // Preserve TypedArrays (Float32Array, Int8Array, etc.)\n if (ArrayBuffer.isView(obj)) {\n return obj;\n }\n if (Array.isArray(obj)) {\n return obj.map((item) => this.stripSymbols(item));\n }\n if (typeof obj === \"object\") {\n const result: Record<string, any> = {};\n for (const key in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, key)) {\n result[key] = this.stripSymbols(obj[key]);\n }\n }\n return result;\n }\n return obj;\n }\n\n /**\n * Serializes the task and its subtasks into a format that can be stored\n * @returns The serialized task and subtasks\n */\n public toJSON(): TaskGraphItemJson {\n const extras = this.config.extras;\n const json: TaskGraphItemJson = this.stripSymbols({\n id: this.config.id,\n type: this.type,\n defaults: this.defaults,\n config: {\n ...(this.config.title ? { title: this.config.title } : {}),\n ...(this.config.inputSchema ? { inputSchema: this.config.inputSchema } : {}),\n ...(this.config.outputSchema ? { outputSchema: this.config.outputSchema } : {}),\n ...(extras && Object.keys(extras).length ? { extras } : {}),\n },\n });\n return json;\n }\n\n /**\n * Converts the task to a JSON format suitable for dependency tracking\n * @returns The task and subtasks in JSON thats easier for humans to read\n */\n public toDependencyJSON(): JsonTaskItem {\n const json = this.toJSON();\n return json;\n }\n\n // ========================================================================\n // Internal graph methods\n // ========================================================================\n\n /**\n * Checks if the task has children. Useful to gate to use of the internal subGraph\n * as this will return without creating a new graph if graph is non-existent .\n *\n * @returns True if the task has children, otherwise false\n */\n public hasChildren(): boolean {\n return (\n this._subGraph !== undefined &&\n this._subGraph !== null &&\n this._subGraph.getTasks().length > 0\n );\n }\n\n private _taskAddedListener: (taskId: TaskIdType) => void = () => {\n this.emit(\"regenerate\");\n };\n\n /**\n * The internal task graph containing subtasks\n *\n * In the base case, these may just be incidental tasks that are not part of the task graph\n * but are used to manage the task's state as part of task execution. Therefore, the graph\n * is not used by the default runner.\n */\n protected _subGraph: TaskGraph | undefined = undefined;\n\n /**\n * Sets the subtask graph for the compound task\n * @param subGraph The subtask graph to set\n */\n set subGraph(subGraph: TaskGraph) {\n if (this._subGraph) {\n this._subGraph.off(\"task_added\", this._taskAddedListener);\n }\n this._subGraph = subGraph;\n this._subGraph.on(\"task_added\", this._taskAddedListener);\n }\n\n /**\n * The internal task graph containing subtasks\n *\n * In the base case, these may just be incidental tasks that are not part of the task graph\n * but are used to manage the task's state as part of task execution. Therefore, the graph\n * is not used by the default runner.\n *\n * Creates a new graph if one doesn't exist.\n *\n * @returns The task graph\n */\n get subGraph(): TaskGraph {\n if (!this._subGraph) {\n this._subGraph = new TaskGraph();\n this._subGraph.on(\"task_added\", this._taskAddedListener);\n }\n return this._subGraph;\n }\n\n /**\n * Regenerates the task graph, which is internal state to execute() with config.own()\n *\n * This is a destructive operation that removes all dataflows and tasks from the graph.\n * It is used to reset the graph to a clean state.\n *\n * GraphAsTask and others override this and do not call super\n */\n public regenerateGraph(): void {\n if (this.hasChildren()) {\n for (const dataflow of this.subGraph.getDataflows()) {\n this.subGraph.removeDataflow(dataflow);\n }\n for (const child of this.subGraph.getTasks()) {\n this.subGraph.removeTask(child.config.id);\n }\n }\n this.events.emit(\"regenerate\");\n }\n}\n",
13
13
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { JobError } from \"@workglow/job-queue\";\nimport { BaseError } from \"@workglow/util\";\n\nexport class TaskError extends BaseError {\n static readonly type: string = \"TaskError\";\n constructor(message: string) {\n super(message);\n }\n}\n\n/**\n * A task configuration error\n *\n */\nexport class TaskConfigurationError extends TaskError {\n static readonly type: string = \"TaskConfigurationError\";\n constructor(message: string) {\n super(message);\n }\n}\n\n/**\n * A task workflow error\n */\nexport class WorkflowError extends TaskError {\n static readonly type: string = \"WorkflowError\";\n constructor(message: string) {\n super(message);\n }\n}\n\n/**\n * A task error that is caused by a task being aborted\n *\n * Examples: task.abort() was called, or some other reason an abort signal was received\n */\nexport class TaskAbortedError extends TaskError {\n static readonly type: string = \"TaskAbortedError\";\n constructor(message: string = \"Task aborted\") {\n super(message);\n }\n}\n\n/**\n * A task error that is caused by a task failing\n *\n * Examples: task.run() threw an error\n */\nexport class TaskFailedError extends TaskError {\n static readonly type: string = \"TaskFailedError\";\n constructor(message: string = \"Task failed\") {\n super(message);\n }\n}\n\nexport class JobTaskFailedError extends TaskFailedError {\n static readonly type: string = \"JobTaskFailedError\";\n public jobError: JobError;\n constructor(err: JobError) {\n super(String(err));\n this.jobError = err;\n }\n}\n\n/**\n * A task error that is caused by an error converting JSON to a Task\n */\nexport class TaskJSONError extends TaskError {\n static readonly type: string = \"TaskJSONError\";\n constructor(message: string = \"Error converting JSON to a Task\") {\n super(message);\n }\n}\n\n/**\n * A task error that is caused by invalid input data\n *\n * Examples: task.run() received invalid input data\n */\nexport class TaskInvalidInputError extends TaskError {\n static readonly type: string = \"TaskInvalidInputError\";\n constructor(message: string = \"Invalid input data\") {\n super(message);\n }\n}\n",
14
14
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { globalServiceRegistry, ServiceRegistry } from \"@workglow/util\";\nimport { TASK_OUTPUT_REPOSITORY, TaskOutputRepository } from \"../storage/TaskOutputRepository\";\nimport { ensureTask, type Taskish } from \"../task-graph/Conversions\";\nimport { resolveSchemaInputs } from \"./InputResolver\";\nimport { IRunConfig, ITask } from \"./ITask\";\nimport { ITaskRunner } from \"./ITaskRunner\";\nimport {\n getOutputStreamMode,\n getStreamingPorts,\n isTaskStreamable,\n type StreamEvent,\n type StreamMode,\n} from \"./StreamTypes\";\nimport { Task } from \"./Task\";\nimport { TaskAbortedError, TaskError, TaskFailedError, TaskInvalidInputError } from \"./TaskError\";\nimport { TaskConfig, TaskInput, TaskOutput, TaskStatus } from \"./TaskTypes\";\n\n/**\n * Responsible for running tasks\n * Manages the execution lifecycle of individual tasks\n */\nexport class TaskRunner<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends TaskConfig = TaskConfig,\n> implements ITaskRunner<Input, Output, Config> {\n /**\n * Whether the task is currently running\n */\n protected running = false;\n protected reactiveRunning = false;\n\n /**\n * The task to run\n */\n public readonly task: ITask<Input, Output, Config>;\n\n /**\n * AbortController for cancelling task execution\n */\n protected abortController?: AbortController;\n\n /**\n * The output cache for the task\n */\n protected outputCache?: TaskOutputRepository;\n\n /**\n * The service registry for the task\n */\n protected registry: ServiceRegistry = globalServiceRegistry;\n\n /**\n * Input streams for pass-through streaming tasks.\n * Set by the graph runner before executing a streaming task that has\n * upstream streaming edges. Keyed by input port name.\n */\n public inputStreams?: Map<string, ReadableStream<StreamEvent>>;\n\n /**\n * Whether the streaming task runner should accumulate text-delta chunks and\n * emit an enriched finish event. Set from IRunConfig.shouldAccumulate.\n * Defaults to true so standalone task execution is backward-compatible.\n * The graph runner sets this to false when no downstream edge needs\n * materialized data (no cache, all downstream tasks are also streaming).\n */\n protected shouldAccumulate: boolean = true;\n\n /**\n * Constructor for TaskRunner\n * @param task The task to run\n */\n constructor(task: ITask<Input, Output, Config>) {\n this.task = task;\n this.own = this.own.bind(this);\n this.handleProgress = this.handleProgress.bind(this);\n }\n\n // ========================================================================\n // Public methods\n // ========================================================================\n\n /**\n * Runs the task and returns the output\n * @param overrides Optional input overrides\n * @param config Optional configuration overrides\n * @returns The task output\n */\n async run(overrides: Partial<Input> = {}, config: IRunConfig = {}): Promise<Output> {\n await this.handleStart(config);\n\n try {\n this.task.setInput(overrides);\n\n // Resolve schema-annotated inputs (models, repositories) before validation\n const schema = (this.task.constructor as typeof Task).inputSchema();\n this.task.runInputData = (await resolveSchemaInputs(\n this.task.runInputData as Record<string, unknown>,\n schema,\n { registry: this.registry }\n )) as Input;\n\n const isValid = await this.task.validateInput(this.task.runInputData);\n if (!isValid) {\n throw new TaskInvalidInputError(\"Invalid input data\");\n }\n\n if (this.abortController?.signal.aborted) {\n await this.handleAbort();\n throw new TaskAbortedError(\"Promise for task created and aborted before run\");\n }\n\n const inputs: Input = this.task.runInputData as Input;\n let outputs: Output | undefined;\n\n const isStreamable = isTaskStreamable(this.task);\n\n if (this.task.cacheable) {\n outputs = (await this.outputCache?.getOutput(this.task.type, inputs)) as Output;\n if (outputs) {\n if (isStreamable) {\n this.task.runOutputData = outputs;\n this.task.emit(\"stream_start\");\n this.task.emit(\"stream_chunk\", { type: \"finish\", data: outputs } as StreamEvent);\n this.task.emit(\"stream_end\", outputs);\n this.task.runOutputData = await this.executeTaskReactive(inputs, outputs);\n } else {\n this.task.runOutputData = await this.executeTaskReactive(inputs, outputs);\n }\n }\n }\n if (!outputs) {\n if (isStreamable) {\n outputs = await this.executeStreamingTask(inputs);\n } else {\n outputs = await this.executeTask(inputs);\n }\n if (this.task.cacheable && outputs !== undefined) {\n await this.outputCache?.saveOutput(this.task.type, inputs, outputs);\n }\n this.task.runOutputData = outputs ?? ({} as Output);\n }\n\n await this.handleComplete();\n\n return this.task.runOutputData as Output;\n } catch (err: any) {\n await this.handleError(err);\n throw err;\n }\n }\n\n /**\n * Runs the task in reactive mode\n * @param overrides Optional input overrides\n * @returns The task output\n */\n public async runReactive(overrides: Partial<Input> = {}): Promise<Output> {\n if (this.task.status === TaskStatus.PROCESSING) {\n return this.task.runOutputData as Output;\n }\n this.task.setInput(overrides);\n\n // Resolve schema-annotated inputs (models, repositories) before validation\n const schema = (this.task.constructor as typeof Task).inputSchema();\n this.task.runInputData = (await resolveSchemaInputs(\n this.task.runInputData as Record<string, unknown>,\n schema,\n { registry: this.registry }\n )) as Input;\n\n await this.handleStartReactive();\n\n try {\n const isValid = await this.task.validateInput(this.task.runInputData);\n if (!isValid) {\n throw new TaskInvalidInputError(\"Invalid input data\");\n }\n\n const resultReactive = await this.executeTaskReactive(\n this.task.runInputData as Input,\n this.task.runOutputData as Output\n );\n\n this.task.runOutputData = resultReactive;\n\n await this.handleCompleteReactive();\n } catch (err: any) {\n await this.handleErrorReactive();\n } finally {\n return this.task.runOutputData as Output;\n }\n }\n\n /**\n * Aborts task execution\n */\n public abort(): void {\n if (this.task.hasChildren()) {\n this.task.subGraph.abort();\n }\n this.abortController?.abort();\n }\n\n // ========================================================================\n // Protected methods\n // ========================================================================\n\n protected own<T extends Taskish<any, any>>(i: T): T {\n const task = ensureTask(i, { isOwned: true });\n this.task.subGraph.addTask(task);\n return i;\n }\n\n /**\n * Protected method to execute a task by delegating back to the task itself.\n */\n protected async executeTask(input: Input): Promise<Output | undefined> {\n const result = await this.task.execute(input, {\n signal: this.abortController!.signal,\n updateProgress: this.handleProgress.bind(this),\n own: this.own,\n registry: this.registry,\n });\n return await this.executeTaskReactive(input, result || ({} as Output));\n }\n\n /**\n * Protected method for reactive execution delegation\n */\n protected async executeTaskReactive(input: Input, output: Output): Promise<Output> {\n const reactiveResult = await this.task.executeReactive(input, output, { own: this.own });\n return Object.assign({}, output, reactiveResult ?? {}) as Output;\n }\n\n /**\n * Executes a streaming task by consuming its executeStream() async iterable.\n *\n * When `shouldAccumulate` is true (default, set by graph runner when any downstream\n * edge needs materialized data, or when caching is on):\n * - text-delta chunks are accumulated per-port into a Map\n * - the raw finish event is NOT emitted; instead an enriched finish event is\n * emitted with the accumulated text merged in, so downstream dataflows can\n * materialize values without re-accumulating on their own\n *\n * When `shouldAccumulate` is false (set by graph runner when all downstream edges\n * are also streaming and no cache is needed):\n * - all events including the raw finish are emitted as-is (pure pass-through)\n * - no accumulation Map is maintained\n */\n protected async executeStreamingTask(input: Input): Promise<Output | undefined> {\n const streamMode: StreamMode = getOutputStreamMode(this.task.outputSchema());\n if (streamMode === \"append\") {\n const ports = getStreamingPorts(this.task.outputSchema());\n if (ports.length === 0) {\n throw new TaskError(\n `Task ${this.task.type} declares append streaming but no output port has x-stream: \"append\"`\n );\n }\n }\n\n const accumulated = this.shouldAccumulate ? new Map<string, string>() : undefined;\n let chunkCount = 0;\n let finalOutput: Output | undefined;\n\n this.task.emit(\"stream_start\");\n\n const stream = this.task.executeStream!(input, {\n signal: this.abortController!.signal,\n updateProgress: this.handleProgress.bind(this),\n own: this.own,\n registry: this.registry,\n inputStreams: this.inputStreams,\n });\n\n for await (const event of stream) {\n chunkCount++;\n\n if (chunkCount === 1) {\n this.task.status = TaskStatus.STREAMING;\n this.task.emit(\"status\", this.task.status);\n }\n\n // For snapshot events, update runOutputData BEFORE emitting stream_chunk\n // so listeners see the latest snapshot when they handle the event\n if (event.type === \"snapshot\") {\n this.task.runOutputData = event.data as Output;\n }\n\n switch (event.type) {\n case \"text-delta\": {\n if (accumulated) {\n accumulated.set(event.port, (accumulated.get(event.port) ?? \"\") + event.textDelta);\n }\n this.task.emit(\"stream_chunk\", event as StreamEvent);\n const progress = Math.min(99, Math.round(100 * (1 - Math.exp(-0.05 * chunkCount))));\n await this.handleProgress(progress);\n break;\n }\n case \"object-delta\": {\n // Reserved for future object streaming -- no accumulation yet\n this.task.emit(\"stream_chunk\", event as StreamEvent);\n const progress = Math.min(99, Math.round(100 * (1 - Math.exp(-0.05 * chunkCount))));\n await this.handleProgress(progress);\n break;\n }\n case \"snapshot\": {\n this.task.emit(\"stream_chunk\", event as StreamEvent);\n const progress = Math.min(99, Math.round(100 * (1 - Math.exp(-0.05 * chunkCount))));\n await this.handleProgress(progress);\n break;\n }\n case \"finish\": {\n if (accumulated) {\n // Emit an enriched finish event: merge accumulated text-deltas into\n // the finish payload so downstream dataflows get complete port data\n // without needing to re-accumulate themselves.\n const merged: Record<string, unknown> = { ...(event.data || {}) };\n for (const [port, text] of accumulated) {\n if (text.length > 0) merged[port] = text;\n }\n finalOutput = merged as unknown as Output;\n this.task.emit(\"stream_chunk\", { type: \"finish\", data: merged } as StreamEvent);\n } else {\n // No accumulation: emit the raw finish event and use it directly\n finalOutput = event.data as Output;\n this.task.emit(\"stream_chunk\", event as StreamEvent);\n }\n break;\n }\n case \"error\": {\n throw event.error;\n }\n }\n }\n\n // Check if the task was aborted during streaming\n if (this.abortController?.signal.aborted) {\n throw new TaskAbortedError(\"Task aborted during streaming\");\n }\n\n if (finalOutput !== undefined) {\n this.task.runOutputData = finalOutput;\n }\n\n this.task.emit(\"stream_end\", this.task.runOutputData as Output);\n\n const reactiveResult = await this.executeTaskReactive(\n input,\n (this.task.runOutputData as Output) || ({} as Output)\n );\n return reactiveResult;\n }\n\n // ========================================================================\n // Protected Handlers\n // ========================================================================\n\n /**\n * Handles task start\n */\n protected async handleStart(config: IRunConfig = {}): Promise<void> {\n if (this.task.status === TaskStatus.PROCESSING) return;\n\n this.running = true;\n\n this.task.startedAt = new Date();\n this.task.progress = 0;\n this.task.status = TaskStatus.PROCESSING;\n\n this.abortController = new AbortController();\n this.abortController.signal.addEventListener(\"abort\", () => {\n this.handleAbort();\n });\n\n const cache = config.outputCache ?? this.task.runConfig?.outputCache;\n if (cache === true) {\n let instance = globalServiceRegistry.get(TASK_OUTPUT_REPOSITORY);\n this.outputCache = instance;\n } else if (cache === false) {\n this.outputCache = undefined;\n } else if (cache instanceof TaskOutputRepository) {\n this.outputCache = cache;\n }\n\n // shouldAccumulate defaults to true (backward-compatible for standalone runs)\n this.shouldAccumulate = config.shouldAccumulate !== false;\n\n if (config.updateProgress) {\n this.updateProgress = config.updateProgress;\n }\n\n if (config.registry) {\n this.registry = config.registry;\n }\n\n this.task.emit(\"start\");\n this.task.emit(\"status\", this.task.status);\n }\n private updateProgress = async (\n task: ITask,\n progress: number,\n message?: string,\n ...args: any[]\n ) => {};\n\n protected async handleStartReactive(): Promise<void> {\n this.reactiveRunning = true;\n }\n\n /**\n * Handles task abort\n */\n protected async handleAbort(): Promise<void> {\n if (this.task.status === TaskStatus.ABORTING) return;\n this.task.status = TaskStatus.ABORTING;\n this.task.progress = 100;\n this.task.error = new TaskAbortedError();\n this.task.emit(\"abort\", this.task.error);\n this.task.emit(\"status\", this.task.status);\n }\n\n protected async handleAbortReactive(): Promise<void> {\n this.reactiveRunning = false;\n }\n\n /**\n * Handles task completion\n */\n protected async handleComplete(): Promise<void> {\n if (this.task.status === TaskStatus.COMPLETED) return;\n\n this.task.completedAt = new Date();\n this.task.progress = 100;\n this.task.status = TaskStatus.COMPLETED;\n this.abortController = undefined;\n\n this.task.emit(\"complete\");\n this.task.emit(\"status\", this.task.status);\n }\n\n protected async handleCompleteReactive(): Promise<void> {\n this.reactiveRunning = false;\n }\n\n protected async handleDisable(): Promise<void> {\n if (this.task.status === TaskStatus.DISABLED) return;\n this.task.status = TaskStatus.DISABLED;\n this.task.progress = 100;\n this.task.completedAt = new Date();\n this.abortController = undefined;\n this.task.emit(\"disabled\");\n this.task.emit(\"status\", this.task.status);\n }\n\n public async disable(): Promise<void> {\n await this.handleDisable();\n }\n\n /**\n * Handles task error\n * @param err Error that occurred\n */\n protected async handleError(err: Error): Promise<void> {\n if (err instanceof TaskAbortedError) return this.handleAbort();\n if (this.task.status === TaskStatus.FAILED) return;\n\n if (this.task.hasChildren()) {\n this.task.subGraph!.abort();\n }\n\n this.task.completedAt = new Date();\n this.task.progress = 100;\n this.task.status = TaskStatus.FAILED;\n this.task.error =\n err instanceof TaskError ? err : new TaskFailedError(err?.message || \"Task failed\");\n this.abortController = undefined;\n this.task.emit(\"error\", this.task.error);\n this.task.emit(\"status\", this.task.status);\n }\n\n protected async handleErrorReactive(): Promise<void> {\n this.reactiveRunning = false;\n }\n\n /**\n * Handles task progress update\n * @param progress Progress value (0-100)\n * @param args Additional arguments\n */\n protected async handleProgress(\n progress: number,\n message?: string,\n ...args: any[]\n ): Promise<void> {\n this.task.progress = progress;\n await this.updateProgress(this.task, progress, message, ...args);\n this.task.emit(\"progress\", progress, message, ...args);\n }\n}\n",
15
15
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DataPortSchema, ServiceRegistry } from \"@workglow/util\";\nimport { getInputResolvers } from \"@workglow/util\";\n\n/**\n * Configuration for the input resolver\n */\nexport interface InputResolverConfig {\n readonly registry: ServiceRegistry;\n}\n\n/**\n * Extracts the format string from a schema, handling oneOf/anyOf wrappers.\n */\nfunction getSchemaFormat(schema: unknown): string | undefined {\n if (typeof schema !== \"object\" || schema === null) return undefined;\n\n const s = schema as Record<string, unknown>;\n\n // Direct format\n if (typeof s.format === \"string\") return s.format;\n\n // Check oneOf/anyOf for format\n const variants = (s.oneOf ?? s.anyOf) as unknown[] | undefined;\n if (Array.isArray(variants)) {\n for (const variant of variants) {\n if (typeof variant === \"object\" && variant !== null) {\n const v = variant as Record<string, unknown>;\n if (typeof v.format === \"string\") return v.format;\n }\n }\n }\n\n return undefined;\n}\n\n/**\n * Gets the format prefix from a format string.\n * For \"model:TextEmbedding\" returns \"model\"\n * For \"storage:tabular\" returns \"storage\"\n */\nfunction getFormatPrefix(format: string): string {\n const colonIndex = format.indexOf(\":\");\n return colonIndex >= 0 ? format.substring(0, colonIndex) : format;\n}\n\n/**\n * Resolves schema-annotated inputs by looking up string IDs from registries.\n * String values with matching format annotations are resolved to their instances.\n * Non-string values (objects/instances) are passed through unchanged.\n *\n * @param input The task input object\n * @param schema The task's input schema\n * @param config Configuration including the service registry\n * @returns The input with resolved values\n *\n * @example\n * ```typescript\n * // In TaskRunner.run()\n * const resolvedInput = await resolveSchemaInputs(\n * this.task.runInputData,\n * (this.task.constructor as typeof Task).inputSchema(),\n * { registry: this.registry }\n * );\n * ```\n */\nexport async function resolveSchemaInputs<T extends Record<string, unknown>>(\n input: T,\n schema: DataPortSchema,\n config: InputResolverConfig\n): Promise<T> {\n if (typeof schema === \"boolean\") return input;\n\n const properties = schema.properties;\n if (!properties || typeof properties !== \"object\") return input;\n\n const resolvers = getInputResolvers();\n const resolved: Record<string, unknown> = { ...input };\n\n for (const [key, propSchema] of Object.entries(properties)) {\n const value = resolved[key];\n\n const format = getSchemaFormat(propSchema);\n if (!format) continue;\n\n // Try full format first (e.g., \"dataset:document-chunk\"), then fall back to prefix (e.g., \"dataset\")\n let resolver = resolvers.get(format);\n if (!resolver) {\n const prefix = getFormatPrefix(format);\n resolver = resolvers.get(prefix);\n }\n\n if (!resolver) continue;\n\n // Handle string values\n if (typeof value === \"string\") {\n resolved[key] = await resolver(value, format, config.registry);\n }\n // Handle arrays of strings - iterate and resolve each element\n else if (Array.isArray(value) && value.every((item) => typeof item === \"string\")) {\n const results = await Promise.all(\n (value as string[]).map((item) => resolver(item, format, config.registry))\n );\n resolved[key] = results.filter((result) => result !== undefined);\n }\n // Skip if not a string or array of strings (already resolved or direct instance)\n }\n\n return resolved as T;\n}\n",
@@ -21,23 +21,23 @@
21
21
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DataPortSchema } from \"@workglow/util\";\nimport { GraphAsTask } from \"../task/GraphAsTask\";\nimport type { IExecuteContext, ITask } from \"../task/ITask\";\nimport { Task } from \"../task/Task\";\nimport type { DataPorts } from \"../task/TaskTypes\";\nimport { Dataflow, DATAFLOW_ALL_PORTS } from \"./Dataflow\";\nimport type { ITaskGraph } from \"./ITaskGraph\";\nimport type { IWorkflow } from \"./IWorkflow\";\nimport { TaskGraph } from \"./TaskGraph\";\nimport { PROPERTY_ARRAY, type CompoundMergeStrategy } from \"./TaskGraphRunner\";\nimport { Workflow } from \"./Workflow\";\n\nclass ListeningGraphAsTask extends GraphAsTask<any, any> {\n constructor(input: any, config: any) {\n super(input, config);\n this.subGraph.on(\"start\", () => {\n this.emit(\"start\");\n });\n this.subGraph.on(\"complete\", () => {\n this.emit(\"complete\");\n });\n this.subGraph.on(\"error\", (e) => {\n this.emit(\"error\", e);\n });\n }\n}\n\nclass OwnGraphTask extends ListeningGraphAsTask {\n public static readonly type = \"Own[Graph]\";\n}\n\nclass OwnWorkflowTask extends ListeningGraphAsTask {\n public static readonly type = \"Own[Workflow]\";\n}\nclass GraphTask extends GraphAsTask {\n public static readonly type = \"Graph\";\n}\n\nclass WorkflowTask extends GraphAsTask {\n public static readonly type = \"Workflow\";\n}\n\n// Update PipeFunction type to be more specific about input/output types\nexport type PipeFunction<I extends DataPorts = any, O extends DataPorts = any> = (\n input: I,\n context: IExecuteContext\n) => O | Promise<O>;\n\nexport type Taskish<A extends DataPorts = DataPorts, B extends DataPorts = DataPorts> =\n | PipeFunction<A, B>\n | ITask<A, B>\n | ITaskGraph\n | IWorkflow<A, B>;\n\nfunction convertPipeFunctionToTask<I extends DataPorts, O extends DataPorts>(\n fn: PipeFunction<I, O>,\n config?: any\n): ITask<I, O> {\n class QuickTask extends Task<I, O> {\n public static type = fn.name ? `𝑓 ${fn.name}` : \"𝑓\";\n public static inputSchema = () => {\n return {\n type: \"object\",\n properties: {\n [DATAFLOW_ALL_PORTS]: {},\n },\n additionalProperties: false,\n } as const satisfies DataPortSchema;\n };\n public static outputSchema = () => {\n return {\n type: \"object\",\n properties: {\n [DATAFLOW_ALL_PORTS]: {},\n },\n additionalProperties: false,\n } as const satisfies DataPortSchema;\n };\n public static cacheable = false;\n public async execute(input: I, context: IExecuteContext) {\n return fn(input, context);\n }\n }\n return new QuickTask({}, config);\n}\n\nexport function ensureTask<I extends DataPorts, O extends DataPorts>(\n arg: Taskish<I, O>,\n config: any = {}\n): ITask<any, any, any> {\n if (arg instanceof Task) {\n return arg;\n }\n if (arg instanceof TaskGraph) {\n const { isOwned, ...cleanConfig } = config;\n if (isOwned) {\n return new OwnGraphTask({}, { ...cleanConfig, subGraph: arg });\n } else {\n return new GraphTask({}, { ...cleanConfig, subGraph: arg });\n }\n }\n if (arg instanceof Workflow) {\n const { isOwned, ...cleanConfig } = config;\n if (isOwned) {\n return new OwnWorkflowTask({}, { ...cleanConfig, subGraph: arg.graph });\n } else {\n return new WorkflowTask({}, { ...cleanConfig, subGraph: arg.graph });\n }\n }\n return convertPipeFunctionToTask(arg as PipeFunction<I, O>, config);\n}\n\nexport function getLastTask(workflow: IWorkflow): ITask<any, any, any> | undefined {\n const tasks = workflow.graph.getTasks();\n return tasks.length > 0 ? tasks[tasks.length - 1] : undefined;\n}\n\nexport function connect(\n source: ITask<any, any, any>,\n target: ITask<any, any, any>,\n workflow: IWorkflow<any, any>\n): void {\n workflow.graph.addDataflow(new Dataflow(source.config.id, \"*\", target.config.id, \"*\"));\n}\n\nexport function pipe<A extends DataPorts, B extends DataPorts>(\n [fn1]: [Taskish<A, B>],\n workflow?: IWorkflow<A, B>\n): IWorkflow<A, B>;\n\nexport function pipe<A extends DataPorts, B extends DataPorts, C extends DataPorts>(\n [fn1, fn2]: [Taskish<A, B>, Taskish<B, C>],\n workflow?: IWorkflow<A, C>\n): IWorkflow<A, C>;\n\nexport function pipe<\n A extends DataPorts,\n B extends DataPorts,\n C extends DataPorts,\n D extends DataPorts,\n>(\n [fn1, fn2, fn3]: [Taskish<A, B>, Taskish<B, C>, Taskish<C, D>],\n workflow?: IWorkflow<A, D>\n): IWorkflow<A, D>;\n\nexport function pipe<\n A extends DataPorts,\n B extends DataPorts,\n C extends DataPorts,\n D extends DataPorts,\n E extends DataPorts,\n>(\n [fn1, fn2, fn3, fn4]: [Taskish<A, B>, Taskish<B, C>, Taskish<C, D>, Taskish<D, E>],\n workflow?: IWorkflow<A, E>\n): IWorkflow<A, E>;\n\nexport function pipe<\n A extends DataPorts,\n B extends DataPorts,\n C extends DataPorts,\n D extends DataPorts,\n E extends DataPorts,\n F extends DataPorts,\n>(\n [fn1, fn2, fn3, fn4, fn5]: [\n Taskish<A, B>,\n Taskish<B, C>,\n Taskish<C, D>,\n Taskish<D, E>,\n Taskish<E, F>,\n ],\n workflow?: IWorkflow<A, F>\n): IWorkflow<A, F>;\n\nexport function pipe<I extends DataPorts, O extends DataPorts>(\n args: Taskish<I, O>[],\n workflow: IWorkflow<I, O> = new Workflow<I, O>()\n): IWorkflow<I, O> {\n let previousTask = getLastTask(workflow);\n const tasks = args.map((arg) => ensureTask(arg));\n tasks.forEach((task) => {\n workflow.graph.addTask(task);\n if (previousTask) {\n connect(previousTask, task, workflow);\n }\n previousTask = task;\n });\n return workflow;\n}\n\nexport function parallel<I extends DataPorts = DataPorts, O extends DataPorts = DataPorts>(\n args: (PipeFunction<I, O> | ITask<I, O> | IWorkflow<I, O> | ITaskGraph)[],\n mergeFn: CompoundMergeStrategy = PROPERTY_ARRAY,\n workflow: IWorkflow<I, O> = new Workflow<I, O>()\n): IWorkflow<I, O> {\n let previousTask = getLastTask(workflow);\n const tasks = args.map((arg) => ensureTask(arg));\n const input = {};\n const config = {\n compoundMerge: mergeFn,\n };\n const name = `‖${args.map((arg) => \"𝑓\").join(\"‖\")}‖`;\n class ParallelTask extends GraphAsTask<I, O> {\n public static type = name;\n }\n const mergeTask = new ParallelTask(input, config);\n mergeTask.subGraph!.addTasks(tasks);\n workflow.graph.addTask(mergeTask);\n if (previousTask) {\n connect(previousTask, mergeTask, workflow);\n }\n return workflow;\n}\n",
22
22
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { EventParameters } from \"@workglow/util\";\nimport type { StreamEvent } from \"../task/StreamTypes\";\nimport { TaskIdType } from \"../task/TaskTypes\";\nimport { DataflowIdType } from \"./Dataflow\";\n\n/**\n * Events that can be emitted by the TaskGraph\n */\n\nexport type TaskGraphStatusListeners = {\n graph_progress: (progress: number, message?: string, ...args: any[]) => void;\n start: () => void;\n complete: () => void;\n error: (error: Error) => void;\n abort: () => void;\n disabled: () => void;\n /** Fired when a task in the graph starts streaming */\n task_stream_start: (taskId: TaskIdType) => void;\n /** Fired for each stream chunk produced by a task in the graph */\n task_stream_chunk: (taskId: TaskIdType, event: StreamEvent) => void;\n /** Fired when a task in the graph finishes streaming */\n task_stream_end: (taskId: TaskIdType, output: Record<string, any>) => void;\n};\nexport type TaskGraphStatusEvents = keyof TaskGraphStatusListeners;\nexport type TaskGraphStatusListener<Event extends TaskGraphStatusEvents> =\n TaskGraphStatusListeners[Event];\nexport type TaskGraphEventStatusParameters<Event extends TaskGraphStatusEvents> = EventParameters<\n TaskGraphStatusListeners,\n Event\n>;\n\nexport type GraphEventDagListeners = {\n task_added: (taskId: TaskIdType) => void;\n task_removed: (taskId: TaskIdType) => void;\n task_replaced: (taskId: TaskIdType) => void;\n dataflow_added: (dataflowId: DataflowIdType) => void;\n dataflow_removed: (dataflowId: DataflowIdType) => void;\n dataflow_replaced: (dataflowId: DataflowIdType) => void;\n};\nexport type GraphEventDagEvents = keyof GraphEventDagListeners;\nexport type GraphEventDagListener<Event extends GraphEventDagEvents> =\n GraphEventDagListeners[Event];\nexport type GraphEventDagParameters<Event extends GraphEventDagEvents> = EventParameters<\n GraphEventDagListeners,\n Event\n>;\n\nexport type TaskGraphListeners = TaskGraphStatusListeners & GraphEventDagListeners;\nexport type TaskGraphEvents = keyof TaskGraphListeners;\nexport type TaskGraphEventListener<Event extends TaskGraphEvents> = TaskGraphListeners[Event];\nexport type TaskGraphEventParameters<Event extends TaskGraphEvents> = EventParameters<\n TaskGraphListeners,\n Event\n>;\n\nexport const EventDagToTaskGraphMapping = {\n \"node-added\": \"task_added\",\n \"node-removed\": \"task_removed\",\n \"node-replaced\": \"task_replaced\",\n \"edge-added\": \"dataflow_added\",\n \"edge-removed\": \"dataflow_removed\",\n \"edge-replaced\": \"dataflow_replaced\",\n} as const;\n\nexport const EventTaskGraphToDagMapping = {\n task_added: \"node-added\",\n task_removed: \"node-removed\",\n task_replaced: \"node-replaced\",\n dataflow_added: \"edge-added\",\n dataflow_removed: \"edge-removed\",\n dataflow_replaced: \"edge-replaced\",\n} as const;\n",
23
23
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { GraphAsTaskRunner } from \"./GraphAsTaskRunner\";\nimport type { IterationAnalysisResult, IteratorTask, IteratorTaskConfig } from \"./IteratorTask\";\nimport type { TaskInput, TaskOutput } from \"./TaskTypes\";\n\n/**\n * Runner for IteratorTask that executes a single subgraph repeatedly with\n * per-iteration inputs. The task defines iteration analysis/collection hooks,\n * while this runner owns scheduling and execution orchestration.\n */\nexport class IteratorTaskRunner<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends IteratorTaskConfig = IteratorTaskConfig,\n> extends GraphAsTaskRunner<Input, Output, Config> {\n declare task: IteratorTask<Input, Output, Config>;\n\n /**\n * Subgraph runs are serialized against one shared subgraph instance.\n */\n private subGraphRunChain: Promise<void> = Promise.resolve();\n\n /**\n * For iterator tasks, reactive runs use full execution for correctness.\n */\n\n protected override async executeTask(input: Input): Promise<Output | undefined> {\n const analysis = this.task.analyzeIterationInput(input);\n\n if (analysis.iterationCount === 0) {\n const emptyResult = this.task.getEmptyResult();\n return this.executeTaskReactive(input, emptyResult as Output);\n }\n\n const result = this.task.isReduceTask()\n ? await this.executeReduceIterations(analysis)\n : await this.executeCollectIterations(analysis);\n\n return this.executeTaskReactive(input, result as Output);\n }\n\n /**\n * Iterator tasks should only run the task's reactive hook here.\n */\n public override async executeTaskReactive(input: Input, output: Output): Promise<Output> {\n const reactiveResult = await this.task.executeReactive(input, output, { own: this.own });\n return Object.assign({}, output, reactiveResult ?? {}) as Output;\n }\n\n protected async executeCollectIterations(analysis: IterationAnalysisResult): Promise<Output> {\n const iterationCount = analysis.iterationCount;\n const preserveOrder = this.task.preserveIterationOrder();\n\n const batchSize =\n this.task.batchSize !== undefined && this.task.batchSize > 0\n ? this.task.batchSize\n : iterationCount;\n\n const requestedConcurrency = this.task.concurrencyLimit ?? iterationCount;\n const concurrency = Math.max(1, Math.min(requestedConcurrency, iterationCount));\n\n const orderedResults: Array<TaskOutput | undefined> = preserveOrder\n ? new Array(iterationCount)\n : [];\n const completionOrderResults: TaskOutput[] = [];\n\n for (let batchStart = 0; batchStart < iterationCount; batchStart += batchSize) {\n if (this.abortController?.signal.aborted) {\n break;\n }\n\n const batchEnd = Math.min(batchStart + batchSize, iterationCount);\n const batchIndices = Array.from({ length: batchEnd - batchStart }, (_, i) => batchStart + i);\n\n const batchResults = await this.executeBatch(\n batchIndices,\n analysis,\n iterationCount,\n concurrency\n );\n\n for (const { index, result } of batchResults) {\n if (result === undefined) continue;\n\n if (preserveOrder) {\n orderedResults[index] = result;\n } else {\n completionOrderResults.push(result);\n }\n }\n\n const progress = Math.round((batchEnd / iterationCount) * 100);\n await this.handleProgress(progress, `Completed ${batchEnd}/${iterationCount} iterations`);\n }\n\n const collected = preserveOrder\n ? orderedResults.filter((result): result is TaskOutput => result !== undefined)\n : completionOrderResults;\n\n return this.task.collectResults(collected);\n }\n\n protected async executeReduceIterations(analysis: IterationAnalysisResult): Promise<Output> {\n const iterationCount = analysis.iterationCount;\n let accumulator = this.task.getInitialAccumulator();\n\n for (let index = 0; index < iterationCount; index++) {\n if (this.abortController?.signal.aborted) {\n break;\n }\n\n const iterationInput = this.task.buildIterationRunInput(analysis, index, iterationCount, {\n accumulator,\n });\n\n const iterationResult = await this.executeSubgraphIteration(iterationInput);\n accumulator = this.task.mergeIterationIntoAccumulator(accumulator, iterationResult, index);\n\n const progress = Math.round(((index + 1) / iterationCount) * 100);\n await this.handleProgress(progress, `Completed ${index + 1}/${iterationCount} iterations`);\n }\n\n return accumulator;\n }\n\n protected async executeBatch(\n indices: number[],\n analysis: IterationAnalysisResult,\n iterationCount: number,\n concurrency: number\n ): Promise<Array<{ index: number; result: TaskOutput | undefined }>> {\n const results: Array<{ index: number; result: TaskOutput | undefined }> = [];\n let cursor = 0;\n\n const workerCount = Math.max(1, Math.min(concurrency, indices.length));\n\n const workers = Array.from({ length: workerCount }, async () => {\n while (true) {\n if (this.abortController?.signal.aborted) {\n return;\n }\n\n const position = cursor;\n cursor += 1;\n\n if (position >= indices.length) {\n return;\n }\n\n const index = indices[position];\n const iterationInput = this.task.buildIterationRunInput(analysis, index, iterationCount);\n const result = await this.executeSubgraphIteration(iterationInput);\n results.push({ index, result });\n }\n });\n\n await Promise.all(workers);\n return results;\n }\n\n protected async executeSubgraphIteration(\n input: Record<string, unknown>\n ): Promise<TaskOutput | undefined> {\n let releaseTurn: (() => void) | undefined;\n const waitForPreviousRun = this.subGraphRunChain;\n this.subGraphRunChain = new Promise<void>((resolve) => {\n releaseTurn = resolve;\n });\n\n await waitForPreviousRun;\n\n try {\n if (this.abortController?.signal.aborted) {\n return undefined;\n }\n\n const results = await this.task.subGraph.run<TaskOutput>(input as TaskInput, {\n parentSignal: this.abortController?.signal,\n outputCache: this.outputCache,\n });\n\n if (results.length === 0) {\n return undefined;\n }\n\n return this.task.subGraph.mergeExecuteOutputsToRunOutput(\n results,\n this.task.compoundMerge\n ) as TaskOutput;\n } finally {\n releaseTurn?.();\n }\n }\n}\n",
24
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DataPortSchema } from \"@workglow/util\";\nimport { TaskGraph } from \"../task-graph/TaskGraph\";\nimport { GraphAsTask, GraphAsTaskConfig, graphAsTaskConfigSchema } from \"./GraphAsTask\";\nimport type { IExecuteContext } from \"./ITask\";\nimport { IteratorTaskRunner } from \"./IteratorTaskRunner\";\nimport type { StreamEvent, StreamFinish } from \"./StreamTypes\";\nimport { TaskConfigurationError } from \"./TaskError\";\nimport type { TaskInput, TaskOutput, TaskTypeName } from \"./TaskTypes\";\n\n/**\n * Standard iteration context schema for IteratorTask subclasses (Map, Reduce).\n * Properties are marked with \"x-ui-iteration\": true so the builder\n * knows to hide them from parent-level display.\n */\nexport const ITERATOR_CONTEXT_SCHEMA: DataPortSchema = {\n type: \"object\",\n properties: {\n _iterationIndex: {\n type: \"integer\",\n minimum: 0,\n title: \"Iteration Index\",\n description: \"Current iteration index (0-based)\",\n \"x-ui-iteration\": true,\n },\n _iterationCount: {\n type: \"integer\",\n minimum: 0,\n title: \"Iteration Count\",\n description: \"Total number of iterations\",\n \"x-ui-iteration\": true,\n },\n },\n};\n\n/**\n * Execution mode for iterator tasks.\n * - `parallel`: Execute all iterations concurrently (logical mode)\n * - `parallel-limited`: Execute with a concurrency limit\n */\nexport type ExecutionMode = \"parallel\" | \"parallel-limited\";\n\n/**\n * Input mode for a property in the iteration input schema.\n * - \"array\": Property must be an array (will be iterated)\n * - \"scalar\": Property must be a scalar (constant for all iterations)\n * - \"flexible\": Property accepts both array and scalar (T | T[])\n */\nexport type IterationInputMode = \"array\" | \"scalar\" | \"flexible\";\n\n/**\n * Configuration for a single property in the iteration input schema.\n */\nexport interface IterationPropertyConfig {\n /** The base schema for the property (without array wrapping) */\n readonly baseSchema: DataPortSchema;\n /** The input mode for this property */\n readonly mode: IterationInputMode;\n}\n\nexport const iteratorTaskConfigSchema = {\n type: \"object\",\n properties: {\n ...graphAsTaskConfigSchema[\"properties\"],\n concurrencyLimit: { type: \"integer\", minimum: 1 },\n batchSize: { type: \"integer\", minimum: 1 },\n iterationInputConfig: { type: \"object\", additionalProperties: true },\n },\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\n/**\n * Configuration type for IteratorTask.\n * Extends GraphAsTaskConfig with iterator-specific options.\n */\nexport type IteratorTaskConfig = GraphAsTaskConfig & {\n /**\n * Maximum number of concurrent iteration workers\n * @default undefined (unlimited)\n */\n readonly concurrencyLimit?: number;\n\n /**\n * Number of items per batch. When set, iteration indices are grouped into batches.\n * @default undefined\n */\n readonly batchSize?: number;\n\n /**\n * User-defined iteration input schema configuration.\n */\n readonly iterationInputConfig?: Record<string, IterationPropertyConfig>;\n};\n\n/**\n * Result of detecting the iterator port from the input schema.\n */\ninterface IteratorPortInfo {\n readonly portName: string;\n readonly itemSchema: DataPortSchema;\n}\n\n/**\n * Result of analyzing input for iteration.\n */\nexport interface IterationAnalysisResult {\n /** The number of iterations to perform */\n readonly iterationCount: number;\n /** Names of properties that are arrays (to be iterated) */\n readonly arrayPorts: string[];\n /** Names of properties that are scalars (passed as constants) */\n readonly scalarPorts: string[];\n /** Gets the input for a specific iteration index */\n getIterationInput(index: number): Record<string, unknown>;\n}\n\nfunction isArrayVariant(schema: unknown): boolean {\n if (!schema || typeof schema !== \"object\") return false;\n const record = schema as Record<string, unknown>;\n return record.type === \"array\" || record.items !== undefined;\n}\n\nfunction getExplicitIterationFlag(schema: DataPortSchema | undefined): boolean | undefined {\n if (!schema || typeof schema !== \"object\") return undefined;\n const record = schema as Record<string, unknown>;\n const flag = record[\"x-ui-iteration\"];\n if (flag === true) return true;\n if (flag === false) return false;\n return undefined;\n}\n\nfunction inferIterationFromSchema(schema: DataPortSchema | undefined): boolean | undefined {\n if (!schema || typeof schema !== \"object\") return undefined;\n\n const record = schema as Record<string, unknown>;\n\n if (record.type === \"array\" || record.items !== undefined) {\n return true;\n }\n\n const variants = (record.oneOf ?? record.anyOf) as unknown[] | undefined;\n if (!Array.isArray(variants) || variants.length === 0) {\n // Schema does not clearly indicate array/non-array - defer to runtime\n if (record.type !== undefined) {\n return false;\n }\n return undefined;\n }\n\n let hasArrayVariant = false;\n let hasNonArrayVariant = false;\n\n for (const variant of variants) {\n if (isArrayVariant(variant)) {\n hasArrayVariant = true;\n } else {\n hasNonArrayVariant = true;\n }\n }\n\n if (hasArrayVariant && hasNonArrayVariant) return undefined;\n if (hasArrayVariant) return true;\n return false;\n}\n\n/**\n * Creates a union type schema (T | T[]) for flexible iteration input.\n */\nexport function createFlexibleSchema(baseSchema: DataPortSchema): DataPortSchema {\n if (typeof baseSchema === \"boolean\") return baseSchema;\n return {\n anyOf: [baseSchema, { type: \"array\", items: baseSchema }],\n } as unknown as DataPortSchema;\n}\n\n/**\n * Creates an array schema from a base schema.\n */\nexport function createArraySchema(baseSchema: DataPortSchema): DataPortSchema {\n if (typeof baseSchema === \"boolean\") return baseSchema;\n return {\n type: \"array\",\n items: baseSchema,\n } as DataPortSchema;\n}\n\n/**\n * Extracts the base (scalar) schema from a potentially wrapped schema.\n */\nexport function extractBaseSchema(schema: DataPortSchema): DataPortSchema {\n if (typeof schema === \"boolean\") return schema;\n\n const schemaType = (schema as Record<string, unknown>).type;\n if (schemaType === \"array\" && (schema as Record<string, unknown>).items) {\n return (schema as Record<string, unknown>).items as DataPortSchema;\n }\n\n const variants = (schema.oneOf ?? schema.anyOf) as DataPortSchema[] | undefined;\n if (Array.isArray(variants)) {\n for (const variant of variants) {\n if (typeof variant === \"object\") {\n const variantType = (variant as Record<string, unknown>).type;\n if (variantType !== \"array\") {\n return variant;\n }\n }\n }\n for (const variant of variants) {\n if (typeof variant === \"object\") {\n const variantType = (variant as Record<string, unknown>).type;\n if (variantType === \"array\" && (variant as Record<string, unknown>).items) {\n return (variant as Record<string, unknown>).items as DataPortSchema;\n }\n }\n }\n }\n\n return schema;\n}\n\n/**\n * Determines if a schema accepts arrays (is array type or has array in union).\n */\nexport function schemaAcceptsArray(schema: DataPortSchema): boolean {\n if (typeof schema === \"boolean\") return false;\n\n const schemaType = (schema as Record<string, unknown>).type;\n if (schemaType === \"array\") return true;\n\n const variants = (schema.oneOf ?? schema.anyOf) as DataPortSchema[] | undefined;\n if (Array.isArray(variants)) {\n return variants.some((variant) => isArrayVariant(variant));\n }\n\n return false;\n}\n\n/**\n * Base class for iterator tasks that process collections of items.\n */\nexport abstract class IteratorTask<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends IteratorTaskConfig = IteratorTaskConfig,\n> extends GraphAsTask<Input, Output, Config> {\n public static type: TaskTypeName = \"IteratorTask\";\n public static category: string = \"Flow Control\";\n public static title: string = \"Iterator\";\n public static description: string = \"Base class for loop-type tasks\";\n\n /** This task has dynamic schemas based on the inner workflow */\n public static hasDynamicSchemas: boolean = true;\n\n public static configSchema(): DataPortSchema {\n return iteratorTaskConfigSchema;\n }\n\n /**\n * Returns the schema for iteration-context inputs that will be\n * injected into the subgraph at runtime.\n */\n public static getIterationContextSchema(): DataPortSchema {\n return ITERATOR_CONTEXT_SCHEMA;\n }\n\n /** Cached iterator port info from schema analysis. */\n protected _iteratorPortInfo: IteratorPortInfo | undefined;\n\n /** Cached computed iteration input schema. */\n protected _iterationInputSchema: DataPortSchema | undefined;\n\n constructor(input: Partial<Input> = {}, config: Partial<Config> = {}) {\n super(input, config as Config);\n }\n\n // ========================================================================\n // TaskRunner Override\n // ========================================================================\n\n declare _runner: IteratorTaskRunner<Input, Output, Config>;\n\n override get runner(): IteratorTaskRunner<Input, Output, Config> {\n if (!this._runner) {\n this._runner = new IteratorTaskRunner<Input, Output, Config>(this);\n }\n return this._runner;\n }\n\n /**\n * IteratorTask does not support streaming pass-through because its output\n * is an aggregation of multiple iterations (arrays for MapTask, accumulated\n * value for ReduceTask). The inherited GraphAsTask.executeStream is\n * overridden to just emit a finish event (no streaming).\n */\n async *executeStream(\n input: Input,\n _context: IExecuteContext\n ): AsyncIterable<StreamEvent<Output>> {\n yield { type: \"finish\", data: input as unknown as Output } as StreamFinish<Output>;\n }\n\n // ========================================================================\n // Graph hooks\n // ========================================================================\n\n override set subGraph(subGraph: TaskGraph) {\n super.subGraph = subGraph;\n this.invalidateIterationInputSchema();\n this.events.emit(\"regenerate\");\n }\n\n override get subGraph(): TaskGraph {\n return super.subGraph;\n }\n\n public override regenerateGraph(): void {\n this.invalidateIterationInputSchema();\n super.regenerateGraph();\n }\n\n // ========================================================================\n // Runner hooks\n // ========================================================================\n\n /**\n * Whether results should be ordered by iteration index.\n * MapTask overrides this to use its `preserveOrder` config.\n */\n public preserveIterationOrder(): boolean {\n return true;\n }\n\n /**\n * Whether this iterator runs in reduce mode.\n */\n public isReduceTask(): boolean {\n return false;\n }\n\n /**\n * Initial accumulator for reduce mode.\n */\n public getInitialAccumulator(): Output {\n return {} as Output;\n }\n\n /**\n * Builds the per-iteration subgraph input.\n */\n public buildIterationRunInput(\n analysis: IterationAnalysisResult,\n index: number,\n iterationCount: number,\n extraInput: Record<string, unknown> = {}\n ): Record<string, unknown> {\n return {\n ...analysis.getIterationInput(index),\n ...extraInput,\n _iterationIndex: index,\n _iterationCount: iterationCount,\n };\n }\n\n /**\n * Updates the accumulator with one iteration result in reduce mode.\n */\n public mergeIterationIntoAccumulator(\n accumulator: Output,\n iterationResult: TaskOutput | undefined,\n _index: number\n ): Output {\n return (iterationResult ?? accumulator) as Output;\n }\n\n /**\n * Returns the result when there are no items to iterate.\n */\n public getEmptyResult(): Output {\n return {} as Output;\n }\n\n /**\n * Collects and merges results from all iterations.\n */\n public collectResults(results: TaskOutput[]): Output {\n if (results.length === 0) {\n return {} as Output;\n }\n\n const merged: Record<string, unknown[]> = {};\n\n for (const result of results) {\n if (!result || typeof result !== \"object\") continue;\n\n for (const [key, value] of Object.entries(result as Record<string, unknown>)) {\n if (!merged[key]) {\n merged[key] = [];\n }\n merged[key].push(value);\n }\n }\n\n return merged as Output;\n }\n\n // ========================================================================\n // Execution Mode Configuration\n // ========================================================================\n\n public get concurrencyLimit(): number | undefined {\n return this.config.concurrencyLimit;\n }\n\n public get batchSize(): number | undefined {\n return this.config.batchSize;\n }\n\n // ========================================================================\n // Iteration Input Schema Management\n // ========================================================================\n\n public get iterationInputConfig(): Record<string, IterationPropertyConfig> | undefined {\n return this.config.iterationInputConfig;\n }\n\n protected buildDefaultIterationInputSchema(): DataPortSchema {\n const innerSchema = this.getInnerInputSchema();\n if (!innerSchema || typeof innerSchema === \"boolean\") {\n return { type: \"object\", properties: {}, additionalProperties: true };\n }\n\n const properties: Record<string, DataPortSchema> = {};\n const innerProps = innerSchema.properties || {};\n\n for (const [key, propSchema] of Object.entries(innerProps)) {\n if (typeof propSchema === \"boolean\") continue;\n\n if ((propSchema as Record<string, unknown>)[\"x-ui-iteration\"]) {\n continue;\n }\n\n const baseSchema = propSchema as DataPortSchema;\n properties[key] = createFlexibleSchema(baseSchema);\n }\n\n return {\n type: \"object\",\n properties,\n additionalProperties: innerSchema.additionalProperties ?? true,\n } as DataPortSchema;\n }\n\n protected buildConfiguredIterationInputSchema(): DataPortSchema {\n const innerSchema = this.getInnerInputSchema();\n if (!innerSchema || typeof innerSchema === \"boolean\") {\n return { type: \"object\", properties: {}, additionalProperties: true };\n }\n\n const config = this.iterationInputConfig || {};\n const properties: Record<string, DataPortSchema> = {};\n const innerProps = innerSchema.properties || {};\n\n for (const [key, propSchema] of Object.entries(innerProps)) {\n if (typeof propSchema === \"boolean\") continue;\n\n if ((propSchema as Record<string, unknown>)[\"x-ui-iteration\"]) {\n continue;\n }\n\n const baseSchema = propSchema as DataPortSchema;\n const propConfig = config[key];\n\n if (!propConfig) {\n properties[key] = createFlexibleSchema(baseSchema);\n continue;\n }\n\n switch (propConfig.mode) {\n case \"array\":\n properties[key] = createArraySchema(propConfig.baseSchema);\n break;\n case \"scalar\":\n properties[key] = propConfig.baseSchema;\n break;\n case \"flexible\":\n default:\n properties[key] = createFlexibleSchema(propConfig.baseSchema);\n break;\n }\n }\n\n return {\n type: \"object\",\n properties,\n additionalProperties: innerSchema.additionalProperties ?? true,\n } as DataPortSchema;\n }\n\n /**\n * Derives the schema accepted by each iteration of the inner workflow.\n * This uses root task inputs and does not require an InputTask node.\n */\n protected getInnerInputSchema(): DataPortSchema | undefined {\n if (!this.hasChildren()) return undefined;\n\n const tasks = this.subGraph.getTasks();\n if (tasks.length === 0) return undefined;\n\n const startingNodes = tasks.filter(\n (task) => this.subGraph.getSourceDataflows(task.config.id).length === 0\n );\n const sources = startingNodes.length > 0 ? startingNodes : tasks;\n\n const properties: Record<string, DataPortSchema> = {};\n const required: string[] = [];\n let additionalProperties = false;\n\n for (const task of sources) {\n const inputSchema = task.inputSchema();\n if (typeof inputSchema === \"boolean\") {\n if (inputSchema === true) {\n additionalProperties = true;\n }\n continue;\n }\n\n additionalProperties = additionalProperties || inputSchema.additionalProperties === true;\n\n for (const [key, prop] of Object.entries(inputSchema.properties || {})) {\n if (typeof prop === \"boolean\") continue;\n if (!properties[key]) {\n properties[key] = prop as DataPortSchema;\n }\n }\n\n for (const key of inputSchema.required || []) {\n if (!required.includes(key)) {\n required.push(key);\n }\n }\n }\n\n return {\n type: \"object\",\n properties,\n ...(required.length > 0 ? { required } : {}),\n additionalProperties,\n } as DataPortSchema;\n }\n\n public getIterationInputSchema(): DataPortSchema {\n if (this._iterationInputSchema) {\n return this._iterationInputSchema;\n }\n\n this._iterationInputSchema = this.iterationInputConfig\n ? this.buildConfiguredIterationInputSchema()\n : this.buildDefaultIterationInputSchema();\n\n return this._iterationInputSchema;\n }\n\n public setIterationInputSchema(schema: DataPortSchema): void {\n this._iterationInputSchema = schema;\n this._inputSchemaNode = undefined;\n this.events.emit(\"regenerate\");\n }\n\n public setPropertyInputMode(\n propertyName: string,\n mode: IterationInputMode,\n baseSchema?: DataPortSchema\n ): void {\n const currentSchema = this.getIterationInputSchema();\n if (typeof currentSchema === \"boolean\") return;\n\n const currentProps = (currentSchema.properties || {}) as Record<string, DataPortSchema>;\n const existingProp = currentProps[propertyName];\n const base: DataPortSchema =\n baseSchema ??\n (existingProp ? extractBaseSchema(existingProp) : ({ type: \"string\" } as DataPortSchema));\n\n let newPropSchema: DataPortSchema;\n switch (mode) {\n case \"array\":\n newPropSchema = createArraySchema(base);\n break;\n case \"scalar\":\n newPropSchema = base;\n break;\n case \"flexible\":\n default:\n newPropSchema = createFlexibleSchema(base);\n break;\n }\n\n this._iterationInputSchema = {\n ...currentSchema,\n properties: {\n ...currentProps,\n [propertyName]: newPropSchema,\n },\n } as DataPortSchema;\n\n this._inputSchemaNode = undefined;\n this.events.emit(\"regenerate\");\n }\n\n public invalidateIterationInputSchema(): void {\n this._iterationInputSchema = undefined;\n this._iteratorPortInfo = undefined;\n this._inputSchemaNode = undefined;\n }\n\n // ========================================================================\n // Iteration analysis\n // ========================================================================\n\n /**\n * Analyzes input to determine which ports are iterated vs scalar.\n * Precedence:\n * 1) explicit x-ui-iteration annotation\n * 2) schema inference where deterministic\n * 3) runtime value fallback (Array.isArray)\n */\n public analyzeIterationInput(input: Input): IterationAnalysisResult {\n const inputData = input as Record<string, unknown>;\n const schema = this.hasChildren() ? this.getIterationInputSchema() : this.inputSchema();\n const schemaProps: Record<string, DataPortSchema> =\n typeof schema === \"object\" && schema.properties\n ? (schema.properties as Record<string, DataPortSchema>)\n : {};\n\n const keys = new Set([...Object.keys(schemaProps), ...Object.keys(inputData)]);\n\n const arrayPorts: string[] = [];\n const scalarPorts: string[] = [];\n const iteratedValues: Record<string, unknown[]> = {};\n const arrayLengths: number[] = [];\n\n for (const key of keys) {\n if (key.startsWith(\"_iteration\")) continue;\n\n const value = inputData[key];\n const portSchema = schemaProps[key];\n\n let shouldIterate: boolean;\n\n const explicitFlag = getExplicitIterationFlag(portSchema);\n if (explicitFlag !== undefined) {\n shouldIterate = explicitFlag;\n } else {\n const schemaInference = inferIterationFromSchema(portSchema);\n shouldIterate = schemaInference ?? Array.isArray(value);\n }\n\n if (!shouldIterate) {\n scalarPorts.push(key);\n continue;\n }\n\n if (!Array.isArray(value)) {\n throw new TaskConfigurationError(\n `${this.type}: Input '${key}' is configured for iteration but value is not an array.`\n );\n }\n\n iteratedValues[key] = value;\n arrayPorts.push(key);\n arrayLengths.push(value.length);\n }\n\n if (arrayPorts.length === 0) {\n throw new TaskConfigurationError(\n `${this.type}: At least one array input is required for iteration. ` +\n `Mark a port with x-ui-iteration=true, provide array-typed schema, or pass array values at runtime.`\n );\n }\n\n const uniqueLengths = new Set(arrayLengths);\n if (uniqueLengths.size > 1) {\n const lengthInfo = arrayPorts\n .map((port, index) => `${port}=${arrayLengths[index]}`)\n .join(\", \");\n throw new TaskConfigurationError(\n `${this.type}: All iterated array inputs must have the same length (zip semantics). ` +\n `Found different lengths: ${lengthInfo}`\n );\n }\n\n const iterationCount = arrayLengths[0] ?? 0;\n\n const getIterationInput = (index: number): Record<string, unknown> => {\n const iterInput: Record<string, unknown> = {};\n\n for (const key of arrayPorts) {\n iterInput[key] = iteratedValues[key][index];\n }\n\n for (const key of scalarPorts) {\n if (key in inputData) {\n iterInput[key] = inputData[key];\n }\n }\n\n return iterInput;\n };\n\n return {\n iterationCount,\n arrayPorts,\n scalarPorts,\n getIterationInput,\n };\n }\n\n // ========================================================================\n // Schema Methods\n // ========================================================================\n\n public getIterationContextSchema(): DataPortSchema {\n return (this.constructor as typeof IteratorTask).getIterationContextSchema();\n }\n\n public inputSchema(): DataPortSchema {\n if (this.hasChildren()) {\n return this.getIterationInputSchema();\n }\n return (this.constructor as typeof IteratorTask).inputSchema();\n }\n\n public outputSchema(): DataPortSchema {\n if (!this.hasChildren()) {\n return (this.constructor as typeof IteratorTask).outputSchema();\n }\n\n return this.getWrappedOutputSchema();\n }\n\n protected getWrappedOutputSchema(): DataPortSchema {\n if (!this.hasChildren()) {\n return { type: \"object\", properties: {}, additionalProperties: false };\n }\n\n const endingNodes = this.subGraph\n .getTasks()\n .filter((task) => this.subGraph.getTargetDataflows(task.config.id).length === 0);\n\n if (endingNodes.length === 0) {\n return { type: \"object\", properties: {}, additionalProperties: false };\n }\n\n const properties: Record<string, unknown> = {};\n\n for (const task of endingNodes) {\n const taskOutputSchema = task.outputSchema();\n if (typeof taskOutputSchema === \"boolean\") continue;\n\n for (const [key, schema] of Object.entries(taskOutputSchema.properties || {})) {\n properties[key] = {\n type: \"array\",\n items: schema,\n };\n }\n }\n\n return {\n type: \"object\",\n properties,\n additionalProperties: false,\n } as DataPortSchema;\n }\n}\n",
24
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DataPortSchema, PropertySchema } from \"@workglow/util\";\nimport { TaskGraph } from \"../task-graph/TaskGraph\";\nimport { GraphAsTask, GraphAsTaskConfig, graphAsTaskConfigSchema } from \"./GraphAsTask\";\nimport type { IExecuteContext } from \"./ITask\";\nimport { IteratorTaskRunner } from \"./IteratorTaskRunner\";\nimport type { StreamEvent, StreamFinish } from \"./StreamTypes\";\nimport { TaskConfigurationError } from \"./TaskError\";\nimport type { TaskInput, TaskOutput, TaskTypeName } from \"./TaskTypes\";\n\n/**\n * Standard iteration context schema for IteratorTask subclasses (Map, Reduce).\n * Properties are marked with \"x-ui-iteration\": true so the builder\n * knows to hide them from parent-level display.\n */\nexport const ITERATOR_CONTEXT_SCHEMA: DataPortSchema = {\n type: \"object\",\n properties: {\n _iterationIndex: {\n type: \"integer\",\n minimum: 0,\n title: \"Iteration Index\",\n description: \"Current iteration index (0-based)\",\n \"x-ui-iteration\": true,\n },\n _iterationCount: {\n type: \"integer\",\n minimum: 0,\n title: \"Iteration Count\",\n description: \"Total number of iterations\",\n \"x-ui-iteration\": true,\n },\n },\n};\n\n/**\n * Execution mode for iterator tasks.\n * - `parallel`: Execute all iterations concurrently (logical mode)\n * - `parallel-limited`: Execute with a concurrency limit\n */\nexport type ExecutionMode = \"parallel\" | \"parallel-limited\";\n\n/**\n * Input mode for a property in the iteration input schema.\n * - \"array\": Property must be an array (will be iterated)\n * - \"scalar\": Property must be a scalar (constant for all iterations)\n * - \"flexible\": Property accepts both array and scalar (T | T[])\n */\nexport type IterationInputMode = \"array\" | \"scalar\" | \"flexible\";\n\n/**\n * Configuration for a single property in the iteration input schema.\n */\nexport interface IterationPropertyConfig {\n /** The base schema for the property (without array wrapping) */\n readonly baseSchema: PropertySchema;\n /** The input mode for this property */\n readonly mode: IterationInputMode;\n}\n\nexport const iteratorTaskConfigSchema = {\n type: \"object\",\n properties: {\n ...graphAsTaskConfigSchema[\"properties\"],\n concurrencyLimit: { type: \"integer\", minimum: 1 },\n batchSize: { type: \"integer\", minimum: 1 },\n iterationInputConfig: { type: \"object\", additionalProperties: true },\n },\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\n/**\n * Configuration type for IteratorTask.\n * Extends GraphAsTaskConfig with iterator-specific options.\n */\nexport type IteratorTaskConfig = GraphAsTaskConfig & {\n /**\n * Maximum number of concurrent iteration workers\n * @default undefined (unlimited)\n */\n readonly concurrencyLimit?: number;\n\n /**\n * Number of items per batch. When set, iteration indices are grouped into batches.\n * @default undefined\n */\n readonly batchSize?: number;\n\n /**\n * User-defined iteration input schema configuration.\n */\n readonly iterationInputConfig?: Record<string, IterationPropertyConfig>;\n};\n\n/**\n * Result of detecting the iterator port from the input schema.\n */\ninterface IteratorPortInfo {\n readonly portName: string;\n readonly itemSchema: DataPortSchema;\n}\n\n/**\n * Result of analyzing input for iteration.\n */\nexport interface IterationAnalysisResult {\n /** The number of iterations to perform */\n readonly iterationCount: number;\n /** Names of properties that are arrays (to be iterated) */\n readonly arrayPorts: string[];\n /** Names of properties that are scalars (passed as constants) */\n readonly scalarPorts: string[];\n /** Gets the input for a specific iteration index */\n getIterationInput(index: number): Record<string, unknown>;\n}\n\nfunction isArrayVariant(schema: unknown): boolean {\n if (!schema || typeof schema !== \"object\") return false;\n const record = schema as Record<string, unknown>;\n return record.type === \"array\" || record.items !== undefined;\n}\n\nfunction getExplicitIterationFlag(schema: DataPortSchema | undefined): boolean | undefined {\n if (!schema || typeof schema !== \"object\") return undefined;\n const record = schema as Record<string, unknown>;\n const flag = record[\"x-ui-iteration\"];\n if (flag === true) return true;\n if (flag === false) return false;\n return undefined;\n}\n\nfunction inferIterationFromSchema(schema: DataPortSchema | undefined): boolean | undefined {\n if (!schema || typeof schema !== \"object\") return undefined;\n\n const record = schema as Record<string, unknown>;\n\n if (record.type === \"array\" || record.items !== undefined) {\n return true;\n }\n\n const variants = (record.oneOf ?? record.anyOf) as unknown[] | undefined;\n if (!Array.isArray(variants) || variants.length === 0) {\n // Schema does not clearly indicate array/non-array - defer to runtime\n if (record.type !== undefined) {\n return false;\n }\n return undefined;\n }\n\n let hasArrayVariant = false;\n let hasNonArrayVariant = false;\n\n for (const variant of variants) {\n if (isArrayVariant(variant)) {\n hasArrayVariant = true;\n } else {\n hasNonArrayVariant = true;\n }\n }\n\n if (hasArrayVariant && hasNonArrayVariant) return undefined;\n if (hasArrayVariant) return true;\n return false;\n}\n\n/**\n * Creates a union type schema (T | T[]) for flexible iteration input.\n */\nexport function createFlexibleSchema(baseSchema: PropertySchema): PropertySchema {\n return {\n anyOf: [baseSchema, { type: \"array\", items: baseSchema }],\n } as PropertySchema;\n}\n\n/**\n * Creates an array schema from a base schema.\n */\nexport function createArraySchema(baseSchema: PropertySchema): PropertySchema {\n return {\n type: \"array\",\n items: baseSchema,\n } as PropertySchema;\n}\n\n/**\n * Extracts the base (scalar) schema from a potentially wrapped schema.\n */\nexport function extractBaseSchema(schema: PropertySchema): PropertySchema {\n const schemaType = (schema as Record<string, unknown>).type;\n if (schemaType === \"array\" && (schema as Record<string, unknown>).items) {\n return (schema as Record<string, unknown>).items as PropertySchema;\n }\n\n const variants =\n (schema as Record<string, unknown>).oneOf ?? (schema as Record<string, unknown>).anyOf;\n if (Array.isArray(variants)) {\n for (const variant of variants) {\n if (typeof variant === \"object\") {\n const variantType = (variant as Record<string, unknown>).type;\n if (variantType !== \"array\") {\n return variant as PropertySchema;\n }\n }\n }\n for (const variant of variants) {\n if (typeof variant === \"object\") {\n const variantType = (variant as Record<string, unknown>).type;\n if (variantType === \"array\" && (variant as Record<string, unknown>).items) {\n return (variant as Record<string, unknown>).items as PropertySchema;\n }\n }\n }\n }\n\n return schema;\n}\n\n/**\n * Determines if a schema accepts arrays (is array type or has array in union).\n */\nexport function schemaAcceptsArray(schema: DataPortSchema): boolean {\n if (typeof schema === \"boolean\") return false;\n\n const schemaType = (schema as Record<string, unknown>).type;\n if (schemaType === \"array\") return true;\n\n const variants = (schema.oneOf ?? schema.anyOf) as DataPortSchema[] | undefined;\n if (Array.isArray(variants)) {\n return variants.some((variant) => isArrayVariant(variant));\n }\n\n return false;\n}\n\n/**\n * Base class for iterator tasks that process collections of items.\n */\nexport abstract class IteratorTask<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends IteratorTaskConfig = IteratorTaskConfig,\n> extends GraphAsTask<Input, Output, Config> {\n public static type: TaskTypeName = \"IteratorTask\";\n public static category: string = \"Flow Control\";\n public static title: string = \"Iterator\";\n public static description: string = \"Base class for loop-type tasks\";\n\n /** This task has dynamic schemas based on the inner workflow */\n public static hasDynamicSchemas: boolean = true;\n\n public static configSchema(): DataPortSchema {\n return iteratorTaskConfigSchema;\n }\n\n /**\n * Returns the schema for iteration-context inputs that will be\n * injected into the subgraph at runtime.\n */\n public static getIterationContextSchema(): DataPortSchema {\n return ITERATOR_CONTEXT_SCHEMA;\n }\n\n /** Cached iterator port info from schema analysis. */\n protected _iteratorPortInfo: IteratorPortInfo | undefined;\n\n /** Cached computed iteration input schema. */\n protected _iterationInputSchema: DataPortSchema | undefined;\n\n constructor(input: Partial<Input> = {}, config: Partial<Config> = {}) {\n super(input, config as Config);\n }\n\n // ========================================================================\n // TaskRunner Override\n // ========================================================================\n\n declare _runner: IteratorTaskRunner<Input, Output, Config>;\n\n override get runner(): IteratorTaskRunner<Input, Output, Config> {\n if (!this._runner) {\n this._runner = new IteratorTaskRunner<Input, Output, Config>(this);\n }\n return this._runner;\n }\n\n /**\n * IteratorTask does not support streaming pass-through because its output\n * is an aggregation of multiple iterations (arrays for MapTask, accumulated\n * value for ReduceTask). The inherited GraphAsTask.executeStream is\n * overridden to just emit a finish event (no streaming).\n */\n async *executeStream(\n input: Input,\n _context: IExecuteContext\n ): AsyncIterable<StreamEvent<Output>> {\n yield { type: \"finish\", data: input as unknown as Output } as StreamFinish<Output>;\n }\n\n // ========================================================================\n // Graph hooks\n // ========================================================================\n\n override set subGraph(subGraph: TaskGraph) {\n super.subGraph = subGraph;\n this.invalidateIterationInputSchema();\n this.events.emit(\"regenerate\");\n }\n\n override get subGraph(): TaskGraph {\n return super.subGraph;\n }\n\n public override regenerateGraph(): void {\n this.invalidateIterationInputSchema();\n super.regenerateGraph();\n }\n\n // ========================================================================\n // Runner hooks\n // ========================================================================\n\n /**\n * Whether results should be ordered by iteration index.\n * MapTask overrides this to use its `preserveOrder` config.\n */\n public preserveIterationOrder(): boolean {\n return true;\n }\n\n /**\n * Whether this iterator runs in reduce mode.\n */\n public isReduceTask(): boolean {\n return false;\n }\n\n /**\n * Initial accumulator for reduce mode.\n */\n public getInitialAccumulator(): Output {\n return {} as Output;\n }\n\n /**\n * Builds the per-iteration subgraph input.\n */\n public buildIterationRunInput(\n analysis: IterationAnalysisResult,\n index: number,\n iterationCount: number,\n extraInput: Record<string, unknown> = {}\n ): Record<string, unknown> {\n return {\n ...analysis.getIterationInput(index),\n ...extraInput,\n _iterationIndex: index,\n _iterationCount: iterationCount,\n };\n }\n\n /**\n * Updates the accumulator with one iteration result in reduce mode.\n */\n public mergeIterationIntoAccumulator(\n accumulator: Output,\n iterationResult: TaskOutput | undefined,\n _index: number\n ): Output {\n return (iterationResult ?? accumulator) as Output;\n }\n\n /**\n * Returns the result when there are no items to iterate.\n */\n public getEmptyResult(): Output {\n return {} as Output;\n }\n\n /**\n * Collects and merges results from all iterations.\n */\n public collectResults(results: TaskOutput[]): Output {\n if (results.length === 0) {\n return {} as Output;\n }\n\n const merged: Record<string, unknown[]> = {};\n\n for (const result of results) {\n if (!result || typeof result !== \"object\") continue;\n\n for (const [key, value] of Object.entries(result as Record<string, unknown>)) {\n if (!merged[key]) {\n merged[key] = [];\n }\n merged[key].push(value);\n }\n }\n\n return merged as Output;\n }\n\n // ========================================================================\n // Execution Mode Configuration\n // ========================================================================\n\n public get concurrencyLimit(): number | undefined {\n return this.config.concurrencyLimit;\n }\n\n public get batchSize(): number | undefined {\n return this.config.batchSize;\n }\n\n // ========================================================================\n // Iteration Input Schema Management\n // ========================================================================\n\n public get iterationInputConfig(): Record<string, IterationPropertyConfig> | undefined {\n return this.config.iterationInputConfig;\n }\n\n protected buildDefaultIterationInputSchema(): DataPortSchema {\n const innerSchema = this.getInnerInputSchema();\n if (!innerSchema || typeof innerSchema === \"boolean\") {\n return { type: \"object\", properties: {}, additionalProperties: true };\n }\n\n const properties: Record<string, PropertySchema> = {};\n const innerProps = innerSchema.properties || {};\n\n for (const [key, propSchema] of Object.entries(innerProps)) {\n if (typeof propSchema === \"boolean\") continue;\n\n if ((propSchema as Record<string, unknown>)[\"x-ui-iteration\"]) {\n continue;\n }\n\n const baseSchema = propSchema as PropertySchema;\n properties[key] = createFlexibleSchema(baseSchema);\n }\n\n return {\n type: \"object\",\n properties,\n additionalProperties: innerSchema.additionalProperties ?? true,\n } as DataPortSchema;\n }\n\n protected buildConfiguredIterationInputSchema(): DataPortSchema {\n const innerSchema = this.getInnerInputSchema();\n if (!innerSchema || typeof innerSchema === \"boolean\") {\n return { type: \"object\", properties: {}, additionalProperties: true };\n }\n\n const config = this.iterationInputConfig || {};\n const properties: Record<string, PropertySchema> = {};\n const innerProps = innerSchema.properties || {};\n\n for (const [key, propSchema] of Object.entries(innerProps)) {\n if (typeof propSchema === \"boolean\") continue;\n\n if ((propSchema as Record<string, unknown>)[\"x-ui-iteration\"]) {\n continue;\n }\n\n const baseSchema = propSchema as PropertySchema;\n const propConfig = config[key];\n\n if (!propConfig) {\n properties[key] = createFlexibleSchema(baseSchema);\n continue;\n }\n\n switch (propConfig.mode) {\n case \"array\":\n properties[key] = createArraySchema(propConfig.baseSchema);\n break;\n case \"scalar\":\n properties[key] = propConfig.baseSchema;\n break;\n case \"flexible\":\n default:\n properties[key] = createFlexibleSchema(propConfig.baseSchema);\n break;\n }\n }\n\n return {\n type: \"object\",\n properties,\n additionalProperties: innerSchema.additionalProperties ?? true,\n } as DataPortSchema;\n }\n\n /**\n * Derives the schema accepted by each iteration of the inner workflow.\n * This uses root task inputs and does not require an InputTask node.\n */\n protected getInnerInputSchema(): DataPortSchema | undefined {\n if (!this.hasChildren()) return undefined;\n\n const tasks = this.subGraph.getTasks();\n if (tasks.length === 0) return undefined;\n\n const startingNodes = tasks.filter(\n (task) => this.subGraph.getSourceDataflows(task.config.id).length === 0\n );\n const sources = startingNodes.length > 0 ? startingNodes : tasks;\n\n const properties: Record<string, DataPortSchema> = {};\n const required: string[] = [];\n let additionalProperties = false;\n\n for (const task of sources) {\n const inputSchema = task.inputSchema();\n if (typeof inputSchema === \"boolean\") {\n if (inputSchema === true) {\n additionalProperties = true;\n }\n continue;\n }\n\n additionalProperties = additionalProperties || inputSchema.additionalProperties === true;\n\n for (const [key, prop] of Object.entries(inputSchema.properties || {})) {\n if (typeof prop === \"boolean\") continue;\n if (!properties[key]) {\n properties[key] = prop as DataPortSchema;\n }\n }\n\n for (const key of inputSchema.required || []) {\n if (!required.includes(key)) {\n required.push(key);\n }\n }\n }\n\n return {\n type: \"object\",\n properties,\n ...(required.length > 0 ? { required } : {}),\n additionalProperties,\n } as DataPortSchema;\n }\n\n public getIterationInputSchema(): DataPortSchema {\n if (this._iterationInputSchema) {\n return this._iterationInputSchema;\n }\n\n this._iterationInputSchema = this.iterationInputConfig\n ? this.buildConfiguredIterationInputSchema()\n : this.buildDefaultIterationInputSchema();\n\n return this._iterationInputSchema;\n }\n\n public setIterationInputSchema(schema: DataPortSchema): void {\n this._iterationInputSchema = schema;\n this._inputSchemaNode = undefined;\n this.events.emit(\"regenerate\");\n }\n\n public setPropertyInputMode(\n propertyName: string,\n mode: IterationInputMode,\n baseSchema?: PropertySchema\n ): void {\n const currentSchema = this.getIterationInputSchema();\n if (typeof currentSchema === \"boolean\") return;\n\n const currentProps = (currentSchema.properties || {}) as Record<string, PropertySchema>;\n const existingProp = currentProps[propertyName];\n const base: PropertySchema =\n baseSchema ?? (existingProp ? extractBaseSchema(existingProp) : { type: \"string\" });\n\n let newPropSchema: PropertySchema;\n switch (mode) {\n case \"array\":\n newPropSchema = createArraySchema(base);\n break;\n case \"scalar\":\n newPropSchema = base;\n break;\n case \"flexible\":\n default:\n newPropSchema = createFlexibleSchema(base);\n break;\n }\n\n this._iterationInputSchema = {\n ...currentSchema,\n properties: {\n ...currentProps,\n [propertyName]: newPropSchema,\n },\n } as DataPortSchema;\n\n this._inputSchemaNode = undefined;\n this.events.emit(\"regenerate\");\n }\n\n public invalidateIterationInputSchema(): void {\n this._iterationInputSchema = undefined;\n this._iteratorPortInfo = undefined;\n this._inputSchemaNode = undefined;\n }\n\n // ========================================================================\n // Iteration analysis\n // ========================================================================\n\n /**\n * Analyzes input to determine which ports are iterated vs scalar.\n * Precedence:\n * 1) explicit x-ui-iteration annotation\n * 2) schema inference where deterministic\n * 3) runtime value fallback (Array.isArray)\n */\n public analyzeIterationInput(input: Input): IterationAnalysisResult {\n const inputData = input as Record<string, unknown>;\n const schema = this.hasChildren() ? this.getIterationInputSchema() : this.inputSchema();\n const schemaProps: Record<string, DataPortSchema> =\n typeof schema === \"object\" && schema.properties\n ? (schema.properties as Record<string, DataPortSchema>)\n : {};\n\n const keys = new Set([...Object.keys(schemaProps), ...Object.keys(inputData)]);\n\n const arrayPorts: string[] = [];\n const scalarPorts: string[] = [];\n const iteratedValues: Record<string, unknown[]> = {};\n const arrayLengths: number[] = [];\n\n for (const key of keys) {\n if (key.startsWith(\"_iteration\")) continue;\n\n const value = inputData[key];\n const portSchema = schemaProps[key];\n\n let shouldIterate: boolean;\n\n const explicitFlag = getExplicitIterationFlag(portSchema);\n if (explicitFlag !== undefined) {\n shouldIterate = explicitFlag;\n } else {\n const schemaInference = inferIterationFromSchema(portSchema);\n shouldIterate = schemaInference ?? Array.isArray(value);\n }\n\n if (!shouldIterate) {\n scalarPorts.push(key);\n continue;\n }\n\n if (!Array.isArray(value)) {\n throw new TaskConfigurationError(\n `${this.type}: Input '${key}' is configured for iteration but value is not an array.`\n );\n }\n\n iteratedValues[key] = value;\n arrayPorts.push(key);\n arrayLengths.push(value.length);\n }\n\n if (arrayPorts.length === 0) {\n throw new TaskConfigurationError(\n `${this.type}: At least one array input is required for iteration. ` +\n `Mark a port with x-ui-iteration=true, provide array-typed schema, or pass array values at runtime.`\n );\n }\n\n const uniqueLengths = new Set(arrayLengths);\n if (uniqueLengths.size > 1) {\n const lengthInfo = arrayPorts\n .map((port, index) => `${port}=${arrayLengths[index]}`)\n .join(\", \");\n throw new TaskConfigurationError(\n `${this.type}: All iterated array inputs must have the same length (zip semantics). ` +\n `Found different lengths: ${lengthInfo}`\n );\n }\n\n const iterationCount = arrayLengths[0] ?? 0;\n\n const getIterationInput = (index: number): Record<string, unknown> => {\n const iterInput: Record<string, unknown> = {};\n\n for (const key of arrayPorts) {\n iterInput[key] = iteratedValues[key][index];\n }\n\n for (const key of scalarPorts) {\n if (key in inputData) {\n iterInput[key] = inputData[key];\n }\n }\n\n return iterInput;\n };\n\n return {\n iterationCount,\n arrayPorts,\n scalarPorts,\n getIterationInput,\n };\n }\n\n // ========================================================================\n // Schema Methods\n // ========================================================================\n\n public getIterationContextSchema(): DataPortSchema {\n return (this.constructor as typeof IteratorTask).getIterationContextSchema();\n }\n\n public inputSchema(): DataPortSchema {\n if (this.hasChildren()) {\n return this.getIterationInputSchema();\n }\n return (this.constructor as typeof IteratorTask).inputSchema();\n }\n\n public outputSchema(): DataPortSchema {\n if (!this.hasChildren()) {\n return (this.constructor as typeof IteratorTask).outputSchema();\n }\n\n return this.getWrappedOutputSchema();\n }\n\n protected getWrappedOutputSchema(): DataPortSchema {\n if (!this.hasChildren()) {\n return { type: \"object\", properties: {}, additionalProperties: false };\n }\n\n const endingNodes = this.subGraph\n .getTasks()\n .filter((task) => this.subGraph.getTargetDataflows(task.config.id).length === 0);\n\n if (endingNodes.length === 0) {\n return { type: \"object\", properties: {}, additionalProperties: false };\n }\n\n const properties: Record<string, unknown> = {};\n\n for (const task of endingNodes) {\n const taskOutputSchema = task.outputSchema();\n if (typeof taskOutputSchema === \"boolean\") continue;\n\n for (const [key, schema] of Object.entries(taskOutputSchema.properties || {})) {\n properties[key] = {\n type: \"array\",\n items: schema,\n };\n }\n }\n\n return {\n type: \"object\",\n properties,\n additionalProperties: false,\n } as DataPortSchema;\n }\n}\n",
25
25
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { GraphAsTaskRunner } from \"./GraphAsTaskRunner\";\nimport type { TaskInput, TaskOutput } from \"./TaskTypes\";\nimport type { WhileTask, WhileTaskConfig } from \"./WhileTask\";\n\n/**\n * Runner for WhileTask that delegates to the task's execute() method\n * instead of directly running the subgraph once (which is what\n * GraphAsTaskRunner does by default).\n *\n * This follows the same pattern as IteratorTaskRunner.\n */\nexport class WhileTaskRunner<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends WhileTaskConfig<Output> = WhileTaskConfig<Output>,\n> extends GraphAsTaskRunner<Input, Output, Config> {\n declare task: WhileTask<Input, Output, Config>;\n\n /**\n * Override executeTask to call the task's execute() method which\n * contains the while-loop logic, rather than the default\n * GraphAsTaskRunner behavior of running the subgraph once.\n */\n protected override async executeTask(input: Input): Promise<Output | undefined> {\n const result = await this.task.execute(input, {\n signal: this.abortController!.signal,\n updateProgress: this.handleProgress.bind(this),\n own: this.own,\n registry: this.registry,\n });\n\n return result;\n }\n\n /**\n * For WhileTask, reactive runs use the task's reactive hook only.\n */\n public override async executeTaskReactive(input: Input, output: Output): Promise<Output> {\n const reactiveResult = await this.task.executeReactive(input, output, { own: this.own });\n return Object.assign({}, output, reactiveResult ?? {}) as Output;\n }\n}\n",
26
26
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DataPortSchema } from \"@workglow/util\";\nimport { CreateEndLoopWorkflow, CreateLoopWorkflow, Workflow } from \"../task-graph/Workflow\";\nimport { evaluateCondition, getNestedValue } from \"./ConditionUtils\";\nimport { GraphAsTask, GraphAsTaskConfig, graphAsTaskConfigSchema } from \"./GraphAsTask\";\nimport type { IExecuteContext } from \"./ITask\";\nimport type { StreamEvent, StreamFinish } from \"./StreamTypes\";\nimport { TaskConfigurationError } from \"./TaskError\";\nimport type { TaskInput, TaskOutput, TaskTypeName } from \"./TaskTypes\";\nimport { WhileTaskRunner } from \"./WhileTaskRunner\";\n\n/**\n * WhileTask context schema - only has index since count is unknown ahead of time.\n * Properties are marked with \"x-ui-iteration\": true so the builder\n * knows to hide them from parent-level display.\n */\nexport const WHILE_CONTEXT_SCHEMA: DataPortSchema = {\n type: \"object\",\n properties: {\n _iterationIndex: {\n type: \"integer\",\n minimum: 0,\n title: \"Iteration Number\",\n description: \"Current iteration number (0-based)\",\n \"x-ui-iteration\": true,\n },\n },\n};\n\n/**\n * Condition function type for WhileTask.\n * Receives the current output and iteration count, returns whether to continue looping.\n *\n * @param output - The output from the last iteration\n * @param iteration - The current iteration number (0-based)\n * @returns true to continue looping, false to stop\n */\nexport type WhileConditionFn<Output> = (output: Output, iteration: number) => boolean;\n\nexport const whileTaskConfigSchema = {\n type: \"object\",\n properties: {\n ...graphAsTaskConfigSchema[\"properties\"],\n condition: {},\n maxIterations: { type: \"integer\", minimum: 1 },\n chainIterations: { type: \"boolean\" },\n conditionField: { type: \"string\" },\n conditionOperator: { type: \"string\" },\n conditionValue: { type: \"string\" },\n iterationInputConfig: { type: \"object\", additionalProperties: true },\n },\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\n/**\n * Configuration for WhileTask.\n */\nexport type WhileTaskConfig<Output extends TaskOutput = TaskOutput> = GraphAsTaskConfig & {\n /**\n * Condition function that determines whether to continue looping.\n * Called after each iteration with the current output and iteration count.\n * Returns true to continue, false to stop.\n */\n readonly condition?: WhileConditionFn<Output>;\n\n /**\n * Maximum number of iterations to prevent infinite loops.\n * @default 100\n */\n readonly maxIterations?: number;\n\n /**\n * Whether to pass the output of each iteration as input to the next.\n * When true, output from iteration N becomes input to iteration N+1.\n * @default true\n */\n readonly chainIterations?: boolean;\n\n /** Output field to evaluate for the loop condition. */\n readonly conditionField?: string;\n\n /** Comparison operator for the loop condition. */\n readonly conditionOperator?: string;\n\n /** Value to compare against for the loop condition. */\n readonly conditionValue?: string;\n\n /** Per-property iteration input configuration (scalar/array/flexible). */\n readonly iterationInputConfig?: Record<string, { mode: string; baseSchema?: unknown }>;\n};\n\n/**\n * WhileTask loops until a condition function returns false.\n *\n * This task is useful for:\n * - Iterative refinement processes\n * - Polling until a condition is met\n * - Convergence algorithms\n * - Retry logic with conditions\n *\n * ## Features\n *\n * - Loops until condition returns false\n * - Configurable maximum iterations (safety limit)\n * - Passes output from each iteration to the next\n * - Access to iteration count in condition function\n *\n * ## Usage\n *\n * ```typescript\n * // Refine until quality threshold\n * workflow\n * .while({\n * condition: (output, iteration) => output.quality < 0.9 && iteration < 10,\n * maxIterations: 20\n * })\n * .refineResult()\n * .evaluateQuality()\n * .endWhile()\n *\n * // Retry until success\n * workflow\n * .while({\n * condition: (output) => !output.success,\n * maxIterations: 5\n * })\n * .attemptOperation()\n * .endWhile()\n * ```\n *\n * @template Input - The input type for the while task\n * @template Output - The output type for the while task\n * @template Config - The configuration type\n */\nexport class WhileTask<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends WhileTaskConfig<Output> = WhileTaskConfig<Output>,\n> extends GraphAsTask<Input, Output, Config> {\n public static type: TaskTypeName = \"WhileTask\";\n public static category: string = \"Flow Control\";\n public static title: string = \"While Loop\";\n public static description: string = \"Loops until a condition function returns false\";\n\n /** This task has dynamic schemas based on the inner workflow */\n public static hasDynamicSchemas: boolean = true;\n\n public static configSchema(): DataPortSchema {\n return whileTaskConfigSchema;\n }\n\n /**\n * Returns the schema for iteration-context inputs that will be\n * injected into the subgraph InputTask at runtime.\n *\n * WhileTask only provides _iterationIndex since the total count\n * is unknown ahead of time.\n */\n public static getIterationContextSchema(): DataPortSchema {\n return WHILE_CONTEXT_SCHEMA;\n }\n\n /**\n * Current iteration count during execution.\n */\n protected _currentIteration: number = 0;\n\n constructor(input: Partial<Input> = {}, config: Partial<Config> = {}) {\n super(input, config as Config);\n }\n\n // ========================================================================\n // TaskRunner Override\n // ========================================================================\n\n declare _runner: WhileTaskRunner<Input, Output, Config>;\n\n override get runner(): WhileTaskRunner<Input, Output, Config> {\n if (!this._runner) {\n this._runner = new WhileTaskRunner<Input, Output, Config>(this);\n }\n return this._runner;\n }\n\n // ========================================================================\n // Configuration Accessors\n // ========================================================================\n\n /**\n * Gets the condition function.\n */\n public get condition(): WhileConditionFn<Output> | undefined {\n return this.config.condition;\n }\n\n /**\n * Gets the maximum iterations limit.\n */\n public get maxIterations(): number {\n return this.config.maxIterations ?? 100;\n }\n\n /**\n * Whether to chain iteration outputs to inputs.\n */\n public get chainIterations(): boolean {\n return this.config.chainIterations ?? true;\n }\n\n /**\n * Gets the current iteration count.\n */\n public get currentIteration(): number {\n return this._currentIteration;\n }\n\n // ========================================================================\n // Execution\n // ========================================================================\n\n /**\n * Execute the while loop.\n */\n /**\n * Builds a condition function from the serialized condition fields in config.\n */\n private buildConditionFromConfig(): WhileConditionFn<Output> | undefined {\n const { conditionOperator, conditionField, conditionValue } = this.config;\n\n if (!conditionOperator) {\n return undefined;\n }\n\n return (output: Output) => {\n const fieldValue = conditionField\n ? getNestedValue(output as Record<string, unknown>, conditionField)\n : output;\n return evaluateCondition(fieldValue, conditionOperator as any, conditionValue ?? \"\");\n };\n }\n\n /**\n * Analyzes the iterationInputConfig from whileConfig to decompose\n * array inputs into per-iteration scalar values.\n *\n * Returns null if no iterationInputConfig is present (normal while behavior).\n */\n private analyzeArrayInputs(input: Input): {\n arrayPorts: string[];\n scalarPorts: string[];\n iteratedValues: Record<string, unknown[]>;\n iterationCount: number;\n } | null {\n if (!this.config.iterationInputConfig) {\n return null;\n }\n\n const inputData = input as Record<string, unknown>;\n const config = this.config.iterationInputConfig!;\n\n const arrayPorts: string[] = [];\n const scalarPorts: string[] = [];\n const iteratedValues: Record<string, unknown[]> = {};\n const arrayLengths: number[] = [];\n\n for (const [key, propConfig] of Object.entries(config)) {\n const value = inputData[key];\n\n if (propConfig.mode === \"array\") {\n if (!Array.isArray(value)) {\n // Skip non-array values for array-mode ports\n scalarPorts.push(key);\n continue;\n }\n iteratedValues[key] = value;\n arrayPorts.push(key);\n arrayLengths.push(value.length);\n } else {\n scalarPorts.push(key);\n }\n }\n\n // Also include any input keys not in the config as scalars\n for (const key of Object.keys(inputData)) {\n if (!config[key] && !key.startsWith(\"_iteration\")) {\n scalarPorts.push(key);\n }\n }\n\n if (arrayPorts.length === 0) {\n return null;\n }\n\n // All array ports must have the same length (zip semantics)\n const uniqueLengths = new Set(arrayLengths);\n if (uniqueLengths.size > 1) {\n const lengthInfo = arrayPorts\n .map((port, index) => `${port}=${arrayLengths[index]}`)\n .join(\", \");\n throw new TaskConfigurationError(\n `${this.type}: All iterated array inputs must have the same length. ` +\n `Found different lengths: ${lengthInfo}`\n );\n }\n\n return {\n arrayPorts,\n scalarPorts,\n iteratedValues,\n iterationCount: arrayLengths[0] ?? 0,\n };\n }\n\n /**\n * Builds per-iteration input by picking the i-th element from each array port\n * and passing scalar ports through unchanged.\n */\n private buildIterationInput(\n input: Input,\n analysis: {\n arrayPorts: string[];\n scalarPorts: string[];\n iteratedValues: Record<string, unknown[]>;\n },\n index: number\n ): Input {\n const inputData = input as Record<string, unknown>;\n const iterInput: Record<string, unknown> = {};\n\n for (const key of analysis.arrayPorts) {\n iterInput[key] = analysis.iteratedValues[key][index];\n }\n\n for (const key of analysis.scalarPorts) {\n if (key in inputData) {\n iterInput[key] = inputData[key];\n }\n }\n\n return iterInput as Input;\n }\n\n public async execute(input: Input, context: IExecuteContext): Promise<Output | undefined> {\n if (!this.hasChildren()) {\n throw new TaskConfigurationError(`${this.type}: No subgraph set for while loop`);\n }\n\n // Use provided condition or auto-build from serialized whileConfig\n const condition = this.condition ?? this.buildConditionFromConfig();\n\n if (!condition) {\n throw new TaskConfigurationError(`${this.type}: No condition function provided`);\n }\n\n // Check for array decomposition via iterationInputConfig\n const arrayAnalysis = this.analyzeArrayInputs(input);\n\n this._currentIteration = 0;\n let currentInput: Input = { ...input };\n let currentOutput: Output = {} as Output;\n\n // Determine effective max iterations (respect array length if decomposing)\n const effectiveMax = arrayAnalysis\n ? Math.min(this.maxIterations, arrayAnalysis.iterationCount)\n : this.maxIterations;\n\n // Execute iterations until condition returns false or max iterations reached\n while (this._currentIteration < effectiveMax) {\n if (context.signal?.aborted) {\n break;\n }\n\n // Build the input for this iteration\n let iterationInput: Input;\n if (arrayAnalysis) {\n // Decompose array inputs into per-iteration scalars\n iterationInput = {\n ...this.buildIterationInput(currentInput, arrayAnalysis, this._currentIteration),\n _iterationIndex: this._currentIteration,\n } as Input;\n } else {\n iterationInput = {\n ...currentInput,\n _iterationIndex: this._currentIteration,\n } as Input;\n }\n\n // Run the subgraph (it resets itself on each run)\n const results = await this.subGraph.run<Output>(iterationInput, {\n parentSignal: context.signal,\n });\n\n // Merge results\n currentOutput = this.subGraph.mergeExecuteOutputsToRunOutput(\n results,\n this.compoundMerge\n ) as Output;\n\n // Check condition\n if (!condition(currentOutput, this._currentIteration)) {\n break;\n }\n\n // Chain output to input for next iteration if enabled\n if (this.chainIterations) {\n currentInput = { ...currentInput, ...currentOutput } as Input;\n }\n\n this._currentIteration++;\n\n // Update progress\n const progress = Math.min((this._currentIteration / effectiveMax) * 100, 99);\n await context.updateProgress(progress, `Iteration ${this._currentIteration}`);\n }\n\n return currentOutput;\n }\n\n /**\n * Streaming execution for WhileTask: runs all iterations except the last\n * normally (materializing), then streams the final iteration's events.\n * This provides streaming output for the final result while still\n * supporting iteration chaining.\n */\n async *executeStream(input: Input, context: IExecuteContext): AsyncIterable<StreamEvent<Output>> {\n if (!this.hasChildren()) {\n throw new TaskConfigurationError(`${this.type}: No subgraph set for while loop`);\n }\n\n const condition = this.condition ?? this.buildConditionFromConfig();\n if (!condition) {\n throw new TaskConfigurationError(`${this.type}: No condition function provided`);\n }\n\n const arrayAnalysis = this.analyzeArrayInputs(input);\n this._currentIteration = 0;\n let currentInput: Input = { ...input };\n let currentOutput: Output = {} as Output;\n\n const effectiveMax = arrayAnalysis\n ? Math.min(this.maxIterations, arrayAnalysis.iterationCount)\n : this.maxIterations;\n\n while (this._currentIteration < effectiveMax) {\n if (context.signal?.aborted) break;\n\n let iterationInput: Input;\n if (arrayAnalysis) {\n iterationInput = {\n ...this.buildIterationInput(currentInput, arrayAnalysis, this._currentIteration),\n _iterationIndex: this._currentIteration,\n } as Input;\n } else {\n iterationInput = {\n ...currentInput,\n _iterationIndex: this._currentIteration,\n } as Input;\n }\n\n // Check if the NEXT iteration would be the potential last: we always\n // run non-streaming first, then decide after the condition check.\n const results = await this.subGraph.run<Output>(iterationInput, {\n parentSignal: context.signal,\n });\n\n currentOutput = this.subGraph.mergeExecuteOutputsToRunOutput(\n results,\n this.compoundMerge\n ) as Output;\n\n if (!condition(currentOutput, this._currentIteration)) {\n // This was the final iteration -- but we already ran it non-streaming.\n // Emit the finish event with the collected output.\n break;\n }\n\n if (this.chainIterations) {\n currentInput = { ...currentInput, ...currentOutput } as Input;\n }\n\n this._currentIteration++;\n\n const progress = Math.min((this._currentIteration / effectiveMax) * 100, 99);\n await context.updateProgress(progress, `Iteration ${this._currentIteration}`);\n }\n\n yield { type: \"finish\", data: currentOutput } as StreamFinish<Output>;\n }\n\n // ========================================================================\n // Schema Methods\n // ========================================================================\n\n /**\n * Instance method to get the iteration context schema.\n * Can be overridden by subclasses to customize iteration context.\n */\n public getIterationContextSchema(): DataPortSchema {\n return (this.constructor as typeof WhileTask).getIterationContextSchema();\n }\n\n /**\n * When chainIterations is true, the output schema from the previous\n * iteration becomes part of the input schema for the next iteration.\n * These chained properties should be marked with \"x-ui-iteration\": true.\n *\n * @returns Schema with chained output properties marked for iteration, or undefined if not chaining\n */\n public getChainedOutputSchema(): DataPortSchema | undefined {\n if (!this.chainIterations) return undefined;\n\n const outputSchema = this.outputSchema();\n if (typeof outputSchema === \"boolean\") return undefined;\n\n // Clone and mark all properties with x-ui-iteration\n const properties: Record<string, DataPortSchema> = {};\n if (outputSchema.properties && typeof outputSchema.properties === \"object\") {\n for (const [key, schema] of Object.entries(outputSchema.properties)) {\n // Skip the _iterations meta field\n if (key === \"_iterations\") continue;\n if (typeof schema === \"object\" && schema !== null) {\n properties[key] = { ...schema, \"x-ui-iteration\": true } as DataPortSchema;\n }\n }\n }\n\n if (Object.keys(properties).length === 0) return undefined;\n\n return { type: \"object\", properties } as DataPortSchema;\n }\n\n /**\n * Instance input schema override.\n * When iterationInputConfig is present, wraps array-mode ports in array schemas\n * so that the dataflow compatibility check accepts array values.\n */\n public override inputSchema(): DataPortSchema {\n if (!this.hasChildren()) {\n return (this.constructor as typeof WhileTask).inputSchema();\n }\n\n // Get the base schema from the subgraph (GraphAsTask behavior)\n const baseSchema = super.inputSchema();\n if (typeof baseSchema === \"boolean\") return baseSchema;\n\n if (!this.config.iterationInputConfig) {\n return baseSchema;\n }\n\n // Wrap array-mode ports in anyOf (scalar | array) schemas.\n // Using anyOf instead of plain type:\"array\" to avoid addInput's array-merge behavior\n // which would prepend an undefined element when runInputData starts empty.\n const properties = { ...(baseSchema.properties || {}) } as Record<string, DataPortSchema>;\n for (const [key, propConfig] of Object.entries(this.config.iterationInputConfig)) {\n if (propConfig.mode === \"array\" && properties[key]) {\n const scalarSchema = properties[key] as DataPortSchema;\n properties[key] = {\n anyOf: [scalarSchema, { type: \"array\", items: scalarSchema }],\n } as unknown as DataPortSchema;\n }\n }\n\n return {\n ...baseSchema,\n properties,\n } as DataPortSchema;\n }\n\n /**\n * Static input schema for WhileTask.\n */\n public static inputSchema(): DataPortSchema {\n return {\n type: \"object\",\n properties: {},\n additionalProperties: true,\n } as const satisfies DataPortSchema;\n }\n\n /**\n * Static output schema for WhileTask.\n */\n public static outputSchema(): DataPortSchema {\n return {\n type: \"object\",\n properties: {\n _iterations: {\n type: \"number\",\n title: \"Iterations\",\n description: \"Number of iterations executed\",\n },\n },\n additionalProperties: true,\n } as const satisfies DataPortSchema;\n }\n\n /**\n * Instance output schema - returns final iteration output schema.\n */\n public override outputSchema(): DataPortSchema {\n if (!this.hasChildren()) {\n return (this.constructor as typeof WhileTask).outputSchema();\n }\n\n // Get ending nodes from subgraph\n const tasks = this.subGraph.getTasks();\n const endingNodes = tasks.filter(\n (task) => this.subGraph.getTargetDataflows(task.config.id).length === 0\n );\n\n if (endingNodes.length === 0) {\n return (this.constructor as typeof WhileTask).outputSchema();\n }\n\n const properties: Record<string, unknown> = {\n _iterations: {\n type: \"number\",\n title: \"Iterations\",\n description: \"Number of iterations executed\",\n },\n };\n\n // Merge output schemas from ending nodes\n for (const task of endingNodes) {\n const taskOutputSchema = task.outputSchema();\n if (typeof taskOutputSchema === \"boolean\") continue;\n\n const taskProperties = taskOutputSchema.properties || {};\n for (const [key, schema] of Object.entries(taskProperties)) {\n if (!properties[key]) {\n properties[key] = schema;\n }\n }\n }\n\n return {\n type: \"object\",\n properties,\n additionalProperties: false,\n } as DataPortSchema;\n }\n}\n\n// ============================================================================\n// Workflow Prototype Extensions\n// ============================================================================\n\ndeclare module \"../task-graph/Workflow\" {\n interface Workflow {\n /**\n * Starts a while loop that continues until a condition is false.\n * Use .endWhile() to close the loop and return to the parent workflow.\n *\n * @param config - Configuration for the while loop (must include condition)\n * @returns A Workflow in loop builder mode for defining the loop body\n *\n * @example\n * ```typescript\n * workflow\n * .while({\n * condition: (output, iteration) => output.quality < 0.9,\n * maxIterations: 10\n * })\n * .refineResult()\n * .endWhile()\n * ```\n */\n while: CreateLoopWorkflow<TaskInput, TaskOutput, WhileTaskConfig<any>>;\n\n /**\n * Ends the while loop and returns to the parent workflow.\n * Only callable on workflows in loop builder mode.\n *\n * @returns The parent workflow\n */\n endWhile(): Workflow;\n }\n}\n\nWorkflow.prototype.while = CreateLoopWorkflow(WhileTask);\n\nWorkflow.prototype.endWhile = CreateEndLoopWorkflow(\"endWhile\");\n",
27
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n *\n * Shared iteration schema helpers used by IteratorTask/WhileTask and the builder.\n * Re-exports context schemas and adds pure schema functions that operate on DataPortSchema.\n */\n\nimport type { DataPortSchema, PropertySchema } from \"@workglow/util\";\n\nimport {\n createArraySchema,\n createFlexibleSchema,\n extractBaseSchema,\n ITERATOR_CONTEXT_SCHEMA,\n type ExecutionMode,\n type IterationInputMode,\n type IterationPropertyConfig,\n} from \"./IteratorTask\";\nimport { WHILE_CONTEXT_SCHEMA } from \"./WhileTask\";\n\nexport {\n createArraySchema,\n createFlexibleSchema,\n extractBaseSchema,\n ITERATOR_CONTEXT_SCHEMA,\n WHILE_CONTEXT_SCHEMA,\n type ExecutionMode,\n type IterationInputMode,\n type IterationPropertyConfig,\n};\n\n/** Config for buildIterationInputSchema: mode and optional baseSchema (defaults to extracted from inner). */\nexport type IterationInputConfig = Record<\n string,\n { mode: IterationInputMode; baseSchema?: DataPortSchema }\n>;\n\n/**\n * Determines if a schema is a flexible type (T | T[]).\n */\nexport function isFlexibleSchema(schema: DataPortSchema): boolean {\n if (typeof schema === \"boolean\") return false;\n\n const variants =\n (schema as Record<string, unknown>).oneOf ?? (schema as Record<string, unknown>).anyOf;\n const arr = Array.isArray(variants) ? (variants as DataPortSchema[]) : undefined;\n if (!arr || arr.length !== 2) return false;\n\n let hasScalar = false;\n let hasArray = false;\n\n for (const variant of arr) {\n if (typeof variant !== \"object\") continue;\n const v = variant as Record<string, unknown>;\n if (v.type === \"array\" || \"items\" in v) {\n hasArray = true;\n } else {\n hasScalar = true;\n }\n }\n\n return hasScalar && hasArray;\n}\n\n/**\n * Determines if a schema is strictly an array type.\n */\nexport function isStrictArraySchema(schema: DataPortSchema): boolean {\n if (typeof schema === \"boolean\") return false;\n const s = schema as Record<string, unknown>;\n return s.type === \"array\" && !isFlexibleSchema(schema);\n}\n\n/**\n * Gets the input mode for a schema property.\n */\nexport function getInputModeFromSchema(schema: DataPortSchema): IterationInputMode {\n if (isFlexibleSchema(schema)) return \"flexible\";\n if (isStrictArraySchema(schema)) return \"array\";\n return \"scalar\";\n}\n\n/**\n * Get the appropriate iteration context schema for a given task type.\n */\nexport function getIterationContextSchemaForType(taskType: string): DataPortSchema | undefined {\n if (taskType === \"MapTask\" || taskType === \"ReduceTask\") {\n return ITERATOR_CONTEXT_SCHEMA;\n }\n if (taskType === \"WhileTask\") {\n return WHILE_CONTEXT_SCHEMA;\n }\n return undefined;\n}\n\n/**\n * Merge iteration context schema into an existing InputNode schema.\n */\nexport function addIterationContextToSchema(\n existingSchema: DataPortSchema | undefined,\n parentTaskType: string\n): DataPortSchema {\n const contextSchema = getIterationContextSchemaForType(parentTaskType);\n if (!contextSchema) {\n return existingSchema ?? { type: \"object\", properties: {} };\n }\n\n const baseProperties =\n existingSchema &&\n typeof existingSchema !== \"boolean\" &&\n (existingSchema as Record<string, unknown>).properties &&\n typeof (existingSchema as Record<string, unknown>).properties !== \"boolean\"\n ? ((existingSchema as Record<string, unknown>).properties as Record<string, DataPortSchema>)\n : {};\n\n const contextProperties =\n typeof contextSchema !== \"boolean\" &&\n (contextSchema as Record<string, unknown>).properties &&\n typeof (contextSchema as Record<string, unknown>).properties !== \"boolean\"\n ? ((contextSchema as Record<string, unknown>).properties as Record<string, DataPortSchema>)\n : {};\n\n return {\n type: \"object\",\n properties: {\n ...baseProperties,\n ...contextProperties,\n },\n };\n}\n\n/**\n * Check if a schema property is an iteration-injected input.\n */\nexport function isIterationProperty(schema: PropertySchema): boolean {\n if (!schema || typeof schema === \"boolean\") return false;\n return (schema as Record<string, unknown>)[\"x-ui-iteration\"] === true;\n}\n\n/**\n * Filter out iteration properties from a schema (for parent display).\n */\nexport function filterIterationProperties(schema?: DataPortSchema): DataPortSchema | undefined {\n if (!schema || typeof schema === \"boolean\") return schema;\n const props = (schema as Record<string, unknown>).properties;\n if (!props || typeof props === \"boolean\") return schema;\n\n const filteredProps: Record<string, DataPortSchema> = {};\n for (const [key, propSchema] of Object.entries(props as Record<string, DataPortSchema>)) {\n if (!isIterationProperty(propSchema)) {\n filteredProps[key] = propSchema;\n }\n }\n\n if (Object.keys(filteredProps).length === 0) {\n return { type: \"object\", properties: {} };\n }\n\n return { ...schema, properties: filteredProps } as DataPortSchema;\n}\n\n/**\n * Extract only iteration properties from a schema.\n */\nexport function extractIterationProperties(schema?: DataPortSchema): DataPortSchema | undefined {\n if (!schema || typeof schema === \"boolean\") return undefined;\n const props = (schema as Record<string, unknown>).properties;\n if (!props || typeof props === \"boolean\") return undefined;\n\n const iterProps: Record<string, DataPortSchema> = {};\n for (const [key, propSchema] of Object.entries(props as Record<string, DataPortSchema>)) {\n if (isIterationProperty(propSchema)) {\n iterProps[key] = propSchema;\n }\n }\n\n if (Object.keys(iterProps).length === 0) return undefined;\n\n return { type: \"object\", properties: iterProps };\n}\n\n/**\n * Remove iteration properties from a schema (alias for filterIterationProperties).\n */\nexport function removeIterationProperties(schema?: DataPortSchema): DataPortSchema | undefined {\n return filterIterationProperties(schema);\n}\n\n/**\n * Merge chained output properties into input schema; marks output properties with \"x-ui-iteration\": true.\n */\nexport function mergeChainedOutputToInput(\n inputSchema: DataPortSchema | undefined,\n outputSchema: DataPortSchema | undefined\n): DataPortSchema {\n const baseSchema = filterIterationProperties(inputSchema) ?? {\n type: \"object\" as const,\n properties: {},\n };\n\n if (!outputSchema || typeof outputSchema === \"boolean\") {\n return baseSchema;\n }\n const outProps = (outputSchema as Record<string, unknown>).properties;\n if (!outProps || typeof outProps === \"boolean\") {\n return baseSchema;\n }\n\n const baseProps =\n typeof baseSchema !== \"boolean\" &&\n (baseSchema as Record<string, unknown>).properties &&\n typeof (baseSchema as Record<string, unknown>).properties !== \"boolean\"\n ? ((baseSchema as Record<string, unknown>).properties as Record<string, DataPortSchema>)\n : {};\n\n const mergedProperties: Record<string, DataPortSchema> = { ...baseProps };\n\n for (const [key, propSchema] of Object.entries(outProps as Record<string, DataPortSchema>)) {\n if (typeof propSchema === \"object\" && propSchema !== null) {\n mergedProperties[key] = { ...propSchema, \"x-ui-iteration\": true } as DataPortSchema;\n }\n }\n\n return {\n type: \"object\",\n properties: mergedProperties,\n };\n}\n\n/**\n * Builds the iteration input schema from the inner schema and optional iteration input configuration.\n */\nexport function buildIterationInputSchema(\n innerSchema: DataPortSchema | undefined,\n config?: IterationInputConfig\n): DataPortSchema {\n if (!innerSchema || typeof innerSchema === \"boolean\") {\n return { type: \"object\", properties: {} };\n }\n\n const innerProps = (innerSchema as Record<string, unknown>).properties;\n if (!innerProps || typeof innerProps === \"boolean\") {\n return { type: \"object\", properties: {} };\n }\n\n const properties: Record<string, DataPortSchema> = {};\n const propsRecord = innerProps as Record<string, DataPortSchema>;\n\n for (const [key, propSchema] of Object.entries(propsRecord)) {\n if (typeof propSchema === \"boolean\") continue;\n\n if ((propSchema as Record<string, unknown>)[\"x-ui-iteration\"]) {\n continue;\n }\n\n const originalProps = propSchema as Record<string, unknown>;\n const metadata: Record<string, unknown> = {};\n for (const metaKey of Object.keys(originalProps)) {\n if (metaKey === \"title\" || metaKey === \"description\" || metaKey.startsWith(\"x-\")) {\n metadata[metaKey] = originalProps[metaKey];\n }\n }\n\n const baseSchema = extractBaseSchema(propSchema);\n const propConfig = config?.[key];\n const mode = propConfig?.mode ?? \"flexible\";\n const base = propConfig?.baseSchema ?? baseSchema;\n\n let wrappedSchema: DataPortSchema;\n switch (mode) {\n case \"array\":\n wrappedSchema = createArraySchema(base);\n break;\n case \"scalar\":\n wrappedSchema = base;\n break;\n case \"flexible\":\n default:\n wrappedSchema = createFlexibleSchema(base);\n break;\n }\n\n // Apply preserved metadata onto the wrapped schema\n if (Object.keys(metadata).length > 0 && typeof wrappedSchema === \"object\") {\n properties[key] = { ...metadata, ...wrappedSchema } as DataPortSchema;\n } else {\n properties[key] = wrappedSchema;\n }\n }\n\n return {\n type: \"object\",\n properties,\n };\n}\n\n/**\n * Find array-typed ports from an input schema.\n */\nexport function findArrayPorts(schema: DataPortSchema | undefined): string[] {\n if (!schema || typeof schema === \"boolean\") return [];\n const props = (schema as Record<string, unknown>).properties;\n if (!props || typeof props === \"boolean\") return [];\n\n const arrayPorts: string[] = [];\n const propsRecord = props as Record<string, DataPortSchema>;\n\n for (const [key, propSchema] of Object.entries(propsRecord)) {\n if (typeof propSchema === \"boolean\") continue;\n if ((propSchema as Record<string, unknown>).type === \"array\") {\n arrayPorts.push(key);\n }\n }\n\n return arrayPorts;\n}\n\n/**\n * Wrap a schema's properties in arrays for iteration output.\n */\nexport function wrapSchemaInArray(schema: DataPortSchema | undefined): DataPortSchema | undefined {\n if (!schema || typeof schema === \"boolean\") return schema;\n const props = (schema as Record<string, unknown>).properties;\n if (!props || typeof props === \"boolean\") return schema;\n\n const propsRecord = props as Record<string, DataPortSchema>;\n const wrappedProperties: Record<string, DataPortSchema> = {};\n\n for (const [key, propSchema] of Object.entries(propsRecord)) {\n wrappedProperties[key] = {\n type: \"array\",\n items: propSchema,\n } as DataPortSchema;\n }\n\n return {\n type: \"object\",\n properties: wrappedProperties,\n };\n}\n",
27
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n *\n * Shared iteration schema helpers used by IteratorTask/WhileTask and the builder.\n * Re-exports context schemas and adds pure schema functions that operate on DataPortSchema.\n */\n\nimport type { DataPortSchema, PropertySchema } from \"@workglow/util\";\n\nimport {\n createArraySchema,\n createFlexibleSchema,\n extractBaseSchema,\n ITERATOR_CONTEXT_SCHEMA,\n type ExecutionMode,\n type IterationInputMode,\n type IterationPropertyConfig,\n} from \"./IteratorTask\";\nimport { WHILE_CONTEXT_SCHEMA } from \"./WhileTask\";\n\nexport {\n createArraySchema,\n createFlexibleSchema,\n extractBaseSchema,\n ITERATOR_CONTEXT_SCHEMA,\n WHILE_CONTEXT_SCHEMA,\n type ExecutionMode,\n type IterationInputMode,\n type IterationPropertyConfig,\n};\n\n/** Config for buildIterationInputSchema: mode and optional baseSchema (defaults to extracted from inner). */\nexport type IterationInputConfig = Record<\n string,\n { mode: IterationInputMode; baseSchema?: PropertySchema }\n>;\n\n/**\n * Determines if a schema is a flexible type (T | T[]).\n */\nexport function isFlexibleSchema(schema: DataPortSchema): boolean {\n if (typeof schema === \"boolean\") return false;\n\n const variants =\n (schema as Record<string, unknown>).oneOf ?? (schema as Record<string, unknown>).anyOf;\n const arr = Array.isArray(variants) ? (variants as DataPortSchema[]) : undefined;\n if (!arr || arr.length !== 2) return false;\n\n let hasScalar = false;\n let hasArray = false;\n\n for (const variant of arr) {\n if (typeof variant !== \"object\") continue;\n const v = variant as Record<string, unknown>;\n if (v.type === \"array\" || \"items\" in v) {\n hasArray = true;\n } else {\n hasScalar = true;\n }\n }\n\n return hasScalar && hasArray;\n}\n\n/**\n * Determines if a schema is strictly an array type.\n */\nexport function isStrictArraySchema(schema: DataPortSchema): boolean {\n if (typeof schema === \"boolean\") return false;\n const s = schema as Record<string, unknown>;\n return s.type === \"array\" && !isFlexibleSchema(schema);\n}\n\n/**\n * Gets the input mode for a schema property.\n */\nexport function getInputModeFromSchema(schema: DataPortSchema): IterationInputMode {\n if (isFlexibleSchema(schema)) return \"flexible\";\n if (isStrictArraySchema(schema)) return \"array\";\n return \"scalar\";\n}\n\n/**\n * Get the appropriate iteration context schema for a given task type.\n */\nexport function getIterationContextSchemaForType(taskType: string): DataPortSchema | undefined {\n if (taskType === \"MapTask\" || taskType === \"ReduceTask\") {\n return ITERATOR_CONTEXT_SCHEMA;\n }\n if (taskType === \"WhileTask\") {\n return WHILE_CONTEXT_SCHEMA;\n }\n return undefined;\n}\n\n/**\n * Merge iteration context schema into an existing InputNode schema.\n */\nexport function addIterationContextToSchema(\n existingSchema: DataPortSchema | undefined,\n parentTaskType: string\n): DataPortSchema {\n const contextSchema = getIterationContextSchemaForType(parentTaskType);\n if (!contextSchema) {\n return existingSchema ?? { type: \"object\", properties: {} };\n }\n\n const baseProperties =\n existingSchema &&\n typeof existingSchema !== \"boolean\" &&\n (existingSchema as Record<string, unknown>).properties &&\n typeof (existingSchema as Record<string, unknown>).properties !== \"boolean\"\n ? ((existingSchema as Record<string, unknown>).properties as Record<string, DataPortSchema>)\n : {};\n\n const contextProperties =\n typeof contextSchema !== \"boolean\" &&\n (contextSchema as Record<string, unknown>).properties &&\n typeof (contextSchema as Record<string, unknown>).properties !== \"boolean\"\n ? ((contextSchema as Record<string, unknown>).properties as Record<string, DataPortSchema>)\n : {};\n\n return {\n type: \"object\",\n properties: {\n ...baseProperties,\n ...contextProperties,\n },\n };\n}\n\n/**\n * Check if a schema property is an iteration-injected input.\n */\nexport function isIterationProperty(schema: PropertySchema): boolean {\n if (!schema || typeof schema === \"boolean\") return false;\n return (schema as Record<string, unknown>)[\"x-ui-iteration\"] === true;\n}\n\n/**\n * Filter out iteration properties from a schema (for parent display).\n */\nexport function filterIterationProperties(schema?: DataPortSchema): DataPortSchema | undefined {\n if (!schema || typeof schema === \"boolean\") return schema;\n const props = (schema as Record<string, unknown>).properties;\n if (!props || typeof props === \"boolean\") return schema;\n\n const filteredProps: Record<string, DataPortSchema> = {};\n for (const [key, propSchema] of Object.entries(props as Record<string, DataPortSchema>)) {\n if (!isIterationProperty(propSchema)) {\n filteredProps[key] = propSchema;\n }\n }\n\n if (Object.keys(filteredProps).length === 0) {\n return { type: \"object\", properties: {} };\n }\n\n return { ...schema, properties: filteredProps } as DataPortSchema;\n}\n\n/**\n * Extract only iteration properties from a schema.\n */\nexport function extractIterationProperties(schema?: DataPortSchema): DataPortSchema | undefined {\n if (!schema || typeof schema === \"boolean\") return undefined;\n const props = (schema as Record<string, unknown>).properties;\n if (!props || typeof props === \"boolean\") return undefined;\n\n const iterProps: Record<string, DataPortSchema> = {};\n for (const [key, propSchema] of Object.entries(props as Record<string, DataPortSchema>)) {\n if (isIterationProperty(propSchema)) {\n iterProps[key] = propSchema;\n }\n }\n\n if (Object.keys(iterProps).length === 0) return undefined;\n\n return { type: \"object\", properties: iterProps };\n}\n\n/**\n * Remove iteration properties from a schema (alias for filterIterationProperties).\n */\nexport function removeIterationProperties(schema?: DataPortSchema): DataPortSchema | undefined {\n return filterIterationProperties(schema);\n}\n\n/**\n * Merge chained output properties into input schema; marks output properties with \"x-ui-iteration\": true.\n */\nexport function mergeChainedOutputToInput(\n inputSchema: DataPortSchema | undefined,\n outputSchema: DataPortSchema | undefined\n): DataPortSchema {\n const baseSchema = filterIterationProperties(inputSchema) ?? {\n type: \"object\" as const,\n properties: {},\n };\n\n if (!outputSchema || typeof outputSchema === \"boolean\") {\n return baseSchema;\n }\n const outProps = (outputSchema as Record<string, unknown>).properties;\n if (!outProps || typeof outProps === \"boolean\") {\n return baseSchema;\n }\n\n const baseProps =\n typeof baseSchema !== \"boolean\" &&\n (baseSchema as Record<string, unknown>).properties &&\n typeof (baseSchema as Record<string, unknown>).properties !== \"boolean\"\n ? ((baseSchema as Record<string, unknown>).properties as Record<string, DataPortSchema>)\n : {};\n\n const mergedProperties: Record<string, DataPortSchema> = { ...baseProps };\n\n for (const [key, propSchema] of Object.entries(outProps as Record<string, DataPortSchema>)) {\n if (typeof propSchema === \"object\" && propSchema !== null) {\n mergedProperties[key] = { ...propSchema, \"x-ui-iteration\": true } as DataPortSchema;\n }\n }\n\n return {\n type: \"object\",\n properties: mergedProperties,\n };\n}\n\n/**\n * Builds the iteration input schema from the inner schema and optional iteration input configuration.\n */\nexport function buildIterationInputSchema(\n innerSchema: DataPortSchema | undefined,\n config?: IterationInputConfig\n): DataPortSchema {\n if (!innerSchema || typeof innerSchema === \"boolean\") {\n return { type: \"object\", properties: {} };\n }\n\n const innerProps = (innerSchema as Record<string, unknown>).properties;\n if (!innerProps || typeof innerProps === \"boolean\") {\n return { type: \"object\", properties: {} };\n }\n\n const properties: Record<string, PropertySchema> = {};\n const propsRecord = innerProps as Record<string, PropertySchema>;\n\n for (const [key, propSchema] of Object.entries(propsRecord)) {\n if (typeof propSchema === \"boolean\") continue;\n\n if ((propSchema as Record<string, unknown>)[\"x-ui-iteration\"]) {\n continue;\n }\n\n const originalProps = propSchema as Record<string, unknown>;\n const metadata: Record<string, unknown> = {};\n for (const metaKey of Object.keys(originalProps)) {\n if (metaKey === \"title\" || metaKey === \"description\" || metaKey.startsWith(\"x-\")) {\n metadata[metaKey] = originalProps[metaKey];\n }\n }\n\n const baseSchema = extractBaseSchema(propSchema);\n const propConfig = config?.[key];\n const mode = propConfig?.mode ?? \"flexible\";\n const base = propConfig?.baseSchema ?? baseSchema;\n\n let wrappedSchema: PropertySchema;\n switch (mode) {\n case \"array\":\n wrappedSchema = createArraySchema(base);\n break;\n case \"scalar\":\n wrappedSchema = base;\n break;\n case \"flexible\":\n default:\n wrappedSchema = createFlexibleSchema(base);\n break;\n }\n\n // Apply preserved metadata onto the wrapped schema\n if (Object.keys(metadata).length > 0 && typeof wrappedSchema === \"object\") {\n properties[key] = { ...metadata, ...wrappedSchema } as PropertySchema;\n } else {\n properties[key] = wrappedSchema;\n }\n }\n\n return {\n type: \"object\",\n properties,\n };\n}\n\n/**\n * Find array-typed ports from an input schema.\n */\nexport function findArrayPorts(schema: DataPortSchema | undefined): string[] {\n if (!schema || typeof schema === \"boolean\") return [];\n const props = (schema as Record<string, unknown>).properties;\n if (!props || typeof props === \"boolean\") return [];\n\n const arrayPorts: string[] = [];\n const propsRecord = props as Record<string, DataPortSchema>;\n\n for (const [key, propSchema] of Object.entries(propsRecord)) {\n if (typeof propSchema === \"boolean\") continue;\n if ((propSchema as Record<string, unknown>).type === \"array\") {\n arrayPorts.push(key);\n }\n }\n\n return arrayPorts;\n}\n\n/**\n * Wrap a schema's properties in arrays for iteration output.\n */\nexport function wrapSchemaInArray(schema: DataPortSchema | undefined): DataPortSchema | undefined {\n if (!schema || typeof schema === \"boolean\") return schema;\n const props = (schema as Record<string, unknown>).properties;\n if (!props || typeof props === \"boolean\") return schema;\n\n const propsRecord = props as Record<string, DataPortSchema>;\n const wrappedProperties: Record<string, DataPortSchema> = {};\n\n for (const [key, propSchema] of Object.entries(propsRecord)) {\n wrappedProperties[key] = {\n type: \"array\",\n items: propSchema,\n } as DataPortSchema;\n }\n\n return {\n type: \"object\",\n properties: wrappedProperties,\n };\n}\n",
28
28
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {\n Job,\n JobConstructorParam,\n JobQueueClient,\n JobQueueServer,\n JobQueueServerOptions,\n} from \"@workglow/job-queue\";\nimport { InMemoryQueueStorage, IQueueStorage } from \"@workglow/storage\";\nimport { createServiceToken, globalServiceRegistry } from \"@workglow/util\";\nimport type { JobQueueTask, JobQueueTaskConfig } from \"./JobQueueTask\";\nimport type { RegisteredQueue } from \"./TaskQueueRegistry\";\nimport type { TaskInput, TaskOutput } from \"./TaskTypes\";\n\nexport type JobClassConstructor<Input extends TaskInput, Output extends TaskOutput> = new (\n params: JobConstructorParam<Input, Output>\n) => Job<Input, Output>;\n\n/**\n * Options for creating a job queue via the factory\n */\nexport interface JobQueueFactoryOptions<Input, Output> {\n readonly storage?: IQueueStorage<Input, Output>;\n readonly limiter?: JobQueueServerOptions<Input, Output>[\"limiter\"];\n readonly workerCount?: number;\n readonly pollIntervalMs?: number;\n readonly deleteAfterCompletionMs?: number;\n readonly deleteAfterFailureMs?: number;\n readonly deleteAfterDisabledMs?: number;\n readonly cleanupIntervalMs?: number;\n}\n\nexport interface JobQueueFactoryParams<Input extends TaskInput, Output extends TaskOutput> {\n readonly queueName: string;\n readonly jobClass: JobClassConstructor<Input, Output>;\n readonly input?: Input;\n readonly config?: JobQueueTaskConfig;\n readonly task?: JobQueueTask<Input, Output>;\n readonly options?: JobQueueFactoryOptions<Input, Output>;\n}\n\nexport type JobQueueFactory = <Input extends TaskInput, Output extends TaskOutput>(\n params: JobQueueFactoryParams<Input, Output>\n) => Promise<RegisteredQueue<Input, Output>> | RegisteredQueue<Input, Output>;\n\nexport const JOB_QUEUE_FACTORY = createServiceToken<JobQueueFactory>(\"taskgraph.jobQueueFactory\");\n\nconst defaultJobQueueFactory: JobQueueFactory = async <\n Input extends TaskInput,\n Output extends TaskOutput,\n>({\n queueName,\n jobClass,\n options,\n}: JobQueueFactoryParams<Input, Output>): Promise<RegisteredQueue<Input, Output>> => {\n const storage =\n (options?.storage as IQueueStorage<Input, Output>) ??\n new InMemoryQueueStorage<Input, Output>(queueName);\n await storage.setupDatabase();\n\n const server = new JobQueueServer<Input, Output>(jobClass as JobClassConstructor<any, any>, {\n storage,\n queueName,\n limiter: options?.limiter,\n workerCount: options?.workerCount,\n pollIntervalMs: options?.pollIntervalMs,\n deleteAfterCompletionMs: options?.deleteAfterCompletionMs,\n deleteAfterFailureMs: options?.deleteAfterFailureMs,\n deleteAfterDisabledMs: options?.deleteAfterDisabledMs,\n cleanupIntervalMs: options?.cleanupIntervalMs,\n });\n\n const client = new JobQueueClient<Input, Output>({\n storage,\n queueName,\n });\n\n // Attach client to server for same-process optimization\n client.attach(server);\n\n return { server, client, storage };\n};\n\nexport function registerJobQueueFactory(factory: JobQueueFactory): void {\n globalServiceRegistry.registerInstance(JOB_QUEUE_FACTORY, factory);\n}\n\n/**\n * Creates a job queue factory from server options\n */\nexport function createJobQueueFactoryWithOptions(\n defaultOptions: Partial<JobQueueFactoryOptions<unknown, unknown>> = {}\n): JobQueueFactory {\n return async <Input extends TaskInput, Output extends TaskOutput>({\n queueName,\n jobClass,\n options,\n }: JobQueueFactoryParams<Input, Output>): Promise<RegisteredQueue<Input, Output>> => {\n const mergedOptions = {\n ...defaultOptions,\n ...(options ?? {}),\n } as JobQueueFactoryOptions<Input, Output>;\n\n const storage =\n (mergedOptions.storage as IQueueStorage<Input, Output>) ??\n new InMemoryQueueStorage<Input, Output>(queueName);\n await storage.setupDatabase();\n\n const server = new JobQueueServer<Input, Output>(jobClass as JobClassConstructor<any, any>, {\n storage,\n queueName,\n limiter: mergedOptions.limiter,\n workerCount: mergedOptions.workerCount,\n pollIntervalMs: mergedOptions.pollIntervalMs,\n deleteAfterCompletionMs: mergedOptions.deleteAfterCompletionMs,\n deleteAfterFailureMs: mergedOptions.deleteAfterFailureMs,\n deleteAfterDisabledMs: mergedOptions.deleteAfterDisabledMs,\n cleanupIntervalMs: mergedOptions.cleanupIntervalMs,\n });\n\n const client = new JobQueueClient<Input, Output>({\n storage,\n queueName,\n });\n\n // Attach client to server for same-process optimization\n client.attach(server);\n\n return { server, client, storage };\n };\n}\n\nexport function getJobQueueFactory(): JobQueueFactory {\n if (!globalServiceRegistry.has(JOB_QUEUE_FACTORY)) {\n registerJobQueueFactory(defaultJobQueueFactory);\n }\n return globalServiceRegistry.get(JOB_QUEUE_FACTORY);\n}\n\nif (!globalServiceRegistry.has(JOB_QUEUE_FACTORY)) {\n registerJobQueueFactory(defaultJobQueueFactory);\n}\n",
29
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DataPortSchema } from \"@workglow/util\";\nimport { Job, JobConstructorParam } from \"@workglow/job-queue\";\nimport { GraphAsTask, graphAsTaskConfigSchema } from \"./GraphAsTask\";\nimport { IExecuteContext } from \"./ITask\";\nimport { getJobQueueFactory } from \"./JobQueueFactory\";\nimport { JobTaskFailedError, TaskConfigurationError } from \"./TaskError\";\nimport { TaskEventListeners } from \"./TaskEvents\";\nimport { getTaskQueueRegistry, RegisteredQueue } from \"./TaskQueueRegistry\";\nimport { TaskConfig, TaskInput, TaskOutput } from \"./TaskTypes\";\n\nexport const jobQueueTaskConfigSchema = {\n type: \"object\",\n properties: {\n ...graphAsTaskConfigSchema[\"properties\"],\n queue: {},\n },\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\n/**\n * Configuration type for JobQueueTask.\n * Extends the base TaskConfig with job queue specific properties.\n */\nexport type JobQueueTaskConfig = TaskConfig & {\n /**\n * Queue selection for the task\n * - `true` (default): create/use the task's default queue\n * - `false`: run directly without queueing (requires `canRunDirectly`)\n * - `string`: use an explicitly registered queue name\n */\n queue?: boolean | string;\n};\n\n/**\n * Extended event listeners for JobQueueTask.\n * Adds progress event handling to base task event listeners.\n */\nexport type JobQueueTaskEventListeners = Omit<TaskEventListeners, \"progress\"> & {\n progress: (progress: number, message?: string, details?: Record<string, any> | null) => void;\n};\n\n/**\n * Abstract base class for tasks that operate within a job queue.\n * Provides functionality for managing job execution, progress tracking, and queue integration.\n *\n * @template Input - Type of input data for the task\n * @template Output - Type of output data produced by the task\n * @template Config - Type of configuration object for the task\n */\nexport abstract class JobQueueTask<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends JobQueueTaskConfig = JobQueueTaskConfig,\n> extends GraphAsTask<Input, Output, Config> {\n static readonly type: string = \"JobQueueTask\";\n static canRunDirectly = true;\n\n public static configSchema(): DataPortSchema {\n return jobQueueTaskConfigSchema;\n }\n\n /** Name of the queue currently processing the task */\n currentQueueName?: string;\n /** ID of the current job being processed */\n currentJobId?: string | unknown;\n /** ID of the current runner being used */\n currentRunnerId?: string;\n\n public jobClass: new (config: JobConstructorParam<Input, Output>) => Job<Input, Output>;\n\n constructor(input: Partial<Input> = {} as Input, config: Config = {} as Config) {\n config.queue ??= true;\n super(input, config);\n this.jobClass = Job as unknown as new (\n config: JobConstructorParam<Input, Output>\n ) => Job<Input, Output>;\n }\n\n async execute(input: Input, executeContext: IExecuteContext): Promise<Output | undefined> {\n let cleanup: () => void = () => {};\n\n try {\n if (\n this.config.queue === false &&\n !(this.constructor as typeof JobQueueTask).canRunDirectly\n ) {\n throw new TaskConfigurationError(`${this.type} cannot run directly without a queue`);\n }\n\n const registeredQueue = await this.resolveQueue(input);\n\n if (!registeredQueue) {\n // Direct execution without a queue\n if (!(this.constructor as typeof JobQueueTask).canRunDirectly) {\n const queueLabel =\n typeof this.config.queue === \"string\"\n ? this.config.queue\n : (this.currentQueueName ?? this.type);\n throw new TaskConfigurationError(\n `Queue ${queueLabel} not found, and ${this.type} cannot run directly`\n );\n }\n this.currentJobId = undefined;\n\n // Create job for direct execution\n const job = await this.createJob(input, this.currentQueueName);\n cleanup = job.onJobProgress(\n (progress: number, message: string, details: Record<string, any> | null) => {\n executeContext.updateProgress(progress, message, details);\n }\n );\n const output = await job.execute(job.input, {\n signal: executeContext.signal,\n updateProgress: executeContext.updateProgress.bind(this),\n });\n return output;\n }\n\n // Execute via queue\n const { client } = registeredQueue;\n const jobInput = await this.getJobInput(input);\n const handle = await client.submit(jobInput as Input, {\n jobRunId: this.currentRunnerId,\n maxRetries: 10,\n });\n\n this.currentJobId = handle.id;\n this.currentQueueName = client.queueName;\n\n cleanup = handle.onProgress((progress, message, details) => {\n executeContext.updateProgress(progress, message, details);\n });\n\n const output = await handle.waitFor();\n if (output === undefined) {\n throw new TaskConfigurationError(\"Job disabled, should not happen\");\n }\n\n return output as Output;\n } catch (err: any) {\n throw new JobTaskFailedError(err);\n } finally {\n cleanup();\n }\n }\n\n /**\n * Get the input to submit to the job queue.\n * Override this method to transform task input to job input.\n * @param input - The task input\n * @returns The input to submit to the job queue\n */\n protected async getJobInput(input: Input): Promise<unknown> {\n return input;\n }\n\n /**\n * Override this method to create the right job class for direct execution (without a queue).\n * This is used when running the task directly without queueing.\n * @param input - The task input\n * @param queueName - The queue name (if any)\n * @returns Promise<Job> - The created job\n */\n async createJob(input: Input, queueName?: string): Promise<Job<any, Output>> {\n return new this.jobClass({\n queueName: queueName ?? this.currentQueueName,\n jobRunId: this.currentRunnerId, // could be undefined\n input: input,\n });\n }\n\n protected async resolveQueue(input: Input): Promise<RegisteredQueue<Input, Output> | undefined> {\n const preference = this.config.queue ?? true;\n\n if (preference === false) {\n this.currentQueueName = undefined;\n return undefined;\n }\n\n if (typeof preference === \"string\") {\n const registeredQueue = getTaskQueueRegistry().getQueue<Input, Output>(preference);\n if (registeredQueue) {\n this.currentQueueName = registeredQueue.server.queueName;\n return registeredQueue;\n }\n this.currentQueueName = preference;\n return undefined;\n }\n\n const queueName = await this.getDefaultQueueName(input);\n if (!queueName) {\n this.currentQueueName = undefined;\n return undefined;\n }\n\n this.currentQueueName = queueName;\n\n let registeredQueue = getTaskQueueRegistry().getQueue<Input, Output>(queueName);\n if (!registeredQueue) {\n registeredQueue = await this.createAndRegisterQueue(queueName, input);\n await registeredQueue.server.start();\n }\n\n return registeredQueue;\n }\n\n protected async getDefaultQueueName(_input: Input): Promise<string | undefined> {\n return this.type;\n }\n\n protected async createAndRegisterQueue(\n queueName: string,\n input: Input\n ): Promise<RegisteredQueue<Input, Output>> {\n const factory = getJobQueueFactory();\n let registeredQueue = await factory({\n queueName,\n jobClass: this.jobClass,\n input,\n config: this.config,\n task: this,\n });\n\n const registry = getTaskQueueRegistry();\n\n try {\n registry.registerQueue(registeredQueue);\n } catch (err) {\n if (err instanceof Error && err.message.includes(\"already exists\")) {\n const existing = registry.getQueue<Input, Output>(queueName);\n if (existing) {\n registeredQueue = existing;\n }\n } else {\n throw err;\n }\n }\n\n return registeredQueue;\n }\n\n /**\n * Aborts the task\n * @returns A promise that resolves when the task is aborted\n */\n async abort(): Promise<void> {\n if (this.currentQueueName && this.currentJobId) {\n const registeredQueue = getTaskQueueRegistry().getQueue(this.currentQueueName);\n if (registeredQueue) {\n await registeredQueue.client.abort(this.currentJobId);\n }\n }\n // Always call the parent abort to ensure the task is properly marked as aborted\n super.abort();\n }\n}\n",
29
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Job, JobConstructorParam } from \"@workglow/job-queue\";\nimport type { DataPortSchema } from \"@workglow/util\";\nimport { GraphAsTask, graphAsTaskConfigSchema } from \"./GraphAsTask\";\nimport { IExecuteContext } from \"./ITask\";\nimport { getJobQueueFactory } from \"./JobQueueFactory\";\nimport { JobTaskFailedError, TaskConfigurationError } from \"./TaskError\";\nimport { TaskEventListeners } from \"./TaskEvents\";\nimport { getTaskQueueRegistry, RegisteredQueue } from \"./TaskQueueRegistry\";\nimport { TaskConfig, TaskInput, TaskOutput } from \"./TaskTypes\";\n\nexport const jobQueueTaskConfigSchema = {\n type: \"object\",\n properties: {\n ...graphAsTaskConfigSchema[\"properties\"],\n queue: {\n oneOf: [{ type: \"boolean\" }, { type: \"string\" }],\n description: \"Queue handling: false=run inline, true=use default, string=explicit queue name\",\n \"x-ui-hidden\": true,\n },\n },\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\n/**\n * Configuration type for JobQueueTask.\n * Extends the base TaskConfig with job queue specific properties.\n */\nexport type JobQueueTaskConfig = TaskConfig & {\n /**\n * Queue selection for the task\n * - `true` (default): create/use the task's default queue\n * - `false`: run directly without queueing (requires `canRunDirectly`)\n * - `string`: use an explicitly registered queue name\n */\n queue?: boolean | string;\n};\n\n/**\n * Extended event listeners for JobQueueTask.\n * Adds progress event handling to base task event listeners.\n */\nexport type JobQueueTaskEventListeners = Omit<TaskEventListeners, \"progress\"> & {\n progress: (progress: number, message?: string, details?: Record<string, any> | null) => void;\n};\n\n/**\n * Abstract base class for tasks that operate within a job queue.\n * Provides functionality for managing job execution, progress tracking, and queue integration.\n *\n * @template Input - Type of input data for the task\n * @template Output - Type of output data produced by the task\n * @template Config - Type of configuration object for the task\n */\nexport abstract class JobQueueTask<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends JobQueueTaskConfig = JobQueueTaskConfig,\n> extends GraphAsTask<Input, Output, Config> {\n static readonly type: string = \"JobQueueTask\";\n static canRunDirectly = true;\n\n public static configSchema(): DataPortSchema {\n return jobQueueTaskConfigSchema;\n }\n\n /** Name of the queue currently processing the task */\n currentQueueName?: string;\n /** ID of the current job being processed */\n currentJobId?: string | unknown;\n /** ID of the current runner being used */\n currentRunnerId?: string;\n\n public jobClass: new (config: JobConstructorParam<Input, Output>) => Job<Input, Output>;\n\n constructor(input: Partial<Input> = {} as Input, config: Config = {} as Config) {\n config.queue ??= true;\n super(input, config);\n this.jobClass = Job as unknown as new (\n config: JobConstructorParam<Input, Output>\n ) => Job<Input, Output>;\n }\n\n async execute(input: Input, executeContext: IExecuteContext): Promise<Output | undefined> {\n let cleanup: () => void = () => {};\n\n try {\n if (\n this.config.queue === false &&\n !(this.constructor as typeof JobQueueTask).canRunDirectly\n ) {\n throw new TaskConfigurationError(`${this.type} cannot run directly without a queue`);\n }\n\n const registeredQueue = await this.resolveQueue(input);\n\n if (!registeredQueue) {\n // Direct execution without a queue\n if (!(this.constructor as typeof JobQueueTask).canRunDirectly) {\n const queueLabel =\n typeof this.config.queue === \"string\"\n ? this.config.queue\n : (this.currentQueueName ?? this.type);\n throw new TaskConfigurationError(\n `Queue ${queueLabel} not found, and ${this.type} cannot run directly`\n );\n }\n this.currentJobId = undefined;\n\n // Create job for direct execution\n const job = await this.createJob(input, this.currentQueueName);\n cleanup = job.onJobProgress(\n (progress: number, message: string, details: Record<string, any> | null) => {\n executeContext.updateProgress(progress, message, details);\n }\n );\n const output = await job.execute(job.input, {\n signal: executeContext.signal,\n updateProgress: executeContext.updateProgress.bind(this),\n });\n return output;\n }\n\n // Execute via queue\n const { client } = registeredQueue;\n const jobInput = await this.getJobInput(input);\n const handle = await client.submit(jobInput as Input, {\n jobRunId: this.currentRunnerId,\n maxRetries: 10,\n });\n\n this.currentJobId = handle.id;\n this.currentQueueName = client.queueName;\n\n cleanup = handle.onProgress((progress, message, details) => {\n executeContext.updateProgress(progress, message, details);\n });\n\n const output = await handle.waitFor();\n if (output === undefined) {\n throw new TaskConfigurationError(\"Job disabled, should not happen\");\n }\n\n return output as Output;\n } catch (err: any) {\n throw new JobTaskFailedError(err);\n } finally {\n cleanup();\n }\n }\n\n /**\n * Get the input to submit to the job queue.\n * Override this method to transform task input to job input.\n * @param input - The task input\n * @returns The input to submit to the job queue\n */\n protected async getJobInput(input: Input): Promise<unknown> {\n return input;\n }\n\n /**\n * Override this method to create the right job class for direct execution (without a queue).\n * This is used when running the task directly without queueing.\n * @param input - The task input\n * @param queueName - The queue name (if any)\n * @returns Promise<Job> - The created job\n */\n async createJob(input: Input, queueName?: string): Promise<Job<any, Output>> {\n return new this.jobClass({\n queueName: queueName ?? this.currentQueueName,\n jobRunId: this.currentRunnerId, // could be undefined\n input: input,\n });\n }\n\n protected async resolveQueue(input: Input): Promise<RegisteredQueue<Input, Output> | undefined> {\n const preference = this.config.queue ?? true;\n\n if (preference === false) {\n this.currentQueueName = undefined;\n return undefined;\n }\n\n if (typeof preference === \"string\") {\n const registeredQueue = getTaskQueueRegistry().getQueue<Input, Output>(preference);\n if (registeredQueue) {\n this.currentQueueName = registeredQueue.server.queueName;\n return registeredQueue;\n }\n this.currentQueueName = preference;\n return undefined;\n }\n\n const queueName = await this.getDefaultQueueName(input);\n if (!queueName) {\n this.currentQueueName = undefined;\n return undefined;\n }\n\n this.currentQueueName = queueName;\n\n let registeredQueue = getTaskQueueRegistry().getQueue<Input, Output>(queueName);\n if (!registeredQueue) {\n registeredQueue = await this.createAndRegisterQueue(queueName, input);\n await registeredQueue.server.start();\n }\n\n return registeredQueue;\n }\n\n protected async getDefaultQueueName(_input: Input): Promise<string | undefined> {\n return this.type;\n }\n\n protected async createAndRegisterQueue(\n queueName: string,\n input: Input\n ): Promise<RegisteredQueue<Input, Output>> {\n const factory = getJobQueueFactory();\n let registeredQueue = await factory({\n queueName,\n jobClass: this.jobClass,\n input,\n config: this.config,\n task: this,\n });\n\n const registry = getTaskQueueRegistry();\n\n try {\n registry.registerQueue(registeredQueue);\n } catch (err) {\n if (err instanceof Error && err.message.includes(\"already exists\")) {\n const existing = registry.getQueue<Input, Output>(queueName);\n if (existing) {\n registeredQueue = existing;\n }\n } else {\n throw err;\n }\n }\n\n return registeredQueue;\n }\n\n /**\n * Aborts the task\n * @returns A promise that resolves when the task is aborted\n */\n async abort(): Promise<void> {\n if (this.currentQueueName && this.currentJobId) {\n const registeredQueue = getTaskQueueRegistry().getQueue(this.currentQueueName);\n if (registeredQueue) {\n await registeredQueue.client.abort(this.currentJobId);\n }\n }\n // Always call the parent abort to ensure the task is properly marked as aborted\n super.abort();\n }\n}\n",
30
30
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { JobQueueClient, JobQueueServer } from \"@workglow/job-queue\";\nimport { IQueueStorage } from \"@workglow/storage\";\n\n/**\n * Combined structure for a registered job queue containing server, client, and storage\n */\nexport interface RegisteredQueue<Input = unknown, Output = unknown> {\n readonly server: JobQueueServer<Input, Output>;\n readonly client: JobQueueClient<Input, Output>;\n readonly storage: IQueueStorage<Input, Output>;\n}\n\n/**\n * Global singleton instance of the TaskQueueRegistry.\n * This is used to manage all job queues across the application.\n */\nlet taskQueueRegistry: TaskQueueRegistry | null = null;\n\n/**\n * Registry for managing task queues in the application.\n * Provides functionality to register, manage, and control job queues.\n *\n * @template Input - The type of input data for tasks in the queues\n * @template Output - The type of output data for tasks in the queues\n */\nexport class TaskQueueRegistry {\n /**\n * Map of queue names to their corresponding registered queue instances\n */\n public readonly queues: Map<string, RegisteredQueue<unknown, unknown>> = new Map();\n\n /**\n * Registers a new job queue with the registry\n *\n * @param queue - The registered queue containing server, client, and storage\n * @throws Error if a queue with the same name already exists\n */\n registerQueue<Input, Output>(queue: RegisteredQueue<Input, Output>): void {\n const queueName = queue.server.queueName;\n if (this.queues.has(queueName)) {\n throw new Error(`Queue with name ${queueName} already exists`);\n }\n this.queues.set(queueName, queue as RegisteredQueue<unknown, unknown>);\n }\n\n /**\n * Retrieves a registered queue by its name\n *\n * @param queueName - The name of the queue to retrieve\n * @returns The registered queue or undefined if not found\n */\n getQueue<Input, Output>(queueName: string): RegisteredQueue<Input, Output> | undefined {\n return this.queues.get(queueName) as RegisteredQueue<Input, Output> | undefined;\n }\n\n /**\n * Starts all registered job queue servers\n * This allows queues to begin processing their jobs\n *\n * @returns The registry instance for chaining\n */\n startQueues(): this {\n for (const queue of this.queues.values()) {\n queue.server.start();\n }\n return this;\n }\n\n /**\n * Stops all registered job queue servers\n * This pauses job processing but maintains the queued jobs\n *\n * @returns The registry instance for chaining\n */\n stopQueues(): this {\n for (const queue of this.queues.values()) {\n queue.server.stop();\n }\n return this;\n }\n\n /**\n * Clears all registered job queues\n * This removes all queued jobs from the storage\n *\n * @returns The registry instance for chaining\n */\n clearQueues(): this {\n for (const queue of this.queues.values()) {\n queue.storage.deleteAll();\n }\n return this;\n }\n}\n\n/**\n * Gets the global TaskQueueRegistry instance\n * Creates a new instance if one doesn't exist\n *\n * @returns The global TaskQueueRegistry instance\n */\nexport function getTaskQueueRegistry(): TaskQueueRegistry {\n if (!taskQueueRegistry) {\n taskQueueRegistry = new TaskQueueRegistry();\n }\n return taskQueueRegistry;\n}\n\n/**\n * Sets the global TaskQueueRegistry instance\n * Stops and clears any existing registry before replacing it\n *\n * @param registry - The new registry instance to use, or null to clear\n */\nexport function setTaskQueueRegistry(registry: TaskQueueRegistry | null): void {\n if (taskQueueRegistry) {\n taskQueueRegistry.stopQueues();\n taskQueueRegistry.clearQueues();\n }\n taskQueueRegistry = registry;\n}\n",
31
31
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DataPortSchema } from \"@workglow/util\";\nimport { PROPERTY_ARRAY } from \"../task-graph/TaskGraphRunner\";\nimport { CreateEndLoopWorkflow, CreateLoopWorkflow, Workflow } from \"../task-graph/Workflow\";\nimport { IteratorTask, IteratorTaskConfig, iteratorTaskConfigSchema } from \"./IteratorTask\";\nimport type { TaskInput, TaskOutput, TaskTypeName } from \"./TaskTypes\";\n\nexport const mapTaskConfigSchema = {\n type: \"object\",\n properties: {\n ...iteratorTaskConfigSchema[\"properties\"],\n preserveOrder: { type: \"boolean\" },\n flatten: { type: \"boolean\" },\n },\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\n/**\n * Configuration for MapTask.\n */\nexport type MapTaskConfig = IteratorTaskConfig & {\n /**\n * Whether to preserve the order of results matching the input order.\n * When false, results may be in completion order.\n * @default true\n */\n readonly preserveOrder?: boolean;\n\n /**\n * Whether to flatten array results from each iteration.\n * When true, if each iteration returns an array, they are concatenated.\n * @default false\n */\n readonly flatten?: boolean;\n};\n\n/**\n * MapTask transforms one or more array inputs by running a workflow for each index.\n */\nexport class MapTask<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends MapTaskConfig = MapTaskConfig,\n> extends IteratorTask<Input, Output, Config> {\n public static type: TaskTypeName = \"MapTask\";\n public static category: string = \"Flow Control\";\n public static title: string = \"Map\";\n public static description: string = \"Transforms array inputs by running a workflow per item\";\n\n public static configSchema(): DataPortSchema {\n return mapTaskConfigSchema;\n }\n\n /**\n * MapTask always uses PROPERTY_ARRAY merge strategy to collect results.\n */\n public static readonly compoundMerge = PROPERTY_ARRAY;\n\n /**\n * Static input schema for MapTask.\n */\n public static inputSchema(): DataPortSchema {\n return {\n type: \"object\",\n properties: {},\n additionalProperties: true,\n } as const satisfies DataPortSchema;\n }\n\n /**\n * Static output schema for MapTask.\n */\n public static outputSchema(): DataPortSchema {\n return {\n type: \"object\",\n properties: {},\n additionalProperties: true,\n } as const satisfies DataPortSchema;\n }\n\n /**\n * Whether to preserve order of results.\n */\n public get preserveOrder(): boolean {\n return this.config.preserveOrder ?? true;\n }\n\n /**\n * Whether to flatten nested array results.\n */\n public get flatten(): boolean {\n return this.config.flatten ?? false;\n }\n\n public override preserveIterationOrder(): boolean {\n return this.preserveOrder;\n }\n\n /**\n * Returns the empty result for MapTask.\n */\n public override getEmptyResult(): Output {\n const schema = this.outputSchema();\n if (typeof schema === \"boolean\") {\n return {} as Output;\n }\n\n const result: Record<string, unknown[]> = {};\n for (const key of Object.keys(schema.properties || {})) {\n result[key] = [];\n }\n\n return result as Output;\n }\n\n /**\n * Output schema for MapTask.\n * Wraps inner workflow output properties in arrays.\n */\n public override outputSchema(): DataPortSchema {\n if (!this.hasChildren()) {\n return (this.constructor as typeof MapTask).outputSchema();\n }\n\n return this.getWrappedOutputSchema();\n }\n\n /**\n * Collects and optionally flattens results from all iterations.\n */\n public override collectResults(results: TaskOutput[]): Output {\n const collected = super.collectResults(results);\n\n if (!this.flatten || typeof collected !== \"object\" || collected === null) {\n return collected;\n }\n\n const flattened: Record<string, unknown[]> = {};\n for (const [key, value] of Object.entries(collected)) {\n if (Array.isArray(value)) {\n flattened[key] = value.flat();\n } else {\n flattened[key] = value as unknown[];\n }\n }\n\n return flattened as Output;\n }\n}\n\n// ============================================================================\n// Workflow Prototype Extensions\n// ============================================================================\n\ndeclare module \"../task-graph/Workflow\" {\n interface Workflow {\n /**\n * Starts a map loop that transforms each element in array input ports.\n * Use .endMap() to close the loop and return to the parent workflow.\n */\n map: CreateLoopWorkflow<TaskInput, TaskOutput, MapTaskConfig>;\n\n /**\n * Ends the map loop and returns to the parent workflow.\n */\n endMap(): Workflow;\n }\n}\n\nqueueMicrotask(() => {\n Workflow.prototype.map = CreateLoopWorkflow(MapTask);\n Workflow.prototype.endMap = CreateEndLoopWorkflow(\"endMap\");\n});\n",
32
32
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { DataPortSchema } from \"@workglow/util\";\nimport { CreateEndLoopWorkflow, CreateLoopWorkflow, Workflow } from \"../task-graph/Workflow\";\nimport {\n IterationAnalysisResult,\n IteratorTask,\n IteratorTaskConfig,\n iteratorTaskConfigSchema,\n} from \"./IteratorTask\";\nimport type { TaskInput, TaskOutput, TaskTypeName } from \"./TaskTypes\";\n\nexport const reduceTaskConfigSchema = {\n type: \"object\",\n properties: {\n ...iteratorTaskConfigSchema[\"properties\"],\n initialValue: {},\n },\n additionalProperties: false,\n} as const satisfies DataPortSchema;\n\n/**\n * Configuration for ReduceTask.\n */\nexport type ReduceTaskConfig<Accumulator = unknown> = IteratorTaskConfig & {\n /**\n * The initial value for the accumulator.\n */\n readonly initialValue?: Accumulator;\n};\n\n/**\n * ReduceTask processes iterated inputs sequentially with an accumulator.\n */\nexport class ReduceTask<\n Input extends TaskInput = TaskInput,\n Output extends TaskOutput = TaskOutput,\n Config extends ReduceTaskConfig<Output> = ReduceTaskConfig<Output>,\n> extends IteratorTask<Input, Output, Config> {\n public static type: TaskTypeName = \"ReduceTask\";\n public static category: string = \"Flow Control\";\n public static title: string = \"Reduce\";\n public static description: string =\n \"Processes iterated inputs sequentially with an accumulator (fold)\";\n\n public static configSchema(): DataPortSchema {\n return reduceTaskConfigSchema;\n }\n\n constructor(input: Partial<Input> = {}, config: Partial<Config> = {}) {\n // Reduce is always sequential\n const reduceConfig = {\n ...config,\n concurrencyLimit: 1,\n batchSize: 1,\n };\n super(input, reduceConfig as Config);\n }\n\n /**\n * Gets the initial accumulator value.\n */\n public get initialValue(): Output {\n return (this.config.initialValue ?? {}) as Output;\n }\n\n public override isReduceTask(): boolean {\n return true;\n }\n\n public override getInitialAccumulator(): Output {\n const value = this.initialValue;\n if (Array.isArray(value)) {\n return [...value] as unknown as Output;\n }\n if (value && typeof value === \"object\") {\n return { ...(value as Record<string, unknown>) } as Output;\n }\n return value;\n }\n\n public override buildIterationRunInput(\n analysis: IterationAnalysisResult,\n index: number,\n iterationCount: number,\n extraInput: Record<string, unknown> = {}\n ): Record<string, unknown> {\n return super.buildIterationRunInput(analysis, index, iterationCount, {\n accumulator: extraInput.accumulator,\n });\n }\n\n public override getEmptyResult(): Output {\n return this.getInitialAccumulator();\n }\n\n /**\n * Static input schema for ReduceTask.\n */\n public static inputSchema(): DataPortSchema {\n return {\n type: \"object\",\n properties: {},\n additionalProperties: true,\n } as const satisfies DataPortSchema;\n }\n\n /**\n * Static output schema for ReduceTask.\n */\n public static outputSchema(): DataPortSchema {\n return {\n type: \"object\",\n properties: {},\n additionalProperties: true,\n } as const satisfies DataPortSchema;\n }\n\n /**\n * Instance output schema - returns the reduced output schema from ending nodes.\n */\n public override outputSchema(): DataPortSchema {\n if (!this.hasChildren()) {\n return (this.constructor as typeof ReduceTask).outputSchema();\n }\n\n const endingNodes = this.subGraph\n .getTasks()\n .filter((task) => this.subGraph.getTargetDataflows(task.config.id).length === 0);\n\n if (endingNodes.length === 0) {\n return (this.constructor as typeof ReduceTask).outputSchema();\n }\n\n const properties: Record<string, unknown> = {};\n\n for (const task of endingNodes) {\n const taskOutputSchema = task.outputSchema();\n if (typeof taskOutputSchema === \"boolean\") continue;\n\n for (const [key, schema] of Object.entries(taskOutputSchema.properties || {})) {\n if (!properties[key]) {\n properties[key] = schema;\n }\n }\n }\n\n return {\n type: \"object\",\n properties,\n additionalProperties: false,\n } as DataPortSchema;\n }\n}\n\n// ============================================================================\n// Workflow Prototype Extensions\n// ============================================================================\n\ndeclare module \"../task-graph/Workflow\" {\n interface Workflow {\n /**\n * Starts a reduce loop that processes iterated inputs with an accumulator.\n * Use .endReduce() to close the loop and return to the parent workflow.\n */\n reduce: CreateLoopWorkflow<TaskInput, TaskOutput, ReduceTaskConfig<any>>;\n\n /**\n * Ends the reduce loop and returns to the parent workflow.\n */\n endReduce(): Workflow;\n }\n}\n\nqueueMicrotask(() => {\n Workflow.prototype.reduce = CreateLoopWorkflow(ReduceTask);\n Workflow.prototype.endReduce = CreateEndLoopWorkflow(\"endReduce\");\n});\n",
33
33
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { ITaskConstructor } from \"./ITask\";\n\n/**\n * Map storing all registered task constructors.\n * Keys are task type identifiers and values are their corresponding constructor functions.\n */\nconst taskConstructors = new Map<string, ITaskConstructor<any, any, any>>();\n\n/**\n * Registers a task constructor with the registry.\n * This allows the task type to be instantiated dynamically based on its type identifier.\n *\n * @param type - The unique identifier for the task type\n * @param constructor - The constructor function for the task\n * @throws Error if a task with the same type is already registered\n */\nfunction registerTask(baseClass: ITaskConstructor<any, any, any>): void {\n if (taskConstructors.has(baseClass.type)) {\n // TODO: fix this\n // throw new Error(`Task type ${baseClass.type} is already registered`);\n }\n taskConstructors.set(baseClass.type, baseClass);\n}\n\n/**\n * TaskRegistry provides a centralized registry for task types.\n * It enables dynamic task instantiation and management across the application.\n */\nexport const TaskRegistry = {\n /**\n * Map containing all registered task constructors\n */\n all: taskConstructors,\n\n /**\n * Function to register new task types\n */\n registerTask,\n};\n",
34
- "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Dataflow } from \"../task-graph/Dataflow\";\nimport { TaskGraph } from \"../task-graph/TaskGraph\";\nimport { CompoundMergeStrategy } from \"../task-graph/TaskGraphRunner\";\nimport { TaskConfigurationError, TaskJSONError } from \"../task/TaskError\";\nimport { TaskRegistry } from \"../task/TaskRegistry\";\nimport { ConditionalTaskConfig } from \"./ConditionalTask\";\nimport { GraphAsTask } from \"./GraphAsTask\";\nimport { IteratorTaskConfig } from \"./IteratorTask\";\nimport { TaskConfig, TaskInput } from \"./TaskTypes\";\nimport { WhileTaskConfig } from \"./WhileTask\";\n\n// ========================================================================\n// JSON Serialization Types\n// ========================================================================\n/**\n * Represents a single task item in the JSON configuration.\n * This structure defines how tasks should be configured in JSON format.\n */\n\nexport type JsonTaskConfig = Omit<\n TaskConfig & WhileTaskConfig & IteratorTaskConfig & ConditionalTaskConfig,\n \"id\"\n>;\n\nexport type JsonTaskItem = {\n /** Unique identifier for the task */\n id: unknown;\n\n /** Type of task to create */\n type: string;\n\n /** Optional configuration for the task */\n config?: JsonTaskConfig;\n\n /** Default input values for the task */\n defaults?: TaskInput;\n\n /** Defines data flow between tasks */\n dependencies?: {\n /** Input parameter name mapped to source task output */\n [x: string]:\n | {\n /** ID of the source task */\n id: unknown;\n\n /** Output parameter name from source task */\n output: string;\n }\n | Array<{\n id: unknown;\n output: string;\n }>;\n };\n\n /** Nested tasks for compound operations */\n subtasks?: JsonTaskItem[];\n};\n\n/**\n * Represents a task graph item, which can be a task or a subgraph\n */\nexport type TaskGraphItemJson = {\n id: unknown;\n type: string;\n defaults?: TaskInput;\n config?: JsonTaskConfig;\n subgraph?: TaskGraphJson;\n merge?: CompoundMergeStrategy;\n};\n\nexport type TaskGraphJson = {\n tasks: TaskGraphItemJson[];\n dataflows: DataflowJson[];\n};\n\nexport type DataflowJson = {\n sourceTaskId: unknown;\n sourceTaskPortId: string;\n targetTaskId: unknown;\n targetTaskPortId: string;\n};\n\nconst createSingleTaskFromJSON = (item: JsonTaskItem | TaskGraphItemJson) => {\n if (!item.id) throw new TaskJSONError(\"Task id required\");\n if (!item.type) throw new TaskJSONError(\"Task type required\");\n if (item.defaults && Array.isArray(item.defaults))\n throw new TaskJSONError(\"Task defaults must be an object\");\n\n const taskClass = TaskRegistry.all.get(item.type);\n if (!taskClass)\n throw new TaskJSONError(`Task type ${item.type} not found, perhaps not registered?`);\n\n const taskConfig: TaskConfig = {\n ...item.config,\n id: item.id,\n };\n const task = new taskClass(item.defaults ?? {}, taskConfig);\n return task;\n};\n\n/**\n * Creates a task instance from a JSON task item configuration\n * Validates required fields and resolves task type from registry\n */\nexport const createTaskFromDependencyJSON = (item: JsonTaskItem) => {\n const task = createSingleTaskFromJSON(item);\n if (item.subtasks && item.subtasks.length > 0) {\n if (!(task instanceof GraphAsTask)) {\n throw new TaskConfigurationError(\"Subgraph is only supported for CompoundTasks\");\n }\n task.subGraph = createGraphFromDependencyJSON(item.subtasks);\n }\n return task;\n};\n\n/**\n * Creates a task graph from an array of JSON task items\n * Recursively processes subtasks for compound tasks\n */\nexport const createGraphFromDependencyJSON = (jsonItems: JsonTaskItem[]) => {\n const subGraph = new TaskGraph();\n for (const subitem of jsonItems) {\n subGraph.addTask(createTaskFromDependencyJSON(subitem));\n }\n return subGraph;\n};\n\n/**\n * Creates a task instance from a task graph item JSON representation\n * @param item The JSON representation of the task\n * @returns A new task instance\n * @throws Error if required fields are missing or invalid\n */\nexport const createTaskFromGraphJSON = (item: TaskGraphItemJson) => {\n const task = createSingleTaskFromJSON(item);\n if (item.subgraph) {\n if (!(task instanceof GraphAsTask)) {\n throw new TaskConfigurationError(\"Subgraph is only supported for GraphAsTask\");\n }\n task.subGraph = createGraphFromGraphJSON(item.subgraph);\n }\n return task;\n};\n\n/**\n * Creates a TaskGraph instance from its JSON representation\n * @param graphJsonObj The JSON representation of the task graph\n * @returns A new TaskGraph instance with all tasks and data flows\n */\nexport const createGraphFromGraphJSON = (graphJsonObj: TaskGraphJson) => {\n const subGraph = new TaskGraph();\n for (const subitem of graphJsonObj.tasks) {\n subGraph.addTask(createTaskFromGraphJSON(subitem));\n }\n for (const subitem of graphJsonObj.dataflows) {\n subGraph.addDataflow(\n new Dataflow(\n subitem.sourceTaskId,\n subitem.sourceTaskPortId,\n subitem.targetTaskId,\n subitem.targetTaskPortId\n )\n );\n }\n return subGraph;\n};\n",
34
+ "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Dataflow } from \"../task-graph/Dataflow\";\nimport { TaskGraph } from \"../task-graph/TaskGraph\";\nimport { CompoundMergeStrategy } from \"../task-graph/TaskGraphRunner\";\nimport { TaskConfigurationError, TaskJSONError } from \"../task/TaskError\";\nimport { TaskRegistry } from \"../task/TaskRegistry\";\nimport { ConditionalTaskConfig } from \"./ConditionalTask\";\nimport { GraphAsTask, GraphAsTaskConfig } from \"./GraphAsTask\";\nimport { IteratorTaskConfig } from \"./IteratorTask\";\nimport { JobQueueTaskConfig } from \"./JobQueueTask\";\nimport { MapTaskConfig } from \"./MapTask\";\nimport { ReduceTaskConfig } from \"./ReduceTask\";\nimport { TaskConfig, TaskInput } from \"./TaskTypes\";\nimport { WhileTaskConfig } from \"./WhileTask\";\n\n// ========================================================================\n// JSON Serialization Types\n// ========================================================================\n/**\n * Represents a single task item in the JSON configuration.\n * This structure defines how tasks should be configured in JSON format.\n */\n\nexport type JsonTaskConfig = Omit<\n TaskConfig &\n GraphAsTaskConfig &\n WhileTaskConfig &\n IteratorTaskConfig &\n ReduceTaskConfig &\n MapTaskConfig &\n ConditionalTaskConfig &\n JobQueueTaskConfig,\n \"id\"\n>;\n\nexport type JsonTaskItem = {\n /** Unique identifier for the task */\n id: unknown;\n\n /** Type of task to create */\n type: string;\n\n /** Optional configuration for the task */\n config?: JsonTaskConfig;\n\n /** Default input values for the task */\n defaults?: TaskInput;\n\n /** Defines data flow between tasks */\n dependencies?: {\n /** Input parameter name mapped to source task output */\n [x: string]:\n | {\n /** ID of the source task */\n id: unknown;\n\n /** Output parameter name from source task */\n output: string;\n }\n | Array<{\n id: unknown;\n output: string;\n }>;\n };\n\n /** Nested tasks for compound operations */\n subtasks?: JsonTaskItem[];\n};\n\n/**\n * Represents a task graph item, which can be a task or a subgraph\n */\nexport type TaskGraphItemJson = {\n id: unknown;\n type: string;\n defaults?: TaskInput;\n config?: JsonTaskConfig;\n subgraph?: TaskGraphJson;\n merge?: CompoundMergeStrategy;\n};\n\nexport type TaskGraphJson = {\n tasks: TaskGraphItemJson[];\n dataflows: DataflowJson[];\n};\n\nexport type DataflowJson = {\n sourceTaskId: unknown;\n sourceTaskPortId: string;\n targetTaskId: unknown;\n targetTaskPortId: string;\n};\n\nconst createSingleTaskFromJSON = (item: JsonTaskItem | TaskGraphItemJson) => {\n if (!item.id) throw new TaskJSONError(\"Task id required\");\n if (!item.type) throw new TaskJSONError(\"Task type required\");\n if (item.defaults && Array.isArray(item.defaults))\n throw new TaskJSONError(\"Task defaults must be an object\");\n\n const taskClass = TaskRegistry.all.get(item.type);\n if (!taskClass)\n throw new TaskJSONError(`Task type ${item.type} not found, perhaps not registered?`);\n\n const taskConfig: TaskConfig = {\n ...item.config,\n id: item.id,\n };\n const task = new taskClass(item.defaults ?? {}, taskConfig);\n return task;\n};\n\n/**\n * Creates a task instance from a JSON task item configuration\n * Validates required fields and resolves task type from registry\n */\nexport const createTaskFromDependencyJSON = (item: JsonTaskItem) => {\n const task = createSingleTaskFromJSON(item);\n if (item.subtasks && item.subtasks.length > 0) {\n if (!(task instanceof GraphAsTask)) {\n throw new TaskConfigurationError(\"Subgraph is only supported for CompoundTasks\");\n }\n task.subGraph = createGraphFromDependencyJSON(item.subtasks);\n }\n return task;\n};\n\n/**\n * Creates a task graph from an array of JSON task items\n * Recursively processes subtasks for compound tasks\n */\nexport const createGraphFromDependencyJSON = (jsonItems: JsonTaskItem[]) => {\n const subGraph = new TaskGraph();\n for (const subitem of jsonItems) {\n subGraph.addTask(createTaskFromDependencyJSON(subitem));\n }\n return subGraph;\n};\n\n/**\n * Creates a task instance from a task graph item JSON representation\n * @param item The JSON representation of the task\n * @returns A new task instance\n * @throws Error if required fields are missing or invalid\n */\nexport const createTaskFromGraphJSON = (item: TaskGraphItemJson) => {\n const task = createSingleTaskFromJSON(item);\n if (item.subgraph) {\n if (!(task instanceof GraphAsTask)) {\n throw new TaskConfigurationError(\"Subgraph is only supported for GraphAsTask\");\n }\n task.subGraph = createGraphFromGraphJSON(item.subgraph);\n }\n return task;\n};\n\n/**\n * Creates a TaskGraph instance from its JSON representation\n * @param graphJsonObj The JSON representation of the task graph\n * @returns A new TaskGraph instance with all tasks and data flows\n */\nexport const createGraphFromGraphJSON = (graphJsonObj: TaskGraphJson) => {\n const subGraph = new TaskGraph();\n for (const subitem of graphJsonObj.tasks) {\n subGraph.addTask(createTaskFromGraphJSON(subitem));\n }\n for (const subitem of graphJsonObj.dataflows) {\n subGraph.addDataflow(\n new Dataflow(\n subitem.sourceTaskId,\n subitem.sourceTaskPortId,\n subitem.targetTaskId,\n subitem.targetTaskPortId\n )\n );\n }\n return subGraph;\n};\n",
35
35
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nexport * from \"./ConditionalTask\";\nexport * from \"./ConditionUtils\";\nexport * from \"./GraphAsTask\";\nexport * from \"./GraphAsTaskRunner\";\nexport * from \"./InputResolver\";\nexport * from \"./ITask\";\nexport * from \"./iterationSchema\";\nexport * from \"./IteratorTask\";\nexport * from \"./IteratorTaskRunner\";\nexport * from \"./JobQueueFactory\";\nexport * from \"./JobQueueTask\";\nexport * from \"./MapTask\";\nexport * from \"./ReduceTask\";\nexport * from \"./StreamTypes\";\nexport * from \"./Task\";\nexport * from \"./TaskError\";\nexport * from \"./TaskEvents\";\nexport * from \"./TaskJSON\";\nexport * from \"./TaskQueueRegistry\";\nexport * from \"./TaskRegistry\";\nexport * from \"./TaskTypes\";\nexport * from \"./WhileTask\";\nexport * from \"./WhileTaskRunner\";\n\nimport { ConditionalTask } from \"./ConditionalTask\";\nimport { GraphAsTask } from \"./GraphAsTask\";\nimport { MapTask } from \"./MapTask\";\nimport { ReduceTask } from \"./ReduceTask\";\nimport { TaskRegistry } from \"./TaskRegistry\";\nimport { WhileTask } from \"./WhileTask\";\n\nexport const registerBaseTasks = () => {\n const tasks = [GraphAsTask, ConditionalTask, MapTask, WhileTask, ReduceTask];\n tasks.map(TaskRegistry.registerTask);\n return tasks;\n};\n",
36
36
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { createServiceToken, EventEmitter, EventParameters } from \"@workglow/util\";\nimport { TaskGraph } from \"../task-graph/TaskGraph\";\n\n/**\n * Service token for TaskGraphRepository\n */\nexport const TASK_GRAPH_REPOSITORY = createServiceToken<TaskGraphRepository>(\n \"taskgraph.taskGraphRepository\"\n);\n\n/**\n * Events that can be emitted by the TaskGraphRepository\n */\nexport type TaskGraphRepositoryEvents = keyof TaskGraphRepositoryEventListeners;\n\nexport type TaskGraphRepositoryEventListeners = {\n graph_saved: (key: string) => void;\n graph_retrieved: (key: string) => void;\n graph_cleared: () => void;\n};\n\nexport type TaskGraphRepositoryEventListener<Event extends TaskGraphRepositoryEvents> =\n TaskGraphRepositoryEventListeners[Event];\n\nexport type TaskGraphRepositoryEventParameters<Event extends TaskGraphRepositoryEvents> =\n EventParameters<TaskGraphRepositoryEventListeners, Event>;\n\n/**\n * Repository class for managing task graphs persistence and retrieval.\n * Provides functionality to save, load, and manipulate task graphs with their associated tasks and data flows.\n */\nexport abstract class TaskGraphRepository {\n /**\n * The type of the repository\n */\n public type = \"TaskGraphRepository\";\n\n /**\n * The event emitter for the task graphs\n */\n private get events() {\n if (!this._events) {\n this._events = new EventEmitter<TaskGraphRepositoryEventListeners>();\n }\n return this._events;\n }\n private _events: EventEmitter<TaskGraphRepositoryEventListeners> | undefined;\n\n /**\n * Registers an event listener for the specified event\n * @param name The event name to listen for\n * @param fn The callback function to execute when the event occurs\n */\n on<Event extends TaskGraphRepositoryEvents>(\n name: Event,\n fn: TaskGraphRepositoryEventListener<Event>\n ) {\n this.events.on(name, fn);\n }\n\n /**\n * Removes an event listener for the specified event\n * @param name The event name to stop listening for\n * @param fn The callback function to remove\n */\n off<Event extends TaskGraphRepositoryEvents>(\n name: Event,\n fn: TaskGraphRepositoryEventListener<Event>\n ) {\n this.events.off(name, fn);\n }\n\n /**\n * Adds an event listener that will only be called once\n * @param name The event name to listen for\n * @param fn The callback function to execute when the event occurs\n */\n once<Event extends TaskGraphRepositoryEvents>(\n name: Event,\n fn: TaskGraphRepositoryEventListener<Event>\n ) {\n this.events.once(name, fn);\n }\n\n /**\n * Returns when the event was emitted (promise form of once)\n * @param name The event name to check\n * @returns true if the event has listeners, false otherwise\n */\n waitOn<Event extends TaskGraphRepositoryEvents>(name: Event) {\n return this.events.waitOn(name) as Promise<TaskGraphRepositoryEventParameters<Event>>;\n }\n\n /**\n * Emits an event (if there are listeners)\n * @param name The event name to emit\n * @param args The event parameters\n */\n emit<Event extends TaskGraphRepositoryEvents>(\n name: Event,\n ...args: TaskGraphRepositoryEventParameters<Event>\n ) {\n this._events?.emit(name, ...args);\n }\n\n /**\n * Saves a task graph to persistent storage\n * @param key The unique identifier for the task graph\n * @param output The task graph to save\n * @emits graph_saved when the operation completes\n */\n abstract saveTaskGraph(key: string, output: TaskGraph): Promise<void>;\n\n /**\n * Retrieves a task graph from persistent storage\n * @param key The unique identifier of the task graph to retrieve\n * @returns The retrieved task graph, or undefined if not found\n * @emits graph_retrieved when the operation completes successfully\n */\n abstract getTaskGraph(key: string): Promise<TaskGraph | undefined>;\n\n /**\n * Clears all task graphs from the repository\n * @emits graph_cleared when the operation completes\n */\n abstract clear(): Promise<void>;\n\n /**\n * Returns the number of task graphs stored in the repository\n * @returns The count of stored task graphs\n */\n abstract size(): Promise<number>;\n}\n",
37
37
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport type { BaseTabularStorage } from \"@workglow/storage\";\nimport { DataPortSchemaObject } from \"@workglow/util\";\nimport { TaskGraph } from \"../task-graph/TaskGraph\";\nimport { createGraphFromGraphJSON } from \"../task/TaskJSON\";\nimport { TaskGraphRepository } from \"./TaskGraphRepository\";\n\nexport const TaskGraphSchema = {\n type: \"object\",\n properties: {\n key: { type: \"string\" },\n value: { type: \"string\" },\n },\n additionalProperties: false,\n} satisfies DataPortSchemaObject;\n\nexport const TaskGraphPrimaryKeyNames = [\"key\"] as const;\n\n/**\n * Options for the TaskGraphRepository\n */\nexport type TaskGraphRepositoryStorage = BaseTabularStorage<\n typeof TaskGraphSchema,\n typeof TaskGraphPrimaryKeyNames\n>;\ntype TaskGraphRepositoryOptions = {\n tabularRepository: TaskGraphRepositoryStorage;\n};\n\n/**\n * Repository class for managing task graphs persistence and retrieval.\n * Provides functionality to save, load, and manipulate task graphs with their associated tasks and data flows.\n */\nexport class TaskGraphTabularRepository extends TaskGraphRepository {\n /**\n * The type of the repository\n */\n public type = \"TaskGraphTabularRepository\";\n\n /**\n * The tabular repository for the task graphs\n */\n tabularRepository: TaskGraphRepositoryStorage;\n\n /**\n * Constructor for the TaskGraphRepository\n * @param options The options for the repository\n */\n constructor({ tabularRepository }: TaskGraphRepositoryOptions) {\n super();\n this.tabularRepository = tabularRepository;\n }\n\n /**\n * Sets up the database for the repository.\n * Must be called before using any other methods.\n */\n async setupDatabase(): Promise<void> {\n await this.tabularRepository.setupDatabase?.();\n }\n\n /**\n * Saves a task graph to persistent storage\n * @param key The unique identifier for the task graph\n * @param output The task graph to save\n * @emits graph_saved when the operation completes\n */\n async saveTaskGraph(key: string, output: TaskGraph): Promise<void> {\n const value = JSON.stringify(output.toJSON());\n await this.tabularRepository.put({ key, value });\n this.emit(\"graph_saved\", key);\n }\n\n /**\n * Retrieves a task graph from persistent storage\n * @param key The unique identifier of the task graph to retrieve\n * @returns The retrieved task graph, or undefined if not found\n * @emits graph_retrieved when the operation completes successfully\n */\n async getTaskGraph(key: string): Promise<TaskGraph | undefined> {\n const result = await this.tabularRepository.get({ key });\n const value = result?.value;\n if (!value) {\n return undefined;\n }\n const jsonObj = JSON.parse(value);\n const graph = createGraphFromGraphJSON(jsonObj);\n\n this.emit(\"graph_retrieved\", key);\n return graph;\n }\n\n /**\n * Clears all task graphs from the repository\n * @emits graph_cleared when the operation completes\n */\n async clear(): Promise<void> {\n await this.tabularRepository.deleteAll();\n this.emit(\"graph_cleared\");\n }\n\n /**\n * Returns the number of task graphs stored in the repository\n * @returns The count of stored task graphs\n */\n async size(): Promise<number> {\n return await this.tabularRepository.size();\n }\n}\n",
38
38
  "/**\n * @license\n * Copyright 2025 Steven Roussey <sroussey@gmail.com>\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { type BaseTabularStorage } from \"@workglow/storage\";\nimport { compress, DataPortSchemaObject, decompress, makeFingerprint } from \"@workglow/util\";\nimport { TaskInput, TaskOutput } from \"../task/TaskTypes\";\nimport { TaskOutputRepository } from \"./TaskOutputRepository\";\n\nexport type TaskOutputPrimaryKey = {\n key: string;\n taskType: string;\n};\n\nexport const TaskOutputSchema = {\n type: \"object\",\n properties: {\n key: { type: \"string\" },\n taskType: { type: \"string\" },\n value: { type: \"string\", contentEncoding: \"blob\" },\n createdAt: { type: \"string\", format: \"date-time\" },\n },\n additionalProperties: false,\n} satisfies DataPortSchemaObject;\n\nexport const TaskOutputPrimaryKeyNames = [\"key\", \"taskType\"] as const;\n\nexport type TaskOutputRepositoryStorage = BaseTabularStorage<\n typeof TaskOutputSchema,\n typeof TaskOutputPrimaryKeyNames\n>;\n\nexport type TaskOutputRepositoryOptions = {\n tabularRepository: TaskOutputRepositoryStorage;\n outputCompression?: boolean;\n};\n\n/**\n * Abstract class for managing task outputs in a repository\n * Provides methods for saving, retrieving, and clearing task outputs\n */\nexport class TaskOutputTabularRepository extends TaskOutputRepository {\n /**\n * The tabular repository for the task outputs\n */\n tabularRepository: TaskOutputRepositoryStorage;\n\n /**\n * Constructor for the TaskOutputTabularRepository\n * @param options The options for the repository\n */\n constructor({ tabularRepository, outputCompression = true }: TaskOutputRepositoryOptions) {\n super({ outputCompression });\n this.tabularRepository = tabularRepository;\n this.outputCompression = outputCompression;\n }\n\n /**\n * Sets up the database for the repository.\n * Must be called before using any other methods.\n */\n async setupDatabase(): Promise<void> {\n await this.tabularRepository.setupDatabase?.();\n }\n\n public async keyFromInputs(inputs: TaskInput): Promise<string> {\n return await makeFingerprint(inputs);\n }\n\n /**\n * Saves a task output to the repository\n * @param taskType The type of task to save the output for\n * @param inputs The input parameters for the task\n * @param output The task output to save\n */\n async saveOutput(\n taskType: string,\n inputs: TaskInput,\n output: TaskOutput,\n createdAt = new Date() // for testing purposes\n ): Promise<void> {\n const key = await this.keyFromInputs(inputs);\n const value = JSON.stringify(output);\n if (this.outputCompression) {\n const compressedValue = await compress(value);\n await this.tabularRepository.put({\n taskType,\n key,\n // contentEncoding: \"blob\" allows Uint8Array despite schema type being \"string\"\n value: compressedValue as unknown as string,\n createdAt: createdAt.toISOString(),\n });\n } else {\n const valueBuffer = Buffer.from(value);\n await this.tabularRepository.put({\n taskType,\n key,\n // contentEncoding: \"blob\" allows Buffer/Uint8Array despite schema type being \"string\"\n value: valueBuffer as unknown as string,\n createdAt: createdAt.toISOString(),\n });\n }\n this.emit(\"output_saved\", taskType);\n }\n\n /**\n * Retrieves a task output from the repository\n * @param taskType The type of task to retrieve the output for\n * @param inputs The input parameters for the task\n * @returns The retrieved task output, or undefined if not found\n */\n async getOutput(taskType: string, inputs: TaskInput): Promise<TaskOutput | undefined> {\n const key = await this.keyFromInputs(inputs);\n const output = await this.tabularRepository.get({ key, taskType });\n this.emit(\"output_retrieved\", taskType);\n if (output?.value) {\n if (this.outputCompression) {\n // Coerce JSON-serialized binary (from filesystem JSON store) back to Uint8Array\n const raw: unknown = output.value as unknown;\n const bytes: Uint8Array =\n raw instanceof Uint8Array\n ? raw\n : Array.isArray(raw)\n ? new Uint8Array(raw as number[])\n : raw && typeof raw === \"object\"\n ? new Uint8Array(\n Object.keys(raw as Record<string, number>)\n .filter((k) => /^\\d+$/.test(k))\n .sort((a, b) => Number(a) - Number(b))\n .map((k) => (raw as Record<string, number>)[k])\n )\n : new Uint8Array();\n const decompressedValue = await decompress(bytes);\n const value = JSON.parse(decompressedValue) as TaskOutput;\n return value as TaskOutput;\n } else {\n const stringValue = output.value.toString();\n const value = JSON.parse(stringValue) as TaskOutput;\n return value as TaskOutput;\n }\n } else {\n return undefined;\n }\n }\n\n /**\n * Clears all task outputs from the repository\n * @emits output_cleared when the operation completes\n */\n async clear(): Promise<void> {\n await this.tabularRepository.deleteAll();\n this.emit(\"output_cleared\");\n }\n\n /**\n * Returns the number of task outputs stored in the repository\n * @returns The count of stored task outputs\n */\n async size(): Promise<number> {\n return await this.tabularRepository.size();\n }\n\n /**\n * Clear all task outputs from the repository that are older than the given date\n * @param olderThanInMs The time in milliseconds to clear task outputs older than\n */\n async clearOlderThan(olderThanInMs: number): Promise<void> {\n const date = new Date(Date.now() - olderThanInMs).toISOString();\n await this.tabularRepository.deleteSearch({ createdAt: { value: date, operator: \"<\" } });\n this.emit(\"output_pruned\");\n }\n}\n"
39
39
  ],
40
- "mappings": ";AAMA;;;ACqBO,IAAM,aAAa;AAAA,EAExB,SAAS;AAAA,EAET,UAAU;AAAA,EAEV,YAAY;AAAA,EAEZ,WAAW;AAAA,EAEX,WAAW;AAAA,EAEX,UAAU;AAAA,EAEV,QAAQ;AACV;AA6CO,IAAM,mBAAmB;AAAA,EAC9B,MAAM;AAAA,EACN,YAAY;AAAA,IACV,IAAI,CAAC;AAAA,IACL,OAAO,EAAE,MAAM,SAAS;AAAA,IACxB,aAAa,EAAE,MAAM,SAAS;AAAA,IAC9B,WAAW,EAAE,MAAM,UAAU;AAAA,IAC7B,aAAa,EAAE,MAAM,UAAU,YAAY,CAAC,GAAG,sBAAsB,KAAK;AAAA,IAC1E,cAAc,EAAE,MAAM,UAAU,YAAY,CAAC,GAAG,sBAAsB,KAAK;AAAA,IAC3E,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,sBAAsB;AAAA,IACxB;AAAA,EACF;AAAA,EACA,sBAAsB;AACxB;;;ADjFO,IAAM,qBAAqB;AAC3B,IAAM,sBAAsB;AAAA;AAK5B,MAAM,S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