mirror of
https://github.com/wassname/pi-goals.git
synced 2026-09-21 13:20:15 +08:00
14 lines
675 B
TypeScript
14 lines
675 B
TypeScript
import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
|
|
import { GoalIntercom } from "../../src/intercom.js";
|
|
|
|
export default function worker(pi: ExtensionAPI): void {
|
|
const link = new GoalIntercom(pi);
|
|
link.onSteer = instruction => pi.sendUserMessage(`[supervisor] ${instruction}`, { deliverAs: "steer" });
|
|
pi.on("session_start", async (_event, ctx) => {
|
|
link.configure("native-pair-test", "worker", ctx);
|
|
void link.waitReady(8000).then(() => {
|
|
link.view("The worker stopped.\n\nThe saved plan needs a check of the actual outputs.", "settled", undefined, true);
|
|
}).catch(error => { if (!link.ended) ctx.ui.notify(String(error), "error"); });
|
|
});
|
|
}
|