codex-copilot-dx 1.0.0 → 1.1.1

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 CHANGED
@@ -2,13 +2,12 @@
2
2
 
3
3
  Use Codex App with GitHub Copilot through a local adapter, with isolated Microsoft 365 access where authorized.
4
4
 
5
- CCDX keeps GitHub Copilot as the default Codex source: discovery, adapted model catalogs, Responses streaming, tool calls and conversation history. Eligible Microsoft 365 environments can also use a separate Claude gateway and manually select M365 as a Codex backup.
5
+ CCDX keeps GitHub Copilot as the default Codex source: discovery, adapted model catalogs, Responses streaming, tool calls and conversation history. Eligible Microsoft 365 environments can also use a protocol-isolated Claude gateway on the main listener and manually select M365 as a Codex backup.
6
6
  Default Auto-review: **GPT-6.1 Sol / low**. Image generation is **off by default**. Native predictions are also **off by default**.
7
7
 
8
8
  ## Install and run
9
9
 
10
- Requires macOS or Windows, Codex App, Node.js **22.15+**, and a GitHub account with Copilot
11
- access to the models you want to use.
10
+ Requires macOS or Windows, Codex App, Node.js **22.15+**, and a GitHub account with Copilot access to the models you want to use.
12
11
 
13
12
  ```bash
14
13
  npm install -g codex-copilot-dx@latest
@@ -16,20 +15,25 @@ ccdx
16
15
  ```
17
16
 
18
17
  CCDX reuses a compatible local credential or starts GitHub Device Flow, listens
19
- on `127.0.0.1:2026`, configures Codex, and opens the App. No client binary patch
18
+ 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
20
19
  is needed. On Windows, open the App manually unless native prediction setup is
21
20
  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`. No install script, alias or policy change is added; custom launchers are preserved. npm's own script is untouched. The configured `dummy` API key is a placeholder, not a credential.
22
21
 
23
- Open [the local dashboard](http://127.0.0.1:2026/) for status, model discovery, usage, cache/limits, recent failures, request context and animation settings. First output uses **ms**; estimated output speed uses **token/s**. Inference HTTP failures are retained separately from route and MCP-method errors.
24
- Provider tabs browse sources without changing routing. Separate disclosures show authorization, clients, resources and optional capabilities. Saved credentials and catalog listings do not prove inference access; historical sources remain filterable.
25
- Auto refresh runs every 30 minutes while visible and can be switched off. Hidden pages pause; opening sections and manual refresh still work. The atom rotates once on page load and manual refresh, respecting reduced motion. Startup uses a compact six-line atom and aligned checks; `Ready` refers to the core service. Narrow/non-color terminals use a plain title.
22
+ The [local control console](http://127.0.0.1:2026/) has a sidebar for **Overview, Clients, Model services, Usage and diagnostics, System and settings**. Codex image generation, input predictions and conversation buffering are explicitly Codex-specific. Provider authorization, model directories, retained usage and operations keep their own scopes. Browsing a catalog never switches the active source.
23
+
24
+ Startup shows bounded checks, discovered Provider catalogs 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 Provider/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 cache-read tokens. `ccdx --verbose` (also `--show-request-id`, or debug logging) retains detail output; optional file logging remains independently controlled. Non-TTY, CI, dumb or terminals smaller than 40 columns / 16 rows use plain output. `Ready` only means the core service is available; discovered catalogs and configured clients do not prove inference access.
25
+
26
+ 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. 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).
27
+
28
+ 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.
26
29
 
27
30
  ## Commands
28
31
 
29
32
  | Command | Purpose |
30
33
  | --- | --- |
31
34
  | `ccdx help` | Command help; use `ccdx help <command>` for details |
32
- | `ccdx start` | Start or reuse the adapter and open Codex when auto-launch is enabled |
35
+ | `ccdx start` | Start/reuse the adapter, open Codex when enabled, and open WebUI on interactive desktop starts |
36
+ | `ccdx --no-browser` / `ccdx --verbose` | Skip WebUI opening once / retain detailed terminal logs |
33
37
  | `ccdx status` | Runtime, limits and bounded request diagnostics |
34
38
  | `ccdx doctor` | Configuration, adapter and read-only App/catalog diagnostics |
35
39
  | `ccdx doctor --fix` | Repair owned launchers/config, recover existing auth and enabled prediction routing once |
@@ -56,11 +60,10 @@ Auto refresh runs every 30 minutes while visible and can be switched off. Hidden
56
60
 
57
61
  ## Microsoft 365 access
58
62
 
59
- Eligible macOS/Windows machines attempt silent Microsoft authorization at startup,
60
- without Copilot CLI or a browser login. MDM alone is insufficient: account, tenant,
63
+ Eligible macOS/Windows machines attempt silent Microsoft authorization at startup, without Copilot CLI or a browser login. MDM alone is insufficient: account, tenant,
61
64
  device policy and Loki entitlement must permit access. Optional failure does not block GitHub.
62
65
 
63
- Claude clients use the separate, keyed `127.0.0.1:2027` gateway and Claude-only catalog.
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.
64
67
  Existing custom/managed settings are preserved; already-running clients may need a normal restart.
65
68
  Canonical Claude IDs and advertised effort caps refresh only in unchanged CCDX-owned settings. User and managed choices are preserved; supported App versions can update model knowledge through Anthropic's signed catalog. New protocol semantics may require a client or CCDX update. See the [model reference](docs/REFERENCE.md#claude-gateway-and-client-ownership).
66
69
  `ccdx m365 off` restores unchanged owned fields; `remove` also clears owned M365 state.
@@ -112,9 +115,7 @@ Updates install the exact stable tag; dependencies still use npm's configured re
112
115
  Updates warn about mismatched npm targets without changing PATH/prefix and verify the installed target version (exact tag for GitHub). Restart the adapter separately. Full `ccdx doctor` reports this target and readonly credential permissions; it never changes ACLs.
113
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).
114
117
 
115
- The dashboard and CLI separate prediction preference, bridge state and observed config traffic; candidate visibility stays unknown. See [architecture boundaries](docs/ARCHITECTURE.md) for separate inference, integration, image and management ownership.
116
-
117
- See the [complete reference](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/REFERENCE.md) for authentication, configuration, limits, logging, images and compatibility. It is also included as `docs/REFERENCE.md` in the npm package.
118
+ See [architecture boundaries](docs/ARCHITECTURE.md) and the [complete reference](https://github.com/DaleXiao/codex-copilot-dx/blob/main/docs/REFERENCE.md) for authentication, configuration, limits, logging, images and compatibility. It is also included as `docs/REFERENCE.md` in the npm package.
118
119
 
119
120
  ## Development
120
121
 
@@ -124,7 +125,6 @@ npm run verify
124
125
  node scripts/config-startup-replay.mjs
125
126
  ```
