//! The templates `wai create` writes: each example of `wai/examples/` but its `test/`
//! directory, its files held in this binary. Each carries an AGENTS.md: what the project is,
//! and how to build, run, test and conform it, for a coding agent. `tests/cli_dx.rs` holds this table to the
//! examples on disk, file for file and byte for byte, so the two cannot drift. Every
//! template is Apache-2.0 and carries the license's text as `LICENSE`: one copy in this
//! binary, `wai/LICENSE`, which each example's `LICENSE` must equal byte for byte.

use super::{File, Template};

/// The Apache-2.0 text every template carries: the one copy `wai create` holds.
const LICENSE: File = super::LICENSE;

macro_rules! ex {
    ($t:literal, $f:literal) => {
        ($f, include_bytes!(concat!("../../../../../examples/", $t, "/", $f)) as &[u8])
    };
}

pub const TEMPLATES: &[Template] = &[
    Template {
        name: "video-room",
        title: "A video room in one page",
        files: &[
            LICENSE,
            ex!("video-room", ".gitignore"),
            ex!("video-room", "AGENTS.md"),
            ex!("video-room", "README.md"),
            ex!("video-room", "index.html"),
            ex!("video-room", "wai.json"),
        ],
        generated: &[],
    },
    Template {
        name: "watch-together",
        title: "Watch together",
        files: &[
            LICENSE,
            ex!("watch-together", ".gitignore"),
            ex!("watch-together", "AGENTS.md"),
            ex!("watch-together", "README.md"),
            ex!("watch-together", "index.html"),
            ex!("watch-together", "wai.json"),
        ],
        generated: &[("tone.wav", super::tone_wav)],
    },
    Template {
        name: "messaging",
        title: "Messaging and a call",
        files: &[
            LICENSE,
            ex!("messaging", ".gitignore"),
            ex!("messaging", "AGENTS.md"),
            ex!("messaging", "README.md"),
            ex!("messaging", "index.html"),
            ex!("messaging", "wai.json"),
        ],
        generated: &[],
    },
    Template {
        name: "encoder-ingest",
        title: "Stream from an encoder into a room",
        files: &[
            LICENSE,
            ex!("encoder-ingest", ".gitignore"),
            ex!("encoder-ingest", "AGENTS.md"),
            ex!("encoder-ingest", "Cargo.toml"),
            ex!("encoder-ingest", "README.md"),
            ex!("encoder-ingest", "src/main.rs"),
            ex!("encoder-ingest", "wai.json"),
        ],
        generated: &[],
    },
    Template {
        name: "package-and-deliver",
        title: "Package a title and play it",
        files: &[
            LICENSE,
            ex!("package-and-deliver", ".gitignore"),
            ex!("package-and-deliver", "AGENTS.md"),
            ex!("package-and-deliver", "README.md"),
            ex!("package-and-deliver", "floor/v.obu"),
            ex!("package-and-deliver", "index.html"),
            ex!("package-and-deliver", "pack.sh"),
            ex!("package-and-deliver", "player.js"),
            ex!("package-and-deliver", "policy.toml"),
            ex!("package-and-deliver", "test-key.hex"),
            ex!("package-and-deliver", "wai.json"),
        ],
        generated: &[],
    },
    Template {
        name: "verify-receipts",
        title: "Verify receipts in Rust and in Python",
        files: &[
            LICENSE,
            ex!("verify-receipts", ".gitignore"),
            ex!("verify-receipts", "AGENTS.md"),
            ex!("verify-receipts", "README.md"),
            ex!("verify-receipts", "python/_blake3.py"),
            ex!("verify-receipts", "python/_ed25519.py"),
            ex!("verify-receipts", "python/verify_receipts.py"),
            ex!("verify-receipts", "rust/Cargo.toml"),
            ex!("verify-receipts", "rust/src/main.rs"),
            ex!("verify-receipts", "wai.json"),
        ],
        generated: &[],
    },
    Template {
        name: "apple-app",
        title: "A native app on Apple platforms",
        files: &[
            LICENSE,
            ex!("apple-app", ".gitignore"),
            ex!("apple-app", "AGENTS.md"),
            ex!("apple-app", "Package.swift"),
            ex!("apple-app", "README.md"),
            ex!("apple-app", "Sources/WaiApp/PlayerApp.swift"),
            ex!("apple-app", "Sources/WaiApp/Replay.swift"),
            ex!("apple-app", "Sources/WaiApp/main.swift"),
            ex!("apple-app", "sample-session.json"),
            ex!("apple-app", "wai.json"),
        ],
        generated: &[],
    },
    Template {
        name: "android-app",
        title: "The native sink in Kotlin, for Android",
        files: &[
            LICENSE,
            ex!("android-app", ".gitignore"),
            ex!("android-app", "AGENTS.md"),
            ex!("android-app", "README.md"),
            ex!("android-app", "replay/build.gradle.kts"),
            ex!("android-app", "replay/src/main/kotlin/Replay.kt"),
            ex!("android-app", "sample-session.json"),
            ex!("android-app", "settings.gradle.kts"),
            ex!("android-app", "wai.json"),
        ],
        generated: &[],
    },
    Template {
        name: "remote-desktop",
        title: "Remote desktop in a room",
        files: &[
            LICENSE,
            ex!("remote-desktop", ".gitignore"),
            ex!("remote-desktop", "AGENTS.md"),
            ex!("remote-desktop", "README.md"),
            ex!("remote-desktop", "host.sh"),
            ex!("remote-desktop", "wai.json"),
        ],
        generated: &[],
    },
];
