codex-copilot-dx 1.3.6 → 1.3.8
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 +7 -16
- package/bin/cli.mjs +55 -31
- package/docs/ARCHITECTURE.md +14 -2
- package/docs/REFERENCE.md +38 -5
- package/package.json +6 -2
- package/src/claude-gateway.mjs +2 -1
- package/src/cli-command-spec.mjs +3 -2
- package/src/cli-image.mjs +2 -80
- package/src/cli-options.mjs +1 -1
- package/src/client-integration.mjs +11 -4
- package/src/dashboard/connections.js +4 -0
- package/src/dashboard/console.js +12 -6
- package/src/dashboard/features.js +68 -0
- package/src/dashboard/index.html +11 -9
- package/src/dashboard/language.js +57 -14
- package/src/dashboard/status.js +2 -1
- package/src/dashboard/tools.js +4 -1
- package/src/dashboard/ui.js +1 -1
- package/src/dashboard-api.mjs +2 -2
- package/src/dashboard-tools.mjs +2 -1
- package/src/dashboard.mjs +1 -0
- package/src/doctor-compat.mjs +19 -13
- package/src/doctor.mjs +1 -1
- package/src/image-setup.mjs +110 -0
- package/src/local-privacy.mjs +1 -0
- package/src/local-tools.mjs +8 -2
- package/src/native-prediction-profile.mjs +5 -2
- package/src/native-prediction.mjs +18 -2
- package/src/optional-routes.mjs +1 -1
- package/src/prediction-control.mjs +64 -0
- package/src/prediction-operations.mjs +68 -0
- package/src/prediction-preference.mjs +75 -0
- package/src/privacy-model.mjs +6 -4
- package/src/privacy-transform.mjs +39 -25
- package/src/response-failures.mjs +8 -2
- package/src/responses-handler.mjs +2 -2
- package/src/responses-proxy.mjs +1 -1
- package/src/service-control.mjs +33 -7
- package/src/service-supervisor.mjs +39 -18
- package/src/service-worker.mjs +13 -1
- package/src/stream-performance.mjs +2 -2
package/README.md
CHANGED
|
@@ -17,8 +17,8 @@ ccdx
|
|
|
17
17
|
|
|
18
18
|
Without Node.js, download and run the installer for your system:
|
|
19
19
|
|
|
20
|
-
- macOS: [install.sh](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.3.
|
|
21
|
-
- Windows: [install.ps1](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.3.
|
|
20
|
+
- macOS: [install.sh](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.3.8/install.sh), then `sh install.sh`.
|
|
21
|
+
- Windows: [install.ps1](https://github.com/DaleXiao/codex-copilot-dx/releases/download/v1.3.8/install.ps1), then `./install.ps1` under your current shell policy.
|
|
22
22
|
|
|
23
23
|
The installer reuses a compatible Node.js or installs a private, verified copy. Git and a compiler are not required. Complete platform packages include their dependencies. Company registry, proxy, certificate and shell policies are kept.
|
|
24
24
|
|
|
@@ -57,22 +57,13 @@ Use `ccdx help` or `ccdx <command> --help` for options. The CLI uses English; th
|
|
|
57
57
|
|
|
58
58
|
**1.3 uses one command tree.** Old command names and the `codex-copilot-dx` executable have been removed. This changes command entrypoints, not saved accounts, model selections or chats. See the [command reference](docs/REFERENCE.md#commands).
|
|
59
59
|
|
|
60
|
-
##
|
|
60
|
+
## Features and maintenance
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
Use the Web UI for accounts, APIs, models, client access, input suggestions, image setup, local masking, appearance, diagnostics and updates. CLI commands remain available for automation and recovery. See the [control reference](docs/REFERENCE.md#webui-and-cli-controls).
|
|
63
63
|
|
|
64
|
-
- **
|
|
65
|
-
- **
|
|
66
|
-
- **
|
|
67
|
-
|
|
68
|
-
## Update and troubleshoot
|
|
69
|
-
|
|
70
|
-
Finish active tasks before updating the active installation. Install the update, then restart CCDX normally:
|
|
71
|
-
|
|
72
|
-
```sh
|
|
73
|
-
ccdx update github
|
|
74
|
-
ccdx version
|
|
75
|
-
```
|
|
64
|
+
- **Input suggestions:** new integrations attempt setup by default when Codex is closed. Saved off choices are retained. The Web UI can enable, disable, finish setup, open Codex and repair the bridge. Setup synchronizes Show predictions, adds App-profile trust and locally decrypts the prediction hosts' HTTPS traffic. App/thread eligibility still applies. [Details](docs/REFERENCE.md#optional-native-predictions).
|
|
65
|
+
- **Images:** configure the address, key and model in Codex → Image generation. Image setup and overnight updates remain off by default.
|
|
66
|
+
- **Updates:** Settings → Install update downloads and verifies a stable release, then switches the installed service when idle. Busy work postpones the switch. Unmanaged launches require the installer or an installed command. [Details](docs/REFERENCE.md#installation-and-updates).
|
|
76
67
|
|
|
77
68
|
Web UI activity updates through server push; the terminal uses the same in-process activity feed. Reconnecting restores current state and bounded recent records.
|
|
78
69
|
|
package/bin/cli.mjs
CHANGED
|
@@ -38,6 +38,15 @@ if (CLI.command === "manage") {
|
|
|
38
38
|
process.exit(1);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
+
if (CLI.command === "update-managed") {
|
|
42
|
+
try {
|
|
43
|
+
if (!CLI.yes) throw new Error("Confirm with --yes to install and switch the idle service. You can also use Settings in the WebUI.");
|
|
44
|
+
const { dashboardToolRequest } = await import("../src/cli-tools.mjs");
|
|
45
|
+
const address = parseAdapterAddressOptions(process.env);
|
|
46
|
+
console.log(JSON.stringify((await dashboardToolRequest({ host: address.adapterHost, port: address.adapterPort, path: "settings", body: { action: "update", confirmed: true }, detailedErrors: true })).last_operation));
|
|
47
|
+
process.exit(0);
|
|
48
|
+
} catch (error) { console.error(status("err", error.message));process.exit(1); }
|
|
49
|
+
}
|
|
41
50
|
if (CLI.command === "web") {
|
|
42
51
|
try {
|
|
43
52
|
const { runWebCommand } = await import("../src/cli-web.mjs");
|
|
@@ -95,11 +104,21 @@ if (CLI.command === "image") {
|
|
|
95
104
|
}
|
|
96
105
|
if (CLI.command === "prediction") {
|
|
97
106
|
try {
|
|
98
|
-
if (["
|
|
99
|
-
const {
|
|
107
|
+
if (!["status", "fix"].includes(CLI.action)) {
|
|
108
|
+
const { checkRunningAdapter } = await import("../src/running-adapter.mjs");
|
|
109
|
+
const { dashboardToolRequest } = await import("../src/cli-tools.mjs");
|
|
100
110
|
const address = parseAdapterAddressOptions(process.env);
|
|
101
|
-
|
|
102
|
-
|
|
111
|
+
const running = await checkRunningAdapter({ host: address.adapterHost, port: address.adapterPort });
|
|
112
|
+
const operation = { on: "setup", off: "remove", fix: "repair" }[CLI.action] || CLI.action;
|
|
113
|
+
if (running.ok) {
|
|
114
|
+
const data = await dashboardToolRequest({ host: address.adapterHost, port: address.adapterPort, path: "settings", body: { action: "prediction", operation }, detailedErrors: true, timeoutMs: 210000 });
|
|
115
|
+
const result = data.last_operation?.result || data.features?.prediction;
|
|
116
|
+
console.log(JSON.stringify(result));process.exit(result?.status === "failed" ? 1 : 0);
|
|
117
|
+
}
|
|
118
|
+
if (["enable", "disable", "setup", "remove", "pause", "resume", "open"].includes(operation)) {
|
|
119
|
+
const { controlPrediction } = await import("../src/prediction-control.mjs");
|
|
120
|
+
console.log(JSON.stringify(await controlPrediction(operation)));process.exit(0);
|
|
121
|
+
}
|
|
103
122
|
}
|
|
104
123
|
const { readAdapterStatus } = await import("../src/cli-status.mjs");
|
|
105
124
|
const { runPredictionCommand } = await import("../src/native-prediction.mjs");
|
|
@@ -234,6 +253,24 @@ if (CLI.command === "doctor" && CLI.configOnly) {
|
|
|
234
253
|
process.exit(checks.some((check) => check.kind === "err") ? 1 : 0);
|
|
235
254
|
}
|
|
236
255
|
|
|
256
|
+
let serviceWorker = null;
|
|
257
|
+
if (CLI.command === "start" && !(process.send && process.env.CCDX_SUPERVISED_SERVICE === "1")) {
|
|
258
|
+
const { nightlyUpdatePreference } = await import("../src/user-settings.mjs");
|
|
259
|
+
const { checkRunningAdapter } = await import("../src/running-adapter.mjs");
|
|
260
|
+
|
|
261
|
+
const { installedUpdateEnvironment } = await import("../src/nightly-update.mjs");
|
|
262
|
+
const address = parseAdapterProbeOptions(process.env);
|
|
263
|
+
const existing = await checkRunningAdapter({ host: address.adapterHost, port: address.adapterPort, timeoutMs: address.existingAdapterTimeoutMs });
|
|
264
|
+
let environment;
|
|
265
|
+
try { if (!existing.ok && !existing.incompatible) environment = installedUpdateEnvironment(); }
|
|
266
|
+
catch { if (nightlyUpdatePreference()) console.warn(status("warn", "Dashboard updates need a writable, matching npm installation. Starting without automatic updates.")); }
|
|
267
|
+
if (environment) {
|
|
268
|
+
const { runServiceSupervisor } = await import("../src/service-supervisor.mjs");
|
|
269
|
+
try { process.exit(await runServiceSupervisor({ environment })); }
|
|
270
|
+
catch { console.warn(status("warn", "Nightly runtime preparation failed. Starting without automatic updates.")); }
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
|
|
237
274
|
// Startup components are loaded only after read-only and local tool commands exit.
|
|
238
275
|
const { ensureAuth, openCodex } = await import("../src/launcher.mjs");
|
|
239
276
|
const { startAdapter } = await import("../src/adapter.mjs");
|
|
@@ -257,24 +294,9 @@ const { createTerminalConsole } = await import("../src/terminal-console.mjs");
|
|
|
257
294
|
const { createServiceControl } = await import("../src/service-control.mjs");
|
|
258
295
|
const { openDashboard } = await import("../src/browser-launch.mjs");
|
|
259
296
|
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
const { createServiceWorker } = await import("../src/service-worker.mjs");
|
|
264
|
-
serviceWorker = await createServiceWorker();
|
|
265
|
-
} else if (nightlyUpdatePreference()) {
|
|
266
|
-
const { installedUpdateEnvironment } = await import("../src/nightly-update.mjs");
|
|
267
|
-
const address = parseAdapterProbeOptions(process.env);
|
|
268
|
-
const existing = await checkRunningAdapter({ host: address.adapterHost, port: address.adapterPort, timeoutMs: address.existingAdapterTimeoutMs });
|
|
269
|
-
let environment;
|
|
270
|
-
try { if (!existing.ok && !existing.incompatible) environment = installedUpdateEnvironment(); }
|
|
271
|
-
catch { console.warn(status("warn", "Nightly updates need a writable, matching npm installation. Starting without automatic updates.")); }
|
|
272
|
-
if (environment) {
|
|
273
|
-
const { runServiceSupervisor } = await import("../src/service-supervisor.mjs");
|
|
274
|
-
try { process.exit(await runServiceSupervisor({ environment })); }
|
|
275
|
-
catch { console.warn(status("warn", "Nightly runtime preparation failed. Starting without automatic updates.")); }
|
|
276
|
-
}
|
|
277
|
-
}
|
|
297
|
+
if (CLI.command === "start" && process.send && process.env.CCDX_SUPERVISED_SERVICE === "1") {
|
|
298
|
+
const { createServiceWorker } = await import("../src/service-worker.mjs");
|
|
299
|
+
serviceWorker = await createServiceWorker();
|
|
278
300
|
}
|
|
279
301
|
|
|
280
302
|
let RUNTIME;
|
|
@@ -415,10 +437,9 @@ try {
|
|
|
415
437
|
else if (command.status === "preserved") console.warn(startupCheck("warn", "Command", "Existing launcher preserved; use ccdx.cmd doctor to inspect it"));
|
|
416
438
|
} catch { console.warn(startupCheck("warn", "Command", "Command setup skipped; service will start")); }
|
|
417
439
|
}
|
|
418
|
-
const updateNotice = runInBackground(printUpdateNotice);
|
|
419
440
|
if (!serviceWorker?.warming && await reuseRunningAdapterIfAvailable()) {
|
|
420
441
|
// Ready is already displayed; finish the bounded check before this short-lived CLI exits.
|
|
421
|
-
await
|
|
442
|
+
await printUpdateNotice();
|
|
422
443
|
serviceWorker?.reused();
|
|
423
444
|
startupPresentation.finish();await LOGGING.cleanup();
|
|
424
445
|
process.exit(0);
|
|
@@ -445,7 +466,7 @@ try {
|
|
|
445
466
|
githubCredentialFingerprint: () => profileRuntime.codexCredentialFingerprint,
|
|
446
467
|
log: (kind, message) => console.log(startupComplete ? status(kind, message) : startupCheck(kind, "M365", message)) });
|
|
447
468
|
const codexEnabled = providerRuntime.connections().clients.find(client => client.id === "codex").enabled;
|
|
448
|
-
const predictionSetup = codexEnabled && !serviceWorker?.warming ? runInBackground(() => earlyIntegration.start()) : Promise.resolve(null);
|
|
469
|
+
const predictionSetup = codexEnabled && !serviceWorker?.warming ? runInBackground(() => earlyIntegration.start({ autoSetup: !serviceWorker?.preserving })) : Promise.resolve(null);
|
|
449
470
|
const m365Setup = runInBackground(() => providerRuntime.start());
|
|
450
471
|
if (providerRuntime.selection().codex === "github") {
|
|
451
472
|
try { await ensureAuth({ log: startupLogger("Sign-in"), interactive: serviceWorker?.preserving !== true,
|
|
@@ -483,7 +504,9 @@ try {
|
|
|
483
504
|
snapshot: () => activeServer?.ccdxSnapshot?.() || {},
|
|
484
505
|
subscribe: listener => activeServer?.ccdxSubscribeActivity?.(listener),
|
|
485
506
|
preferences: () => { const { saved, theme, color_theme } = serviceSettingsSnapshot();return { ...saved, theme, color_theme }; } });
|
|
486
|
-
const serviceControl = createServiceControl({ providerRuntime, clientIntegration: earlyIntegration, terminal: terminalConsole,
|
|
507
|
+
const serviceControl = createServiceControl({ providerRuntime, clientIntegration: earlyIntegration, terminal: terminalConsole,
|
|
508
|
+
adapterPort: ADAPTER_PORT, adapterHost: ADAPTER_HOST, manualUpdate: serviceWorker ? () => serviceWorker.requestUpdate() : undefined,
|
|
509
|
+
nightlyStatus: () => serviceWorker?.status() || null, nightlyChanged: enabled => serviceWorker?.preferenceChanged(enabled) });
|
|
487
510
|
const codexModelCatalog = createCodexModelCatalog();
|
|
488
511
|
activeServer = await startAdapter(serviceWorker?.warming ? 0 : ADAPTER_PORT, serviceWorker?.warming ? "127.0.0.1" : ADAPTER_HOST, {
|
|
489
512
|
log: startupLogger("Service"),
|
|
@@ -503,7 +526,7 @@ try {
|
|
|
503
526
|
credentialsChanged: () => { defaultCopilotClient.invalidateCredentials();profileRuntime = createProfileRuntime({ codexClient: defaultCopilotClient }); },
|
|
504
527
|
applyAnimation: theme => terminalConsole.apply({ theme }) },
|
|
505
528
|
nativePredictionPac: () => clientIntegration?.pacUrl() || null,
|
|
506
|
-
fixPrediction: async () => (await
|
|
529
|
+
fixPrediction: async () => (await import("../src/prediction-control.mjs")).controlPrediction("repair", { integration: await clientIntegrations() }),
|
|
507
530
|
clientIntegrationSnapshot: () => clientIntegration?.snapshot() || null,
|
|
508
531
|
});
|
|
509
532
|
|
|
@@ -536,6 +559,7 @@ try {
|
|
|
536
559
|
|
|
537
560
|
startupComplete = true;
|
|
538
561
|
if (!startupPresentation.enabled) console.log(startupReady({ baseUrl: adapterBaseUrl(ADAPTER_HOST, ADAPTER_PORT), commandName: CLI_NAME }));
|
|
562
|
+
runInBackground(printUpdateNotice);
|
|
539
563
|
await launchDashboard();
|
|
540
564
|
if (!serviceWorker?.warming) {
|
|
541
565
|
startupPresentation.finish();for (const [method, args] of startupPresentation.warnings) terminalConsole.log(method, args);
|
|
@@ -571,7 +595,7 @@ try {
|
|
|
571
595
|
const { clientStateFingerprint, serviceBusinessState } = await import("../src/service-worker.mjs");
|
|
572
596
|
if (serviceWorker.preserving) providerRuntime.validateLocalKeys();
|
|
573
597
|
await serviceWorker.ready({
|
|
574
|
-
notice: code => console.warn(status("warn", `
|
|
598
|
+
notice: code => console.warn(status("warn", `Update notice: ${code}. See Checks & repairs in the WebUI.`)),
|
|
575
599
|
stop: () => shutdown("supervisor"),
|
|
576
600
|
exportState: () => ({ ...activeServer.ccdxExportState(), providers: providerRuntime.exportPrivateState() }),
|
|
577
601
|
importState: async state => { await activeServer.ccdxImportState(state);providerRuntime.importPrivateState(state.providers); },
|
|
@@ -582,13 +606,13 @@ try {
|
|
|
582
606
|
},
|
|
583
607
|
resume: async () => {
|
|
584
608
|
if (!activeServer.listening) await new Promise((resolve, reject) => { activeServer.once("error", reject);activeServer.listen(ADAPTER_PORT, ADAPTER_HOST, () => { activeServer.off("error", reject);resolve(); }); });
|
|
585
|
-
await earlyIntegration.start();earlyIntegration.setPredictionActive(servicePreferences().prediction_enabled);
|
|
609
|
+
await earlyIntegration.start({ autoSetup: false });earlyIntegration.setPredictionActive(servicePreferences().prediction_enabled);
|
|
586
610
|
await LOGGING.cleanup();LOGGING = configureLogging();terminalConsole.start();LOGGING.setTerminalSink((method, args) => terminalConsole.log(method, args));
|
|
587
611
|
},
|
|
588
612
|
promote: async () => {
|
|
589
613
|
await closeHttpServer(activeServer, { timeoutMs: RUNTIME.shutdownTimeoutMs });
|
|
590
614
|
await new Promise((resolve, reject) => { activeServer.once("error", reject);activeServer.listen(ADAPTER_PORT, ADAPTER_HOST, () => { activeServer.off("error", reject);resolve(); }); });
|
|
591
|
-
if (codexEnabled) { nativePrediction = await earlyIntegration.start();await nativePrediction?.prepareRoute();earlyIntegration.setPredictionActive(servicePreferences().prediction_enabled); }
|
|
615
|
+
if (codexEnabled) { nativePrediction = await earlyIntegration.start({ autoSetup: false });await nativePrediction?.prepareRoute();earlyIntegration.setPredictionActive(servicePreferences().prediction_enabled); }
|
|
592
616
|
},
|
|
593
617
|
activate: async () => {
|
|
594
618
|
await LOGGING.cleanup();try { LOGGING = configureLogging(); } catch { LOGGING = configureLogging({ env: { ...process.env, CCDX_LOG_PATH: "" } }); }
|
|
@@ -598,7 +622,7 @@ try {
|
|
|
598
622
|
const data = activeServer.ccdxSnapshot(), routes = data.requests.by_route;
|
|
599
623
|
let fingerprint = null;try { fingerprint = clientStateFingerprint(); } catch {}
|
|
600
624
|
return { version: LOCAL_VERSION, fingerprint, business: serviceBusinessState(providerRuntime),
|
|
601
|
-
busy: !fingerprint || activeServer.ccdxBusy() || clientIntegration.busy() || data.models.refresh_in_flight === true || data.model_activity.active === null,
|
|
625
|
+
busy: !fingerprint || activeServer.ccdxBusy() || clientIntegration.busy() || serviceControl.busy() || data.models.refresh_in_flight === true || data.model_activity.active === null,
|
|
602
626
|
health: { github: profileRuntime.codexClient.runtimeStatus().token_cached === true && !profileModels.codexRegistry.lastError,
|
|
603
627
|
m365: data.providers?.m365?.state === "ready", prediction: earlyIntegration.bridgeHealthy() },
|
|
604
628
|
activity: { active: data.model_activity.active || 0, total: ["responses", "responses_compact", "messages"].reduce((n, key) => n + (routes[key]?.total || 0), data.image_generation?.total || 0) } };
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -1056,9 +1056,9 @@ changes, rotation, incomplete tails, warnings and oversized results rebuild thro
|
|
|
1056
1056
|
the original full scan. No persistent index, polling or per-token work is added.
|
|
1057
1057
|
### Local masking boundary
|
|
1058
1058
|
|
|
1059
|
-
`local-privacy.mjs` owns explicit consent, per-request policy snapshots, a private placeholder seed and bounded shared detection metadata. It wraps provider calls after authorization/model resolution without changing the prepared request used by local history. Completed history records restore client-visible values while signed and encrypted state stays opaque. `privacy-transform.mjs` projects
|
|
1059
|
+
`local-privacy.mjs` owns explicit consent, per-request policy snapshots, a private placeholder seed and bounded shared detection metadata. It wraps provider calls after authorization/model resolution without changing the prepared request used by local history. Completed history records restore client-visible values while signed and encrypted state stays opaque. `privacy-transform.mjs` projects supported text fields, including Responses Lite inline tool descriptions. Tool data has its own recursive restoration context, so field names and values that resemble protocol state do not exempt ordinary arguments. Restored SSE fragments retain their wire metadata; Responses custom tool input shares text's cross-fragment restoration. Tool JSON is emitted once complete, before its terminal block, and incomplete parameters are discarded on an upstream failure. It does not take ownership of credentials or select providers.
|
|
1060
1060
|
|
|
1061
|
-
`privacy-model.mjs` owns verified, optional downloads and a stdio-only child process. The npm dependency graph is unchanged. Model files are revision/SHA256 pinned; the executable is verified against the fixed component Release's checksum manifest. The downloader reuses the selected npm's network policy. Startup warms only already-downloaded, explicitly enabled protection; opening Settings never downloads a model.
|
|
1061
|
+
`privacy-model.mjs` owns verified, optional downloads and a stdio-only child process. The production npm dependency graph is unchanged. Model files are revision/SHA256 pinned; the executable is verified against the fixed component Release's checksum manifest. The downloader reuses the selected npm's network policy. Startup warms only already-downloaded, explicitly enabled protection; opening Settings never downloads a model.
|
|
1062
1062
|
|
|
1063
1063
|
Disabled calls retain their original provider function and body. Enabled calls await a complete check. A frontend check deadline rejects without contacting the provider; shared native work is bounded and may populate the metadata cache for another waiter. Cancellation does not cancel another request's shared work. Native input, jobs, cache and reply buffers have finite budgets; no prompt or mapping database is introduced. The child inherits only required system environment fields, not API keys or sign-in tokens.
|
|
1064
1064
|
|
|
@@ -1066,4 +1066,16 @@ The Magpie-derived Go tokenizer/INT8 classifier is built for four macOS/Windows
|
|
|
1066
1066
|
|
|
1067
1067
|
Progress and readiness share the existing coalesced activity SSE. The settings controller only reads status while visible and uses a bounded-action fallback when event updates are absent. Main-page preference revisions are refreshed after masking choices change. Protected request details add replacement count and local-check duration; other request rows retain their current layout.
|
|
1068
1068
|
|
|
1069
|
+
Local privacy failures carry a separate origin. Request-check and response-restoration messages state different outcomes. Explicit failed tool results in the latest Messages input add only a count to request metadata, without retaining their content or changing a successful model response into a claim of tool-workflow success. SDK tests use independent client parsers; native CLI replays execute a local MCP fixture in temporary profiles, return its result and require the following response to complete.
|
|
1070
|
+
|
|
1069
1071
|
Claude passthrough now holds incomplete SSE frames and validates complete data before forwarding. Malformed tails do not precede the terminal error; valid final JSON without a newline remains deliverable. Capability restoration and replacement writes use the existing ownership journal in one transaction, preserving both files and ownership on failure.
|
|
1072
|
+
|
|
1073
|
+
## WebUI feature controls
|
|
1074
|
+
|
|
1075
|
+
`service-control.mjs` serializes management actions and projects saved/effective state. WebUI and CLI prediction/update commands call this same boundary. `prediction-control.mjs` coordinates existing native setup, bridge lifecycle and App launch; `prediction-preference.mjs` owns the closed-App display-setting transaction across desktop TOML and legacy state. A pending display write is explicit and never reported as visible-suggestion proof. Fresh default setup runs only before App launch and preserves saved off choices.
|
|
1076
|
+
|
|
1077
|
+
`image-setup.mjs` owns image provider inspection and the existing atomic config/credential and guidance transaction. CLI owns terminal prompts; `dashboard/features.js` owns browser forms. Neither renderer receives saved image keys. The model compatibility action uses `doctor-compat.mjs` through local tools and requires explicit quota confirmation.
|
|
1078
|
+
|
|
1079
|
+
The existing supervisor accepts a bounded manual update request as well as its optional nightly scheduler. Both use the same staged package verification, immutable worker, state-transfer, installation commit and rollback path. Manual and scheduled updates are mutually exclusive; settings operations contribute to busy state and image configuration and stable prediction intent/trust participate in the state fingerprint; native port allocation and App stat bookkeeping do not. Warm handoff suppresses first-time prediction setup and pending display writes. Explicit prediction reconfiguration replaces the old bridge after committing trust. An unowned installation falls back to the existing standalone launch and exposes that self-update is unavailable. No inference protocol, privacy transport or native authentication path is changed by these controls.
|
|
1080
|
+
|
|
1081
|
+
Native discovery, configuration and startup environment inspection run in bounded temporary `prediction-operations.mjs` workers. PowerShell, certificate and filesystem work do not block the gateway event loop. Registered-App discovery precedes default trust/proxy setup; missing Apps leave core startup available. Private environment results feed only bridge initialization and are not returned by WebUI actions.
|
package/docs/REFERENCE.md
CHANGED
|
@@ -242,9 +242,38 @@ client after its owned configuration changes. All tests using sample capabilitie
|
|
|
242
242
|
are isolated; they do not assign sample limits to a user's real models.
|
|
243
243
|
|
|
244
244
|
|
|
245
|
+
## WebUI and CLI controls
|
|
246
|
+
|
|
247
|
+
Normal management belongs in the WebUI. CLI provides the same backend operations plus scripting and recovery:
|
|
248
|
+
|
|
249
|
+
| WebUI task | CLI | Effect |
|
|
250
|
+
| --- | --- | --- |
|
|
251
|
+
| Accounts, APIs and models | `source`, `app <id> models` | Shared connection graph, catalogs and credential storage |
|
|
252
|
+
| Client access and synchronization | `app <id> enable/disable/sync` | Preview/recheck ownership; no forced App exit |
|
|
253
|
+
| Delete a disabled, unbound API | `source <id> remove` | Shared impact revision; selected consumers block deletion |
|
|
254
|
+
| Input suggestions: enable/disable | `app codex prediction enable/disable` | Synchronize bridge preference and native Show predictions |
|
|
255
|
+
| Prediction setup/remove/repair/open | `app codex prediction setup/remove/repair/open` | Shared control; App closure may be required |
|
|
256
|
+
| Images: configure/remove/pause/resume | `app codex image setup/remove/pause/resume` | Shared image configuration transaction; keys never returned by WebUI |
|
|
257
|
+
| Install a stable update | `update apply --yes` | Same supervisor request; download, verify and idle service handoff |
|
|
258
|
+
| Standalone update/recovery | `update github/npm`, `doctor` | Available when service management is unavailable |
|
|
259
|
+
| Local/network checks, repair and report | `doctor`, `doctor network/report`, `doctor --fix` | Existing checks and configuration repair |
|
|
260
|
+
| Explicit model compatibility test | `doctor --compat` | Finite Codex Responses/stream/compaction requests; supports vendor IDs; local client credential stays on loopback; WebUI confirms quota use |
|
|
261
|
+
| Decoded request limit | `config limits --decoded <MiB>` | 128–512 MiB; saved for next start; launch environment has priority |
|
|
262
|
+
| Usage, requests, appearance and backups | `usage`, `requests`, `config` | Shared service data/preferences; browser appearance stays browser-local |
|
|
263
|
+
|
|
264
|
+
CLI-only interaction forms include JSON output, file input, key stdin and shell pipelines. Initial installation/startup, a failed service and headless hosts need an external launch/recovery entrypoint. These are not prerequisites for prediction or image configuration. Full runtime-cache purges, batch/file/key-stdin input, JSON formatting and one-installation remote-download exceptions remain advanced CLI operations. Company policy changes remain outside CCDX control.
|
|
265
|
+
|
|
266
|
+
## Prediction controls
|
|
267
|
+
|
|
268
|
+
WebUI → Codex → Input suggestions is the complete enable/disable control. Setup and explicit enable write only `desktop.composer-predictions-enabled` in Codex TOML and its legacy persisted-atom equivalent; unrelated configuration/state remains intact. Writes require Codex to be closed. An open App keeps a pending display change; quit it and Continue setup, or normally launch CCDX again. The WebUI can open Codex after setup without a terminal command. No running App is forcibly closed.
|
|
269
|
+
|
|
270
|
+
Native configuration and startup environment checks use temporary work threads so OS/crypto work does not block the core service. Missing Apps are checked before trust/proxy setup. A normal cold startup attempts setup once when no CCDX prediction record exists, prediction access is allowed, and the App display preference is not saved off. Failed setup leaves core startup available and can be completed in WebUI. Saved off records and App off choices are preserved. Explicit enable intentionally overrides a prior App display-off setting. Repair keeps the selected on/off intent. Disable retains trust and routing; Remove setup owns trust/route cleanup and may defer cleanup until Codex closes. Visible predictions still require native App/thread eligibility and an actual returned suggestion.
|
|
271
|
+
|
|
272
|
+
Installed command launches use the existing supervisor and immutable workers. WebUI updates preserve accounts, models and request continuation through verified handoff; failure rolls back to the previous installation/runtime. Warm version handoff does not perform first-time setup or apply pending App display writes. Prediction intent/trust participates in the handoff fingerprint; port allocation and App stat bookkeeping are runtime data. Manual updates do not enable the overnight schedule, do not downgrade, and defer while requests or settings operations are active. Launches outside a writable matched installation display their limitation explicitly.
|
|
273
|
+
|
|
245
274
|
## Optional native predictions
|
|
246
275
|
|
|
247
|
-
|
|
276
|
+
New native next-message integrations **attempt setup by default when Codex is closed**. Existing CCDX or App off choices are retained. They use no MCP, Hook, skill,
|
|
248
277
|
panel, renderer injection, or client-program modification. This compatibility
|
|
249
278
|
feature uses the App's existing composer UI and the conversation's
|
|
250
279
|
selected model through CCDX. Suggestions are not sent automatically. Native
|
|
@@ -429,9 +458,9 @@ No extra inference or bridge exists for users who leave the feature disabled.
|
|
|
429
458
|
When enabled, prediction requests consume Copilot usage; the setting does not
|
|
430
459
|
provide a separate prediction-model picker.
|
|
431
460
|
|
|
432
|
-
`prediction
|
|
461
|
+
`app codex prediction remove` immediately disables new local overlays. Quit/reopen Codex to
|
|
433
462
|
clear its cached predictions and temporary route. If the App is still running,
|
|
434
|
-
trust removal is deferred; quit it and
|
|
463
|
+
trust removal is deferred; quit it and use Remove setup in WebUI again. Only the exact
|
|
435
464
|
owned certificate record is removed, never the whole store. A CCDX-owned persistent
|
|
436
465
|
proxy preference is restored first, preserving all unrelated preference values.
|
|
437
466
|
User-replaced proxy preferences are not restored over. Failed activation
|
|
@@ -542,7 +571,7 @@ was recreated on the original address, not that gray text appeared.
|
|
|
542
571
|
|
|
543
572
|
## Optional image generation
|
|
544
573
|
|
|
545
|
-
Image generation is disabled by default. Configure it
|
|
574
|
+
Image generation is disabled by default. Configure it in WebUI → Codex → Image generation: enter an HTTPS address and key, read models, choose one and save. An empty key retains the existing key only for the same origin. Discovery and saving use the existing missing-prompt protocol check; they do not generate an image. Removing setup deletes the saved image credential and only CCDX-owned configuration/guidance. Existing calls may finish when pausing. The same setup transaction is available interactively for advanced CLI use:
|
|
546
575
|
|
|
547
576
|
```bash
|
|
548
577
|
ccdx app codex image setup
|
|
@@ -554,7 +583,7 @@ An empty key answer retains the saved key only when the normalized endpoint has
|
|
|
554
583
|
|
|
555
584
|
The provider credential is stored in `~/.config/codex-copilot-dx/image-provider.json`, or under `XDG_CONFIG_HOME`, with mode `0600`. The API key is never written to `~/.codex/config.toml`; that file receives only a marked local MCP entry pointing to the running CCDX adapter with a 210-second tool timeout. Only after enabling, CCDX installs `ccdx-image` guidance under `~/.codex/skills`, with a self-contained Node helper. The concise `SKILL.md` keeps operation selection, safety, and final-image delivery rules; editing details and helper instructions live in references read only for those operations. Codex uses the MCP tool directly, including through deferred tool search; an already-open task without that tool can use the helper to call the same local service and display the saved image. Neither route requires Python, an OpenAI SDK, or copying credentials. Built-in skills and unrelated tools are not modified.
|
|
556
585
|
|
|
557
|
-
The enable command verifies the local MCP handshake and generation-tool directory without generating an image. It reports provider configuration separately from local service readiness; it cannot assert that every running Codex task has refreshed its catalog. Codex normally detects changed skills; restart Codex App once if an open task has not refreshed them. Normal CCDX startup installs or updates this guidance only for an already-enabled provider, without repeating API setup. Without
|
|
586
|
+
The enable command verifies the local MCP handshake and generation-tool directory without generating an image. It reports provider configuration separately from local service readiness; it cannot assert that every running Codex task has refreshed its catalog. Codex normally detects changed skills; restart Codex App once if an open task has not refreshed them. Normal CCDX startup installs or updates this guidance only for an already-enabled provider, without repeating API setup. Without image setup, it installs neither this skill nor the MCP registration. Unchanged guidance is not rewritten. The existing adapter can remain running because provider settings are loaded when the tool is invoked.
|
|
558
587
|
|
|
559
588
|
For Qwen-style image responses, CCDX accepts canonical PNG, JPEG, or WebP `data:image/...;base64,` output within the existing 32 MiB image limit. Public HTTPS image URLs still use the same pinned-DNS download checks; HTTP, private-network targets, and URLs with embedded credentials remain rejected.
|
|
560
589
|
|
|
@@ -746,10 +775,14 @@ Covered text includes conversation instructions, message text, tool results, too
|
|
|
746
775
|
|
|
747
776
|
Rules and a local model replace detected values with stable placeholders. Replies and tool arguments restore their values before delivery. The placeholder seed is private local configuration; original-value mappings live only with the request and are never added to CCDX logs or backups. A restart retains the seed, not the mappings. Local history keeps client-visible text rather than placeholders.
|
|
748
777
|
|
|
778
|
+
Tool data is interpreted in its own context: ordinary argument fields named `id`, `signature`, `data` or `type` are restored, while protocol identifiers and signed blocks remain unchanged. Streaming restoration retains SSE event metadata and restores Responses custom-tool text across fragments. Incomplete parameters are discarded when the upstream emits a failure rather than replacing that failure with a restoration error.
|
|
779
|
+
|
|
749
780
|
Each request pins its masking choice, including compatibility retries. A check exceeding 15 seconds is rejected before any upstream call; bounded local work can continue for up to five minutes so a retry can reuse its complete results. No request is sent using an incomplete model check. Model work is capped at eight jobs and 16 MiB queued input; text input per call is capped at 8 MiB. Detection metadata uses a 5,000-entry/4 MiB memory cache. CPU-only first checks of long histories can take substantially longer than cached checks.
|
|
750
781
|
|
|
751
782
|
Turning masking off affects subsequent requests. Existing protected replies keep their restoration mappings until they finish. The downloaded component can then be deleted separately. Settings reset backs up and resets masking choices while keeping accounts, model selections, client connections, images and prediction access. Older settings backups inherit masking off.
|
|
752
783
|
|
|
753
784
|
Try locally sends sample text only to the local component. Request records show the number of replacements and elapsed local-check time, never the original values. Download failures keep protection off; configured but unavailable protection refuses covered requests. Downloads retain the selected npm's proxy, certificate and offline policy, with no automatic policy relaxation or alternate downloader.
|
|
754
785
|
|
|
786
|
+
Privacy failures have a separate local diagnostic origin. Response-restoration failures report that the response was stopped; request-check failures report that nothing was sent. When the latest Messages input explicitly contains failed tool results, request details show their count without retaining their content. HTTP success describes the model response, not proof that a client executed its tools successfully.
|
|
787
|
+
|
|
755
788
|
The optional component is pinned to the v1.3.6 Release; later code-only updates can reuse it. Its source and license notices are in `native/privacy-guard` and `src/privacy-notices.txt`. AstrLink Guard model files use their publisher's Apache-2.0 license.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "codex-copilot-dx",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.8",
|
|
4
4
|
"description": "Local gateway for Codex and Claude with Copilot, Microsoft 365 and custom APIs",
|
|
5
5
|
"author": "Dale Xiao",
|
|
6
6
|
"type": "module",
|
|
@@ -67,5 +67,9 @@
|
|
|
67
67
|
"cpu": [
|
|
68
68
|
"x64",
|
|
69
69
|
"arm64"
|
|
70
|
-
]
|
|
70
|
+
],
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@anthropic-ai/sdk": "1.3.0",
|
|
73
|
+
"openai": "7.43.0"
|
|
74
|
+
}
|
|
71
75
|
}
|
package/src/claude-gateway.mjs
CHANGED
|
@@ -150,6 +150,7 @@ export function createClaudeGatewayHandler({ provider, apiKey, desktopAliases =
|
|
|
150
150
|
abort.setTimeout(config.upstreamTimeoutMs, "messages_prepare_timeout");
|
|
151
151
|
observeRequestedModel(body);
|
|
152
152
|
context.requestOptions = requestOptionsEvidence(body);
|
|
153
|
+
if (context.requestOptions.client_tool_errors_received) markRequestObservation({ client_tool_errors_received: context.requestOptions.client_tool_errors_received });
|
|
153
154
|
if (!body || typeof body.model !== "string" || !Array.isArray(body.messages)) {
|
|
154
155
|
send(res, 400, apiError("ccdx_messages_invalid", "Expected a model and messages array"));return;
|
|
155
156
|
}
|
|
@@ -257,7 +258,7 @@ export function createClaudeGatewayHandler({ provider, apiKey, desktopAliases =
|
|
|
257
258
|
const detail = operationErrorDetails(error, { reason: abort.reason });
|
|
258
259
|
outcome = detail.source === "cancelled" ? "cancelled" : "failed";
|
|
259
260
|
const statusCode = detail.status || (abort.reason ? abortErrorStatusCode(abort.reason) : 502);
|
|
260
|
-
failureStatus = statusCode;terminalOrigin = outcome === "cancelled" ? "client_disconnect" : statusCode < 500 && statusCode !== 429 ? "client_validation" : "transport";
|
|
261
|
+
failureStatus = statusCode;terminalOrigin = outcome === "cancelled" ? "client_disconnect" : error.origin === "privacy" ? "privacy" : statusCode < 500 && statusCode !== 429 ? "client_validation" : "transport";
|
|
261
262
|
context.errorOrigin = terminalOrigin;
|
|
262
263
|
const message = redactDiagnosticText(error.message).split(apiKey).join("[redacted]").slice(0, 240);
|
|
263
264
|
const diagnostic = error.code === "ccdx_api_network_unavailable" ? transportErrorDetails(error) : null;
|
package/src/cli-command-spec.mjs
CHANGED
|
@@ -126,8 +126,8 @@ export const MANAGED_COMMANDS = [
|
|
|
126
126
|
outputFormat: flags.format,
|
|
127
127
|
})
|
|
128
128
|
),
|
|
129
|
-
...["setup", "remove", "pause", "resume", "repair"].map(action =>
|
|
130
|
-
command(`app codex prediction ${action}`, "
|
|
129
|
+
...["enable", "disable", "setup", "remove", "pause", "resume", "repair", "open"].map(action =>
|
|
130
|
+
command(`app codex prediction ${action}`, ({ enable: "Enable suggestions and synchronize native display", disable: "Disable suggestions; synchronize display after App closure", setup: "Configure or renew App trust and suggestion display", remove: "Remove owned prediction trust and routing", pause: "Pause suggestions while retaining setup", resume: "Resume a configured prediction integration", repair: "Check and restore the selected prediction state", open: "Open Codex with the configured prediction route" })[action], {}, () => ({
|
|
131
131
|
command: "prediction",
|
|
132
132
|
action: { setup: "on", remove: "off", repair: "fix" }[action] || action,
|
|
133
133
|
}))
|
|
@@ -188,6 +188,7 @@ export const MANAGED_COMMANDS = [
|
|
|
188
188
|
"--provider": "value",
|
|
189
189
|
}),
|
|
190
190
|
command("update check", "Check a stable release without installing", read),
|
|
191
|
+
command("update apply", "Request the WebUI's verified idle service update", { "--yes": "flag" }, flags => ({ command: "update-managed", yes: !!flags.yes })),
|
|
191
192
|
];
|
|
192
193
|
|
|
193
194
|
function pathMatch(pattern, values, partial = false) {
|
package/src/cli-image.mjs
CHANGED
|
@@ -1,21 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { fileContent, enableImageProvider, disableImageProvider } from "./image-setup.mjs";
|
|
2
|
+
export { syncEnabledImageSkill } from "./image-setup.mjs";
|
|
2
3
|
import os from "node:os";
|
|
3
4
|
import readline from "node:readline";
|
|
4
5
|
import { createInterface } from "node:readline/promises";
|
|
5
6
|
import { codexPaths } from "./codex-paths.mjs";
|
|
6
|
-
import { withFileLockSync } from "./lock.mjs";
|
|
7
|
-
import { atomicWriteFileIfChangedSync, atomicWriteFilePairSync } from "./atomic-file.mjs";
|
|
8
7
|
import { terminalCell } from "./cli-table.mjs";
|
|
9
|
-
import { computeImageMcpCodexConfig } from "./config.mjs";
|
|
10
8
|
import { probeImageTool } from "./image-readiness.mjs";
|
|
11
|
-
import { updateImageSkill } from "./image-skill.mjs";
|
|
12
9
|
import { servicePreferences, writeServicePreference } from "./user-settings.mjs";
|
|
13
10
|
import {
|
|
14
11
|
imageProviderConfigPath,
|
|
15
12
|
inspectImageProvider,
|
|
16
13
|
normalizeImageEndpoint,
|
|
17
14
|
readImageProviderConfig,
|
|
18
|
-
validateImageProviderConfig,
|
|
19
15
|
} from "./image-provider-config.mjs";
|
|
20
16
|
async function visibleQuestion(input, output, question) {
|
|
21
17
|
const prompt = createInterface({ input, output });
|
|
@@ -61,17 +57,6 @@ export function hiddenQuestion(input, output, question, { cancelMessage = "Image
|
|
|
61
57
|
});
|
|
62
58
|
}
|
|
63
59
|
|
|
64
|
-
function fileContent(filePath) {
|
|
65
|
-
try { return new TextDecoder("utf-8", { fatal: true, ignoreBOM: true }).decode(fs.readFileSync(filePath)); }
|
|
66
|
-
catch (error) {
|
|
67
|
-
if (error?.code === "ENOENT") return "";
|
|
68
|
-
if (error?.code === "ERR_ENCODING_INVALID_ENCODED_DATA") {
|
|
69
|
-
throw new Error("Codex configuration is not valid UTF-8 TOML; no configuration changes were written");
|
|
70
|
-
}
|
|
71
|
-
throw error;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
60
|
function chooseModelLines(modelIds, selected) {
|
|
76
61
|
return modelIds.map((model, index) => ` ${index + 1}. ${terminalCell(model)}${model === selected ? " [current]" : ""}`);
|
|
77
62
|
}
|
|
@@ -99,69 +84,6 @@ function configSummary(config) {
|
|
|
99
84
|
};
|
|
100
85
|
}
|
|
101
86
|
|
|
102
|
-
function enableImageProvider(options) {
|
|
103
|
-
return withFileLockSync(`${options.codexPath}.ccdx.lock`, () => enableImageProviderUnlocked(options));
|
|
104
|
-
}
|
|
105
|
-
function enableImageProviderUnlocked({ providerConfig, providerPath, codexPath, codexContent, adapterPort, adapterHost }) {
|
|
106
|
-
const codex = computeImageMcpCodexConfig(codexContent, {
|
|
107
|
-
enabled: true,
|
|
108
|
-
adapterPort,
|
|
109
|
-
adapterHost,
|
|
110
|
-
});
|
|
111
|
-
const normalized = validateImageProviderConfig(providerConfig, { filePath: providerPath });
|
|
112
|
-
const skill = updateImageSkill({ enabled: true, codexPath, adapterPort, adapterHost });
|
|
113
|
-
try {
|
|
114
|
-
if (fileContent(codexPath) !== codexContent) {
|
|
115
|
-
throw new Error("Codex configuration changed during image setup; retry to preserve the newer settings");
|
|
116
|
-
}
|
|
117
|
-
atomicWriteFilePairSync(
|
|
118
|
-
codexPath,
|
|
119
|
-
codex.content,
|
|
120
|
-
providerPath,
|
|
121
|
-
`${JSON.stringify(normalized, null, 2)}\n`,
|
|
122
|
-
{ mode: 0o600, writeFile: atomicWriteFileIfChangedSync },
|
|
123
|
-
);
|
|
124
|
-
} catch (error) {
|
|
125
|
-
skill.rollback();
|
|
126
|
-
throw error;
|
|
127
|
-
}
|
|
128
|
-
return { codexChanged: codex.changed, config: normalized };
|
|
129
|
-
}
|
|
130
|
-
|
|
131
|
-
function disableImageProvider(options) {
|
|
132
|
-
if (!fs.existsSync(options.codexPath)) return disableImageProviderUnlocked(options);
|
|
133
|
-
return withFileLockSync(`${options.codexPath}.ccdx.lock`, () => disableImageProviderUnlocked(options));
|
|
134
|
-
}
|
|
135
|
-
function disableImageProviderUnlocked({ providerPath, codexPath, codexContent, adapterPort, adapterHost }) {
|
|
136
|
-
const codex = computeImageMcpCodexConfig(codexContent, {
|
|
137
|
-
enabled: false,
|
|
138
|
-
adapterPort,
|
|
139
|
-
adapterHost,
|
|
140
|
-
});
|
|
141
|
-
const providerExists = fs.existsSync(providerPath);
|
|
142
|
-
const skill = updateImageSkill({ enabled: false, codexPath, adapterPort, adapterHost });
|
|
143
|
-
try {
|
|
144
|
-
if (fs.existsSync(codexPath)) {
|
|
145
|
-
if (fileContent(codexPath) !== codexContent) {
|
|
146
|
-
throw new Error("Codex configuration changed during image cleanup; retry to preserve the newer settings");
|
|
147
|
-
}
|
|
148
|
-
atomicWriteFilePairSync(codexPath, codex.content, providerPath, null, {
|
|
149
|
-
mode: 0o600, writeFile: atomicWriteFileIfChangedSync,
|
|
150
|
-
});
|
|
151
|
-
} else if (providerExists) {
|
|
152
|
-
fs.unlinkSync(providerPath);
|
|
153
|
-
}
|
|
154
|
-
} catch (error) {
|
|
155
|
-
skill.rollback();
|
|
156
|
-
throw error;
|
|
157
|
-
}
|
|
158
|
-
return { changed: providerExists || codex.changed || skill.changed, preservedGuidance: Boolean(skill.preserved) };
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
export function syncEnabledImageSkill({ home = os.homedir(), env = process.env, codexPath = codexPaths({ env, home }).config, ...options } = {}) {
|
|
162
|
-
return updateImageSkill({ ...options, enabled: true, codexPath });
|
|
163
|
-
}
|
|
164
|
-
|
|
165
87
|
function printImageReadiness(readiness, output, commandName) {
|
|
166
88
|
if (readiness.ready) {
|
|
167
89
|
output.write("Local image service: ready (generation tool verified; no image generated).\n");
|
package/src/cli-options.mjs
CHANGED
|
@@ -92,7 +92,7 @@ export function cliCommandName() {
|
|
|
92
92
|
|
|
93
93
|
const integrationNotes = {
|
|
94
94
|
prediction:
|
|
95
|
-
"
|
|
95
|
+
"New Codex integrations attempt prediction setup by default and preserve saved off choices. Setup enables native Show predictions; enable/disable synchronizes display, with pending changes while Codex is running. WebUI provides setup, removal, repair and App opening. Windows requires the initialized official MSIX App profile, Windows PowerShell and .NET Framework 4.7.2+; Git/OpenSSL is not required. The bridge port persists across restarts/updates; a busy saved port disables predictions only. Setup/removal requires Codex to be closed; WebUI starts the bridge without a core restart. Offline CLI setup needs the next normal CCDX launch. HTTPS on chatgpt.com and ab.chatgpt.com is decrypted locally; only prediction configuration is changed. App-profile trust and routing are used; no OS trust or client program files are changed. Proxy/PAC policy is preserved. Repair never enables predictions or force-restarts Codex. Environment trust changes require a service restart.",
|
|
96
96
|
image:
|
|
97
97
|
"Setup configures the image API and private credential without generating an image. An empty key keeps the saved key only for the same origin. Pause keeps credentials; remove deletes the stored image credential and unchanged CCDX guidance.",
|
|
98
98
|
review:
|
|
@@ -5,17 +5,24 @@ import { runInBackground } from "./startup.mjs";
|
|
|
5
5
|
import { createPredictionState } from "./native-prediction-state.mjs";
|
|
6
6
|
import { supervisePrediction } from "./native-prediction-recovery.mjs";
|
|
7
7
|
import { operationErrorDetails } from "./operation-error.mjs";
|
|
8
|
+
import { runPredictionOperation } from "./prediction-operations.mjs";
|
|
8
9
|
|
|
9
10
|
// The CLI composes the services; this module owns optional client integration
|
|
10
11
|
// lifecycle. It never forwards model requests or depends on dashboard rendering.
|
|
11
12
|
export function createClientIntegration({ port, host, info = () => {}, warning = () => {}, configLog,
|
|
12
|
-
startPrediction = async options =>
|
|
13
|
+
startPrediction = async options => {
|
|
14
|
+
const preparation = options.environment ? { configured: true, environment: options.environment }
|
|
15
|
+
: await runPredictionOperation("startup", { autoSetup: options.autoSetup, env: process.env, platform: process.platform });
|
|
16
|
+
if (!preparation.configured) { options.state?.configure(false);return null; }
|
|
17
|
+
return (await import("./native-prediction.mjs")).startNativePrediction({ ...options, autoSetup: false, environment: preparation.environment });
|
|
18
|
+
} } = {}) {
|
|
13
19
|
const prediction = createPredictionState();
|
|
14
20
|
let native = null;
|
|
15
21
|
let operation = null, operationName = null, closed = false;
|
|
16
22
|
let pendingRoutePid = null, codexSetup = null;
|
|
17
|
-
async function startPredictionBridge(expectedPort, environment) {
|
|
23
|
+
async function startPredictionBridge(expectedPort, environment, autoSetup = false) {
|
|
18
24
|
const started = await startPrediction({ state: prediction, warning: info,
|
|
25
|
+
autoSetup,
|
|
19
26
|
...(environment ? { environment } : {}), ...(expectedPort ? { expectedPort } : {}) });
|
|
20
27
|
if (!started) return null;
|
|
21
28
|
if (closed) { await started.close();return null; }
|
|
@@ -65,9 +72,9 @@ export function createClientIntegration({ port, host, info = () => {}, warning =
|
|
|
65
72
|
}
|
|
66
73
|
return { imageEnabled: enabled, imageMcpSkipped, compressionSetup: runInBackground(ensureCodexThreadCompression) };
|
|
67
74
|
},
|
|
68
|
-
start() { return serialize("start", async () => {
|
|
75
|
+
start({ autoSetup = true } = {}) { return serialize("start", async () => {
|
|
69
76
|
try {
|
|
70
|
-
native ||= await startPredictionBridge();
|
|
77
|
+
native ||= await startPredictionBridge(undefined, undefined, autoSetup);
|
|
71
78
|
} catch (error) { prediction.unavailable(error); warning(`${error.message}. Core startup will continue.`); }
|
|
72
79
|
return native;
|
|
73
80
|
}); },
|
|
@@ -69,6 +69,10 @@
|
|
|
69
69
|
const toggle = node("input");toggle.type = "checkbox";toggle.checked = true;toggle.setAttribute("role", "switch");toggle.setAttribute("aria-label", format("api_disable_source") + " " + provider.name);
|
|
70
70
|
toggle.addEventListener("change", () => { toggle.checked = true;disableSource(provider); });const hit = node("label", undefined, "switch-hit");hit.append(toggle);actions.append(hit);
|
|
71
71
|
} else actions.append(button("api_restore", () => void change({ operation: "provider", id: provider.id, enabled: true })));
|
|
72
|
+
if (!provider.builtin && !provider.enabled) {
|
|
73
|
+
const remove = button("api_remove_source", () => { if (window.confirm(format("api_remove_source_confirm"))) void change({ operation: "remove_api", id: provider.id, impact_revision: data.source_impacts?.[provider.id]?.revision }); });
|
|
74
|
+
remove.disabled = data.clients.some(c => c.source === provider.id || c.deployments?.some(item => item.source === provider.id));actions.append(remove);
|
|
75
|
+
}
|
|
72
76
|
row.append(info, actions);if (!provider.enabled) disabledSources.append(row);else if (provider.id === selectedProvider) providerList.append(row);
|
|
73
77
|
}
|
|
74
78
|
const current = editingClient && client(editingClient);
|