HagiCode.Libs.Core
0.1.0-dev.25.1
See the version list below for details.
dotnet add package HagiCode.Libs.Core --version 0.1.0-dev.25.1
NuGet\Install-Package HagiCode.Libs.Core -Version 0.1.0-dev.25.1
<PackageReference Include="HagiCode.Libs.Core" Version="0.1.0-dev.25.1" />
<PackageVersion Include="HagiCode.Libs.Core" Version="0.1.0-dev.25.1" />
<PackageReference Include="HagiCode.Libs.Core" />
paket add HagiCode.Libs.Core --version 0.1.0-dev.25.1
#r "nuget: HagiCode.Libs.Core, 0.1.0-dev.25.1"
#:package HagiCode.Libs.Core@0.1.0-dev.25.1
#addin nuget:?package=HagiCode.Libs.Core&version=0.1.0-dev.25.1&prerelease
#tool nuget:?package=HagiCode.Libs.Core&version=0.1.0-dev.25.1&prerelease
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
CliExecutionFacadewhen you want typed requests, policy evaluation, normalized diagnostics, and structured success/failure/timeout handling. - Use
CliProcessManagerdirectly when you need a long-lived stdio transport such as ACP or provider-specific session protocols. - Use the ACP pool contracts (
CliPoolSettings,CliAcpPoolRequest,PooledAcpSessionEntry, andCliAcpSessionPool) 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 plusSystem.Diagnostics.Metricscounters 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 | Versions 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. |
-
net10.0
- Microsoft.Extensions.Logging.Abstractions (>= 10.0.2)
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 |