- 1120
let out = super::BashTool - 1121
.execute(&serde_json::json!({"command": "echo \"$TMPDIR\""}), &ctx) - 1122
.await; - 1123
assert!(!out.is_error, "stdout/stderr: {}", out.content); - 1124
assert!( - 1125
out.content - 1126
.contains(".vak/scratch/researcher-99/test-agent-scratch/tmp"), - 1127
"{}", - 1128
out.content - 1129
); - 1130
} - 1131
- 1132
#[tokio::test] - 1133
async fn workspace_command_promotes_user_visible_result() { - 1134
use crate::{Tool, ToolContext, sandbox_events::SandboxEventSink}; - 1135
let workspace = tempfile::tempdir().unwrap(); - 1136
let (sink, mut events) = SandboxEventSink::new_with_id("test-workspace-result".into()); - 1137
let ctx = ToolContext::new(workspace.path().to_path_buf()).with_sandbox_sink(sink); - 1138
- 1139
let out = super::BashTool - 1140
.execute( - 1141
&serde_json::json!({ - 1142
"command": "printf '<h1>India market</h1>\\n' > index.html", - 1143
"cwd": "." - 1144
}), - 1145
&ctx, - 1146
) - 1147
.await; - 1148
assert!(!out.is_error, "stdout/stderr: {}", out.content); - 1149
assert!(workspace.path().join("index.html").is_file()); - 1150
let mut saw_result = false; - 1151
while let Ok(event) = events.try_recv() { - 1152
if let crate::SandboxEvent::ArtifactGenerated { path, .. } = event { - 1153
saw_result |= path == "index.html"; - 1154
} - 1155
} - 1156
assert!( - 1157
saw_result, - 1158
"workspace result should be emitted as an artifact" - 1159
); - 1160
} - 1161
} - 1162
Indexing the workspace…
Vakyartha documentation is discovering safe artifacts, anchors, and source references.