-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[breadboard, shared-ui, et al] Introduce
GraphStore.graphs()
- **First sketch of `GraphStore.graphs()`.** - **Introduce `GraphStore.registerKit`.** - **Move registering kits with GraphStore to runtime.** - **Nicely dedupe the handlers.** - **Move `deprecated` to a tag.** - **Start using `GraphStore.graphs()`.** - **Plumb `showExperimentalComponents` to `bb-component-selector`.** - **docs(changeset): Introduce `GraphStore.graphs()`.** - **Fix unit tests.** Progress on #3965.
- Loading branch information
Showing
14 changed files
with
312 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
--- | ||
"@google-labs/breadboard": minor | ||
"@breadboard-ai/visual-editor": patch | ||
"@breadboard-ai/shared-ui": patch | ||
"@breadboard-ai/manifest": patch | ||
"@google-labs/breadboard-schema": patch | ||
"@breadboard-ai/types": patch | ||
--- | ||
|
||
Introduce `GraphStore.graphs()`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** | ||
* @license | ||
* Copyright 2024 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
import { deepStrictEqual } from "node:assert"; | ||
import { describe, it } from "node:test"; | ||
import { makeTestGraphStore } from "../../helpers/_graph-store.js"; | ||
import { testKit } from "../test-kit.js"; | ||
|
||
describe("GraphStore.graphs", () => { | ||
it("correctly lists legacy kits as graphs", () => { | ||
const graphStore = makeTestGraphStore({ | ||
kits: [testKit], | ||
}); | ||
deepStrictEqual( | ||
graphStore.graphs().map((graph) => graph.url), | ||
[ | ||
"invoke", | ||
"map", | ||
"promptTemplate", | ||
"runJavascript", | ||
"secrets", | ||
"input", | ||
"output", | ||
"comment", | ||
] | ||
); | ||
}); | ||
|
||
it("correctly lists added graphs", () => { | ||
const graphStore = makeTestGraphStore({ | ||
kits: [testKit], | ||
}); | ||
graphStore.addByDescriptor({ | ||
url: "https://example.com/foo", | ||
title: "Foo", | ||
nodes: [], | ||
edges: [], | ||
}); | ||
deepStrictEqual( | ||
graphStore.graphs().map((graph) => graph.url), | ||
[ | ||
"invoke", | ||
"map", | ||
"promptTemplate", | ||
"runJavascript", | ||
"secrets", | ||
"input", | ||
"output", | ||
"comment", | ||
"https://example.com/foo", | ||
] | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.