codex-copilot-dx 1.2.16 → 1.2.18

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.
@@ -2,6 +2,7 @@
2
2
  const el = id => document.getElementById(id), root = el("connection-sources");if (!root) return;
3
3
  const words = (node, key, args) => globalThis.ccdxLanguage.set(node, key, args), format = key => globalThis.ccdxLanguage.format(key);
4
4
  let data = null, editing = null, editingClient = null, disabling = null, models = [], selectedModels = new Set(), busy = false, generation = 0;
5
+ let claudeClient = "claude_app", bindingSelection = new Set(), bindingDefault = null, bindingDirty = false;
5
6
  const apiForm = el("connection-api-form"), clientForm = el("connection-client-form");
6
7
  const node = (tag, text, className) => { const item = document.createElement(tag);if (text !== undefined) item.textContent = text;if (className) item.className = className;return item; };
7
8
  const source = id => data.providers.find(item => item.id === id), client = id => data.clients.find(item => item.id === id);
@@ -18,8 +19,10 @@
18
19
  if (result.source !== "connections" || !Array.isArray(result.providers) || !Array.isArray(result.clients)) throw new Error("ccdx_connections_unavailable");return result;
19
20
  }
20
21
  function panels(which = "list") {
21
- root.hidden = el("connection-clients").hidden = which !== "list";
22
- el("connection-editor").hidden = which !== "api";el("connection-client-editor").hidden = which !== "client";el("connection-disable-editor").hidden = which !== "disable";
22
+ root.hidden = which !== "list";
23
+ el("source-account-panel").hidden = el("model-providers").hidden = which !== "list";
24
+ el("connection-editor").hidden = which !== "api";el("connection-disable-editor").hidden = which !== "disable";
25
+ (which === "api" ? el("connection-editor") : which === "disable" ? el("connection-disable-editor") : root).append(el("connection-note"));
23
26
  apiForm.elements.key.value = "";
24
27
  }
25
28
  function choice(options, selected, pause = true) {
@@ -35,51 +38,103 @@
35
38
  if (provider.enabled) {
36
39
  const allowed = data.clients.filter(c => c.enabled && c.allowed.includes(provider.id)).map(c => c.name).join(" / ");
37
40
  const line = node("p", undefined, "hint");words(line, "api_allowed_summary", { clients: allowed || format("api_none") });info.append(line);
41
+ if (provider.discovery?.state === "stale") { const warning = node("p", undefined, "hint");words(warning, "cap_catalog_stale");warning.append(" ", provider.discovery.code);info.append(warning); }
38
42
  actions.append(button(provider.builtin ? "api_account" : "api_manage", () => provider.builtin ? (location.hash = "models", window.dispatchEvent(new CustomEvent("ccdx:choose-source", { detail: { id: provider.id } }))) : editApi(provider)));
39
43
  const toggle = node("input");toggle.type = "checkbox";toggle.checked = true;toggle.setAttribute("role", "switch");toggle.setAttribute("aria-label", format("api_disable_source") + " " + provider.name);
40
44
  toggle.addEventListener("change", () => { toggle.checked = true;disableSource(provider); });actions.append(toggle);
41
45
  } else actions.append(button("api_restore", () => void change({ operation: "provider", id: provider.id, enabled: true })));
42
46
  row.append(info, actions);(provider.enabled ? providerList : disabledSources).append(row);
43
47
  }
44
- for (const c of data.clients) {
45
- const row = node("div", undefined, "connection-row"), info = node("div"), actions = node("div", undefined, "connection-actions");info.append(node("h3", c.name));
46
- const note = node("p", undefined, "hint");words(note, c.enabled ? "api_current_summary" : "api_client_disabled", { source: source(c.source)?.name || format("api_pause") });info.append(note);
47
- if (c.enabled) {
48
- actions.append(button("api_manage", () => editClient(c)));
49
- const toggle = node("input");toggle.type = "checkbox";toggle.checked = true;toggle.setAttribute("role", "switch");toggle.setAttribute("aria-label", format("api_close_client") + " " + c.name);
50
- toggle.addEventListener("change", () => { toggle.checked = true;void change({ operation: "client", id: c.id, enabled: false, source: null, allowed: c.allowed }); });actions.append(toggle);
51
- } else actions.append(button("api_restore", () => void change({ operation: "client", id: c.id, enabled: true, source: null, allowed: c.allowed })));
52
- row.append(info, actions);(c.enabled ? clientList : disabledClients).append(row);
48
+ const current = editingClient && client(editingClient);
49
+ if (current) {
50
+ const row = node("div", undefined, "connection-row"), title = node("h3", current.name), toggle = node("input");
51
+ toggle.type = "checkbox";toggle.checked = current.enabled;toggle.setAttribute("role", "switch");toggle.setAttribute("aria-label", current.name);
52
+ toggle.addEventListener("change", () => void change({ operation: "client", id: current.id, enabled: toggle.checked,
53
+ source: toggle.checked ? current.source : null, allowed: current.allowed, ...(Array.isArray(current.deployments) ? { deployments: current.deployments, default_model: current.default_model, auto_sync: current.auto_sync } : {}) }));
54
+ row.append(title, toggle);clientList.append(row);
55
+ }
56
+ for (const c of data.clients.filter(c => !c.enabled)) {
57
+ const row = node("div", undefined, "connection-row");row.append(node("span", c.name), button("api_restore", () => void change({ operation: "client", id: c.id, enabled: true, source: null, allowed: c.allowed })));disabledClients.append(row);
53
58
  }
54
59
  el("connection-disabled-sources").hidden = !disabledSources.children.length;
55
60
  el("connection-disabled-clients").hidden = !disabledClients.children.length;
56
- for (const route of ["codex", "claude"]) {
57
- const visible = route === "codex" ? client("codex").enabled : data.clients.some(c => c.enabled && c.id.startsWith("claude_"));
58
- const link = document.querySelector(`[data-route="${route}"]`);if (link) link.hidden = !visible;
59
- if (!visible && location.hash === "#" + route) location.hash = "system";
60
- }
61
+ // App pages remain reachable while disabled, so access can be restored there.
62
+ for (const route of ["codex", "claude"]) { const link = document.querySelector(`[data-route="${route}"]`);if (link) link.hidden = false; }
61
63
  const m365Toggle = el("m365-enabled")?.closest(".setting-row");if (m365Toggle) m365Toggle.hidden = true;
62
64
  for (const link of document.querySelectorAll("[data-source-link]")) { const id = link.dataset.sourceLink;if (["m365", "github"].includes(id)) link.hidden = !source(id)?.enabled; }
63
65
  globalThis.ccdxConnectionNames = Object.fromEntries(data.providers.map(p => [p.id, p.name]));
64
66
  }
