deepline 0.3.534 → 0.3.536

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 (235) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +254 -147
  2. package/dist/bundling-sources/sdk/src/index.ts +4 -0
  3. package/dist/bundling-sources/sdk/src/plays/local-file-discovery.ts +27 -1
  4. package/dist/bundling-sources/sdk/src/plays/run-request.ts +16 -5
  5. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  6. package/dist/bundling-sources/sdk/src/types.ts +2 -23
  7. package/dist/bundling-sources/shared_libs/integration-contracts/monitor-fleet-contract.ts +26 -14
  8. package/dist/bundling-sources/shared_libs/integration-contracts/monitor-input-contract.ts +33 -8
  9. package/dist/bundling-sources/shared_libs/monitors/fleets/count-drift-alert.ts +121 -0
  10. package/dist/bundling-sources/shared_libs/monitors/fleets/limits.ts +8 -0
  11. package/dist/bundling-sources/shared_libs/monitors/fleets/plan.ts +14 -82
  12. package/dist/bundling-sources/shared_libs/monitors/package.json +1 -0
  13. package/dist/bundling-sources/shared_libs/observability/scheduled-jobs.json +4 -4
  14. package/dist/bundling-sources/shared_libs/play-data-plane/r2.ts +0 -26
  15. package/dist/bundling-sources/shared_libs/play-runtime/activity-observation.ts +36 -0
  16. package/dist/bundling-sources/shared_libs/play-runtime/app-runtime-api.ts +21 -31
  17. package/dist/bundling-sources/shared_libs/play-runtime/call-requeue-state-machine.ts +420 -0
  18. package/dist/bundling-sources/shared_libs/play-runtime/context.ts +727 -102
  19. package/dist/bundling-sources/shared_libs/play-runtime/ctx-types.ts +26 -0
  20. package/dist/bundling-sources/shared_libs/play-runtime/durable-retry-policy.ts +624 -0
  21. package/dist/bundling-sources/shared_libs/play-runtime/durable-runs-rollout.ts +12 -10
  22. package/dist/bundling-sources/shared_libs/play-runtime/durable-summary-events.ts +3 -1
  23. package/dist/bundling-sources/shared_libs/play-runtime/governor/app-runtime-rate-state-backend.ts +71 -2
  24. package/dist/bundling-sources/shared_libs/play-runtime/governor/governor.ts +60 -1
  25. package/dist/bundling-sources/shared_libs/play-runtime/governor/rate-state-backend.ts +2 -0
  26. package/dist/bundling-sources/shared_libs/play-runtime/launch-identity.ts +1 -0
  27. package/dist/bundling-sources/shared_libs/play-runtime/map-memory-limits.ts +372 -10
  28. package/dist/bundling-sources/shared_libs/play-runtime/memory-ledger.ts +15 -2
  29. package/dist/bundling-sources/shared_libs/play-runtime/output-size-limits.ts +21 -0
  30. package/dist/bundling-sources/shared_libs/play-runtime/prebuilt-result-quality.ts +1 -1
  31. package/dist/bundling-sources/shared_libs/play-runtime/protocol.ts +6 -0
  32. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/fixture-capacity-simulator.ts +1 -0
  33. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/gradient2-concurrency-controller.ts +41 -0
  34. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-capacity-policy.ts +6 -0
  35. package/dist/bundling-sources/shared_libs/play-runtime/provider-capacity/provider-concurrency-policy.ts +9 -0
  36. package/dist/bundling-sources/shared_libs/play-runtime/provider-no-progress.ts +6 -2
  37. package/dist/bundling-sources/shared_libs/play-runtime/resource-governor.ts +17 -0
  38. package/dist/bundling-sources/shared_libs/play-runtime/run-failure.ts +2 -2
  39. package/dist/bundling-sources/shared_libs/play-runtime/run-ledger.ts +5 -2
  40. package/dist/bundling-sources/shared_libs/play-runtime/runner-app/runtime-tool-hooks.ts +63 -3
  41. package/dist/bundling-sources/shared_libs/play-runtime/runtime-operation-contract.ts +7 -0
  42. package/dist/bundling-sources/shared_libs/play-runtime/sandbox-compute-usage.ts +31 -0
  43. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backend.ts +6 -0
  44. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +26 -1
  45. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-scope.ts +11 -4
  46. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres-rate-state.ts +73 -18
  47. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +169 -2
  48. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-sandbox-capacity.ts +26 -4
  49. package/dist/bundling-sources/shared_libs/play-runtime/tool-execute-retry-policy.ts +90 -49
  50. package/dist/bundling-sources/shared_libs/plays/authoring-contract.ts +136 -30
  51. package/dist/bundling-sources/shared_libs/plays/launch/input-contract.ts +13 -1
  52. package/dist/bundling-sources/shared_libs/plays/local-file-discovery.ts +68 -1
  53. package/dist/bundling-sources/shared_libs/plays/share/static-pipeline-summary.ts +63 -13
  54. package/dist/bundling-sources/shared_libs/product-notifications/configuration-draft.ts +57 -1
  55. package/dist/bundling-sources/shared_libs/product-notifications/configuration.ts +22 -9
  56. package/dist/cli/auth-6XQKFOLG.js +43 -0
  57. package/dist/cli/{auth-MHQYIMVX.mjs → auth-KCTCUO7P.mjs} +7 -7
  58. package/dist/cli/{billing-YQLNP4S5.js → billing-4VBGZ3CT.js} +273 -112
  59. package/dist/cli/{billing-LX2PSBJ4.mjs → billing-OOJHKLNS.mjs} +185 -24
  60. package/dist/cli/{chunk-DGKTHWWH.js → chunk-2B4IOGFD.js} +406 -382
  61. package/dist/cli/{chunk-MQORQ7WL.js → chunk-2FCSUOYN.js} +55 -55
  62. package/dist/cli/{chunk-T2N3B7IQ.js → chunk-2GJZLIKW.js} +8 -8
  63. package/dist/cli/{chunk-6IFZPEJE.mjs → chunk-2YWJS76L.mjs} +1 -1
  64. package/dist/cli/{chunk-E7TP25I2.mjs → chunk-3PCYV6ZJ.mjs} +2 -2
  65. package/dist/cli/{chunk-LGRZCHKC.js → chunk-4E5JXZ3W.js} +18 -20
  66. package/dist/cli/{chunk-R4RG4FV5.mjs → chunk-4KWD3MX2.mjs} +13 -10
  67. package/dist/cli/{chunk-SUWTLXCV.js → chunk-6BBGUQJJ.js} +67 -146
  68. package/dist/cli/{chunk-JBBJDFUJ.js → chunk-6VUGBQZQ.js} +5 -5
  69. package/dist/cli/{chunk-2P3NVX65.mjs → chunk-AB2GBOD4.mjs} +40 -27
  70. package/dist/cli/{chunk-62SOZ67Y.mjs → chunk-ANUKBZ6W.mjs} +475 -11
  71. package/dist/cli/{chunk-MG6YL4M7.mjs → chunk-BASLYGXK.mjs} +101 -77
  72. package/dist/cli/{chunk-SQWET4SL.js → chunk-BBTKAASQ.js} +2 -1
  73. package/dist/cli/{chunk-NRO3NTVO.js → chunk-CBV7AKWM.js} +5 -5
  74. package/dist/cli/{chunk-RH3YRMUY.js → chunk-CIDN5K23.js} +1 -1
  75. package/dist/cli/{chunk-QNHHZ63P.mjs → chunk-CQBIO6HW.mjs} +1 -1
  76. package/dist/cli/{chunk-2KHUFWTK.js → chunk-CQDQNZGH.js} +42 -37
  77. package/dist/cli/{chunk-UWNVFAFN.js → chunk-CWSLUNA6.js} +33 -33
  78. package/dist/cli/{chunk-5FXMEEF4.mjs → chunk-CXTW7SRW.mjs} +67 -146
  79. package/dist/cli/{chunk-O53LHONF.mjs → chunk-DA2I2M7D.mjs} +2 -2
  80. package/dist/cli/{chunk-EYXUAJAU.mjs → chunk-DQHUJMCL.mjs} +5 -5
  81. package/dist/cli/{chunk-7GFR5Y4J.mjs → chunk-DUYAMLOC.mjs} +1 -1
  82. package/dist/cli/{chunk-OMVVHX4U.mjs → chunk-E24UGPGG.mjs} +13 -15
  83. package/dist/cli/{chunk-STR5LXK4.mjs → chunk-FSIVF2SI.mjs} +1 -1
  84. package/dist/cli/{chunk-KJVY7V2X.mjs → chunk-GF32SBST.mjs} +1 -1
  85. package/dist/cli/{chunk-AK622KIG.mjs → chunk-GHLDCLSC.mjs} +1 -1
  86. package/dist/cli/{chunk-A6HNT4EE.js → chunk-GTVZKY3F.js} +2 -2
  87. package/dist/cli/{chunk-BXIUZM5N.mjs → chunk-HAJQGP5V.mjs} +2 -2
  88. package/dist/cli/{chunk-6CEUQYMB.js → chunk-HWDKRN7L.js} +3 -3
  89. package/dist/cli/{chunk-5YAJGRWB.js → chunk-IPVRMYWT.js} +7 -7
  90. package/dist/cli/{chunk-ZPGGW27Q.mjs → chunk-JL2OTMSG.mjs} +1 -0
  91. package/dist/cli/{chunk-WR4WETRU.mjs → chunk-JUHDJNSI.mjs} +4 -4
  92. package/dist/cli/{chunk-TQH3533L.mjs → chunk-KPQHUVYW.mjs} +5 -5
  93. package/dist/cli/{chunk-V7SCRUFQ.js → chunk-KWYGWO4Y.js} +9 -6
  94. package/dist/cli/{chunk-DZS4JC7I.js → chunk-LDGZFDUB.js} +2 -2
  95. package/dist/cli/{chunk-EGTUOYYG.js → chunk-LN6RXDTB.js} +523 -59
  96. package/dist/cli/{chunk-DQ5ADV2J.mjs → chunk-LZXZQPA2.mjs} +4 -1
  97. package/dist/cli/{chunk-MYSKWJMA.js → chunk-MSP4DTSD.js} +13 -13
  98. package/dist/cli/{chunk-BNH4Y35W.mjs → chunk-OLH2PHMC.mjs} +2 -2
  99. package/dist/cli/{chunk-NNAE7E23.mjs → chunk-OUDTOMZC.mjs} +7 -9
  100. package/dist/cli/{chunk-GESIFFQX.mjs → chunk-OVX3Q5Q3.mjs} +1 -1
  101. package/dist/cli/{chunk-ENCA6O2D.mjs → chunk-PNY3BWHP.mjs} +2 -2
  102. package/dist/cli/{chunk-KSA2XE4T.js → chunk-Q4MNUOS4.js} +316 -303
  103. package/dist/cli/{chunk-GTXSUPCJ.js → chunk-Q5CXV3E3.js} +2 -2
  104. package/dist/cli/{chunk-VAG5YKP6.mjs → chunk-RVSSQPQO.mjs} +1 -1
  105. package/dist/cli/{chunk-VE7ZPLN2.js → chunk-SLPJ3LXI.js} +22 -22
  106. package/dist/cli/{chunk-IX45S5VC.js → chunk-TX5TUHJN.js} +17 -19
  107. package/dist/cli/{chunk-IF75RD6U.js → chunk-U2LVWCTD.js} +18 -6
  108. package/dist/cli/{chunk-ZS2WHWWL.js → chunk-UNDLNT3V.js} +1 -1
  109. package/dist/cli/{chunk-NDFNBJGL.js → chunk-VBDZIMWD.js} +26 -26
  110. package/dist/cli/{chunk-GVGQ6NZW.js → chunk-W7AEIGZR.js} +41 -41
  111. package/dist/cli/{chunk-WDNRPZED.mjs → chunk-WC5M3JXE.mjs} +2 -2
  112. package/dist/cli/{chunk-C374C22Y.js → chunk-WOQO3GV4.js} +14 -11
  113. package/dist/cli/{chunk-MQX363YF.js → chunk-XBAH3TKU.js} +5 -5
  114. package/dist/cli/{chunk-BDWZBMGV.mjs → chunk-XJD2GYUP.mjs} +5 -5
  115. package/dist/cli/{chunk-XRZJKHUA.mjs → chunk-XVZRJJDS.mjs} +4 -4
  116. package/dist/cli/{chunk-TVINIDHB.js → chunk-Y2NTPYGS.js} +17 -17
  117. package/dist/cli/{chunk-6GTGWZJG.mjs → chunk-YBMHOH6H.mjs} +4 -4
  118. package/dist/cli/{chunk-TG2UB3A5.mjs → chunk-YRLAUGQY.mjs} +3 -3
  119. package/dist/cli/{chunk-FKD3KL5Q.mjs → chunk-Z2XA6YU4.mjs} +10 -5
  120. package/dist/cli/{chunk-KXQCUX3X.mjs → chunk-Z7UIOGW4.mjs} +3 -3
  121. package/dist/cli/{chunk-HCD36BP6.js → chunk-ZEV2Y56V.js} +44 -44
  122. package/dist/cli/{chunk-MI6ZP7XI.mjs → chunk-ZG7BOECV.mjs} +18 -6
  123. package/dist/cli/{chunk-XBK6WCVA.js → chunk-ZILSRDIN.js} +8 -8
  124. package/dist/cli/{chunk-B2AS3R5W.js → chunk-ZISEH7OL.js} +16 -16
  125. package/dist/cli/{chunk-HPJAE6PP.js → chunk-ZZ4MF2GI.js} +6 -6
  126. package/dist/cli/command-docs.js +2 -2
  127. package/dist/cli/command-docs.mjs +1 -1
  128. package/dist/cli/{csv-U3M2G76R.js → csv-2V2DIFNG.js} +15 -15
  129. package/dist/cli/{csv-4ID4E5W3.mjs → csv-P3HLK4GO.mjs} +6 -6
  130. package/dist/cli/{db-IHAQIKEQ.js → db-MREAQVW6.js} +36 -36
  131. package/dist/cli/{db-LHX5BBCZ.mjs → db-ZYOY3QRQ.mjs} +9 -9
  132. package/dist/cli/describe-IKZFOADR.mjs +49 -0
  133. package/dist/cli/describe-WW3OQRLP.js +49 -0
  134. package/dist/cli/describe-core.d.mts +3 -3
  135. package/dist/cli/describe-core.d.ts +3 -3
  136. package/dist/cli/describe-core.js +5 -5
  137. package/dist/cli/describe-core.mjs +4 -4
  138. package/dist/cli/{executions-CJ5LV23G.js → executions-H5IJ7QSQ.js} +11 -11
  139. package/dist/cli/{executions-UJ6JZUL5.mjs → executions-KTSY5M34.mjs} +9 -9
  140. package/dist/cli/{feedback-TGUBVGRP.js → feedback-724QK3Z5.js} +16 -16
  141. package/dist/cli/{feedback-YGTPJBRJ.mjs → feedback-WWJRIXEU.mjs} +8 -8
  142. package/dist/cli/git-PHYRD56H.js +25 -0
  143. package/dist/cli/{git-3DOTQHJO.mjs → git-R5VRG7X6.mjs} +7 -7
  144. package/dist/cli/index.js +151 -157
  145. package/dist/cli/index.mjs +51 -57
  146. package/dist/cli/{legacy-noops-BHEHVFHI.js → legacy-noops-C6GDEGPU.js} +11 -11
  147. package/dist/cli/{legacy-noops-RBBYRVLG.mjs → legacy-noops-PWZ5XLAO.mjs} +8 -8
  148. package/dist/cli/{monitors-XECKLAXA.js → monitors-VAVQ4WCE.js} +125 -122
  149. package/dist/cli/{monitors-5AJCG6IV.mjs → monitors-WQSKMHAP.mjs} +19 -16
  150. package/dist/cli/{org-DOBAIYWG.js → org-CWWRWXZQ.js} +89 -89
  151. package/dist/cli/{org-ZAAIEZKB.mjs → org-MAL4QPVF.mjs} +9 -9
  152. package/dist/cli/{play-KLYRMQPF.mjs → play-ILW6MSNG.mjs} +174 -80
  153. package/dist/cli/{play-E74VN6B7.js → play-WJOWK5PQ.js} +690 -596
  154. package/dist/cli/{providers-XTQXV5LB.mjs → providers-4V2NMLZZ.mjs} +9 -9
  155. package/dist/cli/{providers-APZ6SOSK.js → providers-W662ANCH.js} +12 -12
  156. package/dist/cli/{quickstart-S6WN6NWW.js → quickstart-BW6EBUYX.js} +8 -8
  157. package/dist/cli/{quickstart-X7RHHQCH.mjs → quickstart-C22BR743.mjs} +6 -6
  158. package/dist/cli/{run-3YLIJJ57.js → run-KW7KW4FX.js} +50 -53
  159. package/dist/cli/{run-TZPBBSPX.mjs → run-SPAU5IMW.mjs} +31 -34
  160. package/dist/cli/search-HLE54W5G.js +32 -0
  161. package/dist/cli/{search-VLHE2CMZ.mjs → search-XPC75HLM.mjs} +10 -11
  162. package/dist/cli/{search-output-73BYB7UE.mjs → search-output-JKYJSEPM.mjs} +6 -6
  163. package/dist/cli/{search-output-GCT7PQIT.js → search-output-VJYE7USJ.js} +8 -8
  164. package/dist/cli/{secrets-RLOTGKQZ.mjs → secrets-OJG73GXQ.mjs} +9 -9
  165. package/dist/cli/{secrets-J6CEKXKQ.js → secrets-YB57KGSB.js} +18 -18
  166. package/dist/cli/{sessions-7HZ7OZ62.mjs → sessions-7ZL37BW4.mjs} +8 -8
  167. package/dist/cli/sessions-VEBYZIEU.js +22 -0
  168. package/dist/cli/{settings-WRV5XEZC.js → settings-A7DD2ZYE.js} +88 -89
  169. package/dist/cli/{settings-72K5YCIS.mjs → settings-RKSQB7FA.mjs} +15 -16
  170. package/dist/cli/{setup-KQFY6WT4.mjs → setup-NXDUTITY.mjs} +11 -12
  171. package/dist/cli/{setup-QVXWT2EQ.js → setup-S3K5YU62.js} +51 -52
  172. package/dist/cli/skills-NVQ744CN.js +36 -0
  173. package/dist/cli/{skills-C3K3E473.mjs → skills-VMFAIDO6.mjs} +9 -10
  174. package/dist/cli/{tools-4A2OH6MB.mjs → tools-52NTHBSJ.mjs} +20 -21
  175. package/dist/cli/tools-SBDUL3WB.js +56 -0
  176. package/dist/cli/update-HHVFZPCV.js +34 -0
  177. package/dist/cli/{update-BS6USKPR.mjs → update-SAKBEKMV.mjs} +11 -12
  178. package/dist/cli/{views-WB6GFTRX.mjs → views-ACRV7MD6.mjs} +54 -10
  179. package/dist/cli/{views-4NZGAXHL.js → views-C3GJOBDG.js} +66 -22
  180. package/dist/cli/{workflow-2D4WX55R.mjs → workflow-CS22E7TC.mjs} +10 -10
  181. package/dist/cli/{workflow-L2QTQZYV.js → workflow-ZNWCZEGN.js} +20 -20
  182. package/dist/{client-DoUVSkqC.d.mts → client-BlLYQDNo.d.mts} +1 -1
  183. package/dist/{client-DQm56zMs.d.ts → client-DSQlkIDO.d.ts} +1 -1
  184. package/dist/{client-core-C7KkUIE_.d.ts → client-core-CDwapXy5.d.ts} +167 -108
  185. package/dist/{client-core-CPlwsC1Q.d.mts → client-core-rX7n2H8U.d.mts} +167 -108
  186. package/dist/{compiler-manifest-DsxsQP-T.d.mts → compiler-manifest-BHNC4RL-.d.mts} +58 -21
  187. package/dist/{compiler-manifest-DsxsQP-T.d.ts → compiler-manifest-BHNC4RL-.d.ts} +58 -21
  188. package/dist/{errors-qdJUVQ3g.d.mts → errors-D7sPXrvB.d.mts} +1 -1
  189. package/dist/{errors-Bk5h1D-C.d.ts → errors-lhtIWG5Z.d.ts} +1 -1
  190. package/dist/{index-bL66eHYz.d.ts → index-CQTBHXHr.d.ts} +1 -1
  191. package/dist/{index-PaupwX1B.d.mts → index-NaDZq2xf.d.mts} +1 -1
  192. package/dist/index.d.mts +7 -7
  193. package/dist/index.d.ts +7 -7
  194. package/dist/index.js +15 -15
  195. package/dist/index.mjs +11 -11
  196. package/dist/install-integrity.json +131 -132
  197. package/dist/monitor-fleet-contract.d.mts +17 -11
  198. package/dist/monitor-fleet-contract.d.ts +17 -11
  199. package/dist/monitor-fleet-contract.js +3 -3
  200. package/dist/monitor-fleet-contract.mjs +2 -2
  201. package/dist/monitor-input-contract.js +2 -2
  202. package/dist/monitor-input-contract.mjs +1 -1
  203. package/dist/plays/bundle-play-file.d.mts +3 -3
  204. package/dist/plays/bundle-play-file.d.ts +3 -3
  205. package/dist/plays/bundle-play-file.mjs +67 -3
  206. package/dist/plays/csv-data-input.js +3 -3
  207. package/dist/plays/csv-data-input.mjs +2 -2
  208. package/dist/plays/play-description.d.mts +2 -2
  209. package/dist/plays/play-description.d.ts +2 -2
  210. package/dist/plays/run-request.d.mts +2 -2
  211. package/dist/plays/run-request.d.ts +2 -2
  212. package/dist/plays/run-request.js +3 -3
  213. package/dist/plays/run-request.mjs +2 -2
  214. package/dist/release.d.mts +1 -1
  215. package/dist/release.d.ts +1 -1
  216. package/dist/release.js +2 -2
  217. package/dist/release.mjs +1 -1
  218. package/dist/server.d.mts +4 -4
  219. package/dist/server.d.ts +4 -4
  220. package/dist/server.js +12 -12
  221. package/dist/server.mjs +6 -6
  222. package/package.json +1 -1
  223. package/dist/cli/auth-UP2RGPI6.js +0 -43
  224. package/dist/cli/chunk-5LZ5VSOK.mjs +0 -405
  225. package/dist/cli/chunk-D3J2Y2BP.js +0 -405
  226. package/dist/cli/describe-CI4MREFF.mjs +0 -50
  227. package/dist/cli/describe-IVTSD7ST.js +0 -50
  228. package/dist/cli/git-R3W25XIF.js +0 -25
  229. package/dist/cli/pages-FUOSF6BE.mjs +0 -266
  230. package/dist/cli/pages-TLC2N6L7.js +0 -266
  231. package/dist/cli/search-NB5CBALV.js +0 -33
  232. package/dist/cli/sessions-SFCZSB77.js +0 -22
  233. package/dist/cli/skills-WIJEHVLA.js +0 -37
  234. package/dist/cli/tools-VMMERMLO.js +0 -57
  235. package/dist/cli/update-54WZQDTS.js +0 -35
