codex-copilot-dx 1.3.24 → 1.3.26

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.
@@ -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"><strong>Antigravity</strong><label class="switch-hit"><input id="gemini-enabled" type="checkbox" role="switch" aria-label="Antigravity" disabled></label></div></section>
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="model_catalog">Model list</h2><span id="gemini-state" role="status">—</span></div>
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="request_performance">Request performance</summary>
184
- <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>Copilot</dt><dd id="gemini-copilot">—</dd></div><div><dt data-i18n="requests">Requests</dt><dd id="gemini-total">—</dd></div></dl>
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
- <fieldset><legend data-i18n="api_allowed_clients">Allowed clients</legend><div class="connection-checks" id="connection-allowed-clients"></div></fieldset>
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="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>
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="account_access">Account &amp; access</h2>
245
+ <h2 id="source-access-heading" data-i18n="source_connection">Account &amp; 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
- <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>
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="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>
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">
@@ -310,29 +316,29 @@
310
316
  <div data-view="usage" hidden>
311
317
  <div class="context-tabs" role="tablist" aria-label="Usage view" data-i18n-label="context_tabs"><button type="button" id="usage-tokens-tab" role="tab" aria-selected="true" aria-controls="usage-tokens-pane" data-i18n="context_tokens">Tokens</button><button type="button" id="usage-context-tab" role="tab" aria-selected="false" aria-controls="usage-context-pane" data-i18n="context_title">Context</button></div>
312
318
  <div id="usage-tokens-pane" role="tabpanel" aria-labelledby="usage-tokens-tab">
313
- <div class="section-actions usage-source-controls"><label><span data-i18n="source_entire_page">Source / entire page</span><select id="usage-provider"><option value="" data-i18n="all_providers">All providers</option></select></label><button id="refresh-usage" type="button" data-i18n="refresh_usage">Refresh usage</button></div>
319
+ <div class="section-actions usage-source-controls"><label><span data-i18n="source_entire_page">Source / entire page</span><select id="usage-provider"><option value="" data-i18n="all_providers">All providers</option></select></label>
320
+ <label><span data-i18n="usage_model_page">Model / entire page</span><select id="analytics-model"><option value="" data-i18n="all_models">All models</option></select></label>
321
+ <label><span data-i18n="usage_range_page">Time / entire page</span><select id="analytics-range"><option value="all" selected data-i18n="usage_all_history">All retained history</option><option value="7" data-i18n="7_days">Last 7 days</option><option value="30" data-i18n="30_days">Last 30 days</option><option value="90" data-i18n="90_days">Last 90 days</option><option value="365" data-i18n="usage_365_days">Last 365 days</option></select></label>
322
+ <button id="refresh-usage" type="button" data-i18n="refresh_usage">Refresh usage</button></div>
314
323
 
315
324
  <details id="usage-analytics" class="panel dashboard-section analytics-section">
316
325
  <summary data-i18n="usage_analytics">USAGE TRENDS</summary>
317
- <div class="analytics-controls">
318
- <label><span data-i18n="model_both_charts">Model / both charts</span> <select id="analytics-model"><option value="" data-i18n="all_models">All models</option></select></label>
319
- </div>
320
326
  <p id="analytics-note" class="table-note" role="status" data-i18n="open_to_read_retained_usage_history">Loading usage trends…</p>
321
327
  <p id="analytics-updated" class="refresh-time"></p>
322
- <div class="chart-heading"><h3 data-i18n="daily_tokens">DAILY USAGE</h3><div class="analytics-controls"><label><span data-i18n="daily_range">Date range</span> <select id="analytics-range"><option value="7" data-i18n="7_days">Last 7 days</option><option value="30" selected data-i18n="30_days">Last 30 days</option><option value="90" data-i18n="90_days">Last 90 days</option></select></label>
328
+ <div class="chart-heading"><h3 data-i18n="daily_tokens">USAGE BY DATE</h3><div class="analytics-controls">
323
329
  <label><span data-i18n="chart_view">Chart view</span> <select id="analytics-view"><option value="bars" selected data-i18n="bar_chart">Bar chart</option><option value="line" data-i18n="line_chart">Line chart</option></select></label></div></div>
