A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Leave updates to the desktop app in ds-bot's update checks
Fei241161bb789eb2d2
diff --git a/ds-bot/client.js b/ds-bot/client.jsindex 06cb5cd5..22b7d294 100644--- a/ds-bot/client.js+++ b/ds-bot/client.js@@ -825,6 +825,7 @@ var ZH = {"Update checks are off.": "已关闭更新检查。","Installed from a local folder; update it there.": "从本地文件夹安装,请在那里更新。","Updates are not offered for this install.": "这种安装方式不提供更新。",+ "Updates come with the DeepSeek Bot app.": "随 DeepSeek Bot 应用一起更新。",Links: "链接","Source code": "源代码","Release notes": "发布说明",@@ -11067,6 +11068,7 @@ function botHint(update) {if (update.phase === "installed") return t("Restart DSH to start using DS Bot {version}.", { version: update.installed ?? update.latest });if (update.phase === "failed") return t("The update did not finish: {reason}", { reason: hostText(update.error ?? "") });if (update.available) return t("DS Bot {version} is available", { version: update.latest });+ if (update.source === "app") return t("Updates come with the DeepSeek Bot app.");if (update.enabled === false) return t("Update checks are off.");if (update.source === "path") return t("Installed from a local folder; update it there.");if (!update.checkedAt) return null;@@ -11119,7 +11121,7 @@ function AboutPage({ useUpdate, actions, run, Section, Row: Row3 }) {const markState = checking ? "searching" : phase === "installing" || dshPhase === "installing" ? "working" : cheer ? "done" : "idle";const dshNew = showsDshRow(dsh, update.app);const dshShown = dshNew && dsh.available;- const botControl = phase === "installed" ? null : update.available || phase === "installing" ? (0, import_react29.createElement)(+ const botControl = phase === "installed" || update.source === "app" ? null : update.available || phase === "installing" ? (0, import_react29.createElement)("button",{ type: "button", className: "bt-fb-primary", disabled: phase === "installing", onClick: () => run(actions.installUpdate()) },phase === "installing" ? t("Updating…") : phase === "failed" ? t("Try again") : t("Update")diff --git a/ds-bot/src/client/about.js b/ds-bot/src/client/about.jsindex 393a32a8..f1a58fac 100644--- a/ds-bot/src/client/about.js+++ b/ds-bot/src/client/about.js@@ -20,6 +20,7 @@ function botHint(update) {if (update.phase === 'installed') return t('Restart DSH to start using DS Bot {version}.', { version: update.installed ?? update.latest })if (update.phase === 'failed') return t('The update did not finish: {reason}', { reason: hostText(update.error ?? '') })if (update.available) return t('DS Bot {version} is available', { version: update.latest })+ if (update.source === 'app') return t('Updates come with the DeepSeek Bot app.')if (update.enabled === false) return t('Update checks are off.')if (update.source === 'path') return t('Installed from a local folder; update it there.')if (!update.checkedAt) return null@@ -67,7 +68,7 @@ export function AboutPage({ useUpdate, actions, run, Section, Row }) {// Same rule as the sidebar card.const dshNew = showsDshRow(dsh, update.app)const dshShown = dshNew && dsh.available- const botControl = phase === 'installed' ? null+ const botControl = phase === 'installed' || update.source === 'app' ? null: update.available || phase === 'installing'? h('button', { type: 'button', className: 'bt-fb-primary', disabled: phase === 'installing', onClick: () => run(actions.installUpdate()) },phase === 'installing' ? t('Updating…') : phase === 'failed' ? t('Try again') : t('Update'))diff --git a/ds-bot/src/client/i18n.js b/ds-bot/src/client/i18n.jsindex 86d29097..06bb3594 100644--- a/ds-bot/src/client/i18n.js+++ b/ds-bot/src/client/i18n.js@@ -775,6 +775,7 @@ const ZH = {'Update checks are off.': '已关闭更新检查。','Installed from a local folder; update it there.': '从本地文件夹安装,请在那里更新。','Updates are not offered for this install.': '这种安装方式不提供更新。',+ 'Updates come with the DeepSeek Bot app.': '随 DeepSeek Bot 应用一起更新。',Links: '链接','Source code': '源代码','Release notes': '发布说明',diff --git a/ds-bot/src/host/dsh-update.js b/ds-bot/src/host/dsh-update.jsindex 607ba192..9dc83495 100644--- a/ds-bot/src/host/dsh-update.js+++ b/ds-bot/src/host/dsh-update.js@@ -101,10 +101,12 @@ export function install(rt) {try {status.current = await currentDsh()status.kind = installKind()+ // The desktop app pins its DSH and updates it as a whole, so it has nothing to offer.+ const inApp = process.env.DS_BOT_APP === '1'// The release the running package itself verified stays the floor: a bot// older than its own declaration has nothing newer to offer.- const declared = [{ verifiedDsh: PKG.dsBot?.verifiedDsh }]- const released = await releasedDeclaration(sourceOf(await installSpecOf(ctx)))+ const declared = inApp ? [] : [{ verifiedDsh: PKG.dsBot?.verifiedDsh }]+ const released = inApp ? null : await releasedDeclaration(sourceOf(await installSpecOf(ctx)))if (released) declared.push(released)const newestDeclared = declared.filter(entry => cleanVersion(entry.verifiedDsh))diff --git a/ds-bot/src/host/update.js b/ds-bot/src/host/update.jsindex 3f159957..7831eff9 100644--- a/ds-bot/src/host/update.js+++ b/ds-bot/src/host/update.js@@ -170,7 +170,8 @@ export function install(rt) {}async function runCheck() {- const source = sourceOf(await installSpecOf(ctx))+ // The desktop app updates as a whole, with this package inside it.+ const source = process.env.DS_BOT_APP === '1' ? { kind: 'app' } : sourceOf(await installSpecOf(ctx))status.source = source.kindlet found = nulltry {diff --git a/ds-bot/test/dsh-update.test.js b/ds-bot/test/dsh-update.test.jsindex 9074956d..bf5cf207 100644--- a/ds-bot/test/dsh-update.test.js+++ b/ds-bot/test/dsh-update.test.js@@ -117,6 +117,18 @@ test('a bundled package manager means the app owns the runtime: report only, nevassert.throws(() => rt.dshUpdateStart(), /updates with its app/)})+test('the desktop app pins its DSH: it reports the running version, asks no network and offers nothing', async (t) => {+ process.env.DS_BOT_APP = '1'+ t.after(() => { delete process.env.DS_BOT_APP })+ const { rt, fetched } = start({ app: true, source: `${PKG.name}@^${PKG.version}`, answers: registryLatest({ verifiedDsh: '9.9.9' }) })+ const view = await rt.dshUpdateCheck({ fresh: true })+ assert.equal(view.current, '0.1.0')+ assert.equal(view.kind, 'app')+ assert.equal(view.verified, null)+ assert.equal(view.available, false)+ assert.deepEqual(fetched, [])+})+test('without a running version there is nothing to compare against', async () => {const { rt } = start({ current: null, source: `${PKG.name}@^${PKG.version}` })const view = await rt.dshUpdateCheck()diff --git a/ds-bot/test/update.test.js b/ds-bot/test/update.test.jsindex b88ec95c..b647b621 100644--- a/ds-bot/test/update.test.js+++ b/ds-bot/test/update.test.js@@ -147,6 +147,17 @@ test('a linked checkout, an unversioned git install, or a disabled check never aassert.deepEqual(fetched, [])})+test('in the desktop app, which updates as a whole, it never asks the network and offers nothing', async (t) => {+ process.env.DS_BOT_APP = '1'+ t.after(() => { delete process.env.DS_BOT_APP })+ const { rt, fetched } = start({ source: `${PKG.name}@^${PKG.version}`, answers: { [`https://registry.npmjs.org/${PKG.name}/latest`]: { version: '9.0.0' } } })+ const view = await rt.updateCheck({ fresh: true })+ assert.equal(view.source, 'app')+ assert.equal(view.available, false)+ assert.deepEqual(fetched, [])+ assert.throws(() => rt.updateStart(), /No DS Bot update/)+})+test('the star count comes from the repository, is kept for an hour, and survives a failed answer', async () => {const repo = 'https://api.github.com/repos/Fei2411/DeepSeek-Bot'const answers = { [repo]: new Error('offline') }