dsh-ntr 0.1.4 → 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 +20 -1
- package/README.md +20 -1
- package/cordis.patch.yml +32 -0
- package/lib/bridge.js +361 -22
- package/lib/client/panel.js +179 -10
- package/lib/client/store.js +55 -1
- package/lib/client.js +352 -26
- package/lib/client.js.map +1 -1
- package/lib/impl.js +216 -5
- package/lib/index.js +31 -1
- package/lib/types/bridge.d.ts +191 -11
- package/lib/types/client/panel.d.ts +46 -0
- package/lib/types/client/store.d.ts +21 -1
- package/lib/types/impl.d.ts +99 -2
- package/lib/types/protocol.d.ts +135 -0
- package/package.json +1 -1
- package/src/bridge.ts +408 -27
- package/src/client/panel.tsx +322 -7
- package/src/client/store.ts +65 -2
- package/src/impl.ts +272 -7
- package/src/index.ts +30 -2
- package/src/protocol.ts +136 -0
package/README.en.md
CHANGED
|
@@ -240,7 +240,26 @@ Mount it in your profile's `cordis.patch.yml`. When `cwd` / `allowedCwdRoots` ar
|
|
|
240
240
|
allowedCwdRoots: [~/.dsh/dsh-ntr/workspaces]
|
|
241
241
|
```
|
|
242
242
|
|
|
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). 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.
|
|
244
263
|
|
|
245
264
|
### Build & install
|
|
246
265
|
|
package/README.md
CHANGED
|
@@ -240,7 +240,26 @@ agent 要动敏感的东西时会问你。审批卡直接出现在聊天输入
|
|
|
240
240
|
allowedCwdRoots: [~/.dsh/dsh-ntr/workspaces]
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
-
可选的 agent 字段:`npmPackage`(PATH 里找不到时自动 `npm install -g`)、`exposedModels`(NTR 座位菜单列哪些变体)、`idleTimeoutMs`(聊天进程的空闲释放窗口,`0` = 永不释放,默认 30
|
|
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 服务器不受影响,这里只是额外追加。
|
|
244
263
|
|
|
245
264
|
### 构建与安装
|
|
246
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).
|