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.
Files changed (34) hide show
  1. package/mods/agent-things-ui/.claude-plugin/plugin.json +1 -1
  2. package/mods/agent-things-ui/hooks/controls.js +1 -1
  3. package/mods/agent-things-ui/hooks/foundation.js +120 -2
  4. package/mods/agent-things-ui/hooks/presentation.js +9 -6
  5. package/mods/agent-things-ui/hooks/register.js +3 -3
  6. package/outputs/antigravity-session-status.js +276 -99
  7. package/outputs/codex-session-status.js +236 -27
  8. package/package.json +1 -1
  9. package/scripts/build-shared-ui.cjs +13 -1
  10. package/skills/things/SKILL.en.md +3 -1
  11. package/skills/things/SKILL.md +3 -1
  12. package/src/analysis-assets/output.en.schema.json +6 -3
  13. package/src/analysis-assets/output.schema.json +6 -3
  14. package/src/analysis-assets/prompt.en.txt +1 -1
  15. package/src/analysis-assets/prompt.zh-CN.txt +1 -1
  16. package/src/analysis-history.cjs +27 -6
  17. package/src/analysis-service.cjs +1 -1
  18. package/src/antigravity-card.cjs +516 -88
  19. package/src/antigravity-hook.cjs +12 -7
  20. package/src/antigravity-mcp-config.cjs +45 -15
  21. package/src/cli/setup-orchestrator.cjs +6 -4
  22. package/src/harnesses/antigravity/antigravity-harness.js +159 -73
  23. package/src/harnesses/claude/claude-harness.js +583 -2
  24. package/src/harnesses/claude/claude-host-helper.cjs +5 -2
  25. package/src/harnesses/claude/claude-service.cjs +57 -1
  26. package/src/harnesses/claude/claude-source.cjs +18 -5
  27. package/src/harnesses/codex/codex-card-bridge.js +19 -1
  28. package/src/harnesses/codex/codex-card.cjs +1 -1
  29. package/src/plugins/things/sidecars/things_board/index.html +275 -126
  30. package/src/plugins/things/sidecars/things_board/main.mjs +38 -5
  31. package/src/plugins/things/sidecars/things_board/styles.css +22 -6
  32. package/src/plugins/things/sidecars/things_board/ui-i18n.mjs +119 -1
  33. package/src/session-status.js +117 -26
  34. package/src/ui-foundation.cjs +119 -1
@@ -11,12 +11,45 @@
11
11
  return lang === 'en' ? fallback : (zhFallback || fallback);
12
12
  };
13
13
  const padding = new Map();
14
+ let lastSyncedThemeKey = '';
15
+ const syncClaudeThemeAccent = () => {
16
+ try {
17
+ const mode = document.documentElement?.dataset?.mode === 'light' ? 'light' : 'dark';
18
+ let codeTheme = mode === 'light' ? 'claude-light' : 'claude-dark';
19
+ try {
20
+ const rawPrefs = window.localStorage?.getItem('epitaxy-editor-prefs');
21
+ if (rawPrefs) {
22
+ const parsed = JSON.parse(rawPrefs);
23
+ const picked = mode === 'light' ? parsed?.state?.codeThemeLight : parsed?.state?.codeThemeDark;
24
+ if (typeof picked === 'string' && picked.trim()) codeTheme = picked.trim();
25
+ }
26
+ } catch {}
27
+ const p = window.__agentThingsPresentation;
28
+ const themes = p?.claudeCodeThemes || { 'claude-light': '#C6613F', 'claude-dark': '#D97757' };
29
+ const mappedAccent = themes[codeTheme] || (mode === 'light' ? '#C6613F' : '#D97757');
30
+ window.__agentThingsHostAccent = mappedAccent;
31
+ document.documentElement?.style?.setProperty('--agent-things-accent', mappedAccent);
32
+ const sig = `${mode}:${codeTheme}:${mappedAccent}`;
33
+ if (sig !== lastSyncedThemeKey && typeof window.__agentThingsClaudeSend === 'function') {
34
+ lastSyncedThemeKey = sig;
35
+ try {
36
+ window.__agentThingsClaudeSend(JSON.stringify({
37
+ type: 'theme-sync',
38
+ requestId: `theme-${Date.now().toString(36)}`,
39
+ mode,
40
+ codeTheme,
41
+ accent: mappedAccent,
42
+ }));
43
+ } catch {}
44
+ }
45
+ } catch {}
46
+ };
14
47
  const identity = row => row.closest('[data-row-key]')?.getAttribute('data-row-key');
15
48
  const mainButton = row => [...row.querySelectorAll('[data-row-main-button]')].find(node => node.closest('[data-row]') === row);
