steev/install.sh
Svrnty ff2b88a088 fix(steev): install.sh adds hermes-native profile install — dispatch-readiness
Mirror curator + CTO + CMO + CEO fix: append `hermes profile install "$REPO" --yes --force`.
Without this, steev couldn't register in kanban assignees registry.

Done block: verify skills + assignee + gateway-start hint.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-24 13:03:19 -04:00

73 lines
2.4 KiB
Bash
Executable File

#!/usr/bin/env bash
# install.sh — wire Steev profile distribution into Hermes.
# Idempotent. Does NOT set secrets and does NOT enable cron.
#
# ./install.sh [--copy] [--dry-run]
#
# Default = SYMLINK mode: the repo is canonical, ~/.hermes/steev → this repo.
# --copy = copy files into ~/.hermes/steev instead.
set -euo pipefail
REPO="$(cd "$(dirname "$0")" && pwd)"
HERMES_HOME="${HERMES_HOME:-$HOME/.hermes}"
MODE=symlink; DRY=0
while [ $# -gt 0 ]; do case "$1" in
--copy) MODE=copy ;; --dry-run) DRY=1 ;;
*) echo "unknown arg: $1"; exit 2 ;;
esac; shift; done
CFG="$HERMES_HOME/profiles/steev/config.yaml"
run() { if [ "$DRY" = 1 ]; then echo "DRY: $*"; else eval "$*"; fi; }
echo "== preflight =="
for c in python3 sqlite3; do command -v "$c" >/dev/null || { echo "MISSING: $c"; exit 1; }; done
echo "== link/copy repo → \$HERMES_HOME/steev ($MODE) =="
if [ "$MODE" = symlink ]; then
if [ -e "$HERMES_HOME/steev" ] && [ ! -L "$HERMES_HOME/steev" ]; then
echo "EXISTS (not a symlink): $HERMES_HOME/steev — remove it and re-run"; exit 1
fi
run "ln -sfn '$REPO' '$HERMES_HOME/steev'"
else
run "mkdir -p '$HERMES_HOME/steev'"
run "cp -r '$REPO'/skills '$REPO'/schema.sql '$HERMES_HOME/steev/'"
fi
echo "== register skills in steev profile config =="
SKILL_DIR="$REPO/skills"
if [ "$DRY" = 0 ]; then
python3 - "$CFG" "$SKILL_DIR" <<'PY'
import sys, os, yaml
cfg, sk = sys.argv[1], sys.argv[2]
d = yaml.safe_load(open(cfg).read()) if os.path.exists(cfg) else {}
d = d or {}
d.setdefault('skills', {}).setdefault('external_dirs', [])
if sk not in d['skills']['external_dirs']:
d['skills']['external_dirs'].append(sk)
open(cfg, 'w').write(yaml.dump(d, sort_keys=False, allow_unicode=True))
print(" +", sk)
else:
print(" already registered:", sk)
PY
else
echo "DRY: register $SKILL_DIR in $CFG"
fi
echo "== steev.db =="
run "sqlite3 '$HERMES_HOME/steev/steev.db' < '$REPO/schema.sql'"
echo ""
echo "== hermes-native profile install (dispatch-readiness) =="
if [ "$DRY" = 1 ]; then
echo "DRY: hermes profile install '$REPO' --yes --force"
else
hermes profile install "$REPO" --yes --force 2>&1 | tail -5 || \
echo " WARN: hermes profile install failed (legacy symlink still works)"
fi
echo ""
echo "== done =="
echo " verify skills: hermes -p steev skills list | grep steev-agent"
echo " verify assignee registered: hermes kanban assignees | grep steev"
echo " start gateway (when ready): hermes profile gateway start steev"