{"version":3,"sources":["../src/engine/SignalBroker.ts","../src/engine/GraphRunner.ts","../src/engine/GraphRun.ts","../src/utils/ColorRandomizer.ts","../src/engine/exporters/vue-flow/VueFlowExportVisitor.ts","../src/engine/exporters/vue-flow/VueFlowExporter.ts","../src/graph/execution/GraphNode.ts","../src/graph/context/GraphContext.ts","../src/utils/tools.ts","../src/graph/iterators/GraphNodeIterator.ts","../src/interfaces/SignalEmitter.ts","../src/graph/definition/GraphRoutine.ts","../src/interfaces/SignalParticipant.ts","../src/graph/definition/Task.ts","../src/graph/iterators/TaskIterator.ts","../src/registry/GraphRegistry.ts","../src/graph/definition/DebounceTask.ts","../src/graph/definition/EphemeralTask.ts","../src/interfaces/ExecutionChain.ts","../src/graph/iterators/GraphLayerIterator.ts","../src/interfaces/GraphLayer.ts","../src/graph/execution/SyncGraphLayer.ts","../src/interfaces/GraphBuilder.ts","../src/engine/builders/GraphBreadthFirstBuilder.ts","../src/interfaces/GraphRunStrategy.ts","../src/utils/promise.ts","../src/engine/ThrottleEngine.ts","../src/graph/execution/AsyncGraphLayer.ts","../src/engine/builders/GraphAsyncQueueBuilder.ts","../src/engine/strategy/GraphAsyncRun.ts","../src/engine/strategy/GraphStandardRun.ts","../src/Cadenza.ts","../src/graph/definition/SignalTask.ts","../src/index.ts"],"sourcesContent":["import GraphRunner from \"./GraphRunner\";\nimport { AnyObject } from \"../types/global\";\nimport Task from \"../graph/definition/Task\";\nimport GraphRoutine from \"../graph/definition/GraphRoutine\";\nimport Cadenza from \"../Cadenza\";\n\nexport default class SignalBroker {\n  private static instance_: SignalBroker;\n\n  /**\n   * Singleton instance for signal management.\n   * @returns The broker instance.\n   */\n  static get instance(): SignalBroker {\n    if (!this.instance_) {\n      this.instance_ = new SignalBroker();\n    }\n    return this.instance_;\n  }\n\n  private debug: boolean = false;\n\n  setDebug(value: boolean) {\n    this.debug = value;\n  }\n\n  protected sanitizeSignalName(signalName: string) {\n    if (signalName.length > 100) {\n      throw new Error(\"Signal name must be less than 100 characters\");\n    }\n\n    if (signalName.includes(\" \")) {\n      throw new Error(\"Signal name must not contain spaces\");\n    }\n\n    if (signalName.includes(\"\\\\\")) {\n      throw new Error(\"Signal name must not contain backslashes\");\n    }\n\n    if (/[A-Z]/.test(signalName.split(\".\").slice(1).join(\".\"))) {\n      throw new Error(\n        \"Signal name must not contain uppercase letters in the middle of the signal name. It is only allowed in the first part of the signal name.\",\n      );\n    }\n  }\n\n  protected runner: GraphRunner | undefined;\n  protected metaRunner: GraphRunner | undefined;\n\n  public getSignalsTask: Task | undefined;\n\n  protected signalObservers: Map<\n    string,\n    {\n      fn: (\n        runner: GraphRunner,\n        tasks: (Task | GraphRoutine)[],\n        context: AnyObject,\n      ) => void;\n      tasks: Set<Task | GraphRoutine>;\n    }\n  > = new Map();\n\n  protected emitStacks: Map<string, Map<string, AnyObject>> = new Map(); // execId -> emitted signals\n\n  protected constructor() {\n    this.addSignal(\"meta.signal_broker.added\");\n  }\n\n  /**\n   * Initializes with runners.\n   * @param runner Standard runner for user signals.\n   * @param metaRunner Meta runner for 'meta.' signals (suppresses further meta-emits).\n   */\n  bootstrap(runner: GraphRunner, metaRunner: GraphRunner): void {\n    this.runner = runner;\n    this.metaRunner = metaRunner;\n  }\n\n  init() {\n    Cadenza.createDebounceMetaTask(\n      \"Execute and clear queued signals\",\n      () => {\n        for (const [id, signals] of this.emitStacks.entries()) {\n          signals.forEach((context, signal) => {\n            this.execute(signal, context);\n            signals.delete(signal);\n          });\n\n          this.emitStacks.delete(id);\n        }\n        return true;\n      },\n      \"Executes queued signals and clears the stack\",\n      500,\n      { maxWait: 10000 },\n    ).doOn(\"meta.process_signal_queue_requested\");\n\n    this.getSignalsTask = Cadenza.createMetaTask(\"Get signals\", (ctx) => {\n      return {\n        __signals: Array.from(this.signalObservers.keys()),\n        ...ctx,\n      };\n    });\n  }\n\n  /**\n   * Observes a signal with a routine/task.\n   * @param signal The signal (e.g., 'domain.action', 'domain.*' for wildcards).\n   * @param routineOrTask The observer.\n   * @edge Duplicates ignored; supports wildcards for broad listening.\n   */\n  observe(signal: string, routineOrTask: Task | GraphRoutine): void {\n    this.addSignal(signal);\n    this.signalObservers.get(signal)!.tasks.add(routineOrTask);\n  }\n\n  /**\n   * Unsubscribes a routine/task from a signal.\n   * @param signal The signal.\n   * @param routineOrTask The observer.\n   * @edge Removes all instances if duplicate; deletes if empty.\n   */\n  unsubscribe(signal: string, routineOrTask: Task | GraphRoutine): void {\n    const obs = this.signalObservers.get(signal);\n    if (obs) {\n      obs.tasks.delete(routineOrTask);\n      if (obs.tasks.size === 0) {\n        this.signalObservers.delete(signal);\n      }\n    }\n  }\n\n  /**\n   * Emits a signal and bubbles to matching wildcards/parents (e.g., 'a.b.action' triggers 'a.b.action', 'a.b.*', 'a.*').\n   * @param signal The signal name.\n   * @param context The payload.\n   * @edge Fire-and-forget; guards against loops per execId (from context.__graphExecId).\n   * @edge For distribution, SignalTask can prefix and proxy remote.\n   */\n  emit(signal: string, context: AnyObject = {}): void {\n    const execId = context.__routineExecId || \"global\"; // Assume from metadata\n    if (!this.emitStacks.has(execId)) this.emitStacks.set(execId, new Map());\n\n    const stack = this.emitStacks.get(execId)!;\n    stack.set(signal, context);\n\n    let executed = false;\n    try {\n      executed = this.execute(signal, context);\n    } finally {\n      if (executed) stack.delete(signal);\n      if (stack.size === 0) this.emitStacks.delete(execId);\n    }\n  }\n\n  execute(signal: string, context: AnyObject): boolean {\n    let executed;\n    executed = this.executeListener(signal, context); // Exact signal\n\n    const parts = signal\n      .slice(0, Math.max(signal.lastIndexOf(\":\"), signal.lastIndexOf(\".\")))\n      .split(\".\");\n    for (let i = parts.length; i > 0; i--) {\n      const parent = parts.slice(0, i).join(\".\");\n      executed = executed || this.executeListener(parent + \".*\", context); // Wildcard\n    }\n\n    if (this.debug) {\n      console.log(\n        `Emitted signal ${signal} with context ${JSON.stringify(context)}`,\n        executed ? \"✅\" : \"❌\",\n      );\n      // TODO\n    }\n\n    return executed;\n  }\n\n  private executeListener(signal: string, context: AnyObject): boolean {\n    const obs = this.signalObservers.get(signal);\n    const runner = signal.startsWith(\"meta\") ? this.metaRunner : this.runner;\n    if (obs && obs.tasks.size && runner) {\n      obs.fn(runner, Array.from(obs.tasks), context);\n      return true;\n    }\n    return false;\n  }\n\n  private addSignal(signal: string): void {\n    if (!this.signalObservers.has(signal)) {\n      this.sanitizeSignalName(signal);\n      this.signalObservers.set(signal, {\n        fn: (\n          runner: GraphRunner,\n          tasks: (Task | GraphRoutine)[],\n          context: AnyObject,\n        ) => runner.run(tasks, context),\n        tasks: new Set(),\n      });\n\n      this.emit(\"meta.signal_broker.added\", { __signalName: signal });\n    }\n  }\n\n  // TODO schedule signals\n\n  /**\n   * Lists all observed signals.\n   * @returns Array of signals.\n   */\n  listObservedSignals(): string[] {\n    return Array.from(this.signalObservers.keys());\n  }\n\n  reset() {\n    this.emitStacks.clear();\n    this.signalObservers.clear();\n  }\n}\n","import { v4 as uuid } from \"uuid\";\nimport Task from \"../graph/definition/Task\";\nimport GraphRun from \"./GraphRun\";\nimport GraphNode from \"../graph/execution/GraphNode\";\nimport GraphRunStrategy from \"../interfaces/GraphRunStrategy\";\nimport { AnyObject } from \"../types/global\";\nimport GraphRoutine from \"../graph/definition/GraphRoutine\";\nimport SignalEmitter from \"../interfaces/SignalEmitter\";\nimport Cadenza from \"../Cadenza\";\nimport GraphRegistry from \"../registry/GraphRegistry\";\nimport GraphContext from \"../graph/context/GraphContext\";\n\nexport default class GraphRunner extends SignalEmitter {\n  readonly id: string;\n  protected currentRun: GraphRun;\n  private debug: boolean = false;\n  protected isRunning: boolean = false;\n  private readonly isMeta: boolean = false;\n\n  protected strategy: GraphRunStrategy;\n\n  /**\n   * Constructs a runner.\n   * @param isMeta Meta flag (default false).\n   * @edge Creates 'Start run' meta-task chained to registry gets.\n   */\n  constructor(isMeta: boolean = false) {\n    super(isMeta);\n    this.id = uuid();\n    this.isMeta = isMeta;\n    this.strategy = Cadenza.runStrategy.PARALLEL;\n    this.currentRun = new GraphRun(this.strategy);\n  }\n\n  init() {\n    if (this.isMeta) return;\n\n    Cadenza.createMetaTask(\n      \"Start run\",\n      this.startRun.bind(this),\n      \"Starts a run\",\n    ).doAfter(\n      GraphRegistry.instance.getTaskByName,\n      GraphRegistry.instance.getRoutineByName,\n    );\n  }\n\n  /**\n   * Adds tasks/routines to current run.\n   * @param tasks Tasks/routines.\n   * @param context Context (defaults {}).\n   * @edge Flattens routines to tasks; generates routineExecId if not in context.\n   * @edge Emits 'meta.runner.added_tasks' with metadata.\n   * @edge Empty tasks warns no-op.\n   */\n  protected addTasks(\n    tasks: Task | GraphRoutine | (Task | GraphRoutine)[],\n    context: AnyObject = {},\n  ): void {\n    let _tasks = Array.isArray(tasks) ? tasks : [tasks];\n    if (_tasks.length === 0) {\n      console.warn(\"No tasks/routines to add.\");\n      return;\n    }\n\n    let routineName = _tasks.map((t) => t.name).join(\" | \");\n    let isMeta = _tasks.every((t) => t.isMeta);\n    let routineId = null;\n\n    const allTasks = _tasks.flatMap((t) => {\n      if (t instanceof GraphRoutine) {\n        routineName = t.name;\n        isMeta = t.isMeta;\n        routineId = t.id;\n        const routineTasks: Task[] = [];\n        t.forEachTask((task: Task) => routineTasks.push(task));\n        return routineTasks;\n      }\n      return t;\n    });\n\n    const ctx = new GraphContext(context || {});\n\n    const routineExecId = context.__routineExecId ?? uuid();\n    context.__routineExecId = routineExecId;\n\n    const data = {\n      __routineExecId: routineExecId,\n      __routineName: routineName,\n      __isMeta: isMeta,\n      __routineId: routineId,\n      __context: ctx.export(),\n      __previousRoutineExecution: context.__metaData?.__routineExecId ?? null,\n      __contractId:\n        context.__metaData?.__contractId ?? context.__contractId ?? null,\n      __task: {\n        __name: routineName,\n      },\n      __scheduled: Date.now(),\n    };\n\n    this.emit(\"meta.runner.added_tasks\", data);\n\n    allTasks.forEach((task) =>\n      this.currentRun.addNode(\n        new GraphNode(task, ctx, routineExecId, [], this.debug),\n      ),\n    );\n  }\n\n  /**\n   * Runs tasks/routines.\n   * @param tasks Optional tasks/routines.\n   * @param context Optional context.\n   * @returns Current/last run (Promise if async).\n   * @edge If running, returns current; else runs and resets.\n   */\n  public run(\n    tasks?: Task | GraphRoutine | (Task | GraphRoutine)[],\n    context?: AnyObject,\n  ): GraphRun | Promise<GraphRun> {\n    if (tasks) {\n      this.addTasks(tasks, context ?? {});\n    }\n\n    if (this.isRunning) {\n      return this.currentRun;\n    }\n\n    if (this.currentRun) {\n      this.isRunning = true;\n      const runResult = this.currentRun.run();\n\n      if (runResult instanceof Promise) {\n        return this.runAsync(runResult);\n      }\n    }\n\n    return this.reset();\n  }\n\n  private async runAsync(run: Promise<void>): Promise<GraphRun> {\n    await run;\n    return this.reset();\n  }\n\n  protected reset(): GraphRun {\n    this.isRunning = false;\n\n    const lastRun = this.currentRun;\n\n    if (!this.debug) {\n      this.destroy();\n    }\n\n    this.currentRun = new GraphRun(this.strategy);\n\n    return lastRun;\n  }\n\n  public setDebug(value: boolean): void {\n    this.debug = value;\n  }\n\n  public destroy(): void {\n    this.currentRun.destroy();\n  }\n\n  public setStrategy(strategy: GraphRunStrategy): void {\n    this.strategy = strategy;\n    if (!this.isRunning) {\n      this.currentRun = new GraphRun(this.strategy);\n    }\n  }\n\n  private startRun(context: AnyObject): boolean {\n    if (context.__task || context.__routine) {\n      const routine = context.__task ?? context.__routine;\n      this.run(routine, context);\n      return true;\n    } else {\n      context.errored = true;\n      context.__error = \"No routine or task defined.\";\n      return false;\n    }\n  }\n}\n","import { v4 as uuid } from \"uuid\";\nimport GraphNode from \"../graph/execution/GraphNode\";\nimport GraphExporter from \"../interfaces/GraphExporter\";\nimport SyncGraphLayer from \"../graph/execution/SyncGraphLayer\";\nimport GraphRunStrategy from \"../interfaces/GraphRunStrategy\";\nimport GraphLayer from \"../interfaces/GraphLayer\";\nimport VueFlowExporter from \"./exporters/vue-flow/VueFlowExporter\";\n\nexport interface RunJson {\n  __id: string;\n  __label: string;\n  __graph: any;\n  __data: any;\n}\n\n// A unique execution of the graph\nexport default class GraphRun {\n  readonly id: string;\n  private graph: GraphLayer | undefined;\n  // @ts-ignore\n  private strategy: GraphRunStrategy;\n  private exporter: GraphExporter | undefined;\n\n  constructor(strategy: GraphRunStrategy) {\n    this.id = uuid();\n    this.strategy = strategy;\n    this.strategy.setRunInstance(this);\n    this.exporter = new VueFlowExporter();\n  }\n\n  setGraph(graph: GraphLayer) {\n    this.graph = graph;\n  }\n\n  addNode(node: GraphNode) {\n    this.strategy.addNode(node);\n  }\n\n  // Composite function / Command execution\n  run(): void | Promise<void> {\n    return this.strategy.run();\n  }\n\n  // Composite function\n  destroy() {\n    this.graph?.destroy();\n    this.graph = undefined;\n    this.exporter = undefined;\n  }\n\n  // Composite function\n  log() {\n    console.log(\"vvvvvvvvvvvvvvvvv\");\n    console.log(\"GraphRun\");\n    console.log(\"vvvvvvvvvvvvvvvvv\");\n    this.graph?.log();\n    console.log(\"=================\");\n  }\n\n  // Memento\n  export(): RunJson {\n    if (this.exporter && this.graph) {\n      const data = this.strategy.export();\n      return {\n        __id: this.id,\n        __label: data.__startTime ?? this.id,\n        __graph: this.exporter?.exportGraph(this.graph as SyncGraphLayer),\n        __data: data,\n      };\n    }\n\n    return {\n      __id: this.id,\n      __label: this.id,\n      __graph: undefined,\n      __data: {},\n    };\n  }\n\n  // Export Strategy\n  setExporter(exporter: GraphExporter) {\n    this.exporter = exporter;\n  }\n}\n","export default class ColorRandomizer {\n  numberOfSteps: number;\n  stepCounter = 0;\n  spread: number;\n  range: number;\n\n  constructor(numberOfSteps: number = 200, spread: number = 30) {\n    this.numberOfSteps = numberOfSteps;\n    this.spread = spread;\n    this.range = Math.floor(numberOfSteps / this.spread);\n  }\n\n  private rainbow(numOfSteps: number, step: number) {\n    // This function generates vibrant, \"evenly spaced\" colours (i.e. no clustering). This is ideal for creating easily distinguishable vibrant markers in Google Maps and other apps.\n    // Adam Cole, 2011-Sept-14\n    // HSV to RBG adapted from: http://mjijackson.com/2008/02/rgb-to-hsl-and-rgb-to-hsv-color-model-conversion-algorithms-in-javascript\n    let r, g, b;\n    const h = step / numOfSteps;\n    const i = ~~(h * 6);\n    const f = h * 6 - i;\n    const q = 1 - f;\n    switch (i % 6) {\n      case 0:\n        r = 1;\n        g = f;\n        b = 0;\n        break;\n      case 1:\n        r = q;\n        g = 1;\n        b = 0;\n        break;\n      case 2:\n        r = 0;\n        g = 1;\n        b = f;\n        break;\n      case 3:\n        r = 0;\n        g = q;\n        b = 1;\n        break;\n      case 4:\n        r = f;\n        g = 0;\n        b = 1;\n        break;\n      case 5:\n        r = 1;\n        g = 0;\n        b = q;\n        break;\n      default:\n        r = 0;\n        g = 0;\n        b = 0;\n        break;\n    }\n    // @ts-ignore\n    const c =\n      \"#\" +\n      (\"00\" + (~~(r * 255)).toString(16)).slice(-2) +\n      (\"00\" + (~~(g * 255)).toString(16)).slice(-2) +\n      (\"00\" + (~~(b * 255)).toString(16)).slice(-2);\n    return c;\n  }\n\n  getRandomColor() {\n    this.stepCounter++;\n\n    if (this.stepCounter > this.numberOfSteps) {\n      this.stepCounter = 1;\n    }\n\n    const randomStep =\n      ((this.stepCounter * this.range) % this.numberOfSteps) -\n      this.range +\n      Math.floor(this.stepCounter / this.spread);\n\n    return this.rainbow(this.numberOfSteps, randomStep);\n  }\n}\n","import GraphVisitor from \"../../../interfaces/GraphVisitor\";\nimport SyncGraphLayer from \"../../../graph/execution/SyncGraphLayer\";\nimport GraphNode from \"../../../graph/execution/GraphNode\";\nimport Task from \"../../../graph/definition/Task\";\nimport ColorRandomizer from \"../../../utils/ColorRandomizer\";\n\nexport default class VueFlowExportVisitor implements GraphVisitor {\n  private nodeCount = 0;\n  private elements: any[] = [];\n  private index = 0;\n  private numberOfLayerNodes = 0;\n  private contextToColor: { [id: string]: string } = {};\n  private colorRandomizer = new ColorRandomizer();\n\n  visitLayer(layer: SyncGraphLayer): any {\n    const snapshot = layer.export();\n\n    this.numberOfLayerNodes = snapshot.__numberOfNodes;\n    this.index = 0;\n  }\n\n  visitNode(node: GraphNode): any {\n    const snapshot = node.export();\n\n    if (!this.contextToColor[snapshot.__context.__id]) {\n      this.contextToColor[snapshot.__context.__id] =\n        this.colorRandomizer.getRandomColor();\n    }\n\n    const color = this.contextToColor[snapshot.__context.__id];\n\n    this.elements.push({\n      id: snapshot.__id.slice(0, 8),\n      label: snapshot.__task.__name,\n      position: {\n        x: snapshot.__task.__layerIndex * 500,\n        y: -50 * this.numberOfLayerNodes * 0.5 + (this.index * 60 + 30),\n      },\n      sourcePosition: \"right\",\n      targetPosition: \"left\",\n      style: { backgroundColor: `${color}`, width: \"180px\" },\n      data: {\n        executionTime: snapshot.__executionTime,\n        executionStart: snapshot.__executionStart,\n        executionEnd: snapshot.__executionEnd,\n        description: snapshot.__task.__description,\n        functionString: snapshot.__task.__functionString,\n        context: snapshot.__context.__context,\n        layerIndex: snapshot.__task.__layerIndex,\n      },\n    });\n\n    for (const [index, nextNodeId] of snapshot.__nextNodes.entries()) {\n      this.elements.push({\n        id: `${snapshot.__id.slice(0, 8)}-${index}`,\n        source: snapshot.__id.slice(0, 8),\n        target: nextNodeId.slice(0, 8),\n      });\n    }\n\n    this.index++;\n    this.nodeCount++;\n  }\n\n  visitTask(task: Task) {\n    const snapshot = task.export();\n\n    this.elements.push({\n      id: snapshot.__id.slice(0, 8),\n      label: snapshot.__name,\n      position: { x: snapshot.__layerIndex * 300, y: this.index * 50 + 30 },\n      sourcePosition: \"right\",\n      targetPosition: \"left\",\n      data: {\n        description: snapshot.__description,\n        functionString: snapshot.__functionString,\n        layerIndex: snapshot.__layerIndex,\n      },\n    });\n\n    for (const [index, nextTaskId] of snapshot.__nextTasks.entries()) {\n      this.elements.push({\n        id: `${snapshot.__id.slice(0, 8)}-${index}`,\n        source: snapshot.__id.slice(0, 8),\n        target: nextTaskId.slice(0, 8),\n      });\n    }\n\n    this.index++;\n    this.nodeCount++;\n  }\n\n  getElements() {\n    return this.elements;\n  }\n\n  getNodeCount() {\n    return this.nodeCount;\n  }\n}\n","import GraphExporter from \"../../../interfaces/GraphExporter\";\nimport SyncGraphLayer from \"../../../graph/execution/SyncGraphLayer\";\nimport VueFlowExportVisitor from \"./VueFlowExportVisitor\";\nimport Task from \"../../../graph/definition/Task\";\n\nexport default class VueFlowExporter implements GraphExporter {\n  exportGraph(graph: SyncGraphLayer): any {\n    const exporterVisitor = new VueFlowExportVisitor();\n    const layers = graph.getIterator();\n    while (layers.hasNext()) {\n      const layer = layers.next();\n      layer.accept(exporterVisitor);\n    }\n\n    return {\n      elements: exporterVisitor.getElements(),\n      numberOfNodes: exporterVisitor.getNodeCount(),\n    };\n  }\n\n  exportStaticGraph(graph: Task[]) {\n    const exporterVisitor = new VueFlowExportVisitor();\n\n    let prevTask = null;\n    for (const task of graph) {\n      if (task === prevTask) {\n        continue;\n      }\n\n      const tasks = task.getIterator();\n      const exportedTaskIds: string[] = [];\n\n      while (tasks.hasNext()) {\n        const task = tasks.next();\n        if (task && !exportedTaskIds.includes(task.id)) {\n          exportedTaskIds.push(task.id);\n          task.accept(exporterVisitor);\n        }\n      }\n\n      prevTask = task;\n    }\n\n    return {\n      elements: exporterVisitor.getElements(),\n      numberOfNodes: exporterVisitor.getNodeCount(),\n    };\n  }\n}\n","import { v4 as uuid } from \"uuid\";\nimport Task from \"../definition/Task\";\nimport GraphContext from \"../context/GraphContext\";\nimport Graph from \"../../interfaces/Graph\";\nimport GraphVisitor from \"../../interfaces/GraphVisitor\";\nimport GraphNodeIterator from \"../iterators/GraphNodeIterator\";\nimport SignalEmitter from \"../../interfaces/SignalEmitter\";\nimport GraphLayer from \"../../interfaces/GraphLayer\";\nimport { AnyObject } from \"../../types/global\";\n\nexport default class GraphNode extends SignalEmitter implements Graph {\n  id: string;\n  routineExecId: string;\n  private task: Task;\n  private context: GraphContext;\n  private layer: GraphLayer | undefined;\n  private divided: boolean = false;\n  private splitGroupId: string = \"\";\n  private processing: boolean = false;\n  private subgraphComplete: boolean = false;\n  private graphComplete: boolean = false;\n  private result: unknown;\n  private previousNodes: GraphNode[] = [];\n  private nextNodes: GraphNode[] = [];\n  private executionTime: number = 0;\n  private executionStart: number = 0;\n  private failed: boolean = false;\n  private errored: boolean = false;\n  destroyed: boolean = false;\n  protected debug: boolean = false;\n\n  constructor(\n    task: Task,\n    context: GraphContext,\n    routineExecId: string,\n    prevNodes: GraphNode[] = [],\n    debug: boolean = false,\n  ) {\n    super(task.isMeta);\n    this.task = task;\n    this.context = context;\n    this.previousNodes = prevNodes;\n    this.id = uuid();\n    this.routineExecId = routineExecId;\n    this.splitGroupId = routineExecId;\n    this.debug = debug;\n  }\n\n  setDebug(value: boolean) {\n    this.debug = value;\n  }\n\n  public isUnique() {\n    return this.task.isUnique;\n  }\n\n  public isMeta() {\n    return this.task.isMeta;\n  }\n\n  public isProcessed() {\n    return this.divided;\n  }\n\n  public isProcessing() {\n    return this.processing;\n  }\n\n  public subgraphDone() {\n    return this.subgraphComplete;\n  }\n\n  public graphDone() {\n    return this.graphComplete;\n  }\n\n  public isEqualTo(node: GraphNode) {\n    return (\n      this.sharesTaskWith(node) &&\n      this.sharesContextWith(node) &&\n      this.isPartOfSameGraph(node)\n    );\n  }\n\n  public isPartOfSameGraph(node: GraphNode) {\n    return this.routineExecId === node.routineExecId;\n  }\n\n  public sharesTaskWith(node: GraphNode) {\n    return this.task.id === node.task.id;\n  }\n\n  public sharesContextWith(node: GraphNode) {\n    return this.context.id === node.context.id;\n  }\n\n  public getLayerIndex() {\n    return this.task.layerIndex;\n  }\n\n  public getConcurrency() {\n    return this.task.concurrency;\n  }\n\n  public getTag() {\n    return this.task.getTag(this.context);\n  }\n\n  public scheduleOn(layer: GraphLayer) {\n    let shouldSchedule = true;\n    const nodes = layer.getNodesByRoutineExecId(this.routineExecId);\n    for (const node of nodes) {\n      if (node.isEqualTo(this)) {\n        shouldSchedule = false;\n        break;\n      }\n\n      if (node.sharesTaskWith(this) && node.isUnique()) {\n        node.consume(this);\n        shouldSchedule = false;\n        break;\n      }\n    }\n\n    if (shouldSchedule) {\n      this.layer = layer;\n      layer.add(this);\n      this.emit(\"meta.node.scheduled\", {\n        ...this.lightExport(),\n        __scheduled: Date.now(),\n      });\n    }\n  }\n\n  public start() {\n    if (this.executionStart === 0) {\n      this.executionStart = Date.now();\n    }\n\n    const memento = this.lightExport();\n    if (this.previousNodes.length === 0) {\n      this.emit(\"meta.node.started_routine_execution\", memento);\n    }\n\n    if (this.debug) {\n      this.log();\n    }\n\n    this.emit(\"meta.node.started\", memento);\n\n    return this.executionStart;\n  }\n\n  public end() {\n    if (this.executionStart === 0) {\n      return 0;\n    }\n\n    this.processing = false;\n    const end = Date.now();\n    this.executionTime = end - this.executionStart;\n\n    const memento = this.lightExport();\n    if (this.errored || this.failed) {\n      this.emit(\"meta.node.errored\", memento);\n    }\n\n    this.emit(\"meta.node.ended\", memento);\n\n    if (this.graphDone()) {\n      // TODO Reminder, Service registry should be listening to this event, (updateSelf)\n      this.emit(\n        `meta.node.ended_routine_execution:${this.routineExecId}`,\n        memento,\n      );\n    }\n\n    return end;\n  }\n\n  public execute() {\n    if (!this.divided && !this.processing) {\n      this.processing = true;\n\n      const inputValidation = this.task.validateInput(\n        this.context.getContext(),\n      );\n      if (inputValidation !== true) {\n        this.onError(inputValidation.__validationErrors);\n        this.postProcess();\n        return this.nextNodes;\n      }\n\n      try {\n        this.result = this.work();\n      } catch (e: unknown) {\n        this.onError(e);\n      }\n\n      if (this.result instanceof Promise) {\n        return this.processAsync();\n      }\n\n      this.postProcess();\n    }\n\n    return this.nextNodes;\n  }\n\n  private async processAsync() {\n    try {\n      this.result = await this.result;\n    } catch (e: unknown) {\n      this.onError(e);\n    }\n\n    this.postProcess();\n\n    return this.nextNodes;\n  }\n\n  private work() {\n    return this.task.execute(this.context, this.onProgress.bind(this));\n  }\n\n  private onProgress(progress: number) {\n    progress = Math.min(Math.max(0, progress), 1);\n\n    this.emit(`meta.node.progress:${this.routineExecId}`, {\n      __nodeId: this.id,\n      __routineExecId: this.routineExecId,\n      __progress: progress,\n      __weight:\n        this.task.progressWeight /\n        (this.layer?.getNodesByRoutineExecId(this.routineExecId)?.length ?? 1),\n    });\n  }\n\n  private postProcess() {\n    if (typeof this.result === \"string\") {\n      this.onError(\n        `Returning strings is not allowed. Returned: ${this.result}`,\n      );\n    }\n\n    if (Array.isArray(this.result)) {\n      this.onError(`Returning arrays is not allowed. Returned: ${this.result}`);\n    }\n\n    this.nextNodes = this.divide();\n\n    if (this.nextNodes.length === 0) {\n      this.completeSubgraph();\n    }\n\n    if (this.errored || this.failed) {\n      this.task.emitOnFailSignals(this.context);\n    } else {\n      this.task.emitSignals(this.context);\n    }\n\n    this.end();\n  }\n\n  private onError(error: unknown, errorData: AnyObject = {}) {\n    this.result = {\n      ...this.context.getFullContext(),\n      __error: `Node error: ${error}`,\n      error: `Node error: ${error}`,\n      returnedValue: this.result,\n      ...errorData,\n    };\n    this.migrate(this.result);\n    this.errored = true;\n  }\n\n  private divide(): GraphNode[] {\n    const newNodes: GraphNode[] = [];\n\n    if (\n      (this.result as Generator)?.next &&\n      typeof (this.result as Generator).next === \"function\"\n    ) {\n      const generator = this.result as Generator;\n      let current = generator.next();\n      while (!current.done && current.value !== undefined) {\n        const outputValidation = this.task.validateOutput(current.value as any);\n        if (outputValidation !== true) {\n          this.onError(outputValidation.__validationErrors);\n          break;\n        } else {\n          newNodes.push(...this.generateNewNodes(current.value));\n          current = generator.next();\n        }\n      }\n    } else if (this.result !== undefined && !this.errored) {\n      newNodes.push(...this.generateNewNodes(this.result));\n\n      if (typeof this.result !== \"boolean\") {\n        const outputValidation = this.task.validateOutput(this.result as any);\n        if (outputValidation !== true) {\n          this.onError(outputValidation.__validationErrors);\n        }\n        this.migrate({ ...this.result, ...this.context.getMetaData() });\n      }\n    }\n\n    if (this.errored) {\n      newNodes.push(\n        ...this.task.mapNext(\n          (t: Task) =>\n            this.clone()\n              .split(uuid())\n              .differentiate(t)\n              .migrate({ ...(this.result as any) }),\n          true,\n        ),\n      );\n    }\n\n    this.divided = true;\n    this.migrate({\n      ...this.context.getFullContext(),\n      __nextNodes: newNodes.map((n) => n.id),\n    });\n\n    return newNodes;\n  }\n\n  private generateNewNodes(result: any) {\n    const groupId = uuid();\n    const newNodes = [];\n    if (typeof result !== \"boolean\") {\n      const failed =\n        (result.failed !== undefined && result.failed) ||\n        result.error !== undefined;\n      newNodes.push(\n        ...(this.task.mapNext((t: Task) => {\n          const context = t.isUnique\n            ? {\n                joinedContexts: [\n                  { ...result, taskName: this.task.name, __nodeId: this.id },\n                ],\n                ...this.context.getMetaData(),\n              }\n            : { ...result, ...this.context.getMetaData() };\n          return this.clone().split(groupId).differentiate(t).migrate(context);\n        }, failed) as GraphNode[]),\n      );\n\n      this.failed = failed;\n    } else {\n      const shouldContinue = result;\n      if (shouldContinue) {\n        newNodes.push(\n          ...(this.task.mapNext((t: Task) => {\n            const newNode = this.clone().split(groupId).differentiate(t);\n            if (t.isUnique) {\n              newNode.migrate({\n                joinedContexts: [\n                  {\n                    ...this.context.getContext(),\n                    taskName: this.task.name,\n                    __nodeId: this.id,\n                  },\n                ],\n                ...this.context.getMetaData(),\n              });\n            }\n\n            return newNode;\n          }) as GraphNode[]),\n        );\n      }\n    }\n\n    return newNodes;\n  }\n\n  private differentiate(task: Task): GraphNode {\n    this.task = task;\n    return this;\n  }\n\n  private migrate(ctx: any): GraphNode {\n    this.context = new GraphContext(ctx);\n    return this;\n  }\n\n  private split(id: string): GraphNode {\n    this.splitGroupId = id;\n    return this;\n  }\n\n  public clone(): GraphNode {\n    return new GraphNode(\n      this.task,\n      this.context,\n      this.routineExecId,\n      [this],\n      this.debug,\n    );\n  }\n\n  public consume(node: GraphNode) {\n    this.context = this.context.combine(node.context);\n    this.previousNodes = this.previousNodes.concat(node.previousNodes);\n    node.completeSubgraph();\n    node.changeIdentity(this.id);\n    node.destroy();\n  }\n\n  private changeIdentity(id: string) {\n    this.id = id;\n  }\n\n  private completeSubgraph() {\n    for (const node of this.nextNodes) {\n      if (!node.subgraphDone()) {\n        return;\n      }\n    }\n\n    this.subgraphComplete = true;\n\n    if (this.previousNodes.length === 0) {\n      this.completeGraph();\n      return;\n    }\n\n    this.previousNodes.forEach((n) => n.completeSubgraph());\n  }\n\n  private completeGraph() {\n    this.graphComplete = true;\n    this.nextNodes.forEach((n) => n.completeGraph());\n  }\n\n  public destroy() {\n    // @ts-ignore\n    this.context = null;\n    // @ts-ignore\n    this.task = null;\n    this.nextNodes = [];\n    this.previousNodes.forEach((n) =>\n      n.nextNodes.splice(n.nextNodes.indexOf(this), 1),\n    );\n    this.previousNodes = [];\n    this.result = undefined;\n    this.layer = undefined;\n    this.destroyed = true;\n  }\n\n  public getIterator() {\n    return new GraphNodeIterator(this);\n  }\n\n  public mapNext(callback: (node: GraphNode) => any) {\n    return this.nextNodes.map(callback);\n  }\n\n  public accept(visitor: GraphVisitor) {\n    visitor.visitNode(this);\n  }\n\n  public export() {\n    return {\n      __id: this.id,\n      __task: this.task.export(),\n      __context: this.context.export(),\n      __result: this.result,\n      __executionTime: this.executionTime,\n      __executionStart: this.executionStart,\n      __executionEnd: this.executionStart + this.executionTime,\n      __nextNodes: this.nextNodes.map((node) => node.id),\n      __previousNodes: this.previousNodes.map((node) => node.id),\n      __routineExecId: this.routineExecId,\n      __isProcessing: this.processing,\n      __isMeta: this.isMeta(),\n      __graphComplete: this.graphComplete,\n      __failed: this.failed,\n      __errored: this.errored,\n      __isUnique: this.isUnique(),\n      __splitGroupId: this.splitGroupId,\n      __tag: this.getTag(),\n    };\n  }\n\n  lightExport() {\n    return {\n      __id: this.id,\n      __task: {\n        __id: this.task.id,\n        __name: this.task.name,\n      },\n      __context: this.context.export(),\n      __executionTime: this.executionTime,\n      __executionStart: this.executionStart,\n      __nextNodes: this.nextNodes.map((node) => node.id),\n      __previousNodes: this.previousNodes.map((node) => node.id),\n      __routineExecId: this.routineExecId,\n      __isProcessing: this.processing,\n      __graphComplete: this.graphComplete,\n      __isMeta: this.isMeta(),\n      __failed: this.failed,\n      __errored: this.errored,\n      __isUnique: this.isUnique(),\n      __splitGroupId: this.splitGroupId,\n      __tag: this.getTag(),\n    };\n  }\n\n  public log() {\n    console.log(this.task.name, this.context.getContext(), this.routineExecId);\n  }\n}\n","import { v4 as uuid } from \"uuid\";\nimport { deepCloneFilter } from \"../../utils/tools\";\nimport { AnyObject } from \"../../types/global\";\n\nexport default class GraphContext {\n  readonly id: string;\n  private readonly fullContext: AnyObject; // Raw (for internal)\n  private readonly userData: AnyObject; // Filtered, frozen\n  private readonly metaData: AnyObject; // __keys, frozen\n\n  constructor(context: AnyObject) {\n    if (Array.isArray(context)) {\n      throw new Error(\"Array contexts not supported\"); // Per clarification\n    }\n    this.fullContext = context; // Clone once\n    this.userData = Object.fromEntries(\n      Object.entries(this.fullContext).filter(([key]) => !key.startsWith(\"__\")),\n    );\n    this.metaData = Object.fromEntries(\n      Object.entries(this.fullContext).filter(([key]) => key.startsWith(\"__\")),\n    );\n    this.id = uuid();\n  }\n\n  /**\n   * Gets frozen user data (read-only, no clone).\n   * @returns Frozen user context.\n   */\n  getContext(): AnyObject {\n    return this.userData;\n  }\n\n  getClonedContext(): AnyObject {\n    return deepCloneFilter(this.userData);\n  }\n\n  /**\n   * Gets full raw context (cloned for safety).\n   * @returns Cloned full context.\n   */\n  getFullContext(): AnyObject {\n    return this.fullContext;\n  }\n\n  /**\n   * Gets frozen metadata (read-only).\n   * @returns Frozen metadata object.\n   */\n  getMetaData(): AnyObject {\n    return this.metaData;\n  }\n\n  /**\n   * Clones this context (new instance).\n   * @returns New GraphContext.\n   */\n  clone(): GraphContext {\n    return this.mutate(this.fullContext);\n  }\n\n  /**\n   * Creates new context from data (via registry).\n   * @param context New data.\n   * @returns New GraphContext.\n   */\n  mutate(context: AnyObject): GraphContext {\n    return new GraphContext(context);\n  }\n\n  /**\n   * Combines with another for uniques (joins userData).\n   * @param otherContext The other.\n   * @returns New combined GraphContext.\n   * @edge Appends other.userData to joinedContexts in userData.\n   */\n  combine(otherContext: GraphContext): GraphContext {\n    const newUser = { ...this.userData };\n    newUser.joinedContexts = this.userData.joinedContexts\n      ? [...this.userData.joinedContexts]\n      : [this.userData];\n\n    const otherUser = otherContext.userData;\n    if (Array.isArray(otherUser.joinedContexts)) {\n      newUser.joinedContexts.push(...otherUser.joinedContexts);\n    } else {\n      newUser.joinedContexts.push(otherUser);\n    }\n\n    const newFull = {\n      ...this.fullContext,\n      ...otherContext.fullContext,\n      ...newUser,\n    };\n    return new GraphContext(newFull);\n  }\n\n  /**\n   * Exports the context.\n   * @returns Exported object.\n   */\n  export(): { __id: string; __context: AnyObject } {\n    return {\n      __id: this.id,\n      __context: this.getFullContext(),\n    };\n  }\n}\n","/**\n * Deep clones an input with optional filter.\n * @param input The input to clone.\n * @param filterOut Predicate to skip keys (true = skip).\n * @returns Cloned input.\n * @edge Handles arrays/objects; skips cycles with visited.\n * @edge Primitives returned as-is; functions copied by reference.\n */\nexport function deepCloneFilter<T>(\n  input: T,\n  filterOut: (key: string) => boolean = () => false,\n): T {\n  if (input === null || typeof input !== \"object\") {\n    return input;\n  }\n\n  const visited = new WeakMap<any, any>(); // For cycle detection\n\n  const stack: Array<{ source: any; target: any; key?: string }> = [];\n  const output = Array.isArray(input) ? [] : {};\n\n  stack.push({ source: input, target: output });\n  visited.set(input, output);\n\n  while (stack.length) {\n    const { source, target, key } = stack.pop()!;\n    const currentTarget = key !== undefined ? target[key] : target;\n\n    for (const [k, value] of Object.entries(source)) {\n      if (filterOut(k)) continue;\n\n      if (value && typeof value === \"object\") {\n        if (visited.has(value)) {\n          currentTarget[k] = visited.get(value); // Cycle: link to existing clone\n          continue;\n        }\n\n        const clonedValue = Array.isArray(value) ? [] : {};\n        currentTarget[k] = clonedValue;\n        visited.set(value, clonedValue);\n\n        stack.push({ source: value, target: currentTarget, key: k });\n      } else {\n        currentTarget[k] = value;\n      }\n    }\n  }\n\n  return output as T;\n}\n\nexport function formatTimestamp(timestamp: number) {\n  return new Date(timestamp).toISOString();\n}\n","import Iterator from \"../../interfaces/Iterator\";\nimport GraphNode from \"../execution/GraphNode\";\n\nexport default class GraphNodeIterator implements Iterator {\n  currentNode: GraphNode | undefined;\n  currentLayer: GraphNode[] = [];\n  nextLayer: GraphNode[] = [];\n  index: number = 0;\n\n  constructor(node: GraphNode) {\n    this.currentNode = node;\n    this.currentLayer = [node];\n  }\n\n  hasNext(): boolean {\n    return !!this.currentNode;\n  }\n\n  next(): any {\n    const nextNode = this.currentNode;\n\n    if (!nextNode) {\n      return undefined;\n    }\n\n    this.nextLayer.push(...nextNode.mapNext((n: GraphNode) => n));\n\n    this.index++;\n\n    if (this.index === this.currentLayer.length) {\n      this.currentLayer = this.nextLayer;\n      this.nextLayer = [];\n      this.index = 0;\n    }\n\n    this.currentNode = this.currentLayer.length\n      ? this.currentLayer[this.index]\n      : undefined;\n\n    return nextNode;\n  }\n}\n","import Cadenza from \"../Cadenza\";\n\nexport default abstract class SignalEmitter {\n  protected silent: boolean;\n\n  /**\n   * Constructor for signal emitters.\n   * @param silent If true, suppresses all emissions (e.g., for meta-runners to avoid loops; affects all emits).\n   */\n  constructor(silent: boolean = false) {\n    this.silent = silent;\n  }\n\n  /**\n   * Emits a signal via the broker if not silent.\n   * @param signal The signal name.\n   * @param data Optional payload (defaults to empty object).\n   * @edge No emission if silent; for metrics in silent mode, consider override or separate method.\n   */\n  emit(signal: string, data: any = {}): void {\n    if (this.silent) {\n      return;\n    }\n    Cadenza.broker.emit(signal, data);\n  }\n\n  /**\n   * Emits a signal via the broker even if silent.\n   * @param signal The signal name.\n   * @param data Optional payload (defaults to empty object).\n   */\n  emitMetric(signal: string, data: any = {}): void {\n    Cadenza.broker.emit(signal, data); // Ignore silent\n  }\n}\n","import { v4 as uuid } from \"uuid\";\nimport Task from \"./Task\";\nimport SignalParticipant from \"../../interfaces/SignalParticipant\";\n\nexport default class GraphRoutine extends SignalParticipant {\n  id: string;\n  readonly name: string;\n  readonly description: string;\n  readonly isMeta: boolean = false;\n  private tasks: Set<Task> = new Set();\n\n  constructor(\n    name: string,\n    tasks: Task[],\n    description: string,\n    isMeta: boolean = false,\n  ) {\n    super();\n    this.id = uuid();\n    this.name = name;\n    this.description = description;\n    this.isMeta = isMeta;\n    tasks.forEach((t) => this.tasks.add(t));\n    this.emit(\"meta.routine.created\", { __routine: this });\n  }\n\n  /**\n   * Applies callback to starting tasks.\n   * @param callBack The callback.\n   * @returns Promise if async.\n   */\n  public async forEachTask(callBack: (task: Task) => any): Promise<void> {\n    const promises = [];\n    for (const task of this.tasks) {\n      const res = callBack(task);\n      if (res instanceof Promise) promises.push(res);\n    }\n    await Promise.all(promises);\n  }\n\n  /**\n   * Sets global ID.\n   * @param id The ID.\n   */\n  public setGlobalId(id: string): void {\n    const oldId = this.id;\n    this.id = id;\n    this.emit(\"meta.routine.global_id_set\", { __id: this.id, __oldId: oldId });\n  }\n\n  // Removed emitsSignals per clarification (routines as listeners only)\n\n  /**\n   * Destroys the routine.\n   */\n  public destroy(): void {\n    this.tasks.clear();\n    this.emit(\"meta.routine.destroyed\", { __id: this.id });\n  }\n}\n","import SignalEmitter from \"./SignalEmitter\";\nimport GraphContext from \"../graph/context/GraphContext\";\nimport Cadenza from \"../Cadenza\";\n\nexport default class SignalParticipant extends SignalEmitter {\n  protected signalsToEmit: Set<string> = new Set(); // Use Set to prevent duplicates\n  protected signalsToEmitOnFail: Set<string> = new Set();\n  protected observedSignals: Set<string> = new Set();\n\n  /**\n   * Subscribes to signals (chainable).\n   * @param signals The signal names.\n   * @returns This for chaining.\n   * @edge Duplicates ignored; assumes broker.observe binds this as handler.\n   */\n  doOn(...signals: string[]): this {\n    signals.forEach((signal) => {\n      if (this.observedSignals.has(signal)) return;\n      Cadenza.broker.observe(signal, this as any);\n      this.observedSignals.add(signal);\n    });\n    return this;\n  }\n\n  /**\n   * Sets signals to emit post-execution (chainable).\n   * @param signals The signal names.\n   * @returns This for chaining.\n   */\n  emits(...signals: string[]): this {\n    signals.forEach((signal) => this.signalsToEmit.add(signal));\n    return this;\n  }\n\n  emitsOnFail(...signals: string[]): this {\n    signals.forEach((signal) => this.signalsToEmitOnFail.add(signal));\n    return this;\n  }\n\n  /**\n   * Unsubscribes from all observed signals.\n   * @returns This for chaining.\n   */\n  unsubscribeAll(): this {\n    this.observedSignals.forEach((signal) =>\n      Cadenza.broker.unsubscribe(signal, this as any),\n    );\n    this.observedSignals.clear();\n    return this;\n  }\n\n  /**\n   * Unsubscribes from specific signals.\n   * @param signals The signals.\n   * @returns This for chaining.\n   * @edge No-op if not subscribed.\n   */\n  unsubscribe(...signals: string[]): this {\n    signals.forEach((signal) => {\n      if (this.observedSignals.has(signal)) {\n        Cadenza.broker.unsubscribe(signal, this as any);\n        this.observedSignals.delete(signal);\n      }\n    });\n    return this;\n  }\n\n  /**\n   * Detaches specific emitted signals.\n   * @param signals The signals.\n   * @returns This for chaining.\n   */\n  detachSignals(...signals: string[]): this {\n    signals.forEach((signal) => this.signalsToEmit.delete(signal));\n    return this;\n  }\n\n  /**\n   * Detaches all emitted signals.\n   * @returns This for chaining.\n   */\n  detachAllSignals(): this {\n    this.signalsToEmit.clear();\n    return this;\n  }\n\n  /**\n   * Emits attached signals.\n   * @param context The context for emission.\n   * @edge If isMeta (from Task), suppresses further \"meta.*\" to prevent loops.\n   */\n  emitSignals(context: GraphContext): void {\n    this.signalsToEmit.forEach((signal) => {\n      // if ((this as any).isMeta && signal.startsWith('meta.')) return;  // Suppress meta recursion if isMeta\n      this.emit(signal, context);\n    });\n  }\n\n  /**\n   * Emits attached fail signals.\n   * @param context The context for emission.\n   * @edge If isMeta (from Task), suppresses further \"meta.*\" to prevent loops.\n   */\n  emitOnFailSignals(context: GraphContext): void {\n    this.signalsToEmitOnFail.forEach((signal) => {\n      // if ((this as any).isMeta && signal.startsWith('meta.')) return;  // Suppress meta recursion if isMeta\n      this.emit(signal, context);\n    });\n  }\n\n  /**\n   * Destroys the participant (unsub/detach).\n   */\n  destroy(): void {\n    this.unsubscribeAll();\n    this.detachAllSignals();\n  }\n}\n","import { v4 as uuid } from \"uuid\";\nimport GraphContext from \"../context/GraphContext\";\nimport GraphVisitor from \"../../interfaces/GraphVisitor\";\nimport TaskIterator from \"../iterators/TaskIterator\";\nimport Graph from \"../../interfaces/Graph\";\nimport { AnyObject } from \"../../types/global\";\nimport SignalParticipant from \"../../interfaces/SignalParticipant\";\nimport { SchemaDefinition } from \"../../types/schema\";\n\nexport type TaskFunction = (\n  context: AnyObject,\n  progressCallback: (progress: number) => void,\n) => TaskResult;\nexport type TaskResult = boolean | object | Generator | Promise<any> | void;\nexport type ThrottleTagGetter = (context?: AnyObject, task?: Task) => string;\n\nexport default class Task extends SignalParticipant implements Graph {\n  id: string;\n  readonly name: string;\n  readonly description: string;\n  concurrency: number;\n  timeout: number;\n  readonly isMeta: boolean = false;\n  readonly isUnique: boolean = false;\n  readonly throttled: boolean = false;\n\n  readonly isSignal: boolean = false;\n  readonly isDeputy: boolean = false;\n  readonly isEphemeral: boolean = false;\n\n  protected inputContextSchema: SchemaDefinition | undefined = undefined;\n  protected validateInputContext: boolean = false;\n  protected outputContextSchema: SchemaDefinition | undefined = undefined;\n  protected validateOutputContext: boolean = false;\n\n  layerIndex: number = 0;\n  progressWeight: number = 0;\n  private nextTasks: Set<Task> = new Set();\n  private onFailTasks: Set<Task> = new Set();\n  private predecessorTasks: Set<Task> = new Set();\n  destroyed: boolean = false;\n\n  protected readonly taskFunction: TaskFunction;\n\n  /**\n   * Constructs a Task (static definition).\n   * @param name Name.\n   * @param task Function.\n   * @param description Description.\n   * @param concurrency Limit.\n   * @param timeout ms.\n   * @param register Register via signal (default true).\n   * @param isUnique\n   * @param isMeta\n   * @param getTagCallback\n   * @param inputSchema\n   * @param validateInputContext\n   * @param outputSchema\n   * @param validateOutputContext\n   * @edge Emits 'meta.task.created' with { __task: this } for seed.\n   */\n  constructor(\n    name: string,\n    task: TaskFunction,\n    description: string = \"\",\n    concurrency: number = 0,\n    timeout: number = 0,\n    register: boolean = true,\n    isUnique: boolean = false,\n    isMeta: boolean = false,\n    getTagCallback: ThrottleTagGetter | undefined = undefined,\n    inputSchema: SchemaDefinition | undefined = undefined,\n    validateInputContext: boolean = false,\n    outputSchema: SchemaDefinition | undefined = undefined,\n    validateOutputContext: boolean = false,\n  ) {\n    super();\n    this.id = uuid();\n    this.name = name;\n    this.taskFunction = task.bind(this);\n    this.description = description;\n    this.concurrency = concurrency;\n    this.timeout = timeout;\n    this.isUnique = isUnique;\n    this.isMeta = isMeta;\n    this.inputContextSchema = inputSchema;\n    this.validateInputContext = validateInputContext;\n    this.outputContextSchema = outputSchema;\n    this.validateOutputContext = validateOutputContext;\n\n    if (getTagCallback) {\n      this.getTag = (context?: AnyObject) => getTagCallback(context, this);\n      this.throttled = true;\n    }\n\n    if (register) {\n      this.emit(\"meta.task.created\", { __task: this });\n    }\n  }\n\n  public getTag(context?: AnyObject): string {\n    return this.id;\n  }\n\n  public setGlobalId(id: string): void {\n    const oldId = this.id;\n    this.id = id;\n    this.emit(\"meta.task.global_id_set\", { __id: this.id, __oldId: oldId });\n  }\n\n  public setTimeout(timeout: number): void {\n    this.timeout = timeout;\n  }\n\n  public setConcurrency(concurrency: number): void {\n    this.concurrency = concurrency;\n  }\n\n  public setProgressWeight(weight: number): void {\n    this.progressWeight = weight;\n  }\n\n  public setInputContextSchema(schema: SchemaDefinition): void {\n    this.inputContextSchema = schema;\n  }\n\n  public setOutputContextSchema(schema: SchemaDefinition): void {\n    this.outputContextSchema = schema;\n  }\n\n  public setValidateInputContext(value: boolean): void {\n    this.validateInputContext = value;\n  }\n\n  public setValidateOutputContext(value: boolean): void {\n    this.validateOutputContext = value;\n  }\n\n  /**\n   * Validates a context deeply against a schema.\n   * @param data - The data to validate (input context or output result).\n   * @param schema - The schema definition.\n   * @param path - The current path for error reporting (default: 'root').\n   * @returns { { valid: boolean, errors: Record<string, string> } } - Validation result with detailed errors if invalid.\n   * @description Recursively checks types, required fields, and constraints; allows extra properties not in schema.\n   */\n  protected validateSchema(\n    data: any,\n    schema: SchemaDefinition | undefined,\n    path: string = \"context\",\n  ): { valid: boolean; errors: Record<string, string> } {\n    const errors: Record<string, string> = {};\n\n    if (!schema || typeof schema !== \"object\") return { valid: true, errors };\n\n    // Check required fields\n    const required = schema.required || [];\n    for (const key of required) {\n      if (!(key in data)) {\n        errors[`${path}.${key}`] = `Required field '${key}' is missing`;\n      }\n    }\n\n    // Validate defined properties (ignore extras)\n    const properties = schema.properties || {};\n    for (const [key, value] of Object.entries(data)) {\n      if (key in properties) {\n        const prop = properties[key];\n        const propType = prop.type;\n\n        if (propType === \"string\" && typeof value !== \"string\") {\n          errors[`${path}.${key}`] =\n            `Expected 'string' for '${key}', got '${typeof value}'`;\n        } else if (propType === \"number\" && typeof value !== \"number\") {\n          errors[`${path}.${key}`] =\n            `Expected 'number' for '${key}', got '${typeof value}'`;\n        } else if (propType === \"boolean\" && typeof value !== \"boolean\") {\n          errors[`${path}.${key}`] =\n            `Expected 'boolean' for '${key}', got '${typeof value}'`;\n        } else if (propType === \"array\" && !Array.isArray(value)) {\n          errors[`${path}.${key}`] =\n            `Expected 'array' for '${key}', got '${typeof value}'`;\n        } else if (\n          propType === \"object\" &&\n          (typeof value !== \"object\" || value === null || Array.isArray(value))\n        ) {\n          errors[`${path}.${key}`] =\n            `Expected 'object' for '${key}', got '${typeof value}'`;\n        } else if (propType === \"array\" && prop.items) {\n          if (Array.isArray(value)) {\n            value.forEach((item, index) => {\n              const subValidation = this.validateSchema(\n                item,\n                prop.items,\n                `${path}.${key}[${index}]`,\n              );\n              if (!subValidation.valid) {\n                Object.assign(errors, subValidation.errors);\n              }\n            });\n          }\n        } else if (\n          propType === \"object\" &&\n          !Array.isArray(value) &&\n          value !== null\n        ) {\n          const subValidation = this.validateSchema(\n            value,\n            prop,\n            `${path}.${key}`,\n          );\n          if (!subValidation.valid) {\n            Object.assign(errors, subValidation.errors);\n          }\n        }\n\n        // Check constraints (extended as discussed)\n        const constraints = prop.constraints || {};\n        if (typeof value === \"string\") {\n          if (constraints.minLength && value.length < constraints.minLength) {\n            errors[`${path}.${key}`] =\n              `String '${key}' shorter than minLength ${constraints.minLength}`;\n          }\n          if (constraints.maxLength && value.length > constraints.maxLength) {\n            errors[`${path}.${key}`] =\n              `String '${key}' exceeds maxLength ${constraints.maxLength}`;\n          }\n          if (\n            constraints.pattern &&\n            !new RegExp(constraints.pattern).test(value)\n          ) {\n            errors[`${path}.${key}`] =\n              `String '${key}' does not match pattern ${constraints.pattern}`;\n          }\n        } else if (typeof value === \"number\") {\n          if (constraints.min && value < constraints.min) {\n            errors[`${path}.${key}`] =\n              `Number '${key}' below min ${constraints.min}`;\n          }\n          if (constraints.max && value > constraints.max) {\n            errors[`${path}.${key}`] =\n              `Number '${key}' exceeds max ${constraints.max}`;\n          }\n          if (constraints.multipleOf && value % constraints.multipleOf !== 0) {\n            errors[`${path}.${key}`] =\n              `Number '${key}' not multiple of ${constraints.multipleOf}`;\n          }\n        } else if (constraints.enum && !constraints.enum.includes(value)) {\n          errors[`${path}.${key}`] =\n            `Value '${value}' for '${key}' not in enum ${JSON.stringify(constraints.enum)}`;\n        } else if (constraints.format) {\n          const formats = {\n            email: /^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\\.[a-zA-Z]{2,}$/,\n            url: /^(https?|ftp):\\/\\/[^\\s/$.?#].[^\\s]*$/,\n            \"date-time\":\n              /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(Z|[+-]\\d{2}:\\d{2})?$/,\n            uuid: /^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$/,\n            custom: /.*/, // Placeholder; override with prop.constraints.pattern if present\n          } as any;\n          const regex =\n            formats[constraints.format] ||\n            new RegExp(constraints.pattern || \".*\");\n          if (typeof value === \"string\" && !regex.test(value)) {\n            errors[`${path}.${key}`] =\n              `Value '${value}' for '${key}' does not match format '${constraints.format}'`;\n          }\n        } else if (constraints.oneOf && !constraints.oneOf.includes(value)) {\n          errors[`${path}.${key}`] =\n            `Value '${value}' for '${key}' not in oneOf ${JSON.stringify(constraints.oneOf)}`;\n        }\n      } else if (schema.strict) {\n        errors[`${path}.${key}`] = `Key '${key}' is not allowed`;\n      }\n    }\n\n    if (Object.keys(errors).length > 0) {\n      return { valid: false, errors };\n    }\n    return { valid: true, errors: {} };\n  }\n\n  public validateInput(context: AnyObject): true | AnyObject {\n    if (this.validateInputContext) {\n      const validationResult = this.validateSchema(\n        context,\n        this.inputContextSchema,\n      );\n      if (!validationResult.valid) {\n        this.emit(\"meta.task.validationFailed\", {\n          __taskId: this.id,\n          __context: context,\n          __errors: validationResult.errors,\n        });\n        return {\n          errored: true,\n          __error: \"Input context validation failed\",\n          __validationErrors: JSON.stringify(validationResult.errors),\n        };\n      }\n    }\n    return true;\n  }\n\n  public validateOutput(context: AnyObject): true | AnyObject {\n    if (this.validateOutputContext) {\n      const validationResult = this.validateSchema(\n        context,\n        this.outputContextSchema,\n      );\n      if (!validationResult.valid) {\n        this.emit(\"meta.task.outputValidationFailed\", {\n          __taskId: this.id,\n          __result: context,\n          __errors: validationResult.errors,\n        });\n        return {\n          errored: true,\n          __error: \"Output context validation failed\",\n          __validationErrors: JSON.stringify(validationResult.errors),\n        };\n      }\n    }\n    return true;\n  }\n\n  /**\n   * Executes the task function after optional input validation.\n   * @param context - The GraphContext to validate and execute.\n   * @param progressCallback - Callback for progress updates.\n   * @returns TaskResult from the taskFunction or error object on validation failure.\n   * @edge If validateInputContext is true, validates context; on failure, emits 'meta.task.validationFailed' with detailed errors.\n   * @edge If validateOutputContext is true, validates output; on failure, emits 'meta.task.outputValidationFailed' with detailed errors.\n   */\n  public execute(\n    context: GraphContext,\n    progressCallback: (progress: number) => void,\n  ): TaskResult {\n    return this.taskFunction(context.getClonedContext(), progressCallback);\n  }\n\n  public doAfter(...tasks: Task[]): this {\n    for (const pred of tasks) {\n      if (this.predecessorTasks.has(pred)) continue;\n\n      pred.nextTasks.add(this);\n      this.predecessorTasks.add(pred);\n      this.updateLayerFromPredecessors();\n\n      if (this.hasCycle()) {\n        this.decouple(pred);\n        throw new Error(`Cycle adding pred ${pred.name} to ${this.name}`);\n      }\n    }\n\n    this.updateProgressWeights();\n    return this;\n  }\n\n  public then(...tasks: Task[]): this {\n    for (const next of tasks) {\n      if (this.nextTasks.has(next)) continue;\n\n      this.nextTasks.add(next);\n      next.predecessorTasks.add(this);\n      next.updateLayerFromPredecessors();\n\n      if (next.hasCycle()) {\n        this.decouple(next);\n        throw new Error(`Cycle adding next ${next.name} to ${this.name}`);\n      }\n    }\n\n    this.updateProgressWeights();\n    return this;\n  }\n\n  public decouple(task: Task): void {\n    if (task.nextTasks.has(this)) {\n      task.nextTasks.delete(this);\n      this.predecessorTasks.delete(task);\n    }\n\n    if (task.onFailTasks.has(this)) {\n      task.onFailTasks.delete(this);\n      this.predecessorTasks.delete(task);\n    }\n\n    this.updateLayerFromPredecessors();\n  }\n\n  public doOnFail(...tasks: Task[]): this {\n    for (const task of tasks) {\n      if (this.onFailTasks.has(task)) continue;\n\n      this.onFailTasks.add(task);\n      task.predecessorTasks.add(this);\n      task.updateLayerFromPredecessors();\n\n      if (task.hasCycle()) {\n        this.decouple(task);\n        throw new Error(`Cycle adding onFail ${task.name} to ${this.name}`);\n      }\n    }\n\n    return this;\n  }\n\n  private updateProgressWeights(): void {\n    const layers = this.getSubgraphLayers();\n    const numLayers = layers.size;\n    if (numLayers === 0) return;\n\n    const weightPerLayer = 1 / numLayers;\n\n    layers.forEach((tasksInLayer) => {\n      const numTasks = tasksInLayer.size;\n      if (numTasks === 0) return;\n      tasksInLayer.forEach(\n        (task) => (task.progressWeight = weightPerLayer / numTasks),\n      );\n    });\n  }\n\n  private getSubgraphLayers(): Map<number, Set<Task>> {\n    const layers = new Map<number, Set<Task>>();\n    const queue = [this as Task];\n    const visited = new Set<Task>();\n\n    while (queue.length) {\n      const task = queue.shift()!;\n      if (visited.has(task)) continue;\n      visited.add(task);\n\n      if (!layers.has(task.layerIndex)) layers.set(task.layerIndex, new Set());\n      layers.get(task.layerIndex)!.add(task);\n\n      task.nextTasks.forEach((next) => queue.push(next));\n    }\n\n    return layers;\n  }\n\n  private updateLayerFromPredecessors(): void {\n    let maxPred = 0;\n    this.predecessorTasks.forEach(\n      (pred) => (maxPred = Math.max(maxPred, pred.layerIndex)),\n    );\n    this.layerIndex = maxPred + 1;\n\n    const queue = Array.from(this.nextTasks);\n    while (queue.length) {\n      const next = queue.shift()!;\n      next.updateLayerFromPredecessors();\n      next.nextTasks.forEach((n) => queue.push(n));\n    }\n  }\n\n  private hasCycle(): boolean {\n    const visited = new Set<Task>();\n    const recStack = new Set<Task>();\n\n    const dfs = (task: Task): boolean => {\n      if (recStack.has(task)) return true;\n      if (visited.has(task)) return false;\n\n      visited.add(task);\n      recStack.add(task);\n\n      for (const next of task.nextTasks) {\n        if (dfs(next)) return true;\n      }\n\n      recStack.delete(task);\n      return false;\n    };\n\n    return dfs(this);\n  }\n\n  public mapNext(\n    callback: (task: Task) => any,\n    failed: boolean = false,\n  ): any[] {\n    const tasks = failed\n      ? Array.from(this.onFailTasks)\n      : Array.from(this.nextTasks);\n    return tasks.map(callback);\n  }\n\n  public mapPrevious(callback: (task: Task) => any): any[] {\n    return Array.from(this.predecessorTasks).map(callback);\n  }\n\n  public destroy(): void {\n    super.destroy();\n\n    this.predecessorTasks.forEach((pred) => pred.nextTasks.delete(this));\n    this.nextTasks.forEach((next) => next.predecessorTasks.delete(this));\n    this.onFailTasks.forEach((fail) => fail.predecessorTasks.delete(this));\n\n    this.nextTasks.clear();\n    this.predecessorTasks.clear();\n    this.onFailTasks.clear();\n\n    this.destroyed = true;\n\n    this.emit(\"meta.task.destroyed\", { __id: this.id });\n  }\n\n  public export(): AnyObject {\n    return {\n      __id: this.id,\n      __name: this.name,\n      __description: this.description,\n      __layerIndex: this.layerIndex,\n      __isUnique: this.isUnique,\n      __isMeta: this.isMeta,\n      __isSignal: this.isSignal,\n      __eventTriggers: this.observedSignals,\n      __attachedEvents: this.signalsToEmit,\n      __isDeputy: this.isDeputy,\n      __throttled: this.throttled,\n      __isEphemeral: this.isEphemeral,\n      __concurrency: this.concurrency,\n      __timeout: this.timeout,\n      __functionString: this.taskFunction.toString(),\n      __getTagCallback: this.getTag.toString(),\n      __inputSchema: this.inputContextSchema,\n      __validateInputContext: this.validateInputContext,\n      __outputSchema: this.outputContextSchema,\n      __validateOutputContext: this.validateOutputContext,\n      __nextTasks: Array.from(this.nextTasks).map((t) => t.id),\n      __onFailTasks: Array.from(this.onFailTasks).map((t) => t.id),\n      __previousTasks: Array.from(this.predecessorTasks).map((t) => t.id),\n    };\n  }\n\n  public getIterator(): TaskIterator {\n    return new TaskIterator(this);\n  }\n\n  public accept(visitor: GraphVisitor): void {\n    visitor.visitTask(this);\n  }\n\n  public log(): void {\n    console.log(this.name);\n  }\n}\n","import Iterator from \"../../interfaces/Iterator\";\nimport Task from \"../definition/Task\";\n\nexport default class TaskIterator implements Iterator {\n  private currentTask: Task | undefined;\n  private currentLayer: Set<Task> = new Set();\n  private nextLayer: Set<Task> = new Set();\n  private iterator: { next: () => { value: Task | undefined } } =\n    this.currentLayer[Symbol.iterator]();\n\n  constructor(task: Task) {\n    this.currentTask = task;\n    this.currentLayer.add(task);\n  }\n  hasNext(): boolean {\n    return !!this.currentTask;\n  }\n\n  next(): Task | undefined {\n    const nextTask = this.currentTask;\n\n    if (!nextTask) {\n      return undefined;\n    }\n\n    nextTask.mapNext((t: Task) => this.nextLayer.add(t));\n\n    let next = this.iterator.next();\n\n    if (next.value === undefined) {\n      this.currentLayer.clear();\n      this.currentLayer = this.nextLayer;\n      this.nextLayer = new Set();\n      this.iterator = this.currentLayer[Symbol.iterator]();\n      next = this.iterator.next();\n    }\n\n    this.currentTask = next.value;\n\n    return nextTask;\n  }\n}\n","import Cadenza from \"../Cadenza\";\nimport Task from \"../graph/definition/Task\";\nimport GraphRoutine from \"../graph/definition/GraphRoutine\";\nimport { AnyObject } from \"../types/global\";\n\nexport default class GraphRegistry {\n  private static _instance: GraphRegistry;\n  public static get instance(): GraphRegistry {\n    if (!this._instance) this._instance = new GraphRegistry();\n    return this._instance;\n  }\n\n  private tasks: Map<string, Task> = new Map();\n  private routines: Map<string, GraphRoutine> = new Map();\n\n  registerTask: Task;\n  updateTaskId: Task;\n  updateTaskInputSchema: Task;\n  updateTaskOutputSchema: Task;\n  getTaskById: Task;\n  getTaskByName: Task;\n  getTasksByLayer: Task;\n  getAllTasks: Task;\n  doForEachTask: Task;\n  deleteTask: Task;\n  registerRoutine: Task;\n  updateRoutineId: Task;\n  getRoutineById: Task;\n  getRoutineByName: Task;\n  getAllRoutines: Task;\n  doForEachRoutine: Task;\n  deleteRoutine: Task;\n\n  private constructor() {\n    // Hardcode seed MetaTask (observes on existing broker)\n    this.registerTask = new Task(\n      \"Registry Seed\",\n      (context: AnyObject) => {\n        const { __task } = context;\n        if (__task && !this.tasks.has(__task.id)) {\n          console.log(\"Registering task:\", __task.name);\n          this.tasks.set(__task.id, __task);\n        }\n        return true;\n      },\n      \"Registers tasks. Seed for meta.taskCreated\",\n      0,\n      0,\n      true,\n      false,\n      true,\n    ).doOn(\"meta.task.created\");\n\n    // Manual seed register\n    this.tasks.set(this.registerTask.id, this.registerTask);\n\n    this.updateTaskId = Cadenza.createMetaTask(\n      \"Update task id\",\n      (context) => {\n        const { __id, __oldId } = context;\n        const task = this.tasks.get(__oldId);\n        if (!task) return context;\n        this.tasks.set(__id, task);\n        this.tasks.delete(__oldId);\n        return context;\n      },\n      \"Updates task id.\",\n    ).doOn(\"meta.task.global_id_set\");\n\n    this.updateTaskInputSchema = Cadenza.createMetaTask(\n      \"Update task input schema\",\n      (context) => {\n        const { __id, __schema } = context;\n        const task = this.tasks.get(__id);\n        if (!task) return true;\n        task.setInputContextSchema(__schema);\n        return true;\n      },\n      \"Updates task input schema.\",\n    ).doOn(\"meta.task.input_schema_updated\");\n\n    this.updateTaskOutputSchema = Cadenza.createMetaTask(\n      \"Update task input schema\",\n      (context) => {\n        const { __id, __schema } = context;\n        const task = this.tasks.get(__id);\n        if (!task) return true;\n        task.setOutputContextSchema(__schema);\n        return true;\n      },\n      \"Updates task input schema.\",\n    ).doOn(\"meta.task.output_schema_updated\");\n\n    this.getTaskById = Cadenza.createMetaTask(\n      \"Get task by id\",\n      (context) => {\n        const { __id } = context;\n        return { ...context, __task: this.tasks.get(__id) };\n      },\n      \"Gets task by id.\",\n    );\n\n    this.getTaskByName = Cadenza.createMetaTask(\n      \"Get task by name\",\n      (context) => {\n        const { __name } = context;\n        for (const task of this.tasks.values()) {\n          if (task.name === __name) {\n            return { ...context, __task: task };\n          }\n        }\n        return context;\n      },\n      \"Gets task by name (first match).\",\n    );\n\n    this.getTasksByLayer = Cadenza.createMetaTask(\n      \"Get tasks by layer\",\n      (context) => {\n        const { __layerIndex } = context;\n        const layerTasks = Array.from(this.tasks.values()).filter(\n          (task) => task.layerIndex === __layerIndex,\n        );\n        return { ...context, __tasks: layerTasks };\n      },\n      \"Gets tasks by layer index.\",\n    );\n\n    this.getAllTasks = Cadenza.createMetaTask(\n      \"Get all tasks\",\n      (context) => ({ ...context, __tasks: Array.from(this.tasks.values()) }), // Use arrow to capture this\n      \"Gets all tasks.\",\n    );\n\n    this.doForEachTask = Cadenza.createMetaTask(\n      \"Do for each task\",\n      function* (context: AnyObject) {\n        // @ts-ignore\n        for (const task of this.tasks.values()) {\n          yield { ...context, __task: task };\n        }\n      }.bind(this), // Bind to capture this in generator\n      \"Yields each task for branching.\",\n    );\n\n    this.deleteTask = Cadenza.createMetaTask(\n      \"Delete task\",\n      (context) => {\n        const { __id } = context;\n        this.tasks.delete(__id);\n        return context;\n      },\n      \"Deletes task.\",\n    ).doOn(\"meta.task.destroyed\");\n\n    this.registerRoutine = Cadenza.createMetaTask(\n      \"Register routine\",\n      (context) => {\n        const { __routine } = context;\n        if (__routine && !this.routines.has(__routine.id)) {\n          this.routines.set(__routine.id, __routine);\n        }\n        return true;\n      },\n      \"Registers routine.\",\n    ).doOn(\"meta.routine.created\");\n\n    this.updateRoutineId = Cadenza.createMetaTask(\n      \"Update routine id\",\n      (context) => {\n        const { __id, __oldId } = context;\n        const routine = this.routines.get(__oldId);\n        if (!routine) return context;\n        this.routines.set(__id, routine);\n        this.routines.delete(__oldId);\n        return context;\n      },\n      \"Updates routine id.\",\n    ).doOn(\"meta.routine.global_id_set\");\n\n    this.getRoutineById = Cadenza.createMetaTask(\n      \"Get routine by id\",\n      (context) => {\n        const { __id } = context;\n        return { ...context, routine: this.routines.get(__id) };\n      },\n      \"Gets routine by id.\",\n    );\n\n    this.getRoutineByName = Cadenza.createMetaTask(\n      \"Get routine by name\",\n      (context) => {\n        const { __name } = context;\n        for (const routine of this.routines.values()) {\n          if (routine.name === __name) {\n            return { ...context, __routine: routine };\n          }\n        }\n        return context;\n      },\n      \"Gets routine by name.\",\n    );\n\n    this.getAllRoutines = Cadenza.createMetaTask(\n      \"Get all routines\",\n      (context) => ({\n        ...context,\n        __routines: Array.from(this.routines.values()),\n      }), // Use arrow to capture this\n      \"Gets all routines.\",\n    );\n\n    this.doForEachRoutine = Cadenza.createMetaTask(\n      \"Do for each routine\",\n      function* (context: AnyObject) {\n        // @ts-ignore\n        for (const routine of this.routines.values()) {\n          yield { ...context, __routine: routine };\n        }\n      }.bind(this),\n      \"Yields each routine.\",\n    );\n\n    this.deleteRoutine = Cadenza.createMetaTask(\n      \"Delete routine\",\n      (context) => {\n        const { __id } = context;\n        this.routines.delete(__id);\n        return context;\n      },\n      \"Deletes routine.\",\n    );\n  }\n\n  reset() {\n    this.tasks.clear();\n    this.routines.clear();\n    this.tasks.set(this.registerTask.id, this.registerTask);\n  }\n}\n","import Task, { TaskFunction, TaskResult } from \"./Task\";\nimport GraphContext from \"../context/GraphContext\";\nimport { SchemaDefinition } from \"../../types/schema\";\n\nexport interface DebounceOptions {\n  leading?: boolean;\n  trailing?: boolean;\n  maxWait?: number;\n}\n\nexport default class DebounceTask extends Task {\n  private readonly debounceTime: number;\n  private leading: boolean;\n  private trailing: boolean;\n  private maxWait: number;\n  private timer: NodeJS.Timeout | null = null;\n  private maxTimer: NodeJS.Timeout | null = null;\n  private hasLaterCall: boolean = false;\n  private lastResolve: ((value: unknown) => void) | null = null;\n  private lastReject: ((reason?: any) => void) | null = null;\n  private lastContext: GraphContext | null = null;\n  private lastTimeout: NodeJS.Timeout | null = null;\n  private lastProgressCallback: ((progress: number) => void) | null = null;\n\n  constructor(\n    name: string,\n    task: TaskFunction,\n    description: string = \"\",\n    debounceTime: number = 1000,\n    leading: boolean = false,\n    trailing: boolean = true,\n    maxWait: number = 0,\n    concurrency: number = 0,\n    timeout: number = 0,\n    register: boolean = true,\n    isUnique: boolean = false,\n    isMeta: boolean = false,\n    inputSchema: SchemaDefinition | undefined = undefined,\n    validateInputSchema: boolean = false,\n    outputSchema: SchemaDefinition | undefined = undefined,\n    validateOutputSchema: boolean = false,\n  ) {\n    super(\n      name,\n      task,\n      description,\n      concurrency,\n      timeout,\n      register,\n      isUnique,\n      isMeta,\n      undefined,\n      inputSchema,\n      validateInputSchema,\n      outputSchema,\n      validateOutputSchema,\n    );\n    this.debounceTime = debounceTime;\n    this.leading = leading;\n    this.trailing = trailing;\n    this.maxWait = maxWait;\n  }\n\n  private executeFunction(): void {\n    if (this.lastTimeout) {\n      clearTimeout(this.lastTimeout);\n    }\n\n    let result;\n    try {\n      result = this.taskFunction(\n        this.lastContext!.getClonedContext(),\n        this.lastProgressCallback!,\n      );\n    } catch (error) {\n      if (this.lastResolve) {\n        this.lastResolve(error);\n      }\n      return;\n    }\n\n    if (result instanceof Promise) {\n      result.then(this.lastResolve!).catch(this.lastReject!);\n    } else {\n      if (this.lastResolve) {\n        this.lastResolve(result);\n      }\n    }\n  }\n\n  private debouncedTrigger(\n    resolve: (value: unknown) => void,\n    reject: (reason?: any) => void,\n    context: GraphContext,\n    timeout: NodeJS.Timeout,\n    progressCallback: (progress: number) => void,\n  ): void {\n    const callNow = this.leading && this.timer === null;\n    const isNewBurst = this.timer === null;\n\n    if (this.timer !== null) {\n      clearTimeout(this.timer);\n      this.timer = null;\n    }\n\n    this.lastResolve = resolve;\n    this.lastReject = reject;\n    this.lastContext = context;\n    this.lastTimeout = timeout;\n    this.lastProgressCallback = progressCallback;\n\n    if (!callNow) {\n      this.hasLaterCall = true;\n    }\n\n    this.timer = setTimeout(() => {\n      this.timer = null;\n      if (this.trailing && this.hasLaterCall) {\n        this.executeFunction();\n        this.hasLaterCall = false;\n      }\n      if (this.maxTimer) {\n        clearTimeout(this.maxTimer);\n        this.maxTimer = null;\n      }\n    }, this.debounceTime);\n\n    if (callNow) {\n      this.executeFunction();\n      this.hasLaterCall = false;\n    }\n\n    if (this.maxWait > 0 && isNewBurst) {\n      this.maxTimer = setTimeout(() => {\n        this.maxTimer = null;\n        if (this.trailing && this.hasLaterCall) {\n          if (this.timer) {\n            clearTimeout(this.timer);\n            this.timer = null;\n          }\n          this.executeFunction();\n          this.hasLaterCall = false;\n        }\n      }, this.maxWait);\n    }\n  }\n\n  execute(\n    context: GraphContext,\n    progressCallback: (progress: number) => void,\n  ): TaskResult {\n    return new Promise((resolve, reject) => {\n      const timeout = setTimeout(() => {\n        resolve(false);\n      }, this.debounceTime + 1);\n\n      this.debouncedTrigger(\n        resolve,\n        reject,\n        context,\n        timeout,\n        progressCallback,\n      );\n    });\n  }\n}\n","import Task, { TaskFunction, ThrottleTagGetter } from \"./Task\";\nimport { SchemaDefinition } from \"../../types/schema\";\n\nexport default class EphemeralTask extends Task {\n  private readonly once: boolean;\n  private readonly condition: (context: any) => boolean;\n  readonly isEphemeral: boolean = true;\n\n  constructor(\n    name: string,\n    task: TaskFunction,\n    description: string = \"\",\n    once: boolean = true,\n    condition: (context: any) => boolean = () => true,\n    concurrency: number = 0,\n    timeout: number = 0,\n    register: boolean = false,\n    isUnique: boolean = false,\n    isMeta: boolean = false,\n    getTagCallback: ThrottleTagGetter | undefined = undefined,\n    inputSchema: SchemaDefinition | undefined = undefined,\n    validateInputContext: boolean = false,\n    outputSchema: SchemaDefinition | undefined = undefined,\n    validateOutputContext: boolean = false,\n  ) {\n    super(\n      name,\n      task,\n      description,\n      concurrency,\n      timeout,\n      register,\n      isUnique,\n      isMeta,\n      getTagCallback,\n      inputSchema,\n      validateInputContext,\n      outputSchema,\n      validateOutputContext,\n    );\n    this.once = once;\n    this.condition = condition;\n  }\n\n  public execute(context: any, progressCallback: (progress: number) => void) {\n    const result = super.execute(context, progressCallback);\n\n    this.emit(\"meta.ephemeral.executed\", result);\n\n    if (this.once || !this.condition(result)) {\n      this.destroy();\n      return result;\n    }\n  }\n}\n","export default abstract class ExecutionChain {\n  protected next: ExecutionChain | undefined;\n  protected previous: ExecutionChain | undefined;\n\n  public setNext(next: ExecutionChain): void {\n    if (this.hasNext) {\n      return;\n    }\n\n    next.previous = this;\n    this.next = next;\n  }\n\n  get hasNext() {\n    return !!this.next;\n  }\n\n  get hasPreceding() {\n    return !!this.previous;\n  }\n\n  getNext() {\n    return this.next;\n  }\n\n  getPreceding() {\n    return this.previous;\n  }\n\n  decouple() {\n    this.next = undefined;\n    this.previous = undefined;\n  }\n}\n","import Iterator from \"../../interfaces/Iterator\";\nimport SyncGraphLayer from \"../execution/SyncGraphLayer\";\nimport GraphLayer from \"../../interfaces/GraphLayer\";\n\nexport default class GraphLayerIterator implements Iterator {\n  graph: GraphLayer;\n  currentLayer: GraphLayer | undefined;\n\n  constructor(graph: GraphLayer) {\n    this.graph = graph;\n  }\n  hasNext() {\n    return !this.currentLayer || this.currentLayer.hasNext;\n  }\n\n  hasPrevious(): boolean {\n    return !this.currentLayer || this.currentLayer.hasPreceding;\n  }\n\n  next(): GraphLayer {\n    if (!this.currentLayer) {\n      return this.getFirst();\n    } else if (this.hasNext()) {\n      this.currentLayer = this.currentLayer.getNext() as GraphLayer;\n    }\n\n    // @ts-ignore\n    return this.currentLayer;\n  }\n\n  previous(): GraphLayer {\n    if (!this.currentLayer) {\n      this.currentLayer = this.graph;\n    } else if (this.hasPrevious()) {\n      this.currentLayer = this.currentLayer.getPreceding() as SyncGraphLayer;\n    }\n\n    // @ts-ignore\n    return this.currentLayer;\n  }\n\n  getFirst(): GraphLayer {\n    if (!this.currentLayer) {\n      this.currentLayer = this.graph;\n    }\n\n    while (this.hasPrevious()) {\n      this.currentLayer = this.currentLayer?.getPreceding() as SyncGraphLayer;\n    }\n\n    return this.currentLayer;\n  }\n\n  getLast(): GraphLayer {\n    if (!this.currentLayer) {\n      this.currentLayer = this.graph;\n    }\n\n    while (this.hasNext()) {\n      this.currentLayer = this.currentLayer?.getNext() as GraphLayer;\n    }\n\n    return this.currentLayer as GraphLayer;\n  }\n}\n","import ExecutionChain from \"./ExecutionChain\";\nimport Graph from \"./Graph\";\nimport GraphNode from \"../graph/execution/GraphNode\";\nimport GraphLayerIterator from \"../graph/iterators/GraphLayerIterator\";\nimport GraphVisitor from \"./GraphVisitor\";\nimport GraphContext from \"../graph/context/GraphContext\";\n\nexport default abstract class GraphLayer\n  extends ExecutionChain\n  implements Graph\n{\n  protected readonly index: number;\n  protected nodes: GraphNode[] = [];\n  private executionTime: number = 0;\n  private executionStart: number = 0;\n  protected debug: boolean = false;\n\n  constructor(index: number) {\n    super();\n    this.index = index;\n  }\n\n  setDebug(value: boolean) {\n    this.debug = value;\n    for (const node of this.nodes) {\n      node.setDebug(value);\n    }\n  }\n\n  abstract execute(context?: GraphContext): unknown;\n\n  get hasPreceding() {\n    return !!this.previous && this.previous instanceof GraphLayer;\n  }\n\n  getNumberOfNodes() {\n    return this.nodes.length;\n  }\n\n  getNodesByRoutineExecId(routineExecId: string) {\n    return this.nodes.filter((node) => node.routineExecId === routineExecId);\n  }\n\n  isProcessed() {\n    for (const node of this.nodes) {\n      if (!node.isProcessed()) {\n        return false;\n      }\n    }\n\n    return true;\n  }\n\n  graphDone() {\n    let done = true;\n\n    let layer: GraphLayer | undefined = this;\n    while (layer) {\n      if (!layer.isProcessed()) {\n        done = false;\n        break;\n      }\n      layer = layer.getNext() as GraphLayer;\n    }\n\n    return done;\n  }\n\n  setNext(next: GraphLayer) {\n    if (next.index <= this.index) {\n      return;\n    }\n\n    if (next.previous !== undefined) {\n      this.previous = next.previous;\n    }\n\n    super.setNext(next);\n  }\n\n  add(node: GraphNode) {\n    this.nodes.push(node);\n  }\n\n  start() {\n    if (!this.executionStart) {\n      this.executionStart = Date.now();\n    }\n    return this.executionStart;\n  }\n\n  end() {\n    if (!this.executionStart) {\n      return 0;\n    }\n\n    const end = Date.now();\n    this.executionTime = end - this.executionStart;\n    return end;\n  }\n\n  destroy() {\n    for (const node of this.nodes) {\n      node.destroy();\n    }\n\n    this.nodes = [];\n\n    if (this.hasNext) {\n      const layer = this.getNext() as GraphLayer;\n      layer?.destroy();\n    }\n\n    this.decouple();\n  }\n\n  getIterator(): GraphLayerIterator {\n    return new GraphLayerIterator(this);\n  }\n\n  accept(visitor: GraphVisitor) {\n    visitor.visitLayer(this);\n\n    for (const node of this.nodes) {\n      node.accept(visitor);\n    }\n  }\n\n  export() {\n    return {\n      __index: this.index,\n      __executionTime: this.executionTime,\n      __numberOfNodes: this.getNumberOfNodes(),\n      __hasNextLayer: this.hasNext,\n      __hasPrecedingLayer: this.hasPreceding,\n      __nodes: this.nodes.map((node) => node.id),\n    };\n  }\n\n  log() {\n    console.log(`---Layer ${this.index}---`);\n    console.log(\"Execution time:\", this.executionTime);\n    let prevNode;\n    for (const node of this.nodes) {\n      if (!prevNode || !prevNode.sharesContextWith(node)) {\n        console.log(\"**********\");\n      }\n      node.log();\n      prevNode = node;\n    }\n    console.log(\"***********\");\n    if (this.hasNext) {\n      (this.getNext() as GraphLayer).log();\n    }\n  }\n}\n","import GraphNode from \"./GraphNode\";\nimport GraphLayer from \"../../interfaces/GraphLayer\";\n\nexport default class SyncGraphLayer extends GraphLayer {\n  execute(): GraphNode[] {\n    this.start();\n\n    const result: GraphNode[] = [];\n    for (const node of this.nodes) {\n      if (node.isProcessed()) {\n        continue;\n      }\n\n      const newNodes = node.execute();\n\n      if (newNodes instanceof Promise) {\n        console.error(\"Asynchronous functions are not allowed in sync mode!\");\n        continue;\n      }\n\n      result.push(...(newNodes as GraphNode[]));\n    }\n\n    this.end();\n\n    return result;\n  }\n}\n","import SyncGraphLayer from \"../graph/execution/SyncGraphLayer\";\nimport GraphNode from \"../graph/execution/GraphNode\";\nimport GraphLayer from \"./GraphLayer\";\n\nexport default abstract class GraphBuilder {\n  graph: GraphLayer | undefined;\n  topLayerIndex: number = 0;\n  layers: GraphLayer[] = [];\n  debug: boolean = false;\n\n  setDebug(value: boolean) {\n    this.debug = value;\n  }\n\n  getResult(): GraphLayer {\n    return this.graph as GraphLayer;\n  }\n\n  compose() {\n    throw \"Implement this in child class...\";\n  }\n\n  addNode(node: GraphNode) {\n    const index = node.getLayerIndex();\n\n    this.addLayer(index);\n    const layer = this.getLayer(index);\n\n    node.scheduleOn(layer);\n  }\n\n  protected addNodes(nodes: GraphNode[]) {\n    for (const node of nodes) {\n      this.addNode(node);\n    }\n  }\n\n  protected addLayer(index: number) {\n    if (!this.graph) {\n      const layer = this.createLayer(index);\n      this.graph = layer;\n      this.layers.push(layer);\n      this.topLayerIndex = index;\n      return;\n    }\n\n    const lastLayerIndex = this.topLayerIndex + this.layers.length - 1;\n\n    if (index >= this.topLayerIndex && index <= lastLayerIndex) {\n      return;\n    }\n\n    if (this.topLayerIndex > index) {\n      const layer = this.createLayer(this.topLayerIndex - 1);\n      layer.setNext(this.layers[0]);\n      this.graph = layer;\n      this.layers.unshift(layer);\n      this.topLayerIndex = this.topLayerIndex - 1;\n      this.addLayer(index);\n    } else {\n      const layer = this.createLayer(lastLayerIndex + 1);\n      this.layers[this.layers.length - 1].setNext(layer);\n      this.layers.push(layer);\n      this.addLayer(index);\n    }\n  }\n\n  protected createLayer(index: number): GraphLayer {\n    const layer = new SyncGraphLayer(index);\n    layer.setDebug(this.debug);\n    return layer;\n  }\n\n  protected getLayer(layerIndex: number) {\n    return this.layers[layerIndex - this.topLayerIndex];\n  }\n\n  public reset() {\n    this.graph = undefined;\n    this.topLayerIndex = 0;\n    this.layers = [];\n  }\n}\n","import GraphBuilder from \"../../interfaces/GraphBuilder\";\nimport GraphNode from \"../../graph/execution/GraphNode\";\n\nexport default class GraphBreadthFirstBuilder extends GraphBuilder {\n  compose() {\n    if (!this.graph) {\n      return;\n    }\n\n    const layers = this.graph.getIterator();\n    while (layers.hasNext()) {\n      const layer = layers.next();\n      const newNodes = layer.execute() as GraphNode[];\n      this.addNodes(newNodes);\n    }\n  }\n}\n","import GraphNode from \"../graph/execution/GraphNode\";\nimport GraphBuilder from \"./GraphBuilder\";\nimport GraphRun from \"../engine/GraphRun\";\nimport GraphBreadthFirstBuilder from \"../engine/builders/GraphBreadthFirstBuilder\";\n\nexport default abstract class GraphRunStrategy {\n  protected graphBuilder: GraphBuilder;\n  protected runInstance?: GraphRun;\n\n  constructor() {\n    this.graphBuilder = new GraphBreadthFirstBuilder();\n  }\n\n  setRunInstance(runInstance: GraphRun) {\n    this.runInstance = runInstance;\n  }\n\n  changeStrategy(builder: GraphBuilder) {\n    this.graphBuilder = builder;\n  }\n\n  protected reset() {\n    this.graphBuilder.reset();\n  }\n\n  addNode(node: GraphNode) {\n    this.graphBuilder.addNode(node);\n  }\n\n  updateRunInstance() {\n    this.runInstance?.setGraph(this.graphBuilder.getResult());\n  }\n\n  abstract run(): void;\n  abstract export(): any;\n}\n","export function sleep(ms: number) {\n  return new Promise((resolve) => setTimeout(resolve, ms));\n}\n","import GraphNode from \"../graph/execution/GraphNode\";\n\ntype ProcessFunction = (node: GraphNode) => Promise<GraphNode[]> | GraphNode[];\n\nexport default class ThrottleEngine {\n  private static instance_: ThrottleEngine;\n\n  static get instance() {\n    if (!this.instance_) {\n      this.instance_ = new ThrottleEngine();\n    }\n    return this.instance_;\n  }\n\n  private queues: { [tag: string]: [ProcessFunction, GraphNode][] } = {};\n  private runningCounts: { [tag: string]: number } = {};\n  private maxConcurrencyPerTag: { [tag: string]: number } = {};\n\n  private functionIdToPromiseResolve: {\n    [functionInstanceId: string]: (value: GraphNode[]) => void;\n  } = {};\n\n  /**\n   * Set a custom concurrency limit for a specific tag\n   */\n  setConcurrencyLimit(tag: string, limit: number) {\n    console.log(\"setConcurrency\", tag, limit);\n    this.maxConcurrencyPerTag[tag] = limit;\n  }\n\n  throttle(\n    fn: ProcessFunction,\n    node: GraphNode,\n    tag: string = \"default\",\n  ): Promise<GraphNode[]> {\n    const functionPromise = new Promise((resolve) => {\n      this.functionIdToPromiseResolve[node.id] = resolve as (\n        value: GraphNode[],\n      ) => void;\n    }) as Promise<GraphNode[]>;\n\n    this.queues[tag] ??= [];\n    this.queues[tag].push([fn, node]);\n\n    console.log(node.lightExport().__task.__name, tag, this.queues[tag]);\n\n    // Default to 1 if not set\n    this.maxConcurrencyPerTag[tag] ??= 1;\n\n    this.processQueue(tag);\n\n    return functionPromise;\n  }\n\n  private processQueue(tag: string) {\n    const maxAllowed = this.maxConcurrencyPerTag[tag];\n\n    while (\n      (this.queues[tag]?.length ?? 0) > 0 &&\n      (this.runningCounts[tag] ?? 0) < maxAllowed\n    ) {\n      this.runningCounts[tag] = (this.runningCounts[tag] || 0) + 1;\n      const item = this.queues[tag].shift()!;\n      this.process(item).then(() => {\n        this.runningCounts[tag]--;\n        this.processQueue(tag); // Re-check queue\n      });\n    }\n\n    // Clean up if done\n    if (\n      (this.queues[tag]?.length ?? 0) === 0 &&\n      this.runningCounts[tag] === 0\n    ) {\n      delete this.queues[tag];\n      delete this.runningCounts[tag];\n    }\n  }\n\n  private async process(item: [ProcessFunction, GraphNode]) {\n    const fn = item[0];\n    const node = item[1];\n\n    const context = await fn(node);\n\n    this.functionIdToPromiseResolve[node.id](context);\n    delete this.functionIdToPromiseResolve[node.id];\n  }\n}\n","import GraphNode from \"./GraphNode\";\nimport GraphLayer from \"../../interfaces/GraphLayer\";\nimport ThrottleEngine from \"../../engine/ThrottleEngine\";\n\nexport default class AsyncGraphLayer extends GraphLayer {\n  protected waitingNodes: GraphNode[] = [];\n  protected processingNodes: Set<GraphNode> = new Set();\n\n  constructor(index: number) {\n    super(index);\n  }\n\n  add(node: GraphNode) {\n    this.nodes.push(node);\n    this.waitingNodes.push(node);\n  }\n\n  execute() {\n    if (this.waitingNodes.length === 0) {\n      return {};\n    }\n\n    this.start();\n\n    const result: {\n      [routineExecId: string]: (GraphNode[] | Promise<GraphNode[]>)[];\n    } = {};\n\n    while (this.waitingNodes.length > 0) {\n      const node = this.waitingNodes.pop();\n      if (!node) {\n        break;\n      }\n\n      this.processingNodes.add(node);\n\n      result[node.routineExecId] ??= [];\n\n      let nextNodes;\n      if (node?.getConcurrency()) {\n        const tag = node.getTag();\n        ThrottleEngine.instance.setConcurrencyLimit(tag, node.getConcurrency());\n        nextNodes = ThrottleEngine.instance.throttle(\n          this.processNode.bind(this),\n          node,\n          tag,\n        );\n      } else {\n        nextNodes = this.processNode(node);\n      }\n\n      result[node.routineExecId].push(nextNodes);\n    }\n\n    if (this.processingNodes.size === 0) {\n      this.end();\n    }\n\n    return result;\n  }\n\n  processNode(node: GraphNode): Promise<GraphNode[]> | GraphNode[] {\n    node.start();\n\n    const nextNodes = node.execute();\n\n    if (nextNodes instanceof Promise) {\n      return this.processAsync(node, nextNodes);\n    }\n\n    this.processingNodes.delete(node);\n\n    return nextNodes;\n  }\n\n  private async processAsync(node: GraphNode, nextNodes: Promise<GraphNode[]>) {\n    const result = await nextNodes;\n    this.processingNodes.delete(node);\n    return result;\n  }\n\n  destroy() {\n    super.destroy();\n    this.waitingNodes = [];\n    this.processingNodes = new Set();\n  }\n}\n","import GraphBuilder from \"../../interfaces/GraphBuilder\";\nimport { sleep } from \"../../utils/promise\";\nimport AsyncGraphLayer from \"../../graph/execution/AsyncGraphLayer\";\nimport GraphNode from \"../../graph/execution/GraphNode\";\n\nexport default class GraphAsyncQueueBuilder extends GraphBuilder {\n  async compose() {\n    if (!this.graph) {\n      return;\n    }\n\n    const layers = this.graph.getIterator();\n\n    while (true) {\n      let layer = layers.getFirst();\n      if (layer.graphDone()) {\n        return;\n      }\n\n      this.processLayer(layer as AsyncGraphLayer);\n\n      while (layers.hasNext()) {\n        layer = layers.next();\n        this.processLayer(layer as AsyncGraphLayer);\n      }\n\n      await sleep(0); // Take a breath\n    }\n  }\n\n  private processLayer(layer: AsyncGraphLayer) {\n    const nextNodes = layer.execute();\n    for (const routineExecId of Object.keys(nextNodes)) {\n      const group = nextNodes[routineExecId];\n      if (group.some((nodes) => nodes instanceof Promise)) {\n        Promise.all(group).then((result) =>\n          this.addNodes(result.flat() as GraphNode[]),\n        );\n      } else {\n        this.addNodes(group.flat() as GraphNode[]);\n      }\n    }\n  }\n\n  protected createLayer(index: number) {\n    const layer = new AsyncGraphLayer(index);\n    layer.setDebug(this.debug);\n    return layer;\n  }\n}\n","import GraphRunStrategy from \"../../interfaces/GraphRunStrategy\";\nimport GraphAsyncQueueBuilder from \"../builders/GraphAsyncQueueBuilder\";\n\nexport default class GraphAsyncRun extends GraphRunStrategy {\n  constructor() {\n    super();\n    this.graphBuilder = new GraphAsyncQueueBuilder();\n  }\n\n  async run() {\n    await this.graphBuilder.compose();\n    this.updateRunInstance();\n    this.reset();\n  }\n\n  protected reset() {\n    super.reset();\n  }\n\n  export(): any {\n    return {};\n  }\n}\n","import GraphRunStrategy from \"../../interfaces/GraphRunStrategy\";\n\nexport default class GraphStandardRun extends GraphRunStrategy {\n  run() {\n    this.graphBuilder.compose();\n    this.updateRunInstance();\n    this.reset();\n  }\n\n  export(): any {\n    return {};\n  }\n}\n","import SignalBroker from \"./engine/SignalBroker\";\nimport GraphRunner from \"./engine/GraphRunner\";\nimport GraphRegistry from \"./registry/GraphRegistry\";\nimport Task, { TaskFunction, ThrottleTagGetter } from \"./graph/definition/Task\";\nimport DebounceTask, { DebounceOptions } from \"./graph/definition/DebounceTask\";\nimport EphemeralTask from \"./graph/definition/EphemeralTask\";\nimport GraphRoutine from \"./graph/definition/GraphRoutine\";\nimport GraphAsyncRun from \"./engine/strategy/GraphAsyncRun\";\nimport GraphStandardRun from \"./engine/strategy/GraphStandardRun\";\nimport { SchemaDefinition } from \"./types/schema\";\n\nexport interface TaskOptions {\n  concurrency?: number;\n  timeout?: number;\n  register?: boolean;\n  isUnique?: boolean;\n  isMeta?: boolean;\n  getTagCallback?: ThrottleTagGetter;\n  inputSchema?: SchemaDefinition;\n  validateInputContext?: boolean;\n  outputSchema?: SchemaDefinition;\n  validateOutputContext?: boolean;\n}\n\nexport type CadenzaMode = \"dev\" | \"debug\" | \"production\";\n\nexport default class Cadenza {\n  static broker: SignalBroker;\n  static runner: GraphRunner;\n  static metaRunner: GraphRunner;\n  static registry: GraphRegistry;\n  protected static isBootstrapped = false;\n  protected static mode: CadenzaMode = \"production\";\n\n  protected static bootstrap(): void {\n    if (this.isBootstrapped) return;\n    this.isBootstrapped = true;\n\n    // 1. SignalBroker (empty, for observations)\n    this.broker = SignalBroker.instance;\n\n    // 2. Runners (now init broker with them)\n    this.runner = new GraphRunner();\n    this.metaRunner = new GraphRunner(true);\n    this.broker.bootstrap(this.runner, this.metaRunner);\n\n    if (this.mode === \"debug\" || this.mode === \"dev\") {\n      this.broker.setDebug(true);\n      this.runner.setDebug(true);\n    }\n\n    // 3. GraphRegistry (seed observes on broker)\n    this.registry = GraphRegistry.instance;\n\n    // 4. Runners (create meta tasks)\n    this.broker.init();\n    this.runner.init();\n    this.metaRunner.init();\n  }\n\n  public static get runStrategy() {\n    return {\n      PARALLEL: new GraphAsyncRun(),\n      SEQUENTIAL: new GraphStandardRun(),\n    };\n  }\n\n  public static setMode(mode: CadenzaMode) {\n    this.mode = mode;\n\n    this.bootstrap();\n\n    if (mode === \"debug\" || mode === \"dev\") {\n      this.broker.setDebug(true);\n      this.runner.setDebug(true);\n    }\n  }\n\n  /**\n   * Validates a name for uniqueness and non-emptiness.\n   * @param name The name to validate.\n   * @throws Error if invalid.\n   */\n  protected static validateName(name: string): void {\n    if (!name || typeof name !== \"string\") {\n      throw new Error(\"Task or Routine name must be a non-empty string.\");\n    }\n    // Further uniqueness check delegated to GraphRegistry.register*\n  }\n\n  /**\n   * Creates a standard Task and registers it in the GraphRegistry.\n   * @param name Unique identifier for the task.\n   * @param func The function or async generator to execute.\n   * @param description Optional human-readable description for introspection.\n   * @param options Optional task options.\n   * @returns The created Task instance.\n   * @throws Error if name is invalid or duplicate in registry.\n   */\n  static createTask(\n    name: string,\n    func: TaskFunction,\n    description?: string,\n    options: TaskOptions = {\n      concurrency: 0,\n      timeout: 0,\n      register: true,\n      isUnique: false,\n      isMeta: false,\n      getTagCallback: undefined,\n      inputSchema: undefined,\n      validateInputContext: false,\n      outputSchema: undefined,\n      validateOutputContext: false,\n    },\n  ): Task {\n    this.bootstrap();\n    this.validateName(name);\n    return new Task(\n      name,\n      func,\n      description,\n      options.concurrency,\n      options.timeout,\n      options.register,\n      options.isUnique,\n      options.isMeta,\n      options.getTagCallback,\n      options.inputSchema,\n      options.validateInputContext,\n      options.outputSchema,\n      options.validateOutputContext,\n    );\n  }\n\n  /**\n   * Creates a MetaTask (for meta-layer graphs) and registers it.\n   * MetaTasks suppress further meta-signal emissions to prevent loops.\n   * @param name Unique identifier for the meta-task.\n   * @param func The function or async generator to execute.\n   * @param description Optional description.\n   * @param options Optional task options.\n   * @returns The created MetaTask instance.\n   * @throws Error if name invalid or duplicate.\n   */\n  static createMetaTask(\n    name: string,\n    func: TaskFunction,\n    description?: string,\n    options: TaskOptions = {\n      concurrency: 0,\n      timeout: 0,\n      register: true,\n      isUnique: false,\n      isMeta: true,\n      getTagCallback: undefined,\n      inputSchema: undefined,\n      validateInputContext: false,\n      outputSchema: undefined,\n      validateOutputContext: false,\n    },\n  ): Task {\n    options.isMeta = true;\n    return this.createTask(name, func, description, options);\n  }\n\n  /**\n   * Creates a UniqueTask (executes once per execution ID, merging parents) and registers it.\n   * Use for fan-in/joins after parallel branches.\n   * @param name Unique identifier.\n   * @param func Function receiving joinedContexts.\n   * @param description Optional description.\n   * @param options Optional task options.\n   * @returns The created UniqueTask.\n   * @throws Error if invalid.\n   */\n  static createUniqueTask(\n    name: string,\n    func: TaskFunction,\n    description?: string,\n    options: TaskOptions = {\n      concurrency: 0,\n      timeout: 0,\n      register: true,\n      isUnique: true,\n      isMeta: false,\n      getTagCallback: undefined,\n      inputSchema: undefined,\n      validateInputContext: false,\n      outputSchema: undefined,\n      validateOutputContext: false,\n    },\n  ): Task {\n    options.isUnique = true;\n    return this.createTask(name, func, description, options);\n  }\n\n  /**\n   * Creates a UniqueMetaTask for meta-layer joins.\n   * @param name Unique identifier.\n   * @param func Function.\n   * @param description Optional.\n   * @param options Optional task options.\n   * @returns The created UniqueMetaTask.\n   */\n  static createUniqueMetaTask(\n    name: string,\n    func: TaskFunction,\n    description?: string,\n    options: TaskOptions = {\n      concurrency: 0,\n      timeout: 0,\n      register: true,\n      isUnique: true,\n      isMeta: true,\n      getTagCallback: undefined,\n      inputSchema: undefined,\n      validateInputContext: false,\n      outputSchema: undefined,\n      validateOutputContext: false,\n    },\n  ): Task {\n    options.isMeta = true;\n    return this.createUniqueTask(name, func, description, options);\n  }\n\n  /**\n   * Creates a ThrottledTask (rate-limited by concurrency or custom groups) and registers it.\n   * @param name Unique identifier.\n   * @param func Function.\n   * @param throttledIdGetter Optional getter for dynamic grouping (e.g., per-user).\n   * @param description Optional.\n   * @param options Optional task options.\n   * @returns The created ThrottledTask.\n   * @edge If no getter, throttles per task ID; use for resource protection.\n   */\n  static createThrottledTask(\n    name: string,\n    func: TaskFunction,\n    throttledIdGetter: ThrottleTagGetter = () => \"default\",\n    description?: string,\n    options: TaskOptions = {\n      concurrency: 1,\n      timeout: 0,\n      register: true,\n      isUnique: false,\n      isMeta: false,\n      inputSchema: undefined,\n      validateInputContext: false,\n      outputSchema: undefined,\n      validateOutputContext: false,\n    },\n  ): Task {\n    options.getTagCallback = throttledIdGetter;\n    return this.createTask(name, func, description, options);\n  }\n\n  /**\n   * Creates a ThrottledMetaTask for meta-layer throttling.\n   * @param name Identifier.\n   * @param func Function.\n   * @param throttledIdGetter Optional getter.\n   * @param description Optional.\n   * @param options Optional task options.\n   * @returns The created ThrottledMetaTask.\n   */\n  static createThrottledMetaTask(\n    name: string,\n    func: TaskFunction,\n    throttledIdGetter: ThrottleTagGetter,\n    description?: string,\n    options: TaskOptions = {\n      concurrency: 0,\n      timeout: 0,\n      register: true,\n      isUnique: false,\n      isMeta: true,\n      inputSchema: undefined,\n      validateInputContext: false,\n      outputSchema: undefined,\n      validateOutputContext: false,\n    },\n  ): Task {\n    options.isMeta = true;\n    return this.createThrottledTask(\n      name,\n      func,\n      throttledIdGetter,\n      description,\n      options,\n    );\n  }\n\n  /**\n   * Creates a DebounceTask (delays exec until quiet period) and registers it.\n   * @param name Identifier.\n   * @param func Function.\n   * @param description Optional.\n   * @param debounceTime Delay in ms (default 1000).\n   * @param options Optional task options plus optional debounce config (e.g., leading/trailing).\n   * @returns The created DebounceTask.\n   * @edge Multiple triggers within time collapse to one exec.\n   */\n  static createDebounceTask(\n    name: string,\n    func: TaskFunction,\n    description?: string,\n    debounceTime: number = 1000,\n    options: TaskOptions & DebounceOptions = {\n      concurrency: 0,\n      timeout: 0,\n      register: true,\n      leading: false,\n      trailing: true,\n      maxWait: 0,\n      isUnique: false,\n      isMeta: false,\n      inputSchema: undefined,\n      validateInputContext: false,\n      outputSchema: undefined,\n      validateOutputContext: false,\n    },\n  ): DebounceTask {\n    this.bootstrap();\n    this.validateName(name);\n    return new DebounceTask(\n      name,\n      func,\n      description,\n      debounceTime,\n      options.leading,\n      options.trailing,\n      options.maxWait,\n      options.concurrency,\n      options.timeout,\n      options.register,\n      options.isUnique,\n      options.isMeta,\n      options.inputSchema,\n      options.validateInputContext,\n      options.outputSchema,\n      options.validateOutputContext,\n    );\n  }\n\n  /**\n   * Creates a DebouncedMetaTask for meta-layer debouncing.\n   * @param name Identifier.\n   * @param func Function.\n   * @param description Optional.\n   * @param debounceTime Delay in ms.\n   * @param options Optional task options plus optional debounce config (e.g., leading/trailing).\n   * @returns The created DebouncedMetaTask.\n   */\n  static createDebounceMetaTask(\n    name: string,\n    func: TaskFunction,\n    description?: string,\n    debounceTime: number = 1000,\n    options: TaskOptions & DebounceOptions = {\n      concurrency: 0,\n      timeout: 0,\n      register: true,\n      leading: false,\n      trailing: true,\n      maxWait: 0,\n      isUnique: false,\n      isMeta: false,\n      inputSchema: undefined,\n      validateInputContext: false,\n      outputSchema: undefined,\n      validateOutputContext: false,\n    },\n  ): DebounceTask {\n    options.isMeta = true;\n    return this.createDebounceTask(\n      name,\n      func,\n      description,\n      debounceTime,\n      options,\n    );\n  }\n\n  /**\n   * Creates an EphemeralTask (self-destructs after exec or condition) without default registration.\n   * Useful for transients; optionally register if needed.\n   * @param name Identifier (may not be unique if not registered).\n   * @param func Function.\n   * @param description Optional.\n   * @param once Destroy after first exec (default true).\n   * @param destroyCondition Predicate for destruction (default always true).\n   * @param options Optional task options.\n   * @returns The created EphemeralTask.\n   * @edge Destruction triggered post-exec via Node/Builder; emits meta-signal for cleanup.\n   */\n  static createEphemeralTask(\n    name: string,\n    func: TaskFunction,\n    description?: string,\n    once: boolean = true,\n    destroyCondition: (context: any) => boolean = () => true,\n    options: TaskOptions = {\n      concurrency: 0,\n      timeout: 0,\n      register: true,\n      isUnique: false,\n      isMeta: false,\n      getTagCallback: undefined,\n      inputSchema: undefined,\n      validateInputContext: false,\n      outputSchema: undefined,\n      validateOutputContext: false,\n    },\n  ): EphemeralTask {\n    this.bootstrap();\n    this.validateName(name);\n    return new EphemeralTask(\n      name,\n      func,\n      description,\n      once,\n      destroyCondition,\n      options.concurrency,\n      options.timeout,\n      options.register,\n      options.isUnique,\n      options.isMeta,\n      options.getTagCallback,\n      options.inputSchema,\n      options.validateInputContext,\n      options.outputSchema,\n      options.validateOutputContext,\n    );\n  }\n\n  /**\n   * Creates an EphemeralMetaTask for meta-layer transients.\n   * @param name Identifier.\n   * @param func Function.\n   * @param description Optional.\n   * @param once Destroy after first (default true).\n   * @param destroyCondition Destruction predicate.\n   * @param options Optional task options.\n   * @returns The created EphemeralMetaTask.\n   */\n  static createEphemeralMetaTask(\n    name: string,\n    func: TaskFunction,\n    description?: string,\n    once: boolean = true,\n    destroyCondition: (context: any) => boolean = () => true,\n    options: TaskOptions = {\n      concurrency: 0,\n      timeout: 0,\n      register: true,\n      isUnique: false,\n      isMeta: true,\n      getTagCallback: undefined,\n      inputSchema: undefined,\n      validateInputContext: false,\n      outputSchema: undefined,\n      validateOutputContext: false,\n    },\n  ): EphemeralTask {\n    options.isMeta = true;\n    return this.createEphemeralTask(\n      name,\n      func,\n      description,\n      once,\n      destroyCondition,\n      options,\n    );\n  }\n\n  /**\n   * Creates a GraphRoutine (named entry to starting tasks) and registers it.\n   * @param name Unique identifier.\n   * @param tasks Starting tasks (can be empty, but warns as no-op).\n   * @param description Optional.\n   * @returns The created GraphRoutine.\n   * @edge If tasks empty, routine is valid but inert.\n   */\n  static createRoutine(\n    name: string,\n    tasks: Task[],\n    description: string = \"\",\n  ): GraphRoutine {\n    this.bootstrap();\n    this.validateName(name);\n    if (tasks.length === 0) {\n      console.warn(`Routine '${name}' created with no starting tasks (no-op).`);\n    }\n    return new GraphRoutine(name, tasks, description);\n  }\n\n  /**\n   * Creates a MetaRoutine for meta-layer entry points.\n   * @param name Identifier.\n   * @param tasks Starting tasks.\n   * @param description Optional.\n   * @returns The created MetaRoutine.\n   */\n  static createMetaRoutine(\n    name: string,\n    tasks: Task[],\n    description: string = \"\",\n  ): GraphRoutine {\n    this.bootstrap();\n    this.validateName(name);\n    if (tasks.length === 0) {\n      console.warn(`Routine '${name}' created with no starting tasks (no-op).`);\n    }\n    return new GraphRoutine(name, tasks, description, true);\n  }\n\n  static reset() {\n    this.broker?.reset();\n    this.registry?.reset();\n  }\n}\n","import Task from \"./Task\";\n\nexport default class SignalTask extends Task {\n  constructor(signal: string, description: string = \"\") {\n    super(signal, () => true, description);\n\n    this.signalsToEmit.add(signal);\n  }\n}\n","import Cadenza, { TaskOptions } from \"./Cadenza\";\nimport GraphRun from \"./engine/GraphRun\";\nimport GraphContext from \"./graph/context/GraphContext\";\nimport DebounceTask from \"./graph/definition/DebounceTask\";\nimport EphemeralTask from \"./graph/definition/EphemeralTask\";\nimport GraphRoutine from \"./graph/definition/GraphRoutine\";\nimport SignalTask from \"./graph/definition/SignalTask\";\nimport Task, { TaskResult, ThrottleTagGetter } from \"./graph/definition/Task\";\nimport SignalEmitter from \"./interfaces/SignalEmitter\";\nimport SignalParticipant from \"./interfaces/SignalParticipant\";\nimport GraphRegistry from \"./registry/GraphRegistry\";\nimport { AnyObject } from \"./types/global\";\nimport {\n  SchemaConstraints,\n  SchemaDefinition,\n  SchemaType,\n} from \"./types/schema\";\n\nexport default Cadenza;\nexport {\n  Task,\n  GraphRoutine,\n  DebounceTask,\n  EphemeralTask,\n  SignalTask,\n  SignalEmitter,\n  SignalParticipant,\n  GraphContext,\n  GraphRegistry,\n  GraphRun,\n  TaskResult,\n  TaskOptions,\n  AnyObject,\n  SchemaDefinition,\n  SchemaConstraints,\n  SchemaType,\n  ThrottleTagGetter,\n};\n"],"mappings":";AAMA,IAAqB,eAArB,MAAqB,cAAa;AAAA;AAAA,EA2DtB,cAAc;AA7CxB,SAAQ,QAAiB;AA+BzB,SAAU,kBAUN,oBAAI,IAAI;AAEZ,SAAU,aAAkD,oBAAI,IAAI;AAGlE,SAAK,UAAU,0BAA0B;AAAA,EAC3C;AAAA;AAAA;AAAA;AAAA;AAAA,EAtDA,WAAW,WAAyB;AAClC,QAAI,CAAC,KAAK,WAAW;AACnB,WAAK,YAAY,IAAI,cAAa;AAAA,IACpC;AACA,WAAO,KAAK;AAAA,EACd;AAAA,EAIA,SAAS,OAAgB;AACvB,SAAK,QAAQ;AAAA,EACf;AAAA,EAEU,mBAAmB,YAAoB;AAC/C,QAAI,WAAW,SAAS,KAAK;AAC3B,YAAM,IAAI,MAAM,8CAA8C;AAAA,IAChE;AAEA,QAAI,WAAW,SAAS,GAAG,GAAG;AAC5B,YAAM,IAA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