@ghchinoy/litflow 0.2.7 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/CHANGELOG.md +59 -0
  2. package/dist/breadboard/data/common.d.ts +35 -0
  3. package/dist/breadboard/engine/loader/capability.d.ts +21 -0
  4. package/dist/breadboard/engine/loader/loader.d.ts +29 -0
  5. package/dist/breadboard/engine/loader/resolve-graph-urls.d.ts +16 -0
  6. package/dist/breadboard/engine/runtime/bubble.d.ts +23 -0
  7. package/dist/breadboard/engine/runtime/graph-based-node-handler.d.ts +16 -0
  8. package/dist/breadboard/engine/runtime/handler.d.ts +27 -0
  9. package/dist/breadboard/engine/runtime/harness/events.d.ts +145 -0
  10. package/dist/breadboard/engine/runtime/harness/local.d.ts +10 -0
  11. package/dist/breadboard/engine/runtime/harness/plan-runner.d.ts +25 -0
  12. package/dist/breadboard/engine/runtime/run/invoke-graph.d.ts +12 -0
  13. package/dist/breadboard/engine/runtime/run/node-invoker.d.ts +12 -0
  14. package/dist/breadboard/engine/runtime/run/run-graph.d.ts +12 -0
  15. package/dist/breadboard/engine/runtime/run.d.ts +29 -0
  16. package/dist/breadboard/engine/runtime/sandbox/capabilities-manager.d.ts +15 -0
  17. package/dist/breadboard/engine/runtime/sandbox/file-system-handler-factory.d.ts +15 -0
  18. package/dist/breadboard/engine/runtime/sandbox/invoke-describer.d.ts +10 -0
  19. package/dist/breadboard/engine/runtime/static/create-plan.d.ts +14 -0
  20. package/dist/breadboard/engine/runtime/static/orchestrator.d.ts +72 -0
  21. package/dist/breadboard/engine/runtime/traversal/index.d.ts +20 -0
  22. package/dist/breadboard/engine/runtime/traversal/iterator.d.ts +12 -0
  23. package/dist/breadboard/engine/runtime/traversal/machine.d.ts +14 -0
  24. package/dist/breadboard/engine/runtime/traversal/representation.d.ts +27 -0
  25. package/dist/breadboard/engine/runtime/traversal/result.d.ts +24 -0
  26. package/dist/breadboard/engine/runtime/traversal/state.d.ts +34 -0
  27. package/dist/breadboard/lit-flow-runner.d.ts +13 -0
  28. package/dist/breadboard/lit-flow-runner.test.d.ts +1 -0
  29. package/dist/breadboard/runner.d.ts +13 -0
  30. package/dist/index.d.ts +2 -0
  31. package/dist/lit-chiclet.d.ts +9 -0
  32. package/dist/lit-schema-node.d.ts +13 -0
  33. package/dist/lit-schema-node.test.d.ts +1 -0
  34. package/dist/litflow.js +708 -442
  35. package/dist/litflow.js.map +1 -1
  36. package/package.json +18 -4
  37. package/src/breadboard/data/common.ts +450 -0
  38. package/src/breadboard/data/file-system.ts +54 -0
  39. package/src/breadboard/data/inline-all-content.ts +126 -0
  40. package/src/breadboard/data/recent-boards.ts +118 -0
  41. package/src/breadboard/data/save-outputs-as-file.ts +104 -0
  42. package/src/breadboard/engine/add-run-module.ts +168 -0
  43. package/src/breadboard/engine/editor/blank.ts +65 -0
  44. package/src/breadboard/engine/editor/edge.ts +27 -0
  45. package/src/breadboard/engine/editor/events.ts +64 -0
  46. package/src/breadboard/engine/editor/graph.ts +383 -0
  47. package/src/breadboard/engine/editor/history.ts +98 -0
  48. package/src/breadboard/engine/editor/index.ts +8 -0
  49. package/src/breadboard/engine/editor/operations/add-asset.ts +45 -0
  50. package/src/breadboard/engine/editor/operations/add-edge.ts +142 -0
  51. package/src/breadboard/engine/editor/operations/add-graph.ts +47 -0
  52. package/src/breadboard/engine/editor/operations/add-module.ts +64 -0
  53. package/src/breadboard/engine/editor/operations/add-node.ts +86 -0
  54. package/src/breadboard/engine/editor/operations/change-asset-metadata.ts +70 -0
  55. package/src/breadboard/engine/editor/operations/change-configuration.ts +82 -0
  56. package/src/breadboard/engine/editor/operations/change-edge-metadata.ts +58 -0
  57. package/src/breadboard/engine/editor/operations/change-edge.ts +111 -0
  58. package/src/breadboard/engine/editor/operations/change-graph-metadata.ts +52 -0
  59. package/src/breadboard/engine/editor/operations/change-metadata.ts +92 -0
  60. package/src/breadboard/engine/editor/operations/change-module.ts +64 -0
  61. package/src/breadboard/engine/editor/operations/error.ts +21 -0
  62. package/src/breadboard/engine/editor/operations/remove-asset.ts +48 -0
  63. package/src/breadboard/engine/editor/operations/remove-edge.ts +89 -0
  64. package/src/breadboard/engine/editor/operations/remove-graph.ts +49 -0
  65. package/src/breadboard/engine/editor/operations/remove-integration.ts +54 -0
  66. package/src/breadboard/engine/editor/operations/remove-module.ts +69 -0
  67. package/src/breadboard/engine/editor/operations/remove-node.ts +86 -0
  68. package/src/breadboard/engine/editor/operations/replace-graph.ts +52 -0
  69. package/src/breadboard/engine/editor/operations/toggle-export.ts +72 -0
  70. package/src/breadboard/engine/editor/operations/upsert-integration.ts +43 -0
  71. package/src/breadboard/engine/editor/selection.ts +58 -0
  72. package/src/breadboard/engine/editor/transforms/configure-sidewire.ts +73 -0
  73. package/src/breadboard/engine/editor/transforms/isolate-selection.ts +54 -0
  74. package/src/breadboard/engine/editor/transforms/merge-graph.ts +58 -0
  75. package/src/breadboard/engine/editor/transforms/move-to-graph.ts +102 -0
  76. package/src/breadboard/engine/editor/transforms/move-to-new-graph.ts +72 -0
  77. package/src/breadboard/engine/editor/transforms/sidewire-to-new-graph.ts +82 -0
  78. package/src/breadboard/engine/file-system/blob-transform.ts +44 -0
  79. package/src/breadboard/engine/file-system/composed-peristent-backend.ts +140 -0
  80. package/src/breadboard/engine/file-system/ephemeral-blob-store.ts +46 -0
  81. package/src/breadboard/engine/file-system/in-memory-blob-store.ts +87 -0
  82. package/src/breadboard/engine/file-system/index.ts +723 -0
  83. package/src/breadboard/engine/file-system/partial-persistent-backend.ts +109 -0
  84. package/src/breadboard/engine/file-system/path.ts +125 -0
  85. package/src/breadboard/engine/file-system/persistent-file.ts +66 -0
  86. package/src/breadboard/engine/file-system/readable-stream-file.ts +61 -0
  87. package/src/breadboard/engine/file-system/stub-file-system.ts +47 -0
  88. package/src/breadboard/engine/file-system/utils.ts +40 -0
  89. package/src/breadboard/engine/inspector/graph/bubbled-node.ts +162 -0
  90. package/src/breadboard/engine/inspector/graph/describe-cache.ts +78 -0
  91. package/src/breadboard/engine/inspector/graph/describe-type-cache.ts +48 -0
  92. package/src/breadboard/engine/inspector/graph/edge-cache.ts +118 -0
  93. package/src/breadboard/engine/inspector/graph/edge.ts +133 -0
  94. package/src/breadboard/engine/inspector/graph/event.ts +35 -0
  95. package/src/breadboard/engine/inspector/graph/exports-describer.ts +45 -0
  96. package/src/breadboard/engine/inspector/graph/graph-cache.ts +54 -0
  97. package/src/breadboard/engine/inspector/graph/graph-describer-manager.ts +338 -0
  98. package/src/breadboard/engine/inspector/graph/graph-descriptor-handle.ts +73 -0
  99. package/src/breadboard/engine/inspector/graph/graph-node-type.ts +111 -0
  100. package/src/breadboard/engine/inspector/graph/graph-queries.ts +256 -0
  101. package/src/breadboard/engine/inspector/graph/graph.ts +163 -0
  102. package/src/breadboard/engine/inspector/graph/inspectable-asset.ts +36 -0
  103. package/src/breadboard/engine/inspector/graph/kits.ts +208 -0
  104. package/src/breadboard/engine/inspector/graph/module.ts +69 -0
  105. package/src/breadboard/engine/inspector/graph/mutable-graph.ts +150 -0
  106. package/src/breadboard/engine/inspector/graph/node-cache.ts +123 -0
  107. package/src/breadboard/engine/inspector/graph/node-describer-manager.ts +279 -0
  108. package/src/breadboard/engine/inspector/graph/node-type-describer-manager.ts +122 -0
  109. package/src/breadboard/engine/inspector/graph/node.ts +149 -0
  110. package/src/breadboard/engine/inspector/graph/port-cache.ts +80 -0
  111. package/src/breadboard/engine/inspector/graph/ports.ts +292 -0
  112. package/src/breadboard/engine/inspector/graph/schemas.ts +131 -0
  113. package/src/breadboard/engine/inspector/graph/virtual-node.ts +184 -0
  114. package/src/breadboard/engine/inspector/graph-store.ts +629 -0
  115. package/src/breadboard/engine/inspector/index.ts +13 -0
  116. package/src/breadboard/engine/inspector/utils.ts +20 -0
  117. package/src/breadboard/engine/loader/capability.ts +184 -0
  118. package/src/breadboard/engine/loader/index.ts +14 -0
  119. package/src/breadboard/engine/loader/loader.ts +244 -0
  120. package/src/breadboard/engine/loader/resolve-graph-urls.ts +111 -0
  121. package/src/breadboard/engine/runtime/bubble.ts +269 -0
  122. package/src/breadboard/engine/runtime/graph-based-node-handler.ts +174 -0
  123. package/src/breadboard/engine/runtime/handler.ts +166 -0
  124. package/src/breadboard/engine/runtime/harness/diagnostics.ts +22 -0
  125. package/src/breadboard/engine/runtime/harness/events.ts +217 -0
  126. package/src/breadboard/engine/runtime/harness/index.ts +14 -0
  127. package/src/breadboard/engine/runtime/harness/local.ts +48 -0
  128. package/src/breadboard/engine/runtime/harness/plan-runner.ts +759 -0
  129. package/src/breadboard/engine/runtime/index.ts +8 -0
  130. package/src/breadboard/engine/runtime/legacy.ts +28 -0
  131. package/src/breadboard/engine/runtime/run/invoke-graph.ts +79 -0
  132. package/src/breadboard/engine/runtime/run/node-invoker.ts +137 -0
  133. package/src/breadboard/engine/runtime/run/run-graph.ts +186 -0
  134. package/src/breadboard/engine/runtime/run.ts +111 -0
  135. package/src/breadboard/engine/runtime/sandbox/capabilities-manager.ts +253 -0
  136. package/src/breadboard/engine/runtime/sandbox/file-system-handler-factory.ts +53 -0
  137. package/src/breadboard/engine/runtime/sandbox/invoke-describer.ts +125 -0
  138. package/src/breadboard/engine/runtime/static/condense.ts +155 -0
  139. package/src/breadboard/engine/runtime/static/create-plan.ts +134 -0
  140. package/src/breadboard/engine/runtime/static/nodes-to-subgraph.ts +168 -0
  141. package/src/breadboard/engine/runtime/static/orchestrator.ts +664 -0
  142. package/src/breadboard/engine/runtime/static/types.ts +77 -0
  143. package/src/breadboard/engine/runtime/traversal/index.ts +58 -0
  144. package/src/breadboard/engine/runtime/traversal/iterator.ts +124 -0
  145. package/src/breadboard/engine/runtime/traversal/machine.ts +58 -0
  146. package/src/breadboard/engine/runtime/traversal/representation.ts +115 -0
  147. package/src/breadboard/engine/runtime/traversal/result.ts +72 -0
  148. package/src/breadboard/engine/runtime/traversal/state.ts +115 -0
  149. package/src/breadboard/engine/telemetry.ts +121 -0
  150. package/src/breadboard/engine/types.ts +32 -0
  151. package/src/breadboard/lit-flow-runner.test.ts +44 -0
  152. package/src/breadboard/lit-flow-runner.ts +98 -0
  153. package/src/breadboard/runner.ts +80 -0
  154. package/src/index.ts +2 -0
  155. package/src/lit-chiclet.ts +69 -0
  156. package/src/lit-flow.ts +17 -7
  157. package/src/lit-schema-node.test.ts +65 -0
  158. package/src/lit-schema-node.ts +194 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,59 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ ## 2025-12-26
