opencode-cloud-core 25.1.3

Core library for opencode-cloud - config management, singleton enforcement, and shared utilities
Documentation
//! opencode-cloud-core - Core library for opencode-cloud
//!
//! This library provides the shared functionality for both the Rust CLI
//! and Node.js bindings via NAPI-RS.

pub mod config;
pub mod docker;
pub mod host;
pub mod platform;
pub mod singleton;
pub mod version;

// Re-export version functions for Rust consumers
pub use version::{get_version, get_version_long};

// Re-export config types and functions
pub use config::{Config, get_hosts_path, load_config_or_default, save_config};

// Re-export singleton types
pub use singleton::{InstanceLock, SingletonError};

// Re-export docker types
pub use docker::{CONTAINER_NAME, DockerClient, DockerError, OPENCODE_WEB_PORT};

// Re-export platform types
pub use platform::{
    InstallResult, ServiceConfig, ServiceManager, get_service_manager,
    is_service_registration_supported,
};

// Re-export host types
pub use host::{
    DistroFamily, DistroInfo, HostConfig, HostError, HostsFile, SshConfigMatch, SshTunnel,
    detect_distro, get_docker_install_commands, get_ssh_config_path, host_exists_in_ssh_config,
    install_docker, load_hosts, query_ssh_config, save_hosts, test_connection,
    verify_docker_installed, write_ssh_config_entry,
};

// Re-export bollard to ensure all crates use the same version
pub use bollard;

// NAPI bindings for Node.js consumers (only when napi feature is enabled)
#[cfg(feature = "napi")]
use napi_derive::napi;

/// Get the version string for Node.js consumers
#[cfg(feature = "napi")]
#[napi]
pub fn get_version_js() -> String {
    get_version()
}

/// Get the long version string with build info for Node.js consumers
#[cfg(feature = "napi")]
#[napi]
pub fn get_version_long_js() -> String {
    get_version_long()
}