65
67
  async function load() {
66
68
  if (busy) return;const current = ++generation;
67
- try { const result = await api();if (current !== generation) return;data = result;list(); }
68
- catch (error) { if (location.hash === "#system") message(error.message); }
69
+ try { const result = await api();if (current !== generation) return;data = result;mountClient();list(); }
70
+ catch (error) { message(error.message); }
69
71
  }
70
72
  async function change(input, done) {
71
- if (busy) return;busy = true;generation++;root.closest("[data-view]").setAttribute("aria-busy", "true");
72
- try { data = await api(input);list();done?.(data);if (!done) {
73
+ if (busy) return;busy = true;generation++;const view = document.querySelector(`[data-view="${location.hash.slice(1)}"]`);view?.setAttribute("aria-busy", "true");
74
+ try { data = await api(input);if (input.operation === "client") bindingDirty = false;mountClient();list();done?.(data);if (!done) {
73
75
  panels();let key = input.operation === "save_api" ? "api_config_saved" : input.operation === "provider" ? input.enabled ? "api_provider_enabled" : "api_provider_disabled"
74
76
  : !input.enabled ? "api_client_disabled" : !input.source ? "api_client_enabled" : "api_saved";
75
77
  const setup = data.clients.find(c => c.id === input.id)?.setup;
76
78
  if (input.operation === "client" && input.source && ["preserved", "partially_preserved"].includes(setup)) key = "api_client_preserved";
77
79
  if (input.operation === "client" && input.source && setup === "configuration_unavailable") key = "api_client_config_failed";
78
80
  if (input.operation === "client" && input.source && setup === "not_installed") key = "api_client_not_installed";
79
- message(key);
81
+ if (input.operation === "client") words(el("connection-client-note"), key);else message(key);
80
82
  }window.dispatchEvent(new CustomEvent("ccdx:connections"));void dashboardRefresh.refresh("auth", { force: true });void dashboardRefresh.refresh("status", { force: true }); }
81
- catch (error) { message(error.message); }
82
- finally { busy = false;root.closest("[data-view]").removeAttribute("aria-busy"); }
83
+ catch (error) { if (input.operation === "client") words(el("connection-client-note"), error.message);else message(error.message); }
84
+ finally { busy = false;view?.removeAttribute("aria-busy"); }
85
+ }
86
+ const resolved = model => ({ ...(model.metadata?.deployment === source(editing)?.deployment_revision ? model.metadata.values : {}), ...(model.context_window === undefined ? {} : { context_window: model.context_window }),
87
+ ...(model.reasoning_efforts === undefined ? {} : { reasoning_efforts: model.reasoning_efforts }), ...(model.capabilities || {}) });
88
+ const count = value => !value ? format("cap_unknown") : value >= 1000000 ? `${Number((value / 1000000).toFixed(2))}M` : value >= 1000 ? `${Number((value / 1000).toFixed(1))}K` : String(value);
89
+ const reasoningText = values => values.reasoning === false ? format("cap_unsupported") : values.reasoning_efforts?.length ? values.reasoning_efforts.join(" / ") : values.reasoning === true ? format("cap_supported") : format("cap_unknown");
90
+ const searchText = values => values.web_search === undefined ? format("cap_unknown") : values.web_search.length ? values.web_search.map(protocol => protocol === "messages" ? "Messages" : protocol === "responses" ? "Responses" : "Chat").join(" / ") : format("cap_unsupported");
91
+ function modelDetail(model) {
92
+ const detail = el("connection-model-detail");detail.hidden = false;detail.replaceChildren();
93
+ const heading = node("div", undefined, "panel-heading");heading.append(node("h3", model.id), button("close", () => { detail.hidden = true; }));detail.append(heading);
94
+ const note = node("p", undefined, "hint");words(note, "cap_metadata_scope");detail.append(note);
95
+ const fields = node("div", undefined, "connection-fields"), values = resolved(model);
96
+ const numeric = ["context_window", "max_input_tokens", "max_output_tokens", "reasoning_budget_min", "reasoning_budget_max"];
97
+ const flags = ["reasoning", "reasoning_required", "reasoning_adaptive", "tools", "parallel_tools", "streaming", "structured_output"];
98
+ const arrays = ["reasoning_efforts", "input_modalities", "web_search"];
99
+ for (const key of [...numeric, ...flags, ...arrays, "reasoning_format"]) {
100
+ const label = node("label"), title = node("span");words(title, "cap_field_" + key);label.append(title);
101
+ let input;
102
+ if (flags.includes(key) || key === "reasoning_format") {
103
+ input = node("select");for (const [value, text] of [["", "cap_follow_catalog"], ...(key === "reasoning_format" ? [["messages", "Messages"], ["responses", "Responses"], ["chat", "Chat"]] : [["true", "cap_supported"], ["false", "cap_unsupported"]])]) {
104
+ const option = node("option");option.value = value;words(option, text);input.append(option);
105
+ }
106
+ } else { input = node("input");input.type = numeric.includes(key) ? "number" : "text";if (numeric.includes(key)) { input.min = "1";input.max = "100000000";input.step = "1"; } }
107
+ input.dataset.capability = key;
108
+ const manual = model.capabilities?.[key] ?? (key === "context_window" ? model.context_window : key === "reasoning_efforts" ? model.reasoning_efforts : undefined);
109
+ input.value = manual === undefined ? "" : Array.isArray(manual) ? manual.length ? manual.join(", ") : "[]" : String(manual);
110
+ if (input.tagName === "INPUT") input.placeholder = values[key] === undefined ? format("cap_unknown") : Array.isArray(values[key]) ? values[key].join(", ") : String(values[key]);
111
+ const evidence = node("span", undefined, "hint");words(evidence, manual !== undefined ? "cap_manual" : model.metadata?.deployment === source(editing)?.deployment_revision && model.metadata?.values[key] !== undefined ? "cap_catalog" : "cap_unknown");label.append(input, evidence);fields.append(label);
112
+ }
113
+ detail.append(fields);
114
+ const save = button("cap_apply_details", () => {
115
+ const override = {};
116
+ for (const input of fields.querySelectorAll("[data-capability]")) {
117
+ const key = input.dataset.capability, text = input.value.trim();if (!text) continue;
118
+ override[key] = numeric.includes(key) ? Number(text) : flags.includes(key) ? text === "true" : arrays.includes(key) ? text === "[]" ? [] : text.split(/[,,]\s*/).filter(Boolean) : text;
119
+ }
120
+ model.capabilities = override;delete model.context_window;delete model.reasoning_efforts;modelRows();detail.hidden = true;message("cap_details_draft");
121
+ });detail.append(save);detail.scrollIntoView({ block: "nearest", behavior: "auto" });
122
+ }
123
+ function syncPreview(preview) {
124
+ const c = client(editingClient), result = el("connection-sync-result");result.hidden = false;result.replaceChildren();
125
+ const table = node("table"), head = node("tr");for (const key of ["model", "cap_context", "cap_current_budget", "cap_proposed_budget", "cap_reasoning", "cap_search"]) { const cell = node("th");words(cell, key);head.append(cell); }
126
+ const thead = node("thead"), body = node("tbody");thead.append(head);table.append(thead, body);
127
+ for (const item of c.model_plan?.available || []) if (bindingSelection.has(bindingKey(item.source, item.id))) {
128
+ const values = item.capability?.values || {}, row = node("tr"), proposed = preview?.models.find(model => model.id === item.id && model.source === item.source);
129
+ row.append(node("td", item.id), node("td", count(values.context_window)), node("td", count(preview?.current?.budgets?.[proposed?.public_id])),
130
+ node("td", count(preview?.shared?.budgets?.[proposed?.public_id])), node("td", reasoningText(values)), node("td", searchText(values)));body.append(row);
131
+ }
132
+ const wrap = node("div", undefined, "table-wrap");wrap.append(table);result.append(wrap);
133
+ const note = node("p", undefined, "hint");words(note, "cap_preview_scope");result.append(note);
134
+ const sync = preview?.shared || c.model_plan?.sync;
135
+ if (sync) { const status = node("p", undefined, "hint");words(status, "cap_sync_" + sync.state);result.append(status);
136
+ for (const limitation of sync.limitations || []) { const line = node("p", undefined, "hint");words(line, "cap_limit_" + limitation.code);if (limitation.model) line.prepend(limitation.model + ": ");result.append(line); }
137
+ }
83
138
  }
84
139
  function modelRows() {
85
140
  const body = el("connection-models");body.replaceChildren();
@@ -96,7 +151,9 @@
96
151
  if (e.target.checked) { selectedModels.add(model.id);selection.firstChild.checked = true; }
97
152
  });group.append(label);
98
153
  }
