zcode-pro 1.5.1 → 1.6.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 (46) hide show
  1. package/README.en.md +33 -21
  2. package/README.md +23 -13
  3. package/dist/inject.js +9803 -7820
  4. package/package.json +3 -2
  5. package/src/host/cdp.mjs +13 -3
  6. package/src/host/helper.mjs +1591 -495
  7. package/src/host/main.mjs +412 -26
  8. package/src/host/paths.mjs +17 -9
  9. package/src/host/pickFolder.mjs +11 -4
  10. package/src/host/settings.mjs +15 -2
  11. package/src/host/setup.mjs +57 -18
  12. package/src/host/skill-stats.mjs +163 -0
  13. package/src/host/taskIndex.mjs +198 -66
  14. package/src/host/taskOrder.mjs +128 -57
  15. package/src/host/version.mjs +15 -7
  16. package/src/host/wallpaper.mjs +328 -0
  17. package/src/host/webdav.mjs +66 -10
  18. package/src/inject/core.js +300 -105
  19. package/src/inject/features/alias-migration.js +8 -4
  20. package/src/inject/features/alias.js +2 -2
  21. package/src/inject/features/auto-rename.js +166 -0
  22. package/src/inject/features/composer-provider.js +82 -63
  23. package/src/inject/features/copy-path.js +1 -1
  24. package/src/inject/features/file-menu.js +9 -3
  25. package/src/inject/features/idle-reclaim.js +31 -8
  26. package/src/inject/features/image-menu.js +2 -2
  27. package/src/inject/features/newtab-panels.js +13 -3
  28. package/src/inject/features/pinned-collapse.js +11 -3
  29. package/src/inject/features/plugin-card-retry.js +18 -8
  30. package/src/inject/features/project-menu.js +1 -1
  31. package/src/inject/features/relocate-dialog.js +2 -1
  32. package/src/inject/features/sandbox-reclaim.js +17 -1
  33. package/src/inject/features/session-link.js +200 -0
  34. package/src/inject/features/session-switch.js +61 -27
  35. package/src/inject/features/settings-dialog.js +544 -158
  36. package/src/inject/features/status-bar.js +126 -24
  37. package/src/inject/features/table-copy.js +18 -2
  38. package/src/inject/features/task-order.js +48 -14
  39. package/src/inject/features/theme.js +644 -99
  40. package/src/inject/features/title-gen.js +5 -4
  41. package/src/inject/features/title-lock.js +13 -8
  42. package/src/inject/features/turn-usage.js +69 -29
  43. package/src/inject/features/ws-running.js +32 -11
  44. package/src/inject/index.js +18 -1
  45. package/src/inject/provider-fields.js +2 -2
  46. package/src/inject/ui.js +91 -17
