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
@@ -6,3 +6,12 @@ description = "Stable, dependency-free contract for Open CAD Studio add-on packa
|
||||
license = "GPL-3.0-only"
|
||||
|
||||
[dependencies]
|
||||
# Pulled in only by the `host` feature, which adds the `acadrust`-typed
|
||||
# `HostApi` runtime surface. The default crate stays dependency-free so engine
|
||||
# crates and external tooling can depend on the manifest/ribbon contract cheaply.
|
||||
acadrust = { version = "0.3.4", optional = true }
|
||||
|
||||
[features]
|
||||
# Enables the runtime host surface (`HostApi` trait). The OpenCADStudio binary
|
||||
# turns this on; pure-data consumers leave it off.
|
||||
host = ["dep:acadrust"]
|
||||
Reference in new issue
Block a user