324
330
  <div id="daily-bars" class="daily-bars" aria-label="Daily usage in Token" data-i18n-label="daily_token_usage"></div>
325
331
  <div class="daily-axis"><span id="daily-from"></span><span id="daily-to"></span></div>
326
332
  <div class="chart-legend"><span class="legend-input" data-i18n="input_36ecb">Input usage</span><span class="legend-output" data-i18n="output_b2439">Output usage</span></div>
327
- <div class="chart-heading"><h3 data-i18n="request_activity_365_days">ACTIVITY · LAST 365 DAYS</h3><div class="analytics-controls"><label><span data-i18n="calendar_measure">Calendar measure</span> <select id="analytics-metric"><option value="requests" data-i18n="calls_b73a5">Requests</option><option value="tokens" data-i18n="tokens">Usage (Token)</option></select></label></div></div><p id="activity-scale" class="hint">—</p>
333
+ <div class="chart-heading"><h3 data-i18n="usage_activity_range">ACTIVITY</h3><div class="analytics-controls"><label><span data-i18n="calendar_measure">Calendar measure</span> <select id="analytics-metric"><option value="requests" data-i18n="recorded_usage">Usage records</option><option value="tokens" data-i18n="tokens">Usage (Token)</option></select></label></div></div><p id="activity-scale" class="hint">—</p>
328
334
  <div class="calendar-scroll"><div class="calendar-grid"><div id="calendar-months" class="calendar-months" aria-hidden="true"></div><div id="activity-calendar" class="activity-calendar" aria-label="Daily recorded activity over 365 days" data-i18n-label="daily_recorded_request_activity"></div></div></div>
329
335
  <p id="analytics-selection" class="hint" role="status" data-i18n="select_a_day_to_inspect_its_model_totals_no_history_is_distinct_">Select a day for its usage. No records does not mean zero requests.</p>
330
336
  </details>
331
337
  <details class="panel dashboard-section" id="model-usage" open>
332
338
  <summary class="panel-heading"><h2 data-i18n="usage_totals">USAGE TOTALS</h2><span id="usage-state" data-i18n="reading_log">COUNTING</span></summary>
333
- <div class="section-actions"><button id="clear-usage-day" type="button" hidden data-i18n="all_history">Show all</button></div>
339
+ <div class="section-actions"><button id="clear-usage-day" type="button" hidden data-i18n="usage_clear_date">Clear date</button></div>
334
340
  <p id="usage-note" class="table-note" data-i18n="aggregating_local_usage_metadata">Counting local usage…</p>
335
- <div class="table-wrap"><table class="usage-table"><thead><tr><th scope="col" data-i18n="model">MODEL</th><th scope="col" data-i18n="calls">REQUESTS</th><th scope="col" data-i18n="input">INPUT USAGE</th><th scope="col" data-i18n="cache_read">REUSED INPUT</th><th scope="col" data-i18n="cache_write">CACHE WRITE</th><th scope="col" data-i18n="output">OUTPUT USAGE</th><th scope="col" data-i18n="total">TOTAL</th><th scope="col" data-i18n="cache_hit">REUSE RATE</th></tr></thead><tbody id="usage-body"><tr><td colspan="8" data-i18n="loading">Loading…</td></tr></tbody></table></div>
341
+ <div class="table-wrap"><table class="usage-table"><thead><tr><th scope="col" data-i18n="model">MODEL</th><th scope="col" data-i18n="usage_records">RECORDS</th><th scope="col" data-i18n="input">INPUT USAGE</th><th scope="col" data-i18n="cache_read">REUSED INPUT</th><th scope="col" data-i18n="cache_write">CACHE WRITE</th><th scope="col" data-i18n="output">OUTPUT USAGE</th><th scope="col" data-i18n="total">TOTAL</th><th scope="col" data-i18n="cache_hit">REUSE RATE</th></tr></thead><tbody id="usage-body"><tr><td colspan="8" data-i18n="loading">Loading…</td></tr></tbody></table></div>
336
342
  <p class="hint" data-i18n="cache_hit_recorded_cached_input_tokens_incomplete_history_unavai">Unit: Token. Reused input is part of input. Rate uses records with valid input and cache-read counts.
