import { Blue, BlueNode } from '@blue-labs/language'; import { ContractBundle } from './contract-bundle.js'; import { ContractLoader } from './contract-loader.js'; import { ProcessorExecutionContext, ExecutionAdapter } from './processor-execution-context.js'; import { TerminationExecutionAdapter } from './termination-service.js'; import { DocumentProcessingRuntime } from '../runtime/document-processing-runtime.js'; import { JsonPatch } from '../model/shared/json-patch.js'; import { ContractProcessorRegistry } from '../registry/contract-processor-registry.js'; import { TerminationKind } from '../runtime/scope-runtime-context.js'; import { DocumentProcessingResult } from '../types/document-processing-result.js'; interface ExecutionHooks extends ExecutionAdapter, TerminationExecutionAdapter { bundleForScope(scopePath: string): ContractBundle | undefined; deliverLifecycle(scopePath: string, bundle: ContractBundle | null, event: BlueNode, finalizeAfter: boolean): Promise; } export declare class ProcessorExecution implements ExecutionHooks { private readonly contractLoader; private readonly registry; private readonly runtimeRef; private readonly bundles; private readonly pendingTerminations; private readonly cutOffScopes; private readonly checkpointManager; private readonly terminationService; private readonly channelRunner; private readonly scopeExecutor; constructor(contractLoader: ContractLoader, registry: ContractProcessorRegistry, blue: Blue, document: BlueNode); initializeScope(scopePath: string, chargeScopeEntry: boolean): Promise; loadBundles(scopePath: string): void; processExternalEvent(scopePath: string, event: BlueNode): Promise; handlePatch(scopePath: string, bundle: ContractBundle, patch: JsonPatch, allowReservedMutation: boolean): Promise; createContext(scopePath: string, bundle: ContractBundle, event: BlueNode, allowTerminatedWork?: boolean, allowReservedMutation?: boolean): ProcessorExecutionContext; result(): DocumentProcessingResult; runtime(): DocumentProcessingRuntime; bundleForScope(scopePath: string): ContractBundle | undefined; isScopeInactive(scopePath: string): boolean; enterGracefulTermination(scopePath: string, bundle: ContractBundle | null, reason: string | null): Promise; enterFatalTermination(scopePath: string, bundle: ContractBundle | null, reason: string | null): Promise; recordPendingTermination(scopePath: string, kind: TerminationKind, reason: string | null): void; clearPendingTermination(scopePath: string): void; markCutOff(scopePath: string): Promise; deliverLifecycle(scopePath: string, bundle: ContractBundle | null, event: BlueNode, finalizeAfter: boolean): Promise; recordLifecycleForBridging(scopePath: string, event: BlueNode): Promise; normalizeScope(scopePath: string): string; resolvePointer(scopePath: string, relativePointer: string): string; private terminate; private nodeAt; private evaluateChannel; private executeHandler; /** * Converts unexpected handler failures into fatal terminations while allowing * sentinel errors (RunTerminationError/MustUnderstandFailure) to propagate so * the outer run logic can react according to spec (ยง22). */ private handleHandlerError; private fatalReason; private lookupHandlerProcessor; private lookupChannelProcessor; private createDocumentUpdateEvent; private matchesDocumentUpdate; } export declare class ProcessorEngine { private readonly contractLoader; private readonly registry; private readonly blue; constructor(contractLoader: ContractLoader, registry: ContractProcessorRegistry, blue: Blue); initializeDocument(document: BlueNode): Promise; processDocument(document: BlueNode, event: BlueNode): Promise; isInitialized(document: BlueNode): boolean; createExecution(document: BlueNode): ProcessorExecution; private run; private initializationMarker; static nodeAt(root: BlueNode, pointer: string, options?: { calculateBlueId?: (node: BlueNode) => string; }): BlueNode | null; private static specialSegmentNode; } export {}; //# sourceMappingURL=processor-engine.d.ts.map