deepline 0.1.152 → 0.1.154

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 (48) hide show
  1. package/dist/bundling-sources/apps/play-runner-workers/src/coordinator-entry.ts +46 -6
  2. package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +1180 -825
  3. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/batching.ts +34 -18
  4. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/harness-receipt-store.ts +41 -0
  5. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/receipts.ts +143 -8
  6. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-receipts.ts +104 -0
  7. package/dist/bundling-sources/sdk/src/index.ts +0 -1
  8. package/dist/bundling-sources/sdk/src/play.ts +3 -48
  9. package/dist/bundling-sources/sdk/src/plays/harness-stub.ts +27 -2
  10. package/dist/bundling-sources/sdk/src/release.ts +2 -2
  11. package/dist/bundling-sources/sdk/src/worker-play-entry.ts +0 -10
  12. package/dist/bundling-sources/shared_libs/play-data-plane/index.ts +0 -1
  13. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +87 -0
  14. package/dist/bundling-sources/shared_libs/play-runtime/batch-runtime.ts +0 -59
  15. package/dist/bundling-sources/shared_libs/play-runtime/cell-staleness.ts +0 -253
  16. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +805 -1570
  17. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +47 -74
  18. package/dist/bundling-sources/shared_libs/play-runtime/default-batch-strategies.ts +36 -14
  19. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +145 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +284 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/postgres-json.ts +12 -5
  22. package/dist/bundling-sources/shared_libs/play-runtime/run-lifecycle-policy.ts +78 -0
  23. package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +10 -45
  24. package/dist/bundling-sources/shared_libs/play-runtime/runtime-actions.ts +1 -0
  25. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +923 -535
  26. package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver-neon-serverless.ts +58 -78
  27. package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver.ts +12 -1
  28. package/dist/bundling-sources/shared_libs/play-runtime/step-program-dataset-builder.ts +1 -14
  29. package/dist/bundling-sources/shared_libs/play-runtime/tool-execution-outcome.ts +159 -0
  30. package/dist/bundling-sources/shared_libs/play-runtime/tool-result-types.ts +4 -1
  31. package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +32 -0
  32. package/dist/bundling-sources/shared_libs/plays/definition.ts +4 -2
  33. package/dist/bundling-sources/shared_libs/plays/runtime-validation.ts +3 -14
  34. package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +1 -43
  35. package/dist/cli/index.js +1301 -399
  36. package/dist/cli/index.mjs +1269 -361
  37. package/dist/{compiler-manifest-BjoRENv9.d.ts → compiler-manifest-DW1flrHk.d.mts} +0 -9
  38. package/dist/{compiler-manifest-BjoRENv9.d.mts → compiler-manifest-DW1flrHk.d.ts} +0 -9
  39. package/dist/index.d.mts +9 -38
  40. package/dist/index.d.ts +9 -38
  41. package/dist/index.js +22 -11
  42. package/dist/index.mjs +22 -11
  43. package/dist/plays/bundle-play-file.d.mts +2 -2
  44. package/dist/plays/bundle-play-file.d.ts +2 -2
  45. package/package.json +1 -1
  46. package/dist/bundling-sources/shared_libs/play-data-plane/cell-policy.ts +0 -76
  47. package/dist/bundling-sources/shared_libs/play-runtime/progress-emitter.ts +0 -197
  48. package/dist/bundling-sources/shared_libs/play-runtime/waterfall-replay.ts +0 -79
