deepline 0.3.520 → 0.3.521
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/plays/client-core.ts +16 -45
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +0 -18
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +0 -155
- package/dist/bundling-sources/shared_libs/play-runtime/fixture-behavior.ts +24 -0
- package/dist/bundling-sources/shared_libs/play-runtime/internal-bootstrap-token.ts +1 -54
- package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +2 -7
- package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +0 -13
- package/dist/bundling-sources/shared_libs/play-runtime/run-identity.ts +0 -56
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +10 -21
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-progress-push.ts +2 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-lifecycle.ts +2 -37
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +3 -74
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-runtime-watchdog.ts +2 -226
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +3 -36
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api-paths.ts +0 -26
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +1 -9
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-authority.ts +0 -5
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-environment.ts +9 -49
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-gateway-oidc.ts +11 -447
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +5 -4
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +12 -207
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +3 -17
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/gateway-progress-registry.ts +0 -9
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-progress.ts +2 -18
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +15 -175
- package/dist/bundling-sources/shared_libs/play-runtime/workflow-executor-auth.ts +0 -4
- package/dist/cli/{artifacts-4DSPSIU5.js → artifacts-JGH464N2.js} +20 -20
- package/dist/cli/{artifacts-D6PU7SBC.mjs → artifacts-TYPU37IU.mjs} +8 -8
- package/dist/cli/auth-JWR3VSNT.js +43 -0
- package/dist/cli/{auth-MXKNPUXW.mjs → auth-XPQT6NUB.mjs} +5 -5
- package/dist/cli/{billing-SQ26NKGH.mjs → billing-47AMHOMP.mjs} +8 -8
- package/dist/cli/{billing-WEYCNJIR.js → billing-6D4KXBFJ.js} +81 -81
- package/dist/cli/{chunk-TQTQ3YYA.mjs → chunk-2DQPB5HT.mjs} +5 -5
- package/dist/cli/{chunk-6Y3DDRRN.js → chunk-2KHUFWTK.js} +3 -3
- package/dist/cli/{chunk-2BJILUE3.js → chunk-3Q7HEEH2.js} +10 -10
- package/dist/cli/{chunk-NWSKBWQM.mjs → chunk-4DB6JV7X.mjs} +2 -2
- package/dist/cli/{chunk-M6YHS5V7.mjs → chunk-4GGXAYKI.mjs} +3 -3
- package/dist/cli/{chunk-V6BUWQBI.mjs → chunk-4I7I5CGB.mjs} +1 -1
- package/dist/cli/{chunk-ORAWUIMN.js → chunk-4MN65FRF.js} +53 -53
- package/dist/cli/{chunk-U5646OVV.mjs → chunk-4MONKWYE.mjs} +5 -5
- package/dist/cli/{chunk-KKSMHTQO.mjs → chunk-5T7QKHQL.mjs} +1 -1
- package/dist/cli/{chunk-XXDY7K7F.js → chunk-6DCBTJZP.js} +3 -3
- package/dist/cli/{chunk-LUIPBI6P.js → chunk-6N72GHAV.js} +2 -2
- package/dist/cli/{chunk-ASGGZ6BI.mjs → chunk-6UHYXNCP.mjs} +2 -2
- package/dist/cli/{chunk-YVQLXMJU.mjs → chunk-6V2RI3AL.mjs} +3 -3
- package/dist/cli/{chunk-6GI7BYSL.mjs → chunk-7AUXX6M5.mjs} +1 -1
- package/dist/cli/{chunk-6T2LB43P.mjs → chunk-7IYDCHTG.mjs} +2 -2
- package/dist/cli/{chunk-NNUJQ5O2.mjs → chunk-7LRALARF.mjs} +1 -1
- package/dist/cli/{chunk-5TEXJM6F.mjs → chunk-A2B5AAU3.mjs} +11 -11
- package/dist/cli/{chunk-NLIO6QLP.mjs → chunk-A6USUS4L.mjs} +2 -2
- package/dist/cli/{chunk-3YHS4BLB.js → chunk-AMVKLEPH.js} +2 -2
- package/dist/cli/{chunk-YP3G2CP6.mjs → chunk-CBBCUYIN.mjs} +2 -2
- package/dist/cli/{chunk-QQGRQRCS.mjs → chunk-DQURY3WH.mjs} +1 -1
- package/dist/cli/{chunk-7VJKHJY7.js → chunk-DY6634MN.js} +14 -14
- package/dist/cli/{chunk-XU57CH42.mjs → chunk-E4ZS2B2J.mjs} +1 -1
- package/dist/cli/{chunk-UA4MXESL.js → chunk-EILHJRPW.js} +3 -3
- package/dist/cli/{chunk-AM7HMWNA.js → chunk-EW3EAEWZ.js} +5 -5
- package/dist/cli/{chunk-NPRSGUHB.mjs → chunk-EZNZDOAG.mjs} +5 -5
- package/dist/cli/{chunk-HT675XNR.mjs → chunk-FKD3KL5Q.mjs} +1 -1
- package/dist/cli/{chunk-SHB2BNI6.mjs → chunk-FQJFONFT.mjs} +37 -90
- package/dist/cli/{chunk-FWGTBR3W.js → chunk-FTZX4QZN.js} +2 -2
- package/dist/cli/{chunk-5ECMRQCL.js → chunk-GNYSODBR.js} +1 -1
- package/dist/cli/{chunk-Y5QYWFRI.js → chunk-HD3KYCDC.js} +7 -7
- package/dist/cli/{chunk-6VY2SJ6B.mjs → chunk-HHBJJYKL.mjs} +5 -5
- package/dist/cli/{chunk-DQQ6FDE6.mjs → chunk-HRWVEIAX.mjs} +1 -1
- package/dist/cli/{chunk-BHAP6FIZ.js → chunk-HSFLMTED.js} +4 -4
- package/dist/cli/{chunk-KTAOVRXT.js → chunk-JFQJNYTB.js} +16 -16
- package/dist/cli/{chunk-JO2MQ6XR.js → chunk-LGU2NIOT.js} +98 -98
- package/dist/cli/{chunk-QSWPDYOP.mjs → chunk-LNBMEFOI.mjs} +4 -4
- package/dist/cli/{chunk-GVTHFDKN.js → chunk-MD43YAL6.js} +6 -6
- package/dist/cli/{chunk-AVW2LKRF.js → chunk-MRU4N33M.js} +6 -6
- package/dist/cli/{chunk-2EDGA7OE.mjs → chunk-NNDAVVBG.mjs} +2 -2
- package/dist/cli/{chunk-4VR5OTYP.js → chunk-PUKWFJXW.js} +44 -44
- package/dist/cli/{chunk-VSPNBBRT.js → chunk-QGTWGHYD.js} +66 -119
- package/dist/cli/{chunk-A5VR463F.mjs → chunk-TBIWR7M2.mjs} +1 -1
- package/dist/cli/{chunk-I4GBCKBL.js → chunk-UAZKOH3J.js} +5 -5
- package/dist/cli/{chunk-BMCRTI6Z.mjs → chunk-UBKA33KY.mjs} +1 -22
- package/dist/cli/{chunk-6XJA23MZ.js → chunk-ULW2KBKL.js} +26 -26
- package/dist/cli/{chunk-D5VTWJ7K.js → chunk-VSH3AE5E.js} +16 -16
- package/dist/cli/{chunk-74MOIEDC.js → chunk-VYY5V4M5.js} +11 -11
- package/dist/cli/{chunk-YHHLLONU.js → chunk-WL6WPW6X.js} +14 -14
- package/dist/cli/{chunk-WSGXBROE.js → chunk-XDVT3GOM.js} +1 -22
- package/dist/cli/{chunk-7QAX5VBT.js → chunk-Y23TOHNV.js} +41 -41
- package/dist/cli/{chunk-VSLU4JZV.mjs → chunk-Y7IR4LBU.mjs} +3 -3
- package/dist/cli/{chunk-LYIJ3YUP.js → chunk-YROP3H6T.js} +22 -22
- package/dist/cli/{chunk-KCISDDNK.mjs → chunk-ZO2XJVFH.mjs} +6 -6
- package/dist/cli/{csv-VJNR6FOZ.js → csv-5TM2OSYP.js} +13 -13
- package/dist/cli/{csv-T7HIELZ2.mjs → csv-PM3WDXDF.mjs} +4 -4
- package/dist/cli/{db-JF2I54V7.js → db-3LJ32FZM.js} +29 -29
- package/dist/cli/{db-OE2EXZXL.mjs → db-5P72NPRL.mjs} +8 -8
- package/dist/cli/describe-GRS3IRSX.js +50 -0
- package/dist/cli/{describe-HXZZC3LC.mjs → describe-ZLCMBGHG.mjs} +20 -20
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/{executions-UQ2H6MJZ.js → executions-4AJ5TQVY.js} +10 -10
- package/dist/cli/{executions-4BXRIJFF.mjs → executions-JMFL6AV7.mjs} +8 -8
- package/dist/cli/{feedback-TXF5CQKA.mjs → feedback-DKMG2QB7.mjs} +5 -5
- package/dist/cli/{feedback-MKFN7DYY.js → feedback-I2BLXMGH.js} +10 -10
- package/dist/cli/git-2LNT43A2.js +25 -0
- package/dist/cli/{git-MG3NAV65.mjs → git-ARG223MY.mjs} +5 -5
- package/dist/cli/index.js +141 -141
- package/dist/cli/index.mjs +43 -43
- package/dist/cli/{legacy-noops-XSDY46XD.mjs → legacy-noops-24LOAOZN.mjs} +6 -6
- package/dist/cli/{legacy-noops-R76I2OWW.js → legacy-noops-N7SVA7PL.js} +9 -9
- package/dist/cli/{monitors-NVT5YQKV.mjs → monitors-RYQFWM2T.mjs} +9 -9
- package/dist/cli/{monitors-FS3DIDM7.js → monitors-XNCYLOJM.js} +102 -102
- package/dist/cli/{org-SBI6FC6D.js → org-I33TKZXF.js} +74 -74
- package/dist/cli/{org-XU7JONWS.mjs → org-ORIH56E5.mjs} +8 -8
- package/dist/cli/{pages-2CZFJJV6.js → pages-2UXXGIMF.js} +20 -20
- package/dist/cli/{pages-AFB5DVBR.mjs → pages-ME43HSBL.mjs} +8 -8
- package/dist/cli/{play-WZH72UGC.js → play-F4QOFU37.js} +338 -338
- package/dist/cli/{play-EQEIT5S4.mjs → play-XEKNY46M.mjs} +21 -21
- package/dist/cli/{providers-SHSVUQA3.js → providers-E7DPCBNX.js} +11 -11
- package/dist/cli/{providers-3VXTATHF.mjs → providers-XKU44G74.mjs} +8 -8
- package/dist/cli/{quickstart-KPVPK3VL.js → quickstart-ICLF2F6A.js} +6 -6
- package/dist/cli/{quickstart-45YS4SOD.mjs → quickstart-J7NVEXV5.mjs} +4 -4
- package/dist/cli/{run-U5RWBX5J.js → run-HJMHUQBN.js} +43 -43
- package/dist/cli/{run-XEHRZT57.mjs → run-MQ5ZONGL.mjs} +25 -25
- package/dist/cli/run-identity-G257GQED.js +25 -0
- package/dist/cli/{run-identity-MNRZS2N3.mjs → run-identity-MRNCEGV2.mjs} +3 -9
- package/dist/cli/{search-V7XIWBQ2.mjs → search-GGRC77CV.mjs} +10 -10
- package/dist/cli/search-V6IBJ4TX.js +33 -0
- package/dist/cli/{search-output-ZNIICV5Z.js → search-output-MXZTZI2P.js} +6 -6
- package/dist/cli/{search-output-3KAJUV2A.mjs → search-output-NY4GDBRU.mjs} +4 -4
- package/dist/cli/{secrets-SCSG3QXJ.mjs → secrets-FA37G4Q2.mjs} +8 -8
- package/dist/cli/{secrets-53TUV6JK.js → secrets-PFESG72B.js} +17 -17
- package/dist/cli/{sessions-MCTHLLK3.mjs → sessions-BLLXPETU.mjs} +6 -6
- package/dist/cli/sessions-DNFTQOQH.js +18 -0
- package/dist/cli/{settings-ZNOXOIX2.js → settings-32VPG4Z2.js} +88 -88
- package/dist/cli/{settings-Q2HKACSE.mjs → settings-U26S7MPH.mjs} +15 -15
- package/dist/cli/{setup-WKM35SZJ.mjs → setup-4AXBCX7C.mjs} +10 -10
- package/dist/cli/{setup-GO4EULLY.js → setup-R6NSENH7.js} +50 -50
- package/dist/cli/skills-G4ZE3OS5.js +37 -0
- package/dist/cli/{skills-DZZLW6OV.mjs → skills-JUH7AVUL.mjs} +8 -8
- package/dist/cli/tools-27LHZFJD.js +57 -0
- package/dist/cli/{tools-EKVSK6X4.mjs → tools-FOYLU3FH.mjs} +19 -19
- package/dist/cli/{update-FPHYVHSC.mjs → update-FUVX22VM.mjs} +10 -10
- package/dist/cli/update-KNZ7N242.js +35 -0
- package/dist/cli/{workflow-27H3NCNY.js → workflow-JACZW4GJ.js} +19 -19
- package/dist/cli/{workflow-5YAZK5EI.mjs → workflow-QLT22BLT.mjs} +9 -9
- package/dist/{client-DhEOE19l.d.ts → client-B-2Am2y6.d.ts} +1 -1
- package/dist/{client-lJmz2QwF.d.mts → client-DA71-2_u.d.mts} +1 -1
- package/dist/{client-core-BGiSMrBD.d.mts → client-core-BXbds1cb.d.mts} +0 -19
- package/dist/{client-core-DYCGaRBZ.d.ts → client-core-C0IzDKMJ.d.ts} +0 -19
- package/dist/index.d.mts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +19 -19
- package/dist/index.mjs +8 -8
- package/dist/install-integrity.json +114 -122
- package/dist/plays/play-description.d.mts +1 -1
- package/dist/plays/play-description.d.ts +1 -1
- package/dist/plays/run-request.d.mts +1 -1
- package/dist/plays/run-request.d.ts +1 -1
- package/dist/plays/run-request.js +3 -3
- package/dist/plays/run-request.mjs +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 +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +7 -7
- package/dist/server.mjs +5 -5
- package/package.json +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-app-transport.ts +0 -374
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-gateway-egress.ts +0 -55
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-gateway-profile.ts +0 -329
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-gateway-sandbox-credential.ts +0 -338
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-gateway-staging.ts +0 -417
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-gateway-attempt.ts +0 -81
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-gateway-staging-journal.ts +0 -708
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-gateway-staging-teardown.ts +0 -160
- package/dist/cli/auth-TH4JV6BH.js +0 -43
- package/dist/cli/describe-4FLGKRCA.js +0 -50
- package/dist/cli/git-B2QO3SLK.js +0 -25
- package/dist/cli/run-identity-HFYABUJS.js +0 -31
- package/dist/cli/search-Z2V43OPM.js +0 -33
- package/dist/cli/sessions-BOJCVLR7.js +0 -18
- package/dist/cli/skills-B4BAH2B2.js +0 -37
- package/dist/cli/tools-Z5NCKIAB.js +0 -57
- package/dist/cli/update-XCL7F5T6.js +0 -35
|
@@ -35,7 +35,6 @@ import {
|
|
|
35
35
|
normalizePlayRunRuntimeSelection,
|
|
36
36
|
type PlayRunRuntimeSelection,
|
|
37
37
|
} from '../../../shared_libs/play-runtime/runtime-environment.js';
|
|
38
|
-
import { normalizeRuntimeGatewayProfileId } from '../../../shared_libs/play-runtime/runtime-gateway-profile.js';
|
|
39
38
|
import { decodePlayRunPublicStatus } from '../../../shared_libs/play-runtime/run-lifecycle-policy.js';
|
|
40
39
|
|
|
41
40
|
export function normalizePlayRunIntegrationMode(
|
|
@@ -83,14 +82,17 @@ function resolvePlayRunRuntimeSelection(
|
|
|
83
82
|
const configuredToken = env.DEEPLINE_RUNTIME_ENVIRONMENT_TOKEN?.trim();
|
|
84
83
|
const configuredPlacementPolicy =
|
|
85
84
|
env.DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY?.trim();
|
|
86
|
-
|
|
85
|
+
if (env.DEEPLINE_RUNTIME_GATEWAY_PROFILE?.trim()) {
|
|
86
|
+
// The vercel_app@1 gateway profile was removed. Refuse rather than run on
|
|
87
|
+
// the default gateways while the caller believes a profile applies.
|
|
88
|
+
throw new DeeplineError(
|
|
89
|
+
'DEEPLINE_RUNTIME_GATEWAY_PROFILE was removed: Runtime gateway profiles (vercel_app@1) are no longer available. Unset it to run on the default gateways.',
|
|
90
|
+
undefined,
|
|
91
|
+
'RUNTIME_GATEWAY_PROFILE_REMOVED',
|
|
92
|
+
);
|
|
93
|
+
}
|
|
87
94
|
if (!configured) {
|
|
88
|
-
if (
|
|
89
|
-
configuredNamespace ||
|
|
90
|
-
configuredToken ||
|
|
91
|
-
configuredPlacementPolicy ||
|
|
92
|
-
configuredGatewayProfile
|
|
93
|
-
) {
|
|
95
|
+
if (configuredNamespace || configuredToken || configuredPlacementPolicy) {
|
|
94
96
|
// Name the variables that are actually set. This branch is almost always
|
|
95
97
|
// hit by a stale value auto-loaded from a .env/.env.local rather than by
|
|
96
98
|
// a deliberate export, so the message has to say where to look and how
|
|
@@ -101,9 +103,6 @@ function resolvePlayRunRuntimeSelection(
|
|
|
101
103
|
if (configuredPlacementPolicy) {
|
|
102
104
|
present.push('DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY');
|
|
103
105
|
}
|
|
104
|
-
if (configuredGatewayProfile) {
|
|
105
|
-
present.push('DEEPLINE_RUNTIME_GATEWAY_PROFILE');
|
|
106
|
-
}
|
|
107
106
|
const isPlural = present.length > 1;
|
|
108
107
|
throw new DeeplineError(
|
|
109
108
|
[
|
|
@@ -118,47 +117,20 @@ function resolvePlayRunRuntimeSelection(
|
|
|
118
117
|
}
|
|
119
118
|
return undefined;
|
|
120
119
|
}
|
|
121
|
-
// Validated only once a runtime environment is configured: a stale value
|
|
122
|
-
// without one gets the "unset them" guidance above instead.
|
|
123
|
-
const selectedGatewayProfile = configuredGatewayProfile
|
|
124
|
-
? normalizeRuntimeGatewayProfileId(configuredGatewayProfile)
|
|
125
|
-
: undefined;
|
|
126
|
-
if (configuredGatewayProfile && !selectedGatewayProfile) {
|
|
127
|
-
throw new DeeplineError(
|
|
128
|
-
`DEEPLINE_RUNTIME_GATEWAY_PROFILE must be a supported versioned gateway profile id such as vercel_app@1. Received "${configuredGatewayProfile}".`,
|
|
129
|
-
undefined,
|
|
130
|
-
'INVALID_RUNTIME_GATEWAY_PROFILE',
|
|
131
|
-
);
|
|
132
|
-
}
|
|
133
|
-
const gatewayProfile = selectedGatewayProfile
|
|
134
|
-
? { gatewayProfile: selectedGatewayProfile }
|
|
135
|
-
: {};
|
|
136
120
|
if (configured === 'native') {
|
|
137
121
|
// The app's own runtime on a named placement policy. The server decides
|
|
138
122
|
// from the API key's account whether this caller may ask for it.
|
|
139
|
-
const sandboxPlacementPolicy =
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
if (
|
|
143
|
-
configuredNamespace ||
|
|
144
|
-
(configuredPlacementPolicy && !sandboxPlacementPolicy) ||
|
|
145
|
-
(!sandboxPlacementPolicy && !selectedGatewayProfile)
|
|
146
|
-
) {
|
|
123
|
+
const sandboxPlacementPolicy = normalizePlayRuntimeSandboxPlacementPolicy(
|
|
124
|
+
configuredPlacementPolicy,
|
|
125
|
+
);
|
|
126
|
+
if (configuredNamespace || !sandboxPlacementPolicy) {
|
|
147
127
|
throw new DeeplineError(
|
|
148
|
-
'DEEPLINE_RUNTIME_ENVIRONMENT=native requires DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY (such as modal_only@1) and
|
|
128
|
+
'DEEPLINE_RUNTIME_ENVIRONMENT=native requires DEEPLINE_RUNTIME_SANDBOX_PLACEMENT_POLICY (such as modal_only@1) and no DEEPLINE_RUNTIME_NAMESPACE.',
|
|
149
129
|
undefined,
|
|
150
130
|
'INVALID_RUNTIME_ENVIRONMENT',
|
|
151
131
|
);
|
|
152
132
|
}
|
|
153
|
-
|
|
154
|
-
if (sandboxPlacementPolicy) {
|
|
155
|
-
return {
|
|
156
|
-
environment: 'native',
|
|
157
|
-
sandboxPlacementPolicy,
|
|
158
|
-
...gatewayProfile,
|
|
159
|
-
};
|
|
160
|
-
}
|
|
161
|
-
return { environment: 'native', gatewayProfile: selectedGatewayProfile! };
|
|
133
|
+
return { environment: 'native', sandboxPlacementPolicy };
|
|
162
134
|
}
|
|
163
135
|
const environment = normalizePlayRuntimeEnvironment(configured);
|
|
164
136
|
if (!environment) {
|
|
@@ -205,7 +177,6 @@ function resolvePlayRunRuntimeSelection(
|
|
|
205
177
|
...(configuredPlacementPolicy
|
|
206
178
|
? { sandboxPlacementPolicy: configuredPlacementPolicy }
|
|
207
179
|
: {}),
|
|
208
|
-
...gatewayProfile,
|
|
209
180
|
};
|
|
210
181
|
}
|
|
211
182
|
|
|
@@ -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.521',
|
|
209
209
|
updateSummary: {
|
|
210
210
|
introducedIn: '0.3.90',
|
|
211
211
|
summary:
|
|
@@ -928,24 +928,6 @@
|
|
|
928
928
|
"failureAlert": "vercel_route_wrapper",
|
|
929
929
|
"domainReportRequired": true
|
|
930
930
|
},
|
|
931
|
-
{
|
|
932
|
-
"id": "vercel.runtime-gateway-staging-retirement",
|
|
933
|
-
"name": "Runtime gateway staged-body retirement",
|
|
934
|
-
"scheduler": "vercel_cron",
|
|
935
|
-
"cadence": "7,22,37,52 * * * *",
|
|
936
|
-
"timezone": "UTC",
|
|
937
|
-
"source": "apps/deepline-api/vercel.json",
|
|
938
|
-
"locator": "/api/v2/cron/runtime-gateway-staging-retirement",
|
|
939
|
-
"owner": "runtime",
|
|
940
|
-
"criticality": "maintenance",
|
|
941
|
-
"purpose": "Retire app-hosted Runtime gateway staged bodies past their retirement time: delete each exact object, confirm it absent, then mark its custody row deleted; prune long-deleted rows.",
|
|
942
|
-
"successDefinition": "Every scheduler schema served by the deployment was probed; each due row was either confirmed absent and marked deleted or released for the next pass; an idle journal is a valid no-op.",
|
|
943
|
-
"failureDefinition": "A schema's journal probe, claim or prune fails, or target discovery fails, leaving due staged bodies unretired.",
|
|
944
|
-
"startGraceMs": 300000,
|
|
945
|
-
"runTimeoutMs": 300000,
|
|
946
|
-
"failureAlert": "vercel_route_wrapper",
|
|
947
|
-
"domainReportRequired": true
|
|
948
|
-
},
|
|
949
931
|
{
|
|
950
932
|
"id": "vercel.scheduled-work-health-snapshot",
|
|
951
933
|
"name": "Scheduled-work health snapshot",
|
|
@@ -79,18 +79,6 @@ function resolveBucket(kind: R2BucketKind): string {
|
|
|
79
79
|
return requireEnv('CLOUDFLARE_R2_BUCKET_NAME');
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
/**
|
|
83
|
-
* Nonsecret identity of the bucket a configuration addresses: SHA-256 of the
|
|
84
|
-
* bucket name and the endpoint host. Two processes address the same bucket
|
|
85
|
-
* only when their fingerprints match. Resolves no credentials.
|
|
86
|
-
*/
|
|
87
|
-
export function getR2BucketFingerprint(kind: R2BucketKind = 'default'): string {
|
|
88
|
-
const host = new URL(requireEnv('CLOUDFLARE_R2_ENDPOINT')).host.toLowerCase();
|
|
89
|
-
return createHash('sha256')
|
|
90
|
-
.update(`${resolveBucket(kind)}\n${host}`)
|
|
91
|
-
.digest('hex');
|
|
92
|
-
}
|
|
93
|
-
|
|
94
82
|
export function getR2Config(kind: R2BucketKind = 'default') {
|
|
95
83
|
return {
|
|
96
84
|
endpoint: requireEnv('CLOUDFLARE_R2_ENDPOINT'),
|
|
@@ -203,14 +191,12 @@ export async function r2ObjectExists(
|
|
|
203
191
|
export async function confirmR2ObjectAbsent(
|
|
204
192
|
key: string,
|
|
205
193
|
kind: R2BucketKind = 'default',
|
|
206
|
-
options?: { abortSignal?: AbortSignal },
|
|
207
194
|
): Promise<boolean> {
|
|
208
195
|
const config = getR2Config(kind);
|
|
209
196
|
const client = getR2Client(config);
|
|
210
197
|
try {
|
|
211
198
|
await client.send(
|
|
212
199
|
new HeadObjectCommand({ Bucket: config.bucket, Key: key }),
|
|
213
|
-
{ abortSignal: options?.abortSignal },
|
|
214
200
|
);
|
|
215
201
|
return false;
|
|
216
202
|
} catch (error) {
|
|
@@ -326,7 +312,6 @@ export async function listR2Keys(
|
|
|
326
312
|
export async function deleteR2Object(
|
|
327
313
|
key: string,
|
|
328
314
|
kind: R2BucketKind = 'default',
|
|
329
|
-
options?: { abortSignal?: AbortSignal },
|
|
330
315
|
): Promise<void> {
|
|
331
316
|
const startedAt = Date.now();
|
|
332
317
|
const config = getR2Config(kind);
|
|
@@ -336,7 +321,6 @@ export async function deleteR2Object(
|
|
|
336
321
|
Bucket: config.bucket,
|
|
337
322
|
Key: key,
|
|
338
323
|
}),
|
|
339
|
-
{ abortSignal: options?.abortSignal },
|
|
340
324
|
);
|
|
341
325
|
logR2Perf('delete', key, startedAt, { kind });
|
|
342
326
|
}
|
|
@@ -408,142 +392,3 @@ export async function createSignedR2WriteUrl(input: {
|
|
|
408
392
|
expiresAt: new Date(Date.now() + expiresInSeconds * 1000).toISOString(),
|
|
409
393
|
};
|
|
410
394
|
}
|
|
411
|
-
|
|
412
|
-
/** Ceiling for a create-once upload grant: 15 minutes. */
|
|
413
|
-
export const R2_CREATE_ONCE_UPLOAD_MAX_EXPIRES_SECONDS = 15 * 60;
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* Sign an exact-size, create-once PUT (`If-None-Match: *`) valid for at most
|
|
417
|
-
* 15 minutes. This bounds what the URL can write; it does not verify the
|
|
418
|
-
* digest or retire the object. The caller persists custody before calling
|
|
419
|
-
* this, verifies the stored bytes before use, and deletes the key only after
|
|
420
|
-
* the URL has expired (until then the URL could recreate a deleted key).
|
|
421
|
-
*/
|
|
422
|
-
export async function createSignedR2CreateOnceUrl(input: {
|
|
423
|
-
key: string;
|
|
424
|
-
kind?: R2BucketKind;
|
|
425
|
-
contentType: string;
|
|
426
|
-
byteLength: number;
|
|
427
|
-
maxBytes: number;
|
|
428
|
-
expiresInSeconds: number;
|
|
429
|
-
}): Promise<{
|
|
430
|
-
url: string;
|
|
431
|
-
expiresAt: string;
|
|
432
|
-
headers: {
|
|
433
|
-
'content-type': string;
|
|
434
|
-
'content-length': string;
|
|
435
|
-
'if-none-match': '*';
|
|
436
|
-
};
|
|
437
|
-
}> {
|
|
438
|
-
if (!input.key || !input.contentType) {
|
|
439
|
-
throw new Error('R2 create-once upload requires a key and content type.');
|
|
440
|
-
}
|
|
441
|
-
if (
|
|
442
|
-
!Number.isSafeInteger(input.byteLength) ||
|
|
443
|
-
!Number.isSafeInteger(input.maxBytes) ||
|
|
444
|
-
input.byteLength < 0 ||
|
|
445
|
-
input.maxBytes < 0 ||
|
|
446
|
-
input.byteLength > input.maxBytes
|
|
447
|
-
) {
|
|
448
|
-
throw new Error('R2 create-once upload size exceeds its allowed bound.');
|
|
449
|
-
}
|
|
450
|
-
if (
|
|
451
|
-
!Number.isSafeInteger(input.expiresInSeconds) ||
|
|
452
|
-
input.expiresInSeconds < 1 ||
|
|
453
|
-
input.expiresInSeconds > R2_CREATE_ONCE_UPLOAD_MAX_EXPIRES_SECONDS
|
|
454
|
-
) {
|
|
455
|
-
throw new Error(
|
|
456
|
-
`R2 create-once upload expiry must be between 1 and ${R2_CREATE_ONCE_UPLOAD_MAX_EXPIRES_SECONDS} seconds.`,
|
|
457
|
-
);
|
|
458
|
-
}
|
|
459
|
-
const kind = input.kind ?? 'default';
|
|
460
|
-
const config = getR2Config(kind);
|
|
461
|
-
const client = createR2Client(config);
|
|
462
|
-
const command = new PutObjectCommand({
|
|
463
|
-
Bucket: config.bucket,
|
|
464
|
-
Key: input.key,
|
|
465
|
-
ContentType: input.contentType,
|
|
466
|
-
ContentLength: input.byteLength,
|
|
467
|
-
IfNoneMatch: '*',
|
|
468
|
-
});
|
|
469
|
-
// SigV4 timestamps have whole-second precision. Report that exact deadline.
|
|
470
|
-
const signingDate = new Date(Math.floor(Date.now() / 1000) * 1000);
|
|
471
|
-
const url = await getSignedUrl(
|
|
472
|
-
client as R2PresignerClient,
|
|
473
|
-
command as R2PresignerCommand,
|
|
474
|
-
{
|
|
475
|
-
expiresIn: input.expiresInSeconds,
|
|
476
|
-
signingDate,
|
|
477
|
-
signableHeaders: new Set([
|
|
478
|
-
'content-length',
|
|
479
|
-
'content-type',
|
|
480
|
-
'if-none-match',
|
|
481
|
-
]),
|
|
482
|
-
},
|
|
483
|
-
);
|
|
484
|
-
return {
|
|
485
|
-
url,
|
|
486
|
-
expiresAt: new Date(
|
|
487
|
-
signingDate.getTime() + input.expiresInSeconds * 1000,
|
|
488
|
-
).toISOString(),
|
|
489
|
-
headers: {
|
|
490
|
-
'content-type': input.contentType,
|
|
491
|
-
'content-length': String(input.byteLength),
|
|
492
|
-
'if-none-match': '*',
|
|
493
|
-
},
|
|
494
|
-
};
|
|
495
|
-
}
|
|
496
|
-
|
|
497
|
-
/** R2 answered that the key does not exist (as opposed to failing). */
|
|
498
|
-
export function isR2NotFoundError(error: unknown): boolean {
|
|
499
|
-
const details = error as {
|
|
500
|
-
name?: string;
|
|
501
|
-
Code?: string;
|
|
502
|
-
$metadata?: { httpStatusCode?: number };
|
|
503
|
-
} | null;
|
|
504
|
-
return (
|
|
505
|
-
!!details &&
|
|
506
|
-
(details.$metadata?.httpStatusCode === 404 ||
|
|
507
|
-
details.name === 'NotFound' ||
|
|
508
|
-
details.name === 'NoSuchKey' ||
|
|
509
|
-
details.Code === 'NotFound' ||
|
|
510
|
-
details.Code === 'NoSuchKey')
|
|
511
|
-
);
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* Read one object, refusing before buffering when it is larger than
|
|
516
|
-
* `maxBytes`. Returns null only when R2 says the key does not exist; every
|
|
517
|
-
* other failure throws, so callers never mistake an outage for absence.
|
|
518
|
-
*/
|
|
519
|
-
export async function getBoundedBufferFromR2(
|
|
520
|
-
key: string,
|
|
521
|
-
maxBytes: number,
|
|
522
|
-
kind: R2BucketKind = 'default',
|
|
523
|
-
): Promise<Buffer | null> {
|
|
524
|
-
const startedAt = Date.now();
|
|
525
|
-
const config = getR2Config(kind);
|
|
526
|
-
const client = getR2Client(config);
|
|
527
|
-
let response;
|
|
528
|
-
try {
|
|
529
|
-
response = await client.send(
|
|
530
|
-
new GetObjectCommand({ Bucket: config.bucket, Key: key }),
|
|
531
|
-
);
|
|
532
|
-
} catch (error) {
|
|
533
|
-
if (isR2NotFoundError(error)) return null;
|
|
534
|
-
throw error;
|
|
535
|
-
}
|
|
536
|
-
if (
|
|
537
|
-
typeof response.ContentLength === 'number' &&
|
|
538
|
-
response.ContentLength > maxBytes
|
|
539
|
-
) {
|
|
540
|
-
(response.Body as { destroy?: () => void } | undefined)?.destroy?.();
|
|
541
|
-
throw new Error(`R2 object ${key} exceeds ${maxBytes} bytes.`);
|
|
542
|
-
}
|
|
543
|
-
const bytes = await response.Body!.transformToByteArray();
|
|
544
|
-
if (bytes.byteLength > maxBytes) {
|
|
545
|
-
throw new Error(`R2 object ${key} exceeds ${maxBytes} bytes.`);
|
|
546
|
-
}
|
|
547
|
-
logR2Perf('get-bounded', key, startedAt, { kind, bytes: bytes.byteLength });
|
|
548
|
-
return Buffer.from(bytes);
|
|
549
|
-
}
|
|
@@ -798,6 +798,30 @@ export type FixtureExecuteBoundaryCounts = {
|
|
|
798
798
|
unprovenResponses: number;
|
|
799
799
|
};
|
|
800
800
|
|
|
801
|
+
/** Test-only terminal HTTP evidence; identities are full scoped SHA-256 digests. */
|
|
802
|
+
export type FixtureBoundaryCompletion = {
|
|
803
|
+
kind: 'fixture_boundary_completion';
|
|
804
|
+
orgId: string;
|
|
805
|
+
runId: string;
|
|
806
|
+
logicalCallSha256: string | null;
|
|
807
|
+
outcome:
|
|
808
|
+
| 'success'
|
|
809
|
+
| 'other_success'
|
|
810
|
+
| 'released_refusal'
|
|
811
|
+
| 'failure'
|
|
812
|
+
| 'expected_failure'
|
|
813
|
+
| 'unproven';
|
|
814
|
+
};
|
|
815
|
+
|
|
816
|
+
/** Every finished counter ordinal has exactly one detail, written atomically. */
|
|
817
|
+
export function fixtureBoundaryCompletionPrefix(input: {
|
|
818
|
+
orgId: string;
|
|
819
|
+
runId: string;
|
|
820
|
+
shard: number;
|
|
821
|
+
}): string {
|
|
822
|
+
return `${fixtureRunCallCounterKey({ ...input, kind: 'boundary_finished' })}:completion:`;
|
|
823
|
+
}
|
|
824
|
+
|
|
801
825
|
/** Fixture-only evidence; no provider payload, identity, or resource path. */
|
|
802
826
|
export type FixtureReplaySelectionWitness = {
|
|
803
827
|
kind: 'retained_response' | 'synthetic_fallback' | 'unproven';
|
|
@@ -302,14 +302,6 @@ type WorkflowInternalTokenBaseClaims = {
|
|
|
302
302
|
v: typeof INTERNAL_BOOTSTRAP_TOKEN_VERSION;
|
|
303
303
|
};
|
|
304
304
|
|
|
305
|
-
/** Vercel deployment id shape carried by `runtime_gateway_deployment_id`. */
|
|
306
|
-
const RUNTIME_GATEWAY_DEPLOYMENT_ID_CLAIM_PATTERN = /^dpl_[A-Za-z0-9]+$/;
|
|
307
|
-
/**
|
|
308
|
-
* Versioned profile id shape. Membership is checked by the gateway that serves
|
|
309
|
-
* the profile, so a token naming a newer profile still verifies here.
|
|
310
|
-
*/
|
|
311
|
-
const RUNTIME_GATEWAY_PROFILE_CLAIM_PATTERN = /^[a-z][a-z0-9_]*@[1-9][0-9]*$/;
|
|
312
|
-
|
|
313
305
|
export type WorkflowRunExecutionTokenClaims =
|
|
314
306
|
WorkflowInternalTokenBaseClaims & {
|
|
315
307
|
purpose: typeof INTERNAL_WORKFLOW_EXECUTION_PURPOSE;
|
|
@@ -362,13 +354,6 @@ export type WorkflowRunExecutionTokenClaims =
|
|
|
362
354
|
capabilities: RuntimeExecutionCapability[];
|
|
363
355
|
/** Trusted deployment origin that issued this run token. */
|
|
364
356
|
runtime_origin?: string;
|
|
365
|
-
/**
|
|
366
|
-
* Runtime gateway pin: the immutable app deployment (`dpl_...`) whose
|
|
367
|
-
* in-process gateway alone may accept this token. Absent on unpinned runs.
|
|
368
|
-
*/
|
|
369
|
-
runtime_gateway_deployment_id?: string;
|
|
370
|
-
/** Runtime gateway profile id paired with `runtime_gateway_deployment_id`. */
|
|
371
|
-
runtime_gateway_profile?: string;
|
|
372
357
|
/** Immutable receiver advertising leased Run Ledger ingress-prefix support. */
|
|
373
358
|
run_ledger_ingress_prefix_origin?: string;
|
|
374
359
|
};
|
|
@@ -689,18 +674,6 @@ function isValidWorkflowClaimsShape(
|
|
|
689
674
|
typeof claims.terminal_contract === 'string') &&
|
|
690
675
|
(claims.runtime_origin === undefined ||
|
|
691
676
|
isValidRuntimeOrigin(claims.runtime_origin)) &&
|
|
692
|
-
(claims.runtime_gateway_deployment_id === undefined ||
|
|
693
|
-
(typeof claims.runtime_gateway_deployment_id === 'string' &&
|
|
694
|
-
RUNTIME_GATEWAY_DEPLOYMENT_ID_CLAIM_PATTERN.test(
|
|
695
|
-
claims.runtime_gateway_deployment_id,
|
|
696
|
-
))) &&
|
|
697
|
-
(claims.runtime_gateway_profile === undefined ||
|
|
698
|
-
(typeof claims.runtime_gateway_profile === 'string' &&
|
|
699
|
-
RUNTIME_GATEWAY_PROFILE_CLAIM_PATTERN.test(
|
|
700
|
-
claims.runtime_gateway_profile,
|
|
701
|
-
))) &&
|
|
702
|
-
(claims.runtime_gateway_deployment_id === undefined) ===
|
|
703
|
-
(claims.runtime_gateway_profile === undefined) &&
|
|
704
677
|
(claims.run_ledger_ingress_prefix_origin === undefined ||
|
|
705
678
|
isValidRuntimeOrigin(claims.run_ledger_ingress_prefix_origin)) &&
|
|
706
679
|
Array.isArray(claims.capabilities) &&
|
|
@@ -798,32 +771,12 @@ export async function mintWorkflowRunExecutionToken(input: {
|
|
|
798
771
|
terminalContract?: DirectCompletedTerminalContract | null;
|
|
799
772
|
capabilities?: readonly RuntimeExecutionCapability[];
|
|
800
773
|
runtimeOrigin?: string | null;
|
|
801
|
-
/** Both or neither: the pinned deployment and its gateway profile id. */
|
|
802
|
-
runtimeGatewayDeploymentId?: string | null;
|
|
803
|
-
runtimeGatewayProfileId?: string | null;
|
|
804
774
|
runLedgerIngressPrefixOrigin?: string | null;
|
|
805
775
|
subject?: string | null;
|
|
806
776
|
nowMs?: number;
|
|
807
777
|
}): Promise<string> {
|
|
808
778
|
const fixtureBehavior = validateFixtureBehavior(input.fixtureBehavior);
|
|
809
|
-
|
|
810
|
-
input.runtimeGatewayDeploymentId?.trim() || null;
|
|
811
|
-
const runtimeGatewayProfileId = input.runtimeGatewayProfileId?.trim() || null;
|
|
812
|
-
if (
|
|
813
|
-
(runtimeGatewayDeploymentId === null) !==
|
|
814
|
-
(runtimeGatewayProfileId === null) ||
|
|
815
|
-
(runtimeGatewayDeploymentId !== null &&
|
|
816
|
-
!RUNTIME_GATEWAY_DEPLOYMENT_ID_CLAIM_PATTERN.test(
|
|
817
|
-
runtimeGatewayDeploymentId,
|
|
818
|
-
)) ||
|
|
819
|
-
(runtimeGatewayProfileId !== null &&
|
|
820
|
-
!RUNTIME_GATEWAY_PROFILE_CLAIM_PATTERN.test(runtimeGatewayProfileId))
|
|
821
|
-
) {
|
|
822
|
-
throw new Error(
|
|
823
|
-
'Runtime gateway token claims require a valid deployment id and profile id together.',
|
|
824
|
-
);
|
|
825
|
-
}
|
|
826
|
-
if (fixtureBehavior.ok === false) throw new Error(fixtureBehavior.error);
|
|
779
|
+
if (!fixtureBehavior.ok) throw new Error(fixtureBehavior.error);
|
|
827
780
|
if (fixtureBehavior.behavior && input.integrationMode !== 'fixture') {
|
|
828
781
|
throw new Error(
|
|
829
782
|
'fixtureBehavior requires workflow integration mode "fixture".',
|
|
@@ -903,12 +856,6 @@ export async function mintWorkflowRunExecutionToken(input: {
|
|
|
903
856
|
...(input.runtimeOrigin?.trim()
|
|
904
857
|
? { runtime_origin: new URL(input.runtimeOrigin).origin }
|
|
905
858
|
: {}),
|
|
906
|
-
...(runtimeGatewayDeploymentId && runtimeGatewayProfileId
|
|
907
|
-
? {
|
|
908
|
-
runtime_gateway_deployment_id: runtimeGatewayDeploymentId,
|
|
909
|
-
runtime_gateway_profile: runtimeGatewayProfileId,
|
|
910
|
-
}
|
|
911
|
-
: {}),
|
|
912
859
|
...(input.runLedgerIngressPrefixOrigin?.trim()
|
|
913
860
|
? {
|
|
914
861
|
run_ledger_ingress_prefix_origin: new URL(
|
|
@@ -73,13 +73,8 @@ export const PLAY_LAUNCH_ENVELOPE_FIELD_ROLES: {
|
|
|
73
73
|
runLedgerExecutorToken: 'detail',
|
|
74
74
|
runtimeAuthority: 'detail',
|
|
75
75
|
runtimeApiBaseUrl: 'detail',
|
|
76
|
-
// Runtime gateway pin
|
|
77
|
-
//
|
|
78
|
-
// a retry of the same launch through another deployment must deduplicate to
|
|
79
|
-
// the first admission (whose pin stands) rather than conflict. The profile
|
|
80
|
-
// id follows them: a profile changes where gateways run, never what the run
|
|
81
|
-
// computes, and keeping it out of the digest leaves every existing launch
|
|
82
|
-
// digest byte-identical.
|
|
76
|
+
// Retired Runtime gateway pin fields (nothing writes them). A stored launch
|
|
77
|
+
// may still carry them, so they stay classified as detail, never identity.
|
|
83
78
|
runtimeGatewayProfileId: 'detail',
|
|
84
79
|
runtimeReceiptGatewayBaseUrl: 'detail',
|
|
85
80
|
runtimeExecutionGatewayBaseUrl: 'detail',
|
|
@@ -247,19 +247,6 @@ export interface PlayRunnerContextConfig extends RetainedPipelineCarrier {
|
|
|
247
247
|
*/
|
|
248
248
|
executionGatewayBaseUrl?: string | null;
|
|
249
249
|
receiptGatewayBaseUrl?: string | null;
|
|
250
|
-
/**
|
|
251
|
-
* Runtime gateway profile pin (`runtime-gateway-profile.ts`). Absent on
|
|
252
|
-
* unpinned runs. Set only by the worker from a validated launch pin; the
|
|
253
|
-
* gateway URLs above then name the pinned deployment.
|
|
254
|
-
*/
|
|
255
|
-
runtimeGatewayProfileId?: string | null;
|
|
256
|
-
runtimeGatewayDeploymentId?: string | null;
|
|
257
|
-
/** Exact origin and gateway path prefixes that may receive the OIDC token. */
|
|
258
|
-
runtimeGatewayCredentialScope?:
|
|
259
|
-
| import('./runtime-gateway-sandbox-credential').RuntimeGatewayCredentialScope
|
|
260
|
-
| null;
|
|
261
|
-
/** Short-lived edge credential for the pinned gateway; renewed by the watchdog. */
|
|
262
|
-
runtimeGatewayOidcToken?: string | null;
|
|
263
250
|
/**
|
|
264
251
|
* Internal fixture-canary pin for a cordoned receipt-gateway candidate. This
|
|
265
252
|
* is a signed launch fact, never a customer-authored or sandbox-supplied
|
|
@@ -229,59 +229,3 @@ export function buildAsyncPlayRequestFingerprint(input: {
|
|
|
229
229
|
}),
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
|
-
|
|
233
|
-
/**
|
|
234
|
-
* Longest run id any runtime scope accepts. Play names are Postgres
|
|
235
|
-
* identifiers (at most 63 characters), so every built id is far below it.
|
|
236
|
-
*/
|
|
237
|
-
export const PLAY_RUN_ID_MAX_LENGTH = 256;
|
|
238
|
-
|
|
239
|
-
const RUNTIME_SCOPE_RUN_ID_PATTERN = /^[A-Za-z0-9_.:@/-]+$/;
|
|
240
|
-
|
|
241
|
-
/**
|
|
242
|
-
* The one run-id check that may gate a request: a non-empty id of at most
|
|
243
|
-
* `PLAY_RUN_ID_MAX_LENGTH` characters from the path-safe alphabet. Run ids are
|
|
244
|
-
* path-shaped (`play/<family>/run/<suffix>`), so `/` is allowed. It is
|
|
245
|
-
* deliberately permissive: it never parses the id, so a scheduler row with an
|
|
246
|
-
* older or foreign id shape is still served.
|
|
247
|
-
*/
|
|
248
|
-
export function isRuntimeScopeRunId(value: unknown): value is string {
|
|
249
|
-
return (
|
|
250
|
-
typeof value === 'string' &&
|
|
251
|
-
value.length > 0 &&
|
|
252
|
-
value.length <= PLAY_RUN_ID_MAX_LENGTH &&
|
|
253
|
-
RUNTIME_SCOPE_RUN_ID_PATTERN.test(value)
|
|
254
|
-
);
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export type ParsedPlayRunId = Readonly<{
|
|
258
|
-
familyKey: string;
|
|
259
|
-
startedAtMs: number;
|
|
260
|
-
kind: 'root' | 'caller' | 'async' | 'rerun';
|
|
261
|
-
}>;
|
|
262
|
-
|
|
263
|
-
const PLAY_RUN_ID_PATTERN =
|
|
264
|
-
/^play\/([a-z0-9-]+(?:\/[a-z0-9-]+)*)\/run\/\d{8}t\d{6}-\d{3}(?:-[a-z0-9]{8}(-caller-[a-f0-9]{64})?|(-async-[a-f0-9]{20})|(-rerun-[a-f0-9]{20}))?$/;
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* Parse an id built by this module's builders. Diagnostic only: use
|
|
268
|
-
* `isRuntimeScopeRunId` to admit or refuse a request.
|
|
269
|
-
*/
|
|
270
|
-
export function parsePlayRunId(value: unknown): ParsedPlayRunId | null {
|
|
271
|
-
if (!isRuntimeScopeRunId(value)) return null;
|
|
272
|
-
const match = PLAY_RUN_ID_PATTERN.exec(value);
|
|
273
|
-
if (!match) return null;
|
|
274
|
-
const startedAtMs = canonicalPlayRunStartedAtMs(value);
|
|
275
|
-
if (startedAtMs === null) return null;
|
|
276
|
-
return Object.freeze({
|
|
277
|
-
familyKey: match[1]!,
|
|
278
|
-
startedAtMs,
|
|
279
|
-
kind: match[2]
|
|
280
|
-
? 'caller'
|
|
281
|
-
: match[3]
|
|
282
|
-
? 'async'
|
|
283
|
-
: match[4]
|
|
284
|
-
? 'rerun'
|
|
285
|
-
: 'root',
|
|
286
|
-
});
|
|
287
|
-
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { runtimeToolPath } from '../runtime-api-paths';
|
|
2
1
|
import {
|
|
3
2
|
createPrebuiltBatchQualityCollector,
|
|
4
3
|
measurePrebuiltResultQuality,
|
|
@@ -15,10 +14,6 @@ import { appendFileSync, createReadStream, writeFileSync } from 'node:fs';
|
|
|
15
14
|
import { readFile } from 'node:fs/promises';
|
|
16
15
|
import { dirname, isAbsolute, resolve } from 'node:path';
|
|
17
16
|
import { createRequire } from 'node:module';
|
|
18
|
-
import {
|
|
19
|
-
installSandboxRuntimeAppTransport,
|
|
20
|
-
sandboxRuntimeAppFetch,
|
|
21
|
-
} from '../runtime-app-transport';
|
|
22
17
|
import { createHash, randomUUID } from 'node:crypto';
|
|
23
18
|
import { formatWithOptions } from 'node:util';
|
|
24
19
|
import { compileFunction } from 'node:vm';
|
|
@@ -225,15 +220,13 @@ export function createReceiptGatewayResponseObserver(): {
|
|
|
225
220
|
};
|
|
226
221
|
}
|
|
227
222
|
|
|
228
|
-
|
|
229
|
-
// pinned-run gateway credential is applied explicitly by the transport owner.
|
|
230
|
-
const safeNodeOutboundFetch = sandboxRuntimeAppFetch((async (
|
|
223
|
+
async function safeNodeOutboundFetch(
|
|
231
224
|
input: string | URL,
|
|
232
225
|
init?: RequestInit,
|
|
233
|
-
): Promise<Response>
|
|
226
|
+
): Promise<Response> {
|
|
234
227
|
const { safeOutboundFetch } = await loadSafeOutboundFetch();
|
|
235
228
|
return safeOutboundFetch(input, init);
|
|
236
|
-
}
|
|
229
|
+
}
|
|
237
230
|
|
|
238
231
|
function fixtureCtxFetch(
|
|
239
232
|
config: Pick<PlayRunnerExecutionConfig, 'context'>,
|
|
@@ -255,13 +248,13 @@ function fixtureCtxFetch(
|
|
|
255
248
|
});
|
|
256
249
|
}
|
|
257
250
|
|
|
258
|
-
|
|
251
|
+
async function safeNodeStreamingOutboundFetch(
|
|
259
252
|
input: string | URL,
|
|
260
253
|
init?: RequestInit,
|
|
261
|
-
): Promise<Response>
|
|
254
|
+
): Promise<Response> {
|
|
262
255
|
const { safeOutboundFetch } = await loadSafeOutboundFetch();
|
|
263
256
|
return safeOutboundFetch(input, init, { streamResponseBody: true });
|
|
264
|
-
}
|
|
257
|
+
}
|
|
265
258
|
|
|
266
259
|
import {
|
|
267
260
|
resolveSheetContractForTableNamespace,
|
|
@@ -741,7 +734,7 @@ function createRuntimeToolMetadataResolver(config: PlayRunnerExecutionConfig) {
|
|
|
741
734
|
}
|
|
742
735
|
|
|
743
736
|
const promise = (async () => {
|
|
744
|
-
const url = `${config.context.baseUrl}
|
|
737
|
+
const url = `${config.context.baseUrl}/api/v2/plays/runtime-tools/${encodeURIComponent(normalizedToolId)}`;
|
|
745
738
|
const response = await fetchRunnerRuntimeControl({
|
|
746
739
|
url,
|
|
747
740
|
description: `Runtime metadata lookup for tool ${normalizedToolId}`,
|
|
@@ -790,7 +783,7 @@ export function createAppRuntimeToolAuthScopeDigestResolver(
|
|
|
790
783
|
`Runtime auth scope lookup for tool ${normalizedToolId || '<empty>'} requires executorToken and baseUrl.`,
|
|
791
784
|
);
|
|
792
785
|
}
|
|
793
|
-
const url = `${config.context.baseUrl}
|
|
786
|
+
const url = `${config.context.baseUrl}/api/v2/plays/runtime-tools/${encodeURIComponent(normalizedToolId)}/auth-scope`;
|
|
794
787
|
const response = await fetchRunnerRuntimeControl({
|
|
795
788
|
url,
|
|
796
789
|
description: `Runtime auth scope lookup for tool ${normalizedToolId}`,
|
|
@@ -889,7 +882,7 @@ export function createAppRuntimeToolAuthScopeDigestResolver(
|
|
|
889
882
|
if (!proof) {
|
|
890
883
|
proof = (async () => {
|
|
891
884
|
const response = await fetchRunnerRuntimeControl({
|
|
892
|
-
url: `${executionBase}
|
|
885
|
+
url: `${executionBase}/api/v2/plays/runtime-tools/${encodeURIComponent(normalized)}/auth-scope`,
|
|
893
886
|
description: `Runtime async recovery capability for tool ${normalized}`,
|
|
894
887
|
retrySafe: true,
|
|
895
888
|
init: {
|
|
@@ -995,7 +988,7 @@ export function createRuntimeEventWaitHandler(
|
|
|
995
988
|
boundary: IntegrationEventWaitBoundary;
|
|
996
989
|
},
|
|
997
990
|
): Promise<IntegrationEventWaitBoundary> {
|
|
998
|
-
const url = `${config.context.baseUrl}
|
|
991
|
+
const url = `${config.context.baseUrl}/api/v2/plays/runtime-tools/${encodeURIComponent(normalizedToolId)}/event-wait`;
|
|
999
992
|
const response = await fetchRunnerRuntimeControl({
|
|
1000
993
|
url,
|
|
1001
994
|
description: `Event wait runtime call for tool ${normalizedToolId}`,
|
|
@@ -4201,10 +4194,6 @@ async function main() {
|
|
|
4201
4194
|
? gunzipSync(configBuffer).toString('utf-8')
|
|
4202
4195
|
: configBuffer.toString('utf-8');
|
|
4203
4196
|
const parsedConfig = JSON.parse(configJson) as PlayRunnerExecutionConfig;
|
|
4204
|
-
// Pinned runs only: code-owned requests to the pinned gateway origin and
|
|
4205
|
-
// paths carry the watchdog-renewed OIDC credential. Other targets, signed
|
|
4206
|
-
// object URLs included, are untouched. Unpinned configs install nothing.
|
|
4207
|
-
installSandboxRuntimeAppTransport(parsedConfig.context);
|
|
4208
4197
|
writeRunnerStartupDiagnostic(
|
|
4209
4198
|
process.env.DEEPLINE_PLAY_RUNNER_STARTUP_DIAGNOSTIC_PATH,
|
|
4210
4199
|
{ phase: 'booted' },
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { APP_RUNTIME_COMPAT_PATH } from '../runtime-api-paths';
|
|
2
1
|
import { RUNTIME_CLAIM_HEARTBEAT_DIVISOR } from '../runtime-constants';
|
|
3
2
|
import { PLAY_RUNTIME_TRANSPORT_ATTEMPT_HEADER } from '../runtime-contract';
|
|
4
3
|
import {
|
|
@@ -107,6 +106,7 @@ export interface RunnerHeartbeatLoopHandle {
|
|
|
107
106
|
lastSuccessAtMs: () => number;
|
|
108
107
|
}
|
|
109
108
|
|
|
109
|
+
const APP_RUNTIME_COMPAT_PATH = '/api/v2/plays/runtime';
|
|
110
110
|
export const RUNNER_HEARTBEAT_REQUEST_TIMEOUT_MS = 10_000;
|
|
111
111
|
// The detached startup deadline is shorter than the normal 40s cadence.
|
|
112
112
|
// Retry initial transport failures while customer execution remains fenced.
|