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.
Files changed (217) hide show
  1. package/dist/bundling-sources/sdk/src/agent-runtime.ts +18 -1
  2. package/dist/bundling-sources/sdk/src/client.ts +212 -334
  3. package/dist/bundling-sources/sdk/src/compat.ts +45 -2
  4. package/dist/bundling-sources/sdk/src/db/query.ts +9 -10
  5. package/dist/bundling-sources/sdk/src/http.ts +38 -20
  6. package/dist/bundling-sources/sdk/src/index.ts +4 -5
  7. package/dist/bundling-sources/sdk/src/play.ts +10 -10
  8. package/dist/bundling-sources/sdk/src/plays/bundle-play-file.ts +6 -4
  9. package/dist/bundling-sources/sdk/src/plays/check-local-play-graph.ts +114 -0
  10. package/dist/bundling-sources/sdk/src/plays/client.ts +431 -0
  11. package/dist/bundling-sources/sdk/src/plays/local-play-execution.ts +2 -2
  12. package/dist/bundling-sources/sdk/src/plays/run-request.ts +106 -16
  13. package/dist/bundling-sources/sdk/src/release.ts +13 -7
  14. package/dist/bundling-sources/sdk/src/runs/read-errors.ts +8 -0
  15. package/dist/bundling-sources/sdk/src/runs/watch-polling.ts +124 -13
  16. package/dist/bundling-sources/sdk/src/tool-calls.ts +108 -19
  17. package/dist/bundling-sources/sdk/src/types.ts +18 -0
  18. package/dist/bundling-sources/shared_libs/integration-contracts/execute-retry-contract.ts +37 -0
  19. package/dist/bundling-sources/shared_libs/integration-contracts/package.json +3 -0
  20. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +3 -1
  21. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +277 -76
  22. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +6 -0
  23. package/dist/bundling-sources/shared_libs/play-runtime/dataset-row-input.ts +124 -0
  24. package/dist/bundling-sources/shared_libs/play-runtime/durable-call-cache.ts +6 -62
  25. package/dist/bundling-sources/shared_libs/play-runtime/durable-receipt-execution.ts +1 -0
  26. package/dist/bundling-sources/shared_libs/play-runtime/durable-tool-identity.ts +67 -0
  27. package/dist/bundling-sources/shared_libs/play-runtime/execute-server-timing.ts +64 -6
  28. package/dist/bundling-sources/shared_libs/play-runtime/freshness-receipt-execution.ts +1 -5
  29. package/dist/bundling-sources/shared_libs/play-runtime/ledger-safe-payload.ts +1 -1
  30. package/dist/bundling-sources/shared_libs/play-runtime/play-artifact-runtime-contract.ts +3 -0
  31. package/dist/bundling-sources/shared_libs/play-runtime/play-http-request.ts +10 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/query-result-dataset.ts +3 -0
  33. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/egress-probe.ts +3 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/index.ts +26 -16
  35. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-heartbeat.ts +36 -11
  36. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-terminal-push.ts +35 -0
  37. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-launch-transport.ts +21 -0
  38. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-payload-transport.ts +21 -6
  39. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona-session-execution.ts +11 -2
  40. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/daytona.ts +85 -20
  41. package/dist/bundling-sources/shared_libs/play-runtime/runtime-api.ts +71 -13
  42. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-execution-queries.ts +100 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-pool.ts +9 -5
  44. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +337 -146
  45. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-shared.ts +26 -12
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +3 -1
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +425 -102
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-dispatch-authority.ts +4 -0
  49. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +4 -0
  50. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-event-search.ts +9 -0
  51. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +181 -124
  52. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +152 -0
  53. package/dist/bundling-sources/shared_libs/play-runtime/test-runtime-seams.ts +5 -3
  54. package/dist/bundling-sources/shared_libs/play-runtime/tool-cache-policy.ts +31 -0
  55. package/dist/bundling-sources/shared_libs/play-runtime/transient-service-error.ts +10 -0
  56. package/dist/bundling-sources/shared_libs/plays/ambiguous-write-error.ts +25 -0
  57. package/dist/bundling-sources/shared_libs/plays/artifact-types.ts +4 -0
  58. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +63 -68
  59. package/dist/bundling-sources/shared_libs/plays/bundling/index.ts +129 -63
  60. package/dist/bundling-sources/shared_libs/plays/contracts.ts +14 -0
  61. package/dist/bundling-sources/shared_libs/plays/enrich-play-compiler.ts +58 -16
  62. package/dist/bundling-sources/shared_libs/plays/fetch-http-error.ts +50 -0
  63. package/dist/bundling-sources/shared_libs/plays/source-authoring-edition.ts +351 -0
  64. package/dist/bundling-sources/shared_libs/plays/tool-list-getter-mode.ts +9 -0
  65. package/dist/bundling-sources/shared_libs/plays/tool-result-types.ts +1 -1
  66. package/dist/cli/{auth-UVD3CUBB.mjs → auth-LLXLIILR.mjs} +6 -6
  67. package/dist/cli/auth-UG4WOYGL.js +40 -0
  68. package/dist/cli/{billing-BZVTXXLM.mjs → billing-5FVXZYAC.mjs} +8 -8
  69. package/dist/cli/{billing-BZVYAF6T.js → billing-NFPK7GYP.js} +84 -84
  70. package/dist/cli/{chunk-ZAAKSJAS.js → chunk-27GJKC5Q.js} +17 -10
  71. package/dist/cli/{chunk-UHNDVD3P.js → chunk-2H4EY7KH.js} +100 -41
  72. package/dist/cli/{chunk-WTT6CLED.mjs → chunk-2YR7BIIC.mjs} +5 -2
  73. package/dist/cli/{chunk-3ZB6IIA7.js → chunk-36AHOWVS.js} +26 -26
  74. package/dist/cli/{chunk-OSDXE27V.mjs → chunk-4PG4ARL2.mjs} +17 -10
  75. package/dist/cli/{chunk-LOYISF7S.mjs → chunk-4XQLVUC7.mjs} +738 -512
  76. package/dist/cli/{chunk-J5PTX66Y.js → chunk-5MLCBXXU.js} +8 -1
  77. package/dist/cli/chunk-5TUGWDEB.js +313 -0
  78. package/dist/cli/{chunk-D6FFBSM5.js → chunk-5UUQAGJS.js} +5 -2
  79. package/dist/cli/{chunk-4CFULMRB.mjs → chunk-5V5Y37BC.mjs} +2 -2
  80. package/dist/cli/{chunk-PMVFAYL7.mjs → chunk-63ILLN5H.mjs} +2 -2
  81. package/dist/cli/{chunk-AUMD2VXP.js → chunk-63S7X326.js} +1032 -806
  82. package/dist/cli/{chunk-4QFT5LGV.mjs → chunk-6PGATQ6L.mjs} +6 -3
  83. package/dist/cli/{chunk-6BJK4EJ3.mjs → chunk-AARWVK4C.mjs} +2132 -65
  84. package/dist/cli/{chunk-FERRDNMO.js → chunk-AD47BXN2.js} +5 -5
  85. package/dist/cli/{chunk-4RNDKFNQ.js → chunk-D37FEBES.js} +2 -2
  86. package/dist/cli/{chunk-S6R3OX7B.js → chunk-E4CABWXL.js} +25 -2
  87. package/dist/cli/{chunk-NXGCO4JB.mjs → chunk-E4IXDAZI.mjs} +5 -0
  88. package/dist/cli/chunk-EQ4Z7RJW.mjs +35 -0
  89. package/dist/cli/chunk-FR2ILQ4G.mjs +8 -0
  90. package/dist/cli/{chunk-QUAQX3FQ.js → chunk-FVLNYDI4.js} +128 -376
  91. package/dist/cli/{chunk-BRJUESQV.js → chunk-FZJAM576.js} +50 -50
  92. package/dist/cli/{chunk-BZAMOCPA.mjs → chunk-IMZ56EOH.mjs} +3 -3
  93. package/dist/cli/{chunk-IOHRWLQE.mjs → chunk-IPG42SD2.mjs} +452 -138
  94. package/dist/cli/chunk-J33TSWO5.js +8 -0
  95. package/dist/cli/{chunk-XXLXOUUU.mjs → chunk-JNXJZ577.mjs} +1 -1
  96. package/dist/cli/{chunk-JI2B4RZP.mjs → chunk-KCC3FKIW.mjs} +71 -12
  97. package/dist/cli/{chunk-6IKARAYD.mjs → chunk-L2VKAASU.mjs} +23 -0
  98. package/dist/cli/{chunk-PYZZMAJQ.mjs → chunk-LFSHGNT2.mjs} +8 -1
  99. package/dist/cli/{chunk-2XXXFPTD.js → chunk-LTFL4JRN.js} +426 -721
  100. package/dist/cli/{chunk-YHPYUZZX.mjs → chunk-MAMVGOSC.mjs} +1 -1
  101. package/dist/cli/{chunk-URACNNLO.mjs → chunk-MN2OWLFA.mjs} +2 -2
  102. package/dist/cli/{chunk-Q3PUHXOY.js → chunk-NF4V5DTY.js} +12 -12
  103. package/dist/cli/{chunk-Q2E4E4FJ.js → chunk-NPBJI7RE.js} +8 -8
  104. package/dist/cli/chunk-NTVLGHFM.js +501 -0
  105. package/dist/cli/{chunk-HQXL5526.mjs → chunk-NUX2QHNC.mjs} +1 -1
  106. package/dist/cli/{chunk-E3PJF6YP.js → chunk-OBB4QXHA.js} +19 -4
  107. package/dist/cli/{chunk-SEFMGO3Z.js → chunk-OQQOXSYA.js} +2184 -117
  108. package/dist/cli/chunk-OZ6E3IRZ.js +6084 -0
  109. package/dist/cli/{chunk-7P5AA3SN.js → chunk-PPDBRJRW.js} +6 -1
  110. package/dist/cli/{chunk-IWBXJDZA.mjs → chunk-PZSLPBDA.mjs} +2 -2
  111. package/dist/cli/{chunk-ILHRA7AD.js → chunk-QADCFSGH.js} +7 -7
  112. package/dist/cli/{chunk-ECVLPS67.js → chunk-QJI5FIOW.js} +170 -49
  113. package/dist/cli/{chunk-I3DHIXVJ.mjs → chunk-QL22Y56M.mjs} +149 -28
  114. package/dist/cli/{chunk-SD7MXAJA.mjs → chunk-RFB25DSQ.mjs} +36 -284
  115. package/dist/cli/chunk-T44IIOT6.mjs +501 -0
  116. package/dist/cli/chunk-VK2LZ5IP.js +35 -0
  117. package/dist/cli/chunk-VKKVSFRD.js +62 -0
  118. package/dist/cli/{chunk-RWCY6YI2.js → chunk-VYKV5XHL.js} +644 -330
  119. package/dist/cli/{chunk-GSK6NHVM.js → chunk-WU4U6VSB.js} +5 -5
  120. package/dist/cli/chunk-XHLKJOTN.mjs +313 -0
  121. package/dist/cli/{chunk-MJELBQBU.mjs → chunk-XIHWSXSV.mjs} +330 -625
  122. package/dist/cli/chunk-XNZJKRJA.mjs +6084 -0
  123. package/dist/cli/chunk-ZCALLYF6.mjs +62 -0
  124. package/dist/cli/{chunk-ZBABPK6Y.js → chunk-ZFZ427HN.js} +11 -8
  125. package/dist/cli/{chunk-SJVVBWRL.mjs → chunk-ZKYEW55U.mjs} +16 -1
  126. package/dist/cli/command-docs.js +2 -2
  127. package/dist/cli/command-docs.mjs +1 -1
  128. package/dist/cli/{csv-XLGLHJ6P.js → csv-7U3FJYKZ.js} +14 -14
  129. package/dist/cli/{csv-WPSXG6ZZ.mjs → csv-ZWLDMM4A.mjs} +5 -5
  130. package/dist/cli/{db-5PTNJG4X.js → db-DNCGV5PC.js} +42 -47
  131. package/dist/cli/{db-ABS57ABJ.mjs → db-IMYXVMGI.mjs} +15 -20
  132. package/dist/cli/{describe-PVWQJ2PB.mjs → describe-Q23DWJUK.mjs} +20 -15
  133. package/dist/cli/{describe-EZS6PQXA.js → describe-S34JUX5W.js} +27 -22
  134. package/dist/cli/describe-core.d.mts +2 -2
  135. package/dist/cli/describe-core.d.ts +2 -2
  136. package/dist/cli/describe-core.js +6 -6
  137. package/dist/cli/describe-core.mjs +5 -5
  138. package/dist/cli/{executions-OKJGATQZ.mjs → executions-A73EUGSI.mjs} +8 -8
  139. package/dist/cli/{executions-FNTAFQ7Y.js → executions-XOMPX2YJ.js} +10 -10
  140. package/dist/cli/{feedback-W27HDMRR.mjs → feedback-N4GJ2POI.mjs} +11 -7
  141. package/dist/cli/{feedback-6YBOMSUA.js → feedback-QTCHNJJH.js} +13 -9
  142. package/dist/cli/{git-YOOUEL6M.mjs → git-4Q3JIQYZ.mjs} +6 -6
  143. package/dist/cli/git-I6CPBEVG.js +24 -0
  144. package/dist/cli/index.js +240 -352
  145. package/dist/cli/index.mjs +163 -275
  146. package/dist/cli/{legacy-noops-V6OKW7VR.mjs → legacy-noops-3SOVGFF7.mjs} +6 -6
  147. package/dist/cli/{legacy-noops-2VZ7XT6C.js → legacy-noops-4OSHZM34.js} +9 -9
  148. package/dist/cli/{monitors-FBWGVIUS.js → monitors-LVE2KZNG.js} +94 -94
  149. package/dist/cli/{monitors-P2YYWTWT.mjs → monitors-QP2XID2B.mjs} +8 -8
  150. package/dist/cli/{org-DVMG6H3C.mjs → org-IVRETVQA.mjs} +8 -8
  151. package/dist/cli/{org-3XUSVX5T.js → org-XFLK5IAP.js} +68 -68
  152. package/dist/cli/{play-GNC5CQAS.mjs → play-DE7VH6NU.mjs} +533 -98
  153. package/dist/cli/{play-YG5L4BWQ.js → play-XXTPPP23.js} +1067 -632
  154. package/dist/cli/{providers-7PSWG2OV.js → providers-DLD3I4JF.js} +11 -11
  155. package/dist/cli/{providers-JR33SLWL.mjs → providers-GX2NIZQQ.mjs} +8 -8
  156. package/dist/cli/{quickstart-VUOBQYIQ.mjs → quickstart-72B4L4PK.mjs} +5 -5
  157. package/dist/cli/{quickstart-FDVZ5BL3.js → quickstart-XNS3HSWC.js} +7 -7
  158. package/dist/cli/search-6NCH4HB5.js +30 -0
  159. package/dist/cli/{search-JZYLO33K.mjs → search-SUTRANJI.mjs} +9 -9
  160. package/dist/cli/{secrets-VS266FVA.js → secrets-6OBLOVEV.js} +17 -17
  161. package/dist/cli/{secrets-3MCYBT4I.mjs → secrets-FPFXXNUH.mjs} +8 -8
  162. package/dist/cli/sessions-235532DR.js +16 -0
  163. package/dist/cli/{sessions-ELLLT23E.mjs → sessions-R25I4QKN.mjs} +6 -6
  164. package/dist/cli/{settings-PZCKAFII.mjs → settings-AOP6F5PZ.mjs} +12 -12
  165. package/dist/cli/{settings-7364NMMA.js → settings-VL5FOFPN.js} +79 -79
  166. package/dist/cli/{setup-PMWYLCT6.js → setup-BSC67YT3.js} +45 -44
  167. package/dist/cli/{setup-A7GQ4KIA.mjs → setup-ZMPHBHVJ.mjs} +11 -10
  168. package/dist/cli/skills-3IWLYYRL.js +29 -0
  169. package/dist/cli/{skills-WS6BIFPQ.mjs → skills-KF65TVFO.mjs} +7 -7
  170. package/dist/cli/tools-LR66SPYU.js +44 -0
  171. package/dist/cli/{tools-BR4DOZA2.mjs → tools-SX4XIPM7.mjs} +19 -14
  172. package/dist/cli/{update-D2B7UNFT.mjs → update-QRMFRAQQ.mjs} +11 -9
  173. package/dist/cli/update-SP7UEO53.js +31 -0
  174. package/dist/cli/{workflow-PQXC2R47.mjs → workflow-FOEEEB7G.mjs} +44 -20
  175. package/dist/cli/{workflow-6ODTCYXU.js → workflow-KOCK2FLW.js} +54 -30
  176. package/dist/{client-Z9Pye1Wm.d.mts → client-74k4IPh6.d.mts} +137 -54
  177. package/dist/{client-BcvhDfJJ.d.ts → client-C1IK1f8c.d.ts} +137 -54
  178. package/dist/{compiler-manifest-Ycx-hoAr.d.mts → compiler-manifest-lzWpbV3w.d.mts} +83 -66
  179. package/dist/{compiler-manifest-Ycx-hoAr.d.ts → compiler-manifest-lzWpbV3w.d.ts} +83 -66
  180. package/dist/{index-CZXgiN3E.d.mts → index-C8Cy-YTm.d.ts} +5 -1
  181. package/dist/{index-NPG5pqxQ.d.ts → index-CtNK-0nI.d.mts} +5 -1
  182. package/dist/index.d.mts +47 -9
  183. package/dist/index.d.ts +47 -9
  184. package/dist/index.js +17 -14
  185. package/dist/index.mjs +13 -10
  186. package/dist/install-integrity.json +120 -104
  187. package/dist/plays/bundle-play-file.d.mts +3 -3
  188. package/dist/plays/bundle-play-file.d.ts +3 -3
  189. package/dist/plays/bundle-play-file.mjs +5 -4
  190. package/dist/plays/csv-data-input.js +3 -3
  191. package/dist/plays/csv-data-input.mjs +2 -2
  192. package/dist/plays/play-description.d.mts +2 -2
  193. package/dist/plays/play-description.d.ts +2 -2
  194. package/dist/plays/run-request.d.mts +2 -2
  195. package/dist/plays/run-request.d.ts +2 -2
  196. package/dist/plays/run-request.js +11 -3
  197. package/dist/plays/run-request.mjs +10 -2
  198. package/dist/release.d.mts +15 -6
  199. package/dist/release.d.ts +15 -6
  200. package/dist/release.js +2 -2
  201. package/dist/release.mjs +1 -1
  202. package/package.json +2 -2
  203. package/dist/cli/auth-3GB2K636.js +0 -40
  204. package/dist/cli/chunk-67RWR34T.mjs +0 -155
  205. package/dist/cli/chunk-CLJGSOVM.mjs +0 -1716
  206. package/dist/cli/chunk-HQY2SG3K.js +0 -83
  207. package/dist/cli/chunk-OSFWFV72.js +0 -155
  208. package/dist/cli/chunk-Q3LFI3VH.js +0 -392
  209. package/dist/cli/chunk-WPAB4DCU.mjs +0 -83
  210. package/dist/cli/chunk-YMOFWHGO.mjs +0 -392
  211. package/dist/cli/chunk-Z4VNJOF7.js +0 -1716
  212. package/dist/cli/git-YKUXXJOR.js +0 -24
  213. package/dist/cli/search-PPPYC5OZ.js +0 -30
  214. package/dist/cli/sessions-TEHEWW7O.js +0 -16
  215. package/dist/cli/skills-SYS7VRRK.js +0 -29
  216. package/dist/cli/tools-KK4BKVQR.js +0 -39
  217. package/dist/cli/update-2IV5JTX2.js +0 -29
@@ -0,0 +1,8 @@
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});// ../plays/tool-list-getter-mode.ts
2
+ function playToolListGetterMode(edition = void 0) {
3
+ return edition === void 0 || edition >= 10 ? "array" : "dataset";
4
+ }
5
+
6
+
7
+
8
+ exports.playToolListGetterMode = playToolListGetterMode;
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  resolveShellSpawn
3
- } from "./chunk-MJELBQBU.mjs";
3
+ } from "./chunk-XIHWSXSV.mjs";
4
4
 
5
5
  // src/cli/npm-script-policy.ts
6
6
  import { spawnSync } from "child_process";
@@ -8,7 +8,7 @@ import {
8
8
  } from "./chunk-DLIRSHV6.mjs";
9
9
  import {
10
10
  DeeplineError
11
- } from "./chunk-NXGCO4JB.mjs";
11
+ } from "./chunk-E4IXDAZI.mjs";
12
12
 
13
13
  // ../play-runtime/run-lifecycle-policy.ts
14
14
  var TERMINAL_PLAY_RUN_STATUSES = /* @__PURE__ */ new Set([
@@ -73,9 +73,21 @@ function decodePlayRunPublicStatus(value) {
73
73
 
74
74
  // src/plays/run-request.ts
75
75
  var PLAY_RUN_START_PATH = "/api/v2/plays/run";
76
+ var CLI_PLAY_RUN_START_PATH = `${PLAY_RUN_START_PATH}/cli`;
77
+ var CLI_PLAY_RUN_SUPPORTED_HEADER = "x-deepline-cli-play-admission";
76
78
  var PLAY_RUN_START_STREAM_PATH = `${PLAY_RUN_START_PATH}?stream=true`;
79
+ var CLI_PLAY_RUN_START_STREAM_PATH = `${CLI_PLAY_RUN_START_PATH}?stream=true`;
77
80
  var PLAY_FILES_STAGE_PATH = "/api/v2/plays/files/stage";
78
81
  var PLAY_FILES_STAGE_MINT_PATH = `${PLAY_FILES_STAGE_PATH}/mint`;
82
+ var CliPlayAdmissionUnsupportedError = class extends DeeplineError {
83
+ constructor(status) {
84
+ super(
85
+ "This server does not support CLI Play admission.",
86
+ status,
87
+ "CLI_PLAY_ADMISSION_UNSUPPORTED"
88
+ );
89
+ }
90
+ };
79
91
  function buildPlayRunStartBody(request) {
80
92
  return {
81
93
  ...request.admissionOrgId ? { admissionOrgId: request.admissionOrgId } : {},
@@ -103,6 +115,7 @@ function buildPlayRunStartBody(request) {
103
115
  ...typeof request.maxConcurrentRows === "number" ? { maxConcurrentRows: request.maxConcurrentRows } : {},
104
116
  ...typeof request.maxCredits === "number" ? { maxCredits: request.maxCredits } : {},
105
117
  ...typeof request.waitForCompletionMs === "number" ? { waitForCompletionMs: request.waitForCompletionMs } : {},
118
+ ...request.terminalStatus === "full" ? { terminalStatus: "full" } : {},
106
119
  // Profile selection is the API's job, not the caller's. The server
107
120
  // defaults to absurd; callers normally omit this field.
108
121
  ...request.profile ? { profile: request.profile } : {},
@@ -112,11 +125,11 @@ function buildPlayRunStartBody(request) {
112
125
  ...request.testPolicyOverrides ? { testPolicyOverrides: request.testPolicyOverrides } : {}
113
126
  };
114
127
  }
115
- async function preparePlayRunAdmission(http, request, onSubmission) {
128
+ async function preparePlayRunAdmission(http, request, onSubmission, options) {
116
129
  let capability = null;
117
130
  if (http.get) {
118
131
  try {
119
- capability = await http.get(PLAY_RUN_START_PATH);
132
+ capability = await http.get(PLAY_RUN_START_PATH, options);
120
133
  } catch (error) {
121
134
  if (!(error instanceof DeeplineError) || ![404, 405].includes(error.statusCode ?? 0))
122
135
  throw error;
@@ -132,6 +145,7 @@ async function preparePlayRunAdmission(http, request, onSubmission) {
132
145
  }
133
146
  }
134
147
  const supportsCallerIntent = capability?.admissionContract === "caller-intent-v1";
148
+ options?.signal?.throwIfAborted();
135
149
  if (supportsCallerIntent && (!capability?.orgId || request.admissionOrgId && request.admissionOrgId !== capability.orgId)) {
136
150
  throw new DeeplineError(
137
151
  "The admission workspace could not be pinned to this request; execution was not submitted.",
@@ -146,6 +160,20 @@ async function preparePlayRunAdmission(http, request, onSubmission) {
146
160
  "PLAY_RUN_ADMISSION_RECOVERY_UNSUPPORTED"
147
161
  );
148
162
  }
163
+ if (request.maxTotalCredits !== void 0 && capability?.strictTotalBudget === "unbounded-v1") {
164
+ if (request.maxTotalCredits === 0) {
165
+ throw new DeeplineError(
166
+ "A zero-credit total budget cannot admit a Play: sandbox compute is billed even when provider tools are free.",
167
+ 422,
168
+ "PLAY_TOTAL_BUDGET_COMPUTE_REQUIRED"
169
+ );
170
+ }
171
+ throw new DeeplineError(
172
+ "A strict total Play budget cannot currently be admitted: provider operations, Customer DB compute, and additional sandbox sessions do not have a finite admitted upper bound.",
173
+ 422,
174
+ "PLAY_TOTAL_BUDGET_UNBOUNDED"
175
+ );
176
+ }
149
177
  if (request.maxTotalCredits !== void 0 && capability?.strictTotalBudget !== "fail-closed-v1") {
150
178
  throw new DeeplineError(
151
179
  "This server cannot honor a strict total Play budget. Execution was not submitted.",
@@ -186,21 +214,39 @@ async function preparePlayRunAdmission(http, request, onSubmission) {
186
214
  }
187
215
  return { body: submittedBody, workflowId, supportsCallerIntent };
188
216
  }
189
- async function startPlayRun(http, request, headers, onSubmission) {
217
+ async function startPlayRun(http, request, headers, options) {
190
218
  const {
191
219
  body: submittedBody,
192
220
  workflowId,
193
221
  supportsCallerIntent
194
- } = await preparePlayRunAdmission(http, request, onSubmission);
222
+ } = await preparePlayRunAdmission(
223
+ http,
224
+ request,
225
+ options?.onSubmission,
226
+ options
227
+ );
228
+ let cliAdmissionSupported = false;
195
229
  let response;
196
230
  try {
197
231
  response = await http.post(
198
- PLAY_RUN_START_PATH,
232
+ options?.cliAdmission ? CLI_PLAY_RUN_START_PATH : PLAY_RUN_START_PATH,
199
233
  submittedBody,
200
234
  headers,
201
- { maxRetries: 0, exactUrlOnly: true }
235
+ {
236
+ maxRetries: 0,
237
+ exactUrlOnly: true,
238
+ ...options?.signal ? { signal: options.signal } : {},
239
+ ...options?.cliAdmission ? {
240
+ onResponse: (response2) => {
241
+ cliAdmissionSupported = response2.headers.get(CLI_PLAY_RUN_SUPPORTED_HEADER) === "true";
242
+ }
243
+ } : {}
244
+ }
202
245
  );
203
246
  } catch (error) {
247
+ if (options?.cliAdmission && !cliAdmissionSupported && error instanceof DeeplineError && (error.statusCode === 404 || error.statusCode === 405)) {
248
+ throw new CliPlayAdmissionUnsupportedError(error.statusCode);
249
+ }
204
250
  if (error instanceof DeeplineError && ["NETWORK_TIMEOUT", "NETWORK_ERROR", "FETCH_FAILED"].includes(
205
251
  error.code ?? ""
206
252
  ) || error instanceof TypeError || error instanceof Error && ["AbortError", "TimeoutError"].includes(error.name)) {
@@ -223,7 +269,15 @@ async function startPlayRun(http, request, headers, onSubmission) {
223
269
  }
224
270
  throw error;
225
271
  }
226
- return normalizePlayRunStart(response);
272
+ const started = normalizePlayRunStart(response);
273
+ if (options?.cliAdmission && (!started.workflowId || started.workflowId === "pending")) {
274
+ throw new DeeplineError(
275
+ "Play admission returned no run id. Check recent runs before submitting again.",
276
+ void 0,
277
+ "PLAY_START_MISSING_RUN_ID"
278
+ );
279
+ }
280
+ return started;
227
281
  }
228
282
  function isPlayRunPackage(value) {
229
283
  return Boolean(
@@ -245,7 +299,7 @@ function normalizePlayRunStart(raw) {
245
299
  name: runPackage.run.playName,
246
300
  status,
247
301
  ...runPackage.run.dashboardUrl ? { dashboardUrl: runPackage.run.dashboardUrl } : {},
248
- ...isTerminalPlayRunLifecycleStatus(status) ? { finalStatus: runPackage } : {},
302
+ ...isTerminalPlayRunLifecycleStatus(status) ? raw.finalStatusView === "full" && raw.runId === runPackage.run.id ? { finalStatus: raw, finalStatusView: "full" } : { finalStatus: runPackage } : {},
249
303
  package: runPackage
250
304
  };
251
305
  }
@@ -631,11 +685,12 @@ function createSessionPlayRunHttp(fetchImpl = (...args) => fetch(...args)) {
631
685
  return parsed;
632
686
  };
633
687
  return {
634
- get: (path) => send(path, { method: "GET" }),
635
- post: (path, body, headers) => send(path, {
688
+ get: (path, options) => send(path, { method: "GET", ...options }),
689
+ post: (path, body, headers, options) => send(path, {
636
690
  method: "POST",
637
691
  headers: { "content-type": "application/json", ...headers },
638
- body: JSON.stringify(body)
692
+ body: JSON.stringify(body),
693
+ ...options?.signal ? { signal: options.signal } : {}
639
694
  }),
640
695
  postFormData: (path, formData) => send(path, {
641
696
  method: "POST",
@@ -648,9 +703,13 @@ export {
648
703
  isTerminalPlayRunLifecycleStatus,
649
704
  decodePlayRunPublicStatus,
650
705
  PLAY_RUN_START_PATH,
706
+ CLI_PLAY_RUN_START_PATH,
707
+ CLI_PLAY_RUN_SUPPORTED_HEADER,
651
708
  PLAY_RUN_START_STREAM_PATH,
709
+ CLI_PLAY_RUN_START_STREAM_PATH,
652
710
  PLAY_FILES_STAGE_PATH,
653
711
  PLAY_FILES_STAGE_MINT_PATH,
712
+ CliPlayAdmissionUnsupportedError,
654
713
  buildPlayRunStartBody,
655
714
  preparePlayRunAdmission,
656
715
  startPlayRun,
@@ -28,9 +28,26 @@ var PLAY_BACKEND_DESCRIPTORS = {
28
28
  };
29
29
 
30
30
  // ../plays/tool-response-contract.ts
31
+ var V2_TOOL_RESPONSE_CONTRACT = "v2-tool-response";
31
32
  var RAW_V2_TOOL_RESPONSE_CONTRACT = "raw-v2";
32
33
  var RAW_V2_TOOL_RESPONSE_RECEIPT_REVISION = "raw-v2-receipt-v1";
33
34
  var TOOL_RESPONSE_RECEIPT_REVISION_PATTERN = /^[A-Za-z0-9](?:[A-Za-z0-9._-]{0,63})$/;
35
+ function isToolResponseContract(value) {
36
+ return value === V2_TOOL_RESPONSE_CONTRACT || value === RAW_V2_TOOL_RESPONSE_CONTRACT;
37
+ }
38
+ function declaredToolResponseContract(value) {
39
+ if (value == null) return void 0;
40
+ if (isToolResponseContract(value)) return value;
41
+ throw new UnsupportedToolResponseContractError(value);
42
+ }
43
+ var UnsupportedToolResponseContractError = class extends Error {
44
+ constructor(value) {
45
+ super(
46
+ `Unsupported tool response contract ${String(value)}. Supported contracts: ${V2_TOOL_RESPONSE_CONTRACT}, ${RAW_V2_TOOL_RESPONSE_CONTRACT}.`
47
+ );
48
+ this.name = "UnsupportedToolResponseContractError";
49
+ }
50
+ };
34
51
  var InvalidToolResponseReceiptRevisionError = class extends Error {
35
52
  constructor(value) {
36
53
  super(
@@ -46,6 +63,9 @@ function normalizeToolResponseReceiptRevision(value) {
46
63
  }
47
64
  throw new InvalidToolResponseReceiptRevisionError(value);
48
65
  }
66
+ function normalizeToolResponseContract(value) {
67
+ return declaredToolResponseContract(value) ?? V2_TOOL_RESPONSE_CONTRACT;
68
+ }
49
69
  function legacyRawFromToolResponseRawV2(rawV2, view, responseMeta) {
50
70
  const legacyRaw = view === "data" && rawV2 && typeof rawV2 === "object" && !Array.isArray(rawV2) ? rawV2.data : rawV2;
51
71
  const deeplineBilling = responseMeta?.deepline_billing;
@@ -68,7 +88,10 @@ function providerMetaFromToolResponseRawV2(rawV2, view) {
68
88
  export {
69
89
  RAW_V2_TOOL_RESPONSE_CONTRACT,
70
90
  RAW_V2_TOOL_RESPONSE_RECEIPT_REVISION,
91
+ UnsupportedToolResponseContractError,
92
+ InvalidToolResponseReceiptRevisionError,
71
93
  normalizeToolResponseReceiptRevision,
94
+ normalizeToolResponseContract,
72
95
  legacyRawFromToolResponseRawV2,
73
96
  providerMetaFromToolResponseRawV2,
74
97
  PLAY_ARTIFACT_KINDS,
@@ -763,7 +763,8 @@ Cost:
763
763
  core: `
764
764
  Purpose:
765
765
  Inventory of saved and prebuilt plays, one bounded page at a time.[[cli: It is
766
- the command that carries cost estimates.]]
766
+ the command that carries cost estimates.]][[mcp: Search returns Play summaries;
767
+ deepline_describe_play returns input/output schemas and CSV contracts.]]
767
768
  When:
768
769
  [[cli:
769
770
  To price a play before running it: plays list --show-cost, then read the
@@ -787,6 +788,12 @@ Output (JSON):
787
788
  next (the next-page command), render.sections with a "cost estimate:"
788
789
  line per play.
789
790
  ]]
791
+ [[mcp:
792
+ Output:
793
+ data[] with Play names, references, descriptions, ownership, and revision
794
+ metadata. Use deepline_describe_play for input/output schemas and CSV
795
+ contracts before running a Play.
796
+ ]]
790
797
  Cost:
791
798
  Free.
792
799
  [[cli: