Primodel.Sdk.Packaging
5.0.0
dotnet add package Primodel.Sdk.Packaging --version 5.0.0
NuGet\Install-Package Primodel.Sdk.Packaging -Version 5.0.0
<PackageReference Include="Primodel.Sdk.Packaging" Version="5.0.0"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="Primodel.Sdk.Packaging" Version="5.0.0" />
<PackageReference Include="Primodel.Sdk.Packaging"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add Primodel.Sdk.Packaging --version 5.0.0
#r "nuget: Primodel.Sdk.Packaging, 5.0.0"
#:package Primodel.Sdk.Packaging@5.0.0
#addin nuget:?package=Primodel.Sdk.Packaging&version=5.0.0
#tool nuget:?package=Primodel.Sdk.Packaging&version=5.0.0
Primodel.Sdk
Write plugins for Primodel — the governed data platform that maps vendor systems to a canonical model.
A plugin is a normal .NET class library. It adds a source, a target, a format, a SQL dialect or a storage engine to a running Primodel instance, and it ships and upgrades on its own schedule: installing one does not mean redeploying the product.
dotnet add package Primodel.Sdk
A minimal plugin
Three pieces: a role, a factory that binds it once from typed settings, and a package that registers it under a key.
using System.Runtime.InteropServices;
using Primodel.Sdk.Catalog;
using Primodel.Sdk.Plugins;
using Primodel.Sdk.Records;
using Primodel.Sdk.Roles;
// Settings are yours. They arrive as the flow author wrote them, secrets already resolved.
public sealed class GreetingSettings
{
public string Name { get; set; } = "world";
public int Count { get; set; } = 1;
}
public sealed class GreetingSource(GreetingSettings settings) : IRecordSource
{
public async IAsyncEnumerable<RecordBatch> ReadAsync(IRecordContextPool pool, IRunContext context)
{
var records = new RecordContext[settings.Count];
for (var i = 0; i < settings.Count; i++)
{
var record = pool.Rent();
record.SetString("greeting", ("hello " + settings.Name).AsMemory());
records[i] = record;
}
yield return new RecordBatch(records, records.Length);
await Task.CompletedTask;
}
}
// Bound once, when the flow compiles. The role never sees its settings again.
public sealed class GreetingSourceFactory : IRecordSourceFactory<GreetingSettings>
{
public ValueTask<IRecordSource> BindAsync(
GreetingSettings settings, IAdapterServices services, CancellationToken cancellationToken) =>
ValueTask.FromResult<IRecordSource>(new GreetingSource(settings));
}
public sealed class GreetingPlugin : IPluginPackage
{
public string Id => "primodel-greeting"; // must match your assembly name
public string Version => "1.0.0";
public IReadOnlyCollection<Architecture> SupportedArchitectures => []; // empty = fully managed
public PluginActivationMode ActivationMode => PluginActivationMode.Hot;
public void Register(IPluginRegistrationContext context) =>
context.Roles.Register<IRecordSource, GreetingSourceFactory, GreetingSettings>(
"greeting", new RoleCapabilities(RoleLifetime.Job));
}
A flow step naming "greeting" now runs your source.
The package id and the assembly name must match. The loader resolves a package's entry assembly as
{id}.dll, so a mismatch produces a plugin that installs, verifies, activates — and never loads.
What you can contribute
There is one contract family: the roles in Primodel.Sdk.Roles, registered only through
IPluginRegistrationContext.Roles (an IRoleCatalog). Each role is created once by an IRoleFactory, then runs
without settings.
| You implement | For |
|---|---|
IMessageSource |
yielding messages: a file (one message), a paged API or a broker (N messages), each settled |
IMessageTarget |
delivering messages, one session per endpoint, plus ProbeAsync to test an endpoint |
IMessageTransform |
reshaping a message, 1:1 or 1:N |
IRecordSource / IRecordTarget |
reading records from a system, writing records to one |
IRecordTransform |
reshaping records mid-flow, declaring stateless or stateful |
IFormat |
decode, encode and inspect one format with one parser; RoleCapabilities.FormatDirection says which directions the key serves |
IInboundProtocol / IAcknowledgementBuilder |
receiving a wire protocol, and building its acknowledgement later |
Beyond roles, IPluginRegistrationContext also takes a SQL dialect, a materialize writer, a stream source
provider, a lake provider, a connection type and a message broker: enough to add a database engine, an object
store, or a broker the product has never heard of.
An expected remote failure is a value, not an exception: a DeliveryOutcome, a MessageSettlement, a
response message carrying Http-Status, a ConnectionResult from ProbeAsync, or IRunContext.Quarantine for a
record that cannot be parsed. Throw only for configuration errors, bugs and cancellation.
What the host gives you
A plugin never calls back into Primodel. It asks, through interfaces the SDK declares and the host implements.
IAdapterServices is handed to your factory at bind time:
Logger— structured logging, scoped by the host to your package id. AlwaysLogger.LogX("template {Field}", value).Egress(IEgressServices) — vet and dial any host a flow's settings name. Use it. An endpoint written into a flow is attacker-reachable in a way a registered connection is not, and this is what applies the operator's allowlist and the cloud-metadata exclusion.Formats(IFormatResolver) — bind whatever format is registered under a key, including formats installed after your plugin shipped.TradingPartners(ITradingPartnerEnvelopes) — resolve a registered trading partner and allocate its next EDI control numbers.Credentials,Records,Messages,Payloads,Clock— resolved credentials, the record and message pools, the claim-check store and the time source.
IRunContext is the per-run half: cancellation, paging, the incremental watermark, quarantine for records you
cannot parse, and progress.
Testing
dotnet add package Primodel.Sdk.TestKit
Test doubles for the host side (FakeAdapterServices, FakeRunContext), a RecordingRoleCatalog to assert what
your package registers, source and format harnesses, and a conformance suite per role plus one for registration.
Derive from the suite for each role you register and the checks run against your implementation. It tracks the
SDK version exactly.
Support and versioning
Semantic versioning applies. 5.0.0 removed the pre-roles contract families; the migration table is in docs/migrating-to-5.0.md. A host refuses a package built on another SDK major, with a message naming the package, so rebuild plugins when you move major versions.
Issues and questions: github.com/Wadman-IT/Primodel-SDK. Design notes on what belongs in this contract and why are in docs/design.md.
Licence
Apache-2.0. This SDK is the contract you build against and is deliberately open; Primodel itself and its first-party plugin packages are separately licensed commercial software.
Learn more about Target Frameworks and .NET Standard.
This package has no dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 5.0.0 | 0 | 11/21/2026 |
| 4.6.0 | 67 | 11/19/2026 |
| 4.5.0 | 59 | 11/19/2026 |
| 4.4.0 | 80 | 11/18/2026 |
| 4.3.0 | 71 | 11/18/2026 |
| 4.2.0 | 102 | 11/17/2026 |
| 4.1.2 | 91 | 11/17/2026 |
| 4.1.1 | 90 | 11/17/2026 |
| 4.1.0 | 87 | 11/17/2026 |
| 4.0.0 | 97 | 11/16/2026 |
| 3.1.2 | 96 | 11/12/2026 |
| 3.1.1 | 99 | 11/9/2026 |
| 3.1.0 | 95 | 11/9/2026 |
| 3.0.0 | 147 | 10/31/2026 |
| 2.4.0 | 120 | 10/30/2026 |
| 2.3.0 | 131 | 10/26/2026 |
| 2.2.0 | 94 | 10/26/2026 |
| 2.1.0 | 179 | 10/3/2026 |
| 2.0.0 | 109 | 10/1/2026 |
| 1.1.1 | 173 | 9/25/2026 |