codex-copilot-dx 1.3.24 → 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 +1 -1
- package/docs/ARCHITECTURE.md +19 -14
- package/docs/README.md +6 -16
- package/docs/REFERENCE.md +7 -2
- package/package.json +1 -1
- package/src/antigravity-chat-bridge.mjs +1 -0
- package/src/antigravity-handler.mjs +4 -2
- package/src/antigravity-runtime.mjs +6 -3
- package/src/connection-view.mjs +1 -3
- package/src/dashboard/connections.js +48 -29
- package/src/dashboard/gemini.js +49 -40
- package/src/dashboard/index.html +22 -16
- package/src/dashboard/language.js +33 -18
- package/src/dashboard/ui.css +2 -5
- package/src/dashboard/ui.js +2 -2
- package/src/live-models.mjs +14 -4
- package/src/provider-runtime.mjs +2 -3
package/README.md
CHANGED
|
@@ -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
|
|
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.
|
package/docs/ARCHITECTURE.md
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
5
|
-
- [Architecture](ARCHITECTURE.md):
|
|
6
|
-
- [
|
|
7
|
-
- [
|
|
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
|
|
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
|
@@ -69,7 +69,12 @@ The old `app gemini` commands remain available. Authorize Antigravity on the Git
|
|
|
69
69
|
Copilot source page, or with `source github access --edit --apps codex,antigravity --yes`.
|
|
70
70
|
Choose its exposed models on the Antigravity page or with
|
|
71
71
|
`app antigravity models --edit`. A model file uses `{"models":["<ccdx-copilot-model-id>"]}`.
|
|
72
|
-
|
|
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
|
+
|
|
73
78
|
The page distinguishes enabled access from an observed client connection.
|
|
74
79
|
|
|
75
80
|
Carbon and Argon appear with Low, Medium and High reasoning levels when the
|
|
@@ -113,7 +118,7 @@ Clicking the Web UI logo plays one brief rotation and keeps its Overview navigat
|
|
|
113
118
|
|
|
114
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.
|
|
115
120
|
|
|
116
|
-
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
|
|
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.
|
|
117
122
|
|
|
118
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.
|
|
119
124
|
|
package/package.json
CHANGED
|
@@ -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
|
|
|
@@ -33,7 +33,7 @@ function groundedSearch(result,query){
|
|
|
33
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;
|
|
@@ -62,6 +62,7 @@ export function createAntigravityHandler({client,models=()=>[],selectedModels=()
|
|
|
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
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));
|
|
@@ -109,6 +110,7 @@ export function createAntigravityHandler({client,models=()=>[],selectedModels=()
|
|
|
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=()=>[],selectedModels=()
|
|
|
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
|
}
|
|
@@ -41,10 +41,13 @@ export function createAntigravityRuntime({client,models=()=>[],privacy,home=os.h
|
|
|
41
41
|
const handler=createAntigravityHandler({client,models:available,selectedModels:()=>settings().selected_models,enabled:()=>settings().configured,privacy,searchFn:searchFn||web.search,
|
|
42
42
|
imageFn:imageFn||createAntigravityImages({client,models:available,privacy}),guardSource:sourceGuard,fetchGoogle:googleFetch,acquireRequest,...timeouts});
|
|
43
43
|
function snapshot(){
|
|
44
|
-
const config=settings();
|
|
45
|
-
|
|
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,
|
|
46
49
|
model_source:"Google + GitHub Copilot",background_source:"GitHub Copilot",ordinary_chat_source:"Google (unchanged)",
|
|
47
|
-
models:
|
|
50
|
+
models:listed,activity,last_operation:lastOperation};
|
|
48
51
|
}
|
|
49
52
|
async function action(input={},baseUrl){
|
|
50
53
|
if(input&&Object.keys(input).some(name=>!["action","accept_background_copilot","models"].includes(name)))throw httpError("Invalid Gemini operation",400);
|
package/src/connection-view.mjs
CHANGED
|
@@ -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
|
-
|
|
13
|
-
const accessForm = el("
|
|
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
|
-
|
|
16
|
-
const
|
|
17
|
-
const area
|
|
18
|
-
area.
|
|
19
|
-
|
|
20
|
-
item.
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const
|
|
30
|
-
|
|
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
|
|
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),...(provider.id === "github" && globalThis.ccdxGeminiStatus?.enabled ? ["Antigravity"] : [])].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 (
|
|
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:
|
|
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,
|
package/src/dashboard/gemini.js
CHANGED
|
@@ -1,54 +1,63 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const el=id=>document.getElementById(id),language=globalThis.ccdxLanguage;
|
|
3
|
-
let busy=false,state=null,draft=null;
|
|
3
|
+
let busy=false,state=null,draft=null,notice=null,pendingAction=null;
|
|
4
4
|
const words=(id,key)=>language.set(el(id),key);
|
|
5
|
-
const
|
|
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'];
|
|
6
7
|
const selected=()=>state?.models.filter(model=>model.selected!==false).map(model=>model.id)||[];
|
|
7
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);
|
|
8
10
|
function render(){
|
|
9
11
|
for(const id of controls)el(id).disabled=busy||!state;
|
|
10
12
|
if(!state)return;
|
|
11
|
-
if(!busy)
|
|
12
|
-
el(
|
|
13
|
-
words(
|
|
14
|
-
words(
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
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();
|
|
19
25
|
for(const model of state.models){
|
|
20
|
-
const row=document.createElement(
|
|
21
|
-
input.type=
|
|
22
|
-
input.addEventListener(
|
|
23
|
-
label.append(input,document.createTextNode(model.name));name.append(label);row.append(name);
|
|
24
|
-
for(const [key,value]
|
|
25
|
-
const cell=document.createElement("td");cell.textContent=value;language.set(cell,key,{},"data-label");row.append(cell);
|
|
26
|
-
}
|
|
27
|
-
list.append(row);
|
|
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);
|
|
28
31
|
}
|
|
29
|
-
if(!state.models.length){const row=document.createElement(
|
|
30
|
-
|
|
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);
|
|
31
36
|
}
|
|
32
|
-
async function load(action,extra={}){
|
|
33
|
-
if(busy)
|
|
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();
|
|
34
40
|
try{
|
|
35
|
-
const response=await fetch(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
state
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
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'))}
|
|
45
52
|
}
|
|
46
|
-
|
|
47
|
-
el(
|
|
48
|
-
el(
|
|
49
|
-
el(
|
|
50
|
-
el(
|
|
51
|
-
el(
|
|
52
|
-
|
|
53
|
-
|
|
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');
|
|
54
63
|
})();
|
package/src/dashboard/index.html
CHANGED
|
@@ -163,11 +163,9 @@
|
|
|
163
163
|
</details>
|
|
164
164
|
</div>
|
|
165
165
|
<div data-view="gemini" hidden>
|
|
166
|
-
<section class="connection-access"><div class="connection-row"><
|
|
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>
|
|
167
167
|
<section class="panel dashboard-section">
|
|
168
|
-
<div class="panel-heading"><h2 data-i18n="
|
|
169
|
-
<p id="gemini-route-state" class="client-sync-state" role="status">—</p>
|
|
170
|
-
<p class="hint" data-i18n="gemini_scope">Antigravity models, summaries, searches and image generation use Copilot. Ordinary Gemini chat keeps Google.</p>
|
|
168
|
+
<div class="panel-heading"><h2 data-i18n="gemini_model_selection">Model selection</h2><span id="gemini-draft-state" role="status">—</span></div>
|
|
171
169
|
<form id="gemini-model-form">
|
|
172
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>
|
|
173
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>
|
|
@@ -176,12 +174,15 @@
|
|
|
176
174
|
</section>
|
|
177
175
|
<details class="panel dashboard-section" open>
|
|
178
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
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
180
|
<p id="gemini-reopen" class="hint" data-i18n="gemini_reopen" hidden>Quit Gemini, then open it here to load CCDX models.</p>
|
|
181
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
182
|
</details>
|
|
183
|
-
<details class="panel dashboard-section"><summary data-i18n="
|
|
184
|
-
<
|
|
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>
|
|
185
186
|
</details>
|
|
186
187
|
</div>
|
|
187
188
|
|
|
@@ -206,7 +207,7 @@
|
|
|
206
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>
|
|
207
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>
|
|
208
209
|
</div></details>
|
|
209
|
-
|
|
210
|
+
|
|
210
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>
|
|
211
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>
|
|
212
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>
|
|
@@ -222,7 +223,7 @@
|
|
|
222
223
|
<div id="source-account-panel" role="tabpanel">
|
|
223
224
|
<p id="source-status-note" class="hint" role="status"></p>
|
|
224
225
|
<section class="panel dashboard-section" id="github-account">
|
|
225
|
-
<div class="panel-heading"><h2 data-i18n="
|
|
226
|
+
<div class="panel-heading"><h2 data-i18n="source_connection">Account & connection</h2><span id="github-account-state"></span></div>
|
|
226
227
|
<p id="github-account-name" class="account-name">—</p><p id="github-account-hint" class="hint"></p>
|
|
227
228
|
<dl id="github-account-fields" class="account-summary"></dl>
|
|
228
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>
|
|
@@ -236,17 +237,12 @@
|
|
|
236
237
|
<button id="github-cancel" type="button" data-i18n="cancel">Cancel</button>
|
|
237
238
|
<p class="hint" data-i18n="tools_keep_old_signin">Old sign-in is kept until verification succeeds.</p>
|
|
238
239
|
</section>
|
|
239
|
-
<section class="tool-details" id="github-app-access"><h3 data-i18n="api_allowed_clients">Allowed clients</h3>
|
|
240
|
-
<div class="setting-row"><span>Codex</span><a class="section-link" href="#codex" data-i18n="api_manage">Manage</a></div>
|
|
241
|
-
<div class="setting-row"><label for="github-antigravity-enabled">Antigravity</label><input id="github-antigravity-enabled" type="checkbox" role="switch" disabled><a class="section-link" href="#gemini" data-i18n="api_manage">Manage</a></div>
|
|
242
|
-
<p class="hint" data-i18n="gemini_scope">Antigravity uses Copilot; ordinary Gemini chat keeps Google.</p><p id="github-antigravity-note" class="hint" role="status"></p>
|
|
243
|
-
</section>
|
|
244
240
|
<p id="github-account-note" class="hint" role="status" aria-live="polite"></p>
|
|
245
241
|
<details class="tool-details"><summary data-i18n="tools_details">Check details</summary><dl class="failure-detail"><dt data-i18n="tools_storage">Saved sign-in</dt><dd id="github-store">—</dd><dt data-i18n="tools_error_code">Error code</dt><dd id="github-check-code">—</dd><dt>HTTP</dt><dd id="github-check-http">—</dd><dt data-i18n="tools_github_identity">GitHub identity</dt><dd id="github-identity-detail">—</dd><dt data-i18n="last_verified">Last checked</dt><dd id="github-checked-at">—</dd></dl></details>
|
|
246
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>
|
|
247
243
|
</section>
|
|
248
244
|
<section class="panel dashboard-section" id="m365-source-access" hidden aria-labelledby="source-access-heading">
|
|
249
|
-
<h2 id="source-access-heading" data-i18n="
|
|
245
|
+
<h2 id="source-access-heading" data-i18n="source_connection">Account & connection</h2>
|
|
250
246
|
|
|
251
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>
|
|
252
248
|
<div id="m365-control-note" class="hint" role="status"></div>
|
|
@@ -260,14 +256,24 @@
|
|
|
260
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>
|
|
261
257
|
</div>
|
|
262
258
|
<p id="m365-account-note" class="hint" role="status" aria-live="polite"></p>
|
|
263
|
-
|
|
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>
|
|
264
270
|
</section>
|
|
265
271
|
<details class="panel dashboard-section model-catalog" id="upstream-models" open>
|
|
266
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>
|
|
267
273
|
<div class="section-actions"><button id="refresh-models" type="button" data-i18n="refresh">Refresh</button></div>
|
|
268
274
|
<p id="models-note" class="table-note" data-i18n="reading_provider_catalog">Loading model list…</p>
|
|
269
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>
|
|
270
|
-
<div class="table-wrap"><table><thead><tr><th scope="col" data-i18n="model">MODEL</th><th scope="col" data-i18n="
|
|
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>
|
|
271
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>
|
|
272
278
|
</details>
|
|
273
279
|
<details class="panel dashboard-section" id="account-authorization">
|
|
@@ -1,18 +1,30 @@
|
|
|
1
1
|
(() => {
|
|
2
2
|
const translations = {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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 连接。"],
|
|
7
11
|
gemini_version: ["Version", "版本"],
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
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 中确认接入。"],
|
|
13
20
|
gemini_starting: ["Gemini is starting", "Gemini 正在启动"],
|
|
14
21
|
gemini_conflict: ["An existing gateway route was preserved. Resolve the conflict before opening.", "已保留原有网关路由,请先处理配置冲突。"],
|
|
15
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", "高"],
|
|
16
28
|
limit_default: ["Use default", "使用默认值"],
|
|
17
29
|
ccdx_prediction_app_open: ["Quit Codex, then continue setup here.", "请退出 Codex,再在此继续配置。"], feature_read_failed: ["Settings could not be read. Existing files were preserved.", "无法读取设置,原有文件已保留。"],
|
|
18
30
|
prediction_setup_again: ["Set up again", "重新配置"], prediction_bridge_missing: ["Not ready. Check and repair, or quit Codex and set up again.", "尚未就绪。请检查修复,或退出 Codex 后重新配置。"],
|
|
@@ -141,7 +153,7 @@
|
|
|
141
153
|
"api_save_read": ["Save & read models", "保存并读取模型"],
|
|
142
154
|
"api_read_failed": ["API saved. Model lookup failed; retry here. {code}", "来源已保存;模型读取失败,可在此重试。{code}"],
|
|
143
155
|
"sync_capability_unverified": ["Client capabilities are unverified; existing settings were kept.", "客户端能力未验证,现有设置已保留。"],
|
|
144
|
-
"source_accounts": ["
|
|
156
|
+
"source_accounts": ["Sources", "来源"],
|
|
145
157
|
"sync_config_written": ["Configuration written · reopen the app to load changes", "配置已写入 · 重开应用查看变更"],
|
|
146
158
|
"sync_manual": ["Selection saved · automatic sync is off", "选择已保存 · 自动同步已关闭"],
|
|
147
159
|
"sync_preserved": ["Manual settings retained · review sync details", "手工设置已保留 · 查看同步详情"],
|
|
@@ -157,11 +169,16 @@
|
|
|
157
169
|
"tools_code_copied": ["Copied. Ready to paste.", "已复制,可直接粘贴。"],
|
|
158
170
|
"tools_code_copy_needed": ["Click copy before pasting.", "点击复制图标后再粘贴。"],
|
|
159
171
|
"tools_code_copy_failed": ["Select the code and copy it manually.", "请选择验证码,手动复制。"],
|
|
172
|
+
"catalog_supported_apps": ["Supported apps", "支持的应用"],
|
|
173
|
+
"source_connection": ["Account & connection", "账户与连接"],
|
|
160
174
|
"source_allowed_apps": ["Allowed apps", "允许使用的应用"],
|
|
161
175
|
"source_apps_hint": ["Choose models on the app page after granting access.", "授权后,在应用页选择模型。"],
|
|
162
|
-
"
|
|
163
|
-
"
|
|
164
|
-
"
|
|
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} 应用页打开客户端以完成接入。"],
|
|
165
182
|
"source_apps_review": ["Saved. Review {apps} sync results on the app page.", "已保存,请在应用页复核 {apps} 同步结果。"],
|
|
166
183
|
"catalog_read_network": ["Online read", "在线读取"],
|
|
167
184
|
"catalog_read_cache": ["Local cache", "本地缓存"],
|
|
@@ -381,7 +398,6 @@
|
|
|
381
398
|
"api_protocols": ["Available APIs", "可用接口"],
|
|
382
399
|
"api_endpoint_options": ["Addresses & authentication", "接口地址与认证"],
|
|
383
400
|
"api_messages_auth": ["Messages authentication", "Messages 认证"],
|
|
384
|
-
"api_allowed_clients": ["Allowed clients", "允许使用的客户端"],
|
|
385
401
|
"api_read_models": ["Read models", "读取模型"],
|
|
386
402
|
"api_discovery_save_first": ["Reads the model catalog; no inference request.", "只读取模型目录,不发起推理。"],
|
|
387
403
|
"api_add_model": ["Add model", "添加模型"],
|
|
@@ -397,7 +413,6 @@
|
|
|
397
413
|
"api_choose_replacements": ["Choose another source or pause each affected client.", "为受影响的客户端换源,或暂停接入。"],
|
|
398
414
|
"api_confirm_disable": ["Disable", "确认关闭"],
|
|
399
415
|
"api_pause": ["Pause access", "暂停接入"],
|
|
400
|
-
"api_allowed_summary": ["Allowed: {clients}", "允许使用:{clients}"],
|
|
401
416
|
"api_none": ["Not assigned", "暂未分配"],
|
|
402
417
|
"api_account": ["Account", "查看账号"],
|
|
403
418
|
"api_manage": ["Manage", "管理"],
|
|
@@ -524,7 +539,7 @@
|
|
|
524
539
|
"connection_details": ["Connection details", "连接详情"],
|
|
525
540
|
"messages_combined_since_start": ["Both Claude apps · This service run", "两款应用合计 · 本次运行"],
|
|
526
541
|
"claude_metrics_combined": ["Both Claude apps", "两款应用合计"],
|
|
527
|
-
"source_access_details": ["
|
|
542
|
+
"source_access_details": ["CONNECTION DIAGNOSTICS", "连接诊断"],
|
|
528
543
|
"account_access": ["Account & access", "账号与访问"],
|
|
529
544
|
"account_management_location": ["Manage sign-in, accounts and models under Model sources.", "登录、账号和模型在来源页管理。"],
|
|
530
545
|
"check_github_connection": ["Check GitHub connection", "检查 GitHub 连接"],
|
|
@@ -774,7 +789,7 @@
|
|
|
774
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保存后更改后续请求的来源。"],
|
|
775
790
|
"auto_review_model": ["Review model", "自动审查模型"],
|
|
776
791
|
"apply_source": ["Use this source", "使用来源"],
|
|
777
|
-
"enable_service": ["Enable source", "
|
|
792
|
+
"enable_service": ["Enable source", "启用来源"],
|
|
778
793
|
"disable_service": ["Disable source", "停用接入"],
|
|
779
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请求成功情况单独记录。"],
|
|
780
795
|
"process_listener": ["LOCAL SERVICE", "本机服务"],
|
|
@@ -819,7 +834,7 @@
|
|
|
819
834
|
"gateway": ["LOCAL ACCESS", "本机接入"],
|
|
820
835
|
"last_request": ["LAST REQUEST", "最近请求"],
|
|
821
836
|
"client_connections": ["APP SETUP", "应用接入"],
|
|
822
|
-
"model_catalog": ["MODEL
|
|
837
|
+
"model_catalog": ["MODEL CATALOG", "模型目录"],
|
|
823
838
|
"reasoning": ["THINKING LEVEL", "思考强度"],
|
|
824
839
|
"model_providers": ["Model providers", "模型来源"],
|
|
825
840
|
"reading_provider_catalog": ["Loading model list…", "读取模型中…"],
|
package/src/dashboard/ui.css
CHANGED
|
@@ -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
|
-
#
|
|
28
|
-
#
|
|
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; }
|
package/src/dashboard/ui.js
CHANGED
|
@@ -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);
|
package/src/live-models.mjs
CHANGED
|
@@ -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
|
-
|
|
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 {}
|
package/src/provider-runtime.mjs
CHANGED
|
@@ -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 {
|
|
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:
|
|
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");
|