deepline 0.1.169 → 0.1.171

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.
@@ -28,6 +28,8 @@ export interface ToolCallRequest {
28
28
  fieldName?: string;
29
29
  toolId: string;
30
30
  input: Record<string, unknown>;
31
+ timeoutMs?: number;
32
+ receiptWaitMs?: number;
31
33
  tableNamespace?: string;
32
34
  rowKey?: string | null;
33
35
  description?: string;
@@ -169,6 +171,8 @@ export interface ToolCallOptions {
169
171
  description?: string;
170
172
  force?: boolean;
171
173
  staleAfterSeconds?: number;
174
+ timeoutMs?: number;
175
+ receiptWaitMs?: number;
172
176
  }
173
177
 
174
178
  export interface ToolExecutionRequest {
@@ -178,6 +182,8 @@ export interface ToolExecutionRequest {
178
182
  description?: string;
179
183
  force?: boolean;
180
184
  staleAfterSeconds?: number;
185
+ timeoutMs?: number;
186
+ receiptWaitMs?: number;
181
187
  }
182
188
 
183
189
  export type SqlQuery = {
@@ -453,9 +459,7 @@ export interface ContextOptions {
453
459
  getToolRetryPolicy?: (toolId: string) => Promise<{
454
460
  retrySafeTransientHttp?: boolean;
455
461
  } | null>;
456
- getToolActionCacheVersion?: (
457
- toolId: string,
458
- ) => Promise<string> | string;
462
+ getToolActionCacheVersion?: (toolId: string) => Promise<string> | string;
459
463
  getToolTargetGetters?: (
460
464
  toolId: string,
461
465
  output: string,
package/dist/cli/index.js CHANGED
@@ -622,10 +622,10 @@ var SDK_RELEASE = {
622
622
  // 0.1.111 ships dataset-native tool list getters and result row datasets.
623
623
  // 0.1.154 removes the short-lived generated enrich StepOptions recompute
624
624
  // fields shipped in 0.1.153.
625
- version: "0.1.169",
625
+ version: "0.1.171",
626
626
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
627
627
  supportPolicy: {
628
- latest: "0.1.169",
628
+ latest: "0.1.171",
629
629
  minimumSupported: "0.1.53",
630
630
  deprecatedBelow: "0.1.53",
631
631
  commandMinimumSupported: [
@@ -16820,6 +16820,7 @@ function helperSource() {
16820
16820
  // src/cli/commands/enrich.ts
16821
16821
  var ENRICH_EXPORT_PAGE_SIZE = 5e3;
16822
16822
  var ENRICH_AUTO_BATCH_ROWS = 250;
16823
+ var ENRICH_HEAVY_PLAY_AUTO_BATCH_ROWS = 40;
16823
16824
  var ENRICH_EXPORT_BACKING_ROWS_WAIT_MS = 6e4;
16824
16825
  var ENRICH_EXPORT_BACKING_ROWS_POLL_MS = 1e3;
16825
16826
  var ENRICH_SOURCE_ROW_INDEX_COLUMN = "__deeplineSourceRowIndex";
@@ -16829,6 +16830,11 @@ var ENRICH_CELL_META_PATCH_FIELD = "__deeplineCellMetaPatch";
16829
16830
  var EXIT_SERVER2 = 5;
16830
16831
  var ENRICH_DEBUG_T0 = Date.now();
16831
16832
  var GENERATED_ENRICH_ROWS_TABLE_NAMESPACE = "deepline_enrich_rows";
16833
+ var HEAVY_ENRICH_AUTO_BATCH_PLAYS = /* @__PURE__ */ new Set([
16834
+ "company-to-contact",
16835
+ "company-to-contact-by-role-waterfall",
16836
+ "company_to_contact_by_role_waterfall"
16837
+ ]);
16832
16838
  var PLAN_SHAPING_OPTION_NAMES = [
16833
16839
  "with",
16834
16840
  "withWaterfall",
@@ -17605,6 +17611,52 @@ async function writeOutputCsv(outputPath, status, options) {
17605
17611
  function isMissingRowsForCsvExportError(error) {
17606
17612
  return error instanceof Error && (error.message.includes("did not return row-shaped output") || error.message.includes("run returned 0 preview row(s)"));
17607
17613
  }
17614
+ function normalizeEnrichPlayRef(value) {
17615
+ if (typeof value !== "string") {
17616
+ return null;
17617
+ }
17618
+ const normalized = value.trim().toLowerCase().replace(/^prebuilt\//, "");
17619
+ return normalized || null;
17620
+ }
17621
+ function configContainsHeavyEnrichPlay(config) {
17622
+ let hasNestedPlayStep = false;
17623
+ let hasSubrequestProviderStep = false;
17624
+ const visit = (commands) => {
17625
+ for (const command of commands) {
17626
+ if ("with_waterfall" in command) {
17627
+ if (visit(command.commands)) {
17628
+ return true;
17629
+ }
17630
+ continue;
17631
+ }
17632
+ if (command.disabled) {
17633
+ continue;
17634
+ }
17635
+ const candidates = [
17636
+ command.tool,
17637
+ command.operation,
17638
+ command.play?.ref,
17639
+ command.play?.ref?.replace(/^prebuilt\//, "")
17640
+ ];
17641
+ if (candidates.map(normalizeEnrichPlayRef).some(
17642
+ (candidate) => candidate !== null && HEAVY_ENRICH_AUTO_BATCH_PLAYS.has(candidate)
17643
+ )) {
17644
+ return true;
17645
+ }
17646
+ const normalizedTool = normalizeEnrichPlayRef(command.tool);
17647
+ if (command.play || normalizedTool === "test-play") {
17648
+ hasNestedPlayStep = true;
17649
+ } else if (normalizedTool !== null && normalizedTool !== "run_javascript") {
17650
+ hasSubrequestProviderStep = true;
17651
+ }
17652
+ }
17653
+ return false;
17654
+ };
17655
+ return visit(config.commands) || hasNestedPlayStep && hasSubrequestProviderStep;
17656
+ }
17657
+ function enrichAutoBatchRowsForConfig(config) {
17658
+ return configContainsHeavyEnrichPlay(config) ? ENRICH_HEAVY_PLAY_AUTO_BATCH_ROWS : ENRICH_AUTO_BATCH_ROWS;
17659
+ }
17608
17660
  async function maybeWriteOutputCsv(input2) {
17609
17661
  if (!input2.outputPath) return null;
17610
17662
  try {
@@ -18503,7 +18555,7 @@ async function maybeEmitEnrichFailureReport(input2) {
18503
18555
  const jobs = rowJobs.length > 0 || input2.status === void 0 ? rowJobs : collectStatusFailureJobs({
18504
18556
  config: input2.config,
18505
18557
  status: input2.status,
18506
- rowRange: input2.rowRange
18558
+ rowRange: input2.statusRowRange ?? input2.rowRange
18507
18559
  });
18508
18560
  if (jobs.length === 0) {
18509
18561
  return null;
@@ -19238,13 +19290,12 @@ function registerEnrichCommand(program) {
19238
19290
  return { captured: captured2, status: status2, exportResult: exportResult2 };
19239
19291
  };
19240
19292
  const selectedRange = selectedSourceCsvRange(sourceCsvPath, rows);
19241
- if (outputPath && selectedRange.count > ENRICH_AUTO_BATCH_ROWS) {
19242
- const chunkCount = Math.ceil(
19243
- selectedRange.count / ENRICH_AUTO_BATCH_ROWS
19244
- );
19293
+ const autoBatchRows = enrichAutoBatchRowsForConfig(config);
19294
+ if (outputPath && selectedRange.count > autoBatchRows) {
19295
+ const chunkCount = Math.ceil(selectedRange.count / autoBatchRows);
19245
19296
  if (!options.json) {
19246
19297
  process.stderr.write(
19247
- `Large enrich input selected ${selectedRange.count.toLocaleString()} rows. Running ${chunkCount.toLocaleString()} sequential batch runs of up to ${ENRICH_AUTO_BATCH_ROWS.toLocaleString()} rows and merging ${(0, import_node_path12.resolve)(outputPath)}.
19298
+ `Large enrich input selected ${selectedRange.count.toLocaleString()} rows. Running ${chunkCount.toLocaleString()} sequential batch runs of up to ${autoBatchRows.toLocaleString()} rows and merging ${(0, import_node_path12.resolve)(outputPath)}.
19248
19299
  `
19249
19300
  );
19250
19301
  }
@@ -19253,12 +19304,12 @@ function registerEnrichCommand(program) {
19253
19304
  let finalExportResult = null;
19254
19305
  let totalEnrichedRows = 0;
19255
19306
  const batchFailureRows = [];
19256
- for (let chunkStart = selectedRange.start, chunkIndex = 0; chunkStart <= selectedRange.end; chunkStart += ENRICH_AUTO_BATCH_ROWS, chunkIndex += 1) {
19307
+ for (let chunkStart = selectedRange.start, chunkIndex = 0; chunkStart <= selectedRange.end; chunkStart += autoBatchRows, chunkIndex += 1) {
19257
19308
  const chunkRows = {
19258
19309
  rowStart: chunkStart,
19259
19310
  rowEnd: Math.min(
19260
19311
  selectedRange.end,
19261
- chunkStart + ENRICH_AUTO_BATCH_ROWS - 1
19312
+ chunkStart + autoBatchRows - 1
19262
19313
  )
19263
19314
  };
19264
19315
  if (!options.json) {
@@ -19276,6 +19327,24 @@ function registerEnrichCommand(program) {
19276
19327
  });
19277
19328
  lastStatus = chunk.status;
19278
19329
  if (chunk.captured.result !== 0) {
19330
+ if (chunk.exportResult) {
19331
+ finalExportResult = chunk.exportResult;
19332
+ totalEnrichedRows += chunk.exportResult.enrichedRows;
19333
+ batchFailureRows.push(...chunk.exportResult.enrichedDataRows);
19334
+ }
19335
+ const failureReport3 = await maybeEmitEnrichFailureReport({
19336
+ config,
19337
+ rows: batchFailureRows,
19338
+ rowRange: {
19339
+ rowStart: selectedRange.start,
19340
+ rowEnd: selectedRange.end
19341
+ },
19342
+ statusRowRange: chunkRows,
19343
+ client: client2,
19344
+ outputPath: failureReportOutputPath ?? finalExportResult?.path ?? outputPath,
19345
+ status: chunk.status
19346
+ });
19347
+ const committedExportResult2 = finalExportResult ? await commitInPlaceOutput(finalExportResult) : null;
19279
19348
  if (options.json) {
19280
19349
  printJson({
19281
19350
  ok: false,
@@ -19285,12 +19354,27 @@ function registerEnrichCommand(program) {
19285
19354
  rows: chunkRows
19286
19355
  },
19287
19356
  result: chunk.status,
19288
- output: options.inPlace ? null : enrichOutputJson(chunk.exportResult)
19357
+ output: committedExportResult2 ? {
19358
+ sourceCsvRows: selectedRange.sourceRows,
19359
+ selectedRows: selectedRange.count,
19360
+ enrichedRows: totalEnrichedRows,
19361
+ path: committedExportResult2.path,
19362
+ ...committedExportResult2.partial ? {
19363
+ rows: committedExportResult2.rows,
19364
+ partial: true
19365
+ } : {}
19366
+ } : null,
19367
+ ...failureReport3 ? {
19368
+ failure_report: {
19369
+ path: failureReport3.path,
19370
+ jobs: failureReport3.jobs.length
19371
+ }
19372
+ } : {}
19289
19373
  });
19290
19374
  } else {
19291
- if (chunk.exportResult && !options.inPlace) {
19375
+ if (committedExportResult2) {
19292
19376
  process.stderr.write(
19293
- `Wrote ${chunk.exportResult.rows} row(s) to ${chunk.exportResult.path}${chunk.exportResult.partial ? " (partial run output)" : ""}
19377
+ `Wrote ${committedExportResult2.rows} row(s) to ${committedExportResult2.path}${committedExportResult2.partial ? " (partial run output)" : ""}
19294
19378
  `
19295
19379
  );
19296
19380
  }
@@ -19301,7 +19385,7 @@ function registerEnrichCommand(program) {
19301
19385
  status: chunk.status
19302
19386
  });
19303
19387
  }
19304
- process.exitCode = chunk.captured.result;
19388
+ process.exitCode = failureReport3 ? EXIT_SERVER2 : chunk.captured.result;
19305
19389
  return;
19306
19390
  }
19307
19391
  if (chunk.exportResult) {
@@ -19323,15 +19407,13 @@ function registerEnrichCommand(program) {
19323
19407
  outputPath: failureReportOutputPath ?? finalExportResult?.path ?? outputPath,
19324
19408
  status: lastStatus
19325
19409
  });
19326
- if (!failureReport2) {
19327
- finalExportResult = await commitInPlaceOutput(finalExportResult);
19328
- }
19410
+ finalExportResult = await commitInPlaceOutput(finalExportResult);
19329
19411
  if (options.json) {
19330
19412
  const run = rewriteEnrichJsonStatus({
19331
19413
  status: lastStatus,
19332
19414
  config,
19333
19415
  forceAliases,
19334
- output: finalExportResult && (!failureReport2 || !options.inPlace) ? {
19416
+ output: finalExportResult ? {
19335
19417
  ...finalExportResult,
19336
19418
  sourceCsvRows: selectedRange.sourceRows,
19337
19419
  selectedRows: selectedRange.count,
@@ -19346,10 +19428,10 @@ function registerEnrichCommand(program) {
19346
19428
  run,
19347
19429
  batch: {
19348
19430
  chunks: chunkCount,
19349
- chunkRows: ENRICH_AUTO_BATCH_ROWS,
19431
+ chunkRows: autoBatchRows,
19350
19432
  selectedRows: selectedRange.count
19351
19433
  },
19352
- output: finalExportResult && (!failureReport2 || !options.inPlace) ? {
19434
+ output: finalExportResult ? {
19353
19435
  sourceCsvRows: selectedRange.sourceRows,
19354
19436
  selectedRows: selectedRange.count,
19355
19437
  enrichedRows: totalEnrichedRows,
@@ -19376,9 +19458,10 @@ function registerEnrichCommand(program) {
19376
19458
  });
19377
19459
  const rowsForFailureReport = exportResult?.enrichedDataRows ?? extractCanonicalRowsInfo(status)?.rows ?? [];
19378
19460
  if (captured.result !== 0) {
19379
- if (exportResult && !options.inPlace) {
19461
+ const committedExportResult2 = exportResult ? await commitInPlaceOutput(exportResult) : null;
19462
+ if (committedExportResult2) {
19380
19463
  process.stderr.write(
19381
- `Wrote ${exportResult.rows} row(s) to ${exportResult.path}${exportResult.partial ? " (partial run output)" : ""}
19464
+ `Wrote ${committedExportResult2.rows} row(s) to ${committedExportResult2.path}${committedExportResult2.partial ? " (partial run output)" : ""}
19382
19465
  `
19383
19466
  );
19384
19467
  }
@@ -19387,7 +19470,7 @@ function registerEnrichCommand(program) {
19387
19470
  rows: rowsForFailureReport,
19388
19471
  rowRange: rows,
19389
19472
  client: client2,
19390
- exportResult,
19473
+ exportResult: committedExportResult2,
19391
19474
  outputPath,
19392
19475
  reportOutputPath: failureReportOutputPath,
19393
19476
  status
@@ -19396,7 +19479,7 @@ function registerEnrichCommand(program) {
19396
19479
  printJson({
19397
19480
  ok: false,
19398
19481
  run: status,
19399
- output: options.inPlace ? null : enrichOutputJson(exportResult),
19482
+ output: enrichOutputJson(committedExportResult2),
19400
19483
  ...failureReport2 ? {
19401
19484
  failure_report: {
19402
19485
  path: failureReport2.path,
@@ -19419,18 +19502,18 @@ function registerEnrichCommand(program) {
19419
19502
  reportOutputPath: failureReportOutputPath,
19420
19503
  status
19421
19504
  });
19422
- const committedExportResult2 = failureReport2 ? exportResult : await commitInPlaceOutput(exportResult);
19505
+ const committedExportResult2 = await commitInPlaceOutput(exportResult);
19423
19506
  const run = rewriteEnrichJsonStatus({
19424
19507
  status,
19425
19508
  config,
19426
19509
  forceAliases,
19427
- output: failureReport2 && options.inPlace ? null : committedExportResult2,
19510
+ output: committedExportResult2,
19428
19511
  failureReport: failureReport2
19429
19512
  });
19430
19513
  printJson({
19431
19514
  ok: !failureReport2,
19432
19515
  run,
19433
- output: failureReport2 && options.inPlace ? null : enrichOutputJson(committedExportResult2),
19516
+ output: enrichOutputJson(committedExportResult2),
19434
19517
  ...failureReport2 ? {
19435
19518
  failure_report: {
19436
19519
  path: failureReport2.path,
@@ -19451,7 +19534,7 @@ function registerEnrichCommand(program) {
19451
19534
  outputPath: failureReportOutputPath ?? exportResult?.path ?? null,
19452
19535
  status
19453
19536
  });
19454
- const committedExportResult = failureReport ? options.inPlace ? null : exportResult : await commitInPlaceOutput(exportResult);
19537
+ const committedExportResult = await commitInPlaceOutput(exportResult);
19455
19538
  if (committedExportResult) {
19456
19539
  process.stderr.write(
19457
19540
  `Wrote ${committedExportResult.rows} row(s) to ${committedExportResult.path}
@@ -607,10 +607,10 @@ var SDK_RELEASE = {
607
607
  // 0.1.111 ships dataset-native tool list getters and result row datasets.
608
608
  // 0.1.154 removes the short-lived generated enrich StepOptions recompute
609
609
  // fields shipped in 0.1.153.
610
- version: "0.1.169",
610
+ version: "0.1.171",
611
611
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
612
612
  supportPolicy: {
613
- latest: "0.1.169",
613
+ latest: "0.1.171",
614
614
  minimumSupported: "0.1.53",
615
615
  deprecatedBelow: "0.1.53",
616
616
  commandMinimumSupported: [
@@ -16847,6 +16847,7 @@ function helperSource() {
16847
16847
  // src/cli/commands/enrich.ts
16848
16848
  var ENRICH_EXPORT_PAGE_SIZE = 5e3;
16849
16849
  var ENRICH_AUTO_BATCH_ROWS = 250;
16850
+ var ENRICH_HEAVY_PLAY_AUTO_BATCH_ROWS = 40;
16850
16851
  var ENRICH_EXPORT_BACKING_ROWS_WAIT_MS = 6e4;
16851
16852
  var ENRICH_EXPORT_BACKING_ROWS_POLL_MS = 1e3;
16852
16853
  var ENRICH_SOURCE_ROW_INDEX_COLUMN = "__deeplineSourceRowIndex";
@@ -16856,6 +16857,11 @@ var ENRICH_CELL_META_PATCH_FIELD = "__deeplineCellMetaPatch";
16856
16857
  var EXIT_SERVER2 = 5;
16857
16858
  var ENRICH_DEBUG_T0 = Date.now();
16858
16859
  var GENERATED_ENRICH_ROWS_TABLE_NAMESPACE = "deepline_enrich_rows";
16860
+ var HEAVY_ENRICH_AUTO_BATCH_PLAYS = /* @__PURE__ */ new Set([
16861
+ "company-to-contact",
16862
+ "company-to-contact-by-role-waterfall",
16863
+ "company_to_contact_by_role_waterfall"
16864
+ ]);
16859
16865
  var PLAN_SHAPING_OPTION_NAMES = [
16860
16866
  "with",
16861
16867
  "withWaterfall",
@@ -17632,6 +17638,52 @@ async function writeOutputCsv(outputPath, status, options) {
17632
17638
  function isMissingRowsForCsvExportError(error) {
17633
17639
  return error instanceof Error && (error.message.includes("did not return row-shaped output") || error.message.includes("run returned 0 preview row(s)"));
17634
17640
  }
17641
+ function normalizeEnrichPlayRef(value) {
17642
+ if (typeof value !== "string") {
17643
+ return null;
17644
+ }
17645
+ const normalized = value.trim().toLowerCase().replace(/^prebuilt\//, "");
17646
+ return normalized || null;
17647
+ }
17648
+ function configContainsHeavyEnrichPlay(config) {
17649
+ let hasNestedPlayStep = false;
17650
+ let hasSubrequestProviderStep = false;
17651
+ const visit = (commands) => {
17652
+ for (const command of commands) {
17653
+ if ("with_waterfall" in command) {
17654
+ if (visit(command.commands)) {
17655
+ return true;
17656
+ }
17657
+ continue;
17658
+ }
17659
+ if (command.disabled) {
17660
+ continue;
17661
+ }
17662
+ const candidates = [
17663
+ command.tool,
17664
+ command.operation,
17665
+ command.play?.ref,
17666
+ command.play?.ref?.replace(/^prebuilt\//, "")
17667
+ ];
17668
+ if (candidates.map(normalizeEnrichPlayRef).some(
17669
+ (candidate) => candidate !== null && HEAVY_ENRICH_AUTO_BATCH_PLAYS.has(candidate)
17670
+ )) {
17671
+ return true;
17672
+ }
17673
+ const normalizedTool = normalizeEnrichPlayRef(command.tool);
17674
+ if (command.play || normalizedTool === "test-play") {
17675
+ hasNestedPlayStep = true;
17676
+ } else if (normalizedTool !== null && normalizedTool !== "run_javascript") {
17677
+ hasSubrequestProviderStep = true;
17678
+ }
17679
+ }
17680
+ return false;
17681
+ };
17682
+ return visit(config.commands) || hasNestedPlayStep && hasSubrequestProviderStep;
17683
+ }
17684
+ function enrichAutoBatchRowsForConfig(config) {
17685
+ return configContainsHeavyEnrichPlay(config) ? ENRICH_HEAVY_PLAY_AUTO_BATCH_ROWS : ENRICH_AUTO_BATCH_ROWS;
17686
+ }
17635
17687
  async function maybeWriteOutputCsv(input2) {
17636
17688
  if (!input2.outputPath) return null;
17637
17689
  try {
@@ -18530,7 +18582,7 @@ async function maybeEmitEnrichFailureReport(input2) {
18530
18582
  const jobs = rowJobs.length > 0 || input2.status === void 0 ? rowJobs : collectStatusFailureJobs({
18531
18583
  config: input2.config,
18532
18584
  status: input2.status,
18533
- rowRange: input2.rowRange
18585
+ rowRange: input2.statusRowRange ?? input2.rowRange
18534
18586
  });
18535
18587
  if (jobs.length === 0) {
18536
18588
  return null;
@@ -19265,13 +19317,12 @@ function registerEnrichCommand(program) {
19265
19317
  return { captured: captured2, status: status2, exportResult: exportResult2 };
19266
19318
  };
19267
19319
  const selectedRange = selectedSourceCsvRange(sourceCsvPath, rows);
19268
- if (outputPath && selectedRange.count > ENRICH_AUTO_BATCH_ROWS) {
19269
- const chunkCount = Math.ceil(
19270
- selectedRange.count / ENRICH_AUTO_BATCH_ROWS
19271
- );
19320
+ const autoBatchRows = enrichAutoBatchRowsForConfig(config);
19321
+ if (outputPath && selectedRange.count > autoBatchRows) {
19322
+ const chunkCount = Math.ceil(selectedRange.count / autoBatchRows);
19272
19323
  if (!options.json) {
19273
19324
  process.stderr.write(
19274
- `Large enrich input selected ${selectedRange.count.toLocaleString()} rows. Running ${chunkCount.toLocaleString()} sequential batch runs of up to ${ENRICH_AUTO_BATCH_ROWS.toLocaleString()} rows and merging ${resolve9(outputPath)}.
19325
+ `Large enrich input selected ${selectedRange.count.toLocaleString()} rows. Running ${chunkCount.toLocaleString()} sequential batch runs of up to ${autoBatchRows.toLocaleString()} rows and merging ${resolve9(outputPath)}.
19275
19326
  `
19276
19327
  );
19277
19328
  }
@@ -19280,12 +19331,12 @@ function registerEnrichCommand(program) {
19280
19331
  let finalExportResult = null;
19281
19332
  let totalEnrichedRows = 0;
19282
19333
  const batchFailureRows = [];
19283
- for (let chunkStart = selectedRange.start, chunkIndex = 0; chunkStart <= selectedRange.end; chunkStart += ENRICH_AUTO_BATCH_ROWS, chunkIndex += 1) {
19334
+ for (let chunkStart = selectedRange.start, chunkIndex = 0; chunkStart <= selectedRange.end; chunkStart += autoBatchRows, chunkIndex += 1) {
19284
19335
  const chunkRows = {
19285
19336
  rowStart: chunkStart,
19286
19337
  rowEnd: Math.min(
19287
19338
  selectedRange.end,
19288
- chunkStart + ENRICH_AUTO_BATCH_ROWS - 1
19339
+ chunkStart + autoBatchRows - 1
19289
19340
  )
19290
19341
  };
19291
19342
  if (!options.json) {
@@ -19303,6 +19354,24 @@ function registerEnrichCommand(program) {
19303
19354
  });
19304
19355
  lastStatus = chunk.status;
19305
19356
  if (chunk.captured.result !== 0) {
19357
+ if (chunk.exportResult) {
19358
+ finalExportResult = chunk.exportResult;
19359
+ totalEnrichedRows += chunk.exportResult.enrichedRows;
19360
+ batchFailureRows.push(...chunk.exportResult.enrichedDataRows);
19361
+ }
19362
+ const failureReport3 = await maybeEmitEnrichFailureReport({
19363
+ config,
19364
+ rows: batchFailureRows,
19365
+ rowRange: {
19366
+ rowStart: selectedRange.start,
19367
+ rowEnd: selectedRange.end
19368
+ },
19369
+ statusRowRange: chunkRows,
19370
+ client: client2,
19371
+ outputPath: failureReportOutputPath ?? finalExportResult?.path ?? outputPath,
19372
+ status: chunk.status
19373
+ });
19374
+ const committedExportResult2 = finalExportResult ? await commitInPlaceOutput(finalExportResult) : null;
19306
19375
  if (options.json) {
19307
19376
  printJson({
19308
19377
  ok: false,
@@ -19312,12 +19381,27 @@ function registerEnrichCommand(program) {
19312
19381
  rows: chunkRows
19313
19382
  },
19314
19383
  result: chunk.status,
19315
- output: options.inPlace ? null : enrichOutputJson(chunk.exportResult)
19384
+ output: committedExportResult2 ? {
19385
+ sourceCsvRows: selectedRange.sourceRows,
19386
+ selectedRows: selectedRange.count,
19387
+ enrichedRows: totalEnrichedRows,
19388
+ path: committedExportResult2.path,
19389
+ ...committedExportResult2.partial ? {
19390
+ rows: committedExportResult2.rows,
19391
+ partial: true
19392
+ } : {}
19393
+ } : null,
19394
+ ...failureReport3 ? {
19395
+ failure_report: {
19396
+ path: failureReport3.path,
19397
+ jobs: failureReport3.jobs.length
19398
+ }
19399
+ } : {}
19316
19400
  });
19317
19401
  } else {
19318
- if (chunk.exportResult && !options.inPlace) {
19402
+ if (committedExportResult2) {
19319
19403
  process.stderr.write(
19320
- `Wrote ${chunk.exportResult.rows} row(s) to ${chunk.exportResult.path}${chunk.exportResult.partial ? " (partial run output)" : ""}
19404
+ `Wrote ${committedExportResult2.rows} row(s) to ${committedExportResult2.path}${committedExportResult2.partial ? " (partial run output)" : ""}
19321
19405
  `
19322
19406
  );
19323
19407
  }
@@ -19328,7 +19412,7 @@ function registerEnrichCommand(program) {
19328
19412
  status: chunk.status
19329
19413
  });
19330
19414
  }
19331
- process.exitCode = chunk.captured.result;
19415
+ process.exitCode = failureReport3 ? EXIT_SERVER2 : chunk.captured.result;
19332
19416
  return;
19333
19417
  }
19334
19418
  if (chunk.exportResult) {
@@ -19350,15 +19434,13 @@ function registerEnrichCommand(program) {
19350
19434
  outputPath: failureReportOutputPath ?? finalExportResult?.path ?? outputPath,
19351
19435
  status: lastStatus
19352
19436
  });
19353
- if (!failureReport2) {
19354
- finalExportResult = await commitInPlaceOutput(finalExportResult);
19355
- }
19437
+ finalExportResult = await commitInPlaceOutput(finalExportResult);
19356
19438
  if (options.json) {
19357
19439
  const run = rewriteEnrichJsonStatus({
19358
19440
  status: lastStatus,
19359
19441
  config,
19360
19442
  forceAliases,
19361
- output: finalExportResult && (!failureReport2 || !options.inPlace) ? {
19443
+ output: finalExportResult ? {
19362
19444
  ...finalExportResult,
19363
19445
  sourceCsvRows: selectedRange.sourceRows,
19364
19446
  selectedRows: selectedRange.count,
@@ -19373,10 +19455,10 @@ function registerEnrichCommand(program) {
19373
19455
  run,
19374
19456
  batch: {
19375
19457
  chunks: chunkCount,
19376
- chunkRows: ENRICH_AUTO_BATCH_ROWS,
19458
+ chunkRows: autoBatchRows,
19377
19459
  selectedRows: selectedRange.count
19378
19460
  },
19379
- output: finalExportResult && (!failureReport2 || !options.inPlace) ? {
19461
+ output: finalExportResult ? {
19380
19462
  sourceCsvRows: selectedRange.sourceRows,
19381
19463
  selectedRows: selectedRange.count,
19382
19464
  enrichedRows: totalEnrichedRows,
@@ -19403,9 +19485,10 @@ function registerEnrichCommand(program) {
19403
19485
  });
19404
19486
  const rowsForFailureReport = exportResult?.enrichedDataRows ?? extractCanonicalRowsInfo(status)?.rows ?? [];
19405
19487
  if (captured.result !== 0) {
19406
- if (exportResult && !options.inPlace) {
19488
+ const committedExportResult2 = exportResult ? await commitInPlaceOutput(exportResult) : null;
19489
+ if (committedExportResult2) {
19407
19490
  process.stderr.write(
19408
- `Wrote ${exportResult.rows} row(s) to ${exportResult.path}${exportResult.partial ? " (partial run output)" : ""}
19491
+ `Wrote ${committedExportResult2.rows} row(s) to ${committedExportResult2.path}${committedExportResult2.partial ? " (partial run output)" : ""}
19409
19492
  `
19410
19493
  );
19411
19494
  }
@@ -19414,7 +19497,7 @@ function registerEnrichCommand(program) {
19414
19497
  rows: rowsForFailureReport,
19415
19498
  rowRange: rows,
19416
19499
  client: client2,
19417
- exportResult,
19500
+ exportResult: committedExportResult2,
19418
19501
  outputPath,
19419
19502
  reportOutputPath: failureReportOutputPath,
19420
19503
  status
@@ -19423,7 +19506,7 @@ function registerEnrichCommand(program) {
19423
19506
  printJson({
19424
19507
  ok: false,
19425
19508
  run: status,
19426
- output: options.inPlace ? null : enrichOutputJson(exportResult),
19509
+ output: enrichOutputJson(committedExportResult2),
19427
19510
  ...failureReport2 ? {
19428
19511
  failure_report: {
19429
19512
  path: failureReport2.path,
@@ -19446,18 +19529,18 @@ function registerEnrichCommand(program) {
19446
19529
  reportOutputPath: failureReportOutputPath,
19447
19530
  status
19448
19531
  });
19449
- const committedExportResult2 = failureReport2 ? exportResult : await commitInPlaceOutput(exportResult);
19532
+ const committedExportResult2 = await commitInPlaceOutput(exportResult);
19450
19533
  const run = rewriteEnrichJsonStatus({
19451
19534
  status,
19452
19535
  config,
19453
19536
  forceAliases,
19454
- output: failureReport2 && options.inPlace ? null : committedExportResult2,
19537
+ output: committedExportResult2,
19455
19538
  failureReport: failureReport2
19456
19539
  });
19457
19540
  printJson({
19458
19541
  ok: !failureReport2,
19459
19542
  run,
19460
- output: failureReport2 && options.inPlace ? null : enrichOutputJson(committedExportResult2),
19543
+ output: enrichOutputJson(committedExportResult2),
19461
19544
  ...failureReport2 ? {
19462
19545
  failure_report: {
19463
19546
  path: failureReport2.path,
@@ -19478,7 +19561,7 @@ function registerEnrichCommand(program) {
19478
19561
  outputPath: failureReportOutputPath ?? exportResult?.path ?? null,
19479
19562
  status
19480
19563
  });
19481
- const committedExportResult = failureReport ? options.inPlace ? null : exportResult : await commitInPlaceOutput(exportResult);
19564
+ const committedExportResult = await commitInPlaceOutput(exportResult);
19482
19565
  if (committedExportResult) {
19483
19566
  process.stderr.write(
19484
19567
  `Wrote ${committedExportResult.rows} row(s) to ${committedExportResult.path}
package/dist/index.d.mts CHANGED
@@ -2948,6 +2948,10 @@ type ToolExecutionRequest = {
2948
2948
  force?: boolean;
2949
2949
  /** Numeric TTL in seconds for this tool checkpoint. */
2950
2950
  staleAfterSeconds?: number;
2951
+ /** Runtime transport timeout in milliseconds. This is not sent to the provider. */
2952
+ timeoutMs?: number;
2953
+ /** Follower wait budget in milliseconds before a running receipt is reclaimable. */
2954
+ receiptWaitMs?: number;
2951
2955
  };
2952
2956
  type StepResolver<Row, Value> = (row: Row, ctx: DeeplinePlayRuntimeContext, index: number, previousCell?: PreviousCell<Value>) => Value | Promise<Value>;
2953
2957
  /**
package/dist/index.d.ts CHANGED
@@ -2948,6 +2948,10 @@ type ToolExecutionRequest = {
2948
2948
  force?: boolean;
2949
2949
  /** Numeric TTL in seconds for this tool checkpoint. */
2950
2950
  staleAfterSeconds?: number;
2951
+ /** Runtime transport timeout in milliseconds. This is not sent to the provider. */
2952
+ timeoutMs?: number;
2953
+ /** Follower wait budget in milliseconds before a running receipt is reclaimable. */
2954
+ receiptWaitMs?: number;
2951
2955
  };
2952
2956
  type StepResolver<Row, Value> = (row: Row, ctx: DeeplinePlayRuntimeContext, index: number, previousCell?: PreviousCell<Value>) => Value | Promise<Value>;
2953
2957
  /**
package/dist/index.js CHANGED
@@ -421,10 +421,10 @@ var SDK_RELEASE = {
421
421
  // 0.1.111 ships dataset-native tool list getters and result row datasets.
422
422
  // 0.1.154 removes the short-lived generated enrich StepOptions recompute
423
423
  // fields shipped in 0.1.153.
424
- version: "0.1.169",
424
+ version: "0.1.171",
425
425
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
426
426
  supportPolicy: {
427
- latest: "0.1.169",
427
+ latest: "0.1.171",
428
428
  minimumSupported: "0.1.53",
429
429
  deprecatedBelow: "0.1.53",
430
430
  commandMinimumSupported: [
package/dist/index.mjs CHANGED
@@ -351,10 +351,10 @@ var SDK_RELEASE = {
351
351
  // 0.1.111 ships dataset-native tool list getters and result row datasets.
352
352
  // 0.1.154 removes the short-lived generated enrich StepOptions recompute
353
353
  // fields shipped in 0.1.153.
354
- version: "0.1.169",
354
+ version: "0.1.171",
355
355
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
356
356
  supportPolicy: {
357
- latest: "0.1.169",
357
+ latest: "0.1.171",
358
358
  minimumSupported: "0.1.53",
359
359
  deprecatedBelow: "0.1.53",
360
360
  commandMinimumSupported: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.169",
3
+ "version": "0.1.171",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {