@oh-my-dsh/auto-team 0.1.5 → 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 CHANGED
@@ -1,137 +1,159 @@
1
- # DSH Auto Team
2
-
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. Delegation, messaging, and worktree tools come from the host profile. It targets DSH 0.2.2-rc.5 and Node.js 24.9 or later.
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 an active user-created goal already exists at the first score, the threshold is multiplied by 0.6.
14
-
15
- A Lead with no recorded score must score before ending its turn, including after a reset or a resume without a score. An `agent/turn-stopping` listener steers it back with a reminder. After a successful score, `auto_team_score` removes itself; a reset makes the tool available again.
16
-
17
- The score is frozen for the task. Only a user-triggered `/auto-team-reset` clears it; the next score becomes the new frozen decision. 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 no active goal exists; a completed goal is replaced;
22
- - ensures a user-facing reporting teammate named `reporter`, which is configurable; the reporter sends one update or answer directly to the user per turn and returns; the Lead monitors the team on its own schedule;
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
- - `sessionProjections` from `@deepseek-ai/dsh-session-projection` (required injection)
36
- - `agents`, `tools`, `systemPrompt`
37
- - `subagents` from `@deepseek-ai/dsh-subagent`, with the `spawn` provider (or the configured reporting provider)
38
- - `goals` from `@deepseek-ai/dsh-goal`
39
- - `commands` from `@deepseek-ai/dsh-commands` (optional; enables `/auto-team-reset`)
40
- - `create_worktree` from `@deepseek-ai/dsh-experimental-tool-worktree` (required for execution agents to pass the edit guard)
41
-
42
- Cordis waits for `sessionProjections` before activation. The plugin awaits its projection registration before restoring scores or exposing the scoring tool and stop guard. If the other host services are absent, it logs a warning and waits; an `internal/service` listener retries installation when they arrive. The `commands` service is optional: without it the score tool still works and `/auto-team-reset` is not registered.
43
-
44
- The plugin uses the host’s `subagents` service instead of experimental Agent Teams: `rootOf`/`namesOf` for membership, `listDescendants` for reporter discovery, and `startActivation` for creation. Child guards install at `subagent/start`, after runtime ownership is published, rather than during the earlier `agent/created` notification. The old Agent Teams task-board tools are no longer a prerequisite.
45
-
46
- ## Install
47
-
48
- Build and pack the package:
49
-
50
- ```sh
51
- pnpm install
52
- pnpm run lint
53
- pnpm test
54
- pnpm run build
55
- pnpm pack
56
- ```
57
-
58
- Install from npm once the package is published:
59
-
60
- ```sh
61
- dsh plugin --profile <profile> add @oh-my-dsh/auto-team
62
- ```
63
-
64
- Or install a locally packed tarball:
65
-
66
- ```sh
67
- dsh plugin --profile <profile> add ./oh-my-dsh-auto-team-0.1.5.tgz
68
- ```
69
-
70
- The package name is `@oh-my-dsh/auto-team`, published under the `@oh-my-dsh` scope.
71
-
72
- ## Configuration
73
-
74
- Every field is optional. Schemastery checks the values at load; invalid values fail activation.
75
-
76
- | Field | Default | Meaning |
77
- | --- | --- | --- |
78
- | `message` | `auto-team loaded` | Activation log line. |
79
- | `threshold` | `0.55` | Base score needed for Team mode. |
80
- | `manualGoalFactor` | `0.6` | Multiplier applied to the threshold when a user-created goal exists. |
81
- | `weights` | scope 0.3, parallelism 0.25, ambiguity 0.15, risk 0.15, expectedSteps 0.15 | Relative weight of each difficulty factor. |
82
- | `reportingAgentName` | `reporter` | Reporting agent name: 1–32 lower-kebab-case characters, other than `lead`. |
83
- | `reportingProvider` | `spawn` | Subagent provider used for the reporter. |
84
- | `goalMaxRounds` | `256` | Round cap used when the plugin starts a goal. |
85
- | `enforceLeadNoCode` | `true` | Install the Lead write/edit gate. |
86
- | `leadDeniedTools` | `['write', 'edit']` | Tool names denied to a Team-mode Lead. |
87
-
88
- ## Tool
89
-
90
- The package adds one model-facing tool.
91
-
92
- `auto_team_score` takes:
93
-
94
- | Parameter | Type | Meaning |
95
- | --- | --- | --- |
96
- | `scope` | integer 1 to 5 | Expected change scope. |
97
- | `parallelism` | integer 1 to 5 | How much independent work can run at once. |
98
- | `ambiguity` | integer 1 to 5 | How much requirement or design uncertainty remains. |
99
- | `risk` | integer 1 to 5 | How costly a wrong change would be. |
100
- | `expected_steps` | integer 1 to 5 | Expected task length. |
101
- | `objective` | string | The task goal in its ordinary meaning. Used only when the plugin starts a goal. |
102
-
103
- It returns `{ decision, goal, reporter? }`. The numeric score and threshold are not in the result. The host's subagent tools handle delegation and messaging. The host goal lifecycle handles completion and continuation.
104
-
105
- ## Commands
106
-
107
- When the profile provides the host `commands` service, the plugin registers `auto-team-reset`:
108
-
109
- - `/auto-team-reset` clears the frozen score for the current session.
110
- - It appends a `plugin:auto-team/reset` record, so resuming the session does not restore the cleared score.
111
- - It is silent by default and re-enables `auto_team_score`. Any text after the command is sent to the Lead as a user message. The next turn cannot end without a new score; a bare reset does not itself start a turn. The current goal and reporter stay in place.
112
- - The command is user-triggered; the model cannot invoke it.
113
-
114
- ## Guards and limits
115
-
116
- - 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.
117
- - 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.
118
- - The reporter is spawned with the configured local, continuable provider. Its initial activation uses `delivery: 'caller'`: read and continue its replies in its own subagent conversation, without asking the Lead to relay them. DSH does not persist that result-delivery policy across cold resumes; a resumed activation may also notify its parent. If spawning fails, the score stays frozen and a later call retries the reporter.
119
- - An isolated DSH 0.2.2-rc.5 `headless` profile smoke test installed the packed plugin and verified activation, host-only scoring, one-shot tool removal, and silent reset without calling a model. It did not exercise reporter conversations or worker worktrees in a live profile.
120
-
121
- ## Development
1
+ # Auto Team
2
+
3
+ [简体中文](README.zh.md)
4
+
5
+ Auto Team is a host plugin for DeepSeek Harness (DSH). It helps a Lead coordinate
6
+ parallel implementation **after you enable native Agent Teams and set an active
7
+ goal**. The Lead keeps the main checkout; local execution agents work in separate
8
+ DSH-created Git worktrees. DSH still owns delegation, conversations, progress,
9
+ and the goal lifecycle. Auto Team adds a Web composer-dock control, but no separate tools or scheduler.
10
+
11
+ ## Set up an isolated profile
12
+
13
+ - Use a local Git repository and a DSH profile with native Agent Teams,
14
+ subagents and goals. Compose DSH's official Git worktree provider and worktree
15
+ tool before Auto Team; installing Auto Team does not enable them. Use one
16
+ official composition, not duplicate worktree rows.
17
+ - The manifest declares DSH `>=0.2.2-rc.5 <0.3.0`. **The acceptance baseline
18
+ is `0.2.2-rc.5`**, not every release admitted by that range. The worktree
19
+ tool names and sandbox behavior below are based on the
20
+ [version comparison](docs/plans/native-execution/research-git.md). This guide
21
+ does not certify any release/platform combination as runtime-tested.
22
+ - To build a local tarball, use Node.js `>=24.9.0` and pnpm `11.28.5`:
23
+
24
+ ```sh
25
+ pnpm install --frozen-lockfile
26
+ pnpm run build
27
+ pnpm pack --pack-destination "<existing temporary directory>"
28
+ ```
29
+
30
+ Use the selected host's plugin manager to add that **local tarball** to a
31
+ separate development profile under a temporary DSH home. Confirm the exact CLI
32
+ with that host's help. For hosts with the following profile CLI, keep
33
+ `--profile` before forwarded package-manager arguments:
122
34
 
123
35
  ```sh
124
- pnpm install
125
- pnpm run lint
126
- pnpm test
127
- pnpm run build
128
- pnpm pack --dry-run --json
36
+ dsh plugin --profile "<isolated profile>" add "<absolute tarball path>"
37
+ dsh --profile "<isolated profile>" --dump-config
129
38
  ```
130
39
 
131
- The tests cover the scoring policy, configuration, goal and reporter orchestration, the durable score projection and reset, the reset command, the runtime install path, and the Loader export shape. A real DSH 0.2.2-rc.5 projection-registry test also checks awaited handles, host-only visibility, replay, and fiber disposal.
132
-
133
- 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.
134
-
135
- ## Status
136
-
137
- 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.
40
+ In the effective configuration, check for the required native providers and the
41
+ `auto-team` row loading `@oh-my-dsh/auto-team`. Its sole setting is
42
+ `message` (string), a startup diagnostic. The shipped bundle supplies
43
+ `auto-team loaded`; this message neither switches on the team nor proves that
44
+ the write checks apply. If the release or provider combination is not compatible,
45
+ stop rather than bypassing the compatibility check. These instructions do not
46
+ install to a live profile or imply that a new version is available on npm.
47
+
48
+ ## Run a goal
49
+
50
+ 1. **Enable Agent Teams in the local root session, then set a goal** using
51
+ DSH's native controls. No members are required yet. The goal must be active
52
+ and armed for execution. If DSH retains an active goal after a resume or fork
53
+ but disarms it, explicitly continue it through DSH; Auto Team does not rearm
54
+ it. Pausing, blocking or finishing the goal, or turning the team off, ends
55
+ the assistance at the next evaluation. A request already assembled or in
56
+ flight is not necessarily withdrawn.
57
+ 2. **Lead:** Keep the main checkout. Delegate independent work through DSH;
58
+ specify a deliverable, a local base commit and acceptance criteria so each
59
+ agent can verify its own result. Review and coordinate integration instead
60
+ of implementing directly while the policy applies. No split is required if
61
+ the work cannot be delegated independently.
62
+ 3. **Execution agent:** In your own local session, create a worktree using
63
+ DSH's official tool. On `0.2.2-rc.5` use `create_worktree` with a unique
64
+ `name` and an agreed local `from` commit. Later hosts that offer
65
+ `enter_worktree` need the **creation** path (pass a new name and an explicit
66
+ local `from`); entering someone else's checkout does not qualify. Verify
67
+ the effective working directory and branch before editing. A worktree starts
68
+ at the selected commit, so uncommitted changes in the main checkout are not
69
+ copied. Use absolute `file_path` values for native `write` and `edit`.
70
+ 4. **Handoff and cleanup:** Report the branch, commit or diff, tests and
71
+ remaining issues through DSH. The Lead reviews and accepts the work, then
72
+ integrates only as authorized. Auto Team does not create or remove worktrees,
73
+ commit, merge, push, or archive. Before authorized manual cleanup or native
74
+ session archival, stop processes using the worktree and check everything to
75
+ retain, including untracked and ignored files. Check the official host's
76
+ archive policy (including `retainOnArchive`) if the checkout must be kept.
77
+
78
+ ## Parallelism in Web
79
+
80
+ In a local root session, select **Parallelism** at the end of the composer dock.
81
+ The circle shows the current number of running subagents; the two handles set
82
+ an inclusive lower and upper bound from 0 to 8. The display shows the actual
83
+ count even when it exceeds the scale. The switch defaults to off independently
84
+ for each session, and the settings reset when the plugin or host restarts.
85
+
86
+ When enabled and native Agent Teams and a goal are both active, the Lead gets a
87
+ prompt below the lower bound to delegate more independent work, or above the
88
+ upper bound to review completed worktrees and branches that can be cleaned up
89
+ safely. Equality and in-range counts cause no extra prompt. The control does not
90
+ automatically delegate, cancel an agent, or delete Git resources.
91
+
92
+ ## What the write checks cover
93
+
94
+ In the same pop-up, **Enable write restrictions** appears below the parallelism
95
+ switch. It defaults to on for each local root session and is independent of
96
+ parallelism guidance. Turning it off removes only Auto Team’s write restrictions
97
+ for that root and its subagents; native DSH permissions and approvals still apply.
98
+ Reloading the plugin or restarting the host restores the default.
99
+
100
+ The current session's working directory has two exceptions: its top-level
101
+ `AGENTS.md` and files under `.agents/`. Both the Lead and execution agents
102
+ can use native `write` / `edit` on those files without an owned worktree,
103
+ subject to DSH permissions. `.agents/worktrees/` and links to targets outside
104
+ the exception do not qualify.
105
+
106
+ For other files, the policy rejects the Lead's native `write` and `edit` calls.
107
+ For an execution agent, the same tools require a worktree created by
108
+ that session, an effective working directory that matches that checkout, and a
109
+ verified target inside it. A normal Git directory, inherited records, entering
110
+ another agent's worktree, and a path that cannot be verified do not qualify.
111
+ Native permissions and approvals still apply. Other roots are evaluated
112
+ independently; sessions that do not meet the activation criteria retain native
113
+ DSH behavior.
114
+
115
+ **This is not a security sandbox.** The promise covers only the native
116
+ `write` and `edit` execution paths checked by the plugin. It does not extend
117
+ to shells, terminals, arbitrary `run_code` or `pwsh` operations, other write
118
+ tools, Git metadata, or paths changed concurrently after validation. Do not
119
+ switch tools to bypass a rejection. On `0.2.2-rc.5`, changing the session's
120
+ current directory does not narrow the host's original `workspace-write`
121
+ root. On Windows, file-tool checks do not imply process or Git permission to
122
+ write shared worktree metadata. If you require hard isolation across all
123
+ entry points, use independently enforced writable roots and a verified host
124
+ sandbox.
125
+
126
+ If a worktree cannot be created or verified (for example, the official module is
127
+ missing, the directory is not a Git repository, a branch conflicts, permissions
128
+ are denied, or resume falls back to the project directory), keep the affected
129
+ execution agent on read-only implementation work rather than writing project
130
+ files in the shared checkout.
131
+ Resolve the native issue and recheck ownership and the working directory. If
132
+ needed, a person can prepare and verify a separate native Workspace for a
133
+ manual handoff; it does not become the existing agent's owned worktree.
134
+
135
+ ## Upgrade or roll back
136
+
137
+ 1. Back up the deployment configuration and note the installed package version.
138
+ Review and remove only obsolete Auto Team options and integrations from the
139
+ replacement configuration: score/threshold settings, report-agent names,
140
+ plugin-specific goal round settings, and dependencies on retired tools.
141
+ Review old host patches separately; do not apply one for this rewrite or
142
+ blindly reverse changes that other plugins rely on.
143
+ 2. First replace the old bundle with the local tarball in an isolated profile
144
+ and inspect the effective row and native providers. Keep native team and goal
145
+ configuration and state, session history, worktrees, branches and
146
+ uncommitted changes. Old score records are ignored; there is no migration or
147
+ replay. Do not remove old sessions to make the new behavior activate.
148
+ 3. To return to native DSH alone, disable or remove only the Auto Team bundle
149
+ and any profile-local Auto Team overrides. Keep the native providers and
150
+ user data. To restore earlier plugin behavior, use only an explicitly
151
+ approved, compatible old artifact and its saved configuration; do not copy
152
+ obsolete options into the rewritten bundle. Recheck the effective config
153
+ and keep worktree cleanup separate from plugin removal.
154
+
155
+ See the [host contract](docs/dsh-plugin-contracts.md) and
156
+ [acceptance checklist](docs/plans/native-execution/acceptance.md) for provider,
157
+ packaging and real-profile checks. Build and package checks alone do not prove
158
+ activation, worktree ownership, or isolation. The original Auto Team icon is
159
+ covered by the repository's [BSD 3-Clause license](LICENSE).
package/README.zh.md CHANGED
@@ -1,137 +1,120 @@
1
- # DSH Auto Team
1
+ # Auto Team
2
2
 
