deepline 0.3.201 → 0.3.202

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.
Files changed (39) hide show
  1. package/dist/bundling-sources/sdk/src/client.ts +62 -1
  2. package/dist/bundling-sources/sdk/src/http.ts +55 -6
  3. package/dist/bundling-sources/sdk/src/index.ts +1 -0
  4. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  5. package/dist/bundling-sources/sdk/src/types.ts +8 -0
  6. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +4 -2
  7. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +460 -96
  8. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +11 -1
  9. package/dist/bundling-sources/shared_libs/play-runtime/execution-gateway-invocation-fence.ts +6 -2
  10. package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +401 -2
  11. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +458 -0
  12. package/dist/bundling-sources/shared_libs/play-runtime/provider-no-progress.ts +40 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/receipt-sql.ts +7 -0
  14. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +25 -3
  15. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +1 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +119 -171
  17. package/dist/bundling-sources/shared_libs/play-runtime/runtime-work-counters.ts +37 -0
  18. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +16 -7
  19. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +136 -25
  20. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/receipt-gateway.ts +21 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-receipt-value-storage.ts +64 -15
  22. package/dist/bundling-sources/shared_libs/play-runtime/sheet-attempt-sql.ts +5 -5
  23. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/index.ts +1 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/tool-call/result-receipt-policy.ts +46 -0
  25. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +14 -5
  26. package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +5 -1
  27. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-state-machine.ts +3 -9
  28. package/dist/cli/index.js +343 -39
  29. package/dist/cli/index.mjs +346 -41
  30. package/dist/index.d.mts +129 -1
  31. package/dist/index.d.ts +129 -1
  32. package/dist/index.js +64 -7
  33. package/dist/index.mjs +64 -7
  34. package/dist/install-integrity.json +3 -0
  35. package/dist/release.d.mts +1 -1
  36. package/dist/release.d.ts +1 -1
  37. package/dist/release.js +1 -1
  38. package/dist/release.mjs +1 -1
  39. package/package.json +1 -1
package/dist/index.d.mts CHANGED
@@ -142,11 +142,36 @@ type FixtureResponseSample = {
142
142
  httpError?: {
143
143
  status: number;
144
144
  message: string;
145
+ /** Omitted preserves the historical one-second 429 response. */
146
+ retryAfterMs?: number;
147
+ retryAfterFormat?: 'delta_seconds' | 'http_date';
148
+ /** Omitted preserves a permanent configured HTTP error. */
149
+ failuresBeforeSuccess?: number;
145
150
  };
146
151
  };
147
152
  type FixtureBehaviorV2 = {
148
153
  version: typeof FIXTURE_BEHAVIOR_RESPONSE_VERSION;
149
154
  responseSamples: FixtureResponseSample[];
155
+ transient429?: FixtureTransient429;
156
+ sharedRateLimit?: FixtureSharedRateLimit;
157
+ };
158
+ /** Synthetic provider quotas shared by all calls in the fixture workspace. */
159
+ type FixtureSharedRateLimit = {
160
+ requestsPerSecond?: number;
161
+ requestsPerMinute?: number;
162
+ requestsPerHour?: number;
163
+ /** Test-only target for the next hourly boundary, anchored by the first DB quota attempt. */
164
+ requestsPerHourBoundaryAfterMs?: number;
165
+ };
166
+ type FixtureTransient429 = {
167
+ /** Select one of every N stable tool-call identities. */
168
+ everyNthCall: number;
169
+ retryAfterMs: number;
170
+ failuresBeforeSuccess: number;
171
+ when?: {
172
+ provider?: string;
173
+ operation?: string;
174
+ };
150
175
  };
