Compare commits

...
Author SHA1 Message Date
multica-builderandmultica-agent 5d909aca3b feat: models settings page per approved A darkroom spec (HEL-605)
- New /models page: LLM cards (type tag, agent-default badge, test state
  with latency/consecutive failures), add/edit form (OpenAI-compatible
  segment, mono base URL/model, masked key with sk-****tail, timeout
  dropdown, save gated on a passing test), agent default-model panel for
  the five AIGC agents, dashed server-connectivity notice, disabled
  image/video tabs as future placeholders; responsive 1440/1024/768
  breakpoints per spec-v2 §9.
- Scoped A darkroom design tokens in app.css (.a-darkroom) + Noto Sans SC.
- Top nav: add Agents and Models entries before Settings.
- Backend: add 'style' agent role, llm-test timeout_sec (5-60, default 10),
  api_key_tail (last 4 chars) in public profiles; 4 new tests.
- i18n: 84 models.* keys + nav.agents/nav.models in all 7 dictionaries.

Co-authored-by: multica-agent <github@multica.ai>
2026-09-27 20:49:59 +08:00
multica-builder 786b349752 feat: default UI language to zh and add LLM connection test
- First-open default language is now Simplified Chinese (i18n.svelte.ts);
  stored language choice still wins.
- New POST /api/settings/llm-test endpoint probes an OpenAI-compatible
  endpoint with a 1-token chat completion; falls back to a saved profile's
  secret so keys never travel back to the browser.
- Settings LLM cards gain a connection-test button with readable
  success/failure feedback (auth / timeout / connect / HTTP detail),
  localized in all seven dictionaries.
- Backend tests cover success, saved-secret reuse, 401, connection
  refused, and input validation against a local fake OpenAI server.
