@ghchinoy/litflow 0.3.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -10
- package/dist/breadboard/data/file-system.d.ts +9 -0
- package/dist/breadboard/data/inline-all-content.d.ts +8 -0
- package/dist/breadboard/data/recent-boards.d.ts +17 -0
- package/dist/breadboard/data/save-outputs-as-file.d.ts +9 -0
- package/dist/breadboard/engine/add-run-module.d.ts +9 -0
- package/dist/breadboard/engine/editor/blank.d.ts +15 -0
- package/dist/breadboard/engine/editor/edge.d.ts +8 -0
- package/dist/breadboard/engine/editor/events.d.ts +34 -0
- package/dist/breadboard/engine/editor/graph.d.ts +18 -0
- package/dist/breadboard/engine/editor/history.d.ts +21 -0
- package/dist/breadboard/engine/editor/index.d.ts +6 -0
- package/dist/breadboard/engine/editor/operations/add-asset.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/add-edge.d.ts +11 -0
- package/dist/breadboard/engine/editor/operations/add-graph.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/add-module.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/add-node.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/change-asset-metadata.d.ts +11 -0
- package/dist/breadboard/engine/editor/operations/change-configuration.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/change-edge-metadata.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/change-edge.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/change-graph-metadata.d.ts +9 -0
- package/dist/breadboard/engine/editor/operations/change-metadata.d.ts +11 -0
- package/dist/breadboard/engine/editor/operations/change-module.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/error.d.ts +9 -0
- package/dist/breadboard/engine/editor/operations/remove-asset.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/remove-edge.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/remove-graph.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/remove-integration.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/remove-module.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/remove-node.d.ts +10 -0
- package/dist/breadboard/engine/editor/operations/replace-graph.d.ts +9 -0
- package/dist/breadboard/engine/editor/operations/toggle-export.d.ts +9 -0
- package/dist/breadboard/engine/editor/operations/upsert-integration.d.ts +10 -0
- package/dist/breadboard/engine/editor/selection.d.ts +16 -0
- package/dist/breadboard/engine/editor/transforms/configure-sidewire.d.ts +15 -0
- package/dist/breadboard/engine/editor/transforms/isolate-selection.d.ts +12 -0
- package/dist/breadboard/engine/editor/transforms/merge-graph.d.ts +12 -0
- package/dist/breadboard/engine/editor/transforms/move-to-graph.d.ts +12 -0
- package/dist/breadboard/engine/editor/transforms/move-to-new-graph.d.ts +12 -0
- package/dist/breadboard/engine/editor/transforms/sidewire-to-new-graph.d.ts +72 -0
- package/dist/breadboard/engine/file-system/blob-transform.d.ts +8 -0
- package/dist/breadboard/engine/file-system/composed-peristent-backend.d.ts +8 -0
- package/dist/breadboard/engine/file-system/ephemeral-blob-store.d.ts +8 -0
- package/dist/breadboard/engine/file-system/in-memory-blob-store.d.ts +18 -0
- package/dist/breadboard/engine/file-system/index.d.ts +22 -0
- package/dist/breadboard/engine/file-system/partial-persistent-backend.d.ts +19 -0
- package/dist/breadboard/engine/file-system/path.d.ts +23 -0
- package/dist/breadboard/engine/file-system/persistent-file.d.ts +19 -0
- package/dist/breadboard/engine/file-system/readable-stream-file.d.ts +17 -0
- package/dist/breadboard/engine/file-system/stub-file-system.d.ts +18 -0
- package/dist/breadboard/engine/file-system/utils.d.ts +9 -0
- package/dist/breadboard/engine/inspector/graph/bubbled-node.d.ts +34 -0
- package/dist/breadboard/engine/inspector/graph/describe-cache.d.ts +15 -0
- package/dist/breadboard/engine/inspector/graph/describe-type-cache.d.ts +15 -0
- package/dist/breadboard/engine/inspector/graph/edge-cache.d.ts +22 -0
- package/dist/breadboard/engine/inspector/graph/edge.d.ts +40 -0
- package/dist/breadboard/engine/inspector/graph/event.d.ts +16 -0
- package/dist/breadboard/engine/inspector/graph/exports-describer.d.ts +13 -0
- package/dist/breadboard/engine/inspector/graph/graph-cache.d.ts +18 -0
- package/dist/breadboard/engine/inspector/graph/graph-describer-manager.d.ts +21 -0
- package/dist/breadboard/engine/inspector/graph/graph-descriptor-handle.d.ts +17 -0
- package/dist/breadboard/engine/inspector/graph/graph-node-type.d.ts +15 -0
- package/dist/breadboard/engine/inspector/graph/graph-queries.d.ts +31 -0
- package/dist/breadboard/engine/inspector/graph/graph.d.ts +37 -0
- package/dist/breadboard/engine/inspector/graph/inspectable-asset.d.ts +17 -0
- package/dist/breadboard/engine/inspector/graph/kits.d.ts +15 -0
- package/dist/breadboard/engine/inspector/graph/module.d.ts +14 -0
- package/dist/breadboard/engine/inspector/graph/mutable-graph.d.ts +26 -0
- package/dist/breadboard/engine/inspector/graph/node-cache.d.ts +20 -0
- package/dist/breadboard/engine/inspector/graph/node-describer-manager.d.ts +25 -0
- package/dist/breadboard/engine/inspector/graph/node-type-describer-manager.d.ts +19 -0
- package/dist/breadboard/engine/inspector/graph/node.d.ts +27 -0
- package/dist/breadboard/engine/inspector/graph/port-cache.d.ts +18 -0
- package/dist/breadboard/engine/inspector/graph/ports.d.ts +16 -0
- package/dist/breadboard/engine/inspector/graph/schemas.d.ts +24 -0
- package/dist/breadboard/engine/inspector/graph/virtual-node.d.ts +35 -0
- package/dist/breadboard/engine/inspector/graph-store.d.ts +45 -0
- package/dist/breadboard/engine/inspector/index.d.ts +7 -0
- package/dist/breadboard/engine/inspector/utils.d.ts +9 -0
- package/dist/breadboard/engine/loader/index.d.ts +7 -0
- package/dist/breadboard/engine/runtime/harness/diagnostics.d.ts +12 -0
- package/dist/breadboard/engine/runtime/harness/index.d.ts +8 -0
- package/dist/breadboard/engine/runtime/index.d.ts +6 -0
- package/dist/breadboard/engine/runtime/legacy.d.ts +11 -0
- package/dist/breadboard/engine/runtime/static/condense.d.ts +25 -0
- package/dist/breadboard/engine/runtime/static/nodes-to-subgraph.d.ts +18 -0
- package/dist/breadboard/engine/runtime/static/types.d.ts +72 -0
- package/dist/breadboard/engine/telemetry.d.ts +25 -0
- package/dist/breadboard/engine/types.d.ts +9 -0
- package/dist/lit-flow.d.ts +13 -0
- package/dist/lit-node.d.ts +1 -0
- package/dist/litflow.js +6002 -730
- package/dist/litflow.js.map +1 -1
- package/package.json +19 -1
- package/src/lit-flow.ts +133 -2
- package/src/lit-node.ts +34 -3
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { GraphIdentifier, InputValues, InspectableEdge, InspectableNode, InspectableNodePorts, InspectableNodeType, MutableGraph, NodeConfiguration, NodeDescriberResult, NodeDescriptor, NodeMetadata, OutputValues } from "@breadboard-ai/types";
|
|
7
|
+
export declare class Node implements InspectableNode {
|
|
8
|
+
#private;
|
|
9
|
+
descriptor: NodeDescriptor;
|
|
10
|
+
constructor(descriptor: NodeDescriptor, graph: MutableGraph, graphId: GraphIdentifier);
|
|
11
|
+
title(): string;
|
|
12
|
+
description(): string;
|
|
13
|
+
incoming(): InspectableEdge[];
|
|
14
|
+
outgoing(): InspectableEdge[];
|
|
15
|
+
isEntry(): boolean;
|
|
16
|
+
isExit(): boolean;
|
|
17
|
+
isStart(): boolean;
|
|
18
|
+
type(): InspectableNodeType;
|
|
19
|
+
configuration(): NodeConfiguration;
|
|
20
|
+
metadata(): NodeMetadata;
|
|
21
|
+
describe(): Promise<NodeDescriberResult>;
|
|
22
|
+
currentDescribe(): NodeDescriberResult;
|
|
23
|
+
currentPorts(inputValues?: InputValues, outputValues?: OutputValues): InspectableNodePorts;
|
|
24
|
+
ports(inputValues?: InputValues, outputValues?: OutputValues): Promise<InspectableNodePorts>;
|
|
25
|
+
setDeleted(): void;
|
|
26
|
+
deleted(): boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { GraphIdentifier, InspectableNodePorts, NodeIdentifier, NodePortChanges } from "@breadboard-ai/types";
|
|
7
|
+
export { PortCache };
|
|
8
|
+
type PortsUpdate = {
|
|
9
|
+
updated: InspectableNodePorts;
|
|
10
|
+
changes: NodePortChanges;
|
|
11
|
+
};
|
|
12
|
+
declare class PortCache {
|
|
13
|
+
#private;
|
|
14
|
+
reconcilePorts(incoming: InspectableNodePorts, existing?: InspectableNodePorts): PortsUpdate;
|
|
15
|
+
createNewSnapshot(incoming: InspectableNodePorts): PortsUpdate;
|
|
16
|
+
current(graphId: GraphIdentifier, nodeId: NodeIdentifier): InspectableNodePorts | undefined;
|
|
17
|
+
getChanges(graphId: GraphIdentifier, nodeId: NodeIdentifier, ports: InspectableNodePorts): NodePortChanges;
|
|
18
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { BehaviorSchema, InputValues, InspectableEdge, InspectableNode, InspectableNodePorts, InspectablePort, InspectablePortType, NodeConfiguration, NodeDescriberResult, NodeHandler, NodeTypeIdentifier, OutputValues, Schema } from "@breadboard-ai/types";
|
|
7
|
+
import { EdgeType } from "./schemas.js";
|
|
8
|
+
export { describerResultToPorts };
|
|
9
|
+
export declare const collectPorts: (type: EdgeType, edges: InspectableEdge[], schema: Schema, addErrorPort: boolean, allowRequired: boolean, values?: NodeConfiguration) => InspectablePort[];
|
|
10
|
+
export declare class PortType implements InspectablePortType {
|
|
11
|
+
schema: Schema;
|
|
12
|
+
constructor(schema: Schema);
|
|
13
|
+
hasBehavior(behavior: BehaviorSchema): boolean;
|
|
14
|
+
}
|
|
15
|
+
declare function describerResultToPorts(node: InspectableNode, described: NodeDescriberResult, updating: boolean, inputValues?: InputValues, outputValues?: OutputValues): InspectableNodePorts;
|
|
16
|
+
export declare const portsFromHandler: (type: NodeTypeIdentifier, handler: NodeHandler | undefined) => Promise<InspectableNodePorts>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { InspectableEdge, NodeDescriberResult, NodeTypeDescriberOptions, Schema } from "@breadboard-ai/types";
|
|
7
|
+
export declare enum EdgeType {
|
|
8
|
+
In = 0,
|
|
9
|
+
Out = 1
|
|
10
|
+
}
|
|
11
|
+
export declare const DEFAULT_SCHEMA: Schema;
|
|
12
|
+
export declare const edgesToSchema: (edgeType: EdgeType, edges?: InspectableEdge[], keepStar?: boolean) => Schema;
|
|
13
|
+
/**
|
|
14
|
+
* Constructs a Schema for an input node.
|
|
15
|
+
* @param options
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare const describeInput: (options: NodeTypeDescriberOptions) => NodeDescriberResult;
|
|
19
|
+
/**
|
|
20
|
+
* Constructs a Schema for an output node.
|
|
21
|
+
* @param options
|
|
22
|
+
* @returns
|
|
23
|
+
*/
|
|
24
|
+
export declare const describeOutput: (options: NodeTypeDescriberOptions) => NodeDescriberResult;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { InputValues, InspectableEdge, InspectableNode, InspectableNodePorts, InspectableNodeType, NodeConfiguration, NodeDescriberResult, NodeDescriptor, NodeMetadata, OutputValues } from "@breadboard-ai/types";
|
|
7
|
+
export { VirtualNode };
|
|
8
|
+
/**
|
|
9
|
+
* A virtual node represents a node in a virtual graph. Virtual
|
|
10
|
+
* Graphs aren't actually graphs, but rather code that
|
|
11
|
+
* behaves as in a "graph-like" way: it may invoke components,
|
|
12
|
+
* but its topology is entirely imperative.
|
|
13
|
+
* For example, the runModule code is a virtual graph, and
|
|
14
|
+
* every capability it invokes shows up as a virtual node.
|
|
15
|
+
*/
|
|
16
|
+
declare class VirtualNode implements InspectableNode {
|
|
17
|
+
#private;
|
|
18
|
+
descriptor: NodeDescriptor;
|
|
19
|
+
constructor(descriptor: Partial<NodeDescriptor>);
|
|
20
|
+
title(): string;
|
|
21
|
+
description(): string;
|
|
22
|
+
incoming(): InspectableEdge[];
|
|
23
|
+
outgoing(): InspectableEdge[];
|
|
24
|
+
isEntry(): boolean;
|
|
25
|
+
isExit(): boolean;
|
|
26
|
+
isStart(): boolean;
|
|
27
|
+
type(): InspectableNodeType;
|
|
28
|
+
describe(): Promise<NodeDescriberResult>;
|
|
29
|
+
currentDescribe(): NodeDescriberResult;
|
|
30
|
+
configuration(): NodeConfiguration;
|
|
31
|
+
metadata(): NodeMetadata;
|
|
32
|
+
ports(inputs?: InputValues, outputs?: OutputValues): Promise<InspectableNodePorts>;
|
|
33
|
+
currentPorts(inputs?: InputValues, outputs?: OutputValues): InspectableNodePorts;
|
|
34
|
+
deleted(): boolean;
|
|
35
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { AddResult, EditableGraph, EditableGraphOptions, FileSystem, GraphDescriptor, GraphIdentifier, GraphLoader, GraphLoaderContext, GraphLoaderResult, GraphStoreArgs, GraphStoreEntry, GraphStoreEventTarget, InspectableDescriberResultTypeCache, InspectableGraph, InspectableGraphOptions, Kit, MainGraphIdentifier, MainGraphStoreEntry, MutableGraph, MutableGraphStore, NodeHandlerContext, Result, RuntimeFlagManager } from "@breadboard-ai/types";
|
|
7
|
+
import { RunnableModuleFactory } from "@breadboard-ai/types/sandbox.js";
|
|
8
|
+
export { contextFromMutableGraph, contextFromMutableGraphStore, GraphStore, makeTerribleOptions, };
|
|
9
|
+
declare function contextFromMutableGraph(mutable: MutableGraph): NodeHandlerContext;
|
|
10
|
+
declare function contextFromMutableGraphStore(store: MutableGraphStore): NodeHandlerContext;
|
|
11
|
+
declare function makeTerribleOptions(options?: InspectableGraphOptions): Required<InspectableGraphOptions>;
|
|
12
|
+
declare const GraphStore_base: GraphStoreEventTarget;
|
|
13
|
+
declare class GraphStore extends GraphStore_base implements MutableGraphStore {
|
|
14
|
+
#private;
|
|
15
|
+
readonly kits: readonly Kit[];
|
|
16
|
+
readonly sandbox: RunnableModuleFactory;
|
|
17
|
+
readonly loader: GraphLoader;
|
|
18
|
+
readonly fileSystem: FileSystem;
|
|
19
|
+
readonly flags: RuntimeFlagManager;
|
|
20
|
+
/**
|
|
21
|
+
* The cache of type describer results. These are currently
|
|
22
|
+
* entirely static: they are only loaded once and exist
|
|
23
|
+
* for the lifetime of the GraphStore. At the moment, this
|
|
24
|
+
* is ok, since the only graph that ever changes is the main
|
|
25
|
+
* graph, and we don't need its type. This will change
|
|
26
|
+
* probably, so we need to be on look out for when.
|
|
27
|
+
*/
|
|
28
|
+
readonly types: InspectableDescriberResultTypeCache;
|
|
29
|
+
constructor(args: GraphStoreArgs);
|
|
30
|
+
getEntryByDescriptor(descriptor: GraphDescriptor, graphId: GraphIdentifier): GraphStoreEntry | undefined;
|
|
31
|
+
mainGraphs(): MainGraphStoreEntry[];
|
|
32
|
+
graphs(): GraphStoreEntry[];
|
|
33
|
+
load(path: string, context: GraphLoaderContext): Promise<GraphLoaderResult>;
|
|
34
|
+
registerKit(kit: Kit, dependences: MainGraphIdentifier[]): void;
|
|
35
|
+
addByDescriptor(graph: GraphDescriptor): Result<MainGraphIdentifier>;
|
|
36
|
+
getByDescriptor(graph: GraphDescriptor): Result<MainGraphIdentifier>;
|
|
37
|
+
editByDescriptor(graph: GraphDescriptor, options?: EditableGraphOptions): EditableGraph | undefined;
|
|
38
|
+
edit(id: MainGraphIdentifier, options?: EditableGraphOptions): EditableGraph | undefined;
|
|
39
|
+
inspect(id: MainGraphIdentifier, graphId: GraphIdentifier): InspectableGraph | undefined;
|
|
40
|
+
inspectSnapshot(graph: GraphDescriptor, graphId: GraphIdentifier): InspectableGraph | undefined;
|
|
41
|
+
addByURL(path: string, dependencies: MainGraphIdentifier[], context?: GraphLoaderContext): AddResult;
|
|
42
|
+
getLatest(mutable: MutableGraph): Promise<MutableGraph>;
|
|
43
|
+
getOrAdd(graph: GraphDescriptor): Result<MutableGraph>;
|
|
44
|
+
get(id: MainGraphIdentifier): MutableGraph | undefined;
|
|
45
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { GraphIdentifier } from "@breadboard-ai/types";
|
|
7
|
+
export { isModule, getModuleId };
|
|
8
|
+
declare function isModule(graphId: GraphIdentifier): boolean;
|
|
9
|
+
declare function getModuleId(graphId: GraphIdentifier): string;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { Probe, ProbeMessage } from "@breadboard-ai/types";
|
|
7
|
+
export type DiagnosticsCallback = (message: ProbeMessage) => Promise<void>;
|
|
8
|
+
export declare class Diagnostics implements Probe {
|
|
9
|
+
#private;
|
|
10
|
+
constructor(callback: DiagnosticsCallback);
|
|
11
|
+
report(message: ProbeMessage): Promise<void>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { HarnessRunner, RunConfig } from "@breadboard-ai/types";
|
|
7
|
+
export { RunnerErrorEvent } from "./events.js";
|
|
8
|
+
export declare function createPlanRunner(config: RunConfig): HarnessRunner;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export { describerResultToNodeHandlerMetadata } from "./graph-based-node-handler.js";
|
|
7
|
+
export { getGraphHandlerFromMutableGraph, getHandler, getGraphHandler, } from "./handler.js";
|
|
8
|
+
export { invokeGraph } from "./run/invoke-graph.js";
|
|
9
|
+
export { CapabilitiesManagerImpl } from "./sandbox/capabilities-manager.js";
|
|
10
|
+
export { invokeDescriber, invokeMainDescriber, } from "./sandbox/invoke-describer.js";
|
|
11
|
+
export { GraphRepresentationImpl } from "./traversal/representation.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { GraphDescriptor } from "@breadboard-ai/types";
|
|
7
|
+
export { condense };
|
|
8
|
+
/**
|
|
9
|
+
* Given a GraphDescriptor, creates another GraphDescriptor that is a
|
|
10
|
+
* condensed graph representation of it.
|
|
11
|
+
* All strongly connected components (SCC) of the graph are replaced with nodes
|
|
12
|
+
* whose types point at subgraphs, like this "#<id of subgraph>".
|
|
13
|
+
* The subgraph is created as follows:
|
|
14
|
+
* - a node of type "input" is created, and this node acts as a way to
|
|
15
|
+
* capture all incoming edge ports (the "in" values), so that they
|
|
16
|
+
* are correctly routed to inside of the subgraph
|
|
17
|
+
* - a node of type "output" is created, and this node acts as a way to
|
|
18
|
+
* capture all outgoing edge ports (the "out" values), so that they
|
|
19
|
+
* are correctly routed from the subgraph to.
|
|
20
|
+
* In effect, the input/output nodes in a subgraph act as a
|
|
21
|
+
* "function signature" of the subgraph.
|
|
22
|
+
* See https://en.wikipedia.org/wiki/Strongly_connected_component for
|
|
23
|
+
* discussion and definitions.
|
|
24
|
+
*/
|
|
25
|
+
declare function condense(graph: GraphDescriptor): GraphDescriptor;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { GraphDescriptor, GraphIdentifier, NodeIdentifier } from "@breadboard-ai/types";
|
|
7
|
+
export { nodesToSubgraph };
|
|
8
|
+
/**
|
|
9
|
+
* Moves a group of nodes within a graph into a subgraph, mutating
|
|
10
|
+
* the supplied graph.
|
|
11
|
+
*
|
|
12
|
+
* @param graph - The graph where the subgraph will be created.
|
|
13
|
+
* @param nodeGroup - The group of nodes to include in the subgraph.
|
|
14
|
+
* @param subgraphId - The unique identifier for the subgraph.
|
|
15
|
+
* @param title - An optional title for the subgraph.
|
|
16
|
+
* @param description - An optional description for the subgraph.
|
|
17
|
+
*/
|
|
18
|
+
declare function nodesToSubgraph(graph: GraphDescriptor, nodeGroup: NodeIdentifier[], subgraphId: GraphIdentifier, title?: string, description?: string): void;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { NodeIdentifier, Outcome } from "@breadboard-ai/types";
|
|
7
|
+
/**
|
|
8
|
+
* Very WIP, sketching out reactive Model + Controller
|
|
9
|
+
* that replaces the current HarnessRunner
|
|
10
|
+
*/
|
|
11
|
+
export type OrchestrationController = {
|
|
12
|
+
/**
|
|
13
|
+
* Run the graph from start to finish or the next breakpoint.
|
|
14
|
+
* Always restarts, resetting current state.
|
|
15
|
+
* Promise resolves when the run completes.
|
|
16
|
+
*/
|
|
17
|
+
run(): Promise<Outcome<void>>;
|
|
18
|
+
/**
|
|
19
|
+
* Run all incomplete stages to finish or the next breakpoint.
|
|
20
|
+
* Promise resolves when the run completes.
|
|
21
|
+
*/
|
|
22
|
+
continue(): Promise<Outcome<void>>;
|
|
23
|
+
/**
|
|
24
|
+
* Invoke the next "ready" node in the orchestration.
|
|
25
|
+
* Promise resolves when the node invocation completes.
|
|
26
|
+
* If the node reports failure, this is not an error that affects outcome.
|
|
27
|
+
*/
|
|
28
|
+
stepThroughNode(): Promise<Outcome<void>>;
|
|
29
|
+
/**
|
|
30
|
+
* Step through the next incomplete stage in the orchestration.
|
|
31
|
+
* Promise resolves when the stage completes.
|
|
32
|
+
*/
|
|
33
|
+
stepThroughStage(): Promise<Outcome<void>>;
|
|
34
|
+
/**
|
|
35
|
+
* Provides a way to manage breakpoints.
|
|
36
|
+
*/
|
|
37
|
+
breakpoints: BreakpointsController;
|
|
38
|
+
};
|
|
39
|
+
export type BreakpointsController = {
|
|
40
|
+
/**
|
|
41
|
+
* All current breakpoints.
|
|
42
|
+
*/
|
|
43
|
+
readonly breakpoints: ReadonlyMap<NodeIdentifier, Breakpoint>;
|
|
44
|
+
/**
|
|
45
|
+
* Creates a breakpoint. Can be called multiple times on the same node.
|
|
46
|
+
* @param node - the node at which to set the breakpoint
|
|
47
|
+
*/
|
|
48
|
+
create(node: NodeIdentifier): void;
|
|
49
|
+
/**
|
|
50
|
+
* Removes a breakpoint. Can be called multiple times on the same node.
|
|
51
|
+
* @param node - the node at which to remove the breakpoint
|
|
52
|
+
*/
|
|
53
|
+
delete(node: NodeIdentifier): void;
|
|
54
|
+
/**
|
|
55
|
+
* Clears all breakpoints.
|
|
56
|
+
*/
|
|
57
|
+
clear(): void;
|
|
58
|
+
};
|
|
59
|
+
export type Breakpoint = {
|
|
60
|
+
/**
|
|
61
|
+
* The node at which the breakpoint is set.
|
|
62
|
+
*/
|
|
63
|
+
readonly id: NodeIdentifier;
|
|
64
|
+
/**
|
|
65
|
+
* Disables the breakpoint.
|
|
66
|
+
*/
|
|
67
|
+
disable(): void;
|
|
68
|
+
/**
|
|
69
|
+
* Enables the breakpoint.
|
|
70
|
+
*/
|
|
71
|
+
enable(): void;
|
|
72
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2024 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import type { InputValues, NodeMetadata, OutputValues, Probe } from "@breadboard-ai/types";
|
|
7
|
+
import { RunnableModuleTelemetry } from "@breadboard-ai/types/sandbox.js";
|
|
8
|
+
export { Telemetry };
|
|
9
|
+
type Context = {
|
|
10
|
+
probe?: Probe;
|
|
11
|
+
invocationPath?: number[];
|
|
12
|
+
};
|
|
13
|
+
declare class Telemetry implements RunnableModuleTelemetry {
|
|
14
|
+
#private;
|
|
15
|
+
readonly probe: Probe;
|
|
16
|
+
readonly path: number[];
|
|
17
|
+
index: number;
|
|
18
|
+
static create(context: Context): Telemetry | undefined;
|
|
19
|
+
constructor(probe: Probe, path: number[]);
|
|
20
|
+
startModule(): Promise<void>;
|
|
21
|
+
startCapability(type: string, inputs: InputValues, metadata?: NodeMetadata): Promise<number>;
|
|
22
|
+
endCapability(type: string, path: number, inputs: InputValues, outputs: OutputValues): Promise<void>;
|
|
23
|
+
endModule(): Promise<void>;
|
|
24
|
+
invocationPath(path: number): number[];
|
|
25
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2023 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export type { Capability, CommentNode, Edge, GraphDescriptor, GraphIdentifier, GraphInlineMetadata, InputIdentifier, InputResponse, InputValues, KitDescriptor, KitReference, NodeConfiguration, NodeDescriptor, NodeIdentifier, NodeTypeIdentifier, NodeValue, OutputIdentifier, OutputResponse, OutputValues, SubGraphs, } from "@breadboard-ai/types";
|
|
7
|
+
export type * from "@breadboard-ai/types/legacy.js";
|
|
8
|
+
export type * from "@breadboard-ai/types/node-handler.js";
|
|
9
|
+
export type * from "@breadboard-ai/types/schema.js";
|
package/dist/lit-flow.d.ts
CHANGED
|
@@ -23,6 +23,8 @@ export declare class LitFlow extends LitFlow_base {
|
|
|
23
23
|
zoomOnDoubleClick: boolean;
|
|
24
24
|
promptOnDrop: boolean;
|
|
25
25
|
selectionMode: 'pan' | 'select';
|
|
26
|
+
layoutEnabled: boolean;
|
|
27
|
+
layoutPadding: number;
|
|
26
28
|
private _selectionRect;
|
|
27
29
|
private _selectionStart;
|
|
28
30
|
private _width;
|
|
@@ -31,6 +33,7 @@ export declare class LitFlow extends LitFlow_base {
|
|
|
31
33
|
get nodes(): NodeBase[];
|
|
32
34
|
private _notifyChange;
|
|
33
35
|
private _discoverNodes;
|
|
36
|
+
private _performLayout;
|
|
34
37
|
set edges(edges: any[]);
|
|
35
38
|
get edges(): any[];
|
|
36
39
|
viewport: Viewport;
|
|
@@ -54,6 +57,16 @@ export declare class LitFlow extends LitFlow_base {
|
|
|
54
57
|
* @param padding Optional padding in pixels (default: 50)
|
|
55
58
|
*/
|
|
56
59
|
fitView(padding?: number): Promise<void>;
|
|
60
|
+
/**
|
|
61
|
+
* Isolates a subgraph by hiding all nodes and edges not connected to the specified node.
|
|
62
|
+
* @param nodeId The ID of the node to focus on.
|
|
63
|
+
* @param direction The direction of the traversal ('downstream', 'upstream', or 'both').
|
|
64
|
+
*/
|
|
65
|
+
isolateSubgraph(nodeId: string, direction?: 'downstream' | 'upstream' | 'both'): void;
|
|
66
|
+
/**
|
|
67
|
+
* Clears any subgraph isolation, showing all nodes and edges.
|
|
68
|
+
*/
|
|
69
|
+
clearIsolation(): void;
|
|
57
70
|
private _updatePanZoom;
|
|
58
71
|
firstUpdated(): void;
|
|
59
72
|
updated(changedProperties: Map<string, any>): void;
|
package/dist/lit-node.d.ts
CHANGED