deepline 0.3.578 → 0.3.580

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 (175) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +20 -2
  2. package/dist/bundling-sources/sdk/src/release.ts +1 -1
  3. package/dist/bundling-sources/shared_libs/monitors/billing/public-pricing.ts +470 -15
  4. package/dist/bundling-sources/shared_libs/monitors/billing/tamradar.ts +12 -0
  5. package/dist/bundling-sources/shared_libs/monitors/billing/types.ts +59 -0
  6. package/dist/bundling-sources/shared_libs/monitors/provider-monitor-capability.ts +5 -3
  7. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/backends/modal.ts +3 -1
  8. package/dist/bundling-sources/shared_libs/play-runtime/runner-backends/early-sandbox.ts +18 -0
  9. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/absurd-runtime-worker.ts +124 -57
  10. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/early-sandbox-lane.ts +4 -0
  11. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/postgres.ts +182 -80
  12. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +39 -2
  13. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/runtime-worker-wake.ts +25 -0
  14. package/dist/bundling-sources/shared_libs/plays/sandbox-runtime-limits.ts +83 -0
  15. package/dist/cli/{agents-MCU3ITQZ.js → agents-BF5VX5ZB.js} +31 -31
  16. package/dist/cli/{agents-LRBANBZH.mjs → agents-JRFTZE7G.mjs} +4 -4
  17. package/dist/cli/auth-25MVD7TK.js +44 -0
  18. package/dist/cli/{auth-5BJKVYMQ.mjs → auth-XJXZ64R4.mjs} +5 -5
  19. package/dist/cli/{billing-EBBI4MVL.mjs → billing-TXJBGP2I.mjs} +69 -64
  20. package/dist/cli/{billing-NT57POHH.js → billing-VGMTJI7W.js} +158 -153
  21. package/dist/cli/{chunk-XBO4ERH6.js → chunk-2ZCFAUCV.js} +3 -3
  22. package/dist/cli/{chunk-P35YQAUC.js → chunk-3OSNEWGR.js} +281 -275
  23. package/dist/cli/{chunk-7J473OJ5.mjs → chunk-3P4QZIJ5.mjs} +1 -1
  24. package/dist/cli/{chunk-SKHUWQZE.js → chunk-3S5KFHQH.js} +17 -7
  25. package/dist/cli/{chunk-4LMTY4RQ.mjs → chunk-3ZBPXNSW.mjs} +2 -2
  26. package/dist/cli/{chunk-H7DY5NQ3.mjs → chunk-5BPJW6X5.mjs} +5 -5
  27. package/dist/cli/{chunk-A7NKOXBV.js → chunk-6VSUP4WN.js} +4 -4
  28. package/dist/cli/{chunk-4KNRCUKY.mjs → chunk-7HOG3JZE.mjs} +21 -15
  29. package/dist/cli/{chunk-OAQYLTUN.mjs → chunk-7ORX33JX.mjs} +5 -5
  30. package/dist/cli/{chunk-24FGR73C.js → chunk-ANX3PYLT.js} +13 -13
  31. package/dist/cli/{chunk-VVZ7JZMQ.js → chunk-APJ7IPRT.js} +15 -15
  32. package/dist/cli/{chunk-MXPCTF57.js → chunk-AZTQJJH7.js} +17 -2
  33. package/dist/cli/{chunk-3GF33QJJ.mjs → chunk-BAXLPQTM.mjs} +4 -4
  34. package/dist/cli/{chunk-DDJN4RR6.mjs → chunk-BK4Z62CF.mjs} +4 -4
  35. package/dist/cli/{chunk-IFWB4BYZ.mjs → chunk-C6YXUGX2.mjs} +3 -3
  36. package/dist/cli/{chunk-J7PCSLRY.js → chunk-COAAKSFX.js} +5 -5
  37. package/dist/cli/{chunk-Y2TK7OXN.js → chunk-D6I7QWOZ.js} +2 -2
  38. package/dist/cli/{chunk-W47SXEWQ.js → chunk-DQEHBAHL.js} +9 -9
  39. package/dist/cli/{chunk-ITYSPUKD.mjs → chunk-EI7KTESB.mjs} +2 -2
  40. package/dist/cli/{chunk-HZXF2HFF.mjs → chunk-FCJJPEKN.mjs} +5 -5
  41. package/dist/cli/{chunk-NEH7NZFT.js → chunk-GDBNH57Z.js} +10 -10
  42. package/dist/cli/{chunk-CFG3ZM7M.mjs → chunk-GE4ZEMMA.mjs} +2 -2
  43. package/dist/cli/{chunk-4YSJOSBG.mjs → chunk-GIZIWNL5.mjs} +1 -1
  44. package/dist/cli/{chunk-PJXPHUAR.mjs → chunk-H3B6QM6V.mjs} +3 -3
  45. package/dist/cli/{chunk-25SSGQJJ.js → chunk-HEZ24K5F.js} +2 -2
  46. package/dist/cli/{chunk-LYZPGP3P.mjs → chunk-HLMF53HZ.mjs} +1 -1
  47. package/dist/cli/{chunk-T2CCLYHV.mjs → chunk-IERWFFDB.mjs} +7 -7
  48. package/dist/cli/{chunk-CFLAGRWL.mjs → chunk-IG3CXIJY.mjs} +1 -1
  49. package/dist/cli/{chunk-ALXYCC4K.mjs → chunk-IM322G7M.mjs} +1 -1
  50. package/dist/cli/{chunk-RW3URFZK.mjs → chunk-KLBIHDZB.mjs} +2 -2
  51. package/dist/cli/{chunk-VMCJKGZS.mjs → chunk-LC4ETCOA.mjs} +2 -2
  52. package/dist/cli/{chunk-CS36W3RL.js → chunk-LHV3HPAY.js} +26 -26
  53. package/dist/cli/{chunk-CPNTDIJK.js → chunk-MBOPKQJF.js} +1 -1
  54. package/dist/cli/{chunk-BPMA4S3O.js → chunk-MCYZO3RB.js} +21 -21
  55. package/dist/cli/{chunk-JQPFICW3.mjs → chunk-MEDA3STC.mjs} +1 -1
  56. package/dist/cli/{chunk-ZO65VJRJ.js → chunk-MOZDEYQC.js} +11 -1
  57. package/dist/cli/{chunk-6UFTWNC5.mjs → chunk-MP6XUVAJ.mjs} +2 -2
  58. package/dist/cli/{chunk-HGQT6EGK.js → chunk-NNWEQDZR.js} +20 -20
  59. package/dist/cli/{chunk-AZFSCPYK.mjs → chunk-NV5IJ3NY.mjs} +17 -2
  60. package/dist/cli/{chunk-QPOJLAFT.mjs → chunk-O7AWGIDD.mjs} +2 -2
  61. package/dist/cli/{chunk-G7PH2QVM.js → chunk-PFNYLTCZ.js} +5 -5
  62. package/dist/cli/{chunk-DWUESXDD.mjs → chunk-QXQBTTRD.mjs} +11 -1
  63. package/dist/cli/{chunk-5IMWXYVB.js → chunk-R77IVVEZ.js} +53 -53
  64. package/dist/cli/{chunk-MXK4M7HP.js → chunk-S2YKIWCD.js} +17 -17
  65. package/dist/cli/{chunk-FYKHAT2F.mjs → chunk-SECFDB27.mjs} +10 -0
  66. package/dist/cli/{chunk-NTHN7ODR.mjs → chunk-SQBSK74D.mjs} +7 -3
  67. package/dist/cli/{chunk-M3ITWEGS.js → chunk-TSOXJZSW.js} +41 -41
  68. package/dist/cli/{chunk-CSPOWVWS.mjs → chunk-U4VCAECC.mjs} +8 -3
  69. package/dist/cli/{chunk-RLPPLS6A.js → chunk-URZPR54R.js} +6 -6
  70. package/dist/cli/{chunk-27HAQRGH.js → chunk-V5NDHTBB.js} +23 -23
  71. package/dist/cli/{chunk-HKZN33F2.mjs → chunk-VF3EGTHU.mjs} +3 -3
  72. package/dist/cli/{chunk-5LCV36BR.js → chunk-VOQWPUIF.js} +20 -20
  73. package/dist/cli/{chunk-3ZUKYLC6.js → chunk-WJUAVMQC.js} +217 -213
  74. package/dist/cli/{chunk-W66GXHYR.mjs → chunk-X5RXG6VS.mjs} +1 -1
  75. package/dist/cli/{chunk-UKSOIH2P.js → chunk-XFVJ3JNA.js} +5 -5
  76. package/dist/cli/{chunk-RWDYULX2.js → chunk-XQUVLYOL.js} +17 -12
  77. package/dist/cli/{chunk-XE66BGLB.js → chunk-YY6EB252.js} +2 -2
  78. package/dist/cli/{chunk-XX7TZM4N.js → chunk-Z6DERGHY.js} +48 -48
  79. package/dist/cli/{chunk-PXMCPEE2.js → chunk-ZADJC22U.js} +3 -3
  80. package/dist/cli/{chunk-4CNHOBUO.mjs → chunk-ZR7PDXIA.mjs} +2 -2
  81. package/dist/cli/command-docs.js +2 -2
  82. package/dist/cli/command-docs.mjs +1 -1
  83. package/dist/cli/concurrent-runs-help-DEN63DUM.js +22 -0
  84. package/dist/cli/{concurrent-runs-help-2MHLIUC6.mjs → concurrent-runs-help-DSUQRWZQ.mjs} +6 -6
  85. package/dist/cli/{csv-RYYDAC76.js → csv-HSHF6JYZ.js} +13 -13
  86. package/dist/cli/{csv-J6SRBMOT.mjs → csv-QNXJBT5T.mjs} +4 -4
  87. package/dist/cli/{db-WK226TM7.mjs → db-RAWY3SWS.mjs} +6 -6
  88. package/dist/cli/{db-5QLH6QK5.js → db-VHYWVLLU.js} +27 -27
  89. package/dist/cli/{describe-UBSCFPH5.mjs → describe-WZOVHWAM.mjs} +21 -21
  90. package/dist/cli/describe-YHZ2EGBQ.js +50 -0
  91. package/dist/cli/describe-core.d.mts +4 -2
  92. package/dist/cli/describe-core.d.ts +4 -2
  93. package/dist/cli/describe-core.js +4 -4
  94. package/dist/cli/describe-core.mjs +3 -3
  95. package/dist/cli/{executions-AGV5V7SD.js → executions-DQIFH4Z6.js} +8 -8
  96. package/dist/cli/{executions-XF5BNCFS.mjs → executions-QABOXV4K.mjs} +6 -6
  97. package/dist/cli/{feedback-3RDEZE2M.js → feedback-6IER2W4G.js} +14 -14
  98. package/dist/cli/{feedback-LT3PDK72.mjs → feedback-DW4O63DG.mjs} +6 -6
  99. package/dist/cli/{git-7VBTCCBV.mjs → git-3NAPGZGR.mjs} +5 -5
  100. package/dist/cli/git-SQ2MAKAH.js +26 -0
  101. package/dist/cli/index.js +148 -148
  102. package/dist/cli/index.mjs +47 -47
  103. package/dist/cli/{integrations-JP732FQB.js → integrations-5LHIBBXB.js} +29 -29
  104. package/dist/cli/{integrations-E7QRWMKZ.mjs → integrations-TSRUTENK.mjs} +7 -7
  105. package/dist/cli/{legacy-noops-UFNQBPIT.mjs → legacy-noops-4N63A6H7.mjs} +6 -6
  106. package/dist/cli/{legacy-noops-UTL4W5WE.js → legacy-noops-S22XGYGN.js} +9 -9
  107. package/dist/cli/{mcp-YHETA3AU.mjs → mcp-4EJHRRFV.mjs} +4 -4
  108. package/dist/cli/{mcp-5X4XFB4V.js → mcp-JERBGJYE.js} +24 -24
  109. package/dist/cli/{monitors-WFVZ42OQ.mjs → monitors-7BTLBD6S.mjs} +16 -11
  110. package/dist/cli/{monitors-AN6KH4XY.js → monitors-FF35CGC4.js} +109 -104
  111. package/dist/cli/{org-CN3XJZLA.js → org-ADCDO7KU.js} +121 -121
  112. package/dist/cli/{org-OMDV7WDF.mjs → org-QYIIBKA2.mjs} +6 -6
  113. package/dist/cli/{outcomes-7HCZ6K3Q.js → outcomes-2LW4GK2L.js} +14 -14
  114. package/dist/cli/{outcomes-I4ZTG5ND.mjs → outcomes-C5DIBG4Q.mjs} +6 -6
  115. package/dist/cli/{play-TSNBSHGA.mjs → play-DTTDTISL.mjs} +20 -20
  116. package/dist/cli/{play-45VXZ57A.js → play-S5MZ2GRA.js} +349 -349
  117. package/dist/cli/{providers-4TB56ZLK.mjs → providers-AXOEFQ6Q.mjs} +6 -6
  118. package/dist/cli/{providers-RB3TT7AE.js → providers-N2IWEJBW.js} +9 -9
  119. package/dist/cli/{quickstart-XHZ3PG5I.mjs → quickstart-ADWSZBV6.mjs} +4 -4
  120. package/dist/cli/{quickstart-ZNDM6VUD.js → quickstart-UC5AJZWU.js} +6 -6
  121. package/dist/cli/{run-XNEJGAKV.js → run-6TDYUL7L.js} +49 -48
  122. package/dist/cli/{run-7PY4G6GB.mjs → run-R2FVH3K6.mjs} +27 -26
  123. package/dist/cli/{search-BG7KCIOG.mjs → search-GRHUFSLY.mjs} +7 -7
  124. package/dist/cli/search-V7ANBX3J.js +32 -0
  125. package/dist/cli/{search-output-3ZBNTHGO.js → search-output-O7NY3VMD.js} +8 -8
  126. package/dist/cli/{search-output-TWKKP2BE.mjs → search-output-UPQNAFAF.mjs} +5 -5
  127. package/dist/cli/{secrets-FNR6MX6A.js → secrets-72GJHFER.js} +15 -15
  128. package/dist/cli/{secrets-AZZCE7E3.mjs → secrets-NKAEJLIQ.mjs} +6 -6
  129. package/dist/cli/sessions-EO6RTMUC.js +23 -0
  130. package/dist/cli/{sessions-ZAMKN3AF.mjs → sessions-VIMF3UF5.mjs} +6 -6
  131. package/dist/cli/{settings-QGASFWV3.js → settings-HFAW5HIF.js} +85 -85
  132. package/dist/cli/{settings-WKWOOOI2.mjs → settings-KCQHBFNZ.mjs} +12 -12
  133. package/dist/cli/{setup-KUZDCR3F.js → setup-2MHWGEAD.js} +49 -49
  134. package/dist/cli/{setup-U36W42LE.mjs → setup-2ZD5ZIUH.mjs} +9 -9
  135. package/dist/cli/skills-ID6KKDLH.js +37 -0
  136. package/dist/cli/{skills-25CSZQIK.mjs → skills-X2DZZG5P.mjs} +7 -7
  137. package/dist/cli/tools-7UY7GERW.js +57 -0
  138. package/dist/cli/{tools-4NZQ22AA.mjs → tools-KPTOWKD4.mjs} +19 -19
  139. package/dist/cli/{update-CJYP36TG.mjs → update-6PMQCEUP.mjs} +9 -9
  140. package/dist/cli/update-T2RDLLSY.js +37 -0
  141. package/dist/cli/{views-76UIPWJD.js → views-MNBHNO6C.js} +37 -24
  142. package/dist/cli/{views-GYGE7FSV.mjs → views-VRZ5CTFL.mjs} +21 -8
  143. package/dist/cli/{workflow-LZSWALZS.mjs → workflow-7JUJWA5S.mjs} +7 -7
  144. package/dist/cli/{workflow-NCVXBATM.js → workflow-SSMFO7YE.js} +17 -17
  145. package/dist/{client-CF-bsrtI.d.mts → client-CmG8MT0x.d.mts} +1 -1
  146. package/dist/{client-BrdMPFCM.d.ts → client-QznpkWrk.d.ts} +1 -1
  147. package/dist/{client-core-rMoUWSYM.d.ts → client-core-CXDqfeiB.d.ts} +12 -1
  148. package/dist/{client-core-DM1ZedOG.d.mts → client-core-CY0jNW0e.d.mts} +12 -1
  149. package/dist/index.d.mts +3 -3
  150. package/dist/index.d.ts +3 -3
  151. package/dist/index.js +9 -9
  152. package/dist/index.mjs +6 -6
  153. package/dist/install-integrity.json +126 -126
  154. package/dist/plays/play-description.d.mts +1 -1
  155. package/dist/plays/play-description.d.ts +1 -1
  156. package/dist/plays/run-request.d.mts +1 -1
  157. package/dist/plays/run-request.d.ts +1 -1
  158. package/dist/release.d.mts +1 -1
  159. package/dist/release.d.ts +1 -1
  160. package/dist/release.js +2 -2
  161. package/dist/release.mjs +1 -1
  162. package/dist/server.d.mts +2 -2
  163. package/dist/server.d.ts +2 -2
  164. package/dist/server.js +5 -5
  165. package/dist/server.mjs +3 -3
  166. package/package.json +1 -1
  167. package/dist/cli/auth-VSW3MTFO.js +0 -44
  168. package/dist/cli/concurrent-runs-help-ATT2GVTQ.js +0 -22
  169. package/dist/cli/describe-Q27SRQWM.js +0 -50
  170. package/dist/cli/git-BBTP3H7J.js +0 -26
  171. package/dist/cli/search-ZBU5GW4W.js +0 -32
  172. package/dist/cli/sessions-GCY62GAW.js +0 -23
  173. package/dist/cli/skills-43DHMLRW.js +0 -37
  174. package/dist/cli/tools-5BGKNMFU.js +0 -57
  175. package/dist/cli/update-CUO2MTB6.js +0 -37
