import type { ToolDefinition } from "@opencode-ai/plugin"; import type { PluginContext } from "../types.js"; /** * Write bytes to a running PTY background task. * * Two input shapes: * * - **String** — verbatim bytes written to the PTY. Use this for plain text * such as REPL commands (`"print(1)\n"`) or when the agent specifically * wants the literal characters `\u001b` (e.g. writing source code). * * - **Sequence array** — mix plain strings (text) with `{ key: "" }` * objects (named control keys). Items concatenate into one atomic write * so the PTY sees the whole sequence as one input chunk. The agent never * has to JSON-encode escape characters. * * Allowed key names: `enter`, `return`, `tab`, `space`, `backspace`, * `esc`, `escape`, `up`, `down`, `left`, `right`, `home`, `end`, * `page-up`, `page-down`, `delete`, `insert`, `f1`..`f12`, * `ctrl-a`..`ctrl-z`. Names are case-insensitive. * * The vim "type text, exit insert, save and quit" idiom: * * ```ts * bash_write({ taskId, input: [ * "iHello", * { key: "esc" }, * ":wq", * { key: "enter" }, * ]}) * ``` * * Rust enforces a 1 MiB maximum on the EXPANDED byte stream. Agents should * check `bash_status` first and only call `bash_write` when the task reports * `mode: "pty"`. */ export declare function createBashWriteTool(ctx: PluginContext): ToolDefinition; //# sourceMappingURL=bash_write.d.ts.map