337
343
  ~ Partial coverage. — No valid input basis.</p>
338
344
 
@@ -1,18 +1,30 @@
1
1
  (() => {
2
2
  const translations = {
3
- gemini_route_waiting: ["Waiting for the client to load CCDX models", "等待客户端加载 CCDX 模型"],
4
- gemini_route_observed: ["Client connected to CCDX", "客户端已接入 CCDX"],
5
- gemini_models_saved: ["Model selection saved. Reopen Gemini to reload the model list.", "模型选择已保存。重新打开 Gemini 以加载模型列表。"],
6
- gemini_no_models: ["No Copilot models are available. Enable Antigravity and check GitHub access.", "暂无 Copilot 模型。请启用 Antigravity 并检查 GitHub 授权。"],
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
- gemini_enabled: ["Copilot integration is on", "Copilot 接入已启用"], gemini_disabled: ["Copilot integration is off", "Copilot 接入未启用"],
9
- gemini_scope: ["Antigravity models, summaries, searches and image generation use Copilot. Ordinary Gemini chat keeps Google.", "Antigravity 的模型、摘要、搜索和图像生成使用 Copilot;Gemini 普通聊天保留 Google。"],
10
- gemini_enable: ["Enable Antigravity", "启用 Antigravity"], gemini_disable: ["Pause Copilot", "停用 Copilot"], gemini_open: ["Open Antigravity", "打开 Antigravity"],
11
- gemini_reopen: ["Quit Gemini, then open it here. Active apps are never restarted automatically.", "请先退出 Gemini,再从这里打开。CCDX 不会自动重启正在运行的应用。"],
12
- 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 中确认接入。"],
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": ["Accounts & APIs", "账号与 API"],
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
- "source_apps_none": ["Signed in. No app has access.", "仅保留登录,暂无应用使用。"],
163
- "source_apps_pause": ["Saving stops {apps} from using this source.", "保存后,{apps} 将停止使用此来源。"],
164
- "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} 应用页打开客户端以完成接入。"],
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", "管理"],
@@ -477,7 +492,7 @@
477
492
  "flow_active_count": ["Active requests · {count}", "进行中 · {count}"],
478
493
  "flow_last_count": ["Last observed · {count}", "上次记录 · {count}"],
479
494
  "flow_related_count": ["{count} related requests", "{count} 个相关请求"],
480
- "flow_group_scope": ["{apps} apps · {models} models", "{apps} 个应用 · {models} 个模型"],
495
+ "flow_group_scope": ["{apps} apps · {models} model groups", "{apps} 个应用 · {models} 个模型分组"],
481
496
  "flow_omitted": ["Showing {count} requests; {omitted} more have no detail", "显示 {count} 个请求,另有 {omitted} 个暂无详情"],
482
497
  "flow_more_models": ["Show {count} more models", "显示其余 {count} 个模型"],
483
498
  "flow_fewer_models": ["Show fewer models", "收起模型"],
@@ -488,11 +503,33 @@
488
503
  "flow_app_gemini_app": ["Antigravity", "Antigravity"],
489
504
  "flow_app_claude": ["Claude (app unspecified)", "Claude(未区分应用)"],
490
505
  "flow_app_api": ["Unidentified app", "未识别应用"],
506
+ "flow_source_pending": ["Source pending", "来源待确认"],
507
+ "flow_model_pending": ["Model pending", "模型待确认"],
491
508
  "flow_source_unknown": ["Source unknown", "来源未知"],
492
509
  "flow_model_unknown": ["Model not identified", "未识别模型"],
493
510
  "flow_responding": ["Responding", "响应中"],
494
511
  "flow_group_response": ["{count} responding", "{count} 个响应中"],
495
- "flow_waiting": ["Waiting for response", "等待响应"],
512
+ "flow_waiting": ["Waiting upstream", "等待上游"],
513
+ "flow_queued": ["Queued", "排队中"],
514
+ "flow_input": ["Processing input", "处理输入"],
515
+ "flow_processing": ["Processing", "处理中"],
516
+ "request_usage_state": ["Usage received", "用量接收状态"],
517
+ "request_usage_reported": ["Reported", "已收到"],
518
+ "request_usage_partial": ["Some counts unavailable", "部分计数未提供"],
519
+ "request_usage_missing": ["No valid usage received", "未收到有效用量"],
520
+ "request_usage_unavailable": ["Metadata could not be read", "元数据无法读取"],
521
+ "usage_model_page": ["Model / entire page", "模型/整页"],
522
+ "usage_range_page": ["Time / entire page", "时间/整页"],
523
+ "usage_all_history": ["All retained history", "全部已保留历史"],
524
+ "usage_365_days": ["Last 365 days", "最近 365 天"],
525
+ "usage_clear_date": ["Clear date", "清除日期"],
526
+ "usage_records": ["RECORDS", "用量记录"],
527
+ "recorded_usage": ["Usage records", "用量记录"],
528
+ "usage_earlier": ["Earlier records", "更早记录"],
529
+ "usage_earlier_before": ["Records before {date}", "{date} 之前的记录"],
530
+ "usage_empty_selection": ["No recorded usage matches these filters. No records does not mean zero requests.", "当前筛选没有已记录用量。没有记录不代表没有请求。"],
531
+ "usage_activity_range": ["ACTIVITY", "用量活动"],
532
+ "usage_cache_coverage": ["Cache counts available: {known} records; unavailable: {unknown}.", "缓存计数已知 {known} 条,未知 {unknown} 条。"],
496
533
  "flow_preparing": ["Preparing", "准备中"],
497
534
  "flow_retrying": ["Retrying", "正在重试"],
498
535
  "flow_finishing": ["Finishing delivery", "正在完成交付"],
@@ -524,7 +561,7 @@
524
561
  "connection_details": ["Connection details", "连接详情"],
525
562
  "messages_combined_since_start": ["Both Claude apps · This service run", "两款应用合计 · 本次运行"],
526
563
  "claude_metrics_combined": ["Both Claude apps", "两款应用合计"],
527
- "source_access_details": ["SOURCE ACCESS DETAILS", "来源访问详情"],
564
+ "source_access_details": ["CONNECTION DIAGNOSTICS", "连接诊断"],
528
565
  "account_access": ["Account & access", "账号与访问"],
529
566
  "account_management_location": ["Manage sign-in, accounts and models under Model sources.", "登录、账号和模型在来源页管理。"],
530
567
  "check_github_connection": ["Check GitHub connection", "检查 GitHub 连接"],
@@ -774,7 +811,7 @@
774
811
  "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
812
  "auto_review_model": ["Review model", "自动审查模型"],
776
813
  "apply_source": ["Use this source", "使用来源"],
777
- "enable_service": ["Enable source", "开启接入"],
814
+ "enable_service": ["Enable source", "启用来源"],
778
815
  "disable_service": ["Disable source", "停用接入"],
779
816
  "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
817
  "process_listener": ["LOCAL SERVICE", "本机服务"],
@@ -819,7 +856,7 @@
819
856
  "gateway": ["LOCAL ACCESS", "本机接入"],
820
857
  "last_request": ["LAST REQUEST", "最近请求"],
821
858
  "client_connections": ["APP SETUP", "应用接入"],
822
- "model_catalog": ["MODEL LIST", "模型列表"],
859
+ "model_catalog": ["MODEL CATALOG", "模型目录"],
823
860
  "reasoning": ["THINKING LEVEL", "思考强度"],
824
861
  "model_providers": ["Model providers", "模型来源"],
825
862
  "reading_provider_catalog": ["Loading model list…", "读取模型中…"],
@@ -977,13 +1014,13 @@
977
1014
  "calls_b73a5": ["Requests", "请求次数"],
978
1015
  "tokens": ["Usage (Token)", "处理用量"],
979
1016
  "open_to_read_retained_usage_history": ["Loading usage trends…", "读取用量趋势中…"],
980
- "daily_tokens": ["DAILY USAGE", "每日用量"],
1017
+ "daily_tokens": ["USAGE BY DATE", "按日期用量"],
981
1018
  "input_output_cache_included_in_input": ["INPUT + OUTPUT / REUSED INPUT IS PART OF INPUT", "输入与输出合计。\n复用部分已计入输入。"],
982
- "daily_token_usage": ["Daily usage in Token", "每日用量"],
1019
+ "daily_token_usage": ["Input and output usage by date", "按日期记录的输入与输出用量"],
983
1020
  "input_36ecb": ["Input usage", "输入用量"],
984
1021
  "output_b2439": ["Output usage", "输出用量"],
985
1022
  "request_activity_365_days": ["ACTIVITY · LAST 365 DAYS", "活跃日历"],
986
- "daily_recorded_request_activity": ["Daily recorded activity over 365 days", "每日活跃"],
1023
+ "daily_recorded_request_activity": ["Recorded usage by date", "按日期记录的用量"],
987
1024
  "select_a_day_to_inspect_its_model_totals_no_history_is_distinct_": ["Select a day for usage. Blank means no records.", "点击日期查看当天用量。空白表示无记录。"],
988
1025
  "recent_failures": ["Recent issues", "异常记录"],
989
1026
  "recent_response_failures": ["RECENT ISSUES", "异常记录"],
@@ -1072,17 +1109,17 @@
1072
1109
  "records_records_shown_of_models_models_shown_day": ["Records: {records} · models: {shown} of {models}{day}", "记录:{records}条\n模型:展示{shown}个,共{models}个{day}"],
1073
1110
  "zone_model": [" / {zone} / {model}", " / {zone} / {model}"],
1074
1111
  "no_retained_history": ["no records", "没有记录"],
1075
- "calls_recorded_calls_input_input_output_output_cached_cached_inc": ["{calls} recorded requests\nInput: {input} / output: {output}\nReused input: {cached} Token\nReused input is part of input.{partial}", "已记录请求:{calls}\n输入:{input}/输出:{output}\n复用输入:{cached} Token\n复用部分已计入输入。{partial}"],
1112
+ "calls_recorded_calls_input_input_output_output_cached_cached_inc": ["{calls} usage records\nInput: {input} / output: {output}\nReused input: {cached} Token\nReused input is part of input.{partial}", "用量记录:{calls}\n输入:{input}/输出:{output}\n复用输入:{cached} Token\n复用部分已计入输入。{partial}"],
1076
1113
  "partial_token_counts": ["\nIncomplete usage records.", "\n用量记录不完整。"],
1077
1114
  "date_description": ["{date} / {description}", "{date} / {description}"],
1078
- "metric_peak_peak": ["365 DAYS · {metric} · PEAK {peak}", "近365天 · {metric} · 峰值{peak}"],
1115
+ "metric_peak_peak": ["{metric} · Peak {peak}", "{metric} · 峰值 {peak}"],
1079
1116
  "input_output": ["TOTAL USAGE (Token)", "总用量"],
1080
1117
  "recorded_calls": ["RECORDED REQUESTS", "请求次数"],
1081
1118
  "zone_from_to_retained_history_starts_first_oldest_day_may_be_par": ["Zone: {zone}\nRange: {from}–{to}\nFirst record: {first}\nThe first day may be partial.{excluded}{limit}", "时区:{zone}\n记录范围:{from}—{to}\n最早记录:{first}\n最早一天可能记录不全。{excluded}{limit}"],
1082
1119
  "count_records_with_invalid_future_timestamps_excluded": ["\nSkipped {count} records with invalid or future dates.", "\n已跳过{count}条时间异常记录。"],
1083
1120
  "model_filters_limited_to_100_all_model_totals_include_the_remain": ["\nFilters show up to 100 models. Totals include the rest.", "\n只列出前100个模型。\n总计包含其余模型。"],
1084
- "selected_date_model_totals_in_the_usage_table_above_all_history_": ["Selected: {date} / {model}\nUsage is in the table above.\nShow all clears the date filter.", "已选:{date}/{model}\n当天用量见上方表格。\n“查看全部”会清除日期筛选。"],
1085
- "select_a_day_for_model_totals_calls_are_usage_records_not_messag": ["Select a day for usage.\nCounts are requests, not messages or time.\nHatched: no records. Blank: zero recorded requests.", "点击日期查看当天用量。\n统计请求,不代表消息或时长。\n斜线格:没有记录。\n空白格:记录为零次请求。"],
1121
+ "selected_date_model_totals_in_the_usage_table_above_all_history_": ["Selected: {date} / {model}\nClear date restores the time filter.", "已选:{date}/{model}\n清除日期后恢复时间筛选。"],
1122
+ "select_a_day_for_model_totals_calls_are_usage_records_not_messag": ["Select a day for usage.\nCounts are usage records, not messages or time.\nHatched: no retained history. Blank: zero recorded usage.", "点击日期查看当天用量。\n计数为用量记录,不代表消息或时长。\n斜线格:没有保留记录。\n空白格:用量记录为零。"],
1086
1123
  "log_unavailable": ["READ FAILED", "读取失败"],
1087
1124
  "no_usage_summary_available": ["Cannot read usage records.", "无法读取用量记录。"],
1088
1125
  "analytics_unavailable_refresh_usage_to_retry": ["Trends unavailable. Refresh Model usage to retry.", "统计失败,请刷新用量。"],
@@ -9,7 +9,7 @@
9
9
  let issueGroups = { issues: [], capability: [], connection: [] }, issueRequests = [];
10
10
  element("failure-kind")?.addEventListener?.("change", () => renderFailures(issueGroups[element("failure-kind").value] || [], element("failure-kind").value === "issues" ? issueRequests : []));
11
11
  let contextSignature;
12
- const sourceNames = new Map([["github", "GitHub Copilot"], ["m365", "Microsoft 365"]]);
12
+ const sourceNames = new Map([["github", "GitHub Copilot"], ["m365", "Microsoft 365"], ["google", "Google"]]);
13
13
 
14
14
  const sourceLabel = id => globalThis.ccdxConnectionNames?.[id] || sourceNames.get(id) || id;
15
15
  function renderProviders(data) {
@@ -398,6 +398,8 @@
398
398
  ["wire_mib", finite(context.payload_bytes) ? `${(Number(context.payload_bytes) / 1048576).toFixed(2)} MiB` : "—"],
399
399
  ["images", number(context.images)], ["model_window", number(context.context_window_tokens)], ["input_window", ratio],
400
400
  ["output_requested", number(context.max_output_tokens_requested)], ["output_sent", number(context.max_output_tokens_sent)], ["output_used", number(context.output_tokens)], ["stop_reason", request.stop_reason || "—"],
401
+ ...(context.requested_model && context.requested_model !== request.model ? [["requested_model", context.requested_model]] : []),
402
+ ...(["reported", "partial", "missing", "unavailable"].includes(context.usage_state) ? [["request_usage_state", globalThis.ccdxLanguage?.format("request_usage_" + context.usage_state) || context.usage_state]] : []),
401
403
  ...(context.client_tool_errors_received > 0 ? [["client_tool_errors_received", number(context.client_tool_errors_received)]] : [])]) {
402
404
  const term = document.createElement("dt"), detail = document.createElement("dd");localize(term, key);detail.textContent = value;fields.append(term, detail);
403
405
  }
@@ -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; }
@@ -17,6 +17,7 @@ const number = (value) => finite(value) ? Math.max(0, Math.round(Number(value)))
17
17
  const mib = (value) => finite(value) ? `${(Number(value) / 1048576).toFixed(1)} MiB` : "—";
