HsSqlAgent.Approvals.Abstractions 2.0.5

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

HsSqlAgent.Approvals.Abstractions

Transport-neutral contracts for replacing HsSqlAgent's default MCP Elicitation DML approval with a host-owned approval integration.

Immediate approval

using HsSqlAgent.Approvals;

public sealed class CompanyApprovalProvider : IDmlApprovalProvider
{
    public async ValueTask<DmlApprovalResult> RequestApprovalAsync(
        DmlApprovalRequest request,
        CancellationToken cancellationToken = default)
    {
        var approvedBy = await CompanyApprovalApi.WaitForDecisionAsync(request, cancellationToken);

        return approvedBy is null
            ? DmlApprovalResult.Reject(request, "Rejected by company approval workflow.")
            : DmlApprovalResult.Approve(request, approvedBy);
    }
}

Register it with the Server package:

var hs = builder.Services.AddHsSqlAgentCore();
hs.AddHsSqlAgentRuntime();
hs.AddHsSqlAgentDmlApproval<CompanyApprovalProvider>();

Durable external approval

An asynchronous adapter may create a ticket or workflow item and return Pending instead of keeping the MCP request open:

public sealed class CompanyApprovalProvider : IDmlApprovalProvider
{
    public async ValueTask<DmlApprovalResult> RequestApprovalAsync(
        DmlApprovalRequest request,
        CancellationToken cancellationToken = default)
    {
        var externalId = await CompanyApprovalApi.CreateAsync(request, cancellationToken);
        return DmlApprovalResult.Pending(request, externalId);
    }
}

When the external system later reaches a final decision, the adapter passes that decision back to the host-provided completion sink:

public sealed class CompanyApprovalCallback(IDmlApprovalCompletionSink completionSink)
{
    public ValueTask<DmlApprovalCompletionResult> ApproveAsync(
        string requestId,
        string approvalFingerprint,
        string approver,
        string externalReference,
        CancellationToken cancellationToken = default) =>
        completionSink.CompleteAsync(
            DmlApprovalCompletion.Approve(
                requestId,
                approvalFingerprint,
                approver,
                externalReference),
            cancellationToken);
}

Durable pending approvals require the HsSqlAgent Admin Store. The current Server runtime persists the protected resume intent for up to DmlApprovalRequest.DurableUntil. A completion does not execute the old preview session: HsSqlAgent reloads current authorization and database configuration, reparses and previews the DML, compares the approved evidence, and creates a fresh short-lived execution challenge. Changed or revoked authorization, database configuration, custom-tool revision, policy, plan, row set, or affected-row evidence makes the request stale instead of committing it.

The approval provider and callback adapter never receive a database connection, transaction, validated execution plan, or commit primitive. HsSqlAgent retains ownership of SQL validation, evidence binding, commit-time revalidation, and atomic execution.

Product Compatible and additional computed target framework versions.
.NET 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.

NuGet packages (2)

Showing the top 2 NuGet packages that depend on HsSqlAgent.Approvals.Abstractions:

Package Downloads
HsSqlAgent.Server

Embeddable MCP SQL Agent components for ASP.NET Core with composable runtime, MCP, administration, authentication, UI, and telemetry capabilities.

HsSqlAgent.Approvals.Webhook

Official signed-webhook DML approval adapter for HsSqlAgent.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.5 80 9/8/2026
2.0.4 100 9/7/2026
2.0.3 112 9/5/2026