@deepseek-ai/dsh-tool-registry-native 0.0.0-stage → 0.2.3-alpha.4
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 +21 -0
- package/README.i18n.yaml +46 -0
- package/README.md +94 -2
- package/README.zh.md +95 -0
- package/lib/index.js +16 -0
- package/lib/types/index.d.ts +15 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/index.js.map +1 -0
- package/locale/de.json +6 -0
- package/locale/en.json +6 -0
- package/locale/es.json +6 -0
- package/locale/fr.json +6 -0
- package/locale/ja.json +6 -0
- package/locale/pt.json +6 -0
- package/locale/ru.json +6 -0
- package/locale/zh.json +6 -0
- package/package.json +39 -3
- package/src/index.ts +20 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 DeepSeek
|
|
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.i18n.yaml
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# Bilingual-pair consistency record for README.md (docs/i18n/README.md): per heading
|
|
2
|
+
# section, a hash of its English and Chinese blocks outside code blocks and generated regions.
|
|
3
|
+
# After editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/core/tool-registry-native/README.md
|
|
5
|
+
/:
|
|
6
|
+
en: a167e9f03780ad63
|
|
7
|
+
zh: 2e5dc0bd2d08c46e
|
|
8
|
+
/deepseek-ai-dsh-tool-registry-native:
|
|
9
|
+
en: 915a2887c110b13c
|
|
10
|
+
zh: f9f09f05d7274cf1
|
|
11
|
+
/deepseek-ai-dsh-tool-registry-native/summary:
|
|
12
|
+
en: 5c9490442b06770e
|
|
13
|
+
zh: 6356df766580c960
|
|
14
|
+
/deepseek-ai-dsh-tool-registry-native/table-of-contents:
|
|
15
|
+
en: d152484eb41ac6b4
|
|
16
|
+
zh: 09388d293f9be9cb
|
|
17
|
+
/deepseek-ai-dsh-tool-registry-native/use-this-package:
|
|
18
|
+
en: cf4522c5456ba70b
|
|
19
|
+
zh: 4809468e1f216fe6
|
|
20
|
+
/deepseek-ai-dsh-tool-registry-native/understand-the-implementation:
|
|
21
|
+
en: f2c705a5eefe25a2
|
|
22
|
+
zh: 3b05ec06bd61256c
|
|
23
|
+
/deepseek-ai-dsh-tool-registry-native/further-exploration:
|
|
24
|
+
en: dd56262def2d8fa0
|
|
25
|
+
zh: d52f89f273dc3249
|
|
26
|
+
/deepseek-ai-dsh-tool-registry-native/model-experience:
|
|
27
|
+
en: 215e7ba838619b7b
|
|
28
|
+
zh: a311da3843709f90
|
|
29
|
+
/deepseek-ai-dsh-tool-registry-native/model-experience/visible-tools:
|
|
30
|
+
en: 735cc6f4f3bf4cda
|
|
31
|
+
zh: 8dab814b4bba5a7d
|
|
32
|
+
/deepseek-ai-dsh-tool-registry-native/model-experience/visible-tools/what-the-model-sees:
|
|
33
|
+
en: e1f3bbf06e45c22b
|
|
34
|
+
zh: 490cb060c38ccd4e
|
|
35
|
+
/deepseek-ai-dsh-tool-registry-native/model-experience/visible-tools/token-effect:
|
|
36
|
+
en: 81684f49f932e3a3
|
|
37
|
+
zh: 6db2d0a125d990d8
|
|
38
|
+
/deepseek-ai-dsh-tool-registry-native/model-experience/visible-tools/kv-cache-effect:
|
|
39
|
+
en: c0d457297034cf64
|
|
40
|
+
zh: 1dfb5c7f83033d92
|
|
41
|
+
/deepseek-ai-dsh-tool-registry-native/known-limitations-and-deferred-work:
|
|
42
|
+
en: 4621976df86d40cf
|
|
43
|
+
zh: 38ab81da8169883f
|
|
44
|
+
/deepseek-ai-dsh-tool-registry-native/known-limitations-and-deferred-work/dev-note:
|
|
45
|
+
en: e67f633dc6fe7773
|
|
46
|
+
zh: 3bb0c20c93f16f98
|
package/README.md
CHANGED
|
@@ -1,3 +1,95 @@
|
|
|
1
|
-
|
|
1
|
+
---
|
|
2
|
+
description: "Native function calls with scoped tools and bounded batch execution."
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
2
5
|
|
|
3
|
-
|
|
6
|
+
# @deepseek-ai/dsh-tool-registry-native
|
|
7
|
+
|
|
8
|
+
English | [中文](README.zh.md)
|
|
9
|
+
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
Use this root registry when models should call each visible tool directly. Mount it beside the tool registry in the deployment, a preset, or an Agent scope. Parallel-safe calls can overlap; exclusive calls form barriers, and results remain in model order.
|
|
13
|
+
|
|
14
|
+
## Table of Contents
|
|
15
|
+
|
|
16
|
+
- [Use this package](#use-this-package)
|
|
17
|
+
- [Understand the implementation](#understand-the-implementation)
|
|
18
|
+
- [Further Exploration](#further-exploration)
|
|
19
|
+
- [Model Experience](#model-experience)
|
|
20
|
+
- [Known Limitations and Deferred Work](#known-limitations-and-deferred-work)
|
|
21
|
+
- [Dev Note](#dev-note)
|
|
22
|
+
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## Use this package
|
|
27
|
+
|
|
28
|
+
Add this row to a composition with `dsh-tools` mounted. The plugin installs a native root in the mounting scope: `ctx.tools.setRoot()` gives the root the registrations the scope's Agents see, and the root offers each of them as a directly callable entry. Agents use the nearest root, and each scope allows one; the [tools package](../tools/README.md#compose-registries) owns root selection and unavailable roots.
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
- name: '@deepseek-ai/dsh-tool-registry-native'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Configure [agent-loop concurrency](../agent-loop/README.md) for Agent steps; the loop reads the limit once per batch, and `ctx.tools.execute()` runs a batch without a limit at `DEFAULT_MAX_PARALLEL_TOOL_CALLS` (10). Limits must be positive integers; `1` selects serial execution. This plugin has no configuration fields. A plugin that installs its own native root constructs `NativeToolRegistry`, whose only argument is a label for diagnostics, and passes it to `ctx.tools.setRoot()`, which gives it the registrations. A root must not include `ctx.tools`: the inclusion would read the root back, so `setRoot()` rejects such a root with `INVALID_TOOL_COMPOSITION`.
|
|
35
|
+
|
|
36
|
+
-----
|
|
37
|
+
|
|
38
|
+
<a id="understand-the-implementation"></a>
|
|
39
|
+
## Understand the implementation
|
|
40
|
+
|
|
41
|
+
<details>
|
|
42
|
+
<summary>Implementation internals — click to expand</summary>
|
|
43
|
+
|
|
44
|
+
The registry's entries are its registrations plus the entries of the registries it includes, read at every query; as a root it includes the registrations that `setRoot()` gives it, so it always offers the scope's current tools. `ctx.tools.execute()` receives the raw call batch, resolves each call through the selected root, and owns parsing, scheduling, cancellation, and optional model-step logging. A call carrying a `ToolStep` runs only the definition that step declared, so a same-name replacement fails as `UNKNOWN_TOOL` until the next step. It reuses the shared invocation pipeline for policy, tool bodies, and result notifications. After abort, it waits for started work and returns ordered error results for skipped calls. After the plugin unloads, the scope's root selection stays unavailable, and accepted batches still settle their calls.
|
|
45
|
+
|
|
46
|
+
- [`src/index.ts`](src/index.ts) — the root plugin; `NativeToolRegistry` is defined in [`dsh-tools/pipeline`](../tools/src/native-registry.ts).
|
|
47
|
+
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
-----
|
|
51
|
+
|
|
52
|
+
<a id="further-exploration"></a>
|
|
53
|
+
## Further Exploration
|
|
54
|
+
|
|
55
|
+
- [Tool registry](../tools/README.md)
|
|
56
|
+
- [Agent loop](../agent-loop/README.md)
|
|
57
|
+
- [PTC tool registry](../tool-registry-ptc/README.md)
|
|
58
|
+
- [Composable tool registries decision](../../../.agents/notes/implemented/architecture/2026-11-19-composable-tool-registries.md)
|
|
59
|
+
|
|
60
|
+
-----
|
|
61
|
+
|
|
62
|
+
<a id="model-experience"></a>
|
|
63
|
+
## Model Experience
|
|
64
|
+
|
|
65
|
+
### Visible tools
|
|
66
|
+
|
|
67
|
+
#### What the model sees
|
|
68
|
+
|
|
69
|
+
Each visible tool’s `name`, `description`, and JSON Schema parameters; no additional prompt section.
|
|
70
|
+
|
|
71
|
+
#### Token effect
|
|
72
|
+
|
|
73
|
+
Request cost grows with visible definitions; hiding a definition removes its schema cost.
|
|
74
|
+
|
|
75
|
+
#### KV Cache effect
|
|
76
|
+
|
|
77
|
+
The prefix remains stable while tool descriptions and ordering stay unchanged.
|
|
78
|
+
|
|
79
|
+
## Known Limitations and Deferred Work
|
|
80
|
+
|
|
81
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
82
|
+
|
|
83
|
+
These constraints apply to accepted calls.
|
|
84
|
+
|
|
85
|
+
- Same-process tools must observe cancellation; the registry cannot forcibly terminate a tool that ignores its signal.
|
|
86
|
+
|
|
87
|
+
<a id="dev-note"></a>
|
|
88
|
+
### Dev Note
|
|
89
|
+
|
|
90
|
+
<details>
|
|
91
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
92
|
+
|
|
93
|
+
None.
|
|
94
|
+
|
|
95
|
+
</details>
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "具有作用域工具和有界批次执行的原生函数调用。"
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @deepseek-ai/dsh-tool-registry-native
|
|
7
|
+
|
|
8
|
+
[English](README.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 概述
|
|
11
|
+
|
|
12
|
+
当模型应直接调用每个可见工具时,使用此根注册表。在部署、预设或 Agent 作用域中,将它与工具注册表一同挂载。并行安全调用可以重叠,独占调用构成屏障,结果保留模型顺序。
|
|
13
|
+
|
|
14
|
+
## 目录
|
|
15
|
+
|
|
16
|
+
- [使用本包](#use-this-package)
|
|
17
|
+
- [理解实现](#understand-the-implementation)
|
|
18
|
+
- [进一步探索](#further-exploration)
|
|
19
|
+
- [模型体验](#model-experience)
|
|
20
|
+
- [已知限制与延期工作](#known-limitations-and-deferred-work)
|
|
21
|
+
- [开发备注](#dev-note)
|
|
22
|
+
|
|
23
|
+
-----
|
|
24
|
+
|
|
25
|
+
<a id="use-this-package"></a>
|
|
26
|
+
## 使用本包
|
|
27
|
+
|
|
28
|
+
将此行加入已经挂载 `dsh-tools` 的组合。插件在挂载作用域中安装一个原生根注册表:`ctx.tools.setRoot()` 把该作用域中 Agent 看到的注册项交给该根注册表,根注册表再把其中每一项作为可直接调用的条目提供。Agent 使用最近的根注册表,每个作用域只允许一个;根注册表的选择与不可用的根注册表由 [tools 包](../tools/README.zh.md#compose-registries)负责。
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
- name: '@deepseek-ai/dsh-tool-registry-native'
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Agent 步骤使用 [agent-loop 并发配置](../agent-loop/README.zh.md),循环在每个批次开始时读取一次上限;对于未设上限的批次,`ctx.tools.execute()` 按 `DEFAULT_MAX_PARALLEL_TOOL_CALLS`(10)运行。上限必须是正整数;`1` 表示串行执行。本插件没有配置字段。自行安装原生根注册表的插件构造 `NativeToolRegistry`(其唯一参数是用于诊断信息的标签),再把它传给 `ctx.tools.setRoot()`,由后者把注册项交给它。根注册表不得引入 `ctx.tools`:这一引入会回读该根注册表自身,因此 `setRoot()` 以 `INVALID_TOOL_COMPOSITION` 拒绝这样的根注册表。
|
|
35
|
+
|
|
36
|
+
-----
|
|
37
|
+
|
|
38
|
+
<a id="understand-the-implementation"></a>
|
|
39
|
+
## 理解实现
|
|
40
|
+
|
|
41
|
+
<details>
|
|
42
|
+
<summary>实现细节——点击展开</summary>
|
|
43
|
+
|
|
44
|
+
注册表的条目是它自身的注册加上它所引入注册表的条目,每次查询时读取;作为根注册表,它引入 `setRoot()` 交给它的注册项,因此始终提供该作用域当前的工具。`ctx.tools.execute()` 接收原始调用批次,通过选中的根注册表解析每个调用,并负责参数解析、调度、取消和可选的模型步骤日志。携带 `ToolStep` 的调用只运行该步骤声明的定义,因此同名替换在下一个步骤之前都以 `UNKNOWN_TOOL` 失败。`ctx.tools.execute()` 复用共享调用流水线来执行策略、工具和结果通知。中止后,它等待已开始的工作完成,并为跳过的调用返回有序错误结果。插件卸载后,该作用域的根注册表选择保持不可用,已接纳的批次仍会结算其调用。
|
|
45
|
+
|
|
46
|
+
- [`src/index.ts`](src/index.ts) — 根注册表插件;`NativeToolRegistry` 定义在 [`dsh-tools/pipeline`](../tools/src/native-registry.ts) 中。
|
|
47
|
+
|
|
48
|
+
</details>
|
|
49
|
+
|
|
50
|
+
-----
|
|
51
|
+
|
|
52
|
+
<a id="further-exploration"></a>
|
|
53
|
+
## 进一步探索
|
|
54
|
+
|
|
55
|
+
- [工具注册表](../tools/README.zh.md)
|
|
56
|
+
- [Agent 循环](../agent-loop/README.zh.md)
|
|
57
|
+
- [PTC 工具注册表](../tool-registry-ptc/README.zh.md)
|
|
58
|
+
- [可组合工具注册表决策](../../../.agents/notes/implemented/architecture/2026-11-19-composable-tool-registries.zh.md)
|
|
59
|
+
|
|
60
|
+
-----
|
|
61
|
+
|
|
62
|
+
<a id="model-experience"></a>
|
|
63
|
+
## 模型体验
|
|
64
|
+
|
|
65
|
+
### 可见工具
|
|
66
|
+
|
|
67
|
+
#### 模型看到什么
|
|
68
|
+
|
|
69
|
+
每个可见工具的 `name`、`description` 和 JSON Schema 参数;不会增加提示词章节。
|
|
70
|
+
|
|
71
|
+
#### Token 影响
|
|
72
|
+
|
|
73
|
+
请求成本与可见定义成正比;隐藏定义会移除对应 schema 成本。
|
|
74
|
+
|
|
75
|
+
#### KV Cache 影响
|
|
76
|
+
|
|
77
|
+
只要工具描述和顺序不变,前缀就保持稳定。
|
|
78
|
+
|
|
79
|
+
## 已知限制与延期工作
|
|
80
|
+
|
|
81
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
82
|
+
|
|
83
|
+
以下约束适用于已开始的调用。
|
|
84
|
+
|
|
85
|
+
- 同进程工具必须遵守取消信号;注册表无法强制终止忽略信号的工具。
|
|
86
|
+
|
|
87
|
+
<a id="dev-note"></a>
|
|
88
|
+
### 开发备注
|
|
89
|
+
|
|
90
|
+
<details>
|
|
91
|
+
<summary>维护者的工作上下文——点击展开</summary>
|
|
92
|
+
|
|
93
|
+
无。
|
|
94
|
+
|
|
95
|
+
</details>
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { NativeToolRegistry } from "@deepseek-ai/dsh-tools/pipeline";
|
|
2
|
+
//#region lib/types/index.js
|
|
3
|
+
/** Cordis plugin name. */
|
|
4
|
+
const name = "native-tool-registry";
|
|
5
|
+
/** Tool registration and scoped dispatch. */
|
|
6
|
+
const inject = ["tools"];
|
|
7
|
+
/**
|
|
8
|
+
* Install a native root in the mounting scope; it offers every tool that scope's Agents see.
|
|
9
|
+
* The root keeps the registrations it received after unloading, so accepted batches settle their calls.
|
|
10
|
+
* @param ctx - context owning the root selection and its lifetime.
|
|
11
|
+
*/
|
|
12
|
+
function apply(ctx) {
|
|
13
|
+
ctx.tools.setRoot(new NativeToolRegistry());
|
|
14
|
+
}
|
|
15
|
+
//#endregion
|
|
16
|
+
export { NativeToolRegistry, apply, inject, name };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** Native root registry: Agents call every tool their scope offers directly. @module */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis';
|
|
3
|
+
import { NativeToolRegistry } from '@deepseek-ai/dsh-tools/pipeline';
|
|
4
|
+
export { NativeToolRegistry };
|
|
5
|
+
/** Cordis plugin name. */
|
|
6
|
+
export declare const name = "native-tool-registry";
|
|
7
|
+
/** Tool registration and scoped dispatch. */
|
|
8
|
+
export declare const inject: string[];
|
|
9
|
+
/**
|
|
10
|
+
* Install a native root in the mounting scope; it offers every tool that scope's Agents see.
|
|
11
|
+
* The root keeps the registrations it received after unloading, so accepted batches settle their calls.
|
|
12
|
+
* @param ctx - context owning the root selection and its lifetime.
|
|
13
|
+
*/
|
|
14
|
+
export declare function apply(ctx: Context): void;
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,wFAAwF;AACxF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAA;AAElD,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAEpE,OAAO,EAAE,kBAAkB,EAAE,CAAA;AAE7B,0BAA0B;AAC1B,eAAO,MAAM,IAAI,yBAAyB,CAAA;AAC1C,6CAA6C;AAC7C,eAAO,MAAM,MAAM,UAAY,CAAA;AAE/B;;;;GAIG;AACH,wBAAgB,KAAK,CAAC,GAAG,EAAE,OAAO,GAAG,IAAI,CAExC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iCAAiC,CAAA;AAEpE,OAAO,EAAE,kBAAkB,EAAE,CAAA;AAE7B,0BAA0B;AAC1B,MAAM,CAAC,MAAM,IAAI,GAAG,sBAAsB,CAAA;AAC1C,6CAA6C;AAC7C,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,OAAO,CAAC,CAAA;AAE/B;;;;GAIG;AACH,MAAM,UAAU,KAAK,CAAC,GAAY;IAChC,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,kBAAkB,EAAE,CAAC,CAAA;AAC7C,CAAC"}
|
package/locale/de.json
ADDED
package/locale/en.json
ADDED
package/locale/es.json
ADDED
package/locale/fr.json
ADDED
package/locale/ja.json
ADDED
package/locale/pt.json
ADDED
package/locale/ru.json
ADDED
package/locale/zh.json
ADDED
package/package.json
CHANGED
|
@@ -1,6 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@deepseek-ai/dsh-tool-registry-native",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"description": "Native tool registry plugin",
|
|
4
|
+
"version": "0.2.3-alpha.4",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/deepseek-ai/deepseek-harness.git",
|
|
11
|
+
"directory": "packages/core/tool-registry-native"
|
|
12
|
+
},
|
|
13
|
+
"type": "module",
|
|
14
|
+
"main": "lib/index.js",
|
|
15
|
+
"types": "lib/types/index.d.ts",
|
|
16
|
+
"license": "MIT",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./lib/types/index.d.ts",
|
|
20
|
+
"default": "./lib/index.js"
|
|
21
|
+
},
|
|
22
|
+
"./src/*": "./src/*",
|
|
23
|
+
"./package.json": "./package.json",
|
|
24
|
+
"./locale/*.json": "./locale/*.json"
|
|
25
|
+
},
|
|
26
|
+
"files": [
|
|
27
|
+
"locale/*.json",
|
|
28
|
+
"lib/index.js",
|
|
29
|
+
"lib/types/**/*.d.ts",
|
|
30
|
+
"lib/types/**/*.d.ts.map",
|
|
31
|
+
"lib/**/*.js.map",
|
|
32
|
+
"src"
|
|
33
|
+
],
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.3",
|
|
36
|
+
"@deepseek-ai/dsh-tools": "0.2.3-alpha.4"
|
|
37
|
+
},
|
|
38
|
+
"devDependencies": {
|
|
39
|
+
"@deepseek-ai/cordis": "~4.2.0-alpha.3",
|
|
40
|
+
"@deepseek-ai/dsh-tools": "0.2.3-alpha.4"
|
|
41
|
+
}
|
|
6
42
|
}
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** Native root registry: Agents call every tool their scope offers directly. @module */
|
|
2
|
+
import type { Context } from '@deepseek-ai/cordis'
|
|
3
|
+
import type {} from '@deepseek-ai/dsh-tools'
|
|
4
|
+
import { NativeToolRegistry } from '@deepseek-ai/dsh-tools/pipeline'
|
|
5
|
+
|
|
6
|
+
export { NativeToolRegistry }
|
|
7
|
+
|
|
8
|
+
/** Cordis plugin name. */
|
|
9
|
+
export const name = 'native-tool-registry'
|
|
10
|
+
/** Tool registration and scoped dispatch. */
|
|
11
|
+
export const inject = ['tools']
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Install a native root in the mounting scope; it offers every tool that scope's Agents see.
|
|
15
|
+
* The root keeps the registrations it received after unloading, so accepted batches settle their calls.
|
|
16
|
+
* @param ctx - context owning the root selection and its lifetime.
|
|
17
|
+
*/
|
|
18
|
+
export function apply(ctx: Context): void {
|
|
19
|
+
ctx.tools.setRoot(new NativeToolRegistry())
|
|
20
|
+
}
|