deepline 0.1.211 → 0.1.213

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 (54) hide show
  1. package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +317 -340
  2. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/customer-console.ts +23 -0
  3. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-dispatch.ts +1 -1
  4. package/dist/bundling-sources/sdk/src/client.ts +118 -3
  5. package/dist/bundling-sources/sdk/src/index.ts +2 -0
  6. package/dist/bundling-sources/sdk/src/play.ts +8 -1
  7. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +1 -1
  8. package/dist/bundling-sources/sdk/src/plays/harness-stub.ts +11 -1
  9. package/dist/bundling-sources/sdk/src/release.ts +2 -2
  10. package/dist/bundling-sources/sdk/src/types.ts +47 -0
  11. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +302 -30
  12. package/dist/bundling-sources/shared_libs/play-runtime/child-execution-placement.ts +14 -0
  13. package/dist/bundling-sources/shared_libs/play-runtime/child-execution-strategy.ts +57 -23
  14. package/dist/bundling-sources/shared_libs/play-runtime/completed-receipt-cache.ts +166 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +164 -121
  16. package/dist/bundling-sources/shared_libs/play-runtime/ctx-contract.ts +2 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +42 -1
  18. package/dist/bundling-sources/shared_libs/play-runtime/dataset-id.ts +10 -4
  19. package/dist/bundling-sources/shared_libs/play-runtime/db-session.ts +9 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +163 -7
  21. package/dist/bundling-sources/shared_libs/play-runtime/gateway-auth-session.ts +93 -0
  22. package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +14 -2
  23. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +4 -2
  24. package/dist/bundling-sources/shared_libs/play-runtime/play-call-execution.ts +1 -0
  25. package/dist/bundling-sources/shared_libs/play-runtime/receipt-completion-sink.ts +16 -1
  26. package/dist/bundling-sources/shared_libs/play-runtime/receipt-sql.ts +21 -1
  27. package/dist/bundling-sources/shared_libs/play-runtime/receipt-state-sink.ts +10 -0
  28. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +80 -3
  29. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +128 -6
  30. package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +7 -0
  31. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +94 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +91 -6
  33. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +19 -10
  34. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +540 -92
  35. package/dist/bundling-sources/shared_libs/play-runtime/runtime-postgres-admission.ts +162 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/secret-capability.ts +18 -4
  37. package/dist/bundling-sources/shared_libs/play-runtime/sheet-attempt-sql.ts +16 -17
  38. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +29 -9
  39. package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-state-machine.ts +22 -1
  40. package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +1 -0
  41. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +79 -1
  42. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +2 -4
  43. package/dist/cli/index.js +637 -229
  44. package/dist/cli/index.mjs +637 -229
  45. package/dist/{compiler-manifest-j6z8qzpd.d.mts → compiler-manifest-BhgZ23A4.d.mts} +1 -0
  46. package/dist/{compiler-manifest-j6z8qzpd.d.ts → compiler-manifest-BhgZ23A4.d.ts} +1 -0
  47. package/dist/index.d.mts +84 -11
  48. package/dist/index.d.ts +84 -11
  49. package/dist/index.js +225 -43
  50. package/dist/index.mjs +225 -43
  51. package/dist/plays/bundle-play-file.d.mts +2 -2
  52. package/dist/plays/bundle-play-file.d.ts +2 -2
  53. package/dist/plays/bundle-play-file.mjs +65 -4
  54. package/package.json +1 -1
