/** * `/canvas` — the interactive surface for canvas extensions. * * Design: `docs/canvas-extensions-design.md` §11. Deliberately thin: every decision * lives in `core/canvas/session.ts`, which is testable without a terminal, so this * file only renders and supplies an `AbortSignal`. * * The signal is the point of the loader. `BorderedLoader` already gives Esc-to-cancel * and exposes an `AbortSignal`, and `registry.open` accepts one — so a person's Esc * reaches the abandon path (§11.6) and the extension is told to release the port it * may already have bound, rather than the spinner merely disappearing. * * `/new-canvas` is registered here rather than beside `/new-skill` and friends * because it is not a file-writing command any more: it opens what it scaffolds * and hands the agent a brief to build it, which needs this file's session and * `hoo.sendUserMessage`. Its decisions live in `core/canvas/scaffold.ts`. * * The agent tools register on the first successful open and stay for the session: * `registerTool` has no counterpart to remove a tool. So a session that never opens a * canvas pays nothing for them, which is the case that matters (§11.5); after the * first open they cost ~235 tokens and answer honestly when nothing is open. */ import { type CanvasSessionOptions } from "../../core/canvas/session.js"; import type { ExtensionAPI } from "../../core/extensions/types.js"; /** * Test seams, and only that. * * `/new-canvas` opens what it writes, so driving it without a terminal needs a * runtime that does not depend on hoocode having been built, and a home * directory that is not the developer's. Everything else this file does is * decided in `core/canvas/`, where it is testable without any of this. */ export interface CanvasSetupOverrides { homeDir?: string; resolveRuntime?: CanvasSessionOptions["resolveRuntime"]; } export declare function setupCanvas(hoo: ExtensionAPI, overrides?: CanvasSetupOverrides): void; //# sourceMappingURL=canvas.d.ts.map