@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.
Files changed (3) hide show
  1. package/format.ts +4 -3
  2. package/index.ts +6 -9
  3. 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
- if (report.error)
166
- return `Delegate "${report.agent}" (job ${report.id}) failed: ${report.error}\n${reviveHint(report.id)}`;
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 `Delegate "${report.agent}" (job ${report.id}) finished.${output ? `\n\n${output}` : ""}`;
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
- "Use delegate_steer to continue or redirect any job by its id: a running job takes the guidance mid-run, and a finished job continues its own transcript with the message as its next instruction.",
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 guidance to a delegate by job id. A running job receives it after its current tool calls, before its next model request. A finished job (done, failed, cancelled, or interrupted) continues its own transcript with the message as its next instruction and reports again as a follow-up.",
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. Switches a running job's model live, without a restart.",
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() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deathbeam/pi-delegate",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "description": "Minimal extension for delegating tasks to subagents.",
5
5
  "type": "module",
6
6
  "license": "MIT",