126
127
 
127
- Verification covers unit tests, isolated HTTP/idle-stream replay, performance/resource gates and package contents—not an upstream service SLA.
128
- CI also tests Node 22.15/24 on Linux, Windows and macOS, temporary-prefix installation/upgrade and installed image processing.
128
+ Verification covers unit tests, isolated HTTP/idle-stream replay, performance/resource gates and package contents—not an upstream service SLA. CI also tests Node 22.15/24 on Linux, Windows and macOS, temporary-prefix installation/upgrade and installed image processing.
129
129
 
130
130
  License: MIT.
package/bin/cli.mjs CHANGED
@@ -14,7 +14,7 @@ import { runInBackground } from "../src/startup.mjs";
14
14
  import { cliCommandName, cliHelp, parseAdapterAddressOptions, parseAdapterProbeOptions, parseCliArgs, parseRuntimeOptions } from "../src/cli-options.mjs";
15
15
  import { formatAdapterStatus, readAdapterStatus } from "../src/cli-status.mjs";
16
16
  import { closeHttpServer } from "../src/shutdown.mjs";
17
- import { autoReviewModelPreference, autoReviewPreference, responseHistoryLimitPreference, terminalAnimationPreference } from "../src/user-settings.mjs";
17
+ import { autoReviewModelPreference, autoReviewPreference, responseHistoryLimitPreference, terminalAnimationPreference, servicePreferences } from "../src/user-settings.mjs";
18
18
  import { formatLiveCopilotModels } from "../src/cli-models.mjs";
19
19
  import { runAuthCommand } from "../src/cli-auth.mjs";
20
20
  import { createProfileRuntime } from "../src/profile-runtime.mjs";
@@ -22,7 +22,10 @@ import { createProfileModelRuntime } from "../src/profile-model-runtime.mjs";
22
22
  import { createCodexModelCatalog } from "../src/codex-model-catalog.mjs";
23
23
  import { createProviderRuntime } from "../src/provider-runtime.mjs";
