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/cli/index.mjs
CHANGED
|
@@ -1022,7 +1022,7 @@ var SDK_RELEASE = {
|
|
|
1022
1022
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
1023
1023
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
1024
1024
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
1025
|
-
version: "0.1.
|
|
1025
|
+
version: "0.1.308",
|
|
1026
1026
|
contracts: {
|
|
1027
1027
|
api: {
|
|
1028
1028
|
name: "sdk-http-api",
|
|
@@ -1441,8 +1441,8 @@ var HttpClient = class {
|
|
|
1441
1441
|
}
|
|
1442
1442
|
throw lastError;
|
|
1443
1443
|
}
|
|
1444
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1445
|
-
throw new AuthError();
|
|
1444
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1445
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1446
1446
|
}
|
|
1447
1447
|
if (!response.ok) {
|
|
1448
1448
|
const retryableApiError = options?.retryApiErrors === true && isRetryableApiErrorResponse(response.status);
|
|
@@ -1541,10 +1541,11 @@ var HttpClient = class {
|
|
|
1541
1541
|
* @typeParam T - Expected response body type
|
|
1542
1542
|
* @param path - API path (e.g. `"/api/v2/tools"`)
|
|
1543
1543
|
*/
|
|
1544
|
-
async get(path) {
|
|
1544
|
+
async get(path, options) {
|
|
1545
1545
|
return this.request(path, {
|
|
1546
1546
|
method: "GET",
|
|
1547
|
-
retryApiErrors: true
|
|
1547
|
+
retryApiErrors: true,
|
|
1548
|
+
...options
|
|
1548
1549
|
});
|
|
1549
1550
|
}
|
|
1550
1551
|
async *streamSse(path, options) {
|
|
@@ -1569,8 +1570,8 @@ var HttpClient = class {
|
|
|
1569
1570
|
if (!response.ok) {
|
|
1570
1571
|
const body = await response.text();
|
|
1571
1572
|
const parsed = parseResponseBody(body);
|
|
1572
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1573
|
-
throw new AuthError();
|
|
1573
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1574
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1574
1575
|
}
|
|
1575
1576
|
const htmlError = detectHtmlErrorBody(
|
|
1576
1577
|
body,
|
|
@@ -3968,7 +3969,6 @@ var DeeplineClient = class {
|
|
|
3968
3969
|
},
|
|
3969
3970
|
headers,
|
|
3970
3971
|
{
|
|
3971
|
-
forbiddenAsApiError: true,
|
|
3972
3972
|
timeout: options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, input2),
|
|
3973
3973
|
maxRetries: options?.maxRetries ?? 0,
|
|
3974
3974
|
exactUrlOnly: true,
|
|
@@ -4019,9 +4019,7 @@ var DeeplineClient = class {
|
|
|
4019
4019
|
"/api/v2/ingestion/repair",
|
|
4020
4020
|
{
|
|
4021
4021
|
...input2?.provider ? { provider: input2.provider } : {}
|
|
4022
|
-
}
|
|
4023
|
-
void 0,
|
|
4024
|
-
{ forbiddenAsApiError: true }
|
|
4022
|
+
}
|
|
4025
4023
|
);
|
|
4026
4024
|
}
|
|
4027
4025
|
// ——————————————————————————————————————————————————————————
|
|
@@ -4177,7 +4175,7 @@ var DeeplineClient = class {
|
|
|
4177
4175
|
compilerManifest
|
|
4178
4176
|
},
|
|
4179
4177
|
void 0,
|
|
4180
|
-
{
|
|
4178
|
+
{ retryApiErrors: true }
|
|
4181
4179
|
);
|
|
4182
4180
|
}
|
|
4183
4181
|
/**
|
|
@@ -4192,7 +4190,7 @@ var DeeplineClient = class {
|
|
|
4192
4190
|
"/api/v2/plays/artifacts",
|
|
4193
4191
|
{ artifacts },
|
|
4194
4192
|
void 0,
|
|
4195
|
-
{
|
|
4193
|
+
{ retryApiErrors: true }
|
|
4196
4194
|
);
|
|
4197
4195
|
}
|
|
4198
4196
|
const compiledArtifacts = await mapWithConcurrency(
|
|
@@ -4217,7 +4215,7 @@ var DeeplineClient = class {
|
|
|
4217
4215
|
artifacts: chunk
|
|
4218
4216
|
},
|
|
4219
4217
|
void 0,
|
|
4220
|
-
{
|
|
4218
|
+
{ retryApiErrors: true }
|
|
4221
4219
|
)
|
|
4222
4220
|
);
|
|
4223
4221
|
}
|
|
@@ -5346,9 +5344,7 @@ var DeeplineClient = class {
|
|
|
5346
5344
|
const encodedName = encodeURIComponent(name);
|
|
5347
5345
|
return this.http.post(
|
|
5348
5346
|
`/api/v2/plays/${encodedName}/live`,
|
|
5349
|
-
request
|
|
5350
|
-
void 0,
|
|
5351
|
-
{ forbiddenAsApiError: true }
|
|
5347
|
+
request
|
|
5352
5348
|
);
|
|
5353
5349
|
}
|
|
5354
5350
|
/**
|
|
@@ -5639,15 +5635,14 @@ var DeeplineClient = class {
|
|
|
5639
5635
|
const suffix = query ? `?${query}` : "";
|
|
5640
5636
|
return this.http.request(
|
|
5641
5637
|
`/api/v2/monitors/tools${suffix}`,
|
|
5642
|
-
{ method: "GET"
|
|
5638
|
+
{ method: "GET" }
|
|
5643
5639
|
);
|
|
5644
5640
|
}
|
|
5645
5641
|
/** Validate a monitor definition without deploying it. Prefer `client.monitors.check(...)`. */
|
|
5646
5642
|
async checkMonitor(definition) {
|
|
5647
5643
|
return this.http.request("/api/v2/monitors/check", {
|
|
5648
5644
|
method: "POST",
|
|
5649
|
-
body: definition
|
|
5650
|
-
forbiddenAsApiError: true
|
|
5645
|
+
body: definition
|
|
5651
5646
|
});
|
|
5652
5647
|
}
|
|
5653
5648
|
/**
|
|
@@ -5659,14 +5654,12 @@ var DeeplineClient = class {
|
|
|
5659
5654
|
if (options?.dryRun) {
|
|
5660
5655
|
return this.http.request("/api/v2/monitors/check", {
|
|
5661
5656
|
method: "POST",
|
|
5662
|
-
body: definition
|
|
5663
|
-
forbiddenAsApiError: true
|
|
5657
|
+
body: definition
|
|
5664
5658
|
});
|
|
5665
5659
|
}
|
|
5666
5660
|
return this.http.request("/api/v2/monitors/deploy", {
|
|
5667
5661
|
method: "POST",
|
|
5668
|
-
body: definition
|
|
5669
|
-
forbiddenAsApiError: true
|
|
5662
|
+
body: definition
|
|
5670
5663
|
});
|
|
5671
5664
|
}
|
|
5672
5665
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
@@ -5681,28 +5674,28 @@ var DeeplineClient = class {
|
|
|
5681
5674
|
const suffix = query ? `?${query}` : "";
|
|
5682
5675
|
return this.http.request(
|
|
5683
5676
|
`/api/v2/monitors/deployed${suffix}`,
|
|
5684
|
-
{ method: "GET"
|
|
5677
|
+
{ method: "GET" }
|
|
5685
5678
|
);
|
|
5686
5679
|
}
|
|
5687
5680
|
/** Fetch one deployed monitor by public key. Prefer `client.monitors.get(...)`. */
|
|
5688
5681
|
async getMonitor(key) {
|
|
5689
5682
|
return this.http.request(
|
|
5690
5683
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5691
|
-
{ method: "GET"
|
|
5684
|
+
{ method: "GET" }
|
|
5692
5685
|
);
|
|
5693
5686
|
}
|
|
5694
5687
|
/** Published plays depending on one monitor. Prefer `client.monitors.dependents(...)`. */
|
|
5695
5688
|
async getMonitorDependents(key) {
|
|
5696
5689
|
return this.http.request(
|
|
5697
5690
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/dependents`,
|
|
5698
|
-
{ method: "GET"
|
|
5691
|
+
{ method: "GET" }
|
|
5699
5692
|
);
|
|
5700
5693
|
}
|
|
5701
5694
|
/** Update a deployed monitor by public key. Prefer `client.monitors.update(...)`. */
|
|
5702
5695
|
async updateMonitor(key, patch) {
|
|
5703
5696
|
return this.http.request(
|
|
5704
5697
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5705
|
-
{ method: "PATCH", body: patch
|
|
5698
|
+
{ method: "PATCH", body: patch }
|
|
5706
5699
|
);
|
|
5707
5700
|
}
|
|
5708
5701
|
/**
|
|
@@ -5717,7 +5710,7 @@ var DeeplineClient = class {
|
|
|
5717
5710
|
const query = params.toString();
|
|
5718
5711
|
return this.http.request(
|
|
5719
5712
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
5720
|
-
{ method: "DELETE"
|
|
5713
|
+
{ method: "DELETE" }
|
|
5721
5714
|
);
|
|
5722
5715
|
}
|
|
5723
5716
|
/**
|
|
@@ -5728,7 +5721,7 @@ var DeeplineClient = class {
|
|
|
5728
5721
|
const query = options?.dryRun ? "?dry_run=true" : "";
|
|
5729
5722
|
return this.http.request(
|
|
5730
5723
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
5731
|
-
{ method: "POST", body: {}
|
|
5724
|
+
{ method: "POST", body: {} }
|
|
5732
5725
|
);
|
|
5733
5726
|
}
|
|
5734
5727
|
/**
|
|
@@ -7863,8 +7856,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
7863
7856
|
"/api/v2/billing/subscription/checkout",
|
|
7864
7857
|
{
|
|
7865
7858
|
method: "POST",
|
|
7866
|
-
body: { plan_version_id: planVersionId }
|
|
7867
|
-
forbiddenAsApiError: true
|
|
7859
|
+
body: { plan_version_id: planVersionId }
|
|
7868
7860
|
}
|
|
7869
7861
|
);
|
|
7870
7862
|
const url = String(payload.checkout_url || "");
|
|
@@ -12179,6 +12171,134 @@ function resolveEnabledExecutionProfile(override) {
|
|
|
12179
12171
|
}
|
|
12180
12172
|
}
|
|
12181
12173
|
|
|
12174
|
+
// ../shared_libs/play-runtime/sandbox-runtime-limits.ts
|
|
12175
|
+
var STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS = {
|
|
12176
|
+
timeoutSeconds: 30 * 60,
|
|
12177
|
+
memoryGiB: 1,
|
|
12178
|
+
cpu: 1,
|
|
12179
|
+
diskGiB: 3
|
|
12180
|
+
};
|
|
12181
|
+
var MAX_PLAY_SANDBOX_RUNTIME_LIMITS = {
|
|
12182
|
+
timeoutSeconds: 4 * 60 * 60,
|
|
12183
|
+
memoryGiB: 16,
|
|
12184
|
+
cpu: 4,
|
|
12185
|
+
diskGiB: 50
|
|
12186
|
+
};
|
|
12187
|
+
function parsePositiveInteger3(value, unit) {
|
|
12188
|
+
const match = new RegExp(`^(\\d+)\\s*${unit}$`, "i").exec(value.trim());
|
|
12189
|
+
if (!match) return null;
|
|
12190
|
+
const parsed = Number(match[1]);
|
|
12191
|
+
return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : null;
|
|
12192
|
+
}
|
|
12193
|
+
function parseTimeout(value) {
|
|
12194
|
+
const match = /^(\d+)\s*([mh])$/i.exec(value.trim());
|
|
12195
|
+
if (!match) return null;
|
|
12196
|
+
const amount = Number(match[1]);
|
|
12197
|
+
if (!Number.isSafeInteger(amount) || amount <= 0) return null;
|
|
12198
|
+
return amount * (match[2].toLowerCase() === "h" ? 3600 : 60);
|
|
12199
|
+
}
|
|
12200
|
+
function resolvePlaySandboxRuntimeLimits(declaration) {
|
|
12201
|
+
const base = STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS;
|
|
12202
|
+
if (!declaration) return { ...base };
|
|
12203
|
+
const timeoutSeconds = declaration.timeout ? parseTimeout(declaration.timeout) : base.timeoutSeconds;
|
|
12204
|
+
const memoryGiB = declaration.memory ? parsePositiveInteger3(declaration.memory, "GiB") : base.memoryGiB;
|
|
12205
|
+
const diskGiB = declaration.disk ? parsePositiveInteger3(declaration.disk, "GiB") : base.diskGiB;
|
|
12206
|
+
const cpu = declaration.cpu ?? base.cpu;
|
|
12207
|
+
if (timeoutSeconds === null || memoryGiB === null || diskGiB === null || !Number.isSafeInteger(cpu) || cpu <= 0) {
|
|
12208
|
+
throw new Error(
|
|
12209
|
+
'Invalid runtime sandbox declaration. Use timeout like "90m" or "2h", memory/disk like "4GiB", and a positive integer cpu.'
|
|
12210
|
+
);
|
|
12211
|
+
}
|
|
12212
|
+
const resolved = { timeoutSeconds, memoryGiB, cpu, diskGiB };
|
|
12213
|
+
for (const key of ["memoryGiB", "cpu", "diskGiB"]) {
|
|
12214
|
+
if (resolved[key] < base[key]) {
|
|
12215
|
+
throw new Error(
|
|
12216
|
+
`Requested runtime ${key}=${resolved[key]} is below the supported minimum ${base[key]}.`
|
|
12217
|
+
);
|
|
12218
|
+
}
|
|
12219
|
+
}
|
|
12220
|
+
for (const key of Object.keys(
|
|
12221
|
+
resolved
|
|
12222
|
+
)) {
|
|
12223
|
+
if (resolved[key] > MAX_PLAY_SANDBOX_RUNTIME_LIMITS[key]) {
|
|
12224
|
+
throw new Error(
|
|
12225
|
+
`Requested runtime ${key}=${resolved[key]} exceeds this organisation's maximum ${MAX_PLAY_SANDBOX_RUNTIME_LIMITS[key]}.`
|
|
12226
|
+
);
|
|
12227
|
+
}
|
|
12228
|
+
}
|
|
12229
|
+
return resolved;
|
|
12230
|
+
}
|
|
12231
|
+
function hasNonStandardPlaySandboxRuntimeLimits(value) {
|
|
12232
|
+
return Object.keys(value).some(
|
|
12233
|
+
(key) => value[key] !== STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS[key]
|
|
12234
|
+
);
|
|
12235
|
+
}
|
|
12236
|
+
|
|
12237
|
+
// ../shared_libs/play-runtime/worker-api-types.ts
|
|
12238
|
+
var DAYTONA_COMPUTE_PRICING_USD = {
|
|
12239
|
+
vcpuSecond: 14e-6,
|
|
12240
|
+
memoryGiBSecond: 45e-7,
|
|
12241
|
+
storageGiBSecond: 3e-8,
|
|
12242
|
+
includedStorageGiB: 5
|
|
12243
|
+
};
|
|
12244
|
+
function roundUsd(amount) {
|
|
12245
|
+
return Number(Math.max(0, amount).toFixed(12));
|
|
12246
|
+
}
|
|
12247
|
+
function resolveDaytonaSandboxComputeItem(input2) {
|
|
12248
|
+
const billableSeconds = Math.max(1, Math.ceil(input2.wallTimeSeconds));
|
|
12249
|
+
const cpu = Math.max(0, input2.cpu);
|
|
12250
|
+
const memoryGiB = Math.max(0, input2.memoryGiB);
|
|
12251
|
+
const billableDiskGiB = Math.max(
|
|
12252
|
+
0,
|
|
12253
|
+
input2.diskGiB - DAYTONA_COMPUTE_PRICING_USD.includedStorageGiB
|
|
12254
|
+
);
|
|
12255
|
+
const providerCostUsd = roundUsd(
|
|
12256
|
+
billableSeconds * (cpu * DAYTONA_COMPUTE_PRICING_USD.vcpuSecond + memoryGiB * DAYTONA_COMPUTE_PRICING_USD.memoryGiBSecond + billableDiskGiB * DAYTONA_COMPUTE_PRICING_USD.storageGiBSecond)
|
|
12257
|
+
);
|
|
12258
|
+
return {
|
|
12259
|
+
itemId: input2.itemId,
|
|
12260
|
+
source: input2.source ?? "daytona",
|
|
12261
|
+
unit: "sandbox_second",
|
|
12262
|
+
units: billableSeconds,
|
|
12263
|
+
providerCostUsd,
|
|
12264
|
+
metadata: {
|
|
12265
|
+
sandboxId: input2.sandboxId ?? null,
|
|
12266
|
+
cpu,
|
|
12267
|
+
memoryGiB,
|
|
12268
|
+
diskGiB: Math.max(0, input2.diskGiB),
|
|
12269
|
+
billableDiskGiB,
|
|
12270
|
+
startedAt: input2.startedAt,
|
|
12271
|
+
endedAt: input2.endedAt
|
|
12272
|
+
}
|
|
12273
|
+
};
|
|
12274
|
+
}
|
|
12275
|
+
|
|
12276
|
+
// ../shared_libs/billing/compute-pricing.ts
|
|
12277
|
+
var COMPUTE_BILLING_MARKUP_MULTIPLIER = 5;
|
|
12278
|
+
var DEFAULT_USD_PER_CUSTOMER_CREDIT = 0.1;
|
|
12279
|
+
var DEFAULT_PROVIDER_MARKUP_MULTIPLIER = 1.4;
|
|
12280
|
+
function roundUpCredits(value) {
|
|
12281
|
+
if (!Number.isFinite(value) || value <= 0) return 0;
|
|
12282
|
+
return Math.ceil(value * 100) / 100;
|
|
12283
|
+
}
|
|
12284
|
+
function estimateDaytonaMaximumComputeCredits(limits) {
|
|
12285
|
+
const item = resolveDaytonaSandboxComputeItem({
|
|
12286
|
+
itemId: "estimate",
|
|
12287
|
+
wallTimeSeconds: limits.timeoutSeconds,
|
|
12288
|
+
cpu: limits.cpu,
|
|
12289
|
+
memoryGiB: limits.memoryGiB,
|
|
12290
|
+
diskGiB: limits.diskGiB
|
|
12291
|
+
});
|
|
12292
|
+
return roundUpCredits(
|
|
12293
|
+
item.providerCostUsd * COMPUTE_BILLING_MARKUP_MULTIPLIER * DEFAULT_PROVIDER_MARKUP_MULTIPLIER / DEFAULT_USD_PER_CUSTOMER_CREDIT
|
|
12294
|
+
);
|
|
12295
|
+
}
|
|
12296
|
+
function formatNonStandardSandboxRuntimeWarning(limits) {
|
|
12297
|
+
if (!hasNonStandardPlaySandboxRuntimeLimits(limits)) return null;
|
|
12298
|
+
const maximumComputeCredits = estimateDaytonaMaximumComputeCredits(limits);
|
|
12299
|
+
return `This Play requests a non-standard sandbox (${limits.timeoutSeconds}s, ${limits.memoryGiB}GiB memory, ${limits.cpu} CPU, ${limits.diskGiB}GiB disk). Maximum compute estimate: ${maximumComputeCredits.toFixed(2)} Deepline credits. It may queue longer.`;
|
|
12300
|
+
}
|
|
12301
|
+
|
|
12182
12302
|
// ../shared_libs/play-runtime/internal-step-ids.ts
|
|
12183
12303
|
var INTERNAL_GLUE_NODE_ID_PREFIX = "run_javascript:";
|
|
12184
12304
|
function isInternalGlueStepId(stepId) {
|
|
@@ -12738,7 +12858,7 @@ function looksLikeFilePath(target) {
|
|
|
12738
12858
|
}
|
|
12739
12859
|
return target.includes("\\") || /\.(ts|js|mjs|play\.ts)$/.test(target);
|
|
12740
12860
|
}
|
|
12741
|
-
function
|
|
12861
|
+
function parsePositiveInteger4(value, flagName) {
|
|
12742
12862
|
const parsed = Number.parseInt(value, 10);
|
|
12743
12863
|
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
12744
12864
|
throw new Error(`${flagName} must be a positive integer.`);
|
|
@@ -16258,7 +16378,7 @@ function parsePlayRunOptions(args) {
|
|
|
16258
16378
|
);
|
|
16259
16379
|
}
|
|
16260
16380
|
if ((arg === "--tail-timeout-ms" || arg === "--timeout-ms") && args[index + 1]) {
|
|
16261
|
-
waitTimeoutMs =
|
|
16381
|
+
waitTimeoutMs = parsePositiveInteger4(args[++index], arg);
|
|
16262
16382
|
continue;
|
|
16263
16383
|
}
|
|
16264
16384
|
if (PLAY_RUN_RESERVED_BOOLEAN_FLAGS.has(arg)) {
|
|
@@ -16581,23 +16701,49 @@ function formatPlayCheckIssueLines(issue) {
|
|
|
16581
16701
|
}
|
|
16582
16702
|
return lines;
|
|
16583
16703
|
}
|
|
16584
|
-
function printPlayCheckIssues(issues, writer) {
|
|
16585
|
-
|
|
16586
|
-
|
|
16587
|
-
|
|
16704
|
+
function printPlayCheckIssues(issues, writer, warnings = void 0) {
|
|
16705
|
+
const errorIssues = (issues ?? []).filter(
|
|
16706
|
+
(issue) => issue.severity === "error"
|
|
16707
|
+
);
|
|
16708
|
+
const warningIssues = (issues ?? []).filter(
|
|
16709
|
+
(issue) => issue.severity === "warning"
|
|
16710
|
+
);
|
|
16711
|
+
const structuredWarningMessages = warningIssues.map(
|
|
16712
|
+
(issue) => issue.message.trim()
|
|
16713
|
+
);
|
|
16714
|
+
const stringWarnings = [...new Set(warnings ?? [])].filter((warning) => {
|
|
16715
|
+
const trimmed = warning.trim();
|
|
16716
|
+
return trimmed.length > 0 && !structuredWarningMessages.some(
|
|
16717
|
+
(message) => trimmed === message || trimmed.startsWith(message)
|
|
16718
|
+
);
|
|
16719
|
+
});
|
|
16588
16720
|
if (errorIssues.length) {
|
|
16589
16721
|
writer(" issues:");
|
|
16590
16722
|
for (const issue of errorIssues) {
|
|
16591
16723
|
for (const line of formatPlayCheckIssueLines(issue)) writer(line);
|
|
16592
16724
|
}
|
|
16593
16725
|
}
|
|
16594
|
-
if (warningIssues.length) {
|
|
16726
|
+
if (warningIssues.length || stringWarnings.length) {
|
|
16595
16727
|
writer(" warnings:");
|
|
16596
16728
|
for (const issue of warningIssues) {
|
|
16597
16729
|
for (const line of formatPlayCheckIssueLines(issue)) writer(line);
|
|
16598
16730
|
}
|
|
16731
|
+
for (const warning of stringWarnings) writer(` - ${warning.trim()}`);
|
|
16599
16732
|
}
|
|
16600
16733
|
}
|
|
16734
|
+
function formatPlaySandboxRuntimeWarning(declaration) {
|
|
16735
|
+
if (!declaration) return null;
|
|
16736
|
+
const warning = formatNonStandardSandboxRuntimeWarning(
|
|
16737
|
+
resolvePlaySandboxRuntimeLimits(declaration)
|
|
16738
|
+
);
|
|
16739
|
+
return warning ? `Warning: ${warning}` : null;
|
|
16740
|
+
}
|
|
16741
|
+
function printBundledRuntimeWarning(bundle) {
|
|
16742
|
+
const warning = formatPlaySandboxRuntimeWarning(
|
|
16743
|
+
bundle.sandboxRuntimeDeclaration
|
|
16744
|
+
);
|
|
16745
|
+
if (warning) console.warn(warning);
|
|
16746
|
+
}
|
|
16601
16747
|
function partitionMirroredErrors(errors, issues) {
|
|
16602
16748
|
const errorMessages = (issues ?? []).filter((issue) => issue.severity === "error").map((issue) => issue.message.trim()).filter((message) => message.length > 0);
|
|
16603
16749
|
if (errorMessages.length === 0) {
|
|
@@ -16775,7 +16921,11 @@ async function handlePlayCheck(args) {
|
|
|
16775
16921
|
}
|
|
16776
16922
|
printPlayTriggers(enrichedResult.triggers);
|
|
16777
16923
|
printRecognizedSummary(enrichedResult.recognized);
|
|
16778
|
-
printPlayCheckIssues(
|
|
16924
|
+
printPlayCheckIssues(
|
|
16925
|
+
enrichedResult.issues,
|
|
16926
|
+
(line) => console.log(line),
|
|
16927
|
+
enrichedResult.warnings
|
|
16928
|
+
);
|
|
16779
16929
|
printToolGetterHints(enrichedResult.toolGetterHints);
|
|
16780
16930
|
} else {
|
|
16781
16931
|
console.error(`\u2717 ${playName} failed cloud play check`);
|
|
@@ -16786,7 +16936,11 @@ async function handlePlayCheck(args) {
|
|
|
16786
16936
|
for (const error of unstructuredErrors) {
|
|
16787
16937
|
console.error(` ${error}`);
|
|
16788
16938
|
}
|
|
16789
|
-
printPlayCheckIssues(
|
|
16939
|
+
printPlayCheckIssues(
|
|
16940
|
+
enrichedResult.issues,
|
|
16941
|
+
(line) => console.error(line),
|
|
16942
|
+
enrichedResult.warnings
|
|
16943
|
+
);
|
|
16790
16944
|
printToolGetterHints(enrichedResult.toolGetterHints);
|
|
16791
16945
|
}
|
|
16792
16946
|
return enrichedResult.valid ? 0 : 1;
|
|
@@ -16847,6 +17001,7 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
16847
17001
|
}
|
|
16848
17002
|
const bundleResult = graph.root;
|
|
16849
17003
|
const playName = bundleResult.playName ?? extractPlayName(sourceCode, absolutePlayPath);
|
|
17004
|
+
printBundledRuntimeWarning(bundleResult);
|
|
16850
17005
|
try {
|
|
16851
17006
|
progress.phase("publishing imported plays");
|
|
16852
17007
|
await traceCliSpan(
|
|
@@ -17384,7 +17539,7 @@ async function handleRunLogs(args) {
|
|
|
17384
17539
|
for (let index = 0; index < args.length; index += 1) {
|
|
17385
17540
|
const arg = args[index];
|
|
17386
17541
|
if (arg === "--limit" && args[index + 1]) {
|
|
17387
|
-
limit =
|
|
17542
|
+
limit = parsePositiveInteger4(args[++index], "--limit");
|
|
17388
17543
|
continue;
|
|
17389
17544
|
}
|
|
17390
17545
|
if (arg === "--out" && args[index + 1]) {
|
package/dist/index.d.mts
CHANGED
|
@@ -3171,7 +3171,9 @@ declare const SDK_API_CONTRACT: string;
|
|
|
3171
3171
|
/**
|
|
3172
3172
|
* Thrown when the API rejects the request due to an invalid or missing API key.
|
|
3173
3173
|
*
|
|
3174
|
-
* This maps to HTTP 401
|
|
3174
|
+
* This maps to HTTP 401 responses. HTTP 403 means the caller was authenticated
|
|
3175
|
+
* but lacks permission, so the SDK preserves the server's API error instead.
|
|
3176
|
+
* The SDK never retries auth errors —
|
|
3175
3177
|
* they fail immediately.
|
|
3176
3178
|
*
|
|
3177
3179
|
* Fix: run `deepline auth register` to obtain a valid key, or pass one via
|
|
@@ -3809,6 +3811,17 @@ type PlayBindings = {
|
|
|
3809
3811
|
/** Stop the run before a billed action would push total run credits above this cap. */
|
|
3810
3812
|
maxCreditsPerRun?: number;
|
|
3811
3813
|
};
|
|
3814
|
+
/** Requested sandbox envelope; the server enforces the final allowed limits. */
|
|
3815
|
+
runtime?: {
|
|
3816
|
+
/** Duration such as `"90m"` or `"2h"`. */
|
|
3817
|
+
timeout?: string;
|
|
3818
|
+
/** Memory such as `"4GiB"`. */
|
|
3819
|
+
memory?: string;
|
|
3820
|
+
/** Whole vCPU count. */
|
|
3821
|
+
cpu?: number;
|
|
3822
|
+
/** Disk such as `"10GiB"`. */
|
|
3823
|
+
disk?: string;
|
|
3824
|
+
};
|
|
3812
3825
|
/** Webhook trigger with optional HMAC signature verification. */
|
|
3813
3826
|
webhook?: {
|
|
3814
3827
|
hmac?: {
|
|
@@ -4623,6 +4636,8 @@ type DefinePlayConfig<TInput, TOutput extends PlayReturnObject> = {
|
|
|
4623
4636
|
bindings?: PlayBindings;
|
|
4624
4637
|
/** Billing options. */
|
|
4625
4638
|
billing?: PlayBindings['billing'];
|
|
4639
|
+
/** Requested sandbox envelope; the server enforces the final allowed limits. */
|
|
4640
|
+
runtime?: PlayBindings['runtime'];
|
|
4626
4641
|
/** Runtime compatibility override. Omit for the current typed contract. */
|
|
4627
4642
|
compatibility?: PlayBindings['compatibility'];
|
|
4628
4643
|
};
|
|
@@ -4665,6 +4680,8 @@ declare function runIf<Row, Value>(predicate: (row: Row, index: number) => boole
|
|
|
4665
4680
|
type DefinedPlay<TInput, TOutput extends PlayReturnObject> = ((ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>) & DeeplineNamedPlay<TInput, TOutput> & {
|
|
4666
4681
|
/** Optional trigger bindings (cron, webhook). */
|
|
4667
4682
|
readonly bindings?: PlayBindings;
|
|
4683
|
+
/** Requested sandbox envelope. */
|
|
4684
|
+
readonly runtime?: PlayBindings['runtime'];
|
|
4668
4685
|
/** Runtime compatibility explicitly selected by the author. */
|
|
4669
4686
|
readonly compatibility?: PlayBindings['compatibility'];
|
|
4670
4687
|
/** The play's name (same as `.name`). */
|
|
@@ -4676,6 +4693,7 @@ type PlayMetadata = {
|
|
|
4676
4693
|
bindings?: PlayBindings;
|
|
4677
4694
|
inputSchema?: Record<string, unknown>;
|
|
4678
4695
|
billing?: PlayBindings['billing'];
|
|
4696
|
+
runtime?: PlayBindings['runtime'];
|
|
4679
4697
|
compatibility?: PlayBindings['compatibility'];
|
|
4680
4698
|
};
|
|
4681
4699
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -3171,7 +3171,9 @@ declare const SDK_API_CONTRACT: string;
|
|
|
3171
3171
|
/**
|
|
3172
3172
|
* Thrown when the API rejects the request due to an invalid or missing API key.
|
|
3173
3173
|
*
|
|
3174
|
-
* This maps to HTTP 401
|
|
3174
|
+
* This maps to HTTP 401 responses. HTTP 403 means the caller was authenticated
|
|
3175
|
+
* but lacks permission, so the SDK preserves the server's API error instead.
|
|
3176
|
+
* The SDK never retries auth errors —
|
|
3175
3177
|
* they fail immediately.
|
|
3176
3178
|
*
|
|
3177
3179
|
* Fix: run `deepline auth register` to obtain a valid key, or pass one via
|
|
@@ -3809,6 +3811,17 @@ type PlayBindings = {
|
|
|
3809
3811
|
/** Stop the run before a billed action would push total run credits above this cap. */
|
|
3810
3812
|
maxCreditsPerRun?: number;
|
|
3811
3813
|
};
|
|
3814
|
+
/** Requested sandbox envelope; the server enforces the final allowed limits. */
|
|
3815
|
+
runtime?: {
|
|
3816
|
+
/** Duration such as `"90m"` or `"2h"`. */
|
|
3817
|
+
timeout?: string;
|
|
3818
|
+
/** Memory such as `"4GiB"`. */
|
|
3819
|
+
memory?: string;
|
|
3820
|
+
/** Whole vCPU count. */
|
|
3821
|
+
cpu?: number;
|
|
3822
|
+
/** Disk such as `"10GiB"`. */
|
|
3823
|
+
disk?: string;
|
|
3824
|
+
};
|
|
3812
3825
|
/** Webhook trigger with optional HMAC signature verification. */
|
|
3813
3826
|
webhook?: {
|
|
3814
3827
|
hmac?: {
|
|
@@ -4623,6 +4636,8 @@ type DefinePlayConfig<TInput, TOutput extends PlayReturnObject> = {
|
|
|
4623
4636
|
bindings?: PlayBindings;
|
|
4624
4637
|
/** Billing options. */
|
|
4625
4638
|
billing?: PlayBindings['billing'];
|
|
4639
|
+
/** Requested sandbox envelope; the server enforces the final allowed limits. */
|
|
4640
|
+
runtime?: PlayBindings['runtime'];
|
|
4626
4641
|
/** Runtime compatibility override. Omit for the current typed contract. */
|
|
4627
4642
|
compatibility?: PlayBindings['compatibility'];
|
|
4628
4643
|
};
|
|
@@ -4665,6 +4680,8 @@ declare function runIf<Row, Value>(predicate: (row: Row, index: number) => boole
|
|
|
4665
4680
|
type DefinedPlay<TInput, TOutput extends PlayReturnObject> = ((ctx: DeeplinePlayRuntimeContext, input: TInput) => Promise<TOutput>) & DeeplineNamedPlay<TInput, TOutput> & {
|
|
4666
4681
|
/** Optional trigger bindings (cron, webhook). */
|
|
4667
4682
|
readonly bindings?: PlayBindings;
|
|
4683
|
+
/** Requested sandbox envelope. */
|
|
4684
|
+
readonly runtime?: PlayBindings['runtime'];
|
|
4668
4685
|
/** Runtime compatibility explicitly selected by the author. */
|
|
4669
4686
|
readonly compatibility?: PlayBindings['compatibility'];
|
|
4670
4687
|
/** The play's name (same as `.name`). */
|
|
@@ -4676,6 +4693,7 @@ type PlayMetadata = {
|
|
|
4676
4693
|
bindings?: PlayBindings;
|
|
4677
4694
|
inputSchema?: Record<string, unknown>;
|
|
4678
4695
|
billing?: PlayBindings['billing'];
|
|
4696
|
+
runtime?: PlayBindings['runtime'];
|
|
4679
4697
|
compatibility?: PlayBindings['compatibility'];
|
|
4680
4698
|
};
|
|
4681
4699
|
/**
|