@oh-my-dsh/auto-team 0.0.0-stage → 0.1.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/LICENSE +29 -0
- package/README.md +122 -2
- package/README.zh.md +123 -0
- package/cordis.patch.yml +10 -0
- package/lib/index.d.ts +85 -0
- package/lib/index.js +711 -0
- package/package.json +105 -3
- package/src/assets/icon.svg +13 -0
- package/src/assets/locale/en.json +6 -0
- package/src/assets/locale/zh.json +6 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
BSD 3-Clause License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026, Plugin Authors
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Redistribution and use in source and binary forms, with or without
|
|
7
|
+
modification, are permitted provided that the following conditions are met:
|
|
8
|
+
|
|
9
|
+
1. Redistributions of source code must retain the above copyright notice, this
|
|
10
|
+
list of conditions and the following disclaimer.
|
|
11
|
+
|
|
12
|
+
2. Redistributions in binary form must reproduce the above copyright notice,
|
|
13
|
+
this list of conditions and the following disclaimer in the documentation
|
|
14
|
+
and/or other materials provided with the distribution.
|
|
15
|
+
|
|
16
|
+
3. Neither the name of the copyright holder nor the names of its
|
|
17
|
+
contributors may be used to endorse or promote products derived from
|
|
18
|
+
this software without specific prior written permission.
|
|
19
|
+
|
|
20
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
|
21
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
22
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
23
|
+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
24
|
+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
25
|
+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
26
|
+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
27
|
+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
28
|
+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
29
|
+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,123 @@
|
|
|
1
|
-
#
|
|
1
|
+
# DSH Auto Team
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
English | [中文](README.zh.md)
|
|
4
|
+
|
|
5
|
+
`@oh-my-dsh/auto-team` is a host-only DeepSeek Harness plugin (Cordis id `auto-team`). It gives long tasks a scored start and a team-shaped run, and it keeps the numeric score out of the model's context.
|
|
6
|
+
|
|
7
|
+
The plugin adds the first-round decision, the goal bridge, and the Lead and worker policy gates. The teammate, task-board, and worktree tools come from the host profile. It targets DSH 0.2.1-rc.2.
|
|
8
|
+
|
|
9
|
+
## How a task runs
|
|
10
|
+
|
|
11
|
+
The Lead calls `auto_team_score` once in the first round. The call takes five factors from 1 to 5, covering scope, parallelism, ambiguity, risk, and expected_steps, plus the task goal in its ordinary meaning.
|
|
12
|
+
|
|
13
|
+
The plugin turns the factors into a weighted score from 0 to 1. The model gets only `team` or `solo`; the score and the effective threshold stay host-side. The default threshold is 0.55. If a user-created goal already exists at the first score, the threshold is multiplied by 0.6.
|
|
14
|
+
|
|
15
|
+
The first round must be scored. If the turn tries to close before the tool ran, an `agent/turn-stopping` listener steers the Lead back with a reminder.
|
|
16
|
+
|
|
17
|
+
The score is frozen for the task. It is written to the session log as a `plugin:auto-team/score` record and folded into the host-only `autoTeam` projection, so resuming a session keeps the decision and does not score again.
|
|
18
|
+
|
|
19
|
+
On a team decision the plugin:
|
|
20
|
+
|
|
21
|
+
- reuses the current goal, or starts one when none exists;
|
|
22
|
+
- ensures a reporting teammate named `reporter`, which is configurable;
|
|
23
|
+
- tells the Lead to keep the main Git repository and the team, and not to write code;
|
|
24
|
+
- denies the Lead's `write` and `edit` calls by default;
|
|
25
|
+
- requires each execution teammate to complete `create_worktree` before its own `write` or `edit` is allowed, and checks that an edit path stays inside the registered worktree when the host returns one. The reporter is exempt.
|
|
26
|
+
|
|
27
|
+
Multi-round execution belongs to the goal runtime. The plugin starts or reuses the goal and does not run its own continuation loop.
|
|
28
|
+
|
|
29
|
+
On a solo decision the task runs as a normal single-agent task.
|
|
30
|
+
|
|
31
|
+
## Requirements
|
|
32
|
+
|
|
33
|
+
The profile must compose these host services:
|
|
34
|
+
|
|
35
|
+
- `agents`, `tools`, `systemPrompt`, `sessionProjections`
|
|
36
|
+
- `agentTeams` from `@deepseek-ai/dsh-experimental-agent-team`
|
|
37
|
+
- `goals` from `@deepseek-ai/dsh-goal`
|
|
38
|
+
|
|
39
|
+
The plugin loads without them but logs a warning and installs nothing. When a service arrives later, an `internal/service` listener retries the install.
|
|
40
|
+
|
|
41
|
+
## Install
|
|
42
|
+
|
|
43
|
+
Build and pack the package:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
pnpm install
|
|
47
|
+
pnpm run lint
|
|
48
|
+
pnpm test
|
|
49
|
+
pnpm run build
|
|
50
|
+
pnpm pack
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Install from npm once the package is published:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
dsh plugin --profile <profile> add @oh-my-dsh/auto-team
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Or install a locally packed tarball:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
dsh plugin --profile <profile> add ./oh-my-dsh-auto-team-0.1.0.tgz
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
The package name is `@oh-my-dsh/auto-team`, published under the `@oh-my-dsh` scope.
|
|
66
|
+
|
|
67
|
+
## Configuration
|
|
68
|
+
|
|
69
|
+
Every field is optional. Schemastery checks the values at load; invalid values fail activation.
|
|
70
|
+
|
|
71
|
+
| Field | Default | Meaning |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| `message` | `auto-team loaded` | Activation log line. |
|
|
74
|
+
| `threshold` | `0.55` | Base score needed for Team mode. |
|
|
75
|
+
| `manualGoalFactor` | `0.6` | Multiplier applied to the threshold when a user-created goal exists. |
|
|
76
|
+
| `weights` | scope 0.3, parallelism 0.25, ambiguity 0.15, risk 0.15, expectedSteps 0.15 | Relative weight of each difficulty factor. |
|
|
77
|
+
| `reportingAgentName` | `reporter` | Name of the reporting teammate. |
|
|
78
|
+
| `reportingProvider` | `spawn` | Subagent provider used for the reporter. |
|
|
79
|
+
| `goalMaxRounds` | `256` | Round cap used when the plugin starts a goal. |
|
|
80
|
+
| `enforceLeadNoCode` | `true` | Install the Lead write/edit gate. |
|
|
81
|
+
| `leadDeniedTools` | `['write', 'edit']` | Tool names denied to a Team-mode Lead. |
|
|
82
|
+
|
|
83
|
+
## Tool
|
|
84
|
+
|
|
85
|
+
The package adds one model-facing tool.
|
|
86
|
+
|
|
87
|
+
`auto_team_score` takes:
|
|
88
|
+
|
|
89
|
+
| Parameter | Type | Meaning |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| `scope` | integer 1 to 5 | Expected change scope. |
|
|
92
|
+
| `parallelism` | integer 1 to 5 | How much independent work can run at once. |
|
|
93
|
+
| `ambiguity` | integer 1 to 5 | How much requirement or design uncertainty remains. |
|
|
94
|
+
| `risk` | integer 1 to 5 | How costly a wrong change would be. |
|
|
95
|
+
| `expected_steps` | integer 1 to 5 | Expected task length. |
|
|
96
|
+
| `objective` | string | The task goal in its ordinary meaning. Used only when the plugin starts a goal. |
|
|
97
|
+
|
|
98
|
+
It returns `{ decision, goal, reporter? }`. The numeric score and threshold are not in the result. The host's Agent Teams tools handle spawning, messaging, and the shared task board. The host goal lifecycle handles completion and continuation.
|
|
99
|
+
|
|
100
|
+
## Guards and limits
|
|
101
|
+
|
|
102
|
+
- The Lead gate is a tool-name policy, not a sandbox. `pwsh`, `run_code`, and direct filesystem effects can bypass it. The policy tells the Lead not to use them as a workaround.
|
|
103
|
+
- The worker gate checks that a `create_worktree` call succeeded and, when the host returns the worktree path, that each `write` or `edit` uses an absolute `file_path` inside it. If the host result has no path, the gate falls back to checking only that the call succeeded.
|
|
104
|
+
- The reporter is spawned with the configured provider. If the spawn fails, the score stays frozen and a later call retries the reporter.
|
|
105
|
+
- A real DSH profile composition test has not been run in this repository. `tests/runtime.test.ts` mounts a real Cordis context and a real detached Session with fake host services, and covers the install path, the scoring tool, the stop guard, the Lead gate, and the worker gate.
|
|
106
|
+
|
|
107
|
+
## Development
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
pnpm install
|
|
111
|
+
pnpm run lint
|
|
112
|
+
pnpm test
|
|
113
|
+
pnpm run build
|
|
114
|
+
pnpm pack --dry-run --json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
The tests cover the scoring policy, configuration, goal and reporter orchestration, the durable score projection, the runtime install path, and the Loader export shape.
|
|
118
|
+
|
|
119
|
+
Read [the design note](docs/auto-team-design.md) for the behavior and the flow chart, and [the plugin contracts](docs/dsh-plugin-contracts.md) for the package rules.
|
|
120
|
+
|
|
121
|
+
## Status
|
|
122
|
+
|
|
123
|
+
The core flow works and is covered by the repository tests. The release checks pass. Install the package in a profile that composes the required services, then run a long task to verify the behavior in your environment.
|
package/README.zh.md
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
# DSH Auto Team
|
|
2
|
+
|
|
3
|
+
[English](README.md) | 中文
|
|
4
|
+
|
|
5
|
+
`@oh-my-dsh/auto-team` 是一个只跑在宿主侧的 DeepSeek Harness 插件,Cordis id 为 `auto-team`。它给长任务一个带评分的起点和团队式的执行方式,同时把具体分数留在模型上下文之外。
|
|
6
|
+
|
|
7
|
+
插件负责首轮判断、goal 桥接,以及 Lead 和执行 Agent 的策略闸门。队友、任务板和 worktree 工具由宿主 profile 提供。目标版本是 DSH 0.2.1-rc.2。
|
|
8
|
+
|
|
9
|
+
## 任务怎么跑
|
|
10
|
+
|
|
11
|
+
首轮由 Lead 调用一次 `auto_team_score`。参数是五个 1 到 5 的难度因子:scope、parallelism、ambiguity、risk、expected_steps,再加一句任务在通常语义上的目标。
|
|
12
|
+
|
|
13
|
+
插件把因子折算成 0 到 1 的加权分数。模型只拿到 `team` 或 `solo`,分数和实际阈值都留在宿主侧。默认阈值是 0.55。如果第一次打分时已经存在用户触发的 goal,阈值乘以 0.6。
|
|
14
|
+
|
|
15
|
+
首轮必须打分。如果这一轮想在没有调用工具时结束,`agent/turn-stopping` 监听器会把 Lead 拉回来,再发一次提醒。
|
|
16
|
+
|
|
17
|
+
分数在任务内冻结。它以 `plugin:auto-team/score` 记录写进 session log,并折进宿主侧的 `autoTeam` 投影。resume 时恢复这个决定,不会重新打分。
|
|
18
|
+
|
|
19
|
+
决定使用团队后,插件会:
|
|
20
|
+
|
|
21
|
+
- 复用当前 goal;没有 goal 就启动一个;
|
|
22
|
+
- 确保存在名为 `reporter` 的汇报 Agent,名字可配置;
|
|
23
|
+
- 提示 Lead 维护主 Git 仓库和团队,不写代码;
|
|
24
|
+
- 默认拒绝 Lead 的 `write` 和 `edit`;
|
|
25
|
+
- 要求每个执行 Agent 先成功调用 `create_worktree`,之后才允许自己的 `write` 或 `edit`;宿主返回 worktree 路径时,还会检查编辑路径是否在该 worktree 内。汇报 Agent 不受这条限制。
|
|
26
|
+
|
|
27
|
+
多轮执行交给 goal 运行时。插件只负责启动或复用 goal,不自己维护续跑循环。
|
|
28
|
+
|
|
29
|
+
决定不使用团队时,任务按普通单 Agent 流程执行。
|
|
30
|
+
|
|
31
|
+
## 依赖
|
|
32
|
+
|
|
33
|
+
profile 需要组合这些宿主服务:
|
|
34
|
+
|
|
35
|
+
- `agents`、`tools`、`systemPrompt`、`sessionProjections`
|
|
36
|
+
- `agentTeams`,来自 `@deepseek-ai/dsh-experimental-agent-team`
|
|
37
|
+
- `goals`,来自 `@deepseek-ai/dsh-goal`
|
|
38
|
+
|
|
39
|
+
服务缺失时插件仍会加载,但只打一条警告,不安装任何东西。之后某个服务到位,`internal/service` 监听器会重试安装。
|
|
40
|
+
|
|
41
|
+
## 安装
|
|
42
|
+
|
|
43
|
+
构建并打包:
|
|
44
|
+
|
|
45
|
+
```sh
|
|
46
|
+
pnpm install
|
|
47
|
+
pnpm run lint
|
|
48
|
+
pnpm test
|
|
49
|
+
pnpm run build
|
|
50
|
+
pnpm pack
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
从 npm 安装已发布的包:
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
dsh plugin --profile <profile> add @oh-my-dsh/auto-team
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
或者安装本地打包的 tarball:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
dsh plugin --profile <profile> add ./oh-my-dsh-auto-team-0.1.0.tgz
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
包名是 `@oh-my-dsh/auto-team`,发布在 `@oh-my-dsh` scope 下。
|
|
66
|
+
|
|
67
|
+
## 配置
|
|
68
|
+
|
|
69
|
+
所有字段都可选。Schemastery 在加载时校验,非法值会让激活失败。
|
|
70
|
+
|
|
71
|
+
| 字段 | 默认值 | 含义 |
|
|
72
|
+
| --- | --- | --- |
|
|
73
|
+
| `message` | `auto-team loaded` | 激活时的日志。 |
|
|
74
|
+
| `threshold` | `0.55` | 进入团队模式的基础分数。 |
|
|
75
|
+
| `manualGoalFactor` | `0.6` | 已有用户触发 goal 时,阈值的乘数。 |
|
|
76
|
+
| `weights` | scope 0.3、parallelism 0.25、ambiguity 0.15、risk 0.15、expectedSteps 0.15 | 各难度因子的相对权重。 |
|
|
77
|
+
| `reportingAgentName` | `reporter` | 汇报 Agent 的名字。 |
|
|
78
|
+
| `reportingProvider` | `spawn` | 创建汇报 Agent 时用的子 Agent provider。 |
|
|
79
|
+
| `goalMaxRounds` | `256` | 插件启动 goal 时使用的轮次上限。 |
|
|
80
|
+
| `enforceLeadNoCode` | `true` | 是否安装 Lead 的写文件闸门。 |
|
|
81
|
+
| `leadDeniedTools` | `['write', 'edit']` | 团队模式下拒绝给 Lead 的工具名。 |
|
|
82
|
+
|
|
83
|
+
## 工具
|
|
84
|
+
|
|
85
|
+
这个包只增加一个模型可见工具。
|
|
86
|
+
|
|
87
|
+
`auto_team_score` 的参数:
|
|
88
|
+
|
|
89
|
+
| 参数 | 类型 | 含义 |
|
|
90
|
+
| --- | --- | --- |
|
|
91
|
+
| `scope` | 1 到 5 的整数 | 预计改动范围。 |
|
|
92
|
+
| `parallelism` | 1 到 5 的整数 | 有多少独立工作可以同时做。 |
|
|
93
|
+
| `ambiguity` | 1 到 5 的整数 | 还剩多少需求或设计不确定。 |
|
|
94
|
+
| `risk` | 1 到 5 的整数 | 改错了代价多大。 |
|
|
95
|
+
| `expected_steps` | 1 到 5 的整数 | 预计任务有多长。 |
|
|
96
|
+
| `objective` | 字符串 | 任务在通常语义上的目标。只在插件启动 goal 时使用。 |
|
|
97
|
+
|
|
98
|
+
返回 `{ decision, goal, reporter? }`。分数和阈值不在返回里。创建队友、发消息和共享任务板由宿主的 Agent Teams 工具负责;完成和续跑由宿主的 goal 生命周期负责。
|
|
99
|
+
|
|
100
|
+
## 闸门与限制
|
|
101
|
+
|
|
102
|
+
- Lead 的闸门是工具名策略,不是沙箱。`pwsh`、`run_code` 和直接的文件系统操作可以绕过。策略文本会明确要求 Lead 不要拿它们绕路。
|
|
103
|
+
- 执行 Agent 的闸门会检查 `create_worktree` 是否成功;宿主返回 worktree 路径时,还会要求每次 `write`/`edit` 的 `file_path` 是该路径内的绝对路径。宿主结果没有路径时,只检查成功。
|
|
104
|
+
- 汇报 Agent 用配置的 provider 创建。如果创建失败,分数仍保持冻结,后续调用会重试创建。
|
|
105
|
+
- 仓库里还没有跑过真实 DSH profile 的组合测试。`tests/runtime.test.ts` 用真实 Cordis Context、真实 detached Session 和假的宿主服务,覆盖安装路径、打分工具、首轮停止闸门、Lead 闸门和执行 Agent 闸门。
|
|
106
|
+
|
|
107
|
+
## 开发
|
|
108
|
+
|
|
109
|
+
```sh
|
|
110
|
+
pnpm install
|
|
111
|
+
pnpm run lint
|
|
112
|
+
pnpm test
|
|
113
|
+
pnpm run build
|
|
114
|
+
pnpm pack --dry-run --json
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
测试覆盖评分策略、配置、goal 与汇报 Agent 编排、持久化分数投影、运行时安装路径,以及 Loader 导出形状。
|
|
118
|
+
|
|
119
|
+
行为说明和流程图见[设计文档](docs/auto-team-design.md),包规则见[插件契约](docs/dsh-plugin-contracts.md)。
|
|
120
|
+
|
|
121
|
+
## 状态
|
|
122
|
+
|
|
123
|
+
核心流程已经可用,并有仓库测试覆盖。发布检查已通过。把包装进已经组合好所需服务的 profile,跑一个长任务确认实际行为。
|
package/cordis.patch.yml
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# Bundle patch applied over the selected DSH profile when this package is listed
|
|
2
|
+
# in `dsh.profile.bundles`. The row id is deployment-local; the package name
|
|
3
|
+
# must match package.json. Display metadata and the icon come from the exported
|
|
4
|
+
# `locale/*.json` files and `./icon` resource, not from this patch.
|
|
5
|
+
|
|
6
|
+
- insert:
|
|
7
|
+
- id: auto-team
|
|
8
|
+
name: '@oh-my-dsh/auto-team'
|
|
9
|
+
config:
|
|
10
|
+
message: auto-team loaded
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import schema from "@deepseek-ai/schemastery";
|
|
2
|
+
import { Context } from "@deepseek-ai/cordis";
|
|
3
|
+
//#region src/policy.d.ts
|
|
4
|
+
/** Relative weight of each difficulty factor. */
|
|
5
|
+
interface ScoreWeights {
|
|
6
|
+
readonly scope: number;
|
|
7
|
+
readonly parallelism: number;
|
|
8
|
+
readonly ambiguity: number;
|
|
9
|
+
readonly risk: number;
|
|
10
|
+
readonly expectedSteps: number;
|
|
11
|
+
}
|
|
12
|
+
//#endregion
|
|
13
|
+
//#region src/config.d.ts
|
|
14
|
+
/** Plugin configuration supplied by the profile composition. */
|
|
15
|
+
interface PluginConfig {
|
|
16
|
+
/** Message written when this plugin loads. */
|
|
17
|
+
message?: string;
|
|
18
|
+
/** Base team-trigger threshold in the 0..1 range. */
|
|
19
|
+
threshold?: number;
|
|
20
|
+
/**
|
|
21
|
+
* Multiplier applied to the threshold when a user-triggered goal already
|
|
22
|
+
* exists.
|
|
23
|
+
*/
|
|
24
|
+
manualGoalFactor?: number;
|
|
25
|
+
/** Relative weight of each difficulty factor. */
|
|
26
|
+
weights?: Partial<ScoreWeights>;
|
|
27
|
+
/** Name of the reporting teammate created for a team task. */
|
|
28
|
+
reportingAgentName?: string;
|
|
29
|
+
/** Continuable-subagent provider used for the reporting teammate. */
|
|
30
|
+
reportingProvider?: string;
|
|
31
|
+
/** Positive round cap used when auto-team creates a goal. */
|
|
32
|
+
goalMaxRounds?: number;
|
|
33
|
+
/** Block Lead writes after the team decision. Defaults to true. */
|
|
34
|
+
enforceLeadNoCode?: boolean;
|
|
35
|
+
/** Tool names denied to a Team-mode Lead. Defaults to write and edit. */
|
|
36
|
+
leadDeniedTools?: string[];
|
|
37
|
+
}
|
|
38
|
+
/** Loader-visible configuration schema and defaults. */
|
|
39
|
+
declare const Config: schema<PluginConfig>;
|
|
40
|
+
/** Configuration after defaults have been resolved. */
|
|
41
|
+
interface ResolvedConfig {
|
|
42
|
+
/** Message written when this plugin loads. */
|
|
43
|
+
message: string;
|
|
44
|
+
/** Base team-trigger threshold in the 0..1 range. */
|
|
45
|
+
threshold: number;
|
|
46
|
+
/**
|
|
47
|
+
* Multiplier applied to the threshold when a user-triggered goal already
|
|
48
|
+
* exists.
|
|
49
|
+
*/
|
|
50
|
+
manualGoalFactor: number;
|
|
51
|
+
/** Relative weight of each difficulty factor. */
|
|
52
|
+
weights: ScoreWeights;
|
|
53
|
+
/** Name of the reporting teammate created for a team task. */
|
|
54
|
+
reportingAgentName: string;
|
|
55
|
+
/** Continuable-subagent provider used for the reporting teammate. */
|
|
56
|
+
reportingProvider: string;
|
|
57
|
+
/** Positive round cap used when auto-team creates a goal. */
|
|
58
|
+
goalMaxRounds: number;
|
|
59
|
+
/** Block Lead writes after the team decision. */
|
|
60
|
+
enforceLeadNoCode: boolean;
|
|
61
|
+
/** Tool names denied to a Team-mode Lead. */
|
|
62
|
+
leadDeniedTools: string[];
|
|
63
|
+
}
|
|
64
|
+
//#endregion
|
|
65
|
+
//#region src/runtime.d.ts
|
|
66
|
+
/** Fakeable host boundary used by the baseline load message. */
|
|
67
|
+
interface PluginRuntime {
|
|
68
|
+
info: (message: string) => void;
|
|
69
|
+
warn: (message: string) => void;
|
|
70
|
+
}
|
|
71
|
+
/** Apply auto-team to the host; unmanaged scopes stay untouched. */
|
|
72
|
+
declare function apply(ctx: Context, config: PluginConfig): void;
|
|
73
|
+
//#endregion
|
|
74
|
+
//#region src/index.d.ts
|
|
75
|
+
/**
|
|
76
|
+
* Standalone function plugin for DeepSeek Harness.
|
|
77
|
+
*
|
|
78
|
+
* @module @oh-my-dsh/auto-team
|
|
79
|
+
*/
|
|
80
|
+
/** Cordis plugin name; keep this stable after publishing. */
|
|
81
|
+
declare const name = "auto-team";
|
|
82
|
+
/** Services that must exist before the plugin is applied. */
|
|
83
|
+
declare const inject: string[];
|
|
84
|
+
//#endregion
|
|
85
|
+
export { Config, type PluginConfig, type PluginRuntime, type ResolvedConfig, apply, inject, name };
|
package/lib/index.js
ADDED
|
@@ -0,0 +1,711 @@
|
|
|
1
|
+
import schema from "@deepseek-ai/schemastery";
|
|
2
|
+
import { createMessage } from "@deepseek-ai/dsh-llm";
|
|
3
|
+
import { appendPluginRecord, pluginRecordOf } from "@deepseek-ai/dsh-session";
|
|
4
|
+
import { z } from "zod";
|
|
5
|
+
import { defineTool } from "@deepseek-ai/dsh-tools";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
//#region src/policy.ts
|
|
8
|
+
const MIN_FACTOR = 1;
|
|
9
|
+
const MAX_FACTOR = 5;
|
|
10
|
+
const FACTOR_RANGE = 4;
|
|
11
|
+
/** Clamp one finite factor to 1..5 and normalize it to 0..1. */
|
|
12
|
+
function normalizeFactor(name, value) {
|
|
13
|
+
if (!Number.isFinite(value)) throw new TypeError(`difficulty factor "${name}" must be a finite number`);
|
|
14
|
+
return (Math.min(MAX_FACTOR, Math.max(MIN_FACTOR, value)) - MIN_FACTOR) / FACTOR_RANGE;
|
|
15
|
+
}
|
|
16
|
+
/** Reject negative or non-finite weights and an all-zero set. */
|
|
17
|
+
function validateWeights(weights) {
|
|
18
|
+
let total = 0;
|
|
19
|
+
for (const value of Object.values(weights)) {
|
|
20
|
+
if (!Number.isFinite(value) || value < 0) throw new TypeError("score weights must be finite and non-negative");
|
|
21
|
+
total += value;
|
|
22
|
+
}
|
|
23
|
+
if (total <= 0) throw new TypeError("score weights must have a positive total");
|
|
24
|
+
}
|
|
25
|
+
/** Weighted 0..1 difficulty score. */
|
|
26
|
+
function scoreAssessment(assessment, weights) {
|
|
27
|
+
validateWeights(weights);
|
|
28
|
+
const total = weights.scope + weights.parallelism + weights.ambiguity + weights.risk + weights.expectedSteps;
|
|
29
|
+
return (normalizeFactor("scope", assessment.scope) * weights.scope + normalizeFactor("parallelism", assessment.parallelism) * weights.parallelism + normalizeFactor("ambiguity", assessment.ambiguity) * weights.ambiguity + normalizeFactor("risk", assessment.risk) * weights.risk + normalizeFactor("expectedSteps", assessment.expectedSteps) * weights.expectedSteps) / total;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Effective trigger threshold; a user-triggered goal lowers it by the
|
|
33
|
+
* configured factor.
|
|
34
|
+
*/
|
|
35
|
+
function effectiveThreshold(baseThreshold, manualGoal, manualGoalFactor) {
|
|
36
|
+
if (!Number.isFinite(baseThreshold) || baseThreshold < 0 || baseThreshold > 1) throw new TypeError("threshold must be between 0 and 1");
|
|
37
|
+
if (!Number.isFinite(manualGoalFactor) || manualGoalFactor < 0 || manualGoalFactor > 1) throw new TypeError("manualGoalFactor must be between 0 and 1");
|
|
38
|
+
let threshold = baseThreshold;
|
|
39
|
+
if (manualGoal) threshold = baseThreshold * manualGoalFactor;
|
|
40
|
+
return Math.min(1, Math.max(0, threshold));
|
|
41
|
+
}
|
|
42
|
+
/** Compare a score with the effective threshold. */
|
|
43
|
+
function decideTeam(score, threshold) {
|
|
44
|
+
if (score >= threshold) return "team";
|
|
45
|
+
return "solo";
|
|
46
|
+
}
|
|
47
|
+
/** Score one assessment and freeze the decision. */
|
|
48
|
+
function createScoreDecision(assessment, options) {
|
|
49
|
+
const threshold = effectiveThreshold(options.threshold, options.manualGoal, options.manualGoalFactor);
|
|
50
|
+
const score = scoreAssessment(assessment, options.weights);
|
|
51
|
+
return {
|
|
52
|
+
score,
|
|
53
|
+
threshold,
|
|
54
|
+
manualGoal: options.manualGoal,
|
|
55
|
+
decision: decideTeam(score, threshold)
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
//#endregion
|
|
59
|
+
//#region src/config.ts
|
|
60
|
+
/**
|
|
61
|
+
* Serializable configuration, schema, and direct-call defaults for auto-team.
|
|
62
|
+
*
|
|
63
|
+
* @module @oh-my-dsh/auto-team/config
|
|
64
|
+
*/
|
|
65
|
+
const DEFAULT_WEIGHTS = {
|
|
66
|
+
scope: .3,
|
|
67
|
+
parallelism: .25,
|
|
68
|
+
ambiguity: .15,
|
|
69
|
+
risk: .15,
|
|
70
|
+
expectedSteps: .15
|
|
71
|
+
};
|
|
72
|
+
const DEFAULT_THRESHOLD = .55;
|
|
73
|
+
const DEFAULT_MANUAL_GOAL_FACTOR = .6;
|
|
74
|
+
const DEFAULT_REPORTING_AGENT_NAME = "reporter";
|
|
75
|
+
const DEFAULT_REPORTING_PROVIDER = "spawn";
|
|
76
|
+
const DEFAULT_GOAL_MAX_ROUNDS = 256;
|
|
77
|
+
const DEFAULT_ENFORCE_LEAD_NO_CODE = true;
|
|
78
|
+
const DEFAULT_LEAD_DENIED_TOOLS = ["write", "edit"];
|
|
79
|
+
const REPORTER_NAME_PATTERN = /^[a-z][a-z0-9-]*$/u;
|
|
80
|
+
const UNIT_RANGE = {
|
|
81
|
+
min: 0,
|
|
82
|
+
max: 1
|
|
83
|
+
};
|
|
84
|
+
/** Loader-visible configuration schema and defaults. */
|
|
85
|
+
const Config = schema.object({
|
|
86
|
+
message: schema.string().default("auto-team loaded"),
|
|
87
|
+
threshold: schema.number().min(0).max(1).default(DEFAULT_THRESHOLD),
|
|
88
|
+
manualGoalFactor: schema.number().min(0).max(1).default(DEFAULT_MANUAL_GOAL_FACTOR),
|
|
89
|
+
weights: schema.object({
|
|
90
|
+
scope: schema.number().min(0).max(1).default(DEFAULT_WEIGHTS.scope),
|
|
91
|
+
parallelism: schema.number().min(0).max(1).default(DEFAULT_WEIGHTS.parallelism),
|
|
92
|
+
ambiguity: schema.number().min(0).max(1).default(DEFAULT_WEIGHTS.ambiguity),
|
|
93
|
+
risk: schema.number().min(0).max(1).default(DEFAULT_WEIGHTS.risk),
|
|
94
|
+
expectedSteps: schema.number().min(0).max(1).default(DEFAULT_WEIGHTS.expectedSteps)
|
|
95
|
+
}),
|
|
96
|
+
reportingAgentName: schema.string().pattern(REPORTER_NAME_PATTERN).default(DEFAULT_REPORTING_AGENT_NAME),
|
|
97
|
+
reportingProvider: schema.string().default(DEFAULT_REPORTING_PROVIDER),
|
|
98
|
+
goalMaxRounds: schema.natural().min(1).default(DEFAULT_GOAL_MAX_ROUNDS),
|
|
99
|
+
enforceLeadNoCode: schema.boolean().default(DEFAULT_ENFORCE_LEAD_NO_CODE),
|
|
100
|
+
leadDeniedTools: schema.array(schema.string()).default([...DEFAULT_LEAD_DENIED_TOOLS])
|
|
101
|
+
});
|
|
102
|
+
/** Validate one finite number against an inclusive range. */
|
|
103
|
+
function numberInRange(name, value, range) {
|
|
104
|
+
if (!Number.isFinite(value) || value < range.min || value > range.max) throw new TypeError(`${name} must be between ${range.min} and ${range.max}`);
|
|
105
|
+
return value;
|
|
106
|
+
}
|
|
107
|
+
/** Merge partial factor weights over the defaults and validate the total. */
|
|
108
|
+
function resolveWeights(config) {
|
|
109
|
+
const weights = {
|
|
110
|
+
scope: config.weights?.scope ?? DEFAULT_WEIGHTS.scope,
|
|
111
|
+
parallelism: config.weights?.parallelism ?? DEFAULT_WEIGHTS.parallelism,
|
|
112
|
+
ambiguity: config.weights?.ambiguity ?? DEFAULT_WEIGHTS.ambiguity,
|
|
113
|
+
risk: config.weights?.risk ?? DEFAULT_WEIGHTS.risk,
|
|
114
|
+
expectedSteps: config.weights?.expectedSteps ?? DEFAULT_WEIGHTS.expectedSteps
|
|
115
|
+
};
|
|
116
|
+
validateWeights(weights);
|
|
117
|
+
return weights;
|
|
118
|
+
}
|
|
119
|
+
/** Resolve and validate the reporting teammate name. */
|
|
120
|
+
function resolveReportingAgentName(config) {
|
|
121
|
+
const name = config.reportingAgentName ?? DEFAULT_REPORTING_AGENT_NAME;
|
|
122
|
+
if (!REPORTER_NAME_PATTERN.test(name) || name === "lead") throw new TypeError("reportingAgentName must be lower-kebab-case and must not be \"lead\"");
|
|
123
|
+
return name;
|
|
124
|
+
}
|
|
125
|
+
/** Resolve and validate the goal round cap. */
|
|
126
|
+
function resolveGoalMaxRounds(config) {
|
|
127
|
+
const rounds = config.goalMaxRounds ?? DEFAULT_GOAL_MAX_ROUNDS;
|
|
128
|
+
if (!Number.isSafeInteger(rounds) || rounds < 1) throw new TypeError("goalMaxRounds must be a positive safe integer");
|
|
129
|
+
return rounds;
|
|
130
|
+
}
|
|
131
|
+
/** Resolve and validate the two score thresholds. */
|
|
132
|
+
function resolveThresholds(config) {
|
|
133
|
+
return {
|
|
134
|
+
threshold: numberInRange("threshold", config.threshold ?? DEFAULT_THRESHOLD, UNIT_RANGE),
|
|
135
|
+
manualGoalFactor: numberInRange("manualGoalFactor", config.manualGoalFactor ?? DEFAULT_MANUAL_GOAL_FACTOR, UNIT_RANGE)
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/** Resolve the same defaults for direct callers that bypass Cordis Loader. */
|
|
139
|
+
function resolveConfig(config = {}) {
|
|
140
|
+
return {
|
|
141
|
+
message: config.message ?? "auto-team loaded",
|
|
142
|
+
...resolveThresholds(config),
|
|
143
|
+
weights: resolveWeights(config),
|
|
144
|
+
reportingAgentName: resolveReportingAgentName(config),
|
|
145
|
+
reportingProvider: config.reportingProvider ?? DEFAULT_REPORTING_PROVIDER,
|
|
146
|
+
goalMaxRounds: resolveGoalMaxRounds(config),
|
|
147
|
+
enforceLeadNoCode: config.enforceLeadNoCode ?? DEFAULT_ENFORCE_LEAD_NO_CODE,
|
|
148
|
+
leadDeniedTools: [...config.leadDeniedTools ?? DEFAULT_LEAD_DENIED_TOOLS]
|
|
149
|
+
};
|
|
150
|
+
}
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/projection.ts
|
|
153
|
+
const SCORE_RECORD_TYPE = "plugin:auto-team/score";
|
|
154
|
+
const scoreRecordSchema = z.object({
|
|
155
|
+
score: z.number().min(0).max(1),
|
|
156
|
+
threshold: z.number().min(0).max(1),
|
|
157
|
+
manualGoal: z.boolean(),
|
|
158
|
+
decision: z.enum(["team", "solo"]),
|
|
159
|
+
goal: z.enum([
|
|
160
|
+
"started",
|
|
161
|
+
"reused",
|
|
162
|
+
"none"
|
|
163
|
+
])
|
|
164
|
+
});
|
|
165
|
+
const autoTeamProjectionStateSchema = z.object({
|
|
166
|
+
score: scoreRecordSchema.optional(),
|
|
167
|
+
failure: z.string().optional()
|
|
168
|
+
});
|
|
169
|
+
/** Fold one committed event into the first frozen score record. */
|
|
170
|
+
function applyAutoTeamProjection(state, event) {
|
|
171
|
+
const record = pluginRecordOf(event);
|
|
172
|
+
if (record === void 0 || record.type !== SCORE_RECORD_TYPE) return state;
|
|
173
|
+
if (state.score !== void 0) return state;
|
|
174
|
+
const parsed = scoreRecordSchema.safeParse(record.data);
|
|
175
|
+
if (!parsed.success) return {
|
|
176
|
+
...state,
|
|
177
|
+
failure: parsed.error.message
|
|
178
|
+
};
|
|
179
|
+
return {
|
|
180
|
+
...state,
|
|
181
|
+
score: parsed.data
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
/** Host-only projection definition for the auto-team score. */
|
|
185
|
+
const autoTeamProjectionDefinition = {
|
|
186
|
+
key: "autoTeam",
|
|
187
|
+
stateSchema: autoTeamProjectionStateSchema,
|
|
188
|
+
init: () => ({}),
|
|
189
|
+
apply: applyAutoTeamProjection,
|
|
190
|
+
stateVersion: 1
|
|
191
|
+
};
|
|
192
|
+
//#endregion
|
|
193
|
+
//#region src/prompt.ts
|
|
194
|
+
/**
|
|
195
|
+
* Model-facing policy and teammate prompts for auto-team.
|
|
196
|
+
*
|
|
197
|
+
* @module @oh-my-dsh/auto-team/prompt
|
|
198
|
+
*/
|
|
199
|
+
/** First-round steering text used when the scoring tool has not run yet. */
|
|
200
|
+
const FIRST_ROUND_STEER_TEXT = `Auto Team: this first round has no difficulty score yet. Call auto_team_score now with the five difficulty factors and the task's universal-semantic objective. The turn cannot close without it.`;
|
|
201
|
+
/** System prompt section that states the Lead's auto-team obligations. */
|
|
202
|
+
function policyText(reportingAgentName, leadDeniedTools) {
|
|
203
|
+
return `Auto Team policy
|
|
204
|
+
|
|
205
|
+
You are the Team Lead for a long task. Before any other action in the first round, call auto_team_score once with:
|
|
206
|
+
- scope, parallelism, ambiguity, risk, expected_steps: integers from 1 (low) to 5 (high)
|
|
207
|
+
- objective: the task goal in its ordinary, universal meaning
|
|
208
|
+
|
|
209
|
+
The call is mandatory. The turn cannot close without it. The numeric score and threshold are never shown; do not ask for them and do not try to infer them.
|
|
210
|
+
|
|
211
|
+
If the decision is solo, continue as a normal single agent.
|
|
212
|
+
|
|
213
|
+
If the decision is team:
|
|
214
|
+
- Do not write code. You maintain the Main Git repository and the team. The Lead's ${leadDeniedTools.join(", ")} calls are denied in Team mode. This is a tool-name policy gate, not a sandbox: never use pwsh, run_code, or another tool to write product files as a workaround.
|
|
215
|
+
- The plugin starts or reuses the goal and ensures a reporting agent named "${reportingAgentName}".
|
|
216
|
+
- Route user-facing status and detail questions through the reporting agent. Detail questions must not block execution.
|
|
217
|
+
- Create shared tasks with disjoint write scopes, then spawn execution agents. Each execution agent must create its own worktree for its task before editing.
|
|
218
|
+
- Multi-round continuation belongs to the goal runtime. Do not write your own continuation loop.
|
|
219
|
+
- After the workers finish, review the final diff and run the tests in the Main Git repository.`;
|
|
220
|
+
}
|
|
221
|
+
/** Initial prompt for the dedicated reporting teammate. */
|
|
222
|
+
function reporterPrompt() {
|
|
223
|
+
return `You are the reporting agent for an auto-team task. Track team status and handle user-facing detail questions relayed by the Lead. Do not write code.
|
|
224
|
+
|
|
225
|
+
Use list_agents and team_task_list to observe the roster and task board. Send concise status and answers to the Lead with send_message({ target: "lead", message: "..." }).
|
|
226
|
+
|
|
227
|
+
When a detail is unresolved, record it and report it; never block execution waiting for an answer. The Lead relays your updates to the user.`;
|
|
228
|
+
}
|
|
229
|
+
//#endregion
|
|
230
|
+
//#region src/auto-team.ts
|
|
231
|
+
/** Host-side auto-team state and operations. */
|
|
232
|
+
var AutoTeam = class {
|
|
233
|
+
records = /* @__PURE__ */ new WeakMap();
|
|
234
|
+
deps;
|
|
235
|
+
config;
|
|
236
|
+
constructor(deps, config) {
|
|
237
|
+
this.deps = deps;
|
|
238
|
+
this.config = config;
|
|
239
|
+
}
|
|
240
|
+
/** Whether this agent already has a frozen score. */
|
|
241
|
+
hasScore(agent) {
|
|
242
|
+
return this.records.has(agent);
|
|
243
|
+
}
|
|
244
|
+
/** Seed a record restored from durable storage without scoring again. */
|
|
245
|
+
restore(agent, record) {
|
|
246
|
+
if (!this.records.has(agent)) this.records.set(agent, record);
|
|
247
|
+
}
|
|
248
|
+
/** The frozen team decision, when this agent has one. */
|
|
249
|
+
decisionOf(agent) {
|
|
250
|
+
return (this.records.get(agent) ?? this.deps.store.read(agent))?.decision;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Score one task, freeze the decision, then start or reuse its goal and
|
|
254
|
+
* ensure the reporting teammate.
|
|
255
|
+
*/
|
|
256
|
+
async score(agent, request) {
|
|
257
|
+
const existing = this.records.get(agent) ?? this.deps.store.read(agent);
|
|
258
|
+
if (existing !== void 0) {
|
|
259
|
+
this.records.set(agent, existing);
|
|
260
|
+
return await this.finish(agent, existing, request.signal);
|
|
261
|
+
}
|
|
262
|
+
const existingGoal = this.deps.goals.get(agent);
|
|
263
|
+
const manualGoal = existingGoal !== void 0;
|
|
264
|
+
const decision = createScoreDecision(request.assessment, {
|
|
265
|
+
weights: this.config.weights,
|
|
266
|
+
threshold: this.config.threshold,
|
|
267
|
+
manualGoal,
|
|
268
|
+
manualGoalFactor: this.config.manualGoalFactor
|
|
269
|
+
});
|
|
270
|
+
let goal = "none";
|
|
271
|
+
if (decision.decision === "team" && existingGoal === void 0) goal = this.startGoal(agent, request.objective);
|
|
272
|
+
else if (existingGoal !== void 0) goal = "reused";
|
|
273
|
+
const record = {
|
|
274
|
+
score: decision.score,
|
|
275
|
+
threshold: decision.threshold,
|
|
276
|
+
manualGoal,
|
|
277
|
+
decision: decision.decision,
|
|
278
|
+
goal
|
|
279
|
+
};
|
|
280
|
+
this.deps.store.write(agent, record);
|
|
281
|
+
this.records.set(agent, record);
|
|
282
|
+
return await this.finish(agent, record, request.signal);
|
|
283
|
+
}
|
|
284
|
+
/** Create the auto-started goal and return the reported action. */
|
|
285
|
+
startGoal(agent, objective) {
|
|
286
|
+
const trimmed = objective.trim();
|
|
287
|
+
if (trimmed.length === 0) throw new TypeError("objective is required when auto-team starts a goal");
|
|
288
|
+
this.deps.goals.create(agent, {
|
|
289
|
+
objective: trimmed,
|
|
290
|
+
maxGoalRounds: this.config.goalMaxRounds
|
|
291
|
+
});
|
|
292
|
+
return "started";
|
|
293
|
+
}
|
|
294
|
+
/** Add the reporter result to a frozen record, provisioning it when needed. */
|
|
295
|
+
async finish(agent, record, signal) {
|
|
296
|
+
if (record.decision === "solo") return {
|
|
297
|
+
decision: "solo",
|
|
298
|
+
goal: record.goal
|
|
299
|
+
};
|
|
300
|
+
const reporter = await this.ensureReporter(agent, signal);
|
|
301
|
+
return {
|
|
302
|
+
decision: "team",
|
|
303
|
+
goal: record.goal,
|
|
304
|
+
reporter
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
/** Reuse an existing reporting teammate or spawn one. */
|
|
308
|
+
async ensureReporter(agent, signal) {
|
|
309
|
+
const name = this.config.reportingAgentName;
|
|
310
|
+
const existing = this.deps.team.listMembers(agent).find((member) => member.name === name);
|
|
311
|
+
if (existing !== void 0) return existing.name;
|
|
312
|
+
return (await this.deps.team.spawnReporter(agent, {
|
|
313
|
+
name,
|
|
314
|
+
description: "User-facing status reporter for the auto team",
|
|
315
|
+
prompt: reporterPrompt(),
|
|
316
|
+
provider: this.config.reportingProvider,
|
|
317
|
+
signal
|
|
318
|
+
})).name;
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
//#endregion
|
|
322
|
+
//#region src/services.ts
|
|
323
|
+
/** Read the goal service or fail with a plugin-specific message. */
|
|
324
|
+
function goalService(ctx) {
|
|
325
|
+
const service = ctx.get("goals");
|
|
326
|
+
if (service === void 0) throw new Error("auto-team: goals service is unavailable");
|
|
327
|
+
return service;
|
|
328
|
+
}
|
|
329
|
+
/** Read the Team service or fail with a plugin-specific message. */
|
|
330
|
+
function teamService(ctx) {
|
|
331
|
+
const service = ctx.get("agentTeams");
|
|
332
|
+
if (service === void 0) throw new Error("auto-team: agentTeams service is unavailable");
|
|
333
|
+
return service;
|
|
334
|
+
}
|
|
335
|
+
/** Build the goal, team, and durable score ports from Cordis services. */
|
|
336
|
+
function createAutoTeam(ctx, config) {
|
|
337
|
+
return new AutoTeam({
|
|
338
|
+
goals: {
|
|
339
|
+
get: (agent) => goalService(ctx).get(agent),
|
|
340
|
+
create: (agent, request) => goalService(ctx).create(agent, request)
|
|
341
|
+
},
|
|
342
|
+
team: {
|
|
343
|
+
listMembers: (agent) => teamService(ctx).listMembers(agent),
|
|
344
|
+
spawnReporter: async (agent, request) => {
|
|
345
|
+
return { name: (await teamService(ctx).spawnTeammate(agent, {
|
|
346
|
+
name: request.name,
|
|
347
|
+
description: request.description,
|
|
348
|
+
prompt: [{
|
|
349
|
+
type: "text",
|
|
350
|
+
text: request.prompt
|
|
351
|
+
}],
|
|
352
|
+
context: "fresh",
|
|
353
|
+
provider: request.provider,
|
|
354
|
+
signal: request.signal
|
|
355
|
+
})).member.name };
|
|
356
|
+
}
|
|
357
|
+
},
|
|
358
|
+
store: {
|
|
359
|
+
read: (agent) => ctx.get("sessionProjections")?.stateOf(agent.session, "autoTeam")?.score,
|
|
360
|
+
write: (agent, record) => {
|
|
361
|
+
appendPluginRecord(agent.session, "plugin:auto-team/score", record);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
}, config);
|
|
365
|
+
}
|
|
366
|
+
//#endregion
|
|
367
|
+
//#region src/tool.ts
|
|
368
|
+
/**
|
|
369
|
+
* Model-facing scoring tool. The numeric score and threshold are never part of
|
|
370
|
+
* the tool result.
|
|
371
|
+
*
|
|
372
|
+
* @module @oh-my-dsh/auto-team/tool
|
|
373
|
+
*/
|
|
374
|
+
/** Build the one-shot scoring tool for a Lead agent scope. */
|
|
375
|
+
function createScoreTool(autoTeam) {
|
|
376
|
+
return defineTool({
|
|
377
|
+
name: "auto_team_score",
|
|
378
|
+
description: "Record the first-round difficulty assessment and return the team or solo decision. Call once before any other action. The decision is frozen and the numeric score is never shown.",
|
|
379
|
+
parameters: {
|
|
380
|
+
scope: {
|
|
381
|
+
type: "integer",
|
|
382
|
+
required: true,
|
|
383
|
+
enum: [
|
|
384
|
+
1,
|
|
385
|
+
2,
|
|
386
|
+
3,
|
|
387
|
+
4,
|
|
388
|
+
5
|
|
389
|
+
],
|
|
390
|
+
description: "Expected change scope, from 1 low to 5 high."
|
|
391
|
+
},
|
|
392
|
+
parallelism: {
|
|
393
|
+
type: "integer",
|
|
394
|
+
required: true,
|
|
395
|
+
enum: [
|
|
396
|
+
1,
|
|
397
|
+
2,
|
|
398
|
+
3,
|
|
399
|
+
4,
|
|
400
|
+
5
|
|
401
|
+
],
|
|
402
|
+
description: "How much independent work can run in parallel, from 1 low to 5 high."
|
|
403
|
+
},
|
|
404
|
+
ambiguity: {
|
|
405
|
+
type: "integer",
|
|
406
|
+
required: true,
|
|
407
|
+
enum: [
|
|
408
|
+
1,
|
|
409
|
+
2,
|
|
410
|
+
3,
|
|
411
|
+
4,
|
|
412
|
+
5
|
|
413
|
+
],
|
|
414
|
+
description: "How much requirements or design uncertainty remains, from 1 low to 5 high."
|
|
415
|
+
},
|
|
416
|
+
risk: {
|
|
417
|
+
type: "integer",
|
|
418
|
+
required: true,
|
|
419
|
+
enum: [
|
|
420
|
+
1,
|
|
421
|
+
2,
|
|
422
|
+
3,
|
|
423
|
+
4,
|
|
424
|
+
5
|
|
425
|
+
],
|
|
426
|
+
description: "How costly a wrong change would be, from 1 low to 5 high."
|
|
427
|
+
},
|
|
428
|
+
expected_steps: {
|
|
429
|
+
type: "integer",
|
|
430
|
+
required: true,
|
|
431
|
+
enum: [
|
|
432
|
+
1,
|
|
433
|
+
2,
|
|
434
|
+
3,
|
|
435
|
+
4,
|
|
436
|
+
5
|
|
437
|
+
],
|
|
438
|
+
description: "Expected length of the task, from 1 short to 5 long."
|
|
439
|
+
},
|
|
440
|
+
objective: {
|
|
441
|
+
type: "string",
|
|
442
|
+
required: true,
|
|
443
|
+
description: "The task goal in its ordinary, universal meaning. Used only when auto-team starts a goal."
|
|
444
|
+
}
|
|
445
|
+
},
|
|
446
|
+
output: {
|
|
447
|
+
schema: {
|
|
448
|
+
type: "object",
|
|
449
|
+
additionalProperties: false,
|
|
450
|
+
properties: {
|
|
451
|
+
decision: {
|
|
452
|
+
type: "string",
|
|
453
|
+
required: true,
|
|
454
|
+
enum: ["team", "solo"]
|
|
455
|
+
},
|
|
456
|
+
goal: {
|
|
457
|
+
type: "string",
|
|
458
|
+
required: true,
|
|
459
|
+
enum: [
|
|
460
|
+
"started",
|
|
461
|
+
"reused",
|
|
462
|
+
"none"
|
|
463
|
+
]
|
|
464
|
+
},
|
|
465
|
+
reporter: { type: "string" }
|
|
466
|
+
}
|
|
467
|
+
},
|
|
468
|
+
render: (_args, value) => [{
|
|
469
|
+
type: "text",
|
|
470
|
+
text: JSON.stringify(value)
|
|
471
|
+
}]
|
|
472
|
+
},
|
|
473
|
+
async execute(args, exec) {
|
|
474
|
+
const { agent } = exec;
|
|
475
|
+
if (agent === void 0) throw new Error("auto_team_score requires a calling Agent");
|
|
476
|
+
return await autoTeam.score(agent, {
|
|
477
|
+
assessment: {
|
|
478
|
+
scope: args.scope,
|
|
479
|
+
parallelism: args.parallelism,
|
|
480
|
+
ambiguity: args.ambiguity,
|
|
481
|
+
risk: args.risk,
|
|
482
|
+
expectedSteps: args.expected_steps
|
|
483
|
+
},
|
|
484
|
+
objective: args.objective,
|
|
485
|
+
signal: exec.signal
|
|
486
|
+
});
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
}
|
|
490
|
+
//#endregion
|
|
491
|
+
//#region src/worker-guard.ts
|
|
492
|
+
/**
|
|
493
|
+
* Worker write/edit gate: a successful worktree is required, and when the host
|
|
494
|
+
* returns its path, edits must stay inside it.
|
|
495
|
+
*
|
|
496
|
+
* @module @oh-my-dsh/auto-team/worker-guard
|
|
497
|
+
*/
|
|
498
|
+
/** Read a write or edit file path from its tool arguments. */
|
|
499
|
+
function filePathOf(args) {
|
|
500
|
+
if (typeof args !== "object" || args === null || !("file_path" in args)) return;
|
|
501
|
+
const filePath = args.file_path;
|
|
502
|
+
if (typeof filePath === "string") return filePath;
|
|
503
|
+
}
|
|
504
|
+
/** Read the worktree path from a create_worktree canonical value. */
|
|
505
|
+
function worktreePathOf(value) {
|
|
506
|
+
if (typeof value !== "object" || value === null || !("path" in value)) return;
|
|
507
|
+
const worktreePath = value.path;
|
|
508
|
+
if (typeof worktreePath === "string") return worktreePath;
|
|
509
|
+
}
|
|
510
|
+
/** Whether target resolves inside root. */
|
|
511
|
+
function isInside(root, target) {
|
|
512
|
+
const relative = path.relative(path.resolve(root), path.resolve(target));
|
|
513
|
+
return relative === "" || !relative.startsWith("..") && !path.isAbsolute(relative);
|
|
514
|
+
}
|
|
515
|
+
/** Require one execution teammate to work inside its own worktree. */
|
|
516
|
+
function installWorkerGuard(agent, root, autoTeam) {
|
|
517
|
+
let hasWorktree = false;
|
|
518
|
+
let worktreePath = void 0;
|
|
519
|
+
const disposers = [];
|
|
520
|
+
const register = (dispose) => {
|
|
521
|
+
disposers.push(dispose);
|
|
522
|
+
};
|
|
523
|
+
try {
|
|
524
|
+
const pre = agent.ctx.on("tools/pre-execute", async (exec, next) => {
|
|
525
|
+
if (exec.agent === agent && autoTeam.decisionOf(root) === "team" && (exec.name === "write" || exec.name === "edit")) {
|
|
526
|
+
if (!hasWorktree) return {
|
|
527
|
+
kind: "deny",
|
|
528
|
+
reason: "auto-team: create your own worktree with create_worktree before editing files"
|
|
529
|
+
};
|
|
530
|
+
if (worktreePath !== void 0) {
|
|
531
|
+
const filePath = filePathOf(exec.arguments);
|
|
532
|
+
if (filePath === void 0) return {
|
|
533
|
+
kind: "deny",
|
|
534
|
+
reason: "auto-team: write and edit require a file_path so the worktree guard can verify it"
|
|
535
|
+
};
|
|
536
|
+
if (!path.isAbsolute(filePath)) return {
|
|
537
|
+
kind: "deny",
|
|
538
|
+
reason: "auto-team: use an absolute file path inside your registered worktree"
|
|
539
|
+
};
|
|
540
|
+
if (!isInside(worktreePath, filePath)) return {
|
|
541
|
+
kind: "deny",
|
|
542
|
+
reason: `auto-team: edit path is outside your worktree: ${worktreePath}`
|
|
543
|
+
};
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
return await next();
|
|
547
|
+
});
|
|
548
|
+
register(() => {
|
|
549
|
+
pre();
|
|
550
|
+
});
|
|
551
|
+
const post = agent.ctx.on("tools/post-execute", async (exec, result, next) => {
|
|
552
|
+
if (exec.agent === agent && exec.name === "create_worktree" && !result.isError) {
|
|
553
|
+
hasWorktree = true;
|
|
554
|
+
const registered = worktreePathOf(result.value);
|
|
555
|
+
if (registered !== void 0) worktreePath = registered;
|
|
556
|
+
}
|
|
557
|
+
return await next();
|
|
558
|
+
});
|
|
559
|
+
register(() => {
|
|
560
|
+
post();
|
|
561
|
+
});
|
|
562
|
+
} catch (error) {
|
|
563
|
+
for (const dispose of disposers.toReversed()) dispose();
|
|
564
|
+
throw error;
|
|
565
|
+
}
|
|
566
|
+
return () => {
|
|
567
|
+
for (const dispose of disposers.toReversed()) dispose();
|
|
568
|
+
};
|
|
569
|
+
}
|
|
570
|
+
//#endregion
|
|
571
|
+
//#region src/runtime.ts
|
|
572
|
+
/** Create the production runtime adapter from a scoped Cordis context. */
|
|
573
|
+
function createPluginRuntime(ctx) {
|
|
574
|
+
return {
|
|
575
|
+
info: (message) => {
|
|
576
|
+
ctx.logger.info(message);
|
|
577
|
+
},
|
|
578
|
+
warn: (message) => {
|
|
579
|
+
ctx.logger.warn(message);
|
|
580
|
+
}
|
|
581
|
+
};
|
|
582
|
+
}
|
|
583
|
+
/** Install the prompt, scoring tool, and stop guard in one Lead scope. */
|
|
584
|
+
function installLead(options) {
|
|
585
|
+
const { agent, autoTeam, config, source } = options;
|
|
586
|
+
const systemPrompt = agent.ctx.systemPrompt;
|
|
587
|
+
const tools = agent.ctx.tools;
|
|
588
|
+
const disposers = [];
|
|
589
|
+
const register = (dispose) => {
|
|
590
|
+
disposers.push(dispose);
|
|
591
|
+
};
|
|
592
|
+
try {
|
|
593
|
+
register(systemPrompt.section({
|
|
594
|
+
name: "auto-team:policy",
|
|
595
|
+
order: systemPrompt.getSectionOrder("TEAM_POLICY"),
|
|
596
|
+
text: policyText(config.reportingAgentName, config.leadDeniedTools)
|
|
597
|
+
}));
|
|
598
|
+
register(tools.register(createScoreTool(autoTeam)));
|
|
599
|
+
if (source === "startup" || source === "clear") {
|
|
600
|
+
const stop = agent.ctx.on("agent/turn-stopping", (payload) => {
|
|
601
|
+
if (payload.agent !== agent || payload.turn !== 1 || autoTeam.hasScore(agent)) return;
|
|
602
|
+
agent.steer(createMessage({
|
|
603
|
+
role: "user",
|
|
604
|
+
content: [{
|
|
605
|
+
type: "text",
|
|
606
|
+
text: FIRST_ROUND_STEER_TEXT
|
|
607
|
+
}],
|
|
608
|
+
source: { kind: "user" }
|
|
609
|
+
}));
|
|
610
|
+
});
|
|
611
|
+
register(() => {
|
|
612
|
+
stop();
|
|
613
|
+
});
|
|
614
|
+
}
|
|
615
|
+
if (config.enforceLeadNoCode) {
|
|
616
|
+
const guard = agent.ctx.on("tools/pre-execute", async (exec, next) => {
|
|
617
|
+
if (exec.agent !== agent || autoTeam.decisionOf(agent) !== "team" || !config.leadDeniedTools.includes(exec.name)) return await next();
|
|
618
|
+
return {
|
|
619
|
+
kind: "deny",
|
|
620
|
+
reason: "auto-team: the Lead must delegate code changes to an execution agent"
|
|
621
|
+
};
|
|
622
|
+
});
|
|
623
|
+
register(() => {
|
|
624
|
+
guard();
|
|
625
|
+
});
|
|
626
|
+
}
|
|
627
|
+
} catch (error) {
|
|
628
|
+
for (const dispose of disposers.toReversed()) dispose();
|
|
629
|
+
throw error;
|
|
630
|
+
}
|
|
631
|
+
return () => {
|
|
632
|
+
for (const dispose of disposers.toReversed()) dispose();
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
/** Read the services needed by the install path without assuming load order. */
|
|
636
|
+
function servicesReady(ctx) {
|
|
637
|
+
return ctx.get("agentTeams") !== void 0 && ctx.get("goals") !== void 0 && ctx.get("tools") !== void 0 && ctx.get("systemPrompt") !== void 0;
|
|
638
|
+
}
|
|
639
|
+
/** Apply auto-team to the host; unmanaged scopes stay untouched. */
|
|
640
|
+
function apply(ctx, config) {
|
|
641
|
+
const resolved = resolveConfig(config);
|
|
642
|
+
const runtime = createPluginRuntime(ctx);
|
|
643
|
+
runtime.info(resolved.message);
|
|
644
|
+
const autoTeam = createAutoTeam(ctx, resolved);
|
|
645
|
+
const installed = /* @__PURE__ */ new Map();
|
|
646
|
+
let warned = false;
|
|
647
|
+
let projectionRegistered = false;
|
|
648
|
+
const ensureProjection = () => {
|
|
649
|
+
if (projectionRegistered) return;
|
|
650
|
+
const registry = ctx.get("sessionProjections");
|
|
651
|
+
if (registry === void 0) return;
|
|
652
|
+
ctx.effect(() => registry.register(autoTeamProjectionDefinition), "auto-team.projection()");
|
|
653
|
+
projectionRegistered = true;
|
|
654
|
+
};
|
|
655
|
+
ensureProjection();
|
|
656
|
+
const install = (agent, source) => {
|
|
657
|
+
if (installed.has(agent)) return;
|
|
658
|
+
ensureProjection();
|
|
659
|
+
if (!servicesReady(ctx)) {
|
|
660
|
+
if (!warned) {
|
|
661
|
+
runtime.warn("auto-team: host services are unavailable; waiting for agent and goal services");
|
|
662
|
+
warned = true;
|
|
663
|
+
}
|
|
664
|
+
return;
|
|
665
|
+
}
|
|
666
|
+
const membership = ctx.get("agentTeams")?.tryMembership(agent);
|
|
667
|
+
if (membership === void 0) return;
|
|
668
|
+
if (membership.role === "teammate") {
|
|
669
|
+
if (membership.name !== resolved.reportingAgentName) installed.set(agent, installWorkerGuard(agent, membership.root, autoTeam));
|
|
670
|
+
return;
|
|
671
|
+
}
|
|
672
|
+
const restored = ctx.get("sessionProjections")?.stateOf(agent.session, "autoTeam")?.score;
|
|
673
|
+
if (restored !== void 0 && restored !== null) autoTeam.restore(agent, restored);
|
|
674
|
+
installed.set(agent, installLead({
|
|
675
|
+
agent,
|
|
676
|
+
autoTeam,
|
|
677
|
+
config: resolved,
|
|
678
|
+
source
|
|
679
|
+
}));
|
|
680
|
+
};
|
|
681
|
+
for (const agent of ctx.get("agents")?.list() ?? []) install(agent);
|
|
682
|
+
ctx.on("agent/created", ({ agent, source }) => {
|
|
683
|
+
install(agent, source);
|
|
684
|
+
});
|
|
685
|
+
ctx.on("agent/disposed", ({ agent }) => {
|
|
686
|
+
installed.get(agent)?.();
|
|
687
|
+
installed.delete(agent);
|
|
688
|
+
});
|
|
689
|
+
ctx.on("internal/service", (name) => {
|
|
690
|
+
if (name !== "agentTeams" && name !== "goals" && name !== "tools" && name !== "systemPrompt" && name !== "sessionProjections") return;
|
|
691
|
+
ensureProjection();
|
|
692
|
+
for (const agent of ctx.get("agents")?.list() ?? []) install(agent);
|
|
693
|
+
});
|
|
694
|
+
ctx.effect(() => () => {
|
|
695
|
+
for (const dispose of installed.values()) dispose();
|
|
696
|
+
installed.clear();
|
|
697
|
+
}, "auto-team.install()");
|
|
698
|
+
}
|
|
699
|
+
//#endregion
|
|
700
|
+
//#region src/index.ts
|
|
701
|
+
/**
|
|
702
|
+
* Standalone function plugin for DeepSeek Harness.
|
|
703
|
+
*
|
|
704
|
+
* @module @oh-my-dsh/auto-team
|
|
705
|
+
*/
|
|
706
|
+
/** Cordis plugin name; keep this stable after publishing. */
|
|
707
|
+
const name = "auto-team";
|
|
708
|
+
/** Services that must exist before the plugin is applied. */
|
|
709
|
+
const inject = [];
|
|
710
|
+
//#endregion
|
|
711
|
+
export { Config, apply, inject, name };
|
package/package.json
CHANGED
|
@@ -1,6 +1,108 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oh-my-dsh/auto-team",
|
|
3
|
-
"
|
|
4
|
-
"
|
|
5
|
-
|
|
3
|
+
"description": "Score-gated Agent Teams workflow for DeepSeek Harness",
|
|
4
|
+
"keywords": [
|
|
5
|
+
"cordis",
|
|
6
|
+
"cordis-plugin",
|
|
7
|
+
"deepseek-harness",
|
|
8
|
+
"dsh",
|
|
9
|
+
"dsh-plugin",
|
|
10
|
+
"auto-team",
|
|
11
|
+
"long-task",
|
|
12
|
+
"agent-team",
|
|
13
|
+
"goal"
|
|
14
|
+
],
|
|
15
|
+
"license": "BSD-3-Clause",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/omdsh-dev/auto-team.git"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://github.com/omdsh-dev/auto-team#readme",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/omdsh-dev/auto-team/issues"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=24.0.0",
|
|
29
|
+
"dsh": ">=0.2.1-rc.2 <0.3.0"
|
|
30
|
+
},
|
|
31
|
+
"type": "module",
|
|
32
|
+
"version": "0.1.0",
|
|
33
|
+
"imports": {
|
|
34
|
+
"#src/*": "./src/*.ts"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"lib",
|
|
38
|
+
"cordis.patch.yml",
|
|
39
|
+
"src/assets/locale/*.json",
|
|
40
|
+
"src/assets/icon.svg",
|
|
41
|
+
"README.md",
|
|
42
|
+
"README.zh.md"
|
|
43
|
+
],
|
|
44
|
+
"exports": {
|
|
45
|
+
".": {
|
|
46
|
+
"types": "./lib/index.d.ts",
|
|
47
|
+
"default": "./lib/index.js"
|
|
48
|
+
},
|
|
49
|
+
"./locale/*.json": "./src/assets/locale/*.json",
|
|
50
|
+
"./icon": "./src/assets/icon.svg",
|
|
51
|
+
"./package.json": "./package.json"
|
|
52
|
+
},
|
|
53
|
+
"main": "./lib/index.js",
|
|
54
|
+
"types": "./lib/index.d.ts",
|
|
55
|
+
"icon": "./src/assets/icon.svg",
|
|
56
|
+
"dsh": {
|
|
57
|
+
"manifestVersion": 1,
|
|
58
|
+
"bundle": {
|
|
59
|
+
"patch": "./cordis.patch.yml"
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"zod": "4.4.3"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"@deepseek-ai/cordis": "~4.0.5",
|
|
67
|
+
"@deepseek-ai/schemastery": "~3.18.5",
|
|
68
|
+
"@deepseek-ai/dsh-agent": "0.2.1-rc.2",
|
|
69
|
+
"@deepseek-ai/dsh-experimental-agent-team": "0.2.1-rc.2",
|
|
70
|
+
"@deepseek-ai/dsh-goal": "0.2.1-rc.2",
|
|
71
|
+
"@deepseek-ai/dsh-llm": "0.2.1-rc.2",
|
|
72
|
+
"@deepseek-ai/dsh-session": "0.2.1-rc.2",
|
|
73
|
+
"@deepseek-ai/dsh-session-projection": "0.2.1-rc.2",
|
|
74
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
|
|
75
|
+
"@deepseek-ai/dsh-tools": "0.2.1-rc.2"
|
|
76
|
+
},
|
|
77
|
+
"devDependencies": {
|
|
78
|
+
"@deepseek-ai/cordis": "~4.0.5",
|
|
79
|
+
"@deepseek-ai/cordis-plugin-loader": "~1.0.6",
|
|
80
|
+
"@deepseek-ai/schemastery": "~3.18.5",
|
|
81
|
+
"@deepseek-ai/dsh-agent": "0.2.1-rc.2",
|
|
82
|
+
"@deepseek-ai/dsh-experimental-agent-team": "0.2.1-rc.2",
|
|
83
|
+
"@deepseek-ai/dsh-goal": "0.2.1-rc.2",
|
|
84
|
+
"@deepseek-ai/dsh-llm": "0.2.1-rc.2",
|
|
85
|
+
"@deepseek-ai/dsh-session": "0.2.1-rc.2",
|
|
86
|
+
"@deepseek-ai/dsh-session-projection": "0.2.1-rc.2",
|
|
87
|
+
"@deepseek-ai/dsh-system-prompt": "0.2.1-rc.2",
|
|
88
|
+
"@deepseek-ai/dsh-tools": "0.2.1-rc.2",
|
|
89
|
+
"@tsconfig/node24": "^24.0.5",
|
|
90
|
+
"@types/node": "^24.0.0",
|
|
91
|
+
"oxfmt": "0.73.0",
|
|
92
|
+
"oxlint": "1.81.0",
|
|
93
|
+
"oxlint-tsgolint": "7.0.2001",
|
|
94
|
+
"tsdown": "^0.22.2",
|
|
95
|
+
"typescript": "^6.0.3",
|
|
96
|
+
"vitest": "^4.1.11"
|
|
97
|
+
},
|
|
98
|
+
"scripts": {
|
|
99
|
+
"build": "tsdown",
|
|
100
|
+
"fmt": "oxfmt src tests",
|
|
101
|
+
"fmt:check": "oxfmt --check src tests",
|
|
102
|
+
"lint": "oxlint src tests",
|
|
103
|
+
"lint:fix": "oxlint --fix src tests",
|
|
104
|
+
"test": "vitest run",
|
|
105
|
+
"extract:patch": "node scripts/extract-patch.mjs",
|
|
106
|
+
"patch:host": "bash scripts/patch.sh"
|
|
107
|
+
}
|
|
6
108
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" role="img" aria-label="DSH Plugin Template">
|
|
2
|
+
<defs>
|
|
3
|
+
<linearGradient id="g" x1="8" y1="4" x2="56" y2="60" gradientUnits="userSpaceOnUse">
|
|
4
|
+
<stop offset="0" stop-color="#4f8cff"/>
|
|
5
|
+
<stop offset="1" stop-color="#7048e8"/>
|
|
6
|
+
</linearGradient>
|
|
7
|
+
</defs>
|
|
8
|
+
<rect x="4" y="4" width="56" height="56" rx="14" fill="url(#g)"/>
|
|
9
|
+
<path d="M23 21v7M41 21v7" stroke="#fff" stroke-width="4" stroke-linecap="round"/>
|
|
10
|
+
<path d="M19 28h26v10a13 13 0 0 1-13 13 13 13 0 0 1-13-13V28Z" fill="#fff"/>
|
|
11
|
+
<path d="M32 36v8" stroke="#7048e8" stroke-width="4" stroke-linecap="round"/>
|
|
12
|
+
<circle cx="48" cy="16" r="4" fill="#ffd43b"/>
|
|
13
|
+
</svg>
|