forked from 1b-agent/opencadstudio-upstream
New crate crates/ocs_doc_api: object-centric facade (DocApi -> Document -> collections -> typed handles), transport-agnostic wire layer (DocApiEnvelope = single op | read-only query batch), per-op autocommit (no write transactions), bulk ops with upfront-validation all-or-nothing, structured ApiError, and build-time codegen (spec/entities.toml -> ops/query enums, api_reference.md, binding_schema.json). ocs_plugin_api: append-only PluginRequest::DocApiRequest / PluginResponse:: DocApiResponse (serde_bytes payload) + defaulted HostApi::doc_api_dispatch. Host: DocApiBackend impl for HostSession (src/app/doc_api.rs) mapping to scene primitives (solid_models lift-on-miss, register_prepared_solid_model, meshes metrics), entity conversions (doc_api_convert.rs), HostSession accessors + doc_api_dispatch override. Tests: 592 host lib (incl. 7 DocApi integration tests: create/boolean/query, unknown-id, transform-many all-or-nothing, query-batch cap, 2D/geometric/DWG roundtrips), 8 crate unit tests. Examples + README/ARCHITECTURE/IMPLEMENTATION docs.
43 lines
1.8 KiB
TOML
43 lines
1.8 KiB
TOML
[package]
|
|
name = "ocs_doc_api"
|
|
version = "0.1.0"
|
|
edition = "2021"
|
|
description = "Object-oriented, transport-agnostic CAD entity API for OpenCADStudio plugins and hosts (v2)."
|
|
license = "MIT"
|
|
build = "build.rs"
|
|
|
|
# Dependency wiring (plan §2 decision #2): pin the SAME cadkernel/acadrust git revs
|
|
# as the host so `Body`/`EntityType` types are ABI-identical.
|
|
[dependencies]
|
|
serde = { version = "1", features = ["derive"] }
|
|
bincode = "1.3"
|
|
thiserror = "1"
|
|
|
|
# acadrust is needed by the core DTOs (ObjectId = acadrust::Handle) and by the
|
|
# executor (EntityType). cadkernel is needed for solid geometry (host feature).
|
|
acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "5b56571a190e7a17c8f12d36390d2938b0fb72f7", features = ["serde"], optional = true }
|
|
cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "67f2427282d28922d9263e37b0136b6632e929b3", features = ["acis", "offset"], optional = true }
|
|
ocs_plugin_api = { path = "../ocs_plugin_api", optional = true, features = ["host"] }
|
|
|
|
[build-dependencies]
|
|
serde = { version = "1", features = ["derive"] }
|
|
serde_json = "1"
|
|
toml = "0.8"
|
|
|
|
[dev-dependencies]
|
|
serde_json = "1"
|
|
acadrust = { git = "https://github.com/HakanSeven12/cadcodec.git", rev = "5b56571a190e7a17c8f12d36390d2938b0fb72f7", features = ["serde"] }
|
|
cadkernel = { git = "https://github.com/HakanSeven12/cadkernel.git", rev = "67f2427282d28922d9263e37b0136b6632e929b3", features = ["acis", "offset"] }
|
|
|
|
[features]
|
|
# default: pure data types + spec (no heavy deps), per plan §14 open Q1.
|
|
default = []
|
|
# host: pull acadrust + cadkernel + the executor/backend trait (in-process side).
|
|
host = ["acadrust", "cadkernel"]
|
|
# ipc: pull ocs_plugin_api for the IPC transport adapter (plugin side).
|
|
ipc = ["acadrust", "ocs_plugin_api"]
|
|
|
|
[lib]
|
|
name = "ocs_doc_api"
|
|
path = "src/lib.rs"
|