deepline 0.3.579 → 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 (169) hide show
  1. package/dist/bundling-sources/sdk/src/client-core.ts +13 -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/scheduler-backends/postgres.ts +139 -16
  8. package/dist/bundling-sources/shared_libs/play-runtime/scheduler-backends/run-ledger-outbox-recovery.ts +39 -2
  9. package/dist/cli/{agents-D5RZEVXQ.js → agents-BF5VX5ZB.js} +31 -31
  10. package/dist/cli/{agents-FJTRTYCL.mjs → agents-JRFTZE7G.mjs} +4 -4
  11. package/dist/cli/auth-25MVD7TK.js +44 -0
  12. package/dist/cli/{auth-OMYIDVXZ.mjs → auth-XJXZ64R4.mjs} +5 -5
  13. package/dist/cli/{billing-XK3LBNYS.mjs → billing-TXJBGP2I.mjs} +67 -64
  14. package/dist/cli/{billing-EWFUDLQ7.js → billing-VGMTJI7W.js} +156 -153
  15. package/dist/cli/{chunk-TVAFWAOQ.js → chunk-2ZCFAUCV.js} +3 -3
  16. package/dist/cli/{chunk-HEZW2IDK.js → chunk-3OSNEWGR.js} +279 -276
  17. package/dist/cli/{chunk-TFNDOH4W.mjs → chunk-3P4QZIJ5.mjs} +1 -1
  18. package/dist/cli/{chunk-QA55PGJH.js → chunk-3S5KFHQH.js} +7 -7
  19. package/dist/cli/{chunk-6DMGKAWO.mjs → chunk-3ZBPXNSW.mjs} +2 -2
  20. package/dist/cli/{chunk-27ZYRIQC.mjs → chunk-5BPJW6X5.mjs} +5 -5
  21. package/dist/cli/{chunk-6MIEJJSO.js → chunk-6VSUP4WN.js} +4 -4
  22. package/dist/cli/{chunk-6GON36H3.mjs → chunk-7HOG3JZE.mjs} +17 -14
  23. package/dist/cli/{chunk-JFS4KHA3.mjs → chunk-7ORX33JX.mjs} +5 -5
  24. package/dist/cli/{chunk-NWZU6HL4.js → chunk-ANX3PYLT.js} +13 -13
  25. package/dist/cli/{chunk-FKXSIIR4.js → chunk-APJ7IPRT.js} +15 -15
  26. package/dist/cli/{chunk-44NTNNKC.js → chunk-AZTQJJH7.js} +6 -0
  27. package/dist/cli/{chunk-WQQQP3FH.mjs → chunk-BAXLPQTM.mjs} +4 -4
  28. package/dist/cli/{chunk-M4YWN5BT.mjs → chunk-BK4Z62CF.mjs} +4 -4
  29. package/dist/cli/{chunk-KQAEXBVQ.mjs → chunk-C6YXUGX2.mjs} +3 -3
  30. package/dist/cli/{chunk-PLWZ3NB7.js → chunk-COAAKSFX.js} +5 -5
  31. package/dist/cli/{chunk-LCPJR3IY.js → chunk-D6I7QWOZ.js} +2 -2
  32. package/dist/cli/{chunk-LQ45LCH7.js → chunk-DQEHBAHL.js} +9 -9
  33. package/dist/cli/{chunk-6EVVUVU3.mjs → chunk-EI7KTESB.mjs} +2 -2
  34. package/dist/cli/{chunk-F57NDSKT.mjs → chunk-FCJJPEKN.mjs} +5 -5
  35. package/dist/cli/{chunk-7JMCRYXU.js → chunk-GDBNH57Z.js} +10 -10
  36. package/dist/cli/{chunk-NONMY5CY.mjs → chunk-GE4ZEMMA.mjs} +2 -2
  37. package/dist/cli/{chunk-6NYHMXC7.mjs → chunk-GIZIWNL5.mjs} +1 -1
  38. package/dist/cli/{chunk-SZIWFQI2.mjs → chunk-H3B6QM6V.mjs} +3 -3
  39. package/dist/cli/{chunk-NKUXW4WB.js → chunk-HEZ24K5F.js} +2 -2
  40. package/dist/cli/{chunk-LV2LGW2Q.mjs → chunk-HLMF53HZ.mjs} +1 -1
  41. package/dist/cli/{chunk-S2OXA7QS.mjs → chunk-IERWFFDB.mjs} +7 -7
  42. package/dist/cli/{chunk-I2TSRLOI.mjs → chunk-IG3CXIJY.mjs} +1 -1
  43. package/dist/cli/{chunk-OSRATALX.mjs → chunk-IM322G7M.mjs} +1 -1
  44. package/dist/cli/{chunk-VFIIRK7S.mjs → chunk-KLBIHDZB.mjs} +2 -2
  45. package/dist/cli/{chunk-N6X2UKYQ.mjs → chunk-LC4ETCOA.mjs} +2 -2
  46. package/dist/cli/{chunk-G5CZDRY3.js → chunk-LHV3HPAY.js} +26 -26
  47. package/dist/cli/{chunk-NOMO5GPI.js → chunk-MBOPKQJF.js} +1 -1
  48. package/dist/cli/{chunk-BLEYV4BJ.js → chunk-MCYZO3RB.js} +21 -21
  49. package/dist/cli/{chunk-X6LPC3SU.mjs → chunk-MEDA3STC.mjs} +1 -1
  50. package/dist/cli/{chunk-PGRRMVQ5.js → chunk-MOZDEYQC.js} +2 -1
  51. package/dist/cli/{chunk-XQYBBCFI.mjs → chunk-MP6XUVAJ.mjs} +2 -2
  52. package/dist/cli/{chunk-OOGP737I.js → chunk-NNWEQDZR.js} +20 -20
  53. package/dist/cli/{chunk-HGUFTSB5.mjs → chunk-NV5IJ3NY.mjs} +6 -0
  54. package/dist/cli/{chunk-LYBZLA6F.mjs → chunk-O7AWGIDD.mjs} +2 -2
  55. package/dist/cli/{chunk-WWSGXX6U.js → chunk-PFNYLTCZ.js} +5 -5
  56. package/dist/cli/{chunk-BZ4M7OFO.mjs → chunk-QXQBTTRD.mjs} +1 -1
  57. package/dist/cli/{chunk-XTM6NOJ6.js → chunk-R77IVVEZ.js} +53 -53
  58. package/dist/cli/{chunk-Q4VKMF3B.js → chunk-S2YKIWCD.js} +17 -17
  59. package/dist/cli/{chunk-DTQBQSUU.mjs → chunk-SECFDB27.mjs} +1 -0
  60. package/dist/cli/{chunk-KIIOKQFY.mjs → chunk-SQBSK74D.mjs} +7 -3
  61. package/dist/cli/{chunk-AP7PIGL5.js → chunk-TSOXJZSW.js} +41 -41
  62. package/dist/cli/{chunk-YCWRKSLB.mjs → chunk-U4VCAECC.mjs} +2 -2
  63. package/dist/cli/{chunk-KWQHQG53.js → chunk-URZPR54R.js} +6 -6
  64. package/dist/cli/{chunk-ABH6PUDZ.js → chunk-V5NDHTBB.js} +23 -23
  65. package/dist/cli/{chunk-SUHCW7U5.mjs → chunk-VF3EGTHU.mjs} +3 -3
  66. package/dist/cli/{chunk-DH736ASH.js → chunk-VOQWPUIF.js} +20 -20
  67. package/dist/cli/{chunk-7HOYKXVY.js → chunk-WJUAVMQC.js} +217 -213
  68. package/dist/cli/{chunk-3Z4TVZE7.mjs → chunk-X5RXG6VS.mjs} +1 -1
  69. package/dist/cli/{chunk-UYCBG75H.js → chunk-XFVJ3JNA.js} +5 -5
  70. package/dist/cli/{chunk-LYJ2NSHD.js → chunk-XQUVLYOL.js} +13 -13
  71. package/dist/cli/{chunk-K2BU67UC.js → chunk-YY6EB252.js} +2 -2
  72. package/dist/cli/{chunk-Y2ND6PPW.js → chunk-Z6DERGHY.js} +48 -48
  73. package/dist/cli/{chunk-72TWLORR.js → chunk-ZADJC22U.js} +3 -3
  74. package/dist/cli/{chunk-7SZCJC4R.mjs → chunk-ZR7PDXIA.mjs} +2 -2
  75. package/dist/cli/command-docs.js +2 -2
  76. package/dist/cli/command-docs.mjs +1 -1
  77. package/dist/cli/concurrent-runs-help-DEN63DUM.js +22 -0
  78. package/dist/cli/{concurrent-runs-help-IQBZBTD5.mjs → concurrent-runs-help-DSUQRWZQ.mjs} +6 -6
  79. package/dist/cli/{csv-T7TWLIGD.js → csv-HSHF6JYZ.js} +13 -13
  80. package/dist/cli/{csv-6BEOWTGM.mjs → csv-QNXJBT5T.mjs} +4 -4
  81. package/dist/cli/{db-FA5QGXZ7.mjs → db-RAWY3SWS.mjs} +6 -6
  82. package/dist/cli/{db-MFTUN3DF.js → db-VHYWVLLU.js} +27 -27
  83. package/dist/cli/{describe-TITEQNVE.mjs → describe-WZOVHWAM.mjs} +21 -21
  84. package/dist/cli/describe-YHZ2EGBQ.js +50 -0
  85. package/dist/cli/describe-core.d.mts +2 -2
  86. package/dist/cli/describe-core.d.ts +2 -2
  87. package/dist/cli/describe-core.js +4 -4
  88. package/dist/cli/describe-core.mjs +3 -3
  89. package/dist/cli/{executions-QW3L7G7J.js → executions-DQIFH4Z6.js} +8 -8
  90. package/dist/cli/{executions-DMYJJIRB.mjs → executions-QABOXV4K.mjs} +6 -6
  91. package/dist/cli/{feedback-6JZGE7OQ.js → feedback-6IER2W4G.js} +14 -14
  92. package/dist/cli/{feedback-WPSNSFRC.mjs → feedback-DW4O63DG.mjs} +6 -6
  93. package/dist/cli/{git-GO65XRM3.mjs → git-3NAPGZGR.mjs} +5 -5
  94. package/dist/cli/git-SQ2MAKAH.js +26 -0
  95. package/dist/cli/index.js +148 -148
  96. package/dist/cli/index.mjs +47 -47
  97. package/dist/cli/{integrations-T5JPSZXN.js → integrations-5LHIBBXB.js} +29 -29
  98. package/dist/cli/{integrations-EEBPETH2.mjs → integrations-TSRUTENK.mjs} +7 -7
  99. package/dist/cli/{legacy-noops-XDNZ46IR.mjs → legacy-noops-4N63A6H7.mjs} +6 -6
  100. package/dist/cli/{legacy-noops-B55OMNH7.js → legacy-noops-S22XGYGN.js} +9 -9
  101. package/dist/cli/{mcp-4QIUAAWS.mjs → mcp-4EJHRRFV.mjs} +4 -4
  102. package/dist/cli/{mcp-3YA333TQ.js → mcp-JERBGJYE.js} +24 -24
  103. package/dist/cli/{monitors-BVUPS4CE.mjs → monitors-7BTLBD6S.mjs} +16 -11
  104. package/dist/cli/{monitors-FOS7MWZO.js → monitors-FF35CGC4.js} +109 -104
  105. package/dist/cli/{org-CYM7HFLN.js → org-ADCDO7KU.js} +121 -121
  106. package/dist/cli/{org-TCMRRVFC.mjs → org-QYIIBKA2.mjs} +6 -6
  107. package/dist/cli/{outcomes-VDJVP5YC.js → outcomes-2LW4GK2L.js} +14 -14
  108. package/dist/cli/{outcomes-2JSWXWQ3.mjs → outcomes-C5DIBG4Q.mjs} +6 -6
  109. package/dist/cli/{play-CPP4EBYF.mjs → play-DTTDTISL.mjs} +20 -20
  110. package/dist/cli/{play-U3G73VIR.js → play-S5MZ2GRA.js} +349 -349
  111. package/dist/cli/{providers-RVMIX5ED.mjs → providers-AXOEFQ6Q.mjs} +6 -6
  112. package/dist/cli/{providers-2ZB67TK7.js → providers-N2IWEJBW.js} +9 -9
  113. package/dist/cli/{quickstart-L3YO3OWZ.mjs → quickstart-ADWSZBV6.mjs} +4 -4
  114. package/dist/cli/{quickstart-V3Y7XZ47.js → quickstart-UC5AJZWU.js} +6 -6
  115. package/dist/cli/{run-M2CADJ6E.js → run-6TDYUL7L.js} +48 -48
  116. package/dist/cli/{run-PQ3Z2GOF.mjs → run-R2FVH3K6.mjs} +26 -26
  117. package/dist/cli/{search-QVLGI7SZ.mjs → search-GRHUFSLY.mjs} +7 -7
  118. package/dist/cli/search-V7ANBX3J.js +32 -0
  119. package/dist/cli/{search-output-IUANVHWU.js → search-output-O7NY3VMD.js} +8 -8
  120. package/dist/cli/{search-output-PN3V7MSO.mjs → search-output-UPQNAFAF.mjs} +5 -5
  121. package/dist/cli/{secrets-AOW6F67J.js → secrets-72GJHFER.js} +15 -15
  122. package/dist/cli/{secrets-HK25G4K2.mjs → secrets-NKAEJLIQ.mjs} +6 -6
  123. package/dist/cli/sessions-EO6RTMUC.js +23 -0
  124. package/dist/cli/{sessions-YN2OIAGR.mjs → sessions-VIMF3UF5.mjs} +6 -6
  125. package/dist/cli/{settings-6EV2FPGF.js → settings-HFAW5HIF.js} +85 -85
  126. package/dist/cli/{settings-7UW5TWSM.mjs → settings-KCQHBFNZ.mjs} +12 -12
  127. package/dist/cli/{setup-ZQPD2R5K.js → setup-2MHWGEAD.js} +49 -49
  128. package/dist/cli/{setup-BG56SHKH.mjs → setup-2ZD5ZIUH.mjs} +9 -9
  129. package/dist/cli/skills-ID6KKDLH.js +37 -0
  130. package/dist/cli/{skills-MQV2TNUZ.mjs → skills-X2DZZG5P.mjs} +7 -7
  131. package/dist/cli/tools-7UY7GERW.js +57 -0
  132. package/dist/cli/{tools-RGI4OE5T.mjs → tools-KPTOWKD4.mjs} +19 -19
  133. package/dist/cli/{update-SQKGHQKF.mjs → update-6PMQCEUP.mjs} +9 -9
  134. package/dist/cli/update-T2RDLLSY.js +37 -0
  135. package/dist/cli/{views-BUKVHCRD.js → views-MNBHNO6C.js} +37 -24
  136. package/dist/cli/{views-734T2CXF.mjs → views-VRZ5CTFL.mjs} +21 -8
  137. package/dist/cli/{workflow-JNRRBMEK.mjs → workflow-7JUJWA5S.mjs} +7 -7
  138. package/dist/cli/{workflow-LPJC6RHP.js → workflow-SSMFO7YE.js} +17 -17
  139. package/dist/{client-CNYctEBh.d.mts → client-CmG8MT0x.d.mts} +1 -1
  140. package/dist/{client-C1AubrWJ.d.ts → client-QznpkWrk.d.ts} +1 -1
  141. package/dist/{client-core-D6zAE46g.d.ts → client-core-CXDqfeiB.d.ts} +5 -1
  142. package/dist/{client-core-Bb06TCx5.d.mts → client-core-CY0jNW0e.d.mts} +5 -1
  143. package/dist/index.d.mts +3 -3
  144. package/dist/index.d.ts +3 -3
  145. package/dist/index.js +9 -9
  146. package/dist/index.mjs +6 -6
  147. package/dist/install-integrity.json +126 -126
  148. package/dist/plays/play-description.d.mts +1 -1
  149. package/dist/plays/play-description.d.ts +1 -1
  150. package/dist/plays/run-request.d.mts +1 -1
  151. package/dist/plays/run-request.d.ts +1 -1
  152. package/dist/release.d.mts +1 -1
  153. package/dist/release.d.ts +1 -1
  154. package/dist/release.js +2 -2
  155. package/dist/release.mjs +1 -1
  156. package/dist/server.d.mts +2 -2
  157. package/dist/server.d.ts +2 -2
  158. package/dist/server.js +5 -5
  159. package/dist/server.mjs +3 -3
  160. package/package.json +1 -1
  161. package/dist/cli/auth-Q4O7MJU4.js +0 -44
  162. package/dist/cli/concurrent-runs-help-D6XH3FY5.js +0 -22
  163. package/dist/cli/describe-TYZ5YH3V.js +0 -50
  164. package/dist/cli/git-UGGRLGTQ.js +0 -26
  165. package/dist/cli/search-RHPPZZFG.js +0 -32
  166. package/dist/cli/sessions-AEGGTZ3K.js +0 -23
  167. package/dist/cli/skills-C6ZEZWBE.js +0 -37
  168. package/dist/cli/tools-PM3MC3RR.js +0 -57
  169. package/dist/cli/update-ZHUPF2HT.js +0 -37
