import { type ClientEndpointMessage, type EndpointToolContent, type EndpointToolErrorCode } from '@xopcai/endpoint-tools-protocol'; import { EndpointRegistry } from './registry.js'; import { EndpointToolPolicy } from './policy.js'; import type { EndpointUploadService } from './upload-service.js'; type ToolClientMessage = Exclude; export interface EndpointInvocationAuditSink { started(params: { id: string; principalId: string; endpointId: string; toolCallId: string; toolName: string; effect: 'read' | 'write' | 'destructive'; confirmationRequired: boolean; argumentsSha256: string; startedAt: number; }): void; finished(params: { id: string; status: 'succeeded' | 'failed'; errorCode?: EndpointToolErrorCode; errorMessage?: string; completedAt: number; }): void; } export interface EndpointInvocationServiceOptions { audit?: EndpointInvocationAuditSink; uploads?: EndpointUploadService; policy?: EndpointToolPolicy; } export interface EndpointInvocationResult { content: EndpointToolContent[]; details?: Record; } export declare class EndpointToolExecutionError extends Error { readonly code: EndpointToolErrorCode; constructor(code: EndpointToolErrorCode, message: string); } export declare class EndpointInvocationService { private readonly registry; private readonly options; private readonly pending; private readonly policy; constructor(registry: EndpointRegistry, options?: EndpointInvocationServiceOptions); invoke(params: { endpointId: string; toolCallId: string; toolName: string; arguments: Record; descriptorRevision: string; signal?: AbortSignal; onProgress?: (progress: { message?: string; percent?: number; }) => void; }): Promise; handleMessage(endpointId: string, message: ToolClientMessage): void; failEndpoint(endpointId: string): void; close(): void; private cancel; private succeed; private fail; private take; private error; } export {};