Let agents operateforms, not markup.
An agent that drives a UI through CSS selectors breaks when the markup changes. Klyroo.Agent works with the labels, values and named actions of the controllers behind your UI.
Install
dotnet add package Klyroo.Agent --prerelease
Copy the command
Klyroo.Agent
Snapshot Lists every registered component with a stable reference, its label, current value and the actions it accepts.Query Lists the choices of a select or filter, filtered by text, without opening a popup.Act Runs named actions such as setValue, toggle, submit and nextStep by reference or label, and reports why a step failed.Permissions AllowPolicy and a per-call allow callback can refuse any step, and steps that need confirmation are refused when no policy is set.
Program.cs
var schema = FormSchema.For<Project>(s =>
{
s.Title = "Project settings";
s.Field(p => p.Region, f => f.Options(
[new("us-east", "US East"),
new("eu-west", "Europe West")]));
s.Field(p => p.Token, f => f.AsPassword());
});
var agent = new AgentBridgeService();
agent.RegisterForm(
new FormController<Project>(schema, new Project()));
var snapshot = agent.Snapshot();
var result = await agent.ActAsync(
[new("Region", "setValue", ["eu-west"]),
new("Token", "setValue", ["s3cret"])]);RegisterForm hands a controller to the bridge. The agent never sees markup, only the labels, values and actions of the controller.
c1 select "Region" = us-eastc2 input "Token" = [redacted]c3 form "Project settings" = clean{ "steps": [ { "ref": "Region", "action": "setValue", "args": ["eu-west"] }, { "ref": "Token", "action": "setValue", "args": ["s3cret"] }] }
c1 setValue ok eu-westrefused Step 2: action "setValue" on "Token" (c2) was refused:the field is sensitive and the application does not letthe AI model change it.Region
Europe West
Token
[redacted]
the bridge reads the controller, not the markup the controller holds eu-west: the form is now dirty the value is never in a snapshot, a result or a change the token is unchanged
Everything it does
- 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.(JSON numbers keep their digits, text, lists, option labels) and refused with the reason when it does not fit the type of the member.Form - Permission gate
AllowPolicyand a per-callallowcallback can refuse any step. Steps that need confirmation (forms, which are registered withconfirmby default, a spreadsheetSubmit: true submitorclearFile) 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, allow Sensitive Writes: [...]) - Observe
Observedelivers oneObservedChangeper successful step, with the previous and new value.- Tool definitions
GetToolreturns theDefinitions snapshot,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.turns the bridge intoAgent. AI AIFunctioninstances for anyIChatClient, with an approval step for confirmation-required actions.- Browser runtime
- A separate JavaScript module (
klyroo-agent.) offers the same three operations over the DOM and can register them with WebMCP when the browser provides it.js
Packages
Klyroo.CoreAgent. Core The data types of the bridge (AgentActStep,AgentArgument,AgentValue,AgentActResult,AgentToolResult,ObservedChange, ...) andUndoStack. No dependencies, NativeAOT compatible.<T> Klyroo.Add-onAgent Agent,Bridge Service AddKlyrooAgent(), and the browser runtime served from_. Depends oncontent/ Klyroo. Agent/ Klyroo.,Agent. Core Klyroo.,Form. Core Klyroo.andDashboard. Core Klyroo..Spreadsheet. Core Klyroo.Add-onAgent. AI AsAIFunctions(): the bridge asMicrosoft.functions, with approval for confirmation-required actions. Depends onExtensions. AI Klyroo.andAgent Microsoft..Extensions. AI. Abstractions
Install it, then open the first page.
Change here for the other lines
- 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 newtemplates