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
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts
CHANGED
|
@@ -6,6 +6,8 @@ import { modalEarlySandboxAdapter } from '../runner-backends/backends/modal';
|
|
|
6
6
|
import {
|
|
7
7
|
EARLY_SANDBOX_START,
|
|
8
8
|
EARLY_SANDBOX_SWEEP_INTERVAL_MS,
|
|
9
|
+
EARLY_SANDBOX_SWEEP_JITTER_RATIO,
|
|
10
|
+
earlySandboxRequiredCapabilities,
|
|
9
11
|
PREBOOT_RUNNER_IN_EARLY_SANDBOX,
|
|
10
12
|
startEarlySandbox,
|
|
11
13
|
type EarlySandboxAdapter,
|
|
@@ -15,10 +17,18 @@ import {
|
|
|
15
17
|
import { resolveExperimentSwitch } from '../experiment-switches';
|
|
16
18
|
import type { FleetSandboxSweepAdapter } from '../fleet-sandbox-sweep';
|
|
17
19
|
import {
|
|
20
|
+
isKnownRuntimeSandboxPlacementPolicyId,
|
|
21
|
+
resolveRuntimeSandboxPlacementPolicy,
|
|
22
|
+
} from '../runtime-sandbox-placement-policy';
|
|
23
|
+
import {
|
|
24
|
+
assertRuntimeSandboxProvidersSupport,
|
|
18
25
|
runtimeSandboxProviderProfile,
|
|
19
26
|
type RuntimeSandboxProviderId,
|
|
20
27
|
} from '../runtime-sandbox-provider-profile';
|
|
21
|
-
import {
|
|
28
|
+
import {
|
|
29
|
+
assertEarlySandboxLaneSupported,
|
|
30
|
+
runtimeSandboxPlacementPoliciesRunnableByWorker,
|
|
31
|
+
} from './absurd-worker-required-env';
|
|
22
32
|
import { CLAIM_AFFINITY_FOR_EARLY_SANDBOX } from './early-sandbox-claim-affinity';
|
|
23
33
|
|
|
24
34
|
/**
|
|
@@ -35,13 +45,55 @@ export const EARLY_SANDBOX_ADAPTERS: Readonly<
|
|
|
35
45
|
modal: modalEarlySandboxAdapter,
|
|
36
46
|
};
|
|
37
47
|
|
|
48
|
+
/**
|
|
49
|
+
* The only provider a hinted placement policy may lead with. Daytona-led
|
|
50
|
+
* policies (`daytona_modal_canary@1` included: its canary is chosen per run
|
|
51
|
+
* at launch, after the hint) and the Preview-only Vercel policy are refused.
|
|
52
|
+
*/
|
|
53
|
+
export const EARLY_SANDBOX_POLICY_LEAD_PROVIDER: RuntimeSandboxProviderId =
|
|
54
|
+
'modal';
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* Early sandboxes one worker process may hold unadopted at once, summed over
|
|
58
|
+
* its Adapters' registries. A hint past it is refused; its run creates its
|
|
59
|
+
* own sandbox at launch.
|
|
60
|
+
*/
|
|
61
|
+
export const EARLY_SANDBOX_MAX_OUTSTANDING_PER_WORKER = 16;
|
|
62
|
+
|
|
63
|
+
export type EarlySandboxAdapterSelectionRefusal =
|
|
64
|
+
| 'lane_lead_not_single'
|
|
65
|
+
| 'adapter_missing'
|
|
66
|
+
| 'policy_unknown'
|
|
67
|
+
| 'policy_not_on_lane'
|
|
68
|
+
| 'policy_lead_not_modal';
|
|
69
|
+
|
|
38
70
|
export class EarlySandboxAdapterSelectionError extends Error {
|
|
39
|
-
|
|
71
|
+
readonly reason: EarlySandboxAdapterSelectionRefusal;
|
|
72
|
+
constructor(message: string, reason: EarlySandboxAdapterSelectionRefusal) {
|
|
40
73
|
super(message);
|
|
41
74
|
this.name = 'EarlySandboxAdapterSelectionError';
|
|
75
|
+
this.reason = reason;
|
|
42
76
|
}
|
|
43
77
|
}
|
|
44
78
|
|
|
79
|
+
/** Why a worker refuses a hint before selecting an Adapter or creating. */
|
|
80
|
+
export type EarlySandboxHintRefusal =
|
|
81
|
+
| 'worker_draining'
|
|
82
|
+
| 'no_idle_slot'
|
|
83
|
+
| 'outstanding_cap';
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The worker's own state a hint is admitted against. Each refusal is one
|
|
87
|
+
* `play-runner.early.hint_refused` line; the run's launch then creates its
|
|
88
|
+
* own sandbox.
|
|
89
|
+
*/
|
|
90
|
+
export type EarlySandboxWorkerCapacity = {
|
|
91
|
+
/** Drain mode (`DEEPLINE_ABSURD_DRAIN_EXIT`): the lane is retiring. */
|
|
92
|
+
readonly draining: boolean;
|
|
93
|
+
/** Whether the claim loop has a free slot to claim the hinted run with. */
|
|
94
|
+
hasIdleSlot(): boolean;
|
|
95
|
+
};
|
|
96
|
+
|
|
45
97
|
/** A hinted run's early-sandbox switches (E2, PB, CA). */
|
|
46
98
|
export function resolveRunEarlySandboxSwitches(
|
|
47
99
|
overrides: EarlySandboxStartRequest['experimentSwitchOverrides'],
|
|
@@ -62,20 +114,33 @@ export function resolveRunEarlySandboxSwitches(
|
|
|
62
114
|
}
|
|
63
115
|
|
|
64
116
|
/**
|
|
65
|
-
* The Adapter this lane starts a run's early sandbox with.
|
|
66
|
-
*
|
|
117
|
+
* The Adapter this lane starts a run's early sandbox with.
|
|
118
|
+
*
|
|
119
|
+
* Without `sandboxPlacementPolicyId` (every hint from a writer older than the
|
|
120
|
+
* field): the lane's early-sandbox providers must name exactly one
|
|
121
|
+
* implemented Adapter, as before. With it: the policy must be in this
|
|
122
|
+
* worker's placement policy catalog and among the policies this lane runs,
|
|
123
|
+
* and its lead provider must be Modal; the Adapter is the lead provider's.
|
|
124
|
+
*
|
|
125
|
+
* Throws `RuntimeSandboxCapabilityUnsupportedError` when a provider's profile
|
|
67
126
|
* lacks a capability the switches need, and
|
|
68
|
-
* `EarlySandboxAdapterSelectionError`
|
|
69
|
-
* exactly one implemented Adapter.
|
|
127
|
+
* `EarlySandboxAdapterSelectionError` (with its `reason`) otherwise.
|
|
70
128
|
*/
|
|
71
129
|
export function selectEarlySandboxAdapter(input: {
|
|
72
130
|
backend: PlayRuntimeBackendId;
|
|
73
131
|
env: Readonly<Record<string, string | undefined>>;
|
|
74
132
|
switches: EarlySandboxSwitches;
|
|
133
|
+
/** The hinted run's placement policy id; absent keeps the lane rule. */
|
|
134
|
+
sandboxPlacementPolicyId?: string | null;
|
|
75
135
|
adapters?: Readonly<
|
|
76
136
|
Partial<Record<RuntimeSandboxProviderId, EarlySandboxAdapter>>
|
|
77
137
|
>;
|
|
78
138
|
}): EarlySandboxAdapter {
|
|
139
|
+
const adapters = input.adapters ?? EARLY_SANDBOX_ADAPTERS;
|
|
140
|
+
const policyId = input.sandboxPlacementPolicyId?.trim();
|
|
141
|
+
if (policyId) {
|
|
142
|
+
return selectEarlySandboxAdapterForPolicy({ ...input, policyId, adapters });
|
|
143
|
+
}
|
|
79
144
|
const subject = `Early sandbox on the ${input.backend} worker lane`;
|
|
80
145
|
const providers = assertEarlySandboxLaneSupported({
|
|
81
146
|
subject,
|
|
@@ -89,26 +154,126 @@ export function selectEarlySandboxAdapter(input: {
|
|
|
89
154
|
`${subject} needs exactly one lead provider; the lane has ${
|
|
90
155
|
providers.length === 0 ? 'none' : providers.join(', ')
|
|
91
156
|
}.`,
|
|
157
|
+
'lane_lead_not_single',
|
|
92
158
|
);
|
|
93
159
|
}
|
|
94
160
|
// The profile says it is supported; an Adapter must then exist.
|
|
95
|
-
const adapter =
|
|
161
|
+
const adapter = adapters[provider];
|
|
96
162
|
if (!adapter) {
|
|
97
163
|
throw new EarlySandboxAdapterSelectionError(
|
|
98
164
|
`${subject}: ${provider} declares early start supported but has no early-sandbox Adapter.`,
|
|
165
|
+
'adapter_missing',
|
|
99
166
|
);
|
|
100
167
|
}
|
|
101
168
|
return adapter;
|
|
102
169
|
}
|
|
103
170
|
|
|
171
|
+
function selectEarlySandboxAdapterForPolicy(input: {
|
|
172
|
+
backend: PlayRuntimeBackendId;
|
|
173
|
+
env: Readonly<Record<string, string | undefined>>;
|
|
174
|
+
switches: EarlySandboxSwitches;
|
|
175
|
+
policyId: string;
|
|
176
|
+
adapters: Readonly<
|
|
177
|
+
Partial<Record<RuntimeSandboxProviderId, EarlySandboxAdapter>>
|
|
178
|
+
>;
|
|
179
|
+
}): EarlySandboxAdapter {
|
|
180
|
+
const subject = `Early sandbox for placement policy ${input.policyId} on the ${input.backend} worker lane`;
|
|
181
|
+
if (!isKnownRuntimeSandboxPlacementPolicyId(input.policyId)) {
|
|
182
|
+
throw new EarlySandboxAdapterSelectionError(
|
|
183
|
+
`${subject}: the policy is not in this worker's placement policy catalog.`,
|
|
184
|
+
'policy_unknown',
|
|
185
|
+
);
|
|
186
|
+
}
|
|
187
|
+
const policy = resolveRuntimeSandboxPlacementPolicy(input.policyId);
|
|
188
|
+
const runnable = runtimeSandboxPlacementPoliciesRunnableByWorker(
|
|
189
|
+
input.backend,
|
|
190
|
+
input.env,
|
|
191
|
+
);
|
|
192
|
+
if (!runnable.some((candidate) => candidate.id === policy.id)) {
|
|
193
|
+
throw new EarlySandboxAdapterSelectionError(
|
|
194
|
+
`${subject}: this lane does not run the policy (it runs ${
|
|
195
|
+
runnable.map((candidate) => candidate.id).join(', ') || 'none'
|
|
196
|
+
}).`,
|
|
197
|
+
'policy_not_on_lane',
|
|
198
|
+
);
|
|
199
|
+
}
|
|
200
|
+
const lead = policy.providers[0];
|
|
201
|
+
if (lead !== EARLY_SANDBOX_POLICY_LEAD_PROVIDER) {
|
|
202
|
+
throw new EarlySandboxAdapterSelectionError(
|
|
203
|
+
`${subject}: the policy leads with ${lead}; only ${EARLY_SANDBOX_POLICY_LEAD_PROVIDER}-led policies start early.`,
|
|
204
|
+
'policy_lead_not_modal',
|
|
205
|
+
);
|
|
206
|
+
}
|
|
207
|
+
assertRuntimeSandboxProvidersSupport({
|
|
208
|
+
subject,
|
|
209
|
+
providers: [lead],
|
|
210
|
+
required: earlySandboxRequiredCapabilities(input.switches),
|
|
211
|
+
});
|
|
212
|
+
const adapter = input.adapters[lead];
|
|
213
|
+
if (!adapter) {
|
|
214
|
+
throw new EarlySandboxAdapterSelectionError(
|
|
215
|
+
`${subject}: ${lead} has no early-sandbox Adapter.`,
|
|
216
|
+
'adapter_missing',
|
|
217
|
+
);
|
|
218
|
+
}
|
|
219
|
+
return adapter;
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
/** This process's outstanding early sandboxes, over every Adapter. */
|
|
223
|
+
export function outstandingEarlySandboxes(
|
|
224
|
+
adapters: Readonly<
|
|
225
|
+
Partial<Record<RuntimeSandboxProviderId, EarlySandboxAdapter>>
|
|
226
|
+
> = EARLY_SANDBOX_ADAPTERS,
|
|
227
|
+
): number {
|
|
228
|
+
const registries = new Set(
|
|
229
|
+
Object.values(adapters).flatMap((adapter) =>
|
|
230
|
+
adapter ? [adapter.registry] : [],
|
|
231
|
+
),
|
|
232
|
+
);
|
|
233
|
+
let total = 0;
|
|
234
|
+
for (const registry of registries) total += registry.outstanding();
|
|
235
|
+
return total;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
function refuseEarlySandboxHint(input: {
|
|
239
|
+
reason: EarlySandboxHintRefusal;
|
|
240
|
+
backend: PlayRuntimeBackendId;
|
|
241
|
+
workflowId: string;
|
|
242
|
+
sandboxPlacementPolicyId: string | null;
|
|
243
|
+
outstanding?: number;
|
|
244
|
+
}): false {
|
|
245
|
+
console.error(
|
|
246
|
+
JSON.stringify({
|
|
247
|
+
event: 'play-runner.early.hint_refused',
|
|
248
|
+
reason: input.reason,
|
|
249
|
+
backend: input.backend,
|
|
250
|
+
workflowId: input.workflowId,
|
|
251
|
+
sandboxPlacementPolicyId: input.sandboxPlacementPolicyId,
|
|
252
|
+
...(input.outstanding === undefined
|
|
253
|
+
? {}
|
|
254
|
+
: {
|
|
255
|
+
outstanding: input.outstanding,
|
|
256
|
+
cap: EARLY_SANDBOX_MAX_OUTSTANDING_PER_WORKER,
|
|
257
|
+
}),
|
|
258
|
+
}),
|
|
259
|
+
);
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
|
|
104
263
|
/**
|
|
105
264
|
* The worker's early-sandbox hint handler: with E2 off for the run it does
|
|
106
|
-
* nothing (no lane read, no provider call, as before). Otherwise it
|
|
107
|
-
*
|
|
108
|
-
*
|
|
265
|
+
* nothing (no lane read, no provider call, as before). Otherwise it refuses,
|
|
266
|
+
* with one loud line each: a draining worker, a worker with no idle claim
|
|
267
|
+
* slot, a failed Adapter selection (`selectEarlySandboxAdapter`), and a
|
|
268
|
+
* worker already holding `EARLY_SANDBOX_MAX_OUTSTANDING_PER_WORKER` early
|
|
269
|
+
* sandboxes. A refused hint starts nothing; the launch creates its own.
|
|
109
270
|
*/
|
|
110
271
|
export function startWorkerLaneEarlySandbox(
|
|
111
272
|
input: EarlySandboxStartRequest & {
|
|
273
|
+
/** The hinted run's placement policy id; absent keeps the lane rule. */
|
|
274
|
+
sandboxPlacementPolicyId?: string | null;
|
|
275
|
+
/** The worker's drain and claim-slot state; absent checks neither. */
|
|
276
|
+
capacity?: EarlySandboxWorkerCapacity | null;
|
|
112
277
|
env?: Readonly<Record<string, string | undefined>>;
|
|
113
278
|
adapters?: Readonly<
|
|
114
279
|
Partial<Record<RuntimeSandboxProviderId, EarlySandboxAdapter>>
|
|
@@ -123,26 +288,53 @@ export function startWorkerLaneEarlySandbox(
|
|
|
123
288
|
const backend = normalizePlayRuntimeBackend(
|
|
124
289
|
env.DEEPLINE_PLAY_RUNNER_BACKEND?.trim() || 'daytona',
|
|
125
290
|
);
|
|
291
|
+
const sandboxPlacementPolicyId =
|
|
292
|
+
input.sandboxPlacementPolicyId?.trim() || null;
|
|
293
|
+
const hint = {
|
|
294
|
+
backend,
|
|
295
|
+
workflowId: input.workflowId,
|
|
296
|
+
sandboxPlacementPolicyId,
|
|
297
|
+
};
|
|
298
|
+
if (input.capacity?.draining) {
|
|
299
|
+
return refuseEarlySandboxHint({ ...hint, reason: 'worker_draining' });
|
|
300
|
+
}
|
|
301
|
+
if (input.capacity && !input.capacity.hasIdleSlot()) {
|
|
302
|
+
return refuseEarlySandboxHint({ ...hint, reason: 'no_idle_slot' });
|
|
303
|
+
}
|
|
126
304
|
let adapter: EarlySandboxAdapter;
|
|
127
305
|
try {
|
|
128
306
|
adapter = selectEarlySandboxAdapter({
|
|
129
307
|
backend,
|
|
130
308
|
env,
|
|
131
309
|
switches,
|
|
310
|
+
sandboxPlacementPolicyId,
|
|
132
311
|
...(input.adapters ? { adapters: input.adapters } : {}),
|
|
133
312
|
});
|
|
134
313
|
} catch (error) {
|
|
135
314
|
console.error(
|
|
136
315
|
JSON.stringify({
|
|
137
316
|
event: 'play-runner.early.selection_refused',
|
|
138
|
-
|
|
139
|
-
|
|
317
|
+
...hint,
|
|
318
|
+
reason:
|
|
319
|
+
error instanceof EarlySandboxAdapterSelectionError
|
|
320
|
+
? error.reason
|
|
321
|
+
: null,
|
|
140
322
|
errorName: error instanceof Error ? error.name : null,
|
|
141
323
|
error: error instanceof Error ? error.message : String(error),
|
|
142
324
|
}),
|
|
143
325
|
);
|
|
144
326
|
return false;
|
|
145
327
|
}
|
|
328
|
+
const outstanding = outstandingEarlySandboxes(
|
|
329
|
+
input.adapters ?? EARLY_SANDBOX_ADAPTERS,
|
|
330
|
+
);
|
|
331
|
+
if (outstanding >= EARLY_SANDBOX_MAX_OUTSTANDING_PER_WORKER) {
|
|
332
|
+
return refuseEarlySandboxHint({
|
|
333
|
+
...hint,
|
|
334
|
+
reason: 'outstanding_cap',
|
|
335
|
+
outstanding,
|
|
336
|
+
});
|
|
337
|
+
}
|
|
146
338
|
return startEarlySandbox(adapter, {
|
|
147
339
|
workflowId: input.workflowId,
|
|
148
340
|
orgId: input.orgId ?? null,
|
|
@@ -193,6 +385,8 @@ export function earlySandboxFleetSweepAdapter(input: {
|
|
|
193
385
|
provider,
|
|
194
386
|
scope: 'unadopted_early_sandboxes',
|
|
195
387
|
intervalMs: EARLY_SANDBOX_SWEEP_INTERVAL_MS,
|
|
388
|
+
// Every worker runs this pass; a deploy boots them together.
|
|
389
|
+
jitterRatio: EARLY_SANDBOX_SWEEP_JITTER_RATIO,
|
|
196
390
|
async runPass() {
|
|
197
391
|
const outcome = await input.adapter.sweepOrphansForWorker({
|
|
198
392
|
runtimeSchedulerSchema: input.runtimeSchedulerSchema,
|
package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts
CHANGED
|
@@ -194,9 +194,21 @@ export type RuntimeWorkerEarlySandboxHint = {
|
|
|
194
194
|
* resolves E2/F2 for this run. Absent: static defaults.
|
|
195
195
|
*/
|
|
196
196
|
experimentSwitchOverrides?: ExperimentSwitchOverrides;
|
|
197
|
+
/**
|
|
198
|
+
* The run's admitted placement policy id. The worker picks the early
|
|
199
|
+
* sandbox's Adapter from this policy's lead provider (Modal only) and
|
|
200
|
+
* refuses a policy its lane does not run. Absent (every writer today): the
|
|
201
|
+
* lane's own providers decide, as before. Reader-first: an older worker or
|
|
202
|
+
* gateway drops it, and its hint takes the absent path.
|
|
203
|
+
*/
|
|
204
|
+
sandboxPlacementPolicyId?: string;
|
|
197
205
|
};
|
|
198
206
|
|
|
199
|
-
|
|
207
|
+
/** Longest placement policy id a hint may carry (catalog ids are ~25). */
|
|
208
|
+
const EARLY_SANDBOX_HINT_POLICY_ID_MAX_LENGTH = 128;
|
|
209
|
+
|
|
210
|
+
/** Unknown fields are dropped, so a newer writer's additions are ignored. */
|
|
211
|
+
export function parseEarlySandboxHint(
|
|
200
212
|
text: string,
|
|
201
213
|
): RuntimeWorkerEarlySandboxHint | null {
|
|
202
214
|
try {
|
|
@@ -211,10 +223,24 @@ function parseEarlySandboxHint(
|
|
|
211
223
|
const experimentSwitchOverrides = readCarriedExperimentSwitchOverrides(
|
|
212
224
|
value.experimentSwitchOverrides,
|
|
213
225
|
);
|
|
226
|
+
// A present policy id that is not a bounded string is a malformed hint
|
|
227
|
+
// (refused with 400), never silently the absent path.
|
|
228
|
+
let sandboxPlacementPolicyId: string | undefined;
|
|
229
|
+
if (
|
|
230
|
+
value.sandboxPlacementPolicyId !== undefined &&
|
|
231
|
+
value.sandboxPlacementPolicyId !== null
|
|
232
|
+
) {
|
|
233
|
+
if (typeof value.sandboxPlacementPolicyId !== 'string') return null;
|
|
234
|
+
const trimmed = value.sandboxPlacementPolicyId.trim();
|
|
235
|
+
if (!trimmed || trimmed.length > EARLY_SANDBOX_HINT_POLICY_ID_MAX_LENGTH)
|
|
236
|
+
return null;
|
|
237
|
+
sandboxPlacementPolicyId = trimmed;
|
|
238
|
+
}
|
|
214
239
|
return {
|
|
215
240
|
workflowId,
|
|
216
241
|
orgId,
|
|
217
242
|
...(experimentSwitchOverrides ? { experimentSwitchOverrides } : {}),
|
|
243
|
+
...(sandboxPlacementPolicyId ? { sandboxPlacementPolicyId } : {}),
|
|
218
244
|
};
|
|
219
245
|
} catch {
|
|
220
246
|
return null;
|
|
@@ -232,7 +258,9 @@ export function handleRuntimeWorkerEarlySandbox(
|
|
|
232
258
|
* CA: after an accepted start, the name this worker claims under when the
|
|
233
259
|
* hint's run asked for claim affinity; null otherwise (reply unchanged).
|
|
234
260
|
*/
|
|
235
|
-
claimOwner?:
|
|
261
|
+
claimOwner?:
|
|
262
|
+
| ((hint: RuntimeWorkerEarlySandboxHint) => string | null)
|
|
263
|
+
| null;
|
|
236
264
|
},
|
|
237
265
|
): boolean {
|
|
238
266
|
if (
|
|
@@ -242,6 +242,7 @@ export const PLAY_AUTHORING_CONTRACT_ISSUE_CODES = [
|
|
|
242
242
|
'docflow_loop_incomplete',
|
|
243
243
|
'docflow_dataset_column_undrawn',
|
|
244
244
|
'docflow_undrawn_declaration_invalid',
|
|
245
|
+
'play_dataset_column_order_unknown',
|
|
245
246
|
'docflow_layout_complexity',
|
|
246
247
|
'docflow_topology_invalid',
|
|
247
248
|
'docflow_io_ambiguous',
|
|
@@ -1239,6 +1240,12 @@ export type PlayAuthoringDatasetRunOptions<InputRow extends object> = {
|
|
|
1239
1240
|
* region, or name it here. Nothing else opts a column out.
|
|
1240
1241
|
*/
|
|
1241
1242
|
undrawnColumns?: readonly string[];
|
|
1243
|
+
/**
|
|
1244
|
+
* Columns to show first on the run page, in this order. Every other column
|
|
1245
|
+
* keeps the order the run wrote it in. Display only: it changes no
|
|
1246
|
+
* execution, row identity or stored value.
|
|
1247
|
+
*/
|
|
1248
|
+
columnOrder?: readonly string[];
|
|
1242
1249
|
};
|
|
1243
1250
|
|
|
1244
1251
|
export const PLAY_AUTHORING_DATASET_RUN_OPTION_FIELDS = [
|
|
@@ -1248,6 +1255,7 @@ export const PLAY_AUTHORING_DATASET_RUN_OPTION_FIELDS = [
|
|
|
1248
1255
|
'onRowError',
|
|
1249
1256
|
'mode',
|
|
1250
1257
|
'undrawnColumns',
|
|
1258
|
+
'columnOrder',
|
|
1251
1259
|
] as const;
|
|
1252
1260
|
|
|
1253
1261
|
export type PlayAuthoringDatasetBuilder<
|
|
@@ -2785,6 +2793,27 @@ export const PLAY_AUTHORING_FIELD_REGISTRY = {
|
|
|
2785
2793
|
errorMessage:
|
|
2786
2794
|
'ctx.dataset run undrawnColumns must be a non-empty array of static column-name strings.',
|
|
2787
2795
|
},
|
|
2796
|
+
'ctx.dataset.run.columnOrder': {
|
|
2797
|
+
schema: Type.Array(Type.String({ minLength: 1 }), {
|
|
2798
|
+
minItems: 1,
|
|
2799
|
+
uniqueItems: true,
|
|
2800
|
+
}),
|
|
2801
|
+
fixtures: {
|
|
2802
|
+
valid: ['full_name', 'email'],
|
|
2803
|
+
invalid: [],
|
|
2804
|
+
absent: undefined,
|
|
2805
|
+
unresolved: { expression: 'columnOrder' },
|
|
2806
|
+
edition1: ['email'],
|
|
2807
|
+
},
|
|
2808
|
+
referenceType: 'readonly string[]',
|
|
2809
|
+
required: false,
|
|
2810
|
+
resolution: 'static-when-present',
|
|
2811
|
+
issueCode: 'play_authoring_dataset_option_invalid',
|
|
2812
|
+
description:
|
|
2813
|
+
'Columns the run page shows first, in this order; the rest keep their written order.',
|
|
2814
|
+
errorMessage:
|
|
2815
|
+
'ctx.dataset run columnOrder must be a non-empty array of distinct static column-name strings.',
|
|
2816
|
+
},
|
|
2788
2817
|
'ctx.step.id': {
|
|
2789
2818
|
schema: Type.String({ minLength: 1 }),
|
|
2790
2819
|
fixtures: {
|
|
@@ -3639,7 +3668,7 @@ export const PLAY_AUTHORING_CLOUD_TYPE_DECLARATIONS = [
|
|
|
3639
3668
|
'export type StepProgramOutput<TProgram> = TProgram extends StepProgram<unknown, infer Output, unknown> ? Output : never;',
|
|
3640
3669
|
'export type DatasetRowKey<InputRow extends object> = (keyof InputRow & string) | readonly (keyof InputRow & string)[] | ((row: InputRow, index: number) => string | number | readonly unknown[]);',
|
|
3641
3670
|
'export type DatasetDefinitionOptions<InputRow extends object> = { key?: DatasetRowKey<InputRow> };',
|
|
3642
|
-
`export type DatasetRunOptions<InputRow extends object> = { description?: ${cloudReferenceType('ctx.dataset.run.description')}; key?: DatasetRowKey<InputRow>; rowIdentity?: ${cloudReferenceType('ctx.dataset.run.rowIdentity')}; onRowError?: ${cloudReferenceType('ctx.dataset.run.onRowError')}; mode?: ${cloudReferenceType('ctx.dataset.run.mode')}; undrawnColumns?: ${cloudReferenceType('ctx.dataset.run.undrawnColumns')} };`,
|
|
3671
|
+
`export type DatasetRunOptions<InputRow extends object> = { description?: ${cloudReferenceType('ctx.dataset.run.description')}; key?: DatasetRowKey<InputRow>; rowIdentity?: ${cloudReferenceType('ctx.dataset.run.rowIdentity')}; onRowError?: ${cloudReferenceType('ctx.dataset.run.onRowError')}; mode?: ${cloudReferenceType('ctx.dataset.run.mode')}; undrawnColumns?: ${cloudReferenceType('ctx.dataset.run.undrawnColumns')}; columnOrder?: ${cloudReferenceType('ctx.dataset.run.columnOrder')} };`,
|
|
3643
3672
|
'export type DatasetBuilder<InputRow extends object, OutputRow extends object> = {',
|
|
3644
3673
|
' withColumn<Name extends string, Value>(name: Name, resolver: ColumnResolver<OutputRow, Value>): DatasetBuilder<InputRow, OutputRow & Record<Name, Value>>;',
|
|
3645
3674
|
' withColumn<Name extends string, Value>(name: Name, definition: DatasetColumnDefinition<OutputRow, Value> & { readonly runIf: (row: OutputRow, index: number) => boolean | Promise<boolean> }): DatasetBuilder<InputRow, OutputRow & Record<Name, Value | null>>;',
|
|
@@ -490,6 +490,7 @@ function truncateStaticSubstepsForStorage(
|
|
|
490
490
|
undrawnColumns: base.undrawnColumns
|
|
491
491
|
? [...base.undrawnColumns]
|
|
492
492
|
: undefined,
|
|
493
|
+
columnOrder: base.columnOrder ? [...base.columnOrder] : undefined,
|
|
493
494
|
steps: truncateStaticSubstepsForStorage(base.steps, nestedInput),
|
|
494
495
|
sheetContract: cloneStorageSafeSheetContract(base.sheetContract),
|
|
495
496
|
});
|
|
@@ -1492,6 +1493,12 @@ export type PlayStaticSubstep = PlayStaticSubstepMetadata &
|
|
|
1492
1493
|
* coverage gate reads this; nothing about execution does.
|
|
1493
1494
|
*/
|
|
1494
1495
|
undrawnColumns?: string[];
|
|
1496
|
+
/**
|
|
1497
|
+
* Columns the run page shows first, from `.run({ columnOrder: [...] })`.
|
|
1498
|
+
* `resolveSheetContractForTableNamespace` adds it to the contract the
|
|
1499
|
+
* runner reads.
|
|
1500
|
+
*/
|
|
1501
|
+
columnOrder?: string[];
|
|
1495
1502
|
description?: string;
|
|
1496
1503
|
sourceRange?: PlayStaticSourceRange;
|
|
1497
1504
|
callDepth?: number;
|
|
@@ -1902,6 +1909,15 @@ function sourceRangeKey(
|
|
|
1902
1909
|
: 'unknown';
|
|
1903
1910
|
}
|
|
1904
1911
|
|
|
1912
|
+
function withAuthoredColumnOrder(
|
|
1913
|
+
contract: PlaySheetContract,
|
|
1914
|
+
columnOrder: readonly string[] | undefined,
|
|
1915
|
+
): PlaySheetContract {
|
|
1916
|
+
return columnOrder?.length
|
|
1917
|
+
? { ...contract, columnOrder: [...columnOrder] }
|
|
1918
|
+
: contract;
|
|
1919
|
+
}
|
|
1920
|
+
|
|
1905
1921
|
export function resolveSheetContractForTableNamespace(
|
|
1906
1922
|
pipeline: PlayStaticPipeline | null | undefined,
|
|
1907
1923
|
tableNamespace: string | null | undefined,
|
|
@@ -1927,7 +1943,19 @@ export function resolveSheetContractForTableNamespace(
|
|
|
1927
1943
|
normalizeTableNamespace(rootNamespace) === normalizedNamespace &&
|
|
1928
1944
|
currentPipeline.sheetContract
|
|
1929
1945
|
) {
|
|
1930
|
-
|
|
1946
|
+
// A single-dataset Play's root shares the dataset's namespace; the
|
|
1947
|
+
// authored columnOrder still lives on that dataset step.
|
|
1948
|
+
const dataset = getCompiledPipelineSubsteps(currentPipeline).find(
|
|
1949
|
+
(substep) =>
|
|
1950
|
+
substep.type === 'dataset' &&
|
|
1951
|
+
substep.columnOrder?.length &&
|
|
1952
|
+
normalizeTableNamespace(substep.tableNamespace?.trim() ?? '') ===
|
|
1953
|
+
normalizedNamespace,
|
|
1954
|
+
);
|
|
1955
|
+
return withAuthoredColumnOrder(
|
|
1956
|
+
currentPipeline.sheetContract,
|
|
1957
|
+
dataset?.type === 'dataset' ? dataset.columnOrder : undefined,
|
|
1958
|
+
);
|
|
1931
1959
|
}
|
|
1932
1960
|
|
|
1933
1961
|
for (const substep of getCompiledPipelineSubsteps(currentPipeline)) {
|
|
@@ -1938,7 +1966,12 @@ export function resolveSheetContractForTableNamespace(
|
|
|
1938
1966
|
normalizeTableNamespace(substepNamespace) === normalizedNamespace &&
|
|
1939
1967
|
substep.sheetContract
|
|
1940
1968
|
) {
|
|
1941
|
-
|
|
1969
|
+
// The authored `.run({ columnOrder })` lives on the dataset step;
|
|
1970
|
+
// the runner reads it from the contract this returns.
|
|
1971
|
+
return withAuthoredColumnOrder(
|
|
1972
|
+
substep.sheetContract,
|
|
1973
|
+
substep.columnOrder,
|
|
1974
|
+
);
|
|
1942
1975
|
}
|
|
1943
1976
|
continue;
|
|
1944
1977
|
}
|
|
@@ -1,3 +1,27 @@
|
|
|
1
|
+
import { emailDomainCandidates } from './email-domain';
|
|
2
|
+
export { emailDomainCandidates, normalizeEmailDomain } from './email-domain';
|
|
3
|
+
import { disposableEmailBlocklistSet } from 'disposable-email-domains-js';
|
|
4
|
+
|
|
5
|
+
// Operator-reported signup-abuse domains (2026-11-18). Keep these blocked even
|
|
6
|
+
// when the upstream disposable list has not yet classified a new provider.
|
|
7
|
+
const REPORTED_ABUSIVE_SIGNUP_DOMAINS = [
|
|
8
|
+
'garodi.com',
|
|
9
|
+
'jerrsha.com',
|
|
10
|
+
'gomail.edu.pl',
|
|
11
|
+
'aabkmail.com',
|
|
12
|
+
'fbmail.com',
|
|
13
|
+
'corgd.com',
|
|
14
|
+
'jertom.com',
|
|
15
|
+
'temp-mail.lol',
|
|
16
|
+
'hidingpost.net',
|
|
17
|
+
] as const;
|
|
18
|
+
|
|
19
|
+
// Build once per module load. Authentication never needs an external lookup.
|
|
20
|
+
const DISPOSABLE_EMAIL_DOMAINS = disposableEmailBlocklistSet();
|
|
21
|
+
for (const domain of REPORTED_ABUSIVE_SIGNUP_DOMAINS) {
|
|
22
|
+
DISPOSABLE_EMAIL_DOMAINS.add(domain);
|
|
23
|
+
}
|
|
24
|
+
|
|
1
25
|
const HARDCODED_BLACKLISTED_EMAILS = [] as const;
|
|
2
26
|
const EMAIL_BLACKLIST_ENV_VAR = 'DEEPLINE_EMAIL_BLACKLIST';
|
|
3
27
|
|
|
@@ -38,5 +62,15 @@ export function isBlacklistedEmail(email?: string | null): boolean {
|
|
|
38
62
|
if (!normalized) {
|
|
39
63
|
return false;
|
|
40
64
|
}
|
|
41
|
-
return
|
|
65
|
+
return (
|
|
66
|
+
getBlacklistedEmails().has(normalized) || isDisposableEmail(normalized)
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export function isDisposableEmail(email?: string | null): boolean {
|
|
71
|
+
const normalized = normalizeEmailAddress(email);
|
|
72
|
+
if (!normalized) return false;
|
|
73
|
+
return emailDomainCandidates(normalized).some((domain) =>
|
|
74
|
+
DISPOSABLE_EMAIL_DOMAINS.has(domain),
|
|
75
|
+
);
|
|
42
76
|
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Exact DNS domain, optionally pasted as @domain. Never accepts URLs/wildcards. */
|
|
2
|
+
export function normalizeEmailDomain(value: string): string | null {
|
|
3
|
+
const domain = value.trim().toLowerCase().replace(/^@/, '');
|
|
4
|
+
if (domain.length > 253 || !/^[a-z0-9.-]+$/.test(domain)) return null;
|
|
5
|
+
const labels = domain.split('.');
|
|
6
|
+
return labels.length >= 2 &&
|
|
7
|
+
labels.every((label) =>
|
|
8
|
+
/^[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?$/.test(label),
|
|
9
|
+
)
|
|
10
|
+
? domain
|
|
11
|
+
: null;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function emailDomainCandidates(email: string): string[] {
|
|
15
|
+
const domain = normalizeEmailDomain(email.slice(email.lastIndexOf('@') + 1));
|
|
16
|
+
if (!email.includes('@') || !domain) return [];
|
|
17
|
+
const labels = domain.split('.');
|
|
18
|
+
return labels.slice(0, -1).map((_, index) => labels.slice(index).join('.'));
|
|
19
|
+
}
|
|
@@ -132,6 +132,8 @@ const PUBLIC_RESULT_TRANSFER_URL_KEYS = new Set([
|
|
|
132
132
|
'upload_url',
|
|
133
133
|
'downloadUrl',
|
|
134
134
|
'download_url',
|
|
135
|
+
'signedUrl',
|
|
136
|
+
'signed_url',
|
|
135
137
|
]);
|
|
136
138
|
const TRANSFER_SIGNING_PARAM =
|
|
137
139
|
/^(?:sig|signature|x-amz-(?:algorithm|credential|date|expires|signedheaders|signature|security-token)|x-goog-(?:algorithm|credential|date|expires|signedheaders|signature))$/i;
|
|
@@ -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-
|
|
21
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-MI7X6V6V.mjs";
|
|
18
|
+
import "./chunk-VXTTAYOT.mjs";
|
|
19
|
+
import "./chunk-6Y5TU3R7.mjs";
|
|
20
|
+
import "./chunk-RO66FPTS.mjs";
|
|
21
|
+
import "./chunk-NURW5XH4.mjs";
|
|
22
22
|
import "./chunk-DLIRSHV6.mjs";
|
|
23
23
|
import "./chunk-JL2OTMSG.mjs";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-7MY7KWJS.mjs";
|
|
25
25
|
import "./chunk-WZYKRD7T.mjs";
|
|
26
26
|
import "./chunk-KRD6H754.mjs";
|
|
27
27
|
export {
|
|
@@ -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 _chunkSH32HL7Ijs = require('./chunk-SH32HL7I.js');
|
|
18
|
+
require('./chunk-H7Q5IDO3.js');
|
|
19
|
+
require('./chunk-MXQP7CXZ.js');
|
|
20
|
+
require('./chunk-4AZLGNXV.js');
|
|
21
|
+
require('./chunk-EITMD3A5.js');
|
|
22
|
+
require('./chunk-XNYIZMNQ.js');
|
|
23
|
+
require('./chunk-BBTKAASQ.js');
|
|
24
|
+
require('./chunk-JVOUQFHT.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 = _chunkSH32HL7Ijs.EXIT_WORKSPACE_MISMATCH; exports.authStatusLine = _chunkSH32HL7Ijs.authStatusLine; exports.clearPendingClaim = _chunkSH32HL7Ijs.clearPendingClaim; exports.clearSatisfiedPendingClaim = _chunkSH32HL7Ijs.clearSatisfiedPendingClaim; exports.handleRegister = _chunkSH32HL7Ijs.handleRegister; exports.handleStatus = _chunkSH32HL7Ijs.handleStatus; exports.handleWait = _chunkSH32HL7Ijs.handleWait; exports.httpJson = _chunkSH32HL7Ijs.httpJson; exports.readPendingAuthClaim = _chunkSH32HL7Ijs.readPendingAuthClaim; exports.readStatusBanner = _chunkSH32HL7Ijs.readStatusBanner; exports.registerAuthCommands = _chunkSH32HL7Ijs.registerAuthCommands; exports.reportApprovalLinkShown = _chunkSH32HL7Ijs.reportApprovalLinkShown; exports.reportSetupCompleted = _chunkSH32HL7Ijs.reportSetupCompleted; exports.resolvePendingAuthClaimForResume = _chunkSH32HL7Ijs.resolvePendingAuthClaimForResume; exports.statusBannerLine = _chunkSH32HL7Ijs.statusBannerLine;
|