16
49
  const harness = {
17
50
  globalName: '__claudeSessionStatus',
18
51
  startupRows: () => [...document.querySelectorAll('.dframe-sidebar .df-session-list [data-row]')].filter(row => identity(row)?.startsWith('code:')),
19
- attributeFilter: ['data-row-key', 'data-selected', 'aria-current', 'class', 'hidden', 'aria-expanded', 'style', 'data-theme'],
52
+ attributeFilter: ['data-row-key', 'data-selected', 'aria-current', 'class', 'hidden', 'aria-expanded', 'style', 'data-theme', 'data-mode'],
20
53
  send: payload => window.__agentThingsClaudeSend(payload),
21
54
  isRowSelected: row => mainButton(row)?.getAttribute('aria-current') === 'page' || ['true', 'open', 'focused'].includes(row.getAttribute('data-selected')),
22
55
  unmount(entry) {
@@ -46,6 +79,7 @@
46
79
  '该会话的 Agent Things 插件未在运行。请在该会话输入 /reload-plugins 或先发送一条消息,再点一次。'));
47
80
  },
48
81
  reconcile({ mounted, unmount, attachHost, paint, paintVisibility, openPanel, closePanel, isPanelEntry }) {
82
+ syncClaudeThemeAccent();
49
83
  for (const [row, entry] of [...mounted]) {
50
84
  if (!row.isConnected || !entry.host.isConnected || identity(row) !== `code:${entry.threadId}`) unmount(entry);
51
85
  }
@@ -79,15 +113,562 @@
79
113
  mounted.set(row, entry); paint(entry);
80
114
  }
81
115
  },
82
- dispose() { delete window.__sessionStatusHarness; },
116
+ dispose() { window.removeEventListener?.('storage', syncClaudeThemeAccent); window.removeEventListener?.('focus', syncClaudeThemeAccent); delete window.__sessionStatusHarness; },
83
117
  };
118
+ window.addEventListener?.('storage', syncClaudeThemeAccent);
119
+ window.addEventListener?.('focus', syncClaudeThemeAccent);
120
+ syncClaudeThemeAccent();
84
121
  window.__sessionStatusHarness = harness;
85
122
  })();
86
123
 