99
- apis.append(group);actions.append(button("api_remove_model", () => { models = models.filter(item => item !== model);selectedModels.delete(model.id);modelRows(); }));tr.append(name, apis, actions);body.append(tr);
154
+ const capability = resolved(model);
155
+ const context = node("td", count(capability.context_window)), reasoning = node("td", reasoningText(capability)), search = node("td", searchText(capability));
156
+ apis.append(group);actions.append(button("cap_details", () => modelDetail(model)), button("api_remove_model", () => { models = models.filter(item => item !== model);selectedModels.delete(model.id);modelRows(); }));tr.append(name, apis, context, reasoning, search, actions);body.append(tr);
100
157
  }
101
158
  }
102
159
  function setEndpoints(base, endpoints) { for (const [api, path] of [["messages", "messages"], ["responses", "responses"], ["chat", "chat/completions"]]) apiForm.elements[api + "_url"].value = endpoints?.[api] || base.replace(/\/+$/, "") + "/" + path; }
@@ -109,6 +166,7 @@
109
166
  for (const input of apiForm.querySelectorAll('[name="protocol"]')) input.checked = provider ? provider.protocols.includes(input.value) : input.value !== "chat";
110
167
  setEndpoints(provider?.base_url || "", provider?.endpoints);
111
168
  const allowed = el("connection-allowed-clients");allowed.replaceChildren(...data.clients.filter(c => c.enabled).map(c => check("allowed", c.id, c.allowed.includes(editing), c.name)));
169
+ el("connection-model-detail").hidden = true;
112
170
  models = structuredClone(provider?.models || []);selectedModels = new Set(models.map(model => model.id));modelRows();el("connection-manual-model").open = false;el("connection-discover").disabled = !editing;el("connection-model-id").value = "";
113
171
  }
114
172
  apiForm.elements.base.addEventListener("change", () => setEndpoints(apiForm.elements.base.value));
@@ -138,32 +196,62 @@
138
196
  models.push({ id, protocols: [] });selectedModels.add(id);el("connection-model-id").value = "";modelRows();
139
197
  });
140
198
  el("connection-discover").addEventListener("click", () => void change({ operation: "discover", id: editing }, result => {
141
- const known = new Map(models.map(model => [model.id, model]));for (const model of result.discovered || []) if (!known.has(model.id)) known.set(model.id, model);
199
+ const known = new Map(models.map(model => [model.id, model]));for (const model of result.discovered || []) { const previous = known.get(model.id);known.set(model.id, previous ? { ...previous, ...(model.metadata ? { metadata: model.metadata } : {}) } : model); }
142
200
  models = [...known.values()].slice(0, 500);modelRows();message("api_models_read");
143
201
  }));
