// Lair Editor — Scyla Development Environment
//
// A polished terminal UI for writing Scyla code,
// managing datasets, and training models.
//
// Chambers:
//   Code Chamber   — Write and run Scyla code
//   Dataset Chamber — Drag-and-drop training data pairs
//   Terminal        — Interactive Scyla REPL
//
// Nexus: Optional AI intelligence layer (Ctrl+N to toggle)
//
// Aislinn McCubbins, April 2026

fn main() {
    // Create the app
    ui_app("Lair Editor")

    // ── Code Chamber ──
    let welcome_code = "// Welcome to the Lair.\n// Write your Scyla code here.\n\nfn main() \{\n    println(\"Hello from the Lair!\")\n\}"
    ui_tab_editor("Code Chamber", "code", welcome_code)

    // ── Dataset Chamber ──
    let headers = array_new()
    headers = array_push(headers, "Prompt")
    headers = array_push(headers, "Response")
    ui_tab_data("Dataset Chamber", "data", headers)

    // Add some example data pairs
    let row1 = array_new()
    row1 = array_push(row1, "Hello!")
    row1 = array_push(row1, "Hi there! How are you?")
    ui_data_add_row("data", row1)

    let row2 = array_new()
    row2 = array_push(row2, "What is your name?")
    row2 = array_push(row2, "I am Silkie!")
    ui_data_add_row("data", row2)

    let row3 = array_new()
    row3 = array_push(row3, "Tell me about stars")
    row3 = array_push(row3, "Stars are big balls of fire far away. They twinkle!")
    ui_data_add_row("data", row3)

    // ── Terminal ──
    ui_tab_terminal("Terminal", "term")

    // Set status
    ui_status("Ready — 3 training pairs loaded")

    // Launch!
    ui_run()
}
