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
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
parsePlayRunHeaderFlag,
|
|
6
6
|
parsePlayRunOptions,
|
|
7
7
|
resolvePlayRunCliOptions
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-PV7AYBKQ.mjs";
|
|
9
9
|
import {
|
|
10
10
|
TABLE_EXPORT_ERROR_COLUMN,
|
|
11
11
|
addDescribeOptions,
|
|
@@ -17,15 +17,15 @@ import {
|
|
|
17
17
|
underscoreKeysLast,
|
|
18
18
|
writeExecutionOutput,
|
|
19
19
|
writeRunDatasetCsv
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-5Y7LLRWO.mjs";
|
|
21
21
|
import {
|
|
22
22
|
registerDeprecatedSearchCommand
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-TBE2K5W4.mjs";
|
|
24
24
|
import "./chunk-5AEDYVB6.mjs";
|
|
25
25
|
import {
|
|
26
26
|
handleDeploymentGet,
|
|
27
27
|
handleDeploymentsList
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-5QYZ4MEW.mjs";
|
|
29
29
|
import {
|
|
30
30
|
buildPlayDashboardUrl
|
|
31
31
|
} from "./chunk-JVHOS3K3.mjs";
|
|
@@ -57,10 +57,10 @@ import {
|
|
|
57
57
|
import {
|
|
58
58
|
pinLocalPlayImports,
|
|
59
59
|
planLocalPlayExecution
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-FGPJXQEJ.mjs";
|
|
61
61
|
import {
|
|
62
62
|
DeeplineClient
|
|
63
|
-
} from "./chunk-
|
|
63
|
+
} from "./chunk-U23L57VU.mjs";
|
|
64
64
|
import {
|
|
65
65
|
RUN_EVENT_SEARCH_KIND_VALUES,
|
|
66
66
|
RunEventQueryInputError,
|
|
@@ -73,18 +73,20 @@ import {
|
|
|
73
73
|
normalizePlayStatus,
|
|
74
74
|
normalizeRunEventOperationRequest,
|
|
75
75
|
parseLogLevel
|
|
76
|
-
} from "./chunk-
|
|
76
|
+
} from "./chunk-PKOFEHZL.mjs";
|
|
77
77
|
import "./chunk-L2VKAASU.mjs";
|
|
78
78
|
import {
|
|
79
79
|
CSV_DATA_INPUT_KEY,
|
|
80
|
+
CliPlayAdmissionCallerIntentV2UnsupportedError,
|
|
80
81
|
CliPlayAdmissionUnsupportedError,
|
|
81
82
|
buildNamedPlayRunRequest,
|
|
82
83
|
decodePlayRunPublicStatus,
|
|
83
84
|
fileInputBindingsFromPlaySchema,
|
|
84
85
|
fileInputBindingsFromStaticPipeline,
|
|
86
|
+
isPlayRunPackage,
|
|
85
87
|
stageFileInputs,
|
|
86
88
|
stagedFileContentType
|
|
87
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-ONONSV2Q.mjs";
|
|
88
90
|
import {
|
|
89
91
|
CSV_HEADER_MATCHING_NOTE,
|
|
90
92
|
playInputExampleArgs
|
|
@@ -92,19 +94,19 @@ import {
|
|
|
92
94
|
import "./chunk-UBKA33KY.mjs";
|
|
93
95
|
import {
|
|
94
96
|
checkPlayRunCompatibility,
|
|
95
|
-
|
|
96
|
-
} from "./chunk-
|
|
97
|
+
usesCliPlayAdmission
|
|
98
|
+
} from "./chunk-P6KGYOCM.mjs";
|
|
97
99
|
import {
|
|
98
100
|
isCliTraceEnabled,
|
|
99
101
|
recordCliTrace,
|
|
100
102
|
resolveCliMaintenancePolicy,
|
|
101
103
|
traceCliSpan
|
|
102
|
-
} from "./chunk-
|
|
103
|
-
import "./chunk-
|
|
104
|
+
} from "./chunk-VJLL5XIP.mjs";
|
|
105
|
+
import "./chunk-TE2QT2MX.mjs";
|
|
104
106
|
import {
|
|
105
107
|
createCliProgress,
|
|
106
108
|
getActiveCliProgress
|
|
107
|
-
} from "./chunk-
|
|
109
|
+
} from "./chunk-A456YVDE.mjs";
|
|
108
110
|
import {
|
|
109
111
|
argsWantJson,
|
|
110
112
|
describeArgs,
|
|
@@ -118,17 +120,17 @@ import {
|
|
|
118
120
|
printJsonError,
|
|
119
121
|
renderCommandEnvelopeText,
|
|
120
122
|
shouldEmitJson
|
|
121
|
-
} from "./chunk-
|
|
122
|
-
import "./chunk-
|
|
123
|
+
} from "./chunk-PQHDZHZG.mjs";
|
|
124
|
+
import "./chunk-T3Q6BMVH.mjs";
|
|
123
125
|
import {
|
|
124
126
|
fetchWithDeploymentProtection
|
|
125
|
-
} from "./chunk-
|
|
127
|
+
} from "./chunk-MJ56FCYU.mjs";
|
|
126
128
|
import "./chunk-4QF2K7TM.mjs";
|
|
127
129
|
import "./chunk-DLIRSHV6.mjs";
|
|
128
130
|
import {
|
|
129
131
|
DeeplineError
|
|
130
132
|
} from "./chunk-HBL4PM5Q.mjs";
|
|
131
|
-
import "./chunk-
|
|
133
|
+
import "./chunk-5RLVCOKH.mjs";
|
|
132
134
|
import "./chunk-WZYKRD7T.mjs";
|
|
133
135
|
import {
|
|
134
136
|
__commonJS,
|
|
@@ -7154,6 +7156,24 @@ function traceCliSync(phase, fields2, run) {
|
|
|
7154
7156
|
function sleep(ms) {
|
|
7155
7157
|
return new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
7156
7158
|
}
|
|
7159
|
+
function sleepOrAbort(ms, signal) {
|
|
7160
|
+
return new Promise((resolve4) => {
|
|
7161
|
+
if (signal.aborted) {
|
|
7162
|
+
resolve4();
|
|
7163
|
+
return;
|
|
7164
|
+
}
|
|
7165
|
+
const onAbort = () => {
|
|
7166
|
+
clearTimeout(timeout);
|
|
7167
|
+
signal.removeEventListener("abort", onAbort);
|
|
7168
|
+
resolve4();
|
|
7169
|
+
};
|
|
7170
|
+
const timeout = setTimeout(() => {
|
|
7171
|
+
signal.removeEventListener("abort", onAbort);
|
|
7172
|
+
resolve4();
|
|
7173
|
+
}, ms);
|
|
7174
|
+
signal.addEventListener("abort", onAbort, { once: true });
|
|
7175
|
+
});
|
|
7176
|
+
}
|
|
7157
7177
|
function parseReferencedPlayTarget(target) {
|
|
7158
7178
|
const trimmed = target.trim();
|
|
7159
7179
|
const slashIndex = trimmed.indexOf("/");
|
|
@@ -7957,16 +7977,17 @@ var RetryablePlayStartAttemptError = class extends Error {
|
|
|
7957
7977
|
};
|
|
7958
7978
|
var PlayStartOutcomeUnknownError = class extends DeeplineError {
|
|
7959
7979
|
retryable = false;
|
|
7960
|
-
constructor(playName, cause) {
|
|
7980
|
+
constructor(playName, cause, workflowId) {
|
|
7961
7981
|
const causeMessage = cause instanceof Error ? cause.message : String(cause);
|
|
7962
|
-
const recoveryCommand = `deepline runs list --play ${shellQuote(playName)} --json`;
|
|
7982
|
+
const recoveryCommand = workflowId ? `deepline runs get ${shellQuote(workflowId)} --json` : `deepline runs list --play ${shellQuote(playName)} --json`;
|
|
7963
7983
|
super(
|
|
7964
|
-
`Play ${playName} may have started, but the CLI did not receive confirmation. Do not run it again until you inspect the original workspace with: ${recoveryCommand}`,
|
|
7984
|
+
`Play ${playName}${workflowId ? ` (${workflowId})` : ""} may have started, but the CLI did not receive confirmation. Do not run it again until you inspect the original workspace with: ${recoveryCommand}`,
|
|
7965
7985
|
cause instanceof DeeplineError ? cause.statusCode : void 0,
|
|
7966
7986
|
"PLAY_START_OUTCOME_UNKNOWN",
|
|
7967
7987
|
{
|
|
7968
7988
|
outcome: "unknown",
|
|
7969
7989
|
playName,
|
|
7990
|
+
...workflowId ? { runId: workflowId, workflowId } : {},
|
|
7970
7991
|
recoveryCommand,
|
|
7971
7992
|
recoveryScope: "same_authenticated_host_and_workspace",
|
|
7972
7993
|
causeMessage
|
|
@@ -8516,6 +8537,7 @@ function assertPlayWaitNotTimedOut(input) {
|
|
|
8516
8537
|
}
|
|
8517
8538
|
}
|
|
8518
8539
|
var RUN_WATCH_RETRY_INTERVAL_MS = 2e3;
|
|
8540
|
+
var RUN_WATCH_ADMISSION_VISIBILITY_RETRY_INTERVAL_MS = 500;
|
|
8519
8541
|
function isAdmittedRunVisibilityDelay(error) {
|
|
8520
8542
|
return error instanceof DeeplineError && error.statusCode === 404 && error.message.trim() === "Workflow run not found.";
|
|
8521
8543
|
}
|
|
@@ -8638,6 +8660,7 @@ async function waitForPlayCompletionByWatch(input) {
|
|
|
8638
8660
|
};
|
|
8639
8661
|
try {
|
|
8640
8662
|
for (; ; ) {
|
|
8663
|
+
let admittedRunNotVisible = false;
|
|
8641
8664
|
try {
|
|
8642
8665
|
let terminalFromWatch = null;
|
|
8643
8666
|
for await (const event of input.client.watchRunEvents(
|
|
@@ -8674,26 +8697,30 @@ async function waitForPlayCompletionByWatch(input) {
|
|
|
8674
8697
|
}
|
|
8675
8698
|
}
|
|
8676
8699
|
)) {
|
|
8677
|
-
const
|
|
8678
|
-
if (
|
|
8700
|
+
const terminal2 = await handleLiveEvent(event);
|
|
8701
|
+
if (terminal2) terminalFromWatch = terminal2;
|
|
8679
8702
|
}
|
|
8680
8703
|
if (terminalFromWatch) return terminalFromWatch;
|
|
8681
8704
|
} catch (error) {
|
|
8682
8705
|
if (timedOut || controller.signal.aborted) break;
|
|
8683
8706
|
if (!isAdmittedRunVisibilityDelay(error)) throw error;
|
|
8707
|
+
admittedRunNotVisible = true;
|
|
8684
8708
|
if (!visibilityNoticeSent && !input.jsonOutput) {
|
|
8685
8709
|
input.progress.writeLine(
|
|
8686
|
-
`[play watch] run is accepted and waiting for its snapshot; checking again in ${
|
|
8710
|
+
`[play watch] run is accepted and waiting for its snapshot; checking again in ${RUN_WATCH_ADMISSION_VISIBILITY_RETRY_INTERVAL_MS / 1e3}s`
|
|
8687
8711
|
);
|
|
8688
8712
|
visibilityNoticeSent = true;
|
|
8689
8713
|
}
|
|
8690
8714
|
}
|
|
8691
|
-
|
|
8692
|
-
|
|
8715
|
+
if (!admittedRunNotVisible) {
|
|
8716
|
+
const terminal2 = await fetchTerminalStatus();
|
|
8717
|
+
if (terminal2) return terminal2;
|
|
8718
|
+
}
|
|
8693
8719
|
assertPlayWaitNotTimedOut({ ...input, lastPhase });
|
|
8694
8720
|
const nextWait = remainingWaitMs();
|
|
8721
|
+
const retryIntervalMs = admittedRunNotVisible ? RUN_WATCH_ADMISSION_VISIBILITY_RETRY_INTERVAL_MS : RUN_WATCH_RETRY_INTERVAL_MS;
|
|
8695
8722
|
await sleep(
|
|
8696
|
-
nextWait === null ?
|
|
8723
|
+
nextWait === null ? retryIntervalMs : Math.min(retryIntervalMs, Math.max(1, nextWait))
|
|
8697
8724
|
);
|
|
8698
8725
|
}
|
|
8699
8726
|
const terminal = await fetchTerminalStatus();
|
|
@@ -8711,6 +8738,7 @@ async function waitForPlayCompletionByWatch(input) {
|
|
|
8711
8738
|
}
|
|
8712
8739
|
async function startAndWaitForPlayCompletion(input) {
|
|
8713
8740
|
const startedAt = Date.now();
|
|
8741
|
+
const remainingWaitMs = () => input.waitTimeoutMs === null ? null : input.waitTimeoutMs - (Date.now() - startedAt);
|
|
8714
8742
|
const controller = new AbortController();
|
|
8715
8743
|
let timedOut = false;
|
|
8716
8744
|
const timeout = input.waitTimeoutMs === null ? null : setTimeout(
|
|
@@ -8721,32 +8749,152 @@ async function startAndWaitForPlayCompletion(input) {
|
|
|
8721
8749
|
Math.max(1, input.waitTimeoutMs)
|
|
8722
8750
|
);
|
|
8723
8751
|
let started;
|
|
8752
|
+
let knownWorkflowId = null;
|
|
8724
8753
|
let inlineCompatibility = input.cliAdmission === true;
|
|
8725
8754
|
const request = input.request;
|
|
8755
|
+
const callerIntentV2 = input.cliAdmission === true && input.disableCallerIntentV2 !== true && !input.onSubmission && request.maxTotalCredits === void 0;
|
|
8726
8756
|
try {
|
|
8727
|
-
|
|
8728
|
-
|
|
8757
|
+
if (input.cliAdmission) {
|
|
8758
|
+
const prepared = await input.client.preparePlayRunAdmission(request, {
|
|
8759
|
+
cliAdmission: true,
|
|
8760
|
+
callerIntentV2,
|
|
8729
8761
|
signal: controller.signal,
|
|
8730
|
-
onSubmission: input.onSubmission
|
|
8731
|
-
...input.cliAdmission ? { cliAdmission: true } : {}
|
|
8762
|
+
onSubmission: input.onSubmission
|
|
8732
8763
|
});
|
|
8733
|
-
|
|
8734
|
-
|
|
8735
|
-
|
|
8736
|
-
|
|
8737
|
-
|
|
8738
|
-
)
|
|
8739
|
-
|
|
8740
|
-
|
|
8741
|
-
|
|
8764
|
+
knownWorkflowId = prepared.workflowId ?? null;
|
|
8765
|
+
let useCliAdmission = true;
|
|
8766
|
+
let attempt = 0;
|
|
8767
|
+
let startAttempt = 0;
|
|
8768
|
+
const retryDelays = prepared.supportsCallerIntent ? PLAY_START_TRANSIENT_RETRY_DELAYS_MS : [];
|
|
8769
|
+
for (; ; ) {
|
|
8770
|
+
const currentAttempt = ++startAttempt;
|
|
8771
|
+
const postStartedAt = Date.now();
|
|
8772
|
+
try {
|
|
8773
|
+
started = await prepared.start({
|
|
8774
|
+
signal: controller.signal,
|
|
8775
|
+
cliAdmission: useCliAdmission
|
|
8776
|
+
});
|
|
8777
|
+
recordCliTrace({
|
|
8778
|
+
phase: "cli.play_start_admission_attempt",
|
|
8779
|
+
ms: Date.now() - postStartedAt,
|
|
8780
|
+
ok: true,
|
|
8781
|
+
playName: input.playName,
|
|
8782
|
+
workflowId: started.workflowId,
|
|
8783
|
+
attempt: currentAttempt,
|
|
8784
|
+
transport: "json",
|
|
8785
|
+
cliAdmission: useCliAdmission
|
|
8786
|
+
});
|
|
8787
|
+
break;
|
|
8788
|
+
} catch (error) {
|
|
8789
|
+
recordCliTrace({
|
|
8790
|
+
phase: "cli.play_start_admission_attempt",
|
|
8791
|
+
ms: Date.now() - postStartedAt,
|
|
8792
|
+
ok: false,
|
|
8793
|
+
playName: input.playName,
|
|
8794
|
+
attempt: currentAttempt,
|
|
8795
|
+
transport: "json",
|
|
8796
|
+
cliAdmission: useCliAdmission,
|
|
8797
|
+
reason: error instanceof Error ? error.message : String(error)
|
|
8798
|
+
});
|
|
8799
|
+
if (timedOut || controller.signal.aborted) {
|
|
8800
|
+
assertPlayWaitNotTimedOut({
|
|
8801
|
+
workflowId: prepared.workflowId ?? "",
|
|
8802
|
+
startedAt,
|
|
8803
|
+
waitTimeoutMs: input.waitTimeoutMs
|
|
8804
|
+
});
|
|
8805
|
+
throw new PlayStartOutcomeUnknownError(
|
|
8806
|
+
input.playName,
|
|
8807
|
+
error,
|
|
8808
|
+
prepared.workflowId
|
|
8809
|
+
);
|
|
8810
|
+
}
|
|
8811
|
+
if (callerIntentV2 && error instanceof CliPlayAdmissionCallerIntentV2UnsupportedError) {
|
|
8812
|
+
if (currentAttempt > 1) {
|
|
8813
|
+
throw new PlayStartOutcomeUnknownError(
|
|
8814
|
+
input.playName,
|
|
8815
|
+
error,
|
|
8816
|
+
prepared.workflowId
|
|
8817
|
+
);
|
|
8818
|
+
}
|
|
8819
|
+
const remaining = remainingWaitMs();
|
|
8820
|
+
assertPlayWaitNotTimedOut({
|
|
8821
|
+
workflowId: "",
|
|
8822
|
+
startedAt,
|
|
8823
|
+
waitTimeoutMs: input.waitTimeoutMs
|
|
8824
|
+
});
|
|
8825
|
+
if (timeout) clearTimeout(timeout);
|
|
8826
|
+
return await startAndWaitForPlayCompletion({
|
|
8827
|
+
...input,
|
|
8828
|
+
disableCallerIntentV2: true,
|
|
8829
|
+
waitTimeoutMs: remaining === null ? null : Math.max(1, remaining)
|
|
8830
|
+
});
|
|
8831
|
+
}
|
|
8832
|
+
if (useCliAdmission && error instanceof CliPlayAdmissionUnsupportedError) {
|
|
8833
|
+
if (currentAttempt > 1) {
|
|
8834
|
+
throw new PlayStartOutcomeUnknownError(
|
|
8835
|
+
input.playName,
|
|
8836
|
+
error,
|
|
8837
|
+
prepared.workflowId
|
|
8838
|
+
);
|
|
8839
|
+
}
|
|
8840
|
+
await checkPlayRunCompatibility(
|
|
8841
|
+
input.client.baseUrl,
|
|
8842
|
+
input.maintenancePolicy
|
|
8843
|
+
);
|
|
8844
|
+
controller.signal.throwIfAborted();
|
|
8845
|
+
useCliAdmission = false;
|
|
8846
|
+
inlineCompatibility = false;
|
|
8847
|
+
continue;
|
|
8848
|
+
}
|
|
8849
|
+
const retryDelayMs = retryDelays[attempt];
|
|
8850
|
+
if (retryDelayMs === void 0 || !isAmbiguousPlayStartOutcomeError(error)) {
|
|
8851
|
+
throw error;
|
|
8852
|
+
}
|
|
8853
|
+
if (!input.jsonOutput) {
|
|
8854
|
+
input.progress.writeLine(
|
|
8855
|
+
`[play start] response was ambiguous; retrying the same caller intent (${error instanceof Error ? error.message : String(error)})`
|
|
8856
|
+
);
|
|
8857
|
+
}
|
|
8858
|
+
recordCliTrace({
|
|
8859
|
+
phase: "cli.play_start_json_retry",
|
|
8860
|
+
ms: 0,
|
|
8861
|
+
ok: true,
|
|
8862
|
+
playName: input.playName,
|
|
8863
|
+
attempt: attempt + 1,
|
|
8864
|
+
reason: error instanceof Error ? error.message : String(error),
|
|
8865
|
+
recovery: "same_caller_intent"
|
|
8866
|
+
});
|
|
8867
|
+
await sleepOrAbort(retryDelayMs, controller.signal);
|
|
8868
|
+
if (timedOut || controller.signal.aborted) {
|
|
8869
|
+
assertPlayWaitNotTimedOut({
|
|
8870
|
+
workflowId: prepared.workflowId ?? "",
|
|
8871
|
+
startedAt,
|
|
8872
|
+
waitTimeoutMs: input.waitTimeoutMs
|
|
8873
|
+
});
|
|
8874
|
+
}
|
|
8875
|
+
attempt += 1;
|
|
8876
|
+
}
|
|
8877
|
+
}
|
|
8878
|
+
} else {
|
|
8879
|
+
const prepared = input.preparedAdmission ?? await input.client.preparePlayRunAdmission(request, {
|
|
8880
|
+
...input.onSubmission ? { onSubmission: input.onSubmission } : {},
|
|
8881
|
+
signal: controller.signal
|
|
8882
|
+
});
|
|
8883
|
+
knownWorkflowId = prepared.workflowId ?? null;
|
|
8884
|
+
assertPlayWaitNotTimedOut({
|
|
8885
|
+
workflowId: prepared.workflowId ?? "",
|
|
8886
|
+
startedAt,
|
|
8887
|
+
waitTimeoutMs: input.waitTimeoutMs
|
|
8888
|
+
});
|
|
8889
|
+
started = await prepared.start({
|
|
8742
8890
|
signal: controller.signal,
|
|
8743
|
-
|
|
8891
|
+
cliAdmission: false
|
|
8744
8892
|
});
|
|
8745
8893
|
}
|
|
8746
8894
|
} catch (error) {
|
|
8747
8895
|
if (timedOut) {
|
|
8748
8896
|
assertPlayWaitNotTimedOut({
|
|
8749
|
-
workflowId: "",
|
|
8897
|
+
workflowId: knownWorkflowId ?? "",
|
|
8750
8898
|
startedAt,
|
|
8751
8899
|
waitTimeoutMs: input.waitTimeoutMs
|
|
8752
8900
|
});
|
|
@@ -8786,6 +8934,7 @@ async function startAndWaitForPlayCompletion(input) {
|
|
|
8786
8934
|
ok: true,
|
|
8787
8935
|
playName: input.playName,
|
|
8788
8936
|
workflowId,
|
|
8937
|
+
transport: "json",
|
|
8789
8938
|
inlineCompatibility
|
|
8790
8939
|
});
|
|
8791
8940
|
const initialTerminal = readRecord(started.finalStatus);
|
|
@@ -8837,78 +8986,139 @@ async function startAndWaitForPlayCompletion(input) {
|
|
|
8837
8986
|
}
|
|
8838
8987
|
async function startAndWaitForPlayCompletionByStream(input) {
|
|
8839
8988
|
const admissionStartedAt = Date.now();
|
|
8840
|
-
const
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8989
|
+
const admissionDeadlineAt = input.waitTimeoutMs === null ? void 0 : admissionStartedAt + input.waitTimeoutMs;
|
|
8990
|
+
const admissionDeadline = new AbortController();
|
|
8991
|
+
let admissionTimedOut = false;
|
|
8992
|
+
const admissionTimeout = input.waitTimeoutMs === null ? null : setTimeout(
|
|
8993
|
+
() => {
|
|
8994
|
+
admissionTimedOut = true;
|
|
8995
|
+
admissionDeadline.abort();
|
|
8996
|
+
input.cancelAdmissionCapability?.();
|
|
8844
8997
|
},
|
|
8845
|
-
|
|
8846
|
-
cliAdmission: input.cliAdmission,
|
|
8847
|
-
onSubmission: input.onSubmission,
|
|
8848
|
-
...input.admissionCapability ? { admissionCapability: input.admissionCapability } : {}
|
|
8849
|
-
}
|
|
8998
|
+
Math.max(1, input.waitTimeoutMs)
|
|
8850
8999
|
);
|
|
8851
|
-
|
|
8852
|
-
|
|
8853
|
-
|
|
8854
|
-
|
|
8855
|
-
|
|
8856
|
-
|
|
8857
|
-
|
|
8858
|
-
|
|
8859
|
-
|
|
9000
|
+
let prepared;
|
|
9001
|
+
try {
|
|
9002
|
+
const callerIntentV2 = input.cliAdmission === true && input.disableCallerIntentV2 !== true && !input.admissionCapability && !input.onSubmission && input.request.maxTotalCredits === void 0;
|
|
9003
|
+
prepared = await input.client.preparePlayRunAdmission(
|
|
9004
|
+
{
|
|
9005
|
+
...input.request,
|
|
9006
|
+
...input.jsonOutput && input.fullJson === true ? { terminalStatus: "full" } : {}
|
|
9007
|
+
},
|
|
9008
|
+
{
|
|
9009
|
+
cliAdmission: input.cliAdmission,
|
|
9010
|
+
callerIntentV2,
|
|
9011
|
+
onSubmission: input.onSubmission,
|
|
9012
|
+
signal: admissionDeadline.signal,
|
|
9013
|
+
...admissionDeadlineAt === void 0 ? {} : { deadlineAt: admissionDeadlineAt },
|
|
9014
|
+
...input.admissionCapability ? { admissionCapability: input.admissionCapability } : {}
|
|
9015
|
+
}
|
|
9016
|
+
);
|
|
8860
9017
|
assertPlayWaitNotTimedOut({
|
|
8861
9018
|
workflowId: prepared.workflowId ?? "",
|
|
8862
9019
|
startedAt: admissionStartedAt,
|
|
8863
9020
|
waitTimeoutMs: input.waitTimeoutMs
|
|
8864
9021
|
});
|
|
8865
|
-
|
|
8866
|
-
|
|
8867
|
-
|
|
8868
|
-
|
|
8869
|
-
|
|
8870
|
-
|
|
8871
|
-
|
|
8872
|
-
|
|
8873
|
-
|
|
8874
|
-
|
|
8875
|
-
|
|
8876
|
-
|
|
8877
|
-
|
|
8878
|
-
|
|
8879
|
-
|
|
8880
|
-
|
|
9022
|
+
const remainingWaitTimeout = () => input.waitTimeoutMs === null ? null : Math.max(1, input.waitTimeoutMs - (Date.now() - admissionStartedAt));
|
|
9023
|
+
const pinnedInput = {
|
|
9024
|
+
...input,
|
|
9025
|
+
request: prepared.body,
|
|
9026
|
+
startStream: prepared.startStream,
|
|
9027
|
+
supportsCallerIntent: prepared.supportsCallerIntent
|
|
9028
|
+
};
|
|
9029
|
+
const retryDelays = prepared.supportsCallerIntent ? PLAY_START_TRANSIENT_RETRY_DELAYS_MS : [];
|
|
9030
|
+
for (let attempt = 0; attempt <= retryDelays.length; attempt += 1) {
|
|
9031
|
+
assertPlayWaitNotTimedOut({
|
|
9032
|
+
workflowId: prepared.workflowId ?? "",
|
|
9033
|
+
startedAt: admissionStartedAt,
|
|
9034
|
+
waitTimeoutMs: input.waitTimeoutMs
|
|
9035
|
+
});
|
|
9036
|
+
let status;
|
|
9037
|
+
try {
|
|
9038
|
+
const notice = { value: null };
|
|
9039
|
+
status = withRateLimitedNotice(
|
|
9040
|
+
await startAndWaitForPlayCompletionByStreamOnce({
|
|
9041
|
+
...pinnedInput,
|
|
9042
|
+
waitTimeoutMs: remainingWaitTimeout(),
|
|
9043
|
+
rateLimitedNotice: notice
|
|
9044
|
+
}),
|
|
9045
|
+
notice.value
|
|
8881
9046
|
);
|
|
8882
|
-
|
|
8883
|
-
|
|
8884
|
-
|
|
8885
|
-
|
|
8886
|
-
|
|
8887
|
-
|
|
8888
|
-
|
|
8889
|
-
|
|
8890
|
-
|
|
8891
|
-
|
|
8892
|
-
|
|
8893
|
-
|
|
8894
|
-
|
|
9047
|
+
} catch (error) {
|
|
9048
|
+
if (callerIntentV2 && error instanceof CliPlayAdmissionCallerIntentV2UnsupportedError) {
|
|
9049
|
+
const remaining = input.waitTimeoutMs === null ? null : input.waitTimeoutMs - (Date.now() - admissionStartedAt);
|
|
9050
|
+
assertPlayWaitNotTimedOut({
|
|
9051
|
+
workflowId: "",
|
|
9052
|
+
startedAt: admissionStartedAt,
|
|
9053
|
+
waitTimeoutMs: input.waitTimeoutMs
|
|
9054
|
+
});
|
|
9055
|
+
return startAndWaitForPlayCompletionByStream({
|
|
9056
|
+
...input,
|
|
9057
|
+
disableCallerIntentV2: true,
|
|
9058
|
+
waitTimeoutMs: remaining === null ? null : Math.max(1, remaining)
|
|
9059
|
+
});
|
|
9060
|
+
}
|
|
9061
|
+
if (error instanceof CliPlayAdmissionUnsupportedError && input.cliAdmission) {
|
|
9062
|
+
await checkPlayRunCompatibility(
|
|
9063
|
+
input.client.baseUrl,
|
|
9064
|
+
input.maintenancePolicy,
|
|
9065
|
+
admissionDeadline.signal
|
|
9066
|
+
);
|
|
9067
|
+
admissionDeadline.signal.throwIfAborted();
|
|
9068
|
+
assertPlayWaitNotTimedOut({
|
|
9069
|
+
workflowId: prepared.workflowId ?? "",
|
|
9070
|
+
startedAt: admissionStartedAt,
|
|
9071
|
+
waitTimeoutMs: input.waitTimeoutMs
|
|
9072
|
+
});
|
|
9073
|
+
return startAndWaitForPlayCompletion({
|
|
9074
|
+
...input,
|
|
9075
|
+
// The stream preparation already persisted this caller intent. Keep
|
|
9076
|
+
// its identity and do not write the submission journal a second time
|
|
9077
|
+
// while switching to the canonical JSON endpoint.
|
|
9078
|
+
request: pinnedInput.request,
|
|
9079
|
+
onSubmission: void 0,
|
|
9080
|
+
preparedAdmission: prepared,
|
|
9081
|
+
cliAdmission: false,
|
|
9082
|
+
streamTerminalWindowMs: void 0,
|
|
9083
|
+
waitTimeoutMs: remainingWaitTimeout()
|
|
9084
|
+
});
|
|
9085
|
+
}
|
|
9086
|
+
if (!(error instanceof RetryablePlayStartAttemptError)) throw error;
|
|
9087
|
+
const retryDelayMs2 = retryDelays[attempt];
|
|
9088
|
+
if (retryDelayMs2 === void 0) {
|
|
9089
|
+
throw new DeeplineError(
|
|
9090
|
+
`Play ${input.playName} did not start after retrying transient start failures.`,
|
|
9091
|
+
void 0,
|
|
9092
|
+
"PLAY_START_RETRY_EXHAUSTED",
|
|
9093
|
+
{
|
|
9094
|
+
causeMessage: error.originalError instanceof Error ? error.originalError.message : String(error.originalError)
|
|
9095
|
+
}
|
|
9096
|
+
);
|
|
9097
|
+
}
|
|
9098
|
+
if (!input.jsonOutput) {
|
|
9099
|
+
input.progress.writeLine(
|
|
9100
|
+
`[play watch] start response was ambiguous; retrying the same caller intent (${error.message})`
|
|
9101
|
+
);
|
|
9102
|
+
}
|
|
9103
|
+
recordCliTrace({
|
|
9104
|
+
phase: "cli.play_start_stream_retry",
|
|
9105
|
+
ms: 0,
|
|
9106
|
+
ok: true,
|
|
9107
|
+
playName: input.playName,
|
|
9108
|
+
attempt: attempt + 1,
|
|
9109
|
+
reason: error.message,
|
|
9110
|
+
recovery: "same_caller_intent"
|
|
8895
9111
|
});
|
|
9112
|
+
await sleepOrAbort(retryDelayMs2, admissionDeadline.signal);
|
|
9113
|
+
continue;
|
|
8896
9114
|
}
|
|
8897
|
-
|
|
8898
|
-
|
|
8899
|
-
|
|
8900
|
-
throw new DeeplineError(
|
|
8901
|
-
`Play ${input.playName} did not start after retrying transient start failures.`,
|
|
8902
|
-
void 0,
|
|
8903
|
-
"PLAY_START_RETRY_EXHAUSTED",
|
|
8904
|
-
{
|
|
8905
|
-
causeMessage: error.originalError instanceof Error ? error.originalError.message : String(error.originalError)
|
|
8906
|
-
}
|
|
8907
|
-
);
|
|
9115
|
+
const retryDelayMs = retryDelays[attempt];
|
|
9116
|
+
if (retryDelayMs === void 0 || !isRetryablePendingStartFailure(status)) {
|
|
9117
|
+
return status;
|
|
8908
9118
|
}
|
|
8909
9119
|
if (!input.jsonOutput) {
|
|
8910
9120
|
input.progress.writeLine(
|
|
8911
|
-
`[play watch] start
|
|
9121
|
+
`[play watch] start failed before run id with a transient error; retrying (${playStatusErrorText(status)})`
|
|
8912
9122
|
);
|
|
8913
9123
|
}
|
|
8914
9124
|
recordCliTrace({
|
|
@@ -8917,36 +9127,27 @@ async function startAndWaitForPlayCompletionByStream(input) {
|
|
|
8917
9127
|
ok: true,
|
|
8918
9128
|
playName: input.playName,
|
|
8919
9129
|
attempt: attempt + 1,
|
|
8920
|
-
reason:
|
|
8921
|
-
recovery: "same_caller_intent"
|
|
9130
|
+
reason: playStatusErrorText(status)
|
|
8922
9131
|
});
|
|
8923
|
-
await
|
|
8924
|
-
continue;
|
|
8925
|
-
}
|
|
8926
|
-
const retryDelayMs = retryDelays[attempt];
|
|
8927
|
-
if (retryDelayMs === void 0 || !isRetryablePendingStartFailure(status)) {
|
|
8928
|
-
return status;
|
|
9132
|
+
await sleepOrAbort(retryDelayMs, admissionDeadline.signal);
|
|
8929
9133
|
}
|
|
8930
|
-
|
|
8931
|
-
input.
|
|
8932
|
-
|
|
8933
|
-
|
|
9134
|
+
throw new DeeplineError(
|
|
9135
|
+
`Play ${input.playName} did not start after retrying transient start failures.`,
|
|
9136
|
+
void 0,
|
|
9137
|
+
"PLAY_START_RETRY_EXHAUSTED"
|
|
9138
|
+
);
|
|
9139
|
+
} catch (error) {
|
|
9140
|
+
if (admissionTimedOut || admissionDeadlineAt !== void 0 && Date.now() >= admissionDeadlineAt) {
|
|
9141
|
+
assertPlayWaitNotTimedOut({
|
|
9142
|
+
workflowId: prepared?.workflowId ?? "",
|
|
9143
|
+
startedAt: admissionStartedAt,
|
|
9144
|
+
waitTimeoutMs: input.waitTimeoutMs
|
|
9145
|
+
});
|
|
8934
9146
|
}
|
|
8935
|
-
|
|
8936
|
-
|
|
8937
|
-
|
|
8938
|
-
ok: true,
|
|
8939
|
-
playName: input.playName,
|
|
8940
|
-
attempt: attempt + 1,
|
|
8941
|
-
reason: playStatusErrorText(status)
|
|
8942
|
-
});
|
|
8943
|
-
await sleep(retryDelayMs);
|
|
9147
|
+
throw error;
|
|
9148
|
+
} finally {
|
|
9149
|
+
if (admissionTimeout) clearTimeout(admissionTimeout);
|
|
8944
9150
|
}
|
|
8945
|
-
throw new DeeplineError(
|
|
8946
|
-
`Play ${input.playName} did not start after retrying transient start failures.`,
|
|
8947
|
-
void 0,
|
|
8948
|
-
"PLAY_START_RETRY_EXHAUSTED"
|
|
8949
|
-
);
|
|
8950
9151
|
}
|
|
8951
9152
|
async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
8952
9153
|
const startedAt = Date.now();
|
|
@@ -9011,7 +9212,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
9011
9212
|
full: input.fullJson
|
|
9012
9213
|
});
|
|
9013
9214
|
} catch (error) {
|
|
9014
|
-
if (isTransientPlayRunReadError(error)) {
|
|
9215
|
+
if (isTransientPlayRunReadError(error) || isAdmittedRunVisibilityDelay(error)) {
|
|
9015
9216
|
return null;
|
|
9016
9217
|
}
|
|
9017
9218
|
throw error;
|
|
@@ -9149,7 +9350,26 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
9149
9350
|
const reuseFullTerminal = input.jsonOutput && input.fullJson === true && input.request.terminalStatus === "full" && expectedFullRunId !== "" && finalStatus.runId === expectedFullRunId && fullRun?.id === expectedFullRunId && finalStatus.status === "completed" && fullRun.status === "completed" && finalStatus.finalStatusView === "full" && fullPackage?.resultState === "available" && Object.hasOwn(fullPackage, "result") && completeScalarSteps && Array.isArray(fullPackage.datasets) && fullPackage.datasets.length === 0;
|
|
9150
9351
|
let fromDurableStatus = reuseFullTerminal;
|
|
9151
9352
|
let canonicalTerminal;
|
|
9152
|
-
|
|
9353
|
+
const streamedTerminalPackage = getPlayRunPackage(finalStatus);
|
|
9354
|
+
const streamedTerminalPlayRunPackage = isPlayRunPackage(
|
|
9355
|
+
streamedTerminalPackage
|
|
9356
|
+
) ? streamedTerminalPackage : null;
|
|
9357
|
+
const terminalEnvelopeIsComplete = finalStatus.status === "completed" && (event.type === "play.run.snapshot" || event.type === "play.run.final_status") && getEventPayload(event).replayed !== true && finalStatus.runId === lastKnownWorkflowId && !playRunPackageTextLedgerIncomplete(streamedTerminalPackage);
|
|
9358
|
+
if (!reuseFullTerminal && input.cliAdmission === true && terminalEnvelopeIsComplete) {
|
|
9359
|
+
const {
|
|
9360
|
+
package: untrustedTerminalPackage,
|
|
9361
|
+
...finalStatusWithoutPackage
|
|
9362
|
+
} = finalStatus;
|
|
9363
|
+
void untrustedTerminalPackage;
|
|
9364
|
+
canonicalTerminal = {
|
|
9365
|
+
...finalStatusWithoutPackage,
|
|
9366
|
+
// The explicit undefined also overrides any broader package
|
|
9367
|
+
// type contributed by the streamed event's compatibility shape.
|
|
9368
|
+
package: streamedTerminalPlayRunPackage ?? void 0,
|
|
9369
|
+
dashboardUrl,
|
|
9370
|
+
...launchedRevisionId ? { revisionId: launchedRevisionId } : {}
|
|
9371
|
+
};
|
|
9372
|
+
} else if (!reuseFullTerminal && (input.cliAdmission === true || input.request.profile === "absurd")) {
|
|
9153
9373
|
canonicalTerminal = await fetchKnownTerminalStatus();
|
|
9154
9374
|
fromDurableStatus = canonicalTerminal !== null;
|
|
9155
9375
|
} else {
|
|
@@ -12495,10 +12715,8 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
12495
12715
|
let client;
|
|
12496
12716
|
let prefetchClient;
|
|
12497
12717
|
let admissionCapability;
|
|
12498
|
-
let
|
|
12499
|
-
|
|
12500
|
-
process.argv.slice(2)
|
|
12501
|
-
);
|
|
12718
|
+
let cancelAdmissionCapability;
|
|
12719
|
+
let cliAdmission = usesCliPlayAdmission("plays run", process.argv.slice(2));
|
|
12502
12720
|
const progress = getActiveCliProgress() ?? createCliProgress(!options.jsonOutput);
|
|
12503
12721
|
const absolutePlayPath = resolve3(options.target.path);
|
|
12504
12722
|
progress.phase("compiling play");
|
|
@@ -12514,13 +12732,17 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
12514
12732
|
console.error(error instanceof Error ? error.message : String(error));
|
|
12515
12733
|
return 1;
|
|
12516
12734
|
}
|
|
12517
|
-
if (!options.dryRun && options.watch && cliAdmission && options.maxTotalCredits === null && !inputContainsLocalFilePath(runtimeInput)) {
|
|
12735
|
+
if (!options.dryRun && options.watch && cliAdmission && Boolean(options.runIdFile) && options.maxTotalCredits === null && !inputContainsLocalFilePath(runtimeInput)) {
|
|
12518
12736
|
const clientForPrefetch = new DeeplineClient(playRunClientOptions(options));
|
|
12519
12737
|
prefetchClient = clientForPrefetch;
|
|
12738
|
+
const capabilityController = new AbortController();
|
|
12739
|
+
cancelAdmissionCapability = () => capabilityController.abort();
|
|
12520
12740
|
admissionCapability = traceCliSpan(
|
|
12521
12741
|
"cli.play_admission_capability_prefetch",
|
|
12522
12742
|
{ targetKind: "file" },
|
|
12523
|
-
() => clientForPrefetch.prefetchPlayRunAdmissionCapability(
|
|
12743
|
+
() => clientForPrefetch.prefetchPlayRunAdmissionCapability({
|
|
12744
|
+
signal: capabilityController.signal
|
|
12745
|
+
})
|
|
12524
12746
|
);
|
|
12525
12747
|
void admissionCapability.catch(() => void 0);
|
|
12526
12748
|
}
|
|
@@ -12662,7 +12884,7 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
12662
12884
|
const finalStatus = await traceCliSpan(
|
|
12663
12885
|
"cli.play_start_watch",
|
|
12664
12886
|
{ targetKind: "file", playName },
|
|
12665
|
-
() => (options.runIdFile
|
|
12887
|
+
() => (options.runIdFile ? startAndWaitForPlayCompletionByStream : startAndWaitForPlayCompletion)({
|
|
12666
12888
|
client,
|
|
12667
12889
|
request: startRequest,
|
|
12668
12890
|
playName,
|
|
@@ -12681,7 +12903,8 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
12681
12903
|
...cliAdmission ? {
|
|
12682
12904
|
cliAdmission: true,
|
|
12683
12905
|
streamTerminalWindowMs: PLAY_START_STREAM_TERMINAL_WINDOW_MS,
|
|
12684
|
-
...admissionCapability ? { admissionCapability } : {}
|
|
12906
|
+
...admissionCapability ? { admissionCapability } : {},
|
|
12907
|
+
...cancelAdmissionCapability ? { cancelAdmissionCapability } : {}
|
|
12685
12908
|
} : {}
|
|
12686
12909
|
}).catch(async (error) => {
|
|
12687
12910
|
throw await normalizePlayStartError(client, error, playName);
|
|
@@ -12772,10 +12995,7 @@ async function handleNamedRun(options, hooks) {
|
|
|
12772
12995
|
throw new Error("Expected a named play run target.");
|
|
12773
12996
|
}
|
|
12774
12997
|
const client = new DeeplineClient(playRunClientOptions(options));
|
|
12775
|
-
let cliAdmission =
|
|
12776
|
-
"plays run",
|
|
12777
|
-
process.argv.slice(2)
|
|
12778
|
-
);
|
|
12998
|
+
let cliAdmission = usesCliPlayAdmission("plays run", process.argv.slice(2));
|
|
12779
12999
|
const progress = getActiveCliProgress() ?? createCliProgress(!options.jsonOutput);
|
|
12780
13000
|
const playName = options.target.name;
|
|
12781
13001
|
const runtimeInput = options.input ? { ...options.input } : {};
|
|
@@ -12790,11 +13010,16 @@ async function handleNamedRun(options, hooks) {
|
|
|
12790
13010
|
revisionSelector: options.revisionSelector
|
|
12791
13011
|
});
|
|
12792
13012
|
let admissionCapability;
|
|
12793
|
-
|
|
13013
|
+
let cancelAdmissionCapability;
|
|
13014
|
+
if (options.watch && cliAdmission && Boolean(options.runIdFile) && options.maxTotalCredits === null && !needsPlayDefinition && !inputContainsLocalFilePath(runtimeInput)) {
|
|
13015
|
+
const capabilityController = new AbortController();
|
|
13016
|
+
cancelAdmissionCapability = () => capabilityController.abort();
|
|
12794
13017
|
admissionCapability = traceCliSpan(
|
|
12795
13018
|
"cli.play_admission_capability_prefetch",
|
|
12796
13019
|
{ targetKind: "name", playName },
|
|
12797
|
-
() => client.prefetchPlayRunAdmissionCapability(
|
|
13020
|
+
() => client.prefetchPlayRunAdmissionCapability({
|
|
13021
|
+
signal: capabilityController.signal
|
|
13022
|
+
})
|
|
12798
13023
|
);
|
|
12799
13024
|
void admissionCapability.catch(() => void 0);
|
|
12800
13025
|
}
|
|
@@ -12891,7 +13116,7 @@ async function handleNamedRun(options, hooks) {
|
|
|
12891
13116
|
const finalStatus = await traceCliSpan(
|
|
12892
13117
|
"cli.play_start_watch",
|
|
12893
13118
|
{ targetKind: "name", playName },
|
|
12894
|
-
() => (options.runIdFile
|
|
13119
|
+
() => (options.runIdFile ? startAndWaitForPlayCompletionByStream : startAndWaitForPlayCompletion)({
|
|
12895
13120
|
client,
|
|
12896
13121
|
request: startRequest,
|
|
12897
13122
|
playName,
|
|
@@ -12910,7 +13135,8 @@ async function handleNamedRun(options, hooks) {
|
|
|
12910
13135
|
...cliAdmission ? {
|
|
12911
13136
|
cliAdmission: true,
|
|
12912
13137
|
streamTerminalWindowMs: PLAY_START_STREAM_TERMINAL_WINDOW_MS,
|
|
12913
|
-
...admissionCapability ? { admissionCapability } : {}
|
|
13138
|
+
...admissionCapability ? { admissionCapability } : {},
|
|
13139
|
+
...cancelAdmissionCapability ? { cancelAdmissionCapability } : {}
|
|
12914
13140
|
} : {}
|
|
12915
13141
|
}).catch(async (error) => {
|
|
12916
13142
|
throw await normalizePlayStartError(client, error, playName, {
|
|
@@ -16351,7 +16577,7 @@ Examples:
|
|
|
16351
16577
|
process.exitCode = await ownView();
|
|
16352
16578
|
return;
|
|
16353
16579
|
}
|
|
16354
|
-
const { describeAnything } = await import("./describe-
|
|
16580
|
+
const { describeAnything } = await import("./describe-D55V42LH.mjs");
|
|
16355
16581
|
process.exitCode = await describeAnything(
|
|
16356
16582
|
name,
|
|
16357
16583
|
{
|
|
@@ -16685,7 +16911,7 @@ Examples:
|
|
|
16685
16911
|
new Option2("--log-failed", "Attach terminal-failure logs").hideHelp()
|
|
16686
16912
|
).action(async (runId, options) => {
|
|
16687
16913
|
if (TOOL_EXECUTION_ID.test(runId)) {
|
|
16688
|
-
const { getToolExecutionReceipt } = await import("./tools-
|
|
16914
|
+
const { getToolExecutionReceipt } = await import("./tools-G2YNCFNX.mjs");
|
|
16689
16915
|
process.exitCode = await getToolExecutionReceipt(runId, {
|
|
16690
16916
|
receiptJson: options.json !== void 0
|
|
16691
16917
|
});
|