/** * State Building Tools * * Tools for creating and modifying poster state: * - create_poster: Initialize a new poster * - set_background: Configure background layer * - add_layer: Add a layer to the poster * - modify_layer: Modify an existing layer * - apply_effect: Apply main effect (ASCII, dither, etc.) * - add_postprocess: Add post-processing effect * * All state follows the LayerShareState contract for API compatibility. */ import type { Tool } from '@modelcontextprotocol/sdk/types.js'; type AspectRatio = '16:9' | '9:16' | '1:1' | '4:3' | '3:4' | 'full'; type LayoutMode = 'absolute' | 'row' | 'column'; type JustifyContent = 'start' | 'center' | 'end' | 'space-between' | 'space-around' | 'space-evenly'; type AlignItems = 'start' | 'center' | 'end'; interface LayoutPadding { top: number; right: number; bottom: number; left: number; } type EffectId = 'none' | 'ascii-standard' | 'ascii-blocks' | 'ascii-braille' | 'ascii-hatching' | 'ascii-matrix' | 'ascii-technical' | 'ascii-dense' | 'ascii-minimal' | 'dither-floyd-steinberg' | 'dither-atkinson' | 'dither-jarvis-judice-ninke' | 'dither-stucki' | 'dither-burkes' | 'dither-sierra' | 'dither-two-row-sierra' | 'dither-sierra-lite' | 'halftone-mono' | 'halftone-cmyk' | 'glitch-chromatic' | 'glitch-digital' | 'glitch-vhs' | 'glitch-weird' | 'art-kuwahara' | 'art-crosshatch' | 'art-lineart' | 'art-engraving' | 'art-stipple'; type PostProcessType = 'scanlines' | 'vignette' | 'chromatic-aberration' | 'curvature' | 'grain' | 'noise' | 'pixelate' | 'wave' | 'rgb-glitch' | 'brightness-contrast' | 'color-tint' | 'palette' | 'jitter' | 'bloom' | 'dot-screen' | 'sepia' | 'grid' | 'light-beams' | 'motion-blur' | 'blob-tracking'; type TextAnimationType = 'wave' | 'rotate' | 'scale' | 'orbit' | 'bounce' | 'shake' | 'spiral' | 'typewriter' | 'glitch' | 'elastic' | 'cascade' | 'neon'; type StaggerMode = 'sequential' | 'random' | 'center-out' | 'edges-in'; interface TextAnimationSettings { mode: 'static' | 'animated'; animation: TextAnimationParams | null; } interface BaseAnimationParams { type: TextAnimationType; enabled: boolean; speed: number; amplitude: number; staggerDelay: number; staggerMode: StaggerMode; loop: boolean; } type TextAnimationParams = BaseAnimationParams & Record; type FlexChildPositioning = 'flow' | 'absolute'; type FlexChildSizeMode = 'hug' | 'fixed' | 'fill'; type FlexChildAlignSelf = 'auto' | 'start' | 'center' | 'end' | 'stretch'; interface LayerTransform { x: number; y: number; width: number; height: number; rotation: number; opacity: number; originX?: number; originY?: number; } interface BaseLayer { id: string; name: string; type: string; visible: boolean; locked: boolean; positioning?: FlexChildPositioning; flexSizeMode?: FlexChildSizeMode; flexWidthMode?: FlexChildSizeMode; flexHeightMode?: FlexChildSizeMode; alignSelf?: FlexChildAlignSelf; flexGrow?: number; transform: LayerTransform; shadow?: { offsetX: number; offsetY: number; blur: number; color: string; opacity: number; }; blendMode?: string; margin?: { top: number; right: number; bottom: number; left: number; }; minWidth?: number; maxWidth?: number; minHeight?: number; maxHeight?: number; } interface TextLayer extends BaseLayer { type: 'text'; textType?: 'point' | 'frame'; content: string; fontFamily: string; fontSize: number; fontWeight: string; color: string; textAlign: 'left' | 'center' | 'right'; verticalAlign?: 'top' | 'middle' | 'bottom'; letterSpacing: number; lineHeight: number; textTransformMode?: 'scale' | 'box'; textBoxWidth?: number; frameWidthPx?: number; frameHeightPx?: number; autoSize?: 'none' | 'height' | 'widthAndHeight'; clipContent?: boolean; textTransform?: 'uppercase' | 'lowercase' | 'capitalize'; textDecoration?: 'underline' | 'line-through' | 'overline'; textDecorationColor?: string; textDecorationThickness?: number; animation?: TextAnimationSettings; } interface ImageLayer extends BaseLayer { type: 'image'; mediaUrl: string; objectFit: 'cover' | 'contain'; brightness: number; contrast: number; saturation: number; } interface VideoLayer extends BaseLayer { type: 'video'; mediaUrl: string; objectFit: 'cover' | 'contain'; brightness: number; contrast: number; saturation: number; loop: boolean; playbackSpeed: number; } type BackgroundContentType = 'solid' | 'image' | 'video' | '3d' | 'shader'; interface GradientStop { color: string; opacity: number; position: number; } interface SolidFill { type: 'solid'; color: string; opacity: number; } interface LinearGradientFill { type: 'linear'; angle: number; stops: GradientStop[]; } interface RadialGradientFill { type: 'radial'; center: { x: number; y: number; }; radius: number; stops: GradientStop[]; } type Fill = SolidFill | LinearGradientFill | RadialGradientFill; interface BackgroundLayer extends BaseLayer { type: 'background'; contentType: BackgroundContentType; solidColor: string; fill?: Fill; inputMedia?: { mediaUrl: string; mediaType: 'image' | 'video'; brightness: number; contrast: number; saturation: number; objectFit: 'cover' | 'contain'; }; } type Layer = TextLayer | ImageLayer | VideoLayer | BackgroundLayer | BaseLayer; interface PostProcessInstance { id: string; type: PostProcessType; enabled: boolean; settings: Record; } interface PosterState { canvas: { aspectRatio: AspectRatio; backgroundColor: string; canvasColor?: string; overflow?: 'visible' | 'hidden' | 'translucent'; layoutMode?: LayoutMode; justifyContent?: JustifyContent; alignItems?: AlignItems; wrap?: boolean; gap?: number; padding?: LayoutPadding; }; layers: Layer[]; effect?: { effectId: EffectId; enabled: boolean; ascii?: Record; dither?: Record; halftone?: Record; monoHalftone?: Record; cmykHalftone?: Record; chromatic?: Record; glitch?: Record; kuwahara?: Record; crosshatch?: Record; lineart?: Record; engraving?: Record; stipple?: Record; sinewarp?: Record; }; postProcesses: PostProcessInstance[]; } export declare function resetState(): void; export declare function getCurrentState(): PosterState | null; export declare const stateTools: Tool[]; /** * Handle state tool calls */ export declare function handleStateTool(name: string, args: Record | undefined): Promise<{ content: Array<{ type: string; text: string; }>; }>; export {}; //# sourceMappingURL=state.d.ts.map