deepline 0.3.480 → 0.3.481

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.
Files changed (152) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +35 -1
  2. package/dist/bundling-sources/sdk/src/http-core.ts +2 -0
  3. package/dist/bundling-sources/sdk/src/plays/run-request.ts +54 -31
  4. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  5. package/dist/bundling-sources/shared_libs/monitors/legacy-radar-forward-routes.ts +569 -0
  6. package/dist/bundling-sources/shared_libs/monitors/legacy-radar-retirement.ts +451 -0
  7. package/dist/bundling-sources/shared_libs/monitors/package.json +5 -1
  8. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +18 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/runtime-array-input-receipts.ts +13 -6
  10. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +2 -0
  11. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +125 -22
  12. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +16 -53
  13. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +34 -48
  14. package/dist/bundling-sources/shared_libs/security/receipt-admission-token.ts +44 -0
  15. package/dist/cli/auth-EQWYBNIE.js +43 -0
  16. package/dist/cli/{auth-KMKFQX7X.mjs → auth-FYY65LYD.mjs} +5 -5
  17. package/dist/cli/{billing-G3Y5FTQM.mjs → billing-3MELYUTI.mjs} +7 -7
  18. package/dist/cli/{billing-R5RCTEW6.js → billing-TROHWBSE.js} +80 -80
  19. package/dist/cli/{chunk-4V6KEXCM.js → chunk-27BYXQU4.js} +1 -1
  20. package/dist/cli/{chunk-OQOXR6JL.js → chunk-4CIVXXSU.js} +26 -26
  21. package/dist/cli/{chunk-RPJSVGSC.js → chunk-5ONCPLWC.js} +16 -16
  22. package/dist/cli/{chunk-K7E2DO5P.js → chunk-6VKDKATO.js} +53 -53
  23. package/dist/cli/{chunk-WQBJHB63.js → chunk-6WWBVWFQ.js} +7 -7
  24. package/dist/cli/{chunk-LLEBPM3N.mjs → chunk-6ZMUAASO.mjs} +4 -4
  25. package/dist/cli/{chunk-IQ6WL36K.mjs → chunk-75LUK4E5.mjs} +1 -1
  26. package/dist/cli/{chunk-AKCYZDBO.mjs → chunk-7VVC4RZX.mjs} +1 -1
  27. package/dist/cli/{chunk-JBQKBDDN.mjs → chunk-ASQJUUGB.mjs} +5 -5
  28. package/dist/cli/{chunk-DIDWIPMA.mjs → chunk-BJ5UFTWL.mjs} +28 -7
  29. package/dist/cli/{chunk-JH77OHD5.js → chunk-BJMEXKZY.js} +2 -2
  30. package/dist/cli/{chunk-53LLOGNV.mjs → chunk-C7UIUKW6.mjs} +2 -2
  31. package/dist/cli/{chunk-LHU6BMDV.js → chunk-CM3KC74A.js} +3 -3
  32. package/dist/cli/{chunk-XNXE7YWI.mjs → chunk-CS2P3EQS.mjs} +2 -2
  33. package/dist/cli/{chunk-APFFHSPL.js → chunk-CUSWZTS7.js} +8 -8
  34. package/dist/cli/{chunk-6AYQK7Z6.js → chunk-D3UHG54V.js} +199 -178
  35. package/dist/cli/{chunk-PM2CT7HZ.mjs → chunk-EJTU6X6C.mjs} +3 -3
  36. package/dist/cli/{chunk-FZX2DGQZ.js → chunk-EPEAQA6O.js} +37 -37
  37. package/dist/cli/{chunk-57MJL2HU.mjs → chunk-EPZSX7FZ.mjs} +4 -4
  38. package/dist/cli/{chunk-FZ42SO3Q.mjs → chunk-FXLMDAAY.mjs} +1 -1
  39. package/dist/cli/chunk-GBAT5NMI.mjs +789 -0
  40. package/dist/cli/{chunk-VPO2D7WV.js → chunk-GJOKFJ2Y.js} +10 -10
  41. package/dist/cli/{chunk-JDMR33HS.js → chunk-GVAENVIG.js} +28 -19
  42. package/dist/cli/{chunk-NELMCOWK.mjs → chunk-HNRELVCS.mjs} +27 -18
  43. package/dist/cli/{chunk-SUTQCM7U.mjs → chunk-HXG7TYRS.mjs} +2 -2
  44. package/dist/cli/{chunk-PDDUX5UY.js → chunk-J4D3PCQ2.js} +5 -5
  45. package/dist/cli/{chunk-PC42DFZC.mjs → chunk-JE27DTQM.mjs} +3 -3
  46. package/dist/cli/{chunk-MEJJD7PA.js → chunk-KDU6TSGE.js} +2 -2
  47. package/dist/cli/{chunk-NVTVS4AV.js → chunk-KPXP2DIY.js} +7 -9
  48. package/dist/cli/chunk-KQSTV4MW.js +789 -0
  49. package/dist/cli/{chunk-2AYWC63S.mjs → chunk-LISZBUA7.mjs} +2 -2
  50. package/dist/cli/{chunk-44TVNYYV.mjs → chunk-LTOY2GUJ.mjs} +10 -10
  51. package/dist/cli/{chunk-OGXG46LY.js → chunk-MKDWU3ZI.js} +93 -93
  52. package/dist/cli/{chunk-MTMOYZMK.mjs → chunk-N5267HEH.mjs} +1 -1
  53. package/dist/cli/{chunk-T7EWDIVM.mjs → chunk-PDJS6LFI.mjs} +2 -1
  54. package/dist/cli/{chunk-QEV3GFDS.js → chunk-R4EFW2I2.js} +3 -3
  55. package/dist/cli/{chunk-KQNQCZLB.mjs → chunk-RV2GB7KW.mjs} +2 -2
  56. package/dist/cli/{chunk-PYIWO4GS.mjs → chunk-S5BM6NPJ.mjs} +3 -5
  57. package/dist/cli/{chunk-7LMLHUCP.mjs → chunk-S5WXSC3P.mjs} +5 -5
  58. package/dist/cli/{chunk-63QH6FL3.mjs → chunk-SOGLBLMH.mjs} +4 -4
  59. package/dist/cli/{chunk-5IVGZCKY.js → chunk-SVPM2E2U.js} +5 -5
  60. package/dist/cli/{chunk-ZSWY5E3W.mjs → chunk-UUGSZZZH.mjs} +1 -1
  61. package/dist/cli/{chunk-TBJ23WKT.js → chunk-VBDR2DP6.js} +3 -3
  62. package/dist/cli/{chunk-TXFURKHD.mjs → chunk-VRAOWHXJ.mjs} +1 -1
  63. package/dist/cli/{chunk-ASARTL6E.mjs → chunk-VTKAIGW6.mjs} +3 -3
  64. package/dist/cli/{chunk-DQYJXVAF.js → chunk-WF5QE2IW.js} +17 -16
  65. package/dist/cli/{chunk-NBXG4S2X.js → chunk-WICQQ7GY.js} +53 -53
  66. package/dist/cli/{chunk-FFSOXQEM.js → chunk-WTWRZ5ZI.js} +8 -8
  67. package/dist/cli/{chunk-LBZLV6QF.js → chunk-X4XZFIK6.js} +14 -14
  68. package/dist/cli/{chunk-A3PZKD47.js → chunk-X6MEQBAT.js} +21 -21
  69. package/dist/cli/{csv-P3AEI4G4.mjs → csv-2EG7JW7V.mjs} +4 -4
  70. package/dist/cli/{csv-57D62T7L.js → csv-OUALOZBF.js} +13 -13
  71. package/dist/cli/{db-FWFYU34R.js → db-7BTOI6YB.js} +28 -28
  72. package/dist/cli/{db-PJQMPZJP.mjs → db-ECDQWI2Y.mjs} +7 -7
  73. package/dist/cli/describe-EXSH6OZD.js +48 -0
  74. package/dist/cli/{describe-F57VZZML.mjs → describe-KO6WKQIB.mjs} +18 -18
  75. package/dist/cli/describe-core.d.mts +2 -2
  76. package/dist/cli/describe-core.d.ts +2 -2
  77. package/dist/cli/{executions-ZAJGMAAT.mjs → executions-3VMFBZT4.mjs} +7 -7
  78. package/dist/cli/{executions-YBT7NTY5.js → executions-VZSG3F3E.js} +9 -9
  79. package/dist/cli/{feedback-YLYY2EG4.js → feedback-ASKBWRXR.js} +8 -8
  80. package/dist/cli/{feedback-L3ZQCSY6.mjs → feedback-SN7AVALN.mjs} +4 -4
  81. package/dist/cli/{git-M7735NWJ.mjs → git-W2DZXEAY.mjs} +5 -5
  82. package/dist/cli/git-X2XUKYYX.js +25 -0
  83. package/dist/cli/index.js +167 -144
  84. package/dist/cli/index.mjs +73 -50
  85. package/dist/cli/{legacy-noops-TX37UP3U.js → legacy-noops-6KOC6LV7.js} +8 -8
  86. package/dist/cli/{legacy-noops-PKNMQMGY.mjs → legacy-noops-R2SML7ED.mjs} +5 -5
  87. package/dist/cli/{monitors-U7AUIOFZ.mjs → monitors-4VGZGJBT.mjs} +8 -8
  88. package/dist/cli/{monitors-5YTGQSGD.js → monitors-OJXDYU4G.js} +92 -92
  89. package/dist/cli/{org-N6DSSLLD.js → org-AELMZFUT.js} +73 -73
  90. package/dist/cli/{org-SRKZRVVH.mjs → org-UGN5ZG2Y.mjs} +7 -7
  91. package/dist/cli/{pages-YPN54RCC.js → pages-L26N7MK3.js} +18 -18
  92. package/dist/cli/{pages-UOPJUFCF.mjs → pages-ZYPAAYSS.mjs} +7 -7
  93. package/dist/cli/{play-4IK4WXWU.mjs → play-ENYB7X4S.mjs} +125 -53
  94. package/dist/cli/{play-MEYZEYOV.js → play-VTZWB3N5.js} +620 -548
  95. package/dist/cli/{providers-UGHUYP4C.mjs → providers-BZQTVAQG.mjs} +7 -7
  96. package/dist/cli/{providers-VS5MK4ZH.js → providers-HWBY6MGQ.js} +10 -10
  97. package/dist/cli/{quickstart-GW2ERQ2A.js → quickstart-D54IJ3PX.js} +6 -6
  98. package/dist/cli/{quickstart-YBOQSLFV.mjs → quickstart-SSQJDWPB.mjs} +4 -4
  99. package/dist/cli/{run-IVGMLY3J.js → run-45NKE7UY.js} +37 -37
  100. package/dist/cli/{run-44JT5GJM.mjs → run-FR3TPYT3.mjs} +23 -23
  101. package/dist/cli/{search-43NY73VR.mjs → search-CZCWSR5L.mjs} +8 -8
  102. package/dist/cli/search-V2GJKQQQ.js +32 -0
  103. package/dist/cli/{secrets-DABUD3B7.js → secrets-KJ5ZEDWT.js} +16 -16
  104. package/dist/cli/{secrets-ONDQGW3B.mjs → secrets-KKK55B4Y.mjs} +7 -7
  105. package/dist/cli/{sessions-AIAKKLSR.mjs → sessions-2YKA54PH.mjs} +5 -5
  106. package/dist/cli/{sessions-4ILQMBKR.js → sessions-QCNPUTDZ.js} +6 -6
  107. package/dist/cli/{settings-HSGKYOJT.mjs → settings-4NI2AS5V.mjs} +12 -12
  108. package/dist/cli/{settings-BWNLL7TP.js → settings-KM3LCPWD.js} +79 -79
  109. package/dist/cli/{setup-LE4OVH4M.mjs → setup-BZF3M54I.mjs} +9 -9
  110. package/dist/cli/{setup-37QOD4UT.js → setup-V5MTS2AA.js} +47 -47
  111. package/dist/cli/skills-CRFYW767.js +33 -0
  112. package/dist/cli/{skills-A3ZVR2YX.mjs → skills-NXYNB3LP.mjs} +7 -7
  113. package/dist/cli/{tools-ITKPPUDT.mjs → tools-57MWFRIZ.mjs} +17 -17
  114. package/dist/cli/tools-Q662HPVJ.js +55 -0
  115. package/dist/cli/{update-XJOSCOK5.mjs → update-QM6H677U.mjs} +9 -9
  116. package/dist/cli/update-TYHKF7F5.js +33 -0
  117. package/dist/cli/{workflow-KYQYFSND.mjs → workflow-NHYDIUWY.mjs} +8 -8
  118. package/dist/cli/{workflow-LERZ3TYV.js → workflow-TGEC4ITO.js} +18 -18
  119. package/dist/{client-B9N1bcGc.d.mts → client-DJ3r8VQJ.d.mts} +1 -1
  120. package/dist/{client-Btw075Hq.d.ts → client-JPSNljtj.d.ts} +1 -1
  121. package/dist/{client-core-TulbIeRB.d.mts → client-core-3SJlNsKU.d.mts} +21 -2
  122. package/dist/{client-core-DvGWlwtX.d.ts → client-core-rCoQ5Xz3.d.ts} +21 -2
  123. package/dist/index.d.mts +3 -3
  124. package/dist/index.d.ts +3 -3
  125. package/dist/index.js +10 -10
  126. package/dist/index.mjs +7 -7
  127. package/dist/install-integrity.json +106 -104
  128. package/dist/plays/bundle-play-file.mjs +5426 -12
  129. package/dist/plays/play-description.d.mts +1 -1
  130. package/dist/plays/play-description.d.ts +1 -1
  131. package/dist/plays/run-request.d.mts +1 -1
  132. package/dist/plays/run-request.d.ts +1 -1
  133. package/dist/plays/run-request.js +4 -2
  134. package/dist/plays/run-request.mjs +3 -1
  135. package/dist/release.d.mts +1 -1
  136. package/dist/release.d.ts +1 -1
  137. package/dist/release.js +2 -2
  138. package/dist/release.mjs +1 -1
  139. package/dist/server.d.mts +2 -2
  140. package/dist/server.d.ts +2 -2
  141. package/dist/server.js +6 -6
  142. package/dist/server.mjs +4 -4
  143. package/package.json +1 -1
  144. package/dist/cli/auth-7FOB243B.js +0 -43
  145. package/dist/cli/chunk-7UFFWPQ2.js +0 -6188
  146. package/dist/cli/chunk-ZBSUXXZS.mjs +0 -6188
  147. package/dist/cli/describe-ZAYUBNUQ.js +0 -48
  148. package/dist/cli/git-A3433UTN.js +0 -25
  149. package/dist/cli/search-2XTYY7BF.js +0 -32
  150. package/dist/cli/skills-TULQXRQJ.js +0 -33
  151. package/dist/cli/tools-QYYBWDXU.js +0 -55
  152. package/dist/cli/update-XSMY7KWH.js +0 -33
