Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/en/docs/develop/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,13 @@ Setup installs, configures, activates where supported, and runs doctor. Failures

`powercontext setup [agents...] --remove` undoes setup for the selected agents: it removes their native registrations, the files that PowerContext installed, the stored credentials, and their `hosts.<agent>` entries in the Client settings. It keeps the PowerContext package, the Server and its service, stored memory, Scope bindings, and settings that you added. Against an authenticated Server, a later setup needs the token again.
Non-interactive runs require agent names, and each agent succeeds or fails on its own. Only `--json` and the DSH options `--profile` and `--dsh-command` combine with `--remove`; any other setup option exits with code 2. With `--json`, each agent reports `"removal": "removed"`, or `"not_set_up"` when there was nothing to remove; `result.removed` lists what was deleted and `result.notes` what is left for you to do.
Codex, Claude Code, Pi, and DSH keep their registrations in their own CLIs. When that CLI, or the DSH command for the profile, is unavailable, removal still deletes PowerContext's own files, credential, and connection, reports `"host_registration": "not_checked"` instead of `"checked"`, and adds a note with the host command to run. OpenCode's CLI reports its configuration directory; without it, removal deletes only the credential and the connection, also reports `"not_checked"`, and the note says what is left. For DSH, `result.remaining_profiles` lists the other profiles that still register the plugin.
Codex, Claude Code, Pi, and DSH keep their registrations in their own CLIs. When that CLI, or the DSH command for the profile, is unavailable, removal still deletes PowerContext's own files, credential, and connection, reports `"host_registration": "not_checked"` instead of `"checked"`, and adds a note with the host command to run. OpenCode's CLI reports its configuration directory; without it, removal deletes only the credential and the connection, also reports `"not_checked"`, and the note says what is left. DSH removal applies to the DSH home that `DSH_HOME` selects (`~/.dsh` by default) and removes only that home's record in `hosts.dsh`; `result.remaining_profiles` lists the other profiles of that home that still register the plugin. See [Other DSH homes](../integrations/dsh.md#other-dsh-homes).
Removal is not supported for Hermes, OpenClaw, and MiniMax: their setup changes host state that PowerContext cannot attribute to itself, so their guides describe removal with each host's own commands. `powercontext service uninstall` is separate and removes only the personal Server service.

`powercontext config agent [agents...]` updates installed connections without reinstalling or enabling plugins.
`powercontext doctor [agents...]` checks the selected agents, or saved connections when none are selected.
`powercontext doctor [agents...]` checks the selected agents, or saved connections when none are selected; DSH counts as saved only when the DSH home that `DSH_HOME` selects has a record.
With no saved connections, doctor checks the package and Server. Selected agents with a missing required CLI fail their own checks.
Doctor preserves host-specific checks, including OpenCode's separate `plugin` and `skill` results. DSH checks its native registration; Pi checks its registered package.
Doctor preserves host-specific checks, including OpenCode's separate `plugin` and `skill` results. DSH checks its native registration in the profile saved for the selected DSH home; Pi checks its registered package.

The unified HTTP review routes are `/v1/candidates/list`, `get`, `history`, `revise`, `approve`, and `reject` (all POST).
`candidate_kind=artifact|tag` distinguishes proposals. Old Artifact Candidate routes are removed; callers must upgrade together.
Expand Down
97 changes: 72 additions & 25 deletions docs/en/docs/integrations/dsh.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,19 +64,23 @@ the Server from the same ref as well, and restart DSH after reinstalling the plu
`hosts.dsh.result.plugin_path` and run `git -C <plugin_path> rev-parse HEAD` to record the plugin commit;
record the Server checkout commit separately.

`powercontext setup dsh` asks for `web` or `desktop` in an interactive terminal. Without a terminal, or with
`--json`, an omitted profile defaults to `web`. Explicit selection never prompts:
Without `--profile`, setup, doctor, and removal use the profile saved for the selected DSH home, or `web` when that
home has none. Select a profile explicitly with `--profile`:

```bash
powercontext setup dsh --profile web
powercontext setup dsh --profile desktop
powercontext doctor dsh --profile desktop
```

