A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.
Allow the default team workspace only as the folder itself
Fei2411ae43bee3237a
diff --git a/ds-bot/src/host/folders.js b/ds-bot/src/host/folders.jsindex 5c2b3c7f..5f761546 100644--- a/ds-bot/src/host/folders.js+++ b/ds-bot/src/host/folders.js@@ -94,13 +94,14 @@ export function install(rt) {const text = unquote(input)const expanded = expandHome(text)if (text === '' || !isAbsolute(expanded)) throw new Error(`Give the full path of the folder, not ${text}`)- // The plugin's own default lies in DSH's data, and going back to it stays possible, as long- // as it holds none of the data itself (a link put in its place could).+ // The plugin's own default lies in DSH's data, and going back to it stays possible: that+ // folder itself, not where a link put in its place leads.const fallback = resolve(defaultTeamFolder())+ const own = join(await realBeyond(dirname(fallback)), basename(fallback))const holdsData = async (path) => {const roots = await Promise.all([rt.dshHome, rt.home].map(real))if (roots.some(data => within(data, path))) return true- if (path === fallback || path === await real(fallback)) return false+ if (path === own && await realBeyond(fallback) === own) return falsereturn roots.some(data => within(path, data))}// A folder to be made counts where it would be made: a link above it can lead into the data.diff --git a/ds-bot/test/work-dir.test.js b/ds-bot/test/work-dir.test.jsindex b5fac2bd..09a5414e 100644--- a/ds-bot/test/work-dir.test.js+++ b/ds-bot/test/work-dir.test.js@@ -607,11 +607,15 @@ test('the team workspace holds no DeepSeek Harness data, apart from the plugin\'await call('team-workspace', { path: join(root, 'moved') })assert.deepEqual((await call('team-workspace', { path: join(home, 'workspace') })).value, { team })assert.equal(state().workspaceId, 'w1')- // The default replaced by a link to the data is the data, and is refused.+ // The default replaced by a link into the data, to all of it or a part, is refused.await call('team-workspace', { path: join(root, 'moved') })rmSync(team, { recursive: true, force: true })symlinkSync(home, team, process.platform === 'win32' ? 'junction' : 'dir')assert.match(await error(team), /holds DeepSeek Harness data/)+ rmSync(team, { recursive: true, force: true })+ mkdirSync(join(dsh, 'profiles'))+ symlinkSync(join(dsh, 'profiles'), team, process.platform === 'win32' ? 'junction' : 'dir')+ assert.match(await error(team), /holds DeepSeek Harness data/)assert.equal(state().workspaceId, 'w-new')})