codex-copilot-dx 1.3.23 → 1.3.25

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  Use your model services in **Codex App, Claude App and Claude Code** through one local gateway.
4
4
 
5
- On macOS, the optional Gemini integration adds Copilot Carbon and Argon to the original App's Antigravity. Ordinary Gemini chat keeps Google. Set it up on the Gemini page; inspect it with `ccdx app gemini status`. Existing clients keep their setup.
5
+ On macOS, the optional Gemini integration adds Copilot Carbon and Argon to the original App's Antigravity. Ordinary Gemini chat keeps Google. Set it up on the Antigravity page; inspect it with `ccdx app antigravity status`. Existing clients keep their setup.
6
6
 
7
7
  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
8
 
@@ -30,7 +30,7 @@ On Windows, use `npm.cmd` or `ccdx.cmd` if PowerShell blocks npm-generated scrip
30
30
 
31
31
  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.
32
32
 
33
- 1. **Model sources:** connect an account or API, read its models and choose allowed apps.
33
+ 1. **Model sources:** connect an account or API, read its models, choose allowed apps and save. Source tabs only change the view.
34
34
  2. **Codex / Claude:** choose visible models, set a default and save. Preview and synchronize client settings when needed.
35
35
  3. **Overview / Requests:** check configuration, activity and errors.
36
36
  4. **Usage → Context:** inspect reported input, model windows and observed compactions from this run.
@@ -50,7 +50,7 @@ Model availability depends on your account and service. Microsoft 365 also requi
50
50
  | Sign in again | `ccdx source github reauth` |
51
51
  | Choose client models | `ccdx app codex models --edit` |
52
52
  | Preview client setup | `ccdx app claude-app sync --preview` |
53
- | Set up Gemini Antigravity | `ccdx app gemini status` / `enable` / `open` |
53
+ | Set up Antigravity | `ccdx app antigravity status` / `enable` / `open` |
54
54
  | Inspect failures | `ccdx requests --failed` |
55
55
  | Read usage | `ccdx usage` / `ccdx usage --scope run` |
56
56
  | Inspect preferences | `ccdx config show --effective` |
@@ -17,6 +17,11 @@ Client integration, image tools and the dashboard are not a general plugin frame
17
17
 
18
18
  ## Gemini native boundary
19
19
 
20
+ Antigravity tool schemas are converted to Chat Completions schemas. Object schemas always include an explicit `properties` map, including zero-argument functions. The upstream Copilot service rejects native schemas that omit that map. Pausing Copilot access keeps model choices visible while generation remains gated.
21
+
22
+ 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.
23
+
24
+
20
25
  `gemini-app.mjs` verifies the installed App and prepares a process-local
21
26
  `CLOUD_CODE_URL` launch without editing its bundle or closing a running App.
22
27
  `antigravity-runtime.mjs` owns explicit enablement, source-history protection and
@@ -40,7 +45,7 @@ No independent WebKit client or private WebKit SPI is included.
40
45
 
41
46
  ## Composition and lifecycle
42
47
 
43
- ### Manual connection graph (1.2.13)
48
+ ### Manual connection graph
44
49
 
45
50
  `provider-runtime.mjs` composes built-in lifecycle with `connection-runtime.mjs`,
46
51
  which owns grants, switches, versioned model-deployment bindings and lifecycle. `access-settings.mjs`
@@ -703,19 +708,19 @@ workflow and GitHub Release must deliver those same package bytes. WebUI source
703
708
  selection and Auto Review remain under Codex; M365 lifecycle stays in source
704
709
  management. CLI and UI share advertised effort filtering and preference writes.
705
710
 
706
- ## Independent appearance settings (1.2.2)
711
+ ## Independent appearance settings
707
712
 
708
713
  Web color (`green` / `klein` / `pink` / `mono`) and dark/light mode are browser-local presentation state applied before CSS in `dashboard/theme.js`. CSS semantic roles keep errors/warnings separate from theme accents. Terminal color (`green`, `klein`, `pink`, `mono`, `orange`) uses a distinct `terminal_color_theme` config field; animation continues to use `terminal_animation`. `terminal-colors.mjs` owns terminal color capability checks and escaping, while the existing layout runs on plain text first. The one-per-second coherent settings snapshot carries terminal color; animation frames introduce no additional settings reads. No inference, provider-routing or installer dependency is added.
709
714
 
710
715
  The existing same-origin bounded settings action saves terminal color through the strict locked atomic writer, then applies it to the live console. Read or save failures retain existing files and controls revert to the last confirmed choice. Model-list check errors project only bounded public diagnostic fields; UI associates them with the selected source and its last successful snapshot. Existing generation checks, cancellation and deduplication prevent late results from replacing another source's data.
711
716
 
712
- ## Activity presentation and Messages timing (1.2.8)
717
+ ## Activity presentation and Messages timing
713
718
 
714
719
  The existing status payload projects `model_activity.active` from the three fixed inference route counters plus actual image-generation activity, never total HTTP activity or image MCP calls. It adds no history store, provider request or listener. `dashboard/activity.js` consumes this metadata through the existing refresh path, expires stale evidence after six seconds and pauses offscreen animation. Idle, active and unknown remain distinct; CSS owns six theme-colored dots and the idle-only halo. Terminal Cache hit reads the existing raw runtime aggregate rather than deriving a ratio from rounded display numbers.
715
720
 
716
721
  The Claude gateway still relays original native SSE bytes. `stream-performance.mjs` classifies only nonempty text, thinking and tool-argument deltas as first output; empty and signature-only deltas remain transport metadata. Sparse/interleaved blocks are not reordered or translated. Existing provider generations, locked atomic settings writes, cancellation and route ownership remain the composition boundaries.
717
722
 
718
- ## Dashboard layout and information scopes (1.2.9)
723
+ ## Dashboard layout and information scopes
719
724
 
720
725
  The existing CSS grid reserves explicit header/body/footer tracks; the body owns spare space from the full-height sidebar. The header uses an opaque themed sticky surface, stable action slots and a deliberate compact toolbar. Scrollbar space is stable, with an always-scroll fallback for older engines. `console.js` owns route titles, scroll reset and main-content focus; refresh code does not navigate or reset scroll.
721
726
 
@@ -723,7 +728,7 @@ The eight existing views remain. `status.js` groups Overview clients by applicat
723
728
 
724
729
  HTML owns grouping: Codex buffer maintenance is separate from request performance, usage filters sit with the data they actually control, Requests prioritizes recent records and folds bounded technical fields into each row, and Checks & repairs owns runtime diagnostics. Settings owns preferences and updates. Request expansion is preserved by bounded request keys, and literal upstream values still use text nodes. Existing settings transactions, same-origin protections and confirmations remain in use; action failures target the affected controls. No framework, runtime dependency, endpoint, log scan, model call or installer policy is added.
725
730
 
726
- ## Catalog failure evidence and controls (1.2.10)
731
+ ## Catalog failure evidence and controls
727
732
 
728
733
  `providers/m365-catalog-diagnostic.mjs` classifies model-list HTTP failures using
729
734
  fixed causes. The one known Entra-disabled message is recognized exactly; other
@@ -743,7 +748,7 @@ in per-model details. Usage trends and summaries are peer panels, still loaded o
743
748
  demand. Saved/effective preference differences are shown only when relevant.
744
749
 
745
750
 
746
- ## Active request projection and restrained motion (1.2.11)
751
+ ## Active request projection and restrained motion
747
752
 
748
753
  `stream-performance.mjs` remains the timing/outcome owner. Each metrics instance
749
754
  retains at most 64 active snapshot closures; `finish` removes them idempotently.
@@ -779,7 +784,7 @@ the last row and following details use whitespace. Programmatic main-content
779
784
  focus has no frame; interactive keyboard focus remains visible.
780
785
 
781
786
 
782
- ## Flow layout and client-hint correction (1.2.12)
787
+ ## Flow layout and client-hint correction
783
788
 
784
789
  `request-application.mjs` normalizes bounded scalar hints using an explicit map.
785
790
  The map now recognizes `Codex Desktop`, observed in local desktop session metadata
@@ -805,7 +810,7 @@ styling keeps the M365 navigation link semantically a link while matching the
805
810
  existing GitHub shortcut; wording describes navigation rather than a silent check.
806
811
  No new polling, framework, runtime dependency, setting or endpoint is introduced.
807
812
 
808
- ## Catalog transactions and default identity (1.2.20)
813
+ ## Catalog transactions and default identity
809
814
 
810
815
  GitHub dashboard catalog reads use the existing `profile-model-runtime.mjs` single-flight through an injected refresh callback, rather than a second independent directory request. Successful publication updates the shared provider registry/endpoint cache, and the dashboard rereads connection candidates while preserving drafts. Explicit reads report refresh failures instead of presenting the last-good fallback as fresh success. Credential changes during a read reject publication; catalog browsing never synchronizes client files or changes selected deployments, defaults, grants or native authentication.
811
816
 
@@ -986,7 +991,7 @@ Geometry and SVG identity reuse from 1.2.23 remain in place, with hidden/stale/
986
991
  reduced-motion behavior and summary tables preserved.
987
992
 
988
993
 
989
- ## Model presentation and shared source impact (1.2.31)
994
+ ## Model presentation and shared source impact
990
995
 
991
996
  `model-display.mjs` is a pure presentation fallback. `api-model-display.mjs` retains bounded upstream names beside maker declarations in the existing revision-bound, rebuildable cache. `providers/api.mjs` exposes that evidence to `client-model-plan.mjs`, which disambiguates presentation independently of route identity. Claude uses labelOverride for client aliases regardless of the default source. No connection-schema or routing-ID migration is introduced. Existing client-file ordering and manual ownership remain authoritative.
992
997
 
@@ -1052,7 +1057,7 @@ Source-catalog tables keep fixed column geometry while native disclosures expand
1052
1057
 
1053
1058
  A full snapshot keeps a local map of compiled client plans, including reuse during source-impact projection. Public data remains cloned and contains the same revisions/route identifiers. No persistent or global cache is added. `updateAccessSettings` retains strict validation, the lock and original-byte v1 backup, then skips an atomic rewrite only when serialized bytes already match. Skipping a file write does not skip an explicit control action or client sync.
1054
1059
 
1055
- The CLI keeps only command/version/status fundamentals before its early command dispatch. Existing tool implementations are imported in their branches; startup composition loads afterward in its previous dependency order. Native account stores, source/key identity, model projections and image/prediction behavior are unchanged. The repository-only `docs/STATE_REFACTOR_PLAN.md` records included boundaries, local measurements and deferred work.
1060
+ The CLI keeps only command/version/status fundamentals before its early command dispatch. Existing tool implementations are imported in their branches; startup composition loads afterward in its previous dependency order. Native account stores, source/key identity, model projections and image/prediction behavior are unchanged.
1056
1061
 
1057
1062
  ### Context observations
1058
1063
 
@@ -1160,13 +1165,13 @@ Claude App 3.x and 4.x share the inspected effort-capable adapter. Later unknown
1160
1165
 
1161
1166
  Usage presentation maps configured api_ identifiers to current provider labels after aggregation. Rows, chart filters and historical statistics keep their original keys. Provider-label changes refresh only the table/model labels, preserving the selected raw model key, day and existing chart nodes. The native capability replay disables usage persistence and gives its process a temporary usage path; no production filter recognizes test model names or response IDs.
1162
1167
 
1163
- ## Native image recovery and request correlation (1.3.17)
1168
+ ## Native image recovery and request correlation
1164
1169
 
1165
1170
  `image-control.mjs` owns explicit check/repair/open operations for WebUI and terminal commands, reusing client configuration, host preparation and the existing prediction-aware launcher. Repair cannot kill an App or start another service. `image-host-state.mjs` retains bounded, process-local host evidence; the stdio bridge reports initialization and successful new-thread registration through the protected same-origin settings channel without blocking model traffic. Reporter work is bounded and aborted when the original CLI exits. Runtime evidence never contains prompts, images, paths or raw chat identifiers and cannot establish registration in unobserved chats. Manual loopback checks echo a nonce and explicitly identify their Node-only scope.
1166
1171
 
1167
1172
  The existing salted session observation is projected into request metadata. Active requests can reference the previous retained request from the same anonymous session, application and provider; this does not change request routing, history or tool caches. Chat endpoint recognition accepts both `/chat/completions` and `/v1/chat/completions`. Bare JSON error lines in a Messages event stream terminate with an explicit protocol diagnostic rather than waiting for message_stop; normal SSE frames retain their bytes.
1168
1173
 
1169
- ## Boundary reliability (1.3.18)
1174
+ ## Boundary reliability
1170
1175
 
1171
1176
  Native image failures cancel the vendor response and project safe JSON; API Responses compatibility consumes the existing sanitized error once and retains its metadata. Image history collection records whether the current container appended references instead of rescanning previous containers.
1172
1177
 
@@ -1174,7 +1179,7 @@ The stdio host uses a paused-source line pump only while a destination is blocke
1174
1179
 
1175
1180
  `bounded-file.mjs` and `atomic-file.mjs` provide asynchronous bounded reads and durable single/paired writes for request-path state. Other synchronous configuration callers retain their APIs. Conversation admission and company-account guards use abortable asynchronous lock waiting with their prior timeout/stale policy. Messages transfer plans reserve in-process ownership while committing; primary and marker writes retain rollback behavior. JSON/SSE delivery awaits the applicable commit, and settled source checks keep a synchronous cached path. No new cache, file format or provider-selection policy is introduced.
1176
1181
 
1177
- ## Shared Codex App restart and source reliability (1.3.19)
1182
+ ## Shared Codex App restart and source reliability
1178
1183
 
