2026-05-31 16:23:11 +02:00
|
|
|
#!/usr/bin/env python3
|
2026-06-23 18:19:49 +02:00
|
|
|
"""Sample Pi agent — emits JSONL in the colibri-pi-events format.
|
2026-05-31 16:23:11 +02:00
|
|
|
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)
|