@maheidem/pi-delegate 0.6.3 → 0.6.4

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 (3) hide show
  1. package/index.ts +14 -1
  2. package/package.json +1 -1
  3. package/ui/format.ts +2 -0
package/index.ts CHANGED
@@ -572,7 +572,20 @@ export default function delegateExtension(pi: ExtensionAPI) {
572
572
  },
573
573
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
574
574
  renderResult(result: any, options: any, theme: any) {
575
- const d = result.details as DelegateDetails | undefined;
575
+ const d = result.details as (DelegateDetails & { background?: boolean; description?: string }) | undefined;
576
+ // Background spawn: start details {runId, role, background, description}
577
+ // carry no state/duration/usage — the full-card path below would render
578
+ // ✗ unknown NaNs ↑0 ↓0. Neutral spawned card instead; runId guard keeps
579
+ // the slot/busy error details {background, busy} on the plain path.
580
+ if (d?.runId && d.background === true) {
581
+ return renderToolResultCard(theme, {
582
+ header: `→ ${String(d.runId).slice(-16)}`,
583
+ lead: d.role,
584
+ state: "spawned",
585
+ stateBits: d.description ? [d.description] : [],
586
+ detailLines: [{ text: " report arrives as a message · poll delegate_status" }],
587
+ });
588
+ }
576
589
  if (!d?.runId) {
577
590
  const text = (result.content ?? []).map((c: { text?: string }) => c.text ?? "").filter(Boolean).join("\n");
578
591
  return renderToolPlainCard(text);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@maheidem/pi-delegate",
3
- "version": "0.6.3",
3
+ "version": "0.6.4",
4
4
  "type": "module",
5
5
  "description": "Foreground isolated delegation and strict coordinator mode for the Pi coding agent.",
6
6
  "license": "MIT",
package/ui/format.ts CHANGED
@@ -103,6 +103,8 @@ export function stateGlyph(state: string): { glyph: string; word: string; color:
103
103
  return { glyph: "⏱", word: "timeout · hard", color: "warning" };
104
104
  case "queued":
105
105
  return { glyph: "○", word: "queued", color: "muted" };
106
+ case "spawned":
107
+ return { glyph: "↗", word: "spawned", color: "muted" };
106
108
  default:
107
109
  return { glyph: "✗", word: state || "unknown", color: "error" };
108
110
  }