forked from 1b-agent/opencadstudio-upstream
feat(plugin): name-addressed XRecord CRUD on the HostApi (API v8)
Add create/read/update/delete/list for XRecord objects under named-object-dictionary paths to the plugin HostApi, with five additive PluginRequest/PluginResponse variants, dispatch through the shared handler, in-process HostSession methods and both out-of-process proxies. - dictionary paths walk from the NOD root; create seeds missing dictionaries (ensure_image_dictionary bootstrap) and refuses existing names; update refuses missing ones; refusals precede the undo step - entry group codes validated (1..=369, never 5/105); payload content is the plugin's own - each mutating call is one undo step: the pending history snapshot restores the objects map byte-exactly, auto-created dictionaries included (tested) - typed entries survive DWG and DXF write/reload round-trips (tested); update drops verbatim raw bytes so saves emit the new content - bump API_VERSION 7 -> 8 with the build.rs version_info in lockstep, mirroring the v7 addition; MIN_SUPPORTED stays 3
This commit is contained in:
1 parent
6cde0e02d8
commit
ca2f0c9857
11 files changed
+1212
-3
No files matched your search
@@ -200,6 +200,32 @@ pub enum PluginRequest {
|
||||
RunCommand {
|
||||
request: crate::host::CommandRequest,
|
||||
},
|
||||
/// V8 (additive): create an XRecord under a named-object-dictionary path.
|
||||
CreateXRecord {
|
||||
dictionary_path: Vec<String>,
|
||||
name: String,
|
||||
entries: Vec<crate::host::XRecordEntry>,
|
||||
},
|
||||
/// V8 (additive): read the entries of an existing XRecord.
|
||||
ReadXRecord {
|
||||
dictionary_path: Vec<String>,
|
||||
name: String,
|
||||
},
|
||||
/// V8 (additive): replace the entries of an existing XRecord.
|
||||
UpdateXRecord {
|
||||
dictionary_path: Vec<String>,
|
||||
name: String,
|
||||
entries: Vec<crate::host::XRecordEntry>,
|
||||
},
|
||||
/// V8 (additive): delete an XRecord and its dictionary entry.
|
||||
DeleteXRecord {
|
||||
dictionary_path: Vec<String>,
|
||||
name: String,
|
||||
},
|
||||
/// V8 (additive): list the XRecord names under a dictionary path.
|
||||
ListXRecords {
|
||||
dictionary_path: Vec<String>,
|
||||
},
|
||||
}
|
||||
|
||||
/// Responses the host sends back for `PluginRequest`.
|
||||
@@ -236,6 +262,16 @@ pub enum PluginResponse {
|
||||
SolidResult(Result<Handle, String>),
|
||||
TableResult(Result<Handle, String>),
|
||||
CommandResult(Result<crate::host::CommandOutcome, String>),
|
||||
/// V8 (additive): handle of a created XRecord.
|
||||
XRecordCreateResult(Result<Handle, String>),
|
||||
/// V8 (additive): entries of a read XRecord.
|
||||
XRecordEntries(Result<Vec<crate::host::XRecordEntry>, String>),
|
||||
/// V8 (additive): handle of an updated XRecord.
|
||||
XRecordUpdateResult(Result<Handle, String>),
|
||||
/// V8 (additive): the removed XRecord, with its prior content.
|
||||
XRecordDeleteResult(Result<crate::host::XRecord, String>),
|
||||
/// V8 (additive): XRecord names under a dictionary path.
|
||||
XRecordNames(Result<Vec<String>, String>),
|
||||
}
|
||||
|
||||
/// Messages sent from the host to the plugin runner.
|
||||
|
||||
Reference in new issue
Block a user