@pi-unipi/subagents 0.1.7 → 0.1.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pi-unipi/subagents",
3
- "version": "0.1.7",
3
+ "version": "0.1.9",
4
4
  "description": "Subagents for UniPi — parallel execution, file locking, workflow integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
package/src/index.ts CHANGED
@@ -1,13 +1,15 @@
1
1
  /**
2
2
  * @pi-unipi/subagents — Extension entry
3
3
  *
4
- * Tools: Agent, get_result
4
+ * Tools: spawn_helper, get_helper_result
5
5
  * ESC propagation: all children abort on parent ESC
6
6
  */
7
7
 
8
8
  import { defineTool, type ExtensionAPI, type ExtensionContext } from "@mariozechner/pi-coding-agent";
9
9
  import { Text } from "@mariozechner/pi-tui";
10
10
  import { Type } from "@sinclair/typebox";
11
+ import { emitEvent, MODULES } from "@pi-unipi/core";
12
+ import { UNIPI_EVENTS } from "@pi-unipi/core";
11
13
 
12
14
  // Get info registry from global
13
15
  function getInfoRegistry() {
@@ -172,6 +174,14 @@ export default function (pi: ExtensionAPI) {
172
174
  `• Workspace agents: ${workspaceAgents}`,
173
175
  "info",
174
176
  );
177
+
178
+ // Emit module ready event
179
+ emitEvent(pi, UNIPI_EVENTS.MODULE_READY, {
180
+ name: MODULES.SUBAGENTS || "subagents",
181
+ version: "0.1.8",
182
+ commands: [],
183
+ tools: ["spawn_helper", "get_helper_result"],
184
+ });
175
185
  });
176
186
 
177
187
  // ESC propagation: abort all agents on session shutdown
@@ -236,8 +246,8 @@ export default function (pi: ExtensionAPI) {
236
246
 
237
247
  pi.registerTool(
238
248
  defineTool({
239
- name: "Agent",
240
- label: "Agent",
249
+ name: "spawn_helper",
250
+ label: "Spawn Helper",
241
251
  description: `Launch a sub-agent for parallel work.
242
252
 
243
253
  Available agent types: ${builtinTypes}
@@ -263,7 +273,7 @@ Guidelines:
263
273
  }),
264
274
  run_in_background: Type.Optional(
265
275
  Type.Boolean({
266
- description: "Run in background. Returns agent ID immediately.",
276
+ description: "Run in background. Returns helper ID immediately.",
267
277
  }),
268
278
  ),
269
279
  max_turns: Type.Optional(
@@ -392,16 +402,16 @@ Guidelines:
392
402
  }),
393
403
  );
394
404
 
395
- // ---- get_result tool ----
405
+ // ---- get_helper_result tool ----
396
406
 
397
407
  pi.registerTool(
398
408
  defineTool({
399
- name: "get_result",
400
- label: "Get Agent Result",
409
+ name: "get_helper_result",
410
+ label: "Get Helper Result",
401
411
  description: "Check status and retrieve results from a background agent.",
402
412
  parameters: Type.Object({
403
413
  agent_id: Type.String({
404
- description: "The agent ID to check.",
414
+ description: "The helper ID to check.",
405
415
  }),
406
416
  wait: Type.Optional(
407
417
  Type.Boolean({
@@ -412,7 +422,7 @@ Guidelines:
412
422
  execute: async (_toolCallId, params) => {
413
423
  const record = manager.getRecord(params.agent_id as string);
414
424
  if (!record) {
415
- return textResult(`Agent not found: "${params.agent_id}". It may have been cleaned up.`);
425
+ return textResult(`Helper not found: "${params.agent_id}". It may have been cleaned up.`);
416
426
  }
417
427
 
418
428
  if (params.wait && record.status === "running" && record.promise) {
@@ -3,7 +3,7 @@ name: explore
3
3
  description: "Fast parallel codebase exploration"
4
4
  ---
5
5
 
6
- # Explore Agent
6
+ # Explore Helper
7
7
 
8
8
  Read-only agent for fast parallel codebase exploration.
9
9
 
@@ -24,7 +24,7 @@ Read-only agent for fast parallel codebase exploration.
24
24
  Spawn multiple explore agents to read different parts of the codebase in parallel.
25
25
 
26
26
  ```
27
- Agent({
27
+ spawn_helper({
28
28
  type: "explore",
29
29
  prompt: "Find all files related to authentication",
30
30
  description: "Find auth files"
@@ -3,7 +3,7 @@ name: work
3
3
  description: "Parallel file writes with transparent locking"
4
4
  ---
5
5
 
6
- # Work Agent
6
+ # Work Helper
7
7
 
8
8
  Read-write agent for parallel file modifications.
9
9
 
@@ -32,7 +32,7 @@ When writing a file, the lock is acquired automatically. If another agent holds
32
32
  Spawn work agents to modify different files in parallel.
33
33
 
34
34
  ```
35
- Agent({
35
+ spawn_helper({
36
36
  type: "work",
37
37
  prompt: "Refactor src/auth.ts to use async/await",
38
38
  description: "Refactor auth module"