dsh-agent-team-presets 0.1.9 → 0.2.0
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.md +39 -30
- package/README.zh.md +39 -30
- package/lib/index.js +58 -19
- package/package.json +3 -1
package/README.md
CHANGED
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
English | [中文](<README.zh.md>)
|
|
8
8
|
|
|
9
|
-
> **Community plugin v0.
|
|
9
|
+
> **Community plugin v0.2.0** · [Tag](https://github.com/bloodarea/dsh-agent-team-presets/tree/v0.2.0)
|
|
10
10
|
>
|
|
11
11
|
> This release targets **DeepSeek Harness 0.2.2-rc.1** and adds **individual member chat**: hover a Team in the composer, then select one member to run the Session as that member with its own role card, tools, Team Skills, and model route. It also moves member routing to `agent.model.select()` and per-step tool admission. Requires Agent Teams; keep 0.1.8 on older hosts. Prebuilt artifacts are included.
|
|
12
12
|
|
|
13
|
-
### What's new in 0.
|
|
13
|
+
### What's new in 0.2.0
|
|
14
14
|
|
|
15
|
-
- **
|
|
16
|
-
- **
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
- **Custom tool policies work on a PTC Session.** Applying a custom allow-list on a PTC preset registers the Harness native tool executor on that Session's Agent scope and never releases it; the deployment executor and every other Session keep PTC, and the Agent owns the registration for its whole life. The trade-off is explicit: that Session stops using `run_code` until it ends. A mount that fails, or a surface that still exposes the PTC transport, is refused without releasing anything, so a refused Session keeps its previous surface.
|
|
16
|
+
- **A spent member allowance is diagnosable.** The creation refusal now reports `N of M` roster slots occupied, names the occupants whose creation never became usable, and states that the Host roster is append-only with no removal API — so a Team that will never summon again is distinguishable from a busy one.
|
|
17
|
+
|
|
18
|
+
Carried over from 0.1.9: individual member chat from the composer, the Harness 0.2.2-rc.1 adaptation (`agent.model.select()` routes, per-step tool admission), and the built-in troubleshooting skill.
|
|
19
19
|
|
|
20
20
|
<a id="project-introduction"></a>
|
|
21
21
|
## Overview
|
|
@@ -176,67 +176,76 @@ The captain always follows the Session, so selecting it changes the Team and the
|
|
|
176
176
|
## Requirements
|
|
177
177
|
|
|
178
178
|
- **DeepSeek Harness `>=0.2.2-rc.1 <0.3.0`.** Verified against **`0.2.2-rc.1`**. Each member's route is recorded through `agent.model.select()` for fresh, forked, and cold-resumed execution; the captain keeps the conversation's model selection. The plugin manager enforces `engines.dsh` from [package.json](<package.json>).
|
|
179
|
-
- **Custom tool allow-lists
|
|
179
|
+
- **Custom tool allow-lists work on PTC by giving that Session its own native surface.** The Host cannot restore an inherited executor after a release, so the plugin never releases one: on a PTC preset it mounts the Harness native tool executor on the Session's Agent scope and leaves the deployment executor alone. The trade-off is deliberate — that Session stops using `run_code` for the rest of its life, while other Sessions and the all-tools mode keep PTC. If mounting fails, or the surface still exposes the PTC transport afterwards, the application is refused and nothing is left behind, because no executor was ever released.
|
|
180
180
|
- **Agent Teams enabled in the target profile.** The standard integration is `@deepseek-ai/dsh-experimental-agent-team-profile`, which supplies the Team service, tools, and Web roster. This plugin configures and manages Teams; it does not replace that subsystem.
|
|
181
181
|
- **A Web or Desktop profile with Settings and the required client services.** Install into the profile you actually use, typically `web` for the Web GUI or `desktop` for Desktop.
|
|
182
182
|
- **Durable storage and a continuable subagent backend for member execution.** Member creation is refused if the storage domain or selected execution backend is unavailable. The default backend names are `spawn` and `fork`.
|
|
183
183
|
|
|
184
|
-
The plugin version (`0.
|
|
184
|
+
The plugin version (`0.2.0`) and the Harness version (`0.2.2-rc.1`, for example) are separate version lines.
|
|
185
185
|
|
|
186
186
|
<a id="use-this-package"></a>
|
|
187
187
|
## Install and upgrade
|
|
188
188
|
|
|
189
|
-
###
|
|
189
|
+
### Install and upgrade
|
|
190
|
+
|
|
191
|
+
#### Option 1 — npm package (recommended; receives update prompts)
|
|
190
192
|
|
|
191
193
|
Open **Global panels → Plugins → Add plugin**, paste the line below into **Package name or address**, and click **Install**:
|
|
192
194
|
|
|
193
195
|
```text
|
|
194
|
-
|
|
196
|
+
dsh-agent-team-presets
|
|
195
197
|
```
|
|
196
198
|
|
|
197
199
|
<!-- release-version: keep in sync with package.json version -->
|
|
198
200
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
- **Registry** selects which npm source the download comes from. **Default registry** uses pnpm's own configuration. Pick **Official npm registry** to bypass a mirror, or **Custom address** for an internal or cloud mirror.
|
|
202
|
-
- `#v0.1.9` pins the GitHub tag; `@0.1.9` works on npm after the next npm publish. Omit the pin to install the latest published package.
|
|
203
|
-
- The field accepts package names, `name@version`, `github:owner/repo`, tarball URLs, or absolute filesystem paths.
|
|
204
|
-
- This package declares `dsh.bundle`, so the plugin manager automatically registers it as a profile bundle layer; do not add a loader entry by hand.
|
|
205
|
-
- Once installed, reinstalling the same package identity is blocked. To switch sources (e.g. from GitHub to npm), uninstall first, then install the new spec.
|
|
206
|
-
- After installation, reload or restart as prompted.
|
|
207
|
-
|
|
208
|
-
### Install from GitHub
|
|
209
|
-
|
|
210
|
-
To receive repository update notifications:
|
|
201
|
+
Or install it from the CLI:
|
|
211
202
|
|
|
212
203
|
```sh
|
|
213
|
-
dsh plugin --profile <profile> add
|
|
204
|
+
dsh plugin --profile <profile> add dsh-agent-team-presets
|
|
214
205
|
```
|
|
215
206
|
|
|
216
207
|
Replace `<profile>` with your active profile (e.g. `web` or `desktop`):
|
|
217
208
|
|
|
218
209
|
```sh
|
|
219
|
-
dsh plugin --profile web add
|
|
210
|
+
dsh plugin --profile web add dsh-agent-team-presets
|
|
220
211
|
```
|
|
221
212
|
|
|
222
|
-
|
|
213
|
+
The plugin manager compares the installed version against npm's `latest` dist-tag, so every later release is offered as an update.
|
|
214
|
+
|
|
215
|
+
#### Option 2 — floating GitHub install
|
|
216
|
+
|
|
217
|
+
Tracks the repository's default branch; an update is offered when `package.json` on that branch moves to a higher version:
|
|
223
218
|
|
|
224
219
|
```sh
|
|
225
|
-
dsh plugin --profile <profile> add github:bloodarea/dsh-agent-team-presets
|
|
220
|
+
dsh plugin --profile <profile> add github:bloodarea/dsh-agent-team-presets
|
|
226
221
|
```
|
|
227
222
|
|
|
228
|
-
|
|
223
|
+
#### Option 3 — reproducible pin (no update prompts)
|
|
224
|
+
|
|
225
|
+
```text
|
|
226
|
+
dsh-agent-team-presets@0.2.0
|
|
227
|
+
dsh plugin --profile <profile> add github:bloodarea/dsh-agent-team-presets#v0.2.0
|
|
228
|
+
```
|
|
229
229
|
|
|
230
|
-
|
|
230
|
+
A fixed version or tag reproduces exactly one release. **A `#tag` GitHub spec is only ever compared against that same tag, so the market never reports an update for it — upgrading means editing the spec by hand.** Use this form only when you need a frozen install.
|
|
231
|
+
|
|
232
|
+
#### Install notes
|
|
233
|
+
|
|
234
|
+
- **Registry** selects which npm source the download comes from. **Default registry** uses pnpm's own configuration. Pick **Official npm registry** to bypass a mirror, or **Custom address** for an internal or cloud mirror.
|
|
235
|
+
- The field accepts package names, `name@version`, `github:owner/repo`, tarball URLs, or absolute filesystem paths.
|
|
236
|
+
- This package declares `dsh.bundle`, so the plugin manager automatically registers it as a profile bundle layer; do not add a loader entry by hand.
|
|
237
|
+
- Once installed, reinstalling the same package identity is blocked. To switch sources (e.g. from GitHub to npm), uninstall first, then install the new spec.
|
|
238
|
+
- GitHub and [npm](https://www.npmjs.com/package/dsh-agent-team-presets) are separate release channels, so check the version this install would fetch before switching channels:
|
|
231
239
|
|
|
232
240
|
```sh
|
|
233
241
|
npm view dsh-agent-team-presets version
|
|
234
|
-
dsh plugin --profile <profile> add dsh-agent-team-presets
|
|
235
242
|
```
|
|
236
243
|
|
|
244
|
+
- After installation, reload or restart as prompted.
|
|
245
|
+
|
|
237
246
|
### Verify and upgrade safely
|
|
238
247
|
|
|
239
|
-
After installation, follow the plugin manager's reload/restart prompts and navigate to **Settings → Agent team presets**. Verify that details display `dsh-agent-team-presets`, version `0.
|
|
248
|
+
After installation, follow the plugin manager's reload/restart prompts and navigate to **Settings → Agent team presets**. Verify that details display `dsh-agent-team-presets`, version `0.2.0`, and a running component.
|
|
240
249
|
|
|
241
250
|
- Back up profile settings, Team definitions, and Session selections before upgrading.
|
|
242
251
|
- When migrating from a development link, remove `@deepseek-ai/dsh-experimental-agent-team-presets` first before enabling the community package.
|
package/README.zh.md
CHANGED
|
@@ -6,16 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
[English](<README.md>) | 中文
|
|
8
8
|
|
|
9
|
-
> **社区插件 v0.
|
|
9
|
+
> **社区插件 v0.2.0** · [标签](https://github.com/bloodarea/dsh-agent-team-presets/tree/v0.2.0)
|
|
10
10
|
>
|
|
11
11
|
> 本版适配 **DeepSeek Harness 0.2.2-rc.1**,新增**与单个成员单独对话**:在输入区悬浮团队后点选成员,即可让当前会话以该成员的角色卡、工具权限、Team Skill 与模型路由运行。成员路由改用 `agent.model.select()`,工具激活按步评估。需要启用 Agent Teams;旧宿主请保留 0.1.8。仓库包含预构建产物,安装时无需构建。
|
|
12
12
|
|
|
13
|
-
### 0.
|
|
13
|
+
### 0.2.0 更新内容
|
|
14
14
|
|
|
15
|
-
-
|
|
16
|
-
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
- **PTC 会话可以用自定义工具策略了。** 在 PTC 预设下应用自定义白名单时,插件把宿主自带的 native 工具执行器注册到该会话的 Agent 作用域并从不释放:部署级执行器与其他会话仍走 PTC,注册归该 Agent 所有并随其销毁。代价是明确的 —— 该会话此后不再使用 `run_code`,直到它结束。挂载失败、或挂载后工具面仍暴露 PTC 传输时会拒绝应用,且因为从未释放,会话保留原有工具面。
|
|
16
|
+
- **名额耗尽时能看出是谁占的。** 召唤被拒时现在会报 `N/M` 个 roster 槽位被占用、按名字列出创建从未成功的占位,并说明宿主 roster 只追加、无移除 API —— 让"永远不能再召唤"的团队与"暂时忙"的团队可区分。
|
|
17
|
+
|
|
18
|
+
沿用 0.1.9:输入区与单个成员单独对话、Harness 0.2.2-rc.1 适配(`agent.model.select()` 路由、按步工具激活)、内置排障 Skill。
|
|
19
19
|
|
|
20
20
|
<a id="project-introduction"></a>
|
|
21
21
|
## 项目介绍
|
|
@@ -176,67 +176,76 @@ DeepSeek Harness 原生 Agent Teams 已经具备多智能体协作能力。在
|
|
|
176
176
|
## 环境要求
|
|
177
177
|
|
|
178
178
|
- **DeepSeek Harness `>=0.2.2-rc.1 <0.3.0`。** 本次实测版本为 **`0.2.2-rc.1`**。成员路由通过 `agent.model.select()` 写入各自会话,fresh、fork 与冷恢复均使用成员自己的配置;队长使用当前会话选择。插件管理器按 [package.json](<package.json>) 的 `engines.dsh` 判定兼容性。
|
|
179
|
-
-
|
|
179
|
+
- **自定义工具白名单在 PTC 下通过给该会话一个自己的 native 面来工作。** 宿主无法在释放执行器后恢复继承,所以插件从不主动释放:在 PTC 预设下它把宿主自带的 native 工具执行器挂到该会话的 Agent 作用域,部署级执行器保持原样。代价是明确的:该会话此后不再使用 `run_code`,而其他会话与「所有工具」模式继续走 PTC。若挂载失败、或挂载后工具面仍暴露 PTC 传输,则应用被拒绝且不留残留 —— 因为从未释放过任何执行器。
|
|
180
180
|
- **目标 profile 已启用 Agent Teams。** 标准集成是 `@deepseek-ai/dsh-experimental-agent-team-profile`,提供团队服务、工具和 Web 名册。本插件负责配置与管理团队,不替代该子系统。
|
|
181
181
|
- **具备 Settings 与所需客户端服务的 Web 或 Desktop profile。** 安装到实际使用的 profile:Web GUI 通常为 `web`,Desktop 通常为 `desktop`。
|
|
182
182
|
- **成员执行所需的持久存储与支持恢复执行的子智能体后端。** 缺少 storage domain 或所选执行后端时,插件会拒绝创建成员。默认后端名为 `spawn` 和 `fork`。
|
|
183
183
|
|
|
184
|
-
插件版本(`0.
|
|
184
|
+
插件版本(`0.2.0`)和 Harness 版本(如 `0.2.2-rc.1`)是不同的版本线。
|
|
185
185
|
|
|
186
186
|
<a id="use-this-package"></a>
|
|
187
187
|
## 安装与升级
|
|
188
188
|
|
|
189
|
-
###
|
|
189
|
+
### 安装与升级
|
|
190
|
+
|
|
191
|
+
#### 方式一 —— npm 包(推荐,会收到更新提示)
|
|
190
192
|
|
|
191
193
|
打开 **全局面板 → 插件 → 添加插件**,把下面这一行粘贴到「包名或地址」,点击 **安装**:
|
|
192
194
|
|
|
193
195
|
```text
|
|
194
|
-
|
|
196
|
+
dsh-agent-team-presets
|
|
195
197
|
```
|
|
196
198
|
|
|
197
199
|
<!-- release-version: 与 package.json 的 version 同步 -->
|
|
198
200
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
- **安装源**决定从哪个 npm 源下载。「默认安装源」指 pnpm 自身配置所指的源。要绕开镜像选「npm 官方源」;要换内网私有源或云厂商镜像选「自定义地址」。
|
|
202
|
-
- `#v0.1.9` 指定 GitHub 标签;npm 发布 0.1.9 后也可用 `@0.1.9`。想装 npm 上最新的已发布版本,去掉版本只填 `dsh-agent-team-presets`。
|
|
203
|
-
- 输入框支持包名、`name@version`、`github:作者/仓库`、tarball 地址或本地绝对路径。
|
|
204
|
-
- 本包声明了自己的 `dsh.bundle`,安装后由插件管理器登记为 profile 的 bundle 层,不要再手写 loader 条目。
|
|
205
|
-
- 已安装本包时无法重复安装同一包名。要更换安装来源(如由 GitHub 改为 npm),先在插件列表中卸载,再粘贴新规格安装。
|
|
206
|
-
- 安装完成后按提示重新加载或重启应用。
|
|
207
|
-
|
|
208
|
-
### 从 GitHub 安装
|
|
209
|
-
|
|
210
|
-
需要接收仓库新版本更新提示时:
|
|
201
|
+
也可以用命令行安装:
|
|
211
202
|
|
|
212
203
|
```sh
|
|
213
|
-
dsh plugin --profile <profile> add
|
|
204
|
+
dsh plugin --profile <profile> add dsh-agent-team-presets
|
|
214
205
|
```
|
|
215
206
|
|
|
216
207
|
将 `<profile>` 替换为实际运行的 profile(例如 `web` 或 `desktop`):
|
|
217
208
|
|
|
218
209
|
```sh
|
|
219
|
-
dsh plugin --profile web add
|
|
210
|
+
dsh plugin --profile web add dsh-agent-team-presets
|
|
220
211
|
```
|
|
221
212
|
|
|
222
|
-
|
|
213
|
+
插件管理器会把已安装版本与 npm 的 `latest` 标签比较,之后每有新版本都会提示更新。
|
|
214
|
+
|
|
215
|
+
#### 方式二 —— 浮动 GitHub 安装
|
|
216
|
+
|
|
217
|
+
跟随仓库默认分支;该分支上的 `package.json` 版本升高后就会提示更新:
|
|
223
218
|
|
|
224
219
|
```sh
|
|
225
|
-
dsh plugin --profile <profile> add github:bloodarea/dsh-agent-team-presets
|
|
220
|
+
dsh plugin --profile <profile> add github:bloodarea/dsh-agent-team-presets
|
|
226
221
|
```
|
|
227
222
|
|
|
228
|
-
|
|
223
|
+
#### 方式三 —— 可复现的固定版本(收不到更新提示)
|
|
224
|
+
|
|
225
|
+
```text
|
|
226
|
+
dsh-agent-team-presets@0.2.0
|
|
227
|
+
dsh plugin --profile <profile> add github:bloodarea/dsh-agent-team-presets#v0.2.0
|
|
228
|
+
```
|
|
229
229
|
|
|
230
|
-
|
|
230
|
+
固定版本号或固定标签只能复现一个确定的发布。**带 `#标签` 的 GitHub 规格只会与同一个标签比对,市场永远不会提示更新——升级只能手动改规格。** 只在确实需要冻结安装时使用这种形式。
|
|
231
|
+
|
|
232
|
+
#### 安装说明
|
|
233
|
+
|
|
234
|
+
- **安装源**决定从哪个 npm 源下载。「默认安装源」指 pnpm 自身配置所指的源。要绕开镜像选「npm 官方源」;要换内网私有源或云厂商镜像选「自定义地址」。
|
|
235
|
+
- 输入框支持包名、`name@version`、`github:作者/仓库`、tarball 地址或本地绝对路径。
|
|
236
|
+
- 本包声明了自己的 `dsh.bundle`,安装后由插件管理器登记为 profile 的 bundle 层,不要再手写 loader 条目。
|
|
237
|
+
- 已安装本包时无法重复安装同一包名。要更换安装来源(如由 GitHub 改为 npm),先在插件列表中卸载,再粘贴新规格安装。
|
|
238
|
+
- GitHub 与 [npm](https://www.npmjs.com/package/dsh-agent-team-presets) 是独立发布渠道,换渠道前先确认这次会装到哪个版本:
|
|
231
239
|
|
|
232
240
|
```sh
|
|
233
241
|
npm view dsh-agent-team-presets version
|
|
234
|
-
dsh plugin --profile <profile> add dsh-agent-team-presets
|
|
235
242
|
```
|
|
236
243
|
|
|
244
|
+
- 安装完成后按提示重新加载或重启应用。
|
|
245
|
+
|
|
237
246
|
### 确认安装并安全升级
|
|
238
247
|
|
|
239
|
-
安装成功后,按插件管理器的提示重新加载或重启,打开 **设置 → 智能体团队预设**。确认插件详情显示 `dsh-agent-team-presets`、版本 `0.
|
|
248
|
+
安装成功后,按插件管理器的提示重新加载或重启,打开 **设置 → 智能体团队预设**。确认插件详情显示 `dsh-agent-team-presets`、版本 `0.2.0`,且组件处于运行中状态。
|
|
240
249
|
|
|
241
250
|
- 升级前备份 profile 设置、团队定义与会话选择记录。
|
|
242
251
|
- 从开发链接迁移时,先通过插件管理器移除 `@deepseek-ai/dsh-experimental-agent-team-presets`,再启用社区包。
|
package/lib/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { fileURLToPath } from "node:url";
|
|
|
12
12
|
import { access, lstat, mkdir, open, readFile, readdir, rename, rm, stat, writeFile } from "node:fs/promises";
|
|
13
13
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
14
14
|
import { constants, lstatSync, realpathSync, statSync } from "node:fs";
|
|
15
|
+
import { NativeToolExecutor } from "@deepseek-ai/dsh-tool-executor-native";
|
|
15
16
|
import { createScope } from "@deepseek-ai/dsh-scope";
|
|
16
17
|
import { Remote, TypertRemoteService } from "@deepseek-ai/dsh-typert-protocol";
|
|
17
18
|
|
|
@@ -1047,10 +1048,48 @@ async function readWire(agent, selection) {
|
|
|
1047
1048
|
}
|
|
1048
1049
|
}
|
|
1049
1050
|
/**
|
|
1050
|
-
*
|
|
1051
|
-
*
|
|
1052
|
-
*
|
|
1053
|
-
*
|
|
1051
|
+
* One mount attempt per Agent. The core native executor is registered on the
|
|
1052
|
+
* Agent's own scope, so its lifetime is the Agent's; caching the attempt keeps a
|
|
1053
|
+
* second Team application from racing a second registration, which the tool
|
|
1054
|
+
* registry refuses in one scope.
|
|
1055
|
+
*/
|
|
1056
|
+
const nativeMounts = /* @__PURE__ */ new WeakMap();
|
|
1057
|
+
/**
|
|
1058
|
+
* Register the core native tool executor on one Agent scope, once.
|
|
1059
|
+
*
|
|
1060
|
+
* The registration is made through `agent.ctx.tools`, which targets this Agent's
|
|
1061
|
+
* scope, and the disposer is deliberately never called: the effect belongs to the
|
|
1062
|
+
* Agent's context, so it is released exactly when the Agent is destroyed, which is
|
|
1063
|
+
* the only moment at which releasing cannot poison a live selection.
|
|
1064
|
+
* @param agent - the Agent whose strict policy needs a native surface.
|
|
1065
|
+
* @returns whether the Agent now owns a native executor registration.
|
|
1066
|
+
*/
|
|
1067
|
+
async function mountNativeExecutor(agent) {
|
|
1068
|
+
const cached = nativeMounts.get(agent);
|
|
1069
|
+
if (cached !== void 0) return cached;
|
|
1070
|
+
const attempt = (async () => {
|
|
1071
|
+
try {
|
|
1072
|
+
agent.ctx.tools.setExecutor(new NativeToolExecutor(agent.ctx));
|
|
1073
|
+
return true;
|
|
1074
|
+
} catch {
|
|
1075
|
+
return false;
|
|
1076
|
+
}
|
|
1077
|
+
})();
|
|
1078
|
+
nativeMounts.set(agent, attempt);
|
|
1079
|
+
return attempt;
|
|
1080
|
+
}
|
|
1081
|
+
/**
|
|
1082
|
+
* Give a strict policy a settled tool surface without releasing anything.
|
|
1083
|
+
*
|
|
1084
|
+
* A native Session already has one. On PTC the deployment default is left alone
|
|
1085
|
+
* and the core native executor is registered on THIS Agent's scope: its lifetime is
|
|
1086
|
+
* the Agent's, so this module never calls the returned disposer and can never
|
|
1087
|
+
* produce rc.1's one-way release. Because the mounted executor is Harness code
|
|
1088
|
+
* rather than a closure over this plugin, a plugin unload leaves a working
|
|
1089
|
+
* surface instead of a dangling reference. The surface is re-read after mounting;
|
|
1090
|
+
* a Session that still exposes the PTC transport is refused rather than silently
|
|
1091
|
+
* governed, and a refused Session keeps whatever it had, because nothing was
|
|
1092
|
+
* released.
|
|
1054
1093
|
* @param agent - the Agent the Team is being applied to.
|
|
1055
1094
|
* @param selection - the route the Session will run on once the application lands.
|
|
1056
1095
|
* @returns whether a strict policy can govern this Session's tool surface.
|
|
@@ -1062,10 +1101,16 @@ async function prepareNativePresentation(agent, selection) {
|
|
|
1062
1101
|
reason: "This Session's effective tool presentation could not be read, so a strict custom tool policy cannot be applied."
|
|
1063
1102
|
};
|
|
1064
1103
|
if (!before.tools.includes(RUN_CODE_NAME)) return { kind: "already-native" };
|
|
1065
|
-
return {
|
|
1104
|
+
if (!await mountNativeExecutor(agent)) return {
|
|
1066
1105
|
kind: "conflict",
|
|
1067
|
-
reason: "Custom Team tool policies
|
|
1106
|
+
reason: "Custom Team tool policies need a native tool surface, and this Session uses PTC. Mounting the native executor on this Session failed, so nothing was released and the current tool surface is unchanged. Use the \"all\" tool mode, or start the conversation on a native Agent preset."
|
|
1068
1107
|
};
|
|
1108
|
+
const after = await readWire(agent, selection);
|
|
1109
|
+
if (after === void 0 || after.tools.includes(RUN_CODE_NAME)) return {
|
|
1110
|
+
kind: "conflict",
|
|
1111
|
+
reason: "Custom Team tool policies need a native tool surface. The native executor is mounted on this Session but the effective tool surface still exposes the general purpose PTC transport, so a strict custom policy cannot govern it. Use the \"all\" tool mode, or start the conversation on a native Agent preset."
|
|
1112
|
+
};
|
|
1113
|
+
return { kind: "already-native" };
|
|
1069
1114
|
}
|
|
1070
1115
|
/** Classify the complete deployment persona before applying a Team. */
|
|
1071
1116
|
function personaBaseline(sections) {
|
|
@@ -1500,7 +1545,7 @@ const BUILTIN_SKILL_CONTENT = `# Agent Team Presets 使用问题排查
|
|
|
1500
1545
|
| 现象 | 先查 | 常见原因 | 处理 |
|
|
1501
1546
|
|---|---|---|---|
|
|
1502
1547
|
| 选中团队但不生效 | 当前会话 Team selection、应用状态、报错文本 | Team 无效、被 quarantine、任务运行中冻结、Agent preset 不兼容 | 修复预设或换 Team;等队长/成员 idle;必要时换 Agent preset |
|
|
1503
|
-
| 自定义工具策略被拒 | 报错是否提到 native
|
|
1548
|
+
| 自定义工具策略被拒 | 报错是否提到 native executor / run_code 仍暴露 | 挂载 native 执行器失败,或挂载后工具面仍含 PTC 传输 | 改用 all-tools,或在会话开始前换 standard/cordis 预设;两种情况都不会留下残留 |
|
|
1504
1549
|
| 成员无法召唤 | 报错文本、成员快照、subagent provider、存储 | 无 member runtime、无存储、无 spawn/fork 后端、深度/配额、快照损坏、技能目录无法发布 | 按报错逐项修复;不要绕过标记或隔离 |
|
|
1505
1550
|
| 成员模型与配置不符 | configuredRoute、model/selection、request/header、成员快照 route;list_agents 的 model 仅作展示 | 展示值 fallback(list_agents 可能返回错误/继承模型);预设未保存;provider 不支持该模型/effort;成员路由在召唤时读取 | 以运行证据为准;三处运行证据一致而 list_agents 不同时,判定为展示问题,实际路由正确 |
|
|
1506
1551
|
| Team Skill 不可见 | 是否已分配给正确 roleId、skill 工具是否可见、库是否打开 | 分配错角色、成员创建早于目录发布、宿主隐藏 skill 工具、存储未打开 | 重新分配/重建成员;检查库与绑定 |
|
|
@@ -1520,19 +1565,13 @@ const BUILTIN_SKILL_CONTENT = `# Agent Team Presets 使用问题排查
|
|
|
1520
1565
|
|
|
1521
1566
|
## 2. 自定义工具策略被拒 / PTC
|
|
1522
1567
|
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
~~~text
|
|
1526
|
-
Custom Team tool policies require a native Agent preset (standard or cordis).
|
|
1527
|
-
This Session uses PTC, and this Harness version cannot restore an inherited
|
|
1528
|
-
executor after a temporary override.
|
|
1529
|
-
~~~
|
|
1568
|
+
PTC 预设 + 自定义白名单现在可以应用,但会改变该会话的工具面:
|
|
1530
1569
|
|
|
1531
|
-
-
|
|
1532
|
-
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
-
|
|
1570
|
+
- 应用时插件把宿主自带的 native 工具执行器挂到**该会话的 Agent 作用域**(\`agent.ctx.tools.setExecutor\`),部署级 PTC 执行器和其他会话都不受影响。
|
|
1571
|
+
- 该注册的 effect 归 Agent ctx 所有,插件**从不主动释放** —— 这正是 DSH 0.2.2-rc.1 单向释放(tombstone)不会咬到的原因;Agent 销毁时随上下文回收。
|
|
1572
|
+
- 代价:这个会话此后不再使用 \`run_code\`,直到它的 Agent 结束。
|
|
1573
|
+
- 报错时只有两种可能:挂载失败,或挂载后工具面仍暴露 PTC 传输;两种情况都不会留下残留(从未释放过执行器),处理方式是该 Team 改用 all-tools 模式,或在会话开始前选 native 预设。
|
|
1574
|
+
- 不要绕过 guard、不要关闭隔离、也不要手工 \`presentAs\`:策略必须与实际执行面一致。
|
|
1536
1575
|
- 检查点:会话当前 Agent preset、Team 队长/成员的 toolMode、报错是否来自应用阶段还是 spawn_team_member。
|
|
1537
1576
|
|
|
1538
1577
|
## 3. 成员无法召唤
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-agent-team-presets",
|
|
3
3
|
"description": "Reusable Agent Team presets for DeepSeek Harness: a captain plus members with their own prompt, model, reasoning effort, and tools.",
|
|
4
|
-
"version": "0.
|
|
4
|
+
"version": "0.2.0",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agent-presets",
|
|
7
7
|
"agent-teams",
|
|
@@ -63,6 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"scripts": {
|
|
65
65
|
"test": "node tools/test.mjs",
|
|
66
|
+
"check:readme": "node tools/check-readme-install.mjs",
|
|
66
67
|
"test:e2e": "node tools/test.mjs --e2e",
|
|
67
68
|
"typecheck": "node tools/typecheck.mjs",
|
|
68
69
|
"bundle": "node tools/build.mjs"
|
|
@@ -86,6 +87,7 @@
|
|
|
86
87
|
"@deepseek-ai/dsh-subagent": ">=0.2.2-rc.1 <0.3.0",
|
|
87
88
|
"@deepseek-ai/dsh-system-prompt": ">=0.2.2-rc.1 <0.3.0",
|
|
88
89
|
"@deepseek-ai/dsh-tools": ">=0.2.2-rc.1 <0.3.0",
|
|
90
|
+
"@deepseek-ai/dsh-tool-executor-native": ">=0.2.2-rc.1 <0.3.0",
|
|
89
91
|
"@deepseek-ai/dsh-typert-protocol": ">=0.2.2-rc.1 <0.3.0",
|
|
90
92
|
"@deepseek-ai/dsh-user-approval": ">=0.2.2-rc.1 <0.3.0",
|
|
91
93
|
"@deepseek-ai/schemastery": ">=3.18.4 <4.0.0"
|