forked from 1b-agent/opencadstudio-upstream
feat(mcp): implement 4-pillar auto-sync, dynamic introspection, and non-blocking validation
- Pillar 1 (Runtime Auto-Sync): * Add sync_agent_tool_schemas() in src/mcp.rs to atomically export live tool schemas & instructions to ~/.gemini/antigravity/mcp/opencadstudio/ * Automatically invoke sync on MCP startup (mcp::run()) and GUI automation startup (transport::listen()) * Add --sync-mcp-schemas CLI flag in src/cli.rs and src/main.rs - Pillar 2 (Development Hook): * Strengthen export_agent_tool_schemas test in src/mcp.rs to assert all schema files and instructions.md exist and are in sync on every cargo test run - Pillar 3 (In-Band Dynamic Introspection): * Add 'tools' to READ_OPS in src/mcp.rs and query match in src/app/control/mod.rs * Enable agents to dynamically query live tool definitions and instructions via ocs_read (op: 'tools') over MCP or raw socket - Pillar 4 (Non-Blocking Validation): * Set additionalProperties: true on ocs_capture schema in src/mcp.rs to prevent rigid schema rejection of emerging options
This commit is contained in:
1 parent
3c1c1364c6
commit
9d53502b19
5 files changed
+114
-15
No files matched your search
+10
@@ -67,6 +67,16 @@ fn main() -> iced::Result {
|
||||
std::process::exit(if ok { 0 } else { 1 });
|
||||
}
|
||||
|
||||
if args.sync_mcp_schemas {
|
||||
let synced = mcp::sync_agent_tool_schemas();
|
||||
if synced {
|
||||
println!("Successfully synchronized OpenCADStudio MCP schemas to ~/.gemini/antigravity/mcp/opencadstudio/");
|
||||
} else {
|
||||
eprintln!("Antigravity MCP directory ~/.gemini/antigravity/mcp/ not found; skipped sync.");
|
||||
}
|
||||
return Ok(());
|
||||
}
|
||||
|
||||
// MCP is a client-neutral local entry point. It uses only stdin,
|
||||
// stdout and the authenticated GUI bridge, so it must run before any
|
||||
// logging or graphics setup can write to the protocol stream.
|
||||
|
||||
Reference in new issue
Block a user