UNPKG

@mondaydotcomorg/atp-compiler

Version:

Production-ready compiler for transforming async iteration patterns into resumable operations with checkpoint-based state management

57 lines 1.77 kB
import type { CacheProvider } from '@mondaydotcomorg/atp-protocol'; export interface DetectionResult { needsTransform: boolean; patterns: AsyncPattern[]; batchableParallel?: boolean; } export type AsyncPattern = 'for-of-await' | 'while-await' | 'map-async' | 'forEach-async' | 'filter-async' | 'reduce-async' | 'find-async' | 'some-async' | 'every-async' | 'flatMap-async' | 'promise-all' | 'promise-allSettled'; export interface TransformResult { code: string; transformed: boolean; patterns: AsyncPattern[]; metadata: TransformMetadata; } export interface TransformMetadata { loopCount: number; arrayMethodCount: number; parallelCallCount: number; batchableCount: number; } export interface LoopCheckpoint { loopId: string; currentIndex: number; results?: unknown[]; accumulator?: unknown; completed?: Set<number>; timestamp: number; } export interface BatchCallInfo { type: 'llm' | 'approval' | 'embedding'; operation: string; payload: Record<string, unknown>; } export interface RuntimeContext { executionId: string; cache?: CacheProvider; checkpointPrefix?: string; } export interface TransformerOptions { generateDebugInfo?: boolean; maxLoopNesting?: number; enableBatchParallel?: boolean; batchSizeThreshold?: number; } export interface PausableCallPattern { namespace: string; method: string; } export declare const PAUSABLE_CALL_PATTERNS: PausableCallPattern[]; export interface CompilerConfig { enableBatchParallel?: boolean; maxLoopNesting?: number; checkpointInterval?: number; debugMode?: boolean; batchSizeThreshold?: number; } export declare const DEFAULT_COMPILER_CONFIG: CompilerConfig; //# sourceMappingURL=types.d.ts.map