@@ -27,28 +27,33 @@ export function rpc(path, options = {}) {
27
27
 
28
28
  // 配置缓存:菜单每次打开时拉取,保证设置弹窗里的开关即时生效。
29
29
  // 并发合并:config-changed 事件的多个监听方会同时 getConfig(true)(绕过
30
- // 缓存),不合并时一次保存触发 N 个并发全量拉取(每个都是 helper 读盘+序列化)
30
+ // 缓存),不合并时一次保存触发 N 个并发全量拉取(每个都是 helper 读盘+序列化)。
31
+ // force 不并入在途请求:保存后的刷新必须拿到保存后的内容,并入保存前发起的
32
+ // 请求会拿到旧值、还会把旧值写回缓存
31
33
  let configCache = { value: null, at: 0 };
32
34
  let configInflight = null;
35
+ let configGen = 0; // clearConfigCache 时 +1,作废在途请求写缓存的资格
33
36
  export async function getConfig(force = false) {
34
37
  const now = Date.now();
35
38
  if (!force && configCache.value && now - configCache.at < 3000) return configCache.value;
36
- if (configInflight) return configInflight;
37
- configInflight = (async () => {
39
+ if (!force && configInflight) return configInflight;
40
+ const gen = configGen;
41
+ const p = (async () => {
38
42
  try {
39
43
  const res = await rpc('/config');
40
44
  if (res.ok && res.config) {
41
- configCache = { value: res.config, at: Date.now() };
45
+ if (gen === configGen) configCache = { value: res.config, at: Date.now() };
42
46
  return res.config;
43
47
  }
44
48
  return configCache.value || { features: {} };
45
49
  } finally {
46
- configInflight = null;
50
+ if (configInflight === p) configInflight = null;
47
51
  }
48
52
  })();
49
- return configInflight;
53
+ configInflight = p;
54
+ return p;
50
55
  }
51
- export function clearConfigCache() { configCache = { value: null, at: 0 }; }
56
+ export function clearConfigCache() { configCache = { value: null, at: 0 }; configGen++; }
52
57
 
53
58
  // 会话快捷切换的默认键位(按住 alt 再按);settings 的“快捷键”标签页可改,
54
59
  // 配置存在 config.shortcuts,未写的项回退到这里
@@ -62,8 +67,8 @@ export const DEFAULT_SHORTCUTS = {
62
67
 
63
68
  // 状态栏任务统计项的两个组:会话级跟随当前会话,全局级始终显示;
64
69
  // 设置里两节各自排序,保存时归一化为会话组在前(状态栏两组间一道竖线)
65
- export const STATUS_SESSION_IDS = new Set(['ctx', 'sessionCost', 'questions']);
66
- export const STATUS_GLOBAL_IDS = new Set(['todayTokens', 'todayCost', 'totalTokens', 'totalCost', 'tasks']);
70
+ export const STATUS_SESSION_IDS = new Set(['ctx', 'questions', 'tokRate']);
71
+ export const STATUS_GLOBAL_IDS = new Set(['todayTokens', 'totalTokens', 'tasks']);
67
72
 
68
73
  // 状态栏统计项的默认清单(顺序即默认显示顺序);设置 → 外观 → 状态栏里
69
74
  // 可调顺序与显隐,配置存在 config.statusBar.items(整表覆盖)
@@ -75,6 +80,7 @@ export const DEFAULT_TURN_ITEMS = [
75
80
  ];
76
81
 
77
82
  export const DEFAULT_STATUS_ITEMS = [
83
+ { id: 'tokRate', on: true }, // 最近输出 tokens/s(60 秒窗口,本会话)
78
84
  { id: 'ctx', on: true }, // 上下文占用
79
85
  { id: 'questions', on: true }, // 提问次数
80
86
  { id: 'todayTokens', on: true }, // 今日 token(今天的会话记录完整,数据准确)
@@ -84,16 +90,20 @@ export const DEFAULT_STATUS_ITEMS = [
84
90
 
85
91
  // —— ZCode 版本判断(按官方版本启用/停用功能)——
86
92
  // 版本来源:启动器从 app.asar 读出后写进 bootstrap(window.__ZCODEPRO__.zcodeVersion),
87
- // helper 的 /config 响应也附加同名字段。读不到时为空串,各判断保持旧行为。
93
+ // 只经注入 bootstrap 传进页面(helper 的 /config 响应不带这个字段)。读不到时为空串,
94
+ // 各判断保持旧行为。
88
95
  export function zcodeAppVersion() {
89
96
  const v = liveBoot().zcodeVersion;
90
97
  return typeof v === 'string' && v ? v : '';
91
98
  }
92
99
 
93
100
  export function zcodeVersionGte(version, major, minor, patch = 0) {
94
- const m = String(version || '').match(/^(\d+)\.(\d+)\.(\d+)/);
101
+ // 允许两段式版本("3.17")与前缀 v,缺省段按 0;预发布号(-rc.1 等)截在正式
102
+ // 版段后不参与比较、按正式版处理——取舍:预发布版也按新版启用功能,比误判回
103
+ // 老版本少丢功能
104
+ const m = String(version || '').match(/^v?(\d+)(?:\.(\d+))?(?:\.(\d+))?/);
95
105
  if (!m) return false;
96
- const a = Number(m[1]), b = Number(m[2]), c = Number(m[3]);
106
+ const a = Number(m[1]), b = Number(m[2] || 0), c = Number(m[3] || 0);
97
107
  return a > major || (a === major && (b > minor || (b === minor && c >= patch)));
98
108
  }
99
109
 
@@ -122,6 +132,39 @@ const zh = {
122
132
  tabProxy: '代理',
123
133
  tabBehavior: '行为',
124
134
  tabAgents: '全局提示词',
135
+ tabZcode: 'ZCode CLI',
136
+ zcodeDesc: 'ZCode 自身的行为配置(写入 ~/.zcode/cli/config.json),保存后对新会话生效。',
137
+ zcodeStatsTitle: '技能清单检查',
138
+ zcodeStatsCounts: '技能 {total} 个(本地 {user} · 插件 {plugin})',
139
+ zcodeStatsChars: '完整清单约 {n} 字符',
140
+ zcodeBudgetDefaultTag: '(默认值)',
141
+ zcodeStatsDegraded: '超出预算:完整清单放不下,降级为只剩技能名和路径,模型看不到技能描述',
142
+ zcodeStatsOk: '预算充足:清单带完整描述注入新会话',
143
+ zcodeStatsSuggest: '建议预算 {n} 字符(留 20% 余量)',
144
+ zcodeBudgetApply: '用建议值',
145
+ zcodeBudgetApplied: '清单预算已保存',
146
+ zcodeStatsNote: '按当前磁盘状态估算,不含各项目内的技能目录。',
147
+ zcodeSkillEnabled: '技能系统',
148
+ zcodeSkillEnabledDesc: 'skills.enabled:关闭后 ZCode 不再发现与注入任何技能',
149
+ zcodeSkillIncludeInstructions: '技能说明注入',
150
+ zcodeSkillIncludeInstructionsDesc: 'skills.includeInstructions:技能说明是否随清单一起注入',
151
+ zcodeSkillBudget: '技能清单预算(字符)',
152
+ zcodeSkillBudgetDesc: 'skills.metadataBudget:完整清单超过该长度就降级为只剩技能名和路径,默认 20000',
153
+ zcodeSkillRoots: '额外技能目录',
154
+ zcodeSkillRootsDesc: 'skills.roots:每行一个目录,目录下的技能会被发现(~/.zcode/skills、~/.agents/skills 之外的补充)',
155
+ zcodeSave: '保存',
156
+ zcodeRootsSaved: '技能目录已保存',
157
+ zcodeFeatCompact: '会话压缩',
158
+ zcodeFeatCompactDesc: 'features.compact:上下文过长时压缩早期会话内容',
159
+ zcodeFeatRewind: '会话回溯',
160
+ zcodeFeatRewindDesc: 'features.rewind:回退到较早节点重新继续',
161
+ zcodeFeatSubagent: '子代理',
162
+ zcodeFeatSubagentDesc: 'features.subagent:派出子代理处理子任务',
163
+ zcodeFeatSkill: '技能工具',
164
+ zcodeFeatSkillDesc: 'features.skill:Skill 工具可用(还需开启技能系统)',
165
+ zcodeFeatMcp: 'MCP 工具',
166
+ zcodeFeatMcpDesc: 'features.mcp:使用 MCP 服务器提供的工具',
167
+ zcodeMemoryHint: '记忆不在此处:工作区记忆在官方 设置 → Agent 能力 → 记忆 中开关(含记忆详情查看)。',
125
168
  agentsDesc: '写入 ~/.zcode/AGENTS.md,作为默认指令用于所有项目的每次会话;保存后从新会话起生效,项目内的 AGENTS.md 可补充或覆盖。内容超过 100KB 会被应用截断。',
126
169
  agentsPlaceholder: '填写希望所有项目默认遵循的指令;清空并保存即移除全局提示词',
127
170
  agentsSave: '保存',
@@ -163,7 +206,7 @@ const zh = {
163
206
  syncIncludeZcp: 'ZCode Pro 设置',
164
207
  syncIncludeZcpDesc: '功能开关、样式调整与代理设置;同步配置与凭据本身不参与同步。项目别名不同步(官方已支持改项目名)。',
165
208
  syncIncludeModel: '模型设置',
166
- syncIncludeModelDesc: '自定义供应商与模型配置(config.json 与 provider_config.json,含 API Key)。账号登录的凭据(如 BigModel 订阅)不参与同步,各机器用各自账号登录。',
209
+ syncIncludeModelDesc: '自定义供应商与模型配置(config.json 与 provider_config.json,含 API Key)与 Headroom 供应商映射(headroom.json,key 仅以 keyHash 存储、不含明文)。账号登录的凭据(如 BigModel 订阅)不参与同步,各机器用各自账号登录。',
167
210
  syncUpload: '上传到云端',
168
211
  syncDownload: '从云端下载',
169
212
  syncUploading: '上传中…',
@@ -232,10 +275,10 @@ const zh = {
232
275
  featureTaskOrder: '侧边栏会话拖动排序',
233
276
  featureTaskOrderDesc: '拖动调整置顶、项目与分组中的会话顺序,重启后不变。',
234
277
  featureSessionSwitch: '会话快捷切换',
235
- featureSessionSwitchDesc: '{last} 来回上次会话;alt+方向键/快捷键选最近会话;键位可改',
278
+ featureSessionSwitchDesc: '{last} 来回上次会话;按 alt+字母打开切换弹窗,弹窗里用方向键或快捷键选择;键位可改',
236
279
  featureTitleLock: '重命名会话名锁定',
237
280
  featureTitleLockDesc: '手动重命名过的会话不被自动标题覆盖,侧栏始终显示重命名后的名字。',
238
- tabTitleGen: '任务名提示词',
281
+ tabTitleGen: '自动重命名',
239
282
  titleGenShortDesc: '新会话开始作答时,按所选供应商与提示词生成任务名并按手动重命名保存,官方自动标题不再覆盖。',
240
283
  titleGenEnabled: '启用',
241
284
  titleGenProvider: '供应商',
@@ -259,6 +302,17 @@ const zh = {
259
302
  titleGenTesting: '生成中…',
260
303
  titleGenTestOk: '生成结果:',
261
304
  titleGenTestFailed: '生成失败',
305
+ // 手动“自动重命名”(任务行悬浮按钮 / 右键菜单入口)与其开关
306
+ titleGenManual: '手动重命名',
307
+ titleGenHoverBtn: '任务行悬浮按钮',
308
+ titleGenHoverBtnDesc: '鼠标悬停任务行时,在归档按钮旁显示“自动重命名”按钮。',
309
+ titleGenMenuEntry: '右键菜单项',
310
+ titleGenMenuEntryDesc: '任务右键菜单“重命名任务”下方显示“自动重命名”。',
311
+ titleGenRecentQa: '最近问答数',
312
+ titleGenRecentQaDesc: '手动重命名取会话最近几轮问答作为起名素材。',
313
+ autoRenameItem: '自动重命名',
314
+ autoRenameWorking: '正在生成任务名…',
315
+ autoRenameDone: '已重命名:',
262
316
  featureWsRunning: '折叠时任务运行中提示',
263
317
  featureWsRunningDesc: '有会话运行时,折叠的项目与任务分区头显示加载图标,全部结束消失。',
264
318
  tabPerformance: '性能',
@@ -281,7 +335,7 @@ const zh = {
281
335
  featureSandboxReclaimDesc: '沙箱满 64 个时自动释放最早的,新卡片不再打不开;旧卡重新打开所在会话即可恢复。',
282
336
  featurePluginCardRetry: '插件卡片自动重试',
283
337
  featurePluginCardRetryDesc: '因名额上限加载失败的插件卡片自动点击重新加载,名额空出后自动恢复。',
284
- visionCardUi: '思考过程显示识图卡片',
338
+ visionCardUi: '思考过程显示 Vision 卡片',
285
339
  pinnedToggleAria: '折叠/展开已置顶',
286
340
  sidebarProjectSpacingName: '项目间距',
287
341
  sidebarProjectSpacingDesc: '侧边栏中相邻项目行之间的视觉间距(含行内留白);设置后各分区(已置顶/项目/任务)之间的间距也统一为该值。',
@@ -306,16 +360,17 @@ const zh = {
306
360
  featureNewtabPanelsDesc: '新标签页加入第三方插件(headroom、rtk 等)的面板卡片,点击在侧边面板打开。',
307
361
  ntpDescSuffix: '插件面板',
308
362
  ntpNeedSession: '先打开一个任务会话,再从新标签页打开插件面板',
363
+ ntpOpenMissing: '当前界面没有打开插件面板的入口,无法从新标签页打开插件面板',
309
364
  featureStatusBarDesc: '提问输入框右下角和每轮回答最后显示统计项。',
310
365
  tabStylesPane: '样式',
311
366
  tabStatusPane: '状态栏',
312
367
  themeColorsPane: '主题',
313
368
  themeBgRegions: '分区背景',
314
- themeBgRegionFollow: '无背景',
369
+ themeBgRegionFollow: '跟随全局壁纸',
315
370
  themeBgRegionLeft: '左侧边栏',
316
371
  themeBgRegionCenter: '中间区域',
317
372
  themeBgRegionRight: '右侧边栏',
318
- themeBgPane: '背景图',
373
+ themeBgPane: '壁纸',
319
374
  themeSkinTitle: '皮肤',
320
375
  themeSkinDesc: '知名编辑器主题配色,自动匹配 ZCode 的浅色 / 深色模式;默认保持 ZCode 原样,自定义在下方自行调色。',
321
376
  themeSkinCustom: '自定义',
@@ -328,42 +383,62 @@ const zh = {
328
383
  themeCustomFg: '正文',
329
384
  themeCustomMuted: '次级文字',
330
385
  themeCustomAccent: '强调色',
331
- themeBgDesc: '背景来源可选本地图库、文件夹(定时轮换)或网址(定时刷新),左栏 / 中栏 / 右栏可分区独立设置;侧栏、会话流、输入框透出背景,弹窗菜单保持不透明保可读。本地图库随 WebDAV 同步上传(覆盖式,不留历史版本)。',
332
- themeBgModeNone: '无背景',
386
+ themeBgDesc: '壁纸支持图片、视频、网页三类,铺在界面后方;来源可选本地图库(单选一张)、文件夹(定时轮换)、图片网址(定时刷新)或网页地址;左栏 / 中栏 / 右栏可分区独立设置(仅静态图,缩放与遮罩可单独调)。侧栏、会话流、输入框和设置弹窗都可透出画面——设置弹窗是磨砂玻璃,磨砂效果可在本页关掉;右键菜单与其他弹窗保持不透明保可读。本地图库随 WebDAV 同步上传(覆盖式,不留历史版本)。',
387
+ themeBgModeNone: '无壁纸',
333
388
  themeBgModeLibrary: '本地图库',
334
389
  themeBgModeFolder: '文件夹',
335
- themeBgModeUrl: '网址',
390
+ themeBgModeUrl: '图片网址',
391
+ themeBgModeWeb: '网页',
336
392
  themeBgLibrary: '我的图库',
337
- themeBgUpload: '上传图片',
338
- themeBgEmpty: '还没有上传图片,支持 png / jpg / webp / gif / bmp / avif,单张 10MB 以内',
393
+ themeBgUpload: '上传图片/视频',
394
+ themeBgEmpty: '还没有上传文件;图片支持 png / jpg / webp / gif / bmp / avif(10MB 以内),视频支持 mp4 / webm / mov(200MB 以内)',
339
395
  themeBgDelete: '删除',
340
- themeBgNoneHint: '选择一种背景来源;文件夹可定时轮换,网址可配合随机图 API 定时刷新。',
396
+ themeBgNoneHint: '选择一种壁纸来源;文件夹可定时轮换,图片网址可配合随机图 API 定时刷新。',
341
397
  themeBgFolderPick: '浏览',
342
- themeBgFolderPickTitle: '选择背景图文件夹',
343
- themeBgFolderHint: '选择一个装壁纸的文件夹,图片原地读取不复制。',
398
+ themeBgFolderPickTitle: '选择壁纸文件夹',
399
+ themeBgFolderHint: '选择一个装壁纸的文件夹,文件原地读取不复制。',
344
400
  themeBgFolderRandom: '随机顺序',
345
- themeBgIntervalHint: '切换间隔(分钟)',
346
- themeBgIntervalUnit: '分钟,0 = 不切换',
347
- themeBgFolderCount: '文件夹里有 {n} 张图片,定时轮换中。',
348
- themeBgFolderMissing: '文件夹不存在或里面没有图片。',
349
- themeBgUrlHint: '定时刷新适合随机图 API(每次请求返回不同图);刷新时带缓存参数避免命中缓存。',
350
- themeBgUrlIntervalHint: '刷新间隔(分钟)',
401
+ themeBgIntervalHint: '轮换间隔(分钟)',
402
+ themeBgIntervalUnit: '分钟后轮换,设为 0 不轮换',
403
+ themeBgFolderCount: '文件夹里有 {n} 个壁纸文件,定时轮换中。',
404
+ themeBgFolderCountIdle: '文件夹里有 {n} 个壁纸文件,当前不轮换。',
405
+ themeBgFolderMissing: '文件夹不存在或里面没有壁纸文件。',
406
+ themeBgUrlIntervalUnit: '分钟后刷新,设为 0 不刷新',
351
407
  themeBgUrlInvalid: '网址需以 http(s):// 开头',
408
+ themeBgWebHint: '网页壁纸用沙箱 iframe 铺在界面后方,页面需自行播放动画或视频;仅页面自身透明底时能透出壁纸,部分依赖登录态的页面无法显示。',
409
+ themeBgSource: '来源',
410
+ themeBgImage: '画面',
352
411
  themeBgFit: '缩放方式',
353
412
  themeBgFitCover: '填满',
354
413
  themeBgFitContain: '适应',
355
414
  themeBgFitFill: '拉伸',
356
415
  themeBgFitTile: '平铺',
357
416
  themeBgMask: '遮罩不透明度',
358
- themeBgMaskHint: '数值越高,图片越向主题背景色淡化,文字对比越清晰',
359
- themeBgMaskHint2: '图片向主题背景色淡化的程度',
360
- themeBgBlur: '图片模糊',
417
+ themeBgBlur: '画面模糊',
361
418
  themeBgPanel: '面板不透明度',
362
- themeBgPanelHint: '侧栏、面板与标签栏的不透明程度。越低,透出的图片越多。',
363
- themeBgDeletedActive: '当前背景已删除,已自动停用背景',
419
+ themeBgDialogFrost: '设置弹窗磨砂',
420
+ themeBgMisc: '其他',
421
+ themeBgFollowGlobal: '跟随全局',
422
+ themeBgRegionsHint: '每行的缩放、遮罩可单独设置,选“跟随全局”即跟随“画面”的值;模糊、转场、播放仅作用于全局壁纸(分区只能铺图,不能播视频)。分区用文件夹时,轮换间隔与随机顺序沿用全局设置。',
423
+ themeBgPlayback: '播放(视频壁纸)',
424
+ themeBgVolume: '音量',
425
+ themeBgVolumeHint: '视频壁纸的音轨音量,0 = 静音(默认)',
426
+ themeBgRate: '倍速',
427
+ themeBgFps: '帧率上限',
428
+ themeBgFpsOff: '原始帧率',
429
+ themeBgFpsHint: '对视频壁纸重编码抽帧以省资源,需要 ffmpeg;未安装时保持原始帧率。',
430
+ themeBgTransition: '切换转场',
431
+ themeBgTransitionCut: '直接切换',
432
+ themeBgTransitionFade: '淡入淡出',
433
+ themeBgPause: '暂停条件',
434
+ themeBgPauseHidden: '窗口最小化时',
435
+ themeBgPauseBlur: '窗口失焦时',
436
+ themeBgPauseBattery: '电池供电时',
437
+ themeBgDeletedActive: '当前壁纸已删除,已自动停用壁纸',
364
438
  tableCopyBtn: '复制表格',
365
439
  tableCopied: '表格已复制',
366
440
  sbItemCtx: '上下文占用',
441
+ sbItemTokRate: '最近输出 tokens/s',
367
442
  sbItemQuestions: '提问次数',
368
443
  sbMaster: '启用统计',
369
444
  sbMasterDesc: '总开关:关闭后输入框右下角的统计行与每轮回答的用量标注一起停用。',
@@ -417,6 +492,8 @@ const zh = {
417
492
  featureComposerProvider: '模型名显示供应商',
418
493
  featureImageCopyDesc: '右键会话中的图片或点击放大的预览图,可将图片复制到剪贴板。',
419
494
  featureTableCopyDesc: '表格工具条新增复制表格,粘贴进 Excel / 富文本编辑器即为干净表格。',
495
+ featureSessionLink: '会话 ID 显示为任务名链接',
496
+ featureSessionLinkDesc: '提问与回答里的会话 ID(sess_ / session_ 开头)显示为任务名,点击切换到该会话,悬停可看原始 ID。',
420
497
  featureComposerProviderDesc: '模型名前显示供应商名(如 BigModel-Max1 / glm-5.3),区分同名模型。',
421
498
  imageCopy: '复制图片',
422
499
  imageCopied: '图片已复制到剪贴板',
@@ -428,6 +505,10 @@ const zh = {
428
505
  pathCopyFailed: '复制路径失败',
429
506
  fileOpenDefault: '默认应用打开',
430
507
  fileReveal: '打开所在目录',
508
+ fileActionFailed: '{label}失败:{err}',
509
+ unknownError: '未知错误',
510
+ pluginLabel: '插件',
511
+ manualInput: '(手动输入)',
431
512
  featureAutoUpdatePlugins: '自动更新',
432
513
  featureAutoUpdatePluginsRepo: 'duanluan/zcode-plugins',
433
514
  featureAutoUpdatePluginsDesc: '',
@@ -442,7 +523,11 @@ const zh = {
442
523
  tabVision: 'Vision',
443
524
  visionDesc: '主模型不支持图片输入时(如 glm-5.3),自动把消息里的图片交给下面的视觉模型识别,把描述带给主模型(zcode-vision 插件;/vision-* 命令编辑同一配置)。',
444
525
  visionEnabled: '启用',
445
- visionForceIntercept: '主模型能看图也拦截',
526
+ visionForceIntercept: '主模型',
527
+ visionForceInterceptAuto: '不能识图就使用插件',
528
+ visionForceInterceptTrue: '始终使用插件',
529
+ visionForceInterceptFalse: '不使用插件',
530
+ visionForceInterceptHint: '不能识图就使用插件 = 跟随 ZCode“模型设置”里该模型的图片开关:开 = 模型自看不重复识别,关 = 走识别代理(tool 模式出识别卡片);始终使用插件 = 能看图也强制走识别代理(双重识别换卡片);不使用插件 = 能看图就放行(不能识图的模型仍走识别代理)',
446
531
  visionMode: '链模式',
447
532
  visionModeFallback: '依次尝试',
448
533
  visionModeFallbackDesc: '前一个失败才试下一个,任一成功即止(主力 + 备用)。',
@@ -470,6 +555,7 @@ const zh = {
470
555
  visionCompressKB: '压缩阈值 KB',
471
556
  visionCompressKBHint: '超过该大小的图先压缩再识别(最长边 2000、JPEG);0 = 不压缩',
472
557
  visionLoadFailed: '读取视觉代理配置失败',
558
+ titleGenLoadFailed: '读取自动重命名配置失败',
473
559
  tabRtk: 'rtk',
474
560
  rtkDesc: 'rtk 插件:把常见开发命令的输出压缩 60-90% 再进入上下文(/rtk-* 命令编辑同一配置)。',
475
561
  rtkEnabled: '启用',
@@ -611,7 +697,7 @@ const zh = {
611
697
  relocateTitle: '切换文件夹',
612
698
  relocateDesc: '将该项目指向另一个文件夹:侧边栏、已打开标签页与本地任务历史一并迁移,目录本身不会被移动,会话记录不会丢失。',
613
699
  relocateNewPathLabel: '新文件夹',
614
- relocateConfirm: '移动',
700
+ relocateConfirm: '切换',
615
701
  relocateHint: '目标文件夹需已存在,可输入路径或点击“浏览”选择;完成后界面将自动刷新。',
616
702
  relocateSuccess: '已切换文件夹,正在刷新界面…',
617
703
  relocateIndexSkipped: '已切换文件夹;任务历史未能同步(本机缺少 SQLite 支持),旧任务条目可能仍指向旧路径。',
@@ -633,8 +719,41 @@ const en = {
633
719
  tabProxy: 'Proxy',
634
720
  tabBehavior: 'Behavior',
635
721
  tabAgents: 'Global Prompt',
722
+ tabZcode: 'ZCode CLI',
723
+ zcodeDesc: 'ZCode behavior settings (written to ~/.zcode/cli/config.json); takes effect for new sessions.',
724
+ zcodeStatsTitle: 'Skill listing check',
725
+ zcodeStatsCounts: '{total} skills ({user} local · {plugin} from plugins)',
726
+ zcodeStatsChars: 'Full listing ≈ {n} characters',
727
+ zcodeBudgetDefaultTag: ' (default)',
728
+ zcodeStatsDegraded: 'Over budget: the listing degrades to names and file paths only, so the model cannot see skill descriptions',
729
+ zcodeStatsOk: 'Within budget: the full listing with descriptions is injected into new sessions',
730
+ zcodeStatsSuggest: 'Suggested budget {n} characters (with 20% margin)',
731
+ zcodeBudgetApply: 'Use suggested',
732
+ zcodeBudgetApplied: 'Listing budget saved.',
733
+ zcodeStatsNote: 'Estimated from the current disk state; per-project skill directories are not counted.',
734
+ zcodeSkillEnabled: 'Skill system',
735
+ zcodeSkillEnabledDesc: 'skills.enabled: when off, ZCode discovers and injects no skills',
736
+ zcodeSkillIncludeInstructions: 'Skill instructions injection',
737
+ zcodeSkillIncludeInstructionsDesc: 'skills.includeInstructions: whether skill instructions are injected along with the listing',
738
+ zcodeSkillBudget: 'Skill listing budget (characters)',
739
+ zcodeSkillBudgetDesc: 'skills.metadataBudget: the listing degrades to names and file paths only beyond this length; default 20000',
740
+ zcodeSkillRoots: 'Extra skill directories',
741
+ zcodeSkillRootsDesc: 'skills.roots: one directory per line; skills under them are discovered (beyond ~/.zcode/skills and ~/.agents/skills)',
742
+ zcodeSave: 'Save',
743
+ zcodeRootsSaved: 'Skill directories saved.',
744
+ zcodeFeatCompact: 'Compaction',
745
+ zcodeFeatCompactDesc: 'features.compact: compact earlier conversation when the context grows too long',
746
+ zcodeFeatRewind: 'Rewind',
747
+ zcodeFeatRewindDesc: 'features.rewind: roll back to an earlier point and continue from there',
748
+ zcodeFeatSubagent: 'Subagents',
749
+ zcodeFeatSubagentDesc: 'features.subagent: dispatch subagents for subtasks',
750
+ zcodeFeatSkill: 'Skill tool',
751
+ zcodeFeatSkillDesc: 'features.skill: the Skill tool is available (the skill system must also be on)',
752
+ zcodeFeatMcp: 'MCP tools',
753
+ zcodeFeatMcpDesc: 'features.mcp: use tools provided by MCP servers',
754
+ zcodeMemoryHint: 'Workspace memory is not configured here; toggle it in the official settings under Settings → Agent capabilities → Memory (with the memory viewer).',
636
755
  agentsDesc: 'Written to ~/.zcode/AGENTS.md and used as default instructions in every session across all projects. Takes effect for new sessions; per-project AGENTS.md can extend or override it. Content over 100 KB is truncated by the app.',
637
- agentsPlaceholder: 'Instructions followed by all projects by default; save empty to remove the global prompt',
756
+ agentsPlaceholder: 'Instructions followed by all projects by default; leave empty and save to remove the global prompt',
638
757
  agentsSave: 'Save',
639
758
  agentsSaved: 'Global prompt saved.',
640
759
  agentsLoadFailed: 'Failed to load the global prompt',
@@ -655,7 +774,7 @@ const en = {
655
774
  proxyScopeSyncDesc: 'WebDAV upload and download go through the proxy.',
656
775
  tabSync: 'Sync',
657
776
  tabDebug: 'Debug',
658
- testNoSessionHint: 'With “follow current session [current model]” selected, the provider [model] of the last session is used.',
777
+ testNoSessionHint: 'With "Follow current session" selected, the provider and model of the last session are used (the label shows the model name in brackets).',
659
778
  syncDesc: 'Manually back up ZCode Pro settings and model settings to WebDAV, or restore them on a new computer. The two items are stored as separate files, so you can upload or overwrite either one alone; every upload also keeps a timestamped history version (how many to keep is set in the "History" row; older ones are removed automatically after upload) and download lets you pick any of them. Data moves only when you click, never automatically.',
660
779
  syncUrlPlaceholder: 'https://dav.example.com/dav/',
661
780
  syncDir: 'Folder',
@@ -668,17 +787,17 @@ const en = {
668
787
  syncPruned: 'removed {n} older history versions',
669
788
  syncSave: 'Save',
670
789
  syncSaved: 'Sync settings saved.',
671
- syncFormHint: 'Sync files go inside the folder (default zcode-pro, multi-level allowed, created automatically): zcodepro.json and model.json are always the latest version; timestamped history versions are kept alongside.',
790
+ syncFormHint: 'Sync files go inside the folder (default zcode-pro, multi-level allowed, created automatically): zcodepro.json and model.json always hold the latest version; timestamped history versions are kept alongside.',
672
791
  syncRecLink: 'Jianguoyun WebDAV',
673
792
  syncRecSuffix: ' — use the app password, not your account password.',
674
793
  syncIncludeZcp: 'ZCode Pro settings',
675
794
  syncIncludeZcpDesc: 'Feature toggles, style adjustments and the proxy setting; the sync config and credentials themselves are never synced. Project aliases are not synced (renaming is built in now).',
676
795
  syncIncludeModel: 'Model settings',
677
- syncIncludeModelDesc: 'Custom providers and model config (config.json and provider_config.json, API keys included). Account sign-in credentials (e.g. the BigModel subscription) are not synced; each computer signs in with its own account.',
796
+ syncIncludeModelDesc: 'Custom providers and model config (config.json and provider_config.json, API keys included) and the Headroom provider map (headroom.json; keys are stored as keyHashes, never in plaintext). Account sign-in credentials (e.g. the BigModel subscription) are not synced; each computer signs in with its own account.',
678
797
  syncUpload: 'Upload',
679
798
  syncDownload: 'Download',
680
799
  syncUploading: 'Uploading…',
681
- syncUploaded: 'Uploaded to the server.',
800
+ syncUploaded: 'Uploaded to the server',
682
801
  syncDownloaded: 'Restored from the server.',
683
802
  syncLastPush: 'Last upload',
684
803
  syncLastPull: 'Last download',
@@ -686,7 +805,7 @@ const en = {
686
805
  syncConfirmTitle: 'Download from the server',
687
806
  syncConfirmDesc: 'The selected file will overwrite the matching local section (a .zcodepro-backup copy is kept next to each file); your local sync config and credentials stay untouched. Restarting ZCode is recommended after restoring model settings. Import now?',
688
807
  syncConfirmGo: 'Import',
689
- syncPickDesc: 'Fixed names are always the latest version; timestamped files are the history each upload leaves behind. Import overwrites the matching local section.',
808
+ syncPickDesc: 'Fixed names always hold the latest version; timestamped files are the history each upload leaves behind. Import overwrites the matching local section.',
690
809
  syncVerDeleteLatestNote: 'Note: this is the "latest" file that older zcode-pro installs download from; deleting it breaks their download. Timestamped history versions are not affected.',
691
810
  syncHint: 'Sync credentials are stored locally in zcodepro.json only; model settings contain the API keys of custom providers and go to your own WebDAV only.',
692
811
  syncTest: 'Test',
@@ -731,11 +850,11 @@ const en = {
731
850
  lineHeightName: 'Answer line height',
732
851
  lineHeightDesc: 'Line height of answer text (multiplier).',
733
852
  thinkingLineHeightName: 'Work-log line height',
734
- thinkingLineHeightDesc: 'Line height of the “worked for…” history panel (tool entries and reasoning, multiplier).',
853
+ thinkingLineHeightDesc: 'Line height of the "worked for…" history panel (tool entries and reasoning, multiplier).',
735
854
  userLineHeightName: 'Question line height',
736
855
  userLineHeightDesc: 'Line height of question text (multiplier).',
737
856
  contentWidthName: 'Content width',
738
- contentWidthDesc: 'Max width of conversation content; accepts px or % (e.g. 900px, 85%).',
857
+ contentWidthDesc: 'Max width of conversation content; accepts px or % (e.g. 900px, 85%). Shows the current actual width by default; % is relative to the session area.',
739
858
  defaultValue: 'default',
740
859
  resetDefault: 'Reset to default',
741
860
  featureProjectMenu: 'Project menu actions',
@@ -743,37 +862,47 @@ const en = {
743
862
  featureTaskOrder: 'Sidebar session drag ordering',
744
863
  featureTaskOrderDesc: 'Drag to reorder sessions in Pinned, Projects and Groups; survives restarts.',
745
864
  featureSessionSwitch: 'Session quick switch',
746
- featureSessionSwitchDesc: '{last} toggles to the last session; alt + arrows pick recent sessions; keys remappable',
865
+ featureSessionSwitchDesc: '{last} toggles between the current and the last session; alt + letter opens the switcher popup, pick with arrows or hotkeys inside; keys remappable',
747
866
  featureTitleLock: 'Keep renamed session titles',
748
867
  featureTitleLockDesc: 'Sessions you renamed keep their custom title in the sidebar.',
749
- tabTitleGen: 'Task name prompt',
750
- titleGenShortDesc: 'When a new session starts answering, generates the task name with the chosen provider and prompt and saves it as a manual rename the built-in title never overrides.',
868
+ tabTitleGen: 'Auto rename',
869
+ titleGenShortDesc: 'When a new session starts answering, generates the task name with the chosen provider and prompt and saves it as a manual rename that the built-in title never overrides.',
751
870
  titleGenEnabled: 'Enable',
752
871
  titleGenProvider: 'Provider',
753
872
  titleGenProviderNone: 'Custom endpoint (no provider)',
754
873
  titleGenProviderSession: 'Follow current session',
755
874
  titleGenProviderDeleted: ' (deleted)',
756
875
  titleGenModel: 'Model',
757
- titleGenModelHint: 'Pick from the list, or type a model id',
876
+ titleGenModelHint: 'Pick from the list, or type a model ID',
758
877
  titleGenModelEmpty: '(not set)',
759
878
  titleGenModelSessionHint: 'Pick from the list; the first entry follows the session model',
760
879
  titleGenModelFollowSession: 'Follow the session model',
761
- titleGenModelManualHint: 'Type a model id',
880
+ titleGenModelManualHint: 'Type a model ID',
762
881
  titleGenBaseUrl: 'Base URL',
763
882
  titleGenApiKey: 'API Key',
764
883
  titleGenFormat: 'Protocol',
765
884
  titleGenPrompt: 'Prompt',
766
- titleGenPromptPlaceholder: 'Leave empty for the built-in default prompt (button below shows it)',
885
+ titleGenPromptPlaceholder: 'Leave empty for the built-in default prompt (the button below shows it)',
767
886
  titleGenPromptReset: 'Use default prompt',
768
887
  titleGenSample: 'Test message',
769
888
  titleGenTest: 'Test',
770
889
  titleGenTesting: 'Generating…',
771
890
  titleGenTestOk: 'Result: ',
772
891
  titleGenTestFailed: 'Generation failed',
892
+ titleGenManual: 'Manual rename',
893
+ titleGenHoverBtn: 'Task row hover button',
894
+ titleGenHoverBtnDesc: 'Show an "Auto rename" button next to the archive button when hovering a task row.',
895
+ titleGenMenuEntry: 'Context menu item',
896
+ titleGenMenuEntryDesc: 'Show "Auto rename" below "Rename task" in the task context menu.',
897
+ titleGenRecentQa: 'Recent Q&A rounds',
898
+ titleGenRecentQaDesc: 'Manual rename uses the last N Q&A rounds as input.',
899
+ autoRenameItem: 'Auto rename',
900
+ autoRenameWorking: 'Generating title…',
901
+ autoRenameDone: 'Renamed: ',
773
902
  featureWsRunning: 'Running indicator when collapsed',
774
903
  featureWsRunningDesc: 'Collapsed project and task headers show a loader while sessions run.',
775
904
  tabPerformance: 'Performance',
776
- perfDesc: 'ZCode keeps a session process resident for every project you have opened and never reclaims it, so memory grows with projects. When enabled, projects unused for a while with nothing running release their memory automatically: sessions are untouched and reload when reopened, with a few seconds wait on the first reply. The project in use, running sessions, background commands and scheduled tasks are never reclaimed. Background-command detection reads system process info via built-in tools (Linux / macOS / Windows); when unavailable, the feature disables itself.',
905
+ perfDesc: 'ZCode keeps a session process resident for every project you have opened and never reclaims it, so memory grows with projects. When enabled, projects unused for a while with nothing running release their memory automatically: sessions are untouched and reload when reopened, with a few seconds\' wait on the first reply. The project in use, running sessions, background commands and scheduled tasks are never reclaimed. Background-command detection reads system process info via built-in tools (Linux / macOS / Windows); when unavailable, the feature disables itself.',
777
906
  featureIdleReclaim: 'Idle project memory reclaim',
778
907
  featureIdleReclaimDesc: 'Qualifying projects release their memory; sessions are untouched and reload when reopened.',
779
908
  idleReclaimMinutesLabel: 'Idle minutes before reclaim',
@@ -789,9 +918,9 @@ const en = {
789
918
  featurePinnedCollapse: 'Collapsible Pinned section',
790
919
  featurePinnedCollapseDesc: 'The Pinned header collapses/expands its task list.',
791
920
  featureSandboxReclaim: 'Plugin card sandbox reclaim',
792
- featureSandboxReclaimDesc: 'Reclaims the oldest sandboxes at the 64 cap so new cards keep opening; released cards come back when their session is reopened.',
921
+ featureSandboxReclaimDesc: 'Reclaims the oldest sandboxes when the 64-slot cap is hit so new cards keep opening; released cards come back when their session is reopened.',
793
922
  featurePluginCardRetry: 'Plugin card auto-retry',
794
- featurePluginCardRetryDesc: 'Auto-clicks "Reload" on cards that failed the slot cap; they recover as soon as a slot frees up.',
923
+ featurePluginCardRetryDesc: 'Auto-clicks "Reload" on cards that hit the slot cap; they recover as soon as a slot frees up.',
795
924
  visionCardUi: 'Vision cards',
796
925
  pinnedToggleAria: 'Collapse/expand Pinned',
797
926
  sidebarProjectSpacingName: 'Project spacing',
@@ -817,18 +946,19 @@ const en = {
817
946
  featureNewtabPanelsDesc: "Adds third-party plugin panels (headroom, rtk, ...) to the new tab page; click to open in the side pane.",
818
947
  ntpDescSuffix: 'plugin panel',
819
948
  ntpNeedSession: 'Open a task session first, then open plugin panels from the new tab page',
949
+ ntpOpenMissing: 'No plugin-panel opener in this UI; cannot open plugin panels from the new tab page',
820
950
  featureStatusBarDesc: 'Shows statistics at the bottom-right of the input box and at the end of each answer.',
821
951
  tabStylesPane: 'Styles',
822
952
  tabStatusPane: 'Status bar',
823
953
  themeColorsPane: 'Theme',
824
954
  themeBgRegions: 'Regional backgrounds',
825
- themeBgRegionFollow: 'None',
955
+ themeBgRegionFollow: 'Follow global',
826
956
  themeBgRegionLeft: 'Left sidebar',
827
957
  themeBgRegionCenter: 'Center area',
828
958
  themeBgRegionRight: 'Right sidebar',
829
- themeBgPane: 'Background',
959
+ themeBgPane: 'Wallpaper',
830
960
  themeSkinTitle: 'Skins',
831
- themeSkinDesc: 'Famous editor theme palettes, auto-matching ZCode\u2019s light / dark mode; "Default" keeps ZCode as-is, "Custom" is tuned below.',
961
+ themeSkinDesc: 'Well-known editor theme palettes, auto-matching ZCode\'s light / dark mode; "Default" keeps ZCode as-is, "Custom" is tuned below.',
832
962
  themeSkinCustom: 'Custom',
833
963
  themeCustomTitle: 'Custom theme',
834
964
  themeCustomHint: 'Color changes apply live (auto-switches to the custom skin); set light and dark separately — pick 5 colors and the whole palette is derived.',
@@ -839,46 +969,66 @@ const en = {
839
969
  themeCustomFg: 'Text',
840
970
  themeCustomMuted: 'Muted text',
841
971
  themeCustomAccent: 'Accent',
842
- themeBgDesc: 'Sources: local library, folder (rotate on a timer) or URL (refresh on a timer); left / center / right regions can each have their own. Sidebar, chat and composer reveal the background while menus and dialogs stay opaque. The library uploads with the zcode-pro sync group (overwrite, no history versions).',
972
+ themeBgDesc: 'Wallpapers can be images, videos or web pages, rendered behind the UI. Sources: local library (pick one image), folder (rotate on a timer), image URL (refresh on a timer) or a web page; left / center / right regions can each have their own background (static images only, with their own fit and mask). Sidebar, chat, composer and the settings window reveal the wallpaper — the settings window is frosted; the frosting can be turned off here; context menus and other dialogs stay opaque for readability. The library uploads over WebDAV with the zcode-pro sync group (overwrite, no history versions).',
843
973
  themeBgModeNone: 'None',
844
974
  themeBgModeLibrary: 'Library',
845
975
  themeBgModeFolder: 'Folder',
846
- themeBgModeUrl: 'URL',
976
+ themeBgModeUrl: 'Image URL',
977
+ themeBgModeWeb: 'Web page',
847
978
  themeBgLibrary: 'My library',
848
- themeBgUpload: 'Upload',
849
- themeBgEmpty: 'No images yet. png / jpg / webp / gif / bmp / avif, up to 10MB each',
979
+ themeBgUpload: 'Upload images/videos',
980
+ themeBgEmpty: 'Nothing uploaded yet. Images: png / jpg / webp / gif / bmp / avif (up to 10MB); videos: mp4 / webm / mov (up to 200MB)',
850
981
  themeBgDelete: 'Delete',
851
- themeBgNoneHint: 'Pick a background source; folders rotate on a timer, URLs refresh on a timer for random-image APIs.',
982
+ themeBgNoneHint: 'Pick a wallpaper source; folders rotate on a timer, image URLs refresh on a timer for random-image APIs.',
852
983
  themeBgFolderPick: 'Browse',
853
984
  themeBgFolderPickTitle: 'Choose a wallpaper folder',
854
- themeBgFolderHint: 'Pick a folder of wallpapers; images are read in place, not copied.',
985
+ themeBgFolderHint: 'Pick a folder of wallpapers; files are read in place, not copied.',
855
986
  themeBgFolderRandom: 'Random order',
856
- themeBgIntervalHint: 'Switch interval (minutes)',
857
- themeBgIntervalUnit: 'min, 0 = off',
858
- themeBgFolderCount: '{n} images in the folder, rotating on the timer.',
859
- themeBgFolderMissing: 'Folder missing or contains no images.',
860
- themeBgUrlHint: 'Timed refresh suits random-image APIs (each request returns a new image); a cache-buster is appended on refresh.',
861
- themeBgUrlIntervalHint: 'Refresh interval (minutes)',
987
+ themeBgIntervalHint: 'Rotation interval (minutes)',
988
+ themeBgIntervalUnit: 'minutes between rotations; 0 = no rotation',
989
+ themeBgFolderCount: '{n} wallpaper files in the folder, rotating on the timer.',
990
+ themeBgFolderCountIdle: '{n} wallpaper files in the folder, rotation off.',
991
+ themeBgFolderMissing: 'Folder missing or contains no wallpaper files.',
992
+ themeBgUrlIntervalUnit: 'minutes between refreshes; 0 = no refresh',
862
993
  themeBgUrlInvalid: 'URL must start with http(s)://',
994
+ themeBgWebHint: 'Web wallpapers render behind the UI in a sandboxed iframe; the page plays its own animation or video. Only pages with their own transparent background reveal the wallpaper; pages that need a login session may not show.',
995
+ themeBgSource: 'Source',
996
+ themeBgImage: 'Display',
863
997
  themeBgFit: 'Fit',
864
998
  themeBgFitCover: 'Fill',
865
999
  themeBgFitContain: 'Fit',
866
1000
  themeBgFitFill: 'Stretch',
867
1001
  themeBgFitTile: 'Tile',
868
1002
  themeBgMask: 'Mask opacity',
869
- themeBgMaskHint: 'Higher values fade the image toward the theme background color for clearer text',
870
- themeBgMaskHint2: 'How much the image fades toward the theme background color',
871
- themeBgBlur: 'Image blur',
1003
+ themeBgBlur: 'Wallpaper blur',
872
1004
  themeBgPanel: 'Panel opacity',
873
- themeBgPanelHint: 'Opacity of sidebar, panels and tab bar. Lower reveals more of the image.',
874
- themeBgDeletedActive: 'Active background was deleted; background disabled',
1005
+ themeBgDialogFrost: 'Frosted settings window',
1006
+ themeBgMisc: 'Other',
1007
+ themeBgFollowGlobal: 'Follow global',
1008
+ themeBgRegionsHint: 'Fit and mask can be set per row; "Follow global" uses the Display values. Blur, transition and playback apply only to the global wallpaper (regions are static images, no video). Region folders reuse the global rotation interval and order settings.',
1009
+ themeBgPlayback: 'Playback (video)',
1010
+ themeBgVolume: 'Volume',
1011
+ themeBgVolumeHint: 'Audio track volume of video wallpapers, 0 = muted (default)',
1012
+ themeBgRate: 'Speed',
1013
+ themeBgFps: 'FPS cap',
1014
+ themeBgFpsOff: 'Native',
1015
+ themeBgFpsHint: 'Re-encodes video wallpapers to a lower frame rate to save resources; needs ffmpeg, otherwise the native rate is kept.',
1016
+ themeBgTransition: 'Transition',
1017
+ themeBgTransitionCut: 'Instant',
1018
+ themeBgTransitionFade: 'Fade',
1019
+ themeBgPause: 'Pause when',
1020
+ themeBgPauseHidden: 'Window minimized',
1021
+ themeBgPauseBlur: 'Window unfocused',
1022
+ themeBgPauseBattery: 'On battery',
1023
+ themeBgDeletedActive: 'Active wallpaper was deleted; wallpaper disabled',
875
1024
  tableCopyBtn: 'Copy table',
876
1025
  tableCopied: 'Table copied',
877
1026
  sbItemCtx: 'Context usage',
1027
+ sbItemTokRate: 'Recent output tokens/s',
878
1028
  sbItemQuestions: 'Questions asked',
879
1029
  sbMaster: 'Enable statistics',
880
1030
  sbMasterDesc: 'Master switch: turning this off disables both the input-box statistics and per-turn labels.',
881
- sbGroupSession: 'Session statistics (follows current session)',
1031
+ sbGroupSession: 'Session statistics (follows the current session)',
882
1032
  sbGroupGlobal: 'Global statistics',
883
1033
  sbGroupTurn: 'Per-turn statistics (answer rows)',
884
1034
  sbLabelIn: 'in',
@@ -886,7 +1036,7 @@ const en = {
886
1036
  sbLabelCache: 'cache',
887
1037
  turnUsageTitle: 'Turn tokens',
888
1038
  sbLabelQuestions: 'asks',
889
- sbItemTodayTokens: 'Today tokens',
1039
+ sbItemTodayTokens: 'Tokens today',
890
1040
  sbItemTasks: 'Tasks',
891
1041
  sbLabelCtx: 'ctx',
892
1042
  sbLabelTurns: 'calls',
@@ -901,8 +1051,8 @@ const en = {
901
1051
  tabShortcuts: 'Shortcuts',
902
1052
  hkTitle: 'Session quick switch',
903
1053
  hkAltZ: 'Toggle between the current and the last-used session',
904
- hkAltX: 'Move the highlight up (earlier sessions) in the popup',
905
- hkAltC: 'Move the highlight down (recent sessions); at the bottom it loads 5 more and highlights the first newly loaded entry',
1054
+ hkAltX: 'Move the highlight up (earlier tasks) in the popup',
1055
+ hkAltC: 'Move the highlight down (more recent tasks); at the bottom it loads 5 more and highlights the first newly loaded entry',
906
1056
  hkAltE: 'Open the last 10 tasks',
907
1057
  hkAltR: 'Open running / finished-but-unseen tasks',
908
1058
  hkArrow: 'Move the highlight while the popup is open (same rules as alt + {prev} / alt + {next})',
@@ -923,11 +1073,13 @@ const en = {
923
1073
  hkResetDone: 'Shortcuts reset to defaults',
924
1074
  featureFileActions: 'File menu actions',
925
1075
  featureFileActionsDesc: 'Adds "Open with default app" and "Reveal in file manager" to the right-click menu of file links in chat.',
926
- featureImageCopy: 'Image right-click copy',
1076
+ featureImageCopy: 'Copy image',
927
1077
  featureTableCopy: 'Copy table',
928
1078
  featureComposerProvider: 'Provider in model name',
929
1079
  featureImageCopyDesc: 'Right-click an image in chat or the enlarged preview to copy it to the clipboard.',
930
1080
  featureTableCopyDesc: 'Copy-table button on the table toolbar; pastes into Excel / editors as a clean table.',
1081
+ featureSessionLink: 'Session ID links',
1082
+ featureSessionLinkDesc: 'Shows session IDs (sess_ / session_) in chat as task names; click to switch to that session, hover for the raw ID.',
931
1083
  featureComposerProviderDesc: 'Shows the provider before the model name (e.g. BigModel-Max1 / glm-5.3).',
932
1084
  imageCopy: 'Copy image',
933
1085
  imageCopied: 'Image copied to the clipboard.',
@@ -939,6 +1091,10 @@ const en = {
939
1091
  pathCopyFailed: 'Failed to copy the path.',
940
1092
  fileOpenDefault: 'Open with default app',
941
1093
  fileReveal: 'Reveal in file manager',
1094
+ fileActionFailed: '{label} failed: {err}',
1095
+ unknownError: 'Unknown error',
1096
+ pluginLabel: 'Plugin',
1097
+ manualInput: ' (manual input)',
942
1098
  featureAutoUpdatePlugins: 'Auto-update',
943
1099
  featureAutoUpdatePluginsRepo: 'duanluan/zcode-plugins',
944
1100
  featureAutoUpdatePluginsDesc: '',
@@ -953,7 +1109,11 @@ const en = {
953
1109
  tabVision: 'Vision',
954
1110
  visionDesc: 'When the main model cannot see images (e.g. glm-5.3), images in messages are recognized by the vision models below and passed to the main model as text (zcode-vision plugin; /vision-* commands edit the same file).',
955
1111
  visionEnabled: 'Enable',
956
- visionForceIntercept: 'Intercept even if the main model sees images',
1112
+ visionForceIntercept: 'Main model',
1113
+ visionForceInterceptAuto: "Use the plugin only if the model cannot see images",
1114
+ visionForceInterceptTrue: 'Always use the plugin',
1115
+ visionForceInterceptFalse: 'Never use the plugin',
1116
+ visionForceInterceptHint: "Use the plugin only if the model cannot see images = follow the image toggle in ZCode model settings: on = the model sees images itself (no duplicate recognition), off = route through the vision proxy (tool mode shows the result card); Always use the plugin = forced double recognition for the card; Never use the plugin = let capable models see images (models that can't still go through the plugin)",
957
1117
  visionMode: 'Chain mode',
958
1118
  visionModeFallback: 'Fallback',
959
1119
  visionModeFallbackDesc: 'Try in order until one succeeds (primary + backup).',
@@ -967,10 +1127,10 @@ const en = {
967
1127
  visionUseProvider: 'Provider',
968
1128
  visionSkipAfterFailures: 'Skip after failures',
969
1129
  visionSkipAfterFailuresHint: 'After this many consecutive failures a proxy is skipped and the next one is tried; 0 = never skip',
970
- visionSkipMinutes: 'Skip minutes',
1130
+ visionSkipMinutes: 'Skip for (minutes)',
971
1131
  visionSkipMinutesHint: 'How long a skipped proxy rests before being retried; any success resets the counter',
972
1132
  visionResetChain: 'Reset default chain',
973
- visionResetChainConfirm: 'Reset chain mode and the proxy list to the default single-level chain (session: follow session and its current model)? Current proxy edits will be lost. Continue?',
1133
+ visionResetChainConfirm: 'Reset chain mode and the proxy list to the default single-level chain (the "session" entry follows the session\'s provider and model)? Current proxy edits will be lost. Continue?',
974
1134
  visionBaseUrl: 'API URL',
975
1135
  visionModel: 'Model',
976
1136
  visionApiKey: 'API Key',
@@ -978,9 +1138,10 @@ const en = {
978
1138
  visionTest: 'Test',
979
1139
  visionTesting: 'Testing…',
980
1140
  visionTestFailed: 'Vision proxy test failed',
981
- visionCompressKB: 'Compress threshold KB',
1141
+ visionCompressKB: 'Compression threshold (KB)',
982
1142
  visionCompressKBHint: 'Images above this size are compressed first (max edge 2000, JPEG); 0 = never',
983
1143
  visionLoadFailed: 'Failed to load the vision config',
1144
+ titleGenLoadFailed: 'Failed to load the auto-rename config',
984
1145
  tabRtk: 'rtk',
985
1146
  rtkDesc: 'rtk plugin: compresses common dev command output by 60-90% before it reaches the context (/rtk-* commands edit the same files).',
986
1147
  rtkEnabled: 'Enable',
@@ -989,15 +1150,15 @@ const en = {
989
1150
  rtkBinInstalled: 'rtk installed; PATH takes effect for sessions after signing out and back in — the plugin hook works immediately',
990
1151
  rtkWhitelistTitle: 'Whitelist (pass through without compression)',
991
1152
  rtkBuiltinLabel: 'Built-in exemptions (read-only, follow plugin updates):',
992
- rtkWhitelistDesc: 'Each entry is name (e.g. docker) or git:name (e.g. git:clone); added commands skip compression. Built-ins (git add/commit/push, mkdir/cp, …) cannot be removed.',
1153
+ rtkWhitelistDesc: 'Each entry is a name (e.g. docker) or git:name (e.g. git:clone); added commands skip compression. Built-ins (git add/commit/push, mkdir/cp, …) cannot be removed.',
993
1154
  rtkWhitelistPlaceholder: 'name or git:name, press Enter to add',
994
1155
  rtkWhitelistAdd: 'Add',
995
1156
  rtkWhitelistClear: 'Clear',
996
1157
  rtkWhitelistCleared: 'Whitelist cleared',
997
- rtkWhitelistInvalid: 'Entry must be name or git:name',
1158
+ rtkWhitelistInvalid: 'Entry must be a name or git:name',
998
1159
  rtkLoadFailed: 'Failed to load the rtk config',
999
1160
  tabHeadroom: 'Headroom',
1000
- headroomDesc: 'Headroom plugin: a local compression proxy on 127.0.0.1 (port 8787 by default) that compresses context sent to the model to save tokens (/hr-* commands edit the same file). Switching the device restarts the proxy, so requests in progress may be interrupted once.',
1161
+ headroomDesc: 'Headroom plugin: a local compression proxy on 127.0.0.1 (port 8787 by default) that compresses context sent to the model to save tokens (/hr-* commands edit the same file). Switching the compression device restarts the proxy, so requests in progress may be interrupted once.',
1001
1162
  headroomBinMissing: 'The headroom program was not found, so the proxy cannot start. The settings below take effect once it is installed.',
1002
1163
  hrInstallBin: 'Install headroom binary',
1003
1164
  hrBinInstalled: 'headroom installed; reopen the app or a session and the proxy will start automatically',
@@ -1039,7 +1200,7 @@ const en = {
1039
1200
  headroomWatcher: 'Watcher',
1040
1201
  headroomWatcherOn: 'Running',
1041
1202
  headroomWatcherOff: 'Stopped',
1042
- headroomSaverDetect: 'Power-saver detection',
1203
+ headroomSaverDetect: 'Power-save detection',
1043
1204
  headroomRefresh: 'Refresh',
1044
1205
  headroomStart: 'Start',
1045
1206
  headroomRestart: 'Restart',
@@ -1049,28 +1210,28 @@ const en = {
1049
1210
  headroomStoppedWarn: 'Proxy stopped; providers pointing at 127.0.0.1 cannot connect.',
1050
1211
  headroomBackend: 'Compression device',
1051
1212
  headroomBackendAuto: 'Auto · GPU first',
1052
- headroomBackendCpu: 'Power saving · CPU first',
1213
+ headroomBackendCpu: 'Power-save · CPU first',
1053
1214
  headroomBackendNative: ' (native)',
1054
- headroomBackendDesc: 'Auto lets headroom pick the fastest device (CUDA/MPS); CPU forces CPU compression (power saving, no VRAM). Native headroom values (onnx, pytorch_mps, …) also work. Switching restarts the proxy to apply.',
1215
+ headroomBackendDesc: 'Auto lets headroom pick the fastest device (CUDA/MPS); CPU forces CPU compression (power saving, no VRAM). Native headroom values (onnx, pytorch_mps, …) also work. Switching restarts the proxy to apply the change.',
1055
1216
  headroomPower: 'Power-save auto switch',
1056
1217
  headroomPowerOff: 'Off',
1057
1218
  headroomPowerOffDesc: 'No auto switching; always follow the compression device.',
1058
1219
  headroomPowerBattery: 'On battery',
1059
1220
  headroomPowerBatteryDesc: 'On battery (discharging) → CPU; switches back when plugged in.',
1060
- headroomPowerSaver: 'Power-saver',
1061
- headroomPowerSaverDesc: 'Only the system power-saver mode → CPU; back when it exits.',
1221
+ headroomPowerSaver: 'Power saver',
1222
+ headroomPowerSaverDesc: 'Only the system power saver mode → CPU; back when it exits.',
1062
1223
  hrCpuPinnedHint: 'The compression device is pinned to CPU, so power-save switching no longer changes anything.',
1063
1224
  headroomInterval: 'Watch interval',
1064
1225
  headroomIntervalDesc: 'Seconds between power checks (10–3600, default 60); applies from the next round.',
1065
1226
  headroomSecUnit: 's',
1066
- upgradeCheck: 'Check update',
1227
+ upgradeCheck: 'Check for updates',
1067
1228
  upgradeChecking: 'Checking…',
1068
1229
  upgradeUpToDate: 'Up to date ({v})',
1069
1230
  upgradeFound: '{v} available',
1070
1231
  upgradeNow: 'Update',
1071
1232
  upgradeRunning: 'Updating…',
1072
1233
  upgradeStop: 'Stop',
1073
- upgradeStopped: 'Upgrade stopped',
1234
+ upgradeStopped: 'Update stopped',
1074
1235
  upgradeDone: 'Updated to {v}',
1075
1236
  upgradeFinished: 'Update finished',
1076
1237
  upgradeCheckFailed: 'Update check failed',
@@ -1087,9 +1248,9 @@ const en = {
1087
1248
  aliasSaved: 'Alias updated.',
1088
1249
  aliasCleared: 'Real name restored.',
1089
1250
  aliasHint: 'The directory name on disk is unchanged: terminals, file managers and other path-based UI still show the real name.',
1090
- featureProjectMenuDescNew: 'Open folder and copy path in the project "More" menu. Renaming is built in since ZCode 3.16.1 ("Edit project"), so the custom alias is retired.',
1251
+ featureProjectMenuDescNew: 'Open folder and copy path in the project "More" menu. Renaming is built into ZCode ≥ 3.16.1 ("Edit project"), so the custom alias is retired.',
1091
1252
  aliasMigrateTitle: 'Migrate project aliases',
1092
- aliasMigrateDesc: 'This ZCode supports renaming projects (project "More" menu → Edit project), so the custom alias feature is retired. Write your saved aliases into the official project names by picking the projects below; only the project name changes, folders on disk are untouched.',
1253
+ aliasMigrateDesc: 'This ZCode supports renaming projects (project "More" menu → Edit project), so the custom alias feature is retired. Apply your saved aliases to the official project names by picking the projects below; only the project name changes, folders on disk are untouched.',
1093
1254
  aliasMigrateItemHint: 'The alias becomes the project name (re-editable anytime via "Edit project"). Only unmarked entries can be checked; migrated, merged, deleted, not-on-this-machine and manually-renamed ones cannot — to rename those projects, use "Edit project" in the project "More" menu directly.',
1094
1255
  aliasMigrateStateDone: 'Migrated',
1095
1256
  aliasMigrateStateMerged: 'Merged into "{name}"',
@@ -1122,7 +1283,7 @@ const en = {
1122
1283
  relocateTitle: 'Switch folder',
1123
1284
  relocateDesc: 'Points this project at another folder: the sidebar, open tabs and local task history move along. The directory itself is not moved and no sessions are lost.',
1124
1285
  relocateNewPathLabel: 'New folder',
1125
- relocateConfirm: 'Move',
1286
+ relocateConfirm: 'Switch',
1126
1287
  relocateHint: 'The target folder must already exist. Enter a path or use Browse; the UI refreshes automatically afterwards.',
1127
1288
  relocateSuccess: 'Folder switched. Refreshing…',
1128
1289
  relocateIndexSkipped: 'Folder switched, but the task history was not synced (SQLite support missing); old entries may still point to the old path.',
@@ -1159,12 +1320,18 @@ export function startLocaleResolver() {
1159
1320
  .catch(() => { /* 取回失败:沿用 navigator.language 兜底 */ });
1160
1321
  }
1161
1322
 
1323
+ let zhCache = { at: 0, v: null };
1162
1324
  export function isZhLocale() {
1325
+ // 结果缓存 3 秒:一轮渲染里要调十几次,localStorage 每次读有成本;
1326
+ // 语言切换本来就会重载界面,短缓存跟得上
1327
+ if (zhCache.v != null && Date.now() - zhCache.at < 3000) return zhCache.v;
1163
1328
  let pref = null;
1164
1329
  try { pref = window.localStorage.getItem('zcode-locale-preference'); } catch { /* ignore */ }
1165
- if (pref === 'zh-CN' || pref === 'en-US') return pref === 'zh-CN';
1166
- if (cachedSystemLocale) return cachedSystemLocale === 'zh-CN';
1167
- return /^zh/i.test(navigator.language || 'zh-CN');
1330
+ const v = (pref === 'zh-CN' || pref === 'en-US') ? pref === 'zh-CN'
1331
+ : cachedSystemLocale ? cachedSystemLocale === 'zh-CN'
1332
+ : /^zh/i.test(navigator.language || 'zh-CN');
1333
+ zhCache = { at: Date.now(), v };
1334
+ return v;
1168
1335
  }
1169
1336
 
1170
1337
  export function t() {
@@ -1181,7 +1348,6 @@ const errEn = {
1181
1348
  'agents-read': 'Failed to read AGENTS.md',
1182
1349
  'agents-write': 'Failed to write AGENTS.md',
1183
1350
  'config-save': 'Failed to save config',
1184
- 'settings-write': 'Failed to update setting.json',
1185
1351
  'workspace-empty': 'Workspace not found or has no sessions',
1186
1352
  'order-write': 'Failed to persist ordering',
1187
1353
  'group-not-found': 'No group contains these sessions',
@@ -1195,10 +1361,10 @@ const errEn = {
1195
1361
  'vision-read': 'Failed to read zcode-vision.json',
1196
1362
  'vision-write': 'Failed to write zcode-vision.json',
1197
1363
  'vision-test': 'Vision test failed',
1198
- 'proxy-invalid': 'Proxy must look like http://127.0.0.1:7890, or be empty',
1364
+ 'proxy-invalid': 'The proxy must be a URL like http://127.0.0.1:7890, or be empty',
1199
1365
  'proxy-not-set': 'Set the proxy address first',
1200
1366
  'rtk-invalid': 'Invalid rtk config',
1201
- 'rtk-update': 'Failed to check rtk updates (GitHub Releases unreachable? Set a proxy in the Proxy tab)',
1367
+ 'rtk-update': 'Failed to check for rtk updates (GitHub Releases unreachable? Set a proxy in the Proxy tab)',
1202
1368
  'rtk-write': 'Failed to write the rtk config',
1203
1369
  'headroom-read': 'Failed to read headroom.json',
1204
1370
  'headroom-write': 'Failed to write headroom.json',
@@ -1207,7 +1373,8 @@ const errEn = {
1207
1373
  'headroom-sh': 'sh not found; cannot run the headroom plugin script',
1208
1374
  'headroom-action': 'The headroom action failed',
1209
1375
  'headroom-status': 'Failed to read the headroom status',
1210
- 'headroom-upgrade': 'headroom upgrade failed',
1376
+ 'headroom-update': 'headroom update failed',
1377
+ 'ZCODE_NOT_FOUND': 'ZCode executable not found',
1211
1378
  'plugins-status': 'Failed to read the plugin list',
1212
1379
  'plugins-update': 'Failed to update plugins',
1213
1380
  'sync-invalid': 'Invalid sync settings',
@@ -1218,6 +1385,34 @@ const errEn = {
1218
1385
  'sync-run': 'Sync failed',
1219
1386
  'sync-file-invalid': 'Invalid backup file name',
1220
1387
  'sync-export': 'Failed to save the backup to disk',
1388
+ // 壁纸(bg-*)
1389
+ 'bg-folder': 'Invalid or unreadable wallpaper folder path',
1390
+ 'bg-name': 'Invalid file name (must end with a supported extension and include no path separators)',
1391
+ 'bg-data': 'Image data must be a data:image/*;base64 URL (upload videos via /bg/upload)',
1392
+ 'bg-size': 'The file is too large',
1393
+ 'bg-count': 'The wallpaper library is full; delete some files first',
1394
+ 'bg-magic': 'The file content does not match its extension',
1395
+ 'bg-write': 'Failed to write the wallpaper file',
1396
+ 'bg-delete': 'Failed to delete the wallpaper file',
1397
+ // 视频转码
1398
+ 'transcode-src': 'Invalid source video for transcoding',
1399
+ 'transcode-fps': 'Unsupported frame-rate cap',
1400
+ 'transcode-busy': 'The transcode queue is full; retry later',
1401
+ 'no-ffmpeg': 'ffmpeg not found; the frame-rate cap is unavailable',
1402
+ // 配置/文件读写
1403
+ 'config-unreadable': 'zcodepro.json is unreadable or corrupted; fix the config file first',
1404
+ 'zcode-config-unreadable': 'The ZCode config is unparseable; write aborted',
1405
+ 'read-error': 'Failed to read the file',
1406
+ 'cli-not-found': 'ZCode CLI not found (resources/glm/zcode.cjs)',
1407
+ // 重定位(relocate)
1408
+ 'new-not-found': 'The target folder does not exist',
1409
+ 'protected-path': 'Refused: the path points inside the ZCode data directory',
1410
+ 'same-path': 'The new location is the same as the current one',
1411
+ 'export-cancelled': 'Canceled',
1412
+ // 其他
1413
+ 'no-content': 'This session has no Q&A content yet',
1414
+ 'title-gen-disabled': 'Auto rename is not enabled',
1415
+ 'headroom-provider-config': 'ZCode provider config not found (v2/config.json)',
1221
1416
  };
1222
1417
 
1223
1418
  export function errText(res) {