@promptbook/google
Version:
Promptbook: Create persistent AI agents that turn your company's scattered knowledge into action
81 lines (80 loc) • 3.18 kB
TypeScript
import type { AsciiArtColorDepth } from '../utils/ascii-art/convertImageDataToAsciiArt';
import type { ResolvedAvatarRenderDefinition } from './renderAvatarVisual';
import type { AvatarDefinition } from './types/AvatarDefinition';
import type { AvatarSurfaceStyle, AvatarVisualId, AvatarVisualTerminalTextGrid } from './types/AvatarVisualDefinition';
/**
* Options shared by the terminal-text avatar renderers.
*
* @private within the repository
*/
export type RenderAvatarVisualTerminalTextOptions = {
/**
* Stable visual identity of the rendered agent avatar.
*/
readonly avatarDefinition: AvatarDefinition;
/**
* Built-in avatar visual to render, the same one used on the website.
*/
readonly visualId: AvatarVisualId;
/**
* Surface used to derive the avatar palette.
*
* @default 'framed'
*/
readonly surface?: AvatarSurfaceStyle;
/**
* Output width in terminal character cells.
*/
readonly columns: number;
/**
* Output height in terminal character cells.
*/
readonly rows: number;
/**
* Animation timestamp for animated visuals.
*/
readonly timeMs: number;
/**
* Optional stable render data reused across frames.
*/
readonly resolvedAvatarRenderDefinition?: ResolvedAvatarRenderDefinition;
};
/**
* Options for `renderAvatarVisualTerminalTextLines`.
*
* @private within the repository
*/
export type RenderAvatarVisualTerminalTextLinesOptions = RenderAvatarVisualTerminalTextOptions & {
/**
* Color depth of the emitted ANSI escape codes.
*
* @default 'TRUE_COLOR'
*/
readonly colorDepth?: AsciiArtColorDepth;
};
/**
* Renders one frame of a character-based avatar visual straight into terminal character cells.
*
* Visuals which are themselves made of characters, for example `AsciiOctopus`, lose their identity
* when they are rasterized onto a canvas and converted back into half-block ASCII art - every glyph
* is averaged away into a colored blob. Such visuals expose `renderTerminalText`, which paints the
* terminal grid directly and is used instead of the raster pipeline.
*
* The square avatar is centered inside the requested grid the same way `renderAvatarVisualAsciiArt`
* centers the avatar canvas inside a wider terminal frame.
*
* @param options Avatar identity, visual selection, and output grid size.
* @returns Grid of `rows` rows of `columns` cells, or `null` when the visual has no terminal renderer.
*
* @private within the repository
*/
export declare function renderAvatarVisualTerminalTextGrid(options: RenderAvatarVisualTerminalTextOptions): AvatarVisualTerminalTextGrid | null;
/**
* Renders one frame of a character-based avatar visual into ANSI-colored terminal lines.
*
* @param options Avatar identity, visual selection, output grid size, and ANSI color depth.
* @returns One ANSI-colored string per output row, or `null` when the visual has no terminal renderer.
*
* @private within the repository
*/
export declare function renderAvatarVisualTerminalTextLines(options: RenderAvatarVisualTerminalTextLinesOptions): ReadonlyArray<string> | null;