#!/usr/bin/env bash # Entrypoints logici del container thothii-core: # server (default) | check | tht | preprocess # THT_CONFIG punta al workspace attivo (local.yaml nel deploy co-locato). set -euo pipefail export THT_CONFIG="${THT_CONFIG:-/app/harness/workspaces/local.yaml}" cmd="${1:-server}" case "$cmd" in check) # Diagnostica di wiring: validazione config/env + ping DWH (read-only). shift tht config check -c "$THT_CONFIG" tht db ping -c "$THT_CONFIG" || echo "(db ping non verde: verificare .env/ruoli/VPN)" ;; tht) shift exec tht "$@" ;; preprocess) shift exec tht evidence index "$@" ;; *) exec "$@" ;; esac