KnOwl.Contracts 1.0.3

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

KnOwl

Build and Release NuGet NuGet Downloads License: MIT

KnOwl is a set of reusable .NET libraries for designing, versioning, promoting, distributing, and consuming async contract metadata. It gives teams a Control Plane where contracts are authored and released, plus a Runtime surface where deployed contracts can be consumed by running services.

The goal is to keep product hosts thin. Your app owns the executable project, configuration, and EF migrations; KnOwl packages provide the domain model, application services, storage adapters, Razor UI, catalog endpoints, distribution endpoints, and runtime synchronization behavior.

What KnOwl Solves

  • Design event and command contracts with versioned payload schemas.
  • Model commands with a required request schema and optional reply schema.
  • Promote versions through lifecycle states and generate immutable artifacts.
  • Distribute deployed artifacts from a Control Plane to one or more Runtime hosts.
  • Expose deployed schemas through split event and command catalog endpoints.
  • Keep host-specific database migrations outside the reusable NuGet libraries.

Packages

Install only the layer your host needs:

Package Purpose
KnOwl.Contracts Shared DTOs for artifacts, delivery, catalog responses, and security.
KnOwl.ControlPlane Control Plane domain model and repository contracts.
KnOwl.ControlPlane.Application Control Plane services for design, lifecycle, artifacts, releases, and delivery.
KnOwl.ControlPlane.Storage.EntityFramework EF Core storage for Control Plane state.
KnOwl.ControlPlane.WebUI Reusable Razor UI for Control Plane hosts.
KnOwl.ControlPlane.Bootstrap ASP.NET Core composition for Control Plane hosts.
KnOwl.Runtime Runtime domain model and repository contracts.
KnOwl.Runtime.Application Runtime catalog, deployment, pull, and security services.
KnOwl.Runtime.Storage.EntityFramework EF Core storage for Runtime state.
KnOwl.Runtime.WebUI Reusable Razor UI for Runtime hosts.
KnOwl.Runtime.Bootstrap ASP.NET Core composition for Runtime hosts.

All packages target net9.0 and net10.0.

Getting Started

1. Create a Control Plane host

dotnet new web -n MyCompany.Contracts.ControlPlane
cd MyCompany.Contracts.ControlPlane

dotnet add package KnOwl.ControlPlane.Bootstrap
dotnet add package KnOwl.ControlPlane.Storage.EntityFramework

Use the bootstrap package in Program.cs:

using KnOwl.ControlPlane.Bootstrap;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddKnOwlControlPlane(
    builder.Configuration,
    options => options.MigrationsAssembly = typeof(Program).Assembly.GetName().Name);

var app = builder.Build();

app.MapKnOwlControlPlane();

app.Run();

Add configuration:

{
  "ConnectionStrings": {
    "KnOwlDb": "Server=localhost;Database=KnOwlControlPlane;Trusted_Connection=True;TrustServerCertificate=True"
  }
}

Create migrations in the host project:

dotnet ef migrations add InitialKnOwlControlPlane `
  --context KnOwlDbContext `
  --output-dir Migrations

dotnet ef database update --context KnOwlDbContext

Run the host and open the Control Plane UI. From there you can create data types, custom metadata fields, events, commands, versions, artifacts, runtime environments, runtime nodes, and releases.

2. Create a Runtime host

dotnet new web -n MyCompany.Contracts.Runtime
cd MyCompany.Contracts.Runtime

dotnet add package KnOwl.Runtime.Bootstrap
dotnet add package KnOwl.Runtime.Storage.EntityFramework

Use the runtime bootstrap in Program.cs:

using KnOwl.Runtime.Bootstrap;

var builder = WebApplication.CreateBuilder(args);

builder.Services.AddKnOwlRuntime(
    builder.Configuration,
    options => options.MigrationsAssembly = typeof(Program).Assembly.GetName().Name);

var app = builder.Build();

