import { type OrchestrationTypes } from "@cargo-ai/types"; import type { EitherOr, JsonSchema } from "@cargo-ai/utils"; import { z } from "zod"; import type { ApiType, DateToString } from "../types.js"; import type { Billing } from "./billing.js"; import type { Segmentation } from "./segmentation.js"; import type { Storage } from "./storage.js"; type GlobalRecord = Record; export declare namespace Orchestration { type Play = ApiType; type PlayRunCreationRule = ApiType; type PlaySchedule = ApiType; type PlayScheduleCron = ApiType; type PlayScheduleDbt = ApiType; type PlayScheduleRealtime = ApiType; type PlayScheduleDependency = ApiType; type PlayScheduleWatch = ApiType; type TemplatePlay = ApiType; type Tool = ApiType; type Action = ApiType; type ConfiguredAction = ApiType; type ToolTrigger = ApiType; type ToolTriggerCron = ApiType; type TemplateTool = ApiType; type ToolIcon = ApiType; type Workflow = ApiType; type TemplateWorkflow = ApiType; type WorkflowNode = ApiType; type Node = ApiType; type RunMetric = ApiType; type RecordMetric = ApiType; type ReleaseStatus = ApiType; type Release = ApiType; type ReleaseTestRecord = ApiType; type ReleaseFormField = ApiType; type BatchStatus = ApiType; type Batch = ApiType; type BatchData = ApiType; type BatchDataRunsReset = ApiType; type BatchDataRunsFilter = ApiType; type RunStatus = ApiType; type RecordStatus = ApiType; type Execution = ApiType; type ExecutionStatus = ApiType; type Run = ApiType; type Span = ApiType; type Trace = ApiType; type TraceStatus = ApiType; type Record = ApiType; type ExecutionsFilter = ApiType; type ExecutionsFilterCondition = ApiType; type ExecutionsFilterGroup = ApiType; type Template = ApiType; type TemplateKind = OrchestrationTypes.TemplateKind; type TemplateCategory = ApiType; type TemplateNode = ApiType; const reshapeReleaseFormFieldsToSchemas: (formFields: OrchestrationTypes.ReleaseFormField[]) => { jsonSchema: JsonSchema; uiSchema: globalThis.Record; }; const zodNode: z.ZodIntersection; description: z.ZodOptional; retry: z.ZodOptional; initialInterval: z.ZodOptional; backoffCoefficient: z.ZodOptional; }, z.core.$strip>>; childrenUuids: z.ZodArray>; fallbackChildUuid: z.ZodOptional; fallbackOnFailure: z.ZodBoolean; position: z.ZodObject<{ x: z.ZodNumber; y: z.ZodNumber; }, z.core.$strip>; }, z.core.$strip>, z.ZodUnion; actionSlug: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ connector: "connector"; }>; actionSlug: z.ZodString; integrationSlug: z.ZodString; connectorUuid: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ tool: "tool"; }>; toolUuid: z.ZodString; releaseUuid: z.ZodOptional; waitUntilFinished: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ agent: "agent"; }>; agentUuid: z.ZodString; releaseUuid: z.ZodOptional; waitUntilFinished: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ worker: "worker"; }>; workerUuid: z.ZodString; method: z.ZodEnum<{ GET: "GET"; POST: "POST"; PUT: "PUT"; PATCH: "PATCH"; DELETE: "DELETE"; }>; path: z.ZodString; headers: z.ZodOptional>; }, z.core.$strip>]>>; const zodAction: z.ZodIntersection; retry: z.ZodOptional; initialInterval: z.ZodOptional; backoffCoefficient: z.ZodOptional; }, z.core.$strip>>; }, z.core.$strip>, z.ZodUnion; actionSlug: z.ZodString; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ connector: "connector"; }>; actionSlug: z.ZodString; integrationSlug: z.ZodString; connectorUuid: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ tool: "tool"; }>; toolUuid: z.ZodOptional; templateSlug: z.ZodOptional; releaseUuid: z.ZodOptional; waitUntilFinished: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ agent: "agent"; }>; agentUuid: z.ZodOptional; templateSlug: z.ZodOptional; releaseUuid: z.ZodOptional; waitUntilFinished: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ kind: z.ZodEnum<{ worker: "worker"; }>; workerUuid: z.ZodString; method: z.ZodEnum<{ GET: "GET"; POST: "POST"; PUT: "PUT"; PATCH: "PATCH"; DELETE: "DELETE"; }>; path: z.ZodString; headers: z.ZodOptional>; }, z.core.$strip>]>>; namespace Api { export type ListWorkflowsResult = { workflows: Workflow[]; }; export type CreatePlayPayload = DateToString<{ name: string; description?: string; modelUuid: string; filter?: Segmentation.Filter; sort?: Segmentation.Sort; limit?: number; trackingColumnSlugs?: string[]; changeKinds: Segmentation.ChangeKind[]; runCreationRule: PlayRunCreationRule; schedule?: Omit | PlayScheduleDbt | PlayScheduleRealtime | PlayScheduleDependency | Omit; folderUuid?: string; }>; export type CreatePlayResult = { play: Play; }; export const zodCreatePlayErrorReason: z.ZodEnum<{ folderNotFound: "folderNotFound"; connectorNotFound: "connectorNotFound"; modelNotFound: "modelNotFound"; integrationNotFound: "integrationNotFound"; integrationNotCompatible: "integrationNotCompatible"; failedToSchedule: "failedToSchedule"; invalidFilter: "invalidFilter"; failedToCreateSegment: "failedToCreateSegment"; }>; export type ListPlaysResult = { plays: Play[]; }; export type GetPlayResult = { play: Play; }; export const zodGetPlayErrorReason: z.ZodEnum<{ playNotFound: "playNotFound"; }>; export type ListPlaysPayload = { isEnabled?: boolean; modelUuid?: string; segmentUuid?: string; scheduleType?: OrchestrationTypes.PlaySchedule["type"]; }; export type UpdatePlayPayload = DateToString<{ uuid: string; description?: string | null; isEnabled?: boolean; name?: string; filter?: Segmentation.Filter; sort?: Segmentation.Sort | null; limit?: number | null; trackingColumnSlugs?: string[] | null; changeKinds?: Segmentation.ChangeKind[]; runCreationRule?: PlayRunCreationRule; healthThreshold?: number; healthAlertActions?: ConfiguredAction[]; schedule?: Omit | PlayScheduleDbt | PlayScheduleRealtime | PlayScheduleDependency | Omit | null; folderUuid?: string | null; template?: { isAvailable: boolean; scope: "public" | "private"; }; }>; export type UpdatePlayResult = { play: Play; }; export const zodUpdatePlayErrorReason: z.ZodEnum<{ folderNotFound: "folderNotFound"; connectorNotFound: "connectorNotFound"; modelNotFound: "modelNotFound"; integrationNotFound: "integrationNotFound"; integrationNotCompatible: "integrationNotCompatible"; failedToSchedule: "failedToSchedule"; invalidFilter: "invalidFilter"; segmentNotFound: "segmentNotFound"; playNotFound: "playNotFound"; workflowNotFound: "workflowNotFound"; playNotDeployed: "playNotDeployed"; failedToUpdateSegment: "failedToUpdateSegment"; }>; export const zodRemovePlayErrorReason: z.ZodEnum<{ playNotFound: "playNotFound"; failedToRemoveSegment: "failedToRemoveSegment"; }>; export type CreateToolPayload = DateToString<{ name: string; icon: ToolIcon; description?: string; triggers?: Omit[]; folderUuid?: string; }>; export type CreateToolResult = { tool: Tool; }; export type ListToolsResult = { tools: Tool[]; }; export type GetToolResult = { tool: Tool; }; export const zodGetToolErrorReason: z.ZodEnum<{ toolNotFound: "toolNotFound"; }>; export type UpdateToolPayload = DateToString<{ uuid: string; name?: string; icon?: ToolIcon; description?: string | null; triggers?: Omit[]; publicForm?: OrchestrationTypes.ToolPublicForm | null; folderUuid?: string | null; template?: { isAvailable: boolean; scope: "public" | "private"; }; }>; export type UpdateToolResult = { tool: Tool; }; export const zodUpdateToolErrorReason: z.ZodEnum<{ folderNotFound: "folderNotFound"; workflowNotFound: "workflowNotFound"; toolNotFound: "toolNotFound"; toolIsReadOnly: "toolIsReadOnly"; }>; export const zodRemoveToolErrorReason: z.ZodEnum<{ toolNotFound: "toolNotFound"; toolIsReadOnly: "toolIsReadOnly"; }>; export type ComputeNodePayload = DateToString<{ node: NodePayload; groupContext?: GlobalRecord; context: GlobalRecord; }>; export type ComputeNodeResult = { computedConfig: GlobalRecord; }; type NodePayload = Omit & { childrenUuids: Array; }; export type ValidateNodesPayload = DateToString<{ nodes: NodePayload[]; }>; export type ValidateNodesInvalidNode = { node: { uuid: string; slug: string; }; reason: string; invalidNodes?: ValidateNodesInvalidNode[]; }; export type ValidateNodesResult = { outcome: "valid"; } | { outcome: "notValid"; invalidNodes: ValidateNodesInvalidNode[]; }; export type ExecuteNodePayload = DateToString<{ workflowUuid: string; releaseUuid: string; node: NodePayload; computedConfig: GlobalRecord; context: GlobalRecord; groupContext?: GlobalRecord; }>; export type ExecuteNodeGroupItemResult = { item: any; executions: GlobalRecord | null; creditsUsedCount: number; childIndex?: number; } | { outcome: "notExecuted"; reason: "actionFailed"; message: string; creditsUsedCount: number; }>; computedConfigs: GlobalRecord; } | { outcome: "notComputed"; errorMessage: string; }>; error: string | undefined; }; export type ExecuteNodePendingResult = { status: "pending"; message: string; runUuid?: string; }; export type ExecuteNodeSuccessResult = { status: "success"; data: GlobalRecord | Array> | null; creditsUsedCount: number; groupItems?: ExecuteNodeGroupItemResult[]; childIndex?: number; }; export type ExecuteNodeErrorResult = { status: "error"; message: string; creditsUsedCount: number; groupItems?: ExecuteNodeGroupItemResult[]; }; export type ExecuteNodeResult = ExecuteNodePendingResult | ExecuteNodeSuccessResult | ExecuteNodeErrorResult; export const zodExecuteNodeErrorReason: z.ZodEnum<{ releaseNotFound: "releaseNotFound"; }>; export type CreateBatchPayload = DateToString<{ workflowUuid?: string; releaseUuid?: string; nodes?: Node[]; data: { kind: "segment"; segmentUuid: string; } | { kind: "change"; changeUuid: string; changeKinds: Segmentation.ChangeKind[]; } | { kind: "file"; s3Filename: string; mappings?: GlobalRecord; } | { kind: "filter"; modelUuid: string; filter?: Segmentation.Filter; sort?: Segmentation.Sort; limit?: number; } | { kind: "runs"; filter: BatchDataRunsFilter; reset: BatchDataRunsReset; } | { kind: "recordIds"; modelUuid: string; ids: string[]; } | { kind: "records"; records: GlobalRecord[]; } | { kind: "schedule"; modelUuid: string; segmentUuid: string; changeKinds: Segmentation.ChangeKind[]; skip?: boolean; } | { kind: "form"; records: GlobalRecord[]; parentBatchUuid?: string; parentRunUuid?: string; parentNodeUuid?: string; }; }>; export type CreateBatchResult = { batch: Batch; }; export const zodCreateBatchErrorReason: z.ZodEnum<{ notEnoughCredits: "notEnoughCredits"; workflowNotFound: "workflowNotFound"; invalidReleaseOrCustomNodes: "invalidReleaseOrCustomNodes"; invalidDataKind: "invalidDataKind"; nodesNotFound: "nodesNotFound"; rootNodeNotFound: "rootNodeNotFound"; dataError: "dataError"; failedToStart: "failedToStart"; }>; export type PreviewBatchPayload = DateToString<{ workflowUuid: string; data: { kind: "segment"; segmentUuid: string; } | { kind: "change"; changeUuid: string; changeKinds: Segmentation.ChangeKind[]; } | { kind: "file"; s3Filename: any; } | { kind: "filter"; modelUuid: string; filter?: Segmentation.Filter; sort?: Segmentation.Sort; limit?: number; } | { kind: "runs"; runUuids: string[]; reset: BatchDataRunsReset; } | { kind: "recordIds"; modelUuid: string; ids: string[]; } | { kind: "group"; items: any[]; parentBatchUuid?: string; parentRunUuid: string; parentNodeUuid: string; } | { kind: "records"; records: GlobalRecord[]; } | { kind: "schedule"; modelUuid: string; segmentUuid: string; changeKinds: Segmentation.ChangeKind[]; }; }>; export type PreviewBatchResult = { records: GlobalRecord[]; columns: Storage.Column[]; count: number; }; export const zodPreviewBatchErrorReason: z.ZodEnum<{ segmentNotFound: "segmentNotFound"; workflowNotFound: "workflowNotFound"; modelLinkedToWorkflow: "modelLinkedToWorkflow"; noModelLinkedToWorkflow: "noModelLinkedToWorkflow"; failedToFetchFromClient: "failedToFetchFromClient"; }>; export type ListBatchesPayload = DateToString<{ workflowUuids?: string[]; releaseUuid?: string; parentBatchUuid?: string; parentRunUuid?: string; parentNodeUuid?: string; statuses?: BatchStatus[]; hasRuns?: boolean; isSkipped?: boolean; isFinished?: boolean; includedDataKinds?: Array; excludedDataKinds?: Array; limit?: number; offset?: number; }>; export type ListBatchesResult = { batches: Batch[]; }; export type GetBatchResult = { batch: Batch; }; export const zodCancelBatchErrorReason: z.ZodEnum<{ failedToStart: "failedToStart"; batchNotFound: "batchNotFound"; batchAlreadyFinished: "batchAlreadyFinished"; }>; export type DownloadBatchPayload = DateToString<{ uuid: string; outputNodeSlug?: string; }>; export type DownloadBatchResult = { url: string; }; export const zodDownloadBatchErrorReason: z.ZodEnum<{ batchNotFound: "batchNotFound"; batchNotFinished: "batchNotFinished"; batchNotSupported: "batchNotSupported"; }>; export type CreateRunPayload = DateToString<{ workflowUuid?: string; releaseUuid?: string; nodes?: Node[]; data: unknown; }>; export type CreateRunResult = { run: Run; }; export const zodCreateRunErrorReason: z.ZodEnum<{ notEnoughCredits: "notEnoughCredits"; workflowNotFound: "workflowNotFound"; invalidReleaseOrCustomNodes: "invalidReleaseOrCustomNodes"; nodesNotFound: "nodesNotFound"; rootNodeNotFound: "rootNodeNotFound"; failedToStart: "failedToStart"; playNotCompatible: "playNotCompatible"; invalidData: "invalidData"; concurrencyLimitReached: "concurrencyLimitReached"; }>; export type ExecuteActionPayload = { action: Action; data: unknown; waitUntilFinished?: boolean; webhookUrl?: string; webhookSecret?: string; }; export type ExecuteActionResult = { run: Run; runComputedConfigs?: GlobalRecord; runContext?: GlobalRecord; }; export const zodExecuteActionErrorReason: z.ZodEnum<{ notEnoughCredits: "notEnoughCredits"; runNotFound: "runNotFound"; workflowNotFound: "workflowNotFound"; invalidReleaseOrCustomNodes: "invalidReleaseOrCustomNodes"; nodesNotFound: "nodesNotFound"; rootNodeNotFound: "rootNodeNotFound"; failedToStart: "failedToStart"; playNotCompatible: "playNotCompatible"; invalidData: "invalidData"; concurrencyLimitReached: "concurrencyLimitReached"; runTimedOut: "runTimedOut"; }>; export type ExecuteActionBatchPayload = { action: Action; records: GlobalRecord[]; webhookUrl?: string; webhookSecret?: string; waitUntilFinished?: boolean; }; export type ExecuteActionBatchResult = { batch: Batch; }; export const zodExecuteActionBatchErrorReason: z.ZodEnum<{ notEnoughCredits: "notEnoughCredits"; workflowNotFound: "workflowNotFound"; invalidReleaseOrCustomNodes: "invalidReleaseOrCustomNodes"; invalidDataKind: "invalidDataKind"; nodesNotFound: "nodesNotFound"; rootNodeNotFound: "rootNodeNotFound"; dataError: "dataError"; failedToStart: "failedToStart"; batchNotFound: "batchNotFound"; batchTimedOut: "batchTimedOut"; }>; export type GetActionOutputSchemaPayload = { action: Action; data?: GlobalRecord; }; export type GetActionOutputSchemaResult = { schema: JsonSchema; }; export type ListActionKind = "connector" | "native" | "tool" | "agent"; export type ListActionPayload = { query?: string; kind?: ListActionKind; integrationSlug?: string; category?: string; /** * Filters connector actions on their integration's deprecation the way * the identical parameter on `integration.list` does: omit it and both * are returned. A surface offering an action for new work passes `false`. */ isDeprecated?: boolean; /** Maximum results to return. Omit to return all results. */ limit?: number; }; export type ListActionMatch = { name: string; description?: string; score: number; action: Action; integrationName?: string; category?: string; connectors?: Array<{ uuid: string; slug: string; name: string; }>; /** Prices this action can charge. Absent when the action costs no credits. */ credits?: Billing.CreditsCost[]; autocompletes?: Array<{ slug: string; params?: unknown; }>; }; export type ListActionResult = { query: string; totalMatches: number; results: ListActionMatch[]; }; export const zodGetActionOutputSchemaErrorReason: z.ZodEnum<{ releaseNotFound: "releaseNotFound"; connectorNotFound: "connectorNotFound"; integrationNotFound: "integrationNotFound"; actionNotFound: "actionNotFound"; actionHasNoOutput: "actionHasNoOutput"; failedToGetSchema: "failedToGetSchema"; }>; export type GetRunResult = { run: Run; runComputedConfigs: GlobalRecord; runContext: GlobalRecord; }; export type ListRunsPayload = DateToString<{ workflowUuid?: string; userUuid?: string; batchUuid?: string; releaseUuid?: string; statuses?: RunStatus[]; parentBatchUuid?: string; parentUuid?: string; parentNodeUuid?: string; isGroupParent?: boolean; recordId?: string; recordTitle?: string; recordTitleOrId?: string; search?: string; isFinished?: boolean; executionsFilter?: ExecutionsFilter; createdAfter?: string; createdBefore?: string; updatedAfter?: string; updatedBefore?: string; limit?: number; offset?: number; }>; export type CountRunsPayload = DateToString<{ workflowUuid?: string; userUuid?: string; batchUuid?: string; releaseUuid?: string; statuses?: RunStatus[]; parentBatchUuid?: string; parentUuid?: string; parentNodeUuid?: string; isGroupParent?: boolean; recordId?: string; recordTitle?: string; recordTitleOrId?: string; search?: string; isFinished?: boolean; executionsFilter?: ExecutionsFilter; createdAfter?: string; createdBefore?: string; updatedAfter?: string; updatedBefore?: string; }>; export type DownloadRunsPayload = DateToString<{ workflowUuid: string; uuids?: string[]; batchUuid?: string; releaseUuid?: string; statuses?: RunStatus[]; parentBatchUuid?: string; parentUuid?: string; parentNodeUuid?: string; isGroupParent?: boolean; recordId?: string; recordTitle?: string; recordTitleOrId?: string; isFinished?: boolean; executionsFilter?: ExecutionsFilter; createdAfter?: string; createdBefore?: string; updatedAfter?: string; updatedBefore?: string; }>; export type ReviewRunPayload = DateToString<{ uuid: string; computedConfig: GlobalRecord; }>; export type ReviewRunResult = { run: Run; }; export type CancelRunsPayload = DateToString<{ workflowUuid: string; } & EitherOr<{ uuids: string[]; }, { recordId?: string; recordTitle?: string; recordTitleOrId?: string; releaseUuid?: string; batchUuid?: string; parentBatchUuid?: string; parentUuid?: string; parentNodeUuid?: string; isGroupParent?: boolean; executionsFilter?: ExecutionsFilter; createdAfter?: string; createdBefore?: string; }>>; export const zodCancelRunsErrorReason: z.ZodEnum<{ failedToStart: "failedToStart"; }>; export type ListRunsResult = { runs: Run[]; count: number; }; export type CountRunsResult = { count: number; }; export type DownloadRunsResult = { url: string; }; export type DownloadRunOutputsPayload = DateToString<{ workflowUuid: string; outputNodeSlug?: string; format?: "csv" | "json"; batchUuid?: string; releaseUuid?: string; statuses?: RunStatus[]; parentBatchUuid?: string; parentUuid?: string; parentNodeUuid?: string; isGroupParent?: boolean; recordId?: string; recordTitle?: string; recordTitleOrId?: string; isFinished?: boolean; executionsFilter?: ExecutionsFilter; createdAfter?: string; createdBefore?: string; limit?: number; offset?: number; }>; export type DownloadRunOutputsResult = { url: string; }; export const zodDownloadRunOutputsErrorReason: z.ZodEnum<{ noRunsFound: "noRunsFound"; tooManyRuns: "tooManyRuns"; }>; export type GetRunMetricsPayload = DateToString<{ workflowUuid: string; releaseUuid?: string; batchUuid?: string; createdAfter?: string; createdBefore?: string; }>; export type GetRunMetricsResult = { runMetrics: RunMetric[]; }; export type ListRecordsPayload = DateToString<{ workflowUuid?: string; userUuid?: string; ids?: string[]; title?: string; titleOrId?: string; search?: string; releaseUuid?: string; batchUuid?: string; statuses?: RecordStatus[]; parentBatchUuid?: string; parentRunUuid?: string; parentNodeUuid?: string; isGroupParent?: boolean; executionsFilter?: ExecutionsFilter; createdAfter?: string; createdBefore?: string; updatedAfter?: string; updatedBefore?: string; limit?: number; offset?: number; }>; export type ListRecordsResult = { records: Record[]; count: number; }; export type ListSpansPayload = DateToString<{ workflowUuid?: string; userUuid?: string; batchUuid?: string; /** * Returns every span across the trace's run lineage. Raises the maximum * `limit` to 1000 so a whole trace can be fetched in one request. */ traceUuid?: string; runUuid?: string; recordId?: string; recordTitle?: string; recordTitleOrId?: string; search?: string; parentRunUuid?: string; parentNodeUuid?: string; parentAgentUuid?: string; nodeUuid?: string; nodeKind?: Span["nodeKind"]; nodeSlug?: string; nodeIntegrationSlug?: string; nodeConnectorUuid?: string; nodeActionSlug?: string; nodeToolUuid?: string; nodeAgentUuid?: string; nodeWorkerUuid?: string; nodeReleaseUuid?: string; executionTitle?: string; executionTitleOrErrorMessage?: string; executionStatuses?: ExecutionStatus[]; executionStartedAfter: string; executionStartedBefore?: string; limit?: number; offset?: number; }>; export type ListSpansResult = { spans: Span[]; count: number; }; export type CountSpansPayload = DateToString<{ workflowUuid?: string; userUuid?: string; batchUuid?: string; traceUuid?: string; runUuid?: string; recordId?: string; recordTitle?: string; recordTitleOrId?: string; search?: string; parentRunUuid?: string; parentNodeUuid?: string; parentAgentUuid?: string; nodeUuid?: string; nodeKind?: Span["nodeKind"]; nodeSlug?: string; nodeIntegrationSlug?: string; nodeConnectorUuid?: string; nodeActionSlug?: string; nodeToolUuid?: string; nodeAgentUuid?: string; nodeWorkerUuid?: string; nodeReleaseUuid?: string; executionTitle?: string; executionTitleOrErrorMessage?: string; executionStatuses?: ExecutionStatus[]; executionStartedAfter: string; executionStartedBefore?: string; }>; export type CountSpansResult = { count: number; }; export type ListTracesPayload = DateToString<{ workflowUuid?: string; chatUuid?: string; agentUuid?: string; workerUuid?: string; statuses?: TraceStatus[]; startedAfter: string; startedBefore?: string; limit?: number; offset?: number; }>; export type ListTracesResult = { traces: Trace[]; count: number; }; export type CountTracesPayload = DateToString<{ workflowUuid?: string; chatUuid?: string; agentUuid?: string; workerUuid?: string; statuses?: TraceStatus[]; startedAfter: string; startedBefore?: string; }>; export type CountTracesResult = { count: number; }; export type GetTraceResult = { trace: Trace; }; export const zodGetTraceErrorReason: z.ZodEnum<{ traceNotFound: "traceNotFound"; }>; export type ExecuteQueryPayload = { query: string; }; export type ExecuteQueryResult = { rows: Array>; }; export type CountRecordsPayload = DateToString<{ workflowUuid?: string; userUuid?: string; ids?: string[]; title?: string; titleOrId?: string; search?: string; releaseUuid?: string; batchUuid?: string; statuses?: RecordStatus[]; parentBatchUuid?: string; parentRunUuid?: string; parentNodeUuid?: string; isGroupParent?: boolean; executionsFilter?: ExecutionsFilter; createdAfter?: string; createdBefore?: string; updatedAfter?: string; updatedBefore?: string; }>; export type CountRecordsResult = { count: number; }; export type DownloadRecordsPayload = DateToString<{ workflowUuid: string; ids?: string[]; runUuids?: string[]; title?: string; titleOrId?: string; releaseUuid?: string; batchUuid?: string; statuses?: RunStatus[]; parentBatchUuid?: string; parentRunUuid?: string; parentNodeUuid?: string; isGroupParent?: boolean; executionsFilter?: ExecutionsFilter; createdAfter?: string; createdBefore?: string; updatedAfter?: string; updatedBefore?: string; }>; export type DownloadRecordsResult = { url: string; }; export type DownloadRecordOutputsPayload = DateToString<{ workflowUuid: string; outputNodeSlug?: string; format?: "csv" | "json"; ids?: string[]; runUuids?: string[]; title?: string; titleOrId?: string; releaseUuid?: string; batchUuid?: string; statuses?: RunStatus[]; parentBatchUuid?: string; parentRunUuid?: string; parentNodeUuid?: string; isGroupParent?: boolean; executionsFilter?: ExecutionsFilter; createdAfter?: string; createdBefore?: string; limit?: number; offset?: number; }>; export type DownloadRecordOutputsResult = { url: string; }; export const zodDownloadRecordOutputsErrorReason: z.ZodEnum<{ noRecordsFound: "noRecordsFound"; tooManyRecords: "tooManyRecords"; }>; export type CancelRecordsPayload = DateToString<{ workflowUuid: string; } & EitherOr<{ ids: string[]; }, { title?: string; titleOrId?: string; releaseUuid?: string; batchUuid?: string; parentBatchUuid?: string; parentRunUuid?: string; parentNodeUuid?: string; isGroupParent?: boolean; executionsFilter?: ExecutionsFilter; createdAfter?: string; createdBefore?: string; }>>; export type GetRecordMetricsPayload = DateToString<{ workflowUuid: string; releaseUuid?: string; batchUuid?: string; createdAfter?: string; createdBefore?: string; }>; export type GetRecordMetricsResult = { recordMetrics: RecordMetric[]; }; export const zodCancelRecordsErrorReason: z.ZodEnum<{ failedToStart: "failedToStart"; tooManyRecordsSelected: "tooManyRecordsSelected"; }>; export type GetReleaseResult = { release: Release; }; export type ListReleasesPayload = DateToString<{ workflowUuid?: string; userUuid?: string; statuses?: ReleaseStatus[]; limit?: number; offset?: number; }>; export type ListReleaseResult = { releases: Release[]; }; export type GetDraftReleasePayload = DateToString<{ workflowUuid: string; }>; export type GetDraftReleaseResult = { release: Release; }; export const zodGetDraftReleaseErrorReason: z.ZodEnum<{ workflowNotFound: "workflowNotFound"; }>; export type GetDeployedReleasePayload = DateToString<{ workflowUuid: string; }>; export type GetDeployedReleaseResult = { release: Release; }; export const zodGetDeployedReleaseErrorReason: z.ZodEnum<{ releaseNotFound: "releaseNotFound"; }>; export type DeployDraftReleasePayload = DateToString<{ workflowUuid: string; nodes: NodePayload[]; formFields: ReleaseFormField[] | null; version?: string; description?: string; options?: { connectorUuidsByIntegrationSlug?: GlobalRecord; modelUuidsByIntegrationSlug?: GlobalRecord; }; }>; export type DeployDraftReleaseResult = { release: Release; }; export const zodDeployDraftReleaseErrorReason: z.ZodEnum<{ draftReleaseNotFound: "draftReleaseNotFound"; invalidReleaseVersion: "invalidReleaseVersion"; workflowNotFound: "workflowNotFound"; draftReleaseNodesAreInvalid: "draftReleaseNodesAreInvalid"; failedToReconciliateNodes: "failedToReconciliateNodes"; toolReleaseRequiresFormFields: "toolReleaseRequiresFormFields"; }>; export type UpdateDraftReleasePayload = DateToString<{ workflowUuid: string; parentUuid?: string; nodes?: NodePayload[]; testRecords?: ReleaseTestRecord[]; formFields?: ReleaseFormField[] | null; options?: { connectorUuidsByIntegrationSlug?: GlobalRecord; modelUuidsByIntegrationSlug?: GlobalRecord; }; }>; export type UpdateDraftReleaseResult = { release: Release; }; export const zodUpdateDraftReleaseErrorReason: z.ZodEnum<{ draftReleaseNotFound: "draftReleaseNotFound"; invalidParent: "invalidParent"; workflowNotFound: "workflowNotFound"; failedToReconciliateNodes: "failedToReconciliateNodes"; }>; export type ListTemplatesPayload = { hasDocumentation?: boolean; isPreset?: boolean; kinds?: TemplateKind[]; }; export type ListTemplatesResult = { templates: Template[]; }; export type GetTemplatePayload = DateToString<{ slug: string; }>; export type GetTemplateResult = { template: Template; }; export const zodGetTemplateErrorReason: z.ZodEnum<{ templateNotFound: "templateNotFound"; }>; export {}; } const batchKeys: { all: (workspaceUuid: string) => readonly ["batches", string]; get: (workspaceUuid: string, uuid: string) => readonly ["batches", string, string]; list: (workspaceUuid: string, payload: Api.ListBatchesPayload) => readonly ["batches", string, { workflowUuids?: string[] | undefined; releaseUuid?: string | undefined; parentBatchUuid?: string | undefined; parentRunUuid?: string | undefined; parentNodeUuid?: string | undefined; statuses?: BatchStatus[] | undefined; hasRuns?: boolean | undefined; isSkipped?: boolean | undefined; isFinished?: boolean | undefined; includedDataKinds?: ("filter" | "schedule" | "runs" | "file" | "records" | "segment" | "change" | "recordIds" | "form" | "group" | "watchedRecords")[] | undefined; excludedDataKinds?: ("filter" | "schedule" | "runs" | "file" | "records" | "segment" | "change" | "recordIds" | "form" | "group" | "watchedRecords")[] | undefined; limit?: number | undefined; offset?: number | undefined; }]; }; const workflowKeys: { all: (workspaceUuid: string) => readonly ["workflows", string]; }; const playKeys: { all: (workspaceUuid: string) => readonly ["plays", string]; list: (workspaceUuid: string, payload: Api.ListPlaysPayload) => readonly ["plays", string, Api.ListPlaysPayload]; }; const toolsKeys: { all: (workspaceUuid: string) => readonly ["tools", string]; }; const releaseKeys: { all: (workspaceUuid: string) => readonly ["releases", string]; get: (workspaceUuid: string, uuid: string) => readonly ["releases", string, string]; getDraft: (workspaceUuid: string, workflowUuid: string) => readonly ["releases", string, string]; list: (workspaceUuid: string, payload: Api.ListReleasesPayload) => readonly ["releases", string, { workflowUuid?: string | undefined; userUuid?: string | undefined; statuses?: ReleaseStatus[] | undefined; limit?: number | undefined; offset?: number | undefined; }]; }; const draftReleaseKeys: { all: (workspaceUuid: string) => readonly ["draftReleases", string]; get: (workspaceUuid: string, workflowUuid: string) => readonly ["releases", string, string]; }; const runKeys: { all: (workspaceUuid: string) => readonly ["runs", string]; get: (workspaceUuid: string, uuid: string) => readonly ["runs", string, string]; list: (workspaceUuid: string, payload: Api.ListRunsPayload) => readonly ["runs", string, { workflowUuid?: string | undefined; userUuid?: string | undefined; batchUuid?: string | undefined; releaseUuid?: string | undefined; statuses?: RunStatus[] | undefined; parentBatchUuid?: string | undefined; parentUuid?: string | undefined; parentNodeUuid?: string | undefined; isGroupParent?: boolean | undefined; recordId?: string | undefined; recordTitle?: string | undefined; recordTitleOrId?: string | undefined; search?: string | undefined; isFinished?: boolean | undefined; executionsFilter?: { conjonction: OrchestrationTypes.ExecutionsFilterConjonction; groups: { conjonction: OrchestrationTypes.ExecutionsFilterConjonction; conditions: { kind: "node"; nodeSlug: string; status: OrchestrationTypes.ExecutionsFilterNodeStatus; value?: string | undefined; }[]; }[]; } | undefined; createdAfter?: string | undefined; createdBefore?: string | undefined; updatedAfter?: string | undefined; updatedBefore?: string | undefined; limit?: number | undefined; offset?: number | undefined; }]; count: (workspaceUuid: string, payload: Api.CountRunsPayload) => readonly ["runs", string, { workflowUuid?: string | undefined; userUuid?: string | undefined; batchUuid?: string | undefined; releaseUuid?: string | undefined; statuses?: RunStatus[] | undefined; parentBatchUuid?: string | undefined; parentUuid?: string | undefined; parentNodeUuid?: string | undefined; isGroupParent?: boolean | undefined; recordId?: string | undefined; recordTitle?: string | undefined; recordTitleOrId?: string | undefined; search?: string | undefined; isFinished?: boolean | undefined; executionsFilter?: { conjonction: OrchestrationTypes.ExecutionsFilterConjonction; groups: { conjonction: OrchestrationTypes.ExecutionsFilterConjonction; conditions: { kind: "node"; nodeSlug: string; status: OrchestrationTypes.ExecutionsFilterNodeStatus; value?: string | undefined; }[]; }[]; } | undefined; createdAfter?: string | undefined; createdBefore?: string | undefined; updatedAfter?: string | undefined; updatedBefore?: string | undefined; }]; getMetrics: (workspaceUuid: string, payload: Api.GetRunMetricsPayload) => readonly ["runs", string, { workflowUuid: string; releaseUuid?: string | undefined; batchUuid?: string | undefined; createdAfter?: string | undefined; createdBefore?: string | undefined; }]; }; const recordKeys: { all: (workspaceUuid: string) => readonly ["records", string]; list: (workspaceUuid: string, payload: Api.ListRecordsPayload) => readonly ["records", string, { workflowUuid?: string | undefined; userUuid?: string | undefined; ids?: string[] | undefined; title?: string | undefined; titleOrId?: string | undefined; search?: string | undefined; releaseUuid?: string | undefined; batchUuid?: string | undefined; statuses?: RecordStatus[] | undefined; parentBatchUuid?: string | undefined; parentRunUuid?: string | undefined; parentNodeUuid?: string | undefined; isGroupParent?: boolean | undefined; executionsFilter?: { conjonction: OrchestrationTypes.ExecutionsFilterConjonction; groups: { conjonction: OrchestrationTypes.ExecutionsFilterConjonction; conditions: { kind: "node"; nodeSlug: string; status: OrchestrationTypes.ExecutionsFilterNodeStatus; value?: string | undefined; }[]; }[]; } | undefined; createdAfter?: string | undefined; createdBefore?: string | undefined; updatedAfter?: string | undefined; updatedBefore?: string | undefined; limit?: number | undefined; offset?: number | undefined; }]; count: (workspaceUuid: string, payload: Api.CountRecordsPayload) => readonly ["records", string, { workflowUuid?: string | undefined; userUuid?: string | undefined; ids?: string[] | undefined; title?: string | undefined; titleOrId?: string | undefined; search?: string | undefined; releaseUuid?: string | undefined; batchUuid?: string | undefined; statuses?: RecordStatus[] | undefined; parentBatchUuid?: string | undefined; parentRunUuid?: string | undefined; parentNodeUuid?: string | undefined; isGroupParent?: boolean | undefined; executionsFilter?: { conjonction: OrchestrationTypes.ExecutionsFilterConjonction; groups: { conjonction: OrchestrationTypes.ExecutionsFilterConjonction; conditions: { kind: "node"; nodeSlug: string; status: OrchestrationTypes.ExecutionsFilterNodeStatus; value?: string | undefined; }[]; }[]; } | undefined; createdAfter?: string | undefined; createdBefore?: string | undefined; updatedAfter?: string | undefined; updatedBefore?: string | undefined; }]; getMetrics: (workspaceUuid: string, payload: Api.GetRecordMetricsPayload) => readonly ["records", string, { workflowUuid: string; releaseUuid?: string | undefined; batchUuid?: string | undefined; createdAfter?: string | undefined; createdBefore?: string | undefined; }]; }; const spanKeys: { all: (workspaceUuid: string) => readonly ["spans", string]; list: (workspaceUuid: string, payload: Api.ListSpansPayload) => readonly ["spans", string, { workflowUuid?: string | undefined; userUuid?: string | undefined; batchUuid?: string | undefined; traceUuid?: string | undefined; runUuid?: string | undefined; recordId?: string | undefined; recordTitle?: string | undefined; recordTitleOrId?: string | undefined; search?: string | undefined; parentRunUuid?: string | undefined; parentNodeUuid?: string | undefined; parentAgentUuid?: string | undefined; nodeUuid?: string | undefined; nodeKind?: "agent" | "mcpServer" | "connector" | "native" | "autocomplete" | "worker" | "tool" | "capability" | "harness" | undefined; nodeSlug?: string | undefined; nodeIntegrationSlug?: string | undefined; nodeConnectorUuid?: string | undefined; nodeActionSlug?: string | undefined; nodeToolUuid?: string | undefined; nodeAgentUuid?: string | undefined; nodeWorkerUuid?: string | undefined; nodeReleaseUuid?: string | undefined; executionTitle?: string | undefined; executionTitleOrErrorMessage?: string | undefined; executionStatuses?: ExecutionStatus[] | undefined; executionStartedAfter: string; executionStartedBefore?: string | undefined; limit?: number | undefined; offset?: number | undefined; }]; count: (workspaceUuid: string, payload: Api.CountSpansPayload) => readonly ["spans", string, { workflowUuid?: string | undefined; userUuid?: string | undefined; batchUuid?: string | undefined; traceUuid?: string | undefined; runUuid?: string | undefined; recordId?: string | undefined; recordTitle?: string | undefined; recordTitleOrId?: string | undefined; search?: string | undefined; parentRunUuid?: string | undefined; parentNodeUuid?: string | undefined; parentAgentUuid?: string | undefined; nodeUuid?: string | undefined; nodeKind?: "agent" | "mcpServer" | "connector" | "native" | "autocomplete" | "worker" | "tool" | "capability" | "harness" | undefined; nodeSlug?: string | undefined; nodeIntegrationSlug?: string | undefined; nodeConnectorUuid?: string | undefined; nodeActionSlug?: string | undefined; nodeToolUuid?: string | undefined; nodeAgentUuid?: string | undefined; nodeWorkerUuid?: string | undefined; nodeReleaseUuid?: string | undefined; executionTitle?: string | undefined; executionTitleOrErrorMessage?: string | undefined; executionStatuses?: ExecutionStatus[] | undefined; executionStartedAfter: string; executionStartedBefore?: string | undefined; }]; }; const traceKeys: { all: (workspaceUuid: string) => readonly ["traces", string]; get: (workspaceUuid: string, uuid: string) => readonly ["traces", string, string]; list: (workspaceUuid: string, payload: Api.ListTracesPayload) => readonly ["traces", string, { workflowUuid?: string | undefined; chatUuid?: string | undefined; agentUuid?: string | undefined; workerUuid?: string | undefined; statuses?: TraceStatus[] | undefined; startedAfter: string; startedBefore?: string | undefined; limit?: number | undefined; offset?: number | undefined; }]; count: (workspaceUuid: string, payload: Api.CountTracesPayload) => readonly ["traces", string, { workflowUuid?: string | undefined; chatUuid?: string | undefined; agentUuid?: string | undefined; workerUuid?: string | undefined; statuses?: TraceStatus[] | undefined; startedAfter: string; startedBefore?: string | undefined; }]; }; const queryKeys: { all: (workspaceUuid: string) => readonly ["query", string]; execute: (workspaceUuid: string, payload: Api.ExecuteQueryPayload) => readonly ["query", string, Api.ExecuteQueryPayload]; }; const templateKeys: { all: () => readonly ["templates"]; get: (slug: string) => readonly ["templates", string]; list: (payload: Api.ListTemplatesPayload) => readonly ["templates", Api.ListTemplatesPayload]; }; } export {}; //# sourceMappingURL=orchestration.d.ts.map