scripts: run_demo.sh launcher (no python on PATH needed), friendly port-in-use check in run_bridge.sh; README updated

This commit is contained in:
opencode
2026-08-08 11:48:16 +03:00
parent 4ced623b55
commit c224595f49
4 changed files with 42 additions and 10 deletions
+18
View File
@@ -1,7 +1,25 @@
#!/usr/bin/env bash
# Start the AICC capsule testbed bridge over WebSocket (headless).
# Usage: scripts/run_bridge.sh [port] (default 8765)
# Note: the bridge keeps running until interrupted (Ctrl-C).
set -euo pipefail
cd "$(dirname "$0")/.."
PORT="${1:-8765}"
if python3 - "$PORT" <<'EOF'
import socket, sys
port = int(sys.argv[1])
s = socket.socket()
if s.connect_ex(("127.0.0.1", port)) == 0:
print(f"port {port} is already in use")
sys.exit(1)
EOF
then
:
else
echo "error: a bridge may already be running on port $PORT." >&2
echo "stop it first, e.g.: fuser -k ${PORT}/tcp (or kill the run_bridge.sh process)" >&2
exit 1
fi
exec testbed/.venv/bin/python -m testbed.bridge --host 127.0.0.1 --port "$PORT"
+9
View File
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
# Run the AICC capsule demo (agent drives the capsule to the beacon).
# Usage: scripts/run_demo.sh [demo args...]
# e.g. scripts/run_demo.sh --agent auto
# scripts/run_demo.sh --agent scripted
# scripts/run_demo.sh --agent llm --model gemma4:e2b
set -euo pipefail
cd "$(dirname "$0")/.."
exec testbed/.venv/bin/python -m testbed.demo "$@"
+1 -1
View File
@@ -14,5 +14,5 @@ pip install pillow websockets openai pytest pytest-asyncio
echo "Setup done. Activate with: source testbed/.venv/bin/activate"
echo "Run the bridge: scripts/run_bridge.sh"
echo "Run the demo: testbed/.venv/bin/python -m testbed.demo --agent auto"
echo "Run the demo: scripts/run_demo.sh --agent auto"
echo "Conformance: testbed/.venv/bin/python -m testbed.conformance ~/Desktop/aicc-spec/conformance/scenarios"