@leo-alvarenga/pi-mini-subagents 0.2.3 → 0.2.6

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 +7 -7
  2. package/src/index.ts +6 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leo-alvarenga/pi-mini-subagents",
3
- "version": "0.2.3",
3
+ "version": "0.2.6",
4
4
  "description": "Transient subagents for Pi: mini_subagent tool (single + parallel), /subagents command, and a live TUI panel",
5
5
  "license": "MIT",
6
6
  "repository": "github.com/leo-alvarenga/pi-mono",
@@ -15,10 +15,10 @@
15
15
  ],
16
16
  "files": [
17
17
  "src",
18
+ "!src/test",
18
19
  "skills",
19
20
  "README.md",
20
- "LICENSE",
21
- "!src/*.test.ts"
21
+ "LICENSE"
22
22
  ],
23
23
  "peerDependencies": {
24
24
  "@earendil-works/pi-ai": "*",
@@ -27,7 +27,7 @@
27
27
  "typebox": "*"
28
28
  },
29
29
  "dependencies": {
30
- "@leo-alvarenga/pi-ext-core": "^0.3.2"
30
+ "@leo-alvarenga/pi-ext-core": "^0.4.0"
31
31
  },
32
32
  "pi": {
33
33
  "extensions": [
@@ -39,12 +39,12 @@
39
39
  },
40
40
  "devDependencies": {
41
41
  "@types/node": "^22.0.0",
42
- "tsx": "^4.19.0",
43
- "typescript": "^7.0.2"
42
+ "typescript": "^7.0.2",
43
+ "vitest": "^3.2.4"
44
44
  },
45
45
  "scripts": {
46
46
  "build": "tsc --noEmit",
47
47
  "typecheck": "tsc --noEmit",
48
- "test": "tsx src/spec.test.ts"
48
+ "test": "vitest run"
49
49
  }
50
50
  }
package/src/index.ts CHANGED
@@ -25,20 +25,24 @@ import {
25
25
 
26
26
  function getStyledSubagent(r: SubagentRecord, th: Theme): string {
27
27
  const task = r.task.replace(/\s*[\r\n]+\s*/g, " ");
28
+
28
29
  const style = STATUS_STYLES[r.status] ?? STATUS_STYLES.completed;
29
30
  let line = `${th.fg(style.fg, style.icon)} ${th.fg("accent", `#${r.id}`)} ${th.fg(style.fg, task)}`;
31
+
30
32
  if (r.status === "completed" && r.tokens) {
31
33
  line += th.fg("dim", ` · ${formatTokens(r.tokens)}`);
32
34
  }
35
+
33
36
  if (r.status === "failed") line += th.fg("dim", " · failed");
34
37
  if (r.status === "needs_input") line += th.fg("dim", " · needs input");
35
38
  if (r.allowWrite) line += th.fg("warning", " ✎");
39
+
36
40
  return line;
37
41
  }
38
42
 
39
43
  export default function (pi: ExtensionAPI): void {
40
44
  // Child subagent processes inherit PI_SUBAGENT=1; they must not be able to
41
- // spawn sub-subagents, so the tool/widget/command never register there.
45
+ // spawn sub-subagents, so the tool/widget/command never register there
42
46
  if (process.env.PI_SUBAGENT) return;
43
47
 
44
48
  createSubagentRuntime(pi, {
@@ -83,9 +87,9 @@ export default function (pi: ExtensionAPI): void {
83
87
  report: { entryType: REPORT_ENTRY },
84
88
 
85
89
  panel: {
90
+ title: " Subagents",
86
91
  widgetKey: WIDGET_KEY,
87
92
  toggleChord: PANEL_TOGGLE_CHORD,
88
- title: "Subagents",
89
93
  emptyText: "No subagents yet. Ask the agent to delegate a task!",
90
94
  },
91
95