codex-copilot-dx 1.4.21 → 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 +9 -5
- package/docs/ARCHITECTURE.md +7 -1
- package/docs/REFERENCE.md +9 -5
- package/package.json +1 -1
- package/src/adapter.mjs +1 -0
- package/src/antigravity-chat-bridge.mjs +10 -3
- package/src/antigravity-runtime.mjs +8 -5
- package/src/application-control.mjs +14 -7
- package/src/application-process.mjs +9 -4
- package/src/bark-notifications.mjs +18 -7
- package/src/chat-output-parts.mjs +20 -0
- package/src/claude-gateway.mjs +20 -0
- package/src/client-versions.mjs +8 -4
- package/src/dashboard/applications.js +2 -2
- package/src/dashboard/connections-loader.js +36 -0
- package/src/dashboard/connections.js +1 -2
- package/src/dashboard/console.js +4 -2
- package/src/dashboard/gemini.js +81 -34
- package/src/dashboard/index.html +3 -2
- package/src/dashboard/language.js +2 -0
- package/src/dashboard/status.js +5 -1
- package/src/dashboard/tool-activity-arm.js +450 -0
- package/src/dashboard/tool-activity-warehouse.js +352 -0
- package/src/dashboard/tool-activity.js +24 -10
- package/src/dashboard/ui.css +1 -0
- package/src/dashboard/ui.js +45 -4
- package/src/dashboard-assets.mjs +39 -0
- package/src/dashboard.mjs +30 -47
- package/src/gemini-app.mjs +18 -7
- package/src/optional-routes.mjs +3 -3
- package/src/responses-bridge.mjs +37 -7
- package/src/shutdown.mjs +5 -2
- package/src/windows-antigravity-app.mjs +111 -0
package/README.md
CHANGED
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
# CCDX
|
|
2
2
|
|
|
3
|
-
Use your model services in **Codex App, Claude App and
|
|
3
|
+
Use your model services in **Codex App, Claude App, Claude Code and Antigravity App** through one local gateway.
|
|
4
4
|
|
|
5
|
-
|
|
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.
|
|
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.
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -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`
|
|
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
|
|
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,9 @@ 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 and
|
|
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.
|
|
140
|
+
|
|
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.
|
|
138
142
|
|
|
139
143
|
Calls are correlated using their IDs and the existing app/profile/session scope. A model emitting a tool call does not prove that the client executed it. Only a matching returned result ends the wait; ambiguous name-only Gemini results stay unconfirmed. Without a reliable session, completed requests show unconfirmed tool state. After 90 seconds without observable tool or response activity, the UI pauses and shows that fresh status is needed. Late results can update retained unconfirmed observations for another five minutes. These display deadlines never cancel tools or change source timeouts.
|
|
140
144
|
|
|
@@ -241,7 +245,7 @@ Catalog diagnostics distinguish local cached data from an online response and ex
|
|
|
241
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`.
|
|
242
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.
|
|
243
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.
|
|
244
|
-
- **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
|
|
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.
|
|
245
249
|
- **Cache cleanup:** adding `--history` can break the next continuation. It does not delete client transcripts or generated images.
|
|
246
250
|
|
|
247
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.
|
|
@@ -286,7 +290,7 @@ The initial internal ceiling is 128 concurrent requests per source/account. This
|
|
|
286
290
|
|
|
287
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.
|
|
288
292
|
|
|
289
|
-
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.
|
|
290
294
|
|
|
291
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).
|
|
292
296
|
|
package/package.json
CHANGED
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
|
-
|
|
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
|
-
|
|
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
|
|
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?
|
|
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
|
|
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 &&
|
|
88
|
-
const plan =
|
|
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
|
-
|
|
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
|
-
|
|
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,
|
|
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
|
|
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 =
|
|
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
|
|
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(() => {
|
|
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() {
|
|
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
|
+
}
|
package/src/claude-gateway.mjs
CHANGED
|
@@ -204,6 +204,19 @@ function createGuardedMessagesObserver(onEvent, maxBytes, clientModel, guard, re
|
|
|
204
204
|
return { write: chunk => run("write", chunk), finish: () => run("finish") };
|
|
205
205
|
}
|
|
206
206
|
|
|
207
|
+
function malformedTextBlock(body) {
|
|
208
|
+
const invalidIndex = content => Array.isArray(content)
|
|
209
|
+
? content.findIndex(block => block?.type === "text" && typeof block.text !== "string") : -1;
|
|
210
|
+
const system = invalidIndex(body.system);
|
|
211
|
+
if (system >= 0) return `system[${system}].text`;
|
|
212
|
+
for (const [index, message] of body.messages.entries()) {
|
|
213
|
+
if (message?.role !== "user" && message?.role !== "system") continue;
|
|
214
|
+
const block = invalidIndex(message.content);
|
|
215
|
+
if (block >= 0) return `messages[${index}].content[${block}].text`;
|
|
216
|
+
}
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
219
|
+
|
|
207
220
|
export function createClaudeGatewayHandler({ provider, apiKey, desktopAliases = false, appContract, messagesSystemMode = "passthrough", log = () => {}, onRequest = () => {}, env = process.env, performance: sharedPerformance, validateConversation,
|
|
208
221
|
resolveRequest, privacy, compaction, privacyClient = "claude", record = recordUsage, acquireRequest = createRequestAdmission({ maxBytes: 16 * 1024 * 1024, maxQueued: 8 }) } = {}) {
|
|
209
222
|
if (!provider || !isProviderId(provider.id) || typeof apiKey !== "string" || apiKey.length < 32) throw new Error("Claude gateway requires a provider and private local key");
|
|
@@ -260,6 +273,13 @@ export function createClaudeGatewayHandler({ provider, apiKey, desktopAliases =
|
|
|
260
273
|
if (!body || typeof body.model !== "string" || !Array.isArray(body.messages)) {
|
|
261
274
|
send(res, 400, apiError("ccdx_messages_invalid", "Expected a model and messages array"));return;
|
|
262
275
|
}
|
|
276
|
+
const invalidText = malformedTextBlock(body);
|
|
277
|
+
if (invalidText) {
|
|
278
|
+
failureStatus = 400;
|
|
279
|
+
send(res, failureStatus, { type: "error", error: { type: "invalid_request_error",
|
|
280
|
+
code: "ccdx_messages_text_invalid", param: invalidText, message: `${invalidText} must be a string.` } });
|
|
281
|
+
return;
|
|
282
|
+
}
|
|
263
283
|
const apiVersion = req.headers["anthropic-version"];
|
|
264
284
|
if (typeof apiVersion === "string" && apiVersion.trim() === "2026-10-21") {
|
|
265
285
|
const parameter = ["temperature", "top_p", "top_k"].find(name => Object.hasOwn(body, name));
|
package/src/client-versions.mjs
CHANGED
|
@@ -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
|
|
60
|
-
|
|
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
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
(() => {
|
|
2
|
-
function create({ element: el, change, localize, isBusy = () => false }) {
|
|
2
|
+
function create({ element: el, change, localize, isBusy = () => false, isMutating = isBusy }) {
|
|
3
3
|
let data, pending = false, sequence = 0, confirmation = null, claudeApp = true, note = null, autoError = false, antigravityCatalogPending = false;
|
|
4
4
|
const route = () => ({ codex: "codex", claude: claudeApp ? "claude_app" : null, gemini: "antigravity" })[location.hash.slice(1)] || null;
|
|
5
5
|
const label = (id, key) => localize(el(id), key);
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
el("codex-auto-launch").disabled = isBusy() || data?.effective?.codex_auto_launch?.locked === true || !data;
|
|
24
24
|
label("codex-auto-launch-note", autoError ? "application_preference_failed" : data?.effective?.codex_auto_launch?.locked ? "controlled_by_environment" : "next_ccdx_start");
|
|
25
25
|
}
|
|
26
|
-
window.dispatchEvent(new CustomEvent("ccdx:application-state", { detail: { id, application: state, pending: pending ||
|
|
26
|
+
window.dispatchEvent(new CustomEvent("ccdx:application-state", { detail: { id, application: state, pending: pending || isMutating() } }));
|
|
27
27
|
}
|
|
28
28
|
function sync(next) {
|
|
29
29
|
const applications = { ...next.applications };
|
|
@@ -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
|
})();
|
package/src/dashboard/console.js
CHANGED
|
@@ -89,7 +89,8 @@
|
|
|
89
89
|
globalThis.ccdxSettingsPreferences = preferences;
|
|
90
90
|
const bark = globalThis.ccdxBarkSettings?.create({ element: el, api });
|
|
91
91
|
const features = globalThis.ccdxDashboardFeatures?.create({ element: el, api, apply: applySettings, change, localize: label });
|
|
92
|
-
const applications = globalThis.ccdxApplications?.create({ element: el, change, localize: label,
|
|
92
|
+
const applications = globalThis.ccdxApplications?.create({ element: el, change, localize: label,
|
|
93
|
+
isBusy: () => settingsPending, isMutating: () => settingsPending && !settingsReadPending });
|
|
93
94
|
globalThis.ccdxApplicationControls = applications;
|
|
94
95
|
const states = { needs_github_access: "image_needs_github", image_model_unavailable: "image_no_models", immediate: "effective_now", terminal_unavailable: "terminal_animation_unavailable_in_this_output_mode", next_start: "next_ccdx_start", next_call: "applies_to_new_calls", needs_setup: "setup_required",
|
|
95
96
|
next_config_request: "next_configuration_request_cached_suggestions_may_remain", needs_app_relaunch: "reopen_the_client_to_finish", needs_service_restart: "restart_ccdx_to_finish" };
|
|
@@ -201,11 +202,12 @@
|
|
|
201
202
|
async function loadSettings() {
|
|
202
203
|
if (settingsPending) return settingsReadPending;
|
|
203
204
|
settingsPending = true;
|
|
205
|
+
settingsReadPending = api();
|
|
204
206
|
applications?.render();
|
|
205
207
|
el("terminal-color-theme").disabled = true;
|
|
206
208
|
syncAccountControls();
|
|
207
209
|
const readVersion = preferences?.version;
|
|
208
|
-
try {
|
|
210
|
+
try { applySettings(await settingsReadPending, { readVersion });settingsReadAt = time(Date.now());void globalThis.ccdxConnections?.load(); }
|
|
209
211
|
catch (error) {
|
|
210
212
|
for (const id of ["settings-note", ...(settingsViews.includes(current) ? ["page-settings-note"] : [])]) {
|
|
211
213
|
label(el(id), settingsReadAt ? "showing_previous_data_updated_time" : "could_not_read_settings", { time: settingsReadAt });
|