diff options
| author | Adam Malczewski <[email protected]> | 2026-05-21 19:06:15 +0900 |
|---|---|---|
| committer | Adam Malczewski <[email protected]> | 2026-05-21 19:06:15 +0900 |
| commit | 55633c90c0d96e62153a4b6655f3f833a3b46ad4 (patch) | |
| tree | a75f97b48071eb1ba9e8366d8053a376dde69af5 /packages/frontend/src | |
| parent | d6b208342edf97bafa5b1dcc986b782f9879d141 (diff) | |
| download | dispatch-55633c90c0d96e62153a4b6655f3f833a3b46ad4.tar.gz dispatch-55633c90c0d96e62153a4b6655f3f833a3b46ad4.zip | |
refactor: gut model/tag/fallback/agent-template system, fix Docker setup
- Remove ModelResolver, model definitions, model tags, fallback order, agent templates
- Remove all [[models]], [agents], and fallback from dispatch.toml and config schema
- ModelRegistry is now a pure key-state manager
- dispatch.toml reduced to keys + permissions only
- Docker: fix entrypoint for existing UID, skip bun install in frontend container
- Docker: scoped build cache prune in bin/clean
Diffstat (limited to 'packages/frontend/src')
| -rw-r--r-- | packages/frontend/src/App.svelte | 14 | ||||
| -rw-r--r-- | packages/frontend/src/lib/components/ModelStatus.svelte | 26 | ||||
| -rw-r--r-- | packages/frontend/src/lib/components/SidebarPanel.svelte | 8 | ||||
| -rw-r--r-- | packages/frontend/src/lib/types.ts | 6 |
4 files changed, 7 insertions, 47 deletions
diff --git a/packages/frontend/src/App.svelte b/packages/frontend/src/App.svelte index 51fbd00..4ea968c 100644 --- a/packages/frontend/src/App.svelte +++ b/packages/frontend/src/App.svelte @@ -9,14 +9,12 @@ import HotReloadIndicator from "./lib/components/HotReloadIndicator.svelte"; import { chatStore } from "./lib/chat.svelte.js"; import { wsClient } from "./lib/ws.svelte.js"; import { config } from "./lib/config.js"; -import type { KeyInfo, ModelInfo } from "./lib/types.js"; +import type { KeyInfo } from "./lib/types.js"; const STORAGE_KEY = "dispatch-theme"; -let modelsData = $state<{ models: ModelInfo[]; keys: KeyInfo[]; tags: string[] }>({ - models: [], +let modelsData = $state<{ keys: KeyInfo[] }>({ keys: [], - tags: [], }); let sidebarOpen = $state(true); @@ -27,9 +25,7 @@ async function fetchModels() { if (!res.ok) return; const data = await res.json(); modelsData = { - models: data.models ?? [], keys: data.keys ?? [], - tags: data.tags ? (Array.isArray(data.tags) ? data.tags : Object.keys(data.tags)) : [], }; } catch { // ignore fetch errors @@ -83,10 +79,8 @@ onMount(() => { class="w-80 flex-1 min-h-0 overflow-y-auto bg-base-100 border-l border-base-300 px-2 py-2 flex flex-col gap-2 [&>*]:shrink-0 transition-transform duration-300 ease-out" style="transform: translateX({sidebarOpen ? '0' : '100%'})" > - <SidebarPanel - models={modelsData.models} - keys={modelsData.keys} - tags={modelsData.tags} + <SidebarPanel + keys={modelsData.keys} tasks={chatStore.tasks} permissionLog={chatStore.permissionLog} apiBase={config.apiBase} diff --git a/packages/frontend/src/lib/components/ModelStatus.svelte b/packages/frontend/src/lib/components/ModelStatus.svelte index b2b6902..a627de8 100644 --- a/packages/frontend/src/lib/components/ModelStatus.svelte +++ b/packages/frontend/src/lib/components/ModelStatus.svelte @@ -7,12 +7,6 @@ exhaustedAt: number | null; } - interface ModelInfo { - id: string; - provider: string; - tags: string[]; - } - interface CredentialStatus { keyId: string; provider: string; @@ -23,15 +17,11 @@ } const { - models = [], keys = [], - tags = [], currentModel, apiBase = "", }: { - models?: ModelInfo[]; keys?: KeyInfo[]; - tags?: string[]; currentModel?: string; apiBase?: string; } = $props(); @@ -42,8 +32,6 @@ const allExhausted = $derived(totalKeys > 0 && activeKeys === 0); const someExhausted = $derived(totalKeys > 0 && activeKeys < totalKeys && activeKeys > 0); - const uniqueTags = $derived([...new Set(tags)]); - let credentialStatus = $state<Record<string, CredentialStatus>>({}); let importingKey = $state<string | null>(null); let importError = $state<string | null>(null); @@ -158,7 +146,7 @@ </script> <div class="flex flex-col gap-3"> - {#if models.length === 0 && keys.length === 0} + {#if keys.length === 0} <p class="text-xs text-base-content/50"> No models configured. Using environment defaults. </p> @@ -191,18 +179,6 @@ </div> {/if} - <!-- Tags --> - {#if uniqueTags.length > 0} - <div class="flex flex-col gap-1"> - <p class="text-xs text-base-content/50 uppercase tracking-wide">Tags</p> - <div class="flex flex-wrap gap-1"> - {#each uniqueTags as tag (tag)} - <span class="badge badge-outline badge-xs">{tag}</span> - {/each} - </div> - </div> - {/if} - <!-- Import error/success banners --> {#if importError} <div role="alert" class="text-xs text-error/80">{importError}</div> diff --git a/packages/frontend/src/lib/components/SidebarPanel.svelte b/packages/frontend/src/lib/components/SidebarPanel.svelte index 79eb73b..e5536de 100644 --- a/packages/frontend/src/lib/components/SidebarPanel.svelte +++ b/packages/frontend/src/lib/components/SidebarPanel.svelte @@ -7,12 +7,10 @@ import PermissionLog from "./PermissionLog.svelte"; import KeyUsage from "./KeyUsage.svelte"; import ClaudeReset from "./ClaudeReset.svelte"; - import type { TaskItem, LogEntry, KeyInfo, ModelInfo } from "../types.js"; + import type { TaskItem, LogEntry, KeyInfo } from "../types.js"; const { - models = [], keys = [], - tags = [], tasks = [], permissionLog = [], apiBase = "", @@ -23,9 +21,7 @@ onModelChange, onReasoningChange, }: { - models?: ModelInfo[]; keys?: KeyInfo[]; - tags?: string[]; tasks?: TaskItem[]; permissionLog?: LogEntry[]; apiBase?: string; @@ -109,7 +105,7 @@ {:else if panel.selected === "Claude Reset"} <ClaudeReset {apiBase} /> {:else if panel.selected === "Model Status"} - <ModelStatus {models} {keys} {tags} {apiBase} /> + <ModelStatus {keys} {apiBase} /> {:else if panel.selected === "Tasks"} <TaskListPanel {tasks} /> {:else if panel.selected === "Config"} diff --git a/packages/frontend/src/lib/types.ts b/packages/frontend/src/lib/types.ts index 559742d..28752a0 100644 --- a/packages/frontend/src/lib/types.ts +++ b/packages/frontend/src/lib/types.ts @@ -94,12 +94,6 @@ export interface KeyInfo { exhaustedAt: number | null; } -export interface ModelInfo { - id: string; - provider: string; - tags: string[]; -} - export interface LogEntry { id: string; permission: string; |
