agentworkshop 0.17.3 → 0.17.5

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 (53) hide show
  1. package/.output/nitro.json +1 -1
  2. package/.output/public/_nuxt/{Bi7O7Fgd.js → BIyCQj6O.js} +10 -10
  3. package/.output/public/_nuxt/BM-sWDDD.js +1 -0
  4. package/.output/public/_nuxt/Cu6Hle_d.js +2 -0
  5. package/.output/public/_nuxt/{B_6jgkkO.js → D4fDMDMY.js} +4 -4
  6. package/.output/public/_nuxt/{TownView.CASu6sUI.css → TownView.CngAEG0H.css} +1 -1
  7. package/.output/public/_nuxt/{_wsId_.1Ai43iyE.css → _wsId_.CzdXTLVh.css} +1 -1
  8. package/.output/public/_nuxt/builds/latest.json +1 -1
  9. package/.output/public/_nuxt/builds/meta/147c0379-4e07-437d-a7d2-e700d633efad.json +1 -0
  10. package/.output/public/_nuxt/{entry.CxkSJUk3.css → entry.D9gnKVzx.css} +1 -1
  11. package/.output/public/_nuxt/town.D-vq2IRd.css +1 -0
  12. package/.output/server/chunks/_/nitro.mjs +1071 -1071
  13. package/.output/server/chunks/build/{TownView-BF_qaNTQ.mjs → TownView-BdwjWlnU.mjs} +61 -9
  14. package/.output/server/chunks/build/TownView-BdwjWlnU.mjs.map +1 -0
  15. package/.output/server/chunks/build/{_wsId_-DGynuNjs.mjs → _wsId_-CLBiQH5c.mjs} +10 -8
  16. package/.output/server/chunks/build/{_wsId_-DGynuNjs.mjs.map → _wsId_-CLBiQH5c.mjs.map} +1 -1
  17. package/.output/server/chunks/build/{town-Cx6Vny3m.mjs → town-Djy_zAJV.mjs} +10 -7
  18. package/.output/server/chunks/build/{town-Cx6Vny3m.mjs.map → town-Djy_zAJV.mjs.map} +1 -1
  19. package/.output/server/chunks/routes/renderer.mjs +1 -1
  20. package/.output/server/chunks/virtual/entry.mjs +6 -2
  21. package/.output/server/chunks/virtual/precomputed.mjs +1 -1
  22. package/.output/server/package.json +1 -1
  23. package/README-zh.md +20 -6
  24. package/README.md +20 -6
  25. package/app/components/AppBackToMain.vue +86 -0
  26. package/app/components/workshop/console/Topbar.vue +2 -0
  27. package/app/components/workshop/town/components/TownTopNav.vue +2 -0
  28. package/app/pages/town.vue +15 -0
  29. package/config.yml +1 -1
  30. package/desktop/chrome/contract.mjs +59 -3
  31. package/desktop/chrome/preload-splash.cjs +29 -0
  32. package/desktop/chrome/preload.cjs +2 -0
  33. package/desktop/chrome/settings.mjs +24 -0
  34. package/desktop/chrome/splash.html +629 -0
  35. package/desktop/chrome/titlebar.html +8 -1
  36. package/desktop/chrome/tray-menu.mjs +56 -0
  37. package/desktop/main.mjs +694 -42
  38. package/desktop/sidecar.mjs +12 -2
  39. package/docs/cli.en.md +1 -1
  40. package/docs/cli.md +1 -1
  41. package/docs/desktop.md +21 -3
  42. package/docs/plugins.en.md +1 -1
  43. package/docs/plugins.md +1 -1
  44. package/docs/sdk.en.md +1 -1
  45. package/docs/sdk.md +1 -1
  46. package/i18n/locales/en.ts +2 -0
  47. package/i18n/locales/zh-CN.ts +2 -0
  48. package/package.json +223 -219
  49. package/.output/public/_nuxt/CkTQQ28a.js +0 -1
  50. package/.output/public/_nuxt/DhFEApxl.js +0 -2
  51. package/.output/public/_nuxt/builds/meta/e534f0d1-3bc5-444b-a033-3e437b713fc0.json +0 -1
  52. package/.output/public/_nuxt/town.BZPLR4A_.css +0 -1
  53. package/.output/server/chunks/build/TownView-BF_qaNTQ.mjs.map +0 -1
@@ -0,0 +1,56 @@
1
+ // Declarative tray menu model. Electron maps these descriptors to native menu
2
+ // items; unit tests can assert the exact user-facing surface without a display.
3
+
4
+ const SETTINGS = Object.freeze([
5
+ { key: 'closeToTray', label: '关闭时最小化到托盘' },
6
+ { key: 'launchAtLogin', label: '开机自动启动' },
7
+ { key: 'startHidden', label: '启动后最小化到托盘' },
8
+ { key: 'trayNotifications', label: '托盘通知' },
9
+ { key: 'autoCheckUpdates', label: '自动检查更新' },
10
+ ])
11
+
12
+ function updateLabel(update) {
13
+ if (update?.status === 'available') return `查看新版本 v${update.version}`
14
+ if (update?.status === 'downloading') return `正在下载更新 ${Math.max(0, Math.min(100, Number(update.progress) || 0))}%`
15
+ if (update?.status === 'ready') return `安装 v${update.version} 并重启`
16
+ return '检查更新…'
17
+ }
18
+
19
+ export function buildTrayMenuModel({ settings, service, port, version, windowVisible, update }) {
20
+ const online = service === 'online'
21
+ const serviceLabel = online
22
+ ? `本机服务 · 运行中${port ? ` · 127.0.0.1:${port}` : ''}`
23
+ : service === 'offline' ? '本机服务 · 已断开' : '本机服务 · 启动中…'
24
+ const updateBusy = ['downloading', 'ready'].includes(update?.status)
25
+ return [
26
+ { id: 'open', label: windowVisible ? '打开 AgentWorkShop' : '显示主窗口' },
27
+ { id: 'reload', label: '重新加载界面', enabled: online },
28
+ { type: 'separator' },
29
+ { id: 'service-status', label: serviceLabel, enabled: false },
30
+ { id: 'restart-service', label: '重启本地服务…', enabled: online },
31
+ { type: 'separator' },
32
+ { id: 'check-update', label: updateLabel(update), enabled: !updateBusy && update?.status !== 'ready' },
33
+ { id: 'open-home', label: '打开数据目录' },
34
+ { id: 'open-logs', label: '打开日志目录' },
35
+ { id: 'diagnostics', label: '诊断信息…' },
36
+ { type: 'separator' },
37
+ {
38
+ id: 'settings',
39
+ label: '设置',
40
+ submenu: SETTINGS.map(item => ({
41
+ id: `setting:${item.key}`,
42
+ label: item.label,
43
+ type: 'checkbox',
44
+ checked: Boolean(settings?.[item.key]),
45
+ })),
46
+ },
47
+ { type: 'separator' },
48
+ { id: 'quit', label: `退出 AgentWorkShop${version ? ` ${version}` : ''}` },
49
+ ]
50
+ }
51
+
52
+ /** Settings entries for the tray submenu, also used for change notifications. */
53
+ export const TRAY_SETTINGS = SETTINGS
54
+
55
+ /** Settings keys exposed by the tray submenu; used to validate click payloads. */
56
+ export const TRAY_SETTING_KEYS = Object.freeze(SETTINGS.map(item => item.key))