use super::CompletionSpec;

pub(super) fn specs() -> Vec<CompletionSpec> {
    vec![
        (
            "io.readFile",
            "Read file contents",
            "io.readFile(${1:path})",
            "String",
        ),
        (
            "io.readFilePath",
            "Read file contents from a typed path",
            "io.readFilePath(${1:path})",
            "String",
        ),
        (
            "io.readFileBytesPath",
            "Read file bytes from a typed path",
            "io.readFileBytesPath(${1:path})",
            "Bytes",
        ),
        (
            "io.readDir",
            "List directory contents",
            "io.readDir(${1:path})",
            "List<String>",
        ),
        (
            "io.readDirPath",
            "List directory contents from a typed path",
            "io.readDirPath(${1:path})",
            "List<String>",
        ),
        (
            "io.readDirEntryPaths",
            "List directory entry paths from a typed path",
            "io.readDirEntryPaths(${1:path})",
            "List<Path>",
        ),
        (
            "io.writeFile",
            "Write file contents",
            "io.writeFile(${1:path}, ${2:content})",
            "Unit",
        ),
        (
            "io.writeFilePath",
            "Write file contents to a typed path",
            "io.writeFilePath(${1:path}, ${2:content})",
            "Unit",
        ),
        (
            "io.appendFile",
            "Append file contents",
            "io.appendFile(${1:path}, ${2:content})",
            "Unit",
        ),
        (
            "io.appendFilePath",
            "Append file contents to a typed path",
            "io.appendFilePath(${1:path}, ${2:content})",
            "Unit",
        ),
        (
            "io.writeFileBytesPath",
            "Write bytes to a typed path",
            "io.writeFileBytesPath(${1:path}, ${2:bytes})",
            "Unit",
        ),
        (
            "io.appendFileBytesPath",
            "Append bytes to a typed path",
            "io.appendFileBytesPath(${1:path}, ${2:bytes})",
            "Unit",
        ),
        (
            "io.createDirAll",
            "Create directories recursively",
            "io.createDirAll(${1:path})",
            "Unit",
        ),
        (
            "io.createDirAllPath",
            "Create directories recursively from a typed path",
            "io.createDirAllPath(${1:path})",
            "Unit",
        ),
        (
            "io.removeDirAll",
            "Remove directories recursively",
            "io.removeDirAll(${1:path})",
            "Unit",
        ),
        (
            "io.removeDirAllPath",
            "Remove directories recursively from a typed path",
            "io.removeDirAllPath(${1:path})",
            "Unit",
        ),
        (
            "io.pathExists",
            "Check if path exists",
            "io.pathExists(${1:path})",
            "Bool",
        ),
        (
            "io.pathExistsPath",
            "Check if typed path exists",
            "io.pathExistsPath(${1:path})",
            "Bool",
        ),
        (
            "io.isDir",
            "Check if path is directory",
            "io.isDir(${1:path})",
            "Bool",
        ),
        (
            "io.isDirPath",
            "Check if typed path is directory",
            "io.isDirPath(${1:path})",
            "Bool",
        ),
        (
            "io.isFile",
            "Check if path is file",
            "io.isFile(${1:path})",
            "Bool",
        ),
        (
            "io.isFilePath",
            "Check if typed path is file",
            "io.isFilePath(${1:path})",
            "Bool",
        ),
        (
            "io.getEnv",
            "Get environment variable",
            "io.getEnv(${1:name})",
            "Option<String>",
        ),
        (
            "io.currentDir",
            "Get current directory",
            "io.currentDir()",
            "String",
        ),
        (
            "io.currentDirPath",
            "Get current directory as typed path",
            "io.currentDirPath()",
            "Path",
        ),
        (
            "io.homeDir",
            "Get home directory",
            "io.homeDir()",
            "Option<String>",
        ),
        (
            "io.homeDirPath",
            "Get home directory as typed path",
            "io.homeDirPath()",
            "Option<Path>",
        ),
        (
            "io.command",
            "Construct command",
            "io.command(${1:program}, ${2:args})",
            "Command",
        ),
        (
            "io.commandWith",
            "Construct configured command",
            "io.commandWith(${1:opts})",
            "Command",
        ),
        (
            "io.commandWithRedirects",
            "Attach redirects to command",
            "io.commandWithRedirects(${1:command}, ${2:redirects})",
            "Command",
        ),
        (
            "io.execCommand",
            "Execute command",
            "io.execCommand(${1:command})",
            "ProcessResult",
        ),
        (
            "io.pipeline",
            "Construct pipeline",
            "io.pipeline(${1:commands})",
            "Pipeline",
        ),
        (
            "io.pipelineWithRedirects",
            "Attach redirects to pipeline",
            "io.pipelineWithRedirects(${1:pipeline}, ${2:redirects})",
            "Pipeline",
        ),
        (
            "io.execPipeline",
            "Execute pipeline",
            "io.execPipeline(${1:pipeline})",
            "ProcessResult",
        ),
        (
            "io.redirectStdoutPath",
            "Redirect stdout to typed path",
            "io.redirectStdoutPath(${1:path})",
            "Redirect",
        ),
        (
            "io.redirectStderrPath",
            "Redirect stderr to typed path",
            "io.redirectStderrPath(${1:path})",
            "Redirect",
        ),
        (
            "io.redirectStdinPath",
            "Redirect stdin from typed path",
            "io.redirectStdinPath(${1:path})",
            "Redirect",
        ),
        (
            "io.taskCommand",
            "Create command task",
            "io.taskCommand(${1:command})",
            "Task<ProcessResult>",
        ),
        (
            "io.taskPipeline",
            "Create pipeline task",
            "io.taskPipeline(${1:pipeline})",
            "Task<ProcessResult>",
        ),
        (
            "io.awaitTask",
            "Await task result",
            "io.awaitTask(${1:task})",
            "ProcessResult",
        ),
        (
            "io.awaitTasks",
            "Await task list",
            "io.awaitTasks(${1:tasks})",
            "List<ProcessResult>",
        ),
        (
            "io.processSuccess",
            "Check process success",
            "io.processSuccess(${1:result})",
            "Bool",
        ),
        (
            "io.processStdout",
            "Get process stdout",
            "io.processStdout(${1:result})",
            "String",
        ),
        (
            "io.processCode",
            "Get process exit code",
            "io.processCode(${1:result})",
            "Int",
        ),
        (
            "io.processStderr",
            "Get process stderr",
            "io.processStderr(${1:result})",
            "String",
        ),
        (
            "io.hashFile",
            "Hash file contents",
            "io.hashFile(${1:path})",
            "String",
        ),
        (
            "io.hashFilePath",
            "Hash file contents from a typed path",
            "io.hashFilePath(${1:path})",
            "String",
        ),
        (
            "io.hashString",
            "Hash a string",
            "io.hashString(${1:str})",
            "String",
        ),
        (
            "io.currentSystem",
            "Get current system",
            "io.currentSystem()",
            "String",
        ),
        // === Stream<T> APIs (Phase 4) ===
        (
            "io.streamList",
            "Create a stream from a list",
            "io.streamList(${1:list})",
            "Stream<T>",
        ),
        (
            "io.streamLines",
            "Stream lines from a file",
            "io.streamLines(${1:path})",
            "Stream<String>",
        ),
        (
            "io.streamCommand",
            "Stream stdout lines from a command",
            "io.streamCommand(${1:command})",
            "Stream<String>",
        ),
        (
            "io.streamBytes",
            "Stream byte chunks from a file",
            "io.streamBytes(${1:path})",
            "Stream<Bytes>",
        ),
        (
            "io.streamMap",
            "Transform each element of a stream",
            "io.streamMap(${1:stream}, ${2:fn})",
            "Stream<B>",
        ),
        (
            "io.streamFilter",
            "Filter elements of a stream",
            "io.streamFilter(${1:stream}, ${2:predicate})",
            "Stream<T>",
        ),
        (
            "io.streamTake",
            "Take first N elements from a stream",
            "io.streamTake(${1:stream}, ${2:n})",
            "Stream<T>",
        ),
        (
            "io.streamDrop",
            "Drop first N elements from a stream",
            "io.streamDrop(${1:stream}, ${2:n})",
            "Stream<T>",
        ),
        (
            "io.streamCollect",
            "Collect all elements from a stream into a list",
            "io.streamCollect(${1:stream})",
            "List<T>",
        ),
        (
            "io.streamPipe",
            "Pipe stream contents to a command",
            "io.streamPipe(${1:stream}, ${2:command})",
            "ProcessResult",
        ),
        (
            "io.streamForEach",
            "Execute callback for each stream element",
            "io.streamForEach(${1:stream}, ${2:callback})",
            "()",
        ),
        (
            "io.streamFold",
            "Fold a stream with an accumulator",
            "io.streamFold(${1:stream}, ${2:initial}, ${3:fn})",
            "A",
        ),
        (
            "io.streamWithTimeout",
            "Add a timeout to a stream",
            "io.streamWithTimeout(${1:stream}, ${2:timeout_ms})",
            "Stream<Option<T>>",
        ),
        // === Task cancel / await APIs ===
        (
            "io.cancel",
            "Cancel a running task",
            "io.cancel(${1:task})",
            "Unit",
        ),
        (
            "io.awaitAny",
            "Await the first task to complete",
            "io.awaitAny(${1:tasks})",
            "ProcessResult",
        ),
        (
            "io.awaitTaskWithTimeout",
            "Await task with a timeout",
            "io.awaitTaskWithTimeout(${1:task}, ${2:timeout_ms})",
            "Option<ProcessResult>",
        ),
        // === TTY / terminal APIs ===
        (
            "io.isTTY",
            "Check if fd is a terminal",
            "io.isTTY(fd: Int)",
            "Bool",
        ),
        (
            "io.terminalSize",
            "Get terminal size (rows, cols)",
            "io.terminalSize()",
            "Option<(Int, Int)>",
        ),
        (
            "io.setRawMode",
            "Set terminal to raw mode",
            "io.setRawMode(fd: Int, enable: Bool)",
            "Unit",
        ),
        (
            "io.resetTerminal",
            "Reset terminal to normal mode",
            "io.resetTerminal(fd: Int)",
            "Unit",
        ),
        (
            "io.readKey",
            "Read a single byte from fd (raw mode)",
            "io.readKey(fd: Int)",
            "Int",
        ),
        // === Job control APIs ===
        (
            "io.jobs",
            "List running background jobs",
            "io.jobs()",
            "List<Job>",
        ),
        (
            "io.waitAnyJob",
            "Wait for any background job",
            "io.waitAnyJob()",
            "ProcessResult",
        ),
        // === Other I/O ===
        (
            "io.kill",
            "Kill a process by PID",
            "io.kill(${1:pid}, ${2:signal})",
            "Unit",
        ),
        (
            "io.args",
            "Get script arguments",
            "io.args()",
            "List<String>",
        ),
    ]
}
