codex-copilot-dx 1.2.7 → 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.
- package/README.md +3 -3
- package/docs/ARCHITECTURE.md +7 -1
- package/docs/README.md +1 -0
- package/docs/REFERENCE.md +10 -6
- package/package.json +1 -1
- package/src/claude-gateway.mjs +2 -2
- package/src/dashboard/activity.js +27 -0
- package/src/dashboard/console.js +1 -0
- package/src/dashboard/index.html +6 -2
- package/src/dashboard/language.js +4 -0
- package/src/dashboard/status.js +1 -0
- package/src/dashboard/theme.js +3 -2
- package/src/dashboard/ui.css +50 -0
- package/src/dashboard/ui.js +1 -0
- package/src/dashboard.mjs +1 -0
- package/src/observability.mjs +7 -1
- package/src/optional-routes.mjs +1 -1
- package/src/stream-performance.mjs +7 -0
- package/src/terminal-colors.mjs +8 -3
- package/src/terminal-console.mjs +5 -3
- package/src/user-settings.mjs +2 -2
package/README.md
CHANGED
|
@@ -14,15 +14,15 @@ npm install -g codex-copilot-dx@latest
|
|
|
14
14
|
ccdx
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
-
No Node or Git? Download [install.sh](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.
|
|
17
|
+
No Node or Git? Download [install.sh](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.8/install.sh) (macOS/Linux) or [install.ps1](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.8/install.ps1) (Windows), then run `sh install.sh` or `./install.ps1` under your current shell policy. The bootstrap reuses compatible Node/npm or installs verified official Node 24.22.0 privately for CCDX. It adds no Git, compiler or system package manager. It keeps registry/proxy/certificate policy, verifies the Release package and installed runtime, and restores the prior CCDX package if installation fails. Dependencies still need your configured registry. See [installation limits and private command paths](docs/REFERENCE.md#install-without-node-or-git).
|
|
18
18
|
|
|
19
19
|
CCDX reuses a compatible local credential or starts GitHub Device Flow, listens on `127.0.0.1:2026`, configures Codex, and opens the App. Interactive desktop starts also open the local WebUI once; use `ccdx --no-browser` or disable this in WebUI settings. No client binary patch is needed. On Windows, open the App manually unless native prediction setup is enabled. In restricted Windows PowerShell, use `npm.cmd` to install and `ccdx.cmd` for the first launch, or run `ccdx.cmd doctor --fix`. Startup, updates and explicit repair remove only CCDX's exact npm-generated `.ps1` launchers so later calls can use `ccdx`. The npm package adds no install hook or policy change; custom launchers are preserved. npm's own script is untouched. The configured `dummy` API key is a placeholder, not a credential.
|
|
20
20
|
|
|
21
|
-
The [local control console](http://127.0.0.1:2026/) keeps indented Codex/Claude pages, Model sources, Usage, Requests and Settings. Codex owns source/model, Auto Review, images, input suggestions and conversation buffering; Model sources owns accounts, catalogs and Microsoft 365 access. Browsing a catalog never changes routing. Usage offers animated bars (default) or curves without extra requests; reduced motion keeps them static. Overview
|
|
21
|
+
The [local control console](http://127.0.0.1:2026/) keeps indented Codex/Claude pages, Model sources, Usage, Requests and Settings. Codex owns source/model, Auto Review, images, input suggestions and conversation buffering; Model sources owns accounts, catalogs and Microsoft 365 access. Browsing a catalog never changes routing. Usage offers animated bars (default) or curves without extra requests; reduced motion keeps them static. Overview and the live terminal table show the same approximate token cache hit rate, retaining partial/unknown states. Overview adds six small activity dots; only idle has a breathing halo. Failed or six-second-old activity reads show unknown. The indicator shares existing status polling, so very short requests can fall between snapshots. The existing visual style and logo remain. System proxy exceptions accept shortened IPv4 networks; M365 network failures retain specific, redacted reasons.
|
|
22
22
|
|
|
23
23
|
Startup shows bounded checks, sources with discovered model lists and Claude Code/App configuration. Prediction normally uses one summary line; `ccdx prediction status` retains recovery and environment details. After Ready, an interactive terminal shows current source/Claude state and a line-framed table of this process's returned usage and inference counters. Notices and activity each have their own line; individual requests do not scroll. Input includes reused input tokens. `ccdx --verbose` (also `--show-request-id`, or debug logging) retains detail output; optional file logging remains independently controlled. Source and Claude summaries wrap on narrow terminals. Failed reads show previous-data status and the last successful update time. Non-TTY, CI, dumb, or terminals too small for the full region use plain output (at least 40 columns / 16 rows are required). `Ready` only means the core service is available; discovered catalogs and configured clients do not prove inference access.
|
|
24
24
|
|
|
25
|
-
WebUI settings apply animation choices live, pause/resume configured image calls and prediction adaptation without removing credentials/trust, change the Codex source explicitly, and manage the conversation-buffer limit. Saved preference and effective state are separate; browser opening is labeled for the next start. Clearing the conversation buffer clears **all** buffered continuations. Busy cleanup is refused; retry after active requests finish. Saved Codex transcripts are retained. First-time image/prediction setup still uses the existing CLI; trust, client routing and cached client capabilities may require a normal App relaunch. Busy M365 requests must finish before disabling that provider. Settings also offers independent webpage/terminal colors: classic green (default) or
|
|
25
|
+
WebUI settings apply animation choices live, pause/resume configured image calls and prediction adaptation without removing credentials/trust, change the Codex source explicitly, and manage the conversation-buffer limit. Saved preference and effective state are separate; browser opening is labeled for the next start. Clearing the conversation buffer clears **all** buffered continuations. Busy cleanup is refused; retry after active requests finish. Saved Codex transcripts are retained. First-time image/prediction setup still uses the existing CLI; trust, client routing and cached client capabilities may require a normal App relaunch. Busy M365 requests must finish before disabling that provider. Settings also offers independent webpage/terminal colors: classic green (default), Klein blue or Soft pink. Web colors stay in this browser; terminal colors persist locally. Failed saves are reported. See the [control reference](docs/REFERENCE.md#control-console-and-online-settings).
|
|
26
26
|
|
|
27
27
|
While visible and auto-refresh is on, the console reads the small status snapshot about every two seconds and source/settings evidence about every 16 seconds. Catalogs and retained usage are fetched on demand and at most once per 30-minute refresh interval while their view is open. Hidden pages stop scheduled reads. First output uses **ms**, estimated speed **token/s**, and each protocol has its own samples. HTTP traffic includes catalog and routing requests; it is not a conversation count.
|
|
28
28
|
The **Requests by source** section and `ccdx status` separate request outcomes by source and protocol. Process-local returned usage also retains bounded source totals; missing usage remains partial. Configuration, sign-in, discovery and a completed reply remain separate evidence. CLI text stays English; WebUI stays bilingual. See the [copy inventory](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/UX_COPY.md) and [1.2.0 verification](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/RELEASE_1.2.0.md).
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -424,6 +424,12 @@ management. CLI and UI share advertised effort filtering and preference writes.
|
|
|
424
424
|
|
|
425
425
|
## Independent appearance settings (1.2.2)
|
|
426
426
|
|
|
427
|
-
Web color (`green` / `klein`) and dark/light mode are browser-local presentation state applied before CSS in `dashboard/theme.js`. CSS semantic roles keep errors/warnings separate from theme accents. Terminal color uses a distinct `terminal_color_theme` config field; animation continues to use `terminal_animation`. `terminal-colors.mjs` owns terminal color capability checks and escaping, while the existing layout runs on plain text first. The one-per-second coherent settings snapshot carries terminal color; animation frames introduce no additional settings reads. No inference, provider-routing or installer dependency is added.
|
|
427
|
+
Web color (`green` / `klein` / `pink`) and dark/light mode are browser-local presentation state applied before CSS in `dashboard/theme.js`. CSS semantic roles keep errors/warnings separate from theme accents. Terminal color uses a distinct `terminal_color_theme` config field; animation continues to use `terminal_animation`. `terminal-colors.mjs` owns terminal color capability checks and escaping, while the existing layout runs on plain text first. The one-per-second coherent settings snapshot carries terminal color; animation frames introduce no additional settings reads. No inference, provider-routing or installer dependency is added.
|
|
428
428
|
|
|
429
429
|
The existing same-origin bounded settings action saves terminal color through the strict locked atomic writer, then applies it to the live console. Read or save failures retain existing files and controls revert to the last confirmed choice. Model-list check errors project only bounded public diagnostic fields; UI associates them with the selected source and its last successful snapshot. Existing generation checks, cancellation and deduplication prevent late results from replacing another source's data.
|
|
430
|
+
|
|
431
|
+
## Activity presentation and Messages timing (1.2.8)
|
|
432
|
+
|
|
433
|
+
The existing status payload projects `model_activity.active` from the three fixed inference route counters plus actual image-generation activity, never total HTTP activity or image MCP calls. It adds no history store, provider request or listener. `dashboard/activity.js` consumes this metadata through the existing refresh path, expires stale evidence after six seconds and pauses offscreen animation. Idle, active and unknown remain distinct; CSS owns six theme-colored dots and the idle-only halo. Terminal Cache hit reads the existing raw runtime aggregate rather than deriving a ratio from rounded display numbers.
|
|
434
|
+
|
|
435
|
+
The Claude gateway still relays original native SSE bytes. `stream-performance.mjs` classifies only nonempty text, thinking and tool-argument deltas as first output; empty and signature-only deltas remain transport metadata. Sparse/interleaved blocks are not reordered or translated. Existing provider generations, locked atomic settings writes, cancellation and route ownership remain the composition boundaries.
|
package/docs/README.md
CHANGED
|
@@ -17,6 +17,7 @@ effective Codex configuration or validate every field against the installed app.
|
|
|
17
17
|
|
|
18
18
|
## Historical release evidence
|
|
19
19
|
|
|
20
|
+
- [1.2.8: Soft pink, accurate activity and terminal cache reuse](RELEASE_1.2.8.md)
|
|
20
21
|
- [1.2.7: Account tools, checks and repairs, consistent status icons](RELEASE_1.2.7.md)
|
|
21
22
|
- [1.2.6: Abbreviated proxy networks and preserved diagnostics](RELEASE_1.2.6.md)
|
|
22
23
|
- [1.2.5: Animated usage views and approximate cache hit rate](RELEASE_1.2.5.md)
|
package/docs/REFERENCE.md
CHANGED
|
@@ -715,7 +715,7 @@ Run `ccdx <command> --help` for command-specific behavior and side-effect detail
|
|
|
715
715
|
Startup uses aligned status/project/result columns and a left-aligned Ready footer
|
|
716
716
|
with the Web UI URL and `ccdx help`. Ctrl+C is shown only for the foreground-owned
|
|
717
717
|
service, never a short-lived command reusing another service. A static, favicon-style
|
|
718
|
-
atom uses
|
|
718
|
+
atom uses the saved terminal color (green by default) and half-block characters only on interactive color terminals
|
|
719
719
|
at least 72 columns wide; narrow terminals, `NO_COLOR`, `TERM=dumb` and redirected
|
|
720
720
|
output keep a plain title. No new graphics/font/runtime dependency is installed.
|
|
721
721
|
Credentials found are not labeled online-authorized, cached model lists are not
|
|
@@ -799,7 +799,7 @@ not a guarantee that every browser will reuse an existing tab.
|
|
|
799
799
|
|
|
800
800
|
The default TTY display uses wrapping source/Claude summaries, a line-framed usage/inference table, and separate notice/activity rows, without an alternate screen or raw keyboard input. It shows usage returned since this process began; pending
|
|
801
801
|
usage is excluded, missing usage stays partial, and this is not an invoice.
|
|
802
|
-
Business requests drive activity; status/catalog polling does not. Existing nine
|
|
802
|
+
Business requests drive terminal activity; status/catalog polling does not. The live table fills its existing last usage row with Cache hit, using the same process-local cache_hit_rate and partial marker as Overview. Unknown/invalid rates display —; a known zero displays 0.0%. Existing nine
|
|
803
803
|
animation styles retain their timing and cycle pauses; the default green retains its original palette. `--verbose`,
|
|
804
804
|
`--show-request-id` or `CCDX_LOG_LEVEL=debug` restore detailed terminal output.
|
|
805
805
|
Failed reads show previous-data status and the last successful update time, or that no data has been received. Narrow summaries wrap rather than hiding Claude App/Code state. Non-TTY/CI/dumb/too-small terminals use plain output; repeated identical notices
|
|
@@ -842,13 +842,17 @@ auto-refresh still permits manual refresh/settings retry. No history-log scan is
|
|
|
842
842
|
performed at the status cadence. The atom moves on load/manual refresh only and
|
|
843
843
|
respects reduced motion. Client attribution absent from older records stays unknown.
|
|
844
844
|
|
|
845
|
+
### Overview activity
|
|
846
|
+
|
|
847
|
+
Overview reserves a fixed-height row below its status summary. Six 4px theme-colored dots appear and retract in order while the status snapshot reports active Responses, compaction, Claude Messages or actual image generation. Catalog reads, token counting, image MCP discovery and management calls are excluded; retries do not add another logical request. Active dots have no halo. Idle shows one small dot with a breathing halo. Invalid/missing status or a read older than six seconds shows Activity unknown, without a halo. This reuses the existing two-second status polling; short requests between snapshots may not be shown. No model probing, stream connection or extra polling is added. Hidden pages/views pause motion; reduced motion shows static corresponding states.
|
|
848
|
+
|
|
845
849
|
### Color themes
|
|
846
850
|
|
|
847
|
-
Settings separates Web appearance and Terminal appearance. Each offers Classic green (default) and
|
|
851
|
+
Settings separates Web appearance and Terminal appearance. Each offers Classic green (default), Klein blue and Soft pink. Green preserves the previous palette and terminal table's original text colors. Blue and pink color the terminal logo, full table and activity animation without changing glyphs, timing or metric definitions. Webpage color is independent of terminal color, and of the page header's dark/light switch.
|
|
848
852
|
|
|
849
|
-
Web choices use `ccdx.dashboard.palette` (`green` / `klein`) and the existing `ccdx.dashboard.theme` (`dark` / `light`) in browser local storage. They are applied before the stylesheet, including the atom favicon. Same-origin tabs receive storage updates; other browsers retain their own choices. If storage is blocked, the current tab still changes and explicitly reports that the choice was not saved. No service request is needed to change webpage colors.
|
|
853
|
+
Web choices use `ccdx.dashboard.palette` (`green` / `klein` / `pink`) and the existing `ccdx.dashboard.theme` (`dark` / `light`) in browser local storage. They are applied before the stylesheet, including the atom favicon. Same-origin tabs receive storage updates; other browsers retain their own choices. If storage is blocked, the current tab still changes and explicitly reports that the choice was not saved. No service request is needed to change webpage colors.
|
|
850
854
|
|
|
851
|
-
Terminal color uses `terminal_color_theme: "klein"` in the normal CCDX user config. An absent value means `green`; choosing green removes the override. It does not change `terminal_animation` or any capability flag. The same bounded, strict settings read, file lock and atomic writer are reused. Invalid/unreadable existing config is not overwritten with defaults. A successful save applies to the supported live status table; the startup logo uses the saved choice next time. Previously printed terminal lines are not rewritten. Color codes are added after width calculation and clipping. Truecolor, 256-color and ANSI
|
|
855
|
+
Terminal color uses `terminal_color_theme: "klein"` or `"pink"` in the normal CCDX user config. An absent value means `green`; choosing green removes the override. It does not change `terminal_animation` or any capability flag. The same bounded, strict settings read, file lock and atomic writer are reused. Invalid/unreadable existing config is not overwritten with defaults. A successful save applies to the supported live status table; the startup logo uses the saved choice next time. Previously printed terminal lines are not rewritten. Color codes are added after width calculation and clipping. Truecolor, 256-color and ordinary ANSI fallbacks are supported; `NO_COLOR`, dumb terminals and redirected output preserve plain output. A terminal's own palette and background affect the displayed color. Pink uses a darker tone when COLORFGBG explicitly identifies a light background (7 or 15); otherwise its default tone is pale pink. CCDX does not query or change the terminal background.
|
|
852
856
|
|
|
853
857
|
The terminal sample in Settings is labeled Preview and uses sample numbers, not current usage. Existing nine animation previews and their save operation remain available beneath the color choice. Red errors and amber warnings keep their meaning across webpage themes.
|
|
854
858
|
|
|
@@ -1008,7 +1012,7 @@ Unknown support prevents an explicitly requested exception from starting.
|
|
|
1008
1012
|
For an older updater that still requires Git, install the Release tarball directly:
|
|
1009
1013
|
|
|
1010
1014
|
```sh
|
|
1011
|
-
npm install -g https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.
|
|
1015
|
+
npm install -g https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.8/codex-copilot-dx-1.2.8.tgz
|
|
1012
1016
|
# Windows PowerShell: use npm.cmd instead of npm.
|
|
1013
1017
|
```
|
|
1014
1018
|
|
package/package.json
CHANGED
package/src/claude-gateway.mjs
CHANGED
|
@@ -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(
|
|
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);
|
|
@@ -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
|
+
})();
|
package/src/dashboard/console.js
CHANGED
|
@@ -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
|
}
|
package/src/dashboard/index.html
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<script src="/refresh.js" defer></script>
|
|
12
12
|
<script src="/icons.js" defer></script>
|
|
13
13
|
<script src="/status.js" defer></script>
|
|
14
|
+
<script src="/activity.js" defer></script>
|
|
14
15
|
<script src="/usage.js" defer></script>
|
|
15
16
|
<script src="/updates.js" defer></script>
|
|
16
17
|
<script src="/ui.js" defer></script>
|
|
@@ -49,6 +50,9 @@
|
|
|
49
50
|
|
|
50
51
|
|
|
51
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>
|
|
52
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>
|
|
53
57
|
<details class="panel dashboard-section" id="client-features" open>
|
|
54
58
|
<summary class="panel-heading"><h2 data-i18n="client_connections">APP SETUP</h2><span data-i18n="configuration_observation">SETUP AND ACTIVITY</span></summary>
|
|
@@ -248,7 +252,7 @@ Missing data is unknown. This panel keeps no prompts or images.</p>
|
|
|
248
252
|
<h2 id="web-appearance-title" data-i18n="appearance_web_appearance">网页外观</h2>
|
|
249
253
|
<div class="appearance-row">
|
|
250
254
|
<div class="appearance-label"><label for="web-color-theme" data-i18n="appearance_color_theme">颜色主题</label><p data-i18n="appearance_browser_scope">只影响当前浏览器。</p></div>
|
|
251
|
-
<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>
|
|
252
256
|
</div>
|
|
253
257
|
<p id="web-color-note" class="appearance-note" role="status" data-i18n="theme_saved_browser">选择后,网页立即换色。</p>
|
|
254
258
|
</section>
|
|
@@ -257,7 +261,7 @@ Missing data is unknown. This panel keeps no prompts or images.</p>
|
|
|
257
261
|
<h2 id="terminal-appearance-title" data-i18n="terminal_appearance">终端外观</h2>
|
|
258
262
|
<div class="appearance-row">
|
|
259
263
|
<div class="appearance-label"><label for="terminal-color-theme" data-i18n="appearance_color_theme">颜色主题</label><p data-i18n="appearance_terminal_scope">与网页主题分别设置。</p></div>
|
|
260
|
-
<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>
|
|
261
265
|
</div>
|
|
262
266
|
<p id="terminal-color-note" class="appearance-note" role="status" data-i18n="appearance_terminal_effect">表格即时换色,启动 Logo 下次生效。</p>
|
|
263
267
|
|
|
@@ -146,6 +146,10 @@
|
|
|
146
146
|
"appearance_browser_scope": ["This browser only.", "只影响当前浏览器。"],
|
|
147
147
|
"appearance_classic_green": ["Classic green (default)", "经典绿(默认)"],
|
|
148
148
|
"appearance_klein_blue": ["Klein blue", "克莱因蓝"],
|
|
149
|
+
"appearance_soft_pink": ["Soft pink", "淡粉色"],
|
|
150
|
+
"model_activity_active": ["Processing {count} requests", "正在处理 {count} 个请求"],
|
|
151
|
+
"model_activity_idle": ["No model requests", "暂无模型请求"],
|
|
152
|
+
"model_activity_unknown": ["Activity unknown", "活动状态未知"],
|
|
149
153
|
"appearance_terminal_scope": ["Independent of the webpage theme.", "与网页主题分别设置。"],
|
|
150
154
|
"appearance_terminal_effect": ["Table updates now. Startup logo changes next launch.", "表格即时换色,启动 Logo 下次生效。"],
|
|
151
155
|
"appearance_sample": ["Sample data", "示例数据"],
|
package/src/dashboard/status.js
CHANGED
|
@@ -162,6 +162,7 @@
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
function render(data) {
|
|
165
|
+
globalThis.ccdxDashboardActivity?.update(data.model_activity);
|
|
165
166
|
text("version", `v${data.version || "?"}`);
|
|
166
167
|
text("uptime", "pid_pid_uptime_duration", { pid: number(data.pid), duration: duration(data.uptime_ms) });
|
|
167
168
|
|
package/src/dashboard/theme.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const key = "ccdx.dashboard.theme", paletteKey = "ccdx.dashboard.palette";
|
|
3
|
-
const valid = value => value === "green" || value === "klein";
|
|
3
|
+
const valid = value => value === "green" || value === "klein" || value === "pink";
|
|
4
4
|
let theme = "dark", palette = "green", saved = true;
|
|
5
5
|
try {
|
|
6
6
|
if (localStorage.getItem(key) === "light") theme = "light";
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
const applyTheme = () => {
|
|
19
19
|
document.documentElement.dataset.theme = theme;
|
|
20
20
|
document.documentElement.dataset.palette = palette;
|
|
21
|
-
const
|
|
21
|
+
const colors = { green: ["#a6f5a8", "#176b3a"], klein: ["#789aff", "#002fa7"], pink: ["#f3a8c8", "#a83e68"] };
|
|
22
|
+
const color = colors[palette][theme === "dark" ? 0 : 1];
|
|
22
23
|
const svg = `<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"><g fill="none" stroke="${color}" 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="${color}"/></svg>`;
|
|
23
24
|
document.getElementById("favicon").href = `data:image/svg+xml,${encodeURIComponent(svg)}`;
|
|
24
25
|
};
|
package/src/dashboard/ui.css
CHANGED
|
@@ -283,6 +283,56 @@ input[role="switch"]:disabled { opacity: .5; cursor: wait; }
|
|
|
283
283
|
:root:not([data-theme="light"]) #animation-settings { --ansi-white:#f5fff5;--ansi-159:#9af5e9;--ansi-123:#75e4d9;--ansi-87:#5ad0d4;--ansi-51:#42b9d8;--ansi-45:#3ca2d0;--ansi-39:#4389c2;--ansi-33:#4775b2; }
|
|
284
284
|
:root:not([data-theme="light"]) #animation-settings[data-terminal-palette="klein"] { --ansi-white:#789aff;--ansi-159:#789aff;--ansi-123:#789aff;--ansi-87:#789aff;--ansi-51:#789aff;--ansi-45:#789aff;--ansi-39:#789aff;--ansi-33:#789aff; }
|
|
285
285
|
|
|
286
|
+
:root[data-palette="pink"][data-theme="light"] {
|
|
287
|
+
--page:#fff7fa; --surface:#fff; --text:#432e39; --strong:#35202d;
|
|
288
|
+
--muted:#765365; --badge:#765365; --subtle:#765365; --quiet:#805d70; --footer:#805d70;
|
|
289
|
+
--border:#e8ccd8; --top-border:#dfbdcd; --accent:#a83e68; --accent-soft:#a83e68; --heading:#a83e68;
|
|
290
|
+
--button-border:#c38ba4; --button-bg:#fff0f6; --button-fg:#a83e68; --button-hover:#f8dce9;
|
|
291
|
+
--selected-bg:#fae5ef; --option-hover:#fff0f6; --table-text:#432e39; --preview:#805d70;
|
|
292
|
+
--ansi-white:#a83e68; --ansi-159:#aa4a72; --ansi-123:#b3527c; --ansi-87:#ab4671;
|
|
293
|
+
--ansi-51:#a13f69; --ansi-45:#963c66; --ansi-39:#8e3c65; --ansi-33:#843b62;
|
|
294
|
+
--bad:#a33625; --failed:#a33625; --incomplete:#835600;
|
|
295
|
+
}
|
|
296
|
+
:root[data-palette="pink"]:not([data-theme="light"]) {
|
|
297
|
+
--page:#160f16; --surface:#211720; --text:#f2e2eb; --strong:#fff0f6;
|
|
298
|
+
--muted:#c4a7b8; --badge:#d4b8c9; --subtle:#c4a7b8; --quiet:#b598aa; --footer:#b598aa;
|
|
299
|
+
--border:#513342; --top-border:#513342; --accent:#f3a8c8; --accent-soft:#f3a8c8; --heading:#f3a8c8;
|
|
300
|
+
--button-border:#9f6885; --button-bg:#31202d; --button-fg:#f3a8c8; --button-hover:#482b3e;
|
|
301
|
+
--selected-bg:#3b2333; --option-hover:#31202d; --table-text:#f2e2eb; --preview:#c4a7b8;
|
|
302
|
+
--ansi-white:#ffe7f3; --ansi-159:#f7c4da; --ansi-123:#f3b6d1; --ansi-87:#efa8c8;
|
|
303
|
+
--ansi-51:#e99bbd; --ansi-45:#da8bb0; --ansi-39:#cd7fa5; --ansi-33:#bd739a;
|
|
304
|
+
--bad:#ff947e; --failed:#ff9f91; --incomplete:#e3c77c;
|
|
305
|
+
}
|
|
306
|
+
.terminal-sample[data-terminal-palette="pink"] { --sample-logo:#f3a8c8; --sample-table:#f3a8c8; --sample-motion:#f3a8c8; }
|
|
307
|
+
:root:not([data-theme="light"]) #animation-settings[data-terminal-palette="pink"] { --ansi-white:#f3a8c8;--ansi-159:#f3a8c8;--ansi-123:#f3a8c8;--ansi-87:#f3a8c8;--ansi-51:#f3a8c8;--ansi-45:#f3a8c8;--ansi-39:#f3a8c8;--ansi-33:#f3a8c8; }
|
|
308
|
+
:root[data-theme="light"] #animation-settings[data-terminal-palette="pink"] { --ansi-white:#a83e68;--ansi-159:#a83e68;--ansi-123:#a83e68;--ansi-87:#a83e68;--ansi-51:#a83e68;--ansi-45:#a83e68;--ansi-39:#a83e68;--ansi-33:#a83e68; }
|
|
309
|
+
|
|
310
|
+
.model-activity { display:flex;align-items:center;height:30px;margin-top:-26px;padding-left:3px;color:var(--muted);font-size:11px; }
|
|
311
|
+
.activity-lamp,.activity-dots i { position:relative;display:block;flex:none;width:4px;height:4px;border-radius:50%;background:color-mix(in srgb,var(--accent) 72%,var(--surface)); }
|
|
312
|
+
.activity-dots { display:flex;align-items:center;gap:6px;width:0;height:22px;opacity:0;transition:width 320ms ease,padding 320ms ease,opacity 220ms ease; }
|
|
313
|
+
.activity-dots i { opacity:0;transform:scale(.4); }
|
|
314
|
+
.activity-label { margin-left:10px; }
|
|
315
|
+
.model-activity[data-state="active"] .activity-dots { width:50px;padding-left:6px;opacity:1; }
|
|
316
|
+
.model-activity[data-state="active"] .activity-dots i { animation:activity-second 4s ease-in-out infinite; }
|
|
317
|
+
.model-activity[data-state="active"] .activity-dots i:nth-child(2) { animation-name:activity-third; }
|
|
318
|
+
.model-activity[data-state="active"] .activity-dots i:nth-child(3) { animation-name:activity-fourth; }
|
|
319
|
+
.model-activity[data-state="active"] .activity-dots i:nth-child(4) { animation-name:activity-fifth; }
|
|
320
|
+
.model-activity[data-state="active"] .activity-dots i:nth-child(5) { animation-name:activity-sixth; }
|
|
321
|
+
.model-activity[data-state="idle"] .activity-lamp::before { content:"";position:absolute;left:50%;top:50%;width:20px;height:20px;border-radius:50%;background:radial-gradient(circle,color-mix(in srgb,var(--accent) 24%,var(--surface)) 0%,transparent 68%);transform:translate(-50%,-50%);animation:activity-breathe 3.2s ease-in-out infinite; }
|
|
322
|
+
.model-activity[data-state="unknown"] .activity-lamp { background:transparent;border:1px solid var(--muted); }
|
|
323
|
+
.model-activity[data-paused="true"] .activity-dots i,.model-activity[data-paused="true"] .activity-lamp::before { animation-play-state:paused; }
|
|
324
|
+
@keyframes activity-breathe { 0%,100%{opacity:.45;transform:translate(-50%,-50%) scale(.8)}50%{opacity:.95;transform:translate(-50%,-50%) scale(1.18)} }
|
|
325
|
+
@keyframes activity-second { 0%,6%,94%,100%{opacity:0;transform:scale(.4)}12%,88%{opacity:1;transform:scale(1)} }
|
|
326
|
+
@keyframes activity-third { 0%,14%,86%,100%{opacity:0;transform:scale(.4)}20%,80%{opacity:1;transform:scale(1)} }
|
|
327
|
+
@keyframes activity-fourth { 0%,22%,78%,100%{opacity:0;transform:scale(.4)}28%,72%{opacity:1;transform:scale(1)} }
|
|
328
|
+
@keyframes activity-fifth { 0%,30%,70%,100%{opacity:0;transform:scale(.4)}36%,64%{opacity:1;transform:scale(1)} }
|
|
329
|
+
@keyframes activity-sixth { 0%,38%,62%,100%{opacity:0;transform:scale(.4)}44%,56%{opacity:1;transform:scale(1)} }
|
|
330
|
+
@media(prefers-reduced-motion:reduce) {
|
|
331
|
+
.activity-dots { transition:none; }
|
|
332
|
+
.model-activity[data-state="active"] .activity-dots i { animation:none;opacity:1;transform:none; }
|
|
333
|
+
.model-activity[data-state="idle"] .activity-lamp::before { animation:none;opacity:.6; }
|
|
334
|
+
}
|
|
335
|
+
|
|
286
336
|
:root[data-theme="light"] #animation-settings { --ansi-white:#234231;--ansi-159:#116b64;--ansi-123:#0d7771;--ansi-87:#116b75;--ansi-51:#14697e;--ansi-45:#1a6183;--ansi-39:#265f8d;--ansi-33:#365a8d; }
|
|
287
337
|
:root[data-theme="light"] #animation-settings[data-terminal-palette="klein"] { --ansi-white:#002fa7;--ansi-159:#002fa7;--ansi-123:#002fa7;--ansi-87:#002fa7;--ansi-51:#002fa7;--ansi-45:#002fa7;--ansi-39:#002fa7;--ansi-33:#002fa7; }
|
|
288
338
|
|
package/src/dashboard/ui.js
CHANGED
|
@@ -392,6 +392,7 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
|
|
|
392
392
|
},
|
|
393
393
|
apply: render,
|
|
394
394
|
state: state => {
|
|
395
|
+
if (state.error || !state.value) globalThis.ccdxDashboardActivity?.unavailable();
|
|
395
396
|
text("connection", state.pending && !state.value ? "reading" : state.error ? "unavailable_eb0be" : "service_reachable");
|
|
396
397
|
element("connection").className = `badge ${state.pending ? "neutral" : state.error ? "bad" : "good"}`;
|
|
397
398
|
globalThis.ccdxIcons?.set(element("connection"), state.pending && !state.value ? "reading" : state.error ? "unavailable_eb0be" : "service_reachable",
|
package/src/dashboard.mjs
CHANGED
|
@@ -10,6 +10,7 @@ const ASSETS = new Map([
|
|
|
10
10
|
["/console.js", ["./dashboard/console.js", "text/javascript; charset=utf-8"]],
|
|
11
11
|
["/updates.js", ["./dashboard/updates.js", "text/javascript; charset=utf-8"]],
|
|
12
12
|
["/status.js", ["./dashboard/status.js", "text/javascript; charset=utf-8"]],
|
|
13
|
+
["/activity.js", ["./dashboard/activity.js", "text/javascript; charset=utf-8"]],
|
|
13
14
|
["/usage.js", ["./dashboard/usage.js", "text/javascript; charset=utf-8"]],
|
|
14
15
|
["/refresh.js", ["./dashboard/refresh.js", "text/javascript; charset=utf-8"]],
|
|
15
16
|
["/icons.js", ["./dashboard/icons.js", "text/javascript; charset=utf-8"]],
|
package/src/observability.mjs
CHANGED
|
@@ -187,6 +187,11 @@ export function runtimeStatusPayload({
|
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
189
|
const history = responseHistoryStats();
|
|
190
|
+
const requests = metrics?.snapshot?.() || createRequestMetrics().snapshot();
|
|
191
|
+
const activityCounts = ["responses", "responses_compact", "messages"].map(route => requests.by_route[route].active);
|
|
192
|
+
activityCounts.push(imageGeneration?.active ?? 0);
|
|
193
|
+
const active = activityCounts.every(value => Number.isSafeInteger(value) && value >= 0)
|
|
194
|
+
&& Number.isSafeInteger(activityCounts.reduce((sum, value) => sum + value, 0)) ? activityCounts.reduce((sum, value) => sum + value, 0) : null;
|
|
190
195
|
return {
|
|
191
196
|
...adapterHealthPayload(),
|
|
192
197
|
uptime_ms: Math.round(process.uptime() * 1000),
|
|
@@ -197,7 +202,8 @@ export function runtimeStatusPayload({
|
|
|
197
202
|
external_bytes: memory.external,
|
|
198
203
|
array_buffers_bytes: memory.arrayBuffers,
|
|
199
204
|
},
|
|
200
|
-
requests
|
|
205
|
+
requests,
|
|
206
|
+
model_activity: { active },
|
|
201
207
|
stream_performance: streamPerformance?.snapshot?.() || null,
|
|
202
208
|
admission: admission?.diagnostics?.() || admission?.stats?.() || null,
|
|
203
209
|
response_history: history,
|
package/src/optional-routes.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export const DASHBOARD_PATHS = new Set(["/", "/ui.css", "/theme.js", "/language.js", "/refresh.js", "/status.js", "/usage.js", "/ui.js", "/console.js", "/updates.js", "/icons.js", "/tools.js"]);
|
|
1
|
+
export const DASHBOARD_PATHS = new Set(["/", "/ui.css", "/theme.js", "/language.js", "/refresh.js", "/status.js", "/activity.js", "/usage.js", "/ui.js", "/console.js", "/updates.js", "/icons.js", "/tools.js"]);
|
|
2
2
|
export const DASHBOARD_API_PATHS = new Set(["/_ccdx/ui/animation", "/_ccdx/ui/models/live", "/_ccdx/ui/usage", "/_ccdx/ui/auth", "/_ccdx/ui/providers", "/_ccdx/ui/settings", "/_ccdx/ui/m365/accounts", "/_ccdx/ui/updates", "/_ccdx/ui/account", "/_ccdx/ui/checks"]);
|
|
3
3
|
|
|
4
4
|
export function isOptionalRoute(method, pathname) {
|
|
@@ -84,6 +84,13 @@ export function isChatOutputDelta(delta) {
|
|
|
84
84
|
|| nonEmptyString(delta.reasoning_text);
|
|
85
85
|
}
|
|
86
86
|
|
|
87
|
+
export function isMessagesOutputDelta(delta) {
|
|
88
|
+
if (!delta || typeof delta !== "object") return false;
|
|
89
|
+
return delta.type === "text_delta" && nonEmptyString(delta.text)
|
|
90
|
+
|| delta.type === "thinking_delta" && nonEmptyString(delta.thinking)
|
|
91
|
+
|| delta.type === "input_json_delta" && nonEmptyString(delta.partial_json);
|
|
92
|
+
}
|
|
93
|
+
|
|
87
94
|
function createHistogram(edges) {
|
|
88
95
|
return {
|
|
89
96
|
edges,
|
package/src/terminal-colors.mjs
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
export const isColorTheme = value => value === "green" || value === "klein";
|
|
1
|
+
export const isColorTheme = value => value === "green" || value === "klein" || value === "pink";
|
|
2
2
|
|
|
3
3
|
export function terminalColorCode(theme, { output = process.stdout, env = process.env } = {}) {
|
|
4
4
|
if (output.isTTY !== true || Object.hasOwn(env, "NO_COLOR") || env.TERM === "dumb") return "";
|
|
5
5
|
// Preserve the original green exactly. Blue also supports ordinary ANSI terminals.
|
|
6
|
-
if (theme !== "klein") return "\x1b[38;2;166;245;168m";
|
|
6
|
+
if (theme !== "klein" && theme !== "pink") return "\x1b[38;2;166;245;168m";
|
|
7
7
|
const depth = output.getColorDepth?.(env) || (/truecolor|24bit/i.test(env.COLORTERM || "") ? 24 : 4);
|
|
8
|
+
if (theme === "pink") {
|
|
9
|
+
const light = /^(7|15)$/.test(String(env.COLORFGBG || "").split(";").at(-1));
|
|
10
|
+
return depth >= 24 ? light ? "\x1b[38;2;168;62;104m" : "\x1b[38;2;243;168;200m"
|
|
11
|
+
: depth >= 8 ? light ? "\x1b[38;5;132m" : "\x1b[38;5;218m" : "\x1b[95m";
|
|
12
|
+
}
|
|
8
13
|
return depth >= 24 ? "\x1b[38;2;76;159;255m" : depth >= 8 ? "\x1b[38;5;75m" : "\x1b[94m";
|
|
9
14
|
}
|
|
10
15
|
|
|
@@ -14,7 +19,7 @@ export function colorTerminalText(text, theme, options) {
|
|
|
14
19
|
}
|
|
15
20
|
|
|
16
21
|
export function colorTerminalMotion(frame, theme, options) {
|
|
17
|
-
if (theme !== "klein") return frame;
|
|
22
|
+
if (theme !== "klein" && theme !== "pink") return frame;
|
|
18
23
|
const code = terminalColorCode(theme, options);
|
|
19
24
|
return frame.replace(/\x1b\[(?:38;5;\d+|97)m/g, code);
|
|
20
25
|
}
|
package/src/terminal-console.mjs
CHANGED
|
@@ -44,14 +44,16 @@ export function createTerminalConsole({ output = process.stdout, errorOutput = p
|
|
|
44
44
|
function table(width, usage, requests, inferenceActive, sum, compactTitle = false) {
|
|
45
45
|
const left = Math.floor((width - 3) / 2), right = width - 3 - left;
|
|
46
46
|
const cell = (label, value, size) => {
|
|
47
|
-
const number = value === undefined ? "" : updatedAt === null && readFailed ? "—" : compact(value), inner = size - 2;
|
|
47
|
+
const number = value === undefined ? "" : updatedAt === null && readFailed ? "—" : typeof value === "string" ? value : compact(value), inner = size - 2;
|
|
48
48
|
const text = clip(label, Math.max(0, inner - displayWidth(number) - (number ? 1 : 0)));
|
|
49
49
|
return ` ${text}${" ".repeat(Math.max(0, inner - displayWidth(text) - displayWidth(number)))}${number} `;
|
|
50
50
|
};
|
|
51
51
|
const row = (a, b) => `│${a}│${b}│`;
|
|
52
52
|
const rule = (a, b, c) => `${a}${"─".repeat(left)}${b}${"─".repeat(right)}${c}`;
|
|
53
|
+
const rate = usage.cache_hit_rate;
|
|
54
|
+
const cacheHit = Number.isFinite(rate) && rate >= 0 && rate <= 1 ? `${usage.cache_hit_rate_partial ? "~" : ""}${(rate * 100).toFixed(1)}%` : "—";
|
|
53
55
|
const usageRows = [[left < 23 ? "Records" : "Usage records", usage.records || 0], ["Input", usage.input_tokens], [left < 23 ? "Reused" : "Reused input", usage.cached_input_tokens],
|
|
54
|
-
["Output", usage.output_tokens], ["Partial usage", usage.partial_records || 0], ["",
|
|
56
|
+
["Output", usage.output_tokens], ["Partial usage", usage.partial_records || 0], ["Cache hit", cacheHit]];
|
|
55
57
|
const requestRows = [["Requests", requests], ["Active", inferenceActive], ["Completed", sum("completed")], ["Incomplete", sum("incomplete")], ["Failed", sum("failed")], ["Cancelled", sum("cancelled")]];
|
|
56
58
|
const title = compactTitle ? [`┌─ Usage ${"─".repeat(left - 8)}┬─ Inference ${"─".repeat(right - 12)}┐`]
|
|
57
59
|
: [rule("┌", "┬", "┐"), row(cell("Usage / this run", undefined, left), cell("Inference", undefined, right)), rule("├", "┼", "┤")];
|
|
@@ -95,7 +97,7 @@ export function createTerminalConsole({ output = process.stdout, errorOutput = p
|
|
|
95
97
|
dirty = false;
|
|
96
98
|
}
|
|
97
99
|
// Apply color after clipping/layout so escape sequences never consume columns.
|
|
98
|
-
const body = [...content.map(line => current.color_theme
|
|
100
|
+
const body = [...content.map(line => ["klein", "pink"].includes(current.color_theme) && /^[┌│├└]/.test(line)
|
|
99
101
|
? colorTerminalText(line, current.color_theme, { output, env }) : line), `${motion} ${active ? "Working" : "Idle"}`];
|
|
100
102
|
fits = body.length < (Number(output.rows) || 24);
|
|
101
103
|
if (!fits) { frameDelay = 1000;return; }
|
package/src/user-settings.mjs
CHANGED
|
@@ -52,7 +52,7 @@ export function readUserSettings({ env = process.env, home = os.homedir(), stric
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
if (Object.hasOwn(parsed, "terminal_color_theme") && !isColorTheme(parsed.terminal_color_theme)) {
|
|
55
|
-
if (strict) throw invalidSettings(filePath, "terminal_color_theme must be green or
|
|
55
|
+
if (strict) throw invalidSettings(filePath, "terminal_color_theme must be green, klein or pink");
|
|
56
56
|
delete parsed.terminal_color_theme;
|
|
57
57
|
}
|
|
58
58
|
if (Object.hasOwn(parsed, AUTO_REVIEW_MODEL_KEY)) {
|
|
@@ -137,7 +137,7 @@ export function terminalColorPreference(options = {}) {
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
export function writeTerminalColorTheme(theme, options = {}) {
|
|
140
|
-
if (!isColorTheme(theme)) throw new Error("Choose green or
|
|
140
|
+
if (!isColorTheme(theme)) throw new Error("Choose green, klein or pink for the terminal color theme");
|
|
141
141
|
return withFileLockSync(`${userSettingsPath(options)}.lock`, () => {
|
|
142
142
|
const settings = readUserSettings({ ...options, strict: true });
|
|
143
143
|
const next = { ...settings };
|