@maxiaochao/pi-toolkit 0.12.2 → 0.13.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (28) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +5 -4
  3. package/package.json +7 -5
  4. package/packages/background-tasks/CHANGELOG.md +9 -0
  5. package/packages/background-tasks/README.md +114 -0
  6. package/packages/background-tasks/TESTING.md +56 -0
  7. package/packages/background-tasks/docs/demo.gif +0 -0
  8. package/packages/background-tasks/docs/screenshot.png +0 -0
  9. package/packages/background-tasks/extensions/background-tasks.ts +200 -0
  10. package/packages/background-tasks/package.json +43 -0
  11. package/packages/background-tasks/src/background-tasks.ts +240 -0
  12. package/packages/background-tasks/src/output.ts +128 -0
  13. package/packages/background-tasks/src/widget.ts +54 -0
  14. package/packages/background-tasks/tests/extension.mjs +192 -0
  15. package/packages/background-tasks/tests/fixtures/provider.ts +63 -0
  16. package/packages/background-tasks/tests/helpers.mjs +55 -0
  17. package/packages/background-tasks/tests/load.mjs +28 -0
  18. package/packages/background-tasks/tests/output.mjs +55 -0
  19. package/packages/background-tasks/tests/processes.mjs +96 -0
  20. package/packages/background-tasks/tests/runtime.mjs +30 -0
  21. package/packages/background-tasks/tests/tasks.mjs +201 -0
  22. package/packages/background-tasks/tests/tui-smoke.py +195 -0
  23. package/packages/herdr-subagents/CHANGELOG.md +5 -0
  24. package/packages/herdr-subagents/README.md +1 -1
  25. package/packages/herdr-subagents/TESTING.md +1 -0
  26. package/packages/herdr-subagents/package.json +1 -1
  27. package/packages/herdr-subagents/src/protocol.ts +1 -1
  28. package/packages/herdr-subagents/tests/core-state-machine.mjs +2 -1
@@ -1,3 +1,8 @@
1
+ ## 2026-10-21 - v0.7.2
2
+
3
+ - clarify final answer submission through subagent_report
4
+ - Clarify child report instructions: submit the final result through `subagent_report` when work finishes or cannot be completed, rather than tying submission to process exit or ending with a normal text reply.
5
+
1
6
  ## 2026-10-20 - v0.7.1
2
7
 
3
8
  - clarify Persona responsibilities and dispatch guidance
@@ -52,7 +52,7 @@ Cleanup belongs to the Pi session that created the run. Starting a new Pi sessio
52
52
 
53
53
  ## Result protocol
54
54
 
55
- The child must call `subagent_report` once with a terminal status:
55
+ When the task finishes or cannot be completed, the child must call `subagent_report` once instead of ending with a normal text reply. The terminal status is:
56
56
 
57
57
  - `completed`: the requested work finished.
58
58
  - `failed`: it cannot be completed; include `error`.
@@ -17,6 +17,7 @@ It verifies:
17
17
  - required explicit Personas in the tool schema and execution, including legacy single-task argument normalization;
18
18
  - model-facing role selection guidance for broad independent review, codebase investigation, file-changing work, and charter-driven agent-team execution;
19
19
  - effective Persona descriptions in parent listings, corresponding bodies in child system prompts, and unchanged read/write tool boundaries;
20
+ - child system prompts require a terminal `subagent_report` when work finishes or cannot be completed, not a normal text reply or a process-exit condition;
20
21
  - rejection of missing, blank, invalid, and unknown Personas before creating runs, while custom Personas remain supported;
21
22
  - explicit rejection of parallel write-capable tasks with the conflicting task, Persona, and corrective action;
22
23
  - waiting through a delayed authoritative report after a prompt transport error while the Pi process is alive;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maxiaochao/pi-herdr-subagents",
3
- "version": "0.7.1",
3
+ "version": "0.7.2",
4
4
  "description": "Run inspectable interactive Pi subagent batches through Herdr.",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -11,7 +11,7 @@ export function reportProtocolPrompt(systemPrompt: string, kind: ReportPromptKin
11
11
  TURN_INTRO[kind],
12
12
  systemPrompt.trim(),
13
13
  "",
14
- "Before this process exits, call subagent_report exactly once with a terminal result.",
14
+ "Submit your final answer by calling the subagent_report tool.",
15
15
  "Put the complete final answer in result, a concise parent-facing paragraph in summary, and list any useful document paths.",
16
16
  "Use status=completed when the task is finished, or status=failed with error when it cannot be completed.",
17
17
  "Do not pause for parent input; make a reasonable assumption or report failed with the missing requirement.",
@@ -155,7 +155,8 @@ async function run(tasks, concurrency, herdr = fakeHerdr(), signal) {
155
155
  const directory = parallel.details.tasks[index].recordDirectory;
156
156
  const instructions = readFileSync(join(directory, "system-prompt.md"), "utf8");
157
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/);
158
+ assert.ok(instructions.includes("Submit your final answer by calling the subagent_report tool."));
159
+ assert.doesNotMatch(instructions, /process exits/);
159
160
  }
160
161
 
161
162
  const projectAgents = join(root, ".pi", "herdr-subagents", "agents");