deepline 0.3.237 → 0.3.238

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -3454,27 +3454,33 @@ type RunGetStatus = {
3454
3454
  };
3455
3455
  } | null;
3456
3456
  };
3457
- /** Streaming options for `client.runs.tail(...)`. */
3458
- type RunsTailOptions = {
3457
+ /** Options for `client.runs.watch(...)`. */
3458
+ type RunsWatchOptions = {
3459
3459
  signal?: AbortSignal;
3460
- /** Observe each canonical live event while `tail` waits for terminal state. */
3460
+ /** Observe each canonical event while `watch` waits for terminal state. */
3461
3461
  onEvent?: (event: PlayLiveEvent) => void;
3462
3462
  /**
3463
- * Called before each stream reconnect. Server stream windows are finite, so
3464
- * long runs reconnect with backoff until a terminal status is observed.
3463
+ * Called once when a transient REST polling outage begins. Polling retries
3464
+ * on its normal fixed interval.
3465
3465
  */
3466
+ onRetry?: (info: {
3467
+ attempt: number;
3468
+ delayMs: number;
3469
+ reason: string;
3470
+ }) => void;
3471
+ /** @deprecated Use `onRetry`. */
3466
3472
  onReconnect?: (info: {
3467
3473
  attempt: number;
3468
3474
  delayMs: number;
3469
3475
  reason: string;
3470
3476
  }) => void;
3471
3477
  /**
3472
- * Display-only transport notices: subscription-transport reconnects,
3473
- * staleness warnings, and the one-time fallback notice when the server
3474
- * cannot serve the Convex subscription transport (ADR-0008).
3478
+ * Display-only notices for a transient snapshot polling outage or recovery.
3475
3479
  */
3476
3480
  onNotice?: (message: string) => void;
3477
3481
  };
3482
+ /** @deprecated Use `RunsWatchOptions`. */
3483
+ type RunsTailOptions = RunsWatchOptions;
3478
3484
  /** Log fetch options for `client.runs.logs(...)`. */
3479
3485
  type RunsLogsOptions = {
3480
3486
  /** Return the LAST `limit` stored log lines (default 200). */
@@ -3562,7 +3568,7 @@ type PlaySecretCheck = {
3562
3568
  secret: PlaySecretMetadata | null;
3563
3569
  };
3564
3570
  /**
3565
- * Use `client.runs` (`/api/v2/runs`) to poll, stream, stop, read logs, and export durable dataset rows.
3571
+ * Use `client.runs` (`/api/v2/runs`) to watch, stop, read logs, and export durable dataset rows.
3566
3572
  *
3567
3573
  * @sdkReference client 020 client.runs
3568
3574
  */
@@ -3588,7 +3594,9 @@ type RunsNamespace = {
3588
3594
  list: (options: RunsListOptions) => Promise<PlayRunListItem[]>;
3589
3595
  /** Read one run page with total, offset, limit and completeness metadata. */
3590
3596
  listPage: (options: RunsListOptions) => Promise<RunsListPage>;
3591
- /** Stream run events and return the latest/terminal run status. */
3597
+ /** Poll run snapshots every two seconds until terminal status. */
3598
+ watch: (runId: string, options?: RunsWatchOptions) => Promise<PlayStatus>;
3599
+ /** @deprecated Use `watch`; retained as a source-compatible alias. */
3592
3600
  tail: (runId: string, options?: RunsTailOptions) => Promise<PlayStatus>;
3593
3601
  /** Fetch persisted log lines for a run. */
3594
3602
  logs: (runId: string, options?: RunsLogsOptions) => Promise<RunsLogsResult>;
@@ -5095,15 +5103,17 @@ declare class DeeplineClient {
5095
5103
  */
5096
5104
  startPlayRun(request: StartPlayRunRequest): Promise<PlayRunStart>;
5097
5105
  /**
5098
- * Start a play run and stream live runtime events from the same request.
5106
+ * Submit a play run through the legacy event response.
5107
+ *
5108
+ * This reports admission from the start request; it does not watch an
5109
+ * existing run. Use `startPlayRun()` and `watchRunEvents(runId)` separately.
5099
5110
  *
5100
- * Use this when a caller wants low-level event handling instead of submitting
5101
- * first and then connecting to `streamPlayRunEvents(runId)`.
5111
+ * @deprecated Use the separate start and watch methods.
5102
5112
  *
5103
5113
  * @param request - Play run configuration.
5104
- * @param options - Optional streaming options.
5105
- * @param options.signal - Optional abort signal for the streaming request.
5106
- * @returns Async stream of play-scoped live events.
5114
+ * @param options - Optional compatibility response options.
5115
+ * @param options.signal - Abort the start response.
5116
+ * @returns Async generator of play-scoped live events.
5107
5117
  */
5108
5118
  startPlayRunStream(request: StartPlayRunRequest, options?: {
5109
5119
  signal?: AbortSignal;
@@ -5364,17 +5374,50 @@ declare class DeeplineClient {
5364
5374
  billing?: boolean;
5365
5375
  full?: boolean;
5366
5376
  }): Promise<PlayStatus>;
5377
+ /** Poll authenticated run snapshots every two seconds and emit changed events. */
5378
+ watchRunEvents(workflowId: string, options?: {
5379
+ signal?: AbortSignal;
5380
+ onNotice?: (message: string) => void;
5381
+ onRetry?: RunsWatchOptions['onRetry'];
5382
+ }): AsyncGenerator<PlayLiveEvent>;
5367
5383
  /**
5368
- * Stream semantic play-run events using the same SSE feed as the dashboard.
5384
+ * Read raw legacy SSE events for callers that explicitly require that
5385
+ * compatibility endpoint. Ordinary run watching uses REST snapshot polling.
5369
5386
  *
5370
- * The server emits a canonical `play.run.snapshot` event first for every
5371
- * connection, then incremental live events until terminal state or reconnect.
5387
+ * @deprecated Use `watchRunEvents` for ordinary run watching.
5372
5388
  */
5373
5389
  streamPlayRunEvents(workflowId: string, options?: {
5374
5390
  signal?: AbortSignal;
5375
5391
  lastEventId?: string;
5376
5392
  mode?: 'cli' | 'ui';
5377
5393
  }): AsyncGenerator<PlayLiveEvent>;
5394
+ /**
5395
+ * Compatibility alias for polling canonical run snapshots and emitting
5396
+ * their changed events.
5397
+ *
5398
+ * @deprecated Use `watchRunEvents`; kept as a source-compatible alias.
5399
+ * The `fallback` option is ignored because watching uses REST polling.
5400
+ */
5401
+ observeRunEvents(runId: string, options?: {
5402
+ signal?: AbortSignal;
5403
+ onNotice?: (message: string) => void;
5404
+ /** @deprecated Ignored; watching always uses REST snapshot polling. */
5405
+ fallback?: 'sse' | 'none';
5406
+ }): AsyncGenerator<PlayLiveEvent>;
5407
+ /** Poll snapshots to terminal status and return the durable package. */
5408
+ private watchRunToTerminal;
5409
+ /**
5410
+ * Wait for a run and return its terminal status.
5411
+ *
5412
+ * This source-compatible alias uses the same authenticated two-second REST
5413
+ * snapshot polling as `client.runs.watch`.
5414
+ *
5415
+ * @deprecated Use `client.runs.watch`; retained for SDK compatibility.
5416
+ * @param runId - Public Deepline play-run id.
5417
+ * @param options - Optional callbacks and cancellation signal.
5418
+ * @returns The final durable run status.
5419
+ */
5420
+ tailRun(runId: string, options?: RunsTailOptions): Promise<PlayStatus>;
5378
5421
  /**
5379
5422
  * Cancel a running play execution.
5380
5423
  *
@@ -5492,39 +5535,6 @@ declare class DeeplineClient {
5492
5535
  listRuns(options: RunsListOptions): Promise<PlayRunListItem[]>;
5493
5536
  /** Read one run page without discarding server pagination metadata. */
5494
5537
  listRunsPage(options: RunsListOptions): Promise<RunsListPage>;
5495
- /**
5496
- * Observe one run's live events. Uses the Convex Run Snapshot subscription
5497
- * transport first (ADR-0008), then falls back to the canonical SSE stream
5498
- * when the subscription transport or its optional client modules are not
5499
- * available. Pass `fallback: 'none'` to receive
5500
- * {@link RunObserveTransportUnavailableError} instead.
5501
- */
5502
- observeRunEvents(runId: string, options?: {
5503
- signal?: AbortSignal;
5504
- onNotice?: (message: string) => void;
5505
- fallback?: 'sse' | 'none';
5506
- }): AsyncGenerator<PlayLiveEvent>;
5507
- private streamPlayRunEventsUntilTerminal;
5508
- /**
5509
- * Tail one run through the subscription transport until terminal, then
5510
- * return one durable REST status read (the final Run Response Package).
5511
- */
5512
- private tailRunViaObserveTransport;
5513
- /**
5514
- * Read the canonical run stream until a terminal run status is observed.
5515
- *
5516
- * Tries the Convex Run Snapshot subscription transport first (ADR-0008);
5517
- * when the server cannot serve it (grant endpoint missing/unconfigured or
5518
- * Convex unreachable) it falls back — with one `onNotice` message — to the
5519
- * support-window SSE stream below.
5520
- *
5521
- * Server stream windows are finite: they end cleanly at the function
5522
- * ceiling even while the run keeps executing. A window that ends (cleanly
5523
- * or via transient network error) without a terminal event triggers one
5524
- * durable-status re-check followed by a backed-off reconnect, so long runs
5525
- * tail to completion. Abort via `options.signal` to stop waiting.
5526
- */
5527
- tailRun(runId: string, options?: RunsTailOptions): Promise<PlayStatus>;
5528
5538
  /** Get the exact original input retained for a run. This is intentionally separate from status. */
5529
5539
  getRunInput(runId: string): Promise<{
5530
5540
  runId: string;
@@ -5854,10 +5864,10 @@ declare class DeeplineClient {
5854
5864
  revisionId?: string;
5855
5865
  }): Promise<SharePageStatus>;
5856
5866
  /**
5857
- * Run a play end-to-end: submit, stream until terminal, return result.
5867
+ * Run a play end-to-end: submit, poll progress until terminal, return result.
5858
5868
  *
5859
5869
  * This is the highest-level play execution method. It submits the play,
5860
- * reads the canonical run stream for status updates, and returns a structured
5870
+ * reads the canonical run snapshot for status updates, and returns a structured
5861
5871
  * result with logs and timing. Supports cancellation via `AbortSignal`.
5862
5872
  *
5863
5873
  * @param code - Source string fallback; pass the bundled artifact in `options.artifact`
@@ -6879,8 +6889,12 @@ declare const defineWorkflow: typeof definePlay;
6879
6889
  declare function getDefinedPlayMetadata(value: unknown): PlayMetadata | null;
6880
6890
 
6881
6891
  /**
6882
- * Bootstrap failure: this server/deployment cannot serve the subscription
6883
- * transport. Callers fall back to the support-window SSE stream (ADR-0008).
6892
+ * Compatibility export retained for SDK callers that imported the old error.
6893
+ * Run watching now uses authenticated REST snapshot polling and does not throw
6894
+ * this error.
6895
+ *
6896
+ * @deprecated The subscription transport has been removed. Use
6897
+ * `client.watchRunEvents()` or `client.runs.watch()`.
6884
6898
  */
6885
6899
  declare class RunObserveTransportUnavailableError extends Error {
6886
6900
  readonly reason: string;
@@ -7166,4 +7180,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
7166
7180
  */
7167
7181
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
7168
7182
 
7169
- export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingRecentUsageEntry, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpReceipt, type BillingTopUpResult, type BillingUsageEvent, type BillingUsageOptions, type BillingUsageResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CreateNotificationGroupInput, type CreateNotificationGroupResult, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, type DbNamespace, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineExecutionsNamespace, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolExecuteResult, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type ExecutionByKeyResult, type ExecutionRecovery, type FetchOptions, type FileInput, type IngestionStorageRepairResult, type LegacyMonitorStatusFilter, type LiveEventEnvelope, MONITOR_JOB_PHASES, MONITOR_JOB_RECONCILIATION_STATES, MONITOR_JOB_STATES, type MonitorBatchNamespace, type MonitorCheckResult, type MonitorDefinition, type MonitorDeleteResult, type MonitorDependents, type MonitorDeployResult, type MonitorDetail, type MonitorFleetDeactivateOptions, MonitorFleetDefinition, type MonitorFleetGetOptions, type MonitorFleetReactivateOptions, type MonitorFleetResult, type MonitorFleetStatus, type MonitorFleetSyncOptions, type MonitorFleetWaitOptions, type MonitorFleetsNamespace, type MonitorJobDeployOptions, type MonitorJobLogsOptions, type MonitorJobPhase, type MonitorJobReconciliationState, type MonitorJobResult, type MonitorJobState, type MonitorJobWaitOptions, type MonitorJobsNamespace, type MonitorListEntry, type MonitorPayload, type MonitorReactivateResult, type MonitorSpec, type MonitorState, type MonitorStateFilter, type MonitorUpdateChangeSummary, type MonitorUpdateResult, type MonitorsAccessStatus, type MonitorsAvailableOptions, type MonitorsAvailableResult, type MonitorsListOptions, type MonitorsListResult, type MonitorsNamespace, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayActivityObservation, type PlayActivityState, type PlayActivityTarget, type PlayAsyncCallOptions, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayCostEstimate, type PlayFetchResponse, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayPath, type PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySettings, type PlaySettingsPatch, type PlaySettingsPathsPage, type PlaySettingsResult, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PlaysActivityResponse, type PlaysListOptions, type PlaysListPage, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type RerunOptions, type RerunPlayRunResult, type ResolvedConfig, type RunLifecycleStatus, RunObserveTransportUnavailableError, type RunsListOptions, type RunsListPage, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, type RuntimeStepOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopAllCandidate, type StopAllPlayRunsDryRunResult, type StopAllPlayRunsResult, type StopAllPlayRunsStopResult, type StopAllRunsOptions, type StopPlayRunResult, type ToolDefinition, ToolExecuteResult, type ToolExecution, ToolExecutionError, ToolExecutionErrorOptions, type ToolExecutionRequest, type ToolMetadata, ToolRateLimitError, ToolResultBilling, type ToolSearchOptions, type ToolSearchResult, type WorkspaceCreateResult, type WorkspacesNamespace, defineInput, defineMonitor, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, isStopAllPlayRunsDryRunResult, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
7183
+ export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingRecentUsageEntry, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpReceipt, type BillingTopUpResult, type BillingUsageEvent, type BillingUsageOptions, type BillingUsageResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CreateNotificationGroupInput, type CreateNotificationGroupResult, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, type DbNamespace, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineExecutionsNamespace, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolExecuteResult, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type ExecutionByKeyResult, type ExecutionRecovery, type FetchOptions, type FileInput, type IngestionStorageRepairResult, type LegacyMonitorStatusFilter, type LiveEventEnvelope, MONITOR_JOB_PHASES, MONITOR_JOB_RECONCILIATION_STATES, MONITOR_JOB_STATES, type MonitorBatchNamespace, type MonitorCheckResult, type MonitorDefinition, type MonitorDeleteResult, type MonitorDependents, type MonitorDeployResult, type MonitorDetail, type MonitorFleetDeactivateOptions, MonitorFleetDefinition, type MonitorFleetGetOptions, type MonitorFleetReactivateOptions, type MonitorFleetResult, type MonitorFleetStatus, type MonitorFleetSyncOptions, type MonitorFleetWaitOptions, type MonitorFleetsNamespace, type MonitorJobDeployOptions, type MonitorJobLogsOptions, type MonitorJobPhase, type MonitorJobReconciliationState, type MonitorJobResult, type MonitorJobState, type MonitorJobWaitOptions, type MonitorJobsNamespace, type MonitorListEntry, type MonitorPayload, type MonitorReactivateResult, type MonitorSpec, type MonitorState, type MonitorStateFilter, type MonitorUpdateChangeSummary, type MonitorUpdateResult, type MonitorsAccessStatus, type MonitorsAvailableOptions, type MonitorsAvailableResult, type MonitorsListOptions, type MonitorsListResult, type MonitorsNamespace, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayActivityObservation, type PlayActivityState, type PlayActivityTarget, type PlayAsyncCallOptions, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayCostEstimate, type PlayFetchResponse, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayPath, type PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySettings, type PlaySettingsPatch, type PlaySettingsPathsPage, type PlaySettingsResult, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PlaysActivityResponse, type PlaysListOptions, type PlaysListPage, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type RerunOptions, type RerunPlayRunResult, type ResolvedConfig, type RunLifecycleStatus, RunObserveTransportUnavailableError, type RunsListOptions, type RunsListPage, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, type RunsWatchOptions, type RuntimeStepOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopAllCandidate, type StopAllPlayRunsDryRunResult, type StopAllPlayRunsResult, type StopAllPlayRunsStopResult, type StopAllRunsOptions, type StopPlayRunResult, type ToolDefinition, ToolExecuteResult, type ToolExecution, ToolExecutionError, ToolExecutionErrorOptions, type ToolExecutionRequest, type ToolMetadata, ToolRateLimitError, ToolResultBilling, type ToolSearchOptions, type ToolSearchResult, type WorkspaceCreateResult, type WorkspacesNamespace, defineInput, defineMonitor, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, isStopAllPlayRunsDryRunResult, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
package/dist/index.d.ts CHANGED
@@ -3454,27 +3454,33 @@ type RunGetStatus = {
3454
3454
  };
3455
3455
  } | null;
3456
3456
  };
3457
- /** Streaming options for `client.runs.tail(...)`. */
3458
- type RunsTailOptions = {
3457
+ /** Options for `client.runs.watch(...)`. */
3458
+ type RunsWatchOptions = {
3459
3459
  signal?: AbortSignal;
3460
- /** Observe each canonical live event while `tail` waits for terminal state. */
3460
+ /** Observe each canonical event while `watch` waits for terminal state. */
3461
3461
  onEvent?: (event: PlayLiveEvent) => void;
3462
3462
  /**
3463
- * Called before each stream reconnect. Server stream windows are finite, so
3464
- * long runs reconnect with backoff until a terminal status is observed.
3463
+ * Called once when a transient REST polling outage begins. Polling retries
3464
+ * on its normal fixed interval.
3465
3465
  */
3466
+ onRetry?: (info: {
3467
+ attempt: number;
3468
+ delayMs: number;
3469
+ reason: string;
3470
+ }) => void;
3471
+ /** @deprecated Use `onRetry`. */
3466
3472
  onReconnect?: (info: {
3467
3473
  attempt: number;
3468
3474
  delayMs: number;
3469
3475
  reason: string;
3470
3476
  }) => void;
3471
3477
  /**
3472
- * Display-only transport notices: subscription-transport reconnects,
3473
- * staleness warnings, and the one-time fallback notice when the server
3474
- * cannot serve the Convex subscription transport (ADR-0008).
3478
+ * Display-only notices for a transient snapshot polling outage or recovery.
3475
3479
  */
3476
3480
  onNotice?: (message: string) => void;
3477
3481
  };
3482
+ /** @deprecated Use `RunsWatchOptions`. */
3483
+ type RunsTailOptions = RunsWatchOptions;
3478
3484
  /** Log fetch options for `client.runs.logs(...)`. */
3479
3485
  type RunsLogsOptions = {
3480
3486
  /** Return the LAST `limit` stored log lines (default 200). */
@@ -3562,7 +3568,7 @@ type PlaySecretCheck = {
3562
3568
  secret: PlaySecretMetadata | null;
3563
3569
  };
3564
3570
  /**
3565
- * Use `client.runs` (`/api/v2/runs`) to poll, stream, stop, read logs, and export durable dataset rows.
3571
+ * Use `client.runs` (`/api/v2/runs`) to watch, stop, read logs, and export durable dataset rows.
3566
3572
  *
3567
3573
  * @sdkReference client 020 client.runs
3568
3574
  */
@@ -3588,7 +3594,9 @@ type RunsNamespace = {
3588
3594
  list: (options: RunsListOptions) => Promise<PlayRunListItem[]>;
3589
3595
  /** Read one run page with total, offset, limit and completeness metadata. */
3590
3596
  listPage: (options: RunsListOptions) => Promise<RunsListPage>;
3591
- /** Stream run events and return the latest/terminal run status. */
3597
+ /** Poll run snapshots every two seconds until terminal status. */
3598
+ watch: (runId: string, options?: RunsWatchOptions) => Promise<PlayStatus>;
3599
+ /** @deprecated Use `watch`; retained as a source-compatible alias. */
3592
3600
  tail: (runId: string, options?: RunsTailOptions) => Promise<PlayStatus>;
3593
3601
  /** Fetch persisted log lines for a run. */
3594
3602
  logs: (runId: string, options?: RunsLogsOptions) => Promise<RunsLogsResult>;
@@ -5095,15 +5103,17 @@ declare class DeeplineClient {
5095
5103
  */
5096
5104
  startPlayRun(request: StartPlayRunRequest): Promise<PlayRunStart>;
5097
5105
  /**
5098
- * Start a play run and stream live runtime events from the same request.
5106
+ * Submit a play run through the legacy event response.
5107
+ *
5108
+ * This reports admission from the start request; it does not watch an
5109
+ * existing run. Use `startPlayRun()` and `watchRunEvents(runId)` separately.
5099
5110
  *
5100
- * Use this when a caller wants low-level event handling instead of submitting
5101
- * first and then connecting to `streamPlayRunEvents(runId)`.
5111
+ * @deprecated Use the separate start and watch methods.
5102
5112
  *
5103
5113
  * @param request - Play run configuration.
5104
- * @param options - Optional streaming options.
5105
- * @param options.signal - Optional abort signal for the streaming request.
5106
- * @returns Async stream of play-scoped live events.
5114
+ * @param options - Optional compatibility response options.
5115
+ * @param options.signal - Abort the start response.
5116
+ * @returns Async generator of play-scoped live events.
5107
5117
  */
5108
5118
  startPlayRunStream(request: StartPlayRunRequest, options?: {
5109
5119
  signal?: AbortSignal;
@@ -5364,17 +5374,50 @@ declare class DeeplineClient {
5364
5374
  billing?: boolean;
5365
5375
  full?: boolean;
5366
5376
  }): Promise<PlayStatus>;
5377
+ /** Poll authenticated run snapshots every two seconds and emit changed events. */
5378
+ watchRunEvents(workflowId: string, options?: {
5379
+ signal?: AbortSignal;
5380
+ onNotice?: (message: string) => void;
5381
+ onRetry?: RunsWatchOptions['onRetry'];
5382
+ }): AsyncGenerator<PlayLiveEvent>;
5367
5383
  /**
5368
- * Stream semantic play-run events using the same SSE feed as the dashboard.
5384
+ * Read raw legacy SSE events for callers that explicitly require that
5385
+ * compatibility endpoint. Ordinary run watching uses REST snapshot polling.
5369
5386
  *
5370
- * The server emits a canonical `play.run.snapshot` event first for every
5371
- * connection, then incremental live events until terminal state or reconnect.
5387
+ * @deprecated Use `watchRunEvents` for ordinary run watching.
5372
5388
  */
5373
5389
  streamPlayRunEvents(workflowId: string, options?: {
5374
5390
  signal?: AbortSignal;
5375
5391
  lastEventId?: string;
5376
5392
  mode?: 'cli' | 'ui';
5377
5393
  }): AsyncGenerator<PlayLiveEvent>;
5394
+ /**
5395
+ * Compatibility alias for polling canonical run snapshots and emitting
5396
+ * their changed events.
5397
+ *
5398
+ * @deprecated Use `watchRunEvents`; kept as a source-compatible alias.
5399
+ * The `fallback` option is ignored because watching uses REST polling.
5400
+ */
5401
+ observeRunEvents(runId: string, options?: {
5402
+ signal?: AbortSignal;
5403
+ onNotice?: (message: string) => void;
5404
+ /** @deprecated Ignored; watching always uses REST snapshot polling. */
5405
+ fallback?: 'sse' | 'none';
5406
+ }): AsyncGenerator<PlayLiveEvent>;
5407
+ /** Poll snapshots to terminal status and return the durable package. */
5408
+ private watchRunToTerminal;
5409
+ /**
5410
+ * Wait for a run and return its terminal status.
5411
+ *
5412
+ * This source-compatible alias uses the same authenticated two-second REST
5413
+ * snapshot polling as `client.runs.watch`.
5414
+ *
5415
+ * @deprecated Use `client.runs.watch`; retained for SDK compatibility.
5416
+ * @param runId - Public Deepline play-run id.
5417
+ * @param options - Optional callbacks and cancellation signal.
5418
+ * @returns The final durable run status.
5419
+ */
5420
+ tailRun(runId: string, options?: RunsTailOptions): Promise<PlayStatus>;
5378
5421
  /**
5379
5422
  * Cancel a running play execution.
5380
5423
  *
@@ -5492,39 +5535,6 @@ declare class DeeplineClient {
5492
5535
  listRuns(options: RunsListOptions): Promise<PlayRunListItem[]>;
5493
5536
  /** Read one run page without discarding server pagination metadata. */
5494
5537
  listRunsPage(options: RunsListOptions): Promise<RunsListPage>;
5495
- /**
5496
- * Observe one run's live events. Uses the Convex Run Snapshot subscription
5497
- * transport first (ADR-0008), then falls back to the canonical SSE stream
5498
- * when the subscription transport or its optional client modules are not
5499
- * available. Pass `fallback: 'none'` to receive
5500
- * {@link RunObserveTransportUnavailableError} instead.
5501
- */
5502
- observeRunEvents(runId: string, options?: {
5503
- signal?: AbortSignal;
5504
- onNotice?: (message: string) => void;
5505
- fallback?: 'sse' | 'none';
5506
- }): AsyncGenerator<PlayLiveEvent>;
5507
- private streamPlayRunEventsUntilTerminal;
5508
- /**
5509
- * Tail one run through the subscription transport until terminal, then
5510
- * return one durable REST status read (the final Run Response Package).
5511
- */
5512
- private tailRunViaObserveTransport;
5513
- /**
5514
- * Read the canonical run stream until a terminal run status is observed.
5515
- *
5516
- * Tries the Convex Run Snapshot subscription transport first (ADR-0008);
5517
- * when the server cannot serve it (grant endpoint missing/unconfigured or
5518
- * Convex unreachable) it falls back — with one `onNotice` message — to the
5519
- * support-window SSE stream below.
5520
- *
5521
- * Server stream windows are finite: they end cleanly at the function
5522
- * ceiling even while the run keeps executing. A window that ends (cleanly
5523
- * or via transient network error) without a terminal event triggers one
5524
- * durable-status re-check followed by a backed-off reconnect, so long runs
5525
- * tail to completion. Abort via `options.signal` to stop waiting.
5526
- */
5527
- tailRun(runId: string, options?: RunsTailOptions): Promise<PlayStatus>;
5528
5538
  /** Get the exact original input retained for a run. This is intentionally separate from status. */
5529
5539
  getRunInput(runId: string): Promise<{
5530
5540
  runId: string;
@@ -5854,10 +5864,10 @@ declare class DeeplineClient {
5854
5864
  revisionId?: string;
5855
5865
  }): Promise<SharePageStatus>;
5856
5866
  /**
5857
- * Run a play end-to-end: submit, stream until terminal, return result.
5867
+ * Run a play end-to-end: submit, poll progress until terminal, return result.
5858
5868
  *
5859
5869
  * This is the highest-level play execution method. It submits the play,
5860
- * reads the canonical run stream for status updates, and returns a structured
5870
+ * reads the canonical run snapshot for status updates, and returns a structured
5861
5871
  * result with logs and timing. Supports cancellation via `AbortSignal`.
5862
5872
  *
5863
5873
  * @param code - Source string fallback; pass the bundled artifact in `options.artifact`
@@ -6879,8 +6889,12 @@ declare const defineWorkflow: typeof definePlay;
6879
6889
  declare function getDefinedPlayMetadata(value: unknown): PlayMetadata | null;
6880
6890
 
6881
6891
  /**
6882
- * Bootstrap failure: this server/deployment cannot serve the subscription
6883
- * transport. Callers fall back to the support-window SSE stream (ADR-0008).
6892
+ * Compatibility export retained for SDK callers that imported the old error.
6893
+ * Run watching now uses authenticated REST snapshot polling and does not throw
6894
+ * this error.
6895
+ *
6896
+ * @deprecated The subscription transport has been removed. Use
6897
+ * `client.watchRunEvents()` or `client.runs.watch()`.
6884
6898
  */
6885
6899
  declare class RunObserveTransportUnavailableError extends Error {
6886
6900
  readonly reason: string;
@@ -7166,4 +7180,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
7166
7180
  */
7167
7181
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
7168
7182
 
7169
- export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingRecentUsageEntry, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpReceipt, type BillingTopUpResult, type BillingUsageEvent, type BillingUsageOptions, type BillingUsageResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CreateNotificationGroupInput, type CreateNotificationGroupResult, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, type DbNamespace, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineExecutionsNamespace, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolExecuteResult, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type ExecutionByKeyResult, type ExecutionRecovery, type FetchOptions, type FileInput, type IngestionStorageRepairResult, type LegacyMonitorStatusFilter, type LiveEventEnvelope, MONITOR_JOB_PHASES, MONITOR_JOB_RECONCILIATION_STATES, MONITOR_JOB_STATES, type MonitorBatchNamespace, type MonitorCheckResult, type MonitorDefinition, type MonitorDeleteResult, type MonitorDependents, type MonitorDeployResult, type MonitorDetail, type MonitorFleetDeactivateOptions, MonitorFleetDefinition, type MonitorFleetGetOptions, type MonitorFleetReactivateOptions, type MonitorFleetResult, type MonitorFleetStatus, type MonitorFleetSyncOptions, type MonitorFleetWaitOptions, type MonitorFleetsNamespace, type MonitorJobDeployOptions, type MonitorJobLogsOptions, type MonitorJobPhase, type MonitorJobReconciliationState, type MonitorJobResult, type MonitorJobState, type MonitorJobWaitOptions, type MonitorJobsNamespace, type MonitorListEntry, type MonitorPayload, type MonitorReactivateResult, type MonitorSpec, type MonitorState, type MonitorStateFilter, type MonitorUpdateChangeSummary, type MonitorUpdateResult, type MonitorsAccessStatus, type MonitorsAvailableOptions, type MonitorsAvailableResult, type MonitorsListOptions, type MonitorsListResult, type MonitorsNamespace, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayActivityObservation, type PlayActivityState, type PlayActivityTarget, type PlayAsyncCallOptions, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayCostEstimate, type PlayFetchResponse, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayPath, type PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySettings, type PlaySettingsPatch, type PlaySettingsPathsPage, type PlaySettingsResult, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PlaysActivityResponse, type PlaysListOptions, type PlaysListPage, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type RerunOptions, type RerunPlayRunResult, type ResolvedConfig, type RunLifecycleStatus, RunObserveTransportUnavailableError, type RunsListOptions, type RunsListPage, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, type RuntimeStepOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopAllCandidate, type StopAllPlayRunsDryRunResult, type StopAllPlayRunsResult, type StopAllPlayRunsStopResult, type StopAllRunsOptions, type StopPlayRunResult, type ToolDefinition, ToolExecuteResult, type ToolExecution, ToolExecutionError, ToolExecutionErrorOptions, type ToolExecutionRequest, type ToolMetadata, ToolRateLimitError, ToolResultBilling, type ToolSearchOptions, type ToolSearchResult, type WorkspaceCreateResult, type WorkspacesNamespace, defineInput, defineMonitor, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, isStopAllPlayRunsDryRunResult, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
7183
+ export { type AsyncPlayRunRef, AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingRecentUsageEntry, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpReceipt, type BillingTopUpResult, type BillingUsageEvent, type BillingUsageOptions, type BillingUsageResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CreateNotificationGroupInput, type CreateNotificationGroupResult, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, type DbNamespace, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, DeeplineError, type DeeplineExecutionsNamespace, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolExecuteResult, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type ExecutionByKeyResult, type ExecutionRecovery, type FetchOptions, type FileInput, type IngestionStorageRepairResult, type LegacyMonitorStatusFilter, type LiveEventEnvelope, MONITOR_JOB_PHASES, MONITOR_JOB_RECONCILIATION_STATES, MONITOR_JOB_STATES, type MonitorBatchNamespace, type MonitorCheckResult, type MonitorDefinition, type MonitorDeleteResult, type MonitorDependents, type MonitorDeployResult, type MonitorDetail, type MonitorFleetDeactivateOptions, MonitorFleetDefinition, type MonitorFleetGetOptions, type MonitorFleetReactivateOptions, type MonitorFleetResult, type MonitorFleetStatus, type MonitorFleetSyncOptions, type MonitorFleetWaitOptions, type MonitorFleetsNamespace, type MonitorJobDeployOptions, type MonitorJobLogsOptions, type MonitorJobPhase, type MonitorJobReconciliationState, type MonitorJobResult, type MonitorJobState, type MonitorJobWaitOptions, type MonitorJobsNamespace, type MonitorListEntry, type MonitorPayload, type MonitorReactivateResult, type MonitorSpec, type MonitorState, type MonitorStateFilter, type MonitorUpdateChangeSummary, type MonitorUpdateResult, type MonitorsAccessStatus, type MonitorsAvailableOptions, type MonitorsAvailableResult, type MonitorsListOptions, type MonitorsListResult, type MonitorsNamespace, PLAY_BOOTSTRAP_COMPANY_FIELDS, PLAY_BOOTSTRAP_COMPANY_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_CONTACT_FIELDS, PLAY_BOOTSTRAP_FINDER_KINDS, PLAY_BOOTSTRAP_OUTPUT_FIELD_BY_FINDER, PLAY_BOOTSTRAP_PEOPLE_PROVIDER_CATEGORY, PLAY_BOOTSTRAP_PROVIDER_CATEGORY_BY_FINDER, PLAY_BOOTSTRAP_SOURCE_KINDS, PLAY_BOOTSTRAP_STAGE_KINDS, PLAY_BOOTSTRAP_TEMPLATES, PROD_URL, type PlayActivityObservation, type PlayActivityState, type PlayActivityTarget, type PlayAsyncCallOptions, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayCostEstimate, type PlayFetchResponse, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayPath, type PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySettings, type PlaySettingsPatch, type PlaySettingsPathsPage, type PlaySettingsResult, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PlaysActivityResponse, type PlaysListOptions, type PlaysListPage, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type RerunOptions, type RerunPlayRunResult, type ResolvedConfig, type RunLifecycleStatus, RunObserveTransportUnavailableError, type RunsListOptions, type RunsListPage, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, type RunsWatchOptions, type RuntimeStepOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopAllCandidate, type StopAllPlayRunsDryRunResult, type StopAllPlayRunsResult, type StopAllPlayRunsStopResult, type StopAllRunsOptions, type StopPlayRunResult, type ToolDefinition, ToolExecuteResult, type ToolExecution, ToolExecutionError, ToolExecutionErrorOptions, type ToolExecutionRequest, type ToolMetadata, ToolRateLimitError, ToolResultBilling, type ToolSearchOptions, type ToolSearchResult, type WorkspaceCreateResult, type WorkspacesNamespace, defineInput, defineMonitor, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, isStopAllPlayRunsDryRunResult, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };