import type { ExtensionAPI } from "@earendil-works/pi-coding-agent"; export default function (pi: ExtensionAPI) { // /exit command as an alias for /quit pi.registerCommand("exit", { description: "Quit pi (alias for /quit)", handler: async (_args, ctx) => { ctx.shutdown(); }, }); // Typing "exit" alone (no LLM call) also quits pi.on("input", async (event, ctx) => { if (event.text.trim().toLowerCase() === "exit") { ctx.shutdown(); return { action: "handled" }; } return { action: "continue" }; }); }