feat: node graph overlay; move to opencadcodec/opencadkernel/opencadgraph

The codec and kernel repositories and crates are renamed opencadcodec and
opencadkernel. Inside OCS they are depended on under short keys, so code
reads `codec::`, `kernel::` and the new `graph::` (opencadgraph, the node
graph engine). File-format and protocol spellings stay as they were: the
ACIS product id `acadrust`, the ACADRUST_* switches and the plugin
version keys `acadrust_version` / `acadrust_source`.

A button left of MCP on the command line opens a translucent node graph
over the viewport, with a palette of object, input, math, logic, list,
text and geometry nodes added by click or drag. An object node owns
drawing entities and its rows are the Properties panel's own rows for
them: the single-object page is extracted from refresh_properties as
entity_property_sections, values use the control protocol's
property_json, and writes go through set_property_value with a property
target override, so the panel, MCP and the graph share one read/write
path. A list reaching an object row makes one entity per element. Each
graph action is one undo step; the canvas pans and zooms.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Hakan SevenandClaude Opus 5.5 committed 2026-09-25 07:34:23 +03:00
1 parent 56c04408d6
commit f537aff75c
430 files changed
+9925 -8540

No files matched your search

+10 -10
View File
@@ -31,7 +31,7 @@ pub struct RegistryEntry {
pub struct ReleaseInfo {
pub tag: String,
pub api_version: u32,
/// Full `acadrust` git source used by the release.
/// Full `opencadcodec` git source used by the release.
pub acadrust_source: Option<String>,
/// Whether `[opencad]` declares `acadrust_source`.
pub acadrust_declared: bool,
@@ -57,7 +57,7 @@ pub struct ExternalPlugin {
/// an older `plugin.toml` does not declare `repository`.
pub repository: Option<String>,
pub api_version: u32,
/// Full `acadrust` git source used by the plugin.
/// Full `opencadcodec` git source used by the plugin.
pub acadrust_source: Option<String>,
/// Whether `[opencad]` declares `acadrust_source`.
pub acadrust_declared: bool,
@@ -434,7 +434,7 @@ mod loader {
&& d.acadrust_source.is_none()
{
eprintln!(
"[plugin] {} declares acadrust metadata but has no fingerprint; cannot verify compatibility",
"[plugin] {} declares opencadcodec metadata but has no fingerprint; cannot verify compatibility",
d.id
);
}
@@ -450,7 +450,7 @@ mod loader {
out.push((
d.id.clone(),
Err(format!(
"Plugin built for acadrust @{plugin_hash}, but this host uses @{host_hash}"
"Plugin built for opencadcodec @{plugin_hash}, but this host uses @{host_hash}"
)),
));
continue;
@@ -777,9 +777,9 @@ acadrust_source = "0123456789012345678901234567890123456789"
fn acadrust_mismatch_detected() {
let host = ocs_plugin_api::version_info::host_acadrust_source();
let other = if host.contains("94df2c3") {
"git+https://github.com/HakanSeven12/cadcodec.git?rev=0908da7#0908da7b6e4f702a6c78359a57f53e2b79cf39eb"
"git+https://github.com/HakanSeven12/opencadcodec.git?rev=0908da7#0908da7b6e4f702a6c78359a57f53e2b79cf39eb"
} else {
"git+https://github.com/HakanSeven12/cadcodec.git?rev=94df2c3#94df2c3f87fa051b16ffc3923f80e9247c85c5fd"
"git+https://github.com/HakanSeven12/opencadcodec.git?rev=94df2c3#94df2c3f87fa051b16ffc3923f80e9247c85c5fd"
};
let toml = format!(
r#"
@@ -795,7 +795,7 @@ acadrust_source = "{other}"
);
let p = parse_plugin_toml(&toml).expect("parsed");
assert!(p.acadrust_declared);
assert!(!p.acadrust_compatible(), "mismatched acadrust fingerprint should be incompatible");
assert!(!p.acadrust_compatible(), "mismatched opencadcodec fingerprint should be incompatible");
assert!(!p.loadable());
}
@@ -816,7 +816,7 @@ acadrust_source = "{host}"
);
let p = parse_plugin_toml(&toml).expect("parsed");
assert!(p.acadrust_declared);
assert!(p.acadrust_compatible(), "matching acadrust fingerprint should be compatible");
assert!(p.acadrust_compatible(), "matching opencadcodec fingerprint should be compatible");
}
#[test]
@@ -829,14 +829,14 @@ version = "0.1.0"
api_version = 2
[opencad]
acadrust_source = "git+https://github.com/HakanSeven12/cadcodec.git?rev=0908da7#0908da7b6e4f702a6c78359a57f53e2b79cf39eb"
acadrust_source = "git+https://github.com/HakanSeven12/opencadcodec.git?rev=0908da7#0908da7b6e4f702a6c78359a57f53e2b79cf39eb"
"#;
let mut p = parse_plugin_toml(toml).expect("parsed");
p.lib_present = true;
assert!(p.acadrust_declared);
assert!(
p.acadrust_compatible(),
"API v2 plugin should bypass acadrust gate"
"API v2 plugin should bypass opencadcodec gate"
);
assert!(p.loadable());
}
+4 -4
View File
@@ -312,7 +312,7 @@ fn download_bytes(url: &str) -> Result<Vec<u8>, String> {
}
/// Download and install a release's package into the plugins folder. Verifies
/// the API version and, when present, the `acadrust` fingerprint from the
/// the API version and, when present, the `opencadcodec` fingerprint from the
/// package's `plugin.toml` first. Returns the plugin id on success.
pub fn install(release: &Release, repository: &str) -> Result<String, String> {
let lib = release.lib_asset().ok_or("no library for this platform")?;
@@ -331,10 +331,10 @@ pub fn install(release: &Release, repository: &str) -> Result<String, String> {
if ocs_plugin_api::version_info::uses_acadrust_gate(manifest.api_version) {
let Some(source) = manifest.acadrust_source.as_deref() else {
return Err("Release has no acadrust source; cannot verify ABI compatibility".to_string());
return Err("Release has no opencadcodec source; cannot verify ABI compatibility".to_string());
};
if source.is_empty() {
return Err("Release has no acadrust source; cannot verify ABI compatibility".to_string());
return Err("Release has no opencadcodec source; cannot verify ABI compatibility".to_string());
}
if !ocs_plugin_api::version_info::acadrust_sources_compatible(
source,
@@ -346,7 +346,7 @@ pub fn install(release: &Release, repository: &str) -> Result<String, String> {
let host_hash = ocs_plugin_api::version_info::acadrust_source_hash(host_src)
.unwrap_or("unknown");
return Err(format!(
"Plugin built for acadrust @{plugin_hash}, but this host uses @{host_hash}"
"Plugin built for opencadcodec @{plugin_hash}, but this host uses @{host_hash}"
));
}
}
+3 -3
View File
@@ -14,7 +14,7 @@ fn mgr() -> std::sync::MutexGuard<'static, HostV4SnapshotManager> {
/// Open (or refresh) the V4 shared document view for `tab_id`.
pub fn open_document_view_v4(
tab_id: u64,
doc: &acadrust::CadDocument,
doc: &codec::CadDocument,
) -> Option<DocumentViewInfo> {
mgr().open(tab_id, doc)
}
@@ -26,7 +26,7 @@ pub fn close_document_view_v4(tab_id: u64) {
/// Publish the latest document to the V4 shared view for `tab_id` and broadcast
/// a change notification when successful.
pub fn publish_document_view_v4(tab_id: u64, doc: &acadrust::CadDocument) {
pub fn publish_document_view_v4(tab_id: u64, doc: &codec::CadDocument) {
let info = mgr().publish(tab_id, doc);
if let Some(info) = info {
broadcast(HostNotification::DocumentChangedV4 {
@@ -47,7 +47,7 @@ pub fn on_tab_closed(tab_id: u64) {
/// `HostNotification::SelectionChangedV4` carries the active tab id and the
/// current selection set. The caller is responsible for only calling this when
/// the selection actually changed; see `OpenCADStudio::notify_plugins_selection_changed`.
pub fn publish_selection_changed_v4(tab_id: u64, handles: Vec<acadrust::Handle>) {
pub fn publish_selection_changed_v4(tab_id: u64, handles: Vec<codec::Handle>) {
broadcast(HostNotification::SelectionChangedV4 { tab_id, handles });
}