@deathbeam/pi-delegate 0.0.24 → 0.0.25
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/format.ts +4 -3
- package/index.ts +6 -9
- package/package.json +1 -1
package/format.ts
CHANGED
|
@@ -162,10 +162,11 @@ export function reviveHint(id: string): string {
|
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
export function reportText(report: DelegateReport): string {
|
|
165
|
-
|
|
166
|
-
|
|
165
|
+
// Context usage lets the parent judge whether to continue this job or start a fresh one.
|
|
166
|
+
const head = `Delegate "${report.agent}" (job ${report.id}, ${usageStats(report, report.elapsedMs)})`;
|
|
167
|
+
if (report.error) return `${head} failed: ${report.error}\n${reviveHint(report.id)}`;
|
|
167
168
|
const output = (report.output ?? "").trim();
|
|
168
|
-
return
|
|
169
|
+
return `${head} finished.${output ? `\n\n${output}` : ""}`;
|
|
169
170
|
}
|
|
170
171
|
|
|
171
172
|
export function jobLine(info: { description?: string } & UsageInfo, elapsedMs: number): string {
|
package/index.ts
CHANGED
|
@@ -444,7 +444,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
444
444
|
"",
|
|
445
445
|
"A delegate gets the project instructions but not this conversation: it cannot see the user's request, the files you read, or your decisions. Write `task` as a self-contained brief: the goal and why, what you already know (paths, symbols, errors), scope and constraints, whether to edit files or only report, and what to return (format, length, path:line evidence).",
|
|
446
446
|
"",
|
|
447
|
-
"
|
|
447
|
+
"To follow up on or redirect an existing job, see delegate_steer.",
|
|
448
448
|
].join("\n"),
|
|
449
449
|
promptSnippet:
|
|
450
450
|
"Delegate a focused task to a background agent with its own context; only its report comes back, as a later follow-up message",
|
|
@@ -518,20 +518,19 @@ export default function (pi: ExtensionAPI) {
|
|
|
518
518
|
name: "delegate_steer",
|
|
519
519
|
label: "Steer delegate",
|
|
520
520
|
description:
|
|
521
|
-
"Send
|
|
521
|
+
"Send a message to a delegate job. A running job reads it before its next model request. A finished job, whatever its status, continues its own transcript with the message as its next instruction and reports again. Continue a job for follow-up on the same work. For a new task, or a job past half its context window (shown in its report), start a fresh delegate with a condensed brief of what the old job found.",
|
|
522
522
|
promptSnippet: "Send guidance to a delegate by job id, or continue a finished one",
|
|
523
523
|
parameters: Type.Object({
|
|
524
524
|
id: Type.String({
|
|
525
525
|
description: 'Job id from a delegate tool result or a delegate-result message, such as "38631a01".',
|
|
526
526
|
}),
|
|
527
527
|
message: Type.String({
|
|
528
|
-
description:
|
|
529
|
-
"The guidance to deliver: queued on a running child, or the next instruction when it revives a finished job.",
|
|
528
|
+
description: "Guidance for a running job, or the next instruction for a finished one.",
|
|
530
529
|
}),
|
|
531
530
|
model: Type.Optional(
|
|
532
531
|
Type.String({
|
|
533
532
|
description:
|
|
534
|
-
"Model tier (cheap, balanced, strong) or an explicit provider/model, with an optional :<thinking> suffix.
|
|
533
|
+
"Model tier (cheap, balanced, strong) or an explicit provider/model, with an optional :<thinking> suffix. A running job switches live.",
|
|
535
534
|
}),
|
|
536
535
|
),
|
|
537
536
|
}),
|
|
@@ -625,8 +624,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
625
624
|
pi.registerTool({
|
|
626
625
|
name: "delegate_cancel",
|
|
627
626
|
label: "Cancel delegate",
|
|
628
|
-
description:
|
|
629
|
-
"Cancel a running background delegate by job id. Requests abort now and force-kills the child after five seconds if needed. A cancelled job sends no report; continue it later with delegate_steer.",
|
|
627
|
+
description: "Cancel a running delegate by job id. It sends no report; delegate_steer can continue it later.",
|
|
630
628
|
promptSnippet: "Cancel a running background delegate by job id",
|
|
631
629
|
parameters: Type.Object({
|
|
632
630
|
id: Type.String({ description: "Job id from delegate or delegate_list." }),
|
|
@@ -667,8 +665,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
667
665
|
pi.registerTool({
|
|
668
666
|
name: "delegate_list",
|
|
669
667
|
label: "List delegates",
|
|
670
|
-
description:
|
|
671
|
-
"List delegates with their job ids, status, and progress. Finished jobs stay listed; continue one with delegate_steer.",
|
|
668
|
+
description: "List delegate jobs with their ids, status, context usage, and elapsed time.",
|
|
672
669
|
promptSnippet: "List delegates and their job ids",
|
|
673
670
|
parameters: Type.Object({}),
|
|
674
671
|
async execute() {
|