/** * Demo Document Builder * * Builds a Markdown document incrementally as an agent works. * Each command appends a section. The result is a reproducible * tutorial/proof document with embedded command outputs and screenshots. */ export interface DemoState { title: string; filePath: string; sections: DemoSection[]; startedAt: string; url?: string; gitBranch?: string; gitCommit?: string; } export interface DemoSection { type: 'note' | 'exec' | 'screenshot' | 'snapshot'; content: string; /** For exec: the command that was run */ command?: string; /** For exec: the exit code */ exitCode?: number; /** For screenshot: base64 PNG (not stored in state, written to file) */ screenshotFile?: string; timestamp: string; } /** Initialize a new demo document */ export declare function initDemo(title: string, outputDir: string, options?: { url?: string; }): Promise; /** Add a prose note section */ export declare function addNote(state: DemoState, text: string): DemoState; /** * Run a command, capture output, add as code block. * * Uses execSync with shell: true because demo commands may contain * pipes, redirects, and other shell features. The command string * originates from the agent (not user input), so shell injection * is not a concern here. */ export declare function addExec(state: DemoState, command: string, args: string[]): DemoState; /** Take a screenshot via daemon and embed reference */ export declare function addScreenshot(state: DemoState, screenshotBuffer: Buffer, caption?: string): Promise; /** Add a snapshot (accessibility tree) section */ export declare function addSnapshot(state: DemoState, snapshotText: string): DemoState; /** Remove the last section */ export declare function popSection(state: DemoState): DemoState; /** Render the demo state as a Markdown string */ export declare function renderDemo(state: DemoState): string; /** Write the current state to the markdown file */ export declare function writeDemo(state: DemoState): Promise; /** * Verify a demo by re-running all exec sections and comparing outputs. * * Uses execSync with shell: true to reproduce the original commands * which may contain pipes and shell features. */ export declare function verifyDemo(state: DemoState): Promise<{ passed: boolean; failures: Array<{ index: number; command: string; expected: string; actual: string; }>; }>; //# sourceMappingURL=demo.d.ts.map