Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Principle:1ay1 Agentty Editor Integration Via Protocol

From Leeroopedia
Knowledge Sources
Domains Protocols, IDE_Integration
Last Updated 2026-10-28 12:00 GMT

Overview

Architecture where an AI agent exposes its capabilities to an editor (like Zed) through a stdio JSON-RPC protocol with session lifecycle, live configuration, and streaming turn notifications — letting the editor's native UI drive the agent.

Description

Instead of building a custom UI, the agent acts as a server speaking the Agent Client Protocol (ACP) over stdio JSON-RPC. The editor is the client: it sends initialize (handshake + capability negotiation), session/new (create a workspace session), session/prompt (run a turn), and session/set_config_option (change model/effort live).

The agent streams progress back as session/update notifications: messages, tool calls, thoughts, and checkpoints — so the editor's native composer, tool-call cards, and reasoning panels render the turn in real time. The reply to session/prompt is deferred: it arrives when the turn settles, not when it starts.

This decouples the agent's runtime from any single editor: any client that speaks ACP gets the same experience. The protocol version is negotiated (min of client + server), and capability flags gate which notifications the server emits.

Usage

Use this principle when:

  • An AI agent must integrate with editors rather than ship its own TUI
  • Live session state (messages, tools, thoughts) must stream to the client
  • Session lifecycle (create, resume, load, fork) must be protocol-driven

Theoretical Basis

serve:Channel→int(stdio JSON-RPC loop)

# Abstract protocol flow (NOT real implementation)
# Editor (client)                    Agent (server)
# -----------                        -------------
# -> initialize(params)              <- on_initialize -> result
# -> session/new(params)            <- on_new_session -> result
#                                   <- session/update (config options)
# -> session/prompt(text)           <- (deferred reply)
#                                   <- session/update (messages, tools)
#                                   <- session/update (thoughts)
#                                   <- session/prompt result (settled)
# -> session/set_config_option      <- on_set_config_option -> result
#                                   <- session/update (config echo)

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment