Skip to content

nuskey8/acp-csharp

Repository files navigation

AgentClientProtocol for C#

Unofficial C# SDK for ACP (Agent Client Protocol) clients and agents

NuGet Releases license

What's Agent Client Protocol?

Agent Client Protocol is a protocol proposed by Zed to standardize communication between code editors/IDEs and coding agents.

ACP solves this by providing a standardized protocol for agent-editor communication, similar to how the Language Server Protocol (LSP) standardized language server integration.

Please refer to the official documentation for details.

Installation

.NET CLI

dotnet add package AgentClientProtocol

Package Manager

Install-Package AgentClientProtocol

Quick Start

Client

class ExampleClient : IAcpClient { ... }
var client = new ExampleClient();

using var conn = new ClientSideConnection( _ => client, reader, writer);

conn.Open();

var initResult = await conn.InitializeAsync(new InitializeRequest
{
    ProtocolVersion = 1,
    ClientCapabilities = new ClientCapabilities
    {
        Fs = new FileSystemCapability
        {
            ReadTextFile = true,
            WriteTextFile = true
        }
    }
});

Console.WriteLine($"Connected to agent (protocol v{initResult.ProtocolVersion})");

Agent

class ExampleClient : IAcpAgent { ... }
var agent = new ExampleAgent();
using var conn = new AgentSideConnection(agent, reader, writer);
conn.Open();

await Task.Delay(-1);

License

This library is under the MIT License.

About

Unofficial C# SDK for ACP (Agent Client Protocol) clients and agents

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages