@maxiaochao/pi-toolkit 0.12.1 → 0.12.2
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/CHANGELOG.md +5 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/packages/herdr-subagents/CHANGELOG.md +5 -0
- package/packages/herdr-subagents/README.md +7 -3
- package/packages/herdr-subagents/TESTING.md +2 -0
- package/packages/herdr-subagents/agents/analyst.md +2 -2
- package/packages/herdr-subagents/agents/explorer.md +2 -2
- package/packages/herdr-subagents/agents/reviewer.md +2 -2
- package/packages/herdr-subagents/extensions/herdr-subagents.ts +1 -1
- package/packages/herdr-subagents/package.json +1 -1
- package/packages/herdr-subagents/tests/core-state-machine.mjs +38 -1
- package/packages/herdr-subagents/tests/run-tests.mjs +1 -1
- package/skills/agent-team/SKILL.md +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## 2026-10-20 - v0.12.2
|
|
2
|
+
|
|
3
|
+
- herdr-subagents v0.7.1: clarify Persona responsibilities and dispatch guidance
|
|
4
|
+
- Clarify Herdr Persona selection and instructions: broad independent reviewer, codebase explorer, file-changing worker, and neutral charter-driven agent-team analyst. Make the Agent Team skill explicitly select analyst when dispatching through Personas.
|
|
5
|
+
|
|
1
6
|
## 2026-10-19 - v0.12.1
|
|
2
7
|
|
|
3
8
|
- herdr-subagents v0.7.0: add global and project default extension sources with Persona overrides
|
package/README.md
CHANGED
|
@@ -39,7 +39,7 @@ Restart Pi after updating. `pi update --extensions` has the same effect when upd
|
|
|
39
39
|
|
|
40
40
|
Each child README owns its feature description, motivation or upstream alignment, examples, screenshots/demos, configuration, and test documentation.
|
|
41
41
|
|
|
42
|
-
Herdr Subagents tasks require an explicit `agent` Persona; no default `worker` is selected. Personas can opt into local extension files or npm/git Pi packages through `extensions`. Set top-level `defaultExtensions` in `~/.pi/agent/herdr-subagents.json` (or project `.pi/herdr-subagents.json`) to share a fallback list; Persona-specific lists take precedence, and `[]` clears inherited sources. This uses native Pi package semantics: package-provided skills, prompt templates, and themes may also load, and `--no-skills` does not exclude explicitly selected package skills. See the [extension-source contract](packages/herdr-subagents/README.md#explicit-extension-sources-and-pi-packages) for precedence, isolation, and examples. The [real Herdr smoke test](packages/herdr-subagents/TESTING.md) preserves the configured analyst model and explicit authentication extensions while isolating unrelated settings.
|
|
42
|
+
Herdr Subagents tasks require an explicit `agent` Persona; no default `worker` is selected. Choose `reviewer` for independent reviews of proposals, designs, documents, implementations, or analysis; `explorer` for codebase investigation; `worker` for file-changing work; and `analyst` for charter-defined agent-team roles. See [built-in Personas](packages/herdr-subagents/README.md#built-in-personas) for selection guidance and the distinction between parent-facing descriptions and child instructions. Personas can opt into local extension files or npm/git Pi packages through `extensions`. Set top-level `defaultExtensions` in `~/.pi/agent/herdr-subagents.json` (or project `.pi/herdr-subagents.json`) to share a fallback list; Persona-specific lists take precedence, and `[]` clears inherited sources. This uses native Pi package semantics: package-provided skills, prompt templates, and themes may also load, and `--no-skills` does not exclude explicitly selected package skills. See the [extension-source contract](packages/herdr-subagents/README.md#explicit-extension-sources-and-pi-packages) for precedence, isolation, and examples. The [real Herdr smoke test](packages/herdr-subagents/TESTING.md) preserves the configured analyst model and explicit authentication extensions while isolating unrelated settings.
|
|
43
43
|
|
|
44
44
|
Multiple standalone children may be installed together. `pi-openai-account-pool` may also be installed alongside the complete toolkit because the toolkit does not embed it. Every other child in the table above is embedded, so a second install exposes the same resource twice.
|
|
45
45
|
|
package/package.json
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
## 2026-10-20 - v0.7.1
|
|
2
|
+
|
|
3
|
+
- clarify Persona responsibilities and dispatch guidance
|
|
4
|
+
- Clarify parent-facing Persona selection and child instructions: reviewer independently reviews proposals, designs, documents, implementations, and analysis; analyst is the neutral agent-team execution persona with task-defined roles; explorer investigates codebase structure, behavior, and dependencies. Preserve worker instructions and all tool/access boundaries.
|
|
5
|
+
|
|
1
6
|
## 2026-10-19 - v0.7.0
|
|
2
7
|
|
|
3
8
|
- add global and project default extension sources with Persona overrides
|
|
@@ -257,9 +257,13 @@ None of the bundled Personas pins a model, thinking level, skill, or optional ex
|
|
|
257
257
|
| Persona | Access | Built-in tools | Intended use |
|
|
258
258
|
| --- | --- | --- | --- |
|
|
259
259
|
| `worker` | `write` | `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`, `codemode` | One focused implementation or other file-changing task. |
|
|
260
|
-
| `explorer` | `read` | `read`, `bash`, `grep`, `find`, `ls`, `codemode` |
|
|
261
|
-
| `analyst` | `read` | `read`, `bash`, `grep`, `find`, `ls`, `codemode` | Neutral
|
|
262
|
-
| `reviewer` | `read` | `read`, `bash`, `grep`, `find`, `ls`, `codemode` |
|
|
260
|
+
| `explorer` | `read` | `read`, `bash`, `grep`, `find`, `ls`, `codemode` | Codebase structure, behavior, and dependency investigation without file changes. |
|
|
261
|
+
| `analyst` | `read` | `read`, `bash`, `grep`, `find`, `ls`, `codemode` | Neutral agent-team execution where each task supplies the role charter and evaluation method. |
|
|
262
|
+
| `reviewer` | `read` | `read`, `bash`, `grep`, `find`, `ls`, `codemode` | Independent review of proposals, designs, documents, implementations, and analysis against goals and constraints. |
|
|
263
|
+
|
|
264
|
+
Choose `reviewer` for an independent assessment of existing work, `explorer` to investigate how the codebase works, `worker` for file-changing work, and `analyst` for agent-team members whose role is supplied by the task charter. An analyst may perform a review when its charter calls for one; its neutral execution role does not replace the reviewer selection for ordinary review requests.
|
|
265
|
+
|
|
266
|
+
The control tool's `list` action exposes each effective `description` to help the parent choose a Persona. The Markdown body instead becomes the selected child's appended system prompt. Put selection guidance in `description` and execution instructions in the body; bundled definitions keep both in English.
|
|
263
267
|
|
|
264
268
|
`access` is a scheduling declaration: any `write` Persona requires serial execution. It is not by itself a sandbox. For a custom read-only Persona, also omit write-capable tools and load only trusted extensions.
|
|
265
269
|
|
|
@@ -15,6 +15,8 @@ It verifies:
|
|
|
15
15
|
- ordered results despite concurrent completion;
|
|
16
16
|
- sibling continuation after failure and all-failed aggregation;
|
|
17
17
|
- required explicit Personas in the tool schema and execution, including legacy single-task argument normalization;
|
|
18
|
+
- model-facing role selection guidance for broad independent review, codebase investigation, file-changing work, and charter-driven agent-team execution;
|
|
19
|
+
- effective Persona descriptions in parent listings, corresponding bodies in child system prompts, and unchanged read/write tool boundaries;
|
|
18
20
|
- rejection of missing, blank, invalid, and unknown Personas before creating runs, while custom Personas remain supported;
|
|
19
21
|
- explicit rejection of parallel write-capable tasks with the conflicting task, Persona, and corrective action;
|
|
20
22
|
- waiting through a delayed authoritative report after a prompt transport error while the Pi process is alive;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: analyst
|
|
3
|
-
description: Neutral read-only
|
|
3
|
+
description: Neutral read-only execution persona for agent-team, with roles defined by each task
|
|
4
4
|
access: read
|
|
5
5
|
tools: read, bash, grep, find, ls, codemode
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Serve as a neutral execution persona for agent-team. Follow the role charter and evaluation method supplied in the task prompt. Do not modify project files. Separate direct evidence, inference, and unknowns, and report concrete evidence with useful source references.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: explorer
|
|
3
|
-
description: Read-only explorer for
|
|
3
|
+
description: Read-only explorer for codebase structure, behavior, and dependencies
|
|
4
4
|
access: read
|
|
5
5
|
tools: read, bash, grep, find, ls, codemode
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
Investigate the assigned question without modifying files.
|
|
8
|
+
Investigate the assigned question without modifying files. Locate relevant files, trace behavior and dependencies, and report concrete evidence with useful paths. Distinguish confirmed behavior from unresolved questions.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: reviewer
|
|
3
|
-
description:
|
|
3
|
+
description: Independent read-only reviewer for proposals, designs, documents, implementations, and analysis
|
|
4
4
|
access: read
|
|
5
5
|
tools: read, bash, grep, find, ls, codemode
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
Independently review the assigned work against its goals and constraints. Examine assumptions, logic, evidence, trade-offs, and risks. Identify gaps and provide actionable recommendations with concrete evidence. Do not modify project files.
|
|
@@ -148,7 +148,7 @@ export function registerHerdrSubagents(pi: ExtensionAPI, dependencies: HerdrSuba
|
|
|
148
148
|
name: "herdr_subagents",
|
|
149
149
|
...(exposure ? { exposure } : {}),
|
|
150
150
|
label: "Herdr Subagents",
|
|
151
|
-
description: "Run ordered tasks in visible Herdr Pi panes, with an explicit agent for each task. concurrency 1 is serial; higher values require read-only Personas. Returns after all tasks complete, fail, or cancel; full results and sessions remain in project-local records.",
|
|
151
|
+
description: "Run ordered tasks in visible Herdr Pi panes, with an explicit agent for each task. Choose reviewer for independent reviews, explorer for codebase investigation, worker for file changes, or analyst for agent-team tasks with a supplied role charter; use control list to inspect effective and custom Personas. concurrency 1 is serial; higher values require read-only Personas. Returns after all tasks complete, fail, or cancel; full results and sessions remain in project-local records.",
|
|
152
152
|
promptSnippet: "Run focused work in visible Herdr subagents",
|
|
153
153
|
parameters: HerdrSubagentsParams,
|
|
154
154
|
prepareArguments: normalizeHerdrSubagentsArguments,
|
|
@@ -7,7 +7,7 @@ import { runHerdrSubagentsBatch } from "../src/batch-runner.ts";
|
|
|
7
7
|
import registerSubagentReport from "../extensions/subagent-report.ts";
|
|
8
8
|
import { normalizeHerdrSubagentsArguments, registerHerdrSubagents } from "../extensions/herdr-subagents.ts";
|
|
9
9
|
import { applyTaskStatus } from "../src/records.ts";
|
|
10
|
-
import { executeHerdrSubagents } from "../src/tool.ts";
|
|
10
|
+
import { executeHerdrSubagents, executeHerdrSubagentsControl } from "../src/tool.ts";
|
|
11
11
|
|
|
12
12
|
process.env.HERDR_ENV = "1";
|
|
13
13
|
process.env.HERDR_WORKSPACE_ID = "test-workspace";
|
|
@@ -101,6 +101,32 @@ async function run(tasks, concurrency, herdr = fakeHerdr(), signal) {
|
|
|
101
101
|
configurationPaths: { globalConfig: join(root, "global-config.json") },
|
|
102
102
|
herdr,
|
|
103
103
|
});
|
|
104
|
+
const listed = await executeHerdrSubagentsControl({ action: "list" }, undefined, undefined, { cwd: root }, {
|
|
105
|
+
agentsDirectory: fileURLToPath(new URL("../agents/", import.meta.url)),
|
|
106
|
+
configurationPaths: { globalConfig: join(root, "global-config.json") },
|
|
107
|
+
});
|
|
108
|
+
const personas = new Map(listed.details.agents.map((persona) => [persona.name, persona]));
|
|
109
|
+
const analyst = personas.get("analyst");
|
|
110
|
+
assert.match(analyst.description, /agent-team.*roles defined by each task/);
|
|
111
|
+
assert.match(analyst.systemPrompt, /role charter and evaluation method/);
|
|
112
|
+
const reviewer = personas.get("reviewer");
|
|
113
|
+
assert.match(reviewer.description, /proposals, designs, documents, implementations, and analysis/);
|
|
114
|
+
assert.match(reviewer.systemPrompt, /goals and constraints/);
|
|
115
|
+
assert.match(reviewer.systemPrompt, /assumptions, logic, evidence, trade-offs, and risks/);
|
|
116
|
+
const explorer = personas.get("explorer");
|
|
117
|
+
assert.match(explorer.description, /codebase structure, behavior, and dependencies/);
|
|
118
|
+
assert.match(explorer.systemPrompt, /Locate relevant files, trace behavior and dependencies/);
|
|
119
|
+
const readTools = ["read", "bash", "grep", "find", "ls", "codemode"];
|
|
120
|
+
for (const name of ["analyst", "reviewer", "explorer"]) {
|
|
121
|
+
const persona = personas.get(name);
|
|
122
|
+
assert.equal(persona.access, "read");
|
|
123
|
+
assert.deepEqual(persona.tools, readTools);
|
|
124
|
+
assert.ok(listed.content[0].text.includes(`${name}: ${persona.description}`), "The parent must see role selection guidance in Persona listings");
|
|
125
|
+
assert.ok(!listed.content[0].text.includes(persona.systemPrompt), "Persona listings must not embed the child instructions");
|
|
126
|
+
}
|
|
127
|
+
assert.equal(personas.get("worker").access, "write");
|
|
128
|
+
assert.equal(personas.get("worker").description, "General-purpose worker for one focused task");
|
|
129
|
+
assert.match(personas.get("worker").systemPrompt, /Do not delegate to another agent/);
|
|
104
130
|
const missing = { name: "review", prompt: "Read-only review" };
|
|
105
131
|
for (const params of [
|
|
106
132
|
{ tasks: [missing] },
|
|
@@ -125,6 +151,12 @@ async function run(tasks, concurrency, herdr = fakeHerdr(), signal) {
|
|
|
125
151
|
const parallel = await execute({ tasks: ["analyst", "reviewer", "explorer"].map((agent) => ({ ...missing, agent })), concurrency: 2 });
|
|
126
152
|
assert.equal(parallel.details.status, "completed");
|
|
127
153
|
assert.equal(parallel.details.effectiveConcurrency, 2);
|
|
154
|
+
for (const [index, name] of ["analyst", "reviewer", "explorer"].entries()) {
|
|
155
|
+
const directory = parallel.details.tasks[index].recordDirectory;
|
|
156
|
+
const instructions = readFileSync(join(directory, "system-prompt.md"), "utf8");
|
|
157
|
+
assert.ok(instructions.startsWith(personas.get(name).systemPrompt), "Each child must receive its selected Persona body");
|
|
158
|
+
assert.match(instructions, /call subagent_report exactly once/);
|
|
159
|
+
}
|
|
128
160
|
|
|
129
161
|
const projectAgents = join(root, ".pi", "herdr-subagents", "agents");
|
|
130
162
|
mkdirSync(projectAgents, { recursive: true });
|
|
@@ -231,6 +263,11 @@ assert.throws(() => applyTaskStatus(terminal, "running"), /terminal tasks are im
|
|
|
231
263
|
assert.deepEqual(herdrCalls, [], "Pi startup must not inspect or close historical Subagent tabs");
|
|
232
264
|
assert.deepEqual(JSON.parse(readFileSync(join(runDirectory, "run.json"), "utf8")), historicalRun, "Pi startup must not mutate historical Subagent records");
|
|
233
265
|
const taskSchema = registeredTools.get("herdr_subagents").parameters.properties.tasks.items;
|
|
266
|
+
const description = registeredTools.get("herdr_subagents").description;
|
|
267
|
+
assert.match(description, /reviewer for independent reviews/);
|
|
268
|
+
assert.match(description, /explorer for codebase investigation/);
|
|
269
|
+
assert.match(description, /worker for file changes/);
|
|
270
|
+
assert.match(description, /analyst for agent-team/);
|
|
234
271
|
assert.ok(taskSchema.required.includes("agent"), "The model-facing schema must require agent");
|
|
235
272
|
assert.equal(taskSchema.properties.agent.enum, undefined, "Custom Persona names must remain valid");
|
|
236
273
|
assert.equal(registeredTools.get("herdr_subagents")?.exposure, undefined, "Unconfigured Subagent execution must inherit Pi's exposure default");
|
|
@@ -598,7 +598,7 @@ try {
|
|
|
598
598
|
check("persona discovery and diagnostics", discovery.agents.length === 1 && discovery.agents[0].name === "worker" && discovery.diagnostics.length === 1);
|
|
599
599
|
const packageDiscovery = discoverPackageAgents(join(process.cwd(), "agents"));
|
|
600
600
|
const analystPersona = packageDiscovery.agents.find((persona) => persona.name === "analyst");
|
|
601
|
-
check("built-in analyst is neutral and read-only", packageDiscovery.diagnostics.length === 0 && analystPersona?.access === "read" && analystPersona.model === undefined && analystPersona.tools?.join(",") === "read,bash,grep,find,ls,codemode" && /
|
|
601
|
+
check("built-in analyst is neutral and read-only", packageDiscovery.diagnostics.length === 0 && analystPersona?.access === "read" && analystPersona.model === undefined && analystPersona.tools?.join(",") === "read,bash,grep,find,ls,codemode" && /neutral execution persona for agent-team/.test(analystPersona.systemPrompt) && /role charter and evaluation method/.test(analystPersona.systemPrompt) && /direct evidence, inference, and unknowns/.test(analystPersona.systemPrompt) && !/auditor|replicator|adversary/.test(analystPersona.systemPrompt));
|
|
602
602
|
|
|
603
603
|
const configRoot = join(root, "configuration");
|
|
604
604
|
const packageAgents = join(configRoot, "package-agents");
|
|
@@ -28,7 +28,7 @@ description: 多模型协作分析:主 Agent 按配置的模型和角色调度
|
|
|
28
28
|
|
|
29
29
|
读取本 skill 同目录的 [models.json](models.json):`members` 是成员与模型的唯一配置来源,`roles` 是角色职责的唯一配置来源。默认将两个数组按顺序一一对应;配置为空或数量不匹配时,报告配置问题后再启动。
|
|
30
30
|
|
|
31
|
-
按配置成员数并发启动子代理,显式传入各自的 `model`,并将对应角色的 `charter`
|
|
31
|
+
按配置成员数并发启动子代理,显式传入各自的 `model`,并将对应角色的 `charter` 放入任务。使用 Persona 派发时,成员统一选择 `agent: "analyst"`,作为中立执行载体;具体职责由本轮 `charter` 注入。成员使用相同的中性只读执行约束。启动后核对并在本轮记录中写下每个任务实际生效的模型;无法确认或与配置不符时,该成员结果无效并报告原因。
|
|
32
32
|
|
|
33
33
|
每轮在 `rounds/N.md` 写明成员、模型、角色、输入文件和分派问题。默认沿用角色映射;需要交叉复核时可轮换,并记录新的映射。
|
|
34
34
|
|