import type { GatewayToolExecutionContext } from '../types.js'; type RandomBytes = (size: number) => Buffer; export type RunContextRegistryErrorCode = 'RUN_CONTEXT_KEY_INVALID' | 'RUN_CONTEXT_LEASE_CONFLICT' | 'RUN_CONTEXT_LEASE_EXPIRED'; export declare class RunContextRegistryError extends Error { readonly code: RunContextRegistryErrorCode; constructor(code: RunContextRegistryErrorCode, message: string); } export declare function createProcessContextKey(randomBytes?: RandomBytes): string; export declare function isProcessContextKey(value: unknown): value is string; export interface AcquiredRunContext { context: GatewayToolExecutionContext; releasePin: () => void; } export interface RunContextRegistryOptions { now?: () => number; hardCapMs?: number; createLeaseId?: () => string; } export declare class RunContextRegistry { private readonly entries; private readonly now; private readonly hardCapMs; private readonly createLeaseId; constructor(options?: RunContextRegistryOptions); register(contextKey: string, context: GatewayToolExecutionContext): string; acquire(contextKey: string): AcquiredRunContext | null; close(contextKey: string, leaseId: string): boolean; has(contextKey: string): boolean; private assertContextKey; private isExpired; private beginClosing; private removeIfCurrent; } export declare const runContextRegistry: RunContextRegistry; export {}; //# sourceMappingURL=run-context-registry.d.ts.map