import "reflect-metadata"; import { DependencyContainer as Container, DependencyContainer as DependencyContainer$1, Disposable, InjectionToken as InjectionToken$1, InjectionToken as TypeToken, Lifecycle, RegistrationOptions, container as container$1, delay, inject, injectAll, injectable, instanceCachingFactory, instancePerContainerCachingFactory, predicateAwareClassFactory, registry, singleton } from "tsyringe"; import { ZodType, z } from "zod"; import { ReadableStream } from "node:stream/web"; //#region src/contracts/baseTypes.d.ts type WorkflowId = string; type NodeId = string; type OutputPortKey = string; type InputPortKey = string; type PersistedTokenId = string; type NodeConnectionName = string; //#endregion //#region src/triggers/polling/PollingTriggerDedupWindow.d.ts declare class PollingTriggerDedupWindow { static readonly defaultCapN = 2000; merge(previous: ReadonlyArray, incoming: ReadonlyArray, capN?: number): ReadonlyArray; } //#endregion //#region src/triggers/polling/PollingTriggerLogger.d.ts interface PollingTriggerLogger { info(message: string): void; warn(message: string): void; error(message: string, exception?: Error): void; debug(message: string): void; } declare class NoOpPollingTriggerLogger implements PollingTriggerLogger { info(): void; warn(): void; error(): void; debug(): void; } //#endregion //#region src/contracts/credentialTypes.d.ts type CredentialTypeId = string; type CredentialInstanceId = string; type CredentialMaterialSourceKind = "db" | "env" | "code"; type CredentialSetupStatus = "draft" | "ready"; type CredentialHealthStatus = "unknown" | "healthy" | "failing"; type CredentialFieldSchema = Readonly<{ key: string; label: string; type: "string" | "password" | "textarea" | "json" | "boolean"; required?: true; order?: number; visibility?: "default" | "advanced"; placeholder?: string; helpText?: string; envVarName?: string; copyValue?: string; copyButtonLabel?: string; }>; type CredentialRequirement = Readonly<{ slotKey: string; label: string; acceptedTypes: ReadonlyArray; optional?: true; helpText?: string; helpUrl?: string; }>; type CredentialBindingKey = Readonly<{ workflowId: WorkflowId; nodeId: NodeId; slotKey: string; }>; type CredentialBinding = Readonly<{ key: CredentialBindingKey; instanceId: CredentialInstanceId; updatedAt: string; }>; type CredentialHealth = Readonly<{ status: CredentialHealthStatus; message?: string; testedAt?: string; expiresAt?: string; details?: Readonly>; }>; type OAuth2ProviderFromPublicConfig = Readonly<{ authorizeUrlFieldKey: string; tokenUrlFieldKey: string; userInfoUrlFieldKey?: string; }>; type CredentialOAuth2ScopesFromPublicConfig = Readonly<{ presetFieldKey: string; presetScopes: Readonly>>; customPresetKey?: string; customScopesFieldKey?: string; }>; type CredentialOAuth2AuthDefinition = Readonly<{ kind: "oauth2"; providerId: string; scopes: ReadonlyArray; scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig; clientIdFieldKey?: string; clientSecretFieldKey?: string; } | { kind: "oauth2"; providerFromPublicConfig: OAuth2ProviderFromPublicConfig; scopes: ReadonlyArray; scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig; clientIdFieldKey?: string; clientSecretFieldKey?: string; } | { kind: "oauth2"; providerId: string; authorizeUrl: string; tokenUrl: string; userInfoUrl?: string; scopes: ReadonlyArray; scopesFromPublicConfig?: CredentialOAuth2ScopesFromPublicConfig; clientIdFieldKey?: string; clientSecretFieldKey?: string; }>; type CredentialAuthDefinition = CredentialOAuth2AuthDefinition; type CredentialAdvancedSectionPresentation = Readonly<{ title?: string; description?: string; defaultOpen?: boolean; }>; type CredentialTypeDefinition = Readonly<{ typeId: CredentialTypeId; displayName: string; description?: string; publicFields?: ReadonlyArray; secretFields?: ReadonlyArray; advancedSection?: CredentialAdvancedSectionPresentation; supportedSourceKinds?: ReadonlyArray; auth?: CredentialAuthDefinition; }>; type CredentialJsonRecord = Readonly>; type CredentialInstanceRecord = Readonly<{ instanceId: CredentialInstanceId; typeId: CredentialTypeId; displayName: string; sourceKind: CredentialMaterialSourceKind; publicConfig: TPublicConfig; secretRef: CredentialJsonRecord; tags: ReadonlyArray; setupStatus: CredentialSetupStatus; createdAt: string; updatedAt: string; material: Readonly<{ source: "local" | "control-plane"; ref: string; }>; }>; type CredentialSessionFactoryArgs = Readonly<{ instance: CredentialInstanceRecord; material: TMaterial; publicConfig: TPublicConfig; }>; type CredentialSessionFactory = (args: CredentialSessionFactoryArgs) => Promise; type CredentialAccessTokenSessionArgs = Readonly<{ accessToken: string; grantedScopes: ReadonlyArray; publicConfig: TPublicConfig; }>; type CredentialAccessTokenSessionFactory = (args: CredentialAccessTokenSessionArgs) => Promise; type CredentialHealthTester = (args: CredentialSessionFactoryArgs) => Promise; type CredentialType = Readonly<{ definition: CredentialTypeDefinition; createSession: CredentialSessionFactory; createSessionFromAccessToken?: CredentialAccessTokenSessionFactory; test: CredentialHealthTester; }>; type AnyCredentialType = CredentialType; interface CredentialSessionService { getSession(args: Readonly<{ workflowId: WorkflowId; nodeId: NodeId; slotKey: string; }>): Promise; } interface CredentialTypeRegistry { listTypes(): ReadonlyArray; getType(typeId: CredentialTypeId): CredentialTypeDefinition | undefined; } declare class CredentialUnboundError extends Error { readonly bindingKey: CredentialBindingKey; readonly acceptedTypes: ReadonlyArray; constructor(bindingKey: CredentialBindingKey, acceptedTypes?: ReadonlyArray); private static createMessage; } //#endregion //#region src/contracts/collectionTypes.d.ts interface CollectionStore = Record> { insert(row: TRow): Promise; get(id: string): Promise<(TRow & { id: string; created_at: Date; updated_at: Date; }) | null>; findOne(filter: Partial): Promise<(TRow & { id: string; created_at: Date; updated_at: Date; }) | null>; list(opts?: { limit?: number; offset?: number; where?: Partial; }): Promise<{ rows: ReadonlyArray; total: number; }>; update(id: string, patch: Partial): Promise; delete(id: string): Promise<{ deleted: boolean; }>; } type CollectionsContext = Readonly>; //#endregion //#region src/contracts/CostTrackingTelemetryContract.d.ts type CostTrackingComponent = "chat" | "ocr" | "rag"; declare const CostTrackingTelemetryMetricNames: { readonly usage: "codemation.cost.usage"; readonly estimatedCost: "codemation.cost.estimated"; }; declare const CostTrackingTelemetryAttributeNames: { readonly component: "cost.component"; readonly provider: "cost.provider"; readonly operation: "cost.operation"; readonly pricingKey: "cost.pricing_key"; readonly usageUnit: "cost.usage_unit"; readonly currency: "cost.currency"; readonly currencyScale: "cost.currency_scale"; readonly estimateKind: "cost.estimate_kind"; }; interface CostTrackingUsageRecord { readonly component: CostTrackingComponent; readonly provider: string; readonly operation: string; readonly pricingKey: string; readonly usageUnit: string; readonly quantity: number; readonly modelName?: string; readonly attributes?: TelemetryAttributes; } interface CostTrackingPriceQuote { readonly currency: string; readonly currencyScale: number; readonly estimatedAmountMinor: number; readonly estimateKind: "catalog"; } interface CostTrackingTelemetry { captureUsage(args: CostTrackingUsageRecord): Promise; forScope(scope: TelemetryScope): CostTrackingTelemetry; } interface CostTrackingTelemetryFactory { create(args: Readonly<{ telemetry: ExecutionTelemetry; }>): CostTrackingTelemetry; } //#endregion //#region src/contracts/NoOpTelemetryArtifactReference.d.ts declare class NoOpTelemetryArtifactReference { static readonly value: TelemetryArtifactReference; } //#endregion //#region src/contracts/NoOpTelemetrySpanScope.d.ts declare class NoOpTelemetrySpanScope { static readonly value: TelemetrySpanScope; static readonly nodeExecutionTelemetryValue: NodeExecutionTelemetry; } //#endregion //#region src/contracts/NoOpNodeExecutionTelemetry.d.ts declare class NoOpNodeExecutionTelemetry { static readonly value: NodeExecutionTelemetry; } //#endregion //#region src/contracts/NoOpExecutionTelemetry.d.ts declare class NoOpExecutionTelemetry { static readonly value: ExecutionTelemetry; } //#endregion //#region src/contracts/NoOpExecutionTelemetryFactory.d.ts declare class NoOpExecutionTelemetryFactory implements ExecutionTelemetryFactory { create(_: Readonly<{ runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; policySnapshot?: PersistedRunPolicySnapshot; }>): ExecutionTelemetry; } //#endregion //#region src/contracts/CodemationTelemetryAttributeNames.d.ts declare class CodemationTelemetryAttributeNames { static readonly workflowId = "codemation.workflow.id"; static readonly runId = "codemation.run.id"; static readonly nodeId = "codemation.node.id"; static readonly activationId = "codemation.activation.id"; static readonly nodeType = "codemation.node.type"; static readonly nodeRole = "codemation.node.role"; static readonly workflowFolder = "codemation.workflow.folder"; static readonly connectionInvocationId = "codemation.connection.invocation_id"; static readonly toolName = "codemation.tool.name"; static readonly traceParentRunId = "codemation.parent.run.id"; static readonly iterationId = "codemation.iteration.id"; static readonly iterationIndex = "codemation.iteration.index"; static readonly parentInvocationId = "codemation.parent.invocation_id"; static readonly mcpServerId = "mcp.server_id"; static readonly mcpToolName = "mcp.tool_name"; static readonly nodeExecutionStatus = "codemation.node.execution_status"; static readonly runHaltReason = "codemation.run.halt_reason"; static readonly hitlTaskId = "codemation.hitl.task_id"; static readonly hitlChannel = "codemation.hitl.channel"; static readonly hitlDecisionStatus = "codemation.hitl.decision_status"; } //#endregion //#region src/contracts/GenAiTelemetryAttributeNames.d.ts declare class GenAiTelemetryAttributeNames { static readonly operationName = "gen_ai.operation.name"; static readonly requestModel = "gen_ai.request.model"; static readonly usageInputTokens = "gen_ai.usage.input_tokens"; static readonly usageOutputTokens = "gen_ai.usage.output_tokens"; static readonly usageTotalTokens = "gen_ai.usage.total_tokens"; static readonly usageCacheReadInputTokens = "gen_ai.usage.cache_read.input_tokens"; static readonly usageCacheCreationInputTokens = "gen_ai.usage.cache_creation.input_tokens"; static readonly usageReasoningTokens = "codemation.gen_ai.usage.reasoning_tokens"; } //#endregion //#region src/contracts/CodemationTelemetryMetricNames.d.ts declare class CodemationTelemetryMetricNames { static readonly agentTurns = "codemation.ai.turns"; static readonly agentToolCalls = "codemation.ai.tool_calls"; static readonly gmailMessagesEmitted = "codemation.gmail.messages_emitted"; static readonly gmailAttachments = "codemation.gmail.attachments"; static readonly gmailAttachmentBytes = "codemation.gmail.attachment_bytes"; } //#endregion //#region src/contracts/telemetryTypes.d.ts type TelemetryAttributePrimitive = string | number | boolean | null; interface TelemetryAttributes { readonly [key: string]: TelemetryAttributePrimitive | undefined; } interface TelemetryMetricRecord { readonly name: string; readonly value: number; readonly unit?: string; readonly attributes?: TelemetryAttributes; } interface TelemetrySpanEventRecord { readonly name: string; readonly occurredAt?: Date; readonly attributes?: TelemetryAttributes; } interface TelemetryArtifactAttachment { readonly kind: string; readonly contentType: string; readonly previewText?: string; readonly previewJson?: JsonValue; readonly payloadText?: string; readonly payloadJson?: JsonValue; readonly bytes?: number; readonly truncated?: boolean; readonly expiresAt?: Date; } interface TelemetryArtifactReference { readonly artifactId: string; readonly traceId?: string; readonly spanId?: string; } interface TelemetrySpanEnd { readonly status?: "ok" | "error"; readonly statusMessage?: string; readonly endedAt?: Date; readonly attributes?: TelemetryAttributes; } interface TelemetryChildSpanStart { readonly name: string; readonly kind?: "internal" | "client"; readonly startedAt?: Date; readonly attributes?: TelemetryAttributes; } interface TelemetryScope { readonly traceId?: string; readonly spanId?: string; readonly costTracking?: CostTrackingTelemetry; addSpanEvent(args: TelemetrySpanEventRecord): Promise | void; recordMetric(args: TelemetryMetricRecord): Promise | void; attachArtifact(args: TelemetryArtifactAttachment): Promise | TelemetryArtifactReference; } interface TelemetrySpanScope extends TelemetryScope { readonly traceId: string; readonly spanId: string; end(args?: TelemetrySpanEnd): Promise | void; asNodeTelemetry(args: Readonly<{ nodeId: NodeId; activationId: NodeActivationId; }>): NodeExecutionTelemetry; } interface NodeExecutionTelemetry extends ExecutionTelemetry, TelemetrySpanScope { startChildSpan(args: TelemetryChildSpanStart): TelemetrySpanScope; } interface ExecutionTelemetry extends TelemetryScope { readonly traceId: string; readonly spanId: string; forNode(args: Readonly<{ nodeId: NodeId; activationId: NodeActivationId; }>): NodeExecutionTelemetry; } interface ExecutionTelemetryFactory { create(args: Readonly<{ runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; policySnapshot?: PersistedRunPolicySnapshot; }>): ExecutionTelemetry; } //#endregion //#region src/contracts/workflowActivationPolicy.d.ts interface WorkflowActivationPolicy { isActive(workflowId: WorkflowId): boolean; } declare class AllWorkflowsActiveWorkflowActivationPolicy implements WorkflowActivationPolicy { isActive(_workflowId: WorkflowId): boolean; } //#endregion //#region src/contracts/webhookTypes.d.ts type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"; interface WebhookControlSignal { readonly __webhookControl: true; readonly kind: "respondNow" | "respondNowAndContinue"; readonly responseItems: Items; readonly continueItems?: Items; } interface WebhookTriggerRoutingDiagnostics { warn(message: string): void; info?(message: string): void; } interface TriggerInstanceId { workflowId: WorkflowId; nodeId: NodeId; } interface WebhookInvocationMatch { endpointPath: string; workflowId: WorkflowId; nodeId: NodeId; methods: ReadonlyArray; parseJsonBody?: (body: unknown) => unknown; } type WebhookTriggerResolution = { status: "notFound"; } | { status: "methodNotAllowed"; match: WebhookInvocationMatch; } | { status: "ok"; match: WebhookInvocationMatch; }; interface WebhookTriggerMatcher { match(args: { endpointPath: string; method: HttpMethod; }): WebhookInvocationMatch | undefined; lookup(endpointPath: string): WebhookInvocationMatch | undefined; onEngineWorkflowsLoaded?(): void; onEngineStopped?(): void; reloadWebhookRoutes?(): void; } //#endregion //#region src/contracts/runtimeTypes.d.ts type HumanTaskId = string; type Duration = string; interface HumanTaskHandle { readonly taskId: HumanTaskId; readonly runId: string; readonly nodeId: string; readonly expiresAt: Date; readonly resumeUrl: string; readonly metadata?: Readonly>; } interface HumanTaskSubject { readonly title: string; readonly summary: string; readonly attributes?: JsonValue; } interface HumanTaskActor { readonly actorId: string; readonly displayName?: string; } interface ResumeContext { readonly decision: Readonly<{ kind: "decided"; value: unknown; actor: HumanTaskActor; decidedAt: Date; }> | Readonly<{ kind: "timed_out"; at: Date; }> | Readonly<{ kind: "auto_accepted"; at: Date; }>; readonly delivery: JsonValue; readonly task: HumanTaskHandle; } declare class SuspensionRequest extends Error { readonly request: Readonly<{ decisionSchema: ZodType; timeout: Duration; onTimeout: "halt" | "auto-accept"; subject: HumanTaskSubject; metadata?: Readonly>; deliver: (handle: HumanTaskHandle) => Promise; }>; constructor(request: Readonly<{ decisionSchema: ZodType; timeout: Duration; onTimeout: "halt" | "auto-accept"; subject: HumanTaskSubject; metadata?: Readonly>; deliver: (handle: HumanTaskHandle) => Promise; }>); } interface WorkflowRunnerService { runById(args: { workflowId: WorkflowId; startAt?: NodeId; items: Items; parent?: ParentExecutionRef; }): Promise; } interface WorkflowRunnerResolver { resolve(): WorkflowRunnerService | undefined; } interface WorkflowRepository { list(): ReadonlyArray; get(workflowId: WorkflowId): WorkflowDefinition | undefined; } interface LiveWorkflowRepository extends WorkflowRepository { setWorkflows(workflows: ReadonlyArray): void; } interface NodeResolver { resolve(token: TypeToken): T; } interface NodeExecutionStatePublisher { markQueued(args: { nodeId: NodeId; activationId?: NodeActivationId; inputsByPort?: NodeInputsByPort; }): Promise; markRunning(args: { nodeId: NodeId; activationId?: NodeActivationId; inputsByPort?: NodeInputsByPort; }): Promise; markCompleted(args: { nodeId: NodeId; activationId?: NodeActivationId; inputsByPort?: NodeInputsByPort; outputs?: NodeOutputs; }): Promise; markFailed(args: { nodeId: NodeId; activationId?: NodeActivationId; inputsByPort?: NodeInputsByPort; error: Error; }): Promise; appendConnectionInvocation(args: ConnectionInvocationAppendArgs): Promise; setChildRunId?(args: { nodeId: NodeId; childRunId: RunId; }): Promise; } type BinaryBody = ReadableStream | AsyncIterable | Uint8Array | ArrayBuffer; interface BinaryStorageWriteRequest { storageKey: string; body: BinaryBody; } interface BinaryStorageWriteResult { storageKey: string; size: number; sha256?: string; } interface BinaryStorageReadResult { body: ReadableStream; size?: number; } interface BinaryStorageStatResult { exists: boolean; size?: number; } interface BinaryStorage { readonly driverName: string; write(args: BinaryStorageWriteRequest): Promise; openReadStream(storageKey: string): Promise; stat(storageKey: string): Promise; delete(storageKey: string): Promise; deleteMany(storageKeys: ReadonlyArray): Promise; listByPrefix(prefix: string): Promise>; } interface BinaryAttachmentCreateRequest { name: string; body: BinaryBody; mimeType: string; filename?: string; previewKind?: BinaryAttachment["previewKind"]; } interface NodeBinaryAttachmentService extends ExecutionBinaryService { attach(args: BinaryAttachmentCreateRequest): Promise; withAttachment(item: Item, name: string, attachment: BinaryAttachment): Item; } declare const BINARY_DEFAULT_MAX_BYTES: number; interface ExecutionBinaryService { forNode(args: { nodeId: NodeId; activationId: NodeActivationId; }): NodeBinaryAttachmentService; openReadStream(attachment: BinaryAttachment): Promise; getBytes(attachment: BinaryAttachment, maxBytes?: number): Promise; getText(attachment: BinaryAttachment, maxBytes?: number): Promise; getJson(attachment: BinaryAttachment, maxBytes?: number): Promise; } interface ExecutionContext { runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; subworkflowDepth: number; engineMaxNodeActivations: number; engineMaxSubworkflowDepth: number; now: () => Date; data: RunDataSnapshot; nodeState?: NodeExecutionStatePublisher; telemetry: ExecutionTelemetry; binary: ExecutionBinaryService; getCredential(slotKey: string): Promise; iterationId?: NodeIterationId; itemIndex?: number; parentInvocationId?: ConnectionInvocationId; testContext?: RunTestContext; readonly collections?: CollectionsContext; resolve(token: TypeToken): T; } interface ExecutionContextFactory { create(args: { runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; policySnapshot?: PersistedRunPolicySnapshot; subworkflowDepth: number; engineMaxNodeActivations: number; engineMaxSubworkflowDepth: number; data: RunDataSnapshot; nodeState?: NodeExecutionStatePublisher; telemetry?: ExecutionTelemetry; getCredential(slotKey: string): Promise; testContext?: RunTestContext; }): ExecutionContext; } interface NodeExecutionContext extends ExecutionContext { nodeId: NodeId; activationId: NodeActivationId; config: TConfig; telemetry: NodeExecutionTelemetry; binary: NodeBinaryAttachmentService; resumeContext?: ResumeContext; } interface TriggerPollingPort { start(args: { intervalMs: number; seedState?: TState; runCycle: (cycleCtx: { previousState: TState | undefined; signal: AbortSignal; }) => Promise<{ items: Items; nextState: TState; }>; }): Promise; } interface PollingTriggerHandle extends TriggerPollingPort { readonly dedup: PollingTriggerDedupWindow; } interface TriggerSetupContext = TriggerNodeConfig, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState> extends ExecutionContext { trigger: TriggerInstanceId; config: TConfig; previousState: TSetupState$1; registerCleanup(cleanup: TriggerCleanupHandle): void; emit(items: Items): Promise; readonly polling: PollingTriggerHandle; } interface TriggerTestItemsContext = TriggerNodeConfig, TSetupState$1 extends JsonValue | undefined = TriggerNodeSetupState> extends ExecutionContext { trigger: TriggerInstanceId; nodeId: NodeId; config: TConfig; previousState: TSetupState$1; } interface PersistedTriggerSetupState { trigger: TriggerInstanceId; updatedAt: string; state: TState; } interface TriggerSetupStateRepository { load(trigger: TriggerInstanceId): Promise; save(state: PersistedTriggerSetupState): Promise; delete(trigger: TriggerInstanceId): Promise; } interface TriggerCleanupHandle { stop(): Promise | void; } interface EngineHost { credentialSessions: CredentialSessionService; workflows?: WorkflowRunnerService; } interface RunnableNodeExecuteArgs = RunnableNodeConfig, TInputJson$1 = unknown> { readonly input: TInputJson$1; readonly item: Item; readonly itemIndex: number; readonly items: Items; readonly ctx: NodeExecutionContext; } interface RunnableNode = RunnableNodeConfig, TInputJson$1 = unknown, _TOutputJson = unknown> { readonly kind: "node"; readonly outputPorts?: ReadonlyArray; readonly inputSchema?: ZodType; execute(args: RunnableNodeExecuteArgs): Promise | unknown; } type ItemNode = RunnableNodeConfig, TInputJson$1 = unknown, TOutputJson$1 = unknown> = RunnableNode; interface MultiInputNode { kind: "node"; outputPorts?: ReadonlyArray; executeMulti(inputsByPort: NodeInputsByPort, ctx: NodeExecutionContext): Promise; } type TriggerSetupStateFor> = TriggerNodeSetupState; interface TriggerNode = TriggerNodeConfig> { kind: "trigger"; outputPorts: readonly ["main"]; setup(ctx: TriggerSetupContext): Promise>; execute(items: Items, ctx: NodeExecutionContext): Promise; } interface TestableTriggerNode = TriggerNodeConfig> extends TriggerNode { getTestItems(ctx: TriggerTestItemsContext): Promise; } type ExecutableTriggerNode = TriggerNodeConfig> = TriggerNode; interface NodeExecutionRequest { runId: RunId; activationId: NodeActivationId; workflowId: WorkflowId; nodeId: NodeId; input: Items; parent?: ParentExecutionRef; queue?: string; executionOptions?: RunExecutionOptions; } interface NodeExecutionScheduler { enqueue(request: NodeExecutionRequest): Promise<{ receiptId: string; }>; cancel?(receiptId: string): Promise; } interface NodeExecutionRequestHandler { handleNodeExecutionRequest(request: NodeExecutionRequest): Promise; } type NodeActivationRequestBase = Readonly<{ runId: RunId; activationId: NodeActivationId; workflowId: WorkflowId; nodeId: NodeId; parent?: ParentExecutionRef; executionOptions?: RunExecutionOptions; batchId?: string; ctx: NodeExecutionContext; }>; type NodeActivationRequest = (NodeActivationRequestBase & Readonly<{ kind: "single"; input: Items; }>) | (NodeActivationRequestBase & Readonly<{ kind: "multi"; inputsByPort: NodeInputsByPort; }>); interface NodeActivationReceipt { receiptId: string; mode?: "local" | "worker"; queue?: string; } interface PreparedNodeActivationDispatch { readonly receipt: NodeActivationReceipt; dispatch(): Promise; } interface NodeActivationContinuation { markNodeRunning(args: { runId: RunId; activationId: NodeActivationId; nodeId: NodeId; inputsByPort: NodeInputsByPort; }): Promise; resumeFromNodeResult(args: { runId: RunId; activationId: NodeActivationId; nodeId: NodeId; outputs: NodeOutputs; }): Promise; resumeFromNodeError(args: { runId: RunId; activationId: NodeActivationId; nodeId: NodeId; error: Error; }): Promise; } interface NodeActivationScheduler { setContinuation?(continuation: NodeActivationContinuation): void; prepareDispatch(request: NodeActivationRequest): Promise; cancel?(receiptId: string): Promise; } interface WorkflowNodeInstanceFactory { createNodes(workflow: WorkflowDefinition): ReadonlyMap; createByType(type: TypeToken): unknown; } interface NodeExecutor { execute(request: NodeActivationRequest): Promise; } interface WorkflowSnapshotFactory { create(workflow: WorkflowDefinition): PersistedWorkflowSnapshot; } interface WorkflowSnapshotResolver { resolve(args: { workflowId: WorkflowId; workflowSnapshot?: PersistedWorkflowSnapshot; }): WorkflowDefinition | undefined; } interface TriggerRuntimeDiagnostics { info(message: string): void; warn(message: string): void; } interface EngineDeps { credentialSessions: CredentialSessionService; liveWorkflowRepository: LiveWorkflowRepository; workflowRepository: WorkflowRepository; workflowActivationPolicy: WorkflowActivationPolicy; nodeResolver: NodeResolver; triggerSetupStateRepository: TriggerSetupStateRepository; webhookTriggerMatcher: WebhookTriggerMatcher; runIdFactory: RunIdFactory; activationIdFactory: ActivationIdFactory; workflowExecutionRepository: WorkflowExecutionRepository; activationScheduler: NodeActivationScheduler; runDataFactory: RunDataFactory; executionContextFactory: ExecutionContextFactory; executionTelemetryFactory?: ExecutionTelemetryFactory; nodeExecutor: NodeExecutor; eventBus?: RunEventBus; tokenRegistry: PersistedWorkflowTokenRegistryLike; workflowNodeInstanceFactory: WorkflowNodeInstanceFactory; workflowPolicyRuntimeDefaults?: WorkflowPolicyRuntimeDefaults; triggerRuntimeDiagnostics?: TriggerRuntimeDiagnostics; pollingTriggerLogger?: PollingTriggerLogger; } //#endregion //#region src/contracts/retryPolicySpec.types.d.ts type RetryPolicySpec = NoneRetryPolicySpec | FixedRetryPolicySpec | ExponentialRetryPolicySpec; interface NoneRetryPolicySpec { readonly kind: "none"; } interface FixedRetryPolicySpec { readonly kind: "fixed"; readonly maxAttempts: number; readonly delayMs: number; } interface ExponentialRetryPolicySpec { readonly kind: "exponential"; readonly maxAttempts: number; readonly initialDelayMs: number; readonly multiplier: number; readonly maxDelayMs?: number; readonly jitter?: boolean; } //#endregion //#region src/contracts/workflowTypes.d.ts type NodeIdRef = NodeId & Readonly<{ __codemationNodeJson?: TJson; }>; type NodeKind = "trigger" | "node"; type JsonPrimitive = string | number | boolean | null; interface JsonObject { readonly [key: string]: JsonValue; } type JsonValue = JsonPrimitive | JsonObject | JsonArray; type JsonArray = ReadonlyArray; type JsonNonArray = JsonPrimitive | JsonObject; interface Edge { from: { nodeId: NodeId; output: OutputPortKey; }; to: { nodeId: NodeId; input: InputPortKey; }; } interface WorkflowNodeConnection { readonly parentNodeId: NodeId; readonly connectionName: NodeConnectionName; readonly childNodeIds: ReadonlyArray; } interface WorkflowDefinition { id: WorkflowId; name: string; nodes: NodeDefinition[]; edges: Edge[]; readonly connections?: ReadonlyArray; discoveryPathSegments?: readonly string[]; readonly prunePolicy?: WorkflowPrunePolicySpec; readonly storagePolicy?: WorkflowStoragePolicySpec; readonly workflowErrorHandler?: WorkflowErrorHandlerSpec; } interface WorkflowGraph { next(nodeId: NodeId, output: OutputPortKey): ReadonlyArray>; } interface WorkflowGraphFactory { create(def: WorkflowDefinition): WorkflowGraph; } interface NodeConfigBase { readonly kind: NodeKind; readonly type: TypeToken; readonly name?: string; readonly id?: NodeId; readonly icon?: string; readonly description?: string; readonly execution?: Readonly<{ hint?: "local" | "worker"; queue?: string; }>; readonly retryPolicy?: RetryPolicySpec; readonly nodeErrorHandler?: NodeErrorHandlerSpec; readonly continueWhenEmptyOutput?: boolean; readonly declaredOutputPorts?: ReadonlyArray; readonly declaredInputPorts?: ReadonlyArray; getCredentialRequirements?(): ReadonlyArray; readonly emitsAssertions?: true; inspectorSummary?(): ReadonlyArray | undefined; } interface PollingTriggerConfig { getTriggerPollConfig(): Readonly<{ config: JsonObject; pollIntervalMs?: number; }>; } interface NodeInspectorSummaryRow { readonly label: string; readonly value: string; } declare const runnableNodeInputType: unique symbol; declare const runnableNodeOutputType: unique symbol; declare const triggerNodeOutputType: unique symbol; interface RunnableNodeConfig extends NodeConfigBase { readonly kind: "node"; readonly [runnableNodeInputType]?: TInputJson$1; readonly [runnableNodeOutputType]?: TOutputJson$1; readonly inputSchema?: ZodType; readonly emptyBatchExecution?: "skip" | "runOnce"; } declare const triggerNodeSetupStateType: unique symbol; interface TriggerNodeConfig extends NodeConfigBase { readonly kind: "trigger"; readonly [triggerNodeOutputType]?: TOutputJson$1; readonly [triggerNodeSetupStateType]?: TSetupState$1; readonly triggerKind?: "live" | "test"; } type RunnableNodeInputJson> = TConfig extends RunnableNodeConfig ? TInputJson : never; type RunnableNodeOutputJson> = TConfig extends RunnableNodeConfig ? TOutputJson : never; type TriggerNodeOutputJson> = TConfig extends TriggerNodeConfig ? TOutputJson : never; type TriggerNodeSetupState> = TConfig extends TriggerNodeConfig ? TSetupState : never; interface NodeDefinition { id: NodeId; kind: NodeKind; type: TypeToken; name?: string; config: NodeConfigBase; } interface NodeRef { id: NodeId; kind: NodeKind; name?: string; } declare function nodeRef(nodeId: NodeId): NodeIdRef; type PairedItemRef = Readonly<{ nodeId: NodeId; output: OutputPortKey; itemIndex: number; }>; type BinaryPreviewKind = "image" | "audio" | "video" | "download"; type BinaryAttachment = Readonly<{ id: string; storageKey: string; mimeType: string; size: number; storageDriver: string; previewKind: BinaryPreviewKind; createdAt: string; runId: RunId; workflowId: WorkflowId; nodeId: NodeId; activationId: NodeActivationId; filename?: string; sha256?: string; }>; type ItemBinary = Readonly>; type Item = Readonly<{ json: TJson; binary?: ItemBinary; meta?: Readonly>; paired?: ReadonlyArray; }>; type Items = ReadonlyArray>; type NodeOutputs = Partial>; type RunId = string; type NodeActivationId = string; type NodeIterationId = string; interface ParentExecutionRef { runId: RunId; workflowId: WorkflowId; nodeId: NodeId; subworkflowDepth?: number; engineMaxNodeActivations?: number; engineMaxSubworkflowDepth?: number; testContext?: RunTestContext; } interface RunDataSnapshot { getOutputs(nodeId: NodeId): NodeOutputs | undefined; getOutputItems(nodeId: NodeId | NodeIdRef, output?: OutputPortKey): Items; getOutputItem(nodeId: NodeId | NodeIdRef, itemIndex: number, output?: OutputPortKey): Item | undefined; } interface MutableRunData extends RunDataSnapshot { setOutputs(nodeId: NodeId, outputs: NodeOutputs): void; dump(): Record; } interface RunDataFactory { create(initial?: Record): MutableRunData; } interface RunIdFactory { makeRunId(): RunId; } interface ActivationIdFactory { makeActivationId(): NodeActivationId; } type UpstreamRefPlaceholder = `$${number}`; declare const branchRef: (index: number) => UpstreamRefPlaceholder; type ExecutionMode = "local" | "worker"; interface NodeSchedulerDecision { mode: ExecutionMode; queue?: string; } interface NodeOffloadPolicy { decide(args: { workflowId: WorkflowId; nodeId: NodeId; config: NodeConfigBase; }): NodeSchedulerDecision; } type WorkflowStoragePolicyMode = "ALL" | "SUCCESS" | "ERROR" | "NEVER"; type WorkflowStoragePolicySpec = WorkflowStoragePolicyMode | TypeToken; interface WorkflowStoragePolicyResolver { shouldPersist(args: WorkflowStoragePolicyDecisionArgs): boolean | Promise; } interface WorkflowStoragePolicyDecisionArgs { readonly runId: RunId; readonly workflowId: WorkflowId; readonly workflow: WorkflowDefinition; readonly finalStatus: "completed" | "failed"; readonly startedAt: string; readonly finishedAt: string; } interface WorkflowPrunePolicySpec { readonly runDataRetentionSeconds?: number; readonly binaryRetentionSeconds?: number; readonly telemetrySpanRetentionSeconds?: number; readonly telemetryArtifactRetentionSeconds?: number; readonly telemetryMetricRetentionSeconds?: number; } interface PersistedRunPolicySnapshot { readonly retentionSeconds?: number; readonly binaryRetentionSeconds?: number; readonly telemetrySpanRetentionSeconds?: number; readonly telemetryArtifactRetentionSeconds?: number; readonly telemetryMetricRetentionSeconds?: number; readonly storagePolicy: WorkflowStoragePolicyMode; } interface WorkflowErrorHandler { onError(ctx: WorkflowErrorContext): void | Promise; } interface WorkflowErrorContext { readonly runId: RunId; readonly workflowId: WorkflowId; readonly workflow: WorkflowDefinition; readonly failedNodeId: NodeId; readonly error: Error; readonly startedAt: string; readonly finishedAt: string; } type WorkflowErrorHandlerSpec = TypeToken | WorkflowErrorHandler; interface NodeErrorHandlerArgs { readonly kind: "single" | "multi"; readonly items: Items; readonly inputsByPort: Readonly> | undefined; readonly ctx: NodeExecutionContext; readonly error: Error; } interface NodeErrorHandler { handle(args: NodeErrorHandlerArgs): Promise; } type NodeErrorHandlerSpec = TypeToken | NodeErrorHandler; interface WorkflowPolicyRuntimeDefaults { readonly retentionSeconds?: number; readonly binaryRetentionSeconds?: number; readonly telemetrySpanRetentionSeconds?: number; readonly telemetryArtifactRetentionSeconds?: number; readonly telemetryMetricRetentionSeconds?: number; readonly storagePolicy?: WorkflowStoragePolicyMode; } //#endregion //#region src/contracts/testTriggerTypes.d.ts type TestSuiteRunId = string; interface TestTriggerSetupContext = TestTriggerNodeConfig> { readonly workflowId: WorkflowId; readonly nodeId: NodeId; readonly config: TConfig; readonly testSuiteRunId: TestSuiteRunId; getCredential(slotKey: string): Promise; readonly signal: AbortSignal; } interface TestTriggerNodeConfig extends TriggerNodeConfig { readonly triggerKind: "test"; generateItems(ctx: TestTriggerSetupContext>): AsyncIterable>; readonly concurrency?: number; readonly description?: string; caseLabel?(item: Item): string | undefined; } //#endregion //#region src/events/runEvents.d.ts type TestCaseRunStatus = "running" | "succeeded" | "failed" | "errored" | "cancelled"; type TestSuiteRunStatus = "succeeded" | "failed" | "partial" | "errored" | "cancelled"; type RunEvent = Readonly<{ kind: "runCreated"; runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; at: string; }> | Readonly<{ kind: "runSaved"; runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; at: string; state: PersistedRunState; }> | Readonly<{ kind: "nodeQueued"; runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; at: string; snapshot: NodeExecutionSnapshot; }> | Readonly<{ kind: "nodeStarted"; runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; at: string; snapshot: NodeExecutionSnapshot; }> | Readonly<{ kind: "nodeCompleted"; runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; at: string; snapshot: NodeExecutionSnapshot; }> | Readonly<{ kind: "nodeFailed"; runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; at: string; snapshot: NodeExecutionSnapshot; }> | Readonly<{ kind: "connectionInvocationStarted"; runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; at: string; record: ConnectionInvocationRecord; }> | Readonly<{ kind: "connectionInvocationCompleted"; runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; at: string; record: ConnectionInvocationRecord; }> | Readonly<{ kind: "connectionInvocationFailed"; runId: RunId; workflowId: WorkflowId; parent?: ParentExecutionRef; at: string; record: ConnectionInvocationRecord; }> | Readonly<{ kind: "testSuiteStarted"; testSuiteRunId: TestSuiteRunId; workflowId: WorkflowId; triggerNodeId: string; triggerNodeName?: string; concurrency: number; at: string; }> | Readonly<{ kind: "testSuiteFinished"; testSuiteRunId: TestSuiteRunId; workflowId: WorkflowId; status: TestSuiteRunStatus; totalCases: number; passedCases: number; failedCases: number; at: string; }> | Readonly<{ kind: "testCaseStarted"; testSuiteRunId: TestSuiteRunId; testCaseIndex: number; runId: RunId; workflowId: WorkflowId; testCaseLabel?: string; at: string; }> | Readonly<{ kind: "testCaseCompleted"; testSuiteRunId: TestSuiteRunId; testCaseIndex: number; runId: RunId; workflowId: WorkflowId; status: TestCaseRunStatus; at: string; }>; interface RunEventSubscription { close(): Promise; } interface RunEventBus { publish(event: RunEvent): Promise; subscribe(onEvent: (event: RunEvent) => void): Promise; subscribeToWorkflow(workflowId: WorkflowId, onEvent: (event: RunEvent) => void): Promise; } //#endregion //#region src/policies/executionLimits/EngineExecutionLimitsPolicy.d.ts interface EngineExecutionLimitsPolicyConfig { readonly defaultMaxNodeActivations: number; readonly hardMaxNodeActivations: number; readonly defaultMaxSubworkflowDepth: number; readonly hardMaxSubworkflowDepth: number; } declare const ENGINE_EXECUTION_LIMITS_DEFAULTS: EngineExecutionLimitsPolicyConfig; declare class EngineExecutionLimitsPolicy { private readonly config; constructor(config?: EngineExecutionLimitsPolicyConfig); createRootExecutionOptions(): RunExecutionOptions; mergeExecutionOptionsForNewRun(parent: ParentExecutionRef | undefined, user: RunExecutionOptions | undefined): RunExecutionOptions; private capNumber; } //#endregion //#region src/contracts/triggerInvokerTypes.d.ts interface TriggerInvoker { invoke(trigger: TriggerInstanceId, config: TriggerNodeConfig, lastRanAt: string | undefined): Promise; } //#endregion //#region src/di/CoreTokens.d.ts declare const CoreTokens: { readonly PersistedWorkflowTokenRegistry: TypeToken; readonly CredentialSessionService: TypeToken; readonly CredentialTypeRegistry: TypeToken; readonly WorkflowRunnerService: TypeToken; readonly LiveWorkflowRepository: TypeToken; readonly WorkflowRepository: TypeToken; readonly NodeResolver: TypeToken; readonly WorkflowNodeInstanceFactory: TypeToken; readonly RunIdFactory: TypeToken; readonly ActivationIdFactory: TypeToken; readonly WorkflowExecutionRepository: TypeToken; readonly TriggerSetupStateRepository: TypeToken; readonly NodeActivationScheduler: TypeToken; readonly RunDataFactory: TypeToken; readonly ExecutionContextFactory: TypeToken; readonly RunEventBus: TypeToken; readonly BinaryStorage: TypeToken; readonly WebhookBasePath: TypeToken; readonly EngineExecutionLimitsPolicy: TypeToken; readonly WorkflowActivationPolicy: TypeToken; readonly AgentMcpIntegration: TypeToken; readonly TriggerInvoker: TypeToken; }; //#endregion //#region src/contracts/runTypes.d.ts interface RunTestContext { readonly testSuiteRunId: string; readonly testCaseIndex: number; readonly testCaseLabel?: string; } interface RunExecutionOptions { localOnly?: boolean; webhook?: boolean; mode?: "manual" | "debug"; sourceWorkflowId?: WorkflowId; sourceRunId?: RunId; derivedFromRunId?: RunId; isMutable?: boolean; subworkflowDepth?: number; maxNodeActivations?: number; maxSubworkflowDepth?: number; testContext?: RunTestContext; } interface EngineRunCounters { completedNodeActivations: number; } type RunStopCondition = Readonly<{ kind: "workflowCompleted"; }> | Readonly<{ kind: "nodeCompleted"; nodeId: NodeId; }>; interface RunStateResetRequest { clearFromNodeId: NodeId; } interface PersistedRunControlState { stopCondition?: RunStopCondition; } interface PersistedWorkflowSnapshotNode { id: NodeId; kind: NodeKind; name?: string; nodeTokenId: PersistedTokenId; configTokenId: PersistedTokenId; tokenName?: string; configTokenName?: string; config: unknown; inspectorSummary?: ReadonlyArray>; } interface PersistedWorkflowSnapshot { id: WorkflowId; name: string; nodes: ReadonlyArray; edges: ReadonlyArray; workflowErrorHandlerConfigured?: boolean; connections?: ReadonlyArray; } type PinnedNodeOutputsByPort = Readonly>; interface PersistedMutableNodeState { pinnedOutputsByPort?: PinnedNodeOutputsByPort; lastDebugInput?: Items; } interface PersistedMutableRunState { nodesById: Readonly>; } type NodeInputsByPort = Readonly>; interface RunQueueEntry { nodeId: NodeId; input: Items; toInput?: InputPortKey; batchId?: string; from?: Readonly<{ nodeId: NodeId; output: OutputPortKey; }>; collect?: Readonly<{ expectedInputs: ReadonlyArray; received: Readonly>; }>; } type NodeExecutionStatus = "pending" | "queued" | "running" | "completed" | "failed" | "skipped" | "hitl-approved" | "hitl-rejected" | "hitl-timeout" | "hitl-auto-accepted" | "hitl-cancelled"; interface NodeExecutionError { message: string; name?: string; stack?: string; details?: JsonValue; } interface NodeExecutionSnapshot { runId: RunId; workflowId: WorkflowId; nodeId: NodeId; activationId?: NodeActivationId; parent?: ParentExecutionRef; status: NodeExecutionStatus; usedPinnedOutput?: boolean; queuedAt?: string; startedAt?: string; finishedAt?: string; updatedAt: string; inputsByPort?: NodeInputsByPort; outputs?: NodeOutputs; error?: NodeExecutionError; childRunId?: RunId; } type ConnectionInvocationId = string; interface ConnectionInvocationRecord { readonly invocationId: ConnectionInvocationId; readonly runId: RunId; readonly workflowId: WorkflowId; readonly connectionNodeId: NodeId; readonly parentAgentNodeId: NodeId; readonly parentAgentActivationId: NodeActivationId; readonly status: NodeExecutionStatus; readonly managedInput?: JsonValue; readonly managedOutput?: JsonValue; readonly statusLabel?: string; readonly subjectName?: string; readonly error?: NodeExecutionError; readonly queuedAt?: string; readonly startedAt?: string; readonly finishedAt?: string; readonly updatedAt: string; readonly iterationId?: NodeIterationId; readonly itemIndex?: number; readonly parentInvocationId?: ConnectionInvocationId; } type ConnectionInvocationAppendArgs = Readonly<{ invocationId: ConnectionInvocationId; connectionNodeId: NodeId; parentAgentNodeId: NodeId; parentAgentActivationId: NodeActivationId; status: NodeExecutionStatus; managedInput?: JsonValue; managedOutput?: JsonValue; statusLabel?: string; subjectName?: string; error?: NodeExecutionError; queuedAt?: string; startedAt?: string; finishedAt?: string; iterationId?: NodeIterationId; itemIndex?: number; parentInvocationId?: ConnectionInvocationId; }>; interface RunCurrentState { outputsByNode: Record; nodeSnapshotsByNodeId: Record; connectionInvocations?: ReadonlyArray; mutableState?: PersistedMutableRunState; } interface CurrentStateExecutionRequest { workflow: WorkflowDefinition; items?: Items; parent?: ParentExecutionRef; executionOptions?: RunExecutionOptions; workflowSnapshot?: PersistedWorkflowSnapshot; mutableState?: PersistedMutableRunState; currentState?: RunCurrentState; stopCondition?: RunStopCondition; reset?: RunStateResetRequest; } interface ExecutionFrontierPlan { rootNodeId?: NodeId; rootNodeInput?: Items; queue: RunQueueEntry[]; currentState: RunCurrentState; stopCondition: RunStopCondition; satisfiedNodeIds: ReadonlyArray; skippedNodeIds: ReadonlyArray; clearedNodeIds: ReadonlyArray; preservedPinnedNodeIds: ReadonlyArray; } type RunStatus = "running" | "pending" | "completed" | "failed" | "suspended" | "halted"; type RunHaltReason = "hitl-rejected" | "hitl-timeout" | "hitl-cancelled"; interface RunSummary { runId: RunId; workflowId: WorkflowId; startedAt: string; status: RunStatus; testCaseStatus?: TestCaseRunStatus; finishedAt?: string; parent?: ParentExecutionRef; executionOptions?: RunExecutionOptions; } interface PendingNodeExecution { runId: RunId; activationId: NodeActivationId; workflowId: WorkflowId; nodeId: NodeId; itemsIn: number; inputsByPort: NodeInputsByPort; receiptId: string; queue?: string; batchId?: string; enqueuedAt: string; } interface PersistedRunSchedulingState { pending?: PendingNodeExecution; queue: RunQueueEntry[]; } interface PersistedSuspensionEntry { readonly taskId: string; readonly nodeId: NodeId; readonly activationId: NodeActivationId; readonly itemIndex: number; readonly decisionSchemaHash: string; readonly deliveryRef: JsonValue; readonly timeoutAt: string; readonly onTimeout: "halt" | "auto-accept"; } interface PendingResumeEntry { readonly activationId: NodeActivationId; readonly nodeId: NodeId; readonly resumeContext: unknown; } interface PersistedRunState { runId: RunId; workflowId: WorkflowId; startedAt: string; finishedAt?: string; revision?: number; parent?: ParentExecutionRef; executionOptions?: RunExecutionOptions; control?: PersistedRunControlState; workflowSnapshot?: PersistedWorkflowSnapshot; mutableState?: PersistedMutableRunState; policySnapshot?: PersistedRunPolicySnapshot; engineCounters?: EngineRunCounters; status: RunStatus; reason?: RunHaltReason; pending?: PendingNodeExecution; queue: RunQueueEntry[]; outputsByNode: Record; nodeSnapshotsByNodeId: Record; connectionInvocations?: ReadonlyArray; suspension?: ReadonlyArray; pendingResume?: PendingResumeEntry; } interface WorkflowExecutionRepository { createRun(args: { runId: RunId; workflowId: WorkflowId; startedAt: string; parent?: ParentExecutionRef; executionOptions?: RunExecutionOptions; control?: PersistedRunControlState; workflowSnapshot?: PersistedWorkflowSnapshot; mutableState?: PersistedMutableRunState; policySnapshot?: PersistedRunPolicySnapshot; engineCounters?: EngineRunCounters; }): Promise; load(runId: RunId): Promise; loadSchedulingState(runId: RunId): Promise; save(state: PersistedRunState): Promise; deleteRun?(runId: RunId): Promise; } interface WorkflowExecutionListingRepository { listRuns(args?: Readonly<{ workflowId?: WorkflowId; limit?: number; }>): Promise>; } interface RunPruneCandidate { readonly runId: RunId; readonly workflowId: WorkflowId; readonly startedAt: string; readonly finishedAt: string; } interface WorkflowExecutionPruneRepository { listRunsOlderThan(args: Readonly<{ nowIso: string; defaultRetentionSeconds: number; limit?: number; }>): Promise>; } type RunResult = { runId: RunId; workflowId: WorkflowId; startedAt: string; status: "completed"; outputs: Items; } | { runId: RunId; workflowId: WorkflowId; startedAt: string; status: "pending"; pending: PendingNodeExecution; } | { runId: RunId; workflowId: WorkflowId; startedAt: string; status: "failed"; error: { message: string; }; } | { runId: RunId; workflowId: WorkflowId; startedAt: string; status: "halted"; reason: RunHaltReason; }; type WebhookRunResult = Readonly<{ runId: RunId; workflowId: WorkflowId; startedAt: string; runStatus: "pending" | "completed"; response: Items; }>; interface PersistedWorkflowTokenRegistryLike { register(type: TypeToken, packageId: string, persistedNameOverride?: string): string; getTokenId(type: TypeToken): string | undefined; resolve(tokenId: string): TypeToken | undefined; registerFromWorkflows?(workflows: ReadonlyArray): void; } interface RunCompletionNotifier { resolveRunCompletion(result: RunResult): void; resolveWebhookResponse(result: WebhookRunResult): void; } interface RunEventPublisherDeps { eventBus?: RunEventBus; } //#endregion //#region src/contracts/agentMcpTypes.d.ts interface NeedsReconsentEvent { readonly serverId: string; readonly credentialInstanceId: string; readonly missingScopesHint?: readonly string[]; } type AgentMcpToolMap = ReadonlyMap>>; interface AgentMcpIntegration { prepareMcpTools(args: { readonly workflowId: WorkflowId; readonly agentNodeId: NodeId; readonly serverIds: ReadonlyArray; readonly pinnedMcpTools: readonly string[]; readonly emitSpanEvent: (event: TelemetrySpanEventRecord) => void; readonly startChildSpan: (args: { readonly name: string; readonly attributes?: Record; }) => { readonly end: (args?: { status?: "ok" | "error"; statusMessage?: string; }) => void; }; readonly appendMcpInvocation?: (args: ConnectionInvocationAppendArgs) => Promise; readonly parentAgentActivationId?: NodeActivationId; readonly iterationId?: NodeIterationId; readonly itemIndex?: number; readonly parentInvocationId?: ConnectionInvocationId; }): Promise; } //#endregion //#region src/contracts/dispatchTypes.d.ts type WorkspaceId = string; type DispatchBinaryRef = BinaryAttachment; interface DispatchItemMeta { readonly id: string; readonly json?: JsonValue; readonly binary?: Readonly>; } interface WorkflowDispatch { readonly runId: RunId; readonly workspaceId: WorkspaceId; readonly workflowId: WorkflowId; readonly triggerNodeId: NodeId; readonly items: ReadonlyArray; readonly triggerContext: JsonValue; } declare function serializeDispatch(dispatch: WorkflowDispatch): string; declare function deserializeDispatch(raw: string): WorkflowDispatch; //#endregion //#region src/contracts/AgentBindError.d.ts declare class AgentBindError extends Error { constructor(message: string); } //#endregion //#region src/contracts/NoOpAgentMcpIntegration.d.ts declare class NoOpAgentMcpIntegration implements AgentMcpIntegration { prepareMcpTools(): Promise; } //#endregion //#region src/contracts/assertionTypes.d.ts interface AssertionResult { readonly name: string; readonly score: number; readonly passThreshold?: number; readonly errored?: true; readonly expected?: JsonValue; readonly actual?: JsonValue; readonly message?: string; readonly details?: Readonly>; } declare const DEFAULT_ASSERTION_PASS_THRESHOLD = 0.5; declare function deriveAssertionPassed(result: { readonly score: number; readonly passThreshold?: number; readonly errored?: true; }): boolean; interface AssertionResultProvenance { readonly nodeId: NodeId; readonly iterationId?: string; readonly itemIndex?: number; } //#endregion //#region src/contracts/itemExpr.d.ts type ItemExprResolvedContext = Readonly<{ runId: RunId; workflowId: WorkflowId; nodeId: NodeId; activationId: NodeActivationId; data: RunDataSnapshot; }>; type ItemExprContext = ItemExprResolvedContext; type ItemExprArgs = Readonly<{ item: Item; itemIndex: number; items: Items; ctx: ItemExprContext; }>; type ItemExprCallback = (args: ItemExprArgs) => T | Promise; type ItemExpr = Readonly<{ readonly __codemationItemExpr: "codemation.itemExpr"; readonly fn: ItemExprCallback; }>; declare function itemExpr(fn: ItemExprCallback): ItemExpr; declare function isItemExpr(value: unknown): value is ItemExpr; declare function resolveItemExprsInUnknown(value: unknown, args: ItemExprArgs, seen?: WeakSet): Promise; declare function resolveItemExprsForExecution(config: unknown, nodeCtx: NodeExecutionContext, item: Item, itemIndex: number, items: Items): Promise; //#endregion //#region src/contracts/params.d.ts type Expr = ItemExpr; type Param = T | Expr; type ParamDeep = Expr | (T extends readonly (infer U)[] ? ReadonlyArray> : never) | (T extends object ? { [K in keyof T]: ParamDeep } : T); //#endregion //#region src/contracts/CostCatalogContract.d.ts interface CostCatalogEntry { readonly component: CostTrackingUsageRecord["component"]; readonly provider: string; readonly operation: string; readonly pricingKey: string; readonly usageUnit: string; readonly currency: string; readonly currencyScale: number; readonly pricePerUnitMinor: number; } interface CostCatalog { findEntry(args: CostTrackingUsageRecord): CostCatalogEntry | undefined; } //#endregion //#region src/contracts/executionPersistenceContracts.d.ts type ExecutionInstanceId = string; type WorkItemId = string; type BatchId = string; type RunRevision = number; type PersistedRunWorkItemKind = "queue" | "pending"; type WorkItemStatus = "queued" | "claimed" | "completed" | "failed" | "cancelled"; type PersistedExecutionInstanceKind = "workflowNodeActivation" | "connectionInvocation"; type ConnectionInvocationKind = "languageModel" | "tool" | "nestedAgent"; type PayloadStorageKind = "inline" | "external" | "omitted"; interface PersistedRunWorkItemRecord { readonly workItemId: WorkItemId; readonly runId: RunId; readonly workflowId: WorkflowId; readonly kind: PersistedRunWorkItemKind; readonly orderIndex: number; readonly status: WorkItemStatus; readonly queueName?: string; readonly claimToken?: string; readonly claimedBy?: string; readonly claimedAt?: string; readonly availableAt: string; readonly enqueuedAt: string; readonly completedAt?: string; readonly failedAt?: string; readonly sourceInstanceId?: ExecutionInstanceId; readonly parentInstanceId?: ExecutionInstanceId; readonly itemsIn: number; readonly payloadJson: string; readonly error?: Readonly; } interface ExecutionPayloadPolicyFields { readonly inputStorageKind: PayloadStorageKind; readonly outputStorageKind: PayloadStorageKind; readonly inputBytes?: number; readonly outputBytes?: number; readonly inputPreviewJson?: unknown; readonly outputPreviewJson?: unknown; readonly inputPayloadRef?: string; readonly outputPayloadRef?: string; readonly inputTruncated?: boolean; readonly outputTruncated?: boolean; } interface PersistedExecutionInstanceRecord { readonly instanceId: ExecutionInstanceId; readonly runId: RunId; readonly workflowId: WorkflowId; readonly slotNodeId: NodeId; readonly workflowNodeId: NodeId; readonly kind: PersistedExecutionInstanceKind; readonly connectionKind?: ConnectionInvocationKind; readonly activationId?: NodeActivationId; readonly batchId: BatchId; readonly runIndex: number; readonly parentInstanceId?: ExecutionInstanceId; readonly parentRunId?: RunId; readonly workerClaimToken?: string; readonly status: NodeExecutionStatus; readonly queuedAt?: string; readonly startedAt?: string; readonly finishedAt?: string; readonly updatedAt: string; readonly itemCount: number; readonly inputJson?: string; readonly outputJson?: string; readonly errorJson?: string; readonly inputItemIndicesJson?: string; readonly outputItemCount?: number; readonly successfulItemCount?: number; readonly failedItemCount?: number; readonly truncatedInputPreviewJson?: string; readonly truncatedOutputPreviewJson?: string; readonly inputTruncated?: boolean; readonly outputTruncated?: boolean; readonly usedPinnedOutput?: boolean; readonly payloadPolicy?: ExecutionPayloadPolicyFields; } interface RunSlotProjectionState { readonly runId: RunId; readonly workflowId: WorkflowId; readonly revision: RunRevision; readonly slotStatesByNodeId: Record>; } interface PersistedRunSlotProjectionRecord { readonly runId: RunId; readonly workflowId: WorkflowId; readonly revision: RunRevision; readonly updatedAt: string; readonly slotStatesJson: string; } interface WorkflowRunDetailDto { readonly runId: RunId; readonly workflowId: WorkflowId; readonly startedAt: string; readonly finishedAt?: string; readonly status: RunStatus; readonly workflowSnapshot?: PersistedWorkflowSnapshot; readonly mutableState?: PersistedMutableRunState; readonly slotStates: ReadonlyArray; readonly executionInstances: ReadonlyArray; readonly iterations?: ReadonlyArray; } interface RunIterationDto { readonly iterationId: string; readonly agentNodeId: NodeId; readonly activationId: NodeActivationId; readonly itemIndex: number; readonly itemSummary?: string; readonly status: NodeExecutionStatus; readonly startedAt?: string; readonly finishedAt?: string; readonly invocationIds: ReadonlyArray; readonly parentInvocationId?: string; readonly estimatedCostMinorByCurrency?: Readonly>; readonly estimatedCostCurrencyScaleByCurrency?: Readonly>; } interface SlotExecutionStateDto { readonly slotNodeId: NodeId; readonly latestInstanceId?: ExecutionInstanceId; readonly latestTerminalInstanceId?: ExecutionInstanceId; readonly latestRunningInstanceId?: ExecutionInstanceId; readonly status?: NodeExecutionStatus; readonly invocationCount: number; readonly runCount: number; } interface ExecutionInstanceDto { readonly instanceId: ExecutionInstanceId; readonly slotNodeId: NodeId; readonly workflowNodeId: NodeId; readonly parentInstanceId?: ExecutionInstanceId; readonly kind: PersistedExecutionInstanceKind; readonly connectionKind?: ConnectionInvocationKind; readonly runIndex: number; readonly batchId: BatchId; readonly activationId?: NodeActivationId; readonly status: NodeExecutionStatus; readonly queuedAt?: string; readonly startedAt?: string; readonly finishedAt?: string; readonly itemCount: number; readonly inputJson?: JsonValue; readonly outputJson?: JsonValue; readonly error?: Readonly; readonly iterationId?: string; readonly itemIndex?: number; readonly parentInvocationId?: string; readonly childRunId?: string; } interface WorkflowDetailSelectionState { readonly selectedSlotNodeId: NodeId | null; readonly selectedInstanceId: ExecutionInstanceId | null; } //#endregion //#region src/contracts/deploymentManifestTypes.d.ts declare const DEPLOYMENT_MANIFEST_SCHEMA_VERSION: 2; type DeploymentManifestSchemaVersion = typeof DEPLOYMENT_MANIFEST_SCHEMA_VERSION; type ManifestTriggerConfig = Readonly<{ nodeId: NodeId; triggerKind: "live" | "test"; config: JsonObject; pollIntervalMs?: number; nodeTypeId?: string; }>; type ManifestNodeCredentialShape = Readonly<{ nodeId: NodeId; requirements: ReadonlyArray; }>; type WorkflowDeploymentManifest = Readonly<{ manifestId: string; schemaVersion: DeploymentManifestSchemaVersion; workflowId: WorkflowId; canvas: TCanvas; snapshot: PersistedWorkflowSnapshot; triggers: ReadonlyArray; credentialShapes: ReadonlyArray; }>; declare function serializeManifest(manifest: WorkflowDeploymentManifest): string; declare function deserializeManifest(raw: string): WorkflowDeploymentManifest; type ManifestCanvasNode = Readonly<{ id: NodeId; kind: string; name: string | undefined; type?: string; role?: string; triggerKind?: "live" | "test"; declaredOutputPorts?: ReadonlyArray; declaredInputPorts?: ReadonlyArray; }>; type ManifestCanvas = Readonly<{ id: WorkflowId; name: string; nodes: ReadonlyArray; edges: WorkflowDefinition["edges"]; }>; declare function emitWorkflowManifest(workflow: WorkflowDefinition): WorkflowDeploymentManifest; //#endregion //#region src/contracts/mcpTypes.d.ts type McpServerTransport = "http"; interface McpServerDeclaration { id: string; displayName: string; description: string; transport: McpServerTransport; url: string; acceptedCredentialTypes?: ReadonlyArray; requiredScopes?: string[]; staticHeaders?: Record; toolDescriptionOverrides?: Record; } //#endregion //#region src/contracts/emitPorts.d.ts declare const EMIT_PORTS_BRAND: unique symbol; type PortsEmission = Readonly<{ readonly [EMIT_PORTS_BRAND]: true; readonly ports: Readonly>>>; }>; declare function emitPorts(ports: Readonly>>>): PortsEmission; declare function isPortsEmission(value: unknown): value is PortsEmission; declare function isUnbrandedPortsEmissionShape(value: unknown): value is Readonly<{ ports: unknown; }>; //#endregion //#region src/contracts/itemMeta.d.ts declare function getOriginIndexFromItem(item: Item): number | undefined; //#endregion //#region src/contracts/NoRetryPolicy.d.ts declare class NoRetryPolicy implements NoneRetryPolicySpec { readonly kind: "none"; } //#endregion //#region src/contracts/RetryPolicy.d.ts declare class RetryPolicy implements FixedRetryPolicySpec { readonly maxAttempts: number; readonly delayMs: number; readonly kind: "fixed"; constructor(maxAttempts: number, delayMs: number); static readonly defaultForHttp: FixedRetryPolicySpec; static readonly defaultForAiAgent: FixedRetryPolicySpec; } //#endregion //#region src/contracts/ExpRetryPolicy.d.ts declare class ExpRetryPolicy implements ExponentialRetryPolicySpec { readonly maxAttempts: number; readonly initialDelayMs: number; readonly multiplier: number; readonly maxDelayMs?: number | undefined; readonly jitter?: boolean | undefined; readonly kind: "exponential"; constructor(maxAttempts: number, initialDelayMs: number, multiplier: number, maxDelayMs?: number | undefined, jitter?: boolean | undefined); } //#endregion //#region src/contracts/NoOpCostTrackingTelemetry.d.ts declare class NoOpCostTrackingTelemetry implements CostTrackingTelemetry { captureUsage(_: CostTrackingUsageRecord): Promise; forScope(_: TelemetryScope): CostTrackingTelemetry; } //#endregion //#region src/contracts/NoOpCostTrackingTelemetryFactory.d.ts declare class NoOpCostTrackingTelemetryFactory implements CostTrackingTelemetryFactory { create(_: Readonly<{ telemetry: ExecutionTelemetry; }>): CostTrackingTelemetry; } //#endregion //#region src/contracts/runFinishedAtFactory.d.ts type RunFinishedAtSource = Pick; declare class RunFinishedAtFactory { static resolveIso(state: RunFinishedAtSource): string | undefined; } //#endregion //#region src/authoring/nodeBaseOptions.types.d.ts interface NodeBaseOptions { readonly id?: string; readonly description?: string; } //#endregion //#region src/authoring/defineNode.types.d.ts type MaybePromise = TValue | Promise; type ResolvableCredentialType = AnyCredentialType | CredentialTypeId; type SessionForCredentialType = TCredential extends AnyCredentialType ? Awaited> : unknown; type DefinedNodeCredentialBinding = ResolvableCredentialType | Readonly<{ readonly type: ResolvableCredentialType | ReadonlyArray; readonly label?: string; readonly optional?: true; readonly helpText?: string; readonly helpUrl?: string; }>; type DefinedNodeCredentialBindings = Readonly>; type SessionForBinding = TBinding extends Readonly<{ type: infer TType; }> ? TType extends ReadonlyArray ? SessionForCredentialType : SessionForCredentialType : SessionForCredentialType; type DefinedNodeCredentialAccessors = TBindings extends DefinedNodeCredentialBindings ? Readonly<{ [TKey in keyof TBindings]: () => Promise> }> : Readonly>; interface DefinedNodeRunContext { readonly config: TConfig; readonly credentials: DefinedNodeCredentialAccessors; readonly execution: NodeExecutionContext>; } type DefineNodeExecuteArgs = Readonly<{ input: TInputJson$1; item: Item; itemIndex: number; items: Items; ctx: NodeExecutionContext & Readonly<{ config: TConfig; }>>; }>; type DefinedNodeConfigInput = ParamDeep; interface DefinedNode { readonly kind: "defined-node"; readonly key: TKey$1; readonly title: string; readonly description?: string; create(config: DefinedNodeConfigInput, name?: string, idOrOptions?: string | NodeBaseOptions): RunnableNodeConfig; register(context: { registerNode(token: TypeToken, implementation?: TypeToken): void; }): void; } interface DefineNodeOptions { readonly key: TKey$1; readonly title: string; readonly description?: string; readonly icon?: string; readonly input?: Readonly>; readonly configSchema?: z.ZodType; readonly credentials?: TBindings; readonly inputSchema?: ZodType; readonly keepBinaries?: boolean; readonly inspectorSummary?: (args: Readonly<{ config: TConfig; }>) => ReadonlyArray | undefined; execute(args: DefineNodeExecuteArgs, context: DefinedNodeRunContext): MaybePromise; } interface DefineBatchNodeOptions { readonly key: TKey$1; readonly title: string; readonly description?: string; readonly icon?: string; readonly input?: Readonly>; readonly configSchema?: z.ZodType; readonly credentials?: TBindings; readonly inspectorSummary?: (args: Readonly<{ config: TConfig; }>) => ReadonlyArray | undefined; run(items: ReadonlyArray, context: DefinedNodeRunContext): MaybePromise>; } declare function defineNode(options: DefineNodeOptions): DefinedNode; declare function defineBatchNode(options: DefineBatchNodeOptions): DefinedNode; //#endregion //#region src/authoring/defineHumanApprovalNode.types.d.ts interface HumanApprovalDecisionResult { readonly status: "approved" | "rejected" | "timed-out" | "auto-accepted"; readonly actor?: HumanTaskActor; readonly decidedAt?: Date; readonly note?: string; readonly payload?: Record; } type HumanApprovalOutputJson> = TInputJson$1 & { readonly decision: HumanApprovalDecisionResult; }; interface DefinedHumanApprovalNode, TBindings extends DefinedNodeCredentialBindings | undefined = undefined> extends DefinedNode, TBindings> { readonly humanApprovalToolBehavior: { onRejected: "return" | "halt"; }; } declare function isHumanApprovalNode(node: unknown): node is DefinedHumanApprovalNode, Record, undefined>; declare function defineHumanApprovalNode, TDecision extends Record, TDelivery extends JsonValue, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(opts: { key: TKey$1; title: string; description?: string; icon?: string; channel: string; configSchema: ZodType; inputSchema?: ZodType; decisionSchema: ZodType; credentials?: TBindings; approvedPredicate?: (decision: TDecision) => boolean; defaultTimeout?: Duration; defaultOnTimeout?: "halt" | "auto-accept"; inspectorSummary?: (config: TConfig) => ReadonlyArray | undefined; deliver: (args: { task: HumanTaskHandle; config: TConfig; input: TInputJson$1; item: Item; }, ctx: ExecutionContext) => Promise; onDecision?: (args: { decision: TDecision; actor: HumanTaskActor; task: HumanTaskHandle; delivery: TDelivery; item: Item; }, ctx: ExecutionContext) => Promise; onTimeout?: (args: { task: HumanTaskHandle; delivery: TDelivery; item: Item; policy: "halt" | "auto-accept"; }, ctx: ExecutionContext) => Promise; }): DefinedHumanApprovalNode; //#endregion //#region src/workflow/dsl/workflowBuilderTypes.d.ts declare function mergeForward(config: RunnableNodeConfig): RunnableNodeConfig; type AnyRunnableNodeConfig = RunnableNodeConfig; type AnyTriggerNodeConfig = TriggerNodeConfig; type ValidStepSequence> = TSteps extends readonly [] ? readonly [] : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig ? TRest extends ReadonlyArray ? readonly [TFirst, ...ValidStepSequence] : never : never : TSteps; type StepSequenceOutput | undefined> = TSteps extends ReadonlyArray ? TSteps extends readonly [] ? TCurrentJson : TSteps extends readonly [infer TFirst, ...infer TRest] ? TFirst extends RunnableNodeConfig ? TRest extends ReadonlyArray ? StepSequenceOutput : never : never : TCurrentJson : TCurrentJson; type TypesMatch = [TLeft] extends [TRight] ? ([TRight] extends [TLeft] ? true : false) : false; type BranchOutputGuard | undefined, TFalseSteps extends ReadonlyArray | undefined> = TypesMatch, StepSequenceOutput> extends true ? unknown : never; type BranchStepsArg> = TSteps & ValidStepSequence; type BranchMoreArgs, TRestSteps extends ReadonlyArray> = TRestSteps & ValidStepSequence, TRestSteps>; type BooleanWhenOverloads = { >(branch: boolean, steps: BranchStepsArg): TReturn; , TRestSteps extends ReadonlyArray>(branch: boolean, step: TFirstStep, ...more: BranchMoreArgs): TReturn; }; //#endregion //#region src/workflow/dsl/WhenBuilder.d.ts type WhenEndpoint = Readonly<{ node: NodeRef; output: OutputPortKey; inputPortHint?: InputPortKey; }>; declare class WhenBuilder { private readonly wf; private readonly from; private readonly branchPort; private readonly priorEndpoints; private armEndpoint; constructor(wf: WorkflowBuilder, from: NodeRef, branchPort: OutputPortKey, priorEndpoints?: ReadonlyArray); addBranch>(steps: TSteps & ValidStepSequence): this; readonly when: BooleanWhenOverloads>; then>(config: TConfig): ChainCursor>; humanApproval, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(node: DefinedHumanApprovalNode, TBindings>, config: TConfig, metadata?: { name?: string; nodeId?: string; }): ChainCursor>>; build(): WorkflowDefinition; private get accumulatedEndpoints(); private toCursor; } //#endregion //#region src/workflow/dsl/ChainCursorResolver.d.ts type ChainCursorEndpoint = Readonly<{ node: NodeRef; output: OutputPortKey; inputPortHint?: InputPortKey; }>; type ChainCursorWhenOverloads = BooleanWhenOverloads> & { | undefined, TFalseSteps extends ReadonlyArray | undefined>(branches: Readonly<{ true?: TTrueSteps extends ReadonlyArray ? BranchStepsArg : never; false?: TFalseSteps extends ReadonlyArray ? BranchStepsArg : never; }> & BranchOutputGuard): ChainCursor>; }; declare class ChainCursor { private readonly wf; private readonly endpoints; constructor(wf: WorkflowBuilder, endpoints: ReadonlyArray); then>(config: TConfig): ChainCursor>; thenMerge>(config: TConfig): ChainCursor>; thenIntoInputHints>(config: TConfig): ChainCursor>; readonly when: ChainCursorWhenOverloads; route(branches: Readonly) => ChainCursor | undefined>>): ChainCursor; humanApproval, TBindings extends DefinedNodeCredentialBindings | undefined = undefined>(node: DefinedHumanApprovalNode, TBindings>, config: TConfig, metadata?: { name?: string; nodeId?: string; }): ChainCursor>>; build(): WorkflowDefinition; private resolveSharedInputPortHint; } //#endregion //#region src/workflow/dsl/WorkflowBuilder.d.ts declare class WorkflowBuilder { private readonly meta; private readonly options?; private readonly nodes; private readonly edges; constructor(meta: { id: WorkflowId; name: string; }, options?: Readonly> | undefined); private add; private connect; trigger(config: TConfig): ChainCursor>; start(config: TConfig): ChainCursor>; build(): WorkflowDefinition; private validateNodeIds; } //#endregion //#region src/workflow/dsl/WorkflowDefinitionError.d.ts declare class WorkflowDefinitionError extends Error { constructor(message: string); } //#endregion //#region src/workflow/dsl/NodeIdSlugifier.d.ts declare const NodeIdSlugifier: { slugify(label: string): string; }; //#endregion //#region src/workflow/definition/ConnectionInvocationIdFactory.d.ts declare class ConnectionInvocationIdFactory { static create(): string; static createForTest(runId: string, connectionNodeId: NodeId, sequence: number): string; } //#endregion //#region src/workflow/definition/ConnectionNodeIdFactory.d.ts declare class ConnectionNodeIdFactory { static readonly connectionSegment: "__conn__"; static languageModelConnectionNodeId(parentNodeId: NodeId): NodeId; static toolConnectionNodeId(parentNodeId: NodeId, toolName: string): NodeId; static mcpConnectionNodeId(parentNodeId: NodeId, serverId: string): NodeId; static isMcpConnectionNodeId(nodeId: NodeId): boolean; static parseMcpConnectionNodeId(nodeId: NodeId): Readonly<{ parentNodeId: NodeId; serverId: string; }> | undefined; static isLanguageModelConnectionNodeId(nodeId: NodeId): boolean; static isToolConnectionNodeId(nodeId: NodeId): boolean; static parseLanguageModelConnectionNodeId(nodeId: NodeId): Readonly<{ parentNodeId: NodeId; }> | undefined; static parseToolConnectionNodeId(nodeId: NodeId): Readonly<{ parentNodeId: NodeId; normalizedToolName: string; }> | undefined; static isConnectionOwnedDescendantOf(parentNodeId: NodeId, nodeId: NodeId): boolean; static normalizeToolName(toolName: string): string; } //#endregion //#region src/workflow/definition/NodeIterationIdFactory.d.ts declare class NodeIterationIdFactory { static create(): string; static createForTest(seed: string, sequence: number): string; static createForConnection(connectionNodeId: NodeId, sequence: number): string; } //#endregion //#region src/workflow/definition/WorkflowExecutableNodeClassifier.d.ts declare class WorkflowExecutableNodeClassifier { private readonly connectionOwnedIds; constructor(workflow: WorkflowDefinition); isConnectionOwnedNodeId(nodeId: NodeId): boolean; isExecutableNodeId(nodeId: NodeId): boolean; filterExecutableNodeDefinitions(nodes: ReadonlyArray): ReadonlyArray; private collectConnectionOwnedIds; findDefaultExecutableStartNodeId(workflow: WorkflowDefinition): NodeId; firstExecutableNodeIdInDefinitionOrder(workflow: WorkflowDefinition): NodeId | undefined; lastExecutableNodeIdInDefinitionOrder(workflow: WorkflowDefinition): NodeId; } //#endregion //#region src/workflow/definition/WorkflowExecutableNodeClassifierFactory.d.ts declare class WorkflowExecutableNodeClassifierFactory { static create(workflow: WorkflowDefinition): WorkflowExecutableNodeClassifier; } //#endregion //#region src/workflow/graph/DefaultWorkflowGraphFactory.d.ts declare class DefaultWorkflowGraphFactory implements WorkflowGraphFactory { create(def: WorkflowDefinition): WorkflowGraph; } //#endregion export { ManifestNodeCredentialShape as $, NoOpExecutionTelemetryFactory as $a, NodeExecutionContext as $i, singleton as $n, TriggerNodeOutputJson as $r, ConnectionInvocationId as $t, DefinedNodeConfigInput as A, WebhookControlSignal as Aa, BinaryStorageStatResult as Ai, RunStopCondition as An, CredentialRequirement as Ao, NodeErrorHandler as Ar, ItemExprArgs as At, NoOpCostTrackingTelemetry as B, TelemetryArtifactAttachment as Ba, HumanTaskActor as Bi, InjectionToken$1 as Bn, OAuth2ProviderFromPublicConfig as Bo, NodeSchedulerDecision as Br, DEFAULT_ASSERTION_PASS_THRESHOLD as Bt, HumanApprovalOutputJson as C, WorkflowRepository as Ca, NoneRetryPolicySpec as Ci, RunExecutionOptions as Cn, CredentialHealthTester as Co, JsonObject as Cr, WorkflowRunDetailDto as Ct, DefineNodeExecuteArgs as D, WorkflowSnapshotResolver as Da, BinaryBody as Di, RunResult as Dn, CredentialMaterialSourceKind as Do, NodeActivationId as Dr, Param as Dt, DefineBatchNodeOptions as E, WorkflowSnapshotFactory as Ea, BinaryAttachmentCreateRequest as Ei, RunQueueEntry as En, CredentialJsonRecord as Eo, MutableRunData as Er, Expr as Et, defineBatchNode as F, AllWorkflowsActiveWorkflowActivationPolicy as Fa, EngineHost as Fi, WorkflowExecutionPruneRepository as Fn, CredentialType as Fo, NodeIterationId as Fr, itemExpr as Ft, PortsEmission as G, TelemetryMetricRecord as Ga, LiveWorkflowRepository as Gi, delay as Gn, NodeConnectionName as Go, RunDataFactory as Gr, WorkflowDispatch as Gt, RetryPolicy as H, TelemetryAttributePrimitive as Ha, HumanTaskId as Hi, RegistrationOptions as Hn, PollingTriggerLogger as Ho, ParentExecutionRef as Hr, NoOpAgentMcpIntegration as Ht, defineNode as I, WorkflowActivationPolicy as Ia, ExecutableTriggerNode as Ii, WorkflowExecutionRepository as In, CredentialTypeDefinition as Io, NodeKind as Ir, resolveItemExprsForExecution as It, isUnbrandedPortsEmissionShape as J, TelemetrySpanEventRecord as Ja, NodeActivationReceipt as Ji, injectable as Jn, PersistedTokenId as Jo, RunIdFactory as Jr, serializeDispatch as Jt, emitPorts as K, TelemetryScope as Ka, MultiInputNode as Ki, inject as Kn, NodeId as Ko, RunDataSnapshot as Kr, WorkspaceId as Kt, NodeBaseOptions as L, ExecutionTelemetry as La, ExecutionBinaryService as Li, Container as Ln, CredentialTypeId as Lo, NodeOffloadPolicy as Lr, resolveItemExprsInUnknown as Lt, DefinedNodeCredentialBinding as M, WebhookTriggerMatcher as Ma, BinaryStorageWriteResult as Mi, RunTestContext as Mn, CredentialSessionFactoryArgs as Mo, NodeErrorHandlerSpec as Mr, ItemExprContext as Mt, DefinedNodeCredentialBindings as N, WebhookTriggerResolution as Na, Duration as Ni, WebhookRunResult as Nn, CredentialSessionService as No, NodeIdRef as Nr, ItemExprResolvedContext as Nt, DefineNodeOptions as O, HttpMethod as Oa, BinaryStorage as Oi, RunStateResetRequest as On, CredentialOAuth2AuthDefinition as Oo, NodeConfigBase as Or, ParamDeep as Ot, DefinedNodeRunContext as P, WebhookTriggerRoutingDiagnostics as Pa, EngineDeps as Pi, WorkflowExecutionListingRepository as Pn, CredentialSetupStatus as Po, NodeInspectorSummaryRow as Pr, isItemExpr as Pt, DeploymentManifestSchemaVersion as Q, CodemationTelemetryAttributeNames as Qa, NodeBinaryAttachmentService as Qi, registry as Qn, TriggerNodeConfig as Qr, ConnectionInvocationAppendArgs as Qt, RunFinishedAtFactory as R, ExecutionTelemetryFactory as Ra, ExecutionContext as Ri, DependencyContainer$1 as Rn, CredentialTypeRegistry as Ro, NodeOutputs as Rr, AssertionResult as Rt, HumanApprovalDecisionResult as S, WorkflowNodeInstanceFactory as Sa, FixedRetryPolicySpec as Si, RunEventPublisherDeps as Sn, CredentialHealthStatus as So, JsonNonArray as Sr, WorkflowDetailSelectionState as St, isHumanApprovalNode as T, WorkflowRunnerService as Ta, BINARY_DEFAULT_MAX_BYTES as Ti, RunPruneCandidate as Tn, CredentialInstanceRecord as To, JsonValue as Tr, CostCatalogEntry as Tt, NoRetryPolicy as U, TelemetryAttributes as Ua, HumanTaskSubject as Ui, TypeToken as Un, PollingTriggerDedupWindow as Uo, PersistedRunPolicySnapshot as Ur, AgentBindError as Ut, ExpRetryPolicy as V, TelemetryArtifactReference as Va, HumanTaskHandle as Vi, Lifecycle as Vn, NoOpPollingTriggerLogger as Vo, PairedItemRef as Vr, deriveAssertionPassed as Vt, getOriginIndexFromItem as W, TelemetryChildSpanStart as Wa, ItemNode as Wi, container$1 as Wn, InputPortKey as Wo, PollingTriggerConfig as Wr, DispatchItemMeta as Wt, McpServerTransport as X, CodemationTelemetryMetricNames as Xa, NodeActivationRequestBase as Xi, instancePerContainerCachingFactory as Xn, RunnableNodeInputJson as Xr, AgentMcpToolMap as Xt, McpServerDeclaration as Y, TelemetrySpanScope as Ya, NodeActivationRequest as Yi, instanceCachingFactory as Yn, WorkflowId as Yo, RunnableNodeConfig as Yr, AgentMcpIntegration as Yt, DEPLOYMENT_MANIFEST_SCHEMA_VERSION as Z, GenAiTelemetryAttributeNames as Za, NodeActivationScheduler as Zi, predicateAwareClassFactory as Zn, RunnableNodeOutputJson as Zr, NeedsReconsentEvent as Zt, BranchStepsArg as _, TriggerRuntimeDiagnostics as _a, runnableNodeInputType as _i, PersistedWorkflowSnapshotNode as _n, CredentialAuthDefinition as _o, ExecutionMode as _r, RunRevision as _t, ConnectionNodeIdFactory as a, NodeResolver as aa, WorkflowErrorHandlerSpec as ai, NodeExecutionSnapshot as an, CostTrackingPriceQuote as ao, RunEvent as ar, BatchId as at, mergeForward as b, TriggerSetupStateRepository as ba, triggerNodeSetupStateType as bi, RunCompletionNotifier as bn, CredentialFieldSchema as bo, Items as br, WorkItemId as bt, WorkflowDefinitionError as c, PreparedNodeActivationDispatch as ca, WorkflowNodeConnection as ci, PendingNodeExecution as cn, CostTrackingTelemetryFactory as co, TestCaseRunStatus as cr, ExecutionInstanceId as ct, WhenBuilder as d, RunnableNodeExecuteArgs as da, WorkflowStoragePolicyDecisionArgs as di, PersistedMutableRunState as dn, CollectionStore as do, TestTriggerNodeConfig as dr, PersistedExecutionInstanceKind as dt, NodeExecutionRequest as ea, TriggerNodeSetupState as ei, ConnectionInvocationRecord as en, NoOpExecutionTelemetry as eo, CoreTokens as er, ManifestTriggerConfig as et, AnyRunnableNodeConfig as f, SuspensionRequest as fa, WorkflowStoragePolicyMode as fi, PersistedRunControlState as fn, CollectionsContext as fo, TestTriggerSetupContext as fr, PersistedExecutionInstanceRecord as ft, BranchOutputGuard as g, TriggerPollingPort as ga, nodeRef as gi, PersistedWorkflowSnapshot as gn, CredentialAdvancedSectionPresentation as go, Edge as gr, RunIterationDto as gt, BranchMoreArgs as h, TriggerNode as ha, branchRef as hi, PersistedSuspensionEntry as hn, CredentialAccessTokenSessionFactory as ho, BinaryPreviewKind as hr, PersistedRunWorkItemRecord as ht, NodeIterationIdFactory as i, NodeExecutor as ia, WorkflowErrorHandler as ii, NodeExecutionError as in, CostTrackingComponent as io, EngineExecutionLimitsPolicyConfig as ir, serializeManifest as it, DefinedNodeCredentialAccessors as j, WebhookInvocationMatch as ja, BinaryStorageWriteRequest as ji, RunSummary as jn, CredentialSessionFactory as jo, NodeErrorHandlerArgs as jr, ItemExprCallback as jt, DefinedNode as k, TriggerInstanceId as ka, BinaryStorageReadResult as ki, RunStatus as kn, CredentialOAuth2ScopesFromPublicConfig as ko, NodeDefinition as kr, ItemExpr as kt, WorkflowBuilder as l, ResumeContext as la, WorkflowPolicyRuntimeDefaults as li, PendingResumeEntry as ln, CostTrackingTelemetryMetricNames as lo, TestSuiteRunStatus as lr, ExecutionPayloadPolicyFields as lt, BooleanWhenOverloads as m, TriggerCleanupHandle as ma, WorkflowStoragePolicySpec as mi, PersistedRunState as mn, CredentialAccessTokenSessionArgs as mo, BinaryAttachment as mr, PersistedRunWorkItemKind as mt, WorkflowExecutableNodeClassifierFactory as n, NodeExecutionScheduler as na, WorkflowDefinition as ni, EngineRunCounters as nn, NoOpTelemetrySpanScope as no, ENGINE_EXECUTION_LIMITS_DEFAULTS as nr, deserializeManifest as nt, ConnectionInvocationIdFactory as o, PersistedTriggerSetupState as oa, WorkflowGraph as oi, NodeExecutionStatus as on, CostTrackingTelemetry as oo, RunEventBus as or, ConnectionInvocationKind as ot, AnyTriggerNodeConfig as p, TestableTriggerNode as pa, WorkflowStoragePolicyResolver as pi, PersistedRunSchedulingState as pn, AnyCredentialType as po, ActivationIdFactory as pr, PersistedRunSlotProjectionRecord as pt, isPortsEmission as q, TelemetrySpanEnd as qa, NodeActivationContinuation as qi, injectAll as qn, OutputPortKey as qo, RunId as qr, deserializeDispatch as qt, WorkflowExecutableNodeClassifier as r, NodeExecutionStatePublisher as ra, WorkflowErrorContext as ri, ExecutionFrontierPlan as rn, NoOpTelemetryArtifactReference as ro, EngineExecutionLimitsPolicy as rr, emitWorkflowManifest as rt, NodeIdSlugifier as s, PollingTriggerHandle as sa, WorkflowGraphFactory as si, NodeInputsByPort as sn, CostTrackingTelemetryAttributeNames as so, RunEventSubscription as sr, ExecutionInstanceDto as st, DefaultWorkflowGraphFactory as t, NodeExecutionRequestHandler as ta, UpstreamRefPlaceholder as ti, CurrentStateExecutionRequest as tn, NoOpNodeExecutionTelemetry as to, TriggerInvoker as tr, WorkflowDeploymentManifest as tt, ChainCursor as u, RunnableNode as ua, WorkflowPrunePolicySpec as ui, PersistedMutableNodeState as un, CostTrackingUsageRecord as uo, TestSuiteRunId as ur, PayloadStorageKind as ut, StepSequenceOutput as v, TriggerSetupContext as va, runnableNodeOutputType as vi, PersistedWorkflowTokenRegistryLike as vn, CredentialBinding as vo, Item as vr, RunSlotProjectionState as vt, defineHumanApprovalNode as w, WorkflowRunnerResolver as wa, RetryPolicySpec as wi, RunHaltReason as wn, CredentialInstanceId as wo, JsonPrimitive as wr, CostCatalog as wt, DefinedHumanApprovalNode as x, TriggerTestItemsContext as xa, ExponentialRetryPolicySpec as xi, RunCurrentState as xn, CredentialHealth as xo, JsonArray as xr, WorkItemStatus as xt, ValidStepSequence as y, TriggerSetupStateFor as ya, triggerNodeOutputType as yi, PinnedNodeOutputsByPort as yn, CredentialBindingKey as yo, ItemBinary as yr, SlotExecutionStateDto as yt, NoOpCostTrackingTelemetryFactory as z, NodeExecutionTelemetry as za, ExecutionContextFactory as zi, Disposable as zn, CredentialUnboundError as zo, NodeRef as zr, AssertionResultProvenance as zt }; //# sourceMappingURL=index-CRv3_pY3.d.ts.map