import { Inject, Injectable } from '@nestjs/common'; import type { RuntimeApprovalVerifier, RuntimeTerminationAction, } from '../agent/runtime-provider-registry.service.js'; import { CommandAuthorizationService } from './command-authorization.service.js'; /** * Adapter from the provider registry's exact termination action to the shared, * Redis-backed `interaction:command-approval:*` store. It has no separate approval * persistence or replay semantics. */ @Injectable() export class CommandRuntimeApprovalVerifier implements RuntimeApprovalVerifier { constructor( @Inject(CommandAuthorizationService) private readonly authorization: CommandAuthorizationService, ) {} async consume(approvalRef: string, action: RuntimeTerminationAction): Promise { return this.authorization.consumeRuntimeTerminationApproval(approvalRef, action); } }