@yusukeshib/pi-babysit 0.6.3 → 0.6.4
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/README.md +3 -1
- package/index.ts +40 -27
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -81,7 +81,9 @@ backgrounding (`… &`, `nohup`, `setsid`, `disown`). Set
|
|
|
81
81
|
A widget below the editor separates session **kind** from task **state** at a glance:
|
|
82
82
|
summary counts use `RUNNING` / `IDLE`, and every row is labeled
|
|
83
83
|
`PROCESS RUNNING`, `AGENT RUNNING`, or `AGENT IDLE`. The displayed `age`
|
|
84
|
-
is total session age, not time spent in the current state.
|
|
84
|
+
is total session age, not time spent in the current state. Transcript details
|
|
85
|
+
from tool results, snapshots, and completion notifications collapse or expand
|
|
86
|
+
with Pi's tool-output toggle (`Ctrl+O` by default).
|
|
85
87
|
|
|
86
88
|
## Logs without context flooding
|
|
87
89
|
|
package/index.ts
CHANGED
|
@@ -3294,7 +3294,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
3294
3294
|
|
|
3295
3295
|
// Render snapshots and subagent answers INLINE in the transcript as formatted
|
|
3296
3296
|
// markdown, with a semantic status label that remains readable on any theme.
|
|
3297
|
-
pi.registerMessageRenderer("pi-babysit-result", (message,
|
|
3297
|
+
pi.registerMessageRenderer("pi-babysit-result", (message, { expanded }, theme) => {
|
|
3298
3298
|
const d = (message.details ?? {}) as {
|
|
3299
3299
|
title?: string;
|
|
3300
3300
|
body?: string;
|
|
@@ -3305,35 +3305,44 @@ export default function (pi: ExtensionAPI) {
|
|
|
3305
3305
|
const box = new Box(1, 0, (t) => theme.bg("toolSuccessBg", t));
|
|
3306
3306
|
if (d.status) box.addChild(new Text(renderStatus(d.status, theme), 0, 0));
|
|
3307
3307
|
if (d.title) box.addChild(new Text(theme.fg("accent", d.title), 0, 0));
|
|
3308
|
-
box.addChild(new Markdown(body, 0, 0, getMarkdownTheme()));
|
|
3308
|
+
if (expanded && body) box.addChild(new Markdown(body, 0, 0, getMarkdownTheme()));
|
|
3309
3309
|
return box;
|
|
3310
3310
|
});
|
|
3311
3311
|
|
|
3312
3312
|
// Process-end notification rendering with a colored lifecycle label. Keep the
|
|
3313
3313
|
// box background subtle: coloring a potentially large log excerpt is noisy.
|
|
3314
|
-
pi.registerMessageRenderer(
|
|
3315
|
-
|
|
3316
|
-
|
|
3317
|
-
|
|
3318
|
-
|
|
3319
|
-
|
|
3320
|
-
|
|
3321
|
-
|
|
3322
|
-
|
|
3323
|
-
|
|
3324
|
-
|
|
3325
|
-
|
|
3326
|
-
|
|
3327
|
-
|
|
3328
|
-
|
|
3329
|
-
|
|
3330
|
-
|
|
3331
|
-
|
|
3332
|
-
|
|
3333
|
-
|
|
3334
|
-
|
|
3335
|
-
|
|
3336
|
-
|
|
3314
|
+
pi.registerMessageRenderer(
|
|
3315
|
+
"pi-babysit-process-end",
|
|
3316
|
+
(message, { expanded }, theme) => {
|
|
3317
|
+
const content = typeof message.content === "string" ? message.content : "";
|
|
3318
|
+
const d = (message.details ?? {}) as {
|
|
3319
|
+
status?: DisplayStatus;
|
|
3320
|
+
success?: boolean;
|
|
3321
|
+
exitCode?: number | null;
|
|
3322
|
+
command?: string;
|
|
3323
|
+
count?: number;
|
|
3324
|
+
};
|
|
3325
|
+
const status =
|
|
3326
|
+
d.status ??
|
|
3327
|
+
(d.success ? "success" : d.exitCode == null ? "terminated" : "failed");
|
|
3328
|
+
const payload = d.command
|
|
3329
|
+
? ` ${summarizeNotificationCommand(d.command)}`
|
|
3330
|
+
: d.count && d.count > 1
|
|
3331
|
+
? ` ×${d.count}`
|
|
3332
|
+
: "";
|
|
3333
|
+
const header = theme.fg(
|
|
3334
|
+
"warning",
|
|
3335
|
+
theme.bold(`babysit_run COMMAND${payload}`),
|
|
3336
|
+
);
|
|
3337
|
+
const box = new Box(1, 1, (t) => theme.bg("toolSuccessBg", t));
|
|
3338
|
+
box.addChild(new Text(header, 0, 0));
|
|
3339
|
+
box.addChild(new Text(renderStatus(status, theme), 0, 0));
|
|
3340
|
+
if (expanded && content) {
|
|
3341
|
+
box.addChild(new Text(theme.fg("toolOutput", content), 0, 0));
|
|
3342
|
+
}
|
|
3343
|
+
return box;
|
|
3344
|
+
},
|
|
3345
|
+
);
|
|
3337
3346
|
|
|
3338
3347
|
let polling = false;
|
|
3339
3348
|
pi.on("session_start", async (_event, ctx) => {
|
|
@@ -3950,7 +3959,7 @@ export default function (pi: ExtensionAPI) {
|
|
|
3950
3959
|
: "";
|
|
3951
3960
|
return new Text(theme.fg("warning", `${title}${agent}${detail}`), 0, 0);
|
|
3952
3961
|
},
|
|
3953
|
-
renderResult(result, { isPartial }, theme, context) {
|
|
3962
|
+
renderResult(result, { expanded, isPartial }, theme, context) {
|
|
3954
3963
|
const details = (result.details ?? {}) as {
|
|
3955
3964
|
kind?: "process" | "subagent";
|
|
3956
3965
|
status?: DisplayStatus;
|
|
@@ -3977,7 +3986,11 @@ export default function (pi: ExtensionAPI) {
|
|
|
3977
3986
|
? "started"
|
|
3978
3987
|
: "success");
|
|
3979
3988
|
const label = renderStatus(status, theme);
|
|
3980
|
-
return new Text(
|
|
3989
|
+
return new Text(
|
|
3990
|
+
expanded && content ? `${label}\n${theme.fg("toolOutput", content)}` : label,
|
|
3991
|
+
0,
|
|
3992
|
+
0,
|
|
3993
|
+
);
|
|
3981
3994
|
},
|
|
3982
3995
|
});
|
|
3983
3996
|
|