codex-copilot-dx 1.2.1 → 1.2.3
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 +4 -3
- package/bin/cli.mjs +1 -1
- package/docs/ARCHITECTURE.md +10 -0
- package/docs/REFERENCE.md +30 -7
- package/package.json +1 -1
- package/src/adapter.mjs +2 -1
- package/src/cli-m365.mjs +27 -2
- package/src/cli-options.mjs +6 -5
- package/src/dashboard/console.js +61 -5
- package/src/dashboard/index.html +64 -8
- package/src/dashboard/language.js +47 -0
- package/src/dashboard/status.js +11 -2
- package/src/dashboard/theme.js +39 -16
- package/src/dashboard/ui.css +58 -0
- package/src/dashboard/ui.js +27 -1
- package/src/dashboard-api.mjs +18 -3
- package/src/m365-settings.mjs +23 -1
- package/src/optional-routes.mjs +1 -1
- package/src/provider-management.mjs +3 -2
- package/src/provider-runtime.mjs +60 -5
- package/src/providers/m365-accounts.mjs +66 -0
- package/src/providers/m365-auth-helper.mjs +12 -10
- package/src/providers/m365-auth.mjs +13 -4
- package/src/providers/m365-conversation-accounts.mjs +42 -0
- package/src/providers/m365.mjs +19 -8
- package/src/service-control.mjs +11 -7
- package/src/startup-ui.mjs +5 -2
- package/src/terminal-colors.mjs +20 -0
- package/src/terminal-console.mjs +6 -2
- package/src/user-settings.mjs +22 -1
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.3/install.sh) (macOS/Linux) or [install.ps1](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.3/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
|
|
|
@@ -22,7 +22,7 @@ The [local control console](http://127.0.0.1:2026/) keeps indented Codex/Claude
|
|
|
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. See the [control reference](docs/REFERENCE.md#control-console-and-online-settings).
|
|
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 Klein blue. 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).
|
|
@@ -44,6 +44,7 @@ The **Requests by source** section and `ccdx status` separate request outcomes b
|
|
|
44
44
|
| `ccdx usage` | Recorded tokens and upstream prompt-cache hit rate |
|
|
45
45
|
| `ccdx usage --provider ID` | Filter current or historical source-specific usage |
|
|
46
46
|
| `ccdx m365 status` / `models` | M365 authorization, Claude gateway and Claude models |
|
|
47
|
+
| `ccdx m365 accounts` / `account` | List local company accounts or select one; `account --id ID` supports scripts |
|
|
47
48
|
| `ccdx m365 switch` | Choose the Codex source; default remains GitHub |
|
|
48
49
|
| `ccdx m365 on` / `off` / `remove` | Enable discovery, restore owned client settings, or remove owned M365 state |
|
|
49
50
|
| `ccdx auto-review-model` | Select model, then reasoning effort; `0` follows client |
|
|
@@ -60,7 +61,7 @@ The **Requests by source** section and `ccdx status` separate request outcomes b
|
|
|
60
61
|
## Microsoft 365 access
|
|
61
62
|
|
|
62
63
|
Eligible macOS/Windows machines attempt silent Microsoft authorization at startup, without Copilot CLI or a browser login. MDM alone is insufficient: account, tenant,
|
|
63
|
-
device policy and Loki entitlement must permit access. Optional failure does not block GitHub.
|
|
64
|
+
device policy and Loki entitlement must permit access. Optional failure does not block GitHub. Saved bindings stay selected; unresolved company accounts can be chosen under **Model sources → Microsoft 365** or `ccdx m365 account` in the updated running service. Listing is local; changing accounts validates only the selected account, affects M365 in Codex/Claude and requires new conversations. See the reference for identity and history limits.
|
|
64
65
|
|
|
65
66
|
Claude clients use `http://127.0.0.1:2026/anthropic` (or the configured main port), a private local gateway key and a Claude-only catalog. No second Claude listener is opened. Existing unchanged CCDX-owned 2027 addresses migrate automatically; hand-written or managed addresses are preserved and need explicit migration. The optional prediction CONNECT/PAC bridge remains a separate transport.
|
|
66
67
|
Existing custom/managed settings are preserved; already-running clients may need a normal restart.
|
package/bin/cli.mjs
CHANGED
|
@@ -452,7 +452,7 @@ try {
|
|
|
452
452
|
const terminalAnimationTheme = terminalAnimationPreference().theme;
|
|
453
453
|
terminalConsole = createTerminalConsole({ baseUrl: webUiUrl, verbose: CLI.verbose === true || CLI.showRequestId === true || LOGGING.level === "debug",
|
|
454
454
|
snapshot: () => activeServer?.ccdxSnapshot?.() || {},
|
|
455
|
-
preferences: () => { const { saved, theme } = serviceSettingsSnapshot();return { ...saved, theme }; } });
|
|
455
|
+
preferences: () => { const { saved, theme, color_theme } = serviceSettingsSnapshot();return { ...saved, theme, color_theme }; } });
|
|
456
456
|
const serviceControl = createServiceControl({ providerRuntime, clientIntegration: earlyIntegration, terminal: terminalConsole });
|
|
457
457
|
const codexModelCatalog = createCodexModelCatalog();
|
|
458
458
|
activeServer = await startAdapter(ADAPTER_PORT, ADAPTER_HOST, {
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -61,6 +61,10 @@ fields that still match its own values. Foreign gateways and managed desktop
|
|
|
61
61
|
policies are not overwritten. Removing M365 does not remove shared management,
|
|
62
62
|
GitHub auth, prediction, image configuration or historical usage.
|
|
63
63
|
|
|
64
|
+
Company-account discovery and selection are separate from token acquisition. `providers/m365-accounts.mjs` normalizes/deduplicates broker identities, excludes consumer accounts and applies saved binding → unique exact system UPN → single-company-account selection. A bounded Windows system `whoami.exe /upn` lookup runs only for unbound multiple-account discovery; failure never guesses an identity. The short-lived native helper's `accounts` operation performs no token acquisition. `provider-runtime.mjs` owns explicit account changes: admission is paused for M365, a separate candidate validates one account/catalog, then the locked binding writer commits before provider/gateway replacement. GitHub is unaffected; failed candidates are discarded. CLI and the same-origin dashboard use this composition boundary rather than invoking authentication themselves.
|
|
65
|
+
|
|
66
|
+
`providers/m365-conversation-accounts.mjs` bounds account ownership metadata to 1024 hashed conversation keys, writes only on first association, and refuses cross-account or unknown old history after account changes. Response-history transfer between M365 account namespaces is disabled. Binding metadata retains selection provenance and history isolation across restarts; it contains no token. Catalogs remain account-fingerprinted. These controls do not establish Windows enrollment, model entitlement or successful inference, and no account is tried merely because another was refused.
|
|
67
|
+
|
|
64
68
|
### Existing service composition
|
|
65
69
|
|
|
66
70
|
The CLI composes the service. Client integration owns its `configure`, `start`,
|
|
@@ -402,3 +406,9 @@ builds one npm tarball plus checksummed platform scripts/helper; the npm publish
|
|
|
402
406
|
workflow and GitHub Release must deliver those same package bytes. WebUI source
|
|
403
407
|
selection and Auto Review remain under Codex; M365 lifecycle stays in source
|
|
404
408
|
management. CLI and UI share advertised effort filtering and preference writes.
|
|
409
|
+
|
|
410
|
+
## Independent appearance settings (1.2.2)
|
|
411
|
+
|
|
412
|
+
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.
|
|
413
|
+
|
|
414
|
+
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.
|
package/docs/REFERENCE.md
CHANGED
|
@@ -13,6 +13,9 @@ or PM Studio patch. The core Codex provider remains GitHub until explicitly chan
|
|
|
13
13
|
```bash
|
|
14
14
|
ccdx m365 status
|
|
15
15
|
ccdx m365 models
|
|
16
|
+
ccdx m365 accounts
|
|
17
|
+
ccdx m365 account
|
|
18
|
+
ccdx m365 account --id aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
|
|
16
19
|
ccdx m365 switch
|
|
17
20
|
ccdx m365 switch m365 --model gpt-6-sol --auto-review-model gpt-6-sol
|
|
18
21
|
ccdx m365 switch github
|
|
@@ -37,9 +40,11 @@ short-lived Node helper. It discovers OS broker accounts and calls silent token
|
|
|
37
40
|
acquisition only. It neither launches a login UI nor reads Copilot CLI tokens.
|
|
38
41
|
macOS requires MDM enrollment and a working Microsoft Enterprise SSO broker;
|
|
39
42
|
Windows uses its Microsoft account broker. Tenant policy, device compliance,
|
|
40
|
-
account authorization and Loki entitlement still decide access.
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
account authorization and Loki entitlement still decide access. Saved bindings remain selected, including bindings created before account selection was added. Without a binding, Windows runs its system `whoami.exe /upn` once when multiple candidates exist (2.5-second limit) and accepts only a unique exact case-insensitive match with a discovered company account. It does not use the device enrollment identity, environment username, email suffix or list order. Local sign-ins, unsupported UPN lookup and shared UPNs fall back to a single company account or explicit selection. The Node broker has no explicit current-OS-account flag; a UPN match is not a SID/object-ID or device-compliance check. Entra/hybrid enterprise environments still need their own validation.
|
|
44
|
+
|
|
45
|
+
Duplicate stable account/tenant records are merged only when their identity metadata agrees. Conflicts and multiple remaining accounts require user action. Personal Microsoft consumer-tenant accounts are excluded. Windows local sign-in with an Office company account works only when the broker can discover that account; Office's sign-in UI does not prove broker visibility or model entitlement.
|
|
46
|
+
|
|
47
|
+
Use **Model sources → Microsoft 365 → Company account** or `ccdx m365 account` to choose. `ccdx m365 accounts` performs local discovery only; its opaque IDs can be passed as `ccdx m365 account --id ID`. These commands require the updated running service. Selection rediscovers accounts, rejects stale IDs, authorizes only the selected account and fetches its catalog once before committing. Failure retains the previous binding/catalog. Active M365 requests or startup work prevent selection; new M365 requests are refused during validation, while GitHub remains independent. Account changes apply to both M365 GPT and Claude; the selected Codex provider and saved model choices are not silently changed. Models missing from the new catalog require an explicit model choice. No interactive Microsoft sign-in UI is opened automatically. Interaction requirements, policy refusal or a missing native package leave M365 unavailable. None of these invalidate GitHub credentials.
|
|
43
48
|
The GitHub-selected Codex path retains its existing first-run GitHub login flow.
|
|
44
49
|
|
|
45
50
|
The optional package download is approximately 14.6 MB, contains prebuilt binaries
|
|
@@ -90,6 +95,10 @@ optional image MCP/skill/API remains separately configured and off by default.
|
|
|
90
95
|
|
|
91
96
|
### Claude gateway and client ownership
|
|
92
97
|
|
|
98
|
+
Company-account history is isolated. `conversations.json` stores at most 1024 hashes of conversation identifiers (or the first user item when no native identifier exists) and their account fingerprints; no messages, raw session IDs or tokens are stored there. Each new conversation writes its ownership once; known conversations use memory. After changing accounts, known foreign conversations are refused before forwarding. Unknown requests containing old history are also refused, including after restart; use a new conversation. Clients without stable conversation IDs can collide when their first user item is identical, so supply a unique native session ID. Evicted/unrecognized history fails closed after a switch. The history-isolation marker is saved with the binding and survives token renewal. Removing the M365 profile clears this ownership file, but never removes system sign-in or usage history.
|
|
99
|
+
|
|
100
|
+
Account selection stages the new authorization/catalog before replacing the old provider. Catalog and binding writes use the existing locked atomic writer with restoration on failure; this is not a crash/power-loss transaction. Client configuration remains a separate readiness state: its failure does not claim that account authorization failed or overwrite custom/managed fields. Previously saved model preferences are not substituted when the new account lacks those models.
|
|
101
|
+
|
|
93
102
|
Since 1.1.0, Claude mounts under the main HTTP listener at
|
|
94
103
|
`http://127.0.0.1:<ADAPTER_PORT>/anthropic` (default main port 2026).
|
|
95
104
|
It exposes `GET /anthropic/v1/models`, `POST /anthropic/v1/messages` and
|
|
@@ -787,7 +796,7 @@ not a guarantee that every browser will reuse an existing tab.
|
|
|
787
796
|
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
|
|
788
797
|
usage is excluded, missing usage stays partial, and this is not an invoice.
|
|
789
798
|
Business requests drive activity; status/catalog polling does not. Existing nine
|
|
790
|
-
animation
|
|
799
|
+
animation styles retain their timing and cycle pauses; the default green retains its original palette. `--verbose`,
|
|
791
800
|
`--show-request-id` or `CCDX_LOG_LEVEL=debug` restore detailed terminal output.
|
|
792
801
|
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
|
|
793
802
|
are coalesced. File logging retains its existing explicit opt-in and redaction.
|
|
@@ -803,7 +812,9 @@ service preferences fail closed for optional calls rather than reopening them.
|
|
|
803
812
|
|
|
804
813
|
| Control | Effective scope |
|
|
805
814
|
| --- | --- |
|
|
806
|
-
|
|
|
815
|
+
| Webpage color | Current browser, immediately; independent of the existing dark/light choice |
|
|
816
|
+
| Terminal color | Live supported status table and animation; startup logo on the next launch |
|
|
817
|
+
| Terminal animation | Live supported status terminal; plain/verbose/environment-disabled modes are reported separately |
|
|
807
818
|
| Open WebUI | Next interactive desktop start |
|
|
808
819
|
| Image calls | New local MCP calls; keeps provider credentials and allows an already-started call to finish |
|
|
809
820
|
| Prediction adaptation | Subsequent configuration traffic on an already-provisioned bridge; keeps trust/route, and App caches can remain |
|
|
@@ -827,6 +838,18 @@ auto-refresh still permits manual refresh/settings retry. No history-log scan is
|
|
|
827
838
|
performed at the status cadence. The atom moves on load/manual refresh only and
|
|
828
839
|
respects reduced motion. Client attribution absent from older records stays unknown.
|
|
829
840
|
|
|
841
|
+
### Color themes
|
|
842
|
+
|
|
843
|
+
Settings separates Web appearance and Terminal appearance. Each offers Classic green (default) and Klein blue. Green preserves the previous palette and terminal table's original text colors. Blue colors 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.
|
|
844
|
+
|
|
845
|
+
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.
|
|
846
|
+
|
|
847
|
+
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-blue fallbacks are supported; `NO_COLOR`, dumb terminals and redirected output preserve plain output. A terminal's own palette and background can affect the displayed blue.
|
|
848
|
+
|
|
849
|
+
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.
|
|
850
|
+
|
|
851
|
+
Model-list failures name the selected source, retain its last successful list when available, and distinguish that list's timestamp from the failed check. Expand Check details for the bounded public reason, source, available HTTP status and check time. A retry time is shown only when the source supplies an actual retry delay; no new retry or automatic provider failover is added. Existing diagnostic redaction and size limits remain.
|
|
852
|
+
|
|
830
853
|
### Terminal animation
|
|
831
854
|
|
|
832
855
|
Choose the terminal activity animation interactively:
|
|
@@ -971,7 +994,7 @@ Unknown support prevents an explicitly requested exception from starting.
|
|
|
971
994
|
For an older updater that still requires Git, install the Release tarball directly:
|
|
972
995
|
|
|
973
996
|
```sh
|
|
974
|
-
npm install -g https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.
|
|
997
|
+
npm install -g https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.3/codex-copilot-dx-1.2.3.tgz
|
|
975
998
|
# Windows PowerShell: use npm.cmd instead of npm.
|
|
976
999
|
```
|
|
977
1000
|
|
|
@@ -1202,7 +1225,7 @@ Client cancellations remain in verbose/file diagnostics as informational records
|
|
|
1202
1225
|
timeouts and actual failures remain notices. Non-TTY, CI, dumb and terminals under
|
|
1203
1226
|
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.
|
|
1204
1227
|
|
|
1205
|
-
Terminal appearance lives in
|
|
1228
|
+
Terminal appearance lives in Settings, with a sidebar shortcut on wide
|
|
1206
1229
|
screens. Preview frames load on opening; closing, hiding the view/page or reduced
|
|
1207
1230
|
motion stops preview timers. Saving changes the running supported status terminal.
|
|
1208
1231
|
|
package/package.json
CHANGED
package/src/adapter.mjs
CHANGED
|
@@ -169,7 +169,8 @@ export function createAdapterHandler(options = {}) {
|
|
|
169
169
|
const httpErrors = createHttpFailureDiagnostics();
|
|
170
170
|
const optionalRoutes = createOptionalRoutes({ ...options, dashboardOptions: { ...options.dashboardOptions,
|
|
171
171
|
...(options.providerRuntime ? { providerCatalogFn: input => options.providerRuntime.dashboardCatalog(input),
|
|
172
|
-
providerStateFn: () => options.providerRuntime.dashboardProviders()
|
|
172
|
+
providerStateFn: () => options.providerRuntime.dashboardProviders(),
|
|
173
|
+
providerAccountsFn: () => options.providerRuntime.action({ action: "accounts" }) } : {}) } });
|
|
173
174
|
let statusSnapshot;
|
|
174
175
|
const managementHandler = createManagementHandler({
|
|
175
176
|
nativePredictionPac: options.nativePredictionPac, fixPrediction: options.fixPrediction, requestBodyTimeoutMs,
|
package/src/cli-m365.mjs
CHANGED
|
@@ -9,6 +9,7 @@ import { terminalCell } from "./terminal-text.mjs";
|
|
|
9
9
|
import { readBoundedResponseText } from "./upstream-body.mjs";
|
|
10
10
|
import { parseAdapterAddressOptions } from "./cli-options.mjs";
|
|
11
11
|
import { autoReviewReasoningEfforts } from "./models.mjs";
|
|
12
|
+
import { m365AccountMessage } from "./providers/m365-accounts.mjs";
|
|
12
13
|
|
|
13
14
|
export async function fetchActiveProviderModels({ control = providerControl, ...options } = {}) {
|
|
14
15
|
if (readProviderSettings(options).codex !== "m365") {
|
|
@@ -35,6 +36,8 @@ export function formatM365Status(state) {
|
|
|
35
36
|
return [
|
|
36
37
|
`Microsoft 365: ${terminalCell(m.state || "not running")}${m.reason ? ` (${terminalCell(m.reason)})` : ""}`,
|
|
37
38
|
...(m.account?.login ? [`Account: ${terminalCell(m.account.login)}`] : []),
|
|
39
|
+
...(m.account?.tenant ? [`Tenant: ${terminalCell(m.account.tenant)} / ${terminalCell(m.account.selection_source || "legacy")}`] : []),
|
|
40
|
+
...(m.reason ? [m365AccountMessage(m.reason)] : []),
|
|
38
41
|
`Models: ${models.claude || 0} Claude / ${models.gpt || 0} GPT (${models.source || "unavailable"})`,
|
|
39
42
|
`Claude gateway: ${claude.gateway || "not running"}${claude.base_url ? ` / ${claude.base_url}` : ""}`,
|
|
40
43
|
...(claude.reason ? [`Claude detail: ${terminalCell(claude.reason)}`] : []),
|
|
@@ -62,14 +65,36 @@ export async function runProviderAutoReviewCommand(options = {}) {
|
|
|
62
65
|
});
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
export async function runM365Command({ action = "status", provider, model, autoReviewModel, host, port, home,
|
|
68
|
+
export async function runM365Command({ action = "status", provider, model, autoReviewModel, accountId, host, port, home,
|
|
66
69
|
env = process.env, input = process.stdin, output = process.stdout, prompt, control = providerControl } = {}) {
|
|
67
70
|
const options = { home, env };
|
|
68
71
|
let readline;
|
|
69
72
|
const ask = prompt || (question => { if (!input.isTTY || !output.isTTY) throw new Error("Choose the source and models with command arguments.");
|
|
70
73
|
readline ||= createInterface({ input, output });return readline.question(question); });
|
|
71
|
-
const request = value => control({ host, port, action: value });
|
|
74
|
+
const request = value => control({ host, port, action: value, ...(value?.action === "account" ? { timeoutMs: 65000 } : {}) });
|
|
72
75
|
try {
|
|
76
|
+
if (action === "accounts" || action === "account") {
|
|
77
|
+
const result = await request({ action: "accounts" });
|
|
78
|
+
const accounts = result.accounts || [];
|
|
79
|
+
if (!accounts.length) throw new Error("No company account found. Connect your work account in Windows or macOS, then check again.");
|
|
80
|
+
if (action === "accounts") {
|
|
81
|
+
output.write(accounts.map(value => `${terminalCell(value.login)} / ${terminalCell(value.tenant)}${value.selected ? " [selected]" : value.current_windows ? " [Windows sign-in]" : ""}\n ID: ${value.id}`).join("\n") + "\n");
|
|
82
|
+
return result;
|
|
83
|
+
}
|
|
84
|
+
if (!accountId) {
|
|
85
|
+
if (!prompt && (!input.isTTY || !output.isTTY)) throw new Error("Use ccdx m365 account --id ID from ccdx m365 accounts.");
|
|
86
|
+
output.write(accounts.map((value, index) => ` ${index + 1}. ${terminalCell(value.login)} / ${terminalCell(value.tenant)}${value.selected ? " [selected]" : value.current_windows ? " [Windows sign-in]" : ""}`).join("\n") + "\n");
|
|
87
|
+
const answer = String(await ask("Choose an account, or q to cancel: ")).trim();
|
|
88
|
+
if (answer === "q") return { cancelled: true };
|
|
89
|
+
const index = Number(answer) - 1;
|
|
90
|
+
if (!Number.isInteger(index) || !accounts[index]) throw new Error("Choose a listed account");
|
|
91
|
+
accountId = accounts[index].id;
|
|
92
|
+
}
|
|
93
|
+
if (!accounts.some(value => value.id === accountId)) throw new Error("Account list changed. Check again and select a listed account.");
|
|
94
|
+
output.write("Applies to Microsoft 365 in Codex and Claude. Use a new conversation after changing accounts.\n");
|
|
95
|
+
const state = await request({ action: "account", account_id: accountId });
|
|
96
|
+
output.write(formatM365Status(state) + "\n");return state;
|
|
97
|
+
}
|
|
73
98
|
if (action === "status") {
|
|
74
99
|
try { const state = await request();output.write(formatM365Status(state) + "\n");return state; }
|
|
75
100
|
catch (error) {
|
package/src/cli-options.mjs
CHANGED
|
@@ -159,12 +159,13 @@ export function parseCliArgs(args = []) {
|
|
|
159
159
|
if (command === "start") return parseStartOptions(rest);
|
|
160
160
|
if (command === "m365") {
|
|
161
161
|
const [action = "status", ...args] = rest;
|
|
162
|
-
if (!["status", "models", "switch", "on", "off", "remove"].includes(action)) throw new Error("
|
|
162
|
+
if (!["status", "models", "switch", "on", "off", "remove", "accounts", "account"].includes(action)) throw new Error("Choose status, models, accounts, account, switch, on, off or remove");
|
|
163
163
|
let provider, remaining = args;
|
|
164
164
|
if (action === "switch" && args[0] && !args[0].startsWith("--")) { provider = args[0];remaining = args.slice(1); }
|
|
165
165
|
if (provider && !["github", "m365"].includes(provider)) throw new Error("Choose github or m365");
|
|
166
|
-
const values = parseOptions(remaining, new Map(action === "switch" ? [["--model", "value"], ["--auto-review-model", "value"]] : []));
|
|
167
|
-
|
|
166
|
+
const values = parseOptions(remaining, new Map(action === "switch" ? [["--model", "value"], ["--auto-review-model", "value"]] : action === "account" ? [["--id", "value"]] : []));
|
|
167
|
+
if (values["--id"] && !/^[a-f0-9]{64}$/.test(values["--id"])) throw new Error("Use an account ID from ccdx m365 accounts");
|
|
168
|
+
return baseCommand("m365", { action, provider, model: values["--model"], autoReviewModel: values["--auto-review-model"], ...(values["--id"] ? { accountId: values["--id"] } : {}) });
|
|
168
169
|
}
|
|
169
170
|
if (command === "status" || command === "--status") {
|
|
170
171
|
if (rest.length) unexpectedArgs(rest);
|
|
@@ -396,7 +397,7 @@ function topicHelp(name, topic) {
|
|
|
396
397
|
"image-status": `Usage:\n ${name} image-status\n\n- Shows provider configuration and locally advertised generation/editing tools without generating an image or exposing its API key.`,
|
|
397
398
|
"auto-review-model": `Usage:\n ${name} auto-review-model\n\n- Select a Responses model, then an advertised reasoning effort.\n- Enter keeps the default/current choice; q cancels both steps without saving.\n- Effort 0 follows the client (low when omitted).\n- Settings apply only to Auto-review on the next request; no client patch or restart is required for adapters running 0.9.13 or newer.`,
|
|
398
399
|
"suggestion": `The CCDX prediction panel has been retired. Run ${name} suggestion off to safely remove unchanged CCDX registrations. This cleanup does not change native predictions; see ${name} prediction --help for that separate opt-in feature.`,
|
|
399
|
-
m365: `Usage:\n ${name} m365 [status|models|on|off|remove]\n ${name} m365 switch [github|m365] [--model ID] [--auto-review-model ID]\n\n- M365 is discovered silently at startup on supported managed environments.\n- Claude uses /anthropic on the same local port.\n- Codex stays on GitHub unless you explicitly switch.\n- M365 switching requires a running compatible adapter and available GPT/Auto-review choices; it never substitutes unavailable models.\n- Select an available model in Codex after switching an existing thread.\n- Off restores only owned Claude settings and selects GitHub.\n- Remove also clears the CCDX M365 profile, retaining a disabled preference and historical usage.\n- System Microsoft sign-in, GitHub credentials, predictions and images are preserved.`,
|
|
400
|
+
m365: `Usage:\n ${name} m365 [status|models|accounts|account|on|off|remove]\n ${name} m365 account [--id ID]\n ${name} m365 switch [github|m365] [--model ID] [--auto-review-model ID]\n\n- M365 is discovered silently at startup on supported managed environments.\n- accounts lists local company accounts without requesting tokens.\n- account chooses a company account; --id supports scripts. A running updated service is required.\n- Saved bindings stay selected. Otherwise an exact Windows sign-in match, then a single company account, is used.\n- Changing accounts applies to M365 in Codex and Claude; start a new conversation.\n- Claude uses /anthropic on the same local port.\n- Codex stays on GitHub unless you explicitly switch.\n- M365 switching requires a running compatible adapter and available GPT/Auto-review choices; it never substitutes unavailable models.\n- Select an available model in Codex after switching an existing thread.\n- Off restores only owned Claude settings and selects GitHub.\n- Remove also clears the CCDX M365 profile, retaining a disabled preference and historical usage.\n- System Microsoft sign-in, GitHub credentials, predictions and images are preserved.`,
|
|
400
401
|
prediction: `Usage:\n ${name} prediction [status|on|off|fix]\n\n- Optional native next-message predictions; off by default. macOS and Windows.\n- Windows requires the registered official MSIX App, an initialized profile, Windows PowerShell and .NET Framework 4.7.2+; Git/OpenSSL is not required for prediction setup.\n- Quit Codex before on/off, then restart ccdx.\n- On adds private App-profile certificate trust and an App-only route for chatgpt.com and ab.chatgpt.com.\n- HTTPS on those hosts is decrypted locally; only prediction configuration is changed.\n- No client program files, OS trust, account permissions, MCP or Hooks are changed.\n- Static HTTP/HTTPS/SOCKS5 proxies and bypass rules are preserved.\n- Windows supports company PAC/WPAD; macOS dynamic PAC/WPAD remains unsupported.\n- Static IPv4/IPv6 CIDRs match URL IP literals without DNS.\n- The bridge port persists across restarts/updates; a busy saved port disables only predictions.\n- Launch/reuse checks the App's actual route; an older random or missing route may require one full App quit.\n- Official prediction configuration is preserved; the conversation's model is used.\n- App updates require another compatibility check.\n- Status distinguishes saved preference and observed config traffic from unverified candidate visibility.\n- Fix asks a compatible running CCDX adapter to repair the enabled bridge once on its saved port.\n- It never enables predictions, renews certificates or force-restarts Codex.\n- Healthy unchanged bridges are retained.\n- Fix rechecks system proxy settings.\n- Changed routes may need a normal App relaunch to reload cached PAC; failed rechecks preserve the previous bridge with a nonzero exit.\n- Process environment variables and Node trust are not hot-reloaded; changed trust inputs need a CCDX service restart.\n- Startup, status and doctor share sanitized environment diagnostics.\n- Missing App routes require a normal full quit and ccdx launch; partial repair exits 1.\n- An older adapter must first be upgraded and restarted once to gain this repair endpoint.`,
|
|
401
402
|
update: `Usage:\n ${name} update [npm|github] [--allow-remote]\n\n- Updates the global package from the configured npm registry or the latest stable GitHub release.\n- With no source, an interactive terminal prompts for one.\n- Windows uses system cmd.exe to run npm.cmd without changing PowerShell policy; use the .cmd entrypoint if scripts are blocked.\n- GitHub verifies a Release tarball; Git is not required. Dependencies use the configured npm registry.\n- By default npm's remote-download policy is preserved.\n- If npm reports EALLOWREMOTE for a trusted mirror tarball, --allow-remote explicitly permits URL dependencies for this one installation's entire dependency tree; it is not a hostname allowlist.\n- No .npmrc, registry or persistent policy is changed, and failed installations are not retried automatically.\n- Use this only if company policy permits it.\n- Restart the running adapter after installation.`,
|
|
402
403
|
version: `Usage:\n ${name} --version`,
|
|
@@ -424,7 +425,7 @@ export function cliHelp(commandName = "ccdx", topic = "") {
|
|
|
424
425
|
${name} image-status
|
|
425
426
|
${name} auto-review-model
|
|
426
427
|
${name} prediction [status|on|off|fix]
|
|
427
|
-
${name} m365 [status|models|switch|on|off|remove]
|
|
428
|
+
${name} m365 [status|models|accounts|account|switch|on|off|remove]
|
|
428
429
|
${name} update [npm|github] [--allow-remote]
|
|
429
430
|
${name} --version
|
|
430
431
|
${name} --help
|
package/src/dashboard/console.js
CHANGED
|
@@ -5,6 +5,38 @@
|
|
|
5
5
|
let current = "overview", settings = null, settingsPending = false, stopped = false, timer = null, ticks = 0;
|
|
6
6
|
let sourceDirty = false, reviewDirty = false, sourceModels = [], modelsPreference = null, sourceGeneration = 0, modelsSource = null;
|
|
7
7
|
let settingsReadAt = null;
|
|
8
|
+
let accountsPending = false;
|
|
9
|
+
const accountReasons = new Set(["m365_account_ambiguous", "m365_account_unavailable", "m365_account_conflict", "m365_interaction_required", "m365_llm_permission_unavailable", "m365_account_busy", "m365_account_selection_stale"]);
|
|
10
|
+
function syncAccountControls() {
|
|
11
|
+
el("m365-accounts-refresh").disabled = accountsPending || settingsPending;
|
|
12
|
+
el("m365-account-choice").disabled = accountsPending || settingsPending;
|
|
13
|
+
el("m365-account-apply").disabled = accountsPending || settingsPending || !el("m365-account-choice").value || !settings?.providers?.m365?.enabled;
|
|
14
|
+
}
|
|
15
|
+
async function loadAccounts() {
|
|
16
|
+
if (accountsPending || settingsPending) return;
|
|
17
|
+
accountsPending = true;syncAccountControls();label(el("m365-account-note"), "checking");
|
|
18
|
+
try {
|
|
19
|
+
const response = await fetch("/_ccdx/ui/m365/accounts", { headers: { "X-CCDX-Dashboard": "1" }, cache: "no-store", signal: AbortSignal.timeout(30000) });
|
|
20
|
+
const data = await response.json();if (!response.ok || !Array.isArray(data.accounts)) throw Object.assign(new Error("Account discovery failed"), { code: data.code });
|
|
21
|
+
const previous = el("m365-account-choice").value;
|
|
22
|
+
const placeholder = document.createElement("option");placeholder.value = "";label(placeholder, "choose_company_account");
|
|
23
|
+
el("m365-account-choice").replaceChildren(placeholder, ...data.accounts.map(account => {
|
|
24
|
+
const option = document.createElement("option");option.value = account.id;
|
|
25
|
+
option.textContent = `${account.login} / ${account.tenant}`;return option;
|
|
26
|
+
}));
|
|
27
|
+
const selected = data.accounts.find(account => account.id === previous) || data.accounts.find(account => account.selected) || data.accounts.find(account => account.current_windows);
|
|
28
|
+
el("m365-account-choice").value = selected?.id || "";
|
|
29
|
+
el("m365-account-form").hidden = !data.accounts.length;
|
|
30
|
+
label(el("m365-account-note"), data.accounts.length ? "company_account_choose" : "company_account_empty");
|
|
31
|
+
} catch (error) { el("m365-account-form").hidden = true;label(el("m365-account-note"), accountReasons.has(error.code) ? error.code : "company_account_check_failed"); }
|
|
32
|
+
finally { accountsPending = false;syncAccountControls(); }
|
|
33
|
+
}
|
|
34
|
+
el("m365-accounts-refresh").addEventListener("click", () => void loadAccounts());
|
|
35
|
+
el("m365-account-choice").addEventListener("change", syncAccountControls);
|
|
36
|
+
el("m365-account-apply").addEventListener("click", () => {
|
|
37
|
+
if (settings?.providers?.m365?.account && !window.confirm(globalThis.ccdxLanguage.format("company_account_confirm"))) return;
|
|
38
|
+
void change({ action: "provider", operation: "account", account_id: el("m365-account-choice").value }, el("m365-account-apply"));
|
|
39
|
+
});
|
|
8
40
|
function navigate() {
|
|
9
41
|
const route = location.hash.slice(1), next = Object.hasOwn(titles, route) ? route : "overview";
|
|
10
42
|
current = next;
|
|
@@ -22,8 +54,8 @@
|
|
|
22
54
|
async function api(body) {
|
|
23
55
|
const response = await fetch("/_ccdx/ui/settings", { method: body ? "POST" : "GET", cache: "no-store",
|
|
24
56
|
headers: { "X-CCDX-Dashboard": "1", ...(body ? { "Content-Type": "application/json" } : {}) },
|
|
25
|
-
...(body ? { body: JSON.stringify(body) } : {}), signal: AbortSignal.timeout(15000) });
|
|
26
|
-
const data = await response.json();if (!response.ok) throw new Error(data.error || `HTTP ${response.status}`);return data;
|
|
57
|
+
...(body ? { body: JSON.stringify(body) } : {}), signal: AbortSignal.timeout(body?.operation === "account" ? 65000 : 15000) });
|
|
58
|
+
const data = await response.json();if (!response.ok) throw Object.assign(new Error(data.error || `HTTP ${response.status}`), { code: data.code });return data;
|
|
27
59
|
}
|
|
28
60
|
const states = { immediate: "effective_now", terminal_unavailable: "terminal_animation_unavailable_in_this_output_mode", next_start: "next_ccdx_start", next_call: "applies_to_new_calls", needs_setup: "setup_required",
|
|
29
61
|
next_config_request: "next_configuration_request_cached_suggestions_may_remain", needs_app_relaunch: "reopen_the_client_to_finish", needs_service_restart: "restart_ccdx_to_finish" };
|
|
@@ -62,6 +94,12 @@
|
|
|
62
94
|
window.addEventListener("ccdx:providers", () => { syncSources();if (current === "codex") void loadSourceModels(); });
|
|
63
95
|
function applySettings(data) {
|
|
64
96
|
settings = data;
|
|
97
|
+
el("terminal-color-theme").value = data.color_theme || "green";
|
|
98
|
+
el("terminal-color-theme").disabled = settingsPending;
|
|
99
|
+
el("terminal-color-sample").dataset.terminalPalette = data.color_theme || "green";
|
|
100
|
+
el("animation-settings").dataset.terminalPalette = data.color_theme || "green";
|
|
101
|
+
label(el("terminal-color-note"), data.terminal?.mode !== "status"
|
|
102
|
+
? "terminal_theme_unavailable" : "terminal_theme_applied");
|
|
65
103
|
for (const key of ["terminal_animation_enabled", "open_webui", "image_enabled", "prediction_enabled"]) {
|
|
66
104
|
const input = el(`setting-${key}`), effective = data.effective[key];
|
|
67
105
|
input.checked = data.saved[key];input.disabled = Boolean(effective.locked);
|
|
@@ -76,6 +114,11 @@
|
|
|
76
114
|
label(el("settings-note"), "settings_read_from_the_running_service");
|
|
77
115
|
el("page-settings-note").textContent = "";
|
|
78
116
|
const state = data.providers;
|
|
117
|
+
const account = state?.m365?.account;
|
|
118
|
+
if (account) label(el("m365-account-current"), "company_account_current", { login: account.login, tenant: account.tenant || "—", source: { key: `account_source_${account.selection_source || "legacy"}` } });
|
|
119
|
+
else label(el("m365-account-current"), "company_account_none");
|
|
120
|
+
if (accountReasons.has(state?.m365?.reason)) label(el("m365-account-note"), state.m365.reason);
|
|
121
|
+
syncAccountControls();
|
|
79
122
|
syncSources();
|
|
80
123
|
if (current === "codex" && state && (modelsSource !== el("source-provider").value || !sourceDirty && !reviewDirty && modelsPreference !== JSON.stringify(state[el("source-provider").value]?.preference))) void loadSourceModels();
|
|
81
124
|
el("m365-control-note").replaceChildren();
|
|
@@ -95,6 +138,8 @@
|
|
|
95
138
|
async function loadSettings() {
|
|
96
139
|
if (settingsPending) return;
|
|
97
140
|
settingsPending = true;
|
|
141
|
+
el("terminal-color-theme").disabled = true;
|
|
142
|
+
syncAccountControls();
|
|
98
143
|
try { applySettings(await api());settingsReadAt = new Date().toLocaleTimeString(); }
|
|
99
144
|
catch (error) {
|
|
100
145
|
for (const id of ["settings-note", "page-settings-note"]) {
|
|
@@ -102,12 +147,13 @@
|
|
|
102
147
|
el(id).title = error.message;
|
|
103
148
|
}
|
|
104
149
|
}
|
|
105
|
-
finally { settingsPending = false;el("apply-source").disabled = !sourceReady();syncReviewButton(); }
|
|
150
|
+
finally { settingsPending = false;el("terminal-color-theme").disabled = !settings;el("apply-source").disabled = !sourceReady();syncReviewButton();syncAccountControls(); }
|
|
106
151
|
}
|
|
107
152
|
async function change(body, button) {
|
|
108
153
|
if (settingsPending) return;
|
|
109
154
|
settingsPending = true;
|
|
110
|
-
|
|
155
|
+
syncAccountControls();
|
|
156
|
+
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")];
|
|
111
157
|
controls.forEach(input => { input.disabled = true; });
|
|
112
158
|
label(el("settings-note"), "applying");
|
|
113
159
|
if (button) button.setAttribute("aria-busy", "true");
|
|
@@ -117,14 +163,23 @@
|
|
|
117
163
|
if (body.action === "provider" && body.operation === "auto-review") reviewDirty = false;
|
|
118
164
|
if (body.action === "provider" && body.operation === "off") { sourceDirty = false;reviewDirty = false; }
|
|
119
165
|
el("review-control-note").textContent = "";
|
|
120
|
-
applySettings(data);
|
|
166
|
+
applySettings(data);
|
|
167
|
+
if (body.operation === "account") {
|
|
168
|
+
modelsPreference = null;modelsSource = null;
|
|
169
|
+
dashboardRefresh.invalidate("models", { clear: true });
|
|
170
|
+
label(el("m365-account-note"), "company_account_checked");
|
|
171
|
+
}
|
|
172
|
+
if (body.action !== "color_theme") { await dashboardRefresh.refresh("status", { force: true });await dashboardRefresh.refresh("auth", { force: true }); }
|
|
121
173
|
}
|
|
122
174
|
catch (error) {
|
|
123
175
|
if (settings) applySettings(settings);
|
|
176
|
+
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
|
+
if (body.action === "color_theme") { label(el("terminal-color-note"), "not_saved_error", { error: error.message });return; }
|
|
124
178
|
el("settings-note").textContent = error.message;el("source-control-note").textContent = error.message;el("m365-control-note").textContent = error.message;el("review-control-note").textContent = error.message;el("effect-history").textContent = error.message;
|
|
125
179
|
if (body.key) el(`effect-${body.key}`).textContent = error.message;
|
|
126
180
|
} finally {
|
|
127
181
|
settingsPending = false;controls.forEach(input => { input.disabled = false; });
|
|
182
|
+
syncAccountControls();
|
|
128
183
|
if (settings) for (const [key, value] of Object.entries(settings.effective)) if (value.locked) el(`setting-${key}`).disabled = true;
|
|
129
184
|
if (settings?.history.source === "environment") el("save-history").disabled = true;
|
|
130
185
|
el("apply-source").disabled = !sourceReady();el("source-model").disabled = !selectedSource()?.selection.models_required;syncReviewButton();
|
|
@@ -134,6 +189,7 @@
|
|
|
134
189
|
for (const input of document.querySelectorAll("[role=switch]")) input.addEventListener("change", () => {
|
|
135
190
|
void change({ action: "preference", key: input.id.slice("setting-".length), value: input.checked }, input);
|
|
136
191
|
});
|
|
192
|
+
el("terminal-color-theme").addEventListener("change", () => void change({ action: "color_theme", theme: el("terminal-color-theme").value }, el("terminal-color-theme")));
|
|
137
193
|
el("save-history").addEventListener("click", () => void change({ action: "history_limit", mib: Number(el("history-limit").value) }, el("save-history")));
|
|
138
194
|
el("clean-history").addEventListener("click", () => {
|
|
139
195
|
if (window.confirm(globalThis.ccdxLanguage.format("clear_inactive_codex_conversation_data_older_continuation_ids_ma"))) void change({ action: "history_clean" }, el("clean-history"));
|
package/src/dashboard/index.html
CHANGED
|
@@ -133,6 +133,7 @@
|
|
|
133
133
|
<div id="model-providers" class="provider-tabs" role="tablist" aria-label="Model providers" data-i18n-label="model_providers"></div>
|
|
134
134
|
<div class="section-actions"><button id="refresh-models" type="button" data-i18n="refresh">Refresh</button></div>
|
|
135
135
|
<p id="models-note" class="table-note" data-i18n="reading_provider_catalog">Loading model list…</p>
|
|
136
|
+
<details id="model-check-details" class="model-check-details" hidden><summary data-i18n="source_check_details">Check details</summary><dl id="model-check-fields" class="failure-detail"></dl><p class="hint" data-i18n="source_check_action">Use Refresh to check this source again.</p></details>
|
|
136
137
|
<div class="table-wrap"><table><thead><tr><th scope="col" data-i18n="model">MODEL</th><th scope="col" data-i18n="vendor">MODEL MAKER</th><th scope="col" data-i18n="api">CONNECTION TYPE</th><th scope="col" data-i18n="client">APP</th><th scope="col" data-i18n="reasoning">THINKING LEVEL</th><th scope="col" data-i18n="state">STATE</th></tr></thead><tbody id="live-models-body" role="tabpanel"><tr><td colspan="6" data-i18n="loading">Loading…</td></tr></tbody></table></div>
|
|
137
138
|
<p class="hint" data-i18n="catalog_listing_does_not_guarantee_inference_access">Listed does not mean your account can use it.</p>
|
|
138
139
|
</details>
|
|
@@ -141,6 +142,14 @@
|
|
|
141
142
|
<p class="hint" data-i18n="m365_source_access">Provides models for Codex and Claude on supported devices.</p>
|
|
142
143
|
<div class="section-actions"><button id="m365-on" type="button" data-i18n="enable_service">Enable source</button><button id="m365-off" type="button" data-i18n="disable_service">Disable source</button></div>
|
|
143
144
|
<div id="m365-control-note" class="hint" role="status"></div>
|
|
145
|
+
<h3 data-i18n="company_account">Company account</h3>
|
|
146
|
+
<p id="m365-account-current" class="hint" role="status"></p>
|
|
147
|
+
<div class="section-actions"><button id="m365-accounts-refresh" type="button" data-i18n="check_accounts">Check accounts</button></div>
|
|
148
|
+
<div id="m365-account-form" hidden>
|
|
149
|
+
<div class="section-actions"><label><span data-i18n="choose_company_account">Choose a company account</span><select id="m365-account-choice"></select></label><button id="m365-account-apply" type="button" disabled data-i18n="use_this_account">Use this account</button></div>
|
|
150
|
+
<p class="hint" data-i18n="company_account_scope">Applies to Microsoft 365 in Codex and Claude. Start a new conversation after changing accounts.</p>
|
|
151
|
+
</div>
|
|
152
|
+
<p id="m365-account-note" class="hint" role="status" aria-live="polite"></p>
|
|
144
153
|
</section>
|
|
145
154
|
</div>
|
|
146
155
|
<div data-view="usage" hidden>
|
|
@@ -192,20 +201,67 @@ Missing data is unknown. This panel keeps no prompts or images.</p>
|
|
|
192
201
|
</details>
|
|
193
202
|
</div>
|
|
194
203
|
<div data-view="system" hidden>
|
|
195
|
-
|
|
196
|
-
|
|
204
|
+
<section class="panel dashboard-section" aria-labelledby="web-appearance-title">
|
|
205
|
+
<h2 id="web-appearance-title" data-i18n="appearance_web_appearance">网页外观</h2>
|
|
206
|
+
<div class="appearance-row">
|
|
207
|
+
<div class="appearance-label"><label for="web-color-theme" data-i18n="appearance_color_theme">颜色主题</label><p data-i18n="appearance_browser_scope">只影响当前浏览器。</p></div>
|
|
208
|
+
<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>
|
|
209
|
+
</div>
|
|
210
|
+
<p id="web-color-note" class="appearance-note" role="status" data-i18n="theme_saved_browser">选择后,网页立即换色。</p>
|
|
211
|
+
</section>
|
|
212
|
+
|
|
213
|
+
<section class="panel dashboard-section" id="terminal-appearance" aria-labelledby="terminal-appearance-title">
|
|
214
|
+
<h2 id="terminal-appearance-title" data-i18n="terminal_appearance">终端外观</h2>
|
|
215
|
+
<div class="appearance-row">
|
|
216
|
+
<div class="appearance-label"><label for="terminal-color-theme" data-i18n="appearance_color_theme">颜色主题</label><p data-i18n="appearance_terminal_scope">与网页主题分别设置。</p></div>
|
|
217
|
+
<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>
|
|
218
|
+
</div>
|
|
219
|
+
<p id="terminal-color-note" class="appearance-note" role="status" data-i18n="appearance_terminal_effect">表格即时换色,启动 Logo 下次生效。</p>
|
|
220
|
+
|
|
221
|
+
<div id="terminal-color-sample" class="terminal-sample" data-terminal-palette="green" aria-label="Terminal color preview" data-i18n-label="terminal_color_preview">
|
|
222
|
+
<div class="terminal-caption"><span>CCDX · Terminal</span><span data-i18n="appearance_sample">Sample data</span></div>
|
|
223
|
+
<div class="terminal-brand">
|
|
224
|
+
<pre class="terminal-logo" aria-hidden="true"> ▄▀█▄ ▄█▀▄
|
|
225
|
+
█ ▄███▄ █
|
|
226
|
+
▄▀▀█▀ ▄ ▀█▀▀▄
|
|
227
|
+
▀▄▄█▄ ▀ ▄█▄▄▀
|
|
228
|
+
█ ▀███▀ █
|
|
229
|
+
▀▄█▀ ▀█▄▀ </pre>
|
|
230
|
+
<div><strong>CCDX</strong><span>by Dale Xiao</span></div>
|
|
231
|
+
</div>
|
|
232
|
+
<pre class="terminal-table terminal-wide">┌─────────────────────┬───────────────────┐
|
|
233
|
+
│ Usage / this run │ Inference │
|
|
234
|
+
├─────────────────────┼───────────────────┤
|
|
235
|
+
│ Input 1.7M │ Requests 57 │
|
|
236
|
+
│ Output 5.6K │ Active 2 │
|
|
237
|
+
└─────────────────────┴───────────────────┘</pre>
|
|
238
|
+
<pre class="terminal-table terminal-compact">┌──────────────┬──────────────┐
|
|
239
|
+
│ Usage │ Inference │
|
|
240
|
+
├──────────────┼──────────────┤
|
|
241
|
+
│ Input 1.7M │ Requests 57 │
|
|
242
|
+
│ Output 5.6K │ Active 2 │
|
|
243
|
+
└──────────────┴──────────────┘</pre>
|
|
244
|
+
<pre class="terminal-notices">0 notices / details in WebUI</pre>
|
|
245
|
+
<pre class="terminal-motion"><span id="terminal-sample-frame">[ :::::::]</span> <span id="terminal-sample-status">Working</span></pre>
|
|
246
|
+
</div>
|
|
247
|
+
|
|
248
|
+
<div class="setting-row"><label for="setting-terminal_animation_enabled" data-i18n="terminal_animation">Terminal animation</label><input id="setting-terminal_animation_enabled" type="checkbox" role="switch" disabled><span id="effect-terminal_animation_enabled" class="hint" role="status"></span></div>
|
|
249
|
+
<details id="animation-settings" class="appearance-animation settings-panel">
|
|
250
|
+
<summary class="panel-heading"><h2 data-i18n="terminal_animation_9edf6">TERMINAL ANIMATION</h2><span id="animation-state" data-i18n="reading">READING</span></summary>
|
|
251
|
+
<div id="animation-options" class="animation-options" role="group" aria-label="Animation style" data-i18n-label="animation_theme"></div>
|
|
252
|
+
<div class="section-actions"><button id="save-animation" type="button" disabled data-i18n="save_selection">Save animation</button><span id="animation-note" role="status" data-i18n="applies_to_the_running_terminal">Updates the running terminal.</span></div>
|
|
253
|
+
</details>
|
|
254
|
+
</section>
|
|
255
|
+
|
|
197
256
|
<section class="panel dashboard-section" aria-labelledby="settings-heading">
|
|
198
257
|
<h2 id="settings-heading" data-i18n="service_settings">SERVICE SETTINGS</h2>
|
|
199
258
|
<p class="hint" data-i18n="saved_preference_and_effective_state_are_separate_environment_ov">Saved choices and current behavior are shown separately. Startup overrides and required restarts are listed.</p>
|
|
200
|
-
<div class="setting-row"><label for="setting-terminal_animation_enabled" data-i18n="terminal_animation">Terminal animation</label><input id="setting-terminal_animation_enabled" type="checkbox" role="switch" disabled><span id="effect-terminal_animation_enabled" class="hint" role="status"></span></div>
|
|
201
259
|
<div class="setting-row"><label for="setting-open_webui" data-i18n="open_webui_at_startup">Open dashboard on startup</label><input id="setting-open_webui" type="checkbox" role="switch" disabled><span id="effect-open_webui" class="hint" role="status"></span></div>
|
|
202
260
|
<p id="settings-note" class="hint" role="status" data-i18n="reading_settings">Reading settings…</p>
|
|
203
261
|
</section>
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
<div class="section-actions"><button id="save-animation" type="button" disabled data-i18n="save_selection">Save animation</button><span id="animation-note" role="status" data-i18n="applies_to_the_running_terminal">Updates the running terminal.</span></div>
|
|
208
|
-
</details>
|
|
262
|
+
|
|
263
|
+
<section class="panel dashboard-section"><h2 data-i18n="process_listener">LOCAL SERVICE</h2><p id="process-state" class="table-note"></p><p id="process-memory" class="hint"></p><p id="process-queues" class="hint"></p><p id="process-notice" class="hint" role="status"></p></section>
|
|
264
|
+
<section class="overview client-overview"><article class="card"><h2 data-i18n="http_traffic">SERVICE REQUESTS</h2><strong id="requests">—</strong><p id="request-errors">—</p><p id="http-error-breakdown">—</p><p><span data-i18n="per_request_limits_active">Per-request limits</span><br><span id="body-limits">—</span></p></article></section>
|
|
209
265
|
</div>
|
|
210
266
|
</main>
|
|
211
267
|
<footer data-i18n="local_only_visible_page_updates">THIS COMPUTER ONLY / UPDATES WHILE VISIBLE</footer>
|