agent-things 1.2.1 → 1.3.1
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/mods/agent-things-ui/.claude-plugin/plugin.json +1 -1
- package/mods/agent-things-ui/hooks/controls.js +1 -1
- package/mods/agent-things-ui/hooks/foundation.js +120 -2
- package/mods/agent-things-ui/hooks/presentation.js +9 -6
- package/mods/agent-things-ui/hooks/register.js +2 -2
- package/outputs/antigravity-session-status.js +275 -98
- package/outputs/codex-session-status.js +235 -26
- package/package.json +1 -1
- package/scripts/build-shared-ui.cjs +13 -1
- package/skills/things/SKILL.en.md +3 -1
- package/skills/things/SKILL.md +3 -1
- package/src/antigravity-card.cjs +516 -88
- package/src/antigravity-hook.cjs +12 -7
- package/src/antigravity-mcp-config.cjs +45 -15
- package/src/cli/setup-orchestrator.cjs +6 -4
- package/src/harnesses/antigravity/antigravity-harness.js +159 -73
- package/src/harnesses/claude/claude-harness.js +583 -2
- package/src/harnesses/claude/claude-host-helper.cjs +5 -2
- package/src/harnesses/claude/claude-service.cjs +57 -1
- package/src/harnesses/codex/codex-card-bridge.js +19 -1
- package/src/harnesses/codex/codex-card.cjs +1 -1
- package/src/plugins/things/sidecars/things_board/index.html +275 -126
- package/src/plugins/things/sidecars/things_board/main.mjs +38 -5
- package/src/plugins/things/sidecars/things_board/styles.css +22 -6
- package/src/plugins/things/sidecars/things_board/ui-i18n.mjs +119 -1
- package/src/session-status.js +116 -25
- package/src/ui-foundation.cjs +119 -1
- package/README.zh-CN.md +0 -222
|
@@ -130,9 +130,15 @@
|
|
|
130
130
|
const prevShadow = bubble.style.boxShadow;
|
|
131
131
|
const prevTransition = bubble.style.transition;
|
|
132
132
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
let accentHex = '#2F75C3';
|
|
134
|
+
try {
|
|
135
|
+
const rootAccent = getComputedStyle(document.documentElement).getPropertyValue('--primary').trim();
|
|
136
|
+
if (rootAccent) accentHex = rootAccent;
|
|
137
|
+
} catch (_) {}
|
|
138
|
+
|
|
139
|
+
bubble.style.transition = 'outline-color 200ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1)';
|
|
140
|
+
bubble.style.outline = `2px solid ${accentHex}`;
|
|
141
|
+
bubble.style.boxShadow = `0 0 0 4px color-mix(in srgb, ${accentHex} 25%, transparent), 0 8px 24px color-mix(in srgb, ${accentHex} 35%, transparent)`;
|
|
136
142
|
|
|
137
143
|
setTimeout(() => {
|
|
138
144
|
bubble.style.outline = prevOutline;
|
|
@@ -205,9 +211,10 @@
|
|
|
205
211
|
|
|
206
212
|
const seen = new Set();
|
|
207
213
|
const queue = [rootFiber];
|
|
214
|
+
let head = 0;
|
|
208
215
|
let steps = 0;
|
|
209
|
-
while (queue.length && steps++ <
|
|
210
|
-
const node = queue
|
|
216
|
+
while (head < queue.length && steps++ < 20000) {
|
|
217
|
+
const node = queue[head++];
|
|
211
218
|
if (!node || seen.has(node)) continue;
|
|
212
219
|
seen.add(node);
|
|
213
220
|
const mp = node.memoizedProps;
|
|
@@ -277,33 +284,86 @@
|
|
|
277
284
|
}
|
|
278
285
|
}
|
|
279
286
|
|
|
287
|
+
function isThingsSidecarOpenInStore(store, convId) {
|
|
288
|
+
if (!store?.getState) return null;
|
|
289
|
+
try {
|
|
290
|
+
const st = store.getState();
|
|
291
|
+
const paneV1 = convId ? st?.sidePanel?.conversationPanes?.[convId] : st?.sidePanel?.homePane;
|
|
292
|
+
const paneV2 = convId ? st?.sidePanelV2?.conversationPanes?.[convId] : st?.sidePanelV2?.homePane;
|
|
293
|
+
const activeTabId = paneV2?.activeTabId ?? paneV1?.activeTabId ?? '';
|
|
294
|
+
if (paneV1?.isPaneOpen === true && typeof activeTabId === 'string' && activeTabId.startsWith(`sidecar__${THINGS_SIDECAR_ID}__`)) {
|
|
295
|
+
return true;
|
|
296
|
+
}
|
|
297
|
+
if (paneV1 || paneV2) return false;
|
|
298
|
+
} catch (_) {}
|
|
299
|
+
return null;
|
|
300
|
+
}
|
|
301
|
+
|
|
280
302
|
function isThingsSidecarOpen(store, convId) {
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
const st = store.getState();
|
|
284
|
-
const paneV1 = convId ? st?.sidePanel?.conversationPanes?.[convId] : st?.sidePanel?.homePane;
|
|
285
|
-
const paneV2 = convId ? st?.sidePanelV2?.conversationPanes?.[convId] : st?.sidePanelV2?.homePane;
|
|
286
|
-
const activeTabId = paneV2?.activeTabId ?? paneV1?.activeTabId ?? '';
|
|
287
|
-
if (paneV1?.isPaneOpen === true && typeof activeTabId === 'string' && activeTabId.startsWith(`sidecar__${THINGS_SIDECAR_ID}__`)) {
|
|
288
|
-
return true;
|
|
289
|
-
}
|
|
290
|
-
} catch (_) {}
|
|
291
|
-
}
|
|
303
|
+
const storeResult = isThingsSidecarOpenInStore(store, convId);
|
|
304
|
+
if (storeResult !== null) return storeResult;
|
|
292
305
|
if (typeof document !== 'undefined') {
|
|
293
306
|
const slot = document.querySelector(`[data-testid="sidecar-iframe-slot"][data-sidecar-id="${THINGS_SIDECAR_ID}"][data-visible="true"]`);
|
|
294
307
|
if (slot && typeof slot.getBoundingClientRect === 'function' && slot.getBoundingClientRect().width > 0) {
|
|
295
|
-
|
|
308
|
+
const slotUrl = slot.getAttribute?.('data-sidecar-url') || '';
|
|
309
|
+
if (!slotUrl || !convId || slotUrl.includes(`conversationId=${convId}`)) {
|
|
310
|
+
return true;
|
|
311
|
+
}
|
|
296
312
|
}
|
|
297
313
|
const frames = document.querySelectorAll('iframe[data-testid="sidecar-iframe"]');
|
|
298
314
|
for (const frame of frames) {
|
|
299
315
|
if (frame.src?.includes('things--things_board') && typeof frame.getBoundingClientRect === 'function' && frame.getBoundingClientRect().width > 0) {
|
|
300
|
-
|
|
316
|
+
if (!convId || !frame.src.includes('conversationId=') || frame.src.includes(`conversationId=${convId}`)) {
|
|
317
|
+
return true;
|
|
318
|
+
}
|
|
301
319
|
}
|
|
302
320
|
}
|
|
303
321
|
}
|
|
304
322
|
return false;
|
|
305
323
|
}
|
|
306
324
|
|
|
325
|
+
function openViaReduxBridge(bridge, descriptor, activeConvId, { avoidReload = true } = {}) {
|
|
326
|
+
const targetUrl = buildConversationSidecarUrl(descriptor.baseViewUrl, activeConvId);
|
|
327
|
+
if (avoidReload && typeof bridge.sidecarPool?.setIframeSrc === 'function') {
|
|
328
|
+
bridge.sidecarPool.setIframeSrc(targetUrl, targetUrl);
|
|
329
|
+
} else if (typeof bridge.sidecarPool?.navigateIframe === 'function') {
|
|
330
|
+
bridge.sidecarPool.navigateIframe(descriptor.baseViewUrl, targetUrl);
|
|
331
|
+
} else if (typeof bridge.sidecarPool?.setIframeSrc === 'function') {
|
|
332
|
+
bridge.sidecarPool.setIframeSrc(targetUrl, targetUrl);
|
|
333
|
+
}
|
|
334
|
+
const treeId = activeConvId ? { kind: 'cascadeId', cascadeId: activeConvId } : { kind: 'home' };
|
|
335
|
+
const st = bridge.store.getState();
|
|
336
|
+
const setContentType = st?.sidePanelV2 ? 'sidePanelV2/setContent' : 'sidePanel/setContent';
|
|
337
|
+
bridge.store.dispatch({
|
|
338
|
+
type: setContentType,
|
|
339
|
+
payload: {
|
|
340
|
+
treeId,
|
|
341
|
+
content: {
|
|
342
|
+
type: 'sidecarView',
|
|
343
|
+
sidecarView: {
|
|
344
|
+
sidecarId: descriptor.sidecarId,
|
|
345
|
+
path: descriptor.path,
|
|
346
|
+
url: descriptor.baseViewUrl,
|
|
347
|
+
title: descriptor.title,
|
|
348
|
+
},
|
|
349
|
+
},
|
|
350
|
+
tabId: descriptor.tabId,
|
|
351
|
+
},
|
|
352
|
+
});
|
|
353
|
+
bridge.store.dispatch({
|
|
354
|
+
type: 'sidePanel/setSidePanelOpen',
|
|
355
|
+
payload: { treeId, isOpen: true },
|
|
356
|
+
});
|
|
357
|
+
if (typeof bridge.router?.navigate === 'function') {
|
|
358
|
+
try {
|
|
359
|
+
bridge.router.navigate({
|
|
360
|
+
search: prev => ({ ...(prev || {}), tab: descriptor.tabId }),
|
|
361
|
+
replace: true,
|
|
362
|
+
});
|
|
363
|
+
} catch (_) {}
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
307
367
|
async function tryOpenViaDomFallback() {
|
|
308
368
|
if (typeof document === 'undefined') return;
|
|
309
369
|
const toggleBtn = document.querySelector('[data-testid="toggle-aux-sidebar"]');
|
|
@@ -376,6 +436,20 @@
|
|
|
376
436
|
throw new Error(getUiText(null, 'Things sidebar plugin is not enabled. Enable it in Plugins Manager first.', 'Things 侧边栏插件未启用,请先在 Plugins Manager 中启用 Things 插件'));
|
|
377
437
|
}
|
|
378
438
|
|
|
439
|
+
if (isThingsSidecarOpen(bridge.store, activeConvId)) {
|
|
440
|
+
syncSidecarConversation(activeConvId);
|
|
441
|
+
return { ok: true, method: 'alreadyOpen', conversationId: activeConvId };
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
if (descriptor && bridge.store?.dispatch && typeof bridge.sidecarPool?.setIframeSrc === 'function') {
|
|
445
|
+
openViaReduxBridge(bridge, descriptor, activeConvId, { avoidReload: true });
|
|
446
|
+
await waitMs(80);
|
|
447
|
+
if (isThingsSidecarOpen(bridge.store, activeConvId)) {
|
|
448
|
+
syncSidecarConversation(activeConvId);
|
|
449
|
+
return { ok: true, method: 'reduxStore', conversationId: activeConvId };
|
|
450
|
+
}
|
|
451
|
+
}
|
|
452
|
+
|
|
379
453
|
if (bridge.onSidecarLinkClick) {
|
|
380
454
|
bridge.onSidecarLinkClick(THINGS_SIDECAR_ID);
|
|
381
455
|
await waitMs(80);
|
|
@@ -386,43 +460,7 @@
|
|
|
386
460
|
}
|
|
387
461
|
|
|
388
462
|
if (descriptor && bridge.store?.dispatch) {
|
|
389
|
-
|
|
390
|
-
if (typeof bridge.sidecarPool?.navigateIframe === 'function') {
|
|
391
|
-
bridge.sidecarPool.navigateIframe(descriptor.baseViewUrl, targetUrl);
|
|
392
|
-
} else if (typeof bridge.sidecarPool?.setIframeSrc === 'function') {
|
|
393
|
-
bridge.sidecarPool.setIframeSrc(descriptor.baseViewUrl, targetUrl);
|
|
394
|
-
}
|
|
395
|
-
const treeId = activeConvId ? { kind: 'cascadeId', cascadeId: activeConvId } : { kind: 'home' };
|
|
396
|
-
const st = bridge.store.getState();
|
|
397
|
-
const setContentType = st?.sidePanelV2 ? 'sidePanelV2/setContent' : 'sidePanel/setContent';
|
|
398
|
-
bridge.store.dispatch({
|
|
399
|
-
type: setContentType,
|
|
400
|
-
payload: {
|
|
401
|
-
treeId,
|
|
402
|
-
content: {
|
|
403
|
-
type: 'sidecarView',
|
|
404
|
-
sidecarView: {
|
|
405
|
-
sidecarId: descriptor.sidecarId,
|
|
406
|
-
path: descriptor.path,
|
|
407
|
-
url: descriptor.baseViewUrl,
|
|
408
|
-
title: descriptor.title,
|
|
409
|
-
},
|
|
410
|
-
},
|
|
411
|
-
tabId: descriptor.tabId,
|
|
412
|
-
},
|
|
413
|
-
});
|
|
414
|
-
bridge.store.dispatch({
|
|
415
|
-
type: 'sidePanel/setSidePanelOpen',
|
|
416
|
-
payload: { treeId, isOpen: true },
|
|
417
|
-
});
|
|
418
|
-
if (typeof bridge.router?.navigate === 'function') {
|
|
419
|
-
try {
|
|
420
|
-
bridge.router.navigate({
|
|
421
|
-
search: prev => ({ ...(prev || {}), tab: descriptor.tabId }),
|
|
422
|
-
replace: true,
|
|
423
|
-
});
|
|
424
|
-
} catch (_) {}
|
|
425
|
-
}
|
|
463
|
+
openViaReduxBridge(bridge, descriptor, activeConvId, { avoidReload: false });
|
|
426
464
|
await waitMs(80);
|
|
427
465
|
if (isThingsSidecarOpen(bridge.store, activeConvId)) {
|
|
428
466
|
syncSidecarConversation(activeConvId);
|
|
@@ -965,7 +1003,7 @@
|
|
|
965
1003
|
type: data.type === 'AGENT_THINGS_AUTH_REQUEST' ? 'AGENT_THINGS_AUTH_RESPONSE' : 'AGENT_THINGS_ACTION_RESULT',
|
|
966
1004
|
nonce: data.nonce,
|
|
967
1005
|
success: false,
|
|
968
|
-
error:
|
|
1006
|
+
error: '会话身份不匹配:禁止跨会话操作',
|
|
969
1007
|
});
|
|
970
1008
|
return;
|
|
971
1009
|
}
|
|
@@ -1028,14 +1066,21 @@
|
|
|
1028
1066
|
if (reply.snapshot) {
|
|
1029
1067
|
window.__codexSessionStatus?.receive?.(reply.snapshot);
|
|
1030
1068
|
}
|
|
1031
|
-
const targetRecord = reply.snapshot?.records?.[key];
|
|
1032
|
-
const
|
|
1069
|
+
const targetRecord = reply.snapshot?.records?.[key] || null;
|
|
1070
|
+
const targetAnalysis = reply.snapshot?.analysis?.[key] || null;
|
|
1071
|
+
const analysisTasks = Array.isArray(targetAnalysis?.ledger?.tasks) ? targetAnalysis.ledger.tasks : null;
|
|
1072
|
+
const analysisSummary = targetAnalysis?.ledger?.summary || '';
|
|
1073
|
+
const sessionData = {
|
|
1033
1074
|
conversationId: boundConvId,
|
|
1034
|
-
recordRevision: targetRecord
|
|
1035
|
-
progress: targetRecord.progress ?? null,
|
|
1036
|
-
state: targetRecord.state ?? null,
|
|
1037
|
-
note: targetRecord.note ?? '',
|
|
1038
|
-
|
|
1075
|
+
recordRevision: targetRecord?.revision ?? 0,
|
|
1076
|
+
progress: targetRecord ? (targetRecord.progress ?? null) : null,
|
|
1077
|
+
state: targetRecord ? (targetRecord.state ?? null) : 'unstarted',
|
|
1078
|
+
note: targetRecord ? (targetRecord.note ?? '') : '',
|
|
1079
|
+
source: targetRecord?.source || (targetAnalysis ? 'analysis' : 'manual'),
|
|
1080
|
+
updatedAt: targetRecord?.updatedAt || new Date().toISOString(),
|
|
1081
|
+
summary: (targetRecord?.note || analysisSummary) ?? '',
|
|
1082
|
+
...(analysisTasks ? { tasks: analysisTasks } : {}),
|
|
1083
|
+
};
|
|
1039
1084
|
sendReplyToCard(binding, targetPort, {
|
|
1040
1085
|
type: 'AGENT_THINGS_ACTION_RESULT',
|
|
1041
1086
|
nonce,
|
|
@@ -1052,7 +1097,7 @@
|
|
|
1052
1097
|
nonce,
|
|
1053
1098
|
action,
|
|
1054
1099
|
success: false,
|
|
1055
|
-
error: err.message ||
|
|
1100
|
+
error: err.message || '代理请求失败',
|
|
1056
1101
|
});
|
|
1057
1102
|
}
|
|
1058
1103
|
return;
|
|
@@ -1074,7 +1119,7 @@
|
|
|
1074
1119
|
action: 'locate',
|
|
1075
1120
|
success: Boolean(result?.located),
|
|
1076
1121
|
data: result,
|
|
1077
|
-
error: result?.located ? undefined : (result?.message ||
|
|
1122
|
+
error: result?.located ? undefined : (result?.message || '未找到来源消息'),
|
|
1078
1123
|
});
|
|
1079
1124
|
}
|
|
1080
1125
|
} catch (err) {
|
|
@@ -1084,7 +1129,7 @@
|
|
|
1084
1129
|
nonce,
|
|
1085
1130
|
action: 'locate',
|
|
1086
1131
|
success: false,
|
|
1087
|
-
error: err?.message ||
|
|
1132
|
+
error: err?.message || '定位来源失败',
|
|
1088
1133
|
});
|
|
1089
1134
|
}
|
|
1090
1135
|
}
|
|
@@ -1112,7 +1157,7 @@
|
|
|
1112
1157
|
nonce,
|
|
1113
1158
|
action: 'open-pane',
|
|
1114
1159
|
success: false,
|
|
1115
|
-
error: err?.message ||
|
|
1160
|
+
error: err?.message || '打开侧栏插件失败',
|
|
1116
1161
|
});
|
|
1117
1162
|
}
|
|
1118
1163
|
}
|
|
@@ -1293,14 +1338,21 @@
|
|
|
1293
1338
|
}
|
|
1294
1339
|
const rawContent = String(val);
|
|
1295
1340
|
const isCard = rawContent.includes('AGENT_THINGS_AUTH_REQUEST') || rawContent.includes('agentThingsCard');
|
|
1296
|
-
const
|
|
1341
|
+
const testId = iframe.getAttribute?.('data-testid');
|
|
1342
|
+
// 主对话气泡内的 <agent-embed> 会随右侧栏开启而整体位于 aux-pane-split 容器下,不能误按右侧独立工件 Tab 拦截
|
|
1343
|
+
const agentEmbedAncestor = iframe.closest?.('[data-testid="agent-embed"]');
|
|
1344
|
+
const auxSplitAncestor = iframe.closest?.('[data-testid="aux-pane-split"]');
|
|
1345
|
+
const hasDistinctEmbedAncestor = !!agentEmbedAncestor && agentEmbedAncestor !== auxSplitAncestor;
|
|
1346
|
+
const isInlineEmbed = testId === 'agent-embed-iframe'
|
|
1347
|
+
|| (hasDistinctEmbedAncestor && testId !== 'artifact-dynamic-ui-iframe');
|
|
1348
|
+
const isInAux = !isInlineEmbed && (!!auxSplitAncestor || testId === 'artifact-dynamic-ui-iframe');
|
|
1297
1349
|
let currentTab = '';
|
|
1298
1350
|
try { currentTab = new URL(window.location.href).searchParams.get('tab') || ''; } catch (_) {}
|
|
1299
1351
|
const isCardTab = currentTab.includes('things-card.html');
|
|
1300
1352
|
|
|
1301
1353
|
if (isCard && (isInAux ? isCardTab : true)) {
|
|
1302
1354
|
let tabConvId = null;
|
|
1303
|
-
if (isCardTab) {
|
|
1355
|
+
if (isInAux && isCardTab) {
|
|
1304
1356
|
try {
|
|
1305
1357
|
const match = currentTab.match(/[/\\\\]([^/\\\\]+)[/\\\\]things-card\.html/i) || currentTab.match(/([^/]+)\/things-card\.html/i);
|
|
1306
1358
|
if (match) tabConvId = match[1];
|
|
@@ -1338,7 +1390,7 @@
|
|
|
1338
1390
|
|
|
1339
1391
|
// 检查工件文档边界与恶意追加:
|
|
1340
1392
|
// 若为独立 HTML(非官方外层包装模板),必须严格等于 fullDoc;在 </html> 后追加任何脚本均视为非法篡改
|
|
1341
|
-
const isOfficialWrapper =
|
|
1393
|
+
const isOfficialWrapper = /^<!DOCTYPE html><html class="(?:dark|light)"><head><meta http-equiv="Content-Security-Policy"/.test(rawContent);
|
|
1342
1394
|
if (!isOfficialWrapper && rawContent.trim() !== fullDoc.trim()) {
|
|
1343
1395
|
return originalSet.call(iframe, val);
|
|
1344
1396
|
}
|
|
@@ -1349,7 +1401,7 @@
|
|
|
1349
1401
|
// Hold the document until verification completes; no card script runs while awaiting the service.
|
|
1350
1402
|
return (async () => {
|
|
1351
1403
|
const isCurrent = () => pendingCardLoads.get(iframe) === controller && !controller.signal.aborted
|
|
1352
|
-
&& iframe.isConnected && (isCardTab ? new URL(window.location.href).searchParams.get('tab') === currentTab : true);
|
|
1404
|
+
&& iframe.isConnected && (isInAux && isCardTab ? new URL(window.location.href).searchParams.get('tab') === currentTab : true);
|
|
1353
1405
|
let verifiedDigest;
|
|
1354
1406
|
try {
|
|
1355
1407
|
const response = await fetch(`${getServiceOrigin()}/session/verify-artifact`, {
|
|
@@ -1367,7 +1419,7 @@
|
|
|
1367
1419
|
} catch (_) {
|
|
1368
1420
|
// An explicit replacement/disposal must never reinstall an obsolete document.
|
|
1369
1421
|
if (pendingCardLoads.get(iframe) === controller && iframe.isConnected
|
|
1370
|
-
&& (isCardTab ? new URL(window.location.href).searchParams.get('tab') === currentTab : true)) originalSet.call(iframe, val);
|
|
1422
|
+
&& (isInAux && isCardTab ? new URL(window.location.href).searchParams.get('tab') === currentTab : true)) originalSet.call(iframe, val);
|
|
1371
1423
|
return;
|
|
1372
1424
|
} finally { clearTimeout(timeout); }
|
|
1373
1425
|
|
|
@@ -1387,12 +1439,46 @@
|
|
|
1387
1439
|
})) return originalSet.call(iframe, val);
|
|
1388
1440
|
|
|
1389
1441
|
// 以通过校验的工件内容 fullDoc 为唯一渲染输入,彻底剔除外部未经验证的追加字符与脚本
|
|
1390
|
-
|
|
1442
|
+
let hostAccent = '';
|
|
1443
|
+
let hostAccentFg = '';
|
|
1444
|
+
let hostMode = '';
|
|
1445
|
+
try {
|
|
1446
|
+
const rs = getComputedStyle(document.documentElement);
|
|
1447
|
+
hostAccent = rs.getPropertyValue('--primary').trim();
|
|
1448
|
+
hostAccentFg = rs.getPropertyValue('--primary-foreground').trim();
|
|
1449
|
+
if (document.body?.classList?.contains('theme-light')) hostMode = 'light';
|
|
1450
|
+
else if (document.body?.classList?.contains('theme-dark')) hostMode = 'dark';
|
|
1451
|
+
else {
|
|
1452
|
+
const bg = rs.getPropertyValue('--background').trim();
|
|
1453
|
+
if (bg) {
|
|
1454
|
+
if (bg.startsWith('#') && bg.length >= 7) {
|
|
1455
|
+
const r = parseInt(bg.slice(1, 3), 16), g = parseInt(bg.slice(3, 5), 16), b = parseInt(bg.slice(5, 7), 16);
|
|
1456
|
+
hostMode = (0.299 * r + 0.587 * g + 0.114 * b) > 130 ? 'light' : 'dark';
|
|
1457
|
+
} else if (bg.startsWith('rgb')) {
|
|
1458
|
+
const m = bg.match(/\d+/g);
|
|
1459
|
+
if (m && m.length >= 3) hostMode = (0.299 * m[0] + 0.587 * m[1] + 0.114 * m[2]) > 130 ? 'light' : 'dark';
|
|
1460
|
+
}
|
|
1461
|
+
}
|
|
1462
|
+
}
|
|
1463
|
+
} catch (_) {}
|
|
1464
|
+
const tokenScript = '<script>window.__agentThingsLoadToken = ' + JSON.stringify(dynamicToken) + ';'
|
|
1465
|
+
+ (hostAccent ? 'window.__agentThingsHostAccent = ' + JSON.stringify(hostAccent) + ';' : '')
|
|
1466
|
+
+ (hostAccentFg ? 'window.__agentThingsHostAccentFg = ' + JSON.stringify(hostAccentFg) + ';' : '')
|
|
1467
|
+
+ (hostMode ? 'window.__agentThingsHostTheme = ' + JSON.stringify(hostMode) + ';' : '')
|
|
1468
|
+
+ '</' + 'script>';
|
|
1391
1469
|
let modifiedHtml = fullDoc;
|
|
1392
1470
|
// 彻底清理之前注入过的所有 loadToken 脚本(兼容普通与转义关闭标签)
|
|
1393
1471
|
modifiedHtml = modifiedHtml
|
|
1394
1472
|
.replace(/<script[^>]*>window\.__agentThingsLoadToken[\s\S]*?<\/script>/gi, '')
|
|
1395
1473
|
.replace(/<script[^>]*>window\.__agentThingsLoadToken[\s\S]*?<\\\/script>/gi, '');
|
|
1474
|
+
if (hostMode) {
|
|
1475
|
+
modifiedHtml = modifiedHtml.replace(/<html\b([^>]*)>/i, (_, attrs) => {
|
|
1476
|
+
const cleaned = attrs
|
|
1477
|
+
.replace(/\s+data-color-mode\s*=\s*["'][^"']*["']/gi, '')
|
|
1478
|
+
.replace(/\s+style\s*=\s*["']color-scheme:[^"']*["']/gi, '');
|
|
1479
|
+
return '<html data-color-mode="' + hostMode + '" style="color-scheme:' + hostMode + '"' + cleaned + '>';
|
|
1480
|
+
});
|
|
1481
|
+
}
|
|
1396
1482
|
if (modifiedHtml.includes('<head>')) {
|
|
1397
1483
|
modifiedHtml = modifiedHtml.replace('<head>', '<head>' + tokenScript);
|
|
1398
1484
|
} else {
|
|
@@ -1512,6 +1598,40 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
1512
1598
|
return true;
|
|
1513
1599
|
};
|
|
1514
1600
|
const colors = presentation?.colors || { unstarted: '#9098a2', unfinished: '#c89b38', completed: '#548eea', pushed: '#a17be3' };
|
|
1601
|
+
let currentAccent = presentation?.accent?.normal || '#0169CC';
|
|
1602
|
+
let currentAccentPalette = presentation?.accent || { normal: '#0169CC', hover: '#005bb3', pressed: '#004f9c', onAccent: '#FFFFFF' };
|
|
1603
|
+
function resolveHostAccent(isDark = true) {
|
|
1604
|
+
const raw = (window.__agentThingsHostAccent || document.documentElement.style.getPropertyValue('--agent-things-accent') || (() => {
|
|
1605
|
+
try {
|
|
1606
|
+
const rootStyle = getComputedStyle(document.documentElement);
|
|
1607
|
+
for (const varName of ['--codex-base-accent', '--color-button-accent', '--primary', '--agent-things-accent']) {
|
|
1608
|
+
const candidate = rootStyle.getPropertyValue(varName).trim();
|
|
1609
|
+
if (candidate) return candidate;
|
|
1610
|
+
}
|
|
1611
|
+
} catch {}
|
|
1612
|
+
return '';
|
|
1613
|
+
})()).trim();
|
|
1614
|
+
const fallback = presentation?.accent?.normal || '#0169CC';
|
|
1615
|
+
return presentation?.resolveAccentPalette
|
|
1616
|
+
? presentation.resolveAccentPalette(raw || fallback, { isDark, fallback })
|
|
1617
|
+
: { normal: raw || fallback, hover: '#005bb3', pressed: '#004f9c', onAccent: '#FFFFFF' };
|
|
1618
|
+
}
|
|
1619
|
+
function syncAccent(node, isDark = true) {
|
|
1620
|
+
const palette = resolveHostAccent(isDark);
|
|
1621
|
+
currentAccentPalette = palette;
|
|
1622
|
+
currentAccent = palette.normal;
|
|
1623
|
+
if (!node?.style) return palette;
|
|
1624
|
+
const pairs = [
|
|
1625
|
+
['--accent', palette.normal],
|
|
1626
|
+
['--accent-hover', palette.hover],
|
|
1627
|
+
['--accent-pressed', palette.pressed],
|
|
1628
|
+
['--on-accent', palette.onAccent],
|
|
1629
|
+
];
|
|
1630
|
+
for (const [k, v] of pairs) {
|
|
1631
|
+
if (node.style.getPropertyValue(k) !== v) node.style.setProperty(k, v);
|
|
1632
|
+
}
|
|
1633
|
+
return palette;
|
|
1634
|
+
}
|
|
1515
1635
|
let snapshot = { revision: 0, records: {} };
|
|
1516
1636
|
const mounted = new Map();
|
|
1517
1637
|
const pending = new Map();
|
|
@@ -1608,7 +1728,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
1608
1728
|
if (loading) {
|
|
1609
1729
|
svg.setAttribute('class', 'loading');
|
|
1610
1730
|
const circle = document.createElementNS(svg.namespaceURI, 'circle');
|
|
1611
|
-
for (const [name, value] of Object.entries({ cx: 12, cy: 12, r: 10, fill: 'none', stroke: '#0169cc', 'stroke-width': 1.6, 'stroke-dasharray': '42 63', 'stroke-linecap': 'round' })) circle.setAttribute(name, value);
|
|
1731
|
+
for (const [name, value] of Object.entries({ cx: 12, cy: 12, r: 10, fill: 'none', stroke: currentAccent || '#0169cc', 'stroke-width': 1.6, 'stroke-dasharray': '42 63', 'stroke-linecap': 'round' })) circle.setAttribute(name, value);
|
|
1612
1732
|
svg.append(circle); button.append(svg); return;
|
|
1613
1733
|
}
|
|
1614
1734
|
const color = record ? colors[record.state] : '#858991';
|
|
@@ -1692,7 +1812,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
1692
1812
|
host.setAttribute('data-codex-session-status', '');
|
|
1693
1813
|
host.style.cssText = 'display:flex;width:24px;height:28px;flex:none;align-items:center;justify-content:center';
|
|
1694
1814
|
const shadow = host.attachShadow({ mode: 'open' });
|
|
1695
|
-
element('style', `:host{opacity:0}:host([data-visible]),:host(:focus-within){opacity:1}@keyframes status-spin{to{transform:rotate(360deg)}}svg.loading{animation:status-spin .85s linear infinite;transform-origin:center}button{all:unset;box-sizing:border-box;width:28px;height:28px;display:grid;place-items:center;cursor:pointer;border-radius:7px}button:hover{background:color-mix(in srgb,currentColor 8%,transparent)}button:focus-visible{outline:2px solid
|
|
1815
|
+
element('style', `:host{opacity:0}:host([data-visible]),:host(:focus-within){opacity:1}@keyframes status-spin{to{transform:rotate(360deg)}}svg.loading{animation:status-spin .85s linear infinite;transform-origin:center}button{all:unset;box-sizing:border-box;width:28px;height:28px;display:grid;place-items:center;cursor:pointer;border-radius:7px;transition:transform 160ms cubic-bezier(.23,1,.32,1),background-color 150ms cubic-bezier(.23,1,.32,1)}button:hover{background:color-mix(in srgb,currentColor 8%,transparent)}button:active{transform:scale(.94)}button:focus-visible{outline:2px solid var(--accent,#0169cc);outline-offset:1px}svg{display:block;pointer-events:none}`, shadow);
|
|
1696
1816
|
const button = element('button', null, shadow);
|
|
1697
1817
|
button.type = 'button'; button.setAttribute('aria-haspopup', 'dialog'); button.setAttribute('aria-expanded', 'false');
|
|
1698
1818
|
return { host, button, original };
|
|
@@ -1767,10 +1887,26 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
1767
1887
|
return r.width > 0 && r.height > 0 && r.bottom > 0 && r.top < innerHeight;
|
|
1768
1888
|
}
|
|
1769
1889
|
|
|
1890
|
+
function detectPanelColorMode(entry) {
|
|
1891
|
+
if (embedded) return embedded.theme && ['light', 'dark'].includes(embedded.theme) ? embedded.theme : (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
1892
|
+
for (let node = entry?.row; node; node = node.parentElement) {
|
|
1893
|
+
const rgba = getComputedStyle(node).backgroundColor.match(/[\d.]+/g)?.map(Number);
|
|
1894
|
+
if (!rgba || (rgba[3] ?? 1) < .95) continue;
|
|
1895
|
+
return rgba[0] * .2126 + rgba[1] * .7152 + rgba[2] * .0722 < 150 ? 'dark' : 'light';
|
|
1896
|
+
}
|
|
1897
|
+
const docTheme = typeof document !== 'undefined'
|
|
1898
|
+
? (document.documentElement?.getAttribute?.('data-theme') || document.documentElement?.dataset?.mode || (document.body?.classList?.contains('theme-light') ? 'light' : document.body?.classList?.contains('theme-dark') ? 'dark' : ''))
|
|
1899
|
+
: '';
|
|
1900
|
+
if (docTheme === 'light' || docTheme === 'dark') return docTheme;
|
|
1901
|
+
return matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
1902
|
+
}
|
|
1903
|
+
|
|
1770
1904
|
function positionPanel() {
|
|
1771
1905
|
if (!panel) return;
|
|
1772
1906
|
if (embedded) {
|
|
1773
|
-
|
|
1907
|
+
const mode = embedded.theme || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
1908
|
+
if (panel.root.getAttribute('data-color-mode') !== mode) panel.root.setAttribute('data-color-mode', mode);
|
|
1909
|
+
if (typeof syncAccent === 'function') syncAccent(panel.root, mode === 'dark');
|
|
1774
1910
|
return;
|
|
1775
1911
|
}
|
|
1776
1912
|
// Foreground colors change when the host window becomes inactive.
|
|
@@ -1784,6 +1920,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
1784
1920
|
}
|
|
1785
1921
|
mode ||= panel.root.getAttribute('data-color-mode') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
1786
1922
|
if (panel.root.getAttribute('data-color-mode') !== mode) panel.root.setAttribute('data-color-mode', mode);
|
|
1923
|
+
if (typeof syncAccent === 'function') syncAccent(panel.root, mode === 'dark');
|
|
1787
1924
|
const anchor = panel.entry.host.getBoundingClientRect();
|
|
1788
1925
|
const rect = panel.shell.getBoundingClientRect();
|
|
1789
1926
|
const left = Math.max(8, Math.min(anchor.right + 10, innerWidth - rect.width - 8));
|
|
@@ -1824,7 +1961,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
1824
1961
|
target.statusDot.style.borderColor = record ? colors[record.state] : colors.unstarted;
|
|
1825
1962
|
target.timestamp.textContent = record ? (ui?.formatDate ? ui.formatDate(record.updatedAt) : new Date(record.updatedAt).toLocaleString(activeLang === 'en' ? 'en-US' : 'zh-CN', { month: 'numeric', day: 'numeric', hour: '2-digit', minute: '2-digit' })) : '';
|
|
1826
1963
|
target.scoreNumber.textContent = record?.progress ?? '—';
|
|
1827
|
-
target.scoreUnit.hidden =
|
|
1964
|
+
target.scoreUnit.hidden = false;
|
|
1828
1965
|
target.meter.style.setProperty('--fill', `${record?.progress ?? 0}%`);
|
|
1829
1966
|
target.meter.style.setProperty('--mark', record ? colors[record.state] : colors.unstarted);
|
|
1830
1967
|
target.sourceLabel.textContent = record ? (record.source === 'analysis' ? S('sourceAuto') : S('sourceManual')) : '';
|
|
@@ -1926,37 +2063,47 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
1926
2063
|
|
|
1927
2064
|
function openPanel(entry) {
|
|
1928
2065
|
if (panel) return;
|
|
1929
|
-
const root =
|
|
2066
|
+
const root = document.createElement('div');
|
|
2067
|
+
const initialMode = detectPanelColorMode(entry);
|
|
1930
2068
|
root.setAttribute('data-codex-session-status-panel', '');
|
|
2069
|
+
root.setAttribute('data-color-mode', initialMode);
|
|
2070
|
+
syncAccent(root, initialMode === 'dark');
|
|
1931
2071
|
if (!embedded) root.style.cssText = 'position:fixed;inset:0;pointer-events:none;z-index:2147483646';
|
|
1932
2072
|
const shadow = root.attachShadow({ mode: 'open' });
|
|
1933
2073
|
element('style', `
|
|
1934
|
-
:host{--accent:${
|
|
2074
|
+
:host{--accent:${currentAccentPalette.normal || '#0169cc'};--accent-hover:${currentAccentPalette.hover || '#005bb3'};--accent-pressed:${currentAccentPalette.pressed || '#004f9c'};--on-accent:${currentAccentPalette.onAccent || '#ffffff'};--ease-out:cubic-bezier(0.23,1,0.32,1);--ease-in-out:cubic-bezier(0.77,0,0.175,1);--ink:#e6edf3;--secondary:#a0a6ad;--muted:#828c96;--note:#bbc3ca;--track:#ffffff12;--line:#ffffff14;--input-border:#ffffff18;--input-bg:#ffffff03;--hover:#ffffff09;--selected:#ffffff10;--source-bg:#ffffff0a;--number-line:#ffffff25;--thumb:#ffffff;--danger:#ef7777;--error:#f7ad86;font:13px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:var(--ink);color-scheme:dark}
|
|
1935
2075
|
*{box-sizing:border-box;scrollbar-width:none;-ms-overflow-style:none}*::-webkit-scrollbar{display:none;width:0;height:0}button,input,textarea{font:inherit}button{cursor:pointer}button,input,textarea{color:inherit}[hidden]{display:none!important}
|
|
1936
2076
|
.shell{position:fixed;pointer-events:auto;width:${presentation?.layout.panelWidth || 340}px;max-width:calc(100vw - 16px);max-height:calc(100vh - 16px);display:flex;flex-direction:column;overflow:hidden;--panel-bg:#0e1318;background:var(--panel-bg);border:1px solid #ffffff1c;border-radius:20px;box-shadow:0 16px 54px #0005;padding:22px 20px 14px}
|
|
1937
2077
|
.shell:hover{--panel-bg:#1f242a}.title-heading{display:flex;flex:none;align-items:flex-start;gap:10px;margin-right:24px;border-radius:5px;outline-offset:4px}
|
|
1938
2078
|
h2.title{font-size:24px;font-weight:650;line-height:1.3;letter-spacing:-.5px;margin:0;min-width:0;overflow-wrap:anywhere;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden}
|
|
1939
|
-
.title-progress{display:flex;flex:none;width:32px;height:32px;margin-top:1px}.title-progress svg{width:32px;height:32px}.title-progress text{opacity:0}.title-progress text.progress-unknown{opacity:1}.title-heading:hover .progress-pie,.title-heading:focus-visible .progress-pie{opacity:0}.title-heading:hover text,.title-heading:focus-visible text{opacity:1}
|
|
1940
|
-
.close{position:absolute;right:12px;top:7px;border:0;background:none;color:var(--secondary);font-size:0;width:28px;height:28px;padding:0}.close::before,.close::after{content:"";position:absolute;left:7px;top:13px;width:14px;height:1px;background:currentColor;transform:rotate(45deg)}.close::after{transform:rotate(-45deg)}
|
|
1941
|
-
.open-pane{position:absolute;right:44px;top:7px;border:0;background:none;color:var(--secondary);width:28px;height:28px;padding:0;border-radius:6px}.open-pane:hover{color:var(--ink);background:var(--hover)}.open-pane::before{content:"";position:absolute;left:7px;top:8px;width:14px;height:12px;border:1.3px solid currentColor;border-radius:3px;box-sizing:border-box}.open-pane::after{content:"";position:absolute;left:16px;top:8px;width:1.3px;height:12px;background:currentColor}.shell.has-open-pane .title-heading{margin-right:56px}.open-pane-tip{position:absolute;right:0;top:calc(100% + 6px);padding:5px 8px;border-radius:6px;background:var(--panel-bg);color:var(--ink);border:1px solid var(--line);box-shadow:0 4px 14px #0003;font-size:11px;line-height:1.4;white-space:nowrap;pointer-events:none;opacity:0;visibility:hidden;transition:opacity
|
|
1942
|
-
.panel-body{overflow:auto;min-height:0;margin-top:23px;scrollbar-width:none;-ms-overflow-style:none}.panel-body::-webkit-scrollbar{display:none;width:0;height:0}.view{padding-bottom:4px}.status-line{display:flex;align-items:center;justify-content:space-between;gap:16px}.status-block{transform:translateY(2px);min-width:0;flex:1}.status-name{display:flex;align-items:center;gap:7px;line-height:18px;min-width:0}.status-name>span:last-child,.timestamp{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.state-dot{width:10px;height:10px;border:1.5px solid;border-radius:50%;flex:none}.timestamp{font-size:11px;line-height:16px;color:var(--secondary);margin-top:2px;margin-left:17px}.score{display:flex;align-items:baseline;line-height:1;font-variant-numeric:tabular-nums;flex:none}.score-number{font-size:39px;font-weight:550;letter-spacing:-1px}.score-unit{font-size:15px;color:var(--secondary);margin-left:3px}
|
|
1943
|
-
.meter{height:4px;background:var(--track);border-radius:
|
|
1944
|
-
.actions{display:flex;align-items:center;gap:14px;margin:18px 0 22px}.primary{border:0;background:var(--accent);color
|
|
1945
|
-
.task-row{position:relative;display:flex;gap:9px;align-items:flex-start;padding:9px 0;overflow:hidden;isolation:isolate}.task-dot{width:12px;height:12px;border:1.3px solid #c89b38;border-radius:50%;margin-top:4px;flex:none}.task-row[data-status=done] .task-dot{border-color:#548eea;background:#548eea22}.task-content{min-width:0;flex:1}.task-title{width:100%;overflow:hidden;mask-image:linear-gradient(to right,#000 calc(100% - 12px),transparent)}.task-track{display:flex;width:max-content;transform:translateX(0);transition:transform .22s ease-out}.task-copy{white-space:nowrap;flex:none}.task-row:is(:hover,:focus-within) .task-title.overflowing .task-track{transform:translateX(calc(-1 * var(--travel)));transition-duration:var(--duration,4s);transition-timing-function:linear;will-change:transform}.task-meta{font-size:10px;color:var(--secondary);margin-top:3px}.task-source{position:absolute;right:0;top:0;bottom:0;display:flex;align-items:center;justify-content:flex-end;padding-left:28px;background:linear-gradient(to right,transparent,var(--panel-bg) 25px);opacity:0;pointer-events:none;transform:translateX(4px);transition:opacity
|
|
1946
|
-
@media(prefers-reduced-motion:reduce){.task-row .task-title.overflowing .task-track{transform:none;transition:none}.task-title{overflow:auto}}
|
|
2079
|
+
.title-progress{display:flex;flex:none;width:32px;height:32px;margin-top:1px}.title-progress svg{width:32px;height:32px}.title-progress .progress-pie,.title-progress text{transition:opacity 160ms var(--ease-out),transform 160ms var(--ease-out);transform-origin:12px 12px}.title-progress text{opacity:0;transform:scale(.94)}.title-progress text.progress-unknown{opacity:1;transform:none}.title-heading:hover .progress-pie,.title-heading:focus-visible .progress-pie{opacity:0;transform:scale(.94)}.title-heading:hover text,.title-heading:focus-visible text{opacity:1;transform:scale(1)}
|
|
2080
|
+
.close{position:absolute;right:12px;top:7px;border:0;background:none;color:var(--secondary);font-size:0;width:28px;height:28px;padding:0;border-radius:6px;transition:transform 160ms var(--ease-out),color 150ms var(--ease-out),background-color 150ms var(--ease-out)}.close:hover{color:var(--ink);background:var(--hover)}.close:active:not(:disabled){transform:scale(.94)}.close::before,.close::after{content:"";position:absolute;left:7px;top:13px;width:14px;height:1px;background:currentColor;transform:rotate(45deg)}.close::after{transform:rotate(-45deg)}
|
|
2081
|
+
.open-pane{position:absolute;right:44px;top:7px;border:0;background:none;color:var(--secondary);width:28px;height:28px;padding:0;border-radius:6px;transition:transform 160ms var(--ease-out),color 150ms var(--ease-out),background-color 150ms var(--ease-out)}.open-pane:hover{color:var(--ink);background:var(--hover)}.open-pane:active:not(:disabled){transform:scale(.94)}.open-pane::before{content:"";position:absolute;left:7px;top:8px;width:14px;height:12px;border:1.3px solid currentColor;border-radius:3px;box-sizing:border-box}.open-pane::after{content:"";position:absolute;left:16px;top:8px;width:1.3px;height:12px;background:currentColor}.shell.has-open-pane .title-heading{margin-right:56px}.open-pane-tip{position:absolute;right:0;top:calc(100% + 6px);padding:5px 8px;border-radius:6px;background:var(--panel-bg);color:var(--ink);border:1px solid var(--line);box-shadow:0 4px 14px #0003;font-size:11px;line-height:1.4;white-space:nowrap;pointer-events:none;transform-origin:top right;opacity:0;transform:scale(.96) translateY(-2px);visibility:hidden;transition:opacity 150ms var(--ease-out),transform 150ms var(--ease-out),visibility 0s linear 150ms;z-index:2}.open-pane:is(:hover,:focus-visible) .open-pane-tip{opacity:1;transform:scale(1) translateY(0);visibility:visible;transition:opacity 150ms var(--ease-out) 160ms,transform 150ms var(--ease-out) 160ms,visibility 0s linear 160ms}
|
|
2082
|
+
.panel-body{overflow:auto;min-height:0;margin-top:23px;scrollbar-width:none;-ms-overflow-style:none}.panel-body::-webkit-scrollbar{display:none;width:0;height:0}.view{padding-bottom:4px}.status-line{display:flex;align-items:center;justify-content:space-between;gap:16px}.status-block{transform:translateY(2px);min-width:0;flex:1}.status-name{display:flex;align-items:center;gap:7px;line-height:18px;min-width:0}.status-name>span:last-child,.timestamp{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.state-dot{width:10px;height:10px;border:1.5px solid;border-radius:50%;flex:none;transition:border-color 180ms var(--ease-out)}.timestamp{font-size:11px;line-height:16px;color:var(--secondary);margin-top:2px;margin-left:17px}.score{display:flex;align-items:baseline;line-height:1;font-variant-numeric:tabular-nums;flex:none}.score-number{font-size:39px;font-weight:550;letter-spacing:-1px}.score-unit{font-size:15px;color:var(--secondary);margin-left:3px}
|
|
2083
|
+
.meter{height:4px;background:var(--track);border-radius:999px;margin:14px 0 10px;overflow:hidden}.meter::after{content:"";display:block;height:100%;width:var(--fill);background:var(--mark);border-radius:inherit;transition:width 220ms var(--ease-out),background-color 180ms var(--ease-out)}.totals-row{display:flex;justify-content:space-between;align-items:center;gap:8px;color:var(--secondary)}.totals,.source-label{font-size:11px;font-weight:400;line-height:16px}.source-label{margin-left:auto;text-align:right;white-space:nowrap}.summary-block{position:relative;margin:16px 0;outline:none}.overview-summary{font-size:13px;line-height:1.65;color:var(--note);display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere}.summary-expand{position:absolute;right:0;bottom:0;border:0;background:linear-gradient(to right,transparent,var(--panel-bg) 18px);padding:0 0 0 22px;color:var(--secondary);font-size:12px;line-height:21.45px;white-space:nowrap;transition:transform 160ms var(--ease-out),color 150ms var(--ease-out)}.summary-expand:hover{color:inherit}.summary-expand:active:not(:disabled){transform:scale(.97)}.summary-block.expanded .overview-summary{display:block;-webkit-line-clamp:unset}.summary-block.expanded .summary-expand{position:static;display:block;margin-left:auto;padding-left:0;background:none}
|
|
2084
|
+
.actions{display:flex;align-items:center;gap:14px;margin:18px 0 22px}.primary{border:0;background:var(--accent);color:var(--on-accent,#fff);border-radius:9px;padding:9px 14px;font-weight:550;min-height:36px;white-space:nowrap;box-shadow:inset 0 1px 0 rgba(255,255,255,.18),0 1px 2px rgba(0,0,0,.14);transition:transform 160ms var(--ease-out),background-color 160ms var(--ease-out),opacity 160ms var(--ease-out)}.primary:hover:not(:disabled){background:var(--accent-hover);color:var(--on-accent,#fff)}.primary:active:not(:disabled){background:var(--accent-pressed,var(--accent-hover));transform:scale(.97)}.text-button,.clear,.back{border:0;background:none;padding:0;color:var(--secondary);font-size:12px;white-space:nowrap;transition:transform 160ms var(--ease-out),color 150ms var(--ease-out)}.text-button:hover,.back:hover{color:inherit}.text-button:active:not(:disabled),.back:active:not(:disabled),.clear:active:not(:disabled){transform:scale(.97)}.actions .clear{margin-left:auto;font-size:11px;color:var(--muted);white-space:nowrap}.actions .clear:hover{color:var(--danger)}.actions .clear{position:relative}.clear-tooltip{position:absolute;right:0;bottom:calc(100% + 8px);padding:6px 9px;border-radius:6px;background:var(--panel-bg);color:var(--secondary);border:1px solid var(--line);box-shadow:0 6px 18px rgba(0,0,0,.22);font-size:11px;white-space:nowrap;pointer-events:none;transform-origin:bottom right;opacity:0;transform:scale(.96) translateY(3px);visibility:hidden;transition:opacity 150ms var(--ease-out),transform 150ms var(--ease-out),visibility 0s linear 150ms;z-index:2}.clear:is(:hover,:focus-visible) .clear-tooltip{opacity:1;transform:scale(1) translateY(0);visibility:visible;transition:opacity 150ms var(--ease-out) 160ms,transform 150ms var(--ease-out) 160ms,visibility 0s linear 160ms}.section-head{border-top:1px solid var(--line);padding-top:16px;display:flex;align-items:center;justify-content:space-between;margin-bottom:5px}.section-head h3{font-size:12px;font-weight:550;margin:0}.remaining-toggle{border:0;background:none;padding:0;transition:transform 160ms var(--ease-out),color 150ms var(--ease-out)}.remaining-toggle:active:not(:disabled){transform:scale(.97)}.row-detail{font-size:12px;font-weight:400;line-height:18px;color:var(--secondary);white-space:nowrap}
|
|
2085
|
+
.task-row{position:relative;display:flex;gap:9px;align-items:flex-start;padding:9px 0;overflow:hidden;isolation:isolate}.task-dot{width:12px;height:12px;border:1.3px solid #c89b38;border-radius:50%;margin-top:4px;flex:none;transition:transform 180ms var(--ease-out),border-color 180ms var(--ease-out),background-color 180ms var(--ease-out)}.task-row[data-status=done] .task-dot{border-color:#548eea;background:#548eea22}.task-content{min-width:0;flex:1}.task-title{width:100%;overflow:hidden;mask-image:linear-gradient(to right,#000 calc(100% - 12px),transparent)}.task-track{display:flex;width:max-content;transform:translateX(0);transition:transform .22s ease-out}.task-copy{white-space:nowrap;flex:none}.task-row:is(:hover,:focus-within) .task-title.overflowing .task-track{transform:translateX(calc(-1 * var(--travel)));transition-duration:var(--duration,4s);transition-timing-function:linear;will-change:transform}.task-meta{font-size:10px;color:var(--secondary);margin-top:3px}.task-source{position:absolute;right:0;top:0;bottom:0;display:flex;align-items:center;justify-content:flex-end;padding-left:28px;background:linear-gradient(to right,transparent,var(--panel-bg) 25px);opacity:0;pointer-events:none;transform:translateX(4px);transition:opacity 150ms var(--ease-out),transform 150ms var(--ease-out)}.task-source button{border:0;border-radius:6px;background:var(--source-bg);color:inherit;padding:5px 7px;font-size:11px;white-space:nowrap;transition:transform 160ms var(--ease-out),background-color 150ms var(--ease-out)}.task-source button:active:not(:disabled){transform:scale(.96)}.task-row:hover .task-source,.task-row:focus-within .task-source{opacity:1;pointer-events:auto;transform:none}.task-row:focus-visible{outline:1px solid var(--accent);outline-offset:1px}
|
|
2086
|
+
@media(prefers-reduced-motion:reduce){.task-row .task-title.overflowing .task-track{transform:none;transition:none}.task-title{overflow:auto}.primary:active:not(:disabled),.text-button:active:not(:disabled),.back:active:not(:disabled),.clear:active:not(:disabled),.choice:active:not(:disabled),.quiet-row:active:not(:disabled),.range-input:hover::-webkit-slider-thumb,.range-input:active::-webkit-slider-thumb{transform:none}}
|
|
1947
2087
|
@media(hover:none){.task-source{opacity:1;pointer-events:auto;transform:none}}
|
|
1948
|
-
.empty{font-size:12px;color:var(--secondary);padding:13px 0}.quiet-row{border:0;border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;width:100%;background:none;color:inherit;padding:15px 0;text-align:left;font-size:12px}.quiet-row span:last-child{color:var(--secondary)}.overview-bottom{margin-top:13px}.view-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.view-heading h3{font-size:14px;font-weight:550;margin:0}.choice{display:flex;align-items:center;gap:10px;width:100%;padding:8px 9px;border:0;border-radius:7px;background:none;color:inherit;text-align:left}.choice:hover{background:var(--hover)}.choice[aria-pressed=true]{background:var(--selected)}.dot{width:12px;height:12px;border:1.6px solid var(--mark);border-radius:50%;flex:none}.choice[aria-pressed=true] .dot{background:var(--mark);box-shadow:inset 0 0 0 2px var(--panel-bg)}
|
|
1949
|
-
.progress-section{margin-top:20px}.progress-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.label{font-size:11px;color:var(--secondary)}.number-wrap{display:flex;align-items:center;gap:5px;color:var(--secondary)}.progress-number{appearance:textfield;color:var(--ink);width:65px;padding:2px 3px 4px;background:none;border:0;border-bottom:1px solid var(--number-line);font-size:27px;font-weight:550;text-align:right;font-variant-numeric:tabular-nums}.progress-number::-webkit-inner-spin-button{appearance:none}.range{position:relative;height:
|
|
2088
|
+
.empty{font-size:12px;color:var(--secondary);padding:13px 0}.quiet-row{border:0;border-top:1px solid var(--line);display:flex;justify-content:space-between;align-items:center;width:100%;background:none;color:inherit;padding:15px 0;text-align:left;font-size:12px;transition:transform 160ms var(--ease-out),background-color 150ms var(--ease-out)}.quiet-row:active:not(:disabled){transform:scale(.988)}.quiet-row span:last-child{color:var(--secondary);transition:transform 160ms var(--ease-out),color 150ms var(--ease-out)}.quiet-row:hover span:last-child{transform:translateX(2px)}.overview-bottom{margin-top:13px}.view-heading{display:flex;justify-content:space-between;align-items:center;margin-bottom:15px}.view-heading h3{font-size:14px;font-weight:550;margin:0}.choice{display:flex;align-items:center;gap:10px;width:100%;padding:8px 9px;border:0;border-radius:7px;background:none;color:inherit;text-align:left;transition:transform 160ms var(--ease-out),background-color 150ms var(--ease-out)}.choice:hover{background:var(--hover)}.choice:active:not(:disabled){transform:scale(.988)}.choice[aria-pressed=true]{background:var(--selected)}.dot{width:12px;height:12px;border:1.6px solid var(--mark);border-radius:50%;flex:none;transition:background-color 180ms var(--ease-out),border-color 180ms var(--ease-out)}.choice[aria-pressed=true] .dot{background:var(--mark);box-shadow:inset 0 0 0 2px var(--panel-bg)}
|
|
2089
|
+
.progress-section{margin-top:20px}.progress-head{display:flex;justify-content:space-between;align-items:center;margin-bottom:12px}.label{font-size:11px;color:var(--secondary)}.number-wrap{display:flex;align-items:center;gap:5px;color:var(--secondary)}.progress-number{appearance:textfield;color:var(--ink);width:65px;padding:2px 3px 4px;background:none;border:0;border-bottom:1px solid var(--number-line);font-size:27px;font-weight:550;text-align:right;font-variant-numeric:tabular-nums}.progress-number::-webkit-inner-spin-button{appearance:none}.range{position:relative;height:48px;margin-top:2px;--mark:#c89b38}.range-track{position:absolute;left:7px;right:7px;top:9px;height:6px;border-radius:999px;background:linear-gradient(to right,var(--range-fill,var(--mark)) var(--fill),var(--track) var(--fill));pointer-events:none;transition:background-color 160ms var(--ease-out)}.range.is-dragging .range-track{transition:none}.range-input{position:relative;appearance:none;width:100%;height:24px;background:transparent;margin:0;display:block;padding:0;cursor:pointer}.range-input::-webkit-slider-runnable-track{height:6px;background:transparent}.range-input::-webkit-slider-thumb{appearance:none;width:16px;height:16px;margin-top:-5px;background:var(--thumb);border:.5px solid rgba(0,0,0,.14);border-radius:50%;box-shadow:0 1px 3px rgba(0,0,0,.28),0 0 0 .5px rgba(0,0,0,.08);transition:transform 150ms var(--ease-out),box-shadow 150ms var(--ease-out)}.range-input:hover::-webkit-slider-thumb{transform:scale(1.06)}.range-input:active::-webkit-slider-thumb{transform:scale(1.1);box-shadow:0 2px 6px rgba(0,0,0,.34),0 0 0 1px rgba(0,0,0,.12)}.range-nodes{position:absolute;left:7px;right:7px;top:0;pointer-events:none}.range-node{position:absolute;left:var(--at);top:8px;width:0;font-size:10px;font-weight:500;opacity:.78;color:var(--secondary);font-variant-numeric:tabular-nums}.range-node::before{display:none}.range-node-label{position:absolute;top:20px;left:0;transform:translateX(-50%)}.range-node:first-child .range-node-label{transform:none}.range-node:last-child .range-node-label{transform:translateX(-100%)}.unknown-row{display:flex;justify-content:flex-end;margin:2px 0 18px}.unknown{font-size:11px}
|
|
1950
2090
|
.note-label{display:block;font-size:11px;color:var(--secondary);margin-bottom:8px}textarea{display:block;width:100%;resize:vertical;min-height:66px;max-height:140px;background:var(--input-bg);color:inherit;border:1px solid var(--input-border);border-radius:8px;padding:9px;line-height:1.6;font-size:12px;scrollbar-width:none;-ms-overflow-style:none}textarea::-webkit-scrollbar{display:none;width:0;height:0}textarea::placeholder{color:var(--muted)}.edit-actions{display:flex;justify-content:flex-end;gap:18px;align-items:center;padding:21px 0 16px}.git{font-size:11px;color:var(--secondary)}.analysis-message{font-size:11px;color:var(--secondary);margin:0 0 13px}.analysis-message:empty,.error:empty,.git:empty{display:none}.error{flex:none;font-size:12px;color:var(--error);padding-top:10px;white-space:pre-wrap}button:disabled,input:disabled,textarea:disabled{opacity:.55;cursor:wait}button:focus-visible,input:focus-visible,textarea:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
|
|
1951
2091
|
.shell textarea:focus-visible{outline:none}
|
|
1952
2092
|
.app-update{margin-top:3px;padding:10px 11px;background:var(--hover);border:1px solid var(--line);border-radius:10px}.app-update-row{display:flex;align-items:center;justify-content:space-between;gap:10px}.app-update-label{font-size:12px;line-height:18px;color:var(--ink);min-width:0;overflow-wrap:anywhere}.app-update-button{flex:none;padding:5px 10px;min-height:28px;border-radius:7px;font-size:11px}.app-update-detail{margin-top:7px;font-size:11px;line-height:1.6;color:var(--secondary);white-space:pre-wrap;overflow-wrap:anywhere;user-select:text}.app-update[data-failed=true] .app-update-detail{color:var(--error)}
|
|
1953
|
-
:host([data-color-mode=light]){--ink:#22272e;--secondary:#576374;--muted:#667383;--note:#46515f;--track:#
|
|
2093
|
+
:host([data-color-mode=light]){--ink:#22272e;--secondary:#576374;--muted:#667383;--note:#46515f;--track:#dfe4ea;--line:#dfe4ea;--input-border:#c7d0da;--input-bg:#f7f9fb;--hover:#f0f3f6;--selected:#e9edf2;--source-bg:#e9eef4;--number-line:#b6c1ce;--thumb:#ffffff;--danger:#bf2f3a;--error:#b13a2d;color:var(--ink);color-scheme:light}
|
|
1954
2094
|
:host([data-color-mode=light]) .shell{--panel-bg:#fff;border-color:#dfe4ea;box-shadow:0 14px 45px #26344520}
|
|
1955
2095
|
:host([data-color-mode=light]) .shell:hover{--panel-bg:#f5f6f7}
|
|
1956
2096
|
:host([data-color-mode=light]) .range{--range-fill:color-mix(in srgb,var(--mark) 85%,#000)}
|
|
1957
2097
|
:host([data-color-mode=light]) .meter::after{background:color-mix(in srgb,var(--mark) 85%,#000)}
|
|
2098
|
+
@media(prefers-color-scheme:light){
|
|
2099
|
+
:host(:not([data-color-mode=dark])){--ink:#22272e;--secondary:#576374;--muted:#667383;--note:#46515f;--track:#dfe4ea;--line:#dfe4ea;--input-border:#c7d0da;--input-bg:#f7f9fb;--hover:#f0f3f6;--selected:#e9edf2;--source-bg:#e9eef4;--number-line:#b6c1ce;--thumb:#ffffff;--danger:#bf2f3a;--error:#b13a2d;color:var(--ink);color-scheme:light}
|
|
2100
|
+
:host(:not([data-color-mode=dark])) .shell{--panel-bg:#fff;border-color:#dfe4ea;box-shadow:0 14px 45px #26344520}
|
|
2101
|
+
:host(:not([data-color-mode=dark])) .shell:hover{--panel-bg:#f5f6f7}
|
|
2102
|
+
:host(:not([data-color-mode=dark])) .range{--range-fill:color-mix(in srgb,var(--mark) 85%,#000)}
|
|
2103
|
+
:host(:not([data-color-mode=dark])) .meter::after{background:color-mix(in srgb,var(--mark) 85%,#000)}
|
|
2104
|
+
}
|
|
1958
2105
|
`, shadow);
|
|
1959
|
-
if (embedded) element('style', '.shell
|
|
2106
|
+
if (embedded) element('style', '.shell,:host([data-color-mode=light]) .shell,:host(:not([data-color-mode=dark])) .shell{box-shadow:none}.shell{position:relative;max-width:100%;max-height:none}.panel-body{overflow:visible}', shadow);
|
|
1960
2107
|
const shell = element('div', null, shadow, 'shell');
|
|
1961
2108
|
shell.setAttribute('role', embedded ? 'region' : 'dialog'); shell.setAttribute('aria-label', S('panelAriaPattern', { title: entry.title }));
|
|
1962
2109
|
const close = embedded ? null : element('button', '×', shell, 'close'); close?.setAttribute('aria-label', S('close'));
|
|
@@ -2232,7 +2379,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
2232
2379
|
while (Date.now() < deadline) {
|
|
2233
2380
|
if (row.getAttribute('data-app-action-sidebar-thread-selected') === 'true') {
|
|
2234
2381
|
const message = [...document.querySelectorAll('[data-content-search-unit-key]')].find(node => node.getAttribute('data-content-search-unit-key') === `${source.turnId}:${source.itemId}`);
|
|
2235
|
-
if (message) { message.scrollIntoView({ block: 'center', behavior: 'smooth' }); const previous = message.style.outline;
|
|
2382
|
+
if (message) { message.scrollIntoView({ block: 'center', behavior: 'smooth' }); const previous = message.style.outline; const highlight = `2px solid ${currentAccent || '#0169cc'}`; message.style.outline = highlight; setTimeout(() => { if (message.style.outline === highlight || message.style.outline.startsWith('2px solid')) message.style.outline = previous; }, 3000); analysisMessage.textContent = S('locatedMessage'); return; }
|
|
2236
2383
|
}
|
|
2237
2384
|
await new Promise(resolve => setTimeout(resolve, 100));
|
|
2238
2385
|
}
|
|
@@ -2325,8 +2472,8 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
2325
2472
|
updateDraft(target, { progress: value, state });
|
|
2326
2473
|
};
|
|
2327
2474
|
let dragging = false;
|
|
2328
|
-
slider.onpointerdown = () => { dragging = true; };
|
|
2329
|
-
const endDrag = () => { dragging = false; }; slider.onpointerup = endDrag; slider.onpointercancel = endDrag; slider.onlostpointercapture = endDrag;
|
|
2475
|
+
slider.onpointerdown = () => { dragging = true; range.classList.add('is-dragging'); };
|
|
2476
|
+
const endDrag = () => { dragging = false; range.classList.remove('is-dragging'); }; slider.onpointerup = endDrag; slider.onpointercancel = endDrag; slider.onlostpointercapture = endDrag;
|
|
2330
2477
|
slider.oninput = () => { const value = Number(slider.value), nearest = Math.round(value / 25) * 25; setProgress(presentation ? presentation.progressValue(value, dragging) : dragging && Math.abs(value - nearest) <= 2 ? nearest : value); };
|
|
2331
2478
|
progress.oninput = () => { const raw = progress.value.trim(); if (!raw) setProgress(null); else if (Number.isInteger(Number(raw)) && Number(raw) >= 0 && Number(raw) <= 100) setProgress(Number(raw)); else target.dirty = true; };
|
|
2332
2479
|
unknown.onclick = () => setProgress(null);
|
|
@@ -2340,6 +2487,8 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
2340
2487
|
try { await harness.openPane({ entry, request: target.request }); if (panel === target) closePanel(); }
|
|
2341
2488
|
catch (error) { if (panel === target) { openPane.disabled = false; analysisMessage.textContent = error.message; } }
|
|
2342
2489
|
};
|
|
2490
|
+
// 完整子树与主题属性就绪后一次性挂载进文档,杜绝首帧按默认暗底渲染后再切浅色的闪烁。
|
|
2491
|
+
(embedded?.container || document.body).append(root);
|
|
2343
2492
|
// 首次历史读取前以当前快照为基线:读取期间到达的新版快照会触发补读。
|
|
2344
2493
|
target.syncVersion = panelVersion(entry.key);
|
|
2345
2494
|
if (embedded?.analysisState) showHistory(embedded.analysisState); else pollHistory();
|
|
@@ -2398,14 +2547,30 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
2398
2547
|
if (records.every(r => r.target.closest?.('[data-codex-session-status], [data-codex-session-status-panel]'))) return;
|
|
2399
2548
|
schedule();
|
|
2400
2549
|
});
|
|
2401
|
-
const
|
|
2550
|
+
const rootObserver = !embedded ? new MutationObserver(() => {
|
|
2551
|
+
const mode = panel?.root.getAttribute('data-color-mode') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
2552
|
+
syncAccent(panel?.root, mode === 'dark');
|
|
2553
|
+
for (const entry of mounted.values()) {
|
|
2554
|
+
entry.host?.style.setProperty('--accent', currentAccent);
|
|
2555
|
+
if (snapshot.analyzingKeys?.includes(entry.key)) makeRing(entry.button, recordFor(entry.key), false, true);
|
|
2556
|
+
}
|
|
2557
|
+
}) : null;
|
|
2558
|
+
const headObserver = !embedded && document.head ? new MutationObserver(() => {
|
|
2559
|
+
const mode = panel?.root.getAttribute('data-color-mode') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
2560
|
+
syncAccent(panel?.root, mode === 'dark');
|
|
2561
|
+
for (const entry of mounted.values()) entry.host?.style.setProperty('--accent', currentAccent);
|
|
2562
|
+
}) : null;
|
|
2563
|
+
const filter = harness?.attributeFilter || ['data-app-action-sidebar-thread-selected', 'data-app-action-sidebar-thread-id', 'data-app-action-sidebar-thread-host-id', 'data-app-action-sidebar-thread-title', 'hidden', 'aria-expanded', 'style', 'class', 'data-theme', 'data-mode'];
|
|
2402
2564
|
if (!embedded) {
|
|
2403
2565
|
observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: filter });
|
|
2566
|
+
rootObserver?.observe(document.documentElement, { attributes: true, attributeFilter: ['style', 'class', 'data-theme', 'data-mode', 'data-appearance-preset'] });
|
|
2567
|
+
headObserver?.observe(document.head, { childList: true, subtree: true, characterData: true });
|
|
2404
2568
|
document.addEventListener('pointerdown', onOutside, true);
|
|
2405
2569
|
document.addEventListener('keydown', onKey, true);
|
|
2406
2570
|
document.addEventListener('scroll', onScroll, true);
|
|
2407
2571
|
}
|
|
2408
2572
|
window.addEventListener('resize', positionPanel);
|
|
2573
|
+
syncAccent(null, matchMedia('(prefers-color-scheme: dark)').matches);
|
|
2409
2574
|
const api = {
|
|
2410
2575
|
receive(next) { receive(next); localCards?.receive(next); },
|
|
2411
2576
|
receiveCardEvent({ snapshot: next, analysisState, session }) {
|
|
@@ -2421,7 +2586,19 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
2421
2586
|
embedded.streamConnected = false;
|
|
2422
2587
|
if (panel?.analyzing) panel.pollHistory();
|
|
2423
2588
|
},
|
|
2424
|
-
setTheme(theme) {
|
|
2589
|
+
setTheme(theme) {
|
|
2590
|
+
if (!embedded) return;
|
|
2591
|
+
if (['light', 'dark'].includes(theme) && embedded.theme !== theme) {
|
|
2592
|
+
embedded.theme = theme;
|
|
2593
|
+
positionPanel();
|
|
2594
|
+
} else if (panel?.root) {
|
|
2595
|
+
if (panel.root.getAttribute('data-color-mode') !== (embedded.theme || theme) && ['light', 'dark'].includes(embedded.theme || theme)) {
|
|
2596
|
+
positionPanel();
|
|
2597
|
+
} else {
|
|
2598
|
+
syncAccent(panel.root, (embedded.theme || 'dark') === 'dark');
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
},
|
|
2425
2602
|
reply(message) {
|
|
2426
2603
|
localCards?.reply(message);
|
|
2427
2604
|
const { requestId, error, errorInfo, session, snapshot: next, analysisState, projectGit, updateInfo, navigation, pane } = message;
|
|
@@ -2439,7 +2616,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
2439
2616
|
return { snapshot, panel: active, panelStates: [...panelStates], localCards: localCards?.exportState() };
|
|
2440
2617
|
},
|
|
2441
2618
|
destroy() {
|
|
2442
|
-
destroyed = true; localCards?.destroy(); harness?.dispose?.(); observer.disconnect(); cancelAnimationFrame(frame);
|
|
2619
|
+
destroyed = true; localCards?.destroy(); harness?.dispose?.(); observer.disconnect(); rootObserver?.disconnect(); headObserver?.disconnect(); cancelAnimationFrame(frame);
|
|
2443
2620
|
if (panel) { rememberPanel(panel); panelEvent('dispose', panel.entry); clearTimeout(panel.pollTimer); clearTimeout(panel.updateTimer); cancelAnimationFrame(panel.marqueeFrame); panel.resizeObserver?.disconnect(); panel.root.remove(); panel.entry.button?.setAttribute('aria-expanded', 'false'); panel = null; }
|
|
2444
2621
|
for (const entry of [...mounted.values()]) unmount(entry);
|
|
2445
2622
|
document.removeEventListener('pointerdown', onOutside, true); document.removeEventListener('keydown', onKey, true);
|
|
@@ -2450,7 +2627,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
2450
2627
|
}
|
|
2451
2628
|
};
|
|
2452
2629
|
if (!embedded?.independent) window.__codexSessionStatus = api;
|
|
2453
|
-
if (harness?.globalName) window[harness.globalName] = api;
|
|
2630
|
+
if (!embedded?.independent && harness?.globalName) window[harness.globalName] = api;
|
|
2454
2631
|
if (embedded) {
|
|
2455
2632
|
receive(embedded.snapshot);
|
|
2456
2633
|
openPanel({ key: embedded.key, title: embedded.title });
|