codex-copilot-dx 1.0.0 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -16
- package/bin/cli.mjs +24 -3
- package/docs/ARCHITECTURE.md +35 -7
- package/docs/README.md +1 -0
- package/docs/REFERENCE.md +148 -73
- package/package.json +1 -1
- package/src/adapter.mjs +17 -3
- package/src/browser-launch.mjs +22 -0
- package/src/claude-client-config.mjs +7 -2
- package/src/claude-gateway.mjs +18 -2
- package/src/cli-animation.mjs +1 -1
- package/src/cli-image.mjs +3 -0
- package/src/cli-m365.mjs +1 -1
- package/src/cli-options.mjs +7 -3
- package/src/cli-table.mjs +1 -1
- package/src/client-integration.mjs +5 -1
- package/src/dashboard/console.js +141 -0
- package/src/dashboard/index.html +102 -52
- package/src/dashboard/language.js +65 -0
- package/src/dashboard/status.js +27 -5
- package/src/dashboard/ui.css +43 -0
- package/src/dashboard/ui.js +7 -8
- package/src/dashboard-api.mjs +24 -0
- package/src/dashboard.mjs +1 -0
- package/src/image-mcp.mjs +9 -6
- package/src/log.mjs +13 -11
- package/src/m365-settings.mjs +0 -2
- package/src/native-prediction-recovery.mjs +1 -0
- package/src/native-prediction.mjs +6 -2
- package/src/observability.mjs +8 -1
- package/src/optional-routes.mjs +2 -2
- package/src/provider-runtime.mjs +20 -13
- package/src/response-failures.mjs +1 -1
- package/src/service-control.mjs +60 -0
- package/src/startup-ui.mjs +4 -3
- package/src/terminal-console.mjs +87 -0
- package/src/usage-store.mjs +11 -1
- package/src/usage.mjs +1 -0
- package/src/user-settings.mjs +21 -0
package/src/dashboard/index.html
CHANGED
|
@@ -12,50 +12,100 @@
|
|
|
12
12
|
<script src="/status.js" defer></script>
|
|
13
13
|
<script src="/usage.js" defer></script>
|
|
14
14
|
<script src="/ui.js" defer></script>
|
|
15
|
+
<script src="/console.js" defer></script>
|
|
15
16
|
<title data-i18n>CCDX · Local dashboard</title>
|
|
16
17
|
</head>
|
|
17
18
|
<body>
|
|
18
19
|
<div class="shell">
|
|
20
|
+
<aside class="sidebar">
|
|
21
|
+
<a class="sidebar-brand" href="#overview">CCDX<span data-i18n>LOCAL CONTROL</span></a>
|
|
22
|
+
<nav aria-label="Main navigation" data-i18n-label>
|
|
23
|
+
<a href="#overview" data-route="overview" aria-current="page" data-i18n>Overview</a>
|
|
24
|
+
<span class="nav-group" data-i18n>Clients</span>
|
|
25
|
+
<a href="#codex" data-route="codex">Codex</a>
|
|
26
|
+
<a href="#claude" data-route="claude">Claude</a>
|
|
27
|
+
<a href="#models" data-route="models" data-i18n>Model services</a>
|
|
28
|
+
<a href="#usage" data-route="usage" data-i18n>Usage and diagnostics</a>
|
|
29
|
+
<a href="#system" data-route="system" data-i18n>System and settings</a>
|
|
30
|
+
</nav>
|
|
31
|
+
<div class="sidebar-bottom"><button id="open-animation" type="button" aria-controls="animation-settings" aria-expanded="false" data-i18n>Terminal appearance</button><p data-i18n>Local service. Client-specific capabilities stay with their client.</p></div>
|
|
32
|
+
</aside>
|
|
33
|
+
|
|
19
34
|
<header class="topbar">
|
|
20
35
|
<div class="brand">CCDX <span class="brand-detail" data-i18n>/ LOCAL STATUS</span></div>
|
|
21
|
-
<div class="topbar-actions"><span id="connection" class="badge neutral" role="status" data-i18n>READING</span><button id="theme-toggle" class="icon-button" type="button" aria-label="Switch to light mode" title="Switch to light mode"><svg class="icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42M2 12h2m16 0h2M4.93 19.07l1.42-1.42m11.3-11.3 1.42-1.42"/></svg><svg class="icon-moon" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 3A9 9 0 1 0 21 12 7 7 0 0 1 12 3Z"/></svg></button><button id="language-toggle" class="icon-button language-button" type="button" aria-label="Switch to Chinese" title="Switch to Chinese">中文</button><button id="
|
|
36
|
+
<div class="topbar-actions"><span id="connection" class="badge neutral" role="status" data-i18n>READING</span><button id="theme-toggle" class="icon-button" type="button" aria-label="Switch to light mode" title="Switch to light mode"><svg class="icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.8" stroke-linecap="round" aria-hidden="true" focusable="false"><circle cx="12" cy="12" r="4"/><path d="M12 2v2m0 16v2M4.93 4.93l1.42 1.42m11.3 11.3 1.42 1.42M2 12h2m16 0h2M4.93 19.07l1.42-1.42m11.3-11.3 1.42-1.42"/></svg><svg class="icon-moon" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true" focusable="false"><path d="M12 3A9 9 0 1 0 21 12 7 7 0 0 1 12 3Z"/></svg></button><button id="language-toggle" class="icon-button language-button" type="button" aria-label="Switch to Chinese" title="Switch to Chinese">中文</button><button id="auto-refresh" type="button" aria-pressed="true" data-i18n data-i18n-title title="Visible status updates every 2 seconds. Catalogs and retained usage refresh on demand or every 30 minutes while open.">Auto refresh</button><button id="refresh" type="button" data-i18n>Refresh</button></div>
|
|
22
37
|
</header>
|
|
23
38
|
|
|
24
|
-
<main>
|
|
39
|
+
<main id="main-content" tabindex="-1">
|
|
25
40
|
<section class="intro">
|
|
26
|
-
<h1><svg id="status-icon" class="status-icon" viewBox="0 0 64 64" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round"><ellipse cx="32" cy="32" rx="26" ry="10"/><ellipse cx="32" cy="32" rx="26" ry="10" transform="rotate(60 32 32)"/><ellipse cx="32" cy="32" rx="26" ry="10" transform="rotate(120 32 32)"/></g><circle cx="32" cy="32" r="4.5" fill="currentColor"/></svg>
|
|
41
|
+
<h1><svg id="status-icon" class="status-icon" viewBox="0 0 64 64" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round"><ellipse cx="32" cy="32" rx="26" ry="10"/><ellipse cx="32" cy="32" rx="26" ry="10" transform="rotate(60 32 32)"/><ellipse cx="32" cy="32" rx="26" ry="10" transform="rotate(120 32 32)"/></g><circle cx="32" cy="32" r="4.5" fill="currentColor"/></svg> <span id="page-title" data-i18n>Overview</span></h1>
|
|
27
42
|
<div class="snapshot-meta"><p id="auth-account" role="status" data-i18n data-i18n-title title="Provider status / authorization and inference are separate.">READING</p><p id="updated" data-i18n>Reading status…</p></div>
|
|
43
|
+
<p id="page-settings-note" class="hint" role="status"></p>
|
|
28
44
|
</section>
|
|
29
45
|
|
|
30
|
-
<section class="overview" aria-label="Overview" data-i18n-label>
|
|
31
|
-
<article class="card"><h2 data-i18n>ADAPTER</h2><strong id="version">—</strong><p id="uptime">—</p></article>
|
|
32
|
-
<article class="card"><h2 data-i18n>SOURCES</h2><strong id="source-summary">—</strong><p id="source-detail">—</p></article>
|
|
33
|
-
<article class="card"><h2 data-i18n>CODEX MODELS</h2><strong id="models">—</strong><p id="model-source">—</p></article>
|
|
34
|
-
<article class="card"><h2 data-i18n>CODEX REQUESTS</h2><strong id="requests">—</strong><p id="request-errors">—</p><p id="http-error-breakdown">—</p><p><span data-i18n>Per-request limits (active)</span><br><span id="body-limits">—</span></p></article>
|
|
35
|
-
</section>
|
|
36
|
-
|
|
37
|
-
<details class="panel dashboard-section" id="account-authorization">
|
|
38
|
-
<summary class="panel-heading"><h2 data-i18n>ACCOUNT AUTHORIZATION</h2><span data-i18n>BY PROVIDER</span></summary>
|
|
39
|
-
<p class="hint" data-i18n>Saved credentials, authorization, model access and client requests are separate evidence.</p>
|
|
40
|
-
<div class="table-wrap"><table><thead><tr><th data-i18n>Source</th><th data-i18n>ACCOUNT</th><th data-i18n>AUTHORIZATION</th><th data-i18n>SERVICE</th><th data-i18n>LAST VERIFIED</th><th>TTL</th></tr></thead><tbody id="provider-auth"></tbody></table></div>
|
|
41
|
-
</details>
|
|
42
46
|
|
|
47
|
+
<div data-view="overview">
|
|
48
|
+
<section class="overview" aria-label="Overview" data-i18n-label><article class="card"><h2 data-i18n>ADAPTER</h2><strong id="version">—</strong><p id="uptime">—</p></article><article class="card"><h2 data-i18n>SOURCES</h2><strong id="source-summary">—</strong><p id="source-detail">—</p></article></section>
|
|
43
49
|
<details class="panel dashboard-section" id="client-features" open>
|
|
44
|
-
<summary class="panel-heading"><h2 data-i18n>CLIENT CONNECTIONS</h2><span data-i18n>
|
|
50
|
+
<summary class="panel-heading"><h2 data-i18n>CLIENT CONNECTIONS</h2><span data-i18n>CONFIGURATION + OBSERVATION</span></summary>
|
|
45
51
|
<div class="table-wrap"><table><thead><tr><th data-i18n>Source</th><th data-i18n>CLIENT</th><th data-i18n>STATE</th><th data-i18n>GATEWAY</th><th data-i18n>LAST REQUEST</th></tr></thead><tbody id="provider-clients"></tbody></table></div>
|
|
46
52
|
<div id="provider-requests" class="hint"></div>
|
|
47
|
-
|
|
53
|
+
</details>
|
|
54
|
+
<section class="panel dashboard-section"><h2 data-i18n>THIS RUN USAGE</h2><p id="runtime-usage" class="table-note"></p><p class="hint" data-i18n>Updated from returned usage, not a live bill. Pending usage is not included.</p></section>
|
|
55
|
+
</div>
|
|
56
|
+
<div data-view="codex" hidden>
|
|
57
|
+
<section class="overview client-overview"><article class="card"><h2 data-i18n>CODEX MODELS</h2><strong id="models">—</strong><p id="model-source">—</p></article></section>
|
|
58
|
+
<details class="panel dashboard-section" id="runtime-resources" open>
|
|
59
|
+
<summary data-i18n>CODEX CONVERSATIONS</summary>
|
|
60
|
+
<div class="details"><article class="panel">
|
|
61
|
+
<div class="panel-heading"><h2 data-i18n>MODEL OUTCOMES</h2><span>RESPONSES</span></div>
|
|
62
|
+
<dl class="stats"><div><dt data-i18n>Completed</dt><dd id="completed">—</dd></div><div><dt data-i18n>Incomplete</dt><dd id="incomplete">—</dd></div><div><dt data-i18n>Failed</dt><dd id="failed">—</dd></div><div><dt data-i18n>Cancelled</dt><dd id="cancelled">—</dd></div></dl>
|
|
63
|
+
<p class="hint" data-i18n>HTTP 2xx != model completed.</p>
|
|
64
|
+
<dl class="stats timing-stats"><div><dt data-i18n>First output</dt><dd id="ttft">—</dd></div><div><dt data-i18n>Output speed</dt><dd id="tpot">—</dd></div></dl>
|
|
65
|
+
<p class="hint" data-i18n>Codex Responses timing since startup. Output speed is estimated.</p>
|
|
66
|
+
</article><article class="panel">
|
|
67
|
+
<div class="panel-heading"><h2 data-i18n>CODEX CONVERSATION BUFFER</h2><span data-i18n>ACTIVE LIMIT</span></div>
|
|
68
|
+
<strong id="history">—</strong><progress id="history-meter" class="meter" max="100" value="0" aria-label="History cache usage" data-i18n-label></progress>
|
|
69
|
+
<p id="history-detail" class="hint">—</p>
|
|
70
|
+
</article></div>
|
|
71
|
+
<p class="hint" data-i18n>Temporary local data for Responses continuation, not a conversation archive.</p>
|
|
72
|
+
<div class="section-actions"><label><span data-i18n>Buffer limit MiB</span> <input id="history-limit" type="number" min="1" max="65536" step="1"></label><button id="save-history" type="button" data-i18n>Apply limit</button><button id="clean-history" type="button" data-i18n>Clear inactive buffer</button></div>
|
|
73
|
+
<p id="effect-history" class="hint" role="status"></p>
|
|
74
|
+
</details>
|
|
75
|
+
<details class="panel dashboard-section" id="prediction-settings" open>
|
|
76
|
+
<summary class="panel-heading"><h2 data-i18n>CODEX INPUT PREDICTIONS</h2><span data-i18n>CODEX ONLY</span></summary>
|
|
77
|
+
<dl class="stats"><div><dt data-i18n>Prediction integration setup</dt><dd id="prediction-preference">—</dd></div><div><dt data-i18n>Local bridge</dt><dd id="prediction-bridge">—</dd></div><div><dt data-i18n>Client route</dt><dd id="prediction-route">—</dd></div><div><dt data-i18n>Visible candidate</dt><dd id="prediction-candidate">—</dd></div></dl>
|
|
48
78
|
<p id="prediction-note" class="hint">—</p>
|
|
49
79
|
<p class="hint" data-i18n>Configured does not mean displayed. Use ccdx prediction status for details.</p>
|
|
80
|
+
<div class="setting-row"><label for="setting-prediction_enabled" data-i18n>Allow prediction configuration</label><input id="setting-prediction_enabled" type="checkbox" role="switch" disabled><span id="effect-prediction_enabled" class="hint" role="status"></span></div>
|
|
81
|
+
<div class="section-actions"><button id="fix-prediction" type="button" data-i18n>Check and repair</button></div>
|
|
82
|
+
<p class="hint" data-i18n>Pause keeps the existing trust and route. Codex may retain cached suggestions. First-time setup: quit Codex, then ccdx prediction on.</p>
|
|
50
83
|
</details>
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
84
|
+
<details class="panel dashboard-section" id="additional-capabilities">
|
|
85
|
+
<summary data-i18n>CODEX IMAGE GENERATION</summary>
|
|
86
|
+
<article class="panel">
|
|
87
|
+
<div class="panel-heading"><h2 data-i18n>Image service</h2><span data-i18n>CODEX ONLY</span></div>
|
|
88
|
+
<strong id="image">—</strong><p id="image-detail" class="hint">—</p>
|
|
89
|
+
</article>
|
|
90
|
+
<div class="setting-row"><label for="setting-image_enabled" data-i18n>Allow new image calls</label><input id="setting-image_enabled" type="checkbox" role="switch" disabled><span id="effect-image_enabled" class="hint" role="status"></span></div>
|
|
91
|
+
<p class="hint" data-i18n>Pause keeps the provider configuration. Running calls can finish. First-time setup: ccdx enable-image.</p>
|
|
92
|
+
</details>
|
|
93
|
+
</div>
|
|
94
|
+
<div data-view="claude" hidden>
|
|
95
|
+
<section class="panel dashboard-section" aria-labelledby="claude-heading">
|
|
96
|
+
<div class="panel-heading"><h2 id="claude-heading">Claude App / Claude Code</h2><span>ANTHROPIC MESSAGES</span></div>
|
|
97
|
+
<p id="claude-route" class="table-note"></p>
|
|
98
|
+
<p id="claude-client-state" class="hint"></p>
|
|
99
|
+
<dl class="stats"><div><dt data-i18n>Completed</dt><dd id="claude-completed">—</dd></div><div><dt data-i18n>Incomplete</dt><dd id="claude-incomplete">—</dd></div><div><dt data-i18n>Failed</dt><dd id="claude-failed">—</dd></div><div><dt data-i18n>Cancelled</dt><dd id="claude-cancelled">—</dd></div><div><dt data-i18n>First output</dt><dd id="claude-ttft">—</dd></div><div><dt data-i18n>Output speed</dt><dd id="claude-speed">—</dd></div></dl>
|
|
100
|
+
<p class="hint" data-i18n>Since this service started. Configuration, authorization, model discovery and successful inference are separate evidence.</p>
|
|
101
|
+
</section>
|
|
102
|
+
</div>
|
|
103
|
+
<div data-view="models" hidden>
|
|
104
|
+
<details class="panel dashboard-section" id="account-authorization">
|
|
105
|
+
<summary class="panel-heading"><h2 data-i18n>ACCOUNT AUTHORIZATION</h2><span data-i18n>BY PROVIDER</span></summary>
|
|
106
|
+
<p class="hint" data-i18n>Saved credentials, authorization, model access and client requests are separate evidence.</p>
|
|
107
|
+
<div class="table-wrap"><table><thead><tr><th data-i18n>Source</th><th data-i18n>ACCOUNT</th><th data-i18n>AUTHORIZATION</th><th data-i18n>SERVICE</th><th data-i18n>LAST VERIFIED</th><th>TTL</th></tr></thead><tbody id="provider-auth"></tbody></table></div>
|
|
57
108
|
</details>
|
|
58
|
-
|
|
59
109
|
<details class="panel dashboard-section" id="upstream-models" open>
|
|
60
110
|
<summary class="panel-heading"><h2 data-i18n>MODEL CATALOG</h2><span id="models-state" data-i18n>CHECKING LIVE</span></summary>
|
|
61
111
|
<div id="model-providers" class="provider-tabs" role="tablist" aria-label="Model providers" data-i18n-label></div>
|
|
@@ -64,7 +114,15 @@
|
|
|
64
114
|
<div class="table-wrap"><table><thead><tr><th scope="col" data-i18n>MODEL</th><th scope="col" data-i18n>VENDOR</th><th scope="col" data-i18n>API</th><th scope="col" data-i18n>CLIENT</th><th scope="col" data-i18n>REASONING</th><th scope="col" data-i18n>STATE</th></tr></thead><tbody id="live-models-body" role="tabpanel"><tr><td colspan="6" data-i18n>Loading…</td></tr></tbody></table></div>
|
|
65
115
|
<p class="hint" data-i18n>Catalog listing does not guarantee inference access.</p>
|
|
66
116
|
</details>
|
|
67
|
-
|
|
117
|
+
<section class="panel dashboard-section" aria-labelledby="routing-heading">
|
|
118
|
+
<h2 id="routing-heading" data-i18n>CODEX MODEL SOURCE</h2>
|
|
119
|
+
<p class="hint" data-i18n>Catalog tabs only change the view. Apply explicitly to change the source for future Codex requests.</p>
|
|
120
|
+
<div class="section-actions"><label><span data-i18n>Source</span> <select id="source-provider"><option value="github">GitHub Copilot</option><option value="m365">Microsoft 365</option></select></label><label><span data-i18n>Model</span> <select id="source-model" disabled></select></label><label><span data-i18n>Auto-review model</span> <select id="source-review" disabled></select></label><button id="apply-source" type="button" data-i18n>Apply source</button></div>
|
|
121
|
+
<div class="section-actions"><span>Microsoft 365</span><button id="m365-on" type="button" data-i18n>Enable service</button><button id="m365-off" type="button" data-i18n>Disable service</button></div>
|
|
122
|
+
<p id="source-control-note" class="hint" role="status"></p>
|
|
123
|
+
</section>
|
|
124
|
+
</div>
|
|
125
|
+
<div data-view="usage" hidden>
|
|
68
126
|
<details class="panel dashboard-section" id="model-usage" open>
|
|
69
127
|
<summary class="panel-heading"><h2 data-i18n>USAGE</h2><span id="usage-state" data-i18n>READING LOG</span></summary>
|
|
70
128
|
<div class="section-actions"><label><span data-i18n>Source</span> <select id="usage-provider"><option value="" data-i18n>All providers</option></select></label><button id="clear-usage-day" type="button" hidden data-i18n>All history</button><button id="refresh-usage" type="button" data-i18n>Refresh</button></div>
|
|
@@ -89,43 +147,35 @@
|
|
|
89
147
|
<p id="analytics-selection" class="hint" role="status" data-i18n>Select a day to inspect its model totals. No history is distinct from zero recorded calls.</p>
|
|
90
148
|
</details>
|
|
91
149
|
</details>
|
|
92
|
-
|
|
93
150
|
<details class="lower" id="recent-failures" open>
|
|
94
|
-
<summary class="panel-heading"><h2 data-i18n>RECENT
|
|
151
|
+
<summary class="panel-heading"><h2 data-i18n>RECENT INFERENCE + HTTP FAILURES</h2><span id="failure-count">requests + events</span></summary>
|
|
95
152
|
<ol id="failures"><li class="empty" data-i18n>Reading…</li></ol>
|
|
96
153
|
<p class="hint" data-i18n>Upstream messages may contain sensitive text.</p>
|
|
97
154
|
</details>
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<
|
|
101
|
-
<div class="
|
|
102
|
-
|
|
103
|
-
<dl class="stats"><div><dt data-i18n>Completed</dt><dd id="completed">—</dd></div><div><dt data-i18n>Incomplete</dt><dd id="incomplete">—</dd></div><div><dt data-i18n>Failed</dt><dd id="failed">—</dd></div><div><dt data-i18n>Cancelled</dt><dd id="cancelled">—</dd></div></dl>
|
|
104
|
-
<p class="hint" data-i18n>HTTP 2xx != model completed.</p>
|
|
105
|
-
<dl class="stats timing-stats"><div><dt data-i18n>First output</dt><dd id="ttft">—</dd></div><div><dt data-i18n>Output speed</dt><dd id="tpot">—</dd></div></dl>
|
|
106
|
-
<p class="hint" data-i18n>Gateway timing. Output speed is estimated.</p>
|
|
107
|
-
</article><article class="panel">
|
|
108
|
-
<div class="panel-heading"><h2 data-i18n>LOCAL HISTORY</h2><span data-i18n>ACTIVE LIMIT</span></div>
|
|
109
|
-
<strong id="history">—</strong><progress id="history-meter" class="meter" max="100" value="0" aria-label="History cache usage" data-i18n-label></progress>
|
|
110
|
-
<p id="history-detail" class="hint">—</p>
|
|
111
|
-
</article></div>
|
|
112
|
-
</details>
|
|
113
|
-
|
|
114
|
-
<details class="panel dashboard-section" id="additional-capabilities">
|
|
115
|
-
<summary data-i18n>ADDITIONAL CAPABILITIES</summary>
|
|
116
|
-
<article class="panel">
|
|
117
|
-
<div class="panel-heading"><h2 data-i18n>IMAGE GENERATION</h2><span data-i18n>OPTIONAL</span></div>
|
|
118
|
-
<strong id="image">—</strong><p id="image-detail" class="hint">—</p>
|
|
119
|
-
</article>
|
|
155
|
+
<details class="panel dashboard-section" id="request-context">
|
|
156
|
+
<summary data-i18n>RECENT REQUEST CONTEXT</summary>
|
|
157
|
+
<p id="context-note" class="table-note">—</p>
|
|
158
|
+
<div class="table-wrap"><table><thead><tr><th scope="col" data-i18n>MODEL</th><th scope="col" data-i18n>WIRE MiB</th><th scope="col" data-i18n>IMAGES</th><th scope="col" data-i18n>INPUT TOKENS</th><th scope="col" data-i18n>MODEL WINDOW</th><th scope="col" data-i18n>INPUT / WINDOW</th><th scope="col" data-i18n>OUTCOME</th></tr></thead><tbody id="context-body"><tr><td colspan="7" data-i18n>No observed request metadata.</td></tr></tbody></table></div>
|
|
159
|
+
<p class="hint" data-i18n>Recent upstream request metadata, not exact live session occupancy. Missing values are unknown. No prompt or image content is retained.</p>
|
|
120
160
|
</details>
|
|
121
|
-
|
|
161
|
+
</div>
|
|
162
|
+
<div data-view="system" hidden>
|
|
163
|
+
<section class="panel dashboard-section"><h2 data-i18n>PROCESS + LISTENER</h2><p id="process-state" class="table-note"></p><p id="process-memory" class="hint"></p><p id="process-queues" class="hint"></p><p id="process-notice" class="hint" role="status"></p></section>
|
|
164
|
+
<section class="overview client-overview"><article class="card"><h2 data-i18n>HTTP TRAFFIC</h2><strong id="requests">—</strong><p id="request-errors">—</p><p id="http-error-breakdown">—</p><p><span data-i18n>Per-request limits (active)</span><br><span id="body-limits">—</span></p></article></section>
|
|
165
|
+
<section class="panel dashboard-section" aria-labelledby="settings-heading">
|
|
166
|
+
<h2 id="settings-heading" data-i18n>SERVICE SETTINGS</h2>
|
|
167
|
+
<p class="hint" data-i18n>Saved preference and effective state are separate. Environment overrides and client restarts are shown explicitly.</p>
|
|
168
|
+
<div class="setting-row"><label for="setting-terminal_animation_enabled" data-i18n>Terminal animation</label><input id="setting-terminal_animation_enabled" type="checkbox" role="switch" disabled><span id="effect-terminal_animation_enabled" class="hint" role="status"></span></div>
|
|
169
|
+
<div class="setting-row"><label for="setting-open_webui" data-i18n>Open WebUI at startup</label><input id="setting-open_webui" type="checkbox" role="switch" disabled><span id="effect-open_webui" class="hint" role="status"></span></div>
|
|
170
|
+
<p id="settings-note" class="hint" role="status" data-i18n>Reading settings…</p>
|
|
171
|
+
</section>
|
|
122
172
|
<details id="animation-settings" class="panel dashboard-section settings-panel">
|
|
123
173
|
<summary class="panel-heading"><h2 data-i18n>TERMINAL ANIMATION</h2><span id="animation-state" data-i18n>READING</span></summary>
|
|
124
174
|
<div id="animation-options" class="animation-options" role="group" aria-label="Animation theme" data-i18n-label></div>
|
|
125
|
-
<div class="section-actions"><button id="save-animation" type="button" disabled data-i18n>Save selection</button><span id="animation-note" role="status" data-i18n>Applies
|
|
175
|
+
<div class="section-actions"><button id="save-animation" type="button" disabled data-i18n>Save selection</button><span id="animation-note" role="status" data-i18n>Applies to the running terminal.</span></div>
|
|
126
176
|
</details>
|
|
177
|
+
</div>
|
|
127
178
|
</main>
|
|
128
|
-
|
|
129
179
|
<footer data-i18n>LOCAL ONLY / VISIBLE PAGE UPDATES</footer>
|
|
130
180
|
</div>
|
|
131
181
|
</body>
|
|
@@ -1,5 +1,70 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const translations = {
|
|
3
|
+
"Codex body admission: active {active} / queued {queued} / queue limit {limit}": ["Codex body admission: active {active} / queued {queued} / queue limit {limit}", "Codex请求体:进行中{active}\n排队{queued} / 队列上限{limit}"],
|
|
4
|
+
"Terminal animation unavailable in this output mode": ["Terminal animation unavailable in this output mode", "当前输出模式不播放终端动效"],
|
|
5
|
+
"Prediction integration setup": ["Prediction integration setup", "预测集成配置"],
|
|
6
|
+
"Visible status updates every 2 seconds. Catalogs and retained usage refresh on demand or every 30 minutes while open.": ["Visible status updates every 2 seconds. Catalogs and retained usage refresh on demand or every 30 minutes while open.", "可见状态每2秒更新。\n目录和留存用量按需更新,\n展开时每30分钟刷新。"],
|
|
7
|
+
"Clients": ["Clients", "客户端"],
|
|
8
|
+
"Model services": ["Model services", "模型服务"],
|
|
9
|
+
"Usage and diagnostics": ["Usage and diagnostics", "用量与诊断"],
|
|
10
|
+
"System and settings": ["System and settings", "系统与设置"],
|
|
11
|
+
"Main navigation": ["Main navigation", "主导航"],
|
|
12
|
+
"LOCAL CONTROL": ["LOCAL CONTROL", "本机控制台"],
|
|
13
|
+
"Terminal appearance": ["Terminal appearance", "终端外观"],
|
|
14
|
+
"Local service. Client-specific capabilities stay with their client.": ["Local service. Client-specific capabilities stay with their client.", "本机服务;专属能力归属各自客户端。"],
|
|
15
|
+
"CONFIGURATION + OBSERVATION": ["CONFIGURATION + OBSERVATION", "配置与观察"],
|
|
16
|
+
"CODEX CONVERSATIONS": ["CODEX CONVERSATIONS", "Codex 对话与暂存"],
|
|
17
|
+
"CODEX CONVERSATION BUFFER": ["CODEX CONVERSATION BUFFER", "Codex 对话暂存"],
|
|
18
|
+
"CODEX INPUT PREDICTIONS": ["CODEX INPUT PREDICTIONS", "Codex 输入预测"],
|
|
19
|
+
"CODEX ONLY": ["CODEX ONLY", "Codex 专属"],
|
|
20
|
+
"CODEX IMAGE GENERATION": ["CODEX IMAGE GENERATION", "Codex 图片生成"],
|
|
21
|
+
"Image service": ["Image service", "生图服务"],
|
|
22
|
+
"Allow new image calls": ["Allow new image calls", "允许新的生图调用"],
|
|
23
|
+
"Allow prediction configuration": ["Allow prediction configuration", "允许预测配置适配"],
|
|
24
|
+
"Check and repair": ["Check and repair", "检查并修复"],
|
|
25
|
+
"Temporary local data for Responses continuation, not a conversation archive.": ["Temporary local data for Responses continuation, not a conversation archive.", "用于 Responses 对话续接的本机\n临时数据,并非聊天归档。"],
|
|
26
|
+
"Buffer limit MiB": ["Buffer limit MiB", "暂存上限 MiB"],
|
|
27
|
+
"Apply limit": ["Apply limit", "应用上限"],
|
|
28
|
+
"Clear inactive buffer": ["Clear inactive buffer", "清理未使用暂存"],
|
|
29
|
+
"Pause keeps the provider configuration. Running calls can finish. First-time setup: ccdx enable-image.": ["Pause keeps the provider configuration. Running calls can finish. First-time setup: ccdx enable-image.", "暂停保留 Provider 配置,进行中\n的调用可以完成。首次配置:ccdx\nenable-image。"],
|
|
30
|
+
"Pause keeps the existing trust and route. Codex may retain cached suggestions. First-time setup: quit Codex, then ccdx prediction on.": ["Pause keeps the existing trust and route. Codex may retain cached suggestions. First-time setup: quit Codex, then ccdx prediction on.", "暂停保留已有信任和路由,Codex 可能\n保留已缓存的建议。首次配置:退出\nCodex 后执行 ccdx\nprediction on。"],
|
|
31
|
+
"SERVICE SETTINGS": ["SERVICE SETTINGS", "服务设置"],
|
|
32
|
+
"Saved preference and effective state are separate. Environment overrides and client restarts are shown explicitly.": ["Saved preference and effective state are separate. Environment overrides and client restarts are shown explicitly.", "保存的偏好与实际生效状态分别显示;环境覆\n盖和客户端重启要求会明确标注。"],
|
|
33
|
+
"Terminal animation": ["Terminal animation", "终端动效"],
|
|
34
|
+
"Open WebUI at startup": ["Open WebUI at startup", "启动时打开 WebUI"],
|
|
35
|
+
"Reading settings…": ["Reading settings…", "正在读取设置…"],
|
|
36
|
+
"CODEX MODEL SOURCE": ["CODEX MODEL SOURCE", "Codex 模型来源"],
|
|
37
|
+
"Catalog tabs only change the view. Apply explicitly to change the source for future Codex requests.": ["Catalog tabs only change the view. Apply explicitly to change the source for future Codex requests.", "目录标签仅切换查看对象。点击应用才会改变\n后续 Codex 请求的来源。"],
|
|
38
|
+
"Auto-review model": ["Auto-review model", "自动审查模型"],
|
|
39
|
+
"Apply source": ["Apply source", "应用来源"],
|
|
40
|
+
"Enable service": ["Enable service", "启用服务"],
|
|
41
|
+
"Disable service": ["Disable service", "停用服务"],
|
|
42
|
+
"Since this service started. Configuration, authorization, model discovery and successful inference are separate evidence.": ["Since this service started. Configuration, authorization, model discovery and successful inference are separate evidence.", "自本次服务启动起统计。配置、授权、模型发\n现和成功推理是不同证据。"],
|
|
43
|
+
"PROCESS + LISTENER": ["PROCESS + LISTENER", "进程与监听器"],
|
|
44
|
+
"HTTP TRAFFIC": ["HTTP TRAFFIC", "主入口 HTTP 流量"],
|
|
45
|
+
"THIS RUN USAGE": ["THIS RUN USAGE", "本次运行用量"],
|
|
46
|
+
"Updated from returned usage, not a live bill. Pending usage is not included.": ["Updated from returned usage, not a live bill. Pending usage is not included.", "根据已返回的用量更新,不代表实时账单;尚\n未返回的用量不计入。"],
|
|
47
|
+
"Applies to the running terminal.": ["Applies to the running terminal.", "应用到运行中的终端。"],
|
|
48
|
+
"RECENT INFERENCE + HTTP FAILURES": ["RECENT INFERENCE + HTTP FAILURES", "近期推理与 HTTP 故障"],
|
|
49
|
+
"Codex Responses timing since startup. Output speed is estimated.": ["Codex Responses timing since startup. Output speed is estimated.", "自启动起的 Codex\nResponses 时序;输出速度为估计\n值。"],
|
|
50
|
+
"SERVICE REACHABLE": ["SERVICE REACHABLE", "服务可访问"],
|
|
51
|
+
"Saved choice applies to the running terminal.": ["Saved choice applies to the running terminal.", "保存后应用到运行中的终端。"],
|
|
52
|
+
"Effective now": ["Effective now", "即时生效"],
|
|
53
|
+
"Next CCDX start": ["Next CCDX start", "下次启动 CCDX 生效"],
|
|
54
|
+
"Applies to new calls": ["Applies to new calls", "对后续调用生效"],
|
|
55
|
+
"Setup required": ["Setup required", "需要先配置"],
|
|
56
|
+
"Next configuration request; cached suggestions may remain": ["Next configuration request; cached suggestions may remain", "对后续配置请求生效;已缓存建议可能仍存在"],
|
|
57
|
+
"Reopen the client to finish": ["Reopen the client to finish", "需要重新打开客户端"],
|
|
58
|
+
"Restart CCDX to finish": ["Restart CCDX to finish", "需要重启 CCDX"],
|
|
59
|
+
"Saved {saved} / effective {effective} / {state}": ["Saved {saved} / effective {effective} / {state}", "保存:{saved} / 实际:{effective} / {state}"],
|
|
60
|
+
"On": ["On", "开启"],
|
|
61
|
+
"Off": ["Off", "关闭"],
|
|
62
|
+
"Controlled by environment": ["Controlled by environment", "由环境变量控制"],
|
|
63
|
+
"Settings read from the running service.": ["Settings read from the running service.", "已读取运行中服务的设置。"],
|
|
64
|
+
"Applying…": ["Applying…", "正在应用…"],
|
|
65
|
+
"Clear inactive Codex conversation data? Older continuation IDs may stop working.": ["Clear inactive Codex conversation data? Older continuation IDs may stop working.", "清理未使用的 Codex 对话暂存?旧的\n续接 ID 可能失效。"],
|
|
66
|
+
"{records} usage records / input {input} / cache read {cached} / output {output}{partial}": ["{records} usage records / input {input} / cache read {cached} / output {output}{partial}", "{records} 条用量记录 / 输入 {input} / 缓存读取 {cached}\n / 输出 {output}{partial}"],
|
|
67
|
+
"RSS {rss} / heap {heap}": ["RSS {rss} / heap {heap}", "常驻内存 {rss} / 堆内存 {heap}"],
|
|
3
68
|
"CODEX MODELS": ["CODEX MODELS", "Codex 模型"],
|
|
4
69
|
"CODEX REQUESTS": ["CODEX REQUESTS", "Codex 请求"],
|
|
5
70
|
"{state} / {reason}": ["{state} / {reason}", "{state} / {reason}"],
|
package/src/dashboard/status.js
CHANGED
|
@@ -29,14 +29,15 @@
|
|
|
29
29
|
}
|
|
30
30
|
if (provider.requests) {
|
|
31
31
|
const item = document.createElement("p");
|
|
32
|
-
localize(item, "{provider}: {done} done / {incomplete} incomplete / {failed} failed", { provider: provider.name
|
|
32
|
+
localize(item, "{provider}: {done} done / {incomplete} incomplete / {failed} failed", { provider: `${provider.name} · ${provider.request_scope || "Claude Messages"}`,
|
|
33
33
|
done: number(provider.requests.completed), incomplete: number(provider.requests.incomplete), failed: number(provider.requests.failed) });
|
|
34
34
|
requests.append(item);
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
text("source-summary", "{count} providers", { count: providers.filter(provider => provider.enabled).length });
|
|
38
38
|
element("source-detail").textContent = routes.join(" / ") || "—";
|
|
39
|
-
element("auth-account").textContent =
|
|
39
|
+
element("auth-account").textContent = providers.flatMap(provider => (provider.clients || [])
|
|
40
|
+
.filter(client => client.selected).map(client => `${client.name} → ${provider.name}`)).join(" / ") || "—";
|
|
40
41
|
}
|
|
41
42
|
|
|
42
43
|
function duration(value) {
|
|
@@ -174,12 +175,33 @@
|
|
|
174
175
|
? "active {active} / failed {failed} / delivery failures {delivery}"
|
|
175
176
|
: "Setup state unknown / ccdx image-status", { active: number(image?.active), failed: number(image?.failed), delivery: number(image?.delivery_failures) });
|
|
176
177
|
|
|
178
|
+
const claude = data.providers?.m365?.claude, claudeMetrics = claude?.requests?.performance;
|
|
179
|
+
const recentRequests = [...(data.stream_performance?.recent_requests || []), ...(claudeMetrics?.recent_requests || [])]
|
|
180
|
+
.sort((a, b) => (Date.parse(a.at) || 0) - (Date.parse(b.at) || 0));
|
|
177
181
|
renderFailures([...(data.response_failures?.recent || []), ...(data.http_errors?.actionable_recent || data.http_errors?.recent || [])]
|
|
178
|
-
.sort((a, b) => (Date.parse(a.at) || 0) - (Date.parse(b.at) || 0)),
|
|
179
|
-
renderContext(data.stream_performance);
|
|
182
|
+
.sort((a, b) => (Date.parse(a.at) || 0) - (Date.parse(b.at) || 0)), recentRequests);
|
|
183
|
+
renderContext({ ...data.stream_performance, recent_requests: recentRequests });
|
|
184
|
+
if (element("claude-route")) {
|
|
185
|
+
element("claude-route").textContent = claude?.base_url || "—";
|
|
186
|
+
element("claude-client-state").textContent = Object.entries(claude?.clients || {}).map(([key, value]) => `${key}: ${value}`).join(" / ") || "—";
|
|
187
|
+
const totals = claudeMetrics?.by_route?.messages?.terminal_outcomes?.totals || claude?.requests || {};
|
|
188
|
+
for (const key of ["completed", "incomplete", "failed", "cancelled"]) text(`claude-${key}`, totals[key] === undefined ? "—" : number(totals[key]));
|
|
189
|
+
for (const [id, metric, unit] of [["claude-ttft", claudeMetrics?.by_route?.messages?.ttft_ms, "ms"], ["claude-speed", claudeMetrics?.by_route?.messages?.output_tokens_per_second, "token/s"]]) {
|
|
190
|
+
text(id, metric?.samples > 0 ? `${Number(metric.avg).toFixed(1)} ${unit} / ${metric.samples}` : "—");
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
if (element("runtime-usage")) {
|
|
194
|
+
const usage = data.runtime_usage;
|
|
195
|
+
text("runtime-usage", usage ? "{records} usage records / input {input} / cache read {cached} / output {output}{partial}" : "—",
|
|
196
|
+
usage ? { records: number(usage.records), input: number(usage.input_tokens), cached: number(usage.cached_input_tokens), output: number(usage.output_tokens), partial: usage.partial_records ? " ~" : "" } : {});
|
|
197
|
+
element("process-state").textContent = `PID ${data.pid || "—"} / ${globalThis.location?.origin || ""}`;
|
|
198
|
+
text("process-memory", "RSS {rss} / heap {heap}", { rss: mib(data.process?.rss_bytes), heap: mib(data.process?.heap_used_bytes) });
|
|
199
|
+
text("process-queues", "Codex body admission: active {active} / queued {queued} / queue limit {limit}", {
|
|
200
|
+
active: number(data.admission?.activeRequests), queued: number(data.admission?.queued), limit: number(data.admission?.maxQueued) });
|
|
201
|
+
}
|
|
180
202
|
if (element("prediction-preference")) {
|
|
181
203
|
const prediction = data.client_integrations?.prediction;
|
|
182
|
-
text("prediction-preference", prediction ? prediction.configured ? "
|
|
204
|
+
text("prediction-preference", prediction ? prediction.configured ? "Configured" : "Not configured" : "Unknown");
|
|
183
205
|
text("prediction-bridge", ({ running: "Running", recovering: "Recovering", stopped: "Stopped", unavailable: "Unavailable" })[prediction?.bridge] || "Unknown");
|
|
184
206
|
text("prediction-route", prediction?.client_route === "observed" ? "Observed" : "Unknown");
|
|
185
207
|
text("prediction-candidate", "Unknown");
|
package/src/dashboard/ui.css
CHANGED
|
@@ -146,3 +146,46 @@ footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color:
|
|
|
146
146
|
#provider-auth td, #provider-clients td { overflow-wrap: anywhere; }
|
|
147
147
|
.details { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
148
148
|
@media (max-width: 700px) { .details { grid-template-columns: 1fr; } }
|
|
149
|
+
|
|
150
|
+
/* Each view has one scope. The sidebar stays separate from business data. */
|
|
151
|
+
[hidden] { display: none !important; }
|
|
152
|
+
.shell { max-width: 1520px; display: grid; grid-template-columns: 204px minmax(0, 1fr); column-gap: 34px; padding: 0 28px; }
|
|
153
|
+
.sidebar { grid-row: 1 / 4; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 28px 22px 24px 0; border-right: 1px solid var(--border); }
|
|
154
|
+
.sidebar-brand { color: var(--accent); text-decoration: none; font-size: 23px; font-weight: 750; letter-spacing: .04em; }
|
|
155
|
+
.sidebar-brand span { display: block; color: var(--muted); font-size: 10px; font-weight: 500; letter-spacing: .1em; margin-top: 8px; }
|
|
156
|
+
.sidebar nav { display: flex; flex-direction: column; gap: 5px; margin-top: 36px; }
|
|
157
|
+
.sidebar nav a { color: var(--muted); text-decoration: none; padding: 11px 12px; font-size: 13px; border-left: 2px solid transparent; }
|
|
158
|
+
.sidebar nav a:hover { background: var(--option-hover); color: var(--text); }
|
|
159
|
+
.sidebar nav a[aria-current="page"] { color: var(--accent); background: var(--selected-bg); border-left-color: var(--accent); }
|
|
160
|
+
.sidebar nav a:focus-visible, .sidebar-brand:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
|
|
161
|
+
.nav-group { color: var(--subtle); font-size: 10px; padding: 18px 12px 4px; text-transform: uppercase; letter-spacing: .08em; }
|
|
162
|
+
.sidebar-bottom { margin-top: auto; padding-top: 24px; }
|
|
163
|
+
.sidebar-bottom button { width: 100%; text-align: left; }
|
|
164
|
+
.sidebar-bottom p { color: var(--subtle); font-size: 11px; line-height: 1.7; }
|
|
165
|
+
.topbar, main, footer { grid-column: 2; min-width: 0; }
|
|
166
|
+
.topbar { min-height: 76px; gap: 14px; }
|
|
167
|
+
.brand { font-size: 12px; }
|
|
168
|
+
.topbar-actions { gap: 12px; }
|
|
169
|
+
.intro { display: block; padding: 32px 0 26px; }
|
|
170
|
+
.snapshot-meta { justify-content: flex-start; margin-top: 14px; line-height: 1.7; }
|
|
171
|
+
.overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
|
|
172
|
+
.client-overview { grid-template-columns: 1fr; }
|
|
173
|
+
.card { min-height: 130px; }
|
|
174
|
+
.panel, .lower { padding: 22px; }
|
|
175
|
+
.panel h2, .lower h2, .panel > summary { font-size: 12px; letter-spacing: .045em; }
|
|
176
|
+
.hint, .table-note, td, th, .stats dt { font-size: 12px; line-height: 1.7; }
|
|
177
|
+
.section-actions { flex-wrap: wrap; align-items: end; }
|
|
178
|
+
.section-actions label { display: grid; gap: 7px; color: var(--muted); font-size: 12px; max-width: 100%; }
|
|
179
|
+
.section-actions input, .section-actions select { max-width: 100%; min-height: 36px; }
|
|
180
|
+
input[type="number"] { width: 120px; font: inherit; color: var(--text); background: var(--page); border: 1px solid var(--border); padding: 7px; }
|
|
181
|
+
.setting-row { display: grid; grid-template-columns: minmax(160px, 1fr) 44px minmax(0, 1.4fr); align-items: center; gap: 16px; padding: 20px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
|
|
182
|
+
.setting-row .hint { margin: 0; }
|
|
183
|
+
input[role="switch"] { appearance: none; width: 38px; height: 22px; border: 1px solid var(--button-border); border-radius: 20px; background: var(--border); cursor: pointer; margin: 0; position: relative; }
|
|
184
|
+
input[role="switch"]::before { content: ""; position: absolute; width: 14px; height: 14px; left: 3px; top: 3px; border-radius: 50%; background: var(--muted); }
|
|
185
|
+
input[role="switch"]:checked { background: var(--selected-bg); border-color: var(--accent); }
|
|
186
|
+
input[role="switch"]:checked::before { left: 19px; background: var(--accent); }
|
|
187
|
+
input[role="switch"]:focus-visible, input[type="number"]:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
|
|
188
|
+
input[role="switch"]:disabled { opacity: .5; cursor: wait; }
|
|
189
|
+
#process-queues { overflow-wrap: anywhere; font-size: 11px; }
|
|
190
|
+
@media (max-width: 900px) { .shell { grid-template-columns: 170px minmax(0, 1fr); column-gap: 20px; padding: 0 20px; } .topbar .brand { display: none; } .topbar { justify-content: flex-end; } .setting-row { grid-template-columns: minmax(0, 1fr) 44px; } .setting-row .hint { grid-column: 1 / -1; } .overview { grid-template-columns: 1fr; } }
|
|
191
|
+
@media (max-width: 640px) { .shell { display: block; padding: 0 16px; } .sidebar { position: static; height: auto; padding: 20px 0 14px; border-right: 0; border-bottom: 1px solid var(--border); } .sidebar-brand { font-size: 20px; } .sidebar-brand span { display: inline; margin-left: 12px; } .sidebar nav { display: flex; flex-direction: row; flex-wrap: wrap; gap: 4px; margin-top: 16px; } .sidebar nav a { padding: 9px 10px; font-size: 12px; border-left: 0; border-bottom: 2px solid transparent; } .sidebar nav a[aria-current="page"] { border-bottom-color: var(--accent); } .nav-group, .sidebar-bottom { display: none; } .topbar { min-height: 62px; justify-content: flex-start; } .topbar-actions { justify-content: flex-start; gap: 9px; } .intro { padding: 24px 0 18px; } .panel, .lower { padding: 17px; } .section-actions > label { width: 100%; } .stats { gap: 12px; } }
|
package/src/dashboard/ui.js
CHANGED
|
@@ -82,14 +82,14 @@ function stopAnimationPreview() {
|
|
|
82
82
|
|
|
83
83
|
function tickAnimationPreview() {
|
|
84
84
|
previewTimer = null;
|
|
85
|
-
if (!animationTimelines.length || !element("animation-settings").open || !previewVisible || document.visibilityState !== "visible" || reducedMotion.matches || previewDisabledByEnvironment) return;
|
|
85
|
+
if (!animationTimelines.length || !element("animation-settings").open || element("animation-settings").closest("[hidden]") || !previewVisible || document.visibilityState !== "visible" || reducedMotion.matches || previewDisabledByEnvironment) return;
|
|
86
86
|
renderAnimationFrames(performance.now() - previewStarted);
|
|
87
87
|
previewTimer = setTimeout(tickAnimationPreview, 32);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
function syncAnimationPreview() {
|
|
91
91
|
stopAnimationPreview();
|
|
92
|
-
if (!animationTimelines.length || !element("animation-settings").open || !previewVisible || document.visibilityState !== "visible" || reducedMotion.matches || previewDisabledByEnvironment) {
|
|
92
|
+
if (!animationTimelines.length || !element("animation-settings").open || element("animation-settings").closest("[hidden]") || !previewVisible || document.visibilityState !== "visible" || reducedMotion.matches || previewDisabledByEnvironment) {
|
|
93
93
|
for (const timeline of animationTimelines) timeline.lastFrame = -2;
|
|
94
94
|
renderAnimationFrames(0);
|
|
95
95
|
return;
|
|
@@ -155,7 +155,7 @@ function buildAnimationOptions(data) {
|
|
|
155
155
|
function animationNote(data) {
|
|
156
156
|
return data.disabled_by_environment
|
|
157
157
|
? "Disabled by CCDX_TERMINAL_ANIMATION; saved choice applies after override removal and next start."
|
|
158
|
-
: "Saved choice applies
|
|
158
|
+
: "Saved choice applies to the running terminal.";
|
|
159
159
|
}
|
|
160
160
|
|
|
161
161
|
function loadAnimation(options) {
|
|
@@ -375,7 +375,7 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
|
|
|
375
375
|
},
|
|
376
376
|
apply: render,
|
|
377
377
|
state: state => {
|
|
378
|
-
text("connection", state.pending
|
|
378
|
+
text("connection", state.pending && !state.value ? "READING" : state.error ? "UNAVAILABLE" : "SERVICE REACHABLE");
|
|
379
379
|
element("connection").className = `badge ${state.pending ? "neutral" : state.error ? "bad" : "good"}`;
|
|
380
380
|
if (state.error) refreshTime(element("updated"), state);
|
|
381
381
|
for (const node of timestamps.get("status")) refreshTime(node, state);
|
|
@@ -394,7 +394,7 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
|
|
|
394
394
|
},
|
|
395
395
|
},
|
|
396
396
|
models: {
|
|
397
|
-
visible: () => providerEntries.length > 0 && element("upstream-models").open,
|
|
397
|
+
visible: () => providerEntries.length > 0 && element("upstream-models").open && !element("upstream-models").closest("[hidden]"),
|
|
398
398
|
variant: () => selectedProvider,
|
|
399
399
|
load: async ({ signal, variant }) => {
|
|
400
400
|
if (!variant) throw new Error("Reading provider catalog…");
|
|
@@ -418,7 +418,7 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
|
|
|
418
418
|
},
|
|
419
419
|
},
|
|
420
420
|
usage: {
|
|
421
|
-
visible: () => element("model-usage").open,
|
|
421
|
+
visible: () => element("model-usage").open && !element("model-usage").closest("[hidden]"),
|
|
422
422
|
variant: () => {
|
|
423
423
|
const mode = ((element("model-usage").open && element("usage-analytics").open) || Boolean(usageView.selectedDate)) ? "analytics" : "summary";
|
|
424
424
|
const provider = element("usage-provider")?.value || "";
|
|
@@ -516,7 +516,6 @@ element("usage-provider")?.addEventListener("change", () => { dashboardRefresh.i
|
|
|
516
516
|
element("refresh-models").addEventListener("click", loadModels);
|
|
517
517
|
element("refresh-usage").addEventListener("click", loadUsage);
|
|
518
518
|
loadAnimation();
|
|
519
|
-
loadUsage();
|
|
520
519
|
refresh();
|
|
521
|
-
loadAuth()
|
|
520
|
+
loadAuth();
|
|
522
521
|
animateRefresh();
|
package/src/dashboard-api.mjs
CHANGED
|
@@ -128,6 +128,7 @@ function dashboardProviders(providerStateFn, authStatusFn) {
|
|
|
128
128
|
clients: (entry.clients || []).slice(0, 8).map(client => ({ id: code(client.id), name: label(client.name),
|
|
129
129
|
selected: client.selected === true, state: code(client.state) || "unknown", gateway: code(client.gateway),
|
|
130
130
|
reason: code(client.reason), last_request_at: label(client.last_request_at) || null })),
|
|
131
|
+
request_scope: label(entry.request_scope) || null,
|
|
131
132
|
requests: entry.requests ? Object.fromEntries(["total", "active", "completed", "incomplete", "failed", "cancelled"].map(key => [key, finite(entry.requests[key])])) : null };
|
|
132
133
|
});
|
|
133
134
|
}
|
|
@@ -140,6 +141,8 @@ export async function handleDashboardApi(req, res, pathname, {
|
|
|
140
141
|
authStatusFn = () => authStatus({ home }),
|
|
141
142
|
providerCatalogFn,
|
|
142
143
|
providerStateFn,
|
|
144
|
+
serviceControl,
|
|
145
|
+
applyAnimation,
|
|
143
146
|
} = {}) {
|
|
144
147
|
if (!isLoopbackAddress(req.socket?.remoteAddress)
|
|
145
148
|
|| req.headers?.host === undefined
|
|
@@ -158,6 +161,26 @@ export async function handleDashboardApi(req, res, pathname, {
|
|
|
158
161
|
return;
|
|
159
162
|
}
|
|
160
163
|
|
|
164
|
+
if (pathname === "/_ccdx/ui/settings") {
|
|
165
|
+
if (!serviceControl) { sendJson(res, 503, { error: "Settings require the running service; restart the updated CCDX" });return; }
|
|
166
|
+
if (req.method === "GET") {
|
|
167
|
+
try { sendJson(res, 200, serviceControl.snapshot()); } catch { sendJson(res, 409, { error: "Service settings are unreadable; existing settings were preserved" }); }
|
|
168
|
+
return;
|
|
169
|
+
}
|
|
170
|
+
if (req.method !== "POST") { sendJson(res, 405, { error: "Use GET or POST" });return; }
|
|
171
|
+
if (!sameOrigin(req)) { sendJson(res, 403, { error: "Settings require the same-origin dashboard" });return; }
|
|
172
|
+
if (!/^application\/json(?:\s*;|$)/i.test(req.headers["content-type"] || "")) { sendJson(res, 415, { error: "Expected application/json" });return; }
|
|
173
|
+
const abort = createRequestAbort(req, res);abort.setTimeout(5000, "request_body_timeout");
|
|
174
|
+
try {
|
|
175
|
+
const input = await readJsonBody(req, { maxBodyBytes: 4096, maxDecodedBodyBytes: 4096, signal: abort.signal });
|
|
176
|
+
abort.clearTimeout();const data = await serviceControl.action(input);
|
|
177
|
+
if (!res.destroyed && !res.writableEnded) sendJson(res, 200, data);
|
|
178
|
+
} catch (error) {
|
|
179
|
+
sendJson(res, error.statusCode || (error.code?.startsWith("ccdx_cache_") ? 409 : 400), { error: safeText(error.message, 300) });
|
|
180
|
+
} finally { abort.cleanup(); }
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
|
|
161
184
|
if (pathname === AUTH_PATH && req.method === "GET") {
|
|
162
185
|
try {
|
|
163
186
|
const profile = authStatusFn()?.profiles?.codex;
|
|
@@ -215,6 +238,7 @@ export async function handleDashboardApi(req, res, pathname, {
|
|
|
215
238
|
}
|
|
216
239
|
try {
|
|
217
240
|
const result = writeTerminalAnimationTheme(body.theme, { env, home });
|
|
241
|
+
applyAnimation?.(body.theme);
|
|
218
242
|
sendJson(res, 200, { changed: result.changed, ...animationState(env, home) });
|
|
219
243
|
} catch {
|
|
220
244
|
sendJson(res, 409, { error: "Animation setting was not saved; check ccdx animation" });
|
package/src/dashboard.mjs
CHANGED
|
@@ -7,6 +7,7 @@ const ASSETS = new Map([
|
|
|
7
7
|
["/theme.js", ["./dashboard/theme.js", "text/javascript; charset=utf-8"]],
|
|
8
8
|
["/language.js", ["./dashboard/language.js", "text/javascript; charset=utf-8"]],
|
|
9
9
|
["/ui.js", ["./dashboard/ui.js", "text/javascript; charset=utf-8"]],
|
|
10
|
+
["/console.js", ["./dashboard/console.js", "text/javascript; charset=utf-8"]],
|
|
10
11
|
["/status.js", ["./dashboard/status.js", "text/javascript; charset=utf-8"]],
|
|
11
12
|
["/usage.js", ["./dashboard/usage.js", "text/javascript; charset=utf-8"]],
|
|
12
13
|
["/refresh.js", ["./dashboard/refresh.js", "text/javascript; charset=utf-8"]],
|
package/src/image-mcp.mjs
CHANGED
|
@@ -6,6 +6,7 @@ import { isIP } from "node:net";
|
|
|
6
6
|
import { isLoopbackAddress, isLoopbackHostHeader } from "./security.mjs";
|
|
7
7
|
import { generateImage, supportsImageEditing, IMAGE_MAX_BYTES } from "./image-provider.mjs";
|
|
8
8
|
import { readImageProviderConfig } from "./image-provider-config.mjs";
|
|
9
|
+
import { servicePreferences } from "./user-settings.mjs";
|
|
9
10
|
import { createImageReferenceStore } from "./image-references.mjs";
|
|
10
11
|
|
|
11
12
|
const MCP_PROTOCOL_VERSION = "2025-06-18";
|
|
@@ -155,6 +156,7 @@ function safeToolError(error, apiKey) {
|
|
|
155
156
|
|
|
156
157
|
export function createImageMcpHandler({
|
|
157
158
|
configLoader = () => readImageProviderConfig(),
|
|
159
|
+
isEnabled = () => servicePreferences().image_enabled,
|
|
158
160
|
generateImageFn = generateImage,
|
|
159
161
|
maxConcurrent = 2,
|
|
160
162
|
localHostname = "",
|
|
@@ -216,9 +218,10 @@ export function createImageMcpHandler({
|
|
|
216
218
|
protocolVersion: MCP_PROTOCOL_VERSIONS.has(requestedVersion) ? requestedVersion : MCP_PROTOCOL_VERSION,
|
|
217
219
|
capabilities: { tools: { listChanged: false } },
|
|
218
220
|
serverInfo: { name: "ccdx-image", version: "1" },
|
|
219
|
-
instructions: config
|
|
221
|
+
instructions: config && isEnabled()
|
|
220
222
|
? `CCDX handles the configured image API and credentials; no Python or SDK setup. Embed returned image Markdown in the final reply. Redisplay reuses it without tool calls. Keep each image_id with its own image. Do not automatically retry failed/timed-out requests or switch providers.${supportsImageEditing(config) ? " Use generate_image for new images; edit_image requires the exact retained source ID." : " Use generate_image for new images. Editing is unsupported; do not substitute generation."}`
|
|
221
|
-
: "Image
|
|
223
|
+
: config ? "Image calls are paused. Resume them in the CCDX WebUI; the provider and retained edit handles are preserved."
|
|
224
|
+
: "Image generation is disabled. Enable it with ccdx enable-image before requesting images.",
|
|
222
225
|
});
|
|
223
226
|
return;
|
|
224
227
|
}
|
|
@@ -229,7 +232,7 @@ export function createImageMcpHandler({
|
|
|
229
232
|
if (request.method === "tools/list") {
|
|
230
233
|
const config = configLoader();
|
|
231
234
|
if (!config) imageReferences.clear();
|
|
232
|
-
reply({ tools: config ? [imageTool(), ...(supportsImageEditing(config) ? [editTool()] : [])] : [] });
|
|
235
|
+
reply({ tools: config && isEnabled() ? [imageTool(), ...(supportsImageEditing(config) ? [editTool()] : [])] : [] });
|
|
233
236
|
return;
|
|
234
237
|
}
|
|
235
238
|
if (request.method !== "tools/call") {
|
|
@@ -242,10 +245,10 @@ export function createImageMcpHandler({
|
|
|
242
245
|
}
|
|
243
246
|
metrics.total += 1;
|
|
244
247
|
const config = configLoader();
|
|
245
|
-
if (!config) {
|
|
248
|
+
if (!config || !isEnabled()) {
|
|
246
249
|
metrics.failed += 1;
|
|
247
|
-
imageReferences.clear();
|
|
248
|
-
reply({ content: [{ type: "text", text: "Image generation is disabled. Run ccdx enable-image first." }], isError: true });
|
|
250
|
+
if (!config) imageReferences.clear();
|
|
251
|
+
reply({ content: [{ type: "text", text: config ? "Image calls are paused. Resume them in the CCDX WebUI." : "Image generation is disabled. Run ccdx enable-image first." }], isError: true });
|
|
249
252
|
return;
|
|
250
253
|
}
|
|
251
254
|
const editing = request.params.name === EDIT_TOOL_NAME;
|