deepline 0.1.209 → 0.1.211

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 (24) hide show
  1. package/dist/bundling-sources/apps/play-runner-workers/src/coordinator-entry.ts +0 -2
  2. package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +155 -139
  3. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/map-chunk-plan.ts +15 -0
  4. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/map-latency-profile.ts +90 -0
  5. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-dispatch.ts +173 -103
  6. package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-receipts.ts +25 -92
  7. package/dist/bundling-sources/sdk/src/play.ts +4 -2
  8. package/dist/bundling-sources/sdk/src/release.ts +2 -2
  9. package/dist/bundling-sources/shared_libs/play-runtime/child-run-id.ts +4 -5
  10. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +348 -109
  11. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +1 -2
  12. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +2 -4
  13. package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +42 -3
  14. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +5 -1
  15. package/dist/bundling-sources/shared_libs/play-runtime/single-flight.ts +31 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +12 -1
  17. package/dist/bundling-sources/shared_libs/plays/dataset.ts +41 -5
  18. package/dist/cli/index.js +94 -16
  19. package/dist/cli/index.mjs +94 -16
  20. package/dist/index.d.mts +18 -3
  21. package/dist/index.d.ts +18 -3
  22. package/dist/index.js +22 -5
  23. package/dist/index.mjs +22 -5
  24. package/package.json +1 -1
