feat: casan chat optz

This commit is contained in:
thanhnv
2026-07-19 12:14:12 +07:00
parent 709b6cccd6
commit f462079435
16 changed files with 486 additions and 90 deletions
@@ -14,6 +14,16 @@ set -uo pipefail
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/casan-paths.sh"
PROJECT_ROOT="$CASAN_APP_ROOT"
PYTHON_BIN="${CASAN_PYTHON_BIN:-}"
if [[ -z "$PYTHON_BIN" ]]; then
for candidate in /usr/bin/python3 python3 python; do
if command -v "$candidate" >/dev/null 2>&1 && "$candidate" --version >/dev/null 2>&1; then
PYTHON_BIN="$candidate"
break
fi
done
fi
[[ -n "$PYTHON_BIN" ]] || { echo "PATH_GUARD_RUNTIME_UNAVAILABLE" >&2; exit 69; }
TARGET="${1:-}"
ROOT="${2:-$PROJECT_ROOT}"
@@ -22,7 +32,7 @@ if [[ -z "$TARGET" ]]; then
exit 64
fi
python3 - "$TARGET" "$ROOT" <<'PY'
"$PYTHON_BIN" - "$TARGET" "$ROOT" <<'PY'
import os
import sys