zcode-pro 1.4.1 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zcode-pro",
3
- "version": "1.4.1",
3
+ "version": "1.5.1",
4
4
  "description": "ZCode Pro — 为 ZCode 桌面版增加界面增强(不修改客户端文件,通过 ZCode Pro 快捷方式启动即可),核心功能:项目自定义别名",
5
5
  "type": "module",
6
6
  "bin": {
@@ -11,13 +11,13 @@ import { basename, delimiter, dirname, isAbsolute, join, resolve, sep } from 'no
11
11
  import { homedir, tmpdir, userInfo } from 'node:os';
12
12
  import { fileURLToPath, pathToFileURL } from 'node:url';
13
13
  import { readSettings, writeSettingsAtomic, remapSettingsPaths, isProjectOpenInTabs } from './settings.mjs';
14
- import { taskIndexPath, probeTaskIndexWritable, remapTaskIndexPaths, taskIndexDriverAvailable, listOverriddenTitles, listTaskWorkspaceMap, setTaskTitleIfNotOverridden, setCustomSessionTitle, isTaskTitleOverridden, reconcileCustomTitles, getTaskProviderModel, listVirtualProjects, countTasks } from './taskIndex.mjs';
14
+ import { taskIndexPath, probeTaskIndexWritable, remapTaskIndexPaths, taskIndexDriverAvailable, listOverriddenTitles, listTaskWorkspaceMap, listTaskStatuses, setTaskTitleIfNotOverridden, setCustomSessionTitle, isTaskTitleOverridden, reconcileCustomTitles, getTaskProviderModel, listVirtualProjects, countTasks } from './taskIndex.mjs';
15
15
  import { pickFolderSystem } from './pickFolder.mjs';
16
16
  import { reorderWorkspaceTasks, reorderGroupMembers } from './taskOrder.mjs';
17
17
  import { webdavRequest, webdavPutWithMkcol, webdavHttpText, parseWebdavListing, findCurl } from './webdav.mjs';
18
18
  import { resolveZcodeExecutable } from './paths.mjs';
19
19
 
20
- const VERSION = '1.4.1';
20
+ const VERSION = '1.5.1';
21
21
 
22
22
  // 全局提示词固定在用户主目录:官方加载器按 HOME/USERPROFILE 拼 .zcode/AGENTS.md,
23
23
  // 不读 ZCODE_DATA_BASE_DIR(数据根迁走时全局指令仍在原位)。
@@ -159,6 +159,8 @@ export function defaultConfig() {
159
159
  idleReclaim: true, // 空闲项目内存回收:长时间无活动的项目释放其会话进程(时长 idleReclaimMinutes)
160
160
  toolbarIcons: true, // 侧栏菜单并入顶栏:新建任务/搜索/自动化/插件市场收成顶栏图标按钮(原菜单隐藏,点击转发)
161
161
  pinnedCollapse: true, // 已置顶分区可折叠:标题可点折叠/展开任务列表(状态记 localStorage)
162
+ tableCopy: true, // 表格工具条"复制表格"按钮:富文本剪贴板,粘贴即表格(table-copy.js)
163
+ composerProvider: true, // 输入框模型名前显示供应商名(composer-provider.js)
162
164
  },
163
165
  // 空闲项目内存回收的判定时长(分钟,1–1440):项目无运行中会话、无后台命令
164
166
  // 且非当前选中,持续满该时长后释放其会话进程
@@ -705,6 +707,17 @@ export function startHelper({ port, token, dataRoot, state, agentsFile = default
705
707
  : { ok: true, available: false, projects: [], deletedRoots: [] });
706
708
  return;
707
709
  }
710
+ if (req.method === 'GET' && url.pathname === '/task-statuses') {
711
+ // 批量会话终态 + 标题:注入侧剔除 syncer 卡滞的误报、alt+r 弹窗显示
712
+ // 折叠项目会话标题都用它。读不到时 available=false,调用方按未确认处理
713
+ const ids = (url.searchParams.get('ids') || '')
714
+ .split(',').map((s) => s.trim()).filter(Boolean).slice(0, 200);
715
+ const statuses = ids.length ? await listTaskStatuses(dataRoot, ids) : {};
716
+ json(res, 200, statuses !== null
717
+ ? { ok: true, available: true, statuses }
718
+ : { ok: true, available: false, statuses: {} });
719
+ return;
720
+ }
708
721
  if (req.method === 'GET' && url.pathname === '/projects') {
709
722
  const settings = readSettings(settingsFile);
710
723
  const projects = (settings.recentProjects || []).map((p) => {
@@ -835,7 +848,9 @@ export function startHelper({ port, token, dataRoot, state, agentsFile = default
835
848
  json(res, 400, { ok: false, code: 'title-gen-disabled', error: '智能起名未开启' });
836
849
  return;
837
850
  }
838
- const sessId = typeof body?.sessId === 'string' && /^sess_[A-Za-z0-9._-]+$/.test(body.sessId) ? body.sessId : '';
851
+ // 会话 id 有 sess_ 与 session_ 两种前缀(新版应用为 session_),两种都认,
852
+ // 否则新形式会话的标题永远不会写入数据库
853
+ const sessId = typeof body?.sessId === 'string' && /^(?:sess|session)_[A-Za-z0-9._-]+$/.test(body.sessId) ? body.sessId : '';
839
854
  let title;
840
855
  try {
841
856
  title = await generateTitleWith(cfg, text, dataRoot, sessId);
@@ -1510,7 +1525,8 @@ export function startHelper({ port, token, dataRoot, state, agentsFile = default
1510
1525
  renameSync(vTmp, vFile);
1511
1526
  }
1512
1527
  } catch { /* 无配置或不可写不影响启动 */ }
1513
- server.listen(port, '127.0.0.1', () => resolveStarted(server));
1528
+ // 服务就绪即安排 headroom 代理兜底(内部延迟 5 秒执行,避开启动高峰)
1529
+ server.listen(port, '127.0.0.1', () => { ensureHeadroomAtStartup(); resolveStarted(server); });
1514
1530
  };
1515
1531
  tryListen();
1516
1532
  });
@@ -1701,12 +1717,13 @@ function mergeTitleGenConfig(saved) {
1701
1717
  // 登录账号的套餐已在供应商列表里,跟随会话即覆盖原语义
1702
1718
  const provider = typeof s.provider === 'string' ? s.provider.trim().slice(0, 200) : d.provider;
1703
1719
  // customWritten:起名功能写过的 { sessId → { title, at } },自动校正只认这些
1704
- // 记录(见 reconcileCustomTitles)。只收合法会话 id 与短字符串,超 7 天/500 条的丢弃
1720
+ // 记录(见 reconcileCustomTitles)。只收合法会话 id(sess_/session_ 两种前缀,
1721
+ // 新版应用为 session_)与短字符串,超 7 天/500 条的丢弃
1705
1722
  const written = {};
1706
1723
  const cutoff = Date.now() - 7 * 24 * 3600 * 1000;
1707
1724
  let kept = 0;
1708
1725
  for (const [k, v] of Object.entries((s.customWritten && typeof s.customWritten === 'object' && !Array.isArray(s.customWritten)) ? s.customWritten : {})) {
1709
- if (kept >= 500 || !/^sess_[A-Za-z0-9._-]+$/.test(k)) continue;
1726
+ if (kept >= 500 || !/^(?:sess|session)_[A-Za-z0-9._-]+$/.test(k)) continue;
1710
1727
  if (!v || typeof v !== 'object' || typeof v.title !== 'string' || v.title.length > 200) continue;
1711
1728
  if (!Number.isFinite(v.at) || v.at < cutoff) continue;
1712
1729
  written[k] = { title: v.title, at: v.at };
@@ -2455,7 +2472,9 @@ export async function classifyIdleBusyWindows(procs, paths, lookupTaskWs) {
2455
2472
  if (child.ppid !== cli.pid) continue;
2456
2473
  if (isInfraCmdline(child.cmdline)) continue;
2457
2474
  if (!child.cmdline) { unattributed = true; continue; }
2458
- const sess = child.cmdline.match(/sess_[A-Za-z0-9-]+/);
2475
+ // 会话 id 有 sess_ 与 session_ 两种前缀(新版应用为 session_);匹配不到
2476
+ // 会走 unattributed 全量判忙——新形式命令挂着时空闲回收会整体停摆
2477
+ const sess = child.cmdline.match(/(?:sess|session)_[A-Za-z0-9-]+/);
2459
2478
  if (sess) await markByTask(sess[0]);
2460
2479
  else unattributed = true; // 用户进程但无会话线索:归属不到具体项目
2461
2480
  }
@@ -3662,6 +3681,20 @@ async function runHeadroomHook(args, timeoutMs = 30000) {
3662
3681
  });
3663
3682
  }
3664
3683
 
3684
+ // 启动兜底:整机重启后首次打开应用时恢复的是旧会话,触发 SessionStart(resume),
3685
+ // 旧版 headroom 插件的钩子只匹配 startup,代理不会自动启动(要等用户新建会话或
3686
+ // 手动重启)。helper 就绪后延迟几秒补一次 ensure:动作幂等(已在跑秒回),新版
3687
+ // 插件侧还带跨进程锁;失败一律静默——没装 headroom 插件/本体的环境不能打扰启动。
3688
+ let headroomStartupEnsureFired = false;
3689
+ function ensureHeadroomAtStartup() {
3690
+ if (headroomStartupEnsureFired) return;
3691
+ headroomStartupEnsureFired = true;
3692
+ const timer = setTimeout(() => {
3693
+ runHeadroomHook(['ensure'], 20000).catch(() => { /* 兜底失败不影响启动 */ });
3694
+ }, 5000);
3695
+ timer.unref?.();
3696
+ }
3697
+
3665
3698
  // 解析 ensure-proxy(.sh/.mjs) status 输出为结构化字段(字段名以脚本 hr_status 的输出为准;
3666
3699
  // headroom 插件 1.3.0+ 多实例模式由 hr-multi 输出同名字段,另附 instance: 行)。
3667
3700
  // 导出以便测试脚本直接驱动。
@@ -241,8 +241,9 @@ export async function listVirtualProjects(dataRoot) {
241
241
  }
242
242
  }
243
243
 
244
- // 批量查会话终态:task_id → task_status。分区头运行判定用它剔除官方 syncer
245
- // 卡滞的报告(会话已完成但内存态仍报活跃时,任务行 loader 会一直卡转)。
244
+ // 批量查会话终态:task_id → { status, updatedAt, title }。分区头运行判定用它
245
+ // 剔除官方 syncer 卡滞的报告(会话已完成但内存态仍报活跃时,任务行 loader 会
246
+ // 一直卡转);title 供 alt+r 弹窗显示折叠项目(行不在场)会话的标题。
246
247
  // 读不到(库缺失/无驱动)返回 null,调用方按未确认处理
247
248
  export async function listTaskStatuses(dataRoot, ids) {
248
249
  const out = {};
@@ -252,17 +253,19 @@ export async function listTaskStatuses(dataRoot, ids) {
252
253
  if (!driver) return null;
253
254
  const esc = (v) => "'" + String(v).replace(/'/g, "''") + "'";
254
255
  const inList = ids.map((id) => esc(id)).join(', ');
255
- const sql = `SELECT task_id, task_status, updated_at FROM tasks WHERE task_id IN (${inList})`;
256
+ const sql = `SELECT task_id, task_status, updated_at, title FROM tasks WHERE task_id IN (${inList})`;
256
257
  try {
257
258
  let rows;
258
259
  if (driver.kind === 'node') {
259
260
  const db = new driver.DatabaseSync(dbFile, { readOnly: true });
260
261
  try { rows = db.prepare(sql).all(); } finally { db.close(); }
261
262
  } else {
262
- rows = runCli(dbFile, sql + ';').stdout.split('\n').filter(Boolean)
263
- .map((l) => { const [id, st, at] = l.split('|'); return { task_id: id, task_status: st, updated_at: at }; });
263
+ // 标题可含任意字符(含分隔符),CLI 路径走 JSON 聚合,不做分隔符切分
264
+ const agg = runCli(dbFile,
265
+ `SELECT coalesce(json_group_array(json_object('task_id', task_id, 'task_status', task_status, 'updated_at', updated_at, 'title', title)), '[]') FROM tasks WHERE task_id IN (${inList});`);
266
+ rows = JSON.parse(agg.stdout.trim() || '[]');
264
267
  }
265
- for (const r of rows) out[String(r.task_id)] = { status: String(r.task_status || ''), updatedAt: Number(r.updated_at) || 0 };
268
+ for (const r of rows) out[String(r.task_id)] = { status: String(r.task_status || ''), updatedAt: Number(r.updated_at) || 0, title: String(r.title || '') };
266
269
  return out;
267
270
  } catch {
268
271
  return null;
@@ -535,7 +538,8 @@ export async function reconcileCustomTitles(dataRoot, writtenMap) {
535
538
  };
536
539
 
537
540
  for (const [sessId, rec] of Object.entries(writtenMap)) {
538
- if (!/^sess_[A-Za-z0-9._-]+$/.test(sessId) || !rec || typeof rec.title !== 'string') continue;
541
+ // 会话 id 有 sess_ 与 session_ 两种前缀(新版应用为 session_),两种都认
542
+ if (!/^(?:sess|session)_[A-Za-z0-9._-]+$/.test(sessId) || !rec || typeof rec.title !== 'string') continue;
539
543
  let cli;
540
544
  try { cli = await readCli(sessId); } catch { continue; }
541
545
  // CLI 已不是我们所写的 custom 标题:别人改过(手动改名/官方),不碰
@@ -127,7 +127,7 @@ const zh = {
127
127
  agentsSave: '保存',
128
128
  agentsSaved: '全局提示词已保存',
129
129
  agentsLoadFailed: '读取全局提示词失败',
130
- proxyDesc: '为 ZCode Pro 本地助手发起的网络访问设置 HTTP 代理:插件市场的更新与安装、插件依赖软件的安装与升级、WebDAV 同步都可走该代理,用下方开关选择生效范围。不影响 ZCode 应用本身与模型请求,保存后立即生效。',
130
+ proxyDesc: '为 ZCode Pro 本地助手发起的网络访问设置 HTTP 代理:插件市场的更新与安装、插件依赖软件的安装与升级、WebDAV 同步都可走该代理,用下方开关选择生效范围。不影响 ZCode 应用本身与模型请求。',
131
131
  proxyPlaceholder: 'http://127.0.0.1:7890',
132
132
  proxySave: '保存',
133
133
  proxySaved: '代理设置已保存',
@@ -141,7 +141,7 @@ const zh = {
141
141
  proxyScopeDeps: '插件依赖软件',
142
142
  proxyScopeDepsDesc: 'headroom 与 rtk 的安装、检查更新与升级(pip 与 GitHub 下载)走代理。',
143
143
  proxyScopeSync: '同步',
144
- proxyScopeSyncDesc: 'WebDAV 上传与下载走代理。默认关闭:坚果云等国内网盘直连即可,代理停了同步会跟着失败。',
144
+ proxyScopeSyncDesc: 'WebDAV 上传与下载走代理。',
145
145
  tabSync: '同步',
146
146
  tabDebug: '调试',
147
147
  testNoSessionHint: '选择“跟随当前会话[当前模型]”时,选择上次会话中使用的供应商[模型]',
@@ -228,13 +228,13 @@ const zh = {
228
228
  defaultValue: '默认',
229
229
  resetDefault: '恢复默认',
230
230
  featureProjectMenu: '项目菜单增强',
231
- featureProjectMenuDesc: '项目“更多”菜单中的自定义别名、切换文件夹、打开文件夹与复制路径(别名同时作用于侧边栏显示)。',
231
+ featureProjectMenuDesc: '项目更多菜单:打开文件夹与复制路径(别名与切换文件夹已停用)。',
232
232
  featureTaskOrder: '侧边栏会话拖动排序',
233
- featureTaskOrderDesc: '让置顶、项目与分组中的会话拖动后记住顺序,刷新后保持。',
233
+ featureTaskOrderDesc: '拖动调整置顶、项目与分组中的会话顺序,重启后不变。',
234
234
  featureSessionSwitch: '会话快捷切换',
235
- featureSessionSwitchDesc: '{last} 在当前与上次会话间来回切换;按住 alt 再按 {prev}/{next} 弹出最近会话列表前后选择(初始 10 条,{next} 到底再加载 5 条),{recent} 直接打开最近 10 条,{attention} 打开运行中与运行完未查看的任务;方向键同样可选,Enter 或松开 alt 切换(类 alt+tab)',
235
+ featureSessionSwitchDesc: '{last} 来回上次会话;alt+方向键/快捷键选最近会话;键位可改',
236
236
  featureTitleLock: '重命名会话名锁定',
237
- featureTitleLockDesc: '手动重命名过的会话不再被自动标题覆盖:会话有新回答后界面可能改显自动标题,重启后又变回,本功能让侧栏始终显示重命名后的名字。',
237
+ featureTitleLockDesc: '手动重命名过的会话不被自动标题覆盖,侧栏始终显示重命名后的名字。',
238
238
  tabTitleGen: '任务名提示词',
239
239
  titleGenShortDesc: '新会话开始作答时,按所选供应商与提示词生成任务名并按手动重命名保存,官方自动标题不再覆盖。',
240
240
  titleGenEnabled: '启用',
@@ -260,7 +260,7 @@ const zh = {
260
260
  titleGenTestOk: '生成结果:',
261
261
  titleGenTestFailed: '生成失败',
262
262
  featureWsRunning: '折叠时任务运行中提示',
263
- featureWsRunningDesc: '有会话在运行时,折叠的项目与“任务”“已置顶”等分区头显示与任务运行中同款的加载图标,全部结束后消失。',
263
+ featureWsRunningDesc: '有会话运行时,折叠的项目与任务分区头显示加载图标,全部结束消失。',
264
264
  tabPerformance: '性能',
265
265
  perfDesc: 'ZCode 为每个打开过的项目常驻一个会话进程,应用自身不会回收,项目多了内存占用就高。开启后,长时间未使用且没有任务在跑的项目会被自动释放:会话记录不受影响,再次打开时自动恢复,仅首次回复有几秒等待。正在使用的项目、运行中的会话与后台命令、定时任务都不会被回收。后台命令检测依赖系统进程信息(Linux / macOS / Windows 各走系统自带工具),检测不可用时功能自动停用。',
266
266
  featureIdleReclaim: '空闲项目内存回收',
@@ -270,17 +270,17 @@ const zh = {
270
270
  idleReclaimStartupHint: '应用启动会为每个恢复的项目预热进程,到点把未使用的项目一次收掉;0 = 启动后立即回收,该次不受上一项空闲时长限制',
271
271
  idleReclaimUnit: '分钟',
272
272
  featureToolbarIcons: '侧栏菜单并入顶栏',
273
- featureToolbarIconsDesc: '把侧边栏顶部的“新建任务 / 搜索 / 自动化 / 插件市场”收成顶部导航栏(后退/前进旁)的图标按钮:悬停显示名称,对应界面打开时高亮,快捷键照常可用;侧边栏原菜单隐藏。',
273
+ featureToolbarIconsDesc: '新建任务/搜索/自动化/插件市场收成顶栏图标按钮。',
274
274
  tbNewTask: '新建任务',
275
275
  tbSearch: '搜索',
276
276
  tbAutomations: '自动化',
277
277
  tbPluginStore: '插件市场',
278
278
  featurePinnedCollapse: '已置顶分区可折叠',
279
- featurePinnedCollapseDesc: '侧边栏“已置顶”标题可点击折叠/展开其任务列表(与“项目”“分组”分区一致),状态记住。',
279
+ featurePinnedCollapseDesc: '侧边栏已置顶标题可点击折叠/展开其任务列表。',
280
280
  featureSandboxReclaim: '插件界面沙箱回收',
281
- featureSandboxReclaimDesc: '插件卡片沙箱数量达到上限时自动释放最早创建的(正在查看的排最后),避免 64 个名额耗尽后新卡片打不开;被释放的旧卡片重新打开所在会话即恢复(预算可在配置文件 sandboxReclaimBudget 调整)。',
281
+ featureSandboxReclaimDesc: '沙箱满 64 个时自动释放最早的,新卡片不再打不开;旧卡重新打开所在会话即可恢复。',
282
282
  featurePluginCardRetry: '插件卡片自动重试',
283
- featurePluginCardRetryDesc: '因名额上限加载失败的插件卡片自动点击“重新加载”,名额空出后自动恢复,无需手动蹲守。',
283
+ featurePluginCardRetryDesc: '因名额上限加载失败的插件卡片自动点击重新加载,名额空出后自动恢复。',
284
284
  visionCardUi: '思考过程显示识图卡片',
285
285
  pinnedToggleAria: '折叠/展开已置顶',
286
286
  sidebarProjectSpacingName: '项目间距',
@@ -293,17 +293,17 @@ const zh = {
293
293
  userFontDesc: '会话中提问内容的字体;选“默认”时跟随界面字体。',
294
294
  assistantFontName: '回答字体',
295
295
  assistantFontDesc: '会话中回答正文的字体(代码块仍用等宽字体);选“默认”时跟随界面字体。',
296
- switcherHint: '{prev} / {next} 或 ↑ / ↓ 选择,Enter 或松开 alt 切换,Esc 取消',
296
+ switcherHint: '{prev} / {next} 或 ↑ / ↓ 选择,Enter 或点击行切换,Esc 取消',
297
297
  switcherCurrent: '当前',
298
298
  switcherEmpty: '暂无上次会话(切换过会话后可用)',
299
299
  switcherFailed: '未能切换到该会话(可能已删除)',
300
300
  switcherMore: '还有 {n} 条 · 按 c 加载',
301
301
  switcherRunning: '运行中',
302
302
  switcherUnseen: '未查看',
303
- switcherAttentionHint: '运行中 / 运行完未查看的任务 · {prev} / {next} 或 ↑ / ↓ 选择,Enter 或松开 alt 切换',
303
+ switcherAttentionHint: '运行中 / 运行完未查看的任务 · {prev} / {next} 或 ↑ / ↓ 选择,Enter 或点击行切换',
304
304
  switcherAttentionEmpty: '暂无运行中或未查看的任务',
305
305
  featureNewtabPanels: '新标签页插件面板入口',
306
- featureNewtabPanelsDesc: '官方“新标签页”只列官方面板与推荐的官方插件,此功能把第三方市场插件(headroom、rtk 等)的面板卡片加进去,点击在侧边面板打开。',
306
+ featureNewtabPanelsDesc: '新标签页加入第三方插件(headroom、rtk 等)的面板卡片,点击在侧边面板打开。',
307
307
  ntpDescSuffix: '插件面板',
308
308
  ntpNeedSession: '先打开一个任务会话,再从新标签页打开插件面板',
309
309
  featureStatusBarDesc: '提问输入框右下角和每轮回答最后显示统计项。',
@@ -361,6 +361,8 @@ const zh = {
361
361
  themeBgPanel: '面板不透明度',
362
362
  themeBgPanelHint: '侧栏、面板与标签栏的不透明程度。越低,透出的图片越多。',
363
363
  themeBgDeletedActive: '当前背景已删除,已自动停用背景',
364
+ tableCopyBtn: '复制表格',
365
+ tableCopied: '表格已复制',
364
366
  sbItemCtx: '上下文占用',
365
367
  sbItemQuestions: '提问次数',
366
368
  sbMaster: '启用统计',
@@ -395,8 +397,6 @@ const zh = {
395
397
  hkArrow: '弹窗打开时移动高亮(与 alt + {prev} / alt + {next} 同规则)',
396
398
  hkEnter: '确认切换到高亮的会话',
397
399
  hkEsc: '取消并关闭弹窗',
398
- hkRelease: '移动过高亮时松开即切换;从未移动则弹窗保持打开,继续选择',
399
- hkReleaseKey: '松开 alt',
400
400
  hkModify: '修改',
401
401
  hkRecording: '按下新键…',
402
402
  hkInvalid: '快捷键只支持单个字母或数字',
@@ -413,7 +413,11 @@ const zh = {
413
413
  featureFileActions: '文件菜单增强',
414
414
  featureFileActionsDesc: '在会话中文件链接的右键菜单里新增“默认应用打开”与“打开所在目录”。',
415
415
  featureImageCopy: '图片右键复制',
416
+ featureTableCopy: '复制表格',
417
+ featureComposerProvider: '模型名显示供应商',
416
418
  featureImageCopyDesc: '右键会话中的图片或点击放大的预览图,可将图片复制到剪贴板。',
419
+ featureTableCopyDesc: '表格工具条新增复制表格,粘贴进 Excel / 富文本编辑器即为干净表格。',
420
+ featureComposerProviderDesc: '模型名前显示供应商名(如 BigModel-Max1 / glm-5.3),区分同名模型。',
417
421
  imageCopy: '复制图片',
418
422
  imageCopied: '图片已复制到剪贴板',
419
423
  imageCopyFailed: '复制图片失败',
@@ -436,7 +440,7 @@ const zh = {
436
440
  pluginsUpdatesAvailable: 'zcode-plugins 有 {n} 个插件可更新(ZCode Pro 设置 → 功能)',
437
441
  pluginsAutoUpdated: 'zcode-plugins 插件已更新',
438
442
  tabVision: 'Vision',
439
- visionDesc: '主模型不支持图片输入时(如 glm-5.3),自动把消息里的图片交给下面的视觉模型识别,把描述带给主模型(zcode-vision 插件;/vision-* 命令编辑同一配置)。改动自动保存。',
443
+ visionDesc: '主模型不支持图片输入时(如 glm-5.3),自动把消息里的图片交给下面的视觉模型识别,把描述带给主模型(zcode-vision 插件;/vision-* 命令编辑同一配置)。',
440
444
  visionEnabled: '启用',
441
445
  visionForceIntercept: '主模型能看图也拦截',
442
446
  visionMode: '链模式',
@@ -467,14 +471,14 @@ const zh = {
467
471
  visionCompressKBHint: '超过该大小的图先压缩再识别(最长边 2000、JPEG);0 = 不压缩',
468
472
  visionLoadFailed: '读取视觉代理配置失败',
469
473
  tabRtk: 'rtk',
470
- rtkDesc: 'rtk 插件:把常见开发命令的输出压缩 60-90% 再进入上下文(/rtk-* 命令编辑同一配置)。改动自动保存并立即生效。',
474
+ rtkDesc: 'rtk 插件:把常见开发命令的输出压缩 60-90% 再进入上下文(/rtk-* 命令编辑同一配置)。',
471
475
  rtkEnabled: '启用',
472
476
  rtkNotInstalled: '未安装 rtk 本体;安装后以下设置生效(会话里执行 /rtk-setup 也可以)',
473
477
  rtkInstallBin: '安装 rtk 本体',
474
478
  rtkBinInstalled: 'rtk 本体已安装;PATH 需注销重登后对会话生效,插件钩子即时生效',
475
479
  rtkWhitelistTitle: '白名单(不压缩直接放行)',
476
480
  rtkBuiltinLabel: '内置放行(只读,随插件更新):',
477
- rtkWhitelistDesc: '每条 name(如 docker)或 git:name(如 git:clone)。输出极小或纯副作用的命令无需压缩,加入后不再压缩;内置的 git add/commit/push、mkdir/cp 等不可移除。删除本文件即恢复默认。',
481
+ rtkWhitelistDesc: '每条 name(如 docker)或 git:name(如 git:clone),加入后不再压缩;内置的 git add/commit/push、mkdir/cp 等不可移除。',
478
482
  rtkWhitelistPlaceholder: 'name 或 git:name,回车添加',
479
483
  rtkWhitelistAdd: '添加',
480
484
  rtkWhitelistClear: '清空',
@@ -482,18 +486,18 @@ const zh = {
482
486
  rtkWhitelistInvalid: '条目格式应为 name 或 git:name',
483
487
  rtkLoadFailed: '读取 rtk 配置失败',
484
488
  tabHeadroom: 'Headroom',
485
- headroomDesc: 'Headroom 插件:本地压缩代理驻留 127.0.0.1(默认 8787 端口),压缩发往模型的上下文以省 token(/hr-* 命令编辑同一配置)。压缩设备与省电切换保存后立即生效;切换设备会重启代理,正在处理的请求可能中断一次。',
489
+ headroomDesc: 'Headroom 插件:本地压缩代理驻留 127.0.0.1(默认 8787 端口),压缩发往模型的上下文以省 token(/hr-* 命令编辑同一配置)。切换设备会重启代理,正在处理的请求可能中断一次。',
486
490
  headroomBinMissing: '未找到 headroom 程序,代理无法启动;安装 headroom 后以下设置自动生效',
487
491
  hrInstallBin: '安装 headroom 本体',
488
- hrBinInstalled: 'headroom 本体已安装;重新打开会话后代理可用(SessionStart 钩子自动拉起)',
492
+ hrBinInstalled: 'headroom 本体已安装;重新打开应用或会话后代理可用(SessionStart 钩子自动拉起)',
489
493
  headroomInstallTitle: '未安装 headroom 插件',
490
- headroomInstallDesc: '从 zcode-plugins 市场安装后即可在此管理压缩代理;建议安装后重启会话生效。',
494
+ headroomInstallDesc: '从 zcode-plugins 市场安装后即可在此管理压缩代理;重启会话后生效。',
491
495
  headroomInstall: '安装',
492
496
  headroomInstalling: '安装中…',
493
497
  headroomInstalled: '已安装 headroom 插件',
494
498
  headroomInstallRetry: '安装未生效,请重试或手动在插件市场安装',
495
499
  pluginInstallCardTitle: '未安装 {name} 插件',
496
- pluginInstallCardDesc: '从 zcode-plugins 市场安装后即可在此管理;建议安装后重启会话生效。',
500
+ pluginInstallCardDesc: '从 zcode-plugins 市场安装后即可在此管理;重启会话后生效。',
497
501
  pluginInstallDone: '已安装 {name} 插件',
498
502
  pluginEnable: '启用',
499
503
  hrStarting: '正在启动压缩代理…',
@@ -536,7 +540,7 @@ const zh = {
536
540
  headroomBackendAuto: '自动 · 显卡优先',
537
541
  headroomBackendCpu: '省电 · CPU 优先',
538
542
  headroomBackendNative: '(原生值)',
539
- headroomBackendDesc: '自动:headroom 选最快设备(CUDA/MPS 显卡优先);CPU:强制 CPU 压缩,省电且不占显存。也支持 headroom 原生值(onnx、pytorch_mps 等)。切换会重启代理立即生效。',
543
+ headroomBackendDesc: '自动:headroom 选最快设备(CUDA/MPS 显卡优先);CPU:强制 CPU 压缩,省电且不占显存。也支持 headroom 原生值(onnx、pytorch_mps 等)。',
540
544
  headroomPower: '省电自动切换',
541
545
  headroomPowerOff: '关闭',
542
546
  headroomPowerOffDesc: '不自动切换,始终按“压缩设备”运行。',
@@ -546,7 +550,7 @@ const zh = {
546
550
  headroomPowerSaverDesc: '仅系统进入省电模式 → CPU 压缩,退出切回。',
547
551
  hrCpuPinnedHint: '压缩设备已固定为 CPU,省电自动切换不会再改变它。',
548
552
  headroomInterval: '监视间隔',
549
- headroomIntervalDesc: '省电监视器轮询电源状态的间隔(10–3600 秒,默认 60);保存后从下一轮巡检起生效,无需重启。',
553
+ headroomIntervalDesc: '省电监视器轮询电源状态的间隔(10–3600 秒,默认 60);保存后从下一轮巡检起生效。',
550
554
  headroomSecUnit: '秒',
551
555
  upgradeCheck: '检查更新',
552
556
  upgradeChecking: '检查中…',
@@ -634,7 +638,7 @@ const en = {
634
638
  agentsSave: 'Save',
635
639
  agentsSaved: 'Global prompt saved.',
636
640
  agentsLoadFailed: 'Failed to load the global prompt',
637
- proxyDesc: 'Set an HTTP proxy for network access made by the local helper: plugin marketplace updates and installs, plugin dependency installs and upgrades, and WebDAV sync can all use it — pick the scopes with the toggles below. Does not affect the ZCode app itself or model requests. Applies immediately.',
641
+ proxyDesc: 'Set an HTTP proxy for network access made by the local helper: plugin marketplace updates and installs, plugin dependency installs and upgrades, and WebDAV sync can all use it — pick the scopes with the toggles below. Does not affect the ZCode app itself or model requests.',
638
642
  proxyPlaceholder: 'http://127.0.0.1:7890',
639
643
  proxySave: 'Save',
640
644
  proxySaved: 'Proxy settings saved.',
@@ -648,7 +652,7 @@ const en = {
648
652
  proxyScopeDeps: 'Plugin dependencies',
649
653
  proxyScopeDepsDesc: 'headroom and rtk installs, update checks and upgrades (pip and GitHub downloads) go through the proxy.',
650
654
  proxyScopeSync: 'Sync',
651
- proxyScopeSyncDesc: 'WebDAV upload and download go through the proxy. Off by default: domestic WebDAV providers work fine direct, and a stopped proxy breaks sync.',
655
+ proxyScopeSyncDesc: 'WebDAV upload and download go through the proxy.',
652
656
  tabSync: 'Sync',
653
657
  tabDebug: 'Debug',
654
658
  testNoSessionHint: 'With “follow current session [current model]” selected, the provider [model] of the last session is used.',
@@ -735,13 +739,13 @@ const en = {
735
739
  defaultValue: 'default',
736
740
  resetDefault: 'Reset to default',
737
741
  featureProjectMenu: 'Project menu actions',
738
- featureProjectMenuDesc: 'Custom alias, switch folder, open folder and copy path in the project "More" menu (the alias also applies to the sidebar).',
742
+ featureProjectMenuDesc: 'Open folder and copy path in the project More menu (alias and folder switch retired).',
739
743
  featureTaskOrder: 'Sidebar session drag ordering',
740
- featureTaskOrderDesc: 'Makes session drags in Pinned, Projects and Groups persist across refreshes.',
744
+ featureTaskOrderDesc: 'Drag to reorder sessions in Pinned, Projects and Groups; survives restarts.',
741
745
  featureSessionSwitch: 'Session quick switch',
742
- featureSessionSwitchDesc: '{last} toggles between the current and the last session; hold alt and press {prev}/{next} to move the highlight across recently used sessions (10 shown initially, pressing {next} at the bottom loads 5 more), {recent} opens the last 10 directly, {attention} opens running / finished-but-unseen tasks; arrow keys also move the highlight, Enter or release alt to switch (like alt+tab)',
746
+ featureSessionSwitchDesc: '{last} toggles to the last session; alt + arrows pick recent sessions; keys remappable',
743
747
  featureTitleLock: 'Keep renamed session titles',
744
- featureTitleLockDesc: 'Sessions you renamed keep their custom title: after new replies the app may show an auto-generated title instead, which reverts after a restart; this keeps the renamed title in the sidebar.',
748
+ featureTitleLockDesc: 'Sessions you renamed keep their custom title in the sidebar.',
745
749
  tabTitleGen: 'Task name prompt',
746
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.',
747
751
  titleGenEnabled: 'Enable',
@@ -767,7 +771,7 @@ const en = {
767
771
  titleGenTestOk: 'Result: ',
768
772
  titleGenTestFailed: 'Generation failed',
769
773
  featureWsRunning: 'Running indicator when collapsed',
770
- featureWsRunningDesc: 'Shows the same spinning loader as running tasks on collapsed projects and on section headers (“Tasks”, “Pinned”) while any session is running; clears when they all finish.',
774
+ featureWsRunningDesc: 'Collapsed project and task headers show a loader while sessions run.',
771
775
  tabPerformance: 'Performance',
772
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.',
773
777
  featureIdleReclaim: 'Idle project memory reclaim',
@@ -777,15 +781,15 @@ const en = {
777
781
  idleReclaimStartupHint: 'Startup pre-spawns a process per restored project; this pass collects the unused ones once. 0 = reclaim right after startup, ignoring the idle minutes above',
778
782
  idleReclaimUnit: 'min',
779
783
  featureToolbarIcons: 'Sidebar menu in the top bar',
780
- featureToolbarIconsDesc: 'Turns the sidebar menu (New task / Search / Automations / Plugin store) into icon buttons next to the back/forward arrows in the top bar: hover shows the name, the button stays highlighted while its view is open, and shortcuts still work; the original sidebar menu is hidden.',
784
+ featureToolbarIconsDesc: 'New task / search / automations / plugin store become top-bar icon buttons.',
781
785
  tbNewTask: 'New task',
782
786
  tbSearch: 'Search',
783
787
  tbAutomations: 'Automations',
784
788
  tbPluginStore: 'Plugin store',
785
789
  featurePinnedCollapse: 'Collapsible Pinned section',
786
- featurePinnedCollapseDesc: 'The sidebar "Pinned" header collapses/expands its task list (like Projects and Groups); the state is remembered.',
790
+ featurePinnedCollapseDesc: 'The Pinned header collapses/expands its task list.',
787
791
  featureSandboxReclaim: 'Plugin card sandbox reclaim',
788
- featureSandboxReclaimDesc: 'Releases the oldest plugin-card sandboxes once the cap is hit (the one being viewed goes last), so new cards keep opening after the 64-slot pool fills up; released cards come back when their session is reopened (budget adjustable via sandboxReclaimBudget in the config file).',
792
+ featureSandboxReclaimDesc: 'Reclaims the oldest sandboxes at the 64 cap so new cards keep opening; released cards come back when their session is reopened.',
789
793
  featurePluginCardRetry: 'Plugin card auto-retry',
790
794
  featurePluginCardRetryDesc: 'Auto-clicks "Reload" on cards that failed the slot cap; they recover as soon as a slot frees up.',
791
795
  visionCardUi: 'Vision cards',
@@ -800,17 +804,17 @@ const en = {
800
804
  userFontDesc: 'Font of question text in conversations; "default" follows the UI font.',
801
805
  assistantFontName: 'Answer font',
802
806
  assistantFontDesc: 'Font of answer text in conversations (code blocks stay monospaced); "default" follows the UI font.',
803
- switcherHint: '{prev} / {next} or ↑ / ↓ to choose, Enter or release alt to switch, Esc to cancel',
807
+ switcherHint: '{prev} / {next} or ↑ / ↓ to choose, Enter or click a row to switch, Esc to cancel',
804
808
  switcherCurrent: 'current',
805
809
  switcherEmpty: 'No previous session yet (available after you switch sessions)',
806
810
  switcherFailed: 'Failed to switch to that session (it may have been deleted)',
807
811
  switcherMore: '{n} more · press c to load',
808
812
  switcherRunning: 'running',
809
813
  switcherUnseen: 'unseen',
810
- switcherAttentionHint: 'Running / finished but unseen tasks · {prev} / {next} or ↑ / ↓ to choose, Enter or release alt to switch',
814
+ switcherAttentionHint: 'Running / finished but unseen tasks · {prev} / {next} or ↑ / ↓ to choose, Enter or click a row to switch',
811
815
  switcherAttentionEmpty: 'No running or unseen tasks',
812
816
  featureNewtabPanels: 'Plugin panels on the new tab page',
813
- featureNewtabPanelsDesc: "The built-in \"new tab page\" only lists built-in panels and recommended official plugins; this adds cards for third-party marketplace plugin panels (headroom, rtk, …) that open in the side pane.",
817
+ featureNewtabPanelsDesc: "Adds third-party plugin panels (headroom, rtk, ...) to the new tab page; click to open in the side pane.",
814
818
  ntpDescSuffix: 'plugin panel',
815
819
  ntpNeedSession: 'Open a task session first, then open plugin panels from the new tab page',
816
820
  featureStatusBarDesc: 'Shows statistics at the bottom-right of the input box and at the end of each answer.',
@@ -868,6 +872,8 @@ const en = {
868
872
  themeBgPanel: 'Panel opacity',
869
873
  themeBgPanelHint: 'Opacity of sidebar, panels and tab bar. Lower reveals more of the image.',
870
874
  themeBgDeletedActive: 'Active background was deleted; background disabled',
875
+ tableCopyBtn: 'Copy table',
876
+ tableCopied: 'Table copied',
871
877
  sbItemCtx: 'Context usage',
872
878
  sbItemQuestions: 'Questions asked',
873
879
  sbMaster: 'Enable statistics',
@@ -902,8 +908,6 @@ const en = {
902
908
  hkArrow: 'Move the highlight while the popup is open (same rules as alt + {prev} / alt + {next})',
903
909
  hkEnter: 'Switch to the highlighted session',
904
910
  hkEsc: 'Cancel and close the popup',
905
- hkRelease: 'Releasing alt switches once the highlight has moved; otherwise the popup stays open for further selection',
906
- hkReleaseKey: 'release alt',
907
911
  hkModify: 'Change',
908
912
  hkRecording: 'press a key…',
909
913
  hkInvalid: 'Shortcuts accept a single letter or digit only',
@@ -920,7 +924,11 @@ const en = {
920
924
  featureFileActions: 'File menu actions',
921
925
  featureFileActionsDesc: 'Adds "Open with default app" and "Reveal in file manager" to the right-click menu of file links in chat.',
922
926
  featureImageCopy: 'Image right-click copy',
927
+ featureTableCopy: 'Copy table',
928
+ featureComposerProvider: 'Provider in model name',
923
929
  featureImageCopyDesc: 'Right-click an image in chat or the enlarged preview to copy it to the clipboard.',
930
+ featureTableCopyDesc: 'Copy-table button on the table toolbar; pastes into Excel / editors as a clean table.',
931
+ featureComposerProviderDesc: 'Shows the provider before the model name (e.g. BigModel-Max1 / glm-5.3).',
924
932
  imageCopy: 'Copy image',
925
933
  imageCopied: 'Image copied to the clipboard.',
926
934
  imageCopyFailed: 'Failed to copy the image.',
@@ -943,7 +951,7 @@ const en = {
943
951
  pluginsUpdatesAvailable: '{n} zcode-plugins update(s) available (ZCode Pro settings → Features)',
944
952
  pluginsAutoUpdated: 'zcode-plugins updated',
945
953
  tabVision: 'Vision',
946
- 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). Changes save automatically.',
954
+ 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).',
947
955
  visionEnabled: 'Enable',
948
956
  visionForceIntercept: 'Intercept even if the main model sees images',
949
957
  visionMode: 'Chain mode',
@@ -974,14 +982,14 @@ const en = {
974
982
  visionCompressKBHint: 'Images above this size are compressed first (max edge 2000, JPEG); 0 = never',
975
983
  visionLoadFailed: 'Failed to load the vision config',
976
984
  tabRtk: 'rtk',
977
- rtkDesc: 'rtk plugin: compresses common dev command output by 60-90% before it reaches the context (/rtk-* commands edit the same files). Changes save automatically and apply immediately.',
985
+ rtkDesc: 'rtk plugin: compresses common dev command output by 60-90% before it reaches the context (/rtk-* commands edit the same files).',
978
986
  rtkEnabled: 'Enable',
979
987
  rtkNotInstalled: 'rtk is not installed. The settings below take effect after installation (/rtk-setup in a session).',
980
988
  rtkInstallBin: 'Install rtk binary',
981
989
  rtkBinInstalled: 'rtk installed; PATH takes effect for sessions after signing out and back in — the plugin hook works immediately',
982
990
  rtkWhitelistTitle: 'Whitelist (pass through without compression)',
983
991
  rtkBuiltinLabel: 'Built-in exemptions (read-only, follow plugin updates):',
984
- rtkWhitelistDesc: 'Each entry is name (e.g. docker) or git:name (e.g. git:clone). Commands with tiny or no output need no compression; adding them skips compression. Built-ins (git add/commit/push, mkdir/cp, …) cannot be removed. Delete the file to reset.',
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.',
985
993
  rtkWhitelistPlaceholder: 'name or git:name, press Enter to add',
986
994
  rtkWhitelistAdd: 'Add',
987
995
  rtkWhitelistClear: 'Clear',
@@ -989,18 +997,18 @@ const en = {
989
997
  rtkWhitelistInvalid: 'Entry must be name or git:name',
990
998
  rtkLoadFailed: 'Failed to load the rtk config',
991
999
  tabHeadroom: 'Headroom',
992
- 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). Device and power-save changes apply immediately; switching the device restarts the proxy, so requests in progress may be interrupted once.',
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.',
993
1001
  headroomBinMissing: 'The headroom program was not found, so the proxy cannot start. The settings below take effect once it is installed.',
994
1002
  hrInstallBin: 'Install headroom binary',
995
- hrBinInstalled: 'headroom installed; reopen a session and the hook will start the proxy automatically',
1003
+ hrBinInstalled: 'headroom installed; reopen the app or a session and the proxy will start automatically',
996
1004
  headroomInstallTitle: 'headroom plugin not installed',
997
- headroomInstallDesc: 'Install it from the zcode-plugins marketplace to manage the compression proxy here; restarting the session afterwards is recommended.',
1005
+ headroomInstallDesc: 'Install it from the zcode-plugins marketplace to manage the compression proxy here; takes effect after a session restart.',
998
1006
  headroomInstall: 'Install',
999
1007
  headroomInstalling: 'Installing…',
1000
1008
  headroomInstalled: 'headroom plugin installed',
1001
1009
  headroomInstallRetry: 'Installation did not take effect; retry or install it from the marketplace manually',
1002
1010
  pluginInstallCardTitle: '{name} plugin not installed',
1003
- pluginInstallCardDesc: 'Install it from the zcode-plugins marketplace to manage it here; restarting the session afterwards is recommended.',
1011
+ pluginInstallCardDesc: 'Install it from the zcode-plugins marketplace to manage it here; takes effect after a session restart.',
1004
1012
  pluginInstallDone: '{name} plugin installed',
1005
1013
  pluginEnable: 'Enable',
1006
1014
  hrStarting: 'Starting compression proxy…',
@@ -1053,7 +1061,7 @@ const en = {
1053
1061
  headroomPowerSaverDesc: 'Only the system power-saver mode → CPU; back when it exits.',
1054
1062
  hrCpuPinnedHint: 'The compression device is pinned to CPU, so power-save switching no longer changes anything.',
1055
1063
  headroomInterval: 'Watch interval',
1056
- headroomIntervalDesc: 'Seconds between power checks (10–3600, default 60); applies from the next round, no restart needed.',
1064
+ headroomIntervalDesc: 'Seconds between power checks (10–3600, default 60); applies from the next round.',
1057
1065
  headroomSecUnit: 's',
1058
1066
  upgradeCheck: 'Check update',
1059
1067
  upgradeChecking: 'Checking…',