mirror of
https://github.com/harivansh-afk/sandbox-agent.git
synced 2026-04-17 08:01:03 +00:00
feat: expand api snapshots and schema tooling
This commit is contained in:
parent
ee014b0838
commit
011ca27287
72 changed files with 29480 additions and 1081 deletions
26
server/packages/universal-schema-gen/build.rs
Normal file
26
server/packages/universal-schema-gen/build.rs
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
use std::{fs, path::Path};
|
||||
|
||||
fn main() {
|
||||
println!("cargo:rerun-if-changed=../universal-agent-schema/src/lib.rs");
|
||||
|
||||
let schema = schemars::schema_for!(sandbox_agent_universal_agent_schema::UniversalEvent);
|
||||
|
||||
let workspace_root = std::env::var("CARGO_MANIFEST_DIR")
|
||||
.map(|dir| {
|
||||
Path::new(&dir)
|
||||
.parent()
|
||||
.unwrap()
|
||||
.parent()
|
||||
.unwrap()
|
||||
.parent()
|
||||
.unwrap()
|
||||
.to_path_buf()
|
||||
})
|
||||
.unwrap();
|
||||
let out_dir = workspace_root.join("spec");
|
||||
fs::create_dir_all(&out_dir).unwrap();
|
||||
|
||||
let json = serde_json::to_string_pretty(&schema).expect("Failed to serialize JSON schema");
|
||||
fs::write(out_dir.join("universal-schema.json"), json)
|
||||
.expect("Failed to write universal-schema.json");
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue