dsh-ntr 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.en.md CHANGED
@@ -22,7 +22,11 @@ In one sentence: your host agent acts as an ACP client, negotiates capabilities
22
22
 
23
23
  This plugin is a DSH **bundle**: `package.json`'s `dsh.bundle.patch` declares the two patches shipped with the package — the plugin's own `cordis.patch.yml`, and the NTR-mode preset at `presets/acp/acp.patch.yml`. After `dsh plugin` installs it, the package joins the profile's `dsh.profile.bundles` and the patch layers take effect **automatically** — no config file needs editing by hand.
24
24
 
25
- ### Option 1: from the npm registry
25
+ ### Option 1: from the official UI
26
+
27
+ Open the **Plugins** page in DSH's sidebar, click **Add plugin**, enter `dsh-ntr`, and click install. Refresh the page and it's ready to use.
28
+
29
+ ### Option 2: from the npm registry
26
30
 
27
31
  ```bash
28
32
  dsh plugin --profile web add dsh-ntr@latest
@@ -32,7 +36,7 @@ Run the same command again to upgrade.
32
36
 
33
37
  > **Always pass `@latest`**: without it the package manager keeps reusing the version it wrote the first time, and `update` won't get you off it afterwards.
34
38
 
35
- ### Option 2: via the [dsh-market](https://github.com/dsh-market/dsh-market) plugin market
39
+ ### Option 3: via the [dsh-market](https://github.com/dsh-market/dsh-market) plugin market
36
40
 
37
41
  First install the market itself:
38
42
 
@@ -42,9 +46,9 @@ dsh plugin --profile web add dshmarket
42
46
 
43
47
  Restart `dsh web` and open the **Plugins** page: on dsh 0.2.1+ the market is the **Plugin Market** tab next to **Installed**; on older hosts it lives under **Settings → Plugin Market**. Search for `dsh-ntr`, confirm the source, and install in one click — refresh the page and it's live; update checks and upgrades afterwards also happen in the market. The official DSH Desktop app ships with this market preset, so just search and install from the app's **Plugins** page.
44
48
 
45
- > The market's catalog comes from the curated [awesome-dsh-plugin](https://awesome-dsh-plugin.com) registry and refreshes daily. If `dsh-ntr` doesn't show up in search yet, install it from npm with Option 1 — nothing is lost.
49
+ > The market's catalog comes from the curated [awesome-dsh-plugin](https://awesome-dsh-plugin.com) registry and refreshes daily. If `dsh-ntr` doesn't show up in search yet, install it from npm with Option 2 — nothing is lost.
46
50
 
47
- ### Option 3: from source
51
+ ### Option 4: from source
48
52
 
49
53
  Requires Node.js ≥ 22.12.0.
50
54
 
@@ -236,7 +240,26 @@ Mount it in your profile's `cordis.patch.yml`. When `cwd` / `allowedCwdRoots` ar
236
240
  allowedCwdRoots: [~/.dsh/dsh-ntr/workspaces]
237
241
  ```
238
242
 
239
- Optional agent fields: `npmPackage` (auto `npm install -g` when not found on PATH), `exposedModels` (which variants the NTR seat menu lists), `idleTimeoutMs` (idle-release window for chat processes; `0` = never release, default 30 minutes). Plugin-level there are also `transcriptMaxEntries` (per-conversation event buffer cap, default 600) and `probeModelsOnBoot` (kept for compatibility; boot-time per-agent probing no longer happens — see the comment on `bootstrapCatalogs`). Reliability timeouts and retries (`startupTimeoutMs`, `cancelFallbackMs`, `staleCancelRetryDelayMs`, `staleCancelMaxRetries`, `permissionTimeoutMs`, `permissionFallbackTimeoutMs`) are covered by [AGENTS.md](./AGENTS.md) constraints 12 and 13; anything editable in the Settings page should be edited there.
243
+ Optional agent fields: `npmPackage` (auto `npm install -g` when not found on PATH), `exposedModels` (which variants the NTR seat menu lists), `idleTimeoutMs` (idle-release window for chat processes; `0` = never release, default 30 minutes), `mcpServers` (extra MCP servers handed to the agent). Plugin-level there are also `transcriptMaxEntries` (per-conversation event buffer cap, default 600) and `probeModelsOnBoot` (kept for compatibility; boot-time per-agent probing no longer happens — see the comment on `bootstrapCatalogs`). Reliability timeouts and retries (`startupTimeoutMs`, `cancelFallbackMs`, `staleCancelRetryDelayMs`, `staleCancelMaxRetries`, `permissionTimeoutMs`, `permissionFallbackTimeoutMs`) are covered by [AGENTS.md](./AGENTS.md) constraints 12 and 13; anything editable in the Settings page should be edited there.
244
+
245
+ `mcpServers` uses the plugin's OWN shape (every entry carries a `name` and a `transport`), not the ACP wire shape — the wire's stdio entry has no `type`, and an entry written in the wire shape is silently dropped by the agent:
246
+
247
+ ```yaml
248
+ - id: pi
249
+ command: pi-acp
250
+ mcpServers:
251
+ - name: codegraph
252
+ transport: stdio # stdio needs command; http / sse need url
253
+ command: /opt/bin/codegraph
254
+ args: ["serve", "--mcp"]
255
+ env: { CODEGRAPH_INDEX: /srv/index }
256
+ - name: remote
257
+ transport: http
258
+ url: https://mcp.example.com/mcp
259
+ headers: { Authorization: "Bearer …" }
260
+ ```
261
+
262
+ These servers are handed to the agent when a session is created; the agent launches and uses them itself. The MCP servers the agent configures for itself are unaffected — this only adds more.
240
263
 
241
264
  ### Build & install
242
265
 
package/README.md CHANGED
@@ -22,7 +22,11 @@
22
22
 
23
23
  本插件是一个 DSH **bundle**:`package.json` 的 `dsh.bundle.patch` 声明了随包分发的两层补丁——插件本体的 `cordis.patch.yml`,与 NTR 模式 preset 的 `presets/acp/acp.patch.yml`。用 `dsh plugin` 安装后,包会加入 profile 的 `dsh.profile.bundles`,补丁层**自动生效**,无需手动编辑任何配置文件。
24
24
 
25
- ### 方式一:从 npm registry 安装
25
+ ### 方式一:从官方界面安装
26
+
27
+ 打开 DSH 侧边栏的**插件**页,点**添加插件**,输入 `dsh-ntr`,点安装。装完刷新页面即可使用。
28
+
29
+ ### 方式二:从 npm registry 安装
26
30
 
27
31
  ```bash
28
32
  dsh plugin --profile web add dsh-ntr@latest
@@ -32,7 +36,7 @@ dsh plugin --profile web add dsh-ntr@latest
32
36
 
33
37
  > `add` 时**务必带 `@latest`**:不带的话包管理器会一直复用首次写入的版本号,之后连 `update` 也升不上去。
34
38
 
35
- ### 方式二:经 [dsh-market](https://github.com/dsh-market/dsh-market) 插件市场安装
39
+ ### 方式三:经 [dsh-market](https://github.com/dsh-market/dsh-market) 插件市场安装
36
40
 
37
41
  先装市场本体:
38
42
 
@@ -42,9 +46,9 @@ dsh plugin --profile web add dshmarket
42
46
 
43
47
  重启 `dsh web`,打开**插件**页:dsh 0.2.1 起市场是「已安装」旁边的**插件市场**标签页;更早的版本在**设置 → 插件市场**。搜索 `dsh-ntr`,确认来源后一键安装,装完刷新页面即可使用;之后的更新检查与升级也在市场里完成。官方 DSH 桌面 App 自带这个市场,直接在 App 的**插件**页里搜索安装即可。
44
48
 
45
- > 市场的插件清单来自 [awesome-dsh-plugin](https://awesome-dsh-plugin.com) 精选目录,每天自动刷新。若搜索结果里暂时没有 `dsh-ntr`,用方式一从 npm 安装,不影响使用。
49
+ > 市场的插件清单来自 [awesome-dsh-plugin](https://awesome-dsh-plugin.com) 精选目录,每天自动刷新。若搜索结果里暂时没有 `dsh-ntr`,用方式二从 npm 安装,不影响使用。
46
50
 
47
- ### 方式三:从源码安装
51
+ ### 方式四:从源码安装
48
52
 
49
53
  需要 Node.js ≥ 22.12.0。
50
54
 
@@ -236,7 +240,26 @@ agent 要动敏感的东西时会问你。审批卡直接出现在聊天输入
236
240
  allowedCwdRoots: [~/.dsh/dsh-ntr/workspaces]
237
241
  ```
238
242
 
