mecha10-cli 0.6.5

Mecha10 CLI tool
Documentation
//! Dev mode operations (simulator, teleop, etc.)
//!
//! Helper functions for development mode operations.
//! Extracted from the dev handler to reduce complexity.
//!
//! Split into a few focused submodules, re-exported here so callers keep
//! using `ops::function_name` exactly as before:
//!
//! - [`setup`]: Docker services + Redis connection setup
//! - [`models`]: AI model availability checks before spawning nodes
//! - [`spawn`]: spawning nodes by name (node-runner or standalone)
//! - [`build`]: building node binaries before spawning
//! - [`lifecycle`]: watch mode, cleanup, and lifecycle mode changes
//! - [`interactive`]: the interactive TUI event loop
//! - [`health_tail`]: relays node-runner's health-check/restart log lines into the dev-mode
//!   TUI's log buffer (see LAB-1892)
//! - [`teleop`]: entering teleop control mode
//! - [`preflight`]: project-level Python dependency preflight gate, run once before any node
//!   is spawned (see LAB-1811)
//! - [`registry`]: `NodeRegistry`, the single owner of node PID/failure state (see LAB-1891)

mod build;
mod health_tail;
mod interactive;
mod lifecycle;
mod models;
mod preflight;
mod registry;
mod setup;
mod spawn;
mod teleop;

/// Strip a `@scope/name` node identifier down to its bare short name.
///
/// `NodeRegistry` (and, before it, the `pids`/`start_failures`/`last_known_failures`
/// collections it consolidates - see LAB-1891) is keyed by the full scoped identifier exactly as
/// it appears in `mecha10.json` (e.g. `@mecha10/teleop`) — see `spawn_node_runner`'s "Register
/// with full identifier ... for consistent tracking" — so any code that wants to match those
/// keys against a bare short name (e.g. `"teleop"`) needs to normalize first. This is the one
/// shared implementation - see `mecha10_cli_core::utils::strip_node_scope` for the canonical
/// definition; everywhere else that needs this calls through it too.
pub(crate) use mecha10_cli_core::utils::strip_node_scope;

pub use build::build_nodes;
pub use interactive::{run_interactive_mode, InteractiveModeConfig, InteractiveModeState};
pub use preflight::run_dependency_preflight;
#[allow(unused_imports)]
pub use registry::{NodeRegistry, NodeState};
pub use setup::{setup_redis_connection, start_docker_services};
pub(crate) use spawn::maybe_inject_teleop_locomotion_env;
#[allow(unused_imports)]
pub use spawn::SpawnOutcome;
pub use spawn::{spawn_nodes_by_name, SIM_VISIBLE_ENV_VAR};

#[allow(unused_imports)]
pub use lifecycle::cleanup;
pub use lifecycle::run_watch_mode;
#[allow(unused_imports)]
pub use teleop::enter_teleop_mode;