Skip to content

AgentExecutionContext

NexusLabs.Needlr.AgentFramework

NexusLabs.Needlr.AgentFramework.Context

AgentExecutionContext Class

Default implementation of IAgentExecutionContext. Immutable record that carries user identity, orchestration ID, and an extensible property bag.

public sealed record AgentExecutionContext : NexusLabs.Needlr.AgentFramework.Context.IAgentExecutionContext, System.IEquatable<NexusLabs.Needlr.AgentFramework.Context.AgentExecutionContext>

Inheritance System.Object 🡒 AgentExecutionContext

Implements IAgentExecutionContext, System.IEquatable<AgentExecutionContext>

Constructors

AgentExecutionContext(string, string, IReadOnlyDictionary<string,object>) Constructor

Default implementation of IAgentExecutionContext. Immutable record that carries user identity, orchestration ID, and an extensible property bag.

public AgentExecutionContext(string UserId, string OrchestrationId, System.Collections.Generic.IReadOnlyDictionary<string,object>? Properties=null);

Parameters

UserId System.String

The user identity for the current orchestration.

OrchestrationId System.String

Correlation ID for the current orchestration run.

Properties System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object>

Extensible property bag for consumer-specific data.

Properties

AgentExecutionContext.OrchestrationId Property

Correlation ID for the current orchestration run.

public string OrchestrationId { get; init; }

Implements OrchestrationId

Property Value

System.String

AgentExecutionContext.Properties Property

Extensible property bag for consumer-specific data.

public System.Collections.Generic.IReadOnlyDictionary<string,object>? Properties { get; init; }

Implements Properties

Property Value

System.Collections.Generic.IReadOnlyDictionary<System.String,System.Object>

AgentExecutionContext.UserId Property

The user identity for the current orchestration.

public string UserId { get; init; }

Implements UserId

Property Value

System.String

Explicit Interface Implementations

NexusLabs.Needlr.AgentFramework.Context.IAgentExecutionContext.Properties Property

Gets an extensible property bag for consumer-specific data (workspace, tenant, etc.).

System.Collections.Generic.IReadOnlyDictionary<string,object> NexusLabs.Needlr.AgentFramework.Context.IAgentExecutionContext.Properties { get; }

Implements Properties

Remarks

Framework code never reads from this bag. It exists so consumers can attach domain-specific data to the context without creating a custom IAgentExecutionContext implementation.

Implementations should return a read-only dictionary. Mutability (if needed) should be handled by creating a new context with updated properties.