@melihmucuk/pi-crew 1.0.10 → 1.0.11
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.
|
@@ -6,15 +6,23 @@ export function registerCrewListTool({ pi, crew, notifyDiscoveryWarnings, }) {
|
|
|
6
6
|
pi.registerTool({
|
|
7
7
|
name: "crew_list",
|
|
8
8
|
label: "List Crew",
|
|
9
|
-
description: "List available subagent definitions and currently running subagents with their status.",
|
|
9
|
+
description: "List available subagent definitions and currently running subagents with their status. Use only to discover which subagents exist or to get a one-time status snapshot. Do NOT call this repeatedly to check if a subagent has finished — results are delivered automatically as steering messages.",
|
|
10
10
|
parameters: Type.Object({}),
|
|
11
11
|
promptSnippet: "List subagent definitions and active subagents",
|
|
12
|
+
promptGuidelines: [
|
|
13
|
+
"Use crew_list first to see available subagents before spawning.",
|
|
14
|
+
"crew_list: Call this only to discover available subagents before spawning, or when the user explicitly asks for a status report. Do not call it to check if a subagent finished — results arrive as steering messages automatically.",
|
|
15
|
+
],
|
|
12
16
|
async execute(_toolCallId, _params, _signal, _onUpdate, ctx) {
|
|
13
17
|
const { agents, warnings } = discoverAgents(ctx.cwd);
|
|
14
18
|
notifyDiscoveryWarnings(ctx, warnings);
|
|
15
19
|
const callerSessionId = ctx.sessionManager.getSessionId();
|
|
16
20
|
const running = crew.getActiveSummariesForOwner(callerSessionId);
|
|
17
21
|
const lines = [];
|
|
22
|
+
if (running.length > 0) {
|
|
23
|
+
lines.push("⚠ Active subagents detected. Do not poll crew_list for completion — results arrive as steering messages. Continue with unrelated work or end your turn and wait for the steering messages.");
|
|
24
|
+
lines.push("");
|
|
25
|
+
}
|
|
18
26
|
lines.push("## Available Subagents");
|
|
19
27
|
if (agents.length === 0) {
|
|
20
28
|
lines.push("No valid subagent definitions found. Add `.md` files to `<cwd>/.pi/agents/` or `~/.pi/agent/agents/`.");
|
|
@@ -13,7 +13,7 @@ export function registerCrewRespondTool({ pi, crew }) {
|
|
|
13
13
|
}),
|
|
14
14
|
promptSnippet: "Send a follow-up message to a waiting interactive subagent.",
|
|
15
15
|
promptGuidelines: [
|
|
16
|
-
"crew_respond: Response is delivered asynchronously as a steering message. Do not poll crew_list.",
|
|
16
|
+
"crew_respond: Response is delivered asynchronously as a steering message. Do not poll crew_list. Continue with unrelated work or end your turn and wait for the steering message.",
|
|
17
17
|
],
|
|
18
18
|
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
19
19
|
const callerSessionId = ctx.sessionManager.getSessionId();
|
|
@@ -12,13 +12,12 @@ export function registerCrewSpawnTool({ pi, crew, extensionDir, notifyDiscoveryW
|
|
|
12
12
|
}),
|
|
13
13
|
promptSnippet: "Spawn a non-blocking subagent. Use crew_list first to see available subagents.",
|
|
14
14
|
promptGuidelines: [
|
|
15
|
-
"Use crew_list first to see available subagents before spawning.",
|
|
16
15
|
"crew_spawn: The subagent runs in isolation with no access to your session. Include file paths, requirements, and known locations directly in the task parameter.",
|
|
17
16
|
"crew_spawn: DELEGATE means OWNERSHIP TRANSFER. Once you spawn a subagent for a task, that task is exclusively theirs. If you also work on it, you waste the subagent's effort and create conflicting results. After spawning, work on an UNRELATED task or end your turn.",
|
|
18
17
|
"crew_spawn: To avoid duplication, gather only enough context to write a useful task (key files, entry points). Do not pre-investigate the full problem.",
|
|
19
18
|
"crew_spawn: Results arrive asynchronously as steering messages. Do not predict or fabricate results. Wait for all crew-result messages before acting on them.",
|
|
20
|
-
"crew_spawn: Never use crew_list as a completion polling loop.
|
|
21
|
-
"crew_spawn: Interactive subagents stay alive after responding. Use crew_respond to continue
|
|
19
|
+
"crew_spawn: Never use crew_list as a completion polling loop. Results arrive as steering messages. Continue with unrelated work or end your turn and wait for the steering messages.",
|
|
20
|
+
"crew_spawn: Interactive subagents stay alive after responding. Use crew_respond to continue or crew_done to close when finished.",
|
|
22
21
|
],
|
|
23
22
|
async execute(_toolCallId, params, _signal, _onUpdate, ctx) {
|
|
24
23
|
const { agents, warnings } = discoverAgents(ctx.cwd);
|