import type { OrchestrationTypes, SegmentationTypes } from "@cargo-ai/types"; import { type Token } from "../core.js"; import { type FolderRef, type ModelRef, type PlayRef } from "../refs.js"; import { type AlertActionSpec } from "./alert.js"; import type { FolderHandle } from "./folder.js"; import type { ModelHandle } from "./model.js"; import type { WorkflowDefinition } from "./tool.js"; export type PlayScheduleSpec = Omit | OrchestrationTypes.PlayScheduleDbt | OrchestrationTypes.PlayScheduleRealtime | (Omit & { /** The upstream play — a play handle or a `playRef(uuid)`. */ play: PlayHandle | PlayRef; }) | Omit; export type PlaySpec = { name?: string; description?: string; /** The data model this play runs over — a model handle or `modelRef(uuid)`. */ model: ModelHandle | ModelRef; /** Optional per-row automation — a `defineWorkflow(...)` result. */ workflow?: WorkflowDefinition; /** Which row changes trigger a run. Defaults to `["added"]`. */ changeKinds?: SegmentationTypes.ChangeKind[]; /** How runs are created on change. Defaults to `"always"`. */ runCreationRule?: OrchestrationTypes.PlayRunCreationRule; filter?: SegmentationTypes.Filter; sort?: SegmentationTypes.Sort; limit?: number; trackingColumnSlugs?: string[]; schedule?: PlayScheduleSpec; /** * Whether the play runs. The platform creates plays DISABLED, so a deployed * play with a schedule still emits nothing until someone flips it on. Set * `true` to enable on deploy (the reconciler enables right after create and * keeps the switch reconciled on update); `false` to hold it off in code. * Omit to leave the switch manual: the CDK neither enables nor disables, * and a UI toggle survives deploys. */ isEnabled?: boolean; /** * Minimum percentage of successful runs (0–100) for a finished batch to * count healthy; below it the batch is unhealthy and `healthAlertActions` * fire. Omit to leave the platform value unmanaged. */ healthThreshold?: number; /** * Fired (each as a run) when a batch finishes unhealthy — same vocabulary * as an alert's `actions`: a connector action, an agent, or a tool. Omit to * leave UI-configured actions unmanaged; `[]` clears them. */ healthAlertActions?: AlertActionSpec[]; folder?: FolderHandle | FolderRef; }; export type PlayHandle = { readonly slug: string; readonly uuid: Token; /** The backing workflow's uuid — spans/runs are keyed by this, not the play uuid. */ readonly workflowUuid: Token; readonly resource: "play"; }; export declare function definePlay(slug: string, spec: PlaySpec): PlayHandle; //# sourceMappingURL=play.d.ts.map