Skip to content

Epic: TUI remote connection to daemon via A2A protocol #581

@bug-ops

Description

@bug-ops

Overview

Enable TUI client to connect to a headless Zeph daemon via A2A protocol. The daemon runs as a background process exposing an A2A endpoint with full agent capabilities (skills, memory, tools, MCP). The TUI connects as an A2A client with SSE streaming for real-time token-by-token responses.

Architecture

DAEMON (--daemon):
  main() → run_daemon()
    ├─ Full AppBuilder bootstrap (provider, memory, skills, tools, MCP)
    ├─ write_pid_file()
    ├─ LoopbackChannel pair → Agent task (agent.run())
    ├─ StreamingTaskProcessor → A2A server (SSE per-token artifacts)
    ├─ DaemonSupervisor manages components
    └─ Ctrl-C → shutdown + remove_pid_file()

REMOTE TUI (--connect <url>):
  main() → run_tui_remote(url)
    ├─ A2aClient (ssrf bypass for localhost)
    ├─ context_id per session
    ├─ TUI App (standard rendering)
    └─ SSE pump: user input → stream_message() → TaskEvent → AgentEvent

Key Decisions

  • Headless daemon (no fork/setsid) — user manages background via nohup/systemd/launchd
  • Single client at a time — requests serialized via LoopbackChannel
  • Token-level SSE streaming from first release
  • LoopbackChannel in zeph-core — zero new deps, follows existing Channel pattern
  • SSRF bypass via existing with_security(false, false) API

Issues

Implementation Order

#582 (LoopbackChannel) → #583 (StreamingTaskProcessor) → #584 (--daemon) → #585 (--connect)
                                                                              ↑
                                                                    #678 (command palette) ─┘

#678 can be implemented in parallel with #584/#585, but daemon commands activate only when #585 lands.

Recent Refactors Impacting This Epic

PR Impact
#675 agent module decomposition LoopbackChannel placement in channel.rs confirmed valid
#676 typed errors (thiserror) All new code must use typed errors, not anyhow
#672 SSRF hardening with_security() API available for localhost bypass in --connect
#615 crossterm CLI Channel trait unchanged, no impact

Design

.local/plan/precious-dreaming-boole.md

Sub-issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    a2aA2A protocol integrationepicMilestone-level tracking issuefeatureNew functionalitytuiTUI dashboard

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions