/** * Macro resolution (workstream W5's backend slice): substitutes the * `{{...}}` placeholders documented on MacroDef (shared/types.ts) into a * macro's action, given the run-time context (selected workflow, session, * canvas path, free-text subject). Pure and side-effect free — the caller * (src/server/macros.ts) executes the resolved action. */ import type { MacroDef, WorkflowInfo } from "../shared/types.js"; export interface MacroContext { workflow: WorkflowInfo | null; sessionCwd: string; /** Free-text subject for the Visualize macro ({{subject}}). */ subject?: string; } export type ResolvedMacroAction = { kind: "inject"; text: string; submit: boolean; } | { kind: "open-url"; url: string; } | { kind: "render-canvas"; }; export declare class MacroValidationError extends Error { constructor(message: string); } /** * Resolves a macro's action for execution against `ctx`. * Throws `MacroValidationError` when `macro.requiresWorkflow` and `ctx.workflow` * is null — the caller (the REST handler) turns that into a 400. */ export declare function resolveMacro(macro: MacroDef, ctx: MacroContext): ResolvedMacroAction; //# sourceMappingURL=macro-runner.d.ts.map