Universal.Operative.Sdk.Compression
2.0.0
dotnet add package Universal.Operative.Sdk.Compression --version 2.0.0
NuGet\Install-Package Universal.Operative.Sdk.Compression -Version 2.0.0
<PackageReference Include="Universal.Operative.Sdk.Compression" Version="2.0.0" />
<PackageVersion Include="Universal.Operative.Sdk.Compression" Version="2.0.0" />
<PackageReference Include="Universal.Operative.Sdk.Compression" />
paket add Universal.Operative.Sdk.Compression --version 2.0.0
#r "nuget: Universal.Operative.Sdk.Compression, 2.0.0"
#:package Universal.Operative.Sdk.Compression@2.0.0
#addin nuget:?package=Universal.Operative.Sdk.Compression&version=2.0.0
#tool nuget:?package=Universal.Operative.Sdk.Compression&version=2.0.0
About
Universal.Operative.Sdk.Compression adds two IShellHook implementations for Universal.Operative.Sdk's BashTool/PowerShellTool, so large shell output doesn't reach the model as-is:
CommandCompressionHook— anAfterExecutehook backed byUniversal.GenerativeAI.CommandCompression: parses captured stdout/stderr for recognized command families (git, docker, kubectl, test runners, package managers, and more) and compresses them, run in-process, no external dependency.RtkProxyHook— aBeforeExecutehook that proxies a call through the externalrtkCLI when it's onPATH: rtk spawns the target command itself and compresses its output before this SDK ever captures anything. Only applies to a command that parses as one simple invocation with no shell operators, redirects, backgrounding, or command substitution — anything else is left to run through the shell unchanged, since rtk's contract is a plain argv, not a shell string.
Both are opt-in and safe by default: each declines (returns null / leaves the command alone) rather than forcing output through a shape it doesn't recognize. RtkProxyHook additionally verifies, at construction time, that whatever answers to the configured executable name is actually rtk-ai/rtk — there's a documented, unrelated project also named "rtk" ("Rust Type Kit") — by checking that its --help output mentions token compression. No binary on PATH at all is the ordinary case and stays quiet; a name match that fails that check throws InvalidOperationException instead of silently doing nothing, since a wrong tool sitting where rtk was expected is a misconfiguration worth surfacing loudly.
How to Use
Installation
dotnet add package Universal.Operative.Sdk.Compression
Usage
using Universal.Operative.Sdk.Compression;
using Universal.Operative.Sdk.Tools.Shell;
var shellTools = new ShellToolBuilder()
.WithRtkProxy() // no-ops if `rtk` isn't installed
.WithCommandCompression(); // in-process fallback/complement
IEngine engine = EngineBuilder.FromDefaults(model)
.AddBaselineToolSet(shellTools: shellTools)
.Build();
Both hooks can be constructed and added directly too (shellTools.AddBeforeExecuteHook(new RtkProxyHook())), or passed a custom CommandCompressor/tokenizer for finer control.
License
Free for noncommercial use under the Universal.Operative Noncommercial License. Source is closed; commercial use requires a separate license from Andrew Ong.
| Product | Versions 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 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
- Universal.GenerativeAI.CommandCompression (>= 1.1.0)
- Universal.Operative.Sdk (>= 6.0.0)
-
net8.0
- Universal.GenerativeAI.CommandCompression (>= 1.1.0)
- Universal.Operative.Sdk (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Coordinated major release for Universal.Operative.Sdk 6 and the canonical provider-neutral tool-dispatch boundary.