deepline 0.2.25 → 0.2.26

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.
@@ -1319,7 +1319,18 @@ async function uploadStagedFileToPresignedUrl(input: {
1319
1319
  break;
1320
1320
  }
1321
1321
  } catch (error) {
1322
- lastError = error;
1322
+ // fetch rejects network-level failures instead of returning a Response.
1323
+ // Sandboxed egress proxies commonly reject the TLS CONNECT this way, so
1324
+ // preserve the existing multipart fallback after direct retries finish.
1325
+ lastError =
1326
+ error instanceof TypeError
1327
+ ? new DeeplineError(
1328
+ `Direct storage upload of ${input.logicalPath} could not reach the storage endpoint: ${error.message}`,
1329
+ undefined,
1330
+ 'STAGED_FILE_UPLOAD_EGRESS_DENIED',
1331
+ { logicalPath: input.logicalPath },
1332
+ )
1333
+ : error;
1323
1334
  }
1324
1335
  if (attempt < STAGE_DIRECT_UPLOAD_MAX_ATTEMPTS) {
1325
1336
  await sleep(250 * attempt);
@@ -160,7 +160,7 @@ export const SDK_RELEASE = {
160
160
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
161
161
  // exposed storage-dependent synchronous access. This deliberate minor
162
162
  // release keeps lazy paging semantics independent of row residency.
163
- version: '0.2.25',
163
+ version: '0.2.26',
164
164
  contracts: {
165
165
  api: {
166
166
  name: 'sdk-http-api',
@@ -38,6 +38,13 @@ export class GatewayPostgresAdmission {
38
38
  #commitPriorityGrants = 0;
39
39
  #consecutiveCommitPriorityGrants = 0;
40
40
 
41
+ constructor(
42
+ private readonly limits: {
43
+ maxOrdinaryActive?: number;
44
+ maxTotalActive?: number;
45
+ } = {},
46
+ ) {}
47
+
41
48
  async acquire(
42
49
  lane: GatewayPostgresLane,
43
50
  options: { signal?: AbortSignal } = {},
@@ -95,10 +102,20 @@ export class GatewayPostgresAdmission {
95
102
  }
96
103
 
97
104
  #canGrant(lane: GatewayPostgresLane): boolean {
98
- if (this.#activeTotal() >= GATEWAY_POSTGRES_MAX_TOTAL_ACTIVE) return false;
105
+ if (this.#activeTotal() >= this.#maxTotalActive()) return false;
99
106
  return (
100
107
  lane === 'commit' ||
101
- this.#ordinaryActive < GATEWAY_POSTGRES_MAX_ORDINARY_ACTIVE
108
+ this.#ordinaryActive < this.#maxOrdinaryActive()
109
+ );
110
+ }
111
+
112
+ #maxTotalActive(): number {
113
+ return this.limits.maxTotalActive ?? GATEWAY_POSTGRES_MAX_TOTAL_ACTIVE;
114
+ }
115
+
116
+ #maxOrdinaryActive(): number {
117
+ return (
118
+ this.limits.maxOrdinaryActive ?? GATEWAY_POSTGRES_MAX_ORDINARY_ACTIVE
102
119
  );
103
120
  }
104
121
 
@@ -116,10 +133,10 @@ export class GatewayPostgresAdmission {
116
133
  }
117
134
 
118
135
  #drain(): void {
119
- while (this.#activeTotal() < GATEWAY_POSTGRES_MAX_TOTAL_ACTIVE) {
136
+ while (this.#activeTotal() < this.#maxTotalActive()) {
120
137
  const ordinaryCanRun =
121
138
  this.#waiting.ordinary.length > 0 &&
122
- this.#ordinaryActive < GATEWAY_POSTGRES_MAX_ORDINARY_ACTIVE;
139
+ this.#ordinaryActive < this.#maxOrdinaryActive();
123
140
  if (
124
141
  ordinaryCanRun &&
125
142
  this.#waiting.commit.length > 0 &&
@@ -1138,6 +1138,7 @@ export const daytonaPlayRunnerBackend: PlayRunnerBackend = {
1138
1138
  }
1139
1139
  emitDaytonaStage(callbacks, config.context, 'execute:error', {
1140
1140
  sandboxId: sandboxCleanup.currentSandbox()?.id ?? null,
1141
+ runnerAttempt: Math.max(0, Math.floor(config.context.runAttempt ?? 0)),
1141
1142
  error: formatDaytonaError(error),
1142
1143
  operation: 'runner_backend',
1143
1144
  elapsedMs: Date.now() - startedAt,
@@ -1,6 +1,8 @@
1
1
  export const PLAY_RUNTIME_CONTRACT = 4;
2
2
  export const PLAY_RUNTIME_CONTRACT_MIN_SUPPORTED = 1;
3
3
  export const PLAY_RUNTIME_CONTRACT_HEADER = 'x-deepline-runtime-contract';
4
+ /** Shared runner/gateway envelope limit for unacknowledged progress recovery. */
5
+ export const RUNTIME_RUNNER_TERMINAL_PROGRESS_MAX_EVENTS = 2_000;
4
6
  /**
5
7
  * Opaque, per-request correlation key generated inside the sandbox runner.
6
8
  * It contains no customer data and lets gateway logs distinguish a request that
package/dist/cli/index.js CHANGED
@@ -1044,7 +1044,7 @@ var SDK_RELEASE = {
1044
1044
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
1045
1045
  // exposed storage-dependent synchronous access. This deliberate minor
1046
1046
  // release keeps lazy paging semantics independent of row residency.
1047
- version: "0.2.25",
1047
+ version: "0.2.26",
1048
1048
  contracts: {
1049
1049
  api: {
1050
1050
  name: "sdk-http-api",
@@ -3631,7 +3631,12 @@ async function uploadStagedFileToPresignedUrl(input2) {
3631
3631
  break;
3632
3632
  }
3633
3633
  } catch (error) {
3634
- lastError = error;
3634
+ lastError = error instanceof TypeError ? new DeeplineError(
3635
+ `Direct storage upload of ${input2.logicalPath} could not reach the storage endpoint: ${error.message}`,
3636
+ void 0,
3637
+ "STAGED_FILE_UPLOAD_EGRESS_DENIED",
3638
+ { logicalPath: input2.logicalPath }
3639
+ ) : error;
3635
3640
  }
3636
3641
  if (attempt < STAGE_DIRECT_UPLOAD_MAX_ATTEMPTS) {
3637
3642
  await sleep2(250 * attempt);
@@ -1030,7 +1030,7 @@ var SDK_RELEASE = {
1030
1030
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
1031
1031
  // exposed storage-dependent synchronous access. This deliberate minor
1032
1032
  // release keeps lazy paging semantics independent of row residency.
1033
- version: "0.2.25",
1033
+ version: "0.2.26",
1034
1034
  contracts: {
1035
1035
  api: {
1036
1036
  name: "sdk-http-api",
@@ -3617,7 +3617,12 @@ async function uploadStagedFileToPresignedUrl(input2) {
3617
3617
  break;
3618
3618
  }
3619
3619
  } catch (error) {
3620
- lastError = error;
3620
+ lastError = error instanceof TypeError ? new DeeplineError(
3621
+ `Direct storage upload of ${input2.logicalPath} could not reach the storage endpoint: ${error.message}`,
3622
+ void 0,
3623
+ "STAGED_FILE_UPLOAD_EGRESS_DENIED",
3624
+ { logicalPath: input2.logicalPath }
3625
+ ) : error;
3621
3626
  }
3622
3627
  if (attempt < STAGE_DIRECT_UPLOAD_MAX_ATTEMPTS) {
3623
3628
  await sleep2(250 * attempt);
package/dist/index.js CHANGED
@@ -763,7 +763,7 @@ var SDK_RELEASE = {
763
763
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
764
764
  // exposed storage-dependent synchronous access. This deliberate minor
765
765
  // release keeps lazy paging semantics independent of row residency.
766
- version: "0.2.25",
766
+ version: "0.2.26",
767
767
  contracts: {
768
768
  api: {
769
769
  name: "sdk-http-api",
@@ -3350,7 +3350,12 @@ async function uploadStagedFileToPresignedUrl(input) {
3350
3350
  break;
3351
3351
  }
3352
3352
  } catch (error) {
3353
- lastError = error;
3353
+ lastError = error instanceof TypeError ? new DeeplineError(
3354
+ `Direct storage upload of ${input.logicalPath} could not reach the storage endpoint: ${error.message}`,
3355
+ void 0,
3356
+ "STAGED_FILE_UPLOAD_EGRESS_DENIED",
3357
+ { logicalPath: input.logicalPath }
3358
+ ) : error;
3354
3359
  }
3355
3360
  if (attempt < STAGE_DIRECT_UPLOAD_MAX_ATTEMPTS) {
3356
3361
  await sleep2(250 * attempt);
package/dist/index.mjs CHANGED
@@ -689,7 +689,7 @@ var SDK_RELEASE = {
689
689
  // 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
690
690
  // exposed storage-dependent synchronous access. This deliberate minor
691
691
  // release keeps lazy paging semantics independent of row residency.
692
- version: "0.2.25",
692
+ version: "0.2.26",
693
693
  contracts: {
694
694
  api: {
695
695
  name: "sdk-http-api",
@@ -3276,7 +3276,12 @@ async function uploadStagedFileToPresignedUrl(input) {
3276
3276
  break;
3277
3277
  }
3278
3278
  } catch (error) {
3279
- lastError = error;
3279
+ lastError = error instanceof TypeError ? new DeeplineError(
3280
+ `Direct storage upload of ${input.logicalPath} could not reach the storage endpoint: ${error.message}`,
3281
+ void 0,
3282
+ "STAGED_FILE_UPLOAD_EGRESS_DENIED",
3283
+ { logicalPath: input.logicalPath }
3284
+ ) : error;
3280
3285
  }
3281
3286
  if (attempt < STAGE_DIRECT_UPLOAD_MAX_ATTEMPTS) {
3282
3287
  await sleep2(250 * attempt);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "deepline",
3
- "version": "0.2.25",
3
+ "version": "0.2.26",
4
4
  "description": "Deepline SDK + CLI — B2B data enrichment powered by durable cloud execution",
5
5
  "license": "MIT",
6
6
  "repository": {