@leing2021/super-pi 0.18.1 → 0.18.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/extensions/ce-core/index.ts +18 -3
- package/package.json +1 -1
|
@@ -124,7 +124,10 @@ const parallelSubagentTaskSchema = Type.Object({
|
|
|
124
124
|
})
|
|
125
125
|
|
|
126
126
|
const parallelSubagentParams = Type.Object({
|
|
127
|
-
tasks: Type.
|
|
127
|
+
tasks: Type.Union([
|
|
128
|
+
Type.Array(parallelSubagentTaskSchema),
|
|
129
|
+
Type.String({ description: "JSON stringified array of tasks" }),
|
|
130
|
+
], { description: "Array of independent tasks to run concurrently (can be a JSON string)" }),
|
|
128
131
|
inheritSkills: Type.Optional(Type.Boolean({ description: "Whether subagents should inherit skills. Default: false" })),
|
|
129
132
|
})
|
|
130
133
|
|
|
@@ -396,12 +399,24 @@ export default function ceCoreExtension(pi: ExtensionAPI) {
|
|
|
396
399
|
pi.registerTool({
|
|
397
400
|
name: parallelSubagent.name,
|
|
398
401
|
label: "Parallel Subagent",
|
|
399
|
-
description: "Run multiple skill-based subagent tasks concurrently.",
|
|
402
|
+
description: "Run multiple skill-based subagent tasks concurrently. IMPORTANT: Provide 'tasks' as a clean JSON array object. If the environment forces a string, provide a valid JSON array string.",
|
|
400
403
|
parameters: parallelSubagentParams,
|
|
401
404
|
async execute(_toolCallId, params, signal) {
|
|
405
|
+
let tasks: any[]
|
|
406
|
+
if (typeof params.tasks === "string") {
|
|
407
|
+
try {
|
|
408
|
+
const cleaned = params.tasks.replace(/^```json\s*|```$/g, "").trim()
|
|
409
|
+
tasks = JSON.parse(cleaned)
|
|
410
|
+
} catch (e) {
|
|
411
|
+
throw new Error(`Failed to parse tasks string as JSON: ${e instanceof Error ? e.message : String(e)}`)
|
|
412
|
+
}
|
|
413
|
+
} else {
|
|
414
|
+
tasks = params.tasks
|
|
415
|
+
}
|
|
416
|
+
|
|
402
417
|
const result = await parallelSubagent.execute(
|
|
403
418
|
{
|
|
404
|
-
tasks
|
|
419
|
+
tasks,
|
|
405
420
|
inheritSkills: params.inheritSkills,
|
|
406
421
|
},
|
|
407
422
|
createSubagentRunner(pi, signal),
|