#!/bin/bash
# Start the Teams channel webhook server (standalone, no MCP)
set -euo pipefail

DIR="$(cd "$(dirname "$0")" && pwd)"
cd "$DIR"

# Load env from .env if present
if [ -f "$DIR/.env" ]; then
  set -a
  source "$DIR/.env"
  set +a
fi

export MSTEAMS_APP_ID="${MSTEAMS_APP_ID:-e6981a53-9d31-4502-a965-5ff7799d8d0c}"
export MSTEAMS_APP_PASSWORD="${MSTEAMS_APP_PASSWORD:-}"
export MSTEAMS_TENANT_ID="${MSTEAMS_TENANT_ID:-707a7153-af93-4b65-ae01-bfa6febbffdb}"
export MSTEAMS_WEBHOOK_PORT="${MSTEAMS_WEBHOOK_PORT:-3978}"

exec /Users/Work/.bun/bin/bun run "$DIR/server.ts"
