kumiho-construct 2026.4.28

Construct — memory-native AI agent runtime powered by Kumiho
Documentation
//! `construct install` — unified post-build install flow.
//!
//! Today only the `--sidecars-only` path is implemented: it provisions the
//! Kumiho + Operator Python MCP sidecars under `~/.construct/`. The full
//! install flow (prerequisite checks, onboard, dashboard launch) will migrate
//! into this module over time; until then, `install.sh` / `setup.bat` remain
//! canonical for a full install.

use anyhow::{Result, anyhow};

use crate::sidecars::{self, SidecarInstallOptions};

/// Options for `construct install`.
#[derive(Debug, Default, Clone)]
pub struct InstallOptions {
    /// Install only the Python MCP sidecars (Kumiho + Operator).
    pub sidecars_only: bool,
    /// Skip installing the Kumiho sidecar.
    pub skip_kumiho: bool,
    /// Skip installing the Operator sidecar.
    pub skip_operator: bool,
    /// Print what would be done without executing.
    pub dry_run: bool,
    /// Optional explicit Python interpreter.
    pub python: Option<String>,
}

/// Run the install command with the given options.
pub async fn run(opts: InstallOptions) -> Result<()> {
    if !opts.sidecars_only {
        return Err(anyhow!(
            "Full install is not yet implemented as a Rust subcommand.\n\
             Use one of:\n  \
               construct install --sidecars-only    # install Kumiho + Operator Python MCP sidecars\n  \
               ./install.sh                         # full POSIX install (source build + sidecars + onboard)\n  \
               setup.bat                            # full Windows install"
        ));
    }

    sidecars::install_sidecars(&SidecarInstallOptions {
        skip_kumiho: opts.skip_kumiho,
        skip_operator: opts.skip_operator,
        dry_run: opts.dry_run,
        python: opts.python,
    })
    .await
}