@d3ara1n/pi-subagent 0.7.0 → 0.8.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/package.json +1 -1
- package/src/index.ts +24 -13
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@d3ara1n/pi-subagent",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.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",
|
package/src/index.ts
CHANGED
|
@@ -342,6 +342,7 @@ export default function subagentExtension(pi: ExtensionAPI) {
|
|
|
342
342
|
"For multiple independent substantial tasks, emit multiple delegate calls in one turn — they run in parallel.",
|
|
343
343
|
"Include ALL necessary context — subagents have no access to this conversation.",
|
|
344
344
|
'Pass reference files via the `files` parameter (e.g. files: ["src/auth.ts"]) instead of pasting their contents into `context` — the subagent reads them directly without consuming your context window.',
|
|
345
|
+
'Override the model per-call with the `model` parameter for one-off vision or model-specific jobs.',
|
|
345
346
|
);
|
|
346
347
|
}
|
|
347
348
|
|
|
@@ -428,6 +429,12 @@ export default function subagentExtension(pi: ExtensionAPI) {
|
|
|
428
429
|
}),
|
|
429
430
|
),
|
|
430
431
|
cwd: Type.Optional(Type.String({ description: "Working directory (defaults to current)" })),
|
|
432
|
+
model: Type.Optional(
|
|
433
|
+
Type.String({
|
|
434
|
+
description:
|
|
435
|
+
"Override the model for this call. Format: 'provider/model-id' (e.g. 'anthropic/claude-sonnet-4'). When set, bypasses the role's configured model — useful for one-off vision tasks or model-specific jobs without creating a permanent role.",
|
|
436
|
+
}),
|
|
437
|
+
),
|
|
431
438
|
}),
|
|
432
439
|
|
|
433
440
|
async execute(_toolCallId, params, signal, onUpdate, ctx) {
|
|
@@ -540,20 +547,24 @@ export default function subagentExtension(pi: ExtensionAPI) {
|
|
|
540
547
|
};
|
|
541
548
|
}
|
|
542
549
|
|
|
543
|
-
|
|
544
|
-
if (
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
550
|
+
let modelRef: string;
|
|
551
|
+
if (params.model) {
|
|
552
|
+
modelRef = params.model;
|
|
553
|
+
} else {
|
|
554
|
+
const resolved = await rolesApi.resolveRoleAsync(roleDef.role);
|
|
555
|
+
if (!resolved.model) {
|
|
556
|
+
return {
|
|
557
|
+
content: [
|
|
558
|
+
{
|
|
559
|
+
type: "text",
|
|
560
|
+
text: `Role "${roleDef.role}" could not be resolved. Model not available.`,
|
|
561
|
+
},
|
|
562
|
+
],
|
|
563
|
+
details: undefined as any,
|
|
564
|
+
};
|
|
565
|
+
}
|
|
566
|
+
modelRef = `${resolved.model.provider}/${resolved.model.id}`;
|
|
554
567
|
}
|
|
555
|
-
|
|
556
|
-
const modelRef = `${resolved.model.provider}/${resolved.model.id}`;
|
|
557
568
|
const startTime = Date.now();
|
|
558
569
|
|
|
559
570
|
// Throttled progress: coalesces bursty thinking/tool events so the TUI
|