ORYX.Contracts 0.2.0

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

ORYX.Contracts

Shared execution contracts for the ORYX component ecosystem. This library defines the interfaces and types used by components and the node runtime so that components can be developed and hosted in a consistent way across the platform.

Repository: https://github.com/Baltigo/oryx-contracts

Prerequisites

  • .NET 8.0 SDK or later

Package

Property Value
PackageId ORYX.Contracts
Version see NuGet (e.g. 0.2.0)
Target net8.0
License MIT

API Overview

Public types live in ORYX.Contracts.Execution and ORYX.Contracts.Execution.Results.

Execution contracts

Type Description
IComponent Base component contract: Id, Version, and ExecuteAsync(WorkloadContext, CancellationToken).
IComponent<TOptions> Component that accepts typed options: ExecuteAsync(WorkloadContext, TOptions, CancellationToken).
ComponentBase<TOptions> Abstract base class implementing IComponent<TOptions>; override Id, Version, and typed ExecuteAsync.
IComponentOptions Marker interface for component option types (implement on your options class/record).
WorkloadContext Immutable context for a single workload: TenantId, WorkloadId, AttemptId, Inputs, and Logger.
ComponentResult Result of a component run: Success, ExitCode, and optional Message.
IWorkloadLogger Logging abstraction: template-based methods only (Log(LogLevel, string, params object?[]), LogTrace, LogDebug, LogInformation, LogWarning, LogError/LogError(Exception, ...), LogCritical/LogCritical(Exception, ...)). Plain strings are valid templates.

Step execution result (JSON)

Step results are written by ComponentHost/Runner as versioned, machine-readable JSON. These types live in ORYX.Contracts.Execution.Results:

Type Description
StepExecutionResultDto Full step result: schema version, execution/step ids, status, timing, component identity, optional output and error.
StepExecutionStatus Enum: Succeeded, Failed, Cancelled (serialized as string).
StepExecutionTimingDto StartedAtUtc, FinishedAtUtc, DurationMs.
StepComponentIdentityDto ComponentPackageId, PackageName, ComponentKey, ComponentVersion.
StepExecutionErrorDto Optional error: Code, Message, Details.

WorkloadContext

public sealed record WorkloadContext(
    Guid TenantId,
    Guid WorkloadId,
    Guid AttemptId,
    IReadOnlyDictionary<string, string> Inputs,
    IWorkloadLogger Logger);

The node provides this context when invoking a component. Use Inputs for parameters and Logger for structured output.

ComponentResult

public sealed record ComponentResult(
    bool Success,
    int ExitCode,
    string? Message = null);

Return this from ExecuteAsync to report success/failure, exit code, and an optional message.

Step result format: legacy vs new

  • Legacy: Step results were sometimes written as plain text (e.g. result.txt) with key=value or similar formats.
  • Current: Step results are written as result.json (not result.txt) using StepExecutionResultDto. Path: <ExecutionRoot>/Steps/<StepIndex>/result.json. Serialization uses System.Text.Json with camelCase property names, enums as strings (JsonStringEnumConverter), and DateTimeOffset in ISO8601 with Z when UTC.

Example payload (successful step with optional output):

{
  "schemaVersion": 1,
  "executionId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "customerId": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "stepExecutionId": "c3d4e5f6-a7b8-9012-cdef-123456789012",
  "stepIndex": 0,
  "status": "Succeeded",
  "timing": {
    "startedAtUtc": "2025-02-26T10:00:00Z",
    "finishedAtUtc": "2025-02-26T10:00:05Z",
    "durationMs": 5000
  },
  "component": {
    "componentPackageId": "d4e5f6a7-b8c9-0123-def0-234567890123",
    "packageName": "oryx-component-example",
    "componentKey": "example.run",
    "componentVersion": "1.0.0"
  },
  "output": { "filesCreated": 3, "path": "/out" },
  "error": null
}

For a failed step, status is "Failed" and error is populated, e.g. { "code": "ERR_RUNTIME", "message": "Operation failed", "details": "..." }.

Example: implementing a component

using ORYX.Contracts.Execution;

namespace MyComponent;

public record MyOptions(string RepoUrl, string Branch) : IComponentOptions;

public class MyComponent : ComponentBase<MyOptions>
{
    public override string Id => "my.git-clone";
    public override string Version => "1.0.0";

    public override async Task<ComponentResult> ExecuteAsync(
        WorkloadContext context,
        MyOptions options,
        CancellationToken cancellationToken)
    {
        context.Logger.LogInformation("Cloning {RepoUrl} @ {Branch}", options.RepoUrl, options.Branch);
        // ... perform work ...
        return new ComponentResult(Success: true, ExitCode: 0, Message: "Done");
    }
}

Building

From the repository root:

dotnet build

Consuming

All projects must reference ORYX.Contracts via NuGet only. Do not add a ProjectReference to the oryx-contracts project.

The package is published to NuGet.org. To add it to your component or host project:

.NET CLI

dotnet add package ORYX.Contracts

To pin a specific version (e.g. 0.2.0):

dotnet add package ORYX.Contracts --version 0.2.0

Package Manager Console (Visual Studio)

Install-Package ORYX.Contracts

PackageReference (in your .csproj)

<PackageReference Include="ORYX.Contracts" Version="0.2.0" />

Central Package Management (Directory.Packages.props)

In Directory.Packages.props:

<PackageVersion Include="ORYX.Contracts" Version="0.2.0" />

In your project file:

<PackageReference Include="ORYX.Contracts" />
  • oryx-componentagent — Runtime entry point that authenticates to ORYX Core and runs components; references this library.
  • oryx-node — Node runtime that executes workloads and provides WorkloadContext to components.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  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 was computed.  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

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
0.2.0 100 4/28/2026
0.1.10 115 3/5/2026
0.1.9 115 3/1/2026
0.1.8 109 2/28/2026
0.1.7 105 2/28/2026
0.1.6 102 2/26/2026
0.1.5 107 2/26/2026
0.1.4 99 2/26/2026
0.1.3 109 2/25/2026
0.1.2 107 2/24/2026
0.1.1 101 2/19/2026
0.1.0 101 2/19/2026