fix assistant widget configuration
This commit is contained in:
1 parent
bd3e4c33f3
commit
35673f113e
20 files changed
+762
-12
No files matched your search
@@ -24,6 +24,14 @@ const supportedToolArguments = {
|
||||
summary: "Improve dashboard contrast.",
|
||||
changes: { primaryColor: "#7C3AED" },
|
||||
},
|
||||
configure_widget: {
|
||||
boardId: "board-1",
|
||||
boardName: "Home",
|
||||
kind: "notebook",
|
||||
summary: "Add a formatted Plex self-hosting guide.",
|
||||
options: { content: "<h2>Self-host Plex</h2><p>Install Docker first.</p>" },
|
||||
integrationIds: [],
|
||||
},
|
||||
navigate_to_route: { path: "/manage/apps" },
|
||||
open_command_menu: {},
|
||||
open_media_request_search: {},
|
||||
@@ -127,6 +135,20 @@ describe("assistant human tool contracts", () => {
|
||||
expect(() => z.toJSONSchema(browserToolContracts.configure_board_settings.parameters)).not.toThrow();
|
||||
});
|
||||
|
||||
test("accepts a native widget configuration with proposed options and integrations", () => {
|
||||
expect(
|
||||
browserToolContracts.configure_widget.parameters.safeParse({
|
||||
boardId: "board-1",
|
||||
boardName: "Home",
|
||||
kind: "mediaServer",
|
||||
summary: "Show current Plex streams.",
|
||||
options: { showOnlyPlaying: true },
|
||||
integrationIds: ["plex-1"],
|
||||
}).success,
|
||||
).toBe(true);
|
||||
expect(() => z.toJSONSchema(browserToolContracts.configure_widget.parameters)).not.toThrow();
|
||||
});
|
||||
|
||||
test("only preserves usable app icon URLs", () => {
|
||||
expect(normalizeAssistantAppIconUrl("youtube")).toBe("");
|
||||
expect(normalizeAssistantAppIconUrl("/api/media/youtube.svg")).toBe("/api/media/youtube.svg");
|
||||
|
||||
Reference in new issue
Block a user