Web installs under `$DSH_HOME/profiles/web`; Desktop installs under `$DSH_HOME/profiles/desktop`
(`DSH_HOME` defaults to `~/.dsh`). Setup calls `dsh plugin --profile <profile> add`, which installs the package
and enables its bundle in that profile's `package.json`. The bundle supplies its own patch. Setup preserves
both profiles' user `cordis.patch.yml` files and does not enable the plugin in the other profile.
Each profile installs under `$DSH_HOME/profiles/<profile>` (`DSH_HOME` defaults to `~/.dsh`). Setup calls
`dsh plugin --profile <profile> add`, which installs the package and enables its bundle in that profile's
`package.json`. The bundle supplies its own patch. Setup preserves every profile's user `cordis.patch.yml` and does
not enable the plugin in other profiles.

Profiles other than `desktop`, such as `tui` or a profile that another application creates, are set up the way Web
is: through the npm/pnpm `dsh` on PATH, or the command that `--dsh-command` names. A profile name starts with a
letter or digit and contains only letters, digits, `.`, `_`, and `-`.

Desktop requires its **Desktop-installed command**, not npm/pnpm dsh. Open Desktop once to initialize its
profile, use **Manage dsh Command…** to install the command, open a new terminal, then fully quit Desktop
Expand All @@ -93,9 +97,10 @@ unpackaged development launchers are not. Desktop inspection uses the applicatio
configuration APIs without booting plugins. Registration success does not establish running-host readiness:
reopen Desktop and run `/pc doctor`. Setup does not start the Server or quit Desktop for you.

Saved `hosts.dsh` connection settings and `$DSH_HOME/powercontext/credentials.json` are shared between Web
and Desktop. Use the same Server for both; changing the shared URL affects either profile that has no native
override. Credentials remain bound to their saved Server URL. Install into each profile separately if you use both.
The profiles of one DSH home share the saved `hosts.dsh` connection settings and
`$DSH_HOME/powercontext/credentials.json`. Use the same Server for all of them; changing the shared URL affects every
profile that has no native override. Credentials remain bound to their saved Server URL. Install into each profile
separately if you use more than one.

Existing UI and model patches can remain in place. Setup checks the composed PowerContext connection settings;
see [remote connection configuration](../operate/connect-remote-server.md) for conflicts and dynamic configuration limits.
Expand All @@ -108,7 +113,8 @@ Enabled include files must already exist. Cycles, unsupported file types or URLs
and unverifiable group children fail before connection settings or credentials are saved.

An unset, empty, or whitespace-only `DSH_HOME` selects `~/.dsh`. A nonblank path keeps its leading and trailing
spaces. These rules apply to configuration inspection, stored credentials, and plugin dependency lookup.
spaces. These rules apply to configuration inspection, stored credentials, plugin dependency lookup, and the saved
record that setup, doctor, and removal use.

Setup does not start the Server. Restart DSH after installation.
The model-facing PowerContext surface is registered through DSH's native `@deepseek-ai/dsh-mcp-client`.
Expand All @@ -127,6 +133,45 @@ than treating it as a Server error. The same report includes Server diagnostics,
includes separate Server probes; registration itself does not prove running-session connectivity. Restart DSH and
use `/pc doctor` to verify the active session.

### Other DSH homes

An application can run DSH with its own `DSH_HOME`. Run setup, doctor, and removal with the same `DSH_HOME` to
connect, check, or disconnect that home:

```bash
DSH_HOME="$HOME/Library/Application Support/Example/dsh" powercontext setup dsh --profile example-acp
DSH_HOME="$HOME/Library/Application Support/Example/dsh" powercontext doctor dsh
DSH_HOME="$HOME/Library/Application Support/Example/dsh" powercontext setup dsh --remove
```

Each home keeps its own Skill, credential, and saved profile and DSH command, so connecting one home does not
replace another home's connection. The Server URL and HTTP consent in `hosts.dsh` stay shared by every home,
because the plugin reads them without knowing its home. Run each command with the DSH command that manages that
home on PATH, or pass `--dsh-command`. `powercontext doctor` without agent names checks DSH only when the selected
home has a record, so another home's connection does not show up as a failed check of `~/.dsh`.

The Client settings record the default home `~/.dsh` in the top-level `profile` and `dsh_command` fields of
`hosts.dsh`, which earlier releases also read. Every other home has a record under `hosts.dsh.homes`, keyed by
its resolved absolute path:

```json
{
"server_url": "http://127.0.0.1:8000",
"allow_insecure_http": false,
"profile": "web",
"dsh_command": null,
"homes": {
"/Users/me/Library/Application Support/Example/dsh": {"profile": "example-acp", "dsh_command": null}
}
}
```

The top-level fields always belong to the default home, including a record from an earlier release that has no
`homes`, or only the Server URL. A record that an earlier release saved while `DSH_HOME` named another directory is
therefore read as the default home's. To record that home, rerun `powercontext setup dsh` with that `DSH_HOME` and
the same `--profile`, plus `--dsh-command` if the original setup used one; without `--profile`, setup records `web`
for a home that has no record.

## Start the Server and the host

For automatic Source-to-Memory extraction, generate and validate a Server configuration:
Expand Down Expand Up @@ -792,21 +837,23 @@ powercontext setup dsh --remove
powercontext setup dsh --remove --profile desktop
```

Removal applies to the saved profile, or to the profile that `--profile` selects. It unregisters `powercontext-dsh`, and
`powercontext-dsh-pet` when registered, with `dsh plugin --profile <profile> remove`, then deletes the package link and
any source checkout that setup cloned. A checkout that anything else still links to stays: another package in any DSH
profile, including this one, an entry in OpenCode's TUI config, or a Codex or Claude Code marketplace set up with
`--source` pointing into it. So does any checkout while another agent's configuration can't be read, and the result
names what kept it. The profile's `cordis.patch.yml` and the dsh-pet memory state stay. Fully quit DSH Desktop before
removing the plugin from its profile.

While another profile still registers the plugin, the shared Skill, the stored credential, and the saved connection
stay; the result names each such profile and the command that removes it. They also stay while another profile's
manifest can't be read; the result names the manifest, so fix or delete that profile and run removal again. If the
profile's DSH command is unavailable, removal still deletes PowerContext's files and shared state and prints the
`dsh plugin` commands to run later. For the Desktop profile, run them with the Desktop-installed dsh, or rerun removal
with `--dsh-command /path/to/Desktop/resources/runtime/cli/bin/dsh` (`dsh.cmd` on Windows). See
[CLI](../develop/interfaces.md#cli) for what removal keeps.
Removal applies to the selected DSH home: to the profile saved for that home, or to the profile that `--profile`
selects. It unregisters `powercontext-dsh`, and `powercontext-dsh-pet` when registered, with
`dsh plugin --profile <profile> remove`, then deletes the package link and any source checkout that setup cloned.
A checkout that anything else still links to stays: another package in any DSH profile of this home or another
saved home, including this profile, an entry in OpenCode's TUI config, or a Codex or Claude Code marketplace set up
with `--source` pointing into it. So does any checkout while another agent's configuration can't be read, and the
result names what kept it. The profile's `cordis.patch.yml` and the dsh-pet memory state stay. Fully quit DSH
Desktop before removing the plugin from its profile.

While another profile of the same home still registers the plugin, the home's Skill, stored credential, and saved
record stay; the result names each such profile and the command that removes it. They also stay while another
profile's manifest can't be read; the result names the manifest, so fix or delete that profile and run removal
again. Removing the last profile of a home drops that home's record; the shared Server URL and HTTP consent go only
with the last home's record. If the profile's DSH command is unavailable, removal still deletes PowerContext's files
and shared state and prints the `dsh plugin` commands to run later. For the Desktop profile, run them with the
Desktop-installed dsh, or rerun removal with `--dsh-command /path/to/Desktop/resources/runtime/cli/bin/dsh`
(`dsh.cmd` on Windows). See [CLI](../develop/interfaces.md#cli) for what removal keeps.

## Environment variables

Expand Down
6 changes: 3 additions & 3 deletions docs/zh/docs/develop/interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,13 +167,13 @@ Setup 会安装、配置、按宿主能力启用插件并运行 doctor。各 Age

`powercontext setup [agents...] --remove` 撤销所选 Agent 的 setup:移除其原生注册、PowerContext 安装的文件、已保存的凭据,以及 Client 设置中的 `hosts.<agent>` 条目。它保留 PowerContext 安装包、Server 及其服务、已存储的记忆、Scope 绑定,以及你自己添加的设置。连接启用认证的 Server 时,之后再次 setup 需要重新提供 token。
非交互运行时必须指定 Agent 名称,各 Agent 独立成功或失败。只有 `--json` 和 DSH 选项 `--profile`、`--dsh-command` 可以与 `--remove` 一起使用,其他 setup 选项会以退出码 2 失败。使用 `--json` 时,每个 Agent 报告 `"removal": "removed"`,没有可移除的内容时为 `"not_set_up"`;`result.removed` 列出已删除的内容,`result.notes` 列出仍需你处理的事项。
Codex、Claude Code、Pi 和 DSH 的注册由它们自己的 CLI 管理。该 CLI 或该 profile 的 DSH 命令不可用时,移除仍会删除 PowerContext 自己的文件、凭据和连接,报告 `"host_registration": "not_checked"`(而不是 `"checked"`),并在提示中给出需要运行的宿主命令。OpenCode 的配置目录由它的 CLI 报告;没有该 CLI 时,移除只删除凭据和连接,同样报告 `"not_checked"`,并在提示中说明还剩哪些内容。对于 DSH,`result.remaining_profiles` 列出仍注册了插件的其他 profile。
Codex、Claude Code、Pi 和 DSH 的注册由它们自己的 CLI 管理。该 CLI 或该 profile 的 DSH 命令不可用时,移除仍会删除 PowerContext 自己的文件、凭据和连接,报告 `"host_registration": "not_checked"`(而不是 `"checked"`),并在提示中给出需要运行的宿主命令。OpenCode 的配置目录由它的 CLI 报告;没有该 CLI 时,移除只删除凭据和连接,同样报告 `"not_checked"`,并在提示中说明还剩哪些内容。DSH 的移除作用于 `DSH_HOME` 选定的主目录(默认是 `~/.dsh`),只删除 `hosts.dsh` 中该主目录的记录;`result.remaining_profiles` 列出该主目录中仍注册了插件的其他 profile。参见[其他 DSH 主目录](../integrations/dsh.md#其他-dsh-主目录)。
Hermes、OpenClaw 和 MiniMax 不支持移除:它们的 setup 修改了无法归属到 PowerContext 的宿主状态,因此各自的指南说明了如何用宿主自己的命令移除。`powercontext service uninstall` 是另一回事,它只移除个人 Server 服务。

`powercontext config agent [agents...]` 更新已安装连接,不会重新安装或启用插件。
`powercontext doctor [agents...]` 检查选中的 Agent;未指定时检查已保存的连接。
`powercontext doctor [agents...]` 检查选中的 Agent;未指定时检查已保存的连接,其中 DSH 只在 `DSH_HOME` 选定的主目录有记录时才算已保存。
没有已保存连接时,doctor 检查安装包和 Server。选中的 Agent 缺少必需 CLI 时,其检查失败。
Doctor 保留宿主专有检查,包括 OpenCode 独立的 `plugin` 与 `skill` 结果。DSH 检查原生注册;Pi 检查已注册的 package。
Doctor 保留宿主专有检查,包括 OpenCode 独立的 `plugin` 与 `skill` 结果。DSH 检查当前 DSH 主目录所保存 profile 的原生注册;Pi 检查已注册的 package。

Candidate 的统一 HTTP 路径为 `/v1/candidates/list`、`get`、`history`、`revise`、`approve`、`reject`(均为 POST)。
通过 `candidate_kind=artifact|tag` 区分类型;旧 Artifact Candidate 路径直接移除,调用方必须同步升级。
Expand Down
Loading
Loading