239
- 可选的 agent 字段:`npmPackage`(PATH 里找不到时自动 `npm install -g`)、`exposedModels`(NTR 座位菜单列哪些变体)、`idleTimeoutMs`(聊天进程的空闲释放窗口,`0` = 永不释放,默认 30 分钟)。插件级还有 `transcriptMaxEntries`(会话事件缓冲上限,默认 600)与 `probeModelsOnBoot`(保留字段,启动时已不再为每个 agent 探测,见 `bootstrapCatalogs` 的注释)。可靠性超时与重试的默认值(`startupTimeoutMs`、`cancelFallbackMs`、`staleCancelRetryDelayMs`、`staleCancelMaxRetries`、`permissionTimeoutMs` 与 `permissionFallbackTimeoutMs`)见 [AGENTS.md](./AGENTS.md) 约束 12 与 13;设置页能改的都在设置页改。
243
+ 可选的 agent 字段:`npmPackage`(PATH 里找不到时自动 `npm install -g`)、`exposedModels`(NTR 座位菜单列哪些变体)、`idleTimeoutMs`(聊天进程的空闲释放窗口,`0` = 永不释放,默认 30 分钟)、`mcpServers`(额外交给 agent 连接的 MCP 服务器)。插件级还有 `transcriptMaxEntries`(会话事件缓冲上限,默认 600)与 `probeModelsOnBoot`(保留字段,启动时已不再为每个 agent 探测,见 `bootstrapCatalogs` 的注释)。可靠性超时与重试的默认值(`startupTimeoutMs`、`cancelFallbackMs`、`staleCancelRetryDelayMs`、`staleCancelMaxRetries`、`permissionTimeoutMs` 与 `permissionFallbackTimeoutMs`)见 [AGENTS.md](./AGENTS.md) 约束 12 与 13;设置页能改的都在设置页改。
244
+
245
+ `mcpServers` 是**插件自己的形状**(每条必带 `name` 与 `transport`),不是 ACP 线格式——线格式里 stdio 那条不带 `type`,照线格式手写会被 agent 静默丢弃:
246
+
247
+ ```yaml
248
+ - id: pi
249
+ command: pi-acp
250
+ mcpServers:
251
+ - name: codegraph
252
+ transport: stdio # stdio 需 command;http / sse 需 url
253
+ command: /opt/bin/codegraph
254
+ args: ["serve", "--mcp"]
255
+ env: { CODEGRAPH_INDEX: /srv/index }
256
+ - name: remote
257
+ transport: http
258
+ url: https://mcp.example.com/mcp
259
+ headers: { Authorization: "Bearer …" }
260
+ ```
261
+
262
+ 这些服务器在**建会话时**交给 agent,由 agent 自己拉起并使用;agent 自己配置的 MCP 服务器不受影响,这里只是额外追加。
240
263
 
241
264
  ### 构建与安装
242
265
 
package/cordis.patch.yml CHANGED
@@ -34,6 +34,29 @@
34
34
  # DEGRADED native route the turn still ends, after
35
35
  # `permissionFallbackTimeoutMs` (default 300000) —
36
36
  # see `LedgerFallbackReason`.
37
+ # nativeApprovalTimeoutMs: 300000
38
+ # How long the native approval route (the composer
39
+ # takeover) may stay unanswered before the ask is
40
+ # WITHDRAWN and re-asked on the settings ledger. 0 waits
41
+ # for the host forever. Default matches
42
+ # `permissionFallbackTimeoutMs`: one window for "this
43
+ # route is not working", not two. Raise it if a
44
+ # deployment's users routinely deliberate for minutes
45
+ # before answering (withdrawing only relocates the
46
+ # question to Settings — it never answers for them).
47
+ # permissionFallbackTimeoutMs: 300000
48
+ # Deadline for a DEGRADED ask (`unavailable`, or
49
+ # `native-timeout` after the withdrawal above): past it
50
+ # the ask is answered `cancelled` instead of hanging the
51
+ # turn. 0 disables even this. `permissionTimeoutMs > 0`
52
+ # governs every path alike and overrides both.
53
+ # `nativeApprovalTimeoutMs` and
54
+ # `permissionFallbackTimeoutMs` are ALSO editable at
55
+ # runtime (NTR 设置 → 审批时限). The card's value is
56
+ # persisted in the plugin's own state file and OUTRANKS
57
+ # this file; the card shows what this file asked for and
58
+ # offers a reset back to it. Only `permissionTimeoutMs`
59
+ # stays config-file-only, as the override of both.
37
60
  # cancelFallbackMs: 15000 # force-finalize a turn the agent ignores after session/cancel (0 = off)
38
61
  # staleCancelRetryDelayMs: 600 # resend a prompt answered cancelled with no cancel requested (0 = at once)
39
62
  # staleCancelMaxRetries: 2 # cap on those resends before the cancelled stop is reported as-is
@@ -70,3 +93,12 @@
70
93
  # # shows as connected) is released after
71
94
  # # `probeIdleTimeoutMs` (5 min) whatever this
72
95
  # # says, 0 included.
96
+ # mcpServers: # extra MCP servers handed to the agent at
97
+ # - name: codegraph # session setup (the agent starts them
98
+ # transport: stdio # itself). The plugin's OWN shape: every
99
+ # command: /opt/bin/codegraph # entry carries a name and a transport.
100
+ # args: [serve, --mcp] # `stdio` needs command, `http`/`sse` need
101
+ # env: { KEY: value } # url. NOT the ACP wire shape, whose stdio
102
+ # # variant has no `type` field (an entry
103
+ # # written that way is silently dropped by
104
+ # # the agent).