codex-copilot-dx 1.2.11 → 1.2.12
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 +2 -2
- package/docs/ARCHITECTURE.md +27 -0
- package/docs/REFERENCE.md +31 -4
- package/package.json +1 -1
- package/src/dashboard/flow.js +13 -14
- package/src/dashboard/index.html +3 -3
- package/src/dashboard/language.js +6 -1
- package/src/dashboard/ui.css +33 -26
- package/src/dashboard/ui.js +1 -1
- package/src/request-application.mjs +12 -6
package/README.md
CHANGED
|
@@ -14,7 +14,7 @@ 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.12/install.sh) (macOS/Linux) or [install.ps1](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.12/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
|
|
|
@@ -25,7 +25,7 @@ Startup shows bounded checks, sources with discovered model lists and Claude Cod
|
|
|
25
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
|
-
The **Requests** view shows live app/source/model flow above the source summary and finished records. Motion follows observed output; waiting, retries, idle and expired status stay distinct. Name selections filter active details only.
|
|
28
|
+
The **Requests** view shows live app/source/model flow above the source summary and finished records. Motion follows observed output; waiting, retries, idle and expired status stay distinct. Single routes stay straight; concurrent counts sit beside names. Name selections filter active details only. Codex client hints are recognized conservatively; unknown apps stay unidentified. Codex/Claude performance includes approximate first-output P50/P95 with sample counts. CLI stays English; WebUI keeps both languages and the existing palettes. See [1.2.12 changes and verification](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/RELEASE_1.2.12.md) and the [copy inventory](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/UX_COPY.md).
|
|
29
29
|
|
|
30
30
|
## Commands
|
|
31
31
|
| Command | Purpose |
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -497,3 +497,30 @@ instructions are removed; operation scope, effect timing and privacy remain near
|
|
|
497
497
|
the relevant controls or in details. Tables retain header/interior separators;
|
|
498
498
|
the last row and following details use whitespace. Programmatic main-content
|
|
499
499
|
focus has no frame; interactive keyboard focus remains visible.
|
|
500
|
+
|
|
501
|
+
|
|
502
|
+
## Flow layout and client-hint correction (1.2.12)
|
|
503
|
+
|
|
504
|
+
`request-application.mjs` normalizes bounded scalar hints using an explicit map.
|
|
505
|
+
The map now recognizes `Codex Desktop`, observed in local desktop session metadata
|
|
506
|
+
and replayed through the bundled official app-server, as well as existing compact
|
|
507
|
+
names. A bounded, anchored, versioned Codex User-Agent is a fallback only. Generic
|
|
508
|
+
Codex evidence maps to a new `codex` family label; the existing `api` value remains
|
|
509
|
+
the unknown fallback. No raw hint is stored, and this classification does not
|
|
510
|
+
participate in routing, security, credentials or provider affinity.
|
|
511
|
+
|
|
512
|
+
Flow sources/status notes sit outside the name's layout height; both node columns
|
|
513
|
+
share the same header track. The hub shares that track offset. SVG anchors use
|
|
514
|
+
measured name-button centers, replacing fixed pixel assumptions. This keeps single
|
|
515
|
+
and shared concurrent routes straight across locale/wrapping changes. Branches
|
|
516
|
+
reuse the existing rounded-path geometry. Model counts are inline siblings of the
|
|
517
|
+
name, with reserved narrow-layout space; singleton counts and duplicate hub totals
|
|
518
|
+
are removed. Existing caps, freshness, pause/reduced-motion behavior, selection
|
|
519
|
+
scope and global summary semantics are unchanged.
|
|
520
|
+
|
|
521
|
+
The toolbar measures its longer localized on/off text with an inaccessible,
|
|
522
|
+
visually hidden grid sibling; only its visible label is localized dynamically.
|
|
523
|
+
Language controls have intrinsic width and no-wrap/no-shrink. Shared button-link
|
|
524
|
+
styling keeps the M365 navigation link semantically a link while matching the
|
|
525
|
+
existing GitHub shortcut; wording describes navigation rather than a silent check.
|
|
526
|
+
No new polling, framework, runtime dependency, setting or endpoint is introduced.
|
package/docs/REFERENCE.md
CHANGED
|
@@ -1037,7 +1037,7 @@ Unknown support prevents an explicitly requested exception from starting.
|
|
|
1037
1037
|
For an older updater that still requires Git, install the Release tarball directly:
|
|
1038
1038
|
|
|
1039
1039
|
```sh
|
|
1040
|
-
npm install -g https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.
|
|
1040
|
+
npm install -g https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.12/codex-copilot-dx-1.2.12.tgz
|
|
1041
1041
|
# Windows PowerShell: use npm.cmd instead of npm.
|
|
1042
1042
|
```
|
|
1043
1043
|
|
|
@@ -1597,9 +1597,15 @@ Claude Messages requests observed by CCDX; it excludes image-MCP, token counting
|
|
|
1597
1597
|
catalog and management calls. It groups
|
|
1598
1598
|
apps and source/model pairs; a model used through two sources stays separate.
|
|
1599
1599
|
`X-CCDX-Client` recognizes `codex-app`, `codex-cli`, `claude-app`, `claude-code`;
|
|
1600
|
-
known Codex `originator` values also provide labels
|
|
1601
|
-
|
|
1602
|
-
|
|
1600
|
+
known Codex `originator` values also provide labels, including the actual
|
|
1601
|
+
`Codex Desktop` spelling. Explicit client hints take precedence, followed by known
|
|
1602
|
+
originators, then known versioned Codex User-Agent prefixes. A generic `codex`
|
|
1603
|
+
prefix identifies only the Codex family, not App versus CLI. Unknown clients are
|
|
1604
|
+
shown as Unidentified app (the existing `api` metadata ID is retained); unmarked
|
|
1605
|
+
Messages requests remain Claude (app unspecified). These are client-reported
|
|
1606
|
+
presentation hints, never verified identities, authorization or routing inputs.
|
|
1607
|
+
Only bounded scalar strings are inspected; no User-Agent/header text is retained.
|
|
1608
|
+
An unrelated agent containing the word Codex does not match.
|
|
1603
1609
|
|
|
1604
1610
|
Only observed first output starts moving dots. A started attempt without output
|
|
1605
1611
|
is waiting, a subsequent attempt is retrying, and terminal evidence awaiting
|
|
@@ -1613,6 +1619,13 @@ details are reported. With omitted details, observed group counts use ≥; retai
|
|
|
1613
1619
|
nodes with no current detail use dashes, even while the exact total is active. Short requests between two status reads can appear only in
|
|
1614
1620
|
the finished table; the diagram does not fabricate or replay them.
|
|
1615
1621
|
|
|
1622
|
+
A single app/source-model route has aligned name/hub anchors and straight paths,
|
|
1623
|
+
even when multiple requests share that route. Branches alone use rounded curves.
|
|
1624
|
+
Known singleton and idle-zero node counts are hidden. Concurrent counts read
|
|
1625
|
+
“2 requests” beside the name and outside its selected area; lower bounds retain ≥
|
|
1626
|
+
and missing/stale counts remain dashes. The exact active total appears once in
|
|
1627
|
+
the flow header, not again below the logo.
|
|
1628
|
+
|
|
1616
1629
|
Clicking an app or model name filters only active details. Counts, source totals,
|
|
1617
1630
|
all five terminal outcomes (including unknown), last 20 finished requests and
|
|
1618
1631
|
issues remain available. No prompt/image/credential is added to active telemetry.
|
|
@@ -1624,3 +1637,17 @@ not raw samples; the highest bucket uses the observed maximum. These are the
|
|
|
1624
1637
|
upstream first-output observations already used for the mean, include failures
|
|
1625
1638
|
after partial output, and do not measure user-perceived completion or promise a
|
|
1626
1639
|
routing improvement. No samples displays a dash.
|
|
1640
|
+
|
|
1641
|
+
|
|
1642
|
+
### Account shortcuts and compact toolbar (1.2.12)
|
|
1643
|
+
|
|
1644
|
+
Checks & repairs offers equal-height GitHub account / M365 account shortcuts.
|
|
1645
|
+
Both open the corresponding model-source page; neither starts a connection check,
|
|
1646
|
+
account enumeration, login or model call. Actual checks stay on that source page.
|
|
1647
|
+
The M365 shortcut retains link semantics and the shared button appearance.
|
|
1648
|
+
|
|
1649
|
+
Auto refresh has content-based width, sized for the longer localized on/off label
|
|
1650
|
+
so toggling it does not shift nearby controls. The language control has a 40px
|
|
1651
|
+
minimum width, cannot flex-shrink and keeps 中文 / EN on one line. Compact toolbars
|
|
1652
|
+
wrap when required rather than compressing text; header position remains stable
|
|
1653
|
+
between modules in the same language and viewport.
|
package/package.json
CHANGED
package/src/dashboard/flow.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
const root = document.getElementById("request-flow");
|
|
3
3
|
if (!root) return;
|
|
4
4
|
const el = id => document.getElementById(id), ns = "http://www.w3.org/2000/svg";
|
|
5
|
-
const clients = new Set(["codex_app", "codex_cli", "claude_app", "claude_code", "claude", "api"]);
|
|
5
|
+
const clients = new Set(["codex_app", "codex_cli", "codex", "claude_app", "claude_code", "claude", "api"]);
|
|
6
6
|
const label = (node, key, values = {}) => globalThis.ccdxLanguage.set(node, key, values);
|
|
7
7
|
const format = (key, values = {}) => globalThis.ccdxLanguage.format(key, values);
|
|
8
8
|
const nodes = { apps: new Map(), models: new Map() };
|
|
@@ -35,18 +35,14 @@
|
|
|
35
35
|
if (!map.has(id)) map.set(id, { id, provider: row.provider, model: row.model, rows: [] });
|
|
36
36
|
map.get(id).rows.push(row);
|
|
37
37
|
}
|
|
38
|
-
const order = ["codex_app", "codex_cli", "claude_code", "claude_app", "claude", "api"];
|
|
38
|
+
const order = ["codex_app", "codex_cli", "codex", "claude_code", "claude_app", "claude", "api"];
|
|
39
39
|
return [...map.values()].sort((a, b) => type === "apps" ? order.indexOf(a.id) - order.indexOf(b.id) : a.id.localeCompare(b.id));
|
|
40
40
|
}
|
|
41
41
|
function project(type, groups) {
|
|
42
42
|
const target = el(type === "apps" ? "flow-apps" : "flow-models"), cache = nodes[type], fragments = [];
|
|
43
43
|
const ids = new Set(groups.map(group => group.id));
|
|
44
44
|
for (const [id, node] of cache) if (!ids.has(id)) { node.remove();cache.delete(id); }
|
|
45
|
-
let priorSource = null;
|
|
46
45
|
for (const group of groups) {
|
|
47
|
-
if (type === "models" && group.provider !== priorSource) {
|
|
48
|
-
const heading = entry("div", "flow-source");heading.textContent = sourceName(group.provider);fragments.push(heading);priorSource = group.provider;
|
|
49
|
-
}
|
|
50
46
|
let node = cache.get(group.id);
|
|
51
47
|
if (!node) {
|
|
52
48
|
node = entry("div", "flow-node");
|
|
@@ -55,17 +51,21 @@
|
|
|
55
51
|
selected = selected?.type === type && selected.id === group.id ? null : { type, id: group.id };
|
|
56
52
|
el("flow-active").open = Boolean(selected);lastSignature = "";render();
|
|
57
53
|
});
|
|
58
|
-
node.append(button, count, note);
|
|
54
|
+
node.append(button, count, note);
|
|
55
|
+
if (type === "models") node.append(entry("span", "flow-source"));
|
|
56
|
+
cache.set(group.id, node);
|
|
59
57
|
}
|
|
60
58
|
const [button, count, note] = node.children;
|
|
61
59
|
button.textContent = type === "apps" ? appName(group.id) : modelName(group.model);
|
|
62
60
|
button.setAttribute("aria-pressed", String(selected?.type === type && selected.id === group.id));
|
|
63
|
-
count.
|
|
64
|
-
|
|
61
|
+
count.hidden = fresh && omitted === 0 && group.rows.length < 2;
|
|
62
|
+
if (fresh && (group.rows.length || total === 0)) label(count, omitted ? "flow_count_lower" : "flow_count", { count: group.rows.length.toLocaleString() });
|
|
63
|
+
else count.textContent = "—";
|
|
64
|
+
if (type === "models") node.children[3].textContent = sourceName(group.provider);
|
|
65
65
|
const output = group.rows.filter(responding).length;
|
|
66
66
|
const phase = group.rows.every(row => row.terminal_outcome) ? "flow_finishing"
|
|
67
67
|
: group.rows.every(row => row.upstream_attempts > 1) ? "flow_retrying" : "flow_waiting";
|
|
68
|
-
label(note, !fresh || total && !group.rows.length ? "flow_last_observed" : !group.rows.length ? "flow_idle" : output ? "flow_group_response" : phase, { count: output });
|
|
68
|
+
label(note, !fresh || total && !group.rows.length ? "flow_last_observed" : !group.rows.length ? "flow_idle" : output ? group.rows.length === 1 ? "flow_responding" : "flow_group_response" : phase, { count: output });
|
|
69
69
|
node.dataset.related = String(!selected || group.rows.some(related));fragments.push(node);
|
|
70
70
|
}
|
|
71
71
|
// Keep existing buttons and their focus when counts or phases change.
|
|
@@ -102,7 +102,6 @@
|
|
|
102
102
|
const state = el("flow-state");
|
|
103
103
|
if (fresh && total === 0) label(state, "flow_idle");
|
|
104
104
|
else globalThis.ccdxIcons?.set(state, !fresh ? "flow_status_unknown" : "flow_total", !fresh ? "unavailable" : "running", { count: total });
|
|
105
|
-
label(el("flow-total"), fresh ? "flow_total" : "flow_last_observed", { count: total });
|
|
106
105
|
label(el("flow-caption"), !fresh ? "flow_status_unknown" : omitted ? "flow_omitted" : selected ? "flow_related_count" : total ? "flow_group_scope" : "flow_no_active",
|
|
107
106
|
{ count: rows.filter(related).length, omitted, apps: apps.length, models: allModels.length });
|
|
108
107
|
el("flow-clear").hidden = !selected;
|
|
@@ -124,9 +123,9 @@
|
|
|
124
123
|
if (!rect.width) return;
|
|
125
124
|
for (const type of ["apps", "models"]) for (const [id, node] of nodes[type]) {
|
|
126
125
|
if (!node.isConnected) continue;
|
|
127
|
-
const box = node.getBoundingClientRect(), left = type === "apps";
|
|
128
|
-
const x0 = (left ? box.right : hub.right) - rect.left + inset, y0 = (left ?
|
|
129
|
-
const x1 = (left ? hub.left : box.left) - rect.left - inset, y1 = (left ? hub.top + hub.height / 2 :
|
|
126
|
+
const box = node.getBoundingClientRect(), button = node.children[0].getBoundingClientRect(), left = type === "apps";
|
|
127
|
+
const x0 = (left ? box.right : hub.right) - rect.left + inset, y0 = (left ? button.top + button.height / 2 : hub.top + hub.height / 2) - rect.top;
|
|
128
|
+
const x1 = (left ? hub.left : box.left) - rect.left - inset, y1 = (left ? hub.top + hub.height / 2 : button.top + button.height / 2) - rect.top;
|
|
130
129
|
if (x1 <= x0) continue;
|
|
131
130
|
const matches = rows.filter(row => (left ? row.application : modelKey(row)) === id && related(row));
|
|
132
131
|
edges.push({ d: rounded(x0, y0, x1, y1), active: fresh && matches.length > 0, moving: fresh && matches.some(responding), dim: node.dataset.related === "false", x: left ? x0 : x1, y: left ? y0 : y1, left });
|
package/src/dashboard/index.html
CHANGED
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
|
|
42
42
|
<header class="topbar">
|
|
43
43
|
<div class="brand">CCDX <span class="brand-detail" data-i18n="local_status">/ DASHBOARD</span></div>
|
|
44
|
-
<div class="topbar-actions"><span id="connection" class="badge neutral" role="status" data-i18n="reading">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
|
|
44
|
+
<div class="topbar-actions"><span id="connection" class="badge neutral" role="status" data-i18n="reading">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-title="visible_status_updates_every_2_seconds_catalogs_and_retained_usa" title="Visible status updates every 2 seconds. Catalogs and retained usage refresh on demand or every 30 minutes while open."><span class="auto-refresh-measure" aria-hidden="true" data-i18n="auto_refresh_off">Auto refresh · OFF</span><span id="auto-refresh-label" data-i18n="auto_refresh_on">Auto refresh · ON</span></button><button id="refresh" type="button" data-i18n="refresh">Refresh</button></div>
|
|
45
45
|
</header>
|
|
46
46
|
|
|
47
47
|
<main id="main-content" tabindex="-1">
|
|
@@ -210,7 +210,7 @@
|
|
|
210
210
|
</section>
|
|
211
211
|
<section class="panel dashboard-section">
|
|
212
212
|
<h2 data-i18n="account_access">ACCOUNT AND ACCESS</h2>
|
|
213
|
-
<div class="section-actions"><button id="check-account-link" type="button" data-i18n="
|
|
213
|
+
<div class="section-actions"><button id="check-account-link" class="account-entry" type="button" data-i18n="github_account_entry">GitHub account</button><a class="button-link account-entry" href="#models" data-source-link="m365" data-i18n="m365_account_entry">M365 account</a></div>
|
|
214
214
|
</section>
|
|
215
215
|
<section class="panel dashboard-section">
|
|
216
216
|
<h2 data-i18n="tools_codex_connection">Codex connection</h2><p class="hint" data-i18n="tools_config_scope">Review CCDX-managed fields before repair. Other settings are preserved.</p>
|
|
@@ -262,7 +262,7 @@
|
|
|
262
262
|
<div id="flow-network" class="flow-network" role="group" data-i18n-label="request_flow" aria-label="Request flow">
|
|
263
263
|
<svg id="flow-wires" class="flow-wires" aria-hidden="true"></svg>
|
|
264
264
|
<div class="flow-column"><p class="flow-column-title" data-i18n="clients">Apps</p><div id="flow-apps" class="flow-apps"></div></div>
|
|
265
|
-
<div class="flow-hub-column"><button id="flow-hub" type="button" data-i18n-label="flow_show_all" aria-label="Show all requests"><b>CCDX</b
|
|
265
|
+
<div class="flow-hub-column"><button id="flow-hub" type="button" data-i18n-label="flow_show_all" aria-label="Show all requests"><b>CCDX</b></button></div>
|
|
266
266
|
<div class="flow-column"><p class="flow-column-title" data-i18n="flow_sources_models">Sources / models</p><div id="flow-models"></div></div>
|
|
267
267
|
</div>
|
|
268
268
|
<div class="flow-caption"><span id="flow-caption" data-i18n="flow_status_unknown">Status unavailable</span><button id="flow-clear" type="button" data-i18n="flow_show_all" hidden>Show all</button><button id="flow-more" type="button" hidden>More models</button></div>
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const translations = {
|
|
3
|
+
"github_account_entry": ["GitHub account", "GitHub 账号"],
|
|
4
|
+
"m365_account_entry": ["M365 account", "M365 账号"],
|
|
5
|
+
"flow_count": ["{count} requests", "{count} 个请求"],
|
|
6
|
+
"flow_count_lower": ["≥{count} requests", "≥{count} 个请求"],
|
|
7
|
+
"flow_app_codex": ["Codex", "Codex"],
|
|
3
8
|
"prediction_first_setup": ["Quit Codex before first setup: ccdx prediction on", "首次配置前请退出 Codex:ccdx prediction on"],
|
|
4
9
|
"image_first_setup": ["First setup: ccdx enable-image", "首次配置:ccdx enable-image"],
|
|
5
10
|
"record_scope": ["Record scope", "记录范围"],
|
|
@@ -29,7 +34,7 @@
|
|
|
29
34
|
"flow_app_claude_app": ["Claude App", "Claude App"],
|
|
30
35
|
"flow_app_claude_code": ["Claude Code", "Claude Code"],
|
|
31
36
|
"flow_app_claude": ["Claude (app unspecified)", "Claude(未区分应用)"],
|
|
32
|
-
"flow_app_api": ["
|
|
37
|
+
"flow_app_api": ["Unidentified app", "未识别应用"],
|
|
33
38
|
"flow_source_unknown": ["Source unknown", "来源未知"],
|
|
34
39
|
"flow_model_unknown": ["Model not identified", "未识别模型"],
|
|
35
40
|
"flow_responding": ["Responding", "响应中"],
|
package/src/dashboard/ui.css
CHANGED
|
@@ -14,15 +14,17 @@ html { scrollbar-gutter: stable; }
|
|
|
14
14
|
.badge::before { content: "●"; margin-right: 8px; }
|
|
15
15
|
.badge.good { color: var(--accent-soft); }
|
|
16
16
|
.badge.bad { color: var(--bad); }
|
|
17
|
-
button { border: 1px solid var(--button-border); border-radius: 2px; background: var(--button-bg); color: var(--button-fg); padding: 8px 13px; font: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; cursor: pointer; }
|
|
18
|
-
button:hover { background: var(--button-hover); }
|
|
19
|
-
button:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
|
|
17
|
+
button, .button-link { border: 1px solid var(--button-border); border-radius: 2px; background: var(--button-bg); color: var(--button-fg); padding: 8px 13px; font: inherit; font-size: 11px; font-weight: 700; text-transform: uppercase; cursor: pointer; }
|
|
18
|
+
button:hover, .button-link:hover { background: var(--button-hover); }
|
|
19
|
+
button:focus-visible, .button-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
|
|
20
|
+
.button-link { display:inline-flex;align-items:center;justify-content:center;text-decoration:none; }
|
|
21
|
+
.account-entry { text-transform:none; }
|
|
20
22
|
button:disabled { opacity: .55; cursor: default; }
|
|
21
23
|
button[aria-busy="true"] { cursor: progress; }
|
|
22
|
-
.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 6px; border: 0; background: transparent; }
|
|
24
|
+
.icon-button { display: inline-flex; flex:none; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 6px; border: 0; background: transparent; }
|
|
23
25
|
.icon-button:hover { background: transparent; color: var(--accent); }
|
|
24
26
|
.icon-button svg { width: 18px; height: 18px; }
|
|
25
|
-
.language-button { padding:
|
|
27
|
+
.language-button { width:auto; min-width:40px; padding:4px 6px; white-space:nowrap; word-break:normal; overflow-wrap:normal; line-height:1; }
|
|
26
28
|
.icon-moon, :root[data-theme="light"] .icon-sun { display: none; }
|
|
27
29
|
:root[data-theme="light"] .icon-moon { display: block; }
|
|
28
30
|
.intro { display: flex; justify-content: space-between; align-items: baseline; gap: 20px; padding: 38px 0 25px; }
|
|
@@ -187,7 +189,9 @@ footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; color:
|
|
|
187
189
|
.brand { font-size: 12px; }
|
|
188
190
|
.topbar-actions { gap: 12px; flex-wrap: nowrap; }
|
|
189
191
|
.topbar-actions #connection { width: 154px; flex: none; }
|
|
190
|
-
.topbar-actions #auto-refresh {
|
|
192
|
+
.topbar-actions #auto-refresh { display:inline-grid; flex:none; justify-self:start; white-space:nowrap; }
|
|
193
|
+
#auto-refresh span { grid-column:1; grid-row:1; }
|
|
194
|
+
#auto-refresh .auto-refresh-measure { visibility:hidden; }
|
|
191
195
|
.intro { display: block; padding: 32px 0 26px; min-height: 98px; }
|
|
192
196
|
main { align-self: start; }
|
|
193
197
|
#main-content:focus { outline: none; }
|
|
@@ -226,7 +230,7 @@ input[role="switch"]:focus-visible, input[type="number"]:focus-visible { outline
|
|
|
226
230
|
input[role="switch"]:disabled { opacity: .5; cursor: wait; }
|
|
227
231
|
#process-queues { overflow-wrap: anywhere; font-size: 11px; }
|
|
228
232
|
@media (max-width: 1100px) { .topbar .brand { display: none; } .topbar { justify-content: flex-end; } }
|
|
229
|
-
@media (max-width: 900px) { .shell { grid-template-columns: 170px minmax(0, 1fr); column-gap: 20px; padding: 0 20px; } .setting-row { grid-template-columns: minmax(0, 1fr) 44px; } .setting-row .hint { grid-column: 1 / -1; } .overview { grid-template-columns: 1fr; } .shell { grid-template-rows: 96px minmax(0, 1fr) auto; } .topbar { height: 96px; } .topbar-actions { display: grid; grid-template-columns: 32px
|
|
233
|
+
@media (max-width: 900px) { .shell { grid-template-columns: 170px minmax(0, 1fr); column-gap: 20px; padding: 0 20px; } .setting-row { grid-template-columns: minmax(0, 1fr) 44px; } .setting-row .hint { grid-column: 1 / -1; } .overview { grid-template-columns: 1fr; } .shell { grid-template-rows: 96px minmax(0, 1fr) auto; } .topbar { height: 96px; } .topbar-actions { display: grid; grid-template-columns: 32px 40px max-content max-content; justify-content:end; gap: 8px 9px; width: 100%; } .topbar-actions #connection { grid-column: 1 / -1; width: auto; } .topbar-actions #auto-refresh { width: auto; min-width: 0; padding-inline: 8px; } }
|
|
230
234
|
@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; width: fit-content; } .sidebar-brand .brand-caption { margin-top: 4px; } .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 { 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; } }
|
|
231
235
|
|
|
232
236
|
/* Keep forms aligned with the existing dashboard controls. */
|
|
@@ -234,12 +238,13 @@ input[role="switch"]:disabled { opacity: .5; cursor: wait; }
|
|
|
234
238
|
.sidebar nav .nav-child { padding-left: 28px; }
|
|
235
239
|
.section-actions > label { min-width: 0; max-width: 100%; }
|
|
236
240
|
.section-actions select { min-width: 180px; width: 100%; max-width: 320px; }
|
|
237
|
-
.section-actions input:not([type="checkbox"]), .section-actions select, .section-actions button,
|
|
241
|
+
.section-actions input:not([type="checkbox"]), .section-actions select, .section-actions button, .section-actions .button-link,
|
|
238
242
|
.analytics-controls select { box-sizing: border-box; height: 36px; min-height: 36px; line-height: normal; }
|
|
239
|
-
.section-actions button { padding-top: 0; padding-bottom: 0; }
|
|
243
|
+
.section-actions button, .section-actions .button-link { padding-top: 0; padding-bottom: 0; }
|
|
240
244
|
@media (max-width: 640px) {
|
|
241
|
-
.topbar { height: 96px; padding:
|
|
242
|
-
.topbar-actions { justify-content:
|
|
245
|
+
.topbar { height:auto; min-height:96px; padding:8px 0; }
|
|
246
|
+
.topbar-actions { display:flex; flex-wrap:wrap; justify-content:flex-start; gap:8px; }
|
|
247
|
+
.topbar-actions #connection { flex-basis:100%; }
|
|
243
248
|
.section-actions > label { flex: 1 1 180px; }
|
|
244
249
|
.section-actions select { max-width: 100%; }
|
|
245
250
|
}
|
|
@@ -402,23 +407,25 @@ input[role="switch"]:disabled { opacity: .5; cursor: wait; }
|
|
|
402
407
|
.source-account-actions { margin-top: 18px; }
|
|
403
408
|
@media(max-width:640px) { .account-summary { grid-template-columns:1fr; } }
|
|
404
409
|
|
|
405
|
-
.flow-network { position:relative;display:grid;grid-template-columns:minmax(130px,1fr)
|
|
410
|
+
.flow-network { position:relative;display:grid;grid-template-columns:minmax(130px,1fr) 70px minmax(170px,1fr);column-gap:clamp(36px,6vw,92px);align-items:stretch;min-height:236px;margin:26px 0 18px; }
|
|
406
411
|
.flow-wires { position:absolute;inset:0;width:100%;height:100%;pointer-events:none;overflow:visible; }
|
|
407
412
|
.flow-column,.flow-hub-column { position:relative;min-width:0; }
|
|
408
|
-
.flow-column
|
|
409
|
-
.flow-
|
|
410
|
-
.flow-
|
|
413
|
+
.flow-column { display:flex;flex-direction:column; }
|
|
414
|
+
.flow-column-title { height:18px;line-height:18px;margin:0 0 18px;color:var(--muted);font-size:11px;text-align:center; }
|
|
415
|
+
.flow-apps,#flow-models { display:flex;flex:1;flex-direction:column;justify-content:center;align-items:center;gap:68px;padding:32px 0;min-width:0; }
|
|
416
|
+
.flow-hub-column { display:flex;align-items:center;justify-content:center;padding-top:36px; }
|
|
417
|
+
.flow-node { position:relative;display:flex;align-items:center;gap:8px;width:max-content;max-width:100%;min-height:34px; }
|
|
418
|
+
.flow-choice { min-width:0;max-width:100%;min-height:34px;padding:7px 9px;border-color:transparent;background:transparent;color:var(--text);font-size:12px;font-weight:600;text-transform:none;text-align:center;overflow-wrap:anywhere; }
|
|
411
419
|
.flow-choice:hover { background:var(--option-hover); }
|
|
412
420
|
.flow-choice[aria-pressed="true"],.flow-choice[aria-pressed="true"]:hover { color:var(--page);background:var(--accent);border-color:var(--accent); }
|
|
413
|
-
.flow-count {
|
|
414
|
-
.flow-note {
|
|
415
|
-
.flow-source { color:var(--muted);font-size:10px;
|
|
416
|
-
.flow-source:first-child { margin-top:0; }
|
|
421
|
+
.flow-count { flex:none;color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums;white-space:nowrap; }
|
|
422
|
+
.flow-note { position:absolute;top:calc(100% + 4px);left:9px;max-width:100%;margin:0;color:var(--muted);font-size:10px; }
|
|
423
|
+
.flow-source { position:absolute;bottom:calc(100% + 9px);left:9px;color:var(--muted);font-size:10px;white-space:nowrap; }
|
|
417
424
|
.flow-node[data-related="false"] { opacity:.5; }
|
|
418
|
-
#flow-hub { display:flex;
|
|
425
|
+
#flow-hub { position:relative;display:flex;align-items:center;justify-content:center;width:40px;height:40px;border:0;background:var(--surface);color:var(--text);padding:0;text-transform:none; }
|
|
426
|
+
#flow-hub b { position:absolute;top:calc(100% + 10px);left:50%;transform:translateX(-50%); }
|
|
419
427
|
#flow-hub:hover { color:var(--accent); }
|
|
420
428
|
.flow-logo { width:34px;height:34px;color:var(--accent); }
|
|
421
|
-
#flow-hub small { font-size:10px;font-weight:400;color:var(--muted);white-space:normal; }
|
|
422
429
|
.flow-caption { display:flex;align-items:center;flex-wrap:wrap;gap:10px 16px;min-height:30px;font-size:11px;color:var(--muted); }
|
|
423
430
|
.flow-caption button { padding:5px 9px; }
|
|
424
431
|
.flow-wire { fill:none;stroke:var(--border);stroke-width:1;stroke-linecap:round;stroke-linejoin:round; }
|
|
@@ -434,14 +441,14 @@ input[role="switch"]:disabled { opacity: .5; cursor: wait; }
|
|
|
434
441
|
@media(max-width:760px) {
|
|
435
442
|
.flow-network { grid-template-columns:minmax(105px,1fr) 66px minmax(120px,1fr);column-gap:18px; }
|
|
436
443
|
.flow-choice { font-size:11px;padding-inline:4px; }
|
|
437
|
-
.flow-node {
|
|
438
|
-
.flow-
|
|
444
|
+
.flow-node { gap:4px; }
|
|
445
|
+
.flow-apps,#flow-models { gap:92px; }
|
|
446
|
+
.flow-count { position:absolute;top:calc(100% + 46px);left:0;font-size:10px; }
|
|
447
|
+
.flow-source,.flow-note { left:4px; }
|
|
439
448
|
}
|
|
440
449
|
@media(max-width:460px) {
|
|
441
450
|
.flow-network { grid-template-columns:minmax(80px,1fr) 48px minmax(100px,1fr);column-gap:12px; }
|
|
442
|
-
.flow-column-title,.flow-source,.flow-note
|
|
443
|
-
.flow-node { grid-template-columns:minmax(0,1fr) auto; }
|
|
444
|
-
.flow-count { font-size:10px; }
|
|
451
|
+
.flow-column-title,.flow-source,.flow-note { font-size:10px; }
|
|
445
452
|
.flow-logo { width:26px;height:26px; }
|
|
446
453
|
}
|
|
447
454
|
@media(prefers-reduced-motion:reduce) { .flow-packet,#request-flow[data-state="idle"] #flow-state::before { animation:none; } }
|
package/src/dashboard/ui.js
CHANGED
|
@@ -378,7 +378,7 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
|
|
|
378
378
|
const autoRefreshKey = "ccdx.dashboard.autoRefresh";
|
|
379
379
|
const updateAutoRefresh = () => {
|
|
380
380
|
element("auto-refresh").setAttribute("aria-pressed", String(dashboardRefresh.automatic));
|
|
381
|
-
text("auto-refresh", dashboardRefresh.automatic ? "auto_refresh_on" : "auto_refresh_off");
|
|
381
|
+
text("auto-refresh-label", dashboardRefresh.automatic ? "auto_refresh_on" : "auto_refresh_off");
|
|
382
382
|
};
|
|
383
383
|
let automatic = true;
|
|
384
384
|
try { automatic = localStorage.getItem(autoRefreshKey) !== "off"; } catch { /* Keep the default when browser storage is unavailable. */ }
|
|
@@ -1,13 +1,19 @@
|
|
|
1
|
-
const APPLICATIONS = new Set(["codex_app", "codex_cli", "claude_app", "claude_code", "claude", "api"]);
|
|
2
|
-
const DECLARED = new Map([["codex-app", "codex_app"], ["codex-cli", "codex_cli"], ["claude-app", "claude_app"], ["claude-code", "claude_code"]]);
|
|
3
|
-
const ORIGINATORS = new Map([["codex_desktop", "codex_app"], ["codex_app", "codex_app"], ["codex_cli_rs", "codex_cli"]]);
|
|
1
|
+
const APPLICATIONS = new Set(["codex_app", "codex_cli", "codex", "claude_app", "claude_code", "claude", "api"]);
|
|
2
|
+
const DECLARED = new Map([["codex-app", "codex_app"], ["codex-cli", "codex_cli"], ["codex", "codex"], ["claude-app", "claude_app"], ["claude-code", "claude_code"]]);
|
|
3
|
+
const ORIGINATORS = new Map([["codex desktop", "codex_app"], ["codex_desktop", "codex_app"], ["codex_app", "codex_app"], ["codex_cli_rs", "codex_cli"], ["codex_exec", "codex_cli"], ["codex-cli", "codex_cli"], ["codex", "codex"], ["codex_vscode", "codex"]]);
|
|
4
|
+
const hint = value => typeof value === "string" && value.length <= 80 ? value.trim().toLowerCase() : "";
|
|
4
5
|
|
|
5
6
|
export function requestApplication(headers = {}, fallback = "api") {
|
|
6
|
-
const declared = DECLARED.get(headers?.["x-ccdx-client"]);
|
|
7
|
+
const declared = DECLARED.get(hint(headers?.["x-ccdx-client"]));
|
|
7
8
|
if (declared) return declared;
|
|
8
9
|
// These are client-reported presentation hints, never routing or auth evidence.
|
|
9
|
-
const originator = ORIGINATORS.get(headers?.originator);
|
|
10
|
-
|
|
10
|
+
const originator = ORIGINATORS.get(hint(headers?.originator));
|
|
11
|
+
if (originator) return originator;
|
|
12
|
+
// Accept only a known, versioned Codex agent prefix, never a substring match.
|
|
13
|
+
const agent = headers?.["user-agent"];
|
|
14
|
+
const prefix = typeof agent === "string" && agent.length <= 512
|
|
15
|
+
? /^(codex desktop|codex_desktop|codex_app|codex_cli_rs|codex_exec|codex-cli|codex_vscode|codex)\/\d[\w.+-]{0,63}(?:\s|$)/i.exec(agent)?.[1] : null;
|
|
16
|
+
return ORIGINATORS.get(hint(prefix)) || (APPLICATIONS.has(fallback) ? fallback : "api");
|
|
11
17
|
}
|
|
12
18
|
|
|
13
19
|
export function applicationLabel(value) {
|