feat(cli): add A2A HTTP listener for external message injection in Forever Mode

Embed a JSON-RPC 2.0 HTTP server that bridges A2A protocol messages into
the interactive session. Starts automatically in Forever Mode, binds to
127.0.0.1 on a configurable port (sisyphusMode.a2aPort), and writes a
port discovery file to ~/.gemini/sessions/.

Supported methods: message/send (blocking), tasks/get, responses/poll,
and GET /.well-known/agent-card.json.

- Add ExternalMessage and A2AListenerStarted app events
- Track streaming state transitions to capture agent responses
- Display A2A port in StatusDisplay when active
This commit is contained in:
Sandy Tao
2026-03-09 19:31:57 -07:00
parent 5194cef9c1
commit c83d368e2c
9 changed files with 561 additions and 0 deletions

View File

@@ -223,6 +223,7 @@ export interface UIState {
showIsExpandableHint: boolean;
hintMode: boolean;
hintBuffer: string;
a2aListenerPort: number | null;
transientMessage: {
text: string;
type: TransientMessageType;