Skip to content

A team of long-lived bots for DeepSeek Harness, with main bots, bot-to-bot messages and group chats.

Give the desktop app its own engine profile

Fei2411fc70ef058b38
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
index d2a544d0..a5400e1b 100644
--- a/.github/workflows/test.yml
+++ b/.github/workflows/test.yml
@@ -54,6 +54,24 @@ jobs:
env:
SCAN_EXTRA_PATTERNS: ${{ secrets.SCAN_EXTRA_PATTERNS }}
+ app:
+ name: Desktop app profile
+ runs-on: ubuntu-latest
+ defaults:
+ run:
+ shell: bash
+ working-directory: app
+ steps:
+ - uses: actions/checkout@v4
+ - uses: actions/setup-node@v4
+ with:
+ node-version: 24
+ # The test composes the profile and starts no window, so it needs no Electron binary.
+ - run: npm ci --no-fund --no-audit
+ env:
+ ELECTRON_SKIP_BINARY_DOWNLOAD: '1'
+ - run: npm test
+
docker:
name: Docker startup and data migration
runs-on: ubuntu-latest
@@ -70,11 +88,11 @@ jobs:
# The one check that branch rules require. A job whose needs failed is skipped,
# and GitHub counts a skipped required check as passed, so this job always runs
- # and fails unless the matrix, leak scan and Docker checks passed.
+ # and fails unless the matrix, leak scan, app and Docker checks passed.
result:
name: Test result
- needs: [test, scan, docker]
+ needs: [test, scan, app, docker]
if: always()
runs-on: ubuntu-latest
steps:
- - run: test "${{ needs.test.result }}" = success && test "${{ needs.scan.result }}" = success && test "${{ needs.docker.result }}" = success
+ - run: test "${{ needs.test.result }}" = success && test "${{ needs.scan.result }}" = success && test "${{ needs.app.result }}" = success && test "${{ needs.docker.result }}" = success
diff --git a/NOTICE b/NOTICE
index 513690ce..74ef7d24 100644
--- a/NOTICE
+++ b/NOTICE
@@ -16,12 +16,19 @@ MIT License, Copyright (c) 2026 DeepSeek
developer script for screenshots on Linux and is not in the npm package.
- app/src/web.mjs adapts apps/desktop/src/web-document.ts: the launch-token
cookie exchange and the request forwarding.
- - app/src/host.mjs follows apps/desktop-host/src/index.ts: the profile boot
- and the ready, fatal and shutdown messages.
+ - app/src/host.mjs and app/src/profile.mjs follow
+ apps/desktop-host/src/index.ts: the profile boot and the ready, fatal and
+ shutdown messages.
- app/src/host-process.mjs follows apps/desktop/src/host-process.ts: the
Host in Electron's Node mode and the shutdown escalation.
- app/src/main.mjs follows apps/desktop/src/main.ts for the dsh-app scheme
and the request routing.
+ - app/engine/cordis.patch.yml follows the bundle patch of
+ @deepseek-ai/dsh-web-app (packages/bundle/web-app/cordis.patch.yml): the
+ transport and host-service rows and the agent-plane rows it turns off.
+ app/engine/preset-standard.patch.yml copies its standard preset
+ (presets/standard.patch.yml), including the plan-mode prompt text,
+ without the goal rows.
Full license text:
diff --git a/app/README.md b/app/README.md
index f9b2d4d6..1a9f9e6d 100644
--- a/app/README.md
+++ b/app/README.md
@@ -21,8 +21,22 @@ npm installs `ds-bot` from `../ds-bot` as a copy of its package files (`install-
The Host reads model settings and keys the way DSH does: environment variables such as `DEEPSEEK_API_KEY`, and `.env` and `.credentials.yaml` in the data location.
+## The profile
+
+The Host's profile `ds-bot` is in `profiles/ds-bot` in the data location. It stacks three bundles, and after them the bundles that the user installs:
+
+| Bundle | What it adds |
+|---|---|
+| `@deepseek-ai/dsh-base` | DSH's shared core: models, Sessions, tools, settings, plugin management |
+| `deepseek-bot-engine` (`engine/`) | The loopback transport for ds-bot's channel, the host services that ds-bot uses, and the `standard` agent preset that Bot Sessions run on, without the goal command and tool. It has no row of DSH's Web front end |
+| `ds-bot` | The Bot team |
+
+At every start the Host puts these three bundles at the head of the profile's bundle list. Settings for one machine go into the profile's `cordis.patch.yml`, as in DSH. The `@deepseek-ai/dsh` package still installs DSH's Web front end, but the profile does not load it. When the app moves to another DSH version, compare `engine/` with the `dsh-web-app` bundle patch and the standard preset of that version.
+
## Check a change
+`npm test` checks the composition of the profile.
+
`scripts/shot.mjs` starts the app on throwaway folders, saves a screenshot of its window, prints the page text, closes the window the way a user does and waits until the app exits. Build the window first (`npm run build`). Use the mock model of the plugin, `../ds-bot/dev/mock-llm.mjs` (`MOCK_PORT=<port> node ../ds-bot/dev/mock-llm.mjs`).
```sh
@@ -40,7 +54,10 @@ Never point `DS_BOT_HOME` at `~/.dsh` or at the data of an app that you use.
|---|---|
| `src/main.mjs` | Main process: one instance, the `dsh-app://app` scheme (the window's build, and `/api/` forwarded to the Host), the window |
| `src/host-process.mjs` | Starts the Host in Electron's Node mode and owns its exit |
-| `src/host.mjs` | The Host: creates the profile `ds-bot` (`dsh-base`, `dsh-web-app`, `ds-bot`), boots it with `runProfile()` on a loopback port and reports the launch URL |
+| `src/host.mjs` | The Host: boots the profile with `runProfile()` and reports the launch URL |
+| `src/profile.mjs` | The profile: its name, its bundles, and its creation and update |
+| `engine/` | The bundle `deepseek-bot-engine`: `cordis.patch.yml`, `preset-standard.patch.yml`, and `index.js`, which trades the launch token for the Host cookie |
+| `test/` | `npm test`: the composition of the profile |
| `src/web.mjs` | The window's files, the launch-token cookie exchange and the request forwarding |
| `ui/` | The window: React, built with Vite (`vite.config.js`) into `ui/dist`. It uses ds-bot's `api/bot` channel and its live feed `api/bot/feed`, and takes the Bot marks, themes and copy from `../ds-bot/src/client/` |
diff --git a/app/engine/cordis.patch.yml b/app/engine/cordis.patch.yml
new file mode 100644
index 00000000..fbd46bbf
--- /dev/null
+++ b/app/engine/cordis.patch.yml
@@ -0,0 +1,143 @@
+# The engine layer of the desktop app's profile, over dsh-base and under
+# ds-bot. It adds the loopback transport for ds-bot's channel, the host
+# services ds-bot uses, and the agent preset that Bot Sessions run on. It has
+# no DSH Web front-end rows: the window is the app's own page (../ui), which
+# talks only to ds-bot.
+#
+# The rows follow @deepseek-ai/dsh-web-app's bundle patch (MIT; see NOTICE).
+# When the app moves to another DSH version, compare this file and
+# preset-standard.patch.yml with that version's dsh-web-app bundle patch and
+# standard preset.
+
+- id: system-prompt
+ config:
+ personaSuffix: Your working directory is {{cwd}}.
+ personaPrefix: >-
+ You are a coding agent powered by the {{model}} model.
+
+- insert:
+ # The shell is the only client: it trades the launch token for the Host
+ # cookie and forwards the window's /api/ requests. Port 0 lets the system
+ # choose a free port, which the Host reports to the shell.
+ - id: webserver
+ name: '@deepseek-ai/dsh-host-webserver'
+ config:
+ host: 127.0.0.1
+ port: 0
+ compression: gzip
+ compressionLevel: 1
+ compressionThresholdBytes: 1024
+
+ - id: connection
+ name: '@deepseek-ai/dsh-client-connection'
+ config:
+ trustedHosts: []
+
+ # This package's own plugin (index.js): the launch-token exchange.
+ - id: engine-index
+ name: deepseek-bot-engine
+
+ - id: api-remotes
+ name: '@deepseek-ai/dsh-api-remotes'
+
+ # Uploads staged for later prompts; the session controller needs it.
+ - id: file-upload
+ name: '@deepseek-ai/dsh-client-file-upload'
+
+ - id: workspace
+ name: '@deepseek-ai/dsh-workspace'
+
+ - id: session-controller
+ name: '@deepseek-ai/dsh-api-session-controller'
+
+ # ds-bot's folder chooser for Bot and group working folders.
+ - id: directory-picker
+ name: '@deepseek-ai/dsh-host-directory-picker-auto'
+
+ # Read by the standard preset's subagent tool (modelSelectionSettings).
+ - id: subagent-model-selection-settings
+ name: '@deepseek-ai/dsh-tool-subagent/model-selection-settings'
+
+# Every Session mounts an agent preset, so the base rows that compose one
+# agent's tools and prompt sections are off on the host plane. The registries
+# they feed (jobs, skills, goals, subagents, the token meter) stay on.
+
+- id: tool-plugin-manager
+ disabled: true
+
+- id: tool-bash
+ disabled: true
+
+- id: tool-pwsh
+ disabled: true
+
+- id: tool-jobs
+ disabled: true
+
+- id: tool-fs
+ disabled: true
+
+- id: tool-fs-search
+ disabled: true
+
+- id: skill-filesystem
+ disabled: true
+
+- id: tool-skill
+ disabled: true
+
+- id: command-goal
+ disabled: true
+
+- id: tool-goal
+ disabled: true
+
+- id: plan-mode
+ disabled: true
+
+- id: compaction-basic
+ disabled: true
+
+- id: command-compact
+ disabled: true
+
+- id: tool-result-pruner
+ disabled: true
+
+- id: tool-subagent-control
+ disabled: true
+
+- id: tool-subagent-list-agents
+ disabled: true
+
+- id: tool-subagent
+ disabled: true
+
+- id: tool-subagent-fork
+ disabled: true
+
+- id: workflow-ptc
+ disabled: true
+
+- id: tool-workflow
+ disabled: true
+
+# The preset gate reads declared row ids whether or not they are disabled, so
+# this row stays to keep tool-ralph off the host plane.
+- id: tool-ralph
+ disabled: true
+
+- id: agent-instructions
+ disabled: true
+
+- id: tool-todo
+ disabled: true
+
+- id: tool-web
+ disabled: true
+
+- insert:
+ - id: agent-preset-registry
+ name: '@deepseek-ai/dsh-agent-preset-registry'
+ config:
+ default: standard
diff --git a/app/engine/index.js b/app/engine/index.js
new file mode 100644
index 00000000..be5473b8
--- /dev/null
+++ b/app/engine/index.js
@@ -0,0 +1,19 @@
+// The engine's index: the app shell opens the Host's launch URL here and trades its token for the Host
+// cookie. The window's page comes from the shell, so the index serves nothing else.
+
+export const name = 'deepseek-bot-engine'
+export const inject = ['webServer', 'connection']
+
+export function apply(ctx) {
+ ctx.effect(() => ctx.webServer.registerFallback((req, res) => {
+ const pathname = new URL(req.url ?? '/', 'http://x').pathname
+ if (req.method !== 'GET' || pathname !== '/') {
+ res.writeHead(404)
+ res.end()
+ return
+ }
+ if (!ctx.connection.authorizeIndex(req, res)) return
+ res.writeHead(204, { 'cache-control': 'no-store' })
+ res.end()
+ }), 'deepseek-bot-engine: launch-token exchange')
+}
diff --git a/app/engine/package.json b/app/engine/package.json
new file mode 100644
index 00000000..fedcb052
--- /dev/null
+++ b/app/engine/package.json
@@ -0,0 +1,60 @@
+{
+ "name": "deepseek-bot-engine",
+ "version": "0.1.7",
+ "private": true,
+ "description": "The engine layer of the DeepSeek Bot desktop app profile: transport, host services and the Bot agent preset over dsh-base, without the DSH Web front end.",
+ "license": "Apache-2.0",
+ "type": "module",
+ "main": "index.js",
+ "exports": {
+ ".": "./index.js",
+ "./package.json": "./package.json"
+ },
+ "files": [
+ "index.js",
+ "cordis.patch.yml",
+ "preset-standard.patch.yml"
+ ],
+ "dsh": {
+ "bundle": {
+ "patch": [
+ "./cordis.patch.yml",
+ "./preset-standard.patch.yml"
+ ]
+ }
+ },
+ "dependencies": {
+ "@deepseek-ai/dsh-agent-instructions": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-agent-preset": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-api-remotes": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-api-session-controller": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-client-connection": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-client-file-upload": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-command-compact": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-compaction-basic": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-host-directory-picker-auto": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-host-webserver": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-persona": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-plan-mode": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-plugin-manager": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-skill-filesystem": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-ask-user": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-bash": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-fs": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-fs-search": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-jobs": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-present": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-pwsh": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-ralph": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-skill": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-subagent": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-subagent-control": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-todo": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-web": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-workflow": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-workflow-ptc": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-workspace": "0.2.0-rc.2"
+ }
+}
diff --git a/app/engine/preset-standard.patch.yml b/app/engine/preset-standard.patch.yml
new file mode 100644
index 00000000..5c4ed8cb
--- /dev/null
+++ b/app/engine/preset-standard.patch.yml
@@ -0,0 +1,142 @@
+# The standard agent preset that every Bot Session runs on. It is DSH's
+# standard preset (@deepseek-ai/dsh-web-app presets/standard.patch.yml, MIT;
+# see NOTICE) without the goal command and tool: Bot Sessions have no goals.
+- insert:
+ - id: preset-standard
+ name: '@deepseek-ai/dsh-agent-preset'
+ config:
+ id: standard
+ order: 1
+ plugins:
+ - id: persona
+ name: '@deepseek-ai/dsh-persona'
+ config:
+ suffix: Your working directory is {{cwd}}.
+ prefix: You are a coding agent powered by the {{model}} model.
+ - id: agent-instructions
+ name: '@deepseek-ai/dsh-agent-instructions'
+ config:
+ maxBytes: 65536
+ - id: tool-bash
+ name: '@deepseek-ai/dsh-tool-bash'
+ disabled: !!js process.platform === 'win32'
+ - id: tool-pwsh
+ name: '@deepseek-ai/dsh-tool-pwsh'
+ disabled: !!js process.platform !== 'win32'
+ - id: tool-fs
+ name: '@deepseek-ai/dsh-tool-fs'
+ - id: tool-fs-search
+ name: '@deepseek-ai/dsh-tool-fs-search'
+ config:
+ sampleOverCapGlobResults: false
+ - id: tool-jobs
+ name: '@deepseek-ai/dsh-tool-jobs'
+ - id: skill-filesystem
+ name: '@deepseek-ai/dsh-skill-filesystem'
+ - id: tool-skill
+ name: '@deepseek-ai/dsh-tool-skill'
+ - id: planning
+ name: cordis:group
+ group: true
+ isolate:
+ planMode: true
+ config:
+ - id: plan-mode
+ name: '@deepseek-ai/dsh-plan-mode'
+ config:
+ section: |
+ You are in plan mode. Stay in plan mode until exit_plan_mode succeeds or the user switches the session mode. Imperative language to implement changes means plan the implementation, not execute it. A user's conversational agreement — including an answer confirming something you asked — approves nothing and does not end plan mode; fold the confirmed decision into the plan and submit it through exit_plan_mode.
+
+ Explore first. Use non-mutating reads, searches, static analysis, and checks to ground the plan in the actual repository. Do not edit or write files, change configuration, run formatters or code generation that rewrites tracked files, commit, or otherwise carry out the plan. Prefer existing functions and patterns over new machinery.
+
+ The tool catalog stays the same across modes for request-cache stability. These plan-mode rules override any later tool description or guidance that suggests using mutation tools; those tools remain listed to keep the tool catalog unchanged. Do not use todo_write to track this planning phase: it tracks implementation after an approved plan, while the plan itself belongs in exit_plan_mode.
+
+ Resolve discoverable facts by inspection. Use ask_user_question only for user-owned choices or material ambiguity that inspection cannot answer. Do not ask the user where code lives or how current behavior works when you can find out.
+
+ Make the plan decision-complete: state the goal and success criteria; group implementation changes by subsystem; identify public API, schema, and data-flow changes; cover edge cases, failure modes, tests, acceptance criteria, and explicit assumptions. Keep it concise enough to review but detailed enough that another engineer can implement it without making design decisions.
+
+ When ready, call exit_plan_mode with the complete plan markdown, starting with a # title. Make exit_plan_mode the only and final tool call in that assistant response: it presents the plan for approval, and implementation begins only in a later step after approval. Do not paste the final plan as a plain reply or ask "should I proceed?" through prose or ask_user_question. If review rejects it, incorporate the feedback and present again. If the review channel is unavailable or aborted, stay in plan mode and ask the user to switch modes manually; do not proceed with implementation.
+ - id: compaction
+ name: cordis:group
+ group: true
+ isolate:
+ compaction: true
+ toolResultPruner: true
+ config:
+ - id: compaction-basic
+ name: '@deepseek-ai/dsh-compaction-basic'
+ - id: command-compact
+ name: '@deepseek-ai/dsh-command-compact'
+ - id: tool-result-pruner
+ name: '@deepseek-ai/dsh-compaction-tool-result-pruner'
+ config:
+ thresholdChars: 8192
+ headChars: 4096
+ tailChars: 1024
+ - id: delegation
+ name: cordis:group
+ group: true
+ isolate:
+ workflowEngine: true
+ config:
+ - id: tool-subagent-control
+ name: '@deepseek-ai/dsh-tool-subagent-control'
+ - id: tool-subagent-list-agents
+ name: '@deepseek-ai/dsh-tool-subagent-control/list-agents'
+ - id: tool-subagent
+ name: '@deepseek-ai/dsh-tool-subagent'
+ config:
+ provider: spawn
+ toolName: subagent
+ modelSelectionSettings: true
+ backgroundMode: continuable
+ - id: tool-subagent-fork
+ name: '@deepseek-ai/dsh-tool-subagent'
+ config:
+ provider: fork
+ toolName: subagent_fork
+ backgroundMode: continuable
+ - id: tool-subagent-codex
+ name: '@deepseek-ai/dsh-tool-subagent'
+ disabled: true
+ config:
+ provider: codex
+ toolName: subagent_codex
+ backgroundMode: one-shot
+ maxDepth: provider-managed
+ - id: tool-subagent-claude-code
+ name: '@deepseek-ai/dsh-tool-subagent'
+ disabled: true
+ config:
+ provider: claude-code
+ toolName: subagent_claude_code
+ backgroundMode: one-shot
+ maxDepth: provider-managed
+ - id: workflow-ptc
+ name: '@deepseek-ai/dsh-workflow-ptc'
+ config:
+ provider: spawn
+ - id: tool-workflow
+ name: '@deepseek-ai/dsh-tool-workflow'
+ - id: tool-ralph
+ name: '@deepseek-ai/dsh-tool-ralph'
+ disabled: true
+ config:
+ subagentProvider: spawn
+ maxRounds: 64
+ - id: tool-ask-user
+ name: '@deepseek-ai/dsh-tool-ask-user'
+ - id: tool-todo
+ name: '@deepseek-ai/dsh-tool-todo'
+ config:
+ allowParallelInProgress: true
+ - id: tool-web
+ name: '@deepseek-ai/dsh-tool-web'
+ config:
+ fetch: true
+ searchTimeoutMs: 60000
+ - id: present
+ name: '@deepseek-ai/dsh-tool-present'
+ - id: tool-plugin-manager
+ name: '@deepseek-ai/dsh-plugin-manager/tools'
+ disabled: true
diff --git a/app/package-lock.json b/app/package-lock.json
index e400142f..a17b9fa7 100644
--- a/app/package-lock.json
+++ b/app/package-lock.json
@@ -12,7 +12,7 @@
"@deepseek-ai/dsh": "0.2.0-rc.2",
"@deepseek-ai/dsh-app-boot": "0.2.0-rc.2",
"@deepseek-ai/dsh-base": "0.2.0-rc.2",
- "@deepseek-ai/dsh-web-app": "0.2.0-rc.2",
+ "deepseek-bot-engine": "file:./engine",
"ds-bot": "file:../ds-bot",
"pnpm": "11.7.0"
},
@@ -23,6 +23,45 @@
"vite": "8.3.4"
}
},
+ "engine": {
+ "name": "deepseek-bot-engine",
+ "version": "0.1.7",
+ "license": "Apache-2.0",
+ "dependencies": {
+ "@deepseek-ai/dsh-agent-instructions": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-agent-preset": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-agent-preset-registry": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-api-remotes": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-api-session-controller": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-client-connection": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-client-file-upload": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-command-compact": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-compaction-basic": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-compaction-tool-result-pruner": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-host-directory-picker-auto": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-host-webserver": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-persona": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-plan-mode": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-plugin-manager": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-skill-filesystem": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-ask-user": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-bash": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-fs": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-fs-search": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-jobs": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-present": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-pwsh": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-ralph": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-skill": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-subagent": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-subagent-control": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-todo": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-web": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-tool-workflow": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-workflow-ptc": "0.2.0-rc.2",
+ "@deepseek-ai/dsh-workspace": "0.2.0-rc.2"
+ }
+ },
"node_modules/@agentclientprotocol/sdk": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/@agentclientprotocol/sdk/-/sdk-1.4.0.tgz",
@@ -7594,6 +7633,10 @@
"url": "https://github.com/sponsors/sindresorhus"
}
},
+ "node_modules/deepseek-bot-engine": {
+ "resolved": "engine",
+ "link": true
+ },
"node_modules/default-browser": {
"version": "5.5.1",
"resolved": "https://registry.npmjs.org/default-browser/-/default-browser-5.5.1.tgz",
diff --git a/app/package.json b/app/package.json
index 5f03c1c4..97a62f49 100644
--- a/app/package.json
+++ b/app/package.json
@@ -10,13 +10,14 @@
"scripts": {
"build": "vite build",
"start": "vite build && electron .",
- "shot": "node scripts/shot.mjs"
+ "shot": "node scripts/shot.mjs",
+ "test": "node --test \"test/*.test.mjs\""
},
"dependencies": {
"@deepseek-ai/dsh": "0.2.0-rc.2",
"@deepseek-ai/dsh-app-boot": "0.2.0-rc.2",
"@deepseek-ai/dsh-base": "0.2.0-rc.2",
- "@deepseek-ai/dsh-web-app": "0.2.0-rc.2",
+ "deepseek-bot-engine": "file:./engine",
"ds-bot": "file:../ds-bot",
"pnpm": "11.7.0"
},
diff --git a/app/src/host.mjs b/app/src/host.mjs
index fa05a941..3a0f27f9 100644
--- a/app/src/host.mjs
+++ b/app/src/host.mjs
@@ -1,16 +1,11 @@
// The Host: the shell runs this file in Electron's Node mode. It boots the app's own `ds-bot` profile
// on a loopback port and reports the launch URL over IPC.
// Follows DeepSeek Harness apps/desktop-host/src/index.ts (MIT); see NOTICE.
-import { fileURLToPath } from 'node:url'
import { inspect } from 'node:util'
-import { initProfile, loadLayeredEnv, loadProfileDirectory, reportSkippedBundles, resolveProfileDir } from '@deepseek-ai/dsh-app-boot'
+import { loadLayeredEnv, reportSkippedBundles } from '@deepseek-ai/dsh-app-boot'
import { runProfile } from '@deepseek-ai/dsh/profile-boot'
+import { INSTALL_ANCHOR, loadAppProfile, PROFILE } from './profile.mjs'
-const PROFILE = 'ds-bot'
-const BUNDLES = ['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-web-app', 'ds-bot']
-// The app's own manifest is the installation: DSH imports plugins only from the installation's dependency
-// graph, resolves bundles there first, and keeps the bundles it names as direct dependencies from removal.
-const INSTALL_ANCHOR = fileURLToPath(new URL('../package.json', import.meta.url))
const MAX_FATAL_DIAGNOSTIC_CHARS = 64 * 1024
const send = (message) => new Promise((resolve, reject) => {
@@ -20,16 +15,14 @@ const send = (message) => new Promise((resolve, reject) => {
async function main() {
const pnpm = process.argv[2]
- const dir = resolveProfileDir(PROFILE)
- initProfile(dir, BUNDLES)
- const profile = loadProfileDirectory('dsh', dir, INSTALL_ANCHOR)
+ const profile = loadAppProfile()
reportSkippedBundles('dsh', profile)
const application = runProfile({
environment: loadLayeredEnv('dsh'),
profile: PROFILE,
resolvedProfile: { profile, installAnchor: INSTALL_ANCHOR },
patchFiles: [],
- args: ['--no-open', '--port', '0'],
+ args: [],
...(pnpm === undefined ? {} : {
packageManager: { command: process.execPath, args: ['--expose-internals', pnpm], env: { ELECTRON_RUN_AS_NODE: '1' } },
}),
@@ -45,7 +38,10 @@ async function main() {
process.on('message', (message) => { if (message?.type === 'shutdown') void stop() })
process.once('disconnect', () => { void stop() })
const { ctx } = await application
- const url = ctx.connection.authenticatedUrl(`http://127.0.0.1:${String(ctx.webServer.port)}`)
+ const [webServer, connection] = [ctx.get('webServer'), ctx.get('connection')]
+ // A profile patch can turn these rows off; then the window has nothing to talk to.
+ if (webServer === undefined || connection === undefined) throw new Error(`The profile in ${profile.dir} does not start the engine's web server and connection.`)
+ const url = connection.authenticatedUrl(`http://127.0.0.1:${String(webServer.port)}`)
await send({ type: 'ready', url })
}
diff --git a/app/src/profile.mjs b/app/src/profile.mjs
new file mode 100644
index 00000000..10b829f0
--- /dev/null
+++ b/app/src/profile.mjs
@@ -0,0 +1,39 @@
+// The app's own DSH profile: its name, its bundles and its installation.
+import { fileURLToPath } from 'node:url'
+import { initProfile, loadProfileDirectory, readProfileManifest, resolveProfileDir, writeProfileBundles } from '@deepseek-ai/dsh-app-boot'
+
+export const PROFILE = 'ds-bot'
+// DSH's shared core, the app's engine layer (../engine), then the Bot team. Bundles the user installs follow.
+export const BUNDLES = ['@deepseek-ai/dsh-base', 'deepseek-bot-engine', 'ds-bot']
+// Bundles that earlier builds of the app put in its profile.
+const RETIRED_BUNDLES = ['@deepseek-ai/dsh-web-app']
+// The app's own manifest is the installation: DSH imports plugins only from the installation's dependency
+// graph, resolves bundles there first, and keeps the bundles it names as direct dependencies from removal.
+export const INSTALL_ANCHOR = fileURLToPath(new URL('../package.json', import.meta.url))
+
+/**
+ * Put the app's bundles at the head of a profile's bundle list and keep the user's after them.
+ * initProfile writes the list only into a new profile, so a profile from an earlier build keeps its old list.
+ * @param {string} dir - the profile directory
+ */
+export function claimBundles(dir) {
+ const manifest = readProfileManifest('dsh', dir)
+ const listed = manifest.dsh?.profile?.bundles ?? []
+ const bundles = [...BUNDLES, ...listed.filter((name) => !BUNDLES.includes(name) && !RETIRED_BUNDLES.includes(name))]
+ if (bundles.join('\n') !== listed.join('\n')) writeProfileBundles(dir, manifest, bundles)
+}
+
+/**
+ * Create or update the profile under the current DSH_HOME and load it.
+ * @returns {import('@deepseek-ai/dsh-app-boot').Profile} the loaded profile
+ * @throws when one of the app's own bundles does not load
+ */
+export function loadAppProfile() {
+ const dir = resolveProfileDir(PROFILE)
+ initProfile(dir, BUNDLES)
+ claimBundles(dir)
+ const profile = loadProfileDirectory('dsh', dir, INSTALL_ANCHOR)
+ const lost = profile.skippedBundles.filter(({ packageName }) => BUNDLES.includes(packageName))
+ if (lost.length > 0) throw new Error(`The app could not load its own bundles:\n${lost.map(({ packageName, reason }) => `${packageName}: ${reason}`).join('\n')}`)
+ return profile
+}
diff --git a/app/test/profile.test.mjs b/app/test/profile.test.mjs
new file mode 100644
index 00000000..61ecb32f
--- /dev/null
+++ b/app/test/profile.test.mjs
@@ -0,0 +1,86 @@
+import assert from 'node:assert/strict'
+import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from 'node:fs'
+import { tmpdir } from 'node:os'
+import { join } from 'node:path'
+import { after, before, describe, test } from 'node:test'
+import { composeEntries } from '@deepseek-ai/dsh-app-boot'
+import { BUNDLES, claimBundles, loadAppProfile } from '../src/profile.mjs'
+
+// Packages of DSH's own Web front end and its browser runtime; the window is the app's own page.
+const DSH_WEB_FRONT_END = /^@deepseek-ai\/dsh-(client-ui-|web-app|web-frontend|client-modules|host-frontend-static|cordis-client-runner|client-hmr)/u
+
+// Every row of an entry list, with the rows inside groups and agent presets.
+function rows(entries) {
+ return entries.flatMap((entry) => [
+ entry,
+ ...rows(Array.isArray(entry.config) ? entry.config : []),
+ ...rows(Array.isArray(entry.config?.plugins) ? entry.config.plugins : []),
+ ])
+}
+
+describe('the app profile', () => {
+ let home
+ let entries
+ before(() => {
+ home = mkdtempSync(join(tmpdir(), 'ds-bot-app-profile-'))
+ process.env.DSH_HOME = home
+ const profile = loadAppProfile()
+ assert.deepEqual(profile.layers.map((layer) => layer.packageName), BUNDLES)
+ assert.deepEqual(profile.skippedBundles, [])
+ entries = composeEntries([...profile.layers.map((layer) => layer.patches), profile.patches])
+ })
+ after(() => { rmSync(home, { recursive: true, force: true }) })
+
+ test('mounts no part of the DSH Web front end', () => {
+ assert.deepEqual(rows(entries).map((entry) => entry.name).filter((name) => DSH_WEB_FRONT_END.test(name)), [])
+ })
+
+ test('mounts the transport, the services ds-bot uses and the Bot team', () => {
+ const on = new Set(entries.filter((entry) => entry.disabled !== true).map((entry) => entry.id))
+ for (const id of ['webserver', 'connection', 'engine-index', 'file-upload', 'workspace', 'session-controller', 'directory-picker', 'agent-preset-registry', 'preset-standard', 'bot']) {
+ assert.ok(on.has(id), `${id} is mounted`)
+ }
+ })
+
+ test('gives Bot Sessions the standard preset without goals', () => {
+ assert.equal(entries.find((entry) => entry.id === 'agent-preset-registry').config.default, 'standard')
+ const preset = entries.find((entry) => entry.id === 'preset-standard')
+ assert.equal(preset.config.id, 'standard')
+ const names = rows(preset.config.plugins).map((row) => row.name)
+ assert.ok(names.includes('@deepseek-ai/dsh-tool-fs'))
+ assert.deepEqual(names.filter((name) => /goal/u.test(name)), [])
+ })
+
+ test('keeps every preset row off the host plane', () => {
+ const top = new Map(entries.map((entry) => [entry.id, entry]))
+ const preset = entries.find((entry) => entry.id === 'preset-standard')
+ const mounted = rows(preset.config.plugins).filter((row) => top.has(row.id) && top.get(row.id).disabled !== true)
+ assert.deepEqual(mounted.map((row) => row.id), [])
+ })
+})
+
+describe('claimBundles', () => {
+ let dir
+ before(() => { dir = mkdtempSync(join(tmpdir(), 'ds-bot-app-bundles-')) })
+ after(() => { rmSync(dir, { recursive: true, force: true }) })
+
+ const write = (bundles) => {
+ mkdirSync(dir, { recursive: true })
+ writeFileSync(join(dir, 'package.json'), `${JSON.stringify({ name: 'dsh-profile-ds-bot', private: true, dependencies: { 'a-plugin': '1.0.0' }, dsh: { profile: { bundles } } }, undefined, 2)}\n`)
+ }
+ const read = () => JSON.parse(readFileSync(join(dir, 'package.json'), 'utf8'))
+
+ test('puts the app bundles first, keeps the user bundles and drops the retired ones', () => {
+ write(['@deepseek-ai/dsh-base', '@deepseek-ai/dsh-web-app', 'ds-bot', 'a-plugin'])
+ claimBundles(dir)
+ assert.deepEqual(read().dsh.profile.bundles, [...BUNDLES, 'a-plugin'])
+ assert.deepEqual(read().dependencies, { 'a-plugin': '1.0.0' })
+ })
+
+ test('leaves a profile that already lists them alone', () => {
+ write([...BUNDLES, 'a-plugin'])
+ const before = readFileSync(join(dir, 'package.json'), 'utf8')
+ claimBundles(dir)
+ assert.equal(readFileSync(join(dir, 'package.json'), 'utf8'), before)
+ })
+})
diff --git a/docs/plans/2026-10-16-desktop-app.md b/docs/plans/2026-10-16-desktop-app.md
index ec60cc02..6a9e1e4b 100644
--- a/docs/plans/2026-10-16-desktop-app.md
+++ b/docs/plans/2026-10-16-desktop-app.md
@@ -24,6 +24,7 @@
- 插件版和桌面应用用同一份 `ds-bot`,插件版不变。
- 安装包和 `ds-bot` 用同一个版本号。
+- 引擎的 profile 由三个 bundle 叠成:DSH 的 `dsh-base`、桌面应用的引擎层 `deepseek-bot-engine`、`ds-bot`,用户装的插件排在后面。引擎层只放引擎用的东西:给 ds-bot 接口用的本机传输、ds-bot 用到的宿主服务、Bot 会话用的 `standard` 预设(不带目标)。DSH 网页前端的部分一个都不加载。每次启动时,引擎把这三个 bundle 排回最前面。
### DSH 版本
@@ -70,8 +71,10 @@
- 窗口里目前只有团队列表和 Bot 的私聊:能选模型、聊天、看回复一边写一边出来、回答提问卡片。群聊、Bot 详情和设置、记忆、Markdown 排版、工具卡片、首次启动和导入、DeepSeek 账号登录、每个 Bot 的浏览器、更新和安装包还没有。模型和密钥目前用环境变量,或数据位置里的 `.env`、`.credentials.yaml` 设置。
- 不签名:Windows 第一次运行会弹出 SmartScreen 警告,macOS 要在系统设置里手动放行。
- 会话里记着工作文件夹的完整路径,不能改。所以导入和搬工作文件夹都要换段。
+- 安装的 `@deepseek-ai/dsh` 包带着 DSH 的网页前端,所以安装包里仍有这些文件,只是不加载。
## 变更
- 2026-10-17:电脑操作和浏览器操作的提供方由用户选,PR #278。
- 2026-10-17:窗口换成自己的界面(团队列表和 Bot 的私聊),PR #279。
+- 2026-10-17:引擎的 profile 换成桌面应用自己的组合,不再加载 DSH 的网页前端。