#!/usr/bin/env bash # stop-project.sh [agent...] — stop a fleet project's agents via its harness. # Mirror of start-project.sh; for an agent-orchestrator project that is `engine/agents.py down`. set -euo pipefail [ $# -ge 1 ] || { echo "usage: stop-project.sh [agent...]" >&2; exit 1; } NAME="$1"; shift || true source "$(dirname "$0")/_resolve.sh" IFS=$'\t' read -r LOCATION CONFIG HARNESS < <(resolve_project "$NAME") [ -d "$LOCATION" ] || { echo "stop-project: location not a local dir: $LOCATION" >&2; exit 1; } case "$HARNESS" in agent-orchestrator) echo "stop-project: $NAME → python3 engine/agents.py down $* (in $LOCATION)" ( cd "$LOCATION" && python3 engine/agents.py --config "$CONFIG" down "$@" );; *) echo "stop-project: harness '$HARNESS' is not agent-orchestrator — read its docs and drive it by hand." >&2; exit 2;; esac