144
- function clientModels() {
145
- const c = client(editingClient), provider = source(el("connection-current").value), selector = el("connection-current-model");
146
- el("connection-current-model-row").hidden = c.id !== "codex" || provider?.builtin !== false;
147
- selector.replaceChildren(...(provider?.models || []).filter(model => model.protocols.includes("responses")).map(model => { const item = node("option", model.id);item.value = model.id;return item; }));
148
- if ([...selector.options].some(option => option.value === c.model)) selector.value = c.model;
149
- }
150
- function clientSources() {
151
- const allowed = new Set([...el("connection-client-allowed").querySelectorAll("input:checked")].map(input => input.value));
152
- const before = el("connection-current").value, replacement = choice(data.providers.filter(p => p.enabled && allowed.has(p.id) && selectableSource(p, editingClient)), before);
153
- el("connection-current").replaceChildren(...replacement.childNodes);if ([...el("connection-current").options].some(option => option.value === before)) el("connection-current").value = before;clientModels();
202
+ const bindingKey = (source, model) => source + "\0" + model;
203
+ const routeId = item => item.route_id || item.public_id;
204
+ function mountClient(force = false) {
205
+ if (!data) return;
206
+ const route = location.hash.slice(1), id = route === "claude" ? claudeClient : "codex";
207
+ const mount = el(route === "claude" ? "claude-model-management" : "codex-model-management");
208
+ if (!["codex", "claude"].includes(route)) return;
209
+ mount.append(el("connection-clients"), el("connection-client-editor"));
210
+ const c = client(id);el("connection-client-editor").hidden = !c.enabled;
211
+ if (editingClient !== id || force || !bindingDirty) {
212
+ editingClient = id;bindingDirty = false;
213
+ const selected = Array.isArray(c.deployments) ? c.deployments : (c.model_plan?.models || []).map(model => ({ source: model.source, model: model.id }));
214
+ bindingSelection = new Set(selected.map(item => bindingKey(item.source, item.model)));
215
+ bindingDefault = c.default_model || c.model_plan?.models.find(model => model.public_id === c.model_plan?.default_model)?.route_id || null;
216
+ el("connection-auto-sync").checked = c.auto_sync !== false;bindingRows();
217
+ el("connection-sync-result").hidden = true;el("connection-client-note").textContent = "";
218
+ }
219
+ words(el("connection-client-title"), "cap_visible_model");list();
154
220
  }
155
- function editClient(c) {
156
- editingClient = c.id;panels("client");el("connection-client-title").textContent = c.name;
157
- const allowed = el("connection-client-allowed");allowed.replaceChildren(...data.providers.filter(p => p.enabled && compatible(p, c.id)).map(p => check("source", p.id, c.allowed.includes(p.id), p.name)));
158
- allowed.querySelectorAll("input").forEach(input => input.addEventListener("change", clientSources));
159
- const select = choice(data.providers.filter(p => p.enabled && c.allowed.includes(p.id) && selectableSource(p, c.id)), c.source);
160
- el("connection-current").replaceChildren(...select.childNodes);el("connection-current").value = c.source || "";clientModels();
221
+ function bindingRows() {
222
+ el("connection-client-cancel").disabled = !bindingDirty;
223
+ const body = el("connection-bindings"), c = client(editingClient);body.replaceChildren();
224
+ const available = c.model_plan?.available || [], availableKeys = new Set(available.map(item => bindingKey(item.source, item.id)));
225
+ const missing = [...bindingSelection].filter(key => !availableKeys.has(key)).map(key => { const [source, id] = key.split("\0");return { source, id, unavailable: true }; });
226
+ for (const item of [...available, ...missing]) {
227
+ const key = bindingKey(item.source, item.id), row = node("tr"), name = node("td"), capability = item.capability?.values || {};
228
+ const selection = check("binding-model", key, bindingSelection.has(key), item.id);
229
+ selection.firstChild.addEventListener("change", event => {
230
+ bindingDirty = true;if (event.target.checked) { bindingSelection.add(key);bindingDefault ||= routeId(item); }
231
+ else { bindingSelection.delete(key);if (bindingDefault === routeId(item) || !available.some(entry => routeId(entry) === bindingDefault)) bindingDefault = available.find(entry => bindingSelection.has(bindingKey(entry.source, entry.id)))?.route_id || null; }
232
+ bindingRows();
233
+ });name.append(selection);
234
+ const action = button(bindingDefault === routeId(item) && bindingSelection.has(key) ? "cap_default" : "cap_set_default", () => { bindingDirty = true;bindingSelection.add(key);bindingDefault = routeId(item);bindingRows(); });
235
+ action.setAttribute("aria-pressed", String(bindingDefault === routeId(item) && bindingSelection.has(key)));
236
+ const cell = node("td");if (item.unavailable) words(cell, "cap_model_unavailable");else cell.append(action);
237
+ row.append(name, node("td", source(item.source)?.name || item.source), node("td", count(capability.context_window)), node("td", reasoningText(capability)), cell);body.append(row);
238
+ }
239
+ if (!body.children.length) { const row = node("tr"), cell = node("td");cell.colSpan = 5;words(cell, "cap_no_models");const link = node("a");link.href = "#models";words(link, "model_services");cell.append(" ", link);row.append(cell);body.append(row); }
161
240
  }
162
- el("connection-current").addEventListener("change", clientModels);
163
- clientForm.addEventListener("submit", e => { e.preventDefault();const c = client(editingClient), selected = el("connection-current").value;
164
- void change({ operation: "client", id: c.id, enabled: true, source: selected || null, allowed: [...el("connection-client-allowed").querySelectorAll("input:checked")].map(input => input.value).concat(c.allowed.filter(id => !source(id)?.enabled)),
165
- ...(selected.startsWith("api_") && c.id === "codex" ? { model: el("connection-current-model").value, auto_review_model: el("connection-current-model").value } : {}) });
241
+ function editClient(c) { location.hash = c.id === "codex" ? "codex" : "claude";if (c.id !== "codex") claudeClient = c.id;mountClient(true); }
242
+ for (const segment of document.querySelectorAll("[data-claude-client]")) segment.addEventListener("click", () => {
243
+ claudeClient = segment.dataset.claudeClient;bindingDirty = false;
244
+ for (const button of document.querySelectorAll("[data-claude-client]")) button.setAttribute("aria-pressed", String(button === segment));mountClient(true);
166
245
  });
246
+ el("connection-auto-sync").addEventListener("change", () => { bindingDirty = true;el("connection-client-cancel").disabled = false; });
247
+ el("connection-client-cancel").addEventListener("click", () => mountClient(true));
248
+ function bindingInput(operation) {
249
+ const c = client(editingClient);return { operation, id: c.id, enabled: true, allowed: c.allowed,
250
+ deployments: [...bindingSelection].map(key => { const [source, model] = key.split("\0");return { source, model }; }),
251
+ default_model: bindingDefault, auto_sync: el("connection-auto-sync").checked };
252
+ }
253
+ clientForm.addEventListener("submit", event => { event.preventDefault();void change(bindingInput("client")); });
254
+ el("connection-sync-preview").addEventListener("click", () => void change(bindingInput("preview_client"), result => syncPreview(result.preview)));
167
255
  function disableSource(provider) {
168
256
  const affected = data.clients.filter(c => c.enabled && c.source === provider.id);
169
257
  if (!affected.length) { void change({ operation: "provider", id: provider.id, enabled: false });return; }
@@ -173,11 +261,11 @@
173
261
  el("connection-disable-form").addEventListener("submit", e => { e.preventDefault();void change({ operation: "provider", id: disabling, enabled: false,
174
262
  replacements: Object.fromEntries([...el("connection-replacements").querySelectorAll("select")].map(select => [select.name, select.value || null])) }); });
175
263
  el("connection-add").addEventListener("click", () => { if (data) editApi(); });
176
- for (const id of ["connection-cancel", "connection-client-cancel", "connection-disable-cancel"]) el(id).addEventListener("click", () => panels());
177
- window.addEventListener("hashchange", () => { apiForm.elements.key.value = "";if (["#system", "#claude", "#codex"].includes(location.hash)) void load(); });
264
+ for (const id of ["connection-cancel", "connection-disable-cancel"]) el(id).addEventListener("click", () => panels());
265
+ window.addEventListener("hashchange", () => { apiForm.elements.key.value = "";mountClient();if (["#models", "#claude", "#codex"].includes(location.hash)) void load(); });
178
266
  window.addEventListener("ccdx:choose-source", event => { if (typeof event.detail?.id === "string" && providerEntries.some(p => p.id === event.detail.id)) chooseProvider(event.detail.id); });
179
267
  new MutationObserver(() => { if (data) list(); }).observe(document.documentElement, { attributes: true, attributeFilter: ["lang"] });
180
- globalThis.ccdxConnections = { load, editClient: id => { if (data && client(id)) { location.hash = "system";editClient(client(id)); } } };
268
+ globalThis.ccdxConnections = { load, editClient: id => { if (data && client(id)) { editClient(client(id)); } } };
181
269
  for (const button of document.querySelectorAll("[data-client-access]")) button.addEventListener("click", () => globalThis.ccdxConnections.editClient(button.dataset.clientAccess));
182
270
  void load();
183
271
  })();
@@ -64,7 +64,22 @@
64
64
  <section class="panel dashboard-section"><h2 data-i18n="this_run_usage">THIS RUN</h2><p id="runtime-usage" class="table-note"></p><p class="table-note"><span data-i18n="approx_cache_hit_rate">Approx. cache hit rate</span>: <strong id="runtime-cache-hit" data-i18n-title="runtime_cache_hit_basis" title="Reused input / input tokens. ~ Partial counts. — Unknown or invalid.">—</strong></p><p class="hint" data-i18n="updated_from_returned_usage_not_a_live_bill_pending_usage_is_not">Counts returned usage only. Pending usage is not included. This is not a live bill.</p></section>
65
65
  </div>
66
66
  <div data-view="codex" hidden>
67
- <section class="panel dashboard-section" aria-labelledby="routing-heading">
67
+ <div id="codex-model-management"> <section class="panel dashboard-section" id="connection-clients">
68
+ <h2 data-i18n="cap_app_access">App access</h2><div id="connection-client-list"></div>
69
+ <details id="connection-disabled-clients" class="connection-disabled" hidden><summary data-i18n="api_disabled_clients">Disabled clients</summary><div id="connection-disabled-client-list"></div></details>
70
+ </section>
71
+ <section class="panel dashboard-section" id="connection-client-editor" hidden aria-labelledby="connection-client-title">
72
+ <div class="panel-heading"><h2 id="connection-client-title"></h2><button type="button" id="connection-client-cancel" data-i18n="cap_discard_changes">Discard changes</button></div>
73
+ <form id="connection-client-form">
74
+ <div class="table-wrap"><table class="binding-table"><thead><tr><th data-i18n="cap_visible_model">Available models</th><th data-i18n="source">Source</th><th data-i18n="cap_context">Context</th><th data-i18n="cap_reasoning">Reasoning</th><th data-i18n="cap_default">Default</th></tr></thead><tbody id="connection-bindings"></tbody></table></div>
75
+ <div class="setting-row"><label for="connection-auto-sync" data-i18n="cap_auto_sync">Sync model settings</label><input id="connection-auto-sync" type="checkbox" role="switch" checked><span class="hint" data-i18n="cap_sync_scope">Preserves your manual settings.</span></div>
76
+ <div class="section-actions"><button type="submit" data-i18n="api_save">Save</button><button type="button" id="connection-sync-preview" data-i18n="cap_sync_preview">Review sync</button></div>
77
+ <p id="connection-client-note" class="hint" role="status" aria-live="polite"></p>
78
+ <div id="connection-sync-result" hidden></div>
79
+ </form>
80
+ </section>
81
+ </div>
82
+ <section class="panel dashboard-section" aria-labelledby="routing-heading" id="legacy-source-controls" hidden>
68
83
  <h2 id="routing-heading" data-i18n="codex_model_source">CODEX MODEL SOURCE</h2>
69
84
  <p class="hint" data-i18n="source_changes_new_requests">Changes apply to later Codex requests.</p>
70
85
  <div class="section-actions">
@@ -127,19 +142,15 @@
127
142
  </details>
128
143
  </div>
129
144
  <div data-view="claude" hidden>
130
- <div class="section-actions"><button type="button" data-client-access="claude_app" data-i18n="api_claude_app_settings">Claude App settings</button><button type="button" data-client-access="claude_code" data-i18n="api_claude_code_settings">Claude Code settings</button></div>
145
+ <div class="provider-tabs client-segments" role="group" aria-label="Claude app"><button type="button" data-claude-client="claude_app" aria-pressed="true">Claude App</button><button type="button" data-claude-client="claude_code" aria-pressed="false">Claude Code</button></div>
146
+ <div id="claude-model-management"></div>
131
147
  <section class="panel dashboard-section" id="claude-connections">
132
148
  <h2 data-i18n="client_connections">APP SETUP</h2>
133
149
  <div class="table-wrap"><table><thead><tr><th data-i18n="client">APP</th><th data-i18n="connection_setup" data-i18n-title="configured_not_successful">Setup</th><th data-i18n="local_bridge">Local service</th><th data-i18n="last_request">LAST REQUEST</th></tr></thead><tbody id="claude-clients"></tbody></table></div>
134
150
  <p id="claude-client-state" class="hint"></p>
135
151
 
136
152
  </section>
137
- <section class="panel dashboard-section">
138
- <h2 data-i18n="source">Source</h2><p class="table-note">Microsoft 365</p>
139
- <p class="hint" data-i18n="claude_shared_source">Account and source settings apply to both Claude apps.</p>
140
- <a class="section-link" href="#models" data-source-link="m365" data-i18n="manage_source_account">Manage source and account</a>
141
- <details class="tool-details"><summary data-i18n="connection_details">Connection details</summary><p id="claude-route" class="table-note"></p><p>Anthropic Messages</p></details>
142
- </section>
153
+ <details class="panel dashboard-section"><summary data-i18n="connection_details">Connection details</summary><p id="claude-route" class="table-note"></p><p>Anthropic Messages</p><a class="section-link" href="#models" data-i18n="model_services">Model sources</a></details>
143
154
  <section class="panel dashboard-section" id="claude-performance">
144
155
  <div class="panel-heading"><h2 data-i18n="request_performance">REQUEST PERFORMANCE</h2><span data-i18n="messages_combined_since_start">MESSAGES COMBINED / SINCE STARTUP</span></div>
145
156
  <dl class="stats"><div><dt data-i18n="completed">Completed</dt><dd id="claude-completed">—</dd></div><div><dt data-i18n="incomplete">Incomplete</dt><dd id="claude-incomplete">—</dd></div><div><dt data-i18n="failed">Failed</dt><dd id="claude-failed">—</dd></div><div><dt data-i18n="cancelled">Cancelled</dt><dd id="claude-cancelled">—</dd></div><div><dt data-i18n="first_output">First output</dt><dd id="claude-ttft">—</dd></div><div><dt data-i18n="output_speed">Output speed</dt><dd id="claude-speed">—</dd></div></dl>
@@ -150,7 +161,38 @@
150
161
  </section>
151
162
  </div>
152
163
  <div data-view="models" hidden>
153
- <p class="table-note" data-i18n="tools_source_browse">Browse source</p>
164
+ <section class="panel dashboard-section" id="connection-sources">
165
+ <div class="panel-heading"><h2 data-i18n="model_services">Model sources</h2><button id="connection-add" type="button" data-i18n="api_add">Add API</button></div>
166
+ <div id="connection-source-list"></div>
167
+ <details id="connection-disabled-sources" class="connection-disabled" hidden><summary data-i18n="api_disabled_sources">Disabled sources</summary><div id="connection-disabled-source-list"></div></details>
168
+ </section>
169
+ <section class="panel dashboard-section" id="connection-editor" hidden aria-labelledby="connection-editor-title">
170
+ <div class="panel-heading"><h2 id="connection-editor-title" data-i18n="api_add">Add API</h2><button type="button" id="connection-cancel" data-i18n="cancel">Cancel</button></div>
171
+ <form id="connection-api-form">
172
+ <div class="connection-fields">
173
+ <label><span data-i18n="api_name">Name</span><input id="connection-name" name="name" type="text" maxlength="60" required autocomplete="off"></label>
174
+ <label><span data-i18n="api_base">API address</span><input id="connection-base" name="base" type="url" required autocomplete="off" spellcheck="false" placeholder="https://api.example.com/v1"></label>
175
+ <label><span>API Key</span><input id="connection-key" name="key" type="password" autocomplete="off" spellcheck="false"><span class="hint" data-i18n="api_key_private">Stored separately. Never sent to clients.</span></label>
176
+ </div>
177
+ <fieldset><legend data-i18n="api_protocols">Available APIs</legend><div class="connection-checks"><label><input type="checkbox" name="protocol" value="messages" checked>Messages</label><label><input type="checkbox" name="protocol" value="responses" checked>Responses</label><label><input type="checkbox" name="protocol" value="chat">Chat Completions</label></div></fieldset>
178
+ <details class="tool-details"><summary data-i18n="api_endpoint_options">Addresses &amp; authentication</summary><div class="connection-fields">
179
+ <label>Messages<input name="messages_url" type="url"></label><label>Responses<input name="responses_url" type="url"></label><label>Chat Completions<input name="chat_url" type="url"></label>
180
+ <label><span data-i18n="api_messages_auth">Messages authentication</span><select name="auth_header"><option value="x-api-key">x-api-key</option><option value="bearer">Bearer token</option></select></label>
181
+ <label><span data-i18n="api_key_env">Read key from environment</span><input name="key_env" type="text" autocomplete="off" spellcheck="false" placeholder="CCDX_COMPANY_API_KEY"><span class="hint" data-i18n="api_key_env_hint">Optional for servers without a credential service. Set before starting CCDX.</span></label>
182
+ </div></details>
183
+ <fieldset><legend data-i18n="api_allowed_clients">Allowed clients</legend><div class="connection-checks" id="connection-allowed-clients"></div></fieldset>
184
+ <fieldset><legend data-i18n="model_catalog">Model list</legend><div class="section-actions"><button type="button" id="connection-discover" data-i18n="api_read_models">Read models</button><span class="hint" data-i18n="api_discovery_save_first">Save the API first. No chat request is sent.</span></div>
185
+ <details class="tool-details" id="connection-manual-model"><summary data-i18n="api_manual_model">Add a model manually</summary><div class="section-actions"><input type="text" id="connection-model-id" spellcheck="false" autocomplete="off" aria-label="Model ID" placeholder="Model ID"><button type="button" id="connection-model-add" data-i18n="api_add_model">Add model</button></div></details>
186
+ <p class="hint" data-i18n="api_model_protocol_hint">Choose the APIs each model supports.</p><div class="table-wrap"><table><thead><tr><th data-i18n="model">Model</th><th data-i18n="api_protocols">Available APIs</th><th data-i18n="cap_context">Context</th><th data-i18n="cap_reasoning">Reasoning</th><th data-i18n="cap_search">Search</th><th></th></tr></thead><tbody id="connection-models"></tbody></table></div>
187
+ </fieldset>
188
+ <div id="connection-model-detail" hidden></div>
189
+ <div class="section-actions"><button type="submit" data-i18n="api_save">Save</button></div>
190
+ </form>
191
+ </section>
192
+ <section class="panel dashboard-section" id="connection-disable-editor" hidden aria-labelledby="connection-disable-title"><h2 id="connection-disable-title" data-i18n="api_disable_source">Disable source</h2><p class="hint" data-i18n="api_choose_replacements">Choose another source or pause each affected client.</p><form id="connection-disable-form"><div id="connection-replacements" class="connection-fields"></div><div class="section-actions"><button type="submit" data-i18n="api_confirm_disable">Disable</button><button type="button" id="connection-disable-cancel" data-i18n="cancel">Cancel</button></div></form></section>
193
+ <p id="connection-note" class="hint" role="status" aria-live="polite"></p>
194
+
195
+
154
196
  <div id="model-providers" class="provider-tabs" role="tablist" aria-label="Model providers" data-i18n-label="model_providers"></div>
155
197
 
156
198
  <div id="source-account-panel" role="tabpanel">
@@ -289,47 +331,6 @@
289
331
  </details>
290
332
  </div>
291
333
  <div data-view="system" hidden>
292
- <section class="panel dashboard-section" id="connection-sources">
293
- <div class="panel-heading"><h2 data-i18n="model_services">Model sources</h2><button id="connection-add" type="button" data-i18n="api_add">Add API</button></div>
294
- <div id="connection-source-list"></div>
295
- <details id="connection-disabled-sources" class="connection-disabled" hidden><summary data-i18n="api_disabled_sources">Disabled sources</summary><div id="connection-disabled-source-list"></div></details>
296
- </section>
297
- <section class="panel dashboard-section" id="connection-clients">
298
- <h2 data-i18n="api_clients">Clients</h2><div id="connection-client-list"></div>
299
- <details id="connection-disabled-clients" class="connection-disabled" hidden><summary data-i18n="api_disabled_clients">Disabled clients</summary><div id="connection-disabled-client-list"></div></details>
300
- </section>
301
- <section class="panel dashboard-section" id="connection-editor" hidden aria-labelledby="connection-editor-title">
302
- <div class="panel-heading"><h2 id="connection-editor-title" data-i18n="api_add">Add API</h2><button type="button" id="connection-cancel" data-i18n="cancel">Cancel</button></div>
303
- <form id="connection-api-form">
304
- <div class="connection-fields">
305
- <label><span data-i18n="api_name">Name</span><input id="connection-name" name="name" type="text" maxlength="60" required autocomplete="off"></label>
306
- <label><span data-i18n="api_base">API address</span><input id="connection-base" name="base" type="url" required autocomplete="off" spellcheck="false" placeholder="https://api.example.com/v1"></label>
307
- <label><span>API Key</span><input id="connection-key" name="key" type="password" autocomplete="off" spellcheck="false"><span class="hint" data-i18n="api_key_private">Stored separately. Never sent to clients.</span></label>
308
- </div>
309
- <fieldset><legend data-i18n="api_protocols">Available APIs</legend><div class="connection-checks"><label><input type="checkbox" name="protocol" value="messages" checked>Messages</label><label><input type="checkbox" name="protocol" value="responses" checked>Responses</label><label><input type="checkbox" name="protocol" value="chat">Chat Completions</label></div></fieldset>
310
- <details class="tool-details"><summary data-i18n="api_endpoint_options">Addresses &amp; authentication</summary><div class="connection-fields">
311
- <label>Messages<input name="messages_url" type="url"></label><label>Responses<input name="responses_url" type="url"></label><label>Chat Completions<input name="chat_url" type="url"></label>
312
- <label><span data-i18n="api_messages_auth">Messages authentication</span><select name="auth_header"><option value="x-api-key">x-api-key</option><option value="bearer">Bearer token</option></select></label>
313
- <label><span data-i18n="api_key_env">Read key from environment</span><input name="key_env" type="text" autocomplete="off" spellcheck="false" placeholder="CCDX_COMPANY_API_KEY"><span class="hint" data-i18n="api_key_env_hint">Optional for servers without a credential service. Set before starting CCDX.</span></label>
314
- </div></details>
315
- <fieldset><legend data-i18n="api_allowed_clients">Allowed clients</legend><div class="connection-checks" id="connection-allowed-clients"></div></fieldset>
316
- <fieldset><legend data-i18n="model_catalog">Model list</legend><div class="section-actions"><button type="button" id="connection-discover" data-i18n="api_read_models">Read models</button><span class="hint" data-i18n="api_discovery_save_first">Save the API first. No chat request is sent.</span></div>
317
- <details class="tool-details" id="connection-manual-model"><summary data-i18n="api_manual_model">Add a model manually</summary><div class="section-actions"><input type="text" id="connection-model-id" spellcheck="false" autocomplete="off" aria-label="Model ID" placeholder="Model ID"><button type="button" id="connection-model-add" data-i18n="api_add_model">Add model</button></div></details>
318
- <p class="hint" data-i18n="api_model_protocol_hint">Choose the APIs each model supports.</p><div class="table-wrap"><table><thead><tr><th data-i18n="model">Model</th><th data-i18n="api_protocols">Available APIs</th><th></th></tr></thead><tbody id="connection-models"></tbody></table></div>
319
- </fieldset>
320
- <div class="section-actions"><button type="submit" data-i18n="api_save">Save</button></div>
321
- </form>
322
- </section>
323
- <section class="panel dashboard-section" id="connection-client-editor" hidden aria-labelledby="connection-client-title">
324
- <div class="panel-heading"><h2 id="connection-client-title"></h2><button type="button" id="connection-client-cancel" data-i18n="cancel">Cancel</button></div>
325
- <form id="connection-client-form"><div class="connection-fields"><label><span data-i18n="api_current_source">Current source</span><select id="connection-current"></select></label><label id="connection-current-model-row"><span data-i18n="model">Model</span><select id="connection-current-model"></select></label></div>
326
- <fieldset><legend data-i18n="api_allowed_sources">Allowed sources</legend><div id="connection-client-allowed" class="connection-checks"></div></fieldset>
327
- <p class="hint" data-i18n="api_existing_requests">Existing requests keep their source. Use a new conversation after switching.</p>
328
- <div class="section-actions"><button type="submit" data-i18n="api_save">Save</button></div>
329
- </form>
330
- </section>
331
- <section class="panel dashboard-section" id="connection-disable-editor" hidden aria-labelledby="connection-disable-title"><h2 id="connection-disable-title" data-i18n="api_disable_source">Disable source</h2><p class="hint" data-i18n="api_choose_replacements">Choose another source or pause each affected client.</p><form id="connection-disable-form"><div id="connection-replacements" class="connection-fields"></div><div class="section-actions"><button type="submit" data-i18n="api_confirm_disable">Disable</button><button type="button" id="connection-disable-cancel" data-i18n="cancel">Cancel</button></div></form></section>
332
- <p id="connection-note" class="hint" role="status" aria-live="polite"></p>
333
334
  <section class="panel dashboard-section" aria-labelledby="web-appearance-title">
334
335
  <h2 id="web-appearance-title" data-i18n="appearance_web_appearance">网页外观</h2>
335
336
  <div class="appearance-row">
@@ -1,5 +1,63 @@
1
1
  (() => {
2
2
  const translations = {
3
+ "cap_discard_changes": ["Discard changes", "放弃修改"],
4
+ "cap_current_budget": ["Current budget", "当前预算"],
5
+ "cap_proposed_budget": ["After sync", "同步后预算"],
6
+ "cap_limit_reasoning_levels_limited": ["This client cannot show this exact set of reasoning levels.", "客户端无法完整表达这组推理等级。"],
7
+ "cap_limit_manual_sync": ["Automatic sync is off for a shared consumer. Shared settings were preserved.", "共享客户端已关闭自动同步,保留共享设置。"],
8
+ "cap_catalog_stale": ["Refresh failed. Last saved metadata is shown.", "刷新失败,保留上次保存的资料。"],
9
+ "cap_visible_model": ["Available models", "可用模型"],
10
+ "cap_context": ["Context", "上下文"],
11
+ "cap_reasoning": ["Reasoning", "推理"],
12
+ "cap_search": ["Search", "联网搜索"],
13
+ "cap_default": ["Default", "默认"],
14
+ "cap_set_default": ["Set default", "设为默认"],
15
+ "cap_details": ["Details", "能力详情"],
16
+ "cap_app_access": ["App access", "应用接入"],
17
+ "cap_unknown": ["Not declared", "待确认"],
18
+ "cap_supported": ["Supported", "支持"],
19
+ "cap_unsupported": ["Not supported", "不支持"],
20
+ "cap_auto_sync": ["Sync model settings", "同步模型设置"],
21
+ "cap_sync_scope": ["Preserves your manual settings.", "保留你手动修改的设置。"],
22
+ "cap_sync_preview": ["Review sync", "查看同步"],
23
+ "cap_no_models": ["No models yet. Add a source first.", "暂无可用模型,请先添加来源。"],
24
+ "cap_follow_catalog": ["Use catalog value", "跟随目录"],
25
+ "cap_manual": ["Manual override", "手动设置"],
26
+ "cap_catalog": ["Declared by this API", "此 API 目录声明"],
27
+ "cap_metadata_scope": ["Blank uses this API’s catalog. Missing fields remain unknown.", "留空时跟随此 API 目录,缺失字段保持待确认。"],
28
+ "cap_apply_details": ["Apply to draft", "应用到草稿"],
29
+ "cap_details_draft": ["Details updated. Save the source to apply.", "能力已加入草稿,请保存来源。"],
30
+ "cap_preview_scope": ["Save to apply. Restart Claude after its settings change.", "保存后同步;Claude 配置更新后需重启。"],
31
+ "cap_sync_configured": ["Managed settings synchronized.", "受管设置已同步。"],
32
+ "cap_sync_partially_preserved": ["Your existing settings were preserved.", "已保留现有手动设置。"],
33
+ "cap_sync_limited": ["Some client settings cannot be expressed.", "部分能力无法在当前客户端配置中表达。"],
34
+ "cap_sync_configuration_unavailable": ["Could not update client settings. Existing files were preserved.", "客户端配置暂不可写,已保留原文件。"],
35
+ "cap_sync_planned": ["Ready to synchronize.", "可以同步。"],
36
+ "cap_sync_not_configured": ["No models selected.", "尚未选择模型。"],
37
+ "cap_limit_context_unknown": ["Context is not declared; no global window override.", "窗口待确认,不覆盖共享窗口。"],
38
+ "cap_limit_context_range_limited": ["This context budget is outside the client’s 100K–1M range.", "此预算超出客户端 100K–1M 范围。"],
39
+ "cap_limit_client_version_unknown": ["Client version not verified; advanced host settings kept unchanged.", "客户端版本未确认,保留高级宿主设置。"],
40
+ "cap_limit_search_messages_unavailable": ["Native search is not declared for Messages.", "Messages 未声明原生联网搜索。"],
41
+ "cap_limit_capability_list_limited": ["Capability list exceeds the client’s limit.", "能力列表超出客户端长度限制。"],
42
+ "ccdx_api_effort_unavailable": ["Choose a reasoning level declared by this model.", "请选择该模型声明的推理等级。"],
43
+ "ccdx_api_models_invalid": ["Check model capabilities and APIs.", "请检查模型能力与接口配置。"],
44
+ "cap_field_context_window": ["Context window (tokens)", "上下文窗口(tokens)"],
45
+ "cap_field_max_input_tokens": ["Maximum input (tokens)", "最大输入(tokens)"],
46
+ "cap_field_max_output_tokens": ["Maximum reply (tokens)", "最大回复(tokens)"],
47
+ "cap_field_reasoning": ["Reasoning", "推理"],
48
+ "cap_field_reasoning_required": ["Reasoning required", "必须推理"],
49
+ "cap_field_reasoning_adaptive": ["Adaptive reasoning", "自适应推理"],
50
+ "cap_field_reasoning_budget_min": ["Minimum reasoning budget", "最小推理预算"],
51
+ "cap_field_reasoning_budget_max": ["Maximum reasoning budget", "最大推理预算"],
52
+ "cap_field_reasoning_efforts": ["Reasoning levels (comma separated)", "推理等级(逗号分隔)"],
53
+ "cap_field_reasoning_format": ["Reasoning API", "推理参数接口"],
54
+ "cap_field_input_modalities": ["Input types (text, image, …)", "输入类型(text、image 等)"],
55
+ "cap_field_tools": ["Tool calls", "工具调用"],
56
+ "cap_field_parallel_tools": ["Parallel tool calls", "并行工具调用"],
57
+ "cap_field_streaming": ["Streaming", "流式输出"],
58
+ "cap_field_structured_output": ["Structured output", "结构化输出"],
59
+ "cap_field_web_search": ["Native search APIs (messages, responses, chat)", "原生搜索接口(messages、responses、chat)"],
60
+
3
61
  "api_add": ["Add API", "添加 API"],
4
62
  "api_clients": ["Clients", "客户端"],
5
63
  "api_disabled_sources": ["Disabled sources", "已关闭的模型来源"],
@@ -67,7 +125,8 @@
67
125
  "ccdx_api_name_exists": ["This source name is already used. Choose another name.", "来源名称已存在,请换一个名称。"],
68
126
  "ccdx_api_model_reserved": ["codex-auto-review is reserved by CCDX. Enter the real upstream model ID.", "codex-auto-review 为内部名称,请填真实模型 ID。"],
69
127
  "ccdx_connections_limit": ["Connection settings exceed the 8 MiB limit.", "接入配置超过 8 MiB 上限。"],
70
- "ccdx_api_model_unavailable": ["Choose a configured model with the required API.", "请选择支持对应接口的已配置模型。"],
128
+ "ccdx_api_model_unavailable": ["Selected model unavailable. Refresh or clear its selection.", "所选模型暂不可用,请刷新或取消选择。"],
129
+ "cap_model_unavailable": ["Unavailable", "暂不可用"],
71
130
  "ccdx_api_protocol_required": ["Claude needs Messages; Codex needs Responses.", "Claude 需 Messages;Codex 需 Responses。"],
72
131
  "ccdx_api_effort_unavailable": ["Choose a reasoning level advertised by this model, or follow the client.", "请选择模型支持的推理档位,或跟随客户端。"],
73
132
  "ccdx_source_in_use": ["Change the current source or pause its clients first.", "请先更换来源,或暂停相关客户端。"],
@@ -476,3 +476,19 @@ input[role="switch"]:disabled { opacity: .5; cursor: wait; }
476
476
  .flow-logo { width:26px;height:26px; }
477
477
  }
478
478
  @media(prefers-reduced-motion:reduce) { .flow-packet,#request-flow[data-state="idle"] #flow-state::before { animation:none; } }
479
+
480
+ /* Model capability and application binding controls share the existing palette. */
481
+ .client-segments { margin-bottom: 18px; }
482
+ .client-segments button[aria-pressed="true"], .binding-table button[aria-pressed="true"] { color: var(--page); background: var(--accent); border-color: var(--accent); }
483
+ #connection-model-detail { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); }
484
+ #connection-model-detail h3 { overflow-wrap: anywhere; }
485
+ #connection-model-detail .connection-fields { margin-bottom: 18px; }
486
+ #connection-models td:last-child { min-width: 130px; }
487
+ #connection-models td:last-child button { margin: 3px; }
488
+ #connection-models td:first-child label, .binding-table td:first-child label { display: inline-flex; gap: 8px; align-items: center; min-height: 44px; }
489
+ .binding-table input { accent-color: var(--accent); flex: none; }
490
+ .binding-table td { white-space: normal; overflow-wrap: anywhere; }
491
+ .binding-table td:first-child { min-width: 180px; }
492
+ .binding-table td:last-child button { min-width: 102px; white-space: nowrap; }
493
+ #connection-sync-result { margin-top: 20px; }
494
+ #connection-sync-result tr:last-child td { border-bottom: 0; }