deepline 0.1.174 → 0.1.176
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/bundling-sources/apps/play-runner-workers/src/coordinator-entry.ts +3 -0
- package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +17 -7
- package/dist/bundling-sources/sdk/src/client.ts +31 -1
- package/dist/bundling-sources/sdk/src/http.ts +19 -7
- package/dist/bundling-sources/sdk/src/plays/harness-stub.ts +1 -0
- package/dist/bundling-sources/sdk/src/release.ts +2 -2
- package/dist/bundling-sources/sdk/src/types.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +45 -15
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +6 -12
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +123 -32
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +2 -0
- package/dist/cli/index.js +256 -39
- package/dist/cli/index.mjs +256 -39
- package/dist/index.d.mts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +30 -12
- package/dist/index.mjs +30 -12
- package/package.json +1 -1
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.
|
|
424
|
+
version: "0.1.176",
|
|
425
425
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
426
426
|
supportPolicy: {
|
|
427
|
-
latest: "0.1.
|
|
427
|
+
latest: "0.1.176",
|
|
428
428
|
minimumSupported: "0.1.53",
|
|
429
429
|
deprecatedBelow: "0.1.53",
|
|
430
430
|
commandMinimumSupported: [
|
|
@@ -685,9 +685,10 @@ var HttpClient = class {
|
|
|
685
685
|
headers["Content-Type"] = "application/json";
|
|
686
686
|
}
|
|
687
687
|
let lastError = null;
|
|
688
|
-
const candidateUrls = buildCandidateUrls(url);
|
|
688
|
+
const candidateUrls = options?.exactUrlOnly ? [url] : buildCandidateUrls(url);
|
|
689
689
|
let retryAfterDelayMs = null;
|
|
690
|
-
|
|
690
|
+
const maxRetries = options?.maxRetries ?? this.config.maxRetries;
|
|
691
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
691
692
|
if (attempt > 0) {
|
|
692
693
|
const backoffMs = Math.min(1e3 * Math.pow(2, attempt - 1), 3e4);
|
|
693
694
|
const delayMs = retryAfterDelayMs === null ? backoffMs : Math.max(backoffMs, retryAfterDelayMs);
|
|
@@ -714,7 +715,7 @@ var HttpClient = class {
|
|
|
714
715
|
if (response.status === 429) {
|
|
715
716
|
const retryAfter = parseRetryAfter(response);
|
|
716
717
|
lastError = new RateLimitError(retryAfter);
|
|
717
|
-
if (attempt <
|
|
718
|
+
if (attempt < maxRetries) {
|
|
718
719
|
retryAfterDelayMs = retryAfter;
|
|
719
720
|
break;
|
|
720
721
|
}
|
|
@@ -744,7 +745,7 @@ var HttpClient = class {
|
|
|
744
745
|
...htmlError.workerThrewException ? { workerThrewException: true } : {}
|
|
745
746
|
}
|
|
746
747
|
);
|
|
747
|
-
if (retryableApiError && attempt <
|
|
748
|
+
if (retryableApiError && attempt < maxRetries) {
|
|
748
749
|
retryAfterDelayMs = parseOptionalRetryAfter(response);
|
|
749
750
|
break;
|
|
750
751
|
}
|
|
@@ -756,7 +757,7 @@ var HttpClient = class {
|
|
|
756
757
|
lastError = new DeeplineError(msg, response.status, apiErrorCode, {
|
|
757
758
|
response: parsed
|
|
758
759
|
});
|
|
759
|
-
if (retryableApiError && attempt <
|
|
760
|
+
if (retryableApiError && attempt < maxRetries) {
|
|
760
761
|
retryAfterDelayMs = parseOptionalRetryAfter(response);
|
|
761
762
|
break;
|
|
762
763
|
}
|
|
@@ -775,7 +776,7 @@ var HttpClient = class {
|
|
|
775
776
|
lastError = error instanceof Error ? error : new Error(String(error));
|
|
776
777
|
}
|
|
777
778
|
}
|
|
778
|
-
if (attempt <
|
|
779
|
+
if (attempt < maxRetries) continue;
|
|
779
780
|
}
|
|
780
781
|
if (lastError instanceof DeeplineError) {
|
|
781
782
|
throw lastError;
|
|
@@ -1910,6 +1911,7 @@ var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
|
|
|
1910
1911
|
var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
|
|
1911
1912
|
var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
|
|
1912
1913
|
var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_BYTES = 25e5;
|
|
1914
|
+
var DEEPLINEAGENT_EXECUTE_TIMEOUT_MS = 15 * 60 * 1e3;
|
|
1913
1915
|
function normalizePlayRunIntegrationMode(value) {
|
|
1914
1916
|
if (value === "live" || value === "eval_stub" || value === "fixture") {
|
|
1915
1917
|
return value;
|
|
@@ -1984,6 +1986,10 @@ function chunkRegisterPlayArtifacts(artifacts) {
|
|
|
1984
1986
|
}
|
|
1985
1987
|
return chunks;
|
|
1986
1988
|
}
|
|
1989
|
+
function resolveToolExecuteTimeoutMs(toolId) {
|
|
1990
|
+
const normalized = toolId.trim().toLowerCase();
|
|
1991
|
+
return normalized === "deeplineagent" || normalized === "deeplineagent_deeplineagent" || normalized === "ai_inference" || normalized === "deeplineagent_ai_inference" || normalized === "aiinference" ? DEEPLINEAGENT_EXECUTE_TIMEOUT_MS : void 0;
|
|
1992
|
+
}
|
|
1987
1993
|
var RUN_LOGS_PAGE_LIMIT = 1e3;
|
|
1988
1994
|
function isRecord3(value) {
|
|
1989
1995
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
@@ -2423,7 +2429,12 @@ var DeeplineClient = class {
|
|
|
2423
2429
|
`/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
|
|
2424
2430
|
{ payload: input },
|
|
2425
2431
|
headers,
|
|
2426
|
-
{
|
|
2432
|
+
{
|
|
2433
|
+
forbiddenAsApiError: true,
|
|
2434
|
+
timeout: options?.timeout ?? resolveToolExecuteTimeoutMs(toolId),
|
|
2435
|
+
maxRetries: options?.maxRetries ?? 0,
|
|
2436
|
+
exactUrlOnly: true
|
|
2437
|
+
}
|
|
2427
2438
|
);
|
|
2428
2439
|
}
|
|
2429
2440
|
/**
|
|
@@ -2485,6 +2496,7 @@ var DeeplineClient = class {
|
|
|
2485
2496
|
*/
|
|
2486
2497
|
async startPlayRun(request) {
|
|
2487
2498
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
2499
|
+
const forceToolRefresh = request.forceToolRefresh === true;
|
|
2488
2500
|
const response = await this.http.post(
|
|
2489
2501
|
"/api/v2/plays/run",
|
|
2490
2502
|
{
|
|
@@ -2505,6 +2517,7 @@ var DeeplineClient = class {
|
|
|
2505
2517
|
...request.inputFile ? { inputFile: request.inputFile } : {},
|
|
2506
2518
|
...request.packagedFiles?.length ? { packagedFiles: request.packagedFiles } : {},
|
|
2507
2519
|
...request.force ? { force: true } : {},
|
|
2520
|
+
...forceToolRefresh ? { forceToolRefresh: true } : {},
|
|
2508
2521
|
...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
|
|
2509
2522
|
// Profile selection is the API's job, not the CLI's. The server
|
|
2510
2523
|
// defaults to workers_edge; tests and runtime probes that want a
|
|
@@ -2528,6 +2541,7 @@ var DeeplineClient = class {
|
|
|
2528
2541
|
*/
|
|
2529
2542
|
async *startPlayRunStream(request, options) {
|
|
2530
2543
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
2544
|
+
const forceToolRefresh = request.forceToolRefresh === true;
|
|
2531
2545
|
const body = {
|
|
2532
2546
|
...request.name ? { name: request.name } : {},
|
|
2533
2547
|
...request.revisionId ? { revisionId: request.revisionId } : {},
|
|
@@ -2546,6 +2560,7 @@ var DeeplineClient = class {
|
|
|
2546
2560
|
...request.inputFile ? { inputFile: request.inputFile } : {},
|
|
2547
2561
|
...request.packagedFiles?.length ? { packagedFiles: request.packagedFiles } : {},
|
|
2548
2562
|
...request.force ? { force: true } : {},
|
|
2563
|
+
...forceToolRefresh ? { forceToolRefresh: true } : {},
|
|
2549
2564
|
...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
|
|
2550
2565
|
...request.profile ? { profile: request.profile } : {},
|
|
2551
2566
|
...integrationMode ? { integrationMode } : {}
|
|
@@ -2717,7 +2732,8 @@ var DeeplineClient = class {
|
|
|
2717
2732
|
...input.input ? { input: input.input } : {},
|
|
2718
2733
|
...input.inputFile ? { inputFile: input.inputFile } : {},
|
|
2719
2734
|
...input.packagedFiles?.length ? { packagedFiles: input.packagedFiles } : {},
|
|
2720
|
-
...input.force ? { force: true } : {}
|
|
2735
|
+
...input.force ? { force: true } : {},
|
|
2736
|
+
...input.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
2721
2737
|
});
|
|
2722
2738
|
}
|
|
2723
2739
|
/**
|
|
@@ -2790,7 +2806,8 @@ var DeeplineClient = class {
|
|
|
2790
2806
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
2791
2807
|
...options?.inputFile ? { inputFile: options.inputFile } : {},
|
|
2792
2808
|
...options?.packagedFiles?.length ? { packagedFiles: options.packagedFiles } : {},
|
|
2793
|
-
...options?.force ? { force: true } : {}
|
|
2809
|
+
...options?.force ? { force: true } : {},
|
|
2810
|
+
...options?.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
2794
2811
|
});
|
|
2795
2812
|
}
|
|
2796
2813
|
/**
|
|
@@ -3672,7 +3689,8 @@ var DeeplineClient = class {
|
|
|
3672
3689
|
compilerManifest: options?.compilerManifest,
|
|
3673
3690
|
inputFile: options?.inputFile,
|
|
3674
3691
|
packagedFiles: options?.packagedFiles,
|
|
3675
|
-
force: options?.force
|
|
3692
|
+
force: options?.force,
|
|
3693
|
+
forceToolRefresh: options?.forceToolRefresh
|
|
3676
3694
|
});
|
|
3677
3695
|
const start = Date.now();
|
|
3678
3696
|
const state = {
|
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.
|
|
354
|
+
version: "0.1.176",
|
|
355
355
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
356
356
|
supportPolicy: {
|
|
357
|
-
latest: "0.1.
|
|
357
|
+
latest: "0.1.176",
|
|
358
358
|
minimumSupported: "0.1.53",
|
|
359
359
|
deprecatedBelow: "0.1.53",
|
|
360
360
|
commandMinimumSupported: [
|
|
@@ -615,9 +615,10 @@ var HttpClient = class {
|
|
|
615
615
|
headers["Content-Type"] = "application/json";
|
|
616
616
|
}
|
|
617
617
|
let lastError = null;
|
|
618
|
-
const candidateUrls = buildCandidateUrls(url);
|
|
618
|
+
const candidateUrls = options?.exactUrlOnly ? [url] : buildCandidateUrls(url);
|
|
619
619
|
let retryAfterDelayMs = null;
|
|
620
|
-
|
|
620
|
+
const maxRetries = options?.maxRetries ?? this.config.maxRetries;
|
|
621
|
+
for (let attempt = 0; attempt <= maxRetries; attempt++) {
|
|
621
622
|
if (attempt > 0) {
|
|
622
623
|
const backoffMs = Math.min(1e3 * Math.pow(2, attempt - 1), 3e4);
|
|
623
624
|
const delayMs = retryAfterDelayMs === null ? backoffMs : Math.max(backoffMs, retryAfterDelayMs);
|
|
@@ -644,7 +645,7 @@ var HttpClient = class {
|
|
|
644
645
|
if (response.status === 429) {
|
|
645
646
|
const retryAfter = parseRetryAfter(response);
|
|
646
647
|
lastError = new RateLimitError(retryAfter);
|
|
647
|
-
if (attempt <
|
|
648
|
+
if (attempt < maxRetries) {
|
|
648
649
|
retryAfterDelayMs = retryAfter;
|
|
649
650
|
break;
|
|
650
651
|
}
|
|
@@ -674,7 +675,7 @@ var HttpClient = class {
|
|
|
674
675
|
...htmlError.workerThrewException ? { workerThrewException: true } : {}
|
|
675
676
|
}
|
|
676
677
|
);
|
|
677
|
-
if (retryableApiError && attempt <
|
|
678
|
+
if (retryableApiError && attempt < maxRetries) {
|
|
678
679
|
retryAfterDelayMs = parseOptionalRetryAfter(response);
|
|
679
680
|
break;
|
|
680
681
|
}
|
|
@@ -686,7 +687,7 @@ var HttpClient = class {
|
|
|
686
687
|
lastError = new DeeplineError(msg, response.status, apiErrorCode, {
|
|
687
688
|
response: parsed
|
|
688
689
|
});
|
|
689
|
-
if (retryableApiError && attempt <
|
|
690
|
+
if (retryableApiError && attempt < maxRetries) {
|
|
690
691
|
retryAfterDelayMs = parseOptionalRetryAfter(response);
|
|
691
692
|
break;
|
|
692
693
|
}
|
|
@@ -705,7 +706,7 @@ var HttpClient = class {
|
|
|
705
706
|
lastError = error instanceof Error ? error : new Error(String(error));
|
|
706
707
|
}
|
|
707
708
|
}
|
|
708
|
-
if (attempt <
|
|
709
|
+
if (attempt < maxRetries) continue;
|
|
709
710
|
}
|
|
710
711
|
if (lastError instanceof DeeplineError) {
|
|
711
712
|
throw lastError;
|
|
@@ -1840,6 +1841,7 @@ var COMPILE_MANIFEST_RETRY_DELAYS_MS = [250, 1e3];
|
|
|
1840
1841
|
var REGISTER_PLAY_ARTIFACTS_COMPILE_CONCURRENCY = 3;
|
|
1841
1842
|
var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_COUNT = 3;
|
|
1842
1843
|
var REGISTER_PLAY_ARTIFACTS_MAX_BATCH_BYTES = 25e5;
|
|
1844
|
+
var DEEPLINEAGENT_EXECUTE_TIMEOUT_MS = 15 * 60 * 1e3;
|
|
1843
1845
|
function normalizePlayRunIntegrationMode(value) {
|
|
1844
1846
|
if (value === "live" || value === "eval_stub" || value === "fixture") {
|
|
1845
1847
|
return value;
|
|
@@ -1914,6 +1916,10 @@ function chunkRegisterPlayArtifacts(artifacts) {
|
|
|
1914
1916
|
}
|
|
1915
1917
|
return chunks;
|
|
1916
1918
|
}
|
|
1919
|
+
function resolveToolExecuteTimeoutMs(toolId) {
|
|
1920
|
+
const normalized = toolId.trim().toLowerCase();
|
|
1921
|
+
return normalized === "deeplineagent" || normalized === "deeplineagent_deeplineagent" || normalized === "ai_inference" || normalized === "deeplineagent_ai_inference" || normalized === "aiinference" ? DEEPLINEAGENT_EXECUTE_TIMEOUT_MS : void 0;
|
|
1922
|
+
}
|
|
1917
1923
|
var RUN_LOGS_PAGE_LIMIT = 1e3;
|
|
1918
1924
|
function isRecord3(value) {
|
|
1919
1925
|
return Boolean(value && typeof value === "object" && !Array.isArray(value));
|
|
@@ -2353,7 +2359,12 @@ var DeeplineClient = class {
|
|
|
2353
2359
|
`/api/v2/integrations/${encodeURIComponent(toolId)}/execute`,
|
|
2354
2360
|
{ payload: input },
|
|
2355
2361
|
headers,
|
|
2356
|
-
{
|
|
2362
|
+
{
|
|
2363
|
+
forbiddenAsApiError: true,
|
|
2364
|
+
timeout: options?.timeout ?? resolveToolExecuteTimeoutMs(toolId),
|
|
2365
|
+
maxRetries: options?.maxRetries ?? 0,
|
|
2366
|
+
exactUrlOnly: true
|
|
2367
|
+
}
|
|
2357
2368
|
);
|
|
2358
2369
|
}
|
|
2359
2370
|
/**
|
|
@@ -2415,6 +2426,7 @@ var DeeplineClient = class {
|
|
|
2415
2426
|
*/
|
|
2416
2427
|
async startPlayRun(request) {
|
|
2417
2428
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
2429
|
+
const forceToolRefresh = request.forceToolRefresh === true;
|
|
2418
2430
|
const response = await this.http.post(
|
|
2419
2431
|
"/api/v2/plays/run",
|
|
2420
2432
|
{
|
|
@@ -2435,6 +2447,7 @@ var DeeplineClient = class {
|
|
|
2435
2447
|
...request.inputFile ? { inputFile: request.inputFile } : {},
|
|
2436
2448
|
...request.packagedFiles?.length ? { packagedFiles: request.packagedFiles } : {},
|
|
2437
2449
|
...request.force ? { force: true } : {},
|
|
2450
|
+
...forceToolRefresh ? { forceToolRefresh: true } : {},
|
|
2438
2451
|
...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
|
|
2439
2452
|
// Profile selection is the API's job, not the CLI's. The server
|
|
2440
2453
|
// defaults to workers_edge; tests and runtime probes that want a
|
|
@@ -2458,6 +2471,7 @@ var DeeplineClient = class {
|
|
|
2458
2471
|
*/
|
|
2459
2472
|
async *startPlayRunStream(request, options) {
|
|
2460
2473
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
2474
|
+
const forceToolRefresh = request.forceToolRefresh === true;
|
|
2461
2475
|
const body = {
|
|
2462
2476
|
...request.name ? { name: request.name } : {},
|
|
2463
2477
|
...request.revisionId ? { revisionId: request.revisionId } : {},
|
|
@@ -2476,6 +2490,7 @@ var DeeplineClient = class {
|
|
|
2476
2490
|
...request.inputFile ? { inputFile: request.inputFile } : {},
|
|
2477
2491
|
...request.packagedFiles?.length ? { packagedFiles: request.packagedFiles } : {},
|
|
2478
2492
|
...request.force ? { force: true } : {},
|
|
2493
|
+
...forceToolRefresh ? { forceToolRefresh: true } : {},
|
|
2479
2494
|
...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
|
|
2480
2495
|
...request.profile ? { profile: request.profile } : {},
|
|
2481
2496
|
...integrationMode ? { integrationMode } : {}
|
|
@@ -2647,7 +2662,8 @@ var DeeplineClient = class {
|
|
|
2647
2662
|
...input.input ? { input: input.input } : {},
|
|
2648
2663
|
...input.inputFile ? { inputFile: input.inputFile } : {},
|
|
2649
2664
|
...input.packagedFiles?.length ? { packagedFiles: input.packagedFiles } : {},
|
|
2650
|
-
...input.force ? { force: true } : {}
|
|
2665
|
+
...input.force ? { force: true } : {},
|
|
2666
|
+
...input.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
2651
2667
|
});
|
|
2652
2668
|
}
|
|
2653
2669
|
/**
|
|
@@ -2720,7 +2736,8 @@ var DeeplineClient = class {
|
|
|
2720
2736
|
...Object.keys(runtimeInput).length > 0 ? { input: runtimeInput } : {},
|
|
2721
2737
|
...options?.inputFile ? { inputFile: options.inputFile } : {},
|
|
2722
2738
|
...options?.packagedFiles?.length ? { packagedFiles: options.packagedFiles } : {},
|
|
2723
|
-
...options?.force ? { force: true } : {}
|
|
2739
|
+
...options?.force ? { force: true } : {},
|
|
2740
|
+
...options?.forceToolRefresh ? { forceToolRefresh: true } : {}
|
|
2724
2741
|
});
|
|
2725
2742
|
}
|
|
2726
2743
|
/**
|
|
@@ -3602,7 +3619,8 @@ var DeeplineClient = class {
|
|
|
3602
3619
|
compilerManifest: options?.compilerManifest,
|
|
3603
3620
|
inputFile: options?.inputFile,
|
|
3604
3621
|
packagedFiles: options?.packagedFiles,
|
|
3605
|
-
force: options?.force
|
|
3622
|
+
force: options?.force,
|
|
3623
|
+
forceToolRefresh: options?.forceToolRefresh
|
|
3606
3624
|
});
|
|
3607
3625
|
const start = Date.now();
|
|
3608
3626
|
const state = {
|