feat(pi): add read-only subagent attach view
This commit is contained in:
@@ -6,7 +6,7 @@ import { SubprocessRpcRunner } from "./runner.ts";
|
||||
import { Supervisor } from "./supervisor.ts";
|
||||
import { milestoneNotification } from "./status.ts";
|
||||
import type { SpawnRequest, SubagentStatus } from "./types.ts";
|
||||
import { widget } from "./ui.ts";
|
||||
import { attachedChildView, widget } from "./ui.ts";
|
||||
|
||||
let supervisor: Supervisor | undefined;
|
||||
let lastDiagnostics: Diagnostics = { warnings: [] };
|
||||
@@ -230,6 +230,28 @@ export default function subagents(pi: ExtensionAPI) {
|
||||
},
|
||||
});
|
||||
|
||||
pi.registerCommand("subagent-attach", {
|
||||
description: "Open a read-only attached view for a subagent id",
|
||||
handler: async (args, ctx) => {
|
||||
const id = args.trim();
|
||||
if (!id) {
|
||||
ctx.ui.notify("Usage: /subagent-attach <id>", "warning");
|
||||
return;
|
||||
}
|
||||
const currentSupervisor = getSupervisor(ctx);
|
||||
currentSupervisor.status(id);
|
||||
await ctx.ui.custom<void>((tui, _theme, _keybindings, done) => attachedChildView({
|
||||
status: () => currentSupervisor.status(id),
|
||||
activity: () => currentSupervisor.activity(id),
|
||||
onDetach: () => done(),
|
||||
onChange: () => tui.requestRender(),
|
||||
}), {
|
||||
overlay: true,
|
||||
overlayOptions: { width: "90%", maxHeight: "90%", minWidth: 60 },
|
||||
});
|
||||
},
|
||||
});
|
||||
|
||||
pi.registerCommand("subagent-wait", {
|
||||
description: "Wait for subagent ids separated by spaces",
|
||||
handler: async (args, ctx) => {
|
||||
|
||||
Reference in New Issue
Block a user