@@ -181,6 +181,7 @@ type PlayStaticSubstep = PlayStaticSubstepMetadata & ({
181
181
  } | {
182
182
  type: 'play_call';
183
183
  playId: string;
184
+ execution?: 'inline' | 'child-workflow';
184
185
  field: string;
185
186
  inLoop?: boolean;
186
187
  pipeline?: PlayStaticPipeline | null;
@@ -181,6 +181,7 @@ type PlayStaticSubstep = PlayStaticSubstepMetadata & ({
181
181
  } | {
182
182
  type: 'play_call';
183
183
  playId: string;
184
+ execution?: 'inline' | 'child-workflow';
184
185
  field: string;
185
186
  inLoop?: boolean;
186
187
  pipeline?: PlayStaticPipeline | null;
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as PlayCompilerManifest } from './compiler-manifest-j6z8qzpd.mjs';
1
+ import { a as PlayCompilerManifest } from './compiler-manifest-BhgZ23A4.mjs';
2
2
 
3
3
  declare const DEEPLINE_TOOL_CATEGORIES: readonly ["company_search", "people_search", "people_enrich", "email_finder", "email_verify", "phone_finder", "phone_verify", "identity_resolution", "reverse_lookup", "enrichment", "batch", "premium", "free"];
4
4
  type DeeplineToolCategory = (typeof DEEPLINE_TOOL_CATEGORIES)[number] | (string & {});
@@ -431,6 +431,16 @@ type PlayRunActionPackage = {
431
431
  runId: string;
432
432
  datasetPath: string;
433
433
  format: 'csv';
434
+ } | {
435
+ kind: 'deepline_run_logs';
436
+ runId: string;
437
+ view: 'failed' | 'tail';
438
+ limit: number;
439
+ command: string;
440
+ api: {
441
+ method: 'GET';
442
+ path: string;
443
+ };
434
444
  };
435
445
  /**
436
446
  * Compact canonical package for an inspected play run.
@@ -460,11 +470,30 @@ interface PlayRunPackage {
460
470
  steps: Array<Record<string, unknown>>;
461
471
  /** Named output summaries, including dataset handles and scalar outputs. */
462
472
  outputs: Record<string, Record<string, unknown>>;
473
+ /** Every durable Dataset Handle explicitly registered by this run. */
474
+ datasets?: Array<{
475
+ kind: 'dataset';
476
+ datasetId?: string;
477
+ path: string;
478
+ tableNamespace?: string;
479
+ rowCount?: number;
480
+ recovered?: true;
481
+ preview?: Record<string, unknown>;
482
+ actions?: Record<string, PlayRunActionPackage>;
483
+ }>;
484
+ /** Small retained tail of customer and runtime logs; fetch the full stream through `runs.logs`. */
485
+ logs?: {
486
+ tail: string[];
487
+ totalCount: number;
488
+ returnedCount: number;
489
+ truncated?: boolean;
490
+ };
463
491
  /** Follow-up actions a caller can perform against the run. */
464
492
  next?: {
465
493
  inspect?: PlayRunActionPackage;
466
494
  export?: PlayRunActionPackage;
467
495
  query?: PlayRunActionPackage;
496
+ logs?: PlayRunActionPackage;
468
497
  };
469
498
  }
470
499
  /**
@@ -490,6 +519,8 @@ interface PlayStatus {
490
519
  apiVersion?: number;
491
520
  /** Saved play name for this run, when available. */
492
521
  name?: string;
522
+ /** Exact saved revision launched for this run, when applicable. */
523
+ revisionId?: string;
493
524
  /** Alias for `name` used by run/result APIs. */
494
525
  playName?: string;
495
526
  /** Dashboard URL for inspecting the play and its run output in the app. */
@@ -524,6 +555,26 @@ interface PlayStatus {
524
555
  } | null;
525
556
  /** Structured follow-up actions for inspect/query/export. */
526
557
  next?: PlayRunPackage['next'] | Record<string, unknown>;
558
+ /** Bounded terminal-failure log window requested by `runs.get`. */
559
+ failedLogs?: {
560
+ runId: string;
561
+ totalCount: number;
562
+ returnedCount: number;
563
+ firstSequence: number | null;
564
+ lastSequence: number | null;
565
+ truncated: boolean;
566
+ hasMore: boolean;
567
+ entries: string[];
568
+ view?: 'failed';
569
+ association?: 'terminal_failure_window' | 'retained_before_truncation';
570
+ warning?: string;
571
+ next?: {
572
+ logs: string;
573
+ };
574
+ logsTruncated?: boolean;
575
+ };
576
+ /** Exact ordinary `plays run` command that can rerun a failed execution. */
577
+ rerunCommand?: string;
527
578
  }
528
579
  type LiveEventScope = 'play' | 'agent';
529
580
  interface LiveEventEnvelope<TPayload = unknown> {
@@ -1217,9 +1268,20 @@ type RunsListOptions = {
1217
1268
  status?: string;
1218
1269
  limit?: number;
1219
1270
  };
1271
+ /** Options for `client.runs.get(...)`. */
1272
+ type RunsGetOptions = {
1273
+ /** Return the raw status payload instead of the compact package. */
1274
+ full?: boolean;
1275
+ /** Attach a bounded end-of-stream window for a failed run. */
1276
+ failedLogs?: boolean;
1277
+ /** Requested failed-log lines to attach (default 20, hard-capped at 20). */
1278
+ failedLogLimit?: number;
1279
+ };
1220
1280
  /** Streaming options for `client.runs.tail(...)`. */
1221
1281
  type RunsTailOptions = {
1222
1282
  signal?: AbortSignal;
1283
+ /** Observe each canonical live event while `tail` waits for terminal state. */
1284
+ onEvent?: (event: PlayLiveEvent) => void;
1223
1285
  /**
1224
1286
  * Called before each stream reconnect. Server stream windows are finite, so
1225
1287
  * long runs reconnect with backoff until a terminal status is observed.
@@ -1242,6 +1304,8 @@ type RunsLogsOptions = {
1242
1304
  limit?: number;
1243
1305
  /** Fetch every stored log line, paginating to the full totalCount. */
1244
1306
  all?: boolean;
1307
+ /** Select the bounded failure view; truncated runs degrade explicitly. */
1308
+ failed?: boolean;
1245
1309
  };
1246
1310
  /** Persisted log response for one play run. */
1247
1311
  type RunsLogsResult = {
@@ -1253,6 +1317,16 @@ type RunsLogsResult = {
1253
1317
  truncated: boolean;
1254
1318
  hasMore: boolean;
1255
1319
  entries: string[];
1320
+ /** Selected public log view. */
1321
+ view?: 'tail' | 'failed' | 'all';
1322
+ /** Whether entries are terminal context or the last pre-truncation lines. */
1323
+ association?: 'terminal_failure_window' | 'retained_before_truncation';
1324
+ /** Loud explanation when the terminal failure window was not retained. */
1325
+ warning?: string;
1326
+ /** Exact follow-up command when the selected view is degraded. */
1327
+ next?: {
1328
+ logs: string;
1329
+ };
1256
1330
  /**
1257
1331
  * True when the run crossed the Run Log Stream retention cap: `totalCount`
1258
1332
  * keeps counting, but stored line bodies end at a loud truncation marker.
@@ -1307,9 +1381,7 @@ type PlaySecretMetadata = {
1307
1381
  */
1308
1382
  type RunsNamespace = {
1309
1383
  /** Get current run status by public run id. */
1310
- get: (runId: string, options?: {
1311
- full?: boolean;
1312
- }) => Promise<PlayStatus>;
1384
+ get: (runId: string, options?: RunsGetOptions) => Promise<PlayStatus>;
1313
1385
  /** List runs for one play, optionally filtered by status. */
1314
1386
  list: (options: RunsListOptions) => Promise<PlayRunListItem[]>;
1315
1387
  /** Stream run events and return the latest/terminal run status. */
@@ -2090,9 +2162,7 @@ declare class DeeplineClient {
2090
2162
  * deepline runs get <run-id> --json
2091
2163
  * ```
2092
2164
  */
2093
- getRunStatus(runId: string, options?: {
2094
- full?: boolean;
2095
- }): Promise<PlayStatus>;
2165
+ getRunStatus(runId: string, options?: RunsGetOptions): Promise<PlayStatus>;
2096
2166
  /**
2097
2167
  * List play runs using the public runs resource model.
2098
2168
  *
@@ -2993,6 +3063,11 @@ type PreviousCell<Value = unknown> = {
2993
3063
  staleAfterSeconds?: number;
2994
3064
  };
2995
3065
 
3066
+ type PlayCallExecution = 'inline' | 'child-workflow';
3067
+ interface PlayCallOptions {
3068
+ description?: string;
3069
+ execution?: PlayCallExecution;
3070
+ }
2996
3071
  /**
2997
3072
  * Optional trigger bindings for a play.
2998
3073
  *
@@ -3621,9 +3696,7 @@ interface DeeplinePlayRuntimeContext {
3621
3696
  *
3622
3697
  * @sdkReference runtime 140 ctx.runPlay(key, playRef, input, options)
3623
3698
  */
3624
- runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options: {
3625
- description: string;
3626
- }): Promise<TOutput>;
3699
+ runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options?: PlayCallOptions): Promise<TOutput>;
3627
3700
  /**
3628
3701
  * Emit a log line visible in `play tail` and the play's progress logs.
3629
3702
  *
@@ -4314,4 +4387,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
4314
4387
  */
4315
4388
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
4316
4389
 
4317
- export { AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_EXTRACTOR_TARGETS, DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, type DeeplineEmailStatusGetterValue, DeeplineError, type DeeplineExtractorTarget, type DeeplineGetterValue, type DeeplineGetterValueMap, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type FileInput, JOB_CHANGE_STATUS_VALUES, type JobChangeStatus, type LiveEventEnvelope, PHONE_STATUS_VALUES, 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 PhoneStatus, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayDataset, type PlayDatasetInput, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayRevisionSummary, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PreviousCell, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopPlayRunResult, type ToolDefinition, type ToolExecuteResult, type ToolExecution, type ToolExecutionRequest, type ToolMetadata, type ToolSearchOptions, type ToolSearchResult, defineInput, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isDeeplineExtractorTarget, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
4390
+ export { AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_EXTRACTOR_TARGETS, DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, type DeeplineEmailStatusGetterValue, DeeplineError, type DeeplineExtractorTarget, type DeeplineGetterValue, type DeeplineGetterValueMap, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type FileInput, JOB_CHANGE_STATUS_VALUES, type JobChangeStatus, type LiveEventEnvelope, PHONE_STATUS_VALUES, 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 PhoneStatus, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayDataset, type PlayDatasetInput, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayRevisionSummary, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PreviousCell, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopPlayRunResult, type ToolDefinition, type ToolExecuteResult, type ToolExecution, type ToolExecutionRequest, type ToolMetadata, type ToolSearchOptions, type ToolSearchResult, defineInput, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isDeeplineExtractorTarget, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as PlayCompilerManifest } from './compiler-manifest-j6z8qzpd.js';
1
+ import { a as PlayCompilerManifest } from './compiler-manifest-BhgZ23A4.js';
2
2
 
3
3
  declare const DEEPLINE_TOOL_CATEGORIES: readonly ["company_search", "people_search", "people_enrich", "email_finder", "email_verify", "phone_finder", "phone_verify", "identity_resolution", "reverse_lookup", "enrichment", "batch", "premium", "free"];
4
4
  type DeeplineToolCategory = (typeof DEEPLINE_TOOL_CATEGORIES)[number] | (string & {});
@@ -431,6 +431,16 @@ type PlayRunActionPackage = {
431
431
  runId: string;
432
432
  datasetPath: string;
433
433
  format: 'csv';
434
+ } | {
435
+ kind: 'deepline_run_logs';
436
+ runId: string;
437
+ view: 'failed' | 'tail';
438
+ limit: number;
439
+ command: string;
440
+ api: {
441
+ method: 'GET';
442
+ path: string;
443
+ };
434
444
  };
435
445
  /**
436
446
  * Compact canonical package for an inspected play run.
@@ -460,11 +470,30 @@ interface PlayRunPackage {
460
470
  steps: Array<Record<string, unknown>>;
461
471
  /** Named output summaries, including dataset handles and scalar outputs. */
462
472
  outputs: Record<string, Record<string, unknown>>;
473
+ /** Every durable Dataset Handle explicitly registered by this run. */
474
+ datasets?: Array<{
475
+ kind: 'dataset';
476
+ datasetId?: string;
477
+ path: string;
478
+ tableNamespace?: string;
479
+ rowCount?: number;
480
+ recovered?: true;
481
+ preview?: Record<string, unknown>;
482
+ actions?: Record<string, PlayRunActionPackage>;
483
+ }>;
484
+ /** Small retained tail of customer and runtime logs; fetch the full stream through `runs.logs`. */
485
+ logs?: {
486
+ tail: string[];
487
+ totalCount: number;
488
+ returnedCount: number;
489
+ truncated?: boolean;
490
+ };
463
491
  /** Follow-up actions a caller can perform against the run. */
464
492
  next?: {
465
493
  inspect?: PlayRunActionPackage;
466
494
  export?: PlayRunActionPackage;
467
495
  query?: PlayRunActionPackage;
496
+ logs?: PlayRunActionPackage;
468
497
  };
469
498
  }
470
499
  /**
@@ -490,6 +519,8 @@ interface PlayStatus {
490
519
  apiVersion?: number;
491
520
  /** Saved play name for this run, when available. */
492
521
  name?: string;
522
+ /** Exact saved revision launched for this run, when applicable. */
523
+ revisionId?: string;
493
524
  /** Alias for `name` used by run/result APIs. */
494
525
  playName?: string;
495
526
  /** Dashboard URL for inspecting the play and its run output in the app. */
@@ -524,6 +555,26 @@ interface PlayStatus {
524
555
  } | null;
525
556
  /** Structured follow-up actions for inspect/query/export. */
526
557
  next?: PlayRunPackage['next'] | Record<string, unknown>;
558
+ /** Bounded terminal-failure log window requested by `runs.get`. */
559
+ failedLogs?: {
560
+ runId: string;
561
+ totalCount: number;
562
+ returnedCount: number;
563
+ firstSequence: number | null;
564
+ lastSequence: number | null;
565
+ truncated: boolean;
566
+ hasMore: boolean;
567
+ entries: string[];
568
+ view?: 'failed';
569
+ association?: 'terminal_failure_window' | 'retained_before_truncation';
570
+ warning?: string;
571
+ next?: {
572
+ logs: string;
573
+ };
574
+ logsTruncated?: boolean;
575
+ };
576
+ /** Exact ordinary `plays run` command that can rerun a failed execution. */
577
+ rerunCommand?: string;
527
578
  }
528
579
  type LiveEventScope = 'play' | 'agent';
529
580
  interface LiveEventEnvelope<TPayload = unknown> {
@@ -1217,9 +1268,20 @@ type RunsListOptions = {
1217
1268
  status?: string;
1218
1269
  limit?: number;
1219
1270
  };
1271
+ /** Options for `client.runs.get(...)`. */
1272
+ type RunsGetOptions = {
1273
+ /** Return the raw status payload instead of the compact package. */
1274
+ full?: boolean;
1275
+ /** Attach a bounded end-of-stream window for a failed run. */
1276
+ failedLogs?: boolean;
1277
+ /** Requested failed-log lines to attach (default 20, hard-capped at 20). */
1278
+ failedLogLimit?: number;
1279
+ };
1220
1280
  /** Streaming options for `client.runs.tail(...)`. */
1221
1281
  type RunsTailOptions = {
1222
1282
  signal?: AbortSignal;
1283
+ /** Observe each canonical live event while `tail` waits for terminal state. */
1284
+ onEvent?: (event: PlayLiveEvent) => void;
1223
1285
  /**
1224
1286
  * Called before each stream reconnect. Server stream windows are finite, so
1225
1287
  * long runs reconnect with backoff until a terminal status is observed.
@@ -1242,6 +1304,8 @@ type RunsLogsOptions = {
1242
1304
  limit?: number;
1243
1305
  /** Fetch every stored log line, paginating to the full totalCount. */
1244
1306
  all?: boolean;
1307
+ /** Select the bounded failure view; truncated runs degrade explicitly. */
1308
+ failed?: boolean;
1245
1309
  };
1246
1310
  /** Persisted log response for one play run. */
1247
1311
  type RunsLogsResult = {
@@ -1253,6 +1317,16 @@ type RunsLogsResult = {
1253
1317
  truncated: boolean;
1254
1318
  hasMore: boolean;
1255
1319
  entries: string[];
1320
+ /** Selected public log view. */
1321
+ view?: 'tail' | 'failed' | 'all';
1322
+ /** Whether entries are terminal context or the last pre-truncation lines. */
1323
+ association?: 'terminal_failure_window' | 'retained_before_truncation';
1324
+ /** Loud explanation when the terminal failure window was not retained. */
1325
+ warning?: string;
1326
+ /** Exact follow-up command when the selected view is degraded. */
1327
+ next?: {
1328
+ logs: string;
1329
+ };
1256
1330
  /**
1257
1331
  * True when the run crossed the Run Log Stream retention cap: `totalCount`
1258
1332
  * keeps counting, but stored line bodies end at a loud truncation marker.
@@ -1307,9 +1381,7 @@ type PlaySecretMetadata = {
1307
1381
  */
1308
1382
  type RunsNamespace = {
1309
1383
  /** Get current run status by public run id. */
1310
- get: (runId: string, options?: {
1311
- full?: boolean;
1312
- }) => Promise<PlayStatus>;
1384
+ get: (runId: string, options?: RunsGetOptions) => Promise<PlayStatus>;
1313
1385
  /** List runs for one play, optionally filtered by status. */
1314
1386
  list: (options: RunsListOptions) => Promise<PlayRunListItem[]>;
1315
1387
  /** Stream run events and return the latest/terminal run status. */
@@ -2090,9 +2162,7 @@ declare class DeeplineClient {
2090
2162
  * deepline runs get <run-id> --json
2091
2163
  * ```
2092
2164
  */
2093
- getRunStatus(runId: string, options?: {
2094
- full?: boolean;
2095
- }): Promise<PlayStatus>;
2165
+ getRunStatus(runId: string, options?: RunsGetOptions): Promise<PlayStatus>;
2096
2166
  /**
2097
2167
  * List play runs using the public runs resource model.
2098
2168
  *
@@ -2993,6 +3063,11 @@ type PreviousCell<Value = unknown> = {
2993
3063
  staleAfterSeconds?: number;
2994
3064
  };
2995
3065
 
3066
+ type PlayCallExecution = 'inline' | 'child-workflow';
3067
+ interface PlayCallOptions {
3068
+ description?: string;
3069
+ execution?: PlayCallExecution;
3070
+ }
2996
3071
  /**
2997
3072
  * Optional trigger bindings for a play.
2998
3073
  *
@@ -3621,9 +3696,7 @@ interface DeeplinePlayRuntimeContext {
3621
3696
  *
3622
3697
  * @sdkReference runtime 140 ctx.runPlay(key, playRef, input, options)
3623
3698
  */
3624
- runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options: {
3625
- description: string;
3626
- }): Promise<TOutput>;
3699
+ runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options?: PlayCallOptions): Promise<TOutput>;
3627
3700
  /**
3628
3701
  * Emit a log line visible in `play tail` and the play's progress logs.
3629
3702
  *
@@ -4314,4 +4387,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
4314
4387
  */
4315
4388
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
4316
4389
 
4317
- export { AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_EXTRACTOR_TARGETS, DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, type DeeplineEmailStatusGetterValue, DeeplineError, type DeeplineExtractorTarget, type DeeplineGetterValue, type DeeplineGetterValueMap, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type FileInput, JOB_CHANGE_STATUS_VALUES, type JobChangeStatus, type LiveEventEnvelope, PHONE_STATUS_VALUES, 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 PhoneStatus, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayDataset, type PlayDatasetInput, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayRevisionSummary, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PreviousCell, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopPlayRunResult, type ToolDefinition, type ToolExecuteResult, type ToolExecution, type ToolExecutionRequest, type ToolMetadata, type ToolSearchOptions, type ToolSearchResult, defineInput, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isDeeplineExtractorTarget, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };
4390
+ export { AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingPaymentMethodSummary, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, type BillingTopUpResult, type ClearPlayHistoryRequest, type ClearPlayHistoryResult, type ColumnMap, type ColumnResolver, type ConditionalStepResolver, ConfigError, type CsvInput, type CsvOptions, type CustomerDbQueryResult, DEEPLINE_EXTRACTOR_TARGETS, DEEPLINE_EXTRACTOR_TARGET_DEFINITIONS, DEEPLINE_TOOL_CATEGORIES, type DatasetBuilder, type DatasetColumnDefinition, type DatasetColumnRunInput, Deepline, DeeplineClient, type DeeplineClientOptions, DeeplineContext, type DeeplineEmailStatusGetterValue, DeeplineError, type DeeplineExtractorTarget, type DeeplineGetterValue, type DeeplineGetterValueMap, type DeeplineNamedPlay, type DeeplinePlayRuntimeContext, type DeeplinePlaysNamespace, type DeeplineToolCategory, type DeeplineToolsNamespace, type DefinePlayConfig, type DefinedPlay, type FileInput, JOB_CHANGE_STATUS_VALUES, type JobChangeStatus, type LiveEventEnvelope, PHONE_STATUS_VALUES, 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 PhoneStatus, type PlayBindings, type PlayBootstrapEntityKind, type PlayBootstrapFinderKind, type PlayCallExecution, type PlayCallOptions, type PlayDataset, type PlayDatasetInput, type PlayInputContract, type PlayJob, type PlayListItem, type PlayLiveEvent, type PlayRevisionSummary, type PlayRunResult, type PlayRunStart, type PlaySheetRow, type PlaySheetRowsResult, type PlayStatus, type PlayStepProgramStep, type PrebuiltPlayRef, type PreviousCell, type PublishPlayVersionRequest, type PublishPlayVersionResult, RateLimitError, type ResolvedConfig, RunObserveTransportUnavailableError, type RunsListOptions, type RunsLogsOptions, type RunsLogsResult, type RunsNamespace, type RunsTailOptions, SDK_API_CONTRACT, SDK_VERSION, type SqlListenerDeclaration, type SqlListenerEvent, type SqlListenerOperation, type SqlQuery, type StartPlayRunRequest, type StepOptions, type StepProgram, type StepProgramResolver, type StepResolver, type StopPlayRunResult, type ToolDefinition, type ToolExecuteResult, type ToolExecution, type ToolExecutionRequest, type ToolMetadata, type ToolSearchOptions, type ToolSearchResult, defineInput, definePlay, defineWorkflow, extractSummaryFields, formatPlayBootstrapFinderKinds, formatPlayBootstrapFinderKindsForSentence, formatPlayBootstrapTemplates, getDefinedPlayMetadata, isDeeplineExtractorTarget, isPlayBootstrapFinderKind, isPlayBootstrapTemplate, resolveConfig, runIf, steps, tryConvertToList, writeCsvOutputFile, writeJsonOutputFile };