Shared Rust crate for:
- OpenVCS plugins (JSON-RPC over stdio)
- The OpenVCS client/host (shared models + backend trait surface)
plugin-protocol(default): JSON-RPC wire types + plugin helper modules:openvcs_core::plugin_protocol(PluginMessage,RpcRequest,RpcResponse)openvcs_core::plugin_stdio(read/write helpers,respond_shared, host calls)openvcs_core::plugin_runtime(simple request dispatch loop + handler registry)openvcs_core::events(host event subscribe/emit helpers)openvcs_core::host(bridge for calling the host over stdio)
vcs: the backend trait surface:openvcs_core::Vcs,openvcs_core::VcsError,openvcs_core::Resultopenvcs_core::models(shared request/response/event types)- enables
backend-registry
backend-registry: link-time backend discovery viaopenvcs_core::backend_descriptor::BACKENDS- intended to be enabled together with
vcs - on
wasm32, the registry is always empty (nolinkmesupport)
- intended to be enabled together with
Register one or more RPC handlers and run the dispatch loop:
use openvcs_core::plugin_runtime::{register_delegate, run_registered};
use openvcs_core::plugin_stdio::ok;
fn main() -> std::io::Result<()> {
register_delegate("ping", |_ctx, _req| ok(serde_json::json!({ "pong": true })));
run_registered()
}Notes:
openvcs_core::{trace, debug, info, warn, error}forward logs to the OpenVCS host when available (and also emit normallogrecords).- Host calls from plugins go through
openvcs_core::host::call(...)(the runtime initializes the host bridge for stdio). OPENVCS_PLUGIN_HOST_TIMEOUT_MScontrols host call timeouts (default: 60000ms).
Common checks (matches CI):
just fix(runs rustfmt + clippy)cargo fmt --all -- --checkcargo clippy --all-targets --all-features -- -D warningscargo check --all-targets --all-featurescargo testcargo test --no-default-features --features plugin-protocol,vcs,backend-registrycargo package
GPL-3.0-or-later (see LICENSE).