@arhen/pi-core-subagent 1.2.0 → 1.2.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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/index.ts +15 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arhen/pi-core-subagent",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "type": "module",
5
5
  "description": "pi extension: fast in-process subagents with a dependency-graph scheduler (needs edges gate tasks and carry upstream output into dependent prompts), plus background runs, intercom and agent-to-agent mailbox. Leader defines agents inline.",
6
6
  "license": "MIT",
package/src/index.ts CHANGED
@@ -1402,7 +1402,21 @@ export default function (pi: ExtensionAPI) {
1402
1402
  if (args.concurrency) parts.push(`${args.concurrency} at a time`);
1403
1403
  if (args.maxRuntimeMs) parts.push(`${Math.round(args.maxRuntimeMs / 60000)}m limit`);
1404
1404
  const params = parts.length > 0 ? `\n ${theme.fg("dim", parts.join(" · "))}` : "";
1405
- return new Text(`${theme.fg("toolTitle", theme.bold("subagent"))} ${theme.fg("accent", mode)}${flags ? ` ${theme.fg("muted", `[${flags}]`)}` : ""}${params}`, 0, 0);
1405
+ // The plan the model actually wrote: ids, edges, toolset. Streams in as args arrive,
1406
+ // so a graph is visible before the first child spawns.
1407
+ const plan = tasks
1408
+ .filter((t: any) => t.agent || t.id)
1409
+ .map((t: any, i: number) => {
1410
+ const id = t.id ?? `task_${i + 1}`;
1411
+ const edge = t.needs?.length ? theme.fg("muted", ` ← ${t.needs.join(", ")}`) : "";
1412
+ const mark = t.write ? theme.fg("warning", " ✎") : "";
1413
+ // Plain clip, not truncateText — that one appends a multi-line session-file notice.
1414
+ const flat = String(t.task ?? "").replace(/\s+/g, " ").trim();
1415
+ const what = flat ? theme.fg("dim", ` ${flat.length > 64 ? `${flat.slice(0, 64)}…` : flat}`) : "";
1416
+ return `\n ${theme.fg("muted", id)} ${theme.fg("accent", t.agent ?? "…")}${mark}${edge}${what}`;
1417
+ })
1418
+ .join("");
1419
+ return new Text(`${theme.fg("toolTitle", theme.bold("subagent"))} ${theme.fg("accent", mode)}${flags ? ` ${theme.fg("muted", `[${flags}]`)}` : ""}${params}${plan}`, 0, 0);
1406
1420
  },
1407
1421
  renderResult(result, { expanded }, theme) {
1408
1422
  const run = result.details?.run;