mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-15 14:03:52 +00:00
* chore: remove inspect.sandboxagent.dev in favor of /ui/ * chore: add 404 page * fix: correct inspector package name in Dockerfiles and add .dockerignore - Change @anthropic-ai/sdk-inspector to @sandbox-agent/inspector in all Dockerfiles - Add .dockerignore to exclude target/, node_modules/, etc from Docker context The wrong package name caused pnpm install --filter to match nothing, so the inspector frontend was never built, resulting in binaries without the /ui/ endpoint. * chore: cargo fmt * chore(release): update version to 0.1.4-rc.7
30 lines
907 B
Rust
30 lines
907 B
Rust
use std::fs;
|
|
use std::io::{self, Write};
|
|
use std::path::Path;
|
|
|
|
use sandbox_agent::router::ApiDoc;
|
|
use utoipa::OpenApi;
|
|
|
|
fn main() {
|
|
emit_stdout("cargo:rerun-if-changed=../sandbox-agent/src/router.rs");
|
|
emit_stdout("cargo:rerun-if-changed=../sandbox-agent/src/lib.rs");
|
|
|
|
let out_dir = std::env::var("OUT_DIR").expect("OUT_DIR not set");
|
|
let out_path = Path::new(&out_dir).join("openapi.json");
|
|
|
|
let openapi = ApiDoc::openapi();
|
|
let json = serde_json::to_string_pretty(&openapi).expect("Failed to serialize OpenAPI spec");
|
|
|
|
fs::write(&out_path, json).expect("Failed to write OpenAPI spec");
|
|
emit_stdout(&format!(
|
|
"cargo:warning=Generated OpenAPI spec at {}",
|
|
out_path.display()
|
|
));
|
|
}
|
|
|
|
fn emit_stdout(message: &str) {
|
|
let mut out = io::stdout();
|
|
let _ = out.write_all(message.as_bytes());
|
|
let _ = out.write_all(b"\n");
|
|
let _ = out.flush();
|
|
}
|