24
24
  import { setResponseHistoryMaxBytes } from "../src/response-history.mjs";
25
- import { startupBanner, startupCheck, startupReady, startupLogger, predictionStartupCheck } from "../src/startup-ui.mjs";
25
+ import { startupBanner, startupCheck, startupReady, startupLogger, predictionStartupCheck, providerStartupChecks } from "../src/startup-ui.mjs";
26
+ import { createTerminalConsole } from "../src/terminal-console.mjs";
27
+ import { createServiceControl } from "../src/service-control.mjs";
28
+ import { openDashboard } from "../src/browser-launch.mjs";
26
29
 
27
30
  const LOCAL_VERSION = localPackageVersion();
28
31
  const CLI_NAME = cliCommandName();
@@ -284,6 +287,14 @@ let shuttingDown = false;
284
287
  let nativePrediction = null;
285
288
  let clientIntegration = null;
286
289
  let providerRuntime = null;
290
+ let terminalConsole = null;
291
+ const webUiUrl = `http://${ADAPTER_HOST === "::1" ? "[::1]" : "127.0.0.1"}:${ADAPTER_PORT}`;
292
+ async function launchDashboard() {
293
+ try {
294
+ const result = await openDashboard(webUiUrl, { enabled: !CLI.noBrowser && servicePreferences().open_webui });
295
+ if (result.state === "unavailable") console.warn(startupCheck("warn", "WebUI", `Browser unavailable; open ${webUiUrl}`));
296
+ } catch (error) { console.warn(startupCheck("warn", "WebUI", error.message)); }
297
+ }
287
298
 