@@ -70,9 +70,6 @@ interface PlayStaticColumnProducer {
70
70
  toolId?: string;
71
71
  playId?: string;
72
72
  dependsOnFields?: string[];
73
- recompute?: boolean;
74
- recomputeOnError?: boolean;
75
- staleAfterSeconds?: number;
76
73
  conditional?: boolean;
77
74
  sourceRange?: PlayStaticSourceRange;
78
75
  steps?: PlayStaticColumnProducer[];
@@ -82,9 +79,6 @@ interface PlayStaticDatasetColumn {
82
79
  id: string;
83
80
  source: PlaySheetColumnSource;
84
81
  sqlName?: string;
85
- recompute?: boolean;
86
- recomputeOnError?: boolean;
87
- staleAfterSeconds?: number;
88
82
  producers: PlayStaticColumnProducer[];
89
83
  }
90
84
  interface PlayStaticSourceRange {
@@ -97,9 +91,6 @@ interface PlayStaticSourceRange {
97
91
  type PlayStaticSubstepMetadata = {
98
92
  conditional?: boolean;
99
93
  dependsOnFields?: string[];
100
- recompute?: boolean;
101
- recomputeOnError?: boolean;
102
- staleAfterSeconds?: number;
103
94
  };
104
95
  type PlayStaticSubstep = PlayStaticSubstepMetadata & ({
105
96
  type: 'csv';
@@ -70,9 +70,6 @@ interface PlayStaticColumnProducer {
70
70
  toolId?: string;
71
71
  playId?: string;
72
72
  dependsOnFields?: string[];
73
- recompute?: boolean;
74
- recomputeOnError?: boolean;
75
- staleAfterSeconds?: number;
76
73
  conditional?: boolean;
77
74
  sourceRange?: PlayStaticSourceRange;
78
75
  steps?: PlayStaticColumnProducer[];
@@ -82,9 +79,6 @@ interface PlayStaticDatasetColumn {
82
79
  id: string;
83
80
  source: PlaySheetColumnSource;
84
81
  sqlName?: string;
85
- recompute?: boolean;
86
- recomputeOnError?: boolean;
87
- staleAfterSeconds?: number;
88
82
  producers: PlayStaticColumnProducer[];
89
83
  }
90
84
  interface PlayStaticSourceRange {
@@ -97,9 +91,6 @@ interface PlayStaticSourceRange {
97
91
  type PlayStaticSubstepMetadata = {
98
92
  conditional?: boolean;
99
93
  dependsOnFields?: string[];
100
- recompute?: boolean;
101
- recomputeOnError?: boolean;
102
- staleAfterSeconds?: number;
103
94
  };
104
95
  type PlayStaticSubstep = PlayStaticSubstepMetadata & ({
105
96
  type: 'csv';
package/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as PlayCompilerManifest } from './compiler-manifest-BjoRENv9.mjs';
1
+ import { a as PlayCompilerManifest } from './compiler-manifest-DW1flrHk.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 & {});
@@ -2663,8 +2663,11 @@ interface PlayDataset<T> extends AsyncIterable<T> {
2663
2663
  type ToolResultExecutionMetadata = {
2664
2664
  idempotent: true;
2665
2665
  cached: boolean;
2666
- source: 'live' | 'checkpoint' | 'cache';
2666
+ source: 'live' | 'checkpoint' | 'cache' | 'in_flight';
2667
2667
  cacheKey?: string;
2668
+ receiptRole?: 'owner' | 'follower';
2669
+ receiptKey?: string;
2670
+ attachedToReceiptKey?: string;
2668
2671
  };
2669
2672
  type ToolResultTargetMetadata = {
2670
2673
  value: unknown;
@@ -2929,21 +2932,6 @@ type ToolExecutionRequest = {
2929
2932
  /** Numeric TTL in seconds for this tool checkpoint. */
2930
2933
  staleAfterSeconds?: number;
2931
2934
  };
2932
- /**
2933
- * Freshness policy for dataset cells and step-program columns.
2934
- *
2935
- * Use a positive whole number of seconds for a fixed TTL. Use a function when
2936
- * the next expiry depends on the value that was just produced. The function
2937
- * receives the completed cell value; return a positive whole number of seconds
2938
- * to set the next expiry, or `null` to keep that value indefinitely.
2939
- *
2940
- * Result-based policies are evaluated only for dataset/step-program cells. The
2941
- * scalar `ctx.step`, `ctx.fetch`, `ctx.runPlay`, and `ctx.tools.execute` APIs
2942
- * accept numeric TTLs.
2943
- *
2944
- * @sdkReference runtime 080
2945
- */
2946
- type StaleAfterSeconds<Value = unknown> = number | ((value: Value) => number | null);
2947
2935
  type StepResolver<Row, Value> = (row: Row, ctx: DeeplinePlayRuntimeContext, index: number, previousCell?: PreviousCell<Value>) => Value | Promise<Value>;
2948
2936
  /**
2949
2937
  * Input object passed to an object-column `run` resolver.
@@ -2968,8 +2956,7 @@ type DatasetColumnRunInput<Row, Value> = {
2968
2956
  /**
2969
2957
  * Object-column form for `.withColumn(...)`.
2970
2958
  *
2971
- * Use this when a column needs `runIf`, typed `previousCell`, or a
2972
- * result-based `staleAfterSeconds(value)` policy.
2959
+ * Use this when a column needs `runIf` or typed `previousCell`.
2973
2960
  *
2974
2961
  * @sdkReference runtime 100
2975
2962
  */
@@ -2978,12 +2965,6 @@ type DatasetColumnDefinition<Row, Value> = {
2978
2965
  run: (input: DatasetColumnRunInput<Row, Value>) => Value | Promise<Value>;
2979
2966
  /** Optional row-level gate. Skipped rows produce `null` for this column. */
2980
2967
  readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean>;
2981
- /** Recompute this cell on each run instead of reusing its durable value. */
2982
- readonly recompute?: boolean;
2983
- /** Recompute this cell when its durable value is an error-shaped object. */
2984
- readonly recomputeOnError?: boolean;
2985
- /** Fixed or value-dependent freshness policy for this cell. */
2986
- readonly staleAfterSeconds?: StaleAfterSeconds<Value>;
2987
2968
  };
2988
2969
  type ConditionalStepResolver<Row, Value, Else = null> = {
2989
2970
  readonly kind: 'conditional';
@@ -3000,12 +2981,6 @@ type ConditionalStepResolver<Row, Value, Else = null> = {
3000
2981
  type StepOptions<Row, Value = unknown> = {
3001
2982
  /** Optional row-level gate. Skipped rows produce `null` for this column. */
3002
2983
  readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean>;
3003
- /** Recompute this cell on each run instead of reusing its durable value. */
3004
- readonly recompute?: boolean;
3005
- /** Recompute this cell when its durable value is an error-shaped object. */
3006
- readonly recomputeOnError?: boolean;
3007
- /** Fixed or value-dependent freshness policy for this cell. */
3008
- readonly staleAfterSeconds?: StaleAfterSeconds<Value>;
3009
2984
  };
3010
2985
  type StepProgram<Input, Output, Return = Output> = {
3011
2986
  readonly kind: 'steps';
@@ -3024,9 +2999,6 @@ type StepProgramResolver<Input, Return> = {
3024
2999
  };
3025
3000
  type PlayStepProgramStep = {
3026
3001
  readonly name: string;
3027
- readonly recompute?: boolean;
3028
- readonly recomputeOnError?: boolean;
3029
- readonly staleAfterSeconds?: StaleAfterSeconds;
3030
3002
  readonly resolver: StepResolver<Record<string, unknown>, unknown> | ConditionalStepResolver<Record<string, unknown>, unknown> | StepProgramResolver<Record<string, unknown>, unknown>;
3031
3003
  };
3032
3004
  type ColumnResolver<Row, Value> = StepResolver<Row, Value> | ConditionalStepResolver<Row, Value> | StepProgramResolver<Row, Value>;
@@ -3065,8 +3037,7 @@ type DatasetBuilder<InputRow extends object, OutputRow extends object> = {
3065
3037
  /**
3066
3038
  * Define one output column with object-column authoring.
3067
3039
  *
3068
- * Use this form for typed `previousCell` access or result-based
3069
- * `staleAfterSeconds(value)` policies.
3040
+ * Use this form for typed `previousCell` access.
3070
3041
  *
3071
3042
  * @param name - Output column name.
3072
3043
  * @param definition - Object-column definition.
@@ -3078,7 +3049,7 @@ type DatasetBuilder<InputRow extends object, OutputRow extends object> = {
3078
3049
  *
3079
3050
  * @param name - Output column name.
3080
3051
  * @param resolver - Computes the value for one row.
3081
- * @param options - Row gate and freshness options.
3052
+ * @param options - Row gate options.
3082
3053
  * @returns The same dataset builder with a nullable column type for skipped rows.
3083
3054
  */
3084
3055
  withColumn<Name extends string, Value>(name: Name, resolver: StepResolver<OutputRow, Value> | StepProgramResolver<OutputRow, Value>, options: StepOptions<OutputRow, Value>): DatasetBuilder<InputRow, OutputRow & Record<Name, Value | null>>;
@@ -4071,4 +4042,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
4071
4042
  */
4072
4043
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
4073
4044
 
4074
- export { AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, 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 StaleAfterSeconds, 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 };
4045
+ export { AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, 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 };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { a as PlayCompilerManifest } from './compiler-manifest-BjoRENv9.js';
1
+ import { a as PlayCompilerManifest } from './compiler-manifest-DW1flrHk.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 & {});
@@ -2663,8 +2663,11 @@ interface PlayDataset<T> extends AsyncIterable<T> {
2663
2663
  type ToolResultExecutionMetadata = {
2664
2664
  idempotent: true;
2665
2665
  cached: boolean;
2666
- source: 'live' | 'checkpoint' | 'cache';
2666
+ source: 'live' | 'checkpoint' | 'cache' | 'in_flight';
2667
2667
  cacheKey?: string;
2668
+ receiptRole?: 'owner' | 'follower';
2669
+ receiptKey?: string;
2670
+ attachedToReceiptKey?: string;
2668
2671
  };
2669
2672
  type ToolResultTargetMetadata = {
2670
2673
  value: unknown;
@@ -2929,21 +2932,6 @@ type ToolExecutionRequest = {
2929
2932
  /** Numeric TTL in seconds for this tool checkpoint. */
2930
2933
  staleAfterSeconds?: number;
2931
2934
  };
2932
- /**
2933
- * Freshness policy for dataset cells and step-program columns.
2934
- *
2935
- * Use a positive whole number of seconds for a fixed TTL. Use a function when
2936
- * the next expiry depends on the value that was just produced. The function
2937
- * receives the completed cell value; return a positive whole number of seconds
2938
- * to set the next expiry, or `null` to keep that value indefinitely.
2939
- *
2940
- * Result-based policies are evaluated only for dataset/step-program cells. The
2941
- * scalar `ctx.step`, `ctx.fetch`, `ctx.runPlay`, and `ctx.tools.execute` APIs
2942
- * accept numeric TTLs.
2943
- *
2944
- * @sdkReference runtime 080
2945
- */
2946
- type StaleAfterSeconds<Value = unknown> = number | ((value: Value) => number | null);
2947
2935
  type StepResolver<Row, Value> = (row: Row, ctx: DeeplinePlayRuntimeContext, index: number, previousCell?: PreviousCell<Value>) => Value | Promise<Value>;
2948
2936
  /**
2949
2937
  * Input object passed to an object-column `run` resolver.
@@ -2968,8 +2956,7 @@ type DatasetColumnRunInput<Row, Value> = {
2968
2956
  /**
2969
2957
  * Object-column form for `.withColumn(...)`.
2970
2958
  *
2971
- * Use this when a column needs `runIf`, typed `previousCell`, or a
2972
- * result-based `staleAfterSeconds(value)` policy.
2959
+ * Use this when a column needs `runIf` or typed `previousCell`.
2973
2960
  *
2974
2961
  * @sdkReference runtime 100
2975
2962
  */
@@ -2978,12 +2965,6 @@ type DatasetColumnDefinition<Row, Value> = {
2978
2965
  run: (input: DatasetColumnRunInput<Row, Value>) => Value | Promise<Value>;
2979
2966
  /** Optional row-level gate. Skipped rows produce `null` for this column. */
2980
2967
  readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean>;
2981
- /** Recompute this cell on each run instead of reusing its durable value. */
2982
- readonly recompute?: boolean;
2983
- /** Recompute this cell when its durable value is an error-shaped object. */
2984
- readonly recomputeOnError?: boolean;
2985
- /** Fixed or value-dependent freshness policy for this cell. */
2986
- readonly staleAfterSeconds?: StaleAfterSeconds<Value>;
2987
2968
  };
2988
2969
  type ConditionalStepResolver<Row, Value, Else = null> = {
2989
2970
  readonly kind: 'conditional';
@@ -3000,12 +2981,6 @@ type ConditionalStepResolver<Row, Value, Else = null> = {
3000
2981
  type StepOptions<Row, Value = unknown> = {
3001
2982
  /** Optional row-level gate. Skipped rows produce `null` for this column. */
3002
2983
  readonly runIf?: (row: Row, index: number) => boolean | Promise<boolean>;
3003
- /** Recompute this cell on each run instead of reusing its durable value. */
3004
- readonly recompute?: boolean;
3005
- /** Recompute this cell when its durable value is an error-shaped object. */
3006
- readonly recomputeOnError?: boolean;
3007
- /** Fixed or value-dependent freshness policy for this cell. */
3008
- readonly staleAfterSeconds?: StaleAfterSeconds<Value>;
3009
2984
  };
3010
2985
  type StepProgram<Input, Output, Return = Output> = {
3011
2986
  readonly kind: 'steps';
@@ -3024,9 +2999,6 @@ type StepProgramResolver<Input, Return> = {
3024
2999
  };
3025
3000
  type PlayStepProgramStep = {
3026
3001
  readonly name: string;
3027
- readonly recompute?: boolean;
3028
- readonly recomputeOnError?: boolean;
3029
- readonly staleAfterSeconds?: StaleAfterSeconds;
3030
3002
  readonly resolver: StepResolver<Record<string, unknown>, unknown> | ConditionalStepResolver<Record<string, unknown>, unknown> | StepProgramResolver<Record<string, unknown>, unknown>;
3031
3003
  };
3032
3004
  type ColumnResolver<Row, Value> = StepResolver<Row, Value> | ConditionalStepResolver<Row, Value> | StepProgramResolver<Row, Value>;
@@ -3065,8 +3037,7 @@ type DatasetBuilder<InputRow extends object, OutputRow extends object> = {
3065
3037
  /**
3066
3038
  * Define one output column with object-column authoring.
3067
3039
  *
3068
- * Use this form for typed `previousCell` access or result-based
3069
- * `staleAfterSeconds(value)` policies.
3040
+ * Use this form for typed `previousCell` access.
3070
3041
  *
3071
3042
  * @param name - Output column name.
3072
3043
  * @param definition - Object-column definition.
@@ -3078,7 +3049,7 @@ type DatasetBuilder<InputRow extends object, OutputRow extends object> = {
3078
3049
  *
3079
3050
  * @param name - Output column name.
3080
3051
  * @param resolver - Computes the value for one row.
3081
- * @param options - Row gate and freshness options.
3052
+ * @param options - Row gate options.
3082
3053
  * @returns The same dataset builder with a nullable column type for skipped rows.
3083
3054
  */
3084
3055
  withColumn<Name extends string, Value>(name: Name, resolver: StepResolver<OutputRow, Value> | StepProgramResolver<OutputRow, Value>, options: StepOptions<OutputRow, Value>): DatasetBuilder<InputRow, OutputRow & Record<Name, Value | null>>;
@@ -4071,4 +4042,4 @@ declare function writeCsvOutputFile(rows: Array<Record<string, unknown>>, stem:
4071
4042
  */
4072
4043
  declare function extractSummaryFields(payload: unknown): Record<string, Scalar>;
4073
4044
 
4074
- export { AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, 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 StaleAfterSeconds, 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 };
4045
+ export { AuthError, type BillingCreditPool, type BillingInvoiceEntry, type BillingInvoicesResult, type BillingNamespace, type BillingSubscriptionCancelResult, type BillingSubscriptionStatus, 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 };
package/dist/index.js CHANGED
@@ -419,10 +419,10 @@ var SDK_RELEASE = {
419
419
  // the SDK enrich generator's one-second stale policy.
420
420
  // 0.1.110 ships authored V2 prebuilts and required top-level play descriptions.
421
421
  // 0.1.111 ships dataset-native tool list getters and result row datasets.
422
- version: "0.1.152",
422
+ version: "0.1.154",
423
423
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
424
424
  supportPolicy: {
425
- latest: "0.1.152",
425
+ latest: "0.1.154",
426
426
  minimumSupported: "0.1.53",
427
427
  deprecatedBelow: "0.1.53",
428
428
  commandMinimumSupported: [
@@ -1226,8 +1226,15 @@ function normalizeStepProgress(value) {
1226
1226
  };
1227
1227
  }
1228
1228
 
1229
- // ../shared_libs/play-runtime/run-snapshot-stream.ts
1230
- function normalizePlayRunLiveStatus(value) {
1229
+ // ../shared_libs/play-runtime/run-lifecycle-policy.ts
1230
+ var TERMINAL_PLAY_RUN_STATUSES = /* @__PURE__ */ new Set([
1231
+ "completed",
1232
+ "failed",
1233
+ "cancelled",
1234
+ "terminated",
1235
+ "timed_out"
1236
+ ]);
1237
+ function normalizePlayRunLifecycleStatus(value) {
1231
1238
  const normalized = String(value ?? "").trim().toLowerCase();
1232
1239
  switch (normalized) {
1233
1240
  case "queued":
@@ -1235,6 +1242,7 @@ function normalizePlayRunLiveStatus(value) {
1235
1242
  return "running";
1236
1243
  case "running":
1237
1244
  case "started":
1245
+ case "waiting":
1238
1246
  return "running";
1239
1247
  case "completed":
1240
1248
  case "complete":
@@ -1255,8 +1263,16 @@ function normalizePlayRunLiveStatus(value) {
1255
1263
  return "unknown";
1256
1264
  }
1257
1265
  }
1266
+ function isTerminalPlayRunLifecycleStatus(status) {
1267
+ return TERMINAL_PLAY_RUN_STATUSES.has(normalizePlayRunLifecycleStatus(status));
1268
+ }
1269
+
1270
+ // ../shared_libs/play-runtime/run-snapshot-stream.ts
1271
+ function normalizePlayRunLiveStatus(value) {
1272
+ return normalizePlayRunLifecycleStatus(value);
1273
+ }
1258
1274
  function isTerminalPlayRunLiveStatus(status) {
1259
- return status === "completed" || status === "failed" || status === "cancelled" || status === "terminated" || status === "timed_out";
1275
+ return isTerminalPlayRunLifecycleStatus(status);
1260
1276
  }
1261
1277
  function isRecord2(value) {
1262
1278
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
@@ -5096,12 +5112,7 @@ var DeeplineStepProgram = class _DeeplineStepProgram {
5096
5112
  ...this.steps,
5097
5113
  {
5098
5114
  name,
5099
- resolver: stepResolver,
5100
- ...options?.staleAfterSeconds !== void 0 ? {
5101
- staleAfterSeconds: options.staleAfterSeconds
5102
- } : {},
5103
- ...options?.recompute === true ? { recompute: true } : {},
5104
- ...options?.recomputeOnError === true ? { recomputeOnError: true } : {}
5115
+ resolver: stepResolver
5105
5116
  }
5106
5117
  ],
5107
5118
  this.returnResolver
package/dist/index.mjs CHANGED
@@ -349,10 +349,10 @@ var SDK_RELEASE = {
349
349
  // the SDK enrich generator's one-second stale policy.
350
350
  // 0.1.110 ships authored V2 prebuilts and required top-level play descriptions.
351
351
  // 0.1.111 ships dataset-native tool list getters and result row datasets.
352
- version: "0.1.152",
352
+ version: "0.1.154",
353
353
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
354
354
  supportPolicy: {
355
- latest: "0.1.152",
355
+ latest: "0.1.154",
356
356
  minimumSupported: "0.1.53",
357
357
  deprecatedBelow: "0.1.53",
358
358
  commandMinimumSupported: [
@@ -1156,8 +1156,15 @@ function normalizeStepProgress(value) {
1156
1156
  };
1157
1157
  }
1158
1158
 
1159
- // ../shared_libs/play-runtime/run-snapshot-stream.ts
1160
- function normalizePlayRunLiveStatus(value) {
1159
+ // ../shared_libs/play-runtime/run-lifecycle-policy.ts
1160
+ var TERMINAL_PLAY_RUN_STATUSES = /* @__PURE__ */ new Set([
1161
+ "completed",
1162
+ "failed",
1163
+ "cancelled",
1164
+ "terminated",
1165
+ "timed_out"
1166
+ ]);
1167
+ function normalizePlayRunLifecycleStatus(value) {
1161
1168
  const normalized = String(value ?? "").trim().toLowerCase();
1162
1169
  switch (normalized) {
1163
1170
  case "queued":
@@ -1165,6 +1172,7 @@ function normalizePlayRunLiveStatus(value) {
1165
1172
  return "running";
1166
1173
  case "running":
1167
1174
  case "started":
1175
+ case "waiting":
1168
1176
  return "running";
1169
1177
  case "completed":
1170
1178
  case "complete":
@@ -1185,8 +1193,16 @@ function normalizePlayRunLiveStatus(value) {
1185
1193
  return "unknown";
1186
1194
  }
1187
1195
  }
1196
+ function isTerminalPlayRunLifecycleStatus(status) {
1197
+ return TERMINAL_PLAY_RUN_STATUSES.has(normalizePlayRunLifecycleStatus(status));
1198
+ }
1199
+
1200
+ // ../shared_libs/play-runtime/run-snapshot-stream.ts
1201
+ function normalizePlayRunLiveStatus(value) {
1202
+ return normalizePlayRunLifecycleStatus(value);
1203
+ }
1188
1204
  function isTerminalPlayRunLiveStatus(status) {
1189
- return status === "completed" || status === "failed" || status === "cancelled" || status === "terminated" || status === "timed_out";
1205
+ return isTerminalPlayRunLifecycleStatus(status);
1190
1206
  }
1191
1207
  function isRecord2(value) {
1192
1208
  return Boolean(value && typeof value === "object" && !Array.isArray(value));
@@ -5026,12 +5042,7 @@ var DeeplineStepProgram = class _DeeplineStepProgram {
5026
5042
  ...this.steps,
5027
5043
  {
5028
5044
  name,
5029
- resolver: stepResolver,
5030
- ...options?.staleAfterSeconds !== void 0 ? {
5031
- staleAfterSeconds: options.staleAfterSeconds
5032
- } : {},
5033
- ...options?.recompute === true ? { recompute: true } : {},
5034
- ...options?.recomputeOnError === true ? { recomputeOnError: true } : {}
5045
+ resolver: stepResolver
5035
5046
  }
5036
5047
  ],
5037
5048
  this.returnResolver
@@ -1,5 +1,5 @@
1
- import { P as PlayArtifactKind$1, a as PlayCompilerManifest } from '../compiler-manifest-BjoRENv9.mjs';
2
- export { b as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-BjoRENv9.mjs';
1
+ import { P as PlayArtifactKind$1, a as PlayCompilerManifest } from '../compiler-manifest-DW1flrHk.mjs';
2
+ export { b as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-DW1flrHk.mjs';
3
3
 
4
4
  type PlayPackageImport = {
5
5
  name: string;
@@ -1,5 +1,5 @@
1
- import { P as PlayArtifactKind$1, a as PlayCompilerManifest } from '../compiler-manifest-BjoRENv9.js';
2
- export { b as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-BjoRENv9.js';
1
+ import { P as PlayArtifactKind$1, a as PlayCompilerManifest } from '../compiler-manifest-DW1flrHk.js';
2
+ export { b as PLAY_ARTIFACT_KINDS } from '../compiler-manifest-DW1flrHk.js';
3
3
 
4
4
  type PlayPackageImport = {
5
5
  name: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.152",
3
+ "version": "0.1.154",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -1,76 +0,0 @@
1
- import {
2
- normalizeCellStalenessPolicy,
3
- type AuthoredCellStalenessPolicy,
4
- type AuthoredCellStalenessPolicyByField,
5
- type AuthoredStaleAfterSeconds,
6
- type CellStalenessPolicyByField,
7
- } from '../play-runtime/cell-staleness';
8
-
9
- export type DatasetCellPolicyStep = {
10
- name: string;
11
- recompute?: boolean;
12
- recomputeOnError?: boolean;
13
- staleAfterSeconds?: AuthoredStaleAfterSeconds;
14
- };
15
-
16
- export function authoredCellPolicyForDatasetStep(
17
- step: DatasetCellPolicyStep,
18
- ): AuthoredCellStalenessPolicy | null {
19
- const policy = {
20
- ...(step.recompute === true ? { recompute: true as const } : {}),
21
- ...(step.recomputeOnError === true
22
- ? { recomputeOnError: true as const }
23
- : {}),
24
- ...(step.staleAfterSeconds !== undefined
25
- ? { staleAfterSeconds: step.staleAfterSeconds }
26
- : {}),
27
- };
28
- return Object.keys(policy).length > 0 ? policy : null;
29
- }
30
-
31
- export function cellPoliciesFromDatasetSteps(
32
- steps: readonly DatasetCellPolicyStep[],
33
- ): CellStalenessPolicyByField {
34
- return Object.fromEntries(
35
- steps.flatMap((step) => {
36
- const policy = authoredCellPolicyForDatasetStep(step);
37
- return policy ? [[step.name, normalizeCellStalenessPolicy(policy)]] : [];
38
- }),
39
- ) as CellStalenessPolicyByField;
40
- }
41
-
42
- export function authoredCellPoliciesFromDatasetSteps(
43
- steps: readonly DatasetCellPolicyStep[],
44
- ): AuthoredCellStalenessPolicyByField {
45
- return Object.fromEntries(
46
- steps.flatMap((step) => {
47
- const policy = authoredCellPolicyForDatasetStep(step);
48
- return policy ? [[step.name, policy]] : [];
49
- }),
50
- ) as AuthoredCellStalenessPolicyByField;
51
- }
52
-
53
- export function normalizeAuthoredCellPolicyMap(
54
- raw: unknown,
55
- ): CellStalenessPolicyByField {
56
- if (!raw || typeof raw !== 'object') {
57
- return {};
58
- }
59
- return Object.fromEntries(
60
- Object.entries(raw as AuthoredCellStalenessPolicyByField).map(
61
- ([fieldName, policy]) => [
62
- fieldName,
63
- normalizeCellStalenessPolicy(policy),
64
- ],
65
- ),
66
- );
67
- }
68
-
69
- export function authoredCellPolicyMap(
70
- raw: unknown,
71
- ): AuthoredCellStalenessPolicyByField {
72
- if (!raw || typeof raw !== 'object') {
73
- return {};
74
- }
75
- return raw as AuthoredCellStalenessPolicyByField;
76
- }