forked from 1b-agent/opencadstudio-upstream
feat(mcp): declarative op table and per-variant request validation
- Define Ty, Param, Rule, and OpDef in src/mcp_ops.rs for all 39 mutations - Generate Draft 2020-12 schema using per-op anyOf variants with op enum discriminators - Disambiguate colliding properties (replace, center, name) across mutation variants - Add pre-dispatch validator enforcing required fields, rules, and parameter types - Emit unknown parameter warnings into response warnings - Introduce target_document_id for entities_copy_to with deprecated document_id fallback - Update unit tests and automation smoke assertions
This commit is contained in:
1 parent
74c48ff5e3
commit
6951cc2a7a
5 files changed
+1169
-411
No files matched your search
@@ -231,8 +231,9 @@ impl OpenCADStudio {
|
||||
req: &Value,
|
||||
) -> Result<Task<Message>, Value> {
|
||||
let handles = crate::app::control::entities::hex_handles(req, "handles")?;
|
||||
let target = req["document_id"]
|
||||
let target = req["target_document_id"]
|
||||
.as_u64()
|
||||
.or_else(|| req["document_id"].as_u64())
|
||||
.ok_or_else(|| failure("document_required", "Supply the target document_id"))?;
|
||||
let source_index = self.active_tab;
|
||||
let target_index = self
|
||||
|
||||
Reference in new issue
Block a user