288
299
  async function clientIntegrations() {
289
300
  if (!clientIntegration) {
@@ -312,6 +323,7 @@ async function reuseRunningAdapterIfAvailable() {
312
323
  }
313
324
  if (!running.ok) return false;
314
325
 
326
+ const serviceStatus = readAdapterStatus({ host: ADAPTER_HOST, port: ADAPTER_PORT }).catch(() => null);
315
327
  console.log(startupCheck("ok", "Adapter", `Using existing service at ${running.baseUrl}`));
316
328
  console.log(startupCheck("info", "Auth", "Using existing service credentials; not rechecked"));
317
329
  const { compressionSetup, imageEnabled, imageMcpSkipped } = await configureCodexClient();
@@ -341,7 +353,9 @@ async function reuseRunningAdapterIfAvailable() {
341
353
  console.log(predictionStartupCheck({ configured: predictionConfigured, bridge: predictionPacUrl ? "running" : "unknown", launch_route: launchRoute }));
342
354
  console.log(startupCheck(imageEnabled && imageMcpSkipped ? "warn" : "info", "Images", imageEnabled
343
355
  ? imageMcpSkipped ? "Client setup skipped; see warning above" : "Configured; provider not tested" : "Off"));
356
+ console.log(providerStartupChecks((await serviceStatus)?.data));
344
357
  console.log(startupReady({ baseUrl: running.baseUrl, commandName: CLI_NAME, reused: true }));
358
+ await launchDashboard();
345
359
  await compressionSetup;
346
360
  return true;
347
361
  }
@@ -370,8 +384,7 @@ async function printUpdateNotice() {
370
384
  try {
371
385
  const { latestVersion, updateAvailable } = await checkForUpdate({ currentVersion: LOCAL_VERSION });
372
386
  if (!updateAvailable) return;
373
- console.log(`\n${status("warn", `Update available: ${LOCAL_VERSION} -> ${latestVersion}`)}`);
374
- console.log(`Run ${CLI_NAME} update github to update, then restart ${CLI_NAME}.\n`);
387
+ console.warn(`\n${status("warn", `Update available: ${LOCAL_VERSION} -> ${latestVersion}. Run ${CLI_NAME} update github to update, then restart ${CLI_NAME}.`)}\n`);
375
388
  } catch {
376
389
  // Never block startup on the update check.
377
390
  }
@@ -437,6 +450,10 @@ try {
437
450
 
438
451
  // Start the in-process adapter.
439
452
  const terminalAnimationTheme = terminalAnimationPreference().theme;
453
+ terminalConsole = createTerminalConsole({ baseUrl: webUiUrl, verbose: CLI.verbose === true || CLI.showRequestId === true || LOGGING.level === "debug",
454
+ snapshot: () => activeServer?.ccdxSnapshot?.() || {},
455
+ preferences: () => ({ ...servicePreferences(), theme: terminalAnimationPreference().theme }) });
456
+ const serviceControl = createServiceControl({ providerRuntime, clientIntegration: earlyIntegration, terminal: terminalConsole });
440
457
  const codexModelCatalog = createCodexModelCatalog();
441
458
  activeServer = await startAdapter(ADAPTER_PORT, ADAPTER_HOST, {
442
459
  log: startupLogger("Adapter"),
@@ -450,6 +467,8 @@ try {
450
467
  streamHandshakeTimeoutMs: RUNTIME.streamHandshakeTimeoutMs,
451
468
  streamIdleTimeoutMs: RUNTIME.streamIdleTimeoutMs,
452
469
  terminalAnimationTheme,
470
+ terminalActivity: terminalConsole,
471
+ dashboardOptions: { serviceControl, applyAnimation: theme => terminalConsole.apply({ theme }) },
453
472
  nativePredictionPac: () => clientIntegration?.pacUrl() || null,
454
473
  fixPrediction: async () => (await clientIntegrations()).fix(),
455
474
  clientIntegrationSnapshot: () => clientIntegration?.snapshot() || null,
@@ -469,6 +488,7 @@ try {
469
488
  console.log(predictionStartupCheck(clientIntegration?.snapshot().prediction));
470
489
  console.log(startupCheck(imageEnabled && imageMcpSkipped ? "warn" : "info", "Images", imageEnabled
471
490
  ? imageMcpSkipped ? "Client setup skipped; see warning above" : "Configured; provider not tested" : "Off"));
491
+ console.log(providerStartupChecks(activeServer.ccdxSnapshot?.()));
472
492
 
473
493
  // Periodically refresh the model list + endpoint cache so a long-running
474
494
  // adapter picks up newly released models without a restart.
@@ -483,10 +503,13 @@ try {
483
503
 
484
504
  startupComplete = true;
485
505
  console.log(startupReady({ baseUrl: adapterBaseUrl(ADAPTER_HOST, ADAPTER_PORT), commandName: CLI_NAME }));
506
+ await launchDashboard();
507
+ terminalConsole.start();LOGGING.setTerminalSink((method, args) => terminalConsole.log(method, args));
486
508
 
487
509
  const shutdown = async (signal) => {
488
510
  if (shuttingDown) return;
489
511
  shuttingDown = true;
512
+ LOGGING.setTerminalSink(null);terminalConsole?.cleanup();
490
513
  console.log(`\n${status("wait", `Shutting down on ${signal}...`)}`);
491
514
  let exitCode = 0;
492
515
  try {
@@ -508,6 +531,7 @@ try {
508
531
  process.once("SIGTERM", () => { void shutdown("SIGTERM"); });
509
532
  await compressionSetup;
510
533
  } catch (e) {
534
+ LOGGING.setTerminalSink(null);terminalConsole?.cleanup();
511
535
  console.error(status("err", e.message));
512
536
  await clientIntegration?.close().catch(() => {});
513
537
  await providerRuntime?.close().catch(() => {});
@@ -45,12 +45,12 @@ The fixed Loki target, account-bound catalog and dedicated network agent belong
45
45
  to M365. No GitHub token, image credential or browser Cookie is reused. Windows can
46
46
  use a separate OS WinHTTP worker for M365 company routing; macOS preserves static
47
47
  system/environment routing and reports unsupported dynamic PAC. Native runtime
48
- absence, policy refusal and gateway-port conflicts do not disable GitHub.
49
- Claude listener/configuration readiness is also separate from M365 provider
50
- readiness. A busy Claude port or a GPT-only catalog cannot block the explicitly
48
+ absence and policy refusal do not disable GitHub.
49
+ Claude handler/configuration readiness is also separate from M365 provider
50
+ readiness. A Claude setup failure or a GPT-only catalog cannot block the explicitly
51
51
  selected Codex backup; a catalog without Claude models does not install Claude settings.
52
52
 
53
- The Claude gateway listens on loopback only, requires its private local key and
53
+ The Claude gateway is mounted at /anthropic in the main listener, independently requires a loopback socket/Host and its private local key, and
54
54
  rejects browser-origin requests. It preserves native Messages/SSE bytes, observes
55
55
  bounded usage/terminal metadata and honors downstream backpressure. The client
56
56
  writer records field-level ownership before applying changes and restores only
@@ -264,8 +264,11 @@ invalidated on profile generation/account changes. It cancels obsolete reads and
264
264
  prevents stale apply across tabs. `status.js` renders source-neutral authorization
265
265
  and client evidence; `usage.js` renders usage and date selection. View state remains
266
266
  page-local; only existing preferences and the viewed model Provider are saved in
267
- the browser. Expanded sections read on demand. There is no Node data watcher or
268
- new poller. Animation frames still load once per page when opened.
267
+ the browser. Expanded sections read on demand. There is no Node data watcher.
268
+ The sidebar controller reads small process-local status snapshots every two seconds
269
+ while visible/automatic, and source/settings evidence every eight status ticks.
270
+ Catalog and retained-log reads retain their slower, view-scoped policy. Animation
271
+ frames still load once per page when opened.
269
272
 
270
273
  `claude-models.mjs` owns exact ID spelling and capability-cap projection shared by
271
274
  configuration and model discovery. M365 resolves both canonical and existing raw
@@ -284,6 +287,36 @@ implementation and lookup parameters share one in-flight lookup. A waiter can
284
287
  cancel independently; the last cancellation aborts the lookup. Completed results
285
288
  are not cached as live, and each waiter receives its own snapshot.
286
289
 
290
+
291
+ ### Shared listener and service controls
292
+
293
+ The main adapter counts each HTTP request once. /anthropic dispatch strips only
294
+ the protocol mount prefix and preserves its query; the mounted handler retains
295
+ native authentication, admission, Messages timing and response ownership. Closing
296
+ Claude cannot close the main listener. Provider credentials/history namespaces and
297
+ protocol-specific timing stay independent; the UI names the scope rather than
298
+ summing incompatible counters. Root legacy Messages routes remain retired.
299
+
300
+ `service-control.mjs` composes explicit preference/Provider/cache/integration
301
+ actions with serialized writes and effective-state readback. It has no transport,
302
+ UI or shell dependency. `dashboard-api.mjs` supplies the local/same-origin HTTP
303
+ boundary. Client configuration migration reuses field ownership and its original
304
+ before-values, preserving foreign or edited fields. Saved allow gates are separate
305
+ from provisioning; pausing never deletes the Provider key or prediction trust.
306
+
307
+ `terminal-console.mjs` owns a bounded TTY status region and activity only.
308
+ Its 15-line region has Provider/Claude summaries, a responsive line-framed table,
309
+ then separate notice and activity rows. Snapshot data is read about once a second;
310
+ animation ticks reuse the table and write only changed rows. Small viewports
311
+ (under 40 columns or 16 rows) retain plain output. Client-originated cancellations
312
+ are informational; timeouts and actual failures remain notices and file diagnostics.
313
+ `log.mjs` routes terminal presentation independently from existing opt-in,
314
+ redacted rotating file records. Returned usage accumulates scalar process-local
315
+ totals in `usage-store.mjs`, without a historical-log scan or per-token callback.
316
+ `browser-launch.mjs` makes one bounded local desktop-open attempt after readiness;
317
+ no headless/SSH launch, browser dependency, generic shell or background tab watcher
318
+ is added. Neither terminal nor WebUI rendering is required for inference.
319
+
287
320
  ## Configuration ownership
288
321
 
289
322
  `CODEX_HOME` selects Codex configuration. App profile/trust paths have their own
@@ -330,7 +363,7 @@ Empty-stream diagnostics are additive scalar metadata, not a new retry policy.
330
363
  Release reports describe a specific environment, not an SLA or a guarantee of
331
364
  compatibility with every future client or corporate network policy.
332
365
  CI runs Node 22.15 and 24 on Linux, Windows and macOS. The owned temporary-prefix
333
- package smoke installs 0.9.31, upgrades to the packed candidate and exercises
366
+ package smoke installs its 0.9.41 baseline (or an explicit local artifact), upgrades to the packed candidate and exercises
334
367
  installed sharp without provider calls. It does not claim a live Codex UI test
335
368
  or the GitHub updater's network installation; the Windows command chain has a
336
369
  separate actual-process fixture. Direct runtime dependencies are exact versions;
package/docs/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # Documentation index
2
2
 
3
+ - [1.1.1: Clear startup checks and framed terminal status](RELEASE_1.1.1.md)
4
+ - [1.1.0: Shared entry, control console and quiet terminal](RELEASE_1.1.0.md)
3
5
  - [1.0.0: Provider dashboard and Claude effort adaptation](RELEASE_1.0.0.md)
4
6
 
5
7
  The [root README](../README.md) is the quick start; the [command/configuration