deepline 0.1.306 → 0.1.308
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 +11 -24
- package/dist/bundling-sources/sdk/src/errors.ts +3 -1
- package/dist/bundling-sources/sdk/src/http.ts +16 -24
- package/dist/bundling-sources/sdk/src/play.ts +26 -0
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +66 -11
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +13 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +12 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/local-process.ts +21 -9
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-constants.ts +5 -1
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +17 -2
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runtime-limits.ts +102 -0
- package/dist/bundling-sources/shared_libs/play-runtime/tool-http-errors.ts +56 -9
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +56 -0
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +6 -0
- package/dist/cli/index.js +197 -42
- package/dist/cli/index.mjs +197 -42
- package/dist/index.d.mts +19 -1
- package/dist/index.d.ts +19 -1
- package/dist/index.js +33 -30
- package/dist/index.mjs +33 -30
- package/dist/plays/bundle-play-file.d.mts +8 -0
- package/dist/plays/bundle-play-file.d.ts +8 -0
- package/dist/plays/bundle-play-file.mjs +42 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -760,7 +760,7 @@ 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
|
-
version: "0.1.
|
|
763
|
+
version: "0.1.308",
|
|
764
764
|
contracts: {
|
|
765
765
|
api: {
|
|
766
766
|
name: "sdk-http-api",
|
|
@@ -1179,8 +1179,8 @@ var HttpClient = class {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
throw lastError;
|
|
1181
1181
|
}
|
|
1182
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1183
|
-
throw new AuthError();
|
|
1182
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1183
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1184
1184
|
}
|
|
1185
1185
|
if (!response.ok) {
|
|
1186
1186
|
const retryableApiError = options?.retryApiErrors === true && isRetryableApiErrorResponse(response.status);
|
|
@@ -1279,10 +1279,11 @@ var HttpClient = class {
|
|
|
1279
1279
|
* @typeParam T - Expected response body type
|
|
1280
1280
|
* @param path - API path (e.g. `"/api/v2/tools"`)
|
|
1281
1281
|
*/
|
|
1282
|
-
async get(path) {
|
|
1282
|
+
async get(path, options) {
|
|
1283
1283
|
return this.request(path, {
|
|
1284
1284
|
method: "GET",
|
|
1285
|
-
retryApiErrors: true
|
|
1285
|
+
retryApiErrors: true,
|
|
1286
|
+
...options
|
|
1286
1287
|
});
|
|
1287
1288
|
}
|
|
1288
1289
|
async *streamSse(path, options) {
|
|
@@ -1307,8 +1308,8 @@ var HttpClient = class {
|
|
|
1307
1308
|
if (!response.ok) {
|
|
1308
1309
|
const body = await response.text();
|
|
1309
1310
|
const parsed = parseResponseBody(body);
|
|
1310
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1311
|
-
throw new AuthError();
|
|
1311
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1312
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1312
1313
|
}
|
|
1313
1314
|
const htmlError = detectHtmlErrorBody(
|
|
1314
1315
|
body,
|
|
@@ -3706,7 +3707,6 @@ var DeeplineClient = class {
|
|
|
3706
3707
|
},
|
|
3707
3708
|
headers,
|
|
3708
3709
|
{
|
|
3709
|
-
forbiddenAsApiError: true,
|
|
3710
3710
|
timeout: options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, input),
|
|
3711
3711
|
maxRetries: options?.maxRetries ?? 0,
|
|
3712
3712
|
exactUrlOnly: true,
|
|
@@ -3757,9 +3757,7 @@ var DeeplineClient = class {
|
|
|
3757
3757
|
"/api/v2/ingestion/repair",
|
|
3758
3758
|
{
|
|
3759
3759
|
...input?.provider ? { provider: input.provider } : {}
|
|
3760
|
-
}
|
|
3761
|
-
void 0,
|
|
3762
|
-
{ forbiddenAsApiError: true }
|
|
3760
|
+
}
|
|
3763
3761
|
);
|
|
3764
3762
|
}
|
|
3765
3763
|
// ——————————————————————————————————————————————————————————
|
|
@@ -3915,7 +3913,7 @@ var DeeplineClient = class {
|
|
|
3915
3913
|
compilerManifest
|
|
3916
3914
|
},
|
|
3917
3915
|
void 0,
|
|
3918
|
-
{
|
|
3916
|
+
{ retryApiErrors: true }
|
|
3919
3917
|
);
|
|
3920
3918
|
}
|
|
3921
3919
|
/**
|
|
@@ -3930,7 +3928,7 @@ var DeeplineClient = class {
|
|
|
3930
3928
|
"/api/v2/plays/artifacts",
|
|
3931
3929
|
{ artifacts },
|
|
3932
3930
|
void 0,
|
|
3933
|
-
{
|
|
3931
|
+
{ retryApiErrors: true }
|
|
3934
3932
|
);
|
|
3935
3933
|
}
|
|
3936
3934
|
const compiledArtifacts = await mapWithConcurrency(
|
|
@@ -3955,7 +3953,7 @@ var DeeplineClient = class {
|
|
|
3955
3953
|
artifacts: chunk
|
|
3956
3954
|
},
|
|
3957
3955
|
void 0,
|
|
3958
|
-
{
|
|
3956
|
+
{ retryApiErrors: true }
|
|
3959
3957
|
)
|
|
3960
3958
|
);
|
|
3961
3959
|
}
|
|
@@ -5084,9 +5082,7 @@ var DeeplineClient = class {
|
|
|
5084
5082
|
const encodedName = encodeURIComponent(name);
|
|
5085
5083
|
return this.http.post(
|
|
5086
5084
|
`/api/v2/plays/${encodedName}/live`,
|
|
5087
|
-
request
|
|
5088
|
-
void 0,
|
|
5089
|
-
{ forbiddenAsApiError: true }
|
|
5085
|
+
request
|
|
5090
5086
|
);
|
|
5091
5087
|
}
|
|
5092
5088
|
/**
|
|
@@ -5377,15 +5373,14 @@ var DeeplineClient = class {
|
|
|
5377
5373
|
const suffix = query ? `?${query}` : "";
|
|
5378
5374
|
return this.http.request(
|
|
5379
5375
|
`/api/v2/monitors/tools${suffix}`,
|
|
5380
|
-
{ method: "GET"
|
|
5376
|
+
{ method: "GET" }
|
|
5381
5377
|
);
|
|
5382
5378
|
}
|
|
5383
5379
|
/** Validate a monitor definition without deploying it. Prefer `client.monitors.check(...)`. */
|
|
5384
5380
|
async checkMonitor(definition) {
|
|
5385
5381
|
return this.http.request("/api/v2/monitors/check", {
|
|
5386
5382
|
method: "POST",
|
|
5387
|
-
body: definition
|
|
5388
|
-
forbiddenAsApiError: true
|
|
5383
|
+
body: definition
|
|
5389
5384
|
});
|
|
5390
5385
|
}
|
|
5391
5386
|
/**
|
|
@@ -5397,14 +5392,12 @@ var DeeplineClient = class {
|
|
|
5397
5392
|
if (options?.dryRun) {
|
|
5398
5393
|
return this.http.request("/api/v2/monitors/check", {
|
|
5399
5394
|
method: "POST",
|
|
5400
|
-
body: definition
|
|
5401
|
-
forbiddenAsApiError: true
|
|
5395
|
+
body: definition
|
|
5402
5396
|
});
|
|
5403
5397
|
}
|
|
5404
5398
|
return this.http.request("/api/v2/monitors/deploy", {
|
|
5405
5399
|
method: "POST",
|
|
5406
|
-
body: definition
|
|
5407
|
-
forbiddenAsApiError: true
|
|
5400
|
+
body: definition
|
|
5408
5401
|
});
|
|
5409
5402
|
}
|
|
5410
5403
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
@@ -5419,28 +5412,28 @@ var DeeplineClient = class {
|
|
|
5419
5412
|
const suffix = query ? `?${query}` : "";
|
|
5420
5413
|
return this.http.request(
|
|
5421
5414
|
`/api/v2/monitors/deployed${suffix}`,
|
|
5422
|
-
{ method: "GET"
|
|
5415
|
+
{ method: "GET" }
|
|
5423
5416
|
);
|
|
5424
5417
|
}
|
|
5425
5418
|
/** Fetch one deployed monitor by public key. Prefer `client.monitors.get(...)`. */
|
|
5426
5419
|
async getMonitor(key) {
|
|
5427
5420
|
return this.http.request(
|
|
5428
5421
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5429
|
-
{ method: "GET"
|
|
5422
|
+
{ method: "GET" }
|
|
5430
5423
|
);
|
|
5431
5424
|
}
|
|
5432
5425
|
/** Published plays depending on one monitor. Prefer `client.monitors.dependents(...)`. */
|
|
5433
5426
|
async getMonitorDependents(key) {
|
|
5434
5427
|
return this.http.request(
|
|
5435
5428
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/dependents`,
|
|
5436
|
-
{ method: "GET"
|
|
5429
|
+
{ method: "GET" }
|
|
5437
5430
|
);
|
|
5438
5431
|
}
|
|
5439
5432
|
/** Update a deployed monitor by public key. Prefer `client.monitors.update(...)`. */
|
|
5440
5433
|
async updateMonitor(key, patch) {
|
|
5441
5434
|
return this.http.request(
|
|
5442
5435
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5443
|
-
{ method: "PATCH", body: patch
|
|
5436
|
+
{ method: "PATCH", body: patch }
|
|
5444
5437
|
);
|
|
5445
5438
|
}
|
|
5446
5439
|
/**
|
|
@@ -5455,7 +5448,7 @@ var DeeplineClient = class {
|
|
|
5455
5448
|
const query = params.toString();
|
|
5456
5449
|
return this.http.request(
|
|
5457
5450
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
5458
|
-
{ method: "DELETE"
|
|
5451
|
+
{ method: "DELETE" }
|
|
5459
5452
|
);
|
|
5460
5453
|
}
|
|
5461
5454
|
/**
|
|
@@ -5466,7 +5459,7 @@ var DeeplineClient = class {
|
|
|
5466
5459
|
const query = options?.dryRun ? "?dry_run=true" : "";
|
|
5467
5460
|
return this.http.request(
|
|
5468
5461
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
5469
|
-
{ method: "POST", body: {}
|
|
5462
|
+
{ method: "POST", body: {} }
|
|
5470
5463
|
);
|
|
5471
5464
|
}
|
|
5472
5465
|
/**
|
|
@@ -7456,6 +7449,7 @@ function definePlay(nameOrConfig, maybeFn, maybeBindings) {
|
|
|
7456
7449
|
description: maybeBindings?.description,
|
|
7457
7450
|
inputSchema: void 0,
|
|
7458
7451
|
billing: maybeBindings?.billing,
|
|
7452
|
+
runtime: maybeBindings?.runtime,
|
|
7459
7453
|
compatibility: maybeBindings?.compatibility
|
|
7460
7454
|
} : {
|
|
7461
7455
|
name: nameOrConfig.id,
|
|
@@ -7464,6 +7458,7 @@ function definePlay(nameOrConfig, maybeFn, maybeBindings) {
|
|
|
7464
7458
|
description: nameOrConfig.description,
|
|
7465
7459
|
inputSchema: nameOrConfig.input.schema,
|
|
7466
7460
|
billing: nameOrConfig.billing,
|
|
7461
|
+
runtime: nameOrConfig.runtime ?? nameOrConfig.bindings?.runtime,
|
|
7467
7462
|
compatibility: nameOrConfig.compatibility ?? nameOrConfig.bindings?.compatibility
|
|
7468
7463
|
};
|
|
7469
7464
|
const name = config.name;
|
|
@@ -7472,6 +7467,7 @@ function definePlay(nameOrConfig, maybeFn, maybeBindings) {
|
|
|
7472
7467
|
const description = config.description?.trim();
|
|
7473
7468
|
const billing = config.billing;
|
|
7474
7469
|
const inputSchema = config.inputSchema;
|
|
7470
|
+
const runtime = config.runtime;
|
|
7475
7471
|
const compatibility = config.compatibility;
|
|
7476
7472
|
if (typeof fn !== "function") {
|
|
7477
7473
|
throw new Error("definePlay(...) requires an async run function.");
|
|
@@ -7498,6 +7494,7 @@ function definePlay(nameOrConfig, maybeFn, maybeBindings) {
|
|
|
7498
7494
|
...bindings ? { bindings } : {},
|
|
7499
7495
|
...inputSchema ? { inputSchema } : {},
|
|
7500
7496
|
...billing ? { billing } : {},
|
|
7497
|
+
...runtime ? { runtime } : {},
|
|
7501
7498
|
...compatibility ? { compatibility } : {}
|
|
7502
7499
|
};
|
|
7503
7500
|
const play = fn;
|
|
@@ -7519,6 +7516,12 @@ function definePlay(nameOrConfig, maybeFn, maybeBindings) {
|
|
|
7519
7516
|
configurable: false,
|
|
7520
7517
|
writable: false
|
|
7521
7518
|
});
|
|
7519
|
+
Object.defineProperty(play, "runtime", {
|
|
7520
|
+
value: runtime,
|
|
7521
|
+
enumerable: true,
|
|
7522
|
+
configurable: false,
|
|
7523
|
+
writable: false
|
|
7524
|
+
});
|
|
7522
7525
|
Object.defineProperty(play, "compatibility", {
|
|
7523
7526
|
value: compatibility,
|
|
7524
7527
|
enumerable: true,
|
package/dist/index.mjs
CHANGED
|
@@ -686,7 +686,7 @@ 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
|
-
version: "0.1.
|
|
689
|
+
version: "0.1.308",
|
|
690
690
|
contracts: {
|
|
691
691
|
api: {
|
|
692
692
|
name: "sdk-http-api",
|
|
@@ -1105,8 +1105,8 @@ var HttpClient = class {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
throw lastError;
|
|
1107
1107
|
}
|
|
1108
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1109
|
-
throw new AuthError();
|
|
1108
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1109
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1110
1110
|
}
|
|
1111
1111
|
if (!response.ok) {
|
|
1112
1112
|
const retryableApiError = options?.retryApiErrors === true && isRetryableApiErrorResponse(response.status);
|
|
@@ -1205,10 +1205,11 @@ var HttpClient = class {
|
|
|
1205
1205
|
* @typeParam T - Expected response body type
|
|
1206
1206
|
* @param path - API path (e.g. `"/api/v2/tools"`)
|
|
1207
1207
|
*/
|
|
1208
|
-
async get(path) {
|
|
1208
|
+
async get(path, options) {
|
|
1209
1209
|
return this.request(path, {
|
|
1210
1210
|
method: "GET",
|
|
1211
|
-
retryApiErrors: true
|
|
1211
|
+
retryApiErrors: true,
|
|
1212
|
+
...options
|
|
1212
1213
|
});
|
|
1213
1214
|
}
|
|
1214
1215
|
async *streamSse(path, options) {
|
|
@@ -1233,8 +1234,8 @@ var HttpClient = class {
|
|
|
1233
1234
|
if (!response.ok) {
|
|
1234
1235
|
const body = await response.text();
|
|
1235
1236
|
const parsed = parseResponseBody(body);
|
|
1236
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1237
|
-
throw new AuthError();
|
|
1237
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1238
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1238
1239
|
}
|
|
1239
1240
|
const htmlError = detectHtmlErrorBody(
|
|
1240
1241
|
body,
|
|
@@ -3632,7 +3633,6 @@ var DeeplineClient = class {
|
|
|
3632
3633
|
},
|
|
3633
3634
|
headers,
|
|
3634
3635
|
{
|
|
3635
|
-
forbiddenAsApiError: true,
|
|
3636
3636
|
timeout: options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, input),
|
|
3637
3637
|
maxRetries: options?.maxRetries ?? 0,
|
|
3638
3638
|
exactUrlOnly: true,
|
|
@@ -3683,9 +3683,7 @@ var DeeplineClient = class {
|
|
|
3683
3683
|
"/api/v2/ingestion/repair",
|
|
3684
3684
|
{
|
|
3685
3685
|
...input?.provider ? { provider: input.provider } : {}
|
|
3686
|
-
}
|
|
3687
|
-
void 0,
|
|
3688
|
-
{ forbiddenAsApiError: true }
|
|
3686
|
+
}
|
|
3689
3687
|
);
|
|
3690
3688
|
}
|
|
3691
3689
|
// ——————————————————————————————————————————————————————————
|
|
@@ -3841,7 +3839,7 @@ var DeeplineClient = class {
|
|
|
3841
3839
|
compilerManifest
|
|
3842
3840
|
},
|
|
3843
3841
|
void 0,
|
|
3844
|
-
{
|
|
3842
|
+
{ retryApiErrors: true }
|
|
3845
3843
|
);
|
|
3846
3844
|
}
|
|
3847
3845
|
/**
|
|
@@ -3856,7 +3854,7 @@ var DeeplineClient = class {
|
|
|
3856
3854
|
"/api/v2/plays/artifacts",
|
|
3857
3855
|
{ artifacts },
|
|
3858
3856
|
void 0,
|
|
3859
|
-
{
|
|
3857
|
+
{ retryApiErrors: true }
|
|
3860
3858
|
);
|
|
3861
3859
|
}
|
|
3862
3860
|
const compiledArtifacts = await mapWithConcurrency(
|
|
@@ -3881,7 +3879,7 @@ var DeeplineClient = class {
|
|
|
3881
3879
|
artifacts: chunk
|
|
3882
3880
|
},
|
|
3883
3881
|
void 0,
|
|
3884
|
-
{
|
|
3882
|
+
{ retryApiErrors: true }
|
|
3885
3883
|
)
|
|
3886
3884
|
);
|
|
3887
3885
|
}
|
|
@@ -5010,9 +5008,7 @@ var DeeplineClient = class {
|
|
|
5010
5008
|
const encodedName = encodeURIComponent(name);
|
|
5011
5009
|
return this.http.post(
|
|
5012
5010
|
`/api/v2/plays/${encodedName}/live`,
|
|
5013
|
-
request
|
|
5014
|
-
void 0,
|
|
5015
|
-
{ forbiddenAsApiError: true }
|
|
5011
|
+
request
|
|
5016
5012
|
);
|
|
5017
5013
|
}
|
|
5018
5014
|
/**
|
|
@@ -5303,15 +5299,14 @@ var DeeplineClient = class {
|
|
|
5303
5299
|
const suffix = query ? `?${query}` : "";
|
|
5304
5300
|
return this.http.request(
|
|
5305
5301
|
`/api/v2/monitors/tools${suffix}`,
|
|
5306
|
-
{ method: "GET"
|
|
5302
|
+
{ method: "GET" }
|
|
5307
5303
|
);
|
|
5308
5304
|
}
|
|
5309
5305
|
/** Validate a monitor definition without deploying it. Prefer `client.monitors.check(...)`. */
|
|
5310
5306
|
async checkMonitor(definition) {
|
|
5311
5307
|
return this.http.request("/api/v2/monitors/check", {
|
|
5312
5308
|
method: "POST",
|
|
5313
|
-
body: definition
|
|
5314
|
-
forbiddenAsApiError: true
|
|
5309
|
+
body: definition
|
|
5315
5310
|
});
|
|
5316
5311
|
}
|
|
5317
5312
|
/**
|
|
@@ -5323,14 +5318,12 @@ var DeeplineClient = class {
|
|
|
5323
5318
|
if (options?.dryRun) {
|
|
5324
5319
|
return this.http.request("/api/v2/monitors/check", {
|
|
5325
5320
|
method: "POST",
|
|
5326
|
-
body: definition
|
|
5327
|
-
forbiddenAsApiError: true
|
|
5321
|
+
body: definition
|
|
5328
5322
|
});
|
|
5329
5323
|
}
|
|
5330
5324
|
return this.http.request("/api/v2/monitors/deploy", {
|
|
5331
5325
|
method: "POST",
|
|
5332
|
-
body: definition
|
|
5333
|
-
forbiddenAsApiError: true
|
|
5326
|
+
body: definition
|
|
5334
5327
|
});
|
|
5335
5328
|
}
|
|
5336
5329
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
@@ -5345,28 +5338,28 @@ var DeeplineClient = class {
|
|
|
5345
5338
|
const suffix = query ? `?${query}` : "";
|
|
5346
5339
|
return this.http.request(
|
|
5347
5340
|
`/api/v2/monitors/deployed${suffix}`,
|
|
5348
|
-
{ method: "GET"
|
|
5341
|
+
{ method: "GET" }
|
|
5349
5342
|
);
|
|
5350
5343
|
}
|
|
5351
5344
|
/** Fetch one deployed monitor by public key. Prefer `client.monitors.get(...)`. */
|
|
5352
5345
|
async getMonitor(key) {
|
|
5353
5346
|
return this.http.request(
|
|
5354
5347
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5355
|
-
{ method: "GET"
|
|
5348
|
+
{ method: "GET" }
|
|
5356
5349
|
);
|
|
5357
5350
|
}
|
|
5358
5351
|
/** Published plays depending on one monitor. Prefer `client.monitors.dependents(...)`. */
|
|
5359
5352
|
async getMonitorDependents(key) {
|
|
5360
5353
|
return this.http.request(
|
|
5361
5354
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/dependents`,
|
|
5362
|
-
{ method: "GET"
|
|
5355
|
+
{ method: "GET" }
|
|
5363
5356
|
);
|
|
5364
5357
|
}
|
|
5365
5358
|
/** Update a deployed monitor by public key. Prefer `client.monitors.update(...)`. */
|
|
5366
5359
|
async updateMonitor(key, patch) {
|
|
5367
5360
|
return this.http.request(
|
|
5368
5361
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5369
|
-
{ method: "PATCH", body: patch
|
|
5362
|
+
{ method: "PATCH", body: patch }
|
|
5370
5363
|
);
|
|
5371
5364
|
}
|
|
5372
5365
|
/**
|
|
@@ -5381,7 +5374,7 @@ var DeeplineClient = class {
|
|
|
5381
5374
|
const query = params.toString();
|
|
5382
5375
|
return this.http.request(
|
|
5383
5376
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
5384
|
-
{ method: "DELETE"
|
|
5377
|
+
{ method: "DELETE" }
|
|
5385
5378
|
);
|
|
5386
5379
|
}
|
|
5387
5380
|
/**
|
|
@@ -5392,7 +5385,7 @@ var DeeplineClient = class {
|
|
|
5392
5385
|
const query = options?.dryRun ? "?dry_run=true" : "";
|
|
5393
5386
|
return this.http.request(
|
|
5394
5387
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
5395
|
-
{ method: "POST", body: {}
|
|
5388
|
+
{ method: "POST", body: {} }
|
|
5396
5389
|
);
|
|
5397
5390
|
}
|
|
5398
5391
|
/**
|
|
@@ -7382,6 +7375,7 @@ function definePlay(nameOrConfig, maybeFn, maybeBindings) {
|
|
|
7382
7375
|
description: maybeBindings?.description,
|
|
7383
7376
|
inputSchema: void 0,
|
|
7384
7377
|
billing: maybeBindings?.billing,
|
|
7378
|
+
runtime: maybeBindings?.runtime,
|
|
7385
7379
|
compatibility: maybeBindings?.compatibility
|
|
7386
7380
|
} : {
|
|
7387
7381
|
name: nameOrConfig.id,
|
|
@@ -7390,6 +7384,7 @@ function definePlay(nameOrConfig, maybeFn, maybeBindings) {
|
|
|
7390
7384
|
description: nameOrConfig.description,
|
|
7391
7385
|
inputSchema: nameOrConfig.input.schema,
|
|
7392
7386
|
billing: nameOrConfig.billing,
|
|
7387
|
+
runtime: nameOrConfig.runtime ?? nameOrConfig.bindings?.runtime,
|
|
7393
7388
|
compatibility: nameOrConfig.compatibility ?? nameOrConfig.bindings?.compatibility
|
|
7394
7389
|
};
|
|
7395
7390
|
const name = config.name;
|
|
@@ -7398,6 +7393,7 @@ function definePlay(nameOrConfig, maybeFn, maybeBindings) {
|
|
|
7398
7393
|
const description = config.description?.trim();
|
|
7399
7394
|
const billing = config.billing;
|
|
7400
7395
|
const inputSchema = config.inputSchema;
|
|
7396
|
+
const runtime = config.runtime;
|
|
7401
7397
|
const compatibility = config.compatibility;
|
|
7402
7398
|
if (typeof fn !== "function") {
|
|
7403
7399
|
throw new Error("definePlay(...) requires an async run function.");
|
|
@@ -7424,6 +7420,7 @@ function definePlay(nameOrConfig, maybeFn, maybeBindings) {
|
|
|
7424
7420
|
...bindings ? { bindings } : {},
|
|
7425
7421
|
...inputSchema ? { inputSchema } : {},
|
|
7426
7422
|
...billing ? { billing } : {},
|
|
7423
|
+
...runtime ? { runtime } : {},
|
|
7427
7424
|
...compatibility ? { compatibility } : {}
|
|
7428
7425
|
};
|
|
7429
7426
|
const play = fn;
|
|
@@ -7445,6 +7442,12 @@ function definePlay(nameOrConfig, maybeFn, maybeBindings) {
|
|
|
7445
7442
|
configurable: false,
|
|
7446
7443
|
writable: false
|
|
7447
7444
|
});
|
|
7445
|
+
Object.defineProperty(play, "runtime", {
|
|
7446
|
+
value: runtime,
|
|
7447
|
+
enumerable: true,
|
|
7448
|
+
configurable: false,
|
|
7449
|
+
writable: false
|
|
7450
|
+
});
|
|
7448
7451
|
Object.defineProperty(play, "compatibility", {
|
|
7449
7452
|
value: compatibility,
|
|
7450
7453
|
enumerable: true,
|
|
@@ -40,6 +40,13 @@ type PlayBundleArtifact = {
|
|
|
40
40
|
cacheHit: boolean;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
type PlaySandboxRuntimeDeclaration = {
|
|
44
|
+
timeout?: string;
|
|
45
|
+
memory?: string;
|
|
46
|
+
cpu?: number;
|
|
47
|
+
disk?: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
43
50
|
type ImportedPlayDependency = {
|
|
44
51
|
filePath: string;
|
|
45
52
|
playName: string;
|
|
@@ -84,6 +91,7 @@ type BundledPlayFileSuccess = {
|
|
|
84
91
|
filePath: string;
|
|
85
92
|
playName: string | null;
|
|
86
93
|
playDescription: string | null;
|
|
94
|
+
sandboxRuntimeDeclaration: PlaySandboxRuntimeDeclaration | null;
|
|
87
95
|
compilerManifest?: PlayCompilerManifest;
|
|
88
96
|
packagedFiles: PlayLocalFileReference[];
|
|
89
97
|
unresolvedFileReferences: PlayLocalFileDiscoveryError[];
|
|
@@ -40,6 +40,13 @@ type PlayBundleArtifact = {
|
|
|
40
40
|
cacheHit: boolean;
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
+
type PlaySandboxRuntimeDeclaration = {
|
|
44
|
+
timeout?: string;
|
|
45
|
+
memory?: string;
|
|
46
|
+
cpu?: number;
|
|
47
|
+
disk?: string;
|
|
48
|
+
};
|
|
49
|
+
|
|
43
50
|
type ImportedPlayDependency = {
|
|
44
51
|
filePath: string;
|
|
45
52
|
playName: string;
|
|
@@ -84,6 +91,7 @@ type BundledPlayFileSuccess = {
|
|
|
84
91
|
filePath: string;
|
|
85
92
|
playName: string | null;
|
|
86
93
|
playDescription: string | null;
|
|
94
|
+
sandboxRuntimeDeclaration: PlaySandboxRuntimeDeclaration | null;
|
|
87
95
|
compilerManifest?: PlayCompilerManifest;
|
|
88
96
|
packagedFiles: PlayLocalFileReference[];
|
|
89
97
|
unresolvedFileReferences: PlayLocalFileDiscoveryError[];
|
|
@@ -594,6 +594,39 @@ function toolErrorSchemaVersionFromOptions(node, context) {
|
|
|
594
594
|
if (schemaVersion === 0 || schemaVersion === 1) return schemaVersion;
|
|
595
595
|
return null;
|
|
596
596
|
}
|
|
597
|
+
function sandboxRuntimeDeclarationFromOptions(node, context) {
|
|
598
|
+
const directRuntime = resolveStaticProperty(node, "runtime", context);
|
|
599
|
+
const bindings = resolveStaticProperty(node, "bindings", context);
|
|
600
|
+
const bindingRuntime = bindings.kind === "found" ? resolveStaticProperty(bindings.value, "runtime", context) : { kind: "absent" };
|
|
601
|
+
const runtime = directRuntime.kind === "found" ? directRuntime : bindingRuntime;
|
|
602
|
+
if (runtime.kind !== "found") return null;
|
|
603
|
+
const timeout = resolveStaticProperty(runtime.value, "timeout", context);
|
|
604
|
+
const memory = resolveStaticProperty(runtime.value, "memory", context);
|
|
605
|
+
const cpu = resolveStaticProperty(runtime.value, "cpu", context);
|
|
606
|
+
const disk = resolveStaticProperty(runtime.value, "disk", context);
|
|
607
|
+
const declaration = {};
|
|
608
|
+
if (timeout.kind === "found") {
|
|
609
|
+
const value = staticStringFromExpression(timeout.value, context);
|
|
610
|
+
if (value === null) return null;
|
|
611
|
+
declaration.timeout = value;
|
|
612
|
+
}
|
|
613
|
+
if (memory.kind === "found") {
|
|
614
|
+
const value = staticStringFromExpression(memory.value, context);
|
|
615
|
+
if (value === null) return null;
|
|
616
|
+
declaration.memory = value;
|
|
617
|
+
}
|
|
618
|
+
if (cpu.kind === "found") {
|
|
619
|
+
const value = staticNumberFromExpression(cpu.value, context);
|
|
620
|
+
if (value === null) return null;
|
|
621
|
+
declaration.cpu = value;
|
|
622
|
+
}
|
|
623
|
+
if (disk.kind === "found") {
|
|
624
|
+
const value = staticStringFromExpression(disk.value, context);
|
|
625
|
+
if (value === null) return null;
|
|
626
|
+
declaration.disk = value;
|
|
627
|
+
}
|
|
628
|
+
return declaration;
|
|
629
|
+
}
|
|
597
630
|
function stringPropertyFromObjectExpression(node, propertyName, context, seenObjects = /* @__PURE__ */ new Set()) {
|
|
598
631
|
const object = objectExpressionFromNode(node, context);
|
|
599
632
|
if (!object || seenObjects.has(object)) return null;
|
|
@@ -655,6 +688,10 @@ function playMetadataFromDefinePlayCall(node, context) {
|
|
|
655
688
|
);
|
|
656
689
|
}
|
|
657
690
|
const options = isObjectForm ? firstArg : args[2] ?? null;
|
|
691
|
+
const sandboxRuntimeDeclaration = sandboxRuntimeDeclarationFromOptions(
|
|
692
|
+
options,
|
|
693
|
+
context
|
|
694
|
+
);
|
|
658
695
|
const toolErrorSchemaVersion = toolErrorSchemaVersionFromOptions(
|
|
659
696
|
options,
|
|
660
697
|
context
|
|
@@ -666,6 +703,7 @@ function playMetadataFromDefinePlayCall(node, context) {
|
|
|
666
703
|
return {
|
|
667
704
|
name,
|
|
668
705
|
description,
|
|
706
|
+
sandboxRuntimeDeclaration,
|
|
669
707
|
toolErrorSchemaVersion: toolErrorSchemaVersion ?? null,
|
|
670
708
|
toolErrorSchemaVersionUnknown
|
|
671
709
|
};
|
|
@@ -1053,6 +1091,7 @@ async function analyzeSourceGraph(entryFile, adapter, exportName) {
|
|
|
1053
1091
|
}
|
|
1054
1092
|
const playName = metadata?.name ?? null;
|
|
1055
1093
|
const playDescription = metadata?.description ?? null;
|
|
1094
|
+
const sandboxRuntimeDeclaration = metadata?.sandboxRuntimeDeclaration ?? null;
|
|
1056
1095
|
return {
|
|
1057
1096
|
sourceCode,
|
|
1058
1097
|
sourceFiles: Object.fromEntries(
|
|
@@ -1069,6 +1108,7 @@ async function analyzeSourceGraph(entryFile, adapter, exportName) {
|
|
|
1069
1108
|
},
|
|
1070
1109
|
playName,
|
|
1071
1110
|
playDescription,
|
|
1111
|
+
sandboxRuntimeDeclaration,
|
|
1072
1112
|
toolErrorSchemaVersion: metadata?.toolErrorSchemaVersion ?? null,
|
|
1073
1113
|
importedPlayDependencies: [...importedPlayDependencies.values()].sort(
|
|
1074
1114
|
(left, right) => left.filePath.localeCompare(right.filePath)
|
|
@@ -1251,6 +1291,7 @@ entry-export:${exportName}`
|
|
|
1251
1291
|
filePath: absolutePath,
|
|
1252
1292
|
playName: analysis.playName,
|
|
1253
1293
|
playDescription: analysis.playDescription,
|
|
1294
|
+
sandboxRuntimeDeclaration: analysis.sandboxRuntimeDeclaration,
|
|
1254
1295
|
packagedFiles: discoveredFiles.files,
|
|
1255
1296
|
unresolvedFileReferences: discoveredFiles.unresolved,
|
|
1256
1297
|
importedPlayDependencies: analysis.importedPlayDependencies
|
|
@@ -1319,6 +1360,7 @@ entry-export:${exportName}`
|
|
|
1319
1360
|
filePath: absolutePath,
|
|
1320
1361
|
playName: analysis.playName,
|
|
1321
1362
|
playDescription: analysis.playDescription,
|
|
1363
|
+
sandboxRuntimeDeclaration: analysis.sandboxRuntimeDeclaration,
|
|
1322
1364
|
packagedFiles: discoveredFiles.files,
|
|
1323
1365
|
unresolvedFileReferences: discoveredFiles.unresolved,
|
|
1324
1366
|
importedPlayDependencies: analysis.importedPlayDependencies
|