@@ -1,17 +1,17 @@
1
1
  import {
2
2
  DeeplineClient
3
- } from "./chunk-WDNRPZED.mjs";
3
+ } from "./chunk-WC5M3JXE.mjs";
4
4
  import {
5
5
  iterateCursorPages,
6
6
  requireBillingIdempotencyKey
7
- } from "./chunk-MG6YL4M7.mjs";
7
+ } from "./chunk-BASLYGXK.mjs";
8
8
  import "./chunk-L2VKAASU.mjs";
9
- import "./chunk-FKD3KL5Q.mjs";
9
+ import "./chunk-Z2XA6YU4.mjs";
10
10
  import "./chunk-PSX3WHIH.mjs";
11
11
  import "./chunk-UBKA33KY.mjs";
12
12
  import {
13
13
  PLAY_RUNTIME_PRICING_NOTE
14
- } from "./chunk-5FXMEEF4.mjs";
14
+ } from "./chunk-CXTW7SRW.mjs";
15
15
  import "./chunk-5LUF4LAR.mjs";
16
16
  import {
17
17
  PLAY_SANDBOX_SIZE_INPUTS
@@ -22,18 +22,18 @@ import {
22
22
  openInBrowser,
23
23
  printCommandEnvelope,
24
24
  shouldEmitJson
25
- } from "./chunk-62SOZ67Y.mjs";
26
- import "./chunk-E7TP25I2.mjs";
27
- import "./chunk-TG2UB3A5.mjs";
25
+ } from "./chunk-ANUKBZ6W.mjs";
26
+ import "./chunk-3PCYV6ZJ.mjs";
27
+ import "./chunk-YRLAUGQY.mjs";
28
28
  import {
29
29
  AuthError,
30
30
  ConfigError
31
- } from "./chunk-QNHHZ63P.mjs";
31
+ } from "./chunk-CQBIO6HW.mjs";
32
32
  import "./chunk-DLIRSHV6.mjs";
