A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Move no data while another DSH holds the team
Fei24111d8ad2041380
diff --git a/app/src/first-run.mjs b/app/src/first-run.mjsindex 1252b71f..9c821117 100644--- a/app/src/first-run.mjs+++ b/app/src/first-run.mjs@@ -25,6 +25,7 @@ const TEXT = {moveDetail: from => `DeepSeek Bot copies its data there and starts again. ${from} stays as it is; you can delete it once everything works.`,move: 'Move and restart', cancel: 'Cancel',moving: 'Copying DeepSeek Bot\'s data…',+ moveInUse: 'Another DeepSeek Harness is using this data, so it was not moved. Close it, then try again.',moveFailed: message => `The data could not be copied: ${message}\n\nDeepSeek Bot goes on with its data where it was.`,found: (bots, rooms) => `DeepSeek Harness has a Bot team: ${bots} Bot${bots === 1 ? '' : 's'}${rooms > 0 ? `, ${rooms} group${rooms === 1 ? '' : 's'}` : ''}. Copy it into DeepSeek Bot?`,foundDetail: home => `The copy takes the Bots, groups, memories, chats, files, keys and model settings. Nothing in ${home} changes, and the two teams do not stay in step.`,@@ -54,6 +55,7 @@ const TEXT = {moveDetail: from => `DeepSeek Bot 会把数据复制过去,然后重新启动。${from} 会原样保留,确认一切正常后可以自己删掉。`,move: '移动并重启', cancel: '取消',moving: '正在复制 DeepSeek Bot 的数据…',+ moveInUse: '另一个 DeepSeek Harness 正在使用这份数据,所以没有移动。请先关掉它,再重试。',moveFailed: message => `数据没有复制成功:${message}\n\nDeepSeek Bot 会继续使用原来位置的数据。`,found: (bots, rooms) => `DeepSeek Harness 里有一个 Bot 团队:${bots} 个 Bot${rooms > 0 ? `、${rooms} 个群` : ''}。要复制到 DeepSeek Bot 吗?`,foundDetail: home => `会复制 Bot、群、记忆、对话、文件、密钥和模型设置。${home} 里的内容不会改变;复制以后两个团队各自独立。`,diff --git a/app/src/main.mjs b/app/src/main.mjsindex fb06d211..2aad03d5 100644--- a/app/src/main.mjs+++ b/app/src/main.mjs@@ -13,7 +13,7 @@ import { getDshRuntimeVersion } from '@deepseek-ai/dsh-app-boot'import electronUpdater from 'electron-updater'import { chooseLocations, localeText, saveLocations, text } from './first-run.mjs'import { HostProcess } from './host-process.mjs'-import { copySessions, findTeam, importTeam, userDshHome } from './import.mjs'+import { copySessions, findTeam, importTeam, teamInUse, userDshHome } from './import.mjs'import { copyData, moveProblem } from './move-data.mjs'import { CHECK_PROFILE, PROFILE } from './profile.mjs'import { UPDATE_TEXT, watchReleases, watchUpdates } from './updates.mjs'@@ -293,6 +293,12 @@ async function moveData(workspace) {const signal = copyAbort.signalcopying = (async () => {await stopHost()+ // Another DSH on the same data would go on writing while the copy is made.+ if (teamInUse(places.dataDir)) {+ await dialog.showMessageBox({ type: 'warning', title: 'DeepSeek Bot', message: t.moveInUse })+ app.relaunch()+ return+ }void mainWindow?.loadURL(`data:text/html;charset=utf-8,${encodeURIComponent(movingPage(t.moving))}`)mainWindow?.setProgressBar(2)try {