forked from 1b-agent/opencadstudio-upstream
feat(plugin): lift host surface behind a HostApi trait (phase 1b)
Plugins targeted the host's concrete HostSession type. Add a HostApi trait in ocs_plugin_api behind an optional `host` feature (the only thing that pulls acadrust, so the core crate stays dependency-free). HostSession implements it and BuiltinPlugin::dispatch now takes `&mut dyn HostApi`, so an out-of-tree add-on compiles against the contract crate alone. Per-tab plugin state is reached through object-safe plugin_state* helpers. Completes the phase-1 host-surface extraction in the #100 epic. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
1 parent
96ec672d5b
commit
5ccf5cfe36
12 files changed
+231
-22
No files matched your search
+1
-1
@@ -24,7 +24,7 @@ solid3d = ["dep:truck-meshalgo", "dep:truck-shapeops", "dep:lzma-sys"]
|
||||
[dependencies]
|
||||
# Stable, dependency-free add-on contract (manifest + ribbon/CadModule types).
|
||||
# Plugin authors target this crate's semver, not OpenCADStudio internals.
|
||||
ocs_plugin_api = { path = "crates/ocs_plugin_api" }
|
||||
ocs_plugin_api = { path = "crates/ocs_plugin_api", features = ["host"] }
|
||||
# vtkio (pulled in transitively via truck-meshalgo) depends on xz2 → lzma-sys,
|
||||
# which by default links the system liblzma dynamically. On macOS that bakes a
|
||||
# Homebrew dylib path (/opt/homebrew/.../liblzma.5.dylib) into the binary, so
|
||||
|
||||
Reference in new issue
Block a user