18
18
  const time = (value, options) => globalThis.ccdxTime?.format(value, options) ?? (value ? new Date(value).toLocaleTimeString() : "—");
19
19
  const viewHelpers = { time, element, phrase, localize, text, finite, number, mib, tableRow, emptyTable, document, navigator: globalThis.navigator, modelLabel: usageModelLabel,
20
+ usageChanged: () => { dashboardRefresh.invalidate("usage");return dashboardRefresh.refresh("usage", { force: true }); },
20
21
  motionAllowed: () => !reducedMotion.matches && document.visibilityState === "visible" && element("usage-analytics").open && !element("usage-analytics").closest("[hidden]") };
21
22
  const { render, renderActivity, renderProviders, renderFailures, renderContext } = globalThis.ccdxViewBoundary.create("client-features", () => globalThis.ccdxDashboardStatus.create(viewHelpers), ["render", "renderActivity", "renderProviders", "renderFailures", "renderContext"]);
22
23
  const usageView = globalThis.ccdxViewBoundary.create("usage-analytics", () => globalThis.ccdxDashboardUsage.create(viewHelpers), ["applyUsage", "renderUsageState", "renderAnalytics", "renderUsageTable", "selectUsageDay", "usageValues", "setChartVisible", "revealChart", "stopMotion", "refreshModelLabels"]);