1179
1184
  The image and input-suggestion panels share `codex-launch-control.mjs`. `codex-app-control.mjs` associates live host reports with the verified macOS App by process ancestry and checks its prediction PAC argument without treating another process's host or an unobserved chat as proof. Its AppKit control targets only the verified bundle path and PID. A restart requires an explicit user action, prepares enabled routes, asks the App to quit normally, waits for exit, applies any pending prediction display setting and then uses the existing launcher. A refusal, unknown identity, multiple Apps or timeout stops the action without force-quit. A failed post-close display write stays pending and is reported after the App is reopened. Host evidence is accepted independently of serialized settings operations so a restarting App's short-lived report is not lost behind its own restart. Later host tool events also re-establish evidence if CCDX restarted while the host remained live.
1180
1185
 
@@ -1182,7 +1187,7 @@ The managed Codex catalog projects explicit source input modalities ahead of nat
1182
1187
 
1183
1188
  `safe-upstream-error.mjs` reads only failed image or custom API responses, with a 64 KiB size bound, a 200 ms timer and four concurrent readers. Only fixed code/status pairs and local messages escape the reader. Original status, stable CCDX codes and validated Retry-After remain intact. Error-header callbacks normally release request admission before the optional body read; an eligible explicit compatibility rejection retains admission through its one retry. Image processing slots are released before their error read. Count-token singleflight forwards callbacks only to the appropriate waiters. Successful requests never invoke the reader.
1184
1189
 
1185
- ## Client updates and streaming boundaries (1.3.20)
1190
+ ## Client updates and streaming boundaries
1186
1191
 
1187
1192
  `client-versions.mjs` inspects bounded local App metadata asynchronously after service readiness. It coalesces checks, preserves a corrupt observation file, and atomically records only installed versions, builds and change times. A timed-out inspection cannot block service startup or inference. The current App process and actual capability adoption remain unverified. A detected unrecognized system Claude App major prevents later writes to shared capability fields without changing existing routing or model aliases. The existing model-refresh timer, manual checks and a nonblocking service-reuse notification schedule observation; a disabled timer leaves startup and manual checks available.
1188
1193
 
package/docs/README.md CHANGED
@@ -1,19 +1,9 @@
1
1
  # Documentation
2
2
 
3
- - [Quick start](../README.md): install, connect sources and choose app models.
4
- - [Reference](REFERENCE.md): commands, settings, diagnostics, images and native suggestions.
5
- - [Architecture](ARCHITECTURE.md): module ownership and runtime boundaries.
6
- - [State orchestration](STATE_REFACTOR_PLAN.md): implemented boundaries, preservation checks and deferred work.
7
- - [1.3.6](RELEASE_1.3.6.md): optional local masking, complete stream frames and atomic capability updates.
8
- - [1.3.5](RELEASE_1.3.5.md): protocol-first App checks, bounded prediction transport and incremental usage analytics.
9
- - [1.3.4](RELEASE_1.3.4.md): centered Auto refresh labels at compact control heights.
10
- - [1.3.3](RELEASE_1.3.3.md): live activity updates and compact WebUI spacing.
11
- - [1.3.2](RELEASE_1.3.2.md): protected App keys, bounded diagnostics and coalesced usage reads.
12
- - [1.3.1](RELEASE_1.3.1.md): bounded context observations and anchored WebUI details.
13
- - [1.3.0](RELEASE_1.3.0.md): scope, compatibility changes and verification.
3
+ - [Quick start](../README.md): install CCDX, connect model sources and choose app models.
4
+ - [Reference](REFERENCE.md): current commands, settings, diagnostics and recovery.
5
+ - [Architecture](ARCHITECTURE.md): runtime ownership, protocols and security boundaries.
6
+ - [Current release](RELEASE.md): user-facing changes and unverified scope.
7
+ - [Benchmark fixtures](../scripts/fixtures/README.md): test-image provenance.
14
8
 
15
- CLI help describes the installed package. The running service can be an older version until its next normal restart.
16
-
17
- Historical `RELEASE_*.md` files record their own source revision and test environment. They remain engineering evidence, not current installation instructions. GitHub Release cleanup does not remove Git history or npm versions.
18
-
19
- [Benchmark fixtures](../scripts/fixtures/README.md) document test-image provenance.
9
+ CLI help describes the installed package. The running service uses its loaded version until its next normal restart. Historical release records remain in GitHub Releases and Git history.
package/docs/REFERENCE.md CHANGED
@@ -54,17 +54,28 @@ For scripts, source access accepts `--apps codex,claude-app` with `--edit`; edit
54
54
 
55
55
  An app model file contains `deployments: [{"source":"github","model":"<model-id>"}]`, with optional `default_model` and `auto_sync`. An explicit empty array clears the default and pauses access. A file without `deployments` is rejected. Unavailable saved selections remain visible until the user changes them.
56
56
 
57
- ## Gemini App and Antigravity (candidate)
57
+ ## Antigravity in Gemini App
58
58
 
59
- The optional **Gemini** page and `ccdx app gemini status|models|enable|disable|open`
59
+ The **Antigravity** page and `ccdx app antigravity status|models|enable|disable|open`
60
60
  manage the original macOS Gemini App. Enable requires acceptance of this data
61
61
  scope: Antigravity main answers follow the selected Google or Copilot model;
62
62
  all Antigravity summaries, searches and image generation use GitHub Copilot,
63
63
  including background work from Google-model sessions. Ordinary Gemini chat
64
64
  keeps its Google route. No OpenAI account or search fallback is used.
65
65
 
66
- `app list` uses already observed Gemini state without waiting for native App
67
- inspection. Use `app gemini status` to check the signed installation explicitly.
66
+ `app list` includes Antigravity before its first WebUI visit and uses observed state without waiting for native App
67
+ inspection. Use `app antigravity status` to check the signed installation explicitly.
68
+ The old `app gemini` commands remain available. Authorize Antigravity on the GitHub
69
+ Copilot source page, or with `source github access --edit --apps codex,antigravity --yes`.
70
+ Choose its exposed models on the Antigravity page or with
71
+ `app antigravity models --edit`. A model file uses `{"models":["<ccdx-copilot-model-id>"]}`.
72
+ After saving, the Antigravity page reports whether the client has fetched the current model list. If the list is pending, reopen Gemini through CCDX.
73
+
74
+ The WebUI uses one authorization form for GitHub Copilot, Microsoft 365 and custom APIs. Source switches apply immediately. App-authorization and model checkboxes are drafts until **Save**; **Discard changes** restores the saved selection. Drafts survive refresh and navigation. Source authorization does not choose app models.
75
+
76
+ Pausing Antigravity Copilot access retains its saved model selection. Native Google model routes remain available; Copilot models and all Antigravity background summaries, searches and images use Copilot. The connection indicator reports observed requests separately from enabled access, and connection activity includes discovery/control requests.
77
+
78
+ The page distinguishes enabled access from an observed client connection.
68
79
 
69
80
  Carbon and Argon appear with Low, Medium and High reasoning levels when the
70
81
  Copilot account advertises them. Google models, account controls and defaults
@@ -107,7 +118,7 @@ Clicking the Web UI logo plays one brief rotation and keeps its Overview navigat
107
118
 
108
119
  Upgrades retain saved account bindings, source IDs, key references, model choices/defaults and capability overrides. Native account stores keep their existing owner; bookkeeping does not request another login. Unchanged client settings need no repeat save or synchronization. Explicit user changes and ordinary credential renewal keep their current behavior.
109
120
 
110
- Sources own accounts, API addresses, keys and model capabilities. Apps own visible models and defaults. Allowing an app to use a source does not select all its models. Selecting no models pauses that app. Settings owns service preferences and appearance, not model routing. An unchanged graph save keeps the file bytes and modification time; explicit sync, refresh and credential actions still run. Existing v1 configuration is backed up byte-for-byte before its first v2 write; reads do not migrate files.
121
+ Sources own accounts, API addresses, keys and model capabilities. The model directory lists protocol-compatible apps; local grants and exclusion details separately show whether an app may currently use a model. Apps own visible models and defaults. Allowing an app to use a source does not select all its models. Selecting no models pauses managed Codex/Claude conversation routing. Antigravity’s Copilot switch also controls its background requests. Settings owns service preferences and appearance, not model routing. An unchanged graph save keeps the file bytes and modification time; explicit sync, refresh and credential actions still run. Existing v1 configuration is backed up byte-for-byte before its first v2 write; reads do not migrate files.
111
122
 
112
123
  In the Web UI, **Model sources → Add API** saves the source and immediately reads its catalog. A failed read keeps the saved source and editor. Select supported models and their declared interfaces before assigning them to apps. Table details expand downward without shifting their controls or redistributing columns, including request metadata and check results. API-editor capability details open below their model row; manual overrides are separate from reported metadata.
113
124
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-copilot-dx",
3
- "version": "1.3.23",
3
+ "version": "1.3.25",
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
@@ -1,5 +1,6 @@
1
1
  import { imageModelCatalog } from "./image-models.mjs";
2
2
  import http from "node:http";
3
+ import { readUserSettings } from "./user-settings.mjs";
3
4
  import { createNativeImagesHandler } from "./native-images.mjs";
4
5
  import { defaultCopilotClient } from "./copilot.mjs";
5
6
  import { buildCodexModelResponse } from "./codex-model-catalog.mjs";
@@ -245,7 +246,10 @@ export function createAdapterHandler(options = {}) {
245
246
  }
246
247
  try { snapshot.local_privacy = privacy.snapshot(); }
247
248
  catch { snapshot.local_privacy = { state: "error", error: "ccdx_privacy_settings_invalid" }; }
248
- return { ...snapshot, ...(antigravity ? { gemini: antigravity.snapshot() } : {}), http_errors: httpErrors.snapshot(), ...(providers ? { providers } : {}) };
249
+ let gemini;
250
+ try { const saved=readUserSettings({env:options.env,home:options.dashboardOptions?.home});gemini=antigravity?antigravity.snapshot():{configured:Object.hasOwn(saved,"gemini_antigravity_enabled"),enabled:saved.gemini_antigravity_enabled===true,route_observed:false}; }
251
+ catch { gemini={enabled:false,error:"ccdx_antigravity_settings_invalid"}; }
252
+ return { ...snapshot, gemini, http_errors: httpErrors.snapshot(), ...(providers ? { providers } : {}) };
249
253
  },
250
254
  });
251
255
  const responsesHandler = createResponsesHandler({
@@ -30,6 +30,7 @@ function schemaForChat(schema) {
30
30
  else if (schemaLists.has(key) && Array.isArray(value)) result[key] = value.map(schemaForChat);
31
31
  else result[key] = value;
32
32
  }
33
+ if (result.type === "object" && !Object.hasOwn(result, "properties")) result.properties = {};
33
34
  return result;
34
35
  }
35
36
 
@@ -30,10 +30,10 @@ function groundedSearch(result,query){
30
30
  groundingMetadata:{webSearchQueries:[query],groundingChunks:sources.map(item=>({web:{uri:item.url,title:item.title||item.url}}))}}]};
31
31
  }
32
32
 
