dsh-ntr 0.1.5 → 0.1.6
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 +3 -1
- package/README.md +3 -1
- package/cordis.patch.yml +56 -28
- package/lib/bridge.js +366 -147
- package/lib/client/panel.js +220 -61
- package/lib/client/store.js +30 -10
- package/lib/client.js +288 -131
- package/lib/client.js.map +1 -1
- package/lib/impl.js +98 -26
- package/lib/index.js +22 -9
- package/lib/types/bridge.d.ts +153 -109
- package/lib/types/client/panel.d.ts +47 -1
- package/lib/types/client/store.d.ts +10 -3
- package/lib/types/impl.d.ts +62 -10
- package/lib/types/protocol.d.ts +115 -45
- package/package.json +1 -1
- package/src/bridge.ts +422 -196
- package/src/client/panel.tsx +342 -140
- package/src/client/store.ts +31 -11
- package/src/impl.ts +117 -53
- package/src/index.ts +23 -9
- package/src/protocol.ts +116 -45
package/README.en.md
CHANGED
|
@@ -26,6 +26,8 @@ This plugin is a DSH **bundle**: `package.json`'s `dsh.bundle.patch` declares th
|
|
|
26
26
|
|
|
27
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
28
|
|
|
29
|
+
> DSH keeps a 24-hour safety window on the npm channel: a version published within it won't be picked as the latest, so entering plain `dsh-ntr` may install the previous release. To get the new version right away, include the explicit version in the box, e.g. `dsh-ntr@0.1.5`; otherwise wait out the window and install or upgrade as usual.
|
|
30
|
+
|
|
29
31
|
### Option 2: from the npm registry
|
|
30
32
|
|
|
31
33
|
```bash
|
|
@@ -240,7 +242,7 @@ Mount it in your profile's `cordis.patch.yml`. When `cwd` / `allowedCwdRoots` ar
|
|
|
240
242
|
allowedCwdRoots: [~/.dsh/dsh-ntr/workspaces]
|
|
241
243
|
```
|
|
242
244
|
|
|
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`, `
|
|
245
|
+
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`, `permissionTimeoutMode`) are covered by [AGENTS.md](./AGENTS.md) constraints 12 and 13; anything editable in the Settings page should be edited there.
|
|
244
246
|
|
|
245
247
|
`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
248
|
|
package/README.md
CHANGED
|
@@ -26,6 +26,8 @@
|
|
|
26
26
|
|
|
27
27
|
打开 DSH 侧边栏的**插件**页,点**添加插件**,输入 `dsh-ntr`,点安装。装完刷新页面即可使用。
|
|
28
28
|
|
|
29
|
+
> DSH 的 npm 渠道有 24 小时防范期:刚发布的版本 24 小时内不算「最新版」,只输 `dsh-ntr` 装到的可能还是旧版。想马上用新版,把版本号一起写上,例如 `dsh-ntr@0.1.5`;不急的话,等防范期过去再照常安装或升级。
|
|
30
|
+
|
|
29
31
|
### 方式二:从 npm registry 安装
|
|
30
32
|
|
|
31
33
|
```bash
|
|
@@ -240,7 +242,7 @@ agent 要动敏感的东西时会问你。审批卡直接出现在聊天输入
|
|
|
240
242
|
allowedCwdRoots: [~/.dsh/dsh-ntr/workspaces]
|
|
241
243
|
```
|
|
242
244
|
|
|
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` 与 `
|
|
245
|
+
可选的 agent 字段:`npmPackage`(PATH 里找不到时自动 `npm install -g`)、`exposedModels`(NTR 座位菜单列哪些变体)、`idleTimeoutMs`(聊天进程的空闲释放窗口,`0` = 永不释放,默认 30 分钟)、`mcpServers`(额外交给 agent 连接的 MCP 服务器)。插件级还有 `transcriptMaxEntries`(会话事件缓冲上限,默认 600)与 `probeModelsOnBoot`(保留字段,启动时已不再为每个 agent 探测,见 `bootstrapCatalogs` 的注释)。可靠性超时与重试的默认值(`startupTimeoutMs`、`cancelFallbackMs`、`staleCancelRetryDelayMs`、`staleCancelMaxRetries`、`permissionTimeoutMs` 与 `permissionTimeoutMode`)见 [AGENTS.md](./AGENTS.md) 约束 12 与 13;设置页能改的都在设置页改。
|
|
244
246
|
|
|
245
247
|
`mcpServers` 是**插件自己的形状**(每条必带 `name` 与 `transport`),不是 ACP 线格式——线格式里 stdio 那条不带 `type`,照线格式手写会被 agent 静默丢弃:
|
|
246
248
|
|
package/cordis.patch.yml
CHANGED
|
@@ -29,34 +29,62 @@
|
|
|
29
29
|
# after `saveAgent`.
|
|
30
30
|
# Reliability tuning (defaults shown):
|
|
31
31
|
# startupTimeoutMs: 60000 # budget for initialize / session/new / session/load
|
|
32
|
-
# permissionTimeoutMs:
|
|
33
|
-
#
|
|
34
|
-
#
|
|
35
|
-
#
|
|
36
|
-
#
|
|
37
|
-
#
|
|
38
|
-
#
|
|
39
|
-
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
42
|
-
# `
|
|
43
|
-
#
|
|
44
|
-
#
|
|
45
|
-
#
|
|
46
|
-
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
51
|
-
#
|
|
52
|
-
#
|
|
53
|
-
# `nativeApprovalTimeoutMs` and
|
|
54
|
-
# `permissionFallbackTimeoutMs` are
|
|
55
|
-
#
|
|
56
|
-
#
|
|
57
|
-
#
|
|
58
|
-
#
|
|
59
|
-
#
|
|
32
|
+
# permissionTimeoutMs: 300000
|
|
33
|
+
# How long a permission ask may sit unanswered
|
|
34
|
+
# before the deadline fires. ONE window for both
|
|
35
|
+
# places an ask can live — the conversation's
|
|
36
|
+
# approval card and the settings panel's ledger
|
|
37
|
+
# ("待处理权限请求"): they ask the same question,
|
|
38
|
+
# so they get the same answer.
|
|
39
|
+
# 0 = 不等待: the ask is settled the moment it
|
|
40
|
+
# arrives, nobody is asked (no composer card, no
|
|
41
|
+
# ledger entry). That rung belongs to the
|
|
42
|
+
# `auto` mode ONLY — it ANSWERS the ask, so the
|
|
43
|
+
# agent continues. Under `abort` the same zero
|
|
44
|
+
# would refuse every ask on arrival (the agent
|
|
45
|
+
# stops at every gate), so `abort` starts at the
|
|
46
|
+
# shortest real wait. "Never expires" is NOT
|
|
47
|
+
# this key's business — that is `wait` mode
|
|
48
|
+
# below.
|
|
49
|
+
# When the deadline fires, the ask is
|
|
50
|
+
# settled WHERE IT WAS ASKED — it is not handed to
|
|
51
|
+
# the settings panel. What happens is
|
|
52
|
+
# `permissionTimeoutMode`'s business.
|
|
53
|
+
# LEGACY: `nativeApprovalTimeoutMs` and
|
|
54
|
+
# `permissionFallbackTimeoutMs` are still accepted
|
|
55
|
+
# and folded into this key (this key wins when it
|
|
56
|
+
# is present), so an older config keeps meaning
|
|
57
|
+
# what it meant. A LEGACY 0 meant "never
|
|
58
|
+
# expires", so it migrates to `wait` mode with
|
|
59
|
+
# the default window — never to 不等待, which
|
|
60
|
+
# would silently turn "wait forever" into
|
|
61
|
+
# "answer at once".
|
|
62
|
+
# permissionTimeoutMode: wait
|
|
63
|
+
# What an EXPIRED deadline does — three values, no
|
|
64
|
+
# more:
|
|
65
|
+
# wait never expire; the ask stays pending,
|
|
66
|
+
# visibly, until a human answers it or the
|
|
67
|
+
# session is cancelled. DEFAULT: a
|
|
68
|
+
# permission ask is a question FOR A HUMAN,
|
|
69
|
+
# so the safe default is to keep waiting
|
|
70
|
+
# rather than to refuse (or worse, approve)
|
|
71
|
+
# on their behalf.
|
|
72
|
+
# abort refuse the ask (`cancelled`); the agent
|
|
73
|
+
# continues with that answer.
|
|
74
|
+
# auto answer it with the option the AGENT's own
|
|
75
|
+
# kinds imply (allow_always → allow_once →
|
|
76
|
+
# reject_once → reject_always → the first
|
|
77
|
+
# option) and let the agent CONTINUE.
|
|
78
|
+
# Unattended operation: this may approve
|
|
79
|
+
# something nobody looked at, which is why
|
|
80
|
+
# it is opt-in and why the outcome is
|
|
81
|
+
# announced. Same rule as OmniTerm dev's
|
|
82
|
+
# `pick_auto_option`.
|
|
83
|
+
# The window and the mode are BOTH editable at
|
|
84
|
+
# runtime (NTR 设置 → 审批时限). The card's values
|
|
85
|
+
# are persisted in the plugin's own state file and
|
|
86
|
+
# OUTRANK this file; the card shows what this file
|
|
87
|
+
# asked for and offers a reset back to it.
|
|
60
88
|
# cancelFallbackMs: 15000 # force-finalize a turn the agent ignores after session/cancel (0 = off)
|
|
61
89
|
# staleCancelRetryDelayMs: 600 # resend a prompt answered cancelled with no cancel requested (0 = at once)
|
|
62
90
|
# staleCancelMaxRetries: 2 # cap on those resends before the cancelled stop is reported as-is
|