/** * Plannotator Pi Extension — Browser-based plan review. * * Registers a single tool: plannotator_review_plan. * Opens a plan file in the browser UI, collects the user's decision, * and returns it without changing agent behavior. No mode transitions, * no tool gating, no execution tracking. The agent waits for user * instructions after approval. */ import type { ExtensionAPI } from "@mariozechner/pi-coding-agent"; import { registerCurrentPiSession } from "./current-pi-session.js"; import { registerPlannotatorEventListeners } from "./plannotator-events.js"; import { registerReviewTool } from "./review-tool.js"; export default function plannotator(pi: ExtensionAPI): void { const currentPiSession = registerCurrentPiSession(pi); void registerPlannotatorEventListeners(pi); // The one thing this extension does: review a plan and return the decision registerReviewTool(pi, currentPiSession); // Session lifecycle: update session identity only pi.on("session_start", async (_event, ctx) => { currentPiSession.update(ctx); }); pi.on("session_shutdown", () => { currentPiSession.clear(); }); }