deepline 0.1.182 → 0.1.184
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/child-play-await.ts +203 -6
- package/dist/bundling-sources/apps/play-runner-workers/src/child-play-submit.ts +8 -1
- package/dist/bundling-sources/apps/play-runner-workers/src/coordinator-entry.ts +639 -109
- package/dist/bundling-sources/apps/play-runner-workers/src/dedup-do.ts +3 -2
- package/dist/bundling-sources/apps/play-runner-workers/src/entry.ts +1752 -1899
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/harness-receipt-store.ts +116 -0
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/map-chunk-plan.ts +542 -78
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/receipts.ts +292 -11
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/run-work-dispatcher.ts +519 -0
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-dispatch.ts +2381 -0
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/tool-receipts.ts +18 -5
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/work-budget.ts +130 -0
- package/dist/bundling-sources/apps/play-runner-workers/src/runtime/worker-platform-budget.ts +39 -0
- package/dist/bundling-sources/apps/play-runner-workers/src/workflow-retry-state.ts +2 -0
- package/dist/bundling-sources/sdk/src/client.ts +41 -0
- package/dist/bundling-sources/sdk/src/http.ts +23 -8
- package/dist/bundling-sources/sdk/src/plays/harness-stub.ts +56 -3
- 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/app-runtime-api.ts +133 -10
- package/dist/bundling-sources/shared_libs/play-runtime/auth-scope-resolver.ts +92 -0
- package/dist/bundling-sources/shared_libs/play-runtime/batch-runtime.ts +4 -4
- package/dist/bundling-sources/shared_libs/play-runtime/batching-types.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/child-run-id.ts +101 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +1612 -287
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +105 -6
- package/dist/bundling-sources/shared_libs/play-runtime/dedup-backend.ts +0 -0
- package/dist/bundling-sources/shared_libs/play-runtime/default-batch-strategies.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durability-store.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +116 -16
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +186 -20
- package/dist/bundling-sources/shared_libs/play-runtime/dynamic-worker-version.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execution-ledger-store.ts +133 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +245 -0
- package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +5 -5
- package/dist/bundling-sources/shared_libs/play-runtime/governor/policy.ts +14 -0
- package/dist/bundling-sources/shared_libs/play-runtime/lease-policy.ts +52 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +41 -0
- package/dist/bundling-sources/shared_libs/play-runtime/providers.ts +3 -2
- package/dist/bundling-sources/shared_libs/play-runtime/receipt-sql.ts +124 -0
- package/dist/bundling-sources/shared_libs/play-runtime/receipt-status.ts +6 -2
- package/dist/bundling-sources/shared_libs/play-runtime/row-isolation.ts +48 -2
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +158 -15
- package/dist/bundling-sources/shared_libs/play-runtime/run-terminal-source.ts +45 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-actions.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-paths.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +2038 -262
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-contract.ts +42 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-attempt-state-machine.ts +183 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-errors.ts +88 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +8 -1
- package/dist/bundling-sources/shared_libs/play-runtime/sheet-attempt-sql.ts +103 -0
- package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +19 -1
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +343 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +43 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +11 -0
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipt-state-machine.ts +437 -0
- package/dist/bundling-sources/shared_libs/play-runtime/work-receipts.ts +83 -6
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +28 -11
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +38 -6
- package/dist/bundling-sources/shared_libs/security/safe-outbound-fetch.ts +24 -17
- package/dist/cli/index.js +76 -17
- package/dist/cli/index.mjs +76 -17
- package/dist/index.d.mts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +63 -9
- package/dist/index.mjs +63 -9
- package/dist/plays/bundle-play-file.mjs +20 -6
- package/package.json +1 -1
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.
|
|
425
|
+
version: "0.1.184",
|
|
426
426
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
427
427
|
supportPolicy: {
|
|
428
|
-
latest: "0.1.
|
|
428
|
+
latest: "0.1.184",
|
|
429
429
|
minimumSupported: "0.1.53",
|
|
430
430
|
deprecatedBelow: "0.1.53",
|
|
431
431
|
commandMinimumSupported: [
|
|
@@ -583,6 +583,10 @@ var WORKER_CALLBACK_URL_OVERRIDE_HEADER = "x-deepline-worker-callback-url";
|
|
|
583
583
|
var RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER = "x-deepline-runtime-scheduler-schema";
|
|
584
584
|
var SYNTHETIC_RUN_HEADER = "x-deepline-synthetic-run";
|
|
585
585
|
|
|
586
|
+
// ../shared_libs/play-runtime/test-runtime-seams.ts
|
|
587
|
+
var PLAY_RUNTIME_TEST_FAULT_HEADER = "x-deepline-test-fault";
|
|
588
|
+
var MAX_RUNTIME_TEST_POLICY_MS = 10 * 6e4;
|
|
589
|
+
|
|
586
590
|
// src/http.ts
|
|
587
591
|
var MAX_DIAGNOSTIC_HEADER_LENGTH = 120;
|
|
588
592
|
var COWORK_NETWORK_HINT = "Claude Cowork appears to be running Deepline in a network-restricted sandbox. In Claude Desktop, open Settings > Capabilities, turn on Allow network egress, and set Domain allowlist to All domains for the Cowork session.";
|
|
@@ -697,12 +701,9 @@ var HttpClient = class {
|
|
|
697
701
|
headers["x-deepline-play-artifact-r2-prefix"] = playArtifactR2Prefix;
|
|
698
702
|
}
|
|
699
703
|
const coordinatorUrl = typeof process !== "undefined" ? process.env?.DEEPLINE_COORDINATOR_URL : void 0;
|
|
704
|
+
const coordinatorInternalToken = typeof process !== "undefined" ? process.env?.DEEPLINE_INTERNAL_TOKEN : void 0;
|
|
700
705
|
if (coordinatorUrl?.trim()) {
|
|
701
706
|
headers[COORDINATOR_URL_OVERRIDE_HEADER] = coordinatorUrl.trim();
|
|
702
|
-
const coordinatorInternalToken = typeof process !== "undefined" ? process.env?.DEEPLINE_INTERNAL_TOKEN : void 0;
|
|
703
|
-
if (coordinatorInternalToken?.trim()) {
|
|
704
|
-
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
705
|
-
}
|
|
706
707
|
}
|
|
707
708
|
const workerCallbackUrl = typeof process !== "undefined" ? process.env?.DEEPLINE_WORKER_CALLBACK_URL : void 0;
|
|
708
709
|
if (workerCallbackUrl?.trim()) {
|
|
@@ -716,6 +717,13 @@ var HttpClient = class {
|
|
|
716
717
|
if (syntheticRun && syntheticRun.trim() && syntheticRun.trim() !== "0") {
|
|
717
718
|
headers[SYNTHETIC_RUN_HEADER] = "1";
|
|
718
719
|
}
|
|
720
|
+
const runtimeTestFault = typeof process !== "undefined" ? process.env?.DEEPLINE_TEST_RUNTIME_FAULT : void 0;
|
|
721
|
+
if (runtimeTestFault?.trim()) {
|
|
722
|
+
headers[PLAY_RUNTIME_TEST_FAULT_HEADER] = runtimeTestFault.trim();
|
|
723
|
+
}
|
|
724
|
+
if (coordinatorInternalToken?.trim() && (coordinatorUrl?.trim() || workerCallbackUrl?.trim() || runtimeTestFault?.trim())) {
|
|
725
|
+
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
726
|
+
}
|
|
719
727
|
return headers;
|
|
720
728
|
}
|
|
721
729
|
/**
|
|
@@ -1129,6 +1137,20 @@ function resolveTimingWindow(input) {
|
|
|
1129
1137
|
};
|
|
1130
1138
|
}
|
|
1131
1139
|
|
|
1140
|
+
// ../shared_libs/play-runtime/run-terminal-source.ts
|
|
1141
|
+
var PLAY_RUN_LEDGER_EVENT_SOURCES = [
|
|
1142
|
+
"worker",
|
|
1143
|
+
"temporal",
|
|
1144
|
+
"convex",
|
|
1145
|
+
"coordinator",
|
|
1146
|
+
"system"
|
|
1147
|
+
];
|
|
1148
|
+
function normalizePlayRunLedgerTerminalSource(value) {
|
|
1149
|
+
return PLAY_RUN_LEDGER_EVENT_SOURCES.includes(
|
|
1150
|
+
value
|
|
1151
|
+
) ? value : null;
|
|
1152
|
+
}
|
|
1153
|
+
|
|
1132
1154
|
// ../shared_libs/play-runtime/run-ledger.ts
|
|
1133
1155
|
var LOG_TAIL_LIMIT = 100;
|
|
1134
1156
|
function isRecord(value) {
|
|
@@ -1265,7 +1287,8 @@ function normalizePlayRunLedgerSnapshot(value, fallback) {
|
|
|
1265
1287
|
),
|
|
1266
1288
|
resultTableNamespace: optionalNullableString(value.resultTableNamespace),
|
|
1267
1289
|
resultSummary: value.resultSummary,
|
|
1268
|
-
result: value.result
|
|
1290
|
+
result: value.result,
|
|
1291
|
+
terminalSource: normalizePlayRunLedgerTerminalSource(value.terminalSource)
|
|
1269
1292
|
};
|
|
1270
1293
|
}
|
|
1271
1294
|
function normalizeStepStatus(value) {
|
|
@@ -1990,6 +2013,33 @@ function resolvePlayRunIntegrationMode(request) {
|
|
|
1990
2013
|
request.integrationMode ?? process.env.DEEPLINE_EVAL_INTEGRATION_MODE
|
|
1991
2014
|
);
|
|
1992
2015
|
}
|
|
2016
|
+
function normalizeTestPolicyOverrides(value, source) {
|
|
2017
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
2018
|
+
return value;
|
|
2019
|
+
}
|
|
2020
|
+
throw new DeeplineError(
|
|
2021
|
+
`${source} must be a JSON object.`,
|
|
2022
|
+
void 0,
|
|
2023
|
+
"INVALID_TEST_POLICY_OVERRIDES"
|
|
2024
|
+
);
|
|
2025
|
+
}
|
|
2026
|
+
function parseEnvTestPolicyOverrides() {
|
|
2027
|
+
const raw = typeof process !== "undefined" ? process.env?.DEEPLINE_TEST_POLICY_OVERRIDES : void 0;
|
|
2028
|
+
const trimmed = raw?.trim();
|
|
2029
|
+
if (!trimmed) return void 0;
|
|
2030
|
+
let parsed;
|
|
2031
|
+
try {
|
|
2032
|
+
parsed = JSON.parse(trimmed);
|
|
2033
|
+
} catch (error) {
|
|
2034
|
+
const detail = error instanceof Error ? ` ${error.message}` : "";
|
|
2035
|
+
throw new DeeplineError(
|
|
2036
|
+
`DEEPLINE_TEST_POLICY_OVERRIDES must be valid JSON.${detail}`,
|
|
2037
|
+
void 0,
|
|
2038
|
+
"INVALID_TEST_POLICY_OVERRIDES"
|
|
2039
|
+
);
|
|
2040
|
+
}
|
|
2041
|
+
return normalizeTestPolicyOverrides(parsed, "DEEPLINE_TEST_POLICY_OVERRIDES");
|
|
2042
|
+
}
|
|
1993
2043
|
function sleep2(ms) {
|
|
1994
2044
|
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
1995
2045
|
}
|
|
@@ -2632,6 +2682,7 @@ var DeeplineClient = class {
|
|
|
2632
2682
|
*/
|
|
2633
2683
|
async startPlayRun(request) {
|
|
2634
2684
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
2685
|
+
const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
|
|
2635
2686
|
const forceToolRefresh = request.forceToolRefresh === true;
|
|
2636
2687
|
const response = await this.http.post(
|
|
2637
2688
|
"/api/v2/plays/run",
|
|
@@ -2659,7 +2710,8 @@ var DeeplineClient = class {
|
|
|
2659
2710
|
// defaults to workers_edge; tests and runtime probes that want a
|
|
2660
2711
|
// different profile pass `request.profile` explicitly.
|
|
2661
2712
|
...request.profile ? { profile: request.profile } : {},
|
|
2662
|
-
...integrationMode ? { integrationMode } : {}
|
|
2713
|
+
...integrationMode ? { integrationMode } : {},
|
|
2714
|
+
...testPolicyOverrides ? { testPolicyOverrides } : {}
|
|
2663
2715
|
}
|
|
2664
2716
|
);
|
|
2665
2717
|
return normalizePlayRunStart(response);
|
|
@@ -2677,6 +2729,7 @@ var DeeplineClient = class {
|
|
|
2677
2729
|
*/
|
|
2678
2730
|
async *startPlayRunStream(request, options) {
|
|
2679
2731
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
2732
|
+
const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
|
|
2680
2733
|
const forceToolRefresh = request.forceToolRefresh === true;
|
|
2681
2734
|
const body = {
|
|
2682
2735
|
...request.name ? { name: request.name } : {},
|
|
@@ -2699,7 +2752,8 @@ var DeeplineClient = class {
|
|
|
2699
2752
|
...forceToolRefresh ? { forceToolRefresh: true } : {},
|
|
2700
2753
|
...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
|
|
2701
2754
|
...request.profile ? { profile: request.profile } : {},
|
|
2702
|
-
...integrationMode ? { integrationMode } : {}
|
|
2755
|
+
...integrationMode ? { integrationMode } : {},
|
|
2756
|
+
...testPolicyOverrides ? { testPolicyOverrides } : {}
|
|
2703
2757
|
};
|
|
2704
2758
|
for await (const event of this.http.streamSse(
|
|
2705
2759
|
"/api/v2/plays/run?stream=true",
|
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.
|
|
355
|
+
version: "0.1.184",
|
|
356
356
|
apiContract: "2026-06-dataset-handle-results-hard-cutover",
|
|
357
357
|
supportPolicy: {
|
|
358
|
-
latest: "0.1.
|
|
358
|
+
latest: "0.1.184",
|
|
359
359
|
minimumSupported: "0.1.53",
|
|
360
360
|
deprecatedBelow: "0.1.53",
|
|
361
361
|
commandMinimumSupported: [
|
|
@@ -513,6 +513,10 @@ var WORKER_CALLBACK_URL_OVERRIDE_HEADER = "x-deepline-worker-callback-url";
|
|
|
513
513
|
var RUNTIME_SCHEDULER_SCHEMA_OVERRIDE_HEADER = "x-deepline-runtime-scheduler-schema";
|
|
514
514
|
var SYNTHETIC_RUN_HEADER = "x-deepline-synthetic-run";
|
|
515
515
|
|
|
516
|
+
// ../shared_libs/play-runtime/test-runtime-seams.ts
|
|
517
|
+
var PLAY_RUNTIME_TEST_FAULT_HEADER = "x-deepline-test-fault";
|
|
518
|
+
var MAX_RUNTIME_TEST_POLICY_MS = 10 * 6e4;
|
|
519
|
+
|
|
516
520
|
// src/http.ts
|
|
517
521
|
var MAX_DIAGNOSTIC_HEADER_LENGTH = 120;
|
|
518
522
|
var COWORK_NETWORK_HINT = "Claude Cowork appears to be running Deepline in a network-restricted sandbox. In Claude Desktop, open Settings > Capabilities, turn on Allow network egress, and set Domain allowlist to All domains for the Cowork session.";
|
|
@@ -627,12 +631,9 @@ var HttpClient = class {
|
|
|
627
631
|
headers["x-deepline-play-artifact-r2-prefix"] = playArtifactR2Prefix;
|
|
628
632
|
}
|
|
629
633
|
const coordinatorUrl = typeof process !== "undefined" ? process.env?.DEEPLINE_COORDINATOR_URL : void 0;
|
|
634
|
+
const coordinatorInternalToken = typeof process !== "undefined" ? process.env?.DEEPLINE_INTERNAL_TOKEN : void 0;
|
|
630
635
|
if (coordinatorUrl?.trim()) {
|
|
631
636
|
headers[COORDINATOR_URL_OVERRIDE_HEADER] = coordinatorUrl.trim();
|
|
632
|
-
const coordinatorInternalToken = typeof process !== "undefined" ? process.env?.DEEPLINE_INTERNAL_TOKEN : void 0;
|
|
633
|
-
if (coordinatorInternalToken?.trim()) {
|
|
634
|
-
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
635
|
-
}
|
|
636
637
|
}
|
|
637
638
|
const workerCallbackUrl = typeof process !== "undefined" ? process.env?.DEEPLINE_WORKER_CALLBACK_URL : void 0;
|
|
638
639
|
if (workerCallbackUrl?.trim()) {
|
|
@@ -646,6 +647,13 @@ var HttpClient = class {
|
|
|
646
647
|
if (syntheticRun && syntheticRun.trim() && syntheticRun.trim() !== "0") {
|
|
647
648
|
headers[SYNTHETIC_RUN_HEADER] = "1";
|
|
648
649
|
}
|
|
650
|
+
const runtimeTestFault = typeof process !== "undefined" ? process.env?.DEEPLINE_TEST_RUNTIME_FAULT : void 0;
|
|
651
|
+
if (runtimeTestFault?.trim()) {
|
|
652
|
+
headers[PLAY_RUNTIME_TEST_FAULT_HEADER] = runtimeTestFault.trim();
|
|
653
|
+
}
|
|
654
|
+
if (coordinatorInternalToken?.trim() && (coordinatorUrl?.trim() || workerCallbackUrl?.trim() || runtimeTestFault?.trim())) {
|
|
655
|
+
headers[COORDINATOR_INTERNAL_TOKEN_HEADER] = coordinatorInternalToken.trim();
|
|
656
|
+
}
|
|
649
657
|
return headers;
|
|
650
658
|
}
|
|
651
659
|
/**
|
|
@@ -1059,6 +1067,20 @@ function resolveTimingWindow(input) {
|
|
|
1059
1067
|
};
|
|
1060
1068
|
}
|
|
1061
1069
|
|
|
1070
|
+
// ../shared_libs/play-runtime/run-terminal-source.ts
|
|
1071
|
+
var PLAY_RUN_LEDGER_EVENT_SOURCES = [
|
|
1072
|
+
"worker",
|
|
1073
|
+
"temporal",
|
|
1074
|
+
"convex",
|
|
1075
|
+
"coordinator",
|
|
1076
|
+
"system"
|
|
1077
|
+
];
|
|
1078
|
+
function normalizePlayRunLedgerTerminalSource(value) {
|
|
1079
|
+
return PLAY_RUN_LEDGER_EVENT_SOURCES.includes(
|
|
1080
|
+
value
|
|
1081
|
+
) ? value : null;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1062
1084
|
// ../shared_libs/play-runtime/run-ledger.ts
|
|
1063
1085
|
var LOG_TAIL_LIMIT = 100;
|
|
1064
1086
|
function isRecord(value) {
|
|
@@ -1195,7 +1217,8 @@ function normalizePlayRunLedgerSnapshot(value, fallback) {
|
|
|
1195
1217
|
),
|
|
1196
1218
|
resultTableNamespace: optionalNullableString(value.resultTableNamespace),
|
|
1197
1219
|
resultSummary: value.resultSummary,
|
|
1198
|
-
result: value.result
|
|
1220
|
+
result: value.result,
|
|
1221
|
+
terminalSource: normalizePlayRunLedgerTerminalSource(value.terminalSource)
|
|
1199
1222
|
};
|
|
1200
1223
|
}
|
|
1201
1224
|
function normalizeStepStatus(value) {
|
|
@@ -1920,6 +1943,33 @@ function resolvePlayRunIntegrationMode(request) {
|
|
|
1920
1943
|
request.integrationMode ?? process.env.DEEPLINE_EVAL_INTEGRATION_MODE
|
|
1921
1944
|
);
|
|
1922
1945
|
}
|
|
1946
|
+
function normalizeTestPolicyOverrides(value, source) {
|
|
1947
|
+
if (value && typeof value === "object" && !Array.isArray(value)) {
|
|
1948
|
+
return value;
|
|
1949
|
+
}
|
|
1950
|
+
throw new DeeplineError(
|
|
1951
|
+
`${source} must be a JSON object.`,
|
|
1952
|
+
void 0,
|
|
1953
|
+
"INVALID_TEST_POLICY_OVERRIDES"
|
|
1954
|
+
);
|
|
1955
|
+
}
|
|
1956
|
+
function parseEnvTestPolicyOverrides() {
|
|
1957
|
+
const raw = typeof process !== "undefined" ? process.env?.DEEPLINE_TEST_POLICY_OVERRIDES : void 0;
|
|
1958
|
+
const trimmed = raw?.trim();
|
|
1959
|
+
if (!trimmed) return void 0;
|
|
1960
|
+
let parsed;
|
|
1961
|
+
try {
|
|
1962
|
+
parsed = JSON.parse(trimmed);
|
|
1963
|
+
} catch (error) {
|
|
1964
|
+
const detail = error instanceof Error ? ` ${error.message}` : "";
|
|
1965
|
+
throw new DeeplineError(
|
|
1966
|
+
`DEEPLINE_TEST_POLICY_OVERRIDES must be valid JSON.${detail}`,
|
|
1967
|
+
void 0,
|
|
1968
|
+
"INVALID_TEST_POLICY_OVERRIDES"
|
|
1969
|
+
);
|
|
1970
|
+
}
|
|
1971
|
+
return normalizeTestPolicyOverrides(parsed, "DEEPLINE_TEST_POLICY_OVERRIDES");
|
|
1972
|
+
}
|
|
1923
1973
|
function sleep2(ms) {
|
|
1924
1974
|
return new Promise((resolve2) => setTimeout(resolve2, ms));
|
|
1925
1975
|
}
|
|
@@ -2562,6 +2612,7 @@ var DeeplineClient = class {
|
|
|
2562
2612
|
*/
|
|
2563
2613
|
async startPlayRun(request) {
|
|
2564
2614
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
2615
|
+
const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
|
|
2565
2616
|
const forceToolRefresh = request.forceToolRefresh === true;
|
|
2566
2617
|
const response = await this.http.post(
|
|
2567
2618
|
"/api/v2/plays/run",
|
|
@@ -2589,7 +2640,8 @@ var DeeplineClient = class {
|
|
|
2589
2640
|
// defaults to workers_edge; tests and runtime probes that want a
|
|
2590
2641
|
// different profile pass `request.profile` explicitly.
|
|
2591
2642
|
...request.profile ? { profile: request.profile } : {},
|
|
2592
|
-
...integrationMode ? { integrationMode } : {}
|
|
2643
|
+
...integrationMode ? { integrationMode } : {},
|
|
2644
|
+
...testPolicyOverrides ? { testPolicyOverrides } : {}
|
|
2593
2645
|
}
|
|
2594
2646
|
);
|
|
2595
2647
|
return normalizePlayRunStart(response);
|
|
@@ -2607,6 +2659,7 @@ var DeeplineClient = class {
|
|
|
2607
2659
|
*/
|
|
2608
2660
|
async *startPlayRunStream(request, options) {
|
|
2609
2661
|
const integrationMode = resolvePlayRunIntegrationMode(request);
|
|
2662
|
+
const testPolicyOverrides = request.testPolicyOverrides ?? parseEnvTestPolicyOverrides();
|
|
2610
2663
|
const forceToolRefresh = request.forceToolRefresh === true;
|
|
2611
2664
|
const body = {
|
|
2612
2665
|
...request.name ? { name: request.name } : {},
|
|
@@ -2629,7 +2682,8 @@ var DeeplineClient = class {
|
|
|
2629
2682
|
...forceToolRefresh ? { forceToolRefresh: true } : {},
|
|
2630
2683
|
...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
|
|
2631
2684
|
...request.profile ? { profile: request.profile } : {},
|
|
2632
|
-
...integrationMode ? { integrationMode } : {}
|
|
2685
|
+
...integrationMode ? { integrationMode } : {},
|
|
2686
|
+
...testPolicyOverrides ? { testPolicyOverrides } : {}
|
|
2633
2687
|
};
|
|
2634
2688
|
for await (const event of this.http.streamSse(
|
|
2635
2689
|
"/api/v2/plays/run?stream=true",
|
|
@@ -514,7 +514,9 @@ function buildPlayMetadataContext(ast) {
|
|
|
514
514
|
}
|
|
515
515
|
if (statement.type === "ExportNamedDeclaration") {
|
|
516
516
|
if (isAstNode(statement.declaration) && statement.declaration.type === "VariableDeclaration") {
|
|
517
|
-
for (const declaration of astArray(
|
|
517
|
+
for (const declaration of astArray(
|
|
518
|
+
statement.declaration.declarations
|
|
519
|
+
)) {
|
|
518
520
|
const name = getIdentifierName(declaration.id);
|
|
519
521
|
if (!name) continue;
|
|
520
522
|
const initializer = isAstNode(declaration.init) ? declaration.init : null;
|
|
@@ -665,7 +667,11 @@ function playMetadataFromDefinePlayCall(node, context) {
|
|
|
665
667
|
}
|
|
666
668
|
const args = astArray(expression.arguments);
|
|
667
669
|
const firstArg = args[0] ?? null;
|
|
668
|
-
const objectName = stringPropertyFromObjectExpression(
|
|
670
|
+
const objectName = stringPropertyFromObjectExpression(
|
|
671
|
+
firstArg,
|
|
672
|
+
"id",
|
|
673
|
+
context
|
|
674
|
+
);
|
|
669
675
|
const name = objectName ?? staticStringFromExpression(firstArg, context);
|
|
670
676
|
let description = stringPropertyFromObjectExpression(firstArg, "description", context) ?? null;
|
|
671
677
|
for (let index = args.length - 1; !description && index >= 2; index -= 1) {
|
|
@@ -1158,7 +1164,11 @@ async function analyzeSourceGraph(entryFile, adapter, exportName) {
|
|
|
1158
1164
|
return;
|
|
1159
1165
|
}
|
|
1160
1166
|
visited.add(absolutePath);
|
|
1161
|
-
const sourceCode2 = await readFile(
|
|
1167
|
+
const sourceCode2 = await readFile(
|
|
1168
|
+
/* turbopackIgnore: true */
|
|
1169
|
+
absolutePath,
|
|
1170
|
+
"utf-8"
|
|
1171
|
+
);
|
|
1162
1172
|
localFiles.set(absolutePath, sourceCode2);
|
|
1163
1173
|
if (extname(absolutePath).toLowerCase() === ".json") {
|
|
1164
1174
|
return;
|
|
@@ -1186,7 +1196,11 @@ async function analyzeSourceGraph(entryFile, adapter, exportName) {
|
|
|
1186
1196
|
column
|
|
1187
1197
|
});
|
|
1188
1198
|
if (resolved !== absoluteEntryFile && isPlaySourceFile(resolved)) {
|
|
1189
|
-
const importedSource = await readFile(
|
|
1199
|
+
const importedSource = await readFile(
|
|
1200
|
+
/* turbopackIgnore: true */
|
|
1201
|
+
resolved,
|
|
1202
|
+
"utf-8"
|
|
1203
|
+
);
|
|
1190
1204
|
const importedPlayName = extractDefinedPlayName(importedSource);
|
|
1191
1205
|
if (!importedPlayName) {
|
|
1192
1206
|
throw new Error(
|
|
@@ -1749,9 +1763,9 @@ var PLAY_RUNTIME_PROVIDERS = {
|
|
|
1749
1763
|
id: PLAY_RUNTIME_PROVIDER_IDS.hatchet,
|
|
1750
1764
|
scheduler: PLAY_SCHEDULER_BACKENDS.hatchet,
|
|
1751
1765
|
runner: PLAY_RUNTIME_BACKENDS.daytona,
|
|
1752
|
-
dedup: PLAY_DEDUP_BACKENDS.
|
|
1766
|
+
dedup: PLAY_DEDUP_BACKENDS.inMemory,
|
|
1753
1767
|
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
1754
|
-
label: "Hatchet scheduler + one-shot Daytona runner +
|
|
1768
|
+
label: "Hatchet scheduler + one-shot Daytona runner + receipt-backed in-process dedup"
|
|
1755
1769
|
},
|
|
1756
1770
|
local: {
|
|
1757
1771
|
id: PLAY_RUNTIME_PROVIDER_IDS.local,
|