deepline 0.2.0 → 0.2.2
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/sdk/src/client.ts +17 -3
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-job-errors.ts +95 -0
- package/dist/bundling-sources/shared_libs/play-runtime/backend.ts +19 -0
- package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +104 -0
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +4 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +177 -10
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-modal-fallback.ts +218 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +26 -7
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +34 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +380 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/index.ts +28 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/runtime-sandbox-reconciliation.ts +240 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +28 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-environment.ts +17 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sandbox-placement-policy.ts +188 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +77 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +7 -0
- package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/worker-api-types.ts +39 -0
- package/dist/cli/index.js +50 -26
- package/dist/cli/index.mjs +50 -26
- package/dist/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +50 -5
- package/dist/index.mjs +50 -5
- package/dist/plays/bundle-play-file.d.mts +2 -2
- package/dist/plays/bundle-play-file.d.ts +2 -2
- package/dist/plays/bundle-play-file.mjs +7 -1
- package/dist/{tool-execution-error-YDz7UMl-.d.mts → tool-execution-error-4-rhemLQ.d.mts} +7 -1
- package/dist/{tool-execution-error-YDz7UMl-.d.ts → tool-execution-error-4-rhemLQ.d.ts} +7 -1
- package/package.json +1 -1
package/dist/cli/index.mjs
CHANGED
|
@@ -1025,7 +1025,7 @@ var SDK_RELEASE = {
|
|
|
1025
1025
|
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
1026
1026
|
// exposed storage-dependent synchronous access. This deliberate minor
|
|
1027
1027
|
// release keeps lazy paging semantics independent of row residency.
|
|
1028
|
-
version: "0.2.
|
|
1028
|
+
version: "0.2.2",
|
|
1029
1029
|
contracts: {
|
|
1030
1030
|
api: {
|
|
1031
1031
|
name: "sdk-http-api",
|
|
@@ -3232,6 +3232,33 @@ function usesExtendedTheirstackJobSearchBudget(endpointId, payload) {
|
|
|
3232
3232
|
return maxAgeDays !== null && maxAgeDays >= 365 ? true : usesLongExplicitDateWindow(payload);
|
|
3233
3233
|
}
|
|
3234
3234
|
|
|
3235
|
+
// ../shared_libs/play-runtime/backend.ts
|
|
3236
|
+
var PLAY_RUNTIME_BACKENDS = {
|
|
3237
|
+
localProcess: "local_process",
|
|
3238
|
+
daytona: "daytona",
|
|
3239
|
+
modal: "modal"
|
|
3240
|
+
};
|
|
3241
|
+
var PLAY_ARTIFACT_KINDS = {
|
|
3242
|
+
cjsNode20: "cjs_node20"
|
|
3243
|
+
};
|
|
3244
|
+
var PLAY_BACKEND_DESCRIPTORS = {
|
|
3245
|
+
[PLAY_RUNTIME_BACKENDS.localProcess]: {
|
|
3246
|
+
id: PLAY_RUNTIME_BACKENDS.localProcess,
|
|
3247
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
3248
|
+
label: "Local node subprocess"
|
|
3249
|
+
},
|
|
3250
|
+
[PLAY_RUNTIME_BACKENDS.daytona]: {
|
|
3251
|
+
id: PLAY_RUNTIME_BACKENDS.daytona,
|
|
3252
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
3253
|
+
label: "Daytona sandbox"
|
|
3254
|
+
},
|
|
3255
|
+
[PLAY_RUNTIME_BACKENDS.modal]: {
|
|
3256
|
+
id: PLAY_RUNTIME_BACKENDS.modal,
|
|
3257
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
3258
|
+
label: "Modal sandbox"
|
|
3259
|
+
}
|
|
3260
|
+
};
|
|
3261
|
+
|
|
3235
3262
|
// ../shared_libs/play-runtime/runtime-environment.ts
|
|
3236
3263
|
var PLAY_RUNTIME_ENVIRONMENTS = ["preview"];
|
|
3237
3264
|
var PLAY_RUNTIME_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]{0,30}$/;
|
|
@@ -3244,12 +3271,19 @@ function normalizePlayRuntimeSelection(value) {
|
|
|
3244
3271
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
3245
3272
|
const record = value;
|
|
3246
3273
|
if (Object.keys(record).some(
|
|
3247
|
-
(key) => key !== "environment" && key !== "namespace"
|
|
3274
|
+
(key) => key !== "environment" && key !== "namespace" && key !== "backend"
|
|
3248
3275
|
) || record.environment !== "preview") {
|
|
3249
3276
|
return null;
|
|
3250
3277
|
}
|
|
3251
3278
|
const namespace = normalizePlayRuntimeNamespace(record.namespace);
|
|
3252
|
-
|
|
3279
|
+
if (!namespace) return null;
|
|
3280
|
+
if (record.backend === void 0) {
|
|
3281
|
+
return { environment: "preview", namespace };
|
|
3282
|
+
}
|
|
3283
|
+
if (record.backend !== PLAY_RUNTIME_BACKENDS.daytona && record.backend !== PLAY_RUNTIME_BACKENDS.modal) {
|
|
3284
|
+
return null;
|
|
3285
|
+
}
|
|
3286
|
+
return { environment: "preview", namespace, backend: record.backend };
|
|
3253
3287
|
}
|
|
3254
3288
|
function normalizePlayRuntimeEnvironment(value) {
|
|
3255
3289
|
return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
|
|
@@ -3282,7 +3316,7 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
3282
3316
|
const runtime = normalizePlayRuntimeSelection(request.runtime);
|
|
3283
3317
|
if (!runtime) {
|
|
3284
3318
|
throw new DeeplineError(
|
|
3285
|
-
'runtime must be
|
|
3319
|
+
'runtime must be { environment: "preview", namespace, backend?: "daytona" | "modal" } with namespace matching ^[a-z][a-z0-9-]{0,30}$.',
|
|
3286
3320
|
void 0,
|
|
3287
3321
|
"INVALID_RUNTIME_SELECTION"
|
|
3288
3322
|
);
|
|
@@ -3318,7 +3352,18 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
3318
3352
|
"INVALID_RUNTIME_NAMESPACE"
|
|
3319
3353
|
);
|
|
3320
3354
|
}
|
|
3321
|
-
|
|
3355
|
+
const configuredBackend = process.env.DEEPLINE_PLAY_RUNNER_BACKEND?.trim();
|
|
3356
|
+
if (!configuredBackend) {
|
|
3357
|
+
return { environment, namespace };
|
|
3358
|
+
}
|
|
3359
|
+
if (configuredBackend !== "daytona" && configuredBackend !== "modal") {
|
|
3360
|
+
throw new DeeplineError(
|
|
3361
|
+
`DEEPLINE_PLAY_RUNNER_BACKEND must be daytona or modal for preview runtime selection. Received "${configuredBackend}".`,
|
|
3362
|
+
void 0,
|
|
3363
|
+
"INVALID_RUNTIME_BACKEND"
|
|
3364
|
+
);
|
|
3365
|
+
}
|
|
3366
|
+
return { environment, namespace, backend: configuredBackend };
|
|
3322
3367
|
}
|
|
3323
3368
|
function runtimeSelectionHeaders(runtime) {
|
|
3324
3369
|
if (!runtime) return void 0;
|
|
@@ -12096,27 +12141,6 @@ ${hint}`;
|
|
|
12096
12141
|
});
|
|
12097
12142
|
}
|
|
12098
12143
|
|
|
12099
|
-
// ../shared_libs/play-runtime/backend.ts
|
|
12100
|
-
var PLAY_RUNTIME_BACKENDS = {
|
|
12101
|
-
localProcess: "local_process",
|
|
12102
|
-
daytona: "daytona"
|
|
12103
|
-
};
|
|
12104
|
-
var PLAY_ARTIFACT_KINDS = {
|
|
12105
|
-
cjsNode20: "cjs_node20"
|
|
12106
|
-
};
|
|
12107
|
-
var PLAY_BACKEND_DESCRIPTORS = {
|
|
12108
|
-
[PLAY_RUNTIME_BACKENDS.localProcess]: {
|
|
12109
|
-
id: PLAY_RUNTIME_BACKENDS.localProcess,
|
|
12110
|
-
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
12111
|
-
label: "Local node subprocess"
|
|
12112
|
-
},
|
|
12113
|
-
[PLAY_RUNTIME_BACKENDS.daytona]: {
|
|
12114
|
-
id: PLAY_RUNTIME_BACKENDS.daytona,
|
|
12115
|
-
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
12116
|
-
label: "Daytona sandbox"
|
|
12117
|
-
}
|
|
12118
|
-
};
|
|
12119
|
-
|
|
12120
12144
|
// ../shared_libs/play-runtime/dedup-backend.ts
|
|
12121
12145
|
var PLAY_DEDUP_BACKENDS = {
|
|
12122
12146
|
inMemory: "in_memory",
|
package/dist/index.d.mts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { a as PlayCompilerManifest, D as DeeplineError,
|
|
2
|
-
export {
|
|
1
|
+
import { c as PlayRuntimeBackendId, a as PlayCompilerManifest, D as DeeplineError, d as ToolExecutionError, e as ToolExecutionErrorOptions, T as ToolExecutionErrorSchemaVersion } from './tool-execution-error-4-rhemLQ.mjs';
|
|
2
|
+
export { f as ProviderTransientError, g as ProviderTransientErrorCategory, h as ToolExecutionErrorCategory, i as ToolExecutionErrorOrigin, j as ToolExecutionFailureV1, k as ToolExecutionNetworkKind, l as ToolExecutionNetworkScope } from './tool-execution-error-4-rhemLQ.mjs';
|
|
3
3
|
|
|
4
4
|
type PlayRuntimeSelection = {
|
|
5
5
|
environment: 'preview';
|
|
6
6
|
/** Caller-named isolation scope inside a remote runtime environment. */
|
|
7
7
|
namespace: string;
|
|
8
|
+
/** Explicit managed-sandbox executor. Omission preserves Daytona compatibility. */
|
|
9
|
+
backend?: Extract<PlayRuntimeBackendId, 'daytona' | 'modal'>;
|
|
8
10
|
};
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -1990,7 +1992,7 @@ type MonitorUpdateChangeSummary = {
|
|
|
1990
1992
|
};
|
|
1991
1993
|
upstream: {
|
|
1992
1994
|
resource_replaced: boolean;
|
|
1993
|
-
strategy: 'unchanged' | 'create_then_delete_previous';
|
|
1995
|
+
strategy: 'unchanged' | 'create_then_delete_previous' | 'deferred_until_reactivation';
|
|
1994
1996
|
};
|
|
1995
1997
|
};
|
|
1996
1998
|
type MonitorUpdateResult = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { a as PlayCompilerManifest, D as DeeplineError,
|
|
2
|
-
export {
|
|
1
|
+
import { c as PlayRuntimeBackendId, a as PlayCompilerManifest, D as DeeplineError, d as ToolExecutionError, e as ToolExecutionErrorOptions, T as ToolExecutionErrorSchemaVersion } from './tool-execution-error-4-rhemLQ.js';
|
|
2
|
+
export { f as ProviderTransientError, g as ProviderTransientErrorCategory, h as ToolExecutionErrorCategory, i as ToolExecutionErrorOrigin, j as ToolExecutionFailureV1, k as ToolExecutionNetworkKind, l as ToolExecutionNetworkScope } from './tool-execution-error-4-rhemLQ.js';
|
|
3
3
|
|
|
4
4
|
type PlayRuntimeSelection = {
|
|
5
5
|
environment: 'preview';
|
|
6
6
|
/** Caller-named isolation scope inside a remote runtime environment. */
|
|
7
7
|
namespace: string;
|
|
8
|
+
/** Explicit managed-sandbox executor. Omission preserves Daytona compatibility. */
|
|
9
|
+
backend?: Extract<PlayRuntimeBackendId, 'daytona' | 'modal'>;
|
|
8
10
|
};
|
|
9
11
|
|
|
10
12
|
/**
|
|
@@ -1990,7 +1992,7 @@ type MonitorUpdateChangeSummary = {
|
|
|
1990
1992
|
};
|
|
1991
1993
|
upstream: {
|
|
1992
1994
|
resource_replaced: boolean;
|
|
1993
|
-
strategy: 'unchanged' | 'create_then_delete_previous';
|
|
1995
|
+
strategy: 'unchanged' | 'create_then_delete_previous' | 'deferred_until_reactivation';
|
|
1994
1996
|
};
|
|
1995
1997
|
};
|
|
1996
1998
|
type MonitorUpdateResult = {
|
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.
|
|
766
|
+
version: "0.2.2",
|
|
767
767
|
contracts: {
|
|
768
768
|
api: {
|
|
769
769
|
name: "sdk-http-api",
|
|
@@ -2970,6 +2970,33 @@ function usesExtendedTheirstackJobSearchBudget(endpointId, payload) {
|
|
|
2970
2970
|
return maxAgeDays !== null && maxAgeDays >= 365 ? true : usesLongExplicitDateWindow(payload);
|
|
2971
2971
|
}
|
|
2972
2972
|
|
|
2973
|
+
// ../shared_libs/play-runtime/backend.ts
|
|
2974
|
+
var PLAY_RUNTIME_BACKENDS = {
|
|
2975
|
+
localProcess: "local_process",
|
|
2976
|
+
daytona: "daytona",
|
|
2977
|
+
modal: "modal"
|
|
2978
|
+
};
|
|
2979
|
+
var PLAY_ARTIFACT_KINDS = {
|
|
2980
|
+
cjsNode20: "cjs_node20"
|
|
2981
|
+
};
|
|
2982
|
+
var PLAY_BACKEND_DESCRIPTORS = {
|
|
2983
|
+
[PLAY_RUNTIME_BACKENDS.localProcess]: {
|
|
2984
|
+
id: PLAY_RUNTIME_BACKENDS.localProcess,
|
|
2985
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
2986
|
+
label: "Local node subprocess"
|
|
2987
|
+
},
|
|
2988
|
+
[PLAY_RUNTIME_BACKENDS.daytona]: {
|
|
2989
|
+
id: PLAY_RUNTIME_BACKENDS.daytona,
|
|
2990
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
2991
|
+
label: "Daytona sandbox"
|
|
2992
|
+
},
|
|
2993
|
+
[PLAY_RUNTIME_BACKENDS.modal]: {
|
|
2994
|
+
id: PLAY_RUNTIME_BACKENDS.modal,
|
|
2995
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
2996
|
+
label: "Modal sandbox"
|
|
2997
|
+
}
|
|
2998
|
+
};
|
|
2999
|
+
|
|
2973
3000
|
// ../shared_libs/play-runtime/runtime-environment.ts
|
|
2974
3001
|
var PLAY_RUNTIME_ENVIRONMENTS = ["preview"];
|
|
2975
3002
|
var PLAY_RUNTIME_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]{0,30}$/;
|
|
@@ -2982,12 +3009,19 @@ function normalizePlayRuntimeSelection(value) {
|
|
|
2982
3009
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
2983
3010
|
const record = value;
|
|
2984
3011
|
if (Object.keys(record).some(
|
|
2985
|
-
(key) => key !== "environment" && key !== "namespace"
|
|
3012
|
+
(key) => key !== "environment" && key !== "namespace" && key !== "backend"
|
|
2986
3013
|
) || record.environment !== "preview") {
|
|
2987
3014
|
return null;
|
|
2988
3015
|
}
|
|
2989
3016
|
const namespace = normalizePlayRuntimeNamespace(record.namespace);
|
|
2990
|
-
|
|
3017
|
+
if (!namespace) return null;
|
|
3018
|
+
if (record.backend === void 0) {
|
|
3019
|
+
return { environment: "preview", namespace };
|
|
3020
|
+
}
|
|
3021
|
+
if (record.backend !== PLAY_RUNTIME_BACKENDS.daytona && record.backend !== PLAY_RUNTIME_BACKENDS.modal) {
|
|
3022
|
+
return null;
|
|
3023
|
+
}
|
|
3024
|
+
return { environment: "preview", namespace, backend: record.backend };
|
|
2991
3025
|
}
|
|
2992
3026
|
function normalizePlayRuntimeEnvironment(value) {
|
|
2993
3027
|
return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
|
|
@@ -3020,7 +3054,7 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
3020
3054
|
const runtime = normalizePlayRuntimeSelection(request.runtime);
|
|
3021
3055
|
if (!runtime) {
|
|
3022
3056
|
throw new DeeplineError(
|
|
3023
|
-
'runtime must be
|
|
3057
|
+
'runtime must be { environment: "preview", namespace, backend?: "daytona" | "modal" } with namespace matching ^[a-z][a-z0-9-]{0,30}$.',
|
|
3024
3058
|
void 0,
|
|
3025
3059
|
"INVALID_RUNTIME_SELECTION"
|
|
3026
3060
|
);
|
|
@@ -3056,7 +3090,18 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
3056
3090
|
"INVALID_RUNTIME_NAMESPACE"
|
|
3057
3091
|
);
|
|
3058
3092
|
}
|
|
3059
|
-
|
|
3093
|
+
const configuredBackend = process.env.DEEPLINE_PLAY_RUNNER_BACKEND?.trim();
|
|
3094
|
+
if (!configuredBackend) {
|
|
3095
|
+
return { environment, namespace };
|
|
3096
|
+
}
|
|
3097
|
+
if (configuredBackend !== "daytona" && configuredBackend !== "modal") {
|
|
3098
|
+
throw new DeeplineError(
|
|
3099
|
+
`DEEPLINE_PLAY_RUNNER_BACKEND must be daytona or modal for preview runtime selection. Received "${configuredBackend}".`,
|
|
3100
|
+
void 0,
|
|
3101
|
+
"INVALID_RUNTIME_BACKEND"
|
|
3102
|
+
);
|
|
3103
|
+
}
|
|
3104
|
+
return { environment, namespace, backend: configuredBackend };
|
|
3060
3105
|
}
|
|
3061
3106
|
function runtimeSelectionHeaders(runtime) {
|
|
3062
3107
|
if (!runtime) return void 0;
|
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.
|
|
692
|
+
version: "0.2.2",
|
|
693
693
|
contracts: {
|
|
694
694
|
api: {
|
|
695
695
|
name: "sdk-http-api",
|
|
@@ -2896,6 +2896,33 @@ function usesExtendedTheirstackJobSearchBudget(endpointId, payload) {
|
|
|
2896
2896
|
return maxAgeDays !== null && maxAgeDays >= 365 ? true : usesLongExplicitDateWindow(payload);
|
|
2897
2897
|
}
|
|
2898
2898
|
|
|
2899
|
+
// ../shared_libs/play-runtime/backend.ts
|
|
2900
|
+
var PLAY_RUNTIME_BACKENDS = {
|
|
2901
|
+
localProcess: "local_process",
|
|
2902
|
+
daytona: "daytona",
|
|
2903
|
+
modal: "modal"
|
|
2904
|
+
};
|
|
2905
|
+
var PLAY_ARTIFACT_KINDS = {
|
|
2906
|
+
cjsNode20: "cjs_node20"
|
|
2907
|
+
};
|
|
2908
|
+
var PLAY_BACKEND_DESCRIPTORS = {
|
|
2909
|
+
[PLAY_RUNTIME_BACKENDS.localProcess]: {
|
|
2910
|
+
id: PLAY_RUNTIME_BACKENDS.localProcess,
|
|
2911
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
2912
|
+
label: "Local node subprocess"
|
|
2913
|
+
},
|
|
2914
|
+
[PLAY_RUNTIME_BACKENDS.daytona]: {
|
|
2915
|
+
id: PLAY_RUNTIME_BACKENDS.daytona,
|
|
2916
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
2917
|
+
label: "Daytona sandbox"
|
|
2918
|
+
},
|
|
2919
|
+
[PLAY_RUNTIME_BACKENDS.modal]: {
|
|
2920
|
+
id: PLAY_RUNTIME_BACKENDS.modal,
|
|
2921
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
2922
|
+
label: "Modal sandbox"
|
|
2923
|
+
}
|
|
2924
|
+
};
|
|
2925
|
+
|
|
2899
2926
|
// ../shared_libs/play-runtime/runtime-environment.ts
|
|
2900
2927
|
var PLAY_RUNTIME_ENVIRONMENTS = ["preview"];
|
|
2901
2928
|
var PLAY_RUNTIME_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]{0,30}$/;
|
|
@@ -2908,12 +2935,19 @@ function normalizePlayRuntimeSelection(value) {
|
|
|
2908
2935
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
2909
2936
|
const record = value;
|
|
2910
2937
|
if (Object.keys(record).some(
|
|
2911
|
-
(key) => key !== "environment" && key !== "namespace"
|
|
2938
|
+
(key) => key !== "environment" && key !== "namespace" && key !== "backend"
|
|
2912
2939
|
) || record.environment !== "preview") {
|
|
2913
2940
|
return null;
|
|
2914
2941
|
}
|
|
2915
2942
|
const namespace = normalizePlayRuntimeNamespace(record.namespace);
|
|
2916
|
-
|
|
2943
|
+
if (!namespace) return null;
|
|
2944
|
+
if (record.backend === void 0) {
|
|
2945
|
+
return { environment: "preview", namespace };
|
|
2946
|
+
}
|
|
2947
|
+
if (record.backend !== PLAY_RUNTIME_BACKENDS.daytona && record.backend !== PLAY_RUNTIME_BACKENDS.modal) {
|
|
2948
|
+
return null;
|
|
2949
|
+
}
|
|
2950
|
+
return { environment: "preview", namespace, backend: record.backend };
|
|
2917
2951
|
}
|
|
2918
2952
|
function normalizePlayRuntimeEnvironment(value) {
|
|
2919
2953
|
return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
|
|
@@ -2946,7 +2980,7 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
2946
2980
|
const runtime = normalizePlayRuntimeSelection(request.runtime);
|
|
2947
2981
|
if (!runtime) {
|
|
2948
2982
|
throw new DeeplineError(
|
|
2949
|
-
'runtime must be
|
|
2983
|
+
'runtime must be { environment: "preview", namespace, backend?: "daytona" | "modal" } with namespace matching ^[a-z][a-z0-9-]{0,30}$.',
|
|
2950
2984
|
void 0,
|
|
2951
2985
|
"INVALID_RUNTIME_SELECTION"
|
|
2952
2986
|
);
|
|
@@ -2982,7 +3016,18 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
2982
3016
|
"INVALID_RUNTIME_NAMESPACE"
|
|
2983
3017
|
);
|
|
2984
3018
|
}
|
|
2985
|
-
|
|
3019
|
+
const configuredBackend = process.env.DEEPLINE_PLAY_RUNNER_BACKEND?.trim();
|
|
3020
|
+
if (!configuredBackend) {
|
|
3021
|
+
return { environment, namespace };
|
|
3022
|
+
}
|
|
3023
|
+
if (configuredBackend !== "daytona" && configuredBackend !== "modal") {
|
|
3024
|
+
throw new DeeplineError(
|
|
3025
|
+
`DEEPLINE_PLAY_RUNNER_BACKEND must be daytona or modal for preview runtime selection. Received "${configuredBackend}".`,
|
|
3026
|
+
void 0,
|
|
3027
|
+
"INVALID_RUNTIME_BACKEND"
|
|
3028
|
+
);
|
|
3029
|
+
}
|
|
3030
|
+
return { environment, namespace, backend: configuredBackend };
|
|
2986
3031
|
}
|
|
2987
3032
|
function runtimeSelectionHeaders(runtime) {
|
|
2988
3033
|
if (!runtime) return void 0;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as ToolExecutionErrorSchemaVersion, P as PlayArtifactKind$1, a as PlayCompilerManifest } from '../tool-execution-error-
|
|
2
|
-
export { b as PLAY_ARTIFACT_KINDS } from '../tool-execution-error-
|
|
1
|
+
import { T as ToolExecutionErrorSchemaVersion, P as PlayArtifactKind$1, a as PlayCompilerManifest } from '../tool-execution-error-4-rhemLQ.mjs';
|
|
2
|
+
export { b as PLAY_ARTIFACT_KINDS } from '../tool-execution-error-4-rhemLQ.mjs';
|
|
3
3
|
|
|
4
4
|
type PlayPackageImport = {
|
|
5
5
|
name: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { T as ToolExecutionErrorSchemaVersion, P as PlayArtifactKind$1, a as PlayCompilerManifest } from '../tool-execution-error-
|
|
2
|
-
export { b as PLAY_ARTIFACT_KINDS } from '../tool-execution-error-
|
|
1
|
+
import { T as ToolExecutionErrorSchemaVersion, P as PlayArtifactKind$1, a as PlayCompilerManifest } from '../tool-execution-error-4-rhemLQ.js';
|
|
2
|
+
export { b as PLAY_ARTIFACT_KINDS } from '../tool-execution-error-4-rhemLQ.js';
|
|
3
3
|
|
|
4
4
|
type PlayPackageImport = {
|
|
5
5
|
name: string;
|
|
@@ -25,7 +25,8 @@ import { build, transformSync } from "esbuild";
|
|
|
25
25
|
// ../shared_libs/play-runtime/backend.ts
|
|
26
26
|
var PLAY_RUNTIME_BACKENDS = {
|
|
27
27
|
localProcess: "local_process",
|
|
28
|
-
daytona: "daytona"
|
|
28
|
+
daytona: "daytona",
|
|
29
|
+
modal: "modal"
|
|
29
30
|
};
|
|
30
31
|
var PLAY_ARTIFACT_KINDS = {
|
|
31
32
|
cjsNode20: "cjs_node20"
|
|
@@ -40,6 +41,11 @@ var PLAY_BACKEND_DESCRIPTORS = {
|
|
|
40
41
|
id: PLAY_RUNTIME_BACKENDS.daytona,
|
|
41
42
|
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
42
43
|
label: "Daytona sandbox"
|
|
44
|
+
},
|
|
45
|
+
[PLAY_RUNTIME_BACKENDS.modal]: {
|
|
46
|
+
id: PLAY_RUNTIME_BACKENDS.modal,
|
|
47
|
+
artifactKind: PLAY_ARTIFACT_KINDS.cjsNode20,
|
|
48
|
+
label: "Modal sandbox"
|
|
43
49
|
}
|
|
44
50
|
};
|
|
45
51
|
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
declare const PLAY_RUNTIME_BACKENDS: {
|
|
2
|
+
readonly localProcess: "local_process";
|
|
3
|
+
readonly daytona: "daytona";
|
|
4
|
+
readonly modal: "modal";
|
|
5
|
+
};
|
|
6
|
+
type PlayRuntimeBackendId = (typeof PLAY_RUNTIME_BACKENDS)[keyof typeof PLAY_RUNTIME_BACKENDS];
|
|
1
7
|
/**
|
|
2
8
|
* The one executable Play artifact contract. Daytona and local-process both
|
|
3
9
|
* load CommonJS under Node 20.
|
|
@@ -437,4 +443,4 @@ declare class ProviderTransientError extends ToolExecutionError {
|
|
|
437
443
|
static [Symbol.hasInstance](value: unknown): boolean;
|
|
438
444
|
}
|
|
439
445
|
|
|
440
|
-
export { DeeplineError as D, type PlayArtifactKind as P, type ToolExecutionErrorSchemaVersion as T, type PlayCompilerManifest as a, PLAY_ARTIFACT_KINDS as b,
|
|
446
|
+
export { DeeplineError as D, type PlayArtifactKind as P, type ToolExecutionErrorSchemaVersion as T, type PlayCompilerManifest as a, PLAY_ARTIFACT_KINDS as b, type PlayRuntimeBackendId as c, ToolExecutionError as d, type ToolExecutionErrorOptions as e, ProviderTransientError as f, type ProviderTransientErrorCategory as g, type ToolExecutionErrorCategory as h, type ToolExecutionErrorOrigin as i, type ToolExecutionFailureV1 as j, type ToolExecutionNetworkKind as k, type ToolExecutionNetworkScope as l };
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
declare const PLAY_RUNTIME_BACKENDS: {
|
|
2
|
+
readonly localProcess: "local_process";
|
|
3
|
+
readonly daytona: "daytona";
|
|
4
|
+
readonly modal: "modal";
|
|
5
|
+
};
|
|
6
|
+
type PlayRuntimeBackendId = (typeof PLAY_RUNTIME_BACKENDS)[keyof typeof PLAY_RUNTIME_BACKENDS];
|
|
1
7
|
/**
|
|
2
8
|
* The one executable Play artifact contract. Daytona and local-process both
|
|
3
9
|
* load CommonJS under Node 20.
|
|
@@ -437,4 +443,4 @@ declare class ProviderTransientError extends ToolExecutionError {
|
|
|
437
443
|
static [Symbol.hasInstance](value: unknown): boolean;
|
|
438
444
|
}
|
|
439
445
|
|
|
440
|
-
export { DeeplineError as D, type PlayArtifactKind as P, type ToolExecutionErrorSchemaVersion as T, type PlayCompilerManifest as a, PLAY_ARTIFACT_KINDS as b,
|
|
446
|
+
export { DeeplineError as D, type PlayArtifactKind as P, type ToolExecutionErrorSchemaVersion as T, type PlayCompilerManifest as a, PLAY_ARTIFACT_KINDS as b, type PlayRuntimeBackendId as c, ToolExecutionError as d, type ToolExecutionErrorOptions as e, ProviderTransientError as f, type ProviderTransientErrorCategory as g, type ToolExecutionErrorCategory as h, type ToolExecutionErrorOrigin as i, type ToolExecutionFailureV1 as j, type ToolExecutionNetworkKind as k, type ToolExecutionNetworkScope as l };
|