deepline 0.3.408 → 0.3.410
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/agent-runtime.ts +18 -1
- package/dist/bundling-sources/sdk/src/client.ts +212 -334
- package/dist/bundling-sources/sdk/src/compat.ts +45 -2
- package/dist/bundling-sources/sdk/src/db/query.ts +9 -10
- package/dist/bundling-sources/sdk/src/http.ts +38 -20
- package/dist/bundling-sources/sdk/src/index.ts +4 -5
- package/dist/bundling-sources/sdk/src/play.ts +10 -10
- package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +6 -4
- package/dist/bundling-sources/sdk/src/plays/check-local-play-graph.ts +114 -0
- package/dist/bundling-sources/sdk/src/plays/client.ts +431 -0
- package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +2 -2
- package/dist/bundling-sources/sdk/src/plays/run-request.ts +106 -16
- package/dist/bundling-sources/sdk/src/release.ts +13 -7
- package/dist/bundling-sources/sdk/src/runs/read-errors.ts +8 -0
- package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +124 -13
- package/dist/bundling-sources/sdk/src/tool-calls.ts +108 -19
- package/dist/bundling-sources/sdk/src/types.ts +18 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/execute-retry-contract.ts +37 -0
- package/dist/bundling-sources/shared_libs/integration-contracts/package.json +3 -0
- package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/context.ts +277 -76
- package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
- package/dist/bundling-sources/shared_libs/play-runtime/dataset-row-input.ts +124 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +6 -62
- package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +1 -0
- package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +67 -0
- package/dist/bundling-sources/shared_libs/play-runtime/execute-server-timing.ts +64 -6
- package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +1 -5
- package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +1 -1
- package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +10 -0
- package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/egress-probe.ts +3 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +26 -16
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +36 -11
- package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +35 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +21 -0
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +21 -6
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +11 -2
- package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +85 -20
- package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +71 -13
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-execution-queries.ts +100 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +9 -5
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +337 -146
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +26 -12
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +3 -1
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +425 -102
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +4 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +9 -0
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +181 -124
- package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +152 -0
- package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +5 -3
- package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +31 -0
- package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +10 -0
- package/dist/bundling-sources/shared_libs/plays/ambiguous-write-error.ts +25 -0
- package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +4 -0
- package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +63 -68
- package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +129 -63
- package/dist/bundling-sources/shared_libs/plays/contracts.ts +14 -0
- package/dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts +58 -16
- package/dist/bundling-sources/shared_libs/plays/fetch-http-error.ts +50 -0
- package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +351 -0
- package/dist/bundling-sources/shared_libs/plays/tool-list-getter-mode.ts +9 -0
- package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
- package/dist/cli/{auth-UVD3CUBB.mjs → auth-LLXLIILR.mjs} +6 -6
- package/dist/cli/auth-UG4WOYGL.js +40 -0
- package/dist/cli/{billing-BZVTXXLM.mjs → billing-5FVXZYAC.mjs} +8 -8
- package/dist/cli/{billing-BZVYAF6T.js → billing-NFPK7GYP.js} +84 -84
- package/dist/cli/{chunk-ZAAKSJAS.js → chunk-27GJKC5Q.js} +17 -10
- package/dist/cli/{chunk-UHNDVD3P.js → chunk-2H4EY7KH.js} +100 -41
- package/dist/cli/{chunk-WTT6CLED.mjs → chunk-2YR7BIIC.mjs} +5 -2
- package/dist/cli/{chunk-3ZB6IIA7.js → chunk-36AHOWVS.js} +26 -26
- package/dist/cli/{chunk-OSDXE27V.mjs → chunk-4PG4ARL2.mjs} +17 -10
- package/dist/cli/{chunk-LOYISF7S.mjs → chunk-4XQLVUC7.mjs} +738 -512
- package/dist/cli/{chunk-J5PTX66Y.js → chunk-5MLCBXXU.js} +8 -1
- package/dist/cli/chunk-5TUGWDEB.js +313 -0
- package/dist/cli/{chunk-D6FFBSM5.js → chunk-5UUQAGJS.js} +5 -2
- package/dist/cli/{chunk-4CFULMRB.mjs → chunk-5V5Y37BC.mjs} +2 -2
- package/dist/cli/{chunk-PMVFAYL7.mjs → chunk-63ILLN5H.mjs} +2 -2
- package/dist/cli/{chunk-AUMD2VXP.js → chunk-63S7X326.js} +1032 -806
- package/dist/cli/{chunk-4QFT5LGV.mjs → chunk-6PGATQ6L.mjs} +6 -3
- package/dist/cli/{chunk-6BJK4EJ3.mjs → chunk-AARWVK4C.mjs} +2132 -65
- package/dist/cli/{chunk-FERRDNMO.js → chunk-AD47BXN2.js} +5 -5
- package/dist/cli/{chunk-4RNDKFNQ.js → chunk-D37FEBES.js} +2 -2
- package/dist/cli/{chunk-S6R3OX7B.js → chunk-E4CABWXL.js} +25 -2
- package/dist/cli/{chunk-NXGCO4JB.mjs → chunk-E4IXDAZI.mjs} +5 -0
- package/dist/cli/chunk-EQ4Z7RJW.mjs +35 -0
- package/dist/cli/chunk-FR2ILQ4G.mjs +8 -0
- package/dist/cli/{chunk-QUAQX3FQ.js → chunk-FVLNYDI4.js} +128 -376
- package/dist/cli/{chunk-BRJUESQV.js → chunk-FZJAM576.js} +50 -50
- package/dist/cli/{chunk-BZAMOCPA.mjs → chunk-IMZ56EOH.mjs} +3 -3
- package/dist/cli/{chunk-IOHRWLQE.mjs → chunk-IPG42SD2.mjs} +452 -138
- package/dist/cli/chunk-J33TSWO5.js +8 -0
- package/dist/cli/{chunk-XXLXOUUU.mjs → chunk-JNXJZ577.mjs} +1 -1
- package/dist/cli/{chunk-JI2B4RZP.mjs → chunk-KCC3FKIW.mjs} +71 -12
- package/dist/cli/{chunk-6IKARAYD.mjs → chunk-L2VKAASU.mjs} +23 -0
- package/dist/cli/{chunk-PYZZMAJQ.mjs → chunk-LFSHGNT2.mjs} +8 -1
- package/dist/cli/{chunk-2XXXFPTD.js → chunk-LTFL4JRN.js} +426 -721
- package/dist/cli/{chunk-YHPYUZZX.mjs → chunk-MAMVGOSC.mjs} +1 -1
- package/dist/cli/{chunk-URACNNLO.mjs → chunk-MN2OWLFA.mjs} +2 -2
- package/dist/cli/{chunk-Q3PUHXOY.js → chunk-NF4V5DTY.js} +12 -12
- package/dist/cli/{chunk-Q2E4E4FJ.js → chunk-NPBJI7RE.js} +8 -8
- package/dist/cli/chunk-NTVLGHFM.js +501 -0
- package/dist/cli/{chunk-HQXL5526.mjs → chunk-NUX2QHNC.mjs} +1 -1
- package/dist/cli/{chunk-E3PJF6YP.js → chunk-OBB4QXHA.js} +19 -4
- package/dist/cli/{chunk-SEFMGO3Z.js → chunk-OQQOXSYA.js} +2184 -117
- package/dist/cli/chunk-OZ6E3IRZ.js +6084 -0
- package/dist/cli/{chunk-7P5AA3SN.js → chunk-PPDBRJRW.js} +6 -1
- package/dist/cli/{chunk-IWBXJDZA.mjs → chunk-PZSLPBDA.mjs} +2 -2
- package/dist/cli/{chunk-ILHRA7AD.js → chunk-QADCFSGH.js} +7 -7
- package/dist/cli/{chunk-ECVLPS67.js → chunk-QJI5FIOW.js} +170 -49
- package/dist/cli/{chunk-I3DHIXVJ.mjs → chunk-QL22Y56M.mjs} +149 -28
- package/dist/cli/{chunk-SD7MXAJA.mjs → chunk-RFB25DSQ.mjs} +36 -284
- package/dist/cli/chunk-T44IIOT6.mjs +501 -0
- package/dist/cli/chunk-VK2LZ5IP.js +35 -0
- package/dist/cli/chunk-VKKVSFRD.js +62 -0
- package/dist/cli/{chunk-RWCY6YI2.js → chunk-VYKV5XHL.js} +644 -330
- package/dist/cli/{chunk-GSK6NHVM.js → chunk-WU4U6VSB.js} +5 -5
- package/dist/cli/chunk-XHLKJOTN.mjs +313 -0
- package/dist/cli/{chunk-MJELBQBU.mjs → chunk-XIHWSXSV.mjs} +330 -625
- package/dist/cli/chunk-XNZJKRJA.mjs +6084 -0
- package/dist/cli/chunk-ZCALLYF6.mjs +62 -0
- package/dist/cli/{chunk-ZBABPK6Y.js → chunk-ZFZ427HN.js} +11 -8
- package/dist/cli/{chunk-SJVVBWRL.mjs → chunk-ZKYEW55U.mjs} +16 -1
- package/dist/cli/command-docs.js +2 -2
- package/dist/cli/command-docs.mjs +1 -1
- package/dist/cli/{csv-XLGLHJ6P.js → csv-7U3FJYKZ.js} +14 -14
- package/dist/cli/{csv-WPSXG6ZZ.mjs → csv-ZWLDMM4A.mjs} +5 -5
- package/dist/cli/{db-5PTNJG4X.js → db-DNCGV5PC.js} +42 -47
- package/dist/cli/{db-ABS57ABJ.mjs → db-IMYXVMGI.mjs} +15 -20
- package/dist/cli/{describe-PVWQJ2PB.mjs → describe-Q23DWJUK.mjs} +20 -15
- package/dist/cli/{describe-EZS6PQXA.js → describe-S34JUX5W.js} +27 -22
- package/dist/cli/describe-core.d.mts +2 -2
- package/dist/cli/describe-core.d.ts +2 -2
- package/dist/cli/describe-core.js +6 -6
- package/dist/cli/describe-core.mjs +5 -5
- package/dist/cli/{executions-OKJGATQZ.mjs → executions-A73EUGSI.mjs} +8 -8
- package/dist/cli/{executions-FNTAFQ7Y.js → executions-XOMPX2YJ.js} +10 -10
- package/dist/cli/{feedback-W27HDMRR.mjs → feedback-N4GJ2POI.mjs} +11 -7
- package/dist/cli/{feedback-6YBOMSUA.js → feedback-QTCHNJJH.js} +13 -9
- package/dist/cli/{git-YOOUEL6M.mjs → git-4Q3JIQYZ.mjs} +6 -6
- package/dist/cli/git-I6CPBEVG.js +24 -0
- package/dist/cli/index.js +240 -352
- package/dist/cli/index.mjs +163 -275
- package/dist/cli/{legacy-noops-V6OKW7VR.mjs → legacy-noops-3SOVGFF7.mjs} +6 -6
- package/dist/cli/{legacy-noops-2VZ7XT6C.js → legacy-noops-4OSHZM34.js} +9 -9
- package/dist/cli/{monitors-FBWGVIUS.js → monitors-LVE2KZNG.js} +94 -94
- package/dist/cli/{monitors-P2YYWTWT.mjs → monitors-QP2XID2B.mjs} +8 -8
- package/dist/cli/{org-DVMG6H3C.mjs → org-IVRETVQA.mjs} +8 -8
- package/dist/cli/{org-3XUSVX5T.js → org-XFLK5IAP.js} +68 -68
- package/dist/cli/{play-GNC5CQAS.mjs → play-DE7VH6NU.mjs} +533 -98
- package/dist/cli/{play-YG5L4BWQ.js → play-XXTPPP23.js} +1067 -632
- package/dist/cli/{providers-7PSWG2OV.js → providers-DLD3I4JF.js} +11 -11
- package/dist/cli/{providers-JR33SLWL.mjs → providers-GX2NIZQQ.mjs} +8 -8
- package/dist/cli/{quickstart-VUOBQYIQ.mjs → quickstart-72B4L4PK.mjs} +5 -5
- package/dist/cli/{quickstart-FDVZ5BL3.js → quickstart-XNS3HSWC.js} +7 -7
- package/dist/cli/search-6NCH4HB5.js +30 -0
- package/dist/cli/{search-JZYLO33K.mjs → search-SUTRANJI.mjs} +9 -9
- package/dist/cli/{secrets-VS266FVA.js → secrets-6OBLOVEV.js} +17 -17
- package/dist/cli/{secrets-3MCYBT4I.mjs → secrets-FPFXXNUH.mjs} +8 -8
- package/dist/cli/sessions-235532DR.js +16 -0
- package/dist/cli/{sessions-ELLLT23E.mjs → sessions-R25I4QKN.mjs} +6 -6
- package/dist/cli/{settings-PZCKAFII.mjs → settings-AOP6F5PZ.mjs} +12 -12
- package/dist/cli/{settings-7364NMMA.js → settings-VL5FOFPN.js} +79 -79
- package/dist/cli/{setup-PMWYLCT6.js → setup-BSC67YT3.js} +45 -44
- package/dist/cli/{setup-A7GQ4KIA.mjs → setup-ZMPHBHVJ.mjs} +11 -10
- package/dist/cli/skills-3IWLYYRL.js +29 -0
- package/dist/cli/{skills-WS6BIFPQ.mjs → skills-KF65TVFO.mjs} +7 -7
- package/dist/cli/tools-LR66SPYU.js +44 -0
- package/dist/cli/{tools-BR4DOZA2.mjs → tools-SX4XIPM7.mjs} +19 -14
- package/dist/cli/{update-D2B7UNFT.mjs → update-QRMFRAQQ.mjs} +11 -9
- package/dist/cli/update-SP7UEO53.js +31 -0
- package/dist/cli/{workflow-PQXC2R47.mjs → workflow-FOEEEB7G.mjs} +44 -20
- package/dist/cli/{workflow-6ODTCYXU.js → workflow-KOCK2FLW.js} +54 -30
- package/dist/{client-Z9Pye1Wm.d.mts → client-74k4IPh6.d.mts} +137 -54
- package/dist/{client-BcvhDfJJ.d.ts → client-C1IK1f8c.d.ts} +137 -54
- package/dist/{compiler-manifest-Ycx-hoAr.d.mts → compiler-manifest-lzWpbV3w.d.mts} +83 -66
- package/dist/{compiler-manifest-Ycx-hoAr.d.ts → compiler-manifest-lzWpbV3w.d.ts} +83 -66
- package/dist/{index-CZXgiN3E.d.mts → index-C8Cy-YTm.d.ts} +5 -1
- package/dist/{index-NPG5pqxQ.d.ts → index-CtNK-0nI.d.mts} +5 -1
- package/dist/index.d.mts +47 -9
- package/dist/index.d.ts +47 -9
- package/dist/index.js +17 -14
- package/dist/index.mjs +13 -10
- package/dist/install-integrity.json +120 -104
- 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 +5 -4
- package/dist/plays/csv-data-input.js +3 -3
- package/dist/plays/csv-data-input.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 +11 -3
- package/dist/plays/run-request.mjs +10 -2
- package/dist/release.d.mts +15 -6
- package/dist/release.d.ts +15 -6
- package/dist/release.js +2 -2
- package/dist/release.mjs +1 -1
- package/package.json +2 -2
- package/dist/cli/auth-3GB2K636.js +0 -40
- package/dist/cli/chunk-67RWR34T.mjs +0 -155
- package/dist/cli/chunk-CLJGSOVM.mjs +0 -1716
- package/dist/cli/chunk-HQY2SG3K.js +0 -83
- package/dist/cli/chunk-OSFWFV72.js +0 -155
- package/dist/cli/chunk-Q3LFI3VH.js +0 -392
- package/dist/cli/chunk-WPAB4DCU.mjs +0 -83
- package/dist/cli/chunk-YMOFWHGO.mjs +0 -392
- package/dist/cli/chunk-Z4VNJOF7.js +0 -1716
- package/dist/cli/git-YKUXXJOR.js +0 -24
- package/dist/cli/search-PPPYC5OZ.js +0 -30
- package/dist/cli/sessions-TEHEWW7O.js +0 -16
- package/dist/cli/skills-SYS7VRRK.js +0 -29
- package/dist/cli/tools-KK4BKVQR.js +0 -39
- package/dist/cli/update-2IV5JTX2.js +0 -29
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
addDescribeOptions,
|
|
3
3
|
recordPlayTermination
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-4PG4ARL2.mjs";
|
|
5
5
|
import {
|
|
6
6
|
registerDeprecatedSearchCommand
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-XNZJKRJA.mjs";
|
|
8
8
|
import {
|
|
9
9
|
handleDeploymentGet,
|
|
10
10
|
handleDeploymentsList
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-MN2OWLFA.mjs";
|
|
12
12
|
import {
|
|
13
13
|
buildPlayDashboardUrl
|
|
14
14
|
} from "./chunk-IHG7UAHD.mjs";
|
|
@@ -23,16 +23,17 @@ import {
|
|
|
23
23
|
listPlayFileExports,
|
|
24
24
|
parsePlaySourceForAnalysis,
|
|
25
25
|
resolveEnabledExecutionProfile
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-AARWVK4C.mjs";
|
|
27
27
|
import "./chunk-H7HIDGZ7.mjs";
|
|
28
|
+
import "./chunk-FR2ILQ4G.mjs";
|
|
28
29
|
import {
|
|
29
30
|
parseCsvDataInput
|
|
30
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-NUX2QHNC.mjs";
|
|
31
32
|
import {
|
|
32
33
|
pinLocalPlayImports,
|
|
33
34
|
planLocalPlayExecution
|
|
34
35
|
} from "./chunk-ERFN2QY4.mjs";
|
|
35
|
-
import "./chunk-
|
|
36
|
+
import "./chunk-ZCALLYF6.mjs";
|
|
36
37
|
import {
|
|
37
38
|
DeeplineClient,
|
|
38
39
|
RUN_EVENT_SEARCH_KIND_VALUES,
|
|
@@ -43,12 +44,14 @@ import {
|
|
|
43
44
|
isTransientPlayRunReadError,
|
|
44
45
|
logLevelReaches,
|
|
45
46
|
logProvenanceReaches,
|
|
47
|
+
normalizePlayStatus,
|
|
46
48
|
normalizeRunEventOperationRequest,
|
|
47
49
|
parseLogLevel
|
|
48
|
-
} from "./chunk-
|
|
49
|
-
import "./chunk-
|
|
50
|
+
} from "./chunk-4XQLVUC7.mjs";
|
|
51
|
+
import "./chunk-L2VKAASU.mjs";
|
|
50
52
|
import {
|
|
51
53
|
CSV_DATA_INPUT_KEY,
|
|
54
|
+
CliPlayAdmissionUnsupportedError,
|
|
52
55
|
buildNamedPlayRunRequest,
|
|
53
56
|
decodePlayRunPublicStatus,
|
|
54
57
|
fileInputBindingsFromPlaySchema,
|
|
@@ -56,20 +59,26 @@ import {
|
|
|
56
59
|
setDottedInputValue,
|
|
57
60
|
stageFileInputs,
|
|
58
61
|
stagedFileContentType
|
|
59
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-KCC3FKIW.mjs";
|
|
60
63
|
import {
|
|
61
64
|
CSV_HEADER_MATCHING_NOTE,
|
|
62
65
|
playInputExampleArgs
|
|
63
66
|
} from "./chunk-EIMG75BT.mjs";
|
|
64
67
|
import "./chunk-UBKA33KY.mjs";
|
|
65
68
|
import {
|
|
69
|
+
checkPlayRunCompatibility,
|
|
70
|
+
usesInlinePlayAdmission
|
|
71
|
+
} from "./chunk-EQ4Z7RJW.mjs";
|
|
72
|
+
import {
|
|
73
|
+
isCliTraceEnabled,
|
|
66
74
|
recordCliTrace,
|
|
75
|
+
resolveCliMaintenancePolicy,
|
|
67
76
|
traceCliSpan
|
|
68
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-ZKYEW55U.mjs";
|
|
69
78
|
import {
|
|
70
79
|
createCliProgress,
|
|
71
80
|
getActiveCliProgress
|
|
72
|
-
} from "./chunk-
|
|
81
|
+
} from "./chunk-XIHWSXSV.mjs";
|
|
73
82
|
import {
|
|
74
83
|
argsWantJson,
|
|
75
84
|
csvSafeJsonString,
|
|
@@ -84,16 +93,16 @@ import {
|
|
|
84
93
|
printJsonError,
|
|
85
94
|
renderCommandEnvelopeText,
|
|
86
95
|
shouldEmitJson
|
|
87
|
-
} from "./chunk-
|
|
96
|
+
} from "./chunk-5V5Y37BC.mjs";
|
|
88
97
|
import {
|
|
89
98
|
fetchWithDeploymentProtection
|
|
90
|
-
} from "./chunk-
|
|
91
|
-
import "./chunk-
|
|
99
|
+
} from "./chunk-RFB25DSQ.mjs";
|
|
100
|
+
import "./chunk-MAMVGOSC.mjs";
|
|
92
101
|
import "./chunk-DLIRSHV6.mjs";
|
|
93
102
|
import {
|
|
94
103
|
DeeplineError
|
|
95
|
-
} from "./chunk-
|
|
96
|
-
import "./chunk-
|
|
104
|
+
} from "./chunk-E4IXDAZI.mjs";
|
|
105
|
+
import "./chunk-2YR7BIIC.mjs";
|
|
97
106
|
import "./chunk-WZYKRD7T.mjs";
|
|
98
107
|
import {
|
|
99
108
|
__commonJS,
|
|
@@ -7886,7 +7895,7 @@ function parsePlayRunOptions(args, initialInput = null) {
|
|
|
7886
7895
|
headers
|
|
7887
7896
|
};
|
|
7888
7897
|
}
|
|
7889
|
-
function resolvePlayRunCliOptions(target, options, inputArgs = []) {
|
|
7898
|
+
function resolvePlayRunCliOptions(target, options, inputArgs = [], maintenancePolicy) {
|
|
7890
7899
|
const stringOption = (value, flag) => {
|
|
7891
7900
|
if (value !== void 0 && !value.trim())
|
|
7892
7901
|
throw new Error(`${flag} requires a non-empty value.`);
|
|
@@ -7998,6 +8007,7 @@ function resolvePlayRunCliOptions(target, options, inputArgs = []) {
|
|
|
7998
8007
|
);
|
|
7999
8008
|
return {
|
|
8000
8009
|
...base,
|
|
8010
|
+
...maintenancePolicy ? { maintenancePolicy } : {},
|
|
8001
8011
|
target: resolvedTarget,
|
|
8002
8012
|
dryRun,
|
|
8003
8013
|
input: base.input,
|
|
@@ -8036,6 +8046,79 @@ function playAuthoringGraphPath(parent, filePath) {
|
|
|
8036
8046
|
).replaceAll("\\", "/");
|
|
8037
8047
|
}
|
|
8038
8048
|
|
|
8049
|
+
// src/plays/check-local-play-graph.ts
|
|
8050
|
+
async function checkLocalPlayGraph(input) {
|
|
8051
|
+
const { client, graph } = input;
|
|
8052
|
+
const nodesByPath = new Map(
|
|
8053
|
+
[...graph.nodes.values()].map((node) => [node.filePath, node])
|
|
8054
|
+
);
|
|
8055
|
+
const importedPlaysFor = (node) => {
|
|
8056
|
+
const imported = /* @__PURE__ */ new Set();
|
|
8057
|
+
const collect = (parent) => {
|
|
8058
|
+
for (const dependency of parent.importedPlayDependencies) {
|
|
8059
|
+
if (imported.has(dependency.filePath)) continue;
|
|
8060
|
+
const child = nodesByPath.get(dependency.filePath);
|
|
8061
|
+
if (!child)
|
|
8062
|
+
throw new Error(
|
|
8063
|
+
`Missing bundled Play dependency ${dependency.filePath}.`
|
|
8064
|
+
);
|
|
8065
|
+
imported.add(dependency.filePath);
|
|
8066
|
+
collect(child);
|
|
8067
|
+
}
|
|
8068
|
+
};
|
|
8069
|
+
collect(node);
|
|
8070
|
+
return [...imported].map((filePath) => {
|
|
8071
|
+
const child = nodesByPath.get(filePath);
|
|
8072
|
+
return {
|
|
8073
|
+
playName: child.playName,
|
|
8074
|
+
sourceCode: child.sourceCode,
|
|
8075
|
+
sourcePath: playAuthoringGraphPath(node, child.filePath)
|
|
8076
|
+
};
|
|
8077
|
+
});
|
|
8078
|
+
};
|
|
8079
|
+
const checkNode = (node) => {
|
|
8080
|
+
const name = node.playName ?? (node === graph.root ? input.rootPlayName : null);
|
|
8081
|
+
if (!name)
|
|
8082
|
+
throw new Error(`Bundled Play ${node.filePath} has no declared name.`);
|
|
8083
|
+
const importedPlays = importedPlaysFor(node);
|
|
8084
|
+
const exportName = node === graph.root ? input.exportName : node.artifact.exportName ?? "default";
|
|
8085
|
+
return client.checkPlayArtifact({
|
|
8086
|
+
name,
|
|
8087
|
+
sourceCode: node.sourceCode,
|
|
8088
|
+
sourceFiles: node.sourceFiles,
|
|
8089
|
+
description: node.playDescription ?? void 0,
|
|
8090
|
+
artifact: input.prepareArtifact?.(node.artifact) ?? node.artifact,
|
|
8091
|
+
...exportName === "default" ? {} : { exportName },
|
|
8092
|
+
...importedPlays.length ? { importedPlays } : {},
|
|
8093
|
+
...input.integrationMode ? { integrationMode: input.integrationMode } : {}
|
|
8094
|
+
});
|
|
8095
|
+
};
|
|
8096
|
+
if ([...graph.nodes.values()].some(
|
|
8097
|
+
(node) => (node.artifact.compatibility.authoringContractEdition ?? 1) >= 10
|
|
8098
|
+
)) {
|
|
8099
|
+
const checked = /* @__PURE__ */ new Set();
|
|
8100
|
+
const checkChildren = async (node) => {
|
|
8101
|
+
if (checked.has(node.filePath)) return null;
|
|
8102
|
+
checked.add(node.filePath);
|
|
8103
|
+
for (const dependency of node.importedPlayDependencies) {
|
|
8104
|
+
const child = nodesByPath.get(dependency.filePath);
|
|
8105
|
+
if (!child)
|
|
8106
|
+
throw new Error(
|
|
8107
|
+
`Missing bundled Play dependency ${dependency.filePath}.`
|
|
8108
|
+
);
|
|
8109
|
+
const failure2 = await checkChildren(child);
|
|
8110
|
+
if (failure2) return failure2;
|
|
8111
|
+
}
|
|
8112
|
+
if (node === graph.root) return null;
|
|
8113
|
+
const result = await checkNode(node);
|
|
8114
|
+
return result.valid ? null : { result, failedChild: node };
|
|
8115
|
+
};
|
|
8116
|
+
const failure = await checkChildren(graph.root);
|
|
8117
|
+
if (failure) return failure;
|
|
8118
|
+
}
|
|
8119
|
+
return { result: await checkNode(graph.root) };
|
|
8120
|
+
}
|
|
8121
|
+
|
|
8039
8122
|
// src/cli/renderers/local-play-execution.ts
|
|
8040
8123
|
function renderLocalPlayExecutionPlan(plan, options = {}) {
|
|
8041
8124
|
if (options.dryRun) {
|
|
@@ -9005,20 +9088,11 @@ function isRetryablePendingStartFailure(status) {
|
|
|
9005
9088
|
if (status.runId && status.runId !== "pending") return false;
|
|
9006
9089
|
return isTransientPlayRunReadError(new Error(playStatusErrorText(status)));
|
|
9007
9090
|
}
|
|
9008
|
-
function
|
|
9009
|
-
|
|
9010
|
-
|
|
9011
|
-
|
|
9012
|
-
|
|
9013
|
-
playName: input.playName,
|
|
9014
|
-
dashboardUrl: input.dashboardUrl,
|
|
9015
|
-
status: "failed",
|
|
9016
|
-
progress: {
|
|
9017
|
-
status: "failed",
|
|
9018
|
-
logs: [],
|
|
9019
|
-
error: message
|
|
9020
|
-
}
|
|
9021
|
-
};
|
|
9091
|
+
function isAmbiguousPlayStartOutcomeError(error) {
|
|
9092
|
+
if (error instanceof DeeplineError && typeof error.statusCode === "number") {
|
|
9093
|
+
return error.statusCode >= 500;
|
|
9094
|
+
}
|
|
9095
|
+
return true;
|
|
9022
9096
|
}
|
|
9023
9097
|
var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set([
|
|
9024
9098
|
"completed",
|
|
@@ -9026,8 +9100,39 @@ var TERMINAL_PLAY_STATUSES = /* @__PURE__ */ new Set([
|
|
|
9026
9100
|
"cancelled"
|
|
9027
9101
|
]);
|
|
9028
9102
|
var PLAY_START_TRANSIENT_RETRY_DELAYS_MS = [500, 1500];
|
|
9103
|
+
var PLAY_START_STREAM_TERMINAL_WINDOW_MS = 2e3;
|
|
9029
9104
|
var PLAY_PROGRESS_HEARTBEAT_INTERVAL_MS = 15e3;
|
|
9030
9105
|
var PLAY_STATUS_HEARTBEAT_INTERVAL_MS = 15e3;
|
|
9106
|
+
var RetryablePlayStartAttemptError = class extends Error {
|
|
9107
|
+
constructor(originalError) {
|
|
9108
|
+
super(
|
|
9109
|
+
originalError instanceof Error ? originalError.message : String(originalError)
|
|
9110
|
+
);
|
|
9111
|
+
this.originalError = originalError;
|
|
9112
|
+
this.name = "RetryablePlayStartAttemptError";
|
|
9113
|
+
}
|
|
9114
|
+
};
|
|
9115
|
+
var PlayStartOutcomeUnknownError = class extends DeeplineError {
|
|
9116
|
+
retryable = false;
|
|
9117
|
+
constructor(playName, cause) {
|
|
9118
|
+
const causeMessage = cause instanceof Error ? cause.message : String(cause);
|
|
9119
|
+
const recoveryCommand = `deepline runs list --play ${shellQuote(playName)} --json`;
|
|
9120
|
+
super(
|
|
9121
|
+
`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}`,
|
|
9122
|
+
cause instanceof DeeplineError ? cause.statusCode : void 0,
|
|
9123
|
+
"PLAY_START_OUTCOME_UNKNOWN",
|
|
9124
|
+
{
|
|
9125
|
+
outcome: "unknown",
|
|
9126
|
+
playName,
|
|
9127
|
+
recoveryCommand,
|
|
9128
|
+
recoveryScope: "same_authenticated_host_and_workspace",
|
|
9129
|
+
causeMessage
|
|
9130
|
+
}
|
|
9131
|
+
);
|
|
9132
|
+
this.name = "PlayStartOutcomeUnknownError";
|
|
9133
|
+
Object.defineProperty(this, "cause", { value: cause, configurable: true });
|
|
9134
|
+
}
|
|
9135
|
+
};
|
|
9031
9136
|
function watchSurfaceReaches(state, provenance, level) {
|
|
9032
9137
|
const minimumLevel = state.logLevel ?? (state.verbose ? "debug" : "info");
|
|
9033
9138
|
if (!logLevelReaches(level, minimumLevel)) {
|
|
@@ -9593,11 +9698,26 @@ async function waitForPlayCompletionByWatch(input) {
|
|
|
9593
9698
|
await input.onRunAdmitted?.(input.workflowId);
|
|
9594
9699
|
};
|
|
9595
9700
|
const withDashboardUrl = (status) => input.dashboardUrl ? { ...status, dashboardUrl: input.dashboardUrl } : status;
|
|
9701
|
+
const finishTerminalStatus = async (status) => {
|
|
9702
|
+
if (status.runId === input.workflowId && statusProvesPlayRunExecution(status.status)) {
|
|
9703
|
+
await confirmAdmission();
|
|
9704
|
+
}
|
|
9705
|
+
if (!TERMINAL_PLAY_STATUSES.has(status.status)) return null;
|
|
9706
|
+
const resolved = input.fullJson === void 0 ? status : await resolvePlayRunOutputStatus({
|
|
9707
|
+
client: input.client,
|
|
9708
|
+
status,
|
|
9709
|
+
fullJson: input.fullJson,
|
|
9710
|
+
jsonOutput: input.jsonOutput,
|
|
9711
|
+
fromDurableStatus: true
|
|
9712
|
+
});
|
|
9713
|
+
return withDashboardUrl(resolved);
|
|
9714
|
+
};
|
|
9596
9715
|
const fetchTerminalStatus = async () => {
|
|
9597
9716
|
let refreshed;
|
|
9598
9717
|
try {
|
|
9599
9718
|
refreshed = await input.client.getPlayStatus(input.workflowId, {
|
|
9600
|
-
billing: false
|
|
9719
|
+
billing: false,
|
|
9720
|
+
...input.fullJson === void 0 ? {} : { full: input.fullJson }
|
|
9601
9721
|
});
|
|
9602
9722
|
} catch (error) {
|
|
9603
9723
|
if (isTransientPlayRunReadError(error) || isAdmittedRunVisibilityDelay(error)) {
|
|
@@ -9605,10 +9725,7 @@ async function waitForPlayCompletionByWatch(input) {
|
|
|
9605
9725
|
}
|
|
9606
9726
|
throw error;
|
|
9607
9727
|
}
|
|
9608
|
-
|
|
9609
|
-
await confirmAdmission();
|
|
9610
|
-
}
|
|
9611
|
-
return TERMINAL_PLAY_STATUSES.has(refreshed.status) ? withDashboardUrl(refreshed) : null;
|
|
9728
|
+
return finishTerminalStatus(refreshed);
|
|
9612
9729
|
};
|
|
9613
9730
|
const handleLiveEvent = async (event) => {
|
|
9614
9731
|
assertPlayWaitNotTimedOut({ ...input, lastPhase });
|
|
@@ -9664,7 +9781,7 @@ async function waitForPlayCompletionByWatch(input) {
|
|
|
9664
9781
|
}
|
|
9665
9782
|
const finalStatus = getFinalStatusFromLiveEvent(event);
|
|
9666
9783
|
if (event.type === "play.run.final_status" && finalStatus) {
|
|
9667
|
-
return withDashboardUrl(finalStatus);
|
|
9784
|
+
return input.fullJson === void 0 ? withDashboardUrl(finalStatus) : fetchTerminalStatus();
|
|
9668
9785
|
}
|
|
9669
9786
|
const status = getStatusFromLiveEvent(event);
|
|
9670
9787
|
if (status && TERMINAL_PLAY_STATUSES.has(status)) {
|
|
@@ -9679,7 +9796,37 @@ async function waitForPlayCompletionByWatch(input) {
|
|
|
9679
9796
|
let terminalFromWatch = null;
|
|
9680
9797
|
for await (const event of input.client.watchRunEvents(
|
|
9681
9798
|
input.workflowId,
|
|
9682
|
-
{
|
|
9799
|
+
{
|
|
9800
|
+
signal: controller.signal,
|
|
9801
|
+
deferLogs: !input.emitLogs,
|
|
9802
|
+
omitTerminalLogs: !input.emitLogs,
|
|
9803
|
+
...isCliTraceEnabled() ? {
|
|
9804
|
+
onPoll: (observation) => {
|
|
9805
|
+
recordCliTrace({
|
|
9806
|
+
phase: "play_watch_poll",
|
|
9807
|
+
workflowId: input.workflowId,
|
|
9808
|
+
ms: observation.durationMs,
|
|
9809
|
+
poll: observation.poll,
|
|
9810
|
+
httpStatus: observation.status,
|
|
9811
|
+
serverTiming: observation.serverTiming
|
|
9812
|
+
});
|
|
9813
|
+
}
|
|
9814
|
+
} : {},
|
|
9815
|
+
terminalStatus: {
|
|
9816
|
+
full: input.fullJson,
|
|
9817
|
+
billing: false,
|
|
9818
|
+
onStatus: async (status) => {
|
|
9819
|
+
recordCliTrace({
|
|
9820
|
+
phase: "play_watch_terminal_status",
|
|
9821
|
+
workflowId: input.workflowId,
|
|
9822
|
+
full: input.fullJson === true
|
|
9823
|
+
});
|
|
9824
|
+
terminalStatusRead = Promise.resolve(
|
|
9825
|
+
await finishTerminalStatus(status)
|
|
9826
|
+
);
|
|
9827
|
+
}
|
|
9828
|
+
}
|
|
9829
|
+
}
|
|
9683
9830
|
)) {
|
|
9684
9831
|
const terminal3 = await handleLiveEvent(event);
|
|
9685
9832
|
if (terminal3) terminalFromWatch = terminal3;
|
|
@@ -9716,18 +9863,183 @@ async function waitForPlayCompletionByWatch(input) {
|
|
|
9716
9863
|
controller.abort();
|
|
9717
9864
|
}
|
|
9718
9865
|
}
|
|
9866
|
+
async function startAndWaitForPlayCompletion(input) {
|
|
9867
|
+
const startedAt = Date.now();
|
|
9868
|
+
const controller = new AbortController();
|
|
9869
|
+
let timedOut = false;
|
|
9870
|
+
const timeout = input.waitTimeoutMs === null ? null : setTimeout(
|
|
9871
|
+
() => {
|
|
9872
|
+
timedOut = true;
|
|
9873
|
+
controller.abort();
|
|
9874
|
+
},
|
|
9875
|
+
Math.max(1, input.waitTimeoutMs)
|
|
9876
|
+
);
|
|
9877
|
+
let started;
|
|
9878
|
+
let inlineCompatibility = input.cliAdmission === true;
|
|
9879
|
+
const request = input.request;
|
|
9880
|
+
try {
|
|
9881
|
+
try {
|
|
9882
|
+
started = await input.client.startPlayRun(request, {
|
|
9883
|
+
signal: controller.signal,
|
|
9884
|
+
onSubmission: input.onSubmission,
|
|
9885
|
+
...input.cliAdmission ? { cliAdmission: true } : {}
|
|
9886
|
+
});
|
|
9887
|
+
} catch (error) {
|
|
9888
|
+
if (!(error instanceof CliPlayAdmissionUnsupportedError)) throw error;
|
|
9889
|
+
await checkPlayRunCompatibility(
|
|
9890
|
+
input.client.baseUrl,
|
|
9891
|
+
input.maintenancePolicy
|
|
9892
|
+
);
|
|
9893
|
+
inlineCompatibility = false;
|
|
9894
|
+
controller.signal.throwIfAborted();
|
|
9895
|
+
started = await input.client.startPlayRun(request, {
|
|
9896
|
+
signal: controller.signal,
|
|
9897
|
+
onSubmission: input.onSubmission
|
|
9898
|
+
});
|
|
9899
|
+
}
|
|
9900
|
+
} catch (error) {
|
|
9901
|
+
if (timedOut) {
|
|
9902
|
+
assertPlayWaitNotTimedOut({
|
|
9903
|
+
workflowId: "",
|
|
9904
|
+
startedAt,
|
|
9905
|
+
waitTimeoutMs: input.waitTimeoutMs
|
|
9906
|
+
});
|
|
9907
|
+
}
|
|
9908
|
+
throw error;
|
|
9909
|
+
} finally {
|
|
9910
|
+
if (timeout) clearTimeout(timeout);
|
|
9911
|
+
}
|
|
9912
|
+
const workflowId = started.workflowId;
|
|
9913
|
+
if (!workflowId || workflowId === "pending") {
|
|
9914
|
+
throw new DeeplineError(
|
|
9915
|
+
"Play admission returned no run id. Check recent runs before submitting again.",
|
|
9916
|
+
void 0,
|
|
9917
|
+
"PLAY_START_MISSING_RUN_ID"
|
|
9918
|
+
);
|
|
9919
|
+
}
|
|
9920
|
+
await input.onRunStarted?.(workflowId);
|
|
9921
|
+
await input.onRunAdmitted?.(workflowId);
|
|
9922
|
+
const dashboardUrl = started.dashboardUrl ?? buildPlayDashboardUrl(input.client.baseUrl, input.playName);
|
|
9923
|
+
if (!input.jsonOutput) {
|
|
9924
|
+
writeStartedPlayRun({
|
|
9925
|
+
runId: workflowId,
|
|
9926
|
+
playName: input.playName,
|
|
9927
|
+
dashboardUrl,
|
|
9928
|
+
inputFieldCount: Object.keys(input.request.input ?? {}).length,
|
|
9929
|
+
jsonOutput: false,
|
|
9930
|
+
progress: input.progress
|
|
9931
|
+
});
|
|
9932
|
+
}
|
|
9933
|
+
openPlayDashboard(dashboardUrl, input.open ?? false);
|
|
9934
|
+
input.progress.phase("running");
|
|
9935
|
+
recordCliTrace({
|
|
9936
|
+
phase: "cli.play_start_admitted",
|
|
9937
|
+
ms: Date.now() - startedAt,
|
|
9938
|
+
ok: true,
|
|
9939
|
+
playName: input.playName,
|
|
9940
|
+
workflowId,
|
|
9941
|
+
inlineCompatibility
|
|
9942
|
+
});
|
|
9943
|
+
const initialTerminal = readRecord(started.finalStatus);
|
|
9944
|
+
const initialPackage = readRecord(initialTerminal?.package) ?? initialTerminal;
|
|
9945
|
+
const initialRun = readRecord(initialPackage?.run);
|
|
9946
|
+
if (initialTerminal && initialRun?.id === workflowId && initialRun.status === "completed" && (initialTerminal.runId === void 0 || initialTerminal.runId === workflowId) && (initialTerminal.status === void 0 || initialTerminal.status === "completed") && input.fullJson === true && started.finalStatusView === "full") {
|
|
9947
|
+
assertPlayWaitNotTimedOut({
|
|
9948
|
+
workflowId,
|
|
9949
|
+
startedAt,
|
|
9950
|
+
waitTimeoutMs: input.waitTimeoutMs
|
|
9951
|
+
});
|
|
9952
|
+
const initialStatus = normalizePlayStatus(initialTerminal);
|
|
9953
|
+
const status2 = await resolvePlayRunOutputStatus({
|
|
9954
|
+
client: input.client,
|
|
9955
|
+
status: initialStatus,
|
|
9956
|
+
fullJson: true,
|
|
9957
|
+
jsonOutput: input.jsonOutput,
|
|
9958
|
+
fromDurableStatus: true
|
|
9959
|
+
});
|
|
9960
|
+
recordCliTrace({
|
|
9961
|
+
phase: "play_watch_terminal_status",
|
|
9962
|
+
workflowId,
|
|
9963
|
+
full: true,
|
|
9964
|
+
source: status2 === initialStatus ? "start_response" : "durable_repair"
|
|
9965
|
+
});
|
|
9966
|
+
const completedStatus = { ...status2, dashboardUrl };
|
|
9967
|
+
return input.request.revisionId ? { ...completedStatus, revisionId: input.request.revisionId } : completedStatus;
|
|
9968
|
+
}
|
|
9969
|
+
const status = await waitForPlayCompletionByWatch({
|
|
9970
|
+
...input,
|
|
9971
|
+
workflowId,
|
|
9972
|
+
dashboardUrl,
|
|
9973
|
+
startedAt,
|
|
9974
|
+
onRunAdmitted: void 0,
|
|
9975
|
+
state: {
|
|
9976
|
+
emittedRunnerStarted: false,
|
|
9977
|
+
verbose: input.verboseLogs === true,
|
|
9978
|
+
logLevel: input.logLevel ?? "info",
|
|
9979
|
+
lastProgressSignature: null,
|
|
9980
|
+
lastProgressHeartbeatAt: 0,
|
|
9981
|
+
lastStatusHeartbeatAt: 0
|
|
9982
|
+
}
|
|
9983
|
+
});
|
|
9984
|
+
return input.request.revisionId ? { ...status, revisionId: input.request.revisionId } : status;
|
|
9985
|
+
}
|
|
9719
9986
|
async function startAndWaitForPlayCompletionByStream(input) {
|
|
9720
9987
|
const prepared = await input.client.preparePlayRunAdmission(input.request, {
|
|
9988
|
+
cliAdmission: input.cliAdmission,
|
|
9721
9989
|
onSubmission: input.onSubmission
|
|
9722
9990
|
});
|
|
9723
9991
|
const pinnedInput = {
|
|
9724
9992
|
...input,
|
|
9725
9993
|
request: prepared.body,
|
|
9726
|
-
startStream: prepared.startStream
|
|
9994
|
+
startStream: prepared.startStream,
|
|
9995
|
+
supportsCallerIntent: prepared.supportsCallerIntent
|
|
9727
9996
|
};
|
|
9728
9997
|
const retryDelays = prepared.supportsCallerIntent ? PLAY_START_TRANSIENT_RETRY_DELAYS_MS : [];
|
|
9729
9998
|
for (let attempt = 0; attempt <= retryDelays.length; attempt += 1) {
|
|
9730
|
-
|
|
9999
|
+
let status;
|
|
10000
|
+
try {
|
|
10001
|
+
status = await startAndWaitForPlayCompletionByStreamOnce(pinnedInput);
|
|
10002
|
+
} catch (error) {
|
|
10003
|
+
if (error instanceof CliPlayAdmissionUnsupportedError && input.cliAdmission) {
|
|
10004
|
+
await checkPlayRunCompatibility(
|
|
10005
|
+
input.client.baseUrl,
|
|
10006
|
+
input.maintenancePolicy
|
|
10007
|
+
);
|
|
10008
|
+
return startAndWaitForPlayCompletion({
|
|
10009
|
+
...input,
|
|
10010
|
+
cliAdmission: false,
|
|
10011
|
+
streamTerminalWindowMs: void 0
|
|
10012
|
+
});
|
|
10013
|
+
}
|
|
10014
|
+
if (!(error instanceof RetryablePlayStartAttemptError)) throw error;
|
|
10015
|
+
const retryDelayMs2 = retryDelays[attempt];
|
|
10016
|
+
if (retryDelayMs2 === void 0) {
|
|
10017
|
+
throw new DeeplineError(
|
|
10018
|
+
`Play ${input.playName} did not start after retrying transient start failures.`,
|
|
10019
|
+
void 0,
|
|
10020
|
+
"PLAY_START_RETRY_EXHAUSTED",
|
|
10021
|
+
{
|
|
10022
|
+
causeMessage: error.originalError instanceof Error ? error.originalError.message : String(error.originalError)
|
|
10023
|
+
}
|
|
10024
|
+
);
|
|
10025
|
+
}
|
|
10026
|
+
if (!input.jsonOutput) {
|
|
10027
|
+
input.progress.writeLine(
|
|
10028
|
+
`[play watch] start response was ambiguous; retrying the same caller intent (${error.message})`
|
|
10029
|
+
);
|
|
10030
|
+
}
|
|
10031
|
+
recordCliTrace({
|
|
10032
|
+
phase: "cli.play_start_stream_retry",
|
|
10033
|
+
ms: 0,
|
|
10034
|
+
ok: true,
|
|
10035
|
+
playName: input.playName,
|
|
10036
|
+
attempt: attempt + 1,
|
|
10037
|
+
reason: error.message,
|
|
10038
|
+
recovery: "same_caller_intent"
|
|
10039
|
+
});
|
|
10040
|
+
await sleep(retryDelayMs2);
|
|
10041
|
+
continue;
|
|
10042
|
+
}
|
|
9731
10043
|
const retryDelayMs = retryDelays[attempt];
|
|
9732
10044
|
if (retryDelayMs === void 0 || !isRetryablePendingStartFailure(status)) {
|
|
9733
10045
|
return status;
|
|
@@ -9775,10 +10087,26 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
9775
10087
|
let eventCount = 0;
|
|
9776
10088
|
let firstRunIdMs = null;
|
|
9777
10089
|
let launchConfirmed = false;
|
|
10090
|
+
let terminalWindowExpired = false;
|
|
10091
|
+
let terminalWindowTimer = null;
|
|
9778
10092
|
const confirmAdmission = async (runId) => {
|
|
9779
10093
|
if (launchConfirmed || !runId || runId === "pending") return;
|
|
9780
10094
|
launchConfirmed = true;
|
|
9781
10095
|
await input.onRunAdmitted?.(runId);
|
|
10096
|
+
recordCliTrace({
|
|
10097
|
+
phase: "cli.play_start_admitted",
|
|
10098
|
+
ms: Date.now() - startedAt,
|
|
10099
|
+
ok: true,
|
|
10100
|
+
playName: input.playName,
|
|
10101
|
+
workflowId: runId,
|
|
10102
|
+
inlineCompatibility: input.cliAdmission === true
|
|
10103
|
+
});
|
|
10104
|
+
if ((input.streamTerminalWindowMs ?? 0) > 0) {
|
|
10105
|
+
terminalWindowTimer = setTimeout(() => {
|
|
10106
|
+
terminalWindowExpired = true;
|
|
10107
|
+
controller.abort();
|
|
10108
|
+
}, input.streamTerminalWindowMs);
|
|
10109
|
+
}
|
|
9782
10110
|
};
|
|
9783
10111
|
let lastPhase = null;
|
|
9784
10112
|
const timeout = input.waitTimeoutMs === null ? null : setTimeout(
|
|
@@ -9795,7 +10123,8 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
9795
10123
|
let refreshed;
|
|
9796
10124
|
try {
|
|
9797
10125
|
refreshed = await input.client.getPlayStatus(lastKnownWorkflowId, {
|
|
9798
|
-
billing: false
|
|
10126
|
+
billing: false,
|
|
10127
|
+
full: input.fullJson
|
|
9799
10128
|
});
|
|
9800
10129
|
} catch (error) {
|
|
9801
10130
|
if (isTransientPlayRunReadError(error)) {
|
|
@@ -9918,11 +10247,18 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
9918
10247
|
...launchedRevisionId ? { revisionId: launchedRevisionId } : {}
|
|
9919
10248
|
};
|
|
9920
10249
|
}
|
|
9921
|
-
|
|
9922
|
-
|
|
9923
|
-
|
|
9924
|
-
|
|
9925
|
-
|
|
10250
|
+
let fromDurableStatus = false;
|
|
10251
|
+
let canonicalTerminal;
|
|
10252
|
+
if (input.request.profile === "absurd") {
|
|
10253
|
+
canonicalTerminal = await fetchKnownTerminalStatus();
|
|
10254
|
+
fromDurableStatus = canonicalTerminal !== null;
|
|
10255
|
+
} else {
|
|
10256
|
+
canonicalTerminal = {
|
|
10257
|
+
...finalStatus,
|
|
10258
|
+
dashboardUrl,
|
|
10259
|
+
...launchedRevisionId ? { revisionId: launchedRevisionId } : {}
|
|
10260
|
+
};
|
|
10261
|
+
}
|
|
9926
10262
|
if (!canonicalTerminal) {
|
|
9927
10263
|
recordCliTrace({
|
|
9928
10264
|
phase: "cli.play_start_stream_stale_terminal_ignored",
|
|
@@ -9937,22 +10273,37 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
9937
10273
|
});
|
|
9938
10274
|
continue;
|
|
9939
10275
|
}
|
|
10276
|
+
const outputTerminal = input.fullJson === true ? await resolvePlayRunOutputStatus({
|
|
10277
|
+
client: input.client,
|
|
10278
|
+
status: canonicalTerminal,
|
|
10279
|
+
fullJson: true,
|
|
10280
|
+
jsonOutput: input.jsonOutput,
|
|
10281
|
+
fromDurableStatus
|
|
10282
|
+
}) : canonicalTerminal;
|
|
10283
|
+
if (input.fullJson === true) {
|
|
10284
|
+
recordCliTrace({
|
|
10285
|
+
phase: "play_watch_terminal_status",
|
|
10286
|
+
workflowId: outputTerminal.runId || lastKnownWorkflowId || void 0,
|
|
10287
|
+
full: true,
|
|
10288
|
+
source: outputTerminal === canonicalTerminal ? fromDurableStatus ? "start_stream_durable" : "start_stream" : "durable_repair"
|
|
10289
|
+
});
|
|
10290
|
+
}
|
|
9940
10291
|
recordCliTrace({
|
|
9941
10292
|
phase: "cli.play_start_stream_terminal",
|
|
9942
10293
|
ms: Date.now() - startedAt,
|
|
9943
10294
|
ok: true,
|
|
9944
10295
|
playName: input.playName,
|
|
9945
|
-
workflowId:
|
|
10296
|
+
workflowId: outputTerminal.runId || lastKnownWorkflowId || null,
|
|
9946
10297
|
eventCount,
|
|
9947
10298
|
firstRunIdMs,
|
|
9948
10299
|
lastPhase
|
|
9949
10300
|
});
|
|
9950
|
-
if (statusProvesPlayRunExecution(
|
|
10301
|
+
if (statusProvesPlayRunExecution(outputTerminal.status)) {
|
|
9951
10302
|
await confirmAdmission(lastKnownWorkflowId);
|
|
9952
10303
|
}
|
|
9953
|
-
return
|
|
10304
|
+
return outputTerminal;
|
|
9954
10305
|
}
|
|
9955
|
-
if (lastKnownWorkflowId && launchConfirmed) {
|
|
10306
|
+
if (lastKnownWorkflowId && launchConfirmed && (!input.streamTerminalWindowMs || terminalWindowExpired)) {
|
|
9956
10307
|
if (timeout) {
|
|
9957
10308
|
clearTimeout(timeout);
|
|
9958
10309
|
}
|
|
@@ -9965,7 +10316,8 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
9965
10316
|
workflowId: lastKnownWorkflowId,
|
|
9966
10317
|
eventCount,
|
|
9967
10318
|
firstRunIdMs,
|
|
9968
|
-
lastPhase
|
|
10319
|
+
lastPhase,
|
|
10320
|
+
handoffReason: terminalWindowExpired ? "terminal_window_elapsed" : "launch_confirmed"
|
|
9969
10321
|
});
|
|
9970
10322
|
return waitForPlayCompletionByWatch({
|
|
9971
10323
|
client: input.client,
|
|
@@ -9978,6 +10330,7 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
9978
10330
|
startedAt,
|
|
9979
10331
|
state,
|
|
9980
10332
|
progress: input.progress,
|
|
10333
|
+
fullJson: input.fullJson,
|
|
9981
10334
|
onRunAdmitted: confirmAdmission
|
|
9982
10335
|
});
|
|
9983
10336
|
}
|
|
@@ -10006,11 +10359,11 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
10006
10359
|
lastPhase
|
|
10007
10360
|
});
|
|
10008
10361
|
}
|
|
10009
|
-
if (lastKnownWorkflowId && isTransientPlayRunReadError(error)) {
|
|
10362
|
+
if (lastKnownWorkflowId && (terminalWindowExpired || isTransientPlayRunReadError(error))) {
|
|
10010
10363
|
if (timeout) {
|
|
10011
10364
|
clearTimeout(timeout);
|
|
10012
10365
|
}
|
|
10013
|
-
const reason = error instanceof Error ? error.message : String(error);
|
|
10366
|
+
const reason = terminalWindowExpired ? "terminal observation window elapsed" : error instanceof Error ? error.message : String(error);
|
|
10014
10367
|
if (!input.jsonOutput) {
|
|
10015
10368
|
process.stderr.write(
|
|
10016
10369
|
`[play watch] start stream failed after run ${lastKnownWorkflowId}; reconnecting to canonical run stream (${reason})
|
|
@@ -10039,10 +10392,11 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
10039
10392
|
startedAt,
|
|
10040
10393
|
state,
|
|
10041
10394
|
progress: input.progress,
|
|
10395
|
+
fullJson: input.fullJson,
|
|
10042
10396
|
onRunAdmitted: confirmAdmission
|
|
10043
10397
|
});
|
|
10044
10398
|
}
|
|
10045
|
-
if (!lastKnownWorkflowId &&
|
|
10399
|
+
if (!lastKnownWorkflowId && isAmbiguousPlayStartOutcomeError(error)) {
|
|
10046
10400
|
recordCliTrace({
|
|
10047
10401
|
phase: "cli.play_start_stream_transient_failure",
|
|
10048
10402
|
ms: Date.now() - startedAt,
|
|
@@ -10053,17 +10407,17 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
10053
10407
|
lastPhase,
|
|
10054
10408
|
reason: error instanceof Error ? error.message : String(error)
|
|
10055
10409
|
});
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
});
|
|
10410
|
+
if (input.supportsCallerIntent) {
|
|
10411
|
+
throw new RetryablePlayStartAttemptError(error);
|
|
10412
|
+
}
|
|
10413
|
+
throw new PlayStartOutcomeUnknownError(input.playName, error);
|
|
10061
10414
|
}
|
|
10062
10415
|
throw error;
|
|
10063
10416
|
} finally {
|
|
10064
10417
|
if (timeout) {
|
|
10065
10418
|
clearTimeout(timeout);
|
|
10066
10419
|
}
|
|
10420
|
+
if (terminalWindowTimer) clearTimeout(terminalWindowTimer);
|
|
10067
10421
|
}
|
|
10068
10422
|
if (lastKnownWorkflowId) {
|
|
10069
10423
|
if (!input.jsonOutput) {
|
|
@@ -10080,7 +10434,8 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
10080
10434
|
eventCount,
|
|
10081
10435
|
firstRunIdMs,
|
|
10082
10436
|
lastPhase,
|
|
10083
|
-
reason: "stream ended before terminal event"
|
|
10437
|
+
reason: "stream ended before terminal event",
|
|
10438
|
+
...terminalWindowExpired ? { handoffReason: "terminal_window_elapsed" } : {}
|
|
10084
10439
|
});
|
|
10085
10440
|
return waitForPlayCompletionByWatch({
|
|
10086
10441
|
client: input.client,
|
|
@@ -10093,13 +10448,14 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
10093
10448
|
startedAt,
|
|
10094
10449
|
state,
|
|
10095
10450
|
progress: input.progress,
|
|
10451
|
+
fullJson: input.fullJson,
|
|
10096
10452
|
onRunAdmitted: confirmAdmission
|
|
10097
10453
|
});
|
|
10098
10454
|
}
|
|
10099
10455
|
const phaseSuffix = lastPhase && lastPhase.trim() ? ` (last observed phase: ${lastPhase.trim()})` : "";
|
|
10100
10456
|
const idSuffix = lastKnownWorkflowId ? ` runId=${lastKnownWorkflowId}` : "";
|
|
10101
|
-
|
|
10102
|
-
`Play start request ended before terminal status was observed${idSuffix}${phaseSuffix}
|
|
10457
|
+
const endedBeforeConfirmation = new DeeplineError(
|
|
10458
|
+
`Play start request ended before terminal status was observed${idSuffix}${phaseSuffix}.`,
|
|
10103
10459
|
void 0,
|
|
10104
10460
|
"PLAY_START_STREAM_ENDED",
|
|
10105
10461
|
{
|
|
@@ -10107,6 +10463,14 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
|
|
|
10107
10463
|
...lastPhase ? { phase: lastPhase } : {}
|
|
10108
10464
|
}
|
|
10109
10465
|
);
|
|
10466
|
+
if (lastKnownWorkflowId) throw endedBeforeConfirmation;
|
|
10467
|
+
if (input.supportsCallerIntent) {
|
|
10468
|
+
throw new RetryablePlayStartAttemptError(endedBeforeConfirmation);
|
|
10469
|
+
}
|
|
10470
|
+
throw new PlayStartOutcomeUnknownError(
|
|
10471
|
+
input.playName,
|
|
10472
|
+
endedBeforeConfirmation
|
|
10473
|
+
);
|
|
10110
10474
|
}
|
|
10111
10475
|
function formatInteger(value) {
|
|
10112
10476
|
return typeof value === "number" && Number.isFinite(value) ? value.toLocaleString("en-US") : String(value ?? "-");
|
|
@@ -11861,7 +12225,7 @@ function withRunNavigationLines(lines, status, actionCommands = buildRunNavigati
|
|
|
11861
12225
|
function playRunPackageTextLedgerIncomplete(pkg) {
|
|
11862
12226
|
if (!pkg) return true;
|
|
11863
12227
|
const steps = readRecordArray(pkg.steps);
|
|
11864
|
-
if (steps.length === 0) return
|
|
12228
|
+
if (steps.length === 0) return pkg.stepsExpected !== false;
|
|
11865
12229
|
for (const step of steps) {
|
|
11866
12230
|
if (step.kind !== "dataset" || step.status !== "completed") continue;
|
|
11867
12231
|
const output = readRecord(step.output);
|
|
@@ -11876,9 +12240,9 @@ async function resolvePlayRunOutputStatus(input) {
|
|
|
11876
12240
|
return input.status;
|
|
11877
12241
|
}
|
|
11878
12242
|
const streamedPackage = getPlayRunPackage(input.status);
|
|
11879
|
-
const refreshForFullJson = input.fullJson &&
|
|
12243
|
+
const refreshForFullJson = input.fullJson && !input.fromDurableStatus;
|
|
11880
12244
|
const streamedTextPackageIncomplete = input.status.status === "completed" && playRunPackageTextLedgerIncomplete(streamedPackage);
|
|
11881
|
-
const refreshFailedTerminal = input.status.status === "failed";
|
|
12245
|
+
const refreshFailedTerminal = input.status.status === "failed" && (!input.fromDurableStatus || readRecord(streamedPackage?.run)?.status !== "failed");
|
|
11882
12246
|
if (!refreshForFullJson && !streamedTextPackageIncomplete && !refreshFailedTerminal) {
|
|
11883
12247
|
return input.status;
|
|
11884
12248
|
}
|
|
@@ -13144,45 +13508,61 @@ async function checkOneExportedPlay(input) {
|
|
|
13144
13508
|
const authoringErrors = collectPlayGraphAuthoringErrors(graph);
|
|
13145
13509
|
const client = new DeeplineClient();
|
|
13146
13510
|
const integrationMode = resolveEvalIntegrationMode();
|
|
13147
|
-
const
|
|
13148
|
-
|
|
13149
|
-
|
|
13150
|
-
|
|
13151
|
-
|
|
13152
|
-
|
|
13153
|
-
|
|
13154
|
-
sourceCode: graph.root.sourceCode,
|
|
13155
|
-
sourceFiles: graph.root.sourceFiles,
|
|
13156
|
-
description: graph.root.playDescription ?? void 0,
|
|
13157
|
-
artifact: artifactForProductionCompatibilityCheck(graph.root.artifact),
|
|
13158
|
-
...exportName === PLAY_DEFAULT_EXPORT ? {} : { exportName },
|
|
13159
|
-
...importedPlays.length > 0 ? { importedPlays } : {},
|
|
13160
|
-
...integrationMode ? { integrationMode } : {}
|
|
13511
|
+
const checked = await checkLocalPlayGraph({
|
|
13512
|
+
client,
|
|
13513
|
+
graph,
|
|
13514
|
+
rootPlayName: playName,
|
|
13515
|
+
exportName,
|
|
13516
|
+
integrationMode,
|
|
13517
|
+
prepareArtifact: artifactForProductionCompatibilityCheck
|
|
13161
13518
|
});
|
|
13162
|
-
const
|
|
13519
|
+
const importedPlayName = checked.failedChild?.playName;
|
|
13520
|
+
const diagnosticPrefix = importedPlayName ? `Imported Play ${importedPlayName}: ` : "";
|
|
13521
|
+
const valid = checked.result.valid && !checked.failedChild && authoringErrors.length === 0;
|
|
13522
|
+
const errors = [
|
|
13523
|
+
...authoringErrors,
|
|
13524
|
+
...checked.result.errors.map((error) => `${diagnosticPrefix}${error}`)
|
|
13525
|
+
];
|
|
13163
13526
|
return {
|
|
13164
13527
|
exportName,
|
|
13165
13528
|
playName,
|
|
13166
|
-
...authoringErrors.length > 0 ? { stage: "authoring" } : {},
|
|
13529
|
+
...authoringErrors.length > 0 || checked.failedChild ? { stage: "authoring" } : {},
|
|
13167
13530
|
result: {
|
|
13168
|
-
...result,
|
|
13531
|
+
...checked.result,
|
|
13169
13532
|
valid,
|
|
13170
|
-
errors: valid ? result.errors : addPlayCheckRepairHints({
|
|
13171
|
-
errors
|
|
13172
|
-
sourceCode: graph.root.sourceCode
|
|
13533
|
+
errors: valid ? checked.result.errors : addPlayCheckRepairHints({
|
|
13534
|
+
errors,
|
|
13535
|
+
sourceCode: checked.failedChild?.sourceCode ?? graph.root.sourceCode
|
|
13173
13536
|
}),
|
|
13174
|
-
|
|
13537
|
+
...checked.failedChild && checked.result.issues ? {
|
|
13538
|
+
issues: checked.result.issues.map((issue) => ({
|
|
13539
|
+
...issue,
|
|
13540
|
+
message: `${diagnosticPrefix}${issue.message}`
|
|
13541
|
+
}))
|
|
13542
|
+
} : {},
|
|
13543
|
+
toolGetterHints: checked.result.toolGetterHints ?? (checked.failedChild ? [] : await buildToolGetterHints(client, checked.result.staticPipeline))
|
|
13175
13544
|
}
|
|
13176
13545
|
};
|
|
13177
13546
|
}
|
|
13178
13547
|
function playRunClientOptions(options) {
|
|
13179
13548
|
return options.headers ? { headers: options.headers } : void 0;
|
|
13180
13549
|
}
|
|
13550
|
+
async function preflightPlayRunTotalBudget(input) {
|
|
13551
|
+
if (input.maxTotalCredits === null) return;
|
|
13552
|
+
await input.client.preparePlayRunAdmission({
|
|
13553
|
+
name: input.playName,
|
|
13554
|
+
maxTotalCredits: input.maxTotalCredits
|
|
13555
|
+
});
|
|
13556
|
+
}
|
|
13181
13557
|
async function handleFileBackedRun(options, hooks) {
|
|
13182
13558
|
if (options.target.kind !== "file") {
|
|
13183
13559
|
throw new Error("Expected a file-backed play run target.");
|
|
13184
13560
|
}
|
|
13185
13561
|
let client;
|
|
13562
|
+
let cliAdmission = usesInlinePlayAdmission(
|
|
13563
|
+
"plays run",
|
|
13564
|
+
process.argv.slice(2)
|
|
13565
|
+
);
|
|
13186
13566
|
const progress = getActiveCliProgress() ?? createCliProgress(!options.jsonOutput);
|
|
13187
13567
|
const absolutePlayPath = resolve5(options.target.path);
|
|
13188
13568
|
progress.phase("compiling play");
|
|
@@ -13220,6 +13600,18 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
13220
13600
|
return 0;
|
|
13221
13601
|
}
|
|
13222
13602
|
client = new DeeplineClient(playRunClientOptions(options));
|
|
13603
|
+
if (cliAdmission && (graph.root.importedPlayDependencies.length > 0 || inputContainsLocalFilePath(runtimeInput))) {
|
|
13604
|
+
await checkPlayRunCompatibility(
|
|
13605
|
+
client.baseUrl,
|
|
13606
|
+
options.maintenancePolicy
|
|
13607
|
+
);
|
|
13608
|
+
cliAdmission = false;
|
|
13609
|
+
}
|
|
13610
|
+
await preflightPlayRunTotalBudget({
|
|
13611
|
+
client,
|
|
13612
|
+
playName: graph.root.playName ?? extractPlayName(sourceCode, absolutePlayPath),
|
|
13613
|
+
maxTotalCredits: options.maxTotalCredits
|
|
13614
|
+
});
|
|
13223
13615
|
const canDeferCompilerManifest = graph.root.importedPlayDependencies.length === 0 && !sourceGraphMentionsRunPlay(graph.root) && !inputContainsLocalFilePath(runtimeInput);
|
|
13224
13616
|
if (canDeferCompilerManifest) {
|
|
13225
13617
|
recordCliTrace({
|
|
@@ -13324,7 +13716,7 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
13324
13716
|
const finalStatus = await traceCliSpan(
|
|
13325
13717
|
"cli.play_start_watch",
|
|
13326
13718
|
{ targetKind: "file", playName },
|
|
13327
|
-
() => startAndWaitForPlayCompletionByStream({
|
|
13719
|
+
() => (options.runIdFile || cliAdmission ? startAndWaitForPlayCompletionByStream : startAndWaitForPlayCompletion)({
|
|
13328
13720
|
client,
|
|
13329
13721
|
request: startRequest,
|
|
13330
13722
|
playName,
|
|
@@ -13337,7 +13729,13 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
13337
13729
|
progress,
|
|
13338
13730
|
onRunStarted: hooks?.onRunStarted,
|
|
13339
13731
|
onSubmission: hooks?.onSubmission,
|
|
13340
|
-
onRunAdmitted: hooks?.onRunAdmitted
|
|
13732
|
+
onRunAdmitted: hooks?.onRunAdmitted,
|
|
13733
|
+
maintenancePolicy: options.maintenancePolicy,
|
|
13734
|
+
...options.runIdFile ? {} : { fullJson: options.fullJson },
|
|
13735
|
+
...cliAdmission ? {
|
|
13736
|
+
cliAdmission: true,
|
|
13737
|
+
streamTerminalWindowMs: PLAY_START_STREAM_TERMINAL_WINDOW_MS
|
|
13738
|
+
} : {}
|
|
13341
13739
|
}).catch(async (error) => {
|
|
13342
13740
|
throw await normalizePlayStartError(client, error, playName);
|
|
13343
13741
|
})
|
|
@@ -13349,12 +13747,12 @@ async function handleFileBackedRun(options, hooks) {
|
|
|
13349
13747
|
}
|
|
13350
13748
|
const outputStatus = withOrdinaryRunAgainCommand(
|
|
13351
13749
|
withTerminalPlayIdentity(
|
|
13352
|
-
await resolvePlayRunOutputStatus({
|
|
13750
|
+
options.runIdFile ? await resolvePlayRunOutputStatus({
|
|
13353
13751
|
client,
|
|
13354
13752
|
status: finalStatus,
|
|
13355
13753
|
fullJson: options.fullJson,
|
|
13356
13754
|
jsonOutput: options.jsonOutput
|
|
13357
|
-
}),
|
|
13755
|
+
}) : finalStatus,
|
|
13358
13756
|
playName
|
|
13359
13757
|
),
|
|
13360
13758
|
options
|
|
@@ -13419,6 +13817,10 @@ async function handleNamedRun(options, hooks) {
|
|
|
13419
13817
|
throw new Error("Expected a named play run target.");
|
|
13420
13818
|
}
|
|
13421
13819
|
const client = new DeeplineClient(playRunClientOptions(options));
|
|
13820
|
+
let cliAdmission = usesInlinePlayAdmission(
|
|
13821
|
+
"plays run",
|
|
13822
|
+
process.argv.slice(2)
|
|
13823
|
+
);
|
|
13422
13824
|
const progress = getActiveCliProgress() ?? createCliProgress(!options.jsonOutput);
|
|
13423
13825
|
const playName = options.target.name;
|
|
13424
13826
|
const runtimeInput = options.input ? { ...options.input } : {};
|
|
@@ -13465,10 +13867,19 @@ async function handleNamedRun(options, hooks) {
|
|
|
13465
13867
|
selector: options.revisionSelector
|
|
13466
13868
|
})
|
|
13467
13869
|
);
|
|
13870
|
+
await preflightPlayRunTotalBudget({
|
|
13871
|
+
client,
|
|
13872
|
+
playName,
|
|
13873
|
+
maxTotalCredits: options.maxTotalCredits
|
|
13874
|
+
});
|
|
13468
13875
|
const fileInputBindings = playDetail ? [
|
|
13469
13876
|
...fileInputBindingsFromPlaySchema(playDetail.play.inputSchema),
|
|
13470
13877
|
...fileInputBindingsFromStaticPipeline(playDetail.play.staticPipeline)
|
|
13471
13878
|
] : [];
|
|
13879
|
+
if (cliAdmission && fileInputBindings.length > 0) {
|
|
13880
|
+
await checkPlayRunCompatibility(client.baseUrl, options.maintenancePolicy);
|
|
13881
|
+
cliAdmission = false;
|
|
13882
|
+
}
|
|
13472
13883
|
const stagedFileInputs = await traceCliSpan(
|
|
13473
13884
|
"cli.play_stage_inputs",
|
|
13474
13885
|
{
|
|
@@ -13516,7 +13927,7 @@ async function handleNamedRun(options, hooks) {
|
|
|
13516
13927
|
const finalStatus = await traceCliSpan(
|
|
13517
13928
|
"cli.play_start_watch",
|
|
13518
13929
|
{ targetKind: "name", playName },
|
|
13519
|
-
() => startAndWaitForPlayCompletionByStream({
|
|
13930
|
+
() => (options.runIdFile || cliAdmission ? startAndWaitForPlayCompletionByStream : startAndWaitForPlayCompletion)({
|
|
13520
13931
|
client,
|
|
13521
13932
|
request: startRequest,
|
|
13522
13933
|
playName,
|
|
@@ -13529,7 +13940,13 @@ async function handleNamedRun(options, hooks) {
|
|
|
13529
13940
|
progress,
|
|
13530
13941
|
onRunStarted: hooks?.onRunStarted,
|
|
13531
13942
|
onSubmission: hooks?.onSubmission,
|
|
13532
|
-
onRunAdmitted: hooks?.onRunAdmitted
|
|
13943
|
+
onRunAdmitted: hooks?.onRunAdmitted,
|
|
13944
|
+
maintenancePolicy: options.maintenancePolicy,
|
|
13945
|
+
...options.runIdFile ? {} : { fullJson: options.fullJson },
|
|
13946
|
+
...cliAdmission ? {
|
|
13947
|
+
cliAdmission: true,
|
|
13948
|
+
streamTerminalWindowMs: PLAY_START_STREAM_TERMINAL_WINDOW_MS
|
|
13949
|
+
} : {}
|
|
13533
13950
|
}).catch(async (error) => {
|
|
13534
13951
|
throw await normalizePlayStartError(client, error, playName, {
|
|
13535
13952
|
suggestMissingPlay: true
|
|
@@ -13543,12 +13960,12 @@ async function handleNamedRun(options, hooks) {
|
|
|
13543
13960
|
}
|
|
13544
13961
|
const outputStatus = withOrdinaryRunAgainCommand(
|
|
13545
13962
|
withTerminalPlayIdentity(
|
|
13546
|
-
await resolvePlayRunOutputStatus({
|
|
13963
|
+
options.runIdFile ? await resolvePlayRunOutputStatus({
|
|
13547
13964
|
client,
|
|
13548
13965
|
status: finalStatus,
|
|
13549
13966
|
fullJson: options.fullJson,
|
|
13550
13967
|
jsonOutput: options.jsonOutput
|
|
13551
|
-
}),
|
|
13968
|
+
}) : finalStatus,
|
|
13552
13969
|
playName
|
|
13553
13970
|
),
|
|
13554
13971
|
options,
|
|
@@ -14299,7 +14716,7 @@ Active runs: ${next.running}`
|
|
|
14299
14716
|
return lines2.join("\n");
|
|
14300
14717
|
});
|
|
14301
14718
|
const nextOffset = (page.offset ?? offset ?? 0) + runs.length;
|
|
14302
|
-
const nextPage = page.hasMore && playName ? `deepline runs list --play ${shellQuote(playName)}${statusFilter ? ` --status ${shellQuote(statusFilter)}` : ""} --limit ${page.limit ?? limit ?? 20} --offset ${nextOffset}` : null;
|
|
14719
|
+
const nextPage = page.hasMore && playName ? `deepline runs list --play ${shellQuote(playName)}${nodeId ? ` --node ${shellQuote(nodeId)}` : ""}${statusFilter ? ` --status ${shellQuote(statusFilter)}` : ""} --limit ${page.limit ?? limit ?? 20} --offset ${nextOffset}${argsWantJson(args) ? " --json" : ""}` : null;
|
|
14303
14720
|
if (page.hasMore) {
|
|
14304
14721
|
lines.push("List truncated \u2014 more runs match this filter.");
|
|
14305
14722
|
lines.push(
|
|
@@ -15083,6 +15500,7 @@ async function handleRunExport(args) {
|
|
|
15083
15500
|
}
|
|
15084
15501
|
const client = new DeeplineClient();
|
|
15085
15502
|
let status = await client.getPlayStatus(runId, { full: true });
|
|
15503
|
+
assertRunExportStatusIdentity(status, runId);
|
|
15086
15504
|
if (wait && !TERMINAL_PLAY_STATUSES.has(status.status)) {
|
|
15087
15505
|
const progress = createCliProgress(!argsWantJson(args));
|
|
15088
15506
|
try {
|
|
@@ -15103,6 +15521,7 @@ async function handleRunExport(args) {
|
|
|
15103
15521
|
progress
|
|
15104
15522
|
});
|
|
15105
15523
|
status = await client.getPlayStatus(runId, { full: true });
|
|
15524
|
+
assertRunExportStatusIdentity(status, runId);
|
|
15106
15525
|
progress.complete();
|
|
15107
15526
|
} catch (error) {
|
|
15108
15527
|
progress.fail();
|
|
@@ -15198,6 +15617,19 @@ async function handleRunExport(args) {
|
|
|
15198
15617
|
});
|
|
15199
15618
|
return 0;
|
|
15200
15619
|
}
|
|
15620
|
+
function assertRunExportStatusIdentity(status, requestedRunId) {
|
|
15621
|
+
if (status.runId === requestedRunId) return;
|
|
15622
|
+
throw new DeeplineError(
|
|
15623
|
+
`Run status identity did not match requested run ${requestedRunId}; refusing to export rows for ${status.runId || "an unidentified run"}.`,
|
|
15624
|
+
void 0,
|
|
15625
|
+
"RUN_EXPORT_SCOPE_MISMATCH",
|
|
15626
|
+
{
|
|
15627
|
+
requestedRunId,
|
|
15628
|
+
statusRunId: status.runId || null,
|
|
15629
|
+
reason: "status_identity_mismatch"
|
|
15630
|
+
}
|
|
15631
|
+
);
|
|
15632
|
+
}
|
|
15201
15633
|
async function handlePlayGet(args) {
|
|
15202
15634
|
const target = args[0];
|
|
15203
15635
|
if (!target) {
|
|
@@ -16555,7 +16987,8 @@ JSON field selection:
|
|
|
16555
16987
|
resolvePlayRunCliOptions(
|
|
16556
16988
|
effectiveTarget ?? void 0,
|
|
16557
16989
|
options,
|
|
16558
|
-
passthroughArgs
|
|
16990
|
+
passthroughArgs,
|
|
16991
|
+
resolveCliMaintenancePolicy(command.optsWithGlobals())
|
|
16559
16992
|
)
|
|
16560
16993
|
);
|
|
16561
16994
|
recordCliTrace({
|
|
@@ -16762,7 +17195,7 @@ Examples:
|
|
|
16762
17195
|
process.exitCode = await ownView();
|
|
16763
17196
|
return;
|
|
16764
17197
|
}
|
|
16765
|
-
const { describeAnything } = await import("./describe-
|
|
17198
|
+
const { describeAnything } = await import("./describe-Q23DWJUK.mjs");
|
|
16766
17199
|
process.exitCode = await describeAnything(
|
|
16767
17200
|
name,
|
|
16768
17201
|
{
|
|
@@ -17151,12 +17584,13 @@ Examples:
|
|
|
17151
17584
|
deepline runs list --play my-play --status failed --compact
|
|
17152
17585
|
deepline runs list --status running --compact
|
|
17153
17586
|
`
|
|
17154
|
-
).option("--play <name>", "Play name to filter runs").option("--status <status>", "Filter by run status").option("--limit <count>", "Maximum runs to return").option("--offset <count>", "Zero-based page offset (requires --play)").option("--compact", "Drop verbose fields from JSON output").option("--json", "Emit JSON output").option(
|
|
17587
|
+
).option("--play <name>", "Play name to filter runs").option("--node <id>", "Mermaid node id to filter runs").option("--status <status>", "Filter by run status").option("--limit <count>", "Maximum runs to return").option("--offset <count>", "Zero-based page offset (requires --play)").option("--compact", "Drop verbose fields from JSON output").option("--json", "Emit JSON output").option(
|
|
17155
17588
|
"--timing",
|
|
17156
17589
|
"Report the inventory request duration and periodic long-read updates to stderr"
|
|
17157
17590
|
).action(async (options) => {
|
|
17158
17591
|
process.exitCode = await handleRunsList([
|
|
17159
17592
|
...options.play ? ["--play", options.play] : [],
|
|
17593
|
+
...options.node ? ["--node", options.node] : [],
|
|
17160
17594
|
...options.status ? ["--status", options.status] : [],
|
|
17161
17595
|
...options.limit ? ["--limit", options.limit] : [],
|
|
17162
17596
|
...options.offset ? ["--offset", options.offset] : [],
|
|
@@ -17812,6 +18246,7 @@ export {
|
|
|
17812
18246
|
resolveRunStopState,
|
|
17813
18247
|
selectRunLogTailPage,
|
|
17814
18248
|
shouldPrintPlayProgressLine,
|
|
18249
|
+
startAndWaitForPlayCompletion,
|
|
17815
18250
|
startAndWaitForPlayCompletionByStream,
|
|
17816
18251
|
truncateErrorForDisplay,
|
|
17817
18252
|
waitForPlayCompletionByWatch,
|