#!/usr/bin/env bash
set -euo pipefail
# Point to your API host; the local integration fixture listens on port 7073.
: "${AUTOMATIONGLANCE_API_BASE:=http://127.0.0.1:7073}"
: "${AUTOMATIONGLANCE_SESSION_ID:=documentation-local-session}"
# Generate JSON safely; never interpolate arbitrary input into a JSON string.
python3 - <<'JSON' | curl --fail-with-body -sS "$AUTOMATIONGLANCE_API_BASE/api/runSimulation" -H 'Content-Type: application/json' --data-binary @-
import json, os
print(json.dumps({"circuit": "qubits 2\nH 0\nCX 0 1\nMEASURE 0\nMEASURE 1", "shots": 1024, "seed": 42,
                  "sessionId": os.environ.get("AUTOMATIONGLANCE_SESSION_ID", "documentation-local-session")}))
JSON
