deepline 0.1.320 → 0.2.1
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 +13 -2
- package/dist/bundling-sources/sdk/src/release.ts +4 -1
- 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 +106 -3
- 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 +33 -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 +5 -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/bundling-sources/shared_libs/plays/dataset.ts +43 -47
- package/dist/cli/index.js +55 -28
- package/dist/cli/index.mjs +55 -28
- package/dist/index.d.mts +8 -9
- package/dist/index.d.ts +8 -9
- package/dist/index.js +86 -38
- package/dist/index.mjs +86 -38
- 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/index.js
CHANGED
|
@@ -760,7 +760,10 @@ var SDK_RELEASE = {
|
|
|
760
760
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
761
761
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
762
762
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
763
|
-
|
|
763
|
+
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
764
|
+
// exposed storage-dependent synchronous access. This deliberate minor
|
|
765
|
+
// release keeps lazy paging semantics independent of row residency.
|
|
766
|
+
version: "0.2.1",
|
|
764
767
|
contracts: {
|
|
765
768
|
api: {
|
|
766
769
|
name: "sdk-http-api",
|
|
@@ -2967,6 +2970,33 @@ function usesExtendedTheirstackJobSearchBudget(endpointId, payload) {
|
|
|
2967
2970
|
return maxAgeDays !== null && maxAgeDays >= 365 ? true : usesLongExplicitDateWindow(payload);
|
|
2968
2971
|
}
|
|
2969
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
|
+
|
|
2970
3000
|
// ../shared_libs/play-runtime/runtime-environment.ts
|
|
2971
3001
|
var PLAY_RUNTIME_ENVIRONMENTS = ["preview"];
|
|
2972
3002
|
var PLAY_RUNTIME_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]{0,30}$/;
|
|
@@ -2979,12 +3009,19 @@ function normalizePlayRuntimeSelection(value) {
|
|
|
2979
3009
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
2980
3010
|
const record = value;
|
|
2981
3011
|
if (Object.keys(record).some(
|
|
2982
|
-
(key) => key !== "environment" && key !== "namespace"
|
|
3012
|
+
(key) => key !== "environment" && key !== "namespace" && key !== "backend"
|
|
2983
3013
|
) || record.environment !== "preview") {
|
|
2984
3014
|
return null;
|
|
2985
3015
|
}
|
|
2986
3016
|
const namespace = normalizePlayRuntimeNamespace(record.namespace);
|
|
2987
|
-
|
|
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 };
|
|
2988
3025
|
}
|
|
2989
3026
|
function normalizePlayRuntimeEnvironment(value) {
|
|
2990
3027
|
return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
|
|
@@ -3017,7 +3054,7 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
3017
3054
|
const runtime = normalizePlayRuntimeSelection(request.runtime);
|
|
3018
3055
|
if (!runtime) {
|
|
3019
3056
|
throw new DeeplineError(
|
|
3020
|
-
'runtime must be
|
|
3057
|
+
'runtime must be { environment: "preview", namespace, backend?: "daytona" | "modal" } with namespace matching ^[a-z][a-z0-9-]{0,30}$.',
|
|
3021
3058
|
void 0,
|
|
3022
3059
|
"INVALID_RUNTIME_SELECTION"
|
|
3023
3060
|
);
|
|
@@ -3053,7 +3090,18 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
3053
3090
|
"INVALID_RUNTIME_NAMESPACE"
|
|
3054
3091
|
);
|
|
3055
3092
|
}
|
|
3056
|
-
|
|
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 };
|
|
3057
3105
|
}
|
|
3058
3106
|
function runtimeSelectionHeaders(runtime) {
|
|
3059
3107
|
if (!runtime) return void 0;
|
|
@@ -5842,14 +5890,6 @@ var DeferredPlayDataset = class {
|
|
|
5842
5890
|
this.workProgress = input.workProgress;
|
|
5843
5891
|
this.resolvers = input.resolvers;
|
|
5844
5892
|
}
|
|
5845
|
-
get length() {
|
|
5846
|
-
if (this.knownCount === null) {
|
|
5847
|
-
throw this.requiresAsyncAccess(
|
|
5848
|
-
"The row count is not known until this lazy transform executes."
|
|
5849
|
-
);
|
|
5850
|
-
}
|
|
5851
|
-
return this.knownCount;
|
|
5852
|
-
}
|
|
5853
5893
|
async count() {
|
|
5854
5894
|
this.cachedCount = await this.resolvers.count();
|
|
5855
5895
|
this.knownCount = this.cachedCount;
|
|
@@ -5873,6 +5913,9 @@ var DeferredPlayDataset = class {
|
|
|
5873
5913
|
return void 0;
|
|
5874
5914
|
}
|
|
5875
5915
|
if (this.residentRows) return this.residentRows[normalized];
|
|
5916
|
+
if (normalized < this.previewRows.length) {
|
|
5917
|
+
return this.previewRows[normalized];
|
|
5918
|
+
}
|
|
5876
5919
|
if (this.resolvers.at) return await this.resolvers.at(normalized);
|
|
5877
5920
|
let current = 0;
|
|
5878
5921
|
for await (const row of this.resolvers.iterate()) {
|
|
@@ -5942,28 +5985,6 @@ var DeferredPlayDataset = class {
|
|
|
5942
5985
|
yield row;
|
|
5943
5986
|
}
|
|
5944
5987
|
}
|
|
5945
|
-
[Symbol.iterator]() {
|
|
5946
|
-
if (!this.residentRows) {
|
|
5947
|
-
throw this.requiresAsyncAccess(
|
|
5948
|
-
"Synchronous iteration is available only when every row is resident."
|
|
5949
|
-
);
|
|
5950
|
-
}
|
|
5951
|
-
return this.residentRows[Symbol.iterator]();
|
|
5952
|
-
}
|
|
5953
|
-
residentAt(index) {
|
|
5954
|
-
if (this.knownCount !== null && index >= this.knownCount) return void 0;
|
|
5955
|
-
if (!this.residentRows) {
|
|
5956
|
-
throw this.requiresAsyncAccess(
|
|
5957
|
-
`Row ${index} is not resident and may require dataset paging.`
|
|
5958
|
-
);
|
|
5959
|
-
}
|
|
5960
|
-
return this.residentRows[index];
|
|
5961
|
-
}
|
|
5962
|
-
requiresAsyncAccess(detail) {
|
|
5963
|
-
return new Error(
|
|
5964
|
-
`PLAY_DATASET_REQUIRES_ASYNC_ACCESS: ${detail} Dataset Handle ${this.sourceLabel ?? this.datasetId}. Use await dataset.first(), await dataset.at(index), await dataset.materialize(limit), or for await...of.`
|
|
5965
|
-
);
|
|
5966
|
-
}
|
|
5967
5988
|
toJSON() {
|
|
5968
5989
|
return {
|
|
5969
5990
|
kind: "dataset",
|
|
@@ -6094,8 +6115,28 @@ function createDeferredPlayDataset(input) {
|
|
|
6094
6115
|
const boundMethods = /* @__PURE__ */ new Map();
|
|
6095
6116
|
const dataset = new Proxy(target, {
|
|
6096
6117
|
get(dataset2, property) {
|
|
6118
|
+
if (property === "length") {
|
|
6119
|
+
throw datasetAsyncOnlyError(
|
|
6120
|
+
dataset2,
|
|
6121
|
+
"Dataset Handles do not expose synchronous .length.",
|
|
6122
|
+
"Use await dataset.count()."
|
|
6123
|
+
);
|
|
6124
|
+
}
|
|
6097
6125
|
if (typeof property === "string" && /^(0|[1-9]\d*)$/.test(property)) {
|
|
6098
|
-
|
|
6126
|
+
throw datasetAsyncOnlyError(
|
|
6127
|
+
dataset2,
|
|
6128
|
+
`Dataset Handles do not expose synchronous row indexing (${property}).`,
|
|
6129
|
+
`Use await dataset.at(${property}) or await dataset.first().`
|
|
6130
|
+
);
|
|
6131
|
+
}
|
|
6132
|
+
if (property === Symbol.iterator) {
|
|
6133
|
+
return () => {
|
|
6134
|
+
throw datasetAsyncOnlyError(
|
|
6135
|
+
dataset2,
|
|
6136
|
+
"Dataset Handles do not support synchronous iteration.",
|
|
6137
|
+
"Use for await...of or await dataset.materialize(limit)."
|
|
6138
|
+
);
|
|
6139
|
+
};
|
|
6099
6140
|
}
|
|
6100
6141
|
const value = Reflect.get(dataset2, property, dataset2);
|
|
6101
6142
|
if (typeof value !== "function") return value;
|
|
@@ -6106,8 +6147,10 @@ function createDeferredPlayDataset(input) {
|
|
|
6106
6147
|
},
|
|
6107
6148
|
set(_dataset, property) {
|
|
6108
6149
|
if (property === "length" || typeof property === "string" && /^(0|[1-9]\d*)$/.test(property)) {
|
|
6109
|
-
throw
|
|
6110
|
-
|
|
6150
|
+
throw datasetAsyncOnlyError(
|
|
6151
|
+
target,
|
|
6152
|
+
"Dataset Handles do not support synchronous array assignment.",
|
|
6153
|
+
"Transform rows with dataset.map(...) or explicitly materialize a bounded array."
|
|
6111
6154
|
);
|
|
6112
6155
|
}
|
|
6113
6156
|
return false;
|
|
@@ -6119,6 +6162,11 @@ function createDeferredPlayDataset(input) {
|
|
|
6119
6162
|
}
|
|
6120
6163
|
return dataset;
|
|
6121
6164
|
}
|
|
6165
|
+
function datasetAsyncOnlyError(dataset, detail, guidance) {
|
|
6166
|
+
return new Error(
|
|
6167
|
+
`PLAY_DATASET_ASYNC_ONLY: ${detail} Dataset Handle ${dataset.sourceLabel ?? dataset.datasetId}. ${guidance}`
|
|
6168
|
+
);
|
|
6169
|
+
}
|
|
6122
6170
|
function createPlayDataset(rows, metadata) {
|
|
6123
6171
|
const materializedRows = [...rows];
|
|
6124
6172
|
return createDeferredPlayDataset({
|
package/dist/index.mjs
CHANGED
|
@@ -686,7 +686,10 @@ var SDK_RELEASE = {
|
|
|
686
686
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
687
687
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
688
688
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
689
|
-
|
|
689
|
+
// 0.2.0 makes Dataset Handles uniformly async-only after 0.1.320 briefly
|
|
690
|
+
// exposed storage-dependent synchronous access. This deliberate minor
|
|
691
|
+
// release keeps lazy paging semantics independent of row residency.
|
|
692
|
+
version: "0.2.1",
|
|
690
693
|
contracts: {
|
|
691
694
|
api: {
|
|
692
695
|
name: "sdk-http-api",
|
|
@@ -2893,6 +2896,33 @@ function usesExtendedTheirstackJobSearchBudget(endpointId, payload) {
|
|
|
2893
2896
|
return maxAgeDays !== null && maxAgeDays >= 365 ? true : usesLongExplicitDateWindow(payload);
|
|
2894
2897
|
}
|
|
2895
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
|
+
|
|
2896
2926
|
// ../shared_libs/play-runtime/runtime-environment.ts
|
|
2897
2927
|
var PLAY_RUNTIME_ENVIRONMENTS = ["preview"];
|
|
2898
2928
|
var PLAY_RUNTIME_NAMESPACE_PATTERN = /^[a-z][a-z0-9-]{0,30}$/;
|
|
@@ -2905,12 +2935,19 @@ function normalizePlayRuntimeSelection(value) {
|
|
|
2905
2935
|
if (!value || typeof value !== "object" || Array.isArray(value)) return null;
|
|
2906
2936
|
const record = value;
|
|
2907
2937
|
if (Object.keys(record).some(
|
|
2908
|
-
(key) => key !== "environment" && key !== "namespace"
|
|
2938
|
+
(key) => key !== "environment" && key !== "namespace" && key !== "backend"
|
|
2909
2939
|
) || record.environment !== "preview") {
|
|
2910
2940
|
return null;
|
|
2911
2941
|
}
|
|
2912
2942
|
const namespace = normalizePlayRuntimeNamespace(record.namespace);
|
|
2913
|
-
|
|
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 };
|
|
2914
2951
|
}
|
|
2915
2952
|
function normalizePlayRuntimeEnvironment(value) {
|
|
2916
2953
|
return typeof value === "string" && PLAY_RUNTIME_ENVIRONMENTS.includes(value) ? value : null;
|
|
@@ -2943,7 +2980,7 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
2943
2980
|
const runtime = normalizePlayRuntimeSelection(request.runtime);
|
|
2944
2981
|
if (!runtime) {
|
|
2945
2982
|
throw new DeeplineError(
|
|
2946
|
-
'runtime must be
|
|
2983
|
+
'runtime must be { environment: "preview", namespace, backend?: "daytona" | "modal" } with namespace matching ^[a-z][a-z0-9-]{0,30}$.',
|
|
2947
2984
|
void 0,
|
|
2948
2985
|
"INVALID_RUNTIME_SELECTION"
|
|
2949
2986
|
);
|
|
@@ -2979,7 +3016,18 @@ function resolvePlayRunRuntimeSelection(request) {
|
|
|
2979
3016
|
"INVALID_RUNTIME_NAMESPACE"
|
|
2980
3017
|
);
|
|
2981
3018
|
}
|
|
2982
|
-
|
|
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 };
|
|
2983
3031
|
}
|
|
2984
3032
|
function runtimeSelectionHeaders(runtime) {
|
|
2985
3033
|
if (!runtime) return void 0;
|
|
@@ -5768,14 +5816,6 @@ var DeferredPlayDataset = class {
|
|
|
5768
5816
|
this.workProgress = input.workProgress;
|
|
5769
5817
|
this.resolvers = input.resolvers;
|
|
5770
5818
|
}
|
|
5771
|
-
get length() {
|
|
5772
|
-
if (this.knownCount === null) {
|
|
5773
|
-
throw this.requiresAsyncAccess(
|
|
5774
|
-
"The row count is not known until this lazy transform executes."
|
|
5775
|
-
);
|
|
5776
|
-
}
|
|
5777
|
-
return this.knownCount;
|
|
5778
|
-
}
|
|
5779
5819
|
async count() {
|
|
5780
5820
|
this.cachedCount = await this.resolvers.count();
|
|
5781
5821
|
this.knownCount = this.cachedCount;
|
|
@@ -5799,6 +5839,9 @@ var DeferredPlayDataset = class {
|
|
|
5799
5839
|
return void 0;
|
|
5800
5840
|
}
|
|
5801
5841
|
if (this.residentRows) return this.residentRows[normalized];
|
|
5842
|
+
if (normalized < this.previewRows.length) {
|
|
5843
|
+
return this.previewRows[normalized];
|
|
5844
|
+
}
|
|
5802
5845
|
if (this.resolvers.at) return await this.resolvers.at(normalized);
|
|
5803
5846
|
let current = 0;
|
|
5804
5847
|
for await (const row of this.resolvers.iterate()) {
|
|
@@ -5868,28 +5911,6 @@ var DeferredPlayDataset = class {
|
|
|
5868
5911
|
yield row;
|
|
5869
5912
|
}
|
|
5870
5913
|
}
|
|
5871
|
-
[Symbol.iterator]() {
|
|
5872
|
-
if (!this.residentRows) {
|
|
5873
|
-
throw this.requiresAsyncAccess(
|
|
5874
|
-
"Synchronous iteration is available only when every row is resident."
|
|
5875
|
-
);
|
|
5876
|
-
}
|
|
5877
|
-
return this.residentRows[Symbol.iterator]();
|
|
5878
|
-
}
|
|
5879
|
-
residentAt(index) {
|
|
5880
|
-
if (this.knownCount !== null && index >= this.knownCount) return void 0;
|
|
5881
|
-
if (!this.residentRows) {
|
|
5882
|
-
throw this.requiresAsyncAccess(
|
|
5883
|
-
`Row ${index} is not resident and may require dataset paging.`
|
|
5884
|
-
);
|
|
5885
|
-
}
|
|
5886
|
-
return this.residentRows[index];
|
|
5887
|
-
}
|
|
5888
|
-
requiresAsyncAccess(detail) {
|
|
5889
|
-
return new Error(
|
|
5890
|
-
`PLAY_DATASET_REQUIRES_ASYNC_ACCESS: ${detail} Dataset Handle ${this.sourceLabel ?? this.datasetId}. Use await dataset.first(), await dataset.at(index), await dataset.materialize(limit), or for await...of.`
|
|
5891
|
-
);
|
|
5892
|
-
}
|
|
5893
5914
|
toJSON() {
|
|
5894
5915
|
return {
|
|
5895
5916
|
kind: "dataset",
|
|
@@ -6020,8 +6041,28 @@ function createDeferredPlayDataset(input) {
|
|
|
6020
6041
|
const boundMethods = /* @__PURE__ */ new Map();
|
|
6021
6042
|
const dataset = new Proxy(target, {
|
|
6022
6043
|
get(dataset2, property) {
|
|
6044
|
+
if (property === "length") {
|
|
6045
|
+
throw datasetAsyncOnlyError(
|
|
6046
|
+
dataset2,
|
|
6047
|
+
"Dataset Handles do not expose synchronous .length.",
|
|
6048
|
+
"Use await dataset.count()."
|
|
6049
|
+
);
|
|
6050
|
+
}
|
|
6023
6051
|
if (typeof property === "string" && /^(0|[1-9]\d*)$/.test(property)) {
|
|
6024
|
-
|
|
6052
|
+
throw datasetAsyncOnlyError(
|
|
6053
|
+
dataset2,
|
|
6054
|
+
`Dataset Handles do not expose synchronous row indexing (${property}).`,
|
|
6055
|
+
`Use await dataset.at(${property}) or await dataset.first().`
|
|
6056
|
+
);
|
|
6057
|
+
}
|
|
6058
|
+
if (property === Symbol.iterator) {
|
|
6059
|
+
return () => {
|
|
6060
|
+
throw datasetAsyncOnlyError(
|
|
6061
|
+
dataset2,
|
|
6062
|
+
"Dataset Handles do not support synchronous iteration.",
|
|
6063
|
+
"Use for await...of or await dataset.materialize(limit)."
|
|
6064
|
+
);
|
|
6065
|
+
};
|
|
6025
6066
|
}
|
|
6026
6067
|
const value = Reflect.get(dataset2, property, dataset2);
|
|
6027
6068
|
if (typeof value !== "function") return value;
|
|
@@ -6032,8 +6073,10 @@ function createDeferredPlayDataset(input) {
|
|
|
6032
6073
|
},
|
|
6033
6074
|
set(_dataset, property) {
|
|
6034
6075
|
if (property === "length" || typeof property === "string" && /^(0|[1-9]\d*)$/.test(property)) {
|
|
6035
|
-
throw
|
|
6036
|
-
|
|
6076
|
+
throw datasetAsyncOnlyError(
|
|
6077
|
+
target,
|
|
6078
|
+
"Dataset Handles do not support synchronous array assignment.",
|
|
6079
|
+
"Transform rows with dataset.map(...) or explicitly materialize a bounded array."
|
|
6037
6080
|
);
|
|
6038
6081
|
}
|
|
6039
6082
|
return false;
|
|
@@ -6045,6 +6088,11 @@ function createDeferredPlayDataset(input) {
|
|
|
6045
6088
|
}
|
|
6046
6089
|
return dataset;
|
|
6047
6090
|
}
|
|
6091
|
+
function datasetAsyncOnlyError(dataset, detail, guidance) {
|
|
6092
|
+
return new Error(
|
|
6093
|
+
`PLAY_DATASET_ASYNC_ONLY: ${detail} Dataset Handle ${dataset.sourceLabel ?? dataset.datasetId}. ${guidance}`
|
|
6094
|
+
);
|
|
6095
|
+
}
|
|
6048
6096
|
function createPlayDataset(rows, metadata) {
|
|
6049
6097
|
const materializedRows = [...rows];
|
|
6050
6098
|
return createDeferredPlayDataset({
|
|
@@ -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 };
|