diff --git a/ui/storybook/.storybook/preview.tsx b/ui/storybook/.storybook/preview.tsx index 46a01e9e5ca..3d0397d2033 100644 --- a/ui/storybook/.storybook/preview.tsx +++ b/ui/storybook/.storybook/preview.tsx @@ -87,6 +87,63 @@ function installStorybookApiFixtures() { }); } + if (url.pathname === "/api/adapters") { + return Response.json([ + { + type: "claude_local", + label: "Claude Local", + source: "builtin", + modelsCount: 2, + loaded: true, + disabled: false, + capabilities: { + supportsInstructionsBundle: true, + supportsSkills: true, + supportsLocalAgentJwt: true, + requiresMaterializedRuntimeSkills: false, + supportsModelProfiles: true, + }, + }, + { + type: "codex_local", + label: "Codex Local", + source: "builtin", + modelsCount: 3, + loaded: true, + disabled: false, + capabilities: { + supportsInstructionsBundle: true, + supportsSkills: true, + supportsLocalAgentJwt: true, + requiresMaterializedRuntimeSkills: false, + supportsModelProfiles: true, + }, + }, + ]); + } + + const adapterModelsMatch = url.pathname.match( + /^\/api\/companies\/[^/]+\/adapters\/([^/]+)\/(models|model-profiles)$/, + ); + if (adapterModelsMatch) { + const [, , resource] = adapterModelsMatch; + if (resource === "models") { + return Response.json([ + { id: "claude-opus-4-7", label: "Claude Opus 4.7" }, + { id: "claude-sonnet-4-6", label: "Claude Sonnet 4.6" }, + { id: "claude-haiku-4-5", label: "Claude Haiku 4.5" }, + ]); + } + return Response.json([ + { + key: "cheap", + label: "Cheap", + adapterConfig: { model: "claude-sonnet-4-6" }, + source: "adapter_default", + }, + ]); + } + if (url.pathname === "/api/plugins/ui-contributions") { return Response.json([]); }