151
176
  type FixtureReplayBundle = {
152
177
  bundleId: string;
@@ -157,6 +182,8 @@ type FixtureBehaviorV3 = {
157
182
  version: typeof FIXTURE_BEHAVIOR_REPLAY_VERSION;
158
183
  responseSamples: FixtureResponseSample[];
159
184
  replayBundle: FixtureReplayBundle;
185
+ transient429?: FixtureTransient429;
186
+ sharedRateLimit?: FixtureSharedRateLimit;
160
187
  };
161
188
  type FixtureBehavior = FixtureBehaviorV1 | FixtureBehaviorV2 | FixtureBehaviorV3;
162
189
 
@@ -1680,6 +1707,14 @@ interface PlayRunPackage {
1680
1707
  path: string;
1681
1708
  tableNamespace?: string;
1682
1709
  rowCount?: number;
1710
+ /** The materialized dataset count is exact only after this lifecycle completes. */
1711
+ lifecycle?: {
1712
+ phase: 'registered' | 'available' | 'failed';
1713
+ complete: boolean;
1714
+ persistedRowsAtLeast: number;
1715
+ succeededRowsAtLeast: number;
1716
+ failedRowsAtLeast: number;
1717
+ };
1683
1718
  sqlTableName?: string;
1684
1719
  sqlQualifiedTableName?: string;
1685
1720
  recovered?: true;
@@ -3013,6 +3048,9 @@ type EnrichCompiledConfig = {
3013
3048
  };
3014
3049
  };
3015
3050
 
3051
+ /** The only lifecycle states exposed by the API, SDK, CLI, and UI. */
3052
+ type PlayRunPublicStatus = 'queued' | 'running' | 'waiting' | 'completed' | 'failed' | 'cancelled';
3053
+
3016
3054
  type SlackNotificationTarget = {
3017
3055
  channel: string;
3018
3056
  memberId?: never;
@@ -3348,6 +3386,8 @@ type PlaySecretCheck = {
3348
3386
  type RunsNamespace = {
3349
3387
  /** Get current run status by public run id. */
3350
3388
  get: (runId: string, options?: RunsGetOptions) => Promise<PlayStatus>;
3389
+ /** Read bounded scalar lifecycle and confirmed work counts only. */
3390
+ status: (runId: string) => Promise<RunLifecycleStatus>;
3351
3391
  /** Explicitly read the retained original input (may include customer data). */
3352
3392
  input: (runId: string) => Promise<{
3353
3393
  runId: string;
@@ -3374,6 +3414,8 @@ type RunsNamespace = {
3374
3414
  limit?: number;
3375
3415
  offset?: number;
3376
3416
  rowMode?: 'output' | 'all';
3417
+ /** Cancel the page request, including its response body and retry waits. */
3418
+ signal?: AbortSignal;
3377
3419
  }) => Promise<PlaySheetRowsResult>;
3378
3420
  /** Stop a running/waiting run. */
3379
3421
  stop: (runId: string, options?: {
@@ -3393,6 +3435,88 @@ type RunsNamespace = {
3393
3435
  (options?: StopAllRunsOptions): Promise<StopAllPlayRunsResult>;
3394
3436
  };
3395
3437
  };
3438
+ /** Result of the bounded `/api/v2/runs/:runId/status` endpoint. */
3439
+ type RunLifecycleStatus = {
3440
+ available: false;
3441
+ runId: string;
3442
+ } | {
3443
+ available: true;
3444
+ runId: string;
3445
+ lifecycle: {
3446
+ status: PlayRunPublicStatus;
3447
+ updatedAt: number;
3448
+ startedAt: number | null;
3449
+ finishedAt: number | null;
3450
+ };
3451
+ steps: {
3452
+ observed: number;
3453
+ running: number;
3454
+ completed: number;
3455
+ failed: number;
3456
+ skipped: number;
3457
+ confirmed: boolean;
3458
+ };
3459
+ /** Sums across observed step.progress records, not unique output rows. */
3460
+ mapStepWork: {
3461
+ sourceSteps: number;
3462
+ completed: {
3463
+ value: number | null;
3464
+ confirmed: boolean;
3465
+ };
3466
+ total: {
3467
+ value: number | null;
3468
+ confirmed: boolean;
3469
+ };
3470
+ failed: {
3471
+ value: number | null;
3472
+ confirmed: boolean;
3473
+ };
3474
+ startedRows: {
3475
+ value: number | null;
3476
+ confirmed: boolean;
3477
+ };
3478
+ activeRows: {
3479
+ value: number | null;
3480
+ confirmed: boolean;
3481
+ };
3482
+ waitingRows: {
3483
+ value: number | null;
3484
+ confirmed: boolean;
3485
+ };
3486
+ completedRows: {
3487
+ value: number | null;
3488
+ confirmed: boolean;
3489
+ };
3490
+ supersededRows: {
3491
+ value: number | null;
3492
+ confirmed: boolean;
3493
+ };
3494
+ };
3495
+ datasets: {
3496
+ observed: number;
3497
+ persistedRows: {
3498
+ value: number | null;
3499
+ confirmed: boolean;
3500
+ };
3501
+ succeededRows: {
3502
+ value: number | null;
3503
+ confirmed: boolean;
3504
+ };
3505
+ failedRows: {
3506
+ value: number | null;
3507
+ confirmed: boolean;
3508
+ };
3509
+ complete: {
3510
+ value: boolean | null;
3511
+ confirmed: boolean;
3512
+ };
3513
+ };
3514
+ wait: {
3515
+ kind: string | null;
3516
+ until: number | null;
3517
+ confirmed: boolean;
3518
+ };
3519
+ };
3396
3520
  /** Options for {@link RunsNamespace.stopAll} / {@link DeeplineClient.stopAllRuns}. */
3397
3521
  type StopAllRunsOptions = {
3398
3522
  /** Enumerate the candidate runs without cancelling or mutating anything. */
@@ -5133,6 +5257,8 @@ declare class DeeplineClient {
5133
5257
  * ```
5134
5258
  */
5135
5259
  getRunStatus(runId: string, options?: RunsGetOptions): Promise<PlayStatus>;
5260
+ /** Read only the bounded scalar projection; does not hydrate the run package. */
5261
+ getRunLifecycleStatus(runId: string): Promise<RunLifecycleStatus>;
5136
5262
  /**
5137
5263
  * List play runs using the public runs resource model.
5138
5264
  *
@@ -5219,6 +5345,8 @@ declare class DeeplineClient {
5219
5345
  limit?: number;
5220
5346
  offset?: number;
5221
5347
  rowMode?: 'output' | 'all';
5348
+ /** Cancel the page request, including its response body and retry waits. */
5349
+ signal?: AbortSignal;
5222
5350
  }): Promise<PlaySheetRowsResult>;
5223
5351
  /**
5224
5352
  * Stop a run by id using the public runs resource model.
@@ -6800,4 +6928,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
6800
6928
  */
6801
6929
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
6802
6930
 
6803
- 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 PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PlaysListOptions, type PlaysListPage, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type RerunOptions, type RerunPlayRunResult, type ResolvedConfig, 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 };
6931
+ 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 PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, 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 };
package/dist/index.d.ts CHANGED
@@ -142,11 +142,36 @@ type FixtureResponseSample = {
142
142
  httpError?: {
143
143
  status: number;
144
144
  message: string;
145
+ /** Omitted preserves the historical one-second 429 response. */
146
+ retryAfterMs?: number;
147
+ retryAfterFormat?: 'delta_seconds' | 'http_date';
148
+ /** Omitted preserves a permanent configured HTTP error. */
149
+ failuresBeforeSuccess?: number;
145
150
  };
146
151
  };
147
152
  type FixtureBehaviorV2 = {
148
153
  version: typeof FIXTURE_BEHAVIOR_RESPONSE_VERSION;
149
154
  responseSamples: FixtureResponseSample[];
155
+ transient429?: FixtureTransient429;
156
+ sharedRateLimit?: FixtureSharedRateLimit;
157
+ };
158
+ /** Synthetic provider quotas shared by all calls in the fixture workspace. */
159
+ type FixtureSharedRateLimit = {
160
+ requestsPerSecond?: number;
161
+ requestsPerMinute?: number;
162
+ requestsPerHour?: number;
163
+ /** Test-only target for the next hourly boundary, anchored by the first DB quota attempt. */
164
+ requestsPerHourBoundaryAfterMs?: number;
165
+ };
166
+ type FixtureTransient429 = {
167
+ /** Select one of every N stable tool-call identities. */
168
+ everyNthCall: number;
169
+ retryAfterMs: number;
170
+ failuresBeforeSuccess: number;
171
+ when?: {
172
+ provider?: string;
173
+ operation?: string;
174
+ };
150
175
  };
151
176
  type FixtureReplayBundle = {
152
177
  bundleId: string;
@@ -157,6 +182,8 @@ type FixtureBehaviorV3 = {
157
182
  version: typeof FIXTURE_BEHAVIOR_REPLAY_VERSION;
158
183
  responseSamples: FixtureResponseSample[];
159
184
  replayBundle: FixtureReplayBundle;
185
+ transient429?: FixtureTransient429;
186
+ sharedRateLimit?: FixtureSharedRateLimit;
160
187
  };
161
188
  type FixtureBehavior = FixtureBehaviorV1 | FixtureBehaviorV2 | FixtureBehaviorV3;
162
189
 
@@ -1680,6 +1707,14 @@ interface PlayRunPackage {
1680
1707
  path: string;
1681
1708
  tableNamespace?: string;
1682
1709
  rowCount?: number;
1710
+ /** The materialized dataset count is exact only after this lifecycle completes. */
1711
+ lifecycle?: {
1712
+ phase: 'registered' | 'available' | 'failed';
1713
+ complete: boolean;
1714
+ persistedRowsAtLeast: number;
1715
+ succeededRowsAtLeast: number;
1716
+ failedRowsAtLeast: number;
1717
+ };
1683
1718
  sqlTableName?: string;
1684
1719
  sqlQualifiedTableName?: string;
1685
1720
  recovered?: true;
@@ -3013,6 +3048,9 @@ type EnrichCompiledConfig = {
3013
3048
  };
3014
3049
  };
3015
3050
 
3051
+ /** The only lifecycle states exposed by the API, SDK, CLI, and UI. */
3052
+ type PlayRunPublicStatus = 'queued' | 'running' | 'waiting' | 'completed' | 'failed' | 'cancelled';
3053
+
3016
3054
  type SlackNotificationTarget = {
3017
3055
  channel: string;
3018
3056
  memberId?: never;
@@ -3348,6 +3386,8 @@ type PlaySecretCheck = {
3348
3386
  type RunsNamespace = {
3349
3387
  /** Get current run status by public run id. */
3350
3388
  get: (runId: string, options?: RunsGetOptions) => Promise<PlayStatus>;
3389
+ /** Read bounded scalar lifecycle and confirmed work counts only. */
3390
+ status: (runId: string) => Promise<RunLifecycleStatus>;
3351
3391
  /** Explicitly read the retained original input (may include customer data). */
3352
3392
  input: (runId: string) => Promise<{
3353
3393
  runId: string;
@@ -3374,6 +3414,8 @@ type RunsNamespace = {
3374
3414
  limit?: number;
3375
3415
  offset?: number;
3376
3416
  rowMode?: 'output' | 'all';
3417
+ /** Cancel the page request, including its response body and retry waits. */
3418
+ signal?: AbortSignal;
3377
3419
  }) => Promise<PlaySheetRowsResult>;
3378
3420
  /** Stop a running/waiting run. */
3379
3421
  stop: (runId: string, options?: {
@@ -3393,6 +3435,88 @@ type RunsNamespace = {
3393
3435
  (options?: StopAllRunsOptions): Promise<StopAllPlayRunsResult>;
3394
3436
  };
3395
3437
  };
3438
+ /** Result of the bounded `/api/v2/runs/:runId/status` endpoint. */
3439
+ type RunLifecycleStatus = {
3440
+ available: false;
3441
+ runId: string;
3442
+ } | {
3443
+ available: true;
3444
+ runId: string;
3445
+ lifecycle: {
3446
+ status: PlayRunPublicStatus;
3447
+ updatedAt: number;
3448
+ startedAt: number | null;
3449
+ finishedAt: number | null;
3450
+ };
3451
+ steps: {
3452
+ observed: number;
3453
+ running: number;
3454
+ completed: number;
3455
+ failed: number;
3456
+ skipped: number;
3457
+ confirmed: boolean;
3458
+ };
3459
+ /** Sums across observed step.progress records, not unique output rows. */
3460
+ mapStepWork: {
3461
+ sourceSteps: number;
3462
+ completed: {
3463
+ value: number | null;
3464
+ confirmed: boolean;
3465
+ };
3466
+ total: {
3467
+ value: number | null;
3468
+ confirmed: boolean;
3469
+ };
3470
+ failed: {
3471
+ value: number | null;
3472
+ confirmed: boolean;
3473
+ };
3474
+ startedRows: {
3475
+ value: number | null;
3476
+ confirmed: boolean;
3477
+ };
3478
+ activeRows: {
3479
+ value: number | null;
3480
+ confirmed: boolean;
3481
+ };
3482
+ waitingRows: {
3483
+ value: number | null;
3484
+ confirmed: boolean;
3485
+ };
3486
+ completedRows: {
3487
+ value: number | null;
3488
+ confirmed: boolean;
3489
+ };
3490
+ supersededRows: {
3491
+ value: number | null;
3492
+ confirmed: boolean;
3493
+ };
3494
+ };
3495
+ datasets: {
3496
+ observed: number;
3497
+ persistedRows: {
3498
+ value: number | null;
3499
+ confirmed: boolean;
3500
+ };
3501
+ succeededRows: {
3502
+ value: number | null;
3503
+ confirmed: boolean;
3504
+ };
3505
+ failedRows: {
3506
+ value: number | null;
3507
+ confirmed: boolean;
3508
+ };
3509
+ complete: {
3510
+ value: boolean | null;
3511
+ confirmed: boolean;
3512
+ };
3513
+ };
3514
+ wait: {
3515
+ kind: string | null;
3516
+ until: number | null;
3517
+ confirmed: boolean;
3518
+ };
3519
+ };
3396
3520
  /** Options for {@link RunsNamespace.stopAll} / {@link DeeplineClient.stopAllRuns}. */
3397
3521
  type StopAllRunsOptions = {
3398
3522
  /** Enumerate the candidate runs without cancelling or mutating anything. */
@@ -5133,6 +5257,8 @@ declare class DeeplineClient {
5133
5257
  * ```
5134
5258
  */
5135
5259
  getRunStatus(runId: string, options?: RunsGetOptions): Promise<PlayStatus>;
5260
+ /** Read only the bounded scalar projection; does not hydrate the run package. */
5261
+ getRunLifecycleStatus(runId: string): Promise<RunLifecycleStatus>;
5136
5262
  /**
5137
5263
  * List play runs using the public runs resource model.
5138
5264
  *
@@ -5219,6 +5345,8 @@ declare class DeeplineClient {
5219
5345
  limit?: number;
5220
5346
  offset?: number;
5221
5347
  rowMode?: 'output' | 'all';
5348
+ /** Cancel the page request, including its response body and retry waits. */
5349
+ signal?: AbortSignal;
5222
5350
  }): Promise<PlaySheetRowsResult>;
5223
5351
  /**
5224
5352
  * Stop a run by id using the public runs resource model.
@@ -6800,4 +6928,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
6800
6928
  */
6801
6929
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
6802
6930
 
6803
- 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 PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PlaysListOptions, type PlaysListPage, type PrebuiltPlayRef, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type RerunOptions, type RerunPlayRunResult, type ResolvedConfig, 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 };
6931
+ 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 PlayReferenceLike, type PlayRevisionSummary, type PlayRunActionPackage, type PlayRunActivityProjection, type PlayRunDatasetActions, type PlayRunId, type PlayRunPackage, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, 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 };
package/dist/index.js CHANGED
@@ -864,7 +864,7 @@ var SDK_RELEASE = {
864
864
  // getters keep their established compatibility behavior.
865
865
  // 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
866
866
  // 0.3.90 is the first deliberately versioned SDK release for API v3.
867
- version: "0.3.201",
867
+ version: "0.3.202",
868
868
  updateSummary: "Play grep now returns concise results with the matched fields and terms. Automatic CLI updates are enabled by default; use `deepline settings autoupdate off` to opt out, `deepline settings autoupdate on` to re-enable updates, or `deepline settings autoupdate pin <version>` to hold an exact release.",
869
869
  packageCapabilities: {
870
870
  updatePreferences: 1
@@ -1428,6 +1428,11 @@ var MAX_DIAGNOSTIC_HEADER_LENGTH = 120;
1428
1428
  var COWORK_NETWORK_HINT = "Claude Cowork appears to be running Deepline in a network-restricted sandbox. In Claude Desktop, open Settings > Capabilities, turn on Allow network egress, and set Domain allowlist to All domains for the Cowork session.";
1429
1429
  var REQUEST_TIMEOUT_MARKER = Symbol("deeplineRequestTimeout");
1430
1430
  var REQUEST_ABORT_MARKER = Symbol("deeplineRequestAbort");
1431
+ function requestCancelledError(signal) {
1432
+ const error = withErrorCause(new Error("Request aborted"), signal.reason);
1433
+ error[REQUEST_ABORT_MARKER] = true;
1434
+ return error;
1435
+ }
1431
1436
  function normalizeRequestAbortError(error, input) {
1432
1437
  const normalized = error instanceof Error ? error : new Error(String(error));
1433
1438
  const tagged = normalized;
@@ -1606,14 +1611,27 @@ var HttpClient = class {
1606
1611
  const candidateUrls = options?.exactUrlOnly ? [url] : buildCandidateUrls(url);
1607
1612
  let retryAfterDelayMs = null;
1608
1613
  const maxRetries = options?.maxRetries ?? this.config.maxRetries;
1609
- for (let attempt = 0; attempt <= maxRetries; attempt++) {
1614
+ requestAttempts: for (let attempt = 0; attempt <= maxRetries; attempt++) {
1615
+ if (options?.signal?.aborted) {
1616
+ lastError = requestCancelledError(options.signal);
1617
+ break;
1618
+ }
1610
1619
  if (attempt > 0) {
1611
1620
  const backoffMs = Math.min(1e3 * Math.pow(2, attempt - 1), 3e4);
1612
1621
  const delayMs = retryAfterDelayMs === null ? backoffMs : Math.max(backoffMs, retryAfterDelayMs);
1613
1622
  retryAfterDelayMs = null;
1614
- await sleep(delayMs);
1623
+ try {
1624
+ await sleep(delayMs, options?.signal);
1625
+ } catch (error) {
1626
+ lastError = error instanceof Error ? error : new Error(String(error));
1627
+ break;
1628
+ }
1615
1629
  }
1616
1630
  for (const candidateUrl of candidateUrls) {
1631
+ if (options?.signal?.aborted) {
1632
+ lastError = requestCancelledError(options.signal);
1633
+ break requestAttempts;
1634
+ }
1617
1635
  const controller = new AbortController();
1618
1636
  const timeoutMs = options?.timeout ?? this.config.timeout;
1619
1637
  let requestTimedOut = false;
@@ -1621,6 +1639,10 @@ var HttpClient = class {
1621
1639
  requestTimedOut = true;
1622
1640
  controller.abort();
1623
1641
  }, timeoutMs);
1642
+ const abortRequest = () => controller.abort();
1643
+ options?.signal?.addEventListener("abort", abortRequest, {
1644
+ once: true
1645
+ });
1624
1646
  try {
1625
1647
  const response = await fetch(candidateUrl, {
1626
1648
  method,
@@ -1633,8 +1655,8 @@ var HttpClient = class {
1633
1655
  clearTimeout(timeoutId);
1634
1656
  return null;
1635
1657
  }
1636
- clearTimeout(timeoutId);
1637
1658
  const body = await response.text();
1659
+ clearTimeout(timeoutId);
1638
1660
  const parsed = parseResponseBody(body);
1639
1661
  const structuredToolError = options?.toolId && !response.ok ? deserializeToolExecutionFailure(
1640
1662
  apiErrorMessage(parsed, response.status),
@@ -1729,6 +1751,10 @@ var HttpClient = class {
1729
1751
  return parsed;
1730
1752
  } catch (error) {
1731
1753
  clearTimeout(timeoutId);
1754
+ if (options?.signal?.aborted) {
1755
+ lastError = requestCancelledError(options.signal);
1756
+ break requestAttempts;
1757
+ }
1732
1758
  if (error instanceof AuthError || error instanceof DeeplineError) {
1733
1759
  throw error;
1734
1760
  }
@@ -1740,6 +1766,9 @@ var HttpClient = class {
1740
1766
  timeoutMs,
1741
1767
  timedOut: requestTimedOut
1742
1768
  });
1769
+ } finally {
1770
+ clearTimeout(timeoutId);
1771
+ options?.signal?.removeEventListener("abort", abortRequest);
1743
1772
  }
1744
1773
  }
1745
1774
  if (attempt < maxRetries) continue;
@@ -2068,8 +2097,23 @@ function decodeSseFrame(frame) {
2068
2097
  }
2069
2098
  return parsed;
2070
2099
  }
2071
- function sleep(ms) {
2072
- return new Promise((resolve2) => setTimeout(resolve2, ms));
2100
+ function sleep(ms, signal) {
2101
+ return new Promise((resolve2, reject) => {
2102
+ if (signal?.aborted) {
2103
+ reject(requestCancelledError(signal));
2104
+ return;
2105
+ }
2106
+ const timeoutId = setTimeout(() => {
2107
+ signal?.removeEventListener("abort", abort);
2108
+ resolve2();
2109
+ }, ms);
2110
+ const abort = () => {
2111
+ clearTimeout(timeoutId);
2112
+ signal?.removeEventListener("abort", abort);
2113
+ reject(requestCancelledError(signal));
2114
+ };
2115
+ signal?.addEventListener("abort", abort, { once: true });
2116
+ });
2073
2117
  }
2074
2118
  function withCoworkNetworkHint(message) {
2075
2119
  if (!isCoworkLikeSandbox2() || message.includes(COWORK_NETWORK_HINT)) {
@@ -3231,9 +3275,13 @@ function normalizePlayRunLedgerSnapshot(value, fallback) {
3231
3275
  tableNamespace: optionalString(rawDataset.tableNamespace) ?? datasetId,
3232
3276
  phase,
3233
3277
  persistedRows: Math.max(0, finiteNumber(rawDataset.persistedRows) ?? 0),
3278
+ persistedRowsObserved: rawDataset.persistedRowsObserved === true,
3234
3279
  succeededRows: Math.max(0, finiteNumber(rawDataset.succeededRows) ?? 0),
3280
+ succeededRowsObserved: rawDataset.succeededRowsObserved === true,
3235
3281
  failedRows: Math.max(0, finiteNumber(rawDataset.failedRows) ?? 0),
3282
+ failedRowsObserved: rawDataset.failedRowsObserved === true,
3236
3283
  complete: rawDataset.complete === true,
3284
+ completeObserved: rawDataset.completeObserved === true,
3237
3285
  // ADR 0019 birth survives the snapshot round trip. A partial record is
3238
3286
  // dropped rather than half-admitted, so a dataset either states where its
3239
3287
  // rows came from or says nothing.
@@ -4894,6 +4942,7 @@ var DeeplineClient = class _DeeplineClient {
4894
4942
  this.http = new HttpClient(this.config);
4895
4943
  this.runs = {
4896
4944
  get: (runId, options2) => this.getRunStatus(runId, options2),
4945
+ status: (runId) => this.getRunLifecycleStatus(runId),
4897
4946
  list: (options2) => this.listRuns(options2),
4898
4947
  listPage: (options2) => this.listRunsPage(options2),
4899
4948
  tail: (runId, options2) => this.tailRun(runId, options2),
@@ -6306,6 +6355,13 @@ var DeeplineClient = class _DeeplineClient {
6306
6355
  }
6307
6356
  };
6308
6357
  }
6358
+ /** Read only the bounded scalar projection; does not hydrate the run package. */
6359
+ async getRunLifecycleStatus(runId) {
6360
+ const response = await this.http.get(
6361
+ `/api/v2/runs/${encodeURIComponent(runId)}/status`
6362
+ );
6363
+ return response;
6364
+ }
6309
6365
  /**
6310
6366
  * List play runs using the public runs resource model.
6311
6367
  *
@@ -6699,7 +6755,8 @@ var DeeplineClient = class _DeeplineClient {
6699
6755
  params.set("rowMode", "all");
6700
6756
  }
6701
6757
  const result = await this.http.get(
6702
- `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`
6758
+ `/api/v2/plays/${encodeURIComponent(input.playName)}/sheet?${params.toString()}`,
6759
+ { signal: input.signal }
6703
6760
  );
6704
6761
  const requestedRunId = input.runId?.trim() || "";
6705
6762
  if (requestedRunId) {