app.MapKnOwlRuntime();

app.Run();

Add configuration:

{
  "ConnectionStrings": {
    "KnOwlRuntimeDb": "Server=localhost;Database=KnOwlRuntime;Trusted_Connection=True;TrustServerCertificate=True"
  },
  "Runtime": {
    "ArtifactPull": {
      "Enabled": true,
      "InitialDelaySeconds": 5,
      "IntervalSeconds": 30
    }
  }
}

Create runtime migrations in the host project:

dotnet ef migrations add InitialKnOwlRuntime `
  --context KnOwlRuntimeDbContext `
  --output-dir Migrations/RuntimeStorage

dotnet ef database update --context KnOwlRuntimeDbContext

3. Connect Runtime to Control Plane

  1. In the Runtime UI, create a Control Plane connection.
  2. Generate or import the connection credentials.
  3. In the Control Plane UI, register the Runtime node and credentials.
  4. Release deployed artifacts from the Control Plane.
  5. Let the Runtime pull pending artifacts, or push artifacts to the Runtime delivery endpoint.

The sample hosts show the intended shape:

  • samples/KnOwl.ControlPlaneHost.Sample
  • samples/KnOwl.RuntimeHost.Sample

Contract Catalog

Control Plane hosts expose deployed source artifacts only when their artifact status is deployed:

  • GET /contracts/artifacts
  • GET /contracts/events/{eventKey}/versions/{versionNumber}
  • GET /contracts/commands/{commandKey}/versions/{versionNumber}

Runtime hosts expose deployed local artifacts:

  • GET /runtime/contracts/artifacts
  • GET /runtime/contracts/events/{eventKey}/versions/{versionNumber}
  • GET /runtime/contracts/commands/{commandKey}/versions/{versionNumber}

Event responses return one artifact. Command responses return both sides of the command version:

{
  "commandKey": "inventories.reserve",
  "version": "1.0.0",
  "requestArtifact": {
    "artifactType": "CommandRequest",
    "payloadSchema": {}
  },
  "replyArtifact": {
    "artifactType": "CommandReply",
    "payloadSchema": {}
  }
}

replyArtifact is optional. Request artifacts are required.

Local Development

Build and test:

dotnet restore KnOwl.slnx
dotnet build KnOwl.slnx --no-restore --configuration Release
dotnet test KnOwl.slnx --no-build --configuration Release

Pack the libraries:

Get-ChildItem src -Recurse -Filter *.csproj | ForEach-Object {
  dotnet pack $_.FullName --configuration Release -o artifacts/packages
}

Run the distribution end-to-end test. This starts SQL Server in Docker, runs the Control Plane and Runtime samples, and validates SQL Server storage plus push/pull artifact distribution for both target frameworks.

powershell -NoProfile -ExecutionPolicy Bypass -File scripts/run-knowl-distribution-e2e.ps1

Release

The release workflow builds, tests, packs, creates the GitHub release, and publishes NuGet packages. Production releases are driven by .release and CHANGELOG.md.

Current release: 1.0.0

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.
  • net10.0

    • No dependencies.
  • net9.0

    • No dependencies.

NuGet packages (8)

Showing the top 5 NuGet packages that depend on KnOwl.Contracts:

Package Downloads
KnOwl.Runtime

Domain model and repository contracts for KnOwl runtime contract metadata.

KnOwl.Runtime.WebUI

Reusable Razor UI components and pages for KnOwl runtime hosts.

KnOwl.ControlPlane.Application

Application services for KnOwl control plane design, promotion, distribution, and security workflows.

KnOwl.ControlPlane.Storage.EntityFramework

Entity Framework Core storage for KnOwl control plane design and distribution metadata.

KnOwl.ControlPlane

Domain model and repository contracts for KnOwl control plane design and distribution.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.0.3 11 9/15/2026
1.0.2 57 9/14/2026
1.0.1 64 9/14/2026