Klyroo.Agent.Core 0.1.0-preview.2

This is a prerelease version of Klyroo.Agent.Core.
dotnet add package Klyroo.Agent.Core --version 0.1.0-preview.2
                    
NuGet\Install-Package Klyroo.Agent.Core -Version 0.1.0-preview.2
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Klyroo.Agent.Core" Version="0.1.0-preview.2" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Klyroo.Agent.Core" Version="0.1.0-preview.2" />
                    
Directory.Packages.props
<PackageReference Include="Klyroo.Agent.Core" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Klyroo.Agent.Core --version 0.1.0-preview.2
                    
#r "nuget: Klyroo.Agent.Core, 0.1.0-preview.2"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Klyroo.Agent.Core@0.1.0-preview.2
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Klyroo.Agent.Core&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Klyroo.Agent.Core&version=0.1.0-preview.2&prerelease
                    
Install as a Cake Tool

Klyroo.Agent

A semantic bridge that lets AI agents read and operate Klyroo forms, dashboards and spreadsheet imports from .NET code.

CI NuGet License: MIT

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 actions assignColumn, answerValue, editCell, discardRows and 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 no object in the public API. setValue on a form field is read by the codec of the field in Klyroo.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: AllowPolicy and a per-call allow callback can refuse any step. Steps that need confirmation (forms, which are registered with confirmSubmit: true by default, a spreadsheet submit or clearFile) are refused when no policy is set.
  • Spreadsheet imports: the snapshot value is a summary (step, counts, open questions, unmapped required columns) and Query pages 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 in RegisterForm(form, allowSensitiveWrites: [...]).
  • Observe: Observe delivers one ObservedChange per successful step, with the previous and new value.
  • Tool definitions: GetToolDefinitions returns the snapshot, query and act tool descriptions, with read-only and consequential hints and the JSON schema of the arguments, and InvokeToolAsync runs a call from its raw JSON arguments and returns an AgentToolResult.
  • Microsoft.Extensions.AI: Klyroo.Agent.AI turns the bridge into AIFunction instances for any IChatClient, 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 every dotnet add package command needs --prerelease.
  • The controllers you expose: Klyroo.Agent references the Klyroo.Form.Core, Klyroo.Dashboard.Core and Klyroo.Spreadsheet.Core packages, so the bridge works with any app that builds a FormController<TModel> (or a DynamicFormController), a DashboardController or a SpreadsheetImporter<TRow>, rendered or not. Register it with AddKlyrooAgent().
  • An AI host that calls your code: the bridge exposes snapshot, query and act as 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 (MapStaticAssets or UseStaticFiles), and, for registerWebMcp, a browser that exposes the WebMCP modelContext API, 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.Core declares IsAotCompatible and IsTrimmable, so it works in NativeAOT and trimmed apps.
  • Klyroo.Agent declares IsTrimmable and the supported platforms browser, ios, android, maccatalyst and windows. It does not declare IsAotCompatible.
  • AgentBridgeService has 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 modelContext API.

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

MIT

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net10.0

    • No dependencies.
  • net11.0

    • No dependencies.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on Klyroo.Agent.Core:

Package Downloads
Klyroo.Stack.Core

Klyroo Core Meta-Package: aggregates all headless, NativeAOT-compatible Core engines of Klyroo (Query, Table, Form, Dashboard, Display, Spreadsheet, Agent) and the KlyrooStackCatalog router.

Klyroo.Agent

Klyroo Semantic Agent Bridge for Blazor Web & .NET MAUI Hybrid: connects Klyroo.Form, Klyroo.Dashboard, and Klyroo.Spreadsheet to AI agents and WebMCP.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.1.0-preview.2 39 11/29/2026
0.1.0-preview.1 42 11/29/2026