#!/usr/bin/env bash # scripts/connect/connect-name.sh — S7: Name / profile connect helper # # Guides the operator through naming the assistant and setting the profile. # The assistant name becomes the NemoClaw sandbox display identity. # # Platform-first: uses nemohermes for sandbox operations. # # Usage: # ./scripts/connect/connect-name.sh [--dry-run|--apply] # ./scripts/connect/connect-name.sh --help set -euo pipefail SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" # Source shared helpers # shellcheck source=../lib/common.sh source "$SCRIPT_DIR/../lib/common.sh" # shellcheck source=../lib/env.sh source "$SCRIPT_DIR/../lib/env.sh" # shellcheck source=../lib/connect_state.sh source "$SCRIPT_DIR/../lib/connect_state.sh" # ── Defaults ─────────────────────────────────────────────────────────────── DRY_RUN=1 APPLY=0 # ── Parse args ───────────────────────────────────────────────────────────── while [[ $# -gt 0 ]]; do case "$1" in --help|-h) cat </dev/null 2>&1; then log_info "Sandbox '$SANDBOX_NAME' is reachable." else log_warn "Sandbox '$SANDBOX_NAME' not found. Run S4 (sandbox onboard) first." if [[ $APPLY -eq 1 ]]; then set_status "name" "error" "Sandbox not found — run S4 first" fi exit 1 fi else log_warn "nemohermes not available — cannot verify sandbox" fi # ── Name guidance ────────────────────────────────────────────────────────── log_info "" log_info "The assistant name is the display identity the owner sees." log_info "It is stored as LUMINA_SANDBOX in .env and used by nemohermes." log_info "" log_info "Platform naming rules:" log_info " - Lowercase letters, digits, hyphens, underscores" log_info " - 1-63 characters" log_info " - Must be unique within the NemoClaw registry" log_info "" # ── Rename (if --apply and operator wants to change) ─────────────────────── if [[ $APPLY -eq 1 ]]; then log_info "Current name: $SANDBOX_NAME" log_info "" log_info "To rename the assistant:" log_info " 1. Edit LUMINA_SANDBOX in .env" log_info " 2. Run: nemohermes onboard (creates new sandbox)" log_info " 3. Re-run S5 (policy + skills) for the new sandbox" log_info "" log_warn "Renaming requires creating a new sandbox. The old sandbox is NOT" log_warn "automatically deleted. Delete it manually if no longer needed." log_info "" # For now, we record the name as connected if sandbox exists set_status "name" "connected" "Sandbox '$SANDBOX_NAME' verified" log_info "Name status recorded as connected." else log_info "[DRY-RUN] Would verify sandbox name and record status." log_info "Use --apply to record the name status." fi # ── Profile guidance ─────────────────────────────────────────────────────── log_info "" log_info "Profile intake (business name, timezone, hours, priorities, hard rules)" log_info "is handled through the setup-education skill in the assistant chat." log_info "The operator does not need to configure this via scripts." if [[ $APPLY -eq 1 ]]; then # Check if profile status is already set profile_status="$(get_status "profile")" if [[ -z "$profile_status" ]]; then # Default: profile is handled by owner in chat, not operator script set_status "profile" "later" "Profile intake via setup-education skill in chat" fi fi log_info "Name / profile connect complete."