@@ -608,10 +608,10 @@ var SDK_RELEASE = {
608
608
  // 0.1.154 removes the short-lived generated enrich StepOptions recompute
609
609
  // fields shipped in 0.1.153.
610
610
  // 0.1.175 ships loud `deepline enrich` empty-waterfall reporting.
611
- version: "0.1.209",
611
+ version: "0.1.211",
612
612
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
613
613
  supportPolicy: {
614
- latest: "0.1.209",
614
+ latest: "0.1.211",
615
615
  minimumSupported: "0.1.53",
616
616
  deprecatedBelow: "0.1.53",
617
617
  commandMinimumSupported: [
@@ -10855,7 +10855,8 @@ var PLAY_RUN_RESERVED_BOOLEAN_FLAGS = /* @__PURE__ */ new Set([
10855
10855
  "--logs",
10856
10856
  "--full",
10857
10857
  "--force",
10858
- "--no-open"
10858
+ "--no-open",
10859
+ "--debug-map-latency"
10859
10860
  ]);
10860
10861
  function traceCliSync(phase, fields, run) {
10861
10862
  const startedAt = Date.now();
@@ -14202,6 +14203,7 @@ function parsePlayRunOptions(args) {
14202
14203
  const emitLogs = !jsonOutput || args.includes("--logs");
14203
14204
  const force = args.includes("--force");
14204
14205
  const noOpen = args.includes("--no-open");
14206
+ const debugMapLatency = args.includes("--debug-map-latency");
14205
14207
  let waitTimeoutMs = null;
14206
14208
  let profile = null;
14207
14209
  for (let index = 0; index < args.length; index += 1) {
@@ -14320,7 +14322,8 @@ function parsePlayRunOptions(args) {
14320
14322
  waitTimeoutMs,
14321
14323
  force,
14322
14324
  noOpen,
14323
- profile
14325
+ profile,
14326
+ debugMapLatency
14324
14327
  };
14325
14328
  }
14326
14329
  function parsePlayCheckOptions(args) {
@@ -14805,6 +14808,7 @@ async function handleFileBackedRun(options) {
14805
14808
  ...stagedFileInputs.packagedFiles.length ? { packagedFiles: stagedFileInputs.packagedFiles } : {},
14806
14809
  ...options.force ? { force: true } : {},
14807
14810
  ...options.profile ? { profile: options.profile } : {},
14811
+ ...options.debugMapLatency ? { testPolicyOverrides: { mapLatencyProfile: true } } : {},
14808
14812
  ...integrationMode ? { integrationMode } : {}
14809
14813
  };
14810
14814
  if (options.watch) {
@@ -14966,6 +14970,7 @@ async function handleNamedRun(options) {
14966
14970
  ...stagedFileInputs.packagedFiles.length ? { packagedFiles: stagedFileInputs.packagedFiles } : {},
14967
14971
  ...options.force ? { force: true } : {},
14968
14972
  ...options.profile ? { profile: options.profile } : {},
14973
+ ...options.debugMapLatency ? { testPolicyOverrides: { mapLatencyProfile: true } } : {},
14969
14974
  ...integrationMode ? { integrationMode } : {}
14970
14975
  };
14971
14976
  if (options.watch) {
@@ -16214,7 +16219,10 @@ Examples:
16214
16219
  ).option("--watch", "Compatibility alias; run waits by default").option("--wait", "Compatibility alias; run waits by default").option("--no-wait", "Start the run and return immediately").option(
16215
16220
  "--logs",
16216
16221
  "When output is non-interactive, stream play logs to stderr while waiting"
16217
- ).option("--tail-timeout-ms <ms>", "Timeout while watching the run stream").option("--force", "Start a fresh run graph").option("--no-open", "Print the play page URL without opening a browser").option("--json", "Emit JSON output").option("--full", "Debug only: with --json, emit the raw status payload").addHelpText(
16222
+ ).option("--tail-timeout-ms <ms>", "Timeout while watching the run stream").option("--force", "Start a fresh run graph").option(
16223
+ "--debug-map-latency",
16224
+ "Internal diagnostics: emit one aggregate latency profile per dataset map"
16225
+ ).option("--no-open", "Print the play page URL without opening a browser").option("--json", "Emit JSON output").option("--full", "Debug only: with --json, emit the raw status payload").addHelpText(
16218
16226
  "afterAll",
16219
16227
  `
16220
16228
  Pass-through input flags:
@@ -16250,6 +16258,7 @@ Pass-through input flags:
16250
16258
  ...options.logs ? ["--logs"] : [],
16251
16259
  ...options.tailTimeoutMs ? ["--tail-timeout-ms", options.tailTimeoutMs] : [],
16252
16260
  ...options.force ? ["--force"] : [],
16261
+ ...options.debugMapLatency ? ["--debug-map-latency"] : [],
16253
16262
  ...options.noOpen || options.open === false ? ["--no-open"] : [],
16254
16263
  ...options.json ? ["--json"] : [],
16255
16264
  ...options.full ? ["--full"] : [],
@@ -17244,12 +17253,9 @@ function renderColumnRunIfFunction(command) {
17244
17253
  if (!command.run_if_js) {
17245
17254
  return null;
17246
17255
  }
17247
- if (command.play) {
17248
- return `(__dlRawRow) => { const row = __dlPrepareEnrichRow(__dlRawRow, [${stringLiteral(command.alias)}]); const input = row; const context = row;
17256
+ return `(__dlRawRow) => { const row = __dlPrepareEnrichRow(__dlRawRow, [${stringLiteral(command.alias)}]); const input = row; const context = row;
17249
17257
  ${indent(renderJavascriptBody(command.run_if_js), 6)}
17250
17258
  }`;
17251
- }
17252
- return renderRunIfFunction(command);
17253
17259
  }
17254
17260
  function renderCombinedRunIfFunction(precheck, runIfSource) {
17255
17261
  if (!runIfSource) {
@@ -17302,6 +17308,8 @@ function renderPlayStep(command, options) {
17302
17308
  ` const __dlRunIf = ${runIfJs};`,
17303
17309
  ` if (!__dlRunIf(templateRow)) return null;`
17304
17310
  ] : [];
17311
+ const inline = command.play?.inline;
17312
+ const inlineHandler = inline ? `__dlInlinePlay_${inline.sourceHash.slice(0, 16)}` : null;
17305
17313
  return [
17306
17314
  `async (row, stepCtx) => {`,
17307
17315
  ...options.precheck ? [` if (${options.precheck}) return null;`] : [],
@@ -17311,9 +17319,16 @@ function renderPlayStep(command, options) {
17311
17319
  ` if (__dlShouldSkipBlankPlayPayload(payload)) return null;`,
17312
17320
  ` let result: unknown;`,
17313
17321
  ` try {`,
17314
- ` result = await stepCtx.runPlay(${callId}, ${playRef}, payload, {`,
17315
- ` description: ${stringLiteral(command.description ?? command.alias)}`,
17316
- ` });`,
17322
+ ...inlineHandler ? [
17323
+ // Enrich validates and normalizes this payload against the certified
17324
+ // prebuilt contract before code generation. The attachment retains
17325
+ // its concrete input type, while generated payloads are records.
17326
+ ` result = await __dlRunInlinePlay(${inlineHandler}, stepCtx, payload as never, ${options.force});`
17327
+ ] : [
17328
+ ` result = await stepCtx.runPlay(${callId}, ${playRef}, payload, {`,
17329
+ ` description: ${stringLiteral(command.description ?? command.alias)}`,
17330
+ ` });`
17331
+ ],
17317
17332
  ` } catch (error) {`,
17318
17333
  ...options.waterfallSoftFail ? [` return __dlWaterfallToolFailure(error);`] : [` throw error;`],
17319
17334
  ` }`,
@@ -17321,6 +17336,19 @@ function renderPlayStep(command, options) {
17321
17336
  `}`
17322
17337
  ].join("\n");
17323
17338
  }
17339
+ function collectInlinePlayHandlers(commands) {
17340
+ const handlers = /* @__PURE__ */ new Map();
17341
+ const visit = (command) => {
17342
+ if (isWaterfall(command)) {
17343
+ command.commands.forEach(visit);
17344
+ return;
17345
+ }
17346
+ const inline = command.play?.inline;
17347
+ if (inline) handlers.set(inline.sourceHash, inline);
17348
+ };
17349
+ commands.forEach(visit);
17350
+ return [...handlers.values()];
17351
+ }
17324
17352
  function renderInlineJavascriptStep(command, options) {
17325
17353
  const alias = stringLiteral(command.alias);
17326
17354
  const extractJs = renderExtractFunction(command, 4);
@@ -17521,6 +17549,10 @@ function compileEnrichConfigToPlaySource(config, options = {}) {
17521
17549
  [...options.forceAliases ?? []].map((alias) => normalizeAlias(alias))
17522
17550
  );
17523
17551
  const columnSteps = [];
17552
+ const inlineHandlers = collectInlinePlayHandlers(config.commands);
17553
+ const inlineTypeImports = [
17554
+ ...new Set(inlineHandlers.flatMap((inline) => inline.typeImports ?? []))
17555
+ ].sort();
17524
17556
  config.commands.forEach((command) => {
17525
17557
  if (isWaterfall(command)) {
17526
17558
  columnSteps.push(
@@ -17558,6 +17590,19 @@ function compileEnrichConfigToPlaySource(config, options = {}) {
17558
17590
  const generatedAliases = collectGeneratedAliases(config.commands);
17559
17591
  const runOptionsSource = options.failFast ? `{ key: (row, index) => __dlEnrichRowKey(row, index + rowStart), onRowError: 'fail' as const }` : `{ key: (row, index) => __dlEnrichRowKey(row, index + rowStart) }`;
17560
17592
  const body = [
17593
+ `function __dlRunInlinePlay<TContext, TInput, TOutput>(handler: (ctx: TContext, input: TInput) => Promise<TOutput>, scope: TContext, payload: TInput, force: boolean): Promise<TOutput> {`,
17594
+ ` if (!force) return handler(scope, payload);`,
17595
+ ` const runtimeScope = scope as TContext & { __deeplineRunWithForcedTools?: <T>(run: () => Promise<T>) => Promise<T> };`,
17596
+ ` if (typeof runtimeScope.__deeplineRunWithForcedTools !== 'function') {`,
17597
+ ` throw new Error('This runtime does not support forced certified inline play execution.');`,
17598
+ ` }`,
17599
+ ` return runtimeScope.__deeplineRunWithForcedTools(() => handler(scope, payload));`,
17600
+ `}`,
17601
+ ``,
17602
+ ...inlineHandlers.flatMap((inline) => [
17603
+ `const __dlInlinePlay_${inline.sourceHash.slice(0, 16)} = ${inline.functionExpressionSource};`,
17604
+ ``
17605
+ ]),
17561
17606
  `export default definePlay(${stringLiteral(playName)}, async (ctx, input: EnrichInput) => {`,
17562
17607
  ` const sourceRows = await ctx.csv<Record<string, unknown>>(input.file);`,
17563
17608
  ` const rowStart = __dlNonNegativeInteger(input.rowStart, 0);`,
@@ -17582,7 +17627,8 @@ function compileEnrichConfigToPlaySource(config, options = {}) {
17582
17627
  const helpers = idiomaticGetters ? selectUsedHelpers(helperSource(), body.join("\n")) : helperSource();
17583
17628
  return [
17584
17629
  ...inlineRunJavascript && configHasRunJavascript(config) ? ["// @ts-nocheck", "/* eslint-disable */", ""] : [],
17585
- `import { definePlay } from 'deepline';`,
17630
+ `import { definePlay, steps } from 'deepline';`,
17631
+ ...inlineTypeImports.length > 0 ? [`import type { ${inlineTypeImports.join(", ")} } from 'deepline';`] : [],
17586
17632
  ``,
17587
17633
  `type EnrichInput = { file: string; rowStart?: number | null; rowEnd?: number | null };`,
17588
17634
  ``,
@@ -18797,7 +18843,8 @@ async function buildPlanArgs(args) {
18797
18843
  "--fail-fast",
18798
18844
  "--all",
18799
18845
  "--in-place",
18800
- "--no-open"
18846
+ "--no-open",
18847
+ "--debug-map-latency"
18801
18848
  ]);
18802
18849
  const planArgs = [];
18803
18850
  for (let index = 0; index < args.length; index += 1) {
@@ -21350,11 +21397,15 @@ async function fetchBackingRowsForCsvExport(input2) {
21350
21397
  }
21351
21398
  function mergeRowsForCsvExport(enrichedRows, options) {
21352
21399
  const compactAliases = options?.config ? enrichAiRuntimeCompactAliases(options.config) : /* @__PURE__ */ new Set();
21400
+ const preservedAliases = /* @__PURE__ */ new Set([
21401
+ ...compactAliases,
21402
+ ...options?.config ? collectConfigPlayAliases(options.config) : []
21403
+ ]);
21353
21404
  const rows = dataExportRows(
21354
21405
  normalizeEnrichRowsForCsvExport(enrichedRows, options?.config, {
21355
21406
  statusFailureMessages: options?.statusFailureMessages
21356
21407
  }),
21357
- { preserveJsonStringColumns: compactAliases }
21408
+ { preserveJsonStringColumns: preservedAliases }
21358
21409
  );
21359
21410
  const range = options?.rows;
21360
21411
  if (!options?.sourceCsvPath) {
@@ -21431,6 +21482,22 @@ function mergeRowsForCsvExport(enrichedRows, options) {
21431
21482
  }
21432
21483
  return { rows: merged, preferredColumns };
21433
21484
  }
21485
+ function collectConfigPlayAliases(config) {
21486
+ const aliases = /* @__PURE__ */ new Set();
21487
+ const visit = (commands) => {
21488
+ for (const command of commands) {
21489
+ if ("with_waterfall" in command) {
21490
+ visit(command.commands);
21491
+ continue;
21492
+ }
21493
+ if (!command.disabled && command.play) {
21494
+ aliases.add(normalizeAlias2(command.alias));
21495
+ }
21496
+ }
21497
+ };
21498
+ visit(config.commands);
21499
+ return aliases;
21500
+ }
21434
21501
  function collectConfigScalarAliasOrder(config) {
21435
21502
  const aliases = [];
21436
21503
  const seen = /* @__PURE__ */ new Set();
@@ -21586,6 +21653,9 @@ function materializeEnrichAliasCellForCsv(row, alias, options) {
21586
21653
  if (Object.prototype.hasOwnProperty.call(direct, "matched_result") || Object.prototype.hasOwnProperty.call(direct, "matchedResult") || Object.prototype.hasOwnProperty.call(direct, "result")) {
21587
21654
  return materializeCsvCellValue(direct);
21588
21655
  }
21656
+ if (options?.preservePlainObject && !Object.prototype.hasOwnProperty.call(direct, "_metadata")) {
21657
+ return materializeCsvCellValue(direct);
21658
+ }
21589
21659
  const directCells = [];
21590
21660
  for (const [field, value] of Object.entries(direct)) {
21591
21661
  if (!isEnrichAliasPayloadField(field)) {
@@ -21642,6 +21712,7 @@ function materializeEnrichAliasCellForCsv(row, alias, options) {
21642
21712
  function normalizeEnrichRowsForCsvExport(rows, config, options) {
21643
21713
  const aliases = config ? collectConfigScalarAliasOrder(config) : [];
21644
21714
  const aiCompactAliases = config ? enrichAiRuntimeCompactAliases(config) : null;
21715
+ const playAliases = config ? collectConfigPlayAliases(config) : /* @__PURE__ */ new Set();
21645
21716
  const failureOperationByAlias = hardFailureOperationByAlias(config);
21646
21717
  return rows.map((row) => {
21647
21718
  const metadata = legacyMetadataFromRow(row);
@@ -21685,7 +21756,8 @@ function normalizeEnrichRowsForCsvExport(rows, config, options) {
21685
21756
  }
21686
21757
  for (const alias of aliases) {
21687
21758
  const value = materializeEnrichAliasCellForCsv(normalized, alias, {
21688
- compactAiCell: aiCompactAliases?.has(normalizeAlias2(alias)) ?? false
21759
+ compactAiCell: aiCompactAliases?.has(normalizeAlias2(alias)) ?? false,
21760
+ preservePlainObject: playAliases.has(normalizeAlias2(alias))
21689
21761
  });
21690
21762
  if (value !== void 0) {
21691
21763
  normalized[alias] = value;
@@ -21873,6 +21945,9 @@ function registerEnrichCommand(program) {
21873
21945
  ).option(
21874
21946
  "--profile <id>",
21875
21947
  "Internal/testing: override the execution profile for the generated play run."
21948
+ ).option(
21949
+ "--debug-map-latency",
21950
+ "Internal diagnostics: emit one aggregate latency profile per dataset map."
21876
21951
  ).option(
21877
21952
  "--fail-fast",
21878
21953
  "Fail the generated play when any selected row errors, while preserving recovered runtime-sheet rows for export."
@@ -22018,6 +22093,9 @@ function registerEnrichCommand(program) {
22018
22093
  if (options.profile) {
22019
22094
  runArgs.push("--profile", options.profile);
22020
22095
  }
22096
+ if (options.debugMapLatency) {
22097
+ runArgs.push("--debug-map-latency");
22098
+ }
22021
22099
  if (options.noOpen || input2.suppressOpen) {
22022
22100
  runArgs.push("--no-open");
22023
22101
  }
package/dist/index.d.mts CHANGED
@@ -1143,6 +1143,13 @@ type EnrichStepCommand = {
1143
1143
  play?: {
1144
1144
  ref: string;
1145
1145
  mode?: 'scalar';
1146
+ execution?: 'child' | 'inline';
1147
+ inline?: {
1148
+ exportName: string;
1149
+ functionExpressionSource: string;
1150
+ sourceHash: string;
1151
+ typeImports: string[];
1152
+ };
1146
1153
  };
1147
1154
  payload: Record<string, unknown>;
1148
1155
  extract_js?: string;
@@ -2850,7 +2857,7 @@ interface PlayDataset<T> extends AsyncIterable<T> {
2850
2857
  * Large datasets should flow by handle through Neon-backed storage, not
2851
2858
  * through worker memory as giant arrays.
2852
2859
  */
2853
- materialize(limit?: number): Promise<T[]>;
2860
+ materialize(options?: number | PlayDatasetMaterializeOptions): Promise<T[]>;
2854
2861
  toJSON(): {
2855
2862
  kind: 'dataset';
2856
2863
  datasetKind: PlayDatasetKind;
@@ -2866,6 +2873,13 @@ interface PlayDataset<T> extends AsyncIterable<T> {
2866
2873
  preview: T[];
2867
2874
  };
2868
2875
  }
2876
+ type PlayDatasetMaterializeScope = 'result' | 'full_persisted_dataset';
2877
+ type PlayDatasetMaterializeOptions = {
2878
+ /** Rows returned by this operation, or every current row in its persisted dataset. */
2879
+ scope?: PlayDatasetMaterializeScope;
2880
+ /** Maximum number of rows to load into memory. */
2881
+ limit?: number;
2882
+ };
2869
2883
 
2870
2884
  type ToolResultExecutionMetadata = {
2871
2885
  idempotent: true;
@@ -3038,6 +3052,8 @@ type PlayBindings = {
3038
3052
  * older clients can continue to register revisions during the migration.
3039
3053
  */
3040
3054
  description?: string;
3055
+ /** Allow compilers to bundle this named handler directly without a child run. */
3056
+ inline?: boolean;
3041
3057
  /** Optional per-run billing controls enforced by the runtime. */
3042
3058
  billing?: {
3043
3059
  /** Stop the run before a billed action would push total run credits above this cap. */
@@ -3219,7 +3235,7 @@ type StepOptions<Row, Value = unknown> = {
3219
3235
  * Legacy dataset-column recompute flag accepted for older authored plays.
3220
3236
  *
3221
3237
  * Prefer putting freshness on the actual reusable call
3222
- * (`ctx.tools.execute`, `ctx.step`, `ctx.fetch`, or `ctx.runPlay`).
3238
+ * (`ctx.tools.execute`, `ctx.step`, or `ctx.fetch`).
3223
3239
  */
3224
3240
  readonly recompute?: boolean;
3225
3241
  /** Legacy error-recompute flag accepted for older authored plays. */
@@ -3607,7 +3623,6 @@ interface DeeplinePlayRuntimeContext {
3607
3623
  */
3608
3624
  runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options: {
3609
3625
  description: string;
3610
- staleAfterSeconds?: number;
3611
3626
  }): Promise<TOutput>;
3612
3627
  /**
3613
3628
  * Emit a log line visible in `play tail` and the play's progress logs.
package/dist/index.d.ts CHANGED
@@ -1143,6 +1143,13 @@ type EnrichStepCommand = {
1143
1143
  play?: {
1144
1144
  ref: string;
1145
1145
  mode?: 'scalar';
1146
+ execution?: 'child' | 'inline';
1147
+ inline?: {
1148
+ exportName: string;
1149
+ functionExpressionSource: string;
1150
+ sourceHash: string;
1151
+ typeImports: string[];
1152
+ };
1146
1153
  };
1147
1154
  payload: Record<string, unknown>;
1148
1155
  extract_js?: string;
@@ -2850,7 +2857,7 @@ interface PlayDataset<T> extends AsyncIterable<T> {
2850
2857
  * Large datasets should flow by handle through Neon-backed storage, not
2851
2858
  * through worker memory as giant arrays.
2852
2859
  */
2853
- materialize(limit?: number): Promise<T[]>;
2860
+ materialize(options?: number | PlayDatasetMaterializeOptions): Promise<T[]>;
2854
2861
  toJSON(): {
2855
2862
  kind: 'dataset';
2856
2863
  datasetKind: PlayDatasetKind;
@@ -2866,6 +2873,13 @@ interface PlayDataset<T> extends AsyncIterable<T> {
2866
2873
  preview: T[];
2867
2874
  };
2868
2875
  }
2876
+ type PlayDatasetMaterializeScope = 'result' | 'full_persisted_dataset';
2877
+ type PlayDatasetMaterializeOptions = {
2878
+ /** Rows returned by this operation, or every current row in its persisted dataset. */
2879
+ scope?: PlayDatasetMaterializeScope;
2880
+ /** Maximum number of rows to load into memory. */
2881
+ limit?: number;
2882
+ };
2869
2883
 
2870
2884
  type ToolResultExecutionMetadata = {
2871
2885
  idempotent: true;
@@ -3038,6 +3052,8 @@ type PlayBindings = {
3038
3052
  * older clients can continue to register revisions during the migration.
3039
3053
  */
3040
3054
  description?: string;
3055
+ /** Allow compilers to bundle this named handler directly without a child run. */
3056
+ inline?: boolean;
3041
3057
  /** Optional per-run billing controls enforced by the runtime. */
3042
3058
  billing?: {
3043
3059
  /** Stop the run before a billed action would push total run credits above this cap. */
@@ -3219,7 +3235,7 @@ type StepOptions<Row, Value = unknown> = {
3219
3235
  * Legacy dataset-column recompute flag accepted for older authored plays.
3220
3236
  *
3221
3237
  * Prefer putting freshness on the actual reusable call
3222
- * (`ctx.tools.execute`, `ctx.step`, `ctx.fetch`, or `ctx.runPlay`).
3238
+ * (`ctx.tools.execute`, `ctx.step`, or `ctx.fetch`).
3223
3239
  */
3224
3240
  readonly recompute?: boolean;
3225
3241
  /** Legacy error-recompute flag accepted for older authored plays. */
@@ -3607,7 +3623,6 @@ interface DeeplinePlayRuntimeContext {
3607
3623
  */
3608
3624
  runPlay<TOutput = unknown>(key: string, playRef: string | PlayReferenceLike, input: Record<string, unknown>, options: {
3609
3625
  description: string;
3610
- staleAfterSeconds?: number;
3611
3626
  }): Promise<TOutput>;
3612
3627
  /**
3613
3628
  * Emit a log line visible in `play tail` and the play's progress logs.
package/dist/index.js CHANGED
@@ -422,10 +422,10 @@ var SDK_RELEASE = {
422
422
  // 0.1.154 removes the short-lived generated enrich StepOptions recompute
423
423
  // fields shipped in 0.1.153.
424
424
  // 0.1.175 ships loud `deepline enrich` empty-waterfall reporting.
425
- version: "0.1.209",
425
+ version: "0.1.211",
426
426
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
427
427
  supportPolicy: {
428
- latest: "0.1.209",
428
+ latest: "0.1.211",
429
429
  minimumSupported: "0.1.53",
430
430
  deprecatedBelow: "0.1.53",
431
431
  commandMinimumSupported: [
@@ -4485,16 +4485,33 @@ var DeferredPlayDataset = class {
4485
4485
  take(limit, options) {
4486
4486
  return this.slice(0, limit, options);
4487
4487
  }
4488
- async materialize(limit) {
4488
+ async materialize(options) {
4489
+ const scope = typeof options === "object" ? options.scope ?? "result" : "result";
4490
+ const limit = typeof options === "number" ? options : options?.limit;
4489
4491
  const requestedLimit = limit !== void 0 ? Math.max(0, Math.floor(limit)) : void 0;
4490
4492
  const cap = resolveMaterializeLimitCap();
4493
+ const materialize = scope === "full_persisted_dataset" ? this.resolvers.materializeFullPersistedDataset : this.resolvers.materialize;
4494
+ if (!materialize) {
4495
+ throw new Error(
4496
+ 'PlayDataset.materialize({ scope: "full_persisted_dataset" }) is only available for a persisted dataset returned by ctx.dataset(...).run().'
4497
+ );
4498
+ }
4491
4499
  if (requestedLimit !== void 0) {
4492
4500
  if (requestedLimit > cap) {
4493
4501
  throw new Error(
4494
4502
  `PlayDataset.materialize(${requestedLimit}) exceeds the hard limit of ${cap} rows. Return the dataset handle instead, or request a smaller bounded slice.`
4495
4503
  );
4496
4504
  }
4497
- return await this.resolvers.materialize(requestedLimit);
4505
+ return await materialize(requestedLimit);
4506
+ }
4507
+ if (scope === "full_persisted_dataset") {
4508
+ const rows = await materialize(cap + 1);
4509
+ if (rows.length > cap) {
4510
+ throw new Error(
4511
+ `PlayDataset.materialize({ scope: "full_persisted_dataset" }) refuses to load more than ${cap} rows into memory. Pass an explicit bounded limit.`
4512
+ );
4513
+ }
4514
+ return rows;
4498
4515
  }
4499
4516
  const count = await this.count();
4500
4517
  if (count > cap) {
@@ -4502,7 +4519,7 @@ var DeferredPlayDataset = class {
4502
4519
  `PlayDataset.materialize() refuses to load ${count} rows into memory. The hard limit is ${cap}. Return the dataset handle instead or call materialize(limit).`
4503
4520
  );
4504
4521
  }
4505
- return await this.resolvers.materialize();
4522
+ return await materialize();
4506
4523
  }
4507
4524
  async *[Symbol.asyncIterator]() {
4508
4525
  for await (const row of this.resolvers.iterate()) {
package/dist/index.mjs CHANGED
@@ -352,10 +352,10 @@ var SDK_RELEASE = {
352
352
  // 0.1.154 removes the short-lived generated enrich StepOptions recompute
353
353
  // fields shipped in 0.1.153.
354
354
  // 0.1.175 ships loud `deepline enrich` empty-waterfall reporting.
355
- version: "0.1.209",
355
+ version: "0.1.211",
356
356
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
357
357
  supportPolicy: {
358
- latest: "0.1.209",
358
+ latest: "0.1.211",
359
359
  minimumSupported: "0.1.53",
360
360
  deprecatedBelow: "0.1.53",
361
361
  commandMinimumSupported: [
@@ -4415,16 +4415,33 @@ var DeferredPlayDataset = class {
4415
4415
  take(limit, options) {
4416
4416
  return this.slice(0, limit, options);
4417
4417
  }
4418
- async materialize(limit) {
4418
+ async materialize(options) {
4419
+ const scope = typeof options === "object" ? options.scope ?? "result" : "result";
4420
+ const limit = typeof options === "number" ? options : options?.limit;
4419
4421
  const requestedLimit = limit !== void 0 ? Math.max(0, Math.floor(limit)) : void 0;
4420
4422
  const cap = resolveMaterializeLimitCap();
4423
+ const materialize = scope === "full_persisted_dataset" ? this.resolvers.materializeFullPersistedDataset : this.resolvers.materialize;
4424
+ if (!materialize) {
4425
+ throw new Error(
4426
+ 'PlayDataset.materialize({ scope: "full_persisted_dataset" }) is only available for a persisted dataset returned by ctx.dataset(...).run().'
4427
+ );
4428
+ }
4421
4429
  if (requestedLimit !== void 0) {
4422
4430
  if (requestedLimit > cap) {
4423
4431
  throw new Error(
4424
4432
  `PlayDataset.materialize(${requestedLimit}) exceeds the hard limit of ${cap} rows. Return the dataset handle instead, or request a smaller bounded slice.`
4425
4433
  );
4426
4434
  }
4427
- return await this.resolvers.materialize(requestedLimit);
4435
+ return await materialize(requestedLimit);
4436
+ }
4437
+ if (scope === "full_persisted_dataset") {
4438
+ const rows = await materialize(cap + 1);
4439
+ if (rows.length > cap) {
4440
+ throw new Error(
4441
+ `PlayDataset.materialize({ scope: "full_persisted_dataset" }) refuses to load more than ${cap} rows into memory. Pass an explicit bounded limit.`
4442
+ );
4443
+ }
4444
+ return rows;
4428
4445
  }
4429
4446
  const count = await this.count();
4430
4447
  if (count > cap) {
@@ -4432,7 +4449,7 @@ var DeferredPlayDataset = class {
4432
4449
  `PlayDataset.materialize() refuses to load ${count} rows into memory. The hard limit is ${cap}. Return the dataset handle instead or call materialize(limit).`
4433
4450
  );
4434
4451
  }
4435
- return await this.resolvers.materialize();
4452
+ return await materialize();
4436
4453
  }
4437
4454
  async *[Symbol.asyncIterator]() {
4438
4455
  for await (const row of this.resolvers.iterate()) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.209",
3
+ "version": "0.1.211",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {