openvcs-core

Crates.ioopenvcs-core
lib.rsopenvcs-core
version0.1.5
created_at2025-12-31 16:14:13.438153+00
updated_at2026-01-07 23:47:33.465155+00
descriptionCore types and traits for OpenVCS.
homepagehttps://bbgames.dev/
repositoryhttps://github.com/Open-VCS/OpenVCS-Core
max_upload_size
id2014950
size110,104
Jordon (Jordonbc)

documentation

README

OpenVCS Core (openvcs-core)

Dev CI (fast)

Shared Rust crate for:

  • OpenVCS plugins (JSON-RPC over stdio)
  • The OpenVCS client/host (shared models + backend trait surface)

Cargo features

  • 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::Result
    • openvcs_core::models (shared request/response/event types)
    • enables backend-registry
  • backend-registry: link-time backend discovery via openvcs_core::backend_descriptor::BACKENDS
    • intended to be enabled together with vcs
    • on wasm32, the registry is always empty (no linkme support)

Plugin quickstart (stdio JSON-RPC)

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 normal log records).
  • Host calls from plugins go through openvcs_core::host::call(...) (the runtime initializes the host bridge for stdio).
  • OPENVCS_PLUGIN_HOST_TIMEOUT_MS controls host call timeouts (default: 60000ms).

Development

Common checks (matches CI):

  • just fix (runs rustfmt + clippy)
  • cargo fmt --all -- --check
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo check --all-targets --all-features
  • cargo test
  • cargo test --no-default-features --features plugin-protocol,vcs,backend-registry
  • cargo package

License

GPL-3.0-or-later (see LICENSE).

Commit count: 55

cargo fmt