@d3ara1n/pi-subagent 0.9.0 → 0.10.0

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/README.md CHANGED
@@ -54,7 +54,19 @@ This means:
54
54
  ## Installation
55
55
 
56
56
  ```bash
57
- pi install @d3ara1n/pi-subagent
57
+ pi install npm:@d3ara1n/pi-model-roles
58
+ pi install npm:@d3ara1n/pi-subagent
59
+ ```
60
+
61
+ Or add to `~/.pi/agent/settings.json`:
62
+
63
+ ```jsonc
64
+ {
65
+ "extensions": [
66
+ "/absolute/path/to/pi-extensions/packages/pi-model-roles",
67
+ "/absolute/path/to/pi-extensions/packages/pi-subagent"
68
+ ]
69
+ }
58
70
  ```
59
71
 
60
72
  ## Configuration
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@d3ara1n/pi-subagent",
3
- "version": "0.9.0",
3
+ "version": "0.10.0",
4
4
  "type": "module",
5
5
  "description": "Role-based subagent orchestration for pi — delegates tasks to specialized pi child processes with configurable model roles",
6
6
  "main": "src/index.ts",
7
7
  "keywords": [
8
8
  "pi-package",
9
- "pi"
9
+ "pi",
10
+ "pi-extension"
10
11
  ],
11
12
  "peerDependencies": {
12
13
  "@earendil-works/pi-ai": "*",
@@ -26,7 +27,7 @@
26
27
  }
27
28
  },
28
29
  "dependencies": {
29
- "@d3ara1n/pi-model-roles": "^0.1.0"
30
+ "@d3ara1n/pi-model-roles": "^0.6.0"
30
31
  },
31
32
  "pi": {
32
33
  "extensions": [
package/src/index.ts CHANGED
@@ -124,7 +124,7 @@ async function compressOutput(
124
124
  input.slice(-half);
125
125
  }
126
126
 
127
- const result = await rolesApi.complete(
127
+ const result = await rolesApi.completeWithRole(
128
128
  summaryConfig.role,
129
129
  {
130
130
  systemPrompt:
@@ -186,7 +186,7 @@ async function generateSummary(
186
186
  summaryInput.slice(-half);
187
187
  }
188
188
 
189
- const result = await rolesApi.complete(
189
+ const result = await rolesApi.completeWithRole(
190
190
  summaryConfig.role,
191
191
  {
192
192
  systemPrompt:
package/src/spawn.ts CHANGED
@@ -183,7 +183,7 @@ export async function spawnSubagent(
183
183
  }
184
184
 
185
185
  // Temp dir for: large-context/task spill files, and as PI_SUBAGENT_TMPDIR
186
- // for subagent bash work (e.g. git clone). The system prompt no longer uses it.
186
+ // for subagent bash work (e.g. git clone).
187
187
  tmpDir = await fs.promises.mkdtemp(path.join(os.tmpdir(), "pi-subagent-"));
188
188
 
189
189
  // ── System prompt channel: inline text via --append-system-prompt ──
@@ -269,7 +269,7 @@ export async function spawnSubagent(
269
269
  };
270
270
 
271
271
  let thinkingCounter = 0;
272
- // O(1) lookup from toolCallId → activityLog index (was linear find → O(n²) on busy runs)
272
+ // O(1) lookup from toolCallId → activityLog index.
273
273
  const toolCallIndex = new Map<string, number>();
274
274
 
275
275
  // Kill the child when the configured turn/cost budget is exceeded.
package/src/utils.ts CHANGED
@@ -1,9 +1,6 @@
1
1
  /**
2
- * Pure helpers for pi-subagent: formatting, sanitization, formatting helpers,
3
- * and the concurrency semaphore. No pi-API or I/O dependencies — safe to unit-test.
4
- *
5
- * Extracted from index.ts so these can be exercised directly. index.ts imports
6
- * them; behavior is unchanged.
2
+ * Pure helpers for pi-subagent: formatting, sanitization, and the concurrency
3
+ * semaphore. No pi-API or I/O dependencies — safe to unit-test.
7
4
  */
8
5
 
9
6
  import * as os from "node:os";