dsh-tool-adapt 0.2.2

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 dsh-tool-adapt contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,55 @@
1
+ # dsh-tool-adapt
2
+
3
+ ## English
4
+
5
+ **Current release: 0.2.2** — Remote settings are capability-detected and optional, so older DSH RC hosts continue to start the plugin.
6
+
7
+ A compatibility and safety adaptation layer for non-DeepSeek model families in DeepSeek Harness Web. It guards dead escalation states, injects model-family conventions, fuses repeated failures, and provides a lifecycle-safe Settings card and optional composer pill. Its DSH 0.1.2+ `remote.settings` path falls back to the legacy connection API on older RC hosts.
8
+
9
+ ## 中文
10
+
11
+ 面向 DeepSeek Harness Web 非 DeepSeek 模型族的兼容与安全适配层:处理不可升级权限状态、注入模型族惯例、熔断连续失败,并提供生命周期安全的设置卡片与可选输入框胶囊。DSH 0.1.2+ 使用 `remote.settings`,旧版 RC 自动回退到 connection API。
12
+
13
+ Adaptation layer for foreign models in DSH web — official bundle form
14
+ (host pipeline wiring + `__ModuleLoader__` client, no tapIndex injection).
15
+
16
+ ONE RULE: in a "dead" session (sandbox already `danger-full-access`, or
17
+ approval policy `never`) the model-facing tool schemas no longer offer
18
+ `sandbox_permissions` / `justification` (remove), and calls that still carry
19
+ them run with the fields stripped (strip) — no error, no loop.
20
+
21
+ - **guard** — remove + strip, derived from one `escalationDeadState(session)`
22
+ predicate.
23
+ - **L2** — DSH tool-call conventions section, gated by model family (default
24
+ excludes `deepseek-*`).
25
+ - **L0** — consecutive-failure loop fuse: remind after N failures, optional
26
+ veto.
27
+
28
+ Config is hot. When Host `ctx.settings` is available the plugin registers the
29
+ `tool-adapt` namespace and an official-style expandable Settings Card
30
+ (`settings.plugin.item` / key `tool-adapt`, same disclosure chrome as
31
+ Shell / Agent loop) becomes the writable source of truth. A legacy `plugins/tool-adapt.config.json` is migrated once if the
32
+ settings user layer is empty; the old file is kept for rollback. The
33
+ `GET/POST /api/tool-adapt/status|set` routes remain as a compatibility
34
+ surface (loopback + same-origin fenced, 8 KiB body cap). The pill snaps to
35
+ one of the chat input's four corners (drag to switch); the anchor is
36
+ remembered in `localStorage` (`dsh.toolAdapt.anchor`). The pill mounts inside
37
+ the composer seat (same stacking level as the input box) at a normal
38
+ `z-index`, so DSH web popups (modal / menu / toast) can cover it. The pill
39
+ itself is status-only — edit the full form under Settings → Plugins. The
40
+ pill is hidden by DEFAULT: the「显示状态胶囊」switch (`ui.pill`, default
41
+ `false`) at the top of the ADAPT card owns its visibility, and the pill
42
+ follows the hot `/status` config within one poll (or instantly after a save
43
+ in the same tab).
44
+
45
+ ## Install
46
+
47
+ Add to the profile's `package.json` dependencies (`link:` for local dev) and
48
+ to `dsh.profile.bundles`, then `pnpm install` and restart `dsh web`.
49
+
50
+ ## Config
51
+
52
+ The mounting row (in this package's `cordis.patch.yml`) passes
53
+ `config.configFile` — the JSON config path, resolved against the profile
54
+ working directory (default `<cwd>/plugins/tool-adapt.config.json`, keeping the
55
+ legacy location so existing configs migrate unchanged).
@@ -0,0 +1,12 @@
1
+ # dsh-tool-adapt bundle patch
2
+ #
3
+ # Mounts the host half (pipeline wiring + /api/tool-adapt/* RPC) + client half
4
+ # (web bundle). The `configFile` config tells the host where the JSON config
5
+ # lives; it is resolved against the profile working directory and defaults to
6
+ # <cwd>/plugins/tool-adapt.config.json when absent, so existing profile configs
7
+ # migrate unchanged.
8
+ - insert:
9
+ - id: tool-adapt
10
+ name: 'dsh-tool-adapt'
11
+ config:
12
+ configFile: 'plugins/tool-adapt.config.json'