colibri/scripts/sample-pi-agent.py

26 lines
686 B
Python
Raw Permalink Normal View History

#!/usr/bin/env python3
"""Sample Pi agent — emits JSONL in the colibri-pi-events format.
Used by Colibri integration tests to validate the spawn JSONL glasspane path.
"""
import sys
import json
import time
messages = [
{"type": "session", "id": f"pi-test-{int(time.time())}", "cwd": "/tmp"},
{"type": "agent_start"},
{"type": "turn_start"},
{"type": "message_start"},
{"type": "message_update", "delta": "Processing task..."},
{"type": "message_end"},
{"type": "turn_end", "stop": "end_turn"},
{"type": "agent_end"},
]
for msg in messages:
sys.stdout.write(json.dumps(msg) + "\n")
sys.stdout.flush()
time.sleep(0.01)
sys.exit(0)