deepline 0.1.205 → 0.1.207

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 (30) hide show
  1. package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +25 -16
  2. package/dist/bundling-sources/sdk/src/release.ts +2 -2
  3. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +104 -13
  4. package/dist/bundling-sources/shared_libs/play-runtime/child-execution-strategy.ts +51 -0
  5. package/dist/bundling-sources/shared_libs/play-runtime/child-run-id.ts +16 -0
  6. package/dist/bundling-sources/shared_libs/play-runtime/child-run-lifecycle.ts +70 -0
  7. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +321 -175
  8. package/dist/bundling-sources/shared_libs/play-runtime/coordinator-headers.ts +4 -1
  9. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +13 -1
  10. package/dist/bundling-sources/shared_libs/play-runtime/governor/adaptive-admission.ts +16 -4
  11. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +161 -81
  12. package/dist/bundling-sources/shared_libs/play-runtime/governor/coordinator-rate-state-backend.ts +26 -9
  13. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +109 -1
  14. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +1 -0
  15. package/dist/bundling-sources/shared_libs/play-runtime/receipt-completion-sink.ts +7 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/run-execution-scope.ts +256 -0
  17. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +17 -5
  18. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +103 -18
  19. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +8 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/runtime-actions.ts +1 -1
  21. package/dist/bundling-sources/shared_libs/play-runtime/runtime-pg-driver-pg.ts +5 -0
  22. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +74 -0
  23. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +5 -12
  24. package/dist/bundling-sources/shared_libs/play-runtime/worker-api-types.ts +2 -1
  25. package/dist/bundling-sources/shared_libs/runtime-env.ts +55 -0
  26. package/dist/cli/index.js +27 -6
  27. package/dist/cli/index.mjs +27 -6
  28. package/dist/index.js +2 -2
  29. package/dist/index.mjs +2 -2
  30. package/package.json +1 -1
@@ -34,7 +34,8 @@ export type ComputeBillingItem = {
34
34
  metadata?: unknown;
35
35
  };
36
36
 
