codex-copilot-dx 1.4.10 → 1.4.11

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.
@@ -1262,4 +1262,4 @@ The implementation takes the native/gateway-state ownership separation from [Mag
1262
1262
 
1263
1263
  `tool-activity.mjs` stores bounded, memory-only metadata behind each stream-performance observer. Existing parsed Responses items, Messages blocks and Gemini function calls supply tool names and scoped identifiers; no argument or output body is copied. The existing session/profile HMAC and application label isolate result matching. Results match call IDs, with a unique-name-only fallback for Gemini. Request completion changes generated calls to waiting, never to successful execution. Observable returned results, source failures and cancellation terminate the corresponding observations. Live response activity renews preparing observations with at most one notification per second per request. Missing evidence becomes unknown after 90 seconds, with a bounded late-result window. Snapshot reads perform lazy retention cleanup; there is no server polling loop.
1264
1264
 
1265
- The WebUI consumes this metadata through the existing activity subscription. `dashboard/tool-activity.js` draws only the selected style, caches layout/theme measurements, caps drawing at 30 fps and DPR 1.5, pauses hidden/off-screen/reduced-motion views, and stops terminal cues within 0.9 seconds. Beam ring is the default; grid, busy pulse, fast streaks and assembly line are alternatives. Removed styles fall back to the default and Off retains state text. With no pending calls, conversation-purpose active requests supply processing/reply cues; internal diagnostics and terminal requests are excluded. Non-live request snapshots expire after six seconds. Local deadline timers stop stale activity even when the stream has no new events. Native controls, theme variables and the language dictionary preserve the existing UI contract. Existing `requests --active` and `requests tools` grammar also drive TUI discovery.
1265
+ The WebUI consumes this metadata through the existing activity subscription. `dashboard/tool-activity.js` draws only the selected style, caches layout/theme measurements, caps drawing at 30 fps and DPR 1.5, pauses hidden/off-screen/reduced-motion views, and stops terminal cues within 0.9 seconds. Assembly line is the default; Beam ring and Grid are alternatives. Removed styles fall back to the default and Off retains state text. With no pending calls, conversation-purpose active requests supply processing/reply cues; internal diagnostics and terminal requests are excluded. Non-live request snapshots expire after six seconds. Local deadline timers stop stale activity even when the stream has no new events. Native controls, theme variables and the language dictionary preserve the existing UI contract. Existing `requests --active` and `requests tools` grammar also drive TUI discovery.
package/docs/REFERENCE.md CHANGED
@@ -128,7 +128,7 @@ Each protocol observer retains at most 64 series of 64 request points and 16 com
128
128
 
129
129
  ## Observed tool calls
130
130
 
131
- **Requests → Tool and agent activity** uses the existing activity stream for Codex, Claude and Antigravity. Beam ring is the default; choose Grid, Busy pulse, Fast streaks, Assembly line or Off. This browser remembers valid choices; removed Orbit rings and Woven field choices fall back to Beam ring. Captions change with observed call preparation, waiting and returned results. When no tools are pending, active conversation requests show processing or reply generation. These are observed gateway request phases, not a count of native subagents. Motion runs at a faster presentation cadence, independent of event frequency; it is not a progress percentage or a call counter. System reduced motion and hidden/off-screen views pause continuous drawing. Off stops drawing and keeps the status text. Returned results have at most a 0.9-second finish cue; failure, cancellation and unavailable evidence stop continuous motion.
131
+ **Requests → Tool and agent activity** uses the existing activity stream for Codex, Claude and Antigravity. Assembly line is the default. It shows a roller belt feeding a press. You can also choose Beam ring, Grid or Off. This browser remembers valid choices; removed styles fall back to Assembly line. Captions change with observed call preparation, waiting and returned results. When no tools are pending, active conversation requests show processing or reply generation. These are observed gateway request phases, not a count of native subagents. Motion runs at a faster presentation cadence, independent of event frequency; it is not a progress percentage or a call counter. System reduced motion and hidden/off-screen views pause continuous drawing. Off stops drawing and keeps the status text. Returned results have at most a 0.9-second finish cue; failure, cancellation and unavailable evidence stop continuous motion.
132
132
 
133
133
  Calls are correlated using their IDs and the existing app/profile/session scope. A model emitting a tool call does not prove that the client executed it. Only a matching returned result ends the wait; ambiguous name-only Gemini results stay unconfirmed. Without a reliable session, completed requests show unconfirmed tool state. After 90 seconds without observable tool or response activity, the UI pauses and shows that fresh status is needed. Late results can update retained unconfirmed observations for another five minutes. These display deadlines never cancel tools or change source timeouts.
134
134
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "codex-copilot-dx",
3
- "version": "1.4.10",
3
+ "version": "1.4.11",
4
4
  "description": "Local gateway for Codex, Claude and Gemini Antigravity with Copilot, Microsoft 365 and custom APIs",
5
5
  "author": "Dale Xiao",
6
6
  "type": "module",
@@ -402,8 +402,8 @@
402
402
  <details id="flow-active" class="tool-details"><summary id="flow-active-title" data-i18n="flow_active_requests">Active requests</summary><div class="table-wrap"><table><thead><tr><th data-i18n="client">App</th><th data-i18n="source">Source</th><th data-i18n="model">Model</th><th data-i18n="state">State</th><th data-i18n="flow_elapsed">Elapsed</th><th data-i18n="attempts">Attempts</th></tr></thead><tbody id="flow-active-body"></tbody></table></div></details>
403
403
  </section>
404
404
  <section id="tool-activity" class="panel dashboard-section" aria-labelledby="tool-title" data-paused="true">
405
- <div class="panel-heading"><h2 id="tool-title" data-i18n="tool_heading">TOOL AND AGENT ACTIVITY</h2><label class="tool-style" for="tool-style"><span data-i18n="tool_style">Style</span><select id="tool-style"><option value="halo" data-i18n="tool_style_halo">Beam ring</option><option value="grid" data-i18n="tool_style_grid">Grid</option><option value="busy" data-i18n="tool_style_busy">Busy pulse</option><option value="speed" data-i18n="tool_style_speed">Fast streaks</option><option value="assembly" data-i18n="tool_style_assembly">Assembly line</option><option value="off" data-i18n="tool_style_off">Off</option></select></label></div>
406
- <div id="tool-stage" class="tool-stage" data-style="halo">
405
+ <div class="panel-heading"><h2 id="tool-title" data-i18n="tool_heading">TOOL AND AGENT ACTIVITY</h2><label class="tool-style" for="tool-style"><span data-i18n="tool_style">Style</span><select id="tool-style"><option value="assembly" data-i18n="tool_style_assembly">Assembly line</option><option value="halo" data-i18n="tool_style_halo">Beam ring</option><option value="grid" data-i18n="tool_style_grid">Grid</option><option value="off" data-i18n="tool_style_off">Off</option></select></label></div>
406
+ <div id="tool-stage" class="tool-stage" data-style="assembly">
407
407
  <div class="tool-visual"><div class="tool-orbit"><canvas id="tool-canvas" role="img" data-i18n-label="tool_heading" aria-label="Tool and agent activity"></canvas></div><p class="tool-narration"><span id="tool-state" role="status" aria-live="polite" data-i18n="flow_status_unknown">Waiting for a fresh status</span><span id="tool-cursor" aria-hidden="true" hidden> …</span></p></div>
408
408
  <div class="tool-content"><p id="tool-context" class="tool-context" hidden></p><div id="tool-list"></div><p id="tool-more" class="hint" hidden></p><details id="tool-details" class="tool-details tool-technical" hidden><summary data-i18n="tool_details">Call details</summary><div id="tool-technical"></div></details></div>
409
409
  </div>
@@ -4,9 +4,7 @@
4
4
  "tool_style": ["Style","样式"],
5
5
  "tool_style_grid": ["Grid","格子进度条"],
6
6
  "tool_style_halo": ["Beam ring","光束圆环"],
7
- "tool_style_busy": ["Busy pulse","忙碌脉冲"],
8
- "tool_style_speed": ["Fast streaks","疾速流光"],
9
- "tool_style_assembly": ["Assembly line","装配流水线"],
7
+ "tool_style_assembly": ["Assembly line","装配线"],
10
8
  "tool_style_off": ["Off","关闭"],
11
9
  "tool_preparing": ["Preparing a tool call","正在准备调用"],
12
10
  "tool_preparing_many": ["Preparing {count} calls","并行准备 {count} 项调用"],
@@ -1,20 +1,78 @@
1
1
  (() => {
2
2
  const root = document.getElementById("tool-activity");if (!root) return;
3
3
  const el = id => document.getElementById(id), canvas = el("tool-canvas"), ctx = canvas.getContext?.("2d");
4
- const styles = new Set(["halo", "grid", "busy", "speed", "assembly", "off"]), storageKey = "ccdx.dashboard.toolMotionStyle";
4
+ const styles = new Set(["halo", "grid", "assembly", "off"]), storageKey = "ccdx.dashboard.toolMotionStyle";
5
5
  const pending = state => ["preparing", "waiting"].includes(state);
6
6
  const phrase = (key, values = {}) => globalThis.ccdxLanguage.format(key, values);
7
7
  const text = (id, key, values) => globalThis.ccdxLanguage.set(el(id), key, values);
8
- const state = { scene: "idle", style: "halo", intensity: .8, reduce: false };
8
+ const state = { scene: "idle", style: "assembly", intensity: .8, reduce: false };
9
9
  try { const saved = localStorage.getItem(storageKey);if (styles.has(saved)) state.style = saved; } catch {}
10
10
  const motion = globalThis.matchMedia?.("(prefers-reduced-motion: reduce)") || { matches: false, addEventListener() {} };
11
11
  let records = [], fresh = false, supported = false, visible = true, raf = 0, last = 0, start = performance.now(), expiry = null;
12
- let signature = "", box = { width: 0, height: 0 }, color = "", omitted = 0, requests = [], requestDeadline = 0;
12
+ let signature = "", box = { width: 0, height: 0 }, color = "", surface = "", omitted = 0, requests = [], requestDeadline = 0;
13
13
  const animating = () => ["calling", "parallel", "waiting", "processing", "responding"].includes(state.scene);
14
14
  const shown = () => document.visibilityState === "visible" && !root.closest("[hidden]") && visible;
15
15
  function measure() {
16
- box = canvas.getBoundingClientRect();color = getComputedStyle(document.documentElement).getPropertyValue("--accent").trim();
16
+ box = canvas.getBoundingClientRect();
17
+ const theme = getComputedStyle(document.documentElement);
18
+ color = theme.getPropertyValue("--accent").trim();surface = theme.getPropertyValue("--surface").trim();
17
19
  refreshAnimation();
20
+ }
21
+ function drawAssembly(dpr,w,h,t,active,waiting,returned,reduced) {
22
+ const scale=Math.min((w-12)/264,(h-12)/118);
23
+ if(scale<=0)return;
24
+ ctx.setTransform(scale*dpr,0,0,scale*dpr,(w-264*scale)*dpr/2,(h-118*scale)*dpr/2);
25
+ const running=active||waiting;
26
+ const phase=reduced?.42:(t*(waiting?.7:1.04))%2.1/2.1;
27
+ const press=running?Math.max(0,1-Math.abs(phase-.5)/.14):0;
28
+ const workX=returned?132+91*Math.min(1,t/.85):
29
+ phase<.34?29+103*phase/.34:phase<.66?132:132+91*(phase-.66)/.34;
30
+ const moving=running&&(phase<.34||phase>=.66)||returned;
31
+ const shift=moving?(reduced?0:t*78)%14:0;
32
+ const assembled=returned||phase>=.5;
33
+ function path(points,closed=false){
34
+ ctx.beginPath();ctx.moveTo(points[0],points[1]);
35
+ for(let i=2;i<points.length;i+=2)ctx.lineTo(points[i],points[i+1]);
36
+ if(closed)ctx.closePath();
37
+ }
38
+ // Floor, braced stands and the rear uprights of the press.
39
+ ctx.lineWidth=1.2;ctx.globalAlpha=.22;
40
+ path([18,108,246,108]);ctx.stroke();
41
+ ctx.globalAlpha=.52;
42
+ path([35,88,35,108,55,108,55,88,35,106,55,90]);ctx.stroke();
43
+ path([209,88,209,108,229,108,229,88,209,106,229,90]);ctx.stroke();
44
+ ctx.fillRect(99,22,5,45);ctx.fillRect(160,22,5,45);
45
+ ctx.strokeRect(93,11,78,13);
46
+ ctx.globalAlpha=.23;
47
+ ctx.fillRect(93,11,78,13);
48
+ ctx.globalAlpha=.65;
49
+ ctx.beginPath();
50
+ for(let i=98;i<168;i+=8){ctx.moveTo(i,21);ctx.lineTo(i+4,14);}
51
+ ctx.stroke();
52
+ // Belt deck and rollers, with the drive drums in the front housing.
53
+ ctx.globalAlpha=.18;path([13,77,239,77,252,65,26,65],true);ctx.fill();
54
+ ctx.globalAlpha=.64;ctx.stroke();
55
+ ctx.beginPath();
56
+ for(let i=30;i<235;i+=14){ctx.moveTo(i+shift,75);ctx.lineTo(i+shift+9,67);}
57
+ ctx.stroke();
58
+ ctx.globalAlpha=.16;ctx.fillRect(13,77,226,13);
59
+ ctx.globalAlpha=.72;ctx.strokeRect(13,77,226,13);
60
+ for(const x of [22,230]){ctx.beginPath();ctx.arc(x,83.5,3.8,0,Math.PI*2);ctx.stroke();}
61
+ // Cylinder, piston and platen travel together.
62
+ const piston=press*9;
63
+ ctx.globalAlpha=.82;ctx.strokeRect(123,24,18,13);ctx.fillRect(130,37,4,5+piston);
64
+ ctx.fillRect(120,42+piston,24,3);
65
+ if(running||returned){
66
+ const x=workX-11,y=assembled?57:60;
67
+ ctx.globalAlpha=1;ctx.fillStyle=surface;
68
+ path([x,75,x,y,x+6,y-5,x+27,y-5,x+27,70,x+21,75],true);ctx.fill();
69
+ ctx.fillStyle=color;ctx.globalAlpha=.24;ctx.fill();
70
+ ctx.globalAlpha=.86;ctx.stroke();
71
+ path([x,y,x+21,y,x+27,y-5]);ctx.stroke();
72
+ path([x+21,y,x+21,75]);ctx.stroke();
73
+ if(assembled){ctx.globalAlpha=.62;ctx.fillRect(x+6,y+5,9,3);}
74
+ }
75
+ ctx.globalAlpha=1;
18
76
  }
19
77
  function draw(now=performance.now()){
20
78
  if(!ctx||!box.width||!box.height)return;
@@ -36,38 +94,8 @@
36
94
  }
37
95
  ctx.globalAlpha=1;return;
38
96
  }
39
- if(state.style==='busy'){
40
- const n=7,bw=12,gap=11,left=cx-(n*bw+(n-1)*gap)/2;
41
- for(let i=0;i<n;i++){
42
- const wave=active||waiting?(Math.sin(t*(waiting?6:11)-i*.8)+1)/2:.2;
43
- const bh=quiet?12:returned?22:14+wave*54;
44
- ctx.globalAlpha=quiet?.15:returned?.55:.18+wave*power;ctx.fillRect(left+i*(bw+gap),cy-bh/2,bw,bh);
45
- }
46
- ctx.globalAlpha=1;return;
47
- }
48
- if(state.style==='speed'){
49
- const span=Math.min(w-36,220),left=cx-span/2;
50
- for(let i=0;i<7;i++){
51
- const phase=(t*(waiting?1.5:3.3)+i*.173)%1,len=20+(i%3)*16,y=cy+(i-3)*13;
52
- const x=active||waiting?left+phase*(span+len)-len:left+span*.43;
53
- ctx.globalAlpha=quiet?.12:returned?.5:Math.sin(phase*Math.PI)*power;
54
- ctx.lineWidth=i===3?3:1.5;ctx.beginPath();ctx.moveTo(Math.max(left,x),y);ctx.lineTo(Math.min(left+span,x+len),y);ctx.stroke();
55
- }
56
- ctx.globalAlpha=1;return;
57
- }
58
97
  if(state.style==='assembly'){
59
- const span=Math.min(w-32,218),left=cx-span/2,rail=cy+23;
60
- ctx.globalAlpha=quiet?.12:.26;ctx.lineWidth=1;
61
- ctx.beginPath();ctx.moveTo(left,rail);ctx.lineTo(left+span,rail);ctx.moveTo(left,rail+8);ctx.lineTo(left+span,rail+8);ctx.stroke();
62
- for(let i=0;i<3;i++){
63
- const x=left+span*(i+.5)/3,phase=(t*(waiting?1.5:3.2)-i/3+9)%1,press=active||waiting?Math.max(0,1-Math.abs(phase-.5)*5):0;
64
- ctx.globalAlpha=quiet?.16:.58;ctx.fillRect(x-14,cy-36,28,8);ctx.fillRect(x-2,cy-28,4,16+press*16);ctx.fillRect(x-9,cy-14+press*16,18,4);
65
- }
66
- for(let i=0;i<5;i++){
67
- const phase=active||waiting?(t*(waiting?.7:1.6)+i/5)%1:(i+.5)/5,x=left+phase*span;
68
- ctx.globalAlpha=quiet?.12:returned?.55:.2+Math.sin(phase*Math.PI)*power;ctx.fillRect(x-5,rail-12,10,10);
69
- }
70
- ctx.globalAlpha=1;return;
98
+ drawAssembly(dpr,w,h,t,active,waiting,returned,reduced);return;
71
99
  }
72
100
  arc(r,0,Math.PI*2,.25);arc(r*.85,0,Math.PI*2,.13);arc(r*1.12,0,Math.PI*2,.1);
73
101
  const spin=active?t*1.6:waiting?t*.9:0;
@@ -171,11 +171,11 @@ select option { color: var(--text); background: var(--surface); }
171
171
  .chart-heading { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; margin: 22px 0 10px; }
172
172
  .chart-heading h3 { margin: 0; color: var(--heading); font-size: 11px; }
173
173
  .chart-heading span, .chart-legend { color: var(--muted); font-size: 10px; }
174
- .daily-bars { display: flex; align-items: end; gap: 3px; height: 130px; border-bottom: 1px solid var(--border); }
175
- .daily-bar { height: 100%; flex: 1; min-width: 0; padding: 0; border: 0; display: flex; flex-direction: column; justify-content: end; background: transparent; border-radius: 0; }
174
+ .daily-bars { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 130px; border-bottom: 1px solid var(--border); }
175
+ .daily-bar { height: 100%; min-width: 0; padding: 0; border: 0; display: flex; flex-direction: column; justify-content: end; background: transparent; border-radius: 0; }
176
176
  .daily-bar span { display: block; flex-shrink: 0; width: 100%; }
177
- .daily-bar .bar-stack { display:flex; flex-direction:column; justify-content:end; height:100%; transform-origin:center bottom; }
178
- .daily-lines { position:relative; gap:0; }
177
+ .daily-bar .bar-stack { display:flex; flex-direction:column; justify-content:end; align-self:center; width:max(calc(100% - 3px), min(100%, 2px)); height:100%; transform-origin:center bottom; }
178
+ .daily-lines { position:relative; }
179
179
  .daily-line-plot { position:absolute; inset:0; width:100%; height:100%; pointer-events:none; overflow:visible; }
180
180
  .daily-curve { fill:none; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; stroke-dasharray:1; stroke-dashoffset:0; }
181
181
  .curve-input { stroke:var(--accent-soft); }
@@ -196,7 +196,7 @@ select option { color: var(--text); background: var(--surface); }
196
196
  .calendar-grid { width: max-content; }
197
197
  .calendar-months { display: grid; grid-auto-columns: 12px; gap: 4px; margin-bottom: 7px; color: var(--muted); font-size: 9px; height: 14px; }
198
198
  .activity-calendar { display: grid; grid-template-rows: repeat(7, 12px); grid-auto-flow: column; grid-auto-columns: 12px; gap: 4px; width: max-content; }
199
- .calendar-day { padding: 0; border: 1px solid var(--border); width: 12px; height: 12px; background: var(--button-bg); }
199
+ .calendar-day { padding: 0; border: 1px solid var(--border); width: 12px; height: 12px; min-height: 0; background: var(--button-bg); }
200
200
  .calendar-day[data-level="1"] { background: color-mix(in srgb, var(--accent-soft) 25%, var(--surface)); }
201
201
  .calendar-day[data-level="2"] { background: color-mix(in srgb, var(--accent-soft) 45%, var(--surface)); }
202
202
  .calendar-day[data-level="3"] { background: color-mix(in srgb, var(--accent-soft) 70%, var(--surface)); }
@@ -412,7 +412,8 @@ export async function handleDashboardApi(req, res, pathname, {
412
412
  return selection.matches(record);
413
413
  };
414
414
  const analysis = (analytics || filtered) && !usageSummaryFn
415
- ? await analyzeUsageLogs(undefined, { provider, model: selection.filters.model, from: selection.filters.from, to: selection.filters.to, timeZone: selection.filters.time_zone, signal: abort.signal }) : null;
415
+ ? await analyzeUsageLogs(undefined, { provider, model: selection.filters.model, purpose: selection.filters.purpose,
416
+ from: selection.filters.from, to: selection.filters.to, timeZone: selection.filters.time_zone, signal: abort.signal }) : null;
416
417
  const summary = analysis?.summary || await (usageSummaryFn || (options => summarizeUsageLogs(undefined, { ...options, signal: abort.signal })))({ provider,
417
418
  ...(filtered ? { recordFilter } : {}), ...(analytics ? { onRecord: analytics.record } : {}) });
418
419
  const availableModels = analysis?.analytics.models || (observedModels.size ? [...observedModels].sort() : Object.keys(provider ? summary.byModel : summary.bySourceModel || summary.byModel).sort().slice(0, 100));
@@ -111,7 +111,7 @@ function makeGuard(validators, maxBytes) {
111
111
  const state = pending.get(event?.index);
112
112
  if (state && event.type === "content_block_delta") {
113
113
  if (event.delta?.type !== "input_json_delta" || typeof event.delta.partial_json !== "string") throw invalidToolInput();
114
- state.parts.push(event.delta.partial_json);
114
+ if (event.delta.partial_json) state.parts.push(event.delta.partial_json);
115
115
  }
116
116
  if (state && event.type === "content_block_stop") {
117
117
  let value = state.initial, unsafe = state.unsafe;