Skip to content

Agent Zero AI framework

Redesign first-run onboarding

Alessandrof6bc52201d9b
diff --git a/conf/model_providers.yaml b/conf/model_providers.yaml
index bef15015b..ee376782c 100644
--- a/conf/model_providers.yaml
+++ b/conf/model_providers.yaml
@@ -140,6 +140,8 @@ chat:
venice:
name: Venice.ai
litellm_provider: openai
+ models_list:
+ endpoint_url: "https://api.venice.ai/api/v1/models"
kwargs:
api_base: https://api.venice.ai/api/v1
venice_parameters:
diff --git a/plugins/_discovery/extensions/webui/initFw_end/auto-modal.js b/plugins/_discovery/extensions/webui/initFw_end/auto-modal.js
new file mode 100644
index 000000000..2fcce0076
--- /dev/null
+++ b/plugins/_discovery/extensions/webui/initFw_end/auto-modal.js
@@ -0,0 +1,136 @@
+import { callJsonApi } from "/js/api.js";
+import { isModalOpen } from "/js/modals.js";
+
+const DEFAULT_SURFACE = "welcome";
+const STARTUP_DELAY_MS = 650;
+const SUPPRESSION_PREFIX = "discovery_auto_modal_closed";
+
+let initialized = false;
+let lastOpened = null;
+let checking = false;
+
+function cleanPath(path = "") {
+ return String(path || "").replace(/^\/+/, "");
+}
+
+function currentContextId(fallback = "") {
+ try {
+ return fallback || globalThis.getContext?.() || sessionStorage.getItem("lastSelectedChat") || "welcome";
+ } catch {
+ return fallback || "welcome";
+ }
+}
+
+function bannerSupportsSurface(banner, surface) {
+ const surfaces = banner?.auto_modal_surfaces;
+ return !Array.isArray(surfaces) || surfaces.length === 0 || surfaces.includes(surface);
+}
+
+function suppressionKey({ surface, ctxid, reason, path }) {
+ return `${SUPPRESSION_PREFIX}:${surface}:${ctxid || "none"}:${reason || "unknown"}:${cleanPath(path)}`;
+}
+
+function isSuppressed(item) {
+ try {
+ return sessionStorage.getItem(suppressionKey(item)) === "1";
+ } catch {
+ return false;
+ }
+}
+
+function suppress(item) {
+ try {
+ sessionStorage.setItem(suppressionKey(item), "1");
+ } catch {
+ // no-op
+ }
+}
+
+function modalAlreadyOpen(path) {
+ return isModalOpen(path);
+}
+
+async function fetchAutoModalBanner(surface, ctxid) {
+ const response = await callJsonApi("/banners", {
+ banners: [],
+ context: {
+ is_welcome: surface === "welcome",
+ is_onboarding: document.body.dataset.mode === "onboarding",
+ surface,
+ ctxid,
+ },
+ });
+
+ const banners = Array.isArray(response?.banners) ? response.banners : [];
+ return banners
+ .filter((banner) => banner?.auto_modal_path)
+ .filter((banner) => bannerSupportsSurface(banner, surface))
+ .sort((left, right) => (Number(right.auto_modal_priority || 0) - Number(left.auto_modal_priority || 0)))[0] || null;
+}
+
+async function maybeOpenAutoModal(surface = DEFAULT_SURFACE, detail = {}) {
+ if (checking) return;
+ checking = true;
+ const ctxid = currentContextId(detail.ctxid || "");
+
+ try {
+ const banner = await fetchAutoModalBanner(surface, ctxid);
+ if (!banner?.auto_modal_path) return;
+
+ const item = {
+ surface,
+ ctxid,
+ path: banner.auto_modal_path,
+ reason: banner.auto_modal_reason || banner.id || "auto-modal",
+ };
+
+ if (isSuppressed(item) || modalAlreadyOpen(item.path)) return;
+
+ const opener = globalThis.ensureModalOpen || globalThis.openModal;
+ if (!opener) return;
+
+ lastOpened = item;
+ await opener(item.path);
+ } catch (error) {
+ console.error("Discovery auto-modal check failed:", error);
+ } finally {
+ checking = false;
+ }
+}
+
+function handleModalClosed(event) {
+ const closedPath = event?.detail?.modalPath || "";
+ if (lastOpened && cleanPath(closedPath) === cleanPath(lastOpened.path)) {
+ suppress(lastOpened);
+ const surface = lastOpened.surface;
+ const ctxid = lastOpened.ctxid;
+ lastOpened = null;
+ window.setTimeout(() => {
+ void maybeOpenAutoModal(surface, { ctxid });
+ }, 250);
+ return;
+ }
+
+ window.setTimeout(() => {
+ void maybeOpenAutoModal(DEFAULT_SURFACE);
+ }, 250);
+}
+
+function handleChatCreated(event) {
+ const ctxid = event?.detail?.ctxid || "";
+ window.setTimeout(() => {
+ void maybeOpenAutoModal("chat-created", { ctxid });
+ }, 300);
+}
+
+export default function initDiscoveryAutoModal() {
+ if (initialized) return;
+ initialized = true;
+
+ document.addEventListener("modal-closed", handleModalClosed);
+ document.addEventListener("chat-created", handleChatCreated);
+
+ window.setTimeout(() => {
+ void maybeOpenAutoModal(DEFAULT_SURFACE);
+ }, STARTUP_DELAY_MS);
+}
diff --git a/plugins/_discovery/extensions/webui/onboarding-success-end/discovery-cards.html b/plugins/_discovery/extensions/webui/onboarding-success-end/discovery-cards.html
index 58968987a..f77d8d9aa 100644
--- a/plugins/_discovery/extensions/webui/onboarding-success-end/discovery-cards.html
+++ b/plugins/_discovery/extensions/webui/onboarding-success-end/discovery-cards.html
@@ -53,7 +53,7 @@
</div>
- <template x-for="card in $store.discoveryStore.heroCards" :key="card.id">
+ <template x-for="card in $store.discoveryStore.heroCards.filter(card => card.id !== 'discovery-codex-oauth')" :key="card.id">
<article class="discovery-hero"
role="button"
tabindex="0"
diff --git a/plugins/_model_config/api/model_config_get.py b/plugins/_model_config/api/model_config_get.py
index 3350d0d0f..cf660e2ba 100644
--- a/plugins/_model_config/api/model_config_get.py
+++ b/plugins/_model_config/api/model_config_get.py
@@ -1,5 +1,6 @@
from helpers.api import ApiHandler, Request, Response
from helpers import plugins
+from helpers.providers import get_raw_providers
from plugins._model_config.helpers import model_config
import models
@@ -21,6 +22,8 @@ class ModelConfigGet(ApiHandler):
# Add provider lists for UI dropdowns
chat_providers = model_config.get_chat_providers()
embedding_providers = model_config.get_embedding_providers()
+ chat_provider_details = get_raw_providers("chat")
+ embedding_provider_details = get_raw_providers("embedding")
# Mask API keys - show status only
api_key_status = {}
@@ -37,5 +40,7 @@ class ModelConfigGet(ApiHandler):
"config": config,
"chat_providers": chat_providers,
"embedding_providers": embedding_providers,
+ "chat_provider_details": chat_provider_details,
+ "embedding_provider_details": embedding_provider_details,
"api_key_status": api_key_status,
}
diff --git a/plugins/_model_config/api/model_search.py b/plugins/_model_config/api/model_search.py
index fc5c8acc0..83a7deeda 100644
--- a/plugins/_model_config/api/model_search.py
+++ b/plugins/_model_config/api/model_search.py
@@ -1,35 +1,66 @@
+from __future__ import annotations
+
+from typing import Any
+
import httpx
from helpers.api import ApiHandler, Request, Response
from helpers.providers import get_provider_config
import models
-# Model name substrings to exclude from litellm fallback results
-_LITELLM_EXCLUDE = frozenset({
- "dall-e", "gpt-image", "tts", "whisper", "audio",
- "realtime", "davinci", "babbage", "ada", "vision-preview",
+# Model name substrings to exclude from chat dropdowns and LiteLLM fallback results.
+_NON_CHAT_EXCLUDE = frozenset({
+ "dall-e",
+ "gpt-image",
+ "image",
+ "tts",
+ "text-to-speech",
+ "whisper",
+ "audio",
+ "transcribe",
+ "transcription",
+ "speech",
+ "realtime",
+ "embedding",
+ "embed",
+ "moderation",
+ "omni-moderation",
+ "vision-preview",
})
class ModelSearch(ApiHandler):
async def process(self, input: dict, request: Request) -> dict | Response:
- provider = input.get("provider", "")
- model_type = input.get("model_type", "chat")
- user_api_base = input.get("api_base", "")
+ provider = str(input.get("provider", "") or "").strip().lower()
+ model_type = str(input.get("model_type", "chat") or "chat").strip().lower()
+ query = str(input.get("query", "") or "").strip().lower()
+ user_api_base = str(input.get("api_base", "") or "").strip()
if not provider:
- return {"models": []}
+ return {"models": [], "provider": "", "source": "none", "error": ""}
cfg = self._get_provider_cfg(model_type, provider)
ml = self._get_models_list(cfg)
- all_models = await self._fetch_models(provider, cfg, ml, user_api_base) or []
+ models_list, source, error = await self._fetch_models(provider, cfg, ml, user_api_base)
- if not all_models:
- litellm_provider = cfg.get("litellm_provider", provider)
- if litellm_provider == provider:
- all_models = self._litellm_fallback(provider, cfg)
+ if not models_list:
+ fallback = self._litellm_fallback(provider, cfg)
+ if fallback:
+ models_list = fallback
+ source = "litellm_registry"
+ elif not source:
+ source = "none"
- return {"models": sorted(all_models), "provider": provider}
+ models_list = self._filter_models(models_list, model_type)
+ if query:
+ models_list = [name for name in models_list if query in name.lower()]
+
+ return {
+ "models": sorted(set(models_list), key=str.lower),
+ "provider": provider,
+ "source": source,
+ "error": error,
+ }
@staticmethod
def _get_provider_cfg(model_type: str, provider: str) -> dict:
@@ -48,55 +79,96 @@ class ModelSearch(ApiHandler):
"""Extract models_list sub-config."""
return cfg.get("models_list") or {}
- async def _fetch_models(self, provider: str, cfg: dict, ml: dict, user_api_base: str = "") -> list[str] | None:
+ async def _fetch_models(
+ self,
+ provider: str,
+ cfg: dict,
+ ml: dict,
+ user_api_base: str = "",
+ ) -> tuple[list[str], str, str]:
api_key = models.get_api_key(provider)
- api_base = user_api_base or (cfg or {}).get("kwargs", {}).get("api_base", "")
+ kwargs = (cfg or {}).get("kwargs", {}) or {}
+ api_base = user_api_base or kwargs.get("api_base", "") or ml.get("default_base", "")
+ effective_ml = dict(ml or {})
+
+ # Ollama's native endpoint is /api/tags, but user-supplied /v1 bases usually
+ # mean the OpenAI-compatible /v1/models endpoint.
+ if provider == "ollama" and user_api_base.rstrip("/").endswith("/v1"):
+ effective_ml["endpoint_url"] = "/models"
+ effective_ml["format"] = "openai"
- url, fmt = self._resolve_url(ml, api_base)
+ url, fmt = self._resolve_url(effective_ml, api_base)
if not url:
- return None
+ return [], "none", ""
headers = self._build_headers(provider, api_key, cfg)
- params = dict(ml.get("params", {}) or {})
+ params = dict(effective_ml.get("params", {}) or {})
- # Google uses query-param auth
+ # Google uses query-param auth for the public models list endpoint.
if provider == "google" and api_key and api_key != "None":
params.setdefault("key", api_key)
+ urls: list[tuple[str, str]] = [(url, fmt)]
+ if provider == "ollama" and fmt == "ollama":
+ ps_url = self._ollama_ps_url(url)
+ if ps_url and ps_url != url:
+ urls.append((ps_url, "ollama"))
+
+ combined: list[str] = []
+ errors: list[str] = []
+
try:
async with httpx.AsyncClient(timeout=10.0) as client:
- resp = await client.get(url, headers=headers, params=params)
- if resp.status_code == 200:
- result = self._parse(resp.json(), fmt)
- if result:
- return result
- except Exception:
- pass
-
- return None
+ for candidate_url, candidate_fmt in urls:
+ resp = await client.get(candidate_url, headers=headers, params=params)
+ if resp.status_code == 200:
+ combined.extend(self._parse(resp.json(), candidate_fmt))
+ else:
+ errors.append(f"{candidate_url}: HTTP {resp.status_code}")
+ except Exception as exc:
+ errors.append(str(exc))
+
+ if combined:
+ return combined, "provider_endpoint", ""
+ return [], "provider_endpoint", "; ".join(errors)
@staticmethod
def _resolve_url(ml: dict, api_base: str) -> tuple[str | None, str]:
fmt = ml.get("format", "openai")
- endpoint = ml.get("endpoint_url", "")
- default_base = ml.get("default_base", "")
+ endpoint = str(ml.get("endpoint_url", "") or "")
+ default_base = str(ml.get("default_base", "") or "")
- if endpoint.startswith("http"):
+ if endpoint.startswith("http://") or endpoint.startswith("https://"):
return endpoint, fmt
- base = api_base or default_base
+ base = str(api_base or default_base or "").strip()
if not base:
return None, fmt
- if endpoint:
- return base.rstrip("/") + endpoint, fmt
+ endpoint = endpoint or "/models"
+ base = base.rstrip("/")
+
+ if not endpoint.startswith("/"):
+ endpoint = "/" + endpoint
- # Generic fallback: base + /models
- return base.rstrip("/") + "/models", fmt
+ # Avoid doubled /v1/v1 when users enter a base ending in /v1 and metadata
+ # also contains a versioned endpoint.
+ if base.endswith("/v1") and endpoint.startswith("/v1/"):
+ endpoint = endpoint[3:]
+
+ return base + endpoint, fmt
+
+ @staticmethod
+ def _ollama_ps_url(resolved_url: str) -> str:
+ """Return the Ollama running-model endpoint for a resolved native URL."""
+ marker = "/api/"
+ if marker not in resolved_url:
+ return ""
+ return resolved_url.split(marker, 1)[0].rstrip("/") + "/api/ps"
def _build_headers(self, provider: str, api_key: str, cfg: dict | None) -> dict[str, str]:
headers: dict[str, str] = {}
- has_key = api_key and api_key != "None"
+ has_key = bool(api_key and api_key.strip() and api_key != "None")
if provider == "anthropic":
if has_key:
@@ -113,52 +185,103 @@ class ModelSearch(ApiHandler):
extra = (cfg or {}).get("kwargs", {}).get("extra_headers", {})
if isinstance(extra, dict):
- for k, v in extra.items():
- if isinstance(v, str):
- headers[k] = v
+ for key, value in extra.items():
+ if isinstance(value, str):
+ headers[key] = value
return headers
def _litellm_fallback(self, provider: str, cfg: dict | None) -> list[str]:
try:
import litellm
+
registry = getattr(litellm, "models_by_provider", None)
if not registry:
return []
litellm_provider = (cfg or {}).get("litellm_provider", provider)
- raw_models: set = registry.get(litellm_provider, set())
+ raw_models = registry.get(litellm_provider, set()) or set()
if not raw_models:
return []
prefix = litellm_provider + "/"
result: list[str] = []
for name in raw_models:
- clean = name[len(prefix):] if name.startswith(prefix) else name
- low = clean.lower()
- if any(exc in low for exc in _LITELLM_EXCLUDE):
- continue
- if clean:
+ clean = str(name or "")
+ clean = clean[len(prefix):] if clean.startswith(prefix) else clean
+ if clean and not self._is_non_chat_model(clean):
result.append(clean)
return result
except Exception:
return []
def _parse(self, data: dict | list, fmt: str) -> list[str]:
+ if isinstance(data, list):
+ return self._parse_list(data)
+
+ if not isinstance(data, dict):
+ return []
+
if fmt == "ollama":
- return [m.get("name", "") for m in data.get("models", []) if m.get("name")]
+ return self._parse_models_array(data.get("models", []), "name")
if fmt == "google":
result = []
- for m in data.get("models", []):
- name = m.get("name", "")
+ for item in data.get("models", []) or []:
+ if not isinstance(item, dict):
+ continue
+ name = str(item.get("name", "") or "")
if name.startswith("models/"):
name = name[7:]
if name:
result.append(name)
return result
- if isinstance(data, dict) and "data" in data:
- return [m.get("id", "") for m in data["data"] if m.get("id")]
+ if "data" in data:
+ return self._parse_models_array(data.get("data", []), "id")
+
+ if "models" in data:
+ return self._parse_models_array(data.get("models", []), "id")
return []
+
+ @staticmethod
+ def _parse_models_array(items: Any, primary_key: str) -> list[str]:
+ if not isinstance(items, list):
+ return []
+ result = []
+ for item in items:
+ if isinstance(item, str):
+ result.append(item)
+ elif isinstance(item, dict):
+ value = item.get(primary_key) or item.get("id") or item.get("name")
+ if value:
+ result.append(str(value))
+ return result
+
+ def _parse_list(self, data: list) -> list[str]:
+ result = []
+ for item in data:
+ if isinstance(item, str):
+ result.append(item)
+ elif isinstance(item, dict):
+ value = item.get("id") or item.get("name")
+ if value:
+ result.append(str(value))
+ return result
+
+ def _filter_models(self, model_names: list[str], model_type: str) -> list[str]:
+ cleaned = []
+ for name in model_names or []:
+ value = str(name or "").strip()
+ if not value:
+ continue
+ if model_type == "chat" and self._is_non_chat_model(value):
+ continue
+ cleaned.append(value)
+ return cleaned
+
+ @staticmethod
+ def _is_non_chat_model(name: str) -> bool:
+ low = name.lower()
+ return any(token in low for token in _NON_CHAT_EXCLUDE)
diff --git a/plugins/_model_config/extensions/python/banners/_20_missing_api_key.py b/plugins/_model_config/extensions/python/banners/_20_missing_api_key.py
index d209d37c2..0028a93fc 100644
--- a/plugins/_model_config/extensions/python/banners/_20_missing_api_key.py
+++ b/plugins/_model_config/extensions/python/banners/_20_missing_api_key.py
@@ -21,7 +21,7 @@ class MissingApiKeyCheck(Extension):
if missing_providers:
banners.append({
"id": "missing-api-key",
- "type": "error",
+ "type": "warning",
"priority": 100,
"title": "Welcome to Agent Zero!",
"html": f"""You're almost ready to chat. Please configure your models to continue.<br>
@@ -29,6 +29,10 @@ class MissingApiKeyCheck(Extension):
{self.CONFIGURE_MODEL_SETTINGS_LINK}""",
"dismissible": False,
"source": "backend",
+ "auto_modal_path": "/plugins/_onboarding/webui/onboarding.html",
+ "auto_modal_reason": "missing-api-key",
+ "auto_modal_priority": 100,
+ "auto_modal_surfaces": ["welcome", "chat-created"],
# For programmatic clients (e.g. chat composer) reusing this banner pipeline
"missing_providers": missing_providers,
})
diff --git a/plugins/_model_config/helpers/model_config.py b/plugins/_model_config/helpers/model_config.py
index eee226bb8..30a7c731f 100644
--- a/plugins/_model_config/helpers/model_config.py
+++ b/plugins/_model_config/helpers/model_config.py
@@ -4,14 +4,53 @@ from copy import deepcopy
import models
from helpers import plugins, files
from helpers import yaml as yaml_helper
-from helpers.providers import get_providers
+from helpers.providers import get_provider_config, get_providers
PRESETS_FILE = "presets.yaml"
DEFAULT_PRESETS_FILE = "default_presets.yaml"
+PROVIDER_METADATA_FILE = "provider_metadata.yaml"
PRESET_SCOPE_GLOBAL = "global"
PRESET_SCOPE_PROJECT = "project"
LOCAL_PROVIDERS = {"ollama", "lm_studio"}
LOCAL_EMBEDDING = {"huggingface"}
+_PROVIDER_METADATA_CACHE: dict | None = None
+
+
+def _get_provider_metadata_path() -> str:
+ plugin_dir = plugins.find_plugin_dir("_model_config")
+ return files.get_abs_path(plugin_dir, PROVIDER_METADATA_FILE) if plugin_dir else ""
+
+
+def get_provider_metadata(model_type: str = "chat", provider: str = "") -> dict:
+ """Get plugin-owned provider metadata that does not belong in conf/model_providers.yaml."""
+ global _PROVIDER_METADATA_CACHE
+ if _PROVIDER_METADATA_CACHE is None:
+ path = _get_provider_metadata_path()
+ if path and files.exists(path):
+ data = yaml_helper.loads(files.read_file(path))
+ _PROVIDER_METADATA_CACHE = data if isinstance(data, dict) else {}
+ else:
+ _PROVIDER_METADATA_CACHE = {}
+
+ section = _PROVIDER_METADATA_CACHE.get(model_type, {})
+ if not isinstance(section, dict):
+ return {}
+ meta = section.get(str(provider or "").strip().lower(), {})
+ return meta if isinstance(meta, dict) else {}
+
+
+def _model_type_for_label(label: str) -> str:
+ return "embedding" if label == "Embedding Model" else "chat"
+
+
+def provider_requires_api_key(provider: str, model_type: str = "chat") -> bool:
+ provider_id = str(provider or "").strip().lower()
+ if not provider_id:
+ return False
+ cfg = get_provider_config(model_type, provider_id) or get_provider_config("chat", provider_id) or {}
+ meta = get_provider_metadata(model_type, provider_id) or get_provider_metadata("chat", provider_id)
+ mode = str(meta.get("api_key_mode") or cfg.get("api_key_mode") or "required").strip().lower()
+ return mode not in {"none", "optional", "oauth"}
def _get_presets_path(project_name: str | None = None) -> str:
@@ -351,7 +390,9 @@ def get_embedding_providers():
return get_providers("embedding")
-def has_provider_api_key(provider: str, configured_api_key: str = "") -> bool:
+def has_provider_api_key(provider: str, configured_api_key: str = "", model_type: str = "chat") -> bool:
+ if not provider_requires_api_key(provider, model_type):
+ return True
configured_value = (configured_api_key or "").strip()
if configured_value and configured_value != "None":
return True
@@ -381,7 +422,7 @@ def get_missing_api_key_providers(agent=None) -> list[dict]:
if label == "Embedding Model" and provider_lower in LOCAL_EMBEDDING:
continue
- if not has_provider_api_key(provider_lower, model_cfg.get("api_key", "")):
+ if not has_provider_api_key(provider_lower, model_cfg.get("api_key", ""), _model_type_for_label(label)):
missing.append({"model_type": label, "provider": provider})
return missing
diff --git a/plugins/_model_config/provider_metadata.yaml b/plugins/_model_config/provider_metadata.yaml
new file mode 100644
index 000000000..b88a897ed
--- /dev/null
+++ b/plugins/_model_config/provider_metadata.yaml
@@ -0,0 +1,19 @@
+chat:
+ codex_oauth:
+ api_key_mode: oauth
+ lm_studio:
+ api_key_mode: none
+ ollama:
+ api_key_mode: none
+ other:
+ api_key_mode: optional
+
+embedding:
+ huggingface:
+ api_key_mode: none
+ lm_studio:
+ api_key_mode: none
+ ollama:
+ api_key_mode: none
+ other:
+ api_key_mode: optional
diff --git a/plugins/_model_config/webui/model-config-store.js b/plugins/_model_config/webui/model-config-store.js
index 1f68e5d01..268952a34 100644
--- a/plugins/_model_config/webui/model-config-store.js
+++ b/plugins/_model_config/webui/model-config-store.js
@@ -54,6 +54,8 @@ export const store = createStore("modelConfig", {
// Core state
chatProviders: [],
embeddingProviders: [],
+ chatProviderDetails: [],
+ embeddingProviderDetails: [],
_loaded: false,
// API Keys state (from mixin)
@@ -95,6 +97,8 @@ export const store = createStore("modelConfig", {
const data = await this._fetchConfigData();
this.chatProviders = data.chat_providers || [];
this.embeddingProviders = data.embedding_providers || [];
+ this.chatProviderDetails = data.chat_provider_details || [];
+ this.embeddingProviderDetails = data.embedding_provider_details || [];
this.apiKeyStatus = data.api_key_status || {};
const keys = {};
const dirty = {};
@@ -238,8 +242,8 @@ export const store = createStore("modelConfig", {
return key === 'embedding_model' ? 'embedding' : 'chat';
},
- async searchModels(provider, query, modelType, apiBase) {
- if (!provider) return [];
+ async searchModelsDetailed(provider, query, modelType, apiBase) {
+ if (!provider) return { models: [], provider: '', source: 'none', error: '' };
try {
const res = await fetchApi(`${API_BASE}/model_search`, {
method: 'POST',
@@ -247,13 +251,23 @@ export const store = createStore("modelConfig", {
body: JSON.stringify({ provider, query: query || '', model_type: modelType || 'chat', api_base: apiBase || '' })
});
const data = await res.json();
- return data.models || [];
+ return {
+ models: data.models || [],
+ provider: data.provider || provider,
+ source: data.source || '',
+ error: data.error || '',
+ };
} catch (e) {
console.error('Model search failed:', e);
- return [];
+ return { models: [], provider, source: 'error', error: e?.message || String(e) };
}
},
+ async searchModels(provider, query, modelType, apiBase) {
+ const data = await this.searchModelsDetailed(provider, query, modelType, apiBase);
+ return data.models || [];
+ },
+
groupResults(models, query) {
const q = (query || '').trim().toLowerCase();
if (!q) return { matched: [], rest: models };
diff --git a/plugins/_onboarding/webui/assets/cloud-card.webp b/plugins/_onboarding/webui/assets/cloud-card.webp
new file mode 100644
index 000000000..0ad9b2035
Binary files /dev/null and b/plugins/_onboarding/webui/assets/cloud-card.webp differ
diff --git a/plugins/_onboarding/webui/assets/local-card.webp b/plugins/_onboarding/webui/assets/local-card.webp
new file mode 100644
index 000000000..cf9576ba4
Binary files /dev/null and b/plugins/_onboarding/webui/assets/local-card.webp differ
diff --git a/plugins/_onboarding/webui/assets/provider-logos/cometapi.ico b/plugins/_onboarding/webui/assets/provider-logos/cometapi.ico
new file mode 100644
index 000000000..702023db5
Binary files /dev/null and b/plugins/_onboarding/webui/assets/provider-logos/cometapi.ico differ
diff --git a/plugins/_onboarding/webui/assets/provider-logos/github-copilot.svg b/plugins/_onboarding/webui/assets/provider-logos/github-copilot.svg
new file mode 100644
index 000000000..fc0d041ed
--- /dev/null
+++ b/plugins/_onboarding/webui/assets/provider-logos/github-copilot.svg
@@ -0,0 +1 @@
+<svg fill="#000000" role="img" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><title>GitHub Copilot</title><path d="M23.922 16.997C23.061 18.492 18.063 22.02 12 22.02 5.937 22.02.939 18.492.078 16.997A.641.641 0 0 1 0 16.741v-2.869a.883.883 0 0 1 .053-.22c.372-.935 1.347-2.292 2.605-2.656.167-.429.414-1.055.644-1.517a10.098 10.098 0 0 1-.052-1.086c0-1.331.282-2.499 1.132-3.368.397-.406.89-.717 1.474-.952C7.255 2.937 9.248 1.98 11.978 1.98c2.731 0 4.767.957 6.166 2.093.584.235 1.077.546 1.474.952.85.869 1.132 2.037 1.132 3.368 0 .368-.014.733-.052 1.086.23.462.477 1.088.644 1.517 1.258.364 2.233 1.721 2.605 2.656a.841.841 0 0 1 .053.22v2.869a.641.641 0 0 1-.078.256Zm-11.75-5.992h-.344a4.359 4.359 0 0 1-.355.508c-.77.947-1.918 1.492-3.508 1.492-1.725 0-2.989-.359-3.782-1.259a2.137 2.137 0 0 1-.085-.104L4 11.746v6.585c1.435.779 4.514 2.179 8 2.179 3.486 0 6.565-1.4 8-2.179v-6.585l-.098-.104s-.033.045-.085.104c-.793.9-2.057 1.259-3.782 1.259-1.59 0-2.738-.545-3.508-1.492a4.359 4.359 0 0 1-.355-.508Zm2.328 3.25c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm-5 0c.549 0 1 .451 1 1v2c0 .549-.451 1-1 1-.549 0-1-.451-1-1v-2c0-.549.451-1 1-1Zm3.313-6.185c.136 1.057.403 1.913.878 2.497.442.544 1.134.938 2.344.938 1.573 0 2.292-.337 2.657-.751.384-.435.558-1.15.558-2.361 0-1.14-.243-1.847-.705-2.319-.477-.488-1.319-.862-2.824-1.025-1.487-.161-2.192.138-2.533.529-.269.307-.437.808-.438 1.578v.021c0 .265.021.562.063.893Zm-1.626 0c.042-.331.063-.628.063-.894v-.02c-.001-.77-.169-1.271-.438-1.578-.341-.391-1.046-.69-2.533-.529-1.505.163-2.347.537-2.824 1.025-.462.472-.705 1.179-.705 2.319 0 1.211.175 1.926.558 2.361.365.414 1.084.751 2.657.751 1.21 0 1.902-.394 2.344-.938.475-.584.742-1.44.878-2.497Z"/></svg>
\ No newline at end of file
diff --git a/plugins/_onboarding/webui/assets/provider-logos/google-gemini.svg b/plugins/_onboarding/webui/assets/provider-logos/google-gemini.svg
new file mode 100644
index 000000000..787c83710
--- /dev/null
+++ b/plugins/_onboarding/webui/assets/provider-logos/google-gemini.svg
@@ -0,0 +1 @@
+<svg fill="none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><path d="M16 8.016A8.522 8.522 0 008.016 16h-.032A8.521 8.521 0 000 8.016v-.032A8.521 8.521 0 007.984 0h.032A8.522 8.522 0 0016 7.984v.032z" fill="url(#prefix__paint0_radial_980_20147)"/><defs><radialGradient id="prefix__paint0_radial_980_20147" cx="0" cy="0" r="1" gradientUnits="userSpaceOnUse" gradientTransform="matrix(16.1326 5.4553 -43.70045 129.2322 1.588 6.503)"><stop offset=".067" stop-color="#9168C0"/><stop offset=".343" stop-color="#5684D1"/><stop offset=".672" stop-color="#1BA1E3"/></radialGradient></defs></svg>
\ No newline at end of file
diff --git a/plugins/_onboarding/webui/assets/provider-logos/groq.svg b/plugins/_onboarding/webui/assets/provider-logos/groq.svg
new file mode 100644
index 000000000..5cd0253a7
--- /dev/null
+++ b/plugins/_onboarding/webui/assets/provider-logos/groq.svg
@@ -0,0 +1,38 @@
+<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" width="152px" height="55.5px" viewBox="0 32.25 152 55.5" enable-background="new 0 32.25 152 55.5" xml:space="preserve">
+ <title>
+ groq_logo
+ </title>
+ <g id="Layer_2">
+ <g id="Layer_1-2">
+ <path d="M84.848,34.137c-9.798,0-17.769,7.971-17.769,17.77s7.971,17.769,17.769,17.769s17.77-7.971,17.77-17.769
+ S94.645,34.137,84.848,34.137z M84.848,63.013c-6.124,0-11.106-4.983-11.106-11.106s4.982-11.106,11.106-11.106
+ c6.124,0,11.106,4.982,11.106,11.106S90.973,63.013,84.848,63.013z">
+ </path>
+ <path d="M60.315,34.206c-0.607-0.068-1.217-0.104-1.827-0.108c-0.304,0-0.595,0.009-0.893,0.014s-0.594,0.033-0.891,0.051
+ c-1.197,0.094-2.382,0.299-3.541,0.611c-2.329,0.629-4.574,1.723-6.515,3.277c-1.97,1.57-3.548,3.575-4.611,5.859
+ c-0.53,1.138-0.921,2.336-1.165,3.567c-0.121,0.608-0.21,1.222-0.266,1.84c-0.02,0.307-0.055,0.615-0.059,0.921l-0.011,0.459
+ l-0.005,0.23v0.19l0.015,5.951l0.015,5.951l0.041,5.95h6.664l0.042-5.95l0.015-5.952l0.015-5.951v-0.182l0.005-0.142l0.008-0.285
+ c0-0.191,0.028-0.375,0.039-0.564c0.036-0.37,0.091-0.738,0.165-1.102c0.146-0.716,0.374-1.413,0.678-2.077
+ c0.613-1.332,1.528-2.502,2.673-3.419c1.156-0.932,2.541-1.628,4.038-2.042c0.757-0.207,1.532-0.344,2.314-0.408
+ c0.198-0.011,0.395-0.03,0.594-0.037c0.199-0.007,0.402-0.013,0.595-0.012c0.383,0,0.76,0.025,1.142,0.06
+ c1.518,0.153,2.989,0.619,4.318,1.368l3.326-5.776C65.108,35.263,62.753,34.484,60.315,34.206z">
+ </path>
+ <path d="M17.77,34.048C7.971,34.048,0,42.019,0,51.817s7.971,17.77,17.77,17.77h5.844v-6.664H17.77
+ c-6.124,0-11.106-4.982-11.106-11.106s4.982-11.106,11.106-11.106s11.132,4.982,11.132,11.106l0,0v16.365l0,0
+ c0,6.084-4.954,11.039-11.023,11.103c-2.904-0.024-5.681-1.191-7.729-3.25l-4.712,4.712c3.266,3.283,7.691,5.151,12.321,5.201
+ v0.003c0.04,0,0.08,0,0.119,0h0.125v-0.003c9.659-0.131,17.48-8.005,17.525-17.686l0.006-16.881
+ C35.302,41.785,27.422,34.048,17.77,34.048z">
+ </path>
+ <path d="M124.083,34.137c-9.798,0-17.769,7.971-17.769,17.77s7.971,17.769,17.769,17.769h6.08v-6.663h-6.08
+ c-6.124,0-11.106-4.983-11.106-11.106s4.982-11.106,11.106-11.106c5.799,0,10.572,4.468,11.062,10.143h-0.01v34.12h6.664V51.907
+ l0,0C141.797,42.108,133.881,34.137,124.083,34.137z">
+ </path>
+ <polygon points="151.983,35.04 151.033,35.04 149.737,37.053 148.399,35.04 147.44,35.04 147.44,38.624 148.511,38.624
+ 148.511,36.88 149.461,38.288 149.979,38.288 150.912,36.836 150.929,38.624 152,38.624 ">
+ </polygon>
+ <polygon points="143.519,35.896 144.685,35.896 144.685,38.624 145.86,38.624 145.86,35.896 147.034,35.896 147.034,35.04
+ 143.519,35.04 ">
+ </polygon>
+ </g>
+ </g>
+</svg>
\ No newline at end of file
diff --git a/plugins/_onboarding/webui/assets/provider-logos/sambanova.png b/plugins/_onboarding/webui/assets/provider-logos/sambanova.png
new file mode 100644
index 000000000..a962965f6
Binary files /dev/null and b/plugins/_onboarding/webui/assets/provider-logos/sambanova.png differ
diff --git a/plugins/_onboarding/webui/assets/provider-logos/zai-logo.svg b/plugins/_onboarding/webui/assets/provider-logos/zai-logo.svg
new file mode 100644
index 000000000..4f511bd72
--- /dev/null
+++ b/plugins/_onboarding/webui/assets/provider-logos/zai-logo.svg
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 25.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;" xml:space="preserve">
+<style type="text/css">
+ .st0{opacity:0.3;fill:#E2E4E7;}
+ .st1{opacity:0.8;fill:#E2E4E7;stroke:#FFFFFF;stroke-width:5;stroke-miterlimit:10;}
+ .st2{fill:url(#SVGID_1_);}
+ .st3{fill:none;stroke:#E0E4E9;stroke-width:0.25;stroke-miterlimit:10;}
+ .st4{fill:none;}
+ .st5{fill:#9DA1A5;}
+ .st6{fill-rule:evenodd;clip-rule:evenodd;fill:none;}
+ .st7{fill-rule:evenodd;clip-rule:evenodd;fill:#DFE2E7;}
+ .st8{fill-rule:evenodd;clip-rule:evenodd;fill:#CDD4DA;}
+ .st9{fill-rule:evenodd;clip-rule:evenodd;fill:#B3BCC7;}
+ .st10{fill-rule:evenodd;clip-rule:evenodd;fill:#9DAAB7;}
+ .st11{fill-rule:evenodd;clip-rule:evenodd;fill:#8698A8;}
+ .st12{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_2_);}
+ .st13{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_3_);}
+ .st14{fill:#1F63EC;}
+ .st15{fill:#2D2D2D;}
+ .st16{fill:none;stroke:#E0E4E9;stroke-width:0.5;stroke-miterlimit:10;}
+ .st17{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_4_);}
+ .st18{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_5_);}
+ .st19{fill:none;stroke:#677380;stroke-width:0.5;stroke-miterlimit:10;}
+ .st20{fill:none;stroke:url(#SVGID_6_);stroke-width:2;stroke-miterlimit:10;}
+ .st21{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_7_);}
+ .st22{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_8_);}
+ .st23{fill:#FFFFFF;}
+ .st24{fill-rule:evenodd;clip-rule:evenodd;fill:#2D2D2D;}
+ .st25{clip-path:url(#SVGID_10_);}
+ .st26{clip-path:url(#SVGID_12_);}
+ .st27{fill:url(#SVGID_13_);}
+ .st28{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_14_);}
+ .st29{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_15_);}
+ .st30{clip-path:url(#SVGID_17_);}
+ .st31{clip-path:url(#SVGID_19_);}
+ .st32{fill:url(#SVGID_20_);}
+ .st33{fill:none;stroke:url(#SVGID_21_);stroke-width:2;stroke-miterlimit:10;}
+ .st34{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_22_);}
+ .st35{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_23_);}
+ .st36{clip-path:url(#SVGID_25_);}
+ .st37{clip-path:url(#SVGID_27_);}
+ .st38{fill:url(#SVGID_28_);}
+ .st39{clip-path:url(#SVGID_30_);}
+ .st40{clip-path:url(#SVGID_32_);}
+ .st41{fill:url(#SVGID_33_);}
+ .st42{fill-rule:evenodd;clip-rule:evenodd;fill:#126EF6;}
+ .st43{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
+ .st44{clip-path:url(#SVGID_35_);}
+ .st45{clip-path:url(#SVGID_37_);}
+ .st46{fill:url(#SVGID_38_);}
+ .st47{fill-rule:evenodd;clip-rule:evenodd;fill:#9DA1A5;}
+ .st48{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_39_);}
+ .st49{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_40_);}
+ .st50{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_41_);}
+ .st51{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_42_);}
+ .st52{fill:none;stroke:url(#SVGID_43_);stroke-width:2;stroke-miterlimit:10;}
+ .st53{fill-rule:evenodd;clip-rule:evenodd;fill:none;stroke:#E0E4E9;stroke-width:0.5;stroke-miterlimit:10;}
+ .st54{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_44_);}
+ .st55{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_45_);}
+ .st56{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_46_);}
+ .st57{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_47_);}
+ .st58{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_48_);}
+ .st59{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_49_);}
+ .st60{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_50_);}
+ .st61{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_51_);}
+ .st62{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_52_);}
+ .st63{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_53_);}
+ .st64{clip-path:url(#SVGID_55_);}
+ .st65{clip-path:url(#SVGID_57_);}
+ .st66{fill:url(#SVGID_58_);}
+ .st67{clip-path:url(#SVGID_60_);}
+ .st68{clip-path:url(#SVGID_62_);}
+ .st69{fill:url(#SVGID_63_);}
+ .st70{fill:none;stroke:url(#SVGID_64_);stroke-width:2;stroke-miterlimit:10;}
+ .st71{clip-path:url(#SVGID_66_);}
+ .st72{clip-path:url(#SVGID_68_);}
+ .st73{fill:url(#SVGID_69_);}
+ .st74{clip-path:url(#SVGID_71_);}
+ .st75{clip-path:url(#SVGID_73_);}
+ .st76{fill:url(#SVGID_74_);}
+ .st77{clip-path:url(#SVGID_76_);}
+ .st78{clip-path:url(#SVGID_78_);}
+ .st79{fill:url(#SVGID_79_);}
+ .st80{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_80_);}
+ .st81{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_81_);}
+ .st82{clip-path:url(#SVGID_83_);}
+ .st83{clip-path:url(#SVGID_85_);}
+ .st84{fill:url(#SVGID_86_);}
+ .st85{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_87_);}
+ .st86{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_88_);}
+ .st87{clip-path:url(#SVGID_90_);}
+ .st88{clip-path:url(#SVGID_92_);}
+ .st89{fill:url(#SVGID_93_);}
+ .st90{fill:none;stroke:url(#SVGID_94_);stroke-width:2;stroke-miterlimit:10;}
+ .st91{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_95_);}
+ .st92{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_96_);}
+ .st93{clip-path:url(#SVGID_98_);}
+ .st94{clip-path:url(#SVGID_100_);}
+ .st95{fill:url(#SVGID_101_);}
+ .st96{clip-path:url(#SVGID_103_);}
+ .st97{clip-path:url(#SVGID_105_);}
+ .st98{fill:url(#SVGID_106_);}
+ .st99{clip-path:url(#SVGID_108_);}
+ .st100{clip-path:url(#SVGID_110_);}
+ .st101{fill:url(#SVGID_111_);}
+ .st102{fill:#FFFFFF;stroke:#B3BCC7;stroke-width:0.275;stroke-miterlimit:10;}
+ .st103{clip-path:url(#SVGID_113_);}
+ .st104{fill:#FDD138;}
+ .st105{fill:#FCA62F;}
+ .st106{fill:#FB7927;}
+ .st107{fill:#F44B22;}
+ .st108{fill:#D81915;}
+ .st109{fill:#2D2D2D;stroke:#FFFFFF;stroke-width:0.3354;stroke-miterlimit:10;}
+ .st110{fill:none;stroke:#65727F;stroke-width:2;stroke-miterlimit:10;}
+ .st111{fill:none;stroke:#65727F;stroke-width:0.75;stroke-miterlimit:10;}
+ .st112{fill:url(#SVGID_114_);}
+ .st113{fill:#D06C50;}
+ .st114{fill:#2D2D2D;stroke:#B3BCC7;stroke-width:0.275;stroke-miterlimit:10;}
+ .st115{opacity:0.2;}
+ .st116{fill:none;stroke:#677380;stroke-width:0.3564;stroke-miterlimit:10;}
+ .st117{fill:none;stroke:#677380;stroke-width:0.3564;stroke-miterlimit:10;stroke-dasharray:1.0212,1.0212;}
+ .st118{fill:none;stroke:#677380;stroke-width:0.3564;stroke-miterlimit:10;stroke-dasharray:1.0205,1.0205;}
+ .st119{opacity:0.2;fill:none;}
+ .st120{fill:none;stroke:#677380;stroke-width:0.3689;stroke-miterlimit:10;}
+ .st121{fill:none;stroke:#677380;stroke-width:0.3689;stroke-miterlimit:10;stroke-dasharray:1.0509,1.0509;}
+ .st122{opacity:0.3;fill:#1F63EC;}
+ .st123{fill:#2D2D2D;stroke:#FFFFFF;stroke-width:0.3162;stroke-miterlimit:10;}
+ .st124{fill:#FFFFFF;stroke:#B3BCC7;stroke-width:0.3162;stroke-miterlimit:10;}
+ .st125{clip-path:url(#SVGID_118_);}
+ .st126{fill:url(#SVGID_119_);}
+ .st127{fill:none;stroke:#DFE2E7;stroke-width:0.75;stroke-miterlimit:10;}
+ .st128{fill:#9DA1A5;stroke:#FFFFFF;stroke-miterlimit:10;}
+ .st129{fill:url(#SVGID_120_);}
+ .st130{fill:none;stroke:#677380;stroke-width:0.75;stroke-miterlimit:10;}
+ .st131{opacity:0.4;}
+ .st132{clip-path:url(#SVGID_122_);}
+ .st133{clip-path:url(#SVGID_124_);}
+ .st134{fill:url(#SVGID_125_);}
+ .st135{fill:none;stroke:#8392A3;stroke-width:0.35;stroke-miterlimit:10;}
+ .st136{fill:none;stroke:#8392A3;stroke-width:0.35;stroke-miterlimit:10;stroke-dasharray:0.9951,0.9951;}
+ .st137{fill:none;stroke:#8392A3;stroke-width:0.35;stroke-miterlimit:10;stroke-dasharray:1.004,1.004;}
+ .st138{fill:none;stroke:url(#SVGID_126_);stroke-width:1.5;stroke-miterlimit:10;}
+ .st139{fill:url(#SVGID_127_);}
+ .st140{fill:none;stroke:#DDE0E4;stroke-width:0.35;stroke-miterlimit:10;}
+ .st141{fill:#2D2D2D;stroke:#A9B3BE;stroke-width:0.275;stroke-miterlimit:10;}
+ .st142{fill-rule:evenodd;clip-rule:evenodd;fill:#126EF4;}
+ .st143{fill:#FFFFFF;stroke:#B1BAC4;stroke-width:0.275;stroke-miterlimit:10;}
+ .st144{fill:#CE6C50;}
+ .st145{fill:#5B5B5B;}
+ .st146{fill:#8392A3;}
+ .st147{fill:none;stroke:url(#SVGID_128_);stroke-width:1.5;stroke-miterlimit:10;}
+ .st148{fill:url(#SVGID_129_);}
+ .st149{fill:none;stroke:#B5BDC4;stroke-width:0.7;stroke-miterlimit:10;}
+ .st150{opacity:0.6;fill:none;stroke:#78838E;stroke-width:0.35;stroke-miterlimit:10;}
+ .st151{opacity:0.2;fill:none;stroke:#8392A3;stroke-width:0.35;stroke-miterlimit:10;stroke-dasharray:1,1;}
+ .st152{fill:none;stroke:#DDE0E4;stroke-width:0.75;stroke-miterlimit:10;}
+ .st153{fill:none;stroke:#8392A3;stroke-width:0.5;stroke-miterlimit:10;}
+ .st154{opacity:0.2;fill:none;stroke:#677380;stroke-width:0.3564;stroke-miterlimit:10;stroke-dasharray:1.0182,1.0182;}
+ .st155{fill:none;stroke:#DDE0E4;stroke-width:0.765;stroke-miterlimit:10;}
+ .st156{fill:url(#SVGID_130_);}
+ .st157{fill:url(#SVGID_131_);}
+ .st158{fill:#B1BAC4;}
+ .st159{fill:#CBD1D8;}
+ .st160{fill:#0B1B2B;}
+ .st161{fill:#91D119;}
+ .st162{opacity:0.7;}
+ .st163{fill:#FFFFFF;stroke:#000000;stroke-width:0.4418;stroke-miterlimit:10;}
+ .st164{fill:none;stroke:#939CAA;stroke-width:0.2209;stroke-miterlimit:10;}
+ .st165{fill:none;stroke:#FFFFFF;stroke-width:3.0924;stroke-miterlimit:10;}
+ .st166{fill:url(#SVGID_132_);}
+ .st167{fill:none;stroke:url(#SVGID_133_);stroke-width:1.714;stroke-miterlimit:10;}
+ .st168{fill:url(#SVGID_134_);}
+ .st169{fill:url(#SVGID_135_);}
+ .st170{fill:url(#SVGID_136_);}
+ .st171{fill:url(#SVGID_137_);}
+ .st172{fill:url(#SVGID_138_);}
+ .st173{fill:url(#SVGID_139_);}
+ .st174{fill:url(#SVGID_140_);}
+ .st175{fill:url(#SVGID_141_);}
+ .st176{fill:url(#SVGID_142_);}
+ .st177{fill:url(#SVGID_143_);}
+ .st178{fill:url(#SVGID_144_);}
+ .st179{fill:none;stroke:#1F63EC;stroke-width:4;stroke-miterlimit:10;}
+ .st180{fill:none;stroke:#0B1B2B;stroke-width:4;stroke-miterlimit:10;}
+ .st181{fill:none;stroke:#677380;stroke-width:0.3989;stroke-miterlimit:10;}
+ .st182{fill:none;stroke:#677380;stroke-width:0.3989;stroke-miterlimit:10;stroke-dasharray:1.14,1.14;}
+ .st183{fill:#257AF1;}
+ .st184{opacity:0.3;fill:#FFFFFF;}
+ .st185{fill:none;stroke:#98A5B2;stroke-width:4;stroke-miterlimit:10;}
+ .st186{fill:none;stroke:#65727F;stroke-width:0.3989;stroke-miterlimit:10;}
+ .st187{fill:none;stroke:#65727F;stroke-width:0.3989;stroke-miterlimit:10;stroke-dasharray:1.14,1.14;}
+ .st188{fill:none;stroke:#DDDFE4;stroke-width:0.75;stroke-miterlimit:10;}
+ .st189{fill:#9A9EA2;}
+ .st190{fill-rule:evenodd;clip-rule:evenodd;fill:#3267AC;}
+ .st191{fill:#FFFFFF;stroke:#AFB8C3;stroke-width:0.275;stroke-miterlimit:10;}
+ .st192{fill:#C5694E;}
+ .st193{fill:#8192A2;}
+ .st194{fill:#2D2D2D;stroke:#FFFFFF;stroke-width:0.6317;stroke-miterlimit:10;}
+</style>
+<g id="图层_2">
+</g>
+<g id="图层_1">
+ <path class="st194" d="M24.51,28.51H5.49c-2.21,0-4-1.79-4-4V5.49c0-2.21,1.79-4,4-4h19.03c2.21,0,4,1.79,4,4v19.03
+ C28.51,26.72,26.72,28.51,24.51,28.51z"/>
+ <g>
+ <g>
+ <g>
+ <g>
+ <path class="st23" d="M15.47,7.1l-1.3,1.85c-0.2,0.29-0.54,0.47-0.9,0.47h-7.1V7.09C6.16,7.1,15.47,7.1,15.47,7.1z"/>
+ <polygon class="st23" points="24.3,7.1 13.14,22.91 5.7,22.91 16.86,7.1 "/>
+ <path class="st23" d="M14.53,22.91l1.31-1.86c0.2-0.29,0.54-0.47,0.9-0.47h7.09v2.33H14.53z"/>
+ </g>
+ </g>
+ </g>
+ </g>
+</g>
+</svg>
diff --git a/plugins/_onboarding/webui/assets/provider-logos/zai.svg b/plugins/_onboarding/webui/assets/provider-logos/zai.svg
new file mode 100644
index 000000000..4f511bd72
--- /dev/null
+++ b/plugins/_onboarding/webui/assets/provider-logos/zai.svg
@@ -0,0 +1,219 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Generator: Adobe Illustrator 25.3.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
+<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
+ viewBox="0 0 30 30" style="enable-background:new 0 0 30 30;" xml:space="preserve">
+<style type="text/css">
+ .st0{opacity:0.3;fill:#E2E4E7;}
+ .st1{opacity:0.8;fill:#E2E4E7;stroke:#FFFFFF;stroke-width:5;stroke-miterlimit:10;}
+ .st2{fill:url(#SVGID_1_);}
+ .st3{fill:none;stroke:#E0E4E9;stroke-width:0.25;stroke-miterlimit:10;}
+ .st4{fill:none;}
+ .st5{fill:#9DA1A5;}
+ .st6{fill-rule:evenodd;clip-rule:evenodd;fill:none;}
+ .st7{fill-rule:evenodd;clip-rule:evenodd;fill:#DFE2E7;}
+ .st8{fill-rule:evenodd;clip-rule:evenodd;fill:#CDD4DA;}
+ .st9{fill-rule:evenodd;clip-rule:evenodd;fill:#B3BCC7;}
+ .st10{fill-rule:evenodd;clip-rule:evenodd;fill:#9DAAB7;}
+ .st11{fill-rule:evenodd;clip-rule:evenodd;fill:#8698A8;}
+ .st12{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_2_);}
+ .st13{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_3_);}
+ .st14{fill:#1F63EC;}
+ .st15{fill:#2D2D2D;}
+ .st16{fill:none;stroke:#E0E4E9;stroke-width:0.5;stroke-miterlimit:10;}
+ .st17{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_4_);}
+ .st18{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_5_);}
+ .st19{fill:none;stroke:#677380;stroke-width:0.5;stroke-miterlimit:10;}
+ .st20{fill:none;stroke:url(#SVGID_6_);stroke-width:2;stroke-miterlimit:10;}
+ .st21{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_7_);}
+ .st22{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_8_);}
+ .st23{fill:#FFFFFF;}
+ .st24{fill-rule:evenodd;clip-rule:evenodd;fill:#2D2D2D;}
+ .st25{clip-path:url(#SVGID_10_);}
+ .st26{clip-path:url(#SVGID_12_);}
+ .st27{fill:url(#SVGID_13_);}
+ .st28{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_14_);}
+ .st29{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_15_);}
+ .st30{clip-path:url(#SVGID_17_);}
+ .st31{clip-path:url(#SVGID_19_);}
+ .st32{fill:url(#SVGID_20_);}
+ .st33{fill:none;stroke:url(#SVGID_21_);stroke-width:2;stroke-miterlimit:10;}
+ .st34{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_22_);}
+ .st35{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_23_);}
+ .st36{clip-path:url(#SVGID_25_);}
+ .st37{clip-path:url(#SVGID_27_);}
+ .st38{fill:url(#SVGID_28_);}
+ .st39{clip-path:url(#SVGID_30_);}
+ .st40{clip-path:url(#SVGID_32_);}
+ .st41{fill:url(#SVGID_33_);}
+ .st42{fill-rule:evenodd;clip-rule:evenodd;fill:#126EF6;}
+ .st43{fill-rule:evenodd;clip-rule:evenodd;fill:#FFFFFF;}
+ .st44{clip-path:url(#SVGID_35_);}
+ .st45{clip-path:url(#SVGID_37_);}
+ .st46{fill:url(#SVGID_38_);}
+ .st47{fill-rule:evenodd;clip-rule:evenodd;fill:#9DA1A5;}
+ .st48{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_39_);}
+ .st49{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_40_);}
+ .st50{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_41_);}
+ .st51{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_42_);}
+ .st52{fill:none;stroke:url(#SVGID_43_);stroke-width:2;stroke-miterlimit:10;}
+ .st53{fill-rule:evenodd;clip-rule:evenodd;fill:none;stroke:#E0E4E9;stroke-width:0.5;stroke-miterlimit:10;}
+ .st54{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_44_);}
+ .st55{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_45_);}
+ .st56{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_46_);}
+ .st57{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_47_);}
+ .st58{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_48_);}
+ .st59{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_49_);}
+ .st60{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_50_);}
+ .st61{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_51_);}
+ .st62{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_52_);}
+ .st63{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_53_);}
+ .st64{clip-path:url(#SVGID_55_);}
+ .st65{clip-path:url(#SVGID_57_);}
+ .st66{fill:url(#SVGID_58_);}
+ .st67{clip-path:url(#SVGID_60_);}
+ .st68{clip-path:url(#SVGID_62_);}
+ .st69{fill:url(#SVGID_63_);}
+ .st70{fill:none;stroke:url(#SVGID_64_);stroke-width:2;stroke-miterlimit:10;}
+ .st71{clip-path:url(#SVGID_66_);}
+ .st72{clip-path:url(#SVGID_68_);}
+ .st73{fill:url(#SVGID_69_);}
+ .st74{clip-path:url(#SVGID_71_);}
+ .st75{clip-path:url(#SVGID_73_);}
+ .st76{fill:url(#SVGID_74_);}
+ .st77{clip-path:url(#SVGID_76_);}
+ .st78{clip-path:url(#SVGID_78_);}
+ .st79{fill:url(#SVGID_79_);}
+ .st80{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_80_);}
+ .st81{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_81_);}
+ .st82{clip-path:url(#SVGID_83_);}
+ .st83{clip-path:url(#SVGID_85_);}
+ .st84{fill:url(#SVGID_86_);}
+ .st85{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_87_);}
+ .st86{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_88_);}
+ .st87{clip-path:url(#SVGID_90_);}
+ .st88{clip-path:url(#SVGID_92_);}
+ .st89{fill:url(#SVGID_93_);}
+ .st90{fill:none;stroke:url(#SVGID_94_);stroke-width:2;stroke-miterlimit:10;}
+ .st91{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_95_);}
+ .st92{fill-rule:evenodd;clip-rule:evenodd;fill:url(#SVGID_96_);}
+ .st93{clip-path:url(#SVGID_98_);}
+ .st94{clip-path:url(#SVGID_100_);}
+ .st95{fill:url(#SVGID_101_);}
+ .st96{clip-path:url(#SVGID_103_);}
+ .st97{clip-path:url(#SVGID_105_);}
+ .st98{fill:url(#SVGID_106_);}
+ .st99{clip-path:url(#SVGID_108_);}
+ .st100{clip-path:url(#SVGID_110_);}
+ .st101{fill:url(#SVGID_111_);}
+ .st102{fill:#FFFFFF;stroke:#B3BCC7;stroke-width:0.275;stroke-miterlimit:10;}
+ .st103{clip-path:url(#SVGID_113_);}
+ .st104{fill:#FDD138;}
+ .st105{fill:#FCA62F;}
+ .st106{fill:#FB7927;}
+ .st107{fill:#F44B22;}
+ .st108{fill:#D81915;}
+ .st109{fill:#2D2D2D;stroke:#FFFFFF;stroke-width:0.3354;stroke-miterlimit:10;}
+ .st110{fill:none;stroke:#65727F;stroke-width:2;stroke-miterlimit:10;}
+ .st111{fill:none;stroke:#65727F;stroke-width:0.75;stroke-miterlimit:10;}
+ .st112{fill:url(#SVGID_114_);}
+ .st113{fill:#D06C50;}
+ .st114{fill:#2D2D2D;stroke:#B3BCC7;stroke-width:0.275;stroke-miterlimit:10;}
+ .st115{opacity:0.2;}
+ .st116{fill:none;stroke:#677380;stroke-width:0.3564;stroke-miterlimit:10;}
+ .st117{fill:none;stroke:#677380;stroke-width:0.3564;stroke-miterlimit:10;stroke-dasharray:1.0212,1.0212;}
+ .st118{fill:none;stroke:#677380;stroke-width:0.3564;stroke-miterlimit:10;stroke-dasharray:1.0205,1.0205;}
+ .st119{opacity:0.2;fill:none;}
+ .st120{fill:none;stroke:#677380;stroke-width:0.3689;stroke-miterlimit:10;}
+ .st121{fill:none;stroke:#677380;stroke-width:0.3689;stroke-miterlimit:10;stroke-dasharray:1.0509,1.0509;}
+ .st122{opacity:0.3;fill:#1F63EC;}
+ .st123{fill:#2D2D2D;stroke:#FFFFFF;stroke-width:0.3162;stroke-miterlimit:10;}
+ .st124{fill:#FFFFFF;stroke:#B3BCC7;stroke-width:0.3162;stroke-miterlimit:10;}
+ .st125{clip-path:url(#SVGID_118_);}
+ .st126{fill:url(#SVGID_119_);}
+ .st127{fill:none;stroke:#DFE2E7;stroke-width:0.75;stroke-miterlimit:10;}
+ .st128{fill:#9DA1A5;stroke:#FFFFFF;stroke-miterlimit:10;}
+ .st129{fill:url(#SVGID_120_);}
+ .st130{fill:none;stroke:#677380;stroke-width:0.75;stroke-miterlimit:10;}
+ .st131{opacity:0.4;}
+ .st132{clip-path:url(#SVGID_122_);}
+ .st133{clip-path:url(#SVGID_124_);}
+ .st134{fill:url(#SVGID_125_);}
+ .st135{fill:none;stroke:#8392A3;stroke-width:0.35;stroke-miterlimit:10;}
+ .st136{fill:none;stroke:#8392A3;stroke-width:0.35;stroke-miterlimit:10;stroke-dasharray:0.9951,0.9951;}
+ .st137{fill:none;stroke:#8392A3;stroke-width:0.35;stroke-miterlimit:10;stroke-dasharray:1.004,1.004;}
+ .st138{fill:none;stroke:url(#SVGID_126_);stroke-width:1.5;stroke-miterlimit:10;}
+ .st139{fill:url(#SVGID_127_);}
+ .st140{fill:none;stroke:#DDE0E4;stroke-width:0.35;stroke-miterlimit:10;}
+ .st141{fill:#2D2D2D;stroke:#A9B3BE;stroke-width:0.275;stroke-miterlimit:10;}
+ .st142{fill-rule:evenodd;clip-rule:evenodd;fill:#126EF4;}
+ .st143{fill:#FFFFFF;stroke:#B1BAC4;stroke-width:0.275;stroke-miterlimit:10;}
+ .st144{fill:#CE6C50;}
+ .st145{fill:#5B5B5B;}
+ .st146{fill:#8392A3;}
+ .st147{fill:none;stroke:url(#SVGID_128_);stroke-width:1.5;stroke-miterlimit:10;}
+ .st148{fill:url(#SVGID_129_);}
+ .st149{fill:none;stroke:#B5BDC4;stroke-width:0.7;stroke-miterlimit:10;}
+ .st150{opacity:0.6;fill:none;stroke:#78838E;stroke-width:0.35;stroke-miterlimit:10;}
+ .st151{opacity:0.2;fill:none;stroke:#8392A3;stroke-width:0.35;stroke-miterlimit:10;stroke-dasharray:1,1;}
+ .st152{fill:none;stroke:#DDE0E4;stroke-width:0.75;stroke-miterlimit:10;}
+ .st153{fill:none;stroke:#8392A3;stroke-width:0.5;stroke-miterlimit:10;}
+ .st154{opacity:0.2;fill:none;stroke:#677380;stroke-width:0.3564;stroke-miterlimit:10;stroke-dasharray:1.0182,1.0182;}
+ .st155{fill:none;stroke:#DDE0E4;stroke-width:0.765;stroke-miterlimit:10;}
+ .st156{fill:url(#SVGID_130_);}
+ .st157{fill:url(#SVGID_131_);}
+ .st158{fill:#B1BAC4;}
+ .st159{fill:#CBD1D8;}
+ .st160{fill:#0B1B2B;}
+ .st161{fill:#91D119;}
+ .st162{opacity:0.7;}
+ .st163{fill:#FFFFFF;stroke:#000000;stroke-width:0.4418;stroke-miterlimit:10;}
+ .st164{fill:none;stroke:#939CAA;stroke-width:0.2209;stroke-miterlimit:10;}
+ .st165{fill:none;stroke:#FFFFFF;stroke-width:3.0924;stroke-miterlimit:10;}
+ .st166{fill:url(#SVGID_132_);}
+ .st167{fill:none;stroke:url(#SVGID_133_);stroke-width:1.714;stroke-miterlimit:10;}
+ .st168{fill:url(#SVGID_134_);}
+ .st169{fill:url(#SVGID_135_);}
+ .st170{fill:url(#SVGID_136_);}
+ .st171{fill:url(#SVGID_137_);}
+ .st172{fill:url(#SVGID_138_);}
+ .st173{fill:url(#SVGID_139_);}
+ .st174{fill:url(#SVGID_140_);}
+ .st175{fill:url(#SVGID_141_);}
+ .st176{fill:url(#SVGID_142_);}
+ .st177{fill:url(#SVGID_143_);}
+ .st178{fill:url(#SVGID_144_);}
+ .st179{fill:none;stroke:#1F63EC;stroke-width:4;stroke-miterlimit:10;}
+ .st180{fill:none;stroke:#0B1B2B;stroke-width:4;stroke-miterlimit:10;}
+ .st181{fill:none;stroke:#677380;stroke-width:0.3989;stroke-miterlimit:10;}
+ .st182{fill:none;stroke:#677380;stroke-width:0.3989;stroke-miterlimit:10;stroke-dasharray:1.14,1.14;}
+ .st183{fill:#257AF1;}
+ .st184{opacity:0.3;fill:#FFFFFF;}
+ .st185{fill:none;stroke:#98A5B2;stroke-width:4;stroke-miterlimit:10;}
+ .st186{fill:none;stroke:#65727F;stroke-width:0.3989;stroke-miterlimit:10;}
+ .st187{fill:none;stroke:#65727F;stroke-width:0.3989;stroke-miterlimit:10;stroke-dasharray:1.14,1.14;}
+ .st188{fill:none;stroke:#DDDFE4;stroke-width:0.75;stroke-miterlimit:10;}
+ .st189{fill:#9A9EA2;}
+ .st190{fill-rule:evenodd;clip-rule:evenodd;fill:#3267AC;}
+ .st191{fill:#FFFFFF;stroke:#AFB8C3;stroke-width:0.275;stroke-miterlimit:10;}
+ .st192{fill:#C5694E;}
+ .st193{fill:#8192A2;}
+ .st194{fill:#2D2D2D;stroke:#FFFFFF;stroke-width:0.6317;stroke-miterlimit:10;}
+</style>
+<g id="图层_2">
+</g>
+<g id="图层_1">
+ <path class="st194" d="M24.51,28.51H5.49c-2.21,0-4-1.79-4-4V5.49c0-2.21,1.79-4,4-4h19.03c2.21,0,4,1.79,4,4v19.03
+ C28.51,26.72,26.72,28.51,24.51,28.51z"/>
+ <g>
+ <g>
+ <g>
+ <g>
+ <path class="st23" d="M15.47,7.1l-1.3,1.85c-0.2,0.29-0.54,0.47-0.9,0.47h-7.1V7.09C6.16,7.1,15.47,7.1,15.47,7.1z"/>
+ <polygon class="st23" points="24.3,7.1 13.14,22.91 5.7,22.91 16.86,7.1 "/>
+ <path class="st23" d="M14.53,22.91l1.31-1.86c0.2-0.29,0.54-0.47,0.9-0.47h7.09v2.33H14.53z"/>
+ </g>
+ </g>
+ </g>
+ </g>
+</g>
+</svg>
diff --git a/plugins/_onboarding/webui/onboarding-providers.js b/plugins/_onboarding/webui/onboarding-providers.js
new file mode 100644
index 000000000..d63ab010b
--- /dev/null
+++ b/plugins/_onboarding/webui/onboarding-providers.js
@@ -0,0 +1,239 @@
+export const TOP_CLOUD_PROVIDER_IDS = [
+ "openrouter",
+ "a0_venice",
+ "openai",
+ "anthropic",
+ "google",
+ "deepseek",
+ "venice",
+ "zai",
+ "mistral",
+ "azure",
+];
+
+export const MORE_CLOUD_PROVIDER_IDS = [
+ "ollama_cloud",
+ "bedrock",
+ "groq",
+ "xai",
+ "moonshot",
+ "huggingface",
+ "github_copilot",
+ "sambanova",
+ "cometapi",
+ "other",
+];
+
+export const LOCAL_PROVIDER_IDS = ["ollama", "lm_studio", "other"];
+
+export const ONBOARDING_PROVIDER_OVERRIDES = {
+ a0_venice: {
+ logo: "/public/darkSymbol.svg",
+ setup_url: "https://www.agent-zero.ai/p/community/api-dashboard/about/",
+ docs_url: "https://www.agent-zero.ai/p/community/api-dashboard/about/",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "A0T token-based Venice.ai API Proxy.",
+ },
+ anthropic: {
+ logo: "https://www.anthropic.com/favicon.ico",
+ setup_url: "https://console.anthropic.com/",
+ api_key_url: "https://platform.claude.com/settings/keys",
+ docs_url: "https://platform.claude.com/settings/keys",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "Claude models for careful reasoning.",
+ },
+ azure: {
+ name: "Azure OpenAI",
+ logo: "https://azure.microsoft.com/favicon.ico",
+ setup_url: "https://portal.azure.com/",
+ docs_url: "https://learn.microsoft.com/en-us/azure/foundry/openai/api-version-lifecycle?tabs=python#api-evolution",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "OpenAI models through Azure.",
+ },
+ bedrock: {
+ logo: "https://a0.awsstatic.com/libra-css/images/site/fav/favicon.ico",
+ setup_url: "https://aws.amazon.com/bedrock/",
+ docs_url: "https://docs.aws.amazon.com/bedrock/",
+ api_key_mode: "required",
+ model_list_autoload: false,
+ short_description: "Enterprise access through AWS.",
+ },
+ cometapi: {
+ logo: "/plugins/_onboarding/webui/assets/provider-logos/cometapi.ico",
+ setup_url: "https://www.cometapi.com/",
+ docs_url: "https://apidoc.cometapi.com/overview/quick-start",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "Multi-model API gateway.",
+ },
+ deepseek: {
+ logo: "https://www.deepseek.com/favicon.ico",
+ setup_url: "https://platform.deepseek.com/",
+ api_key_url: "https://platform.deepseek.com/api_keys",
+ docs_url: "https://platform.deepseek.com/api_keys",
+ default_chat_model: "deepseek-chat",
+ default_utility_model: "deepseek-chat",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "Cost-efficient reasoning and coding.",
+ },
+ github_copilot: {
+ logo: "/plugins/_onboarding/webui/assets/provider-logos/github-copilot.svg",
+ setup_url: "https://github.com/features/copilot",
+ docs_url: "https://docs.github.com/copilot",
+ api_key_mode: "required",
+ model_list_autoload: false,
+ short_description: "GitHub account-backed coding models.",
+ },
+ google: {
+ name: "Google",
+ logo: "/plugins/_onboarding/webui/assets/provider-logos/google-gemini.svg",
+ setup_url: "https://aistudio.google.com/",
+ api_key_url: "https://ai.google.dev/gemini-api/docs/api-key",
+ docs_url: "https://ai.google.dev/gemini-api/docs/api-key",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "Gemini models from Google AI Studio.",
+ },
+ groq: {
+ logo: "/plugins/_onboarding/webui/assets/provider-logos/groq.svg",
+ setup_url: "https://console.groq.com/",
+ api_key_url: "https://console.groq.com/keys",
+ docs_url: "https://console.groq.com/keys",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "Very fast hosted inference.",
+ },
+ huggingface: {
+ logo: "https://huggingface.co/front/assets/huggingface_logo-noborder.svg",
+ setup_url: "https://huggingface.co/settings/tokens",
+ api_key_url: "https://huggingface.co/docs/hub/security-tokens",
+ docs_url: "https://huggingface.co/docs/hub/security-tokens",
+ api_key_mode: "required",
+ model_list_autoload: false,
+ short_description: "Open model hub and hosted inference.",
+ },
+ lm_studio: {
+ logo: "https://lmstudio.ai/favicon.ico",
+ setup_url: "https://lmstudio.ai/",
+ docs_url: "https://lmstudio.ai/docs/developer/core/authentication",
+ default_api_base: "http://host.docker.internal:1234/v1",
+ api_key_mode: "none",
+ model_list_autoload: true,
+ short_description: "Run local models through LM Studio.",
+ },
+ mistral: {
+ logo: "https://mistral.ai/favicon.ico",
+ setup_url: "https://console.mistral.ai/",
+ api_key_url: "https://docs.mistral.ai/getting-started/quickstarts/studio/activate-and-generate-api-key",
+ docs_url: "https://docs.mistral.ai/getting-started/quickstarts/studio/activate-and-generate-api-key",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "European frontier and open models.",
+ },
+ moonshot: {
+ logo: "https://platform.moonshot.ai/favicon.ico",
+ setup_url: "https://platform.moonshot.ai/",
+ api_key_url: "https://platform.kimi.ai/console/api-keys",
+ docs_url: "https://platform.kimi.ai/console/api-keys",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "Kimi models with long-context strengths.",
+ },
+ ollama: {
+ logo: "https://ollama.com/public/ollama.png",
+ setup_url: "https://ollama.com/download",
+ docs_url: "https://docs.ollama.com/",
+ default_api_base: "http://host.docker.internal:11434",
+ api_key_mode: "none",
+ model_list_autoload: true,
+ short_description: "Run models on your own machine.",
+ },
+ ollama_cloud: {
+ logo: "https://ollama.com/public/ollama.png",
+ setup_url: "https://ollama.com/",
+ api_key_url: "https://ollama.com/settings/keys",
+ docs_url: "https://docs.ollama.com/cloud",
+ default_api_base: "https://ollama.com/v1",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "Ollama cloud models through a hosted endpoint.",
+ },
+ openai: {
+ logo: "https://openai.com/favicon.ico",
+ setup_url: "https://platform.openai.com/",
+ api_key_url: "https://platform.openai.com/api-keys",
+ docs_url: "https://platform.openai.com/api-keys",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "OpenAI API models for general work.",
+ },
+ openrouter: {
+ logo: "https://openrouter.ai/favicon.ico",
+ setup_url: "https://openrouter.ai/",
+ api_key_url: "https://openrouter.ai/workspaces/default/keys",
+ docs_url: "https://openrouter.ai/workspaces/default/keys",
+ default_chat_model: "anthropic/claude-sonnet-4.6",
+ default_utility_model: "google/gemini-3.1-flash-lite-preview",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "One key for many model families.",
+ },
+ other: {
+ logo: "/public/darkSymbol.svg",
+ docs_url: "",
+ api_key_url: "",
+ setup_url: "",
+ api_key_mode: "optional",
+ model_list_autoload: true,
+ short_description: "Use a compatible endpoint you control.",
+ },
+ sambanova: {
+ logo: "/plugins/_onboarding/webui/assets/provider-logos/sambanova.png",
+ setup_url: "https://cloud.sambanova.ai/",
+ api_key_url: "https://cloud.sambanova.ai/apis",
+ docs_url: "https://docs.sambanova.ai/",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "Hosted fast open-model inference.",
+ },
+ venice: {
+ logo: "https://venice.ai/favicon.ico",
+ setup_url: "https://venice.ai/",
+ api_key_url: "https://venice.ai/settings/api",
+ docs_url: "https://docs.venice.ai/guides/getting-started/generating-api-key",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "Privacy-focused hosted models.",
+ },
+ xai: {
+ logo: "https://x.ai/favicon.ico",
+ setup_url: "https://console.x.ai/",
+ api_key_url: "https://console.x.ai/team/default/api-keys",
+ docs_url: "https://docs.x.ai/",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "Grok models from xAI.",
+ },
+ zai: {
+ logo: "/plugins/_onboarding/webui/assets/provider-logos/zai-logo.svg",
+ setup_url: "https://z.ai/",
+ api_key_url: "https://z.ai/manage-apikey/apikey-list",
+ docs_url: "https://z.ai/manage-apikey/apikey-list",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "GLM models from Z.AI.",
+ },
+ zai_coding: {
+ logo: "/plugins/_onboarding/webui/assets/provider-logos/zai-logo.svg",
+ setup_url: "https://z.ai/",
+ api_key_url: "https://z.ai/manage-apikey/apikey-list",
+ docs_url: "https://z.ai/manage-apikey/apikey-list",
+ api_key_mode: "required",
+ model_list_autoload: true,
+ short_description: "Z.AI coding endpoint.",
+ },
+};
diff --git a/plugins/_onboarding/webui/onboarding-store.js b/plugins/_onboarding/webui/onboarding-store.js
index 8864ffd9e..fe8c3b275 100644
--- a/plugins/_onboarding/webui/onboarding-store.js
+++ b/plugins/_onboarding/webui/onboarding-store.js
@@ -1,119 +1,688 @@
import { createStore } from "/js/AlpineStore.js";
+import { callJsonApi, fetchApi } from "/js/api.js";
import { store as modelConfigStore } from "/plugins/_model_config/webui/model-config-store.js";
import { store as chatsStore } from "/components/sidebar/chats/chats-store.js";
+import {
+ LOCAL_PROVIDER_IDS,
+ MORE_CLOUD_PROVIDER_IDS,
+ ONBOARDING_PROVIDER_OVERRIDES,
+ TOP_CLOUD_PROVIDER_IDS,
+} from "/plugins/_onboarding/webui/onboarding-providers.js";
-const fetchApi = globalThis.fetchApi;
+const MODEL_CONFIG_API = "/plugins/_model_config";
+const OAUTH_STATUS_API = "/plugins/_oauth/status";
+const OAUTH_START_API = "/plugins/_oauth/start_device_login";
+const OAUTH_POLL_API = "/plugins/_oauth/poll_device_login";
+const OAUTH_MODELS_API = "/plugins/_oauth/models";
+const MAX_OAUTH_POLL_MS = 120000;
+
+const TOP_CLOUD_IDS = TOP_CLOUD_PROVIDER_IDS;
+const MORE_CLOUD_IDS = MORE_CLOUD_PROVIDER_IDS;
+
+const FALLBACKS = {
+ codex_oauth: {
+ id: "codex_oauth",
+ name: "ChatGPT/Codex Account",
+ logo: "https://openai.com/favicon.ico",
+ onboarding_category: "account",
+ api_key_mode: "oauth",
+ short_description: "Use your connected ChatGPT or Codex account.",
+ setup_url: "https://chatgpt.com/",
+ docs_url: "https://platform.openai.com/docs/codex",
+ },
+ other: {
+ id: "other",
+ name: "Other OpenAI-compatible",
+ logo: "/public/darkSymbol.svg",
+ api_key_mode: "optional",
+ short_description: "Use a compatible endpoint you control.",
+ },
+};
+
+function clone(value) {
+ return JSON.parse(JSON.stringify(value || {}));
+}
+
+function detailsById(details = []) {
+ const result = {};
+ for (const item of details || []) {
+ const id = String(item?.id || item?.value || "").trim();
+ if (id) result[id] = item;
+ }
+ return result;
+}
+
+function ensureSlot(config, key) {
+ if (!config[key] || typeof config[key] !== "object") config[key] = {};
+ config[key] = {
+ provider: "",
+ name: "",
+ api_base: "",
+ api_key: "",
+ ctx_length: key === "utility_model" ? 128000 : 200000,
+ ctx_history: key === "chat_model" ? 0.7 : undefined,
+ ctx_input: key === "utility_model" ? 0.7 : undefined,
+ vision: key === "chat_model" ? true : undefined,
+ rl_requests: 0,
+ rl_input: 0,
+ rl_output: 0,
+ kwargs: {},
+ ...config[key],
+ };
+}
+
+function normalizeUrl(value) {
+ return String(value || "").trim();
+}
+
+function safeProviderName(provider) {
+ return provider?.name || provider?.label || provider?.id || "Provider";
+}
export const store = createStore("onboarding", {
- step: 1,
- config: null,
- loading: true,
- steps: [
- { step: 1, label: "Main Model" },
- { step: 2, label: "Utility Model" },
- { step: 3, label: "Ready" },
- ],
-
- async init() {
- this.step = 1;
- this.loading = true;
- this.config = null;
- },
-
- async onOpen() {
- await this.init();
- await modelConfigStore.ensureLoaded();
- modelConfigStore.resetApiKeyDrafts();
- await modelConfigStore.refreshApiKeyStatus();
-
- // Fetch current config
- const response = await fetchApi("/plugins", {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({
- action: "get_config",
- plugin_name: "_model_config",
- project_name: "",
- agent_profile: "",
- }),
- });
- const result = await response.json().catch(() => ({}));
- this.config = result.ok ? (result.data || {}) : {};
-
- // Ensure slots exist
- if (!this.config.chat_model) this.config.chat_model = { provider: "", name: "", api_key: "" };
- if (!this.config.utility_model) this.config.utility_model = { provider: "", name: "", api_key: "" };
-
- modelConfigStore.initConfigFields(this.config);
-
- this.loading = false;
- },
-
- cleanup() {
- this.step = 1;
- this.config = null;
- this.loading = true;
- },
-
- prev() {
- if (this.step > 1) {
- this.step--;
- }
- },
+ step: "path",
+ pathChoice: "",
+ loading: true,
+ saving: false,
+ config: null,
+ providerDetails: {},
+ selectedProviderId: "",
+ selectedProviderOrigin: "cloud",
+ moreProviderQuery: "",
+ moreCloudOpen: false,
+ sameAsMain: true,
+ userTouchedModel: {
+ chat_model: false,
+ utility_model: false,
+ },
+ modelDropdown: {
+ chat_model: { models: [], open: false, loading: false, error: "", source: "" },
+ utility_model: { models: [], open: false, loading: false, error: "", source: "" },
+ },
+ oauthStatus: null,
+ oauthLoading: false,
+ oauthConnecting: false,
+ oauthDevice: null,
+ oauthPollTimer: null,
+ oauthPollStartedAt: 0,
+ oauthModels: [],
+
+ steps: [
+ { step: "path", label: "Choose path" },
+ { step: "setup", label: "Connect" },
+ { step: "utility", label: "Utility" },
+ { step: "ready", label: "Ready" },
+ ],
+
+ async init() {
+ this.resetState();
+ },
+
+ resetState() {
+ this.step = "path";
+ this.pathChoice = "";
+ this.loading = true;
+ this.saving = false;
+ this.config = null;
+ this.providerDetails = {};
+ this.selectedProviderId = "";
+ this.selectedProviderOrigin = "cloud";
+ this.moreProviderQuery = "";
+ this.moreCloudOpen = false;
+ this.sameAsMain = true;
+ this.userTouchedModel = { chat_model: false, utility_model: false };
+ this.modelDropdown = {
+ chat_model: { models: [], open: false, loading: false, error: "", source: "" },
+ utility_model: { models: [], open: false, loading: false, error: "", source: "" },
+ };
+ this.oauthStatus = null;
+ this.oauthLoading = false;
+ this.oauthConnecting = false;
+ this.oauthDevice = null;
+ this.oauthModels = [];
+ this.stopOauthPolling();
+ },
+
+ async onOpen() {
+ await this.init();
+ await modelConfigStore.ensureLoaded();
+ modelConfigStore.resetApiKeyDrafts();
+ await modelConfigStore.refreshApiKeyStatus();
+ await this.loadConfig();
+ await this.loadOauthStatus({ silent: true });
+ this.loading = false;
+ },
+
+ cleanup() {
+ this.stopOauthPolling();
+ this.resetState();
+ },
+
+ async loadConfig() {
+ const response = await fetchApi(`${MODEL_CONFIG_API}/model_config_get`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({}),
+ });
+ const data = await response.json().catch(() => ({}));
+ this.config = clone(data.config || {});
+ ensureSlot(this.config, "chat_model");
+ ensureSlot(this.config, "utility_model");
+ ensureSlot(this.config, "embedding_model");
+ modelConfigStore.initConfigFields(this.config);
+ this.providerDetails = detailsById(data.chat_provider_details || modelConfigStore.chatProviderDetails || []);
+ if (this.config.chat_model.provider) {
+ this.selectedProviderId = this.config.chat_model.provider;
+ }
+ },
+
+ providerMeta(id) {
+ const providerId = String(id || "").trim();
+ const fromDetails = this.providerDetails[providerId] || {};
+ const fallback = FALLBACKS[providerId] || {};
+ const override = ONBOARDING_PROVIDER_OVERRIDES[providerId] || {};
+ return {
+ ...fallback,
+ ...fromDetails,
+ ...override,
+ id: providerId,
+ name: override.name || fromDetails.name || fallback.name || providerId,
+ short_description: override.short_description || fromDetails.short_description || fallback.short_description || "Connect this provider to Agent Zero.",
+ logo: override.logo || fromDetails.logo || fallback.logo || "/public/darkSymbol.svg",
+ api_key_mode: override.api_key_mode || fromDetails.api_key_mode || fallback.api_key_mode || "required",
+ };
+ },
+
+ topCloudProviders() {
+ return TOP_CLOUD_IDS.map((id) => this.providerMeta(id));
+ },
+
+ moreCloudProviders() {
+ return MORE_CLOUD_IDS.map((id) => this.providerMeta(id));
+ },
+
+ filteredMoreCloudProviders() {
+ const query = this.moreProviderQuery.trim().toLowerCase();
+ const providers = this.moreCloudProviders();
+ if (!query) return providers;
+ return providers.filter((provider) => {
+ const haystack = `${provider.name} ${provider.short_description} ${provider.id}`.toLowerCase();
+ return haystack.includes(query);
+ });
+ },
+
+ localProviderCards() {
+ return LOCAL_PROVIDER_IDS.map((id) => {
+ const meta = this.providerMeta(id);
+ if (id === "other") {
+ return {
+ ...meta,
+ name: "Other local endpoint",
+ short_description: "Point Agent Zero at a local compatible server.",
+ default_api_base: "",
+ api_key_mode: "optional",
+ };
+ }
+ return meta;
+ });
+ },
+
+ accountMeta() {
+ return this.providerMeta("codex_oauth");
+ },
+
+ accountActionLabel() {
+ return this.oauthConnected() ? "Use connected account" : "Connect via device code";
+ },
+
+ selectedProvider() {
+ return this.providerMeta(this.selectedProviderId || this.config?.chat_model?.provider || "");
+ },
+
+ selectedProviderName() {
+ return safeProviderName(this.selectedProvider());
+ },
+
+ titleText() {
+ if (this.step === "setup") return "Choose your main model";
+ if (this.step === "utility") return "Choose your utility model";
+ if (this.step === "ready") return "Agent Zero is ready";
+ if (this.step === "path") return "Choose how to use AI models in Agent Zero";
+ if (this.step === "cloud") return "Choose your cloud AI provider";
+ if (this.step === "local") {
+ return "Choose your local LLM provider";
+ }
+ return "Choose how to use AI models in Agent Zero";
+ },
+
+ stepNumber(stepName) {
+ const index = this.steps.findIndex((item) => item.step === stepName);
+ return index >= 0 ? index + 1 : 1;
+ },
+
+ currentStepNumber() {
+ if (this.step === "cloud" || this.step === "local") return 1;
+ return this.stepNumber(this.step);
+ },
+
+ isStep(name) {
+ return this.step === name;
+ },
+
+ choosePath(path) {
+ this.pathChoice = path;
+ this.step = path === "local" ? "local" : "cloud";
+ },
+
+ goBack() {
+ if (this.step === "cloud" || this.step === "local") {
+ this.step = "path";
+ return;
+ }
+ if (this.step === "setup") {
+ this.step = this.pathChoice === "local" ? "local" : "cloud";
+ return;
+ }
+ if (this.step === "utility") {
+ this.step = "setup";
+ return;
+ }
+ if (this.step === "ready") {
+ this.step = "utility";
+ }
+ },
+
+ showBackButton() {
+ return !["path", "ready"].includes(this.step);
+ },
+
+ showPrimaryButton() {
+ return ["setup", "utility", "ready"].includes(this.step);
+ },
+
+ primaryButtonLabel() {
+ if (this.step === "setup") return "Choose utility model";
+ if (this.step === "utility") return this.saving ? "Saving" : "Finish setup";
+ if (this.step === "ready") return "Start Chatting";
+ return "Continue";
+ },
+
+ primaryDisabled() {
+ if (this.loading || this.saving) return true;
+ if (this.step === "setup") {
+ if (this.isOAuthProvider() && !this.oauthConnected()) return true;
+ if (this.providerNeedsKey(this.selectedProviderId) && !this.hasProviderKey(this.selectedProviderId)) return true;
+ return !this.config?.chat_model?.provider || !this.config?.chat_model?.name;
+ }
+ if (this.step === "utility") return !this.config?.utility_model?.provider || !this.config?.utility_model?.name;
+ return false;
+ },
+
+ async primaryAction() {
+ if (this.primaryDisabled()) return;
+ if (this.step === "setup") {
+ this.prepareUtilityDefaults();
+ this.step = "utility";
+ await this.loadModels("utility_model");
+ return;
+ }
+ if (this.step === "utility") {
+ await this.completeSetup();
+ return;
+ }
+ if (this.step === "ready") {
+ await this.startChatting();
+ }
+ },
+
+ async selectProvider(providerId, origin = "cloud") {
+ this.selectedProviderId = providerId;
+ this.selectedProviderOrigin = origin;
+ this.pathChoice = origin;
+ const meta = this.providerMeta(providerId);
+ this.applyProviderToSlot("chat_model", providerId, meta, { forceApiBase: origin === "local" });
+ if (providerId === "codex_oauth") {
+ await this.loadOauthStatus({ silent: true });
+ }
+ this.step = "setup";
+ if (meta.model_list_autoload !== false) {
+ await this.loadModels("chat_model", { openDropdown: false });
+ }
+ },
- next() {
- if (this.step < 3) {
- this.step++;
+ async selectCodexAccount() {
+ this.pathChoice = "cloud";
+ await this.selectProvider("codex_oauth", "cloud");
+ },
+
+ applyProviderToSlot(slotKey, providerId, meta, options = {}) {
+ ensureSlot(this.config, slotKey);
+ const slot = this.config[slotKey];
+ const previousProvider = slot.provider;
+ slot.provider = providerId;
+ const defaultApiBase = meta.default_api_base || meta.kwargs?.api_base || "";
+ if (defaultApiBase && (options.forceApiBase || !slot.api_base)) {
+ slot.api_base = defaultApiBase;
+ }
+
+ const defaultModel = slotKey === "utility_model"
+ ? meta.default_utility_model || meta.default_chat_model || ""
+ : meta.default_chat_model || "";
+ if (defaultModel && (!slot.name || !this.userTouchedModel[slotKey])) {
+ slot.name = defaultModel;
+ } else if (previousProvider && previousProvider !== providerId && !this.userTouchedModel[slotKey]) {
+ slot.name = "";
+ }
+
+ if (!slot.kwargs || typeof slot.kwargs !== "object") slot.kwargs = {};
+ },
+
+ localGuidance() {
+ return "";
+ },
+
+ showApiBaseField() {
+ return this.selectedProviderOrigin === "local" || this.selectedProviderId === "other";
+ },
+
+ setupPurpose() {
+ if (this.isOAuthProvider()) return "Connect once, then Agent Zero can use the local Codex/ChatGPT account bridge without an API key.";
+ if (this.selectedProviderOrigin === "local") return "Choose a local model and confirm where Agent Zero can reach it.";
+ return "Choose a model and add the key Agent Zero will use for this provider.";
+ },
+
+ selectedProviderDocsUrl() {
+ const provider = this.selectedProvider();
+ return provider.docs_url || provider.api_key_url || provider.setup_url || "";
+ },
+
+ openSelectedProviderDocs() {
+ const url = this.selectedProviderDocsUrl();
+ if (url) window.open(url, "_blank", "noopener,noreferrer");
+ },
+
+ providerNeedsKey(providerId) {
+ return this.providerMeta(providerId).api_key_mode === "required";
+ },
+
+ providerKeyOptional(providerId) {
+ return this.providerMeta(providerId).api_key_mode === "optional";
+ },
+
+ providerHasNoKey(providerId) {
+ const mode = this.providerMeta(providerId).api_key_mode;
+ return mode === "none" || mode === "oauth";
+ },
+
+ hasProviderKey(providerId) {
+ if (!providerId) return false;
+ if (this.providerHasNoKey(providerId)) return true;
+ const draft = modelConfigStore.apiKeyValues?.[providerId] || "";
+ return Boolean(draft.trim() || modelConfigStore.apiKeyStatus?.[providerId]);
+ },
+
+ isOAuthProvider() {
+ return this.selectedProviderId === "codex_oauth" || this.config?.chat_model?.provider === "codex_oauth";
+ },
+
+ oauthConnected() {
+ return Boolean(this.oauthStatus?.codex?.connected);
+ },
+
+ oauthEmail() {
+ return this.oauthStatus?.codex?.email || this.oauthStatus?.codex?.account_email || this.oauthStatus?.codex?.account_id || "";
+ },
+
+ oauthStatusLabel() {
+ if (this.oauthLoading) return "Checking";
+ return this.oauthConnected() ? "Connected" : "Not connected";
+ },
+
+ async loadOauthStatus({ silent = false } = {}) {
+ if (this.oauthLoading) return;
+ this.oauthLoading = true;
+ try {
+ this.oauthStatus = await callJsonApi(OAUTH_STATUS_API, {});
+ } catch (error) {
+ if (!silent) globalThis.justToast?.("Could not check account connection", "error");
+ } finally {
+ this.oauthLoading = false;
+ }
+ },
+
+ async connectCodex() {
+ if (this.oauthConnecting) return;
+ this.oauthConnecting = true;
+ const popup = window.open("about:blank", "_blank");
+ if (popup) popup.opener = null;
+ try {
+ const response = await callJsonApi(OAUTH_START_API, {});
+ if (!response?.ok || !response.verification_url || !response.attempt_id) {
+ throw new Error(response?.error || "Could not start account connection.");
+ }
+ this.oauthDevice = response;
+ if (popup && !popup.closed) {
+ popup.location.assign(response.verification_url);
+ } else {
+ window.open(response.verification_url, "_blank", "noopener,noreferrer");
+ }
+ this.startOauthPolling();
+ } catch (error) {
+ if (popup && !popup.closed) popup.close();
+ this.oauthConnecting = false;
+ globalThis.justToast?.(error?.message || "Could not connect account", "error");
+ }
+ },
+
+ startOauthPolling() {
+ this.stopOauthPolling();
+ this.oauthPollStartedAt = Date.now();
+ const tick = async () => {
+ if (!this.oauthDevice?.attempt_id) return;
+ try {
+ const response = await callJsonApi(OAUTH_POLL_API, { attempt_id: this.oauthDevice.attempt_id });
+ if (!response?.ok) {
+ if (response?.expired) {
+ this.oauthDevice = null;
+ }
+ throw new Error(response?.error || "Could not finish account connection.");
}
- },
-
- nextButtonLabel() {
- if (this.step === 1) return "Use Main Model";
- if (this.step === 2) return "Use Utility Model";
- return "Next";
- },
-
- providerLabel(modelKey) {
- const provider = this.config?.[modelKey]?.provider || "";
- const providers = modelConfigStore.getProviders(modelKey) || [];
- const match = providers.find((item) => item.value === provider);
- return match?.label || provider || "Provider";
- },
-
- async finish() {
- this.loading = true;
- try {
- // Save model config
- await fetchApi("/plugins", {
- method: "POST",
- headers: { "Content-Type": "application/json" },
- body: JSON.stringify({
- action: "save_config",
- plugin_name: "_model_config",
- project_name: "",
- agent_profile: "",
- settings: this.config,
- }),
- });
-
- // Save API keys
- await modelConfigStore.persistApiKeysForConfig(this.config);
-
- // Open a new chat after finishing
- window.closeModal?.();
- chatsStore.newChat();
- } catch (e) {
- console.error("Failed to finish onboarding", e);
- globalThis.justToast?.("Failed to save settings", "error");
- } finally {
- this.loading = false;
+ if (response.completed) {
+ this.oauthConnecting = false;
+ this.oauthDevice = null;
+ this.stopOauthPolling();
+ await this.loadOauthStatus();
+ this.applyProviderToSlot("chat_model", "codex_oauth", this.providerMeta("codex_oauth"));
+ await this.loadOauthModels();
+ return;
}
- },
-
- async openAdvancedSettings() {
- window.closeModal?.();
- // Dynamic import since we just removed the static import to fix cyclic imports
- const { store: pluginSettingsStore } = await import("/components/plugins/plugin-settings-store.js");
- await pluginSettingsStore.openConfig("_model_config");
+ } catch (error) {
+ this.oauthConnecting = false;
+ this.stopOauthPolling();
+ globalThis.justToast?.(error?.message || "Could not connect account", "error");
+ return;
+ }
+ if (Date.now() - this.oauthPollStartedAt > MAX_OAUTH_POLL_MS) {
+ this.oauthConnecting = false;
+ this.oauthDevice = null;
+ this.stopOauthPolling();
+ }
+ };
+ void tick();
+ const parsedInterval = Number(this.oauthDevice.interval);
+ const intervalSeconds = Number.isFinite(parsedInterval) ? parsedInterval : 5;
+ const delay = Math.max(1500, intervalSeconds * 1000);
+ this.oauthPollTimer = window.setInterval(tick, delay);
+ },
+
+ stopOauthPolling() {
+ if (this.oauthPollTimer) window.clearInterval(this.oauthPollTimer);
+ this.oauthPollTimer = null;
+ },
+
+ async loadOauthModels() {
+ try {
+ const response = await callJsonApi(OAUTH_MODELS_API, {});
+ this.oauthModels = Array.isArray(response?.models) ? response.models : [];
+ if (this.oauthModels.length && !this.userTouchedModel.chat_model) {
+ this.config.chat_model.name = this.oauthModels[0];
+ }
+ this.modelDropdown.chat_model.models = this.oauthModels;
+ this.modelDropdown.chat_model.source = "oauth";
+ } catch {
+ this.oauthModels = [];
+ }
+ },
+
+ cancelOauthConnect() {
+ this.oauthConnecting = false;
+ this.oauthDevice = null;
+ this.stopOauthPolling();
+ },
+
+ async loadModels(slotKey, { openDropdown = true } = {}) {
+ if (!this.config?.[slotKey]?.provider) return;
+ const dropdown = this.modelDropdown[slotKey];
+ dropdown.loading = true;
+ dropdown.error = "";
+ dropdown.source = "";
+ try {
+ const slot = this.config[slotKey];
+ const response = await fetchApi(`${MODEL_CONFIG_API}/model_search`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ provider: slot.provider,
+ model_type: slotKey === "embedding_model" ? "embedding" : "chat",
+ query: "",
+ api_base: slot.api_base || "",
+ }),
+ });
+ const data = await response.json().catch(() => ({}));
+ dropdown.models = Array.isArray(data.models) ? data.models : [];
+ dropdown.source = data.source || "";
+ dropdown.error = data.error || "";
+ dropdown.open = openDropdown && dropdown.models.length > 0;
+ this.selectDefaultModelIfSafe(slotKey);
+ } catch (error) {
+ dropdown.models = [];
+ dropdown.error = error?.message || "Could not load models.";
+ dropdown.open = false;
+ } finally {
+ dropdown.loading = false;
+ }
+ },
+
+ selectDefaultModelIfSafe(slotKey) {
+ const slot = this.config?.[slotKey];
+ if (!slot || this.userTouchedModel[slotKey]) return;
+ const models = this.modelDropdown[slotKey]?.models || [];
+ if (!models.length) return;
+ if (slot.name && models.includes(slot.name)) return;
+ const meta = this.providerMeta(slot.provider);
+ const preferred = slotKey === "utility_model" ? meta.default_utility_model : meta.default_chat_model;
+ if (preferred && models.includes(preferred)) {
+ slot.name = preferred;
+ }
+ },
+
+ filteredModels(slotKey) {
+ const slot = this.config?.[slotKey] || {};
+ const query = String(slot.name || "").trim().toLowerCase();
+ const models = this.modelDropdown[slotKey]?.models || [];
+ if (!query) return models.slice(0, 80);
+ return models.filter((name) => String(name).toLowerCase().includes(query)).slice(0, 80);
+ },
+
+ openModelDropdown(slotKey) {
+ this.modelDropdown[slotKey].open = true;
+ if (!this.modelDropdown[slotKey].models.length && !this.modelDropdown[slotKey].loading) {
+ void this.loadModels(slotKey);
}
+ },
+
+ closeModelDropdown(slotKey) {
+ this.modelDropdown[slotKey].open = false;
+ },
+
+ selectModel(slotKey, modelName) {
+ this.config[slotKey].name = modelName;
+ this.userTouchedModel[slotKey] = true;
+ this.modelDropdown[slotKey].open = false;
+ if (slotKey === "chat_model" && this.sameAsMain) {
+ this.syncUtilityWithMain();
+ }
+ },
+
+ markModelTouched(slotKey) {
+ this.userTouchedModel[slotKey] = true;
+ if (slotKey === "chat_model" && this.sameAsMain) {
+ this.syncUtilityWithMain();
+ }
+ },
+
+ prepareUtilityDefaults() {
+ ensureSlot(this.config, "utility_model");
+ if (this.sameAsMain) {
+ this.syncUtilityWithMain();
+ return;
+ }
+ const mainProvider = this.config.chat_model.provider;
+ const meta = this.providerMeta(mainProvider);
+ this.applyProviderToSlot("utility_model", mainProvider, meta);
+ },
+
+ syncUtilityWithMain() {
+ ensureSlot(this.config, "utility_model");
+ if (!this.sameAsMain || !this.config?.chat_model) return;
+ this.config.utility_model.provider = this.config.chat_model.provider;
+ this.config.utility_model.name = this.config.chat_model.name;
+ this.config.utility_model.api_base = this.config.chat_model.api_base || "";
+ this.config.utility_model.kwargs = clone(this.config.chat_model.kwargs || {});
+ },
+
+ async utilityProviderChanged() {
+ const providerId = this.config.utility_model.provider;
+ this.sameAsMain = providerId === this.config.chat_model.provider;
+ this.userTouchedModel.utility_model = false;
+ this.applyProviderToSlot("utility_model", providerId, this.providerMeta(providerId));
+ await this.loadModels("utility_model");
+ },
+
+ async completeSetup() {
+ this.saving = true;
+ try {
+ if (this.sameAsMain) this.syncUtilityWithMain();
+ await modelConfigStore.persistApiKeysForConfig(this.config);
+ const response = await fetchApi(`${MODEL_CONFIG_API}/model_config_set`, {
+ method: "POST",
+ headers: { "Content-Type": "application/json" },
+ body: JSON.stringify({
+ project_name: "",
+ agent_profile: "",
+ config: this.config,
+ }),
+ });
+ const data = await response.json().catch(() => ({}));
+ if (!data?.ok) throw new Error(data?.error || "Could not save model setup.");
+ await modelConfigStore.refreshApiKeyStatus();
+ this.step = "ready";
+ document.dispatchEvent(new CustomEvent("onboarding-configured"));
+ } catch (error) {
+ globalThis.justToast?.(error?.message || "Could not save setup", "error");
+ } finally {
+ this.saving = false;
+ }
+ },
+
+ async startChatting() {
+ window.closeModal?.();
+ await chatsStore.newChat();
+ },
+
+ async openAdvancedSettings() {
+ window.closeModal?.();
+ const { store: pluginSettingsStore } = await import("/components/plugins/plugin-settings-store.js");
+ await pluginSettingsStore.openConfig("_model_config");
+ },
});
diff --git a/plugins/_onboarding/webui/onboarding.html b/plugins/_onboarding/webui/onboarding.html
index 8b9e894c5..dbe81866b 100644
--- a/plugins/_onboarding/webui/onboarding.html
+++ b/plugins/_onboarding/webui/onboarding.html
@@ -6,165 +6,303 @@
</script>
<style>
.modal-inner.onboarding-modal {
- width: min(92vw, 980px);
- }
- .modal-inner.onboarding-modal .modal-scroll {
- padding: 0;
- }
- .modal-inner.onboarding-modal .modal-bd.onboarding-body {
- padding: 24px 32px 28px;
+ width: min(94vw, 1120px);
+ --onboard-ink: var(--text-1, var(--color-text));
+ --onboard-muted: var(--text-2, color-mix(in srgb, var(--color-text) 70%, transparent));
+ --onboard-soft: color-mix(in srgb, var(--color-panel) 72%, transparent);
+ --onboard-line: color-mix(in srgb, var(--color-border) 72%, transparent);
+ }
+ .modal-inner.onboarding-modal .modal-scroll { padding: 0; }
+ .modal-inner.onboarding-modal .modal-bd.onboarding-body { padding: 0; }
+ .onboarding-shell {
+ position: relative;
+ overflow: hidden;
+ padding: 24px 30px 28px;
+ background: var(--color-panel, #151515);
}
- .onboarding-logo {
- text-align: center;
+ .onboarding-content { position: relative; z-index: 1; }
+ .onboarding-header {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 18px;
margin-bottom: 18px;
}
- .onboarding-logo img {
- width: 200px;
- max-width: 100%;
- height: auto;
+ .onboarding-brand {
+ display: flex;
+ align-items: center;
+ gap: 12px;
+ min-width: 0;
}
- .onboarding-welcome-text {
- text-align: center;
- max-width: 78ch;
- margin: var(--spacing-md) auto var(--spacing-lg);
- color: var(--text-2);
- font-size: 1.02rem;
- line-height: 1.5;
- }
- .onboarding-welcome-title {
- color: var(--text-1);
- font-size: 1.42rem;
+ .onboarding-logo {
+ width: 38px;
+ height: 38px;
+ flex: 0 0 auto;
+ background: var(--onboard-ink);
+ opacity: 0.82;
+ -webkit-mask: url("/public/darkSymbol.svg") center / contain no-repeat;
+ mask: url("/public/darkSymbol.svg") center / contain no-repeat;
+ }
+ .onboarding-title {
+ margin: 0;
+ color: var(--onboard-ink);
+ font-size: clamp(1.18rem, 2.4vw, 1.7rem);
+ line-height: 1.14;
font-weight: 800;
- margin-bottom: 12px;
+ letter-spacing: -0.015em;
}
.onboarding-progress {
- display: grid;
- grid-template-columns: repeat(3, minmax(0, 1fr));
- gap: 6px;
- margin: 0 0 24px;
- padding: 7px;
- border: 1px solid color-mix(in srgb, var(--color-border) 64%, transparent);
- border-radius: 8px;
- background: color-mix(in srgb, var(--color-panel) 42%, transparent);
- }
- .onboarding-progress-step {
display: flex;
align-items: center;
+ justify-content: flex-end;
gap: 8px;
- min-width: 0;
- min-height: 36px;
- padding: 0 10px;
- border: 1px solid transparent;
- border-radius: 7px;
- color: var(--color-text);
- opacity: 0.64;
- font-size: 0.84rem;
- font-weight: 700;
- }
- .onboarding-progress-step.active {
- opacity: 1;
- border-color: color-mix(in srgb, var(--color-primary) 32%, var(--color-border));
- background: color-mix(in srgb, var(--color-background-hover) 58%, transparent);
- }
- .onboarding-progress-step.done {
- opacity: 0.88;
+ min-width: 92px;
}
.onboarding-progress-dot {
- display: grid;
- place-items: center;
- width: 20px;
- height: 20px;
+ width: 8px;
+ height: 8px;
border-radius: 999px;
- background: color-mix(in srgb, var(--color-border) 70%, transparent);
- color: var(--color-background);
- font-size: 0.72rem;
- font-weight: 900;
- flex: 0 0 auto;
+ background: color-mix(in srgb, var(--color-border) 78%, transparent);
+ opacity: 0.62;
}
- .onboarding-progress-step.active .onboarding-progress-dot {
- background: var(--color-primary);
+ .onboarding-progress-dot.active {
+ width: 22px;
+ background: var(--color-primary, var(--color-accent, #2f81f7));
+ opacity: 1;
}
- .onboarding-progress-step.done .onboarding-progress-dot {
- background: #63c98b;
+ .onboarding-lede {
+ max-width: 760px;
+ margin: 0 auto 22px;
+ color: var(--onboard-muted);
+ text-align: center;
+ font-size: 1rem;
+ line-height: 1.55;
}
- .onboarding-progress-check {
- font-size: 14px;
- line-height: 1;
+ .onboarding-panel {
+ border: 1px solid var(--onboard-line);
+ border-radius: 18px;
+ background: color-mix(in srgb, var(--color-panel) 78%, transparent);
+ box-shadow: 0 18px 55px rgba(0, 0, 0, 0.22);
+ padding: 18px;
}
- .onboarding-progress-label {
- min-width: 0;
+ .path-grid {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 16px;
+ }
+ .path-card {
+ position: relative;
+ aspect-ratio: 21 / 9;
+ min-height: 0;
overflow: hidden;
- text-overflow: ellipsis;
- white-space: nowrap;
+ border: 1px solid color-mix(in srgb, var(--onboard-line) 78%, transparent);
+ border-radius: 18px;
+ background: var(--onboard-soft);
+ text-align: left;
+ cursor: pointer;
+ padding: 0;
+ color: var(--onboard-ink);
+ font-family: "Rubik", var(--font-family, sans-serif);
+ transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
- .onboarding-success {
- text-align: center;
- padding: var(--spacing-md) 0;
+ .path-card:hover, .path-card:focus-visible {
+ border-color: var(--color-border);
+ box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
+ outline: none;
}
- .onboarding-success-icon {
- font-size: 64px;
- color: var(--success, #22c55e);
- margin-bottom: 24px;
+ .path-card img {
+ position: absolute;
+ inset: 0;
+ width: 100%;
+ height: 100%;
+ object-fit: cover;
+ object-position: center;
+ opacity: 0.92;
+ }
+ .path-card::after {
+ content: "";
+ position: absolute;
+ inset: 0;
+ background: linear-gradient(180deg, rgba(0,0,0,0.06), rgba(0,0,0,0.58));
}
- .onboarding-success-text {
- margin-bottom: 0;
+ .path-card-copy {
+ position: absolute;
+ left: 20px;
+ right: 20px;
+ bottom: 18px;
+ z-index: 1;
+ color: #f8f4ec;
+ text-shadow: 0 1px 18px rgba(0,0,0,0.45);
}
- .onboarding-advanced-link {
- text-align: center;
- margin-top: 32px;
- padding-top: 16px;
- border-top: 1px solid var(--surface-3);
+ .path-card-title {
+ display: block;
+ font-size: clamp(1.18rem, 2.4vw, 1.65rem);
+ font-weight: 700;
+ letter-spacing: -0.02em;
+ margin-bottom: 5px;
}
- .onboarding-advanced-link a {
- color: var(--text-3);
- text-decoration: none;
- font-size: 0.9rem;
- display: inline-flex;
+ .path-card-text { display: block; max-width: 38ch; line-height: 1.45; }
+ .account-strip {
+ display: flex;
align-items: center;
- gap: 4px;
+ justify-content: space-between;
+ gap: 14px;
+ margin-top: 16px;
+ padding: 14px;
+ border: 1px solid var(--onboard-line);
+ border-radius: 14px;
+ background: color-mix(in srgb, var(--color-background) 45%, transparent);
+ }
+ .account-strip-main { display: flex; align-items: center; gap: 12px; min-width: 0; }
+ .provider-logo, .account-strip img {
+ width: 34px;
+ height: 34px;
+ object-fit: contain;
+ border-radius: 8px;
+ background: rgba(255,255,255,0.06);
}
- .onboarding-advanced-link a:hover {
- color: var(--text-1);
+ .provider-initial {
+ width: 34px;
+ height: 34px;
+ display: grid;
+ place-items: center;
+ border-radius: 9px;
+ background: color-mix(in srgb, #d9ad68 24%, var(--color-panel));
+ color: var(--onboard-ink);
+ font-weight: 900;
}
- .onboarding-advanced-link-icon {
- font-size: 16px;
+ .account-title { color: var(--onboard-ink); font-weight: 760; }
+ .section-title { color: var(--onboard-ink); font-weight: 900; }
+ .setup-hero .section-title { font-weight: 720; }
+ .account-subtitle, .section-description { color: var(--onboard-muted); line-height: 1.45; }
+ .provider-grid {
+ display: grid;
+ grid-template-columns: repeat(5, minmax(0, 1fr));
+ gap: 10px;
+ }
+ .provider-card, .local-card {
+ min-height: 86px;
+ padding: 13px;
+ border: 1px solid var(--onboard-line);
+ border-radius: 15px;
+ background: color-mix(in srgb, var(--color-panel) 68%, transparent);
+ color: var(--onboard-ink);
+ text-align: left;
+ cursor: pointer;
+ display: flex;
+ align-items: center;
+ transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}
- /* Scoped overrides to make the fields look nice here */
- .onboarding-body .model-section {
- padding: 16px;
- background: color-mix(in srgb, var(--color-panel) 58%, transparent);
- border-radius: 8px;
- border: 1px solid color-mix(in srgb, var(--color-border) 64%, transparent);
+ .provider-card:hover, .provider-card:focus-visible, .local-card:hover, .local-card:focus-visible { border-color: var(--color-border);
+ background: color-mix(in srgb, var(--color-background-hover) 62%, var(--color-panel));
+ outline: none;
}
- .onboarding-body .section-title { margin-bottom: 8px; }
- .onboarding-body .section-description { margin-bottom: 24px; }
- .onboarding-body .model-section .field:last-child {
+ .provider-card-top {
+ display: flex;
+ align-items: center;
+ gap: 10px;
margin-bottom: 0;
}
- .onboarding-body .loading-container { height: 200px; }
- .onboarding-body .input-with-icon { padding-right: 32px; }
- .onboarding-body .relative-container { position: relative; }
- .onboarding-footer-left { flex: 1; display: flex; gap: 8px; }
- .onboarding-footer-right { display: flex; gap: 8px; }
- .onboarding-icon-right { font-size: 18px; margin-left: 4px; }
- .onboarding-banner-btn-container { margin-top: 12px; }
-
- /* Same as plugins/_model_config/webui/config.html: icons sit inside padded inputs */
- .onboarding-body .eye-toggle {
- position: absolute;
- right: 8px;
- top: 50%;
- transform: translateY(-50%);
- font-size: 18px;
+ .provider-name { font-weight: 900; line-height: 1.18; }
+ .more-providers {
+ margin: 10px 0 14px;
+ padding: 0;
+ overflow: hidden;
+ border: 0;
+ background: transparent;
+ box-shadow: none;
+ }
+ .more-provider-toggle {
+ width: 100%;
+ min-height: 44px;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ border: 0;
+ background: transparent;
+ color: var(--onboard-ink);
cursor: pointer;
- user-select: none;
- opacity: 0.6;
- z-index: 1;
+ font-weight: 900;
}
- .onboarding-body .eye-toggle:hover {
- opacity: 1;
+ .more-provider-toggle .material-symbols-outlined {
+ transition: transform 0.18s ease;
}
- .onboarding-body .model-search-btn {
+ .more-provider-toggle.open .material-symbols-outlined {
+ transform: rotate(180deg);
+ }
+ .more-provider-list {
+ display: grid;
+ grid-template-columns: repeat(5, minmax(0, 1fr));
+ gap: 10px;
+ padding: 0;
+ margin-top: 8px;
+ }
+ .local-grid {
+ display: grid;
+ grid-template-columns: repeat(3, minmax(0, 1fr));
+ gap: 12px;
+ }
+ .setup-layout {
+ display: grid;
+ grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
+ gap: 16px;
+ }
+ .setup-hero {
+ padding: 18px;
+ border: 1px solid var(--onboard-line);
+ border-radius: 16px;
+ background: color-mix(in srgb, var(--color-background) 44%, transparent);
+ }
+ .setup-hero-logo { width: 58px; height: 58px; object-fit: contain; border-radius: 12px; margin-bottom: 12px; }
+ .setup-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
+ .setup-form-panel {
+ padding: 4px 0;
+ border: 0;
+ border-radius: 0;
+ background: transparent;
+ box-shadow: none;
+ }
+ .field-stack { display: grid; gap: 14px; }
+ .field label, .model-label {
+ display: block;
+ color: var(--onboard-ink);
+ font-weight: 850;
+ margin-bottom: 6px;
+ }
+ .field-help { color: var(--onboard-muted); font-size: 0.88rem; line-height: 1.4; margin-top: 6px; }
+ .relative-field { position: relative; }
+ .model-input-row {
+ width: 100%;
+ display: grid;
+ grid-template-columns: minmax(0, 1fr);
+ gap: 0;
+ align-items: center;
+ position: relative;
+ }
+ .main-model-field {
+ display: grid;
+ grid-template-columns: minmax(110px, 0.32fr) minmax(360px, 1fr);
+ column-gap: 16px;
+ align-items: center;
+ }
+ .wide-inline-field {
+ display: grid;
+ grid-template-columns: minmax(110px, 0.32fr) minmax(360px, 1fr);
+ column-gap: 16px;
+ align-items: center;
+ }
+ .wide-inline-field label { margin-bottom: 0; }
+ .wide-inline-field .field-help { grid-column: 2; margin-top: 0; }
+ .main-model-field .model-label { margin-bottom: 0; }
+ .main-model-field .field-help { grid-column: 2; margin-top: 0; }
+ .main-model-field .model-dropdown { grid-column: auto; }
+ .model-input-row input {
+ width: 100%;
+ box-sizing: border-box;
+ padding-right: 32px;
+ }
+ .model-refresh-button {
position: absolute;
right: 8px;
top: 50%;
@@ -173,327 +311,518 @@
height: 20px;
display: grid;
place-items: center;
+ border: 0;
+ border-radius: 0;
+ background: transparent;
+ color: var(--onboard-ink);
cursor: pointer;
- user-select: none;
opacity: 0.6;
+ padding: 0;
+ user-select: none;
z-index: 1;
}
- .onboarding-body .model-search-btn:hover {
+ .model-refresh-button:hover, .model-refresh-button:focus-visible {
+ outline: none;
+ background: transparent;
opacity: 1;
}
- .onboarding-body .model-search-btn > span {
- grid-area: 1 / 1;
- font-size: 18px;
- transition: opacity 0.15s;
- }
- .onboarding-body .model-search-spinner {
- animation: onboarding-model-search-spin 0.8s linear infinite;
- }
- @keyframes onboarding-model-search-spin {
- from { transform: rotate(0deg); }
- to { transform: rotate(360deg); }
- }
- .onboarding-body .model-search-results {
+ .model-refresh-button .material-symbols-outlined { font-size: 18px; }
+ .model-dropdown {
position: absolute;
- top: calc(100% + 4px);
+ z-index: 40;
left: 0;
right: 0;
+ top: calc(100% + 4px);
max-height: 200px;
- overflow-y: auto;
- background: var(--color-input);
- border: 1px solid var(--color-border);
- border-radius: 6px;
- box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
- z-index: 50;
+ overflow: auto;
padding: 4px;
+ border: 1px solid var(--onboard-line);
+ border-radius: 6px;
+ background: var(--color-input, var(--color-panel));
+ box-shadow: 0 4px 12px rgba(0,0,0,0.3);
+ width: 100%;
+ min-width: 100%;
+ box-sizing: border-box;
+ }
+ .model-item {
+ width: 100%;
+ display: block;
+ padding: 7px 9px;
+ border: 0;
+ border-radius: 8px;
+ background: transparent;
+ color: var(--onboard-ink);
+ text-align: left;
+ cursor: pointer;
+ word-break: break-word;
+ }
+ .model-item:hover, .model-item:focus-visible { background: var(--color-background-hover, rgba(255,255,255,0.08)); outline: none; }
+ .model-inline-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
+ .soft-note {
+ padding: 11px 12px;
+ border: 1px solid color-mix(in srgb, var(--onboard-line) 72%, transparent);
+ border-radius: 12px;
+ color: var(--onboard-muted);
+ background: color-mix(in srgb, var(--color-background) 38%, transparent);
+ line-height: 1.45;
+ }
+ .advanced-box {
+ margin-top: 14px;
+ border: 1px solid var(--onboard-line);
+ border-radius: 12px;
+ padding: 10px 12px;
+ background: color-mix(in srgb, var(--color-panel) 55%, transparent);
+ }
+ .advanced-box summary { cursor: pointer; color: var(--onboard-ink); font-weight: 850; }
+ .ready-state { text-align: center; padding: 32px 12px 12px; }
+ .ready-mark {
+ width: 78px;
+ height: 78px;
+ display: grid;
+ place-items: center;
+ margin: 0 auto 18px;
+ border-radius: 24px;
+ background: linear-gradient(135deg, color-mix(in srgb, #76b39d 42%, transparent), color-mix(in srgb, #d9ad68 34%, transparent));
+ color: var(--onboard-ink);
+ }
+ .ready-mark .material-symbols-outlined { font-size: 42px; }
+ .onboarding-advanced-link {
+ text-align: center;
+ margin-top: 18px;
}
- .onboarding-body .model-search-item {
- padding: 5px 8px;
- font-size: 0.8rem;
- border-radius: 4px;
+ .advanced-settings-toggle {
+ min-height: 42px;
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 8px;
+ border: 0;
+ background: transparent;
+ color: var(--onboard-ink);
cursor: pointer;
- word-break: break-all;
+ font-weight: 900;
}
- .onboarding-body .model-search-item:hover {
- background: var(--color-background-hover, rgba(255,255,255,0.06));
+ .advanced-settings-toggle:hover, .advanced-settings-toggle:focus-visible {
+ outline: none;
+ text-decoration: none;
}
- .onboarding-body .model-search-item.disabled {
- opacity: 0.4;
- cursor: default;
- font-style: italic;
+ .utility-panel {
+ border: 0;
+ border-radius: 0;
+ background: transparent;
+ box-shadow: none;
+ padding: 0;
}
- .onboarding-body .model-search-item.matched {
- font-weight: 500;
+ .onboarding-footer-left { flex: 1; display: flex; gap: 8px; align-items: center; }
+ .onboarding-footer-right { display: flex; gap: 8px; align-items: center; }
+ .loading-container { min-height: 360px; display: grid; place-items: center; }
+ .oauth-connect-panel {
+ display: grid;
+ gap: 12px;
+ padding: 14px;
+ border: 1px solid color-mix(in srgb, var(--onboard-line) 82%, transparent);
+ border-radius: 14px;
+ background: color-mix(in srgb, var(--color-background) 42%, transparent);
}
- .onboarding-body .model-search-separator {
- height: 1px;
- margin: 4px 8px;
- background: var(--color-border);
- opacity: 0.5;
+ .oauth-connect-main {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 12px;
}
- .onboarding-body .model-search-item.disabled:hover {
- background: transparent;
+ .oauth-status-group {
+ min-width: 0;
+ display: flex;
+ align-items: center;
+ gap: 11px;
+ }
+ .oauth-status-mark {
+ width: 36px;
+ height: 36px;
+ flex: 0 0 auto;
+ display: grid;
+ place-items: center;
+ border: 1px solid var(--onboard-line);
+ border-radius: 10px;
+ color: var(--onboard-muted);
+ background: color-mix(in srgb, var(--color-panel) 72%, transparent);
+ }
+ .oauth-status-mark.connected {
+ color: #8fd8a8;
+ border-color: color-mix(in srgb, #8fd8a8 52%, var(--onboard-line));
+ background: color-mix(in srgb, #8fd8a8 14%, var(--color-panel));
+ }
+ .oauth-status-mark .material-symbols-outlined { font-size: 22px; }
+ .oauth-status-copy {
+ min-width: 0;
+ display: grid;
+ gap: 2px;
+ }
+ .oauth-status-label {
+ color: var(--onboard-ink);
+ font-weight: 850;
+ line-height: 1.2;
+ }
+ .oauth-status-detail {
+ color: var(--onboard-muted);
+ font-size: 0.86rem;
+ line-height: 1.35;
+ overflow-wrap: anywhere;
+ }
+ .oauth-connect-actions {
+ flex: 0 0 auto;
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ }
+ .oauth-device-note {
+ display: flex;
+ align-items: center;
+ gap: 8px;
+ padding: 10px 11px;
+ border: 1px solid color-mix(in srgb, #d9ad68 36%, var(--onboard-line));
+ border-radius: 10px;
+ color: var(--onboard-ink);
+ background: color-mix(in srgb, #d9ad68 12%, var(--color-background));
+ line-height: 1.4;
+ }
+ .oauth-device-note .material-symbols-outlined { font-size: 19px; color: #d9ad68; }
+ .status-pill {
+ display: inline-flex;
+ align-items: center;
+ gap: 6px;
+ border: 1px solid var(--onboard-line);
+ border-radius: 999px;
+ padding: 5px 9px;
+ color: var(--onboard-muted);
+ font-size: 0.78rem;
+ font-weight: 850;
+ }
+ .status-pill.connected { color: #8fd8a8; border-color: color-mix(in srgb, #8fd8a8 44%, var(--onboard-line)); }
+ @media (max-width: 980px) {
+ .provider-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
+ .more-provider-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
+ .setup-layout { grid-template-columns: 1fr; }
+ }
+ @media (max-width: 760px) {
+ .onboarding-shell { padding: 18px 14px 22px; }
+ .onboarding-header { align-items: flex-start; flex-direction: column; }
+ .onboarding-progress { justify-content: flex-start; }
+ .path-grid, .local-grid { grid-template-columns: 1fr; }
+ .provider-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+ .more-provider-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
+ .path-card { aspect-ratio: 21 / 10; }
+ .account-strip { align-items: flex-start; flex-direction: column; }
+ .oauth-connect-main { align-items: stretch; flex-direction: column; }
+ .oauth-connect-actions { justify-content: flex-start; }
+ }
+ @media (max-width: 480px) {
+ .provider-grid { grid-template-columns: 1fr; }
+ .more-provider-list { grid-template-columns: 1fr; }
+ .provider-card, .local-card { min-height: auto; }
+ }
+
+ .more-providers.onboarding-panel {
+ border: 0 !important;
+ background: transparent !important;
+ box-shadow: none !important;
}
- @media (max-width: 720px) {
- .modal-inner.onboarding-modal .modal-bd.onboarding-body {
- padding: 18px 16px 22px;
- }
- .onboarding-progress {
- grid-template-columns: 1fr;
- }
- .onboarding-welcome-text {
- font-size: 0.96rem;
- }
- }
- </style>
-</head>
+ .more-provider-toggle,
+ .more-provider-toggle.open {
+ border: 0 !important;
+ border-top: 0 !important;
+ border-bottom: 0 !important;
+ box-shadow: none !important;
+ background: transparent !important;
+ }
+
+ .more-provider-toggle:focus,
+ .more-provider-toggle:focus-visible,
+ .more-provider-toggle.open:focus,
+ .more-provider-toggle.open:focus-visible {
+ outline: none !important;
+ text-decoration: underline;
+ text-decoration-thickness: 1px;
+ text-underline-offset: 5px;
+ text-decoration-color: color-mix(in srgb, #d9ad68 62%, transparent);
+ }
+
+ .more-provider-toggle,
+ .more-provider-toggle:focus,
+ .more-provider-toggle:focus-visible,
+ .more-provider-toggle.open:focus,
+ .more-provider-toggle.open:focus-visible {
+ text-decoration: none !important;
+ }
+</style>
+</head>
<body>
<div x-data>
<template x-if="$store.onboarding">
- <div x-init="$store.onboarding.onOpen()" x-destroy="$store.onboarding.cleanup()">
-
- <div class="modal-header">
- <div class="onboarding-logo">
- <img src="/public/a0-fullDark.svg" alt="Agent Zero">
+ <div x-init="$store.onboarding.onOpen()" x-destroy="$store.onboarding.cleanup()" class="onboarding-shell">
+ <div class="onboarding-content">
+ <div class="onboarding-header">
+ <div class="onboarding-brand">
+ <span class="onboarding-logo" role="img" aria-label="Agent Zero"></span>
+ <div>
+ <h1 class="onboarding-title" x-text="$store.onboarding.titleText()"></h1>
+ </div>
+ </div>
+ <nav class="onboarding-progress" aria-label="Onboarding progress">
+ <template x-for="item in $store.onboarding.steps" :key="item.step">
+ <span class="onboarding-progress-dot"
+ :class="{ active: $store.onboarding.currentStepNumber() === $store.onboarding.stepNumber(item.step) }"
+ :aria-label="item.label"
+ :aria-current="$store.onboarding.currentStepNumber() === $store.onboarding.stepNumber(item.step) ? 'step' : null"></span>
+ </template>
+ </nav>
</div>
- </div>
- <div class="modal-scroll">
- <div class="modal-bd onboarding-body">
-
- <div x-show="$store.onboarding.loading" class="loading loading-container"></div>
+ <div x-show="$store.onboarding.loading" class="loading loading-container">Loading...</div>
- <template x-if="!$store.onboarding.loading && $store.onboarding.config">
- <div>
- <nav class="onboarding-progress" aria-label="Onboarding progress">
- <template x-for="item in $store.onboarding.steps" :key="item.step">
- <div class="onboarding-progress-step"
- :class="{ active: $store.onboarding.step === item.step, done: $store.onboarding.step > item.step }"
- :aria-current="$store.onboarding.step === item.step ? 'step' : null">
- <span class="onboarding-progress-dot">
- <span x-show="$store.onboarding.step <= item.step" x-text="item.step"></span>
- <span class="material-symbols-outlined onboarding-progress-check" x-show="$store.onboarding.step > item.step">check</span>
+ <template x-if="!$store.onboarding.loading && $store.onboarding.config">
+ <div>
+ <section x-show="$store.onboarding.isStep('path')" x-transition.opacity>
+ <div class="path-grid">
+ <button type="button" class="path-card" @click="$store.onboarding.choosePath('cloud')" aria-label="Choose Cloud provider setup">
+ <img src="/plugins/_onboarding/webui/assets/cloud-card.webp" alt="">
+ <span class="path-card-copy">
+ <span class="path-card-title">Cloud</span>
+ <span class="path-card-text">Use an online provider with an API key or account connection.</span>
+ </span>
+ </button>
+ <button type="button" class="path-card" @click="$store.onboarding.choosePath('local')" aria-label="Choose Local model setup">
+ <img src="/plugins/_onboarding/webui/assets/local-card.webp" alt="">
+ <span class="path-card-copy">
+ <span class="path-card-title">Local</span>
+ <span class="path-card-text">Use a local LLM running on your own machine, with more control over where requests go.</span>
+ </span>
+ </button>
+ </div>
+ </section>
+
+ <section x-show="$store.onboarding.isStep('cloud')" x-transition.opacity>
+ <div class="provider-grid" aria-label="Cloud providers">
+ <template x-for="provider in $store.onboarding.topCloudProviders()" :key="provider.id">
+ <button type="button" class="provider-card" @click="$store.onboarding.selectProvider(provider.id, 'cloud')">
+ <span class="provider-card-top">
+ <img class="provider-logo" :src="provider.logo" :alt="provider.name + ' logo'" @error="$el.style.display='none'">
+ <span class="provider-name" x-text="provider.name"></span>
</span>
- <span class="onboarding-progress-label" x-text="item.label"></span>
+ </button>
+ </template>
+ </div>
+ <div class="account-strip">
+ <div class="account-strip-main">
+ <img :src="$store.onboarding.accountMeta().logo" alt="OpenAI logo">
+ <div>
+ <div class="account-title">Connect ChatGPT/Codex Account</div>
+ <div class="account-subtitle" x-text="$store.onboarding.oauthStatusLabel()"></div>
</div>
+ </div>
+ <button type="button" class="btn btn-secondary" @click="$store.onboarding.selectCodexAccount()" x-text="$store.onboarding.accountActionLabel()"></button>
+ </div>
+ <div class="more-providers onboarding-panel">
+ <button type="button"
+ class="more-provider-toggle"
+ :class="{ open: $store.onboarding.moreCloudOpen }"
+ @click="$store.onboarding.moreCloudOpen = !$store.onboarding.moreCloudOpen"
+ :aria-expanded="$store.onboarding.moreCloudOpen ? 'true' : 'false'">
+ <span>Click here if you don't see your provider</span>
+ <span class="material-symbols-outlined">keyboard_arrow_down</span>
+ </button>
+ <div class="more-provider-list" x-show="$store.onboarding.moreCloudOpen" x-transition.opacity>
+ <template x-for="provider in $store.onboarding.moreCloudProviders()" :key="provider.id">
+ <button type="button" class="provider-card" @click="$store.onboarding.selectProvider(provider.id, 'cloud')">
+ <span class="provider-card-top">
+ <img class="provider-logo" :src="provider.logo" :alt="provider.name + ' logo'" @error="$el.style.display='none'">
+ <span class="provider-name" x-text="provider.name"></span>
+ </span>
+ </button>
+ </template>
+ </div>
+ </div>
+ </section>
+
+ <section x-show="$store.onboarding.isStep('local')" x-transition.opacity>
+ <div class="local-grid">
+ <template x-for="provider in $store.onboarding.localProviderCards()" :key="provider.id + provider.name">
+ <button type="button" class="local-card" @click="$store.onboarding.selectProvider(provider.id, 'local')">
+ <span class="provider-card-top">
+ <img class="provider-logo" :src="provider.logo" :alt="provider.name + ' logo'" @error="$el.style.display='none'">
+ <span class="provider-name" x-text="provider.name"></span>
+ </span>
+ </button>
</template>
- </nav>
+ </div>
+ </section>
- <!-- Step 1: Main Model -->
- <div x-show="$store.onboarding.step === 1">
- <div class="onboarding-welcome-text">
- <div class="onboarding-welcome-title">Welcome to Agent Zero</div>
- First, choose the model Agent Zero will think with. The <b>Main Model</b> handles conversation, tool calls, skills, and browser work.
+ <section x-show="$store.onboarding.isStep('setup')" x-transition.opacity>
+ <div class="setup-layout">
+ <div class="setup-hero">
+ <img class="setup-hero-logo" :src="$store.onboarding.selectedProvider().logo" :alt="$store.onboarding.selectedProviderName() + ' logo'" @error="$el.style.display='none'">
+ <h2 class="section-title" x-text="$store.onboarding.selectedProviderName()"></h2>
+ <p class="section-description" x-text="$store.onboarding.setupPurpose()"></p>
+ <div class="setup-actions">
+ <button type="button"
+ class="btn btn-secondary"
+ x-show="$store.onboarding.selectedProviderDocsUrl()"
+ @click="$store.onboarding.openSelectedProviderDocs()"
+ x-text="$store.onboarding.selectedProviderName() + ' Docs'"></button>
+ </div>
</div>
-
- <div class="model-section">
- <div class="section-title" x-text="$store.modelConfig.MODEL_SECTIONS[0].title"></div>
- <div class="section-description">Choose a capable general model for conversation, reasoning, tools, skills, and browser automation.</div>
-
- <!-- Provider -->
- <div class="field">
- <div class="field-label">
- <div class="field-title">Provider</div>
- <div class="field-description">Where Agent Zero will send Main Model requests.</div>
- </div>
- <div class="field-control">
- <select x-model="$store.onboarding.config.chat_model.provider"
- x-effect="$nextTick(() => { if ($store.modelConfig.getProviders('chat_model').length) $el.value = $store.onboarding.config.chat_model.provider })">
- <template x-for="p in $store.modelConfig.getProviders('chat_model')" :key="p.value">
- <option :value="p.value" x-text="p.label"></option>
+ <div class="setup-form-panel field-stack">
+ <div class="field relative-field main-model-field" @click.outside="$store.onboarding.closeModelDropdown('chat_model')">
+ <label class="model-label" for="main-model-input">Main model</label>
+ <div class="model-input-row">
+ <input id="main-model-input"
+ type="text"
+ x-model="$store.onboarding.config.chat_model.name"
+ @input="$store.onboarding.markModelTouched('chat_model')"
+ @focus="$store.onboarding.openModelDropdown('chat_model')"
+ placeholder="Search or enter a model">
+ <button type="button"
+ class="model-refresh-button"
+ aria-label="Refresh model list"
+ title="Refresh model list"
+ @click="$store.onboarding.loadModels('chat_model')"
+ :disabled="$store.onboarding.modelDropdown.chat_model.loading">
+ <span class="material-symbols-outlined" x-text="$store.onboarding.modelDropdown.chat_model.loading ? 'progress_activity' : 'search'"></span>
+ </button>
+ <div class="model-dropdown" x-show="$store.onboarding.modelDropdown.chat_model.open && !$store.onboarding.modelDropdown.chat_model.loading" x-transition.opacity>
+ <template x-for="model in $store.onboarding.filteredModels('chat_model')" :key="model">
+ <button type="button" class="model-item" @click="$store.onboarding.selectModel('chat_model', model)" x-text="model"></button>
</template>
- </select>
+ <div class="model-item" x-show="$store.onboarding.filteredModels('chat_model').length === 0">No models found. You can still type the model name manually.</div>
+ </div>
</div>
+ <div class="field-help" x-show="$store.onboarding.modelDropdown.chat_model.error && !$store.onboarding.modelDropdown.chat_model.models.length">Model list unavailable. You can still type the model name.</div>
</div>
-
- <!-- Model search -->
- <div class="field">
- <div class="field-label">
- <div class="field-title">Model name</div>
- <div class="field-description">Use the suggested model or search for another capable general-purpose model.</div>
- </div>
- <div class="field-control relative-container"
- x-data="{ results: [], open: false, searching: false,
- doSearch() { this.searching = true; $store.modelConfig.searchModels($store.onboarding.config.chat_model.provider, $store.onboarding.config.chat_model.name, $store.modelConfig.getSearchType('chat_model'), $store.onboarding.config.chat_model.api_base).then(r => { this.results = r; this.open = true; }).finally(() => this.searching = false); },
- grouped() { return $store.modelConfig.groupResults(this.results, $store.onboarding.config.chat_model.name); }
- }"
- @click.outside="open = false">
- <input type="text" x-model="$store.onboarding.config.chat_model.name" class="input-with-icon" @keydown.enter.prevent="doSearch()" />
- <span class="model-search-btn" @click="if (!searching) doSearch()" title="Search available models">
- <span class="material-symbols-outlined" :style="searching && 'opacity:0'">search</span>
- <span class="material-symbols-outlined model-search-spinner" :style="!searching && 'opacity:0'">progress_activity</span>
- </span>
- <div class="model-search-results" x-show="open && results.length > 0" x-transition.opacity>
- <template x-for="m in grouped().matched" :key="'m_'+m">
- <div class="model-search-item matched" @click="$store.onboarding.config.chat_model.name = m; open = false;" x-text="m"></div>
- </template>
- <div class="model-search-separator" x-show="grouped().matched.length > 0 && grouped().rest.length > 0"></div>
- <template x-for="m in grouped().rest" :key="'r_'+m">
- <div class="model-search-item" @click="$store.onboarding.config.chat_model.name = m; open = false;" x-text="m"></div>
- </template>
+ <template x-if="$store.onboarding.isOAuthProvider()">
+ <div class="oauth-connect-panel">
+ <div class="oauth-connect-main">
+ <div class="oauth-status-group">
+ <span class="oauth-status-mark" :class="{ connected: $store.onboarding.oauthConnected() }">
+ <span class="material-symbols-outlined" x-text="$store.onboarding.oauthConnected() ? 'check_circle' : 'lock_open'"></span>
+ </span>
+ <span class="oauth-status-copy">
+ <span class="oauth-status-label">ChatGPT/Codex account</span>
+ <span class="oauth-status-detail">
+ <span x-text="$store.onboarding.oauthStatusLabel()"></span>
+ <span x-show="$store.onboarding.oauthEmail()"> - <span x-text="$store.onboarding.oauthEmail()"></span></span>
+ </span>
+ </span>
+ </div>
+ <div class="oauth-connect-actions">
+ <button type="button" class="btn btn-ok" x-show="!$store.onboarding.oauthConnected()" @click="$store.onboarding.connectCodex()" :disabled="$store.onboarding.oauthConnecting">
+ <span x-text="$store.onboarding.oauthConnecting ? 'Waiting for sign-in' : 'Connect account'"></span>
+ </button>
+ <button type="button" class="btn btn-cancel" x-show="$store.onboarding.oauthConnecting" @click="$store.onboarding.cancelOauthConnect()">Cancel</button>
+ <span class="status-pill connected" x-show="$store.onboarding.oauthConnected()">
+ <span class="material-symbols-outlined">check_circle</span>
+ <span>Connected</span>
+ </span>
+ </div>
</div>
- <div class="model-search-results" x-show="open && results.length === 0 && !searching">
- <div class="model-search-item disabled">No models found</div>
+ <div class="oauth-device-note" x-show="$store.onboarding.oauthDevice">
+ <span class="material-symbols-outlined">key</span>
+ <span>Device code: <b x-text="$store.onboarding.oauthDevice?.user_code"></b></span>
</div>
</div>
- </div>
+ </template>
- <!-- API Key -->
- <div class="field">
- <div class="field-label">
- <div class="field-title" x-text="`${$store.onboarding.providerLabel('chat_model')} API key`"></div>
- <div class="field-description">Saved keys stay hidden. Paste a new key only when you need to add or replace one.</div>
- </div>
- <div class="field-control relative-container" x-data="{ showKey: false }">
- <input :type="showKey ? 'text' : 'password'"
- x-model="$store.modelConfig.apiKeyValues[$store.onboarding.config.chat_model.provider]"
- :placeholder="$store.modelConfig.apiKeyStatus[$store.onboarding.config.chat_model.provider] ? '••••••••••••' : ''"
- autocomplete="off"
- class="input-with-icon"
- @input="$store.modelConfig.touchApiKey($store.onboarding.config.chat_model.provider)" />
- <span class="material-symbols-outlined eye-toggle"
- @click="
- showKey = !showKey;
- const prov = $store.onboarding.config.chat_model.provider;
- if (showKey && !$store.modelConfig.apiKeyValues[prov] && $store.modelConfig.apiKeyStatus[prov]) {
- $store.modelConfig.revealApiKey(prov).then(v => { if (v) $store.modelConfig.apiKeyValues[prov] = v; });
- }
- "
- x-text="showKey ? 'visibility' : 'visibility_off'"></span>
+ <template x-if="!$store.onboarding.isOAuthProvider()">
+ <div class="field-stack">
+ <div class="soft-note" x-show="$store.onboarding.localGuidance()" x-text="$store.onboarding.localGuidance()"></div>
+ <div class="field wide-inline-field" x-show="!$store.onboarding.providerHasNoKey($store.onboarding.selectedProviderId)">
+ <label for="onboarding-api-key">
+ API key <span x-show="$store.onboarding.providerKeyOptional($store.onboarding.selectedProviderId)">(optional)</span>
+ </label>
+ <input id="onboarding-api-key"
+ type="password"
+ autocomplete="off"
+ x-model="$store.modelConfig.apiKeyValues[$store.onboarding.selectedProviderId]"
+ :placeholder="$store.modelConfig.apiKeyStatus[$store.onboarding.selectedProviderId] ? 'Key already saved' : 'Paste your API key'"
+ @input="$store.modelConfig.touchApiKey($store.onboarding.selectedProviderId)">
+ <div class="field-help">Already have a key? Paste it here and continue.</div>
+ </div>
+ <div class="soft-note" x-show="$store.onboarding.providerHasNoKey($store.onboarding.selectedProviderId)">
+ This provider does not need an API key here.
+ </div>
+ <div class="field wide-inline-field" x-show="$store.onboarding.showApiBaseField()">
+ <label for="onboarding-api-base">API Base URL</label>
+ <input id="onboarding-api-base" type="text" x-model="$store.onboarding.config.chat_model.api_base" placeholder="Provider default"> </div>
</div>
- </div>
+ </template>
</div>
</div>
+ </section>
- <!-- Step 2: Utility Model -->
- <div x-show="$store.onboarding.step === 2">
- <div class="onboarding-welcome-text">
- <div class="onboarding-welcome-title">Choose your Utility Model</div>
- Agent Zero uses the <b>Utility Model</b> for quiet work: summaries, memory, and preparation. Pick something fast, reliable, and cost-conscious.
+ <section x-show="$store.onboarding.isStep('utility')" x-transition.opacity>
+ <div class="utility-panel field-stack">
+ <label class="soft-note">
+ <input type="checkbox" x-model="$store.onboarding.sameAsMain" @change="$store.onboarding.syncUtilityWithMain()">
+ Use same as Main Model
+ </label>
+ <div class="field">
+ <label for="utility-provider">Utility provider</label>
+ <select id="utility-provider" x-model="$store.onboarding.config.utility_model.provider" @change="$store.onboarding.utilityProviderChanged()" :disabled="$store.onboarding.sameAsMain">
+ <template x-for="provider in $store.modelConfig.getProviders('utility_model')" :key="provider.value">
+ <option :value="provider.value" x-text="provider.label"></option>
+ </template>
+ </select>
</div>
-
- <div class="model-section">
- <div class="section-title" x-text="$store.modelConfig.MODEL_SECTIONS[1].title"></div>
- <div class="section-description">Choose a fast, reliable model for summaries, memory, and prompt preparation.</div>
-
- <!-- Provider -->
- <div class="field">
- <div class="field-label">
- <div class="field-title">Provider</div>
- <div class="field-description">Use the same provider as your Main Model, or choose a faster low-cost option.</div>
- </div>
- <div class="field-control">
- <select x-model="$store.onboarding.config.utility_model.provider"
- x-effect="$nextTick(() => { if ($store.modelConfig.getProviders('utility_model').length) $el.value = $store.onboarding.config.utility_model.provider })">
- <template x-for="p in $store.modelConfig.getProviders('utility_model')" :key="p.value">
- <option :value="p.value" x-text="p.label"></option>
- </template>
- </select>
- </div>
- </div>
-
- <!-- Model search -->
- <div class="field">
- <div class="field-label">
- <div class="field-title">Model name</div>
- <div class="field-description">The suggested model is tuned for speed and cost. Search if your provider uses another name.</div>
- </div>
- <div class="field-control relative-container"
- x-data="{ results: [], open: false, searching: false,
- doSearch() { this.searching = true; $store.modelConfig.searchModels($store.onboarding.config.utility_model.provider, $store.onboarding.config.utility_model.name, $store.modelConfig.getSearchType('utility_model'), $store.onboarding.config.utility_model.api_base).then(r => { this.results = r; this.open = true; }).finally(() => this.searching = false); },
- grouped() { return $store.modelConfig.groupResults(this.results, $store.onboarding.config.utility_model.name); }
- }"
- @click.outside="open = false">
- <input type="text" x-model="$store.onboarding.config.utility_model.name" class="input-with-icon" @keydown.enter.prevent="doSearch()" />
- <span class="model-search-btn" @click="if (!searching) doSearch()" title="Search available models">
- <span class="material-symbols-outlined" :style="searching && 'opacity:0'">search</span>
- <span class="material-symbols-outlined model-search-spinner" :style="!searching && 'opacity:0'">progress_activity</span>
- </span>
- <div class="model-search-results" x-show="open && results.length > 0" x-transition.opacity>
- <template x-for="m in grouped().matched" :key="'m_'+m">
- <div class="model-search-item matched" @click="$store.onboarding.config.utility_model.name = m; open = false;" x-text="m"></div>
- </template>
- <div class="model-search-separator" x-show="grouped().matched.length > 0 && grouped().rest.length > 0"></div>
- <template x-for="m in grouped().rest" :key="'r_'+m">
- <div class="model-search-item" @click="$store.onboarding.config.utility_model.name = m; open = false;" x-text="m"></div>
- </template>
- </div>
- <div class="model-search-results" x-show="open && results.length === 0 && !searching">
- <div class="model-search-item disabled">No models found</div>
- </div>
- </div>
- </div>
-
- <!-- API Key -->
- <div class="field">
- <div class="field-label">
- <div class="field-title" x-text="`${$store.onboarding.providerLabel('utility_model')} API key`"></div>
- <div class="field-description">Saved keys stay hidden. Paste a new key only when you need to add or replace one.</div>
- </div>
- <div class="field-control relative-container" x-data="{ showKey: false }">
- <input :type="showKey ? 'text' : 'password'"
- x-model="$store.modelConfig.apiKeyValues[$store.onboarding.config.utility_model.provider]"
- :placeholder="$store.modelConfig.apiKeyStatus[$store.onboarding.config.utility_model.provider] ? '••••••••••••' : ''"
- autocomplete="off"
- class="input-with-icon"
- @input="$store.modelConfig.touchApiKey($store.onboarding.config.utility_model.provider)" />
- <span class="material-symbols-outlined eye-toggle"
- @click="
- showKey = !showKey;
- const prov = $store.onboarding.config.utility_model.provider;
- if (showKey && !$store.modelConfig.apiKeyValues[prov] && $store.modelConfig.apiKeyStatus[prov]) {
- $store.modelConfig.revealApiKey(prov).then(v => { if (v) $store.modelConfig.apiKeyValues[prov] = v; });
- }
- "
- x-text="showKey ? 'visibility' : 'visibility_off'"></span>
+ <div class="field relative-field" @click.outside="$store.onboarding.closeModelDropdown('utility_model')">
+ <label class="model-label" for="utility-model-input">Search or enter Utility Model</label>
+ <div class="model-input-row">
+ <input id="utility-model-input" type="text" x-model="$store.onboarding.config.utility_model.name" @input="$store.onboarding.markModelTouched('utility_model')" @focus="$store.onboarding.openModelDropdown('utility_model')" :disabled="$store.onboarding.sameAsMain" placeholder="Search or enter a model">
+ <button type="button"
+ class="model-refresh-button"
+ aria-label="Refresh utility model list"
+ title="Refresh model list"
+ x-show="!$store.onboarding.sameAsMain"
+ @click="$store.onboarding.loadModels('utility_model')"
+ :disabled="$store.onboarding.modelDropdown.utility_model.loading">
+ <span class="material-symbols-outlined" x-text="$store.onboarding.modelDropdown.utility_model.loading ? 'progress_activity' : 'search'"></span>
+ </button>
+ <div class="model-dropdown" x-show="!$store.onboarding.sameAsMain && $store.onboarding.modelDropdown.utility_model.open && !$store.onboarding.modelDropdown.utility_model.loading" x-transition.opacity>
+ <template x-for="model in $store.onboarding.filteredModels('utility_model')" :key="model">
+ <button type="button" class="model-item" @click="$store.onboarding.selectModel('utility_model', model)" x-text="model"></button>
+ </template>
+ <div class="model-item" x-show="$store.onboarding.filteredModels('utility_model').length === 0">No models found. You can still type the model name manually.</div>
</div>
</div>
+ <span class="field-help" x-show="$store.onboarding.modelDropdown.utility_model.error && !$store.onboarding.modelDropdown.utility_model.models.length">Model list unavailable. You can still type the model name.</span>
</div>
</div>
+ </section>
- <!-- Step 3: Success -->
- <div x-show="$store.onboarding.step === 3" class="onboarding-success">
- <div class="material-symbols-outlined onboarding-success-icon">check_circle</div>
- <div class="onboarding-welcome-text onboarding-success-text">
- <div class="onboarding-welcome-title">Agent Zero is ready</div>
- Your models are configured. You can change them anytime in Settings.<br>
- You can also connect integrations now and give Agent Zero more places to work.
- </div>
- <x-extension id="onboarding-success-end"></x-extension>
- </div>
+ <section x-show="$store.onboarding.isStep('ready')" x-transition.opacity>
+ <x-extension id="onboarding-success-end"></x-extension>
+ </section>
- <div class="onboarding-advanced-link" x-show="$store.onboarding.step < 3">
- <a href="#" @click.prevent="$store.onboarding.openAdvancedSettings()">
- Advanced Settings <span class="material-symbols-outlined onboarding-advanced-link-icon">arrow_drop_down</span>
- </a>
- </div>
+ <div class="onboarding-advanced-link" x-show="!$store.onboarding.isStep('ready') && !$store.onboarding.isStep('cloud') && !$store.onboarding.isStep('local')">
+ <button type="button" class="advanced-settings-toggle" @click="$store.onboarding.openAdvancedSettings()">
+ <span>Advanced Settings</span>
+ <span class="material-symbols-outlined">keyboard_arrow_right</span>
+ </button>
</div>
- </template>
-
- </div>
+ </div>
+ </template>
</div>
<div class="modal-footer" data-modal-footer>
<div class="onboarding-footer-left">
- <button class="btn btn-cancel" @click="window.closeModal()" :disabled="$store.onboarding.loading">Cancel</button>
+ <button class="btn btn-cancel" @click="window.closeModal()" :disabled="$store.onboarding.saving">Cancel</button>
</div>
<div class="onboarding-footer-right">
- <button class="btn" x-show="$store.onboarding.step > 1" @click="$store.onboarding.prev()" :disabled="$store.onboarding.loading">
- Back
- </button>
-
- <button class="btn btn-ok" x-show="$store.onboarding.step < 3" @click="$store.onboarding.next()" :disabled="$store.onboarding.loading">
- <span x-text="$store.onboarding.nextButtonLabel()"></span>
- <span class="material-symbols-outlined onboarding-icon-right">arrow_forward</span>
- </button>
-
- <button class="btn btn-ok" x-show="$store.onboarding.step === 3" @click="$store.onboarding.finish()" :disabled="$store.onboarding.loading">
- Start Chatting
+ <button class="btn btn-secondary" x-show="$store.onboarding.showBackButton()" @click="$store.onboarding.goBack()" :disabled="$store.onboarding.loading || $store.onboarding.saving">Back</button>
+ <button class="btn btn-ok" x-show="$store.onboarding.showPrimaryButton()" @click="$store.onboarding.primaryAction()" :disabled="$store.onboarding.primaryDisabled()">
+ <span x-text="$store.onboarding.primaryButtonLabel()"></span>
</button>
</div>
</div>
-
</div>
</template>
</div>
diff --git a/tests/test_model_config_api_keys.py b/tests/test_model_config_api_keys.py
index adfbdbe4c..132618cec 100644
--- a/tests/test_model_config_api_keys.py
+++ b/tests/test_model_config_api_keys.py
@@ -129,3 +129,36 @@ def test_ollama_cloud_provider_config_requires_key_and_base_url():
assert ollama_cloud["kwargs"]["api_base"] == "https://ollama.com/v1"
assert ollama_cloud["models_list"]["endpoint_url"] == "/models"
assert "api_key_mode" not in ollama_cloud
+
+
+def test_missing_api_key_banner_includes_auto_modal_metadata(monkeypatch):
+ from plugins._model_config.helpers import model_config
+
+ fake = [{"model_type": "Chat Model", "provider": "openai"}]
+ monkeypatch.setattr(model_config, "get_missing_api_key_providers", lambda: fake)
+
+ async def run():
+ banners = []
+ await missing_key_banner.MissingApiKeyCheck(agent=None).execute(
+ banners=banners, frontend_context={}
+ )
+ return next(b for b in banners if b.get("id") == "missing-api-key")
+
+ import asyncio
+ row = asyncio.run(run())
+
+ assert row["auto_modal_path"] == "/plugins/_onboarding/webui/onboarding.html"
+ assert row["auto_modal_reason"] == "missing-api-key"
+ assert row["auto_modal_priority"] == 100
+ assert row["type"] == "warning"
+ assert row["dismissible"] is False
+ assert row["missing_providers"] == fake
+
+
+def test_provider_key_modes_for_local_and_ollama_cloud():
+ from plugins._model_config.helpers import model_config
+
+ assert model_config.provider_requires_api_key("ollama") is False
+ assert model_config.provider_requires_api_key("lm_studio") is False
+ assert model_config.provider_requires_api_key("other") is False
+ assert model_config.provider_requires_api_key("ollama_cloud") is True
diff --git a/tests/test_model_search.py b/tests/test_model_search.py
new file mode 100644
index 000000000..2ea6b4c9e
--- /dev/null
+++ b/tests/test_model_search.py
@@ -0,0 +1,82 @@
+import sys
+import threading
+import types
+from pathlib import Path
+
+from flask import Flask
+
+PROJECT_ROOT = Path(__file__).resolve().parents[1]
+if str(PROJECT_ROOT) not in sys.path:
+ sys.path.insert(0, str(PROJECT_ROOT))
+
+sys.modules.setdefault("giturlparse", types.SimpleNamespace(parse=lambda *args, **kwargs: None))
+sys.modules.setdefault("whisper", types.SimpleNamespace(load_model=lambda *args, **kwargs: None))
+
+from plugins._model_config.api.model_search import ModelSearch
+
+
+def _handler():
+ return ModelSearch(Flask(__name__), threading.Lock())
+
+
+def test_model_search_parses_openai_style_data():
+ handler = _handler()
+
+ assert handler._parse({"data": [{"id": "gpt-4.1"}, {"id": "gpt-4.1-mini"}]}, "openai") == [
+ "gpt-4.1",
+ "gpt-4.1-mini",
+ ]
+
+
+def test_model_search_parses_google_models_and_strips_prefix():
+ handler = _handler()
+
+ assert handler._parse({"models": [{"name": "models/gemini-pro"}]}, "google") == ["gemini-pro"]
+
+
+def test_model_search_parses_ollama_models():
+ handler = _handler()
+
+ assert handler._parse({"models": [{"name": "llama3.2"}]}, "ollama") == ["llama3.2"]
+
+
+def test_model_search_builds_ollama_running_models_url():
+ handler = _handler()
+
+ assert handler._ollama_ps_url("http://host.docker.internal:11434/api/tags") == (
+ "http://host.docker.internal:11434/api/ps"
+ )
+
+
+def test_model_search_parses_list_style_dicts_and_strings():
+ handler = _handler()
+
+ assert handler._parse([{"id": "mistral-large"}, "mistral-small"], "openai") == [
+ "mistral-large",
+ "mistral-small",
+ ]
+
+
+def test_model_search_resolves_v1_base_without_duplicate_v1():
+ handler = _handler()
+
+ url, fmt = handler._resolve_url({"endpoint_url": "/v1/models"}, "http://host.docker.internal:1234/v1")
+
+ assert url == "http://host.docker.internal:1234/v1/models"
+ assert fmt == "openai"
+
+
+def test_model_search_filters_non_chat_models():
+ handler = _handler()
+
+ assert handler._filter_models(["gpt-4.1", "text-embedding-3-small", "gpt-image-1"], "chat") == ["gpt-4.1"]
+
+
+def test_model_search_falls_back_to_litellm_registry(monkeypatch):
+ handler = _handler()
+ fake_litellm = types.SimpleNamespace(
+ models_by_provider={"openai": {"openai/gpt-4.1", "text-embedding-3-small"}}
+ )
+ monkeypatch.setitem(sys.modules, "litellm", fake_litellm)
+
+ assert set(handler._litellm_fallback("openai", {"litellm_provider": "openai"})) == {"gpt-4.1"}
diff --git a/tests/test_onboarding_static.py b/tests/test_onboarding_static.py
new file mode 100644
index 000000000..eddf09810
--- /dev/null
+++ b/tests/test_onboarding_static.py
@@ -0,0 +1,122 @@
+from pathlib import Path
+
+PROJECT_ROOT = Path(__file__).resolve().parents[1]
+
+
+def test_onboarding_contains_guided_cloud_local_flow():
+ html = (PROJECT_ROOT / "plugins/_onboarding/webui/onboarding.html").read_text(encoding="utf-8")
+ store = (PROJECT_ROOT / "plugins/_onboarding/webui/onboarding-store.js").read_text(encoding="utf-8")
+
+ assert "Cloud" in html
+ assert "Local" in html
+ assert "Welcome to Agent Zero" in html
+ assert "Choose how to use AI models in Agent Zero" in html + store
+ assert "Choose your cloud AI provider" in html + store
+ assert "Choose your local LLM provider" in html + store
+ assert "cloud-card.webp" in html
+ assert "local-card.webp" in html
+ assert "Connect ChatGPT/Codex Account" in html
+ assert "Main model" in html
+ assert "Refresh model list" in html
+ assert "Search or enter Utility Model" in html
+ assert "Advanced Settings" in html
+ assert "selectedProviderName() + ' Docs'" in html
+ assert "openSelectedProviderDocs" in html + store
+ assert "Connect via device code" in html + store
+ assert "accountActionLabel" in html + store
+ assert "Click here if you don't see your provider" in html
+ assert "provider-description" not in html
+ assert "!$store.onboarding.isStep('cloud')" in html
+ assert "!$store.onboarding.isStep('local')" in html
+ assert "main-model-field" in html
+ assert "wide-inline-field" in html
+ assert "utility-panel" in html
+ assert "showApiBaseField()" in html + store
+ assert "localGuidance()" in html + store
+
+
+def test_onboarding_provider_grid_names_are_present_in_metadata():
+ provider_yaml = (PROJECT_ROOT / "conf/model_providers.yaml").read_text(encoding="utf-8")
+ provider_ui = (PROJECT_ROOT / "plugins/_onboarding/webui/onboarding-providers.js").read_text(encoding="utf-8")
+ model_metadata = (PROJECT_ROOT / "plugins/_model_config/provider_metadata.yaml").read_text(encoding="utf-8")
+
+ assert "TOP_CLOUD_PROVIDER_IDS" in provider_ui
+ assert '"venice"' in provider_ui
+ assert '"xai"' in provider_ui
+ assert provider_ui.index('"venice"') < provider_ui.index('"zai"')
+ assert provider_ui.index('"xai"') > provider_ui.index("MORE_CLOUD_PROVIDER_IDS")
+ assert 'name: "Google"' in provider_ui
+ assert 'docs_url: "https://openrouter.ai/workspaces/default/keys"' in provider_ui
+ assert 'docs_url: "https://ai.google.dev/gemini-api/docs/api-key"' in provider_ui
+ assert 'docs_url: "https://docs.venice.ai/guides/getting-started/generating-api-key"' in provider_ui
+ assert 'docs_url: "https://lmstudio.ai/docs/developer/core/authentication"' in provider_ui
+ assert 'docs_url: ""' in provider_ui
+ assert "api_key_mode: none" in model_metadata
+ assert "api_key_mode: optional" in model_metadata
+ assert "Ollama Cloud" in provider_yaml
+ assert "https://ollama.com/v1" in provider_yaml
+ assert not (PROJECT_ROOT / "plugins/_model_config/conf/model_providers.yaml").exists()
+
+ for name in [
+ "OpenRouter",
+ "Agent Zero API",
+ "OpenAI",
+ "Anthropic",
+ "Google",
+ "DeepSeek",
+ "xAI",
+ "Moonshot AI",
+ "Z.AI",
+ "Mistral AI",
+ "Azure OpenAI",
+ ]:
+ assert name in provider_yaml + provider_ui
+
+ for name in ["Ollama Cloud", "AWS Bedrock", "Groq"]:
+ assert name in provider_yaml + provider_ui
+
+ for forbidden in [
+ "onboarding_category",
+ "onboarding_rank",
+ "short_description",
+ "setup_url",
+ "api_key_url",
+ "docs_url",
+ "logo:",
+ "api_key_mode",
+ "model_list_autoload",
+ "default_chat_model",
+ "default_utility_model",
+ "default_api_base",
+ ]:
+ assert forbidden not in provider_yaml
+
+ for logo in [
+ "google-gemini.svg",
+ "groq.svg",
+ "sambanova.png",
+ "cometapi.ico",
+ "github-copilot.svg",
+ "zai-logo.svg",
+ ]:
+ assert logo in provider_ui
+
+
+def test_discovery_auto_modal_extension_contains_required_guards():
+ content = (PROJECT_ROOT / "plugins/_discovery/extensions/webui/initFw_end/auto-modal.js").read_text(encoding="utf-8")
+
+ assert "auto_modal_path" in content
+ assert "chat-created" in content
+ assert "modalAlreadyOpen" in content
+ assert "discovery_auto_modal_closed" in content
+ assert "auto_modal_surfaces" in content
+
+
+def test_onboarding_success_filters_codex_discovery_card():
+ content = (
+ PROJECT_ROOT
+ / "plugins/_discovery/extensions/webui/onboarding-success-end/discovery-cards.html"
+ ).read_text(encoding="utf-8")
+
+ assert "discovery-codex-oauth" in content
+ assert "filter(card => card.id !== 'discovery-codex-oauth')" in content
diff --git a/webui/components/sidebar/chats/chats-store.js b/webui/components/sidebar/chats/chats-store.js
index 9b0ab247e..580185975 100644
--- a/webui/components/sidebar/chats/chats-store.js
+++ b/webui/components/sidebar/chats/chats-store.js
@@ -168,7 +168,8 @@ const model = {
});
if (response.ok) {
- this.selectChat(response.ctxid);
+ await this.selectChat(response.ctxid);
+ document.dispatchEvent(new CustomEvent("chat-created", { detail: { ctxid: response.ctxid } }));
return;
}