style(web): apply linter formatting across model config components

Normalize quote style, import ordering, and class name ordering as
reported by the project linter.
This commit is contained in:
SiYue-ZO 2026-05-06 18:16:52 +08:00
parent 77c6f31983
commit 249fa93e95
13 changed files with 213 additions and 221 deletions

View file

@ -66,10 +66,7 @@ export function WebSearchGeneralSettings({
</SettingRow>
<SettingRow
label={t(
"pages.agent.tools.web_search.proxy",
"Proxy Configuration",
)}
label={t("pages.agent.tools.web_search.proxy", "Proxy Configuration")}
description={t(
"pages.agent.tools.web_search.proxy_description",
"Optional global HTTP/S proxy for underlying web requests.",

View file

@ -84,10 +84,7 @@ function ProviderCard({
const { t } = useTranslation()
const apiKeyPlaceholder = maskedSecretPlaceholder(
settings.api_key_set ? `${providerId}-configured` : "",
t(
"pages.agent.tools.web_search.api_key_placeholder",
"Enter API key...",
),
t("pages.agent.tools.web_search.api_key_placeholder", "Enter API key..."),
)
const updateSettings = (
@ -167,7 +164,10 @@ function ProviderCard({
>
<div className="ml-8 flex max-w-xl flex-col gap-5">
<ProviderField
label={t("pages.agent.tools.web_search.max_results", "Max Results")}
label={t(
"pages.agent.tools.web_search.max_results",
"Max Results",
)}
>
<Input
type="number"

View file

@ -128,7 +128,10 @@ export function ChatComposer({
<div className="flex items-center gap-1.5">
{contextUsage && (
<ContextUsageRing usage={contextUsage} onDetailClick={onContextDetail} />
<ContextUsageRing
usage={contextUsage}
onDetailClick={onContextDetail}
/>
)}
{canInput ? (
<Tooltip delayDuration={700}>

View file

@ -127,7 +127,7 @@ export function ContextUsageRing({
: "pointer-events-none scale-95 opacity-0"
}`}
>
<div className="bg-popover absolute -bottom-1.5 right-3 h-3 w-3 rotate-45 border-r border-b" />
<div className="bg-popover absolute right-3 -bottom-1.5 h-3 w-3 rotate-45 border-r border-b" />
<div className="flex items-center justify-between">
<span className="text-muted-foreground text-xs">

View file

@ -545,9 +545,7 @@ export function LauncherSection({
disabled={disabled}
autoComplete="new-password"
placeholder={t("pages.config.dashboard_password_placeholder")}
onChange={(e) =>
onFieldChange("dashboardPassword", e.target.value)
}
onChange={(e) => onFieldChange("dashboardPassword", e.target.value)}
/>
</Field>

View file

@ -5,11 +5,10 @@
* Messages use i18n keys with interpolation params callers must
* translate them via t(key, params).
*/
import {
findClosestProvider,
KNOWN_PROVIDER_KEYS,
PROVIDER_ALIASES,
findClosestProvider,
} from "./provider-registry"
export type ValidationLevel = "error" | "warning" | "success"

View file

@ -1,4 +1,9 @@
import { IconDatabase, IconLoader2, IconPlus, IconStar } from "@tabler/icons-react"
import {
IconDatabase,
IconLoader2,
IconPlus,
IconStar,
} from "@tabler/icons-react"
import { useCallback, useEffect, useState } from "react"
import { useTranslation } from "react-i18next"
import { toast } from "sonner"

View file

@ -63,10 +63,13 @@ export function ProviderCombobox({
}
return (
<Popover open={open} onOpenChange={(v) => {
setOpen(v)
if (!v) setCustomMode(false)
}}>
<Popover
open={open}
onOpenChange={(v) => {
setOpen(v)
if (!v) setCustomMode(false)
}}
>
<PopoverTrigger asChild>
<Button
variant="outline"

View file

@ -1,9 +1,6 @@
import { useMemo, useState } from "react"
import {
PROVIDER_DOMAINS,
PROVIDER_ICON_SLUGS,
} from "./provider-registry"
import { PROVIDER_DOMAINS, PROVIDER_ICON_SLUGS } from "./provider-registry"
interface ProviderIconProps {
providerKey: string

View file

@ -1,7 +1,4 @@
import {
PROVIDER_ALIASES,
PROVIDER_LABELS,
} from "./provider-registry"
import { PROVIDER_ALIASES, PROVIDER_LABELS } from "./provider-registry"
export function getProviderKey(provider?: string): string {
const normalized = provider?.trim().toLowerCase()

View file

@ -20,344 +20,334 @@ export interface ProviderDefinition {
export const PROVIDERS: ProviderDefinition[] = [
{
key: 'openai',
label: 'OpenAI',
iconSlug: 'openai',
domain: 'openai.com',
defaultApiBase: 'https://api.openai.com/v1',
key: "openai",
label: "OpenAI",
iconSlug: "openai",
domain: "openai.com",
defaultApiBase: "https://api.openai.com/v1",
requiresApiKey: true,
isLocal: false,
priority: 100,
commonModels: ['gpt-4o', 'gpt-4o-mini', 'gpt-4-turbo', 'o1', 'o3-mini'],
aliases: ['gpt'],
commonModels: ["gpt-4o", "gpt-4o-mini", "gpt-4-turbo", "o1", "o3-mini"],
aliases: ["gpt"],
},
{
key: 'anthropic',
label: 'Anthropic',
iconSlug: 'anthropic',
domain: 'anthropic.com',
defaultApiBase: 'https://api.anthropic.com/v1',
key: "anthropic",
label: "Anthropic",
iconSlug: "anthropic",
domain: "anthropic.com",
defaultApiBase: "https://api.anthropic.com/v1",
requiresApiKey: true,
isLocal: false,
priority: 95,
commonModels: [
'claude-sonnet-4-20250514',
'claude-haiku-4-20250414',
'claude-3-5-sonnet-20241022',
"claude-sonnet-4-20250514",
"claude-haiku-4-20250414",
"claude-3-5-sonnet-20241022",
],
aliases: ['claude'],
aliases: ["claude"],
},
{
key: 'gemini',
label: 'Google Gemini',
iconSlug: 'googlegemini',
domain: 'gemini.google.com',
defaultApiBase: 'https://generativelanguage.googleapis.com/v1beta',
key: "gemini",
label: "Google Gemini",
iconSlug: "googlegemini",
domain: "gemini.google.com",
defaultApiBase: "https://generativelanguage.googleapis.com/v1beta",
requiresApiKey: true,
isLocal: false,
priority: 90,
commonModels: ['gemini-2.0-flash', 'gemini-2.5-pro', 'gemini-1.5-flash'],
aliases: ['google'],
commonModels: ["gemini-2.0-flash", "gemini-2.5-pro", "gemini-1.5-flash"],
aliases: ["google"],
},
{
key: 'deepseek',
label: 'DeepSeek',
iconSlug: 'deepseek',
domain: 'deepseek.com',
defaultApiBase: 'https://api.deepseek.com/v1',
key: "deepseek",
label: "DeepSeek",
iconSlug: "deepseek",
domain: "deepseek.com",
defaultApiBase: "https://api.deepseek.com/v1",
requiresApiKey: true,
isLocal: false,
priority: 85,
commonModels: ['deepseek-chat', 'deepseek-reasoner'],
commonModels: ["deepseek-chat", "deepseek-reasoner"],
},
{
key: 'openrouter',
label: 'OpenRouter',
iconSlug: 'openrouter',
domain: 'openrouter.ai',
defaultApiBase: 'https://openrouter.ai/api/v1',
key: "openrouter",
label: "OpenRouter",
iconSlug: "openrouter",
domain: "openrouter.ai",
defaultApiBase: "https://openrouter.ai/api/v1",
requiresApiKey: true,
isLocal: false,
priority: 80,
commonModels: [
'openai/gpt-4o',
'anthropic/claude-sonnet-4',
'google/gemini-2.0-flash',
"openai/gpt-4o",
"anthropic/claude-sonnet-4",
"google/gemini-2.0-flash",
],
},
{
key: 'qwen-portal',
label: 'Qwen',
labelZh: 'Qwen (阿里云)',
iconSlug: 'alibabacloud',
domain: 'qwenlm.ai',
defaultApiBase:
'https://dashscope.aliyuncs.com/compatible-mode/v1',
key: "qwen-portal",
label: "Qwen",
labelZh: "Qwen (阿里云)",
iconSlug: "alibabacloud",
domain: "qwenlm.ai",
defaultApiBase: "https://dashscope.aliyuncs.com/compatible-mode/v1",
requiresApiKey: true,
isLocal: false,
priority: 75,
commonModels: ['qwen-max', 'qwen-plus', 'qwen-turbo'],
aliases: ['qwen'],
commonModels: ["qwen-max", "qwen-plus", "qwen-turbo"],
aliases: ["qwen"],
},
{
key: 'qwen-intl',
label: 'Qwen International',
iconSlug: 'alibabacloud',
domain: 'alibabacloud.com',
defaultApiBase:
'https://dashscope-intl.aliyuncs.com/compatible-mode/v1',
key: "qwen-intl",
label: "Qwen International",
iconSlug: "alibabacloud",
domain: "alibabacloud.com",
defaultApiBase: "https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
requiresApiKey: true,
isLocal: false,
priority: 74,
commonModels: ['qwen-max', 'qwen-plus', 'qwen-turbo'],
aliases: ['qwen-international', 'dashscope-intl'],
commonModels: ["qwen-max", "qwen-plus", "qwen-turbo"],
aliases: ["qwen-international", "dashscope-intl"],
},
{
key: 'moonshot',
label: 'Moonshot',
labelZh: 'Moonshot (月之暗面)',
domain: 'moonshot.ai',
defaultApiBase: 'https://api.moonshot.cn/v1',
key: "moonshot",
label: "Moonshot",
labelZh: "Moonshot (月之暗面)",
domain: "moonshot.ai",
defaultApiBase: "https://api.moonshot.cn/v1",
requiresApiKey: true,
isLocal: false,
priority: 70,
commonModels: ['moonshot-v1-8k', 'moonshot-v1-32k', 'moonshot-v1-128k'],
commonModels: ["moonshot-v1-8k", "moonshot-v1-32k", "moonshot-v1-128k"],
},
{
key: 'volcengine',
label: 'Volcengine',
labelZh: 'Volcengine (火山引擎)',
iconSlug: 'bytedance',
domain: 'volcengine.com',
defaultApiBase:
'https://ark.cn-beijing.volces.com/api/v3',
key: "volcengine",
label: "Volcengine",
labelZh: "Volcengine (火山引擎)",
iconSlug: "bytedance",
domain: "volcengine.com",
defaultApiBase: "https://ark.cn-beijing.volces.com/api/v3",
requiresApiKey: true,
isLocal: false,
priority: 69,
commonModels: ['doubao-1.5-pro', 'doubao-1.5-lite'],
commonModels: ["doubao-1.5-pro", "doubao-1.5-lite"],
},
{
key: 'zhipu',
label: 'Zhipu AI',
labelZh: 'Zhipu AI (智谱)',
iconSlug: 'zhipu',
domain: 'zhipuai.cn',
defaultApiBase:
'https://open.bigmodel.cn/api/paas/v4',
key: "zhipu",
label: "Zhipu AI",
labelZh: "Zhipu AI (智谱)",
iconSlug: "zhipu",
domain: "zhipuai.cn",
defaultApiBase: "https://open.bigmodel.cn/api/paas/v4",
requiresApiKey: true,
isLocal: false,
priority: 68,
commonModels: ['glm-4-plus', 'glm-4-flash'],
commonModels: ["glm-4-plus", "glm-4-flash"],
},
{
key: 'groq',
label: 'Groq',
iconSlug: 'groq',
domain: 'groq.com',
defaultApiBase: 'https://api.groq.com/openai/v1',
key: "groq",
label: "Groq",
iconSlug: "groq",
domain: "groq.com",
defaultApiBase: "https://api.groq.com/openai/v1",
requiresApiKey: true,
isLocal: false,
priority: 65,
commonModels: [
'llama-3.3-70b-versatile',
'mixtral-8x7b-32768',
],
commonModels: ["llama-3.3-70b-versatile", "mixtral-8x7b-32768"],
},
{
key: 'mistral',
label: 'Mistral AI',
iconSlug: 'mistralai',
domain: 'mistral.ai',
defaultApiBase: 'https://api.mistral.ai/v1',
key: "mistral",
label: "Mistral AI",
iconSlug: "mistralai",
domain: "mistral.ai",
defaultApiBase: "https://api.mistral.ai/v1",
requiresApiKey: true,
isLocal: false,
priority: 64,
commonModels: ['mistral-large-latest', 'mistral-small-latest'],
commonModels: ["mistral-large-latest", "mistral-small-latest"],
},
{
key: 'nvidia',
label: 'NVIDIA',
iconSlug: 'nvidia',
domain: 'nvidia.com',
defaultApiBase:
'https://integrate.api.nvidia.com/v1',
key: "nvidia",
label: "NVIDIA",
iconSlug: "nvidia",
domain: "nvidia.com",
defaultApiBase: "https://integrate.api.nvidia.com/v1",
requiresApiKey: true,
isLocal: false,
priority: 63,
commonModels: ['meta/llama-3.1-405b-instruct'],
commonModels: ["meta/llama-3.1-405b-instruct"],
},
{
key: 'cerebras',
label: 'Cerebras',
iconSlug: 'cerebras',
domain: 'cerebras.ai',
defaultApiBase: 'https://api.cerebras.ai/v1',
key: "cerebras",
label: "Cerebras",
iconSlug: "cerebras",
domain: "cerebras.ai",
defaultApiBase: "https://api.cerebras.ai/v1",
requiresApiKey: true,
isLocal: false,
priority: 62,
commonModels: ['llama3.1-8b', 'llama3.1-70b'],
commonModels: ["llama3.1-8b", "llama3.1-70b"],
},
{
key: 'azure',
label: 'Azure OpenAI',
iconSlug: 'microsoftazure',
domain: 'azure.com',
key: "azure",
label: "Azure OpenAI",
iconSlug: "microsoftazure",
domain: "azure.com",
requiresApiKey: true,
isLocal: false,
priority: 61,
commonModels: ['gpt-4o', 'gpt-4o-mini'],
commonModels: ["gpt-4o", "gpt-4o-mini"],
},
{
key: 'github-copilot',
label: 'GitHub Copilot',
iconSlug: 'githubcopilot',
domain: 'github.com',
key: "github-copilot",
label: "GitHub Copilot",
iconSlug: "githubcopilot",
domain: "github.com",
requiresApiKey: false,
isLocal: true,
priority: 55,
},
{
key: 'antigravity',
label: 'Google Code Assist',
domain: 'antigravity.google',
key: "antigravity",
label: "Google Code Assist",
domain: "antigravity.google",
requiresApiKey: false,
isLocal: false,
priority: 54,
},
{
key: 'ollama',
label: 'Ollama',
labelZh: 'Ollama (本地)',
iconSlug: 'ollama',
domain: 'ollama.com',
defaultApiBase: 'http://localhost:11434/v1',
key: "ollama",
label: "Ollama",
labelZh: "Ollama (本地)",
iconSlug: "ollama",
domain: "ollama.com",
defaultApiBase: "http://localhost:11434/v1",
requiresApiKey: false,
isLocal: true,
priority: 50,
commonModels: ['llama3', 'mistral', 'codellama', 'qwen2.5'],
commonModels: ["llama3", "mistral", "codellama", "qwen2.5"],
},
{
key: 'vllm',
label: 'VLLM',
labelZh: 'VLLM (本地)',
domain: 'vllm.ai',
defaultApiBase: 'http://localhost:8000/v1',
key: "vllm",
label: "VLLM",
labelZh: "VLLM (本地)",
domain: "vllm.ai",
defaultApiBase: "http://localhost:8000/v1",
requiresApiKey: false,
isLocal: true,
priority: 49,
},
{
key: 'lmstudio',
label: 'LM Studio',
labelZh: 'LM Studio (本地)',
domain: 'lmstudio.ai',
defaultApiBase: 'http://localhost:1234/v1',
key: "lmstudio",
label: "LM Studio",
labelZh: "LM Studio (本地)",
domain: "lmstudio.ai",
defaultApiBase: "http://localhost:1234/v1",
requiresApiKey: false,
isLocal: true,
priority: 48,
},
{
key: 'venice',
label: 'Venice AI',
iconSlug: 'venice',
domain: 'venice.ai',
defaultApiBase: 'https://api.venice.ai/api/v1',
key: "venice",
label: "Venice AI",
iconSlug: "venice",
domain: "venice.ai",
defaultApiBase: "https://api.venice.ai/api/v1",
requiresApiKey: true,
isLocal: false,
priority: 45,
},
{
key: 'shengsuanyun',
label: 'ShengsuanYun',
labelZh: 'ShengsuanYun (神算云)',
domain: 'shengsuanyun.com',
defaultApiBase:
'https://router.shengsuanyun.com/api/v1',
key: "shengsuanyun",
label: "ShengsuanYun",
labelZh: "ShengsuanYun (神算云)",
domain: "shengsuanyun.com",
defaultApiBase: "https://router.shengsuanyun.com/api/v1",
requiresApiKey: true,
isLocal: false,
priority: 44,
},
{
key: 'vivgrid',
label: 'Vivgrid',
domain: 'vivgrid.com',
defaultApiBase: 'https://api.vivgrid.com/v1',
key: "vivgrid",
label: "Vivgrid",
domain: "vivgrid.com",
defaultApiBase: "https://api.vivgrid.com/v1",
requiresApiKey: true,
isLocal: false,
priority: 43,
},
{
key: 'minimax',
label: 'MiniMax',
domain: 'minimaxi.com',
defaultApiBase: 'https://api.minimaxi.com/v1',
key: "minimax",
label: "MiniMax",
domain: "minimaxi.com",
defaultApiBase: "https://api.minimaxi.com/v1",
requiresApiKey: true,
isLocal: false,
priority: 42,
},
{
key: 'longcat',
label: 'LongCat',
domain: 'longcat.chat',
defaultApiBase: 'https://api.longcat.chat/openai',
key: "longcat",
label: "LongCat",
domain: "longcat.chat",
defaultApiBase: "https://api.longcat.chat/openai",
requiresApiKey: true,
isLocal: false,
priority: 41,
},
{
key: 'modelscope',
label: 'ModelScope',
labelZh: 'ModelScope (魔搭社区)',
domain: 'modelscope.cn',
defaultApiBase:
'https://api-inference.modelscope.cn/v1',
key: "modelscope",
label: "ModelScope",
labelZh: "ModelScope (魔搭社区)",
domain: "modelscope.cn",
defaultApiBase: "https://api-inference.modelscope.cn/v1",
requiresApiKey: true,
isLocal: false,
priority: 40,
},
{
key: 'mimo',
label: 'Xiaomi MiMo',
iconSlug: 'xiaomi',
domain: 'xiaomi.com',
defaultApiBase: 'https://api.xiaomimimo.com/v1',
key: "mimo",
label: "Xiaomi MiMo",
iconSlug: "xiaomi",
domain: "xiaomi.com",
defaultApiBase: "https://api.xiaomimimo.com/v1",
requiresApiKey: true,
isLocal: false,
priority: 39,
},
{
key: 'avian',
label: 'Avian',
domain: 'avian.io',
defaultApiBase: 'https://api.avian.io/v1',
key: "avian",
label: "Avian",
domain: "avian.io",
defaultApiBase: "https://api.avian.io/v1",
requiresApiKey: true,
isLocal: false,
priority: 38,
},
{
key: 'zai',
label: 'Z.ai',
domain: 'z.ai',
defaultApiBase: 'https://api.z.ai/api/coding/paas/v4',
key: "zai",
label: "Z.ai",
domain: "z.ai",
defaultApiBase: "https://api.z.ai/api/coding/paas/v4",
requiresApiKey: true,
isLocal: false,
priority: 37,
aliases: ['z.ai', 'z-ai'],
aliases: ["z.ai", "z-ai"],
},
{
key: 'novita',
label: 'Novita AI',
domain: 'novita.ai',
defaultApiBase: 'https://api.novita.ai/openai',
key: "novita",
label: "Novita AI",
domain: "novita.ai",
defaultApiBase: "https://api.novita.ai/openai",
requiresApiKey: true,
isLocal: false,
priority: 36,
},
{
key: 'litellm',
label: 'LiteLLM',
domain: 'litellm.ai',
defaultApiBase: 'http://localhost:4000/v1',
key: "litellm",
label: "LiteLLM",
domain: "litellm.ai",
defaultApiBase: "http://localhost:4000/v1",
requiresApiKey: true,
isLocal: false,
priority: 35,
@ -373,9 +363,7 @@ export const PROVIDER_LABELS: Record<string, string> = Object.fromEntries(
)
export const PROVIDER_ALIASES: Record<string, string> = Object.fromEntries(
PROVIDERS.flatMap((p) =>
(p.aliases || []).map((a) => [a, p.key]),
),
PROVIDERS.flatMap((p) => (p.aliases || []).map((a) => [a, p.key])),
)
export const KNOWN_PROVIDER_KEYS = new Set(PROVIDERS.map((p) => p.key))

View file

@ -93,7 +93,12 @@ interface KeyInputProps {
className?: string
}
export function KeyInput({ value, onChange, placeholder, className }: KeyInputProps) {
export function KeyInput({
value,
onChange,
placeholder,
className,
}: KeyInputProps) {
const [show, setShow] = useState(false)
return (

View file

@ -1,7 +1,6 @@
import { useEffect } from "react"
import githubDarkCss from "highlight.js/styles/github-dark.css?inline"
import githubLightCss from "highlight.js/styles/github.css?inline"
import { useEffect } from "react"
const THEME_STYLE_ID = "hljs-theme-style"
const THEME_STYLE_OWNER_ATTR = "data-picoclaw-highlight-theme"
@ -17,8 +16,9 @@ function getOrCreateThemeStyleElement(): HTMLStyleElement {
return managedStyleElement
}
const existingStyleElement =
document.querySelector<HTMLStyleElement>(ID_THEME_STYLE_SELECTOR)
const existingStyleElement = document.querySelector<HTMLStyleElement>(
ID_THEME_STYLE_SELECTOR,
)
if (existingStyleElement) {
existingStyleElement.setAttribute(
THEME_STYLE_OWNER_ATTR,