2026-09-27 20:04:46 +08:00
18 changed files with 2812 additions and 16 deletions
+12 -1
View File
@@ -59,7 +59,15 @@ DEFAULT_AGENT_HARDENING_PROMPT = """You are operating under additional operator-
# Agent roles that can be pinned to a specific LLM profile. Values live in # Agent roles that can be pinned to a specific LLM profile. Values live in
# Settings.agent_llm_assignments (role -> profile id or None). A missing or # Settings.agent_llm_assignments (role -> profile id or None). A missing or
# None entry means "use the Active LLM". # None entry means "use the Active LLM".
AGENT_LLM_ROLES: tuple[str, ...] = ("main", "planner", "story", "script", "assets", "video") AGENT_LLM_ROLES: tuple[str, ...] = (
"main",
"planner",
"story",
"style",
"script",
"assets",
"video",
)
def is_ephemeral_path(path: Path | str | None) -> bool: def is_ephemeral_path(path: Path | str | None) -> bool:
@@ -318,6 +326,9 @@ class Settings(BaseSettings):
"base_url": p["base_url"], "base_url": p["base_url"],
"model": p["model"], "model": p["model"],
"api_key": bool(p.get("api_key")), "api_key": bool(p.get("api_key")),
# Last 4 characters only — enough to recognise a saved key in
# the UI without ever exposing it (GitHub/Stripe convention).
"api_key_tail": (p.get("api_key") or "")[-4:] or None,
} }
for p in self.llm_profiles for p in self.llm_profiles
] ]
@@ -1,7 +1,9 @@
from __future__ import annotations from __future__ import annotations
import time
from typing import Any from typing import Any
import httpx
from fastapi import APIRouter, HTTPException from fastapi import APIRouter, HTTPException
from pydantic import BaseModel, Field from pydantic import BaseModel, Field
@@ -11,6 +13,9 @@ router = APIRouter()
_LEGACY_LLM_KEYS = {"llm_base_url", "llm_model", "llm_api_key"} _LEGACY_LLM_KEYS = {"llm_base_url", "llm_model", "llm_api_key"}
_LLM_TEST_TIMEOUT_SEC = 15.0
_LLM_TEST_TIMEOUT_RANGE = (5, 60)
class LlmProfileIn(BaseModel): class LlmProfileIn(BaseModel):
id: str | None = None id: str | None = None
@@ -20,6 +25,18 @@ class LlmProfileIn(BaseModel):
api_key: str | None = None api_key: str | None = None
class LlmTestIn(BaseModel):
profile_id: str | None = None
base_url: str | None = None
model: str | None = None
api_key: str | None = None
# Probe timeout requested by the caller (models settings page dropdown).
# Clamped server-side regardless of what the client sends.
timeout_sec: float | None = Field(
None, ge=_LLM_TEST_TIMEOUT_RANGE[0], le=_LLM_TEST_TIMEOUT_RANGE[1]
)
class SettingsUpdate(BaseModel): class SettingsUpdate(BaseModel):
llm_base_url: str | None = None llm_base_url: str | None = None
llm_model: str | None = None llm_model: str | None = None
@@ -106,3 +123,76 @@ async def update_settings(payload: SettingsUpdate) -> dict[str, Any]:
settings.save_config_file() settings.save_config_file()
return settings.to_public_dict() return settings.to_public_dict()
@router.post("/llm-test")
async def test_llm_connection(payload: LlmTestIn) -> dict[str, Any]:
settings.ensure_llm_profiles()
base_url = (payload.base_url or "").strip()
model = (payload.model or "").strip()
api_key = (payload.api_key or "").strip() or None
if payload.profile_id:
profile = next(
(p for p in settings.llm_profiles if p.get("id") == payload.profile_id), None
)
if profile is None:
raise HTTPException(status_code=404, detail="Unknown LLM profile")
if not base_url:
base_url = str(profile.get("base_url") or "").strip()
if not model:
model = str(profile.get("model") or "").strip()
if api_key is None:
key = profile.get("api_key")
if isinstance(key, str) and key.strip():
api_key = key
if not base_url or not model:
raise HTTPException(status_code=400, detail="base_url and model are required")
url = f"{base_url.rstrip('/')}/chat/completions"
headers = {"Content-Type": "application/json"}
if api_key:
headers["Authorization"] = f"Bearer {api_key}"
body = {
"model": model,
"messages": [{"role": "user", "content": "ping"}],
"max_tokens": 1,
"stream": False,
"temperature": 0,
}
timeout_sec = payload.timeout_sec if payload.timeout_sec is not None else _LLM_TEST_TIMEOUT_SEC
timeout_sec = min(
max(timeout_sec, _LLM_TEST_TIMEOUT_RANGE[0]),
_LLM_TEST_TIMEOUT_RANGE[1],
)
started = time.perf_counter()
try:
async with httpx.AsyncClient(timeout=timeout_sec) as client:
resp = await client.post(url, headers=headers, json=body)
except httpx.TimeoutException:
return {
"ok": False,
"error": "timeout",
"detail": f"no response within {timeout_sec:.0f}s",
"timeout_sec": timeout_sec,
}
except httpx.HTTPError as exc:
return {"ok": False, "error": "connect", "detail": str(exc) or exc.__class__.__name__}
elapsed_ms = int((time.perf_counter() - started) * 1000)
if resp.status_code in (401, 403):
return {"ok": False, "error": "auth", "detail": f"HTTP {resp.status_code}"}
if resp.status_code == 404:
return {
"ok": False,
"error": "not_found",
"detail": "HTTP 404 — check base URL (OpenAI-compatible servers usually end with /v1)",
}
if resp.status_code >= 400:
text = resp.text[:200].strip().replace("\n", " ")
return {"ok": False, "error": "http", "detail": f"HTTP {resp.status_code}: {text}"}
try:
data = resp.json()
except ValueError:
return {"ok": False, "error": "http", "detail": "response is not JSON"}
if not (isinstance(data, dict) and data.get("choices")):
return {"ok": False, "error": "http", "detail": "response has no choices"}
return {"ok": True, "elapsed_ms": elapsed_ms}
@@ -0,0 +1,260 @@
"""LLM connection test endpoint: probe an OpenAI-compatible endpoint without paid keys."""
from __future__ import annotations
import json
import socket
import threading
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
import pytest
from calliope.config import settings
class _FakeOpenAIHandler(BaseHTTPRequestHandler):
server_version = "FakeOpenAI/1.0"
def do_POST(self):
length = int(self.headers.get("Content-Length") or 0)
body = json.loads(self.rfile.read(length) or b"{}")
auth = self.headers.get("Authorization") or ""
seen = {"path": self.path, "auth": auth, "body": body}
self.server.requests.append(seen)
if self.path != "/v1/chat/completions":
self._send(404, {"error": "not found"})
return
if self.server.require_auth and auth != f"Bearer {self.server.api_key}":
self._send(401, {"error": {"message": "Incorrect API key"}})
return
self._send(
200,
{
"id": "chatcmpl-test",
"object": "chat.completion",
"model": body.get("model", "fake"),
"choices": [
{"index": 0, "message": {"role": "assistant", "content": "pong"}, "finish_reason": "stop"}
],
},
)
def _send(self, status: int, payload: dict) -> None:
data = json.dumps(payload).encode("utf-8")
self.send_response(status)
self.send_header("Content-Type", "application/json")
self.send_header("Content-Length", str(len(data)))
self.end_headers()
self.wfile.write(data)
def log_message(self, format, *args):
pass
@pytest.fixture
def fake_openai():
server = ThreadingHTTPServer(("127.0.0.1", 0), _FakeOpenAIHandler)
server.requests = []
server.require_auth = False
server.api_key = ""
thread = threading.Thread(target=server.serve_forever, daemon=True)
thread.start()
try:
yield server
finally:
server.shutdown()
server.server_close()
def _url(server) -> str:
return f"http://127.0.0.1:{server.server_address[1]}/v1"
def _snapshot() -> dict:
return {
"llm_profiles": [dict(p) for p in (settings.llm_profiles or [])],
"llm_active_id": settings.llm_active_id,
"llm_base_url": settings.llm_base_url,
"llm_model": settings.llm_model,
"llm_api_key": settings.llm_api_key,
}
def _restore(prev: dict) -> None:
for key, value in prev.items():
setattr(settings, key, value)
def test_llm_test_success(client, fake_openai):
r = client.post(
"/api/settings/llm-test",
json={"base_url": _url(fake_openai), "model": "fake-model", "api_key": "sk-test"},
)
assert r.status_code == 200
body = r.json()
assert body["ok"] is True
assert isinstance(body["elapsed_ms"], int)
assert fake_openai.requests[0]["path"] == "/v1/chat/completions"
assert fake_openai.requests[0]["auth"] == "Bearer sk-test"
assert fake_openai.requests[0]["body"]["model"] == "fake-model"
def test_llm_test_uses_saved_profile_secret(client, fake_openai):
prev = _snapshot()
fake_openai.require_auth = True
fake_openai.api_key = "sk-saved-secret"
try:
pid = "cccccccc-cccc-cccc-cccc-cccccccccccc"
r = client.post(
"/api/settings",
json={
"llm_profiles": [
{
"id": pid,
"name": "Fake",
"base_url": _url(fake_openai),
"model": "fake-model",
"api_key": "sk-saved-secret",
}
],
"llm_active_id": pid,
},
)
assert r.status_code == 200
assert r.json()["llm_profiles"][0]["api_key"] is True
r = client.post("/api/settings/llm-test", json={"profile_id": pid})
assert r.status_code == 200
assert r.json()["ok"] is True
assert fake_openai.requests[-1]["auth"] == "Bearer sk-saved-secret"
finally:
_restore(prev)
def test_llm_test_auth_rejected(client, fake_openai):
fake_openai.require_auth = True
fake_openai.api_key = "sk-right-one"
r = client.post(
"/api/settings/llm-test",
json={"base_url": _url(fake_openai), "model": "fake-model", "api_key": "sk-wrong-one"},
)
assert r.status_code == 200
body = r.json()
assert body["ok"] is False
assert body["error"] == "auth"
assert "401" in body["detail"]
def test_llm_test_connection_refused(client):
sock = socket.socket()
sock.bind(("127.0.0.1", 0))
port = sock.getsockname()[1]
sock.close()
r = client.post(
"/api/settings/llm-test",
json={"base_url": f"http://127.0.0.1:{port}/v1", "model": "fake-model"},
)
assert r.status_code == 200
body = r.json()
assert body["ok"] is False
assert body["error"] == "connect"
assert body["detail"]
def test_llm_test_validation(client):
r = client.post("/api/settings/llm-test", json={"model": "only-model"})
assert r.status_code == 400
r = client.post("/api/settings/llm-test", json={"profile_id": "does-not-exist"})
assert r.status_code == 404
def test_llm_test_accepts_timeout_sec(client, fake_openai):
r = client.post(
"/api/settings/llm-test",
json={
"base_url": _url(fake_openai),
"model": "fake-model",
"api_key": "sk-test",
"timeout_sec": 10,
},
)
assert r.status_code == 200
assert r.json()["ok"] is True
def test_llm_test_timeout_sec_bounds(client):
for bad in (0, 4, 61):
r = client.post(
"/api/settings/llm-test",
json={"base_url": "http://127.0.0.1:1/v1", "model": "m", "timeout_sec": bad},
)
assert r.status_code == 422, bad
def test_settings_hide_key_but_expose_tail(client, fake_openai):
prev = _snapshot()
try:
pid = "dddddddd-dddd-dddd-dddd-dddddddddddd"
r = client.post(
"/api/settings",
json={
"llm_profiles": [
{
"id": pid,
"name": "Tail",
"base_url": _url(fake_openai),
"model": "fake-model",
"api_key": "sk-tail-3f2a",
}
],
"llm_active_id": pid,
},
)
assert r.status_code == 200
profile = r.json()["llm_profiles"][0]
assert profile["api_key"] is True
assert profile["api_key_tail"] == "3f2a"
assert "sk-tail" not in r.text
finally:
_restore(prev)
def test_style_role_assignment_round_trip(client, fake_openai):
"""视觉设计 (style) is one of the five AIGC agents on the models page."""
prev = _snapshot()
prev_assign = dict(settings.agent_llm_assignments or {})
try:
pid = "eeeeeeee-eeee-eeee-eeee-eeeeeeeeeeee"
r = client.post(
"/api/settings",
json={
"llm_profiles": [
{
"id": pid,
"name": "StyleLLM",
"base_url": _url(fake_openai),
"model": "fake-model",
}
],
"llm_active_id": pid,
"agent_llm_assignments": {
"main": None,
"planner": None,
"story": pid,
"style": pid,
"script": None,
"assets": None,
"video": None,
},
},
)
assert r.status_code == 200
body = r.json()
assert body["agent_llm_assignments"]["style"] == pid
assert body["agent_llm_assignments"]["story"] == pid
resolved = settings.resolve_llm_for_role("style")
assert resolved["id"] == pid
finally:
_restore(prev)
settings.agent_llm_assignments = prev_assign
+1 -1
View File
@@ -8,7 +8,7 @@
<link rel="preconnect" href="https://fonts.googleapis.com" /> <link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin /> <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link <link
href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap" href="https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&family=Noto+Sans+SC:wght@400;500;600&display=swap"
rel="stylesheet" rel="stylesheet"
/> />
%sveltekit.head% %sveltekit.head%
+19
View File
@@ -81,6 +81,8 @@ export interface LlmProfile {
base_url: string; base_url: string;
model: string; model: string;
api_key: boolean; api_key: boolean;
/** Last 4 chars of the stored key, for masked display only. */
api_key_tail?: string | null;
} }
export interface Settings { export interface Settings {
@@ -267,6 +269,23 @@ export const settings = {
get: () => api<Settings>('/api/settings'), get: () => api<Settings>('/api/settings'),
update: (payload: Record<string, unknown>) => update: (payload: Record<string, unknown>) =>
api<Settings>('/api/settings', { method: 'POST', body: JSON.stringify(payload) }), api<Settings>('/api/settings', { method: 'POST', body: JSON.stringify(payload) }),
testLlm: (payload: {
profile_id?: string;
base_url?: string;
model?: string;
api_key?: string;
timeout_sec?: number;
}) =>
api<{
ok: boolean;
elapsed_ms?: number;
error?: string;
detail?: string;
timeout_sec?: number;
}>('/api/settings/llm-test', {
method: 'POST',
body: JSON.stringify(payload),
}),
}; };
export const workflows = { export const workflows = {
@@ -3,7 +3,7 @@
import { t } from '$lib/i18n.svelte'; import { t } from '$lib/i18n.svelte';
interface Props { interface Props {
active?: 'projects' | 'canvas' | 'build-scene' | 'library' | 'settings'; active?: 'projects' | 'canvas' | 'build-scene' | 'library' | 'agents' | 'models' | 'settings';
crumb?: string; crumb?: string;
/** Optional status content rendered between the crumb and the nav. */ /** Optional status content rendered between the crumb and the nav. */
status?: import('svelte').Snippet; status?: import('svelte').Snippet;
@@ -31,6 +31,8 @@ interface Props {
<a class="nav-link" class:active={active === 'projects'} href="/projects">{t('nav.projects')}</a> <a class="nav-link" class:active={active === 'projects'} href="/projects">{t('nav.projects')}</a>
<a class="nav-link" class:active={active === 'build-scene'} href="/build-scene">{t('nav.buildScene')}</a> <a class="nav-link" class:active={active === 'build-scene'} href="/build-scene">{t('nav.buildScene')}</a>
<a class="nav-link" class:active={active === 'library'} href="/library">{t('nav.library')}</a> <a class="nav-link" class:active={active === 'library'} href="/library">{t('nav.library')}</a>
<a class="nav-link" class:active={active === 'agents'} href="/agents">{t('nav.agents')}</a>
<a class="nav-link" class:active={active === 'models'} href="/models">{t('nav.models')}</a>
<a class="nav-link" class:active={active === 'settings'} href="/settings">{t('nav.settings')}</a> <a class="nav-link" class:active={active === 'settings'} href="/settings">{t('nav.settings')}</a>
</nav> </nav>
</div> </div>
+1 -1
View File
@@ -25,7 +25,7 @@ function initialLanguage(): Language {
// language this build no longer ships must not blank the UI. This runs on // language this build no longer ships must not blank the UI. This runs on
// the server too, where storage is absent and we render the default. // the server too, where storage is absent and we render the default.
const stored = storageGet(STORAGE_KEY); const stored = storageGet(STORAGE_KEY);
return isLanguage(stored) ? stored : 'en'; return isLanguage(stored) ? stored : 'zh';
} }
export const language = $state<{ current: Language }>({ current: initialLanguage() }); export const language = $state<{ current: Language }>({ current: initialLanguage() });
+94
View File
@@ -34,6 +34,8 @@ export const de: Dict = {
'nav.projects': 'Projekte', 'nav.projects': 'Projekte',
'nav.buildScene': 'Szene bauen', 'nav.buildScene': 'Szene bauen',
'nav.settings': 'Einstellungen', 'nav.settings': 'Einstellungen',
'nav.agents': 'Agenten',
'nav.models': 'Modelle',
'nav.home': 'Start', 'nav.home': 'Start',
'nav.primary': 'Primär', 'nav.primary': 'Primär',
'nav.projectStages': 'Projektphasen', 'nav.projectStages': 'Projektphasen',
@@ -995,6 +997,12 @@ export const de: Dict = {
'settings.removeLlmTitle': 'LLM entfernen', 'settings.removeLlmTitle': 'LLM entfernen',
'settings.name': 'Name', 'settings.name': 'Name',
'settings.active': 'Aktiv', 'settings.active': 'Aktiv',
'settings.testLlm': 'Verbindung testen',
'settings.llmTestOk': 'Verbindung erfolgreich ({ms} ms)',
'settings.llmTestFail': 'Verbindung fehlgeschlagen: {detail}',
'settings.llmTestAuth': 'Schlüssel abgelehnt ({detail})',
'settings.llmTestTimeout': 'Keine Antwort innerhalb von 15 s',
'settings.llmTestConnect': 'Server nicht erreichbar ({detail})',
'settings.agentModelsSection': 'Agentenmodell', 'settings.agentModelsSection': 'Agentenmodell',
'settings.agentModelsLead': 'Modell für Story-Entwürfe und Agenten-Aufgaben.', 'settings.agentModelsLead': 'Modell für Story-Entwürfe und Agenten-Aufgaben.',
'settings.agentMaxStepsField': 'Max. Schritte', 'settings.agentMaxStepsField': 'Max. Schritte',
@@ -1128,4 +1136,90 @@ export const de: Dict = {
'shot.errBlob': 'Der aufgenommene Frame konnte nicht gelesen werden', 'shot.errBlob': 'Der aufgenommene Frame konnte nicht gelesen werden',
'shot.errRecorder': 'Recorder konnte nicht gestartet werden', 'shot.errRecorder': 'Recorder konnte nicht gestartet werden',
'shot.errNoData': 'Keine Szenendaten zum Exportieren', 'shot.errNoData': 'Keine Szenendaten zum Exportieren',
// Models settings page (spec-v2 §9)
'models.title': 'Modelle',
'models.subtitle': 'Eigene LLMs für Agenten anlegen · Phase 1 nur LLMs; Bild-/Videomodelle folgen später',
'models.statusCount': '{n} Modelle · {m} verfügbar',
'models.add': '+ Modell hinzufügen',
'models.tabLlm': 'Sprachmodelle',
'models.tabImage': 'Bildmodelle',
'models.tabVideo': 'Videomodelle',
'models.comingSoon': 'Später',
'models.empty': 'Noch keine Modelle — oben rechts auf „Modell hinzufügen“ klicken, um das erste LLM anzubinden',
'models.typeLocal': 'Lokal',
'models.typeLan': 'LAN',
'models.typeCloud': 'Cloud',
'models.defaultBadge': 'Agenten-Standard',
'models.setDefault': 'Als Standard',
'models.defaultSetToast': 'Als Agenten-Standardmodell gesetzt',
'models.test': 'Verbindung testen',
'models.testing': 'Teste…',
'models.edit': 'Bearbeiten',
'models.delete': 'Löschen',
'models.statusUntested': 'Nicht getestet',
'models.statusConnected': 'Verbunden',
'models.statusFailed': 'Verbindung fehlgeschlagen',
'models.latency': '{ms}ms Latenz',
'models.agentsUsing': 'von {n} Agenten genutzt',
'models.lastTestAt': 'letzter Test {time}',
'models.consecutiveFails': '{n} Fehlversuche in Folge',
'models.cloudPaused': 'Cloud-Aufrufe pausiert',
'models.formTitleAdd': 'Modell hinzufügen',
'models.formTitleEdit': 'Modell bearbeiten',
'models.formClose': 'Schließen',
'models.fName': 'Name',
'models.fNamePh': 'Modell benennen, z. B. DeepSeek offiziell',
'models.fApiType': 'API-Typ',
'models.apiOpenai': 'OpenAI-kompatibel',
'models.apiAnthropic': 'Anthropic',
'models.apiOther': 'Andere',
'models.apiTypeHelp': 'Phase 1 unterstützt nur OpenAI-kompatible APIs; weitere Protokolle kommen mit Bild-/Videomodellen',
'models.fBaseUrl': 'Basis-URL',
'models.baseUrlHelp': 'Mit Protokoll und Port, z. B. http://192.168.200.18:11434/v1',
'models.fModel': 'Modellname',
'models.modelHelp': 'Modell-ID des Anbieters verwenden',
'models.fApiKey': 'API-Schlüssel',
'models.keyNoEcho': 'wird nie angezeigt',
'models.keyHelp': 'Wird nur auf diesem Server gespeichert; der vollständige Schlüssel erscheint nie in der Oberfläche',
'models.keyKeepHint': 'Schlüssel gespeichert — leer lassen zum Behalten',
'models.fTimeout': 'Zeitüberschreitung',
'models.timeoutSec': '{n}s',
'models.testOk': '✓ Test bestanden · {ms}ms · {model} verfügbar',
'models.testFail': '✕ Test fehlgeschlagen · {reason}',
'models.needTest': 'Speichern erst nach bestandenem Test',
'models.testBtn': 'Verbindung testen',
'models.save': 'Modell speichern',
'models.errName': 'Bitte benennen Sie das Modell',
'models.errUrl': 'Ungültige URL — Protokoll und Pfad nötig, z. B. https://api.deepseek.com/v1',
'models.errModel': 'Bitte den Modellnamen des Anbieters eingeben',
'models.errKey': 'Bitte den API-Schlüssel eingeben',
'models.failTimeout': 'Zeitüberschreitung ({sec}s, keine Antwort): der Server erreicht diese Adresse nicht — Adresse, Port und Firewall prüfen',
'models.failAuth': 'Authentifizierung fehlgeschlagen (401): API-Schlüssel prüfen; bei Aggregatoren die Modellfreischaltung bestätigen',
'models.failNotFound': 'Erreichbar, Modell aber nicht gefunden (404): Modellnamen prüfen',
'models.failNotOpenai': 'Erreichbar, aber keine OpenAI-kompatible API — Pfad muss auf /v1 enden',
'models.failConnect': 'Der Server kann diese Adresse nicht erreichen — Adresse und Port prüfen',
'models.failHttp': 'Test failed (HTTP {status})',
'models.delTitle': 'Modell löschen',
'models.delConfirmUsed': '{n} Agenten nutzen dieses Modell; nach dem Löschen nutzen sie den Agenten-Standard. Löschen?',
'models.delConfirmFree': 'Dieses Modell löschen? Kann nicht widerrufen werden.',
'models.delDefaultHint': 'Dies ist der Agenten-Standard — zuerst einen anderen Standard wählen',
'models.agentsTitle': 'Agenten-Standardmodelle',
'models.agentsHint': 'Gilt für neue Sitzungen · individuelle Auswahl auf der Agenten-Seite',
'models.agentDefault': 'Agenten-Standard',
'models.agentStory': 'Drehbuch',
'models.agentStyle': 'Visuelles Design',
'models.agentScript': 'Storyboards',
'models.agentAssets': 'Asset-Bibliothek',
'models.agentVideo': 'Shotlisten',
'models.unavailable': '(nicht verfügbar)',
'models.noticeStrong': 'Erreichbarkeit gilt vom Workbench-Server aus:',
'models.noticeBody': 'eine im Browser öffnungsfähige Adresse ist nicht automatisch vom Server erreichbar; Verbindungs- und Dialoganfragen stellt der Server. API-Schlüssel liegen nur auf dem Server und werden nie angezeigt.',
'models.saved': 'Modell gespeichert',
'models.deleted': 'Modell gelöscht',
'models.assignSaved': 'Agentenmodelle aktualisiert',
'models.saveFailed': 'Speichern fehlgeschlagen: {detail}',
'models.loading': 'Lädt…',
'models.loadFailed': 'Einstellungen konnten nicht geladen werden',
'models.idleFormHint': '„Bearbeiten“ auf einer Karte wählen oder oben „Modell hinzufügen“ klicken',
}; };
+94 -1
View File
@@ -32,6 +32,8 @@ export const en = {
'nav.projects': 'Projects', 'nav.projects': 'Projects',
'nav.buildScene': 'Build Scene', 'nav.buildScene': 'Build Scene',
'nav.settings': 'Settings', 'nav.settings': 'Settings',
'nav.agents': 'Agents',
'nav.models': 'Models',
'nav.home': 'Home', 'nav.home': 'Home',
'nav.primary': 'Primary', 'nav.primary': 'Primary',
'nav.projectStages': 'Project stages', 'nav.projectStages': 'Project stages',
@@ -995,6 +997,12 @@ export const en = {
'settings.removeLlmTitle': 'Remove LLM', 'settings.removeLlmTitle': 'Remove LLM',
'settings.name': 'Name', 'settings.name': 'Name',
'settings.active': 'Active', 'settings.active': 'Active',
'settings.testLlm': 'Test connection',
'settings.llmTestOk': 'Connected ({ms} ms)',
'settings.llmTestFail': 'Connection failed: {detail}',
'settings.llmTestAuth': 'API key rejected ({detail})',
'settings.llmTestTimeout': 'No response within 15 s',
'settings.llmTestConnect': 'Could not reach the server ({detail})',
'settings.agentModelsSection': 'Agent model', 'settings.agentModelsSection': 'Agent model',
'settings.agentModelsLead': 'Model used for story drafting and agent tasks.', 'settings.agentModelsLead': 'Model used for story drafting and agent tasks.',
'settings.agentMaxStepsField': 'Max steps', 'settings.agentMaxStepsField': 'Max steps',
@@ -1128,6 +1136,91 @@ export const en = {
'shot.errBlob': 'Could not read the captured frame', 'shot.errBlob': 'Could not read the captured frame',
'shot.errRecorder': 'Could not start recorder', 'shot.errRecorder': 'Could not start recorder',
'shot.errNoData': 'No scene data to export', 'shot.errNoData': 'No scene data to export',
};
// Models settings page (spec-v2 §9)
'models.title': 'Models',
'models.subtitle': 'Add custom LLMs for your agents · phase 1 covers LLMs only; image / video models come later',
'models.statusCount': '{n} models · {m} available',
'models.add': '+ Add model',
'models.tabLlm': 'Language models',
'models.tabImage': 'Image models',
'models.tabVideo': 'Video models',
'models.comingSoon': 'Coming later',
'models.empty': 'No models yet — click "Add model" in the top right to connect your first LLM',
'models.typeLocal': 'Local',
'models.typeLan': 'LAN',
'models.typeCloud': 'Cloud',
'models.defaultBadge': 'Agent default',
'models.setDefault': 'Set as default',
'models.defaultSetToast': 'Set as agent default model',
'models.test': 'Test connection',
'models.testing': 'Testing…',
'models.edit': 'Edit',
'models.delete': 'Delete',
'models.statusUntested': 'Not tested',
'models.statusConnected': 'Connected',
'models.statusFailed': 'Connection failed',
'models.latency': '{ms}ms latency',
'models.agentsUsing': 'used by {n} agents',
'models.lastTestAt': 'last test {time}',
'models.consecutiveFails': '{n} consecutive failures',
'models.cloudPaused': 'Cloud calls paused',
'models.formTitleAdd': 'Add model',
'models.formTitleEdit': 'Edit model',
'models.formClose': 'Close',
'models.fName': 'Name',
'models.fNamePh': 'Name this model, e.g. DeepSeek official',
'models.fApiType': 'API type',
'models.apiOpenai': 'OpenAI-compatible',
'models.apiAnthropic': 'Anthropic',
'models.apiOther': 'Other',
'models.apiTypeHelp': 'Phase 1 supports OpenAI-compatible APIs only; other protocols arrive with image / video models',
'models.fBaseUrl': 'Base URL',
'models.baseUrlHelp': 'Include protocol and port, e.g. http://192.168.200.18:11434/v1',
'models.fModel': 'Model name',
'models.modelHelp': 'Use the model ID from your provider',
'models.fApiKey': 'API key',
'models.keyNoEcho': 'never echoed',
'models.keyHelp': 'Stored on this server only; the full key is never shown in the UI',
'models.keyKeepHint': 'Key saved — leave empty to keep it',
'models.fTimeout': 'Timeout',
'models.timeoutSec': '{n}s',
'models.testOk': '✓ Test passed · {ms}ms · {model} available',
'models.testFail': '✕ Test failed · {reason}',
'models.needTest': 'Save unlocks after a passing test',
'models.testBtn': 'Test connection',
'models.save': 'Save model',
'models.errName': 'Please name this model',
'models.errUrl': 'Invalid URL — it needs protocol and path, e.g. https://api.deepseek.com/v1',
'models.errModel': 'Please enter the model name from your provider',
'models.errKey': 'Please enter the API key',
'models.failTimeout': 'Timed out ({sec}s, no response): the server cannot reach this address — check the address, port and firewall',
'models.failAuth': 'Authentication failed (401): check that the API key is correct and not expired; with aggregators, confirm the model is enabled for your account',
'models.failNotFound': 'Reachable but model not found (404): check the model name spelling',
'models.failNotOpenai': 'Reachable but not recognized as an OpenAI-compatible API — make sure the path ends with /v1',
'models.failConnect': 'The server cannot connect to this address — check the address and port',
'models.failHttp': 'Test failed (HTTP {status})',
'models.delTitle': 'Delete model',
'models.delConfirmUsed': '{n} agents use this model; after deletion they fall back to the agent default. Delete?',
'models.delConfirmFree': 'Delete this model? This cannot be undone.',
'models.delDefaultHint': 'This is the agent default — pick another default first',
'models.agentsTitle': 'Agent default models',
'models.agentsHint': 'Changes apply to new sessions · per-agent overrides live on the Agents page',
'models.agentDefault': 'Agent default',
'models.agentStory': 'Screenplay',
'models.agentStyle': 'Visual design',
'models.agentScript': 'Storyboards',
'models.agentAssets': 'Asset library',
'models.agentVideo': 'Shot lists',
'models.unavailable': '(unavailable)',
'models.noticeStrong': 'Connectivity is measured from the workbench server:',
'models.noticeBody': 'a URL opening in your browser does not mean the server running this workbench can reach it; connection tests and chat requests are made by the server. API keys are stored on the server only and never echoed in the UI.',
'models.saved': 'Model saved',
'models.deleted': 'Model deleted',
'models.assignSaved': 'Agent models updated',
'models.saveFailed': 'Save failed: {detail}',
'models.loading': 'Loading…',
'models.loadFailed': 'Failed to load settings',
'models.idleFormHint': 'Pick "Edit" on a card, or click "Add model" above',
};
export type Dict = typeof en; export type Dict = typeof en;
+94
View File
@@ -34,6 +34,8 @@ export const es: Dict = {
'nav.projects': 'Proyectos', 'nav.projects': 'Proyectos',
'nav.buildScene': 'Componer escena', 'nav.buildScene': 'Componer escena',
'nav.settings': 'Ajustes', 'nav.settings': 'Ajustes',
'nav.agents': 'Agentes',
'nav.models': 'Modelos',
'nav.home': 'Inicio', 'nav.home': 'Inicio',
'nav.primary': 'Principal', 'nav.primary': 'Principal',
'nav.projectStages': 'Etapas del proyecto', 'nav.projectStages': 'Etapas del proyecto',
@@ -995,6 +997,12 @@ export const es: Dict = {
'settings.removeLlmTitle': 'Quitar LLM', 'settings.removeLlmTitle': 'Quitar LLM',
'settings.name': 'Nombre', 'settings.name': 'Nombre',
'settings.active': 'Activo', 'settings.active': 'Activo',
'settings.testLlm': 'Probar conexión',
'settings.llmTestOk': 'Conexión correcta ({ms} ms)',
'settings.llmTestFail': 'Error de conexión: {detail}',
'settings.llmTestAuth': 'Clave rechazada ({detail})',
'settings.llmTestTimeout': 'Sin respuesta en 15 s',
'settings.llmTestConnect': 'No se pudo conectar al servidor ({detail})',
'settings.agentModelsSection': 'Modelo del agente', 'settings.agentModelsSection': 'Modelo del agente',
'settings.agentModelsLead': 'Modelo usado para redactar la historia y para las tareas del agente.', 'settings.agentModelsLead': 'Modelo usado para redactar la historia y para las tareas del agente.',
'settings.agentMaxStepsField': 'Pasos máximos', 'settings.agentMaxStepsField': 'Pasos máximos',
@@ -1128,4 +1136,90 @@ export const es: Dict = {
'shot.errBlob': 'No se pudo leer el fotograma capturado', 'shot.errBlob': 'No se pudo leer el fotograma capturado',
'shot.errRecorder': 'No se pudo iniciar el grabador', 'shot.errRecorder': 'No se pudo iniciar el grabador',
'shot.errNoData': 'No hay datos de escena para exportar', 'shot.errNoData': 'No hay datos de escena para exportar',
// Models settings page (spec-v2 §9)
'models.title': 'Modelos',
'models.subtitle': 'Añade LLM personalizados para tus agentes · la fase 1 solo incluye LLM; los modelos de imagen / vídeo llegarán después',
'models.statusCount': '{n} modelos · {m} disponibles',
'models.add': '+ Añadir modelo',
'models.tabLlm': 'Modelos de lenguaje',
'models.tabImage': 'Modelos de imagen',
'models.tabVideo': 'Modelos de vídeo',
'models.comingSoon': 'Próximamente',
'models.empty': 'Aún no hay modelos: pulsa «Añadir modelo» arriba a la derecha para conectar tu primer LLM',
'models.typeLocal': 'Local',
'models.typeLan': 'LAN',
'models.typeCloud': 'Nube',
'models.defaultBadge': 'Predeterminado',
'models.setDefault': 'Predeterminar',
'models.defaultSetToast': 'Modelo predeterminado de agentes actualizado',
'models.test': 'Probar conexión',
'models.testing': 'Probando…',
'models.edit': 'Editar',
'models.delete': 'Eliminar',
'models.statusUntested': 'Sin probar',
'models.statusConnected': 'Conectado',
'models.statusFailed': 'Conexión fallida',
'models.latency': '{ms}ms de latencia',
'models.agentsUsing': 'usado por {n} agentes',
'models.lastTestAt': 'última prueba {time}',
'models.consecutiveFails': '{n} fallos consecutivos',
'models.cloudPaused': 'Llamadas en la nube en pausa',
'models.formTitleAdd': 'Añadir modelo',
'models.formTitleEdit': 'Editar modelo',
'models.formClose': 'Cerrar',
'models.fName': 'Nombre',
'models.fNamePh': 'Nombra el modelo, p. ej. DeepSeek oficial',
'models.fApiType': 'Tipo de API',
'models.apiOpenai': 'Compatible con OpenAI',
'models.apiAnthropic': 'Anthropic',
'models.apiOther': 'Otro',
'models.apiTypeHelp': 'La fase 1 solo admite APIs compatibles con OpenAI; otros protocolos llegarán con los modelos de imagen / vídeo',
'models.fBaseUrl': 'URL base',
'models.baseUrlHelp': 'Incluye protocolo y puerto, p. ej. http://192.168.200.18:11434/v1',
'models.fModel': 'Nombre del modelo',
'models.modelHelp': 'Usa el ID de modelo que indica tu proveedor',
'models.fApiKey': 'Clave API',
'models.keyNoEcho': 'nunca se muestra',
'models.keyHelp': 'Se guarda solo en este servidor; la clave completa nunca aparece en la interfaz',
'models.keyKeepHint': 'Clave guardada: déjalo vacío para conservarla',
'models.fTimeout': 'Tiempo de espera',
'models.timeoutSec': '{n}s',
'models.testOk': '✓ Prueba superada · {ms}ms · {model} disponible',
'models.testFail': '✕ Prueba fallida · {reason}',
'models.needTest': 'Guardar se habilita tras superar la prueba',
'models.testBtn': 'Test connection',
'models.save': 'Guardar modelo',
'models.errName': 'Ponle nombre al modelo',
'models.errUrl': 'URL no válida: debe incluir protocolo y ruta, p. ej. https://api.deepseek.com/v1',
'models.errModel': 'Introduce el nombre del modelo de tu proveedor',
'models.errKey': 'Introduce la clave API',
'models.failTimeout': 'Tiempo de espera agotado ({sec}s sin respuesta): el servidor no llega a esta dirección; revisa dirección, puerto y cortafuegos',
'models.failAuth': 'Autenticación fallida (401): comprueba que la clave API sea correcta y no haya caducado; con agregadores, confirma que el modelo esté activado',
'models.failNotFound': 'Accesible pero modelo no encontrado (404): revisa cómo se escribe el nombre',
'models.failNotOpenai': 'Accesible pero no parece una API compatible con OpenAI: comprueba que la ruta termine en /v1',
'models.failConnect': 'El servidor no puede conectarse a esta dirección: revisa dirección y puerto',
'models.failHttp': 'Prueba fallida (HTTP {status})',
'models.delTitle': 'Eliminar modelo',
'models.delConfirmUsed': '{n} agentes usan este modelo; tras eliminarlo usarán el predeterminado. ¿Eliminar?',
'models.delConfirmFree': '¿Eliminar este modelo? No se puede deshacer.',
'models.delDefaultHint': 'Es el modelo predeterminado: elige otro predeterminado primero',
'models.agentsTitle': 'Modelos predeterminados de agentes',
'models.agentsHint': 'Los cambios aplican a sesiones nuevas · ajustes por agente en la página Agentes',
'models.agentDefault': 'Predeterminado',
'models.agentStory': 'Guion',
'models.agentStyle': 'Diseño visual',
'models.agentScript': 'Storyboards',
'models.agentAssets': 'Biblioteca de assets',
'models.agentVideo': 'Listas de planos',
'models.unavailable': '(no disponible)',
'models.noticeStrong': 'La conectividad se mide desde el servidor del workbench:',
'models.noticeBody': 'que una URL abra en tu navegador no significa que el servidor pueda acceder a ella; las pruebas de conexión y las peticiones las hace el servidor. Las claves API se guardan solo en el servidor y nunca se muestran.',
'models.saved': 'Modelo guardado',
'models.deleted': 'Modelo eliminado',
'models.assignSaved': 'Modelos de agentes actualizados',
'models.saveFailed': 'Error al guardar: {detail}',
'models.loading': 'Cargando…',
'models.loadFailed': 'No se pudieron cargar los ajustes',
'models.idleFormHint': 'Pulsa «Editar» en una tarjeta o «Añadir modelo» arriba',
}; };
+94
View File
@@ -34,6 +34,8 @@ export const fr: Dict = {
'nav.projects': 'Projets', 'nav.projects': 'Projets',
'nav.buildScene': 'Composer la scène', 'nav.buildScene': 'Composer la scène',
'nav.settings': 'Paramètres', 'nav.settings': 'Paramètres',
'nav.agents': 'Agents',
'nav.models': 'Modèles',
'nav.home': 'Accueil', 'nav.home': 'Accueil',
'nav.primary': 'Principal', 'nav.primary': 'Principal',
'nav.projectStages': 'Étapes du projet', 'nav.projectStages': 'Étapes du projet',
@@ -995,6 +997,12 @@ export const fr: Dict = {
'settings.removeLlmTitle': 'Retirer le LLM', 'settings.removeLlmTitle': 'Retirer le LLM',
'settings.name': 'Nom', 'settings.name': 'Nom',
'settings.active': 'Actif', 'settings.active': 'Actif',
'settings.testLlm': 'Tester la connexion',
'settings.llmTestOk': 'Connexion réussie ({ms} ms)',
'settings.llmTestFail': 'Échec de connexion : {detail}',
'settings.llmTestAuth': 'Clé refusée ({detail})',
'settings.llmTestTimeout': 'Aucune réponse sous 15 s',
'settings.llmTestConnect': 'Serveur injoignable ({detail})',
'settings.agentModelsSection': 'Modèle agent', 'settings.agentModelsSection': 'Modèle agent',
'settings.agentModelsLead': "Modèle utilisé pour la rédaction de l'histoire et les tâches de l'agent.", 'settings.agentModelsLead': "Modèle utilisé pour la rédaction de l'histoire et les tâches de l'agent.",
'settings.agentMaxStepsField': 'Étapes max.', 'settings.agentMaxStepsField': 'Étapes max.',
@@ -1128,4 +1136,90 @@ export const fr: Dict = {
'shot.errBlob': "Impossible de lire l'image capturée", 'shot.errBlob': "Impossible de lire l'image capturée",
'shot.errRecorder': "Impossible de démarrer l'enregistreur", 'shot.errRecorder': "Impossible de démarrer l'enregistreur",
'shot.errNoData': 'Aucune donnée de scène à exporter', 'shot.errNoData': 'Aucune donnée de scène à exporter',
// Models settings page (spec-v2 §9)
'models.title': 'Modèles',
'models.subtitle': 'Ajoutez des LLM personnalisés pour vos agents · la phase 1 ne couvre que les LLM ; les modèles image / vidéo arriveront ensuite',
'models.statusCount': '{n} modèles · {m} disponibles',
'models.add': '+ Ajouter un modèle',
'models.tabLlm': 'Modèles de langage',
'models.tabImage': "Modèles d'image",
'models.tabVideo': 'Modèles vidéo',
'models.comingSoon': 'À venir',
'models.empty': 'Aucun modèle pour l’instant — cliquez sur « Ajouter un modèle » en haut à droite pour connecter votre premier LLM',
'models.typeLocal': 'Local',
'models.typeLan': 'LAN',
'models.typeCloud': 'Cloud',
'models.defaultBadge': 'Par défaut',
'models.setDefault': 'Définir par défaut',
'models.defaultSetToast': 'Modèle par défaut des agents défini',
'models.test': 'Tester la connexion',
'models.testing': 'Test en cours…',
'models.edit': 'Modifier',
'models.delete': 'Supprimer',
'models.statusUntested': 'Non testé',
'models.statusConnected': 'Connecté',
'models.statusFailed': 'Échec de connexion',
'models.latency': 'latence {ms}ms',
'models.agentsUsing': 'utilisé par {n} agents',
'models.lastTestAt': 'dernier test {time}',
'models.consecutiveFails': '{n} échecs consécutifs',
'models.cloudPaused': 'Appels cloud suspendus',
'models.formTitleAdd': 'Ajouter un modèle',
'models.formTitleEdit': 'Modifier le modèle',
'models.formClose': 'Fermer',
'models.fName': 'Nom',
'models.fNamePh': 'Nommez le modèle, ex. DeepSeek officiel',
'models.fApiType': 'Type d’API',
'models.apiOpenai': 'Compatible OpenAI',
'models.apiAnthropic': 'Anthropic',
'models.apiOther': 'Autre',
'models.apiTypeHelp': 'La phase 1 ne prend en charge que les API compatibles OpenAI ; les autres protocoles arriveront avec les modèles image / vidéo',
'models.fBaseUrl': 'URL de base',
'models.baseUrlHelp': 'Avec protocole et port, ex. http://192.168.200.18:11434/v1',
'models.fModel': 'Nom du modèle',
'models.modelHelp': 'Utilisez l’identifiant de modèle fourni par votre prestataire',
'models.fApiKey': 'Clé API',
'models.keyNoEcho': 'jamais affichée',
'models.keyHelp': 'Stockée uniquement sur ce serveur ; la clé complète n’apparaît jamais dans l’interface',
'models.keyKeepHint': 'Clé enregistrée — laissez vide pour la conserver',
'models.fTimeout': 'Délai d’attente',
'models.timeoutSec': '{n}s',
'models.testOk': '✓ Test réussi · {ms}ms · {model} disponible',
'models.testFail': '✕ Échec du test · {reason}',
'models.needTest': 'Enregistrement possible après un test réussi',
'models.testBtn': 'Test connection',
'models.save': 'Enregistrer le modèle',
'models.errName': 'Veuillez nommer le modèle',
'models.errUrl': 'URL invalide — protocole et chemin requis, ex. https://api.deepseek.com/v1',
'models.errModel': 'Saisissez le nom du modèle fourni par votre prestataire',
'models.errKey': 'Saisissez la clé API',
'models.failTimeout': 'Délai dépassé ({sec}s sans réponse) : le serveur n’atteint pas cette adresse — vérifiez adresse, port et pare-feu',
'models.failAuth': 'Échec d’authentification (401) : vérifiez que la clé API est correcte et non expirée ; avec les agrégateurs, confirmez que le modèle est activé',
'models.failNotFound': 'Joignable mais modèle introuvable (404) : vérifiez l’orthographe du nom',
'models.failNotOpenai': 'Joignable mais non reconnue comme API compatible OpenAI — le chemin doit se terminer par /v1',
'models.failConnect': 'Le serveur ne peut pas se connecter à cette adresse — vérifiez adresse et port',
'models.failHttp': 'Test failed (HTTP {status})',
'models.delTitle': 'Supprimer le modèle',
'models.delConfirmUsed': '{n} agents utilisent ce modèle ; après suppression ils reviendront au modèle par défaut. Supprimer ?',
'models.delConfirmFree': 'Supprimer ce modèle ? Action irréversible.',
'models.delDefaultHint': 'Ce modèle est celui par défaut — choisissez d’abord un autre défaut',
'models.agentsTitle': 'Modèles par défaut des agents',
'models.agentsHint': 'Appliqué aux nouvelles sessions · réglage par agent sur la page Agents',
'models.agentDefault': 'Par défaut',
'models.agentStory': 'Scénario',
'models.agentStyle': 'Direction visuelle',
'models.agentScript': 'Storyboards',
'models.agentAssets': 'Bibliothèque d’assets',
'models.agentVideo': 'Plans de tournage',
'models.unavailable': '(indisponible)',
'models.noticeStrong': 'La connectivité est mesurée depuis le serveur du workbench :',
'models.noticeBody': 'une URL qui s’ouvre dans votre navigateur n’est pas forcément accessible au serveur ; les tests de connexion et les requêtes sont faits par le serveur. Les clés API restent sur le serveur et ne sont jamais affichées.',
'models.saved': 'Modèle enregistré',
'models.deleted': 'Modèle supprimé',
'models.assignSaved': 'Modèles des agents mis à jour',
'models.saveFailed': 'Échec de l’enregistrement : {detail}',
'models.loading': 'Chargement…',
'models.loadFailed': 'Impossible de charger les paramètres',
'models.idleFormHint': 'Cliquez « Modifier » sur une carte ou « Ajouter un modèle » ci-dessus',
}; };
+94
View File
@@ -34,6 +34,8 @@ export const ja: Dict = {
'nav.projects': 'プロジェクト', 'nav.projects': 'プロジェクト',
'nav.buildScene': 'シーン構築', 'nav.buildScene': 'シーン構築',
'nav.settings': '設定', 'nav.settings': '設定',
'nav.agents': 'エージェント',
'nav.models': 'モデル設定',
'nav.home': 'ホーム', 'nav.home': 'ホーム',
'nav.primary': 'メイン', 'nav.primary': 'メイン',
'nav.projectStages': 'プロジェクトの段階', 'nav.projectStages': 'プロジェクトの段階',
@@ -995,6 +997,12 @@ export const ja: Dict = {
'settings.removeLlmTitle': 'LLM を削除', 'settings.removeLlmTitle': 'LLM を削除',
'settings.name': '名前', 'settings.name': '名前',
'settings.active': '有効', 'settings.active': '有効',
'settings.testLlm': '接続テスト',
'settings.llmTestOk': '接続成功({ms} ms)',
'settings.llmTestFail': '接続失敗:{detail}',
'settings.llmTestAuth': 'キーが拒否されました({detail})',
'settings.llmTestTimeout': '15 秒以内に応答なし',
'settings.llmTestConnect': 'サーバーに接続できません({detail})',
'settings.agentModelsSection': 'エージェントモデル', 'settings.agentModelsSection': 'エージェントモデル',
'settings.agentModelsLead': 'ストーリーの下書きやエージェントタスクに使用するモデル。', 'settings.agentModelsLead': 'ストーリーの下書きやエージェントタスクに使用するモデル。',
'settings.agentMaxStepsField': '最大ステップ数', 'settings.agentMaxStepsField': '最大ステップ数',
@@ -1128,4 +1136,90 @@ export const ja: Dict = {
'shot.errBlob': 'キャプチャしたフレームを読み取れませんでした', 'shot.errBlob': 'キャプチャしたフレームを読み取れませんでした',
'shot.errRecorder': 'レコーダーを開始できませんでした', 'shot.errRecorder': 'レコーダーを開始できませんでした',
'shot.errNoData': '書き出すシーンデータがありません', 'shot.errNoData': '書き出すシーンデータがありません',
// Models settings page (spec-v2 §9)
'models.title': 'モデル設定',
'models.subtitle': 'エージェントが使うカスタム LLM を追加 · 第一段階は LLM のみ、画像 / 動画モデルは後日',
'models.statusCount': 'モデル {n} 件 · 利用可能 {m} 件',
'models.add': '+ モデルを追加',
'models.tabLlm': '大規模言語モデル',
'models.tabImage': '画像モデル',
'models.tabVideo': '動画モデル',
'models.comingSoon': '近日公開',
'models.empty': 'モデルが未設定です。右上の「モデルを追加」から最初の LLM を登録してください',
'models.typeLocal': 'ローカル',
'models.typeLan': 'LAN',
'models.typeCloud': 'クラウド',
'models.defaultBadge': 'エージェント既定',
'models.setDefault': '既定にする',
'models.defaultSetToast': 'エージェント既定モデルを設定しました',
'models.test': '接続テスト',
'models.testing': 'テスト中…',
'models.edit': '編集',
'models.delete': '削除',
'models.statusUntested': '未テスト',
'models.statusConnected': '接続済み',
'models.statusFailed': '接続失敗',
'models.latency': '遅延 {ms}ms',
'models.agentsUsing': '{n} 個のエージェントが使用',
'models.lastTestAt': '前回テスト {time}',
'models.consecutiveFails': '連続失敗 {n} 回',
'models.cloudPaused': 'クラウド呼び出しを一時停止',
'models.formTitleAdd': 'モデルを追加',
'models.formTitleEdit': 'モデルを編集',
'models.formClose': '閉じる',
'models.fName': '名前',
'models.fNamePh': 'モデルの名前(例:DeepSeek 公式)',
'models.fApiType': 'API タイプ',
'models.apiOpenai': 'OpenAI 互換',
'models.apiAnthropic': 'Anthropic',
'models.apiOther': 'その他',
'models.apiTypeHelp': '第一段階は OpenAI 互換 API のみ対応。他のプロトコルは画像 / 動画モデルと同時に提供予定',
'models.fBaseUrl': 'API アドレス',
'models.baseUrlHelp': 'プロトコルとポートを含めてください(例:http://192.168.200.18:11434/v1)',
'models.fModel': 'モデル名',
'models.modelHelp': 'プロバイダ提供のモデル ID を指定してください',
'models.fApiKey': 'API キー',
'models.keyNoEcho': '表示されません',
'models.keyHelp': 'このサーバーにのみ保存され、完全なキーが画面に表示されることはありません',
'models.keyKeepHint': 'キー保存済み — 空欄のままなら変更されません',
'models.fTimeout': 'タイムアウト',
'models.timeoutSec': '{n} 秒',
'models.testOk': '✓ テスト成功 · {ms}ms · {model} 利用可能',
'models.testFail': '✕ テスト失敗 · {reason}',
'models.needTest': 'テスト成功後に保存できます',
'models.testBtn': '接続テスト',
'models.save': 'モデルを保存',
'models.errName': 'モデルに名前を付けてください',
'models.errUrl': 'アドレス形式が不正です。プロトコルとパスを含めてください(例:https://api.deepseek.com/v1)',
'models.errModel': 'プロバイダ提供のモデル名を入力してください',
'models.errKey': 'API キーを入力してください',
'models.failTimeout': 'タイムアウト({sec} 秒無応答):サーバーからこのアドレスに届きません。アドレス・ポート・ファイアウォールを確認してください',
'models.failAuth': '認証失敗(401):API キーが正しいか・期限切れでないか確認してください。集約サービスの場合はモデル権限もご確認ください',
'models.failNotFound': '接続はできるがモデルが見つかりません(404):モデル名の綴りを確認してください',
'models.failNotOpenai': 'アドレスにはアクセスできるものの OpenAI 互換 API と識別できません。パスが /v1 で終わるか確認してください',
'models.failConnect': 'サーバーからこのアドレスに接続できません。アドレスとポートを確認してください',
'models.failHttp': 'Test failed (HTTP {status})',
'models.delTitle': 'モデルを削除',
'models.delConfirmUsed': '{n} 個のエージェントが使用中です。削除後は「エージェント既定」に切り替わります。削除しますか?',
'models.delConfirmFree': 'このモデルを削除しますか?取り消せません。',
'models.delDefaultHint': 'このモデルは「エージェント既定」です。先に別の既定モデルを指定してください',
'models.agentsTitle': 'エージェント既定モデル',
'models.agentsHint': '新しいセッションから適用 · 個別設定はエージェントページで',
'models.agentDefault': 'エージェント既定',
'models.agentStory': '脚本制作',
'models.agentStyle': 'ビジュアルデザイン',
'models.agentScript': '絵コンテ',
'models.agentAssets': '素材アセット',
'models.agentVideo': 'ショットリスト',
'models.unavailable': '(利用不可)',
'models.noticeStrong': '接続性はワークベンチのサーバー基準です:',
'models.noticeBody': 'ブラウザで開けるアドレスでも、ワークベンチのサーバーからアクセスできるとは限りません。接続テストと対話リクエストはサーバーが行います。API キーはサーバーにのみ保存され、画面に表示されることはありません。',
'models.saved': 'モデルを保存しました',
'models.deleted': 'モデルを削除しました',
'models.assignSaved': 'エージェントのモデルを更新しました',
'models.saveFailed': '保存に失敗しました:{detail}',
'models.loading': '読み込み中…',
'models.loadFailed': '設定の読み込みに失敗しました',
'models.idleFormHint': 'カードの「編集」を選ぶか、上の「モデルを追加」をクリックしてください',
}; };
+94
View File
@@ -34,6 +34,8 @@ export const ko: Dict = {
'nav.projects': '프로젝트', 'nav.projects': '프로젝트',
'nav.buildScene': '장면 구성', 'nav.buildScene': '장면 구성',
'nav.settings': '설정', 'nav.settings': '설정',
'nav.agents': '에이전트',
'nav.models': '모델 설정',
'nav.home': '홈', 'nav.home': '홈',
'nav.primary': '기본', 'nav.primary': '기본',
'nav.projectStages': '프로젝트 단계', 'nav.projectStages': '프로젝트 단계',
@@ -995,6 +997,12 @@ export const ko: Dict = {
'settings.removeLlmTitle': 'LLM 제거', 'settings.removeLlmTitle': 'LLM 제거',
'settings.name': '이름', 'settings.name': '이름',
'settings.active': '활성', 'settings.active': '활성',
'settings.testLlm': '연결 테스트',
'settings.llmTestOk': '연결 성공 ({ms}ms)',
'settings.llmTestFail': '연결 실패: {detail}',
'settings.llmTestAuth': '키가 거부됨 ({detail})',
'settings.llmTestTimeout': '15초 내 응답 없음',
'settings.llmTestConnect': '서버에 연결할 수 없음 ({detail})',
'settings.agentModelsSection': '에이전트 모델', 'settings.agentModelsSection': '에이전트 모델',
'settings.agentModelsLead': '스토리 초안 작성과 에이전트 작업에 사용하는 모델입니다.', 'settings.agentModelsLead': '스토리 초안 작성과 에이전트 작업에 사용하는 모델입니다.',
'settings.agentMaxStepsField': '최대 단계', 'settings.agentMaxStepsField': '최대 단계',
@@ -1128,4 +1136,90 @@ export const ko: Dict = {
'shot.errBlob': '캡처한 프레임을 읽지 못했습니다', 'shot.errBlob': '캡처한 프레임을 읽지 못했습니다',
'shot.errRecorder': '녹화를 시작하지 못했습니다', 'shot.errRecorder': '녹화를 시작하지 못했습니다',
'shot.errNoData': '내보낼 장면 데이터가 없습니다', 'shot.errNoData': '내보낼 장면 데이터가 없습니다',
// Models settings page (spec-v2 §9)
'models.title': '모델 설정',
'models.subtitle': '에이전트가 사용할 사용자 지정 LLM을 추가합니다 · 1단계는 LLM만 지원, 이미지 / 동영상 모델은 추후 제공',
'models.statusCount': '모델 {n}개 · 사용 가능 {m}개',
'models.add': '+ 모델 추가',
'models.tabLlm': '대규모 언어 모델',
'models.tabImage': '이미지 모델',
'models.tabVideo': '동영상 모델',
'models.comingSoon': '추후 제공',
'models.empty': '아직 모델이 없습니다. 오른쪽 위 «모델 추가»를 눌러 첫 LLM을 연결하세요',
'models.typeLocal': '로컬',
'models.typeLan': 'LAN',
'models.typeCloud': '클라우드',
'models.defaultBadge': '에이전트 기본',
'models.setDefault': '기본으로 설정',
'models.defaultSetToast': '에이전트 기본 모델로 설정했습니다',
'models.test': '연결 테스트',
'models.testing': '테스트 중…',
'models.edit': '편집',
'models.delete': '삭제',
'models.statusUntested': '미테스트',
'models.statusConnected': '연결됨',
'models.statusFailed': '연결 실패',
'models.latency': '지연 {ms}ms',
'models.agentsUsing': '{n}개 에이전트 사용 중',
'models.lastTestAt': '마지막 테스트 {time}',
'models.consecutiveFails': '{n}회 연속 실패',
'models.cloudPaused': '클라우드 호출 일시 중지',
'models.formTitleAdd': '모델 추가',
'models.formTitleEdit': '모델 편집',
'models.formClose': '닫기',
'models.fName': '이름',
'models.fNamePh': '모델 이름, 예: DeepSeek 공식',
'models.fApiType': 'API 유형',
'models.apiOpenai': 'OpenAI 호환',
'models.apiAnthropic': 'Anthropic',
'models.apiOther': '기타',
'models.apiTypeHelp': '1단계는 OpenAI 호환 API만 지원하며, 다른 프로토콜은 이미지 / 동영상 모델과 함께 제공됩니다',
'models.fBaseUrl': 'API 주소',
'models.baseUrlHelp': '프로토콜과 포트를 포함하세요, 예: http://192.168.200.18:11434/v1',
'models.fModel': '모델 이름',
'models.modelHelp': '공급자가 제공하는 모델 ID를 사용하세요',
'models.fApiKey': 'API 키',
'models.keyNoEcho': '표시되지 않음',
'models.keyHelp': '이 서버에만 저장되며 전체 키는 화면에 절대 표시되지 않습니다',
'models.keyKeepHint': '키 저장됨 — 비워 두면 유지됩니다',
'models.fTimeout': '시간 제한',
'models.timeoutSec': '{n}초',
'models.testOk': '✓ 테스트 통과 · {ms}ms · {model} 사용 가능',
'models.testFail': '✕ 테스트 실패 · {reason}',
'models.needTest': '테스트 통과 후 저장할 수 있습니다',
'models.testBtn': '연결 테스트',
'models.save': '모델 저장',
'models.errName': '모델 이름을 입력하세요',
'models.errUrl': '주소 형식이 올바르지 않습니다. 프로토콜과 경로를 포함하세요, 예: https://api.deepseek.com/v1',
'models.errModel': '공급자가 제공하는 모델 이름을 입력하세요',
'models.errKey': 'API 키를 입력하세요',
'models.failTimeout': '시간 초과({sec}초 무응답): 서버가 이 주소에 접근할 수 없습니다. 주소·포트·방화벽을 확인하세요',
'models.failAuth': '인증 실패(401): API 키가 올바르고 만료되지 않았는지 확인하세요. 통합 서비스라면 모델 권한도 확인하세요',
'models.failNotFound': '접속은 되지만 모델을 찾을 수 없음(404): 모델 이름 철자를 확인하세요',
'models.failNotOpenai': '주소에 접근할 수 있으나 OpenAI 호환 API로 식별되지 않습니다. 경로가 /v1로 끝나는지 확인하세요',
'models.failConnect': '서버가 이 주소에 연결할 수 없습니다. 주소와 포트를 확인하세요',
'models.failHttp': 'Test failed (HTTP {status})',
'models.delTitle': '모델 삭제',
'models.delConfirmUsed': '{n}개 에이전트가 이 모델을 사용 중입니다. 삭제 후에는 «에이전트 기본»으로 전환됩니다. 삭제할까요?',
'models.delConfirmFree': '이 모델을 삭제할까요? 되돌릴 수 없습니다.',
'models.delDefaultHint': '이 모델은 «에이전트 기본»입니다. 먼저 다른 기본 모델을 지정하세요',
'models.agentsTitle': '에이전트 기본 모델',
'models.agentsHint': '새 세션부터 적용 · 에이전트별 설정은 에이전트 페이지에서',
'models.agentDefault': '에이전트 기본',
'models.agentStory': '시나리오',
'models.agentStyle': '비주얼 디자인',
'models.agentScript': '스토리보드',
'models.agentAssets': '에셋 라이브러리',
'models.agentVideo': '숏리스트',
'models.unavailable': '(사용 불가)',
'models.noticeStrong': '연결성은 워크벤치 서버 기준입니다:',
'models.noticeBody': '브라우저에서 열리는 주소라도 워크벤치 서버가 접근 가능한 것은 아닙니다. 연결 테스트와 대화 요청은 서버가 수행합니다. API 키는 서버에만 저장되며 화면에 표시되지 않습니다.',
'models.saved': '모델을 저장했습니다',
'models.deleted': '모델을 삭제했습니다',
'models.assignSaved': '에이전트 모델을 업데이트했습니다',
'models.saveFailed': '저장 실패: {detail}',
'models.loading': '불러오는 중…',
'models.loadFailed': '설정을 불러오지 못했습니다',
'models.idleFormHint': '카드의 «편집»을 누르거나 위의 «모델 추가»를 클릭하세요',
}; };
+94
View File
@@ -34,6 +34,8 @@ export const zh: Dict = {
'nav.projects': '项目', 'nav.projects': '项目',
'nav.buildScene': '搭建场景', 'nav.buildScene': '搭建场景',
'nav.settings': '设置', 'nav.settings': '设置',
'nav.agents': '智能体',
'nav.models': '模型设置',
'nav.home': '首页', 'nav.home': '首页',
'nav.primary': '主导航', 'nav.primary': '主导航',
'nav.projectStages': '项目阶段', 'nav.projectStages': '项目阶段',
@@ -995,6 +997,12 @@ export const zh: Dict = {
'settings.removeLlmTitle': '移除 LLM', 'settings.removeLlmTitle': '移除 LLM',
'settings.name': '名称', 'settings.name': '名称',
'settings.active': '激活', 'settings.active': '激活',
'settings.testLlm': '测试连接',
'settings.llmTestOk': '连接成功({ms} 毫秒)',
'settings.llmTestFail': '连接失败:{detail}',
'settings.llmTestAuth': '密钥被拒绝({detail})',
'settings.llmTestTimeout': '15 秒内无响应',
'settings.llmTestConnect': '无法连接服务器({detail})',
'settings.agentModelsSection': '智能体模型', 'settings.agentModelsSection': '智能体模型',
'settings.agentModelsLead': '用于故事起草和智能体任务的模型。', 'settings.agentModelsLead': '用于故事起草和智能体任务的模型。',
'settings.agentMaxStepsField': '最大步数', 'settings.agentMaxStepsField': '最大步数',
@@ -1128,4 +1136,90 @@ export const zh: Dict = {
'shot.errBlob': '无法读取截取的帧', 'shot.errBlob': '无法读取截取的帧',
'shot.errRecorder': '无法启动录制器', 'shot.errRecorder': '无法启动录制器',
'shot.errNoData': '没有可导出的场景数据', 'shot.errNoData': '没有可导出的场景数据',
// Models settings page (spec-v2 §9)
'models.title': '模型设置',
'models.subtitle': '添加自定义大语言模型(LLM),供智能体选用 · 第一阶段仅开放 LLM,图片 / 视频模型后续接入',
'models.statusCount': '{n} 个模型 · {m} 个可用',
'models.add': '+ 添加模型',
'models.tabLlm': '大语言模型',
'models.tabImage': '图片模型',
'models.tabVideo': '视频模型',
'models.comingSoon': '后续开放',
'models.empty': '还没有配置模型,点右上角「添加模型」接入第一个大语言模型',
'models.typeLocal': '本机',
'models.typeLan': '局域网',
'models.typeCloud': '云端',
'models.defaultBadge': '智能体默认',
'models.setDefault': '设为默认',
'models.defaultSetToast': '已设为智能体默认模型',
'models.test': '测试连接',
'models.testing': '测试中…',
'models.edit': '编辑',
'models.delete': '删除',
'models.statusUntested': '未测试',
'models.statusConnected': '已连接',
'models.statusFailed': '连接失败',
'models.latency': '延迟 {ms}ms',
'models.agentsUsing': '{n} 个智能体选用',
'models.lastTestAt': '上次测试 {time}',
'models.consecutiveFails': '已连续失败 {n} 次',
'models.cloudPaused': '云端调用已暂停',
'models.formTitleAdd': '添加模型',
'models.formTitleEdit': '编辑模型',
'models.formClose': '关闭',
'models.fName': '名称',
'models.fNamePh': '给模型起个名字,如 DeepSeek 官方',
'models.fApiType': '接口类型',
'models.apiOpenai': 'OpenAI 兼容',
'models.apiAnthropic': 'Anthropic',
'models.apiOther': '其他协议',
'models.apiTypeHelp': '第一阶段仅支持 OpenAI 兼容接口,其余协议随图片 / 视频模型一同开放',
'models.fBaseUrl': '接口地址',
'models.baseUrlHelp': '需含协议与端口,如 http://192.168.200.18:11434/v1',
'models.fModel': '模型名称',
'models.modelHelp': '以服务商提供的模型 ID 为准',
'models.fApiKey': 'API 密钥',
'models.keyNoEcho': '密钥不回显',
'models.keyHelp': '仅保存在本机服务器,页面永不显示完整密钥',
'models.keyKeepHint': '已保存密钥,留空表示不修改',
'models.fTimeout': '超时时间',
'models.timeoutSec': '{n} 秒',
'models.testOk': '✓ 测试通过 · 延迟 {ms}ms · {model} 可用',
'models.testFail': '✕ 测试失败 · {reason}',
'models.needTest': '未测试通过前无法保存',
'models.testBtn': '测试连接',
'models.save': '保存模型',
'models.errName': '请给模型起个名字',
'models.errUrl': '地址格式不正确,需含协议与路径,示例:https://api.deepseek.com/v1',
'models.errModel': '请填写模型名称,以服务商提供的模型 ID 为准',
'models.errKey': '请填写 API 密钥',
'models.failTimeout': '连接超时({sec} 秒无响应):服务器无法访问该地址,请检查地址、端口与防火墙',
'models.failAuth': '鉴权失败(401):请检查 API 密钥是否正确或已过期;使用聚合服务时,请确认账号已开通该模型权限',
'models.failNotFound': '连接正常但未找到该模型(404):请核对模型名称拼写',
'models.failNotOpenai': '地址可访问但未识别为 OpenAI 兼容接口,请确认路径是否以 /v1 结尾',
'models.failConnect': '服务器无法连接到该地址,请检查地址与端口',
'models.failHttp': '测试失败(HTTP {status})',
'models.delTitle': '删除模型',
'models.delConfirmUsed': '该模型正被 {n} 个智能体使用,删除后这些智能体将改用「智能体默认」。确定删除?',
'models.delConfirmFree': '确定删除该模型?删除后不可恢复。',
'models.delDefaultHint': '该模型是「智能体默认」,请先指定其他默认模型',
'models.agentsTitle': '智能体默认模型',
'models.agentsHint': '更改后新会话立即生效 · 也可在「智能体」页单独调整',
'models.agentDefault': '智能体默认',
'models.agentStory': '剧本创作',
'models.agentStyle': '视觉设计',
'models.agentScript': '分镜设计',
'models.agentAssets': '素材资产',
'models.agentVideo': '镜头脚本',
'models.unavailable': '(不可用)',
'models.noticeStrong': '连通性以工作台服务器为准:',
'models.noticeBody': '浏览器能打开某个地址,不代表运行工作台的服务器也能访问;连接测试与对话请求均由服务器发起。API 密钥仅保存在服务器本地,任何页面不回显。',
'models.saved': '模型已保存',
'models.deleted': '模型已删除',
'models.assignSaved': '智能体模型已更新',
'models.saveFailed': '保存失败:{detail}',
'models.loading': '加载中…',
'models.loadFailed': '设置加载失败',
'models.idleFormHint': '从左侧选择「编辑」,或点上方「添加模型」新增配置',
}; };
+56
View File
@@ -49,6 +49,62 @@ body {
min-height: 100vh; min-height: 100vh;
} }
/* ------------------------------------------------------------------
* A「片场暗房」scoped design tokens — spec-v2 §2 (HEL-603 confirmed).
* Adopted incrementally by new A-style pages via the `.a-darkroom`
* wrapper; graduates to :root when the full A shell (216px nav) lands.
* Values are the single source of truth for A pages — do not hardcode
* colors inside pages, and do not override these with ad-hoc CSS.
* ------------------------------------------------------------------ */
.a-darkroom {
--bg: #0d0e11;
--surface: #14161b;
--surface-2: #1b1e25;
--surface-3: #22262f;
--border: rgba(255, 255, 255, 0.07);
--border-strong: rgba(255, 255, 255, 0.14);
--text: #edeef0;
--text-2: #9ba1ab;
--text-3: #5c626c;
--accent: #e8a33d;
--accent-hover: #f1b155; /* +8% brightness (§5 主按钮) */
--accent-contrast: #16130a;
--accent-dim: rgba(232, 163, 61, 0.14);
--accent-glow: rgba(232, 163, 61, 0.35);
--success: #3fb97f;
--success-dim: rgba(63, 185, 127, 0.14);
--info: #5b8def;
--info-dim: rgba(91, 141, 239, 0.14);
--error: #e5484d;
--error-dim: rgba(229, 72, 77, 0.14);
--cloud: #b98be0;
--cloud-dim: rgba(185, 139, 224, 0.14);
/* Typography (§2.2) */
--font-ui: 'Noto Sans SC', 'Noto Sans CJK SC', var(--font-body);
--font-a-mono: 'JetBrains Mono', 'IBM Plex Mono', ui-monospace, monospace;
/* Avatar five-color set (§2.1) — five agents only */
--avatar-1: linear-gradient(135deg, #e8a33d, #b96a1b);
--avatar-2: linear-gradient(135deg, #5b8def, #3a5fa9);
--avatar-3: linear-gradient(135deg, #3fb97f, #2a7a54);
--avatar-4: linear-gradient(135deg, #b98be0, #7a4fa9);
--avatar-5: linear-gradient(135deg, #d98e6a, #a95535);
background: var(--bg);
color: var(--text);
font-family: var(--font-ui);
font-size: 13.5px;
line-height: 1.6;
}
.a-darkroom .mono,
.a-darkroom code,
.a-darkroom .kh {
font-family: var(--font-a-mono);
font-variant-numeric: tabular-nums;
}
h1, h1,
h2, h2,
h3, h3,
File diff suppressed because it is too large Load Diff
+2
View File
@@ -0,0 +1,2 @@
export const ssr = false;
export const prerender = false;
+91 -11
View File
@@ -33,6 +33,7 @@
let draft = $state<Record<string, unknown>>({}); let draft = $state<Record<string, unknown>>({});
let apiKeyDrafts = $state<Record<string, string>>({}); let apiKeyDrafts = $state<Record<string, string>>({});
let llmTestState = $state<Record<string, { pending: boolean; ok?: boolean; message: string }>>({});
// Dirty tracking: any staged field (draft map or a typed API key) counts. // Dirty tracking: any staged field (draft map or a typed API key) counts.
const dirtyKeys = $derived([ const dirtyKeys = $derived([
@@ -349,6 +350,53 @@
const nextKeys = { ...apiKeyDrafts }; const nextKeys = { ...apiKeyDrafts };
delete nextKeys[id]; delete nextKeys[id];
apiKeyDrafts = nextKeys; apiKeyDrafts = nextKeys;
const nextTests = { ...llmTestState };
delete nextTests[id];
llmTestState = nextTests;
}
function llmTestFailureText(res: { error?: string; detail?: string }): string {
let detail = res.detail ?? res.error ?? '';
if (res.error === 'auth') detail = t('settings.llmTestAuth', { detail });
else if (res.error === 'timeout') detail = t('settings.llmTestTimeout');
else if (res.error === 'connect') detail = t('settings.llmTestConnect', { detail });
return t('settings.llmTestFail', { detail });
}
async function testLlmConnection(s: Settings, profile: LlmProfile) {
ensureLlmDraft(s);
const typedKey = apiKeyDrafts[profile.id];
const savedOnServer = s.llm_profiles?.some((p) => p.id === profile.id) ?? false;
llmTestState = { ...llmTestState, [profile.id]: { pending: true, message: '' } };
try {
const res = await settings.testLlm({
...(typedKey || !savedOnServer ? {} : { profile_id: profile.id }),
base_url: profile.base_url.trim(),
model: profile.model.trim(),
...(typedKey ? { api_key: typedKey } : {}),
});
llmTestState = {
...llmTestState,
[profile.id]: res.ok
? {
pending: false,
ok: true,
message: t('settings.llmTestOk', { ms: res.elapsed_ms ?? '?' }),
}
: { pending: false, ok: false, message: llmTestFailureText(res) },
};
} catch (err) {
llmTestState = {
...llmTestState,
[profile.id]: {
pending: false,
ok: false,
message: t('settings.llmTestFail', {
detail: err instanceof Error ? err.message : String(err),
}),
},
};
}
} }
</script> </script>
@@ -389,16 +437,25 @@
{#each workingProfiles(s) as profile (profile.id)} {#each workingProfiles(s) as profile (profile.id)}
{@const active = workingActiveId(s) === profile.id} {@const active = workingActiveId(s) === profile.id}
<article class="llm-card" class:active> <article class="llm-card" class:active>
<header class="llm-card-head"> <header class="llm-card-head">
<label class="llm-active"> <label class="llm-active">
<input <input
type="radio" type="radio"
name="llm-active" name="llm-active"
checked={active} checked={active}
onchange={() => setActiveProfile(s, profile.id)} onchange={() => setActiveProfile(s, profile.id)}
/> />
<span>{active ? t('settings.active') : t('settings.useThis')}</span> <span>{active ? t('settings.active') : t('settings.useThis')}</span>
</label> </label>
<div class="llm-card-actions">
<Button
variant="secondary"
size="sm"
loading={llmTestState[profile.id]?.pending}
onclick={() => testLlmConnection(s, profile)}
>
{t('settings.testLlm')}
</Button>
{#if workingProfiles(s).length > 1} {#if workingProfiles(s).length > 1}
<Button <Button
variant="ghost" variant="ghost"
@@ -410,7 +467,17 @@
{t('settings.remove')} {t('settings.remove')}
</Button> </Button>
{/if} {/if}
</header> </div>
</header>
{#if llmTestState[profile.id] && !llmTestState[profile.id].pending && llmTestState[profile.id].message}
<p
class="test-result"
class:ok={llmTestState[profile.id].ok}
class:err={llmTestState[profile.id].ok === false}
>
{llmTestState[profile.id].message}
</p>
{/if}
<label class="field"> <label class="field">
<span class="field-label">{t('settings.name')}</span> <span class="field-label">{t('settings.name')}</span>
<input <input
@@ -950,6 +1017,19 @@
gap: 12px; gap: 12px;
margin-bottom: var(--space-sm); margin-bottom: var(--space-sm);
} }
.llm-card-actions {
display: flex;
align-items: center;
gap: 8px;
}
.test-result {
margin: 0 0 var(--space-sm);
font-size: 12px;
color: var(--error);
}
.test-result.ok {
color: var(--success);
}
.llm-active { .llm-active {
display: inline-flex; display: inline-flex;
align-items: center; align-items: center;