Merge main into feat/conversation-title

This commit is contained in:
xmanrui 2026-09-01 17:22:49 +08:00
commit fd303b6c78
16 changed files with 156 additions and 125 deletions

View file

@ -74,7 +74,7 @@ const HELP_TEXT_LINES = [
'/new 开启一个全新会话',
'/compact 压缩当前会话的较早上下文',
'/history [数量] 查看最近历史消息(默认 3 条,最多 5 条)',
'/workspace 工作区绝对路径 切换工作区',
'/workspace 工作区序号或绝对路径 切换工作区',
'/workspacelist 列出工作区绝对路径',
'/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题',
'/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话',

View file

@ -153,6 +153,7 @@ function isFeishuLocalCommand(text, { hasImages = false, hasFiles = false } = {}
/** Canonical workspace/session help advertised by every bridge family. */
const WORKSPACE_HELP_LINES = [
'/workspace 工作区序号或绝对路径 切换工作区',
'/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话',
'/workspacelist 列出工作区绝对路径',
'/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题',

View file

@ -490,7 +490,7 @@ export function menuHelpText() {
'/sessionlist 或 /sessions 列出工作区会话',
'/session ID 绑定已有会话',
'/workspacelist 列出工作区',
'/workspace 路径 切换工作区',
'/workspace 工作区序号或绝对路径 切换工作区',
'/new 开启全新会话',
'',
'📊 状态 / 压缩',
@ -554,7 +554,7 @@ const HELP_TEXT_COMMANDS = [
'`/new` — 开启全新会话',
'`/session ID` — 绑定已有会话',
'`/sessionlist [工作区]` 或 `/sessions [工作区]` — 列出会话',
'`/workspace 路径` — 切换工作区',
'`/workspace 工作区序号或绝对路径` — 切换工作区',
'`/workspacelist` — 列出工作区',
'`/status` — 查看连接状态',
'`/compact` — 压缩上下文',

View file

@ -85,7 +85,7 @@ function helpText() {
t('/new 开启一个全新会话'),
t('/compact 压缩当前会话的较早上下文'),
t('/history [数量] 查看最近历史消息(默认 3 条,最多 5 条)'),
t('/workspace 工作区绝对路径 切换工作区'),
t('/workspace 工作区序号或绝对路径 切换工作区'),
t('/workspacelist 列出工作区绝对路径'),
t('/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题'),
t('/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话'),

View file

@ -227,7 +227,6 @@ export default {
'/sessionlist or /sessions List workspace sessions',
'/session ID 绑定已有会话': '/session ID Bind an existing session',
'/workspacelist 列出工作区': '/workspacelist List workspaces',
'/workspace 路径 切换工作区': '/workspace PATH Switch workspace',
'/new 开启全新会话': '/new Start a new session',
'📊 状态 / 压缩': '📊 Status / compact',
'/status 连接状态': '/status Connection status',
@ -247,8 +246,8 @@ export default {
'/steer 指令 给 Agent 补充指令': '/steer INSTRUCTION Steer the Agent',
'**📋 卡片功能**\n\n1. 会话下拉 — 切换当前绑定会话\n2. 工作区下拉 — 切换工作区\n3. 🤖 预设下拉 — 切换 Agent 预设\n4. 🧠 模型下拉 — 切换模型\n5. 🆕 新会话 — 开启全新会话\n6. 📋 会话/关注 — 查看/绑定会话,管理关注\n7. ⏹ 停止 — 停止当前任务\n8. 📐 压缩 — 压缩当前会话上下文\n9. 补充指令 — 给 Agent 发送指令\n10. 🗄 归档切换 — 显示/隐藏归档会话\n11. 📊 状态 — 查看系统连接状态\n12. 📖 帮助 — 查看本帮助':
'**📋 Card features**\n\n1. Session dropdown — switch the bound session\n2. Workspace dropdown — switch workspace\n3. 🤖 Preset dropdown — switch Agent Preset\n4. 🧠 Model dropdown — switch model\n5. 🆕 New session — start fresh\n6. 📋 Sessions/watches — view or bind sessions and manage watches\n7. ⏹ Stop — stop the current task\n8. 📐 Compact — compact the current session context\n9. Steer task — send an instruction to the Agent\n10. 🗄 Archived toggle — show or hide archived sessions\n11. 📊 Status — view connection status\n12. 📖 Help — view this help',
'**⌨️ 文本命令**\n\n`/m` — 打开菜单卡片\n`/new` — 开启全新会话\n`/session ID` — 绑定已有会话\n`/sessionlist [工作区]` 或 `/sessions [工作区]` — 列出会话\n`/workspace 路径` — 切换工作区\n`/workspacelist` — 列出工作区\n`/status` — 查看连接状态\n`/compact` — 压缩上下文\n`/stop` — 停止当前任务\n`/steer 指令` — 补充指令\n`/watch ID` — 关注会话\n`/watchlist` — 关注列表\n`/unwatch ID` — 取消关注\n`/archived on/off` — 归档显隐\n`/presetlist` 或 `/presets` — 列出预设\n`/preset [序号/ID]` — 切换预设\n`/preset --default` — 跟随默认\n`/models` — 列出模型\n`/reasoninglist` 或 `/reasonings` — 按序号列出当前模型可用推理等级\n`/reasoning [序号、等级ID或 --default]` — 查看或切换当前推理等级\n`/model [序号或完整模型ID] [推理等级ID]` — 查看或切换当前会话模型\n`/batch` — 开启批量输入(仅私聊,最多 10 条文字)\n`/send` — 提交当前批次\n`/cancel` — 取消当前批次\n`/repair` — 补全飞书权限与卡片回调':
'**⌨️ Text commands**\n\n`/m` — open the menu card\n`/new` — start a new session\n`/session ID` — bind an existing session\n`/sessionlist [workspace]` or `/sessions [workspace]` — list sessions\n`/workspace PATH` — switch workspace\n`/workspacelist` — list workspaces\n`/status` — view connection status\n`/compact` — compact context\n`/stop` — stop the current task\n`/steer INSTRUCTION` — steer the task\n`/watch ID` — watch a session\n`/watchlist` — list watched sessions\n`/unwatch ID` — stop watching\n`/archived on/off` — show or hide archived sessions\n`/presetlist` or `/presets` — list presets\n`/preset [index/ID]` — switch preset\n`/preset --default` — follow default\n`/models` — list models\n`/reasoninglist` or `/reasonings` — list reasoning efforts for the current model\n`/reasoning [index, effort ID, or --default]` — show or switch reasoning effort\n`/model [index or full model ID] [reasoning effort ID]` — show or switch the current Session model\n`/batch` — start batch input (direct messages only, up to 10 text messages)\n`/send` — submit the current batch\n`/cancel` — cancel the current batch\n`/repair` — complete Feishu permissions and the card callback',
'**⌨️ 文本命令**\n\n`/m` — 打开菜单卡片\n`/new` — 开启全新会话\n`/session ID` — 绑定已有会话\n`/sessionlist [工作区]` 或 `/sessions [工作区]` — 列出会话\n`/workspace 工作区序号或绝对路径` — 切换工作区\n`/workspacelist` — 列出工作区\n`/status` — 查看连接状态\n`/compact` — 压缩上下文\n`/stop` — 停止当前任务\n`/steer 指令` — 补充指令\n`/watch ID` — 关注会话\n`/watchlist` — 关注列表\n`/unwatch ID` — 取消关注\n`/archived on/off` — 归档显隐\n`/presetlist` 或 `/presets` — 列出预设\n`/preset [序号/ID]` — 切换预设\n`/preset --default` — 跟随默认\n`/models` — 列出模型\n`/reasoninglist` 或 `/reasonings` — 按序号列出当前模型可用推理等级\n`/reasoning [序号、等级ID或 --default]` — 查看或切换当前推理等级\n`/model [序号或完整模型ID] [推理等级ID]` — 查看或切换当前会话模型\n`/batch` — 开启批量输入(仅私聊,最多 10 条文字)\n`/send` — 提交当前批次\n`/cancel` — 取消当前批次\n`/repair` — 补全飞书权限与卡片回调':
'**⌨️ Text commands**\n\n`/m` — open the menu card\n`/new` — start a new session\n`/session ID` — bind an existing session\n`/sessionlist [workspace]` or `/sessions [workspace]` — list sessions\n`/workspace <workspace index or absolute path>` — switch workspace\n`/workspacelist` — list workspaces\n`/status` — view connection status\n`/compact` — compact context\n`/stop` — stop the current task\n`/steer INSTRUCTION` — steer the task\n`/watch ID` — watch a session\n`/watchlist` — list watched sessions\n`/unwatch ID` — stop watching\n`/archived on/off` — show or hide archived sessions\n`/presetlist` or `/presets` — list presets\n`/preset [index/ID]` — switch preset\n`/preset --default` — follow default\n`/models` — list models\n`/reasoninglist` or `/reasonings` — list reasoning efforts for the current model\n`/reasoning [index, effort ID, or --default]` — show or switch reasoning effort\n`/model [index or full model ID] [reasoning effort ID]` — show or switch the current Session model\n`/batch` — start batch input (direct messages only, up to 10 text messages)\n`/send` — submit the current batch\n`/cancel` — cancel the current batch\n`/repair` — complete Feishu permissions and the card callback',
'**💡 数字兜底**\n回复数字快速操作:\n**1**工作区列表 · **2**新会话 · **3**会话/关注\n**4**状态 · **5**补全权限 · **6**帮助':
'**💡 Number fallback**\nReply with a number for a quick action:\n**1** Workspace list · **2** New session · **3** Sessions/watches\n**4** Status · **5** Complete permissions · **6** Help',
'从下方下拉选择补充指令;最后一项可自定义输入。':

View file

@ -120,7 +120,8 @@ export default {
'{label}机器人已连接 DeepSeek Harness。': 'The {label} bot is connected to DeepSeek Harness.',
'/new 开启一个全新会话': '/new Start a brand-new session',
'/compact 压缩当前会话的较早上下文': '/compact Compact the earlier context of the current session',
'/workspace 工作区绝对路径 切换工作区': '/workspace <absolute workspace path> Switch workspace',
'/workspace 工作区序号或绝对路径 切换工作区':
'/workspace <workspace index or absolute path> Switch workspace',
'/workspacelist 列出工作区绝对路径': '/workspacelist List absolute workspace paths',
'/sessionlist [工作区序号或绝对路径] 列出会话 ID 和标题':
'/sessionlist [workspace index or absolute path] List session IDs and titles',

View file

@ -17,7 +17,8 @@ export default {
'当前 Harness Host 上存在的工作区({count}):':
'Workspaces on the current Harness Host ({count}):',
'(当前)': '(current)',
'切换用法:/workspace 工作区绝对路径': 'To switch: /workspace Workspace absolute path',
'切换用法:/workspace 工作区序号或绝对路径':
'To switch: /workspace Workspace index or absolute path',
'查看会话:/sessionlist 工作区序号或绝对路径':
'To view Sessions: /sessionlist Workspace index or absolute path',
'机器人正在移除或已重新接入,无法列出原会话的工作区。':
@ -80,10 +81,12 @@ export default {
'归档:{archived}': 'Archived: {archived}',
'是': 'Yes',
'否': 'No',
'用法:/workspace 工作区绝对路径': 'Usage: /workspace Workspace absolute path',
'用法:/workspace 工作区序号或绝对路径':
'Usage: /workspace Workspace index or absolute path',
'当前机器人暂不支持切换工作区。': 'This bot does not support switching Workspaces yet.',
'工作区已切换为:{workspace}': 'Workspace switched to: {workspace}',
'{message}\n用法:/workspace 工作区绝对路径': '{message}\nUsage: /workspace Workspace absolute path',
'{message}\n用法:/workspace 工作区序号或绝对路径':
'{message}\nUsage: /workspace Workspace index or absolute path',
'机器人正在移除或已重新接入,无法切换原会话的工作区。':
'The bot is being removed or has been reconnected; cannot switch the Workspace of the original Session.',

View file

@ -588,7 +588,7 @@ export class TextHarnessBridge {
t('/new 开启一个全新会话'),
t('/compact 压缩当前会话的较早上下文'),
t('/history [数量] 查看最近历史消息(默认 3 条,最多 5 条)'),
t('/workspace 工作区绝对路径 切换工作区'),
t('/workspace 工作区序号或绝对路径 切换工作区'),
t('/workspacelist 列出工作区绝对路径'),
t('/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题'),
t('/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话'),

View file

@ -142,7 +142,7 @@ async function runWorkspaceListCommand(match, harness) {
`${index + 1}. ${workspace}${workspace === current ? t('(当前)') : ''}`
)),
'',
t('切换用法:/workspace 工作区绝对路径'),
t('切换用法:/workspace 工作区序号或绝对路径'),
t('查看会话:/sessionlist 工作区序号或绝对路径'),
];
const message = lines.join('\n');
@ -366,18 +366,30 @@ export async function runWorkspaceCommand(text, harness, conversationKey) {
if (!match) return null;
const workspace = match[1]?.trim();
if (!workspace) {
return commandResult(t('用法:/workspace 工作区绝对路径'));
return commandResult(t('用法:/workspace 工作区序号或绝对路径'));
}
if (typeof harness?.switchWorkspace !== 'function') {
return commandResult(t('当前机器人暂不支持切换工作区。'));
}
try {
const current = await harness.switchWorkspace(workspace);
let selected = workspace;
if (/^\d+$/u.test(workspace)) {
if (typeof harness?.listWorkspaces !== 'function') {
return commandResult(t('当前机器人暂不支持按序号选择工作区。'));
}
const { paths } = await workspacePathSnapshot(harness);
const position = Number(workspace);
if (!Number.isSafeInteger(position) || position < 1 || position > paths.length) {
return commandResult(t('工作区序号不存在,请先执行 /workspacelist。'));
}
selected = paths[position - 1];
}
const current = await harness.switchWorkspace(selected);
return commandResult(t('工作区已切换为:{workspace}', { workspace: current }));
} catch (error) {
if (['workspace-not-absolute', 'workspace-not-found', 'workspace-not-directory'].includes(error?.code)) {
return commandResult(t(`{message}
用法:/workspace 工作区绝对路径`, { message: error.message }));
用法:/workspace 工作区序号或绝对路径`, { message: error.message }));
}
if (error?.code === 'workspace-bot-not-found') {
return commandResult(t('机器人正在移除或已重新接入,无法切换原会话的工作区。'));

View file

@ -68,7 +68,7 @@ function helpText() {
t('/new 开启一个全新会话'),
t('/compact 压缩当前会话的较早上下文'),
t('/history [数量] 查看最近历史消息(默认 3 条,最多 5 条)'),
t('/workspace 工作区绝对路径 切换工作区'),
t('/workspace 工作区序号或绝对路径 切换工作区'),
t('/workspacelist 列出工作区绝对路径'),
t('/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题'),
t('/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话'),

View file

@ -75,7 +75,7 @@ const HELP_TEXT = () => [
t('/new 开启一个全新会话'),
t('/compact 压缩当前会话的较早上下文'),
t('/history [数量] 查看最近历史消息(默认 3 条,最多 5 条)'),
t('/workspace 工作区绝对路径 切换工作区'),
t('/workspace 工作区序号或绝对路径 切换工作区'),
t('/workspacelist 列出工作区绝对路径'),
t('/sessionlist 或 /sessions [工作区序号或绝对路径] 列出会话 ID 和标题'),
t('/session Session ID 或当前工作区序号 将当前聊天绑定到指定会话'),