pi-better-subagents 0.1.15 → 0.1.16
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/completion.mjs +3 -6
- package/finalization.ts +0 -2
- package/package.json +1 -1
package/completion.mjs
CHANGED
|
@@ -16,16 +16,15 @@
|
|
|
16
16
|
* - Announces the subagent finished
|
|
17
17
|
* - Tells the model to call/use subagent_result id="<id>"
|
|
18
18
|
* - Does NOT contain "--- result ---" or any result payload
|
|
19
|
-
* -
|
|
19
|
+
* - Includes label, verdict, stat, and lifecycle classification when available
|
|
20
|
+
* - Omits tool history; detailed execution evidence belongs in subagent_result
|
|
20
21
|
*
|
|
21
22
|
* @param p.id - The run id
|
|
22
23
|
* @param p.label - Human-readable label (e.g., "reviewer (abc123)")
|
|
23
24
|
* @param p.verdict - Status line (e.g., "✓ completed" or "✗ failed (exit 1)")
|
|
24
25
|
* @param p.stat - Statistics line (e.g., "45s · 1.2k tok · $0.0034")
|
|
25
|
-
* @param p.tools - Optional tools used (e.g., "read,bash,web_fetch")
|
|
26
26
|
*/
|
|
27
27
|
export function formatCallbackTrigger(p) {
|
|
28
|
-
const tools = p.tools ? ` ·${p.tools.replace(/\n/, " ")}` : "";
|
|
29
28
|
const lifecycle = p.lifecycleClassification ? ` · lifecycle ${p.lifecycleClassification}` : "";
|
|
30
29
|
const announcement = p.incomplete
|
|
31
30
|
? "ATTENTION: a background subagent exited unexpectedly before producing a coherent final result."
|
|
@@ -33,7 +32,7 @@ export function formatCallbackTrigger(p) {
|
|
|
33
32
|
const instruction = p.incomplete
|
|
34
33
|
? `Inspect the diagnostic with subagent_result id="${p.id}" before deciding how to continue.`
|
|
35
34
|
: `Ingest this signal and call subagent_result id="${p.id}" to retrieve the actual result, then use/present it as appropriate.`;
|
|
36
|
-
return `${announcement}\nsubagent: ${p.label} · ${p.verdict} · ${p.stat}${
|
|
35
|
+
return `${announcement}\nsubagent: ${p.label} · ${p.verdict} · ${p.stat}${lifecycle}\n\n${instruction}`;
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
/**
|
|
@@ -74,7 +73,6 @@ export function formatCallbackQuiet(p) {
|
|
|
74
73
|
* @param p.label - Human-readable label
|
|
75
74
|
* @param p.verdict - Status line (e.g. "✓ completed")
|
|
76
75
|
* @param p.stat - Statistics line (e.g. "45s · 1.2k tok")
|
|
77
|
-
* @param p.tools - Optional tools list
|
|
78
76
|
* @param p.callback - Whether to trigger a turn (true) or be quiet (false)
|
|
79
77
|
* @param p.resultText - The parsed final answer; MUST NOT appear in content
|
|
80
78
|
*/
|
|
@@ -86,7 +84,6 @@ export function buildCompletionDelivery(p) {
|
|
|
86
84
|
label: p.label,
|
|
87
85
|
verdict: p.verdict,
|
|
88
86
|
stat: p.stat,
|
|
89
|
-
tools: p.tools,
|
|
90
87
|
incomplete: p.incomplete,
|
|
91
88
|
lifecycleClassification: p.lifecycleClassification,
|
|
92
89
|
}),
|
package/finalization.ts
CHANGED
|
@@ -69,7 +69,6 @@ export function finalizeRun(
|
|
|
69
69
|
const el = fmtElapsed(meta.endedAt - meta.startedAt);
|
|
70
70
|
const spend = fmtSpend(r.usage);
|
|
71
71
|
const stat = `${el}${spend ? ` · ${spend}` : ""}`;
|
|
72
|
-
const tools = r.toolCalls.length ? r.toolCalls.join(", ") : undefined;
|
|
73
72
|
|
|
74
73
|
// A finished run is no longer in the widget; redraw (and stop the ticker if
|
|
75
74
|
// it was the last one).
|
|
@@ -94,7 +93,6 @@ export function finalizeRun(
|
|
|
94
93
|
label,
|
|
95
94
|
verdict,
|
|
96
95
|
stat,
|
|
97
|
-
tools,
|
|
98
96
|
callback,
|
|
99
97
|
incomplete: outcome.incomplete,
|
|
100
98
|
lifecycleClassification: outcome.classification,
|