codex-copilot-dx 1.2.2 → 1.2.4
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/docs/ARCHITECTURE.md +6 -0
- package/docs/README.md +2 -0
- package/docs/REFERENCE.md +24 -5
- 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 +50 -5
- package/src/dashboard/index.html +31 -9
- package/src/dashboard/language.js +47 -0
- package/src/dashboard/status.js +5 -6
- package/src/dashboard/ui.css +20 -4
- package/src/dashboard/ui.js +10 -9
- package/src/dashboard/updates.js +73 -0
- package/src/dashboard-api.mjs +21 -1
- package/src/dashboard-updates.mjs +71 -0
- package/src/dashboard.mjs +1 -0
- package/src/m365-settings.mjs +23 -1
- package/src/optional-routes.mjs +2 -2
- 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 +5 -3
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.4/install.sh) (macOS/Linux) or [install.ps1](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.4/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
|
|
|
@@ -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.
|
|
@@ -109,7 +110,7 @@ See the [M365 reference](docs/REFERENCE.md#microsoft-365-provider) for ownership
|
|
|
109
110
|
expose it to the public internet. The dashboard is not an authentication wall
|
|
110
111
|
for the API. Inference rejects browser Origin headers; native clients remain supported. Diagnostic errors may contain sensitive upstream text.
|
|
111
112
|
|
|
112
|
-
Startup checks GitHub's latest-release web redirect, not npm or the anonymous REST quota, and suggests `ccdx update github`.
|
|
113
|
+
Startup checks GitHub's latest-release web redirect, not npm or the anonymous REST quota, and suggests `ccdx update github`. Settings → Version & updates shows the running version, release dates and newer releases, with copyable update and macOS/Windows recovery commands. This separate, cached GitHub metadata check never installs automatically; failed checks remain unknown. See the [reference](docs/REFERENCE.md#version-and-update-information).
|
|
113
114
|
GitHub updates verify and install the exact Release tarball without Git; dependencies still use npm's configured registry. Lookup errors identify HTTP refusal, timeout, network failure or invalid redirects. For npm `EALLOWREMOTE`, only if policy permits and the update is trusted, use `ccdx update github --allow-remote`: explicit URL-download permission for that installation's whole dependency tree, not a hostname allowlist. Persistent npm settings stay unchanged.
|
|
114
115
|
Updates back up the discovered CCDX package and commands, restore them on install/runtime-check failure, and verify the installed version (exact for GitHub). Mismatched npm targets warn without changing PATH/prefix. Restart the adapter separately. Full `ccdx doctor` reports this target and readonly credential permissions; it never changes ACLs.
|
|
115
116
|
Recent errors separate HTTP and model failures. By default HTTP metadata retains status, source and IDs, not error bodies or prompts; original errors still reach Codex unchanged. Explicit, bounded error-excerpt collection is described in the [reference](docs/REFERENCE.md#http-error-diagnostics).
|
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`,
|
|
@@ -273,6 +277,8 @@ while visible/automatic, and source/settings evidence every eight status ticks.
|
|
|
273
277
|
Catalog and retained-log reads retain their slower, view-scoped policy. Animation
|
|
274
278
|
frames still load once per page when opened.
|
|
275
279
|
|
|
280
|
+
`dashboard-updates.mjs` is loaded only by the protected update-information route. It projects bounded public stable-release metadata and publication dates, with process-local single-flight, five-minute success and one-minute failure caches. Its asynchronous npm network-configuration read reuses the installer's existing policy-preserving downloader; it adds no runtime dependency, credentials or synchronous child process on the service event loop. Metadata has a four-second per-request deadline and 128 KiB decoded-body bound. It never installs or restarts anything and does not alter startup's independent web-redirect lookup. `dashboard/updates.js` renders current/available/unknown states and validated, pinned installation command text; `refresh.js` owns its visible Settings refresh cadence. Failed checks preserve explicitly labeled prior metadata. No provider authentication or inference is involved.
|
|
281
|
+
|
|
276
282
|
`claude-models.mjs` owns exact ID spelling and capability-cap projection shared by
|
|
277
283
|
configuration and model discovery. M365 resolves both canonical and existing raw
|
|
278
284
|
IDs to the same catalog entry and checks explicit effort lists without modifying
|
package/docs/README.md
CHANGED
|
@@ -17,6 +17,8 @@ effective Codex configuration or validate every field against the installed app.
|
|
|
17
17
|
|
|
18
18
|
## Historical release evidence
|
|
19
19
|
|
|
20
|
+
- [1.2.4: Navigation clarity and bounded version discovery](RELEASE_1.2.4.md)
|
|
21
|
+
|
|
20
22
|
These reports record a specific release and test environment. Their version,
|
|
21
23
|
test counts, timings, live-provider observations, and limitations remain
|
|
22
24
|
historical facts rather than current guarantees.
|
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
|
|
@@ -839,6 +848,16 @@ Terminal color uses `terminal_color_theme: "klein"` in the normal CCDX user conf
|
|
|
839
848
|
|
|
840
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.
|
|
841
850
|
|
|
851
|
+
### Version and update information
|
|
852
|
+
|
|
853
|
+
Settings ends with Version & updates. The current version belongs to the running service, which can differ from a newly installed package until CCDX restarts. Dates are GitHub Release publication dates, not local installation dates; an unavailable date is explicitly unknown. A verified newer stable release shows its version/date and `ccdx update github`. Copying a command never executes it. No background installation or service restart is added.
|
|
854
|
+
|
|
855
|
+
Opening Settings reads `GET /_ccdx/ui/updates`, protected by the existing loopback/Host/dashboard-header checks. It reads public GitHub REST release metadata without credentials, accepting stable, non-draft releases only. The first successful check needs at most two serial metadata requests: latest, and the exact current tag when different. The current publication date is retained in memory. Concurrent reads share one lookup; successful results are cached for five minutes and failures for one minute. The page reuses the visible-view 30-minute refresh controller, so the two-second status timer never polls GitHub. Manual checks also respect the service cache. Network configuration discovery is asynchronous and reads only npm's named proxy/CA/TLS/offline settings; no registry or policy is rewritten. Each metadata request has a four-second deadline and a 128 KiB decoded-body limit, with no automatic retry.
|
|
856
|
+
|
|
857
|
+
Failed/rate-limited checks never claim that the installed version is latest. Last-known release details remain labeled as such, separate from the latest check attempt. A failed current-tag date lookup does not hide an otherwise verified available update. The startup web-redirect check remains unchanged and independent of this REST check. If npm/network settings cannot be read or company policy blocks GitHub, the version card reports the check as unavailable.
|
|
858
|
+
|
|
859
|
+
Expand the recovery instructions to choose macOS Terminal or Windows PowerShell. Commands download the version-pinned Release installer into a unique temporary directory and remove that directory afterward. They use the newer of the running version and last-known stable release, falling back to the running version if no release is known; stale metadata cannot select a downgrade. Installers retain the documented no-Git, minimum-runtime, rollback and configured-registry behavior. Windows instructions keep the current execution policy; if company policy blocks scripts, use its approved installation method. Dependencies still require the configured npm registry.
|
|
860
|
+
|
|
842
861
|
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.
|
|
843
862
|
|
|
844
863
|
### Terminal animation
|
|
@@ -985,7 +1004,7 @@ Unknown support prevents an explicitly requested exception from starting.
|
|
|
985
1004
|
For an older updater that still requires Git, install the Release tarball directly:
|
|
986
1005
|
|
|
987
1006
|
```sh
|
|
988
|
-
npm install -g https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.
|
|
1007
|
+
npm install -g https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.2.4/codex-copilot-dx-1.2.4.tgz
|
|
989
1008
|
# Windows PowerShell: use npm.cmd instead of npm.
|
|
990
1009
|
```
|
|
991
1010
|
|
|
@@ -1157,7 +1176,7 @@ A locally saved GitHub credential is not online entitlement. Account names with
|
|
|
1157
1176
|
underscores retain their exact display value; identity, keys and environment
|
|
1158
1177
|
values are not inferred from model names. Client configuration, gateway state,
|
|
1159
1178
|
recent requests and actual inference are separate observations. The top summary
|
|
1160
|
-
|
|
1179
|
+
describes source/application status without mapping arrows. The source card counts and lists every discovered registered source, including disabled sources; availability and account evidence remain in the detailed tables. Each sidebar tab has a decorative inline SVG icon, with application entries indented. Terminal appearance has one Settings entry, and the animation selector has one separating rule.
|
|
1161
1180
|
|
|
1162
1181
|
Catalog tabs browse registered Provider directories without changing routing.
|
|
1163
1182
|
Rows retain protocol, eligible clients, reasoning metadata and directory state.
|
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;
|
|
@@ -16,14 +48,14 @@
|
|
|
16
48
|
if (["codex", "models", "system"].includes(next)) void loadSettings();
|
|
17
49
|
if (next === "models") { void dashboardRefresh.refresh("models");void dashboardRefresh.refresh("auth"); }
|
|
18
50
|
if (next === "usage") void dashboardRefresh.refresh("usage");
|
|
19
|
-
if (next === "system") void dashboardRefresh.refresh("animation");
|
|
51
|
+
if (next === "system") { void dashboardRefresh.refresh("animation");void dashboardRefresh.refresh("updates"); }
|
|
20
52
|
syncAnimationPreview();
|
|
21
53
|
}
|
|
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" };
|
|
@@ -82,6 +114,11 @@
|
|
|
82
114
|
label(el("settings-note"), "settings_read_from_the_running_service");
|
|
83
115
|
el("page-settings-note").textContent = "";
|
|
84
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();
|
|
85
122
|
syncSources();
|
|
86
123
|
if (current === "codex" && state && (modelsSource !== el("source-provider").value || !sourceDirty && !reviewDirty && modelsPreference !== JSON.stringify(state[el("source-provider").value]?.preference))) void loadSourceModels();
|
|
87
124
|
el("m365-control-note").replaceChildren();
|
|
@@ -102,6 +139,7 @@
|
|
|
102
139
|
if (settingsPending) return;
|
|
103
140
|
settingsPending = true;
|
|
104
141
|
el("terminal-color-theme").disabled = true;
|
|
142
|
+
syncAccountControls();
|
|
105
143
|
try { applySettings(await api());settingsReadAt = new Date().toLocaleTimeString(); }
|
|
106
144
|
catch (error) {
|
|
107
145
|
for (const id of ["settings-note", "page-settings-note"]) {
|
|
@@ -109,11 +147,12 @@
|
|
|
109
147
|
el(id).title = error.message;
|
|
110
148
|
}
|
|
111
149
|
}
|
|
112
|
-
finally { settingsPending = false;el("terminal-color-theme").disabled = !settings;el("apply-source").disabled = !sourceReady();syncReviewButton(); }
|
|
150
|
+
finally { settingsPending = false;el("terminal-color-theme").disabled = !settings;el("apply-source").disabled = !sourceReady();syncReviewButton();syncAccountControls(); }
|
|
113
151
|
}
|
|
114
152
|
async function change(body, button) {
|
|
115
153
|
if (settingsPending) return;
|
|
116
154
|
settingsPending = true;
|
|
155
|
+
syncAccountControls();
|
|
117
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")];
|
|
118
157
|
controls.forEach(input => { input.disabled = true; });
|
|
119
158
|
label(el("settings-note"), "applying");
|
|
@@ -125,15 +164,22 @@
|
|
|
125
164
|
if (body.action === "provider" && body.operation === "off") { sourceDirty = false;reviewDirty = false; }
|
|
126
165
|
el("review-control-note").textContent = "";
|
|
127
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
|
+
}
|
|
128
172
|
if (body.action !== "color_theme") { await dashboardRefresh.refresh("status", { force: true });await dashboardRefresh.refresh("auth", { force: true }); }
|
|
129
173
|
}
|
|
130
174
|
catch (error) {
|
|
131
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; }
|
|
132
177
|
if (body.action === "color_theme") { label(el("terminal-color-note"), "not_saved_error", { error: error.message });return; }
|
|
133
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;
|
|
134
179
|
if (body.key) el(`effect-${body.key}`).textContent = error.message;
|
|
135
180
|
} finally {
|
|
136
181
|
settingsPending = false;controls.forEach(input => { input.disabled = false; });
|
|
182
|
+
syncAccountControls();
|
|
137
183
|
if (settings) for (const [key, value] of Object.entries(settings.effective)) if (value.locked) el(`setting-${key}`).disabled = true;
|
|
138
184
|
if (settings?.history.source === "environment") el("save-history").disabled = true;
|
|
139
185
|
el("apply-source").disabled = !sourceReady();el("source-model").disabled = !selectedSource()?.selection.models_required;syncReviewButton();
|
|
@@ -220,6 +266,5 @@
|
|
|
220
266
|
el("refresh").addEventListener("click", () => { if (["codex", "models", "system"].includes(current)) void loadSettings(); });
|
|
221
267
|
window.addEventListener("pagehide", () => { stopped = true;clearTimeout(timer); });
|
|
222
268
|
window.addEventListener("pageshow", () => { stopped = false;schedule(); });
|
|
223
|
-
el("open-animation").addEventListener("click", () => { location.hash = "system";navigate(); });
|
|
224
269
|
navigate();schedule();
|
|
225
270
|
})();
|
package/src/dashboard/index.html
CHANGED
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
<script src="/refresh.js" defer></script>
|
|
12
12
|
<script src="/status.js" defer></script>
|
|
13
13
|
<script src="/usage.js" defer></script>
|
|
14
|
+
<script src="/updates.js" defer></script>
|
|
14
15
|
<script src="/ui.js" defer></script>
|
|
15
16
|
<script src="/console.js" defer></script>
|
|
16
17
|
<title data-i18n="ccdx_local_dashboard">CCDX · Dashboard</title>
|
|
@@ -20,16 +21,15 @@
|
|
|
20
21
|
<aside class="sidebar">
|
|
21
22
|
<a class="sidebar-brand" href="#overview"><svg id="status-icon" class="status-icon" viewBox="0 0 64 64" aria-hidden="true" focusable="false"><g fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round"><ellipse cx="32" cy="32" rx="26" ry="10"/><ellipse cx="32" cy="32" rx="26" ry="10" transform="rotate(60 32 32)"/><ellipse cx="32" cy="32" rx="26" ry="10" transform="rotate(120 32 32)"/></g><circle cx="32" cy="32" r="4.5" fill="currentColor"/></svg><span class="brand-name">CCDX</span><span class="brand-caption" data-i18n="local_control">LOCAL CONTROL</span></a>
|
|
22
23
|
<nav aria-label="Navigation" data-i18n-label="main_navigation">
|
|
23
|
-
<a href="#overview" data-route="overview" aria-current="page" data-i18n="overview">Overview</a>
|
|
24
|
+
<a href="#overview" data-route="overview" aria-current="page"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="3" y="3" width="7" height="7" rx="1"/><rect x="14" y="3" width="7" height="7" rx="1"/><rect x="3" y="14" width="7" height="7" rx="1"/><rect x="14" y="14" width="7" height="7" rx="1"/></svg><span data-i18n="overview">Overview</span></a>
|
|
24
25
|
<span class="nav-group" data-i18n="clients">Apps</span>
|
|
25
|
-
<a class="nav-child" href="#codex" data-route="codex">Codex</a>
|
|
26
|
-
<a class="nav-child" href="#claude" data-route="claude">Claude</a>
|
|
27
|
-
<a href="#models" data-route="models" data-i18n="model_services">Model sources</a>
|
|
28
|
-
<a href="#usage" data-route="usage" data-i18n="usage_and_diagnostics">Usage</a>
|
|
29
|
-
<a href="#requests" data-route="requests" data-i18n="request_records">Requests</a>
|
|
30
|
-
<a href="#system" data-route="system" data-i18n="system_and_settings">Settings</a>
|
|
26
|
+
<a class="nav-child" href="#codex" data-route="codex"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="m7 8 4 4-4 4m7 0h3"/></svg><span>Codex</span></a>
|
|
27
|
+
<a class="nav-child" href="#claude" data-route="claude"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M21 15a3 3 0 0 1-3 3H8l-5 3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3Z"/></svg><span>Claude</span></a>
|
|
28
|
+
<a href="#models" data-route="models"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m12 3 10 5-10 5L2 8Zm-10 9 10 5 10-5M2 16l10 5 10-5"/></svg><span data-i18n="model_services">Model sources</span></a>
|
|
29
|
+
<a href="#usage" data-route="usage"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 3v18h18M7 16v-5m5 5V7m5 9V4"/></svg><span data-i18n="usage_and_diagnostics">Usage</span></a>
|
|
30
|
+
<a href="#requests" data-route="requests"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"/></svg><span data-i18n="request_records">Requests</span></a>
|
|
31
|
+
<a href="#system" data-route="system"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 6h4m4 0h10M3 12h10m4 0h4M3 18h4m4 0h10"/><circle cx="9" cy="6" r="2"/><circle cx="15" cy="12" r="2"/><circle cx="9" cy="18" r="2"/></svg><span data-i18n="system_and_settings">Settings</span></a>
|
|
31
32
|
</nav>
|
|
32
|
-
<div class="sidebar-bottom"><button id="open-animation" type="button" aria-controls="animation-settings" aria-expanded="false" data-i18n="terminal_appearance">Terminal appearance</button></div>
|
|
33
33
|
</aside>
|
|
34
34
|
|
|
35
35
|
<header class="topbar">
|
|
@@ -142,6 +142,14 @@
|
|
|
142
142
|
<p class="hint" data-i18n="m365_source_access">Provides models for Codex and Claude on supported devices.</p>
|
|
143
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>
|
|
144
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>
|
|
145
153
|
</section>
|
|
146
154
|
</div>
|
|
147
155
|
<div data-view="usage" hidden>
|
|
@@ -237,7 +245,7 @@ Missing data is unknown. This panel keeps no prompts or images.</p>
|
|
|
237
245
|
<pre class="terminal-motion"><span id="terminal-sample-frame">[ :::::::]</span> <span id="terminal-sample-status">Working</span></pre>
|
|
238
246
|
</div>
|
|
239
247
|
|
|
240
|
-
<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>
|
|
248
|
+
<div class="setting-row terminal-animation-toggle"><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>
|
|
241
249
|
<details id="animation-settings" class="appearance-animation settings-panel">
|
|
242
250
|
<summary class="panel-heading"><h2 data-i18n="terminal_animation_9edf6">TERMINAL ANIMATION</h2><span id="animation-state" data-i18n="reading">READING</span></summary>
|
|
243
251
|
<div id="animation-options" class="animation-options" role="group" aria-label="Animation style" data-i18n-label="animation_theme"></div>
|
|
@@ -254,6 +262,20 @@ Missing data is unknown. This panel keeps no prompts or images.</p>
|
|
|
254
262
|
|
|
255
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>
|
|
256
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>
|
|
265
|
+
<section class="panel dashboard-section" id="version-updates" aria-labelledby="version-updates-title">
|
|
266
|
+
<div class="version-heading"><h2 id="version-updates-title" data-i18n="version_updates">VERSION & UPDATES</h2><button id="check-updates" type="button" data-i18n="check_updates">Check for updates</button></div>
|
|
267
|
+
<dl class="version-list"><div><dt data-i18n="current_version">Current version</dt><dd id="update-current-version">—</dd><dd id="update-current-date" class="hint">—</dd></div><div id="update-latest-row" hidden><dt data-i18n="available_update">Update available</dt><dd id="update-latest-version">—</dd><dd id="update-latest-date" class="hint">—</dd></div></dl>
|
|
268
|
+
<p id="update-state" class="hint" role="status" data-i18n="reading">READING</p>
|
|
269
|
+
<div id="update-command-row" class="update-command"><code id="update-command">ccdx update github</code><button type="button" id="copy-update" data-i18n="copy_command">Copy command</button></div>
|
|
270
|
+
<p class="hint" data-i18n="update_restart">Run in your terminal, then restart CCDX.</p>
|
|
271
|
+
<p id="update-checked" class="refresh-time"></p>
|
|
272
|
+
<details class="update-install"><summary data-i18n="update_install_help">Update failed? View full installation commands</summary><p class="hint" data-i18n="update_install_hint">Download the official installer. No Git required.</p>
|
|
273
|
+
<div class="section-actions install-platforms" role="group" aria-label="Installation platform" data-i18n-label="installation_platform"><button type="button" data-install-platform="macos" aria-pressed="true">macOS</button><button type="button" data-install-platform="windows" aria-pressed="false">Windows</button></div>
|
|
274
|
+
<div class="install-command-heading"><span id="install-shell" class="hint">macOS · Terminal</span><button type="button" id="copy-install" data-i18n="copy_command">Copy command</button></div><pre id="install-command" class="install-command"></pre>
|
|
275
|
+
<p class="hint" data-i18n="update_install_policy">Reuses compatible Node/npm or installs a private runtime. Keeps your registry, proxy, certificates and shell policy.</p>
|
|
276
|
+
<p id="install-windows-policy" class="hint" hidden data-i18n="update_windows_policy">If scripts are blocked, use your company’s approved installation method.</p>
|
|
277
|
+
</details><p id="update-copy-note" class="hint" role="status"></p>
|
|
278
|
+
</section>
|
|
257
279
|
</div>
|
|
258
280
|
</main>
|
|
259
281
|
<footer data-i18n="local_only_visible_page_updates">THIS COMPUTER ONLY / UPDATES WHILE VISIBLE</footer>
|
|
@@ -1,5 +1,52 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const translations = {
|
|
3
|
+
"provider_status_scope": ["Source and application status", "模型来源与应用状态"],
|
|
4
|
+
"version_updates": ["VERSION & UPDATES", "版本与更新"],
|
|
5
|
+
"copy_command": ["Copy command", "复制指令"],
|
|
6
|
+
"check_updates": ["Check for updates", "检查更新"],
|
|
7
|
+
"checking_updates": ["Checking…", "正在检查…"],
|
|
8
|
+
"current_version": ["Current version", "当前版本"],
|
|
9
|
+
"available_update": ["Update available", "可用更新"],
|
|
10
|
+
"last_known_version": ["Last known version", "上次查到的版本"],
|
|
11
|
+
"released_date": ["Released {date}", "发布于 {date}"],
|
|
12
|
+
"release_date_unknown": ["Release date unknown", "发布日期未知"],
|
|
13
|
+
"new_version_available": ["A new version is available.", "发现新版本。"],
|
|
14
|
+
"already_latest": ["You’re up to date.", "已是最新版本。"],
|
|
15
|
+
"update_check_failed": ["Could not check updates. Latest version unknown.", "暂时无法检查,最新版本未知。"],
|
|
16
|
+
"update_rate_limited": ["GitHub limited update checks. Try again later.", "GitHub 限制了检查,请稍后再试。"],
|
|
17
|
+
"update_restart": ["Run in your terminal, then restart CCDX.", "在终端运行,完成后重启 CCDX。"],
|
|
18
|
+
"update_checked_time": ["Last checked: {time}", "上次检查:{time}"],
|
|
19
|
+
"update_attempted_time": ["Last attempt: {time}", "最近尝试:{time}"],
|
|
20
|
+
"update_install_help": ["Update failed? View full installation commands", "更新遇到问题?查看完整安装指令"],
|
|
21
|
+
"installation_platform": ["Installation platform", "安装平台"],
|
|
22
|
+
"update_install_hint": ["Download the official installer. No Git required.", "下载官方安装器,无需 Git。"],
|
|
23
|
+
"update_install_policy": ["Reuses compatible Node/npm or installs a private runtime. Keeps your registry, proxy, certificates and shell policy.", "复用可用的 Node/npm,否则安装专用运行环境。\n保留镜像、代理、证书和脚本策略。"],
|
|
24
|
+
"update_windows_policy": ["If scripts are blocked, use your company’s approved installation method.", "若公司禁止运行脚本,请使用公司批准的安装方式。"],
|
|
25
|
+
"update_copy_unavailable": ["Clipboard unavailable. Select the command and copy it.", "无法自动复制,请选中指令复制。"],
|
|
26
|
+
"company_account": ["Company account", "公司账号"],
|
|
27
|
+
"check_accounts": ["Check accounts", "检查账号"],
|
|
28
|
+
"choose_company_account": ["Choose a company account", "选择公司账号"],
|
|
29
|
+
"use_this_account": ["Use this account", "使用此账号"],
|
|
30
|
+
"company_account_scope": ["Applies to Microsoft 365 in Codex and Claude. Start a new conversation after changing accounts.", "影响 Codex 和 Claude 的 M365 服务。\n更换账号后请新建对话。"],
|
|
31
|
+
"company_account_current": ["{login} · Tenant {tenant} · {source}", "{login}\n租户:{tenant} · {source}"],
|
|
32
|
+
"account_source_windows": ["Windows sign-in", "Windows 登录账号"],
|
|
33
|
+
"account_source_single": ["Only company account", "唯一公司账号"],
|
|
34
|
+
"account_source_manual": ["Your choice", "手动选择"],
|
|
35
|
+
"account_source_legacy": ["Saved account", "已保存账号"],
|
|
36
|
+
"company_account_none": ["No company account connected.", "尚未连接公司账号。"],
|
|
37
|
+
"company_account_choose": ["Choose an account. Browsing does not change your connection.", "请选择账号。查看列表不会切换。"],
|
|
38
|
+
"company_account_empty": ["No company account found. Connect your work account in Windows or macOS, then check again.", "未找到公司账号。\n请先连接工作账号,再检查。"],
|
|
39
|
+
"company_account_confirm": ["Change the Microsoft 365 account for Codex and Claude? Existing conversations will not move to the new account. Start a new conversation.", "更换 Codex 和 Claude 的 M365 账号?旧对话不会转移,请新建对话。"],
|
|
40
|
+
"company_account_checked": ["Account connected. Model list checked; inference access is not tested.", "账号已连接,模型列表已检查。\n尚未测试实际请求。"],
|
|
41
|
+
"m365_account_ambiguous": ["Choose a company account below.", "请在下方选择公司账号。"],
|
|
42
|
+
"m365_account_unavailable": ["Company account unavailable. Check your work sign-in, then check again.", "公司账号不可用。\n请检查工作账号登录。"],
|
|
43
|
+
"m365_account_conflict": ["Account records conflict. Check your work sign-in.", "账号记录冲突,请检查工作登录。"],
|
|
44
|
+
"m365_interaction_required": ["Complete your company sign-in, then check again.", "请先完成公司登录,再检查。"],
|
|
45
|
+
"m365_llm_permission_unavailable": ["This account does not have model access.", "此账号没有模型访问权限。"],
|
|
46
|
+
"m365_account_busy": ["Finish Microsoft 365 requests before changing accounts.", "请在 M365 请求结束后更换。"],
|
|
47
|
+
"m365_account_selection_stale": ["Account list changed. Check again and select an account.", "账号列表已变化,请重新检查。"],
|
|
48
|
+
"company_account_check_failed": ["Could not read accounts. Check company sign-in and the native authentication component.", "未能读取账号。\n请检查公司登录和认证组件。"],
|
|
49
|
+
"company_account_not_saved": ["Account not changed. Previous connection kept. {reason}", "账号未更换,保留原连接。\n{reason}"],
|
|
3
50
|
"source_catalog_unavailable": ["Model list unavailable: {code}", "模型列表不可用:{code}"],
|
|
4
51
|
"terminal_color_preview": ["Terminal color preview", "终端配色预览"],
|
|
5
52
|
"source_retry_time": ["Can retry after {time}.", "可在 {time} 后重试。"],
|
package/src/dashboard/status.js
CHANGED
|
@@ -14,7 +14,6 @@
|
|
|
14
14
|
restored: "settings_restored", not_installed: "not_installed", configuration_unavailable: "setup_unavailable", not_configured: "unknown", standby: "standby" };
|
|
15
15
|
const auth = element("provider-auth"), clients = element("provider-clients"), requests = element("provider-requests");
|
|
16
16
|
auth.replaceChildren();clients.replaceChildren();requests.replaceChildren();
|
|
17
|
-
const routes = [];
|
|
18
17
|
for (const provider of providers) {
|
|
19
18
|
sourceNames.set(provider.id, provider.name);
|
|
20
19
|
const identity = provider.auth || {};
|
|
@@ -27,7 +26,6 @@
|
|
|
27
26
|
client.gateway || "—", client.last_request_at || "—"], { labels: [2, 3] });
|
|
28
27
|
if (client.reason) localize(row.children[2], "state_reason", { state: phrase(states[client.state] || "unknown"), reason: client.reason });
|
|
29
28
|
clients.append(row);
|
|
30
|
-
if (client.selected && client.id === "codex") routes.push(`${client.name} → ${provider.name}`);
|
|
31
29
|
}
|
|
32
30
|
if (provider.requests) {
|
|
33
31
|
const item = document.createElement("p");
|
|
@@ -36,10 +34,11 @@
|
|
|
36
34
|
requests.append(item);
|
|
37
35
|
}
|
|
38
36
|
}
|
|
39
|
-
text("source-summary", "count_providers", { count: providers.
|
|
40
|
-
element("source-detail").
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
text("source-summary", "count_providers", { count: providers.length });
|
|
38
|
+
element("source-detail").replaceChildren(...providers.map(provider => {
|
|
39
|
+
const item = document.createElement("span");item.textContent = provider.name;return item;
|
|
40
|
+
}));
|
|
41
|
+
text("auth-account", "provider_status_scope");
|
|
43
42
|
}
|
|
44
43
|
|
|
45
44
|
function duration(value) {
|