dsh-tool-drawer 0.1.1 → 0.1.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/README-zh.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  [English](README.md) | 中文
4
4
 
5
- **把工具当成一张桌子和一个抽屉。**
5
+ **把工具都收进抽屉,要用的时候再摆上桌面。**
6
6
 
7
- DeepSeek Harness 每一步都会把每个工具的完整说明塞进模型上下文。多装几个插件和 MCP 之后,这笔开销会一直压在那里。这个插件负责把桌面收小。
7
+ DSH 每一步都会把每个工具的完整说明塞进模型上下文。多装几个插件和 MCP 之后,光是「有哪些工具」就吃掉一大块窗口。这个插件让模型平时只看到桌面上那几样常用的,其余都躺在抽屉里——需要对哪个,拉开抽屉取出来用,用完再放回去。
8
8
 
9
- ## 思路
9
+ ## 桌面和抽屉
10
10
 
11
- - **桌面** —— 伸手就能拿到的工具。它们的说明永远在上下文里。
12
- - **抽屉** —— 其他所有工具。不用的时候不花一分钱:模型点名要,插件拉开抽屉取出来、跑完再放回去。
11
+ - **桌面** —— 伸手就能拿到的常用工具,它们的说明一直在上下文里。
12
+ - **抽屉** —— 其他所有工具。平时不占地方,模型点名要的时候才被取出来。
13
13
 
14
14
  ## 两种模式
15
15
 
@@ -36,11 +36,17 @@ DeepSeek Harness 每一步都会把每个工具的完整说明塞进模型上下
36
36
 
37
37
  ## 安装
38
38
 
39
+ ```powershell
40
+ dsh plugin --profile <profile> add dsh-tool-drawer
41
+ ```
42
+
43
+ 或者从本地目录链接安装:
44
+
39
45
  ```powershell
40
46
  dsh plugin --profile <profile> add link:/path/to/dsh-tool-drawer
41
47
  ```
42
48
 
43
- 然后在 profile 的 `package.json` 里把 `dsh-tool-drawer` 加进 `dsh.profile.bundles`,重启 DSH。包发布到 npm 之后也可以直接按名字安装:`dsh plugin --profile <profile> add dsh-tool-drawer`。
49
+ 然后把 `dsh-tool-drawer` 加进 profile 的 `package.json` 的 `dsh.profile.bundles`,重启 DSH。
44
50
 
45
51
  ## 设置
46
52
 
@@ -53,6 +59,7 @@ dsh plugin --profile <profile> add link:/path/to/dsh-tool-drawer
53
59
  | DSH | 验证日期 |
54
60
  |---|---|
55
61
  | 0.2.2-rc.3 | 2026-11-16 |
62
+ | 0.2.2-rc.5 | 2026-11-18 |
56
63
 
57
64
  ## 注意
58
65
 
package/README.md CHANGED
@@ -2,14 +2,14 @@
2
2
 
3
3
  English | [中文](README-zh.md)
4
4
 
5
- **Your tools, as a desk and a drawer.**
5
+ **Put every tool in a drawer, and bring one to the desk only when it is needed.**
6
6
 
7
- DeepSeek Harness hands the model every tool's full schema on every single step. A few plugins and MCP servers later that is a large standing cost. This plugin keeps the desk small.
7
+ DSH sends the full description of every tool on every single step. With a few plugins and MCP servers, merely listing them eats a large slice of the context window. This plugin keeps only the everyday tools on the desk; everything else stays in a drawer and is taken out when the model asks for it.
8
8
 
9
- ## The idea
9
+ ## The desk and the drawer
10
10
 
11
- - **Desk** — the tools that are always within reach. Their schemas are always in the prompt.
12
- - **Drawer** — everything else. It costs nothing until it is needed: the model looks a tool up, the plugin fetches it and runs it.
11
+ - **Desk** — the everyday tools within reach; their descriptions are always in the prompt.
12
+ - **Drawer** — everything else. It costs nothing until it is needed.
13
13
 
14
14
  ## Two modes
15
15
 
@@ -36,11 +36,17 @@ Nothing is persisted, no tool registration is changed, and no preset is touched.
36
36
 
37
37
  ## Install
38
38
 
39
+ ```powershell
40
+ dsh plugin --profile <profile> add dsh-tool-drawer
41
+ ```
42
+
43
+ Or link a local checkout:
44
+
39
45
  ```powershell
40
46
  dsh plugin --profile <profile> add link:/path/to/dsh-tool-drawer
41
47
  ```
42
48
 
