diff --git a/.github/workflows/ui-storybook.yml b/.github/workflows/ui-storybook.yml new file mode 100644 index 000000000000..e757bb05f250 --- /dev/null +++ b/.github/workflows/ui-storybook.yml @@ -0,0 +1,81 @@ +name: UI Storybook + +# Builds Llama UI and Llama Chat's Storybook (ui/apps/chat) and publishes it to its Hugging Face Space +# whenever the UI changes on master, so the Space always shows the latest build. + +on: + workflow_dispatch: + push: + branches: + - master + paths: [ + '.github/workflows/ui-storybook.yml', + 'ui/apps/chat/**', + 'ui/lib/ui/**' + ] + +cache-mode: none +permissions: + contents: read + +# only the newest build matters: a newer push replaces a deploy still in progress +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: true + +jobs: + deploy: + name: Deploy to Hugging Face Spaces + if: github.repository == 'ggml-org/llama.cpp' + runs-on: ubuntu-24.04 + + env: + HF_SPACE: ${{ vars.HF_SPACE_UI_STORYBOOK || 'ggml-org/llama-ui-storybook' }} + + steps: + - name: Checkout code + uses: actions/checkout@v6 + + - name: Setup Node.js + uses: actions/setup-node@v6 + with: + node-version: "24" + package-manager-cache: false + + - name: Install dependencies + run: npm ci + working-directory: ui/apps/chat + + - name: Build Storybook + run: npm run build-storybook + working-directory: ui/apps/chat + + - name: Write the Space card + run: | + cat > ui/apps/chat/storybook-static/README.md << EOF + --- + title: Llama UI Storybook + emoji: 🦙 + colorFrom: gray + colorTo: gray + sdk: static + pinned: false + --- + + The Storybook of Llama UI and Llama Chat, built from [ggml-org/llama.cpp](https://github.com/ggml-org/llama.cpp) (\`ui/apps/chat\`) at ${GITHUB_SHA}. + EOF + + - name: Install Hugging Face Hub CLI + run: | + python3 -m venv .venv-hf + .venv-hf/bin/pip install -U huggingface_hub==1.28.0 + + - name: Upload to the Space + env: + HF_TOKEN: ${{ secrets.HF_TOKEN_UI_STATIC_OUTPUT }} + run: | + # --delete '*' removes files the new build no longer has; the Space's .gitattributes is always kept + .venv-hf/bin/hf upload "$HF_SPACE" ui/apps/chat/storybook-static . \ + --repo-type space \ + --delete '*' \ + --commit-message "Storybook from ggml-org/llama.cpp@${GITHUB_SHA::10}" diff --git a/.github/workflows/ui.yml b/.github/workflows/ui.yml index abf55d7093ad..96fb5162579d 100644 --- a/.github/workflows/ui.yml +++ b/.github/workflows/ui.yml @@ -132,6 +132,15 @@ jobs: run: npm run check working-directory: ui/lib/ui + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + working-directory: ui/lib/ui + + # the unit tests and the Storybook stories (ui/lib/ui/tests/stories), which run as tests in Chromium + - name: Run tests + run: npm test + working-directory: ui/lib/ui + - name: Build the package run: npm run prepack working-directory: ui/lib/ui diff --git a/ui/apps/chat/.storybook/color-scheme.ts b/ui/apps/chat/.storybook/color-scheme.ts new file mode 100644 index 000000000000..4ebfb46ee5cf --- /dev/null +++ b/ui/apps/chat/.storybook/color-scheme.ts @@ -0,0 +1,24 @@ +import { MEDIA_QUERIES } from '#lib/constants/pwa.constants.ts'; +import { ColorMode } from '#lib/enums/ui.enums.ts'; +import { modeStorageKey } from 'mode-watcher'; + +/** The class on `` that turns the dark theme on, as mode-watcher sets it. */ +export const DARK_CLASS = ColorMode.DARK; + +/** Turns the dark theme on or off. */ +export function setDarkClass(isDark: boolean) { + document.documentElement.classList.toggle(DARK_CLASS, isDark); +} + +/** + * Sets the dark class from the saved mode-watcher mode, or the system preference + * when there is none. Docs pages render no story, so preview.ts calls this too. + */ +export function applyColorScheme() { + const mode = localStorage.getItem(modeStorageKey.current) || ColorMode.SYSTEM; + const isDark = + mode === ColorMode.DARK || + (mode === ColorMode.SYSTEM && window.matchMedia(MEDIA_QUERIES.PREFERS_DARK).matches); + + setDarkClass(isDark); +} diff --git a/ui/apps/chat/.storybook/decorators/ModeWatcherDecorator.svelte b/ui/apps/chat/.storybook/decorators/ModeWatcherDecorator.svelte index 8bded8b3f1e6..82fa0b10ac5c 100644 --- a/ui/apps/chat/.storybook/decorators/ModeWatcherDecorator.svelte +++ b/ui/apps/chat/.storybook/decorators/ModeWatcherDecorator.svelte @@ -1,33 +1,24 @@ - +{#if !forced}{/if} {#if children} {@const Component = children} diff --git a/ui/apps/chat/.storybook/docs.css b/ui/apps/chat/.storybook/docs.css new file mode 100644 index 000000000000..4a2f1facc078 --- /dev/null +++ b/ui/apps/chat/.storybook/docs.css @@ -0,0 +1,91 @@ +@reference '../src/app.css'; + +/* + * MDX pages that wrap their content in
drop + * Storybook's docs theme and take colours, font and type roles from the design system. + */ +.sbdocs-wrapper:has(.ds-docs) { + background: var(--surface-page); +} + +.ds-docs { + @apply mx-auto max-w-3xl font-sans text-body text-fg-default; + + & :where(h1) { + @apply mb-4 text-heading; + } + + & :where(h2) { + @apply mt-10 mb-3 border-b border-line-default pb-2 text-title; + } + + & :where(h3) { + @apply mt-6 mb-2 text-body font-semibold; + } + + & :where(h4, h5, h6) { + @apply mt-4 mb-2 text-label; + } + + & :where(p, ul, ol, blockquote, table, pre) { + @apply my-3; + } + + & :where(ul) { + @apply list-disc pl-6; + } + + & :where(ol) { + @apply list-decimal pl-6; + } + + & :where(li) { + @apply my-1; + } + + & :where(strong) { + @apply font-semibold; + } + + & :where(a) { + @apply underline underline-offset-2 hover:text-fg-muted; + } + + & :where(blockquote) { + @apply border-l-2 border-line-default pl-4 text-fg-muted; + } + + /* a note that stands out from the running text: a quiet panel with the accent on its edge */ + & :where(.callout) { + @apply my-6 rounded-panel border-l-2 border-(--art-cinder) bg-surface-muted px-5 py-4; + + & > :where(p) { + @apply my-0; + } + } + + & :where(hr) { + @apply my-8 border-line-default; + } + + /* inline code only, with a selector that outranks the code the Markdown block renders */ + & :not(pre) > code { + @apply rounded-control border-0 bg-surface-code px-1 py-0.5 font-mono text-[0.875em] text-(--fg-code); + } + + & :where(pre) { + @apply overflow-x-auto rounded-panel bg-surface-code p-4 text-body-sm; + } + + & :where(table) { + @apply w-full border-collapse text-body-sm; + } + + & :where(th, td) { + @apply border-b border-line-default px-3 py-2 text-left align-top; + } + + & :where(th) { + @apply text-label; + } +} diff --git a/ui/apps/chat/.storybook/main.ts b/ui/apps/chat/.storybook/main.ts index b02ecc5d5a62..076f244815d6 100644 --- a/ui/apps/chat/.storybook/main.ts +++ b/ui/apps/chat/.storybook/main.ts @@ -4,8 +4,19 @@ import { fileURLToPath } from 'url'; const __dirname = dirname(fileURLToPath(import.meta.url)); +// Llama UI's stories live with the library (ui/lib/ui/tests/stories), which runs and tests them in its own +// Storybook; this one shows them too, under Llama UI, next to Llama Chat's own. The library's front page stays its own. +const LLAMA_UI_STORIES = resolve(__dirname, '../../../lib/ui/tests/stories'); + const config: StorybookConfig = { - stories: ['../tests/stories/**/*.mdx', '../tests/stories/**/*.stories.@(js|ts|svelte)'], + stories: [ + '../tests/stories/**/*.mdx', + '../tests/stories/**/*.stories.@(js|ts|svelte)', + { + directory: '../../../lib/ui/tests/stories', + files: '{foundations,components,app,models,mockups}/**/*.stories.svelte' + } + ], addons: [ '@storybook/addon-svelte-csf', '@chromatic-com/storybook', @@ -18,7 +29,18 @@ const config: StorybookConfig = { viteFinal: async (config) => { config.server = config.server || {}; config.server.fs = config.server.fs || {}; - config.server.fs.allow = [...(config.server.fs.allow || []), resolve(__dirname, '../tests')]; + config.server.fs.allow = [ + ...(config.server.fs.allow || []), + resolve(__dirname, '../tests'), + LLAMA_UI_STORIES + ]; + // the library's stories import Storybook from where they live, where only this app's packages are installed + config.resolve = config.resolve || {}; + config.resolve.dedupe = [ + ...(config.resolve.dedupe || []), + '@storybook/addon-svelte-csf', + 'storybook' + ]; return config; } }; diff --git a/ui/apps/chat/.storybook/manager-head.html b/ui/apps/chat/.storybook/manager-head.html new file mode 100644 index 000000000000..5964c8fa3cb4 --- /dev/null +++ b/ui/apps/chat/.storybook/manager-head.html @@ -0,0 +1,86 @@ + + diff --git a/ui/apps/chat/.storybook/mockups/MacDock.svelte b/ui/apps/chat/.storybook/mockups/MacDock.svelte new file mode 100644 index 000000000000..0c2fdfad9bcf --- /dev/null +++ b/ui/apps/chat/.storybook/mockups/MacDock.svelte @@ -0,0 +1,174 @@ + + + + + +{#snippet tile(app: DockApp)} + + {#if app.name === labelled}{app.name}{/if} + + {#if app.icon} + {app.name} + {:else} + {@const Glyph = app.glyph ?? Folder} + + + + + + + + + + + {/if} + + + +{/snippet} + + + + diff --git a/ui/apps/chat/.storybook/mockups/MacMenuBar.svelte b/ui/apps/chat/.storybook/mockups/MacMenuBar.svelte new file mode 100644 index 000000000000..5a524adb07ce --- /dev/null +++ b/ui/apps/chat/.storybook/mockups/MacMenuBar.svelte @@ -0,0 +1,119 @@ + + + + + + diff --git a/ui/apps/chat/.storybook/mockups/MacStatusIcon.svelte b/ui/apps/chat/.storybook/mockups/MacStatusIcon.svelte new file mode 100644 index 000000000000..2b857aa5ad37 --- /dev/null +++ b/ui/apps/chat/.storybook/mockups/MacStatusIcon.svelte @@ -0,0 +1,56 @@ + + + + + + + + diff --git a/ui/apps/chat/.storybook/mockups/MockDesktop.svelte b/ui/apps/chat/.storybook/mockups/MockDesktop.svelte new file mode 100644 index 000000000000..51facca5111d --- /dev/null +++ b/ui/apps/chat/.storybook/mockups/MockDesktop.svelte @@ -0,0 +1,76 @@ + + + +
+
+ {@render children()} +
+
+ + diff --git a/ui/apps/chat/.storybook/mockups/WindowsTaskbar.svelte b/ui/apps/chat/.storybook/mockups/WindowsTaskbar.svelte new file mode 100644 index 000000000000..dc2e8afdf8bd --- /dev/null +++ b/ui/apps/chat/.storybook/mockups/WindowsTaskbar.svelte @@ -0,0 +1,234 @@ + + + + + + + + diff --git a/ui/apps/chat/.storybook/mockups/index.ts b/ui/apps/chat/.storybook/mockups/index.ts new file mode 100644 index 000000000000..c4783bde1224 --- /dev/null +++ b/ui/apps/chat/.storybook/mockups/index.ts @@ -0,0 +1,15 @@ +// OS mockups for the stories: a desktop's wallpaper, and on it the macOS Dock and menu bar or the Windows taskbar, +// to picture the brand's icons where the apps put them +export { + default as MacDock, + PLACEHOLDERS as MAC_DOCK_PLACEHOLDERS, + type DockApp +} from './MacDock.svelte'; +export { default as MacMenuBar } from './MacMenuBar.svelte'; +export { default as MacStatusIcon } from './MacStatusIcon.svelte'; +export { default as MockDesktop } from './MockDesktop.svelte'; +export { + default as WindowsTaskbar, + PLACEHOLDERS as WINDOWS_TASKBAR_PLACEHOLDERS, + type TaskbarApp +} from './WindowsTaskbar.svelte'; diff --git a/ui/apps/chat/.storybook/preview.ts b/ui/apps/chat/.storybook/preview.ts index c26ceaec6309..671aa2f95003 100644 --- a/ui/apps/chat/.storybook/preview.ts +++ b/ui/apps/chat/.storybook/preview.ts @@ -1,8 +1,16 @@ import '../src/app.css'; +import { MEDIA_QUERIES } from '#lib/constants/pwa.constants.ts'; +import { SurfaceTheme } from '#lib/enums/ui.enums.ts'; +import { applySurfaceTheme } from '#lib/utils/css.ts'; +import './docs.css'; +import { applyColorScheme } from './color-scheme'; import ModeWatcherDecorator from './decorators/ModeWatcherDecorator.svelte'; import TooltipProviderDecorator from './decorators/TooltipProviderDecorator.svelte'; import type { Preview } from '@storybook/sveltekit'; +applyColorScheme(); +window.matchMedia(MEDIA_QUERIES.PREFERS_DARK).addEventListener('change', applyColorScheme); + const preview: Preview = { parameters: { controls: { @@ -16,6 +24,57 @@ const preview: Preview = { disabled: true }, + options: { + // sidebar sections: the introduction and the guidelines for agents, then the two layers as the code has them. + // Llama UI is the library (ui/lib/ui): its foundations, base components, app components, Model UI and mockups. + // Llama Chat is the app (ui/apps/chat): its own foundations, then one folder per src/lib/components/app/, + // the full chat screen leading Chat. The brand and communications are in llama-brand's Storybook + storySort: { + order: [ + 'Introduction', + 'Agents', + ['Design guidelines'], + 'Llama UI', + [ + 'Foundations', + ['Colors', 'Typography', 'Sizing', 'Shapes', 'Elevation', 'Surfaces'], + 'Components', + ['Actions', 'Forms', 'Display', 'Overlays', 'Navigation'], + 'App components', + 'Models', + 'Mockups' + ], + 'Llama Chat', + [ + 'Foundations', + ['Safe areas', 'Brand'], + 'Chat', + [ + 'ChatScreen', + ['ChatScreen', '*'], + 'ChatForm', + 'ChatMessages', + 'ChatAttachments', + 'ChatTabs' + ], + 'Content', + 'Models', + 'MCP', + 'Navigation', + 'Settings', + ['DialogSettingsChat', 'Navigation', 'Sections'], + 'Dialogs', + 'Forms', + 'Actions', + 'Badges', + 'Misc', + 'Servers', + 'PWA' + ] + ] + } + }, + a11y: { // 'todo' - show a11y violations in the test UI only // 'error' - fail CI on a11y violations @@ -23,11 +82,50 @@ const preview: Preview = { test: 'todo' } }, + // read by tests/stories/pace.ts; the test runner always plays at full speed + globalTypes: { + interactionPace: { + description: 'Speed of the interactions a story plays', + toolbar: { + dynamicTitle: true, + icon: 'timer', + items: [ + { title: 'Human pace', value: 'human' }, + { title: 'Instant', value: 'instant' } + ], + title: 'Interaction pace' + } + }, + // the light surface theme: Paper (white panels on a grey page) or Matte (grey glass on white) + surface: { + description: 'Light surface theme', + toolbar: { + dynamicTitle: true, + icon: 'paintbrush', + items: [ + { title: 'Paper', value: SurfaceTheme.PAPER }, + { title: 'Matte', value: SurfaceTheme.MATTE } + ], + title: 'Surface' + } + } + }, + initialGlobals: { + interactionPace: 'human', + surface: SurfaceTheme.PAPER + }, decorators: [ - (story) => ({ + (story, context) => { + applySurfaceTheme(context.globals.surface); + + return story(); + }, + // `parameters.colorScheme` fixes a story to light or dark, whatever the viewer chose (a scene in a store screenshot) + (story, context) => ({ Component: ModeWatcherDecorator, props: { - children: story + children: story, + forced: context.parameters.colorScheme } }), (story) => ({ diff --git a/ui/apps/chat/AGENTS.md b/ui/apps/chat/AGENTS.md index efb369e1a8bd..c4c0a0f3c191 100644 --- a/ui/apps/chat/AGENTS.md +++ b/ui/apps/chat/AGENTS.md @@ -1,6 +1,22 @@ # Instructions for ui/apps/chat -These add to the repository's [AGENTS.md](../../../AGENTS.md) for work in `ui/apps/chat`: **Llama Chat**, the chat client that llama-server bundles. **Llama UI**, the library, is `ui/lib/ui` (`@ggml-org/llama-ui`): Chat imports its tokens, fonts and base components from there (`@ggml-org/llama-ui/ui/`) and keeps no copy of them. `DESIGN.md` lives here. +These add to the repository's [AGENTS.md](../../../AGENTS.md) for work in `ui/apps/chat`: **Llama Chat**, the chat client that llama-server bundles. **Llama UI**, the library, is `ui/lib/ui` (`@ggml-org/llama-ui`): Chat imports its tokens, fonts and base components from there (`@ggml-org/llama-ui/ui/`) and keeps no copy of them. `DESIGN.md` and the Storybook live here; the brand book, `BRAND.md`, and the brand and communications pages are in [ggml-org/llama-brand](https://github.com/ggml-org/llama-brand), with their own Storybook. - **Design:** [DESIGN.md](DESIGN.md) holds the tokens, roles and rules, written for agents. Follow it for anything visual; when it and the CSS disagree, the CSS wins and DESIGN.md is updated. +- **Stories:** a story lives with the code it shows. Llama UI's (its foundations, base components, app components and Model UI) are in `ui/lib/ui/tests/stories`, titled `Llama UI/...`, and run as the library's tests; this app's Storybook shows them too. Llama Chat's are in `tests/stories/`, one folder per `src/lib/components/app/` (`chat/` has one per Chat folder), titled `Llama Chat//`. An accessibility story sits next to its component's, as `.a11y.stories.svelte`, titled `...//Accessibility`. - **Components:** the `SKILL.md` next to a component folder (such as [src/lib/components/app/SKILL.md](src/lib/components/app/SKILL.md)) holds that folder's conventions. + +## Content is Markdown, custom pieces are Svelte: .svx + +Anything that is mostly content (a doc, an overview, a showcase or a Storybook page with prose) is written in Markdown, and whatever Markdown cannot express (a live example, a diagram, a real component) is a Svelte component placed in it. Together that is a `.svx` page, compiled by [mdsvex](https://mdsvex.pngwk.com). + +- Write the prose as plain Markdown, so it reads well as source, for people and for agents alike. +- Put each custom piece in its own `.svelte` file and import it in the page's ` - - - - - - - - - - - - - - - - - - -
- {#each RADII as [radius, label] (radius)} -
- {label} - - -
- {/each} -
-
diff --git a/ui/apps/chat/tests/stories/ChatMessage.stories.svelte b/ui/apps/chat/tests/stories/ChatMessage.stories.svelte deleted file mode 100644 index ff9518a70fc8..000000000000 --- a/ui/apps/chat/tests/stories/ChatMessage.stories.svelte +++ /dev/null @@ -1,416 +0,0 @@ - - - { - const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts'); - - settingsStore.updateConfig('showRawOutputSwitch', false); - }} -/> - - { - const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts'); - - settingsStore.updateConfig('showRawOutputSwitch', false); - }} -/> - - { - const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts'); - - settingsStore.updateConfig('showRawOutputSwitch', false); - }} -/> - - { - const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts'); - - settingsStore.updateConfig('showRawOutputSwitch', false); - }} -/> - - { - const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts'); - - settingsStore.updateConfig('showRawOutputSwitch', true); - }} -/> - - { - const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts'); - const { conversationsStore } = await import('#lib/stores/conversations/index.svelte.ts'); - - settingsStore.updateConfig('showMessageStats', true); - settingsStore.updateConfig('showRawOutputSwitch', false); - // The toggle reads the before size from the branch, so the story needs - // the summarized turn in the active message list. - conversationsStore.activeMessages = [preCompactionAssistant, compactionMessage]; - }} -/> - - { - const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts'); - const { chatActivityStore } = await import('#lib/stores/chat/activity.svelte.ts'); - const { chatStore } = await import('#lib/stores/chat/index.svelte.ts'); - - settingsStore.updateConfig('showRawOutputSwitch', false); - - // The summary request reports its prompt progress through the shared - // processing state; seed one so the story shows the prefill detail. - chatActivityStore.markCompacting('conv-1', compactionPendingMessage.id); - chatStore.processing.setActiveConversation('conv-1'); - chatStore.processing.setState('conv-1', { - contextTotal: 32768, - contextUsed: 10000, - hasNextToken: false, - outputTokensMax: -1, - outputTokensUsed: 0, - progressPercent: 42, - promptProgress: { cache: 0, processed: 4200, time_ms: 6000, total: 10000 }, - promptTokens: 0, - speculative: false, - status: 'preparing', - temperature: 0.8, - tokensDecoded: 0, - tokensPerSecond: 0, - tokensRemaining: -1, - topP: 0.95 - }); - }} -/> - - { - const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts'); - const { chatActivityStore } = await import('#lib/stores/chat/activity.svelte.ts'); - const { chatStore } = await import('#lib/stores/chat/index.svelte.ts'); - - settingsStore.updateConfig('showRawOutputSwitch', false); - - // Prompt processing is over, so only the generated tokens are reported. - chatActivityStore.markCompacting('conv-1', compactionGeneratingMessage.id); - chatStore.processing.setActiveConversation('conv-1'); - chatStore.processing.setState('conv-1', { - contextTotal: 32768, - contextUsed: 45200, - hasNextToken: true, - outputTokensMax: -1, - outputTokensUsed: 128, - promptTokens: 42200, - speculative: false, - status: 'generating', - temperature: 0.8, - tokensDecoded: 128, - tokensPerSecond: 25, - tokensRemaining: -1, - topP: 0.95 - }); - }} -/> - - { - const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts'); - - settingsStore.updateConfig('showRawOutputSwitch', false); - // Phase 1: Stream reasoning content in chunks - let reasoningText = - 'I need to think about this carefully. Let me break down the problem:\n\n1. The user is asking for help with something complex\n2. I should provide a thorough and helpful response\n3. I need to consider multiple approaches\n4. The best solution would be to explain step by step\n\nThis approach will ensure clarity and understanding.'; - let reasoningChunk = 'I'; - let i = 0; - - while (i < reasoningText.length) { - const chunkSize = Math.floor(Math.random() * 5) + 3; // Random 3-7 characters - const chunk = reasoningText.slice(i, i + chunkSize); - - reasoningChunk += chunk; - - // Update the reactive state directly - streamingMessage.thinking = reasoningChunk; - - i += chunkSize; - await new Promise((resolve) => setTimeout(resolve, 50)); - } - - const regularText = - "Based on my analysis, here's the solution:\n\n**Step 1:** First, we need to understand the requirements clearly.\n\n**Step 2:** Then we can implement the solution systematically.\n\n**Step 3:** Finally, we test and validate the results.\n\nThis approach ensures we cover all aspects of the problem effectively."; - - let contentChunk = ''; - - i = 0; - - while (i < regularText.length) { - const chunkSize = Math.floor(Math.random() * 5) + 3; // Random 3-7 characters - const chunk = regularText.slice(i, i + chunkSize); - - contentChunk += chunk; - - // Update the reactive state directly - streamingMessage.content = contentChunk; - - i += chunkSize; - await new Promise((resolve) => setTimeout(resolve, 50)); - } - - streamingMessage.timestamp = Date.now(); - }} -> -
- -
-
- - { - const { settingsStore } = await import('#lib/stores/settings/index.svelte.ts'); - - settingsStore.updateConfig('showRawOutputSwitch', false); - // Import the chat store to simulate loading state - const { chatStore } = await import('#lib/stores/chat/index.svelte.ts'); - - // Set loading state to true to trigger the processing UI - chatStore.isLoading = true; - - // Simulate the processing state hook behavior - // This will show the "Generating..." text and parameter details - await new Promise((resolve) => setTimeout(resolve, 100)); - }} -/> diff --git a/ui/apps/chat/tests/stories/ChatScreenForm.stories.svelte b/ui/apps/chat/tests/stories/ChatScreenForm.stories.svelte deleted file mode 100644 index 1240b595bdad..000000000000 --- a/ui/apps/chat/tests/stories/ChatScreenForm.stories.svelte +++ /dev/null @@ -1,95 +0,0 @@ - - - { - const editor = await canvas.findByRole('textbox'); - const submitButton = await canvas.findByRole('button', { name: 'Send' }); - - // Expect the input to be focused after the component is mounted - await expect(editor).toHaveFocus(); - - // Expect the submit button to be disabled - await expect(submitButton).toBeDisabled(); - - const text = 'What is the meaning of life?'; - - await userEvent.clear(editor); - await userEvent.type(editor, text); - - await expect(editor).toHaveTextContent(text); - - const fileInput = document.querySelector('input[type="file"]'); - - await expect(fileInput).not.toHaveAttribute('accept'); - }} -/> - - - - { - const jpgAttachment = canvas.getByAltText('1.jpg'); - const svgAttachment = canvas.getByAltText('hf-logo.svg'); - const pdfFileExtension = canvas.getByText('PDF'); - const pdfAttachment = canvas.getByText('example.pdf'); - const pdfSize = canvas.getByText('342.82 KB'); - - await expect(jpgAttachment).toBeInTheDocument(); - await expect(jpgAttachment).toHaveAttribute('src', jpgAsset); - - await expect(svgAttachment).toBeInTheDocument(); - await expect(svgAttachment).toHaveAttribute('src', svgAsset); - - await expect(pdfFileExtension).toBeInTheDocument(); - await expect(pdfAttachment).toBeInTheDocument(); - await expect(pdfSize).toBeInTheDocument(); - }} -/> diff --git a/ui/apps/chat/tests/stories/DesignGuidelines.mdx b/ui/apps/chat/tests/stories/DesignGuidelines.mdx new file mode 100644 index 000000000000..d4b35cec5ab9 --- /dev/null +++ b/ui/apps/chat/tests/stories/DesignGuidelines.mdx @@ -0,0 +1,30 @@ +import { Markdown, Meta, Source, Unstyled } from '@storybook/addon-docs/blocks'; +import designMd from '../../DESIGN.md?raw'; + +export const [, tokens, guidelines] = designMd.split(/^---$/m); + + + + +
+ +# Design guidelines + +
+ +**Written for agents first.** This is the how of Llama UI, in a form an agent can follow when it builds or changes the UI: the tokens, the roles and the rules, precise rather than persuasive. People can read it too. + +
+ +Rendered from `ui/apps/chat/DESIGN.md`. The implementation lives in `ui/lib/ui/src/lib/styles`, and every token and surface below can be seen under **Llama UI** in this Storybook. The logo, type and colours are in llama-brand's Storybook. + +{guidelines} + +## Tokens + +The machine-readable half of `ui/apps/chat/DESIGN.md`, in the [DESIGN.md format](https://github.com/google-labs-code/design.md). Check it with `npx @google/design.md lint DESIGN.md`. + + + +
+
diff --git a/ui/apps/chat/tests/stories/Introduction.mdx b/ui/apps/chat/tests/stories/Introduction.mdx deleted file mode 100644 index 7ee9182689c4..000000000000 --- a/ui/apps/chat/tests/stories/Introduction.mdx +++ /dev/null @@ -1,44 +0,0 @@ -import { Meta } from '@storybook/addon-docs/blocks'; - - - -# Llama Chat - -Welcome to **Llama UI**, the component library of Llama Chat! This Storybook showcases the components used in Llama Chat, the modern web interface for the llama-server. - -## 🚀 About This Project - -Llama Chat is a modern web interface for the llama-server, built with SvelteKit and ShadCN UI. Features include: - -- **Real-time chat conversations** with AI assistants -- **Multi-conversation management** with persistent storage -- **Advanced parameter tuning** for model behavior -- **File upload support** for multimodal interactions -- **Responsive design** that works on desktop and mobile - -## 🎨 Design System - -The UI is built using: - -- **SvelteKit** - Modern web framework with excellent performance -- **Tailwind CSS** - Utility-first CSS framework for rapid styling -- **ShadCN/UI** - High-quality, accessible component library -- **Lucide Icons** - Beautiful, consistent icon set - -## 🔧 Development - -This Storybook serves as both documentation and a development environment for the UI components. Each story demonstrates: - -- **Component variations** - Different states and configurations -- **Interactive examples** - Live components you can interact with -- **Usage patterns** - How components work together -- **Styling consistency** - Unified design language - -## 🚀 Getting Started - -To explore the components: - -1. **Browse the sidebar** to see all available components -2. **Click on stories** to see different component states -3. **Use the controls panel** to interact with component props -4. **Check the docs tab** for detailed component information diff --git a/ui/apps/chat/tests/stories/MarkdownContent.stories.svelte b/ui/apps/chat/tests/stories/MarkdownContent.stories.svelte deleted file mode 100644 index a3d3662f6e1e..000000000000 --- a/ui/apps/chat/tests/stories/MarkdownContent.stories.svelte +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - - - - - - - - - - - - { - const { canvasElement } = context; - - // Wait for component to render - await new Promise((resolve) => setTimeout(resolve, 100)); - - // Find all links in the rendered content - const links = (canvasElement as HTMLElement).querySelectorAll( - 'a[href]' - ) as NodeListOf; - const linkList = Array.from(links) as HTMLAnchorElement[]; - - // Test that we have the expected number of links - expect(links.length).toBeGreaterThan(0); - - // Test each link for proper attributes - links.forEach((link: HTMLAnchorElement) => { - const href = link.getAttribute('href'); - - // Test that external links have proper security attributes - if (href && (href.startsWith('http://') || href.startsWith('https://'))) { - expect(link.getAttribute('target')).toBe('_blank'); - expect(link.getAttribute('rel')).toBe('noopener noreferrer'); - } - }); - - // Test specific links exist - const hugginFaceLink = linkList.find( - (link) => link.getAttribute('href') === 'https://huggingface.co' - ); - - expect(hugginFaceLink).toBeTruthy(); - expect(hugginFaceLink?.textContent).toBe('Hugging Face Homepage'); - - const githubLink = linkList.find( - (link) => link.getAttribute('href') === 'https://github.com/ggml-org/llama.cpp' - ); - - expect(githubLink).toBeTruthy(); - expect(githubLink?.textContent).toBe('GitHub Repository'); - - const openaiLink = linkList.find((link) => link.getAttribute('href') === 'https://openai.com'); - - expect(openaiLink).toBeTruthy(); - expect(openaiLink?.textContent).toBe('OpenAI Website'); - - const googleLink = linkList.find( - (link) => link.getAttribute('href') === 'https://www.google.com' - ); - - expect(googleLink).toBeTruthy(); - expect(googleLink?.textContent).toBe('Google Search'); - - // Test inline links (auto-linked URLs) - const exampleLink = linkList.find( - (link) => link.getAttribute('href') === 'https://example.com' - ); - - expect(exampleLink).toBeTruthy(); - - const pythonDocsLink = linkList.find( - (link) => link.getAttribute('href') === 'https://docs.python.org' - ); - - expect(pythonDocsLink).toBeTruthy(); - - console.log(`✅ URL Links test passed - Found ${links.length} links with proper attributes`); - }} -/> diff --git a/ui/apps/chat/tests/stories/ModelsSelector.stories.svelte b/ui/apps/chat/tests/stories/ModelsSelector.stories.svelte deleted file mode 100644 index 2894596fc005..000000000000 --- a/ui/apps/chat/tests/stories/ModelsSelector.stories.svelte +++ /dev/null @@ -1,268 +0,0 @@ - - - - - -
- -
-
- - -
- -
-
- - -
- -
-
- - -
-
- Server model states -
- - {}} - onMouseEnter={() => {}} - onSelect={() => {}} - option={mockModel('model-idle', 'Model (idle)', 'meta')} - /> - - {}} - onMouseEnter={() => {}} - onSelect={() => {}} - option={mockModel('model-loading', 'Model (loading)', 'meta')} - /> - - {}} - onMouseEnter={() => {}} - onSelect={() => {}} - option={mockModel('model-loaded', 'Model (loaded)', 'meta')} - /> - - {}} - onMouseEnter={() => {}} - onSelect={() => {}} - option={mockModel('model-sleeping', 'Model (sleeping)', 'meta')} - /> - - {}} - onMouseEnter={() => {}} - onSelect={() => {}} - option={mockModel('model-failed', 'Model (failed)', 'meta')} - /> -
-
- - -
-
- Selection states -
- - {}} - onMouseEnter={() => {}} - onSelect={() => {}} - option={mockModel('normal-model', 'Normal Model', 'meta')} - /> - - {}} - onMouseEnter={() => {}} - onSelect={() => {}} - option={mockModel('selected-model', 'Selected Model', 'meta')} - /> - - {}} - onMouseEnter={() => {}} - onSelect={() => {}} - option={mockModel('highlighted-model', 'Highlighted Model', 'meta')} - /> - - {}} - onMouseEnter={() => {}} - onSelect={() => {}} - option={mockModel('fav-model', 'Favorite Model', 'Qwen')} - /> -
-
diff --git a/ui/apps/chat/tests/stories/PwaRefreshAlert.stories.svelte b/ui/apps/chat/tests/stories/PwaRefreshAlert.stories.svelte deleted file mode 100644 index 615fb1fc033a..000000000000 --- a/ui/apps/chat/tests/stories/PwaRefreshAlert.stories.svelte +++ /dev/null @@ -1,64 +0,0 @@ - - - console.log('reload') }} - name="Default" - play={async ({ canvas }) => { - const title = canvas.getByText('Update available'); - - await expect(title).toBeInTheDocument(); - - const description = canvas.getByText(/A new version is available/); - - await expect(description).toBeInTheDocument(); - - const button = canvas.getByRole('button', { name: 'Reload' }); - - await expect(button).toBeInTheDocument(); - }} -/> - - console.log('reload') }} - name="Hidden" - play={async ({ canvas }) => { - const title = canvas.queryByText('Update available'); - - await expect(title).not.toBeInTheDocument(); - }} -/> - - console.log('reload') - }} - name="ClickReload" - play={async ({ canvas, userEvent }) => { - const button = canvas.getByRole('button', { name: 'Reload' }); - - await expect(button).toBeInTheDocument(); - - await userEvent.click(button); - - const title = canvas.queryByText('Update available'); - - await expect(title).not.toBeInTheDocument(); - - const reloadBtn = canvas.queryByRole('button', { name: 'Reload' }); - - await expect(reloadBtn).not.toBeInTheDocument(); - }} -/> diff --git a/ui/apps/chat/tests/stories/actions/ActionIconCopyToClipboard.stories.svelte b/ui/apps/chat/tests/stories/actions/ActionIconCopyToClipboard.stories.svelte new file mode 100644 index 000000000000..b3fecbd7c6ac --- /dev/null +++ b/ui/apps/chat/tests/stories/actions/ActionIconCopyToClipboard.stories.svelte @@ -0,0 +1,23 @@ + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/actions/GlassKey.stories.svelte b/ui/apps/chat/tests/stories/actions/GlassKey.stories.svelte new file mode 100644 index 000000000000..b2d2c510a89b --- /dev/null +++ b/ui/apps/chat/tests/stories/actions/GlassKey.stories.svelte @@ -0,0 +1,40 @@ + + + +
+
+ {#each LINES as line (line)} +

{line}

+ {/each} +
+ +
+ + + +
+
+
diff --git a/ui/apps/chat/tests/stories/badges/InfoBadges.stories.svelte b/ui/apps/chat/tests/stories/badges/InfoBadges.stories.svelte new file mode 100644 index 000000000000..27e604312582 --- /dev/null +++ b/ui/apps/chat/tests/stories/badges/InfoBadges.stories.svelte @@ -0,0 +1,53 @@ + + + + + +
+ + {#snippet icon()} + + {/snippet} + + 42.7 t/s + + + + {#snippet icon()} + + {/snippet} + + 3.2 s + + + qwen3-8b +
+
+ + + + + + + + +
+
diff --git a/ui/apps/chat/tests/stories/brand/assets/OpticalCentre.svelte b/ui/apps/chat/tests/stories/brand/assets/OpticalCentre.svelte new file mode 100644 index 000000000000..d8c148915d37 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/assets/OpticalCentre.svelte @@ -0,0 +1,550 @@ + + + +
+ + {#each [shown] as panel (panel.key)} +
+
+

{panel.label}

+ +

{panel.note}

+
+ +
+ {#each [['#FAFAFA', '#111111'], ['#111111', '#FAFAFA']] as [ground, ink] (ground)} + + + + + {#each PATHS as d (d)}{/each} + + + {/each} + +
+ + + + + + + + + + + + {#each PATHS as d (d)}{/each} + + + + + + + + + + + + + + + + + {#each panel.gaps as g, i (g.kind + g.name)} + + + {round(g.gap)} + {/each} + + + {#each [{ at: [0.08, panel.y / 2], value: panel.y }, { at: [0.92, (placement.size + panel.y + side) / 2], value: placement.size - panel.y - side }] as m (m.at[0])} + {round(m.value)} + {/each} + + {#each [{ value: panel.x, x: panel.x / 2 }, { value: placement.size - panel.x - side, x: (placement.size + panel.x + side) / 2 }] as m (m.x)} + {round(m.value)} + {/each} + + +
+
+
+ {/each} + + + + {#each tiles as tile, i (tile.name)} +
step} + n={String(i + 1).padStart(2, '0')} + onclick={() => (from = { at: i })} + title={titles[tile.name]} + view="0 0 {placement.size} {placement.size}" + > + {#snippet drawing()} + + + + + + + + {#each PATHS as d (d)}{/each} + + + {#if tile.name === 'measured'} + {#each gaps(tile.x, tile.y) as g (g.kind + g.name)} + + {/each} + {:else} + + {/if} + {/snippet} + + {#if tile.name === 'centred'} + At the exact centre of the square, the icon reads low: its weight sits in the wide foot. + {:else if tile.name === 'lifted'} + Up 1/{lift} of its height, it looks centred. + {:else if tile.name === 'nudged'} + Left 1/{nudge} of its width: where the files place it, in the avatars and the PWA icon. + {:else} + Each gap between the crop and the icon's outer points, filled by a circle touching both. + {/if} +
+ {/each} +
+ +
+ The icon fills {Math.round((side / placement.size) * 100)}% of the side; the numbers are pixels + at {placement.size} + × {placement.size}. Each circle fills the gap between the circle crop and one of the icon’s + outer points: orange at the rounded corners (the blade’s top left, the foot’s bottom right), + grey at the sharp corners (the blade’s top right, the foot’s bottom left), blue at the tips in + the middle (the blade’s left, the foot’s right). No placement evens all three pairs, since the + tips are even only without a sideways nudge; lifted 1/{lift} and nudged 1/{nudge} left, the files + keep every pair within a few pixels. +
+
+ + diff --git a/ui/apps/chat/tests/stories/brand/assets/files/native/macos/icon_512x512@2x.png b/ui/apps/chat/tests/stories/brand/assets/files/native/macos/icon_512x512@2x.png new file mode 100644 index 000000000000..159c775028fa Binary files /dev/null and b/ui/apps/chat/tests/stories/brand/assets/files/native/macos/icon_512x512@2x.png differ diff --git a/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square150x150Logo.scale-400.png b/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square150x150Logo.scale-400.png new file mode 100644 index 000000000000..748ca35a5e0e Binary files /dev/null and b/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square150x150Logo.scale-400.png differ diff --git a/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square44x44Logo.scale-400.png b/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square44x44Logo.scale-400.png new file mode 100644 index 000000000000..970ef0295c72 Binary files /dev/null and b/ui/apps/chat/tests/stories/brand/assets/files/native/windows/Square44x44Logo.scale-400.png differ diff --git a/ui/apps/chat/tests/stories/brand/fonts/LlamaMono.woff2 b/ui/apps/chat/tests/stories/brand/fonts/LlamaMono.woff2 new file mode 100644 index 000000000000..c8cd45657bfe Binary files /dev/null and b/ui/apps/chat/tests/stories/brand/fonts/LlamaMono.woff2 differ diff --git a/ui/apps/chat/tests/stories/brand/fonts/fonts.css b/ui/apps/chat/tests/stories/brand/fonts/fonts.css new file mode 100644 index 000000000000..8d9409b2fd94 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/fonts/fonts.css @@ -0,0 +1,8 @@ +/* Llama Mono for the brand showcases (logo and type); Llama Sans is the design system's own (src/app.css) */ +@font-face { + font-family: 'Llama Mono'; + src: url('./LlamaMono.woff2') format('woff2'); + font-weight: 400 700; + font-style: normal; + font-display: block; +} diff --git a/ui/apps/chat/tests/stories/brand/logo-showcase/ShowcaseFrame.svelte b/ui/apps/chat/tests/stories/brand/logo-showcase/ShowcaseFrame.svelte new file mode 100644 index 000000000000..05899dc7fcce --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/logo-showcase/ShowcaseFrame.svelte @@ -0,0 +1,58 @@ + + + + + + diff --git a/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figure.svelte b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figure.svelte new file mode 100644 index 000000000000..e155eec28679 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figure.svelte @@ -0,0 +1,189 @@ + + + +
+ {#if onclick}{/if} + + {#if n}{n}{/if} + + {@render drawing()} + +
{title}{@render children?.()}
+
+ + diff --git a/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figures.svelte b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figures.svelte new file mode 100644 index 000000000000..623c34703502 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/components/Figures.svelte @@ -0,0 +1,31 @@ + + + +
{@render children()}
+ + diff --git a/ui/apps/chat/tests/stories/brand/logo-showcase/lib/logo.ts b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/logo.ts new file mode 100644 index 000000000000..f8a067f4569f --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/logo.ts @@ -0,0 +1,72 @@ +// Geometry of the Llama icon (ggml-org/llama-brand, icon/icon-light.svg, a 600 x 600 drawing). +// Everything the logo page draws is derived from these numbers. + +export type Pt = [number, number]; + +export const SIZE = 600; +export const SPLIT = 392; // where the two blades meet +export const PATHS = [ + 'M600 392L504.249 558L504.137 557.929C487.252 584.069 458.193 600 426.864 600H120L240 392H600Z', + 'M240 392H0L199.602 46.0254C216.032 17.5463 246.411 3.25756e-05 279.29 0H466.154L240 392Z' +]; + +// the four slanted edges, as two points each +export const edges: Record = { + lowerRight: [ + [600, 392], + [504.249, 558] + ], + shared: [ + [466.154, 0], + [120, 600] + ], // upper blade's right edge and lower blade's left edge: one line + upperLeft: [ + [0, 392], + [199.602, 46.0254] + ] +}; + +export const angle = (a: Pt, b: Pt) => + (Math.atan2(Math.abs(b[1] - a[1]), Math.abs(b[0] - a[0])) * 180) / Math.PI; + +// the rounded corners: tangent points, the sharp corner they replace, and the circle they follow +function corner(tangentEdge: Pt, tangentFlat: Pt, sharp: Pt, inward: 1 | -1) { + const trim = Math.hypot(tangentFlat[0] - sharp[0], tangentFlat[1] - sharp[1]); + const r = trim * Math.tan(Math.PI / 3); // the corner is 120°, so r = trim · tan 60° + + return { + centre: [tangentFlat[0], tangentFlat[1] + inward * r] as Pt, + r, + sharp, + tangentEdge, + tangentFlat, + trim + }; +} +const xAt = (e: [Pt, Pt], y: number) => + e[0][0] + ((y - e[0][1]) * (e[1][0] - e[0][0])) / (e[1][1] - e[0][1]); + +export const corners = [ + corner([199.602, 46.0254], [279.29, 0], [xAt(edges.upperLeft, 0), 0], 1), + corner([504.249, 558], [426.864, 600], [xAt(edges.lowerRight, 600), 600], -1) +]; + +/** Extend the line through a and b to the edges of a box (x0, y0, x1, y1). */ +export function extend(a: Pt, b: Pt, box: [number, number, number, number]): [Pt, Pt] { + const [x0, y0, x1, y1] = box; + const dx = b[0] - a[0], + dy = b[1] - a[1]; + const ts: number[] = []; + + if (dx) ts.push((x0 - a[0]) / dx, (x1 - a[0]) / dx); + + if (dy) ts.push((y0 - a[1]) / dy, (y1 - a[1]) / dy); + + const inside = ts + .map((t) => [a[0] + dx * t, a[1] + dy * t] as Pt) + .filter(([x, y]) => x >= x0 - 1e-6 && x <= x1 + 1e-6 && y >= y0 - 1e-6 && y <= y1 + 1e-6); + + inside.sort((p, q) => p[0] - q[0] || p[1] - q[1]); + + return [inside[0], inside.at(-1)!]; +} diff --git a/ui/apps/chat/tests/stories/brand/logo-showcase/lib/styles/logo.css b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/styles/logo.css new file mode 100644 index 000000000000..59afe43b4902 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/logo-showcase/lib/styles/logo.css @@ -0,0 +1,50 @@ +/* The logo showcase's colours, shared by every drawing (the blueprint, the origin animation, the step tiles and the + rule panels). Grayscale after the brand: black icon on light grey in light mode, white icon on near-black in dark + mode; construction lines in a mid grey that reads over both the icon and the ground. Greys follow the llama.cpp + design system's neutrals. Dark mode follows the design system's .dark class on . */ +:root { + --l-bg: oklch(0.97 0 0); /* neutral-100 */ + --l-shape: #111111; + --l-shape-2: #6b6b6b; + --l-faint: rgba(17, 17, 17, 0.16); + --l-line: oklch(0.708 0 0); /* neutral-400 */ + --l-ink: #111111; + --l-muted: oklch(0.556 0 0); /* fg-muted */ + --l-panel: oklch(1 0 0); /* surface-raised */ + --l-rule: oklch(0.922 0 0); /* line-field */ + --l-mark: #ee6c1e; /* cinder, the one accent: marks a detail, such as the L's empty centre */ + --l-bolt: #ee6c1e; /* cinder, as in the .cpp of the llama.cpp lockup: the L flashes in it */ + /* the lightning: a white-hot core, a yellow glow around it and a blue halo beyond; the L flashes in --l-bolt */ + --l-bolt-core: #ffffff; + --l-bolt-glow: #ffd23f; + --l-bolt-halo: #3d8bff; + --l-ink-glow: 0.3; /* the L's glow in light mode, where it is black */ + /* the strike's night sky, light mode only */ + --l-night: 1; + --l-night-sky: oklch(0.16 0 0); + --l-night-ink: #fafafa; + /* in light mode the bolt is solid, so it reads crisply inside the black L (see-through yellow over black turns olive) */ + --l-bolt-alpha: 1; + --l-bolt-tint: 0; + --l-paper: oklch(0.985 0 0); /* neutral-50 */ + --l-grid: rgba(17, 17, 17, 0.05); + --l-grid-major: rgba(17, 17, 17, 0.13); +} +:root.dark { + --l-bg: oklch(0.16 0 0); + --l-shape: #fafafa; + --l-shape-2: #9e9e9e; + --l-faint: rgba(250, 250, 250, 0.18); + --l-line: oklch(0.439 0 0); + --l-ink: #fafafa; + --l-muted: oklch(0.708 0 0); + --l-panel: oklch(0.205 0 0); + --l-rule: oklch(1 0 0 / 0.12); + --l-bolt-alpha: 0.85; + --l-bolt-tint: 0.3; + --l-ink-glow: 1; + --l-night: 0; + --l-paper: oklch(0.205 0 0); + --l-grid: rgba(250, 250, 250, 0.05); + --l-grid-major: rgba(250, 250, 250, 0.13); +} diff --git a/ui/apps/chat/tests/stories/brand/logo-usage/IconUsage.svelte b/ui/apps/chat/tests/stories/brand/logo-usage/IconUsage.svelte new file mode 100644 index 000000000000..e7658f03b296 --- /dev/null +++ b/ui/apps/chat/tests/stories/brand/logo-usage/IconUsage.svelte @@ -0,0 +1,966 @@ + + + + +{#if section === 'glyphs'} +

In Llama Sans · U+E002, U+E001 and U+E000

+ +

Three glyphs of the font

+ +

+ The icon is a character of Llama Sans, in two sizes, so anything set in it can carry the mark + without an image, in the text's colour and weight. U+E001 is the one to reach for: the icon 1.24 + times the cap height, centred on the capitals, with the lockup's gap after it. Use it in small + text, in controls and before a name, where a cap-height mark would read as smaller than the + letters. U+E000 sits on the baseline at exactly the cap height: keep it for headlines, where the + icon should sit quietly among large capitals and not stand out. In all caps, the case feature + swaps U+E000 for U+E001. U+E002 is the lockup: U+E001 with the space after it built in, typed + straight before the name, in Llama Sans or in Llama Mono, which carries it too. +

+ +
+

llama.cpp

+ +

Llama

+
+ +
+

+ U+E002 · the lockupLlama +

+ +

+ U+E001 · small text, controls, namesModels run locally in  Llama. +

+ +

+ U+E000 · headlinesRun it in  Llama +

+
+{/if} + + +{#if section === 'buttons'} +

In buttons

+ +

Open in Llama

+ +

+ Buttons always take the capital glyph, U+E001: at a label's size the cap-height glyph reads as + smaller than the letters beside it. As a glyph, the icon centres on the button's line box like + the label's capitals, with a word space after it, so it needs no icon slot and no nudging. These + are the design system's own buttons. +

+ +
+
+ + + + + +
+ +
+ + + + + + + +
+
+{/if} + + +{#if section === 'context'} +

The lockups in context

+ +

Where the name goes

+ +

+ The two lockups at the sizes they are used at: the README banner, app headers, a terminal, a + footer and a hero. Llama, the app, is set in Llama Sans with its capital L; llama.cpp, the + engine, in Llama Mono and all lowercase, as it is typed in a terminal. Both start with the + lockup glyph, U+E002: the capital icon with the gap built in, so the lockup is one character and + the name. Llama Mono's is drawn a little larger: with the icons matched, llama.cpp's wider, + heavier letters set at 90% of Llama's. The llama.cpp lockup always sits on a neutral ground + (white, the greys, ink); only the Llama lockup goes on colour, the day sky and the night sky. +

+ +
+ + {#each ['dark', 'light'] as const as tone (tone)} + + {/each} + +
+ llama.cpp + + docs · server · cli + + +
+ +
+ Llama + + Settings +
+ + +
$ llama-server -m model.gguf --port 9931
+ b6123 · listening on http://127.0.0.1:9931
+ b6123 · slot 0 ready, ctx 32768
+ + + + + {#each [{ field: DAY_SKY, ink: '#111111', name: 'day sky' }, { field: NIGHT_SKY, ink: '#fafafa', name: 'night sky' }] as b (b.name)} +
+ Llama +
+ {/each} +
+{/if} + + +{#if section === 'badge'} +

Download badge

+ +

Get the app

+ +

+ Our own equivalent of a store badge, for links to download Llama or get llama.cpp: a dark key + with the icon at the height of its two lines and a small line over the name. 48 px high (40 for + a compact one), radius 10, the icon the capital glyph (U+E001) at 18 px, 14 from the left edge + and 10 from the text. +

+ + +{/if} + + +{#if section === 'text'} +

In running text

+ +

Inline, at any size

+ +

+ In small text the icon takes its capital form, U+E001, so it holds its own next to the letters; + in a headline, the cap-height U+E000 sits quietly among the capitals. Use it before the name it + stands for, never as a word on its own. +

+ +
+

+ Models load with  llama.cpp and run locally in  Llama, on your own machine. +

+ +

+ Models load with  llama.cpp and run locally in  Llama, on your own machine. +

+ +

Run it in  Llama.

+
+{/if} + + +{#if section === 'icons'} +

App icons and avatars

+ +

On the tab, the home screen and the profile

+ + +

+ Every icon starts from the same placement. Centred exactly, the L reads low, its weight in the + wide foot; so the icon is lifted {Math.round(OPTICAL_LIFT * 1000) / 10}% of its height and + nudged + {Math.round(OPTICAL_NUDGE * 1000) / 10}% of its width left, and looks centred. Cut to a circle, + as in the social avatars and the PWA icon, it then clears the circle's edge at its corners and + tips nearly evenly. Drawn from the avatar file itself, the icon at 56% of a square, which every + platform crops round. +

+ +
+ +
+ +

+ The web app's favicon, PWA, maskable and Apple touch icons, with their proportions drawn in. All + of them start from the favicon, the icon with a {percent( + PWA_ASSET_GENERATOR.FAVICON_PADDING / 2 + )} margin; the square icons add the generator's 30% padding, and the PWA icon is the maskable one + at 85%, cut round. The files Llama Chat ships still carry the old llama.cpp mark; these are drawn + with the L. +

+ +
+ {#each icons as icon (icon.label)} + {@const p = placed(100, 100, icon.scale)} +
+ + {#if icon.background} + {#if icon.round} + + {:else} + + {/if} + {/if} + + + {#each PATHS as d (d)}{/each} + + + + + + {#if icon.guide === 'safe'} + + {:else if icon.guide === 'apple'} + + {/if} + + +
+ {icon.label} + + {#each icon.spec as line (line)}{line}{/each} + + {icon.files} +
+
+ {/each} +
+ + +

Native app icons

+ +
+ {#each nativeIcons as icon (icon.label)} +
+ {icon.label} + +
+ {icon.label} + + {#each icon.spec as line (line)}{line}{/each} + + {icon.files} +
+
+ {/each} +
+ + +
+ {#each ['light', 'dark'] as const as mode (mode)} +
+ + + + + + +
macOS, the menu bar and the Dock, {mode}
+
+ +
+ + + + +
Windows, the taskbar and the tray, {mode}
+
+ {/each} +
+{/if} + + +{#if section === 'splash'} +

Splash screens

+ +

While the app opens

+ +

+ For now the splash screens are the icon alone, centred on the light or dark page colour at + {percent(splash)} of the screen's shorter side, for every iPhone and iPad size, upright and on its + side. A designed splash screen will follow. +

+ +
+ {#each splashes as s (s.label)} + {@const p = placed(s.w, s.h, splash)} +
+ + + + + {#each PATHS as d (d)}{/each} + + + + + +
+ {s.label} + + {s.w} × {s.h} · icon {Math.round(p.side)} px + + {s.files} +
+
+ {/each} +
+{/if} + + diff --git a/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsList.stories.svelte b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsList.stories.svelte new file mode 100644 index 000000000000..a145cef3aef0 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsList.stories.svelte @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsListItemMcpResource.stories.svelte b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsListItemMcpResource.stories.svelte new file mode 100644 index 000000000000..5553ee00268a --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsListItemMcpResource.stories.svelte @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + console.log('remove', id)} + {onclick} + /> + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsPreview.stories.svelte b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsPreview.stories.svelte new file mode 100644 index 000000000000..00c6a6d97e12 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/attachments/ChatAttachmentsPreview.stories.svelte @@ -0,0 +1,136 @@ + + + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + + +
+ +
+
+ + + +
+ +
+
+ + +
+ +
+
+ + + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + +
+ +
+
+ + + { + await waitFor(() => expect(canvas.getByText('Failed to load PDF images')).toBeInTheDocument(), { + timeout: 5000 + }); + + // a retry loop would flip back to the loading state + await new Promise((resolve) => setTimeout(resolve, 500)); + await expect(canvas.queryByText('Converting PDF to images...')).not.toBeInTheDocument(); + await expect(canvas.getByText('Failed to load PDF images')).toBeInTheDocument(); + }} +> +
+ +
+
diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormActionReasoning.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormActionReasoning.stories.svelte new file mode 100644 index 000000000000..5abcd806d014 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/form/ChatFormActionReasoning.stories.svelte @@ -0,0 +1,56 @@ + + + + + + + + + { + await userEvent.click(canvas.getByRole('button', { name: 'Reasoning effort' })); + await screen.findByRole('menu'); + }} +/> + + { + await userEvent.click(canvas.getByRole('button', { name: 'Reasoning effort' })); + await screen.findByRole('menu'); + }} +/> diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormActionRecord.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormActionRecord.stories.svelte new file mode 100644 index 000000000000..4ddd18fc42b6 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/form/ChatFormActionRecord.stories.svelte @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + // the tooltip trigger wraps the disabled button, hover the trigger + await userEvent.hover(canvas.getAllByRole('button', { name: 'Start recording' })[0]); + }} +/> diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormActionSubmit.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormActionSubmit.stories.svelte new file mode 100644 index 000000000000..caf92908098d --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/form/ChatFormActionSubmit.stories.svelte @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormContextGauge.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormContextGauge.stories.svelte new file mode 100644 index 000000000000..a0416fd5d03d --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/form/ChatFormContextGauge.stories.svelte @@ -0,0 +1,110 @@ + + +{#snippet frame()} + +
+ + + + +{/snippet} + + + {@render frame()} + + + + {@render frame()} + + + + {@render frame()} + + + + {@render frame()} + + + + {@render frame()} + + + + {@render frame()} + diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormCurrentWorkingDirectory.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormCurrentWorkingDirectory.stories.svelte new file mode 100644 index 000000000000..32f19d1c4c69 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/form/ChatFormCurrentWorkingDirectory.stories.svelte @@ -0,0 +1,105 @@ + + +{#snippet template(args: ComponentProps)} + +
+
+ + +
+{/snippet} + + + + + + + + + + + + + + + + ({ error: 'path is outside the allowed roots' }) + })} + name="PickerSearchError" + {template} +/> + + diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormInput.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormInput.stories.svelte new file mode 100644 index 000000000000..5c41912fe770 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/form/ChatFormInput.stories.svelte @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormPickerCommand.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerCommand.stories.svelte new file mode 100644 index 000000000000..1c3b4825dbb6 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerCommand.stories.svelte @@ -0,0 +1,46 @@ + + + +{#snippet anchored(query: string)} +
+
+ +
+
+{/snippet} + + + + + {@render anchored('')} + + + + {@render anchored('dir')} + + + + {@render anchored('xyz')} + + + diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMcpPrompts.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMcpPrompts.stories.svelte new file mode 100644 index 000000000000..ccb5835bc860 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMcpPrompts.stories.svelte @@ -0,0 +1,74 @@ + + +{#snippet template(args: ComponentProps)} + +
+ +
+{/snippet} + + seedStores({ mcpPrompts, mcpServers })} name="Default" {template} /> + + seedStores({ mcpPrompts: mcpPrompts.slice(0, 2), mcpServers })} + name="FewPrompts" + {template} +/> + + seedStores({ mcpPrompts, mcpServers })} + name="Filtered" + {template} +/> + + + + seedStores({ mcpPrompts: [], mcpServers })} name="Empty" {template} /> + + seedStores({ mcpPrompts, mcpServers })} + name="ArgumentForm" + play={async ({ userEvent }) => { + await userEvent.click(await screen.findByText('Code review')); + await screen.findByRole('button', { name: 'Use Prompt' }); + }} + {template} +/> diff --git a/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMention.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMention.stories.svelte new file mode 100644 index 000000000000..30ce00ebda74 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/form/ChatFormPickerMention.stories.svelte @@ -0,0 +1,78 @@ + + +{#snippet template(args: ComponentProps)} + +
+ +
+{/snippet} + + + seedStores({ ...searchTools, globSearch: globSearchResult(toGlobEntries(mentionEntries)) })} + name="Default" + {template} +/> + + seedStores({ ...searchTools, globSearch: pendingGlobSearch() })} + name="Loading" + {template} +/> + + seedStores({ ...searchTools, globSearch: globSearchResult([]) })} + name="NoMatch" + {template} +/> + + + seedStores({ + ...searchTools, + globSearch: async () => ({ error: 'path is outside the allowed roots' }) + })} + name="SearchError" + {template} +/> + + seedStores({ serverHome: SERVER_HOME, serverTools: [] })} + name="SearchUnavailable" + {template} +/> diff --git a/ui/apps/chat/tests/stories/a11y/ChatScreenForm.a11y.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatScreenForm.a11y.stories.svelte similarity index 95% rename from ui/apps/chat/tests/stories/a11y/ChatScreenForm.a11y.stories.svelte rename to ui/apps/chat/tests/stories/chat/form/ChatScreenForm.a11y.stories.svelte index 81bc7f1f7fb8..b1058822af45 100644 --- a/ui/apps/chat/tests/stories/a11y/ChatScreenForm.a11y.stories.svelte +++ b/ui/apps/chat/tests/stories/chat/form/ChatScreenForm.a11y.stories.svelte @@ -10,7 +10,7 @@ layout: 'centered' }, tags: ['!dev'], - title: 'Components/ChatScreen/ChatScreenForm/Accessibility' + title: 'Llama Chat/Chat/ChatForm/ChatScreenForm/Accessibility' }); diff --git a/ui/apps/chat/tests/stories/chat/form/ChatScreenForm.stories.svelte b/ui/apps/chat/tests/stories/chat/form/ChatScreenForm.stories.svelte new file mode 100644 index 000000000000..818b9830bcbd --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/form/ChatScreenForm.stories.svelte @@ -0,0 +1,208 @@ + + + { + const editor = await canvas.findByRole('textbox'); + const submitButton = await canvas.findByRole('button', { name: 'Send' }); + + // Expect the input to be focused after the component is mounted + await expect(editor).toHaveFocus(); + + // Expect the submit button to be disabled + await expect(submitButton).toBeDisabled(); + + const text = 'What is the meaning of life?'; + + await userEvent.clear(editor); + await userEvent.type(editor, text); + + await expect(editor).toHaveTextContent(text); + + const fileInput = document.querySelector('input[type="file"]'); + + await expect(fileInput).not.toHaveAttribute('accept'); + }} +/> + + seedStores(modelServer)} + name="WithText" + play={async ({ canvas, userEvent }) => { + const editor = await canvas.findByRole('textbox'); + + await userEvent.type(editor, 'Explain how the KV cache works in llama.cpp'); + }} +/> + + seedStores(modelServer)} + name="WithCodeSpan" + play={async ({ canvas, userEvent }) => { + const editor = await canvas.findByRole('textbox'); + + // the live-preview editor renders a complete code span as it is typed + await userEvent.type(editor, 'Why does `npm run check` fail after `npm install`?'); + }} +/> + + + + + + { + const jpgAttachment = canvas.getByAltText('1.jpg'); + const svgAttachment = canvas.getByAltText('hf-logo.svg'); + + await expect(jpgAttachment).toHaveAttribute('src', jpgAsset); + await expect(svgAttachment).toHaveAttribute('src', svgAsset); + await expect(canvas.getByText('example.pdf')).toBeInTheDocument(); + await expect(canvas.getByText('342.82 KB')).toBeInTheDocument(); + }} +/> + + + + + seedStores({ + config: { autoMicOnEmpty: true }, + serverProps: modelServerProps({ modalities: { audio: true, video: false, vision: true } }), + serverRole: ServerRole.MODEL + })} + name="WithRecordButton" +/> + + seedStores({ ...modelServer, reasoningEffort: ReasoningEffort.HIGH })} + name="WithReasoningEffort" +/> + + + seedStores({ + models: routerModels, + selectedModelId: 'removed-model', + serverProps: modelServerProps({ role: ServerRole.ROUTER }), + serverRole: ServerRole.ROUTER + })} + name="ModelNotAvailable" + play={async ({ canvas, userEvent }) => { + const editor = await canvas.findByRole('textbox'); + + await userEvent.type(editor, 'Hello'); + }} +/> + + seedStores({ mcpResources, mcpServers })} + name="WithMcpResources" +/> + + + seedStores({ + ...modelServer, + pendingCwd: `${SERVER_HOME}/llama.cpp/ui/apps/chat`, + serverHome: SERVER_HOME, + serverTools: cwdServerTools + })} + name="WithWorkingDirectory" +/> + + { + await userEvent.click(await canvas.findByRole('button', { name: ATTACHMENT_TOOLTIP_TEXT })); + await screen.findByRole('menu'); + }} +/> + + + seedStores({ + ...modelServer, + mcpServers, + serverHome: SERVER_HOME, + serverTools: cwdServerTools + })} + name="CommandPickerOpen" + play={async ({ canvas, userEvent }) => { + await userEvent.type(await canvas.findByRole('textbox'), '/'); + await screen.findByText('/prompt'); + }} +/> + + + seedStores({ + ...modelServer, + globSearch: globSearchResult(toGlobEntries(mentionEntries)), + serverHome: SERVER_HOME, + serverTools: cwdServerTools + })} + name="MentionPickerOpen" + play={async ({ canvas, userEvent }) => { + await userEvent.type(await canvas.findByRole('textbox'), 'Look at @chat'); + await screen.findByText('ChatForm.svelte'); + }} +/> diff --git a/ui/apps/chat/tests/stories/chat/form/fixtures.ts b/ui/apps/chat/tests/stories/chat/form/fixtures.ts new file mode 100644 index 000000000000..499c87028246 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/form/fixtures.ts @@ -0,0 +1,463 @@ +import jpgAsset from '../../fixtures/assets/1.jpg?url'; +import pdfAsset from '../../fixtures/assets/example.pdf?inline'; +import svgAsset from '../../fixtures/assets/hf-logo.svg?url'; +import { + BuiltInTool, + ChatFormCommandAction, + FileMentionEntryType, + MessageRole, + MessageType, + MimeTypeText, + ReasoningEffort, + ServerRole, + SpecialFileType, + ToolSource +} from '#lib/enums/index.ts'; +import { ToolsService } from '#lib/services/tools.service.ts'; +import { + conversationsStore, + mcpStore, + modelsStore, + serverStore, + settingsStore, + toolsStore +} from '#lib/stores/index.ts'; +import type { + ChatFormCommand, + DatabaseConversation, + DatabaseMessage, + FileMentionEntry, + GlobEntry, + MCPPromptInfo, + MCPResourceInfo, + MCPServerSettingsEntry, + ServerToolInfo +} from '#lib/types/index.ts'; + +export const FORM_CLASS = 'max-w-[56rem] w-[calc(100vw-2rem)]'; + +export const MODEL_PATH = '/models/Qwen3-8B-Q4_K_M.gguf'; +export const MODEL_NAME = 'Qwen3-8B-Q4_K_M.gguf'; +export const SERVER_HOME = '/home/user'; +export const CONVERSATION_ID = 'story-conversation'; + +export { jpgAsset, svgAsset }; + +export const fileAttachments: ChatUploadedFile[] = [ + { + file: new File([''], '1.jpg', { type: 'image/jpeg' }), + id: '1', + name: '1.jpg', + preview: jpgAsset, + size: 44891, + type: 'image/jpeg' + }, + { + file: new File([''], 'hf-logo.svg', { type: 'image/svg+xml' }), + id: '2', + name: 'hf-logo.svg', + preview: svgAsset, + size: 1234, + type: 'image/svg+xml' + }, + { + // the PDF inlined as a data URL and decoded to its bytes: ?raw read it as UTF-8 text, which mangled the binary + // and left control characters in the built chunk + file: new File( + [Uint8Array.from(atob(pdfAsset.split(',')[1]), (c) => c.charCodeAt(0))], + 'example.pdf', + { type: 'application/pdf' } + ), + id: '3', + name: 'example.pdf', + size: 351048, + type: 'application/pdf' + }, + { + file: new File(['# Notes\n\nShort text file.'], 'notes.md', { type: MimeTypeText.MARKDOWN }), + id: '4', + name: 'notes.md', + size: 26, + textContent: '# Notes\n\nShort text file.', + type: MimeTypeText.MARKDOWN + } +]; + +export const loadingAttachment: ChatUploadedFile = { + file: new File([], 'loading'), + id: 'loading-prompt', + isLoading: true, + mcpPrompt: { promptName: 'code_review', serverName: 'github' }, + name: 'Code review', + size: 0, + type: SpecialFileType.MCP_PROMPT +}; + +export const mcpServers: MCPServerSettingsEntry[] = [ + { enabled: true, id: 'github', name: 'GitHub', url: 'https://api.githubcopilot.com/mcp/' }, + { enabled: true, id: 'docs', name: 'Docs', url: 'https://docs.example.com/mcp' } +]; + +export const mcpPrompts: MCPPromptInfo[] = [ + { + arguments: [ + { description: 'Repository in owner/name form', name: 'repo', required: true }, + { description: 'Pull request number', name: 'pr', required: true }, + { description: 'Focus area, e.g. security', name: 'focus' } + ], + description: 'Review a pull request and list the main issues', + name: 'code_review', + serverName: 'github', + title: 'Code review' + }, + { + description: 'Summarize open issues by label', + name: 'issue_summary', + serverName: 'github', + title: 'Issue summary' + }, + { + arguments: [{ description: 'Topic to explain', name: 'topic', required: true }], + description: 'Explain a topic from the docs', + name: 'explain', + serverName: 'docs', + title: 'Explain' + }, + { + description: 'Write release notes from the changelog', + name: 'release_notes', + serverName: 'docs' + } +]; + +export const mcpResources: MCPResourceInfo[] = [ + { + mimeType: MimeTypeText.MARKDOWN, + name: 'README.md', + serverName: 'github', + uri: 'repo://ggml-org/llama.cpp/README.md' + }, + { + mimeType: MimeTypeText.PLAIN, + name: 'server-api.txt', + serverName: 'docs', + title: 'Server API', + uri: 'docs://server/api' + } +]; + +export const chatCommands: ChatFormCommand[] = [ + { + action: ChatFormCommandAction.PROMPT, + description: 'Insert an MCP prompt', + disabled: false, + name: 'prompt' + }, + { + action: ChatFormCommandAction.CWD, + description: 'Set working directory', + disabled: false, + keywords: ['current working directory'], + name: 'cwd' + }, + { + action: ChatFormCommandAction.MODEL, + description: 'Select model', + disabled: false, + name: 'model' + }, + { + action: ChatFormCommandAction.COMPACT, + description: 'Summarize the conversation to free up context', + disabled: true, + keywords: ['summarize', 'context'], + name: 'compact' + } +]; + +export const mentionEntries: FileMentionEntry[] = [ + { + name: 'src', + path: `${SERVER_HOME}/llama.cpp/ui/apps/chat/src`, + type: FileMentionEntryType.DIRECTORY + }, + { + name: 'ChatForm.svelte', + path: `${SERVER_HOME}/llama.cpp/ui/apps/chat/src/lib/components/app/chat/ChatForm/ChatForm.svelte`, + type: FileMentionEntryType.FILE + }, + { + name: 'chat.d.ts', + path: `${SERVER_HOME}/llama.cpp/ui/apps/chat/src/lib/types/chat.d.ts`, + type: FileMentionEntryType.FILE + } +]; + +export const directoryResults = [ + `${SERVER_HOME}/llama.cpp`, + `${SERVER_HOME}/llama.cpp/tools`, + `${SERVER_HOME}/llama.cpp/ui/apps/chat`, + `${SERVER_HOME}/llama.cpp/tools/server` +]; + +/** Server tools that make the cwd chip and the mention search available. */ +export const cwdServerTools: ServerToolInfo[] = [ + BuiltInTool.SERVER_FILE_GLOB_SEARCH, + BuiltInTool.SERVER_READ_FILE +].map((tool) => ({ + definition: { function: { name: tool, parameters: {} }, type: 'function' }, + display_name: tool, + permissions: { write: false }, + tool, + type: ToolSource.SERVER, + uses_cwd: true +})); + +export function modelServerProps( + overrides: Partial = {} +): ApiLlamaCppServerProps { + return { + default_generation_settings: { n_ctx: 32768 }, + modalities: { audio: false, video: false, vision: true }, + model_path: MODEL_PATH, + ...overrides + } as unknown as ApiLlamaCppServerProps; +} + +export const routerModels: ModelOption[] = [ + { capabilities: [], id: 'qwen3-8b', model: 'Qwen/Qwen3-8B-GGUF', name: 'Qwen3-8B' }, + { capabilities: [], id: 'gemma-3-4b', model: 'google/gemma-3-4b-it-GGUF', name: 'gemma-3-4b-it' } +]; + +export const conversation: DatabaseConversation = { + currNode: 'a2', + id: CONVERSATION_ID, + lastModified: Date.now(), + name: 'Story conversation' +}; + +/** A short user/assistant exchange whose last turn used `promptTokens` of context. */ +export function conversationMessages(promptTokens: number, outputTokens = 512): DatabaseMessage[] { + const base = { + children: [], + convId: CONVERSATION_ID, + timestamp: Date.now(), + type: MessageType.TEXT + }; + + return [ + { ...base, content: 'Explain the KV cache.', id: 'u1', parent: null, role: MessageRole.USER }, + { + ...base, + content: 'The KV cache stores keys and values of past tokens.', + id: 'a1', + model: MODEL_NAME, + parent: 'u1', + role: MessageRole.ASSISTANT, + timings: { predicted_ms: 4200, predicted_n: 380, prompt_ms: 120, prompt_n: 240 } + }, + { ...base, content: 'And how big can it get?', id: 'u2', parent: 'a1', role: MessageRole.USER }, + { + ...base, + content: 'It grows with the context length.', + id: 'a2', + model: MODEL_NAME, + parent: 'u2', + role: MessageRole.ASSISTANT, + timings: { + cache_n: 620, + predicted_ms: outputTokens * 11, + predicted_n: outputTokens, + prompt_ms: 300, + prompt_n: promptTokens - 620 + } + } + ] as DatabaseMessage[]; +} + +/** Store state a story needs; every field left out keeps the current value. */ +export interface StoreSeed { + activeConversation?: DatabaseConversation | null; + activeMessages?: DatabaseMessage[]; + config?: Record; + globSearch?: (params: Record) => Promise>; + mcpPrompts?: MCPPromptInfo[]; + mcpResources?: MCPResourceInfo[]; + mcpServers?: MCPServerSettingsEntry[]; + modelProps?: Record; + models?: ModelOption[]; + pendingCwd?: string | null; + reasoningEffort?: ReasoningEffort; + routerModels?: ApiModelDataEntry[]; + selectedModelId?: string | null; + selectedModelName?: string | null; + serverHome?: string | null; + serverProps?: ApiLlamaCppServerProps | null; + serverRole?: ServerRole | null; + serverTools?: ServerToolInfo[]; +} + +interface ToolsStoreInternals { + _serverHome: string | null | undefined; + _serverTools: ServerToolInfo['definition'][]; + cwdAwareTools: Set; +} + +interface PropsCache { + cache: { delete(key: string): boolean; set(key: string, value: ApiLlamaCppServerProps): void }; + cacheVersion: number; +} + +type Restore = () => void; + +/** Override an object member; the restore puts back the original. */ +export function override( + target: T, + key: K, + value: T[K] +): Restore { + const hadOwn = Object.prototype.hasOwnProperty.call(target, key); + const previous = target[key]; + + Object.defineProperty(target, key, { configurable: true, value, writable: true }); + + return () => { + if (hadOwn) target[key] = previous; + else delete target[key]; + }; +} + +/** + * Seed the global stores for one story. Nothing is persisted. Return the + * result from `beforeEach` so Storybook restores the stores afterwards. + */ +export function seedStores(seed: StoreSeed): Restore { + const restores: Restore[] = []; + const tools = toolsStore as unknown as ToolsStoreInternals; + const props = modelsStore.props as unknown as PropsCache; + const set = (target: T, key: K, value: T[K]) => { + const previous = target[key]; + + target[key] = value; + restores.push(() => (target[key] = previous)); + }; + + if (seed.serverRole !== undefined) set(serverStore, 'role', seed.serverRole); + + if (seed.serverProps !== undefined) set(serverStore, 'props', seed.serverProps); + + if (seed.models) set(modelsStore, 'models', seed.models); + + if (seed.routerModels) set(modelsStore, 'routerModels', seed.routerModels); + + if (seed.selectedModelId !== undefined) set(modelsStore, 'selectedModelId', seed.selectedModelId); + + if (seed.selectedModelName !== undefined) + set(modelsStore, 'selectedModelName', seed.selectedModelName); + + if (seed.config || seed.mcpServers) { + set(settingsStore, 'config', { + ...settingsStore.config, + ...seed.config, + ...(seed.mcpServers ? { mcpServers: JSON.stringify(seed.mcpServers) } : {}) + }); + } + + if (seed.reasoningEffort !== undefined) + set(conversationsStore.preferences, 'pendingReasoningEffort', seed.reasoningEffort); + + if (seed.pendingCwd !== undefined) + set(conversationsStore.preferences, 'pendingCwd', seed.pendingCwd); + + if (seed.activeConversation !== undefined) + set(conversationsStore, 'activeConversation', seed.activeConversation); + + if (seed.activeMessages) set(conversationsStore, 'activeMessages', seed.activeMessages); + + if (seed.serverTools) { + set( + tools, + '_serverTools', + seed.serverTools.map((t) => t.definition) + ); + set( + tools, + 'cwdAwareTools', + new Set(seed.serverTools.filter((t) => t.uses_cwd).map((t) => t.tool)) + ); + } + + if (seed.serverHome !== undefined) set(tools, '_serverHome', seed.serverHome); + + if (seed.modelProps) { + for (const [id, value] of Object.entries(seed.modelProps)) { + props.cache.set(id, value); + restores.push(() => props.cache.delete(id)); + } + + props.cacheVersion++; + } + + if (seed.globSearch) { + const globSearch = seed.globSearch; + + restores.push( + override(ToolsService, 'executeToolRaw', async (toolName, params) => { + if (toolName !== BuiltInTool.SERVER_FILE_GLOB_SEARCH) return {}; + + return globSearch(params); + }) + ); + } + + if (seed.mcpPrompts) { + const prompts = seed.mcpPrompts; + + restores.push(override(mcpStore, 'ensureInitialized', async () => true)); + restores.push(override(mcpStore, 'getAllPrompts', async () => prompts)); + } + + if (seed.mcpResources) { + for (const resource of seed.mcpResources) { + const attachment = mcpStore.resources.addAttachment(resource); + + mcpStore.resources.updateAttachmentContent(attachment.id, [ + { mimeType: resource.mimeType, text: `Content of ${resource.name}`, uri: resource.uri } + ]); + } + + restores.push(() => mcpStore.resources.clearAttachments()); + } + + return () => { + for (const restore of restores.reverse()) restore(); + }; +} + +/** A `file_glob_search` stand-in that returns `paths` relative to the server home. */ +export function globSearchResult(entries: GlobEntry[], delayMs = 0) { + return async () => { + if (delayMs > 0) await new Promise((resolve) => setTimeout(resolve, delayMs)); + + return { base: SERVER_HOME, entries }; + }; +} + +/** Never resolves: keeps a picker in its loading state. */ +export function pendingGlobSearch() { + return () => new Promise>(() => {}); +} + +export function toGlobEntries(paths: { path: string; type: FileMentionEntryType }[]): GlobEntry[] { + return paths.map(({ path, type }) => ({ + path: path.replace(`${SERVER_HOME}/`, ''), + type: type === FileMentionEntryType.DIRECTORY ? 'dir' : 'file' + })); +} + +export { ReasoningEffort, ServerRole }; + +/** An open menu that unmounts leaves `pointer-events: none` on the body; clear it. */ +export function resetPointerEvents() { + document.body.style.pointerEvents = ''; +} diff --git a/ui/apps/chat/tests/stories/chat/messages/ActionIconsStoryHost.svelte b/ui/apps/chat/tests/stories/chat/messages/ActionIconsStoryHost.svelte new file mode 100644 index 000000000000..8715b6940d7a --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/messages/ActionIconsStoryHost.svelte @@ -0,0 +1,90 @@ + + + (rawOutputEnabled = enabled)} + {onRegenerate} + {rawOutputEnabled} + {showRawOutputSwitch} +/> diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessage.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessage.stories.svelte new file mode 100644 index 000000000000..aaf5f3d6e17f --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessage.stories.svelte @@ -0,0 +1,275 @@ + + + seedChatStory()} name="Default" /> + + seedChatStory()} name="User" /> + + seedChatStory()} + name="UserMarkdown" +/> + + seedChatStory({ settings: { renderUserContentAsMarkdown: false } })} + name="UserPlainText" +/> + + seedChatStory()} + name="UserWithAttachments" +/> + + seedChatStory()} + name="UserAttachmentsOnly" +/> + + seedChatStory()} + name="UserWithReadingStats" +/> + + seedChatStory({ loading: true, processing: promptProcessingState })} + name="UserReadingLive" +/> + + seedChatStory()} name="System" /> + + seedChatStory()} name="SystemLong" /> + + seedChatStory({ settings: { enableContinueGeneration: true } })} + name="AssistantWithContinue" +/> + + seedChatStory()} + name="AssistantWithReasoning" +/> + + seedChatStory()} + name="AssistantReasoningCancelled" +/> + + seedChatStory({ loading: true, streamingMessageId: streamingMessage.id })} + name="AssistantReasoningStreaming" + play={async () => { + streamingMessage.timestamp = 0; + streamingMessage.content = ''; + streamingMessage.reasoningContent = ''; + + await streamInto('reasoningContent', REASONING_TEXT); + await streamInto('content', STREAM_ANSWER); + + chatStore.chatStreamingStates.delete(CONV_ID); + chatActivityStore.localEnded(CONV_ID); + streamingMessage.timestamp = Date.now(); + }} +> + + + + seedChatStory({ loading: true, processing: promptProcessingState })} + name="AssistantProcessing" +/> + + + seedChatStory({ + loading: true, + processing: generatingProcessingState, + streamingMessageId: 'assistant-generating' + })} + name="AssistantGenerating" +/> + + seedChatStory()} + name="AssistantWithToolCalls" +/> + + seedChatStory({ settings: { showAgenticTurnStats: true } })} + name="AssistantAgenticMultiTurn" +/> + + seedChatStory()} + name="AssistantWithStatistics" +/> + + seedChatStory({ settings: { showRawOutputSwitch: true } })} + name="RawOutput" + play={async ({ canvas, userEvent }) => { + await userEvent.click(await canvas.findByRole('switch')); + }} +/> + + seedChatStory()} + name="WithBranching" +/> + + + seedChatStory({ activeMessages: [preCompactionAssistantMessage, compactionMessage] })} + name="Compaction" +/> + + + seedChatStory({ + compactingNodeId: compactionPendingMessage.id, + loading: true, + processing: promptProcessingState + })} + name="CompactionPrefill" +/> + + + seedChatStory({ + compactingNodeId: compactionGeneratingMessage.id, + loading: true, + processing: generatingProcessingState + })} + name="CompactionGenerating" +/> + + seedChatStory()} name="CwdChange" /> + + seedChatStory()} name="CwdCleared" /> + + seedChatStory()} name="McpPrompt" /> + + seedChatStory({ pendingEditMessageId: userWithAttachmentsMessage.id })} + name="EditUser" +/> + + seedChatStory({ pendingEditMessageId: assistantWithReasoningMessage.id })} + name="EditAssistant" +/> + + seedChatStory({ pendingEditMessageId: systemMessage.id })} + name="EditSystem" +/> diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionCard.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionCard.stories.svelte new file mode 100644 index 000000000000..a834943e11e7 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionCard.stories.svelte @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionIcons.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionIcons.stories.svelte new file mode 100644 index 000000000000..958dcad912d3 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageActionIcons.stories.svelte @@ -0,0 +1,78 @@ + + + + + + {}} + {onRegenerate} + /> + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageReasoningBlock.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageReasoningBlock.stories.svelte new file mode 100644 index 000000000000..de7b1ec14f56 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageReasoningBlock.stories.svelte @@ -0,0 +1,60 @@ + + + seedChatStory()} name="States"> + + + + + + + + + + + + + + + + + + + + + + + + + seedChatStory({ settings: { renderThinkingAsMarkdown: false } })} + name="ExpandedPlainText" +/> diff --git a/ui/apps/chat/tests/stories/a11y/ChatMessageStatistics.a11y.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.a11y.stories.svelte similarity index 94% rename from ui/apps/chat/tests/stories/a11y/ChatMessageStatistics.a11y.stories.svelte rename to ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.a11y.stories.svelte index 8fdf46b4009c..7e7df3885538 100644 --- a/ui/apps/chat/tests/stories/a11y/ChatMessageStatistics.a11y.stories.svelte +++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.a11y.stories.svelte @@ -9,7 +9,7 @@ layout: 'centered' }, tags: ['!dev'], - title: 'Components/ChatMessageStatistics/Accessibility' + title: 'Llama Chat/Chat/ChatMessages/ChatMessageStatistics/Accessibility' }); diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.stories.svelte new file mode 100644 index 000000000000..b511a313826f --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageStatistics.stories.svelte @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageToolCallBlock.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageToolCallBlock.stories.svelte new file mode 100644 index 000000000000..ed10308957fd --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageToolCallBlock.stories.svelte @@ -0,0 +1,156 @@ + + + seedChatStory()} name="States"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/chat/messages/ChatMessageUserPending.stories.svelte b/ui/apps/chat/tests/stories/chat/messages/ChatMessageUserPending.stories.svelte new file mode 100644 index 000000000000..cdb32f16dba8 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/messages/ChatMessageUserPending.stories.svelte @@ -0,0 +1,34 @@ + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/chat/messages/fixtures.ts b/ui/apps/chat/tests/stories/chat/messages/fixtures.ts new file mode 100644 index 000000000000..41aae1b3d582 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/messages/fixtures.ts @@ -0,0 +1,728 @@ +import { + AgenticSectionType, + AttachmentType, + BuiltInTool, + MessageRole, + MessageType +} from '#lib/enums/index.ts'; +import { chatActivityStore } from '#lib/stores/chat/activity.svelte.ts'; +import { chatStore, conversationsStore, settingsStore } from '#lib/stores/index.ts'; +import type { + AgenticSection, + ApiChatCompletionToolCall, + ApiProcessingState, + ChatMessageActions, + ChatMessageAgenticTimings, + ChatMessageSiblingInfo, + DatabaseMessage, + DatabaseMessageExtra, + SettingsConfigValue +} from '#lib/types/index.ts'; + +export const CONV_ID = 'conv-1'; +export const MODEL_NAME = 'ggml-org/gpt-oss-20b-GGUF'; +export const STORY_CLASS = 'max-w-[56rem] w-[calc(100vw-2rem)]'; + +const NOW = Date.now(); + +export const noopChatActions: ChatMessageActions = { + continueAssistantMessage: () => {}, + copy: () => {}, + delete: () => {}, + editUserMessagePreserveResponses: () => {}, + editWithBranching: () => {}, + editWithReplacement: () => {}, + forkConversation: () => {}, + navigateToSibling: () => {}, + regenerateCompaction: () => {}, + regenerateWithBranching: () => {} +}; + +function createMessage( + fields: Pick & Partial +): DatabaseMessage { + return { + children: [], + convId: CONV_ID, + parent: null, + timestamp: NOW - 1000 * 60, + type: MessageType.TEXT, + ...fields + }; +} + +function toolCallsJson(calls: { id: string; name: string; args: unknown }[]): string { + const toolCalls: ApiChatCompletionToolCall[] = calls.map((call) => ({ + function: { arguments: JSON.stringify(call.args), name: call.name }, + id: call.id, + type: 'function' + })); + + return JSON.stringify(toolCalls); +} + +// Small inline images so the stories need no binary assets. +const SVG_IMAGE_URL = `data:image/svg+xml;base64,${btoa( + '' +)}`; +const CHART_IMAGE_URL = `data:image/svg+xml;base64,${btoa( + '' +)}`; + +/* User messages */ + +export const userMessage = createMessage({ + content: 'What is the meaning of life, the universe, and everything?', + id: 'user-1', + role: MessageRole.USER +}); + +export const userMarkdownMessage = createMessage({ + content: + 'Can you review this function?\n\n```ts\nexport function sum(values: number[]): number {\n\treturn values.reduce((acc, v) => acc + v, 0);\n}\n```\n\n- Is it safe for empty arrays?\n- Should it accept `bigint`?', + id: 'user-markdown', + role: MessageRole.USER +}); + +export const userAttachments: DatabaseMessageExtra[] = [ + { + base64Url: SVG_IMAGE_URL, + name: 'sunset.svg', + size: 412, + type: AttachmentType.IMAGE + }, + { + content: 'id,name,score\n1,Ada,98\n2,Linus,91\n3,Grace,95\n', + name: 'scores.csv', + size: 46, + type: AttachmentType.TEXT + }, + { + base64Data: btoa('%PDF-1.4\n%mock\n'), + content: 'Quarterly report. Revenue grew 12 percent quarter over quarter.', + name: 'report.pdf', + processedAsImages: false, + size: 18_432, + type: AttachmentType.PDF + } +]; + +export const userWithAttachmentsMessage = createMessage({ + content: 'Summarize the attached files and describe the image.', + extra: userAttachments, + id: 'user-attachments', + role: MessageRole.USER +}); + +export const userAttachmentsOnlyMessage = createMessage({ + content: '', + extra: [userAttachments[0]], + id: 'user-attachments-only', + role: MessageRole.USER +}); + +/* System messages */ + +export const systemMessage = createMessage({ + content: 'You are a helpful assistant. Answer briefly and use **markdown** when it helps.', + id: 'system-1', + role: MessageRole.SYSTEM, + type: MessageType.SYSTEM +}); + +export const systemLongMessage = createMessage({ + content: [ + 'You are a senior software engineer helping with the llama.cpp web UI.', + '', + '## Rules', + '', + '1. Read the relevant files before you answer.', + '2. Keep answers short and concrete.', + '3. Prefer existing helpers over new abstractions.', + '4. Use ASCII only in code comments.', + '5. Never invent API fields; read the types first.', + '6. Point to file paths when you mention code.', + '', + '## Style', + '', + '- Use simple words.', + '- Avoid long comments.', + '- Show code only when it is needed.' + ].join('\n'), + id: 'system-long', + role: MessageRole.SYSTEM, + type: MessageType.SYSTEM +}); + +/* Assistant messages */ + +export const assistantMessage = createMessage({ + content: + 'The answer to the ultimate question of life, the universe, and everything is **42**.\n\nThis comes from Douglas Adams\' "The Hitchhiker\'s Guide to the Galaxy," where a supercomputer named Deep Thought calculated this answer over 7.5 million years. However, the question itself was never properly formulated, which is why the answer seems meaningless without context.', + id: 'assistant-1', + parent: 'user-1', + role: MessageRole.ASSISTANT +}); + +export const REASONING_TEXT = + "Let's consider the question step by step:\n\n1. Identify the core problem\n2. Evaluate relevant information\n3. Formulate a clear answer\n\nFollowing this process keeps the final response focused and accurate."; + +export const assistantWithReasoningMessage = createMessage({ + content: "Here's the concise answer, now that I've thought it through: **42**.", + id: 'assistant-reasoning', + parent: 'user-1', + reasoningContent: REASONING_TEXT, + role: MessageRole.ASSISTANT +}); + +// Reasoning with no answer after it, on a finished turn: the block shows "Cancelled". +export const assistantInterruptedReasoningMessage = createMessage({ + content: '', + id: 'assistant-reasoning-interrupted', + parent: 'user-1', + reasoningContent: 'The user asks about the meaning of life. I should first check which', + role: MessageRole.ASSISTANT +}); + +export const assistantWithStatsMessage = createMessage({ + content: assistantMessage.content, + id: 'assistant-stats', + model: MODEL_NAME, + parent: 'user-1', + role: MessageRole.ASSISTANT, + timings: { + cache_n: 128, + predicted_ms: 3120, + predicted_n: 164, + prompt_ms: 412, + prompt_n: 1830 + } +}); + +export const rawOutputMessage = createMessage({ + content: 'Hello there! How can I help you today?', + id: 'assistant-raw', + parent: 'user-1', + reasoningContent: + 'User greeted me. Is this a trap? No, just a normal hello. Respond calmly and do not start explaining quantum physics again.', + role: MessageRole.ASSISTANT +}); + +/* Agentic (tool calls) */ + +export const agenticTimings: ChatMessageAgenticTimings = { + llm: { predicted_ms: 5400, predicted_n: 312, prompt_ms: 980, prompt_n: 4210 }, + perTurn: [ + { + llm: { predicted_ms: 1800, predicted_n: 96, prompt_ms: 610, prompt_n: 2400 }, + toolCalls: [ + { duration_ms: 42, name: BuiltInTool.SERVER_GET_INFO, success: true }, + { duration_ms: 318, name: BuiltInTool.SERVER_EXEC_SHELL_COMMAND, success: true } + ], + toolsMs: 360, + turn: 1 + }, + { + llm: { predicted_ms: 3600, predicted_n: 216, prompt_ms: 370, prompt_n: 1810 }, + toolCalls: [], + toolsMs: 0, + turn: 2 + } + ], + toolCalls: [ + { duration_ms: 42, name: BuiltInTool.SERVER_GET_INFO, success: true }, + { duration_ms: 318, name: BuiltInTool.SERVER_EXEC_SHELL_COMMAND, success: true } + ], + toolCallsCount: 2, + toolsMs: 360, + turns: 2 +}; + +export const assistantWithToolCallsMessage = createMessage({ + content: 'Let me check the environment first.', + id: 'assistant-tools', + parent: 'user-1', + reasoningContent: 'I need the working directory and the file list before I answer.', + role: MessageRole.ASSISTANT, + toolCalls: toolCallsJson([ + { args: {}, id: 'call-info', name: BuiltInTool.SERVER_GET_INFO }, + { args: { command: 'ls -la' }, id: 'call-ls', name: BuiltInTool.SERVER_EXEC_SHELL_COMMAND } + ]) +}); + +export const toolResultMessages: DatabaseMessage[] = [ + createMessage({ + content: JSON.stringify({ cwd: '/home/user/projects/llama.cpp', os: 'linux' }), + id: 'tool-info', + parent: 'assistant-tools', + role: MessageRole.TOOL, + toolCallId: 'call-info' + }), + createMessage({ + content: + 'total 24\ndrwxr-xr-x 6 user user 4096 Oct 28 10:12 .\ndrwxr-xr-x 12 user user 4096 Oct 27 09:01 ..\n-rw-r--r-- 1 user user 1067 Oct 20 14:33 LICENSE\n-rw-r--r-- 1 user user 2311 Oct 28 10:12 README.md\ndrwxr-xr-x 4 user user 4096 Oct 28 10:10 src\ndrwxr-xr-x 3 user user 4096 Oct 26 18:40 tools\n[exit code: 0]', + id: 'tool-ls', + parent: 'tool-info', + role: MessageRole.TOOL, + toolCallId: 'call-ls', + toolCwd: '/home/user/projects/llama.cpp' + }) +]; + +// Continuation turn after the tool results; it closes the agentic session. +export const agenticFinalTurnMessage = createMessage({ + content: + 'The project root holds `README.md`, `LICENSE` and two folders: `src` and `tools`. The shell runs on Linux in `~/projects/llama.cpp`.', + id: 'assistant-tools-final', + parent: 'tool-ls', + role: MessageRole.ASSISTANT +}); + +export const agenticToolMessages: DatabaseMessage[] = [ + ...toolResultMessages, + agenticFinalTurnMessage +]; + +export const assistantAgenticWithStatsMessage: DatabaseMessage = { + ...assistantWithToolCallsMessage, + id: 'assistant-tools-stats', + model: MODEL_NAME, + timings: { + agentic: agenticTimings, + predicted_ms: 1800, + predicted_n: 96, + prompt_ms: 610, + prompt_n: 2400 + } +}; + +/* Compaction */ + +export const preCompactionAssistantMessage = createMessage({ + content: 'Deep Thought took 7.5 million years to answer.', + id: 'assistant-pre-compaction', + parent: 'user-1', + role: MessageRole.ASSISTANT, + timestamp: NOW - 1000 * 60 * 31, + timings: { cache_n: 0, predicted_n: 118, prompt_n: 42200 } +}); + +export const compactionMessage = createMessage({ + content: + 'The user asked about the ultimate answer and its origin. Key facts: the answer is **42**, from Douglas Adams\' "The Hitchhiker\'s Guide to the Galaxy", computed by Deep Thought over 7.5 million years.\n\nNothing is left to do unless the user wants the question itself discussed.', + id: 'compaction-1', + model: MODEL_NAME, + parent: 'assistant-pre-compaction', + role: MessageRole.USER, + timestamp: NOW - 1000 * 60 * 30, + // The pre-encode stamps the reduced prompt; `compaction` keeps the summary request timings. + timings: { + cache_n: 0, + compaction: { + cache_n: 0, + predicted_ms: 12000, + predicted_n: 300, + prompt_ms: 18200, + prompt_n: 42200 + }, + predicted_n: 0, + prompt_n: 3204 + }, + type: MessageType.COMPACTION +}); + +export const compactionPendingMessage = createMessage({ + content: '', + id: 'compaction-pending', + parent: 'assistant-pre-compaction', + role: MessageRole.USER, + type: MessageType.COMPACTION +}); + +export const compactionGeneratingMessage = createMessage({ + content: + 'The user asked about the ultimate answer and its origin. Key facts: the answer is **42**', + id: 'compaction-generating', + model: MODEL_NAME, + parent: 'assistant-pre-compaction', + role: MessageRole.USER, + type: MessageType.COMPACTION +}); + +/* Synthetic and MCP prompt */ + +export const cwdChangeMessage = createMessage({ + content: 'Set working directory to [file:///home/user/projects/llama.cpp](~/projects/llama.cpp)', + id: 'cwd-change', + isSynthetic: true, + role: MessageRole.USER +}); + +export const cwdClearedMessage = createMessage({ + content: 'Working directory cleared', + id: 'cwd-cleared', + isSynthetic: true, + role: MessageRole.USER +}); + +export const mcpPromptMessage = createMessage({ + content: '', + extra: [ + { + arguments: { language: 'TypeScript', path: 'src/lib/utils/agentic.ts' }, + content: + 'Review the TypeScript file at src/lib/utils/agentic.ts. Point out bugs first, then style issues.', + name: 'code_review', + promptName: 'code_review', + serverName: 'github', + type: AttachmentType.MCP_PROMPT + } + ], + id: 'mcp-prompt', + role: MessageRole.USER +}); + +/* Branching */ + +export const siblingInfo: ChatMessageSiblingInfo = { + currentIndex: 1, + message: assistantMessage, + siblingIds: ['assistant-0', assistantMessage.id, 'assistant-2'], + totalSiblings: 3 +}; + +/* Tool call sections, as deriveAgenticSections builds them */ + +function toolSection( + toolName: string, + args: unknown, + toolResult?: string, + type: AgenticSectionType = AgenticSectionType.TOOL_CALL +): AgenticSection { + return { + content: toolResult ?? '', + toolArgs: typeof args === 'string' ? args : JSON.stringify(args), + toolCallId: `call-${toolName}`, + toolName, + toolResult, + type + }; +} + +export const defaultToolSection = toolSection( + 'get_weather', + { city: 'Warsaw', units: 'metric' }, + JSON.stringify({ city: 'Warsaw', condition: 'cloudy', humidity: 71, temperature: 9 }) +); + +export const defaultToolPendingSection = toolSection( + 'get_weather', + { city: 'Warsaw', units: 'metric' }, + undefined, + AgenticSectionType.TOOL_CALL_PENDING +); + +export const defaultToolStreamingSection = toolSection( + 'get_weather', + '{"city": "Wars', + undefined, + AgenticSectionType.TOOL_CALL_STREAMING +); + +export const defaultToolMarkdownSection = toolSection( + 'summarize_issue', + { issue: 31273 }, + '## Issue 31273\n\n**Status:** open\n\nThe reasoning menu should list the effort levels the chat template supports.' +); + +export const getDatetimeSection = toolSection( + BuiltInTool.BROWSER_GET_DATETIME, + {}, + JSON.stringify({ result: 'Wednesday, October 28, 2026, 10:15:00 CET' }) +); + +export const getInfoSection = toolSection( + BuiltInTool.SERVER_GET_INFO, + {}, + JSON.stringify({ cwd: '/home/user/projects/llama.cpp', os: 'linux' }) +); + +export const readFileSection = toolSection( + BuiltInTool.SERVER_READ_FILE, + { end_line: 9, path: 'src/lib/utils/sum.ts', start_line: 1 }, + 'export function sum(values: number[]): number {\n\treturn values.reduce((acc, v) => acc + v, 0);\n}\n\nexport function mean(values: number[]): number {\n\tif (values.length === 0) return 0;\n\n\treturn sum(values) / values.length;\n}' +); + +export const editFileSection = toolSection( + BuiltInTool.SERVER_EDIT_FILE, + { + edits: [ + { + new_text: '\tif (values.length === 0) return Number.NaN;', + old_text: '\tif (values.length === 0) return 0;' + } + ], + path: 'src/lib/utils/sum.ts' + }, + JSON.stringify({ edits_applied: 1, result: 'File edited' }) +); + +export const editFileErrorSection = toolSection( + BuiltInTool.SERVER_EDIT_FILE, + { + edits: [{ new_text: 'const b = 2;', old_text: 'const a = 1;' }], + path: 'src/lib/utils/sum.ts' + }, + JSON.stringify({ error: 'old_text not found in file' }) +); + +export const writeFileSection = toolSection( + BuiltInTool.SERVER_WRITE_FILE, + { + content: '# Notes\n\n- Sum is safe for empty arrays.\n- Mean returns NaN for empty input.\n', + path: 'docs/notes.md' + }, + JSON.stringify({ bytes: 79, result: 'File written' }) +); + +export const execShellSection: AgenticSection = { + ...toolSection( + BuiltInTool.SERVER_EXEC_SHELL_COMMAND, + { command: 'npm test -- --run' }, + ' RUN v4.1.12 /home/user/projects/app\n\n src/sum.test.ts (3 tests) 4ms\n src/mean.test.ts (2 tests) 3ms\n\n Test Files 2 passed (2)\n Tests 5 passed (5)\n[exit code: 0]' + ), + toolCwd: '/home/user/projects/app' +}; + +export const execShellFailedSection: AgenticSection = { + ...toolSection( + BuiltInTool.SERVER_EXEC_SHELL_COMMAND, + { command: 'cat missing.txt' }, + 'cat: missing.txt: No such file or directory\n[exit code: 1]' + ), + toolCwd: '/home/user/projects/app' +}; + +export const execShellTimedOutSection: AgenticSection = { + ...toolSection( + BuiltInTool.SERVER_EXEC_SHELL_COMMAND, + { command: 'sleep 600' }, + '[exit code: -1] [exit due to timed out]' + ), + toolCwd: '/home/user/projects/app' +}; + +export const execShellPendingSection: AgenticSection = toolSection( + BuiltInTool.SERVER_EXEC_SHELL_COMMAND, + { command: 'npm run build' }, + undefined, + AgenticSectionType.TOOL_CALL_PENDING +); + +export const fileGlobSearchSection = toolSection( + BuiltInTool.SERVER_FILE_GLOB_SEARCH, + { exclude: '**/node_modules/**', include: '**/*.svelte', path: 'src/lib/components' }, + JSON.stringify({ + plain_text_response: + 'src/lib/components/app/chat/ChatMessages/ChatMessage/ChatMessage.svelte\nsrc/lib/components/app/chat/ChatMessages/ChatMessageReasoningBlock.svelte\nsrc/lib/components/app/chat/ChatMessages/ChatMessageEditForm.svelte\n---\nTotal matches: 3' + }) +); + +export const grepSearchSection = toolSection( + BuiltInTool.SERVER_GREP_SEARCH, + { + include: '**/*.ts', + path: 'src/lib', + pattern: 'deriveAgenticSections', + return_line_numbers: true + }, + JSON.stringify({ + plain_text_response: + 'src/lib/utils/agentic.ts:209:export function deriveAgenticSections(\nsrc/lib/utils/index.ts:88:\tderiveAgenticSections,\n---\nTotal matches: 2' + }) +); + +export const runJavascriptSection = toolSection( + BuiltInTool.BROWSER_RUN_JAVASCRIPT, + { + code: 'const values = [3, 1, 2];\nconsole.log(values.sort());\nreturn values.length;', + timeout_ms: 5000 + }, + '[1,2,3]\n3' +); + +export const runJavascriptErrorSection = toolSection( + BuiltInTool.BROWSER_RUN_JAVASCRIPT, + { code: 'undefinedFunction();' }, + JSON.stringify({ error: 'ReferenceError: undefinedFunction is not defined' }) +); + +export const readMediaSection: AgenticSection = { + ...toolSection( + BuiltInTool.BROWSER_READ_MEDIA, + { path: '/home/user/charts/usage.svg' }, + 'File: /home/user/charts/usage.svg\nSize: 512 bytes\nMIME: image/svg+xml\n[Attachment saved: mcp-attachment-usage.svg]' + ), + toolResultExtras: [ + { + base64Url: CHART_IMAGE_URL, + name: 'mcp-attachment-usage.svg', + type: AttachmentType.IMAGE + } + ] +}; + +export const searchResultsSection = toolSection( + 'web_search_exa', + { query: 'llama.cpp speculative decoding' }, + [ + 'Title: Speculative decoding in llama.cpp', + 'URL: https://github.com/ggml-org/llama.cpp/tree/master/examples/speculative', + 'Published: 2025-03-14', + 'Author: N/A', + 'Highlights:', + 'Use a small draft model to propose tokens that the main model verifies in one batch.', + '---', + 'Title: llama-server README', + 'URL: https://github.com/ggml-org/llama.cpp/blob/master/tools/server/README.md', + 'Published: N/A', + 'Author: ggml-org', + 'Highlights:', + 'The server accepts --model-draft to enable speculative decoding.' + ].join('\n') +); + +/* Reasoning sections */ + +export const reasoningSection: AgenticSection = { + content: REASONING_TEXT, + type: AgenticSectionType.REASONING +}; + +export const reasoningPendingSection: AgenticSection = { + content: REASONING_TEXT, + type: AgenticSectionType.REASONING_PENDING +}; + +export const reasoningInterruptedSection: AgenticSection = { + content: 'The user asks about the meaning of life. I should first check which', + type: AgenticSectionType.REASONING, + wasInterrupted: true +}; + +/* Store seeding */ + +export const promptProcessingState: ApiProcessingState = { + contextTotal: 32768, + contextUsed: 10000, + hasNextToken: false, + outputTokensMax: -1, + outputTokensUsed: 0, + progressPercent: 42, + promptProgress: { cache: 0, processed: 4200, time_ms: 6000, total: 10000 }, + promptTokens: 0, + speculative: false, + status: 'preparing', + temperature: 0.8, + tokensDecoded: 0, + tokensPerSecond: 0, + tokensRemaining: -1, + topP: 0.95 +}; + +export const generatingProcessingState: ApiProcessingState = { + contextTotal: 32768, + contextUsed: 45200, + hasNextToken: true, + outputTokensMax: -1, + outputTokensUsed: 128, + promptTokens: 42200, + speculative: false, + status: 'generating', + temperature: 0.8, + tokensDecoded: 128, + tokensPerSecond: 25, + tokensRemaining: -1, + topP: 0.95 +}; + +export interface ChatStorySeed { + settings?: Record; + /** Branch the compaction toggle reads its "before" size from. */ + activeMessages?: DatabaseMessage[]; + /** Marks the conversation as having a local pipe (chatStore.isLoading). */ + loading?: boolean; + /** Message id of a live stream (chatStore.isStreaming()). */ + streamingMessageId?: string; + processing?: ApiProcessingState; + compactingNodeId?: string; + /** Opens the edit form of this message on mount. */ + pendingEditMessageId?: string; +} + +// Pinned so stories look the same whatever the viewer has in localStorage. +const STORY_SETTINGS_DEFAULTS: Record = { + enableContinueGeneration: false, + renderThinkingAsMarkdown: true, + renderUserContentAsMarkdown: true, + showAgenticTurnStats: false, + showMessageStats: true, + showRawOutputSwitch: false +}; + +/** + * Seed the global stores a chat message reads. Use as a story `beforeEach`: + * it runs before render and the returned cleanup resets the stores, so state + * does not leak into the next story. + */ +export function seedChatStory(seed: ChatStorySeed = {}): () => void { + const settings = { ...STORY_SETTINGS_DEFAULTS, ...seed.settings }; + const previousSettings = Object.fromEntries( + Object.keys(settings).map((key) => [key, settingsStore.config[key]]) + ); + + for (const [key, value] of Object.entries(settings)) { + settingsStore.updateConfig(key, value); + } + + conversationsStore.activeConversation = { + currNode: null, + id: CONV_ID, + lastModified: NOW, + name: 'Storybook conversation' + }; + conversationsStore.activeMessages = seed.activeMessages ?? []; + + if (seed.loading) chatActivityStore.markLocal(CONV_ID); + + if (seed.streamingMessageId) { + chatStore.chatStreamingStates.set(CONV_ID, { + messageId: seed.streamingMessageId, + response: '' + }); + } + + if (seed.processing) { + chatStore.processing.setActiveConversation(CONV_ID); + chatStore.processing.setState(CONV_ID, seed.processing); + } + + if (seed.compactingNodeId) chatActivityStore.markCompacting(CONV_ID, seed.compactingNodeId); + + if (seed.pendingEditMessageId) chatStore.pendingEditMessageId = seed.pendingEditMessageId; + + return () => { + for (const [key, value] of Object.entries(previousSettings)) { + settingsStore.updateConfig(key, value); + } + + chatActivityStore.localEnded(CONV_ID); + chatActivityStore.endCompacting(CONV_ID); + chatStore.chatStreamingStates.delete(CONV_ID); + chatStore.processing.setState(CONV_ID, null); + chatStore.processing.setActiveConversation(null); + chatStore.pendingEditMessageId = null; + conversationsStore.activeMessages = []; + conversationsStore.activeConversation = null; + }; +} diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreen.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreen.stories.svelte new file mode 100644 index 000000000000..da7aba545b3e --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreen.stories.svelte @@ -0,0 +1,242 @@ + + + { + const { canvas } = context; + + await expect(await canvas.findByText('Hello there')).toBeInTheDocument(); + await expect(canvas.getByRole('textbox')).toHaveFocus(); + await expect(canvas.getByRole('button', { name: 'Send' })).toBeDisabled(); + }} +/> + + { + const { canvas, step } = context; + + await step('type and send a message', async () => { + await send(context, 'What does quantization do?'); + }); + + await step('the message moves into the chat and the reply streams in', async () => { + await expect(await canvas.findByText('What does quantization do?')).toBeInTheDocument(); + await expect( + await canvas.findByText(REPLY_END, { exact: false }, { timeout: 8000 }) + ).toBeInTheDocument(); + }); + + await step('the form is ready for the next message', async () => { + await waitFor(() => expect(chatStore.isLoading).toBe(false)); + // the editor is empty again: at most its placeholder is left + await expect(canvas.getByRole('textbox')).toHaveTextContent(/^(Type a message\.\.\.)?$/); + await expect(conversationsStore.activeMessages.map((m) => m.role)).toEqual([ + 'user', + 'assistant' + ]); + }); + }} +/> + + { + const { canvas } = context; + + await expect( + await canvas.findByText('What is the difference between Q4_K_M and Q8_0?') + ).toBeInTheDocument(); + await expect(canvas.getByText('How do I run one with llama-server?')).toBeInTheDocument(); + await expect(canvas.getByRole('table')).toBeInTheDocument(); + await expect(canvas.queryByText('Hello there')).not.toBeVisible(); + }} +/> + + { + const { canvas } = context; + + await canvas.findByText('How do I run one with llama-server?'); + + await send(context, 'Which one fits in 8 GB of VRAM?'); + + await expect(await canvas.findByText('Which one fits in 8 GB of VRAM?')).toBeInTheDocument(); + await expect( + await canvas.findByText(REPLY_END, { exact: false }, { timeout: 8000 }) + ).toBeInTheDocument(); + + // the follow-up joins the existing branch: 4 earlier turns plus the new pair + await waitFor(() => expect(conversationsStore.activeMessages).toHaveLength(6)); + // the reply is stored before the next story resets the stores + await waitFor(() => expect(chatStore.isLoading).toBe(false)); + }} +/> + + { + const { canvas, step, userEvent } = context; + + await send(context, 'Tell me about quantization'); + + await step('stop the reply while it streams', async () => { + const stop = await canvas.findByRole('button', { name: 'Stop' }, { timeout: 4000 }); + + await canvas.findByText('Sure.', { exact: false }, { timeout: 8000 }); + await getPace(context).pause(); + await userEvent.click(stop); + }); + + await step('the partial reply stays and the form is ready again', async () => { + await waitFor(() => expect(chatStore.isLoading).toBe(false)); + await expect(canvas.getByText('Sure.', { exact: false })).toBeInTheDocument(); + await expect(canvas.queryByText(REPLY_END, { exact: false })).not.toBeInTheDocument(); + await expect(canvas.getByRole('button', { name: 'Send' })).toBeInTheDocument(); + }); + }} +/> + + { + await send(context, 'Summarize this very long document'); + + // the dialog is portalled to the body, outside the canvas + const page = within(document.body); + + await expect(await page.findByRole('alertdialog', {}, { timeout: 4000 })).toBeInTheDocument(); + await expect(page.getByText('Server Error')).toBeInTheDocument(); + await expect( + page.getByText('the request exceeds the available context size', { exact: false }) + ).toBeInTheDocument(); + }} +/> + + { + const restore = await setup()(context); + + serverStore.error = 'Failed to fetch server properties: connection refused'; + serverStore.status = 500; + + return () => { + serverStore.error = null; + serverStore.status = null; + restore(); + }; + }} + name="ServerUnavailable" + parameters={newChatRoute} + play={async (context) => { + const { canvas } = context; + + await expect(await canvas.findByText(/connection refused/)).toBeInTheDocument(); + // the markdown editor is a contenteditable, disabled by turning that off + await expect(canvas.getByRole('textbox')).toHaveAttribute('contenteditable', 'false'); + }} +/> diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreenActionScrollDown.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreenActionScrollDown.stories.svelte new file mode 100644 index 000000000000..2e3ef989acb6 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreenActionScrollDown.stories.svelte @@ -0,0 +1,19 @@ + + + + +
+ console.log('scroll to bottom')} /> +
+
diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreenDragOverlay.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreenDragOverlay.stories.svelte new file mode 100644 index 000000000000..b4a8780ebddf --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreenDragOverlay.stories.svelte @@ -0,0 +1,20 @@ + + + +
+ Page content behind the overlay +
+ + +
diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreenGreeting.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreenGreeting.stories.svelte new file mode 100644 index 000000000000..732a92c097d6 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreenGreeting.stories.svelte @@ -0,0 +1,33 @@ + + + + seedAudio(false)} name="Default"> +
+ +
+
+ + seedAudio(true)} name="WithAudioModality"> +
+ +
+
diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreenServerError.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreenServerError.stories.svelte new file mode 100644 index 000000000000..1dff6c44cc1f --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreenServerError.stories.svelte @@ -0,0 +1,56 @@ + + + + seedServer({ error: 'Failed to fetch server properties: connection refused', status: 500 })} + name="Default" +> +
+ +
+
+ + + seedServer({ + error: 'Failed to fetch server properties: connection refused', + loading: true, + status: 500 + })} + name="Retrying" +> +
+ +
+
+ + + seedServer({ error: 'Loading model', status: 503 })} + name="LoadingModel" +> +
+ +
+
diff --git a/ui/apps/chat/tests/stories/chat/screen/ChatScreenStreamResumeStatus.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/ChatScreenStreamResumeStatus.stories.svelte new file mode 100644 index 000000000000..63aa0ac85858 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/screen/ChatScreenStreamResumeStatus.stories.svelte @@ -0,0 +1,27 @@ + + + + { + chatStore.streamConnectionState = StreamConnectionState.RESUMING; + }} + name="Default" +> +
+ +
+
diff --git a/ui/apps/chat/tests/stories/chat/screen/attachments/ChatAttachmentsPreview.stories.svelte b/ui/apps/chat/tests/stories/chat/screen/attachments/ChatAttachmentsPreview.stories.svelte deleted file mode 100644 index 2a4aecb68936..000000000000 --- a/ui/apps/chat/tests/stories/chat/screen/attachments/ChatAttachmentsPreview.stories.svelte +++ /dev/null @@ -1,47 +0,0 @@ - - - - { - await waitFor(() => expect(canvas.getByText('Failed to load PDF images')).toBeInTheDocument(), { - timeout: 5000 - }); - - // a retry loop would flip back to the loading state - await new Promise((resolve) => setTimeout(resolve, 500)); - await expect(canvas.queryByText('Converting PDF to images...')).not.toBeInTheDocument(); - await expect(canvas.getByText('Failed to load PDF images')).toBeInTheDocument(); - }} -> -
- -
-
diff --git a/ui/apps/chat/tests/stories/chat/screen/chat-screen.fixtures.ts b/ui/apps/chat/tests/stories/chat/screen/chat-screen.fixtures.ts new file mode 100644 index 000000000000..b0613ef13307 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/screen/chat-screen.fixtures.ts @@ -0,0 +1,179 @@ +import { MODEL_NAME, modelServerProps, seedStores } from '../form/fixtures'; +import { MessageRole, MessageType, ServerRole } from '#lib/enums/index.ts'; +import { DatabaseService } from '#lib/services/database.service.ts'; +import { chatStore, conversationsStore } from '#lib/stores/index.ts'; + +export const SCREEN_CONVERSATION_ID = 'story-chat-screen'; + +export const REPLY_TEXT = + 'Sure. Quantization stores the weights with fewer bits, so the model takes less memory and runs faster, at a small cost in quality.'; + +const minutesAgo = (minutes: number) => Date.now() - minutes * 60_000; +const turn = ( + id: string, + parent: string | null, + children: string[], + fields: Partial +): DatabaseMessage => ({ + children, + content: '', + convId: SCREEN_CONVERSATION_ID, + id, + parent, + role: MessageRole.USER, + timestamp: minutesAgo(10), + toolCalls: '', + type: MessageType.TEXT, + ...fields +}); + +/** A finished conversation in the export format, written to IndexedDB as the app would import it. */ +export const screenConversation: ExportedConversation = { + conv: { + currNode: 'a2', + id: SCREEN_CONVERSATION_ID, + lastModified: minutesAgo(2), + name: 'Running GGUF models locally' + }, + messages: [ + turn('root', null, ['u1'], { role: MessageRole.SYSTEM, type: MessageType.ROOT }), + turn('u1', 'root', ['a1'], { + content: 'What is the difference between Q4_K_M and Q8_0?', + timestamp: minutesAgo(9) + }), + turn('a1', 'u1', ['u2'], { + content: + 'Both are GGUF quantization types:\n\n| Type | Bits per weight | Quality |\n| --- | --- | --- |\n| Q4_K_M | ~4.8 | good |\n| Q8_0 | ~8.5 | near lossless |\n\nPick **Q4_K_M** when memory is tight and **Q8_0** when quality matters most.', + model: MODEL_NAME, + reasoningContent: + 'The user compares two quant types. Give bits per weight and the trade-off, keep it short.', + role: MessageRole.ASSISTANT, + timestamp: minutesAgo(8), + timings: { predicted_ms: 3100, predicted_n: 96, prompt_ms: 180, prompt_n: 42 } + }), + turn('u2', 'a1', ['a2'], { + content: 'How do I run one with llama-server?', + timestamp: minutesAgo(3) + }), + turn('a2', 'u2', [], { + content: + 'Point the server at the file and open the web UI:\n\n```sh\nllama-server -m Qwen3-8B-Q4_K_M.gguf --port 9931\n```\n\nThen visit `http://localhost:9931`.', + model: MODEL_NAME, + role: MessageRole.ASSISTANT, + timestamp: minutesAgo(2), + timings: { cache_n: 120, predicted_ms: 2400, predicted_n: 64, prompt_ms: 90, prompt_n: 30 } + }) + ] +}; + +export interface FakeServerOptions { + /** Text streamed back for a chat completion. */ + reply?: string; + /** Delay between streamed chunks, in ms. */ + chunkDelayMs?: number; + /** HTTP status for the completion request; anything but 200 is an error reply. */ + status?: number; + /** Error message sent with a failed completion. */ + errorMessage?: string; +} + +const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms)); +const json = (body: unknown, status = 200) => + new Response(JSON.stringify(body), { headers: { 'Content-Type': 'application/json' }, status }); + +function streamReply(reply: string, chunkDelayMs: number, signal?: AbortSignal | null): Response { + const encoder = new TextEncoder(); + const words = reply.split(/(?<= )/); + const sse = (data: unknown) => encoder.encode(`data: ${JSON.stringify(data)}\n\n`); + const body = new ReadableStream({ + async start(controller) { + for (const word of words) { + if (signal?.aborted) return controller.error(new DOMException('Aborted', 'AbortError')); + + controller.enqueue( + sse({ choices: [{ delta: { content: word }, index: 0 }], model: MODEL_NAME }) + ); + await sleep(chunkDelayMs); + } + + controller.enqueue( + sse({ + choices: [{ delta: {}, finish_reason: 'stop', index: 0 }], + model: MODEL_NAME, + timings: { + predicted_ms: words.length * chunkDelayMs, + predicted_n: words.length, + prompt_ms: 40, + prompt_n: 24 + } + }) + ); + controller.enqueue(encoder.encode('data: [DONE]\n\n')); + controller.close(); + } + }); + + return new Response(body, { headers: { 'Content-Type': 'text/event-stream' } }); +} + +/** + * Stand-in for llama-server: answers chat completions with a streamed reply and + * every other API call with a harmless empty result. Returns the restore. + */ +export function installFakeServer(options: FakeServerOptions = {}): () => void { + const { chunkDelayMs = 30, errorMessage = 'Internal server error', reply = REPLY_TEXT } = options; + const status = options.status ?? 200; + const realFetch = window.fetch; + + window.fetch = async (input, init) => { + const url = typeof input === 'string' ? input : input instanceof URL ? input.href : input.url; + + if (url.includes('/v1/chat/completions') && !url.includes('/control')) { + if (status !== 200) return json({ error: { code: status, message: errorMessage } }, status); + + const body = JSON.parse(String(init?.body ?? '{}')); + + if (!body.stream) { + return json({ + choices: [{ message: { content: reply, role: 'assistant' } }], + timings: { cache_n: 0, prompt_n: 24 } + }); + } + + return streamReply(reply, chunkDelayMs, init?.signal); + } + + if (url.includes('/props')) return json(modelServerProps()); + + if (url.includes('/v1/models')) return json({ data: [], object: 'list' }); + + return json({}, 404); + }; + + return () => { + window.fetch = realFetch; + }; +} + +/** Single-model server state plus an empty new-chat screen. */ +export function seedNewChat(): () => void { + const restore = seedStores({ + activeConversation: null, + activeMessages: [], + config: { conversationTabs: false, showMessageStats: true }, + serverProps: modelServerProps(), + serverRole: ServerRole.MODEL + }); + + chatStore.dismissErrorDialog(); + + return restore; +} + +/** Writes the fixture conversation to IndexedDB and opens it like the chat route does. */ +export async function openScreenConversation(): Promise { + await DatabaseService.deleteConversation(SCREEN_CONVERSATION_ID).catch(() => {}); + await DatabaseService.importConversations([structuredClone(screenConversation)]); + await conversationsStore.loadConversations(); + await conversationsStore.loadConversation(SCREEN_CONVERSATION_ID); +} diff --git a/ui/apps/chat/tests/stories/chat/screen/fixtures.ts b/ui/apps/chat/tests/stories/chat/screen/fixtures.ts new file mode 100644 index 000000000000..7eca3838adb6 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/screen/fixtures.ts @@ -0,0 +1,286 @@ +import photoUrl from '../../fixtures/assets/1.jpg'; +import clipVideoUrl from '../../fixtures/assets/clip.webm'; +import hfLogoUrl from '../../fixtures/assets/hf-logo.svg'; +import toneAudioUrl from '../../fixtures/assets/tone.wav'; +import { AttachmentType, SpecialFileType } from '#lib/enums/index.ts'; +import type { + DatabaseMessageExtraAudioFile, + DatabaseMessageExtraImageFile, + DatabaseMessageExtraLegacyContext, + DatabaseMessageExtraMcpPrompt, + DatabaseMessageExtraMcpResource, + DatabaseMessageExtraPdfFile, + DatabaseMessageExtraTextFile, + DatabaseMessageExtraVideoFile, + MCPResourceAttachment +} from '#lib/types/index.ts'; + +export { clipVideoUrl, hfLogoUrl, photoUrl, toneAudioUrl }; + +export const gradientImageUrl = `data:image/svg+xml;utf8,${encodeURIComponent( + '' +)}`; + +export const sampleCode = `import { serverStore } from '#lib/stores/index.ts'; + +export async function loadProps(): Promise { + await serverStore.fetch(); + + if (serverStore.error) { + console.error('Server unavailable:', serverStore.error); + } +} +`; + +export const sampleNotes = `Meeting notes - release planning + +- Ship the matte glass surfaces behind a flag first. +- Collect feedback from the nightly build users. +- Remove the flag once the dark theme contrast is fixed. +- Follow up on the attachment preview performance numbers from last week.`; + +export const samplePdfText = `Attention Is All You Need + +Abstract. The dominant sequence transduction models are based on complex recurrent or convolutional neural networks that include an encoder and a decoder.`; + +// Stored message attachments (DatabaseMessageExtra) + +export const imageAttachment: DatabaseMessageExtraImageFile = { + base64Url: photoUrl, + name: 'mountain-lake.jpg', + size: 44_891, + type: AttachmentType.IMAGE +}; + +export const logoAttachment: DatabaseMessageExtraImageFile = { + base64Url: hfLogoUrl, + name: 'hf-logo.svg', + size: 35_285, + type: AttachmentType.IMAGE +}; + +export const gradientAttachment: DatabaseMessageExtraImageFile = { + base64Url: gradientImageUrl, + name: 'gradient.svg', + size: 412, + type: AttachmentType.IMAGE +}; + +export const textAttachment: DatabaseMessageExtraTextFile = { + content: sampleCode, + name: 'load-props.ts', + size: sampleCode.length, + type: AttachmentType.TEXT +}; + +export const notesAttachment: DatabaseMessageExtraTextFile = { + content: sampleNotes, + name: 'notes.md', + size: sampleNotes.length, + type: AttachmentType.TEXT +}; + +export const legacyContextAttachment: DatabaseMessageExtraLegacyContext = { + content: 'Pasted context from the old UI.', + name: 'Pasted content', + type: AttachmentType.LEGACY_CONTEXT +}; + +// PDF pages are pre-rendered so the preview does not need pdf.js +export const pdfAttachment: DatabaseMessageExtraPdfFile = { + base64Data: '', + content: samplePdfText, + images: [photoUrl, gradientImageUrl], + name: 'attention-is-all-you-need.pdf', + processedAsImages: false, + size: 2_215_244, + type: AttachmentType.PDF +}; + +export const pdfAsImagesAttachment: DatabaseMessageExtraPdfFile = { + ...pdfAttachment, + name: 'scanned-invoice.pdf', + processedAsImages: true, + size: 351_048 +}; + +export const audioAttachment: DatabaseMessageExtraAudioFile = { + base64Data: '', + mimeType: 'audio/wav', + name: 'voice-memo.wav', + size: 8_078, + type: AttachmentType.AUDIO +}; + +export const videoAttachment: DatabaseMessageExtraVideoFile = { + base64Data: '', + mimeType: 'video/webm', + name: 'screen-recording.webm', + size: 8_101, + type: AttachmentType.VIDEO +}; + +export const mcpPromptAttachment: DatabaseMessageExtraMcpPrompt = { + arguments: { language: 'TypeScript', topic: 'error handling' }, + content: + 'Review the following TypeScript code and suggest improvements for error handling. Focus on edge cases.', + name: 'code-review', + promptName: 'code-review', + serverName: 'github', + type: AttachmentType.MCP_PROMPT +}; + +export const mcpResourceAttachment: DatabaseMessageExtraMcpResource = { + content: '# llama.cpp\n\nInference of LLMs in pure C/C++.', + mimeType: 'text/markdown', + name: 'README.md', + serverName: 'filesystem', + type: AttachmentType.MCP_RESOURCE, + uri: 'file:///workspace/llama.cpp/README.md' +}; + +export const mcpResourceImageAttachment: DatabaseMessageExtraMcpResource = { + content: '', + mimeType: 'image/png', + name: 'architecture.png', + serverName: 'filesystem', + type: AttachmentType.MCP_RESOURCE, + uri: 'file:///workspace/docs/architecture.png' +}; + +export function toMcpResourceAttachment( + extra: DatabaseMessageExtraMcpResource, + overrides: Partial = {} +): MCPResourceAttachment { + return { + id: `resource-${extra.name}`, + resource: { + mimeType: extra.mimeType, + name: extra.name, + serverName: extra.serverName, + title: extra.name, + uri: extra.uri + }, + ...overrides + }; +} + +// Pending uploads (ChatUploadedFile) + +export function createUploadedFile( + name: string, + type: string, + extra: Partial = {} +): ChatUploadedFile { + const content = extra.textContent ?? ''; + + return { + file: new File([content], name, { type }), + id: `upload-${name}`, + name, + size: extra.size ?? content.length, + type, + ...extra + }; +} + +export const uploadedImage = createUploadedFile('mountain-lake.jpg', 'image/jpeg', { + preview: photoUrl, + size: 44_891 +}); + +export const uploadedLogo = createUploadedFile('hf-logo.svg', 'image/svg+xml', { + preview: hfLogoUrl, + size: 35_285 +}); + +export const uploadedGradient = createUploadedFile('gradient.svg', 'image/svg+xml', { + preview: gradientImageUrl, + size: 412 +}); + +export const uploadedText = createUploadedFile('load-props.ts', 'text/typescript', { + textContent: sampleCode +}); + +export const uploadedNotes = createUploadedFile('notes.md', 'text/markdown', { + textContent: sampleNotes +}); + +export const uploadedPdf = createUploadedFile('attention-is-all-you-need.pdf', 'application/pdf', { + size: 2_215_244, + textContent: samplePdfText +}); + +export const uploadedAudio = createUploadedFile('voice-memo.wav', 'audio/wav', { + preview: toneAudioUrl, + size: 8_078 +}); + +export const uploadedVideo = createUploadedFile('screen-recording.webm', 'video/webm', { + preview: clipVideoUrl, + size: 8_101 +}); + +export const uploadedArchive = createUploadedFile('dataset.zip', 'application/zip', { + size: 5_242_880 +}); + +export const uploadedMcpPrompt = createUploadedFile('summarize-issue', SpecialFileType.MCP_PROMPT, { + mcpPrompt: { + arguments: { issue: '#31273' }, + promptName: 'summarize-issue', + serverName: 'github' + }, + textContent: 'Summarize the discussion in issue #31273 and list the open questions.' +}); + +export const uploadedMcpPromptLoading = createUploadedFile( + 'triage-bug', + SpecialFileType.MCP_PROMPT, + { + isLoading: true, + mcpPrompt: { arguments: { label: 'bug' }, promptName: 'triage-bug', serverName: 'github' } + } +); + +export const uploadedMcpPromptError = createUploadedFile( + 'release-notes', + SpecialFileType.MCP_PROMPT, + { + loadError: 'MCP server "github" is not connected', + mcpPrompt: { promptName: 'release-notes', serverName: 'github' } + } +); + +// Conversations for the tab strip + +export const tabConversations: DatabaseConversation[] = [ + { currNode: 'm-1', id: 'conv-1', lastModified: Date.now() - 60_000, name: 'Rust borrow checker' }, + { currNode: 'm-2', id: 'conv-2', lastModified: Date.now() - 120_000, name: 'Trip to Kyoto' }, + { currNode: 'm-3', id: 'conv-3', lastModified: Date.now() - 180_000, name: 'GGUF quantization' }, + { + currNode: 'm-4', + id: 'conv-4', + lastModified: Date.now() - 240_000, + name: 'A very long conversation title that has to be truncated inside the tab' + }, + { currNode: 'm-5', id: 'conv-5', lastModified: Date.now() - 300_000, name: 'Sourdough starter' }, + { + currNode: 'm-6', + id: 'conv-6', + lastModified: Date.now() - 360_000, + name: 'SQL window functions' + }, + { + currNode: 'm-7', + id: 'conv-7', + lastModified: Date.now() - 420_000, + name: 'Weekly report draft' + }, + { currNode: 'm-8', id: 'conv-8', lastModified: Date.now() - 480_000, name: 'Svelte 5 runes' }, + { currNode: 'm-9', id: 'conv-9', lastModified: Date.now() - 540_000, name: 'Bike maintenance' }, + { currNode: 'm-10', id: 'conv-10', lastModified: Date.now() - 600_000, name: 'Tax questions' }, + { currNode: 'm-11', id: 'conv-11', lastModified: Date.now() - 660_000, name: 'Piano practice' }, + { currNode: 'm-12', id: 'conv-12', lastModified: Date.now() - 720_000, name: 'CUDA kernels' } +]; diff --git a/ui/apps/chat/tests/stories/chat/tabs/ChatTabs.stories.svelte b/ui/apps/chat/tests/stories/chat/tabs/ChatTabs.stories.svelte new file mode 100644 index 000000000000..0d9a88e1cc66 --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/tabs/ChatTabs.stories.svelte @@ -0,0 +1,96 @@ + + + seedTabs(['conv-1', 'conv-2', 'conv-3'])} + name="Default" + parameters={chatRoute('conv-2')} +> +
+ +
+
+ + + seedTabs(['conv-1', 'conv-2', NEW_CHAT_TAB_ID])} + name="NewChatTabActive" + parameters={newChatRoute} +> +
+ +
+
+ + seedTabs(['conv-1', 'conv-2', 'conv-3', 'conv-5'], ['conv-1', 'conv-3'])} + name="WithLoadingTabs" + parameters={chatRoute('conv-1')} +> +
+ +
+
+ + + + seedTabs( + tabConversations.map((c) => c.id), + ['conv-6'] + )} + name="ManyTabsOverflow" + parameters={chatRoute('conv-9')} +> +
+ +
+
+ + + seedTabs(['conv-1', 'conv-missing'])} + name="UnnamedChat" + parameters={chatRoute('conv-missing')} +> +
+ +
+
diff --git a/ui/apps/chat/tests/stories/chat/tabs/ChatTabsItem.stories.svelte b/ui/apps/chat/tests/stories/chat/tabs/ChatTabsItem.stories.svelte new file mode 100644 index 000000000000..969a18d413fb --- /dev/null +++ b/ui/apps/chat/tests/stories/chat/tabs/ChatTabsItem.stories.svelte @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/content/CollapsibleTerminalBlock.stories.svelte b/ui/apps/chat/tests/stories/content/CollapsibleTerminalBlock.stories.svelte new file mode 100644 index 000000000000..840eeb12e7b0 --- /dev/null +++ b/ui/apps/chat/tests/stories/content/CollapsibleTerminalBlock.stories.svelte @@ -0,0 +1,26 @@ + + + +
+ +
running 3 tests
+test borrow::longest ... ok
+test borrow::shorter ... ok
+test borrow::equal ... ok
+
+test result: ok. 3 passed; 0 failed
+
+
+
diff --git a/ui/apps/chat/tests/stories/content/MarkdownContent.stories.svelte b/ui/apps/chat/tests/stories/content/MarkdownContent.stories.svelte new file mode 100644 index 000000000000..a569a0643548 --- /dev/null +++ b/ui/apps/chat/tests/stories/content/MarkdownContent.stories.svelte @@ -0,0 +1,18 @@ + + + diff --git a/ui/apps/chat/tests/stories/dialogs/DialogConfirmation.stories.svelte b/ui/apps/chat/tests/stories/dialogs/DialogConfirmation.stories.svelte new file mode 100644 index 000000000000..677c8f449096 --- /dev/null +++ b/ui/apps/chat/tests/stories/dialogs/DialogConfirmation.stories.svelte @@ -0,0 +1,43 @@ + + + + + + (defaultOpen = false)} + onConfirm={() => (defaultOpen = false)} + title="Switch model?" + /> + + + + (destructiveOpen = false)} + onConfirm={() => (destructiveOpen = false)} + title="Delete conversation?" + variant="destructive" + /> + diff --git a/ui/apps/chat/tests/stories/editorial/Chapters.svelte b/ui/apps/chat/tests/stories/editorial/Chapters.svelte new file mode 100644 index 000000000000..439b5597d063 --- /dev/null +++ b/ui/apps/chat/tests/stories/editorial/Chapters.svelte @@ -0,0 +1,153 @@ + + + +{#if chapters.length} + +{/if} + + diff --git a/ui/apps/chat/tests/stories/editorial/Editorial.svelte b/ui/apps/chat/tests/stories/editorial/Editorial.svelte new file mode 100644 index 000000000000..cdc71ad11231 --- /dev/null +++ b/ui/apps/chat/tests/stories/editorial/Editorial.svelte @@ -0,0 +1,205 @@ + + + +
{@render children()}
+ + + + diff --git a/ui/apps/chat/tests/stories/editorial/Figure.svelte b/ui/apps/chat/tests/stories/editorial/Figure.svelte new file mode 100644 index 000000000000..25f92ac9a478 --- /dev/null +++ b/ui/apps/chat/tests/stories/editorial/Figure.svelte @@ -0,0 +1,60 @@ + + + +
+
{@render children()}
+ +
+ Fig. {n} + {caption} +
+
+ + diff --git a/ui/apps/chat/tests/stories/fixtures/ChatFormSingleRowPreview.svelte b/ui/apps/chat/tests/stories/fixtures/ChatFormSingleRowPreview.svelte deleted file mode 100644 index b25549bfa8fa..000000000000 --- a/ui/apps/chat/tests/stories/fixtures/ChatFormSingleRowPreview.svelte +++ /dev/null @@ -1,57 +0,0 @@ - - - - -
- -
diff --git a/ui/apps/chat/tests/stories/fixtures/api-docs.ts b/ui/apps/chat/tests/stories/fixtures/api-docs.ts deleted file mode 100644 index 7b499956f8bc..000000000000 --- a/ui/apps/chat/tests/stories/fixtures/api-docs.ts +++ /dev/null @@ -1,160 +0,0 @@ -// API Documentation -export const API_DOCS_MD = String.raw` -# REST API Documentation - -## 🔐 Authentication - -All API requests require authentication using **Bearer tokens**. Include your API key in the Authorization header: - -${'```'}http -GET /api/v1/users -Host: api.example.com -Authorization: Bearer YOUR_API_KEY -Content-Type: application/json -${'```'} - -## 📍 Endpoints - -### Users API - -#### **GET** /api/v1/users - -Retrieve a paginated list of users. - -**Query Parameters:** - -| Parameter | Type | Default | Description | -|-----------|------|---------|-------------| -| page | integer | 1 | Page number | -| limit | integer | 20 | Items per page | -| sort | string | "created_at" | Sort field | -| order | string | "desc" | Sort order | - -**Response:** 200 OK - -${'```'}json -{ - "data": [ - { - "id": "usr_1234567890", - "email": "user@example.com", - "name": "John Doe", - "role": "admin", - "created_at": "2024-01-15T10:30:00Z" - } - ], - "pagination": { - "page": 1, - "limit": 20, - "total": 156, - "pages": 8 - } -} -${'```'} - -#### **POST** /api/v1/users - -Create a new user account. - -**Request Body:** - -${'```'}json -{ - "email": "newuser@example.com", - "password": "SecurePassword123!", - "name": "Jane Smith", - "role": "user" -} -${'```'} - -**Response:** 201 Created - -${'```'}json -{ - "id": "usr_9876543210", - "email": "newuser@example.com", - "name": "Jane Smith", - "role": "user", - "created_at": "2024-01-21T09:15:00Z" -} -${'```'} - -### Error Responses - -The API returns errors in a consistent format: - -${'```'}json -{ - "error": { - "code": "VALIDATION_ERROR", - "message": "Invalid request parameters", - "details": [ - { - "field": "email", - "message": "Email format is invalid" - } - ] - } -} -${'```'} - -### Rate Limiting - -| Tier | Requests/Hour | Burst | -|------|--------------|-------| -| **Free** | 1,000 | 100 | -| **Pro** | 10,000 | 500 | -| **Enterprise** | Unlimited | - | - -**Headers:** -- X-RateLimit-Limit -- X-RateLimit-Remaining -- X-RateLimit-Reset - -### Webhooks - -Configure webhooks to receive real-time events: - -${'```'}javascript -// Webhook payload -{ - "event": "user.created", - "timestamp": "2024-01-21T09:15:00Z", - "data": { - "id": "usr_9876543210", - "email": "newuser@example.com" - }, - "signature": "sha256=abcd1234..." -} -${'```'} - -### SDK Examples - -**JavaScript/TypeScript:** - -${'```'}typescript -import { ApiClient } from '@example/api-sdk'; - -const client = new ApiClient({ - apiKey: process.env.API_KEY -}); - -const users = await client.users.list({ - page: 1, - limit: 20 -}); -${'```'} - -**Python:** - -${'```'}python -from example_api import Client - -client = Client(api_key=os.environ['API_KEY']) -users = client.users.list(page=1, limit=20) -${'```'} - ---- - -📚 [Full API Reference](https://api.example.com/docs) | 💬 [Support](https://support.example.com) -`; diff --git a/ui/apps/chat/tests/stories/fixtures/assets/beautiful-flowers-lotus.webp b/ui/apps/chat/tests/stories/fixtures/assets/beautiful-flowers-lotus.webp deleted file mode 100644 index 6efcffc3b82b..000000000000 Binary files a/ui/apps/chat/tests/stories/fixtures/assets/beautiful-flowers-lotus.webp and /dev/null differ diff --git a/ui/apps/chat/tests/stories/fixtures/assets/clip.webm b/ui/apps/chat/tests/stories/fixtures/assets/clip.webm new file mode 100644 index 000000000000..b033e8745925 Binary files /dev/null and b/ui/apps/chat/tests/stories/fixtures/assets/clip.webm differ diff --git a/ui/apps/chat/tests/stories/fixtures/assets/tone.wav b/ui/apps/chat/tests/stories/fixtures/assets/tone.wav new file mode 100644 index 000000000000..80c7e08cd588 Binary files /dev/null and b/ui/apps/chat/tests/stories/fixtures/assets/tone.wav differ diff --git a/ui/apps/chat/tests/stories/fixtures/blog-post.ts b/ui/apps/chat/tests/stories/fixtures/blog-post.ts deleted file mode 100644 index 3eb2ed7585f8..000000000000 --- a/ui/apps/chat/tests/stories/fixtures/blog-post.ts +++ /dev/null @@ -1,125 +0,0 @@ -// Blog Post Content -export const BLOG_POST_MD = String.raw` -# Understanding Rust's Ownership System - -*Published on March 15, 2024 • 8 min read* - -Rust's ownership system is one of its most distinctive features, enabling memory safety without garbage collection. In this post, we'll explore how ownership works and why it's revolutionary for systems programming. - -## What is Ownership? - -Ownership is a set of rules that governs how Rust manages memory. These rules are checked at compile time, ensuring memory safety without runtime overhead. - -### The Three Rules of Ownership - -1. **Each value has a single owner** -2. **There can only be one owner at a time** -3. **When the owner goes out of scope, the value is dropped** - -## Memory Management Without GC - -Traditional approaches to memory management: - -- **Manual management** (C/C++): Error-prone, leads to bugs -- **Garbage collection** (Java, Python): Runtime overhead -- **Ownership** (Rust): Compile-time safety, zero runtime cost - -## Basic Examples - -### Variable Scope - -${'```'}rust -fn main() { - let s = String::from("hello"); // s comes into scope - - // s is valid here - println!("{}", s); - -} // s goes out of scope and is dropped -${'```'} - -### Move Semantics - -${'```'}rust -fn main() { - let s1 = String::from("hello"); - let s2 = s1; // s1 is moved to s2 - - // println!("{}", s1); // ❌ ERROR: s1 is no longer valid - println!("{}", s2); // ✅ OK: s2 owns the string -} -${'```'} - -## Borrowing and References - -Instead of transferring ownership, you can **borrow** values: - -### Immutable References - -${'```'}rust -fn calculate_length(s: &String) -> usize { - s.len() // s is a reference, doesn't own the String -} - -fn main() { - let s1 = String::from("hello"); - let len = calculate_length(&s1); // Borrow s1 - println!("Length of '{}' is {}", s1, len); // s1 still valid -} -${'```'} - -### Mutable References - -${'```'}rust -fn main() { - let mut s = String::from("hello"); - - let r1 = &mut s; - r1.push_str(", world"); - println!("{}", r1); - - // let r2 = &mut s; // ❌ ERROR: cannot borrow twice -} -${'```'} - -## Common Pitfalls - -### Dangling References - -${'```'}rust -fn dangle() -> &String { // ❌ ERROR: missing lifetime specifier - let s = String::from("hello"); - &s // s will be dropped, leaving a dangling reference -} -${'```'} - -### ✅ Solution - -${'```'}rust -fn no_dangle() -> String { - let s = String::from("hello"); - s // Ownership is moved out -} -${'```'} - -## Benefits - -- ✅ **No null pointer dereferences** -- ✅ **No data races** -- ✅ **No use-after-free** -- ✅ **No memory leaks** - -## Conclusion - -Rust's ownership system eliminates entire classes of bugs at compile time. While it has a learning curve, the benefits in safety and performance are worth it. - -## Further Reading - -- [The Rust Book - Ownership](https://doc.rust-lang.org/book/ch04-00-understanding-ownership.html) -- [Rust by Example - Ownership](https://doc.rust-lang.org/rust-by-example/scope/move.html) -- [Rustlings Exercises](https://github.com/rust-lang/rustlings) - ---- - -*Questions? Reach out on [Twitter](https://twitter.com/rustlang) or join the [Rust Discord](https://discord.gg/rust-lang)* -`; diff --git a/ui/apps/chat/tests/stories/fixtures/data-analysis.ts b/ui/apps/chat/tests/stories/fixtures/data-analysis.ts deleted file mode 100644 index 6fec32dad637..000000000000 --- a/ui/apps/chat/tests/stories/fixtures/data-analysis.ts +++ /dev/null @@ -1,124 +0,0 @@ -// Data Analysis Report -export const DATA_ANALYSIS_MD = String.raw` -# Q4 2024 Business Analytics Report - -*Executive Summary • Generated on January 15, 2025* - -## 📊 Key Performance Indicators - -${'```'} -Daily Active Users (DAU): 1.2M (+65% YoY) -Monthly Active Users (MAU): 4.5M (+48% YoY) -User Retention (Day 30): 68% (+12pp YoY) -Average Session Duration: 24min (+35% YoY) -${'```'} - -## 🎯 Product Performance - -### Feature Adoption Rates - -1. **AI Assistant**: 78% of users (↑ from 45%) -2. **Collaboration Tools**: 62% of users (↑ from 38%) -3. **Analytics Dashboard**: 54% of users (↑ from 31%) -4. **Mobile App**: 41% of users (↑ from 22%) - -### Customer Satisfaction - -| Metric | Q4 2024 | Q3 2024 | Change | -|--------|---------|---------|--------| -| **NPS Score** | 72 | 68 | +4 | -| **CSAT** | 4.6/5 | 4.4/5 | +0.2 | -| **Support Tickets** | 2,340 | 2,890 | -19% | -| **Resolution Time** | 4.2h | 5.1h | -18% | - -## 💰 Revenue Metrics - -### Monthly Recurring Revenue (MRR) - -- **Current MRR**: $2.8M (+42% YoY) -- **New MRR**: $340K -- **Expansion MRR**: $180K -- **Churned MRR**: $95K -- **Net New MRR**: $425K - -### Customer Acquisition - -${'```'} -Cost per Acquisition (CAC): $127 (-23% YoY) -Customer Lifetime Value: $1,840 (+31% YoY) -LTV:CAC Ratio: 14.5:1 -Payback Period: 3.2 months -${'```'} - -## 🌍 Geographic Performance - -### Revenue by Region - -1. **North America**: 45% ($1.26M) -2. **Europe**: 32% ($896K) -3. **Asia-Pacific**: 18% ($504K) -4. **Other**: 5% ($140K) - -### Growth Opportunities - -- **APAC**: 89% YoY growth potential -- **Latin America**: Emerging market entry -- **Middle East**: Enterprise expansion - -## 📱 Channel Performance - -### Traffic Sources - -| Channel | Sessions | Conversion | Revenue | -|---------|----------|------------|---------| -| **Organic Search** | 45% | 3.2% | $1.1M | -| **Direct** | 28% | 4.1% | $850K | -| **Social Media** | 15% | 2.8% | $420K | -| **Paid Ads** | 12% | 5.5% | $430K | - -### Marketing ROI - -- **Content Marketing**: 340% ROI -- **Email Campaigns**: 280% ROI -- **Social Media**: 190% ROI -- **Paid Search**: 220% ROI - -## 🔍 User Behavior Analysis - -### Session Patterns - -- **Peak Hours**: 9-11 AM, 2-4 PM EST -- **Mobile Usage**: 67% of sessions -- **Average Pages/Session**: 4.8 -- **Bounce Rate**: 23% (↓ from 31%) - -### Feature Usage Heatmap - -Most used features in order: -1. Dashboard (89% of users) -2. Search (76% of users) -3. Reports (64% of users) -4. Settings (45% of users) -5. Integrations (32% of users) - -## 💡 Recommendations - -1. **Invest** in AI capabilities (+$2M budget) -2. **Expand** sales team in APAC region -3. **Improve** onboarding to reduce churn -4. **Launch** enterprise security features - -## Appendix - -### Methodology - -Data collected from: -- Internal analytics (Amplitude) -- Customer surveys (n=2,450) -- Financial systems (NetSuite) -- Market research (Gartner) - ---- - -*Report prepared by Data Analytics Team • [View Interactive Dashboard](https://analytics.example.com)* -`; diff --git a/ui/apps/chat/tests/stories/fixtures/empty.ts b/ui/apps/chat/tests/stories/fixtures/empty.ts deleted file mode 100644 index 05286e7a783c..000000000000 --- a/ui/apps/chat/tests/stories/fixtures/empty.ts +++ /dev/null @@ -1,2 +0,0 @@ -// Empty state -export const EMPTY_MD = ''; diff --git a/ui/apps/chat/tests/stories/fixtures/math-formulas.ts b/ui/apps/chat/tests/stories/fixtures/math-formulas.ts deleted file mode 100644 index 1355256b20ce..000000000000 --- a/ui/apps/chat/tests/stories/fixtures/math-formulas.ts +++ /dev/null @@ -1,221 +0,0 @@ -/* eslint-disable no-irregular-whitespace */ -// Math Formulas Content -export const MATH_FORMULAS_MD = String.raw` -# Mathematical Formulas and Expressions - -This document demonstrates various mathematical notation and formulas that can be rendered using LaTeX syntax in markdown. - -## Basic Arithmetic - -### Addition and Summation -$$\sum_{i=1}^{n} i = \frac{n(n+1)}{2}$$ - -## Algebra - -### Quadratic Formula -The solutions to $ax^2 + bx + c = 0$ are: -$$x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}$$ - -### Binomial Theorem -$$(x + y)^n = \sum_{k=0}^{n} \binom{n}{k} x^{n-k} y^k$$ - -## Calculus - -### Derivatives -The derivative of $f(x) = x^n$ is: -$$f'(x) = nx^{n-1}$$ - -### Integration -$$\int_a^b f(x) \, dx = F(b) - F(a)$$ - -### Fundamental Theorem of Calculus -$$\frac{d}{dx} \int_a^x f(t) \, dt = f(x)$$ - -## Linear Algebra - -### Matrix Multiplication -If $A$ is an $m \times n$ matrix and $B$ is an $n \times p$ matrix, then: -$$C_{ij} = \sum_{k=1}^{n} A_{ik} B_{kj}$$ - -### Eigenvalues and Eigenvectors -For a square matrix $A$, if $Av = \lambda v$ for some non-zero vector $v$, then: -- $\lambda$ is an eigenvalue -- $v$ is an eigenvector - -## Statistics and Probability - -### Normal Distribution -The probability density function is: -$$f(x) = \frac{1}{\sigma\sqrt{2\pi}} e^{-\frac{1}{2}\left(\frac{x-\mu}{\sigma}\right)^2}$$ - -### Bayes' Theorem -$$P(A|B) = \frac{P(B|A) \cdot P(A)}{P(B)}$$ - -### Central Limit Theorem -For large $n$, the sample mean $\bar{X}$ is approximately: -$$\bar{X} \sim N\left(\mu, \frac{\sigma^2}{n}\right)$$ - -## Trigonometry - -### Pythagorean Identity -$$\sin^2\theta + \cos^2\theta = 1$$ - -### Euler's Formula -$$e^{i\theta} = \cos\theta + i\sin\theta$$ - -### Taylor Series for Sine -$$\sin x = \sum_{n=0}^{\infty} \frac{(-1)^n}{(2n+1)!} x^{2n+1} = x - \frac{x^3}{3!} + \frac{x^5}{5!} - \frac{x^7}{7!} + \cdots$$ - -## Complex Analysis - -### Complex Numbers -A complex number can be written as: -$$z = a + bi = r e^{i\theta}$$ - -where $r = |z| = \sqrt{a^2 + b^2}$ and $\theta = \arg(z)$ - -### Cauchy-Riemann Equations -For a function $f(z) = u(x,y) + iv(x,y)$ to be analytic: -$$\frac{\partial u}{\partial x} = \frac{\partial v}{\partial y}, \quad \frac{\partial u}{\partial y} = -\frac{\partial v}{\partial x}$$ - -## Differential Equations - -### First-order Linear ODE -$$\frac{dy}{dx} + P(x)y = Q(x)$$ - -Solution: $y = e^{-\int P(x)dx}\left[\int Q(x)e^{\int P(x)dx}dx + C\right]$ - -### Heat Equation -$$\frac{\partial u}{\partial t} = \alpha \frac{\partial^2 u}{\partial x^2}$$ - -## Number Theory - -### Prime Number Theorem -$$\pi(x) \sim \frac{x}{\ln x}$$ - -where $\pi(x)$ is the number of primes less than or equal to $x$. - -### Fermat's Last Theorem -For $n > 2$, there are no positive integers $a$, $b$, and $c$ such that: -$$a^n + b^n = c^n$$ - -## Set Theory - -### De Morgan's Laws -$$\overline{A \cup B} = \overline{A} \cap \overline{B}$$ -$$\overline{A \cap B} = \overline{A} \cup \overline{B}$$ - -## Advanced Topics - -### Riemann Zeta Function -$$\zeta(s) = \sum_{n=1}^{\infty} \frac{1}{n^s} = \prod_{p \text{ prime}} \frac{1}{1-p^{-s}}$$ - -### Maxwell's Equations -$$\nabla \cdot \mathbf{E} = \frac{\rho}{\epsilon_0}$$ -$$\nabla \cdot \mathbf{B} = 0$$ -$$\nabla \times \mathbf{E} = -\frac{\partial \mathbf{B}}{\partial t}$$ -$$\nabla \times \mathbf{B} = \mu_0\mathbf{J} + \mu_0\epsilon_0\frac{\partial \mathbf{E}}{\partial t}$$ - -### Schrödinger Equation -$$i\hbar\frac{\partial}{\partial t}\Psi(\mathbf{r},t) = \hat{H}\Psi(\mathbf{r},t)$$ - -## Inline Math Examples - -Here are some inline mathematical expressions: - -- The golden ratio: $\phi = \frac{1 + \sqrt{5}}{2} \approx 1.618$ -- Euler's number: $e = \lim_{n \to \infty} \left(1 + \frac{1}{n}\right)^n$ -- Pi: $\pi = 4 \sum_{n=0}^{\infty} \frac{(-1)^n}{2n+1}$ -- Square root of 2: $\sqrt{2} = 1.41421356...$ - -## Fractions and Radicals - -Complex fraction: $\frac{\frac{a}{b} + \frac{c}{d}}{\frac{e}{f} - \frac{g}{h}}$ - -Nested radicals: $\sqrt{2 + \sqrt{3 + \sqrt{4 + \sqrt{5}}}}$ - -## Summations and Products - -### Geometric Series -$$\sum_{n=0}^{\infty} ar^n = \frac{a}{1-r} \quad \text{for } |r| < 1$$ - -### Product Notation -$$n! = \prod_{k=1}^{n} k$$ - -### Double Summation -$$\sum_{i=1}^{m} \sum_{j=1}^{n} a_{ij}$$ - -## Limits - -$$\lim_{x \to 0} \frac{\sin x}{x} = 1$$ - -$$\lim_{n \to \infty} \left(1 + \frac{x}{n}\right)^n = e^x$$ - -## Further Bracket Styles and Amounts - -- \( \mathrm{GL}_2(\mathbb{F}_7) \): Group of invertible matrices with entries in \(\mathbb{F}_7\). -- Some kernel of \(\mathrm{SL}_2(\mathbb{F}_7)\): - \[ - \left\{ \begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}, \begin{pmatrix} -1 & 0 \\ 0 & -1 \end{pmatrix} \right\} = \{\pm I\} - \] -- Algebra: -\[ -x = \frac{-b \pm \sqrt{\,b^{2}-4ac\,}}{2a} -\] -- $100 and $12.99 are amounts, not LaTeX. -- I have $10, $3.99 and $x + y$ and $100x$. The amount is $2,000. -- Emma buys 2 cupcakes for $3 each and 1 cookie for $1.50. How much money does she spend in total? -- Maria has $20. She buys a notebook for $4.75 and a pack of pencils for $3.25. How much change does she receive? -- 1 kg の質量は - \[ - E = (1\ \text{kg}) \times (3.0 \times 10^8\ \text{m/s})^2 \approx 9.0 \times 10^{16}\ \text{J} - \] - というエネルギーに相当します。これは約 21 百万トンの TNT が爆発したときのエネルギーに匹敵します。 -- Algebra: \[ -x = \frac{-b \pm \sqrt{\,b^{2}-4ac\,}}{2a} -\] -- Algebraic topology, Homotopy Groups of $\mathbb{S}^3$: -$$\pi_n(\mathbb{S}^3) = \begin{cases} -\mathbb{Z} & n = 3 \\ -0 & n > 3, n \neq 4 \\ -\mathbb{Z}_2 & n = 4 \\ -\end{cases}$$ -- Spacer preceded by backslash: -\[ -\boxed{ -\begin{aligned} -N_{\text{att}}^{\text{(MHA)}} &= -h \bigl[\, d_{\text{model}}\;d_{k} + d_{\text{model}}\;d_{v}\, \bigr] && (\text{Q,K,V の重み})\\ -&\quad+ h(d_{k}+d_{k}+d_{v}) && (\text{バイアス Q,K,V)}\\[4pt] -&\quad+ (h d_{v})\, d_{\text{model}} && (\text{出力射影 }W^{O})\\ -&\quad+ d_{\text{model}} && (\text{バイアス }b^{O}) -\end{aligned}} -\] - -## Formulas in a Table - -| Area | Expression | Comment | -|------|------------|---------| -| **Algebra** | \[ -x = \frac{-b \pm \sqrt{\,b^{2}-4ac\,}}{2a} -\] | Quadratic formula | -| | \[ -(a+b)^{n} = \sum_{k=0}^{n}\binom{n}{k}\,a^{\,n-k}\,b^{\,k} -\] | Binomial theorem | -| | \(\displaystyle \prod_{k=1}^{n}k = n! \) | Factorial definition | -| **Geometry** | \( \mathbf{a}\cdot \mathbf{b} = \|\mathbf{a}\|\,\|\mathbf{b}\|\,\cos\theta \) | Dot product & angle | - -## No math (but chemical) - -Balanced chemical reaction with states: - -\[ -\ce{2H2(g) + O2(g) -> 2H2O(l)} -\] - -The standard enthalpy change for the reaction is: $\Delta H^\circ = \pu{-572 kJ mol^{-1}}$. - ---- - -*This document showcases various mathematical notation and formulas that can be rendered in markdown using LaTeX syntax.* -`; diff --git a/ui/apps/chat/tests/stories/fixtures/mobile-tables.ts b/ui/apps/chat/tests/stories/fixtures/mobile-tables.ts deleted file mode 100644 index 3e9cc3231db3..000000000000 --- a/ui/apps/chat/tests/stories/fixtures/mobile-tables.ts +++ /dev/null @@ -1,27 +0,0 @@ -// Table-heavy answers, to check the table layout at a phone width. -export const JOKES_TABLE_MD = String.raw` -Sure! Here are the jokes in a table: - -| No. | Joke | -|-----|------| -| 1 | Why don't scientists trust atoms? Because they make up everything. | -| 2 | I told my wife she was drawing her eyebrows too high. She looked surprised. | -| 3 | Why did the scarecrow win an award? Because he was outstanding in his field. | -| 4 | I'm reading a book about anti-gravity. It's impossible to put down. | -| 5 | Why don't skeletons fight each other? They don't have the guts. | -| 6 | I used to hate clowns, but they all have their fat-sies. | -| 7 | What do you call a fake noodle? An impasta. | -| 8 | Why did the bicycle fall over? Because it was two-tired. | -| 9 | I would tell you a chemistry joke, but I know I wouldn't get a reaction. | -| 10 | Why did the golfer bring two pairs of pants? In case he got a hole in one. | -`; - -export const WIDE_CELL_TABLE_MD = String.raw` -Some endpoints, in a table, for reference: - -| Name | Endpoint | Description | -|------|----------|-------------| -| Completions | https://huggingface.co/api/models/ggml-org/gpt-oss-20b-GGUF/summary | Long endpoint description | -| Models | ./v1/models | Lists the models loaded in the server slot | -| Props | ./props | Server capabilities and default sampling | -`; diff --git a/ui/apps/chat/tests/stories/fixtures/readme.ts b/ui/apps/chat/tests/stories/fixtures/readme.ts deleted file mode 100644 index e8b573d6c4e3..000000000000 --- a/ui/apps/chat/tests/stories/fixtures/readme.ts +++ /dev/null @@ -1,136 +0,0 @@ -// README Content -export const README_MD = String.raw` -# 🚀 Awesome Web Framework - -[![npm version](https://img.shields.io/npm/v/awesome-framework.svg)](https://www.npmjs.com/package/awesome-framework) -[![Build Status](https://github.com/awesome/framework/workflows/CI/badge.svg)](https://github.com/awesome/framework/actions) -[![Coverage](https://codecov.io/gh/awesome/framework/branch/main/graph/badge.svg)](https://codecov.io/gh/awesome/framework) -[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) - -> A modern, fast, and flexible web framework for building scalable applications - -## ✨ Features - -- 🎯 **Type-Safe** - Full TypeScript support out of the box -- ⚡ **Lightning Fast** - Built on Vite for instant HMR -- 📦 **Zero Config** - Works out of the box for most use cases -- 🎨 **Flexible** - Unopinionated with sensible defaults -- 🔧 **Extensible** - Plugin system for custom functionality -- 📱 **Responsive** - Mobile-first approach -- 🌍 **i18n Ready** - Built-in internationalization -- 🔒 **Secure** - Security best practices by default - -## 📦 Installation - -${'```'}bash -npm install awesome-framework -# or -yarn add awesome-framework -# or -pnpm add awesome-framework -${'```'} - -## 🚀 Quick Start - -### Create a new project - -${'```'}bash -npx create-awesome-app my-app -cd my-app -npm run dev -${'```'} - -### Basic Example - -${'```'}javascript -import { createApp } from 'awesome-framework'; - -const app = createApp({ - port: 3000, - middleware: ['cors', 'helmet', 'compression'] -}); - -app.get('/', (req, res) => { - res.json({ message: 'Hello World!' }); -}); - -app.listen(() => { - console.log('Server running on http://localhost:3000'); -}); -${'```'} - -## 📖 Documentation - -### Core Concepts - -- [Getting Started](https://docs.awesome.dev/getting-started) -- [Configuration](https://docs.awesome.dev/configuration) -- [Routing](https://docs.awesome.dev/routing) -- [Middleware](https://docs.awesome.dev/middleware) -- [Database](https://docs.awesome.dev/database) -- [Authentication](https://docs.awesome.dev/authentication) - -### Advanced Topics - -- [Performance Optimization](https://docs.awesome.dev/performance) -- [Deployment](https://docs.awesome.dev/deployment) -- [Testing](https://docs.awesome.dev/testing) -- [Security](https://docs.awesome.dev/security) - -## 🛠️ Development - -### Prerequisites - -- Node.js >= 18 -- pnpm >= 8 - -### Setup - -${'```'}bash -git clone https://github.com/awesome/framework.git -cd framework -pnpm install -pnpm dev -${'```'} - -### Testing - -${'```'}bash -pnpm test # Run unit tests -pnpm test:e2e # Run end-to-end tests -pnpm test:watch # Run tests in watch mode -${'```'} - -## 🤝 Contributing - -We welcome contributions! Please see our [Contributing Guide](CONTRIBUTING.md) for details. - -### Contributors - - - - - -## 📊 Benchmarks - -| Framework | Requests/sec | Latency (ms) | Memory (MB) | -|-----------|-------------|--------------|-------------| -| **Awesome** | **45,230** | **2.1** | **42** | -| Express | 28,450 | 3.5 | 68 | -| Fastify | 41,200 | 2.3 | 48 | -| Koa | 32,100 | 3.1 | 52 | - -*Benchmarks performed on MacBook Pro M2, Node.js 20.x* - -## 📝 License - -MIT © [Awesome Team](https://github.com/awesome) - -## 🙏 Acknowledgments - -Special thanks to all our sponsors and contributors who make this project possible. - ---- - -**[Website](https://awesome.dev)** • **[Documentation](https://docs.awesome.dev)** • **[Discord](https://discord.gg/awesome)** • **[Twitter](https://twitter.com/awesomeframework)** -`; diff --git a/ui/apps/chat/tests/stories/fixtures/storybook-mocks.ts b/ui/apps/chat/tests/stories/fixtures/storybook-mocks.ts deleted file mode 100644 index 41a1a8a49aee..000000000000 --- a/ui/apps/chat/tests/stories/fixtures/storybook-mocks.ts +++ /dev/null @@ -1,87 +0,0 @@ -import { serverStore } from '#lib/stores/llama-server.svelte.ts'; -import { modelsStore } from '#lib/stores/models/index.svelte.ts'; - -/** - * Mock server properties for Storybook testing - * This utility allows setting mock server configurations without polluting production code - */ -export function mockServerProps(props: Partial): void { - // Reset any pointer-events from previous tests (dropdown cleanup) - const body = document.querySelector('body'); - - if (body) body.style.pointerEvents = ''; - - // Directly set the props for testing purposes - (serverStore as unknown as { props: ApiLlamaCppServerProps }).props = { - modalities: { - audio: props.modalities?.audio ?? false, - video: props.modalities?.video ?? false, - vision: props.modalities?.vision ?? false - }, - model_path: props.model_path || 'test-model', - ...props - } as ApiLlamaCppServerProps; - - // Set router mode role so activeModelId can be set - (serverStore as unknown as { props: ApiLlamaCppServerProps }).props.role = 'ROUTER'; - - // Also mock modelsStore methods for modality checking - const vision = props.modalities?.vision ?? false; - const audio = props.modalities?.audio ?? false; - const video = props.modalities?.video ?? false; - - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (modelsStore as any).modelSupportsVision = () => vision; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (modelsStore as any).modelSupportsAudio = () => audio; - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (modelsStore as any).modelSupportsVideo = () => video; - - // Mock models list with a test model so activeModelId can be resolved - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (modelsStore as any).models = [ - { - id: 'test-model', - model: 'test-model', - name: 'Test Model' - } - ]; - - // Mock selectedModelId - // eslint-disable-next-line @typescript-eslint/no-explicit-any - (modelsStore as any).selectedModelId = 'test-model'; -} - -/** - * Reset server store to clean state for testing - */ -export function resetServerStore(): void { - (serverStore as unknown as { props: ApiLlamaCppServerProps }).props = { - modalities: { - audio: false, - video: false, - vision: false - }, - model_path: '' - } as ApiLlamaCppServerProps; - (serverStore as unknown as { error: string }).error = ''; - (serverStore as unknown as { loading: boolean }).loading = false; -} - -/** - * Common mock configurations for Storybook stories - */ -export const mockConfigs = { - audioOnly: { - modalities: { audio: true, vision: false } - }, - bothModalities: { - modalities: { audio: true, vision: true } - }, - noModalities: { - modalities: { audio: false, video: false, vision: false } - }, - visionOnly: { - modalities: { audio: false, vision: true } - } -} as const; diff --git a/ui/apps/chat/tests/stories/forms/HighlightedMatch.stories.svelte b/ui/apps/chat/tests/stories/forms/HighlightedMatch.stories.svelte new file mode 100644 index 000000000000..9eb502f47fc3 --- /dev/null +++ b/ui/apps/chat/tests/stories/forms/HighlightedMatch.stories.svelte @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/forms/InputWithSuggestions.stories.svelte b/ui/apps/chat/tests/stories/forms/InputWithSuggestions.stories.svelte new file mode 100644 index 000000000000..57f4e8feed56 --- /dev/null +++ b/ui/apps/chat/tests/stories/forms/InputWithSuggestions.stories.svelte @@ -0,0 +1,68 @@ + + + + + + + + + +
+ +
+
+ + + + +
+
diff --git a/ui/apps/chat/tests/stories/forms/KeyValuePairs.stories.svelte b/ui/apps/chat/tests/stories/forms/KeyValuePairs.stories.svelte new file mode 100644 index 000000000000..50e6a7e37adf --- /dev/null +++ b/ui/apps/chat/tests/stories/forms/KeyValuePairs.stories.svelte @@ -0,0 +1,47 @@ + + + + + + + + (pairs = next)} + {pairs} + sectionLabel="Headers" + /> + + + + (emptyPairs = next)} + pairs={emptyPairs} + sectionLabel="Headers" + /> + + + diff --git a/ui/apps/chat/tests/stories/foundations/Brand.stories.svelte b/ui/apps/chat/tests/stories/foundations/Brand.stories.svelte new file mode 100644 index 000000000000..23f9fbd3aa30 --- /dev/null +++ b/ui/apps/chat/tests/stories/foundations/Brand.stories.svelte @@ -0,0 +1,18 @@ + + + + + diff --git a/ui/apps/chat/tests/stories/foundations/SafeAreas.stories.svelte b/ui/apps/chat/tests/stories/foundations/SafeAreas.stories.svelte new file mode 100644 index 000000000000..d2d37842e588 --- /dev/null +++ b/ui/apps/chat/tests/stories/foundations/SafeAreas.stories.svelte @@ -0,0 +1,86 @@ + + +{#snippet phone(content: () => ReturnType)} +
+ {@render content()} + + +
+ status bar · --safe-area-top +
+ +
+ home indicator · --safe-area-bottom +
+
+{/snippet} + +{#snippet unpadded()} +
+

Page title under the status bar

+ +

Bottom bar over the home indicator

+
+{/snippet} + +{#snippet page()} +
+

Page title, 3rem below the status bar

+ +

+ Bottom bar, clear of the home indicator +

+
+{/snippet} + +{#snippet sheet()} +
+

Type a message...

+ + + + ⤡ + +
+{/snippet} + + + + + {@render phone(unpadded)} + + + + {@render phone(page)} + + + + {@render phone(sheet)} + + + diff --git a/ui/apps/chat/tests/stories/helpers/StateGallery.svelte b/ui/apps/chat/tests/stories/helpers/StateGallery.svelte new file mode 100644 index 000000000000..30399e9a01b9 --- /dev/null +++ b/ui/apps/chat/tests/stories/helpers/StateGallery.svelte @@ -0,0 +1,52 @@ + + + +
+ {#if title} +

{title}

+ {/if} + + +
+ {@render children()} +
+
diff --git a/ui/apps/chat/tests/stories/helpers/StateGalleryItem.svelte b/ui/apps/chat/tests/stories/helpers/StateGalleryItem.svelte new file mode 100644 index 000000000000..005bea0017c8 --- /dev/null +++ b/ui/apps/chat/tests/stories/helpers/StateGalleryItem.svelte @@ -0,0 +1,35 @@ + + + +
+
+ {label} + + {#if note} + {note} + {/if} +
+ +
+ {@render children()} +
+
diff --git a/ui/apps/chat/tests/stories/introduction/Introduction.stories.svelte b/ui/apps/chat/tests/stories/introduction/Introduction.stories.svelte new file mode 100644 index 000000000000..a0eb2594a301 --- /dev/null +++ b/ui/apps/chat/tests/stories/introduction/Introduction.stories.svelte @@ -0,0 +1,20 @@ + + + + + + + diff --git a/ui/apps/chat/tests/stories/introduction/Introduction.svx b/ui/apps/chat/tests/stories/introduction/Introduction.svx new file mode 100644 index 000000000000..ff870aa640cc --- /dev/null +++ b/ui/apps/chat/tests/stories/introduction/Introduction.svx @@ -0,0 +1,60 @@ + + + + +

Llama · Storybook

+ +# Introduction + +

This is where Llama UI and Llama Chat are designed, built and checked. Everything in it is the real component, font or file, so what you see here is what ships. The Llama Brand and the communications made with it have their own Storybook, in llama-brand.

+ +## In short + +The component library **Llama UI**, built on the **Llama Brand** (the icon, Llama Sans and Llama Mono, the colours), and the app **Llama Chat** built from it, in one place, for the people and agents who design and build Llama products. + +
+ +
+ +## What it's for + +
+ +
+ +## How we think + +
+ +
+ +## How it fits together + +
+ +
+ +Inside Llama UI, the tokens go from primitives to semantic roles to components, in `ui/lib/ui/src/lib/styles/tokens/`, and `DESIGN.md` is generated from them. Llama UI draws the interface and handles interaction; each app owns its own state. + +## How it's laid out + +
+ +
+ +## Working in it + +- Run it with `npm run storybook` in `ui/apps/chat`. +- Pages that are mostly prose, like this one, are `.svx`: Markdown with Svelte components in it. `AGENTS.md` says how to write them. +- Where a guideline and a story disagree, the story is right: it's the real thing. diff --git a/ui/apps/chat/tests/stories/introduction/Principles.svelte b/ui/apps/chat/tests/stories/introduction/Principles.svelte new file mode 100644 index 000000000000..326b03a6ed94 --- /dev/null +++ b/ui/apps/chat/tests/stories/introduction/Principles.svelte @@ -0,0 +1,228 @@ + + + +
+
+
+
+
+ +
+ + + + + +
+
+ +

Personal, on hardware you already have

+ +

Private by default, and open to everyone.

+
+ +
+
+
+ Recommended + + Reads, sees and hears + + +
+
+ +

Simple by default

+ +

Choices made for you to start; every setting when you want it.

+
+ +
+
+ + + Aa + + +
+ +

Recognisable, easy to change

+ +

The icon, the type, one accent. The rest is neutral.

+
+ +
+
+ +
+ +

Function first

+ +

Every element has a job and a reason for its size.

+
+ +
+
+ --neutral-900 + + + + --action-primary + + + + --button-primary-background +
+ +

Design lives in code

+ +

Change a primitive and the rest follows.

+
+
+ + diff --git a/ui/apps/chat/tests/stories/introduction/Products.svelte b/ui/apps/chat/tests/stories/introduction/Products.svelte new file mode 100644 index 000000000000..88827eb2f877 --- /dev/null +++ b/ui/apps/chat/tests/stories/introduction/Products.svelte @@ -0,0 +1,343 @@ + + + +
+
+
+ ggml-org/llama-brand + + The source +
+ +

llama-brand

+ +

The fonts, the logo and the brand files, generated by its own scripts.

+ +
+ {#each ['Llama Sans', 'Llama Mono', 'The icon', 'Lockups', 'App icons'] as tag (tag)} + {tag} + {/each} +
+
+ + + + + +
+
+ ggml-org/llama.cpp +
+ +

llama.cpp

+ +
+
+ The engine + + llama-server: models on your own machine, behind an API +
+ +
+ Llama UI → Llama Chat + + ui/lib/ui: the components. ui/apps/chat: the chat client the + server bundles +
+
+
+ + + +
+
+ The native Llama apps +
+ +
+

Llama for Mac

+ + ggml-org/Llama-macOS + + A menu bar app, in Swift +
+ +
+

Llama for Windows

+ + ggml-org/Llama-Windows + + A tray app, in WinUI 3 and C#, ported from the Mac app +
+
+
+ + diff --git a/ui/apps/chat/tests/stories/introduction/Sections.svelte b/ui/apps/chat/tests/stories/introduction/Sections.svelte new file mode 100644 index 000000000000..568b5ac1950e --- /dev/null +++ b/ui/apps/chat/tests/stories/introduction/Sections.svelte @@ -0,0 +1,182 @@ + + + +
    + {#each sections as section (section.name)} +
  1. + + {#if section.icon} + + +
    +

    + {section.name} + + {#if section.here}You are here{/if} +

    + +

    {section.holds}

    + + {#if section.pages.length} +
      + {#each section.pages as page (page)} +
    • {page}
    • + {/each} +
    + {/if} +
    +
  2. + {/each} +
+ + diff --git a/ui/apps/chat/tests/stories/introduction/Stack.svelte b/ui/apps/chat/tests/stories/introduction/Stack.svelte new file mode 100644 index 000000000000..dc0564852488 --- /dev/null +++ b/ui/apps/chat/tests/stories/introduction/Stack.svelte @@ -0,0 +1,129 @@ + +
+
+ 03 + +

Llama Chat

+ +

The app, built from Llama UI

+
+ +
+

Other apps

+ +

Yours, built on Llama UI

+
+ +
+

Communications

+ +

Posts, store screenshots, link previews and swag, made from the brand and the app

+
+ +
+ 02 + +

Llama UI

+ +

The components and their tokens

+
+ +
+ 01 + + +

Llama Brand

+ +

The icon, Llama Sans and Llama Mono, the colours

+
+
+ + diff --git a/ui/apps/chat/tests/stories/introduction/Uses.svelte b/ui/apps/chat/tests/stories/introduction/Uses.svelte new file mode 100644 index 000000000000..4c10841d7fe4 --- /dev/null +++ b/ui/apps/chat/tests/stories/introduction/Uses.svelte @@ -0,0 +1,80 @@ + + + +
+ {#each uses as use (use.name)} +
+ + + +

{use.name}

+ +

{use.line}

+
+ {/each} +
+ + diff --git a/ui/apps/chat/tests/stories/mcp/McpCapabilitiesBadges.stories.svelte b/ui/apps/chat/tests/stories/mcp/McpCapabilitiesBadges.stories.svelte new file mode 100644 index 000000000000..695c680e1b05 --- /dev/null +++ b/ui/apps/chat/tests/stories/mcp/McpCapabilitiesBadges.stories.svelte @@ -0,0 +1,15 @@ + + + console.log('browse') }} name="Default" /> diff --git a/ui/apps/chat/tests/stories/mcp/McpConnectionLogs.stories.svelte b/ui/apps/chat/tests/stories/mcp/McpConnectionLogs.stories.svelte new file mode 100644 index 000000000000..289afe7435a3 --- /dev/null +++ b/ui/apps/chat/tests/stories/mcp/McpConnectionLogs.stories.svelte @@ -0,0 +1,18 @@ + + + diff --git a/ui/apps/chat/tests/stories/mcp/McpServerCard.stories.svelte b/ui/apps/chat/tests/stories/mcp/McpServerCard.stories.svelte new file mode 100644 index 000000000000..bd7c8b21861a --- /dev/null +++ b/ui/apps/chat/tests/stories/mcp/McpServerCard.stories.svelte @@ -0,0 +1,41 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/mcp/fixtures.ts b/ui/apps/chat/tests/stories/mcp/fixtures.ts new file mode 100644 index 000000000000..06f39e137282 --- /dev/null +++ b/ui/apps/chat/tests/stories/mcp/fixtures.ts @@ -0,0 +1,109 @@ +import { + HealthCheckStatus, + MCPConnectionPhase, + MCPLogLevel, + MCPTransportType +} from '#lib/enums/index.ts'; +import { mcpStore } from '#lib/stores/index.ts'; +import type { + HealthCheckState, + MCPCapabilitiesInfo, + MCPConnectionLog, + MCPServerSettingsEntry +} from '#lib/types/index.ts'; + +const startedAt = new Date('2026-10-29T09:00:00Z'); +const log = ( + offsetMs: number, + phase: MCPConnectionPhase, + message: string, + level = MCPLogLevel.INFO +): MCPConnectionLog => ({ + level, + message, + phase, + timestamp: new Date(startedAt.getTime() + offsetMs) +}); + +export const connectionLogs: MCPConnectionLog[] = [ + log(0, MCPConnectionPhase.TRANSPORT_CREATING, 'Creating streamable HTTP transport'), + log(42, MCPConnectionPhase.TRANSPORT_READY, 'Transport ready'), + log(118, MCPConnectionPhase.INITIALIZING, 'Sending initialize request'), + log(204, MCPConnectionPhase.CAPABILITIES_EXCHANGED, 'Negotiated protocol 2025-06-18'), + log(266, MCPConnectionPhase.LISTING_TOOLS, 'Listing tools'), + log(301, MCPConnectionPhase.CONNECTED, 'Connected with 3 tools') +]; + +export const errorLogs: MCPConnectionLog[] = [ + log(0, MCPConnectionPhase.TRANSPORT_CREATING, 'Creating streamable HTTP transport'), + log(5_000, MCPConnectionPhase.ERROR, 'Request timed out after 5000 ms', MCPLogLevel.ERROR) +]; + +export const capabilities: MCPCapabilitiesInfo = { + client: { elicitation: { form: true }, roots: { listChanged: true }, sampling: true }, + server: { + completions: true, + logging: true, + prompts: { listChanged: true }, + resources: { listChanged: true, subscribe: true }, + tools: { listChanged: true } + } +}; + +const server = (id: string, name: string, enabled = true): MCPServerSettingsEntry => ({ + displayName: name, + enabled, + id, + url: `https://${id}.example.com/mcp` +}); + +export const servers = { + connected: server('docs', 'Docs search'), + connecting: server('files', 'Filesystem'), + disabled: server('weather', 'Weather', false), + error: server('tracker', 'Issue tracker') +}; + +const states: Record = { + [servers.connected.id]: { + capabilities, + connectionTimeMs: 301, + logs: connectionLogs, + protocolVersion: '2025-06-18', + serverInfo: { name: 'docs-search', version: '1.4.0' }, + status: HealthCheckStatus.SUCCESS, + tools: [ + { description: 'Full text search over the docs', name: 'search_docs' }, + { description: 'Fetch one page by path', name: 'get_page' }, + { description: 'List the table of contents', name: 'list_sections' } + ], + transportType: MCPTransportType.STREAMABLE_HTTP + }, + [servers.connecting.id]: { + logs: connectionLogs.slice(0, 3), + phase: MCPConnectionPhase.INITIALIZING, + status: HealthCheckStatus.CONNECTING + }, + [servers.error.id]: { + logs: errorLogs, + message: 'Request timed out after 5000 ms', + phase: MCPConnectionPhase.ERROR, + status: HealthCheckStatus.ERROR + } +}; + +// health states normally come from a live probe; the setter is private, so reach it directly +type HealthAccess = { + health: { clear: (id: string) => void; setState: (id: string, state: HealthCheckState) => void }; +}; + +/** Seeds one health state per fixture server; returns the cleanup. */ +export function seedServerHealth(): () => void { + const { health } = mcpStore as unknown as HealthAccess; + + for (const [id, state] of Object.entries(states)) health.setState(id, state); + + return () => { + for (const id of Object.keys(states)) health.clear(id); + }; +} diff --git a/ui/apps/chat/tests/stories/misc/CollapsibleSection.stories.svelte b/ui/apps/chat/tests/stories/misc/CollapsibleSection.stories.svelte new file mode 100644 index 000000000000..886612b62f2f --- /dev/null +++ b/ui/apps/chat/tests/stories/misc/CollapsibleSection.stories.svelte @@ -0,0 +1,37 @@ + + + + + {#each [true, false] as defaultOpen (defaultOpen)} + + + {#snippet trigger()} + Pinned + {/snippet} + +
    +
  • Explain quantization
  • + +
  • Rust borrow checker notes
  • + +
  • Trip plan for Lisbon
  • +
+
+
+ {/each} +
+
diff --git a/ui/apps/chat/tests/stories/misc/KeyboardShortcutInfo.stories.svelte b/ui/apps/chat/tests/stories/misc/KeyboardShortcutInfo.stories.svelte new file mode 100644 index 000000000000..c9c1dbb8bfd0 --- /dev/null +++ b/ui/apps/chat/tests/stories/misc/KeyboardShortcutInfo.stories.svelte @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/a11y/ScrollCarousel.a11y.stories.svelte b/ui/apps/chat/tests/stories/misc/ScrollCarousel.a11y.stories.svelte similarity index 91% rename from ui/apps/chat/tests/stories/a11y/ScrollCarousel.a11y.stories.svelte rename to ui/apps/chat/tests/stories/misc/ScrollCarousel.a11y.stories.svelte index 0b91f1914702..12c777ccaaf5 100644 --- a/ui/apps/chat/tests/stories/a11y/ScrollCarousel.a11y.stories.svelte +++ b/ui/apps/chat/tests/stories/misc/ScrollCarousel.a11y.stories.svelte @@ -10,7 +10,7 @@ layout: 'centered' }, tags: ['!dev'], - title: 'Components/ScrollCarousel/Accessibility' + title: 'Llama Chat/Misc/ScrollCarousel/Accessibility' }); @@ -36,9 +36,9 @@ -
+
-
+
diff --git a/ui/apps/chat/tests/stories/misc/ScrollCarousel.stories.svelte b/ui/apps/chat/tests/stories/misc/ScrollCarousel.stories.svelte new file mode 100644 index 000000000000..856800ecb113 --- /dev/null +++ b/ui/apps/chat/tests/stories/misc/ScrollCarousel.stories.svelte @@ -0,0 +1,36 @@ + + + + + {#each [ScrollCarouselVariant.TOP, ScrollCarouselVariant.CENTER] as variant (variant)} + + + {#each items as item (item)} +
+ {item} +
+ {/each} +
+
+ {/each} +
+
diff --git a/ui/apps/chat/tests/stories/misc/TruncatedText.stories.svelte b/ui/apps/chat/tests/stories/misc/TruncatedText.stories.svelte new file mode 100644 index 000000000000..119dbb57c5c9 --- /dev/null +++ b/ui/apps/chat/tests/stories/misc/TruncatedText.stories.svelte @@ -0,0 +1,31 @@ + + + + + +
+ +
+
+ + +
+ +
+
+
+
diff --git a/ui/apps/chat/tests/stories/a11y/ModelsManager.a11y.stories.svelte b/ui/apps/chat/tests/stories/models/ModelsManager.a11y.stories.svelte similarity index 95% rename from ui/apps/chat/tests/stories/a11y/ModelsManager.a11y.stories.svelte rename to ui/apps/chat/tests/stories/models/ModelsManager.a11y.stories.svelte index d5b116de9201..af9fc9b041e3 100644 --- a/ui/apps/chat/tests/stories/a11y/ModelsManager.a11y.stories.svelte +++ b/ui/apps/chat/tests/stories/models/ModelsManager.a11y.stories.svelte @@ -10,7 +10,7 @@ layout: 'centered' }, tags: ['!dev'], - title: 'Components/ModelsManager/Accessibility' + title: 'Llama Chat/Models/ModelsManager/Accessibility' }); const option: ModelOption = { diff --git a/ui/apps/chat/tests/stories/ModelsManager.stories.svelte b/ui/apps/chat/tests/stories/models/ModelsManager.stories.svelte similarity index 82% rename from ui/apps/chat/tests/stories/ModelsManager.stories.svelte rename to ui/apps/chat/tests/stories/models/ModelsManager.stories.svelte index 4f09345f0b12..c030f36094d7 100644 --- a/ui/apps/chat/tests/stories/ModelsManager.stories.svelte +++ b/ui/apps/chat/tests/stories/models/ModelsManager.stories.svelte @@ -14,7 +14,7 @@ parameters: { layout: 'fullscreen' }, - title: 'Components/ModelsManager' + title: 'Llama Chat/Models/ModelsManager' }); const option = (model: string, name: string, contextLength?: number): ModelOption => ({ @@ -71,7 +71,7 @@ const isFavorite = (picked: ModelOption) => modelsStore.favoriteModelIds.has(picked.model); - +
- - -
- (selectedId = picked.id)} - {selectedId} - /> -
-
- - -
- (selectedId = picked.id)} - {selectedId} - /> -
-
diff --git a/ui/apps/chat/tests/stories/models/ModelsSelector.stories.svelte b/ui/apps/chat/tests/stories/models/ModelsSelector.stories.svelte new file mode 100644 index 000000000000..3aa5c6045df4 --- /dev/null +++ b/ui/apps/chat/tests/stories/models/ModelsSelector.stories.svelte @@ -0,0 +1,98 @@ + + + + + +
+ +
+
diff --git a/ui/apps/chat/tests/stories/SidebarNavigation.stories.svelte b/ui/apps/chat/tests/stories/navigation/SidebarNavigation.stories.svelte similarity index 58% rename from ui/apps/chat/tests/stories/SidebarNavigation.stories.svelte rename to ui/apps/chat/tests/stories/navigation/SidebarNavigation.stories.svelte index a759fe16b81d..8c4f05ca8098 100644 --- a/ui/apps/chat/tests/stories/SidebarNavigation.stories.svelte +++ b/ui/apps/chat/tests/stories/navigation/SidebarNavigation.stories.svelte @@ -1,16 +1,14 @@ @@ -67,46 +65,3 @@
- - { - const { conversationsStore } = await import('#lib/stores/conversations/index.svelte.ts'); - - waitFor(() => - setTimeout(() => { - conversationsStore.conversations = mockConversations; - }, 0) - ); - - // Expand sidebar first, then click Search in the expanded button list - const logoTrigger = screen.getByRole('button', { name: /expand navigation/i }); - - await userEvent.click(logoTrigger); - const searchTrigger = screen.getByText('Search'); - - await userEvent.click(searchTrigger); - - await expect(await screen.findByRole('combobox')).toHaveFocus(); - }} -> -
- -
-
- - { - // Mock empty conversations store - const { conversationsStore } = await import('#lib/stores/conversations/index.svelte.ts'); - - conversationsStore.conversations = []; - }} -> -
- -
-
diff --git a/ui/apps/chat/tests/stories/a11y/SidebarNavigationConversationItem.a11y.stories.svelte b/ui/apps/chat/tests/stories/navigation/SidebarNavigationConversationItem.a11y.stories.svelte similarity index 92% rename from ui/apps/chat/tests/stories/a11y/SidebarNavigationConversationItem.a11y.stories.svelte rename to ui/apps/chat/tests/stories/navigation/SidebarNavigationConversationItem.a11y.stories.svelte index b607b4ff014a..349013fced1b 100644 --- a/ui/apps/chat/tests/stories/a11y/SidebarNavigationConversationItem.a11y.stories.svelte +++ b/ui/apps/chat/tests/stories/navigation/SidebarNavigationConversationItem.a11y.stories.svelte @@ -17,7 +17,7 @@ layout: 'centered' }, tags: ['!dev'], - title: 'Components/SidebarNavigationConversationItem/Accessibility' + title: 'Llama Chat/Navigation/SidebarNavigationConversationItem/Accessibility' }); diff --git a/ui/apps/chat/tests/stories/pace.ts b/ui/apps/chat/tests/stories/pace.ts new file mode 100644 index 000000000000..c042f4d51abc --- /dev/null +++ b/ui/apps/chat/tests/stories/pace.ts @@ -0,0 +1,37 @@ +import { userEvent } from 'storybook/test'; + +/** Toolbar values of the `interactionPace` global, see .storybook/preview.ts. */ +export enum InteractionPace { + HUMAN = 'human', + INSTANT = 'instant' +} + +export interface Pace { + /** Delay between streamed reply chunks of a fake server. */ + streamChunkMs: number; + /** Waits before the next action, as if reading the screen first. */ + pause: (ms?: number) => Promise; + /** A user-event instance that types key by key at the chosen pace. */ + user: ReturnType; +} + +// the test runner drives a Playwright browser, which always plays stories at full speed +const isTestRun = typeof navigator !== 'undefined' && navigator.webdriver; +const HUMAN = { beforeActionMs: 900, streamChunkMs: 110, typingMs: 55 }; +const INSTANT = { beforeActionMs: 0, streamChunkMs: 30, typingMs: 0 }; + +/** + * Pace for a story's `beforeEach` or `play`: human in the Storybook UI (unless the + * toolbar says instant), instant in the test suite. + */ +export function getPace(context: { globals?: Record }): Pace { + const human = !isTestRun && context.globals?.interactionPace !== InteractionPace.INSTANT; + const timings = human ? HUMAN : INSTANT; + + return { + pause: (ms = timings.beforeActionMs) => + ms > 0 ? new Promise((resolve) => setTimeout(resolve, ms)) : Promise.resolve(), + streamChunkMs: timings.streamChunkMs, + user: userEvent.setup({ delay: timings.typingMs }) + }; +} diff --git a/ui/apps/chat/tests/stories/pwa/PwaRefreshAlert.stories.svelte b/ui/apps/chat/tests/stories/pwa/PwaRefreshAlert.stories.svelte new file mode 100644 index 000000000000..85d574104476 --- /dev/null +++ b/ui/apps/chat/tests/stories/pwa/PwaRefreshAlert.stories.svelte @@ -0,0 +1,31 @@ + + + console.log('reload') }} + name="Default" + play={async ({ canvas }) => { + const title = canvas.getByText('Update available'); + + await expect(title).toBeInTheDocument(); + + const description = canvas.getByText(/A new version is available/); + + await expect(description).toBeInTheDocument(); + + const button = canvas.getByRole('button', { name: 'Reload' }); + + await expect(button).toBeInTheDocument(); + }} +/> diff --git a/ui/apps/chat/tests/stories/servers/ServerSplash.stories.svelte b/ui/apps/chat/tests/stories/servers/ServerSplash.stories.svelte new file mode 100644 index 000000000000..6b34ae95213b --- /dev/null +++ b/ui/apps/chat/tests/stories/servers/ServerSplash.stories.svelte @@ -0,0 +1,31 @@ + + + + + + + + + + console.log('retry')} + /> + + + diff --git a/ui/apps/chat/tests/stories/settings/DialogSettingsChat.stories.svelte b/ui/apps/chat/tests/stories/settings/DialogSettingsChat.stories.svelte new file mode 100644 index 000000000000..eac7c7410a6b --- /dev/null +++ b/ui/apps/chat/tests/stories/settings/DialogSettingsChat.stories.svelte @@ -0,0 +1,26 @@ + + + + + + diff --git a/ui/apps/chat/tests/stories/settings/SettingsNavigation.stories.svelte b/ui/apps/chat/tests/stories/settings/SettingsNavigation.stories.svelte new file mode 100644 index 000000000000..0aa3d97272f7 --- /dev/null +++ b/ui/apps/chat/tests/stories/settings/SettingsNavigation.stories.svelte @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/settings/SettingsSections.stories.svelte b/ui/apps/chat/tests/stories/settings/SettingsSections.stories.svelte new file mode 100644 index 000000000000..24b2c5c13b9b --- /dev/null +++ b/ui/apps/chat/tests/stories/settings/SettingsSections.stories.svelte @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + diff --git a/ui/apps/chat/tests/stories/svx.d.ts b/ui/apps/chat/tests/stories/svx.d.ts new file mode 100644 index 000000000000..88dce604475c --- /dev/null +++ b/ui/apps/chat/tests/stories/svx.d.ts @@ -0,0 +1,6 @@ +// .svx pages (mdsvex) import as Svelte components +declare module '*.svx' { + import type { Component } from 'svelte'; + const page: Component; + export default page; +} diff --git a/ui/apps/chat/vite.config.ts b/ui/apps/chat/vite.config.ts index 7f24f5963876..5c69a43c078e 100644 --- a/ui/apps/chat/vite.config.ts +++ b/ui/apps/chat/vite.config.ts @@ -13,7 +13,7 @@ import { playwright } from '@vitest/browser-playwright'; import { mdsvex } from 'mdsvex'; import { dirname, resolve } from 'path'; import { fileURLToPath } from 'url'; -import { defineConfig, loadEnv, searchForWorkspaceRoot } from 'vite'; +import { defineConfig, loadEnv, type ProxyOptions, searchForWorkspaceRoot } from 'vite'; const __dirname = dirname(fileURLToPath(import.meta.url)); // eslint-disable-next-line @typescript-eslint/no-explicit-any @@ -35,6 +35,18 @@ const outDir = process.env.LLAMA_UI_OUT_DIR ?? './dist'; export default defineConfig(({ mode }) => { const env = loadEnv(mode, process.cwd(), 'VITE_PUBLIC_'); const SERVER_ORIGIN = env.VITE_PUBLIC_SERVER_ORIGIN || 'http://localhost:9931'; + // llama-server takes cross-origin browser requests only from --cors-origins, so the proxy + // calls it as its own page: the Host of the server and no Origin. Sec-Fetch-Site still + // passes through, so the server keeps refusing requests from other sites. + const toServer = (ws = false): ProxyOptions => ({ + changeOrigin: true, + configure: (proxy) => { + proxy.on('proxyReq', (req) => req.removeHeader('origin')); + proxy.on('proxyReqWs', (req) => req.removeHeader('origin')); + }, + target: SERVER_ORIGIN, + ws + }); return { build: { @@ -90,12 +102,12 @@ export default defineConfig(({ mode }) => { 'Cross-Origin-Opener-Policy': 'same-origin' }, proxy: { - '/cors-proxy': SERVER_ORIGIN, - '/models': SERVER_ORIGIN, - '/props': SERVER_ORIGIN, - '/slots': SERVER_ORIGIN, - '/tools': SERVER_ORIGIN, - '/v1': SERVER_ORIGIN + '/cors-proxy': toServer(), + '/models': toServer(), + '/props': toServer(), + '/slots': toServer(), + '/tools': toServer(), + '/v1': toServer() } }, @@ -129,6 +141,8 @@ export default defineConfig(({ mode }) => { ], test: { browser: { ...browserBaseConfig, instances: [{ browser: 'chromium', headless: true }] }, + // Llama UI's stories, shown in this Storybook too, are tested by the library itself (ui/lib/ui) + exclude: ['../../lib/ui/tests/**'], name: 'ui' } } diff --git a/ui/lib/ui/.gitignore b/ui/lib/ui/.gitignore index cd8a373ca9d6..1409f221aac9 100644 --- a/ui/lib/ui/.gitignore +++ b/ui/lib/ui/.gitignore @@ -24,3 +24,5 @@ vite.config.js.timestamp-* vite.config.ts.timestamp-* .vitest/ +*storybook.log +storybook-static diff --git a/ui/lib/ui/.storybook/color-scheme.ts b/ui/lib/ui/.storybook/color-scheme.ts new file mode 100644 index 000000000000..3b5feab66f74 --- /dev/null +++ b/ui/lib/ui/.storybook/color-scheme.ts @@ -0,0 +1,12 @@ +/** + * Sets the `dark` class from the saved mode-watcher mode, or the system preference + * when there is none. Docs pages render no story, so preview.ts calls this too. + */ +export function applyColorScheme() { + const mode = localStorage.getItem('mode-watcher-mode') || 'system'; + const isDark = + mode === 'dark' || + (mode === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches); + + document.documentElement.classList.toggle('dark', isDark); +} diff --git a/ui/lib/ui/.storybook/decorators/ModeWatcherDecorator.svelte b/ui/lib/ui/.storybook/decorators/ModeWatcherDecorator.svelte new file mode 100644 index 000000000000..a20701dd6a20 --- /dev/null +++ b/ui/lib/ui/.storybook/decorators/ModeWatcherDecorator.svelte @@ -0,0 +1,26 @@ + + +{#if !forced}{/if} + +{#if children} + {@const Component = children} + + +{/if} diff --git a/ui/lib/ui/.storybook/decorators/TooltipProviderDecorator.svelte b/ui/lib/ui/.storybook/decorators/TooltipProviderDecorator.svelte new file mode 100644 index 000000000000..ba0cabc56185 --- /dev/null +++ b/ui/lib/ui/.storybook/decorators/TooltipProviderDecorator.svelte @@ -0,0 +1,13 @@ + + + + {@render children()} + diff --git a/ui/lib/ui/.storybook/docs.css b/ui/lib/ui/.storybook/docs.css new file mode 100644 index 000000000000..4a2f1facc078 --- /dev/null +++ b/ui/lib/ui/.storybook/docs.css @@ -0,0 +1,91 @@ +@reference '../src/app.css'; + +/* + * MDX pages that wrap their content in
drop + * Storybook's docs theme and take colours, font and type roles from the design system. + */ +.sbdocs-wrapper:has(.ds-docs) { + background: var(--surface-page); +} + +.ds-docs { + @apply mx-auto max-w-3xl font-sans text-body text-fg-default; + + & :where(h1) { + @apply mb-4 text-heading; + } + + & :where(h2) { + @apply mt-10 mb-3 border-b border-line-default pb-2 text-title; + } + + & :where(h3) { + @apply mt-6 mb-2 text-body font-semibold; + } + + & :where(h4, h5, h6) { + @apply mt-4 mb-2 text-label; + } + + & :where(p, ul, ol, blockquote, table, pre) { + @apply my-3; + } + + & :where(ul) { + @apply list-disc pl-6; + } + + & :where(ol) { + @apply list-decimal pl-6; + } + + & :where(li) { + @apply my-1; + } + + & :where(strong) { + @apply font-semibold; + } + + & :where(a) { + @apply underline underline-offset-2 hover:text-fg-muted; + } + + & :where(blockquote) { + @apply border-l-2 border-line-default pl-4 text-fg-muted; + } + + /* a note that stands out from the running text: a quiet panel with the accent on its edge */ + & :where(.callout) { + @apply my-6 rounded-panel border-l-2 border-(--art-cinder) bg-surface-muted px-5 py-4; + + & > :where(p) { + @apply my-0; + } + } + + & :where(hr) { + @apply my-8 border-line-default; + } + + /* inline code only, with a selector that outranks the code the Markdown block renders */ + & :not(pre) > code { + @apply rounded-control border-0 bg-surface-code px-1 py-0.5 font-mono text-[0.875em] text-(--fg-code); + } + + & :where(pre) { + @apply overflow-x-auto rounded-panel bg-surface-code p-4 text-body-sm; + } + + & :where(table) { + @apply w-full border-collapse text-body-sm; + } + + & :where(th, td) { + @apply border-b border-line-default px-3 py-2 text-left align-top; + } + + & :where(th) { + @apply text-label; + } +} diff --git a/ui/lib/ui/.storybook/main.ts b/ui/lib/ui/.storybook/main.ts new file mode 100644 index 000000000000..b02ecc5d5a62 --- /dev/null +++ b/ui/lib/ui/.storybook/main.ts @@ -0,0 +1,25 @@ +import type { StorybookConfig } from '@storybook/sveltekit'; +import { dirname, resolve } from 'path'; +import { fileURLToPath } from 'url'; + +const __dirname = dirname(fileURLToPath(import.meta.url)); + +const config: StorybookConfig = { + stories: ['../tests/stories/**/*.mdx', '../tests/stories/**/*.stories.@(js|ts|svelte)'], + addons: [ + '@storybook/addon-svelte-csf', + '@chromatic-com/storybook', + '@storybook/addon-vitest', + '@storybook/addon-a11y', + '@storybook/addon-docs', + '@storybook/addon-mcp' + ], + framework: '@storybook/sveltekit', + viteFinal: async (config) => { + config.server = config.server || {}; + config.server.fs = config.server.fs || {}; + config.server.fs.allow = [...(config.server.fs.allow || []), resolve(__dirname, '../tests')]; + return config; + } +}; +export default config; diff --git a/ui/lib/ui/.storybook/preview.ts b/ui/lib/ui/.storybook/preview.ts new file mode 100644 index 000000000000..9994a5554ebd --- /dev/null +++ b/ui/lib/ui/.storybook/preview.ts @@ -0,0 +1,92 @@ +import type { Preview } from '@storybook/sveltekit'; +import '../src/app.css'; +import './docs.css'; +import { applyColorScheme } from './color-scheme'; +import ModeWatcherDecorator from './decorators/ModeWatcherDecorator.svelte'; +import TooltipProviderDecorator from './decorators/TooltipProviderDecorator.svelte'; + +applyColorScheme(); +window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', applyColorScheme); + +const preview: Preview = { + parameters: { + controls: { + matchers: { + color: /(background|color)$/i, + date: /Date$/i + } + }, + + backgrounds: { + disabled: true + }, + + options: { + // the package's own sections, in the order Llama Chat's Storybook (ui/apps/chat) shows them under Llama UI: + // the foundations, the base components, the app components, then the Model UI and the mockups + storySort: { + order: [ + 'Introduction', + 'Llama UI', + [ + 'Foundations', + ['Colors', 'Typography', 'Sizing', 'Shapes', 'Elevation', 'Surfaces'], + 'Components', + ['Actions', 'Forms', 'Display', 'Overlays', 'Navigation'], + 'App components', + 'Models', + 'Mockups' + ] + ] + } + }, + + a11y: { + // 'todo' - show a11y violations in the test UI only + // 'error' - fail CI on a11y violations + // 'off' - skip a11y checks entirely + test: 'todo' + } + }, + globalTypes: { + // the light surface theme: Paper (white panels on a grey page) or Matte (grey glass on white) + surface: { + description: 'Light surface theme', + toolbar: { + dynamicTitle: true, + icon: 'paintbrush', + items: [ + { title: 'Paper', value: 'paper' }, + { title: 'Matte', value: 'matte' } + ], + title: 'Surface' + } + } + }, + initialGlobals: { + surface: 'paper' + }, + decorators: [ + (story, context) => { + document.documentElement.classList.toggle('theme-matte', context.globals.surface === 'matte'); + + return story(); + }, + // `parameters.colorScheme` fixes a story to light or dark, whatever the viewer chose (a scene in a store screenshot) + (story, context) => ({ + Component: ModeWatcherDecorator, + props: { + children: story, + forced: context.parameters.colorScheme + } + }), + (story) => ({ + Component: TooltipProviderDecorator, + props: { + children: story + } + }) + ] +}; + +export default preview; diff --git a/ui/lib/ui/README.md b/ui/lib/ui/README.md index 6efb96756c86..dda22fd9d2c0 100644 --- a/ui/lib/ui/README.md +++ b/ui/lib/ui/README.md @@ -67,6 +67,8 @@ shows in the app at once and the app keeps no copy of a component or a token. Fo ## Development -- `npm run dev`: a small SvelteKit check page (`src/routes`) +- `npm run storybook`: the package's Storybook, with a story for everything it holds; the stories run as tests in + `npm test`, and Llama Chat's Storybook (in `ui/apps/chat`) shows them under Llama UI +- `npm run dev`: Storybook and a small SvelteKit check page (`src/routes`) - `npm run check`: svelte-check - `npm run prepack`: build the library into `dist/` and run publint diff --git a/ui/lib/ui/package-lock.json b/ui/lib/ui/package-lock.json index 543d49f6f4c8..6a2ddf4939ea 100644 --- a/ui/lib/ui/package-lock.json +++ b/ui/lib/ui/package-lock.json @@ -20,6 +20,13 @@ "vaul-svelte": "1.0.0-next.7" }, "devDependencies": { + "@chromatic-com/storybook": "^5.5.1", + "@storybook/addon-a11y": "^10.6.2", + "@storybook/addon-docs": "^10.6.2", + "@storybook/addon-mcp": "10.6.2", + "@storybook/addon-svelte-csf": "^5.1.5", + "@storybook/addon-vitest": "^10.6.2", + "@storybook/sveltekit": "^10.6.2", "@sveltejs/adapter-auto": "^8.0.0", "@sveltejs/kit": "^3.0.0", "@sveltejs/package": "^2.5.8", @@ -28,9 +35,11 @@ "@types/node": "^24", "@vitest/browser-playwright": "5.0.5", "@vitest/coverage-v8": "5.0.5", + "mdsvex": "0.12.7", "mode-watcher": "^1.1.0", "playwright": "^1.60.0", "publint": "^0.3.21", + "storybook": "^10.6.2", "svelte": "^5.57.1", "svelte-check": "^4.6.0", "tailwindcss": "^4.3.3", @@ -48,6 +57,13 @@ "tw-animate-css": "^1.4.0" } }, + "node_modules/@adobe/css-tools": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@adobe/css-tools/-/css-tools-4.5.0.tgz", + "integrity": "sha512-6OzddxPio9UiWTCemp4N8cYLV2ZN1ncRnV1cVGtve7dhPOtRkleRyx32GQCYSwDYgaHU3USMm84tNsvKzRCa1Q==", + "dev": true, + "license": "MIT" + }, "node_modules/@babel/code-frame": { "version": "7.29.7", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.29.7.tgz", @@ -140,124 +156,1362 @@ "dev": true, "license": "MIT" }, - "node_modules/@floating-ui/core": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz", - "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==", + "node_modules/@chromatic-com/storybook": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/@chromatic-com/storybook/-/storybook-5.5.1.tgz", + "integrity": "sha512-DOtUEBIJHmqsOWg+Hi1t5m5FTNlyzL0NpZUwQob+ex30nDvL4p+MrYctmvEqH/QT72mf9mLXbz3Uj8aoWD2OYA==", + "dev": true, "license": "MIT", "dependencies": { - "@floating-ui/utils": "^0.2.12" + "@neoconfetti/react": "^1.0.0", + "chromatic": "^18.0.1", + "jsonfile": "^6.1.0", + "strip-ansi": "^7.1.0" + }, + "engines": { + "node": ">=20.0.0", + "yarn": ">=1.22.18" + }, + "peerDependencies": { + "storybook": "^0.0.0-0 || ^10.1.0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0 || ^10.4.0-0 || ^10.5.0-0 || ^10.6.0-0 || ^11.0.0-0" } }, - "node_modules/@floating-ui/dom": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.8.0.tgz", - "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==", + "node_modules/@emnapi/core": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.9.2.tgz", + "integrity": "sha512-UC+ZhH3XtczQYfOlu3lNEkdW/p4dsJ1r/bP7H8+rhao3TTTMO1ATq/4DdIi23XuGoFY+Cz0JmCbdVl0hz9jZcA==", + "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@floating-ui/core": "^1.8.0", - "@floating-ui/utils": "^0.2.12" + "@emnapi/wasi-threads": "1.2.1", + "tslib": "^2.4.0" } }, - "node_modules/@floating-ui/utils": { - "version": "0.2.12", - "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.12.tgz", - "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", - "license": "MIT" - }, - "node_modules/@ggml-org/llama-brand": { - "version": "0.1.0", - "resolved": "https://codeload.github.com/ggml-org/llama-brand/tar.gz/f05540643c1ca2a18d732ed6491c839686da9a3a", - "integrity": "sha512-kRDXUIUdfcDt7w4hh3JrFTpqxf2i7R0PHVLGnwUdr4L8EMqE32mEECoXUz1uoUlFaQ+h6QaVHvJWS5y98AoaYA==", - "license": "CC-BY-NC-4.0" - }, - "node_modules/@internationalized/date": { - "version": "3.12.4", - "resolved": "https://registry.npmjs.org/@internationalized/date/-/date-3.12.4.tgz", - "integrity": "sha512-M1dEn4c1U1HsSlaVR8upZtSqvXrTkHDfv18H01uCSJyjVLDxnBR38v/fMxecmlwXKR4i9HeZcmgQAPE6A+aGJQ==", - "license": "Apache-2.0", + "node_modules/@emnapi/runtime": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.9.2.tgz", + "integrity": "sha512-3U4+MIWHImeyu1wnmVygh5WlgfYDtyf0k8AbLhMFxOipihf6nrWC4syIm/SwEeec0mNSafiiNnMJwbza/Is6Lw==", + "dev": true, + "license": "MIT", + "optional": true, "dependencies": { - "@swc/helpers": "^0.5.0" + "tslib": "^2.4.0" } }, - "node_modules/@jridgewell/gen-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", - "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "node_modules/@emnapi/wasi-threads": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.1.tgz", + "integrity": "sha512-uTII7OYF+/Mes/MrcIOYp5yOtSMLBWSIoLPpcgwipoiKbli6k322tcoFsxoIIxPDqW01SQGAgko4EzZi2BNv2w==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@jridgewell/sourcemap-codec": "^1.5.0", - "@jridgewell/trace-mapping": "^0.3.24" + "tslib": "^2.4.0" } }, - "node_modules/@jridgewell/remapping": { - "version": "2.3.5", - "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", - "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "node_modules/@esbuild/aix-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/aix-ppc64/-/aix-ppc64-0.28.2.tgz", + "integrity": "sha512-XExcO+dvLKvVtNTibSTBej1NCAbaGhWn9Ww1ZPx80qsahhPFe/8jgWP0IchNe0F3HwkU7n8ejhH8bjonqht8mQ==", + "cpu": [ + "ppc64" + ], "dev": true, "license": "MIT", - "dependencies": { - "@jridgewell/gen-mapping": "^0.3.5", - "@jridgewell/trace-mapping": "^0.3.24" + "optional": true, + "os": [ + "aix" + ], + "engines": { + "node": ">=18" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", - "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "node_modules/@esbuild/android-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.28.2.tgz", + "integrity": "sha512-kXXoiPVVGQcnIYGOeaovwOURpniDBpSq4A03qkQ+BMQqtGG6HYap3xne9C1O1yo4TR3qxlCX5IqqmX6fFo2Lqg==", + "cpu": [ + "arm" + ], "dev": true, "license": "MIT", + "optional": true, + "os": [ + "android" + ], "engines": { - "node": ">=6.0.0" + "node": ">=18" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", - "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "node_modules/@esbuild/android-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.28.2.tgz", + "integrity": "sha512-5YfKeeI8qWfBZIX+u2xZC3Zlb3Os/gLS2sbEKM+I4ZOcsWmHS2WLysCcQZDAFRslDUU5Oiq44gf6PYN1vGwG5A==", + "cpu": [ + "arm64" + ], "dev": true, - "license": "MIT" + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.31", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", - "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "node_modules/@esbuild/android-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.28.2.tgz", + "integrity": "sha512-O387ite7SzUyCcy3JQX4P4bLtEA7bLLkx+esve5JHnyYfNTxcVpXZo9jhdB0lTKN44gztELTdU7nS8Nr16Fs1Q==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.28.2.tgz", + "integrity": "sha512-n4KqkOQrraxHJcgjM1RvwbigfQKIKJVpM7xp+KsxiyUSrRdIXnt73VhrPAx0fV44hgfmIVKjxMN9J1t5jySVkw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/darwin-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.28.2.tgz", + "integrity": "sha512-uq6suIWYP37qzGddBKPw5QEQPi6HiLGsO7UmkpfyaYNQ3D+rN6w6WfwH+nuqcGXWvawGwxOEroO4YGnFh95azw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.28.2.tgz", + "integrity": "sha512-n+I0BTSRIoy+d6RPKnEVwql5UwBJolytvY4mAOIEJorKlqgPII8ix6slVVrfZ5Tnj7glIZvloylbB/EJPMWEXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/freebsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.28.2.tgz", + "integrity": "sha512-78XJTJkvPs0kz2w61301PJjXl4g7q3JqiYMZ/M/yVI73EHBrCRTgkhu9oqG7vPqq+a/yadEW8aD+agKlk5xrmg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.28.2.tgz", + "integrity": "sha512-XlDnu2q5yoqems+xay6wSAcg9DDD7K9RLKZEBOMZm3ckNpJBvOX20tSfby8KfrrhINDyv9V2YVZKY/SpoGJI8w==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.28.2.tgz", + "integrity": "sha512-pW4AC0P3it8c7do9MVM4p51FzHzdM/TZrerurgRcHJ2WTa1VQ1CIq18xncfpBJw4ojkiZZrKW2yIBWBP92j6Ug==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.28.2.tgz", + "integrity": "sha512-CYbnj78HsIeA+DhgUKgFCfvNsTHFhMMrinUrMZpDXJXKN8T3XViTZ/+wtHeVxEWY8ewSzTFN+nRmSwO2tZaLUQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-loong64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.28.2.tgz", + "integrity": "sha512-buwkd8nsph4R+ajRvw0qM5Hja/TXQow3ptzWO2EbG/cqcIkHloRrdlBtQlshyYGTNFvfkfJ5tpPLVkY4DtsPfQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-mips64el": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.28.2.tgz", + "integrity": "sha512-ZVykbDyk7519VwiNb9Lcj9m8XM6v5V9uKPvrEMkkEedVewf+0itkhahp4HDpgERXhwLRpWFypsGbG/J8s0QjJA==", + "cpu": [ + "mips64el" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-ppc64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.28.2.tgz", + "integrity": "sha512-CAXl+Dtd9UUuJd8pKKdwh6MLm3MUMiqMPmhZ3tTSXPqfyQ3vDl6R5hZdZ/kYojK4ofXtdfSv1tFq8XzWx3heNQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-riscv64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.28.2.tgz", + "integrity": "sha512-GeXCej4IQtU1B+QlDV8W/RRvbzI3O/Stss+/bCXv4lZls5WGRtu2a+3JkA3i4qIUlMXpcHebWpF8AkJhATowuA==", + "cpu": [ + "riscv64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-s390x": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.28.2.tgz", + "integrity": "sha512-3H1weTYZPxt/WOhByszQZybS9w5lKzUn1FDMsgEChbHWQwHYQQRfBxgCcZvPhjHfKyJjIievvMmEUawJrdY9Dg==", + "cpu": [ + "s390x" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/linux-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.28.2.tgz", + "integrity": "sha512-4xTZr1FUmSoQW4XIWmit3tzQrUTZM+N3P0XV8xROKYF50XfI7xeO90+1bZvNwxIufQ9hDQVRJH5YhgPVF8A/HQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-arm64/-/netbsd-arm64-0.28.2.tgz", + "integrity": "sha512-sSATRjPeDBg3pdgHoQfoYBob11Kk1FGa9lui5RIHZCoCkJa9QKlvl3/vKz2usCmYYjs7ymJR/2Nnsqe+Hjt5nw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/netbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.28.2.tgz", + "integrity": "sha512-lqnzCV+mM0gIADaKihiCg6ifgfU2L3h5E33rNQBN1Y4MaVGnzryzmvvf7UHxprpQdE8hpqLolJ9Rl+SkIRDpyw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-arm64/-/openbsd-arm64-0.28.2.tgz", + "integrity": "sha512-AL2qJILH7lNjrDmCQDvdxMfAUIv8KMNZOvrwAQ8i8//ntL9FflhOyMJ8OZSMBb8/AWXe3/5v5S20y3zCoZWKoQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openbsd-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.28.2.tgz", + "integrity": "sha512-QtiuPytchRyC4rwUKhexJdQKvDuZ6hWloi3igqPQNUJCS1/v9EiO3UTOXR6A3FoMo4fnAKbWJdqaIwhOzh8qEw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/openharmony-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/openharmony-arm64/-/openharmony-arm64-0.28.2.tgz", + "integrity": "sha512-WkhYDmpTjLvGlScA1rwjRUmhl4k8oXR3cIbtqWmELgU/dFeHHlEllxDvdWcNJV9rbzCexB5vz8gtNewWLgCT7Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/sunos-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.28.2.tgz", + "integrity": "sha512-GPMSkTOtMnv2U2F8gxe4Io6qmVs+YKyp832Etqqxr0hFngmXQ3rzwytelm3GIn7T4VviRUlf3sOgBOiTdvaf7g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-arm64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.28.2.tgz", + "integrity": "sha512-PIhhEkE9uPBleRBrQEJpUn7MBnibZzbGzYWPmY3x+YoVg/95zbjB4CxPPOQ8l5tYYM4mMaCthF8/1DIfBQQyWQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-ia32": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.28.2.tgz", + "integrity": "sha512-YmJbfTlvU7Sdn9BB+4PRES4oB6pxgS37MAONj+hBr/cpXS1aBPKXxNnDbu+QCWPj0o9dgyxeq79g6c5P8KeuYA==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@esbuild/win32-x64": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.28.2.tgz", + "integrity": "sha512-5ebpxr3nWMzrL/rnUI755Jkuee0bHL/Gq0WTF9lvcpv73wAp5eu8MfBUgWK9bhWvZjj7yX8etf/8tI8Ney695g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=18" + } + }, + "node_modules/@floating-ui/core": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.8.0.tgz", + "integrity": "sha512-0CIZ5itps/8x7BG8dEIhs53BvCUH2PCoogtakwRTut+Arm58sJooJ0AuZhLw2HJYIR5cMLNPBSS728sPho2khQ==", + "license": "MIT", + "dependencies": { + "@floating-ui/utils": "^0.2.12" + } + }, + "node_modules/@floating-ui/dom": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.8.0.tgz", + "integrity": "sha512-yXSrzeHZBTZadLOlfyhCkJHNeLJnHRnRInwdZ40L7ZiaAtrBwoYlsDrX3v5zB1Utk7CLfzcOVnVVWoXEky7Ceg==", + "license": "MIT", + "dependencies": { + "@floating-ui/core": "^1.8.0", + "@floating-ui/utils": "^0.2.12" + } + }, + "node_modules/@floating-ui/utils": { + "version": "0.2.12", + "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.12.tgz", + "integrity": "sha512-HpCo8tmWzLVad5s2d19EhAz5zqrrQ6s69qd6moPMQvkOuSwDT1YgRfWSVuc4ennqrgv3OHppiOGMQ7oC13yIww==", + "license": "MIT" + }, + "node_modules/@ggml-org/llama-brand": { + "version": "0.1.0", + "resolved": "https://codeload.github.com/ggml-org/llama-brand/tar.gz/f05540643c1ca2a18d732ed6491c839686da9a3a", + "integrity": "sha512-kRDXUIUdfcDt7w4hh3JrFTpqxf2i7R0PHVLGnwUdr4L8EMqE32mEECoXUz1uoUlFaQ+h6QaVHvJWS5y98AoaYA==", + "license": "CC-BY-NC-4.0" + }, + "node_modules/@internationalized/date": { + "version": "3.12.4", + "resolved": "https://registry.npmjs.org/@internationalized/date/-/date-3.12.4.tgz", + "integrity": "sha512-M1dEn4c1U1HsSlaVR8upZtSqvXrTkHDfv18H01uCSJyjVLDxnBR38v/fMxecmlwXKR4i9HeZcmgQAPE6A+aGJQ==", + "license": "Apache-2.0", + "dependencies": { + "@swc/helpers": "^0.5.0" + } + }, + "node_modules/@jridgewell/gen-mapping": { + "version": "0.3.13", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.13.tgz", + "integrity": "sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.0", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/remapping": { + "version": "2.3.5", + "resolved": "https://registry.npmjs.org/@jridgewell/remapping/-/remapping-2.3.5.tgz", + "integrity": "sha512-LI9u/+laYG4Ds1TDKSJW2YPrIlcVYOwi2fUC6xB43lueCjgxV4lffOCZCtYFiH6TNOX+tQKXx97T4IKHbhyHEQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/gen-mapping": "^0.3.5", + "@jridgewell/trace-mapping": "^0.3.24" + } + }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", + "integrity": "sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.0.0" + } + }, + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.6.0.tgz", + "integrity": "sha512-T7jf+5zgsZHwNJ4lvQ7/aezbyk0nNX+zJVWpmHA7VYsEx7a7qr5Rg5IbtJFqkgze5Y2sruq1RUY8Q837Od7iFw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.31", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.31.tgz", + "integrity": "sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "^3.1.0", + "@jridgewell/sourcemap-codec": "^1.4.14" + } + }, + "node_modules/@lucide/svelte": { + "version": "1.46.0", + "resolved": "https://registry.npmjs.org/@lucide/svelte/-/svelte-1.46.0.tgz", + "integrity": "sha512-Ru8jDjoCVLJ7J7pPRUdY+odSBV2BI6rj68JTmT+ENq/ZwYOPGPAiKVvKz+XLyAoK4HAwlRTzZHpsMvrHfsetqg==", + "license": "ISC", + "peerDependencies": { + "svelte": "^5" + } + }, + "node_modules/@mdx-js/react": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/@mdx-js/react/-/react-3.1.1.tgz", + "integrity": "sha512-f++rKLQgUVYDAtECQ6fn/is15GkEH9+nZPM3MS0RcxVqoTfawHvDlSCH7JbMhAM6uJ32v3eXLvLmLvjGu7PTQw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdx": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + }, + "peerDependencies": { + "@types/react": ">=16", + "react": ">=16" + } + }, + "node_modules/@napi-rs/wasm-runtime": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/@napi-rs/wasm-runtime/-/wasm-runtime-1.2.5.tgz", + "integrity": "sha512-HshSvXzmBxNzqejd3k/KemgQ3hdREUYFRRrgxOZ+gPljDIsO2SDZrVZMd4Z/HsxudQbE62OVyVFE8z9BCurfjA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@tybys/wasm-util": "^0.10.3" + }, + "engines": { + "node": "^20.19.0 || ^22.13.0 || >=23.5.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/Brooooooklyn" + }, + "peerDependencies": { + "@emnapi/core": "^1.7.1 || ^2.0.0-alpha.4", + "@emnapi/runtime": "^1.7.1 || ^2.0.0-alpha.4" + } + }, + "node_modules/@neoconfetti/react": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@neoconfetti/react/-/react-1.0.0.tgz", + "integrity": "sha512-klcSooChXXOzIm+SE5IISIAn3bYzYfPjbX7D7HoqZL84oAfgREeSg5vSIaSFH+DaGzzvImTyWe1OyrJ67vik4A==", + "dev": true, + "license": "MIT" + }, + "node_modules/@oxc-parser/binding-android-arm-eabi": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm-eabi/-/binding-android-arm-eabi-0.127.0.tgz", + "integrity": "sha512-0LC7ye4hvqbIKxAzThzvswgHLFu2AURKzYLeSVvLdu2TBOYWQDmHnTqPLeA597BcUCxiLqLsS4CJ5uoI5WYWCQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-android-arm64": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-android-arm64/-/binding-android-arm64-0.127.0.tgz", + "integrity": "sha512-b5jtVTH6AU5CJXHNdj7Jj9IEiR9yVjjnwHzPJhGyHGPdcsZSzBCkS9GBbV33niRMvKthDwQRFRJfI4a+k4PvYg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-darwin-arm64": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-arm64/-/binding-darwin-arm64-0.127.0.tgz", + "integrity": "sha512-obCE8B7ISKkJidjlhv9xRGJPOSDG2Yu6PRga9Ruaz35uintHxbp1Ki/Yc71wx4rj3Edrm0a1kzG1TAwit0wFpg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-darwin-x64": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-darwin-x64/-/binding-darwin-x64-0.127.0.tgz", + "integrity": "sha512-JL6Xb5IwPQT8rUzlpsX7E+AgfcdNklXNPFp8pjCQQ5MQOQo5rtEB2ui+3Hgg9Sn7Y9Egj6YOLLiHhLpdAe12Aw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-freebsd-x64": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-freebsd-x64/-/binding-freebsd-x64-0.127.0.tgz", + "integrity": "sha512-SDQ/3MQFw58fqQz3Z1PhSKFF3JoCF4gmlNjziDm8X02tTahCw0qJbd7FGPDKw1i4VTBZene9JPyC3mHtSvi+wA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm-gnueabihf": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-0.127.0.tgz", + "integrity": "sha512-Av+D1MIqzV0YMGPT9we2SIZaMKD7Cxs4CvXSx/yxaWHewZjYEjScpOf5igc8IILASViw4WTnjlwUdI1KzVtDHQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm-musleabihf": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-0.127.0.tgz", + "integrity": "sha512-Cs2fdJ8cPpFdeebj6p4dag8A4+56hPvZ0AhQQzlaLswGz1tz7bXt1nETLeorrM9+AMcWFFkqxcXwDGfTVidY8g==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm64-gnu": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-0.127.0.tgz", + "integrity": "sha512-qdOfTcT6SY8gsJrrV92uyEUyjqMGPpIB5JZUG6QN5dukYd+7/j0kX6MwK1DgQj39jtUYixxPiaRUiEN1+0CXgQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-arm64-musl": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-arm64-musl/-/binding-linux-arm64-musl-0.127.0.tgz", + "integrity": "sha512-EoTCZneNFU/P2qrpEM+RHmQwt+CvDkyGESG6qhr7KaegXLZwePfbrkCDfAk8/rhxbDUVGsZILX+2tqPzFtoFWA==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-ppc64-gnu": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-0.127.0.tgz", + "integrity": "sha512-zALjmZYgxFLHjXeudcDF0xFGNydTAtkAeXAr2EuC17ywCyFxcmQra4w0BMde0Yi/re4Bi4iwEoEXtYN7l6eBLQ==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-riscv64-gnu": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-0.127.0.tgz", + "integrity": "sha512-fPP8M6zQLS7Jz7o9d5ArUSuAuSK3e+WCYVrCpdzeCOejidtZExJ9tjhDrAd3HEPqARBCPmdpqxESPFqy44vkBQ==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-riscv64-musl": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-0.127.0.tgz", + "integrity": "sha512-7IcC4Ao02oGpfnjt+X/oF4U2mllo2qoSkw5xxiXNKL9MCTsTiAC6616beOuehdxGcnz1bRoPC1RQ2f1GQDdN+g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-s390x-gnu": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-0.127.0.tgz", + "integrity": "sha512-pbXIhiNFHoqWeqDNLiJ9JkpHz1IM9k4DXa66x+1GTWMG7iLxtkXgE53iiuKSXwmk3zIYmaPVfBvgcAhS583K4Q==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-x64-gnu": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-gnu/-/binding-linux-x64-gnu-0.127.0.tgz", + "integrity": "sha512-MYCguB9RvBvlSd6gbuNI7QwiLoCCAlGnlRJFPrzLI6U1/9wkC/WK6LtBAUln55H1Ctqw45PWmqrobKoMhsYQzQ==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-linux-x64-musl": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-linux-x64-musl/-/binding-linux-x64-musl-0.127.0.tgz", + "integrity": "sha512-5eY0B/bxf1xIUxb4NOTvOI3KWtBQfPWYyKAzgcrCt0mDibSZygVpO1Pz8bkeiSZ5Jj9+M09dkggG3H8I5d0Uyg==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-openharmony-arm64": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-openharmony-arm64/-/binding-openharmony-arm64-0.127.0.tgz", + "integrity": "sha512-Gld0ajrFTUXNtdw20fVBuTQx66FA75nIVg+//pPfR3sXkuABB4mTBhl3r9JNzrJpgW//qiwxf0nWXUWGJSL3UQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-wasm32-wasi": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-wasm32-wasi/-/binding-wasm32-wasi-0.127.0.tgz", + "integrity": "sha512-T6KVD7rhLzFlwGRXMnxUFfkCZD8FHnb968wVXW1mXzgRFc5RNXOBY2mPPDZ77x5Ln76ltLMgtPg0cOkU1NSrEQ==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.9.2", + "@emnapi/runtime": "1.9.2", + "@napi-rs/wasm-runtime": "^1.1.4" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-win32-arm64-msvc": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-0.127.0.tgz", + "integrity": "sha512-Ujvw4X+LD1CCGULcsQcvb4YNVoBGqt+JHgNNzGGaCImELiZLk477ifUH53gIbE7EKd933NdTi25JWEr9K2HwXw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-win32-ia32-msvc": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-0.127.0.tgz", + "integrity": "sha512-0cwxKO7KHQQQfo4Uf4B2SQrhgm+cJaP9OvFFhx52Tkg4bezsacu83GB2/In5bC415Ueeym+kXdnge/57rbSfTw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-parser/binding-win32-x64-msvc": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-parser/binding-win32-x64-msvc/-/binding-win32-x64-msvc-0.127.0.tgz", + "integrity": "sha512-rOrnSQSCbhI2kowr9XxE7m9a8oQXnBHjnS6j95LxxAnEZ0+Fz20WlRXG4ondQb+ejjt2KOsa65sE6++L6kUd+w==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-project/runtime": { + "version": "0.154.0", + "resolved": "https://registry.npmjs.org/@oxc-project/runtime/-/runtime-0.154.0.tgz", + "integrity": "sha512-cBQNGoh659BNgvA8OC/e4BNDtFkv03dJaYdkp2adgOQNtISNAPQ+nB4S8XvWtNk7Xl+0g+7aa+iRGR25Xycd1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxc-project/types": { + "version": "0.154.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.154.0.tgz", + "integrity": "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@oxc-resolver/binding-android-arm-eabi": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm-eabi/-/binding-android-arm-eabi-11.21.2.tgz", + "integrity": "sha512-xQoCRv+gKax9KTdwdaQNnAFOai8neay7g3jExDIORzhbrejwGSJaZNTdOJHR5ziLg2joMxOCMOFMo4zuxza2uQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-android-arm64": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-android-arm64/-/binding-android-arm64-11.21.2.tgz", + "integrity": "sha512-HF5oiE2L05yInPYCFD/4uxSrEZW4SuIfn99Y6L1xnJnzl066JR+MJs2rIdstw8A2MPlAKH+13dpFPNycjqzvGg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "android" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-arm64": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-arm64/-/binding-darwin-arm64-11.21.2.tgz", + "integrity": "sha512-UX4u49CVCAD8QZNELaW8eMGgMAGwFWYEPbvNsh+3r/gs4NX3KfpiACMVwRQT0EuH3uat9hM5Zl+Ppm9pJD8tgg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-darwin-x64": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-darwin-x64/-/binding-darwin-x64-11.21.2.tgz", + "integrity": "sha512-J9xPx7YBkrRmJ+xl561ztnMWEc1aOyjEIxBiGX1dVb3u7bGSnfObfcZk+Pd+uM0HZAPNsQ1xvD8j52A/uOSqNQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxc-resolver/binding-freebsd-x64": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-freebsd-x64/-/binding-freebsd-x64-11.21.2.tgz", + "integrity": "sha512-fRlt7OvSaQkWj6+EDTVxawVxOlqJB2QSnBfkeCyK4RTvsGctbw3BiH2Tb7DzMs7bikc4BRBpvWP5zF9K8b54Zg==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "freebsd" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-gnueabihf": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-gnueabihf/-/binding-linux-arm-gnueabihf-11.21.2.tgz", + "integrity": "sha512-gK+vPUcPQITkGwBKpZGrcDHSlU6eDGl7AQacxS2CEKAZIBHWkOVFeJwLZ4tYnA1acJqRM5lt7yYwPCVqGHIJ7A==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm-musleabihf": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm-musleabihf/-/binding-linux-arm-musleabihf-11.21.2.tgz", + "integrity": "sha512-L/Rgas7SrOKy/z7IH+HxSFRqVO4PuLDKLEGKvnhoCBBq3UJ0YzGBou3qMzaAGgkJwsIvX2pBF+7ojzfUhLiZxQ==", + "cpu": [ + "arm" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-gnu": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-gnu/-/binding-linux-arm64-gnu-11.21.2.tgz", + "integrity": "sha512-CUEYvlX1Fk7E9kUMzuswru1J9HLxMwnpDeQGjQuI4ZH+iNCoa2X9T+pvyzrbsgl7WnIeTFTlNlHsRfVdf5g9/g==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-arm64-musl": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-arm64-musl/-/binding-linux-arm64-musl-11.21.2.tgz", + "integrity": "sha512-ViN1ZibQyxwC67GpoP33oo+S9UyUnkog13vzQb9+v9bCNvrVzJuk0MRdacjtv/9xfRMVF/eqHFyl8YOeykI10Q==", + "cpu": [ + "arm64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-ppc64-gnu": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-ppc64-gnu/-/binding-linux-ppc64-gnu-11.21.2.tgz", + "integrity": "sha512-CU1sCqWnhGqYD5I1HedHk5pujrn7ssDkNB/AEQd/pd3D/EojVSgJUlpbafwIbyhia3PgIfkvdFpRPWSALzVumA==", + "cpu": [ + "ppc64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-riscv64-gnu": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-gnu/-/binding-linux-riscv64-gnu-11.21.2.tgz", + "integrity": "sha512-jWVyZtIHca4Gb96x7dag+y69vlei7ffjrsveLkmf2ZhqEAz6ZSBnY1GWvgZUaZlwZP62A3xD092BW97Q5VGc+g==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-riscv64-musl": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-riscv64-musl/-/binding-linux-riscv64-musl-11.21.2.tgz", + "integrity": "sha512-LF29obFqNgBUgDX7rmUK7M4D0JQG5LxhYzn3xXmECcHU9aQAdWG7NiY052qybtesEdwHQXKNTWYQ7mTsybNvWg==", + "cpu": [ + "riscv64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-s390x-gnu": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-s390x-gnu/-/binding-linux-s390x-gnu-11.21.2.tgz", + "integrity": "sha512-+NYcm+cCHBbtdQQ3A4phQTSuVRYnNHz7wrl9XRAPEovcdoqi0mb1K5ZOl+jN54ZD+q1zz3V0vltbFJmzecJKmw==", + "cpu": [ + "s390x" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-x64-gnu": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-gnu/-/binding-linux-x64-gnu-11.21.2.tgz", + "integrity": "sha512-UQqZDdG2r2HhAOsZEgufkIWHPQ886IUyuJQkoZByvzhW8j51R4UNzGBJFkTiTnLhQnggwJRdJgFWK4uY6ZVIMw==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "glibc" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-linux-x64-musl": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-linux-x64-musl/-/binding-linux-x64-musl-11.21.2.tgz", + "integrity": "sha512-3Q9PMRjalWkT6NZ4jfujuqTCFwoWErg3y3BnOgb544B8IMw4PktiwWOigMfOHNRLMghZeJ7hpfpZf4CP7rV7Og==", + "cpu": [ + "x64" + ], + "dev": true, + "libc": [ + "musl" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxc-resolver/binding-openharmony-arm64": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-openharmony-arm64/-/binding-openharmony-arm64-11.21.2.tgz", + "integrity": "sha512-Eljeq3ndtyKhM+Es8LITi4Zl2htzuRZcrPMF3kMCsrILztvU6AjZ3FuEhHHKobPUB9rMpzLpJP5bDqXI7r+iog==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ] + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-wasm32-wasi/-/binding-wasm32-wasi-11.21.2.tgz", + "integrity": "sha512-HGDbNsIywqc4LxU38+CTJNnB/6BF7rheWOJ259b4eE0aEnelYblC8x+1tEd63bp31fYne63RQz9Jb4yVnC7Yig==", + "cpu": [ + "wasm32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/core": "1.11.0", + "@emnapi/runtime": "1.11.0", + "@napi-rs/wasm-runtime": "^1.1.5" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/@emnapi/core": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@emnapi/core/-/core-1.11.0.tgz", + "integrity": "sha512-l9Oo58x0HOP5znGzVhYW9U3e5wVuA4LAZU2AGezTmkhO1CgQRFDhDg4nneHsu/t3WniXg9QrG2nIXL/ZS8ln8Q==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@emnapi/wasi-threads": "1.2.2", + "tslib": "^2.4.0" + } + }, + "node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/@emnapi/runtime": { + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.11.0.tgz", + "integrity": "sha512-55coeOFKHv1ywEcUXJtWU5f+Jr/W5tZDvZig8DLKSwUN1JpROQ4rk/SNOQiFWmaR/VKF4zuFyW1B8JduOSv6Pg==", "dev": true, "license": "MIT", + "optional": true, "dependencies": { - "@jridgewell/resolve-uri": "^3.1.0", - "@jridgewell/sourcemap-codec": "^1.4.14" + "tslib": "^2.4.0" } }, - "node_modules/@lucide/svelte": { - "version": "1.46.0", - "resolved": "https://registry.npmjs.org/@lucide/svelte/-/svelte-1.46.0.tgz", - "integrity": "sha512-Ru8jDjoCVLJ7J7pPRUdY+odSBV2BI6rj68JTmT+ENq/ZwYOPGPAiKVvKz+XLyAoK4HAwlRTzZHpsMvrHfsetqg==", - "license": "ISC", - "peerDependencies": { - "svelte": "^5" + "node_modules/@oxc-resolver/binding-wasm32-wasi/node_modules/@emnapi/wasi-threads": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/@emnapi/wasi-threads/-/wasi-threads-1.2.2.tgz", + "integrity": "sha512-c95qOXkHdydNKhscBTebqEC1CVAZpyqOfVfBzQ1qgzyl3gfeldUjIggDbIZgDKsHLgnsM+igH7TJ/eAasaVuMA==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" } }, - "node_modules/@oxc-project/runtime": { - "version": "0.154.0", - "resolved": "https://registry.npmjs.org/@oxc-project/runtime/-/runtime-0.154.0.tgz", - "integrity": "sha512-cBQNGoh659BNgvA8OC/e4BNDtFkv03dJaYdkp2adgOQNtISNAPQ+nB4S8XvWtNk7Xl+0g+7aa+iRGR25Xycd1Q==", + "node_modules/@oxc-resolver/binding-win32-arm64-msvc": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-11.21.2.tgz", + "integrity": "sha512-iWx25CBEgH49iE9q5coEGI/jb1jl5kkCY9z6U5Og67xCkQ/WFMDc2J5U78+AE91SUxM2NqSLhJC8/PLfWnImww==", + "cpu": [ + "arm64" + ], "dev": true, "license": "MIT", - "engines": { - "node": "^20.19.0 || >=22.12.0" - } + "optional": true, + "os": [ + "win32" + ] }, - "node_modules/@oxc-project/types": { - "version": "0.154.0", - "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.154.0.tgz", - "integrity": "sha512-KYOUGQFlLWR+s4QMV2Q9ko38TZm7EdO87Qm7rvZLqk/webse/cDjtyxKhg/47l0byCbs/k46LT8qc4PKjAikzA==", + "node_modules/@oxc-resolver/binding-win32-x64-msvc": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/@oxc-resolver/binding-win32-x64-msvc/-/binding-win32-x64-msvc-11.21.2.tgz", + "integrity": "sha512-VPoCAhKvCQTlG7vxqaBXcmuvbh77BfnGXj8g0pbvVXpm1F/R8rDVwqIWcEbMzrI1JvJlm8v7T9uMVQb6UctMRg==", + "cpu": [ + "x64" + ], "dev": true, "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/oxc-project" - } + "optional": true, + "os": [ + "win32" + ] }, "node_modules/@oxfmt/binding-android-arm-eabi": { "version": "0.73.0", @@ -961,131 +2215,448 @@ "musl" ], "license": "MIT", - "optional": true, - "os": [ - "linux" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-openharmony-arm64": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.88.0.tgz", + "integrity": "sha512-DBUcx/KwYdg1DAz+G01P/GFv512J04EsZadbHptx2FTpWT/MWRg21ZToNHt9pnsfQRBQ3et/g+vqzbvrdAVbuA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "openharmony" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-arm64-msvc": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.88.0.tgz", + "integrity": "sha512-xeVd0n4XG5HvynxfYvXi6uB+JvZbVZataowPS8cYpMbYg9mwE4sSyElFQd4LVJFifq8bRLDSR18XgEildmcXAg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-ia32-msvc": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.88.0.tgz", + "integrity": "sha512-MA6iOw//amleaz2mVMsZrA7NHlEexjTrhIxSMFCXQi6IUuQO+3Od00GZhr2iCYw6RFzMW36jkKK/WHBXMsoQAw==", + "cpu": [ + "ia32" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/binding-win32-x64-msvc": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.88.0.tgz", + "integrity": "sha512-3Sz6rVWe8Dy+ufsXurFN1GX2dX43F/lQMSLelK9gFjiba7nHvLlqlhR5cHlWVnCpSqUY1hN9pyCX9XToe6ve6g==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^20.19.0 || >=22.12.0" + } + }, + "node_modules/@oxlint/plugins": { + "version": "1.88.0", + "resolved": "https://registry.npmjs.org/@oxlint/plugins/-/plugins-1.88.0.tgz", + "integrity": "sha512-G2xbfWTrbqYRhR/vfeKNMQf/sS3/ti0iKJAAkRxHuXWZH/hne/dyIb9QKk5LuR6cJLARxsL6FMoAYmfspd74MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/oxc-project" + } + }, + "node_modules/@polka/url": { + "version": "1.0.0-next.29", + "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", + "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "dev": true, + "license": "MIT" + }, + "node_modules/@publint/pack": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@publint/pack/-/pack-0.1.7.tgz", + "integrity": "sha512-4EDEmvxWtgsCnnVeBvtFIFZtUhPPt1+bA9JrSwU4Sa//6oKtzCSlGGXYJr44OD9aGISymbieJ4mCKHUygUDU+g==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyexec": "^1.3.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://bjornlu.com/sponsor" + } + }, + "node_modules/@rolldown/pluginutils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", + "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", + "dev": true, + "license": "MIT" + }, + "node_modules/@standard-schema/spec": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", + "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@storybook/addon-a11y": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/@storybook/addon-a11y/-/addon-a11y-10.6.2.tgz", + "integrity": "sha512-zleS+btwrTRcUf3opbZntKsEt6PTqAtxsek08tx5jh5fRvd6wWmtnwW3uaBcypfIKnheTB3KGljJwFX+Mc+Umg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@storybook/global": "^5.0.0", + "axe-core": "^4.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "storybook": "^10.6.2" + } + }, + "node_modules/@storybook/addon-docs": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/@storybook/addon-docs/-/addon-docs-10.6.2.tgz", + "integrity": "sha512-f7Rv/rzX1sk4lUDTeoIRkXWcWvNwLv7vBnfpFGb3f88MliB+M4ZekGKNiKtrmi44uLFt52gzwwPzj2eGDu0DQQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@mdx-js/react": "^3.0.0", + "@storybook/icons": "^2.0.2", + "@storybook/react-dom-shim": "10.6.2", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "ts-dedent": "^2.0.0", + "unplugin": "^2.3.5" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "storybook": "^10.6.2" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, + "node_modules/@storybook/addon-mcp": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/@storybook/addon-mcp/-/addon-mcp-10.6.2.tgz", + "integrity": "sha512-AY18igxEq+8pEmzFreSklY6nxYe5xHZdqOqHCg10vT6Ms7pYb0XdnSG94mesJ6Zp+1E4o65WDfmsgMadEvJsfw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tmcp/adapter-valibot": "^0.1.5", + "@tmcp/transport-http": "^0.8.5", + "tmcp": "^1.19.4", + "valibot": "^1.4.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "@storybook/addon-vitest": "^10.6.2", + "storybook": "^10.6.2" + }, + "peerDependenciesMeta": { + "@storybook/addon-vitest": { + "optional": true + } + } + }, + "node_modules/@storybook/addon-svelte-csf": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/@storybook/addon-svelte-csf/-/addon-svelte-csf-5.1.5.tgz", + "integrity": "sha512-lYc9tyFIowXtd/hlapngtGhw6YUZMSU5KezHqJl84lRkahsNtmtqHl/mJjRRJG2ZQIWgw6xBUi4PvVvTxPwqzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@storybook/csf": "^0.1.13", + "dedent": "^1.5.3", + "es-toolkit": "^1.26.1", + "esrap": "^1.2.2", + "magic-string": "^0.30.12", + "svelte-ast-print": "^0.4.0", + "zimmerframe": "^1.1.2" + }, + "peerDependencies": { + "@storybook/svelte": "^0.0.0-0 || ^8.2.0 || ^9.0.0 || ^9.1.0-0 || ^10.0.0-0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0 || ^10.4.0-0 || ^10.5.0-0 || ^10.6.0-0 || ^11.0.0-0", + "@sveltejs/vite-plugin-svelte": "^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0", + "storybook": "^0.0.0-0 || ^8.2.0 || ^9.0.0 || ^9.1.0-0 || ^10.0.0-0 || ^10.1.0-0 || ^10.2.0-0 || ^10.3.0-0 || ^10.4.0-0 || ^10.5.0-0 || ^10.6.0-0 || ^11.0.0-0", + "svelte": "^5.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, + "node_modules/@storybook/addon-svelte-csf/node_modules/esrap": { + "version": "1.4.9", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-1.4.9.tgz", + "integrity": "sha512-3OMlcd0a03UGuZpPeUC1HxR3nA23l+HEyCiZw3b3FumJIN9KphoGzDJKMXI1S72jVS1dsenDyQC0kJlO1U9E1g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15" + } + }, + "node_modules/@storybook/addon-svelte-csf/node_modules/magic-string": { + "version": "0.30.21", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.30.21.tgz", + "integrity": "sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.5.5" + } + }, + "node_modules/@storybook/addon-vitest": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/@storybook/addon-vitest/-/addon-vitest-10.6.2.tgz", + "integrity": "sha512-gyyBzncvUyEgWQR3LinnGuI4UsWIUYLyw1u8i244aTxmY4uxCYjsDmUNkaSr8xQzNz8nh2Ckh3G4bO4SvJ6nJQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@storybook/global": "^5.0.0", + "@storybook/icons": "^2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "@vitest/browser": "^3.0.0 || ^4.0.0 || ^5.0.0", + "@vitest/browser-playwright": "^4.0.0 || ^5.0.0", + "@vitest/runner": "^3.0.0 || ^4.0.0 || ^5.0.0", + "storybook": "^10.6.2", + "vitest": "^3.0.0 || ^4.0.0 || ^5.0.0" + }, + "peerDependenciesMeta": { + "@vitest/browser": { + "optional": true + }, + "@vitest/browser-playwright": { + "optional": true + }, + "@vitest/runner": { + "optional": true + }, + "vitest": { + "optional": true + } + } + }, + "node_modules/@storybook/builder-vite": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/@storybook/builder-vite/-/builder-vite-10.6.2.tgz", + "integrity": "sha512-SzeQEGjvybdhP2coF4aIX6JX/7rZTrQCpRU3vAEO/R98Vr3xM8jdg7a3nvt91TeF/P8iWqljLIpaDjTdk2r/sQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ts-dedent": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "storybook": "^10.6.2", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/@oxlint/binding-openharmony-arm64": { - "version": "1.88.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-openharmony-arm64/-/binding-openharmony-arm64-1.88.0.tgz", - "integrity": "sha512-DBUcx/KwYdg1DAz+G01P/GFv512J04EsZadbHptx2FTpWT/MWRg21ZToNHt9pnsfQRBQ3et/g+vqzbvrdAVbuA==", - "cpu": [ - "arm64" - ], + "node_modules/@storybook/csf": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/@storybook/csf/-/csf-0.1.13.tgz", + "integrity": "sha512-7xOOwCLGB3ebM87eemep89MYRFTko+D8qE7EdAAq74lgdqRR5cOUtYWJLjO2dLtP94nqoOdHJo6MdLLKzg412Q==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "openharmony" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "dependencies": { + "type-fest": "^2.19.0" } }, - "node_modules/@oxlint/binding-win32-arm64-msvc": { - "version": "1.88.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-arm64-msvc/-/binding-win32-arm64-msvc-1.88.0.tgz", - "integrity": "sha512-xeVd0n4XG5HvynxfYvXi6uB+JvZbVZataowPS8cYpMbYg9mwE4sSyElFQd4LVJFifq8bRLDSR18XgEildmcXAg==", - "cpu": [ - "arm64" - ], + "node_modules/@storybook/global": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@storybook/global/-/global-5.0.0.tgz", + "integrity": "sha512-FcOqPAXACP0I3oJ/ws6/rrPT9WGhu915Cg8D02a9YxLo0DE9zI+a9A5gRGvmQ09fiWPukqI8ZAEoQEdWUKMQdQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/@storybook/icons": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/@storybook/icons/-/icons-2.2.0.tgz", + "integrity": "sha512-FpUB/xizIrV1ILhCIYFo+TtQNN9YEoLjfcnAW0JtOXL+BcM2aisSysI0B54JMWDnljriXySBHgN6ps4s9lb75A==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, - "node_modules/@oxlint/binding-win32-ia32-msvc": { - "version": "1.88.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-ia32-msvc/-/binding-win32-ia32-msvc-1.88.0.tgz", - "integrity": "sha512-MA6iOw//amleaz2mVMsZrA7NHlEexjTrhIxSMFCXQi6IUuQO+3Od00GZhr2iCYw6RFzMW36jkKK/WHBXMsoQAw==", - "cpu": [ - "ia32" - ], + "node_modules/@storybook/react-dom-shim": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/@storybook/react-dom-shim/-/react-dom-shim-10.6.2.tgz", + "integrity": "sha512-k0262Vqxjk3wHeg3g/QO/ENDrkC7kkbuwsFSXOdYr7Sl888tsF1DAS7uQ/gr+s/BRz1FLYRX7wBY3smEUV4MJg==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "@types/react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "storybook": "^10.6.2" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } } }, - "node_modules/@oxlint/binding-win32-x64-msvc": { - "version": "1.88.0", - "resolved": "https://registry.npmjs.org/@oxlint/binding-win32-x64-msvc/-/binding-win32-x64-msvc-1.88.0.tgz", - "integrity": "sha512-3Sz6rVWe8Dy+ufsXurFN1GX2dX43F/lQMSLelK9gFjiba7nHvLlqlhR5cHlWVnCpSqUY1hN9pyCX9XToe6ve6g==", - "cpu": [ - "x64" - ], + "node_modules/@storybook/svelte": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/@storybook/svelte/-/svelte-10.6.2.tgz", + "integrity": "sha512-P4LfcT2fGEYcqn4CFVkel/TvCHFxLUF8E/H/M8LqU/beJGr0f0c87L64QvDaJJiGjARRWTK1mvd0z8eSYO96Nw==", "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "engines": { - "node": "^20.19.0 || >=22.12.0" + "dependencies": { + "ts-dedent": "^2.0.0", + "type-fest": "^5.6.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "storybook": "^10.6.2", + "svelte": "^5.0.0" } }, - "node_modules/@oxlint/plugins": { - "version": "1.88.0", - "resolved": "https://registry.npmjs.org/@oxlint/plugins/-/plugins-1.88.0.tgz", - "integrity": "sha512-G2xbfWTrbqYRhR/vfeKNMQf/sS3/ti0iKJAAkRxHuXWZH/hne/dyIb9QKk5LuR6cJLARxsL6FMoAYmfspd74MQ==", + "node_modules/@storybook/svelte-vite": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/@storybook/svelte-vite/-/svelte-vite-10.6.2.tgz", + "integrity": "sha512-IjSm98aMRNX0iH5A0i8VK1oUOak8Vq8r0O1xHozb7esjz0bVTznwx6sOGKkfhV8k0n1Vn5e2YzvXJR5m5Rqo8A==", "dev": true, "license": "MIT", - "engines": { - "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + "dependencies": { + "@storybook/builder-vite": "10.6.2", + "@storybook/svelte": "10.6.2", + "magic-string": "^1.1.0", + "svelte2tsx": "^0.7.55", + "typescript": "^4.9.4 || ^5.0.0" }, "funding": { - "url": "https://github.com/sponsors/oxc-project" + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "@sveltejs/vite-plugin-svelte": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0", + "storybook": "^10.6.2", + "svelte": "^5.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/@polka/url": { - "version": "1.0.0-next.29", - "resolved": "https://registry.npmjs.org/@polka/url/-/url-1.0.0-next.29.tgz", - "integrity": "sha512-wwQAWhWSuHaag8c4q/KN/vCoeOJYshAIvMQwD4GpSb3OiZklFfvAgmj0VCBBImRpuF/aFgIRzllXlVX93Jevww==", + "node_modules/@storybook/svelte-vite/node_modules/typescript": { + "version": "5.9.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.3.tgz", + "integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==", "dev": true, - "license": "MIT" + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } }, - "node_modules/@publint/pack": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/@publint/pack/-/pack-0.1.7.tgz", - "integrity": "sha512-4EDEmvxWtgsCnnVeBvtFIFZtUhPPt1+bA9JrSwU4Sa//6oKtzCSlGGXYJr44OD9aGISymbieJ4mCKHUygUDU+g==", + "node_modules/@storybook/svelte/node_modules/type-fest": { + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-5.10.0.tgz", + "integrity": "sha512-NoSdpq/WEiAg5sjmBkmV/hfxv6HJH4NqPNrqjtSO5CwRmpsDfaf4begxW34KdJykH/l1yHtwBWQkCRdoXO8mPA==", "dev": true, - "license": "MIT", + "license": "(MIT OR CC0-1.0)", "dependencies": { - "tinyexec": "^1.3.0" + "tagged-tag": "^1.0.0" }, "engines": { - "node": ">=18" + "node": ">=20" }, "funding": { - "url": "https://bjornlu.com/sponsor" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@rolldown/pluginutils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@rolldown/pluginutils/-/pluginutils-1.0.1.tgz", - "integrity": "sha512-2j9bGt5Jh8hj+vPtgzPtl72j0yRxHAyumoo6TNfAjsLB04UtpSvPbPcDcBMxz7n+9CYB0c1GxQFxYRg2jimqGw==", - "dev": true, - "license": "MIT" - }, - "node_modules/@standard-schema/spec": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.1.0.tgz", - "integrity": "sha512-l2aFy5jALhniG5HgqrD6jXLi/rUWrKvqN/qJx6yoJsgKhblVd+iqqU4RCXavm/jPityDo5TCvKMnpjKnOriy0w==", + "node_modules/@storybook/sveltekit": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/@storybook/sveltekit/-/sveltekit-10.6.2.tgz", + "integrity": "sha512-YfwJz+rlArrZSiMhTLA7TrPSwmcK3vqKa0yIDZaRfmQuP8YuwQop1CCic719VZ9kbYgMbsboCOAhZIr/ZtMreg==", "dev": true, - "license": "MIT" + "license": "MIT", + "dependencies": { + "@storybook/builder-vite": "10.6.2", + "@storybook/svelte": "10.6.2", + "@storybook/svelte-vite": "10.6.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "storybook": "^10.6.2", + "svelte": "^5.0.0", + "vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + } }, "node_modules/@sveltejs/acorn-typescript": { "version": "1.0.13", @@ -1868,6 +3439,33 @@ "dequal": "^2.0.3" } }, + "node_modules/@testing-library/jest-dom": { + "version": "6.9.1", + "resolved": "https://registry.npmjs.org/@testing-library/jest-dom/-/jest-dom-6.9.1.tgz", + "integrity": "sha512-zIcONa+hVtVSSep9UT3jZ5rizo2BsxgyDYU7WFD5eICBE7no3881HGeb/QkGfsJs6JTkY1aQhT7rIPC7e+0nnA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@adobe/css-tools": "^4.4.0", + "aria-query": "^5.0.0", + "css.escape": "^1.5.1", + "dom-accessibility-api": "^0.6.3", + "picocolors": "^1.1.1", + "redent": "^3.0.0" + }, + "engines": { + "node": ">=14", + "npm": ">=6", + "yarn": ">=1" + } + }, + "node_modules/@testing-library/jest-dom/node_modules/dom-accessibility-api": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/dom-accessibility-api/-/dom-accessibility-api-0.6.3.tgz", + "integrity": "sha512-7ZgogeTnjuHbo+ct10G9Ffp0mif17idi0IyWNVA/wcwcm7NPOD/WEHVP3n7n3MhXqxoIYm8d6MuZohYWIZ4T3w==", + "dev": true, + "license": "MIT" + }, "node_modules/@testing-library/svelte-core": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/@testing-library/svelte-core/-/svelte-core-1.1.3.tgz", @@ -1895,6 +3493,63 @@ "@testing-library/dom": ">=7.21.4" } }, + "node_modules/@tmcp/adapter-valibot": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/@tmcp/adapter-valibot/-/adapter-valibot-0.1.7.tgz", + "integrity": "sha512-MkY4yiyx6k/eeft7Ktnp3RSWrflwWF2PvhmVBSSSGjclJLdIOhhIY1wgp7LVKWwHKiYjOnaL8fQqx1kfdk4xkA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "@valibot/to-json-schema": "^1.3.0", + "valibot": "^1.1.0" + }, + "peerDependencies": { + "tmcp": "^1.17.0 || ^1.20.0-next.0", + "valibot": "^1.1.0" + } + }, + "node_modules/@tmcp/session-manager": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/@tmcp/session-manager/-/session-manager-0.2.2.tgz", + "integrity": "sha512-UrCRpTsxh5XnMbplspvftEYboiZWgAiXqqAUbyFTHoHMJ0LoNDy8bQd0+7qtxtT4S5Qsnv650gvs/Nbec5NTCQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "tmcp": "^1.16.3" + } + }, + "node_modules/@tmcp/transport-http": { + "version": "0.8.6", + "resolved": "https://registry.npmjs.org/@tmcp/transport-http/-/transport-http-0.8.6.tgz", + "integrity": "sha512-iLcxu+tEMbkVHbhFfyXQhxfPDDTfm+F0kEw8Xg/a1rm29s4cBg1vwcpbtk02XTxsdDh8RJ1AZkQwF9WDGeb/IA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@tmcp/session-manager": "^0.2.2", + "esm-env": "^1.2.2" + }, + "peerDependencies": { + "@tmcp/auth": "^0.3.3 || ^0.4.0", + "tmcp": "^1.18.0" + }, + "peerDependenciesMeta": { + "@tmcp/auth": { + "optional": true + } + } + }, + "node_modules/@tybys/wasm-util": { + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@tybys/wasm-util/-/wasm-util-0.10.4.tgz", + "integrity": "sha512-W3c4gRigFS0T/Ma4qIYF3GDAc5AQdHb1yL5znJT1Zv1YaD9Kitx656wBjvr19qbiosmZT8lWDM5BEMynUqX65A==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, "node_modules/@types/aria-query": { "version": "5.0.4", "resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz", @@ -1927,6 +3582,30 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/json-schema": { + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/mdast": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/mdast/-/mdast-4.0.4.tgz", + "integrity": "sha512-kGaNbPh1k7AFzgpud/gMdvIm5xuECykRR+JnWKQno9TAXVa6WIVCGTPvYGekIDL4uwCZQSYbUxNBSb1aUo79oA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/mdx": { + "version": "2.0.14", + "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.14.tgz", + "integrity": "sha512-T48PeuJtvLosNTPVhfnIp3i/n3a4g4Bad7YCq5k64D4u7NwDrAotikQ+5+sjtUvBmxCMlbo3dVL+C2dP0rWHzg==", + "dev": true, + "license": "MIT" + }, "node_modules/@types/node": { "version": "24.19.2", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.19.2.tgz", @@ -1937,6 +3616,23 @@ "undici-types": ">=7.24.0 <7.24.7" } }, + "node_modules/@types/unist": { + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-2.0.11.tgz", + "integrity": "sha512-CmBKiL6NNo/OqgmMn95Fk9Whlp2mtvIv+KNpQKN2F4SjvrEesubTRWGYSg+BnWZOnlCaSTU1sMpsBOzgbYhnsA==", + "dev": true, + "license": "MIT" + }, + "node_modules/@valibot/to-json-schema": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@valibot/to-json-schema/-/to-json-schema-1.8.0.tgz", + "integrity": "sha512-a0M+uwCuQZEPAo65NYkFSJ14O5c213KoSZmPdoCfuFvUhfULi4T2Z6Tpjv6lTVMW9RoLm74RpRAjNEa43KcN+g==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "valibot": "^1.5.0" + } + }, "node_modules/@vitest/browser": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/@vitest/browser/-/browser-5.0.5.tgz", @@ -2037,13 +3733,98 @@ "resolved": "https://registry.npmjs.org/obug/-/obug-3.0.0.tgz", "integrity": "sha512-5vvB5+W7ePv+p3uqxi+RcW1XAzLW0/hxt3/4X4Lc4qHudzOhmBiBwOY6DRob4WnanAEGvNcLjF+KNOufrUoEQw==", "dev": true, - "funding": [ - "https://github.com/sponsors/sxzz", - "https://opencollective.com/debug" - ], + "funding": [ + "https://github.com/sponsors/sxzz", + "https://opencollective.com/debug" + ], + "license": "MIT", + "engines": { + "node": ">=12.20.0" + } + }, + "node_modules/@vitest/expect": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/expect/-/expect-3.2.4.tgz", + "integrity": "sha512-Io0yyORnB6sikFlt8QW5K7slY4OjqNX9jmJQ02QDda8lyM6B5oNgVWoSoKPac8/kgnCUzuHQKrSLtu/uOqqrig==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/chai": "^5.2.2", + "@vitest/spy": "3.2.4", + "@vitest/utils": "3.2.4", + "chai": "^5.2.0", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/expect/node_modules/@vitest/pretty-format": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/pretty-format/-/pretty-format-3.2.4.tgz", + "integrity": "sha512-IVNZik8IVRJRTr9fxlitMKeJeXFFFN0JaB9PHPGQ8NKQbGpfjlTx9zO4RefN8gp7eqjNy8nyK3NZmBzOPeIxtA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/expect/node_modules/@vitest/spy": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", + "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/expect/node_modules/@vitest/utils": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/utils/-/utils-3.2.4.tgz", + "integrity": "sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@vitest/pretty-format": "3.2.4", + "loupe": "^3.1.4", + "tinyrainbow": "^2.0.0" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/@vitest/expect/node_modules/chai": { + "version": "5.3.3", + "resolved": "https://registry.npmjs.org/chai/-/chai-5.3.3.tgz", + "integrity": "sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==", + "dev": true, + "license": "MIT", + "dependencies": { + "assertion-error": "^2.0.1", + "check-error": "^2.1.1", + "deep-eql": "^5.0.1", + "loupe": "^3.1.0", + "pathval": "^2.0.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@vitest/expect/node_modules/tinyrainbow": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/tinyrainbow/-/tinyrainbow-2.0.0.tgz", + "integrity": "sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==", + "dev": true, "license": "MIT", "engines": { - "node": ">=12.20.0" + "node": ">=14.0.0" } }, "node_modules/@vitest/istanbul-lib-coverage": { @@ -2320,6 +4101,13 @@ "node": ">=20.0.0" } }, + "node_modules/@webcontainer/env": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@webcontainer/env/-/env-1.1.1.tgz", + "integrity": "sha512-6aN99yL695Hi9SuIk1oC88l9o0gmxL1nGWWQ/kNy81HigJ0FoaoTXpytCj6ItzgyCEwA9kF1wixsTuv5cjsgng==", + "dev": true, + "license": "MIT" + }, "node_modules/@yuku-core/binding-android-arm64": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/@yuku-core/binding-android-arm64/-/binding-android-arm64-0.19.0.tgz", @@ -2569,6 +4357,19 @@ "node": ">=12" } }, + "node_modules/ast-types": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.16.3.tgz", + "integrity": "sha512-FvWoWYfSCM6kRxCSH+MGLHIKKGRL6A6AW7Zek2O32REPQRdg131428uRTKMBYAeRd3XXAaHDS60Wpri7CdKDrA==", + "dev": true, + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/ast-v8-to-istanbul": { "version": "1.0.7", "resolved": "https://registry.npmjs.org/ast-v8-to-istanbul/-/ast-v8-to-istanbul-1.0.7.tgz", @@ -2588,6 +4389,16 @@ "dev": true, "license": "MIT" }, + "node_modules/axe-core": { + "version": "4.14.0", + "resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.14.0.tgz", + "integrity": "sha512-9WTZxEjsZ7b13TH8JPmbV2z8CHbl80/2hm3XPEG4JgNdQLK81IBRXmSxHfMAOkSqQeRxT/0dwNDz2GOm3zzpcQ==", + "dev": true, + "license": "MPL-2.0", + "engines": { + "node": ">=4" + } + }, "node_modules/axobject-query": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/axobject-query/-/axobject-query-4.1.0.tgz", @@ -2666,6 +4477,22 @@ "svelte": "^5.30.2" } }, + "node_modules/bundle-name": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/bundle-name/-/bundle-name-4.1.1.tgz", + "integrity": "sha512-DdH81/zPLVS11EUgWq3tEu/xn+EzljlMYooDNdzWEnFha3R3NBMpMV1UqYIpjYHV/SgpFKMIX1Oh7o06SjM/oA==", + "dev": true, + "license": "MIT", + "dependencies": { + "run-applescript": "^7.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/chai": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/chai/-/chai-6.3.0.tgz", @@ -2676,6 +4503,16 @@ "node": ">=18" } }, + "node_modules/check-error": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/check-error/-/check-error-2.1.3.tgz", + "integrity": "sha512-PAJdDJusoxnwm1VwW07VWwUN1sl7smmC3OKggvndJFadxxDRyFJBX/ggnu/KE4kQAB7a3Dp8f/YXC1FlUprWmA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 16" + } + }, "node_modules/chokidar": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-5.0.0.tgz", @@ -2692,6 +4529,40 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/chromatic": { + "version": "18.13.0", + "resolved": "https://registry.npmjs.org/chromatic/-/chromatic-18.13.0.tgz", + "integrity": "sha512-AdN6tHB9anx/sdJKIMQ7JkQQV2RhVe1iTvXOFLlwFBRecbl9rp50h/25N0sZJDdpx22gG7Y81HoUALOORfMuxQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "bin": { + "chroma": "dist/bin.cjs", + "chromatic": "dist/bin.cjs", + "chromatic-cli": "dist/bin.cjs" + }, + "engines": { + "node": ">=22.0.0" + }, + "peerDependencies": { + "@chromatic-com/cypress": "^0.*.* || ^1.0.0", + "@chromatic-com/playwright": "^0.*.* || ^1.0.0", + "@chromatic-com/vitest": "^0.*.* || ^1.0.0" + }, + "peerDependenciesMeta": { + "@chromatic-com/cypress": { + "optional": true + }, + "@chromatic-com/playwright": { + "optional": true + }, + "@chromatic-com/vitest": { + "optional": true + } + } + }, "node_modules/clsx": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", @@ -2722,6 +4593,28 @@ "url": "https://opencollective.com/express" } }, + "node_modules/css.escape": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/css.escape/-/css.escape-1.5.1.tgz", + "integrity": "sha512-YUifsXXuknHlUsmlgyY0PKzgPOr7/FjCePfHNt0jxm83wHZi44VDMQ7/fGNkjY3/jV1MC+1CmZbaHzugyeRtpg==", + "dev": true, + "license": "MIT" + }, + "node_modules/dedent": { + "version": "1.7.2", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-1.7.2.tgz", + "integrity": "sha512-WzMx3mW98SN+zn3hgemf4OzdmyNhhhKz5Ay0pUfQiMQ3e1g+xmTJWp/pKdwKVXhdSkAEGIIzqeuWrL3mV/AXbA==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "babel-plugin-macros": "^3.1.0" + }, + "peerDependenciesMeta": { + "babel-plugin-macros": { + "optional": true + } + } + }, "node_modules/dedent-js": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/dedent-js/-/dedent-js-1.0.1.tgz", @@ -2729,6 +4622,16 @@ "dev": true, "license": "MIT" }, + "node_modules/deep-eql": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-5.0.2.tgz", + "integrity": "sha512-h5k/5U50IJJFpzfL6nO9jaaumfjO/f2NjK/oYB2Djzm4p9L+3T9qWpZqZ2hAbLPuuYq9wrU08WQyBTL5GbPk5Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/deepmerge": { "version": "4.3.1", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.3.1.tgz", @@ -2739,6 +4642,49 @@ "node": ">=0.10.0" } }, + "node_modules/default-browser": { + "version": "5.5.1", + "resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.1.tgz", + "integrity": "sha512-m1pAzaJgZ/gssEqlOhJkPJp8Xly7QyW6xcrkUa2KKcDeDSEMP7X8xipU3snUcfisTQx0w1AGae+9UtJSfVnXGw==", + "dev": true, + "license": "MIT", + "dependencies": { + "bundle-name": "^4.1.0", + "default-browser-id": "^5.0.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/default-browser-id": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/default-browser-id/-/default-browser-id-5.0.1.tgz", + "integrity": "sha512-x1VCxdX4t+8wVfd1so/9w+vQ4vx7lKd2Qp5tDRutErwmR85OgmfX7RlLRMWafRMY7hbEiXIbudNrjOAPa/hL8Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/define-lazy-prop": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-3.0.0.tgz", + "integrity": "sha512-N+MeXYoqr3pOgn8xfyRPREN7gHakLYjhsHhWGT3fWAiL4IkAt0iDw14QiiEm2bE30c5XX5q0FtAA3CK5f9/BUg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/dequal": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/dequal/-/dequal-2.0.3.tgz", @@ -2793,12 +4739,81 @@ "dev": true, "license": "MIT" }, + "node_modules/es-toolkit": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.52.0.tgz", + "integrity": "sha512-XTNEJQh1tY1ZJVcf6ayP/2n4ZPyaHlW2FWs7xvw5ddPuhUVjLD3olQVQS7kf58JbAB48iL0uL/jerTrjtV3lDA==", + "dev": true, + "license": "MIT", + "workspaces": [ + "docs", + "benchmarks", + "tests/types", + "tests/browser-compat" + ] + }, + "node_modules/esbuild": { + "version": "0.28.2", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.28.2.tgz", + "integrity": "sha512-HKVLS8dvII+xoKW9kmqxbRKrnWEXfJJr/FZhhJmiqIB0e053QNYFqOBouTMO/k5sID4MvCiUCvv8b9M4h32wIA==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=18" + }, + "optionalDependencies": { + "@esbuild/aix-ppc64": "0.28.2", + "@esbuild/android-arm": "0.28.2", + "@esbuild/android-arm64": "0.28.2", + "@esbuild/android-x64": "0.28.2", + "@esbuild/darwin-arm64": "0.28.2", + "@esbuild/darwin-x64": "0.28.2", + "@esbuild/freebsd-arm64": "0.28.2", + "@esbuild/freebsd-x64": "0.28.2", + "@esbuild/linux-arm": "0.28.2", + "@esbuild/linux-arm64": "0.28.2", + "@esbuild/linux-ia32": "0.28.2", + "@esbuild/linux-loong64": "0.28.2", + "@esbuild/linux-mips64el": "0.28.2", + "@esbuild/linux-ppc64": "0.28.2", + "@esbuild/linux-riscv64": "0.28.2", + "@esbuild/linux-s390x": "0.28.2", + "@esbuild/linux-x64": "0.28.2", + "@esbuild/netbsd-arm64": "0.28.2", + "@esbuild/netbsd-x64": "0.28.2", + "@esbuild/openbsd-arm64": "0.28.2", + "@esbuild/openbsd-x64": "0.28.2", + "@esbuild/openharmony-arm64": "0.28.2", + "@esbuild/sunos-x64": "0.28.2", + "@esbuild/win32-arm64": "0.28.2", + "@esbuild/win32-ia32": "0.28.2", + "@esbuild/win32-x64": "0.28.2" + } + }, "node_modules/esm-env": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/esm-env/-/esm-env-1.2.2.tgz", "integrity": "sha512-Epxrv+Nr/CaL4ZcFGPJIYLWFom+YeV1DqMLHJoEd9SYRxNbaFruBwfEX/kkHUJf55j2+TUbmDcmuilbP1TmXHA==", "license": "MIT" }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true, + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/esrap": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/esrap/-/esrap-2.4.0.tgz", @@ -2900,12 +4915,57 @@ "node": ">=12.0.0" } }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, "node_modules/inline-style-parser": { "version": "0.2.7", "resolved": "https://registry.npmjs.org/inline-style-parser/-/inline-style-parser-0.2.7.tgz", "integrity": "sha512-Nb2ctOyNR8DqQoR0OwRG95uNWIC0C1lCgf5Naz5H6Ji72KZ8OcFZLz2P5sNgwlyoJ8Yif11oMuYs5pBQa86csA==", "license": "MIT" }, + "node_modules/is-docker": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-3.0.0.tgz", + "integrity": "sha512-eljcgEDlEns/7AXFosB5K/2nCM4P7FQPkGc/DWLy5rmFEWvZayGrik1d9/QIY5nJ4f9YsVvBkA6kJpHn9rISdQ==", + "dev": true, + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-inside-container": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-inside-container/-/is-inside-container-1.0.0.tgz", + "integrity": "sha512-KIYLCCJghfHZxqjYBE7rEy0OBuTd5xCHS7tHVgvCLkx7StIoaxwNW3hCALgEUjFfeRk+MG/Qxmp/vtETEF3tRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-docker": "^3.0.0" + }, + "bin": { + "is-inside-container": "cli.js" + }, + "engines": { + "node": ">=14.16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-reference": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-3.0.3.tgz", @@ -2916,6 +4976,22 @@ "@types/estree": "^1.0.6" } }, + "node_modules/is-wsl": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-3.1.1.tgz", + "integrity": "sha512-e6rvdUCiQCAuumZslxRJWR/Doq4VpPR82kqclvcS0efgt430SlGIk05vdCN58+VrzgtIcfNODjozVielycD4Sw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-inside-container": "^1.0.0" + }, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/jiti": { "version": "2.7.0", "resolved": "https://registry.npmjs.org/jiti/-/jiti-2.7.0.tgz", @@ -2933,6 +5009,33 @@ "dev": true, "license": "MIT" }, + "node_modules/json-rpc-2.0": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/json-rpc-2.0/-/json-rpc-2.0-1.8.1.tgz", + "integrity": "sha512-BmN42JKn6FI36pcMMzHCXQhpKNEfbeqgSIcUYHKnifq0/4Ey6PDinovwUOgajT7NsgUtpWdDXaCWlpI4LHXN3g==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonc-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", + "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsonfile": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.2.1.tgz", + "integrity": "sha512-zwOTdL3rFQ/lRdBnntKVOX6k5cKJwEc1HdilT71BWEu7J41gXIB2MRp+vxduPSwZJPWBxEzv4yH1wYLJGUHX4Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, "node_modules/kleur": { "version": "4.1.5", "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.5.tgz", @@ -3223,6 +5326,13 @@ "dev": true, "license": "MIT" }, + "node_modules/loupe": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/loupe/-/loupe-3.2.1.tgz", + "integrity": "sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==", + "dev": true, + "license": "MIT" + }, "node_modules/lz-string": { "version": "1.5.0", "resolved": "https://registry.npmjs.org/lz-string/-/lz-string-1.5.0.tgz", @@ -3254,6 +5364,34 @@ "source-map-js": "^1.2.1" } }, + "node_modules/mdsvex": { + "version": "0.12.7", + "resolved": "https://registry.npmjs.org/mdsvex/-/mdsvex-0.12.7.tgz", + "integrity": "sha512-gx4bReLCUvq+MPErHXYeyX+TEq1hsS2KfiZtEOMNTcbibSouFy8AHc5h04KbGCl+g5tLuo4/lbgRVYRnc7bJZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mdast": "^4.0.4", + "@types/unist": "^2.0.3", + "prism-svelte": "^0.4.7", + "prismjs": "^1.17.1", + "unist-util-visit": "^2.0.1", + "vfile-message": "^2.0.4" + }, + "peerDependencies": { + "svelte": "^3.56.0 || ^4.0.0 || ^5.0.0-next.120" + } + }, + "node_modules/min-indent": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, "node_modules/mode-watcher": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/mode-watcher/-/mode-watcher-1.1.0.tgz", @@ -3321,6 +5459,104 @@ "node": ">=12.20.0" } }, + "node_modules/open": { + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/open/-/open-10.2.0.tgz", + "integrity": "sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "default-browser": "^5.2.1", + "define-lazy-prop": "^3.0.0", + "is-inside-container": "^1.0.0", + "wsl-utils": "^0.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/oxc-parser": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/oxc-parser/-/oxc-parser-0.127.0.tgz", + "integrity": "sha512-bkgD4qHlN7WxLdX8bLXdaU54TtQtAIg/ZBAfm0aje/mo3MRDo3P0hZSgr4U7O3xfX+fQmR5AP04JS/TGcZLcFA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@oxc-project/types": "^0.127.0" + }, + "engines": { + "node": "^20.19.0 || >=22.12.0" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxc-parser/binding-android-arm-eabi": "0.127.0", + "@oxc-parser/binding-android-arm64": "0.127.0", + "@oxc-parser/binding-darwin-arm64": "0.127.0", + "@oxc-parser/binding-darwin-x64": "0.127.0", + "@oxc-parser/binding-freebsd-x64": "0.127.0", + "@oxc-parser/binding-linux-arm-gnueabihf": "0.127.0", + "@oxc-parser/binding-linux-arm-musleabihf": "0.127.0", + "@oxc-parser/binding-linux-arm64-gnu": "0.127.0", + "@oxc-parser/binding-linux-arm64-musl": "0.127.0", + "@oxc-parser/binding-linux-ppc64-gnu": "0.127.0", + "@oxc-parser/binding-linux-riscv64-gnu": "0.127.0", + "@oxc-parser/binding-linux-riscv64-musl": "0.127.0", + "@oxc-parser/binding-linux-s390x-gnu": "0.127.0", + "@oxc-parser/binding-linux-x64-gnu": "0.127.0", + "@oxc-parser/binding-linux-x64-musl": "0.127.0", + "@oxc-parser/binding-openharmony-arm64": "0.127.0", + "@oxc-parser/binding-wasm32-wasi": "0.127.0", + "@oxc-parser/binding-win32-arm64-msvc": "0.127.0", + "@oxc-parser/binding-win32-ia32-msvc": "0.127.0", + "@oxc-parser/binding-win32-x64-msvc": "0.127.0" + } + }, + "node_modules/oxc-parser/node_modules/@oxc-project/types": { + "version": "0.127.0", + "resolved": "https://registry.npmjs.org/@oxc-project/types/-/types-0.127.0.tgz", + "integrity": "sha512-aIYXQBo4lCbO4z0R3FHeucQHpF46l2LbMdxRvqvuRuW2OxdnSkcng5B8+K12spgLDj93rtN3+J2Vac/TIO+ciQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + } + }, + "node_modules/oxc-resolver": { + "version": "11.21.2", + "resolved": "https://registry.npmjs.org/oxc-resolver/-/oxc-resolver-11.21.2.tgz", + "integrity": "sha512-w5tLwYN3Zo24w5EeWJjJWZOwhYqTtC8PS2B1tIt7BZUuqTIcU07sQValbDw+rq7+AuAGzOHklgK+ifsy4lpXfw==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxc-resolver/binding-android-arm-eabi": "11.21.2", + "@oxc-resolver/binding-android-arm64": "11.21.2", + "@oxc-resolver/binding-darwin-arm64": "11.21.2", + "@oxc-resolver/binding-darwin-x64": "11.21.2", + "@oxc-resolver/binding-freebsd-x64": "11.21.2", + "@oxc-resolver/binding-linux-arm-gnueabihf": "11.21.2", + "@oxc-resolver/binding-linux-arm-musleabihf": "11.21.2", + "@oxc-resolver/binding-linux-arm64-gnu": "11.21.2", + "@oxc-resolver/binding-linux-arm64-musl": "11.21.2", + "@oxc-resolver/binding-linux-ppc64-gnu": "11.21.2", + "@oxc-resolver/binding-linux-riscv64-gnu": "11.21.2", + "@oxc-resolver/binding-linux-riscv64-musl": "11.21.2", + "@oxc-resolver/binding-linux-s390x-gnu": "11.21.2", + "@oxc-resolver/binding-linux-x64-gnu": "11.21.2", + "@oxc-resolver/binding-linux-x64-musl": "11.21.2", + "@oxc-resolver/binding-openharmony-arm64": "11.21.2", + "@oxc-resolver/binding-wasm32-wasi": "11.21.2", + "@oxc-resolver/binding-win32-arm64-msvc": "11.21.2", + "@oxc-resolver/binding-win32-x64-msvc": "11.21.2" + } + }, "node_modules/oxfmt": { "version": "0.73.0", "resolved": "https://registry.npmjs.org/oxfmt/-/oxfmt-0.73.0.tgz", @@ -3458,6 +5694,16 @@ "dev": true, "license": "MIT" }, + "node_modules/pathval": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pathval/-/pathval-2.0.1.tgz", + "integrity": "sha512-//nshmD55c46FuFw26xV/xFAaB5HF9Xdap7HJBBnrKdAd6/GxDBaNA1870O79+9ueg61cZLSVc+OaFlfmObYVQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 14.16" + } + }, "node_modules/picocolors": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", @@ -3561,6 +5807,23 @@ "node": "^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0" } }, + "node_modules/prism-svelte": { + "version": "0.4.7", + "resolved": "https://registry.npmjs.org/prism-svelte/-/prism-svelte-0.4.7.tgz", + "integrity": "sha512-yABh19CYbM24V7aS7TuPYRNMqthxwbvx6FF/Rw920YbyBWO3tnyPIqRMgHuSVsLmuHkkBS1Akyof463FVdkeDQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/prismjs": { + "version": "1.30.0", + "resolved": "https://registry.npmjs.org/prismjs/-/prismjs-1.30.0.tgz", + "integrity": "sha512-DEvV2ZF2r2/63V+tK8hQvrR2ZGn10srHbXviTlcv7Kpzw8jWiNTqbVgjO3IY8RxrrOUF8VPMQQFysYYYv0YZxw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/publint": { "version": "0.3.25", "resolved": "https://registry.npmjs.org/publint/-/publint-0.3.25.tgz", @@ -3577,10 +5840,33 @@ "publint": "src/cli.js" }, "engines": { - "node": ">=18" + "node": ">=18" + }, + "funding": { + "url": "https://bjornlu.com/sponsor" + } + }, + "node_modules/react": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react/-/react-19.3.1.tgz", + "integrity": "sha512-QNhWdt7nrgVWWQG58QuGsAR3jv3Hbe4mb4vz7w2csnHavciZJgda1CPNaldF6eVxv90ud3jUXpKlHL69gO38yw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.3.1", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.3.1.tgz", + "integrity": "sha512-Y0bARz53lhEC1NMCASs0/j+faB/zqt3R8hpvg1e8+61ZVJ4UL0UdC4cBbXfZMcIuhrfgeILTLe+ZeBCavQPtKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "scheduler": "^0.28.0" }, - "funding": { - "url": "https://bjornlu.com/sponsor" + "peerDependencies": { + "react": "^19.3.1" } }, "node_modules/react-is": { @@ -3604,6 +5890,50 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/recast": { + "version": "0.23.21", + "resolved": "https://registry.npmjs.org/recast/-/recast-0.23.21.tgz", + "integrity": "sha512-mFAyJq9vUbSTARLZUvAEf1z3YxlvAwswbmxMx2mPA/MSm4KmpwvwvhsH/NIrZhyOuwD60Lzyw2qh83uCbgTPYw==", + "dev": true, + "license": "MIT", + "dependencies": { + "ast-types": "^0.16.1", + "esprima": "~4.0.0", + "source-map": "~0.6.1", + "tiny-invariant": "^1.3.3", + "tslib": "^2.0.1" + }, + "engines": { + "node": ">= 4" + } + }, + "node_modules/redent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "indent-string": "^4.0.0", + "strip-indent": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/run-applescript": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/run-applescript/-/run-applescript-7.1.0.tgz", + "integrity": "sha512-DPe5pVFaAsinSaV6QjQ6gdiedWDcRCbUuiQfQa2wmWV7+xC9bGulGI8+TdRmoFkAPaBXk8CrAbnlY2ISniJ47Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/runed": { "version": "0.25.0", "resolved": "https://registry.npmjs.org/runed/-/runed-0.25.0.tgz", @@ -3633,6 +5963,13 @@ "node": ">=6" } }, + "node_modules/scheduler": { + "version": "0.28.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.28.0.tgz", + "integrity": "sha512-juorfCmIkIw8tT+p5BXSm6PJjQF/ycEYmKyzURCIt/RaZIhL+PulbQ9Yu2z1HdOJDdqDTlxA1+xKBmHXJsczAw==", + "dev": true, + "license": "MIT" + }, "node_modules/scule": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/scule/-/scule-1.3.0.tgz", @@ -3668,6 +6005,16 @@ "node": ">=18" } }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/source-map-js": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.2.tgz", @@ -3678,6 +6025,13 @@ "node": ">=0.10.0" } }, + "node_modules/sqids": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/sqids/-/sqids-0.3.0.tgz", + "integrity": "sha512-lOQK1ucVg+W6n3FhRwwSeUijxe93b51Bfz5PMRMihVf1iVkl82ePQG7V5vwrhzB11v0NtsR25PSZRGiSomJaJw==", + "dev": true, + "license": "MIT" + }, "node_modules/std-env": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/std-env/-/std-env-4.3.0.tgz", @@ -3685,6 +6039,110 @@ "dev": true, "license": "MIT" }, + "node_modules/storybook": { + "version": "10.6.2", + "resolved": "https://registry.npmjs.org/storybook/-/storybook-10.6.2.tgz", + "integrity": "sha512-qHDINMiapxFUxYb+xC3j8u7Y+85X3u+/PlytE/wmnyg+bU0agCW3jUmWP4vIh2MioO2jTK/2B3Lcw6IpRFzQBA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@storybook/global": "^5.0.0", + "@storybook/icons": "^2.0.2", + "@testing-library/dom": "^10.4.1", + "@testing-library/jest-dom": "6.9.1", + "@testing-library/user-event": "^14.6.3", + "@vitest/expect": "3.2.4", + "@vitest/spy": "3.2.4", + "@webcontainer/env": "^1.1.1", + "esbuild": "^0.18.0 || ^0.19.0 || ^0.20.0 || ^0.21.0 || ^0.22.0 || ^0.23.0 || ^0.24.0 || ^0.25.0 || ^0.26.0 || ^0.27.0 || ^0.28.0", + "jsonc-parser": "^3.3.1", + "open": "^10.2.0", + "oxc-parser": "^0.127.0", + "oxc-resolver": "11.21.2", + "recast": "^0.23.5", + "semver": "^7.7.3", + "use-sync-external-store": "^1.5.0", + "ws": "^8.21.1" + }, + "bin": { + "storybook": "dist/bin/dispatcher.js" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/storybook" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "prettier": "^2 || ^3", + "vite-plus": "^0.1.15 || ^0.2.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "prettier": { + "optional": true + }, + "vite-plus": { + "optional": true + } + } + }, + "node_modules/storybook/node_modules/@vitest/spy": { + "version": "3.2.4", + "resolved": "https://registry.npmjs.org/@vitest/spy/-/spy-3.2.4.tgz", + "integrity": "sha512-vAfasCOe6AIK70iP5UD11Ac4siNUNJ9i/9PZ3NKx07sG6sUxeag1LWdNrMWeKKYBLlzuK+Gn65Yd5nyL6ds+nw==", + "dev": true, + "license": "MIT", + "dependencies": { + "tinyspy": "^4.0.3" + }, + "funding": { + "url": "https://opencollective.com/vitest" + } + }, + "node_modules/strip-ansi": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.2.0.tgz", + "integrity": "sha512-yDPMNjp4WyfYBkHnjIRLfca1i6KMyGCtsVgoKe/z1+6vukgaENdgGBZt+ZmKPc4gavvEZ5OgHfHdrazhgNyG7w==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^6.2.2" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/strip-ansi/node_modules/ansi-regex": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.4.0.tgz", + "integrity": "sha512-KzTVk2tCWAHtYrvvvaP8bJKJq2pVinhLcGEQdtLIYPbmNGNyYe8QwNaTUYQp2J7/vIsUKt5QCqAfUkYyG9DkOw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/strip-indent": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "min-indent": "^1.0.0" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/style-to-object": { "version": "1.0.14", "resolved": "https://registry.npmjs.org/style-to-object/-/style-to-object-1.0.14.tgz", @@ -3721,6 +6179,51 @@ "node": ">=18" } }, + "node_modules/svelte-ast-print": { + "version": "0.4.2", + "resolved": "https://registry.npmjs.org/svelte-ast-print/-/svelte-ast-print-0.4.2.tgz", + "integrity": "sha512-hRHHufbJoArFmDYQKCpCvc0xUuIEfwYksvyLYEQyH+1xb5LD5sM/IthfooCdXZQtOIqXz6xm7NmaqdfwG4kh6w==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/xeho91" + }, + { + "type": "opencollective", + "url": "https://opencollective.com/xeho91" + } + ], + "license": "MIT", + "dependencies": { + "esrap": "1.2.2", + "zimmerframe": "1.1.2" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "svelte": "^5.0.0" + } + }, + "node_modules/svelte-ast-print/node_modules/esrap": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esrap/-/esrap-1.2.2.tgz", + "integrity": "sha512-F2pSJklxx1BlQIQgooczXCPHmcWpn6EsP5oo73LQfonG9fIlIENQ8vMmfGXeojP9MrkzUNAfyU5vdFlR9shHAw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/sourcemap-codec": "^1.4.15", + "@types/estree": "^1.0.1" + } + }, + "node_modules/svelte-ast-print/node_modules/zimmerframe": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/zimmerframe/-/zimmerframe-1.1.2.tgz", + "integrity": "sha512-rAbqEGa8ovJy4pyBxZM70hg4pE6gDgaQ0Sl9M3enG3I0d6H4XSAM3GeNGLKnsBpuijUow064sf7ww1nutC5/3w==", + "dev": true, + "license": "MIT" + }, "node_modules/svelte-check": { "version": "4.7.7", "resolved": "https://registry.npmjs.org/svelte-check/-/svelte-check-4.7.7.tgz", @@ -3842,6 +6345,19 @@ "integrity": "sha512-dMCuwDUY6Noz3zVKLefBC4wq+aJV20yc7vWmM7uTNGwtQSFF5kX7OUIUsxuVajz/bdt5Xqdah3/0NLjth+cM5A==", "license": "MIT" }, + "node_modules/tagged-tag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/tagged-tag/-/tagged-tag-1.0.0.tgz", + "integrity": "sha512-yEFYrVhod+hdNyx7g5Bnkkb0G6si8HJurOoOEgC8B/O0uXLHlaey/65KRv6cuWBNhBgHKAROVpc7QyYqE5gFng==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/tailwind-merge": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/tailwind-merge/-/tailwind-merge-3.7.0.tgz", @@ -3895,6 +6411,13 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/tiny-invariant": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/tiny-invariant/-/tiny-invariant-1.3.3.tgz", + "integrity": "sha512-+FbBPE1o9QAYvviau/qC5SE3caw21q3xkvWKBtja5vgqOWIHHJ3ioaq1VPfn/Szqctz2bU/oYeKd9/z5BL+PVg==", + "dev": true, + "license": "MIT" + }, "node_modules/tinybench": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/tinybench/-/tinybench-6.2.2.tgz", @@ -3952,6 +6475,31 @@ "node": ">=14.0.0" } }, + "node_modules/tinyspy": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/tinyspy/-/tinyspy-4.0.6.tgz", + "integrity": "sha512-u8KszXvGfU68hVcZpRHKG28T0krMuv2G5nDhiHaMLen/gIuFEgIJhaJuO69qjnXg5paSrbPMFfx3brNuN8eVSg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/tmcp": { + "version": "1.20.1", + "resolved": "https://registry.npmjs.org/tmcp/-/tmcp-1.20.1.tgz", + "integrity": "sha512-fpUliSYZnYOlFbgpUtUAdyKWoLsjyyt1DZc/zvpY5r0aUUUwcp57od4iJGemLcrEQrRF2V7Niktmt7S5DYIqhw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@standard-schema/spec": "^1.0.0", + "@types/json-schema": "^7.0.15", + "json-rpc-2.0": "^1.7.1", + "sqids": "^0.3.0", + "uri-template-matcher": "^1.1.1", + "valibot": "^1.1.0" + } + }, "node_modules/totalist": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/totalist/-/totalist-3.0.1.tgz", @@ -3962,6 +6510,23 @@ "node": ">=6" } }, + "node_modules/ts-dedent": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/ts-dedent/-/ts-dedent-2.3.0.tgz", + "integrity": "sha512-JfJeIHke7y2egdGGgRAvpCwYFUsHlM2gPcrVOxFkznt/4uzQ7HFmvE63iFHVLBJNDuyDOQgijDK/tXH/f6Msjg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6.10" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, "node_modules/tw-animate-css": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/tw-animate-css/-/tw-animate-css-1.4.0.tgz", @@ -3972,6 +6537,19 @@ "url": "https://github.com/sponsors/Wombosvideo" } }, + "node_modules/type-fest": { + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=12.20" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/typescript": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-6.0.3.tgz", @@ -3993,6 +6571,120 @@ "dev": true, "license": "MIT" }, + "node_modules/unist-util-is": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/unist-util-is/-/unist-util-is-4.1.0.tgz", + "integrity": "sha512-ZOQSsnce92GrxSqlnEEseX0gi7GH9zTJZ0p9dtu87WRb/37mMPO2Ilx1s/t9vBHrFhbgweUwb+t7cIn5dxPhZg==", + "dev": true, + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-stringify-position": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-stringify-position/-/unist-util-stringify-position-2.0.3.tgz", + "integrity": "sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/unist-util-visit/-/unist-util-visit-2.0.3.tgz", + "integrity": "sha512-iJ4/RczbJMkD0712mGktuGpm/U4By4FfDonL7N/9tATGIF4imikjOuagyMY53tnZq3NP6BcmlrHhEKAfGWjh7Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0", + "unist-util-visit-parents": "^3.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/unist-util-visit-parents": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/unist-util-visit-parents/-/unist-util-visit-parents-3.1.1.tgz", + "integrity": "sha512-1KROIZWo6bcMrZEwiH2UrXDyalAa0uqzWCxCJj6lPOvTve2WkfgCytoDTPaMnodXh1WrXOq0haVYHj99ynJlsg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-is": "^4.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unplugin": { + "version": "2.3.11", + "resolved": "https://registry.npmjs.org/unplugin/-/unplugin-2.3.11.tgz", + "integrity": "sha512-5uKD0nqiYVzlmCRs01Fhs2BdkEgBS3SAVP6ndrBsuK42iC2+JHyxM05Rm9G8+5mkmRtzMZGY8Ct5+mliZxU/Ww==", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/remapping": "^2.3.5", + "acorn": "^8.15.0", + "picomatch": "^4.0.3", + "webpack-virtual-modules": "^0.6.2" + }, + "engines": { + "node": ">=18.12.0" + } + }, + "node_modules/uri-template-matcher": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/uri-template-matcher/-/uri-template-matcher-1.1.2.tgz", + "integrity": "sha512-uZc1h12jdO3m/R77SfTEOuo6VbMhgWznaawKpBjRGSJb7i91x5PgI37NQJtG+Cerxkk0yr1pylBY2qG1kQ+aEQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/use-sync-external-store": { + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/use-sync-external-store/-/use-sync-external-store-1.7.0.tgz", + "integrity": "sha512-6L+EeigHMQhdaIPNIFUKwfWJSwWFQ8gJbJ2DLOs5sDIegTwR9fRxvnM3uciHKjIZhFz+KAv2emhWMRvDmMcY8A==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/valibot": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/valibot/-/valibot-1.5.0.tgz", + "integrity": "sha512-nil6AkP2TChWL43Z5uJ6GTxX01CUA+g8LWUM+N/rB9NBbkUMaUsi9PUNzlUPgoKASgmx9f7eGOYpJ04/fSa6FQ==", + "dev": true, + "license": "MIT", + "peerDependencies": { + "typescript": ">=5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/vaul-svelte": { "version": "1.0.0-next.7", "resolved": "https://registry.npmjs.org/vaul-svelte/-/vaul-svelte-1.0.0-next.7.tgz", @@ -4025,6 +6717,21 @@ "svelte": "^5.7.0" } }, + "node_modules/vfile-message": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/vfile-message/-/vfile-message-2.0.4.tgz", + "integrity": "sha512-DjssxRGkMvifUOJre00juHoP9DPWuzjxKuMDrhNbk2TdaYYBNMStsNhEOt3idrtI12VQYM/1+iM0KOzXi4pxwQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "^2.0.0", + "unist-util-stringify-position": "^2.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/unified" + } + }, "node_modules/vite": { "name": "@voidzero-dev/vite-plus-core", "version": "1.3.0", @@ -4332,6 +7039,13 @@ "node": ">=12.20.0" } }, + "node_modules/webpack-virtual-modules": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/webpack-virtual-modules/-/webpack-virtual-modules-0.6.2.tgz", + "integrity": "sha512-66/V2i5hQanC51vBQKPH4aI8NMAcBW59FVBs+rC7eGHupMyfn34q7rZIE+ETlJ+XTevqfUhVVBgSUNSW2flEUQ==", + "dev": true, + "license": "MIT" + }, "node_modules/why-is-node-running": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/why-is-node-running/-/why-is-node-running-3.2.1.tgz", @@ -4367,6 +7081,22 @@ } } }, + "node_modules/wsl-utils": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/wsl-utils/-/wsl-utils-0.1.0.tgz", + "integrity": "sha512-h3Fbisa2nKGPxCpm89Hk33lBLsnaGBvctQopaBSOW/uIs6FTe1ATyAnKFJrzVs9vpGdsTe73WF3V4lIsk4Gacw==", + "dev": true, + "license": "MIT", + "dependencies": { + "is-wsl": "^3.1.0" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/yuku-core": { "version": "0.19.0", "resolved": "https://registry.npmjs.org/yuku-core/-/yuku-core-0.19.0.tgz", diff --git a/ui/lib/ui/package.json b/ui/lib/ui/package.json index f29f6d109ac1..af0697b6c4ad 100644 --- a/ui/lib/ui/package.json +++ b/ui/lib/ui/package.json @@ -65,7 +65,7 @@ "./surfaces.css": "./dist/styles/surfaces.css" }, "scripts": { - "dev": "vp dev", + "dev": "bash scripts/dev.sh", "build": "vp build && npm run prepack", "preview": "vp preview", "prepare": "svelte-kit sync || echo ''", @@ -74,9 +74,18 @@ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch", "test:unit": "vp test", "test": "npm run test:unit -- --run", + "storybook": "storybook dev -p 6006", + "build-storybook": "storybook build", "watch:package": "svelte-kit sync && svelte-package -w" }, "devDependencies": { + "@chromatic-com/storybook": "^5.5.1", + "@storybook/addon-a11y": "^10.6.2", + "@storybook/addon-docs": "^10.6.2", + "@storybook/addon-mcp": "10.6.2", + "@storybook/addon-svelte-csf": "^5.1.5", + "@storybook/addon-vitest": "^10.6.2", + "@storybook/sveltekit": "^10.6.2", "@sveltejs/adapter-auto": "^8.0.0", "@sveltejs/kit": "^3.0.0", "@sveltejs/package": "^2.5.8", @@ -85,9 +94,11 @@ "@types/node": "^24", "@vitest/browser-playwright": "5.0.5", "@vitest/coverage-v8": "5.0.5", + "mdsvex": "0.12.7", "mode-watcher": "^1.1.0", "playwright": "^1.60.0", "publint": "^0.3.21", + "storybook": "^10.6.2", "svelte": "^5.57.1", "svelte-check": "^4.6.0", "tailwindcss": "^4.3.3", diff --git a/ui/lib/ui/scripts/dev.sh b/ui/lib/ui/scripts/dev.sh new file mode 100755 index 000000000000..6c7552b13de9 --- /dev/null +++ b/ui/lib/ui/scripts/dev.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +# Development script for @ggml-org/llama-ui (a Svelte library, not an app). +# +# Storybook on :6006 is the primary surface for building and testing components. +# The SvelteKit sandbox (src/routes) runs via `vp dev` on :5173 as a demo harness. +# To develop against the built package output from another repo, also run: +# npm run watch:package +# +# Usage: +# npm run dev + +echo "Starting development servers..." + +storybook dev -p 6006 --ci & +vp dev & + +# Wait for all background processes +wait diff --git a/ui/lib/ui/src/lib/styles/surfaces.css b/ui/lib/ui/src/lib/styles/surfaces.css index fa4aeb7ef977..9f38783fdac4 100644 --- a/ui/lib/ui/src/lib/styles/surfaces.css +++ b/ui/lib/ui/src/lib/styles/surfaces.css @@ -131,15 +131,14 @@ } /* Floating panel (menus, popovers, drawers): frosted fill, faint rim, lifted shadow. The edge is the hairline ring - baked into the shadow, not the border, so the two never draw a double edge; the border stays transparent so the - panel keeps its size. */ + baked into the shadow; the panel's 1px border is its rim, the inner highlight right inside the ring. An inset + shadow for the rim would sit inside the border instead, and the 1px between the two would draw a double edge. */ @utility matte-float { background-color: var(--float-background, var(--float-panel-background)); - border-color: transparent; + border-color: var(--float-panel-highlight); color: var(--float-panel-text); backdrop-filter: blur(var(--blur-surface)) saturate(1.5); box-shadow: - inset 0 0 0 1px var(--float-panel-highlight), var(--float-panel-shadow), 0 0 0 var(--elevation-ring-width) var(--float-panel-edge); } diff --git a/ui/lib/ui/src/routes/+page.svelte b/ui/lib/ui/src/routes/+page.svelte index d9c7b2d52b41..bb9fc89c0fdb 100644 --- a/ui/lib/ui/src/routes/+page.svelte +++ b/ui/lib/ui/src/routes/+page.svelte @@ -5,10 +5,12 @@ const next = { light: 'dark', dark: 'system', system: 'light' } as const; - +

@ggml-org/llama-ui

+

The full set is in Storybook: npm run storybook

+
diff --git a/ui/apps/chat/tests/stories/a11y/ActionIcon.a11y.stories.svelte b/ui/lib/ui/tests/stories/app/ActionIcon.a11y.stories.svelte similarity index 93% rename from ui/apps/chat/tests/stories/a11y/ActionIcon.a11y.stories.svelte rename to ui/lib/ui/tests/stories/app/ActionIcon.a11y.stories.svelte index cef659d6c7fc..2a0635015db2 100644 --- a/ui/apps/chat/tests/stories/a11y/ActionIcon.a11y.stories.svelte +++ b/ui/lib/ui/tests/stories/app/ActionIcon.a11y.stories.svelte @@ -10,7 +10,7 @@ layout: 'centered' }, tags: ['!dev'], - title: 'Components/ActionIcon/Accessibility' + title: 'Llama UI/App components/ActionIcon/Accessibility' }); diff --git a/ui/lib/ui/tests/stories/app/ActionIcon.stories.svelte b/ui/lib/ui/tests/stories/app/ActionIcon.stories.svelte new file mode 100644 index 000000000000..ee3b1a62f6e4 --- /dev/null +++ b/ui/lib/ui/tests/stories/app/ActionIcon.stories.svelte @@ -0,0 +1,34 @@ + + + + + +
+ + + + + +
+
+ + + + +
+
diff --git a/ui/lib/ui/tests/stories/app/SearchInput.stories.svelte b/ui/lib/ui/tests/stories/app/SearchInput.stories.svelte new file mode 100644 index 000000000000..13db4d2be05c --- /dev/null +++ b/ui/lib/ui/tests/stories/app/SearchInput.stories.svelte @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + diff --git a/ui/lib/ui/tests/stories/app/SyntaxHighlightedCode.stories.svelte b/ui/lib/ui/tests/stories/app/SyntaxHighlightedCode.stories.svelte new file mode 100644 index 000000000000..e3bd6cc2abc2 --- /dev/null +++ b/ui/lib/ui/tests/stories/app/SyntaxHighlightedCode.stories.svelte @@ -0,0 +1,23 @@ + + + diff --git a/ui/lib/ui/tests/stories/brand/fonts/LlamaMono.woff2 b/ui/lib/ui/tests/stories/brand/fonts/LlamaMono.woff2 new file mode 100644 index 000000000000..f43b2588dc35 Binary files /dev/null and b/ui/lib/ui/tests/stories/brand/fonts/LlamaMono.woff2 differ diff --git a/ui/lib/ui/tests/stories/brand/fonts/OFL.txt b/ui/lib/ui/tests/stories/brand/fonts/OFL.txt new file mode 100644 index 000000000000..04e95fc55085 --- /dev/null +++ b/ui/lib/ui/tests/stories/brand/fonts/OFL.txt @@ -0,0 +1,93 @@ +Copyright 2024 The Geist Project Authors (https://github.com/vercel/geist-font) + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +https://openfontlicense.org + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. \ No newline at end of file diff --git a/ui/lib/ui/tests/stories/brand/fonts/fonts.css b/ui/lib/ui/tests/stories/brand/fonts/fonts.css new file mode 100644 index 000000000000..8d9409b2fd94 --- /dev/null +++ b/ui/lib/ui/tests/stories/brand/fonts/fonts.css @@ -0,0 +1,8 @@ +/* Llama Mono for the brand showcases (logo and type); Llama Sans is the design system's own (src/app.css) */ +@font-face { + font-family: 'Llama Mono'; + src: url('./LlamaMono.woff2') format('woff2'); + font-weight: 400 700; + font-style: normal; + font-display: block; +} diff --git a/ui/lib/ui/tests/stories/components/actions/Button.stories.svelte b/ui/lib/ui/tests/stories/components/actions/Button.stories.svelte new file mode 100644 index 000000000000..bbabfd5a03e8 --- /dev/null +++ b/ui/lib/ui/tests/stories/components/actions/Button.stories.svelte @@ -0,0 +1,54 @@ + + + + + {#each variants as variant (variant)} + +
+ {#each sizes as size (size)} + + {/each} + + + + +
+
+ {/each} + + +
+ + + +
+
+
+
diff --git a/ui/lib/ui/tests/stories/components/actions/ButtonGroup.stories.svelte b/ui/lib/ui/tests/stories/components/actions/ButtonGroup.stories.svelte new file mode 100644 index 000000000000..9704b419c532 --- /dev/null +++ b/ui/lib/ui/tests/stories/components/actions/ButtonGroup.stories.svelte @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/lib/ui/tests/stories/components/actions/Toggle.stories.svelte b/ui/lib/ui/tests/stories/components/actions/Toggle.stories.svelte new file mode 100644 index 000000000000..15594608f33e --- /dev/null +++ b/ui/lib/ui/tests/stories/components/actions/Toggle.stories.svelte @@ -0,0 +1,66 @@ + + + + + + + + + + + + + +
+ + + +
+
+ + +
+ Wrap + + Wrap + + Wrap +
+
+ + + + + + +
+ + + Toggle + + + + Wrap + + + + +
+
+
+
diff --git a/ui/lib/ui/tests/stories/components/actions/ToggleGroup.stories.svelte b/ui/lib/ui/tests/stories/components/actions/ToggleGroup.stories.svelte new file mode 100644 index 000000000000..73eabcf47ffb --- /dev/null +++ b/ui/lib/ui/tests/stories/components/actions/ToggleGroup.stories.svelte @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + Tools + + Vision + + Audio + + + + + + Tools + + Vision + + Audio + + + + +
+ {#each sizes as size (size)} + + + + + + {/each} +
+
+ + + + + + + + +
+
diff --git a/ui/lib/ui/tests/stories/components/display/Alert.stories.svelte b/ui/lib/ui/tests/stories/components/display/Alert.stories.svelte new file mode 100644 index 000000000000..85e7ca7cb604 --- /dev/null +++ b/ui/lib/ui/tests/stories/components/display/Alert.stories.svelte @@ -0,0 +1,77 @@ + + + + + + + + + Model is loading + + The first reply can take a few seconds. + + + + + + + + Context is full + + Start a new chat or remove some attachments. + + + + + + + + Model loaded + + Qwen 2.5 7B is ready on port 9931. + + + + + + + + Low memory + + Gemma 2 27B needs 16.6 GB; 12 GB is free. + + + + + + + + Update available + + llama.cpp b9726 adds faster prompt processing. + + + + + + + + Saved to this browser + + + + diff --git a/ui/lib/ui/tests/stories/components/display/Badge.stories.svelte b/ui/lib/ui/tests/stories/components/display/Badge.stories.svelte new file mode 100644 index 000000000000..86862b0fa17d --- /dev/null +++ b/ui/lib/ui/tests/stories/components/display/Badge.stories.svelte @@ -0,0 +1,35 @@ + + + + + {#each variants as variant (variant)} + + Q4_K_M + + {/each} + + diff --git a/ui/lib/ui/tests/stories/components/display/Card.stories.svelte b/ui/lib/ui/tests/stories/components/display/Card.stories.svelte new file mode 100644 index 000000000000..3119820d4c18 --- /dev/null +++ b/ui/lib/ui/tests/stories/components/display/Card.stories.svelte @@ -0,0 +1,33 @@ + + + + + + Qwen3.8-27B + + 131k context, vision and tool use + + + + Loaded on the server and ready to answer. + + + + + + + + + diff --git a/ui/lib/ui/tests/stories/components/display/Collapsible.stories.svelte b/ui/lib/ui/tests/stories/components/display/Collapsible.stories.svelte new file mode 100644 index 000000000000..2546c3c2ad22 --- /dev/null +++ b/ui/lib/ui/tests/stories/components/display/Collapsible.stories.svelte @@ -0,0 +1,52 @@ + + +{#snippet section(open: boolean)} + +
+ Advanced sampling + + + {#snippet child({ props })} + + {/snippet} + +
+ +
temperature 0.8
+ + +
top_p 0.95
+ +
min_p 0.05
+
+
+{/snippet} + + + + + {@render section(false)} + + + + {@render section(true)} + + + diff --git a/ui/lib/ui/tests/stories/components/display/Empty.stories.svelte b/ui/lib/ui/tests/stories/components/display/Empty.stories.svelte new file mode 100644 index 000000000000..4e24b3fc82cd --- /dev/null +++ b/ui/lib/ui/tests/stories/components/display/Empty.stories.svelte @@ -0,0 +1,32 @@ + + + + + + + + + + No conversations yet + + Your chats are saved in this browser and show up here. + + + + + + + diff --git a/ui/lib/ui/tests/stories/components/display/ScrollArea.stories.svelte b/ui/lib/ui/tests/stories/components/display/ScrollArea.stories.svelte new file mode 100644 index 000000000000..5f352b904353 --- /dev/null +++ b/ui/lib/ui/tests/stories/components/display/ScrollArea.stories.svelte @@ -0,0 +1,29 @@ + + + + +
+

Conversations

+ + {#each chats as chat (chat)} +
{chat}
+ + + {/each} +
+
+
diff --git a/ui/lib/ui/tests/stories/components/display/Separator.stories.svelte b/ui/lib/ui/tests/stories/components/display/Separator.stories.svelte new file mode 100644 index 000000000000..8a659c0d9975 --- /dev/null +++ b/ui/lib/ui/tests/stories/components/display/Separator.stories.svelte @@ -0,0 +1,34 @@ + + + +
+

Qwen3.8-27B

+ +

Loaded, 131k context

+ + + +
+ Chat + + + + Models + + + + Settings +
+
+
diff --git a/ui/lib/ui/tests/stories/components/display/Skeleton.stories.svelte b/ui/lib/ui/tests/stories/components/display/Skeleton.stories.svelte new file mode 100644 index 000000000000..ae2dba5ffb2d --- /dev/null +++ b/ui/lib/ui/tests/stories/components/display/Skeleton.stories.svelte @@ -0,0 +1,40 @@ + + + + + +
+ + + + + +
+
+ + +
+ + +
+ + + +
+
+
+
+
diff --git a/ui/lib/ui/tests/stories/components/display/Table.stories.svelte b/ui/lib/ui/tests/stories/components/display/Table.stories.svelte new file mode 100644 index 000000000000..d253cc53a620 --- /dev/null +++ b/ui/lib/ui/tests/stories/components/display/Table.stories.svelte @@ -0,0 +1,60 @@ + + + +
+ + Models on this server + + + + Model + + Quant + + Context + + Size + + + + + {#each rows as row (row.model + row.quant)} + + {row.model} + + {row.quant} + + {row.context} + + {row.size} + + {/each} + + + + + Total + + 47.1 GB + + + +
+
diff --git a/ui/lib/ui/tests/stories/components/forms/Checkbox.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Checkbox.stories.svelte new file mode 100644 index 000000000000..a091f067558d --- /dev/null +++ b/ui/lib/ui/tests/stories/components/forms/Checkbox.stories.svelte @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/lib/ui/tests/stories/components/forms/Input.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Input.stories.svelte new file mode 100644 index 000000000000..14404c5a9930 --- /dev/null +++ b/ui/lib/ui/tests/stories/components/forms/Input.stories.svelte @@ -0,0 +1,38 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/lib/ui/tests/stories/components/forms/Label.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Label.stories.svelte new file mode 100644 index 000000000000..dcf3a927d6ae --- /dev/null +++ b/ui/lib/ui/tests/stories/components/forms/Label.stories.svelte @@ -0,0 +1,21 @@ + + + +
+ + + +
+
diff --git a/ui/lib/ui/tests/stories/components/forms/RadioGroup.stories.svelte b/ui/lib/ui/tests/stories/components/forms/RadioGroup.stories.svelte new file mode 100644 index 000000000000..1e31f12689bd --- /dev/null +++ b/ui/lib/ui/tests/stories/components/forms/RadioGroup.stories.svelte @@ -0,0 +1,43 @@ + + + + + + + {#each options as option (option)} + + {/each} + + + + + + {#each options as option (option)} + + {/each} + + + + diff --git a/ui/lib/ui/tests/stories/components/forms/Select.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Select.stories.svelte new file mode 100644 index 000000000000..bd3e1743263b --- /dev/null +++ b/ui/lib/ui/tests/stories/components/forms/Select.stories.svelte @@ -0,0 +1,60 @@ + + + + + + + Choose a theme + + + + + + Dark + + + + + + System + + + + +
+ + Light + + + + Theme + + {#each themes as theme (theme.value)} + + {/each} + + + +
+
+
+
diff --git a/ui/lib/ui/tests/stories/components/forms/Switch.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Switch.stories.svelte new file mode 100644 index 000000000000..c9cb3453ff79 --- /dev/null +++ b/ui/lib/ui/tests/stories/components/forms/Switch.stories.svelte @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/ui/lib/ui/tests/stories/components/forms/Textarea.stories.svelte b/ui/lib/ui/tests/stories/components/forms/Textarea.stories.svelte new file mode 100644 index 000000000000..779c152223e8 --- /dev/null +++ b/ui/lib/ui/tests/stories/components/forms/Textarea.stories.svelte @@ -0,0 +1,34 @@ + + + + + +