deepline 0.1.22 → 0.1.23
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 +35 -8
- package/dist/cli/index.mjs +35 -8
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +30 -3
- package/dist/index.mjs +30 -3
- package/dist/repo/apps/play-runner-workers/src/coordinator-entry.ts +3 -1
- package/dist/repo/apps/play-runner-workers/src/entry.ts +6 -0
- package/dist/repo/sdk/src/client.ts +38 -4
- package/dist/repo/sdk/src/version.ts +1 -1
- package/dist/repo/shared_libs/play-runtime/execution-plan.ts +27 -2
- package/package.json +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -266,7 +266,7 @@ function saveProjectDeeplineEnvValues(baseUrl, values, startDir = projectEnvStar
|
|
|
266
266
|
}
|
|
267
267
|
|
|
268
268
|
// src/version.ts
|
|
269
|
-
var SDK_VERSION = "0.1.
|
|
269
|
+
var SDK_VERSION = "0.1.23";
|
|
270
270
|
var SDK_API_CONTRACT = "2026-05-runs-v2";
|
|
271
271
|
|
|
272
272
|
// ../shared_libs/play-runtime/coordinator-headers.ts
|
|
@@ -554,6 +554,19 @@ function sleep(ms) {
|
|
|
554
554
|
// src/client.ts
|
|
555
555
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
556
556
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
557
|
+
var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
|
|
558
|
+
function sleep2(ms) {
|
|
559
|
+
return new Promise((resolve8) => setTimeout(resolve8, ms));
|
|
560
|
+
}
|
|
561
|
+
function isTransientCompileManifestError(error) {
|
|
562
|
+
if (error instanceof DeeplineError && typeof error.statusCode === "number") {
|
|
563
|
+
return error.statusCode === 408 || error.statusCode === 425 || error.statusCode === 499 || error.statusCode >= 500 && error.statusCode < 600;
|
|
564
|
+
}
|
|
565
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
566
|
+
return /fetch failed|connection (?:closed|reset|terminated)|socket hang up|econnreset|etimedout|eai_again|abort/i.test(
|
|
567
|
+
message
|
|
568
|
+
);
|
|
569
|
+
}
|
|
557
570
|
function isRecord(value) {
|
|
558
571
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
559
572
|
}
|
|
@@ -959,8 +972,22 @@ var DeeplineClient = class {
|
|
|
959
972
|
});
|
|
960
973
|
}
|
|
961
974
|
async compilePlayManifest(input) {
|
|
962
|
-
const
|
|
963
|
-
|
|
975
|
+
const retryDelays = COMPILE_MANIFEST_RETRY_DELAYS_MS.slice(
|
|
976
|
+
0,
|
|
977
|
+
Math.max(0, this.config.maxRetries)
|
|
978
|
+
);
|
|
979
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
980
|
+
try {
|
|
981
|
+
const response = await this.http.post("/api/v2/plays/compile-manifest", input);
|
|
982
|
+
return response.compilerManifest;
|
|
983
|
+
} catch (error) {
|
|
984
|
+
const delayMs = retryDelays[attempt];
|
|
985
|
+
if (delayMs === void 0 || !isTransientCompileManifestError(error)) {
|
|
986
|
+
throw error;
|
|
987
|
+
}
|
|
988
|
+
await sleep2(delayMs);
|
|
989
|
+
}
|
|
990
|
+
}
|
|
964
991
|
}
|
|
965
992
|
/**
|
|
966
993
|
* Check a bundled play artifact against the server's current play compiler.
|
|
@@ -2013,7 +2040,7 @@ function buildCandidateUrls2(url) {
|
|
|
2013
2040
|
return [url];
|
|
2014
2041
|
}
|
|
2015
2042
|
}
|
|
2016
|
-
function
|
|
2043
|
+
function sleep3(ms) {
|
|
2017
2044
|
return new Promise((resolve8) => setTimeout(resolve8, ms));
|
|
2018
2045
|
}
|
|
2019
2046
|
function printDeeplineLogo() {
|
|
@@ -2096,7 +2123,7 @@ async function handleRegister(args) {
|
|
|
2096
2123
|
return EXIT_AUTH;
|
|
2097
2124
|
}
|
|
2098
2125
|
if (s >= 500 || s === 0 || s === 400) {
|
|
2099
|
-
await
|
|
2126
|
+
await sleep3(2e3);
|
|
2100
2127
|
continue;
|
|
2101
2128
|
}
|
|
2102
2129
|
if (s >= 400) {
|
|
@@ -2120,7 +2147,7 @@ async function handleRegister(args) {
|
|
|
2120
2147
|
console.log("That approval link expired. Please run: deepline auth register");
|
|
2121
2148
|
return EXIT_AUTH;
|
|
2122
2149
|
}
|
|
2123
|
-
await
|
|
2150
|
+
await sleep3(2e3);
|
|
2124
2151
|
}
|
|
2125
2152
|
}
|
|
2126
2153
|
async function handleWait(args) {
|
|
@@ -2157,7 +2184,7 @@ async function handleWait(args) {
|
|
|
2157
2184
|
return EXIT_AUTH;
|
|
2158
2185
|
}
|
|
2159
2186
|
if (status >= 500 || status === 0 || status === 400) {
|
|
2160
|
-
await
|
|
2187
|
+
await sleep3(2e3);
|
|
2161
2188
|
continue;
|
|
2162
2189
|
}
|
|
2163
2190
|
if (status >= 400) {
|
|
@@ -2181,7 +2208,7 @@ async function handleWait(args) {
|
|
|
2181
2208
|
console.error("That approval link expired. Run: deepline auth register");
|
|
2182
2209
|
return EXIT_AUTH;
|
|
2183
2210
|
}
|
|
2184
|
-
await
|
|
2211
|
+
await sleep3(2e3);
|
|
2185
2212
|
}
|
|
2186
2213
|
console.error("Still pending. Approve the browser link, then run: deepline auth wait");
|
|
2187
2214
|
return EXIT_AUTH;
|
package/dist/cli/index.mjs
CHANGED
|
@@ -243,7 +243,7 @@ function saveProjectDeeplineEnvValues(baseUrl, values, startDir = projectEnvStar
|
|
|
243
243
|
}
|
|
244
244
|
|
|
245
245
|
// src/version.ts
|
|
246
|
-
var SDK_VERSION = "0.1.
|
|
246
|
+
var SDK_VERSION = "0.1.23";
|
|
247
247
|
var SDK_API_CONTRACT = "2026-05-runs-v2";
|
|
248
248
|
|
|
249
249
|
// ../shared_libs/play-runtime/coordinator-headers.ts
|
|
@@ -531,6 +531,19 @@ function sleep(ms) {
|
|
|
531
531
|
// src/client.ts
|
|
532
532
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
533
533
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
534
|
+
var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
|
|
535
|
+
function sleep2(ms) {
|
|
536
|
+
return new Promise((resolve8) => setTimeout(resolve8, ms));
|
|
537
|
+
}
|
|
538
|
+
function isTransientCompileManifestError(error) {
|
|
539
|
+
if (error instanceof DeeplineError && typeof error.statusCode === "number") {
|
|
540
|
+
return error.statusCode === 408 || error.statusCode === 425 || error.statusCode === 499 || error.statusCode >= 500 && error.statusCode < 600;
|
|
541
|
+
}
|
|
542
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
543
|
+
return /fetch failed|connection (?:closed|reset|terminated)|socket hang up|econnreset|etimedout|eai_again|abort/i.test(
|
|
544
|
+
message
|
|
545
|
+
);
|
|
546
|
+
}
|
|
534
547
|
function isRecord(value) {
|
|
535
548
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
536
549
|
}
|
|
@@ -936,8 +949,22 @@ var DeeplineClient = class {
|
|
|
936
949
|
});
|
|
937
950
|
}
|
|
938
951
|
async compilePlayManifest(input) {
|
|
939
|
-
const
|
|
940
|
-
|
|
952
|
+
const retryDelays = COMPILE_MANIFEST_RETRY_DELAYS_MS.slice(
|
|
953
|
+
0,
|
|
954
|
+
Math.max(0, this.config.maxRetries)
|
|
955
|
+
);
|
|
956
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
957
|
+
try {
|
|
958
|
+
const response = await this.http.post("/api/v2/plays/compile-manifest", input);
|
|
959
|
+
return response.compilerManifest;
|
|
960
|
+
} catch (error) {
|
|
961
|
+
const delayMs = retryDelays[attempt];
|
|
962
|
+
if (delayMs === void 0 || !isTransientCompileManifestError(error)) {
|
|
963
|
+
throw error;
|
|
964
|
+
}
|
|
965
|
+
await sleep2(delayMs);
|
|
966
|
+
}
|
|
967
|
+
}
|
|
941
968
|
}
|
|
942
969
|
/**
|
|
943
970
|
* Check a bundled play artifact against the server's current play compiler.
|
|
@@ -1995,7 +2022,7 @@ function buildCandidateUrls2(url) {
|
|
|
1995
2022
|
return [url];
|
|
1996
2023
|
}
|
|
1997
2024
|
}
|
|
1998
|
-
function
|
|
2025
|
+
function sleep3(ms) {
|
|
1999
2026
|
return new Promise((resolve8) => setTimeout(resolve8, ms));
|
|
2000
2027
|
}
|
|
2001
2028
|
function printDeeplineLogo() {
|
|
@@ -2078,7 +2105,7 @@ async function handleRegister(args) {
|
|
|
2078
2105
|
return EXIT_AUTH;
|
|
2079
2106
|
}
|
|
2080
2107
|
if (s >= 500 || s === 0 || s === 400) {
|
|
2081
|
-
await
|
|
2108
|
+
await sleep3(2e3);
|
|
2082
2109
|
continue;
|
|
2083
2110
|
}
|
|
2084
2111
|
if (s >= 400) {
|
|
@@ -2102,7 +2129,7 @@ async function handleRegister(args) {
|
|
|
2102
2129
|
console.log("That approval link expired. Please run: deepline auth register");
|
|
2103
2130
|
return EXIT_AUTH;
|
|
2104
2131
|
}
|
|
2105
|
-
await
|
|
2132
|
+
await sleep3(2e3);
|
|
2106
2133
|
}
|
|
2107
2134
|
}
|
|
2108
2135
|
async function handleWait(args) {
|
|
@@ -2139,7 +2166,7 @@ async function handleWait(args) {
|
|
|
2139
2166
|
return EXIT_AUTH;
|
|
2140
2167
|
}
|
|
2141
2168
|
if (status >= 500 || status === 0 || status === 400) {
|
|
2142
|
-
await
|
|
2169
|
+
await sleep3(2e3);
|
|
2143
2170
|
continue;
|
|
2144
2171
|
}
|
|
2145
2172
|
if (status >= 400) {
|
|
@@ -2163,7 +2190,7 @@ async function handleWait(args) {
|
|
|
2163
2190
|
console.error("That approval link expired. Run: deepline auth register");
|
|
2164
2191
|
return EXIT_AUTH;
|
|
2165
2192
|
}
|
|
2166
|
-
await
|
|
2193
|
+
await sleep3(2e3);
|
|
2167
2194
|
}
|
|
2168
2195
|
console.error("Still pending. Approve the browser link, then run: deepline auth wait");
|
|
2169
2196
|
return EXIT_AUTH;
|
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -241,7 +241,7 @@ function resolveConfig(options) {
|
|
|
241
241
|
}
|
|
242
242
|
|
|
243
243
|
// src/version.ts
|
|
244
|
-
var SDK_VERSION = "0.1.
|
|
244
|
+
var SDK_VERSION = "0.1.23";
|
|
245
245
|
var SDK_API_CONTRACT = "2026-05-runs-v2";
|
|
246
246
|
|
|
247
247
|
// ../shared_libs/play-runtime/coordinator-headers.ts
|
|
@@ -529,6 +529,19 @@ function sleep(ms) {
|
|
|
529
529
|
// src/client.ts
|
|
530
530
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
531
531
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
532
|
+
var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
|
|
533
|
+
function sleep2(ms) {
|
|
534
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
535
|
+
}
|
|
536
|
+
function isTransientCompileManifestError(error) {
|
|
537
|
+
if (error instanceof DeeplineError && typeof error.statusCode === "number") {
|
|
538
|
+
return error.statusCode === 408 || error.statusCode === 425 || error.statusCode === 499 || error.statusCode >= 500 && error.statusCode < 600;
|
|
539
|
+
}
|
|
540
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
541
|
+
return /fetch failed|connection (?:closed|reset|terminated)|socket hang up|econnreset|etimedout|eai_again|abort/i.test(
|
|
542
|
+
message
|
|
543
|
+
);
|
|
544
|
+
}
|
|
532
545
|
function isRecord(value) {
|
|
533
546
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
534
547
|
}
|
|
@@ -934,8 +947,22 @@ var DeeplineClient = class {
|
|
|
934
947
|
});
|
|
935
948
|
}
|
|
936
949
|
async compilePlayManifest(input) {
|
|
937
|
-
const
|
|
938
|
-
|
|
950
|
+
const retryDelays = COMPILE_MANIFEST_RETRY_DELAYS_MS.slice(
|
|
951
|
+
0,
|
|
952
|
+
Math.max(0, this.config.maxRetries)
|
|
953
|
+
);
|
|
954
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
955
|
+
try {
|
|
956
|
+
const response = await this.http.post("/api/v2/plays/compile-manifest", input);
|
|
957
|
+
return response.compilerManifest;
|
|
958
|
+
} catch (error) {
|
|
959
|
+
const delayMs = retryDelays[attempt];
|
|
960
|
+
if (delayMs === void 0 || !isTransientCompileManifestError(error)) {
|
|
961
|
+
throw error;
|
|
962
|
+
}
|
|
963
|
+
await sleep2(delayMs);
|
|
964
|
+
}
|
|
965
|
+
}
|
|
939
966
|
}
|
|
940
967
|
/**
|
|
941
968
|
* Check a bundled play artifact against the server's current play compiler.
|
package/dist/index.mjs
CHANGED
|
@@ -195,7 +195,7 @@ function resolveConfig(options) {
|
|
|
195
195
|
}
|
|
196
196
|
|
|
197
197
|
// src/version.ts
|
|
198
|
-
var SDK_VERSION = "0.1.
|
|
198
|
+
var SDK_VERSION = "0.1.23";
|
|
199
199
|
var SDK_API_CONTRACT = "2026-05-runs-v2";
|
|
200
200
|
|
|
201
201
|
// ../shared_libs/play-runtime/coordinator-headers.ts
|
|
@@ -483,6 +483,19 @@ function sleep(ms) {
|
|
|
483
483
|
// src/client.ts
|
|
484
484
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set(["completed", "failed", "cancelled"]);
|
|
485
485
|
var INCLUDE_TOOL_METADATA_HEADER = "x-deepline-include-tool-metadata";
|
|
486
|
+
var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
|
|
487
|
+
function sleep2(ms) {
|
|
488
|
+
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
489
|
+
}
|
|
490
|
+
function isTransientCompileManifestError(error) {
|
|
491
|
+
if (error instanceof DeeplineError && typeof error.statusCode === "number") {
|
|
492
|
+
return error.statusCode === 408 || error.statusCode === 425 || error.statusCode === 499 || error.statusCode >= 500 && error.statusCode < 600;
|
|
493
|
+
}
|
|
494
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
495
|
+
return /fetch failed|connection (?:closed|reset|terminated)|socket hang up|econnreset|etimedout|eai_again|abort/i.test(
|
|
496
|
+
message
|
|
497
|
+
);
|
|
498
|
+
}
|
|
486
499
|
function isRecord(value) {
|
|
487
500
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
488
501
|
}
|
|
@@ -888,8 +901,22 @@ var DeeplineClient = class {
|
|
|
888
901
|
});
|
|
889
902
|
}
|
|
890
903
|
async compilePlayManifest(input) {
|
|
891
|
-
const
|
|
892
|
-
|
|
904
|
+
const retryDelays = COMPILE_MANIFEST_RETRY_DELAYS_MS.slice(
|
|
905
|
+
0,
|
|
906
|
+
Math.max(0, this.config.maxRetries)
|
|
907
|
+
);
|
|
908
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
909
|
+
try {
|
|
910
|
+
const response = await this.http.post("/api/v2/plays/compile-manifest", input);
|
|
911
|
+
return response.compilerManifest;
|
|
912
|
+
} catch (error) {
|
|
913
|
+
const delayMs = retryDelays[attempt];
|
|
914
|
+
if (delayMs === void 0 || !isTransientCompileManifestError(error)) {
|
|
915
|
+
throw error;
|
|
916
|
+
}
|
|
917
|
+
await sleep2(delayMs);
|
|
918
|
+
}
|
|
919
|
+
}
|
|
893
920
|
}
|
|
894
921
|
/**
|
|
895
922
|
* Check a bundled play artifact against the server's current play compiler.
|
|
@@ -3017,6 +3017,7 @@ async function handleWorkflowRoute(input: {
|
|
|
3017
3017
|
error: terminalEvent.error ?? null,
|
|
3018
3018
|
totalRows: terminalEvent.totalRows ?? null,
|
|
3019
3019
|
durationMs: terminalEvent.durationMs ?? null,
|
|
3020
|
+
completedAt: terminalEvent.ts,
|
|
3020
3021
|
events: eventResult?.events ?? [],
|
|
3021
3022
|
latestSeq: eventResult?.latestSeq ?? afterSeq,
|
|
3022
3023
|
wait: null,
|
|
@@ -3147,6 +3148,7 @@ async function handleWorkflowRoute(input: {
|
|
|
3147
3148
|
error: terminalState.error ?? null,
|
|
3148
3149
|
totalRows: terminalState.totalRows ?? null,
|
|
3149
3150
|
durationMs: terminalState.durationMs ?? null,
|
|
3151
|
+
completedAt: terminalState.completedAt ?? null,
|
|
3150
3152
|
wait: null,
|
|
3151
3153
|
coordinatorObserve: {
|
|
3152
3154
|
ms: Date.now() - statusStartedAt,
|
|
@@ -3229,7 +3231,7 @@ function stableHash(value: string): string {
|
|
|
3229
3231
|
}
|
|
3230
3232
|
|
|
3231
3233
|
const DYNAMIC_PLAY_WORKER_HARNESS_VERSION =
|
|
3232
|
-
'
|
|
3234
|
+
'h7-skip-high-volume-tool-traces';
|
|
3233
3235
|
const DYNAMIC_WORKER_BUNDLED_CODE_CACHE_MAX_ENTRIES = 64;
|
|
3234
3236
|
const dynamicWorkerBundledCodeCache = new Map<string, string>();
|
|
3235
3237
|
|
|
@@ -555,6 +555,12 @@ function recordRunnerPerfTrace(input: {
|
|
|
555
555
|
extra?: Record<string, unknown>;
|
|
556
556
|
}): void {
|
|
557
557
|
if (!input.req.runId || !input.phase) return;
|
|
558
|
+
// Tool-level traces can fire once per row/provider step. Forwarding each one
|
|
559
|
+
// through the coordinator binding can consume Cloudflare's subrequest budget
|
|
560
|
+
// before large batched maps finish.
|
|
561
|
+
if (input.phase.startsWith('runner.tool.')) {
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
558
564
|
const payload = {
|
|
559
565
|
ts: Date.now(),
|
|
560
566
|
source: 'dynamic_worker' as const,
|
|
@@ -67,6 +67,26 @@ import type { PlayCompilerManifest } from '../../shared_libs/plays/compiler-mani
|
|
|
67
67
|
|
|
68
68
|
const TERMINAL_PLAY_STATUSES = new Set(['completed', 'failed', 'cancelled']);
|
|
69
69
|
const INCLUDE_TOOL_METADATA_HEADER = 'x-deepline-include-tool-metadata';
|
|
70
|
+
const COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1_000];
|
|
71
|
+
|
|
72
|
+
function sleep(ms: number): Promise<void> {
|
|
73
|
+
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function isTransientCompileManifestError(error: unknown): boolean {
|
|
77
|
+
if (error instanceof DeeplineError && typeof error.statusCode === 'number') {
|
|
78
|
+
return (
|
|
79
|
+
error.statusCode === 408 ||
|
|
80
|
+
error.statusCode === 425 ||
|
|
81
|
+
error.statusCode === 499 ||
|
|
82
|
+
(error.statusCode >= 500 && error.statusCode < 600)
|
|
83
|
+
);
|
|
84
|
+
}
|
|
85
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
86
|
+
return /fetch failed|connection (?:closed|reset|terminated)|socket hang up|econnreset|etimedout|eai_again|abort/i.test(
|
|
87
|
+
message,
|
|
88
|
+
);
|
|
89
|
+
}
|
|
70
90
|
|
|
71
91
|
type ExecuteToolRawOptions = {
|
|
72
92
|
includeToolMetadata?: boolean;
|
|
@@ -759,10 +779,24 @@ export class DeeplineClient {
|
|
|
759
779
|
artifact: Record<string, unknown>;
|
|
760
780
|
importedPlayDependencies?: PlayCompilerManifest[];
|
|
761
781
|
}): Promise<PlayCompilerManifest> {
|
|
762
|
-
const
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
782
|
+
const retryDelays = COMPILE_MANIFEST_RETRY_DELAYS_MS.slice(
|
|
783
|
+
0,
|
|
784
|
+
Math.max(0, this.config.maxRetries),
|
|
785
|
+
);
|
|
786
|
+
for (let attempt = 0; ; attempt += 1) {
|
|
787
|
+
try {
|
|
788
|
+
const response = await this.http.post<{
|
|
789
|
+
compilerManifest: PlayCompilerManifest;
|
|
790
|
+
}>('/api/v2/plays/compile-manifest', input);
|
|
791
|
+
return response.compilerManifest;
|
|
792
|
+
} catch (error) {
|
|
793
|
+
const delayMs = retryDelays[attempt];
|
|
794
|
+
if (delayMs === undefined || !isTransientCompileManifestError(error)) {
|
|
795
|
+
throw error;
|
|
796
|
+
}
|
|
797
|
+
await sleep(delayMs);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
766
800
|
}
|
|
767
801
|
|
|
768
802
|
/**
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const SDK_VERSION = "0.1.
|
|
1
|
+
export const SDK_VERSION = "0.1.23";
|
|
2
2
|
export const SDK_API_CONTRACT = "2026-05-runs-v2";
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
export const EXECUTION_PLAN_DEFAULTS = {
|
|
8
8
|
inlineRowsLimit: 1_000,
|
|
9
9
|
largeMapChunkSize: 5_000,
|
|
10
|
+
complexMapChunkSize: 1_000,
|
|
10
11
|
workflowSoftStepBudget: 20_000,
|
|
11
12
|
workflowHardStepBudget: 25_000,
|
|
12
13
|
ingestStepCount: 1,
|
|
@@ -183,6 +184,10 @@ function extractPlanMaps(
|
|
|
183
184
|
(substep): substep is Extract<PlayStaticSubstep, { type: 'waterfall' }> =>
|
|
184
185
|
substep.type === 'waterfall',
|
|
185
186
|
);
|
|
187
|
+
const fallbackStepSuites = substeps.filter(
|
|
188
|
+
(substep): substep is Extract<PlayStaticSubstep, { type: 'step_suite' }> =>
|
|
189
|
+
substep.type === 'step_suite',
|
|
190
|
+
);
|
|
186
191
|
return substeps
|
|
187
192
|
.filter(
|
|
188
193
|
(substep): substep is Extract<PlayStaticSubstep, { type: 'map' }> =>
|
|
@@ -200,13 +205,33 @@ function extractPlanMaps(
|
|
|
200
205
|
waterfallId: waterfall.id ?? waterfall.field,
|
|
201
206
|
stageIds: waterfall.steps?.map((step) => step.id) ?? [],
|
|
202
207
|
}));
|
|
208
|
+
const stepSuites = fallbackStepSuites.filter((stepSuite) => {
|
|
209
|
+
if (!mapSubstep.waterfallIds?.length) return true;
|
|
210
|
+
return mapSubstep.waterfallIds.includes(stepSuite.field);
|
|
211
|
+
});
|
|
212
|
+
const stepSuiteStepsPerChunk = stepSuites.reduce(
|
|
213
|
+
(max, stepSuite) => Math.max(max, stepSuite.steps.length),
|
|
214
|
+
0,
|
|
215
|
+
);
|
|
216
|
+
const waterfallStepsPerChunk = waterfallStages.reduce(
|
|
217
|
+
(max, waterfall) => Math.max(max, waterfall.stageIds.length),
|
|
218
|
+
0,
|
|
219
|
+
);
|
|
220
|
+
const stepsPerChunk = Math.max(
|
|
221
|
+
1,
|
|
222
|
+
waterfallStepsPerChunk,
|
|
223
|
+
stepSuiteStepsPerChunk,
|
|
224
|
+
);
|
|
203
225
|
return {
|
|
204
226
|
mapName: mapSubstep.name ?? mapSubstep.field,
|
|
205
227
|
tableNamespace: mapSubstep.tableNamespace ?? mapSubstep.field,
|
|
206
228
|
outputFields: mapSubstep.outputFields ?? [],
|
|
207
229
|
waterfallStages,
|
|
208
|
-
defaultChunkSize:
|
|
209
|
-
|
|
230
|
+
defaultChunkSize:
|
|
231
|
+
stepsPerChunk > 1
|
|
232
|
+
? EXECUTION_PLAN_DEFAULTS.complexMapChunkSize
|
|
233
|
+
: EXECUTION_PLAN_DEFAULTS.largeMapChunkSize,
|
|
234
|
+
stepsPerChunk,
|
|
210
235
|
};
|
|
211
236
|
});
|
|
212
237
|
}
|