43
- Then add `dsh-tool-drawer` to `dsh.profile.bundles` in the profile's `package.json` and restart DSH. Once the package is published you can install it by name: `dsh plugin --profile <profile> add dsh-tool-drawer`.
49
+ Then add `dsh-tool-drawer` to `dsh.profile.bundles` in the profile's `package.json` and restart DSH.
44
50
 
45
51
  ## Settings
46
52
 
@@ -53,6 +59,7 @@ The panel follows DSH's language: English by default; DSH's Chinese locale (incl
53
59
  | DSH | Verified |
54
60
  |---|---|
55
61
  | 0.2.2-rc.3 | 2026-11-16 |
62
+ | 0.2.2-rc.5 | 2026-11-18 |
56
63
 
57
64
  ## Notes
58
65
 
package/lib/drawer.js CHANGED
@@ -63,6 +63,23 @@ export function parseToolList(raw) {
63
63
  return out
64
64
  }
65
65
 
66
+ /**
67
+ * Dereference a host-provided volatile setting reference.
68
+ *
69
+ * Before `apply` runs, the host evaluates the plugin's Config schema
70
+ * (`internal/config` waterfall); every field declared `.volatile()` arrives
71
+ * not as a value but as a frozen `{ get() }` reference, and setting-page
72
+ * changes are committed into those references in place. Reading through
73
+ * `get()` on every call is what makes hot changes apply without a restart.
74
+ * Plain values (unit tests, hosts without the schema step) pass through.
75
+ * @param {unknown} value - a config field as mounted by the host.
76
+ * @returns {unknown} the field's current value.
77
+ */
78
+ export function pickRef(value) {
79
+ if (value !== null && typeof value === 'object' && typeof value.get === 'function') return value.get()
80
+ return value
81
+ }
82
+
66
83
  /**
67
84
  * Normalize the live plugin config.
68
85
  * @param {Record<string, unknown>} raw - plugin config as mounted by the profile.
@@ -70,12 +87,13 @@ export function parseToolList(raw) {
70
87
  */
71
88
  export function resolveConfig(raw) {
72
89
  const source = raw !== null && typeof raw === 'object' ? raw : {}
73
- const mode = MODES.includes(source.mode) ? source.mode : 'proxy'
74
- const listed = parseToolList(source.coreTools)
75
- const maxActive = Number(source.maxActive)
76
- const searchLimit = Number(source.searchLimit)
90
+ const modeRaw = pickRef(source.mode)
91
+ const mode = MODES.includes(modeRaw) ? modeRaw : 'proxy'
92
+ const listed = parseToolList(pickRef(source.coreTools))
93
+ const maxActive = Number(pickRef(source.maxActive))
94
+ const searchLimit = Number(pickRef(source.searchLimit))
77
95
  return {
78
- enabled: source.enabled !== false,
96
+ enabled: pickRef(source.enabled) !== false,
79
97
  mode,
80
98
  core: new Set(listed.length > 0 ? listed : DEFAULT_CORE),
81
99
  maxActive: Number.isFinite(maxActive) ? Math.max(1, Math.min(128, Math.trunc(maxActive))) : 20,
package/locale/en.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "Tool drawer",
4
- "description": "Keeps the tool list small: the tools you use stay on the desk, the rest wait in a drawer."
4
+ "description": "Put every tool in a drawer: everyday tools stay on the desk, everything else is fetched when needed."
5
5
  }
6
6
  }
package/locale/zh.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "meta": {
3
3
  "title": "工具抽屉",
4
- "description": "把工具表换小:常用的留在桌面上,其余收进抽屉,需要时再取。"
4
+ "description": "把工具都收进抽屉,需要用的才摆上桌面。"
5
5
  }
6
6
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "dsh-tool-drawer",
3
- "version": "0.1.1",
4
- "description": "Keep DeepSeek Harness's tool list small: the tools you use sit on the desk, everything else waits in a drawer and is fetched on demand.",
3
+ "version": "0.1.2",
4
+ "description": "Put every tool in a drawer: everyday tools stay on the desk, everything else is fetched on demand.",
5
5
  "type": "module",
6
6
  "main": "lib/index.js",
7
7
  "exports": {
@@ -31,11 +31,12 @@
31
31
  "@deepseek-ai/dsh-client-ui-settings"
32
32
  ]
33
33
  },
34
- "verifiedWith": "0.2.2-rc.3",
34
+ "verifiedWith": "0.2.2-rc.5",
35
35
  "compatibility": {
36
36
  "dsh": ">=0.2.2-rc.3",
37
37
  "dshReleases": {
38
- "0.2.2-rc.3": "compatible"
38
+ "0.2.2-rc.3": "compatible",
39
+ "0.2.2-rc.5": "compatible"
39
40
  }
40
41
  }
41
42
  },