3
- [English](README.md) | 中文
3
+ [English](README.md)
4
4
 
5
- `@oh-my-dsh/auto-team` 是一个只跑在宿主侧的 DeepSeek Harness 插件,Cordis id 为 `auto-team`。它给长任务一个带评分的起点和团队式的执行方式,同时把具体分数留在模型上下文之外。
5
+ Auto Team 是 DeepSeek Harness(DSH)的宿主插件。**用户开启原生 Agent Teams 并
6
+ 布置正在生效的 goal 后**,插件才辅助并行执行。Lead 维护主检出,本地执行 Agent
7
+ 在各自通过 DSH 创建的 Git 工作树里实现。委派、沟通、进度和 goal 生命周期仍由
8
+ DSH 管理;插件只扩展 Web 会话状态栏,不增加独立工具或调度器。
6
9
 
7
- 插件负责首轮判断、goal 桥接,以及 Lead 和执行 Agent 的策略闸门。委派、消息和 worktree 工具由宿主 profile 提供。目标版本是 DSH 0.2.2-rc.5,需要 Node.js 24.9 或更高版本。
10
+ ## 准备隔离 profile
8
11
 
9
- ## 任务怎么跑
12
+ - 使用本地 Git 仓库,选择提供原生 Agent Teams、子 Agent 和 goal 的 DSH profile。
13
+ 先为该 profile 装配 DSH 官方工作树服务和工具,再装配 Auto Team。安装 Auto Team
14
+ 不会替你开启这些能力;官方工作树组合只装一套,避免重复配置行。
15
+ - 清单声明的 DSH 范围是 `>=0.2.2-rc.5 <0.3.0`,**验收基线为 `0.2.2-rc.5`**,
16
+ 不代表范围内所有版本已经验证。下文工具名和沙箱差异来自
17
+ [版本对照](docs/plans/native-execution/research-git.md);本文不声称任何发行版与
18
+ 平台组合已通过运行时验收。
19
+ - 使用 Node.js `>=24.9.0` 与 pnpm `11.28.5` 构建本地 tarball:
10
20
 
