Acp.Net.Process 0.1.1

dotnet add package Acp.Net.Process --version 0.1.1
                    
NuGet\Install-Package Acp.Net.Process -Version 0.1.1
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Acp.Net.Process" Version="0.1.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Acp.Net.Process" Version="0.1.1" />
                    
Directory.Packages.props
<PackageReference Include="Acp.Net.Process" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Acp.Net.Process --version 0.1.1
                    
#r "nuget: Acp.Net.Process, 0.1.1"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Acp.Net.Process@0.1.1
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Acp.Net.Process&version=0.1.1
                    
Install as a Cake Addin
#tool nuget:?package=Acp.Net.Process&version=0.1.1
                    
Install as a Cake Tool

Acp.Net.Process

Process, runtime bridge, shutdown, and transcript helpers for .NET ACP integrations.

🇹🇷 Türkçe sürüm: README.tr.md

Minimal Runtime Policy Example

var runner = new AcpProcessRunner(new AcpProcessOptions
{
    AgentName = "my-acp-agent",
    Command = "python3",
    Arguments = ["agent.py"],
    TranscriptPath = "artifacts/agent-transcript.ndjson",
    RunArtifactPath = "artifacts/agent-run.json",
    RequiredTools =
    [
        AcpRequiredExecutable.Throw("python3"),
        AcpRequiredExecutable.Warn("rg")
    ]
});

Missing Throw tools fail before the agent starts and produce an EnvironmentFailure run artifact. Missing Warn tools are written to the transcript and artifact but the agent still starts.

This package intentionally does not model the ACP protocol schema. It produces the agent's stdio streams and works with any ACP protocol/JSON-RPC package — for example AgentClientProtocol, dotacp, or LibAcp. The samples use AgentClientProtocol.

Install

dotnet add package Acp.Net.Process --prerelease

Basic Usage

using AcpNet.Process;
using AgentClientProtocol;

var runner = new AcpProcessRunner(new AcpProcessOptions
{
    Command = "python3",
    Arguments = ["/home/user/agent.py"],
    Runtime = AcpRuntime.Auto,
    TranscriptPath = "agent-transcript.ndjson",
    RequiredExecutables = ["rg", "git"],
    Shutdown = AcpShutdownPolicy.GracefulThenKill(TimeSpan.FromSeconds(2))
});

await using var session = await runner.StartAsync();

using var connection = new ClientSideConnection(
    _ => client,
    session.Stdout,
    session.Stdin);

connection.Open();

var cwdForAgent = session.ToAgentPath(Directory.GetCurrentDirectory());

Windows note: AcpRuntime.Auto runs the command natively unless it detects a WSL agent. For a POSIX agent such as python3, set Runtime = AcpRuntime.Wsl explicitly (see below), or keep Auto with a WSL agent path. As of 0.1.0-alpha.2, when a bare command like python3 resolves only to a Windows Store execution-alias stub, Auto routes it through WSL and preflight reports the stub as missing instead of hanging.

Windows + WSL

When a Windows .NET process needs to run a WSL/Linux ACP agent, use AcpRuntime.Wsl or leave AcpRuntime.Auto with WSL paths:

var runner = new AcpProcessRunner(new AcpProcessOptions
{
    Command = "python3",
    Arguments = ["/home/user/agent.py"],
    Runtime = AcpRuntime.Wsl,
    WslDistribution = "Ubuntu"
});

The runner maps UNC/Windows paths to WSL paths and starts the process through wsl.exe. Use session.ToAgentPath(...) for ACP payload paths such as NewSessionRequest.Cwd when the agent runs in WSL.

Environment Shaping

var runner = new AcpProcessRunner(new AcpProcessOptions
{
    Command = "gemini",
    Arguments = ["--acp"],
    Runtime = AcpRuntime.Wsl,
    AdditionalPathEntries = ["/usr/bin", "/home/user/.local/bin"],
    Environment = new Dictionary<string, string?>
    {
        ["GEMINI_DEBUG"] = "1"
    },
    RequiredExecutables = ["rg", "git", "node"]
});

RequiredExecutables are checked before the agent starts and written to the transcript as preflight.tool.found or preflight.tool.missing events.

Public API

  • AcpProcessRunner
  • AcpProcessOptions
  • AcpProcessSession
  • AcpRequiredExecutable
  • AcpMissingExecutablePolicy
  • AcpExecutablePreflightResult
  • AcpPreflightException
  • AcpRunArtifact
  • AcpRunFailureKind
  • AcpRuntime
  • AcpShutdownPolicy
  • AcpTranscriptRecorder
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.1 146 7/26/2026
0.1.0 103 7/17/2026
0.1.0-alpha.2 70 6/13/2026
0.1.0-alpha.1 68 6/11/2026

0.1.1: Two silent-failure fixes found by the first real consumer. WSL route: arguments after -- are now POSIX-quoted for the shell that actually receives them, so payloads containing parentheses, semicolons or quotes no longer produce empty stdout or syntax errors. RecordingTextReader: Read, ReadToEnd and the other TextReader members forward to the inner reader instead of inheriting defaults that silently returned empty; char-level reads are recorded per line. No API changes.