A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Give the start page copy one table and ten layers
AdamPlatin123dbea65089c61
diff --git a/app/src/first-run.mjs b/app/src/first-run.mjsindex 4f589cd5..c2c35b84 100644--- a/app/src/first-run.mjs+++ b/app/src/first-run.mjs@@ -7,57 +7,11 @@ import { homedir } from 'node:os'import { dirname, join } from 'node:path'import { findTeam, newerSessions, teamInUse, userDshHome } from './import.mjs'import { installFolder } from './move-data.mjs'+import { langOf, t } from './start/text.mjs'-const TEXT = {- en: {- pickRoot: 'Where DeepSeek Bot keeps its data',- inDsh: home => `Choose a folder outside the DeepSeek Harness data (${home}).`,- inProgram: 'Choose a folder outside the program folder: uninstalling removes it.',- pickMove: 'New folder for DeepSeek Bot data',- moveDrive: 'Choose a folder, not a whole drive.',- moveNested: 'Choose a folder outside the current data folder.',- moveWorkspace: 'The data folder and the team workspace cannot hold each other.',- moveNotEmpty: 'Choose an empty folder or a new one.',- moveConfirm: to => `Move DeepSeek Bot's data to ${to}?`,- 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',- 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.`,- copy: 'Copy', skip: 'Do not copy',- inUse: 'DeepSeek Harness is using this team. Close it, then try again.', retry: 'Try again',- newer: count => `${count} chat${count === 1 ? ' was' : 's were'} written by a newer DeepSeek Harness than this DeepSeek Bot can read. Update DeepSeek Bot, then start it again to copy the team.`,- quit: 'Quit', startEmpty: 'Start without the team',- whichModels: 'Which model settings should DeepSeek Bot use?',- failed: message => `The team could not be copied: ${message}\n\nDeepSeek Bot starts with a new team. The team in DeepSeek Harness is unchanged.`,- },- zh: {- pickRoot: '选择 DeepSeek Bot 放数据的位置',- inDsh: home => `请选择 DeepSeek Harness 数据(${home})以外的文件夹。`,- inProgram: '请选择程序文件夹以外的位置:卸载时会删掉程序文件夹。',- pickMove: '选择 DeepSeek Bot 数据的新文件夹',- moveDrive: '请选择一个文件夹,不要选整个磁盘。',- moveNested: '请选择现在的数据文件夹以外的位置。',- moveWorkspace: '数据文件夹和总工作区不能互相包含。',- moveNotEmpty: '请选择一个空文件夹,或者新建一个。',- moveConfirm: to => `把 DeepSeek Bot 的数据移到 ${to} 吗?`,- moveDetail: from => `DeepSeek Bot 会把数据复制过去,然后重新启动。${from} 会原样保留,确认一切正常后可以自己删掉。`,- move: '移动并重启', cancel: '取消',- 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} 里的内容不会改变;复制以后两个团队各自独立。`,- copy: '复制', skip: '不复制',- inUse: 'DeepSeek Harness 正在使用这个团队。请先关掉它,再重试。', retry: '重试',- newer: count => `有 ${count} 段对话是更新版本的 DeepSeek Harness 写的,这个版本的 DeepSeek Bot 读不了。请先更新 DeepSeek Bot,再打开它来复制团队。`,- quit: '退出', startEmpty: '不带团队开始',- whichModels: 'DeepSeek Bot 用哪一份模型设置?',- failed: message => `团队没有复制成功:${message}\n\nDeepSeek Bot 会用一个新团队开始。DeepSeek Harness 里的团队没有变化。`,- },-}-export const localeText = table => (app.getLocale().toLowerCase().startsWith('zh') ? table.zh : table.en)-export const text = () => localeText(TEXT)+// The system dialogs speak the language of the start page (main.mjs gives it the same locale).+export const lang = () => langOf(app.getLocale())+export const tx = (key, vars) => t(lang(), key, vars)const PROFILE_NAMES = { desktop: 'DSH Desktop', web: 'DSH Web' }const locationsFile = () => join(app.getPath('userData'), 'locations.json')@@ -91,7 +45,7 @@ export const programFolder = () => installFolder(app.getPath('exe'))*/export async function pickRoot(from, signal, ui) {try {- return await pick(text().pickRoot, from, signal, ui)+ return await pick(tx('dialog.pickRoot'), from, signal, ui)} catch (error) {if (error instanceof Quit) return undefinedthrow error@@ -120,7 +74,7 @@ export function teamsAt(dataDir = defaultPlaces().dataDir) {}/** @returns {Promise<{ offered: boolean, import?: { from: string, profile?: string }, quit?: true }>} */-async function offerImport(t, dataDir, signal, ui) {+async function offerImport(dataDir, signal, ui) {const from = userDshHome()let foundtry {@@ -129,18 +83,18 @@ async function offerImport(t, dataDir, signal, ui) {console.error(error)}if (found === undefined) return { offered: false }- if (await ask({ type: 'question', message: t.found(found.bots, found.rooms), detail: t.foundDetail(from), buttons: [t.copy, t.skip], defaultId: 0, cancelId: 1 }, signal, ui) === 1) return { offered: true }+ if (await ask({ type: 'question', message: tx('dialog.import.found', { bots: found.bots, groups: found.rooms }), detail: tx('dialog.import.foundDetail', { home: from }), buttons: [tx('btn.copy'), tx('btn.skipCopy')], defaultId: 0, cancelId: 1 }, signal, ui) === 1) return { offered: true }while (teamInUse(from)) {- if (await ask({ type: 'warning', message: t.inUse, buttons: [t.retry, t.skip], defaultId: 0, cancelId: 1 }, signal, ui) === 1) return { offered: true }+ if (await ask({ type: 'warning', message: tx('dialog.import.inUse'), buttons: [tx('btn.retry'), tx('btn.skipCopy')], defaultId: 0, cancelId: 1 }, signal, ui) === 1) return { offered: true }}const newer = newerSessions(from, found.team)if (newer.length > 0) {- if (await ask({ type: 'warning', message: t.newer(newer.length), buttons: [t.quit, t.startEmpty], defaultId: 0, cancelId: 0 }, signal, ui) === 0) return { offered: true, quit: true }+ if (await ask({ type: 'warning', message: tx('dialog.import.newer', { n: newer.length }), buttons: [tx('btn.quit'), tx('btn.startWithout')], defaultId: 0, cancelId: 0 }, signal, ui) === 0) return { offered: true, quit: true }return { offered: true }}const { profiles } = foundconst profile = profiles.length < 2 ? profiles[0]?.name- : profiles[await ask({ type: 'question', message: t.whichModels, buttons: profiles.map(entry => PROFILE_NAMES[entry.name] ?? entry.name), defaultId: 0, cancelId: 0 }, signal, ui)].name+ : profiles[await ask({ type: 'question', message: tx('dialog.import.whichModels'), buttons: profiles.map(entry => PROFILE_NAMES[entry.name] ?? entry.name), defaultId: 0, cancelId: 0 }, signal, ui)].namereturn { offered: true, import: { from, profile } }}@@ -173,7 +127,7 @@ export async function chooseLocations(signal, ui) {const { dataDir, workspace } = defaultPlaces()let offeredtry {- const offer = await offerImport(text(), dataDir, signal, ui)+ const offer = await offerImport(dataDir, signal, ui)if (offer.quit) return { quit: true }if (offer.import !== undefined) return { dataDir, workspace, import: offer.import, offered: true }offered = offer.offereddiff --git a/app/src/main.mjs b/app/src/main.mjsindex 0c5c2899..bc4f62e8 100644--- a/app/src/main.mjs+++ b/app/src/main.mjs@@ -17,6 +17,7 @@ import { captureStdio, LogFile } from './logs.mjs'import { currentRootOf, driveOf, formatBytes, freeSpace, isEmptyTree, pickFrom, placeOf, rootOf } from './place.mjs'import { readStartFrame, writeStartFrame } from './start-frame.mjs'import { explainOf, StartWindow } from './start-window.mjs'+import { langOf } from './start/text.mjs'import { CAPTION_HEIGHT, cssColor, micaAvailable, nativeThemeSource } from './window-frame.mjs'const IPC = {@@ -38,7 +39,7 @@ const IPC = {}// A cookie export larger than this is not a cookie export.const IMPORT_FILE_MAX = 32 * 1024 * 1024-const MOVE_PROBLEMS = { drive: 'moveDrive', nested: 'moveNested', workspace: 'moveWorkspace', program: 'inProgram', notEmpty: 'moveNotEmpty' }+const MOVE_PROBLEMS = { drive: 'dialog.move.drive', nested: 'dialog.move.nested', workspace: 'dialog.move.workspace', program: 'dialog.move.inProgram', notEmpty: 'dialog.move.notEmpty' }const UPDATE_CHECK_WAIT_MS = 15_000const UPDATE_DOWNLOAD_WAIT_MS = 15 * 60_000// Under this, the start page notes the drive's free space for the first 10 s (onboarding §3).@@ -54,9 +55,9 @@ const frameFile = join(app.getPath('userData'), 'start-frame.json')// Loaded once the start window is up (loadModules).let BotBrowserGuests, partitionOf, BotViews, isBotId, importFromBrowser, listSources, applyCookies, CookieImports, parseCookieFile-let downloadSaver, chooseLocations, defaultPlaces, localeText, pickRoot, programFolder, saveLocations, teamIn, teamsAt, text, HostProcess+let downloadSaver, chooseLocations, defaultPlaces, pickRoot, programFolder, saveLocations, teamIn, teamsAt, tx, HostProcesslet copySessions, findTeam, importTeam, teamInUse, userDshHome, copyData, moveProblem, CHECK_PROFILE, PROFILE-let UPDATE_TEXT, watchReleases, watchUpdates, getDshRuntimeVersion, electronUpdater+let watchReleases, watchUpdates, getDshRuntimeVersion, electronUpdaterlet mainWindow// Settles once the hidden team window exists.@@ -116,7 +117,7 @@ if (canonical !== undefined) {electron: { BrowserWindow, ipcMain, screen, shell, clipboard, nativeTheme, systemPreferences },page: join(here, 'start', 'start.html'), preload: join(here, 'preload.cjs'), icon: iconFile, mica, devTools: !app.isPackaged,// On Windows the locale is known only once the app is ready.- lang: () => (app.getLocale().toLowerCase().startsWith('zh') ? 'zh' : 'en'), motion: readStartFrame(frameFile).motion,+ lang: () => langOf(app.getLocale()), motion: readStartFrame(frameFile).motion,version: app.getVersion(), program: [dirname(process.execPath), process.resourcesPath, app.getAppPath()], log: logs, mainWindow: () => mainWindow,onRetry: () => { retry().catch(fail) },onReload: () => { mainWindow?.webContents.reload() },@@ -195,12 +196,12 @@ async function loadModules() {;({ applyCookies, CookieImports } = cookies);({ parseCookieFile } = cookieFiles);({ downloadSaver } = downloads)- ;({ chooseLocations, defaultPlaces, localeText, pickRoot, programFolder, saveLocations, teamIn, teamsAt, text } = firstRun)+ ;({ chooseLocations, defaultPlaces, pickRoot, programFolder, saveLocations, teamIn, teamsAt, tx } = firstRun);({ HostProcess } = hostProcess);({ copySessions, findTeam, importTeam, teamInUse, userDshHome } = imports);({ copyData, moveProblem } = moves);({ CHECK_PROFILE, PROFILE } = profile)- ;({ UPDATE_TEXT, watchReleases, watchUpdates } = updatesModule)+ ;({ watchReleases, watchUpdates } = updatesModule);({ getDshRuntimeVersion } = boot)electronUpdater = updater.defaultbrowserGuests = new BotBrowserGuests({ session, origin: () => origin, devTools: !app.isPackaged })@@ -599,8 +600,7 @@ async function copyTeam(where, signal) {const unreadable = await checkTeam(where, signal)if (signal.aborted) return 'stopped'if (unreadable > 0) {- const t = text()- const { response } = await startWindow.asking(dialog.showMessageBox(owner(), { type: 'warning', title: 'DeepSeek Bot', noLink: true, message: t.newer(unreadable), buttons: [t.quit, t.startEmpty], defaultId: 0, cancelId: 0, signal }))+ const { response } = await startWindow.asking(dialog.showMessageBox(owner(), { type: 'warning', title: 'DeepSeek Bot', noLink: true, message: tx('dialog.import.newer', { n: unreadable }), buttons: [tx('btn.quit'), tx('btn.startWithout')], defaultId: 0, cancelId: 0, signal }))if (signal.aborted) return 'stopped'if (response === 0) return 'quit'saveLocations(where)@@ -621,7 +621,7 @@ async function copyTeam(where, signal) {} catch (error) {if (signal.aborted) return 'stopped'console.error(error)- await startWindow.asking(dialog.showMessageBox(owner(), { type: 'warning', title: 'DeepSeek Bot', message: text().failed(error instanceof Error ? error.message : String(error)), signal }))+ await startWindow.asking(dialog.showMessageBox(owner(), { type: 'warning', title: 'DeepSeek Bot', message: tx('dialog.import.failed', { message: error instanceof Error ? error.message : String(error) }), signal }))if (signal.aborted) return 'stopped'} finally {signal.removeEventListener('abort', stopWarm)@@ -670,8 +670,7 @@ async function checkTeam(where, signal) {// folder; after a failed copy it starts again on the old one. The old folder stays.async function moveData(workspace) {if (copying !== undefined || stopping || mainWindow === undefined) return false- const t = text()- const { canceled, filePaths } = await dialog.showOpenDialog(owner(), { title: t.pickMove, defaultPath: dirname(places.dataDir), properties: ['openDirectory', 'createDirectory', 'promptToCreate'] })+ const { canceled, filePaths } = await dialog.showOpenDialog(owner(), { title: tx('dialog.pickMove'), defaultPath: dirname(places.dataDir), properties: ['openDirectory', 'createDirectory', 'promptToCreate'] })if (canceled || filePaths[0] === undefined) return falseconst to = resolve(filePaths[0])const dshHome = userDshHome()@@ -680,13 +679,13 @@ async function moveData(workspace) {for (const current of new Set([workspace, places.workspace])) {const problem = moveProblem({ from: places.dataDir, to, workspace: current, dshHome, program: app.isPackaged ? programFolder() : undefined })if (problem === undefined) continue- await dialog.showMessageBox(owner(), { type: 'warning', title: 'DeepSeek Bot', message: problem === 'dsh' ? t.inDsh(dshHome) : t[MOVE_PROBLEMS[problem]], buttons: ['OK'] })+ await dialog.showMessageBox(owner(), { type: 'warning', title: 'DeepSeek Bot', message: problem === 'dsh' ? tx('dialog.move.inDsh', { home: dshHome }) : tx(MOVE_PROBLEMS[problem]), buttons: [tx('btn.ok')] })return true}return false}if (await refused()) return false- const { response } = await dialog.showMessageBox(owner(), { type: 'question', title: 'DeepSeek Bot', noLink: true, message: t.moveConfirm(to), detail: t.moveDetail(places.dataDir), buttons: [t.move, t.cancel], defaultId: 0, cancelId: 1 })+ const { response } = await dialog.showMessageBox(owner(), { type: 'question', title: 'DeepSeek Bot', noLink: true, message: tx('dialog.move.confirm', { to }), detail: tx('dialog.move.detail', { from: places.dataDir }), buttons: [tx('btn.move'), tx('btn.cancel')], defaultId: 0, cancelId: 1 })if (response !== 0 || stopping || await refused()) return falseconst signal = copyAbort.signalcopying = (async () => {@@ -703,7 +702,7 @@ async function moveData(workspace) {}// Another DSH on the same data would go on writing while the copy is made.if (teamInUse(places.dataDir)) {- await dialog.showMessageBox(owner(), { type: 'warning', title: 'DeepSeek Bot', message: t.moveInUse })+ await dialog.showMessageBox(owner(), { type: 'warning', title: 'DeepSeek Bot', message: tx('dialog.move.inUse') })app.relaunch()return}@@ -720,7 +719,7 @@ async function moveData(workspace) {} catch (error) {if (signal.aborted) returnconsole.error(error)- await dialog.showMessageBox(owner(), { type: 'warning', title: 'DeepSeek Bot', message: t.moveFailed(error instanceof Error ? error.message : String(error)) })+ await dialog.showMessageBox(owner(), { type: 'warning', title: 'DeepSeek Bot', message: tx('dialog.move.failed', { message: error instanceof Error ? error.message : String(error) }) })} finally {setProgress(-1)}@@ -765,15 +764,13 @@ const afterHandoff = async () => { await startWindow.teamShown; return !failed }async function askRestart(version) {if (failed || !await afterHandoff()) return false- const t = localeText(UPDATE_TEXT)- const { response } = await dialog.showMessageBox(owner(), { type: 'info', title: 'DeepSeek Bot', message: t.ready(version), detail: t.readyDetail, buttons: [t.restart, t.later], defaultId: 0, cancelId: 1, noLink: true })+ const { response } = await dialog.showMessageBox(owner(), { type: 'info', title: 'DeepSeek Bot', message: tx('dialog.update.ready', { version }), detail: tx('dialog.update.readyDetail'), buttons: [tx('btn.restart'), tx('btn.notNowRestart')], defaultId: 0, cancelId: 1, noLink: true })return response === 0}async function askDownload(version) {if (failed || !await afterHandoff()) return false- const t = localeText(UPDATE_TEXT)- const { response } = await dialog.showMessageBox(owner(), { type: 'info', title: 'DeepSeek Bot', message: t.available(version), detail: t.availableDetail, buttons: [t.download, t.later], defaultId: 0, cancelId: 1, noLink: true })+ const { response } = await dialog.showMessageBox(owner(), { type: 'info', title: 'DeepSeek Bot', message: tx('dialog.update.available', { version }), detail: tx('dialog.update.availableDetail'), buttons: [tx('btn.download'), tx('btn.notNowDownload')], defaultId: 0, cancelId: 1, noLink: true })return response === 0}@@ -883,8 +880,7 @@ async function fail(error) {startWindow.fail(error, startKind())const found = await Promise.race([updates?.latest() ?? null, sleep(UPDATE_CHECK_WAIT_MS).then(() => null)])if (!found || mine !== attempt) return- const t = localeText(UPDATE_TEXT)- await dialog.showMessageBox(owner(), { type: 'info', title: 'DeepSeek Bot', message: found.page ? t.onFailurePage(found.version) : t.onFailure(found.version) })+ await dialog.showMessageBox(owner(), { type: 'info', title: 'DeepSeek Bot', message: tx(found.page ? 'dialog.update.onFailurePage' : 'dialog.update.onFailure', { version: found.version }) })if (found.page) {if (!process.env.DS_BOT_HOME) await shell.openExternal(found.page)returndiff --git a/app/src/start/start.html b/app/src/start/start.htmlindex bbc84752..e45251fd 100644--- a/app/src/start/start.html+++ b/app/src/start/start.html@@ -19,34 +19,34 @@</div></div></div></div></div></div><div class="whale-hit" aria-hidden="true"></div><div class="fx" aria-hidden="true"><span class="trace"></span><span class="trace"></span><span class="ripple"></span></div>-<ol class="track sr" data-t-label="track.label">-<li class="station" data-phase="data" data-state="pending"><span data-t="phase.data"></span> <span class="sr"></span></li>-<li class="station" data-phase="engine" data-state="pending"><span data-t="phase.engine"></span> <span class="sr"></span></li>-<li class="station" data-phase="team" data-state="pending"><span data-t="phase.team"></span> <span class="sr"></span></li>+<ol class="track sr" data-t-label="status.track">+<li class="station" data-phase="data" data-state="pending"><span data-t="status.phase.data"></span> <span class="sr"></span></li>+<li class="station" data-phase="engine" data-state="pending"><span data-t="status.phase.engine"></span> <span class="sr"></span></li>+<li class="station" data-phase="team" data-state="pending"><span data-t="status.phase.team"></span> <span class="sr"></span></li></ol><p class="voice"><span></span></p>-<p class="caption"><span class="caption-text"></span><button class="btn" data-look="small" data-act="openLogs" data-t="openLogs" hidden></button></p>+<p class="caption"><span class="caption-text"></span><button class="btn" data-look="small" data-act="openLogs" data-t="btn.openLogs" hidden></button></p><section class="sheet"><div class="sheet-edge"></div><div class="sheet-fill"></div><div class="sheet-body">-<section class="card" data-kind="recommend" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.{reason}"></h2><p class="lead"><span data-t="card.reason.{reason}"></span> <span class="ask" data-t="card.recommend.ask"></span></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="rec" data-rec data-t="card.recommend.use"></button><button class="btn" data-look="soft" data-act="answer" data-detail="keep" data-keep data-t="card.recommend.keep"></button><button class="btn" data-look="link" data-act="pick" data-rec data-t="card.recommend.other"></button><button class="btn" data-look="primary" data-act="pick" data-norec data-t="pickOther"></button><p class="foot" data-t="card.footnote"></p></div></section>-<section class="card" data-kind="rejected" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.rejected"></h2><p class="lead" data-t="card.rejected.{reason}"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="pick" data-t="card.picked.repick"></button><button class="btn" data-look="soft" data-act="answer" data-detail="rec" data-rec data-t="card.recommend.use"></button><button class="btn" data-look="soft" data-act="answer" data-detail="keep" data-keep data-t="card.recommend.keep"></button><p class="foot" data-t="card.footnote"></p></div></section>-<section class="card" data-kind="missing" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.missing"></h2><p class="lead" data-t="card.missing"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="retry" data-t="retry"></button><button class="btn" data-look="soft" data-act="pick" data-t="card.missing.relocate"></button><button class="btn" data-look="soft" data-act="freshStart" data-t="freshStart"></button></div><p class="miss" data-t="card.missing.retryMissed" hidden></p><p class="foot" data-t="card.footnote"></p></section>-<section class="card" data-kind="picked" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.picked"></h2><p class="lead" data-t="card.picked"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="use" data-t="card.picked.use"></button><button class="btn" data-look="soft" data-act="pick" data-t="card.picked.repick"></button><p class="foot" data-t="card.footnote"></p></div></section>-<section class="card" data-kind="import" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.import"></h2><p class="lead" data-t="import.lead"></p><p class="small extra-row"><span data-t="import.extra"></span><button class="btn disclose" data-look="link" data-act="toggleMore" aria-expanded="false"><span data-t="import.more"></span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 6.2 8 9.7l3.5-3.5"/></svg></button></p><div class="more" hidden><p class="small ink" data-t="import.found"></p><p class="small" data-t="import.scope"></p><p class="small ink model-row"><span data-t="import.model"></span><button class="btn" data-look="link" data-act="toggleModels" aria-expanded="false" data-t="import.change"></button></p><ul class="models" hidden></ul><div class="opts"><label><input type="checkbox" data-opt="regen"><span data-t="import.opt.regen"></span></label><label><input type="checkbox" data-opt="skipWork"><span data-t="import.opt.skipWork"></span></label></div></div></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="copy" data-t="import.copy"></button><button class="btn" data-look="soft" data-act="answer" data-detail="skip" data-t="import.skip"></button><p class="foot" data-t="import.footnote"></p></div></section>-<section class="card" data-kind="importSpace" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.importSpace"></h2><p class="lead" data-t="import.space"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="pick" data-t="pickOther"></button><button class="btn" data-look="soft" data-act="answer" data-detail="skip" data-t="import.skip"></button></div></section>-<section class="card" data-kind="copying" hidden><div class="card-scroll"><h2 class="card-title" data-t="copying.title"></h2><div class="copy-steps"><ol class="steps"><li data-step="1"><span class="mark" aria-hidden="true"><span class="dot"></span><svg class="check" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8"/><path d="M4.6 8.3 7 10.6l4.4-4.9"/></svg></span><span data-t="copying.step1"></span></li><li data-step="2"><span class="mark" aria-hidden="true"><span class="dot"></span><svg class="check" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8"/><path d="M4.6 8.3 7 10.6l4.4-4.9"/></svg></span><span data-t="copying.step2"></span></li><li data-step="3"><span class="mark" aria-hidden="true"><span class="dot"></span><svg class="check" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8"/><path d="M4.6 8.3 7 10.6l4.4-4.9"/></svg></span><span data-t="copying.step3"></span></li></ol><div class="bar" aria-hidden="true"><span class="bar-fill"></span></div></div><div class="confirm" hidden><p class="lead" data-t="stop.confirm"></p></div></div><div class="card-actions"><span class="eta small"></span><button class="btn stop" data-look="soft" data-act="stopCopy" data-t="stop"></button><button class="btn" data-look="primary" data-act="keepCopying" data-confirm data-t="keepCopying"></button><button class="btn danger" data-look="soft" data-act="stopCopy" data-detail="confirm" data-confirm data-t="stop"></button></div></section>-<section class="card" data-kind="inUse" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.inUse"></h2><p class="lead" data-t="inUse"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="skip" data-t="import.skip"></button></div></section>-<section class="card" data-kind="newerUpdating" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.newer"></h2><p class="lead" data-t="newer.updating"></p><p class="small"><span data-t="update.slow"></span> <button class="btn" data-look="link" data-act="manualDownload" data-t="manualDownload"></button></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="skip" data-t="import.skip"></button></div></section>-<section class="card" data-kind="newer" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.newer"></h2><p class="lead" data-t="newer.unreadable"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="startWithout" data-t="startWithout"></button><p class="foot" data-t="newer.footnote"></p></div></section>-<section class="card" data-kind="importFailed" hidden><div class="card-scroll"><p class="lead" data-t="importFailed"></p><div class="card-actions"><button class="btn" data-look="primary" data-act="retry" data-t="retry"></button><button class="btn" data-look="soft" data-act="answer" data-detail="startWithout" data-t="startWithout"></button><button class="btn" data-look="soft" data-act="copyDetails" data-t="copyDetails"></button><button class="btn disclose" data-look="link" data-act="toggleDetails" aria-expanded="false"><span data-t="details"></span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 6.2 8 9.7l3.5-3.5"/></svg></button></div><div class="log" hidden><pre></pre></div></div></section>-<section class="card" data-kind="watchdog" hidden><div class="card-actions"><button class="btn" data-look="primary" data-act="wait" data-t="wait"></button><button class="btn" data-look="soft" data-act="retry" data-t="retry"></button><button class="btn" data-look="soft" data-act="openLogs" data-t="openLogs"></button></div></section>-<section class="card" data-kind="failed" hidden><div class="card-scroll"><p class="lead" data-t="failed.reason.{reason}"></p><div class="banner" hidden><div class="banner-row"><p class="lead" data-t="update.available"></p><button class="btn" data-look="primary" data-act="installUpdate" data-u="available" data-t="update.install"></button></div><div class="banner-down" data-u="downloading"><p class="small banner-line"><span data-t="update.downloading"></span><span class="slow"><span data-t="update.slow"></span><button class="btn" data-look="link" data-act="manualDownload" data-t="manualDownload"></button></span></p><div class="bar"><span class="bar-fill"></span></div></div><p class="small" data-u="installing" data-t="update.installing"></p><div class="banner-fail" data-u="failed"><p class="small danger" data-t="update.failed"></p><button class="btn" data-look="small" data-act="installUpdate" data-t="retry"></button><button class="btn" data-look="small" data-act="manualDownload" data-t="manualDownload"></button></div></div><div class="card-actions"><button class="btn" data-look="primary" data-act="retry" data-main data-t="retry"></button><button class="btn" data-look="soft" data-act="pick" data-detail="changePlace" data-places data-t="changePlace" hidden></button><button class="btn" data-look="soft" data-act="freshStart" data-places data-t="freshStart" hidden></button><button class="btn" data-look="soft" data-act="openLogs" data-t="openLogs"></button><button class="btn" data-look="soft" data-act="copyDetails" data-t="copyDetails"></button><button class="btn disclose" data-look="link" data-act="toggleDetails" aria-expanded="false"><span data-t="details"></span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 6.2 8 9.7l3.5-3.5"/></svg></button></div><div class="log" hidden><pre></pre></div></div></section>-<section class="card" data-kind="viewFailed" hidden><div class="card-actions"><button class="btn" data-look="primary" data-act="reloadView" data-t="reload"></button><button class="btn" data-look="soft" data-act="openLogs" data-t="openLogs"></button><button class="btn" data-look="soft" data-act="copyDetails" data-t="copyDetails"></button></div></section>+<section class="card" data-kind="recommend" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.{reason}"></h2><p class="lead"><span data-t="reason.place.{reason}"></span> <span class="ask" data-t="card.recommend.ask"></span></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="rec" data-rec data-t="btn.useRec"></button><button class="btn" data-look="soft" data-act="answer" data-detail="keep" data-keep data-t="btn.keepDrive"></button><button class="btn" data-look="link" data-act="pick" data-rec data-t="btn.otherPlace"></button><button class="btn" data-look="primary" data-act="pick" data-norec data-t="btn.pickPlace"></button><p class="foot" data-t="note.changeLater"></p></div></section>+<section class="card" data-kind="rejected" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.rejected"></h2><p class="lead" data-t="reason.place.{reason}"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="pick" data-t="btn.repick"></button><button class="btn" data-look="soft" data-act="answer" data-detail="rec" data-rec data-t="btn.useRec"></button><button class="btn" data-look="soft" data-act="answer" data-detail="keep" data-keep data-t="btn.keepDrive"></button><p class="foot" data-t="note.changeLater"></p></div></section>+<section class="card" data-kind="missing" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.missing"></h2><p class="lead" data-t="card.missing.lead"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="retry" data-t="btn.retry"></button><button class="btn" data-look="soft" data-act="pick" data-t="btn.relocate"></button><button class="btn" data-look="soft" data-act="freshStart" data-t="btn.freshStart"></button></div><p class="miss" data-t="card.missing.retryMissed" hidden></p><p class="foot" data-t="note.changeLater"></p></section>+<section class="card" data-kind="picked" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.picked"></h2><p class="lead" data-t="card.picked.lead"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="use" data-t="btn.continue"></button><button class="btn" data-look="soft" data-act="pick" data-t="btn.repick"></button><p class="foot" data-t="note.changeLater"></p></div></section>+<section class="card" data-kind="import" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.import"></h2><p class="lead" data-t="card.import.lead"></p><p class="small extra-row"><span data-t="card.import.extra"></span><button class="btn disclose" data-look="link" data-act="toggleMore" aria-expanded="false"><span data-t="btn.more"></span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 6.2 8 9.7l3.5-3.5"/></svg></button></p><div class="more" hidden><p class="small ink" data-t="card.import.found"></p><p class="small" data-t="card.import.scope"></p><p class="small ink model-row"><span data-t="card.import.model"></span><button class="btn" data-look="link" data-act="toggleModels" aria-expanded="false" data-t="btn.changeModel"></button></p><ul class="models" hidden></ul><div class="opts"><label><input type="checkbox" data-opt="regen"><span data-t="card.import.optRegen"></span></label><label><input type="checkbox" data-opt="skipWork"><span data-t="card.import.optSkipWork"></span></label></div></div></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="copy" data-t="btn.copy"></button><button class="btn" data-look="soft" data-act="answer" data-detail="skip" data-t="btn.skipCopy"></button><p class="foot" data-t="note.copyLater"></p></div></section>+<section class="card" data-kind="importSpace" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.importSpace"></h2><p class="lead" data-t="card.importSpace.lead"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="pick" data-t="btn.pickPlace"></button><button class="btn" data-look="soft" data-act="answer" data-detail="skip" data-t="btn.skipCopy"></button></div></section>+<section class="card" data-kind="copying" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.copying"></h2><div class="copy-steps"><ol class="steps"><li data-step="1"><span class="mark" aria-hidden="true"><span class="dot"></span><svg class="check" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8"/><path d="M4.6 8.3 7 10.6l4.4-4.9"/></svg></span><span data-t="card.copying.step1"></span></li><li data-step="2"><span class="mark" aria-hidden="true"><span class="dot"></span><svg class="check" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8"/><path d="M4.6 8.3 7 10.6l4.4-4.9"/></svg></span><span data-t="card.copying.step2"></span></li><li data-step="3"><span class="mark" aria-hidden="true"><span class="dot"></span><svg class="check" viewBox="0 0 16 16"><circle cx="8" cy="8" r="8"/><path d="M4.6 8.3 7 10.6l4.4-4.9"/></svg></span><span data-t="card.copying.step3"></span></li></ol><div class="bar" aria-hidden="true"><span class="bar-fill"></span></div></div><div class="confirm" hidden><p class="lead" data-t="card.copying.stopConfirm"></p></div></div><div class="card-actions"><span class="eta small"></span><button class="btn stop" data-look="soft" data-act="stopCopy" data-t="btn.stopCopy"></button><button class="btn" data-look="primary" data-act="keepCopying" data-confirm data-t="btn.keepCopying"></button><button class="btn danger" data-look="soft" data-act="stopCopy" data-detail="confirm" data-confirm data-t="btn.stopCopy"></button></div></section>+<section class="card" data-kind="inUse" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.inUse"></h2><p class="lead" data-t="card.inUse.lead"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="skip" data-t="btn.skipCopy"></button></div></section>+<section class="card" data-kind="newerUpdating" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.newer"></h2><p class="lead" data-t="card.newerUpdating.lead"></p><p class="small"><span data-t="card.update.slow"></span> <button class="btn" data-look="link" data-act="manualDownload" data-t="btn.manualDownload"></button></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="skip" data-t="btn.skipCopy"></button></div></section>+<section class="card" data-kind="newer" hidden><div class="card-scroll"><h2 class="card-title" data-t="say.newer"></h2><p class="lead" data-t="card.newer.lead"></p></div><div class="card-actions"><button class="btn" data-look="primary" data-act="answer" data-detail="startWithout" data-t="btn.startWithout"></button><p class="foot" data-t="note.copyAgain"></p></div></section>+<section class="card" data-kind="importFailed" hidden><div class="card-scroll"><p class="lead" data-t="card.importFailed.lead"></p><div class="card-actions"><button class="btn" data-look="primary" data-act="retry" data-t="btn.retry"></button><button class="btn" data-look="soft" data-act="answer" data-detail="startWithout" data-t="btn.startWithout"></button><button class="btn" data-look="soft" data-act="copyDetails" data-t="btn.copyDetails"></button><button class="btn disclose" data-look="link" data-act="toggleDetails" aria-expanded="false"><span data-t="btn.details"></span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 6.2 8 9.7l3.5-3.5"/></svg></button></div><div class="log" hidden><pre></pre></div></div></section>+<section class="card" data-kind="watchdog" hidden><div class="card-actions"><button class="btn" data-look="primary" data-act="wait" data-t="btn.wait"></button><button class="btn" data-look="soft" data-act="retry" data-t="btn.retry"></button><button class="btn" data-look="soft" data-act="openLogs" data-t="btn.openLogs"></button></div></section>+<section class="card" data-kind="failed" hidden><div class="card-scroll"><p class="lead" data-t="reason.start.{reason}"></p><div class="banner" hidden><div class="banner-row"><p class="lead" data-t="card.update.available"></p><button class="btn" data-look="primary" data-act="installUpdate" data-u="available" data-t="btn.install"></button></div><div class="banner-down" data-u="downloading"><p class="small banner-line"><span data-t="card.update.downloading"></span><span class="slow"><span data-t="card.update.slow"></span><button class="btn" data-look="link" data-act="manualDownload" data-t="btn.manualDownload"></button></span></p><div class="bar"><span class="bar-fill"></span></div></div><p class="small" data-u="installing" data-t="card.update.installing"></p><div class="banner-fail" data-u="failed"><p class="small danger" data-t="card.update.failed"></p><button class="btn" data-look="small" data-act="installUpdate" data-t="btn.retry"></button><button class="btn" data-look="small" data-act="manualDownload" data-t="btn.manualDownload"></button></div></div><div class="card-actions"><button class="btn" data-look="primary" data-act="retry" data-main data-t="btn.retry"></button><button class="btn" data-look="soft" data-act="pick" data-detail="changePlace" data-places data-t="btn.changePlace" hidden></button><button class="btn" data-look="soft" data-act="freshStart" data-places data-t="btn.freshStart" hidden></button><button class="btn" data-look="soft" data-act="openLogs" data-t="btn.openLogs"></button><button class="btn" data-look="soft" data-act="copyDetails" data-t="btn.copyDetails"></button><button class="btn disclose" data-look="link" data-act="toggleDetails" aria-expanded="false"><span data-t="btn.details"></span><svg viewBox="0 0 16 16" aria-hidden="true"><path d="M4.5 6.2 8 9.7l3.5-3.5"/></svg></button></div><div class="log" hidden><pre></pre></div></div></section>+<section class="card" data-kind="viewFailed" hidden><div class="card-actions"><button class="btn" data-look="primary" data-act="reloadView" data-t="btn.reload"></button><button class="btn" data-look="soft" data-act="openLogs" data-t="btn.openLogs"></button><button class="btn" data-look="soft" data-act="copyDetails" data-t="btn.copyDetails"></button></div></section></div></section></main>-<footer class="footrow"><span class="note" data-t="footer"></span><p class="place" hidden><span class="place-text"></span><span aria-hidden="true">·</span><button class="btn" data-look="link" data-act="pick" data-detail="changePlace" data-t="place.change"></button></p></footer>+<footer class="footrow"><span class="note" data-t="foot.community"></span><p class="place" hidden><span class="place-text"></span><span aria-hidden="true">·</span><button class="btn" data-look="link" data-act="pick" data-detail="changePlace" data-t="btn.changePlace"></button></p></footer><p class="sr live" aria-live="polite"></p></body></html>diff --git a/app/src/start/start.js b/app/src/start/start.jsindex a90efb99..29208b1c 100644--- a/app/src/start/start.js+++ b/app/src/start/start.js@@ -3,7 +3,7 @@// region). The whale, its rings and the hidden stage list belong to the director in whale.js;// the whale's line follows where the director has the whale, not the snapshot alone. Text is// set only through textContent (and text nodes), never as markup.-import { t } from './text.mjs'+import { fill as fillIn, t } from './text.mjs'import { createDirector, reduced, play, spring, sleep, clamped } from './whale.js'const root = document.documentElement@@ -31,21 +31,27 @@ const say = (key, vars) => t(lang, key, vars)const sigs = new WeakMap()function render(el, vars = {}) {const key = el.dataset.t.replace(/\{(\w+)\}/gu, (all, name) => vars[name] ?? '')- const parts = say(key).split(/\{(\w+)\}/u)- const sig = parts.map((part, i) => (i % 2 ? `\u0001${vars[part] ?? ''}` : part)).join('')+ // Odd parts are placeholders: {name}, or {name|one|many} for an English count.+ const parts = say(key).split(/\{(\w+(?:\|[^}]*)?)\}/u)+ const valueOf = (part) => {+ const value = vars[part.split('|')[0]]+ if (value === undefined || value === null) return ''+ return part.includes('|') ? fillIn(`{${part}}`, vars) : String(value)+ }+ const sig = parts.map((part, i) => (i % 2 ? `\u0001${valueOf(part)}` : part)).join('')if (sigs.get(el) === sig) returnsigs.set(el, sig)el.replaceChildren(...parts.map((part, i) => {if (i % 2 === 0) return part- const value = String(vars[part] ?? '')+ const value = valueOf(part)return CODE.has(part) ? Object.assign(document.createElement('code'), { textContent: value }) : value}))}function renderStatic() {root.lang = lang === 'zh' ? 'zh-CN' : 'en'for (const el of document.querySelectorAll('.track [data-t], .footrow [data-t], .caption [data-t]')) render(el)- $('.track').setAttribute('aria-label', say('track.label'))- for (const st of document.querySelectorAll('.station')) st.querySelector('.sr').textContent = say(`state.${st.dataset.state}`)+ $('.track').setAttribute('aria-label', say('status.track'))+ for (const st of document.querySelectorAll('.station')) st.querySelector('.sr').textContent = say(`status.state.${st.dataset.state}`)if (s) { fillBlock(shown); placeUI(s.place); timeUI() }}// Where the data goes, at the footer's right end with 「换个位置…」 (first starts; the main@@ -56,7 +62,7 @@ function placeUI(place) {const on = first && place !== null && typeof place === 'object' && !['failed', 'viewFailed'].includes(s?.view)placeEl.hidden = !onif (!on) return- const key = place.drive ? (place.free ? 'place.drive' : 'place.driveOnly') : place.free ? 'place.path' : 'place.pathOnly'+ const key = place.drive ? (place.free ? 'foot.place.drive' : 'foot.place.driveOnly') : place.free ? 'foot.place.path' : 'foot.place.pathOnly'placeText.textContent = say(key, place)}function varsOf(snap) {@@ -64,7 +70,7 @@ function varsOf(snap) {const update = snap.update ?? {}const vars = { ...snap.explain, ...card }if (snap.view === 'failed' || snap.view === 'viewFailed') vars.reason = snap.failure?.reason ?? 'other'- if (card.kind === 'importFailed') vars.reason = say(`importFailed.${card.reason}`)+ if (card.kind === 'importFailed') vars.reason = say(`reason.copy.${card.reason}`)if (card.kind === 'newerUpdating') vars.p = card.percent ?? 0if (update.version) Object.assign(vars, { version: update.version, p: update.percent ?? 0, a: update.received ?? 0, b: update.total ?? 0 })return vars@@ -81,6 +87,8 @@ function announce(text) { if (text) live.textContent = text }// 「进去吧」 lets the line before it be read for READ_MS first, and the director starts the// celebration READY_MS (whale.js) after 「进去吧」 is up.const HOLDS = { 'voice.hello': 1500, 'voice.found': 700 }+// The line of a later start, a data move and the two failure views.+const VOICES = { later: 'voice.opening', moving: 'voice.moving', failed: 'voice.failed', viewFailed: 'voice.viewFailed' }const HOLD_MS = 900const READ_MS = 400const FADE_MS = 160@@ -92,10 +100,10 @@ const v = { key: '', text: '', shown: '', at: 0, timer: 0, swap: 0, renaming: faconst readyLine = () => (v.readyAt ? Promise.resolve(v.readyAt) : new Promise(resolve => v.waiters.push(resolve)))function voiceWant() {const view = s.view- if (view === 'failed' || view === 'viewFailed') return [`title.${view}`, true]+ if (view === 'failed' || view === 'viewFailed') return [VOICES[view], true]if (view === 'watchdog') return ['voice.watchdog', true]if (view === 'card') return ['', false]- if (!first) return [`title.${START}`, true]+ if (!first) return [VOICES[START], true]if (view === 'handoff') return ['voice.ready', false]const st = director.stage()// The whale is sinking to start over: the line goes with it, without the usual hold.@@ -161,7 +169,7 @@ function put() {v.at = performance.now() < catchUp ? -Infinity : performance.now()if (!v.shown) returnv.last = v.shown- if (v.shown === 'title.failed' || v.shown === 'title.viewFailed') announce(v.text)+ if (v.shown === 'voice.failed' || v.shown === 'voice.viewFailed') announce(v.text)if (v.shown === 'voice.ready' && !v.readyAt) { v.readyAt = performance.now(); for (const resolve of v.waiters.splice(0)) resolve(v.readyAt) }}@@ -177,8 +185,8 @@ function hintWant() {const sec = Math.floor(ms / 1000)if (!first) {if (view !== 'boot' && view !== 'moving') return ['', {}, false]- if (ms >= 45000) return ['slow.45.later', {}, true]- if (ms >= 10000) return ['elapsed', { n: sec }, false]+ if (ms >= 45000) return ['hint.slowLater', {}, true]+ if (ms >= 10000) return ['status.elapsed', { n: sec }, false]return [s.hint ? 'hint.space' : '', { ...s.hint }, false]}if (view !== 'boot' && view !== 'handoff') return ['', {}, false]@@ -211,7 +219,7 @@ function timeUI() {// The clock stays through 「进去吧」 and fades with the hint row when the celebration starts.const shown = (booting || s.view === 'handoff') && ms >= 5000root.toggleAttribute('data-elapsed', shown)- if (shown) elapsed.textContent = say('elapsed', { n: sec })+ if (shown) elapsed.textContent = say('status.elapsed', { n: sec })}hint()speak()@@ -446,7 +454,7 @@ function copying(el) {const fillEl = el.querySelector('.copy-steps .bar-fill')if (card.step !== copyStep) { copyStep = card.step; bars.set(fillEl, 0); fillEl.style.scale = '0 1' }bar(fillEl, card.fraction, true)- el.querySelector('.eta').textContent = card.eta === null || card.eta === undefined ? '' : card.eta < 1 ? say('eta.lt1') : say('eta.minutes', { n: card.eta })+ el.querySelector('.eta').textContent = card.eta === null || card.eta === undefined ? '' : card.eta < 1 ? say('card.copying.etaSoon') : say('card.copying.eta', { n: card.eta })}// The recovery card. 〔换个位置…〕 and 〔用新的空白团队开始…〕 show only when the main process can// carry them out (failure.places).@@ -478,7 +486,7 @@ function toggleDetails(button) {}function copiedLabel(button) {button.classList.add('copied')- button.textContent = say('copied')+ button.textContent = say('btn.copied')setTimeout(() => { button.classList.remove('copied'); sigs.delete(button); render(button) }, 1600)}diff --git a/app/src/start/text.mjs b/app/src/start/text.mjsindex fd9f0193..e716cd38 100644--- a/app/src/start/text.mjs+++ b/app/src/start/text.mjs@@ -1,26 +1,28 @@-// Start page strings, for the page and the main process. zh is the copy decided in-// docs/plans/2026-10-26-windows-onboarding.md §3 and docs/plans/2026-10-26-start-window.md;-// en mirrors it. The whale's lines are voice.*, a card's first line say.*, the hint row hint.*:-// one short line at a time, in the Main Bot's own words, none longer than one line.-// Placeholders are {name}; paths, sizes and names are filled from the snapshot, never from here.+// Every string of the app shell that the user sees, in one table: the start page and the system+// dialogs of the main process (choosing a folder, moving the data, the import, updates). Product+// names in dialog titles (DeepSeek Bot, DSH Desktop, DSH Web) are constants, not copy.+// docs/plans/2026-10-29-start-copy.md decides the keys and the layers; zh is the source, en+// mirrors it key by key with the same placeholders.+//+// A key is <layer>.<thing>[.<part>]; the layer says where the line is on screen:+// voice the whale's line: one line, at most 16 characters, no full stop (a question mark is fine)+// say a card's first line: at most 12 characters, no full stop+// hint the hint row: the one thing to know next, at most 22 characters, no full stop+// card card text: whole sentences ending in 。 or ?; card.<card>.<part>+// reason reasons reused in card text: whole sentences end in 。 (reason.place.*,+// reason.start.*), fragments set into a sentence have no punctuation (reason.copy.*)+// btn buttons: at most 10 characters, a verb first; one that opens a system picker or+// leaves the card ends in …; no full stop+// note card footnotes: one sentence ending in 。 that says where to change it later+// foot the footer row: no full stop+// status screen readers and counters only: no full stop+// dialog system dialogs: sentences ending in 。 or ?, picker titles without a full stop+//+// Placeholders are {name}; paths, sizes, names and versions come from the snapshot or the+// caller, never from here. {name|one|many} picks the English singular or plural by the value.export const TEXT = {zh: {- 'title.later': '正在打开你的团队…',- 'title.failed': 'DeepSeek Bot 没能启动',- 'title.viewFailed': '团队界面没有加载出来。',- 'title.moving': '正在搬 DeepSeek Bot 的数据…',- 'phase.data': '准备数据文件夹',- 'phase.engine': '启动本机引擎',- 'phase.team': '打开团队',- 'track.label': '启动进度',- 'state.pending': '未开始',- 'state.active': '进行中',- 'state.done': '已完成',- 'state.failed': '没有完成',- 'sr.active': '{phase}:进行中',- 'sr.done': '{phase}:已完成',- elapsed: '已用 {n} 秒',- footer: '社区开源项目,不是 DeepSeek 官方产品',+ // voice'voice.hello': '嗨,我是总管','voice.helloName': '嗨,我是{name}','voice.helloBack': '嗨,我来了',@@ -32,15 +34,11 @@ export const TEXT = {'voice.team': '开门去了','voice.ready': '进去吧','voice.watchdog': '等太久了,要不要重试?',- 'hint.model': '待会儿要接一个模型:DeepSeek 账号或 API Key',- 'hint.preview': '里面先有一页说明,点「继续」就行',- 'hint.reinstall': '上次的 {bots} 个 Bot 和 {groups} 个群聊都在',- 'slow.45.later': '比平时慢,请再等一会儿。',- 'hint.space': '{drive} 盘只剩 {free}',- openLogs: '打开日志文件夹',- wait: '继续等待',- retry: '重试',- freshStart: '用新的空白团队开始…',+ 'voice.opening': '正在打开你的团队…',+ 'voice.moving': '正在搬 DeepSeek Bot 的数据…',+ 'voice.failed': 'DeepSeek Bot 没能启动',+ 'voice.viewFailed': '团队界面没有加载出来',+ // say'say.space': '{drive} 盘有点挤','say.permission': '这里不让我放东西','say.rejected': '这里放不了',@@ -50,97 +48,141 @@ export const TEXT = {'say.importSpace': '地方不够放','say.inUse': 'DeepSeek Harness 还在用这个团队','say.newer': '这些对话比我新',- 'card.reason.space': '{drive} 盘只剩 {free}。',- 'card.reason.permission': 'DeepSeek Bot 没有权限在 {path} 里写文件。',+ 'say.copying': '正在搬过来',+ // hint+ 'hint.model': '待会儿要接一个模型:DeepSeek 账号或 API Key',+ 'hint.preview': '里面先有一页说明,点「继续」就行',+ 'hint.reinstall': '上次的 {bots} 个 Bot 和 {groups} 个群聊都在',+ 'hint.space': '{drive} 盘只剩 {free}',+ 'hint.slowLater': '比平时慢,请再等一会儿',+ // card'card.recommend.ask': '放到 {rec} 盘(剩 {recFree})?',- 'card.recommend.use': '放到 {rec} 盘',- 'card.recommend.keep': '仍然放在 {drive} 盘',- 'card.recommend.other': '其他位置…',- pickOther: '选择其他位置…',- 'card.rejected.permission': 'DeepSeek Bot 没有权限在 {path} 里写文件。',- 'card.rejected.onedrive': '{path} 在 OneDrive 里,同步会打断正在写入的聊天记录。',- 'card.rejected.foreign': '{path} 里已经有别的文件。',- 'card.rejected.dsh': '{path} 是 DeepSeek Harness 的数据。',- 'card.rejected.program': '{path} 在程序文件夹里,卸载时会删掉。',- 'card.rejected.nested': '{path} 和现在放数据的位置重叠。',- 'place.drive': '数据放在 {drive} 盘(剩 {free})',- 'place.driveOnly': '数据放在 {drive} 盘',- 'place.path': '数据放在 {path}(剩 {free})',- 'place.pathOnly': '数据放在 {path}',- 'place.change': '换个位置…',- 'card.missing': '找不到数据文件夹 {path}。可能是移动硬盘没插上,或者文件夹被移走、删除了。旧数据不会被改动。',- 'card.missing.relocate': '重新找到它…',+ 'card.missing.lead': '找不到数据文件夹 {path}。可能是移动硬盘没插上,或者文件夹被移走、删除了。旧数据不会被改动。','card.missing.retryMissed': '还是找不到这个文件夹。',- 'card.picked': '会放在 {path}',- 'card.picked.use': '继续',- 'card.picked.repick': '重新选',- 'card.footnote': '以后可以在 设置 → 通用 → 位置 里改。',- 'import.lead': 'DeepSeek Harness 里有 {bots} 个 Bot 和 {groups} 个群聊(对话 {chats},工作文件 {work})。复制过来?',- 'import.extra': '复制后会多占 {total},DeepSeek Harness 里的原件不动。',- 'import.more': '详细',- 'import.found': '在 {path} 里找到 {bots} 个 Bot({names}等)和 {groups} 个群聊,{sessions} 段对话。',- 'import.scope': '会复制:Bot、群聊、记忆、对话、附件、模型设置和 API Key。不会复制:MCP、技能和 DSH Agent。DeepSeek Harness 里的内容不会改动,复制以后两边各用各的。',- 'import.model': '模型设置:{model}',- 'import.change': '更换',- 'import.opt.regen': '不复制可以重新生成的文件夹',- 'import.opt.skipWork': '先不复制工作文件',- 'import.copy': '复制过来',- 'import.skip': '先不复制',- 'import.footnote': '也可以在 设置 → 通用 → 位置 里复制。',- 'import.space': '空间不够:复制要约 {need},{drive} 盘只剩 {free},还差 {short}。',- 'copying.title': '正在搬过来',- 'copying.step1': '检查对话 {a}/{b}',- 'copying.step2': '复制 Bot 和对话 {a} / {b}',- 'copying.step3': '启动团队',- 'eta.minutes': '还要大约 {n} 分钟',- 'eta.lt1': '不到 1 分钟',- stop: '停止复制',- 'stop.confirm': '停下后不会留下复制了一半的团队,DeepSeek Harness 里的团队不受影响。',- keepCopying: '继续复制',- inUse: '请完全退出 DSH Desktop(任务栏右下角的托盘图标也要退出),并关掉 DSH Web,这里会自动继续。',- 'newer.updating': 'DeepSeek Bot {version} 能读它们,正在下载({p}%)。装好后会重新打开,再复制团队。',- 'newer.unreadable': '这些对话是更新版本的 DeepSeek Harness 写的,DeepSeek Bot 现在读不了。',- startWithout: '先不带团队开始',- 'newer.footnote': '可以在 设置 → 通用 → 位置 里再复制。',- importFailed: '团队没有复制完:{reason}。DeepSeek Harness 里的团队没有变化。',- 'importFailed.inUse': '文件被别的程序占用',- 'importFailed.permission': '没有权限读取',- 'importFailed.full': '磁盘满了',- 'failed.reason.permission': '没有写入权限。',- 'failed.reason.space': '磁盘空间不够。',- 'failed.reason.files': '程序文件不完整,可能被杀毒软件拦掉了一部分。',- 'failed.reason.engine': '本机引擎启动到一半停下了。',- 'failed.reason.other': '出了点意外。',- changePlace: '换个位置…',- copyDetails: '复制详细信息',- copied: '已复制',- details: '详细信息',- 'update.available': 'DeepSeek Bot {version} 已经发布,可能修好了这个问题。',- 'update.install': '下载并安装',- 'update.downloading': '正在下载 {version}({p}%,{a}/{b} MB)',- 'update.slow': '下载太慢?',- 'update.installing': '正在安装,装好后会重新打开。',- 'update.failed': '下载失败。',- manualDownload: '手动下载',- reload: '重新载入',+ 'card.picked.lead': '会放在 {path}。',+ 'card.import.lead': 'DeepSeek Harness 里有 {bots} 个 Bot 和 {groups} 个群聊(对话 {chats},工作文件 {work})。复制过来?',+ 'card.import.extra': '复制后会多占 {total},DeepSeek Harness 里的原件不动。',+ 'card.import.found': '在 {path} 里找到 {bots} 个 Bot({names}等)和 {groups} 个群聊,{sessions} 段对话。',+ 'card.import.scope': '会复制:Bot、群聊、记忆、对话、附件、模型设置和 API Key。不会复制:MCP、技能和 DSH Agent。DeepSeek Harness 里的内容不会改动,复制以后两边各用各的。',+ 'card.import.model': '模型设置:{model}',+ 'card.import.optRegen': '不复制可以重新生成的文件夹',+ 'card.import.optSkipWork': '先不复制工作文件',+ 'card.importSpace.lead': '空间不够:复制要约 {need},{drive} 盘只剩 {free},还差 {short}。',+ 'card.copying.step1': '检查对话 {a}/{b}',+ 'card.copying.step2': '复制 Bot 和对话 {a} / {b}',+ 'card.copying.step3': '启动团队',+ 'card.copying.eta': '还要大约 {n} 分钟',+ 'card.copying.etaSoon': '不到 1 分钟',+ 'card.copying.stopConfirm': '停下后不会留下复制了一半的团队,DeepSeek Harness 里的团队不受影响。',+ 'card.inUse.lead': '请完全退出 DSH Desktop(任务栏右下角的托盘图标也要退出),并关掉 DSH Web,这里会自动继续。',+ 'card.newerUpdating.lead': 'DeepSeek Bot {version} 能读它们,正在下载({p}%)。装好后会重新打开,再复制团队。',+ 'card.newer.lead': '这些对话是更新版本的 DeepSeek Harness 写的,DeepSeek Bot 现在读不了。',+ 'card.importFailed.lead': '团队没有复制完:{reason}。DeepSeek Harness 里的团队没有变化。',+ 'card.update.available': 'DeepSeek Bot {version} 已经发布,可能修好了这个问题。',+ 'card.update.downloading': '正在下载 {version}({p}%,{a}/{b} MB)',+ 'card.update.installing': '正在安装,装好后会重新打开。',+ 'card.update.failed': '下载失败。',+ 'card.update.slow': '下载太慢?',+ // reason+ 'reason.place.space': '{drive} 盘只剩 {free}。',+ 'reason.place.permission': 'DeepSeek Bot 没有权限在 {path} 里写文件。',+ 'reason.place.onedrive': '{path} 在 OneDrive 里,同步会打断正在写入的对话。',+ 'reason.place.foreign': '{path} 里已经有别的文件。',+ 'reason.place.dsh': '{path} 是 DeepSeek Harness 的数据。',+ 'reason.place.program': '{path} 在程序文件夹里,卸载时会删掉。',+ 'reason.place.nested': '{path} 和现在放数据的位置重叠。',+ 'reason.start.permission': '没有写入权限。',+ 'reason.start.space': '磁盘空间不够。',+ 'reason.start.files': '程序文件不完整,可能被杀毒软件拦掉了一部分。',+ 'reason.start.engine': '本机引擎启动到一半停下了。',+ 'reason.start.other': '出了点意外。',+ 'reason.copy.inUse': '文件被别的程序占用',+ 'reason.copy.permission': '没有权限读取',+ 'reason.copy.full': '磁盘满了',+ // btn+ 'btn.retry': '重试',+ 'btn.wait': '继续等待',+ 'btn.openLogs': '打开日志文件夹',+ 'btn.freshStart': '用新的空白团队开始…',+ 'btn.useRec': '放到 {rec} 盘',+ 'btn.keepDrive': '仍然放在 {drive} 盘',+ 'btn.otherPlace': '其他位置…',+ 'btn.pickPlace': '选择其他位置…',+ 'btn.changePlace': '换个位置…',+ 'btn.relocate': '重新找到它…',+ 'btn.continue': '继续',+ 'btn.repick': '重新选…',+ 'btn.copy': '复制过来',+ 'btn.skipCopy': '先不复制',+ 'btn.more': '详细',+ 'btn.changeModel': '更换',+ 'btn.stopCopy': '停止复制',+ 'btn.keepCopying': '继续复制',+ 'btn.startWithout': '先不带团队开始',+ 'btn.copyDetails': '复制详细信息',+ 'btn.copied': '已复制',+ 'btn.details': '详细信息',+ 'btn.install': '下载并安装',+ 'btn.manualDownload': '手动下载',+ 'btn.reload': '重新载入',+ 'btn.move': '移动并重启',+ 'btn.cancel': '取消',+ 'btn.quit': '退出',+ 'btn.restart': '立即重启',+ 'btn.download': '下载',+ 'btn.notNowRestart': '先不重启',+ 'btn.notNowDownload': '先不下载',+ 'btn.ok': '确定',+ // note+ 'note.changeLater': '以后可以在 设置 → 通用 → 位置 里改。',+ 'note.copyLater': '也可以在 设置 → 通用 → 位置 里复制。',+ 'note.copyAgain': '以后可以在 设置 → 通用 → 位置 里复制。',+ // foot+ 'foot.community': '社区开源项目,不是 DeepSeek 官方产品',+ 'foot.place.drive': '数据放在 {drive} 盘(剩 {free})',+ 'foot.place.driveOnly': '数据放在 {drive} 盘',+ 'foot.place.path': '数据放在 {path}(剩 {free})',+ 'foot.place.pathOnly': '数据放在 {path}',+ // status+ 'status.track': '启动进度',+ 'status.phase.data': '准备数据文件夹',+ 'status.phase.engine': '启动本机引擎',+ 'status.phase.team': '打开团队',+ 'status.state.pending': '未开始',+ 'status.state.active': '进行中',+ 'status.state.done': '已完成',+ 'status.state.failed': '没有完成',+ 'status.sr.active': '{phase}:进行中',+ 'status.sr.done': '{phase}:已完成',+ 'status.elapsed': '已用 {n} 秒',+ // dialog+ 'dialog.pickRoot': '选择 DeepSeek Bot 放数据的位置',+ 'dialog.pickMove': '选择 DeepSeek Bot 数据的新文件夹',+ 'dialog.move.inDsh': '请选择 DeepSeek Harness 数据({home})以外的文件夹。',+ 'dialog.move.inProgram': '请选择程序文件夹以外的位置:卸载时会删掉程序文件夹。',+ 'dialog.move.drive': '请选择一个文件夹,不要选整个磁盘。',+ 'dialog.move.nested': '请选择现在的数据文件夹以外的位置。',+ 'dialog.move.workspace': '数据文件夹和总工作区不能互相包含。',+ 'dialog.move.notEmpty': '请选择一个空文件夹,或者新建一个。',+ 'dialog.move.confirm': '把 DeepSeek Bot 的数据移到 {to} 吗?',+ 'dialog.move.detail': 'DeepSeek Bot 会把数据复制过去,然后重新启动。{from} 会原样保留,确认一切正常后可以自己删掉。',+ 'dialog.move.inUse': '另一个 DeepSeek Harness 正在使用这份数据,所以没有移动。请先关掉它,再重试。',+ 'dialog.move.failed': '数据没有复制成功:{message}\n\nDeepSeek Bot 会继续使用原来位置的数据。',+ 'dialog.import.found': 'DeepSeek Harness 里有 {bots} 个 Bot 和 {groups} 个群聊。要复制到 DeepSeek Bot 吗?',+ 'dialog.import.foundDetail': '会复制 Bot、群聊、记忆、对话、附件、模型设置和 API Key。{home} 里的内容不会改变,复制以后两边各用各的。',+ 'dialog.import.inUse': 'DeepSeek Harness 正在使用这个团队。请先关掉它,再重试。',+ 'dialog.import.newer': '有 {n} 段对话是更新版本的 DeepSeek Harness 写的,这个版本的 DeepSeek Bot 读不了。请先更新 DeepSeek Bot,再打开它来复制团队。',+ 'dialog.import.whichModels': 'DeepSeek Bot 用哪一份模型设置?',+ 'dialog.import.failed': '团队没有复制完:{message}\n\nDeepSeek Bot 会用一个新团队开始。DeepSeek Harness 里的团队没有变化。',+ 'dialog.update.ready': 'DeepSeek Bot {version} 已经下载好。',+ 'dialog.update.readyDetail': '现在重启就能更新;不重启的话,下次退出时安装。',+ 'dialog.update.available': 'DeepSeek Bot {version} 已经发布。',+ 'dialog.update.availableDetail': '这个版本不能自己更新。请到发布页下载新版,再用它替换「应用程序」里的 DeepSeek Bot。',+ 'dialog.update.onFailure': 'DeepSeek Bot {version} 下载完会自动安装,然后重新打开。',+ 'dialog.update.onFailurePage': 'DeepSeek Bot {version} 已经发布。关掉这个对话框后,会打开它的下载页面。',},en: {- 'title.later': 'Opening your team…',- 'title.failed': 'DeepSeek Bot couldn’t start',- 'title.viewFailed': 'The team view didn’t load.',- 'title.moving': 'Moving DeepSeek Bot’s data…',- 'phase.data': 'Prepare the data folder',- 'phase.engine': 'Start the local engine',- 'phase.team': 'Open the team',- 'track.label': 'Start progress',- 'state.pending': 'Not started',- 'state.active': 'In progress',- 'state.done': 'Done',- 'state.failed': 'Not finished',- 'sr.active': '{phase}: in progress',- 'sr.done': '{phase}: done',- elapsed: '{n} s so far',- footer: 'A community open-source project, not an official DeepSeek product',+ // voice'voice.hello': 'Hi, I’m Chief','voice.helloName': 'Hi, I’m {name}','voice.helloBack': 'Hi, I’m here',@@ -152,15 +194,11 @@ export const TEXT = {'voice.team': 'Off to open the door','voice.ready': 'Come on in','voice.watchdog': 'This is taking too long. Try again?',- 'hint.model': 'Next you’ll connect a model: a DeepSeek account or an API Key',- 'hint.preview': 'A notice page comes first; just click “Continue”',- 'hint.reinstall': 'Your {bots} Bots and {groups} group chats are still here',- 'slow.45.later': 'Slower than usual. Please wait a little longer.',- 'hint.space': 'Only {free} left on drive {drive}',- openLogs: 'Open log folder',- wait: 'Keep waiting',- retry: 'Try again',- freshStart: 'Start with a new blank team…',+ 'voice.opening': 'Opening your team…',+ 'voice.moving': 'Moving DeepSeek Bot’s data…',+ 'voice.failed': 'DeepSeek Bot couldn’t start',+ 'voice.viewFailed': 'The team view didn’t load',+ // say'say.space': 'Drive {drive} is a bit full','say.permission': 'I’m not allowed to put things here','say.rejected': 'That place won’t work',@@ -170,83 +208,155 @@ export const TEXT = {'say.importSpace': 'Not enough room','say.inUse': 'DeepSeek Harness is still using this team','say.newer': 'These chats are newer than me',- 'card.reason.space': 'Only {free} left on drive {drive}.',- 'card.reason.permission': 'DeepSeek Bot can’t write files in {path}.',+ 'say.copying': 'Moving your team in',+ // hint+ 'hint.model': 'Next you’ll connect a model: a DeepSeek account or an API Key',+ 'hint.preview': 'A notice page comes first; just click “Continue”',+ 'hint.reinstall': 'Your {bots|Bot|Bots} and {groups|group chat|group chats} are still here',+ 'hint.space': 'Only {free} left on drive {drive}',+ 'hint.slowLater': 'Slower than usual; please wait a little longer',+ // card'card.recommend.ask': 'Put it on drive {rec} ({recFree} free)?',- 'card.recommend.use': 'Put it on drive {rec}',- 'card.recommend.keep': 'Keep it on drive {drive}',- 'card.recommend.other': 'Another location…',- pickOther: 'Choose another location…',- 'card.rejected.permission': 'DeepSeek Bot can’t write files in {path}.',- 'card.rejected.onedrive': '{path} is in OneDrive; syncing interrupts chats while they are being written.',- 'card.rejected.foreign': '{path} already has other files in it.',- 'card.rejected.dsh': '{path} is DeepSeek Harness’s data.',- 'card.rejected.program': '{path} is in the program folder, which uninstalling removes.',- 'card.rejected.nested': '{path} overlaps where the data is now.',- 'place.drive': 'Drive {drive}, {free} free',- 'place.driveOnly': 'Drive {drive}',- 'place.path': '{path}, {free} free',- 'place.pathOnly': '{path}',- 'place.change': 'Change…',- 'card.missing': 'Can’t find the data folder {path}. The external drive may be unplugged, or the folder was moved or deleted. The old data won’t be changed.',- 'card.missing.relocate': 'Find it again…',+ 'card.missing.lead': 'Can’t find the data folder {path}. The external drive may be unplugged, or the folder was moved or deleted. The old data won’t be changed.','card.missing.retryMissed': 'Still can’t find this folder.',- 'card.picked': 'It will go in {path}',- 'card.picked.use': 'Continue',- 'card.picked.repick': 'Choose again',- 'card.footnote': 'You can change this later in Settings → General → Locations.',- 'import.lead': 'DeepSeek Harness has {bots} Bots and {groups} group chats (chats {chats}, work files {work}). Copy them over?',- 'import.extra': 'The copy takes another {total}; the originals in DeepSeek Harness stay untouched.',- 'import.more': 'Details',- 'import.found': 'Found {bots} Bots ({names} and others), {groups} group chats and {sessions} conversations in {path}.',- 'import.scope': 'Copied: Bots, group chats, memory, conversations, attachments, model settings and API Keys. Not copied: MCP, skills and DSH Agent. Nothing in DeepSeek Harness changes; after the copy each side goes its own way.',- 'import.model': 'Model settings: {model}',- 'import.change': 'Change',- 'import.opt.regen': 'Skip folders that can be regenerated',- 'import.opt.skipWork': 'Don’t copy work files yet',- 'import.copy': 'Copy them',- 'import.skip': 'Not now',- 'import.footnote': 'You can also copy them in Settings → General → Locations.',- 'import.space': 'Not enough space: the copy needs about {need}, drive {drive} has {free} left, {short} short.',- 'copying.title': 'Moving your team in',- 'copying.step1': 'Checking conversations {a}/{b}',- 'copying.step2': 'Copying Bots and conversations {a} / {b}',- 'copying.step3': 'Starting the team',- 'eta.minutes': 'About {n} minutes left',- 'eta.lt1': 'Less than a minute left',- stop: 'Stop copying',- 'stop.confirm': 'Stopping leaves no half-copied team, and the team in DeepSeek Harness is not affected.',- keepCopying: 'Keep copying',- inUse: 'Quit DSH Desktop completely (its tray icon at the bottom right of the taskbar too) and close DSH Web; this continues by itself.',- 'newer.updating': 'DeepSeek Bot {version} can read them and is downloading ({p}%). After installing it reopens and copies the team.',- 'newer.unreadable': 'These conversations were written by a newer DeepSeek Harness, which DeepSeek Bot can’t read yet.',- startWithout: 'Start without the team',- 'newer.footnote': 'You can copy them again in Settings → General → Locations.',- importFailed: 'The team wasn’t fully copied: {reason}. The team in DeepSeek Harness is unchanged.',- 'importFailed.inUse': 'a file is in use by another program',- 'importFailed.permission': 'no permission to read',- 'importFailed.full': 'the disk is full',- 'failed.reason.permission': 'No permission to write.',- 'failed.reason.space': 'Not enough disk space.',- 'failed.reason.files': 'Program files are incomplete; antivirus software may have blocked some of them.',- 'failed.reason.engine': 'The local engine stopped halfway through starting.',- 'failed.reason.other': 'Something unexpected happened.',- changePlace: 'Change the location…',- copyDetails: 'Copy details',- copied: 'Copied',- details: 'Details',- 'update.available': 'DeepSeek Bot {version} is out and may fix this.',- 'update.install': 'Download and install',- 'update.downloading': 'Downloading {version} ({p}%, {a}/{b} MB)',- 'update.slow': 'Download too slow?',- 'update.installing': 'Installing; it reopens when done.',- 'update.failed': 'The download failed.',- manualDownload: 'Download manually',- reload: 'Reload',+ 'card.picked.lead': 'It will go in {path}.',+ 'card.import.lead': 'DeepSeek Harness has {bots|Bot|Bots} and {groups|group chat|group chats} (chats {chats}, work files {work}). Copy them over?',+ 'card.import.extra': 'The copy takes another {total}; the originals in DeepSeek Harness stay untouched.',+ 'card.import.found': 'Found {bots|Bot|Bots} ({names} and others), {groups|group chat|group chats} and {sessions|chat|chats} in {path}.',+ 'card.import.scope': 'Copied: Bots, group chats, memory, chats, attachments, model settings and API Keys. Not copied: MCP, skills and DSH Agent. Nothing in DeepSeek Harness changes; after the copy each side goes its own way.',+ 'card.import.model': 'Model settings: {model}',+ 'card.import.optRegen': 'Skip folders that can be regenerated',+ 'card.import.optSkipWork': 'Don’t copy work files yet',+ 'card.importSpace.lead': 'Not enough space: the copy needs about {need}, drive {drive} has {free} left, {short} short.',+ 'card.copying.step1': 'Checking chats {a}/{b}',+ 'card.copying.step2': 'Copying Bots and chats {a} / {b}',+ 'card.copying.step3': 'Starting the team',+ 'card.copying.eta': 'About {n|minute|minutes} left',+ 'card.copying.etaSoon': 'Less than a minute left',+ 'card.copying.stopConfirm': 'Stopping leaves no half-copied team, and the team in DeepSeek Harness is not affected.',+ 'card.inUse.lead': 'Quit DSH Desktop completely (its tray icon at the bottom right of the taskbar too) and close DSH Web; this continues by itself.',+ 'card.newerUpdating.lead': 'DeepSeek Bot {version} can read them and is downloading ({p}%). After installing it reopens and copies the team.',+ 'card.newer.lead': 'These chats were written by a newer DeepSeek Harness, which DeepSeek Bot can’t read yet.',+ 'card.importFailed.lead': 'The team wasn’t fully copied: {reason}. The team in DeepSeek Harness is unchanged.',+ 'card.update.available': 'DeepSeek Bot {version} is out and may fix this.',+ 'card.update.downloading': 'Downloading {version} ({p}%, {a}/{b} MB)',+ 'card.update.installing': 'Installing; it reopens when done.',+ 'card.update.failed': 'The download failed.',+ 'card.update.slow': 'Download too slow?',+ // reason+ 'reason.place.space': 'Only {free} left on drive {drive}.',+ 'reason.place.permission': 'DeepSeek Bot can’t write files in {path}.',+ 'reason.place.onedrive': '{path} is in OneDrive; syncing interrupts chats while they are being written.',+ 'reason.place.foreign': '{path} already has other files in it.',+ 'reason.place.dsh': '{path} is DeepSeek Harness’s data.',+ 'reason.place.program': '{path} is in the program folder, which uninstalling removes.',+ 'reason.place.nested': '{path} overlaps where the data is now.',+ 'reason.start.permission': 'No permission to write.',+ 'reason.start.space': 'Not enough disk space.',+ 'reason.start.files': 'Program files are incomplete; antivirus software may have blocked some of them.',+ 'reason.start.engine': 'The local engine stopped halfway through starting.',+ 'reason.start.other': 'Something unexpected happened.',+ 'reason.copy.inUse': 'a file is in use by another program',+ 'reason.copy.permission': 'no permission to read',+ 'reason.copy.full': 'the disk is full',+ // btn+ 'btn.retry': 'Try again',+ 'btn.wait': 'Keep waiting',+ 'btn.openLogs': 'Open log folder',+ 'btn.freshStart': 'Start with a new blank team…',+ 'btn.useRec': 'Put it on drive {rec}',+ 'btn.keepDrive': 'Keep it on drive {drive}',+ 'btn.otherPlace': 'Another location…',+ 'btn.pickPlace': 'Choose another location…',+ 'btn.changePlace': 'Change the location…',+ 'btn.relocate': 'Find it again…',+ 'btn.continue': 'Continue',+ 'btn.repick': 'Choose again…',+ 'btn.copy': 'Copy them over',+ 'btn.skipCopy': 'Don’t copy yet',+ 'btn.more': 'Details',+ 'btn.changeModel': 'Change',+ 'btn.stopCopy': 'Stop copying',+ 'btn.keepCopying': 'Keep copying',+ 'btn.startWithout': 'Start without the team',+ 'btn.copyDetails': 'Copy details',+ 'btn.copied': 'Copied',+ 'btn.details': 'Details',+ 'btn.install': 'Download and install',+ 'btn.manualDownload': 'Download manually',+ 'btn.reload': 'Reload',+ 'btn.move': 'Move and restart',+ 'btn.cancel': 'Cancel',+ 'btn.quit': 'Quit',+ 'btn.restart': 'Restart now',+ 'btn.download': 'Download',+ 'btn.notNowRestart': 'Not now',+ 'btn.notNowDownload': 'Not now',+ 'btn.ok': 'OK',+ // note+ 'note.changeLater': 'You can change this later in Settings → General → Location.',+ 'note.copyLater': 'You can also copy the team in Settings → General → Location.',+ 'note.copyAgain': 'You can copy the team later in Settings → General → Location.',+ // foot+ 'foot.community': 'A community open-source project, not an official DeepSeek product',+ 'foot.place.drive': 'Data on drive {drive}, {free} free',+ 'foot.place.driveOnly': 'Data on drive {drive}',+ 'foot.place.path': 'Data in {path}, {free} free',+ 'foot.place.pathOnly': 'Data in {path}',+ // status+ 'status.track': 'Start progress',+ 'status.phase.data': 'Prepare the data folder',+ 'status.phase.engine': 'Start the local engine',+ 'status.phase.team': 'Open the team',+ 'status.state.pending': 'Not started',+ 'status.state.active': 'In progress',+ 'status.state.done': 'Done',+ 'status.state.failed': 'Not finished',+ 'status.sr.active': '{phase}: in progress',+ 'status.sr.done': '{phase}: done',+ 'status.elapsed': '{n} s so far',+ // dialog+ 'dialog.pickRoot': 'Choose where DeepSeek Bot keeps its data',+ 'dialog.pickMove': 'Choose a new folder for DeepSeek Bot’s data',+ 'dialog.move.inDsh': 'Choose a folder outside the DeepSeek Harness data ({home}).',+ 'dialog.move.inProgram': 'Choose a place outside the program folder: uninstalling removes the program folder.',+ 'dialog.move.drive': 'Choose a folder, not a whole drive.',+ 'dialog.move.nested': 'Choose a place outside the current data folder.',+ 'dialog.move.workspace': 'The data folder and the team workspace cannot hold each other.',+ 'dialog.move.notEmpty': 'Choose an empty folder or make a new one.',+ 'dialog.move.confirm': 'Move DeepSeek Bot’s data to {to}?',+ 'dialog.move.detail': 'DeepSeek Bot copies its data there and starts again. {from} stays as it is; you can delete it yourself once everything works.',+ 'dialog.move.inUse': 'Another DeepSeek Harness is using this data, so it was not moved. Close it, then try again.',+ 'dialog.move.failed': 'The data was not copied: {message}\n\nDeepSeek Bot goes on with its data where it was.',+ 'dialog.import.found': 'DeepSeek Harness has {bots|Bot|Bots} and {groups|group chat|group chats}. Copy them into DeepSeek Bot?',+ 'dialog.import.foundDetail': 'Copied: Bots, group chats, memory, chats, attachments, model settings and API Keys. Nothing in {home} changes; after the copy each side goes its own way.',+ 'dialog.import.inUse': 'DeepSeek Harness is using this team. Close it, then try again.',+ 'dialog.import.newer': '{n|chat was|chats were} written by a newer DeepSeek Harness than this version of DeepSeek Bot can read. Update DeepSeek Bot first, then open it to copy the team.',+ 'dialog.import.whichModels': 'Which model settings should DeepSeek Bot use?',+ 'dialog.import.failed': 'The team wasn’t fully copied: {message}\n\nDeepSeek Bot starts with a new team. The team in DeepSeek Harness is unchanged.',+ 'dialog.update.ready': 'DeepSeek Bot {version} has finished downloading.',+ 'dialog.update.readyDetail': 'Restart now to update; if you don’t, it installs the next time you quit.',+ 'dialog.update.available': 'DeepSeek Bot {version} is out.',+ 'dialog.update.availableDetail': 'This version can’t update itself. Download the new version from its release page, then replace DeepSeek Bot in Applications with it.',+ 'dialog.update.onFailure': 'DeepSeek Bot {version} installs itself when its download is done, and then opens again.',+ 'dialog.update.onFailurePage': 'DeepSeek Bot {version} is out. Once this box is closed, its download page opens.',},}+const PLACEHOLDER = /\{(\w+)(?:\|([^|}]*)\|([^}]*))?\}/gu++/** Fill {name} and {name|one|many} from vars; a placeholder without a value stays as it is. */+export function fill(text, vars) {+ return text.replace(PLACEHOLDER, (all, name, one, many) => {+ if (!(name in vars)) return all+ const value = String(vars[name])+ return one === undefined ? value : `${value} ${value === '1' ? one : many}`+ })+}+export function t(lang, key, vars) {const text = TEXT[lang]?.[key] ?? TEXT.zh[key] ?? key- return vars ? text.replace(/\{(\w+)\}/gu, (all, name) => (name in vars ? String(vars[name]) : all)) : text+ return vars ? fill(text, vars) : text}++export const langOf = locale => (String(locale ?? '').toLowerCase().startsWith('zh') ? 'zh' : 'en')diff --git a/app/src/start/whale.js b/app/src/start/whale.jsindex 199a15eb..64a453e9 100644--- a/app/src/start/whale.js+++ b/app/src/start/whale.js@@ -144,7 +144,7 @@ export function createDirector({ start, resume, act, label, announce, onCheck, oconst st = stations[i]if (!st || st.dataset.state === state) returnst.dataset.state = state- st.querySelector('.sr').textContent = label(`state.${state}`)+ st.querySelector('.sr').textContent = label(`status.state.${state}`)if (state === 'active') st.setAttribute('aria-current', 'step')else st.removeAttribute('aria-current')}@@ -170,7 +170,7 @@ export function createDirector({ start, resume, act, label, announce, onCheck, osetStation(i, 'done')// The last stop gets no ring: the whale dives there.if (i < 2) leaveTrace(i)- announce(label('sr.done', { phase: label(`phase.${PHASES[i]}`) }))+ announce(label('status.sr.done', { phase: label(`status.phase.${PHASES[i]}`) }))onCheck?.(i)}let activeTimer = 0@@ -185,7 +185,7 @@ export function createDirector({ start, resume, act, label, announce, onCheck, oif (D.at !== i || stations[i].dataset.state !== 'pending' || failure() || (i < 2 && want.done.includes(PHASES[i]))) returnsetStation(i, 'active')D.activeAt[i] = performance.now()- announce(label('sr.active', { phase: label(`phase.${PHASES[i]}`) }))+ announce(label('status.sr.active', { phase: label(`status.phase.${PHASES[i]}`) }))onActive?.(i)changed()}, instant ? 0 : delay)diff --git a/app/src/updates.mjs b/app/src/updates.mjsindex d6960b22..a70fc341 100644--- a/app/src/updates.mjs+++ b/app/src/updates.mjs@@ -1,28 +1,6 @@// Windows and a Linux AppImage download and install updates; macOS and a Linux deb ask before-// opening the release page.--export const UPDATE_TEXT = {- en: {- ready: version => `DeepSeek Bot ${version} is ready to install.`,- readyDetail: 'Restart now to update, or it is installed the next time you quit.',- restart: 'Restart now', later: 'Later',- onFailure: version => `DeepSeek Bot ${version} is installed when its download is done, and then DeepSeek Bot opens again.`,- available: version => `DeepSeek Bot ${version} is available.`,- availableDetail: 'This version cannot update itself. Download the new version from its release page, then replace DeepSeek Bot in Applications.',- download: 'Download',- onFailurePage: version => `DeepSeek Bot ${version} is available. After this box, its download page opens.`,- },- zh: {- ready: version => `DeepSeek Bot ${version} 已经下载好。`,- readyDetail: '现在重启就能更新;不重启的话,下次退出时安装。',- restart: '立即重启', later: '稍后',- onFailure: version => `DeepSeek Bot ${version} 下载完会自动安装,然后重新打开。`,- available: version => `DeepSeek Bot ${version} 已经发布。`,- availableDetail: '这个版本不能自己更新。请到发布页下载新版,再用它替换「应用程序」里的 DeepSeek Bot。',- download: '下载',- onFailurePage: version => `DeepSeek Bot ${version} 已经发布。关掉这个对话框后,会打开它的下载页面。`,- },-}+// opening the release page. main.mjs asks the questions, in the dialog.update.* copy of+// start/text.mjs.const CHECK_EVERY_MS = 4 * 60 * 60_000export const RELEASES_URL = 'https://api.github.com/repos/Fei2411/DS-Bot/releases?per_page=20'diff --git a/app/test/start-page.test.mjs b/app/test/start-page.test.mjsindex 06606be9..3c816df8 100644--- a/app/test/start-page.test.mjs+++ b/app/test/start-page.test.mjs@@ -4,7 +4,7 @@ import { existsSync, readFileSync } from 'node:fs'import { test } from 'node:test'import { fileURLToPath } from 'node:url'import { START_ACTS } from '../src/start-window.mjs'-import { TEXT, t } from '../src/start/text.mjs'+import { langOf, TEXT, t } from '../src/start/text.mjs'const dir = new URL('../src/start/', import.meta.url)const read = name => readFileSync(new URL(name, dir), 'utf8')@@ -67,19 +67,84 @@ test('the page sends only the acts of the start window', () => {for (const name of START_ACTS) assert.ok(sent.has(name), `the main process takes ${name}, which the page never sends`)})+// docs/plans/2026-10-29-start-copy.md §2: the first part of a key says where the line is.+const LAYERS = ['voice', 'say', 'hint', 'card', 'reason', 'btn', 'note', 'foot', 'status', 'dialog']+const layerOf = key => key.split('.')[0]+// {name} and {name|one|many} (an English count) both name one placeholder.+const PLACEHOLDER = /\{(\w+)(?:\|[^}]*)?\}/gu+test('zh and en carry the same keys and the same placeholders', () => {- const placeholders = text => (text.match(/\{\w+\}/gu) ?? []).sort().join()+ const placeholders = text => [...text.matchAll(PLACEHOLDER)].map(match => match[1]).sort().join()assert.deepEqual(Object.keys(TEXT.en).sort(), Object.keys(TEXT.zh).sort())for (const [key, zh] of Object.entries(TEXT.zh)) assert.equal(placeholders(TEXT.en[key]), placeholders(zh), `${key}: placeholders differ`)})+test('every text key starts with one of the ten layers', () => {+ for (const key of Object.keys(TEXT.zh)) assert.ok(LAYERS.includes(layerOf(key)), `${key}: unknown layer`)+})++// §2 and §4: a line that stands alone takes no full stop; card, reason, note and dialog text is+// whole sentences.+test('each layer ends its lines as its rule says', () => {+ const BARE = new Set(['voice', 'say', 'hint', 'btn', 'foot', 'status'])+ // Not sentences: picker titles, progress lines and labels.+ const NOT_SENTENCES = new Set([+ 'card.update.slow', 'card.update.downloading', 'dialog.pickRoot', 'dialog.pickMove',+ 'card.copying.step1', 'card.copying.step2', 'card.copying.step3', 'card.copying.eta', 'card.copying.etaSoon',+ 'card.import.model', 'card.import.optRegen', 'card.import.optSkipWork',+ ])+ for (const key of Object.keys(TEXT.zh)) {+ const zh = TEXT.zh[key]+ const en = TEXT.en[key]+ if (BARE.has(layerOf(key))) {+ assert.doesNotMatch(zh, /。$/u, `${key}: zh ends with a full stop`)+ assert.doesNotMatch(en, /\.$/u, `${key}: en ends with a full stop`)+ } else if (key.startsWith('reason.copy.')) {+ // A fragment set into a sentence.+ assert.doesNotMatch(zh, /[。?!,]$/u, `${key}: a fragment ends with punctuation`)+ assert.doesNotMatch(en, /[.?!,]$/u, `${key}: a fragment ends with punctuation`)+ } else if (!NOT_SENTENCES.has(key)) {+ // A reason or a footnote states; only a card or a dialog may ask.+ const ends = layerOf(key) === 'reason' || layerOf(key) === 'note' ? [/。$/u, /\.$/u] : [/[。?]$/u, /[.?]$/u]+ assert.match(zh, ends[0], `${key}: zh is not a whole sentence`)+ assert.match(en, ends[1], `${key}: en is not a whole sentence`)+ }+ if (key === 'dialog.pickRoot' || key === 'dialog.pickMove') {+ assert.doesNotMatch(zh, /。$/u, `${key}: a picker title ends with a full stop`)+ assert.doesNotMatch(en, /\.$/u, `${key}: a picker title ends with a full stop`)+ }+ }+})++// Counted after the placeholders are removed, a run of Latin letters or digits (a name such as+// DeepSeek, a unit) as one character.+test('the zh lines stay within their layer’s length', () => {+ const LIMITS = { voice: 16, say: 12, hint: 22, btn: 10 }+ const length = text => [...text.replace(PLACEHOLDER, '').replace(/\s+/gu, '').replace(/[A-Za-z0-9]+/gu, 'A')].length+ for (const [key, zh] of Object.entries(TEXT.zh)) {+ const limit = LIMITS[layerOf(key)]+ if (limit !== undefined) assert.ok(length(zh) <= limit, `${key}: ${String(length(zh))} characters, over ${String(limit)}`)+ }+})++test('a button that opens the system picker ends with …', () => {+ const picks = [...html.matchAll(/<button\b[^>]*>/gu)].map(match => match[0]).filter(tag => tag.includes('data-act="pick"'))+ assert.ok(picks.length > 0)+ for (const tag of picks) {+ const key = tag.match(/data-t="([^"]+)"/u)?.[1]+ assert.ok(key !== undefined, `a pick button without text: ${tag}`)+ assert.match(TEXT.zh[key], /…$/u, `${key}: a pick button`)+ assert.match(TEXT.en[key], /…$/u, `${key}: a pick button`)+ }+})+// docs/plans/2026-10-26-windows-onboarding.md, 用词: proper names and units only.test('the zh copy shows no English but the allowed names and units', () => {const NAMES = ['DS Bot', 'DSH Desktop', 'DSH Web']const WORDS = new Set(['DeepSeek', 'Bot', 'API', 'Key', 'Harness', 'DSH', 'Agent', 'MCP', 'Windows', 'PowerShell', 'GitHub', 'SmartScreen', 'OneDrive', 'HTTP', 'SOCKS', 'KB', 'MB', 'GB'])const english = []for (const [key, value] of Object.entries(TEXT.zh)) {- let rest = value.replace(/\{\w+\}/gu, ' ')+ let rest = value.replace(PLACEHOLDER, ' ')for (const name of NAMES) rest = rest.replaceAll(name, ' ')for (const word of rest.match(/[A-Za-z][A-Za-z0-9.-]*/gu) ?? []) if (!WORDS.has(word)) english.push(`${key}: ${word}`)// A promise the engine cannot keep.@@ -92,7 +157,7 @@ test('every text key that the page uses exists', () => {const keys = Object.keys(TEXT.zh)const matching = pattern => keys.filter(key => new RegExp(`^${pattern.replaceAll('.', '\\.').replace(/\{\w+\}/gu, '\\w+')}$`, 'u').test(key))for (const [, key] of html.matchAll(/data-t(?:-label)?="([^"]+)"/gu)) assert.ok(matching(key).length > 0, `start.html: unknown text key ${key}`)- const literal = /^(?:voice|hint|title|say|card|import|copying|eta|sr|state|phase|slow|update|failed|newer|importFailed|track|place)\.[\w.]+$/u+ const literal = new RegExp(`^(?:${LAYERS.join('|')})\\.[\\w.]+$`, 'u')for (const name of ['start.js', 'whale.js']) {const text = uncommented(code[name])const used = [@@ -103,19 +168,55 @@ test('every text key that the page uses exists', () => {for (const [, prefix] of text.matchAll(/`([\w.]+\.)\$\{/gu)) assert.ok(keys.some(key => key.startsWith(prefix)), `${name}: no text key starts with ${prefix}`)}// Keys the page builds from the snapshot's views, the stages and the failure reasons.- for (const key of ['title.failed', 'title.viewFailed', 'title.later', 'title.moving', 'phase.data', 'phase.engine', 'phase.team', 'state.pending', 'state.active', 'state.done', 'state.failed']) assert.ok(key in TEXT.zh, key)- assert.deepEqual(matching('failed.reason.{reason}').sort(), ['failed.reason.engine', 'failed.reason.files', 'failed.reason.other', 'failed.reason.permission', 'failed.reason.space'])+ for (const key of ['voice.failed', 'voice.viewFailed', 'voice.opening', 'voice.moving', 'status.phase.data', 'status.phase.engine', 'status.phase.team', 'status.state.pending', 'status.state.active', 'status.state.done', 'status.state.failed']) assert.ok(key in TEXT.zh, key)+ assert.deepEqual(matching('reason.start.{reason}').sort(), ['reason.start.engine', 'reason.start.files', 'reason.start.other', 'reason.start.permission', 'reason.start.space'])+ assert.deepEqual(matching('reason.place.{reason}').sort(), ['reason.place.dsh', 'reason.place.foreign', 'reason.place.nested', 'reason.place.onedrive', 'reason.place.permission', 'reason.place.program', 'reason.place.space'])+ assert.deepEqual(matching('reason.copy.{reason}').sort(), ['reason.copy.full', 'reason.copy.inUse', 'reason.copy.permission'])+})++// §1: the main process takes its dialog copy from the same table.+test('the main process uses only keys of the table and keeps no table of its own', () => {+ const src = new URL('../src/', import.meta.url)+ const files = Object.fromEntries(['main.mjs', 'first-run.mjs', 'updates.mjs'].map(name => [name, uncommented(readFileSync(new URL(name, src), 'utf8'))]))+ for (const [name, text] of Object.entries(files)) {+ const used = [+ ...[...text.matchAll(/\btx\(\s*'([^']+)'/gu)].map(match => match[1]),+ ...[...text.matchAll(/'((?:dialog|btn)\.[\w.]+)'/gu)].map(match => match[1]),+ ]+ for (const key of used) assert.ok(key in TEXT.zh, `${name}: unknown text key ${key}`)+ }+ assert.match(files['main.mjs'], /\btx\('dialog\./u)+ assert.match(files['first-run.mjs'], /\btx\('dialog\./u)+ for (const name of ['first-run.mjs', 'updates.mjs']) {+ assert.doesNotMatch(files[name], /\b(?:en|zh)\s*:\s*\{/u, `${name}: a string table`)+ assert.doesNotMatch(files[name], /[㐀-鿿]/u, `${name}: Chinese copy outside text.mjs`)+ }})test('t fills placeholders and falls back to zh, then to the key', () => {- assert.equal(t('zh', 'elapsed', { n: 12 }), '已用 12 秒')- assert.equal(t('en', 'elapsed', { n: 12 }), '12 s so far')+ assert.equal(t('zh', 'status.elapsed', { n: 12 }), '已用 12 秒')+ assert.equal(t('en', 'status.elapsed', { n: 12 }), '12 s so far')assert.equal(t('en', 'voice.helloName', { name: 'Ada' }), 'Hi, I’m Ada')- assert.equal(t('fr', 'retry'), '重试')+ assert.equal(t('fr', 'btn.retry'), '重试')assert.equal(t('en', 'hint.space', { drive: 'C' }), 'Only {free} left on drive C')assert.equal(t('zh', 'no.such.key'), 'no.such.key')})+test('t picks the English singular or plural by the value', () => {+ assert.equal(t('en', 'hint.reinstall', { bots: 1, groups: 6 }), 'Your 1 Bot and 6 group chats are still here')+ assert.equal(t('en', 'hint.reinstall', { bots: 6, groups: 1 }), 'Your 6 Bots and 1 group chat are still here')+ assert.equal(t('zh', 'hint.reinstall', { bots: 6, groups: 1 }), '上次的 6 个 Bot 和 1 个群聊都在')+ assert.equal(t('en', 'hint.reinstall', { bots: 1 }), 'Your 1 Bot and {groups|group chat|group chats} are still here')+})++test('langOf gives zh for every Chinese locale and en otherwise', () => {+ assert.equal(langOf('zh-CN'), 'zh')+ assert.equal(langOf('ZH-tw'), 'zh')+ assert.equal(langOf('en-US'), 'en')+ assert.equal(langOf('fr'), 'en')+ assert.equal(langOf(''), 'en')+})+test('the generated blocks of the start page are current', () => {const script = fileURLToPath(new URL('../scripts/start-assets.mjs', import.meta.url))const result = spawnSync(process.execPath, [script, '--check'], { encoding: 'utf8' })diff --git a/docs/plans/2026-10-16-desktop-app.md b/docs/plans/2026-10-16-desktop-app.mdindex f68ec666..15b0f10d 100644--- a/docs/plans/2026-10-16-desktop-app.md+++ b/docs/plans/2026-10-16-desktop-app.md@@ -88,7 +88,7 @@- Windows(x64):安装向导,可以改程序位置,装完可以直接运行。只给当前用户安装:不问「为所有用户还是只为我」,不要管理员权限,默认装在 `%LOCALAPPDATA%\Programs\DeepSeek Bot`。卸载不删数据位置。- Windows 自动更新:后台下载,校验 sha512,下载完在窗口里提示重启以更新;不重启的话,下次退出时装上。- 启动时查一次 GitHub 上最新的 Release,之后每 4 小时查一次。Release 里的 `latest.yml` 写着安装包的文件名和 sha512。- - 提示是窗口上的系统对话框:「立即重启」先停掉引擎再装;「稍后」等下次退出。+ - 提示是窗口上的系统对话框:「立即重启」先停掉引擎再装;「先不重启」等下次退出([启动页文案](2026-10-29-start-copy.md))。- 引擎起不来时也能更新:检查在引擎启动前开始(首次启动的导入之后)。启动失败时,错误框里说有新版本,关掉错误框后等下载完,装上并重新打开。- 应用里的 ds-bot 和 DSH 随应用一起更新:插件不自己查这两项的更新,关于页写「随 DeepSeek Bot 应用一起更新」。- 发版:发布 Release 时,工作流打 Windows 安装包,把它、它的 `.blockmap` 和 `latest.yml` 传到 Release。应用和 ds-bot 用同一个版本号,Release 的标签就是这个版本号。各平台的包都传完后,工作流再传 `SHA256SUMS.txt` 和不带版本号的安装包(如 `DeepSeek-Bot-win-x64.exe`),在说明开头加「下载 / Download」表,最后才把 Release 标为最新;所以发布时不勾「Set as the latest release」。diff --git a/docs/plans/2026-10-26-start-window.md b/docs/plans/2026-10-26-start-window.mdindex 93a9e972..4432ea47 100644--- a/docs/plans/2026-10-26-start-window.md+++ b/docs/plans/2026-10-26-start-window.md@@ -158,7 +158,7 @@- 没有水线和圈,也没有首次启动的那些话和提示:鲸鱼下面只有这一行已定的字(换位置时是「正在搬 DeepSeek Bot 的数据…」)。- 前 1 秒什么都不再动。1 秒后鲸鱼开始工作(只上下晃和眨眼),那行字带流光。- 10 秒起,下面显示「已用 N 秒」。-- 45 秒:「比平时慢,请再等一会儿。」〔打开日志文件夹〕。+- 45 秒:「比平时慢,请再等一会儿」〔打开日志文件夹〕。- 180 秒:和首次启动一样。- 就绪时没有庆祝(重试或重新开始后第一次成功时例外,第 8 节):字淡出 .16 s,鲸鱼从当前姿势潜下去;120 ms 时发 `handoffShow`,启动窗口和首次启动一样长成主窗口的矩形,主窗口在就绪后约 0.6 秒露面(第 8 节)。- `DS_BOT_HOME` 的一次性运行用这一套,只是不出卡片。@@ -185,10 +185,10 @@- 同一件事又出了新问题(复制时空间不够),跳一下。- 选位置的卡片只有推荐盘这一种,只在首次启动出现,〔放到 D 盘〕〔仍然放在 C 盘〕都已经试写通过(上手流程第 3 节);以后的启动还会出「找不到数据文件夹」卡:- 推荐盘:「C 盘只剩 1.2 GB。放到 D 盘(剩 412 GB)?」〔放到 D 盘〕(主按钮,拿到焦点)〔仍然放在 C 盘〕,按钮行末尾一个小链接「其他位置…」。默认位置不能用时,第一句换成原因(「DeepSeek Bot 没有权限在 `C:\Users\<用户名>` 里写文件。」),第二句一样;按钮只有〔放到 D 盘〕(主按钮)和小链接「其他位置…」,没有〔仍然放在 C 盘〕;没有可推荐的盘时只有〔选择其他位置…〕。- - 「其他位置…」打开系统选择框,卡片留在后面。定出的根就是用户选的文件夹时(上手流程第 3 节的规则),卡片直接收回,照常启动,不确认。应用在里面加了一层 `DeepSeek Bot` 时,同一张卡变形成「会放在 `D:\DeepSeek Bot`」〔继续〕(主按钮)〔重新选〕。选的位置不能用,同一张卡写一句原因(「DeepSeek Bot 没有权限在 `D:\Data` 里写文件。」「`C:\Users\<用户名>\OneDrive\文档` 在 OneDrive 里,同步会打断正在写入的聊天记录。」「`D:\Projects\DeepSeek Bot` 里已经有别的文件。」),〔重新选〕(主按钮),来时那张卡的〔放到 D 盘〕〔仍然放在 C 盘〕照旧留着;选择框被取消就回到来时的卡。「会放在…」和被拒绝的卡也有脚注。+ - 「其他位置…」打开系统选择框,卡片留在后面。定出的根就是用户选的文件夹时(上手流程第 3 节的规则),卡片直接收回,照常启动,不确认。应用在里面加了一层 `DeepSeek Bot` 时,同一张卡变形成「会放在 `D:\DeepSeek Bot`。」〔继续〕(主按钮)〔重新选…〕。选的位置不能用,同一张卡写一句原因(「DeepSeek Bot 没有权限在 `D:\Data` 里写文件。」「`C:\Users\<用户名>\OneDrive\文档` 在 OneDrive 里,同步会打断正在写入的对话。」「`D:\Projects\DeepSeek Bot` 里已经有别的文件。」),〔重新选…〕(主按钮),来时那张卡的〔放到 D 盘〕〔仍然放在 C 盘〕照旧留着;选择框被取消就回到来时的卡。「会放在…」和被拒绝的卡也有脚注。- 脚注都是「以后可以在 设置 → 通用 → 位置 里改。」- 没有更好的盘时不出卡片:前 10 秒提示行写「C 盘只剩 1.2 GB」,之后换成这一站的提示(第 4 节)。- - 位置行的「换个位置…」(第 2 节)不等推荐盘的卡:新团队和要导入的首次启动期间随时能点,引擎正在起也可以,走和「其他位置…」同一条路。选完先定根(上手流程第 3 节「一个位置」):根就是选的文件夹时不出卡,直接重新开始;加了一层 `DeepSeek Bot` 时出「会放在 `D:\DeepSeek Bot`」〔继续〕(主按钮)〔重新选〕;不能用时出「这里放不了」加一句原因(上面三句,再加「`D:\Data` 是 DeepSeek Harness 的数据。」「`C:\Program Files\DeepSeek Bot\data` 在程序文件夹里,卸载时会删掉。」),〔重新选〕(主按钮);这两张卡都是用户自己引出的,不跳。选择框被取消就回到位置行:这一路没有来时的卡,「会放在…」和「这里放不了」也一起收回,仍按默认位置走。选了现在的根或数据文件夹就当没选;选在现在的数据文件夹里面、或者定出的根和它重叠,出「这里放不了」加「`C:\Users\<用户名>\.ds-bot\旧` 和现在放数据的位置重叠。」,总工作区里已经有东西时也一样,还空着的(这次启动刚建的)可以成为新的根:默认位置下选用户文件夹,就是「会放在 `C:\Users\<用户名>\DeepSeek Bot`」;读不了的文件夹按没有权限处理;检查都穿过链接和联接看真正的路径,DSH 的家那句写用户选的文件夹。选择框或这两张卡开着时团队就绪了,交接和 20 秒的界面检查都等答完再走:交接会把启动窗口连同挂在它上面的选择框一起收掉。定好以后按第 7 节〔换个位置…〕的路重新开始:鲸鱼立刻沉下去,位置行立刻写新的盘;旧引擎直接结束,不等它起完、也不等它有序退出(两者都要 3 到 10 秒,鲸鱼会一直在水下;那个文件夹马上就删,没有要保全的东西),默认位置上这一次建的文件夹删掉(数据文件夹整个删,总工作区只在还是空的时候删),位置这时就记下,鲸鱼在第 1 站重新浮上来;沉下去时这一行立刻空着,不等上一句停够。导入复制进行中不接这一下,复制完以后这一行收起:搬一个复制好的团队是 设置 → 通用 → 位置 的事。+ - 位置行的「换个位置…」(第 2 节)不等推荐盘的卡:新团队和要导入的首次启动期间随时能点,引擎正在起也可以,走和「其他位置…」同一条路。选完先定根(上手流程第 3 节「一个位置」):根就是选的文件夹时不出卡,直接重新开始;加了一层 `DeepSeek Bot` 时出「会放在 `D:\DeepSeek Bot`。」〔继续〕(主按钮)〔重新选…〕;不能用时出「这里放不了」加一句原因(上面三句,再加「`D:\Data` 是 DeepSeek Harness 的数据。」「`C:\Program Files\DeepSeek Bot\data` 在程序文件夹里,卸载时会删掉。」),〔重新选…〕(主按钮);这两张卡都是用户自己引出的,不跳。选择框被取消就回到位置行:这一路没有来时的卡,「会放在…」和「这里放不了」也一起收回,仍按默认位置走。选了现在的根或数据文件夹就当没选;选在现在的数据文件夹里面、或者定出的根和它重叠,出「这里放不了」加「`C:\Users\<用户名>\.ds-bot\旧` 和现在放数据的位置重叠。」,总工作区里已经有东西时也一样,还空着的(这次启动刚建的)可以成为新的根:默认位置下选用户文件夹,就是「会放在 `C:\Users\<用户名>\DeepSeek Bot`。」;读不了的文件夹按没有权限处理;检查都穿过链接和联接看真正的路径,DSH 的家那句写用户选的文件夹。选择框或这两张卡开着时团队就绪了,交接和 20 秒的界面检查都等答完再走:交接会把启动窗口连同挂在它上面的选择框一起收掉。定好以后按第 7 节〔换个位置…〕的路重新开始:鲸鱼立刻沉下去,位置行立刻写新的盘;旧引擎直接结束,不等它起完、也不等它有序退出(两者都要 3 到 10 秒,鲸鱼会一直在水下;那个文件夹马上就删,没有要保全的东西),默认位置上这一次建的文件夹删掉(数据文件夹整个删,总工作区只在还是空的时候删),位置这时就记下,鲸鱼在第 1 站重新浮上来;沉下去时这一行立刻空着,不等上一句停够。导入复制进行中不接这一下,复制完以后这一行收起:搬一个复制好的团队是 设置 → 通用 → 位置 的事。- 重装(`C:\Users\<用户名>\.ds-bot` 里有团队、没有保存的位置)不出卡片,盘不够也不出:鲸鱼到了第 2 站,提示行写「上次的 6 个 Bot 和 2 个群聊都在」,不写路径,也没有接模型的提示。- 180 秒:鲸鱼立刻问「等太久了,要不要重试?」,卡片里只有〔继续等待〕(主按钮)〔重试〕〔打开日志文件夹〕,读屏读的是这句问话。- 〔继续等待〕:卡片收回,180 秒后再问。@@ -231,7 +231,7 @@- 重试或重新开始后第一次成功时庆祝一次:首次启动照第 8 节的表,先说「进去吧」;以后的启动不说「进去吧」,字照旧,压扁回弹 920 ms 后潜下去(第 8 节)。- 团队界面 20 秒没加载出来:- 主窗口始终不显示。- - 鲸鱼在第 3 站换成失败的姿势,它的话换成「团队界面没有加载出来。」,不画叉;卡片里是〔重新载入〕〔打开日志文件夹〕〔复制详细信息〕,没有鲸鱼的第一行。+ - 鲸鱼在第 3 站换成失败的姿势,它的话换成「团队界面没有加载出来」,不画叉;卡片里是〔重新载入〕〔打开日志文件夹〕〔复制详细信息〕,没有鲸鱼的第一行。- 〔重新载入〕:在隐藏的主窗口里重新载入,回到第 3 站,20 秒重新算。- `ready()` 晚到了也直接交接,不庆祝。@@ -310,7 +310,7 @@- `start.css`。- `start.js`:桥和界面。- `whale.js`:鲸鱼的状态机。- - `text.mjs`:中英文,主进程也用。鲸鱼的话是 `voice.*`,卡片的第一行是 `say.*`,提示行是 `hint.*`;原来的 `title.first`、`explain.*`、`slow.10`、`slow.45.first` 和 180 秒那句 `watchdog` 都去掉了,`copying.title` 改成「正在搬过来」。+ - `text.mjs`:中英文的唯一一张表,启动页和主进程的系统对话框都用。层、键名、写法规则和测试见 [启动页文案](2026-10-29-start-copy.md):键的第一段是那里定的层(`voice`、`say`、`hint`、`card`、`reason`、`btn`、`note`、`foot`、`status`、`dialog`),说的是这行字在页面的哪里,每层一条写法规则。- 预算:这五个文件合计不超过 45 KB(未压缩,原型定的目标);原型超了,怎么办见「待定」。- 所有状态的 DOM 一开始就在页面里,用 `hidden` 和属性切换,运行时不插入大块节点。- 三个阶段在页面里是一个看不见的列表(`ol`,「启动进度」),`aria-current` 和状态词照旧更新;看得见的只有鲸鱼、水线和圈。@@ -334,7 +334,7 @@| 同上 首次启动说明的第三条「聊天和设置保存在这台电脑上……· 社区开源项目,不是 DeepSeek 官方产品」 | 「社区开源项目,不是 DeepSeek 官方产品」是首次启动每一屏的底注,卡片不盖住它;前半句随说明一起去掉(见下面「首次启动的说明」那一行) || 同上 20 秒没就绪时「回到启动页」 | 启动窗口一直在,主窗口不显示 || 同上「首次启动期间再双击图标:恢复并聚焦已有窗口」 | 聚焦正在显示的那个窗口 |-| 同上 第 8 节 以后的启动「只写『正在打开你的团队…』」 | 另外 10 秒起显示已用秒数;45 秒显示「比平时慢,请再等一会儿。」;180 秒同首次启动 |+| 同上 第 8 节 以后的启动「只写『正在打开你的团队…』」 | 另外 10 秒起显示已用秒数;45 秒显示「比平时慢,请再等一会儿」;180 秒同首次启动 || 同上「改动的已定设计」:窗口先加载启动页,再加载引擎的本机地址 | 启动窗口先出来;主窗口隐藏着加载引擎的本机地址(同一个地址和端口),就绪后才显示 || 同上 验收「进程启动后 2 秒内窗口可见」「没有一个 `dialog.show*` 不挂在主窗口上」 | 两条里的窗口都指启动窗口 || [桌面应用](2026-10-16-desktop-app.md)「窗口」 | 加上启动窗口:720 × 540,不能缩放,只有最小化和关闭,Mica;交接时由主进程长成主窗口的矩形(第 8 节) |@@ -355,6 +355,7 @@| [UI 标准](../design/ui-standard.md) 第 1 节第 4 条和 8.4「持续的环境动画只出现在「活泼」档」;8.4 活泼档「等你回答时一直跳」;8.3 状态动作 | 只在启动窗口里、卡片等用户回答时,正常档和活泼档也呼吸和眨眼;活泼档改成越跳越稀;另加探身、按下预备、眼睛跟着键盘焦点、回到窗口时看你一眼(第 3 节第二张表)。安静档和减少动态效果时都没有;插件里的头像不变 || 本文首稿 第 3 节「只为真实的事动:……以及用户的指针和点击」「等用户回答时静止」;第 3 节的表和第 6 节「跳两下,然后静止,看着卡片」「不跳,静止」 | 等用户回答时停下:探身、呼吸和眨眼(第 3 节第二张表),另为键盘焦点和回到窗口而动;安静档、减少动态效果和失败页上停下就不再动 || 本文 2026-10-28 第 4 节第 2 拍「已经完成的话,直接游到第 2 站」 | 等问候读满(页面画出来后 1.66 秒)才离开第 1 站,等的时候晃着(第 4 节)。维护者 2026-10-29 试用时「小鲸鱼看到的时候就在第二个位置」:主进程在页面画出来以前就建好了数据文件夹,鲸鱼一浮上来就游走,第 1 站像没有过 |+| 本文第 5、6、7 节:45 秒「比平时慢,请再等一会儿。」;「会放在 `D:\DeepSeek Bot`」〔继续〕〔重新选〕;「…同步会打断正在写入的聊天记录。」;鲸鱼的话「团队界面没有加载出来。」 | 「比平时慢,请再等一会儿」;「会放在 `D:\DeepSeek Bot`。」〔继续〕〔重新选…〕(被拒绝的卡上的〔重新选…〕一样);「…正在写入的对话。」;「团队界面没有加载出来」。按 [启动页文案](2026-10-29-start-copy.md) 每一层的写法规则 |## 变更@@ -366,6 +367,7 @@- 2026-10-28 位置行:落地第一批(启动窗口、交接、失败页、日志)时维护者看到首次启动仍弹「欢迎使用 DeepSeek Bot」的系统对话框,要求「给出建议,同时提供自行选择的接口,避免小弹窗」。首次启动不再弹这个对话框,底注右边一行「数据放在 C 盘(剩 412 GB)· 换个位置…」(第 2、4 节),点了才开系统选择框,定根、「会放在…」和「这里放不了」按第 6 节,被拒绝的原因加上 DSH 的家和程序文件夹两句,定好后按第 7 节沉下去重新开始,默认位置上这一次建的文件夹删掉;导入复制完以后收起。依据:桌面应用里的实现和它的检查(`place.test.mjs`、`start-window.test.mjs`、未打包的应用上的实测)。- 2026-10-28 张望:第 3 节第二张表加第 9 条,第 2 站工作时每 5 到 9 秒随机向一边看 600 ms,安静档和减少动态效果没有;维护者问「小鱼的摇晃改为摇晃-张望随机是否可行」,可行,叠在上下晃上。依据:原型 `alive.cjs` 的 wander 用例(正常档 30 秒内三次、间隔 7.8 到 8.5 秒,安静档和指针在页面上时零次)。- 2026-10-29 先打招呼再出发:第 4 节第 2 拍,数据阶段已完成时鲸鱼也等问候读满才离开第 1 站,等的时候晃着。维护者试用落地的启动窗口时「小鲸鱼看到的时候就在第二个位置」:那次首次启动里主进程 2.9 秒就建好了数据文件夹,页面 8.6 秒才画出来(冷启动;之后两次启动 2 秒),鲸鱼浮上来 560 ms 就游到了第 2 站。依据:原型 `alive.cjs` 的 greet 用例(数据阶段在入场结束前完成时,鲸鱼入场后 1.66 秒离开第 1 站、再 0.6 秒说「热身中,等我一下」;搜索到一半完成的也一样,且不说「先找个地方放东西」)、试用副本上的实测(窗口 1.1 秒出现、数据 1.9 秒完成、页面 2.1 秒画出来;鲸鱼入场后 1.68 秒离开第 1 站;`main.mjs` 标记数据完成后紧接着就启动引擎,日志里「engine took」从那一刻起算,和问候无关)。+- 2026-10-29 文案分层:启动页的字按页面位置分层、一张表,见 [启动页文案](2026-10-29-start-copy.md);第 11 节 `text.mjs` 一条改成指向它;按各层规则改四处:45 秒的提示和「团队界面没有加载出来」去句号,「会放在 …」加句号、〔重新选〕加 …,OneDrive 的原因里「聊天记录」改成「对话」(第 5、6、7 节)。## 待定diff --git a/docs/plans/2026-10-26-windows-onboarding.md b/docs/plans/2026-10-26-windows-onboarding.mdindex 30613def..c718bee5 100644--- a/docs/plans/2026-10-26-windows-onboarding.md+++ b/docs/plans/2026-10-26-windows-onboarding.md@@ -97,7 +97,7 @@ Windows 是桌面应用的主要平台:0.2.0 到 0.2.2 三个版本的安装| 就绪 | 「进去吧」,300 ms 后庆祝、潜下去 | 同上,到庆祝开始 || 盘不够、又没有更好的盘 | 照那一站说 | 前 10 秒「C 盘只剩 1.2 GB」 || 180 秒 | 「等太久了,要不要重试?」 | 无;卡片上只有〔继续等待〕〔重试〕〔打开日志文件夹〕 |-| 启动失败、团队界面没加载出来 | 「DeepSeek Bot 没能启动」「团队界面没有加载出来。」 | 无 |+| 启动失败、团队界面没加载出来 | 「DeepSeek Bot 没能启动」「团队界面没有加载出来」 | 无 || 有卡片时 | 空着,由卡片自己的第一句说(15/20、600,在已定的文字上面):推荐盘「C 盘有点挤」(盘不够)或「这里不让我放东西」(没有写入权限),「会放在…」那张「我多加了一层文件夹」,被拒绝的「这里放不了」,找不到数据文件夹「数据不在原来的地方了」;导入的几张见第 4 节;失败的卡没有 | 隐藏 |- 话跟着鲸鱼走(停在哪一站、正在游哪一段、就绪),从不抢在它前面。每句至少能读 300 ms 才被换掉,一般停 0.9 秒(招呼 1.5 秒,「找到了」0.7 秒);中间跳过的话以后不补说。失败和 180 秒的问题马上说。「进去吧」等上一句能读满 400 ms 才上,上屏 300 ms 后开始庆祝。鲸鱼沉下去、换个新文件夹重新开始时,话和提示都空着。失败时不画叉,鲸鱼失败的姿势和那句话就是失败。一般的首次启动,用户读到的是「嗨,我是总管」→「热身中,等我一下」→「开门去了」→「进去吧」:数据文件夹这一步通常在招呼读完之前就做完了。@@ -108,14 +108,14 @@ Windows 是桌面应用的主要平台:0.2.0 到 0.2.2 三个版本的安装- **重装不问。** 没有保存的位置、而 `C:\Users\<用户名>\.ds-bot` 里有团队时(重装过,或者 `%APPDATA%` 被清过),直接接着用:不出推荐盘的卡片,盘不够只在提示行写一句「C 盘只剩 1.2 GB」,要搬去 设置 → 通用 → 位置 →〔移到…〕;写不进去直接是恢复页。第 2 站的提示行写「上次的 6 个 Bot 和 2 个群聊都在」,不写路径,接模型的那句提示也不显示。旧团队登记的总工作区启动页不知道:插件启动后经 `teamWorkspaceChanged` 报告一次,应用据此写 `locations.json` 的 `workspace`。想要空白团队的人去 设置 → 通用 → 位置 →「用新的空白团队开始…」。只认默认位置:放在别处、又没有保存位置的旧数据找不到,和今天一样。- **推荐的盘**怎么来:只在数据所在的盘不到门槛(5 GB,有团队要导入时加上要多占的数:对话 1.2 GB 加默认要复制的工作文件 3.4 GB,就是不到 9.6 GB)、或默认位置不能用时查一次(重装接着用时不查),正常启动不查。这一步在引擎预热之前,所以迁移用户先看到推荐盘的卡,再看到导入卡。用完整路径的 `%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -NonInteractive`(`windowsHide`,5 秒超时)读 `Win32_LogicalDisk` 和 `Get-Partition | Get-Disk`:只要固定盘(`DriveType` 3)、`FreeSpace` 不为空、总线不是 USB、SD、MMC 或虚拟盘的,再用 `fs.statfs` 确认一次。盘不够时排除数据现在所在的盘;默认位置不能用时可以推荐同一个盘上的 `X:\DeepSeek Bot`。取剩余空间最大、而且不少于 20 GB 的一个。`X:\DeepSeek Bot` 已经存在时按下面定根的规则判断,不能用就不推荐这个盘。试写只建缺的那几层,写完删掉自己建的。PowerShell 失败、超时或被策略禁掉,都当作没有更好的盘。macOS 和 Linux 不推荐盘,空间不够只在提示行写一句。- **一个位置。** 用户换位置时只选一个文件夹,由它定出根 `R`:选的是磁盘根目录,`R` 是它下面的 `DeepSeek Bot`;选的文件夹不存在或是空的,`R` 就是它;选的文件夹是 DeepSeek Bot 以前的根(`data` 里有 `.deepseek-bot` 标记,没有团队或者只有一个没说过话的空白团队),`R` 也是它;其余非空的文件夹,`R` 是它下面的 `DeepSeek Bot`。`R` 已经存在、非空、又不是以前的根时,不能用。数据放在 `R\data`,Bot 的文件放在 `R\workspace`(子文件夹的名字待定);两者是兄弟,互不包含,和默认的 `~\.ds-bot`、`~\DeepSeek Bot` 一样是同一个父文件夹下的兄弟,所有规则不变。〔放到 D 盘〕就是 `D:\DeepSeek Bot\data` 加 `D:\DeepSeek Bot\workspace`。默认安装的路径不改(待定)。设置里也是一处:「位置」一行显示两个路径,一个〔移到…〕一起搬(第 8 节);要分开放的在「高级」里。-- 只有点了「其他位置…」才打开系统选择框,挂在窗口上,从推荐的盘开始,没有推荐的盘就从现在的数据文件夹的上一级开始。选完先定根,`R\data` 和 `R\workspace` 都对照现在的数据文件夹和总工作区过一遍位置规则,再试写。都通过了:`R` 就是用户选的文件夹时直接用,不再确认;应用加了一层 `DeepSeek Bot` 时,同一张卡片变成「会放在 `D:\DeepSeek Bot`」〔继续〕〔重新选〕,只在应用改了用户选的路径时才确认。没通过(没有写入权限、在 OneDrive 里、`R` 是别人的非空文件夹、在 DSH 的家里、在程序文件夹里),卡片写一句原因,〔重新选〕作主按钮,来时那张卡的〔放到 D 盘〕〔仍然放在 C 盘〕照旧留着;选择框被取消就回到来时的卡。DSH 数据的规则只在那个文件夹真的存在时才检查。位置行的「换个位置…」走同一条路,没有来时的卡:取消就回到位置行,已经出的「会放在…」「这里放不了」也收回。选了现在的根或数据文件夹就当没选;选在现在的数据文件夹里面不行,总工作区还空着时可以成为新的根。+- 只有点了「其他位置…」才打开系统选择框,挂在窗口上,从推荐的盘开始,没有推荐的盘就从现在的数据文件夹的上一级开始。选完先定根,`R\data` 和 `R\workspace` 都对照现在的数据文件夹和总工作区过一遍位置规则,再试写。都通过了:`R` 就是用户选的文件夹时直接用,不再确认;应用加了一层 `DeepSeek Bot` 时,同一张卡片变成「会放在 `D:\DeepSeek Bot`。」〔继续〕〔重新选…〕,只在应用改了用户选的路径时才确认。没通过(没有写入权限、在 OneDrive 里、`R` 是别人的非空文件夹、在 DSH 的家里、在程序文件夹里),卡片写一句原因,〔重新选…〕作主按钮,来时那张卡的〔放到 D 盘〕〔仍然放在 C 盘〕照旧留着;选择框被取消就回到来时的卡。DSH 数据的规则只在那个文件夹真的存在时才检查。位置行的「换个位置…」走同一条路,没有来时的卡:取消就回到位置行,已经出的「会放在…」「这里放不了」也收回。选了现在的根或数据文件夹就当没选;选在现在的数据文件夹里面不行,总工作区还空着时可以成为新的根。- 首次启动的位置检查和「移到…」用同一套规则检查定出的根:不能是整个磁盘、不能是别人的非空文件夹,外加一次试写。- `locations.json` 只在引擎第一次成功启动(`ready`)、导入问题也答完之后才写。同时写一份 UTF-16LE 的 `locations.ini` 给卸载程序读。应用自己新建的数据文件夹里放一个不含任何机密的 `.deepseek-bot` 标记,这个标记在建文件夹时就写、不等 `ready`:首次启动没走完就退出时,留下的文件夹下次才认得出是自己建的(定根规则里的「以前的根」),不会被当成别人的非空文件夹。「首次启动没走完就退出时什么都不记」的规则不变:记的只是 `locations.json`。每次启动先删掉上次留下的暂存(路径记在 `%APPDATA%` 里,加上数据文件夹里所有的 `.import-*` 和 `.import-check-*`)。- 然后加载引擎的页面:DSH 的「预览版说明」→「继续」。DSH 自己的「开始使用」和「添加一个 API Key」不再自动出现:应用在自己的 profile 补丁(和 `search-patch.mjs` 一样经 `runProfile` 的 `patchFiles` 传入)里设 `ui-settings-models` 的 `credentialOnboarding: false`,这是 DSH 有文档的配置。补丁会替换这一行的整个 `config`,所以每次升级锁定的 DSH 都对照新版本重写这一行。应用的补丁里只有这一行。- **启动失败**时,启动页当场变成恢复页(不再等 GitHub、不再隐藏窗口、不再弹英文「Error」框):鲸鱼那一行写「DeepSeek Bot 没能启动」,不说俏皮话,下面一句对应的原因(没有写入权限 / 磁盘空间不够 / 程序文件不完整,可能被杀毒软件拦掉了一部分 / 本机引擎启动到一半停下了 / 出了点意外),每种都给〔重试〕〔换个位置…〕〔用新的空白团队开始…〕〔打开日志文件夹〕〔复制详细信息〕(换位置按第 3 节定根的规则,数据和总工作区一起搬,搬的规则同第 8 节:同一个卷上改名,不同的卷上复制完再删旧的;还没有团队时只是换个空文件夹),再加一个「详细信息」折叠区(日志最后 200 行,已脱敏)。- 启动超过 180 秒:鲸鱼问「等太久了,要不要重试?」,卡片上只有〔继续等待〕〔重试〕〔打开日志文件夹〕,引擎同时继续启动。- 后台更新器发现了新版本时,恢复页上显示「DeepSeek Bot {版本} 已经发布,可能修好了这个问题。」〔下载并安装〕,带下载百分比和「下载太慢?手动下载」(打开镜像页)。-- 引擎起来了但 DS Bot 界面 20 秒内没报告就绪(ds-bot 在界面挂载完成后调用 `dsBotApp.ready()`):回到启动页,显示「团队界面没有加载出来。」〔重新载入〕〔打开日志文件夹〕〔复制详细信息〕。+- 引擎起来了但 DS Bot 界面 20 秒内没报告就绪(ds-bot 在界面挂载完成后调用 `dsBotApp.ready()`):回到启动页,显示「团队界面没有加载出来」〔重新载入〕〔打开日志文件夹〕〔复制详细信息〕。- 首次启动期间再双击图标:恢复并聚焦已有窗口,失败页上也一样。- 建窗口不再依赖「下载」文件夹:每次下载时才取它的位置,取不到就用家目录,再不行就不给默认位置,让用户自己选。- 日志:`%APPDATA%\DeepSeek Bot\logs\main.log`,2 MB × 3 份轮换,收主进程和引擎的输出;写之前去掉 `token=…`、`sk-…` 和 `/oauth/callback?…` 的查询部分,把用户文件夹的完整路径(如 `C:\Users\<用户名>`)换成 `%USERPROFILE%`。@@ -143,7 +143,7 @@ Windows 是桌面应用的主要平台:0.2.0 到 0.2.2 三个版本的安装- 新用户从不复制任何东西:推荐盘和「其他位置…」只新建空文件夹,重装接着用原处的数据。应用自己的数据搬动时(第 8 节〔移到…〕、恢复页的〔换个位置…〕)旧位置不留副本。- 第一段复制时卡片标题是「正在搬过来」,下面是分步进度和数字:「检查对话 23/143」→「复制 Bot 和对话 820 MB / 1.2 GB」→「启动团队」,带剩余时间估计和任务栏进度。〔停止复制〕会就地确认,并说明停下后会留下什么:不留下复制了一半的团队,DSH 里的团队不受影响。- DSH 正在用这个团队:第一句「DeepSeek Harness 还在用这个团队」,下面「请完全退出 DSH Desktop(任务栏右下角的托盘图标也要退出),并关掉 DSH Web,这里会自动继续。」这张卡在答〔复制过来〕时才出现(卡片一出现就查到被占着时只是不暂存),每 2 秒自动重查,不用点重试,锁一放开就开始暂存和复制;卡上有〔先不复制〕,退不掉 DSH 的人有路可走。判断规则和 ds-bot 的 home-lock 一样:同一台机器上 PID 活着**而且**锁在 60 秒内刷新过(#428 的修法),被系统重用的旧 PID 不再算。-- 有更新版本 DSH 写的对话(下面两张卡的第一句都是「这些对话比我新」):更新器现在随应用一起启动,找到能读的版本时:「DeepSeek Bot 0.2.4 能读它们,正在下载(37%)。装好后会重新打开,再复制团队。」卡上有〔先不复制〕,还有「下载太慢?手动下载」;下载失败时〔重试〕〔手动下载〕(和恢复页的更新条一样)。位置在这之前不保存,重开后会再问导入。没找到时:「这些对话是更新版本的 DeepSeek Harness 写的,DeepSeek Bot 现在读不了。」主按钮是〔先不带团队开始〕(不再是「退出」),脚注「可以在 设置 → 通用 → 位置 里再复制。」+- 有更新版本 DSH 写的对话(下面两张卡的第一句都是「这些对话比我新」):更新器现在随应用一起启动,找到能读的版本时:「DeepSeek Bot 0.2.4 能读它们,正在下载(37%)。装好后会重新打开,再复制团队。」卡上有〔先不复制〕,还有「下载太慢?手动下载」;下载失败时〔重试〕〔手动下载〕(和恢复页的更新条一样)。位置在这之前不保存,重开后会再问导入。没找到时:「这些对话是更新版本的 DeepSeek Harness 写的,DeepSeek Bot 现在读不了。」主按钮是〔先不带团队开始〕(不再是「退出」),脚注「以后可以在 设置 → 通用 → 位置 里复制。」- 复制失败(失败的卡没有鲸鱼的第一句):「团队没有复制完:{原因}。DeepSeek Harness 里的团队没有变化。」常见原因翻成人话(文件被别的程序占用 / 没有权限读取 / 磁盘满了),其他放进「详细信息」。〔重试〕〔先不带团队开始〕〔复制详细信息〕。失败或停止时删掉 `.import-<时间>` 暂存文件夹。- 导入的修正:群聊的接力 Session(`room.id`)也复制(#551,PR #567);目标里已有的 `.credentials.yaml` 存着用户自己的 key 或登录时不覆盖。引擎在新数据位置第一次启动时会写一份只有 `client-connection/` 记录(浏览器会话)的 `.credentials.yaml`,这样的文件照常换成旧的。- 第一段复制完成后,窗口打开在导入来的 Main Bot 的聊天里,先显示一张一次性的卡片「复制好了:6 个 Bot、2 个群聊、143 段对话。工作文件正在后台复制(1,204 个,3.4 GB,还要大约 2 分钟)。」,然后是对模型的检查结果。检查通过显示「模型:DeepSeek-V4-Pro · DeepSeek API Key 可以用,余额 ¥23.50」;没通过就在用户打字前显示对应的修复卡(见第 6 节)。@@ -272,7 +272,7 @@ Windows 是桌面应用的主要平台:0.2.0 到 0.2.2 三个版本的安装### 8. 以后的启动和回头入口-- 以后每次启动也显示启动页:64 px 的鲸鱼和「正在打开你的团队…」,没有水线和圈,也没有第 3 节鲸鱼的话和提示;10 秒起显示「已用 N 秒」,45 秒「比平时慢,请再等一会儿。」〔打开日志文件夹〕,180 秒和首次启动一样([启动窗口](2026-10-26-start-window.md) 第 5 节)。然后打开上次的 Bot(预计 3 到 12 秒,以后的启动还没实测)。+- 以后每次启动也显示启动页:64 px 的鲸鱼和「正在打开你的团队…」,没有水线和圈,也没有第 3 节鲸鱼的话和提示;10 秒起显示「已用 N 秒」,45 秒「比平时慢,请再等一会儿」〔打开日志文件夹〕,180 秒和首次启动一样([启动窗口](2026-10-26-start-window.md) 第 5 节)。然后打开上次的 Bot(预计 3 到 12 秒,以后的启动还没实测)。- 设置卡由状态决定:没有能用的模型(跳过过、删了 key、退出了登录),Main Bot 的设置卡就回来;账号登录过期时显示「DeepSeek 账号的登录失效了。」〔重新登录〕(桌面应用里同样在登录窗口里登录)。- 目标卡、建议卡和第一件事卡(第 6 节)只在新团队接上模型、上手还没结束时出现。上手结束看 Main Bot 的会话:里面有那行「上手结束」的灰字、或者有用户自己发的消息(第一件事也是),就算结束,从会话里读,不另存标记;结束以后它们不再回来,设置卡回来时也不带它们。上手中途关了应用、或者模型没了:重开或重新接上模型后从目标卡重新开始,开场白不再发,已经建好的 Bot 留着,`restrict` 和 guard 重新挂上(它们只在内存里),「模型请求 n/3」从 0 算起。导入来的团队从来不出。- DS Bot 设置 → 模型在所有形态里都有(在 `team-actions.js` 里接上插件 Host 已有的 `providers`、`provider-key` 等接口,今天只有停用的 `app/ui` 接了),显示每个提供商的 key 状态(「已设置 Key」「需要 API Key」「Key 来自 DS Bot 之外」)和「添加提供商」。原来的「Harness 设置」改叫「高级设置(DeepSeek Harness)」。@@ -299,6 +299,7 @@ Windows 是桌面应用的主要平台:0.2.0 到 0.2.2 三个版本的安装- 本文里「引擎」指桌面应用启动的 DSH 子进程,「引擎的页面」是它提供的网页前端;「Host」只指插件的 `ds-bot/src/host`。- 第一次介绍产品的地方都写「不是 DeepSeek 官方产品」。- README.md 和 README.zh.md 各加一行名词解释:DeepSeek Bot / DS Bot / DeepSeek Harness。+- 启动页和壳里系统对话框的字分哪几层、键怎么起、每层怎么写(标点、字数、… 的用法、英文对照),在 [启动页文案](2026-10-29-start-copy.md) 里定。- 中文界面里用户能看到的英文,只允许专有名词(DeepSeek、DS Bot、Bot、API、Key、Harness、DSH、DSH Desktop、DSH Web、Agent、MCP、Windows、PowerShell、GitHub、SmartScreen、OneDrive、HTTP、SOCKS)、模型名、提供商名(如 OpenRouter)、用户自己起的名字(Bot、群聊)、文件名、路径、网址、环境变量名、Key 的格式和前八位(占位的「sk-…」、卡上的「sk-1a2b3…」)和单位(KB、MB、GB);「技术详情」和「详细信息」里的原文不算。测试会扫描。## 改动的已定设计@@ -340,7 +341,8 @@ Windows 是桌面应用的主要平台:0.2.0 到 0.2.2 三个版本的安装| 同上 重装时说明的小字「接着用上次的数据:6 个 Bot、2 个群聊(`C:\Users\<用户名>\.ds-bot`)。可以在 设置 → 通用 → 位置 里改。」 | 第 2 站的提示「上次的 6 个 Bot 和 2 个群聊都在」,不写路径 || 同上 180 秒「启动比平常慢很多。可以再等一会儿,或者重试。」 | 鲸鱼问「等太久了,要不要重试?」,卡片上只有〔继续等待〕〔重试〕〔打开日志文件夹〕,不再重复这句话 || 同上「窗口先出来……启动页和引擎的页面共用这个窗口」 | 启动页在单独的启动窗口里([启动窗口](2026-10-26-start-window.md) 第 1 节,待定,那里记过这一行);启动窗口整个启动期间都是 720 × 540,只在交接时改一次大小,长成主窗口的矩形,主窗口在同一个矩形上露面(同上第 8 节):首次启动在就绪后约 1.6 秒可见(原来约 620 ms),以后的启动约 0.6 秒(原来 120 ms) |-| 本文首稿 §8「以后每次启动也显示启动页,只写「正在打开你的团队…」」 | 另外 10 秒起显示已用秒数,45 秒「比平时慢,请再等一会儿。」〔打开日志文件夹〕,180 秒和首次启动一样([启动窗口](2026-10-26-start-window.md) 第 5 节,那里记过这一行);没有水线、圈和第 3 节鲸鱼的话 |+| 本文首稿 §8「以后每次启动也显示启动页,只写「正在打开你的团队…」」 | 另外 10 秒起显示已用秒数,45 秒「比平时慢,请再等一会儿」〔打开日志文件夹〕,180 秒和首次启动一样([启动窗口](2026-10-26-start-window.md) 第 5 节,那里记过这一行);没有水线、圈和第 3 节鲸鱼的话 |+| 本文 第 3 节「团队界面没有加载出来。」、「会放在 `D:DeepSeek Bot`」〔继续〕〔重新选〕;第 4 节 更新版本那张卡的脚注「可以在 设置 → 通用 → 位置 里再复制。」;第 8 节「比平时慢,请再等一会儿。」 | 「团队界面没有加载出来」(鲸鱼那一行不加句号);「会放在 `D:DeepSeek Bot`。」〔继续〕〔重新选…〕(正文带句号,打开选择框的按钮带 …);「以后可以在 设置 → 通用 → 位置 里复制。」;「比平时慢,请再等一会儿」(提示行不加句号)。按 [启动页文案](2026-10-29-start-copy.md) 的层规则 || 本文首稿 §5「通过后卡片收成一行……Main Bot 的开场白随即开始」;§6「开场白用界面语言(沿用现有的 kickoff),两句,以一个问题结尾」;[Bot 运行配置](2026-10-10-bot-runtime.md)「等用户在它的聊天里选好再打招呼」,招呼是一次模型调用 | 新团队第一个 Main Bot 的开场白是固定文字,不调用模型(插件在 `llm/stream` 监听里直接回,和 `HANDOFF_ACK` 一样),设置卡收成一行后约 900 ms 是目标卡;之前的余额检查或 8 token 试连照旧,它也挡着第一个正常回合;上手里从建议卡建的 Bot 的招呼也是固定文字,别的 Bot 的招呼照旧由模型写,修复卡里「开场白失败时重新留着」只管这些模型写的招呼 || 本文首稿 §6「试试:」三个固定按钮 | 新团队先是目标卡(四个可以多选的选项、自由输入、〔确定〕)和建议卡,再是第一件事卡;三个固定任务留作〔跳过〕之后的第一件事卡,以及勾掉 Bot 后补满第一件事卡。只选选项不调用模型,写了字才调用一次,整个上手最多 3 次请求;第一件事发出之前 Main Bot 的工具受限,步骤由卡片的回答推进 |@@ -491,3 +493,4 @@ Windows 是桌面应用的主要平台:0.2.0 到 0.2.2 三个版本的安装- 2026-10-27:接模型的三条改进写进 §5 和 M2:桌面应用里登录页在应用自己的登录窗口里打开,不离开应用,打不开时才退回系统浏览器;现成的 Key(DeepSeek Harness 的凭据、设置卡期间的剪贴板)一键用,照样先检查再保存;聊天里整段是 Key 的草稿拦下来,问保存还是发送。`dsBotApp` 加 `signIn` 和 `foundKeys()` / `takeKey()`;「需要 DSH 提供的」加第 13、14 条;剪贴板是否保留、〔去充值 ↗〕在哪里打开列入待定。评审后补正:DSH 开的空白弹窗改不了 partition,登录窗口由应用另建、两者同生同灭;允许名单只管主框架,授权页来源从第一次导航取;回调不看状态码,`onClosed` 带原因,回调发出后关窗不算取消;代理提示不提引擎的开关;环境变量的 Key 是「来源 env」不是「不可写」;mock 加三把 DeepSeek 格式的 Key;现成 Key 一行一个主按钮、两处合并、`takeKey` 核对前八位;聊天卡按状态选文案,加〔清掉〕和「改一下」,和模型锁合算一个 block,发送走输入框自己的 `submit()`;草稿存在 localStorage、充值页要再登录记进已知限制。第二轮补正:登录窗口的 session 只放行主框架的回调,不照抄 Bot 浏览器拦引擎的规则;新窗口等旧 partition 清完再开;`onClosed` 带代理,打不开的卡有〔取消〕;登录中点鲸鱼菜单或修复卡只打开 DSH 的登录框;窗口里新开的链接一律去系统浏览器;被拒的现成 Key 不再推荐;聊天卡写明检查没通过时的按钮、余额为零的〔知道了〕和 `request_secret` 卡的按钮;「放过」在 DSH 清空草稿时仍在。- 2026-10-28:维护者 2026-10-27 的反馈写进 §3 到 §6、§8 和 M2、M4,分三部分。一是「鲸鱼即进度」的启动页:小窗口显示的是实现的结构(一条带三个点的线和几段说明),不是用户感受到的东西;现在鲸鱼停在哪一站就是到了哪一步,一次一句鲸鱼的话,提示行只说接下来要准备什么,5 秒起显示已用秒数,卡片的第一句也由鲸鱼说,重装的小字改成提示,180 秒改成鲸鱼的问题,交接时启动窗口长成主窗口。二是目标卡可以多选,按〔确定〕提交,几个目标按卡上的顺序合并成一份建议。三是上手后半段的 AI-native 方案:开场白改成固定文字、不调用模型,然后是目标卡、建议卡和第一件事卡,只在用户写了字或要换一组时调用模型,整个上手最多 3 次请求,深度限制写成机制(步骤表在代码里、工具受限、每一步一次请求和时限、模型关着也能走通的卡、mock 模型的 CI);「试试:」的三个固定任务留作〔跳过〕的路和补位。依据:启动窗口和团队窗口的原型及其检查(`handoffShow` 在就绪后 1.09 到 1.17 秒,窗口 300 ms 长大,目标卡和合并的用例)和 2026-10-27 给维护者的 AI-native 评估。合并的上限、第一件事的分法、单个目标的摘要、水线和启动页的大小列入「待定」。评审后补正:第一件事一发出就解除工具限制,它是不受上手限制的正常回合,灰字仍在它回复以后;建议卡建的 Bot 的招呼也是固定文字,整个上手确实最多 3 次请求;JSON 调用只有一组时限(8 秒第一个字、12 秒回完),整轮 20 秒只管上手期间 Main Bot 会话里的回合,兜底最坏 12 秒;schema 带 `goal` 和任务的草案序号,合并按 `goal` 走,模型的摘要只在用户的话太长时用;〔换一组建议〕由模型换一组不重复的;目标卡输入框里整段是 Key 时不发给模型;上手结束从会话里读(灰字或用户自己的消息),中途重开从目标卡重新开始,「取舍」写明这一点;一个会话的 block 按模型锁、上手锁、Key 排,上手锁有自己的占位,开场白不再说「直接说就行」;接上模型前发出的消息算 Main Bot 的第一个正常回合,不再出目标卡;修复卡的「重新留着」只管模型写的招呼;合并的上限和分法按已定的写,「待定」改成要不要改;「一轮多少钱」改用第一件事的回合实测;第 5 节写明侧栏磁贴上的鲸鱼,开场白和目标卡的时间从设置卡收起时算;以后的启动照 [启动窗口](2026-10-26-start-window.md) 第 5 节写,记进「改动的已定设计」;交接的验收从鲸鱼停到第 3 站算;`askSteward` 只是形态相同,上限是这次调用自己的;「水圈」统一叫「圈」,「三站」改成「三站的标记」;导入的检查行去掉破折号;45 KB 那条待定照启动窗口稿写;M4 加八种动作和磁贴上的鲸鱼,估计改成 10 人日。复核后补正:问候里的名字、`dsBotApp` 的露面事件(待定)和以后的启动庆祝那次的 2.5 秒兜底与启动窗口稿对齐;交接验收的 1.2 秒放宽到 1.3 秒,给 CI 留余量。- 2026-10-28(第二次):落地 M4 第一批时维护者看到首次启动仍弹「欢迎使用 DeepSeek Bot」的系统对话框(「我主要不喜欢这个」),要求「给出建议,同时提供自行选择的接口,避免小弹窗」:§3 的「什么都不问」补上启动页底注右边的位置行「数据放在 C 盘(剩 412 GB)· 换个位置…」,点了才开系统选择框,定根和「一个位置」一样,被拒绝的原因加上 DSH 的家和程序文件夹,定好后引擎在新文件夹重新起(启动窗口稿第 2、4、6、7 节);验收加一条。导入问题在 M5 的导入卡落地前仍是挂在启动窗口上的对话框。+- 2026-10-29:启动页的文案分层,写进 [启动页文案](2026-10-29-start-copy.md);按各层的写法规则改了本文引用的四处:§3「团队界面没有加载出来」、§8 45 秒的「比平时慢,请再等一会儿」去句号,§3「会放在 `D:\DeepSeek Bot`。」加句号、〔重新选…〕加 …(被拒绝的卡也一样),§4 更新版本那张卡的脚注改成「以后可以在 设置 → 通用 → 位置 里复制。」,和「以后可以在 … 里改。」同一个句式;「用词」加一条指向它。diff --git a/docs/plans/2026-10-29-start-copy.md b/docs/plans/2026-10-29-start-copy.mdnew file mode 100644index 00000000..49babbd5--- /dev/null+++ b/docs/plans/2026-10-29-start-copy.md@@ -0,0 +1,188 @@+# 启动页文案:层、键和一张表++- 日期:2026-10-29+- 相关:[启动窗口](2026-10-26-start-window.md)(第 3、4、5、6、7、11 节)、[Windows 上手流程](2026-10-26-windows-onboarding.md)(第 3、4、8 节、用词)、[UI 标准](../design/ui-standard.md) 第 11 节+- 代码:`app/src/start/text.mjs`(唯一的表)、`app/src/start/start.html`、`app/src/start/start.js`、`app/src/first-run.mjs`、`app/src/updates.mjs`、`app/src/main.mjs`、`app/test/start-page.test.mjs`++## 为什么++启动页的字是在两份设计稿里一句一句定下来的,代码里却散在三张表里:页面的 `text.mjs`(118 个键),主进程的 `first-run.mjs`(30 个)和 `updates.mjs`(11 个),后两张用函数拼句子,没有测试盯着。键名按来历起,不按它在页面上是哪一行字:鲸鱼那一行既有 `voice.*` 也有 `title.*`,提示行里有一个 `slow.45.later`,按钮一半是光杆键(`retry`)一半挂在卡片下(`card.recommend.use`),卡片正文散在 `card.*`、`import.*`、`newer.*`、`update.*` 和光杆键里。于是同一句话写了两遍(「换个位置…」「DeepSeek Bot 没有权限在 … 里写文件。」),同一个意思有两三种写法(「不复制 / 先不复制」「不带团队开始 / 先不带团队开始」),标点看情况(鲸鱼的话里只有「团队界面没有加载出来。」带句号,提示行里只有「比平时慢,请再等一会儿。」带句号),用词也走了样(「聊天记录」对「对话」,「群」对「群聊」,英文里 chats 和 conversations 混用)。审一遍 2026-10-29 的表,没有一个键是死的,问题全在结构上。++这份稿只做一件事:**按字在页面上的位置分层,每一层一条写法规则,一个键一句话,一张表,一组测试。** 已定的句子一个字都不改,除非它违反自己那一层的规则;改了的逐条记在「改动的已定设计」里。++## 已定的行为++### 1. 一张表++- 壳里用户看得到的字都在 `app/src/start/text.mjs` 的 `TEXT` 里:启动页的,和挂在启动窗口或主窗口上的系统对话框的(选文件夹、搬数据、导入、更新)。`first-run.mjs` 和 `updates.mjs` 不再有自己的表。+- 中文是源,英文逐键对照;两边键集相同、占位符相同(已有的测试)。+- 占位符 `{name}`;路径、大小、名字、版本都从快照或参数填,表里不写。英文的单复数写在占位符里:`{bots|Bot|Bots}` 填成「1 Bot」「6 Bots」(`t()` 按值是不是 1 选)。中文不用。+- 查字只有一个函数 `t(lang, key, vars)`。语言由 `langOf(locale)` 定(`zh*` → `zh`,其余 `en`),页面从快照拿,主进程用 `app.getLocale()`。+- 产品名不是文案:对话框标题 `DeepSeek Bot`、`DSH Desktop`、`DSH Web` 是常量,不进表、不翻译。+- 表以外不再有用户看得到的中文或英文;主进程里给 Bot 或开发者看的英文错误串(浏览器、cookie 导入、IPC 拒绝)不算文案,不进表。++### 2. 层:键的第一段++键写成 `<层>.<事>[.<部分>]`。第一段只能是下面十个,说的是这行字在页面的哪里,不是它为什么存在。每层一条写法规则(中文;英文照第 4 节)。++| 层 | 在哪里 | 谁在说 | 规则 |+|---|---|---|---|+| `voice.*` | 鲸鱼下面那一行 | 鲸鱼,第一人称、口语 | 一行,不折行,最多 16 字;不加句号,可以问号;可以用口语的动词(「搬过来」) |+| `say.*` | 卡片的第一行(15/20、600) | 鲸鱼 | 最多 12 字;不加句号 |+| `hint.*` | 提示行 | 应用,中性 | 只写接下来要知道的一件事,最多 22 字;不加句号 |+| `card.*` | 卡片正文 | 应用 | 整句,以 。? 结尾;说出了什么事,怎么办交给按钮;路径放 `code`;`card.<卡>.<部分>`,几张卡共用的放 `card.update.*` |+| `reason.*` | 卡片正文里复用的原因 | 应用 | 整句的以 。 结尾(`reason.place.*` 位置不能用的七个原因、`reason.start.*` 启动失败的五个);嵌进句子的片段不带标点(`reason.copy.*` 复制失败的三个) |+| `btn.*` | 按钮 | 用户的动作 | 最多 10 字,动词或动作短语开头;打开系统选择框或离开这张卡的以 … 结尾;不加句号;链接样式的小按钮可以是名词短语(「其他位置…」「详细」) |+| `note.*` | 卡片脚注 | 应用 | 一句,以 。 结尾,说以后在哪里改 |+| `foot.*` | 底注行 | 应用 | 不加句号(「社区开源项目,不是 DeepSeek 官方产品」、位置行) |+| `status.*` | 只给读屏和计数 | 应用 | 不加句号:隐藏列表「启动进度」、三个阶段名、四个状态词、朗读句、「已用 N 秒」 |+| `dialog.*` | 系统对话框的正文和标题 | 应用 | 正文整句以 。? 结尾,可以两段(`\n\n`);选择框标题不加句号;按钮用 `btn.*` |++- 同一句话只有一个键;两层里都要的同一句,各自一键(提示行的「C 盘只剩 1.2 GB」和卡片里的「C 盘只剩 1.2 GB。」是两层两键)。+- 同一个意思只有一种写法:「先不复制」(不复制团队,继续)和「先不带团队开始」(放弃复制、带空白团队启动)是两个意思,各一种写法;对话框里原来的「不复制」「不带团队开始」改成这两句。+- 一个东西一个名字(上手流程「用词」):对话(不是聊天记录)、群聊(不是群)、API Key(不是密钥)、附件、总工作区、数据文件夹、位置(设置项,英文 Location,单数)。鲸鱼的话可以口语(「正在搬过来」),按钮和正文用正式名(「复制过来」「停止复制」)。+- 不写过程词:马上、稍后、下个版本(UI 标准第 11 节;测试扫全表)。「待会儿要接一个模型」说的是用户的下一步,不是引擎的承诺,留着。++### 3. 键的对照++旧键 → 新键,中文照旧的不写,改了的写出来。++鲸鱼的话 `voice.*`:`voice.hello / helloName / helloBack / data / found / engine / slow10 / slow45 / team / ready / watchdog` 不动;`title.later` → `voice.opening`,`title.moving` → `voice.moving`,`title.failed` → `voice.failed`,`title.viewFailed` → `voice.viewFailed`「团队界面没有加载出来」(去句号)。++卡片第一行 `say.*`:`say.space / permission / rejected / picked / missing / import / importSpace / inUse / newer` 不动;`copying.title` → `say.copying`「正在搬过来」。++提示行 `hint.*`:`hint.model / preview / reinstall / space` 不动;`slow.45.later` → `hint.slowLater`「比平时慢,请再等一会儿」(去句号)。++卡片正文 `card.*`:++| 旧 | 新 | 中文 |+|---|---|---|+| `card.recommend.ask` | `card.recommend.ask` | 放到 {rec} 盘(剩 {recFree})? |+| `card.reason.space`、`card.reason.permission` | 见 `reason.place.*` | |+| `card.rejected.*` | 见 `reason.place.*` | 卡片直接用 `reason.place.{reason}` |+| `card.missing` | `card.missing.lead` | |+| `card.missing.retryMissed` | `card.missing.retryMissed` | |+| `card.picked` | `card.picked.lead` | 会放在 {path}。(加句号) |+| `import.lead / extra / found / scope / model` | `card.import.lead / extra / found / scope / model` | |+| `import.opt.regen / skipWork` | `card.import.optRegen / optSkipWork` | 勾选框的标签 |+| `import.space` | `card.importSpace.lead` | |+| `copying.step1 / 2 / 3` | `card.copying.step1 / 2 / 3` | |+| `eta.minutes`、`eta.lt1` | `card.copying.eta`、`card.copying.etaSoon` | |+| `stop.confirm` | `card.copying.stopConfirm` | |+| `inUse` | `card.inUse.lead` | |+| `newer.updating`、`newer.unreadable` | `card.newerUpdating.lead`、`card.newer.lead` | |+| `importFailed` | `card.importFailed.lead` | |+| `failed.reason.*` | 见 `reason.start.*` | 卡片直接用 `reason.start.{reason}` |+| `update.available / downloading / installing / failed / slow` | `card.update.available / downloading / installing / failed / slow` | |++原因 `reason.*`:++| 新 | 中文 | 来自 |+|---|---|---|+| `reason.place.space` | {drive} 盘只剩 {free}。 | `card.reason.space` |+| `reason.place.permission` | DeepSeek Bot 没有权限在 {path} 里写文件。 | `card.reason.permission` 和 `card.rejected.permission` 合一 |+| `reason.place.onedrive` | {path} 在 OneDrive 里,同步会打断正在写入的对话。 | `card.rejected.onedrive`(聊天记录 → 对话) |+| `reason.place.foreign / dsh / program / nested` | 照旧 | `card.rejected.*` |+| `reason.start.permission / space / files / engine / other` | 照旧,带句号 | `failed.reason.*` |+| `reason.copy.inUse / permission / full` | 照旧,片段 | `importFailed.*` |++按钮 `btn.*`:++| 旧 | 新 | 中文 |+|---|---|---|+| `retry`、`wait`、`openLogs`、`freshStart` | `btn.retry`、`btn.wait`、`btn.openLogs`、`btn.freshStart` | |+| `card.recommend.use`、`card.recommend.keep` | `btn.useRec`、`btn.keepDrive` | 放到 {rec} 盘、仍然放在 {drive} 盘 |+| `card.recommend.other` | `btn.otherPlace` | 其他位置…(链接样式) |+| `pickOther` | `btn.pickPlace` | 选择其他位置… |+| `place.change`、`changePlace` | `btn.changePlace` | 换个位置…(合一;英文 Change the location…) |+| `card.missing.relocate` | `btn.relocate` | 重新找到它… |+| `card.picked.use`、`card.picked.repick` | `btn.continue`、`btn.repick` | 继续、重新选…(加 …:它打开系统选择框) |+| `import.copy`、`import.skip` | `btn.copy`、`btn.skipCopy` | 复制过来、先不复制 |+| `import.more`、`import.change` | `btn.more`、`btn.changeModel` | 详细、更换 |+| `stop`、`keepCopying` | `btn.stopCopy`、`btn.keepCopying` | 停止复制、继续复制 |+| `startWithout` | `btn.startWithout` | 先不带团队开始 |+| `copyDetails`、`copied`、`details` | `btn.copyDetails`、`btn.copied`、`btn.details` | |+| `update.install`、`manualDownload`、`reload` | `btn.install`、`btn.manualDownload`、`btn.reload` | |+| 对话框的 `move`、`cancel`、`quit`、`restart`、`download` | `btn.move`、`btn.cancel`、`btn.quit`、`btn.restart`、`btn.download` | 移动并重启、取消、退出、立即重启、下载 |+| 对话框的 `copy`、`skip`、`startEmpty` | 并入 `btn.copy`、`btn.skipCopy`、`btn.startWithout` | 复制过来、先不复制、先不带团队开始 |+| 更新框的 `later` | `btn.notNowRestart`、`btn.notNowDownload` | 先不重启、先不下载(「稍后」是过程词) |+| 写死的 `'OK'` | `btn.ok` | 确定 |++脚注 `note.*`:`card.footnote` → `note.changeLater`「以后可以在 设置 → 通用 → 位置 里改。」;`import.footnote` → `note.copyLater`「也可以在 设置 → 通用 → 位置 里复制。」;`newer.footnote` → `note.copyAgain`「以后可以在 设置 → 通用 → 位置 里复制。」(和 `note.changeLater` 同一个句式)。++底注 `foot.*`:`footer` → `foot.community`;`place.drive / driveOnly / path / pathOnly` → `foot.place.drive / driveOnly / path / pathOnly`。++状态 `status.*`:`track.label` → `status.track`;`phase.*` → `status.phase.*`;`state.*` → `status.state.*`;`sr.*` → `status.sr.*`;`elapsed` → `status.elapsed`。++对话框 `dialog.*`(原来在 `first-run.mjs` 和 `updates.mjs`):++| 新 | 中文 |+|---|---|+| `dialog.pickRoot` | 选择 DeepSeek Bot 放数据的位置 |+| `dialog.pickMove` | 选择 DeepSeek Bot 数据的新文件夹 |+| `dialog.move.inDsh` | 请选择 DeepSeek Harness 数据({home})以外的文件夹。 |+| `dialog.move.inProgram / drive / nested / workspace / notEmpty` | 照旧 |+| `dialog.move.confirm`、`dialog.move.detail` | 把 DeepSeek Bot 的数据移到 {to} 吗? / DeepSeek Bot 会把数据复制过去,然后重新启动。{from} 会原样保留,确认一切正常后可以自己删掉。 |+| `dialog.move.inUse`、`dialog.move.failed` | 照旧(`{message}`) |+| `dialog.import.found` | DeepSeek Harness 里有 {bots} 个 Bot 和 {groups} 个群聊。要复制到 DeepSeek Bot 吗?(原来 0 个群聊时不写群;现在和导入卡一样总写) |+| `dialog.import.foundDetail` | 会复制 Bot、群聊、记忆、对话、附件、模型设置和 API Key。{home} 里的内容不会改变,复制以后两边各用各的。(群 → 群聊,密钥 → API Key,文件 → 附件,和 `card.import.scope` 一致) |+| `dialog.import.inUse` | DeepSeek Harness 正在使用这个团队。请先关掉它,再重试。 |+| `dialog.import.newer` | 有 {n} 段对话是更新版本的 DeepSeek Harness 写的,这个版本的 DeepSeek Bot 读不了。请先更新 DeepSeek Bot,再打开它来复制团队。 |+| `dialog.import.whichModels` | DeepSeek Bot 用哪一份模型设置? |+| `dialog.import.failed` | 团队没有复制完:{message}\n\nDeepSeek Bot 会用一个新团队开始。DeepSeek Harness 里的团队没有变化。(没有复制成功 → 没有复制完,和 `card.importFailed.lead` 一致) |+| `dialog.update.ready`、`dialog.update.readyDetail` | DeepSeek Bot {version} 已经下载好。 / 现在重启就能更新;不重启的话,下次退出时安装。(英文改成 has finished downloading,原来说的是 ready to install) |+| `dialog.update.available`、`dialog.update.availableDetail` | 照旧 |+| `dialog.update.onFailure`、`dialog.update.onFailurePage` | 照旧 |++### 4. 英文++- 逐键对照中文的意思,不另写一套:位置行写全「Data on drive {drive}, {free} free」(原来只有「Drive C, 412 GB free」)。+- 句首大写;`voice / say / hint / btn / foot / status` 不加句号;`card / reason(整句)/ note / dialog` 以句号或问号结尾;… 和中文同步。+- 名词:chats(不用 conversations)、group chats、attachments、API Key、Settings → General → Location(单数)、team workspace、data folder、local engine。+- 单复数用 `{n|one|many}`:`hint.reinstall`「Your {bots|Bot|Bots} and {groups|group chat|group chats} are still here」、`card.import.lead`、`card.import.found`、`dialog.import.found`、`dialog.import.newer`。+- 「先不复制」是 Don't copy yet,「先不带团队开始」是 Start without the team,「先不重启」Not now(重启框)、「先不下载」Not now(下载框)。++### 5. 测试++`app/test/start-page.test.mjs` 扫 `text.mjs` 全表、`start.html`、`start.js`、`whale.js`,以及 `main.mjs`、`first-run.mjs`、`updates.mjs`:++- 已有的:中英键集和占位符相同;中文里没有白名单外的英文;没有 马上 / 稍后 / 下个版本;页面用到的键都在表里。+- 新加的:+ - 每个键的第一段是十层之一。+ - `voice / say / hint / btn / foot / status` 的中文不以 。 结尾,英文不以 . 结尾;`card / note / dialog` 的整句以 。? 结尾(`reason.copy.*`、`card.update.slow`「下载太慢?」、选择框标题、`card.copying.step*`、`card.copying.eta*`、`card.import.model`、`card.import.opt*`、进度行 `card.update.downloading` 除外,测试里列明)。+ - 字数上限(去掉占位符后):`voice` 16、`say` 12、`hint` 22、`btn` 10。+ - `start.html` 里 `data-act="pick"` 的按钮,键的中文以 … 结尾。+ - 主进程三个文件里 `tx('…')` 用到的键都在表里;`first-run.mjs` 和 `updates.mjs` 里没有自己的字符串表。+ - `t()` 的单复数:`{bots|Bot|Bots}` 在 1 和 6 上各填对。++## 改动的已定设计++| 原来 | 现在 | 原因 |+|---|---|---|+| 启动窗口稿第 7 节、上手流程第 3 节:鲸鱼的话「团队界面没有加载出来。」 | 「团队界面没有加载出来」 | 鲸鱼那一行不加句号,和「DeepSeek Bot 没能启动」一致 |+| 启动窗口稿第 5 节、上手流程第 8 节:45 秒「比平时慢,请再等一会儿。」 | 「比平时慢,请再等一会儿」 | 提示行不加句号 |+| 启动窗口稿第 6 节、上手流程第 3 节:「会放在 `D:\DeepSeek Bot`」〔继续〕〔重新选〕 | 「会放在 `D:\DeepSeek Bot`。」〔继续〕〔重新选…〕 | 卡片正文以句号结尾;打开系统选择框的按钮以 … 结尾(被拒绝的卡上的〔重新选…〕一样) |+| 启动窗口稿第 6 节:「…在 OneDrive 里,同步会打断正在写入的聊天记录。」 | 「…正在写入的对话。」 | 一个东西一个名字 |+| 上手流程第 4 节:更新版本那张卡的脚注「可以在 设置 → 通用 → 位置 里再复制。」 | 「以后可以在 设置 → 通用 → 位置 里复制。」 | 和「以后可以在 … 里改。」同一个句式 |+| `first-run.mjs`:导入对话框〔复制〕〔不复制〕〔不带团队开始〕 | 〔复制过来〕〔先不复制〕〔先不带团队开始〕 | 和导入卡同一种写法;对话框只到导入卡落地(M5)为止 |+| `first-run.mjs`:「DeepSeek Harness 里有一个 Bot 团队:6 个 Bot、2 个群。」「会复制 Bot、群、记忆、对话、文件、密钥和模型设置。」 | 「DeepSeek Harness 里有 6 个 Bot 和 2 个群聊。要复制到 DeepSeek Bot 吗?」「会复制 Bot、群聊、记忆、对话、附件、模型设置和 API Key。…」 | 群聊、附件、API Key 是定下的名字 |+| 桌面应用稿 安装和更新、`updates.mjs`:更新框的〔稍后〕 | 〔先不重启〕〔先不下载〕 | 稍后是过程词,UI 标准第 11 节 |+| `main.mjs`:搬数据被拒绝的框只有英文的〔OK〕 | 〔确定〕/〔OK〕按语言 | 表以外不再有用户看得到的字 |++## 不做什么++- 不改任何一句的意思;上面没列的句子一个字不动。+- 不把插件里(团队界面、设置、Main Bot 聊天里的卡)的文案搬进这张表:那些在 `i18n.js`,源语言是英文(UI 标准第 11 节)。上手流程第 4、8 节里属于设置和聊天的句子不在这里。+- 不给启动页加新的句子。上手流程第 3 节定了〔重新找到它…〕选到没有数据的文件夹时写「这里没有 DeepSeek Bot 的数据。」,`.deepseek-bot` 标记还没落地,这句等那一步一起加(`card.missing.noData`)。+- 不改 `dialog.move.detail` 说的「{from} 会原样保留」:它说的是今天代码的行为;上手流程第 8 节「搬是搬,旧位置不留副本」落地时一起改。+- 不改 `dialog.update.availableDetail` 里「应用程序」文件夹的说法(macOS 的话也给了 Linux deb):属于更新流程,另记。++## 已知限制++- 字数上限按中文字符数算,去掉占位符后,一串连着的英文字母或数字(DeepSeek、GB)算一个字;英文不限长度:英文是否折行由样式决定,一行放不下时先改句子。+- 单复数只有英文 1 和多两种形,够启动页用;别的语言不在范围里。+- 测试里的「以 … 结尾」只查 `data-act="pick"` 的按钮;对话框里打开选择框的按钮(没有)不在内。++## 变更++- 2026-10-29 首稿:十层、一张表、键的对照、测试;对应 `text.mjs` 重排、`first-run.mjs` 和 `updates.mjs` 的表并入、`start.html` 和 `start.js` 改键。依据:2026-10-29 对三张表的审读(30 个对话框键和 11 个更新键都在用,没有死键;页面表和两份设计稿逐句对照只有 `failed.reason.*` 的句号一处不同;风格问题 30 条,全部复核过)。diff --git a/docs/plans/README.md b/docs/plans/README.mdindex a89374b0..ac537762 100644--- a/docs/plans/README.md+++ b/docs/plans/README.md@@ -51,3 +51,4 @@| [消息布局和宽度](2026-10-22-message-layout.md) | 气泡 / 平铺两种布局;平铺时 Bot 的话带头像、名字、时间;气泡宽度和平铺正文宽度各用一个滑块,按正文列的百分比调 || [Windows 上手流程](2026-10-26-windows-onboarding.md) | 从下载到第一条回复:下载区和信任说明、安装、窗口先出来的启动页、一个位置和推荐盘、启动页上的一键导入、Main Bot 聊天里的模型设置卡(登录或检查过的 key、自动选模型)、修复卡、第一个小时的 Windows 问题、卸载时问一次 || [启动窗口](2026-10-26-start-window.md) | 启动页的样子和动作:单独的小窗口(待定),Main Bot 的鲸鱼沿着水线一站一站游过三个真实阶段,等待越久越慢,卡片和失败页在同一张纸面上变形,就绪时潜下去、团队窗口盖上来 |+| [启动页文案](2026-10-29-start-copy.md) | 启动页和壳里系统对话框的字:按页面位置分层,每层一条写法规则;`text.mjs` 一张表、旧键到新键的对照、扫全表的测试 |