Skip to main content

tycode_core/modules/execution/
config.rs

1use schemars::JsonSchema;
2use serde::{Deserialize, Serialize};
3
4#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, JsonSchema)]
5pub enum RunBuildTestOutputMode {
6    #[default]
7    ToolResponse,
8    Context,
9}
10
11#[derive(Debug, Clone, Serialize, Deserialize, Default, PartialEq, Eq, JsonSchema)]
12pub enum CommandExecutionMode {
13    #[default]
14    Direct,
15    Bash,
16}
17
18#[derive(Debug, Clone, Serialize, Deserialize, Default, JsonSchema)]
19#[schemars(title = "Execution")]
20pub struct ExecutionConfig {
21    /// Where command output appears - in tool response or context section
22    #[serde(default)]
23    pub output_mode: RunBuildTestOutputMode,
24
25    /// How commands are executed - direct exec or bash wrapper
26    #[serde(default)]
27    pub execution_mode: CommandExecutionMode,
28
29    /// Maximum bytes of command output to include. Large outputs are compacted
30    /// by keeping the first half and last half with a truncation marker.
31    /// None means no limit (default).
32    #[serde(default)]
33    pub max_output_bytes: Option<usize>,
34}