@breadboard-ai/types
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -135,26 +135,4 @@ /** | ||
*/ | ||
export type NodeTag = | ||
export type NodeTag = string; | ||
/** | ||
* A simple start tag, which is the same as { type: "start" }. | ||
*/ | ||
"start" | ||
/** | ||
* A tag that indicates that the node is a starting point for traversal. | ||
*/ | ||
| StartTag; | ||
/** | ||
* Represents a start tag, which is a special tag that can be associated with a | ||
* node. It is used to indicate that the node is a starting point for traversal. | ||
* The `label` field allows the user to specify additional way to specify the | ||
* kind of traversal they are looking for. | ||
*/ | ||
export type StartTag = { | ||
type: "start"; | ||
label?: StartLabel; | ||
}; | ||
/** | ||
* Valid start labels. | ||
*/ | ||
export type StartLabel = "default" | "describe"; | ||
/** | ||
* Represents references to a "kit": a collection of `NodeHandlers`. | ||
@@ -198,14 +176,2 @@ * The basic premise here is that people can publish kits with interesting | ||
/** | ||
* Describes a light kit: a kit where each node is backed by a graph. | ||
*/ | ||
export type KitManifest = KitDescriptor & { | ||
/** | ||
* A map of nodes. Each key in this object is the node that is provided by | ||
* the kit. Each value the `GraphDescriptor` containing the graph. This | ||
* graph will be run (runOnce) when the `invoke` of the node's `NodeHandler` | ||
* is called. | ||
*/ | ||
nodes: Record<NodeIdentifier, GraphDescriptor>; | ||
}; | ||
/** | ||
* Represents graph metadata that is stored inline in the GraphDescriptor. | ||
@@ -273,2 +239,6 @@ */ | ||
* within this graph. | ||
* | ||
* The describers in the format of "module:name" will be interpreted as | ||
* "use the `describe` export of the module named `name` to describe this | ||
* graph". | ||
*/ | ||
@@ -346,3 +316,3 @@ describer?: string; | ||
*/ | ||
start?: StartLabel; | ||
start?: NodeIdentifier; | ||
}; | ||
@@ -365,4 +335,9 @@ /** | ||
export type ModuleTag = "published" | "experimental"; | ||
export type ModuleLanguage = string; | ||
export type ModuleMetadata = { | ||
/** | ||
* Whether the module should be presented as a runnable item to runModule. | ||
*/ | ||
runnable?: boolean; | ||
/** | ||
* The icon for the module. | ||
@@ -390,2 +365,9 @@ */ | ||
}; | ||
/** | ||
* The pre-compiled source for this module. | ||
*/ | ||
source?: { | ||
language: ModuleLanguage; | ||
code: ModuleCode; | ||
}; | ||
}; | ||
@@ -400,9 +382,6 @@ export type Module = { | ||
*/ | ||
code: string; | ||
code: ModuleCode; | ||
}; | ||
export type Modules = Record<ModuleIdentifier, Module>; | ||
/** | ||
* Represents a graph. | ||
*/ | ||
export type GraphDescriptor = GraphInlineMetadata & { | ||
export type GraphCommonProperties = GraphInlineMetadata & { | ||
/** | ||
@@ -413,2 +392,33 @@ * Metadata associated with the graph. | ||
/** | ||
* Arguments that are passed to the graph, useful to bind values to graphs. | ||
*/ | ||
args?: InputValues; | ||
/** | ||
* Modules that are included as part of this graph. | ||
*/ | ||
modules?: Modules; | ||
/** | ||
* The modules and sub-graphs that this graph declares as "exports": they | ||
* themselves are usable declarative or imperative graphs. | ||
* When the "exports" property exist, this graph is actually a Kit | ||
* declaration: it can be used to distributed multiple graphs. | ||
*/ | ||
exports?: (ModuleIdentifier | `#${GraphIdentifier}`)[]; | ||
/** | ||
* An optional property that indicates that this graph is | ||
* "virtual": it can not be represented by a static list | ||
* of edges and nodes, and is instead more of a representation | ||
* of something that's "graph-like". | ||
* Modules, when they invoke capabilities, are "virtual" graphs: | ||
* they don't have a defined topology and instead, this topology | ||
* is discovered through imperative code execution | ||
*/ | ||
virtual?: true; | ||
}; | ||
/** | ||
* Represents a typical graph: a collection of nodes and edges that form | ||
* the graph topology. | ||
*/ | ||
export type DeclarativeGraph = GraphCommonProperties & { | ||
/** | ||
* The collection of all edges in the graph. | ||
@@ -429,12 +439,21 @@ */ | ||
graphs?: SubGraphs; | ||
}; | ||
/** | ||
* Represents a graph that's backed by code rather than nodes and edges. | ||
*/ | ||
export type ImperativeGraph = GraphCommonProperties & { | ||
/** | ||
* Arguments that are passed to the graph, useful to bind values to graphs. | ||
* The id of the Module that is used as an entry point for this graph. | ||
* If this value is set, the graph is a "module graph": it is backed | ||
* by code rather than by nodes and edges. | ||
*/ | ||
args?: InputValues; | ||
/** | ||
* Modules that are included as part of this graph. | ||
*/ | ||
modules?: Modules; | ||
} & TestProperties; | ||
main: ModuleIdentifier; | ||
}; | ||
/** | ||
* A union type of both declarative and imperative graphs. Represents a graph | ||
* that is either declarative (defined by nodes and edges) or imperative | ||
* (backed by code). | ||
*/ | ||
export type GraphDescriptor = GraphCommonProperties & DeclarativeGraph & Partial<ImperativeGraph> & TestProperties; | ||
/** | ||
* Values that are supplied as inputs to the `NodeHandler`. | ||
@@ -441,0 +460,0 @@ */ |
@@ -8,2 +8,4 @@ /** | ||
export type * from "./llm-content.js"; | ||
export type * from "./probe.js"; | ||
export type * from "./traversal.js"; | ||
//# sourceMappingURL=index.d.ts.map |
{ | ||
"name": "@breadboard-ai/types", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "TypeScript type definitions for Breadboard.", | ||
@@ -5,0 +5,0 @@ "main": "./dist/src/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
30050
22
665