@deepseek-ai/dsh-agent-preset-registry 0.1.7-alpha.1
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 +6 -0
- package/README.md +107 -0
- package/README.zh.md +107 -0
- package/lib/index.js +781 -0
- package/lib/invariant.js +806 -0
- package/lib/typert.host.d.ts +3 -0
- package/lib/typert.host.js +774 -0
- package/lib/typert.remote-client.d.ts +28 -0
- package/lib/typert.remote-client.js +84 -0
- package/lib/types/composition-inventory.d.ts +61 -0
- package/lib/types/composition-inventory.js +100 -0
- package/lib/types/definition.d.ts +20 -0
- package/lib/types/definition.js +29 -0
- package/lib/types/display.d.ts +41 -0
- package/lib/types/display.js +39 -0
- package/lib/types/index.d.ts +127 -0
- package/lib/types/index.js +371 -0
- package/lib/types/invariant.d.ts +16 -0
- package/lib/types/invariant.js +53 -0
- package/lib/types/mount.d.ts +112 -0
- package/lib/types/mount.js +243 -0
- package/lib/types/preset.d.ts +20 -0
- package/lib/types/preset.js +2 -0
- package/lib/types/session.d.ts +42 -0
- package/lib/types/session.js +29 -0
- package/lib/types/types.d.ts +66 -0
- package/lib/types/types.js +2 -0
- package/package.json +96 -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,6 @@
|
|
|
1
|
+
# Bilingual-pair consistency record (docs/i18n/README.md): the git blob hash of each
|
|
2
|
+
# side as of the last confirmed-consistent state. Both languages carry equal authority;
|
|
3
|
+
# after editing either side, bring the other along and re-record with:
|
|
4
|
+
# pnpm run verify-translation-pairing --write packages/preset/agent-preset-registry/README.md
|
|
5
|
+
README.md: 7a1ee3e733fc54194515dbf093e53af0c9698e40
|
|
6
|
+
README.zh.md: 11206a3f9237cbca237220a81fd98ec5eea1083e
|
package/README.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "Choose an Agent’s tools, prompt sections and skills through declarative presets. One process can run several compositions. Failed definitions remain visible, while existing Agents retain the composition they already use."
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @deepseek-ai/dsh-agent-preset-registry
|
|
7
|
+
|
|
8
|
+
English | [中文](README.zh.md)
|
|
9
|
+
|
|
10
|
+
## Summary
|
|
11
|
+
|
|
12
|
+
Choose an Agent’s tools, prompt sections and skills through declarative presets. One process can run several compositions. Failed definitions remain visible, while existing Agents retain the composition they already use.
|
|
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
|
+
### Minimal configuration
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
- id: agent-preset-registry
|
|
32
|
+
name: '@deepseek-ai/dsh-agent-preset-registry'
|
|
33
|
+
config:
|
|
34
|
+
default: standard
|
|
35
|
+
- id: preset-standard
|
|
36
|
+
name: '@deepseek-ai/dsh-agent-preset'
|
|
37
|
+
config:
|
|
38
|
+
id: standard
|
|
39
|
+
plugins: []
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
| Field | Default | Meaning |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| `default` | required | Preset ID used when none is requested |
|
|
45
|
+
|
|
46
|
+
The Web definitions come from the `dsh-web-app` bundle. Definitions are ordinary plugin rows; the registry neither scans directories nor accepts preset paths. The `selectedDefault` and `modeSelectionEnabled` volatile fields of the `agent-preset-registry` entry retain the user default and the chooser visibility; hiding the chooser uses the deployment `default`.
|
|
47
|
+
|
|
48
|
+
The registry writes no declarations. A new preset or an override of a shipped one is a bundle patch: an `insert` of a `@deepseek-ai/dsh-agent-preset` row, or a patch keyed by that row’s id, installed into the profile with `plugin_manager`; Creator mode authors such bundles in conversation.
|
|
49
|
+
|
|
50
|
+
<a id="understand-the-implementation"></a>
|
|
51
|
+
## Understand the implementation
|
|
52
|
+
|
|
53
|
+
<details>
|
|
54
|
+
<summary>Implementation internals — click to expand</summary>
|
|
55
|
+
|
|
56
|
+
Each declaration eagerly creates a registry-owned scope and an in-memory Loader tree. Updating or removing a declaration retires its previous revision. Agents, children and temporary historical reads retain references; releasing the final reference disposes the retired tree. Plugin registrations inherit the preset scope, and the Agent scope’s parent link controls visibility. The Host continues to share the Agent loop.
|
|
57
|
+
|
|
58
|
+
Activation auditing checks imports, missing services and globally leaked services. Import failures, activation failures and leaks reject the mount. A row waiting for a Host service stays mounted, and every read and binding re-audits it after the Host Loader tree settles, so startup order does not decide the outcome. Failure prevents new bindings to that definition. Session logs retain the preset ID and blank-session selections; recovery after restart uses the current definition of that ID and rejects a missing definition.
|
|
59
|
+
|
|
60
|
+
| File | Responsibility |
|
|
61
|
+
|---|---|
|
|
62
|
+
| [index.ts](src/index.ts) | Registration, revisions and Agent bindings |
|
|
63
|
+
| [mount.ts](src/mount.ts) | Scoped plugin trees and activation auditing |
|
|
64
|
+
|
|
65
|
+
</details>
|
|
66
|
+
|
|
67
|
+
<a id="further-exploration"></a>
|
|
68
|
+
## Further Exploration
|
|
69
|
+
|
|
70
|
+
- [Scope](../../core/scope/README.md) — Registration isolation.
|
|
71
|
+
- [Agent](../../core/agent/README.md) — Session runtime.
|
|
72
|
+
- [Cordis](../../../docs/cordis-primer.md) — Plugin configuration and lifecycle.
|
|
73
|
+
|
|
74
|
+
<a id="model-experience"></a>
|
|
75
|
+
## Model Experience
|
|
76
|
+
|
|
77
|
+
### Preset selection
|
|
78
|
+
|
|
79
|
+
#### What the model sees
|
|
80
|
+
|
|
81
|
+
Nothing directly: the selected preset’s `plugins` own the model-visible tools and prompt sections.
|
|
82
|
+
|
|
83
|
+
#### Token effect
|
|
84
|
+
|
|
85
|
+
None from this package; each mounted `plugins` row declares its own tools and sections.
|
|
86
|
+
|
|
87
|
+
#### KV Cache effect
|
|
88
|
+
|
|
89
|
+
Existing Agents retain their plugins and prompts. New Agents build their prefixes from the current definition.
|
|
90
|
+
|
|
91
|
+
## Known Limitations and Deferred Work
|
|
92
|
+
|
|
93
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
94
|
+
|
|
95
|
+
- Presets are not security sandboxes: YAML and plugins can execute Host code. A user override replaces the complete child list and does not automatically merge future changes to the builtin list. Old revision implementations are not retained across process restarts.
|
|
96
|
+
|
|
97
|
+
<a id="dev-note"></a>
|
|
98
|
+
### Dev Note
|
|
99
|
+
|
|
100
|
+
<details>
|
|
101
|
+
<summary>Working context for maintainers — click to expand</summary>
|
|
102
|
+
|
|
103
|
+
None.
|
|
104
|
+
|
|
105
|
+
</details>
|
|
106
|
+
|
|
107
|
+
**Runtime invariant:** The companion checks services leaked globally after activation and Agents addressing a model without joining a configured preset.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "通过声明式 preset 选择 Agent 的工具、提示词和技能。同一进程可以运行多种组合。配置失败会显示在列表中;现有 Agent 保留已经使用的组合。"
|
|
3
|
+
kind: "package-reference"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# @deepseek-ai/dsh-agent-preset-registry
|
|
7
|
+
|
|
8
|
+
[English](README.md) | 中文
|
|
9
|
+
|
|
10
|
+
## 概述
|
|
11
|
+
|
|
12
|
+
通过声明式 preset 选择 Agent 的工具、提示词和技能。同一进程可以运行多种组合。配置失败会显示在列表中;现有 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
|
+
### 最小配置
|
|
29
|
+
|
|
30
|
+
```yaml
|
|
31
|
+
- id: agent-preset-registry
|
|
32
|
+
name: '@deepseek-ai/dsh-agent-preset-registry'
|
|
33
|
+
config:
|
|
34
|
+
default: standard
|
|
35
|
+
- id: preset-standard
|
|
36
|
+
name: '@deepseek-ai/dsh-agent-preset'
|
|
37
|
+
config:
|
|
38
|
+
id: standard
|
|
39
|
+
plugins: []
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
| 字段 | 默认值 | 含义 |
|
|
43
|
+
|---|---|---|
|
|
44
|
+
| `default` | 必填 | 未显式指定时使用的 preset ID |
|
|
45
|
+
|
|
46
|
+
Web 内置定义来自 `dsh-web-app` bundle。定义使用普通插件行;注册表不扫描目录,也不接受 preset 路径。`agent-preset-registry` 条目的 volatile 字段 `selectedDefault` 与 `modeSelectionEnabled` 保留用户默认值和选择器可见性;隐藏选择器时使用部署 `default`。
|
|
47
|
+
|
|
48
|
+
注册表不写入任何声明。新建 preset 或覆盖内置 preset 都是 bundle 补丁:插入一行 `@deepseek-ai/dsh-agent-preset`,或按该行 id 写覆盖补丁,再用 `plugin_manager` 安装到 profile;创造模式在对话中编写这类 bundle。
|
|
49
|
+
|
|
50
|
+
<a id="understand-the-implementation"></a>
|
|
51
|
+
## 理解实现
|
|
52
|
+
|
|
53
|
+
<details>
|
|
54
|
+
<summary>实现细节 — 点击展开</summary>
|
|
55
|
+
|
|
56
|
+
每个声明在启动时创建注册表拥有的 scope 和内存 Loader 树。更新或移除声明会让旧代际退役;Agent、子 Agent 和临时历史读取各自持有引用,最后一个引用释放后才销毁插件树。插件注册继承 preset scope,Agent scope 的父链接决定可见性;Agent loop 仍由宿主共享。
|
|
57
|
+
|
|
58
|
+
激活审计检查导入失败、缺失服务和向全局泄漏的服务。导入失败、激活失败和泄漏会拒绝挂载。等待 Host 服务的行保持挂载,每次读取和绑定都在 Host Loader 树结算后重新审计,因此启动顺序不决定结果。失败只禁用该定义的新绑定。会话日志保存 preset ID 和空白会话的切换记录;重启恢复使用该 ID 的当前定义,缺失时拒绝恢复。
|
|
59
|
+
|
|
60
|
+
| 文件 | 职责 |
|
|
61
|
+
|---|---|
|
|
62
|
+
| [index.ts](src/index.ts) | 注册、代际与 Agent 绑定 |
|
|
63
|
+
| [mount.ts](src/mount.ts) | 隔离插件树与激活审计 |
|
|
64
|
+
|
|
65
|
+
</details>
|
|
66
|
+
|
|
67
|
+
<a id="further-exploration"></a>
|
|
68
|
+
## 延伸阅读
|
|
69
|
+
|
|
70
|
+
- [Scope](../../core/scope/README.zh.md) — 注册隔离。
|
|
71
|
+
- [Agent](../../core/agent/README.zh.md) — 会话运行时。
|
|
72
|
+
- [Cordis](../../../docs/cordis-primer.zh.md) — 插件配置与生命周期。
|
|
73
|
+
|
|
74
|
+
<a id="model-experience"></a>
|
|
75
|
+
## 模型体验
|
|
76
|
+
|
|
77
|
+
### Preset 选择
|
|
78
|
+
|
|
79
|
+
#### 模型看到的内容
|
|
80
|
+
|
|
81
|
+
没有直接内容:所选 preset 的 `plugins` 拥有模型可见的工具和提示词片段。
|
|
82
|
+
|
|
83
|
+
#### Token 影响
|
|
84
|
+
|
|
85
|
+
本包自身没有;每个挂载的 `plugins` 行声明自己的工具和片段。
|
|
86
|
+
|
|
87
|
+
#### KV Cache effect
|
|
88
|
+
|
|
89
|
+
已有 Agent 保留插件和提示词。新 Agent 从当前定义构建前缀。
|
|
90
|
+
|
|
91
|
+
## 已知限制与待办
|
|
92
|
+
|
|
93
|
+
<a id="known-limitations-and-deferred-work"></a>
|
|
94
|
+
|
|
95
|
+
- preset 不是安全沙箱:YAML 及插件可以执行 Host 代码。用户覆盖替换完整子插件列表,不自动合并内置列表的未来更新。进程退出后不保存旧代际的插件实现。
|
|
96
|
+
|
|
97
|
+
<a id="dev-note"></a>
|
|
98
|
+
### 开发备注
|
|
99
|
+
|
|
100
|
+
<details>
|
|
101
|
+
<summary>维护者工作上下文 — 点击展开</summary>
|
|
102
|
+
|
|
103
|
+
无。
|
|
104
|
+
|
|
105
|
+
</details>
|
|
106
|
+
|
|
107
|
+
**运行时不变量:** companion 检查挂载后泄漏到全局的服务,以及模型请求前尚未绑定 preset 的 Agent。
|