codex-copilot-dx 1.2.7 → 1.2.9
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 +15 -1
- package/docs/README.md +1 -0
- package/docs/REFERENCE.md +20 -15
- package/package.json +1 -1
- package/src/claude-gateway.mjs +2 -2
- package/src/dashboard/activity.js +27 -0
- package/src/dashboard/console.js +18 -7
- package/src/dashboard/index.html +80 -56
- package/src/dashboard/language.js +44 -3
- package/src/dashboard/status.js +49 -17
- package/src/dashboard/theme.js +3 -2
- package/src/dashboard/ui.css +78 -5
- package/src/dashboard/ui.js +16 -5
- 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/)
|
|
21
|
+
The [local control console](http://127.0.0.1:2026/) separates Overview, indented Codex/Claude pages, Model sources, Usage, Requests, Checks & repairs and Settings. Its sticky header stays stable across modules; page switches return to the top, while refreshes preserve scroll. Codex owns source/model, Auto Review, images, input suggestions and conversation buffering, with request performance separate from maintenance. Model sources owns accounts, catalogs and M365 access; browsing never changes routing. Claude shows each app's setup separately and labels combined Messages performance. Checks & repairs owns runtime diagnostics; Settings keeps appearance, startup and updates. Usage offers animated bars (default) or curves with scoped filters and no extra requests; reduced motion stays static. Trends load on demand. Recent requests open by default, with technical metadata folded into each row. Overview and the live terminal share an approximate token cache hit rate, preserving partial/unknown states. Overview's six activity dots share status polling; only idle has a breathing halo, failed or six-second-old evidence is unknown, and short requests can fall between snapshots. The existing 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,20 @@ 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.
|
|
436
|
+
|
|
437
|
+
## Dashboard layout and information scopes (1.2.9)
|
|
438
|
+
|
|
439
|
+
The existing CSS grid reserves explicit header/body/footer tracks; the body owns spare space from the full-height sidebar. The header uses an opaque themed sticky surface, stable action slots and a deliberate compact toolbar. Scrollbar space is stable, with an always-scroll fallback for older engines. `console.js` owns route titles/descriptions, scroll reset and main-content focus; refresh code does not navigate or reset scroll.
|
|
440
|
+
|
|
441
|
+
The eight existing views remain. `status.js` groups Overview clients by application using explicit selected-source evidence, retains all registered sources and projects separate Claude setup rows without inventing per-app Messages metrics. Account controls, catalog and access rows share the selected source in `ui.js`; source-management shortcuts browse without switching inference routes. Existing resource generations, cancellation, last-good snapshots and refresh cadence remain unchanged. Timestamps follow their own status/source/catalog/usage resources. Animation reads also check that Settings is visible.
|
|
442
|
+
|
|
443
|
+
HTML owns grouping: Codex buffer maintenance is separate from request performance, usage filters sit with the data they actually control, Requests prioritizes recent records and folds bounded technical fields into each row, and Checks & repairs owns runtime diagnostics. Settings owns preferences and updates. Request expansion is preserved by bounded request keys, and literal upstream values still use text nodes. Existing settings transactions, same-origin protections and confirmations remain in use; action failures target the affected controls. No framework, runtime dependency, endpoint, log scan, model call or installer policy is added.
|
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
|
|
|
@@ -1170,17 +1174,17 @@ once by default, using the configured main port when customized. See
|
|
|
1170
1174
|
startup preferences, output modes and effective-state rules. Assets require both
|
|
1171
1175
|
a loopback connection and loopback Host, including when the main listener uses LAN mode.
|
|
1172
1176
|
|
|
1173
|
-
The sidebar separates Overview, indented Codex/Claude Apps, Model sources, Usage, Requests, and Settings. Codex-specific images, prediction integration
|
|
1174
|
-
and conversation buffering stay under Codex. HTTP traffic counts include model
|
|
1177
|
+
The sidebar separates Overview, indented Codex/Claude Apps, Model sources, Usage, Requests, Checks & repairs, and Settings. Desktop header rows have explicit heights, the header sticks when it reaches the viewport top, and stable scrollbar space prevents horizontal movement between long and short pages. Narrow screens keep compact navigation and a two-row toolbar. Page switches reset scroll and move keyboard focus to the main content; background/manual data refreshes preserve scroll. Each page has its own purpose description, and data groups carry their own update times rather than a shared page-wide freshness claim. Codex-specific images, prediction integration
|
|
1178
|
+
and conversation buffering stay under Codex. Buffer controls and request performance have separate groups. HTTP traffic counts include model
|
|
1175
1179
|
catalogs and route errors; model outcomes and timing are named by protocol.
|
|
1176
1180
|
Microsoft 365's Claude Messages summary is not a Provider-wide request total.
|
|
1177
1181
|
|
|
1178
|
-
The
|
|
1182
|
+
The source access table uses bounded local credential metadata and Provider snapshots, showing only the selected source. Switching source tabs also changes the account controls and catalog, never application routing. Overview groups client rows by app and uses an explicitly selected source; it does not substitute a configured but unselected source when the selected source is unavailable. The source card still lists every registered source. Claude App and Claude Code have separate setup/local-service rows, while Messages performance stays combined and is labeled accordingly. A running local service does not prove the app is open.
|
|
1179
1183
|
A locally saved GitHub credential is not online entitlement. Account names with
|
|
1180
1184
|
underscores retain their exact display value; identity, keys and environment
|
|
1181
1185
|
values are not inferred from model names. Client configuration, gateway state,
|
|
1182
1186
|
recent requests and actual inference are separate observations. The top summary
|
|
1183
|
-
describes source/application status without mapping arrows. The source card counts and lists every discovered registered source, including disabled sources; availability and account evidence remain in the detailed tables. Each sidebar tab has a decorative inline SVG icon, with application entries indented. Terminal appearance has one Settings entry, and the animation selector has one separating rule.
|
|
1187
|
+
describes source/application status without mapping arrows. The source card counts and lists every discovered registered source, including disabled sources; availability and account evidence remain in the detailed tables. Each sidebar tab has a decorative inline SVG icon, with application entries indented. Terminal appearance has one Settings entry, and the animation selector has one separating rule. Settings contains webpage/terminal appearance, startup preferences and version updates. Local memory, queues, notices, raw HTTP traffic and request-size caps live under Checks & repairs → Runtime details. Account-check links identify the source and lead to its existing account tools. Save failures appear beside the affected controls; configuration repair previews and destructive-action confirmations remain in place.
|
|
1184
1188
|
|
|
1185
1189
|
Catalog tabs browse registered Provider directories without changing routing.
|
|
1186
1190
|
Rows retain protocol, eligible clients, reasoning metadata and directory state.
|
|
@@ -1206,6 +1210,8 @@ The separate current-run summary updates from returned usage in memory, without
|
|
|
1206
1210
|
rescanning retained logs at the status cadence.
|
|
1207
1211
|
Overview adds an approximate token cache hit rate: returned reused input tokens divided by returned input tokens, weighted by tokens rather than request percentages. Missing evidence is distinct from an explicit zero; all-unknown cache evidence, zero input and invalid counts display `—`. Mixed complete/incomplete cache evidence displays `~` before the recorded aggregate ratio. This describes recorded input reuse, not a request success ratio, invoice or whole-account cache statistic. Missing output alone does not invalidate usable input/cache evidence.
|
|
1208
1212
|
|
|
1213
|
+
The usage source selector applies to the whole page. Model selection controls both daily trends and the calendar; 7/30/90-day range and bar/line view belong to daily trends, and request/Token measure belongs to the fixed annual calendar. These controls do not redefine the all-history model table; selecting a known day narrows the table and Show all restores retained-history totals.
|
|
1214
|
+
|
|
1209
1215
|
Usage analytics remains collapsed until opened: 7/30/90-day charts and a bounded
|
|
1210
1216
|
365-day calendar in the browser time zone. Model/range/day selection reuses its
|
|
1211
1217
|
snapshot. Days outside retained history are distinct from zero recorded activity.
|
|
@@ -1243,8 +1249,7 @@ Client cancellations remain in verbose/file diagnostics as informational records
|
|
|
1243
1249
|
timeouts and actual failures remain notices. Non-TTY, CI, dumb and terminals under
|
|
1244
1250
|
40 columns or 16 rows retain plain output. At 40×16 the compact table keeps all metrics and short source/Code/App states. Larger terminals wrap full state descriptions. No runtime terminal dependency is added.
|
|
1245
1251
|
|
|
1246
|
-
Terminal appearance lives in Settings,
|
|
1247
|
-
screens. Preview frames load on opening; closing, hiding the view/page or reduced
|
|
1252
|
+
Terminal appearance lives only in Settings. Preview frames load on opening; closing, hiding the view/page or reduced
|
|
1248
1253
|
motion stops preview timers. Saving changes the running supported status terminal.
|
|
1249
1254
|
|
|
1250
1255
|
The recent-failure view merges bounded Responses events, main-listener HTTP
|
|
@@ -1330,13 +1335,13 @@ ccdx --show-request-id
|
|
|
1330
1335
|
|
|
1331
1336
|
### Authentication recovery
|
|
1332
1337
|
|
|
1333
|
-
The dashboard's
|
|
1334
|
-
status snapshot. It shows at most 20 finished request observations: serialized
|
|
1338
|
+
The dashboard's **RECENT REQUESTS** section opens by default and reuses the same
|
|
1339
|
+
status snapshot. It shows at most 20 finished request observations: time, source, model, outcome and returned input tokens, with serialized
|
|
1335
1340
|
upstream payload bytes, image count, reported input tokens, the advertised model
|
|
1336
1341
|
window and terminal outcome, plus process-local compaction outcome counts. Missing
|
|
1337
1342
|
fields are unknown, not zero; input/window is a reference ratio, not an exact live
|
|
1338
1343
|
session measurement. No prompts, image bytes, files, tool results or extra session
|
|
1339
|
-
scan are retained.
|
|
1344
|
+
scan are retained. Technical fields are folded into each row. Expanded fields survive unchanged reads and retained matching request observations; closed/hidden request groups defer row rebuilding without another API call.
|
|
1340
1345
|
|
|
1341
1346
|
When the saved token is missing, `ccdx` looks for compatible local Copilot GitHub tokens, validates them with GitHub and Copilot, and imports a valid one before starting Device Flow. It checks explicit token sources (`CCDX_GITHUB_TOKEN`, `CCDX_GITHUB_TOKEN_PATH`, and `CCDX_GITHUB_TOKEN_PATHS`) plus common local `auth.json` layouts. Generic discovery refuses to choose silently when valid credentials for multiple GitHub accounts are found.
|
|
1342
1347
|
|
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
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
const el = id => document.getElementById(id);
|
|
3
3
|
const label = (node, key, values = {}) => globalThis.ccdxLanguage.set(node, key, values);
|
|
4
4
|
const titles = { overview: "overview", codex: "Codex", claude: "Claude", models: "model_services", usage: "usage_and_diagnostics", requests: "request_records", checks: "tools_checks_title", system: "system_and_settings" };
|
|
5
|
+
const descriptions = { overview: "page_overview_description", codex: "page_codex_description", claude: "page_claude_description", models: "page_models_description", usage: "page_usage_description", requests: "page_requests_description", checks: "page_checks_description", system: "page_settings_description" };
|
|
6
|
+
const settingsViews = ["codex", "models", "system", "checks"];
|
|
5
7
|
let current = "overview", settings = null, settingsPending = false, stopped = false, timer = null, ticks = 0;
|
|
6
8
|
let sourceDirty = false, reviewDirty = false, sourceModels = [], modelsPreference = null, sourceGeneration = 0, modelsSource = null;
|
|
7
9
|
let settingsReadAt = null;
|
|
@@ -41,13 +43,19 @@
|
|
|
41
43
|
const route = location.hash.slice(1), next = Object.hasOwn(titles, route) ? route : "overview";
|
|
42
44
|
current = next;
|
|
43
45
|
for (const view of document.querySelectorAll("[data-view]")) view.hidden = view.dataset.view !== next;
|
|
46
|
+
globalThis.ccdxDashboardActivity?.visibilityChanged();
|
|
44
47
|
for (const item of document.querySelectorAll("[data-route]")) {
|
|
45
48
|
if (item.dataset.route === next) item.setAttribute("aria-current", "page");else item.removeAttribute("aria-current");
|
|
46
49
|
}
|
|
47
50
|
label(el("page-title"), titles[next]);
|
|
48
|
-
|
|
51
|
+
label(el("page-description"), descriptions[next]);
|
|
52
|
+
el("page-settings-note").textContent = "";
|
|
53
|
+
window.scrollTo(0, 0);
|
|
54
|
+
el("main-content").focus({ preventScroll: true });
|
|
55
|
+
if (settingsViews.includes(next)) void loadSettings();
|
|
49
56
|
if (next === "models") { void dashboardRefresh.refresh("models");void dashboardRefresh.refresh("auth"); }
|
|
50
57
|
if (next === "usage") { void dashboardRefresh.refresh("usage");usageView.revealChart(); } else usageView.stopMotion();
|
|
58
|
+
if (next === "requests") renderContext();
|
|
51
59
|
if (next === "system") { void dashboardRefresh.refresh("animation");void dashboardRefresh.refresh("updates"); }
|
|
52
60
|
syncAnimationPreview();
|
|
53
61
|
}
|
|
@@ -142,7 +150,7 @@
|
|
|
142
150
|
syncAccountControls();
|
|
143
151
|
try { applySettings(await api());settingsReadAt = new Date().toLocaleTimeString(); }
|
|
144
152
|
catch (error) {
|
|
145
|
-
for (const id of ["settings-note", "page-settings-note"]) {
|
|
153
|
+
for (const id of ["settings-note", ...(settingsViews.includes(current) ? ["page-settings-note"] : [])]) {
|
|
146
154
|
label(el(id), settingsReadAt ? "showing_previous_data_updated_time" : "could_not_read_settings", { time: settingsReadAt });
|
|
147
155
|
el(id).title = error.message;
|
|
148
156
|
}
|
|
@@ -155,7 +163,11 @@
|
|
|
155
163
|
syncAccountControls();
|
|
156
164
|
const controls = [...document.querySelectorAll("[role=switch], #save-history, #clean-history, #fix-prediction, #apply-source, #save-review, #source-provider, #source-model, #source-review, #source-review-effort, #terminal-color-theme, #m365-on, #m365-off")];
|
|
157
165
|
controls.forEach(input => { input.disabled = true; });
|
|
158
|
-
|
|
166
|
+
const note = el(body.key ? `effect-${body.key}` : body.action === "color_theme" ? "terminal-color-note"
|
|
167
|
+
: body.action.startsWith("history_") ? "effect-history" : body.action === "prediction_fix" ? "prediction-note"
|
|
168
|
+
: body.operation === "switch" ? "source-control-note" : body.operation === "auto-review" ? "review-control-note"
|
|
169
|
+
: body.operation === "account" ? "m365-account-note" : "m365-control-note");
|
|
170
|
+
label(note, "applying");
|
|
159
171
|
if (button) button.setAttribute("aria-busy", "true");
|
|
160
172
|
try {
|
|
161
173
|
const data = await api(body);
|
|
@@ -175,8 +187,7 @@
|
|
|
175
187
|
if (settings) applySettings(settings);
|
|
176
188
|
if (body.operation === "account") { label(el("m365-account-note"), "company_account_not_saved", { reason: { key: accountReasons.has(error.code) ? error.code : error.message } });return; }
|
|
177
189
|
if (body.action === "color_theme") { label(el("terminal-color-note"), "not_saved_error", { error: error.message });return; }
|
|
178
|
-
|
|
179
|
-
if (body.key) el(`effect-${body.key}`).textContent = error.message;
|
|
190
|
+
note.textContent = error.message;
|
|
180
191
|
} finally {
|
|
181
192
|
settingsPending = false;controls.forEach(input => { input.disabled = false; });
|
|
182
193
|
syncAccountControls();
|
|
@@ -256,14 +267,14 @@
|
|
|
256
267
|
await dashboardRefresh.refresh("status", { force: true });
|
|
257
268
|
if (++ticks % 8 === 0) {
|
|
258
269
|
await dashboardRefresh.refresh("auth", { force: true });
|
|
259
|
-
if (
|
|
270
|
+
if (settingsViews.includes(current)) await loadSettings();
|
|
260
271
|
}
|
|
261
272
|
}
|
|
262
273
|
schedule();
|
|
263
274
|
}, 2000);
|
|
264
275
|
}
|
|
265
276
|
window.addEventListener("hashchange", navigate);
|
|
266
|
-
el("refresh").addEventListener("click", () => { if (
|
|
277
|
+
el("refresh").addEventListener("click", () => { if (settingsViews.includes(current)) void loadSettings(); });
|
|
267
278
|
window.addEventListener("pagehide", () => { stopped = true;clearTimeout(timer); });
|
|
268
279
|
window.addEventListener("pageshow", () => { stopped = false;schedule(); });
|
|
269
280
|
navigate();schedule();
|