HagiCode.Libs.Core
0.1.0-dev.26.1
See the version list below for details.
dotnet add package HagiCode.Libs.Core --version 0.1.0-dev.26.1
NuGet\Install-Package HagiCode.Libs.Core -Version 0.1.0-dev.26.1
<PackageReference Include="HagiCode.Libs.Core" Version="0.1.0-dev.26.1" />
<PackageVersion Include="HagiCode.Libs.Core" Version="0.1.0-dev.26.1" />
<PackageReference Include="HagiCode.Libs.Core" />
paket add HagiCode.Libs.Core --version 0.1.0-dev.26.1
#r "nuget: HagiCode.Libs.Core, 0.1.0-dev.26.1"
#:package HagiCode.Libs.Core@0.1.0-dev.26.1
#addin nuget:?package=HagiCode.Libs.Core&version=0.1.0-dev.26.1&prerelease
#tool nuget:?package=HagiCode.Libs.Core&version=0.1.0-dev.26.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, DeepAgents, 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.2.3-dev.57.1 | 22 | 4/17/2026 |
| 0.2.3-dev.56.1 | 35 | 4/16/2026 |
| 0.2.3-dev.55.1 | 32 | 4/15/2026 |
| 0.2.3-dev.54.1 | 33 | 4/15/2026 |
| 0.2.3-dev.53.1 | 44 | 4/14/2026 |
| 0.2.3-dev.52.1 | 42 | 4/14/2026 |
| 0.2.3-dev.51.1 | 49 | 4/13/2026 |
| 0.2.2 | 96 | 4/13/2026 |
| 0.2.2-dev.49.1 | 44 | 4/11/2026 |
| 0.2.2-dev.48.1 | 37 | 4/11/2026 |
| 0.2.2-dev.47.1 | 40 | 4/11/2026 |
| 0.2.2-dev.46.1 | 40 | 4/11/2026 |
| 0.2.2-dev.45.1 | 44 | 4/11/2026 |
| 0.2.2-dev.44.1 | 40 | 4/11/2026 |
| 0.2.2-dev.43.1 | 42 | 4/11/2026 |
| 0.2.2-dev.42.1 | 42 | 4/11/2026 |
| 0.2.2-dev.41.1 | 44 | 4/11/2026 |
| 0.2.2-dev.40.1 | 43 | 4/11/2026 |
| 0.2.2-dev.39.1 | 40 | 4/9/2026 |
| 0.1.0-dev.26.1 | 43 | 3/29/2026 |