#!/usr/bin/env nu

# Service Management Module
# Exports all service management functionality

# services/ subsystem facade — selective re-exports (ADR-025 Phase 3 Layer 3).

# Core service management
export use manager.nu [
    check-service-health get-service-definition get-service-logs
    get-service-status init-service-state is-service-running list-all-services
    list-running-services load-service-registry restart-service start-service
    stop-service wait-for-service-health
]

# Service lifecycle
export use lifecycle.nu [
    get-service-pid kill-service-process start-service-by-mode stop-service-by-mode
]

# Health checks
export use health.nu [
    get-health-status monitor-service-health perform-health-check
    retry-health-check wait-for-service
]

# Pre-flight checks
export use preflight.nu [
    auto-start-required-services check-required-services check-service-conflicts
    get-readiness-report preflight-start-service validate-all-services
    validate-service-prerequisites
]

# Dependency resolution
export use dependencies.nu [
    can-stop-service get-dependency-tree get-reverse-dependencies
    get-startup-order resolve-dependencies start-services-with-deps
    validate-dependency-graph visualize-dependency-graph
]

# CLI commands (multi-word Nu subcommands)
export use commands.nu [
    "platform health" "platform logs" "platform restart" "platform start"
    "platform status" "platform stop" "platform update"
    "services check" "services dependencies" "services health" "services list"
    "services logs" "services monitor" "services readiness" "services restart"
    "services start" "services status" "services stop" "services validate"
]
