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.js
CHANGED
|
@@ -1037,7 +1037,7 @@ var SDK_RELEASE = {
|
|
|
1037
1037
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
1038
1038
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
1039
1039
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
1040
|
-
version: "0.1.
|
|
1040
|
+
version: "0.1.308",
|
|
1041
1041
|
contracts: {
|
|
1042
1042
|
api: {
|
|
1043
1043
|
name: "sdk-http-api",
|
|
@@ -1456,8 +1456,8 @@ var HttpClient = class {
|
|
|
1456
1456
|
}
|
|
1457
1457
|
throw lastError;
|
|
1458
1458
|
}
|
|
1459
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1460
|
-
throw new AuthError();
|
|
1459
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1460
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1461
1461
|
}
|
|
1462
1462
|
if (!response.ok) {
|
|
1463
1463
|
const retryableApiError = options?.retryApiErrors === true && isRetryableApiErrorResponse(response.status);
|
|
@@ -1556,10 +1556,11 @@ var HttpClient = class {
|
|
|
1556
1556
|
* @typeParam T - Expected response body type
|
|
1557
1557
|
* @param path - API path (e.g. `"/api/v2/tools"`)
|
|
1558
1558
|
*/
|
|
1559
|
-
async get(path) {
|
|
1559
|
+
async get(path, options) {
|
|
1560
1560
|
return this.request(path, {
|
|
1561
1561
|
method: "GET",
|
|
1562
|
-
retryApiErrors: true
|
|
1562
|
+
retryApiErrors: true,
|
|
1563
|
+
...options
|
|
1563
1564
|
});
|
|
1564
1565
|
}
|
|
1565
1566
|
async *streamSse(path, options) {
|
|
@@ -1584,8 +1585,8 @@ var HttpClient = class {
|
|
|
1584
1585
|
if (!response.ok) {
|
|
1585
1586
|
const body = await response.text();
|
|
1586
1587
|
const parsed = parseResponseBody(body);
|
|
1587
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1588
|
-
throw new AuthError();
|
|
1588
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1589
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1589
1590
|
}
|
|
1590
1591
|
const htmlError = detectHtmlErrorBody(
|
|
1591
1592
|
body,
|
|
@@ -3983,7 +3984,6 @@ var DeeplineClient = class {
|
|
|
3983
3984
|
},
|
|
3984
3985
|
headers,
|
|
3985
3986
|
{
|
|
3986
|
-
forbiddenAsApiError: true,
|
|
3987
3987
|
timeout: options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, input2),
|
|
3988
3988
|
maxRetries: options?.maxRetries ?? 0,
|
|
3989
3989
|
exactUrlOnly: true,
|
|
@@ -4034,9 +4034,7 @@ var DeeplineClient = class {
|
|
|
4034
4034
|
"/api/v2/ingestion/repair",
|
|
4035
4035
|
{
|
|
4036
4036
|
...input2?.provider ? { provider: input2.provider } : {}
|
|
4037
|
-
}
|
|
4038
|
-
void 0,
|
|
4039
|
-
{ forbiddenAsApiError: true }
|
|
4037
|
+
}
|
|
4040
4038
|
);
|
|
4041
4039
|
}
|
|
4042
4040
|
// ——————————————————————————————————————————————————————————
|
|
@@ -4192,7 +4190,7 @@ var DeeplineClient = class {
|
|
|
4192
4190
|
compilerManifest
|
|
4193
4191
|
},
|
|
4194
4192
|
void 0,
|
|
4195
|
-
{
|
|
4193
|
+
{ retryApiErrors: true }
|
|
4196
4194
|
);
|
|
4197
4195
|
}
|
|
4198
4196
|
/**
|
|
@@ -4207,7 +4205,7 @@ var DeeplineClient = class {
|
|
|
4207
4205
|
"/api/v2/plays/artifacts",
|
|
4208
4206
|
{ artifacts },
|
|
4209
4207
|
void 0,
|
|
4210
|
-
{
|
|
4208
|
+
{ retryApiErrors: true }
|
|
4211
4209
|
);
|
|
4212
4210
|
}
|
|
4213
4211
|
const compiledArtifacts = await mapWithConcurrency(
|
|
@@ -4232,7 +4230,7 @@ var DeeplineClient = class {
|
|
|
4232
4230
|
artifacts: chunk
|
|
4233
4231
|
},
|
|
4234
4232
|
void 0,
|
|
4235
|
-
{
|
|
4233
|
+
{ retryApiErrors: true }
|
|
4236
4234
|
)
|
|
4237
4235
|
);
|
|
4238
4236
|
}
|
|
@@ -5361,9 +5359,7 @@ var DeeplineClient = class {
|
|
|
5361
5359
|
const encodedName = encodeURIComponent(name);
|
|
5362
5360
|
return this.http.post(
|
|
5363
5361
|
`/api/v2/plays/${encodedName}/live`,
|
|
5364
|
-
request
|
|
5365
|
-
void 0,
|
|
5366
|
-
{ forbiddenAsApiError: true }
|
|
5362
|
+
request
|
|
5367
5363
|
);
|
|
5368
5364
|
}
|
|
5369
5365
|
/**
|
|
@@ -5654,15 +5650,14 @@ var DeeplineClient = class {
|
|
|
5654
5650
|
const suffix = query ? `?${query}` : "";
|
|
5655
5651
|
return this.http.request(
|
|
5656
5652
|
`/api/v2/monitors/tools${suffix}`,
|
|
5657
|
-
{ method: "GET"
|
|
5653
|
+
{ method: "GET" }
|
|
5658
5654
|
);
|
|
5659
5655
|
}
|
|
5660
5656
|
/** Validate a monitor definition without deploying it. Prefer `client.monitors.check(...)`. */
|
|
5661
5657
|
async checkMonitor(definition) {
|
|
5662
5658
|
return this.http.request("/api/v2/monitors/check", {
|
|
5663
5659
|
method: "POST",
|
|
5664
|
-
body: definition
|
|
5665
|
-
forbiddenAsApiError: true
|
|
5660
|
+
body: definition
|
|
5666
5661
|
});
|
|
5667
5662
|
}
|
|
5668
5663
|
/**
|
|
@@ -5674,14 +5669,12 @@ var DeeplineClient = class {
|
|
|
5674
5669
|
if (options?.dryRun) {
|
|
5675
5670
|
return this.http.request("/api/v2/monitors/check", {
|
|
5676
5671
|
method: "POST",
|
|
5677
|
-
body: definition
|
|
5678
|
-
forbiddenAsApiError: true
|
|
5672
|
+
body: definition
|
|
5679
5673
|
});
|
|
5680
5674
|
}
|
|
5681
5675
|
return this.http.request("/api/v2/monitors/deploy", {
|
|
5682
5676
|
method: "POST",
|
|
5683
|
-
body: definition
|
|
5684
|
-
forbiddenAsApiError: true
|
|
5677
|
+
body: definition
|
|
5685
5678
|
});
|
|
5686
5679
|
}
|
|
5687
5680
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
@@ -5696,28 +5689,28 @@ var DeeplineClient = class {
|
|
|
5696
5689
|
const suffix = query ? `?${query}` : "";
|
|
5697
5690
|
return this.http.request(
|
|
5698
5691
|
`/api/v2/monitors/deployed${suffix}`,
|
|
5699
|
-
{ method: "GET"
|
|
5692
|
+
{ method: "GET" }
|
|
5700
5693
|
);
|
|
5701
5694
|
}
|
|
5702
5695
|
/** Fetch one deployed monitor by public key. Prefer `client.monitors.get(...)`. */
|
|
5703
5696
|
async getMonitor(key) {
|
|
5704
5697
|
return this.http.request(
|
|
5705
5698
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5706
|
-
{ method: "GET"
|
|
5699
|
+
{ method: "GET" }
|
|
5707
5700
|
);
|
|
5708
5701
|
}
|
|
5709
5702
|
/** Published plays depending on one monitor. Prefer `client.monitors.dependents(...)`. */
|
|
5710
5703
|
async getMonitorDependents(key) {
|
|
5711
5704
|
return this.http.request(
|
|
5712
5705
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/dependents`,
|
|
5713
|
-
{ method: "GET"
|
|
5706
|
+
{ method: "GET" }
|
|
5714
5707
|
);
|
|
5715
5708
|
}
|
|
5716
5709
|
/** Update a deployed monitor by public key. Prefer `client.monitors.update(...)`. */
|
|
5717
5710
|
async updateMonitor(key, patch) {
|
|
5718
5711
|
return this.http.request(
|
|
5719
5712
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5720
|
-
{ method: "PATCH", body: patch
|
|
5713
|
+
{ method: "PATCH", body: patch }
|
|
5721
5714
|
);
|
|
5722
5715
|
}
|
|
5723
5716
|
/**
|
|
@@ -5732,7 +5725,7 @@ var DeeplineClient = class {
|
|
|
5732
5725
|
const query = params.toString();
|
|
5733
5726
|
return this.http.request(
|
|
5734
5727
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
5735
|
-
{ method: "DELETE"
|
|
5728
|
+
{ method: "DELETE" }
|
|
5736
5729
|
);
|
|
5737
5730
|
}
|
|
5738
5731
|
/**
|
|
@@ -5743,7 +5736,7 @@ var DeeplineClient = class {
|
|
|
5743
5736
|
const query = options?.dryRun ? "?dry_run=true" : "";
|
|
5744
5737
|
return this.http.request(
|
|
5745
5738
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
5746
|
-
{ method: "POST", body: {}
|
|
5739
|
+
{ method: "POST", body: {} }
|
|
5747
5740
|
);
|
|
5748
5741
|
}
|
|
5749
5742
|
/**
|
|
@@ -7866,8 +7859,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
7866
7859
|
"/api/v2/billing/subscription/checkout",
|
|
7867
7860
|
{
|
|
7868
7861
|
method: "POST",
|
|
7869
|
-
body: { plan_version_id: planVersionId }
|
|
7870
|
-
forbiddenAsApiError: true
|
|
7862
|
+
body: { plan_version_id: planVersionId }
|
|
7871
7863
|
}
|
|
7872
7864
|
);
|
|
7873
7865
|
const url = String(payload.checkout_url || "");
|
|
@@ -12150,6 +12142,134 @@ function resolveEnabledExecutionProfile(override) {
|
|
|
12150
12142
|
}
|
|
12151
12143
|
}
|
|
12152
12144
|
|
|
12145
|
+
// ../shared_libs/play-runtime/sandbox-runtime-limits.ts
|
|
12146
|
+
var STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS = {
|
|
12147
|
+
timeoutSeconds: 30 * 60,
|
|
12148
|
+
memoryGiB: 1,
|
|
12149
|
+
cpu: 1,
|
|
12150
|
+
diskGiB: 3
|
|
12151
|
+
};
|
|
12152
|
+
var MAX_PLAY_SANDBOX_RUNTIME_LIMITS = {
|
|
12153
|
+
timeoutSeconds: 4 * 60 * 60,
|
|
12154
|
+
memoryGiB: 16,
|
|
12155
|
+
cpu: 4,
|
|
12156
|
+
diskGiB: 50
|
|
12157
|
+
};
|
|
12158
|
+
function parsePositiveInteger3(value, unit) {
|
|
12159
|
+
const match = new RegExp(`^(\\d+)\\s*${unit}$`, "i").exec(value.trim());
|
|
12160
|
+
if (!match) return null;
|
|
12161
|
+
const parsed = Number(match[1]);
|
|
12162
|
+
return Number.isSafeInteger(parsed) && parsed > 0 ? parsed : null;
|
|
12163
|
+
}
|
|
12164
|
+
function parseTimeout(value) {
|
|
12165
|
+
const match = /^(\d+)\s*([mh])$/i.exec(value.trim());
|
|
12166
|
+
if (!match) return null;
|
|
12167
|
+
const amount = Number(match[1]);
|
|
12168
|
+
if (!Number.isSafeInteger(amount) || amount <= 0) return null;
|
|
12169
|
+
return amount * (match[2].toLowerCase() === "h" ? 3600 : 60);
|
|
12170
|
+
}
|
|
12171
|
+
function resolvePlaySandboxRuntimeLimits(declaration) {
|
|
12172
|
+
const base = STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS;
|
|
12173
|
+
if (!declaration) return { ...base };
|
|
12174
|
+
const timeoutSeconds = declaration.timeout ? parseTimeout(declaration.timeout) : base.timeoutSeconds;
|
|
12175
|
+
const memoryGiB = declaration.memory ? parsePositiveInteger3(declaration.memory, "GiB") : base.memoryGiB;
|
|
12176
|
+
const diskGiB = declaration.disk ? parsePositiveInteger3(declaration.disk, "GiB") : base.diskGiB;
|
|
12177
|
+
const cpu = declaration.cpu ?? base.cpu;
|
|
12178
|
+
if (timeoutSeconds === null || memoryGiB === null || diskGiB === null || !Number.isSafeInteger(cpu) || cpu <= 0) {
|
|
12179
|
+
throw new Error(
|
|
12180
|
+
'Invalid runtime sandbox declaration. Use timeout like "90m" or "2h", memory/disk like "4GiB", and a positive integer cpu.'
|
|
12181
|
+
);
|
|
12182
|
+
}
|
|
12183
|
+
const resolved = { timeoutSeconds, memoryGiB, cpu, diskGiB };
|
|
12184
|
+
for (const key of ["memoryGiB", "cpu", "diskGiB"]) {
|
|
12185
|
+
if (resolved[key] < base[key]) {
|
|
12186
|
+
throw new Error(
|
|
12187
|
+
`Requested runtime ${key}=${resolved[key]} is below the supported minimum ${base[key]}.`
|
|
12188
|
+
);
|
|
12189
|
+
}
|
|
12190
|
+
}
|
|
12191
|
+
for (const key of Object.keys(
|
|
12192
|
+
resolved
|
|
12193
|
+
)) {
|
|
12194
|
+
if (resolved[key] > MAX_PLAY_SANDBOX_RUNTIME_LIMITS[key]) {
|
|
12195
|
+
throw new Error(
|
|
12196
|
+
`Requested runtime ${key}=${resolved[key]} exceeds this organisation's maximum ${MAX_PLAY_SANDBOX_RUNTIME_LIMITS[key]}.`
|
|
12197
|
+
);
|
|
12198
|
+
}
|
|
12199
|
+
}
|
|
12200
|
+
return resolved;
|
|
12201
|
+
}
|
|
12202
|
+
function hasNonStandardPlaySandboxRuntimeLimits(value) {
|
|
12203
|
+
return Object.keys(value).some(
|
|
12204
|
+
(key) => value[key] !== STANDARD_PLAY_SANDBOX_RUNTIME_LIMITS[key]
|
|
12205
|
+
);
|
|
12206
|
+
}
|
|
12207
|
+
|
|
12208
|
+
// ../shared_libs/play-runtime/worker-api-types.ts
|
|
12209
|
+
var DAYTONA_COMPUTE_PRICING_USD = {
|
|
12210
|
+
vcpuSecond: 14e-6,
|
|
12211
|
+
memoryGiBSecond: 45e-7,
|
|
12212
|
+
storageGiBSecond: 3e-8,
|
|
12213
|
+
includedStorageGiB: 5
|
|
12214
|
+
};
|
|
12215
|
+
function roundUsd(amount) {
|
|
12216
|
+
return Number(Math.max(0, amount).toFixed(12));
|
|
12217
|
+
}
|
|
12218
|
+
function resolveDaytonaSandboxComputeItem(input2) {
|
|
12219
|
+
const billableSeconds = Math.max(1, Math.ceil(input2.wallTimeSeconds));
|
|
12220
|
+
const cpu = Math.max(0, input2.cpu);
|
|
12221
|
+
const memoryGiB = Math.max(0, input2.memoryGiB);
|
|
12222
|
+
const billableDiskGiB = Math.max(
|
|
12223
|
+
0,
|
|
12224
|
+
input2.diskGiB - DAYTONA_COMPUTE_PRICING_USD.includedStorageGiB
|
|
12225
|
+
);
|
|
12226
|
+
const providerCostUsd = roundUsd(
|
|
12227
|
+
billableSeconds * (cpu * DAYTONA_COMPUTE_PRICING_USD.vcpuSecond + memoryGiB * DAYTONA_COMPUTE_PRICING_USD.memoryGiBSecond + billableDiskGiB * DAYTONA_COMPUTE_PRICING_USD.storageGiBSecond)
|
|
12228
|
+
);
|
|
12229
|
+
return {
|
|
12230
|
+
itemId: input2.itemId,
|
|
12231
|
+
source: input2.source ?? "daytona",
|
|
12232
|
+
unit: "sandbox_second",
|
|
12233
|
+
units: billableSeconds,
|
|
12234
|
+
providerCostUsd,
|
|
12235
|
+
metadata: {
|
|
12236
|
+
sandboxId: input2.sandboxId ?? null,
|
|
12237
|
+
cpu,
|
|
12238
|
+
memoryGiB,
|
|
12239
|
+
diskGiB: Math.max(0, input2.diskGiB),
|
|
12240
|
+
billableDiskGiB,
|
|
12241
|
+
startedAt: input2.startedAt,
|
|
12242
|
+
endedAt: input2.endedAt
|
|
12243
|
+
}
|
|
12244
|
+
};
|
|
12245
|
+
}
|
|
12246
|
+
|
|
12247
|
+
// ../shared_libs/billing/compute-pricing.ts
|
|
12248
|
+
var COMPUTE_BILLING_MARKUP_MULTIPLIER = 5;
|
|
12249
|
+
var DEFAULT_USD_PER_CUSTOMER_CREDIT = 0.1;
|
|
12250
|
+
var DEFAULT_PROVIDER_MARKUP_MULTIPLIER = 1.4;
|
|
12251
|
+
function roundUpCredits(value) {
|
|
12252
|
+
if (!Number.isFinite(value) || value <= 0) return 0;
|
|
12253
|
+
return Math.ceil(value * 100) / 100;
|
|
12254
|
+
}
|
|
12255
|
+
function estimateDaytonaMaximumComputeCredits(limits) {
|
|
12256
|
+
const item = resolveDaytonaSandboxComputeItem({
|
|
12257
|
+
itemId: "estimate",
|
|
12258
|
+
wallTimeSeconds: limits.timeoutSeconds,
|
|
12259
|
+
cpu: limits.cpu,
|
|
12260
|
+
memoryGiB: limits.memoryGiB,
|
|
12261
|
+
diskGiB: limits.diskGiB
|
|
12262
|
+
});
|
|
12263
|
+
return roundUpCredits(
|
|
12264
|
+
item.providerCostUsd * COMPUTE_BILLING_MARKUP_MULTIPLIER * DEFAULT_PROVIDER_MARKUP_MULTIPLIER / DEFAULT_USD_PER_CUSTOMER_CREDIT
|
|
12265
|
+
);
|
|
12266
|
+
}
|
|
12267
|
+
function formatNonStandardSandboxRuntimeWarning(limits) {
|
|
12268
|
+
if (!hasNonStandardPlaySandboxRuntimeLimits(limits)) return null;
|
|
12269
|
+
const maximumComputeCredits = estimateDaytonaMaximumComputeCredits(limits);
|
|
12270
|
+
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.`;
|
|
12271
|
+
}
|
|
12272
|
+
|
|
12153
12273
|
// ../shared_libs/play-runtime/internal-step-ids.ts
|
|
12154
12274
|
var INTERNAL_GLUE_NODE_ID_PREFIX = "run_javascript:";
|
|
12155
12275
|
function isInternalGlueStepId(stepId) {
|
|
@@ -12709,7 +12829,7 @@ function looksLikeFilePath(target) {
|
|
|
12709
12829
|
}
|
|
12710
12830
|
return target.includes("\\") || /\.(ts|js|mjs|play\.ts)$/.test(target);
|
|
12711
12831
|
}
|
|
12712
|
-
function
|
|
12832
|
+
function parsePositiveInteger4(value, flagName) {
|
|
12713
12833
|
const parsed = Number.parseInt(value, 10);
|
|
12714
12834
|
if (!Number.isFinite(parsed) || parsed <= 0) {
|
|
12715
12835
|
throw new Error(`${flagName} must be a positive integer.`);
|
|
@@ -16229,7 +16349,7 @@ function parsePlayRunOptions(args) {
|
|
|
16229
16349
|
);
|
|
16230
16350
|
}
|
|
16231
16351
|
if ((arg === "--tail-timeout-ms" || arg === "--timeout-ms") && args[index + 1]) {
|
|
16232
|
-
waitTimeoutMs =
|
|
16352
|
+
waitTimeoutMs = parsePositiveInteger4(args[++index], arg);
|
|
16233
16353
|
continue;
|
|
16234
16354
|
}
|
|
16235
16355
|
if (PLAY_RUN_RESERVED_BOOLEAN_FLAGS.has(arg)) {
|
|
@@ -16552,23 +16672,49 @@ function formatPlayCheckIssueLines(issue) {
|
|
|
16552
16672
|
}
|
|
16553
16673
|
return lines;
|
|
16554
16674
|
}
|
|
16555
|
-
function printPlayCheckIssues(issues, writer) {
|
|
16556
|
-
|
|
16557
|
-
|
|
16558
|
-
|
|
16675
|
+
function printPlayCheckIssues(issues, writer, warnings = void 0) {
|
|
16676
|
+
const errorIssues = (issues ?? []).filter(
|
|
16677
|
+
(issue) => issue.severity === "error"
|
|
16678
|
+
);
|
|
16679
|
+
const warningIssues = (issues ?? []).filter(
|
|
16680
|
+
(issue) => issue.severity === "warning"
|
|
16681
|
+
);
|
|
16682
|
+
const structuredWarningMessages = warningIssues.map(
|
|
16683
|
+
(issue) => issue.message.trim()
|
|
16684
|
+
);
|
|
16685
|
+
const stringWarnings = [...new Set(warnings ?? [])].filter((warning) => {
|
|
16686
|
+
const trimmed = warning.trim();
|
|
16687
|
+
return trimmed.length > 0 && !structuredWarningMessages.some(
|
|
16688
|
+
(message) => trimmed === message || trimmed.startsWith(message)
|
|
16689
|
+
);
|
|
16690
|
+
});
|
|
16559
16691
|
if (errorIssues.length) {
|
|
16560
16692
|
writer(" issues:");
|
|
16561
16693
|
for (const issue of errorIssues) {
|
|
16562
16694
|
for (const line of formatPlayCheckIssueLines(issue)) writer(line);
|
|
16563
16695
|
}
|
|
16564
16696
|
}
|
|
16565
|
-
if (warningIssues.length) {
|
|
16697
|
+
if (warningIssues.length || stringWarnings.length) {
|
|
16566
16698
|
writer(" warnings:");
|
|
16567
16699
|
for (const issue of warningIssues) {
|
|
16568
16700
|
for (const line of formatPlayCheckIssueLines(issue)) writer(line);
|
|
16569
16701
|
}
|
|
16702
|
+
for (const warning of stringWarnings) writer(` - ${warning.trim()}`);
|
|
16570
16703
|
}
|
|
16571
16704
|
}
|
|
16705
|
+
function formatPlaySandboxRuntimeWarning(declaration) {
|
|
16706
|
+
if (!declaration) return null;
|
|
16707
|
+
const warning = formatNonStandardSandboxRuntimeWarning(
|
|
16708
|
+
resolvePlaySandboxRuntimeLimits(declaration)
|
|
16709
|
+
);
|
|
16710
|
+
return warning ? `Warning: ${warning}` : null;
|
|
16711
|
+
}
|
|
16712
|
+
function printBundledRuntimeWarning(bundle) {
|
|
16713
|
+
const warning = formatPlaySandboxRuntimeWarning(
|
|
16714
|
+
bundle.sandboxRuntimeDeclaration
|
|
16715
|
+
);
|
|
16716
|
+
if (warning) console.warn(warning);
|
|
16717
|
+
}
|
|
16572
16718
|
function partitionMirroredErrors(errors, issues) {
|
|
16573
16719
|
const errorMessages = (issues ?? []).filter((issue) => issue.severity === "error").map((issue) => issue.message.trim()).filter((message) => message.length > 0);
|
|
16574
16720
|
if (errorMessages.length === 0) {
|
|
@@ -16746,7 +16892,11 @@ async function handlePlayCheck(args) {
|
|
|
16746
16892
|
}
|
|
16747
16893
|
printPlayTriggers(enrichedResult.triggers);
|
|
16748
16894
|
printRecognizedSummary(enrichedResult.recognized);
|
|
16749
|
-
printPlayCheckIssues(
|
|
16895
|
+
printPlayCheckIssues(
|
|
16896
|
+
enrichedResult.issues,
|
|
16897
|
+
(line) => console.log(line),
|
|
16898
|
+
enrichedResult.warnings
|
|
16899
|
+
);
|
|
16750
16900
|
printToolGetterHints(enrichedResult.toolGetterHints);
|
|
16751
16901
|
} else {
|
|
16752
16902
|
console.error(`\u2717 ${playName} failed cloud play check`);
|
|
@@ -16757,7 +16907,11 @@ async function handlePlayCheck(args) {
|
|
|
16757
16907
|
for (const error of unstructuredErrors) {
|
|
16758
16908
|
console.error(` ${error}`);
|
|
16759
16909
|
}
|
|
16760
|
-
printPlayCheckIssues(
|
|
16910
|
+
printPlayCheckIssues(
|
|
16911
|
+
enrichedResult.issues,
|
|
16912
|
+
(line) => console.error(line),
|
|
16913
|
+
enrichedResult.warnings
|
|
16914
|
+
);
|
|
16761
16915
|
printToolGetterHints(enrichedResult.toolGetterHints);
|
|
16762
16916
|
}
|
|
16763
16917
|
return enrichedResult.valid ? 0 : 1;
|
|
@@ -16818,6 +16972,7 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
16818
16972
|
}
|
|
16819
16973
|
const bundleResult = graph.root;
|
|
16820
16974
|
const playName = bundleResult.playName ?? extractPlayName(sourceCode, absolutePlayPath);
|
|
16975
|
+
printBundledRuntimeWarning(bundleResult);
|
|
16821
16976
|
try {
|
|
16822
16977
|
progress.phase("publishing imported plays");
|
|
16823
16978
|
await traceCliSpan(
|
|
@@ -17355,7 +17510,7 @@ async function handleRunLogs(args) {
|
|
|
17355
17510
|
for (let index = 0; index < args.length; index += 1) {
|
|
17356
17511
|
const arg = args[index];
|
|
17357
17512
|
if (arg === "--limit" && args[index + 1]) {
|
|
17358
|
-
limit =
|
|
17513
|
+
limit = parsePositiveInteger4(args[++index], "--limit");
|
|
17359
17514
|
continue;
|
|
17360
17515
|
}
|
|
17361
17516
|
if (arg === "--out" && args[index + 1]) {
|