6
+ - Implement M3-styled Controls component (litflow-qwm)
7
+ - Style lit-handle with Material 3 (litflow-rip)
8
+ - Style lit-node with Material 3 (litflow-clx)
9
+ - Example: Static Documentation Display (litflow-l52)
10
+ - Packaging and Distribution (litflow-b9b)
11
+ - Example: Subflows (Parent/Child) (litflow-2lt)
12
+ - Example: Custom Edges (Step/SmoothStep) (litflow-8zz)
13
+ - Implement manual edge connections (litflow-ycn)
14
+ - Establish Material 3 Design System (litflow-m7y)
15
+ - Investigate and fix node jumping on subsequent drags (litflow-v7y)
16
+ - Example: Custom Nodes with Lit templates (litflow-aop)
17
+ - Implement Controls and MiniMap components (litflow-04c)
18
+ - Example: Dynamic Interactivity (Add/Remove) (litflow-4bd)
19
+ - Implement SignalWatcher in lit-node and lit-edge (litflow-lu1)
20
+ - Integrate Lit Signals for state management (litflow-txd)
21
+ - Refactor store.ts to use @lit-labs/signals (litflow-jdv)
22
+ - Migrate from npm to pnpm (litflow-ytd)
23
+ - Example: Multiple Handles/Ports (litflow-e6c)
24
+ - Example: Basic Flow (litflow-xzk)
25
+ - Setup examples/ directory and base runner (litflow-8oj)
26
+
27
+ ## 2025-12-27
28
+ - Implement Advanced FitView (litflow-w6a)
29
+ - Example: Gemini AI Nodes (Prompt & Image) (litflow-ln0)
30
+ - Implement Keyboard Interactivity (litflow-d81)
31
+ - Validate and Debug Marquee Selection reliability (litflow-cc1)
32
+ - Example: Overview (litflow-59h)
33
+ - Implement Marquee Selection (litflow-ucl)
34
+ - Investigate and implement Edge Labels (litflow-3z2)
35
+ - Implement Edge Markers (Arrowheads) (litflow-c56)
36
+ - Configurable Node Naming on Drop (litflow-8ku)
37
+ - Create Drag & Drop Guide (litflow-w6v)
38
+ - Example: Drag & Drop (litflow-lyd)
39
+ - Implement M3-styled Sidebar for Drag & Drop (litflow-kyi)
40
+ - Implement project method in LitFlow (litflow-ypx)
41
+ - Investigate and implement Edge Labels (litflow-1ed)
42
+ - Tutorial: Building Static Documentation with LitFlow (litflow-vgd)
43
+ - Project Documentation System (Eleventy + Diataxis + gh-pages) (litflow-46j)
44
+ - Draft Welcome Landing Page (litflow-46j.5)
45
+ - Configure GitHub Actions Deployment (litflow-46j.4)
46
+ - Implement Live Example integration (litflow-46j.3)
47
+ - Migrate and structure docs using Diataxis (litflow-46j.2)
48
+ - Initialize Eleventy project in docs/ (litflow-46j.1)
49
+ - Example: Graphviz to LitFlow (litflow-48p)
50
+
51
+ ## 2025-12-29
52
+ - Implement Real LitFlowRunner (litflow-wmj)
53
+ - Implement Mock Runner (litflow-wjn)
54
+ - Implement LitSchemaNode (litflow-ztw)
55
+ - Analysis: Phase 3 - GenAI & Gemini Integration (litflow-9ms)
56
+ - Analysis: Phase 2 - Graph Execution (The Core) (litflow-i81)
57
+ - Designer: Integrate Drag & Drop Palette (litflow-aa8)
58
+ - Example: Inspector Designer with live JSON sync (litflow-0i5)
59
+
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2024 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { CodeExecutionResultPart, ExecutableCodePart, FileDataPart, FunctionCallCapabilityPart, FunctionResponseCapabilityPart, InlineDataCapabilityPart, JSONPart, ListPart, LLMContent, OutputValues, StoredDataCapabilityPart, TextCapabilityPart } from "@breadboard-ai/types";
7
+ import { Chunk, DataCapability, DataPartTransformer, DataPartTransformType, Outcome } from "@breadboard-ai/types";
8
+ import { isStoredData } from "@breadboard-ai/utils";
9
+ export { isCodeExecutionResultPart, isExecutableCodePart, isStoredData };
10
+ export declare function isImageURL(nodeValue: unknown): nodeValue is {
11
+ image_url: string;
12
+ };
13
+ export declare function isTextCapabilityPart(part: unknown): part is TextCapabilityPart;
14
+ export declare function isFileDataCapabilityPart(part: unknown): part is FileDataPart;
15
+ export declare function isFunctionCallCapabilityPart(part: unknown): part is FunctionCallCapabilityPart;
16
+ export declare function isFunctionResponseCapabilityPart(part: unknown): part is FunctionResponseCapabilityPart;
17
+ export declare function isJSONPart(part: unknown): part is JSONPart;
18
+ export declare function isListPart(part: unknown): part is ListPart;
19
+ export declare function isLLMContent(nodeValue: unknown): nodeValue is LLMContent;
20
+ export declare function isLLMContentArray(nodeValue: unknown): nodeValue is LLMContent[];
21
+ export declare function isMetadataEntry(nodeValue: LLMContent): boolean;
22
+ export declare const isDataCapability: (value: unknown) => value is DataCapability;
23
+ export declare const asBlob: (part: InlineDataCapabilityPart | StoredDataCapabilityPart | Chunk) => Promise<Blob>;
24
+ export declare const isChunk: (value: unknown) => value is Chunk;
25
+ export declare const isInlineData: (value: unknown) => value is InlineDataCapabilityPart;
26
+ declare function isCodeExecutionResultPart(value: unknown): value is CodeExecutionResultPart;
27
+ declare function isExecutableCodePart(value: unknown): value is ExecutableCodePart;
28
+ export declare const isSerializedData: (value: unknown) => value is InlineDataCapabilityPart;
29
+ export declare function asBase64(file: File | Blob): Promise<string>;
30
+ export declare function asBase64DataUrl(blob: Blob): Promise<string>;
31
+ export declare function retrieveAsBlob(part: StoredDataCapabilityPart, graphUrl?: URL): Promise<Blob>;
32
+ export declare function toInlineDataPart(part: StoredDataCapabilityPart, graphUrl?: URL): Promise<InlineDataCapabilityPart>;
33
+ export declare function toStoredDataPart(part: InlineDataCapabilityPart | StoredDataCapabilityPart | Blob): Promise<StoredDataCapabilityPart>;
34
+ export declare function transformDataParts(graphUrl: URL, contents: LLMContent[], to: DataPartTransformType, transformer: DataPartTransformer): Promise<Outcome<LLMContent[]>>;
35
+ export declare function convertStoredPartsToAbsoluteUrls(values: OutputValues | undefined, graphUrl?: string): OutputValues;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2024 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { GraphLoaderResult, NodeHandlerContext, NodeValue, OutputValues } from "@breadboard-ai/types";
7
+ import { BreadboardCapability, GraphDescriptorBoardCapability, ResolvedURLBoardCapability, UnresolvedPathBoardCapability } from "@breadboard-ai/types/legacy.js";
8
+ export declare const isBreadboardCapability: (o: unknown) => o is BreadboardCapability;
9
+ export declare const isGraphDescriptorCapability: (capability: BreadboardCapability) => capability is GraphDescriptorBoardCapability;
10
+ export declare const isResolvedURLBoardCapability: (capability: BreadboardCapability) => capability is ResolvedURLBoardCapability;
11
+ export declare const isUnresolvedPathBoardCapability: (capability: BreadboardCapability) => capability is UnresolvedPathBoardCapability;
12
+ export declare const graphDescriptorFromCapability: (capability: BreadboardCapability, context?: NodeHandlerContext) => Promise<GraphLoaderResult>;
13
+ export declare const getGraphDescriptor: (board: unknown, context?: NodeHandlerContext) => Promise<GraphLoaderResult>;
14
+ /**
15
+ * Resolves any BreadboardCapability instances that are
16
+ * `UnresolvedPathBoardCapability` to `ResolvedURLBoardCapability`.
17
+ * This must happen at run-time, at the earliest moment when
18
+ * the inputs are received by the BoardRunner.
19
+ */
20
+ export declare const resolveBoardCapabilities: (outputs: OutputValues, context: NodeHandlerContext, url?: string) => Promise<OutputValues>;
21
+ export declare const resolveBoardCapabilitiesInInputs: (values: Record<string, NodeValue>, context: NodeHandlerContext, url?: string) => Record<string, NodeValue>;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { GraphDescriptor, GraphLoader, GraphLoaderContext, GraphLoaderResult, GraphProvider, GraphToRun } from "@breadboard-ai/types";
7
+ export declare const SENTINEL_BASE_URL: URL;
8
+ export { getGraphUrl, getGraphUrlComponents, resolveGraph, urlComponentsFromString, };
9
+ declare function getGraphUrl(path: string, context: GraphLoaderContext): URL;
10
+ declare function getGraphUrlComponents(url: URL): {
11
+ mainGraphUrl: string;
12
+ graphId: string;
13
+ moduleId?: string;
14
+ };
15
+ declare function resolveGraph(graphToRun: GraphToRun): GraphDescriptor;
16
+ export declare const removeHash: (url: URL) => URL;
17
+ export declare const sameWithoutHash: (a: URL, b: URL) => boolean;
18
+ export declare const baseURLFromString: (urlString: string | undefined) => URL | null;
19
+ export declare const baseURLFromContext: (context: GraphLoaderContext) => URL;
20
+ declare function urlComponentsFromString(urlString: string, context?: GraphLoaderContext): {
21
+ mainGraphUrl: string;
22
+ graphId: string;
23
+ moduleId?: string;
24
+ };
25
+ export declare class Loader implements GraphLoader {
26
+ #private;
27
+ constructor(graphProviders: GraphProvider[]);
28
+ load(path: string, context: GraphLoaderContext): Promise<GraphLoaderResult>;
29
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { GraphToRun } from "@breadboard-ai/types";
7
+ export { resolveGraphUrls };
8
+ /**
9
+ * Walks over the GraphDescriptor specified in GraphToRun and resolves all
10
+ * relative URLs in the GraphDescriptor to be absolute. Returns a new
11
+ * instance of a GraphToRun and a new instance of the GraphDescriptor.
12
+ *
13
+ * @param graphToRun an instance of GraphToRun
14
+ * @returns a new instance of GraphToRun
15
+ */
16
+ declare function resolveGraphUrls(graphToRun: GraphToRun): GraphToRun;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { GraphInlineMetadata, InputValues, NodeDescriptor, NodeHandlerContext, OutputValues, RunArguments, Schema, TraversalResult } from "@breadboard-ai/types";
7
+ import { RunResult } from "./run.js";
8
+ export declare const createErrorMessage: (inputName: string | string[], metadata: GraphInlineMetadata | undefined, required: boolean) => string;
9
+ export declare const bubbleUpInputsIfNeeded: (metadata: GraphInlineMetadata, context: NodeHandlerContext, descriptor: NodeDescriptor, result: TraversalResult, path: number[]) => Promise<void>;
10
+ export declare const createBubbleHandler: (metadata: GraphInlineMetadata, context: NodeHandlerContext, descriptor: NodeDescriptor) => (propertiesSchema: Schema, path: number[]) => Promise<OutputValues>;
11
+ export type InputSchemaHandler = (schema: Schema, path: number[]) => Promise<OutputValues>;
12
+ export declare class InputSchemaReader {
13
+ #private;
14
+ constructor(currentOutputs: OutputValues, inputs: InputValues, path: number[]);
15
+ read(handler: InputSchemaHandler): Promise<OutputValues>;
16
+ }
17
+ export declare class RequestedInputsManager {
18
+ #private;
19
+ constructor(args: RunArguments);
20
+ createHandler(next: (result: RunResult) => Promise<void>, result: TraversalResult): NodeHandlerContext["requestInput"];
21
+ }
22
+ export declare const bubbleUpOutputsIfNeeded: (outputs: OutputValues, descriptor: NodeDescriptor, context: NodeHandlerContext, path: number[]) => Promise<boolean>;
23
+ export declare const createOutputProvider: (next: (result: RunResult) => Promise<void>, result: TraversalResult, context: NodeHandlerContext) => (outputs: OutputValues, descriptor: NodeDescriptor, path: number[]) => Promise<void>;
@@ -0,0 +1,16 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2024 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { GraphToRun, InputValues, NodeDescriberContext, NodeDescriberResult, NodeHandlerContext, NodeHandlerMetadata, NodeHandlerObject, NodeTypeIdentifier, Schema } from "@breadboard-ai/types";
7
+ export { describerResultToNodeHandlerMetadata, GraphBasedNodeHandler, toNodeHandlerMetadata, };
8
+ declare class GraphBasedNodeHandler implements NodeHandlerObject {
9
+ #private;
10
+ constructor(graph: GraphToRun, type: NodeTypeIdentifier);
11
+ invoke(inputs: InputValues, context: NodeHandlerContext): Promise<import("@breadboard-ai/types").OutputValues>;
12
+ describe(inputs?: InputValues, inputSchema?: Schema, outputSchema?: Schema, context?: NodeDescriberContext): Promise<NodeDescriberResult>;
13
+ get metadata(): NodeHandlerMetadata | undefined;
14
+ }
15
+ declare function describerResultToNodeHandlerMetadata(result: NodeDescriberResult, updating: boolean): NodeHandlerMetadata;
16
+ declare function toNodeHandlerMetadata(graphToRun: GraphToRun, url: NodeTypeIdentifier, updating: boolean): NodeHandlerMetadata | undefined;
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { InputValues, Kit, MutableGraph, NodeHandler, NodeHandlerContext, NodeHandlerObject, NodeHandlers, NodeTypeIdentifier, OutputValues } from "@breadboard-ai/types";
7
+ export declare const callHandler: (handler: NodeHandler, inputs: InputValues, context: NodeHandlerContext) => Promise<OutputValues | void>;
8
+ export declare const handlersFromKits: (kits: Kit[]) => NodeHandlers;
9
+ /**
10
+ * The single entry point for getting a handler for a node type.
11
+ * The handler can be one of the two types:
12
+ * - A graph-based handler, where the `type` is actually a
13
+ * URL-like string that points to a graph.
14
+ * - A kit-based handler, where the `type` is a string that
15
+ * corresponds to a node type in a kit.
16
+ *
17
+ * The function throws an error if no handler is found for the
18
+ * given node type.
19
+ *
20
+ * @param type -- The node type to get a handler for.
21
+ * @param context -- The context in which the handler is
22
+ * being requested.
23
+ * @returns -- The handler for the node type.
24
+ */
25
+ export declare function getHandler(type: NodeTypeIdentifier, context: NodeHandlerContext): Promise<NodeHandler>;
26
+ export declare function getGraphHandlerFromMutableGraph(type: NodeTypeIdentifier, mutable: MutableGraph): Promise<NodeHandlerObject | undefined>;
27
+ export declare function getGraphHandler(type: NodeTypeIdentifier, context: NodeHandlerContext, allow3PModules?: boolean): Promise<NodeHandlerObject | undefined>;
@@ -0,0 +1,145 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2024 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { Edge, EdgeLifecycleState, End, ErrorResponse, GraphEndProbeData, GraphStartProbeData, HarnessRunResult, InputResponse, InputValues, NodeEndResponse, NodeIdentifier, NodeLifecycleState, NodeStartResponse, NodeValue, OutputResponse, RunEdgeStateChangeEvent, RunEndEvent, RunErrorEvent, RunGraphEndEvent, RunGraphStartEvent, RunInputEvent, RunLifecycleEvent, RunNextEvent, RunNodeEndEvent, RunNodeStartEvent, RunNodeStateChangeEvent, RunOutputEvent, RunSkipEvent, SkipProbeMessage, TraversalResult } from "@breadboard-ai/types";
7
+ export declare class PendingEvent extends Event {
8
+ data: {
9
+ timestamp: number;
10
+ };
11
+ static readonly eventName = "pending";
12
+ constructor(data: {
13
+ timestamp: number;
14
+ });
15
+ }
16
+ export declare class InputEvent extends Event implements RunInputEvent {
17
+ readonly running: boolean;
18
+ data: InputResponse;
19
+ static readonly eventName = "input";
20
+ constructor(running: boolean, data: InputResponse);
21
+ }
22
+ export declare class OutputEvent extends Event implements RunOutputEvent {
23
+ data: OutputResponse;
24
+ static readonly eventName = "output";
25
+ readonly running = true;
26
+ constructor(data: OutputResponse);
27
+ }
28
+ export declare class RunnerErrorEvent extends Event implements RunErrorEvent {
29
+ data: ErrorResponse;
30
+ static readonly eventName = "error";
31
+ readonly running = false;
32
+ constructor(data: ErrorResponse);
33
+ }
34
+ export declare class EndEvent extends Event implements RunEndEvent {
35
+ data: End;
36
+ static readonly eventName = "end";
37
+ readonly running = false;
38
+ constructor(data: End);
39
+ }
40
+ export declare class SkipEvent extends Event implements RunSkipEvent {
41
+ data: SkipProbeMessage["data"];
42
+ static readonly eventName = "skip";
43
+ readonly running = true;
44
+ constructor(data: SkipProbeMessage["data"]);
45
+ }
46
+ export declare class GraphStartEvent extends Event implements RunGraphStartEvent {
47
+ data: GraphStartProbeData;
48
+ static readonly eventName = "graphstart";
49
+ readonly running = true;
50
+ constructor(data: GraphStartProbeData);
51
+ }
52
+ export declare class GraphEndEvent extends Event implements RunGraphEndEvent {
53
+ data: GraphEndProbeData;
54
+ static readonly eventName = "graphend";
55
+ readonly running = true;
56
+ constructor(data: GraphEndProbeData);
57
+ }
58
+ export declare class NodeStartEvent extends Event implements RunNodeStartEvent {
59
+ data: NodeStartResponse;
60
+ result?: TraversalResult | undefined;
61
+ static readonly eventName = "nodestart";
62
+ readonly running = true;
63
+ constructor(data: NodeStartResponse, result?: TraversalResult | undefined);
64
+ }
65
+ export declare class NodeEndEvent extends Event implements RunNodeEndEvent {
66
+ data: NodeEndResponse;
67
+ static readonly eventName = "nodeend";
68
+ readonly running = true;
69
+ constructor(data: NodeEndResponse);
70
+ }
71
+ export declare class PauseEvent extends Event implements RunLifecycleEvent {
72
+ running: boolean;
73
+ data: {
74
+ timestamp: number;
75
+ };
76
+ static readonly eventName = "pause";
77
+ constructor(running: boolean, data: {
78
+ timestamp: number;
79
+ });
80
+ }
81
+ export declare class ResumeEvent extends Event implements RunLifecycleEvent {
82
+ data: {
83
+ timestamp: number;
84
+ inputs?: InputValues;
85
+ };
86
+ static readonly eventName = "resume";
87
+ readonly running = true;
88
+ constructor(data: {
89
+ timestamp: number;
90
+ inputs?: InputValues;
91
+ });
92
+ }
93
+ export declare class StartEvent extends Event implements RunLifecycleEvent {
94
+ data: {
95
+ timestamp: number;
96
+ inputs?: InputValues;
97
+ };
98
+ static readonly eventName = "start";
99
+ readonly running = true;
100
+ constructor(data: {
101
+ timestamp: number;
102
+ inputs?: InputValues;
103
+ });
104
+ }
105
+ export declare class StopEvent extends Event implements RunLifecycleEvent {
106
+ running: boolean;
107
+ data: {
108
+ timestamp: number;
109
+ };
110
+ static readonly eventName = "stop";
111
+ constructor(running: boolean, data: {
112
+ timestamp: number;
113
+ });
114
+ }
115
+ export declare class NextEvent extends Event implements RunNextEvent {
116
+ data: HarnessRunResult | void;
117
+ static readonly eventName = "next";
118
+ constructor(data: HarnessRunResult | void);
119
+ }
120
+ export declare class NodeStateChangeEvent extends Event implements RunNodeStateChangeEvent {
121
+ data: {
122
+ id: NodeIdentifier;
123
+ state: NodeLifecycleState;
124
+ message: NodeValue;
125
+ };
126
+ static readonly eventName = "nodestatechange";
127
+ readonly running = true;
128
+ constructor(data: {
129
+ id: NodeIdentifier;
130
+ state: NodeLifecycleState;
131
+ message: NodeValue;
132
+ });
133
+ }
134
+ export declare class EdgeStateChangeEvent extends Event implements RunEdgeStateChangeEvent {
135
+ data: {
136
+ edges: Edge[];
137
+ state: EdgeLifecycleState;
138
+ };
139
+ static readonly eventName = "edgestatechange";
140
+ readonly running = true;
141
+ constructor(data: {
142
+ edges: Edge[];
143
+ state: EdgeLifecycleState;
144
+ });
145
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { ProbeMessage } from "@breadboard-ai/types";
7
+ import { BreadboardRunResult, HarnessRunResult } from "@breadboard-ai/types";
8
+ export { fromRunnerResult, fromProbe };
9
+ declare function fromProbe<Probe extends ProbeMessage>(probe: Probe): HarnessRunResult;
10
+ declare function fromRunnerResult<Result extends BreadboardRunResult>(result: Result): HarnessRunResult;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { GraphDescriptor, HarnessRunner, HarnessRunResult, InputValues, NodeIdentifier, OrchestratorState, Outcome, RunConfig, RunEventTarget } from "@breadboard-ai/types";
7
+ import { SignalMap } from "signal-utils/map";
8
+ export { PlanRunner };
9
+ declare const PlanRunner_base: RunEventTarget;
10
+ declare class PlanRunner extends PlanRunner_base implements HarnessRunner {
11
+ #private;
12
+ readonly config: RunConfig;
13
+ running(): boolean;
14
+ run(inputs?: InputValues, interactiveMode?: boolean): Promise<boolean>;
15
+ get state(): OrchestratorState;
16
+ get plan(): OrchestrationPlan;
17
+ get waiting(): Map<any, any>;
18
+ accessor breakpoints: SignalMap<string, BreakpointSpec>;
19
+ constructor(config: RunConfig);
20
+ runNode(id: NodeIdentifier): Promise<Outcome<void>>;
21
+ runFrom(id: NodeIdentifier): Promise<Outcome<void>>;
22
+ stop(id: NodeIdentifier): Promise<Outcome<void>>;
23
+ protected getGenerator(interactiveMode?: boolean): AsyncGenerator<HarnessRunResult, void, unknown>;
24
+ updateGraph(graph: GraphDescriptor): Promise<void>;
25
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2024 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { GraphToRun, InputValues, OutputValues, RunArguments, TraversalResult } from "@breadboard-ai/types";
7
+ /**
8
+ * Runs a graph in "run as component" mode. See
9
+ * https://breadboard-ai.github.io/breadboard/docs/reference/runtime-semantics/#run-as-component-mode
10
+ * for more details.
11
+ */
12
+ export declare function invokeGraph(graphToRun: GraphToRun, inputs: InputValues, context?: RunArguments, resumeFrom?: TraversalResult): Promise<OutputValues>;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2024 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { GraphToRun, OutputValues, RunArguments, TraversalResult } from "@breadboard-ai/types";
7
+ import { RunResult } from "../run.js";
8
+ export declare class NodeInvoker {
9
+ #private;
10
+ constructor(args: RunArguments, graph: GraphToRun, next: (result: RunResult) => Promise<void>);
11
+ invokeNode(result: TraversalResult, invocationPath: number[]): Promise<OutputValues>;
12
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2024 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { BreadboardRunResult, GraphToRun, RunArguments, TraversalResult } from "@breadboard-ai/types";
7
+ /**
8
+ * Runs a graph in "run" mode. See
9
+ * https://breadboard-ai.github.io/breadboard/docs/reference/runtime-semantics/#run-mode
10
+ * for more details.
11
+ */
12
+ export declare function runGraph(graphToRun: GraphToRun, args?: RunArguments, resumeFrom?: TraversalResult): AsyncGenerator<BreadboardRunResult>;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { BreadboardRunResult, InputValues, NodeDescriptor, OutputValues, RunResultType, TraversalResult } from "@breadboard-ai/types";
7
+ export declare class RunResult implements BreadboardRunResult {
8
+ #private;
9
+ constructor(state: TraversalResult, type: RunResultType, invocationId: number, path: number[]);
10
+ get invocationId(): number;
11
+ get path(): number[];
12
+ get type(): RunResultType;
13
+ get node(): NodeDescriptor;
14
+ get inputArguments(): InputValues;
15
+ set inputs(inputs: InputValues);
16
+ get outputs(): OutputValues;
17
+ get state(): TraversalResult;
18
+ get timestamp(): number;
19
+ isAtExitNode(): boolean;
20
+ }
21
+ export declare class InputStageResult extends RunResult {
22
+ constructor(state: TraversalResult, invocationId: number, path: number[]);
23
+ get outputs(): OutputValues;
24
+ }
25
+ export declare class OutputStageResult extends RunResult {
26
+ constructor(state: TraversalResult, invocationId: number, path: number[]);
27
+ get inputArguments(): InputValues;
28
+ set inputs(_inputs: InputValues);
29
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { NodeHandlerContext } from "@breadboard-ai/types";
7
+ import { CapabilitiesManager, CapabilitySpec } from "@breadboard-ai/types/sandbox.js";
8
+ export { CapabilitiesManagerImpl };
9
+ declare class CapabilitiesManagerImpl implements CapabilitiesManager {
10
+ #private;
11
+ readonly context?: NodeHandlerContext | undefined;
12
+ constructor(context?: NodeHandlerContext | undefined);
13
+ createSpec(): CapabilitySpec;
14
+ static dummies(): CapabilitySpec;
15
+ }
@@ -0,0 +1,15 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { Capability } from "@breadboard-ai/types/sandbox.js";
7
+ import { FileSystem } from "@breadboard-ai/types";
8
+ export { FileSystemHandlerFactory };
9
+ declare class FileSystemHandlerFactory {
10
+ readonly fs?: FileSystem | undefined;
11
+ constructor(fs?: FileSystem | undefined);
12
+ query(): Capability;
13
+ read(): Capability;
14
+ write(): Capability;
15
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { GraphDescriptor, InputValues, ModuleIdentifier, MutableGraph, NodeDescriberResult, NodeHandlerContext, Schema } from "@breadboard-ai/types";
7
+ import { CapabilitiesManager } from "@breadboard-ai/types/sandbox.js";
8
+ export { invokeDescriber, invokeMainDescriber };
9
+ declare function invokeDescriber(context: NodeHandlerContext, moduleId: ModuleIdentifier, mutable: MutableGraph, graph: GraphDescriptor, inputs: InputValues, inputSchema?: Schema, outputSchema?: Schema, capabilities?: CapabilitiesManager, asType?: boolean): Promise<NodeDescriberResult | undefined>;
10
+ declare function invokeMainDescriber(context: NodeHandlerContext, mutable: MutableGraph, graph: GraphDescriptor, inputs: InputValues, inputSchema?: Schema, outputSchema?: Schema, capabilities?: CapabilitiesManager, asType?: boolean): Promise<NodeDescriberResult | undefined | false>;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { GraphDescriptor, OrchestrationPlan } from "@breadboard-ai/types";
7
+ export { createPlan };
8
+ /**
9
+ * Creates an execution plan from the provided GraphDescription.
10
+ * The graph is guaranteed to be condensed (no cycles), and each
11
+ * strongly connected component is represented with a single node
12
+ * that has a "folded" tag.
13
+ */
14
+ declare function createPlan(graph: GraphDescriptor): OrchestrationPlan;
@@ -0,0 +1,72 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { NodeIdentifier, Outcome, OutputValues, OrchestrationPlan, OrchestratorProgress, Task, OrchestrationNodeInfo, OrchestratorState, OrchestratorCallbacks, OrchestratorNodeState } from "@breadboard-ai/types";
7
+ export { Orchestrator };
8
+ /**
9
+ * The Orchestrator acts as the state machine for running a graph.
10
+ * Its primary responsibilities are:
11
+ *
12
+ * 1. Lifecycle Management: Starting, resetting, and managing the overall
13
+ * progress of a run from beginning to end.
14
+ * 2. Task Coordination: Determining which nodes are ready to be invoked
15
+ * based on dependencies.
16
+ * 3. State Persistence: Receiving results of node invocation and persisting
17
+ * the state workflow.
18
+ * 4. Inspection and Debugging: Providing methods to observe the current state
19
+ * of a run, inspect cached results, and control execution flow.
20
+ *
21
+ * It breaks down the process into three distinct parts:
22
+ * - the planning -- determining the static sequence of a run
23
+ * - the orchestration -- managing execution results that can be dynamic
24
+ * - actual node invocation
25
+ */
26
+ declare class Orchestrator {
27
+ #private;
28
+ readonly plan: OrchestrationPlan;
29
+ readonly callbacks: OrchestratorCallbacks;
30
+ constructor(plan: OrchestrationPlan, callbacks: OrchestratorCallbacks);
31
+ /**
32
+ * Returns current progress of the orchestration.
33
+ */
34
+ get progress(): OrchestratorProgress;
35
+ get working(): boolean;
36
+ get allWorking(): unknown[];
37
+ get allWaiting(): unknown[];
38
+ get failed(): boolean;
39
+ getNodeState(id: NodeIdentifier): OrchestratorNodeState | null;
40
+ /**
41
+ * Bring the orchestrator to the initial state.
42
+ */
43
+ reset(): Outcome<void>;
44
+ restartAtCurrentStage(): Outcome<void>;
45
+ restartAtStage(stage: number): Outcome<void>;
46
+ restartAtNode(id: NodeIdentifier): Outcome<void>;
47
+ setWorking(id: NodeIdentifier): Outcome<void>;
48
+ setWaiting(id: NodeIdentifier): Outcome<void>;
49
+ setInterrupted(id: NodeIdentifier): Outcome<void>;
50
+ fullState(): OrchestratorState;
51
+ /**
52
+ * Provides a way to inspect the current state of nodes as they are being
53
+ * orchestrated.
54
+ * @returns a map representing current state of all nodes
55
+ */
56
+ state(): ReadonlyMap<NodeIdentifier, OrchestrationNodeInfo>;
57
+ /**
58
+ * Creates a new task to invoke a node, given a node id
59
+ * @param id -- node id
60
+ */
61
+ taskFromId(id: NodeIdentifier): Outcome<Task>;
62
+ /**
63
+ * Creates a list of current tasks: nodes to be invoked next, along
64
+ * with their inputs, according to the current state of the orchestrator.
65
+ */
66
+ currentTasks(): Outcome<Task[]>;
67
+ update(old: Orchestrator): void;
68
+ /**
69
+ * Submit results of a node invocation. Also updates the current state.
70
+ */
71
+ provideOutputs(id: NodeIdentifier, outputs: OutputValues): Outcome<OrchestratorProgress>;
72
+ }
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { Edge, InputValues, NodeDescriptor, NodeIdentifier } from "@breadboard-ai/types";
7
+ /**
8
+ * This class holds important parts of the graph traversal algorithm.
9
+ */
10
+ export declare class Traversal {
11
+ /**
12
+ * Computes the missing inputs for a node. A missing input is an input that is
13
+ * required by the node, but is not (yet) available in the current state.
14
+ * @param heads All the edges that point to the node.
15
+ * @param inputs The input values that will be passed to the node
16
+ * @param current The node that is being visited.
17
+ * @returns Array of missing input names.
18
+ */
19
+ static computeMissingInputs(heads: Edge[], inputs: InputValues, current: NodeDescriptor, start?: NodeIdentifier): string[];
20
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import type { GraphRepresentation, TraversalResult } from "@breadboard-ai/types";
7
+ export declare class TraversalMachineIterator implements AsyncIterator<TraversalResult> {
8
+ #private;
9
+ graph: GraphRepresentation;
10
+ constructor(graph: GraphRepresentation, result: TraversalResult);
11
+ next(): Promise<IteratorResult<TraversalResult>>;
12
+ }