deepline 0.1.89 → 0.1.91

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.
package/dist/cli/index.js CHANGED
@@ -229,10 +229,10 @@ var import_node_path2 = require("path");
229
229
 
230
230
  // src/release.ts
231
231
  var SDK_RELEASE = {
232
- version: "0.1.89",
232
+ version: "0.1.91",
233
233
  apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
234
234
  supportPolicy: {
235
- latest: "0.1.89",
235
+ latest: "0.1.91",
236
236
  minimumSupported: "0.1.53",
237
237
  deprecatedBelow: "0.1.53"
238
238
  }
@@ -9920,18 +9920,33 @@ function writePlayResult(status, jsonOutput, options) {
9920
9920
  ` }
9921
9921
  );
9922
9922
  }
9923
+ function playRunPackageStepCount(pkg) {
9924
+ if (!pkg) return 0;
9925
+ const steps = pkg.steps;
9926
+ return Array.isArray(steps) ? steps.length : 0;
9927
+ }
9923
9928
  async function resolvePlayRunOutputStatus(input2) {
9924
- if (!input2.fullJson || !getPlayRunPackage(input2.status)) {
9925
- return input2.status;
9926
- }
9927
9929
  const runId = input2.status.runId;
9928
9930
  if (!runId) {
9929
9931
  return input2.status;
9930
9932
  }
9931
- const refreshedStatus = await input2.client.getPlayStatus(runId, {
9933
+ const streamedPackage = getPlayRunPackage(input2.status);
9934
+ const refreshForFullJson = input2.fullJson && streamedPackage !== null;
9935
+ const streamedTextPackageIncomplete = !input2.jsonOutput && input2.status.status === "completed" && playRunPackageStepCount(streamedPackage) === 0;
9936
+ if (!refreshForFullJson && !streamedTextPackageIncomplete) {
9937
+ return input2.status;
9938
+ }
9939
+ let refreshedStatus = await input2.client.getPlayStatus(runId, {
9932
9940
  billing: false,
9933
9941
  full: input2.fullJson
9934
9942
  });
9943
+ for (let attempt = 0; attempt < 3 && streamedTextPackageIncomplete && refreshedStatus.status === "completed" && playRunPackageStepCount(getPlayRunPackage(refreshedStatus)) === 0; attempt += 1) {
9944
+ await sleep4(250);
9945
+ refreshedStatus = await input2.client.getPlayStatus(runId, {
9946
+ billing: false,
9947
+ full: input2.fullJson
9948
+ });
9949
+ }
9935
9950
  const dashboardUrl = input2.status.dashboardUrl;
9936
9951
  return typeof dashboardUrl === "string" ? { ...refreshedStatus, dashboardUrl } : refreshedStatus;
9937
9952
  }
@@ -10895,7 +10910,8 @@ async function handleFileBackedRun(options) {
10895
10910
  await resolvePlayRunOutputStatus({
10896
10911
  client,
10897
10912
  status: finalStatus,
10898
- fullJson: options.fullJson
10913
+ fullJson: options.fullJson,
10914
+ jsonOutput: options.jsonOutput
10899
10915
  }),
10900
10916
  playName
10901
10917
  );
@@ -11045,7 +11061,8 @@ async function handleNamedRun(options) {
11045
11061
  await resolvePlayRunOutputStatus({
11046
11062
  client,
11047
11063
  status: finalStatus,
11048
- fullJson: options.fullJson
11064
+ fullJson: options.fullJson,
11065
+ jsonOutput: options.jsonOutput
11049
11066
  }),
11050
11067
  playName
11051
11068
  );
@@ -206,10 +206,10 @@ import { join as join2 } from "path";
206
206
 
207
207
  // src/release.ts
208
208
  var SDK_RELEASE = {
209
- version: "0.1.89",
209
+ version: "0.1.91",
210
210
  apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
211
211
  supportPolicy: {
212
- latest: "0.1.89",
212
+ latest: "0.1.91",
213
213
  minimumSupported: "0.1.53",
214
214
  deprecatedBelow: "0.1.53"
215
215
  }
@@ -9929,18 +9929,33 @@ function writePlayResult(status, jsonOutput, options) {
9929
9929
  ` }
9930
9930
  );
9931
9931
  }
