Compare commits
2 Commits
micn/libvi
...
libvision
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c1ce3038d8 | ||
|
|
4b1694b308 |
5
.cargo/config.toml
Normal file
5
.cargo/config.toml
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
[target.aarch64-apple-darwin]
|
||||||
|
rustflags = ["-C", "link-args=-Wl,-rpath,@executable_path"]
|
||||||
|
|
||||||
|
[target.x86_64-apple-darwin]
|
||||||
|
rustflags = ["-C", "link-args=-Wl,-rpath,@executable_path"]
|
||||||
@@ -136,8 +136,12 @@ G3 is designed for:
|
|||||||
# Build the project
|
# Build the project
|
||||||
cargo build --release
|
cargo build --release
|
||||||
|
|
||||||
# Run G3
|
# Run from the build directory
|
||||||
cargo run
|
./target/release/g3
|
||||||
|
|
||||||
|
# Or copy both files to somewhere in your PATH (macOS only needs both files)
|
||||||
|
cp target/release/g3 ~/.local/bin/
|
||||||
|
cp target/release/libVisionBridge.dylib ~/.local/bin/ # macOS only
|
||||||
|
|
||||||
# Execute a task
|
# Execute a task
|
||||||
g3 "implement a function to calculate fibonacci numbers"
|
g3 "implement a function to calculate fibonacci numbers"
|
||||||
|
|||||||
11
build.rs
11
build.rs
@@ -1,11 +0,0 @@
|
|||||||
use std::env;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
// Only add rpaths on macOS
|
|
||||||
if env::var("CARGO_CFG_TARGET_OS").unwrap() == "macos" {
|
|
||||||
// Add rpath so libVisionBridge.dylib can be found at runtime
|
|
||||||
// @executable_path means "relative to the executable"
|
|
||||||
println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path");
|
|
||||||
println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
use std::env;
|
|
||||||
|
|
||||||
fn main() {
|
|
||||||
// Only add rpaths on macOS
|
|
||||||
if env::var("CARGO_CFG_TARGET_OS").unwrap() == "macos" {
|
|
||||||
// Add rpath so libVisionBridge.dylib can be found at runtime
|
|
||||||
// @executable_path means "relative to the executable"
|
|
||||||
println!("cargo:rustc-link-arg=-Wl,-rpath,@executable_path");
|
|
||||||
println!("cargo:rustc-link-arg=-Wl,-rpath,@loader_path");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -2675,12 +2675,7 @@ Template:
|
|||||||
|
|
||||||
// Display tool execution result with proper indentation
|
// Display tool execution result with proper indentation
|
||||||
if tool_call.tool != "final_output" {
|
if tool_call.tool != "final_output" {
|
||||||
// Skip displaying output for shell tool since it was already streamed
|
let output_lines: Vec<&str> = tool_result.lines().collect();
|
||||||
let should_display_output = tool_call.tool != "shell";
|
|
||||||
|
|
||||||
let output_lines: Vec<&str> = if should_display_output {
|
|
||||||
tool_result.lines().collect()
|
|
||||||
} else { vec![] };
|
|
||||||
|
|
||||||
// Check if UI wants full output (machine mode) or truncated (human mode)
|
// Check if UI wants full output (machine mode) or truncated (human mode)
|
||||||
let wants_full = self.ui_writer.wants_full_output();
|
let wants_full = self.ui_writer.wants_full_output();
|
||||||
@@ -3192,16 +3187,13 @@ Template:
|
|||||||
{
|
{
|
||||||
Ok(result) => {
|
Ok(result) => {
|
||||||
if result.success {
|
if result.success {
|
||||||
// Don't return stdout - it was already streamed to the UI
|
Ok(if result.stdout.is_empty() {
|
||||||
// Returning it would cause duplicate output
|
"✅ Command executed successfully".to_string()
|
||||||
Ok("✅ Command executed successfully".to_string())
|
|
||||||
} else {
|
} else {
|
||||||
// For errors, return stderr since it wasn't streamed
|
result.stdout.trim().to_string()
|
||||||
Ok(if result.stderr.is_empty() {
|
|
||||||
"❌ Command failed".to_string()
|
|
||||||
} else {
|
|
||||||
format!("❌ Command failed: {}", result.stderr.trim())
|
|
||||||
})
|
})
|
||||||
|
} else {
|
||||||
|
Ok(format!("❌ Command failed: {}", result.stderr.trim()))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Err(e) => Ok(format!("❌ Execution error: {}", e)),
|
Err(e) => Ok(format!("❌ Execution error: {}", e)),
|
||||||
|
|||||||
Reference in New Issue
Block a user