@@ -5,7 +5,7 @@ import {
5
5
  parsePlayRunHeaderFlag,
6
6
  parsePlayRunOptions,
7
7
  resolvePlayRunCliOptions
8
- } from "./chunk-ASARTL6E.mjs";
8
+ } from "./chunk-VTKAIGW6.mjs";
9
9
  import {
10
10
  TABLE_EXPORT_ERROR_COLUMN,
11
11
  addDescribeOptions,
@@ -17,14 +17,14 @@ import {
17
17
  underscoreKeysLast,
18
18
  writeExecutionOutput,
19
19
  writeRunDatasetCsv
20
- } from "./chunk-AKCYZDBO.mjs";
20
+ } from "./chunk-7VVC4RZX.mjs";
21
21
  import {
22
22
  registerDeprecatedSearchCommand
23
- } from "./chunk-PC42DFZC.mjs";
23
+ } from "./chunk-JE27DTQM.mjs";
24
24
  import {
25
25
  handleDeploymentGet,
26
26
  handleDeploymentsList
27
- } from "./chunk-XNXE7YWI.mjs";
27
+ } from "./chunk-CS2P3EQS.mjs";
28
28
  import {
29
29
  buildPlayDashboardUrl
30
30
  } from "./chunk-JVHOS3K3.mjs";