@@ -1,21 +1,26 @@
1
1
  import {
2
2
  concurrentRunsLine
3
- } from "./chunk-7SZCJC4R.mjs";
4
- import "./chunk-SUHCW7U5.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-6EVVUVU3.mjs";
11
+ } from "./chunk-EI7KTESB.mjs";
8
12
  import {
9
13
  PUBLIC_PLAN_SKUS,
10
14
  iterateCursorPages,
11
- requireBillingIdempotencyKey
12
- } from "./chunk-KIIOKQFY.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-HGUFTSB5.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-6DMGKAWO.mjs";
36
- import "./chunk-3Z4TVZE7.mjs";
37
- import "./chunk-I2TSRLOI.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-6NYHMXC7.mjs";
55
+ import "./chunk-GIZIWNL5.mjs";
48
56
  import "./chunk-WZYKRD7T.mjs";
49
57
  import "./chunk-KRD6H754.mjs";
50
58
 
@@ -857,7 +865,7 @@ function planPriceText(priceUsd, priceInterval) {
857
865
  function targetPlanLine(plan) {
858
866
  const firstMonth = plan.first_month_price_usd != null ? ` (first month $${plan.first_month_price_usd})` : "";
859
867
  const bonus = plan.bonus_credits != null ? ` (+${plan.bonus_credits} bonus credits once paid)` : "";
860
- 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}` : ""})` : "";
861
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"}`;
862
870
  }
863
871
  async function handlePlans(options) {
@@ -885,7 +893,7 @@ async function handlePlans(options) {
885
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("_", " ")}`
886
894
  ] : [],
887
895
  ...plans.length === 0 ? ["Plans: none available"] : ["Plans:", ...plans.map(targetPlanLine)],
888
- 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>"
889
897
  ];
890
898
  const legacyPayload = shouldEmitJson(options.json) ? await client.billing.plans() : null;
891
899
  printCommandEnvelope(
@@ -1725,23 +1733,10 @@ async function handleTopUpRecover(creditsRaw, options) {
1725
1733
  );
1726
1734
  }
1727
1735
  async function handleTargetPlan(planSku, options) {
1728
- if (options.invoice && !options.billingEmail) {
1729
- reportBillingFailure(
1730
- {
1731
- exitCode: 2,
1732
- code: "INVALID_REQUEST",
1733
- message: "--invoice needs --billing-email <email>."
1734
- },
1735
- options
1736
- );
1737
- return;
1738
- }
1739
- const targetPlanSku = [...PUBLIC_PLAN_SKUS, ...COMPATIBLE_PLAN_SKUS].find(
1736
+ const targetPlanSku = planSku === void 0 ? void 0 : [...PUBLIC_PLAN_SKUS, ...COMPATIBLE_PLAN_SKUS].find(
1740
1737
  (sku) => sku === planSku
1741
- ) ?? // Retained Canary requests may replay their original operation. The API
1742
- // rejects new acquisition even when a caller supplies an idempotency key.
1743
- (planSku === "growth-canary-v1" && options.idempotencyKey ? planSku : void 0);
1744
- if (!targetPlanSku) {
1738
+ );
1739
+ if (planSku !== void 0 && !targetPlanSku) {
1745
1740
  reportBillingFailure(
1746
1741
  {
1747
1742
  exitCode: 2,
@@ -1752,18 +1747,26 @@ async function handleTargetPlan(planSku, options) {
1752
1747
  );
1753
1748
  return;
1754
1749
  }
1755
- const idempotencyKey = targetBillingIdempotencyKey(options.idempotencyKey);
1756
- const payload = await new DeeplineClient().billing.transitionPlan({
1757
- action: "start_or_change",
1758
- targetPlanSku,
1759
- ...options.billingEmail ? { billingEmail: options.billingEmail } : {},
1760
- ...options.promoCode ? { promoCode: options.promoCode } : {},
1761
- ...options.annual ? { billingInterval: "year" } : {},
1762
- ...options.invoice ? { paymentMethod: "invoice" } : {},
1763
- idempotencyKey
1764
- });
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);
1765
1757
  printCommandEnvelope(
1766
- { 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
+ },
1767
1770
  { json: options.json }
1768
1771
  );
1769
1772
  }
@@ -2208,22 +2211,25 @@ Examples:
2208
2211
  (cardId, options) => handleCardChange("remove", cardId, options)
2209
2212
  )
2210
2213
  );
2211
- billing.command("change-plan").description("Start or change the target billing plan.").argument(
2212
- "<plan_sku>",
2213
- `${PUBLIC_PLAN_SKUS.join(", ")}. Run deepline billing plans to see workspace availability.`
2214
- ).option(
2215
- "--billing-email <email>",
2216
- "Invoice recipient: required with --invoice, otherwise used when the account has no billing email"
2217
- ).option(
2218
- "--promo-code <code>",
2219
- "Plan promo code; an unknown, expired, or used code refuses the change"
2220
- ).option(
2221
- "--annual",
2222
- "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"
2223
- ).option(
2224
- "--invoice",
2225
- "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`"
2226
- ).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);
2227
2233
  const details = billing.command("details").description(
2228
2234
  "Show the company name, billing address and tax ID printed on invoices."
2229
2235
  ).option("--json", "Emit JSON output").action(handleBillingDetailsShow);
@@ -2242,15 +2248,12 @@ Notes:
2242
2248
  Read-only. Shows the current target billing plan, pending plan, and every
2243
2249
  visible plan's recurring price, included credits, purchased-credit price,
2244
2250
  and current acquisition availability. All amounts are Deepline credits and
2245
- Deepline-facing USD, never raw provider spend. Change to an available plan
2246
- with: deepline billing change-plan <plan_sku>. A first-month price or bonus
2247
- credits appear on a plan when the org is offered them. An annual
2248
- price appears when the org may pay for a year up front; buy it with
2249
- change-plan <plan_sku> --annual. Where offered, any plan can be invoiced
2250
- instead of charged: add --invoice --billing-email <email> (billing details set adds the company
2251
- name, address and tax ID). With
2252
- --promo-code, prices are quoted with that code and its outcome is shown;
2253
- 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.
2254
2257
 
2255
2258
  Examples:
2256
2259
  deepline billing plans