codex-copilot-dx 1.2.6 → 1.2.8

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.
Files changed (42) hide show
  1. package/README.md +5 -5
  2. package/bin/cli.mjs +42 -2
  3. package/docs/ARCHITECTURE.md +13 -1
  4. package/docs/README.md +5 -0
  5. package/docs/REFERENCE.md +31 -7
  6. package/package.json +1 -1
  7. package/src/account-tools.mjs +121 -0
  8. package/src/adapter.mjs +2 -0
  9. package/src/auth-credentials.mjs +18 -8
  10. package/src/auth-status.mjs +21 -7
  11. package/src/auth.mjs +1 -0
  12. package/src/claude-gateway.mjs +2 -2
  13. package/src/cli-auth.mjs +38 -1
  14. package/src/cli-options.mjs +46 -13
  15. package/src/cli-tools.mjs +25 -0
  16. package/src/cli-web.mjs +37 -0
  17. package/src/codex-config-doctor.mjs +4 -0
  18. package/src/copilot-client.mjs +1 -0
  19. package/src/copilot-token-session.mjs +9 -0
  20. package/src/dashboard/activity.js +27 -0
  21. package/src/dashboard/console.js +2 -1
  22. package/src/dashboard/icons.js +24 -0
  23. package/src/dashboard/index.html +63 -17
  24. package/src/dashboard/language.js +90 -0
  25. package/src/dashboard/status.js +10 -0
  26. package/src/dashboard/theme.js +3 -2
  27. package/src/dashboard/tools.js +151 -0
  28. package/src/dashboard/ui.css +73 -0
  29. package/src/dashboard/ui.js +5 -1
  30. package/src/dashboard-api.mjs +5 -0
  31. package/src/dashboard-tools.mjs +43 -0
  32. package/src/dashboard.mjs +3 -0
  33. package/src/doctor.mjs +3 -2
  34. package/src/local-tools.mjs +53 -0
  35. package/src/native-prediction-environment.mjs +1 -1
  36. package/src/observability.mjs +7 -1
  37. package/src/optional-routes.mjs +9 -3
  38. package/src/provider-runtime.mjs +2 -2
  39. package/src/stream-performance.mjs +7 -0
  40. package/src/terminal-colors.mjs +8 -3
  41. package/src/terminal-console.mjs +5 -3
  42. package/src/user-settings.mjs +2 -2
@@ -8,7 +8,7 @@ import { loadRuntimeConfig } from "./runtime-config.mjs";
8
8
  import { isLoopbackAddress, isLoopbackHostHeader } from "./security.mjs";
9
9
  import { safeUpstreamResponseHeaders } from "./upstream-headers.mjs";
10
10
  import { runWithRequestContext, currentRequestContext } from "./request-context.mjs";
11
- import { createStreamPerformanceMetrics } from "./stream-performance.mjs";
11
+ import { createStreamPerformanceMetrics, isMessagesOutputDelta } from "./stream-performance.mjs";
12
12
  import { buildMessagesUsageRecord, recordUsage } from "./usage-store.mjs";
13
13
  import { redactDiagnosticText } from "./diagnostic-text.mjs";
14
14
  import { decodedBodyLimitPreference } from "./user-settings.mjs";
@@ -123,7 +123,7 @@ export function createClaudeGatewayHandler({ provider, apiKey, log = () => {}, o
123
123
  if (event.type === "error") { failedEvent = true;outcome = "failed";return; }
124
124
  if (sawStop || failedEvent) return;
125
125
  if (event.type === "message_start") { responseId = event.message?.id;model = event.message?.model || model;usage = event.message?.usage || {}; }
126
- if (event.type === "content_block_delta") tracker?.firstOutput(event.delta?.type === "input_json_delta" ? "tool_arguments" : "output_text");
126
+ if (event.type === "content_block_delta" && isMessagesOutputDelta(event.delta)) tracker?.firstOutput();
127
127
  if (event.type === "message_delta") { usage = { ...usage, ...event.usage };stopReason = event.delta?.stop_reason || stopReason; }
128
128
  if (event.type === "message_stop") { sawStop = true;outcome = stopReason === "max_tokens" ? "incomplete" : "completed"; }
129
129
  }, config.maxSseBufferBytes);
package/src/cli-auth.mjs CHANGED
@@ -1,5 +1,8 @@
1
1
  import { authStatus, authStatusOnline } from "./auth-status.mjs";
2
2
  import { status } from "./status.mjs";