@@ -1,21 +1,26 @@
1
1
  import {
2
2
  concurrentRunsLine
3
- } from "./chunk-4CNHOBUO.mjs";
4
- import "./chunk-HKZN33F2.mjs";
3
+ } from "./chunk-ZR7PDXIA.mjs";
4
+ import {
5
+ buildDashboardUrl
6
+ } from "./chunk-SECFDB27.mjs";
7
+ import "./chunk-STXDSVQZ.mjs";
8
+ import "./chunk-VF3EGTHU.mjs";
5
9
  import {
6
10
  DeeplineClient
7
- } from "./chunk-ITYSPUKD.mjs";
11
+ } from "./chunk-EI7KTESB.mjs";
8
12
  import {
9
13
  PUBLIC_PLAN_SKUS,
10
14
  iterateCursorPages,
11
- requireBillingIdempotencyKey
12
- } from "./chunk-NTHN7ODR.mjs";
15
+ requireBillingIdempotencyKey,
16
+ resolvePublicPlanSku
17
+ } from "./chunk-SQBSK74D.mjs";
13
18
  import "./chunk-FZHMNK6F.mjs";
14
19
  import "./chunk-5TYLSS4Q.mjs";
15
20
  import "./chunk-PSX3WHIH.mjs";
16
21
  import {
17
22
  PLAY_RUNTIME_PRICING_NOTE
18
- } from "./chunk-AZFSCPYK.mjs";
23
+ } from "./chunk-NV5IJ3NY.mjs";
19
24
  import {
20
25
  PRICING_PAGE_NOTE
21
26
  } from "./chunk-HECXJBED.mjs";
@@ -32,9 +37,12 @@ import {
32
37
  openInBrowser,
33
38
  printCommandEnvelope,
34
39
  shouldEmitJson
35
- } from "./chunk-4LMTY4RQ.mjs";
36
- import "./chunk-W66GXHYR.mjs";
37
- import "./chunk-CFLAGRWL.mjs";
40
+ } from "./chunk-3ZBPXNSW.mjs";
41
+ import {
42
+ resolveBaseUrlOnly,
43
+ resolveCliDashboardOrgId
44
+ } from "./chunk-X5RXG6VS.mjs";
45
+ import "./chunk-IG3CXIJY.mjs";
38
46
  import {
39
47
  AuthError,
40
48
  ConfigError
@@ -44,7 +52,7 @@ import {
44
52
  DeeplineError
45
53
  } from "./chunk-Z3A2S3QM.mjs";
46
54
  import "./chunk-2MGZAI54.mjs";
47
- import "./chunk-4YSJOSBG.mjs";
55
+ import "./chunk-GIZIWNL5.mjs";
48
56
  import "./chunk-WZYKRD7T.mjs";
49
57
  import "./chunk-KRD6H754.mjs";
50
58
 
@@ -299,6 +307,8 @@ function recentUsageLines(entries) {
299
307
  const auditBits = [
300
308
  entry.outcome ? `outcome=${entry.outcome}` : null,
301
309
  entry.pricing_basis ? `priced_by=${entry.pricing_basis}` : null,
310
+ // managed: Deepline's provider key; user: the workspace's own key.
311
+ entry.credential_source && entry.credential_source !== "unknown" ? `key=${entry.credential_source}` : null,
302
312
  entry.run_id ? `run=${entry.run_id}` : null,
303
313
  entry.play_run_id || entry.execution_run_id ? `play_run=${entry.play_run_id ?? entry.execution_run_id}` : null,
304
314
  entry.billing_run_id ? `billing_run=${entry.billing_run_id}` : null,
@@ -855,7 +865,7 @@ function planPriceText(priceUsd, priceInterval) {
855
865
  function targetPlanLine(plan) {
856
866
  const firstMonth = plan.first_month_price_usd != null ? ` (first month $${plan.first_month_price_usd})` : "";
857
867
  const bonus = plan.bonus_credits != null ? ` (+${plan.bonus_credits} bonus credits once paid)` : "";
858
- const annual = plan.annual_price_usd != null ? ` (or $${plan.annual_price_usd}/year with --annual${plan.annual_offer_label ? `, ${plan.annual_offer_label}` : ""})` : "";
868
+ const annual = plan.annual_price_usd != null ? ` (or $${plan.annual_price_usd}/year paid annually${plan.annual_offer_label ? `, ${plan.annual_offer_label}` : ""})` : "";
859
869
  return `${plan.display_name ?? plan.name} (${plan.public_sku ?? plan.sku}) | ${planPriceText(plan.recurring_price_usd, plan.interval)}${firstMonth}${bonus}${annual} | ${plan.included_credits} included credits/month | $${plan.purchased_credit_price_usd}/purchased credit | ${plan.acquisition_enabled ? "available" : "unavailable"}`;
860
870
  }
861
871
  async function handlePlans(options) {
@@ -883,7 +893,7 @@ async function handlePlans(options) {
883
893
  promo.status === "applied" ? `Promo code ${promo.code}: applied to ${promoPlanSkus.join(", ")}${promo.expires_at ? ` (until ${promo.expires_at})` : ""}` : `Promo code ${promo.code}: ${promo.status.replaceAll("_", " ")}`
884
894
  ] : [],
885
895
  ...plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...plans.map(targetPlanLine)],
886
- promo?.status === "applied" ? `Change plan: deepline billing change-plan <plan_sku> --promo-code ${promo.code}` : "Change plan: deepline billing change-plan <plan_sku>"
896
+ promo?.status === "applied" ? `Change plan: deepline billing change-plan <plan_sku>, then enter promo code ${promo.code} in the browser` : "Change plan: deepline billing change-plan <plan_sku>"
887
897
  ];
888
898
  const legacyPayload = shouldEmitJson(options.json) ? await client.billing.plans() : null;
889
899
  printCommandEnvelope(
@@ -1723,23 +1733,10 @@ async function handleTopUpRecover(creditsRaw, options) {
1723
1733
  );
1724
1734
  }
1725
1735
  async function handleTargetPlan(planSku, options) {
1726
- if (options.invoice && !options.billingEmail) {
1727
- reportBillingFailure(
1728
- {
1729
- exitCode: 2,
1730
- code: "INVALID_REQUEST",
1731
- message: "--invoice needs --billing-email <email>."
1732
- },
1733
- options
1734
- );
1735
- return;
1736
- }
1737
- const targetPlanSku = [...PUBLIC_PLAN_SKUS, ...COMPATIBLE_PLAN_SKUS].find(
1736
+ const targetPlanSku = planSku === void 0 ? void 0 : [...PUBLIC_PLAN_SKUS, ...COMPATIBLE_PLAN_SKUS].find(
1738
1737
  (sku) => sku === planSku
1739
- ) ?? // Retained Canary requests may replay their original operation. The API
1740
- // rejects new acquisition even when a caller supplies an idempotency key.
1741
- (planSku === "growth-canary-v1" && options.idempotencyKey ? planSku : void 0);
1742
- if (!targetPlanSku) {
1738
+ );
1739
+ if (planSku !== void 0 && !targetPlanSku) {
1743
1740
  reportBillingFailure(
1744
1741
  {
1745
1742
  exitCode: 2,
@@ -1750,18 +1747,26 @@ async function handleTargetPlan(planSku, options) {
1750
1747
  );
1751
1748
  return;
1752
1749
  }
1753
- const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
1754
- const payload = await new DeeplineClient().billing.transitionPlan({
1755
- action: "start_or_change",
1756
- targetPlanSku,
1757
- ...options.billingEmail ? { billingEmail: options.billingEmail } : {},
1758
- ...options.promoCode ? { promoCode: options.promoCode } : {},
1759
- ...options.annual ? { billingInterval: "year" } : {},
1760
- ...options.invoice ? { paymentMethod: "invoice" } : {},
1761
- idempotencyKey
1762
- });
1750
+ const baseUrl = resolveBaseUrlOnly();
1751
+ const link = buildDashboardUrl(
1752
+ baseUrl,
1753
+ targetPlanSku ? `/dashboard/billing?plan=${encodeURIComponent(resolvePublicPlanSku(targetPlanSku))}` : "/dashboard/billing?plan",
1754
+ resolveCliDashboardOrgId(baseUrl)
1755
+ );
1756
+ if (!options.json && options.open !== false) openInBrowser(link);
1763
1757
  printCommandEnvelope(
1764
- { ok: true, idempotency_key: idempotencyKey, ...payload },
1758
+ {
1759
+ ok: true,
1760
+ url: link,
1761
+ render: {
1762
+ sections: [
1763
+ {
1764
+ title: "billing change-plan",
1765
+ lines: [`Open this link to choose and confirm the plan: ${link}`]
1766
+ }
1767
+ ]
1768
+ }
1769
+ },
1765
1770
  { json: options.json }
1766
1771
  );
1767
1772
  }
@@ -2206,22 +2211,25 @@ Examples:
2206
2211
  (cardId, options) => handleCardChange("remove", cardId, options)
2207
2212
  )
2208
2213
  );
2209
- billing.command("change-plan").description("Start or change the target billing plan.").argument(
2210
- "<plan_sku>",
2211
- `${PUBLIC_PLAN_SKUS.join(", ")}. Run deepline billing plans to see workspace availability.`
2212
- ).option(
2213
- "--billing-email <email>",
2214
- "Invoice recipient: required with --invoice, otherwise used when the account has no billing email"
2215
- ).option(
2216
- "--promo-code <code>",
2217
- "Plan promo code; an unknown, expired, or used code refuses the change"
2218
- ).option(
2219
- "--annual",
2220
- "Pay for a year up front where `billing plans` shows an annual price; credits stay monthly and a cancellation takes effect at the end of the paid year"
2221
- ).option(
2222
- "--invoice",
2223
- "Email an invoice to --billing-email instead of charging a card (monthly or with --annual, starting from Solo); the plan starts once it is paid (due in 27 days). Set company name, address and tax ID first with `billing details set`"
2224
- ).option("--idempotency-key <key>", "Stable retry key").option("--json", "Emit JSON output").action(handleTargetPlan);
2214
+ billing.command("change-plan").description(
2215
+ "Print and open a billing page link with the plan dialog open; the plan changes only once you confirm it in the browser."
2216
+ ).addHelpText(
2217
+ "after",
2218
+ `
2219
+ Notes:
2220
+ Makes no change itself. A named plan opens its confirmation in the browser;
2221
+ without one, the plan picker opens. Annual billing and promo codes are
2222
+ chosen in the browser. Agents: give the user the printed link.
2223
+
2224
+ Examples:
2225
+ deepline billing change-plan
2226
+ deepline billing change-plan team
2227
+ deepline billing change-plan scale --no-open
2228
+ `
2229
+ ).argument(
2230
+ "[plan_sku]",
2231
+ `${PUBLIC_PLAN_SKUS.join(", ")}. Opens that plan's confirmation; omit to open the plan picker.`
2232
+ ).option("--no-open", "Print the link without opening a browser").option("--json", "Emit JSON output").action(handleTargetPlan);
2225
2233
  const details = billing.command("details").description(
2226
2234
  "Show the company name, billing address and tax ID printed on invoices."
2227
2235
  ).option("--json", "Emit JSON output").action(handleBillingDetailsShow);
@@ -2240,15 +2248,12 @@ Notes:
2240
2248
  Read-only. Shows the current target billing plan, pending plan, and every
2241
2249
  visible plan's recurring price, included credits, purchased-credit price,
2242
2250
  and current acquisition availability. All amounts are Deepline credits and
2243
- Deepline-facing USD, never raw provider spend. Change to an available plan
2244
- with: deepline billing change-plan <plan_sku>. A first-month price or bonus
2245
- credits appear on a plan when the org is offered them. An annual
2246
- price appears when the org may pay for a year up front; buy it with
2247
- change-plan <plan_sku> --annual. Where offered, any plan can be invoiced
2248
- instead of charged: add --invoice --billing-email <email> (billing details set adds the company
2249
- name, address and tax ID). With
2250
- --promo-code, prices are quoted with that code and its outcome is shown;
2251
- pass the same code to change-plan.
2251
+ Deepline-facing USD, never raw provider spend. Get a link to change to an
2252
+ available plan with: deepline billing change-plan <plan_sku>. A first-month
2253
+ price or bonus credits appear on a plan when the org is offered them. An
2254
+ annual price appears when the org may pay for a year up front; choose it in
2255
+ the browser. With --promo-code, prices are quoted with that code and its
2256
+ outcome is shown; enter the same code in the browser.
2252
2257
 
2253
2258
  Examples:
2254
2259
  deepline billing plans