/** * @license * Copyright 2024 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import type { AddResult, EditableGraph, EditableGraphOptions, FileSystem, GraphDescriptor, GraphIdentifier, GraphLoader, GraphLoaderContext, GraphLoaderResult, GraphStoreArgs, GraphStoreEntry, GraphStoreEventTarget, InspectableDescriberResultTypeCache, InspectableGraph, InspectableGraphOptions, Kit, MainGraphIdentifier, MainGraphStoreEntry, MutableGraph, MutableGraphStore, NodeHandlerContext, Result, Sandbox } from "@breadboard-ai/types"; export { contextFromMutableGraph, contextFromMutableGraphStore, GraphStore, makeTerribleOptions, }; declare function contextFromMutableGraph(mutable: MutableGraph): NodeHandlerContext; declare function contextFromMutableGraphStore(store: MutableGraphStore): NodeHandlerContext; declare function makeTerribleOptions(options?: InspectableGraphOptions): Required; declare const GraphStore_base: GraphStoreEventTarget; declare class GraphStore extends GraphStore_base implements MutableGraphStore { #private; readonly kits: readonly Kit[]; readonly sandbox: Sandbox; readonly loader: GraphLoader; readonly fileSystem: FileSystem; /** * The cache of type describer results. These are currently * entirely static: they are only loaded once and exist * for the lifetime of the GraphStore. At the moment, this * is ok, since the only graph that ever changes is the main * graph, and we don't need its type. This will change * probably, so we need to be on look out for when. */ readonly types: InspectableDescriberResultTypeCache; constructor(args: GraphStoreArgs); getEntryByDescriptor(descriptor: GraphDescriptor, graphId: GraphIdentifier): GraphStoreEntry | undefined; mainGraphs(): MainGraphStoreEntry[]; graphs(): GraphStoreEntry[]; load(path: string, context: GraphLoaderContext): Promise; registerKit(kit: Kit, dependences: MainGraphIdentifier[]): void; addByDescriptor(graph: GraphDescriptor): Result; getByDescriptor(graph: GraphDescriptor): Result; editByDescriptor(graph: GraphDescriptor, options?: EditableGraphOptions): EditableGraph | undefined; edit(id: MainGraphIdentifier, options?: EditableGraphOptions): EditableGraph | undefined; inspect(id: MainGraphIdentifier, graphId: GraphIdentifier): InspectableGraph | undefined; inspectSnapshot(graph: GraphDescriptor, graphId: GraphIdentifier): InspectableGraph | undefined; addByURL(path: string, dependencies: MainGraphIdentifier[], context?: GraphLoaderContext): AddResult; getLatest(mutable: MutableGraph): Promise; getOrAdd(graph: GraphDescriptor): Result; get(id: MainGraphIdentifier): MutableGraph | undefined; } //# sourceMappingURL=graph-store.d.ts.map