// Package execenv abstracts process execution so tool handlers (Bash, // SubAgent fork, plugin sandboxing) can run against a local exec.Cmd in // CLI / daemon mode or against a remote sandbox (E2B Firecracker, etc.) // in SaaS mode. The Executor / Process pair is the sole injection point // for "how do we actually run a child process" — everything above it // calls these interfaces, nothing below assumes local fork. // // # API Consumption Shapes // // Both Executor and Process are form 3 (synchronous callback) under the // three Flyto API shapes (see `docs/api-reference.md` "API 消费形态 / // API Consumption Patterns"): // // - Executor.Start: engine / tools call synchronously to launch a // child process; the backend implementation (local / sandbox) // returns a Process handle or error. // - Process.Wait / Kill / Stdin / Stdout / Stderr: synchronous method // calls on the returned handle, same shape. // // Package execenv 抽象进程执行: 工具处理器 (Bash / SubAgent fork / plugin // 沙盒) 在 CLI / daemon 模式下跑本地 exec.Cmd, 在 SaaS 模式下跑远端沙盒 // (E2B Firecracker 等). Executor / Process 对是 "我们怎么真执行子进程" 的 // 唯一注入点 —— 上层都调这对接口, 下层不假设本地 fork. // // # API 消费形态 // // Executor 和 Process 都是形态三 (同步回调, 见 `docs/api-reference.md` // "API 消费形态 / API Consumption Patterns"): // // - Executor.Start: 引擎 / 工具同步调启动子进程; 后端实现 (本地 / 沙盒) // 返 Process 句柄或 error. // - Process.Wait / Kill / Stdin / Stdout / Stderr: 对返回句柄的同步方法调用, 同形态. package execenv