rae 0.1.4

Renderer-neutral widget, layout, state, and GLSL shader primitives for agentic Rust desktop tools.
Documentation
use rae::{
    compute_agent_layout, AgentMode, DeckModel, FlowLane, KanbanColumn, PaneChrome, PaneId,
    PromptModel, Rgba, StatusChip, TaskStatus, ThinkingMode, TranscriptItem, WidgetFrame,
};

fn main() {
    let layout = compute_agent_layout(rae::Rect::new(0.0, 0.0, 1440.0, 900.0));
    let frame = WidgetFrame {
        panes: vec![
            PaneChrome {
                id: PaneId::Transcript,
                title: "Transcript".into(),
                subtitle: "assistant stream".into(),
                rect: layout.main,
                focused: true,
            },
            PaneChrome {
                id: PaneId::Sidebar,
                title: "Agent Flow".into(),
                subtitle: "kanban + validation".into(),
                rect: layout.sidebar,
                focused: false,
            },
            PaneChrome {
                id: PaneId::Prompt,
                title: "Prompt".into(),
                subtitle: "build mode".into(),
                rect: layout.prompt,
                focused: false,
            },
        ],
        prompt: PromptModel {
            mode: AgentMode::Build,
            thinking: ThinkingMode::High,
            input: "Add shader examples and verify the crate".into(),
            cursor: 27,
            placeholder: "Ask for a patch, plan, review, or validation".into(),
        },
        transcript: vec![
            TranscriptItem::system("workspace loaded: KnottRustDesign"),
            TranscriptItem::user("Make examples evolve with rae"),
            TranscriptItem::assistant(
                "I added runnable examples for shader catalogs, morphing, effects, layout, flow, sidecar safety, and themes.",
                "verification pending",
            ),
        ],
        deck: DeckModel {
            active_lane: FlowLane::Kanban,
            chips: vec![
                StatusChip {
                    label: "mode".into(),
                    value: "Build".into(),
                    color: Rgba::rgb8(122, 185, 255),
                },
                StatusChip {
                    label: "thinking".into(),
                    value: "high".into(),
                    color: Rgba::rgb8(255, 190, 94),
                },
            ],
            columns: vec![
                KanbanColumn {
                    status: TaskStatus::Todo,
                    cards: vec!["wire preview gallery".into()],
                },
                KanbanColumn {
                    status: TaskStatus::Doing,
                    cards: vec!["add examples".into(), "run verification".into()],
                },
                KanbanColumn {
                    status: TaskStatus::Done,
                    cards: vec!["publish shader crate".into()],
                },
            ],
            recommendations: vec![
                "bind u_time, u_resolution, and u_intensity for every shader".into(),
                "cache morph SDFs by MorphCacheKey".into(),
            ],
        },
    };

    println!("widget frame snapshot");
    println!("prompt: {}{}", frame.prompt.label(), frame.prompt.input);
    for pane in &frame.panes {
        println!(
            "pane {:?}: {:<12} focused:{} rect=({:.0},{:.0},{:.0},{:.0})",
            pane.id,
            pane.title,
            pane.focused,
            pane.rect.x,
            pane.rect.y,
            pane.rect.width,
            pane.rect.height
        );
    }
    for chip in &frame.deck.chips {
        println!("chip: {}={}", chip.label, chip.value);
    }
    for column in &frame.deck.columns {
        println!("{}: {} cards", column.status.label(), column.cards.len());
    }
}