33
33
  import {
34
34
  DeeplineError
35
- } from "./chunk-ZPGGW27Q.mjs";
36
- import "./chunk-AK622KIG.mjs";
35
+ } from "./chunk-JL2OTMSG.mjs";
36
+ import "./chunk-GHLDCLSC.mjs";
37
37
  import "./chunk-WZYKRD7T.mjs";
38
38
  import "./chunk-KRD6H754.mjs";
39
39
 
@@ -790,21 +790,29 @@ function planPriceText(priceUsd, priceInterval) {
790
790
  }
791
791
  function targetPlanLine(plan) {
792
792
  const firstMonth = plan.first_month_price_usd != null ? ` (first month $${plan.first_month_price_usd})` : "";
793
- return `${plan.name} (${plan.sku}) | ${planPriceText(plan.recurring_price_usd, plan.interval)}${firstMonth} | ${plan.included_credits} included credits/month | $${plan.purchased_credit_price_usd}/purchased credit | ${plan.acquisition_enabled ? "available" : "unavailable"}`;
793
+ const bonus = plan.bonus_credits != null ? ` (+${plan.bonus_credits} bonus credits once paid)` : "";
794
+ return `${plan.display_name ?? plan.name} (${plan.sku}) | ${planPriceText(plan.recurring_price_usd, plan.interval)}${firstMonth}${bonus} | ${plan.included_credits} included credits/month | $${plan.purchased_credit_price_usd}/purchased credit | ${plan.acquisition_enabled ? "available" : "unavailable"}`;
794
795
  }
