refactor(plugin): extract ocs_plugin_api crate for the stable add-on contract

Move the dependency-free, semver-versioned half of the plugin contract into a
standalone workspace crate `crates/ocs_plugin_api`:

- manifest types: PluginManifest, ApiVersion, API_VERSION
- ribbon vocabulary: CadModule trait + ToolDef/RibbonGroup/RibbonItem/IconKind/
  ModuleEvent/StyleKey

The host re-exports them from `crate::plugin::manifest` and `crate::modules`, so
every existing call site is unchanged. The acadrust-typed runtime surface
(HostSession) stays in the host binary; lifting it behind a HostApi trait in the
same crate is the remaining phase-1b step.

Part of #100. Docs updated in docs/plugin-architecture.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Hakan Seven 2026-06-15 01:36:04 +03:00
commit 72ec1146df
9 changed files with 280 additions and 154 deletions

5
Cargo.lock generated
View file

@ -24,6 +24,7 @@ dependencies = [
"image",
"inventory",
"lzma-sys",
"ocs_plugin_api",
"open",
"printpdf",
"rayon",
@ -3646,6 +3647,10 @@ dependencies = [
"objc2-foundation 0.2.2",
]
[[package]]
name = "ocs_plugin_api"
version = "0.1.0"
[[package]]
name = "once_cell"
version = "1.21.4"