@jidekaixin2dian/dsh-toolgate 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/CHANGELOG.md +5 -0
- package/LICENSE +21 -21
- package/README.en.md +16 -4
- package/README.md +16 -4
- package/README.zh.md +5 -5
- package/cordis.patch.yml +5 -5
- package/icon.svg +9 -9
- package/lib/api-payload.js +9 -9
- package/lib/client.js +21 -1
- package/lib/groups.js +58 -58
- package/locale/en.json +6 -7
- package/locale/zh.json +6 -7
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.1.6 — 2026-10-31
|
|
4
|
+
|
|
5
|
+
- 设置页新增「项目与反馈」入口,在预算、MCP、Skills 页面均可打开对应 GitHub 项目或新建反馈;页面加载失败时也保留入口。
|
|
6
|
+
- Add project and issue links across settings tabs, including when the main settings panel fails to load.
|
|
7
|
+
|
|
3
8
|
## 0.1.5 — 2026-10-28
|
|
4
9
|
|
|
5
10
|
- 发布与更新维护:明确 npm 安装、GitHub 来源迁移、市场检测与重启步骤;保留既有运行时行为。
|
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 jidekaixin2dian
|
|
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.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 jidekaixin2dian
|
|
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.en.md
CHANGED
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
# Toolgate
|
|
1
|
+
# Toolgate · 工具闸门
|
|
2
2
|
|
|
3
3
|
**Bring only the tools you need into the next prompt.**
|
|
4
4
|
|
|
5
|
-
[中文](README.md) · [Marketplace](https://awesome-dsh-plugin.com/p/jidekaixin2dian/dsh-toolgate/) · [Download](https://github.com/jidekaixin2dian/dsh-toolgate/releases/latest) · [Changelog](CHANGELOG.md)
|
|
5
|
+
[中文](README.md) · [npm](https://www.npmjs.com/package/@jidekaixin2dian/dsh-toolgate/v/0.1.6) · [Marketplace](https://awesome-dsh-plugin.com/p/jidekaixin2dian/dsh-toolgate/) · [Download](https://github.com/jidekaixin2dian/dsh-toolgate/releases/latest) · [Changelog](CHANGELOG.md)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
Many MCP servers installed, but only a few relevant to the task? Toolgate brings MCP servers, skills and tool visibility into one DSH settings page. Hide tool definitions by server and restore them when needed; configuration stays in place and MCP processes keep running.
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
|
+
## Three jobs, one settings page
|
|
12
|
+
|
|
11
13
|
| Tab | What it does |
|
|
12
14
|
|---|---|
|
|
13
15
|
| Budget | Estimate context usage, hide groups / all MCP / the largest group, restore tools |
|
|
14
16
|
| MCP servers | Add, edit, enable, disable and remove stdio or streamable-http servers |
|
|
15
17
|
| Skills | Search, create and toggle by Session workspace; move eligible local skills to trash |
|
|
16
18
|
|
|
19
|
+
## Downloads
|
|
20
|
+
|
|
21
|
+
| GitHub release assets · all releases | npm 0.1.5 · past 7 days |
|
|
22
|
+
|---|---|
|
|
23
|
+
| [**471 downloads**](https://api.github.com/repos/jidekaixin2dian/dsh-toolgate/releases?per_page=100) | [**126 downloads**](https://api.npmjs.org/versions/@jidekaixin2dian%2Fdsh-toolgate/last-week) |
|
|
24
|
+
|
|
25
|
+
Snapshot: **2026-10-29**. GitHub counts release-asset requests, including checksums; npm counts downloads of the named version. Requests can include repeat installs and automation, so these are not unique-user counts and the two columns are not added together. Click a number for its live source.
|
|
26
|
+
|
|
17
27
|
## Install and update
|
|
18
28
|
|
|
19
29
|
Requires **DSH >=0.2.1-rc.2 and Node >=24**. CI verifies DSH rc.2 / rc.3 / rc.4.
|
|
20
30
|
|
|
21
|
-
Search for **dsh-toolgate**, author **jidekaixin2dian**, in the marketplace. Both npm and GitHub sources support version checks. Once the catalog recognizes the npm package it prefers npm; existing users can check under installed plugins. Catalog
|
|
31
|
+
Search for **dsh-toolgate**, author **jidekaixin2dian**, in the marketplace. Both npm and GitHub sources support version checks. Once the catalog recognizes the npm package it prefers npm; existing users can check under installed plugins. Catalog and registry data may take time to refresh.
|
|
22
32
|
|
|
23
33
|
Alternatively, quit DSH and run the same command to install or update, then reopen it:
|
|
24
34
|
|
|
@@ -57,6 +67,8 @@ Existing `.tgz` or local installations can use the same command in the same prof
|
|
|
57
67
|
|
|
58
68
|
## Boundaries
|
|
59
69
|
|
|
70
|
+
**Project and feedback** at the bottom of every settings tab opens this plugin's GitHub repository or a new issue.
|
|
71
|
+
|
|
60
72
|
- Hiding tools is context budgeting, **not a permission sandbox**. MCP processes keep running; permitted Session overrides can restore tools.
|
|
61
73
|
- Token estimates use schema / description length. Neither estimates nor illustrated counts establish cost or latency savings.
|
|
62
74
|
- Some dynamically scoped tools cannot be hidden; use their manager to unload them. Skill ZIP / folder import is not implemented.
|
package/README.md
CHANGED
|
@@ -1,24 +1,34 @@
|
|
|
1
|
-
#
|
|
1
|
+
# 工具闸门 · Toolgate
|
|
2
2
|
|
|
3
3
|
**让下一轮 prompt 只带需要的工具。**
|
|
4
4
|
|
|
5
|
-
[English](README.en.md) · [插件市场](https://awesome-dsh-plugin.com/p/jidekaixin2dian/dsh-toolgate/) · [下载](https://github.com/jidekaixin2dian/dsh-toolgate/releases/latest) · [更新记录](CHANGELOG.md)
|
|
5
|
+
[English](README.en.md) · [npm](https://www.npmjs.com/package/@jidekaixin2dian/dsh-toolgate/v/0.1.6) · [插件市场](https://awesome-dsh-plugin.com/p/jidekaixin2dian/dsh-toolgate/) · [下载](https://github.com/jidekaixin2dian/dsh-toolgate/releases/latest) · [更新记录](CHANGELOG.md)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
装了很多 MCP,却只有少数工具与当前任务有关?Toolgate 把 MCP 服务器、Skill 和工具可见性放在同一个 DSH 设置页里。按服务器隐藏整组工具定义,需要时再恢复;配置保留,MCP 进程继续运行。
|
|
8
8
|
|
|
9
9
|

|
|
10
10
|
|
|
11
|
+
## 一处管理三件事
|
|
12
|
+
|
|
11
13
|
| 页面 | 你可以做什么 |
|
|
12
14
|
|---|---|
|
|
13
15
|
| 预算 | 查看估算占用,隐藏单组、全部 MCP 或最大组,恢复工具 |
|
|
14
16
|
| MCP 服务器 | 新增、编辑、启停、删除服务器;支持 stdio 与 streamable-http |
|
|
15
17
|
| Skills | 按会话工作区搜索、新建、启停;可删除的本地 Skill 移到回收目录 |
|
|
16
18
|
|
|
19
|
+
## 下载情况
|
|
20
|
+
|
|
21
|
+
| GitHub Release 资源 · 历史累计 | npm 0.1.5 · 近 7 日 |
|
|
22
|
+
|---|---|
|
|
23
|
+
| [**471 次下载**](https://api.github.com/repos/jidekaixin2dian/dsh-toolgate/releases?per_page=100) | [**126 次下载**](https://api.npmjs.org/versions/@jidekaixin2dian%2Fdsh-toolgate/last-week) |
|
|
24
|
+
|
|
25
|
+
统计快照:**2026-10-29**。GitHub 包含安装包、校验文件等资源请求;npm 仅统计表中版本。下载可能包含重复安装和自动化请求,不代表独立用户数,两列不相加。点击数字可查看实时来源。
|
|
26
|
+
|
|
17
27
|
## 安装与更新
|
|
18
28
|
|
|
19
29
|
需要 **DSH >=0.2.1-rc.2、Node >=24**;持续验证 DSH rc.2 / rc.3 / rc.4。
|
|
20
30
|
|
|
21
|
-
在插件市场搜索 **dsh-toolgate**,确认作者为 **jidekaixin2dian**。npm 与 GitHub 来源都支持版本检查;市场识别 npm 包后优先使用 npm
|
|
31
|
+
在插件市场搜索 **dsh-toolgate**,确认作者为 **jidekaixin2dian**。npm 与 GitHub 来源都支持版本检查;市场识别 npm 包后优先使用 npm,可在「已安装」中检查更新。目录与 registry 数据可能有同步延迟。
|
|
22
32
|
|
|
23
33
|
也可完全退出 DSH 后执行以下命令;再次执行即可更新,随后重新打开 DSH:
|
|
24
34
|
|
|
@@ -59,6 +69,8 @@ toolgate action=reset
|
|
|
59
69
|
|
|
60
70
|
## 使用边界
|
|
61
71
|
|
|
72
|
+
设置页底部的「项目与反馈」可打开本插件的 GitHub 项目或新建反馈,在三个标签页中都能找到。
|
|
73
|
+
|
|
62
74
|
- 工具隐藏用于上下文预算,**不是权限沙箱**。MCP 进程不会因此停止;默认允许的会话覆盖可以恢复工具。
|
|
63
75
|
- token 数与示意图都不代表实际费用或速度收益;token 仅按 schema / 描述长度估算。
|
|
64
76
|
- agent 作用域中的部分动态工具无法隐藏,请用对应管理器卸载。Skill ZIP / 文件夹导入尚未实现。
|
package/README.zh.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# 中文说明
|
|
2
|
-
|
|
3
|
-
中文 README 已作为默认文档:[README.md](README.md)。
|
|
4
|
-
|
|
5
|
-
English: [README.en.md](README.en.md)。
|
|
1
|
+
# 中文说明
|
|
2
|
+
|
|
3
|
+
中文 README 已作为默认文档:[README.md](README.md)。
|
|
4
|
+
|
|
5
|
+
English: [README.en.md](README.en.md)。
|
|
6
6
|
|
package/cordis.patch.yml
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# Bundle patch: the row loads the host half; `dsh.client` in package.json
|
|
2
|
-
# makes the web app load ./client as the browser half.
|
|
3
|
-
- insert:
|
|
4
|
-
- id: dsh-toolgate
|
|
5
|
-
name: '@jidekaixin2dian/dsh-toolgate'
|
|
1
|
+
# Bundle patch: the row loads the host half; `dsh.client` in package.json
|
|
2
|
+
# makes the web app load ./client as the browser half.
|
|
3
|
+
- insert:
|
|
4
|
+
- id: dsh-toolgate
|
|
5
|
+
name: '@jidekaixin2dian/dsh-toolgate'
|
|
6
6
|
|
package/icon.svg
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" role="img" aria-label="dsh-toolgate">
|
|
2
|
-
<rect width="128" height="128" rx="24" fill="#0f172a"/>
|
|
3
|
-
<rect x="24" y="72" width="14" height="32" rx="3" fill="#38bdf8"/>
|
|
4
|
-
<rect x="46" y="52" width="14" height="52" rx="3" fill="#38bdf8"/>
|
|
5
|
-
<rect x="68" y="34" width="14" height="70" rx="3" fill="#a78bfa"/>
|
|
6
|
-
<rect x="90" y="60" width="14" height="44" rx="3" fill="#38bdf8"/>
|
|
7
|
-
<path d="M22 30h48" stroke="#e2e8f0" stroke-width="5" stroke-linecap="round"/>
|
|
8
|
-
<path d="M60 30l-9-7M60 30l-9 7" stroke="#e2e8f0" stroke-width="4" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
|
|
9
|
-
</svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 128" role="img" aria-label="dsh-toolgate">
|
|
2
|
+
<rect width="128" height="128" rx="24" fill="#0f172a"/>
|
|
3
|
+
<rect x="24" y="72" width="14" height="32" rx="3" fill="#38bdf8"/>
|
|
4
|
+
<rect x="46" y="52" width="14" height="52" rx="3" fill="#38bdf8"/>
|
|
5
|
+
<rect x="68" y="34" width="14" height="70" rx="3" fill="#a78bfa"/>
|
|
6
|
+
<rect x="90" y="60" width="14" height="44" rx="3" fill="#38bdf8"/>
|
|
7
|
+
<path d="M22 30h48" stroke="#e2e8f0" stroke-width="5" stroke-linecap="round"/>
|
|
8
|
+
<path d="M60 30l-9-7M60 30l-9 7" stroke="#e2e8f0" stroke-width="4" fill="none" stroke-linecap="round" stroke-linejoin="round"/>
|
|
9
|
+
</svg>
|
|
10
10
|
|
package/lib/api-payload.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
// The settings page posts `{ op, args }` (see `api()` in client.js), while the
|
|
2
|
-
// route handlers read operation fields directly. Accept both shapes so the
|
|
3
|
-
// bundle and the host cannot drift apart again — and so a hand-written probe
|
|
4
|
-
// or a future client that flattens the body still lands on the same fields.
|
|
5
|
-
export function requestArgs(payload) {
|
|
6
|
-
if (!payload || typeof payload !== 'object') return {}
|
|
7
|
-
const args = payload.args
|
|
8
|
-
return args && typeof args === 'object' && !Array.isArray(args) ? args : payload
|
|
9
|
-
}
|
|
1
|
+
// The settings page posts `{ op, args }` (see `api()` in client.js), while the
|
|
2
|
+
// route handlers read operation fields directly. Accept both shapes so the
|
|
3
|
+
// bundle and the host cannot drift apart again — and so a hand-written probe
|
|
4
|
+
// or a future client that flattens the body still lands on the same fields.
|
|
5
|
+
export function requestArgs(payload) {
|
|
6
|
+
if (!payload || typeof payload !== 'object') return {}
|
|
7
|
+
const args = payload.args
|
|
8
|
+
return args && typeof args === 'object' && !Array.isArray(args) ? args : payload
|
|
9
|
+
}
|
|
10
10
|
|
package/lib/client.js
CHANGED
|
@@ -55,6 +55,11 @@ const factory = (require) => {
|
|
|
55
55
|
'.cb-input{font:inherit;font-size:12px;padding:4px 6px;border-radius:5px;border:1px solid var(--dsw-alias-border-l2, rgba(128,128,128,.5));background:transparent;color:inherit;width:100%;box-sizing:border-box}',
|
|
56
56
|
'.cb-input textarea,.cb-form textarea{font-family:Consolas,monospace;min-height:44px;resize:vertical}',
|
|
57
57
|
'.cb-search{font-size:12px;padding:5px 8px;border-radius:6px;border:1px solid var(--dsw-alias-border-l2, rgba(128,128,128,.5));background:transparent;color:inherit;width:100%;box-sizing:border-box}',
|
|
58
|
+
'.cb-section{display:flex;flex-direction:column;gap:16px;color:inherit}',
|
|
59
|
+
'.cb-project{margin:0 2px;padding:14px 0 4px;border-top:1px solid var(--dsw-alias-border-l2,rgba(128,128,128,.25));font-size:13px;line-height:1.6}',
|
|
60
|
+
'.cb-project h3{margin:0 0 4px;font-size:13px;font-weight:600}.cb-project p{margin:0;font-size:12px;opacity:.7}',
|
|
61
|
+
'.cb-project-links{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}.cb-project-link{display:inline-flex;align-items:center;gap:7px;margin:0;padding:6px 10px;border:1px solid var(--dsw-alias-border-l2,rgba(128,128,128,.35));border-radius:7px;background:var(--dsw-alias-bg-layer-2,transparent);color:inherit;text-decoration:none;font-size:12px}',
|
|
62
|
+
'.cb-project-link svg{width:15px;height:15px;flex:none;opacity:.75}.cb-project-link:hover{border-color:currentColor}.cb-project-link:focus-visible{outline:2px solid var(--dsw-alias-brand,#367bf5);outline-offset:2px}',
|
|
58
63
|
].join('')
|
|
59
64
|
|
|
60
65
|
function ensureCss() {
|
|
@@ -365,6 +370,19 @@ const factory = (require) => {
|
|
|
365
370
|
React.createElement('button', { className: 'cb-btn danger', title: s.deletable ? '' : '该来源只读', disabled: !!busy || !s.deletable, onClick: () => remove(s) }, '删除')))))
|
|
366
371
|
}
|
|
367
372
|
|
|
373
|
+
function ProjectLinks() {
|
|
374
|
+
const language = pageCtx?.locale?.language?.getSnapshot?.() || (typeof navigator === 'undefined' ? 'zh' : navigator.language)
|
|
375
|
+
const zh = /^zh\b/i.test(language)
|
|
376
|
+
const title = zh ? '项目与反馈' : 'Project and feedback'
|
|
377
|
+
const icon = path => React.createElement('svg', { viewBox: '0 0 24 24', fill: 'none', stroke: 'currentColor', strokeWidth: 1.8, strokeLinecap: 'round', strokeLinejoin: 'round', 'aria-hidden': true }, React.createElement('path', { d: path }))
|
|
378
|
+
return React.createElement('section', { className: 'cb-project', 'aria-label': title },
|
|
379
|
+
React.createElement('h3', null, title),
|
|
380
|
+
React.createElement('p', null, zh ? '有问题或想法?欢迎在 GitHub 留言,一起把工具闸门做得更好。' : 'Found a problem or have an idea? Help make Toolgate better on GitHub.'),
|
|
381
|
+
React.createElement('div', { className: 'cb-project-links' },
|
|
382
|
+
React.createElement('a', { className: 'cb-project-link', href: 'https://github.com/jidekaixin2dian/dsh-toolgate', target: '_blank', rel: 'noopener noreferrer' }, icon('m9 8-4 4 4 4m6-8 4 4-4 4'), zh ? 'GitHub 项目' : 'GitHub project'),
|
|
383
|
+
React.createElement('a', { className: 'cb-project-link', href: 'https://github.com/jidekaixin2dian/dsh-toolgate/issues/new', target: '_blank', rel: 'noopener noreferrer' }, icon('M6 4h12a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-7l-5 4v-4a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z M8 9h8M8 13h5'), zh ? '反馈问题' : 'Report an issue')))
|
|
384
|
+
}
|
|
385
|
+
|
|
368
386
|
function Page() {
|
|
369
387
|
const [status, setStatus] = React.useState(null)
|
|
370
388
|
const [error, setError] = React.useState(null)
|
|
@@ -503,7 +521,9 @@ const factory = (require) => {
|
|
|
503
521
|
if (!slots) return
|
|
504
522
|
slots.inject('settings.section', () => slots.register(
|
|
505
523
|
{ name: 'settings.section', id: 'toolgate', order: 18, label: '工具闸门' },
|
|
506
|
-
() => React.createElement(
|
|
524
|
+
() => React.createElement('div', { className: 'cb-section' },
|
|
525
|
+
React.createElement(PageBoundary, null, React.createElement(Page)),
|
|
526
|
+
React.createElement(ProjectLinks))))
|
|
507
527
|
},
|
|
508
528
|
}
|
|
509
529
|
return module.exports
|
package/lib/groups.js
CHANGED
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
// Pure grouping rules. Kept dependency-free so node --test can exercise them
|
|
2
|
-
// without loading the DSH host or @deepseek-ai/dsh-tools.
|
|
3
|
-
export const FIXED_LABELS = {
|
|
4
|
-
skills: 'Skill 目录',
|
|
5
|
-
memory: '记忆工具',
|
|
6
|
-
schedule: '定时任务',
|
|
7
|
-
}
|
|
8
|
-
export const CORE_LABEL = '核心工具'
|
|
9
|
-
|
|
10
|
-
export function groupOf(toolName) {
|
|
11
|
-
const n = String(toolName || '')
|
|
12
|
-
if (n.startsWith('mcp__')) {
|
|
13
|
-
const rest = n.slice(5)
|
|
14
|
-
const cut = rest.indexOf('__')
|
|
15
|
-
const server = cut > 0 ? rest.slice(0, cut) : 'other'
|
|
16
|
-
return 'mcp:' + (server.toLowerCase().replace(/[^a-z0-9_-]/g, '_').slice(0, 32) || 'other')
|
|
17
|
-
}
|
|
18
|
-
if (n === 'skill') return 'skills'
|
|
19
|
-
if (n.startsWith('mnemon_')) return 'memory'
|
|
20
|
-
if (n.startsWith('schedule_')) return 'schedule'
|
|
21
|
-
return 'core'
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
export function labelOf(group) {
|
|
25
|
-
if (group === 'core') return CORE_LABEL
|
|
26
|
-
if (group.startsWith('mcp:')) return 'MCP · ' + group.slice(4)
|
|
27
|
-
return FIXED_LABELS[group] || group
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export function normalizeDisabled(value) {
|
|
31
|
-
if (!Array.isArray(value)) return []
|
|
32
|
-
const out = new Set()
|
|
33
|
-
for (const raw of value) {
|
|
34
|
-
let id = String(raw || '').trim().toLowerCase()
|
|
35
|
-
// Migrate the pre-market fixed groups to generic MCP server ids.
|
|
36
|
-
if (id === 'rea') id = 'mcp:rea'
|
|
37
|
-
if (id === 'mcp_other') id = 'mcp:other'
|
|
38
|
-
if (id === 'mcp') {
|
|
39
|
-
out.add('mcp')
|
|
40
|
-
continue
|
|
41
|
-
}
|
|
42
|
-
if (/^mcp:[a-z0-9_-]{1,32}$/.test(id)) {
|
|
43
|
-
out.add(id)
|
|
44
|
-
continue
|
|
45
|
-
}
|
|
46
|
-
if (Object.hasOwn(FIXED_LABELS, id)) out.add(id)
|
|
47
|
-
}
|
|
48
|
-
return [...out]
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export function isDisabled(group, disabled) {
|
|
52
|
-
if (group === 'core') return false
|
|
53
|
-
return disabled.includes(group) || (group.startsWith('mcp:') && disabled.includes('mcp'))
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export function matchesDisabled(toolName, disabled) {
|
|
57
|
-
return isDisabled(groupOf(toolName), disabled)
|
|
58
|
-
}
|
|
1
|
+
// Pure grouping rules. Kept dependency-free so node --test can exercise them
|
|
2
|
+
// without loading the DSH host or @deepseek-ai/dsh-tools.
|
|
3
|
+
export const FIXED_LABELS = {
|
|
4
|
+
skills: 'Skill 目录',
|
|
5
|
+
memory: '记忆工具',
|
|
6
|
+
schedule: '定时任务',
|
|
7
|
+
}
|
|
8
|
+
export const CORE_LABEL = '核心工具'
|
|
9
|
+
|
|
10
|
+
export function groupOf(toolName) {
|
|
11
|
+
const n = String(toolName || '')
|
|
12
|
+
if (n.startsWith('mcp__')) {
|
|
13
|
+
const rest = n.slice(5)
|
|
14
|
+
const cut = rest.indexOf('__')
|
|
15
|
+
const server = cut > 0 ? rest.slice(0, cut) : 'other'
|
|
16
|
+
return 'mcp:' + (server.toLowerCase().replace(/[^a-z0-9_-]/g, '_').slice(0, 32) || 'other')
|
|
17
|
+
}
|
|
18
|
+
if (n === 'skill') return 'skills'
|
|
19
|
+
if (n.startsWith('mnemon_')) return 'memory'
|
|
20
|
+
if (n.startsWith('schedule_')) return 'schedule'
|
|
21
|
+
return 'core'
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export function labelOf(group) {
|
|
25
|
+
if (group === 'core') return CORE_LABEL
|
|
26
|
+
if (group.startsWith('mcp:')) return 'MCP · ' + group.slice(4)
|
|
27
|
+
return FIXED_LABELS[group] || group
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export function normalizeDisabled(value) {
|
|
31
|
+
if (!Array.isArray(value)) return []
|
|
32
|
+
const out = new Set()
|
|
33
|
+
for (const raw of value) {
|
|
34
|
+
let id = String(raw || '').trim().toLowerCase()
|
|
35
|
+
// Migrate the pre-market fixed groups to generic MCP server ids.
|
|
36
|
+
if (id === 'rea') id = 'mcp:rea'
|
|
37
|
+
if (id === 'mcp_other') id = 'mcp:other'
|
|
38
|
+
if (id === 'mcp') {
|
|
39
|
+
out.add('mcp')
|
|
40
|
+
continue
|
|
41
|
+
}
|
|
42
|
+
if (/^mcp:[a-z0-9_-]{1,32}$/.test(id)) {
|
|
43
|
+
out.add(id)
|
|
44
|
+
continue
|
|
45
|
+
}
|
|
46
|
+
if (Object.hasOwn(FIXED_LABELS, id)) out.add(id)
|
|
47
|
+
}
|
|
48
|
+
return [...out]
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function isDisabled(group, disabled) {
|
|
52
|
+
if (group === 'core') return false
|
|
53
|
+
return disabled.includes(group) || (group.startsWith('mcp:') && disabled.includes('mcp'))
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export function matchesDisabled(toolName, disabled) {
|
|
57
|
+
return isDisabled(groupOf(toolName), disabled)
|
|
58
|
+
}
|
|
59
59
|
|
package/locale/en.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta": {
|
|
3
|
-
"title": "Toolgate",
|
|
4
|
-
"description": "Manage MCP servers and skills in
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "Toolgate · 工具闸门",
|
|
4
|
+
"description": "Manage MCP servers and skills in one place; hide or restore groups of tool definitions to control what enters the next prompt."
|
|
5
|
+
}
|
|
6
|
+
}
|
package/locale/zh.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
{
|
|
2
|
-
"meta": {
|
|
3
|
-
"title": "工具闸门",
|
|
4
|
-
"description": "
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
|
|
1
|
+
{
|
|
2
|
+
"meta": {
|
|
3
|
+
"title": "工具闸门 · Toolgate",
|
|
4
|
+
"description": "集中管理 MCP 服务器和 Skill,按组隐藏或恢复工具定义,控制下一轮 prompt 的工具占用。"
|
|
5
|
+
}
|
|
6
|
+
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jidekaixin2dian/dsh-toolgate",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "Manage MCP servers and skills in
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"description": "Manage MCP servers and skills in one place; hide or restore groups of tool definitions to control what enters the next prompt.",
|
|
5
5
|
"icon": "icon.svg",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "lib/index.js",
|