795
796
  async function handlePlans(options) {
796
797
  const client = new DeeplineClient();
797
- const payload = await client.billing.targetPlans();
798
+ const payload = await client.billing.targetPlans(
799
+ options.promoCode ? { promoCode: options.promoCode } : void 0
800
+ );
801
+ const promo = payload.promo_code;
798
802
  const listedCurrentPlan = payload.plans.find(
799
803
  (plan) => plan.sku === payload.current_plan_sku
800
804
  );
801
805
  const currentPlan = listedCurrentPlan ?? (await client.billing.targetStatus()).plan;
806
+ const pendingPlan = payload.pending_plan_display_name && payload.pending_plan_sku ? `${payload.pending_plan_display_name} (${payload.pending_plan_sku})` : payload.pending_plan_sku ?? "none";
802
807
  const lines = [
803
- `Current plan: ${currentPlan.name} (${currentPlan.sku}) | ${planPriceText(currentPlan.recurring_price_usd, currentPlan.interval)} | ${currentPlan.included_credits ?? "(unknown)"} included credits/month`,
804
- `Pending plan: ${payload.pending_plan_sku ?? "none"}`,
808
+ `Current plan: ${currentPlan.display_name ?? currentPlan.name} (${currentPlan.sku}) | ${planPriceText(currentPlan.recurring_price_usd, currentPlan.interval)} | ${currentPlan.included_credits ?? "(unknown)"} included credits/month`,
809
+ `Pending plan: ${pendingPlan}`,
805
810
  `Plan changes: ${payload.acquisition_enabled ? "enabled" : "disabled"}`,
811
+ ...promo ? [
812
+ promo.status === "applied" ? `Promo code ${promo.code}: applied to ${promo.plan_skus.join(", ")}${promo.expires_at ? ` (until ${promo.expires_at})` : ""}` : `Promo code ${promo.code}: ${promo.status.replaceAll("_", " ")}`
813
+ ] : [],
806
814
  ...payload.plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...payload.plans.map(targetPlanLine)],
807
- "Change plan: deepline billing change-plan <plan_sku>"
815
+ promo?.status === "applied" ? `Change plan: deepline billing change-plan <plan_sku> --promo-code ${promo.code}` : "Change plan: deepline billing change-plan <plan_sku>"
808
816
  ];
