pi-squad 0.6.0 → 0.6.2
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-squad",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.2",
|
|
4
4
|
"description": "Multi-agent collaboration extension for pi — task decomposition, dependency management, parallel execution, TUI panel",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"pi": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"src/index.ts"
|
|
9
9
|
],
|
|
10
10
|
"skills": [
|
|
11
|
-
"src/skills/supervisor"
|
|
11
|
+
"src/skills/squad-supervisor"
|
|
12
12
|
]
|
|
13
13
|
},
|
|
14
14
|
"files": [
|
package/src/index.ts
CHANGED
|
@@ -1176,6 +1176,16 @@ async function startSquad(
|
|
|
1176
1176
|
depends: t.depends || [],
|
|
1177
1177
|
})),
|
|
1178
1178
|
};
|
|
1179
|
+
|
|
1180
|
+
// Validate agent names — remap unknown agents to fullstack
|
|
1181
|
+
for (const task of plan.tasks) {
|
|
1182
|
+
const agentDef = store.loadAgentDef(task.agent, cwd);
|
|
1183
|
+
if (!agentDef) {
|
|
1184
|
+
const original = task.agent;
|
|
1185
|
+
task.agent = "fullstack";
|
|
1186
|
+
task.description = `[Note: agent "${original}" not found, remapped to fullstack]\n\n${task.description}`;
|
|
1187
|
+
}
|
|
1188
|
+
}
|
|
1179
1189
|
} else {
|
|
1180
1190
|
// Run planner to generate task breakdown
|
|
1181
1191
|
try {
|
package/src/planner.ts
CHANGED
|
@@ -65,7 +65,8 @@ export async function runPlanner(options: PlannerOptions): Promise<PlannerOutput
|
|
|
65
65
|
model: model || plannerDef?.model || undefined,
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
const agentNames = new Set(allAgents.map((a) => a.name));
|
|
69
|
+
return parsePlannerOutput(output, agentNames);
|
|
69
70
|
} finally {
|
|
70
71
|
try {
|
|
71
72
|
fs.unlinkSync(promptFile);
|
|
@@ -172,7 +173,7 @@ async function runPiJson(options: PiJsonOptions): Promise<string> {
|
|
|
172
173
|
// Output Parsing
|
|
173
174
|
// ============================================================================
|
|
174
175
|
|
|
175
|
-
function parsePlannerOutput(text: string): PlannerOutput {
|
|
176
|
+
function parsePlannerOutput(text: string, validAgents?: Set<string>): PlannerOutput {
|
|
176
177
|
// Try to extract JSON from the text (might be wrapped in markdown code blocks)
|
|
177
178
|
const jsonMatch = text.match(/```(?:json)?\s*\n?([\s\S]*?)\n?```/) || text.match(/(\{[\s\S]*\})/);
|
|
178
179
|
|
|
@@ -194,6 +195,13 @@ function parsePlannerOutput(text: string): PlannerOutput {
|
|
|
194
195
|
}
|
|
195
196
|
if (!task.depends) task.depends = [];
|
|
196
197
|
if (!task.description) task.description = "";
|
|
198
|
+
|
|
199
|
+
// Remap unknown agent names to fullstack (the generalist)
|
|
200
|
+
if (validAgents && !validAgents.has(task.agent)) {
|
|
201
|
+
const original = task.agent;
|
|
202
|
+
task.agent = "fullstack";
|
|
203
|
+
task.description = `[Note: planner assigned "${original}" which doesn't exist, remapped to fullstack]\n\n${task.description}`;
|
|
204
|
+
}
|
|
197
205
|
}
|
|
198
206
|
|
|
199
207
|
if (!parsed.agents) parsed.agents = {};
|
|
File without changes
|