#!/usr/bin/env bash
#
# Simple tmux session starter for ArchitectOS.
# Usage:
#   aos-tmux [session-name]
#
set -euo pipefail

SESSION_NAME="${1:-architectos}"

if ! command -v tmux >/dev/null 2>&1; then
  echo "[aos-tmux] tmux is not installed or not on PATH." >&2
  exit 1
fi

# Reuse existing session if it exists, otherwise create one.
if tmux has-session -t "$SESSION_NAME" 2>/dev/null; then
  tmux attach -t "$SESSION_NAME"
else
  tmux new-session -s "$SESSION_NAME" "aos info; bash"
fi
