dsh-model-capability-sync 0.0.0-stage → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/LICENSE +21 -0
- package/README.md +237 -2
- package/cordis.patch.yml +8 -0
- package/lib/client.js +1168 -0
- package/lib/client.js.map +7 -0
- package/lib/index.js +445 -0
- package/lib/index.js.map +7 -0
- package/package.json +95 -4
- package/scripts/build-client.mjs +42 -0
- package/scripts/build-host.mjs +22 -0
- package/scripts/smoke.mjs +56 -0
- package/scripts/test-fields.mjs +56 -0
- package/scripts/test-locale.mjs +54 -0
- package/scripts/test-match.mjs +268 -0
- package/scripts/test-rename.mjs +88 -0
- package/scripts/test-sort.mjs +82 -0
- package/scripts/test-write-merge.mjs +104 -0
- package/scripts/verify-package.mjs +64 -0
- package/scripts/warm-cache.mjs +15 -0
- package/src/catalog.ts +204 -0
- package/src/client/SyncSection.tsx +870 -0
- package/src/client/apply.ts +257 -0
- package/src/client/index.ts +6 -0
- package/src/client/locale.ts +158 -0
- package/src/client/rename.ts +157 -0
- package/src/client/shared.ts +197 -0
- package/src/index.ts +150 -0
- package/src/mapping.ts +73 -0
- package/src/match.ts +431 -0
- package/src/sort.ts +174 -0
- package/src/types.ts +136 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/client/index.ts", "../src/client/SyncSection.tsx", "../src/sort.ts", "../src/client/shared.ts", "../src/client/rename.ts", "../src/client/locale.ts", "../src/client/apply.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Browser-half entry: the module loader imports this file and calls its\n * `apply` once the injected services exist.\n * @module dsh-model-capability-sync/client\n */\nexport { apply, inject } from './apply.ts'\n", "/**\n * The capability-sync settings section: pick the provider entry, analyze its\n * models against models.dev, review what would change, then apply.\n *\n * Pure props \u2014 no context access, no subscriptions. Everything arrives through\n * the inject face `apply` builds, including the bound translate function.\n */\nimport { useEffect, useRef, useState } from 'react'\nimport type { ReactNode } from 'react'\nimport type { CapabilityFields, LiveResponse, LiveRow, PreviewResponse, PreviewRow, RpcEnvelope } from '../types.ts'\nimport type { SortMode } from '../sort.ts'\nimport { sortByModelId } from '../sort.ts'\nimport type { ModelDraft, SettingsDescriptor, SettingsInjected, SettingsPathOp } from './shared.ts'\nimport { isBlank, mergeFields, modelsOf, parseTokenCount, providersOf, sortedModelsOf, TARGET_DEFAULT, targetLabelOf, textOf, withWrittenModels } from './shared.ts'\nimport { planNames, renameModels, redirectName } from './rename.ts'\n\n/** What `apply` injects into this component. */\nexport interface SyncSectionInjected extends SettingsInjected {\n preview(request: { ids: string[]; aliases?: Record<string, string>; names?: Record<string, string>; refresh?: boolean }): Promise<RpcEnvelope<PreviewResponse>>\n live(request: { provider: string; ids: string[] }): Promise<RpcEnvelope<LiveResponse>>\n}\n\nexport interface SyncSectionProps extends SyncSectionInjected {\n t: (key: string, params?: Record<string, unknown>) => string\n}\n\n/** One capability field that applying a row would rewrite. */\ninterface FieldChange {\n key: keyof CapabilityFields\n before: unknown\n after: unknown\n}\n\n/** One preview row joined with the stored entry it would rewrite. */\ninterface PlanRow {\n row: PreviewRow\n model: ModelDraft\n /** What a write would use: catalog values with typed ones on top. */\n fields?: CapabilityFields\n /** The subset that was typed in the table. */\n manual?: CapabilityFields\n changes: FieldChange[]\n}\n\n/** Human token count: 128000 \u2192 `128K`, 1000000 \u2192 `1M`. */\nfunction tokens(value: unknown): string {\n if (typeof value !== 'number') return '\u2014'\n if (value >= 1_000_000) return `${String(Number((value / 1_000_000).toFixed(1)))}M`\n if (value >= 1000) return `${String(Number((value / 1000).toFixed(0)))}K`\n return String(value)\n}\n\n/** Which rule produced a match, as section copy. */\nfunction viaLabel(row: PreviewRow, t: SyncSectionProps['t']): string {\n switch (row.match?.via) {\n case 'alias': return t('viaAlias')\n case 'exact': return t('viaExact')\n case 'folded': return t('viaFolded')\n case 'basename': return t('viaBasename')\n case 'suffix': return t('viaSuffix')\n case 'prefix': return t('viaPrefix')\n case 'vendor': return t('viaVendor')\n case 'spelling': return t('viaSpelling')\n case 'name': return t('viaName')\n case 'nameSuffix': return t('viaNameSuffix')\n default: return ''\n }\n}\n\n/**\n * Merge one row's capability fields into an existing model entry.\n *\n * `name` is never written: a label is the user's or the gateway's choice, and\n * renaming models is not this page's job. The host no longer returns one, and\n * the explicit skip keeps that true even against an older host build.\n * @param model - the entry as stored.\n * @param fields - catalog capabilities.\n * @param overwrite - replace values the user already set.\n * @returns a new entry; the input is never mutated.\n */\nfunction mergeModel(\n model: ModelDraft,\n fields: CapabilityFields,\n overwrite: boolean,\n manual?: CapabilityFields,\n): ModelDraft {\n const next: ModelDraft = { ...model }\n for (const [key, value] of Object.entries(fields)) {\n if (key === 'name' || value === undefined) continue\n // A value typed in the table is an instruction, not a suggestion: it is\n // applied even when the entry already holds something and \"overwrite\" is\n // off, because that switch is about the catalog replacing stored values.\n const typed = manual !== undefined && key in manual\n if (!typed && !overwrite && !isBlank(next[key])) continue\n next[key] = value\n }\n return next\n}\n\n/**\n * The fields applying one row would actually rewrite.\n * @param model - the entry as stored.\n * @param fields - catalog capabilities.\n * @param overwrite - replace values the user already set.\n * @returns one entry per changed field, in field order; empty when nothing moves.\n */\nfunction changesBetween(\n model: ModelDraft,\n fields: CapabilityFields,\n overwrite: boolean,\n manual?: CapabilityFields,\n): FieldChange[] {\n const next = mergeModel(model, fields, overwrite, manual)\n const changes: FieldChange[] = []\n for (const key of Object.keys(fields) as Array<keyof CapabilityFields>) {\n const before = model[key]\n const after = next[key]\n if (JSON.stringify(before) === JSON.stringify(after)) continue\n changes.push({ key, before, after })\n }\n return changes\n}\n\n/** The image verdict of one modality list. */\nfunction imageText(value: unknown, t: SyncSectionProps['t']): string {\n if (Array.isArray(value) && value.includes('image')) return t('imageYes')\n if (isBlank(value)) return t('fieldEmpty')\n return t('imageNo')\n}\n\n/** The reasoning verdict of one effort value. */\nfunction reasoningText(value: unknown): string {\n if (value === false) return 'off'\n if (typeof value === 'object' && value !== null && !Array.isArray(value)) {\n const keys = Object.keys(value as Record<string, unknown>)\n return keys.length === 0 ? '\u2014' : keys.join(' / ')\n }\n return '\u2014'\n}\n\n/**\n * Which option the image select should show.\n * @param value - the effective modality list, manual or stored.\n * @returns `yes`, `no`, or `default` when it is not set.\n */\nfunction imageChoice(value: unknown): 'yes' | 'no' | 'default' {\n if (Array.isArray(value) && value.includes('image')) return 'yes'\n if (isBlank(value)) return 'default'\n return 'no'\n}\n\n/** The image verdict the owning adapter reports right now. */\nfunction liveLabel(row: LiveRow | undefined, t: SyncSectionProps['t']): string {\n if (row === undefined) return '\u2014'\n if (row.error !== undefined) return t('liveError')\n if (row.input === undefined) return '\u2014'\n return row.input.includes('image') ? t('imageYes') : t('imageNo')\n}\n\n/**\n * One value cell: the stored value alone, or `before \u2192 after` when it moves.\n * @param change - the change for this field, when there is one.\n * @param current - the stored value.\n * @param format - renders one value as section copy.\n * @returns the cell body.\n */\nfunction valueCell(change: FieldChange | undefined, current: unknown, format: (value: unknown) => string): ReactNode {\n if (change === undefined) return <span className=\"cs-dim\">{format(current)}</span>\n return (\n <span className=\"cs-change\">\n <span className=\"cs-from\">{format(change.before)}</span>\n {' \u2192 '}{format(change.after)}\n </span>\n )\n}\n\n/**\n * An editable capability cell: the stored value, with a box to override it.\n *\n * The catalog is a suggestion. A proxy route may need a smaller window than the\n * upstream model advertises, and a model the catalog never listed has no\n * values at all \u2014 so every number here is also typeable, and a typed value\n * shows next to the catalog one instead of replacing what the catalog said.\n * @param props - the field, its values and the change for this row.\n * @returns the cell body.\n */\nfunction EditableNumber(props: {\n field: 'contextWindow' | 'maxTokens'\n model: ModelDraft\n manual?: CapabilityFields\n change?: FieldChange\n label: string\n onType: (value: number | undefined) => void\n}): ReactNode {\n const { field, model, manual, change, label, onType } = props\n const typed = manual?.[field]\n const shown = typed !== undefined ? String(typed) : change === undefined ? '' : String(model[field] ?? '')\n return (\n <span className=\"cs-cell\">\n {change === undefined\n ? null\n : (\n <span className=\"cs-change\">\n <span className=\"cs-from\">{tokens(change.before)}</span>\n {' \u2192 '}{tokens(change.after)}\n </span>\n )}\n <input\n className={typed !== undefined ? 'cs-input cs-input--cell cs-input--typed' : 'cs-input cs-input--cell'}\n aria-label={label}\n inputMode=\"numeric\"\n value={typed !== undefined ? String(typed) : change === undefined ? (isBlank(model[field]) ? '' : tokens(model[field])) : ''}\n placeholder={change === undefined ? tokens(model[field]) : tokens(change.after)}\n onChange={(event) => { onType(parseTokenCount(event.target.value)) }}\n />\n </span>\n )\n}\n\n/**\n * Render the section.\n * @param props - injected wire face plus the bound translate function.\n * @returns the section body.\n */\nexport function SyncSection(props: SyncSectionProps): ReactNode {\n const { t, preview, live, describeSettings, mutateSettings } = props\n const [status, setStatus] = useState<'loading' | 'ready' | 'error'>('loading')\n const [errorText, setErrorText] = useState<string | undefined>(undefined)\n const [descriptors, setDescriptors] = useState<SettingsDescriptor[]>([])\n const [targetNs, setTargetNs] = useState(TARGET_DEFAULT)\n const [providerKey, setProviderKey] = useState('')\n const [models, setModels] = useState<ModelDraft[]>([])\n /**\n * The same list as `models`, readable synchronously.\n *\n * Two writes in a row (rename, then reorder) run before React has committed\n * the first `setModels`, so the second handler would sort the pre-rename list\n * and write the old names back. Reading the ref instead of the state closes\n * that gap.\n */\n const modelsRef = useRef<ModelDraft[]>([])\n const [rows, setRows] = useState<PreviewRow[] | undefined>(undefined)\n /**\n * Values typed into the table, keyed by model id then field.\n *\n * Held apart from `models` so an edit survives re-analysis: the catalog is a\n * source of suggestions, and re-querying it must not discard what a person\n * decided the entry should say.\n */\n const [typed, setTyped] = useState<ReadonlyMap<string, CapabilityFields>>(new Map())\n const [liveRows, setLiveRows] = useState<ReadonlyMap<string, LiveRow>>(new Map())\n const [selected, setSelected] = useState<ReadonlySet<string>>(new Set())\n const [overwrite, setOverwrite] = useState(false)\n const [query, setQuery] = useState('')\n const [onlyChanged, setOnlyChanged] = useState(false)\n const [sortMode, setSortMode] = useState<SortMode>('prefix')\n const [renaming, setRenaming] = useState(false)\n const [reordering, setReordering] = useState(false)\n const [busy, setBusy] = useState<'idle' | 'analyzing' | 'applying'>('idle')\n const [notice, setNotice] = useState<string | undefined>(undefined)\n const [catalogInfo, setCatalogInfo] = useState<string | undefined>(undefined)\n const [staleInfo, setStaleInfo] = useState<string | undefined>(undefined)\n\n /** Everything a write would touch, joined with the stored entries. */\n const plan: PlanRow[] = (() => {\n if (rows === undefined) return []\n const stored = new Map(models.map(model => [textOf(model, 'id'), model]))\n return rows.map((row) => {\n const model = stored.get(row.id) ?? {}\n const manual = typed.get(row.id)\n const fields = mergeFields(row.fields, manual)\n return {\n row,\n model,\n ...fields === undefined ? {} : { fields },\n ...manual === undefined ? {} : { manual },\n changes: fields === undefined ? [] : changesBetween(model, fields, overwrite, manual),\n }\n })\n })()\n // A row with no catalog entry is still workable: the whole entry can be\n // typed by hand, which is the point of the editable cells.\n const matched = plan.filter(entry => entry.fields !== undefined)\n const unmatched = plan.filter(entry => entry.fields === undefined)\n const changing = matched.filter(entry => entry.changes.length > 0)\n const changeFields = changing.reduce((total, entry) => total + entry.changes.length, 0)\n const liveImage = matched.filter(entry => liveRows.get(entry.row.id)?.input?.includes('image') === true).length\n const liveText = matched.filter((entry) => {\n const answer = liveRows.get(entry.row.id)\n return answer?.input !== undefined && !answer.input.includes('image')\n }).length\n\n /** Read every configurable entry and select the default target. */\n const load = async (mode: SortMode = sortMode): Promise<void> => {\n setStatus('loading')\n setErrorText(undefined)\n try {\n const list = await describeSettings()\n setDescriptors(list)\n const candidates = list.filter(entry => Object.keys(providersOf(entry)).length > 0)\n const target = candidates.find(entry => entry.ns === TARGET_DEFAULT) ?? candidates[0]\n if (target === undefined) {\n setStatus('error')\n setErrorText(t('noTarget'))\n return\n }\n const providers = providersOf(target)\n const firstKey = Object.keys(providers)[0] ?? ''\n setTargetNs(target.ns)\n setProviderKey(firstKey)\n putModels(sortedModelsOf(providers[firstKey], mode))\n setRows(undefined)\n setLiveRows(new Map())\n setSelected(new Set())\n setQuery('')\n setStatus('ready')\n } catch (error) {\n setStatus('error')\n setErrorText(error instanceof Error ? error.message : String(error))\n }\n }\n\n useEffect(() => { void load() }, [])\n\n /** Show one provider's models, in display order, with a clean slate. */\n const showProvider = (ns: string, key: string, mode: SortMode = sortMode): void => {\n const providers = providersOf(descriptors.find(entry => entry.ns === ns))\n const resolved = key !== '' && providers[key] !== undefined ? key : Object.keys(providers)[0] ?? ''\n setTargetNs(ns)\n setProviderKey(resolved)\n putModels(sortedModelsOf(providers[resolved], mode))\n setRows(undefined)\n setLiveRows(new Map())\n setSelected(new Set())\n setNotice(undefined)\n setQuery('')\n }\n\n /** Ask the owning adapter what a request sees for these ids. */\n const refreshLive = async (provider: string, ids: string[]): Promise<void> => {\n try {\n const answer = await live({ provider, ids })\n setLiveRows(answer.ok ? new Map(answer.value.rows.map(row => [row.id, row])) : new Map())\n } catch {\n setLiveRows(new Map())\n }\n }\n\n /** Re-read the configuration without losing the analysis on screen. */\n const reloadConfig = async (): Promise<void> => {\n const list = await describeSettings()\n setDescriptors(list)\n const descriptor = list.find(entry => entry.ns === targetNs)\n if (descriptor !== undefined) putModels(sortedModelsOf(providersOf(descriptor)[providerKey], sortMode))\n }\n\n /** Preselect every row that would actually change. */\n const selectChanging = (source: readonly PreviewRow[], stored: readonly ModelDraft[], mode: boolean): void => {\n const byId = new Map(stored.map(model => [textOf(model, 'id'), model]))\n setSelected(new Set(source\n .filter(row => row.fields !== undefined && changesBetween(byId.get(row.id) ?? {}, row.fields, mode).length > 0)\n .map(row => row.id)))\n }\n\n /** Resolve every configured id against the catalog. */\n const analyze = async (refresh: boolean): Promise<void> => {\n setBusy('analyzing')\n setErrorText(undefined)\n setNotice(undefined)\n setStaleInfo(undefined)\n try {\n const ids = models.map(model => textOf(model, 'id')).filter(id => id.length > 0)\n // Names travel with the ids: a gateway may hide the model behind an\n // opaque id (`qoder/qfmodel` for Qwen3.8-Flash), and the label is the\n // only place the real model shows up. Sending them makes the id-only\n // rows resolvable, and since the host strips source annotations, a\n // renamed label resolves exactly like the original.\n const names: Record<string, string> = {}\n for (const model of models) {\n const id = textOf(model, 'id')\n const name = textOf(model, 'name')\n if (id !== '' && name !== '' && name !== id) names[id] = name\n }\n const result = await preview({\n ids,\n ...Object.keys(names).length > 0 ? { names } : {},\n ...refresh ? { refresh: true } : {},\n })\n if (!result.ok) throw new Error(result.error.message)\n setRows(result.value.rows)\n selectChanging(result.value.rows, models, overwrite)\n setCatalogInfo(t('catalogInfo', {\n models: result.value.catalogModels,\n time: new Date(result.value.fetchedAt).toLocaleString(),\n }))\n setStaleInfo(result.value.stale === true\n ? t('catalogStale', { time: new Date(result.value.fetchedAt).toLocaleString() })\n : undefined)\n // The entry we are about to write may not be the route a request takes,\n // so this is the only honest answer to \"did the write take effect\".\n await refreshLive(providerKey, ids)\n } catch (error) {\n setErrorText(error instanceof Error ? error.message : String(error))\n } finally {\n setBusy('idle')\n }\n }\n\n /**\n * Switch the ordering and re-sort the list on screen.\n *\n * The analysis is kept: the mode only changes the order of the same entries,\n * so re-querying the catalog would only cost time. Rows are re-read from the\n * stored order, not from the sorted array, so switching back is exact.\n */\n const setSortModeAndApply = (mode: SortMode): void => {\n setSortMode(mode)\n const descriptor = descriptors.find(entry => entry.ns === targetNs)\n if (descriptor !== undefined) putModels(sortedModelsOf(providersOf(descriptor)[providerKey], mode))\n }\n\n /** Switch the overwrite mode and follow it with the selection. */\n const setOverwriteMode = (mode: boolean): void => {\n setOverwrite(mode)\n if (rows === undefined) return\n selectChanging(rows, models, mode)\n }\n\n /**\n * Replace the model list, keeping the synchronous mirror in step.\n *\n * All writers and loaders go through this so `modelsRef.current` is always\n * the list the latest render would show.\n * @param next - the list to show.\n */\n const putModels = (next: ModelDraft[]): void => {\n modelsRef.current = next\n setModels(next)\n }\n\n /**\n * Record a successful write: the new list and its revision replace what the\n * held descriptor says, and the on-screen list follows.\n *\n * Without this the descriptor kept the pre-write models while `models` held\n * the new ones, so anything that rebuilt the list from the descriptor \u2014 a\n * sort-mode switch, a provider switch, a conflict reload \u2014 put the old names\n * back. That is the \"rename then reorder loses the names\" report.\n * @param ordered - the list that was just written.\n * @param view - the namespace view the settings service answered with.\n */\n const commitWrite = (ordered: ModelDraft[], view: SettingsDescriptor): void => {\n putModels(ordered)\n setDescriptors(previous => previous.map(entry =>\n entry.ns === targetNs\n ? withWrittenModels(entry, providerKey, ordered, view.revision)\n : entry))\n }\n\n /** Rename all models that would change: one-shot action. */\n const doRename = async (): Promise<void> => {\n const descriptor = descriptors.find(entry => entry.ns === targetNs)\n if (descriptor === undefined) return\n // Read the live list: a write may have landed since the last render.\n const live = modelsRef.current\n // Auto-redirect now applies to ALL models, not just those with changes\n const targets = new Set(live.map(model => textOf(model, 'id')))\n if (targets.size === 0) {\n setNotice(t('redirectNoChanges'))\n return\n }\n const renamed = renameModels(live, targets)\n setRenaming(true)\n setErrorText(undefined)\n setNotice(undefined)\n try {\n const ordered = sortByModelId(renamed.next, model => textOf(model, 'id'), model => textOf(model, 'name'), sortMode)\n const view = await mutateSettings(targetNs, [{\n op: 'set',\n path: ['providers', providerKey, 'models'],\n value: ordered,\n }], descriptor.revision)\n commitWrite(ordered, view)\n setNotice(`${t('redirectApplied', { count: renamed.written })}`)\n } catch (error) {\n setErrorText(error instanceof Error ? error.message : String(error))\n } finally {\n setRenaming(false)\n }\n }\n\n /** Reorder models to match the chosen sort mode. */\n const doReorder = async (): Promise<void> => {\n const descriptor = descriptors.find(entry => entry.ns === targetNs)\n if (descriptor === undefined) return\n setReordering(true)\n setErrorText(undefined)\n setNotice(undefined)\n try {\n const ordered = sortByModelId(modelsRef.current, model => textOf(model, 'id'), model => textOf(model, 'name'), sortMode)\n const view = await mutateSettings(targetNs, [{\n op: 'set',\n path: ['providers', providerKey, 'models'],\n value: ordered,\n }], descriptor.revision)\n commitWrite(ordered, view)\n setNotice(t('reordered'))\n } catch (error) {\n setErrorText(error instanceof Error ? error.message : String(error))\n } finally {\n setReordering(false)\n }\n }\n\n /**\n * Record one typed value for a model, or clear it when the box is emptied.\n * @param id - the gateway model id.\n * @param key - which capability field.\n * @param value - the parsed value, or undefined to drop the manual entry.\n */\n const typeField = (id: string, key: keyof CapabilityFields, value: unknown): void => {\n setTyped((previous) => {\n const next = new Map(previous)\n const current: CapabilityFields = next.get(id) ?? {}\n const updated = { ...current } as Record<string, unknown>\n if (value === undefined) delete updated[key]\n else updated[key] = value\n if (Object.keys(updated).length === 0) next.delete(id)\n else next.set(id, updated as CapabilityFields)\n return next\n })\n }\n\n /** Write the selected rows into the provider entry. */\n const applyRows = async (): Promise<void> => {\n const descriptor = descriptors.find(entry => entry.ns === targetNs)\n if (descriptor === undefined) return\n const targets = new Map(changing\n .filter(entry => selected.has(entry.row.id) && entry.fields !== undefined)\n .map(entry => [entry.row.id, entry]))\n if (targets.size === 0) {\n setNotice(t('nothingSelected'))\n return\n }\n let written = 0\n const next = modelsRef.current.map((model) => {\n const entry = targets.get(textOf(model, 'id'))\n if (entry?.fields === undefined) return model\n written += 1\n return mergeModel(model, entry.fields, overwrite, entry.manual)\n })\n setBusy('applying')\n setErrorText(undefined)\n setNotice(undefined)\n try {\n // The order is written with the rows: it is a choice the user made\n // about the list, not an artifact of how the page happened to load.\n const ordered = sortByModelId(next, model => textOf(model, 'id'), model => textOf(model, 'name'), sortMode)\n const view = await mutateSettings(targetNs, [{\n op: 'set',\n path: ['providers', providerKey, 'models'],\n value: ordered,\n }], descriptor.revision)\n commitWrite(ordered, view)\n setNotice(t('applied', { count: written }))\n await refreshLive(providerKey, next.map(model => textOf(model, 'id')).filter(id => id.length > 0))\n } catch (error) {\n const code = (error as { code?: string } | undefined)?.code\n if (code === 'settings/conflict') {\n // Someone else wrote this entry while the page was open. Reload the\n // baseline instead of retrying blindly: a silent retry would overwrite\n // whatever they just saved.\n try {\n await reloadConfig()\n } catch {\n // Keep the conflict message; the reload is only a convenience.\n }\n setNotice(t('conflictReload'))\n } else {\n setErrorText(error instanceof Error ? error.message : String(error))\n }\n } finally {\n setBusy('idle')\n }\n }\n\n if (status === 'loading') return <div className=\"cs-hint\">{t('loading')}</div>\n\n if (status === 'error') {\n return (\n <div className=\"cs-field\">\n <p className=\"cs-error\">{t('loadFailed')}: {errorText}</p>\n <button type=\"button\" className=\"cs-button\" onClick={() => { void load() }}>{t('retry')}</button>\n </div>\n )\n }\n\n const descriptor = descriptors.find(entry => entry.ns === targetNs)\n const candidates = descriptors.filter(entry => Object.keys(providersOf(entry)).length > 0)\n const providerKeys = Object.keys(providersOf(descriptor))\n const needle = query.trim().toLowerCase()\n const visible = plan.filter((entry) => {\n if (onlyChanged && entry.changes.length === 0) return false\n if (needle === '') return true\n return entry.row.id.toLowerCase().includes(needle)\n || entry.row.match?.modelId.toLowerCase().includes(needle) === true\n })\n const selectable = visible.filter(entry => entry.changes.length > 0)\n const toggle = (id: string): void => {\n const next = new Set(selected)\n if (next.has(id)) next.delete(id)\n else next.add(id)\n setSelected(next)\n }\n\n return (\n <div>\n <p className=\"cs-hint\">{t('intro')}</p>\n\n <div className=\"cs-row\">\n {candidates.length > 1\n ? (\n <label className=\"cs-field\">\n <span className=\"cs-hint\">{t('writeTarget')}</span>\n <select className=\"cs-select\" value={targetNs} onChange={(event) => { showProvider(event.target.value, '') }}>\n {candidates.map(entry => (\n <option key={entry.ns} value={entry.ns}>{targetLabelOf(entry.ns, t)}</option>\n ))}\n </select>\n </label>\n )\n : (\n <div className=\"cs-field\" title={targetNs}>\n <span className=\"cs-hint\">{t('writeTarget')}</span>\n <span className=\"cs-target\">{targetLabelOf(targetNs, t)}</span>\n </div>\n )}\n <label className=\"cs-field\">\n <span className=\"cs-hint\">{t('provider')}</span>\n <select className=\"cs-select\" value={providerKey} onChange={(event) => { showProvider(targetNs, event.target.value) }}>\n {providerKeys.map(key => <option key={key} value={key}>{key}</option>)}\n </select>\n </label>\n <span className=\"cs-hint\">{t('modelCount', { count: models.length })}</span>\n <label className=\"cs-field\">\n <span className=\"cs-hint\">{t('sortMode')}</span>\n <select\n className=\"cs-select\"\n value={sortMode}\n onChange={(event) => { setSortModeAndApply(event.target.value as SortMode) }}\n >\n <option value=\"prefix\">{t('sortByPrefix')}</option>\n <option value=\"redirected\">{t('sortByRedirected')}</option>\n </select>\n </label>\n <span className=\"cs-hint\">{t('willSort')}</span>\n </div>\n\n {models.length === 0\n ? <p className=\"cs-hint\">{t('noModels')}</p>\n : (\n <div className=\"cs-row\">\n <button type=\"button\" className=\"cs-button cs-button--primary\" disabled={busy !== 'idle'} onClick={() => { void analyze(false) }}>\n {busy === 'analyzing' ? t('analyzing') : t('analyze')}\n </button>\n <button type=\"button\" className=\"cs-button\" disabled={busy !== 'idle'} onClick={() => { void analyze(true) }}>\n {t('refreshCatalog')}\n </button>\n <label className=\"cs-hint\" title={t('overwriteHint')}>\n <input type=\"checkbox\" checked={overwrite} onChange={(event) => { setOverwriteMode(event.target.checked) }} />\n {' '}{t('overwrite')}\n </label>\n <button\n type=\"button\"\n className=\"cs-button\"\n disabled={renaming}\n onClick={() => { void doRename() }}\n >\n {renaming ? t('redirectApplying') : t('redirectApply')}\n </button>\n <button\n type=\"button\"\n className=\"cs-button\"\n disabled={reordering}\n onClick={() => { void doReorder() }}\n >\n {reordering ? t('reordering') : t('reorder')}\n </button>\n </div>\n )}\n\n {errorText !== undefined ? <p className=\"cs-error\">{errorText}</p> : null}\n {notice !== undefined ? <p className=\"cs-hint\">{notice}</p> : null}\n {catalogInfo !== undefined ? <p className=\"cs-hint\">{catalogInfo}</p> : null}\n {staleInfo !== undefined ? <p className=\"cs-warn\">{staleInfo}</p> : null}\n\n {rows !== undefined && plan.length > 0\n ? (\n <>\n <p className=\"cs-hint\">{t('editHint')}</p>\n <div className=\"cs-row\">\n <input\n className=\"cs-input\"\n type=\"search\"\n value={query}\n placeholder={t('search')}\n onChange={(event) => { setQuery(event.target.value) }}\n />\n <label className=\"cs-hint\">\n <input type=\"checkbox\" checked={onlyChanged} onChange={(event) => { setOnlyChanged(event.target.checked) }} />\n {' '}{t('onlyChanged')}\n </label>\n <span className=\"cs-hint\">\n {changing.length === 0\n ? t('noChanges')\n : t('changeSummary', { rows: changing.length, fields: changeFields })}\n </span>\n </div>\n\n {visible.length === 0\n ? <p className=\"cs-hint\">{t('filteredEmpty')}</p>\n : (\n <div className=\"cs-table-wrap\">\n <table className=\"cs-table\">\n <colgroup>\n <col className=\"cs-col-check\" />\n <col className=\"cs-col-id\" />\n <col className=\"cs-col-name\" />\n <col className=\"cs-col-match\" />\n <col className=\"cs-col-context\" />\n <col className=\"cs-col-output\" />\n <col className=\"cs-col-image\" />\n <col className=\"cs-col-live\" />\n <col className=\"cs-col-reasoning\" />\n </colgroup>\n <thead>\n <tr>\n <th>\n <input\n type=\"checkbox\"\n aria-label={t('selectAll')}\n checked={selectable.length > 0 && selectable.every(entry => selected.has(entry.row.id))}\n onChange={(event) => {\n const keep = event.target.checked ? new Set(selectable.map(entry => entry.row.id)) : new Set<string>()\n setSelected(keep)\n }}\n />\n </th>\n <th>{t('colModel')}</th>\n <th>{t('colName')}</th>\n <th>{t('colMatch')}</th>\n <th>{t('colContext')}</th>\n <th>{t('colOutput')}</th>\n <th>{t('colImage')}</th>\n <th title={t('colLiveHint')}>{t('colLive')}</th>\n <th>{t('colReasoning')}</th>\n </tr>\n </thead>\n <tbody>\n {visible.map((entry) => {\n const { row, model, changes } = entry\n const changeOf = (key: keyof CapabilityFields): FieldChange | undefined =>\n changes.find(change => change.key === key)\n return (\n <tr key={row.id} className={changes.length > 0 ? 'cs-row--changed' : undefined}>\n <td>\n <input\n type=\"checkbox\"\n aria-label={row.id}\n checked={selected.has(row.id)}\n disabled={changes.length === 0}\n onChange={() => { toggle(row.id) }}\n />\n </td>\n <td className=\"cs-id\">{row.id}</td>\n <td>\n {redirectName(row.id, textOf(model, 'name')).after}\n </td>\n <td className=\"cs-dim\">\n {row.match === undefined\n ? <span className=\"cs-badge\">{t('notListed')}</span>\n : (\n <>\n {`${row.match.provider}/${row.match.modelId}`}\n {' '}<span className=\"cs-badge\">{viaLabel(row, t)}</span>\n </>\n )}\n </td>\n <td>\n <EditableNumber\n field=\"contextWindow\"\n label={`${row.id} ${t('colContext')}`}\n model={model}\n manual={entry.manual}\n change={changeOf('contextWindow')}\n onType={(value) => { typeField(row.id, 'contextWindow', value) }}\n />\n </td>\n <td>\n <EditableNumber\n field=\"maxTokens\"\n label={`${row.id} ${t('colOutput')}`}\n model={model}\n manual={entry.manual}\n change={changeOf('maxTokens')}\n onType={(value) => { typeField(row.id, 'maxTokens', value) }}\n />\n </td>\n <td>\n <select\n className={entry.manual?.input === undefined ? 'cs-select cs-select--cell' : 'cs-select cs-select--cell cs-select--typed'}\n aria-label={`${row.id} ${t('colImage')}`}\n value={imageChoice(entry.manual?.input ?? model.input)}\n onChange={(event) => {\n const choice = event.target.value\n typeField(row.id, 'input', choice === 'default'\n ? undefined\n : choice === 'yes' ? ['text', 'image'] : ['text'])\n }}\n >\n <option value=\"default\">{imageText(model.input, t)}</option>\n <option value=\"yes\">{t('imageYes')}</option>\n <option value=\"no\">{t('imageNo')}</option>\n </select>\n {changeOf('input') === undefined\n ? null\n : (\n <span className=\"cs-change cs-change--block\">\n <span className=\"cs-from\">{imageText(changeOf('input')?.before, t)}</span>\n {' \u2192 '}{imageText(changeOf('input')?.after, t)}\n </span>\n )}\n </td>\n <td>\n <span className={liveRows.get(row.id)?.input?.includes('image') === true ? 'cs-badge cs-badge--image' : 'cs-dim'}>\n {liveLabel(liveRows.get(row.id), t)}\n </span>\n </td>\n <td className=\"cs-dim\">\n {valueCell(changeOf('reasoningEfforts'), model.reasoningEfforts, reasoningText)}\n </td>\n </tr>\n )\n })}\n </tbody>\n </table>\n </div>\n )}\n\n {liveRows.size > 0\n ? <p className=\"cs-hint\">{t('liveSummary', { image: liveImage, text: liveText })}</p>\n : null}\n <div className=\"cs-row\">\n <button\n type=\"button\"\n className=\"cs-button cs-button--primary\"\n disabled={busy !== 'idle' || !changing.some(entry => selected.has(entry.row.id))}\n onClick={() => { void applyRows() }}\n >\n {busy === 'applying' ? t('applying') : t('apply')}\n </button>\n </div>\n </>\n )\n : null}\n\n {unmatched.length > 0 ? <p className=\"cs-hint\">{t('unmatchedHint', { count: unmatched.length })}</p> : null}\n </div>\n )\n}\n", "/**\n * Ordering for one provider's model list.\n *\n * A gateway id carries its vendor as a path prefix (`qoder-gj/Qwen3.8-Flash`),\n * so sorting on the whole id would group by nothing useful: the model family\n * is the part after the slash, and the vendor is what a reader scans for.\n *\n * Two orders are offered, because two different questions get asked of the\n * same list. `prefix` groups by vendor -- the right shape when the list is\n * arranged around who serves what. `redirected` sorts on the name a picker\n * shows once the source prefix has been moved to the end\n * (`Qwen3.8-Flash\u3010qoder\u3011`, literally with full-width brackets),\n * which reads as one alphabetical model list instead of one silo per vendor.\n *\n * Comparison is case-insensitive, with the raw id as the final tie-break, so\n * two runs on the same configuration always produce the same array.\n * @module dsh-model-capability-sync/sort\n */\n\n/** How a model list is ordered. */\nexport type SortMode = 'prefix' | 'redirected'\n\n\n/** The two ordering keys of one id: the vendor group, then the model name. */\nexport interface ModelSortKey {\n /** The prefix before the last slash, or the whole id when there is none. */\n group: string\n /** The part after the last slash, or the whole id when there is none. */\n name: string\n}\n\n/**\n * Split one id into its ordering keys.\n * @param id - the gateway model id exactly as configured.\n * @returns folded keys; the caller compares them, never displays them.\n */\nexport function modelSortKey(id: string): ModelSortKey {\n const slash = id.lastIndexOf('/')\n if (slash === -1) {\n const folded = id.toLowerCase()\n return { group: folded, name: folded }\n }\n return { group: id.slice(0, slash).toLowerCase(), name: id.slice(slash + 1).toLowerCase() }\n}\n\n/**\n * The prefix a redirect would append, i.e. the vendor segment of the id.\n * @param id - the gateway model id exactly as configured.\n * @returns the first path segment, or `''` when the id has none.\n */\nexport function sourcePrefix(id: string): string {\n const slash = id.indexOf('/')\n return slash <= 0 ? '' : id.slice(0, slash)\n}\n\n/**\n * The redirected sort key for one model: the source prefix (in brackets) as the primary key.\n *\n * When models are redirected to have the source prefix at the beginning in full-width\n * brackets (`\u3010workbuddy\u3011 GLM-5.3-Flash`), a natural sort is to group by that\n * prefix first (so all `\u3010workbuddy\u3011` together), then sort within the group by\n * the model name. Models without a source prefix use `\u3010other\u3011` as their group.\n * This gives the appearance of a list organized by vendor, with a readable name\n * for each.\n *\n * The prefix is extracted from the displayed name if present; if absent,\n * the ID prefix is used (or 'other' if the ID has no prefix).\n *\n * @param id - the gateway model id exactly as configured.\n * @param name - the configured display name; `''` when unset.\n * @returns a tuple `[prefix, modelName]` for two-level sort: first by prefix,\n * then by name, both lower-cased.\n */\nexport function redirectedSortKey(id: string, name: string): [string, string] {\n const idPrefix = sourcePrefix(id)\n const displayName = name !== '' ? name : id\n\n // Extract the bracketed prefix from the beginning or end of the display name.\n // Patterns: \u3010vendor\u3011 (new, at start), (vendor) at start, or [vendor]\n let extracted = ''\n let cleaned = displayName\n\n // Try leading full-width \u3010vendor\u3011 first (the new format)\n const leadingFullWidthMatch = displayName.match(/^\u3010([^\u3011]+)\u3011\\s*/)\n if (leadingFullWidthMatch) {\n extracted = leadingFullWidthMatch[1] ?? ''\n cleaned = displayName.slice(leadingFullWidthMatch[0].length).trim()\n } else {\n // Try trailing full-width \u3010vendor\u3011 (old format, backward compatibility)\n const trailingFullWidthMatch = displayName.match(/\u3010([^\u3011]+)\u3011\\s*$/)\n if (trailingFullWidthMatch) {\n extracted = trailingFullWidthMatch[1] ?? ''\n cleaned = displayName.slice(0, -trailingFullWidthMatch[0].length).trim()\n } else {\n // Try half-width () or [] at any position\n const halfWidthMatch = displayName.match(/[([]\\s*([^)\\]]*)\\s*[)\\]]\\s*/)\n if (halfWidthMatch) {\n extracted = halfWidthMatch[1] ?? ''\n // Remove the matched half-width from cleaned\n cleaned = displayName.replace(halfWidthMatch[0], '').trim()\n }\n }\n }\n\n // If no prefix was found in the name, use the ID prefix (or 'other' if none)\n const sortPrefix = extracted !== '' ? extracted : (idPrefix !== '' ? idPrefix : 'other')\n // If the cleaned name is empty, use the ID without its prefix as fallback\n const sortName = cleaned !== '' ? cleaned : (idPrefix !== '' ? id.slice(idPrefix.length + 1) : id)\n\n return [sortPrefix.toLowerCase(), sortName.toLowerCase()]\n}\n\n/**\n * Compare two ids in display order.\n * @param left - first id.\n * @param right - second id.\n * @returns negative when `left` sorts first, positive when `right` does.\n */\nexport function compareModelIds(left: string, right: string): number {\n const a = modelSortKey(left)\n const b = modelSortKey(right)\n if (a.group !== b.group) return a.group < b.group ? -1 : 1\n if (a.name !== b.name) return a.name < b.name ? -1 : 1\n // Same folded pair: keep the raw spelling as the tie-break so the result is\n // deterministic instead of depending on the input order.\n if (left === right) return 0\n return left < right ? -1 : 1\n}\n\n/**\n * Compare two ids as `redirected` order would list them: group by source\n * prefix (from the bracketed annotation), then sort by model name within group.\n * @param left - first id.\n * @param right - second id.\n * @param nameOf - reads one id's display name.\n * @returns negative when `left` sorts first, positive when `right` does.\n */\nexport function compareRedirected(\n left: string,\n right: string,\n nameOf: (id: string) => string,\n): number {\n const [aPrefix, aName] = redirectedSortKey(left, nameOf(left))\n const [bPrefix, bName] = redirectedSortKey(right, nameOf(right))\n // Primary sort: by prefix (vendor)\n if (aPrefix !== bPrefix) return aPrefix < bPrefix ? -1 : 1\n // Secondary sort: by model name within the same prefix\n if (aName !== bName) return aName < bName ? -1 : 1\n // Tie-break: raw IDs for determinism\n if (left === right) return 0\n return left < right ? -1 : 1\n}\n\n/**\n * Return a sorted copy of a model list.\n * @param items - entries in any order; the input array is never mutated.\n * @param idOf - reads the model id out of one entry.\n * @param nameOf - reads the display name out of one entry.\n * @param mode - `prefix` (vendor groups) or `redirected` (shown label).\n * @returns the entries in the requested order.\n */\nexport function sortByModelId<T>(\n items: readonly T[],\n idOf: (item: T) => string,\n nameOf: (item: T) => string = () => '',\n mode: SortMode = 'prefix',\n): T[] {\n const copy = [...items]\n if (mode === 'redirected') {\n const names = new Map(copy.map(item => [idOf(item), nameOf(item)] as const))\n return copy.sort((left, right) => compareRedirected(idOf(left), idOf(right), id => names.get(id) ?? ''))\n }\n return copy.sort((left, right) => compareModelIds(idOf(left), idOf(right)))\n}\n", "/**\n * Settings shapes and provider-entry helpers shared by the plugin's two\n * settings sections: capability sync and name redirect.\n *\n * The browser half only sees `settings.describe` / `settings.mutate`, and that\n * document is structurally open \u2014 these helpers keep every unknown field alive\n * instead of narrowing the entry to the fields this plugin understands.\n * @module dsh-model-capability-sync/client/shared\n */\nimport type { CapabilityFields } from '../types.ts'\nimport type { SortMode } from '../sort.ts'\nimport { sortByModelId } from '../sort.ts'\n\n/** One settings descriptor as the remote reports it (only the fields used here). */\nexport interface SettingsDescriptor {\n ns: string\n revision: number\n value: Record<string, unknown>\n}\n\n/** One ordered form edit understood by `settings.mutate`. */\nexport interface SettingsPathOp {\n op: 'set' | 'unset'\n path: string[]\n value?: unknown\n}\n\n/** The settings surface both sections read and write through. */\nexport interface SettingsInjected {\n describeSettings(): Promise<SettingsDescriptor[]>\n mutateSettings(ns: string, ops: SettingsPathOp[], expectedRevision?: number): Promise<SettingsDescriptor>\n}\n\n/** A model entry as the provider stores it: structurally open, so unknown fields survive. */\nexport type ModelDraft = Record<string, unknown>\n\n/** The official adapter this plugin fills capabilities into. */\nexport const TARGET_DEFAULT = 'llm-pi-ai'\n\n/**\n * How a writable settings namespace reads to a person.\n *\n * A namespace id is an internal identity, so the page names the thing it\n * configures instead. Provenance is a table, not a guess: the client cannot\n * see which package owns a namespace (`settings.describe` reports only\n * `ns/revision/value/base/user`), and inferring \"official\" from an `llm-`\n * prefix would eventually mislabel a third-party plugin. A namespace this\n * table does not know is shown as a plugin, with its id.\n */\nexport const TARGET_DIRECTORY: Record<string, { native: boolean; nameKey: string }> = {\n 'llm-pi-ai': { native: true, nameKey: 'nameLlmPiAi' },\n 'llm-deepseek': { native: true, nameKey: 'nameLlmDeepseek' },\n 'llm-deepseek-account': { native: true, nameKey: 'nameLlmDeepseekAccount' },\n 'llm-newapi': { native: false, nameKey: 'nameLlmNewapi' },\n}\n\n/** The bound translate function the shell hands to a section. */\nexport type Translate = (key: string, params?: Record<string, unknown>) => string\n\n/**\n * Render one namespace as provenance plus a name.\n * @param ns - the settings namespace id.\n * @param t - the bound translate function.\n * @returns copy such as `\u539F\u751F\u914D\u7F6E \u00B7 pi-ai`, never a bare namespace id.\n */\nexport function targetLabelOf(ns: string, t: Translate): string {\n const known = TARGET_DIRECTORY[ns]\n if (known === undefined) return `${t('sourcePlugin')} \u00B7 ${ns}`\n return `${known.native ? t('sourceNative') : t('sourcePlugin')} \u00B7 ${t(known.nameKey)}`\n}\n\n/** The provider dict inside one descriptor's live value. */\nexport function providersOf(descriptor: SettingsDescriptor | undefined): Record<string, Record<string, unknown>> {\n const providers = descriptor?.value?.providers\n return typeof providers === 'object' && providers !== null\n ? providers as Record<string, Record<string, unknown>>\n : {}\n}\n\n/** The models array of one provider profile. */\nexport function modelsOf(provider: Record<string, unknown> | undefined): ModelDraft[] {\n const models = provider?.models\n return Array.isArray(models) ? models.filter((entry): entry is ModelDraft => typeof entry === 'object' && entry !== null) : []\n}\n\n/** The models of one provider profile, in display order. */\nexport function sortedModelsOf(provider: Record<string, unknown> | undefined, mode: SortMode = 'prefix'): ModelDraft[] {\n return sortByModelId(\n modelsOf(provider),\n model => textOf(model, 'id'),\n model => textOf(model, 'name'),\n mode,\n )\n}\n\n/** Read a string field, or the empty string. */\nexport function textOf(model: ModelDraft, key: string): string {\n const value = model[key]\n return typeof value === 'string' ? value : ''\n}\n\n/**\n * Decide whether a stored field counts as \"the user has not said anything\".\n *\n * The configuration schema fills defaults for absent fields (`input` reads as\n * `[]`), and those defaults are not user intent, so they count as blank.\n * @param value - the stored value.\n * @returns true when filling the field loses no user intent.\n */\nexport function isBlank(value: unknown): boolean {\n if (value === undefined || value === null || value === '') return true\n if (Array.isArray(value)) return value.length === 0\n if (typeof value === 'object') return Object.keys(value as Record<string, unknown>).length === 0\n return false\n}\n\n/**\n * Replace one provider's model list inside a descriptor, keeping everything\n * else it carries.\n *\n * A write updates the configuration, so the descriptor the page holds must\n * follow: otherwise the next rebuild from that descriptor (a sort-mode switch,\n * a provider switch, a conflict reload) hands back the pre-write models and the\n * names that were just applied disappear. This is the pure half of that update,\n * separated so it can be tested without a running settings service.\n *\n * Only `providers[key].models` moves. Other providers, and other fields of this\n * provider and its models, are carried over untouched.\n * @param descriptor - the descriptor as the page held it.\n * @param providerKey - which provider was written.\n * @param models - the list that was written.\n * @param revision - the revision the service answered with, when it gave one.\n * @returns a new descriptor; the input is not mutated.\n */\nexport function withWrittenModels(\n descriptor: SettingsDescriptor,\n providerKey: string,\n models: readonly ModelDraft[],\n revision: number | undefined,\n): SettingsDescriptor {\n const providers = providersOf(descriptor)\n const provider = providers[providerKey]\n const nextProviders = provider === undefined\n ? providers\n : { ...providers, [providerKey]: { ...provider, models: [...models] } }\n return {\n ...descriptor,\n ...revision === undefined ? {} : { revision },\n value: { ...descriptor.value, providers: nextProviders },\n }\n}\n\n/**\n * Read a hand-typed token count: `128K`, `1M`, `128000`, `1,000,000`.\n *\n * The cells show the short form (`1M`), so the same short form has to be\n * accepted back: a field you can see you can also type. Anything that is not a\n * number with an optional K/M suffix returns undefined, which the caller reads\n * as \"no manual value\" rather than as zero.\n * @param text - what the cell holds.\n * @returns the count, or undefined when the text is not a count.\n */\nexport function parseTokenCount(text: string): number | undefined {\n const trimmed = text.trim().replace(/[,_\\s]/g, '')\n if (trimmed === '') return undefined\n const match = /^([0-9]+(?:\\.[0-9]+)?)([kKmM])?$/.exec(trimmed)\n if (match === null) return undefined\n const amount = Number(match[1])\n if (!Number.isFinite(amount) || amount <= 0) return undefined\n const suffix = match[2]?.toLowerCase()\n if (suffix === 'k') return Math.round(amount * 1000)\n if (suffix === 'm') return Math.round(amount * 1_000_000)\n return Math.round(amount)\n}\n\n/**\n * Overlay hand-typed fields on the ones the catalog gave.\n *\n * The page shows numbers a person can change, because the catalog is not\n * always right and sometimes has nothing at all: a rate-limited proxy route\n * may need a smaller window than the upstream model advertises, and a model\n * the catalog never heard of gets its whole entry typed by hand. Manual values\n * therefore win, and they are applied even when \"overwrite\" is off \u2014 that\n * switch governs catalog values replacing what the user already stored, not\n * values the user just typed.\n * @param base - catalog fields, when there were any.\n * @param manual - fields typed in the table.\n * @returns the fields a write would use.\n */\nexport function mergeFields(\n base: CapabilityFields | undefined,\n manual: CapabilityFields | undefined,\n): CapabilityFields | undefined {\n if (base === undefined) return manual\n if (manual === undefined) return base\n return { ...base, ...manual }\n}\n", "/**\n * Name redirection: automatically prepend each gateway model's source prefix.\n *\n * A gateway namespaces its upstream by a path prefix (`qoder/qfmodel`,\n * `qoder-cn/qfmodel`, `antigravity/gemini-3.8-flash`) and keeps the upstream's\n * own label as the name. Two sources that offer the same model therefore look\n * identical in the model picker \u2014 both read \"Qwen3.8-Flash\" \u2014 and the only\n * clue to which source serves the answer is buried in an id nobody sees while\n * chatting.\n *\n * The rule here is applied to ALL models automatically:\n * - Models with a source prefix (e.g. `qoder/`) get \u3010vendor\u3011 prepended\n * - Models without a prefix get \u3010other\u3011 prepended\n *\n * The rule is deliberately mechanical: take the first path segment of the id\n * (or use 'other' if none), strip anything of that shape already on the name\n * (leading \u3010prefix\u3011, a prefix/ at the front, or a trailing \u3010prefix\u3011 from\n * before the redesign), then prepend \u3010prefix\u3011 followed by a space. So the\n * prefix ends up in exactly one place, at the front, in one spelling.\n * Re-running the rule is a no-op, so reapplying never stacks prefixes.\n *\n * This module is pure: no settings access, no React. The section renders the\n * plan and writes it through the official settings service.\n * @module dsh-model-capability-sync/rename\n */\nimport type { ModelDraft } from './shared.ts'\nimport { textOf } from './shared.ts'\n\n/** One model and the name redirect that applies to it. */\nexport interface NameRow {\n /** The gateway model id exactly as configured. */\n id: string\n /** The source prefix (the first path segment), or `''` when the id has none. */\n prefix: string\n /** What the picker shows today: the stored name, or the id when it is blank. */\n before: string\n /** What the picker would show after the redirect. */\n after: string\n /** True when applying would actually rewrite the stored name. */\n changed: boolean\n}\n\n/**\n * The source prefix of one gateway id.\n *\n * Only the first path segment counts: a gateway may nest further\n * (`qoder/gj/qwen3.8`), but the thing that distinguishes sources is the\n * outermost one.\n * @param id - the gateway model id exactly as configured.\n * @returns the prefix, or `''` when the id has no usable prefix.\n */\nexport function sourcePrefixOf(id: string): string {\n const slash = id.indexOf('/')\n if (slash <= 0) return ''\n return id.slice(0, slash)\n}\n\n/**\n * The part of an id after its prefix \u2014 the fallback label when a model has no\n * name of its own.\n * @param id - the gateway model id exactly as configured.\n * @returns the remainder after the first slash, or the whole id without one.\n */\nfunction bareIdOf(id: string): string {\n const slash = id.indexOf('/')\n if (slash === -1) return id\n const rest = id.slice(slash + 1)\n return rest === '' ? id : rest\n}\n\n/**\n * Compute the redirected name for one model.\n *\n * All models get a prefix annotation: one extracted from the id (e.g. `qoder/` \u2192 `\u3010qoder\u3011`),\n * or `\u3010other\u3011` when the id has no path segment. The prefix uses full-width brackets\n * because a model label is already dense with ASCII, and parentheses would read as\n * part of the upstream's own name. Placing it at the front makes it immediately\n * visible as the source, improving clarity.\n * @param id - the gateway model id exactly as configured.\n * @param name - the stored display name; the empty string when it is unset.\n * @returns the prefix, both labels, and whether the write changes anything.\n */\nexport function redirectName(id: string, name: string): Omit<NameRow, 'id'> {\n let prefix = sourcePrefixOf(id)\n if (prefix === '') prefix = 'other' // No source prefix in id \u2192 use \u3010other\u3011\n \n const before = name !== '' ? name : id\n const prefix_bracket = `\u3010${prefix}\u3011`\n const prefix_space = `${prefix_bracket} `\n\n // If already has the exact prefix at the beginning, no change needed (idempotent).\n if (before.startsWith(prefix_space)) {\n return { prefix, before, after: before, changed: false }\n }\n\n // Strip any existing bracket annotation (both leading and trailing).\n // This handles both our \u3010prefix\u3011 (new prefix-at-start), the old rule's suffix\n // \u3010prefix\u3011 (at the end), legacy ( ) and user-added [ ] gracefully.\n let stripped = before\n\n // Strip any leading bracket annotation (\u3010\u3011, (), [])\n const leadingAnnotations = /^\u3010[^\u3011]*\u3011\\s*|\\s*\\([^)]*\\)\\s*|\\s*\\[[^\\]]*\\]\\s*/\n stripped = stripped.replace(leadingAnnotations, '')\n\n // Strip any trailing bracket annotation\n const trailingAnnotations = /\\s*\u3010[^\u3011]*\u3011\\s*|\\s*\\([^)]*\\)\\s*|\\s*\\[[^\\]]*\\]\\s*$/\n while (trailingAnnotations.test(stripped)) {\n stripped = stripped.replace(trailingAnnotations, '')\n }\n\n // Strip leading prefix if present (user might have put \"qoder/ModelName\")\n const originalPrefix = sourcePrefixOf(id)\n if (originalPrefix !== '') {\n const lead = `${originalPrefix}/`\n if (stripped.startsWith(lead)) {\n stripped = stripped.slice(lead.length)\n }\n }\n\n const base = stripped.trimEnd() !== '' ? stripped.trimEnd() : bareIdOf(id)\n const after = `${prefix_space}${base}`\n return { prefix, before, after, changed: after !== before }\n}\n\n/**\n * Build the redirect plan for one provider's models.\n * @param models - the stored entries, in display order.\n * @returns one row per entry, in the same order.\n */\nexport function planNames(models: readonly ModelDraft[]): NameRow[] {\n return models.map((model) => {\n const id = textOf(model, 'id')\n return { id, ...redirectName(id, textOf(model, 'name')) }\n })\n}\n\n/**\n * Apply a redirect plan to the stored entries.\n *\n * Only selected ids are touched, and only when the redirect actually changes\n * the name, so a stale plan cannot rewrite a label the user just edited.\n * @param models - the stored entries, in stored order.\n * @param selected - ids to rewrite.\n * @returns the new entries plus how many were rewritten.\n */\nexport function renameModels(models: readonly ModelDraft[], selected: ReadonlySet<string>): { next: ModelDraft[]; written: number } {\n let written = 0\n const next = models.map((model) => {\n const id = textOf(model, 'id')\n if (!selected.has(id)) return model\n const { after, changed } = redirectName(id, textOf(model, 'name'))\n if (!changed) return model\n written += 1\n return { ...model, name: after }\n })\n return { next, written }\n}\n", "/**\n * Copy dictionaries for the capability-sync section. Chinese first (the dsh\n * web convention); English mirrors it key for key.\n */\n\nexport const zh = {\n nav: '\u6A21\u578B\u80FD\u529B\u540C\u6B65',\n loading: '\u6B63\u5728\u8BFB\u53D6\u914D\u7F6E\u2026',\n intro: '\u4ECE models.dev \u67E5\u8BE2\u5DF2\u914D\u7F6E\u6A21\u578B\u7684\u80FD\u529B\uFF08\u4E0A\u4E0B\u6587\u7A97\u53E3\u3001\u8F93\u51FA\u4E0A\u9650\u3001\u662F\u5426\u652F\u6301\u56FE\u7247\u3001\u63A8\u7406\u6863\u4F4D\uFF09\uFF0C\u5E76\u5199\u5165\u6240\u9009\u4F9B\u5E94\u5546\u7684\u914D\u7F6E\u3002\u672C\u9875\u53EA\u5199\u914D\u7F6E\uFF0C\u4E0D\u53D1\u9001\u4EFB\u4F55\u63A8\u7406\u8BF7\u6C42\u3002',\n writeTarget: '\u5199\u5165\u4F4D\u7F6E',\n sourceNative: '\u539F\u751F\u914D\u7F6E',\n sourcePlugin: '\u63D2\u4EF6\u914D\u7F6E',\n nameLlmPiAi: 'pi-ai \u9002\u914D\u5668',\n nameLlmDeepseek: 'DeepSeek \u5B98\u65B9',\n nameLlmDeepseekAccount: 'DeepSeek \u8D26\u53F7',\n nameLlmNewapi: 'NewAPI',\n provider: '\u4F9B\u5E94\u5546',\n modelCount: '\u5171 {count} \u4E2A\u6A21\u578B',\n willSort: '\u5199\u5165\u65F6\u6309\u300C\u524D\u7F00\u5206\u7EC4 + \u540D\u79F0\u300D\u6392\u5E8F',\n sortMode: '\u6392\u5E8F',\n sortByPrefix: '\u6309\u6A21\u578B\u524D\u7F00\u6392\u5E8F\uFF08\u5206\u7EC4\uFF09',\n sortByRedirected: '\u6309\u91CD\u5B9A\u5411\u540E\u3010\u6765\u6E90\u3011\u540D\u79F0\u6392\u5E8F',\n search: '\u641C\u7D22\u6A21\u578B ID \u6216\u76EE\u5F55 ID',\n onlyChanged: '\u53EA\u770B\u6709\u53D8\u5316\u7684',\n changeSummary: '\u5C06\u4FEE\u6539 {rows} \u884C \u00B7 {fields} \u4E2A\u5B57\u6BB5',\n noChanges: '\u6CA1\u6709\u9700\u8981\u5199\u5165\u7684\u53D8\u5316\uFF08\u76EE\u5F55\u503C\u4E0E\u4F60\u73B0\u6709\u914D\u7F6E\u4E00\u81F4\uFF09\u3002',\n filteredEmpty: '\u6CA1\u6709\u7B26\u5408\u7B5B\u9009\u6761\u4EF6\u7684\u6A21\u578B\u3002',\n fieldEmpty: '\u672A\u8BBE\u7F6E',\n conflictReload: '\u914D\u7F6E\u5DF2\u88AB\u5176\u4ED6\u6539\u52A8\u66F4\u65B0\uFF0C\u5DF2\u91CD\u65B0\u8BFB\u53D6\u6700\u65B0\u503C\uFF1B\u8BF7\u786E\u8BA4\u540E\u518D\u70B9\u4E00\u6B21\u300C\u5E94\u7528\u300D\u3002',\n analyze: '\u5206\u6790\u80FD\u529B',\n analyzing: '\u6B63\u5728\u5339\u914D\u2026',\n refreshCatalog: '\u91CD\u65B0\u4E0B\u8F7D\u76EE\u5F55',\n apply: '\u5E94\u7528',\n applying: '\u6B63\u5728\u5199\u5165\u2026',\n applied: '\u5DF2\u5199\u5165 {count} \u4E2A\u6A21\u578B',\n overwrite: '\u8986\u76D6\u5DF2\u6709\u503C',\n overwriteHint: '\u4E0D\u52FE\u9009\u65F6\u53EA\u586B\u7A7A\u767D\u5B57\u6BB5\uFF0C\u4F60\u624B\u586B\u8FC7\u7684\u503C\u4E0D\u4F1A\u88AB\u6539\u5199\u3002',\n selectAll: '\u5168\u9009',\n colModel: '\u6A21\u578B ID',\n colName: '\u540D\u79F0',\n colMatch: '\u5339\u914D',\n colContext: '\u4E0A\u4E0B\u6587',\n colOutput: '\u8F93\u51FA',\n colImage: '\u56FE\u7247',\n colLive: '\u5F53\u524D\u751F\u6548',\n colLiveHint: '\u7531\u771F\u6B63\u63A5\u7BA1\u8FD9\u6761\u8DEF\u7531\u7684\u9002\u914D\u5668\u4E0A\u62A5\uFF0C\u4E5F\u5C31\u662F\u804A\u5929\u8BF7\u6C42\u5B9E\u9645\u770B\u5230\u7684\u503C\u3002\u82E5\u5B83\u4E0E\u300C\u56FE\u7247\u300D\u5217\u4E0D\u4E00\u81F4\uFF0C\u8BF4\u660E\u914D\u7F6E\u88AB\u53E6\u4E00\u4E2A\u63D2\u4EF6\u62A2\u5360\u4E86\u8DEF\u7531\u3002',\n liveError: '\u65E0\u6CD5\u8BFB\u53D6',\n liveSummary: '\u5F53\u524D\u751F\u6548\uFF1A{image} \u4E2A\u652F\u6301\u56FE\u7247\uFF0C{text} \u4E2A\u7EAF\u6587\u672C\u3002\u82E5\u4E0E\u300C\u56FE\u7247\u300D\u5217\u4E0D\u4E00\u81F4\uFF0C\u8BF4\u660E\u8FD9\u6761\u8DEF\u7531\u7531\u522B\u7684\u63D2\u4EF6\u63A5\u7BA1\uFF0C\u5199\u5165\u672C\u914D\u7F6E\u4E0D\u4F1A\u751F\u6548\u3002',\n colReasoning: '\u63A8\u7406\u6863\u4F4D',\n imageYes: '\u652F\u6301',\n imageNo: '\u7EAF\u6587\u672C',\n unmatched: '\u672A\u5339\u914D',\n unmatchedHint: '\u5176\u4E2D {count} \u4E2A\u6A21\u578B\u5728 models.dev \u91CC\u627E\u4E0D\u5230\uFF0C\u80FD\u529B\u53C2\u6570\u53EF\u4EE5\u5728\u4E0A\u8868\u91CC\u624B\u52A8\u586B\u3002',\n editHint: '\u4E0A\u4E0B\u6587 / \u8F93\u51FA / \u56FE\u7247\u53EF\u4EE5\u76F4\u63A5\u5728\u8868\u683C\u91CC\u6539\uFF1A\u76EE\u5F55\u6CA1\u6536\u5F55\u7684\u6A21\u578B\u4E5F\u80FD\u624B\u52A8\u586B\uFF0C\u84DD\u8272\u8868\u793A\u662F\u4F60\u624B\u586B\u7684\u503C\u3002',\n notListed: '\u76EE\u5F55\u672A\u6536\u5F55',\n noModels: '\u8BE5\u4F9B\u5E94\u5546\u4E0B\u8FD8\u6CA1\u6709\u6A21\u578B\u3002',\n noTarget: '\u6CA1\u6709\u627E\u5230\u53EF\u5199\u7684\u914D\u7F6E\u6761\u76EE\uFF08\u9700\u8981\u5DF2\u542F\u7528\u7684 llm-pi-ai \u4F9B\u5E94\u5546\u914D\u7F6E\uFF09\u3002',\n loadFailed: '\u52A0\u8F7D\u5931\u8D25',\n retry: '\u91CD\u8BD5',\n viaAlias: '\u522B\u540D',\n viaName: '\u6309\u540D\u79F0',\n viaNameSuffix: '\u540D\u79F0\u53BB\u53D8\u4F53',\n viaExact: '\u7CBE\u786E',\n viaFolded: '\u5FFD\u7565\u5927\u5C0F\u5199',\n viaBasename: '\u53BB\u524D\u7F00',\n viaSuffix: '\u53BB\u53D8\u4F53\u540E\u7F00',\n viaPrefix: '\u524D\u7F00\u5339\u914D',\n viaVendor: '\u53BB\u4F9B\u5E94\u5546\u524D\u7F00',\n viaSpelling: '\u7A7A\u683C\u8F6C\u6A2A\u7EBF',\n catalogInfo: '\u76EE\u5F55\uFF1A{models} \u4E2A\u6A21\u578B \u00B7 {time}',\n catalogStale: '\u5728\u7EBF\u76EE\u5F55\u4E0B\u8F7D\u5931\u8D25\uFF0C\u6B63\u5728\u4F7F\u7528\u672C\u673A\u7F13\u5B58\uFF08{time}\uFF09\u3002\u6570\u636E\u53EF\u80FD\u4E0D\u662F\u6700\u65B0\uFF0C\u5B57\u6BB5\u542B\u4E49\u4E0D\u53D8\u3002',\n nothingSelected: '\u6CA1\u6709\u9009\u4E2D\u4EFB\u4F55\u6A21\u578B\u3002',\n redirectNoChanges: '\u8FD9\u4E9B\u540D\u79F0\u5DF2\u5E26\u6765\u6E90\u524D\u7F00\uFF0C\u65E0\u9700\u6539\u52A8\u3002',\n reorder: '\u91CD\u6392',\n reordering: '\u91CD\u6392\u4E2D...',\n reordered: '\u5DF2\u6309 {mode} \u91CD\u6392\u76EE\u5F55',\n redirectApply: '\u5199\u5165\u540D\u79F0',\n redirectApplying: '\u6B63\u5728\u5199\u5165\u2026',\n redirectApplied: '\u5DF2\u6539\u5199 {count} \u4E2A\u540D\u79F0',\n} as const\n\nexport type SyncKey = keyof typeof zh\n\nexport const en: Record<SyncKey, string> = {\n nav: 'Model capabilities',\n loading: 'Reading configuration\u2026',\n intro: 'Look up capabilities (context window, output cap, image input, reasoning efforts) for the models already configured here, then write them into the selected provider. This page only writes configuration; it never sends a model request.',\n writeTarget: 'Write to',\n sourceNative: 'Built in',\n sourcePlugin: 'Plugin',\n nameLlmPiAi: 'pi-ai adapter',\n nameLlmDeepseek: 'DeepSeek official',\n nameLlmDeepseekAccount: 'DeepSeek account',\n nameLlmNewapi: 'NewAPI',\n provider: 'Provider',\n modelCount: '{count} models',\n willSort: 'Written sorted by vendor prefix, then name',\n sortMode: 'Order',\n sortByPrefix: 'Sort by model prefix (grouped)',\n sortByRedirected: 'Sort by redirected name \u3010source\u3011',\n search: 'Search model id or catalog id',\n onlyChanged: 'Only rows that change',\n changeSummary: 'Will change {rows} rows \u00B7 {fields} fields',\n noChanges: 'Nothing to write: the catalog agrees with your configuration.',\n filteredEmpty: 'No model matches the filter.',\n fieldEmpty: 'unset',\n conflictReload: 'The configuration changed elsewhere; the latest values were reloaded. Check them, then press Apply again.',\n analyze: 'Analyze',\n analyzing: 'Matching\u2026',\n refreshCatalog: 'Re-download catalog',\n apply: 'Apply',\n applying: 'Writing\u2026',\n applied: 'Wrote {count} models',\n overwrite: 'Overwrite existing values',\n overwriteHint: 'Unchecked: only blank fields are filled, so values you typed are preserved.',\n selectAll: 'Select all',\n colModel: 'Model id',\n colName: 'Name',\n colMatch: 'Match',\n colContext: 'Context',\n colOutput: 'Output',\n colImage: 'Image',\n colLive: 'In effect',\n colLiveHint: 'Reported by the adapter that actually serves this route \u2014 what a chat request sees. A value that disagrees with the Image column means another plugin owns the route.',\n liveError: 'unreadable',\n liveSummary: 'In effect: {image} image-capable, {text} text-only. If this disagrees with the Image column, another plugin serves the route and writing this entry changes nothing.',\n colReasoning: 'Reasoning',\n imageYes: 'yes',\n imageNo: 'text only',\n unmatched: 'unmatched',\n unmatchedHint: '{count} of these are not in models.dev; type their capability values in the table above.',\n editHint: 'Context, output and image can be edited right in the table \u2014 including models the catalog never listed. A blue value is one you typed.',\n notListed: 'not listed',\n noModels: 'This provider has no models yet.',\n noTarget: 'No writable configuration entry found (an enabled llm-pi-ai provider is required).',\n loadFailed: 'Load failed',\n retry: 'Retry',\n viaAlias: 'alias',\n viaName: 'by name',\n viaNameSuffix: 'name + variant',\n viaExact: 'exact',\n viaFolded: 'case-folded',\n viaBasename: 'basename',\n viaSuffix: 'suffix',\n viaPrefix: 'prefix match',\n viaVendor: 'vendor prefix',\n viaSpelling: 'gap as dash',\n catalogInfo: 'Catalog: {models} models \u00B7 {time}',\n catalogStale: 'The online catalog download failed; using the local copy from {time}. The facts still mean the same thing, they may just be older.',\n nothingSelected: 'Nothing selected.',\n redirectNoChanges: 'These names already carry a source prefix; nothing to change.',\n reorder: 'Reorder',\n reordering: 'Reordering\u2026',\n reordered: 'Reordered by {mode}',\n redirectApply: 'Write names',\n redirectApplying: 'Writing\u2026',\n redirectApplied: 'Rewrote {count} names',\n}\n", "/**\n * Browser half: one settings section plus the host RPC call it needs.\n *\n * The section is a `settings.section` slot of its own, so no shell edit is\n * required. Configuration reads and writes go through the official settings\n * remote (`remote.settings`), which is the same surface the shell's own Models\n * page uses; the only custom channel is the catalog lookup, which must run\n * host-side to avoid a cross-origin download.\n * @module dsh-model-capability-sync/client\n */\nimport type { RpcEnvelope } from '../types.ts'\nimport type { LiveResponse, PreviewRequest, PreviewResponse } from '../types.ts'\nimport { SyncSection } from './SyncSection.tsx'\nimport type { SyncSectionInjected } from './SyncSection.tsx'\nimport type { SettingsDescriptor, SettingsInjected, SettingsPathOp } from './shared.ts'\nimport { en, zh } from './locale.ts'\n\n/** Copy namespace owned by this plugin. */\nconst NS = 'settings.capability-sync'\n/** Own host RPC channel. */\nconst CHANNEL = '/model-capability-sync'\n\n/** The slice of the browser context this plugin uses. */\ninterface ClientContext {\n effect(callback: () => (() => void) | void, label?: string): void\n get(service: string): unknown\n locale: {\n register(ns: string, dictionaries: { zh: unknown; en: unknown }): () => void\n bind(ns: string): (key: string, params?: Record<string, unknown>) => string\n }\n slots: {\n inject(name: string, callback: () => () => void): void\n register(options: Record<string, unknown>, component: unknown): () => void\n }\n}\n\n/** The connection face carrying `rpc.call`. */\ninterface ConnectionFace {\n rpc: { call(channel: string, endpoint: string, payload: unknown): Promise<unknown> }\n}\n\n/** The remote face carrying the settings namespace. */\ninterface RemoteFace {\n settings: {\n describe(): Promise<unknown>\n mutate(ns: string, ops: SettingsPathOp[], expectedRevision?: number): Promise<unknown>\n }\n}\n\n/** The document `settings.describe` answers with, once its envelope is opened. */\ninterface SettingsDocument {\n writable?: boolean\n namespaces?: SettingsDescriptor[]\n}\n\n/** A refusal as the Remote namespace states it. */\ninterface Refusal {\n /** Machine-readable reason; `settings/conflict` is the one callers act on. */\n code?: string\n /** Human message for the page. */\n message: string\n}\n\n/**\n * Read the refusal out of a Remote answer envelope.\n * @param answer - whatever the Remote namespace resolved with.\n * @returns the refusal when the answer carries one, otherwise undefined.\n */\nfunction refusalOf(answer: unknown): Refusal | undefined {\n if (typeof answer !== 'object' || answer === null) return undefined\n const envelope = answer as { ok?: unknown; error?: { code?: unknown; message?: unknown } }\n if (envelope.ok !== false) return undefined\n return {\n ...typeof envelope.error?.code === 'string' ? { code: envelope.error.code } : {},\n message: typeof envelope.error?.message === 'string' ? envelope.error.message : 'settings request refused',\n }\n}\n\n/**\n * Open a Remote answer envelope.\n *\n * Every `remote.settings` method answers `{ok: true, value}` or\n * `{ok: false, error}`; a few surfaces hand back the bare value instead, so\n * both shapes are accepted rather than guessed at one. A refusal keeps its\n * `code`, so the section can tell a stale revision apart from a real failure.\n * @param answer - whatever the Remote namespace resolved with.\n * @returns the value the answer carries.\n * @throws the refusal, carrying `code` when the answer had one.\n */\nfunction unwrap(answer: unknown): unknown {\n const refusal = refusalOf(answer)\n if (refusal !== undefined) {\n throw Object.assign(new Error(refusal.message), refusal.code === undefined ? {} : { code: refusal.code })\n }\n if (typeof answer === 'object' && answer !== null && 'ok' in answer && 'value' in answer) {\n return (answer as { value: unknown }).value\n }\n return answer\n}\n\n/**\n * The namespace views a describe answer carries.\n * @param answer - the `settings.describe` answer, enveloped or bare.\n * @returns every served namespace view.\n * @throws when the answer holds no namespace list.\n */\nfunction namespacesOf(answer: unknown): SettingsDescriptor[] {\n const document = unwrap(answer) as SettingsDocument | SettingsDescriptor[] | undefined\n if (Array.isArray(document)) return document\n const namespaces = document?.namespaces\n if (!Array.isArray(namespaces)) throw new Error('settings.describe returned no namespace list')\n return namespaces\n}\n\n/** Required services (cordis fiber inject). */\nexport const inject = ['slots', 'locale', 'connection', 'remote', 'remote.settings']\n\n/** Section styles, riding the shell's `--dsw-alias-*` tokens for both themes. */\nconst SECTION_CSS = `\n.cs-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }\n.cs-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; }\n.cs-select {\n box-sizing: border-box; padding: 6px 10px; border-radius: 8px;\n border: 1px solid var(--dsw-alias-border-l2);\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit; font-size: 13px;\n}\n.cs-button {\n padding: 6px 12px; border-radius: 6px; font: inherit; font-size: 13px;\n border: 1px solid var(--dsw-alias-border-l2);\n background: transparent; color: var(--dsw-alias-label-primary);\n cursor: pointer;\n}\n.cs-button:hover:not(:disabled) { background: var(--dsw-alias-interactive-bg-hover); }\n.cs-button:disabled { opacity: 0.4; cursor: default; }\n.cs-button--primary {\n border-color: transparent;\n background: var(--dsw-alias-button-primary-fill);\n color: var(--dsw-alias-label-primary-foreground);\n}\n.cs-button--primary:hover:not(:disabled) { background: var(--dsw-alias-button-primary-hover); }\n.cs-hint { font-size: 12px; color: var(--dsw-alias-label-tertiary); line-height: 18px; }\n.cs-error { color: var(--dsw-alias-state-error-primary); font-size: 12px; }\n.cs-warn { color: var(--dsw-alias-state-warning-primary, var(--dsw-alias-label-secondary)); font-size: 12px; line-height: 18px; }\n.cs-input {\n box-sizing: border-box; padding: 6px 10px; border-radius: 8px; min-width: 200px;\n border: 1px solid var(--dsw-alias-border-l2);\n background: var(--dsw-alias-bg-layer-1);\n color: var(--dsw-alias-label-primary);\n font: inherit; font-size: 13px;\n}\n.cs-target { font-size: 13px; color: var(--dsw-alias-label-primary); line-height: 30px; }\n.cs-table-wrap {\n max-height: 460px; overflow: auto; margin-bottom: 12px;\n border: 1px solid var(--dsw-alias-border-l2); border-radius: 8px;\n}\n/* Fit the columns to the panel: ids and names wrap rather than push the table\n wider than the space it has. Scrolling horizontally stays possible as a last\n resort for a very narrow window, it just is not the normal state. */\n.cs-table {\n width: 100%; border-collapse: separate; border-spacing: 0; font-size: 12px;\n table-layout: fixed;\n}\n.cs-table col.cs-col-check { width: 28px; }\n.cs-table col.cs-col-id { width: 17%; }\n.cs-table col.cs-col-name { width: 17%; }\n.cs-table col.cs-col-match { width: 19%; }\n.cs-table col.cs-col-context { width: 9%; }\n.cs-table col.cs-col-output { width: 9%; }\n.cs-table col.cs-col-image { width: 8%; }\n.cs-table col.cs-col-live { width: 7%; }\n.cs-table col.cs-col-reasoning { width: 14%; }\n.cs-table th {\n position: sticky; top: 0; z-index: 1;\n text-align: left; font-weight: 500; color: var(--dsw-alias-label-secondary);\n background: var(--dsw-alias-bg-layer-1);\n padding: 6px 8px; border-bottom: 1px solid var(--dsw-alias-border-l2); white-space: nowrap;\n}\n.cs-table td {\n padding: 6px 8px; border-bottom: 1px solid var(--dsw-alias-border-l2);\n color: var(--dsw-alias-label-primary); vertical-align: top;\n}\n.cs-table tr:last-child td { border-bottom: none; }\n.cs-row--changed td { background: var(--dsw-alias-bg-layer-2, transparent); }\n.cs-id { font-variant-numeric: tabular-nums; word-break: break-all; }\n/* Cells that hold a control keep the row compact and the table inside the panel. */\n.cs-cell { display: flex; flex-direction: column; gap: 2px; min-width: 0; }\n.cs-input--cell, .cs-select--cell {\n width: 100%; min-width: 0; padding: 2px 4px; font-size: 12px; line-height: 18px;\n border-radius: 4px;\n}\n.cs-input--cell { text-align: right; font-variant-numeric: tabular-nums; }\n.cs-select--cell { padding-right: 2px; }\n/* A value the user typed is marked, so it is clear it did not come from the catalog. */\n.cs-input--typed, .cs-select--typed {\n border-color: var(--dsw-alias-brand-primary);\n color: var(--dsw-alias-brand-primary);\n}\n.cs-change--block { display: block; white-space: normal; }\n.cs-dim { color: var(--dsw-alias-label-tertiary); }\n.cs-change { white-space: nowrap; }\n.cs-from { color: var(--dsw-alias-label-tertiary); text-decoration: line-through; }\n.cs-badge {\n display: inline-block; padding: 0 6px; border-radius: 9px; font-size: 11px; line-height: 18px;\n border: 1px solid var(--dsw-alias-border-l2); color: var(--dsw-alias-label-secondary);\n}\n.cs-badge--image { border-color: var(--dsw-alias-brand-primary); color: var(--dsw-alias-brand-primary); }\n.cs-unmatched { margin: 8px 0 0; padding-left: 18px; color: var(--dsw-alias-label-tertiary); font-size: 12px; }\n`\n\n/**\n * Register the copy dictionary, the section styles, and the section itself.\n * @param ctx - browser root context.\n */\nexport function apply(ctx: ClientContext): void {\n ctx.effect(() => ctx.locale.register(NS, { zh, en }), 'model-capability-sync: copy dictionaries')\n\n if (typeof document !== 'undefined') {\n ctx.effect(() => {\n const element = document.createElement('style')\n element.textContent = SECTION_CSS\n document.head.append(element)\n return () => { element.remove() }\n }, 'model-capability-sync: section styles')\n }\n\n const connection = ctx.get('connection') as ConnectionFace\n const remote = ctx.get('remote') as RemoteFace\n const t = ctx.locale.bind(NS)\n\n const settingsInjected = (): SettingsInjected => ({\n describeSettings: async () => namespacesOf(await remote.settings.describe()),\n mutateSettings: async (ns, ops, expectedRevision) => {\n const view = unwrap(await remote.settings.mutate(ns, ops, expectedRevision)) as SettingsDescriptor | undefined\n if (view === undefined) throw new Error('settings.mutate returned no namespace view')\n return view\n },\n })\n\n const injected = (): SyncSectionInjected => ({\n ...settingsInjected(),\n preview: request =>\n connection.rpc.call(CHANNEL, 'preview', request) as Promise<RpcEnvelope<PreviewResponse>>,\n live: request =>\n connection.rpc.call(CHANNEL, 'live', request) as Promise<RpcEnvelope<LiveResponse>>,\n })\n\n ctx.slots.inject('settings.section', () => ctx.slots.register({\n name: 'settings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