3
+ import { createInterface } from "node:readline/promises";
4
+ import { createAccountTools } from "./account-tools.mjs";
5
+ import { terminalCell as safeCell } from "./terminal-text.mjs";
3
6
  import {
4
7
  cliOutputFormat,
5
8
  cliOutputWidth,
@@ -29,7 +32,7 @@ function onlineStatusLine(profile) {
29
32
  function authStatusPlainLines(snapshot, { commandName }) {
30
33
  return [
31
34
  `${commandName} auth status`,
32
- status(snapshot.profiles.codex.valid ? "ok" : "warn", `Codex: ${accountLabel(snapshot.profiles.codex)} [legacy path]`),
35
+ status(snapshot.profiles.codex.valid ? "ok" : "warn", `Codex: ${accountLabel(snapshot.profiles.codex)} [${snapshot.profiles.codex.source === "ccdx" ? "CCDX store" : "legacy path"}]`),
33
36
  onlineStatusLine(snapshot.profiles.codex),
34
37
  status("info", `Routing: responses -> ${snapshot.routing.responses}`),
35
38
  ].filter(Boolean);
@@ -103,6 +106,40 @@ export async function runAuthCommand({
103
106
  output = process.stdout,
104
107
  ...options
105
108
  } = {}) {
109
+ if (["login", "reauth", "logout", "check"].includes(action)) {
110
+ const tools = options.tools || createAccountTools(options);
111
+ if (action === "check") {
112
+ const checked = await tools.check(), snapshot = authStatus(options);
113
+ snapshot.profiles.codex.online = checked.online ? { ...checked.online, httpStatus: checked.online.http_status } : null;
114
+ return { action, output: formatAuthStatus(snapshot, { commandName, format, output }), snapshot };
115
+ }
116
+ if (action === "logout") {
117
+ if (!options.yes) {
118
+ const input = options.input || process.stdin;
119
+ if (!input.isTTY || !output.isTTY) throw new Error("Use --yes to sign out of CCDX. Other apps stay signed in.");
120
+ const prompt = createInterface({ input, output });
121
+ try { if (!/^y(?:es)?$/i.test((await prompt.question("Sign out of CCDX? New requests will need a sign-in [y/N]: ")).trim())) return { action, output: "Sign-out cancelled." }; }
122
+ finally { prompt.close(); }
123
+ }
124
+ await tools.logout({ confirmed: true });
125
+ return { action, output: "Signed out of CCDX. Other apps stay signed in." };
126
+ }
127
+ const controller = new AbortController();
128
+ let id;
129
+ const cancel = () => { controller.abort();if (id) void tools.cancel(id);else tools.dispose(); };
130
+ process.once("SIGINT", cancel);
131
+ try {
132
+ const started = await tools.start({ reauth: action === "reauth" || options.reauth === true, expectedLogin: options.expectedLogin });
133
+ id = started.operation?.id;
134
+ if (controller.signal.aborted && id) await tools.cancel(id);
135
+ if (started.operation?.state === "authorizing") output.write(`Open ${started.operation.verification_uri}\nCode: ${started.operation.user_code}\nWaiting for GitHub. Ctrl+C cancels; saved sign-in is kept.\n`);
136
+ const result = await tools.wait();
137
+ if (result.operation?.state === "failed") throw new Error(`Sign-in failed: ${safeCell(result.operation.reason)}. Saved sign-in kept.`);
138
+ return { action, output: result.operation?.state === "cancelled" ? "Sign-in cancelled. Saved sign-in kept."
139
+ : result.operation?.state === "complete" ? "Signed in and verified. Use a new conversation; restart CCDX to change accounts."
140
+ : "A sign-in is saved. Run ccdx auth check to verify it, or ccdx auth reauth to replace it." };
141
+ } finally { process.removeListener("SIGINT", cancel);tools.dispose(); }
142
+ }
106
143
  if (action !== "status") throw new Error(`Unsupported auth action: ${action}`);
107
144
  const snapshot = online ? await authStatusOnline(options) : authStatus(options);
108
145
  return { action, output: formatAuthStatus(snapshot, { commandName, format, output }), snapshot };
@@ -18,6 +18,7 @@ const HELP_TOPICS = new Set([
18
18
  "start",
19
19
  "auth",
20
20
  "auth status",
21
+ "auth login", "auth reauth", "auth check", "auth logout", "reauth", "web", "source", "image", "doctor network", "doctor report",
21
22
  "doctor",
22
23
  "doctor config",
23
24
  "status",
@@ -129,6 +130,17 @@ function parseStartOptions(args) {
129
130
  export function parseCliArgs(args = []) {
130
131
  const [command, ...rest] = args;
131
132
  if (!command) return baseCommand("start");
133
+ if (command === "reauth") return parseCliArgs(["auth", "reauth", ...rest]);
134
+ if (command === "source") { if (rest.length === 1 && HELP_COMMANDS.has(rest[0])) return helpCommand(["source"]);return parseCliArgs(["m365", "switch", ...rest]); }
135
+ if (command === "web") { if (rest.length === 1 && HELP_COMMANDS.has(rest[0])) return helpCommand(["web"]);if (rest.length) unexpectedArgs(rest);return baseCommand("web"); }
136
+ if (command === "image") {
137
+ if (rest.length === 1 && HELP_COMMANDS.has(rest[0])) return helpCommand(["image"]);
138
+ const [action = "status", ...extra] = rest;
139
+ if (!["status", "pause", "resume"].includes(action)) throw new Error("Choose image status, pause or resume.");
140
+ if (extra.length) unexpectedArgs(extra);
141
+ return baseCommand("image", { action });
142
+ }
143
+ if (command === "doctor" && ["network", "report"].includes(rest[0]) && rest.length === 2 && HELP_COMMANDS.has(rest[1])) return helpCommand(["doctor", rest[0]]);
132
144
  if (HELP_COMMANDS.has(command)) {
133
145
  const topic = rest;
134
146
  if (topic.length > 2) unexpectedArgs(topic.slice(2));
@@ -241,8 +253,16 @@ export function parseCliArgs(args = []) {
241
253
  };
242
254
  }
243
255
  if (command === "auth") {
244
- const [action, ...authArgs] = rest;
245
- if (!action) throw new Error("Choose auth status or auth login.");
256
+ const [action = "status", ...authArgs] = rest;
257
+ if (["login", "reauth", "check", "logout"].includes(action)) {
258
+ const values = authArgs[0] === "github" || authArgs[0] === "codex" ? authArgs.slice(1) : authArgs;
259
+ const options = parseOptions(values, new Map(action === "logout" ? [["--yes", "flag"]]
260
+ : action === "check" ? [["--format", "value"]] : [["--login", "value"], ["--reauth", "flag"]]));
261
+ if (options["--login"] && !/^[a-z\d_-]{1,39}$/i.test(options["--login"])) throw new Error("Enter a GitHub account name.");
262
+ return baseCommand("auth", { action, ...(options["--yes"] ? { yes: true } : {}),
263
+ ...(options["--reauth"] ? { reauth: true } : {}), ...(options["--login"] ? { expectedLogin: options["--login"] } : {}),
264
+ ...(options["--format"] ? outputFormatOption(options["--format"]) : {}) });
265
+ }
246
266
  if (action === "status") {
247
267
  const options = parseOptions(authArgs, new Map([
248
268
  ["--online", "flag"],
@@ -258,12 +278,6 @@ export function parseCliArgs(args = []) {
258
278
  ...outputFormatOption(options["--format"]),
259
279
  };
260
280
  }
261
- if (action === "login") {
262
- const [profile, ...loginArgs] = authArgs;
263
- if (!profile) throw new Error("Choose the claude sign-in profile.");
264
- if (profile !== "claude") throw new Error(`Auth login profile must be claude: ${profile}`);
265
- return baseCommand("retired", { integration: "Claude App and Claude Code" });
266
- }
267
281
  throw new Error(`Unknown auth action: ${action}`);
268
282
  }
269
283
  if (command === "animation") {
@@ -272,7 +286,7 @@ export function parseCliArgs(args = []) {
272
286
  }
273
287
  if (command === "prediction") {
274
288
  const [action = "status", ...extra] = rest;
275
- if (!["on", "off", "status", "fix"].includes(action)) throw new Error("Choose prediction on, off, status or fix.");
289
+ if (!["on", "off", "status", "fix", "pause", "resume"].includes(action)) throw new Error("Choose prediction on, off, status, fix, pause or resume.");
276
290
  if (extra.length) unexpectedArgs(extra);
277
291
  return baseCommand("prediction", { action });
278
292
  }
@@ -309,6 +323,10 @@ export function parseCliArgs(args = []) {
309
323
  };
310
324
  }
311
325
  if (command === "doctor" || command === "--doctor") {
326
+ if (["network", "report"].includes(rest[0])) {
327
+ if (rest.length > 1) unexpectedArgs(rest.slice(1));
328
+ return baseCommand("doctor", { tool: rest[0] });
329
+ }
312
330
  const options = parseOptions(rest, new Map([
313
331
  ["--online", "flag"],
314
332
  ["--compat", "flag"],
@@ -380,9 +398,15 @@ export function cliCommandName() {
380
398
  }
381
399
 
382
400
  function topicHelp(name, topic) {
401
+ const authHelp = `Usage:\n ${name} auth status [--online] [--format table|plain]\n ${name} auth check [--format table|plain]\n ${name} auth login [--login ACCOUNT]\n ${name} auth reauth [--login ACCOUNT]\n ${name} auth logout [--yes]\n\n- Status reads local sign-in only. Check verifies GitHub, Copilot access and the model catalog; no inference.\n- Login uses GitHub device authorization. Reauth replaces a sign-in only after verification; cancel/failure keeps the old one.\n- The saved account is required by default. --login explicitly chooses another account; restart CCDX to change accounts.\n- New tool sign-ins use CCDX's own store; legacy sign-in stays compatible and is never deleted by logout.\n- Logout stops new authenticated requests in the notified service; other apps stay signed in.\n- ${name} reauth is a shortcut. Run ${name} web to open these tools without signing in first.`;
402
+ if (topic === "auth" || ["auth login", "auth reauth", "auth check", "auth logout", "reauth"].includes(topic)) return authHelp;
383
403
  const sections = {
404
+ web: `Usage:\n ${name} web\n\n- Opens an existing compatible dashboard, or starts a local management service.\n- No sign-in, app edits, prediction setup or app launch is required.\n- Ctrl+C stops a management service started by this command.\n- For normal app routing and optional startup integrations, stop that management service and run ${name}.`,
405
+ image: `Usage:\n ${name} image [status|pause|resume]\n\n- Pause/resume keeps provider credentials and setup. Running requests can finish.\n- Resume does not install or configure an image provider; first setup: ${name} enable-image.\n- disable-image removes the stored API credential; pause does not.`,
406
+ source: `Usage:\n ${name} source [github|m365] [--model ID] [--auto-review-model ID]\n\n- Alias for ${name} m365 switch, with the same validation and explicit model choices.\n- Applies to new Codex requests. Start a new conversation after changing sources.`,
407
+ "doctor network": `Usage:\n ${name} doctor network\n\n- Reads local proxy/trust diagnostics without sending external requests.\n- Does not change proxy, PAC, certificates or policy.`,
408
+ "doctor report": `Usage:\n ${name} doctor report\n\n- Prints a redacted local report as JSON. No inference or external service request.\n- Account details, credentials and chat content are omitted.`,
384
409
  start: `Usage:\n ${name} [start] [--show-request-id] [--no-browser] [--verbose]\n\n- Starts or reuses the local adapter, updates Codex configuration, and attempts to open Codex App when auto-launch is enabled and supported.\n- Interactive desktop starts also open WebUI once; --no-browser skips that attempt.\n- After startup the terminal shows fixed status/returned usage; --verbose or --show-request-id retains request detail.`,
385
- auth: `Usage:\n ${name} auth status [--online] [--format table|plain]\n\n- Shows the saved GitHub Copilot account without exposing credentials.\n- --online also verifies its entitlement and model catalog.`,
386
410
  "auth status": `Usage:\n ${name} auth status [--online] [--format table|plain]\n\n- Shows the saved GitHub Copilot account without exposing credentials.\n- --online also verifies its entitlement and model catalog.\n- Interactive terminals use a table by default.`,
387
411
  doctor: `Usage:\n ${name} doctor [--online] [--compat] [--fix] [--json]\n ${name} doctor config\n\n- Checks credentials, managed configuration, command launchers, adapter, enabled optional features and observed client catalog.\n- Default is read-only; no inference requests.\n- --online validates account entitlement; --compat sends minimal inference requests and consumes a small amount of Copilot usage, requiring successful model completion rather than HTTP 200 alone.\n- --fix repairs owned Windows launchers and managed config, imports a verified existing credential only if none is saved, and asks the running adapter to repair enabled predictions once.\n- No interactive login, client program edits, forced App restarts, policy changes or optional feature activation.\n- Missing-credential repair can contact GitHub without --online.\n- Changed existing config is backed up to config.toml.ccdx-doctor.bak.\n- Partial repairs exit 1.\n- --json emits a redacted report, including before_checks for repairs.\n- App-internal cache and visible predictions are not externally verified.\n- The config subcommand remains strictly read-only.`,
388
412
  "doctor config": `Usage:\n ${name} doctor config\n\n- Reads ~/.codex/config.toml, checks TOML syntax and CCDX-managed settings, and previews the existing startup writer's changes.\n- Does not merge Codex profiles or validate the complete installed Codex schema.\n- No authentication, network requests, file writes, or adapter/GUI startup.\n- Existing context_management=false is valid.\n- Exit 1 for errors, 0 for OK/warnings; unsupported arguments exit 2.`,
@@ -398,7 +422,7 @@ function topicHelp(name, topic) {
398
422
  "auto-review-model": `Usage:\n ${name} auto-review-model\n\n- Select a Responses model, then an advertised reasoning effort.\n- Enter keeps the default/current choice; q cancels both steps without saving.\n- Effort 0 follows the client (low when omitted).\n- Settings apply only to Auto-review on the next request; no client patch or restart is required for adapters running 0.9.13 or newer.`,
399
423
  "suggestion": `The CCDX prediction panel has been retired. Run ${name} suggestion off to safely remove unchanged CCDX registrations. This cleanup does not change native predictions; see ${name} prediction --help for that separate opt-in feature.`,
400
424
  m365: `Usage:\n ${name} m365 [status|models|accounts|account|on|off|remove]\n ${name} m365 account [--id ID]\n ${name} m365 switch [github|m365] [--model ID] [--auto-review-model ID]\n\n- M365 is discovered silently at startup on supported managed environments.\n- accounts lists local company accounts without requesting tokens.\n- account chooses a company account; --id supports scripts. A running updated service is required.\n- Saved bindings stay selected. Otherwise an exact Windows sign-in match, then a single company account, is used.\n- Changing accounts applies to M365 in Codex and Claude; start a new conversation.\n- Claude uses /anthropic on the same local port.\n- Codex stays on GitHub unless you explicitly switch.\n- M365 switching requires a running compatible adapter and available GPT/Auto-review choices; it never substitutes unavailable models.\n- Select an available model in Codex after switching an existing thread.\n- Off restores only owned Claude settings and selects GitHub.\n- Remove also clears the CCDX M365 profile, retaining a disabled preference and historical usage.\n- System Microsoft sign-in, GitHub credentials, predictions and images are preserved.`,
401
- prediction: `Usage:\n ${name} prediction [status|on|off|fix]\n\n- Optional native next-message predictions; off by default. macOS and Windows.\n- Windows requires the registered official MSIX App, an initialized profile, Windows PowerShell and .NET Framework 4.7.2+; Git/OpenSSL is not required for prediction setup.\n- Quit Codex before on/off, then restart ccdx.\n- On adds private App-profile certificate trust and an App-only route for chatgpt.com and ab.chatgpt.com.\n- HTTPS on those hosts is decrypted locally; only prediction configuration is changed.\n- No client program files, OS trust, account permissions, MCP or Hooks are changed.\n- Static HTTP/HTTPS/SOCKS5 proxies and bypass rules are preserved.\n- Windows supports company PAC/WPAD; macOS dynamic PAC/WPAD remains unsupported.\n- Static IPv4/IPv6 CIDRs match URL IP literals without DNS.\n- The bridge port persists across restarts/updates; a busy saved port disables only predictions.\n- Launch/reuse checks the App's actual route; an older random or missing route may require one full App quit.\n- Official prediction configuration is preserved; the conversation's model is used.\n- App updates require another compatibility check.\n- Status distinguishes saved preference and observed config traffic from unverified candidate visibility.\n- Fix asks a compatible running CCDX adapter to repair the enabled bridge once on its saved port.\n- It never enables predictions, renews certificates or force-restarts Codex.\n- Healthy unchanged bridges are retained.\n- Fix rechecks system proxy settings.\n- Changed routes may need a normal App relaunch to reload cached PAC; failed rechecks preserve the previous bridge with a nonzero exit.\n- Process environment variables and Node trust are not hot-reloaded; changed trust inputs need a CCDX service restart.\n- Startup, status and doctor share sanitized environment diagnostics.\n- Missing App routes require a normal full quit and ccdx launch; partial repair exits 1.\n- An older adapter must first be upgraded and restarted once to gain this repair endpoint.`,
425
+ prediction: `Usage:\n ${name} prediction [status|on|off|fix|pause|resume]\n\n- Pause/resume only pauses adaptation; trust and route setup are kept.\n- Resume does not activate a feature that has not been set up.\n- Optional native next-message predictions; off by default. macOS and Windows.\n- Windows requires the registered official MSIX App, an initialized profile, Windows PowerShell and .NET Framework 4.7.2+; Git/OpenSSL is not required for prediction setup.\n- Quit Codex before on/off, then restart ccdx.\n- On adds private App-profile certificate trust and an App-only route for chatgpt.com and ab.chatgpt.com.\n- HTTPS on those hosts is decrypted locally; only prediction configuration is changed.\n- No client program files, OS trust, account permissions, MCP or Hooks are changed.\n- Static HTTP/HTTPS/SOCKS5 proxies and bypass rules are preserved.\n- Windows supports company PAC/WPAD; macOS dynamic PAC/WPAD remains unsupported.\n- Static IPv4/IPv6 CIDRs match URL IP literals without DNS.\n- The bridge port persists across restarts/updates; a busy saved port disables only predictions.\n- Launch/reuse checks the App's actual route; an older random or missing route may require one full App quit.\n- Official prediction configuration is preserved; the conversation's model is used.\n- App updates require another compatibility check.\n- Status distinguishes saved preference and observed config traffic from unverified candidate visibility.\n- Fix asks a compatible running CCDX adapter to repair the enabled bridge once on its saved port.\n- It never enables predictions, renews certificates or force-restarts Codex.\n- Healthy unchanged bridges are retained.\n- Fix rechecks system proxy settings.\n- Changed routes may need a normal App relaunch to reload cached PAC; failed rechecks preserve the previous bridge with a nonzero exit.\n- Process environment variables and Node trust are not hot-reloaded; changed trust inputs need a CCDX service restart.\n- Startup, status and doctor share sanitized environment diagnostics.\n- Missing App routes require a normal full quit and ccdx launch; partial repair exits 1.\n- An older adapter must first be upgraded and restarted once to gain this repair endpoint.`,
402
426
  update: `Usage:\n ${name} update [npm|github] [--allow-remote]\n\n- Updates the global package from the configured npm registry or the latest stable GitHub release.\n- With no source, an interactive terminal prompts for one.\n- Windows uses system cmd.exe to run npm.cmd without changing PowerShell policy; use the .cmd entrypoint if scripts are blocked.\n- GitHub verifies a Release tarball; Git is not required. Dependencies use the configured npm registry.\n- By default npm's remote-download policy is preserved.\n- If npm reports EALLOWREMOTE for a trusted mirror tarball, --allow-remote explicitly permits URL dependencies for this one installation's entire dependency tree; it is not a hostname allowlist.\n- No .npmrc, registry or persistent policy is changed, and failed installations are not retried automatically.\n- Use this only if company policy permits it.\n- Restart the running adapter after installation.`,
403
427
  version: `Usage:\n ${name} --version`,
404
428
  };
@@ -414,6 +438,12 @@ export function cliHelp(commandName = "ccdx", topic = "") {
414
438
  ${name} auth status [--online] [--format table|plain]
415
439
  ${name} doctor [--online] [--compat] [--fix] [--json]
416
440
  ${name} doctor config
441
+ ${name} doctor network
442
+ ${name} doctor report
443
+ ${name} auth [login|reauth|check|logout]
444
+ ${name} web
445
+ ${name} source [github|m365]
446
+ ${name} image [status|pause|resume]
417
447
  ${name} status
418
448
  ${name} models [--format table|plain]
419
449
  ${name} usage [--format table|plain] [--provider ID]
@@ -424,7 +454,7 @@ export function cliHelp(commandName = "ccdx", topic = "") {
424
454
  ${name} disable-image
425
455
  ${name} image-status
426
456
  ${name} auto-review-model
427
- ${name} prediction [status|on|off|fix]
457
+ ${name} prediction [status|on|off|fix|pause|resume]
428
458
  ${name} m365 [status|models|accounts|account|switch|on|off|remove]
429
459
  ${name} update [npm|github] [--allow-remote]
430
460
  ${name} --version
@@ -432,7 +462,10 @@ export function cliHelp(commandName = "ccdx", topic = "") {
432
462
 
433
463
  Commands:
434
464
  start Start or reuse the adapter and configure Codex
435
- auth Inspect the saved GitHub Copilot account
465
+ auth Manage GitHub sign-in and check access
466
+ web Open local account and repair tools
467
+ source Choose a Codex model source
468
+ image Inspect, pause or resume image requests
436
469
  doctor Diagnose local config; optional live and inference checks
437
470
  status Show runtime routing, performance, queue, and cache health
438
471
  models Show the selected Codex provider's GPT model catalog
@@ -0,0 +1,25 @@
1
+ import { adapterBaseUrl, checkRunningAdapter } from "./running-adapter.mjs";
2
+ import { isLoopbackHost } from "./security.mjs";
3
+ import { readBoundedResponseText } from "./upstream-body.mjs";
4
+ import { writeServicePreference } from "./user-settings.mjs";
5
+
6
+ export async function dashboardToolRequest({ host = "127.0.0.1", port = 2026, path = "account", body, fetchImpl = fetch, timeoutMs = 5000 } = {}) {
7
+ const baseUrl = adapterBaseUrl(isLoopbackHost(host) ? host : "127.0.0.1", port);
8
+ const running = await checkRunningAdapter({ host, port, fetchImpl, timeoutMs });
9
+ if (!running.ok) throw new Error("Start or restart CCDX to use this tool.");
10
+ const response = await fetchImpl(`${baseUrl}/_ccdx/ui/${path}`, { method: body ? "POST" : "GET", redirect: "error",
11
+ headers: { "X-CCDX-Dashboard": "1", Origin: baseUrl, ...(body ? { "Content-Type": "application/json" } : {}) },
12
+ ...(body ? { body: JSON.stringify(body) } : {}), signal: AbortSignal.timeout(timeoutMs) });
13
+ const data = JSON.parse(await readBoundedResponseText(response, { maxBytes: 1024 * 1024, label: "Local tool response" }));
14
+ if (!response.ok) throw new Error("Local tool is unavailable. Restart the updated CCDX service.");
15
+ return data;
16
+ }
17
+
18
+ export async function pauseServiceFeature({ feature, action, home, env = process.env, host, port, request = dashboardToolRequest } = {}) {
19
+ const key = `${feature}_enabled`, value = action === "resume";
20
+ if (!["image", "prediction"].includes(feature) || !["pause", "resume"].includes(action)) throw new Error("Choose pause or resume for images or predictions.");
21
+ writeServicePreference(key, value, { home, env });
22
+ let applied = false;
23
+ try { await request({ host, port, path: "settings", body: { action: "preference", key, value } });applied = true; } catch {}
24
+ return `${feature === "image" ? "Image requests" : "Prediction adaptation"}: ${value ? "resumed" : "paused"}. Setup and credentials kept.${applied ? "" : " Start or restart CCDX to apply."}`;
25
+ }
@@ -0,0 +1,37 @@
1
+ import { startAdapter } from "./adapter.mjs";
2
+ import { defaultCopilotClient } from "./copilot.mjs";
3
+ import { createProfileRuntime } from "./profile-runtime.mjs";
4
+ import { createProfileModelRuntime } from "./profile-model-runtime.mjs";
5
+ import { createProviderRuntime } from "./provider-runtime.mjs";
6
+ import { createServiceControl } from "./service-control.mjs";
7
+ import { openDashboard } from "./browser-launch.mjs";
8
+ import { adapterBaseUrl, checkRunningAdapter } from "./running-adapter.mjs";
9
+ import { assertSafeAdapterHost, isLoopbackHost } from "./security.mjs";
10
+ import { closeHttpServer } from "./shutdown.mjs";
11
+
12
+ // Starts management without requesting sign-in or editing/launching an app.
13
+ export async function runWebCommand({ host = "127.0.0.1", port = 2026, env = process.env, home, output = console.log } = {}) {
14
+ assertSafeAdapterHost(host, env);
15
+ const baseUrl = adapterBaseUrl(isLoopbackHost(host) ? host : "127.0.0.1", port);
16
+ const running = await checkRunningAdapter({ host, port });
17
+ if (running.incompatible) throw new Error("Restart the updated CCDX service before opening the dashboard.");
18
+ if (running.ok) { await openDashboard(baseUrl, { env, interactive: true });output(`Web UI: ${baseUrl}`);return; }
19
+ let profile = createProfileRuntime({ home, codexClient: defaultCopilotClient });
20
+ const models = createProfileModelRuntime({ home, env, codexClient: defaultCopilotClient, codexCredentialFingerprint: () => profile.codexCredentialFingerprint });
21
+ const providers = createProviderRuntime({ home, env, corePort: port, githubClient: defaultCopilotClient,
22
+ githubRegistry: models.codexRegistry, githubClientConfigured: false, githubCredentialFingerprint: () => profile.codexCredentialFingerprint });
23
+ const serviceControl = createServiceControl({ home, env, providerRuntime: providers });
24
+ const server = await startAdapter(port, host, { providerRuntime: providers, codexModelRegistry: models.codexRegistry,
25
+ dashboardOptions: { home, env, host, port, serviceControl, credentialsChanged: () => {
26
+ defaultCopilotClient.invalidateCredentials();profile = createProfileRuntime({ home, codexClient: defaultCopilotClient });
27
+ } } });
28
+ let closing = false;
29
+ const stop = () => { if (closing) return;closing = true;void closeHttpServer(server).catch(() => { server.closeAllConnections();server.close(); }); };
30
+ server.ccdxWebClosed = new Promise(resolve => server.once("close", () => {
31
+ process.removeListener("SIGINT", stop);process.removeListener("SIGTERM", stop);
32
+ void providers.close().then(resolve, () => { output("Provider shutdown could not be verified.");resolve(); });
33
+ }));
34
+ process.once("SIGINT", stop);process.once("SIGTERM", stop);
35
+ await openDashboard(baseUrl, { env, interactive: true });output(`Web UI: ${baseUrl}\nManagement service running. Ctrl+C stops it.`);
36
+ return server;
37
+ }
@@ -2,6 +2,7 @@ import fs from "node:fs";
2
2
  import os from "node:os";
3
3
  import { codexPaths } from "./codex-paths.mjs";
4
4
  import { isDeepStrictEqual } from "node:util";
5
+ import { createHash } from "node:crypto";
5
6
  import { parse } from "smol-toml";
6
7
  import { computeUpdatedCodexConfig, initialCodexConfig } from "./config.mjs";
7
8
  import { adapterBaseUrl } from "./running-adapter.mjs";
@@ -177,6 +178,9 @@ export function repairCodexConfig(options = {}) {
177
178
  }
178
179
  let content = null;
179
180
  try { content = fs.readFileSync(file, "utf8"); } catch (error) { if (error.code !== "ENOENT") throw error; }
181
+ if (options.expectedRevision !== undefined && options.expectedRevision !== (content === null ? "missing" : createHash("sha256").update(content).digest("hex"))) {
182
+ throw Object.assign(new Error("config_preview_changed"), { code: "config_preview_changed", statusCode: 409 });
183
+ }
180
184
  const next = content === null ? { content: initialCodexConfig(port, host), changed: true }
181
185
  : computeUpdatedCodexConfig(content, port, host);
182
186
  if (!next.changed) return { status: "unchanged", changed: false };
@@ -231,6 +231,7 @@ export function createCopilotClientRuntime({
231
231
  getApiBase: tokenSession.getApiBase,
232
232
  runtimeStatus,
233
233
  getCopilotToken: tokenSession.getToken,
234
+ invalidateCredentials: tokenSession.invalidateCredentials,
234
235
  resetTokenForTests: tokenSession.resetForTests,
235
236
  chatCompletions,
236
237
  listModels,
@@ -304,6 +304,7 @@ export function createCopilotTokenSession({
304
304
  fetchImpl,
305
305
  signal,
306
306
  });
307
+ if (signal?.aborted) throw abortError(signal);
307
308
  const token = cacheTokenData(data, {
308
309
  sourceKey: credentials.sourceKey,
309
310
  githubToken: credentials.token,
@@ -384,10 +385,18 @@ export function createCopilotTokenSession({
384
385
  apiBase = defaultApiBase;
385
386
  }
386
387
 
388
+ function invalidateCredentials() {
389
+ refreshFlight?.controller.abort();
390
+ refreshFlight = null;
391
+ copilotToken = null;copilotTokenExpiry = 0;refreshRetryAt = 0;
392
+ // Keep the account binding. Switching accounts still requires a restart.
393
+ }
394
+
387
395
  return Object.freeze({
388
396
  getToken,
389
397
  getApiBase: () => apiBase,
390
398
  runtimeStatus,
399
+ invalidateCredentials,
391
400
  resetForTests,
392
401
  });
393
402
  }
@@ -0,0 +1,27 @@
1
+ (() => {
2
+ const node = document.getElementById("model-activity"), label = document.getElementById("model-activity-label");
3
+ let signature, expiry = null, deadline = 0;
4
+ function show(active) {
5
+ const state = Number.isSafeInteger(active) && active >= 0 ? active > 0 ? "active" : "idle" : "unknown";
6
+ const next = `${state}:${active}`;
7
+ if (next === signature) return;
8
+ signature = next;node.dataset.state = state;
9
+ const key = state === "active" ? "model_activity_active" : state === "idle" ? "model_activity_idle" : "model_activity_unknown";
10
+ globalThis.ccdxLanguage.set(node, key, { count: active }, "aria-label");
11
+ label.hidden = state === "idle";
12
+ globalThis.ccdxLanguage.set(label, key, { count: active });
13
+ }
14
+ function pause() {
15
+ if (deadline && Date.now() >= deadline) unavailable();
16
+ node.dataset.paused = String(document.visibilityState !== "visible" || Boolean(node.closest("[hidden]")));
17
+ }
18
+ document.addEventListener("visibilitychange", pause);
19
+ globalThis.addEventListener("pagehide", () => { node.dataset.paused = "true"; });
20
+ globalThis.addEventListener("pageshow", pause);
21
+ function unavailable() { clearTimeout(expiry);expiry = null;deadline = 0;show(null); }
22
+ globalThis.ccdxDashboardActivity = {
23
+ update(data) { clearTimeout(expiry);show(data?.active);deadline = Date.now() + 6000;expiry = setTimeout(unavailable, 6000); },
24
+ unavailable, visibilityChanged: pause,
25
+ };
26
+ pause();
27
+ })();
@@ -1,7 +1,7 @@
1
1
  (() => {
2
2
  const el = id => document.getElementById(id);
3
3
  const label = (node, key, values = {}) => globalThis.ccdxLanguage.set(node, key, values);
4
- const titles = { overview: "overview", codex: "Codex", claude: "Claude", models: "model_services", usage: "usage_and_diagnostics", requests: "request_records", system: "system_and_settings" };
4
+ const titles = { overview: "overview", codex: "Codex", claude: "Claude", models: "model_services", usage: "usage_and_diagnostics", requests: "request_records", checks: "tools_checks_title", system: "system_and_settings" };
5
5
  let current = "overview", settings = null, settingsPending = false, stopped = false, timer = null, ticks = 0;
6
6
  let sourceDirty = false, reviewDirty = false, sourceModels = [], modelsPreference = null, sourceGeneration = 0, modelsSource = null;
7
7
  let settingsReadAt = null;
@@ -41,6 +41,7 @@
41
41
  const route = location.hash.slice(1), next = Object.hasOwn(titles, route) ? route : "overview";
42
42
  current = next;
43
43
  for (const view of document.querySelectorAll("[data-view]")) view.hidden = view.dataset.view !== next;
44
+ globalThis.ccdxDashboardActivity?.visibilityChanged();
44
45
  for (const item of document.querySelectorAll("[data-route]")) {
45
46
  if (item.dataset.route === next) item.setAttribute("aria-current", "page");else item.removeAttribute("aria-current");
46
47
  }
@@ -0,0 +1,24 @@
1
+ (() => {
2
+ const shapes = { ok: ["path", { d: "m8 12 2.5 2.5L16 9" }], running: ["path", { d: "m10 8 6 4-6 4Z" }],
3
+ warning: ["path", { d: "M12 7.5v5m0 3.5h.01" }], unavailable: ["path", { d: "M8 12h8" }] };
4
+ function icon(kind = "unknown") {
5
+ const svg = document.createElementNS("http://www.w3.org/2000/svg", "svg");
6
+ for (const [key, value] of Object.entries({ viewBox: "0 0 24 24", "aria-hidden": "true", focusable: "false", class: "state-icon" })) svg.setAttribute(key, value);
7
+ const circle = document.createElementNS(svg.namespaceURI, "circle");
8
+ circle.setAttribute("cx", "12");circle.setAttribute("cy", "12");circle.setAttribute("r", "9");svg.append(circle);
9
+ if (shapes[kind]) { const [tag, attributes] = shapes[kind], shape = document.createElementNS(svg.namespaceURI, tag);
10
+ for (const [key, value] of Object.entries(attributes)) shape.setAttribute(key, value);svg.append(shape); }
11
+ return svg;
12
+ }
13
+ function set(target, key, kind = "unknown", values = {}) {
14
+ const label = document.createElement("span"), wrapper = document.createElement("span");
15
+ wrapper.className = `state-label state-${kind}`;
16
+ globalThis.ccdxLanguage.set(label, key, values);wrapper.append(icon(kind), label);
17
+ target.removeAttribute("data-i18n");target.replaceChildren(wrapper);
18
+ }
19
+ const kind = value => ["running", "active"].includes(value) ? "running"
20
+ : ["ready", "authorized", "configured", "saved", "passed", "ok", "completed"].includes(value) ? "ok"
21
+ : ["unavailable", "disabled", "unsupported", "not_installed", "unconfigured"].includes(value) ? "unavailable"
22
+ : ["warn", "err", "invalid", "failed", "configuration_unavailable"].includes(value) ? "warning" : "unknown";
23
+ globalThis.ccdxIcons = { icon, set, kind };
24
+ })();
@@ -9,11 +9,14 @@
9
9
  <script src="/theme.js"></script>
10
10
  <link rel="stylesheet" href="/ui.css">
11
11
  <script src="/refresh.js" defer></script>
12
+ <script src="/icons.js" defer></script>
12
13
  <script src="/status.js" defer></script>
14
+ <script src="/activity.js" defer></script>
13
15
  <script src="/usage.js" defer></script>
14
16
  <script src="/updates.js" defer></script>
15
17
  <script src="/ui.js" defer></script>
16
18
  <script src="/console.js" defer></script>
19
+ <script src="/tools.js" defer></script>
17
20
  <title data-i18n="ccdx_local_dashboard">CCDX · Dashboard</title>
18
21
  </head>
19
22
  <body>
@@ -28,6 +31,7 @@
28
31
  <a href="#models" data-route="models"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m12 3 10 5-10 5L2 8Zm-10 9 10 5 10-5M2 16l10 5 10-5"/></svg><span data-i18n="model_services">Model sources</span></a>
29
32
  <a href="#usage" data-route="usage"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 3v18h18M7 16v-5m5 5V7m5 9V4"/></svg><span data-i18n="usage_and_diagnostics">Usage</span></a>
30
33
  <a href="#requests" data-route="requests"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"/></svg><span data-i18n="request_records">Requests</span></a>
34
+ <a href="#checks" data-route="checks"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m3 7 2 2 4-4m3 2h9M3 13l2 2 4-4m3 2h9M3 19l2 2 4-4m3 2h9"/></svg><span data-i18n="tools_checks_title">Checks &amp; repairs</span></a>
31
35
  <a href="#system" data-route="system"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 6h4m4 0h10M3 12h10m4 0h4M3 18h4m4 0h10"/><circle cx="9" cy="6" r="2"/><circle cx="15" cy="12" r="2"/><circle cx="9" cy="18" r="2"/></svg><span data-i18n="system_and_settings">Settings</span></a>
32
36
  </nav>
33
37
  </aside>
@@ -46,6 +50,9 @@
46
50
 
47
51
 
48
52
  <div data-view="overview">
53
+ <div id="model-activity" class="model-activity" data-state="unknown" role="status" aria-label="Activity unknown" data-i18n-label="model_activity_unknown">
54
+ <span class="activity-lamp" aria-hidden="true"></span><span class="activity-dots" aria-hidden="true"><i></i><i></i><i></i><i></i><i></i></span><span id="model-activity-label" class="activity-label" data-i18n="model_activity_unknown">Activity unknown</span>
55
+ </div>
49
56
  <section class="overview" aria-label="Overview" data-i18n-label="overview"><article class="card"><h2 data-i18n="adapter">SERVICE</h2><strong id="version">—</strong><p id="uptime">—</p></article><article class="card"><h2 data-i18n="sources">SOURCES</h2><strong id="source-summary">—</strong><p id="source-detail">—</p></article></section>
50
57
  <details class="panel dashboard-section" id="client-features" open>
51
58
  <summary class="panel-heading"><h2 data-i18n="client_connections">APP SETUP</h2><span data-i18n="configuration_observation">SETUP AND ACTIVITY</span></summary>
@@ -123,21 +130,27 @@
123
130
  </section>
124
131
  </div>
125
132
  <div data-view="models" hidden>
126
- <details class="panel dashboard-section" id="account-authorization">
127
- <summary class="panel-heading"><h2 data-i18n="account_authorization">ACCOUNT AUTHORIZATION</h2><span data-i18n="by_provider">BY SOURCE</span></summary>
128
- <p class="hint" data-i18n="saved_credentials_authorization_model_access_and_client_requests">Saved sign-in, access, models and app requests are separate checks.</p>
129
- <div class="table-wrap"><table><thead><tr><th data-i18n="source">Source</th><th data-i18n="account">ACCOUNT</th><th data-i18n="authorization">AUTHORIZATION</th><th data-i18n="service">SERVICE</th><th data-i18n="last_verified">LAST VERIFIED</th><th data-i18n="time_left">Time left</th></tr></thead><tbody id="provider-auth"></tbody></table></div>
130
- </details>
131
- <details class="panel dashboard-section" id="upstream-models" open>
132
- <summary class="panel-heading"><h2 data-i18n="model_catalog">MODEL LIST</h2><span id="models-state" data-i18n="checking_live">CHECKING</span></summary>
133
- <div id="model-providers" class="provider-tabs" role="tablist" aria-label="Model providers" data-i18n-label="model_providers"></div>
134
- <div class="section-actions"><button id="refresh-models" type="button" data-i18n="refresh">Refresh</button></div>
135
- <p id="models-note" class="table-note" data-i18n="reading_provider_catalog">Loading model list…</p>
136
- <details id="model-check-details" class="model-check-details" hidden><summary data-i18n="source_check_details">Check details</summary><dl id="model-check-fields" class="failure-detail"></dl><p class="hint" data-i18n="source_check_action">Use Refresh to check this source again.</p></details>
137
- <div class="table-wrap"><table><thead><tr><th scope="col" data-i18n="model">MODEL</th><th scope="col" data-i18n="vendor">MODEL MAKER</th><th scope="col" data-i18n="api">CONNECTION TYPE</th><th scope="col" data-i18n="client">APP</th><th scope="col" data-i18n="reasoning">THINKING LEVEL</th><th scope="col" data-i18n="state">STATE</th></tr></thead><tbody id="live-models-body" role="tabpanel"><tr><td colspan="6" data-i18n="loading">Loading…</td></tr></tbody></table></div>
138
- <p class="hint" data-i18n="catalog_listing_does_not_guarantee_inference_access">Listed does not mean your account can use it.</p>
139
- </details>
140
- <section class="panel dashboard-section" aria-labelledby="source-access-heading">
133
+ <div id="model-providers" class="provider-tabs" role="tablist" aria-label="Model providers" data-i18n-label="model_providers"></div>
134
+ <p class="hint source-browse-note" data-i18n="tools_source_browse">Browsing a source does not change app settings.</p>
135
+ <div id="source-account-panel" role="tabpanel">
136
+ <section class="panel dashboard-section" id="github-account">
137
+ <div class="panel-heading"><h2>GitHub Copilot</h2><span id="github-account-state"></span></div>
138
+ <p id="github-account-name" class="account-name">—</p><p id="github-account-hint" class="hint"></p>
139
+ <dl id="github-account-fields" class="account-fields"></dl>
140
+ <div class="section-actions"><button id="github-signin" type="button" data-i18n="tools_login">Sign in to GitHub</button><button id="github-check" type="button" data-i18n="tools_check_connection">Check connection</button></div>
141
+ <p class="hint" data-i18n="tools_no_inference">Checks access and models. No chat request is sent.</p>
142
+ <section id="github-login-flow" class="tool-flow" hidden aria-label="GitHub sign-in">
143
+ <h3 id="github-flow-state" data-i18n="tools_waiting">Waiting for GitHub</h3>
144
+ <p class="hint" data-i18n="tools_device_instructions">Open GitHub, enter this code, and authorize CCDX.</p><code id="github-user-code" class="device-code">—</code>
145
+ <a id="github-authorize" class="tool-link" href="https://github.com/login/device" target="_blank" rel="noopener noreferrer" data-i18n="tools_open_github">Open GitHub</a>
146
+ <button id="github-cancel" type="button" data-i18n="cancel">Cancel</button>
147
+ <p class="hint" data-i18n="tools_keep_old_signin">Old sign-in is kept until verification succeeds.</p>
148
+ </section>
149
+ <p id="github-account-note" class="hint" role="status" aria-live="polite"></p>
150
+ <details class="tool-details"><summary data-i18n="tools_details">Check details</summary><dl class="failure-detail"><dt data-i18n="tools_storage">Saved sign-in</dt><dd id="github-store">—</dd><dt data-i18n="tools_error_code">Error code</dt><dd id="github-check-code">—</dd><dt>HTTP</dt><dd id="github-check-http">—</dd></dl></details>
151
+ <details class="tool-details"><summary data-i18n="tools_more_actions">More actions</summary><div class="section-actions"><button id="github-force-reauth" type="button" data-i18n="tools_reauth">Sign in again</button><button id="github-logout" type="button" data-i18n="tools_logout">Sign out of CCDX</button></div><p class="hint" data-i18n="tools_logout_scope">Other apps stay signed in.</p></details>
152
+ </section>
153
+ <section class="panel dashboard-section" id="m365-source-access" hidden aria-labelledby="source-access-heading">
141
154
  <h2 id="source-access-heading">Microsoft 365</h2>
142
155
  <p class="hint" data-i18n="m365_source_access">Provides models for Codex and Claude on supported devices.</p>
143
156
  <div class="section-actions"><button id="m365-on" type="button" data-i18n="enable_service">Enable source</button><button id="m365-off" type="button" data-i18n="disable_service">Disable source</button></div>
@@ -151,6 +164,39 @@
151
164
  </div>
152
165
  <p id="m365-account-note" class="hint" role="status" aria-live="polite"></p>
153
166
  </section>
167
+ <details class="panel dashboard-section" id="upstream-models" open>
168
+ <summary class="panel-heading"><h2 data-i18n="model_catalog">MODEL LIST</h2><span id="models-state" data-i18n="checking_live">CHECKING</span></summary>
169
+ <div class="section-actions"><button id="refresh-models" type="button" data-i18n="refresh">Refresh</button></div>
170
+ <p id="models-note" class="table-note" data-i18n="reading_provider_catalog">Loading model list…</p>
171
+ <details id="model-check-details" class="model-check-details" hidden><summary data-i18n="source_check_details">Check details</summary><dl id="model-check-fields" class="failure-detail"></dl><p class="hint" data-i18n="source_check_action">Use Refresh to check this source again.</p></details>
172
+ <div class="table-wrap"><table><thead><tr><th scope="col" data-i18n="model">MODEL</th><th scope="col" data-i18n="vendor">MODEL MAKER</th><th scope="col" data-i18n="api">CONNECTION TYPE</th><th scope="col" data-i18n="client">APP</th><th scope="col" data-i18n="reasoning">THINKING LEVEL</th><th scope="col" data-i18n="state">STATE</th></tr></thead><tbody id="live-models-body" role="tabpanel"><tr><td colspan="6" data-i18n="loading">Loading…</td></tr></tbody></table></div>
173
+ <p class="hint" data-i18n="catalog_listing_does_not_guarantee_inference_access">Listed does not mean your account can use it.</p>
174
+ </details>
175
+ <details class="panel dashboard-section" id="account-authorization">
176
+ <summary class="panel-heading"><h2 data-i18n="account_authorization">ACCOUNT AUTHORIZATION</h2><span data-i18n="by_provider">BY SOURCE</span></summary>
177
+ <p class="hint" data-i18n="saved_credentials_authorization_model_access_and_client_requests">Saved sign-in, access, models and app requests are separate checks.</p>
178
+ <div class="table-wrap"><table><thead><tr><th data-i18n="source">Source</th><th data-i18n="account">ACCOUNT</th><th data-i18n="authorization">AUTHORIZATION</th><th data-i18n="service">SERVICE</th><th data-i18n="last_verified">LAST VERIFIED</th><th data-i18n="time_left">Time left</th></tr></thead><tbody id="provider-auth"></tbody></table></div>
179
+ </details>
180
+ </div>
181
+ </div>
182
+ <div data-view="checks" hidden>
183
+ <section class="panel dashboard-section">
184
+ <h2 data-i18n="tools_checks_title">Checks &amp; repairs</h2>
185
+ <p class="hint" data-i18n="tools_local_scope">Local checks do not contact external services.</p>
186
+ <div class="section-actions"><button id="check-local" type="button" data-i18n="tools_check_local">Check this computer</button><button id="check-account-link" type="button" data-i18n="tools_check_connection">Check connection</button><button id="export-report" type="button" data-i18n="tools_export_report">Export report</button></div>
187
+ <p id="checks-note" class="table-note" role="status" aria-live="polite" data-i18n="tools_checks_empty">Run a check to see the results.</p>
188
+ <div class="table-wrap"><table class="checks-table"><thead><tr><th data-i18n="tools_check_item">Check</th><th data-i18n="state">State</th><th data-i18n="tools_details">Details</th></tr></thead><tbody id="checks-body"></tbody></table></div>
189
+ </section>
190
+ <section class="panel dashboard-section">
191
+ <h2 data-i18n="tools_codex_connection">Codex connection</h2><p class="hint" data-i18n="tools_config_scope">Review CCDX-managed fields before repair. Other settings are preserved.</p>
192
+ <div class="section-actions"><button id="preview-config-repair" type="button" data-i18n="tools_review_repair">Review repair</button></div>
193
+ <section id="config-repair-preview" class="tool-flow" hidden><h3 data-i18n="tools_repair_preview">Repair preview</h3><dl id="config-repair-fields" class="failure-detail"></dl><pre id="config-preview-details" class="tool-code"></pre><div class="section-actions"><button id="apply-config-repair" type="button" data-i18n="tools_apply_repair">Back up and repair</button><button id="cancel-config-repair" type="button" data-i18n="cancel">Cancel</button></div></section>
194
+ </section>
195
+ <details class="panel dashboard-section"><summary data-i18n="tools_more_checks">More checks</summary>
196
+ <div class="section-actions"><button id="check-network" type="button" data-i18n="tools_network_check">Network settings</button></div><p id="network-check-result" class="hint" role="status"></p>
197
+ <h3 data-i18n="tools_compatibility">Model compatibility</h3><p class="hint" data-i18n="tools_compatibility_scope">This test sends model requests and uses quota. Run it explicitly in your terminal:</p><pre class="tool-code">ccdx doctor --compat</pre>
198
+ <p class="hint" data-i18n="tools_report_scope">Reports omit credentials, account details and chat content.</p>
199
+ </details>
154
200
  </div>
155
201
  <div data-view="usage" hidden>
156
202
 
@@ -206,7 +252,7 @@ Missing data is unknown. This panel keeps no prompts or images.</p>
206
252
  <h2 id="web-appearance-title" data-i18n="appearance_web_appearance">网页外观</h2>
207
253
  <div class="appearance-row">
208
254
  <div class="appearance-label"><label for="web-color-theme" data-i18n="appearance_color_theme">颜色主题</label><p data-i18n="appearance_browser_scope">只影响当前浏览器。</p></div>
209
- <select id="web-color-theme" class="appearance-select"><option value="green" data-i18n="appearance_classic_green">经典绿(默认)</option><option value="klein" data-i18n="appearance_klein_blue">克莱因蓝</option></select>
255
+ <select id="web-color-theme" class="appearance-select"><option value="green" data-i18n="appearance_classic_green">经典绿(默认)</option><option value="klein" data-i18n="appearance_klein_blue">克莱因蓝</option><option value="pink" data-i18n="appearance_soft_pink">淡粉色</option></select>
210
256
  </div>
211
257
  <p id="web-color-note" class="appearance-note" role="status" data-i18n="theme_saved_browser">选择后,网页立即换色。</p>
212
258
  </section>
@@ -215,7 +261,7 @@ Missing data is unknown. This panel keeps no prompts or images.</p>
215
261
  <h2 id="terminal-appearance-title" data-i18n="terminal_appearance">终端外观</h2>
216
262
  <div class="appearance-row">
217
263
  <div class="appearance-label"><label for="terminal-color-theme" data-i18n="appearance_color_theme">颜色主题</label><p data-i18n="appearance_terminal_scope">与网页主题分别设置。</p></div>
218
- <select id="terminal-color-theme" disabled class="appearance-select"><option value="green" data-i18n="appearance_classic_green">经典绿(默认)</option><option value="klein" data-i18n="appearance_klein_blue">克莱因蓝</option></select>
264
+ <select id="terminal-color-theme" disabled class="appearance-select"><option value="green" data-i18n="appearance_classic_green">经典绿(默认)</option><option value="klein" data-i18n="appearance_klein_blue">克莱因蓝</option><option value="pink" data-i18n="appearance_soft_pink">淡粉色</option></select>
219
265
  </div>
220
266
  <p id="terminal-color-note" class="appearance-note" role="status" data-i18n="appearance_terminal_effect">表格即时换色,启动 Logo 下次生效。</p>
221
267