11
- 首轮由 Lead 调用一次 `auto_team_score`。参数是五个 1 到 5 的难度因子:scope、parallelism、ambiguity、risk、expected_steps,再加一句任务在通常语义上的目标。
21
+ ```sh
22
+ pnpm install --frozen-lockfile
23
+ pnpm run build
24
+ pnpm pack --pack-destination "<已有的临时目录>"
25
+ ```
12
26
 
13
- 插件把因子折算成 0 到 1 的加权分数。模型只拿到 `team` 或 `solo`,分数和实际阈值都留在宿主侧。默认阈值是 0.55。如果第一次打分时已经存在有效的用户触发 goal,阈值乘以 0.6。
14
-
15
- Lead 没有分数时就必须在结束本轮前打分,包括 reset 后或 resume 时没有分数的情况。`agent/turn-stopping` 监听器会把它拉回来,再发一次提醒。成功打分后,`auto_team_score` 会注销自身;reset 后工具重新出现。
16
-
17
- 分数在任务内冻结。只有用户主动执行 `/auto-team-reset` 才能清空;下一次打分成为新的冻结决定。它以 `plugin:auto-team/score` 记录写进 session log,并折进宿主侧的 `autoTeam` 投影。resume 时恢复这个决定,不会重新打分。
18
-
19
- 决定使用团队后,插件会:
20
-
21
- - 复用当前有效 goal;没有有效 goal 就启动一个,已完成的 goal 会被替换;
22
- - 确保存在名为 `reporter` 的汇报 Agent,名字可配置;它每轮只发一条更新或回答就直接发给用户,然后返回;Lead 按自己的节奏监听团队;
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
- - `sessionProjections`,来自 `@deepseek-ai/dsh-session-projection`(必需注入)
36
- - `agents`、`tools`、`systemPrompt`
37
- - `subagents`,来自 `@deepseek-ai/dsh-subagent`,并提供 `spawn` 或配置指定的汇报 provider
38
- - `goals`,来自 `@deepseek-ai/dsh-goal`
39
- - `commands`,来自 `@deepseek-ai/dsh-commands`(可选;启用 `/auto-team-reset`)
40
- - `create_worktree`,来自 `@deepseek-ai/dsh-experimental-tool-worktree`(执行 Agent 通过编辑闸门所需)
41
-
42
- Cordis 会等待 `sessionProjections` 到位才激活插件。插件先等待投影注册完成,再恢复分数、开放评分工具和停止守卫。其他宿主服务缺失时会打一条警告并等待;服务到位后,`internal/service` 监听器会重试安装。`commands` 服务是可选的:没有它,打分工具照常工作,但不会注册 `/auto-team-reset`。
43
-
44
- 插件使用宿主的 `subagents` 服务,不再依赖实验性的 Agent Teams:用 `rootOf`/`namesOf` 识别成员,用 `listDescendants` 查找汇报 Agent,用 `startActivation` 创建。执行 Agent 的守卫在运行时归属已发布的 `subagent/start` 安装,不在更早的 `agent/created` 中读取成员身份。旧 Agent Teams 任务板工具不再是前置依赖。
45
-
46
- ## 安装
47
-
48
- 构建并打包:
49
-
50
- ```sh
51
- pnpm install
52
- pnpm run lint
53
- pnpm test
54
- pnpm run build
55
- pnpm pack
56
- ```
57
-
58
- 从 npm 安装已发布的包:
59
-
60
- ```sh
61
- dsh plugin --profile <profile> add @oh-my-dsh/auto-team
62
- ```
63
-
64
- 或者安装本地打包的 tarball:
27
+ 使用目标宿主的插件管理器,将**本地 tarball** 安装至临时 DSH home 下的独立开发
28
+ profile。先查看该宿主的命令帮助;若支持以下 profile 命令,把 `--profile` 放在
29
+ 转发给包管理器的参数之前:
65
30
 