@@ -35,16 +35,14 @@ import "./chunk-LJ5747UC.mjs";
35
35
  import {
36
36
  INLINE_PLAY_FILE,
37
37
  PLAY_DEFAULT_EXPORT,
38
- extractDefinedPlayName,
39
38
  inlinePlaySource,
40
39
  isAstNode,
41
40
  listPlayFileExports,
42
41
  parsePlaySourceForAnalysis
43
- } from "./chunk-ZBSUXXZS.mjs";
42
+ } from "./chunk-GBAT5NMI.mjs";
44
43
  import {
45
44
  resolveEnabledExecutionProfile
46
45
  } from "./chunk-F6QV42MC.mjs";
47
- import "./chunk-H7HIDGZ7.mjs";
48
46
  import {
49
47
  MAX_PLAY_SANDBOX_RUNTIME_LIMITS,
50
48
  PLAY_SANDBOX_SIZE_LIMITS,
@@ -53,18 +51,16 @@ import {
53
51
  playSandboxSizeForLimits,
54
52
  resolvePlaySandboxRuntimeLimits
55
53
  } from "./chunk-7I4B6V2S.mjs";
56
- import "./chunk-FR2ILQ4G.mjs";
57
54
  import {
58
55
  parseCsvDataInput
59
56
  } from "./chunk-OZDT2CZW.mjs";
60
57
  import {
61
58
  pinLocalPlayImports,
62
59
  planLocalPlayExecution
63
- } from "./chunk-KQNQCZLB.mjs";
60
+ } from "./chunk-RV2GB7KW.mjs";
64
61
  import {
65
62
  DeeplineClient
66
- } from "./chunk-2AYWC63S.mjs";
67
- import "./chunk-ZCALLYF6.mjs";
63
+ } from "./chunk-LISZBUA7.mjs";
68
64
  import {
69
65
  RUN_EVENT_SEARCH_KIND_VALUES,
70
66
  RunEventQueryInputError,
@@ -77,7 +73,7 @@ import {
77
73
  normalizePlayStatus,
78
74
  normalizeRunEventOperationRequest,
79
75
  parseLogLevel
80
- } from "./chunk-DIDWIPMA.mjs";
76
+ } from "./chunk-BJ5UFTWL.mjs";
81
77
  import "./chunk-L2VKAASU.mjs";
82
78
  import {
83
79
  CSV_DATA_INPUT_KEY,
@@ -88,7 +84,7 @@ import {
88
84
  fileInputBindingsFromStaticPipeline,
89
85
  stageFileInputs,
90
86
  stagedFileContentType
91
- } from "./chunk-NELMCOWK.mjs";
87
+ } from "./chunk-HNRELVCS.mjs";
92
88
  import {
93
89
  CSV_HEADER_MATCHING_NOTE,
94
90
  playInputExampleArgs
@@ -97,18 +93,18 @@ import "./chunk-UBKA33KY.mjs";
97
93
  import {
98
94
  checkPlayRunCompatibility,
99
95
  usesInlinePlayAdmission
100
- } from "./chunk-PYIWO4GS.mjs";
96
+ } from "./chunk-S5BM6NPJ.mjs";
101
97
  import {
102
98
  isCliTraceEnabled,
103
99
  recordCliTrace,
104
100
  resolveCliMaintenancePolicy,
105
101
  traceCliSpan
106
- } from "./chunk-MTMOYZMK.mjs";
107
- import "./chunk-57MJL2HU.mjs";
102
+ } from "./chunk-N5267HEH.mjs";
103
+ import "./chunk-EPZSX7FZ.mjs";
108
104
  import {
109
105
  createCliProgress,
110
106
  getActiveCliProgress
111
- } from "./chunk-ZSWY5E3W.mjs";
107
+ } from "./chunk-UUGSZZZH.mjs";
112
108
  import {
113
109
  argsWantJson,
114
110
  describeArgs,
@@ -122,17 +118,17 @@ import {
122
118
  printJsonError,
123
119
  renderCommandEnvelopeText,
124
120
  shouldEmitJson
125
- } from "./chunk-53LLOGNV.mjs";
126
- import "./chunk-TXFURKHD.mjs";
121
+ } from "./chunk-C7UIUKW6.mjs";
122
+ import "./chunk-VRAOWHXJ.mjs";
127
123
  import {
128
124
  fetchWithDeploymentProtection
129
- } from "./chunk-T7EWDIVM.mjs";
125
+ } from "./chunk-PDJS6LFI.mjs";
130
126
  import "./chunk-4QF2K7TM.mjs";
131
127
  import "./chunk-DLIRSHV6.mjs";
132
128
  import {
133
129
  DeeplineError
134
130
  } from "./chunk-HBL4PM5Q.mjs";
135
- import "./chunk-FZ42SO3Q.mjs";
131
+ import "./chunk-FXLMDAAY.mjs";
136
132
  import "./chunk-WZYKRD7T.mjs";
137
133
  import {
138
134
  __commonJS,
@@ -7524,7 +7520,8 @@ function buildMissingDefinePlayError(filePath) {
7524
7520
  `Play file ${filePath} is not a play. Write the play as \`import deepline from 'deepline'; export default async function (input: T) { ... return { ... }; }\`.`
7525
7521
  );
7526
7522
  }
7527
- function extractPlayName(code, filePath) {
7523
+ async function extractPlayName(code, filePath) {
7524
+ const { extractDefinedPlayName } = await loadPlayBundler();
7528
7525
  const definedPlayName = extractDefinedPlayName(code, filePath);
7529
7526
  if (definedPlayName) {
7530
7527
  return definedPlayName;
@@ -7808,7 +7805,7 @@ async function compileBundledPlayGraphManifests(client, graph) {
7808
7805
  }
7809
7806
  await compileNode(child);
7810
7807
  }
7811
- const name = node.playName ?? extractPlayName(node.sourceCode, node.filePath);
7808
+ const name = node.playName ?? await extractPlayName(node.sourceCode, node.filePath);
7812
7809
  node.compilerManifest = await client.compilePlayManifest({
7813
7810
  name,
7814
7811
  sourceCode: node.sourceCode,
@@ -8543,7 +8540,10 @@ async function waitForPlayCompletionByWatch(input) {
8543
8540
  admissionConfirmed = true;
8544
8541
  await input.onRunAdmitted?.(input.workflowId);
8545
8542
  };
8546
- const withDashboardUrl = (status) => input.dashboardUrl ? { ...status, dashboardUrl: input.dashboardUrl } : status;
8543
+ const withDashboardUrl = (status) => carryFullDurableTerminalStatus(
8544
+ status,
8545
+ input.dashboardUrl ? { ...status, dashboardUrl: input.dashboardUrl } : status
8546
+ );
8547
8547
  const finishTerminalStatus = async (status) => {
8548
8548
  if (status.runId === input.workflowId && statusProvesPlayRunExecution(status.status)) {
8549
8549
  await confirmAdmission();
@@ -8836,10 +8836,19 @@ async function startAndWaitForPlayCompletion(input) {
8836
8836
  return input.request.revisionId ? { ...status, revisionId: input.request.revisionId } : status;
8837
8837
  }
8838
8838
  async function startAndWaitForPlayCompletionByStream(input) {
8839
- const prepared = await input.client.preparePlayRunAdmission(input.request, {
8840
- cliAdmission: input.cliAdmission,
8841
- onSubmission: input.onSubmission
8842
- });
8839
+ const admissionStartedAt = Date.now();
8840
+ const prepared = await input.client.preparePlayRunAdmission(
8841
+ {
8842
+ ...input.request,
8843
+ ...input.jsonOutput && input.fullJson === true ? { terminalStatus: "full" } : {}
8844
+ },
8845
+ {
8846
+ cliAdmission: input.cliAdmission,
8847
+ onSubmission: input.onSubmission,
8848
+ ...input.admissionCapability ? { admissionCapability: input.admissionCapability } : {}
8849
+ }
8850
+ );
8851
+ const remainingWaitTimeout = () => input.waitTimeoutMs === null ? null : Math.max(1, input.waitTimeoutMs - (Date.now() - admissionStartedAt));
8843
8852
  const pinnedInput = {
8844
8853
  ...input,
8845
8854
  request: prepared.body,
@@ -8848,12 +8857,18 @@ async function startAndWaitForPlayCompletionByStream(input) {
8848
8857
  };
8849
8858
  const retryDelays = prepared.supportsCallerIntent ? PLAY_START_TRANSIENT_RETRY_DELAYS_MS : [];
8850
8859
  for (let attempt = 0; attempt <= retryDelays.length; attempt += 1) {
8860
+ assertPlayWaitNotTimedOut({
8861
+ workflowId: prepared.workflowId ?? "",
8862
+ startedAt: admissionStartedAt,
8863
+ waitTimeoutMs: input.waitTimeoutMs
8864
+ });
8851
8865
  let status;
8852
8866
  try {
8853
8867
  const notice = { value: null };
8854
8868
  status = withRateLimitedNotice(
8855
8869
  await startAndWaitForPlayCompletionByStreamOnce({
8856
8870
  ...pinnedInput,
8871
+ waitTimeoutMs: remainingWaitTimeout(),
8857
8872
  rateLimitedNotice: notice
8858
8873
  }),
8859
8874
  notice.value
@@ -8864,10 +8879,19 @@ async function startAndWaitForPlayCompletionByStream(input) {
8864
8879
  input.client.baseUrl,
8865
8880
  input.maintenancePolicy
8866
8881
  );
8867
- return startAndWaitForPlayCompletion({
8882
+ assertPlayWaitNotTimedOut({
8883
+ workflowId: prepared.workflowId ?? "",
8884
+ startedAt: admissionStartedAt,
8885
+ waitTimeoutMs: input.waitTimeoutMs
8886
+ });
8887
+ const legacyStart = input.onSubmission ? startAndWaitForPlayCompletionByStream : startAndWaitForPlayCompletion;
8888
+ return legacyStart({
8868
8889
  ...input,
8890
+ request: prepared.body,
8891
+ onSubmission: void 0,
8869
8892
  cliAdmission: false,
8870
- streamTerminalWindowMs: void 0
8893
+ streamTerminalWindowMs: void 0,
8894
+ waitTimeoutMs: remainingWaitTimeout()
8871
8895
  });
8872
8896
  }
8873
8897
  if (!(error instanceof RetryablePlayStartAttemptError)) throw error;
@@ -9006,6 +9030,11 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9006
9030
  signal: controller.signal
9007
9031
  })) {
9008
9032
  eventCount += 1;
9033
+ const expectedFullRunId = input.request.workflowId?.trim() || lastKnownWorkflowId;
9034
+ const eventRunId = getRunIdFromLiveEvent(event);
9035
+ const pinnedRunId = input.fullJson === true && input.request.terminalStatus === "full" ? input.request.workflowId?.trim() : void 0;
9036
+ if (pinnedRunId && eventRunId && eventRunId !== "pending" && eventRunId !== pinnedRunId)
9037
+ continue;
9009
9038
  const eventRevisionId = getStringField(
9010
9039
  getEventPayload(event),
9011
9040
  "revisionId"
@@ -9017,7 +9046,6 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9017
9046
  if (eventRateLimited && typeof eventRateLimited === "object") {
9018
9047
  notice.value = eventRateLimited;
9019
9048
  }
9020
- const eventRunId = getRunIdFromLiveEvent(event);
9021
9049
  if (typeof eventRunId === "string" && eventRunId && eventRunId !== "pending") {
9022
9050
  const runStartedNow = !lastKnownWorkflowId;
9023
9051
  lastKnownWorkflowId = eventRunId;
@@ -9112,9 +9140,12 @@ async function startAndWaitForPlayCompletionByStreamOnce(input) {
9112
9140
  ...launchedRevisionId ? { revisionId: launchedRevisionId } : {}
9113
9141
  };
9114
9142
  }
9115
- let fromDurableStatus = false;
9143
+ const fullPackage = getPlayRunPackage(finalStatus);
9144
+ const fullRun = readRecord(fullPackage?.run);
9145
+ 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") && fullPackage.stepsExpected === false && Array.isArray(fullPackage.steps) && fullPackage.steps.length === 0 && Array.isArray(fullPackage.datasets) && fullPackage.datasets.length === 0;
9146
+ let fromDurableStatus = reuseFullTerminal;
9116
9147
  let canonicalTerminal;
9117
- if (input.request.profile === "absurd") {
9148
+ if (input.request.profile === "absurd" && !reuseFullTerminal) {
9118
9149
  canonicalTerminal = await fetchKnownTerminalStatus();
9119
9150
  fromDurableStatus = canonicalTerminal !== null;
9120
9151
  } else {
@@ -10914,11 +10945,11 @@ function playRunRateLimitedNotice(status) {
10914
10945
  function withRateLimitedNotice(status, notice) {
10915
10946
  if (!notice) return status;
10916
10947
  const packaged = getPlayRunPackage(status);
10917
- if (!packaged) return { ...status, rateLimited: notice };
10918
- return packaged === status ? { ...status, rateLimited: notice } : {
10948
+ const withNotice = !packaged || packaged === status ? { ...status, rateLimited: notice } : {
10919
10949
  ...status,
10920
10950
  package: { ...packaged, rateLimited: notice }
10921
10951
  };
10952
+ return carryFullDurableTerminalStatus(status, withNotice);
10922
10953
  }
10923
10954
  function buildRunLaunch(status) {
10924
10955
  const compact = compactPlayStatus(status);
@@ -11115,16 +11146,27 @@ function playRunPackageTextLedgerIncomplete(pkg) {
11115
11146
  }
11116
11147
  return false;
11117
11148
  }
11149
+ var fullDurableTerminalStatuses = /* @__PURE__ */ new WeakSet();
11150
+ function carryFullDurableTerminalStatus(source, target) {
11151
+ if (fullDurableTerminalStatuses.has(source)) {
11152
+ fullDurableTerminalStatuses.add(target);
11153
+ }
11154
+ return target;
11155
+ }
11118
11156
  async function resolvePlayRunOutputStatus(input) {
11119
11157
  const runId = input.status.runId;
11120
11158
  if (!runId || runId === "pending") {
11121
11159
  return input.status;
11122
11160
  }
11123
11161
  const streamedPackage = getPlayRunPackage(input.status);
11124
- const refreshForFullJson = input.fullJson && !input.fromDurableStatus;
11162
+ const fromDurableStatus = input.fromDurableStatus === true || fullDurableTerminalStatuses.has(input.status);
11163
+ const refreshForFullJson = input.fullJson && !fromDurableStatus;
11125
11164
  const streamedTextPackageIncomplete = input.status.status === "completed" && playRunPackageTextLedgerIncomplete(streamedPackage);
11126
- const refreshFailedTerminal = input.status.status === "failed" && (!input.fromDurableStatus || readRecord(streamedPackage?.run)?.status !== "failed");
11165
+ const refreshFailedTerminal = input.status.status === "failed" && (!fromDurableStatus || readRecord(streamedPackage?.run)?.status !== "failed");
11127
11166
  if (!refreshForFullJson && !streamedTextPackageIncomplete && !refreshFailedTerminal) {
11167
+ if (input.fullJson && fromDurableStatus && TERMINAL_PLAY_STATUSES.has(input.status.status)) {
11168
+ fullDurableTerminalStatuses.add(input.status);
11169
+ }
11128
11170
  return input.status;
11129
11171
  }
11130
11172
  let refreshedStatus = await input.client.getPlayStatus(runId, {
@@ -11145,7 +11187,11 @@ async function resolvePlayRunOutputStatus(input) {
11145
11187
  return input.status;
11146
11188
  }
11147
11189
  const dashboardUrl = input.status.dashboardUrl;
11148
- return typeof dashboardUrl === "string" ? { ...refreshedStatus, dashboardUrl } : refreshedStatus;
11190
+ const resolved = typeof dashboardUrl === "string" ? { ...refreshedStatus, dashboardUrl } : refreshedStatus;
11191
+ if (input.fullJson && TERMINAL_PLAY_STATUSES.has(resolved.status)) {
11192
+ fullDurableTerminalStatuses.add(resolved);
11193
+ }
11194
+ return resolved;
11149
11195
  }
11150
11196
  var RUN_EXPORT_PAGE_SIZE = 5e3;
11151
11197
  function runExportRetryCommand(runId, outPath, datasetPath, options = {}) {
@@ -12373,7 +12419,7 @@ function artifactForProductionCompatibilityCheck(artifact) {
12373
12419
  }
12374
12420
  async function checkOneExportedPlay(input) {
12375
12421
  const { absolutePlayPath, sourceCode, exportName } = input;
12376
- const fallbackName = extractPlayName(sourceCode, absolutePlayPath);
12422
+ const fallbackName = await extractPlayName(sourceCode, absolutePlayPath);
12377
12423
  let graph;
12378
12424
  try {
12379
12425
  graph = await collectBundledPlayGraph(absolutePlayPath, null, exportName);
@@ -12443,6 +12489,8 @@ async function handleFileBackedRun(options, hooks) {
12443
12489
  throw new Error("Expected a file-backed play run target.");
12444
12490
  }
12445
12491
  let client;
12492
+ let prefetchClient;
12493
+ let admissionCapability;
12446
12494
  let cliAdmission = usesInlinePlayAdmission(
12447
12495
  "plays run",
12448
12496
  process.argv.slice(2)
@@ -12462,6 +12510,16 @@ async function handleFileBackedRun(options, hooks) {
12462
12510
  console.error(error instanceof Error ? error.message : String(error));
12463
12511
  return 1;
12464
12512
  }
12513
+ if (!options.dryRun && options.watch && cliAdmission && options.maxTotalCredits === null && !inputContainsLocalFilePath(runtimeInput)) {
12514
+ const clientForPrefetch = new DeeplineClient(playRunClientOptions(options));
12515
+ prefetchClient = clientForPrefetch;
12516
+ admissionCapability = traceCliSpan(
12517
+ "cli.play_admission_capability_prefetch",
12518
+ { targetKind: "file" },
12519
+ () => clientForPrefetch.prefetchPlayRunAdmissionCapability()
12520
+ );
12521
+ void admissionCapability.catch(() => void 0);
12522
+ }
12465
12523
  let graph;
12466
12524
  try {
12467
12525
  graph = await traceCliSpan(
@@ -12483,7 +12541,7 @@ async function handleFileBackedRun(options, hooks) {
12483
12541
  );
12484
12542
  return 0;
12485
12543
  }
12486
- client = new DeeplineClient(playRunClientOptions(options));
12544
+ client = prefetchClient ?? new DeeplineClient(playRunClientOptions(options));
12487
12545
  if (cliAdmission && (graph.root.importedPlayDependencies.length > 0 || inputContainsLocalFilePath(runtimeInput))) {
12488
12546
  await checkPlayRunCompatibility(
12489
12547
  client.baseUrl,
@@ -12493,7 +12551,7 @@ async function handleFileBackedRun(options, hooks) {
12493
12551
  }
12494
12552
  await preflightPlayRunTotalBudget({
12495
12553
  client,
12496
- playName: graph.root.playName ?? extractPlayName(sourceCode, absolutePlayPath),
12554
+ playName: graph.root.playName ?? await extractPlayName(sourceCode, absolutePlayPath),
12497
12555
  maxTotalCredits: options.maxTotalCredits
12498
12556
  });
12499
12557
  const canDeferCompilerManifest = graph.root.importedPlayDependencies.length === 0 && !sourceGraphMentionsRunPlay(graph.root) && !inputContainsLocalFilePath(runtimeInput);
@@ -12523,7 +12581,7 @@ async function handleFileBackedRun(options, hooks) {
12523
12581
  return 1;
12524
12582
  }
12525
12583
  let bundleResult = graph.root;
12526
- const playName = bundleResult.playName ?? extractPlayName(sourceCode, absolutePlayPath);
12584
+ const playName = bundleResult.playName ?? await extractPlayName(sourceCode, absolutePlayPath);
12527
12585
  printBundledRuntimeWarning(bundleResult);
12528
12586
  if (bundleResult.importedPlayDependencies.length > 0) {
12529
12587
  try {
@@ -12615,10 +12673,11 @@ async function handleFileBackedRun(options, hooks) {
12615
12673
  onSubmission: hooks?.onSubmission,
12616
12674
  onRunAdmitted: hooks?.onRunAdmitted,
12617
12675
  maintenancePolicy: options.maintenancePolicy,
12618
- ...options.runIdFile ? {} : { fullJson: options.fullJson },
12676
+ ...!options.runIdFile || options.fullJson ? { fullJson: options.fullJson } : {},
12619
12677
  ...cliAdmission ? {
12620
12678
  cliAdmission: true,
12621
- streamTerminalWindowMs: PLAY_START_STREAM_TERMINAL_WINDOW_MS
12679
+ streamTerminalWindowMs: PLAY_START_STREAM_TERMINAL_WINDOW_MS,
12680
+ ...admissionCapability ? { admissionCapability } : {}
12622
12681
  } : {}
12623
12682
  }).catch(async (error) => {
12624
12683
  throw await normalizePlayStartError(client, error, playName);
@@ -12726,6 +12785,15 @@ async function handleNamedRun(options, hooks) {
12726
12785
  runtimeInput,
12727
12786
  revisionSelector: options.revisionSelector
12728
12787
  });
12788
+ let admissionCapability;
12789
+ if (options.watch && cliAdmission && options.maxTotalCredits === null && !needsPlayDefinition && !inputContainsLocalFilePath(runtimeInput)) {
12790
+ admissionCapability = traceCliSpan(
12791
+ "cli.play_admission_capability_prefetch",
12792
+ { targetKind: "name", playName },
12793
+ () => client.prefetchPlayRunAdmissionCapability()
12794
+ );
12795
+ void admissionCapability.catch(() => void 0);
12796
+ }
12729
12797
  const playDetail = needsPlayDefinition ? await (async () => {
12730
12798
  progress.phase("loading play definition");
12731
12799
  return traceCliSpan(
@@ -12834,10 +12902,11 @@ async function handleNamedRun(options, hooks) {
12834
12902
  onSubmission: hooks?.onSubmission,
12835
12903
  onRunAdmitted: hooks?.onRunAdmitted,
12836
12904
  maintenancePolicy: options.maintenancePolicy,
12837
- ...options.runIdFile ? {} : { fullJson: options.fullJson },
12905
+ ...!options.runIdFile || options.fullJson ? { fullJson: options.fullJson } : {},
12838
12906
  ...cliAdmission ? {
12839
12907
  cliAdmission: true,
12840
- streamTerminalWindowMs: PLAY_START_STREAM_TERMINAL_WINDOW_MS
12908
+ streamTerminalWindowMs: PLAY_START_STREAM_TERMINAL_WINDOW_MS,
12909
+ ...admissionCapability ? { admissionCapability } : {}
12841
12910
  } : {}
12842
12911
  }).catch(async (error) => {
12843
12912
  throw await normalizePlayStartError(client, error, playName, {
@@ -14708,7 +14777,10 @@ async function handlePlayGet(args) {
14708
14777
  );
14709
14778
  return 2;
14710
14779
  }
14711
- const playName = isFileTarget(target) ? extractPlayName(readFileSync(resolve3(target), "utf-8"), resolve3(target)) : parseReferencedPlayTarget(target).playName;
14780
+ const playName = isFileTarget(target) ? await extractPlayName(
14781
+ readFileSync(resolve3(target), "utf-8"),
14782
+ resolve3(target)
14783
+ ) : parseReferencedPlayTarget(target).playName;
14712
14784
  const includeSource = sourceOutput || outPath !== null;
14713
14785
  const detail = isFileTarget(target) ? await client.getPlay(
14714
14786
  playName,
@@ -15195,9 +15267,9 @@ async function handlePlayDescribe(args) {
15195
15267
  }
15196
15268
  if (isFileTarget(playName) || looksLikeFilePath(playName)) {
15197
15269
  const message = "Local play files can be checked and run, but describe only supports saved/prebuilt play references.";
15198
- const definedName = isFileTarget(playName) ? (() => {
15270
+ const definedName = isFileTarget(playName) ? await (async () => {
15199
15271
  try {
15200
- return extractPlayName(
15272
+ return await extractPlayName(
15201
15273
  readFileSync(resolve3(playName), "utf-8"),
15202
15274
  playName
15203
15275
  );
@@ -15268,7 +15340,7 @@ async function handlePlaySave(args) {
15268
15340
  console.error(error instanceof Error ? error.message : String(error));
15269
15341
  return 7;
15270
15342
  }
15271
- const playName = graph.root.playName ?? extractPlayName(graph.root.sourceCode, graph.root.filePath);
15343
+ const playName = graph.root.playName ?? await extractPlayName(graph.root.sourceCode, graph.root.filePath);
15272
15344
  const artifactHash = graph.root.artifact.artifactHash;
15273
15345
  if (options.expectedArtifactHash && options.expectedArtifactHash !== artifactHash) {
15274
15346
  const result = {
@@ -15393,7 +15465,7 @@ async function handlePlayPublish(args) {
15393
15465
  console.error(error instanceof Error ? error.message : String(error));
15394
15466
  return 1;
15395
15467
  }
15396
- const rootPlayName = graph.root.playName ?? extractPlayName(graph.root.sourceCode, graph.root.filePath);
15468
+ const rootPlayName = graph.root.playName ?? await extractPlayName(graph.root.sourceCode, graph.root.filePath);
15397
15469
  const artifactHash = graph.root.artifact.artifactHash;
15398
15470
  if (options.expectedArtifactHash && options.expectedArtifactHash !== artifactHash) {
15399
15471
  const result3 = {
@@ -16275,7 +16347,7 @@ Examples:
16275
16347
  process.exitCode = await ownView();
16276
16348
  return;
16277
16349
  }
16278
- const { describeAnything } = await import("./describe-F57VZZML.mjs");
16350
+ const { describeAnything } = await import("./describe-KO6WKQIB.mjs");
16279
16351
  process.exitCode = await describeAnything(
16280
16352
  name,
16281
16353
  {
@@ -16609,7 +16681,7 @@ Examples:
16609
16681
  new Option2("--log-failed", "Attach terminal-failure logs").hideHelp()
16610
16682
  ).action(async (runId, options) => {
16611
16683
  if (TOOL_EXECUTION_ID.test(runId)) {
16612
- const { getToolExecutionReceipt } = await import("./tools-ITKPPUDT.mjs");
16684
+ const { getToolExecutionReceipt } = await import("./tools-57MWFRIZ.mjs");
16613
16685
  process.exitCode = await getToolExecutionReceipt(runId, {
16614
16686
  receiptJson: options.json !== void 0
16615
16687
  });