AuditingAgentDefinitionStore
AgentPrism.Core.dllWraps IAgentDefinitionStore in a decorator that writes an audit trail.
public sealed class AuditingAgentDefinitionStore : IAgentDefinitionStore, IAuditDecoratedInheritance
Section titled “Inheritance”object ← AuditingAgentDefinitionStore
Implements
Section titled “Implements”IAgentDefinitionStore, IAuditDecorated
Inherited Members
Section titled “Inherited Members”object.GetType(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
Remarks
Section titled “Remarks”Writes occur here, not at the endpoint layer. This follows the same reason as
enforcing the “an agent can only refer to a registered tool” rule in ToolRegistry:
the store is the one gateway for every write path to an agent definition.
Constructors
Section titled “Constructors”AuditingAgentDefinitionStore(IAgentDefinitionStore, IAuditLog, ITenantContext, IAuditActorResolver, ILogger<AuditingAgentDefinitionStore>)
Section titled “ AuditingAgentDefinitionStore(IAgentDefinitionStore, IAuditLog, ITenantContext, IAuditActorResolver, ILogger<AuditingAgentDefinitionStore>)”Initializes a new audited definition store.
public AuditingAgentDefinitionStore(IAgentDefinitionStore inner, IAuditLog auditLog, ITenantContext tenantContext, IAuditActorResolver actorResolver, ILogger<AuditingAgentDefinitionStore> logger)Parameters
Section titled “Parameters”inner IAgentDefinitionStore
auditLog IAuditLog
tenantContext ITenantContext
actorResolver IAuditActorResolver
logger ILogger<AuditingAgentDefinitionStore>
Properties
Section titled “Properties”AuditedInner
Section titled “ AuditedInner”Gets the real store instance the decorator wraps.
public object AuditedInner { get; }Property Value
Section titled “Property Value”Methods
Section titled “Methods”DeleteAsync(string, CancellationToken)
Section titled “ DeleteAsync(string, CancellationToken)”Deletes the definition and every one of its versions.
public ValueTask<bool> DeleteAsync(string name, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”name string
The agent name.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”true when the delete happened.
GetAsync(string, CancellationToken)
Section titled “ GetAsync(string, CancellationToken)”Returns the current version of the definition with the given name.
public ValueTask<AgentDefinition?> GetAsync(string name, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”name string
The agent name.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The definition, or null when it does not exist.
GetVersionAsync(string, int, CancellationToken)
Section titled “ GetVersionAsync(string, int, CancellationToken)”Returns the given version of the definition with the given name.
public ValueTask<AgentDefinition?> GetVersionAsync(string name, int version, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”name string
The agent name.
version int
The requested version number.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The definition, or null when that version does not exist.
ListAsync(CancellationToken)
Section titled “ ListAsync(CancellationToken)”Lists the current version of every definition.
public ValueTask<IReadOnlyList<AgentDefinition>> ListAsync(CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyList<AgentDefinition>>
The definitions.
ListVersionsAsync(string, CancellationToken)
Section titled “ ListVersionsAsync(string, CancellationToken)”Lists every version of a definition, from newest to oldest.
public ValueTask<IReadOnlyList<AgentDefinition>> ListVersionsAsync(string name, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”name string
The agent name.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”ValueTask<IReadOnlyList<AgentDefinition>>
The version history.
RollbackAsync(string, int, CancellationToken)
Section titled “ RollbackAsync(string, int, CancellationToken)”Makes the given version current. A rollback does not delete the old version; it saves its content as a new version.
public ValueTask<AgentDefinition> RollbackAsync(string name, int version, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”name string
The agent name.
version int
The version number to roll back to.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The definition saved as the new version.
SaveAsync(AgentDefinition, CancellationToken)
Section titled “ SaveAsync(AgentDefinition, CancellationToken)”Saves the definition and produces a new version. The
AgentDefinition.Version value of the incoming definition is ignored;
the store decides the version number.
public ValueTask<AgentDefinition> SaveAsync(AgentDefinition definition, CancellationToken cancellationToken = default)Parameters
Section titled “Parameters”definition AgentDefinition
The definition to save.
cancellationToken CancellationToken
The cancellation token.
Returns
Section titled “Returns”The definition with the new version number assigned.