809
817
  const legacyPayload = shouldEmitJson(options.json) ? await client.billing.plans() : null;
810
818
  printCommandEnvelope(
@@ -847,7 +855,7 @@ async function handleSubscriptionStatus(options) {
847
855
  const payload = await client.billing.subscription.status();
848
856
  const pools = payload.credit_pools ?? [];
849
857
  const lines = [
850
- `Plan: ${payload.plan_name ?? "(unknown)"} (${payload.plan_version_id ?? "(unknown)"})`,
858
+ `Plan: ${payload.plan_display_name ?? payload.plan_name ?? "(unknown)"} (${payload.plan_version_id ?? "(unknown)"})`,
851
859
  `Subscribed: ${payload.subscribed ? "yes" : "no"}`,
852
860
  ...payload.cancel_at_period_end ? [
853
861
  `Cancellation scheduled: ends ${payload.current_period_end ?? "(unknown)"} at period end (credits are kept)`
@@ -896,6 +904,7 @@ async function handleSubscriptionCancel(options) {
896
904
  action,
897
905
  plan_version_id: status.plan_version_id,
898
906
  plan_name: status.plan_name,
907
+ plan_display_name: status.plan_display_name,
899
908
  cancel_at_period_end: status.cancel_at_period_end,
900
909
  current_period_end: status.current_period_end,
901
910
  consequence,
@@ -909,7 +918,7 @@ async function handleSubscriptionCancel(options) {
909
918
  {
910
919
  title: "billing subscription cancel (dry run)",
911
920
  lines: [
912
- `Plan: ${status.plan_name} (${status.plan_version_id})`,
921
+ `Plan: ${status.plan_display_name ?? status.plan_name} (${status.plan_version_id})`,
913
922
  `Planned request: POST ${SUBSCRIPTION_CANCEL_PATH} {"action":"${action}"}`,
914
923
  consequence,
915
924
  "No request was sent. Re-run without --dry-run to apply."
@@ -1227,7 +1236,7 @@ async function handleTargetStatus(options) {
1227
1236
  {
1228
1237
  title: "billing status",
1229
1238
  lines: [
1230
- `Plan: ${payload.plan.name} (${payload.plan.sku})`,
1239
+ `Plan: ${payload.plan.display_name ?? payload.plan.name} (${payload.plan.sku})`,
1231
1240
  `State: ${payload.state}`,
1232
1241
  `Payment: ${payload.payment_state}`,
1233
1242
  `Automatic recharge: ${payload.recharge_state}`,
@@ -1444,6 +1453,119 @@ async function handleAutoRechargeOff(options) {
1444
1453
  { json: options.json }
1445
1454
  );
1446
1455
  }
1456
+ function savedCardLine(card) {
1457
+ const expiry = card.exp_month !== null && card.exp_year !== null ? ` exp ${String(card.exp_month).padStart(2, "0")}/${card.exp_year}` : "";
1458
+ const marks = [
1459
+ card.is_default ? "default" : null,
1460
+ card.expired ? "expired" : null,
1461
+ card.kind === "legacy_source" ? "cannot be changed here" : null
1462
+ ].filter(Boolean);
1463
+ return `${card.id} ${card.label}${expiry}${marks.length > 0 ? ` (${marks.join(", ")})` : ""}`;
1464
+ }
1465
+ function savedCardLines(cards, hasMore) {
1466
+ if (cards.length === 0) {
1467
+ return ["No saved cards. Add one with: deepline billing cards add"];
1468
+ }
1469
+ return [
1470
+ ...cards.map(savedCardLine),
1471
+ ...hasMore ? ["More cards exist: pass --cursor with next_cursor."] : []
1472
+ ];
1473
+ }
1474
+ async function handleCardsList(options) {
1475
+ const limit = options.limit === void 0 ? void 0 : Number(options.limit);
1476
+ if (limit !== void 0 && (!Number.isInteger(limit) || limit < 1 || limit > 100)) {
1477
+ printCommandEnvelope(
1478
+ { ok: false, error: "--limit must be a whole number from 1 to 100." },
1479
+ { json: options.json }
1480
+ );
1481
+ process.exitCode = 1;
1482
+ return;
1483
+ }
1484
+ const payload = await new DeeplineClient().billing.cards.list({
1485
+ ...limit !== void 0 ? { limit } : {},
1486
+ ...options.cursor ? { cursor: options.cursor } : {}
1487
+ });
1488
+ printCommandEnvelope(
1489
+ {
1490
+ ok: true,
1491
+ ...payload,
1492
+ render: {
1493
+ sections: [
1494
+ {
1495
+ title: "Saved cards",
1496
+ lines: savedCardLines(payload.cards, payload.has_more)
1497
+ }
1498
+ ]
1499
+ }
1500
+ },
1501
+ { json: options.json }
1502
+ );
1503
+ }
1504
+ async function handleCardsAdd(options) {
1505
+ const makeDefault = options.makeDefault === true;
1506
+ const payload = await new DeeplineClient().billing.cards.add({ makeDefault });
1507
+ printCommandEnvelope(
1508
+ {
1509
+ ok: true,
1510
+ make_default: makeDefault,
1511
+ ...payload,
1512
+ render: {
1513
+ sections: [
1514
+ {
1515
+ title: "Add a card",
1516
+ lines: [
1517
+ `Open this page to enter the card: ${payload.checkout_url}`,
1518
+ makeDefault ? "It will become the default card." : "Your current default card stays the default. With no saved card yet, this one becomes it.",
1519
+ "Then check: deepline billing cards list"
1520
+ ]
1521
+ }
1522
+ ]
1523
+ }
1524
+ },
1525
+ { json: options.json }
1526
+ );
1527
+ }
1528
+ async function handleCardChange(action, cardId, options) {
1529
+ const changeId = options.changeId ?? randomUUID();
1530
+ const path = `/api/v2/billing/payment-methods/${action}`;
1531
+ if (options.dryRun) {
1532
+ printCommandEnvelope(
1533
+ {
1534
+ ok: true,
1535
+ dry_run: true,
1536
+ change_id: changeId,
1537
+ planned_request: {
1538
+ method: "POST",
1539
+ path,
1540
+ body: { card_id: cardId, change_id: changeId }
1541
+ }
1542
+ },
1543
+ { json: options.json }
1544
+ );
1545
+ return;
1546
+ }
1547
+ const cards = new DeeplineClient().billing.cards;
1548
+ const payload = action === "default" ? await cards.setDefault({ cardId, changeId }) : await cards.remove({ cardId, changeId });
1549
+ printCommandEnvelope(
1550
+ {
1551
+ ...payload,
1552
+ render: {
1553
+ sections: [
1554
+ {
1555
+ title: action === "default" ? "Default card changed" : "Card removed",
1556
+ lines: [
1557
+ ...action === "default" ? [
1558
+ "Later top-ups, auto top-up and invoices use this card. Charges already made are not moved."
1559
+ ] : [],
1560
+ ...savedCardLines(payload.cards, payload.has_more)
1561
+ ]
1562
+ }
1563
+ ]
1564
+ }
1565
+ },
1566
+ { json: options.json }
1567
+ );
1568
+ }
1447
1569
  async function handleBuyCredits(creditsRaw, options) {
1448
1570
  const credits = parseTopUpCredits(creditsRaw);
1449
1571
  if (credits === null) {
@@ -1522,14 +1644,14 @@ async function handleTopUpRecover(creditsRaw, options) {
1522
1644
  );
1523
1645
  }
1524
1646
  async function handleTargetPlan(planSku, options) {
1525
- if (planSku !== "payg-v1" && planSku !== "builder-v1" && planSku !== "growth-v1" && // Retained Canary requests may replay their original operation. The API
1647
+ if (planSku !== "payg-v1" && planSku !== "builder-v1" && planSku !== "growth-v1" && planSku !== "team-v2" && // Retained Canary requests may replay their original operation. The API
1526
1648
  // rejects new acquisition even when a caller supplies an idempotency key.
1527
1649
  !(planSku === "growth-canary-v1" && options.idempotencyKey) && planSku !== "team-v1") {
1528
1650
  reportBillingFailure(
1529
1651
  {
1530
1652
  exitCode: 2,
1531
1653
  code: "INVALID_PLAN",
1532
- message: "Plan must be payg-v1, builder-v1, growth-v1, or team-v1."
1654
+ message: "Plan must be payg-v1, builder-v1, growth-v1, team-v1, or team-v2."
1533
1655
  },
1534
1656
  options
1535
1657
  );
@@ -1540,6 +1662,7 @@ async function handleTargetPlan(planSku, options) {
1540
1662
  action: "start_or_change",
1541
1663
  targetPlanSku: planSku,
1542
1664
  ...options.billingEmail ? { billingEmail: options.billingEmail } : {},
1665
+ ...options.promoCode ? { promoCode: options.promoCode } : {},
1543
1666
  idempotencyKey
1544
1667
  });
1545
1668
  printCommandEnvelope(
@@ -1895,9 +2018,44 @@ Examples:
1895
2018
  printCommandEnvelope({ ok: true, ...result }, { json: options.json });
1896
2019
  })
1897
2020
  );
1898
- billing.command("change-plan").description("Start or change the target billing plan.").argument("<plan_sku>", "payg-v1, builder-v1, growth-v1, or team-v1").option(
2021
+ billing.command("cards").description("List, add, choose the default of, and remove saved cards.").addHelpText(
2022
+ "after",
2023
+ `
2024
+ The default card pays for top-ups, auto top-up and invoices. Changing it does
2025
+ not move a charge already made. To remove the default card, make another card
2026
+ the default first.
2027
+
2028
+ Examples:
2029
+ deepline billing cards list
2030
+ deepline billing cards add
2031
+ deepline billing cards add --make-default
2032
+ deepline billing cards default <card_id> --dry-run
2033
+ deepline billing cards remove <card_id>
2034
+ `
2035
+ ).addCommand(
2036
+ new Command("list").description("Show saved cards, default first.").option("--limit <n>", "Cards per page (1-100, default 20)").option("--cursor <cursor>", "next_cursor from the previous page").option("--json", "Emit JSON output").action(handleCardsList)
2037
+ ).addCommand(
2038
+ new Command("add").description(
2039
+ "Print a secure page for entering a card. Keeps the current default unless --make-default is set."
2040
+ ).option("--make-default", "Make the new card the default").option("--json", "Emit JSON output").action(handleCardsAdd)
2041
+ ).addCommand(
2042
+ new Command("default").description("Use a saved card for later top-ups and invoices.").argument("<card_id>", "Card id from: deepline billing cards list").option("--change-id <uuid>", "Reuse to retry the same request").option("--dry-run", "Print the planned request without sending it").option("--json", "Emit JSON output").action(
2043
+ (cardId, options) => handleCardChange("default", cardId, options)
2044
+ )
2045
+ ).addCommand(
2046
+ new Command("remove").description("Remove a saved card that is not the default.").argument("<card_id>", "Card id from: deepline billing cards list").option("--change-id <uuid>", "Reuse to retry the same request").option("--dry-run", "Print the planned request without sending it").option("--json", "Emit JSON output").action(
2047
+ (cardId, options) => handleCardChange("remove", cardId, options)
2048
+ )
2049
+ );
2050
+ billing.command("change-plan").description("Start or change the target billing plan.").argument(
2051
+ "<plan_sku>",
2052
+ "payg-v1, builder-v1, growth-v1, team-v1, or team-v2"
2053
+ ).option(
1899
2054
  "--billing-email <email>",
1900
2055
  "Invoice recipient when the account has no billing email"
2056
+ ).option(
2057
+ "--promo-code <code>",
2058
+ "Plan promo code; an unknown, expired, or used code refuses the change"
1901
2059
  ).option("--idempotency-key <key>", "Stable retry key").option("--json", "Emit JSON output").action(handleTargetPlan);
1902
2060
  billing.command("cancel-plan").description("Cancel a target subscription at period end, or undo it.").option("--undo", "Undo a pending period-end cancellation").option("--idempotency-key <key>", "Stable retry key").option("--json", "Emit JSON output").action(handleTargetPlanCancellation);
1903
2061
  billing.command("portal").description("Open the Stripe-hosted billing recovery portal.").option("--billing-address", "Open the billing address editor directly").option("--no-open", "Print the URL without opening a browser").option("--json", "Emit JSON output").action(handleTargetPortal);
@@ -1909,13 +2067,16 @@ Notes:
1909
2067
  visible plan's recurring price, included credits, purchased-credit price,
1910
2068
  and current acquisition availability. All amounts are Deepline credits and
1911
2069
  Deepline-facing USD, never raw provider spend. Change to an available plan
1912
- with: deepline billing change-plan <plan_sku>
2070
+ with: deepline billing change-plan <plan_sku>. A first-month price or bonus
2071
+ credits appear on a plan when the workspace is offered them. With
2072
+ --promo-code, prices are quoted with that code and its outcome is shown;
2073
+ pass the same code to change-plan.
1913
2074
 
1914
2075
  Examples:
1915
2076
  deepline billing plans
1916
- deepline billing plans
2077
+ deepline billing plans --promo-code <code>
1917
2078
  `
1918
- ).option("--json", "Emit JSON output").action(handlePlans);
2079
+ ).option("--promo-code <code>", "Quote plan prices with a promo code").option("--json", "Emit JSON output").action(handlePlans);
1919
2080
  billing.command("subscribe").description(
1920
2081
  "Start a subscription checkout for a plan and optionally open it in your browser."
1921
2082
  ).addHelpText(