Self-evolving Context Database for AI Agents. Unify Agent Memory, Knowledge RAG and Skills.
Python agent-contextagent-memoryagent-pluginsagentic-ragcontext-databasedsh-pluginknowledge-basememorymemory-managementself-evolvingvector-database
feat(dsh): support DeepSeek Harness Desktop (#6626)
t0saki1e7b90a41fef
diff --git a/.github/host-compat.json b/.github/host-compat.jsonindex 264d3838b..f1f568584 100644--- a/.github/host-compat.json+++ b/.github/host-compat.json@@ -44,9 +44,17 @@"--dump-config"],"expect": "^- id: openviking-memory-runtime$"+ },+ {+ "run": [+ "node",+ "{root}/.github/scripts/dsh-desktop-smoke.mjs",+ "{tarball}",+ "openviking-memory-runtime"+ ]}],- "notes": "DSH checks @deepseek-ai/dsh-* peers at plugin load with prereleases included. bundle.test.mjs asserts the dev pins stay at the tested minimum, which this check replaces on purpose. The smoke steps install that dsh release, add the packed bundle to a profile, and require the composed profile to include the bundle; DSH refuses to add a bundle whose peers reject the release, so the add step fails first."+ "notes": "DSH checks @deepseek-ai/dsh-* peers at plugin load with prereleases included. bundle.test.mjs asserts the dev pins stay at the tested minimum, which this check replaces on purpose. The smoke steps install that dsh release, add the packed bundle to a profile, and require the composed profile to include the bundle; DSH refuses to add a bundle whose peers reject the release, so the add step fails first. The last step emulates the DeepSeek Harness Desktop launcher with that release (Desktop itself is an Electron app with no npm package or Linux build): it initializes the reserved desktop profile the way Desktop's first launch does, adds the bundle through runCli({ manageDesktopProfile: true }), requires the profile to list and compose it, and checks that npm dsh refuses the desktop profile and that no dsh dumps its config."}]}diff --git a/.github/scripts/dsh-desktop-smoke.mjs b/.github/scripts/dsh-desktop-smoke.mjsnew file mode 100644index 000000000..9a648a023--- /dev/null+++ b/.github/scripts/dsh-desktop-smoke.mjs@@ -0,0 +1,112 @@+#!/usr/bin/env node++// DeepSeek Harness Desktop keeps its plugins in a reserved `desktop` profile+// that only its own `dsh` launcher may manage: npm `dsh` refuses the profile,+// and no `dsh` will boot it or dump its config. Desktop is an Electron app that+// is not on npm and has no Linux build, so this emulates its launcher with the+// npm dsh release under test, the way Desktop wires the same packages:+// apps/desktop/src/project-manager.ts initializes the profile from the web+// template on first launch, and apps/desktop-host/src/cli.ts runs the ordinary+// CLI with runCli({ manageDesktopProfile: true }). Desktop's bundled pnpm is+// the one part left out; the pnpm on PATH stands in for it.+//+// Usage, as a host-compat smoke step from the directory the dsh release is+// installed in, with HOME pointing at a scratch home:+// node .github/scripts/dsh-desktop-smoke.mjs <tarball> <runtime-id>+//+// It adds the packed plugin to the desktop profile, requires the profile to+// list and compose it, and checks the refusals the installer relies on.++import { execFileSync, spawnSync } from "node:child_process";+import { existsSync, readFileSync } from "node:fs";+import { createRequire } from "node:module";+import { dirname, join } from "node:path";+import { fileURLToPath, pathToFileURL } from "node:url";++const SCRIPT = fileURLToPath(import.meta.url);+const LAUNCHER = "--as-desktop-launcher";+const DESKTOP_REFUSAL = /profile "desktop" is managed exclusively by the Electron application/;+const STEP_TIMEOUT_MS = 5 * 60 * 1000;++const requireFromHost = createRequire(join(process.cwd(), "package.json"));+const dshDir = dirname(requireFromHost.resolve("@deepseek-ai/dsh/package.json"));+const requireFromDsh = createRequire(join(dshDir, "package.json"));+const bin = requireFromDsh.resolve("@deepseek-ai/dsh/lib/bin.js");++function fail(message, output = "") {+ console.error(`dsh desktop smoke: ${message}${output ? `\n${output.trimEnd()}` : ""}`);+ process.exit(1);+}++function run(args) {+ const result = spawnSync(process.execPath, args, { encoding: "utf8", timeout: STEP_TIMEOUT_MS });+ const error = result.error ? `\n${result.error.message}` : "";+ return { ok: result.status === 0, output: `${result.stdout ?? ""}${result.stderr ?? ""}${error}` };+}++/** Desktop's launcher: the ordinary CLI with access to the reserved profile. */+function launcher(...args) {+ return run([SCRIPT, LAUNCHER, ...args]);+}++/** npm dsh: the same CLI without that access. */+function npmDsh(...args) {+ return run([bin, ...args]);+}++function expectOk(label, result) {+ if (!result.ok) fail(`${label} failed`, result.output);+ console.log(`ok: ${label}`);+ return result.output;+}++function expectRefused(label, result, pattern) {+ if (result.ok) fail(`${label} succeeded, expected a refusal`, result.output);+ if (!pattern.test(result.output)) fail(`${label} failed without matching /${pattern.source}/`, result.output);+ console.log(`ok: ${label} is refused`);+}++if (process.argv[2] === LAUNCHER) {+ process.argv.splice(2, 1);+ const { runCli } = await import(pathToFileURL(bin).href);+ await runCli({ manageDesktopProfile: true });+} else {+ const [tarball, runtimeId] = process.argv.slice(2);+ if (!tarball || !runtimeId) fail("usage: dsh-desktop-smoke.mjs <tarball> <runtime-id>");+ // The profile resolves under DSH_HOME first; an inherited one would escape the scratch home.+ if (process.env.DSH_HOME) fail("DSH_HOME is set; unset it so the desktop profile lands in the scratch HOME");++ const { PROFILE_TEMPLATES, initProfile, resolveProfileDir } = await import(+ pathToFileURL(requireFromDsh.resolve("@deepseek-ai/dsh-app-boot")).href+ );+ const { name } = JSON.parse(execFileSync("tar", ["-xzOf", tarball, "package/package.json"], { encoding: "utf8" }));+ const profileDir = resolveProfileDir("desktop");++ expectRefused("npm dsh plugin --profile desktop", npmDsh("plugin", "--profile", "desktop", "ls"), DESKTOP_REFUSAL);+ expectRefused(+ "launcher plugin --profile desktop before Desktop's first launch",+ launcher("plugin", "--profile", "desktop", "ls"),+ /Open DeepSeek Harness Desktop once to initialize its profile/,+ );++ // Desktop's first launch: createPluginProfile() in apps/desktop/src/project-manager.ts.+ initProfile(profileDir, PROFILE_TEMPLATES.web.bundles);++ expectOk(`launcher plugin --profile desktop add ${tarball}`, launcher("plugin", "--profile", "desktop", "add", tarball));+ const listed = expectOk("launcher plugin --profile desktop ls", launcher("plugin", "--profile", "desktop", "ls"));+ if (!listed.includes(name)) fail(`plugin ls does not list ${name}`, listed);++ const manifest = JSON.parse(readFileSync(join(profileDir, "package.json"), "utf8"));+ const bundles = manifest.dsh?.profile?.bundles ?? [];+ if (!bundles.includes(name)) fail(`dsh.profile.bundles does not include ${name}: ${JSON.stringify(bundles)}`);+ console.log(`ok: dsh.profile.bundles is ${JSON.stringify(bundles)}`);++ const patchPath = join(profileDir, "node_modules", ...name.split("/"), "cordis.patch.yml");+ if (!existsSync(patchPath)) fail(`${patchPath} is missing`);+ if (!new RegExp(`^\\s*- id: ${runtimeId}$`, "m").test(readFileSync(patchPath, "utf8"))) {+ fail(`${patchPath} has no entry with id ${runtimeId}`);+ }+ console.log(`ok: the installed patch inserts ${runtimeId}`);++ expectRefused("launcher --profile desktop --dump-config", launcher("--profile", "desktop", "--dump-config"), DESKTOP_REFUSAL);+}diff --git a/.github/scripts/host-compat.mjs b/.github/scripts/host-compat.mjsindex c3d2f6544..86742b988 100644--- a/.github/scripts/host-compat.mjs+++ b/.github/scripts/host-compat.mjs@@ -12,9 +12,10 @@// pins is moved to the release under test, and its tests run there. The tests// exercise the plugin's code on the new host packages but never start the host,// so a host may also list smoke steps: commands that install the real host-// release, add the packed plugin to it, and check the host picked it up. Run-// `node examples/memory-plugin-shared/sync.mjs` first: the copy takes the-// generated shared/ modules with it.+// release, add the packed plugin to it, and check the host picked it up; a step+// may run a script from this repository, such as one that emulates a host+// launcher npm does not ship. Run `node examples/memory-plugin-shared/sync.mjs`+// first: the copy takes the generated shared/ modules with it.import { execFileSync, spawnSync } from "node:child_process";import { appendFileSync, cpSync, globSync, mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";@@ -113,7 +114,8 @@ function checkRelease(host, release) {/*** Install the real host release in an isolated home and run the host's smoke* steps against the plugin packed the way npm would publish it. Steps substitute- * {version} and {tarball}; a step with `expect` must print a line matching it.+ * {version}, {tarball} and {root} (this repository); a step with `expect` must+ * print a line matching it.*/function smoke(host, release, work) {const dir = mkdtempSync(join(tmpdir(), `host-compat-${host.id}-smoke-`));@@ -128,7 +130,8 @@ function smoke(host, release, work) {// The host's own state (profiles, stores, credentials) lands in the scratch home.const env = { ...process.env, HOME: home, USERPROFILE: home, XDG_CONFIG_HOME: join(home, ".config") };- const fill = (arg) => arg.replaceAll("{version}", release.version).replaceAll("{tarball}", tarball);+ const fill = (arg) => arg+ .replaceAll("{version}", release.version).replaceAll("{tarball}", tarball).replaceAll("{root}", ROOT);for (const step of host.smoke) {const [command, ...args] = step.run.map(fill);const label = `smoke: ${step.run.join(" ")}`;diff --git a/docs/en/agent-integrations/01-overview.md b/docs/en/agent-integrations/01-overview.mdindex 4197ab69e..409578df7 100644--- a/docs/en/agent-integrations/01-overview.md+++ b/docs/en/agent-integrations/01-overview.md@@ -11,7 +11,7 @@ OpenViking can act as the long-term memory and context backend for many agent ru| **Codex / TraeCode CLI 2.0** | [Codex Memory Plugin](./04-codex.md) — lifecycle hooks for auto-recall and incremental capture || **Cursor** | [Cursor Memory Integration](./12-cursor.md) — one command installs lifecycle hooks, MCP tools, rules, and skills || **TRAE / TRAE CN** | [TRAE Memory Integration](./13-trae.md) — one installer configures prompt-time recall, turn capture, and OpenViking tools |-| **DeepSeek Harness (`dsh`)** | [DeepSeek Harness Memory Bundle](./17-dsh.md) — in-process Cordis plugin with pre-step recall, event capture, and the OpenViking MCP tools |+| **DeepSeek Harness (`dsh`) / DeepSeek Harness Desktop** | [DeepSeek Harness Memory Bundle](./17-dsh.md) — in-process Cordis plugin with pre-step recall, event capture, and the OpenViking MCP tools || **Hermes Agent** | [Hermes Agent](./05-hermes.md). Memory plugin with automatic capture and recall. Older releases include a built-in provider. || **OpenCode** | [OpenCode Plugin](./10-opencode.md) — MCP tools plus lifecycle hooks for repo context, auto-recall, and capture || **pi** | [pi Coding Agent Extension](./11-pi.md) — native extension with auto-recall, turn capture, threshold commit, and the server's MCP tools registered as native pi tools |diff --git a/docs/en/agent-integrations/16-capability-reference.md b/docs/en/agent-integrations/16-capability-reference.mdindex a39a07a08..1d4cbf2d5 100644--- a/docs/en/agent-integrations/16-capability-reference.md+++ b/docs/en/agent-integrations/16-capability-reference.md@@ -485,7 +485,7 @@ The session ID prefix tells you which integration wrote a session on the server.| Kimi Code | Unified installer; managed Kimi Code plugin | `kc-<id>` | Shared settings, `plugin.kimicode` || CodeBuddy Code | Unified installer, which registers a local marketplace | `cb-<id>` | Shared settings, `plugin.codebuddy` || OpenCode | Unified installer, npm (`@openviking/opencode-plugin`), or source | `oc-<id>`; subagents `oc-<parent>__subagent-<child>` | Shared settings, `plugin.opencode` |-| DSH | Unified installer or `dsh plugin add @openviking/dsh-memory-plugin` | `dsh-<id>` | Shared settings, `plugin.dsh`, then the Cordis patch |+| DSH | Unified installer, `dsh plugin add @openviking/dsh-memory-plugin`, or Desktop's Plugins page | `dsh-<id>` | Shared settings, `plugin.dsh`, then the Cordis patch || pi | Unified installer, into pi's extension directory | `pi-<id>` | Shared settings, `plugin.pi` || OpenClaw | ClawHub, npm installer, or offline bundle; then `openclaw openviking setup` | The session UUID, or a SHA-256 of the session key | `openclaw.json` and a few environment variables || Hermes (bundled) | Ships with Hermes; `hermes memory setup openviking` | Hermes's own session ID | `.env`, a linked `ovcli.conf`, and Hermes `config.yaml` |@@ -658,9 +658,9 @@ Each note covers what is specific to one integration. Shared behavior is in the- It listens to `agent/session-start`, `agent/pre-step`, `session/event`, `session/flush`, `tools/pre-execute`, and `tools/post-execute`.- `ctx.provide("openvikingMemory")` lets other Cordis plugins build on it.-- The installer uses the `web` profile unless `--dsh-profile` names another. Every mode except `dev` installs the published npm package.+- The installer uses the `web` profile unless `--dsh-profile` names another. On macOS it installs into DeepSeek Harness Desktop's `desktop` profile as a separate harness, `dsh-desktop`, through Desktop's own `dsh` command ([DeepSeek Harness Desktop](./17-dsh.md#deepseek-harness-desktop)). Every mode except `dev` installs the published npm package.- Tool results are captured by default (`captureToolResults: true`), so `ov-experience-memory` runs its full loop; turning capture off leaves it able only to find and apply Experience.-- The URI guard lowercases tool names, denies file tools on `viking://` paths in `tools/pre-execute`, and adds a notice to `bash` commands in `tools/post-execute`.+- The URI guard lowercases tool names, denies file tools on `viking://` paths in `tools/pre-execute`, and adds a notice to `bash` commands, and to `pwsh` commands on Windows, in `tools/post-execute`.- Credentials named in the Cordis patch override every other source. For behavior settings the patch is the lowest layer.<a id="pi-pi-coding-agent-extension"></a>diff --git a/docs/en/agent-integrations/17-dsh.md b/docs/en/agent-integrations/17-dsh.mdindex e6217cc32..d735981da 100644--- a/docs/en/agent-integrations/17-dsh.md+++ b/docs/en/agent-integrations/17-dsh.md@@ -1,6 +1,6 @@# DeepSeek Harness-Give [DeepSeek Harness](https://www.npmjs.com/package/@deepseek-ai/dsh) (`dsh`) cross-project and cross-session long-term memory. Once installed, every conversation automatically recalls relevant memories and captures new content, and the model gets the OpenViking tools and the `openviking-memory`, `openviking-skills`, and `ov-experience-memory` skills without any extra setup.+Give [DeepSeek Harness](https://www.npmjs.com/package/@deepseek-ai/dsh) (`dsh`), and the DeepSeek Harness Desktop app, cross-project and cross-session long-term memory. Once installed, every conversation automatically recalls relevant memories and captures new content, and the model gets the OpenViking tools and the `openviking-memory`, `openviking-skills`, and `ov-experience-memory` skills without any extra setup.Source: [examples/dsh-memory-plugin](https://github.com/volcengine/OpenViking/tree/main/examples/dsh-memory-plugin)@@ -13,7 +13,7 @@ curl -fsSL https://openviking.ai/install | bash# AI agents: not sure about running this? The script's header says what it does and how to verify it.```-The installer puts the plugin into the `web` profile. To use another profile, pass `--dsh-profile <name>`: `curl -fsSL https://openviking.ai/install | bash -s -- --dsh-profile <name>`.+The installer puts the plugin into the `web` profile. To use another profile, pass `--dsh-profile <name>`: `curl -fsSL https://openviking.ai/install | bash -s -- --dsh-profile <name>`. Using the Desktop app? See [DeepSeek Harness Desktop](#deepseek-harness-desktop).After installation, use the verification steps below to check tool access and cross-session recall.@@ -28,7 +28,7 @@ After installation, use the verification steps below to check tool access and crdsh plugin --profile web add @openviking/dsh-memory-plugin```- `dsh plugin` forwards to pnpm inside the profile directory, so any profile name works; `web` is the one `dsh` creates for you on first use.+ `dsh plugin` forwards to pnpm inside the profile directory, so any profile name works except `desktop`, which belongs to the [Desktop app](#deepseek-harness-desktop); `web` is the one `dsh` creates for you on first use.3. **Check that the profile picked it up**:@@ -50,6 +50,60 @@ Start `dsh --profile web` and open a conversation. You should see an OpenVikingFor MCP proxy diagnostics, set `OPENVIKING_DEBUG=1` and `OPENVIKING_DEBUG_LOG=/tmp/ov-dsh.log` before starting DSH, then check that file. Automatic memory callbacks use DSH's own logger. The legacy `OV_DEBUG_LOG=/tmp/ov-dsh.log` alias is still supported and takes precedence over both canonical settings.+## DeepSeek Harness Desktop {#deepseek-harness-desktop}++The bundle also runs inside the DeepSeek Harness Desktop app on macOS and Windows; Desktop is not released for Linux. Desktop keeps its plugins in its own `desktop` profile at `~/.dsh/profiles/desktop`, separate from the CLI's `web` profile, so a bundle installed for `dsh web` does not show up in Desktop or the other way round. Both read the same `~/.openviking/ovcli.conf`.++### Install with the installer (macOS) {#desktop-installer}++On macOS the installer detects Desktop and offers it as a harness of its own, **DeepSeek Harness Desktop** (`dsh-desktop`), selected by default and installable alongside the `dsh` CLI. Desktop's profile should only be changed while the app is not running:++1. Open Desktop once so it creates its profile, then quit it with ⌘Q. Closing the window only hides it; the app keeps running.+2. Run the installer. `bash -s -- --harness dsh-desktop` in place of `bash` installs Desktop alone; `--dsh-profile desktop` (or `OPENVIKING_DSH_PROFILE=desktop`) selects the same harness.+3. Reopen Desktop and start a new conversation.++If Desktop is running, the installer asks you to quit it (with `--yes` it warns and continues). If it cannot find Desktop's `dsh` command, the profile does not exist yet, or Desktop is still running after the prompt, it prints the Plugins page steps instead of failing. The installer itself needs Node.js 18 or later, which Desktop does not provide; on a Mac without Node.js it prints the same steps and stops.++The installer uses Desktop's own `dsh` command, not the one from npm, which refuses the `desktop` profile. It looks for, in order: `OPENVIKING_DSH_DESKTOP_CLI`; `/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh`; the same path under `~/Applications`; and a `dsh` on PATH that resolves inside `DeepSeek Harness.app`, which is what the app menu's **Manage dsh Command…** installs.++### Manual setup {#desktop-plugins-page}++Use this on Windows, where the installer does not run, or on macOS if you would rather not run the installer. The Plugins page and Desktop's `dsh` command only add the bundle; neither asks for your OpenViking credentials, so set those up first.++1. **Configure the connection.** Write `~/.openviking/ovcli.conf` (`%USERPROFILE%\.openviking\ovcli.conf` on Windows):++ ```json+ { "url": "https://<your-openviking-server>", "api_key": "<your-api-key>" }+ ```++ Add `account` and `user` for a trusted-mode server, or skip this step for a local server at `http://127.0.0.1:1933` without authentication. See [Deployment Guide → CLI](../guides/03-deployment.md#cli).++2. **Add the bundle**, either way:+ - **Plugins page** (macOS and Windows): in Desktop, open **Plugins** → **Add plugin**, enter `@openviking/dsh-memory-plugin`, and click **Install**. The **Install source** menu picks the npm registry; a mirror may take a while to pick up a new release. If the plugin's switch is off afterwards, turn it on.+ - **Desktop's `dsh` command** (macOS): quit Desktop with ⌘Q, then run:++ ```bash+ DSH="/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh"+ "$DSH" plugin --profile desktop add @openviking/dsh-memory-plugin+ ```++ On Windows the same command is `resources\runtime\cli\bin\dsh.cmd` in Desktop's install directory.++3. Open a new conversation. After the `dsh` command, reopen Desktop first.++### Verify in Desktop {#verify-in-desktop}++No `dsh` can start the `desktop` profile, so `--dump-config` does not work for it. Check the install with `"$DSH" plugin --profile desktop ls`, or look for `@openviking/dsh-memory-plugin` under `dsh.profile.bundles` in `~/.dsh/profiles/desktop/package.json`. Then open a new conversation in Desktop and check for the context injection and the `mcp__openviking__*` tools, as in [Verify](#verify).++### Configure Desktop {#configure-desktop}++- Prefer `~/.openviking/ovcli.conf` for the connection and for behavior knobs (under `plugin.dsh`). The patch block from **Configuration** below goes in `~/.dsh/profiles/desktop/cordis.patch.yml`, but when Desktop fails to start, its recovery dialog (**Disable third-party plugins, back up profile patch, and restart**) moves that file aside to `cordis.patch.yml.bak-<timestamp>`.+- Desktop does not see variables exported in a terminal. On macOS it reads your login shell's environment (`~/.zprofile`, `~/.zshrc`) once when the app starts, so quit and reopen it after changing an `OPENVIKING_*` variable; `DSH_*` variables are not taken from the shell. On Windows it reads your user environment variables: set them with `setx`, then quit and reopen Desktop.+- Desktop does not show DSH's log output, which is where automatic memory callbacks log. To debug the MCP proxy, set `OPENVIKING_DEBUG=1` and `OPENVIKING_DEBUG_LOG=<file>` as the previous item describes, then read that file.+- Desktop starts the MCP proxy from its profile directory, so the proxy has no workspace peer; automatic recall and capture still use each conversation's workspace. With `OPENVIKING_RECALL_PEER_SCOPE=actor`, set `actor_peer_id` in `ovcli.conf` or `OPENVIKING_PEER_ID` to scope the `mcp__openviking__*` tools, which otherwise search every peer. An explicit peer also replaces each conversation's workspace peer for automatic recall and capture, so every Desktop conversation shares it.++To remove the bundle, use **Uninstall** on its Plugins page entry, or quit Desktop and run `"$DSH" plugin --profile desktop rm @openviking/dsh-memory-plugin`.+## How it worksThe bundle runs inside DSH as a Cordis plugin rather than as external hooks, so it follows the session in-process. At session start it injects your OpenViking profile block, an index of available memories, and an `<available-skills>` catalog of your OpenViking skills. When a model step takes new user input, it searches OpenViking with the text the user typed and appends what it finds to that step as a durable message, so the injection replays with the session and is visible to compaction. Context that DSH or other plugins inject (for example `time-context` or job notices) and tool results neither trigger recall nor enter the query. It captures user, assistant, and (optionally) tool-result messages straight from DSH's event stream, skipping injected context, and commits to OpenViking once pending tokens cross the threshold or when DSH begins a compaction, archiving every captured message. Writes that fail land in a pending queue and replay at the next session start.@@ -102,15 +156,20 @@ Credentials given in the patch win over the environment. Behavior knobs resolve| Issue | What to check ||-------|---------------|-| Nothing injected, no OpenViking tools | `dsh --profile web --dump-config` should list `openviking-memory-runtime`; re-run the installer or `dsh plugin --profile web add …` |+| Nothing injected, no OpenViking tools | `dsh --profile web --dump-config` should list `openviking-memory-runtime`; re-run the installer or `dsh plugin --profile web add …`. For Desktop, see [Verify in Desktop](#verify-in-desktop) || Installed into the wrong profile | The installer defaults to `web`; re-run it with `--dsh-profile <name>` || DSH reports the bundle is incompatible with this dsh version | The bundle accepts every `@deepseek-ai/dsh` 0.x release from `0.1.0-rc.6` on (peer range `>=0.1.0-rc.6 <1.0.0-0`), so this means DSH 1.0 or later; update the bundle, or accept the risk with `dsh plugin allow-version`. Keep all `@deepseek-ai/dsh-*` host packages on the same version. |-| Bundle fails to start on a new DSH release | Releases verified so far: `0.1.0-rc.6`, `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.7-rc.2`, `0.2.0-rc.2`, `0.2.1-alpha.1`. Newer 0.x releases are admitted without prior verification; pin DSH to a verified release and open an issue. |+| Bundle fails to start on a new DSH release | Releases verified so far: `0.1.0-rc.6`, `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.7-rc.2`, `0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-rc.2`, `0.2.1-rc.3`. Newer 0.x releases are admitted without prior verification; pin DSH to a verified release and open an issue. || Install says the package is "not in the npm registry" | The profile may have a pnpm minimum release age of 24 hours; check its configuration (`minimumReleaseAge`). Wait it out, or add the exact version to `minimumReleaseAgeExclude` in the profile's `pnpm-workspace.yaml` || Recall is empty | `curl "<your OpenViking URL>/health"`; check the endpoint and that the prompt is longer than the minimum query length (3 characters) || 401 / 403 from OpenViking | Verify `OPENVIKING_API_KEY`; for trusted-mode deployments also verify `OPENVIKING_ACCOUNT` and `OPENVIKING_USER` || Memories from other projects leak in | Set `OPENVIKING_RECALL_PEER_SCOPE=actor` to limit peer memories to the active peer; user-level memories remain shared || Nothing committed after a crash | Commit runs on a token threshold, at compaction start, and at teardown; queued writes replay at the next session start |+| `profile "desktop" is managed exclusively by the Electron application` | The `desktop` profile cannot be started or dumped, and only Desktop's own `dsh` can change its plugins. Use [Desktop's `dsh` command](#desktop-plugins-page) and [verify without `--dump-config`](#verify-in-desktop) |+| `Open DeepSeek Harness Desktop once to initialize its profile…` | Desktop has not created its profile yet. Open it once, quit it with ⌘Q, then re-run the installer |+| Installed for Desktop but nothing appears | Quit Desktop with ⌘Q (closing the window only hides it) and reopen it; in **Plugins**, check that the bundle is enabled |+| Gone from Desktop after its recovery dialog | Recovery disables third-party plugins and backs up `cordis.patch.yml`; enable the bundle again in **Plugins**, and move settings you need from the `.bak-<timestamp>` file into `ovcli.conf` |+| Skills missing in **Minimal mode** | The Web and Desktop **Minimal mode** agent preset has no skill tool, so the bundled skills are unavailable there; automatic recall and capture still work |## See alsodiff --git a/docs/en/gateway/03-connect-clients.md b/docs/en/gateway/03-connect-clients.mdindex 9602a347b..08f6f50cc 100644--- a/docs/en/gateway/03-connect-clients.md+++ b/docs/en/gateway/03-connect-clients.md@@ -238,7 +238,7 @@ Next, [check the connection](#check-the-connection).## DSH {#dsh}-[DeepSeek Harness](https://www.npmjs.com/package/@deepseek-ai/dsh) (`dsh`) builds on pi's model layer and takes the same `api` and base URL values: `https://ov.example.com/gateway/v1`, or `https://ov.example.com/gateway` for Anthropic Messages. Add a provider to the profile configuration. `dsh web` uses the `web` profile, so the file is `~/.dsh/profiles/web/cordis.patch.yml`:+[DeepSeek Harness](https://www.npmjs.com/package/@deepseek-ai/dsh) (`dsh`) builds on pi's model layer and takes the same `api` and base URL values: `https://ov.example.com/gateway/v1`, or `https://ov.example.com/gateway` for Anthropic Messages. Add a provider to the profile configuration. `dsh web` uses the `web` profile, so the file is `~/.dsh/profiles/web/cordis.patch.yml`; the DeepSeek Harness Desktop app uses `~/.dsh/profiles/desktop/cordis.patch.yml`:```yaml- id: llm-pi-ai@@ -257,6 +257,7 @@ If the file already has an `llm-pi-ai` entry, add `openviking` under its `providExport the gateway key as `OPENVIKING_GATEWAY_KEY`, the variable `apiKeyEnv` names, then start `dsh web` and pick `<model>` under the `openviking` provider in the model picker.- You can also add the provider in the Web UI under Settings → Models → Add model provider → Custom model API, which writes the same file.+- Desktop does not see variables exported in a terminal. On macOS, export `OPENVIKING_GATEWAY_KEY` in your shell startup file (`~/.zprofile` or `~/.zshrc`); on Windows, set it with `setx`. Then quit Desktop with ⌘Q or from the tray and reopen it. If Desktop's recovery dialog runs, it moves `cordis.patch.yml` aside to a `.bak-<timestamp>` file, so add the provider again.- A DSH provider speaks one protocol. To use the gateway over several, declare one provider per protocol.- Unless DSH sends one of the session headers, the gateway matches its conversations by their history (see [How conversations are recognized](#how-conversations-are-recognized)).- If the [OpenViking plugin for DSH](../agent-integrations/17-dsh.md) is installed in the same profile, the gateway steps aside for those conversations. Use one or the other.diff --git a/docs/images/agents/en/deepseek-harness.md b/docs/images/agents/en/deepseek-harness.mdindex 8ebf1e673..c50d26b9f 100644--- a/docs/images/agents/en/deepseek-harness.md+++ b/docs/images/agents/en/deepseek-harness.md@@ -10,6 +10,7 @@ curl -fsSL https://openviking.ai/install | bashThe installer asks for the harness and OpenViking credentials:1. Select **DeepSeek Harness**. The plugin goes into the `web` profile; for another profile, run the command with `bash -s -- --dsh-profile <name>` in place of `bash`.+ On macOS with the DeepSeek Harness Desktop app, also select **DeepSeek Harness Desktop** (selected by default when Desktop is found). Open Desktop once and quit it with ⌘Q before running the installer, and reopen it afterwards. On Windows, set it up by hand: put the server URL and API key in `%USERPROFILE%\.openviking\ovcli.conf`, then in Desktop's **Plugins** page click **Add plugin**, enter `@openviking/dsh-memory-plugin` and **Install** (see the full guide's [manual setup](https://docs.openviking.net/en/agent-integrations/17-dsh#desktop-plugins-page)).2. Select **Volcengine OpenViking Cloud** and enter the API key:{{OPENVIKING_API_KEY_BLOCK}}@@ -18,12 +19,15 @@ The installer asks for the harness and OpenViking credentials:1. Run `dsh --profile web` and open a new conversation. Confirm that “context injection · openviking-memory” appears at the top.2. Confirm that the model has `mcp__openviking__*` tools and can call them.+3. For Desktop, open a new conversation in the app and check the same two points. `--dump-config` does not work for Desktop's `desktop` profile; check that `~/.dsh/profiles/desktop/package.json` lists the plugin under `dsh.profile.bundles` instead.## Troubleshooting| Issue | What to check ||---|---|| No context injection or OpenViking tools | Run `dsh --profile web --dump-config` and confirm it contains `openviking-memory`; otherwise rerun the installer or run `dsh plugin --profile web add @openviking/dsh-memory-plugin` |+| Desktop shows nothing after installing | Quit Desktop with ⌘Q (closing the window only hides it) and reopen it; in **Plugins**, check that the plugin is enabled |+| `profile "desktop" is managed exclusively by the Electron application` | Only Desktop's own `dsh` command can change the `desktop` profile, and nothing can start it; see the full guide's [Desktop section](https://docs.openviking.net/en/agent-integrations/17-dsh#deepseek-harness-desktop) || Installed into the wrong profile | The installer uses `web`; rerun it with `bash -s -- --dsh-profile <name>` in place of `bash` || DSH reports the plugin is incompatible with this dsh version | The plugin accepts every DSH 0.x release from `0.1.0-rc.6` on; on DSH 1.0 or later, update the plugin or run `dsh plugin allow-version` || Plugin fails to start after a DSH upgrade | Newer 0.x releases are admitted without prior verification; pin DSH to a verified release such as `0.2.0-rc.2` and open an issue |diff --git a/docs/images/agents/zh/deepseek-harness.md b/docs/images/agents/zh/deepseek-harness.mdindex f628e3e2e..255878a7f 100644--- a/docs/images/agents/zh/deepseek-harness.md+++ b/docs/images/agents/zh/deepseek-harness.md@@ -10,6 +10,7 @@ curl -fsSL https://openviking.ai/install | bash安装器会依次询问 Harness 和 OpenViking 凭据:1. Harness 选择 **DeepSeek Harness**。插件会装到 `web` profile;要装到其他 profile,把命令末尾的 `bash` 换成 `bash -s -- --dsh-profile <name>`。+ 在装有 DeepSeek Harness Desktop 桌面应用的 macOS 上,同时选择 **DeepSeek Harness Desktop**(检测到 Desktop 时默认选中)。运行安装器前先打开一次 Desktop 再用 ⌘Q 退出,装完后重新打开。Windows 上手动安装:先把服务地址和 API Key 写进 `%USERPROFILE%\.openviking\ovcli.conf`,再在 Desktop 的 **插件** 页点击 **添加插件**,输入 `@openviking/dsh-memory-plugin` 并 **安装**(见完整文档的[手动安装](https://docs.openviking.net/zh/agent-integrations/17-dsh#desktop-plugins-page))。2. 连接方式选择 **火山引擎 OpenViking 云服务**,并填入 API Key:{{OPENVIKING_API_KEY_BLOCK}}@@ -18,12 +19,15 @@ curl -fsSL https://openviking.ai/install | bash1. 启动 `dsh --profile web` 并打开新会话,确认会话顶部显示“上下文注入 · openviking-memory”。2. 确认模型具有 `mcp__openviking__*` 工具,并能够在会话中正常调用。+3. Desktop 用户在应用中新开会话,检查以上两点。`--dump-config` 对 Desktop 的 `desktop` profile 不可用,改为确认 `~/.dsh/profiles/desktop/package.json` 的 `dsh.profile.bundles` 中有该插件。## 故障排查| 现象 | 排查方向 ||---|---|| 没有上下文注入,也没有 OpenViking 工具 | 执行 `dsh --profile web --dump-config`,确认输出中包含 `openviking-memory`;若缺失,重新运行安装器或执行 `dsh plugin --profile web add @openviking/dsh-memory-plugin` |+| 安装后 Desktop 中没有任何变化 | 用 ⌘Q 退出 Desktop(关闭窗口只会隐藏)后重新打开;在 **插件** 页确认插件已启用 |+| 提示 `profile "desktop" is managed exclusively by the Electron application` | 只有 Desktop 自带的 `dsh` 命令能修改 `desktop` profile,且任何命令都无法启动它;见完整文档的 [Desktop 一节](https://docs.openviking.net/zh/agent-integrations/17-dsh#deepseek-harness-desktop) || 插件安装到了错误的 profile | 安装器默认使用 `web`;把命令末尾的 `bash` 换成 `bash -s -- --dsh-profile <name>` 重新运行 || DSH 提示插件与当前 dsh 版本不兼容 | 插件接受 `0.1.0-rc.6` 起的所有 DSH 0.x 版本;DSH 已是 1.0 或更高时,升级插件或运行 `dsh plugin allow-version` || 升级 DSH 后插件启动失败 | 更新的 0.x 版本不经预先验证就会被接受;请把 DSH 固定到已验证的版本(如 `0.2.0-rc.2`),并提 issue |diff --git a/docs/zh/agent-integrations/01-overview.md b/docs/zh/agent-integrations/01-overview.mdindex 241adc4e7..eb1f82e89 100644--- a/docs/zh/agent-integrations/01-overview.md+++ b/docs/zh/agent-integrations/01-overview.md@@ -11,7 +11,7 @@ OpenViking 可以作为多种 Agent 运行时的长期记忆与上下文后端| **Codex / TraeCode CLI 2.0** | [Codex 记忆插件](./04-codex.md) — 生命周期 hooks 自动召回与增量捕获 || **Cursor** | [Cursor 记忆集成](./12-cursor.md) — 一条命令安装生命周期 Hook、MCP 工具、Rules 与 Skills || **TRAE / TRAE CN** | [TRAE 记忆集成](./13-trae.md) — 一个安装器完成 prompt 召回、回合捕获与 OpenViking 工具接入 |-| **DeepSeek Harness(`dsh`)** | [DeepSeek Harness 记忆插件](./17-dsh.md) — 进程内 Cordis 插件,pre-step 召回、事件捕获与 OpenViking MCP 工具 |+| **DeepSeek Harness(`dsh`)/ DeepSeek Harness Desktop** | [DeepSeek Harness 记忆插件](./17-dsh.md) — 进程内 Cordis 插件,pre-step 召回、事件捕获与 OpenViking MCP 工具 || **Hermes Agent** | [Hermes Agent](./05-hermes.md)。自动捕获和召回记忆,旧版本使用内置提供方。 || **OpenCode** | [OpenCode 插件](./10-opencode.md) — MCP 工具 + 生命周期 hooks,覆盖仓库上下文、自动召回与捕获 || **pi** | [pi Coding Agent 扩展](./11-pi.md) — 原生扩展,自动召回、逐轮捕获、阈值 commit,并把服务端的 MCP 工具注册为 pi 原生工具 |diff --git a/docs/zh/agent-integrations/16-capability-reference.md b/docs/zh/agent-integrations/16-capability-reference.mdindex 750524679..22e310d4d 100644--- a/docs/zh/agent-integrations/16-capability-reference.md+++ b/docs/zh/agent-integrations/16-capability-reference.md@@ -484,7 +484,7 @@ Claude Code 和 Codex 默认 `auto`,其他集成默认 `off`。支持服务端| Kimi Code | 统一安装器;Kimi Code 托管插件 | `kc-<id>` | 共享配置,`plugin.kimicode` || CodeBuddy Code | 统一安装器,由其注册本地 marketplace | `cb-<id>` | 共享配置,`plugin.codebuddy` || OpenCode | 统一安装器、npm(`@openviking/opencode-plugin`)或源码 | `oc-<id>`;子代理 `oc-<parent>__subagent-<child>` | 共享配置,`plugin.opencode` |-| DSH | 统一安装器或 `dsh plugin add @openviking/dsh-memory-plugin` | `dsh-<id>` | 共享配置,`plugin.dsh`,然后是 Cordis patch |+| DSH | 统一安装器、`dsh plugin add @openviking/dsh-memory-plugin` 或 Desktop 的插件页 | `dsh-<id>` | 共享配置,`plugin.dsh`,然后是 Cordis patch || pi | 统一安装器,装入 pi 的扩展目录 | `pi-<id>` | 共享配置,`plugin.pi` || OpenClaw | ClawHub、npm 安装器或离线包;之后运行 `openclaw openviking setup` | 会话 UUID,或会话 key 的 SHA-256 | `openclaw.json` 和少量环境变量 || Hermes(内置) | 随 Hermes 发布;运行 `hermes memory setup openviking` | Hermes 自己的会话 ID | `.env`、关联的 `ovcli.conf` 和 Hermes `config.yaml` |@@ -657,9 +657,9 @@ Claude Code、Cursor、TRAE、ZCode、Kimi Code、DSH 和 pi 还会安装 **URI- 监听 `agent/session-start`、`agent/pre-step`、`session/event`、`session/flush`、`tools/pre-execute` 和 `tools/post-execute`。- `ctx.provide("openvikingMemory")` 让其他 Cordis 插件可以在它之上构建功能。-- 安装器默认使用 `web` profile,可以用 `--dsh-profile` 指定其他 profile。除 `dev` 外的所有模式都安装已发布的 npm 包。+- 安装器默认使用 `web` profile,可以用 `--dsh-profile` 指定其他 profile。在 macOS 上,它还会把 DeepSeek Harness Desktop 的 `desktop` profile 作为单独的 harness `dsh-desktop`,通过 Desktop 自带的 `dsh` 命令安装(见 [DeepSeek Harness Desktop](./17-dsh.md#deepseek-harness-desktop))。除 `dev` 外的所有模式都安装已发布的 npm 包。- 默认捕获工具结果(`captureToolResults: true`),所以 `ov-experience-memory` 能完整运行;关闭捕获后,只能检索和应用 Experience。-- URI guard 先把工具名转成小写,在 `tools/pre-execute` 拒绝对 `viking://` 路径的文件工具调用,在 `tools/post-execute` 为包含这种路径的 `bash` 命令附加提示。+- URI guard 先把工具名转成小写,在 `tools/pre-execute` 拒绝对 `viking://` 路径的文件工具调用,在 `tools/post-execute` 为包含这种路径的 `bash` 命令(Windows 上是 `pwsh` 命令)附加提示。- Cordis patch 中写明的凭据优先于其他所有来源;对行为配置来说,patch 是优先级最低的一层。<a id="pi-pi-coding-agent-extension"></a>diff --git a/docs/zh/agent-integrations/17-dsh.md b/docs/zh/agent-integrations/17-dsh.mdindex 04e0e093c..b1674443b 100644--- a/docs/zh/agent-integrations/17-dsh.md+++ b/docs/zh/agent-integrations/17-dsh.md@@ -1,6 +1,6 @@# DeepSeek Harness-为 [DeepSeek Harness](https://www.npmjs.com/package/@deepseek-ai/dsh)(`dsh`)接入跨项目、跨会话的长期记忆。安装后每次对话都会自动召回相关记忆并捕获新内容,模型也会直接拿到 OpenViking 工具以及 `openviking-memory`、`openviking-skills`、`ov-experience-memory` 三个技能,无需额外配置。+为 [DeepSeek Harness](https://www.npmjs.com/package/@deepseek-ai/dsh)(`dsh`)及 DeepSeek Harness Desktop 桌面应用接入跨项目、跨会话的长期记忆。安装后每次对话都会自动召回相关记忆并捕获新内容,模型也会直接拿到 OpenViking 工具以及 `openviking-memory`、`openviking-skills`、`ov-experience-memory` 三个技能,无需额外配置。源码:[examples/dsh-memory-plugin](https://github.com/volcengine/OpenViking/tree/main/examples/dsh-memory-plugin)@@ -13,7 +13,7 @@ curl -fsSL https://openviking.ai/install | bash# AI agent 如不确定是否执行,可先阅读脚本头部,其中写明了它会做什么、如何核实。```-安装器会把插件装到 `web` profile。要装到其他 profile,用 `--dsh-profile <name>` 指定:`curl -fsSL https://openviking.ai/install | bash -s -- --dsh-profile <name>`。+安装器会把插件装到 `web` profile。要装到其他 profile,用 `--dsh-profile <name>` 指定:`curl -fsSL https://openviking.ai/install | bash -s -- --dsh-profile <name>`。使用桌面应用?见 [DeepSeek Harness Desktop](#deepseek-harness-desktop)。安装后按下方“验证”步骤检查工具接入和跨会话召回。@@ -28,7 +28,7 @@ curl -fsSL https://openviking.ai/install | bashdsh plugin --profile web add @openviking/dsh-memory-plugin```- `dsh plugin` 会转发给 profile 目录下的 pnpm,所以任何 profile 名都可以;`web` 是 `dsh` 首次运行时自动创建的那个。+ `dsh plugin` 会转发给 profile 目录下的 pnpm,所以除 `desktop` 外任何 profile 名都可以(`desktop` 归[桌面应用](#deepseek-harness-desktop)所有);`web` 是 `dsh` 首次运行时自动创建的那个。3. **确认 profile 已生效**:@@ -50,6 +50,60 @@ curl -fsSL https://openviking.ai/install | bash排查 MCP 代理问题时,在启动 DSH 前设置 `OPENVIKING_DEBUG=1` 和 `OPENVIKING_DEBUG_LOG=/tmp/ov-dsh.log`,然后查看该文件。自动记忆回调使用 DSH 自身的日志系统。旧别名 `OV_DEBUG_LOG=/tmp/ov-dsh.log` 仍然支持,并且优先于这两个规范配置项。+## DeepSeek Harness Desktop {#deepseek-harness-desktop}++插件同样可以在 DeepSeek Harness Desktop 桌面应用中运行,支持 macOS 和 Windows;Desktop 没有 Linux 版本。Desktop 的插件装在它专属的 `desktop` profile(`~/.dsh/profiles/desktop`)里,与 CLI 的 `web` profile 互不相通:给 `dsh web` 装的插件不会出现在 Desktop 里,反之亦然。两者读取同一份 `~/.openviking/ovcli.conf`。++### 用安装器安装(macOS) {#desktop-installer}++在 macOS 上,安装器会检测到 Desktop,并把它作为单独的 harness **DeepSeek Harness Desktop**(`dsh-desktop`)列出,默认选中,可以和 `dsh` CLI 一起安装。修改 Desktop 的 profile 时,应用不应处于运行状态:++1. 先打开一次 Desktop,让它创建 profile,然后用 ⌘Q 退出。关闭窗口只会隐藏它,应用仍在运行。+2. 运行安装器。把命令末尾的 `bash` 换成 `bash -s -- --harness dsh-desktop` 只安装 Desktop;`--dsh-profile desktop`(或 `OPENVIKING_DSH_PROFILE=desktop`)选中的也是这个 harness。+3. 重新打开 Desktop,新开一个会话。++如果 Desktop 正在运行,安装器会提示你先退出(加 `--yes` 时只警告并继续)。如果找不到 Desktop 自带的 `dsh` 命令、profile 还没创建,或者提示后 Desktop 仍在运行,安装器不会报错退出,而是打印插件页的安装步骤。安装器本身需要 Node.js 18 或更高版本,Desktop 并不提供;在没有 Node.js 的 Mac 上,它会打印同样的步骤后退出。++安装器用的是 Desktop 自带的 `dsh` 命令,而不是 npm 装的那个——后者会拒绝 `desktop` profile。它按以下顺序查找:`OPENVIKING_DSH_DESKTOP_CLI`;`/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh`;`~/Applications` 下的同一路径;PATH 上实际指向 `DeepSeek Harness.app` 内部的 `dsh`(即应用菜单 **Manage dsh Command…** 安装的那个)。++### 手动安装 {#desktop-plugins-page}++Windows 上安装器不可用,只能用这种方式;macOS 上不想跑安装器时也可以用。插件页和 Desktop 自带的 `dsh` 命令只负责添加插件,都不会询问 OpenViking 凭据,所以要先配好鉴权。++1. **配置连接。** 写好 `~/.openviking/ovcli.conf`(Windows 上是 `%USERPROFILE%\.openviking\ovcli.conf`):++ ```json+ { "url": "https://<你的 OpenViking 服务地址>", "api_key": "<你的 API Key>" }+ ```++ trusted 模式的服务端还要填 `account` 和 `user`;如果用的是 `http://127.0.0.1:1933` 上无鉴权的本地服务端,这步可以跳过。参见[部署指南 → CLI](../guides/03-deployment.md#cli)。++2. **添加插件**,两种方式任选:+ - **插件页**(macOS 和 Windows):在 Desktop 中打开 **插件** → **添加插件**,输入 `@openviking/dsh-memory-plugin`,点击 **安装**。**安装源** 菜单决定从哪个 npm 源下载;镜像源同步新版本可能有延迟。装好后如果插件开关是关闭的,把它打开。+ - **Desktop 自带的 `dsh` 命令**(macOS):先用 ⌘Q 退出 Desktop,再运行:++ ```bash+ DSH="/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh"+ "$DSH" plugin --profile desktop add @openviking/dsh-memory-plugin+ ```++ Windows 上对应的命令是 Desktop 安装目录下的 `resources\runtime\cli\bin\dsh.cmd`。++3. 新开一个会话。用 `dsh` 命令安装的,要先重新打开 Desktop。++### 在 Desktop 中验证 {#verify-in-desktop}++任何 `dsh` 都无法启动 `desktop` profile,所以 `--dump-config` 对它不可用。可以用 `"$DSH" plugin --profile desktop ls` 检查,或者确认 `~/.dsh/profiles/desktop/package.json` 的 `dsh.profile.bundles` 中有 `@openviking/dsh-memory-plugin`。然后在 Desktop 中新开一个会话,按[验证](#验证)一节检查上下文注入和 `mcp__openviking__*` 工具。++### 配置 Desktop {#configure-desktop}++- 连接和行为参数(写在 `plugin.dsh` 下)优先放在 `~/.openviking/ovcli.conf`。下文 **配置** 中的 patch 块要写进 `~/.dsh/profiles/desktop/cordis.patch.yml`,但 Desktop 启动失败时,恢复对话框(**禁用第三方插件、备份 profile patch 并重启**)会把这个文件挪成 `cordis.patch.yml.bak-<时间戳>`。+- Desktop 看不到在终端里 export 的变量。macOS 上,它在应用启动时读取一次登录 shell 的环境(`~/.zprofile`、`~/.zshrc`),所以改了 `OPENVIKING_*` 变量后要退出并重新打开 Desktop;`DSH_*` 变量不会从 shell 读取。Windows 上,它读取用户环境变量:用 `setx` 设置后退出并重新打开 Desktop。+- Desktop 不显示 DSH 的日志输出,而自动记忆回调的日志正写在那里。排查 MCP 代理时,按上一条的方式设置 `OPENVIKING_DEBUG=1` 和 `OPENVIKING_DEBUG_LOG=<文件路径>`,再查看该文件。+- Desktop 从 profile 目录启动 MCP 代理,因此代理拿不到工作区 peer;自动召回和捕获仍按每个会话的工作区计算。设置了 `OPENVIKING_RECALL_PEER_SCOPE=actor` 时,在 `ovcli.conf` 中设置 `actor_peer_id` 或设置 `OPENVIKING_PEER_ID`,才能限定 `mcp__openviking__*` 工具的范围,否则它们会检索所有 peer。显式 peer 也会取代每个会话的工作区 peer,用于自动召回和捕获,因此 Desktop 的所有会话共用这一个 peer。++卸载:在插件页中该插件的条目上点击 **卸载**;或者退出 Desktop 后运行 `"$DSH" plugin --profile desktop rm @openviking/dsh-memory-plugin`。+## 工作方式插件以 Cordis 插件的形式跑在 DSH 进程内,而不是外挂 hook,因此能贴着会话走。会话开始时注入 OpenViking 画像块、可用记忆索引和 OpenViking 技能清单 `<available-skills>`;模型步骤带有新的用户输入时,用用户输入的文本做语义检索,把结果作为持久消息追加到同一步骤,因此注入会随会话重放,也对压缩可见。DSH 或其他插件注入的上下文(例如 `time-context`、job 通知)和工具结果既不触发召回,也不拼进检索文本。它直接从 DSH 的事件流捕获 user、assistant 以及(可选的)工具结果消息,并跳过注入的上下文,待同步 token 超过阈值或 DSH 开始压缩时即 commit,每次 commit 都归档全部已捕获的消息。写入失败会进入待写队列,在下次会话开始时重放。@@ -102,15 +156,20 @@ patch 中写的凭证优先于环境变量。行为配置按优先级从高到| 现象 | 排查方向 ||------|----------|-| 没有注入,也没有 OpenViking 工具 | `dsh --profile web --dump-config` 里应能看到 `openviking-memory-runtime`;重新运行安装器或 `dsh plugin --profile web add …` |+| 没有注入,也没有 OpenViking 工具 | `dsh --profile web --dump-config` 里应能看到 `openviking-memory-runtime`;重新运行安装器或 `dsh plugin --profile web add …`。Desktop 见[在 Desktop 中验证](#verify-in-desktop) || 装到了错误的 profile | 安装器默认 `web`;用 `--dsh-profile <name>` 重新运行 || DSH 提示插件与当前 dsh 版本不兼容 | 插件接受 `0.1.0-rc.6` 起的所有 `@deepseek-ai/dsh` 0.x 版本(peer 范围 `>=0.1.0-rc.6 <1.0.0-0`),出现这个提示说明 DSH 已是 1.0 或更高;升级插件,或者确认风险后用 `dsh plugin allow-version` 放行。所有 `@deepseek-ai/dsh-*` 宿主包要保持同一版本。 |-| 升级 DSH 后插件启动失败 | 已验证的版本:`0.1.0-rc.6`、`0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.7-rc.2`、`0.2.0-rc.2`、`0.2.1-alpha.1`。更新的 0.x 版本不经预先验证就会被接受;请把 DSH 固定到已验证的版本,并提 issue。 |+| 升级 DSH 后插件启动失败 | 已验证的版本:`0.1.0-rc.6`、`0.1.5-rc.1`、`0.1.5-rc.2`、`0.1.7-rc.2`、`0.2.0-rc.2`、`0.2.1-alpha.1`、`0.2.1-rc.2`、`0.2.1-rc.3`。更新的 0.x 版本不经预先验证就会被接受;请把 DSH 固定到已验证的版本,并提 issue。 || 安装时报包「不在 npm registry 中」 | 检查该 profile 的 pnpm 是否设置了 24 小时的最小发布年龄(`minimumReleaseAge`)。等一等,或把该精确版本加进 profile 的 `pnpm-workspace.yaml` 的 `minimumReleaseAgeExclude` || 召不回任何内容 | `curl "<OpenViking 服务地址>/health"`;检查端点配置,以及 prompt 是否长于最小查询长度(3 个字符) || OpenViking 返回 401 / 403 | 检查 `OPENVIKING_API_KEY`;可信模式部署还要检查 `OPENVIKING_ACCOUNT` 与 `OPENVIKING_USER` || 串入了其他项目的记忆 | 设置 `OPENVIKING_RECALL_PEER_SCOPE=actor`,将 peer 记忆限定为当前 peer;用户级记忆仍会共享 || 崩溃后没有 commit | commit 由 token 阈值、压缩开始和 teardown 触发;排队的写入会在下次会话开始时重放 |+| `profile "desktop" is managed exclusively by the Electron application` | `desktop` profile 不能启动,也不能 dump 配置,只有 Desktop 自带的 `dsh` 能修改它的插件。改用 [Desktop 自带的 `dsh` 命令](#desktop-plugins-page),并[不借助 `--dump-config` 验证](#verify-in-desktop) |+| `Open DeepSeek Harness Desktop once to initialize its profile…` | Desktop 还没创建 profile。先打开一次 Desktop,用 ⌘Q 退出,再重新运行安装器 |+| 给 Desktop 装好了,但什么都没出现 | 用 ⌘Q 退出 Desktop(关闭窗口只会隐藏)后重新打开;在 **插件** 页确认插件已启用 |+| Desktop 弹出恢复对话框后插件消失了 | 恢复操作会禁用第三方插件并备份 `cordis.patch.yml`;到 **插件** 页重新启用,需要的设置从 `.bak-<时间戳>` 文件挪到 `ovcli.conf` |+| **极简模式** 下没有技能 | Web 和 Desktop 的 **极简模式** agent 预设没有技能工具,插件附带的技能在那里不可用;自动召回和捕获照常 |## 延伸阅读diff --git a/docs/zh/gateway/03-connect-clients.md b/docs/zh/gateway/03-connect-clients.mdindex 7d0aa77ad..a34fd50c4 100644--- a/docs/zh/gateway/03-connect-clients.md+++ b/docs/zh/gateway/03-connect-clients.md@@ -238,7 +238,7 @@ pi 可以使用 Chat Completions、Anthropic Messages 或 Responses,Base URL## DSH {#dsh}-[DeepSeek Harness](https://www.npmjs.com/package/@deepseek-ai/dsh)(`dsh`)的模型层基于 pi,`api` 和 Base URL 的取值与 pi 相同:`https://ov.example.com/gateway/v1`,Anthropic Messages 用 `https://ov.example.com/gateway`。在 profile 配置中添加一个服务商;`dsh web` 使用的 profile 是 `web`,所以文件是 `~/.dsh/profiles/web/cordis.patch.yml`:+[DeepSeek Harness](https://www.npmjs.com/package/@deepseek-ai/dsh)(`dsh`)的模型层基于 pi,`api` 和 Base URL 的取值与 pi 相同:`https://ov.example.com/gateway/v1`,Anthropic Messages 用 `https://ov.example.com/gateway`。在 profile 配置中添加一个服务商;`dsh web` 使用的 profile 是 `web`,所以文件是 `~/.dsh/profiles/web/cordis.patch.yml`;DeepSeek Harness Desktop 桌面应用用的是 `~/.dsh/profiles/desktop/cordis.patch.yml`:```yaml- id: llm-pi-ai@@ -257,6 +257,7 @@ pi 可以使用 Chat Completions、Anthropic Messages 或 Responses,Base URL把网关密钥导出为 `OPENVIKING_GATEWAY_KEY`(也就是 `apiKeyEnv` 填的变量名),然后启动 `dsh web`,在模型选择器中选择 `openviking` 服务商下的 `<model>`。- 也可以在 Web UI 的 Settings → Models → Add model provider → Custom model API 中添加,写入的是同一个文件。+- Desktop 看不到在终端里 export 的变量。macOS 上把 `OPENVIKING_GATEWAY_KEY` 写进 shell 启动文件(`~/.zprofile` 或 `~/.zshrc`);Windows 上用 `setx` 设置。然后用 ⌘Q 或托盘菜单退出 Desktop,再重新打开。Desktop 的恢复对话框会把 `cordis.patch.yml` 挪成 `.bak-<时间戳>` 文件,运行过恢复后需要重新添加服务商。- DSH 的一个服务商只使用一种协议。要通过多种协议使用网关,就为每种协议各声明一个服务商。- 除非 DSH 发送了某个会话请求头,否则网关根据历史匹配它的对话(见[网关如何识别对话](#how-conversations-are-recognized))。- 同一个 profile 里装了 [OpenViking 的 DSH 插件](../agent-integrations/17-dsh.md)时,网关会让出这些对话,两者选一个即可。diff --git a/examples/agent-hook-plugin/hosts/codebuddy/plugin.json b/examples/agent-hook-plugin/hosts/codebuddy/plugin.jsonindex 7b7fbf238..4f25d3481 100644--- a/examples/agent-hook-plugin/hosts/codebuddy/plugin.json+++ b/examples/agent-hook-plugin/hosts/codebuddy/plugin.json@@ -1,6 +1,6 @@{"name": "openviking-memory",- "version": "0.5.25",+ "version": "0.5.26","description": "Long-term semantic memory for the CodeBuddy Code CLI, powered by OpenViking. Injects relevant context at session start and on each prompt, and captures the conversation back into OpenViking.","author": {"name": "OpenViking",diff --git a/examples/agent-hook-plugin/hosts/cursor/openviking.integration.json b/examples/agent-hook-plugin/hosts/cursor/openviking.integration.jsonindex 84e898b7e..178ef8b95 100644--- a/examples/agent-hook-plugin/hosts/cursor/openviking.integration.json+++ b/examples/agent-hook-plugin/hosts/cursor/openviking.integration.json@@ -1,7 +1,7 @@{"schemaVersion": 1,"id": "openviking-memory",- "version": "0.5.25",+ "version": "0.5.26","clients": ["cursor"],diff --git a/examples/agent-hook-plugin/hosts/kimicode/kimi.plugin.json b/examples/agent-hook-plugin/hosts/kimicode/kimi.plugin.jsonindex 8ef7e34c3..99c90929d 100644--- a/examples/agent-hook-plugin/hosts/kimicode/kimi.plugin.json+++ b/examples/agent-hook-plugin/hosts/kimicode/kimi.plugin.json@@ -1,6 +1,6 @@{"name": "openviking-memory",- "version": "0.5.25",+ "version": "0.5.26","description": "Long-term semantic memory for Kimi Code CLI, powered by OpenViking.","author": {"name": "OpenViking",diff --git a/examples/agent-hook-plugin/hosts/kimicode/openviking.integration.json b/examples/agent-hook-plugin/hosts/kimicode/openviking.integration.jsonindex 2880c09f7..a82476529 100644--- a/examples/agent-hook-plugin/hosts/kimicode/openviking.integration.json+++ b/examples/agent-hook-plugin/hosts/kimicode/openviking.integration.json@@ -1,7 +1,7 @@{"schemaVersion": 1,"id": "openviking-memory",- "version": "0.5.25",+ "version": "0.5.26","clients": ["kimicode"],diff --git a/examples/agent-hook-plugin/hosts/trae/openviking.integration.json b/examples/agent-hook-plugin/hosts/trae/openviking.integration.jsonindex 0f2a6cd64..e25e143cd 100644--- a/examples/agent-hook-plugin/hosts/trae/openviking.integration.json+++ b/examples/agent-hook-plugin/hosts/trae/openviking.integration.json@@ -1,7 +1,7 @@{"schemaVersion": 1,"id": "openviking-memory",- "version": "0.5.25",+ "version": "0.5.26","clients": ["trae","trae-cn"diff --git a/examples/agent-hook-plugin/hosts/zcode/openviking.integration.json b/examples/agent-hook-plugin/hosts/zcode/openviking.integration.jsonindex 8b983547a..d280b6aea 100644--- a/examples/agent-hook-plugin/hosts/zcode/openviking.integration.json+++ b/examples/agent-hook-plugin/hosts/zcode/openviking.integration.json@@ -1,7 +1,7 @@{"schemaVersion": 1,"id": "openviking-memory",- "version": "0.5.25",+ "version": "0.5.26","clients": ["zcode"],diff --git a/examples/agent-hook-plugin/plugin.json b/examples/agent-hook-plugin/plugin.jsonindex 2cf95db7c..bd9a726d5 100644--- a/examples/agent-hook-plugin/plugin.json+++ b/examples/agent-hook-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "agent-hook-plugin",- "version": "0.5.25",+ "version": "0.5.26","description": "Long-term semantic memory for Cursor, TRAE, TRAE CN, ZCode, Kimi Code and CodeBuddy Code — powered by OpenViking. Auto-recall relevant memories and capture the conversation as it happens.","author": {"name": "OpenViking",diff --git a/examples/claude-code-memory-plugin/.claude-plugin/plugin.json b/examples/claude-code-memory-plugin/.claude-plugin/plugin.jsonindex 6e6692b7e..1a2e04dda 100644--- a/examples/claude-code-memory-plugin/.claude-plugin/plugin.json+++ b/examples/claude-code-memory-plugin/.claude-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "openviking-memory",- "version": "0.7.18",+ "version": "0.7.19","description": "Long-term semantic memory for Claude Code, powered by OpenViking. Auto-recall relevant memories at session start and capture important information during conversations.","author": {"name": "OpenViking",diff --git a/examples/claude-code-memory-plugin/package.json b/examples/claude-code-memory-plugin/package.jsonindex 3f4f26c65..d3f15421f 100644--- a/examples/claude-code-memory-plugin/package.json+++ b/examples/claude-code-memory-plugin/package.json@@ -1,6 +1,6 @@{"name": "claude-code-openviking-memory",- "version": "0.7.18",+ "version": "0.7.19","description": "OpenViking memory plugin for Claude Code — semantic long-term memory","type": "module","scripts": {diff --git a/examples/claude-code-memory-plugin/scripts/shared/uri-guard.mjs b/examples/claude-code-memory-plugin/scripts/shared/uri-guard.mjsindex dc168cea0..f7388ce28 100644--- a/examples/claude-code-memory-plugin/scripts/shared/uri-guard.mjs+++ b/examples/claude-code-memory-plugin/scripts/shared/uri-guard.mjs@@ -167,7 +167,9 @@ export const DEFAULT_TOOL_HINTS = {// Tools whose argument is a command line rather than a location. A viking:// URI// in one is data (an `ov` argument, an HTTP payload, a grep pattern) as often as// a path the model hoped to open, so the command runs and the model gets a notice.-const SHELL_TOOL_NAMES = new Set(["bash", "shell", "runcommand"]);+// Only a name the host's hint table lists is guarded at all, so the PowerShell+// names reach no host that does not map them (dsh's Windows `pwsh` tool does).+const SHELL_TOOL_NAMES = new Set(["bash", "shell", "runcommand", "pwsh", "powershell"]);// `pattern` is where glob looks but what grep looks for: a grep for the text// "viking://" in a local tree is not a path. The generic sweep still reachesdiff --git a/examples/codex-memory-plugin/.codex-plugin/plugin.json b/examples/codex-memory-plugin/.codex-plugin/plugin.jsonindex 8c73112e4..b9c7125a7 100644--- a/examples/codex-memory-plugin/.codex-plugin/plugin.json+++ b/examples/codex-memory-plugin/.codex-plugin/plugin.json@@ -1,6 +1,6 @@{"name": "openviking-memory",- "version": "0.11.15",+ "version": "0.11.16","description": "Long-term semantic memory for Codex, powered by OpenViking. Recall on UserPromptSubmit, incremental add_message on Stop (per turn), commit on SessionEnd (Codex >= 0.145) and on PreCompact, with an idle/ended sweep on SessionStart as the fallback for signals, crashes and older Codex builds. Includes a local stdio MCP proxy that reads OpenViking credentials from env/ovcli.conf.","author": {"name": "OpenViking",diff --git a/examples/dsh-memory-plugin/README.md b/examples/dsh-memory-plugin/README.mdindex 6f052979c..8ec7d5740 100644--- a/examples/dsh-memory-plugin/README.md+++ b/examples/dsh-memory-plugin/README.md@@ -10,14 +10,17 @@ Published as [`@openviking/dsh-memory-plugin`](https://www.npmjs.com/package/@op## Install-DSH is covered by the unified memory-plugin installer, which asks which profile-to install into (default `web`):+DSH is covered by the unified memory-plugin installer:```bashcurl -fsSL https://openviking.ai/install | bash# AI agents: not sure about running this? The script's header says what it does and how to verify it.```+It installs into the npm `dsh`'s `web` profile; pass `--dsh-profile <name>`+for another one. On macOS it also offers DeepSeek Harness Desktop as a separate+harness, `dsh-desktop` (see [DeepSeek Harness Desktop](#deepseek-harness-desktop)).+Or add the package to a profile directly:```bash@@ -33,10 +36,48 @@ tree's realpath rather than from the profile.It also needs `node examples/memory-plugin-shared/sync.mjs` run first: the`shared/` modules the bundle imports are generated, not committed.+### DeepSeek Harness Desktop++Desktop keeps its plugins in a reserved `desktop` profile under+`${DSH_HOME:-$HOME/.dsh}/profiles/desktop`, separate from the CLI's profiles.+The bundle runs there unchanged; only the way it gets installed differs.++- **Plugins page** (macOS and Windows, manual): Plugins → Add plugin → enter+ `@openviking/dsh-memory-plugin` → Install, then turn it on if its switch is+ off. The page does not ask for OpenViking credentials, so write+ `~/.openviking/ovcli.conf` yourself first. Uninstall from the same page. The page shows [`docs/DETAIL.md`](docs/DETAIL.md)+ ([`DETAIL.zh.md`](docs/DETAIL.zh.md) in Chinese) as the plugin's detail+ document, through `meta.detail` in `locale/*.json`.+- **Installer** (macOS, needs Node.js): with Desktop present the installer+ selects the `dsh-desktop` harness, and `--dsh-profile desktop` routes there+ too. It uses Desktop's own launcher at `OPENVIKING_DSH_DESKTOP_CLI` when set,+ otherwise the one in `/Applications` or `~/Applications`, otherwise a `dsh`+ on `PATH` that resolves into the app.+- **Desktop's launcher** (macOS). Open Desktop once so the profile exists, quit+ it with ⌘Q (closing the window only hides it), run the command, then reopen+ Desktop:++ ```bash+ DSH_DESKTOP="/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh"+ "$DSH_DESKTOP" plugin --profile desktop add @openviking/dsh-memory-plugin+ "$DSH_DESKTOP" plugin --profile desktop ls # should list the package+ "$DSH_DESKTOP" plugin --profile desktop rm @openviking/dsh-memory-plugin+ ```++An npm-installed `dsh` refuses `--profile desktop`, and no `dsh` boots that+profile or runs `--dump-config` on it, Desktop's own launcher included. To+confirm an install, use `plugin --profile desktop ls` or check that+`profiles/desktop/package.json` lists the package under `dsh.profile.bundles`.+On Windows, install from the Plugins page and configure the connection in+`~/.openviking/ovcli.conf`; the installer does not cover Windows. Desktop has+no Linux release.+## Requirements- `@deepseek-ai/dsh` `0.1.0-rc.6` or later, below `1.0.0` (see [DSH version compatibility](#dsh-version-compatibility))-- Node.js `^22.19.0` or `>=24`+- Node.js `^22.19.0` or `>=24` for the bundle itself. The host decides in+ practice: DSH `0.2.1-rc.2` and later need Node.js `>=24.9`, and Desktop ships+ its own runtime, so it needs no system Node.js.- A reachable OpenViking serverThe bundle has no runtime npm dependencies. Its message structures come from@@ -66,13 +107,20 @@ the plugin entry points of `@deepseek-ai/dsh-mcp-client` andreleases tested so far.Verified releases: `0.1.0-rc.6`, `0.1.5-rc.1`, `0.1.5-rc.2`, `0.1.7-rc.2`,-`0.2.0-rc.2`, and `0.2.1-alpha.1`. A daily job+`0.2.0-rc.2`, `0.2.1-alpha.1`, `0.2.1-rc.2`, and `0.2.1-rc.3` (built from the+same source tag as Desktop `0.2.1-rc.3`). A daily job(`.github/workflows/host-compat.yml`) runs the bundle's tests against thereleases DSH's `latest`, `next`, and `alpha` dist-tags point at, installs each-of those releases, adds the packed bundle to a profile and checks+of those releases from npm, adds the packed bundle to a `web` profile and checks`--dump-config` lists it, and opens an issue when any of that fails, so a breaking release is usually caught before usersreach it; if the bundle still fails to start on a new release, pin DSH to a-verified one and open an issue. DSH 1.0 and later, pre-releases included, fall outside the+verified one and open an issue. Every one of those checks uses npm `dsh` on+Linux, because Desktop is not on npm and has no Linux build. A further smoke step+emulates Desktop's launcher with the same release: it initializes a `desktop`+profile the way Desktop's first launch does, adds the bundle through+`runCli({ manageDesktopProfile: true })`, and checks that the profile lists it,+that npm `dsh` still refuses that profile, and that no `dsh` dumps its config. Real Desktop builds are checked by+hand. DSH 1.0 and later, pre-releases included, fall outside therange and DSH refuses to load the bundle; `dsh plugin allow-version` grants an exact-versionexemption if you accept the risk. Local devDependencies and `overrides` staypinned to rc.6 to exercise the minimum supported contract.@@ -165,6 +213,10 @@ effect for the tools when DSH restarts the bundle, as it does for the runtime.Two consequences follow from the proxy being one process per profile:- **MCP actor scope is process-level.** With the default `recallPeerScope: all`, MCP tool calls omit the actor peer header. With `actor`, they use the peer resolved at boot. Automatic recall, capture, and commit resolve their peer from each session's workspace.+ Desktop boots the bundle in its profile directory, which is no repository, so+ there the boot peer is empty and `actor`-scoped tool calls fall back to broad+ recall. Set `actor_peer_id` in `ovcli.conf` or `OPENVIKING_PEER_ID` to give+ them a peer; either one also overrides the workspace peer of every session.- **`remember` is not session-scoped.** The server's MCP `remember` stores intoits own short-lived session rather than the live `dsh-<session-id>` stream —the same behavior the Claude Code, Codex, and Cursor integrations have.@@ -178,9 +230,17 @@ lifecycle registration, so a proxy that cannot start holds up nothing above it.`skills.mjs` registers a second `ctx.skills` provider with`includeDefaultRoots: false` and `bundledSkillDir` pointing at `skills/`. DSHreads this host-owned bundle directly rather than asking a workspace filesystem-to resolve a path outside its root. Its existing `filesystem` provider still-owns the project and user skill roots; the bundle does not duplicate that-catalog or override higher-priority project skills.+to resolve a path outside its root. The provider discovers no project or user+roots, so the bundle does not duplicate that catalog or override+higher-priority project skills. Those roots belong to DSH's own+`skill-filesystem`: `dsh-base`'s host-level row in `headless`, `acp`, and+`sdk`, whose app bundles keep it, and per-preset rows in `web` and `desktop`,+where `dsh-web-app` disables the host row and the `standard`, `ptc`, and+`cordis` agent presets each mount their own `skill-filesystem` and+`tool-skill`. The bundle's provider registers at host level, which every+preset reads, so those agents see the bundled skills. The `minimal` preset mounts no `tool-skill`, so its agents+see no skills, these included, and `sdk-minimal` has no `skills` service, so the+provider never starts there.## Configuration@@ -251,7 +311,7 @@ The older size settings apply to fallback recall, not the primary context reques- `skillCatalog` (default `true`) and `skillCatalogTokenBudget` (default `1200`; `0` also turns the catalog off) govern `<available-skills>`. The catalog comes from one `GET /api/v1/skills?node_limit=200` call: the user's own skills first, then those shared under `viking://agent/skills` minus any whose name the user also owns, each description cut to about 40 tokens. Its budget is separate from `profileTokenBudget`. When the descriptions do not fit, the catalog lists names only (with a `... +N more` tail if even the names do not all fit); when not even one name fits, it shrinks to a one-line count; with no skills, or a server without the endpoint, it is omitted.- Failed writes enter the shared OpenViking pending queue. A background drainer (default every 60s, `OPENVIKING_PENDING_DRAIN_INTERVAL_MS`) probes the server health and replays the queue in-process, so a transient write failure recovers without restarting dsh; it does not consume the session-start retry budget. Session-start replays keep consuming retries as before.- `tools/pre-execute` denies a DSH filesystem tool (`read`, `glob`, `grep`, `edit`, `write`, `str_replace_editor`) whose path argument is a `viking://` URI, pointing the model at the bridged `mcp__openviking__*` tools instead. A `write` or `edit` under a skill directory (`viking://~/skills/...`, `viking://user/<id>/skills/...`, `viking://agent/skills/...`) points at `mcp__openviking__add_skill` instead, which creates or replaces a whole skill from its `SKILL.md` text. A `grep` whose pattern is `viking://` text still runs.-- `tools/post-execute` lets a `bash` command that carries a `viking://` URI run unchanged and attaches a notice for the model: use the bridged tools if it meant OpenViking content, or ignore the notice when the URI is intentional data such as an `ov` argument or an HTTP payload.+- `tools/post-execute` lets a `bash` command (`pwsh` on Windows, where DSH mounts it in place of `bash`) that carries a `viking://` URI run unchanged and attaches a notice for the model: use the bridged tools if it meant OpenViking content, or ignore the notice when the URI is intentional data such as an `ov` argument or an HTTP payload.Each DSH session maps to `dsh-<session-id>` in OpenViking. IDs that contain Windows-invalid path characters are normalized to a readable underscore form plus a stable hash, so two native IDs cannot collapse onto the same OpenViking session; already-portable IDs keep their existing mapping. Existing sessions whose native IDs require normalization start a new OpenViking session after this upgrade. Workspace-derived actor peers are resolved per session and sent on every session-specific request: the peer is the git identity of the session's workspace — the normalized `origin` URL (`[email protected]:volcengine/OpenViking.git` becomes `github.com-volcengine-openviking`), else the repository root path, that fallback keeping the older rule where every non-letter-or-digit character becomes `-`. With the default peer settings, no peer is sent outside a git repository, and what is remembered there goes to the user-level space `viking://user/<you>/memories`. One repository therefore keeps one peer across subdirectories, worktrees, clones and machines, while a fork's different origin keeps it separate. Memories written under the older path-derived peer stay reachable: the default `recallPeerScope: all` sweeps every peer under the user.diff --git a/examples/dsh-memory-plugin/bundle.test.mjs b/examples/dsh-memory-plugin/bundle.test.mjsindex 7b536013f..03028ffd7 100644--- a/examples/dsh-memory-plugin/bundle.test.mjs+++ b/examples/dsh-memory-plugin/bundle.test.mjs@@ -24,7 +24,7 @@ test("bundle uses neutral DSH naming and bounded peers", async () => {for (const [name, range] of Object.entries(manifest.peerDependencies)) {for (const version of ["0.1.0-rc.6", "0.1.5-rc.1", "0.1.5-rc.2", "0.1.5", "0.1.7-rc.2",- "0.2.0-rc.2", "0.2.1-alpha.1", "0.3.0",+ "0.2.0-rc.2", "0.2.1-alpha.1", "0.2.1-rc.3", "0.3.0",]) {assert.ok(semver.satisfies(version, range, dshRange), `${name} must accept ${version}`);}@@ -61,6 +61,22 @@ test("the runtime and package lock report the published package version", asyncassert.deepEqual(lock.packages[""].peerDependencies, manifest.peerDependencies);});+// DSH's Plugins page shows the file locale `meta.detail` names instead of the+// README. It rejects a root-level document, a path outside the package, and a+// named file that does not exist, and the npm package only has what `files` lists.+test("each locale's detail document exists and ships with the package", async () => {+ const manifest = JSON.parse(await readFile(new URL("./package.json", import.meta.url), "utf8"));+ for (const language of ["en", "zh"]) {+ const { meta } = JSON.parse(await readFile(new URL(`./locale/${language}.json`, import.meta.url), "utf8"));+ const segments = meta.detail.split("/");+ assert.ok(segments.length > 1, `${language}: ${meta.detail} must sit in a subdirectory`);+ assert.ok(segments.every(s => s && s !== "." && s !== ".."), `${language}: ${meta.detail}`);+ assert.match(meta.detail, /\.md$/);+ await readFile(join(PLUGIN_DIR, meta.detail), "utf8");+ assert.ok(manifest.files.includes(`${segments[0]}/`), `${segments[0]}/ must be in files`);+ }+});+test("plugin source tree contains no product-specific identifier", async () => {for (const file of await sourceFiles(PLUGIN_DIR)) {const path = relative(PLUGIN_DIR, file);diff --git a/examples/dsh-memory-plugin/docs/DETAIL.md b/examples/dsh-memory-plugin/docs/DETAIL.mdnew file mode 100644index 000000000..4632330b9--- /dev/null+++ b/examples/dsh-memory-plugin/docs/DETAIL.md@@ -0,0 +1,61 @@+# OpenViking Memory++Long-term memory for DeepSeek Harness, backed by an [OpenViking](https://github.com/volcengine/OpenViking) server. Works in DeepSeek Harness Desktop and in `dsh web`.++- **Recall:** before each step that takes your input, relevant memories are added to the conversation.+- **Capture:** your messages and the assistant's replies are sent to OpenViking and committed as memories.+- **Tools and skills:** the model gets the OpenViking tools (`mcp__openviking__search`, `read`, `remember`, `add_skill`, …) and the `openviking-memory`, `openviking-skills` and `ov-experience-memory` skills.+- **URI protection:** a file tool aimed at a `viking://` path is stopped and pointed at the right OpenViking tool. A `bash` or `pwsh` command that contains one still runs, with a note to the model.++## 1. Connect to your server++Write `~/.openviking/ovcli.conf` with `url` and `api_key` (plus `account` and `user` on a trusted-mode server). A local server at `http://127.0.0.1:1933` without authentication needs nothing. See [Deployment Guide → CLI](https://github.com/volcengine/OpenViking/blob/main/docs/en/guides/03-deployment.md#cli).++Prefer `ovcli.conf` to environment variables in Desktop. On macOS, Desktop reads your login shell's environment once when it starts; on Windows, it uses your user environment. After changing either, fully quit and reopen Desktop.++## 2. Install++**With the installer (macOS):**++```bash+curl -fsSL https://openviking.ai/install | bash+```++It needs Node.js 18 or later. It finds Desktop and installs into it as the `dsh-desktop` harness. Open Desktop once beforehand so its profile exists, and quit it with ⌘Q while the installer runs: closing the window only hides it.++**From the Plugins page (manual; macOS, Windows and `dsh web`):** Plugins → Add plugin → enter `@openviking/dsh-memory-plugin` → Install, then turn it on if its switch is off. This only adds the plugin: it does not ask for your OpenViking credentials, so do step 1 first.++**With Desktop's own `dsh` command (macOS):** open Desktop once, quit it with ⌘Q, then run:++```bash+"/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" plugin --profile desktop add @openviking/dsh-memory-plugin+```++A `dsh` installed from npm cannot manage the `desktop` profile. After a command-line install, reopen Desktop.++## 3. Check that it works++Open a new conversation. You should see an OpenViking context block near the top, and the model should list `mcp__openviking__*` tools. Ask about something from an earlier conversation to confirm recall.++To check the install from a terminal (with Desktop quit):++```bash+"/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" plugin --profile desktop ls+```++## Good to know++- **No settings page.** Configure the plugin through `ovcli.conf` or `OPENVIKING_*` variables. Behavior options can also go in `~/.dsh/profiles/desktop/cordis.patch.yml` under `openviking-memory-runtime`. The recovery dialog's "Disable third-party plugins, back up profile patch, and restart" resets the profile's plugins and moves that file aside, so keep lasting settings in `ovcli.conf`, and enable the plugin again afterwards.+- **Tool identity.** Automatic recall and capture follow each conversation's project. The OpenViking tools run once per profile, from the profile directory, so with `OPENVIKING_RECALL_PEER_SCOPE=actor` they have no project peer. To give them one, set `actor_peer_id` in `ovcli.conf` or `OPENVIKING_PEER_ID`. That peer also replaces each conversation's project peer for recall and capture, so every conversation shares it.+- **Skills.** Bundled skills reach agents whose preset includes the skill tool. The `minimal` preset does not, so agents using it do not see them.+- **Logs.** Desktop shows no plugin output. To debug the OpenViking tools, set `OPENVIKING_DEBUG=1` and `OPENVIKING_DEBUG_LOG=<file>`, then reopen Desktop.++## Uninstall++Plugins → OpenViking Memory → Uninstall. Or, with Desktop quit:++```bash+"/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" plugin --profile desktop rm @openviking/dsh-memory-plugin+```++Full documentation: [DeepSeek Harness integration](https://github.com/volcengine/OpenViking/blob/main/docs/en/agent-integrations/17-dsh.md) and the [bundle README](https://github.com/volcengine/OpenViking/tree/main/examples/dsh-memory-plugin).diff --git a/examples/dsh-memory-plugin/docs/DETAIL.zh.md b/examples/dsh-memory-plugin/docs/DETAIL.zh.mdnew file mode 100644index 000000000..1e97be4a8--- /dev/null+++ b/examples/dsh-memory-plugin/docs/DETAIL.zh.md@@ -0,0 +1,61 @@+# OpenViking 记忆++基于 [OpenViking](https://github.com/volcengine/OpenViking) 服务端,为 DeepSeek Harness 提供长期记忆。DeepSeek Harness Desktop 和 `dsh web` 均可使用。++- **召回**:每个带有你输入的步骤开始前,把相关记忆加入对话。+- **捕获**:把你的消息和助手的回复发送到 OpenViking,并提交为记忆。+- **工具与技能**:模型可以使用 OpenViking 工具(`mcp__openviking__search`、`read`、`remember`、`add_skill` 等),以及 `openviking-memory`、`openviking-skills`、`ov-experience-memory` 三个技能。+- **URI 保护**:文件工具指向 `viking://` 路径时会被拦下,并提示改用对应的 OpenViking 工具;`bash` 或 `pwsh` 命令里带 `viking://` URI 时照常执行,只给模型附一条提示。++## 1. 连接服务端++写 `~/.openviking/ovcli.conf`,填 `url` 和 `api_key`(trusted 模式的服务端还要填 `account` 和 `user`)。如果用的是 `http://127.0.0.1:1933` 上无鉴权的本地服务端,这步可以跳过。参见 [部署指南 → CLI](https://github.com/volcengine/OpenViking/blob/main/docs/zh/guides/03-deployment.md#cli)。++在 Desktop 里建议用 `ovcli.conf` 而不是环境变量。macOS 上 Desktop 只在启动时读取一次登录 shell 的环境变量;Windows 上使用用户环境变量。改动后需要彻底退出并重新打开 Desktop。++## 2. 安装++**通过安装器(macOS)**:++```bash+curl -fsSL https://openviking.ai/install | bash+```++安装器需要 Node.js 18 或更高版本。它会找到 Desktop,作为 `dsh-desktop` harness 安装进去。运行前先打开一次 Desktop 让它创建 profile,安装期间用 ⌘Q 退出 Desktop:关闭窗口只是把它隐藏起来。++**通过插件页面(手动;macOS、Windows 和 `dsh web`)**:插件 → 添加插件 → 输入 `@openviking/dsh-memory-plugin` → 安装,开关未打开时再打开。这一步只添加插件,不会询问 OpenViking 凭据,所以要先完成第 1 步。++**通过 Desktop 自带的 `dsh` 命令(macOS)**:先打开一次 Desktop,用 ⌘Q 退出,再运行:++```bash+"/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" plugin --profile desktop add @openviking/dsh-memory-plugin+```++通过 npm 安装的 `dsh` 无法管理 `desktop` profile。用命令行安装后,重新打开 Desktop。++## 3. 验证++新开一个对话。顶部附近应能看到 OpenViking 上下文块,模型的工具列表里应有 `mcp__openviking__*`。问一件之前对话里的事,确认召回生效。++在终端里检查安装结果(需先退出 Desktop):++```bash+"/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" plugin --profile desktop ls+```++## 注意事项++- **没有设置页面。** 通过 `ovcli.conf` 或 `OPENVIKING_*` 环境变量配置插件。行为参数也可以写进 `~/.dsh/profiles/desktop/cordis.patch.yml` 的 `openviking-memory-runtime` 条目。恢复对话框里的“禁用第三方插件、备份 profile patch 并重启”会重置 profile 的插件,并把这个文件挪作备份,所以长期设置请放在 `ovcli.conf`,恢复后记得重新启用插件。+- **工具身份。** 自动召回和捕获按每个对话所在的项目区分。OpenViking 工具每个 profile 只启动一次,工作目录是 profile 目录,所以在 `OPENVIKING_RECALL_PEER_SCOPE=actor` 下它们没有项目 peer。需要时在 `ovcli.conf` 里设置 `actor_peer_id`,或设置 `OPENVIKING_PEER_ID`。这个 peer 也会取代每个对话的项目 peer 用于召回和捕获,因此所有对话共用它。+- **技能。** 内置技能只对预设里带技能工具的 agent 可见。`minimal` 预设不带,用它的 agent 看不到这些技能。+- **日志。** Desktop 不显示插件输出。要排查 OpenViking 工具,设置 `OPENVIKING_DEBUG=1` 和 `OPENVIKING_DEBUG_LOG=<文件>`,然后重新打开 Desktop。++## 卸载++插件 → OpenViking 记忆 → 卸载。或者在退出 Desktop 后运行:++```bash+"/Applications/DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh" plugin --profile desktop rm @openviking/dsh-memory-plugin+```++完整文档:[DeepSeek Harness 集成](https://github.com/volcengine/OpenViking/blob/main/docs/zh/agent-integrations/17-dsh.md) 和 [插件 README](https://github.com/volcengine/OpenViking/tree/main/examples/dsh-memory-plugin)。diff --git a/examples/dsh-memory-plugin/index.mjs b/examples/dsh-memory-plugin/index.mjsindex 577facd01..63e51257e 100644--- a/examples/dsh-memory-plugin/index.mjs+++ b/examples/dsh-memory-plugin/index.mjs@@ -86,8 +86,10 @@ export function apply(ctx, input = {}) {]);if (signal.aborted) return decision;const additions = [profile, recall].filter(Boolean);+ // Keep the rest of the decision: goal-round-driver marks its entries with+ // `startsRequestSeries`, and rebuilding the object would drop that flag.return additions.length > 0- ? { kind: "enter", messages: [...decision.messages, ...additions] }+ ? { ...decision, messages: [...decision.messages, ...additions] }: decision;}, { prepend: true });diff --git a/examples/dsh-memory-plugin/index.test.mjs b/examples/dsh-memory-plugin/index.test.mjsindex 183fbd7ff..88986173a 100644--- a/examples/dsh-memory-plugin/index.test.mjs+++ b/examples/dsh-memory-plugin/index.test.mjs@@ -197,6 +197,25 @@ test("agent/created (dsh 0.1.7+) runs startup once and pre-step does not re-inje});});+test("agent/pre-step keeps the downstream decision's other fields when it appends", async () => {+ const { handlers } = mountPlugin();+ const agent = startupAgent("dsh-goal-round");+ await withQuietFetch(async () => {+ const input = [message("goal round prompt")];+ // goal-round-driver marks the entry that opens a request series.+ const decision = await handlers.get("agent/pre-step")({+ agent,+ messages: input,+ signal: new AbortController().signal,+ }, async () => ({ kind: "enter", messages: input, startsRequestSeries: true }));++ assert.equal(decision.kind, "enter");+ assert.equal(decision.startsRequestSeries, true);+ assert.equal(decision.messages[0], input[0]);+ assert.ok(decision.messages.length > input.length, "the profile block was appended");+ });+});+test("dsh 0.1.x: source-less agent/created defers startup to agent/session-start", async () => {const { handlers, calls } = mountPlugin();const agent = startupAgent("dsh-legacy");diff --git a/examples/dsh-memory-plugin/locale/en.json b/examples/dsh-memory-plugin/locale/en.jsonindex ee99f6407..b89fb8c2b 100644--- a/examples/dsh-memory-plugin/locale/en.json+++ b/examples/dsh-memory-plugin/locale/en.json@@ -1,6 +1,7 @@{"meta": {"title": "OpenViking Memory",- "description": "Long-term semantic memory for DeepSeek Harness: auto-recall before each step, session capture and commit, viking:// URI protection, and the OpenViking MCP tools and skills."+ "description": "Long-term semantic memory for DeepSeek Harness: auto-recall before each step, session capture and commit, viking:// URI protection, and the OpenViking MCP tools and skills.",+ "detail": "docs/DETAIL.md"}}diff --git a/examples/dsh-memory-plugin/locale/zh.json b/examples/dsh-memory-plugin/locale/zh.jsonindex e88f51ff4..e8bb03354 100644--- a/examples/dsh-memory-plugin/locale/zh.json+++ b/examples/dsh-memory-plugin/locale/zh.json@@ -1,6 +1,7 @@{"meta": {"title": "OpenViking 记忆",- "description": "为 DeepSeek Harness 提供长期语义记忆:每步自动召回、会话采集与提交、viking:// URI 保护,以及 OpenViking MCP 工具与技能。"+ "description": "为 DeepSeek Harness 提供长期语义记忆:每步自动召回、会话采集与提交、viking:// URI 保护,以及 OpenViking MCP 工具与技能。",+ "detail": "docs/DETAIL.zh.md"}}diff --git a/examples/dsh-memory-plugin/package-lock.json b/examples/dsh-memory-plugin/package-lock.jsonindex 169737ecb..e30fd735d 100644--- a/examples/dsh-memory-plugin/package-lock.json+++ b/examples/dsh-memory-plugin/package-lock.json@@ -1,12 +1,12 @@{"name": "@openviking/dsh-memory-plugin",- "version": "0.5.29",+ "version": "0.5.30","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "@openviking/dsh-memory-plugin",- "version": "0.5.29",+ "version": "0.5.30","license": "Apache-2.0","devDependencies": {"@deepseek-ai/dsh-llm": "0.1.0-rc.6",diff --git a/examples/dsh-memory-plugin/package.json b/examples/dsh-memory-plugin/package.jsonindex 788d24c41..afb1ebe8b 100644--- a/examples/dsh-memory-plugin/package.json+++ b/examples/dsh-memory-plugin/package.json@@ -1,6 +1,6 @@{"name": "@openviking/dsh-memory-plugin",- "version": "0.5.29",+ "version": "0.5.30","description": "OpenViking memory and context bundle for DeepSeek Harness","icon": "./icon.svg","type": "module",@@ -27,6 +27,7 @@"shared/","skills/","locale/",+ "docs/","cordis.patch.yml","README.md"],diff --git a/examples/dsh-memory-plugin/uri-guard.mjs b/examples/dsh-memory-plugin/uri-guard.mjsindex f516bba98..33d34f7ff 100644--- a/examples/dsh-memory-plugin/uri-guard.mjs+++ b/examples/dsh-memory-plugin/uri-guard.mjs@@ -24,6 +24,11 @@ const GUARDED_TOOLS = {tool: `${mcp("read")} or ${mcp("search")}`,example: uri => `${mcp("read")}(uris="${uri}")`,},+ // On Windows DSH mounts `pwsh` in place of `bash`; its command line is also `command`.+ pwsh: {+ tool: `${mcp("read")} or ${mcp("search")}`,+ example: uri => `${mcp("read")}(uris="${uri}")`,+ },edit: {tool: uri => (isSkillUri(uri) ? mcp("add_skill") : mcp("edit")),example: uri =>diff --git a/examples/dsh-memory-plugin/uri-guard.test.mjs b/examples/dsh-memory-plugin/uri-guard.test.mjsindex f87c74eab..fa165d1b3 100644--- a/examples/dsh-memory-plugin/uri-guard.test.mjs+++ b/examples/dsh-memory-plugin/uri-guard.test.mjs@@ -139,6 +139,29 @@ test("shell commands carrying a viking URI run and get a notice", async () => {assert.match(context.content[0].text, /mcp__openviking__read/);});+test("a Windows pwsh command carrying a viking URI runs and gets the same notice", async () => {+ // tool-pwsh takes `{ description, command, workdir? }`, like tool-bash.+ const exec = {+ name: "pwsh",+ arguments: {+ description: "Read the profile",+ command: "Get-Content viking://user/default/memories/profile.md",+ },+ };+ let delegated = false;+ await guardVikingUri(exec, async () => {+ delegated = true;+ return { kind: "allow" };+ });+ assert.equal(delegated, true);++ const decision = await noticeVikingUri(exec, okResult(), async () => ({ kind: "accept" }));+ assert.equal(decision.kind, "accept");+ assert.equal(decision.additionalContexts.length, 1);+ assert.match(decision.additionalContexts[0].content[0].text, /ignore this notice/);+ assert.match(decision.additionalContexts[0].content[0].text, /mcp__openviking__read/);+});+test("the notice summary stays within dsh's context summary bound", async () => {const uri = `viking://resources/${"deep/".repeat(60)}file.md`;const decision = await noticeVikingUri(diff --git a/examples/memory-plugin-shared/install-tui.test.mjs b/examples/memory-plugin-shared/install-tui.test.mjsindex 18637d40f..51d1c440f 100644--- a/examples/memory-plugin-shared/install-tui.test.mjs+++ b/examples/memory-plugin-shared/install-tui.test.mjs@@ -1,6 +1,6 @@import assert from "node:assert/strict";import { spawn, spawnSync } from "node:child_process";-import { chmodSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, realpathSync, rmSync, writeFileSync } from "node:fs";+import { chmodSync, existsSync, mkdirSync, mkdtempSync, readdirSync, readFileSync, realpathSync, rmSync, symlinkSync, writeFileSync } from "node:fs";import { createServer } from "node:http";import { tmpdir } from "node:os";import { join } from "node:path";@@ -578,3 +578,260 @@ test("a non-interactive run with no server says so and how to re-run", (t) => {assert.equal(again.status, 0, `${again.stdout}\n${again.stderr}`);assert.doesNotMatch(again.stdout, notice);});++// DeepSeek Harness Desktop's launcher inside a fake app bundle. It behaves+// like the real one for the calls the installer makes: every boot of the+// desktop profile, --dump-config included, is refused, and so is a plugin+// command before Desktop has created its profile.+const desktopLauncher = "DeepSeek Harness.app/Contents/Resources/runtime/cli/bin/dsh";+// The installer looks in /Applications before ~/Applications, so on a Mac with+// Desktop installed these tests would find (and run) the real app instead.+const realDesktop = process.platform === "darwin" && existsSync(join("/Applications", desktopLauncher))+ && "DeepSeek Harness Desktop is installed in /Applications";++function fakeDsHDesktop(dir, { home = dir, apps = join(home, "Applications"), initialized = true, failAdd = false } = {}) {+ const launcher = join(apps, desktopLauncher);+ const log = join(dir, "dsh-desktop.log");+ const profile = join(home, ".dsh", "profiles", "desktop");+ mkdirSync(join(launcher, ".."), { recursive: true });+ mkdirSync(profile, { recursive: true });+ if (initialized) {+ writeFileSync(join(profile, "package.json"), '{"dsh":{"profile":{"bundles":["@deepseek-ai/dsh-base","@deepseek-ai/dsh-web-app"]}}}\n');+ }+ writeFileSync(launcher, [+ "#!/bin/sh",+ `echo "$*" >> "${log}"`,+ 'case " $* " in *" --dump-config "*) echo \'error: profile "desktop" is managed exclusively by the Electron application\' >&2; exit 1 ;; esac',+ '[ "$1" = plugin ] || { echo "error: profile \\"desktop\\" is managed exclusively by the Electron application" >&2; exit 1; }',+ 'manifest="${DSH_HOME:-$HOME/.dsh}/profiles/desktop/package.json"',+ '[ -f "$manifest" ] || { echo "dsh: Error: Open DeepSeek Harness Desktop once to initialize its profile, then fully quit it before running dsh plugin --profile desktop." >&2; exit 1; }',+ 'case "$4" in',+ failAdd+ ? ' add) echo "ERR_PNPM_FETCH_404 GET https://registry.example/@openviking%2fdsh-memory-plugin: Not Found - 404" >&2; exit 1 ;;'+ : ' add) echo \'{"dsh":{"profile":{"bundles":["@deepseek-ai/dsh-base","@deepseek-ai/dsh-web-app","@openviking/dsh-memory-plugin"]}},"dependencies":{"@openviking/dsh-memory-plugin":"^1.0.0"}}\' > "$manifest" ;;',+ ' ls) cat "$manifest" ;;',+ "esac",+ "",+ ].join("\n"), { mode: 0o755 });+ return { launcher, log, profile };+}++function fakeUname(bin, os) {+ writeFileSync(join(bin, "uname"), `#!/bin/sh\ncase "$1" in -m) echo arm64 ;; *) echo ${os} ;; esac\n`, { mode: 0o755 });+}++// `running`: true or false for every call, or the number of calls that still+// find Desktop running.+function fakePgrep(bin, running) {+ const log = join(bin, "pgrep.log");+ writeFileSync(join(bin, "pgrep"), [+ "#!/bin/sh",+ `echo "$*" >> "${log}"`,+ typeof running === "number"+ ? `[ "$(wc -l < "${log}")" -le ${running} ]`+ : `exit ${running ? 0 : 1}`,+ "",+ ].join("\n"), { mode: 0o755 });+}++test("macOS detects DeepSeek Harness Desktop under ~/Applications and selects it", { skip: realDesktop }, (t) => {+ const home = makeTempHome(t);+ const bin = join(home, "fake-bin");+ mkdirSync(bin);+ fakeUname(bin, "Darwin");+ fakeDsHDesktop(home);++ const result = runInstallerPrelude(`+HAVE_CURSOR=0+INTERACTIVE=0+REQUESTED_HARNESSES=""+select_harnesses+printf '%s:%s:%s\\n' "$HAVE_DSH" "$HAVE_DSH_DESKTOP" "$SELECTED_HARNESSES"+printf '%s\\n' "$(resolve_dsh_desktop_cli)"+tui_reset_bin_selection+tui_finish_selection+printf '%s|%s\\n' "$(tui_bin_label dsh-desktop dsh-desktop)" "$SELECTED_HARNESSES"+`, { HOME: home, PATH: `${bin}:/usr/bin:/bin`, OPENVIKING_DSH_DESKTOP_CLI: undefined, DSH_HOME: undefined });++ assert.equal(result.status, 0, result.stderr);+ assert.deepEqual(result.stdout.trim().split("\n"), [+ "0:1:dsh-desktop,cli",+ join(home, "Applications", desktopLauncher),+ "DeepSeek Harness Desktop|dsh-desktop,cli",+ ]);+});++test("a dsh on PATH that is Desktop's launcher is Desktop, not the npm CLI", { skip: realDesktop }, (t) => {+ const home = makeTempHome(t);+ const bin = join(home, "fake-bin");+ mkdirSync(bin);+ fakeUname(bin, "Darwin");+ // Outside ~/Applications, so only the PATH link finds it.+ const { launcher } = fakeDsHDesktop(home, { apps: join(home, "elsewhere") });+ symlinkSync(launcher, join(bin, "dsh"));++ const result = runInstallerPrelude(`+printf '%s:%s:%s\\n' "$HAVE_DSH" "$HAVE_DSH_DESKTOP" "$(resolve_dsh_desktop_cli)"+install_dsh >&2+`, { HOME: home, PATH: `${bin}:/usr/bin:/bin`, OPENVIKING_DSH_DESKTOP_CLI: undefined, DSH_HOME: undefined });++ assert.equal(result.status, 0, result.stderr);+ assert.equal(result.stdout.trim(), `0:1:${join(bin, "dsh")}`);+ // Asked for the npm CLI, it says why that dsh is not used.+ assert.match(result.stderr, /The dsh on PATH is the one inside DeepSeek Harness Desktop, not the npm dsh CLI/);+});++test("Linux never offers DeepSeek Harness Desktop", (t) => {+ const home = makeTempHome(t);+ const bin = join(home, "fake-bin");+ mkdirSync(bin);+ fakeUname(bin, "Linux");+ fakeDsHDesktop(home);++ const result = runInstallerPrelude(`+HAVE_CURSOR=0+INTERACTIVE=0+REQUESTED_HARNESSES=""+select_harnesses+printf '%s:%s\\n' "$HAVE_DSH_DESKTOP" "$SELECTED_HARNESSES"+idx=0+while [ "$idx" -lt "$(tui_selectable_count)" ]; do printf '%s ' "$(tui_item_at "$idx")"; idx=$((idx + 1)); done+printf '\\n'+SELECTED_HARNESSES=dsh-desktop+(validate_selected_harnesses) || printf 'rejected:%s\\n' "$?"+`, {+ HOME: home,+ PATH: `${bin}:/usr/bin:/bin`,+ OPENVIKING_DSH_DESKTOP_CLI: join(home, "Applications", desktopLauncher),+ DSH_HOME: undefined,+ });++ assert.equal(result.status, 0, result.stderr);+ const [detected, rows, rejected] = result.stdout.trim().split("\n");+ assert.equal(detected, "0:claude,codex,cli");+ assert.doesNotMatch(rows, /dsh-desktop/);+ assert.match(rows, /dsh\|dsh /);+ assert.equal(rejected, "rejected:2");+ assert.match(result.stderr, /macOS only/);+});++test("--dsh-profile desktop routes the dsh harness to dsh-desktop", () => {+ const result = runInstallerPrelude(`+SELECTED_HARNESSES="claude,dsh,dsh-desktop"+PUBLIC_SELECTED_HARNESSES=""+DSH_PROFILE_ARG=desktop+select_dsh_profile+printf '%s\\n' "$SELECTED_HARNESSES"+SELECTED_HARNESSES="dsh"+DSH_PROFILE_ARG=headless+select_dsh_profile+printf '%s:%s\\n' "$SELECTED_HARNESSES" "$DSH_PROFILE"+`);++ assert.equal(result.status, 0, result.stderr);+ assert.deepEqual(result.stdout.trim().split("\n"), ["claude,dsh-desktop", "dsh:headless"]);+});++function desktopInstaller(t, options = {}, transform) {+ const flow = detachedInstaller(t, transform);+ const bin = join(flow.home, "bin");+ fakeUname(bin, "Darwin");+ fakePgrep(bin, options.running ?? false);+ const desktop = fakeDsHDesktop(join(flow.home, ".."), { home: flow.home, ...options });+ const log = () => (existsSync(desktop.log) ? readFileSync(desktop.log, "utf8") : "");+ return { ...flow, ...desktop, bin, log };+}++test("dsh-desktop installs through Desktop's own launcher and never asks it to boot", { skip: realDesktop }, (t) => {+ const { home, dshLog, launcher, log, bin, run } = desktopInstaller(t);++ // The npm dsh on PATH must not be handed Desktop's profile.+ const result = run(["--harness", "dsh", "--dsh-profile", "desktop", "--lang", "en", "--yes", "--url", "http://127.0.0.1:9", "--api-key", ""]);++ const out = `${result.stdout}\n${result.stderr}`;+ assert.equal(result.status, 0, out);+ assert.equal(existsSync(dshLog), false);+ assert.match(result.stdout, /Selected harnesses: dsh-desktop\n/);+ assert.match(result.stdout, /\[3\/4\] DeepSeek Harness Desktop bundle/);+ assert.match(log(), /^plugin --profile desktop add @openviking\/dsh-memory-plugin@latest$/m);+ assert.match(log(), /^plugin --profile desktop ls$/m);+ assert.doesNotMatch(log(), /--dump-config/);+ // Only this user's app main process: its Host and this launcher run the+ // same executable with arguments.+ assert.equal(readFileSync(join(bin, "pgrep.log"), "utf8"),+ `-u ${process.getuid()} -f DeepSeek Harness\\.app/Contents/MacOS/DeepSeek Harness( -psn_[0-9_]+)?$\n`);+ assert.match(result.stdout, /Reopen DeepSeek Harness Desktop to load it\./);+ assert.match(result.stdout, /dsh-desktop: @openviking\/dsh-memory-plugin installed in DeepSeek Harness Desktop/);+ assert.match(result.stdout, /dsh-desktop: plugin enabled in the Desktop profile/);+ assert.doesNotMatch(out, /Validation reported issues/);+ const shown = launcher.replace(home, "~");+ assert.ok(result.stdout.includes(`"${shown}" plugin --profile desktop add @openviking/dsh-memory-plugin@latest`), result.stdout);+ assert.ok(result.stdout.includes(`Uninstall: with Desktop quit, "${launcher}" plugin --profile desktop rm @openviking/dsh-memory-plugin; or Plugins page`), result.stdout);+});++test("an uninitialized Desktop profile gets the Plugins-page steps instead of a failing add", { skip: realDesktop }, (t) => {+ const { log, run } = desktopInstaller(t, { initialized: false });++ const result = run(["--harness", "dsh-desktop", "--lang", "en", "--yes", "--url", "http://127.0.0.1:9", "--api-key", ""]);++ assert.equal(result.status, 0, `${result.stdout}\n${result.stderr}`);+ assert.equal(log(), "");+ assert.match(result.stdout, /has not set up its profile yet: open it once, quit it with ⌘Q and re-run this installer/);+ assert.match(result.stdout, /Plugins → Add plugin → enter @openviking\/dsh-memory-plugin → Install, then turn it on if its switch is off/);+ assert.match(result.stdout, /DeepSeek Harness Desktop: nothing; the steps for its Plugins page are printed/);+});++test("a running Desktop is warned about with --yes and blocks the add when it is not quit", { skip: realDesktop }, (t) => {+ const yes = desktopInstaller(t, { running: true });+ const result = yes.run(["--harness", "dsh-desktop", "--lang", "en", "--yes", "--url", "http://127.0.0.1:9", "--api-key", ""]);+ assert.equal(result.status, 0, `${result.stdout}\n${result.stderr}`);+ assert.match(result.stdout, /DeepSeek Harness Desktop is running; installing anyway\. Quit it with ⌘Q/);+ assert.match(yes.log(), /^plugin --profile desktop add /m);++ // Interactive: asked to quit, still running after Enter, so nothing is added.+ const interactiveFlow = `INTERACTIVE=1+exec 3</dev/null+tui_menu() { TUI_MENU_CHOICE="$2"; }+DSH_DESKTOP_QUIT_WAIT=1+${mainMarker}`;+ const asked = desktopInstaller(t, { running: true }, (source) => source.replace(mainMarker, interactiveFlow));+ const interactive = asked.run(["--harness", "dsh-desktop", "--lang", "en", "--url", "http://127.0.0.1:9", "--api-key", ""]);+ assert.equal(interactive.status, 0, `${interactive.stdout}\n${interactive.stderr}`);+ assert.match(interactive.stdout, /Quit it with ⌘Q, then press Enter:/);+ assert.match(interactive.stdout, /Waiting for DeepSeek Harness Desktop to exit/);+ assert.match(interactive.stdout, /still running; it was not changed/);+ assert.doesNotMatch(asked.log(), /\badd\b/);+ assert.match(interactive.stdout, /Next: open DeepSeek Harness Desktop: Plugins → Add plugin/);++ // Quitting shuts the Host down first, so Desktop may outlive the Enter by a+ // few seconds: the installer waits for it rather than giving up.+ const quitting = desktopInstaller(t, { running: 2 }, (source) => source.replace(mainMarker, interactiveFlow));+ const waited = quitting.run(["--harness", "dsh-desktop", "--lang", "en", "--url", "http://127.0.0.1:9", "--api-key", ""]);+ assert.equal(waited.status, 0, `${waited.stdout}\n${waited.stderr}`);+ assert.match(waited.stdout, /Waiting for DeepSeek Harness Desktop to exit/);+ assert.doesNotMatch(waited.stdout, /still running/);+ assert.match(quitting.log(), /^plugin --profile desktop add /m);+});++test("a failed Desktop add shows the launcher's own error", { skip: realDesktop }, (t) => {+ const { launcher, run } = desktopInstaller(t, { failAdd: true });++ const result = run(["--harness", "dsh-desktop", "--lang", "en", "--yes", "--url", "http://127.0.0.1:9", "--api-key", ""]);++ assert.equal(result.status, 0, `${result.stdout}\n${result.stderr}`);+ assert.match(result.stdout, /dsh plugin add failed for DeepSeek Harness Desktop:\n {6}ERR_PNPM_FETCH_404/);+ assert.ok(result.stdout.includes(`run it manually: "${launcher}" plugin --profile desktop add @openviking/dsh-memory-plugin@latest`), result.stdout);+ assert.match(result.stdout, /Plugins → Add plugin → enter @openviking\/dsh-memory-plugin → Install/);+});++test("without Node.js, a Mac with Desktop is told how to install from its Plugins page", { skip: realDesktop }, (t) => {+ const { log, run } = desktopInstaller(t, {}, (source) => source.replace("command -v node >/dev/null 2>&1 || {", "false || {"));++ const result = run(["--harness", "dsh-desktop", "--lang", "en", "--yes"]);++ assert.equal(result.status, 1, `${result.stdout}\n${result.stderr}`);+ assert.match(result.stderr, /node not found/);+ assert.match(result.stdout, /Plugins → Add plugin → enter @openviking\/dsh-memory-plugin → Install, then turn it on if its switch is off/);+ assert.match(result.stdout, /ovcli\.conf: \{"url": "<server-url>", "api_key": "<api-key>"\}/);+ assert.equal(log(), "");+});diff --git a/examples/memory-plugin-shared/install.sh b/examples/memory-plugin-shared/install.shindex b3322ab74..b36cef715 100644--- a/examples/memory-plugin-shared/install.sh+++ b/examples/memory-plugin-shared/install.sh@@ -2,7 +2,7 @@## OpenViking Memory Plugin shared installer for Claude Code, Codex, Cursor,# TRAE / TRAE CN, TraeCode CLI 2.0, ZCode, Kimi Code, CodeBuddy Code,-# OpenCode, pi and DeepSeek Harness (dsh).+# OpenCode, pi, DeepSeek Harness (dsh) and DeepSeek Harness Desktop.## In short:# - Open source. This script and every OpenViking file it installs are@@ -48,7 +48,7 @@# the API key.# The npm registry npm is configured with: the CLI (@openviking/cli and its# binary for this platform), pi's dependencies (npm ci) and the dsh-# package (dsh plugin add).+# package (dsh plugin add, for DeepSeek Harness Desktop too).# docs.openviking.ai is hosted on GitHub Pages. The script itself never# contacts github.com and never runs git.#@@ -68,6 +68,8 @@# opencode ~/.config/opencode/plugins/openviking, openviking.js, opencode.json(c)# pi ~/.pi/agent/extensions/openviking# dsh dsh plugin add into the chosen profile+# dsh-desktop (macOS) dsh plugin add into Desktop's profile, with the dsh+# command inside DeepSeek Harness.app, while Desktop is quit# cli npm install -g @openviking/cli: ov in npm's global bin directory,# or in ~/.local/bin when that needs sudo# Cursor, TRAE, TRAE CN and ZCode run their hooks from@@ -155,6 +157,13 @@ CODEX_BINS_ARG="${OPENVIKING_CODEX_BINS:-${OPENVIKING_CODEX_BIN:-}}"DSH_PROFILE_ARG="${OPENVIKING_DSH_PROFILE:-}"DSH_PROFILE_DEFAULT="web"DSH_PROFILE=""+# DeepSeek Harness Desktop keeps its own profile, which only the dsh command+# inside its app bundle may change (npm dsh refuses it), and no dsh can boot it.+DSH_DESKTOP_APP="DeepSeek Harness.app"+DSH_DESKTOP_LAUNCHER="Contents/Resources/runtime/cli/bin/dsh"+DSH_DESKTOP_CLI="" # Desktop's dsh command; set by select_dsh_profile+DSH_DESKTOP_INSTALLED=0 # 1 once its plugin add succeeded+DSH_DESKTOP_QUIT_WAIT=20 # seconds a quit Desktop gets to shut its Host downSOURCE_ARG=""DIST_ARG=""LANG_ARG=""@@ -226,12 +235,13 @@ usage() {Usage: install.sh [options]Options:- --harness LIST Comma-separated harnesses: claude, codex, cursor, trae, trae-cn, trae-cli, zcode, kimicode, codebuddy, opencode, pi, dsh, cli.+ --harness LIST Comma-separated harnesses: claude, codex, cursor, trae, trae-cn, trae-cli, zcode, kimicode, codebuddy, opencode, pi, dsh, dsh-desktop, cli.Use trae-cli for TraeCode CLI 2.0 (installed through its Codex-compatible plugin format).+ dsh is the dsh CLI from npm; dsh-desktop is DeepSeek Harness Desktop (macOS only).cli is the OpenViking CLI (ov), installed from npm. Without --harness: the detected ones and cli.--claude-bin LIST Comma-separated Claude-format CLI commands (default: claude).--codex-bin LIST Comma-separated Codex-format CLI commands (default: codex).- --dsh-profile NAME DeepSeek Harness profile to install into (default: web).+ --dsh-profile NAME DeepSeek Harness profile to install into (default: web). desktop selects dsh-desktop instead.--lang LANG en | zh (default: asked first, with the system locale preselected;with --yes or no terminal, the system locale).--source MODE Advanced: archive (the OpenViking release) | dev (this checkout's plugins).@@ -245,7 +255,7 @@ Options:--no-statusline Skip the statusline prompt.--uninstall Remove the Cursor, TRAE, TRAE CN, ZCode, Kimi Code and CodeBuddy Code integrations,plus any legacy TraeCode CLI hook config. Claude Code, Codex, OpenCode,- pi and dsh are removed with the commands the install prints at the end.+ pi, dsh and dsh-desktop are removed with the commands the install prints at the end.--yes, -y Ask nothing: use defaults and install without asking for confirmation.Environment:@@ -255,6 +265,9 @@ Environment:OPENVIKING_CLAUDE_BINS Same as --claude-bin.OPENVIKING_CODEX_BINS Same as --codex-bin.OPENVIKING_DSH_PROFILE Same as --dsh-profile.+ OPENVIKING_DSH_DESKTOP_CLI The dsh command inside DeepSeek Harness.app to use for dsh-desktop+ (default: found under /Applications, ~/Applications or on PATH).+ DSH_HOME DeepSeek Harness home holding Desktop's profile (default: ~/.dsh).OPENVIKING_DOWNLOAD_BASE Download locations, separated by spaces; the first to answer is used(default: https://docs.openviking.net/dl https://docs.openviking.ai/dl).OPENVIKING_TOS_BASE is read as well.@@ -499,8 +512,58 @@ EOFreturn 1}+dsh_home() { printf '%s' "${DSH_HOME:-$HOME/.dsh}"; }++follow_symlinks() { # follow_symlinks <path> -> the file it finally points at+ local path="$1" dir target hops=0+ while [ -L "$path" ] && [ "$hops" -lt 40 ]; do+ dir="$(cd "$(dirname "$path")" && pwd -P)" || break+ target="$(readlink "$path")" || break+ case "$target" in+ /*) path="$target" ;;+ *) path="$dir/$target" ;;+ esac+ hops=$((hops + 1))+ done+ printf '%s' "$path"+}++# Desktop's "Manage dsh Command…" links /usr/local/bin/dsh to the launcher in+# its app bundle. That dsh is Desktop, not the npm CLI: what it adds to the+# CLI's profiles never reaches Desktop.+is_dsh_desktop_launcher() { # is_dsh_desktop_launcher <path>+ case "$(follow_symlinks "$1")" in+ *.app/"$DSH_DESKTOP_LAUNCHER") return 0 ;;+ esac+ return 1+}++have_npm_dsh() {+ local found+ found="$(command -v dsh 2>/dev/null)" || return 1+ ! is_dsh_desktop_launcher "$found"+}++# The launcher works from its absolute path, so registering it on PATH is+# optional. Desktop ships for macOS and Windows only.+resolve_dsh_desktop_cli() {+ [ "$DSH_DESKTOP_OFFERED" -eq 1 ] || return 1+ local candidate+ for candidate in "${OPENVIKING_DSH_DESKTOP_CLI:-}" \+ "/Applications/$DSH_DESKTOP_APP/$DSH_DESKTOP_LAUNCHER" \+ "$HOME/Applications/$DSH_DESKTOP_APP/$DSH_DESKTOP_LAUNCHER"; do+ if [ -n "$candidate" ] && [ -x "$candidate" ]; then+ printf '%s' "$candidate"+ return 0+ fi+ done+ candidate="$(command -v dsh 2>/dev/null)" || return 1+ is_dsh_desktop_launcher "$candidate" || return 1+ printf '%s' "$candidate"+}+refresh_available_harnesses() {- HAVE_CLAUDE=0; HAVE_CODEX=0; HAVE_CURSOR=0; HAVE_TRAE=0; HAVE_TRAE_CN=0; HAVE_TRAE_CLI=0; HAVE_OPENCODE=0; HAVE_PI=0; HAVE_ZCODE=0; HAVE_KIMICODE=0; HAVE_CODEBUDDY=0; HAVE_DSH=0+ HAVE_CLAUDE=0; HAVE_CODEX=0; HAVE_CURSOR=0; HAVE_TRAE=0; HAVE_TRAE_CN=0; HAVE_TRAE_CLI=0; HAVE_OPENCODE=0; HAVE_PI=0; HAVE_ZCODE=0; HAVE_KIMICODE=0; HAVE_CODEBUDDY=0; HAVE_DSH=0; HAVE_DSH_DESKTOP=0has_available_bin "$CLAUDE_BINS" && HAVE_CLAUDE=1has_available_bin "$CODEX_BINS" && HAVE_CODEX=1{ command -v cursor >/dev/null 2>&1 || command -v cursor-agent >/dev/null 2>&1 || [ -d "/Applications/Cursor.app" ] || [ -d "$HOME/.cursor" ]; } && HAVE_CURSOR=1@@ -509,7 +572,8 @@ refresh_available_harnesses() {{ command -v trae-cli >/dev/null 2>&1 || command -v traecli >/dev/null 2>&1 || command -v traex >/dev/null 2>&1; } && HAVE_TRAE_CLI=1command -v opencode >/dev/null 2>&1 && HAVE_OPENCODE=1command -v pi >/dev/null 2>&1 && HAVE_PI=1- command -v dsh >/dev/null 2>&1 && HAVE_DSH=1+ have_npm_dsh && HAVE_DSH=1+ { resolve_dsh_desktop_cli >/dev/null || { [ "$DSH_DESKTOP_OFFERED" -eq 1 ] && [ -d "$(dsh_home)/profiles/desktop" ]; }; } && HAVE_DSH_DESKTOP=1{ command -v zcode >/dev/null 2>&1 || [ -d "$HOME/.zcode" ]; } && HAVE_ZCODE=1{ command -v kimi >/dev/null 2>&1 || [ -d "$HOME/.kimi-code" ]; } && HAVE_KIMICODE=1{ command -v codebuddy >/dev/null 2>&1 || [ -d "$HOME/.codebuddy" ]; } && HAVE_CODEBUDDY=1@@ -637,7 +701,11 @@ NODECLAUDE_BINS="$(normalize_bin_list "$CLAUDE_BINS_ARG" claude)"CODEX_BINS="$(normalize_bin_list "$CODEX_BINS_ARG" codex)"-HAVE_CLAUDE=0; HAVE_CODEX=0; HAVE_CURSOR=0; HAVE_TRAE=0; HAVE_TRAE_CN=0; HAVE_TRAE_CLI=0; HAVE_OPENCODE=0; HAVE_PI=0; HAVE_ZCODE=0; HAVE_DSH=0+HAVE_CLAUDE=0; HAVE_CODEX=0; HAVE_CURSOR=0; HAVE_TRAE=0; HAVE_TRAE_CN=0; HAVE_TRAE_CLI=0; HAVE_OPENCODE=0; HAVE_PI=0; HAVE_ZCODE=0; HAVE_DSH=0; HAVE_DSH_DESKTOP=0+# DeepSeek Harness Desktop is released for macOS and Windows; of the systems+# this script runs on, only macOS ever offers it.+DSH_DESKTOP_OFFERED=0+[ "$(uname -s)" != "Darwin" ] || DSH_DESKTOP_OFFERED=1refresh_available_harnessesTUI_CLAUDE_BINS="$CLAUDE_BINS"@@ -649,6 +717,7 @@ SEL_CODEX_BINS=""SEL_OPENCODE=0SEL_PI=0SEL_DSH=0+SEL_DSH_DESKTOP=0SEL_CURSOR_APP=0SEL_TRAE=0SEL_TRAE_CN=0@@ -669,7 +738,7 @@ EOF}tui_selectable_count() {- printf '%s' $(( $(list_count "$TUI_CLAUDE_BINS") + $(list_count "$TUI_CODEX_BINS") + 10 ))+ printf '%s' $(( $(list_count "$TUI_CLAUDE_BINS") + $(list_count "$TUI_CODEX_BINS") + 10 + DSH_DESKTOP_OFFERED ))}tui_total_count() {@@ -698,6 +767,10 @@ EOFi=$((i + 1))if [ "$i" -eq "$idx" ]; then printf 'dsh|dsh'; return 0; fii=$((i + 1))+ if [ "$DSH_DESKTOP_OFFERED" -eq 1 ]; then+ if [ "$i" -eq "$idx" ]; then printf 'dsh-desktop|dsh-desktop'; return 0; fi+ i=$((i + 1))+ fiif [ "$i" -eq "$idx" ]; then printf 'cursor|cursor'; return 0; fii=$((i + 1))if [ "$i" -eq "$idx" ]; then printf 'trae|trae'; return 0; fi@@ -739,6 +812,7 @@ tui_bin_label() {opencode:*) printf 'OpenCode' ;;pi:*) printf 'pi' ;;dsh:*) printf 'DeepSeek Harness' ;;+ dsh-desktop:*) printf 'DeepSeek Harness Desktop' ;;cursor:*) printf 'Cursor' ;;trae:*) printf 'TRAE' ;;trae-cn:*) printf 'TRAE CN' ;;@@ -763,6 +837,8 @@ tui_bin_selected() {[ "$SEL_PI" -eq 1 ]elif [ "$kind" = "dsh" ]; then[ "$SEL_DSH" -eq 1 ]+ elif [ "$kind" = "dsh-desktop" ]; then+ [ "$SEL_DSH_DESKTOP" -eq 1 ]elif [ "$kind" = "cursor" ]; then[ "$SEL_CURSOR_APP" -eq 1 ]elif [ "$kind" = "trae" ]; then@@ -790,6 +866,8 @@ tui_bin_detected() { # tui_bin_detected <kind> <bin>zcode) [ "$HAVE_ZCODE" -eq 1 ] ;;kimicode) [ "$HAVE_KIMICODE" -eq 1 ] ;;codebuddy) [ "$HAVE_CODEBUDDY" -eq 1 ] ;;+ dsh) [ "$HAVE_DSH" -eq 1 ] ;;+ dsh-desktop) [ "$HAVE_DSH_DESKTOP" -eq 1 ] ;;*) command -v "$2" >/dev/null 2>&1 ;;esac}@@ -800,6 +878,7 @@ tui_set_all_bins() {SEL_OPENCODE=1SEL_PI=1SEL_DSH=1+ SEL_DSH_DESKTOP="$DSH_DESKTOP_OFFERED"SEL_CURSOR_APP=1SEL_TRAE=1SEL_TRAE_CN=1@@ -824,6 +903,8 @@ tui_toggle_bin() {elif [ "$kind" = "dsh" ]; thenSEL_DSH=$((1 - SEL_DSH))return 0+ elif [ "$kind" = "dsh-desktop" ]; then+ SEL_DSH_DESKTOP=$((1 - SEL_DSH_DESKTOP)); return 0elif [ "$kind" = "cursor" ]; thenSEL_CURSOR_APP=$((1 - SEL_CURSOR_APP)); return 0elif [ "$kind" = "trae" ]; then@@ -915,6 +996,7 @@ tui_reset_bin_selection() {SEL_OPENCODE=0SEL_PI=0SEL_DSH=0+ SEL_DSH_DESKTOP=0SEL_CURSOR_APP=0SEL_TRAE=0SEL_TRAE_CN=0@@ -942,7 +1024,8 @@ $TUI_CODEX_BINSEOFif command -v opencode >/dev/null 2>&1; then SEL_OPENCODE=1; any=1; fiif command -v pi >/dev/null 2>&1; then SEL_PI=1; any=1; fi- if command -v dsh >/dev/null 2>&1; then SEL_DSH=1; any=1; fi+ if [ "$HAVE_DSH" -eq 1 ]; then SEL_DSH=1; any=1; fi+ if [ "$HAVE_DSH_DESKTOP" -eq 1 ]; then SEL_DSH_DESKTOP=1; any=1; fiif [ "$HAVE_CURSOR" -eq 1 ]; then SEL_CURSOR_APP=1; any=1; fiif [ "$HAVE_TRAE" -eq 1 ]; then SEL_TRAE=1; any=1; fiif [ "$HAVE_TRAE_CN" -eq 1 ]; then SEL_TRAE_CN=1; any=1; fi@@ -1035,7 +1118,7 @@ tui_add_compatible_cli() {tui_has_selection() {[ -n "$(list_words "$SEL_CLAUDE_BINS")" ] || [ -n "$(list_words "$SEL_CODEX_BINS")" ] \- || [ "$SEL_OPENCODE" -eq 1 ] || [ "$SEL_PI" -eq 1 ] || [ "$SEL_DSH" -eq 1 ] || [ "$SEL_CURSOR_APP" -eq 1 ] \+ || [ "$SEL_OPENCODE" -eq 1 ] || [ "$SEL_PI" -eq 1 ] || [ "$SEL_DSH" -eq 1 ] || [ "$SEL_DSH_DESKTOP" -eq 1 ] || [ "$SEL_CURSOR_APP" -eq 1 ] \|| [ "$SEL_TRAE" -eq 1 ] || [ "$SEL_TRAE_CN" -eq 1 ] || [ "$SEL_ZCODE" -eq 1 ] \|| [ "$SEL_KIMICODE" -eq 1 ] || [ "$SEL_CODEBUDDY" -eq 1 ] || [ "$SEL_CLI" -eq 1 ]}@@ -1049,6 +1132,7 @@ tui_finish_selection() {[ "$SEL_OPENCODE" -eq 1 ] && SELECTED_HARNESSES="${SELECTED_HARNESSES:+$SELECTED_HARNESSES,}opencode"[ "$SEL_PI" -eq 1 ] && SELECTED_HARNESSES="${SELECTED_HARNESSES:+$SELECTED_HARNESSES,}pi"[ "$SEL_DSH" -eq 1 ] && SELECTED_HARNESSES="${SELECTED_HARNESSES:+$SELECTED_HARNESSES,}dsh"+ [ "$SEL_DSH_DESKTOP" -eq 1 ] && SELECTED_HARNESSES="${SELECTED_HARNESSES:+$SELECTED_HARNESSES,}dsh-desktop"[ "$SEL_CURSOR_APP" -eq 1 ] && SELECTED_HARNESSES="${SELECTED_HARNESSES:+$SELECTED_HARNESSES,}cursor"[ "$SEL_TRAE" -eq 1 ] && SELECTED_HARNESSES="${SELECTED_HARNESSES:+$SELECTED_HARNESSES,}trae"[ "$SEL_TRAE_CN" -eq 1 ] && SELECTED_HARNESSES="${SELECTED_HARNESSES:+$SELECTED_HARNESSES,}trae-cn"@@ -1127,6 +1211,7 @@ select_harnesses() {[ "$HAVE_OPENCODE" -eq 1 ] && detected="${detected:+$detected,}opencode"[ "$HAVE_PI" -eq 1 ] && detected="${detected:+$detected,}pi"[ "$HAVE_DSH" -eq 1 ] && detected="${detected:+$detected,}dsh"+ [ "$HAVE_DSH_DESKTOP" -eq 1 ] && detected="${detected:+$detected,}dsh-desktop"[ "$HAVE_ZCODE" -eq 1 ] && detected="${detected:+$detected,}zcode"[ "$HAVE_KIMICODE" -eq 1 ] && detected="${detected:+$detected,}kimicode"[ "$HAVE_CODEBUDDY" -eq 1 ] && detected="${detected:+$detected,}codebuddy"@@ -1150,7 +1235,31 @@ select_harnesses() {fi}+route_dsh_to_desktop() { # route_dsh_to_desktop <harness-list> -> the list with dsh-desktop for dsh+ local h out=""+ while IFS= read -r h; do+ [ -n "$h" ] || continue+ if [ "$h" = "dsh" ]; then h="dsh-desktop"; fi+ case ",$out," in+ *",$h,"*) ;;+ *) out="${out:+$out,}$h" ;;+ esac+ done <<EOF+$(split_harnesses "$1")+EOF+ printf '%s' "$out"+}+select_dsh_profile() {+ # npm dsh refuses Desktop's profile, so `--dsh-profile desktop` means the+ # dsh-desktop harness, which goes through Desktop's own dsh command.+ if [ "$DSH_PROFILE_ARG" = "desktop" ] && contains_harness dsh; then+ SELECTED_HARNESSES="$(route_dsh_to_desktop "$SELECTED_HARNESSES")"+ [ -z "$PUBLIC_SELECTED_HARNESSES" ] || PUBLIC_SELECTED_HARNESSES="$(route_dsh_to_desktop "$PUBLIC_SELECTED_HARNESSES")"+ fi+ if contains_harness dsh-desktop; then+ DSH_DESKTOP_CLI="$(resolve_dsh_desktop_cli || true)"+ ficontains_harness dsh || return 0if [ -n "$DSH_PROFILE_ARG" ]; thenDSH_PROFILE="$DSH_PROFILE_ARG"@@ -1159,38 +1268,123 @@ select_dsh_profile() {DSH_PROFILE="$DSH_PROFILE_DEFAULT"}-install_dsh() {- step_heading "$(t 'DeepSeek Harness bundle' 'DeepSeek Harness 插件')"- if ! command -v dsh >/dev/null 2>&1; then- warn "$(t 'dsh CLI not found; skipping DeepSeek Harness install.' '未找到 dsh 命令,跳过 DeepSeek Harness 安装。')"- return 0- fi+# Sets DSH_SPEC and DSH_ORIGIN to what `<command> plugin add` installs.+dsh_select_spec() { # dsh_select_spec <dsh-command> <profile>+ local cmd="$1" profile="$2" local_dir packed# `@latest` rather than a bare name: pnpm keeps an already-satisfying install# when the name carries no version, so a profile holding a dev build would# never fall back to the published package.- local profile="${DSH_PROFILE:-$DSH_PROFILE_DEFAULT}" spec="$DSH_PACKAGE@latest" origin="npm" local_dir+ DSH_SPEC="$DSH_PACKAGE@latest"+ DSH_ORIGIN="npm"# npm is the bundle's only distribution channel; only dev mode installs# something other than the published package. It still has to arrive as a# real package rather than a link: a linked source tree resolves its dsh# peers from its own realpath and misses the profile's hoisted node_modules,# so the checkout gets packed first.if [ "$SOURCE_MODE" = "dev" ] && ensure_bundle && local_dir="$(plugin_dir_on_disk dsh-memory-plugin)"; then- local packedif packed="$(dsh_pack_local "$local_dir")"; then- spec="$packed"- origin="$local_dir"+ DSH_SPEC="$packed"+ DSH_ORIGIN="$local_dir"# A dev re-install usually carries the same version, and pnpm treats an# already-satisfied version as a no-op no matter which tarball it is# pointed at, so the edited sources would never reach the profile.# Dropping the package first forces the reinstall. Only done for local# sources: it is a downgrade in robustness when `add` can fail on network.- dsh plugin --profile "$profile" rm "$DSH_PACKAGE" >/dev/null 2>&1 || true+ "$cmd" plugin --profile "$profile" rm "$DSH_PACKAGE" >/dev/null 2>&1 || truefifi- if dsh plugin --profile "$profile" add "$spec" >/dev/null 2>&1; then- info "$(t 'DeepSeek Harness bundle installed into profile:' 'DeepSeek Harness 插件已安装到 profile:') $profile ($(t 'source' '来源'): $origin)"+}++install_dsh() {+ step_heading "$(t 'DeepSeek Harness bundle' 'DeepSeek Harness 插件')"+ if ! have_npm_dsh; then+ if command -v dsh >/dev/null 2>&1; then+ warn "$(t 'The dsh on PATH is the one inside DeepSeek Harness Desktop, not the npm dsh CLI; skipping DeepSeek Harness install (use --harness dsh-desktop for Desktop).' 'PATH 中的 dsh 是 DeepSeek Harness Desktop 自带的,不是 npm 安装的 dsh CLI,跳过 DeepSeek Harness 安装(Desktop 请用 --harness dsh-desktop)。')"+ else+ warn "$(t 'dsh CLI not found; skipping DeepSeek Harness install.' '未找到 dsh 命令,跳过 DeepSeek Harness 安装。')"+ fi+ return 0+ fi+ local profile="${DSH_PROFILE:-$DSH_PROFILE_DEFAULT}"+ dsh_select_spec dsh "$profile"+ if dsh plugin --profile "$profile" add "$DSH_SPEC" >/dev/null 2>&1; then+ info "$(t 'DeepSeek Harness bundle installed into profile:' 'DeepSeek Harness 插件已安装到 profile:') $profile ($(t 'source' '来源'): $DSH_ORIGIN)"else- warn "$(t 'dsh plugin add failed; run it manually:' 'dsh plugin add 失败;请手动执行:') dsh plugin --profile $profile add $spec"+ warn "$(t 'dsh plugin add failed; run it manually:' 'dsh plugin add 失败;请手动执行:') dsh plugin --profile $profile add $DSH_SPEC"+ fi+}++# Desktop creates its profile on first launch; its dsh refuses to run before.+dsh_desktop_initialized() { [ -f "$(dsh_home)/profiles/desktop/package.json" ]; }++# Closing Desktop's window only hides it. The main process runs the app's+# executable with no arguments (older macOS adds -psn_*); its Host and any dsh+# command pass some. Only this user's Desktop counts.+dsh_desktop_running() {+ if command -v pgrep >/dev/null 2>&1; then+ pgrep -u "$(id -u)" -f "DeepSeek Harness\.app/Contents/MacOS/DeepSeek Harness( -psn_[0-9_]+)?\$" >/dev/null 2>&1+ elif command -v osascript >/dev/null 2>&1; then+ [ "$(osascript -e 'application "DeepSeek Harness" is running' 2>/dev/null)" = "true" ]+ else+ return 1+ fi+}++# Desktop does not lock its profile against the dsh command, and only loads+# a change when it starts, so it should be quit first. Fails when it is still+# running after the user was asked to quit it.+dsh_desktop_quit_first() {+ local reply waited=0+ dsh_desktop_running || return 0+ if [ "$INTERACTIVE" -ne 1 ]; then+ warn "$(t 'DeepSeek Harness Desktop is running; installing anyway. Quit it with ⌘Q (closing the window only hides it) and reopen it to load the plugin.' 'DeepSeek Harness Desktop 正在运行,仍继续安装。请用 ⌘Q 退出(关闭窗口只是隐藏)后重新打开,插件才会加载。')"+ return 0+ fi+ warn "$(t 'DeepSeek Harness Desktop is running. Closing its window only hides it.' 'DeepSeek Harness Desktop 正在运行。关闭窗口只是隐藏它。')"+ ask "$(t 'Quit it with ⌘Q, then press Enter: ' '请用 ⌘Q 退出后按回车:')"+ read_tty reply+ # Quitting first shuts its Host down, which may take it a few seconds.+ while dsh_desktop_running && [ "$waited" -lt "$DSH_DESKTOP_QUIT_WAIT" ]; do+ [ "$waited" -gt 0 ] || info "$(t 'Waiting for DeepSeek Harness Desktop to exit...' '等待 DeepSeek Harness Desktop 退出…')"+ sleep 1+ waited=$((waited + 1))+ done+ dsh_desktop_running || return 0+ warn "$(t 'DeepSeek Harness Desktop is still running; it was not changed.' 'DeepSeek Harness Desktop 仍在运行,未做修改。')"+ return 1+}++dsh_desktop_plugins_page_steps() {+ info "$(t 'Install it from DeepSeek Harness Desktop instead: Plugins → Add plugin → enter' '也可以在 DeepSeek Harness Desktop 中安装:插件 → 添加插件 → 输入') $DSH_PACKAGE → $(t 'Install, then turn it on if its switch is off' '安装,开关未打开时再打开')"+}++install_dsh_desktop() {+ step_heading "$(t 'DeepSeek Harness Desktop bundle' 'DeepSeek Harness Desktop 插件')"+ local cli="$DSH_DESKTOP_CLI" output+ if [ -z "$cli" ]; then+ warn "$(t "The dsh command inside $DSH_DESKTOP_APP was not found (set OPENVIKING_DSH_DESKTOP_CLI to it)." "未找到 $DSH_DESKTOP_APP 中的 dsh 命令(可用 OPENVIKING_DSH_DESKTOP_CLI 指定)。")"+ dsh_desktop_plugins_page_steps+ return 0+ fi+ if ! dsh_desktop_initialized; then+ warn "$(t 'DeepSeek Harness Desktop has not set up its profile yet: open it once, quit it with ⌘Q and re-run this installer.' 'DeepSeek Harness Desktop 尚未初始化其 profile:请先打开一次,用 ⌘Q 退出后重新运行本安装脚本。') ($(t 'not found:' '未找到:') $(short_path "$(dsh_home)/profiles/desktop/package.json"))"+ dsh_desktop_plugins_page_steps+ return 0+ fi+ if ! dsh_desktop_quit_first; then+ dsh_desktop_plugins_page_steps+ return 0+ fi+ dsh_select_spec "$cli" desktop+ if output="$("$cli" plugin --profile desktop add "$DSH_SPEC" 2>&1)"; then+ DSH_DESKTOP_INSTALLED=1+ info "$(t 'DeepSeek Harness Desktop bundle installed' 'DeepSeek Harness Desktop 插件已安装') ($(t 'source' '来源'): $DSH_ORIGIN)"+ info "$(t 'Reopen DeepSeek Harness Desktop to load it.' '重新打开 DeepSeek Harness Desktop 后生效。')"+ else+ warn "$(t 'dsh plugin add failed for DeepSeek Harness Desktop:' 'DeepSeek Harness Desktop 的 dsh plugin add 失败:')"+ printf '%s\n' "$output" | tail -n 5 | sed 's/^/ /'+ warn "$(t 'With Desktop quit, run it manually:' '退出 Desktop 后手动执行:') \"$cli\" plugin --profile desktop add $DSH_SPEC"+ dsh_desktop_plugins_page_stepsfi}@@ -1280,6 +1474,11 @@ validate_selected_harnesses() {while IFS= read -r h; docase "$h" inclaude|codex|cursor|trae|trae-cn|opencode|pi|zcode|kimicode|codebuddy|dsh|cli) ;;+ dsh-desktop)+ [ "$DSH_DESKTOP_OFFERED" -eq 1 ] || {+ err "$(t 'DeepSeek Harness Desktop (dsh-desktop) is installed by this script on macOS only; on Windows, add the plugin from its Plugins page.' '本脚本仅在 macOS 上安装 DeepSeek Harness Desktop(dsh-desktop);Windows 上请在其“插件”页添加。')"+ bad=1+ } ;;trae-cli) [ "$UNINSTALL" -eq 1 ] || bad=1 ;;*) err "Unsupported harness: $h"; bad=1 ;;esac@@ -1317,7 +1516,9 @@ EOFfiif contains_harness opencode && command -v opencode >/dev/null 2>&1; then ok=1; fiif contains_harness pi && command -v pi >/dev/null 2>&1; then ok=1; fi- if contains_harness dsh && command -v dsh >/dev/null 2>&1; then ok=1; fi+ if contains_harness dsh && have_npm_dsh; then ok=1; fi+ # Without its dsh command, Desktop still gets the steps for its Plugins page.+ if contains_harness dsh-desktop; then ok=1; fiif contains_harness cli; then ok=1; fi# Cursor and TRAE are config-driven integrations. They may be installed# before the desktop app itself, so a CLI in PATH is not required.@@ -1633,12 +1834,15 @@ reexec_release_installer() { # reexec_release_installer <original-args...>}# The names the release resolver knows: a Codex-format CLI counts as the-# TraeCode CLI when it is one, otherwise as Codex.+# TraeCode CLI when it is one, otherwise as Codex, and Desktop installs the+# same dsh package.resolver_harnesses() {local h bin out=""while IFS= read -r h; do[ -n "$h" ] && [ "$h" != "cli" ] || continue- if [ "$h" = "codex" ]; then+ if [ "$h" = "dsh-desktop" ]; then+ out="$(append_csv_list "$out" dsh)"+ elif [ "$h" = "codex" ]; thenwhile IFS= read -r bin; do[ -n "$bin" ] || continuecase "$(bin_basename "$bin")" in@@ -3135,7 +3339,7 @@ EOFnode --check "$HOME/.pi/agent/extensions/openviking/shared/mcp-proxy-config.mjs" || ok=0fifi- if contains_harness dsh && command -v dsh >/dev/null 2>&1; then+ if contains_harness dsh && have_npm_dsh; thenlocal dsh_profile="${DSH_PROFILE:-$DSH_PROFILE_DEFAULT}"if dsh plugin --profile "$dsh_profile" ls 2>/dev/null | grep -q "$DSH_PACKAGE"; theninfo "dsh: $DSH_PACKAGE $(t 'installed in profile' '已安装到 profile') $dsh_profile"@@ -3150,6 +3354,25 @@ EOFok=0fifi+ if contains_harness dsh-desktop && [ "$DSH_DESKTOP_INSTALLED" -eq 1 ]; then+ if str_contains "$("$DSH_DESKTOP_CLI" plugin --profile desktop ls 2>/dev/null || true)" "$DSH_PACKAGE"; then+ info "dsh-desktop: $DSH_PACKAGE $(t 'installed in DeepSeek Harness Desktop' '已安装到 DeepSeek Harness Desktop')"+ else+ warn "dsh-desktop: $DSH_PACKAGE $(t 'not found in DeepSeek Harness Desktop' '未在 DeepSeek Harness Desktop 中找到')"+ ok=0+ fi+ # No dsh boots Desktop's profile, so there is no --dump-config to read;+ # Desktop loads the bundles its profile manifest lists.+ if "$NODE_BIN" -e '+ const m = JSON.parse(require("node:fs").readFileSync(process.argv[1], "utf8"));+ process.exit((m.dsh?.profile?.bundles ?? []).includes(process.argv[2]) ? 0 : 1);+ ' "$(dsh_home)/profiles/desktop/package.json" "$DSH_PACKAGE" 2>/dev/null; then+ info "dsh-desktop: $(t 'plugin enabled in the Desktop profile' '插件已在 Desktop profile 中启用')"+ else+ warn "dsh-desktop: $(t 'plugin not enabled in the Desktop profile; enable it on the Plugins page' 'Desktop profile 中未启用该插件;请在“插件”页启用')"+ ok=0+ fi+ fiif [ -n "$MKT_DIR" ] && [ -f "$MKT_DIR/claude-code-memory-plugin/scripts/marketplace.test.mjs" ] && [ -d "$MKT_DIR/../.git" ]; thennode --test "$MKT_DIR/claude-code-memory-plugin/scripts/marketplace.test.mjs" \"$MKT_DIR/codex-memory-plugin/scripts/marketplace.test.mjs" || ok=0@@ -3237,7 +3460,7 @@ count_steps() {STEP_TOTAL=3if contains_harness claude; then STEP_TOTAL=$((STEP_TOTAL + $(list_count "$CLAUDE_BINS"))); fiif contains_harness codex; then STEP_TOTAL=$((STEP_TOTAL + $(list_count "$CODEX_BINS"))); fi- for h in cursor trae trae-cn zcode kimicode codebuddy opencode pi dsh cli; do+ for h in cursor trae trae-cn zcode kimicode codebuddy opencode pi dsh dsh-desktop cli; doif contains_harness "$h"; then STEP_TOTAL=$((STEP_TOTAL + 1)); fidone}@@ -3255,6 +3478,7 @@ print_selection() {if [ -n "$TRAECODE_CLI_BIN" ]; then info "TraeCode CLI 2.0: $TRAECODE_CLI_BIN"; fiif contains_harness codex && [ -z "$TRAECODE_CLI_BIN" ]; then info "$(t 'Codex-format commands:' 'Codex 格式命令:') $(list_words "$CODEX_BINS")"; fiif contains_harness dsh; then info "$(t 'DeepSeek Harness profile:' 'DeepSeek Harness profile:') ${DSH_PROFILE:-$DSH_PROFILE_DEFAULT}"; fi+ if contains_harness dsh-desktop && [ -n "$DSH_DESKTOP_CLI" ]; then info "$(t 'DeepSeek Harness Desktop command:' 'DeepSeek Harness Desktop 命令:') $(short_path "$DSH_DESKTOP_CLI")"; fi}plan_item() { printf ' %s\n' "$*"; }@@ -3378,9 +3602,16 @@ EOFif contains_harness pi && command -v pi >/dev/null 2>&1; thenplan_paths pi "$HOME/.pi/agent/extensions/openviking"fi- if contains_harness dsh && command -v dsh >/dev/null 2>&1; then+ if contains_harness dsh && have_npm_dsh; thenplan_item "dsh plugin --profile ${DSH_PROFILE:-$DSH_PROFILE_DEFAULT} add $DSH_PACKAGE@latest"fi+ if contains_harness dsh-desktop; then+ if [ -n "$DSH_DESKTOP_CLI" ] && dsh_desktop_initialized; then+ plan_item "\"$(short_path "$DSH_DESKTOP_CLI")\" plugin --profile desktop add $DSH_PACKAGE@latest ($(t 'DeepSeek Harness Desktop, which must be quit' 'DeepSeek Harness Desktop,需先退出'))"+ else+ plan_item "DeepSeek Harness Desktop: $(t 'nothing; the steps for its Plugins page are printed' '不修改;改为给出其“插件”页的安装步骤')"+ fi+ fiif contains_harness cli && [ -n "$CLI_PREFIX" ]; thenplan_item "npm install -g $CLI_PACKAGE@latest ($(short_path "$CLI_PREFIX/bin/ov"))"if [ ! -f "$CLI_SETTINGS" ]; then@@ -3495,10 +3726,22 @@ EOFif contains_harness pi && command -v pi >/dev/null 2>&1; thennext_steps pi "$(t 'restart pi' '重启 pi')" "$rerun" "" "rm -rf ~/.pi/agent/extensions/openviking"fi- if contains_harness dsh && command -v dsh >/dev/null 2>&1; then+ if contains_harness dsh && have_npm_dsh; thennext_steps "DeepSeek Harness" "$(t 'start a new dsh session' '新开一个 dsh 会话')" "$rerun" "" \"dsh plugin --profile ${DSH_PROFILE:-$DSH_PROFILE_DEFAULT} rm $DSH_PACKAGE"fi+ if contains_harness dsh-desktop && [ "$DSH_DESKTOP_INSTALLED" -eq 1 ]; then+ next_steps "DeepSeek Harness Desktop" \+ "$(t 'quit DeepSeek Harness Desktop with ⌘Q if it is open, reopen it and start a new conversation' '如 DeepSeek Harness Desktop 已打开,用 ⌘Q 退出后重新打开,再新建对话')" \+ "$(t 're-run this installer, or update it on the Plugins page' '重新运行本安装脚本,或在“插件”页更新')" \+ "\"$DSH_DESKTOP_CLI\" plugin --profile desktop ls" \+ "$(t "with Desktop quit, \"$DSH_DESKTOP_CLI\" plugin --profile desktop rm $DSH_PACKAGE; or Plugins page → $DSH_PACKAGE → Uninstall" "退出 Desktop 后运行 \"$DSH_DESKTOP_CLI\" plugin --profile desktop rm $DSH_PACKAGE;或在“插件”页 → $DSH_PACKAGE → 卸载")"+ elif contains_harness dsh-desktop; then+ next_steps "DeepSeek Harness Desktop" \+ "$(t "open DeepSeek Harness Desktop: Plugins → Add plugin → enter $DSH_PACKAGE → Install, then turn it on if its switch is off" "打开 DeepSeek Harness Desktop:插件 → 添加插件 → 输入 $DSH_PACKAGE → 安装,开关未打开时再打开")" \+ "$(t 'on the Plugins page' '在“插件”页')" "" \+ "$(t "Plugins page → $DSH_PACKAGE → Uninstall" "“插件”页 → $DSH_PACKAGE → 卸载")"+ fiif [ "$CLI_INSTALLED" -eq 1 ]; thennext_steps "CLI (ov)" "$(t 'run ov health, which uses the same credentials' '运行 ov health,它使用同一份凭据')" "$rerun" "" \"$(cli_uninstall_command)"@@ -3519,16 +3762,24 @@ case "$(uname -s)" inDarwin|Linux) ;;*) err "Unsupported OS: $(uname -s). Only macOS and Linux are supported."; exit 1 ;;esac-command -v node >/dev/null 2>&1 || { err "$(t 'node not found. Install Node.js 18+.' '未找到 node,请先安装 Node.js 18+。')"; exit 1; }+command -v node >/dev/null 2>&1 || {+ err "$(t 'node not found. Install Node.js 18+.' '未找到 node,请先安装 Node.js 18+。')"+ # Desktop brings its own runtime, so a Mac with only Desktop has no Node.js.+ if [ "$HAVE_DSH_DESKTOP" -eq 1 ]; then+ dsh_desktop_plugins_page_steps+ info "$(t 'Then write the server to' '再把服务写入') $OVCLI_CONF: {\"url\": \"<server-url>\", \"api_key\": \"<api-key>\"}"+ fi+ exit 1+}NODE_BIN="$(command -v node)"NODE_MAJOR="$("$NODE_BIN" -p 'Number(process.versions.node.split(".")[0])')"[ "$NODE_MAJOR" -ge 18 ] || { err "Node.js 18+ required; found $("$NODE_BIN" --version)."; exit 1; }command -v curl >/dev/null 2>&1 || warn "$(t 'curl not found; the server check is skipped and downloads will fail.' '未找到 curl:将跳过服务检查,下载也会失败。')"select_harnesses+select_dsh_profilevalidate_selected_harnessesselect_compatible_bins-select_dsh_profilerefresh_available_harnessesvalidate_selected_binsif [ "$UNINSTALL" -eq 1 ]; then@@ -3576,6 +3827,7 @@ if contains_harness codebuddy; then install_codebuddy; fiif contains_harness opencode; then install_opencode; fiif contains_harness pi; then install_pi; fiif contains_harness dsh; then install_dsh; fi+if contains_harness dsh-desktop; then install_dsh_desktop; fiif contains_harness cli; then install_cli; fivalidate_installprint_next_stepsdiff --git a/examples/memory-plugin-shared/lib/uri-guard.mjs b/examples/memory-plugin-shared/lib/uri-guard.mjsindex bb0f20d1b..d09fdc208 100644--- a/examples/memory-plugin-shared/lib/uri-guard.mjs+++ b/examples/memory-plugin-shared/lib/uri-guard.mjs@@ -166,7 +166,9 @@ export const DEFAULT_TOOL_HINTS = {// Tools whose argument is a command line rather than a location. A viking:// URI// in one is data (an `ov` argument, an HTTP payload, a grep pattern) as often as// a path the model hoped to open, so the command runs and the model gets a notice.-const SHELL_TOOL_NAMES = new Set(["bash", "shell", "runcommand"]);+// Only a name the host's hint table lists is guarded at all, so the PowerShell+// names reach no host that does not map them (dsh's Windows `pwsh` tool does).+const SHELL_TOOL_NAMES = new Set(["bash", "shell", "runcommand", "pwsh", "powershell"]);// `pattern` is where glob looks but what grep looks for: a grep for the text// "viking://" in a local tree is not a path. The generic sweep still reachesdiff --git a/examples/memory-plugin-shared/uri-guard.test.mjs b/examples/memory-plugin-shared/uri-guard.test.mjsindex 012acd025..62df66e66 100644--- a/examples/memory-plugin-shared/uri-guard.test.mjs+++ b/examples/memory-plugin-shared/uri-guard.test.mjs@@ -71,6 +71,19 @@ test("a shell command that carries a viking:// URI gets a notice, never a deny",assert.equal(evaluateUriNotice("Bash", { command: "cat /tmp/a.md" }), null)})+test("PowerShell tools are shell tools for a host that maps them, and unguarded otherwise", () => {+ const input = { command: "Get-Content viking://resources/a.md" }+ // The shape dsh passes for its Windows `pwsh` tool.+ const hints = { pwsh: { tool: "openviking_read", example: (uri) => `openviking_read(uris="${uri}")` } }+ assert.equal(evaluateUriGuard("pwsh", input, { hints }), null)+ assert.equal(evaluateUriNotice("pwsh", input, { hints })?.uri, "viking://resources/a.md")+ assert.equal(evaluateUriGuard("PowerShell", input, { hints: { powershell: hints.pwsh } }), null)+ assert.equal(evaluateUriNotice("PowerShell", input, { hints: { powershell: hints.pwsh } })?.uri, "viking://resources/a.md")+ // The default table names neither, so hosts that rely on it see no change.+ assert.equal(evaluateUriGuard("PowerShell", input), null)+ assert.equal(evaluateUriNotice("PowerShell", input), null)+})+test("a file tool on a viking:// path is denied, never noticed", () => {const input = { file_path: "viking://resources/a.md" }assert.equal(evaluateUriGuard("Read", input)?.uri, "viking://resources/a.md")diff --git a/examples/opencode-plugin/package.json b/examples/opencode-plugin/package.jsonindex de5b30800..0d4878a5b 100644--- a/examples/opencode-plugin/package.json+++ b/examples/opencode-plugin/package.json@@ -1,6 +1,6 @@{"name": "@openviking/opencode-plugin",- "version": "0.5.20",+ "version": "0.5.21","author": "@openviking","description": "Unified OpenCode plugin for OpenViking repository retrieval and long-term memory","type": "module",diff --git a/examples/pi-coding-agent-extension/package-lock.json b/examples/pi-coding-agent-extension/package-lock.jsonindex 51b0ccdf5..95995fafc 100644--- a/examples/pi-coding-agent-extension/package-lock.json+++ b/examples/pi-coding-agent-extension/package-lock.json@@ -1,12 +1,12 @@{"name": "openviking-pi-extension",- "version": "0.4.23",+ "version": "0.4.24","lockfileVersion": 3,"requires": true,"packages": {"": {"name": "openviking-pi-extension",- "version": "0.4.23",+ "version": "0.4.24","dependencies": {"@modelcontextprotocol/client": "2.0.0"},diff --git a/examples/pi-coding-agent-extension/package.json b/examples/pi-coding-agent-extension/package.jsonindex 6662b2741..4253f7f89 100644--- a/examples/pi-coding-agent-extension/package.json+++ b/examples/pi-coding-agent-extension/package.json@@ -1,6 +1,6 @@{"name": "openviking-pi-extension",- "version": "0.4.23",+ "version": "0.4.24","description": "OpenViking memory and context extension for the pi coding agent","private": true,"type": "module",