#!/usr/bin/env bash
# compute-team: Scan team/ profiles and room/ artifacts to produce TEAM-STATE.md
# A knowledge landscape context tool for Larry -- never productivity/attendance tracking
# Called by compute-state as a sub-step
#
# Usage: scripts/compute-team <room_dir>
# Output: Writes room/team/TEAM-STATE.md directly
# Exit: 0 on success, 1 on error. If no team/ directory, exit 0 silently.

# Phase 381: the work runs in lib/core/room-render.cjs (node 22.18.0 or later).
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if ! command -v node >/dev/null 2>&1; then
  echo "compute-team: node is not on PATH; this step needs Node.js 22.18.0 or later" >&2
  exit 1
fi
NODE_NO_WARNINGS=1 exec node "${SCRIPT_DIR}/../lib/core/room-render.cjs" team "$@"