66
31
  ```sh
67
- dsh plugin --profile <profile> add ./oh-my-dsh-auto-team-0.1.5.tgz
32
+ dsh plugin --profile "<隔离 profile>" add "<tarball 的绝对路径>"
33
+ dsh --profile "<隔离 profile>" --dump-config
68
34
  ```
69
35
 
70
- 包名是 `@oh-my-dsh/auto-team`,发布在 `@oh-my-dsh` scope 下。
71
-
72
- ## 配置
73
-
74
- 所有字段都可选。Schemastery 在加载时校验,非法值会让激活失败。
75
-
76
- | 字段 | 默认值 | 含义 |
77
- | --- | --- | --- |
78
- | `message` | `auto-team loaded` | 激活时的日志。 |
79
- | `threshold` | `0.55` | 进入团队模式的基础分数。 |
80
- | `manualGoalFactor` | `0.6` | 已有用户触发 goal 时,阈值的乘数。 |
81
- | `weights` | scope 0.3、parallelism 0.25、ambiguity 0.15、risk 0.15、expectedSteps 0.15 | 各难度因子的相对权重。 |
82
- | `reportingAgentName` | `reporter` | 汇报 Agent 名字:1–32 个小写字母、数字或连字符,以字母开头,不能为 `lead`。 |
83
- | `reportingProvider` | `spawn` | 创建汇报 Agent 时用的子 Agent provider。 |
84
- | `goalMaxRounds` | `256` | 插件启动 goal 时使用的轮次上限。 |
85
- | `enforceLeadNoCode` | `true` | 是否安装 Lead 的写文件闸门。 |
86
- | `leadDeniedTools` | `['write', 'edit']` | 团队模式下拒绝给 Lead 的工具名。 |
87
-
88
- ## 工具
89
-
90
- 这个包只增加一个模型可见工具。
91
-
92
- `auto_team_score` 的参数:
93
-
94
- | 参数 | 类型 | 含义 |
95
- | --- | --- | --- |
96
- | `scope` | 1 到 5 的整数 | 预计改动范围。 |
97
- | `parallelism` | 1 到 5 的整数 | 有多少独立工作可以同时做。 |
98
- | `ambiguity` | 1 到 5 的整数 | 还剩多少需求或设计不确定。 |
99
- | `risk` | 1 到 5 的整数 | 改错了代价多大。 |
100
- | `expected_steps` | 1 到 5 的整数 | 预计任务有多长。 |
101
- | `objective` | 字符串 | 任务在通常语义上的目标。只在插件启动 goal 时使用。 |
102
-
103
- 返回 `{ decision, goal, reporter? }`。分数和阈值不在返回里。委派和消息由宿主的 subagent 工具负责;完成和续跑由宿主的 goal 生命周期负责。
104
-
105
- ## 命令
106
-
107
- profile 提供宿主 `commands` 服务时,插件注册 `auto-team-reset`:
108
-
109
- - `/auto-team-reset` 清空当前 session 的冻结分数。
110
- - 它写入 `plugin:auto-team/reset` 记录,resume 时不会恢复被清掉的分数。
111
- - 它默认静默,并重新开放 `auto_team_score`;命令后附带的文字会作为用户消息发给 Lead。下一轮没有新分数就不能结束,但仅执行裸 reset 不会主动启动一轮。当前 goal 和汇报 Agent 保留。
112
- - 命令由用户触发,模型不能调用。
113
-
114
- ## 闸门与限制
115
-
116
- - Lead 的闸门是工具名策略,不是沙箱。`pwsh`、`run_code` 和直接的文件系统操作可以绕过。策略文本会明确要求 Lead 不要拿它们绕路。
117
- - 执行 Agent 的闸门会检查 `create_worktree` 是否成功;宿主返回 worktree 路径时,还会要求每次 `write`/`edit` 的 `file_path` 是该路径内的绝对路径。宿主结果没有路径时,只检查成功。
118
- - 汇报 Agent 使用配置的本地、可续接 provider 创建。首次 activation 采用 `delivery: 'caller'`:用户直接在它自己的子会话里阅读和继续对话,不需要 Lead 转述。DSH 不会跨冷恢复持久化这项结果投递策略;冷恢复后的一轮可能同时通知父 Agent。创建失败时,分数仍保持冻结,后续调用会重试创建。
119
- - 已在隔离的 DSH 0.2.2-rc.5 `headless` profile 安装打包产物,不调用模型,验证了插件激活、评分仅在宿主侧可见、评分后工具注销和静默 reset。此次实测未覆盖汇报 Agent 的对话或执行 Agent 的 worktree。
120
-
121
- ## 开发
122
-
123
- ```sh
124
- pnpm install
125
- pnpm run lint
126
- pnpm test
127
- pnpm run build
128
- pnpm pack --dry-run --json
129
- ```
130
-
131
- 测试覆盖评分策略、配置、goal 与汇报 Agent 编排、持久化分数投影与重设、重设命令、运行时安装路径,以及 Loader 导出形状。另用 DSH 0.2.2-rc.5 的真实投影注册表验证异步句柄、宿主侧可见性、重放和 fiber 清理。
132
-
133
- 行为说明和流程图见[设计文档](docs/auto-team-design.md),包规则见[插件契约](docs/dsh-plugin-contracts.md)。
134
-
135
- ## 状态
136
-
137
- 核心流程已经可用,并有仓库测试覆盖。发布检查已通过。把包装进已经组合好所需服务的 profile,跑一个长任务确认实际行为。
36
+ 在生效配置里核对原生能力以及加载 `@oh-my-dsh/auto-team` 的 `auto-team` 行。
37
+ 唯一配置 `message`(字符串)只用于启动诊断,随包组合提供 `auto-team loaded`。
38
+ 这条消息不是 team 开关,也不证明写入检查已生效。宿主或 provider 不兼容时应停止,
39
+ 而不是绕过版本检查。以上步骤不用于现有实际 profile,也不代表 npm 已有新版。
40
+
41
+ ## 执行一个 goal
42
+
43
+ 1. **先在本地根会话开启原生 team,再使用 DSH 布置 goal。** 不需要先有成员。
44
+ goal 必须同时处于活跃状态且获得原生执行准入。恢复或 fork 后若 DSH 保留了
45
+ 活跃 goal、但未授权继续,需通过 DSH 明确继续;插件不替你重新授权。暂停、
46
+ 阻塞、结束 goal 或关闭 team 后,下一次判定不再辅助执行;不保证撤回已经
47
+ 组装或在途的请求。
48
+ 2. **Lead:** 保留主检出,通过 DSH 委派独立任务,说明交付物、本地基底提交与
49
+ 验收标准。规则生效期间负责协调、审查和集成,不直接实现;不能独立拆分的
50
+ 工作不必强行派工。
51
+ 3. **执行 Agent:** 在自己的本地会话里调用官方工具新建工作树。`0.2.2-rc.5`
52
+ 使用 `create_worktree`,指定唯一 `name` 和商定的本地 `from` 提交。采用
53
+ `enter_worktree` 的后续宿主要走**新建**路径(指定新名称和明确的本地
54
+ `from`);仅进入他人的检出不合格。修改前核对当前工作目录和分支。工作树
55
+ 从选定提交检出,不会复制主检出中的未提交改动。原生 `write` / `edit` 的
56
+ `file_path` 必须是绝对路径。
57
+ 4. **交付与回收:** 通过 DSH 汇报分支、提交或差异、测试结果和剩余问题。Lead
58
+ 审查、验收,仅在获得授权后集成。Auto Team 不创建或删除工作树,也不提交、
59
+ 合并、推送或归档。若获准手工回收或执行原生会话归档,先停妥使用该检出的
60
+ 进程,核对要保留的文件(包括未跟踪和被忽略的文件)。若需保留检出,先核对
61
+ 官方归档策略(包括 `retainOnArchive`)。
62
+
63
+ ## Web 状态栏的并行度
64
+
65
+ 在本地根会话的输入区状态栏末尾点击 **并行度**。圆点表示当前正在运行的子智能体
66
+ 数量,两条竖线可以拖动,分别设置 0–8 的下限和上限。超出刻度时仍显示真实数量。
67
+ 每个会话的开关独立且默认关闭;重新加载插件或重启宿主后恢复默认设置。
68
+
69
+ 开启后,仅当原生 Agent Teams 已开启且 goal 正在生效时,Lead 才会收到额外的
70
+ 提示:低于下限时,建议拆分并委派更多独立任务;高于上限时,建议检查已经结束、
71
+ 可以安全整理的工作树和分支。等于上下限或位于区间内时不提示。不自动派工、停止
72
+ 智能体或删除 Git 资源。
73
+
74
+ ## 写入检查的范围
75
+
76
+ 同一个小窗中,「启用写入限制」位于「启用并行度提示」下方。这两个开关互不影响。
77
+ 写入限制对每个本地根会话默认开启;关闭后,该根及其子 Agent 不再受 Auto Team
78
+ 额外的写入限制,原生 DSH 权限和审批仍然生效。重新加载插件或重启宿主后恢复默认。
79
+
80
+ 以**当前会话的工作目录**为准,顶层 `AGENTS.md` 和 `.agents/` 下的文件不受
81
+ Auto Team 写入检查约束。Lead 和执行 Agent 无需先创建工作树,也可用原生
82
+ `write` / `edit` 修改这些文件,但仍须遵守 DSH 原生权限。`.agents/worktrees/`
83
+ 和借链接指向例外范围之外的路径不豁免。
84
+
85
+ 对于其他文件,规则生效时,插件拒绝 Lead 的原生 `write` / `edit`。执行 Agent 使用这两个工具
86
+ 时,必须有由其自身会话创建的工作树,当前工作目录须与该检出匹配,目标也必须
87
+ 确认在其中。普通 Git 目录、继承来的记录、仅进入他人工作树或无法核实的路径都
88
+ 不合格。DSH 的原生权限和审批仍然适用。不同根会话独立判定;不满足生效条件的
89
+ 会话保持 DSH 原生行为。
90
+
91
+ **这不是安全沙箱。** 插件只承诺检查原生 `write` 和 `edit` 的受支持执行路径。
92
+ 不保护 Shell、终端、任意 `run_code` 或 `pwsh` 操作、其他写工具、Git 元数据,
93
+ 也不保证防止核验后并发换链。不要切换工具绕过拒绝。`0.2.2-rc.5` 的会话工作
94
+ 目录改变后,原有 `workspace-write` 权限根不会随之收窄。Windows 的文件工具检查
95
+ 不等于进程或 Git 拥有写共享工作树元数据的权限。若要求全入口硬隔离,需分别配置
96
+ 独立、强制执行的可写根,并核证宿主沙箱。
97
+
98
+ 若工作树无法创建或核验(例如缺少官方模块、目录不是 Git 仓库、分支冲突、权限被
99
+ 拒绝,或恢复后工作目录退回项目目录),受影响的执行 Agent 只能以只读方式处理实现任务,不能
100
+ 回落到共享检出写实现文件。修复原生环境后重新核对归属和工作目录。必要时由人准备并
101
+ 验证独立原生 Workspace,手工接续;它不会成为已有执行会话的自建工作树。
102
+
103
+ ## 升级与回退
104
+
105
+ 1. 备份部署配置并记录已安装的包版本。在新版配置里只移除废弃的 Auto Team 参数
106
+ 和集成:评分/阈值、汇报 Agent 名称、插件专属 goal 轮次配置,以及对退役工具的
107
+ 依赖。单独审查旧宿主补丁;本次重写不需要宿主补丁,也不要盲目回退其他插件
108
+ 仍依赖的修改。
109
+ 2. 先在隔离 profile 用本地 tarball 替换旧包,核对生效行和原生 provider。保留原生
110
+ team/goal 的配置和状态、历史会话、工作树、分支与未提交内容。旧评分记录仅是
111
+ 历史:新版忽略它们,不导入、不重放,也不要求删除旧会话。
112
+ 3. 只想退回原生 DSH 时,仅停用或移除 Auto Team bundle 及它的 profile 覆盖项,
113
+ 保留原生能力和用户数据。如需退回旧插件,仅使用明确获准且与宿主兼容的旧包
114
+ 及备份配置;不要给重写版加回旧参数。再次核对生效配置,工作树回收与插件
115
+ 卸载分开处理。
116
+
117
+ provider、打包和真实 profile 验证见 [宿主契约](docs/dsh-plugin-contracts.md)与
118
+ [验收清单](docs/plans/native-execution/acceptance.md)。构建和打包通过不证明宿主
119
+ 激活、工作树归属或隔离。原创 Auto Team 图标适用仓库的
120
+ [BSD 3-Clause 许可](LICENSE)。
package/cordis.patch.yml CHANGED
@@ -7,4 +7,4 @@
7
7
  - id: auto-team
8
8
  name: '@oh-my-dsh/auto-team'
9
9
  config:
10
- message: auto-team loaded
10
+ message: auto-team loaded