HagiCode.Libs.Core 0.1.0-dev.19.1

This is a prerelease version of HagiCode.Libs.Core.
There is a newer version of this package available.
See the version list below for details.
dotnet add package HagiCode.Libs.Core --version 0.1.0-dev.19.1
                    
NuGet\Install-Package HagiCode.Libs.Core -Version 0.1.0-dev.19.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="HagiCode.Libs.Core" Version="0.1.0-dev.19.1" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HagiCode.Libs.Core" Version="0.1.0-dev.19.1" />
                    
Directory.Packages.props
<PackageReference Include="HagiCode.Libs.Core" />
                    
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 HagiCode.Libs.Core --version 0.1.0-dev.19.1
                    
#r "nuget: HagiCode.Libs.Core, 0.1.0-dev.19.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 HagiCode.Libs.Core@0.1.0-dev.19.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=HagiCode.Libs.Core&version=0.1.0-dev.19.1&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=HagiCode.Libs.Core&version=0.1.0-dev.19.1&prerelease
                    
Install as a Cake Tool

HagiCode.Libs.Core

HagiCode.Libs.Core provides the low-level building blocks behind HagiCode CLI integrations. Use it when you need to discover installed executables, resolve the runtime environment for spawned tools, manage CLI processes, talk to ACP-compatible transports, or launch external commands through the new shared execution facade.

What is included

  • CLI executable discovery for local tools and custom paths
  • Runtime environment resolution, including the macOS shell-aware fallback
  • Process management helpers for launching and monitoring CLI subprocesses
  • A shared CLI execution facade with buffered and streaming result envelopes
  • Transport, ACP session primitives, and shared ACP pool contracts for higher-level integrations

Install

dotnet add package HagiCode.Libs.Core

Minimal usage

Resolve an executable path and the effective environment before launching a CLI:

using HagiCode.Libs.Core.Discovery;
using HagiCode.Libs.Core.Environment;

var executableResolver = new CliExecutableResolver();
var executablePath = executableResolver.ResolveFirstAvailablePath(["codex", "codex.exe"]);

var environmentResolver = new RuntimeEnvironmentResolver(new ProcessShellCommandRunner());
var environment = await environmentResolver.ResolveAsync();

Console.WriteLine(executablePath ?? "Codex CLI not found.");
Console.WriteLine(environment.TryGetValue("PATH", out var path) ? path : "PATH is unavailable.");

Execute a command through the shared execution facade without constructing ProcessStartContext directly:

using HagiCode.Libs.Core.Environment;
using HagiCode.Libs.Core.Execution;
using HagiCode.Libs.Core.Process;

var facade = new CliExecutionFacade(
    new CliProcessManager(),
    new RuntimeEnvironmentResolver(new ProcessShellCommandRunner()));

var result = await facade.ExecuteAsync(new CliExecutionRequest
{
    ExecutablePath = "dotnet",
    Arguments = ["--info"],
    Timeout = TimeSpan.FromSeconds(10)
});

Console.WriteLine(result.Status);
Console.WriteLine(result.StandardOutput);

For long-running or interactive commands, call ExecuteStreamingAsync() to receive stdout and stderr events followed by a terminal CliExecutionResult envelope.

Adoption boundaries

  • Use CliExecutionFacade when you want typed requests, policy evaluation, normalized diagnostics, and structured success/failure/timeout handling.
  • Use CliProcessManager directly when you need a long-lived stdio transport such as ACP or provider-specific session protocols.
  • Use the ACP pool contracts (CliPoolSettings, CliAcpPoolRequest, PooledAcpSessionEntry, and CliAcpSessionPool) when provider code needs warm session reuse, idle eviction, or deterministic fault cleanup.
  • CliAcpSessionPool.GetDiagnosticsSnapshot() exposes read-only global and provider-scoped hit/miss/evict/fault counters, live entry counts, and the most recent eviction/fault reasons; the pool also emits structured logs plus System.Diagnostics.Metrics counters for warm reuse, misses, evictions, and faults.
  • The embedded lifecycle improvements intentionally stay behind HagiCode namespaces; callers should continue passing structured argument tokens instead of raw shell strings.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on HagiCode.Libs.Core:

Package Downloads
HagiCode.Libs.Providers

Provider abstractions and built-in HagiCode CLI integrations for Claude Code, Copilot, Codex, CodeBuddy, Gemini, Hermes, Kimi, Kiro, OpenCode, and QoderCLI.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0 41 3/29/2026
0.1.0-dev.28.1 32 3/29/2026
0.1.0-dev.27.1 33 3/29/2026
0.1.0-dev.26.1 32 3/29/2026
0.1.0-dev.25.1 39 3/29/2026
0.1.0-dev.24.1 39 3/28/2026
0.1.0-dev.23.1 43 3/27/2026
0.1.0-dev.22.1 35 3/27/2026
0.1.0-dev.21.1 40 3/27/2026
0.1.0-dev.20.1 32 3/26/2026
0.1.0-dev.19.1 30 3/25/2026
0.1.0-dev.18.1 32 3/25/2026
0.1.0-dev.17.1 34 3/23/2026
0.1.0-dev.16.1 40 3/22/2026
0.1.0-dev.15.1 33 3/22/2026
0.1.0-dev.14.1 34 3/22/2026
0.1.0-dev.13.1 31 3/22/2026
0.1.0-dev.12.1 33 3/22/2026
0.1.0-dev.11.1 29 3/22/2026
0.1.0-dev.10.1 34 3/22/2026
Loading failed