[RFC/Feature] AGY CLI lacks structured observability layer for headless orchestration (Unlocking cross-platform agent ecosystems)

  1. Overview & Strategic Vision**
    We are attempting to integrate the AGY CLI into external orchestration systems (e.g., messaging platforms like QQ, WeChat, Slack) to utilize it as a foundational “terminal-level general assistant.”
    However, the current CLI design is purely terminal-bound. It does not expose any structured external state or event stream, making reliable headless integration impossible and artificially limiting its massive ecosystem potential.
    2. The Engineering Problem
    We attempted multiple integration approaches for long-running daemonization, including:
  • tmux-based bridging (capture-pane + send-keys)
  • PTY-based process wrapping
  • Output diffing and watermark extraction
    All approaches fail because AGY CLI output is strictly terminal-rendered text rather than a structured data stream. Key limitations include:
  • Opaque Execution States: No external approval or execution state exposure (e.g., pending “Yes/No” prompts cannot be deterministically detected).
  • Data Pollution: Output is heavily polluted by ANSI escape codes, spinner animations, and terminal overwrite behavior.
  • No Data Boundaries: No deterministic way to extract incremental responses.
    3. Conclusion
    This is not an implementation bug, but a critical missing observability layer in the CLI architecture. The CLI currently cannot be safely or reliably embedded into headless orchestration systems.
    4. Proposed Solution
    We propose adding a structured external interface to bypass the TUI renderer, such as:
  • Option A: A --json-stream mode for event-based CLI output (e.g., {“event”: “thinking”}, {“event”: “approval_required”}).
  • Option B: A native, append-only transcript.jsonl event ledger written during execution.
  • Option C: A lightweight IPC interface for state queries and approval injection.
    5. Ecosystem Impact
    Without a structured output contract, AGY CLI cannot be safely integrated into multi-agent systems, external messaging channels, or long-running autonomous workflows.
    Addressing this gap will transform AGY from a local interactive tool into a highly scalable, headless engine capable of powering cross-platform AI assistants.