import { A as RunId, B as RunExecutionOptions, D as NodeOutputs, Dt as WebhookInvocationMatch, Et as HttpMethod, F as CurrentStateExecutionRequest, Ft as NodeId, H as RunResult, I as NodeInputsByPort, It as WorkflowId, K as WebhookRunResult, O as ParentExecutionRef, Ot as WebhookTriggerMatcher, P as WorkflowDefinition, R as PersistedWorkflowTokenRegistryLike, S as Items, W as RunStopCondition, _ as WorkflowRepository, d as NodeActivationContinuation, g as ResumeContext, kt as WebhookTriggerResolution, m as NodeExecutionRequestHandler, p as NodeExecutionRequest, q as WorkflowExecutionRepository, u as LiveWorkflowRepository, v as WorkflowSnapshotResolver, w as NodeActivationId, z as RunCurrentState } from "./ItemsInputNormalizer-C2gLv7d9.js"; import { ZodType } from "zod"; //#region ../core/src/contracts/Clock.d.ts interface Clock { now(): Date; } //#endregion //#region ../core/src/authoring/defineCollection.types.d.ts type CollectionFieldType = "text" | "int" | "bigint" | "double" | "bool" | "timestamptz" | "jsonb" | "uuid"; interface CollectionFieldDefinition { readonly type: CollectionFieldType; readonly nullable: boolean; readonly default?: unknown; } interface CollectionIndexDefinition { readonly on: ReadonlyArray; readonly unique?: boolean; } interface CollectionDefinition { readonly name: string; readonly fields: Readonly>; readonly indexes: ReadonlyArray; } interface DefinedCollection { readonly kind: "defined-collection"; readonly definition: TDefinition; register(context: { registerCollection(d: CollectionDefinition): void; }): void; } //#endregion //#region ../core/src/orchestration/Engine.d.ts interface EngineTriggerRuntime { startTriggers(): Promise; stop(): Promise; syncWorkflowTriggersForActivation(workflowId: WorkflowId): Promise; createTriggerTestItems(args: { workflow: WorkflowDefinition; nodeId: NodeId; }): Promise; } interface EngineRunStartService { runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions, persistedStateOverrides?: Readonly<{ workflowSnapshot?: NonNullable>>["workflowSnapshot"]; mutableState?: NonNullable>>["mutableState"]; }>): Promise; runWorkflowFromState(request: CurrentStateExecutionRequest): Promise; } interface EngineRunContinuationService { 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; resumeFromStepResult(args: { runId: RunId; activationId: NodeActivationId; nodeId: NodeId; outputs: NodeOutputs; }): Promise; resumeFromStepError(args: { runId: RunId; activationId: NodeActivationId; nodeId: NodeId; error: Error; }): Promise; waitForCompletion(runId: RunId): Promise>; waitForWebhookResponse(runId: RunId): Promise; resumeRun(args: { runId: RunId; taskId: string; resumeContext: ResumeContext; }): Promise; } interface EngineNodeExecutionRequestHandler { handleNodeExecutionRequest(request: NodeExecutionRequest): Promise; } interface EngineFacadeDeps { liveWorkflowRepository: LiveWorkflowRepository; tokenRegistry: PersistedWorkflowTokenRegistryLike; webhookTriggerMatcher: WebhookTriggerMatcher; workflowSnapshotResolver: WorkflowSnapshotResolver; triggerRuntime: EngineTriggerRuntime; runStartService: EngineRunStartService; runContinuationService: EngineRunContinuationService; nodeExecutionRequestHandler: EngineNodeExecutionRequestHandler; } declare class Engine implements NodeActivationContinuation, NodeExecutionRequestHandler { private readonly deps; constructor(deps: EngineFacadeDeps); loadWorkflows(workflows: ReadonlyArray): void; getTokenRegistry(): EngineFacadeDeps["tokenRegistry"]; resolveWorkflowSnapshot(args: { workflowId: WorkflowId; workflowSnapshot?: NonNullable>>["workflowSnapshot"]; }): WorkflowDefinition | undefined; startTriggers(): Promise; syncWorkflowTriggersForActivation(workflowId: WorkflowId): Promise; start(workflows: WorkflowDefinition[]): Promise; stop(): Promise; resolveWebhookTrigger(args: { endpointPath: string; method: HttpMethod; }): WebhookTriggerResolution; createTriggerTestItems(args: { workflow: WorkflowDefinition; nodeId: NodeId; }): Promise; runWorkflow(wf: WorkflowDefinition, startAt: NodeId, items: Items, parent?: ParentExecutionRef, executionOptions?: RunExecutionOptions, persistedStateOverrides?: Readonly<{ workflowSnapshot?: NonNullable>>["workflowSnapshot"]; mutableState?: NonNullable>>["mutableState"]; }>): Promise; runWorkflowFromState(request: CurrentStateExecutionRequest): Promise; 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; resumeFromStepResult(args: { runId: RunId; activationId: NodeActivationId; nodeId: NodeId; outputs: NodeOutputs; }): Promise; resumeFromStepError(args: { runId: RunId; activationId: NodeActivationId; nodeId: NodeId; error: Error; }): Promise; waitForCompletion(runId: RunId): Promise>; waitForWebhookResponse(runId: RunId): Promise; resumeRun(args: { runId: RunId; taskId: string; resumeContext: ResumeContext; }): Promise; handleNodeExecutionRequest(request: NodeExecutionRequest): Promise; } //#endregion //#region ../core/src/runtime/RunIntentService.d.ts type StartWorkflowIntent = { workflow: WorkflowDefinition; startAt?: string; items: Items; synthesizeTriggerItems?: boolean; parent?: CurrentStateExecutionRequest["parent"]; executionOptions?: RunExecutionOptions; workflowSnapshot?: CurrentStateExecutionRequest["workflowSnapshot"]; mutableState?: CurrentStateExecutionRequest["mutableState"]; currentState?: RunCurrentState; stopCondition?: RunStopCondition; reset?: CurrentStateExecutionRequest["reset"]; }; type RerunFromNodeIntent = { workflow: WorkflowDefinition; nodeId: NodeId; currentState: RunCurrentState; items?: Items; synthesizeTriggerItems?: boolean; parent?: CurrentStateExecutionRequest["parent"]; executionOptions?: RunExecutionOptions; workflowSnapshot?: CurrentStateExecutionRequest["workflowSnapshot"]; mutableState?: CurrentStateExecutionRequest["mutableState"]; }; type MatchedWebhookRunIntent = { endpointPath: string; method: HttpMethod; requestItem: Items[number]; }; type WebhookMatchRunIntent = { match: WebhookInvocationMatch; requestItem: Items[number]; }; declare class RunIntentService { private readonly engine; private readonly workflowRepository; constructor(engine: Engine, workflowRepository: WorkflowRepository); startWorkflow(args: StartWorkflowIntent): Promise; rerunFromNode(args: RerunFromNodeIntent): Promise; private resolveStartWorkflowItems; private resolveRerunItems; private resolveStartWorkflowTriggerNodeId; private resolveRerunTriggerNodeId; private firstTriggerNodeId; private isTriggerNode; private hasNonEmptyItems; resolveWebhookTrigger(args: { endpointPath: string; method: HttpMethod; }): WebhookTriggerResolution; runMatchedWebhook(args: MatchedWebhookRunIntent): Promise; runWebhookMatch(args: WebhookMatchRunIntent): Promise; private createWebhookExecutionOptions; } //#endregion //#region ../core/src/credentials/OAuthFlowExecutor.types.d.ts interface OAuthFlowStartArgs { readonly typeId: string; readonly scopes: ReadonlyArray; readonly redirectUri: string; readonly instanceId?: string; } interface OAuthFlowStartResult { readonly consentUrl: string; readonly stateToken: string; } interface OAuthFlowCallbackArgs { readonly stateToken: string; readonly code: string; } interface OAuthMaterial { readonly accessToken: string; readonly refreshToken?: string; readonly expiresAt?: string; readonly grantedScopes: ReadonlyArray; } interface OAuthFlowExecutor { start(args: OAuthFlowStartArgs): Promise; lookupInstanceId(stateToken: string): string | undefined; completeCallback(args: OAuthFlowCallbackArgs): Promise; refresh(args: { typeId: string; instanceId: string; material: OAuthMaterial; }): Promise; } //#endregion //#region ../core/src/credentials/CredentialMaterialProvider.types.d.ts type CredentialMaterialRef = Readonly<{ source: "local" | "control-plane"; id: string; }>; type MaterialBundle = OAuthMaterial; type CallerContext = Readonly<{ workspaceId: string; caller: Readonly<{ kind: "workflow-node"; workflowId: string; nodeId: string; }> | Readonly<{ kind: "concierge"; chatId: string; }> | Readonly<{ kind: "research-agent"; chatId: string; }> | Readonly<{ kind: "manual"; userId: string; }>; reason?: string; }>; interface CredentialMaterialProvider { getMaterial(ref: CredentialMaterialRef, context: CallerContext): Promise; setMaterial(ref: CredentialMaterialRef, material: MaterialBundle): Promise; } //#endregion export { CollectionDefinition as a, Engine as i, OAuthFlowExecutor as n, DefinedCollection as o, RunIntentService as r, Clock as s, CredentialMaterialProvider as t }; //# sourceMappingURL=index-Cy08dvyb.d.ts.map