UNPKG

@gati-framework/runtime

Version:

Gati runtime execution engine for running handler-based applications

90 lines 2.17 kB
/** * @module runtime/debug-gate-manager * @description Manages debug gates for pausing execution */ import type { DebugGate, StageName } from './types/trace.js'; import { EventEmitter } from 'events'; /** * Debug gate manager configuration */ export interface DebugGateManagerConfig { /** Enable debug gates */ enabled: boolean; /** Default gate timeout (ms) */ defaultTimeout: number; } /** * Gate trigger event */ export interface GateTriggerEvent { gateId: string; traceId: string; stage: StageName; timestamp: number; } /** * Manages debug gates for execution control */ export declare class DebugGateManager extends EventEmitter { private gates; private pausedExecutions; private config; constructor(config?: Partial<DebugGateManagerConfig>); /** * Create a debug gate */ createGate(traceId: string, stage: StageName, condition?: string): DebugGate; /** * Check if execution should pause at gate */ checkGate(traceId: string, stage: StageName, context?: Record<string, unknown>): Promise<void>; /** * Release a gate and resume execution */ releaseGate(gateId: string): boolean; /** * Remove a gate */ removeGate(gateId: string): boolean; /** * Get gate by ID */ getGate(gateId: string): DebugGate | null; /** * List all gates for a trace */ listGates(traceId?: string): DebugGate[]; /** * Clear all gates */ clear(): void; /** * Enable debug gates */ enable(): void; /** * Disable debug gates */ disable(): void; /** * Check if enabled */ isEnabled(): boolean; /** * Find active gate for trace and stage */ private findActiveGate; /** * Pause execution until gate is released */ private pauseExecution; /** * Evaluate gate condition */ private evaluateCondition; } /** * Create a debug gate manager instance */ export declare function createDebugGateManager(config?: Partial<DebugGateManagerConfig>): DebugGateManager; //# sourceMappingURL=debug-gate-manager.d.ts.map