33
- export function createAntigravityHandler({client,models=()=>[],enabled=()=>false,privacy,searchFn,imageFn,guardSource,acquireRequest=async()=>()=>{},
33
+ export function createAntigravityHandler({client,models=()=>[],selectedModels=()=>null,enabled=()=>false,privacy,searchFn,imageFn,guardSource,acquireRequest=async()=>()=>{},
34
34
  fetchGoogle=fetch,googleOrigin=GOOGLE_ORIGIN,requestBodyTimeoutMs=120000,upstreamTimeoutMs=180000,streamIdleTimeoutMs=60000}={}) {
35
35
  if(![GOOGLE_ORIGIN,"https://cloudcode-pa.googleapis.com"].includes(googleOrigin))throw new Error("Unrecognized Google control origin");
36
- let active=0,observed=false;
36
+ let active=0,observed=false,catalogModels=null;
37
37
  const counts={total:0,google:0,copilot:0,search:0,images:0,failed:0};
38
38
  const handler=async(req,res)=>{
39
39
  const abort=createRequestAbort(req,res);let release=()=>{},session;
@@ -61,7 +61,8 @@ export function createAntigravityHandler({client,models=()=>[],enabled=()=>false
61
61
  if(generation)markUpstreamHeaders(upstream.status);
62
62
  if(method==="fetchAvailableModels"&&upstream.ok){
63
63
  const value=JSON.parse(await readBoundedResponseText(upstream,{maxBytes:8*1024*1024,signal:abort.signal,label:"Google model catalog"}));
64
- const merged=mergeAntigravityModels(value,models());
64
+ const merged=mergeAntigravityModels(value,models(),selectedModels());
65
+ catalogModels=Object.keys(merged.models).filter(id=>id.startsWith(ANTIGRAVITY_MODEL_PREFIX));
65
66
  res.writeHead(200,{"Content-Type":"application/json","Cache-Control":"no-store"});res.end(JSON.stringify(merged));return;
66
67
  }
67
68
  res.writeHead(upstream.status,safeUpstreamResponseHeaders(upstream.headers));
@@ -74,7 +75,7 @@ export function createAntigravityHandler({client,models=()=>[],enabled=()=>false
74
75
  observed=true;return await native();
75
76
  }
76
77
  if(req.method!=="POST"||!body||typeof body.model!=="string"||!body.request)throw httpError("Invalid Antigravity generation request",400);
77
- const copilotModels=antigravityCopilotModels(models()),selected=copilotModels.find(model=>model.id===body.model);
78
+ const selection=selectedModels(),copilotModels=antigravityCopilotModels(models()),selected=copilotModels.find(model=>model.id===body.model&&(selection===null||selection.includes(model.id)));
78
79
  if(body.requestType==="agent"&&!selected){
79
80
  if(body.model.startsWith(ANTIGRAVITY_MODEL_PREFIX))throw httpError("The selected Copilot model is unavailable",503);
80
81
  await guardSource?.(body,"google",abort.signal);
@@ -109,6 +110,7 @@ export function createAntigravityHandler({client,models=()=>[],enabled=()=>false
109
110
  observeRequestedModel({model:target.model});
110
111
  session=privacy?.prepareSession?await privacy.prepareSession(converted.chat,{protocol:"chat",client:"gemini",signal:abort.signal}):passthrough(converted.chat);
111
112
  const upstream=await client.chatCompletions(session.body,{signal:abort.signal,retryOptions:{retries:0}});
113
+ markUpstreamHeaders(upstream.status);
112
114
  if(!upstream.ok){await upstream.body?.cancel();throw httpError("Copilot generation was refused (HTTP "+upstream.status+")",upstream.status)}
113
115
  if(!stream){
114
116
  const result=chatToAntigravity(JSON.parse(await readBoundedResponseText(upstream,{maxBytes:MAX_REPLY,signal:abort.signal,label:"Copilot response"})),converted.originalNames);
@@ -136,6 +138,6 @@ export function createAntigravityHandler({client,models=()=>[],enabled=()=>false
136
138
  else sendJsonError(res,error,error.statusCode||502);
137
139
  }finally{session?.release();release();abort.cleanup();active--}
138
140
  };
139
- handler.snapshot=()=>({enabled:enabled(),observed,active,...counts});
141
+ handler.snapshot=()=>({enabled:enabled(),observed,catalog_models:catalogModels,active,...counts});
140
142
  return handler;
141
143
  }
@@ -13,9 +13,9 @@ export function antigravityCopilotModels(catalog) {
13
13
  })));
14
14
  }
15
15
 
16
- export function mergeAntigravityModels(googleCatalog,copilotCatalog) {
16
+ export function mergeAntigravityModels(googleCatalog,copilotCatalog,selection=null) {
17
17
  if(!googleCatalog?.models||typeof googleCatalog.models!=="object"||Array.isArray(googleCatalog.models))throw new Error("Unrecognized Google model catalog");
18
- const entries=antigravityCopilotModels(copilotCatalog),models={...googleCatalog.models};
18
+ const entries=antigravityCopilotModels(copilotCatalog).filter(model=>selection===null||selection.includes(model.id)),models={...googleCatalog.models};
19
19
  if(!entries.length)return googleCatalog;
20
20
  const used=new Set(Object.values(models).map(model=>model?.model));let next=500;
21
21
  for(const entry of entries){
@@ -18,7 +18,7 @@ import {withFileLockSync} from "./lock.mjs";
18
18
  import {httpError} from "./http-errors.mjs";
19
19
  import {antigravityCopilotModels} from "./antigravity-models.mjs";
20
20
 
21
- const execute=promisify(execFile),key="gemini_antigravity_enabled";
21
+ const execute=promisify(execFile),key="gemini_antigravity_enabled",modelKey="gemini_antigravity_models";
22
22
 
23
23
  export function createAntigravityRuntime({client,models=()=>[],privacy,home=os.homedir(),env=process.env,inspect=inspectGeminiApp,
24
24
  exec=execute,searchFn,imageFn,guardSource,googleFetch,acquireRequest,readToken=()=>readSavedGithubToken(home),...timeouts}={}) {
@@ -28,7 +28,8 @@ export function createAntigravityRuntime({client,models=()=>[],privacy,home=os.h
28
28
  const settings=()=>{
29
29
  const saved=readUserSettings({...options,strict:true});
30
30
  if(saved[key]!==undefined&&typeof saved[key]!=="boolean")throw httpError("Invalid Gemini integration setting",409);
31
- return {configured:Object.hasOwn(saved,key),enabled:saved[key]===true};
31
+ if(saved[modelKey]!==undefined&&(!Array.isArray(saved[modelKey])||saved[modelKey].length>100||new Set(saved[modelKey]).size!==saved[modelKey].length||saved[modelKey].some(id=>typeof id!=="string"||!/^ccdx-copilot-[a-z0-9-]{1,140}$/.test(id))))throw httpError("Invalid Antigravity model selection",409);
32
+ return {configured:Object.hasOwn(saved,key),enabled:saved[key]===true,selected_models:saved[modelKey]??null};
32
33
  };
33
34
  const available=()=>settings().enabled&&readAccessSettings(options).providers.github?models():[];
34
35
  const sourceGuard=guardSource||((body,source,signal)=>{
@@ -37,18 +38,30 @@ export function createAntigravityRuntime({client,models=()=>[],privacy,home=os.h
37
38
  const profile=source==="github"?"codex:"+githubTokenFingerprint(readToken()||""):"google:gemini-native";
38
39
  return guard("gemini",profile,{messages:[]},{session_id:id},readClientGatewayKeys({...options,create:false}).codex,undefined,signal);
39
40
  });
40
- const handler=createAntigravityHandler({client,models:available,enabled:()=>settings().configured,privacy,searchFn:searchFn||web.search,
41
+ const handler=createAntigravityHandler({client,models:available,selectedModels:()=>settings().selected_models,enabled:()=>settings().configured,privacy,searchFn:searchFn||web.search,
41
42
  imageFn:imageFn||createAntigravityImages({client,models:available,privacy}),guardSource:sourceGuard,fetchGoogle:googleFetch,acquireRequest,...timeouts});
42
43
  function snapshot(){
43
- const config=settings();
44
- return {source:"gemini_antigravity",...config,app,route_observed:handler.snapshot().observed,
44
+ const config=settings(),sourceEnabled=readAccessSettings(options).providers.github,activity=handler.snapshot();
45
+ const listed=antigravityCopilotModels(models()).map(({id,displayName,effort,maxTokens})=>({id,name:displayName,effort,context_window:maxTokens,selected:config.selected_models===null||config.selected_models.includes(id)}));
46
+ const expected=listed.filter(model=>model.selected).map(model=>model.id).sort();
47
+ const reload=config.enabled&&sourceEnabled?(activity.catalog_models===null?null:JSON.stringify([...activity.catalog_models].sort())!==JSON.stringify(expected)):false;
48
+ return {source:"gemini_antigravity",...config,source_enabled:sourceEnabled,models_reload_required:reload,app,route_observed:handler.snapshot().observed,
45
49
  model_source:"Google + GitHub Copilot",background_source:"GitHub Copilot",ordinary_chat_source:"Google (unchanged)",
46
- models:antigravityCopilotModels(available()).map(({id,displayName})=>({id,name:displayName})),activity:handler.snapshot(),last_operation:lastOperation};
50
+ models:listed,activity,last_operation:lastOperation};
47
51
  }
48
52
  async function action(input={},baseUrl){
49
- if(input&&Object.keys(input).some(name=>!["action","accept_background_copilot"].includes(name)))throw httpError("Invalid Gemini operation",400);
53
+ if(input&&Object.keys(input).some(name=>!["action","accept_background_copilot","models"].includes(name)))throw httpError("Invalid Gemini operation",400);
50
54
  const operation=input.action||"status";
51
- if(!["status","enable","disable","open","preview"].includes(operation))throw httpError("Unknown Gemini operation",400);
55
+ if(!["status","summary","models","enable","disable","open","preview"].includes(operation))throw httpError("Unknown Gemini operation",400);
56
+ if(input.models!==undefined&&operation!=="models")throw httpError("Models require the models operation",400);
57
+ if(operation==="models"){
58
+ const ids=input.models,known=new Set(antigravityCopilotModels(models()).map(model=>model.id));
59
+ if(!Array.isArray(ids)||ids.length>100||new Set(ids).size!==ids.length||ids.some(id=>!known.has(id)))throw httpError("Choose available Antigravity models",400);
60
+ const file=userSettingsPath(options);fs.mkdirSync(path.dirname(file),{recursive:true,mode:0o700});
61
+ withFileLockSync(file+".lock",()=>{const saved=readUserSettings({...options,strict:true});atomicWriteFileIfChangedSync(file,JSON.stringify({...saved,[modelKey]:ids},null,2)+"\n",{mode:0o600})});
62
+ lastOperation={action:operation,status:"models_saved"};
63
+ }
64
+ if(operation==="summary")return snapshot();
52
65
  if(["enable","disable"].includes(operation)){
53
66
  if(operation==="enable"&&input.accept_background_copilot!==true)throw httpError("Antigravity background requests use GitHub Copilot; accept this scope before enabling",400);
54
67
  if(operation==="enable")readClientGatewayKeys(options);
@@ -106,8 +106,8 @@ export const MANAGED_COMMANDS = [
106
106
  )
107
107
  ),
108
108
  command("app list", "List client configuration and observed activity", read),
109
- ...["status", "models", "enable", "disable", "open"].map(action => command(`app gemini ${action}`,
110
- ({status:"Inspect Gemini App and Antigravity setup",models:"List Copilot models added to Antigravity",enable:"Enable Antigravity routing and Copilot background requests",disable:"Pause Antigravity Copilot access; reopen Gemini for native routing",open:"Open the original Gemini App with its prepared route"})[action], {...read,...confirm})),
109
+ ...["gemini", "antigravity"].flatMap(app => ["status", "models", "enable", "disable", "open"].map(action => command(`app ${app} ${action}`,
110
+ ({status:"Inspect Gemini App and Antigravity setup",models:"List Copilot models added to Antigravity",enable:"Enable Antigravity routing and Copilot background requests",disable:"Pause Antigravity Copilot access; reopen Gemini for native routing",open:"Open the original Gemini App with its prepared route"})[action], {...read,...confirm,...(action==="models"?{"--edit":"flag","--file":"value"}:{})}))),
111
111
  command("app <app> status", "Show configuration, not process liveness", { ...read, "--details": "flag" }),
112
112
  command("app <app> models", "Show or edit the client's selected model plan", {
113
113
  ...read,
@@ -183,19 +183,27 @@ export async function runManagementCommand(command, options = {}) {
183
183
  writeSettingsPreferences(body, preferenceOptions);return print({ saved: settingsPreferencesSnapshot(preferenceOptions).values, effect: "Saved for the next CCDX start; no service was started" });
184
184
  }
185
185
  if (group === "app") {
186
- if (path[1] === "gemini") {
186
+ if (["gemini", "antigravity"].includes(path[1])) {
187
187
  if (["enable", "disable"].includes(action)) {
188
188
  const preview = { action, background_source: "GitHub Copilot (all Antigravity summaries, searches and image generation)", ordinary_Gemini_chat: "Google; no routing change" };
189
189
  if (flags.preview) return print(preview);
190
190
  output.write(print(preview) + "\n");await confirm(action === "enable" ? "Enable this Antigravity-only routing scope?" : "Pause Copilot access? Reopen Gemini afterward to restore its native route.");
191
191
  }
192
+ if(action==="models"&&flags.edit){
193
+ const state=await request({path:"gemini"});
194
+ const ids=flags.file?readFile().models:(await choose(state.models.map(model=>model.name),state.models.flatMap((model,index)=>model.selected!==false?[index]:[]))).map(index=>state.models[index].id);
195
+ if(!Array.isArray(ids)||new Set(ids).size!==ids.length||ids.some(id=>!state.models.some(model=>model.id===id)))throw new Error("Choose listed Antigravity model IDs.");
196
+ if(flags.preview)return print({models:ids,saved:false});
197
+ await confirm("Save Antigravity model selection? Reopen Gemini afterward to reload it.");
198
+ return print(await request({path:"gemini",body:{action:"models",models:ids}}));
199
+ }
192
200
  const state = await request({ path: "gemini", ...(["status", "models"].includes(action) ? {} : { body: { action: flags.preview ? "preview" : action, ...(action === "enable" ? { accept_background_copilot: true } : {}) }, timeoutMs: 20000 }) });
193
201
  return print(action === "models" ? state.models : state);
194
202
  }
195
203
  const graph = await connection(), snapshot = (await readStatus()).data, view = projectTerminalState(snapshot);
196
204
  if (action === "list") {
197
205
  const clients=[...view.clients];
198
- if(!clients.some(client=>client.id==="gemini"))clients.push({id:"gemini",name:"Gemini · Antigravity",setup:"Not checked",active:null});
206
+ if(!clients.some(client=>client.id==="antigravity"))clients.push({id:"antigravity",name:"Antigravity",setup:"Not checked",active:null});
199
207
  return print(clients, [["id", "ID"], ["name", "Client"], ["setup", "Setup"], ["active", "Active"]]);
200
208
  }
201
209
  const id = ids.app ? CLI_CLIENTS[ids.app] : "codex", client = getClient(graph, id), modelPlan = client.model_plan;
@@ -308,14 +316,22 @@ export async function runManagementCommand(command, options = {}) {
308
316
  return print(source.builtin ? await request({ path: `models/live?provider=${encodeURIComponent(id)}`, timeoutMs: 60000 }) : (await save({ operation: "discover", id })).discovered);
309
317
  }
310
318
  if (action === "access") {
311
- const current = graph.clients.filter(client => client.allowed.includes(id)).map(client => client.id);
312
- if (!flags.edit) return print({ source: id, authorized_clients: current.map(value => Object.keys(CLI_CLIENTS).find(key => CLI_CLIENTS[key] === value)), consuming_clients: graph.source_impacts?.[id]?.clients || [] });
313
- const allowed = flags.apps !== undefined ? flags.apps === "none" ? [] : flags.apps.split(",").map(app => { if (!CLI_CLIENTS[app]) throw new Error("Use listed client IDs, or none.");return CLI_CLIENTS[app]; })
314
- : (await choose(graph.clients.map(client => TERMINAL_CLIENT_NAMES[client.id]), graph.clients.flatMap((client, index) => current.includes(client.id) ? [index] : []))).map(index => graph.clients[index].id);
315
- output.write(print({ source: id, before: current, after: allowed, effect: "Revoked routes are removed; added grants do not select models" }) + "\n");
319
+ const integration=id==="github"?await request({path:"gemini?scope=summary"}):null;
320
+ const candidates=[...graph.clients.filter(client=>id!=="github"||client.id==="codex"),...(integration?[{id:"antigravity",name:"Antigravity"}]:[])];
321
+ const current=[...graph.clients.filter(client=>client.allowed.includes(id)).map(client=>client.id),...(integration?.enabled?["antigravity"]:[])];
322
+ if (!flags.edit) return print({ source: id, authorized_clients: current.map(value => value==="antigravity"?value:Object.keys(CLI_CLIENTS).find(key => CLI_CLIENTS[key] === value)), consuming_clients: graph.source_impacts?.[id]?.clients || [] });
323
+ const allowed = flags.apps !== undefined ? flags.apps === "none" ? [] : flags.apps.split(",").map(app => { const client=app==="antigravity"?app:CLI_CLIENTS[app];if (!candidates.some(item=>item.id===client)) throw new Error("Use listed client IDs, or none.");return client; })
324
+ : (await choose(candidates.map(client => client.name||TERMINAL_CLIENT_NAMES[client.id]), candidates.flatMap((client, index) => current.includes(client.id) ? [index] : []))).map(index => candidates[index].id);
325
+ if(new Set(allowed).size!==allowed.length)throw new Error("Choose unique client IDs.");
326
+ output.write(print({ source: id, before: current, after: allowed, effect: integration?"Antigravity uses Copilot for models and background requests; ordinary Gemini chat keeps Google":"Revoked routes are removed; added grants do not select models" }) + "\n");
316
327
  if (flags.preview) return "Preview only; access unchanged.";await confirm("Save source authorization for these clients?");
317
- const result = await save({ operation: "source_access", id, allowed, impact_revision: graph.source_impacts[id].revision });
318
- return print({ source: id, authorized_clients: result.clients.filter(client => client.allowed.includes(id)).map(client => TERMINAL_CLIENT_NAMES[client.id]), saved: true });
328
+ const base=allowed.filter(value=>value!=="antigravity");
329
+ const result = await save({ operation: "source_access", id, allowed:base, impact_revision: graph.source_impacts[id].revision });
330
+ if(integration&&integration.enabled!==allowed.includes("antigravity")){
331
+ try{await request({path:"gemini",body:{action:allowed.includes("antigravity")?"enable":"disable",...(allowed.includes("antigravity")?{accept_background_copilot:true}:{})}})}
332
+ catch(error){throw new Error("Other client access was saved, but Antigravity access could not be changed: "+error.message)}
333
+ }
334
+ return print({ source: id, authorized_clients: [...result.clients.filter(client => client.allowed.includes(id)).map(client => TERMINAL_CLIENT_NAMES[client.id]),...(allowed.includes("antigravity")?["Antigravity"]:[])], saved: true });
319
335
  }
320
336
  if (["enable", "disable", "remove"].includes(action)) {
321
337
  const impact = graph.source_impacts?.[id];
@@ -311,9 +311,7 @@ export function createConnectionView({ legacy, env, binding, plan, getSource, en
311
311
  return value?.then ? value.then(catalog => catalogVisibility(catalog, source)) : catalogVisibility(value, source);
312
312
  }
313
313
  if (!enabled(input.provider)) throw accessError("ccdx_client_source_disabled", 503);
314
- return catalogVisibility(getSource(input.provider).publicCatalog(
315
- CLIENT_IDS.filter(id => binding(id).enabled && binding(id).allowed.includes(input.provider))
316
- ), input.provider);
314
+ return catalogVisibility(getSource(input.provider).publicCatalog(CLIENT_IDS), input.provider);
317
315
  },
318
316
  };
319
317
  return { imageModels, snapshot, sourceImpact, clientRevision, catalogVisibility, methods };
@@ -9,28 +9,49 @@
9
9
  const apiForm = el("connection-api-form"), clientForm = el("connection-client-form");
10
10
  const node = (tag, text, className) => { const item = document.createElement(tag);if (text !== undefined) item.textContent = text;if (className) item.className = className;return item; };
11
11
  const source = id => data.providers.find(item => item.id === id), client = id => data.clients.find(item => item.id === id);
12
- let accessDraft = null, accessError = null, accessRefresh = [], accessReview = [];
13
- const accessForm = el("m365-app-access");
12
+ const accessDrafts = new Map(), accessResults = new Map();
13
+ const accessForm = el("source-access-form");
14
+ const sameAccess = (a,b) => JSON.stringify([...a].sort()) === JSON.stringify([...b].sort());
15
+ function accessChoices(id) {
16
+ const provider=source(id);if(!provider)return [];
17
+ return [...data.clients.filter(c=>compatible(provider,c.id)),...(id==="github"?[{id:"antigravity",name:"Antigravity"}]:[])];
18
+ }
19
+ function savedAccess(id) {
20
+ return [...data.clients.filter(c=>c.allowed.includes(id)).map(c=>c.id),...(id==="github"&&globalThis.ccdxAntigravity?.state?.enabled?["antigravity"]:[])];
21
+ }
14
22
  function renderAccess() {
15
- if (!accessForm) return;accessForm.hidden = selectedProvider !== "m365";
16
- const saved = data.clients.filter(c => c.allowed.includes("m365")).map(c => c.id), selected = accessDraft || saved;
17
- const area = el("m365-allowed-apps"), focus = area.contains(document.activeElement) ? document.activeElement.value : null;
18
- area.replaceChildren(...data.clients.filter(c => c.enabled).map(c => {
19
- const item = check("m365-app", c.id, selected.includes(c.id), c.name);
20
- item.firstChild.disabled = busy;item.firstChild.addEventListener("change", () => {
21
- accessDraft = [...selected.filter(id => !data.clients.find(c => c.id === id)?.enabled), ...[...area.querySelectorAll("input:checked")].map(input => input.value)];
22
- accessError = null;
23
- renderAccess();[...area.querySelectorAll("input")].find(input => input.value === c.id)?.focus();
24
- });return item;
25
- }));
26
- const dirty = JSON.stringify([...saved].sort()) !== JSON.stringify([...selected].sort());el("m365-access-save").disabled = busy || !dirty;
27
- words(el("m365-access-state"), accessError || (dirty ? "cap_unsaved" : accessReview.length ? "source_apps_review" : accessRefresh.length ? "source_apps_reopen" : saved.length ? "cap_saved" : "source_apps_none"),
28
- { apps: (accessReview.length ? [...new Set([...accessReview, ...accessRefresh])] : accessRefresh).map(id => data.clients.find(c => c.id === id)?.name || id).join(" / ") });
29
- const affected = data.clients.filter(c => !selected.includes(c.id) && (c.source === "m365" || c.deployments?.some(item => item.source === "m365")));
30
- el("m365-access-warning").hidden = !affected.length;words(el("m365-access-warning"), "source_apps_pause", { apps: affected.map(c => c.name).join(" / ") });
31
- if (focus) [...area.querySelectorAll("input")].find(input => input.value === focus)?.focus();
23
+ const id=selectedProvider,provider=source(id),root=el("source-app-access");root.hidden=!provider;if(!provider)return;
24
+ const waiting=id==="github"&&!globalThis.ccdxAntigravity?.state,pending=busy||id==="github"&&Boolean(globalThis.ccdxAntigravity?.pending);
25
+ const saved=savedAccess(id),selected=accessDrafts.get(id)||saved,dirty=!sameAccess(saved,selected),area=el("source-allowed-apps");
26
+ const focus=area.contains(document.activeElement)?document.activeElement.value:null;
27
+ area.replaceChildren(...(waiting?[]:accessChoices(id).map(c=>{
28
+ const item=check("source-app",c.id,selected.includes(c.id),c.name);item.firstChild.disabled=pending;
29
+ item.firstChild.addEventListener("change",()=>{const next=new Set(accessDrafts.get(id)||savedAccess(id));if(item.firstChild.checked)next.add(c.id);else next.delete(c.id);accessDrafts.set(id,[...next]);accessResults.delete(id);renderAccess();[...area.querySelectorAll("input")].find(input=>input.value===c.id)?.focus()});return item;
30
+ })));
31
+ el("source-access-save").disabled=pending||waiting||!dirty;el("source-access-cancel").disabled=pending||!dirty;
32
+ words(el("source-access-save"),busy?"api_saving":"api_save");if(busy)el("source-access-save").setAttribute("aria-busy","true");else el("source-access-save").removeAttribute("aria-busy");
33
+ words(el("source-access-state"),waiting?"reading":dirty?"cap_unsaved":"cap_saved");
34
+ const affected=data.clients.filter(c=>!selected.includes(c.id)&&(c.source===id||c.deployments?.some(item=>item.source===id))).map(c=>c.name);
35
+ if(id==="github"&&saved.includes("antigravity")&&!selected.includes("antigravity"))affected.push("Antigravity");
36
+ el("source-access-warning").hidden=!affected.length;words(el("source-access-warning"),"source_apps_revoke",{apps:affected.join(" / ")});
37
+ const result=accessResults.get(id);el("source-access-note").title=result?.detail||"";if(result)words(el("source-access-note"),result.key,result.args);else{el("source-access-note").removeAttribute("data-i18n");el("source-access-note").textContent="";}
38
+ if(focus)[...area.querySelectorAll("input")].find(input=>input.value===focus)?.focus();
32
39
  }
33
- accessForm?.addEventListener("submit", event => { event.preventDefault();accessError = null;void change({ operation: "source_access", id: "m365", allowed: accessDraft || [] }, result => { accessDraft = null;accessRefresh = result.client_refresh || [];accessReview = result.client_review || [];renderAccess(); }); });
40
+ accessForm.addEventListener("submit",async event=>{
41
+ event.preventDefault();const id=selectedProvider,wanted=accessDrafts.get(id);if(busy||!wanted)return;
42
+ if(id==="github"&&globalThis.ccdxAntigravity?.pending)return;
43
+ busy=true;generation++;let wrote=false,review=[],refresh=[];renderAccess();
44
+ try{
45
+ const allowed=wanted.filter(value=>value!=="antigravity"),before=data.clients.filter(c=>c.allowed.includes(id)).map(c=>c.id);
46
+ if(!sameAccess(allowed,before)){data=await api({operation:"source_access",id,allowed,impact_revision:data.source_impacts[id].revision});review=data.client_review||[];refresh=data.client_refresh||[];wrote=true;}
47
+ if(id==="github"&&globalThis.ccdxAntigravity.state.enabled!==wanted.includes("antigravity")){await globalThis.ccdxAntigravity.setEnabled(wanted.includes("antigravity"));refresh=[...refresh,"antigravity"];wrote=true;}
48
+ accessDrafts.delete(id);
49
+ if(review.length||refresh.length)accessResults.set(id,{key:review.length?"source_apps_review":"source_apps_reopen",args:{apps:[...new Set([...review,...refresh])].map(value=>value==="antigravity"?"Antigravity":data.clients.find(c=>c.id===value)?.name||value).join(" / ")}});else accessResults.delete(id);
50
+ window.dispatchEvent(new CustomEvent("ccdx:connections",{detail:{imageChanged:false}}));void dashboardRefresh.refresh("auth",{force:true});void dashboardRefresh.refresh("status",{force:true});
51
+ }catch(error){accessResults.set(id,{key:wrote?"source_apps_partial":error.message==="ccdx_connections_conflict"?"source_apps_conflict":"source_apps_failed",detail:error.message});}
52
+ finally{busy=false;list();}
53
+ });
54
+ el("source-access-cancel").addEventListener("click",()=>{accessDrafts.delete(selectedProvider);accessResults.delete(selectedProvider);renderAccess()});
34
55
  const compatible = (provider, id) => provider.protocols.includes(id === "codex" ? "responses" : "messages");
35
56
  const selectableSource = (provider, id) => compatible(provider, id)
36
57
  && (provider.builtin || provider.models?.some(model => model.protocols.includes(id === "codex" ? "responses" : "messages")));
@@ -59,11 +80,9 @@
59
80
  const providerList = el("connection-source-list"), clientList = el("connection-client-list"), disabledSources = el("connection-disabled-source-list"), disabledClients = el("connection-disabled-client-list");
60
81
  providerList.replaceChildren();clientList.replaceChildren();disabledSources.replaceChildren();disabledClients.replaceChildren();
61
82
  for (const provider of data.providers) {
62
- const row = node("div", undefined, "connection-row"), info = node("div"), actions = node("div", undefined, "connection-actions");info.append(node("h3", provider.name));
83
+ const row = node("div", undefined, "connection-row"), info = node("div"), actions = node("div", undefined, "connection-actions");info.append(node("h3", provider.enabled ? format("enable_service") : provider.name));
63
84
  if (!provider.builtin) info.append(node("p", provider.base_url, "hint"));
64
85
  if (provider.enabled) {
65
- const allowed = data.clients.filter(c => c.enabled && c.allowed.includes(provider.id)).map(c => c.name).join(" / ");
66
- const line = node("p", undefined, "hint");words(line, "api_allowed_summary", { clients: allowed || format("api_none") });info.append(line);
67
86
  if (provider.discovery?.state === "stale") { const warning = node("p", undefined, "hint");words(warning, "cap_catalog_stale");warning.append(" ", provider.discovery.code);info.append(warning); }
68
87
  if (!provider.builtin) actions.append(button("api_manage", () => editApi(provider)));
69
88
  const toggle = node("input");toggle.type = "checkbox";toggle.checked = true;toggle.setAttribute("role", "switch");toggle.setAttribute("aria-label", format("api_disable_source") + " " + provider.name);
@@ -73,7 +92,7 @@
73
92
  const remove = button("api_remove_source", () => { if (window.confirm(format("api_remove_source_confirm"))) void change({ operation: "remove_api", id: provider.id, impact_revision: data.source_impacts?.[provider.id]?.revision }); });
74
93
  remove.disabled = data.clients.some(c => c.source === provider.id || c.deployments?.some(item => item.source === provider.id));actions.append(remove);
75
94
  }
76
- row.append(info, actions);if (!provider.enabled) disabledSources.append(row);else if (provider.id === selectedProvider) providerList.append(row);
95
+ row.dataset.source = provider.id;row.append(info, actions);if (!provider.enabled) disabledSources.append(row);else if (provider.id === selectedProvider) providerList.append(row);
77
96
  }
78
97
  const current = editingClient && client(editingClient);
79
98
  if (current) {
@@ -133,7 +152,7 @@
133
152
  if (input.operation === "provider" && !input.enabled && error.message === "ccdx_connections_conflict") {
134
153
  try { data = await api();list();disableSource(source(input.id));message("api_impact_changed"); } catch { message(error.message); }return;
135
154
  }
136
- if (input.operation === "source_access") accessError = error.message;else if (["client", "image_model"].includes(input.operation)) words(el("connection-client-note"), error.message);else message(error.message);return;
155
+ if (["client", "image_model"].includes(input.operation)) words(el("connection-client-note"), error.message);else message(error.message);return;
137
156
  }
138
157
  finally { busy = false;if (trigger?.tagName === "BUTTON") { trigger.removeAttribute("aria-busy");trigger.disabled = false;if (oldKey) words(trigger, oldKey);else trigger.textContent = oldText; }
139
158
  if (["client", "preview_client", "image_model"].includes(input.operation)) bindingRows();
@@ -275,7 +294,6 @@
275
294
  apiForm.elements.key_env.value = provider?.key_env || "";keyMode();
276
295
  for (const input of apiForm.querySelectorAll('[name="protocol"]')) input.checked = provider ? Boolean(provider.endpoints?.[input.value]) : input.value !== "chat";
277
296
  setEndpoints(provider?.base_url || "", provider?.endpoints);
278
- const allowed = el("connection-allowed-clients");allowed.replaceChildren(...data.clients.filter(c => c.enabled).map(c => check("allowed", c.id, c.allowed.includes(editing), c.name)));
279
297
  el("connection-model-detail").hidden = true;
280
298
  models = structuredClone(provider?.models || []);selectedModels = new Set(models.map(model => model.id));modelRows();el("connection-manual-model").open = false;el("connection-discover").disabled = !editing;el("connection-model-id").value = "";apiForm.elements.name.focus();
281
299
  words(apiForm.querySelector('button[type="submit"]'), provider ? "api_save" : "api_save_read");
@@ -301,7 +319,7 @@
301
319
  const input = { operation: "save_api", ...(editing ? { id: editing } : {}), key,
302
320
  config: { name: apiForm.elements.name.value.trim(), base_url: apiForm.elements.base.value.trim().replace(/\/+$/, ""), endpoints, auth_header: apiForm.elements.auth_header.value, models: chosenModels,
303
321
  ...(apiForm.elements.key_env.value.trim() ? { key_env: apiForm.elements.key_env.value.trim() } : {}) },
304
- allowed: [...apiForm.querySelectorAll('[name="allowed"]:checked')].map(input => input.value).concat(data.clients.filter(c => !c.enabled && c.allowed.includes(editing)).map(c => c.id)) };
322
+ allowed: data.clients.filter(c => c.allowed.includes(editing)).map(c => c.id) };
305
323
  void (async () => {
306
324
  const saved = await change(input, first ? result => { const provider = result.providers.find(p => !p.builtin && p.name === input.config.name);if (provider) editApi(provider); } : undefined);
307
325
  if (saved && first && editing) await discoverModels();
@@ -474,8 +492,8 @@
474
492
  }
475
493
  const impact = data.source_impacts?.[provider.id];
476
494
  if (!impact) { message("api_impact_unavailable");void load();return; }
477
- const affected = impact.clients;disableRevision = impact.revision;
478
- if (!affected.length) { void change({ operation: "provider", id: provider.id, enabled: false, impact_revision: disableRevision });return; }
495
+ const affected = impact.clients,antigravity=provider.id==="github"&&globalThis.ccdxAntigravity?.state?.enabled;disableRevision = impact.revision;
496
+ if (!affected.length&&!antigravity) { void change({ operation: "provider", id: provider.id, enabled: false, impact_revision: disableRevision });return; }
479
497
  disabling = provider.id;panels("disable");const area = el("connection-replacements");area.replaceChildren();
480
498
  for (const item of affected) {
481
499
  const c = client(item.id), section = node("div", undefined, "source-impact");section.append(node("strong", c.name));
@@ -484,6 +502,7 @@
484
502
  if (item.needs_replacement) { const label = node("label"), select = choice(data.providers.filter(p => p.id !== provider.id && p.enabled && c.allowed.includes(p.id) && selectableSource(p, c.id)));select.name = c.id;select.setAttribute("aria-label", c.name);label.append(select);section.append(label); }
485
503
  area.append(section);
486
504
  }
505
+ if(antigravity){const section=node("div",undefined,"source-impact"),note=node("p",undefined,"hint");section.append(node("strong","Antigravity"));words(note,"source_antigravity_pause");section.append(note);area.append(section);}
487
506
  }
488
507
  el("connection-disable-form").addEventListener("submit", e => { e.preventDefault();void change({ operation: "provider", id: disabling, enabled: false,
489
508
  impact_revision: disableRevision,
@@ -493,6 +512,7 @@
493
512
  el("refresh").addEventListener("click", () => { if (["#models", "#codex", "#claude"].includes(location.hash)) void load(); });
494
513
  window.addEventListener("hashchange", () => { apiForm.elements.key.value = "";mountClient();if (["#models", "#claude", "#codex"].includes(location.hash)) void load(); });
495
514
  window.addEventListener("ccdx:choose-source", event => { if (typeof event.detail?.id === "string" && providerEntries.some(p => p.id === event.detail.id)) chooseProvider(event.detail.id); });
515
+ window.addEventListener("ccdx-gemini-state", () => { if (data) list(); });
496
516
  window.addEventListener("ccdx:source-view", () => { if (data) list(); });
497
517
  window.addEventListener("ccdx:providers", () => { if (desiredSource && providerEntries.some(p => p.id === desiredSource)) { const id = desiredSource;desiredSource = null;chooseProvider(id); }if (data) list(); });
498
518
  new MutationObserver(() => { if (data) list(); }).observe(document.documentElement, { attributes: true, attributeFilter: ["lang"] });
@@ -1,7 +1,7 @@
1
1
  (() => {
2
2
  const el = id => document.getElementById(id);
3
3
  const label = (node, key, values = {}) => globalThis.ccdxLanguage.set(node, key, values);
4
- const titles = { overview: "overview", codex: "Codex", claude: "Claude", gemini: "Gemini", models: "model_services", usage: "usage_and_diagnostics", requests: "request_records", checks: "tools_checks_title", system: "system_and_settings" };
4
+ const titles = { overview: "overview", codex: "Codex", claude: "Claude", gemini: "Antigravity", models: "model_services", usage: "usage_and_diagnostics", requests: "request_records", checks: "tools_checks_title", system: "system_and_settings" };
5
5
  const settingsViews = ["codex", "claude", "models", "system", "checks"];
6
6
  let current = "overview", settings = null, settingsPending = false, stopped = false, timer = null, ticks = 0;
7
7
  let sourceDirty = false, reviewDirty = false, sourceModels = [], modelsPreference = null, sourceGeneration = 0, modelsSource = null;
@@ -1,27 +1,63 @@
1
1
  (() => {
2
2
  const el=id=>document.getElementById(id),language=globalThis.ccdxLanguage;
3
- let busy=false;
3
+ let busy=false,state=null,draft=null,notice=null,pendingAction=null;
4
4
  const words=(id,key)=>language.set(el(id),key);
5
- async function load(action){
6
- if(busy)return;busy=true;
7
- for(const id of ["gemini-enable","gemini-disable","gemini-open","gemini-refresh"])el(id).disabled=true;
5
+ const clear=id=>{el(id).removeAttribute('data-i18n');el(id).removeAttribute('data-i18n-args');el(id).textContent='';el(id).title=''};
6
+ const controls=['gemini-enabled','gemini-open','gemini-refresh','gemini-save','gemini-cancel'];
7
+ const selected=()=>state?.models.filter(model=>model.selected!==false).map(model=>model.id)||[];
8
+ const dirty=()=>draft!==null&&JSON.stringify([...draft].sort())!==JSON.stringify(selected().sort());
9
+ const count=value=>!value?'—':value>=1000000?`${Number((value/1000000).toFixed(2))}M`:value>=1000?`${Number((value/1000).toFixed(1))}K`:String(value);
10
+ function render(){
11
+ for(const id of controls)el(id).disabled=busy||!state;
12
+ if(!state)return;
13
+ if(!busy)el('gemini-enabled').checked=state.enabled;
14
+ el('gemini-save').disabled=busy||!dirty();el('gemini-cancel').disabled=busy||!dirty();
15
+ words('gemini-save',busy&&pendingAction==='models'?'api_saving':'api_save');if(busy&&pendingAction==='models')el('gemini-save').setAttribute('aria-busy','true');else el('gemini-save').removeAttribute('aria-busy');
16
+ words('gemini-draft-state',dirty()?'cap_unsaved':'cap_saved');
17
+ words('gemini-route-state',!state.enabled?'gemini_disabled':state.source_enabled===false?'gemini_source_disabled':state.app.status==='starting'?'gemini_route_waiting':state.models_reload_required===null?'gemini_catalog_unknown':state.models_reload_required?'gemini_models_pending':state.route_observed?'gemini_route_observed':'gemini_route_waiting');
18
+ el('gemini-version').textContent=state.app.version||'—';
19
+ words('gemini-app-state',state.app.status==='running'?'gemini_running':state.app.status==='stopped'?'gemini_stopped':state.app.status==='starting'?'gemini_starting':'gemini_unavailable');
20
+ const needsReload=state.enabled&&state.source_enabled!==false&&(state.models_reload_required===true||state.models_reload_required===null);
21
+ const hint=!state.enabled&&state.app.status==='running'?'gemini_pause_reopen':needsReload?(state.app.status==='running'?(state.models_reload_required===null?'gemini_maybe_reopen':'gemini_reopen'):state.app.status==='stopped'?'gemini_open_to_load':null):null;
22
+ el('gemini-reopen').hidden=!hint;if(hint)words('gemini-reopen',hint);
23
+ el('gemini-open').disabled=busy||state.app.status!=='stopped';
24
+ const list=el('gemini-models'),focus=list.contains(document.activeElement)?document.activeElement.value:null;list.replaceChildren();
25
+ for(const model of state.models){
26
+ const row=document.createElement('tr'),name=document.createElement('td'),label=document.createElement('label'),input=document.createElement('input');
27
+ input.type='checkbox';input.value=model.id;input.checked=(draft||selected()).includes(model.id);input.disabled=busy;input.setAttribute('aria-label',model.name);
28
+ input.addEventListener('change',()=>{const next=new Set(draft||selected());if(input.checked)next.add(model.id);else next.delete(model.id);draft=[...next];notice=null;clear('gemini-note');el('gemini-save').disabled=!dirty();el('gemini-cancel').disabled=!dirty();words('gemini-draft-state',dirty()?'cap_unsaved':'cap_saved')});
29
+ label.append(input,document.createTextNode(model.name.split(' · Copilot')[0]));name.append(label);row.append(name);
30
+ for(const [key,value]of [['source','GitHub Copilot'],['cap_context',count(model.context_window)],['cap_reasoning',language.format(model.effort||'cap_unknown')]]){const cell=document.createElement('td');cell.textContent=value;cell.dataset.label=language.format(key);row.append(cell)}list.append(row);
31
+ }
32
+ if(!state.models.length){const row=document.createElement('tr'),cell=document.createElement('td');cell.colSpan=4;language.set(cell,'gemini_no_models');row.append(cell);list.append(row)}
33
+ if(focus)[...list.querySelectorAll('input')].find(input=>input.value===focus)?.focus();
34
+ for(const id of ['active','failed','copilot','total'])el('gemini-'+id).textContent=state.activity?.[id]??'—';
35
+ if(notice)words('gemini-note',notice);
36
+ }
37
+ async function load(action,extra={},report=true){
38
+ if(busy){if(!report)throw Error('Antigravity settings are busy');return}
39
+ busy=true;pendingAction=action;render();
8
40
  try{
9
- const response=await fetch("/_ccdx/ui/gemini",{method:action?"POST":"GET",headers:{"X-CCDX-Dashboard":"1",...(action?{"Content-Type":"application/json"}:{})},
10
- cache:"no-store",signal:AbortSignal.timeout(20000),...(action?{body:JSON.stringify({action,...(action==="enable"?{accept_background_copilot:true}:{})})}:{})});
11
- const state=await response.json();if(!response.ok)throw new Error(state.error||"Gemini setup failed");
12
- globalThis.ccdxGeminiStatus=state;window.dispatchEvent(new Event("ccdx-gemini-state"));
13
- words("gemini-state",state.enabled?"gemini_enabled":"gemini_disabled");
14
- el("gemini-version").textContent=state.app.version||"—";
15
- words("gemini-app-state",state.app.status==="running"?"gemini_running":state.app.status==="stopped"?"gemini_stopped":state.app.status==="starting"?"gemini_starting":"gemini_unavailable");
16
- el("gemini-reopen").hidden=state.app.status!=="running";
17
- const list=el("gemini-models");list.replaceChildren();for(const model of state.models){const item=document.createElement("li");item.textContent=model.name;list.append(item)}
18
- const status=state.last_operation?.status;
19
- const notice=status==="needs_app_relaunch"?"gemini_reopen":status==="opened"?"gemini_opened":status==="route_conflict"?"gemini_conflict":null;
20
- if(notice)words("gemini-note",notice);else el("gemini-note").textContent="";
21
- }catch(error){el("gemini-note").textContent=error.message}
22
- finally{busy=false;for(const id of ["gemini-enable","gemini-disable","gemini-open","gemini-refresh"])el(id).disabled=false}
41
+ const write=action&&action!=='summary',response=await fetch('/_ccdx/ui/gemini'+(action==='summary'?'?scope=summary':''),{method:write?'POST':'GET',headers:{'X-CCDX-Dashboard':'1',...(write?{'Content-Type':'application/json'}:{})},cache:'no-store',signal:AbortSignal.timeout(20000),...(write?{body:JSON.stringify({action,...(action==='enable'?{accept_background_copilot:true}:{}),...extra})}:{})});
42
+ const value=await response.json();if(!response.ok)throw Error(value.error||'Antigravity setup failed');
43
+ state=value;if(action==='models')draft=null;
44
+ globalThis.ccdxGeminiStatus=state;
45
+ if(action&&action!=='summary'){
46
+ const status=state.last_operation?.status;notice=action==='models'?null:status==='needs_app_relaunch'?'gemini_reopen':status==='opened'?'gemini_opened':status==='route_conflict'?'gemini_conflict':null;
47
+ clear('gemini-note');
48
+ }
49
+ return state;
50
+ }catch(error){if(!report)throw error;notice='gemini_operation_failed';words('gemini-note',notice);el('gemini-note').title=error.message}
51
+ finally{busy=false;pendingAction=null;render();window.dispatchEvent(new Event('ccdx-gemini-state'))}
23
52
  }
24
- for(const action of ["enable","disable","open"])el("gemini-"+action).addEventListener("click",()=>void load(action));
25
- el("gemini-refresh").addEventListener("click",()=>void load());
26
- const navigate=()=>{if(location.hash==="#gemini")void load()};window.addEventListener("hashchange",navigate);navigate();
53
+ globalThis.ccdxAntigravity={get state(){return state},get pending(){return busy},setEnabled:enabled=>load(enabled?'enable':'disable',{},false)};
54
+ el('gemini-enabled').addEventListener('change',event=>void load(event.target.checked?'enable':'disable'));
55
+ el('gemini-model-form').addEventListener('submit',event=>{event.preventDefault();if(dirty())void load('models',{models:draft})});
56
+ el('gemini-cancel').addEventListener('click',()=>{draft=null;notice=null;clear('gemini-note');render()});
57
+ el('gemini-open').addEventListener('click',()=>void load('open'));
58
+ el('gemini-refresh').addEventListener('click',()=>void load());
59
+ el('refresh').addEventListener('click',()=>{if(['#gemini','#models'].includes(location.hash))void load(location.hash==='#models'?'summary':undefined)});
60
+ window.addEventListener('hashchange',()=>{if(['#gemini','#models'].includes(location.hash))void load(location.hash==='#models'?'summary':undefined)});
61
+ new MutationObserver(render).observe(document.documentElement,{attributes:true,attributeFilter:['lang']});
62
+ void load(location.hash==='#gemini'?undefined:'summary');
27
63
  })();
@@ -20,7 +20,7 @@
20
20
  <span class="nav-group" data-i18n="clients">Apps</span>
21
21
  <a class="nav-child" href="#codex" data-route="codex"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><rect x="3" y="3" width="18" height="18" rx="2"/><path d="m7 8 4 4-4 4m7 0h3"/></svg><span>Codex</span></a>
22
22
  <a class="nav-child" href="#claude" data-route="claude"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M21 15a3 3 0 0 1-3 3H8l-5 3V6a3 3 0 0 1 3-3h12a3 3 0 0 1 3 3Z"/></svg><span>Claude</span></a>
23
- <a class="nav-child" href="#gemini" data-route="gemini"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2c1 6 4 9 10 10-6 1-9 4-10 10C11 16 8 13 2 12c6-1 9-4 10-10Z"/></svg><span>Gemini</span></a>
23
+ <a class="nav-child" href="#gemini" data-route="gemini"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true"><path d="M12 2c1 6 4 9 10 10-6 1-9 4-10 10C11 16 8 13 2 12c6-1 9-4 10-10Z"/></svg><span>Antigravity</span></a>
24
24
  <a href="#models" data-route="models"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="m12 3 10 5-10 5L2 8Zm-10 9 10 5 10-5M2 16l10 5 10-5"/></svg><span data-i18n="model_services">Model sources</span></a>
25
25
  <a href="#usage" data-route="usage"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M3 3v18h18M7 16v-5m5 5V7m5 9V4"/></svg><span data-i18n="usage_and_diagnostics">Usage</span></a>
26
26
  <a href="#requests" data-route="requests"><svg class="nav-icon" viewBox="0 0 24 24" aria-hidden="true" focusable="false"><path d="M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"/></svg><span data-i18n="request_records">Requests</span></a>
@@ -163,15 +163,27 @@
163
163
  </details>
164
164
  </div>
165
165
  <div data-view="gemini" hidden>
166
+ <section class="connection-access"><div class="connection-row"><label for="gemini-enabled" data-i18n="gemini_access_title">Copilot access</label><label class="switch-hit"><input id="gemini-enabled" type="checkbox" role="switch" data-i18n-label="gemini_access_title" aria-label="Copilot access" disabled></label></div></section>
166
167
  <section class="panel dashboard-section">
167
- <h2>Gemini · Antigravity</h2>
168
- <p id="gemini-state" data-i18n="gemini_disabled">Copilot integration is off</p>
169
- <p id="gemini-app-state">—</p><p><span data-i18n="gemini_version">Version</span>: <span id="gemini-version">—</span></p>
170
- <p class="hint" data-i18n="gemini_scope">Antigravity summaries, searches and image generation use Copilot. Ordinary Gemini chat keeps Google.</p>
171
- <div class="connection-actions"><button id="gemini-enable" type="button" data-i18n="gemini_enable">Enable Antigravity</button><button id="gemini-disable" type="button" data-i18n="gemini_disable">Pause Copilot</button><button id="gemini-open" type="button" data-i18n="gemini_open">Open Gemini</button><button id="gemini-refresh" type="button" data-i18n="refresh">Refresh</button></div>
172
- <p id="gemini-reopen" class="hint" data-i18n="gemini_reopen" hidden>Quit Gemini, then open it here. Active apps are never restarted automatically.</p>
173
- <ul id="gemini-models"></ul><p id="gemini-note" class="hint" role="status"></p>
168
+ <div class="panel-heading"><h2 data-i18n="gemini_model_selection">Model selection</h2><span id="gemini-draft-state" role="status">—</span></div>
169
+ <form id="gemini-model-form">
170
+ <div class="table-wrap"><table class="binding-table"><thead><tr><th data-i18n="model">Model</th><th data-i18n="source">Source</th><th data-i18n="cap_context">Context</th><th data-i18n="cap_reasoning">Reasoning</th></tr></thead><tbody id="gemini-models"></tbody></table></div>
171
+ <div class="section-actions"><button id="gemini-save" type="submit" data-i18n="api_save" disabled>Save</button><button id="gemini-cancel" type="button" data-i18n="cap_discard_changes" disabled>Discard changes</button></div>
172
+ </form>
173
+ <p id="gemini-note" class="hint" role="status" aria-live="polite"></p>
174
174
  </section>
175
+ <details class="panel dashboard-section" open>
176
+ <summary data-i18n="connection_details">Connection details</summary>
177
+ <p id="gemini-route-state" class="client-sync-state" role="status">—</p>
178
+ <p class="hint" data-i18n="gemini_scope">Native Google models remain available. Copilot models and background requests use Copilot.</p>
179
+ <p id="gemini-app-state" class="table-note">—</p><p class="hint"><span data-i18n="gemini_version">Version</span>: <span id="gemini-version">—</span></p>
180
+ <p id="gemini-reopen" class="hint" data-i18n="gemini_reopen" hidden>Quit Gemini, then open it here to load CCDX models.</p>
181
+ <div class="section-actions"><button id="gemini-open" type="button" data-i18n="gemini_open">Open Antigravity</button><button id="gemini-refresh" type="button" data-i18n="refresh">Refresh</button><a class="section-link" href="#models" data-source-link="github">GitHub Copilot</a></div>
182
+ </details>
183
+ <details class="panel dashboard-section"><summary data-i18n="gemini_activity">Connection activity</summary>
184
+ <p class="hint" data-i18n="gemini_activity_scope">Includes model requests and client discovery.</p>
185
+ <dl class="stats"><div><dt data-i18n="active">Active</dt><dd id="gemini-active">—</dd></div><div><dt data-i18n="failed">Failed</dt><dd id="gemini-failed">—</dd></div><div><dt data-i18n="gemini_copilot_requests">Copilot requests</dt><dd id="gemini-copilot">—</dd></div><div><dt data-i18n="requests">Requests</dt><dd id="gemini-total">—</dd></div></dl>
186
+ </details>
175
187
  </div>
176
188
 
177
189
  <div data-view="models" hidden>
@@ -195,7 +207,7 @@
195
207
  <label><span data-i18n="api_messages_auth">Messages authentication</span><select name="auth_header"><option value="x-api-key">x-api-key</option><option value="bearer">Bearer token</option></select></label>
196
208
  <label><span data-i18n="api_key_env">Read key from environment</span><input name="key_env" type="text" autocomplete="off" spellcheck="false" placeholder="CCDX_COMPANY_API_KEY"><span class="hint" data-i18n="api_key_env_hint">Optional for servers without a credential service. Set before starting CCDX.</span></label>
197
209
  </div></details>
198
- <fieldset><legend data-i18n="api_allowed_clients">Allowed clients</legend><div class="connection-checks" id="connection-allowed-clients"></div></fieldset>
210
+
199
211
  <fieldset><legend data-i18n="model_catalog">Model list</legend><div class="section-actions"><button type="button" id="connection-discover" data-i18n="api_read_models">Read models</button><button type="button" id="connection-discover-cancel" data-i18n="cancel" hidden>Cancel</button><span class="hint" data-i18n="api_discovery_save_first">Save the API first. No chat request is sent.</span></div>
200
212
  <details class="tool-details" id="connection-manual-model"><summary data-i18n="api_manual_model">Add a model manually</summary><div class="section-actions"><input type="text" id="connection-model-id" spellcheck="false" autocomplete="off" aria-label="Model ID" placeholder="Model ID"><button type="button" id="connection-model-add" data-i18n="api_add_model">Add model</button></div></details>
201
213
  <p class="hint" data-i18n="api_model_protocol_hint">Choose the APIs each model supports.</p><div class="table-wrap"><table><thead><tr><th data-i18n="model">Model</th><th data-i18n="api_protocols">Available APIs</th><th data-i18n="cap_context">Context</th><th data-i18n="cap_reasoning">Reasoning</th><th data-i18n="cap_search">Search</th><th></th></tr></thead><tbody id="connection-models"></tbody></table></div>
@@ -211,7 +223,7 @@
211
223
  <div id="source-account-panel" role="tabpanel">
212
224
  <p id="source-status-note" class="hint" role="status"></p>
213
225
  <section class="panel dashboard-section" id="github-account">
214
- <div class="panel-heading"><h2 data-i18n="account_access">Account &amp; access</h2><span id="github-account-state"></span></div>
226
+ <div class="panel-heading"><h2 data-i18n="source_connection">Account &amp; connection</h2><span id="github-account-state"></span></div>
215
227
  <p id="github-account-name" class="account-name">—</p><p id="github-account-hint" class="hint"></p>
216
228
  <dl id="github-account-fields" class="account-summary"></dl>
217
229
  <div class="section-actions"><button id="github-check" type="button" data-i18n="tools_check_connection">Check connection</button><button id="github-signin" type="button" data-i18n="tools_login">Sign in to GitHub</button><button id="github-force-reauth" type="button" data-i18n="tools_reauth">Sign in again</button></div>
@@ -230,7 +242,7 @@
230
242
  <details class="tool-details"><summary data-i18n="tools_more_actions">More actions</summary><div class="section-actions"><button id="github-logout" type="button" data-i18n="tools_logout">Sign out of CCDX</button></div></details>
231
243
  </section>
232
244
  <section class="panel dashboard-section" id="m365-source-access" hidden aria-labelledby="source-access-heading">
233
- <h2 id="source-access-heading" data-i18n="account_access">Account &amp; access</h2>
245
+ <h2 id="source-access-heading" data-i18n="source_connection">Account &amp; connection</h2>
234
246
 
235
247
  <div class="setting-row"><label for="m365-enabled" data-i18n="enable_service">Enable source</label><input id="m365-enabled" type="checkbox" role="switch" disabled><span id="m365-source-effect" class="hint" role="status"></span></div>
236
248
  <div id="m365-control-note" class="hint" role="status"></div>
@@ -244,14 +256,24 @@
244
256
  <p class="hint" data-i18n="company_account_scope">Applies to Microsoft 365 in Codex and Claude. Start a new conversation after changing accounts.</p>
245
257
  </div>
246
258
  <p id="m365-account-note" class="hint" role="status" aria-live="polite"></p>
247
- <form id="m365-app-access" hidden><fieldset><legend data-i18n="source_allowed_apps">Allowed apps</legend><div class="connection-checks" id="m365-allowed-apps"></div></fieldset><p class="hint" data-i18n="source_apps_hint">Choose models on the app page after granting access.</p><p id="m365-access-warning" class="hint" role="status" hidden></p><div class="section-actions"><button id="m365-access-save" type="submit" data-i18n="api_save" disabled>Save</button><span id="m365-access-state" class="hint" role="status" aria-live="polite"></span></div></form>
259
+
260
+ </section>
261
+ <section class="panel dashboard-section" id="source-app-access" hidden>
262
+ <div class="panel-heading"><h2 id="source-app-access-heading" data-i18n="source_allowed_apps">Allowed apps</h2><span id="source-access-state" class="hint" role="status" aria-live="polite"></span></div>
263
+ <form id="source-access-form">
264
+ <div class="connection-checks" id="source-allowed-apps" role="group" aria-labelledby="source-app-access-heading"></div>
265
+ <p class="hint" data-i18n="source_apps_hint">Choose models on the app page after granting access.</p>
266
+ <p id="source-access-warning" class="hint" role="status" hidden></p>
267
+ <div class="section-actions"><button id="source-access-save" type="submit" data-i18n="api_save" disabled>Save</button><button id="source-access-cancel" type="button" data-i18n="cap_discard_changes" disabled>Discard changes</button></div>
268
+ <p id="source-access-note" class="hint" role="status" aria-live="polite"></p>
269
+ </form>
248
270
  </section>
249
271
  <details class="panel dashboard-section model-catalog" id="upstream-models" open>
250
272
  <summary class="panel-heading"><h2 data-i18n="model_catalog">MODEL LIST</h2><span id="models-state" role="status" aria-live="polite" data-i18n="checking_live">CHECKING</span></summary>
251
273
  <div class="section-actions"><button id="refresh-models" type="button" data-i18n="refresh">Refresh</button></div>
252
274
  <p id="models-note" class="table-note" data-i18n="reading_provider_catalog">Loading model list…</p>
253
275
  <details id="model-check-details" class="model-check-details" hidden><summary data-i18n="source_check_details">Check details</summary><dl id="model-check-fields" class="failure-detail"></dl></details>
254
- <div class="table-wrap"><table><thead><tr><th scope="col" data-i18n="model">MODEL</th><th scope="col" data-i18n="client">APP</th><th scope="col" data-i18n="tools_details">Details</th></tr></thead><tbody id="live-models-body" role="tabpanel"><tr><td colspan="3" data-i18n="loading">Loading…</td></tr></tbody></table></div>
276
+ <div class="table-wrap"><table><thead><tr><th scope="col" data-i18n="model">MODEL</th><th scope="col" data-i18n="catalog_supported_apps">Supported apps</th><th scope="col" data-i18n="tools_details">Details</th></tr></thead><tbody id="live-models-body" role="tabpanel"><tr><td colspan="3" data-i18n="loading">Loading…</td></tr></tbody></table></div>
255
277
  <details class="tool-details"><summary data-i18n="catalog_scope">Catalog scope</summary><p class="hint" data-i18n="catalog_listing_does_not_guarantee_inference_access">Models listed; inference access not verified.</p></details>
256
278
  </details>
257
279
  <details class="panel dashboard-section" id="account-authorization">
@@ -1,14 +1,30 @@
1
1
  (() => {
2
2
  const translations = {
3
+ gemini_access_title: ["Copilot access", "Copilot 接入"],
4
+ gemini_model_selection: ["Model selection", "模型选择"],
5
+ gemini_route_waiting: ["No Antigravity request observed yet", "尚未观察到 Antigravity 请求"],
6
+ gemini_route_observed: ["Antigravity requests observed", "已观察到 Antigravity 请求"],
7
+ gemini_catalog_unknown: ["Client model list not yet confirmed", "尚未确认客户端模型列表"],
8
+ gemini_maybe_reopen: ["If CCDX models are missing, finish your work, quit Gemini, refresh its status, then open it here.", "如未显示 CCDX 模型,请在任务完成后退出 Gemini,刷新状态后从这里打开。"],
9
+ gemini_models_pending: ["Client model list needs reloading", "客户端模型列表待重新加载"],
10
+ gemini_no_models: ["No Copilot models are listed. Check GitHub access in Model sources.", "暂无 Copilot 模型,请在模型来源页检查 GitHub 连接。"],
3
11
  gemini_version: ["Version", "版本"],
4
- gemini_enabled: ["Copilot integration is on", "Copilot 接入已启用"], gemini_disabled: ["Copilot integration is off", "Copilot 接入未启用"],
5
- gemini_scope: ["Antigravity summaries, searches and image generation use Copilot. Ordinary Gemini chat keeps Google.", "Antigravity 的摘要、搜索和图像生成使用 Copilot;Gemini 普通聊天保留 Google。"],
6
- gemini_enable: ["Enable Antigravity", "启用 Antigravity"], gemini_disable: ["Pause Copilot", "停用 Copilot"], gemini_open: ["Open Gemini", "打开 Gemini"],
7
- gemini_reopen: ["Quit Gemini, then open it here. Active apps are never restarted automatically.", "请先退出 Gemini,再从这里打开。CCDX 不会自动重启正在运行的应用。"],
8
- gemini_opened: ["Gemini opened. Route adoption awaits an Antigravity request.", "已打开 Gemini,等待 Antigravity 请求确认接入。"],
12
+ gemini_disabled: ["Copilot access is paused", "Copilot 接入已停用"],
13
+ gemini_source_disabled: ["GitHub Copilot source is disabled. Enable it in Model sources.", "GitHub Copilot 来源已停用,请到模型来源页启用。"],
14
+ gemini_scope: ["Native Google models keep their route. Copilot models and all Antigravity summaries, searches and images use Copilot. Ordinary Gemini chat keeps Google.", "原生 Google 模型保留原路由;Copilot 模型及全部 Antigravity 摘要、搜索和图像使用 Copilot。Gemini 普通聊天保留 Google。"],
15
+ gemini_enable: ["Enable Copilot access", "启用 Copilot 接入"], gemini_disable: ["Pause Copilot access", "停用 Copilot 接入"], gemini_open: ["Open client", "打开客户端"],
16
+ gemini_reopen: ["Quit Gemini when your work finishes, refresh its status, then open it here to reload CCDX models.", "请在任务完成后退出 Gemini,刷新状态后从这里打开,以加载 CCDX 模型。"],
17
+ gemini_pause_reopen: ["Copilot access is paused. Quit Gemini, refresh its status, then open it here to restore its native Google route.", "Copilot 接入已停用。请退出 Gemini,刷新状态后从这里打开,以恢复原生 Google 路由。"],
18
+ gemini_open_to_load: ["Open Gemini here to load CCDX models.", "请从这里打开 Gemini,以加载 CCDX 模型。"],
19
+ gemini_opened: ["Client launch requested. Verify Antigravity access in the client.", "已请求打开客户端,请在 Antigravity 中确认接入。"],
9
20
  gemini_starting: ["Gemini is starting", "Gemini 正在启动"],
10
21
  gemini_conflict: ["An existing gateway route was preserved. Resolve the conflict before opening.", "已保留原有网关路由,请先处理配置冲突。"],
11
22
  gemini_running: ["Gemini is running", "Gemini 正在运行"], gemini_stopped: ["Gemini is closed", "Gemini 已退出"], gemini_unavailable: ["Gemini installation could not be verified", "尚未确认 Gemini 安装状态"],
23
+ gemini_copilot_requests: ["Copilot requests", "Copilot 请求"],
24
+ gemini_activity: ["Connection activity", "接入活动"],
25
+ gemini_activity_scope: ["Includes model requests and client discovery since CCDX started.", "统计本次 CCDX 启动后的模型请求和客户端目录等请求。"],
26
+ gemini_operation_failed: ["Could not update Antigravity. Your model choices are kept; try again.", "Antigravity 操作未完成,模型选择已保留,请重试。"],
27
+ low: ["Low", "低"], medium: ["Medium", "中"], high: ["High", "高"],
12
28
  limit_default: ["Use default", "使用默认值"],
13
29
  ccdx_prediction_app_open: ["Quit Codex, then continue setup here.", "请退出 Codex,再在此继续配置。"], feature_read_failed: ["Settings could not be read. Existing files were preserved.", "无法读取设置,原有文件已保留。"],
14
30
  prediction_setup_again: ["Set up again", "重新配置"], prediction_bridge_missing: ["Not ready. Check and repair, or quit Codex and set up again.", "尚未就绪。请检查修复,或退出 Codex 后重新配置。"],
@@ -137,7 +153,7 @@
137
153
  "api_save_read": ["Save & read models", "保存并读取模型"],
138
154
  "api_read_failed": ["API saved. Model lookup failed; retry here. {code}", "来源已保存;模型读取失败,可在此重试。{code}"],
139
155
  "sync_capability_unverified": ["Client capabilities are unverified; existing settings were kept.", "客户端能力未验证,现有设置已保留。"],
140
- "source_accounts": ["Accounts & APIs", "账号与 API"],
156
+ "source_accounts": ["Sources", "来源"],
141
157
  "sync_config_written": ["Configuration written · reopen the app to load changes", "配置已写入 · 重开应用查看变更"],
142
158
  "sync_manual": ["Selection saved · automatic sync is off", "选择已保存 · 自动同步已关闭"],
143
159
  "sync_preserved": ["Manual settings retained · review sync details", "手工设置已保留 · 查看同步详情"],
@@ -153,11 +169,16 @@
153
169
  "tools_code_copied": ["Copied. Ready to paste.", "已复制,可直接粘贴。"],
154
170
  "tools_code_copy_needed": ["Click copy before pasting.", "点击复制图标后再粘贴。"],
155
171
  "tools_code_copy_failed": ["Select the code and copy it manually.", "请选择验证码,手动复制。"],
172
+ "catalog_supported_apps": ["Supported apps", "支持的应用"],
173
+ "source_connection": ["Account & connection", "账户与连接"],
156
174
  "source_allowed_apps": ["Allowed apps", "允许使用的应用"],
157
175
  "source_apps_hint": ["Choose models on the app page after granting access.", "授权后,在应用页选择模型。"],
158
- "source_apps_none": ["Signed in. No app has access.", "仅保留登录,暂无应用使用。"],
159
- "source_apps_pause": ["Saving stops {apps} from using this source.", "保存后,{apps} 将停止使用此来源。"],
160
- "source_apps_reopen": ["Saved. Reopen {apps} to apply access.", "已保存,重新打开 {apps} 后生效。"],
176
+ "source_antigravity_pause": ["Disabling this source also pauses Antigravity Copilot models, summaries, searches and images. Saved model choices are kept.", "停用此来源也会暂停 Antigravity 的 Copilot 模型、摘要、搜索和图像。已保存的模型选择会保留。"],
177
+ "source_apps_revoke": ["Saving revokes source access for {apps}.", "保存后,{apps} 将无法使用此来源。"],
178
+ "source_apps_failed": ["Could not save app access. Your choices are kept; try again.", "应用授权保存失败,未保存的选择已保留,请重试。"],
179
+ "source_apps_partial": ["Some changes were saved. Remaining choices are kept; try again.", "部分更改已保存,其余选择已保留,请重试。"],
180
+ "source_apps_conflict": ["Settings changed elsewhere. Refresh, review your choices, then save again.", "设置已在其他位置更新,请刷新并复核选择后再保存。"],
181
+ "source_apps_reopen": ["Saved. Open {apps} from its app page to apply access.", "已保存,请从 {apps} 应用页打开客户端以完成接入。"],
161
182
  "source_apps_review": ["Saved. Review {apps} sync results on the app page.", "已保存,请在应用页复核 {apps} 同步结果。"],
162
183
  "catalog_read_network": ["Online read", "在线读取"],
163
184
  "catalog_read_cache": ["Local cache", "本地缓存"],
@@ -377,7 +398,6 @@
377
398
  "api_protocols": ["Available APIs", "可用接口"],
378
399
  "api_endpoint_options": ["Addresses & authentication", "接口地址与认证"],
379
400
  "api_messages_auth": ["Messages authentication", "Messages 认证"],
380
- "api_allowed_clients": ["Allowed clients", "允许使用的客户端"],
381
401
  "api_read_models": ["Read models", "读取模型"],
382
402
  "api_discovery_save_first": ["Reads the model catalog; no inference request.", "只读取模型目录,不发起推理。"],
383
403
  "api_add_model": ["Add model", "添加模型"],
@@ -393,7 +413,6 @@
393
413
  "api_choose_replacements": ["Choose another source or pause each affected client.", "为受影响的客户端换源,或暂停接入。"],
394
414
  "api_confirm_disable": ["Disable", "确认关闭"],
395
415
  "api_pause": ["Pause access", "暂停接入"],
396
- "api_allowed_summary": ["Allowed: {clients}", "允许使用:{clients}"],
397
416
  "api_none": ["Not assigned", "暂未分配"],
398
417
  "api_account": ["Account", "查看账号"],
399
418
  "api_manage": ["Manage", "管理"],
@@ -481,7 +500,7 @@
481
500
  "flow_app_codex_cli": ["Codex CLI", "Codex CLI"],
482
501
  "flow_app_claude_app": ["Claude App", "Claude App"],
483
502
  "flow_app_claude_code": ["Claude Code", "Claude Code"],
484
- "flow_app_gemini_app": ["Gemini · Antigravity", "Gemini · Antigravity"],
503
+ "flow_app_gemini_app": ["Antigravity", "Antigravity"],
485
504
  "flow_app_claude": ["Claude (app unspecified)", "Claude(未区分应用)"],
486
505
  "flow_app_api": ["Unidentified app", "未识别应用"],
487
506
  "flow_source_unknown": ["Source unknown", "来源未知"],
@@ -520,7 +539,7 @@
520
539
  "connection_details": ["Connection details", "连接详情"],
521
540
  "messages_combined_since_start": ["Both Claude apps · This service run", "两款应用合计 · 本次运行"],
522
541
  "claude_metrics_combined": ["Both Claude apps", "两款应用合计"],
523
- "source_access_details": ["SOURCE ACCESS DETAILS", "来源访问详情"],
542
+ "source_access_details": ["CONNECTION DIAGNOSTICS", "连接诊断"],
524
543
  "account_access": ["Account & access", "账号与访问"],
525
544
  "account_management_location": ["Manage sign-in, accounts and models under Model sources.", "登录、账号和模型在来源页管理。"],
526
545
  "check_github_connection": ["Check GitHub connection", "检查 GitHub 连接"],
@@ -770,7 +789,7 @@
770
789
  "catalog_tabs_only_change_the_view_apply_explicitly_to_change_the": ["Tabs only browse models. Apply changes the source for later Codex requests.", "切换标签只查看模型。\n保存后更改后续请求的来源。"],
771
790
  "auto_review_model": ["Review model", "自动审查模型"],
772
791
  "apply_source": ["Use this source", "使用来源"],
773
- "enable_service": ["Enable source", "开启接入"],
792
+ "enable_service": ["Enable source", "启用来源"],
774
793
  "disable_service": ["Disable source", "停用接入"],
775
794
  "since_this_service_started_configuration_authorization_model_dis": ["Counts start with this service. Setup, sign-in, listed models and successful requests are separate checks.", "从本次启动开始统计。\n设置、登录、模型列表分别核实。\n请求成功情况单独记录。"],
776
795
  "process_listener": ["LOCAL SERVICE", "本机服务"],
@@ -815,7 +834,7 @@
815
834
  "gateway": ["LOCAL ACCESS", "本机接入"],
816
835
  "last_request": ["LAST REQUEST", "最近请求"],
817
836
  "client_connections": ["APP SETUP", "应用接入"],
818
- "model_catalog": ["MODEL LIST", "模型列表"],
837
+ "model_catalog": ["MODEL CATALOG", "模型目录"],
819
838
  "reasoning": ["THINKING LEVEL", "思考强度"],
820
839
  "model_providers": ["Model providers", "模型来源"],
821
840
  "reading_provider_catalog": ["Loading model list…", "读取模型中…"],
@@ -75,7 +75,7 @@
75
75
  }
76
76
  if (data.gemini || globalThis.ccdxGeminiStatus) {
77
77
  const gemini=data.gemini || globalThis.ccdxGeminiStatus;
78
- clients.append(tableRow(["Gemini · Antigravity",gemini.enabled?"Google + Copilot":"Google",gemini.enabled?"configured":"access_paused",gemini.activity?.active>0?"active":gemini.route_observed?"observed":"unknown","—"],{labels:[2,3]}));
78
+ clients.append(tableRow(["Antigravity",gemini.enabled?"Google + Copilot":"Google",gemini.enabled?"configured":"access_paused",gemini.activity?.active>0?"active":gemini.route_observed?"observed":"unknown","—"],{labels:[2,3]}));
79
79
  }
80
80
  if (element("claude-client-state")) element("claude-client-state").hidden = Boolean(claudeClients?.children.length);
81
81
  text("source-summary", "count_providers", { count: providers.length });
@@ -24,11 +24,8 @@ button:focus-visible, .button-link:focus-visible { outline: 2px solid var(--acce
24
24
  .device-code-row { display:flex;align-items:center;gap:10px; }
25
25
  .device-code-row .device-code { margin:10px 0; }
26
26
  #github-copy-state:empty { display:none; }
27
- #m365-app-access { margin-top:22px; }
28
- #m365-app-access fieldset { border:0;padding:0;margin:0; }
29
- #m365-app-access legend { margin-bottom:10px;padding:0; }
30
- #m365-access-warning { color:var(--incomplete); }
31
- #m365-access-state { margin:0; }
27
+ #source-access-warning { color:var(--incomplete); }
28
+ #source-access-state { margin:0; }
32
29
  button:disabled { opacity: .55; cursor: default; }
33
30
  button[aria-busy="true"] { cursor: progress; }
34
31
  .icon-button { display: inline-flex; flex:none; align-items: center; justify-content: center; width: 32px; height: 32px; padding: 6px; border: 0; background: transparent; }
@@ -27,7 +27,7 @@ const statusResourceKey = () => ["codex", "claude", "models", "usage", "requests
27
27
  const refreshStatus = () => dashboardRefresh.refresh(statusResourceKey(), { force: true });
28
28
  const refresh = refreshStatus;
29
29
  globalThis.addEventListener?.("ccdx-gemini-state", () => {
30
- const auth=dashboardRefresh.state("auth").value;if(auth)renderProviders({...auth,gemini:globalThis.ccdxGeminiStatus});
30
+ const auth=dashboardRefresh.state("auth").value;if(auth){renderProviders({...auth,gemini:globalThis.ccdxGeminiStatus});syncProviderDetails();}
31
31
  });
32
32
 
33
33
  function animateLogo() {
@@ -212,7 +212,7 @@ function applyModels(data, { changed }) {
212
212
  const expanded = new Set([...body.querySelectorAll("details[open]")].filter(node => node.dataset.disclosureClosing !== "true").map(node => node.dataset.model));
213
213
  body.replaceChildren();
214
214
  for (const model of data.models) {
215
- const clients = (model.clients || []).map(id => ({ codex: "Codex App", claude_app: "Claude App", claude_code: "Claude Code" })[id] || id).join(" / ") || "—";
215
+ const clients = (model.clients || []).map(id => ({ codex: "Codex App", claude_app: "Claude App", claude_code: "Claude Code", antigravity: "Antigravity" })[id] || id).join(" / ") || "—";
216
216
  const row = tableRow([model.display_name || model.id, clients, ""]);row.children[0].className = "model-name";
217
217
  if (model.kind === "image") { const badge = document.createElement("span");badge.className = "model-maker";localize(badge, "image_purpose");row.children[0].append(badge); }
218
218
  if (model.vendor && model.vendor !== "Unknown") { const maker = document.createElement("span");maker.className = "model-maker";maker.textContent = model.vendor;row.children[0].append(maker); }
@@ -229,7 +229,7 @@ function applyModels(data, { changed }) {
229
229
  }
230
230
  for (const item of model.client_visibility || []) if (item.reason) {
231
231
  const term = document.createElement("dt"), detail = document.createElement("dd");
232
- term.textContent = ({ codex: "Codex App", claude_app: "Claude App", claude_code: "Claude Code" })[item.client] || item.client;
232
+ term.textContent = ({ codex: "Codex App", claude_app: "Claude App", claude_code: "Claude Code", antigravity: "Antigravity" })[item.client] || item.client;
233
233
  localize(detail, "visibility_" + item.reason);fields.append(term, detail);
234
234
  }
235
235
  row.children[2].append(details);body.append(row);
@@ -179,7 +179,7 @@ export async function handleDashboardApi(req, res, pathname, {
179
179
  if (req.method === "POST" && (!sameOrigin(req) || !/^application\/json(?:\s*;|$)/i.test(req.headers["content-type"] || ""))) { sendJson(res, 403, { error: "Gemini setup requires same-origin JSON" });return; }
180
180
  const abort = createRequestAbort(req, res);abort.setTimeout(5000, "request_body_timeout");
181
181
  try {
182
- const input = req.method === "POST" ? await readJsonBody(req, { maxBodyBytes: 8192, maxDecodedBodyBytes: 8192, signal: abort.signal }) : {};
182
+ const input = req.method === "POST" ? await readJsonBody(req, { maxBodyBytes: 8192, maxDecodedBodyBytes: 8192, signal: abort.signal }) : new URL(req.url, "http://localhost").searchParams.get("scope")==="summary"?{action:"summary"}:{};
183
183
  abort.clearTimeout();sendJson(res, 200, await geminiFn(input, `http://${req.headers.host}`));
184
184
  } catch (error) { sendJson(res, error.statusCode || 400, { error: error.message }); }
185
185
  finally { abort.cleanup(); }return;
@@ -1,3 +1,5 @@
1
+ import { antigravityCopilotModels } from "./antigravity-models.mjs";
2
+ import { sourceModels } from "./client-model-plan.mjs";
1
3
  import { isImageModel, imageModelCatalog } from "./image-models.mjs";
2
4
  import os from "node:os";
3
5
  import { publicModelCatalog } from "./provider-metadata.mjs";
@@ -60,6 +62,17 @@ export function selectableCopilotModels(payload) {
60
62
  return { advertised: data.length, models };
61
63
  }
62
64
 
65
+ export function publicCopilotModelCatalog(payload) {
66
+ const data=Array.isArray(payload)?payload:payload.data;
67
+ const codex=new Set(sourceModels({id:"github",registry:{models:{data}}},"codex")
68
+ .filter(model=>model.model_picker_enabled!==false&&(!model.policy?.state||model.policy.state==="enabled")).map(model=>model.id));
69
+ const antigravity=new Set(antigravityCopilotModels(payload).map(model=>model.model));
70
+ return publicModelCatalog(data,{
71
+ selectable:model=>codex.has(model.id)||antigravity.has(model.id)||imageModelCatalog([model]).length>0,
72
+ clients:model=>[...(codex.has(model.id)||isImageModel(model)?["codex"]:[]),...(antigravity.has(model.id)?["antigravity"]:[])],
73
+ });
74
+ }
75
+
63
76
  function validationFailure(validation) {
64
77
  const httpStatus = validation?.status ? ` (HTTP ${validation.status})` : "";
65
78
  return `GitHub Copilot authentication failed: ${validation?.reason || "unknown error"}${httpStatus}`;
@@ -139,10 +152,7 @@ async function lookupLiveModels(credentials, { fetchImpl, timeoutMs, vscodeVersi
139
152
  }
140
153
  const catalog = selectableCopilotModels(payload);
141
154
  if (includeAll) {
142
- const selected = new Set(catalog.models.map(model => model.id));
143
- catalog.models = publicModelCatalog(Array.isArray(payload) ? payload : payload.data, {
144
- selectable: model => selected.has(model.id) || imageModelCatalog([model]).length > 0, clients: model => selected.has(model.id) || isImageModel(model) ? ["codex"] : [],
145
- });
155
+ catalog.models = publicCopilotModelCatalog(payload);
146
156
  }
147
157
  let upstreamHost = "GitHub Copilot";
148
158
  try { upstreamHost = new URL(apiBase).hostname; } catch {}
@@ -4,7 +4,7 @@ import { providerDescriptors } from "./provider-descriptors.mjs";
4
4
  import { autoReviewPreference, writeAutoReviewModel } from "./user-settings.mjs";
5
5
  import { autoReviewReasoningEfforts, DEFAULT_CODEX_AUTO_REVIEW_MODEL, responsesModelIdsFromCopilotModels } from "./models.mjs";
6
6
  import { publicModelCatalog } from "./provider-metadata.mjs";
7
- import { selectableCopilotModels } from "./live-models.mjs";
7
+ import { publicCopilotModelCatalog } from "./live-models.mjs";
8
8
  import { createGithubProvider } from "./providers/github.mjs";
9
9
  import { readProviderSettings, writeProviderSettings } from "./provider-settings.mjs";
10
10
  import { readM365Settings, updateM365Settings, m365Paths, ensureM365GatewayKey, readM365Account, m365AccountKey } from "./m365-settings.mjs";
@@ -249,10 +249,9 @@ function createBuiltinProviderRuntime({ githubClient, githubRegistry, refreshGit
249
249
  if (provider === "github") {
250
250
  if (!refreshGithubCatalog) return null;
251
251
  const catalog = await refreshGithubCatalog();
252
- const selected = new Set(selectableCopilotModels(catalog).models.map(model => model.id));
253
252
  const upstreamHost = githubClient.runtimeStatus?.().upstream_host;
254
253
  return { source: "live", checkedAt: new Date().toISOString(), upstreamHost: upstreamHost && upstreamHost !== "unknown" ? upstreamHost : "GitHub Copilot", advertised: catalog.data.length,
255
- models: publicModelCatalog(catalog.data, { selectable: model => selected.has(model.id) || imageModelCatalog([model]).length > 0, clients: model => selected.has(model.id) || isImageModel(model) ? ["codex"] : [] }) };
254
+ models: publicCopilotModelCatalog(catalog) };
256
255
  }
257
256
  if (provider !== "m365") throw Object.assign(new Error("Unknown provider"), { statusCode: 400 });
258
257
  if (!enabled || !["darwin", "win32"].includes(platform)) throw unavailable(!enabled ? "m365_disabled" : "m365_unsupported");
@@ -1,8 +1,8 @@
1
1
  import { terminalCell } from "./terminal-text.mjs";
2
2
 
3
3
  const integer = value => Number.isSafeInteger(value) && value >= 0;
4
- const appIds = { codex_app: "codex", codex_cli: "codex", codex: "codex", claude_app: "claude_app", claude_code: "claude_code", gemini_app: "gemini" };
5
- export const TERMINAL_CLIENT_NAMES = Object.freeze({ codex: "Codex", claude_app: "Claude App", claude_code: "Claude Code", gemini: "Gemini · Antigravity" });
4
+ const appIds = { codex_app: "codex", codex_cli: "codex", codex: "codex", claude_app: "claude_app", claude_code: "claude_code", gemini_app: "antigravity" };
5
+ export const TERMINAL_CLIENT_NAMES = Object.freeze({ codex: "Codex", claude_app: "Claude App", claude_code: "Claude Code", gemini: "Antigravity", antigravity: "Antigravity" });
6
6
  const labels = { configured: "Configured", paused: "Paused", disabled: "Disabled", not_configured: "Not configured", not_installed: "Not installed",
7
7
  preserved: "Unchanged", partially_preserved: "Partly unchanged", manual_sync: "Manual sync", default_unavailable: "Default unavailable", configuration_unavailable: "Unreadable", unavailable: "Unavailable" };
8
8
  export function terminalUptime(milliseconds) {
@@ -37,7 +37,7 @@ export function projectTerminalState(data = {}) {
37
37
  ...[["app", "claude_app"], ["code", "claude_code"]].map(([key, id]) => ({ id, setup: data.providers?.m365?.claude?.clients?.[key] })),
38
38
  ]).map(client => ({ id: client.id, name: TERMINAL_CLIENT_NAMES[client.id] || terminalCell(client.name || client.id),
39
39
  setup: clientSetup(client.id === "codex" && !connection?.managed && !client.setup && data.client_integrations?.codex?.setup ? { ...client, setup: data.client_integrations.codex.setup } : client), active: running.length || active === 0 ? byApp.get(client.id) || 0 : null, observed_at: client.observed_at || null }));
40
- if(data.gemini||byApp.has("gemini"))clients.push({id:"gemini",name:TERMINAL_CLIENT_NAMES.gemini,setup:data.gemini?.enabled?"Configured":"Paused",active:byApp.get("gemini")||0,observed_at:null});
40
+ if(data.gemini||byApp.has("antigravity"))clients.push({id:"antigravity",name:TERMINAL_CLIENT_NAMES.antigravity,setup:data.gemini?.enabled?"Configured":"Paused",active:byApp.get("antigravity")||0,observed_at:null});
41
41
  if (integer(active) && active > running.length) unidentified += active - running.length;
42
42
  if (unidentified) clients.push({ id: "other", name: "Other clients", setup: "Not identified", active: unidentified });
43
43
  const sources = connection?.providers?.filter(item => item.enabled && !(item.id === "m365" && data.providers?.m365?.enabled === false)).map(item => ({ id: item.id, name: terminalCell(item.name || item.id) }))