9932
+ function playRunPackageStepCount(pkg) {
9933
+ if (!pkg) return 0;
9934
+ const steps = pkg.steps;
9935
+ return Array.isArray(steps) ? steps.length : 0;
9936
+ }
9932
9937
  async function resolvePlayRunOutputStatus(input2) {
9933
- if (!input2.fullJson || !getPlayRunPackage(input2.status)) {
9934
- return input2.status;
9935
- }
9936
9938
  const runId = input2.status.runId;
9937
9939
  if (!runId) {
9938
9940
  return input2.status;
9939
9941
  }
9940
- const refreshedStatus = await input2.client.getPlayStatus(runId, {
9942
+ const streamedPackage = getPlayRunPackage(input2.status);
9943
+ const refreshForFullJson = input2.fullJson && streamedPackage !== null;
9944
+ const streamedTextPackageIncomplete = !input2.jsonOutput && input2.status.status === "completed" && playRunPackageStepCount(streamedPackage) === 0;
9945
+ if (!refreshForFullJson && !streamedTextPackageIncomplete) {
9946
+ return input2.status;
9947
+ }
9948
+ let refreshedStatus = await input2.client.getPlayStatus(runId, {
9941
9949
  billing: false,
9942
9950
  full: input2.fullJson
9943
9951
  });
9952
+ for (let attempt = 0; attempt < 3 && streamedTextPackageIncomplete && refreshedStatus.status === "completed" && playRunPackageStepCount(getPlayRunPackage(refreshedStatus)) === 0; attempt += 1) {
9953
+ await sleep4(250);
9954
+ refreshedStatus = await input2.client.getPlayStatus(runId, {
9955
+ billing: false,
9956
+ full: input2.fullJson
9957
+ });
9958
+ }
9944
9959
  const dashboardUrl = input2.status.dashboardUrl;
9945
9960
  return typeof dashboardUrl === "string" ? { ...refreshedStatus, dashboardUrl } : refreshedStatus;
9946
9961
  }
@@ -10904,7 +10919,8 @@ async function handleFileBackedRun(options) {
10904
10919
  await resolvePlayRunOutputStatus({
10905
10920
  client,
10906
10921
  status: finalStatus,
10907
- fullJson: options.fullJson
10922
+ fullJson: options.fullJson,
10923
+ jsonOutput: options.jsonOutput
10908
10924
  }),
10909
10925
  playName
10910
10926
  );
@@ -11054,7 +11070,8 @@ async function handleNamedRun(options) {
11054
11070
  await resolvePlayRunOutputStatus({
11055
11071
  client,
11056
11072
  status: finalStatus,
11057
- fullJson: options.fullJson
11073
+ fullJson: options.fullJson,
11074
+ jsonOutput: options.jsonOutput
11058
11075
  }),
11059
11076
  playName
11060
11077
  );
package/dist/index.js CHANGED
@@ -246,10 +246,10 @@ var import_node_path2 = require("path");
246
246
 
247
247
  // src/release.ts
248
248
  var SDK_RELEASE = {
249
- version: "0.1.89",
249
+ version: "0.1.91",
250
250
  apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
251
251
  supportPolicy: {
252
- latest: "0.1.89",
252
+ latest: "0.1.91",
253
253
  minimumSupported: "0.1.53",
254
254
  deprecatedBelow: "0.1.53"
255
255
  }
package/dist/index.mjs CHANGED
@@ -179,10 +179,10 @@ import { join as join2 } from "path";
179
179
 
180
180
  // src/release.ts
181
181
  var SDK_RELEASE = {
182
- version: "0.1.89",
182
+ version: "0.1.91",
183
183
  apiContract: "2026-06-dataset-column-cell-stale-hard-cutover",
184
184
  supportPolicy: {
185
- latest: "0.1.89",
185
+ latest: "0.1.91",
186
186
  minimumSupported: "0.1.53",
187
187
  deprecatedBelow: "0.1.53"
188
188
  }
@@ -34,7 +34,6 @@ import {
34
34
  type WorkflowStep,
35
35
  } from 'cloudflare:workers';
36
36
  import {
37
- chooseMapChunkSize,
38
37
  deterministicMapChunkStepName,
39
38
  type ExecutionPlan,
40
39
  } from '../../../shared_libs/play-runtime/execution-plan';
@@ -131,6 +130,7 @@ import {
131
130
  setHarnessBinding,
132
131
  } from '../../../sdk/src/plays/harness-stub';
133
132
  import { createHarnessWorkerReceiptStore } from './runtime/harness-receipt-store';
133
+ import { chooseWorkerMapRowsPerChunk } from './runtime/map-chunk-plan';
134
134
  import {
135
135
  applyCsvRenameProjection,
136
136
  stripCsvProjectionMetadata,
@@ -2939,6 +2939,7 @@ async function prepareMapRows(input: {
2939
2939
  req: RunRequest;
2940
2940
  tableNamespace: string;
2941
2941
  rows: Record<string, unknown>[];
2942
+ inputOffset: number;
2942
2943
  outputFields: string[];
2943
2944
  cellPolicies?: CellStalenessPolicyByField;
2944
2945
  }): Promise<{
@@ -2964,6 +2965,7 @@ async function prepareMapRows(input: {
2964
2965
  }),
2965
2966
  rows: input.rows.map((row) => publicCsvStorageRow(row)),
2966
2967
  runId: input.req.runId,
2968
+ inputOffset: input.inputOffset,
2967
2969
  userEmail: input.req.userEmail,
2968
2970
  cellPolicies: input.cellPolicies,
2969
2971
  });
@@ -3443,16 +3445,10 @@ function createMinimalWorkerCtx(
3443
3445
  const baseOffset = 0;
3444
3446
  const fieldEntries = Object.entries(fieldsDef);
3445
3447
  const plan = req.executionPlan;
3446
- const planMap = plan?.maps.find(
3447
- (candidate) =>
3448
- candidate.mapName === name || candidate.tableNamespace === name,
3449
- );
3450
- const rowsPerChunk = chooseMapChunkSize({
3451
- totalRows: rowCountHint,
3452
- mapCount: Math.max(1, plan?.maps.length ?? 1),
3453
- stepsPerChunk: planMap?.stepsPerChunk ?? 1,
3454
- preferredChunkSize: planMap?.defaultChunkSize,
3455
- softWorkflowStepBudget: plan?.chunkPlan.softWorkflowStepBudget,
3448
+ const rowsPerChunk = chooseWorkerMapRowsPerChunk({
3449
+ mapName: name,
3450
+ rowCountHint,
3451
+ executionPlan: plan,
3456
3452
  });
3457
3453
  const outputFields = fieldEntries.map(([field]) => field);
3458
3454
  const updateMapProgress = (
@@ -3627,6 +3623,7 @@ function createMinimalWorkerCtx(
3627
3623
  ...row,
3628
3624
  __deeplineRowKey: rowKey,
3629
3625
  })),
3626
+ inputOffset: baseOffset + chunkStart,
3630
3627
  });
3631
3628
  recordRunnerPerfTrace({
3632
3629
  req,
@@ -4366,22 +4363,25 @@ function createMinimalWorkerCtx(
4366
4363
  program.steps.map((step) => [step.name, step.resolver]),
4367
4364
  );
4368
4365
  const cellPolicies = Object.fromEntries(
4369
- program.steps.map((step) => [
4370
- step.name,
4366
+ program.steps.flatMap((step) =>
4371
4367
  step.staleAfterSeconds === undefined
4372
- ? {}
4373
- : normalizeCellStalenessPolicy({
4374
- staleAfterSeconds: step.staleAfterSeconds,
4375
- }),
4376
- ]),
4368
+ ? []
4369
+ : [
4370
+ [
4371
+ step.name,
4372
+ normalizeCellStalenessPolicy({
4373
+ staleAfterSeconds: step.staleAfterSeconds,
4374
+ }),
4375
+ ],
4376
+ ],
4377
+ ),
4377
4378
  ) as CellStalenessPolicyByField;
4378
4379
  const authoredCellPolicies = Object.fromEntries(
4379
- program.steps.map((step) => [
4380
- step.name,
4380
+ program.steps.flatMap((step) =>
4381
4381
  step.staleAfterSeconds === undefined
4382
- ? {}
4383
- : { staleAfterSeconds: step.staleAfterSeconds },
4384
- ]),
4382
+ ? []
4383
+ : [[step.name, { staleAfterSeconds: step.staleAfterSeconds }]],
4384
+ ),
4385
4385
  ) as AuthoredCellStalenessPolicyByField;
4386
4386
  return runMap(
4387
4387
  this.name,
@@ -4611,22 +4611,25 @@ function createMinimalWorkerCtx(
4611
4611
  fieldsDef.steps.map((step) => [step.name, step.resolver]),
4612
4612
  );
4613
4613
  const cellPolicies = Object.fromEntries(
4614
- fieldsDef.steps.map((step) => [
4615
- step.name,
4614
+ fieldsDef.steps.flatMap((step) =>
4616
4615
  step.staleAfterSeconds === undefined
4617
- ? {}
4618
- : normalizeCellStalenessPolicy({
4619
- staleAfterSeconds: step.staleAfterSeconds,
4620
- }),
4621
- ]),
4616
+ ? []
4617
+ : [
4618
+ [
4619
+ step.name,
4620
+ normalizeCellStalenessPolicy({
4621
+ staleAfterSeconds: step.staleAfterSeconds,
4622
+ }),
4623
+ ],
4624
+ ],
4625
+ ),
4622
4626
  ) as CellStalenessPolicyByField;
4623
4627
  const authoredCellPolicies = Object.fromEntries(
4624
- fieldsDef.steps.map((step) => [
4625
- step.name,
4628
+ fieldsDef.steps.flatMap((step) =>
4626
4629
  step.staleAfterSeconds === undefined
4627
- ? {}
4628
- : { staleAfterSeconds: step.staleAfterSeconds },
4629
- ]),
4630
+ ? []
4631
+ : [[step.name, { staleAfterSeconds: step.staleAfterSeconds }]],
4632
+ ),
4630
4633
  ) as AuthoredCellStalenessPolicyByField;
4631
4634
  return runMap(
4632
4635
  name,
@@ -0,0 +1,44 @@
1
+ import {
2
+ chooseMapChunkSize,
3
+ type ExecutionPlan,
4
+ } from '../../../../shared_libs/play-runtime/execution-plan';
5
+
6
+ export const CACHE_ENABLED_SIMPLE_MAP_CHUNK_SIZE = 10_000;
7
+
8
+ export type WorkerMapChunkPlanInput = {
9
+ mapName: string;
10
+ rowCountHint: number | null;
11
+ executionPlan?: ExecutionPlan | null;
12
+ };
13
+
14
+ export function chooseWorkerMapRowsPerChunk(
15
+ input: WorkerMapChunkPlanInput,
16
+ ): number {
17
+ const plan = input.executionPlan ?? null;
18
+ const planMap = plan?.maps.find(
19
+ (candidate) =>
20
+ candidate.mapName === input.mapName ||
21
+ candidate.tableNamespace === input.mapName,
22
+ );
23
+ const rowsPerChunk = chooseMapChunkSize({
24
+ totalRows: input.rowCountHint,
25
+ mapCount: Math.max(1, plan?.maps.length ?? 1),
26
+ stepsPerChunk: planMap?.stepsPerChunk ?? 1,
27
+ preferredChunkSize: planMap?.defaultChunkSize,
28
+ softWorkflowStepBudget: plan?.chunkPlan.softWorkflowStepBudget,
29
+ });
30
+
31
+ const toolFreeSimpleMap =
32
+ !!planMap &&
33
+ planMap.stepsPerChunk === 1 &&
34
+ (plan?.toolDeclarations.length ?? 0) === 0;
35
+ if (
36
+ toolFreeSimpleMap &&
37
+ (input.rowCountHint === null ||
38
+ input.rowCountHint >= CACHE_ENABLED_SIMPLE_MAP_CHUNK_SIZE)
39
+ ) {
40
+ return Math.max(rowsPerChunk, CACHE_ENABLED_SIMPLE_MAP_CHUNK_SIZE);
41
+ }
42
+
43
+ return rowsPerChunk;
44
+ }
@@ -50,10 +50,10 @@ export type SdkRelease = {
50
50
  };
51
51
 
52
52
  export const SDK_RELEASE = {
53
- version: '0.1.89',
53
+ version: '0.1.91',
54
54
  apiContract: '2026-06-dataset-column-cell-stale-hard-cutover',
55
55
  supportPolicy: {
56
- latest: '0.1.89',
56
+ latest: '0.1.91',
57
57
  minimumSupported: '0.1.53',
58
58
  deprecatedBelow: '0.1.53',
59
59
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.89",
3
+ "version": "0.1.91",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {