Unicorb 0.9.17-alpha

This is a prerelease version of Unicorb.
dotnet add package Unicorb --version 0.9.17-alpha
                    
NuGet\Install-Package Unicorb -Version 0.9.17-alpha
                    
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="Unicorb" Version="0.9.17-alpha" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Unicorb" Version="0.9.17-alpha" />
                    
Directory.Packages.props
<PackageReference Include="Unicorb" />
                    
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 Unicorb --version 0.9.17-alpha
                    
#r "nuget: Unicorb, 0.9.17-alpha"
                    
#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 Unicorb@0.9.17-alpha
                    
#: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=Unicorb&version=0.9.17-alpha&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Unicorb&version=0.9.17-alpha&prerelease
                    
Install as a Cake Tool

Unicorb

State-machine engine for bots. It provides registries for commands, states, handlers and extractors, plus an update processing pipeline.

The package is transport-neutral. The host decides where updates come from and where responses are sent.

TFM: net9.0, net10.0

The API may change before version 1.0.0.

Install

dotnet add package Unicorb

Quick Start

builder.Services.AddUnicorb(o =>
{
    o.Registries(r => r.ScanFrom<MyMarker>());
});

ScanFrom<T> scans one assembly for commands, states, handlers and extractors.

Use explicit scanning when you need more control:

builder.Services.AddUnicorb(o => o.Registries(r =>
{
    r.ScanCommandsFrom<MyMarker>();
    r.ScanStatesFrom<MyMarker>();
    r.ScanHandlersFrom<MyMarker>();
    r.ScanExtractorsFrom<MyMarker>();
}));

Dialog Model

  • InteractionState waits for user input.
  • TransitionState moves to the next step without user input.
  • CommandHandler, InteractionHandler and TransitionHandler process dialog steps.
  • IInputExtractor<TUpdate, TInput> converts a transport update into handler input.
  • StateContext stores session variables.

Session snapshots are stored by key:

public sealed record SessionKey(string Platform, string Member);

Platform separates transports such as telegram, max and playground. Member identifies the session.

Validate Wiring

After app.Build(), validate that handlers and extractors are connected:

var app = builder.Build();
app.Services.ValidateUnicorb<PlaygroundUpdate>();

Overrides

  • Add a custom extractor with ScanExtractorsFrom<MyMarker>() after the bridge marker.
  • If multiple extractors match the same (TUpdate, TInput) pair, the last one wins.
  • Register a custom slash-command parser before AddUnicorb.
  • Register a custom ISnapshotStore or ISessionFactory before AddUnicorb.
  • The default InMemorySnapshotStore is for get-started and local dev only; use a persistent store in production.
builder.Services.AddSingleton<ICommandInvocationParser, MyCommandParser>();
builder.Services.AddUnicorb(o => o.Registries(r => r.ScanFrom<MyMarker>()));

Bridge Packages

Package Adds
Unicorb.Playground.Bridge Playground pipeline and adapter
Unicorb.Telegram.Bridge Telegram pipeline and Bot API adapter
Unicorb.Max.Bridge Max pipeline and API adapter
Unicorb.Telegram.Configuration.AspNetCore Telegram webhook endpoint
Unicorb.Max.Configuration.AspNetCore Max webhook endpoint

Minimal Playground stack:

builder.Services.AddUnicorb(o => o.Registries(r =>
{
    r.ScanHandlersFrom<MyMarker>();
    r.ScanStatesFrom<MyMarker>();
    r.ScanCommandsFrom<MyMarker>();
    r.ScanExtractorsFrom<PlaygroundAssemblyMarker>();
}));

builder.Services.AddPlayground();
builder.Services.AddPlaygroundBridge();

var app = builder.Build();
app.Services.ValidateUnicorb<PlaygroundUpdate>();
app.UsePlayground();

Demo

dotnet run --project Unicorb.Demo
Product Compatible and additional computed target framework versions.
.NET net9.0 is compatible.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (5)

Showing the top 5 NuGet packages that depend on Unicorb:

Package Downloads
Unicorb.Max.Bridge

Max transport bridge for Unicorb: update pipeline, state machine, extractors, and Bot API adapter

Unicorb.Telegram.Bridge

Telegram transport bridge for Unicorb: update pipeline, state machine, extractors, and Bot API adapter

Unicorb.Telegram.Configuration.AspNetCore

ASP.NET Core webhook endpoint for Unicorb Telegram bots: default POST route to IUpdateService

Unicorb.Max.Configuration.AspNetCore

ASP.NET Core webhook endpoint for Unicorb Max bots: default POST route to IUpdateService

Unicorb.Playground.Bridge

Playground transport bridge for Unicorb: update pipeline, state machine, extractors, and in-process UI adapter

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.9.17-alpha 26 7/30/2026
0.9.16-alpha 28 7/30/2026
0.9.15-alpha 36 7/30/2026
0.9.14-alpha 37 7/29/2026
0.9.13-alpha 64 7/21/2026
0.9.12-alpha 65 7/20/2026
0.9.11-alpha 70 7/15/2026
0.9.10-alpha 66 7/13/2026
0.9.9-alpha 67 7/13/2026
0.9.8-alpha 66 7/12/2026
0.9.7-alpha 76 7/10/2026
0.9.6-alpha 77 7/10/2026
0.9.5-alpha 73 7/9/2026
0.9.4-alpha 76 7/9/2026
0.9.3-alpha 88 6/24/2026
0.9.2-alpha 92 6/23/2026
0.9.1-alpha 80 6/14/2026
0.9.0-alpha 86 6/14/2026