* Add an ability to stream stdin, stdout, and stderr * Streaming of stdout and stderr has a configurable cap for total amount of transmitted bytes (with an ability to disable it) * Add support for overriding environment variables * Add an ability to terminate running applications (using `command/exec/terminate`) * Add TTY/PTY support, with an ability to resize the terminal (using `command/exec/resize`)
23 lines
770 B
Rust
23 lines
770 B
Rust
use crate::protocol::v1;
|
|
use crate::protocol::v2;
|
|
impl From<v1::ExecOneOffCommandParams> for v2::CommandExecParams {
|
|
fn from(value: v1::ExecOneOffCommandParams) -> Self {
|
|
Self {
|
|
command: value.command,
|
|
process_id: None,
|
|
tty: false,
|
|
stream_stdin: false,
|
|
stream_stdout_stderr: false,
|
|
output_bytes_cap: None,
|
|
disable_output_cap: false,
|
|
disable_timeout: false,
|
|
timeout_ms: value
|
|
.timeout_ms
|
|
.map(|timeout| i64::try_from(timeout).unwrap_or(60_000)),
|
|
cwd: value.cwd,
|
|
env: None,
|
|
size: None,
|
|
sandbox_policy: value.sandbox_policy.map(std::convert::Into::into),
|
|
}
|
|
}
|
|
}
|