deepline 0.3.545 → 0.3.546
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/errors.ts +1 -1
- package/dist/bundling-sources/sdk/src/http-core.ts +41 -12
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +2 -2
- package/dist/bundling-sources/shared_libs/play-data-plane/contracts.ts +5 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-contract.ts +27 -0
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/fleet-sandbox-sweep.ts +40 -3
- package/dist/bundling-sources/shared_libs/play-runtime/modal-runtime-config.ts +19 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +18 -4
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +441 -103
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox-egress.ts +322 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +200 -64
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-speed-profile.ts +65 -2
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +5 -3
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +32 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +206 -12
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +30 -2
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +30 -1
- package/dist/bundling-sources/shared_libs/plays/static-pipeline.ts +35 -2
- package/dist/bundling-sources/shared_libs/security/email-blacklist.ts +35 -1
- package/dist/bundling-sources/shared_libs/security/email-domain.ts +19 -0
- package/dist/bundling-sources/shared_libs/security/secret-redaction.ts +2 -0
- package/dist/cli/{auth-VZAMAMFW.mjs → auth-KFWG72AZ.mjs} +6 -6
- package/dist/cli/auth-W32GMYND.js +43 -0
- package/dist/cli/{billing-DADQUQEZ.mjs → billing-MMZ336HO.mjs} +10 -10
- package/dist/cli/{billing-ASZJDFH2.js → billing-OQVOAZ4S.js} +98 -98
- package/dist/cli/{chunk-HLUNTJBO.mjs → chunk-3DUNNZB6.mjs} +4 -4
- package/dist/cli/{chunk-YRQKRQDU.js → chunk-4AZLGNXV.js} +36 -26
- package/dist/cli/{chunk-Y3T5GWYK.mjs → chunk-5OEFXAKP.mjs} +5 -1
- package/dist/cli/{chunk-ERLW6RPA.js → chunk-5V7NZKGG.js} +2 -2
- package/dist/cli/{chunk-34UKDHRL.js → chunk-5VNQMVCU.js} +26 -26
- package/dist/cli/{chunk-DZTVDL2X.js → chunk-5W4ENHWM.js} +12 -12
- package/dist/cli/{chunk-7JZ27AFH.mjs → chunk-6FBDTYR2.mjs} +2 -2
- package/dist/cli/{chunk-QM7PHHYZ.js → chunk-6LG7MLJ2.js} +44 -44
- package/dist/cli/{chunk-7MFATEUC.mjs → chunk-6Y5TU3R7.mjs} +2 -2
- package/dist/cli/{chunk-52C6W7FG.mjs → chunk-7MY7KWJS.mjs} +1 -1
- package/dist/cli/{chunk-7P72EGLK.mjs → chunk-7ZW67ME6.mjs} +1 -1
- package/dist/cli/{chunk-TQKHXMV3.js → chunk-BTFUAGHC.js} +16 -16
- package/dist/cli/{chunk-LWPFMYSO.mjs → chunk-EEG46QZY.mjs} +2 -2
- package/dist/cli/{chunk-NCX2JH2F.js → chunk-EEJHB76U.js} +9 -9
- package/dist/cli/{chunk-2GJZLIKW.js → chunk-EITMD3A5.js} +1 -1
- package/dist/cli/{chunk-DGKDCZGC.js → chunk-F2VEFMU5.js} +13 -13
- package/dist/cli/{chunk-4JQEAYN3.js → chunk-F5YQXCP3.js} +5 -1
- package/dist/cli/{chunk-2CBX43LP.mjs → chunk-GOOF7E2B.mjs} +5 -5
- package/dist/cli/{chunk-YWTRCKGD.mjs → chunk-GYTSDSQD.mjs} +11 -11
- package/dist/cli/{chunk-G5TV6WLV.js → chunk-H7Q5IDO3.js} +19 -19
- package/dist/cli/{chunk-3TCHX7YK.mjs → chunk-HJR2DDJS.mjs} +2 -2
- package/dist/cli/{chunk-OGQYAJSO.js → chunk-IVWU7SJC.js} +5 -5
- package/dist/cli/{chunk-XGEUPU3L.mjs → chunk-J65HJCJO.mjs} +2 -2
- package/dist/cli/{chunk-Z4Y4BLW7.mjs → chunk-JA633HRV.mjs} +3 -3
- package/dist/cli/{chunk-LTCEZWPZ.mjs → chunk-JARZ47OP.mjs} +2 -2
- package/dist/cli/{chunk-5YYWZ43J.js → chunk-JCH4UNNS.js} +2 -2
- package/dist/cli/{chunk-7MHBJU73.js → chunk-JCWNF44W.js} +22 -22
- package/dist/cli/{chunk-C6XYSTBW.js → chunk-JVOUQFHT.js} +1 -1
- package/dist/cli/{chunk-HR5BT42R.js → chunk-JYG4XZLT.js} +99 -99
- package/dist/cli/{chunk-KYO2FICL.mjs → chunk-K2XELBPF.mjs} +5 -5
- package/dist/cli/{chunk-2HFSYH7V.mjs → chunk-KUK7ARXA.mjs} +2 -2
- package/dist/cli/{chunk-WP36UBRY.mjs → chunk-LHE2TSV6.mjs} +1 -1
- package/dist/cli/{chunk-N4LADLCO.js → chunk-LIJKRDDG.js} +6 -6
- package/dist/cli/{chunk-KRW727W6.mjs → chunk-LX2TC3HO.mjs} +4 -4
- package/dist/cli/{chunk-QI57XUGA.js → chunk-MEGHIX4M.js} +5 -5
- package/dist/cli/{chunk-Z7QM244Q.mjs → chunk-MI7X6V6V.mjs} +3 -3
- package/dist/cli/{chunk-CJ7DBYEQ.js → chunk-MXQP7CXZ.js} +8 -8
- package/dist/cli/{chunk-GFRJU2KB.js → chunk-ND7SFRQL.js} +2 -2
- package/dist/cli/{chunk-CQBIO6HW.mjs → chunk-NURW5XH4.mjs} +1 -1
- package/dist/cli/{chunk-GWDPNOA7.mjs → chunk-OAKWSLKS.mjs} +2 -2
- package/dist/cli/{chunk-XBYQZEUE.mjs → chunk-P7A3H6G5.mjs} +1 -1
- package/dist/cli/{chunk-NZDZGK35.js → chunk-PMDHY2YK.js} +7 -7
- package/dist/cli/{chunk-4NZ3OZNO.mjs → chunk-PU3ZAG6V.mjs} +1 -1
- package/dist/cli/{chunk-3M2QH3KA.mjs → chunk-RO66FPTS.mjs} +22 -12
- package/dist/cli/{chunk-3NG43NXB.js → chunk-SH32HL7I.js} +53 -53
- package/dist/cli/{chunk-IYJO3RWR.js → chunk-SYTWWVIQ.js} +5 -5
- package/dist/cli/{chunk-FB7UPZ6M.js → chunk-TBWYZOSV.js} +3 -3
- package/dist/cli/{chunk-CXETRZ3G.js → chunk-UQJBV5PM.js} +10 -10
- package/dist/cli/{chunk-HPX7LLAM.mjs → chunk-UREAIHUU.mjs} +2 -2
- package/dist/cli/{chunk-2FF3O2Y2.js → chunk-VAT2SXFF.js} +12 -12
- package/dist/cli/{chunk-NAN3A4IF.mjs → chunk-VPERQ3U6.mjs} +5 -5
- package/dist/cli/{chunk-XMUPZINS.mjs → chunk-VTK3HGMN.mjs} +5 -5
- package/dist/cli/{chunk-JL5JU3LD.mjs → chunk-VXTTAYOT.mjs} +2 -2
- package/dist/cli/{chunk-EK5C2R7S.js → chunk-WKHPLBJK.js} +15 -15
- package/dist/cli/{chunk-EWA3M54M.mjs → chunk-X5KOHDJN.mjs} +1 -1
- package/dist/cli/{chunk-D3SXB2NX.js → chunk-Z3UEBFIN.js} +41 -41
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/concurrent-runs-help-6QT7ZR4W.js +21 -0
- package/dist/cli/{concurrent-runs-help-YP7ALTDB.mjs → concurrent-runs-help-C2O5YKQA.mjs} +7 -7
- package/dist/cli/{csv-67WT5EGR.js → csv-MJDNOIQJ.js} +14 -14
- package/dist/cli/{csv-D5ITFSYI.mjs → csv-Z4DNGR54.mjs} +5 -5
- package/dist/cli/{db-SZYBRFYG.mjs → db-4RL2BNOF.mjs} +7 -7
- package/dist/cli/{db-GZS76X7R.js → db-S5QVPK5E.js} +32 -32
- package/dist/cli/{describe-YJ7ZLLLI.mjs → describe-L4P5SZLQ.mjs} +19 -19
- package/dist/cli/describe-VLU2LUDJ.js +50 -0
- package/dist/cli/describe-core.d.mts +3 -3
- package/dist/cli/describe-core.d.ts +3 -3
- package/dist/cli/describe-core.js +1 -1
- package/dist/cli/describe-core.mjs +1 -1
- package/dist/cli/{executions-O5USTYGL.js → executions-MFZ2Z36O.js} +9 -9
- package/dist/cli/{executions-HMYGR32E.mjs → executions-RR6O3XK5.mjs} +7 -7
- package/dist/cli/{feedback-Z3NXWYUO.mjs → feedback-EQBQ3ABB.mjs} +7 -7
- package/dist/cli/{feedback-RHLFDCRS.js → feedback-YDAG7VH2.js} +15 -15
- package/dist/cli/git-E6W44F5M.js +25 -0
- package/dist/cli/{git-CLFKXELB.mjs → git-YGLCCU35.mjs} +6 -6
- package/dist/cli/index.js +150 -150
- package/dist/cli/index.mjs +46 -46
- package/dist/cli/{integrations-FOACOBQB.mjs → integrations-FWYXSBHK.mjs} +8 -8
- package/dist/cli/{integrations-TZ4QEQGV.js → integrations-IQXYMRMW.js} +16 -16
- package/dist/cli/{legacy-noops-6F6Y3BV7.mjs → legacy-noops-I4YRIX5F.mjs} +7 -7
- package/dist/cli/{legacy-noops-QRDOS33V.js → legacy-noops-U7LI7UXC.js} +10 -10
- package/dist/cli/{mcp-ETMMDDGB.js → mcp-GX2UKKWU.js} +25 -25
- package/dist/cli/{mcp-UXRCWOZU.mjs → mcp-QJBMB6VS.mjs} +5 -5
- package/dist/cli/{monitors-DITT7QTV.js → monitors-WCJYINGX.js} +102 -102
- package/dist/cli/{monitors-6XEWR46R.mjs → monitors-Z6EGKYJP.mjs} +8 -8
- package/dist/cli/{org-4DE37X3L.js → org-7SKG423N.js} +89 -89
- package/dist/cli/{org-CVSSH73G.mjs → org-NNHICBR2.mjs} +7 -7
- package/dist/cli/{play-RH6P45CI.js → play-4P4DTG3Q.js} +318 -318
- package/dist/cli/{play-Y5NCHOKK.mjs → play-CXDFPJ7Z.mjs} +18 -18
- package/dist/cli/{providers-DU42DLOL.js → providers-EE4TUE3O.js} +10 -10
- package/dist/cli/{providers-VHUHC4IZ.mjs → providers-VQLQ7DTR.mjs} +7 -7
- package/dist/cli/{quickstart-HJY5YYE5.mjs → quickstart-IYNJRB5G.mjs} +5 -5
- package/dist/cli/{quickstart-XJ43JLEC.js → quickstart-RVXHK4WA.js} +7 -7
- package/dist/cli/{run-JXUS7QFI.js → run-R3F34KU3.js} +44 -44
- package/dist/cli/{run-JAIXHVH7.mjs → run-VBQPPMEX.mjs} +24 -24
- package/dist/cli/{search-RDMNM2AX.mjs → search-B7R62HX5.mjs} +8 -8
- package/dist/cli/search-UUVFXZRA.js +32 -0
- package/dist/cli/{search-output-ZKTR3WTJ.mjs → search-output-LNQQXIGZ.mjs} +5 -5
- package/dist/cli/{search-output-RKAM2HBH.js → search-output-LWHWEPOT.js} +7 -7
- package/dist/cli/{secrets-WSW3FTF6.mjs → secrets-NM3VAJLO.mjs} +7 -7
- package/dist/cli/{secrets-TKFVMAYX.js → secrets-QBOZ7WTD.js} +16 -16
- package/dist/cli/sessions-K3PD73Q2.js +22 -0
- package/dist/cli/{sessions-724BK6VP.mjs → sessions-R5BSIJ4I.mjs} +7 -7
- package/dist/cli/{settings-5LJZDAZU.js → settings-POYWKNRD.js} +86 -86
- package/dist/cli/{settings-YRC7J75G.mjs → settings-S4PN7WLY.mjs} +13 -13
- package/dist/cli/{setup-STNPX5MK.mjs → setup-PFLXVBTL.mjs} +10 -10
- package/dist/cli/{setup-2F3DBSOS.js → setup-VHB4Z654.js} +50 -50
- package/dist/cli/skills-QNE2EYT3.js +36 -0
- package/dist/cli/{skills-D5PK56FO.mjs → skills-W2TELEU7.mjs} +8 -8
- package/dist/cli/tools-3RLI4HGF.js +57 -0
- package/dist/cli/{tools-WOGWMBA3.mjs → tools-M4FA6N3Y.mjs} +18 -18
- package/dist/cli/update-UT6KIW2W.js +34 -0
- package/dist/cli/{update-PC6XSWMI.mjs → update-W7LIHEA7.mjs} +10 -10
- package/dist/cli/{views-HLCLAPWN.js → views-DJXAGD7V.js} +22 -22
- package/dist/cli/{views-IIHT4RYQ.mjs → views-KTVPV6UP.mjs} +7 -7
- package/dist/cli/{workflow-HK4MZ7LK.mjs → workflow-LGKCRODX.mjs} +8 -8
- package/dist/cli/{workflow-CCZ2A7DI.js → workflow-NVZDJKH2.js} +18 -18
- package/dist/{client-BQ6yuSjM.d.ts → client-CCyWJqAI.d.ts} +1 -1
- package/dist/{client-DfdUc_MY.d.mts → client-Tp1LSULB.d.mts} +1 -1
- package/dist/{client-core-3GQ8WMuk.d.ts → client-core-BpYiYEfu.d.ts} +1 -1
- package/dist/{client-core-ClsNRytk.d.mts → client-core-D8eCZz3O.d.mts} +1 -1
- package/dist/{compiler-manifest-BWFtsQIC.d.mts → compiler-manifest-EBWEUj0b.d.mts} +35 -0
- package/dist/{compiler-manifest-BWFtsQIC.d.ts → compiler-manifest-EBWEUj0b.d.ts} +35 -0
- package/dist/{errors-Lm9_vJHZ.d.ts → errors-CParKUQR.d.mts} +2 -2
- package/dist/{errors-CwKXXtuu.d.mts → errors-Qt0OTA7_.d.ts} +2 -2
- package/dist/{index-DjwsAt82.d.mts → index-BMUVCNp7.d.mts} +1 -1
- package/dist/{index-3vJ-V9yw.d.ts → index-CoqDkIw0.d.ts} +1 -1
- package/dist/index.d.mts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +10 -10
- package/dist/index.mjs +7 -7
- package/dist/install-integrity.json +126 -124
- package/dist/plays/bundle-play-file.d.mts +3 -3
- package/dist/plays/bundle-play-file.d.ts +3 -3
- package/dist/plays/bundle-play-file.mjs +20 -1
- package/dist/plays/play-description.d.mts +2 -2
- package/dist/plays/play-description.d.ts +2 -2
- package/dist/plays/run-request.d.mts +2 -2
- package/dist/plays/run-request.d.ts +2 -2
- package/dist/release.d.mts +1 -1
- package/dist/release.d.ts +1 -1
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/dist/server.d.mts +4 -4
- package/dist/server.d.ts +4 -4
- package/dist/server.js +10 -10
- package/dist/server.mjs +4 -4
- package/package.json +1 -1
- package/dist/cli/auth-455MB4K6.js +0 -43
- package/dist/cli/concurrent-runs-help-GFWXOKF5.js +0 -21
- package/dist/cli/describe-ZRGYAEBT.js +0 -50
- package/dist/cli/git-RC4XDATD.js +0 -25
- package/dist/cli/search-O5VVMXII.js +0 -32
- package/dist/cli/sessions-3PWFWCHO.js +0 -22
- package/dist/cli/skills-RFOMVXIT.js +0 -36
- package/dist/cli/tools-CAO6EVUW.js +0 -57
- package/dist/cli/update-L4DQZY3G.js +0 -34
|
@@ -133,7 +133,7 @@ export class AuthError extends DeeplineError {
|
|
|
133
133
|
* @sdkReference errors 100
|
|
134
134
|
*/
|
|
135
135
|
export class RateLimitError extends DeeplineError {
|
|
136
|
-
/** Milliseconds to wait before retrying,
|
|
136
|
+
/** Milliseconds to wait before retrying: the exact `retry-after-ms` delay when Deepline sends one, else the `Retry-After` header. Defaults to 5000. */
|
|
137
137
|
public retryAfterMs: number;
|
|
138
138
|
|
|
139
139
|
/** Constructed by the SDK after exhausting HTTP-level rate-limit retries. */
|
|
@@ -546,7 +546,7 @@ export class HttpClient {
|
|
|
546
546
|
const candidateUrls = options?.exactUrlOnly
|
|
547
547
|
? [url]
|
|
548
548
|
: buildCandidateUrls(url);
|
|
549
|
-
let
|
|
549
|
+
let retryAfterHint: RetryAfterHint | null = null;
|
|
550
550
|
let totalRetryWaitMs = 0;
|
|
551
551
|
|
|
552
552
|
let maxRetries = options?.maxRetries ?? this.config.maxRetries;
|
|
@@ -559,11 +559,19 @@ export class HttpClient {
|
|
|
559
559
|
}
|
|
560
560
|
if (attempt > 0) {
|
|
561
561
|
const backoffMs = Math.min(1000 * Math.pow(2, attempt - 1), 30_000);
|
|
562
|
+
// An exact limiter hint is when the next slot frees, so the first
|
|
563
|
+
// retry waits only that. Being refused again means other callers took
|
|
564
|
+
// the slot: later retries keep the exponential backoff floor so a
|
|
565
|
+
// crowd of refused callers spreads out instead of spending every
|
|
566
|
+
// retry in the same instant. A whole-second Retry-After is always a
|
|
567
|
+
// floor under the backoff.
|
|
562
568
|
const delayMs =
|
|
563
|
-
|
|
569
|
+
retryAfterHint === null
|
|
564
570
|
? backoffMs
|
|
565
|
-
:
|
|
566
|
-
|
|
571
|
+
: retryAfterHint.exact && attempt === 1
|
|
572
|
+
? retryAfterHint.delayMs
|
|
573
|
+
: Math.max(backoffMs, retryAfterHint.delayMs);
|
|
574
|
+
retryAfterHint = null;
|
|
567
575
|
if (totalRetryWaitMs + delayMs > MAX_AUTOMATIC_RETRY_WAIT_MS) {
|
|
568
576
|
// Honor the upstream delay by returning its original error. Never
|
|
569
577
|
// retry sooner than requested, and never let automatic retries hold
|
|
@@ -675,7 +683,10 @@ export class HttpClient {
|
|
|
675
683
|
failure.retryAfterMs ?? Math.max(0, retryAfter),
|
|
676
684
|
});
|
|
677
685
|
if (responseRetryAllowed && attempt < maxRetries) {
|
|
678
|
-
|
|
686
|
+
retryAfterHint = parseRetryAfterHint(response) ?? {
|
|
687
|
+
delayMs: retryAfter,
|
|
688
|
+
exact: false,
|
|
689
|
+
};
|
|
679
690
|
break;
|
|
680
691
|
}
|
|
681
692
|
throw attachToolUpstreamResponse(lastError, parsed);
|
|
@@ -698,7 +709,10 @@ export class HttpClient {
|
|
|
698
709
|
const retryAfter = parseRetryAfter(response);
|
|
699
710
|
lastError = new RateLimitError(retryAfter);
|
|
700
711
|
if (responseRetryAllowed && attempt < maxRetries) {
|
|
701
|
-
|
|
712
|
+
retryAfterHint = parseRetryAfterHint(response) ?? {
|
|
713
|
+
delayMs: retryAfter,
|
|
714
|
+
exact: false,
|
|
715
|
+
};
|
|
702
716
|
break;
|
|
703
717
|
}
|
|
704
718
|
throw options?.toolId
|
|
@@ -740,7 +754,7 @@ export class HttpClient {
|
|
|
740
754
|
},
|
|
741
755
|
);
|
|
742
756
|
if (retryableApiError && attempt < maxRetries) {
|
|
743
|
-
|
|
757
|
+
retryAfterHint = parseRetryAfterHint(response);
|
|
744
758
|
break;
|
|
745
759
|
}
|
|
746
760
|
throw lastError;
|
|
@@ -770,7 +784,7 @@ export class HttpClient {
|
|
|
770
784
|
response: parsed,
|
|
771
785
|
});
|
|
772
786
|
if (retryableApiError && attempt < maxRetries) {
|
|
773
|
-
|
|
787
|
+
retryAfterHint = parseRetryAfterHint(response);
|
|
774
788
|
break;
|
|
775
789
|
}
|
|
776
790
|
throw options?.toolId
|
|
@@ -1220,17 +1234,32 @@ function detectHtmlErrorBody(
|
|
|
1220
1234
|
};
|
|
1221
1235
|
}
|
|
1222
1236
|
|
|
1223
|
-
|
|
1237
|
+
type RetryAfterHint = {
|
|
1238
|
+
delayMs: number;
|
|
1239
|
+
/** True when the server sent the limiter's exact delay (`retry-after-ms`). */
|
|
1240
|
+
exact: boolean;
|
|
1241
|
+
};
|
|
1242
|
+
|
|
1243
|
+
/** The response's retry delay in milliseconds. Falls back to 5000ms. */
|
|
1224
1244
|
function parseRetryAfter(response: Response): number {
|
|
1225
|
-
return
|
|
1245
|
+
return parseRetryAfterHint(response)?.delayMs ?? 5000;
|
|
1226
1246
|
}
|
|
1227
1247
|
|
|
1228
|
-
|
|
1248
|
+
/**
|
|
1249
|
+
* Deepline's execute limiter sends `retry-after-ms`, the exact delay until
|
|
1250
|
+
* its window frees a slot, beside `Retry-After`, which can only say whole
|
|
1251
|
+
* seconds. Prefer the exact delay when it is present.
|
|
1252
|
+
*/
|
|
1253
|
+
function parseRetryAfterHint(response: Response): RetryAfterHint | null {
|
|
1254
|
+
const exactMs = Number(response.headers.get('retry-after-ms') ?? '');
|
|
1255
|
+
if (Number.isFinite(exactMs) && exactMs > 0) {
|
|
1256
|
+
return { delayMs: Math.ceil(exactMs), exact: true };
|
|
1257
|
+
}
|
|
1229
1258
|
const header = response.headers.get('retry-after');
|
|
1230
1259
|
if (header) {
|
|
1231
1260
|
const seconds = Number(header);
|
|
1232
1261
|
if (Number.isFinite(seconds) && seconds > 0) {
|
|
1233
|
-
return seconds * 1000;
|
|
1262
|
+
return { delayMs: seconds * 1000, exact: false };
|
|
1234
1263
|
}
|
|
1235
1264
|
}
|
|
1236
1265
|
return null;
|
|
@@ -205,7 +205,7 @@ export const SDK_RELEASE = {
|
|
|
205
205
|
// getters keep their established compatibility behavior.
|
|
206
206
|
// 0.3.1 deprecated the legacy `deepline enrich` command in favor of Plays.
|
|
207
207
|
// 0.3.90 is the first deliberately versioned SDK release for API v3.
|
|
208
|
-
version: '0.3.
|
|
208
|
+
version: '0.3.546',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -1245,8 +1245,8 @@
|
|
|
1245
1245
|
"owner": "billing",
|
|
1246
1246
|
"criticality": "operational",
|
|
1247
1247
|
"purpose": "Request workspace drains for indexed pending usage from closed UTC days, including late arrivals.",
|
|
1248
|
-
"successDefinition": "Discovery reaches the end of the
|
|
1249
|
-
"failureDefinition": "Discovery or wake dispatch fails, or the bounded pass stops before reaching the end. The next invocation resumes from its saved
|
|
1248
|
+
"successDefinition": "Discovery reaches the end of the chronological pending-event scan and issues asynchronous workspace wake requests. Each query reads at most 25 events or 128 KiB; each invocation commits at most 40 pages within five minutes.",
|
|
1249
|
+
"failureDefinition": "Discovery or wake dispatch fails, or the bounded pass stops before reaching the end. The next invocation resumes from its saved event cursor and frozen time range.",
|
|
1250
1250
|
"startGraceMs": 120000,
|
|
1251
1251
|
"runTimeoutMs": 420000,
|
|
1252
1252
|
"failureAlert": "convex_action_wrapper",
|
|
@@ -34,4 +34,9 @@ export interface PlaySheetColumnContract {
|
|
|
34
34
|
export interface PlaySheetContract {
|
|
35
35
|
tableNamespace: string;
|
|
36
36
|
columns: PlaySheetColumnContract[];
|
|
37
|
+
/**
|
|
38
|
+
* Authored fields the run page shows first, in this order, from
|
|
39
|
+
* `.run({ columnOrder: [...] })`. Display only; absent on older contracts.
|
|
40
|
+
*/
|
|
41
|
+
columnOrder?: string[];
|
|
37
42
|
}
|
|
@@ -318,3 +318,30 @@ export function datasetWrittenColumnOrder(input: {
|
|
|
318
318
|
for (const field of input.outputFields ?? []) append(field);
|
|
319
319
|
return order;
|
|
320
320
|
}
|
|
321
|
+
|
|
322
|
+
/**
|
|
323
|
+
* The written order to show: the contract's `columnOrder` columns first, in
|
|
324
|
+
* that order, then every other written column in written order. Always a
|
|
325
|
+
* permutation of `written` (a listed column the run never wrote is skipped),
|
|
326
|
+
* so the ledger's longest-list rule still sees the full set. `written` stays
|
|
327
|
+
* the append-only order; apply this to a copy at emission.
|
|
328
|
+
*/
|
|
329
|
+
export function datasetDisplayColumnOrder(
|
|
330
|
+
written: readonly string[],
|
|
331
|
+
contract: Pick<PlaySheetContract, 'columns' | 'columnOrder'>,
|
|
332
|
+
): string[] {
|
|
333
|
+
if (!contract.columnOrder?.length) return [...written];
|
|
334
|
+
const present = new Set(written);
|
|
335
|
+
const leading: string[] = [];
|
|
336
|
+
for (const field of contract.columnOrder) {
|
|
337
|
+
const declared = contract.columns.find(
|
|
338
|
+
(column) =>
|
|
339
|
+
(column.source === 'input' || column.source === 'datasetColumn') &&
|
|
340
|
+
(column.field ?? column.id) === field,
|
|
341
|
+
);
|
|
342
|
+
const sqlName = declared?.sqlName ?? sqlSafePlayColumnName(field);
|
|
343
|
+
if (present.has(sqlName) && !leading.includes(sqlName)) leading.push(sqlName);
|
|
344
|
+
}
|
|
345
|
+
const lead = new Set(leading);
|
|
346
|
+
return [...leading, ...written.filter((name) => !lead.has(name))];
|
|
347
|
+
}
|
|
@@ -9719,6 +9719,10 @@ export class PlayContextImpl implements ScalarPlayAuthoringRuntimeContext {
|
|
|
9719
9719
|
'ctx.dataset.run.undrawnColumns',
|
|
9720
9720
|
options.undrawnColumns,
|
|
9721
9721
|
);
|
|
9722
|
+
validateOptionalPlayAuthoringField(
|
|
9723
|
+
'ctx.dataset.run.columnOrder',
|
|
9724
|
+
options.columnOrder,
|
|
9725
|
+
);
|
|
9722
9726
|
if (options.key !== undefined) {
|
|
9723
9727
|
validatePlayAuthoringField('ctx.dataset.run.key', options.key);
|
|
9724
9728
|
}
|
|
@@ -461,6 +461,13 @@ export interface RuntimeDatasetOptions<TItem = Record<string, unknown>> {
|
|
|
461
461
|
* execution behavior.
|
|
462
462
|
*/
|
|
463
463
|
undrawnColumns?: readonly string[];
|
|
464
|
+
/**
|
|
465
|
+
* Columns the run page shows first, in this order. Every other column keeps
|
|
466
|
+
* the order the run wrote it in (row keys, then each `withColumn`), and a
|
|
467
|
+
* cascade's attempt columns stay right after the cascade. Display only:
|
|
468
|
+
* read from literals at compile time, it changes no execution or stored value.
|
|
469
|
+
*/
|
|
470
|
+
columnOrder?: readonly string[];
|
|
464
471
|
}
|
|
465
472
|
|
|
466
473
|
export type RuntimeDatasetDefinitionOptions<TItem = Record<string, unknown>> =
|
|
@@ -474,6 +481,7 @@ export type RuntimeDatasetRunOptions<TItem = Record<string, unknown>> = Pick<
|
|
|
474
481
|
| 'onRowError'
|
|
475
482
|
| 'mode'
|
|
476
483
|
| 'undrawnColumns'
|
|
484
|
+
| 'columnOrder'
|
|
477
485
|
>;
|
|
478
486
|
|
|
479
487
|
/** Runtime-only receipt recovery bit; never part of the customer authoring API. */
|
|
@@ -44,6 +44,13 @@ export type FleetSandboxSweepAdapter = Readonly<{
|
|
|
44
44
|
scope: FleetSandboxSweepScope;
|
|
45
45
|
/** Minimum spacing between pass starts. */
|
|
46
46
|
intervalMs: number;
|
|
47
|
+
/**
|
|
48
|
+
* Loop-driven owners only: spread passes across a fleet that boots
|
|
49
|
+
* together. Each interval is scaled by a random factor in
|
|
50
|
+
* [1 - jitterRatio, 1 + jitterRatio], and the first pass waits a random
|
|
51
|
+
* [0, 2 * jitterRatio * intervalMs]. In [0, 0.5]; absent: no jitter.
|
|
52
|
+
*/
|
|
53
|
+
jitterRatio?: number;
|
|
47
54
|
/**
|
|
48
55
|
* One pass: enumerate, apply the provider's age, ownership and dry-run
|
|
49
56
|
* policy, and terminate or restore cleanup for each dead sandbox. A
|
|
@@ -81,6 +88,18 @@ export function assertFleetSandboxSweepAdapters(
|
|
|
81
88
|
`Fleet sandbox sweep for ${adapter.provider} needs a positive integer interval.`,
|
|
82
89
|
);
|
|
83
90
|
}
|
|
91
|
+
if (
|
|
92
|
+
adapter.jitterRatio !== undefined &&
|
|
93
|
+
!(
|
|
94
|
+
Number.isFinite(adapter.jitterRatio) &&
|
|
95
|
+
adapter.jitterRatio >= 0 &&
|
|
96
|
+
adapter.jitterRatio <= 0.5
|
|
97
|
+
)
|
|
98
|
+
) {
|
|
99
|
+
throw new FleetSandboxSweepAdapterError(
|
|
100
|
+
`Fleet sandbox sweep for ${adapter.provider} needs a jitter ratio in [0, 0.5].`,
|
|
101
|
+
);
|
|
102
|
+
}
|
|
84
103
|
if (adapter.scope === 'provider_inventory') {
|
|
85
104
|
const support = runtimeSandboxProviderProfile(adapter.provider)
|
|
86
105
|
.capabilities.orphanEnumeration;
|
|
@@ -116,17 +135,26 @@ export function createFleetSandboxSweep(input: {
|
|
|
116
135
|
adapters: readonly FleetSandboxSweepAdapter[];
|
|
117
136
|
/** Injected clock; read on every call so fake timers apply. */
|
|
118
137
|
now?: () => number;
|
|
138
|
+
/** Injected uniform [0, 1) source for `jitterRatio`. */
|
|
139
|
+
random?: () => number;
|
|
119
140
|
}): FleetSandboxSweep {
|
|
120
141
|
assertFleetSandboxSweepAdapters(input.adapters);
|
|
121
142
|
const now = input.now ?? (() => Date.now());
|
|
143
|
+
const random = input.random ?? Math.random;
|
|
144
|
+
const createdAtMs = now();
|
|
122
145
|
const states: PassState[] = input.adapters.map((adapter) => ({
|
|
123
146
|
adapter,
|
|
124
147
|
running: null,
|
|
125
|
-
nextDueAtMs:
|
|
148
|
+
nextDueAtMs: adapter.jitterRatio
|
|
149
|
+
? createdAtMs + 2 * adapter.jitterRatio * random() * adapter.intervalMs
|
|
150
|
+
: 0,
|
|
126
151
|
}));
|
|
127
152
|
|
|
128
153
|
const start = (state: PassState, startedAtMs: number): void => {
|
|
129
|
-
|
|
154
|
+
const jitter = state.adapter.jitterRatio ?? 0;
|
|
155
|
+
state.nextDueAtMs =
|
|
156
|
+
startedAtMs +
|
|
157
|
+
state.adapter.intervalMs * (1 + jitter * (2 * random() - 1));
|
|
130
158
|
// The async wrapper turns a synchronous throw into a rejection, so it is
|
|
131
159
|
// reported like any other failed pass and never reaches the next Adapter.
|
|
132
160
|
const pass: Promise<void> = (async () => {
|
|
@@ -184,11 +212,20 @@ export function createFleetSandboxSweep(input: {
|
|
|
184
212
|
/**
|
|
185
213
|
* Timer-driven owner: run every Adapter's pass once now, then once per its
|
|
186
214
|
* interval, skipping (and reporting) a tick whose previous pass still runs.
|
|
187
|
-
* Timers are unref'd so the sweep never keeps a process alive.
|
|
215
|
+
* Timers are unref'd so the sweep never keeps a process alive. `jitterRatio`
|
|
216
|
+
* is loop-driven only: fixed timers would silently ignore it, so an Adapter
|
|
217
|
+
* that sets it is refused before any timer starts.
|
|
188
218
|
*/
|
|
189
219
|
export function startFleetSandboxSweepTimers(input: {
|
|
190
220
|
adapters: readonly FleetSandboxSweepAdapter[];
|
|
191
221
|
}): { stop: () => void; sweep: FleetSandboxSweep } {
|
|
222
|
+
for (const adapter of input.adapters) {
|
|
223
|
+
if (adapter.jitterRatio !== undefined) {
|
|
224
|
+
throw new FleetSandboxSweepAdapterError(
|
|
225
|
+
`Fleet sandbox sweep for ${adapter.provider} sets jitterRatio, which timer-driven owners do not support.`,
|
|
226
|
+
);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
192
229
|
const sweep = createFleetSandboxSweep({ adapters: input.adapters });
|
|
193
230
|
const intervals = input.adapters.map((adapter) => {
|
|
194
231
|
const interval = setInterval(() => {
|
|
@@ -19,6 +19,14 @@ export {
|
|
|
19
19
|
modalSandboxResourcesForPlay,
|
|
20
20
|
} from './worker-api-types';
|
|
21
21
|
export const MODAL_SANDBOX_MEMORY_MIB = 1024;
|
|
22
|
+
/**
|
|
23
|
+
* The Modal region every Play sandbox is created in: us-east (Virginia), next
|
|
24
|
+
* to the Fly iad receipt gateway, execution relay and workers it talks to.
|
|
25
|
+
* Unpinned, Modal places a sandbox anywhere: about 36% of Production Modal
|
|
26
|
+
* runs landed overseas (Europe, Israel), each sandbox-to-relay round trip
|
|
27
|
+
* 94-117 ms instead of 14-27 ms. A narrow region costs 1.75x Modal's base price.
|
|
28
|
+
*/
|
|
29
|
+
export const MODAL_SANDBOX_REGIONS: readonly string[] = ['us-east'];
|
|
22
30
|
|
|
23
31
|
export function isModalPreviewEvaluation(input: {
|
|
24
32
|
runtimeSchedulerSchema: string | null | undefined;
|
|
@@ -92,6 +100,16 @@ function cidrAllowlist(raw: string | null | undefined): string[] | null {
|
|
|
92
100
|
return values.length > 0 ? values : null;
|
|
93
101
|
}
|
|
94
102
|
|
|
103
|
+
/** Production refuses a Modal sandbox without an outbound allowlist. */
|
|
104
|
+
export class ModalSandboxAllowlistRequiredError extends Error {
|
|
105
|
+
constructor() {
|
|
106
|
+
super(
|
|
107
|
+
'DEEPLINE_DAYTONA_NETWORK_ALLOW_LIST is required for the Modal capacity fallback in production. Refusing to run customer code with unrestricted outbound network access.',
|
|
108
|
+
);
|
|
109
|
+
this.name = 'ModalSandboxAllowlistRequiredError';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
|
|
95
113
|
export function resolveModalSandboxNetworkPolicy(input: {
|
|
96
114
|
runtimeSchedulerSchema: string | null | undefined;
|
|
97
115
|
env?: NodeJS.ProcessEnv;
|
|
@@ -105,9 +123,7 @@ export function resolveModalSandboxNetworkPolicy(input: {
|
|
|
105
123
|
env.NODE_ENV === 'production' &&
|
|
106
124
|
!isIsolatedRuntimeSchedulerSchema(input.runtimeSchedulerSchema)
|
|
107
125
|
) {
|
|
108
|
-
throw new
|
|
109
|
-
'DEEPLINE_DAYTONA_NETWORK_ALLOW_LIST is required for the Modal capacity fallback in production. Refusing to run customer code with unrestricted outbound network access.',
|
|
110
|
-
);
|
|
126
|
+
throw new ModalSandboxAllowlistRequiredError();
|
|
111
127
|
}
|
|
112
128
|
return { outboundCidrAllowlist };
|
|
113
129
|
}
|
|
@@ -71,6 +71,7 @@ import {
|
|
|
71
71
|
} from '../tool-http-errors';
|
|
72
72
|
import {
|
|
73
73
|
augmentSheetContractWithDatasetFields,
|
|
74
|
+
datasetDisplayColumnOrder,
|
|
74
75
|
datasetWrittenColumnOrder,
|
|
75
76
|
} from '../../play-data-plane/sheet-contract';
|
|
76
77
|
import { nextWorkCounterInvocationSeq } from '../runtime-work-counters';
|
|
@@ -2506,10 +2507,21 @@ async function run(
|
|
|
2506
2507
|
persistedRows: number;
|
|
2507
2508
|
succeededRows: number;
|
|
2508
2509
|
failedRows: number;
|
|
2509
|
-
/** Stored column names in the order this run wrote them. */
|
|
2510
|
+
/** Stored column names in the order this run wrote them. Append-only. */
|
|
2510
2511
|
columns?: string[];
|
|
2512
|
+
/** The dataset's sheet contract; its `columnOrder` leads the emitted order. */
|
|
2513
|
+
sheetContract?: PlaySheetContract;
|
|
2511
2514
|
}
|
|
2512
2515
|
>();
|
|
2516
|
+
// The order events carry: authored `columnOrder` first, then written order.
|
|
2517
|
+
// A permutation of the written set, so the ledger's longest list stays whole.
|
|
2518
|
+
const emittedDatasetColumns = (settlement: {
|
|
2519
|
+
columns?: string[];
|
|
2520
|
+
sheetContract?: PlaySheetContract;
|
|
2521
|
+
}): string[] =>
|
|
2522
|
+
settlement.sheetContract
|
|
2523
|
+
? datasetDisplayColumnOrder(settlement.columns ?? [], settlement.sheetContract)
|
|
2524
|
+
: [...(settlement.columns ?? [])];
|
|
2513
2525
|
const runtimeSheetAttemptKey = (input: {
|
|
2514
2526
|
playName: string;
|
|
2515
2527
|
runId: string;
|
|
@@ -2845,7 +2857,7 @@ async function run(
|
|
|
2845
2857
|
failedRows: settlement.failedRows,
|
|
2846
2858
|
complete: false,
|
|
2847
2859
|
...(settlement.columns?.length
|
|
2848
|
-
? { columns: settlement
|
|
2860
|
+
? { columns: emittedDatasetColumns(settlement) }
|
|
2849
2861
|
: {}),
|
|
2850
2862
|
at: event.at,
|
|
2851
2863
|
},
|
|
@@ -3069,6 +3081,7 @@ async function run(
|
|
|
3069
3081
|
rows: items,
|
|
3070
3082
|
existing: settlement.columns,
|
|
3071
3083
|
});
|
|
3084
|
+
settlement.sheetContract = sheetContract;
|
|
3072
3085
|
runtimeMapDatasetSettlements.set(datasetId, settlement);
|
|
3073
3086
|
emitRunnerEvent(
|
|
3074
3087
|
{
|
|
@@ -3084,7 +3097,7 @@ async function run(
|
|
|
3084
3097
|
failedRows: 0,
|
|
3085
3098
|
complete: false,
|
|
3086
3099
|
...(settlement.columns.length > 0
|
|
3087
|
-
? { columns: settlement
|
|
3100
|
+
? { columns: emittedDatasetColumns(settlement) }
|
|
3088
3101
|
: {}),
|
|
3089
3102
|
// ADR 0019 dataset-grain row birth. These rows entered from
|
|
3090
3103
|
// play-body code, so the only witnessed fact is how many arrived at
|
|
@@ -3463,6 +3476,7 @@ async function run(
|
|
|
3463
3476
|
outputFields: input.outputFields,
|
|
3464
3477
|
existing: settlement.columns,
|
|
3465
3478
|
});
|
|
3479
|
+
settlement.sheetContract = sheetContract;
|
|
3466
3480
|
runtimeMapDatasetSettlements.set(datasetId, settlement);
|
|
3467
3481
|
emitWorkerLog(
|
|
3468
3482
|
`[perf] runtime map persist table=${input.tableNamespace} rows=${input.rows.length} updated=${result.updated} accepted=${committedTerminalRows} stale=${staleKeys.size} elapsed_ms=${Date.now() - persistStartedAt}`,
|
|
@@ -3747,7 +3761,7 @@ async function run(
|
|
|
3747
3761
|
failedRows: settlement.failedRows,
|
|
3748
3762
|
complete: true,
|
|
3749
3763
|
...(settlement.columns?.length
|
|
3750
|
-
? { columns: settlement
|
|
3764
|
+
? { columns: emittedDatasetColumns(settlement) }
|
|
3751
3765
|
: {}),
|
|
3752
3766
|
at: Date.now(),
|
|
3753
3767
|
},
|