@@ -80,8 +81,8 @@ let selectedProvider = "";
80
81
  function usageModelLabel(value) {
81
82
  if (typeof value !== "string") return value;
82
83
  const at = value.indexOf(" / "), id = value.slice(0, at);
83
- if (at < 0 || !id.startsWith("api_")) return value;
84
- const name = providerEntries.find(provider => provider.id === id)?.name;
84
+ if (at < 0) return value;
85
+ const name = providerEntries.find(provider => provider.id === id)?.name || ({ github: "GitHub Copilot", m365: "Microsoft 365", google: "Google" })[id];
85
86
  return name ? name + value.slice(at) : value;
86
87
  }
87
88
  const modelSnapshots = new Map();
@@ -91,7 +92,7 @@ try { selectedProvider = localStorage.getItem("ccdx.dashboard.modelProvider") ||
91
92
  function syncUsageProviders() {
92
93
  const selector = element("usage-provider"), selected = selector.value;
93
94
  const entries = new Map(providerEntries.map(provider => [provider.id, provider.name]));
94
- for (const id of Object.keys(usageProviders)) if (usageProviders[id] > 0 && !entries.has(id)) entries.set(id, id);
95
+ for (const id of Object.keys(usageProviders)) if (usageProviders[id] > 0 && !entries.has(id)) entries.set(id, ({ google: "Google", github: "GitHub Copilot", m365: "Microsoft 365" })[id] || id);
95
96
  const signature = JSON.stringify([...entries]);
96
97
  if (selector.dataset.providers === signature) return;
97
98
  selector.dataset.providers = signature;
@@ -212,7 +213,7 @@ function applyModels(data, { changed }) {
212
213
  const expanded = new Set([...body.querySelectorAll("details[open]")].filter(node => node.dataset.disclosureClosing !== "true").map(node => node.dataset.model));
213
214
  body.replaceChildren();
214
215
  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(" / ") || "—";
216
+ const clients = (model.clients || []).map(id => ({ codex: "Codex App", claude_app: "Claude App", claude_code: "Claude Code", antigravity: "Antigravity" })[id] || id).join(" / ") || "—";
216
217
  const row = tableRow([model.display_name || model.id, clients, ""]);row.children[0].className = "model-name";
217
218
  if (model.kind === "image") { const badge = document.createElement("span");badge.className = "model-maker";localize(badge, "image_purpose");row.children[0].append(badge); }
218
219
  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 +230,7 @@ function applyModels(data, { changed }) {
229
230
  }
230
231
  for (const item of model.client_visibility || []) if (item.reason) {
231
232
  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;
233
+ term.textContent = ({ codex: "Codex App", claude_app: "Claude App", claude_code: "Claude Code", antigravity: "Antigravity" })[item.client] || item.client;
233
234
  localize(detail, "visibility_" + item.reason);fields.append(term, detail);
234
235
  }
235
236
  row.children[2].append(details);body.append(row);
@@ -390,12 +391,17 @@ const dashboardRefresh = globalThis.ccdxRefresh.createController({
390
391
  variant: () => {
391
392
  const mode = (element("usage-analytics").open || Boolean(usageView.selectedDate)) ? "analytics" : "summary";
392
393
  const provider = element("usage-provider")?.value || "";
393
- return mode + (provider ? `:${provider}` : "");
394
+ return JSON.stringify({ mode, provider, model: element("analytics-model").value || "", days: element("analytics-range").value || "all", date: usageView.selectedDate });
394
395
  },
395
396
  load: async ({ variant, signal }) => {
396
- const [mode, provider = ""] = variant.split(":"), query = new URLSearchParams();
397
+ const { mode, provider, model, days, date } = JSON.parse(variant), query = new URLSearchParams();
397
398
  if (mode === "analytics") { query.set("analytics", "1");query.set("time_zone", Intl.DateTimeFormat().resolvedOptions().timeZone); }
398
399
  if (provider) query.set("provider", provider);
400
+ if (model) query.set("model", model);
401
+ if (date?.startsWith("<")) query.set("to", new Date(Date.parse(date.slice(1)) - 86400000).toISOString().slice(0, 10));
402
+ else if (date) { query.set("from", date);query.set("to", date); }
403
+ else if (days !== "all") query.set("days", days);
404
+ if (date || days !== "all") query.set("time_zone", Intl.DateTimeFormat().resolvedOptions().timeZone);
399
405
  const data = await readDashboard(`/_ccdx/ui/usage${query.size ? `?${query}` : ""}`, { signal, source: "local_usage_log" });
400
406
  if (!data.total || !Array.isArray(data.rows) || (mode === "analytics" && (!Array.isArray(data.analytics?.days) || !data.analytics.days.length))) throw new Error("Invalid usage snapshot");
401
407
  return data;
@@ -495,12 +501,17 @@ element("usage-analytics").addEventListener("toggle", () => {
495
501
  if (element("usage-analytics").open) usageView.revealChart();else usageView.stopMotion();
496
502
  if (element("usage-analytics").open) dashboardRefresh.refresh("usage");
497
503
  });
498
- for (const id of ["analytics-model", "analytics-range", "analytics-metric", "analytics-view"]) element(id).addEventListener("change", () => {
504
+ for (const id of ["analytics-metric", "analytics-view"]) element(id).addEventListener("change", () => {
499
505
  renderAnalytics();
500
506
  if (usageView.data && usageView.selectedDate) renderUsageTable();
501
507
  });
508
+ for (const id of ["analytics-model", "analytics-range"]) element(id).addEventListener("change", () => {
509
+ if (id === "analytics-range" && usageView.selectedDate) { const range = element(id).value;selectUsageDay("", { refresh: false });element(id).value = range; }
510
+ renderAnalytics();if (usageView.data && !usageView.data.filters) renderUsageTable();
511
+ dashboardRefresh.invalidate("usage");void dashboardRefresh.refresh("usage", { force: true });
512
+ });
502
513
  element("clear-usage-day").addEventListener("click", () => selectUsageDay(""));
503
- element("usage-provider")?.addEventListener("change", () => { dashboardRefresh.invalidate("usage");dashboardRefresh.refresh("usage", { force: true }); });
514
+ element("usage-provider")?.addEventListener("change", () => { selectUsageDay("", { refresh: false });element("analytics-model").value = "";dashboardRefresh.invalidate("usage");dashboardRefresh.refresh("usage", { force: true }); });
504
515
  element("refresh-models").addEventListener("click", loadModels);
505
516
  element("refresh-usage").addEventListener("click", loadUsage);
506
517
  for (const link of document.querySelectorAll("[data-source-link]")) link.addEventListener("click", () => {