agent-things 1.2.2 → 1.3.2
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/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 +3 -3
- package/outputs/antigravity-session-status.js +276 -99
- package/outputs/codex-session-status.js +236 -27
- 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/analysis-assets/output.en.schema.json +6 -3
- package/src/analysis-assets/output.schema.json +6 -3
- package/src/analysis-assets/prompt.en.txt +1 -1
- package/src/analysis-assets/prompt.zh-CN.txt +1 -1
- package/src/analysis-history.cjs +27 -6
- package/src/analysis-service.cjs +1 -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/claude/claude-source.cjs +18 -5
- 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 +117 -26
- package/src/ui-foundation.cjs +119 -1
|
@@ -97,6 +97,33 @@ function getActiveUi(lang) {
|
|
|
97
97
|
return getUiForLang(normalizeLang(lang) || readConfiguredLang());
|
|
98
98
|
}
|
|
99
99
|
|
|
100
|
+
function readConfiguredHostTheme() {
|
|
101
|
+
let mode = 'light';
|
|
102
|
+
try {
|
|
103
|
+
const out = execFileSync('defaults', ['read', '-g', 'AppleInterfaceStyle'], {
|
|
104
|
+
encoding: 'utf8',
|
|
105
|
+
timeout: 300,
|
|
106
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
107
|
+
}).trim();
|
|
108
|
+
if (/^dark$/i.test(out)) mode = 'dark';
|
|
109
|
+
} catch (_) {}
|
|
110
|
+
let settings = {};
|
|
111
|
+
try {
|
|
112
|
+
const cfgPath = join(homedir(), '.gemini/config/config.json');
|
|
113
|
+
if (existsSync(cfgPath)) {
|
|
114
|
+
settings = JSON.parse(readFileSync(cfgPath, 'utf-8'))?.userSettings || {};
|
|
115
|
+
}
|
|
116
|
+
} catch (_) {}
|
|
117
|
+
if (settings.themeMode === 'THEME_MODE_LIGHT') mode = 'light';
|
|
118
|
+
else if (settings.themeMode === 'THEME_MODE_DARK') mode = 'dark';
|
|
119
|
+
const seeds = mode === 'dark' ? settings.customThemeSeedsDark : settings.customThemeSeedsLight;
|
|
120
|
+
return {
|
|
121
|
+
mode,
|
|
122
|
+
primary: seeds?.primary || (mode === 'dark' ? '#2F71E3' : '#2F75C3'),
|
|
123
|
+
bg: seeds?.background || (mode === 'dark' ? '#070708' : '#FFFFFF'),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
|
|
100
127
|
function sidecarMsg(lang, zhText, enText) {
|
|
101
128
|
return (normalizeLang(lang) || readConfiguredLang()) === 'en' ? enText : zhText;
|
|
102
129
|
}
|
|
@@ -271,7 +298,8 @@ const app = new SidecarApp();
|
|
|
271
298
|
app.page('/', () => {
|
|
272
299
|
const lang = readConfiguredLang();
|
|
273
300
|
const ui = getActiveUi(lang);
|
|
274
|
-
const
|
|
301
|
+
const hostTheme = readConfiguredHostTheme();
|
|
302
|
+
const bootstrapScript = `<script>window.__agentThingsLang=${JSON.stringify(lang)};window.__agentThingsHostTheme=${JSON.stringify(hostTheme)};window.__agentThingsI18n=${JSON.stringify({
|
|
275
303
|
lang,
|
|
276
304
|
labels: ui.labels,
|
|
277
305
|
taskLabels: ui.taskLabels,
|
|
@@ -280,7 +308,7 @@ app.page('/', () => {
|
|
|
280
308
|
locales: ui.locales,
|
|
281
309
|
})};</script>`;
|
|
282
310
|
let html = readFileSync(join(__dirname, 'index.html'), 'utf-8');
|
|
283
|
-
html = html.replace('<html lang="zh-CN">', `<html lang="${lang === 'en' ? 'en' : 'zh-CN'}">`);
|
|
311
|
+
html = html.replace('<html lang="zh-CN">', `<html lang="${lang === 'en' ? 'en' : 'zh-CN'}" data-color-mode="${hostTheme.mode}" style="color-scheme:${hostTheme.mode}">`);
|
|
284
312
|
html = html.replace(
|
|
285
313
|
'<title>Agent Things 会话任务进度 · 任务进展</title>',
|
|
286
314
|
`<title>${lang === 'en' ? `${ui.strings.defaultDocTitle} · ${ui.strings.docTitleSuffix}` : 'Agent Things 会话任务进度 · 任务进展'}</title>`
|
|
@@ -533,9 +561,14 @@ async function triggerHostLocate(convId, source) {
|
|
|
533
561
|
const box = el.querySelector?.('[data-testid="user-message-bubble"]') || el;
|
|
534
562
|
box.scrollIntoView({ block: 'center', behavior: 'smooth' });
|
|
535
563
|
const po = box.style.outline, ps = box.style.boxShadow, pt = box.style.transition;
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
564
|
+
let accentHex = '#2F75C3';
|
|
565
|
+
try {
|
|
566
|
+
const v = getComputedStyle(document.documentElement).getPropertyValue('--primary').trim();
|
|
567
|
+
if (v) accentHex = v;
|
|
568
|
+
} catch (_) {}
|
|
569
|
+
box.style.transition = 'outline-color 200ms cubic-bezier(0.23, 1, 0.32, 1), box-shadow 200ms cubic-bezier(0.23, 1, 0.32, 1)';
|
|
570
|
+
box.style.outline = '2px solid ' + accentHex;
|
|
571
|
+
box.style.boxShadow = '0 0 0 4px color-mix(in srgb, ' + accentHex + ' 25%, transparent), 0 8px 24px color-mix(in srgb, ' + accentHex + ' 35%, transparent)';
|
|
539
572
|
setTimeout(() => {
|
|
540
573
|
box.style.outline = po;
|
|
541
574
|
box.style.boxShadow = ps;
|
|
@@ -150,7 +150,11 @@ button {
|
|
|
150
150
|
height: 26px;
|
|
151
151
|
border-radius: 4px;
|
|
152
152
|
color: var(--secondary);
|
|
153
|
-
transition:
|
|
153
|
+
transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 160ms cubic-bezier(0.23, 1, 0.32, 1), color 160ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.btn-icon:active {
|
|
157
|
+
transform: scale(0.95);
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
.btn-icon:hover {
|
|
@@ -224,7 +228,7 @@ button {
|
|
|
224
228
|
height: 100%;
|
|
225
229
|
background: var(--accent);
|
|
226
230
|
border-radius: 3px;
|
|
227
|
-
transition: width 0.
|
|
231
|
+
transition: width 220ms cubic-bezier(0.23, 1, 0.32, 1), background-color 180ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
228
232
|
}
|
|
229
233
|
|
|
230
234
|
/* Note Card */
|
|
@@ -289,7 +293,11 @@ button {
|
|
|
289
293
|
padding: 2px 8px;
|
|
290
294
|
border-radius: 4px;
|
|
291
295
|
color: var(--muted);
|
|
292
|
-
transition:
|
|
296
|
+
transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 160ms cubic-bezier(0.23, 1, 0.32, 1), color 160ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.filter-tab:active {
|
|
300
|
+
transform: scale(0.97);
|
|
293
301
|
}
|
|
294
302
|
|
|
295
303
|
.filter-tab.active {
|
|
@@ -317,7 +325,7 @@ button {
|
|
|
317
325
|
background: var(--card-bg);
|
|
318
326
|
border: 1px solid var(--line);
|
|
319
327
|
border-radius: 6px;
|
|
320
|
-
transition:
|
|
328
|
+
transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 160ms cubic-bezier(0.23, 1, 0.32, 1), border-color 160ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
321
329
|
}
|
|
322
330
|
|
|
323
331
|
.task-item:hover {
|
|
@@ -441,7 +449,11 @@ button {
|
|
|
441
449
|
background: rgba(255, 255, 255, 0.02);
|
|
442
450
|
color: var(--secondary);
|
|
443
451
|
text-align: center;
|
|
444
|
-
transition:
|
|
452
|
+
transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 160ms cubic-bezier(0.23, 1, 0.32, 1), border-color 160ms cubic-bezier(0.23, 1, 0.32, 1), color 160ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
.chip-btn:active {
|
|
456
|
+
transform: scale(0.97);
|
|
445
457
|
}
|
|
446
458
|
|
|
447
459
|
.chip-btn:hover {
|
|
@@ -507,7 +519,11 @@ button {
|
|
|
507
519
|
border-radius: 6px;
|
|
508
520
|
font-size: 12px;
|
|
509
521
|
font-weight: 500;
|
|
510
|
-
transition:
|
|
522
|
+
transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1), background-color 160ms cubic-bezier(0.23, 1, 0.32, 1), border-color 160ms cubic-bezier(0.23, 1, 0.32, 1), color 160ms cubic-bezier(0.23, 1, 0.32, 1);
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.btn:active:not(:disabled) {
|
|
526
|
+
transform: scale(0.97);
|
|
511
527
|
}
|
|
512
528
|
|
|
513
529
|
.btn-primary {
|
|
@@ -4,7 +4,98 @@ export const createPresentation = function createPresentation(lang) {
|
|
|
4
4
|
const currentLang = normalizeLang(lang ?? (typeof globalThis !== 'undefined' ? globalThis.__agentThingsLang : undefined));
|
|
5
5
|
const colors = { unstarted: '#9098a2', unfinished: '#c89b38', completed: '#548eea', pushed: '#a17be3' };
|
|
6
6
|
const layout = { contentWidth: 300, panelWidth: 340, progressNodes: [0, 25, 50, 75, 100] };
|
|
7
|
-
const accent = { normal: '#0169CC', hover: '#005bb3', pressed: '#004f9c' };
|
|
7
|
+
const accent = { normal: '#0169CC', hover: '#005bb3', pressed: '#004f9c', onAccent: '#FFFFFF' };
|
|
8
|
+
const claudeCodeThemes = {
|
|
9
|
+
'claude-light': '#C6613F',
|
|
10
|
+
'claude-dark': '#D97757',
|
|
11
|
+
'github-light': '#0969DA',
|
|
12
|
+
'github-light-high-contrast': '#0550AE',
|
|
13
|
+
'github-dark': '#1F6FEB',
|
|
14
|
+
'github-dark-dimmed': '#316DCA',
|
|
15
|
+
'github-dark-high-contrast': '#409EFF',
|
|
16
|
+
'pierre-light': '#0073E6',
|
|
17
|
+
'pierre-dark': '#0087EE',
|
|
18
|
+
'vscode-light': '#007ACC',
|
|
19
|
+
'vscode-dark': '#007ACC',
|
|
20
|
+
'one-light': '#4078F2',
|
|
21
|
+
'one-dark-pro': '#61AFEF',
|
|
22
|
+
'catppuccin-latte': '#8839EF',
|
|
23
|
+
'catppuccin-mocha': '#CBA6F7',
|
|
24
|
+
'solarized-light': '#268BD2',
|
|
25
|
+
'solarized-dark': '#268BD2',
|
|
26
|
+
'vitesse-light': '#4D9375',
|
|
27
|
+
'vitesse-dark': '#4D9375',
|
|
28
|
+
'min-light': '#256ABF',
|
|
29
|
+
'min-dark': '#5598E7',
|
|
30
|
+
'rose-pine-dawn': '#D7827E',
|
|
31
|
+
'rose-pine': '#EA9A97',
|
|
32
|
+
'slack-ochin': '#1264A3',
|
|
33
|
+
'slack-dark': '#36C5F0',
|
|
34
|
+
'dracula': '#BD93F9',
|
|
35
|
+
'dracula-soft': '#BD93F9',
|
|
36
|
+
'nord': '#88C0D0',
|
|
37
|
+
'monokai': '#F92672',
|
|
38
|
+
'tokyo-night': '#7AA2F7',
|
|
39
|
+
'night-owl': '#82AAFF',
|
|
40
|
+
'ayu-dark': '#E6B450',
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
function normalizeHexColor(value, fallback = null) {
|
|
44
|
+
if (typeof value !== 'string') return fallback;
|
|
45
|
+
const raw = value.trim();
|
|
46
|
+
if (/^#[0-9a-fA-F]{6}$/.test(raw)) return raw.toUpperCase();
|
|
47
|
+
if (/^#[0-9a-fA-F]{3}$/.test(raw)) {
|
|
48
|
+
return `#${raw[1]}${raw[1]}${raw[2]}${raw[2]}${raw[3]}${raw[3]}`.toUpperCase();
|
|
49
|
+
}
|
|
50
|
+
const rgbMatch = raw.match(/^rgba?\(\s*(\d{1,3})\s*[,\s]\s*(\d{1,3})\s*[,\s]\s*(\d{1,3})/i);
|
|
51
|
+
if (rgbMatch) {
|
|
52
|
+
const toHex = n => Math.max(0, Math.min(255, Number(n))).toString(16).padStart(2, '0');
|
|
53
|
+
return `#${toHex(rgbMatch[1])}${toHex(rgbMatch[2])}${toHex(rgbMatch[3])}`.toUpperCase();
|
|
54
|
+
}
|
|
55
|
+
return fallback;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function hexToRgb(hex) {
|
|
59
|
+
const clean = normalizeHexColor(hex, '#0169CC').slice(1);
|
|
60
|
+
return [
|
|
61
|
+
parseInt(clean.slice(0, 2), 16),
|
|
62
|
+
parseInt(clean.slice(2, 4), 16),
|
|
63
|
+
parseInt(clean.slice(4, 6), 16),
|
|
64
|
+
];
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function getRelativeLuminance(hex) {
|
|
68
|
+
const [r, g, b] = hexToRgb(hex).map(channel => {
|
|
69
|
+
const srgb = channel / 255;
|
|
70
|
+
return srgb <= 0.03928 ? srgb / 12.92 : ((srgb + 0.055) / 1.055) ** 2.4;
|
|
71
|
+
});
|
|
72
|
+
return 0.2126 * r + 0.7152 * g + 0.0722 * b;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function mixHexColors(hexA, hexB, weightA) {
|
|
76
|
+
const [r1, g1, b1] = hexToRgb(hexA);
|
|
77
|
+
const [r2, g2, b2] = hexToRgb(hexB);
|
|
78
|
+
const wA = Math.max(0, Math.min(1, weightA));
|
|
79
|
+
const wB = 1 - wA;
|
|
80
|
+
const toHex = n => Math.max(0, Math.min(255, Math.round(n))).toString(16).padStart(2, '0');
|
|
81
|
+
return `#${toHex(r1 * wA + r2 * wB)}${toHex(g1 * wA + g2 * wB)}${toHex(b1 * wA + b2 * wB)}`.toUpperCase();
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
function resolveAccentPalette(rawColor, { isDark = true, fallback = '#0169CC' } = {}) {
|
|
85
|
+
const normal = normalizeHexColor(rawColor, normalizeHexColor(fallback, '#0169CC'));
|
|
86
|
+
const lum = getRelativeLuminance(normal);
|
|
87
|
+
const onAccent = lum > 0.45 ? '#0D0D0D' : '#FFFFFF';
|
|
88
|
+
// Darken bright accents or shade toward dark/light ink subtly without losing hue identity.
|
|
89
|
+
const mixTarget = lum > 0.45 ? '#000000' : (isDark ? '#FFFFFF' : '#000000');
|
|
90
|
+
const hoverWeight = lum > 0.45 ? 0.88 : (isDark ? 0.88 : 0.88);
|
|
91
|
+
const pressedWeight = lum > 0.45 ? 0.78 : (isDark ? 0.78 : 0.78);
|
|
92
|
+
return {
|
|
93
|
+
normal,
|
|
94
|
+
hover: mixHexColors(normal, mixTarget, hoverWeight),
|
|
95
|
+
pressed: mixHexColors(normal, mixTarget, pressedWeight),
|
|
96
|
+
onAccent,
|
|
97
|
+
};
|
|
98
|
+
}
|
|
8
99
|
|
|
9
100
|
const locales = {
|
|
10
101
|
zh: {
|
|
@@ -183,6 +274,18 @@ export const createPresentation = function createPresentation(lang) {
|
|
|
183
274
|
hookPresentedMessage: '已呈现当前会话任务进度卡片',
|
|
184
275
|
noSessionBadge: '无会话',
|
|
185
276
|
offlineBadge: '离线',
|
|
277
|
+
badgeNotOrganized: '未整理',
|
|
278
|
+
badgeProgressUnrecordedSuffix: ' · 进度未记录',
|
|
279
|
+
ringAriaPattern: '{title}:{summary},点击记录任务进展',
|
|
280
|
+
ringUpdating: '正在更新进度',
|
|
281
|
+
sessionFallbackTitle: '会话',
|
|
282
|
+
statusUnrecorded: '尚未记录进展',
|
|
283
|
+
panelAriaPattern: '{title} 任务进展',
|
|
284
|
+
totalsEmpty: '暂无任务统计',
|
|
285
|
+
taskUnknown: '状态未知',
|
|
286
|
+
timelineAnalysis: '自动分析',
|
|
287
|
+
timelineManual: '手动记录',
|
|
288
|
+
unrecordedShort: '未记录',
|
|
186
289
|
},
|
|
187
290
|
en: {
|
|
188
291
|
appTitle: 'Agent Things',
|
|
@@ -360,6 +463,18 @@ export const createPresentation = function createPresentation(lang) {
|
|
|
360
463
|
hookPresentedMessage: 'Session task progress card presented',
|
|
361
464
|
noSessionBadge: 'No session',
|
|
362
465
|
offlineBadge: 'Offline',
|
|
466
|
+
badgeNotOrganized: 'Not organized',
|
|
467
|
+
badgeProgressUnrecordedSuffix: ' · Progress unrecorded',
|
|
468
|
+
ringAriaPattern: '{title}: {summary}. Click to track progress',
|
|
469
|
+
ringUpdating: 'Updating progress',
|
|
470
|
+
sessionFallbackTitle: 'Session',
|
|
471
|
+
statusUnrecorded: 'No progress recorded',
|
|
472
|
+
panelAriaPattern: '{title} Task Progress',
|
|
473
|
+
totalsEmpty: 'No task metrics yet',
|
|
474
|
+
taskUnknown: 'Unknown status',
|
|
475
|
+
timelineAnalysis: 'Auto analysis',
|
|
476
|
+
timelineManual: 'Manual record',
|
|
477
|
+
unrecordedShort: 'Unrecorded',
|
|
363
478
|
},
|
|
364
479
|
};
|
|
365
480
|
|
|
@@ -418,6 +533,9 @@ export const createPresentation = function createPresentation(lang) {
|
|
|
418
533
|
locales,
|
|
419
534
|
layout,
|
|
420
535
|
accent,
|
|
536
|
+
claudeCodeThemes,
|
|
537
|
+
normalizeHexColor,
|
|
538
|
+
resolveAccentPalette,
|
|
421
539
|
t: active.t,
|
|
422
540
|
format,
|
|
423
541
|
forLang,
|
package/src/session-status.js
CHANGED
|
@@ -30,6 +30,40 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
30
30
|
return true;
|
|
31
31
|
};
|
|
32
32
|
const colors = presentation?.colors || { unstarted: '#9098a2', unfinished: '#c89b38', completed: '#548eea', pushed: '#a17be3' };
|
|
33
|
+
let currentAccent = presentation?.accent?.normal || '#0169CC';
|
|
34
|
+
let currentAccentPalette = presentation?.accent || { normal: '#0169CC', hover: '#005bb3', pressed: '#004f9c', onAccent: '#FFFFFF' };
|
|
35
|
+
function resolveHostAccent(isDark = true) {
|
|
36
|
+
const raw = (window.__agentThingsHostAccent || document.documentElement.style.getPropertyValue('--agent-things-accent') || (() => {
|
|
37
|
+
try {
|
|
38
|
+
const rootStyle = getComputedStyle(document.documentElement);
|
|
39
|
+
for (const varName of ['--codex-base-accent', '--color-button-accent', '--primary', '--agent-things-accent']) {
|
|
40
|
+
const candidate = rootStyle.getPropertyValue(varName).trim();
|
|
41
|
+
if (candidate) return candidate;
|
|
42
|
+
}
|
|
43
|
+
} catch {}
|
|
44
|
+
return '';
|
|
45
|
+
})()).trim();
|
|
46
|
+
const fallback = presentation?.accent?.normal || '#0169CC';
|
|
47
|
+
return presentation?.resolveAccentPalette
|
|
48
|
+
? presentation.resolveAccentPalette(raw || fallback, { isDark, fallback })
|
|
49
|
+
: { normal: raw || fallback, hover: '#005bb3', pressed: '#004f9c', onAccent: '#FFFFFF' };
|
|
50
|
+
}
|
|
51
|
+
function syncAccent(node, isDark = true) {
|
|
52
|
+
const palette = resolveHostAccent(isDark);
|
|
53
|
+
currentAccentPalette = palette;
|
|
54
|
+
currentAccent = palette.normal;
|
|
55
|
+
if (!node?.style) return palette;
|
|
56
|
+
const pairs = [
|
|
57
|
+
['--accent', palette.normal],
|
|
58
|
+
['--accent-hover', palette.hover],
|
|
59
|
+
['--accent-pressed', palette.pressed],
|
|
60
|
+
['--on-accent', palette.onAccent],
|
|
61
|
+
];
|
|
62
|
+
for (const [k, v] of pairs) {
|
|
63
|
+
if (node.style.getPropertyValue(k) !== v) node.style.setProperty(k, v);
|
|
64
|
+
}
|
|
65
|
+
return palette;
|
|
66
|
+
}
|
|
33
67
|
let snapshot = { revision: 0, records: {} };
|
|
34
68
|
const mounted = new Map();
|
|
35
69
|
const pending = new Map();
|
|
@@ -126,7 +160,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
126
160
|
if (loading) {
|
|
127
161
|
svg.setAttribute('class', 'loading');
|
|
128
162
|
const circle = document.createElementNS(svg.namespaceURI, 'circle');
|
|
129
|
-
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);
|
|
163
|
+
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);
|
|
130
164
|
svg.append(circle); button.append(svg); return;
|
|
131
165
|
}
|
|
132
166
|
const color = record ? colors[record.state] : '#858991';
|
|
@@ -210,7 +244,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
210
244
|
host.setAttribute('data-codex-session-status', '');
|
|
211
245
|
host.style.cssText = 'display:flex;width:24px;height:28px;flex:none;align-items:center;justify-content:center';
|
|
212
246
|
const shadow = host.attachShadow({ mode: 'open' });
|
|
213
|
-
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
|
|
247
|
+
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);
|
|
214
248
|
const button = element('button', null, shadow);
|
|
215
249
|
button.type = 'button'; button.setAttribute('aria-haspopup', 'dialog'); button.setAttribute('aria-expanded', 'false');
|
|
216
250
|
return { host, button, original };
|
|
@@ -285,10 +319,26 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
285
319
|
return r.width > 0 && r.height > 0 && r.bottom > 0 && r.top < innerHeight;
|
|
286
320
|
}
|
|
287
321
|
|
|
322
|
+
function detectPanelColorMode(entry) {
|
|
323
|
+
if (embedded) return embedded.theme && ['light', 'dark'].includes(embedded.theme) ? embedded.theme : (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
324
|
+
for (let node = entry?.row; node; node = node.parentElement) {
|
|
325
|
+
const rgba = getComputedStyle(node).backgroundColor.match(/[\d.]+/g)?.map(Number);
|
|
326
|
+
if (!rgba || (rgba[3] ?? 1) < .95) continue;
|
|
327
|
+
return rgba[0] * .2126 + rgba[1] * .7152 + rgba[2] * .0722 < 150 ? 'dark' : 'light';
|
|
328
|
+
}
|
|
329
|
+
const docTheme = typeof document !== 'undefined'
|
|
330
|
+
? (document.documentElement?.getAttribute?.('data-theme') || document.documentElement?.dataset?.mode || (document.body?.classList?.contains('theme-light') ? 'light' : document.body?.classList?.contains('theme-dark') ? 'dark' : ''))
|
|
331
|
+
: '';
|
|
332
|
+
if (docTheme === 'light' || docTheme === 'dark') return docTheme;
|
|
333
|
+
return matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light';
|
|
334
|
+
}
|
|
335
|
+
|
|
288
336
|
function positionPanel() {
|
|
289
337
|
if (!panel) return;
|
|
290
338
|
if (embedded) {
|
|
291
|
-
|
|
339
|
+
const mode = embedded.theme || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
340
|
+
if (panel.root.getAttribute('data-color-mode') !== mode) panel.root.setAttribute('data-color-mode', mode);
|
|
341
|
+
if (typeof syncAccent === 'function') syncAccent(panel.root, mode === 'dark');
|
|
292
342
|
return;
|
|
293
343
|
}
|
|
294
344
|
// Foreground colors change when the host window becomes inactive.
|
|
@@ -302,6 +352,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
302
352
|
}
|
|
303
353
|
mode ||= panel.root.getAttribute('data-color-mode') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
304
354
|
if (panel.root.getAttribute('data-color-mode') !== mode) panel.root.setAttribute('data-color-mode', mode);
|
|
355
|
+
if (typeof syncAccent === 'function') syncAccent(panel.root, mode === 'dark');
|
|
305
356
|
const anchor = panel.entry.host.getBoundingClientRect();
|
|
306
357
|
const rect = panel.shell.getBoundingClientRect();
|
|
307
358
|
const left = Math.max(8, Math.min(anchor.right + 10, innerWidth - rect.width - 8));
|
|
@@ -342,7 +393,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
342
393
|
target.statusDot.style.borderColor = record ? colors[record.state] : colors.unstarted;
|
|
343
394
|
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' })) : '';
|
|
344
395
|
target.scoreNumber.textContent = record?.progress ?? '—';
|
|
345
|
-
target.scoreUnit.hidden =
|
|
396
|
+
target.scoreUnit.hidden = false;
|
|
346
397
|
target.meter.style.setProperty('--fill', `${record?.progress ?? 0}%`);
|
|
347
398
|
target.meter.style.setProperty('--mark', record ? colors[record.state] : colors.unstarted);
|
|
348
399
|
target.sourceLabel.textContent = record ? (record.source === 'analysis' ? S('sourceAuto') : S('sourceManual')) : '';
|
|
@@ -444,37 +495,47 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
444
495
|
|
|
445
496
|
function openPanel(entry) {
|
|
446
497
|
if (panel) return;
|
|
447
|
-
const root =
|
|
498
|
+
const root = document.createElement('div');
|
|
499
|
+
const initialMode = detectPanelColorMode(entry);
|
|
448
500
|
root.setAttribute('data-codex-session-status-panel', '');
|
|
501
|
+
root.setAttribute('data-color-mode', initialMode);
|
|
502
|
+
syncAccent(root, initialMode === 'dark');
|
|
449
503
|
if (!embedded) root.style.cssText = 'position:fixed;inset:0;pointer-events:none;z-index:2147483646';
|
|
450
504
|
const shadow = root.attachShadow({ mode: 'open' });
|
|
451
505
|
element('style', `
|
|
452
|
-
:host{--accent:${
|
|
506
|
+
: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}
|
|
453
507
|
*{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}
|
|
454
508
|
.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}
|
|
455
509
|
.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}
|
|
456
510
|
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}
|
|
457
|
-
.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}
|
|
458
|
-
.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)}
|
|
459
|
-
.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
|
|
460
|
-
.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}
|
|
461
|
-
.meter{height:4px;background:var(--track);border-radius:
|
|
462
|
-
.actions{display:flex;align-items:center;gap:14px;margin:18px 0 22px}.primary{border:0;background:var(--accent);color
|
|
463
|
-
.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
|
|
464
|
-
@media(prefers-reduced-motion:reduce){.task-row .task-title.overflowing .task-track{transform:none;transition:none}.task-title{overflow:auto}}
|
|
511
|
+
.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)}
|
|
512
|
+
.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)}
|
|
513
|
+
.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}
|
|
514
|
+
.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}
|
|
515
|
+
.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}
|
|
516
|
+
.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}
|
|
517
|
+
.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}
|
|
518
|
+
@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}}
|
|
465
519
|
@media(hover:none){.task-source{opacity:1;pointer-events:auto;transform:none}}
|
|
466
|
-
.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)}
|
|
467
|
-
.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:
|
|
520
|
+
.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)}
|
|
521
|
+
.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}
|
|
468
522
|
.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}
|
|
469
523
|
.shell textarea:focus-visible{outline:none}
|
|
470
524
|
.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)}
|
|
471
|
-
:host([data-color-mode=light]){--ink:#22272e;--secondary:#576374;--muted:#667383;--note:#46515f;--track:#
|
|
525
|
+
: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}
|
|
472
526
|
:host([data-color-mode=light]) .shell{--panel-bg:#fff;border-color:#dfe4ea;box-shadow:0 14px 45px #26344520}
|
|
473
527
|
:host([data-color-mode=light]) .shell:hover{--panel-bg:#f5f6f7}
|
|
474
528
|
:host([data-color-mode=light]) .range{--range-fill:color-mix(in srgb,var(--mark) 85%,#000)}
|
|
475
529
|
:host([data-color-mode=light]) .meter::after{background:color-mix(in srgb,var(--mark) 85%,#000)}
|
|
530
|
+
@media(prefers-color-scheme:light){
|
|
531
|
+
: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}
|
|
532
|
+
:host(:not([data-color-mode=dark])) .shell{--panel-bg:#fff;border-color:#dfe4ea;box-shadow:0 14px 45px #26344520}
|
|
533
|
+
:host(:not([data-color-mode=dark])) .shell:hover{--panel-bg:#f5f6f7}
|
|
534
|
+
:host(:not([data-color-mode=dark])) .range{--range-fill:color-mix(in srgb,var(--mark) 85%,#000)}
|
|
535
|
+
:host(:not([data-color-mode=dark])) .meter::after{background:color-mix(in srgb,var(--mark) 85%,#000)}
|
|
536
|
+
}
|
|
476
537
|
`, shadow);
|
|
477
|
-
if (embedded) element('style', '.shell
|
|
538
|
+
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);
|
|
478
539
|
const shell = element('div', null, shadow, 'shell');
|
|
479
540
|
shell.setAttribute('role', embedded ? 'region' : 'dialog'); shell.setAttribute('aria-label', S('panelAriaPattern', { title: entry.title }));
|
|
480
541
|
const close = embedded ? null : element('button', '×', shell, 'close'); close?.setAttribute('aria-label', S('close'));
|
|
@@ -750,7 +811,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
750
811
|
while (Date.now() < deadline) {
|
|
751
812
|
if (row.getAttribute('data-app-action-sidebar-thread-selected') === 'true') {
|
|
752
813
|
const message = [...document.querySelectorAll('[data-content-search-unit-key]')].find(node => node.getAttribute('data-content-search-unit-key') === `${source.turnId}:${source.itemId}`);
|
|
753
|
-
if (message) { message.scrollIntoView({ block: 'center', behavior: 'smooth' }); const previous = message.style.outline;
|
|
814
|
+
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; }
|
|
754
815
|
}
|
|
755
816
|
await new Promise(resolve => setTimeout(resolve, 100));
|
|
756
817
|
}
|
|
@@ -762,7 +823,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
762
823
|
element('span', null, row, 'task-dot'); const content = element('div', null, row, 'task-content');
|
|
763
824
|
const title = element('div', null, content, 'task-title'); title.title = task.title;
|
|
764
825
|
const track = element('div', null, title, 'task-track');
|
|
765
|
-
const text = task.
|
|
826
|
+
const text = task.title || task.summary;
|
|
766
827
|
element('span', text, track, 'task-copy');
|
|
767
828
|
element('div', taskLabels[task.status] || S('taskUnknown'), content, 'task-meta');
|
|
768
829
|
const ref = task.evidenceRefs?.find(value => sources?.[value]?.turnId);
|
|
@@ -843,8 +904,8 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
843
904
|
updateDraft(target, { progress: value, state });
|
|
844
905
|
};
|
|
845
906
|
let dragging = false;
|
|
846
|
-
slider.onpointerdown = () => { dragging = true; };
|
|
847
|
-
const endDrag = () => { dragging = false; }; slider.onpointerup = endDrag; slider.onpointercancel = endDrag; slider.onlostpointercapture = endDrag;
|
|
907
|
+
slider.onpointerdown = () => { dragging = true; range.classList.add('is-dragging'); };
|
|
908
|
+
const endDrag = () => { dragging = false; range.classList.remove('is-dragging'); }; slider.onpointerup = endDrag; slider.onpointercancel = endDrag; slider.onlostpointercapture = endDrag;
|
|
848
909
|
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); };
|
|
849
910
|
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; };
|
|
850
911
|
unknown.onclick = () => setProgress(null);
|
|
@@ -858,6 +919,8 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
858
919
|
try { await harness.openPane({ entry, request: target.request }); if (panel === target) closePanel(); }
|
|
859
920
|
catch (error) { if (panel === target) { openPane.disabled = false; analysisMessage.textContent = error.message; } }
|
|
860
921
|
};
|
|
922
|
+
// 完整子树与主题属性就绪后一次性挂载进文档,杜绝首帧按默认暗底渲染后再切浅色的闪烁。
|
|
923
|
+
(embedded?.container || document.body).append(root);
|
|
861
924
|
// 首次历史读取前以当前快照为基线:读取期间到达的新版快照会触发补读。
|
|
862
925
|
target.syncVersion = panelVersion(entry.key);
|
|
863
926
|
if (embedded?.analysisState) showHistory(embedded.analysisState); else pollHistory();
|
|
@@ -916,14 +979,30 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
916
979
|
if (records.every(r => r.target.closest?.('[data-codex-session-status], [data-codex-session-status-panel]'))) return;
|
|
917
980
|
schedule();
|
|
918
981
|
});
|
|
919
|
-
const
|
|
982
|
+
const rootObserver = !embedded ? new MutationObserver(() => {
|
|
983
|
+
const mode = panel?.root.getAttribute('data-color-mode') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
984
|
+
syncAccent(panel?.root, mode === 'dark');
|
|
985
|
+
for (const entry of mounted.values()) {
|
|
986
|
+
entry.host?.style.setProperty('--accent', currentAccent);
|
|
987
|
+
if (snapshot.analyzingKeys?.includes(entry.key)) makeRing(entry.button, recordFor(entry.key), false, true);
|
|
988
|
+
}
|
|
989
|
+
}) : null;
|
|
990
|
+
const headObserver = !embedded && document.head ? new MutationObserver(() => {
|
|
991
|
+
const mode = panel?.root.getAttribute('data-color-mode') || (matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light');
|
|
992
|
+
syncAccent(panel?.root, mode === 'dark');
|
|
993
|
+
for (const entry of mounted.values()) entry.host?.style.setProperty('--accent', currentAccent);
|
|
994
|
+
}) : null;
|
|
995
|
+
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'];
|
|
920
996
|
if (!embedded) {
|
|
921
997
|
observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: filter });
|
|
998
|
+
rootObserver?.observe(document.documentElement, { attributes: true, attributeFilter: ['style', 'class', 'data-theme', 'data-mode', 'data-appearance-preset'] });
|
|
999
|
+
headObserver?.observe(document.head, { childList: true, subtree: true, characterData: true });
|
|
922
1000
|
document.addEventListener('pointerdown', onOutside, true);
|
|
923
1001
|
document.addEventListener('keydown', onKey, true);
|
|
924
1002
|
document.addEventListener('scroll', onScroll, true);
|
|
925
1003
|
}
|
|
926
1004
|
window.addEventListener('resize', positionPanel);
|
|
1005
|
+
syncAccent(null, matchMedia('(prefers-color-scheme: dark)').matches);
|
|
927
1006
|
const api = {
|
|
928
1007
|
receive(next) { receive(next); localCards?.receive(next); },
|
|
929
1008
|
receiveCardEvent({ snapshot: next, analysisState, session }) {
|
|
@@ -939,7 +1018,19 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
939
1018
|
embedded.streamConnected = false;
|
|
940
1019
|
if (panel?.analyzing) panel.pollHistory();
|
|
941
1020
|
},
|
|
942
|
-
setTheme(theme) {
|
|
1021
|
+
setTheme(theme) {
|
|
1022
|
+
if (!embedded) return;
|
|
1023
|
+
if (['light', 'dark'].includes(theme) && embedded.theme !== theme) {
|
|
1024
|
+
embedded.theme = theme;
|
|
1025
|
+
positionPanel();
|
|
1026
|
+
} else if (panel?.root) {
|
|
1027
|
+
if (panel.root.getAttribute('data-color-mode') !== (embedded.theme || theme) && ['light', 'dark'].includes(embedded.theme || theme)) {
|
|
1028
|
+
positionPanel();
|
|
1029
|
+
} else {
|
|
1030
|
+
syncAccent(panel.root, (embedded.theme || 'dark') === 'dark');
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
},
|
|
943
1034
|
reply(message) {
|
|
944
1035
|
localCards?.reply(message);
|
|
945
1036
|
const { requestId, error, errorInfo, session, snapshot: next, analysisState, projectGit, updateInfo, navigation, pane } = message;
|
|
@@ -957,7 +1048,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
957
1048
|
return { snapshot, panel: active, panelStates: [...panelStates], localCards: localCards?.exportState() };
|
|
958
1049
|
},
|
|
959
1050
|
destroy() {
|
|
960
|
-
destroyed = true; localCards?.destroy(); harness?.dispose?.(); observer.disconnect(); cancelAnimationFrame(frame);
|
|
1051
|
+
destroyed = true; localCards?.destroy(); harness?.dispose?.(); observer.disconnect(); rootObserver?.disconnect(); headObserver?.disconnect(); cancelAnimationFrame(frame);
|
|
961
1052
|
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; }
|
|
962
1053
|
for (const entry of [...mounted.values()]) unmount(entry);
|
|
963
1054
|
document.removeEventListener('pointerdown', onOutside, true); document.removeEventListener('keydown', onKey, true);
|
|
@@ -968,7 +1059,7 @@ function installCodexSessionStatus(version, restored, embedded) {
|
|
|
968
1059
|
}
|
|
969
1060
|
};
|
|
970
1061
|
if (!embedded?.independent) window.__codexSessionStatus = api;
|
|
971
|
-
if (harness?.globalName) window[harness.globalName] = api;
|
|
1062
|
+
if (!embedded?.independent && harness?.globalName) window[harness.globalName] = api;
|
|
972
1063
|
if (embedded) {
|
|
973
1064
|
receive(embedded.snapshot);
|
|
974
1065
|
openPanel({ key: embedded.key, title: embedded.title });
|