37
- const DAYTONA_COMPUTE_PRICING_USD = {
37
+ /** Daytona pay-as-you-go rates, per second (https://www.daytona.io/pricing). */
38
+ export const DAYTONA_COMPUTE_PRICING_USD = {
38
39
  vcpuSecond: 0.000014,
39
40
  memoryGiBSecond: 0.0000045,
40
41
  storageGiBSecond: 0.00000003,
@@ -0,0 +1,55 @@
1
+ export type DeeplineRuntimeEnv = 'prod' | 'dev';
2
+
3
+ function normalizeEnvToken(value: string): DeeplineRuntimeEnv | null {
4
+ const token = value.trim().toLowerCase();
5
+ if (!token) return null;
6
+
7
+ if (
8
+ token === 'prod' ||
9
+ token === 'production' ||
10
+ token === 'live' ||
11
+ token.startsWith('prod-')
12
+ ) {
13
+ return 'prod';
14
+ }
15
+
16
+ if (
17
+ token === 'dev' ||
18
+ token === 'development' ||
19
+ token === 'local' ||
20
+ token === 'preview' ||
21
+ token === 'staging' ||
22
+ token === 'stage' ||
23
+ token === 'test' ||
24
+ token.startsWith('dev-')
25
+ ) {
26
+ return 'dev';
27
+ }
28
+
29
+ return null;
30
+ }
31
+
32
+ export function getRuntimeEnv(): DeeplineRuntimeEnv {
33
+ const explicit = normalizeEnvToken(process.env.DEEPLINE_ENV ?? '');
34
+ if (explicit) return explicit;
35
+
36
+ const convexDeployment = String(process.env.CONVEX_DEPLOYMENT ?? '')
37
+ .trim()
38
+ .toLowerCase();
39
+ if (convexDeployment.startsWith('prod:')) return 'prod';
40
+ if (convexDeployment.startsWith('dev:')) return 'dev';
41
+
42
+ const vercelEnv = normalizeEnvToken(process.env.VERCEL_ENV ?? '');
43
+ if (vercelEnv) return vercelEnv;
44
+
45
+ return process.env.NODE_ENV === 'production' ? 'prod' : 'dev';
46
+ }
47
+
48
+ export function getRuntimeEnvInfo() {
49
+ return {
50
+ env: getRuntimeEnv(),
51
+ deepline_env: process.env.DEEPLINE_ENV ?? null,
52
+ convex_deployment: process.env.CONVEX_DEPLOYMENT ?? null,
53
+ node_env: process.env.NODE_ENV ?? null,
54
+ };
55
+ }
package/dist/cli/index.js CHANGED
@@ -623,10 +623,10 @@ var SDK_RELEASE = {
623
623
  // 0.1.154 removes the short-lived generated enrich StepOptions recompute
624
624
  // fields shipped in 0.1.153.
625
625
  // 0.1.175 ships loud `deepline enrich` empty-waterfall reporting.
626
- version: "0.1.205",
626
+ version: "0.1.207",
627
627
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
628
628
  supportPolicy: {
629
- latest: "0.1.205",
629
+ latest: "0.1.207",
630
630
  minimumSupported: "0.1.53",
631
631
  deprecatedBelow: "0.1.53",
632
632
  commandMinimumSupported: [
@@ -11032,7 +11032,9 @@ async function isMissingRunPlayReferenceError(input2) {
11032
11032
  return false;
11033
11033
  }
11034
11034
  try {
11035
- await input2.client.getPlay(parseReferencedPlayTarget2(input2.playName).playName);
11035
+ await input2.client.getPlay(
11036
+ parseReferencedPlayTarget2(input2.playName).playName
11037
+ );
11036
11038
  return false;
11037
11039
  } catch (lookupError) {
11038
11040
  return isPlayNotFoundError(lookupError);
@@ -12492,17 +12494,33 @@ async function startAndWaitForPlayCompletionByStreamOnce(input2) {
12492
12494
  }
12493
12495
  const finalStatus = getFinalStatusFromLiveEvent(event);
12494
12496
  if (finalStatus) {
12497
+ lastKnownWorkflowId ||= finalStatus.runId ?? "";
12498
+ const canonicalTerminal = input2.request.profile === "absurd" ? await fetchKnownTerminalStatus() : { ...finalStatus, dashboardUrl };
12499
+ if (!canonicalTerminal) {
12500
+ recordCliTrace({
12501
+ phase: "cli.play_start_stream_stale_terminal_ignored",
12502
+ ms: Date.now() - startedAt,
12503
+ ok: true,
12504
+ playName: input2.playName,
12505
+ workflowId: lastKnownWorkflowId || null,
12506
+ eventCount,
12507
+ firstRunIdMs,
12508
+ lastPhase,
12509
+ streamedStatus: finalStatus.status
12510
+ });
12511
+ continue;
12512
+ }
12495
12513
  recordCliTrace({
12496
12514
  phase: "cli.play_start_stream_terminal",
12497
12515
  ms: Date.now() - startedAt,
12498
12516
  ok: true,
12499
12517
  playName: input2.playName,
12500
- workflowId: finalStatus.runId || lastKnownWorkflowId || null,
12518
+ workflowId: canonicalTerminal.runId || lastKnownWorkflowId || null,
12501
12519
  eventCount,
12502
12520
  firstRunIdMs,
12503
12521
  lastPhase
12504
12522
  });
12505
- return { ...finalStatus, dashboardUrl };
12523
+ return canonicalTerminal;
12506
12524
  }
12507
12525
  }
12508
12526
  } catch (error) {
@@ -13789,7 +13807,10 @@ async function exportPlayStatusRows(client2, status, outPath, options = {}) {
13789
13807
  availableRows,
13790
13808
  datasetPath: options.datasetPath
13791
13809
  });
13792
- return { path: writeCanonicalRowsCsv(guarded2, outPath), rowsInfo: guarded2 };
13810
+ return {
13811
+ path: writeCanonicalRowsCsv(guarded2, outPath),
13812
+ rowsInfo: guarded2
13813
+ };
13793
13814
  }
13794
13815
  if (rowsInfo.complete) {
13795
13816
  const guarded2 = assertDatasetHasExportableRows({
@@ -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.205",
611
+ version: "0.1.207",
612
612
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
613
613
  supportPolicy: {
614
- latest: "0.1.205",
614
+ latest: "0.1.207",
615
615
  minimumSupported: "0.1.53",
616
616
  deprecatedBelow: "0.1.53",
617
617
  commandMinimumSupported: [
@@ -11061,7 +11061,9 @@ async function isMissingRunPlayReferenceError(input2) {
11061
11061
  return false;
11062
11062
  }
11063
11063
  try {
11064
- await input2.client.getPlay(parseReferencedPlayTarget2(input2.playName).playName);
11064
+ await input2.client.getPlay(
11065
+ parseReferencedPlayTarget2(input2.playName).playName
11066
+ );
11065
11067
  return false;
11066
11068
  } catch (lookupError) {
11067
11069
  return isPlayNotFoundError(lookupError);
@@ -12521,17 +12523,33 @@ async function startAndWaitForPlayCompletionByStreamOnce(input2) {
12521
12523
  }
12522
12524
  const finalStatus = getFinalStatusFromLiveEvent(event);
12523
12525
  if (finalStatus) {
12526
+ lastKnownWorkflowId ||= finalStatus.runId ?? "";
12527
+ const canonicalTerminal = input2.request.profile === "absurd" ? await fetchKnownTerminalStatus() : { ...finalStatus, dashboardUrl };
12528
+ if (!canonicalTerminal) {
12529
+ recordCliTrace({
12530
+ phase: "cli.play_start_stream_stale_terminal_ignored",
12531
+ ms: Date.now() - startedAt,
12532
+ ok: true,
12533
+ playName: input2.playName,
12534
+ workflowId: lastKnownWorkflowId || null,
12535
+ eventCount,
12536
+ firstRunIdMs,
12537
+ lastPhase,
12538
+ streamedStatus: finalStatus.status
12539
+ });
12540
+ continue;
12541
+ }
12524
12542
  recordCliTrace({
12525
12543
  phase: "cli.play_start_stream_terminal",
12526
12544
  ms: Date.now() - startedAt,
12527
12545
  ok: true,
12528
12546
  playName: input2.playName,
12529
- workflowId: finalStatus.runId || lastKnownWorkflowId || null,
12547
+ workflowId: canonicalTerminal.runId || lastKnownWorkflowId || null,
12530
12548
  eventCount,
12531
12549
  firstRunIdMs,
12532
12550
  lastPhase
12533
12551
  });
12534
- return { ...finalStatus, dashboardUrl };
12552
+ return canonicalTerminal;
12535
12553
  }
12536
12554
  }
12537
12555
  } catch (error) {
@@ -13818,7 +13836,10 @@ async function exportPlayStatusRows(client2, status, outPath, options = {}) {
13818
13836
  availableRows,
13819
13837
  datasetPath: options.datasetPath
13820
13838
  });
13821
- return { path: writeCanonicalRowsCsv(guarded2, outPath), rowsInfo: guarded2 };
13839
+ return {
13840
+ path: writeCanonicalRowsCsv(guarded2, outPath),
13841
+ rowsInfo: guarded2
13842
+ };
13822
13843
  }
13823
13844
  if (rowsInfo.complete) {
13824
13845
  const guarded2 = assertDatasetHasExportableRows({
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.205",
425
+ version: "0.1.207",
426
426
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
427
427
  supportPolicy: {
428
- latest: "0.1.205",
428
+ latest: "0.1.207",
429
429
  minimumSupported: "0.1.53",
430
430
  deprecatedBelow: "0.1.53",
431
431
  commandMinimumSupported: [
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.205",
355
+ version: "0.1.207",
356
356
  apiContract: "2026-06-dataset-handle-results-hard-cutover",
357
357
  supportPolicy: {
358
- latest: "0.1.205",
358
+ latest: "0.1.207",
359
359
  minimumSupported: "0.1.53",
360
360
  deprecatedBelow: "0.1.53",
361
361
  commandMinimumSupported: [
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.1.205",
3
+ "version": "0.1.207",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {