A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Tighten the computer-use copy and unshadow shared keys
Fei24113d8916fde0bf
diff --git a/ds-bot/client.js b/ds-bot/client.jsindex ac0d218e..593f6ad1 100644--- a/ds-bot/client.js+++ b/ds-bot/client.js@@ -122,7 +122,7 @@ var ZH = {Enable: "启用",Disable: "停用","Remove?": "确认移除?",- Off: "未连接",+ "Not connected": "未连接",Disabled: "已停用",Platform: "平台",Capabilities: "能力",@@ -374,7 +374,7 @@ var ZH = {"No browsers found": "没有找到浏览器","The Bot controls this browser": "Bot 正在控制此浏览器","The Bot is waiting for you": "Bot 正在等待你",- "waits for the computer": "在等电脑空出来",+ "waits for the computer": "等你停手","You control this browser": "你正在控制此浏览器","The Bot handed this browser to you: {reason}": "Bot 已将此浏览器交给你:{reason}","Take over": "接管",@@ -756,7 +756,7 @@ var ZH = {"Done when": "验收方法",Rules: "约束","Final check": "总验收",- "Waiting for you": "等你",+ "Waiting for you": "等你处理","Goal reached": "已达成","Stages": "阶段","Stage {n}: {title}": "第 {n} 阶段:{title}",@@ -1354,46 +1354,42 @@ var HOST_ZH = {"Let Bots use the computer": "允许 Bot 使用电脑","Using the computer": "在用电脑","Off": "关",- "View only": "只能看",- "Background": "后台",- "Foreground": "前台",+ "View only": "只看",+ "Background": "后台操作",+ "Foreground": "可以动前台",+ "In the foreground": "前台","Computer use level": "电脑操控等级",- "Provider": "提供方",+ "Computer provider": "提供方","Loading the provider…": "正在加载提供方…",- "Ready": "就绪","Could not load the provider": "提供方加载失败","The provider package is not installed": "提供方包未安装","Another computer-use provider is running": "另一个电脑操控提供方正在运行","Computer use is not available on this platform": "此平台不支持电脑操控",- "Retry": "重试","Accessibility": "辅助功能","Screen Recording": "屏幕录制","Allowed": "已允许","Not allowed": "未允许",- "Grant": "允许",- "Revoke": "收回",- "Off in Settings → Computer use": "已在 设置 → 电脑操控 中关闭",+ "Grant": "去授权",+ "Revoke": "撤销",+ "Off in Settings → Computer use": "已在设置中关闭","Idle": "空闲",- "You have the computer": "你在操控电脑",- "Waiting for you": "在等你",+ "Operating": "在操作",+ "You have the computer": "你在操作","Latest screenshot": "最新截图","Let it continue": "让它继续",- "Stop all": "全部停止",- "Take over": "我来接管",- "Hand back": "交还给它",+ "Take over the computer": "我来操作",+ "Hand back": "交还","Recent steps": "最近的操作","failed": "失败","Allow {name} to use {app}?": "允许 {name} 使用 {app} 吗?",- "Always lets it use {app} without asking again.": "选总是允许后它用这个应用就不再问了。","This time": "这一次",- "Always": "总是",- "the computer": "电脑",+ "Always": "一直允许","Needs your confirmation": "需要你确认",- "Help needed on the computer": "电脑上需要你帮忙",+ "Help needed on the computer": "需要你在电脑上帮忙","You control the computer": "你在操控电脑","Stop {name}": "停止 {name}","{name} · foreground": "{name} · 前台",- "{name} waits for the computer": "{name} 在等电脑空出来"+ "{name} waits for the computer": "{name} 等你停手"};Object.assign(ZH, HOST_ZH);var fill = (text, params) => params ? text.replace(/\{(\w+)\}/g, (match, name) => name in params ? String(params[name]) : match) : text;@@ -5235,7 +5231,7 @@ function ComputerPage({ roster, actions, run: run2, Section, Row: Row3, Switch:),computer.enabled ? (0, import_react10.createElement)(Section,- { key: "provider", title: t("Provider") },+ { key: "provider", title: t("Computer provider") },(0, import_react10.createElement)(Row3,{ label: t(PROVIDER_TEXT[provider.state]?.[0] ?? PROVIDER_TEXT.error[0]), hint: provider.message },@@ -5289,7 +5285,7 @@ function ComputerView({ bot, actions, hooks }) {current = false;};}, [entry.lastShot?.attachmentId]);- const controlLabel = { idle: "Idle", bot: "Working", user: "You have the computer", waiting: "Waiting for you" }[entry.state] ?? "Idle";+ const controlLabel = { idle: "Idle", bot: "Operating", user: "You have the computer", waiting: "Waiting for you" }[entry.state] ?? "Idle";return (0, import_react10.createElement)("div",{ className: "bt-cview" },@@ -5305,7 +5301,7 @@ function ComputerView({ bot, actions, hooks }) {"div",{ className: "bt-cview-actions" },(0, import_react10.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => void actions.computerStop(bot.id) }, t("Stop")),- entry.state !== "user" ? (0, import_react10.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => void actions.computerTakeover(bot.id) }, t("Take over")) : (0, import_react10.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => void actions.computerHandback(bot.id) }, t("Hand back"))+ entry.state !== "user" ? (0, import_react10.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => void actions.computerTakeover(bot.id) }, t("Take over the computer")) : (0, import_react10.createElement)("button", { type: "button", className: "bt-soft bt-soft-sm", onClick: () => void actions.computerHandback(bot.id) }, t("Hand back"))),entry.steps.length > 0 ? (0, import_react10.createElement)("div",@@ -5352,8 +5348,7 @@ function PendingAppAccess({ ask, actions, inline }) {(0, import_react10.createElement)("div",{ className: "bt-q-text" },- (0, import_react10.createElement)("p", { className: "bt-q-title", id: titleId }, t("Allow {name} to use {app}?", { name: ask.botName ?? "a Bot", app: ask.appName })),- (0, import_react10.createElement)("div", { className: "bt-q-detail" }, t("Always lets it use {app} without asking again.", { app: ask.appName }))+ (0, import_react10.createElement)("p", { className: "bt-q-title", id: titleId }, t("Allow {name} to use {app}?", { name: ask.botName ?? "a Bot", app: ask.appName })))),(0, import_react10.createElement)(@@ -5540,7 +5535,7 @@ function ComputerIndicator({ useComputer, useRoster, actions }) {return (0, import_react10.createElement)("span", { className: "bt-cbar-ava bt-cbar-ava-dot", style: { background: look.color } }, String(nameOf(id)).slice(0, 1));};const entries2 = [- ...leases.map((entry) => ({ key: `l:${entry.botId}`, botId: entry.botId, waiting: false, app: entry.kind === "foreground" ? t("Foreground") : entry.appName })),+ ...leases.map((entry) => ({ key: `l:${entry.botId}`, botId: entry.botId, waiting: false, app: entry.kind === "foreground" ? t("In the foreground") : entry.appName })),...waiting.map(([botId]) => ({ key: `w:${botId}`, botId, waiting: true, app: t("waits for the computer") }))];return (0, import_react10.createElement)(@@ -19985,11 +19980,11 @@ function QrPanel({ actions, platform, botId, onDone }) {);}function statusText3(status) {- if (status === void 0) return t("Off");+ if (status === void 0) return t("Not connected");if (status.state === "connecting") return t("Connecting…");if (status.state === "error") return t("Could not connect: {error}", { error: status.error ?? "" });if (status.state === "ready") return t("Connected");- return t("Off");+ return t("Not connected");}function TargetPicker({ value, roster, onChange, label }) {return (0, import_react45.createElement)(@@ -25328,8 +25323,8 @@ function apply(ctx) {const rows2 = (live2.leases ?? []).map((entry) => ({botId: entry.botId,name: name(entry.botId),- app: entry.kind === "foreground" ? t("Foreground") : entry.appName,- label: entry.kind === "foreground" ? `${name(entry.botId)} · ${t("Foreground")}` : `${name(entry.botId)} · ${entry.appName}`,+ app: entry.kind === "foreground" ? t("In the foreground") : entry.appName,+ label: entry.kind === "foreground" ? t("{name} · foreground", { name: name(entry.botId) }) : `${name(entry.botId)} · ${entry.appName}`,color: look(entry.botId).color,avatar: look(entry.botId).image}));diff --git a/ds-bot/src/client/computer.js b/ds-bot/src/client/computer.jsindex e49c9fda..5f0748ea 100644--- a/ds-bot/src/client/computer.js+++ b/ds-bot/src/client/computer.js@@ -60,7 +60,7 @@ export function ComputerPage({ roster, actions, run, Section, Row, Switch }) {h(Section, { key: 'switch' },h(Row, { label: t('Let Bots use the computer') },Switch === undefined ? null : h(Switch, { label: t('Let Bots use the computer'), on: computer.enabled === true, onChange: on => run(actions.computerSetEnabled(on)) }))),- computer.enabled ? h(Section, { key: 'provider', title: t('Provider') },+ computer.enabled ? h(Section, { key: 'provider', title: t('Computer provider') },h(Row, { label: t(PROVIDER_TEXT[provider.state]?.[0] ?? PROVIDER_TEXT.error[0]), hint: provider.message },['error', 'missing', 'occupied'].includes(provider.state) && actions.computerProviderRetry? h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => run(actions.computerProviderRetry()) }, t('Retry')) : null),@@ -97,7 +97,7 @@ export function ComputerView({ bot, actions, hooks }) {void Promise.resolve(actions.computerShot(id)).then(value => { if (current) setShot(value) }, () => {})return () => { current = false }}, [entry.lastShot?.attachmentId])- const controlLabel = { idle: 'Idle', bot: 'Working', user: 'You have the computer', waiting: 'Waiting for you' }[entry.state] ?? 'Idle'+ const controlLabel = { idle: 'Idle', bot: 'Operating', user: 'You have the computer', waiting: 'Waiting for you' }[entry.state] ?? 'Idle'return h('div', { className: 'bt-cview' },h('div', { className: 'bt-cview-head' },h('span', { className: 'bt-cview-state', 'data-state': entry.state }, t(controlLabel)),@@ -109,7 +109,7 @@ export function ComputerView({ bot, actions, hooks }) {h('div', { className: 'bt-cview-actions' },h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => void actions.computerStop(bot.id) }, t('Stop')),entry.state !== 'user'- ? h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => void actions.computerTakeover(bot.id) }, t('Take over'))+ ? h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => void actions.computerTakeover(bot.id) }, t('Take over the computer')): h('button', { type: 'button', className: 'bt-soft bt-soft-sm', onClick: () => void actions.computerHandback(bot.id) }, t('Hand back'))),entry.steps.length > 0 ? h('div', { className: 'bt-cview-steps' },h('div', { className: 'bt-section-title' }, t('Recent steps')),@@ -143,8 +143,7 @@ export function PendingAppAccess({ ask, actions, inline }) {h('section', { className: inline ? 'bt-q' : 'bt-q bt-q-raised', role: 'group', 'aria-labelledby': titleId },h('div', { className: 'bt-q-head' },h('div', { className: 'bt-q-text' },- h('p', { className: 'bt-q-title', id: titleId }, t('Allow {name} to use {app}?', { name: ask.botName ?? 'a Bot', app: ask.appName })),- h('div', { className: 'bt-q-detail' }, t('Always lets it use {app} without asking again.', { app: ask.appName })))),+ h('p', { className: 'bt-q-title', id: titleId }, t('Allow {name} to use {app}?', { name: ask.botName ?? 'a Bot', app: ask.appName })))),h('div', { className: 'bt-q-foot' },h('button', { type: 'button', className: 'bt-q-btn', onClick: () => answer('deny') }, t('Deny')),h('button', { type: 'button', className: 'bt-q-btn', onClick: () => answer('once') }, t('This time')),@@ -301,7 +300,7 @@ export function ComputerIndicator({ useComputer, useRoster, actions }) {return h('span', { className: 'bt-cbar-ava bt-cbar-ava-dot', style: { background: look.color } }, String(nameOf(id)).slice(0, 1))}const entries = [- ...leases.map(entry => ({ key: `l:${entry.botId}`, botId: entry.botId, waiting: false, app: entry.kind === 'foreground' ? t('Foreground') : entry.appName })),+ ...leases.map(entry => ({ key: `l:${entry.botId}`, botId: entry.botId, waiting: false, app: entry.kind === 'foreground' ? t('In the foreground') : entry.appName })),...waiting.map(([botId]) => ({ key: `w:${botId}`, botId, waiting: true, app: t('waits for the computer') })),]return h('div', { className: 'bt-cbar', role: 'status' },diff --git a/ds-bot/src/client/i18n.js b/ds-bot/src/client/i18n.jsindex 0e27035a..27757dcf 100644--- a/ds-bot/src/client/i18n.js+++ b/ds-bot/src/client/i18n.js@@ -86,7 +86,7 @@ const ZH = {Enable: '启用',Disable: '停用','Remove?': '确认移除?',- Off: '未连接',+ 'Not connected': '未连接',Disabled: '已停用',Platform: '平台',Capabilities: '能力',@@ -342,7 +342,7 @@ const ZH = {'No browsers found': '没有找到浏览器','The Bot controls this browser': 'Bot 正在控制此浏览器','The Bot is waiting for you': 'Bot 正在等待你',- 'waits for the computer': '在等电脑空出来',+ 'waits for the computer': '等你停手','You control this browser': '你正在控制此浏览器','The Bot handed this browser to you: {reason}': 'Bot 已将此浏览器交给你:{reason}','Take over': '接管',@@ -702,7 +702,7 @@ const ZH = {'Done when': '验收方法',Rules: '约束','Final check': '总验收',- 'Waiting for you': '等你',+ 'Waiting for you': '等你处理','Goal reached': '已达成','Stages': '阶段','Stage {n}: {title}': '第 {n} 阶段:{title}',@@ -1310,46 +1310,42 @@ const HOST_ZH = {'Let Bots use the computer': '允许 Bot 使用电脑','Using the computer': '在用电脑','Off': '关',- 'View only': '只能看',- 'Background': '后台',- 'Foreground': '前台',+ 'View only': '只看',+ 'Background': '后台操作',+ 'Foreground': '可以动前台',+ 'In the foreground': '前台','Computer use level': '电脑操控等级',- 'Provider': '提供方',+ 'Computer provider': '提供方','Loading the provider…': '正在加载提供方…',- 'Ready': '就绪','Could not load the provider': '提供方加载失败','The provider package is not installed': '提供方包未安装','Another computer-use provider is running': '另一个电脑操控提供方正在运行','Computer use is not available on this platform': '此平台不支持电脑操控',- 'Retry': '重试','Accessibility': '辅助功能','Screen Recording': '屏幕录制','Allowed': '已允许','Not allowed': '未允许',- 'Grant': '允许',- 'Revoke': '收回',- 'Off in Settings → Computer use': '已在 设置 → 电脑操控 中关闭',+ 'Grant': '去授权',+ 'Revoke': '撤销',+ 'Off in Settings → Computer use': '已在设置中关闭','Idle': '空闲',- 'You have the computer': '你在操控电脑',- 'Waiting for you': '在等你',+ 'Operating': '在操作',+ 'You have the computer': '你在操作','Latest screenshot': '最新截图','Let it continue': '让它继续',- 'Stop all': '全部停止',- 'Take over': '我来接管',- 'Hand back': '交还给它',+ 'Take over the computer': '我来操作',+ 'Hand back': '交还','Recent steps': '最近的操作','failed': '失败','Allow {name} to use {app}?': '允许 {name} 使用 {app} 吗?',- 'Always lets it use {app} without asking again.': '选总是允许后它用这个应用就不再问了。','This time': '这一次',- 'Always': '总是',- 'the computer': '电脑',+ 'Always': '一直允许','Needs your confirmation': '需要你确认',- 'Help needed on the computer': '电脑上需要你帮忙',+ 'Help needed on the computer': '需要你在电脑上帮忙','You control the computer': '你在操控电脑','Stop {name}': '停止 {name}','{name} · foreground': '{name} · 前台',- '{name} waits for the computer': '{name} 在等电脑空出来',+ '{name} waits for the computer': '{name} 等你停手',}Object.assign(ZH, HOST_ZH)diff --git a/ds-bot/src/client/im-page.js b/ds-bot/src/client/im-page.jsindex 52d83aec..c709b1bb 100644--- a/ds-bot/src/client/im-page.js+++ b/ds-bot/src/client/im-page.js@@ -80,11 +80,11 @@ function QrPanel({ actions, platform, botId, onDone }) {}function statusText(status) {- if (status === undefined) return t('Off')+ if (status === undefined) return t('Not connected')if (status.state === 'connecting') return t('Connecting…')if (status.state === 'error') return t('Could not connect: {error}', { error: status.error ?? '' })if (status.state === 'ready') return t('Connected')- return t('Off')+ return t('Not connected')}function TargetPicker({ value, roster, onChange, label }) {diff --git a/ds-bot/src/client/index.js b/ds-bot/src/client/index.jsindex 72642a6a..f1ace606 100644--- a/ds-bot/src/client/index.js+++ b/ds-bot/src/client/index.js@@ -753,8 +753,8 @@ export function apply(ctx) {const rows = (live.leases ?? []).map(entry => ({botId: entry.botId,name: name(entry.botId),- app: entry.kind === 'foreground' ? t('Foreground') : entry.appName,- label: entry.kind === 'foreground' ? `${name(entry.botId)} · ${t('Foreground')}` : `${name(entry.botId)} · ${entry.appName}`,+ app: entry.kind === 'foreground' ? t('In the foreground') : entry.appName,+ label: entry.kind === 'foreground' ? t('{name} · foreground', { name: name(entry.botId) }) : `${name(entry.botId)} · ${entry.appName}`,color: look(entry.botId).color,avatar: look(entry.botId).image,}))@@ -768,6 +768,7 @@ export function apply(ctx) {// Fresh cursor events ride the same sync; seq keeps each published once.for (const event of live.cursors ?? []) {if ((seenCursors.get(event.botId) ?? 0) >= event.seq) continue+ if (Number.isFinite(event.t) && Date.now() - event.t > 3000) continueseenCursors.set(event.botId, event.seq)if (typeof appComputer.computerCursor === 'function') {appComputer.computerCursor({ ...event, color: look(event.botId).color, avatar: look(event.botId).image })diff --git a/ds-bot/test/computer-ui.test.js b/ds-bot/test/computer-ui.test.jsindex 5ff52c94..cad4cc8a 100644--- a/ds-bot/test/computer-ui.test.js+++ b/ds-bot/test/computer-ui.test.js@@ -105,7 +105,7 @@ test('the computer view shows the state, steps and the action buttons', () => {actions: { computerShot: async () => ({ dataUrl: 'data:image/png;base64,x' }), computerStop: async () => {}, computerTakeover: async () => {}, computerHandback: async () => {} },hooks: { useComputer: pick => pick({ bots: { w1: { state: 'bot', app: 'Notes', steps: [{ time: 1, action: 'click', ok: true }] } } }) },})- assert.ok(texts(tree).includes('Take over') || texts(tree).includes('Hand back'))+ assert.ok(texts(tree).includes('Take over the computer') || texts(tree).includes('Hand back'))assert.ok(texts(tree).includes('Stop'))})