/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { NodeIdentifier, Outcome, OutputValues } from "@breadboard-ai/types"; import { OrchestrationPlan, OrchestratorProgress, Task, OrchestrationNodeInfo } from "./types.js"; export { Orchestrator }; /** * The Orchestrator acts as the state machine for running a graph. * Its primary responsibilities are: * * 1. Lifecycle Management: Starting, resetting, and managing the overall * progress of a run from beginning to end. * 2. Task Coordination: Determining which nodes are ready to be invoked * based on dependencies. * 3. State Persistence: Receiving results of node invocation and persisting * the state workflow. * 4. Inspection and Debugging: Providing methods to observe the current state * of a run, inspect cached results, and control execution flow. * * It breaks down the process into three distinct parts: * - the planning -- determining the static sequence of a run * - the orchestration -- managing execution results that can be dynamic * - actual node invocation */ declare class Orchestrator { #private; readonly plan: OrchestrationPlan; constructor(plan: OrchestrationPlan); /** * Returns current progress of the orchestration. */ get progress(): OrchestratorProgress; /** * Bring the orchestrator to the initial state. */ reset(): Outcome; restartAtStage(stage: number): Outcome; restartAtNode(id: NodeIdentifier): Outcome; setWorking(id: NodeIdentifier): Outcome; setWaiting(id: NodeIdentifier): Outcome; setInterrupted(id: NodeIdentifier): Outcome; /** * Provides a way to inspect the current state of nodes as they are being * orchestrated. * @returns a map representing current state of all nodes */ state(): ReadonlyMap; /** * Creates a list of current tasks: nodes to be invoked next, along * with their inputs, according to the current state of the orchestrator. */ currentTasks(): Outcome; /** * Submit results of a node invocation. Also updates the current state. */ provideOutputs(id: NodeIdentifier, outputs: OutputValues): Outcome; } //# sourceMappingURL=orchestrator.d.ts.map