UNPKG

@mondaydotcomorg/atp-compiler

Version:

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

27 lines 1.04 kB
import * as t from '@babel/types'; export interface BatchOptimizationResult { canBatch: boolean; reason?: string; llmCallPattern?: 'single' | 'multiple' | 'conditional'; hasConditionals?: boolean; hasLoops?: boolean; } export interface SmartBatchDecision { shouldBatch: boolean; reason: string; strategy: 'always-batch' | 'size-dependent' | 'never-batch'; } export declare class BatchOptimizer { private arrayMethodsWithEarlyExit; canBatchArrayMethod(callback: t.Function): BatchOptimizationResult; /** * Smart decision: Should we batch based on array size and method type? */ makeSmartBatchDecision(methodName: string, batchResult: BatchOptimizationResult, arrayNode: t.Expression, threshold?: number): SmartBatchDecision; private estimateArraySize; canBatchForOfLoop(loopNode: t.ForOfStatement): BatchOptimizationResult; private containsBreakOrContinue; private isDirectPausableCall; private countPausableCalls; } //# sourceMappingURL=batch-optimizer.d.ts.map