deepline 0.3.484 → 0.3.486
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-core.ts +91 -30
- package/dist/bundling-sources/sdk/src/compat.ts +13 -0
- package/dist/bundling-sources/sdk/src/plays/client-core.ts +4 -1
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +143 -9
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +31 -4
- package/dist/bundling-sources/sdk/src/tool-calls.ts +1 -1
- package/dist/bundling-sources/sdk/src/types.ts +7 -1
- package/dist/bundling-sources/shared_libs/play-data-plane/sheet-column-storage.ts +32 -3
- package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +126 -41
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +231 -25
- package/dist/bundling-sources/shared_libs/play-runtime/daytona-runtime-config.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-machines.ts +130 -19
- package/dist/bundling-sources/shared_libs/play-runtime/deployment/fly-registry.ts +105 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execute-server-timing.ts +4 -2
- package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +194 -56
- package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +8 -4
- package/dist/bundling-sources/shared_libs/play-runtime/log-provenance.ts +11 -6
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/job.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/ports.ts +2 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-runs/sandbox-cleanup/postgres-adapter.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +30 -0
- package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +195 -2
- package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +20 -1
- package/dist/bundling-sources/shared_libs/play-runtime/run-ledger-projection-contract.ts +15 -0
- package/dist/bundling-sources/shared_libs/play-runtime/run-snapshot-stream.ts +2 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +139 -67
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/progress-sidecar.ts +9 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-control-transport.ts +25 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +133 -82
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +58 -16
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-sandbox-absence.ts +171 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +69 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +100 -40
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/types.ts +8 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +67 -9
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-incident-drills.ts +5 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-receipt-store-adapter.ts +6 -3
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-errors.ts +14 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-sheet-row-writer.ts +87 -31
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/contract.ts +18 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/index.ts +19 -0
- package/dist/bundling-sources/shared_libs/play-runtime/sandbox-runs/runner-backend-adapter.ts +14 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +206 -7
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd.ts +39 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/play-run-recovery.ts +12 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +28 -9
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-scope.ts +44 -15
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +60 -11
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +656 -64
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +6 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +17 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +25 -33
- package/dist/bundling-sources/shared_libs/play-runtime/suspension.ts +12 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +21 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +1 -1
- package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +1 -1
- package/dist/cli/auth-ARKH3OAU.js +43 -0
- package/dist/cli/{auth-EBFOTF7X.mjs → auth-B4DJO4FB.mjs} +5 -5
- package/dist/cli/{billing-G2G3EF3I.js → billing-GDWAMARK.js} +80 -80
- package/dist/cli/{billing-2ZOIMW5V.mjs → billing-IIQ3VNXU.mjs} +7 -7
- package/dist/cli/{chunk-YWC5AN26.mjs → chunk-2DVFQYPG.mjs} +62 -34
- package/dist/cli/{chunk-UWOY74RU.js → chunk-5DUP4ZUE.js} +21 -21
- package/dist/cli/{chunk-EACX7QXO.mjs → chunk-5QYZ4MEW.mjs} +2 -2
- package/dist/cli/{chunk-HEI3BWIV.mjs → chunk-5RLVCOKH.mjs} +1 -1
- package/dist/cli/{chunk-TIRSKEZH.mjs → chunk-5Y7LLRWO.mjs} +1 -1
- package/dist/cli/{chunk-IXWQOVNW.js → chunk-5YILTBF7.js} +87 -76
- package/dist/cli/{chunk-OHKKDPA5.js → chunk-7FTQKEZ6.js} +13 -13
- package/dist/cli/{chunk-TN2GW57M.mjs → chunk-A456YVDE.mjs} +1 -1
- package/dist/cli/{chunk-GVAENVIG.js → chunk-AUQQVDAB.js} +110 -21
- package/dist/cli/{chunk-3XQIVEAT.js → chunk-BJL7RYQN.js} +3 -3
- package/dist/cli/{chunk-2AWYJXBX.js → chunk-BNB2RK4L.js} +5 -5
- package/dist/cli/{chunk-U7IJAGWB.js → chunk-BYEDI5PM.js} +7 -7
- package/dist/cli/{chunk-RLLEH2SP.js → chunk-C4GFBB52.js} +26 -26
- package/dist/cli/{chunk-AK7UKQ5R.js → chunk-CSBMKHTV.js} +5 -5
- package/dist/cli/{chunk-UT4YMA2N.js → chunk-DFHS5XVZ.js} +5 -4
- package/dist/cli/{chunk-XZXIWPT3.mjs → chunk-F3G2HAUQ.mjs} +1 -1
- package/dist/cli/{chunk-C62NI2X6.js → chunk-FCAKAW6S.js} +5 -5
- package/dist/cli/{chunk-AF7MOUZP.mjs → chunk-FGPJXQEJ.mjs} +2 -2
- package/dist/cli/chunk-FSCOYTRV.js +42 -0
- package/dist/cli/{chunk-6GRZEYSG.js → chunk-GCEUOHJW.js} +7 -7
- package/dist/cli/{chunk-SD7QWZTV.mjs → chunk-INW22YP7.mjs} +1 -1
- package/dist/cli/{chunk-OWUZKXE7.mjs → chunk-J7EENGKJ.mjs} +1 -1
- package/dist/cli/{chunk-QIDDTIVZ.js → chunk-KPIVQFXZ.js} +322 -294
- package/dist/cli/{chunk-4IOY2SCQ.js → chunk-LOX3BISD.js} +4 -4
- package/dist/cli/{chunk-WYUCDLVR.mjs → chunk-MJ56FCYU.mjs} +2 -1
- package/dist/cli/{chunk-DBJ62RAO.js → chunk-NSPMJLYA.js} +3 -3
- package/dist/cli/{chunk-HNRELVCS.mjs → chunk-ONONSV2Q.mjs} +96 -7
- package/dist/cli/{chunk-PU52JXKA.mjs → chunk-P6KGYOCM.mjs} +13 -4
- package/dist/cli/{chunk-VEVGM6B5.js → chunk-PCYZDTDC.js} +14 -14
- package/dist/cli/{chunk-NW4QJE54.js → chunk-PHWFY26F.js} +2 -2
- package/dist/cli/{chunk-LTZXLYKE.mjs → chunk-PKOFEHZL.mjs} +93 -17
- package/dist/cli/{chunk-7K5CWKKZ.mjs → chunk-PQHDZHZG.mjs} +2 -2
- package/dist/cli/{chunk-UKM74PAA.js → chunk-PTM3QRAT.js} +37 -37
- package/dist/cli/{chunk-YGN77QA5.mjs → chunk-PV7AYBKQ.mjs} +3 -3
- package/dist/cli/{chunk-4OEOM6GP.mjs → chunk-PYDHVRAF.mjs} +5 -5
- package/dist/cli/{chunk-FRD5WFT4.js → chunk-QD22TY33.js} +323 -247
- package/dist/cli/{chunk-5KNRQWHE.js → chunk-QEQ3KHVY.js} +3 -3
- package/dist/cli/{chunk-KGOC6HGI.js → chunk-S5EYODEG.js} +53 -53
- package/dist/cli/{chunk-FQK7BULS.js → chunk-S7OILDJH.js} +1 -1
- package/dist/cli/{chunk-TRLDJNVE.mjs → chunk-T3Q6BMVH.mjs} +1 -1
- package/dist/cli/{chunk-5K5CAND4.mjs → chunk-TBE2K5W4.mjs} +4 -4
- package/dist/cli/{chunk-YHA3EV3I.mjs → chunk-TE2QT2MX.mjs} +15 -4
- package/dist/cli/{chunk-ZOKM7DVA.js → chunk-TNHY3ATN.js} +8 -8
- package/dist/cli/{chunk-4OVHIWE7.mjs → chunk-U23L57VU.mjs} +2 -2
- package/dist/cli/{chunk-5GOG5ZGC.mjs → chunk-UEJLWUJ3.mjs} +2 -2
- package/dist/cli/{chunk-6NPWXE32.mjs → chunk-VJLL5XIP.mjs} +1 -1
- package/dist/cli/{chunk-WXRM3UC6.mjs → chunk-WCOJH4W4.mjs} +3 -3
- package/dist/cli/{chunk-4SFC2XUF.mjs → chunk-XAZWUW6I.mjs} +5 -5
- package/dist/cli/{chunk-ZM2YPJQJ.js → chunk-XK5DMLZE.js} +5 -1
- package/dist/cli/{chunk-LJ5747UC.mjs → chunk-XRDXNAAY.mjs} +5 -1
- package/dist/cli/{chunk-V7JCMBLU.mjs → chunk-YIKHNZ6B.mjs} +4 -4
- package/dist/cli/{chunk-M4PG7FGC.js → chunk-YS6JOYYS.js} +2 -2
- package/dist/cli/{chunk-DEXSQGXB.mjs → chunk-ZMRZ3BXG.mjs} +5 -5
- package/dist/cli/{chunk-CYWBAV5H.js → chunk-ZQI26KE4.js} +16 -16
- package/dist/cli/{csv-S3CHUKI6.js → csv-3PSMPZM5.js} +13 -13
- package/dist/cli/{csv-NLWVWD3H.mjs → csv-LFCT3WQ4.mjs} +4 -4
- package/dist/cli/{db-OGRPAEEM.mjs → db-HULKVAMU.mjs} +7 -7
- package/dist/cli/{db-WBSKMMOH.js → db-R7I2PPTV.js} +28 -28
- package/dist/cli/{describe-FAD3Z7LN.mjs → describe-D55V42LH.mjs} +21 -21
- package/dist/cli/describe-H47BLOEP.js +49 -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 +4 -4
- package/dist/cli/describe-core.mjs +3 -3
- package/dist/cli/{executions-LYCL344R.mjs → executions-ICVVOYVG.mjs} +7 -7
- package/dist/cli/{executions-SOAZHCY4.js → executions-O37FN2SK.js} +9 -9
- package/dist/cli/{feedback-AVF6V7SV.mjs → feedback-3K3QPGCQ.mjs} +4 -4
- package/dist/cli/{feedback-OROUPUNJ.js → feedback-MAZQ7C6S.js} +8 -8
- package/dist/cli/{git-J5N5M57H.mjs → git-2MMD5KJS.mjs} +5 -5
- package/dist/cli/git-RQ2XLFYZ.js +25 -0
- package/dist/cli/index.js +142 -139
- package/dist/cli/index.mjs +45 -42
- package/dist/cli/{legacy-noops-QAQMZMEG.js → legacy-noops-2OX2Y3Y2.js} +8 -8
- package/dist/cli/{legacy-noops-ENRRM7BL.mjs → legacy-noops-VLSWJ6VE.mjs} +5 -5
- package/dist/cli/{monitors-CKQ65WRL.mjs → monitors-2NODQQWG.mjs} +8 -8
- package/dist/cli/{monitors-SFMQ5LFR.js → monitors-UCSV5FOR.js} +92 -92
- package/dist/cli/{org-3UNTDLT2.js → org-4YY73VTW.js} +73 -73
- package/dist/cli/{org-K4UIEU5P.mjs → org-W7AUQCDE.mjs} +7 -7
- package/dist/cli/{pages-NKZTGB4C.js → pages-FBZEUMXK.js} +18 -18
- package/dist/cli/{pages-6GPGBIAH.mjs → pages-ZRP7U5PO.mjs} +7 -7
- package/dist/cli/{play-BDEADESI.js → play-LFCTQJXA.js} +858 -632
- package/dist/cli/{play-62BEE7IX.mjs → play-XF2BSGTP.mjs} +372 -146
- package/dist/cli/{providers-SXGP44GH.js → providers-5456JNHP.js} +10 -10
- package/dist/cli/{providers-X3CUWMFP.mjs → providers-SICAPKGI.mjs} +7 -7
- package/dist/cli/{quickstart-XQ4426M4.js → quickstart-2KLLIPIU.js} +6 -6
- package/dist/cli/{quickstart-7LN22BKX.mjs → quickstart-IBVG6GX6.mjs} +4 -4
- package/dist/cli/{run-PBJ4ZJ4W.js → run-DNLDGJRC.js} +41 -41
- package/dist/cli/{run-XXSN3B5A.mjs → run-XPIZIQ7H.mjs} +26 -26
- package/dist/cli/search-2KQA65LH.js +32 -0
- package/dist/cli/{search-M75VMADD.mjs → search-PW22AEAL.mjs} +8 -8
- package/dist/cli/{search-output-F6HCFYEI.js → search-output-H6F6QMRF.js} +22 -16
- package/dist/cli/{search-output-NUQAKWDM.mjs → search-output-JFD53H2N.mjs} +14 -8
- package/dist/cli/{secrets-J2H6V33R.mjs → secrets-542CTZRZ.mjs} +7 -7
- package/dist/cli/{secrets-LRYY4QPE.js → secrets-LCCRRAN7.js} +16 -16
- package/dist/cli/{sessions-YPF62CZE.js → sessions-5FYDQE3N.js} +6 -6
- package/dist/cli/{sessions-IMT336UV.mjs → sessions-CALLS2XD.mjs} +5 -5
- package/dist/cli/{settings-PDWVQIGH.mjs → settings-GSKPHUEC.mjs} +12 -12
- package/dist/cli/{settings-35YYC5WA.js → settings-ORGKOBP6.js} +79 -79
- package/dist/cli/{setup-UR7GOR7H.js → setup-4BUWJKB6.js} +47 -47
- package/dist/cli/{setup-DG5DISSE.mjs → setup-V57GHVAF.mjs} +9 -9
- package/dist/cli/skills-KYZPPGSN.js +33 -0
- package/dist/cli/{skills-U6NJD5J7.mjs → skills-NGLCFQFT.mjs} +7 -7
- package/dist/cli/tools-AFYXUEMD.js +56 -0
- package/dist/cli/{tools-2HGEOELR.mjs → tools-G2YNCFNX.mjs} +19 -19
- package/dist/cli/{update-FRAYBAHK.mjs → update-IZ3Z5T5C.mjs} +9 -9
- package/dist/cli/update-T6JJ7A3K.js +33 -0
- package/dist/cli/{workflow-JKKLOMBX.js → workflow-7AHST2XV.js} +18 -18
- package/dist/cli/{workflow-DDKVTF36.mjs → workflow-L7ROQIM7.mjs} +8 -8
- package/dist/{client-DJ3r8VQJ.d.mts → client-BkbDHRIg.d.mts} +1 -1
- package/dist/{client-JPSNljtj.d.ts → client-D3hVHXjK.d.ts} +1 -1
- package/dist/{client-core-3SJlNsKU.d.mts → client-core-BZoSMKcY.d.mts} +30 -15
- package/dist/{client-core-rCoQ5Xz3.d.ts → client-core-DUdVqO_m.d.ts} +30 -15
- package/dist/{compiler-manifest-gkO9ZkVg.d.mts → compiler-manifest-BFTwq1HI.d.mts} +1 -1
- package/dist/{compiler-manifest-gkO9ZkVg.d.ts → compiler-manifest-BFTwq1HI.d.ts} +1 -1
- package/dist/{errors-Cc92LKH-.d.ts → errors-c3pMsylw.d.ts} +1 -1
- package/dist/{errors-CeCCOKSA.d.mts → errors-w31ybrQM.d.mts} +1 -1
- package/dist/{index-DJQKdV76.d.ts → index-CQ-15-QL.d.ts} +1 -1
- package/dist/{index-DsqWJL3Q.d.mts → index-DvNtxucX.d.mts} +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 +117 -116
- 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 +2 -2
- 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/plays/run-request.js +12 -2
- package/dist/plays/run-request.mjs +11 -1
- 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 +6 -6
- package/dist/server.mjs +4 -4
- package/package.json +1 -1
- package/dist/cli/auth-L5CSV3UO.js +0 -43
- package/dist/cli/chunk-KA2LNIUP.js +0 -33
- package/dist/cli/describe-UIAYCHWW.js +0 -49
- package/dist/cli/git-ATMWC27D.js +0 -25
- package/dist/cli/search-IGHLRLBD.js +0 -32
- package/dist/cli/skills-4U5WC4MJ.js +0 -33
- package/dist/cli/tools-PYJTQVVS.js +0 -56
- package/dist/cli/update-344OTRFM.js +0 -33
|
@@ -1031,6 +1031,8 @@ export async function deliverRunCreatedOutboxEventInline(input: {
|
|
|
1031
1031
|
schedulerOptions?: Pick<PostgresSchedulerOptions, 'schema'>;
|
|
1032
1032
|
tokenAuthority: RunLedgerOutboxTokenAuthority;
|
|
1033
1033
|
appRuntimeFetch?: typeof fetch;
|
|
1034
|
+
/** The receiver origin `appRuntimeFetch` serves in-process, without ingress. */
|
|
1035
|
+
appRuntimeInProcessOrigin?: string | null;
|
|
1034
1036
|
/** The caller owns this attempt through its after-response lifecycle. */
|
|
1035
1037
|
background?: boolean;
|
|
1036
1038
|
deadlineMs?: number;
|
|
@@ -1076,7 +1078,10 @@ export async function deliverRunCreatedOutboxEventInline(input: {
|
|
|
1076
1078
|
leaseSeconds: RUN_CREATED_INLINE_DELIVERY_LEASE_SECONDS,
|
|
1077
1079
|
tokenAuthority: input.tokenAuthority,
|
|
1078
1080
|
...(input.appRuntimeFetch
|
|
1079
|
-
? {
|
|
1081
|
+
? {
|
|
1082
|
+
appRuntimeFetch: input.appRuntimeFetch,
|
|
1083
|
+
appRuntimeInProcessOrigin: input.appRuntimeInProcessOrigin ?? null,
|
|
1084
|
+
}
|
|
1080
1085
|
: {}),
|
|
1081
1086
|
signal: controller.signal,
|
|
1082
1087
|
onAbortedLeaseRelease: (released) => {
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts
CHANGED
|
@@ -158,6 +158,8 @@ export type RuntimeRunLogPage = {
|
|
|
158
158
|
lastStoredSeq: number;
|
|
159
159
|
firstStoredSeq: number | null;
|
|
160
160
|
entries: Array<{ seq: number; line: string }>;
|
|
161
|
+
/** The canonical terminal fact and its ordered log prefix are indexed. */
|
|
162
|
+
terminalProjected?: boolean;
|
|
161
163
|
};
|
|
162
164
|
|
|
163
165
|
function requiredScope(value: string): string {
|
|
@@ -1107,6 +1109,8 @@ export async function getRuntimeRunLogPage(
|
|
|
1107
1109
|
limit: number;
|
|
1108
1110
|
/** Return the newest bounded window for a stream's initial connection. */
|
|
1109
1111
|
tail?: boolean;
|
|
1112
|
+
/** Only canonical-event terminal watchers require this readiness fence. */
|
|
1113
|
+
includeTerminalProjection?: boolean;
|
|
1110
1114
|
},
|
|
1111
1115
|
): Promise<RuntimeRunLogPage> {
|
|
1112
1116
|
const scope = requiredScope(input.runtimeScope);
|
|
@@ -1142,6 +1146,7 @@ export async function getRuntimeRunLogPage(
|
|
|
1142
1146
|
first_stored_seq: string | number | null;
|
|
1143
1147
|
last_stored_seq: string | number | null;
|
|
1144
1148
|
entries: Array<{ seq: string | number; line: string }>;
|
|
1149
|
+
terminal_projected?: boolean;
|
|
1145
1150
|
}>(
|
|
1146
1151
|
// Match the event-then-cursor relation lock order used by migrations and
|
|
1147
1152
|
// log projection. Cursor-first reads can deadlock a schema expansion.
|
|
@@ -1181,6 +1186,15 @@ export async function getRuntimeRunLogPage(
|
|
|
1181
1186
|
retained.last_seq AS last_stored_seq,
|
|
1182
1187
|
coalesce((SELECT jsonb_agg(jsonb_build_object('seq', seq, 'line', line)
|
|
1183
1188
|
ORDER BY seq) FROM page), '[]'::jsonb) AS entries
|
|
1189
|
+
${
|
|
1190
|
+
input.includeTerminalProjection
|
|
1191
|
+
? `, EXISTS (
|
|
1192
|
+
SELECT 1 FROM runtime_observability.events
|
|
1193
|
+
WHERE runtime_scope = $1 AND org_id = $2 AND run_id = $3
|
|
1194
|
+
AND kind IN (${RUN_EVENT_KIND_SQL_LITERAL.runCompleted}, ${RUN_EVENT_KIND_SQL_LITERAL.runFailed}, ${RUN_EVENT_KIND_SQL_LITERAL.runCancelled})
|
|
1195
|
+
) AS terminal_projected`
|
|
1196
|
+
: ''
|
|
1197
|
+
}
|
|
1184
1198
|
FROM retained`,
|
|
1185
1199
|
pageParams,
|
|
1186
1200
|
);
|
|
@@ -1220,6 +1234,9 @@ export async function getRuntimeRunLogPage(
|
|
|
1220
1234
|
lastStoredSeq,
|
|
1221
1235
|
firstStoredSeq,
|
|
1222
1236
|
entries,
|
|
1237
|
+
...(input.includeTerminalProjection
|
|
1238
|
+
? { terminalProjected: row?.terminal_projected === true }
|
|
1239
|
+
: {}),
|
|
1223
1240
|
};
|
|
1224
1241
|
}
|
|
1225
1242
|
|
|
@@ -75,6 +75,8 @@ function schemaTables(options?: Pick<PostgresSchedulerOptions, 'schema'>) {
|
|
|
75
75
|
return {
|
|
76
76
|
cache: `${schema}."runtime_org_sandbox_limit_cache"`,
|
|
77
77
|
leases: `${schema}."runtime_sandbox_capacity_leases"`,
|
|
78
|
+
capacityLock: `${schema}.runtime_sandbox_capacity_lock`,
|
|
79
|
+
capacityObservation: `${schema}.runtime_sandbox_capacity_observation`,
|
|
78
80
|
operations: `${schema}."runtime_sandbox_operations"`,
|
|
79
81
|
cleanup: `${schema}."sandbox_cleanup_jobs_v2"`,
|
|
80
82
|
runs: `${schema}."runs"`,
|
|
@@ -153,20 +155,23 @@ export async function syncRuntimeOrgSandboxLimitCache(
|
|
|
153
155
|
'expiresAt must be a positive epoch milliseconds value or null.',
|
|
154
156
|
);
|
|
155
157
|
}
|
|
156
|
-
const { cache } = schemaTables(options);
|
|
158
|
+
const { cache, capacityLock } = schemaTables(options);
|
|
157
159
|
const result = await client.query<{ synced_at_ms: number }>(
|
|
158
160
|
`
|
|
161
|
+
WITH capacity_lock AS MATERIALIZED (
|
|
162
|
+
SELECT ${capacityLock}($1) AS acquired
|
|
163
|
+
)
|
|
159
164
|
INSERT INTO ${cache} (
|
|
160
165
|
org_id, "limit", expires_at, source_revision, synced_at
|
|
161
166
|
)
|
|
162
|
-
|
|
167
|
+
SELECT
|
|
163
168
|
$1,
|
|
164
169
|
$2,
|
|
165
170
|
CASE WHEN $3::double precision IS NULL THEN NULL
|
|
166
171
|
ELSE to_timestamp($3::double precision / 1000.0) END,
|
|
167
172
|
$4,
|
|
168
173
|
clock_timestamp()
|
|
169
|
-
|
|
174
|
+
FROM capacity_lock
|
|
170
175
|
ON CONFLICT (org_id) DO UPDATE
|
|
171
176
|
SET "limit" = EXCLUDED."limit",
|
|
172
177
|
expires_at = EXCLUDED.expires_at,
|
|
@@ -300,8 +305,15 @@ export async function reserveRuntimeSandboxCapacityLease(
|
|
|
300
305
|
> {
|
|
301
306
|
const orgId = assertId(input.orgId, 'orgId');
|
|
302
307
|
const runId = assertId(input.runId, 'runId');
|
|
303
|
-
const {
|
|
304
|
-
|
|
308
|
+
const {
|
|
309
|
+
cache,
|
|
310
|
+
leases,
|
|
311
|
+
capacityObservation,
|
|
312
|
+
operations,
|
|
313
|
+
runs,
|
|
314
|
+
attempts,
|
|
315
|
+
cleanup,
|
|
316
|
+
} = schemaTables(options);
|
|
305
317
|
const leaseId = input.leaseId?.trim() || randomUUID();
|
|
306
318
|
const unsentProviderOperationToken = unsentReservationInputs.get(input);
|
|
307
319
|
const providerOperationToken =
|
|
@@ -313,11 +325,11 @@ export async function reserveRuntimeSandboxCapacityLease(
|
|
|
313
325
|
input.resumePendingDaytonaOperation === true &&
|
|
314
326
|
input.provider === RuntimeSandboxProvider.Daytona &&
|
|
315
327
|
input.attempt !== undefined;
|
|
316
|
-
//
|
|
317
|
-
//
|
|
318
|
-
//
|
|
319
|
-
//
|
|
320
|
-
//
|
|
328
|
+
// Capacity is a soft per-org limit. Two transaction-scoped observation lanes
|
|
329
|
+
// permit one extra lease in a simultaneous race while keeping larger bursts
|
|
330
|
+
// bounded. Keep observation, lease insertion, and provider-operation intent
|
|
331
|
+
// in one query, then prove the insert or read it back before granting create
|
|
332
|
+
// authority. No reservation lock crosses provider I/O.
|
|
321
333
|
const observed = await client.query<{
|
|
322
334
|
limit: number;
|
|
323
335
|
active_leases: number;
|
|
@@ -348,29 +360,8 @@ export async function reserveRuntimeSandboxCapacityLease(
|
|
|
348
360
|
`
|
|
349
361
|
WITH observed AS MATERIALIZED (
|
|
350
362
|
SELECT
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
SELECT CASE
|
|
354
|
-
WHEN expires_at IS NOT NULL AND expires_at <= clock_timestamp()
|
|
355
|
-
THEN $2::integer
|
|
356
|
-
ELSE "limit"
|
|
357
|
-
END
|
|
358
|
-
FROM ${cache}
|
|
359
|
-
WHERE org_id = $1
|
|
360
|
-
),
|
|
361
|
-
$2::integer
|
|
362
|
-
) AS "limit",
|
|
363
|
-
(
|
|
364
|
-
SELECT count(*)::integer
|
|
365
|
-
FROM ${leases}
|
|
366
|
-
WHERE org_id = $1
|
|
367
|
-
AND released_at IS NULL
|
|
368
|
-
-- A bound lease represents a provider resource that must remain
|
|
369
|
-
-- counted until provider-confirmed deletion. The 50-minute TTL
|
|
370
|
-
-- is only the crash backstop for a create that never became
|
|
371
|
-
-- durable enough to bind to a sandbox id.
|
|
372
|
-
AND (sandbox_id IS NOT NULL OR expires_at > clock_timestamp())
|
|
373
|
-
) AS active_leases,
|
|
363
|
+
capacity.configured_limit AS "limit",
|
|
364
|
+
capacity.active_leases,
|
|
374
365
|
coalesce((
|
|
375
366
|
SELECT jsonb_agg(pending)
|
|
376
367
|
FROM (
|
|
@@ -445,6 +436,7 @@ export async function reserveRuntimeSandboxCapacityLease(
|
|
|
445
436
|
WHERE lease.lease_id = $5
|
|
446
437
|
) AS existing
|
|
447
438
|
) AS existing_operation
|
|
439
|
+
FROM ${capacityObservation}($1, $2::integer) AS capacity
|
|
448
440
|
), active_run AS MATERIALIZED (
|
|
449
441
|
SELECT run.run_id
|
|
450
442
|
FROM ${runs} AS run, observed
|
|
@@ -161,16 +161,28 @@ export class PlayRowExecutionSuspendedError extends Error {
|
|
|
161
161
|
|
|
162
162
|
/** A provider wait is a control handoff, never a failed cell or receipt. */
|
|
163
163
|
export class PlayRowProviderBackpressureError extends Error {
|
|
164
|
+
readonly #localRetryAtMs: number | undefined;
|
|
165
|
+
|
|
164
166
|
constructor(
|
|
165
167
|
readonly provider: string,
|
|
166
168
|
readonly retryAtMs: number,
|
|
167
169
|
/** Live handoff only: the mapped row must not renew this tool's wait budget. */
|
|
168
170
|
readonly residentWaitBudgetExhausted = false,
|
|
171
|
+
localRetryAtMs?: number,
|
|
169
172
|
) {
|
|
170
173
|
super(
|
|
171
174
|
`Play row is waiting for ${provider} provider backpressure to clear.`,
|
|
172
175
|
);
|
|
173
176
|
this.name = 'PlayRowProviderBackpressureError';
|
|
177
|
+
this.#localRetryAtMs =
|
|
178
|
+
Number.isSafeInteger(localRetryAtMs) && Number(localRetryAtMs) >= 0
|
|
179
|
+
? localRetryAtMs
|
|
180
|
+
: undefined;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
/** Live clock evidence only; the provider's canonical deadline stays unchanged. */
|
|
184
|
+
get localRetryAtMs(): number | undefined {
|
|
185
|
+
return this.#localRetryAtMs;
|
|
174
186
|
}
|
|
175
187
|
}
|
|
176
188
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
1
2
|
import { getRuntimeEnv } from './runtime-env';
|
|
2
3
|
import type { PlayRunnerEvent } from './protocol';
|
|
3
4
|
import {
|
|
@@ -5,6 +6,26 @@ import {
|
|
|
5
6
|
type RuntimeTestFaultName,
|
|
6
7
|
} from './runtime-incident-drills';
|
|
7
8
|
|
|
9
|
+
/** Complete rate-acquire traces belong only to the existing scoped synthetic fixture. */
|
|
10
|
+
export function isRuntimeRateStateDiagnosticBucket(bucketId: string): boolean {
|
|
11
|
+
return /^rate:fleet_managed:test_unhinted:[a-f0-9]{64}$/.test(bucketId);
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function isRuntimeRateStateDiagnosticScope(
|
|
15
|
+
playName: string | null | undefined,
|
|
16
|
+
bucketId: string,
|
|
17
|
+
): boolean {
|
|
18
|
+
return (
|
|
19
|
+
/^unhinted_adaptive_[a-f0-9]{12}$/.test(playName ?? '') &&
|
|
20
|
+
isRuntimeRateStateDiagnosticBucket(bucketId)
|
|
21
|
+
);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** Hash the entire quota identity; never log its raw credential/customer components. */
|
|
25
|
+
export function runtimeRateStateBucketDigest(bucketId: string): string {
|
|
26
|
+
return createHash('sha256').update(bucketId).digest('hex');
|
|
27
|
+
}
|
|
28
|
+
|
|
8
29
|
export const PLAY_RUNTIME_TEST_FAULT_HEADER = 'x-deepline-test-fault';
|
|
9
30
|
|
|
10
31
|
export type RuntimeTestFaultRegistry = {
|
|
@@ -1819,7 +1819,7 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
|
|
|
1819
1819
|
resolution: 'static-required',
|
|
1820
1820
|
issueCode: 'play_authoring_binding_invalid',
|
|
1821
1821
|
description:
|
|
1822
|
-
'
|
|
1822
|
+
'Declares the current explicit-freshness contract. Unmarked new source also uses the current edition. Already-pinned artifacts retain their admitted behavior.',
|
|
1823
1823
|
errorMessage:
|
|
1824
1824
|
'compatibility.authoringContract must be the static literal "explicit-freshness".',
|
|
1825
1825
|
},
|
|
@@ -391,7 +391,7 @@ export function resolvePlaySourceAuthoringContractEdition(
|
|
|
391
391
|
throw new PlayAuthoringFieldValidationError(
|
|
392
392
|
'compatibility.authoringContract',
|
|
393
393
|
'play_authoring_binding_invalid',
|
|
394
|
-
'compatibility.authoringContract must be statically resolvable;
|
|
394
|
+
'compatibility.authoringContract must be statically resolvable; use the literal "explicit-freshness" or omit the field to use the source default or artifact pin.',
|
|
395
395
|
);
|
|
396
396
|
}
|
|
397
397
|
if (marker.kind === 'absent')
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
var _chunkS5EYODEGjs = require('./chunk-S5EYODEG.js');
|
|
18
|
+
require('./chunk-BYEDI5PM.js');
|
|
19
|
+
require('./chunk-BJL7RYQN.js');
|
|
20
|
+
require('./chunk-DFHS5XVZ.js');
|
|
21
|
+
require('./chunk-ALJJRZNJ.js');
|
|
22
|
+
require('./chunk-XNYIZMNQ.js');
|
|
23
|
+
require('./chunk-DIAWYWT5.js');
|
|
24
|
+
require('./chunk-S7OILDJH.js');
|
|
25
|
+
require('./chunk-OG64RBAC.js');
|
|
26
|
+
require('./chunk-COGTRVWW.js');
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
exports.EXIT_WORKSPACE_MISMATCH = _chunkS5EYODEGjs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkS5EYODEGjs.authStatusLine; exports.clearPendingClaim = _chunkS5EYODEGjs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkS5EYODEGjs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkS5EYODEGjs.handleRegister; exports.handleStatus = _chunkS5EYODEGjs.handleStatus; exports.handleWait = _chunkS5EYODEGjs.handleWait; exports.httpJson = _chunkS5EYODEGjs.httpJson; exports.readPendingAuthClaim = _chunkS5EYODEGjs.readPendingAuthClaim; exports.readStatusBanner = _chunkS5EYODEGjs.readStatusBanner; exports.registerAuthCommands = _chunkS5EYODEGjs.registerAuthCommands; exports.reportApprovalLinkShown = _chunkS5EYODEGjs.reportApprovalLinkShown; exports.reportSetupCompleted = _chunkS5EYODEGjs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkS5EYODEGjs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkS5EYODEGjs.statusBannerLine;
|
|
@@ -14,14 +14,14 @@ import {
|
|
|
14
14
|
reportSetupCompleted,
|
|
15
15
|
resolvePendingAuthClaimForResume,
|
|
16
16
|
statusBannerLine
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-WCOJH4W4.mjs";
|
|
18
|
+
import "./chunk-PQHDZHZG.mjs";
|
|
19
|
+
import "./chunk-T3Q6BMVH.mjs";
|
|
20
|
+
import "./chunk-MJ56FCYU.mjs";
|
|
21
21
|
import "./chunk-4QF2K7TM.mjs";
|
|
22
22
|
import "./chunk-DLIRSHV6.mjs";
|
|
23
23
|
import "./chunk-HBL4PM5Q.mjs";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-5RLVCOKH.mjs";
|
|
25
25
|
import "./chunk-WZYKRD7T.mjs";
|
|
26
26
|
import "./chunk-KRD6H754.mjs";
|
|
27
27
|
export {
|