codex-copilot-dx 1.4.22 → 1.4.23

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
@@ -1,8 +1,14 @@
1
1
  # CCDX
2
2
 
3
- Use your model services in **Codex App, Claude App and Claude Code** through one local gateway.
3
+ Use your model services in **Codex App, Claude App, Claude Code and Antigravity App** through one local gateway.
4
4
 
5
- On macOS, the optional Gemini integration adds compatible Copilot Gemini models to the original App's Antigravity. Ordinary Gemini chat keeps Google. The Antigravity page lists each model once, with its advertised reasoning levels shown in the same format as Codex and Claude. Refresh the catalog there or with `ccdx app antigravity models --refresh`. Existing clients keep their setup.
5
+ Antigravity can use compatible Copilot Gemini models with their advertised reasoning levels. Ordinary Gemini chat keeps Google. See [setup and connection checks](docs/REFERENCE.md#antigravity-in-gemini-app).
6
+
7
+ | Antigravity client | Integration |
8
+ | --- | --- |
9
+ | macOS Gemini App | Integrated App detection, model routing and launch |
10
+ | Windows x64/ARM64 Antigravity App | Native launch path for the official 2.35.1 payloads. Signed-in App routing is pending live verification. |
11
+ | Antigravity standalone IDE or CLI | Separate clients outside this integration |
6
12
 
7
13
  Connect GitHub Copilot, Microsoft 365 or your own API. Choose which apps can use each source, then select their models. CI and prebuilt releases cover **macOS on Apple Silicon** and **Windows on x64/ARM64**. Intel Mac code remains available, without CI coverage or new prebuilt assets.
8
14
 
@@ -33,7 +39,7 @@ On Windows, use `npm.cmd` or `ccdx.cmd` if PowerShell blocks npm-generated scrip
33
39
  The Web UI opens at [http://127.0.0.1:2026](http://127.0.0.1:2026/). Run `ccdx web` to open it again, including before signing in.
34
40
 
35
41
  1. **Model sources:** connect an account or API, read its models, choose allowed apps and save. Source tabs only change the view.
36
- 2. **Codex / Claude:** choose visible models, set a default and save. Preview and synchronize client settings when needed.
42
+ 2. **Codex / Claude / Antigravity:** choose visible models, set a default and save. For Antigravity, enable the integration and open the verified App from its page.
37
43
  3. **Overview / Requests:** check configuration, activity and errors.
38
44
  4. **Usage → Context:** inspect reported input, model windows and observed compactions from this run.
39
45
 
@@ -82,8 +88,6 @@ Use the Web UI for accounts, APIs, models, client access, input suggestions, nat
82
88
  - **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).
83
89
  - **App updates:** Checks & repairs and `ccdx doctor` show observed installed Codex, Claude and Antigravity versions. A version change does not by itself verify the running App or its integrations. [Details](docs/REFERENCE.md#checks-and-troubleshooting).
84
90
 
85
- Web UI activity updates through server push; the terminal uses the same in-process activity feed. Reconnecting restores current state and bounded recent records.
86
-
87
91
  The foreground terminal stops with **Ctrl+C**. Client configuration marked **Unchanged** means CCDX kept the existing settings. Configuration and successful model access are separate checks.
88
92
 
89
93
  If models are missing, check the selected source and app models first. After a client update or configuration change, fully quit and reopen that app. Use **Checks & repairs** or `ccdx doctor` for local diagnostics.
@@ -26,7 +26,9 @@ Antigravity tool schemas are converted to Chat Completions schemas. Object schem
26
26
  The dashboard separates source enablement, source-to-app authorization and per-app model choices. Source enablement is immediate; authorization and model drafts use explicit Save / Discard actions. GitHub, Microsoft 365 and custom APIs share the same authorization form. Antigravity's source authorization and its Copilot access switch represent the same saved integration state.
27
27
 
28
28
 
29
- `gemini-app.mjs` verifies the installed App and prepares a process-local
29
+ `gemini-app.mjs` shares desktop launch planning with `application-control.mjs`.
30
+ `windows-antigravity-app.mjs` discovers native Windows installations and verifies the executable, application archive and language server before a launch.
31
+ The resulting plan prepares a process-local
30
32
  `CLOUD_CODE_URL` launch without editing its bundle or closing a running App.
31
33
  `antigravity-runtime.mjs` owns explicit enablement, source-history protection and
32
34
  the native management snapshot. The adapter loads it only for its management
@@ -1277,3 +1279,7 @@ The implementation takes the native/gateway-state ownership separation from [Mag
1277
1279
  `tool-activity.mjs` stores bounded, memory-only metadata behind each stream-performance observer. Existing parsed Responses items, Messages blocks and Gemini function calls supply tool names and scoped identifiers; no argument or output body is copied. The existing session/profile HMAC and application label isolate result matching. Results match call IDs, with a unique-name-only fallback for Gemini. Request completion changes generated calls to waiting, never to successful execution. Observable returned results, source failures and cancellation terminate the corresponding observations. Live response activity renews preparing observations with at most one notification per second per request. Missing evidence becomes unknown after 90 seconds, with a bounded late-result window. Snapshot reads perform lazy retention cleanup; there is no server polling loop.
1278
1280
 
1279
1281
  The WebUI consumes this metadata through the existing activity subscription. `dashboard/tool-activity.js` draws only the selected style, caches layout/theme measurements, caps drawing at 30 fps and DPR 1.5, pauses hidden/off-screen/reduced-motion views, and stops terminal cues within 0.9 seconds. Assembly line is the default; Beam ring and Grid are alternatives. Removed styles fall back to the default and Off retains state text. With no pending calls, conversation-purpose active requests supply processing/reply cues; internal diagnostics and terminal requests are excluded. Non-live request snapshots expire after six seconds. Local deadline timers stop stale activity even when the stream has no new events. Native controls, theme variables and the language dictionary preserve the existing UI contract. Existing `requests --active` and `requests tools` grammar also drive TUI discovery.
1282
+
1283
+ ## Dashboard assets
1284
+
1285
+ `dashboard-assets.mjs` owns the loopback asset allowlist and the ordered bootstrap bundle. The theme runs before paint; language and the bootstrap run in deferred order. Connection editors mount on their own views. Requests load only the selected drawing asset. Cold reads verify the installed package version around each file load.
package/docs/REFERENCE.md CHANGED
@@ -54,7 +54,7 @@ For installation and first use, start with the [README](../README.md). This refe
54
54
 
55
55
  Client IDs are `codex`, `claude-app` and `claude-code`. Source IDs are listed by `source list`. Read-only management commands support `--format table|plain|json`. They do not start an app or a gateway. Native image/suggestion status also reads local setup when the gateway is stopped; JSON includes the saved configuration flag and the same public details. Management operations need the running service; use `ccdx web` to start it without launching a client.
56
56
 
57
- The Codex, Claude App and Antigravity pages have a primary **Open app** action. A running App is focused, not launched again. **Reopen** requires confirmation and requests a normal exit; refusal, a changed process or multiple matching Apps stops the operation. Current desktop control covers macOS Codex, Claude App and Gemini/Antigravity, plus registered Codex and Claude installations on Windows. Claude Code remains a terminal client.
57
+ The Codex, Claude App and Antigravity pages have a primary **Open app** action. A running App is focused, not launched again. **Reopen** requires confirmation and requests a normal exit; refusal, a changed process or multiple matching Apps stops the operation. Current desktop control covers macOS Codex, Claude App and Gemini/Antigravity, plus registered Codex and Claude installations and known Antigravity App payloads on Windows. Claude Code remains a terminal client.
58
58
 
59
59
  **Open Codex when CCDX starts** is off by default. It takes effect on the next service start. `CCDX_AUTO_LAUNCH` explicitly overrides the saved preference; `0` disables and `1` enables it. `ccdx config set codex_auto_launch true --yes` also enables it. Explicit image preparation and opening remain available with automatic opening disabled.
60
60
 
@@ -74,7 +74,7 @@ Choose **Follow conversation model** to use an observed model from the same Code
74
74
  ## Antigravity in Gemini App
75
75
 
76
76
  The **Antigravity** page and `ccdx app antigravity status|models|enable|disable|open`
77
- manage the original macOS Gemini App. Enable requires acceptance of this data
77
+ manage the macOS Gemini App and the native Windows App launch path described below. Enable requires acceptance of this data
78
78
  scope: Antigravity main answers follow the selected Google or Copilot model;
79
79
  unbound summaries, searches and image generation use GitHub Copilot. A known conversation retains its confirmed source, model and reasoning level for compression. Ordinary Gemini chat
80
80
  keeps its Google route. No OpenAI account or search fallback is used.
@@ -115,6 +115,8 @@ conflict instead of being overwritten. The Gemini bundle, Google credentials,
115
115
  global proxy and certificates are untouched. Endpoint adoption remains
116
116
  unconfirmed until an Antigravity request is observed.
117
117
 
118
+ On Windows, install the official **Antigravity App** for x64 or ARM64 from [Google](https://antigravity.google/download), then run Windows-native CCDX. The native launcher verifies the executable, Electron application archive and language server against the corresponding official 2.35.1 installer payload. Unknown or modified builds remain unverified. Local launch preserves Windows and proxy settings and supplies the route only to the launched process. Existing gateway overrides and selected WSL backends cause a route conflict. Standalone Antigravity IDE and CLI remain separate. Windows launcher and bridge contracts have isolated coverage; signed-in model discovery, inference and native Google chat isolation still require live App acceptance.
119
+
118
120
  `disable` removes Copilot model access and refuses later Copilot/background
119
121
  requests without sending them to Google. Quit and reopen Gemini through CCDX
120
122
  after disabling to restore its native endpoint. This integration is separate
@@ -134,7 +136,7 @@ Each protocol observer retains at most 64 series of 64 request points and 16 com
134
136
 
135
137
  ## Observed tool calls
136
138
 
137
- **Requests → Tool and agent activity** offers Production line, Gear clock, Assembly line, Dual-lane sorter, Gantry transfer, Indexing table and Articulated robot arm. Production line is the default for new browsers and replaces unsupported preferences. Saved styles with the same name use the new drawings. Choose Off to keep status text without drawing. The setting is per browser. The display follows observed request and tool activity. Motion stops on completion, failure, cancellation, stale evidence, hidden views or reduced-motion settings. The pictures show activity and do not measure progress. Expand Call details for the full list. Recent requests show total time next to the timestamp, with details below each request.
139
+ **Requests → Tool and agent activity** offers Production line, Gear clock, Assembly line, Dual-lane sorter, Gantry transfer, Indexing table, Articulated robot arm and Warehouse pallet robots. Warehouse robots follow right-angle aisles and reserved intersection slots. Production line is the default for new browsers and replaces unsupported preferences. Saved styles with the same name use the new drawings. Choose Off to keep status text without drawing. The setting is per browser. The display follows observed request and tool activity. Motion stops on completion, failure, cancellation, stale evidence, hidden views or reduced-motion settings. The pictures show activity and do not measure progress. Expand Call details for the full list. Recent requests show total time next to the timestamp, with details below each request.
138
140
 
139
141
  On the Antigravity page, the top **Refresh** reads local setup and activity. **Refresh models** fetches the upstream catalog. Returning to the page retains unsaved selections and the last focused model control while status refreshes.
140
142
 
@@ -243,7 +245,7 @@ Catalog diagnostics distinguish local cached data from an online response and ex
243
245
  - **Request evidence:** use `ccdx requests show ID --format json` while the request is retained. The local request ID, outbound client ID and upstream request ID identify different stages. **Recent request issues → Failures over 24 hours** groups available failure metadata by hour, app, model and phase. `ccdx status --details --format json` includes the same bounded summary under `http_errors.history`.
244
246
  - **Token counting unavailable:** an observed API count-endpoint 404 is cached briefly per model/header scope. Inference and token counting are separate capabilities; no synthetic count is returned.
245
247
  - **Local checks:** `doctor` is read-only by default. `--online` checks access; `--compat` sends minimal inference and consumes usage. `--fix` backs up owned configuration and performs bounded repairs. It does not enable optional features, change company policy or force-restart apps. Partial repairs exit 1.
246
- - **App updates:** after the service is ready, CCDX observes installed App versions in the background. Checks & repairs shows the result; `ccdx doctor` can inspect it locally. On macOS this includes Antigravity (the original Gemini App) and uses known App bundle metadata and, when available, the bundled Codex CLI version. On Windows the registered Codex package is inspected; Claude App remains unknown if reliable metadata is unavailable. The running process may still be an older build, and a version observation does not verify images, predictions, model access or protocol compatibility. Claude capability synchronization uses the installed macOS App contract described below. An installed version alone does not establish native adoption. The compact local version record contains only App versions, builds and observation times, not credentials or conversation data. It is refreshed on startup, local checks and the existing model-refresh cadence; a reused service receives a nonblocking refresh notification.
248
+ - **App updates:** after the service is ready, CCDX observes installed App versions in the background. Checks & repairs shows the result; `ccdx doctor` can inspect it locally. On macOS this includes Antigravity (the original Gemini App) and uses known App bundle metadata and, when available, the bundled Codex CLI version. On Windows the registered Codex package and detected Antigravity App version are inspected; Claude App remains unknown if reliable metadata is unavailable. The running process may still be an older build, and a version observation does not verify images, predictions, model access or protocol compatibility. Claude capability synchronization uses the installed macOS App contract described below. An installed version alone does not establish native adoption. The compact local version record contains only App versions, builds and observation times, not credentials or conversation data. It is refreshed on startup, local checks and the existing model-refresh cadence; a reused service receives a nonblocking refresh notification.
247
249
  - **Cache cleanup:** adding `--history` can break the next continuation. It does not delete client transcripts or generated images.
248
250
 
249
251
  Request inspection covers bounded retained records, not a full conversation archive. Unidentified clients stay unidentified. Routine diagnostics omit secrets, prompts and error bodies. Explicit error excerpts use bounded, redacted collection. The usage JSON `requests` field counts recorded usage rows, not HTTP calls. Usage is returned token metadata; cache hit is reused input divided by input from records with valid counts for both. Unknown/invalid records remain in token totals but are excluded from both sides of the rate, with partial coverage indicated. It is not a request-based cache rate or a billing receipt.
@@ -288,7 +290,7 @@ The initial internal ceiling is 128 concurrent requests per source/account. This
288
290
 
289
291
  Settings separates saved preferences from effective state. Auto-save applies changes by default; required restarts remain explicit. Restore-defaults creates a backup first and keeps accounts, keys, model plans and chats. CLI preference reset/restore uses its own service-only backup; it does not change browser appearance or replace the Web UI's backup.
290
292
 
291
- Use the button beside the CCDX wordmark to collapse the sidebar to icons. The browser remembers the layout for this dashboard address. The current page stays selected when the sidebar changes width.
293
+ Use the button beside the CCDX wordmark to collapse the sidebar to icons. Hover over or focus an icon to see its page name. Escape dismisses the tooltip. The browser remembers the layout for this dashboard address. The current page stays selected when the sidebar changes width.
292
294
 
293
295
  **Settings → Bark notifications** is collapsed by default. Enable it and paste the URL containing the device key from Bark. The minimum duration defaults to 30 minutes. Zero includes every eligible completed turn. Leave the title and description blank to use the name of the app that finished. The phone retrieves the matching public PNG from [Lobe Icons](https://github.com/lobehub/lobe-icons).
294
296
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-copilot-dx",
3
- "version": "1.4.22",
3
+ "version": "1.4.23",
4
4
  "description": "Local gateway for Codex, Claude and Gemini Antigravity with Copilot, Microsoft 365 and custom APIs",
5
5
  "author": "Dale Xiao",
6
6
  "type": "module",
package/src/adapter.mjs CHANGED
@@ -635,6 +635,7 @@ export async function startAdapter(port = 2026, host = "127.0.0.1", options = {}
635
635
  server.ccdxSnapshot = handler.snapshot;
636
636
  server.ccdxSubscribeActivity = handler.subscribeActivity;
637
637
  server.ccdxCloseActivity = handler.closeActivity;
638
+ server.ccdxDrainBackground = () => options.dashboardOptions?.serviceControl?.closeNotifications?.();
638
639
  server.ccdxBusy = handler.busy;
639
640
  server.ccdxExportState = handler.exportState;
640
641
  server.ccdxImportState = handler.importState;
@@ -4,6 +4,7 @@ import { MAX_UPSTREAM_CHAT_SUCCESS_BODY_BYTES } from "./http-transport.mjs";
4
4
  import { ToolArgumentDeltaGuard, upstreamChatStreamError } from "./stream-contract.mjs";
5
5
  import { observeSourceStreamFailure } from "./source-admission.mjs";
6
6
  import { sourceResponseAccepted } from "./source-response.mjs";
7
+ import { chatOutputParts } from "./chat-output-parts.mjs";
7
8
  import { MAX_OPAQUE_LENGTH } from "./antigravity-opaque-reasoning.mjs";
8
9
 
9
10
  const object = value => value !== null && typeof value === "object" && !Array.isArray(value);
@@ -212,7 +213,7 @@ export function chatToAntigravity(response, originalNames, usage = mergeChatUsag
212
213
  if (!object(message)) throw invalid("Invalid upstream Chat response", 502);
213
214
  const parts = [];
214
215
  if (typeof message.reasoning_content === "string" && message.reasoning_content) parts.push({ text: message.reasoning_content, thought: true });
215
- if (typeof message.content === "string" && message.content) parts.push({ text: message.content });
216
+ for (const { text, thought } of chatOutputParts(message.content)) parts.push({ text, ...(thought ? { thought: true } : {}) });
216
217
  if (Array.isArray(message.tool_calls)) for (const call of message.tool_calls) parts.push(chatFunctionPart(call, originalNames));
217
218
  const finish = { stop: "STOP", tool_calls: "STOP", length: "MAX_TOKENS", content_filter: "SAFETY" }[choice.finish_reason];
218
219
  if (!finish) throw invalid("Upstream Chat response did not complete", 502);
@@ -245,11 +246,17 @@ export async function* chatStreamToAntigravity(response, originalNames, { onChun
245
246
  // Copilot sends a full replacement value in each such delta.
246
247
  opaque = delta.reasoning_opaque.length <= MAX_OPAQUE_LENGTH ? delta.reasoning_opaque : undefined;
247
248
  }
248
- for (const [key, thought] of [["reasoning_content", true], ["content", false], ["refusal", false]]) {
249
+ const parts = [];
250
+ for (const [key, thought] of [["reasoning_content", true], ["refusal", false]]) {
249
251
  if (delta[key] === undefined || delta[key] === null || delta[key] === "") continue;
250
252
  if (typeof delta[key] !== "string") throw invalid("Unsupported upstream Chat stream content", 502);
253
+ parts.push({ text: delta[key], thought });
254
+ }
255
+ const reasoning = parts.filter(part => part.thought);
256
+ const refusal = parts.filter(part => !part.thought);
257
+ for (const { text, thought } of [...reasoning, ...chatOutputParts(delta.content), ...refusal]) {
251
258
  if (!thought) visible = true;
252
- yield { response: { candidates: [{ index: 0, content: { role: "model", parts: [{ text: delta[key], ...(thought ? { thought: true } : {}) }] } }] } };
259
+ yield { response: { candidates: [{ index: 0, content: { role: "model", parts: [{ text, ...(thought ? { thought: true } : {}) }] } }] } };
253
260
  }
254
261
  if (delta.function_call) throw invalid("Unsupported upstream Chat function call", 502);
255
262
  if (delta.tool_calls !== undefined && !Array.isArray(delta.tool_calls)) throw invalid("Invalid upstream Chat tool calls", 502);
@@ -7,6 +7,7 @@ import {createAntigravityHandler} from "./antigravity-handler.mjs";
7
7
  import {createAntigravityImages} from "./antigravity-images.mjs";
8
8
  import {createCopilotWeb} from "./copilot-web.mjs";
9
9
  import {inspectGeminiApp,planGeminiAppLaunch} from "./gemini-app.mjs";
10
+ import {launchWindowsAntigravity} from "./windows-antigravity-app.mjs";
10
11
  import {readUserSettings,userSettingsPath} from "./user-settings.mjs";
11
12
  import {readAccessSettings} from "./access-settings.mjs";
12
13
  import {readClientGatewayKeys} from "./client-gateway-keys.mjs";
@@ -26,8 +27,8 @@ const nativeSourceKey="gemini_antigravity_native_source";
26
27
  const validTimeout=value=>Number.isSafeInteger(value)&&value>=1&&value<=600;
27
28
  const validAlias=id=>typeof id==="string"&&/^ccdx-copilot-[a-z0-9._-]{1,140}$/.test(id);
28
29
 
29
- export function createAntigravityRuntime({client,models=()=>[],refreshModels,privacy,home=os.homedir(),env=process.env,inspect=inspectGeminiApp,
30
- exec=execute,searchFn,imageFn,guardSource,googleFetch,acquireRequest,applicationControl,readToken=()=>readSavedGithubToken(home),
30
+ export function createAntigravityRuntime({client,models=()=>[],refreshModels,privacy,home=os.homedir(),env=process.env,platform=process.platform,inspect=inspectGeminiApp,
31
+ exec=execute,launchWindows=launchWindowsAntigravity,searchFn,imageFn,guardSource,googleFetch,acquireRequest,applicationControl,readToken=()=>readSavedGithubToken(home),
31
32
  upstreamTimeoutMs=180000,copilotTimeoutMs,nativeSources=()=>[],getSource=()=>null,...timeouts}={}) {
32
33
  const options={home,env},guard=createConversationSourceGuard(options);
33
34
  const web=searchFn?null:createCopilotWeb({client,readToken});
@@ -178,13 +179,15 @@ export function createAntigravityRuntime({client,models=()=>[],refreshModels,pri
178
179
  }else await applicationControl.check("antigravity",true);
179
180
  return snapshot();
180
181
  }
181
- app=await inspect();route=baseUrl+"/antigravity";
182
+ app=await inspect({home,env,platform,exec});route=baseUrl+"/antigravity";
182
183
  if(["open","preview"].includes(operation)){
183
184
  const config=settings();
184
- const plan=config.enabled||config.native_source?planGeminiAppLaunch(app,{cloudCodeUrl:route,env,home}):app.status==="stopped"?{status:"prepared",command:"/usr/bin/open",args:["-a",app.app]}:{status:app.status==="running"?"needs_app_relaunch":app.status};
185
+ const plan=planGeminiAppLaunch(app,{cloudCodeUrl:config.enabled||config.native_source?route:undefined,env,home,platform});
185
186
  lastOperation={action:operation,status:plan.status};
186
187
  if(operation==="open"&&plan.status==="prepared"){
187
- await exec(plan.command,plan.args,{encoding:"utf8",timeout:5000,maxBuffer:4096});lastOperation.status="opened";app={...app,status:"starting"};
188
+ if(platform==="win32")await launchWindows(plan);
189
+ else await exec(plan.command,plan.args,{encoding:"utf8",timeout:5000,maxBuffer:4096});
190
+ lastOperation.status="opened";app={...app,status:"starting"};
188
191
  }
189
192
  if(operation==="preview"&&plan.status==="prepared")lastOperation.plan={command:plan.command,args:plan.args};
190
193
  }
@@ -6,12 +6,13 @@ import { inspectApplicationConfiguration } from "./application-configuration.mjs
6
6
  import { createApplicationEvidence } from "./application-evidence.mjs";
7
7
  import { planGeminiAppLaunch, inspectGeminiApp } from "./gemini-app.mjs";
8
8
  import { readUserSettings } from "./user-settings.mjs";
9
+ import { launchWindowsAntigravity } from "./windows-antigravity-app.mjs";
9
10
 
10
11
  const execute = promisify(execFile), ids = ["codex", "claude_app", "antigravity"];
11
12
  export function createApplicationControl({ providerRuntime, clientIntegration, imageHostState, env = process.env, home,
12
13
  platform = process.platform, port = 2026, host = "127.0.0.1", now = Date.now, exec = execute, wait = sleep,
13
14
  inspect = inspectApplicationProcesses, connections = applicationConnections, control = controlApplicationProcess,
14
- inspectGemini = inspectGeminiApp,
15
+ inspectGemini = inspectGeminiApp, launchWindowsGemini = launchWindowsAntigravity,
15
16
  configuration = inspectApplicationConfiguration, openCodexApp, evidence = providerRuntime?.applicationEvidence || createApplicationEvidence({ now }) } = {}) {
16
17
  const options = { env, home, platform, exec };
17
18
  const states = Object.fromEntries(ids.map(id => [id, { status: "unknown", connection: "pending" }]));
@@ -56,6 +57,10 @@ export function createApplicationControl({ providerRuntime, clientIntegration, i
56
57
  if (operation === "restart" && expectedPid !== undefined && (expectedPid !== app?.pid || expectedStarted !== app?.started)) return { status: "app_changed", app: state };
57
58
  if (["unknown", "multiple", "unsupported", "not_installed"].includes(state.status)) return { status: state.status, app: state };
58
59
  if (state.status === "starting") return { status: "opening", app: state };
60
+ if (platform === "win32" && id === "antigravity" && state.status === "running") {
61
+ const verified = await inspectGemini({ ...options, app: app.app });
62
+ if (verified.status !== "running" || !verified.pids.includes(app.pid)) return { status: "app_changed", app: state };
63
+ }
59
64
  if (state.status === "running" && operation !== "restart") {
60
65
  if (state.needs_reload && operation !== "focus") return { status: "needs_app_relaunch", app: state };
61
66
  const result = await control(app, "focus", options);
@@ -84,10 +89,13 @@ export function createApplicationControl({ providerRuntime, clientIntegration, i
84
89
  handled = true;
85
90
  }
86
91
  }
87
- if (!handled && platform === "darwin") {
88
- const plan = id === "antigravity" ? await antigravityPlan(app) : { status: "prepared", command: "/usr/bin/open", args: ["-a", app.app] };
92
+ if (!handled && id === "antigravity") {
93
+ const plan = await antigravityPlan(app);
89
94
  if (plan.status !== "prepared") return { status: plan.status, app: states[id] };
90
- await exec(plan.command, plan.args, { encoding: "utf8", timeout: 5000, maxBuffer: 4096 });
95
+ if (platform === "win32") await launchWindowsGemini(plan);
96
+ else await exec(plan.command, plan.args, { encoding: "utf8", timeout: 5000, maxBuffer: 4096 });
97
+ } else if (!handled && platform === "darwin") {
98
+ await exec("/usr/bin/open", ["-a", app.app], { encoding: "utf8", timeout: 5000, maxBuffer: 4096 });
91
99
  } else if (!handled && platform === "win32") {
92
100
  if (app.target.startsWith("shell:AppsFolder\\")) await exec("explorer.exe", [app.target], { encoding: "utf8", timeout: 5000, maxBuffer: 4096, windowsHide: true });
93
101
  else await exec(app.target, [], { encoding: "utf8", timeout: 5000, maxBuffer: 4096, windowsHide: true });
@@ -101,11 +109,10 @@ export function createApplicationControl({ providerRuntime, clientIntegration, i
101
109
  const config = readUserSettings({ env, home, strict: true });
102
110
  return config.gemini_antigravity_enabled === true || typeof config.gemini_antigravity_native_source === "string";
103
111
  };
104
- if (!bridgeEnabled()) return { status: "prepared", command: "/usr/bin/open", args: ["-a", app.app] };
112
+ if (platform === "darwin" && !bridgeEnabled()) return { status: "prepared", command: "/usr/bin/open", args: ["-a", app.app] };
105
113
  const verified = await inspectGemini({ ...options, app: app.app });
106
114
  if (verified.status !== "stopped") return { status: verified.status === "running" ? "app_changed" : verified.status };
107
- if (!bridgeEnabled()) return { status: "prepared", command: "/usr/bin/open", args: ["-a", app.app] };
108
- return planGeminiAppLaunch(verified, { cloudCodeUrl: `http://${host}:${port}/antigravity`, env, home });
115
+ return planGeminiAppLaunch(verified, { cloudCodeUrl: bridgeEnabled() ? `http://${host}:${port}/antigravity` : undefined, env, home, platform });
109
116
  }
110
117
  return { snapshot, evidence, check, busy: () => operations > 0,
111
118
  async previewAntigravity() {
@@ -4,6 +4,7 @@ import path from "node:path";
4
4
  import { execFile } from "node:child_process";
5
5
  import { promisify } from "node:util";
6
6
  import { installedWindowsPredictionAppAsync } from "./native-prediction-windows.mjs";
7
+ import { inspectWindowsAntigravity } from "./windows-antigravity-app.mjs";
7
8
 
8
9
  const execute = promisify(execFile);
9
10
  const definitions = {
@@ -31,7 +32,8 @@ export function processFamily(processes, root) {
31
32
  }
32
33
 
33
34
  export async function inspectApplicationProcesses({ platform = process.platform, home = os.homedir(), env = process.env,
34
- exec = execute, discoverWindows = installedWindowsPredictionAppAsync, applicationsRoot = "/Applications" } = {}) {
35
+ exec = execute, discoverWindows = installedWindowsPredictionAppAsync, discoverWindowsAntigravity = inspectWindowsAntigravity,
36
+ applicationsRoot = "/Applications" } = {}) {
35
37
  if (!["darwin", "win32"].includes(platform)) return { apps: Object.fromEntries(Object.keys(definitions).map(id => [id, { status: "unsupported" }])), processes: [] };
36
38
  const apps = {}, processes = [];
37
39
  if (platform === "darwin") {
@@ -54,16 +56,19 @@ export async function inspectApplicationProcesses({ platform = process.platform,
54
56
  apps[id] = running.length > 1 ? { status: "multiple" } : running[0] || installed[0] || { status: "not_installed" };
55
57
  }
56
58
  } else {
57
- const result = await exec("powershell.exe", ["-NoLogo", "-NoProfile", "-NonInteractive", "-Command", windowsInventory], { ...runOptions, env: metadataEnvironment(env) });
59
+ const [result, codex, antigravity] = await Promise.all([
60
+ exec("powershell.exe", ["-NoLogo", "-NoProfile", "-NonInteractive", "-Command", windowsInventory], { ...runOptions, env: metadataEnvironment(env) }),
61
+ Promise.resolve().then(() => discoverWindows({ env })).catch(() => null),
62
+ Promise.resolve().then(() => discoverWindowsAntigravity({ env, exec })).catch(() => ({ status: "unknown" })),
63
+ ]);
58
64
  const inventory = JSON.parse(result.stdout);
59
65
  for (const row of inventory.processes || []) if (Number.isSafeInteger(row.pid) && row.pid > 0 && Number.isFinite(Date.parse(row.started))) processes.push(row);
60
- let codex;try { codex = await discoverWindows({ env }); } catch {}
61
66
  apps.codex = codex ? { app: codex.app, target: codex.app, executable: codex.app } : { status: "not_installed" };
62
67
  const claude = inventory.claude;
63
68
  apps.claude_app = claude && path.win32.isAbsolute(claude.app) && path.win32.basename(claude.app).toLowerCase() === "claude.exe"
64
69
  && (claude.target === claude.app || /^shell:AppsFolder\\[A-Za-z0-9._-]+![A-Za-z0-9._-]+$/.test(claude.target))
65
70
  ? { app: claude.app, target: claude.target, executable: claude.app } : { status: "not_installed" };
66
- apps.antigravity = { status: "unsupported" };
71
+ apps.antigravity = antigravity;
67
72
  }
68
73
  for (const info of Object.values(apps)) if (info.executable) {
69
74
  const same = command => platform === "win32" ? command?.toLowerCase() === info.executable.toLowerCase() : command === info.executable;
@@ -165,7 +165,8 @@ export function createBarkNotifications({ env = process.env, home = os.homedir()
165
165
  const antigravity = path.join(home, ".gemini", "antigravity");
166
166
  let timer, lastResult = null, closed = false, running = false, watching = false, since = now();
167
167
  let settings = readSettings(), antigravityCatalog, insecureRef;
168
- let stopWatcher, antigravityScan;
168
+ let stopWatcher, antigravityScan, scanFlight, closeFlight;
169
+ const shutdown = new AbortController();
169
170
  const scanned = new Map();
170
171
 
171
172
  function readSettings() {
@@ -238,14 +239,15 @@ export function createBarkNotifications({ env = process.env, home = os.homedir()
238
239
  if (closed || snapshot !== settings) return;
239
240
  try { if (!claim(event)) return; }
240
241
  catch { lastResult = "ledger_failed";return; }
242
+ const signal = AbortSignal.any([shutdown.signal, AbortSignal.timeout(5000)]);
241
243
  const result = await fetchImpl(destination.endpoint, {
242
- method: "POST", headers: { "Content-Type": "application/json" }, redirect: "error", signal: AbortSignal.timeout(5000),
244
+ method: "POST", headers: { "Content-Type": "application/json" }, redirect: "error", signal,
243
245
  body: JSON.stringify({ device_key: destination.deviceKey, ...notificationMessage(snapshot, event) }),
244
246
  });
245
- const reply = await readBoundedResponseText(result, { maxBytes: 4096, label: "Bark response" });
246
- if (snapshot === settings) lastResult = result.ok && record(reply)?.code === 200 ? "sent" : "failed";
247
+ const reply = await readBoundedResponseText(result, { maxBytes: 4096, label: "Bark response", signal });
248
+ if (!closed && snapshot === settings) lastResult = result.ok && record(reply)?.code === 200 ? "sent" : "failed";
247
249
  } catch {
248
- if (snapshot === settings) lastResult = "failed";
250
+ if (!closed && snapshot === settings) lastResult = "failed";
249
251
  }
250
252
  }
251
253
 
@@ -332,7 +334,7 @@ export function createBarkNotifications({ env = process.env, home = os.homedir()
332
334
 
333
335
  function schedule(interval = scanIntervalMs) {
334
336
  clearTimeout(timer);
335
- if (!closed && settings.enabled) timer = setTimeout(() => { void scan(); }, interval).unref();
337
+ if (!closed && settings.enabled) timer = setTimeout(() => { scanFlight = scan(); }, interval).unref();
336
338
  }
337
339
 
338
340
  function watchAntigravityStop() {
@@ -385,6 +387,15 @@ export function createBarkNotifications({ env = process.env, home = os.homedir()
385
387
  schedule(0);
386
388
  return snapshot();
387
389
  },
388
- close() { closed = true;clearTimeout(timer);stopWatcher?.close();secretStore.close?.(); },
390
+ close() {
391
+ if (closeFlight) return closeFlight;
392
+ closed = true;clearTimeout(timer);stopWatcher?.close();shutdown.abort();
393
+ let deadline;
394
+ closeFlight = Promise.race([
395
+ Promise.allSettled([scanFlight, antigravityScan]),
396
+ new Promise(resolve => { deadline = setTimeout(resolve, 5000).unref(); }),
397
+ ]).finally(() => { clearTimeout(deadline);secretStore.close?.(); });
398
+ return closeFlight;
399
+ },
389
400
  };
390
401
  }
@@ -0,0 +1,20 @@
1
+ import { invalidUpstreamStream } from "./stream-contract.mjs";
2
+
3
+ function unsupported() {
4
+ throw invalidUpstreamStream("Unsupported upstream Chat stream content");
5
+ }
6
+
7
+ export function chatOutputParts(content) {
8
+ if (content == null || content === "") return [];
9
+ if (typeof content === "string") return [{ text: content, thought: false }];
10
+ if (!Array.isArray(content)) unsupported();
11
+ return content.flatMap(part => {
12
+ if (part?.type === "text" && typeof part.text === "string") return [{ text: part.text, thought: false }];
13
+ if (part?.type === "thinking") {
14
+ if (typeof part.thinking === "string") return [{ text: part.thinking, thought: true }];
15
+ if (Array.isArray(part.thinking) && part.thinking.every(chunk => chunk?.type === "text" && typeof chunk.text === "string"))
16
+ return part.thinking.map(chunk => ({ text: chunk.text, thought: true }));
17
+ }
18
+ return unsupported();
19
+ }).filter(part => part.text);
20
+ }
@@ -9,7 +9,7 @@ const MAX_METADATA_BYTES = 64 * 1024;
9
9
  const MAX_APPS = 9;
10
10
  export const clientVersionName = client => ({ codex: "Codex App", claude: "Claude App", antigravity: "Antigravity" })[client] || client;
11
11
  const validId = value => /^(?:codex|claude)_(?:system|user|windows)_(?:chatgpt|codex|claude)$/.test(value)
12
- || /^antigravity_(?:system|user)_gemini$/.test(value);
12
+ || /^antigravity_(?:system|user)_gemini$/.test(value) || value === "antigravity_windows_antigravity";
13
13
  const validVersion = value => typeof value === "string" && /^[0-9][0-9A-Za-z.+_-]{0,63}$/.test(value);
14
14
  const optionalVersion = value => value == null || validVersion(value);
15
15
  const validDate = value => value == null || typeof value === "string" && /^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d\.\d{3}Z$/.test(value);
@@ -46,7 +46,7 @@ async function macBundle(root, scope, name, client) {
46
46
  }
47
47
 
48
48
  export async function inspectInstalledClientVersions({ home = os.homedir(), env = process.env, platform = process.platform,
49
- systemApplications = "/Applications", windowsCodexVersion } = {}) {
49
+ systemApplications = "/Applications", windowsCodexVersion, windowsAntigravityVersion } = {}) {
50
50
  if (platform === "darwin") {
51
51
  const roots = [["system", systemApplications], ["user", path.join(home, "Applications")]], jobs = [];
52
52
  for (const [scope, root] of roots) for (const [name, client] of [["ChatGPT.app", "codex"], ["Codex.app", "codex"], ["Claude.app", "claude"], ["Gemini.app", "antigravity"]]) {
@@ -56,8 +56,12 @@ export async function inspectInstalledClientVersions({ home = os.homedir(), env
56
56
  }
57
57
  if (platform === "win32") {
58
58
  const inspect = windowsCodexVersion || (await import("./native-prediction-windows.mjs")).inspectWindowsCodexVersion;
59
- const version = await inspect({ env }).catch(() => null);
60
- return validVersion(version) ? [{ id: "codex_windows_codex", name: "Codex", client: "codex", scope: "windows", version, build: null, cli_version: null }] : [];
59
+ const antigravity = windowsAntigravityVersion || (await import("./windows-antigravity-app.mjs")).inspectWindowsAntigravity;
60
+ const [version, app] = await Promise.all([inspect({ env }).catch(() => null), antigravity({ env }).catch(() => null)]);
61
+ return [
62
+ ...(validVersion(version) ? [{ id: "codex_windows_codex", name: "Codex", client: "codex", scope: "windows", version, build: null, cli_version: null }] : []),
63
+ ...(validVersion(app?.version) ? [{ id: "antigravity_windows_antigravity", name: "Antigravity", client: "antigravity", scope: "windows", version: app.version, build: null, cli_version: null }] : []),
64
+ ];
61
65
  }
62
66
  return [];
63
67
  }
@@ -0,0 +1,36 @@
1
+ (() => {
2
+ const routeNeedsEditor = () => ["#models", "#codex", "#claude"].includes(location.hash);
3
+ const asset = new URL(document.currentScript.src);
4
+ asset.pathname = "/connections.js";
5
+ let pending, latestMemory;
6
+ const bootstrap = {
7
+ load() {
8
+ if (!routeNeedsEditor() || pending) return pending;
9
+ pending = new Promise(resolve => {
10
+ const script = document.createElement("script");
11
+ script.src = asset.href;
12
+ script.addEventListener("load", () => {
13
+ const feature = globalThis.ccdxConnections;
14
+ if (feature === bootstrap) {
15
+ pending = null;
16
+ script.remove();
17
+ resolve();
18
+ return;
19
+ }
20
+ Promise.resolve(feature.ready).then(() => feature.updateMemory(latestMemory)).finally(resolve);
21
+ }, { once: true });
22
+ script.addEventListener("error", () => {
23
+ pending = null;
24
+ script.remove();
25
+ resolve();
26
+ }, { once: true });
27
+ document.head.append(script);
28
+ });
29
+ return pending;
30
+ },
31
+ updateMemory(snapshot) { latestMemory = snapshot; },
32
+ };
33
+ globalThis.ccdxConnections = bootstrap;
34
+ window.addEventListener("hashchange", () => { if (globalThis.ccdxConnections === bootstrap) void bootstrap.load(); });
35
+ void bootstrap.load();
36
+ })();
@@ -612,8 +612,7 @@
612
612
  window.addEventListener("ccdx:source-view", () => { if (data) list(); });
613
613
  window.addEventListener("ccdx:providers", () => { if (desiredSource && providerEntries.some(p => p.id === desiredSource)) { const id = desiredSource;desiredSource = null;chooseProvider(id); }if (data) list(); });
614
614
  new MutationObserver(() => { if (data) list(); }).observe(document.documentElement, { attributes: true, attributeFilter: ["lang"] });
615
- globalThis.ccdxConnections = { load,
615
+ globalThis.ccdxConnections = { load, ready: load(),
616
616
  updateMemory(snapshot) { const c = snapshot?.clients?.find(c => c.id === "codex");if (data && c?.memory_model) { client("codex").memory_model = c.memory_model;memoryRender(); } }, editClient: id => { if (data && client(id)) { editClient(client(id)); } } };
617
617
  for (const button of document.querySelectorAll("[data-client-access]")) button.addEventListener("click", () => globalThis.ccdxConnections.editClient(button.dataset.clientAccess));
618
- void load();
619
618
  })();
@@ -5,14 +5,15 @@
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1">
6
6
  <meta name="color-scheme" content="dark light">
7
7
  <link id="favicon" rel="icon" type="image/svg+xml" href="data:,">
8
- <script src="/language.js"></script>
9
8
  <script src="/theme.js"></script>
9
+ <script src="/language.js" defer></script>
10
10
  <link rel="stylesheet" href="/ui.css">
11
11
  <script src="/dashboard.js" defer></script>
12
12
  <title data-i18n="ccdx_local_dashboard">CCDX Dashboard</title>
13
13
  </head>
14
14
  <body>
15
15
  <div class="shell">
16
+ <div id="sidebar-tooltip" class="sidebar-tooltip" aria-hidden="true" hidden></div>
16
17
  <aside class="sidebar">
17
18
  <div class="sidebar-header">
18
19
  <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></a>
@@ -411,7 +412,7 @@
411
412
  <div class="flow-caption"><span id="flow-caption" data-i18n="flow_status_unknown">Status unavailable</span><button id="flow-clear" type="button" data-i18n="flow_show_all" hidden>Show all</button><button id="flow-more" type="button" hidden>More models</button></div>
412
413
  </section>
413
414
  <section id="tool-activity" class="panel dashboard-section" aria-labelledby="tool-title" data-paused="true">
414
- <div class="panel-heading"><h2 id="tool-title" data-i18n="tool_heading">TOOL AND AGENT ACTIVITY</h2><label class="tool-style" for="tool-style"><span data-i18n="tool_style">Style</span><select id="tool-style"><option value="production" data-i18n="tool_style_production">Production line</option><option value="clock" data-i18n="tool_style_clock">Gear clock</option><option value="assembly" data-i18n="tool_style_assembly">Assembly line</option><option value="sorter" data-i18n="tool_style_sorter">Dual-lane sorter</option><option value="gantry" data-i18n="tool_style_gantry">Gantry transfer</option><option value="rotary" data-i18n="tool_style_rotary">Indexing table</option><option value="arm" data-i18n="tool_style_arm">Articulated robot arm</option><option value="off" data-i18n="tool_style_off">Off</option></select></label></div>
415
+ <div class="panel-heading"><h2 id="tool-title" data-i18n="tool_heading">TOOL AND AGENT ACTIVITY</h2><label class="tool-style" for="tool-style"><span data-i18n="tool_style">Style</span><select id="tool-style"><option value="production" data-i18n="tool_style_production">Production line</option><option value="clock" data-i18n="tool_style_clock">Gear clock</option><option value="assembly" data-i18n="tool_style_assembly">Assembly line</option><option value="sorter" data-i18n="tool_style_sorter">Dual-lane sorter</option><option value="gantry" data-i18n="tool_style_gantry">Gantry transfer</option><option value="rotary" data-i18n="tool_style_rotary">Indexing table</option><option value="arm" data-i18n="tool_style_arm">Articulated robot arm</option><option value="warehouse" data-i18n="tool_style_warehouse">Warehouse pallet robots</option><option value="off" data-i18n="tool_style_off">Off</option></select></label></div>
415
416
  <div id="tool-stage" class="tool-stage" data-style="production">
416
417
  <div class="tool-visual"><div class="tool-orbit"><canvas id="tool-canvas" role="img" data-i18n-label="tool_heading" aria-label="Tool and agent activity"></canvas></div><p class="tool-narration"><span id="tool-state" role="status" aria-live="polite" data-i18n="flow_status_unknown">Waiting for a fresh status</span><span id="tool-cursor" aria-hidden="true" hidden> …</span></p></div>
417
418
  <div class="tool-content"><p id="tool-context" class="tool-context" hidden></p><div id="tool-list"></div><p id="tool-more" class="hint" hidden></p></div>
@@ -30,6 +30,7 @@
30
30
  "tool_style_gantry": ["Gantry transfer","龙门移载"],
31
31
  "tool_style_rotary": ["Indexing table","分度转盘"],
32
32
  "tool_style_arm": ["Articulated robot arm","多节机械臂"],
33
+ "tool_style_warehouse": ["Warehouse pallet robots","仓库托盘机器人"],
33
34
  "tool_style_production": ["Production line", "工业生产线"],
34
35
  "tool_style_clock": ["Gear clock", "齿轮钟表"],
35
36
  "tool_style_assembly": ["Assembly line","装配线"],
@@ -249,7 +249,11 @@
249
249
  text("updated", "snapshot_time", { time: time(Date.now()) });
250
250
  return;
251
251
  }
252
- for (const source of data.providers?.connections?.providers || []) sourceNames.set(source.id, source.name);
252
+ const connections = data.providers?.connections;
253
+ if (Array.isArray(connections?.providers)) {
254
+ for (const source of connections.providers) sourceNames.set(source.id, source.name);
255
+ globalThis.ccdxConnectionNames = Object.fromEntries(connections.providers.map(({ id, name }) => [id, name]));
256
+ }
253
257
  globalThis.ccdxConnections?.updateMemory?.(data.providers?.connections);
254
258
  globalThis.ccdxDashboardActivity?.update(data.model_activity);
255
259
  globalThis.ccdxDashboardFlow?.update(data);globalThis.ccdxToolActivity?.update(data);