diff --git a/packages/kilo-ui/src/stories/basic-tool.stories.tsx b/packages/kilo-ui/src/stories/basic-tool.stories.tsx index 5816c932d38..d677af17647 100644 --- a/packages/kilo-ui/src/stories/basic-tool.stories.tsx +++ b/packages/kilo-ui/src/stories/basic-tool.stories.tsx @@ -1,6 +1,6 @@ /** @jsxImportSource solid-js */ import type { Meta, StoryObj } from "storybook-solidjs-vite" -import { BasicTool, GenericTool } from "@opencode-ai/ui/basic-tool" +import { ToolCall, GenericTool } from "@opencode-ai/ui/basic-tool" const meta: Meta = { title: "Components/BasicTool", @@ -12,37 +12,43 @@ type Story = StoryObj export const Default: Story = { render: () => ( - +
{`export const hello = () => "world"`}
-
+ ), } export const WithArgs: Story = { render: () => ( - +
{"added 42 packages in 3s"}
-
+ ), } export const DefaultOpen: Story = { render: () => ( - +
Found 12 matches across 5 files.
-
+ ), } export const NoChildren: Story = { - render: () => , + render: () => , } export const Locked: Story = { render: () => ( - +
{"Hello, world!"}
-
+
), } @@ -53,13 +59,13 @@ export const Generic: Story = { export const AllVariants: Story = { render: () => (
- +
content here
-
- + +
All tests passed!
-
- + +
), diff --git a/packages/kilo-vscode/tests/unit/kilo-ui-contract.test.ts b/packages/kilo-vscode/tests/unit/kilo-ui-contract.test.ts index 86714fe371b..f4d28fb31e9 100644 --- a/packages/kilo-vscode/tests/unit/kilo-ui-contract.test.ts +++ b/packages/kilo-vscode/tests/unit/kilo-ui-contract.test.ts @@ -50,7 +50,8 @@ describe("ToolRegistry tool name contract (runtime)", () => { const names = JSON.stringify(TOOL_NAMES_WE_DEPEND_ON) const result = check(` const hist = { state: null, length: 1, replaceState(s) { hist.state = s }, pushState(s) { hist.state = s }, go() {} } - globalThis.window = globalThis.window || { history: hist, location: { pathname: "/", search: "", hash: "", href: "/", origin: "" }, scrollTo() {}, addEventListener() {}, removeEventListener() {}, confirm() { return false } } + const mql = { matches: false, media: "", onchange: null, addListener() {}, removeListener() {}, addEventListener() {}, removeEventListener() {}, dispatchEvent() { return true } } + globalThis.window = globalThis.window || { history: hist, location: { pathname: "/", search: "", hash: "", href: "/", origin: "" }, scrollTo() {}, addEventListener() {}, removeEventListener() {}, confirm() { return false }, matchMedia() { return mql } } const { ToolRegistry } = await import("./src/components/message-part.tsx") const names = ${names} const missing = names.filter(n => typeof ToolRegistry.render(n) !== "function") @@ -71,7 +72,8 @@ describe("getToolInfo() export contract (runtime)", () => { // outside a SolidJS rendering context. We verify it exists as a function. const result = check(` const hist = { state: null, length: 1, replaceState(s) { hist.state = s }, pushState(s) { hist.state = s }, go() {} } - globalThis.window = globalThis.window || { history: hist, location: { pathname: "/", search: "", hash: "", href: "/", origin: "" }, scrollTo() {}, addEventListener() {}, removeEventListener() {}, confirm() { return false } } + const mql = { matches: false, media: "", onchange: null, addListener() {}, removeListener() {}, addEventListener() {}, removeEventListener() {}, dispatchEvent() { return true } } + globalThis.window = globalThis.window || { history: hist, location: { pathname: "/", search: "", hash: "", href: "/", origin: "" }, scrollTo() {}, addEventListener() {}, removeEventListener() {}, confirm() { return false }, matchMedia() { return mql } } const { getToolInfo } = await import("./src/components/message-part.tsx") if (typeof getToolInfo !== "function") { console.error("getToolInfo is " + typeof getToolInfo)