Topwater.Agents
0.1.0-preview.10
dotnet add package Topwater.Agents --version 0.1.0-preview.10
NuGet\Install-Package Topwater.Agents -Version 0.1.0-preview.10
<PackageReference Include="Topwater.Agents" Version="0.1.0-preview.10" />
<PackageVersion Include="Topwater.Agents" Version="0.1.0-preview.10" />
<PackageReference Include="Topwater.Agents" />
paket add Topwater.Agents --version 0.1.0-preview.10
#r "nuget: Topwater.Agents, 0.1.0-preview.10"
#:package Topwater.Agents@0.1.0-preview.10
#addin nuget:?package=Topwater.Agents&version=0.1.0-preview.10&prerelease
#tool nuget:?package=Topwater.Agents&version=0.1.0-preview.10&prerelease
Topwater.Agents
Run Microsoft Agent Framework's shell tool and file tools in a Topwater shell:
an interpreter in your process with its own file system, so no command the model writes starts a process or
touches a file on the host. Experimental (TW003) and pinned to exact framework versions
(Microsoft.Agents.AI.Tools.Shell 1.28.0-preview.261106.1, Microsoft.Agents.AI 1.28.0).
dotnet add package Topwater.Agents --prerelease
using Microsoft.Agents.AI;
using Topwater;
using Topwater.Agents;
var shell = new Shell();
await using var executor = new TopwaterShellExecutor(shell);
// the framework's shell tool: named run_shell, result in the framework's format (stdout, "stderr: ...", "exit_code: N")
AIAgent agent = chatClient.AsAIAgent(
instructions: "You are a helpful assistant.",
tools: [executor.AsAIFunction(requireApproval: false)]);
Console.WriteLine(await agent.RunAsync("How many lines are in notes.txt?"));
TopwaterShellExecutoris aShellExecutor. The shell is persistent (directory, variables and files carry over). A command that hits one of the shell's limits comes back as a result: a timeout is exit code 124 withTimedOutset, and the note naming the limit endsStderr. Output past 30,000 characters is cut andTruncatedis set.requireApprovaldefaults totrue, as in the framework. Nothing a command does reaches the host, so you can turn it off; leave it on if you want a person to see each command anyway (it works withUseToolApproval()).TopwaterFileStoreis anAgentFileStoreover one directory of the shell (by default the user's home), forFileAccessProviderandFileMemoryProvider. It runs as the shell's user, within the shell's disk limit, and refuses paths that leave its root or enter a mounted folder.TopwaterMountChangeslets the model ask for a staged mount's changes to be applied, through the framework's tool approval:changes.AsAIFunction()isapply_mount_changes, andawait changes.ReviewAsync(request)gives you the changes and a bounded summary to show your user. Approval applies exactly the reviewed changes, or nothing if they changed since; rejection leaves them pending.TopwaterSkillScriptRunner(experimental,TW013) runs Agent Skills scripts in the shell: pass itsRunAsyncto the framework'sAgentSkillsProvider(below). The skill's folder is copied read-only to/skills/<name>/, and the scripts run under the shell's limits, approvals, labels and audit trail..shruns in Topwater's bash; Python runs only through apython3you register, otherwise it fails withcommand not found(127).TopwaterSessionMachines(experimental,TW014) gives eachAgentSessionits own machine, saved after every call and back afterSerializeSessionAsync/DeserializeSessionAsyncor a workflow checkpoint (below). The session holds only a signed machine id; the machine goes to a store you own.- Calls through every executor, file store,
TopwaterMountChangesand skill script over the same shell run one at a time, together with the shell'sAsAIFunction()andBashTool.ExecuteAsync.
One machine per session, saved with it:
#pragma warning disable TW014 // experimental
var machines = new TopwaterSessionMachines("machines"); // saved machines and their signing key live here
AIAgent agent = chatClient.AsAIAgent(tools: [machines.AsAIFunction(requireApproval: false)]);
AgentSession session = await agent.CreateSessionAsync();
await agent.RunAsync("Write hello to notes.txt", session);
JsonElement saved = await agent.SerializeSessionAsync(session); // keep it wherever you keep sessions
AgentSession resumed = await agent.DeserializeSessionAsync(saved); // later, even in another process
await agent.RunAsync("What is in notes.txt?", resumed); // the file is still there
See docs/session-machines.md for owners, the template (mounts, programs, limits), bad ids and the store.
Agent Skills, with their scripts in the shell:
#pragma warning disable TW013 // experimental
var skills = new AgentSkillsProvider("skills", new TopwaterSkillScriptRunner(shell).RunAsync, options: new()
{
// The framework asks a person before each skill tool by default.
DisableLoadSkillApproval = true,
DisableReadSkillResourceApproval = true,
DisableRunSkillScriptApproval = true,
});
AIAgent agent = chatClient.AsAIAgent(new ChatClientAgentOptions { AIContextProviders = [skills] });
See docs/agent-skills.md for Python and the details.
If you use ShellEnvironmentProvider, set OverrideFamily = ShellFamily.Posix and your own InstructionsFormatter:
its default text names the host's operating system, not the shell's.
For a plain bash tool with Topwater's own result format, shell.AsAIFunction() from Topwater.AI works in Agent
Framework too. See docs/integrations.md.
| 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
- Microsoft.Agents.AI (= 1.28.0)
- Microsoft.Agents.AI.Tools.Shell (= 1.28.0-preview.261106.1)
- Microsoft.Extensions.AI (>= 11.0.1)
- Topwater (>= 0.1.0-preview.10)
-
net8.0
- Microsoft.Agents.AI (= 1.28.0)
- Microsoft.Agents.AI.Tools.Shell (= 1.28.0-preview.261106.1)
- Microsoft.Extensions.AI (>= 11.0.1)
- Topwater (>= 0.1.0-preview.10)
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.0-preview.10 | 46 | 12/1/2026 |
| 0.1.0-preview.9 | 200 | 11/30/2026 |
| 0.1.0-preview.8 | 82 | 11/29/2026 |
| 0.1.0-preview.7 | 84 | 11/28/2026 |