Klyroo.Agent
0.1.0-preview.2
dotnet add package Klyroo.Agent --version 0.1.0-preview.2
NuGet\Install-Package Klyroo.Agent -Version 0.1.0-preview.2
<PackageReference Include="Klyroo.Agent" Version="0.1.0-preview.2" />
<PackageVersion Include="Klyroo.Agent" Version="0.1.0-preview.2" />
<PackageReference Include="Klyroo.Agent" />
paket add Klyroo.Agent --version 0.1.0-preview.2
#r "nuget: Klyroo.Agent, 0.1.0-preview.2"
#:package Klyroo.Agent@0.1.0-preview.2
#addin nuget:?package=Klyroo.Agent&version=0.1.0-preview.2&prerelease
#tool nuget:?package=Klyroo.Agent&version=0.1.0-preview.2&prerelease
Klyroo.Agent
A semantic bridge that lets AI agents read and operate Klyroo forms, dashboards and spreadsheet imports from .NET code.
An agent that drives a UI through CSS selectors breaks whenever the markup changes. Klyroo.Agent skips the markup: you register the controllers behind your UI, and the agent works with their labels, values and named actions. The bridge is plain C# with no JavaScript interop, so it behaves the same in every Blazor render mode, in .NET MAUI and in a console app.
Features
- Snapshot: lists every registered component with a stable reference (
c1,c2, ...), its label, current value and the actions it accepts, capped at 100 entries. - Query: lists the choices of a select or filter, filtered by text, without opening a popup. Matching ignores case and accents.
- Act: runs named actions (
setValue,toggle,clear,reset,submit,nextStep,setView,refresh, and the spreadsheet actionsassignColumn,answerValue,editCell,discardRowsand more) by reference or label, stops at the first failing step and reports why. - Typed values: values, step arguments, query records and tool results are typed (
AgentValue,AgentArgument,AgentRecord,AgentToolResult), with noobjectin the public API.setValueon a form field is read by the codec of the field inKlyroo.Form(JSON numbers keep their digits, text, lists, option labels) and refused with the reason when it does not fit the type of the member. - Permission gate:
AllowPolicyand a per-callallowcallback can refuse any step. Steps that need confirmation (forms, which are registered withconfirmSubmit: trueby default, a spreadsheetsubmitorclearFile) are refused when no policy is set. - Spreadsheet imports: the snapshot value is a summary (step, counts, open questions, unmapped required columns) and
Querypages through rows and issues, addressed by the row number the user sees. - Secret redaction: password and one-time-code fields (any sensitive field) appear as
[redacted]in snapshots, results and observed changes, and the model cannot write them unless you name them inRegisterForm(form, allowSensitiveWrites: [...]). - Observe:
Observedelivers oneObservedChangeper successful step, with the previous and new value. - Tool definitions:
GetToolDefinitionsreturns thesnapshot,queryandacttool descriptions, with read-only and consequential hints and the JSON schema of the arguments, andInvokeToolAsyncruns a call from its raw JSON arguments and returns anAgentToolResult. - Microsoft.Extensions.AI:
Klyroo.Agent.AIturns the bridge intoAIFunctioninstances for anyIChatClient, with an approval step for confirmation-required actions. - Browser runtime: a separate JavaScript module (
klyroo-agent.js) offers the same three operations over the DOM and can register them with WebMCP when the browser provides it.
Packages
| Package | Description |
|---|---|
Klyroo.Agent.Core |
The data types of the bridge (AgentActStep, AgentArgument, AgentValue, AgentActResult, AgentToolResult, ObservedChange, ...) and UndoStack<T>. No dependencies, NativeAOT compatible. |
Klyroo.Agent |
AgentBridgeService, AddKlyrooAgent(), and the browser runtime served from _content/Klyroo.Agent/. Depends on Klyroo.Agent.Core, Klyroo.Form.Core, Klyroo.Dashboard.Core and Klyroo.Spreadsheet.Core. |
Klyroo.Agent.AI |
AsAIFunctions(): the bridge as Microsoft.Extensions.AI functions, with approval for confirmation-required actions. Depends on Klyroo.Agent and Microsoft.Extensions.AI.Abstractions. |
@klyroo/agent |
Source of the browser runtime (npm package manifest). Not published to npm; the same file ships inside Klyroo.Agent. |
Prerequisites
To use the library in an app:
- The .NET 11 SDK, and an app that targets
net11.0. The packages are prereleases, so everydotnet add packagecommand needs--prerelease. - The controllers you expose:
Klyroo.Agentreferences theKlyroo.Form.Core,Klyroo.Dashboard.CoreandKlyroo.Spreadsheet.Corepackages, so the bridge works with any app that builds aFormController<TModel>(or aDynamicFormController), aDashboardControlleror aSpreadsheetImporter<TRow>, rendered or not. Register it withAddKlyrooAgent(). - An AI host that calls your code: the bridge exposes
snapshot,queryandactas methods and tool definitions; your MCP server, chat endpoint or tool loop calls them. The library does not call a model itself. - For the browser runtime (
klyroo-agent.js): a browser with ES modules, the static web assets of the app served (MapStaticAssetsorUseStaticFiles), and, forregisterWebMcp, a browser that exposes the WebMCPmodelContextAPI, which is still experimental.
To build this repository you need the .NET 11 SDK (a newer SDK works too, see global.json) and clones of klyroo-dashboard, klyroo-form and klyroo-spreadsheet in the same parent folder: some projects reference them by relative path (../klyroo-dashboard/...). See Contributing.
Installation
dotnet add package Klyroo.Agent --prerelease
Register the bridge in Program.cs (Blazor) or MauiProgram.cs (.NET MAUI Blazor Hybrid):
using Klyroo.Agent;
builder.Services.AddKlyrooAgent();
AgentBridgeService is registered as a scoped service. The package has no stylesheet. If you only need the data
types, install Klyroo.Agent.Core instead.
Quick start
Register a form, then let a caller inspect it and change it:
using Klyroo.Agent;
using Klyroo.Form;
var agent = new AgentBridgeService();
var schema = FormSchema.For<Project>(s =>
{
s.FormKey = "project-settings";
s.Title = "Project settings";
s.Field(p => p.Name, f => f.Label("Project name"));
s.Field(p => p.Region, f => f.Options(
[
new FormOption<string>("us-east", "US East"),
new FormOption<string>("eu-west", "Europe West"),
]));
});
var form = new FormController<Project>(schema, new Project());
agent.RegisterForm(form);
foreach (var component in agent.Snapshot())
{
Console.WriteLine($"{component.Ref} {component.Component} \"{component.Label}\" = {component.Value?.ToDisplayString()}");
}
// c1 input "Project name" = Apollo
// c2 select "Region" = us-east
// c3 form "Project settings" = clean
var matches = agent.Query(new AgentQueryRequest { Within = "region", Text = "europe" });
Console.WriteLine(matches[0].Items[0].Value); // eu-west
var result = await agent.ActAsync(
[
new AgentActStep("Project name", "setValue", ["Atlas"]),
new AgentActStep("Region", "setValue", ["eu-west"]),
]);
Console.WriteLine(result.Ok ? "done" : result.Error);
Console.WriteLine(form.Get(schema.Field(p => p.Name))); // Atlas
public sealed class Project
{
public string Name { get; set; } = "Apollo";
public string Region { get; set; } = "us-east";
}
In a Blazor component, inject the scoped service instead of creating one, as shown in Getting started.
Documentation
| Getting started | Step-by-step first integration |
| Guides | Task-oriented recipes |
| Concepts | How the library works |
| Platforms | Render modes, .NET MAUI, NativeAOT |
| API reference | Every public type and member |
| FAQ | Troubleshooting and limitations |
Compatibility
- .NET 11 SDK.
Klyroo.Agent.CoredeclaresIsAotCompatibleandIsTrimmable, so it works in NativeAOT and trimmed apps.Klyroo.AgentdeclaresIsTrimmableand the supported platformsbrowser,ios,android,maccatalystandwindows. It does not declareIsAotCompatible.AgentBridgeServicehas no dependency on a render mode: it works in Static SSR, Interactive Server, WebAssembly, Auto, .NET MAUI Blazor Hybrid and non-UI hosts.- The browser runtime needs a browser; WebMCP registration is skipped when the browser has no
modelContextAPI.
Klyroo ecosystem
Klyroo is a family of independent .NET libraries that compose. Each one has its own repository, versions and releases.
| Library | Description |
|---|---|
| Klyroo.UI | Accessible Blazor components for the web and .NET MAUI Blazor Hybrid, styled with Tailwind CSS v4 |
| Klyroo.Query | Typed query model, URL state sync, and IQueryable / EF Core execution |
| Klyroo.Table | Data lists with table and card-grid layouts, filters, selection and actions |
| Klyroo.Form | Schema-driven forms, validation and wizards |
| Klyroo.Dashboard | Dashboard controller, filters and Blazor blocks: stats, gauges, charts, tables and feeds |
| Klyroo.Display | Code highlighting, secret and file list components, media player controls and file preview |
| Klyroo.Spreadsheet | Import wizard for CSV, TSV and pasted data, with column and value mapping |
| Klyroo.Agent | Bridge that lets AI agents read and act on Klyroo forms, dashboards and imports |
| Klyroo.Hotkey | Server-side .NET client for Hotkey cloud browsers, human handoffs and signed webhooks |
| Klyroo.Stack | Meta-package, MCP documentation server and dotnet new templates |
Contributing
Contributions are welcome. Read CONTRIBUTING.md before opening a pull request, and follow the code of conduct. Report security issues privately as described in SECURITY.md.
License
| 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. net11.0 is compatible. |
-
net10.0
- Klyroo.Agent.Core (= 0.1.0-preview.2)
- Klyroo.Dashboard.Core (= 0.1.0-preview.2)
- Klyroo.Form.Core (= 0.1.0-preview.2)
- Klyroo.Spreadsheet.Core (= 0.1.0-preview.2)
- Microsoft.AspNetCore.Components.Web (>= 10.0.0)
-
net11.0
- Klyroo.Agent.Core (= 0.1.0-preview.2)
- Klyroo.Dashboard.Core (= 0.1.0-preview.2)
- Klyroo.Form.Core (= 0.1.0-preview.2)
- Klyroo.Spreadsheet.Core (= 0.1.0-preview.2)
- Microsoft.AspNetCore.Components.Web (>= 11.0.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Klyroo.Agent:
| Package | Downloads |
|---|---|
|
Klyroo.Agent.AI
Klyroo Agent for Microsoft.Extensions.AI: exposes the snapshot, query and act tools of Klyroo.Agent as AIFunction instances for any IChatClient, with an approval step for actions that need confirmation. |
|
|
Klyroo.Stack
Umbrella meta-package for the entire Klyroo ecosystem (UI, Query, Table, Form, Dashboard, Display, Spreadsheet, Agent) for Blazor Web and .NET MAUI Hybrid. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.1.0-preview.2 | 40 | 11/29/2026 |
| 0.1.0-preview.1 | 38 | 11/29/2026 |