124
+ // <generated-presentation-fallback>
125
+ if (typeof globalThis !== 'undefined' && !globalThis.__agentThingsPresentation) {
126
+ globalThis.__agentThingsPresentation = (function createPresentation(lang) {
127
+ const normalizeLang = value => (value === 'en' ? 'en' : 'zh');
128
+ const currentLang = normalizeLang(lang ?? (typeof globalThis !== 'undefined' ? globalThis.__agentThingsLang : undefined));
129
+ const colors = { unstarted: '#9098a2', unfinished: '#c89b38', completed: '#548eea', pushed: '#a17be3' };
130
+ const layout = { contentWidth: 300, panelWidth: 340, progressNodes: [0, 25, 50, 75, 100] };
131
+ const accent = { normal: '#0169CC', hover: '#005bb3', pressed: '#004f9c', onAccent: '#FFFFFF' };
132
+ const claudeCodeThemes = {
133
+ 'claude-light': '#C6613F',
134
+ 'claude-dark': '#D97757',
135
+ 'github-light': '#0969DA',
136
+ 'github-light-high-contrast': '#0550AE',
137
+ 'github-dark': '#1F6FEB',
138
+ 'github-dark-dimmed': '#316DCA',
139
+ 'github-dark-high-contrast': '#409EFF',
140
+ 'pierre-light': '#0073E6',
141
+ 'pierre-dark': '#0087EE',
142
+ 'vscode-light': '#007ACC',
143
+ 'vscode-dark': '#007ACC',
144
+ 'one-light': '#4078F2',
145
+ 'one-dark-pro': '#61AFEF',
146
+ 'catppuccin-latte': '#8839EF',
147
+ 'catppuccin-mocha': '#CBA6F7',
148
+ 'solarized-light': '#268BD2',
149
+ 'solarized-dark': '#268BD2',
150
+ 'vitesse-light': '#4D9375',
151
+ 'vitesse-dark': '#4D9375',
152
+ 'min-light': '#256ABF',
153
+ 'min-dark': '#5598E7',
154
+ 'rose-pine-dawn': '#D7827E',
155
+ 'rose-pine': '#EA9A97',
156
+ 'slack-ochin': '#1264A3',
157
+ 'slack-dark': '#36C5F0',
158
+ 'dracula': '#BD93F9',
159
+ 'dracula-soft': '#BD93F9',
160
+ 'nord': '#88C0D0',
161
+ 'monokai': '#F92672',
162
+ 'tokyo-night': '#7AA2F7',
163
+ 'night-owl': '#82AAFF',
164
+ 'ayu-dark': '#E6B450',
165
+ };
166
+
167
+ function normalizeHexColor(value, fallback = null) {
168
+ if (typeof value !== 'string') return fallback;
169
+ const raw = value.trim();
170
+ if (/^#[0-9a-fA-F]{6}$/.test(raw)) return raw.toUpperCase();
171
+ if (/^#[0-9a-fA-F]{3}$/.test(raw)) {
172
+ return `#${raw[1]}${raw[1]}${raw[2]}${raw[2]}${raw[3]}${raw[3]}`.toUpperCase();
173
+ }
174
+ const rgbMatch = raw.match(/^rgba?\(\s*(\d{1,3})\s*[,\s]\s*(\d{1,3})\s*[,\s]\s*(\d{1,3})/i);
175
+ if (rgbMatch) {
176
+ const toHex = n => Math.max(0, Math.min(255, Number(n))).toString(16).padStart(2, '0');
177
+ return `#${toHex(rgbMatch[1])}${toHex(rgbMatch[2])}${toHex(rgbMatch[3])}`.toUpperCase();
178
+ }
179
+ return fallback;
180
+ }
181
+
182
+ function hexToRgb(hex) {
183
+ const clean = normalizeHexColor(hex, '#0169CC').slice(1);
184
+ return [
185
+ parseInt(clean.slice(0, 2), 16),
186
+ parseInt(clean.slice(2, 4), 16),
187
+ parseInt(clean.slice(4, 6), 16),
188
+ ];
189
+ }
190
+
191
+ function getRelativeLuminance(hex) {
192
+ const [r, g, b] = hexToRgb(hex).map(channel => {
193
+ const srgb = channel / 255;
194
+ return srgb <= 0.03928 ? srgb / 12.92 : ((srgb + 0.055) / 1.055) ** 2.4;
195
+ });
196
+ return 0.2126 * r + 0.7152 * g + 0.0722 * b;
197
+ }
87
198
 
199
+ function mixHexColors(hexA, hexB, weightA) {
200
+ const [r1, g1, b1] = hexToRgb(hexA);
201
+ const [r2, g2, b2] = hexToRgb(hexB);
202
+ const wA = Math.max(0, Math.min(1, weightA));
203
+ const wB = 1 - wA;
204
+ const toHex = n => Math.max(0, Math.min(255, Math.round(n))).toString(16).padStart(2, '0');
205
+ return `#${toHex(r1 * wA + r2 * wB)}${toHex(g1 * wA + g2 * wB)}${toHex(b1 * wA + b2 * wB)}`.toUpperCase();
206
+ }
88
207
 
208
+ function resolveAccentPalette(rawColor, { isDark = true, fallback = '#0169CC' } = {}) {
209
+ const normal = normalizeHexColor(rawColor, normalizeHexColor(fallback, '#0169CC'));
210
+ const lum = getRelativeLuminance(normal);
211
+ const onAccent = lum > 0.45 ? '#0D0D0D' : '#FFFFFF';
212
+ // Darken bright accents or shade toward dark/light ink subtly without losing hue identity.
213
+ const mixTarget = lum > 0.45 ? '#000000' : (isDark ? '#FFFFFF' : '#000000');
214
+ const hoverWeight = lum > 0.45 ? 0.88 : (isDark ? 0.88 : 0.88);
215
+ const pressedWeight = lum > 0.45 ? 0.78 : (isDark ? 0.78 : 0.78);
216
+ return {
217
+ normal,
218
+ hover: mixHexColors(normal, mixTarget, hoverWeight),
219
+ pressed: mixHexColors(normal, mixTarget, pressedWeight),
220
+ onAccent,
221
+ };
222
+ }
89
223
 
224
+ const locales = {
225
+ zh: {
226
+ appTitle: 'Agent Things',
227
+ docTitleSuffix: '任务进展',
228
+ defaultDocTitle: 'Agent Things 会话任务进度',
229
+ defaultSessionTitle: '当前会话',
230
+ fallbackShortTitle: '会话进度',
231
+ fallbackThreadTitle: '会话',
232
+ labels: {
233
+ unstarted: '尚未开始',
234
+ unfinished: '有遗留事项',
235
+ completed: '全部完成',
236
+ pushed: '全部完成并已推送',
237
+ },
238
+ taskLabels: {
239
+ todo: '待开始',
240
+ in_progress: '进行中',
241
+ blocked: '受阻',
242
+ needs_verification: '待验收',
243
+ done: '已完成',
244
+ unknown: '状态未知',
245
+ },
246
+ unrecordedSummary: '尚未记录进展',
247
+ unorganized: '未整理',
248
+ progressUnrecorded: '进度未记录',
249
+ sidebarUpdating: '正在更新进度',
250
+ sidebarTooltipPattern: '{title}:{status},点击记录任务进展',
251
+ noTasksYet: '暂无任务统计',
252
+ totalsPattern: '已完成 {done} / {total} 项任务',
253
+ basisPattern: '已完成 {done}/{total} 项任务,剩余 {remaining} 项({remainingPercent}%)',
254
+ basisEmpty: '暂无任务',
255
+ sourceAuto: '自动分析',
256
+ sourceManual: '手动调整',
257
+ sourceManualRecord: '手动记录',
258
+ btnUpdate: '更新进度',
259
+ btnUpdating: '正在分析…',
260
+ btnAdjust: '手动调整',
261
+ btnClear: '清除进度',
262
+ clearTooltip: '立即清除进度与任务记录',
263
+ clearConfirm: '确定要清除本会话的任务进度和记录吗?',
264
+ clearingFeedback: '正在清除…',
265
+ clearedFeedback: '✓ 已清空进度',
266
+ clearFailedPrefix: '清除失败: ',
267
+ openInSidebar: '在侧栏打开',
268
+ openPaneFailedPrefix: '打开侧栏失败: ',
269
+ close: '关闭',
270
+ expandAll: '查看全部',
271
+ collapse: '收起',
272
+ remainingHeadingPattern: '剩余任务 {count}',
273
+ showAllCountPattern: '查看全部 {count} 条 ›',
274
+ collapseArrow: '收起 ›',
275
+ emptyNoTasks: '点击更新进度,整理这次会话的任务',
276
+ emptyNoRemaining: '暂无未完成任务',
277
+ completedHeading: '已完成任务',
278
+ countArrowPattern: '{count} 条 ›',
279
+ notesLabel: '备注',
280
+ addLabel: '添加',
281
+ editLabel: '编辑',
282
+ untitledTask: '未命名事项',
283
+ completedTaskFallback: '已完成事项',
284
+ viewSource: '查看来源',
285
+ viewSourceAriaPrefix: '查看来源:',
286
+ backLabel: '‹ 返回',
287
+ backPlain: '返回',
288
+ emptyCompleted: '暂无已完成任务',
289
+ emptySourceText: '此记录没有可显示的原文',
290
+ editHeading: '手动记录会话状态',
291
+ progressLabel: '进度',
292
+ progressAltPattern: '进度 {value}%',
293
+ progressUnrecordedWord: '未记录',
294
+ currentProgressAlt: '当前进度',
295
+ clearValueBtn: '清空进度',
296
+ notePlaceholder: '记下下一步要做的事…',
297
+ noteAriaLabel: '事项备注',
298
+ sliderAriaLabel: '拖动调整进度',
299
+ cancelBtn: '取消',
300
+ saveBtn: '保存记录',
301
+ savingBtn: '正在保存…',
302
+ savingFeedback: '正在保存…',
303
+ savedFeedback: '✓ 保存成功',
304
+ saveFailedPrefix: '保存失败: ',
305
+ conflictBanner: '保存冲突:内容已被其他入口修改。当前草稿已保留。',
306
+ conflictShortToast: '保存冲突,已保留当前草稿',
307
+ conflictDetectedFeedback: '保存失败:检测到版本冲突',
308
+ resolveConflictBtn: '读取最新版本并保留草稿',
309
+ conflictRebasedFeedback: '基准版本已对齐最新状态,再次点击保存即可提交当前草稿。',
310
+ conflictReloadedFeedback: '已读取最新版本,草稿已保留。再次保存即可提交。',
311
+ timelineHeading: '进展记录',
312
+ timelineLink: '进展记录 ›',
313
+ emptyTimeline: '暂无进展记录',
314
+ dividerAlt: '分隔线',
315
+ loadingTitle: '正在读取会话进度…',
316
+ loadingAlt: '加载中',
317
+ loadingTasksAlt: '正在加载任务列表',
318
+ loadingSubtitle: '正在同步当前会话任务,完成后将自动更新…',
319
+ notLoadedTitle: '尚未读取到会话进度',
320
+ notLoadedAlt: '未读取',
321
+ retryLoadBtn: '重试读取',
322
+ processing: '正在处理…',
323
+ retryingStatus: '状态查询暂时失败,正在重试…',
324
+ locatingMessage: '正在定位消息…',
325
+ locatingShort: '定位中...',
326
+ locatingSourceMessage: '正在定位来源消息…',
327
+ locatedMessage: '已定位来源',
328
+ locatedJumpMessage: '已跳转并定位到会话来源',
329
+ locateSent: '已发送定位请求',
330
+ locateFailedPrefix: '定位失败:',
331
+ locateHostUnavailable: '未能连接宿主定位接口',
332
+ locateNotFound: '未找到对应会话消息',
333
+ locateUnsupported: '当前环境不支持跳转来源',
334
+ locateTimeout: '定位来源超时,请在原会话中确认历史消息',
335
+ locateNoSource: '此记录没有可定位的消息',
336
+ locateHostDisconnected: '当前宿主未连接,暂时无法定位来源消息',
337
+ locateOpenFailed: '无法打开来源会话',
338
+ locateUnavailable: '暂时无法定位来源消息',
339
+ locateCommandErrorPrefix: '跳转失败:',
340
+ startingAnalysisFeedback: '正在开始分析…',
341
+ updateFailedPrefix: '更新失败: ',
342
+ analysisNotDonePrefix: '分析未完成: ',
343
+ analysisFailedPrefix: '分析失败:',
344
+ analysisFailedWord: '分析失败',
345
+ analyzingWord: '分析中',
346
+ analysisFailedRetry: '请重试',
347
+ analysisAbnormal: '执行异常',
348
+ analysisStages: {
349
+ starting: '正在启动分析…',
350
+ reading: '正在读取会话…',
351
+ analyzing: '正在分析任务…',
352
+ retrying: '正在重新连接…',
353
+ },
354
+ invalidProgressError: '请输入 0–100 的整数,或留空',
355
+ unknownActionError: '未知错误',
356
+ gitCheckUnavailable: '暂时无法检测 Git 信息',
357
+ sidebarHintText: '如需启用侧边栏插件,请打开「开发者 → Enable Main Process Debugger」。',
358
+ dismissHint: '不再提醒',
359
+ updateStages: {
360
+ queued: '正在准备升级',
361
+ checking: '正在检查版本',
362
+ downloading: '正在下载新版本',
363
+ waiting: '等待当前分析结束',
364
+ installing: '正在升级',
365
+ },
366
+ updateAvailablePattern: '发现新版本 v{version}',
367
+ upgradedToPattern: '已升级至 v{version}',
368
+ updateFailedLabel: '升级失败',
369
+ upgradeBtn: '立即升级',
370
+ upgradingShort: '正在升级…',
371
+ pleaseWait: '请稍候',
372
+ completedShort: '已完成',
373
+ retryBtn: '重试',
374
+ terminalUpgradePrefix: '终端升级:',
375
+ reconnectHint: '正在重新连接后台,升级状态将在连接后恢复',
376
+ reconnectMcpHint: '请在客户端重新连接 MCP 服务',
377
+ cardCommandDescription: '打开会话任务进度卡片',
378
+ cardCommandReply: 'Agent Things · 会话任务进度',
379
+ cardMissingSession: '卡片缺少当前会话信息',
380
+ cardAuthUnavailable: '卡片授权不可用,请重新打开会话进度卡片',
381
+ cardSyncUnavailable: '卡片同步暂不可用',
382
+ cardTimeout: '卡片连接超时',
383
+ cardClosed: '卡片已关闭',
384
+ cardOpFailed: '卡片操作失败',
385
+ cardRequestCancelled: '请求已取消',
386
+ cardRequestTimeout: '请求超时,请重试',
387
+ cardStatusDisconnected: '状态连接暂不可用',
388
+ cardDaemonDisconnected: '本地进程已断开',
389
+ claudeInlineOffline: '本地后台连接失败',
390
+ mdProgressHeading: '当前会话任务进度',
391
+ mdStateDone: '全部完成 (100%)',
392
+ mdStateUnstarted: '未开始',
393
+ mdTasksOverview: '任务总览',
394
+ mdTasksEmpty: '暂无任务清单',
395
+ mdNotesLabel: '会话备注',
396
+ mdQuickActionsLabel: '快捷交互',
397
+ mdQuickActionsText: '可在卡片中点击“手动调整”滑动调整进度或修改备注,或点击“更新进度”开始自动分析。',
398
+ hookPresentedMessage: '已呈现当前会话任务进度卡片',
399
+ noSessionBadge: '无会话',
400
+ offlineBadge: '离线',
401
+ badgeNotOrganized: '未整理',
402
+ badgeProgressUnrecordedSuffix: ' · 进度未记录',
403
+ ringAriaPattern: '{title}:{summary},点击记录任务进展',
404
+ ringUpdating: '正在更新进度',
405
+ sessionFallbackTitle: '会话',
406
+ statusUnrecorded: '尚未记录进展',
407
+ panelAriaPattern: '{title} 任务进展',
408
+ totalsEmpty: '暂无任务统计',
409
+ taskUnknown: '状态未知',
410
+ timelineAnalysis: '自动分析',
411
+ timelineManual: '手动记录',
412
+ unrecordedShort: '未记录',
413
+ },
414
+ en: {
415
+ appTitle: 'Agent Things',
416
+ docTitleSuffix: 'Progress',
417
+ defaultDocTitle: 'Agent Things Progress',
418
+ defaultSessionTitle: 'Current session',
419
+ fallbackShortTitle: 'Session progress',
420
+ fallbackThreadTitle: 'Session',
421
+ labels: {
422
+ unstarted: 'Not started',
423
+ unfinished: 'Remaining items',
424
+ completed: 'Completed',
425
+ pushed: 'Completed & pushed',
426
+ },
427
+ taskLabels: {
428
+ todo: 'To do',
429
+ in_progress: 'In progress',
430
+ blocked: 'Blocked',
431
+ needs_verification: 'Needs verification',
432
+ done: 'Done',
433
+ unknown: 'Unknown status',
434
+ },
435
+ unrecordedSummary: 'No progress recorded',
436
+ unorganized: 'Not organized',
437
+ progressUnrecorded: 'Progress not recorded',
438
+ sidebarUpdating: 'Updating progress',
439
+ sidebarTooltipPattern: '{title}: {status} · Click to track progress',
440
+ noTasksYet: 'No task stats yet',
441
+ totalsPattern: '{done} of {total} tasks done',
442
+ basisPattern: 'Completed {done}/{total} tasks, {remaining} remaining ({remainingPercent}%)',
443
+ basisEmpty: 'No tasks yet',
444
+ sourceAuto: 'Auto-analyzed',
445
+ sourceManual: 'Manual',
446
+ sourceManualRecord: 'Manual',
447
+ btnUpdate: 'Update progress',
448
+ btnUpdating: 'Analyzing...',
449
+ btnAdjust: 'Adjust',
450
+ btnClear: 'Clear',
451
+ clearTooltip: 'Clear progress and task records now',
452
+ clearConfirm: 'Clear progress and task records for this session?',
453
+ clearingFeedback: 'Clearing...',
454
+ clearedFeedback: '✓ Cleared',
455
+ clearFailedPrefix: 'Clear failed: ',
456
+ openInSidebar: 'Open in sidebar',
457
+ openPaneFailedPrefix: 'Open sidebar failed: ',
458
+ close: 'Close',
459
+ expandAll: 'Show all',
460
+ collapse: 'Collapse',
461
+ remainingHeadingPattern: 'Remaining tasks ({count})',
462
+ showAllCountPattern: 'Show all {count} ›',
463
+ collapseArrow: 'Collapse ›',
464
+ emptyNoTasks: 'Click Update progress to organize tasks for this session',
465
+ emptyNoRemaining: 'No remaining tasks',
466
+ completedHeading: 'Completed tasks',
467
+ countArrowPattern: '{count} ›',
468
+ notesLabel: 'Notes',
469
+ addLabel: 'Add',
470
+ editLabel: 'Edit',
471
+ untitledTask: 'Untitled task',
472
+ completedTaskFallback: 'Completed task',
473
+ viewSource: 'View source',
474
+ viewSourceAriaPrefix: 'View source: ',
475
+ backLabel: '‹ Back',
476
+ backPlain: 'Back',
477
+ emptyCompleted: 'No completed tasks',
478
+ emptySourceText: 'No original message text available for this record',
479
+ editHeading: 'Set session status',
480
+ progressLabel: 'Progress',
481
+ progressAltPattern: 'Progress {value}%',
482
+ progressUnrecordedWord: 'unrecorded',
483
+ currentProgressAlt: 'Current progress',
484
+ clearValueBtn: 'Clear value',
485
+ notePlaceholder: 'Add next steps or notes...',
486
+ noteAriaLabel: 'Session notes',
487
+ sliderAriaLabel: 'Drag to adjust progress',
488
+ cancelBtn: 'Cancel',
489
+ saveBtn: 'Save',
490
+ savingBtn: 'Saving...',
491
+ savingFeedback: 'Saving...',
492
+ savedFeedback: '✓ Saved',
493
+ saveFailedPrefix: 'Save failed: ',
494
+ conflictBanner: 'Save conflict: updated elsewhere. Your draft has been kept.',
495
+ conflictShortToast: 'Save conflict, draft kept',
496
+ conflictDetectedFeedback: 'Save failed: revision conflict detected',
497
+ resolveConflictBtn: 'Load latest & keep draft',
498
+ conflictRebasedFeedback: 'Synced to latest version. Click Save again to submit your draft.',
499
+ conflictReloadedFeedback: 'Loaded latest version with draft preserved. Save again to submit.',
500
+ timelineHeading: 'Timeline',
501
+ timelineLink: 'Timeline ›',
502
+ emptyTimeline: 'No activity yet',
503
+ dividerAlt: 'Divider',
504
+ loadingTitle: 'Loading session progress...',
505
+ loadingAlt: 'Loading',
506
+ loadingTasksAlt: 'Loading task list',
507
+ loadingSubtitle: 'Syncing session tasks, will update automatically...',
508
+ notLoadedTitle: 'Session progress not loaded yet',
509
+ notLoadedAlt: 'Not loaded',
510
+ retryLoadBtn: 'Retry',
511
+ processing: 'Processing...',
512
+ retryingStatus: 'Status check failed, retrying...',
513
+ locatingMessage: 'Locating message...',
514
+ locatingShort: 'Locating...',
515
+ locatingSourceMessage: 'Locating source message...',
516
+ locatedMessage: 'Source located',
517
+ locatedJumpMessage: 'Jumped to source message',
518
+ locateSent: 'Locate request sent',
519
+ locateFailedPrefix: 'Locate failed: ',
520
+ locateHostUnavailable: 'Unable to reach host locate API',
521
+ locateNotFound: 'Source message not found',
522
+ locateUnsupported: 'Jumping to source is not supported here',
523
+ locateTimeout: 'Locate timed out. Please check conversation history.',
524
+ locateNoSource: 'No locatable source message for this item',
525
+ locateHostDisconnected: 'Host is disconnected, unable to locate source message',
526
+ locateOpenFailed: 'Unable to open source session',
527
+ locateUnavailable: 'Unable to locate source message right now',
528
+ locateCommandErrorPrefix: 'Jump failed: ',
529
+ startingAnalysisFeedback: 'Starting analysis...',
530
+ updateFailedPrefix: 'Update failed: ',
531
+ analysisNotDonePrefix: 'Analysis incomplete: ',
532
+ analysisFailedPrefix: 'Analysis failed: ',
533
+ analysisFailedWord: 'Analysis failed',
534
+ analyzingWord: 'Analyzing',
535
+ analysisFailedRetry: 'please retry',
536
+ analysisAbnormal: 'execution error',
537
+ analysisStages: {
538
+ starting: 'Starting analysis...',
539
+ reading: 'Reading session...',
540
+ analyzing: 'Analyzing tasks...',
541
+ retrying: 'Reconnecting...',
542
+ },
543
+ invalidProgressError: 'Enter an integer 0–100, or leave blank',
544
+ unknownActionError: 'Unknown error',
545
+ gitCheckUnavailable: 'Git status unavailable right now',
546
+ sidebarHintText: 'To enable the sidebar pane, open Developer → Enable Main Process Debugger.',
547
+ dismissHint: 'Dismiss',
548
+ updateStages: {
549
+ queued: 'Preparing upgrade',
550
+ checking: 'Checking version',
551
+ downloading: 'Downloading update',
552
+ waiting: 'Waiting for analysis to finish',
553
+ installing: 'Upgrading',
554
+ },
555
+ updateAvailablePattern: 'Update available v{version}',
556
+ upgradedToPattern: 'Upgraded to v{version}',
557
+ updateFailedLabel: 'Upgrade failed',
558
+ upgradeBtn: 'Upgrade',
559
+ upgradingShort: 'Upgrading...',
560
+ pleaseWait: 'Please wait',
561
+ completedShort: 'Done',
562
+ retryBtn: 'Retry',
563
+ terminalUpgradePrefix: 'Terminal upgrade: ',
564
+ reconnectHint: 'Reconnecting to background service; upgrade status will resume shortly',
565
+ reconnectMcpHint: 'Please reconnect the MCP server in your client',
566
+ cardCommandDescription: 'Open session task progress card',
567
+ cardCommandReply: 'Agent Things · Session Progress',
568
+ cardMissingSession: 'Card is missing current session info',
569
+ cardAuthUnavailable: 'Card authorization unavailable; please reopen the card',
570
+ cardSyncUnavailable: 'Card sync unavailable',
571
+ cardTimeout: 'Card connection timed out',
572
+ cardClosed: 'Card closed',
573
+ cardOpFailed: 'Card action failed',
574
+ cardRequestCancelled: 'Request cancelled',
575
+ cardRequestTimeout: 'Request timed out, please retry',
576
+ cardStatusDisconnected: 'Status connection unavailable',
577
+ cardDaemonDisconnected: 'Local service disconnected',
578
+ claudeInlineOffline: 'Local service connection failed',
579
+ mdProgressHeading: 'Session task progress',
580
+ mdStateDone: 'Completed (100%)',
581
+ mdStateUnstarted: 'Not started',
582
+ mdTasksOverview: 'Overview',
583
+ mdTasksEmpty: 'No task checklist yet',
584
+ mdNotesLabel: 'Session notes',
585
+ mdQuickActionsLabel: 'Quick actions',
586
+ mdQuickActionsText: 'Click "Adjust" on the card to set progress/notes manually, or click "Update progress" to auto-analyze.',
587
+ hookPresentedMessage: 'Session task progress card presented',
588
+ noSessionBadge: 'No session',
589
+ offlineBadge: 'Offline',
590
+ badgeNotOrganized: 'Not organized',
591
+ badgeProgressUnrecordedSuffix: ' · Progress unrecorded',
592
+ ringAriaPattern: '{title}: {summary}. Click to track progress',
593
+ ringUpdating: 'Updating progress',
594
+ sessionFallbackTitle: 'Session',
595
+ statusUnrecorded: 'No progress recorded',
596
+ panelAriaPattern: '{title} Task Progress',
597
+ totalsEmpty: 'No task metrics yet',
598
+ taskUnknown: 'Unknown status',
599
+ timelineAnalysis: 'Auto analysis',
600
+ timelineManual: 'Manual record',
601
+ unrecordedShort: 'Unrecorded',
602
+ },
603
+ };
90
604
 
605
+ function format(template, vars = {}) {
606
+ return String(template || '').replace(/\{(\w+)\}/g, (_, k) => (vars[k] !== undefined ? String(vars[k]) : ''));
607
+ }
91
608
 
609
+ function forLang(targetLang) {
610
+ const code = normalizeLang(targetLang);
611
+ const dict = locales[code];
612
+ return {
613
+ lang: code,
614
+ strings: dict,
615
+ labels: dict.labels,
616
+ taskLabels: dict.taskLabels,
617
+ t(key, vars) {
618
+ return format(dict[key] ?? locales.zh[key] ?? key, vars);
619
+ },
620
+ formatDate(value) {
621
+ if (!value) return '';
622
+ const d = new Date(value);
623
+ if (Number.isNaN(d.getTime())) return '';
624
+ return `${d.getMonth() + 1}/${d.getDate()} ${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
625
+ },
626
+ };
627
+ }
92
628
 
629
+ function progressValue(value, dragging = false) {
630
+ value = Math.max(0, Math.min(100, Math.round(value)));
631
+ const nearest = Math.round(value / 25) * 25;
632
+ return dragging && Math.abs(value - nearest) <= 2 ? nearest : value;
633
+ }
634
+ function progressState(state, value) {
635
+ return value === 100 ? state === 'pushed' ? 'pushed' : 'completed'
636
+ : value === 0 && state === 'unstarted' ? 'unstarted' : 'unfinished';
637
+ }
638
+ function draftTransition(current, event) {
639
+ if (event.type === 'begin') return { draft: { state: event.record?.state || 'unfinished', progress: event.record?.progress ?? null, note: event.record?.note || '' }, baseRevision: event.revision ?? event.record?.revision ?? 0, conflict: false };
640
+ if (event.type === 'patch') return { ...current, draft: { ...current.draft, ...event.patch } };
641
+ if (event.type === 'conflict') return { ...current, conflict: true };
642
+ if (event.type === 'rebase') return { ...current, baseRevision: event.revision, conflict: false };
643
+ if (event.type === 'saved' || event.type === 'cleared') return { draft: null, baseRevision: event.revision, conflict: false };
644
+ return current;
645
+ }
646
+ function analysisDisabled(busy, analyzing, upgradeStage) {
647
+ return Boolean(busy || analyzing || ['waiting', 'installing'].includes(upgradeStage));
648
+ }
93
649
 
650
+ const active = forLang(currentLang);
651
+ return {
652
+ lang: active.lang,
653
+ labels: active.labels,
654
+ colors,
655
+ taskLabels: active.taskLabels,
656
+ strings: active.strings,
657
+ locales,
658
+ layout,
659
+ accent,
660
+ claudeCodeThemes,
661
+ normalizeHexColor,
662
+ resolveAccentPalette,
663
+ t: active.t,
664
+ format,
665
+ forLang,
666
+ formatDate: active.formatDate,
667
+ progressValue,
668
+ progressState,
669
+ draftTransition,
670
+ analysisDisabled,
671
+ };
672
+ })(globalThis.__agentThingsLang);
673
+ }
674
+ // </generated-presentation-fallback>
@@ -130,10 +130,13 @@ function installClaudeHost({ root, credentialFile }) {
130
130
  if (refreshing || stopped) return;
131
131
  refreshing = true;
132
132
  try {
133
- const resources = [path.join(root, 'src/harnesses/claude/claude-harness.js'), path.join(root, 'src/session-status.js')];
133
+ const foundationFile = path.join(root, 'src/ui-foundation.cjs');
134
+ const resources = [foundationFile, path.join(root, 'src/harnesses/claude/claude-harness.js'), path.join(root, 'src/session-status.js')];
134
135
  const stamp = resources.map(file => { const stat = fs.statSync(file); return `${stat.mtimeMs}:${stat.size}`; }).join('|');
135
136
  if (stamp !== resourceStamp) {
136
- source = resources.map(file => fs.readFileSync(file, 'utf8')).join('\n');
137
+ const foundationCode = fs.readFileSync(foundationFile, 'utf8');
138
+ const foundationInit = `(() => { const module = { exports: {} }; ${foundationCode}\nglobalThis.__agentThingsPresentation = module.exports.createPresentation(globalThis.__agentThingsLang); })();`;
139
+ source = [foundationInit, ...resources.slice(1).map(file => fs.readFileSync(file, 'utf8'))].join('\n');
137
140
  lastVersion = crypto.createHash('sha256').update(source).digest('hex'); resourceStamp = stamp;
138
141
  }
139
142
  for (const w of webContents.getAllWebContents()) if (eligible(w)) watch(w);