@koda-sl/baker-cli 0.851.0-dev.067cf62dd → 0.851.0-dev.42852f724

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 (884) hide show
  1. package/README.md +2 -0
  2. package/dist/account-5FGZVAFP.js +83 -0
  3. package/dist/account-5FGZVAFP.js.map +1 -0
  4. package/dist/account-reads-WSCCHXVJ.js +230 -0
  5. package/dist/account-users-T37HWKHS.js +69 -0
  6. package/dist/account-users-T37HWKHS.js.map +1 -0
  7. package/dist/accounts-CR76UGBN.js +505 -0
  8. package/dist/accounts-CR76UGBN.js.map +1 -0
  9. package/dist/accounts-IJSVR6DJ.js +122 -0
  10. package/dist/accounts-T5ZBECCN.js +81 -0
  11. package/dist/accounts-T5ZBECCN.js.map +1 -0
  12. package/dist/actions-CHEA2XHB.js +55 -0
  13. package/dist/activecampaign-FJFAI3GM.js +935 -0
  14. package/dist/activecampaign-FJFAI3GM.js.map +1 -0
  15. package/dist/add-INCBSHIH.js +108 -0
  16. package/dist/add-INCBSHIH.js.map +1 -0
  17. package/dist/add-JFWEPNBS.js +661 -0
  18. package/dist/add-JFWEPNBS.js.map +1 -0
  19. package/dist/add-QK52FG4O.js +662 -0
  20. package/dist/add-QK52FG4O.js.map +1 -0
  21. package/dist/ads-FFOZYOTX.js +48 -0
  22. package/dist/advertisers-BHA43WUQ.js +126 -0
  23. package/dist/advertisers-BHA43WUQ.js.map +1 -0
  24. package/dist/alerts-4N7V3EZD.js +153 -0
  25. package/dist/alerts-4N7V3EZD.js.map +1 -0
  26. package/dist/analytics-ITUBZ3IF.js +2791 -0
  27. package/dist/analytics-ITUBZ3IF.js.map +1 -0
  28. package/dist/analytics-NLGGUMEN.js +461 -0
  29. package/dist/analytics-NLGGUMEN.js.map +1 -0
  30. package/dist/assign-KXYAHG7M.js +83 -0
  31. package/dist/assign-KXYAHG7M.js.map +1 -0
  32. package/dist/audience-size-PWKKMI5J.js +77 -0
  33. package/dist/audience-size-PWKKMI5J.js.map +1 -0
  34. package/dist/audit-CRSIM74B.js +155 -0
  35. package/dist/audit-CRSIM74B.js.map +1 -0
  36. package/dist/autocomplete-6SY6MSG2.js +117 -0
  37. package/dist/autocomplete-6SY6MSG2.js.map +1 -0
  38. package/dist/avatars-T4KI7MGJ.js +38 -0
  39. package/dist/bid-pricing-DYTWBTPR.js +104 -0
  40. package/dist/bid-pricing-DYTWBTPR.js.map +1 -0
  41. package/dist/brief-GP5NF2PP.js +511 -0
  42. package/dist/brief-GP5NF2PP.js.map +1 -0
  43. package/dist/campaign-groups-3QEG7ERR.js +118 -0
  44. package/dist/campaign-groups-3QEG7ERR.js.map +1 -0
  45. package/dist/campaign-writes-GA6N3TED.js +169 -0
  46. package/dist/campaign-writes-GA6N3TED.js.map +1 -0
  47. package/dist/campaigns-64LDKR53.js +193 -0
  48. package/dist/campaigns-64LDKR53.js.map +1 -0
  49. package/dist/campaigns-SFWGE46K.js +111 -0
  50. package/dist/canvas-FU77RUVS.js +48 -0
  51. package/dist/capabilities-I4JPXWUC.js +184 -0
  52. package/dist/capabilities-I4JPXWUC.js.map +1 -0
  53. package/dist/catalog-EB7VJ4IC.js +89 -0
  54. package/dist/catalog-EB7VJ4IC.js.map +1 -0
  55. package/dist/changes-NZ3VD4DX.js +288 -0
  56. package/dist/chats-JSDHNGPH.js +659 -0
  57. package/dist/chats-JSDHNGPH.js.map +1 -0
  58. package/dist/check-UI7GO6WL.js +54 -0
  59. package/dist/chunk-2AEGQHER.js +746 -0
  60. package/dist/chunk-2CZG4RWO.js +411 -0
  61. package/dist/chunk-3KHNCHQG.js +423 -0
  62. package/dist/chunk-4KLOD6BZ.js +660 -0
  63. package/dist/chunk-57NMT4HK.js +329 -0
  64. package/dist/chunk-6W4IWZS6.js +51 -0
  65. package/dist/chunk-7FH3IREG.js +375 -0
  66. package/dist/chunk-ABUK7QTA.js +1124 -0
  67. package/dist/chunk-AMK4DLOY.js +863 -0
  68. package/dist/chunk-BTILLYVG.js +251 -0
  69. package/dist/chunk-BTUY3BKY.js +163 -0
  70. package/dist/chunk-CVAQZO4I.js +4416 -0
  71. package/dist/chunk-CVAQZO4I.js.map +1 -0
  72. package/dist/chunk-CYT3HWSV.js +147 -0
  73. package/dist/chunk-D4U4UTAW.js +877 -0
  74. package/dist/chunk-DKKBLSSV.js +396 -0
  75. package/dist/chunk-EYR2FNGL.js +78 -0
  76. package/dist/chunk-F4XOJA6P.js +313 -0
  77. package/dist/chunk-FSCP6ABR.js +303 -0
  78. package/dist/chunk-GXW6WVY5.js +320 -0
  79. package/dist/chunk-GZV7523D.js +749 -0
  80. package/dist/chunk-HRVWFNHN.js +392 -0
  81. package/dist/chunk-I3KZTXTZ.js +479 -0
  82. package/dist/chunk-J3VU2WTT.js +374 -0
  83. package/dist/chunk-JMIWK222.js +6340 -0
  84. package/dist/chunk-KLGXKDF3.js +197 -0
  85. package/dist/chunk-KLY3M46A.js +170 -0
  86. package/dist/chunk-L653Z5Y6.js +91 -0
  87. package/dist/chunk-LNF7UX4Z.js +202 -0
  88. package/dist/chunk-MFQS4F3S.js +103 -0
  89. package/dist/chunk-O3KKPPQZ.js +260 -0
  90. package/dist/chunk-POPVDF5D.js +10361 -0
  91. package/dist/chunk-PSUMRBER.js +341 -0
  92. package/dist/chunk-QADB45DW.js +509 -0
  93. package/dist/chunk-QGDORYTY.js +61 -0
  94. package/dist/chunk-QOU5FOOS.js +64 -0
  95. package/dist/chunk-RJCPZBLI.js +547 -0
  96. package/dist/chunk-SYUPKPEB.js +262 -0
  97. package/dist/chunk-TMCRKUCE.js +224 -0
  98. package/dist/chunk-TY5WIUV3.js +65 -0
  99. package/dist/chunk-URLGCG7H.js +175 -0
  100. package/dist/chunk-VJYMJQC6.js +548 -0
  101. package/dist/chunk-W44IK3XR.js +155 -0
  102. package/dist/chunk-WW54TX3Z.js +9127 -0
  103. package/dist/chunk-XHBCLWET.js +685 -0
  104. package/dist/chunk-XQQGDAN3.js +91 -0
  105. package/dist/chunk-YTC2BEFB.js +8382 -0
  106. package/dist/chunk-YTC2BEFB.js.map +1 -0
  107. package/dist/chunk-Z2ZHZ63Y.js +1883 -0
  108. package/dist/chunk-Z5HFLB26.js +23 -0
  109. package/dist/chunk-ZMIYMQXQ.js +3378 -0
  110. package/dist/claim-YUIS6PBB.js +218 -0
  111. package/dist/claim-YUIS6PBB.js.map +1 -0
  112. package/dist/cli.js +34 -34
  113. package/dist/companies-4HVE4Q6R.js +36 -0
  114. package/dist/company-SC7VQTKF.js +311 -0
  115. package/dist/company-SC7VQTKF.js.map +1 -0
  116. package/dist/complete-PKGVYD57.js +87 -0
  117. package/dist/complete-PKGVYD57.js.map +1 -0
  118. package/dist/connect-DQ4UEXTA.js +46 -0
  119. package/dist/conversation-5D2C3RZT.js +100 -0
  120. package/dist/conversation-5D2C3RZT.js.map +1 -0
  121. package/dist/conversion-upload-command-2MWV3HNQ.js +456 -0
  122. package/dist/conversions-RNEQZTQY.js +141 -0
  123. package/dist/conversions-RNEQZTQY.js.map +1 -0
  124. package/dist/create-4HVYFI65.js +356 -0
  125. package/dist/create-4HVYFI65.js.map +1 -0
  126. package/dist/create-7PAAFHDE.js +65 -0
  127. package/dist/create-7PAAFHDE.js.map +1 -0
  128. package/dist/create-PLTZYBLT.js +219 -0
  129. package/dist/create-PLTZYBLT.js.map +1 -0
  130. package/dist/create-XYN6WYWR.js +190 -0
  131. package/dist/create-XYN6WYWR.js.map +1 -0
  132. package/dist/creatives-JFBLKD57.js +48 -0
  133. package/dist/creatives-ZBYNABZK.js +235 -0
  134. package/dist/creatives-ZBYNABZK.js.map +1 -0
  135. package/dist/credentials-LF6MUNZD.js +291 -0
  136. package/dist/credentials-LF6MUNZD.js.map +1 -0
  137. package/dist/critique-Y6QYMEBX.js +230 -0
  138. package/dist/critique-Y6QYMEBX.js.map +1 -0
  139. package/dist/crm-BF6SVGJ2.js +418 -0
  140. package/dist/crm-BF6SVGJ2.js.map +1 -0
  141. package/dist/crm-MCEJYQK7.js +327 -0
  142. package/dist/crm-MCEJYQK7.js.map +1 -0
  143. package/dist/currency-ONT4GYB3.js +91 -0
  144. package/dist/customers-LV5ZBX6E.js +69 -0
  145. package/dist/delete-77APWTTX.js +71 -0
  146. package/dist/delete-77APWTTX.js.map +1 -0
  147. package/dist/delete-DWP7MQIN.js +70 -0
  148. package/dist/delete-DWP7MQIN.js.map +1 -0
  149. package/dist/delete-KHXLNEWH.js +60 -0
  150. package/dist/delete-KHXLNEWH.js.map +1 -0
  151. package/dist/demographics-GVXXLIXR.js +145 -0
  152. package/dist/demographics-GVXXLIXR.js.map +1 -0
  153. package/dist/discard-KC7R37D2.js +72 -0
  154. package/dist/discard-KC7R37D2.js.map +1 -0
  155. package/dist/discover-T3V6CZN6.js +191 -0
  156. package/dist/domain-W67FD5EC.js +104 -0
  157. package/dist/domain-W67FD5EC.js.map +1 -0
  158. package/dist/download-FDHGZICL.js +174 -0
  159. package/dist/download-FDHGZICL.js.map +1 -0
  160. package/dist/draft-7GALT4VY.js +640 -0
  161. package/dist/draft-H26RWBDK.js +427 -0
  162. package/dist/draft-H26RWBDK.js.map +1 -0
  163. package/dist/draft-HPR7G6IQ.js +389 -0
  164. package/dist/draft-HPR7G6IQ.js.map +1 -0
  165. package/dist/draft-HXNNHFLI.js +227 -0
  166. package/dist/draft-HXNNHFLI.js.map +1 -0
  167. package/dist/engine/index.js +4 -5
  168. package/dist/experiment-WEWASTVO.js +2094 -0
  169. package/dist/experiment-WEWASTVO.js.map +1 -0
  170. package/dist/experiments-UYQKAOSW.js +241 -0
  171. package/dist/experiments-UYQKAOSW.js.map +1 -0
  172. package/dist/extract-RZO4HCXY.js +144 -0
  173. package/dist/extract-RZO4HCXY.js.map +1 -0
  174. package/dist/facets-KCGHNOYE.js +118 -0
  175. package/dist/facets-KCGHNOYE.js.map +1 -0
  176. package/dist/feedback-J66EWKO7.js +115 -0
  177. package/dist/feedback-J66EWKO7.js.map +1 -0
  178. package/dist/fetch-BKRBBODV.js +487 -0
  179. package/dist/fetch-BKRBBODV.js.map +1 -0
  180. package/dist/fit-BHEY5AJ2.js +69 -0
  181. package/dist/flows-RMZU5FGK.js +342 -0
  182. package/dist/flows-RMZU5FGK.js.map +1 -0
  183. package/dist/forecast-KSGBXVVI.js +189 -0
  184. package/dist/forecast-TBAPSMR4.js +122 -0
  185. package/dist/forecast-TBAPSMR4.js.map +1 -0
  186. package/dist/funnel-NA6LS7K6.js +701 -0
  187. package/dist/funnel-NA6LS7K6.js.map +1 -0
  188. package/dist/get-FUJHSPKK.js +114 -0
  189. package/dist/get-FUJHSPKK.js.map +1 -0
  190. package/dist/get-J6XEE522.js +77 -0
  191. package/dist/get-J6XEE522.js.map +1 -0
  192. package/dist/google-HXU73QN2.js +3765 -0
  193. package/dist/google-HXU73QN2.js.map +1 -0
  194. package/dist/google-WHSMCPMN.js +164 -0
  195. package/dist/google-WHSMCPMN.js.map +1 -0
  196. package/dist/google-ads-RYGJH24J.js +201 -0
  197. package/dist/google-ads-RYGJH24J.js.map +1 -0
  198. package/dist/history-SEF3IKVX.js +108 -0
  199. package/dist/history-SEF3IKVX.js.map +1 -0
  200. package/dist/history-VVBDPQLF.js +155 -0
  201. package/dist/history-VVBDPQLF.js.map +1 -0
  202. package/dist/hubspot-MERWCPQP.js +853 -0
  203. package/dist/hubspot-MERWCPQP.js.map +1 -0
  204. package/dist/ideas-E2AT6UC2.js +49 -0
  205. package/dist/images-CYYSGAIY.js +92 -0
  206. package/dist/ingest-AFID4ITN.js +31 -0
  207. package/dist/ingest-H247ZCXC.js +162 -0
  208. package/dist/ingest-H247ZCXC.js.map +1 -0
  209. package/dist/inspect-TQF3CHYA.js +38 -0
  210. package/dist/intent-YQSJW3ML.js +97 -0
  211. package/dist/keyword-gap-4UK4GCVM.js +132 -0
  212. package/dist/keyword-metrics-I5DHMFDR.js +234 -0
  213. package/dist/keyword-metrics-I5DHMFDR.js.map +1 -0
  214. package/dist/keywords-for-site-6PZYJXQX.js +134 -0
  215. package/dist/keywords-for-site-6PZYJXQX.js.map +1 -0
  216. package/dist/languages-NVU327GJ.js +41 -0
  217. package/dist/leads-GQXRZ2DO.js +137 -0
  218. package/dist/leads-GQXRZ2DO.js.map +1 -0
  219. package/dist/learn-3FZPKAI7.js +213 -0
  220. package/dist/learn-3FZPKAI7.js.map +1 -0
  221. package/dist/line-item-writes-ILVBM4JL.js +212 -0
  222. package/dist/line-item-writes-ILVBM4JL.js.map +1 -0
  223. package/dist/line-items-KR2LVAHD.js +107 -0
  224. package/dist/link-HQE7MQDP.js +70 -0
  225. package/dist/link-HQE7MQDP.js.map +1 -0
  226. package/dist/linkedin-HSD72YMR.js +1498 -0
  227. package/dist/linkedin-HSD72YMR.js.map +1 -0
  228. package/dist/linkedin-person-WGMAI6X7.js +142 -0
  229. package/dist/linkedin-person-WGMAI6X7.js.map +1 -0
  230. package/dist/list-FF3WU47Y.js +320 -0
  231. package/dist/list-FF3WU47Y.js.map +1 -0
  232. package/dist/list-Q3XWZ77Q.js +169 -0
  233. package/dist/list-Q3XWZ77Q.js.map +1 -0
  234. package/dist/list-UN2AH6ZV.js +89 -0
  235. package/dist/list-UN2AH6ZV.js.map +1 -0
  236. package/dist/locations-CUE3CPNC.js +41 -0
  237. package/dist/log-BLP6CEHV.js +98 -0
  238. package/dist/log-BLP6CEHV.js.map +1 -0
  239. package/dist/make-DHRZIIKM.js +1391 -0
  240. package/dist/make-DHRZIIKM.js.map +1 -0
  241. package/dist/map-VSVF7MAZ.js +519 -0
  242. package/dist/map-VSVF7MAZ.js.map +1 -0
  243. package/dist/mcp-PDNUGCTV.js +1017 -0
  244. package/dist/mcp-PDNUGCTV.js.map +1 -0
  245. package/dist/media-sources-A6OA52B6.js +35 -0
  246. package/dist/members-7DEKCEUZ.js +50 -0
  247. package/dist/members-7DEKCEUZ.js.map +1 -0
  248. package/dist/metrics-TPYUYVQG.js +193 -0
  249. package/dist/normalize-SDCAIKAE.js +145 -0
  250. package/dist/normalize-SDCAIKAE.js.map +1 -0
  251. package/dist/options-V4ANY2CZ.js +126 -0
  252. package/dist/options-V4ANY2CZ.js.map +1 -0
  253. package/dist/organization-7RFAIQNW.js +949 -0
  254. package/dist/organization-7RFAIQNW.js.map +1 -0
  255. package/dist/people-G2H3VX2G.js +161 -0
  256. package/dist/people-G2H3VX2G.js.map +1 -0
  257. package/dist/people-ZO5XXMWV.js +171 -0
  258. package/dist/people-ZO5XXMWV.js.map +1 -0
  259. package/dist/performance-K76OKFC6.js +6294 -0
  260. package/dist/performance-K76OKFC6.js.map +1 -0
  261. package/dist/performance-Q45ZTIGE.js +28 -0
  262. package/dist/pipedrive-325R5VO3.js +533 -0
  263. package/dist/pipedrive-325R5VO3.js.map +1 -0
  264. package/dist/preview-EK5RFXB7.js +103 -0
  265. package/dist/preview-EK5RFXB7.js.map +1 -0
  266. package/dist/promoted-tweet-writes-E3KBKT7C.js +184 -0
  267. package/dist/promoted-tweet-writes-E3KBKT7C.js.map +1 -0
  268. package/dist/promoted-tweets-C7RJ66FU.js +119 -0
  269. package/dist/publish-U3HD5VDC.js +430 -0
  270. package/dist/publish-U3HD5VDC.js.map +1 -0
  271. package/dist/query-D5CI5W3N.js +68 -0
  272. package/dist/reddit-NRGE6NTA.js +30 -0
  273. package/dist/refresh-XAHEOATL.js +100 -0
  274. package/dist/refresh-XAHEOATL.js.map +1 -0
  275. package/dist/release-ZQD7NZJM.js +66 -0
  276. package/dist/release-ZQD7NZJM.js.map +1 -0
  277. package/dist/relevant-pages-UMT5ZDRY.js +101 -0
  278. package/dist/remove-UB2UAGZQ.js +54 -0
  279. package/dist/remove-UB2UAGZQ.js.map +1 -0
  280. package/dist/reopen-XPXKOMU3.js +69 -0
  281. package/dist/reopen-XPXKOMU3.js.map +1 -0
  282. package/dist/rerun-7M7R7LMH.js +101 -0
  283. package/dist/rerun-7M7R7LMH.js.map +1 -0
  284. package/dist/research-JMDZT4FR.js +266 -0
  285. package/dist/research-JMDZT4FR.js.map +1 -0
  286. package/dist/research-ZLLP2VOB.js +78 -0
  287. package/dist/reset-VYQR723A.js +58 -0
  288. package/dist/reset-VYQR723A.js.map +1 -0
  289. package/dist/reset-YHS3Q26B.js +58 -0
  290. package/dist/reset-YHS3Q26B.js.map +1 -0
  291. package/dist/resolve-TDYGEVSL.js +125 -0
  292. package/dist/resolve-TDYGEVSL.js.map +1 -0
  293. package/dist/retry-6YFCCKNR.js +66 -0
  294. package/dist/retry-6YFCCKNR.js.map +1 -0
  295. package/dist/retry-JOUNNTTZ.js +66 -0
  296. package/dist/retry-JOUNNTTZ.js.map +1 -0
  297. package/dist/revenue-AOWMOB75.js +99 -0
  298. package/dist/revenue-AOWMOB75.js.map +1 -0
  299. package/dist/rules-ZHZTVRVB.js +163 -0
  300. package/dist/rules-ZHZTVRVB.js.map +1 -0
  301. package/dist/run-6SIYL54P.js +73 -0
  302. package/dist/run-6SIYL54P.js.map +1 -0
  303. package/dist/run-ELP43NMT.js +78 -0
  304. package/dist/scaffold-ad-IAZW44YM.js +1600 -0
  305. package/dist/scaffold-ad-IAZW44YM.js.map +1 -0
  306. package/dist/scaffold-static-ad-BHRKNJ4E.js +998 -0
  307. package/dist/scaffold-static-ad-BHRKNJ4E.js.map +1 -0
  308. package/dist/scaffold-video-QPMBM2B4.js +888 -0
  309. package/dist/scaffold-video-QPMBM2B4.js.map +1 -0
  310. package/dist/schedule-WFET5V7N.js +65 -0
  311. package/dist/schedule-WFET5V7N.js.map +1 -0
  312. package/dist/scheduled-agents-3CGSEALY.js +59 -0
  313. package/dist/schema-4PS5KOSS.js +241 -0
  314. package/dist/schema-OXLMLONK.js +136 -0
  315. package/dist/schema-OXLMLONK.js.map +1 -0
  316. package/dist/search-RNLFRVRH.js +192 -0
  317. package/dist/search-RNLFRVRH.js.map +1 -0
  318. package/dist/search-terms-KNCX3COA.js +412 -0
  319. package/dist/select-5FNYGD2W.js +134 -0
  320. package/dist/select-5FNYGD2W.js.map +1 -0
  321. package/dist/set-47VB26OF.js +274 -0
  322. package/dist/set-47VB26OF.js.map +1 -0
  323. package/dist/set-prompt-KHBDNZAX.js +204 -0
  324. package/dist/set-prompt-KHBDNZAX.js.map +1 -0
  325. package/dist/setup-links-JQ36OVF6.js +145 -0
  326. package/dist/setup-links-JQ36OVF6.js.map +1 -0
  327. package/dist/shopify-XDDPWDCE.js +4032 -0
  328. package/dist/shopify-XDDPWDCE.js.map +1 -0
  329. package/dist/site-LCS7KLHS.js +181 -0
  330. package/dist/site-LCS7KLHS.js.map +1 -0
  331. package/dist/sources-2CAHK6AB.js +30 -0
  332. package/dist/sources-BDA5VAW5.js +463 -0
  333. package/dist/sources-BDA5VAW5.js.map +1 -0
  334. package/dist/stale-S5Z4MSHI.js +92 -0
  335. package/dist/stale-S5Z4MSHI.js.map +1 -0
  336. package/dist/status-HKJW5BSO.js +68 -0
  337. package/dist/status-HKJW5BSO.js.map +1 -0
  338. package/dist/stock-F6ERRSYN.js +213 -0
  339. package/dist/stock-F6ERRSYN.js.map +1 -0
  340. package/dist/sync-MRYYP5VA.js +58 -0
  341. package/dist/sync-MRYYP5VA.js.map +1 -0
  342. package/dist/sync-definition-YTZY6NSH.js +74 -0
  343. package/dist/tags-KT4NJSKY.js +26 -0
  344. package/dist/tags-S7YVPV3Y.js +24 -0
  345. package/dist/tags-S7YVPV3Y.js.map +1 -0
  346. package/dist/tags-UOIR4IWC.js +24 -0
  347. package/dist/tags-UOIR4IWC.js.map +1 -0
  348. package/dist/tags-V5Y4ZFTK.js +182 -0
  349. package/dist/tags-V5Y4ZFTK.js.map +1 -0
  350. package/dist/tags-ZOYKJ3WO.js +24 -0
  351. package/dist/tags-ZOYKJ3WO.js.map +1 -0
  352. package/dist/targeting-criteria-3URPDGYI.js +113 -0
  353. package/dist/targets-EAMAYLRJ.js +110 -0
  354. package/dist/targets-EAMAYLRJ.js.map +1 -0
  355. package/dist/testimonials-IFKSIRNF.js +32 -0
  356. package/dist/themes-VINUDRB5.js +102 -0
  357. package/dist/top-companies-F7ALYKO6.js +250 -0
  358. package/dist/top-companies-F7ALYKO6.js.map +1 -0
  359. package/dist/transcript-3BY66QHM.js +168 -0
  360. package/dist/transcript-3BY66QHM.js.map +1 -0
  361. package/dist/translate-B73VH7FN.js +607 -0
  362. package/dist/translate-B73VH7FN.js.map +1 -0
  363. package/dist/triggers-W5N5672K.js +148 -0
  364. package/dist/triggers-W5N5672K.js.map +1 -0
  365. package/dist/unlink-43WMLMKD.js +73 -0
  366. package/dist/unlink-43WMLMKD.js.map +1 -0
  367. package/dist/unstage-SDB4NVWE.js +92 -0
  368. package/dist/unstage-SDB4NVWE.js.map +1 -0
  369. package/dist/update-HAETN3U3.js +193 -0
  370. package/dist/update-HAETN3U3.js.map +1 -0
  371. package/dist/update-QWLZ55WX.js +69 -0
  372. package/dist/update-QWLZ55WX.js.map +1 -0
  373. package/dist/update-XI5WURT2.js +175 -0
  374. package/dist/update-XI5WURT2.js.map +1 -0
  375. package/dist/update-XOZETVTJ.js +237 -0
  376. package/dist/update-XOZETVTJ.js.map +1 -0
  377. package/dist/upload-KDO6YHMA.js +185 -0
  378. package/dist/upload-KDO6YHMA.js.map +1 -0
  379. package/dist/url-options-WB24UWPV.js +137 -0
  380. package/dist/url-params-7W3PJXCM.js +102 -0
  381. package/dist/url-params-7W3PJXCM.js.map +1 -0
  382. package/dist/validate-PP4B2KGG.js +180 -0
  383. package/dist/validate-PP4B2KGG.js.map +1 -0
  384. package/dist/videos-LDJBOSGX.js +41 -0
  385. package/dist/viewer-check-DHTJISCO.js +89 -0
  386. package/dist/visuals-MG2ZD75F.js +129 -0
  387. package/dist/visuals-MG2ZD75F.js.map +1 -0
  388. package/dist/web-VLEAPHN5.js +180 -0
  389. package/dist/web-VLEAPHN5.js.map +1 -0
  390. package/dist/winning-ads-2YTDMOWE.js +88 -0
  391. package/dist/write-commands-OOUJOTUO.js +1555 -0
  392. package/dist/write-commands-OOUJOTUO.js.map +1 -0
  393. package/dist/x-TJOFGBFR.js +47 -0
  394. package/package.json +1 -1
  395. package/dist/account-KRF7EIGP.js +0 -84
  396. package/dist/account-KRF7EIGP.js.map +0 -1
  397. package/dist/account-reads-XOGHJB3K.js +0 -230
  398. package/dist/account-users-4I2AAEAO.js +0 -70
  399. package/dist/account-users-4I2AAEAO.js.map +0 -1
  400. package/dist/accounts-7CHGRXBP.js +0 -122
  401. package/dist/accounts-A37M7HW3.js +0 -506
  402. package/dist/accounts-A37M7HW3.js.map +0 -1
  403. package/dist/accounts-DXLJFGM6.js +0 -82
  404. package/dist/accounts-DXLJFGM6.js.map +0 -1
  405. package/dist/actions-KWHMTMLD.js +0 -55
  406. package/dist/activecampaign-AJURU2SD.js +0 -936
  407. package/dist/activecampaign-AJURU2SD.js.map +0 -1
  408. package/dist/add-2CN64JRZ.js +0 -109
  409. package/dist/add-2CN64JRZ.js.map +0 -1
  410. package/dist/add-INCMGBM2.js +0 -662
  411. package/dist/add-INCMGBM2.js.map +0 -1
  412. package/dist/add-M6LS32QO.js +0 -663
  413. package/dist/add-M6LS32QO.js.map +0 -1
  414. package/dist/ads-7Q7PRFJ4.js +0 -48
  415. package/dist/advertisers-A3YGDOLM.js +0 -127
  416. package/dist/advertisers-A3YGDOLM.js.map +0 -1
  417. package/dist/alerts-DEP2DXBN.js +0 -154
  418. package/dist/alerts-DEP2DXBN.js.map +0 -1
  419. package/dist/analytics-7UCEXUVF.js +0 -2792
  420. package/dist/analytics-7UCEXUVF.js.map +0 -1
  421. package/dist/analytics-XHWSVXYX.js +0 -462
  422. package/dist/analytics-XHWSVXYX.js.map +0 -1
  423. package/dist/assign-JUXS2HIS.js +0 -84
  424. package/dist/assign-JUXS2HIS.js.map +0 -1
  425. package/dist/audience-size-ZWHF4BMF.js +0 -78
  426. package/dist/audience-size-ZWHF4BMF.js.map +0 -1
  427. package/dist/audit-G5SNO6AP.js +0 -156
  428. package/dist/audit-G5SNO6AP.js.map +0 -1
  429. package/dist/autocomplete-RQPSDMYX.js +0 -118
  430. package/dist/autocomplete-RQPSDMYX.js.map +0 -1
  431. package/dist/avatars-PILXCCPG.js +0 -38
  432. package/dist/bid-pricing-7ZNHIIJI.js +0 -105
  433. package/dist/bid-pricing-7ZNHIIJI.js.map +0 -1
  434. package/dist/brief-RBOKX3HZ.js +0 -512
  435. package/dist/brief-RBOKX3HZ.js.map +0 -1
  436. package/dist/campaign-groups-VFVDSZVA.js +0 -119
  437. package/dist/campaign-groups-VFVDSZVA.js.map +0 -1
  438. package/dist/campaign-writes-NYSYVJC6.js +0 -170
  439. package/dist/campaign-writes-NYSYVJC6.js.map +0 -1
  440. package/dist/campaigns-I55PNY55.js +0 -194
  441. package/dist/campaigns-I55PNY55.js.map +0 -1
  442. package/dist/campaigns-XS52PZQL.js +0 -111
  443. package/dist/canvas-3AHETASK.js +0 -48
  444. package/dist/capabilities-KIPCD5SQ.js +0 -185
  445. package/dist/capabilities-KIPCD5SQ.js.map +0 -1
  446. package/dist/catalog-3OIBTMBV.js +0 -90
  447. package/dist/catalog-3OIBTMBV.js.map +0 -1
  448. package/dist/changes-YOTRCCNB.js +0 -288
  449. package/dist/chats-JWH4BIWL.js +0 -660
  450. package/dist/chats-JWH4BIWL.js.map +0 -1
  451. package/dist/check-3SVCK3V3.js +0 -55
  452. package/dist/chunk-2CV2LEJN.js +0 -685
  453. package/dist/chunk-2PNBK7KZ.js +0 -1124
  454. package/dist/chunk-3B7GRVIM.js +0 -392
  455. package/dist/chunk-3MJTL763.js +0 -103
  456. package/dist/chunk-433NCHRS.js +0 -4413
  457. package/dist/chunk-433NCHRS.js.map +0 -1
  458. package/dist/chunk-4GM3TBGL.js +0 -320
  459. package/dist/chunk-5UG7AJB5.js +0 -65
  460. package/dist/chunk-AOXHDVWS.js +0 -260
  461. package/dist/chunk-AYW4VFTH.js +0 -547
  462. package/dist/chunk-BMUAE5IR.js +0 -411
  463. package/dist/chunk-BPQY4KIM.js +0 -251
  464. package/dist/chunk-BYYIJMLP.js +0 -197
  465. package/dist/chunk-CDU64GKK.js +0 -61
  466. package/dist/chunk-CE6M4VLG.js +0 -1883
  467. package/dist/chunk-DA634ZIV.js +0 -175
  468. package/dist/chunk-DJLTDVRD.js +0 -479
  469. package/dist/chunk-G4IFJB4Z.js +0 -863
  470. package/dist/chunk-GHEURTBN.js +0 -224
  471. package/dist/chunk-GJPS6SUI.js +0 -147
  472. package/dist/chunk-H2IG6MOX.js +0 -78
  473. package/dist/chunk-HSPOURUB.js +0 -877
  474. package/dist/chunk-HVVE3GT6.js +0 -91
  475. package/dist/chunk-IAOXI7MJ.js +0 -9127
  476. package/dist/chunk-M6RQJCDW.js +0 -746
  477. package/dist/chunk-N5IR2T2B.js +0 -509
  478. package/dist/chunk-NZ3PQBRV.js +0 -51
  479. package/dist/chunk-NZFVC7RP.js +0 -548
  480. package/dist/chunk-PNGXJPM5.js +0 -604
  481. package/dist/chunk-PNGXJPM5.js.map +0 -1
  482. package/dist/chunk-QLSNKH5D.js +0 -91
  483. package/dist/chunk-RN3IVT3B.js +0 -3378
  484. package/dist/chunk-RZOHIOPP.js +0 -262
  485. package/dist/chunk-SELCZP76.js +0 -6340
  486. package/dist/chunk-T55DY36I.js +0 -163
  487. package/dist/chunk-T5FACY43.js +0 -170
  488. package/dist/chunk-TR72BZ4D.js +0 -660
  489. package/dist/chunk-UTOVP53O.js +0 -313
  490. package/dist/chunk-V7T6HAPO.js +0 -375
  491. package/dist/chunk-VDHPAQUM.js +0 -23
  492. package/dist/chunk-VPWLH6VS.js +0 -202
  493. package/dist/chunk-VXLFFMW6.js +0 -155
  494. package/dist/chunk-VZQHMRYM.js +0 -303
  495. package/dist/chunk-X4NF7IMQ.js +0 -423
  496. package/dist/chunk-X6CSCKXX.js +0 -341
  497. package/dist/chunk-Y4XW2LW3.js +0 -10361
  498. package/dist/chunk-YAMDF3DT.js +0 -374
  499. package/dist/chunk-YCCTIFI7.js +0 -396
  500. package/dist/chunk-YWHOPJG5.js +0 -64
  501. package/dist/chunk-Z7WMTBGD.js +0 -329
  502. package/dist/chunk-ZIZBAKJF.js +0 -749
  503. package/dist/chunk-ZJY3ACX3.js +0 -7782
  504. package/dist/chunk-ZJY3ACX3.js.map +0 -1
  505. package/dist/claim-H5HZFRPG.js +0 -219
  506. package/dist/claim-H5HZFRPG.js.map +0 -1
  507. package/dist/companies-6FM3CALY.js +0 -37
  508. package/dist/company-U67GZ652.js +0 -312
  509. package/dist/company-U67GZ652.js.map +0 -1
  510. package/dist/complete-7PB5RC47.js +0 -88
  511. package/dist/complete-7PB5RC47.js.map +0 -1
  512. package/dist/connect-J6M3W7WW.js +0 -47
  513. package/dist/conversation-6FGVSJQV.js +0 -101
  514. package/dist/conversation-6FGVSJQV.js.map +0 -1
  515. package/dist/conversion-upload-command-6TY2DIBM.js +0 -456
  516. package/dist/conversions-T3WPLUNU.js +0 -142
  517. package/dist/conversions-T3WPLUNU.js.map +0 -1
  518. package/dist/create-3UEEKKBJ.js +0 -66
  519. package/dist/create-3UEEKKBJ.js.map +0 -1
  520. package/dist/create-BQFV23KE.js +0 -220
  521. package/dist/create-BQFV23KE.js.map +0 -1
  522. package/dist/create-PYNZG2I7.js +0 -191
  523. package/dist/create-PYNZG2I7.js.map +0 -1
  524. package/dist/create-WGQKASYJ.js +0 -357
  525. package/dist/create-WGQKASYJ.js.map +0 -1
  526. package/dist/creatives-PW2P7VMU.js +0 -48
  527. package/dist/creatives-X4ZDII4J.js +0 -236
  528. package/dist/creatives-X4ZDII4J.js.map +0 -1
  529. package/dist/credentials-IGLXTK56.js +0 -292
  530. package/dist/credentials-IGLXTK56.js.map +0 -1
  531. package/dist/critique-HF4ZNSFG.js +0 -231
  532. package/dist/critique-HF4ZNSFG.js.map +0 -1
  533. package/dist/crm-EOXLQJTJ.js +0 -419
  534. package/dist/crm-EOXLQJTJ.js.map +0 -1
  535. package/dist/crm-J7YGM36V.js +0 -328
  536. package/dist/crm-J7YGM36V.js.map +0 -1
  537. package/dist/currency-CLB7ROUV.js +0 -91
  538. package/dist/customers-OHB5EY7Z.js +0 -70
  539. package/dist/delete-I24TSU35.js +0 -61
  540. package/dist/delete-I24TSU35.js.map +0 -1
  541. package/dist/delete-O6GJAIDU.js +0 -72
  542. package/dist/delete-O6GJAIDU.js.map +0 -1
  543. package/dist/delete-UM6ENIDW.js +0 -71
  544. package/dist/delete-UM6ENIDW.js.map +0 -1
  545. package/dist/demographics-BGSWNDRQ.js +0 -146
  546. package/dist/demographics-BGSWNDRQ.js.map +0 -1
  547. package/dist/discard-3S5LU3GF.js +0 -73
  548. package/dist/discard-3S5LU3GF.js.map +0 -1
  549. package/dist/discover-EAI4WDSL.js +0 -191
  550. package/dist/domain-DJ4Y72PN.js +0 -105
  551. package/dist/domain-DJ4Y72PN.js.map +0 -1
  552. package/dist/download-FR7XSZWV.js +0 -175
  553. package/dist/download-FR7XSZWV.js.map +0 -1
  554. package/dist/draft-MUMANPJ7.js +0 -228
  555. package/dist/draft-MUMANPJ7.js.map +0 -1
  556. package/dist/draft-R3GI7JWY.js +0 -640
  557. package/dist/draft-Z6YHU3AR.js +0 -390
  558. package/dist/draft-Z6YHU3AR.js.map +0 -1
  559. package/dist/draft-ZJ4VSYKB.js +0 -428
  560. package/dist/draft-ZJ4VSYKB.js.map +0 -1
  561. package/dist/experiment-TLYYA7IF.js +0 -2123
  562. package/dist/experiment-TLYYA7IF.js.map +0 -1
  563. package/dist/experiments-SJ2ODFHA.js +0 -242
  564. package/dist/experiments-SJ2ODFHA.js.map +0 -1
  565. package/dist/extract-X7H37JJT.js +0 -145
  566. package/dist/extract-X7H37JJT.js.map +0 -1
  567. package/dist/facets-BXRB3I6Q.js +0 -119
  568. package/dist/facets-BXRB3I6Q.js.map +0 -1
  569. package/dist/feedback-YWJUV7LV.js +0 -116
  570. package/dist/feedback-YWJUV7LV.js.map +0 -1
  571. package/dist/fetch-SZORBUY6.js +0 -488
  572. package/dist/fetch-SZORBUY6.js.map +0 -1
  573. package/dist/fit-BNMTWIDZ.js +0 -70
  574. package/dist/flows-CXLGJZX3.js +0 -343
  575. package/dist/flows-CXLGJZX3.js.map +0 -1
  576. package/dist/forecast-4GMD2VLH.js +0 -123
  577. package/dist/forecast-4GMD2VLH.js.map +0 -1
  578. package/dist/forecast-YFCLMXAV.js +0 -189
  579. package/dist/funnel-6T744PW5.js +0 -702
  580. package/dist/funnel-6T744PW5.js.map +0 -1
  581. package/dist/get-AV7SAPWM.js +0 -115
  582. package/dist/get-AV7SAPWM.js.map +0 -1
  583. package/dist/get-XGNDE6U5.js +0 -78
  584. package/dist/get-XGNDE6U5.js.map +0 -1
  585. package/dist/google-5PTZYW6Q.js +0 -165
  586. package/dist/google-5PTZYW6Q.js.map +0 -1
  587. package/dist/google-GBGLPAP5.js +0 -3759
  588. package/dist/google-GBGLPAP5.js.map +0 -1
  589. package/dist/google-ads-LL4VNYPD.js +0 -202
  590. package/dist/google-ads-LL4VNYPD.js.map +0 -1
  591. package/dist/history-CFVA6FMG.js +0 -109
  592. package/dist/history-CFVA6FMG.js.map +0 -1
  593. package/dist/history-DSRIBYK6.js +0 -156
  594. package/dist/history-DSRIBYK6.js.map +0 -1
  595. package/dist/hubspot-QEDQFEME.js +0 -854
  596. package/dist/hubspot-QEDQFEME.js.map +0 -1
  597. package/dist/ideas-UK74GJGE.js +0 -50
  598. package/dist/images-OH7KDUR5.js +0 -92
  599. package/dist/ingest-2BC3W4WC.js +0 -32
  600. package/dist/ingest-U46BUNPL.js +0 -163
  601. package/dist/ingest-U46BUNPL.js.map +0 -1
  602. package/dist/inspect-ZMCRHR2P.js +0 -39
  603. package/dist/intent-6NJBN3OR.js +0 -97
  604. package/dist/keyword-gap-Y5J2VZDP.js +0 -132
  605. package/dist/keyword-metrics-RHQHOBBD.js +0 -235
  606. package/dist/keyword-metrics-RHQHOBBD.js.map +0 -1
  607. package/dist/keywords-for-site-SXM5GYNK.js +0 -135
  608. package/dist/keywords-for-site-SXM5GYNK.js.map +0 -1
  609. package/dist/languages-H4VPFO7Y.js +0 -41
  610. package/dist/leads-SXKIKE33.js +0 -138
  611. package/dist/leads-SXKIKE33.js.map +0 -1
  612. package/dist/learn-IUTTKGIM.js +0 -214
  613. package/dist/learn-IUTTKGIM.js.map +0 -1
  614. package/dist/line-item-writes-4UCLAFCM.js +0 -213
  615. package/dist/line-item-writes-4UCLAFCM.js.map +0 -1
  616. package/dist/line-items-RUC54PIV.js +0 -107
  617. package/dist/link-DVOBJDBN.js +0 -71
  618. package/dist/link-DVOBJDBN.js.map +0 -1
  619. package/dist/linkedin-2Y7TU4US.js +0 -1499
  620. package/dist/linkedin-2Y7TU4US.js.map +0 -1
  621. package/dist/linkedin-person-MTXQCPG5.js +0 -143
  622. package/dist/linkedin-person-MTXQCPG5.js.map +0 -1
  623. package/dist/list-KYEFILOK.js +0 -170
  624. package/dist/list-KYEFILOK.js.map +0 -1
  625. package/dist/list-V5XCBLJ7.js +0 -321
  626. package/dist/list-V5XCBLJ7.js.map +0 -1
  627. package/dist/list-VXWXN54Z.js +0 -90
  628. package/dist/list-VXWXN54Z.js.map +0 -1
  629. package/dist/locations-UPY33JUY.js +0 -41
  630. package/dist/log-STIZ76SH.js +0 -99
  631. package/dist/log-STIZ76SH.js.map +0 -1
  632. package/dist/make-HDEKIJC6.js +0 -1392
  633. package/dist/make-HDEKIJC6.js.map +0 -1
  634. package/dist/map-2SS3BULX.js +0 -520
  635. package/dist/map-2SS3BULX.js.map +0 -1
  636. package/dist/mcp-I5ASSVSH.js +0 -1018
  637. package/dist/mcp-I5ASSVSH.js.map +0 -1
  638. package/dist/media-sources-KUEQ45V5.js +0 -35
  639. package/dist/members-65P2J63J.js +0 -51
  640. package/dist/members-65P2J63J.js.map +0 -1
  641. package/dist/metrics-BNLDV4BU.js +0 -193
  642. package/dist/normalize-WNJDY66N.js +0 -146
  643. package/dist/normalize-WNJDY66N.js.map +0 -1
  644. package/dist/options-G4KR2KM7.js +0 -127
  645. package/dist/options-G4KR2KM7.js.map +0 -1
  646. package/dist/organization-FVZ6EIQB.js +0 -950
  647. package/dist/organization-FVZ6EIQB.js.map +0 -1
  648. package/dist/people-654OH5SE.js +0 -162
  649. package/dist/people-654OH5SE.js.map +0 -1
  650. package/dist/people-G3X6XVSH.js +0 -172
  651. package/dist/people-G3X6XVSH.js.map +0 -1
  652. package/dist/performance-BIH653SL.js +0 -29
  653. package/dist/performance-IU4CAW5U.js +0 -6295
  654. package/dist/performance-IU4CAW5U.js.map +0 -1
  655. package/dist/pipedrive-7AHNEUZI.js +0 -534
  656. package/dist/pipedrive-7AHNEUZI.js.map +0 -1
  657. package/dist/preview-ZOTNLVQF.js +0 -104
  658. package/dist/preview-ZOTNLVQF.js.map +0 -1
  659. package/dist/promoted-tweet-writes-7OXSBCSP.js +0 -185
  660. package/dist/promoted-tweet-writes-7OXSBCSP.js.map +0 -1
  661. package/dist/promoted-tweets-6YCNFVJK.js +0 -119
  662. package/dist/publish-W6YO4KXM.js +0 -431
  663. package/dist/publish-W6YO4KXM.js.map +0 -1
  664. package/dist/query-FZAFUWCX.js +0 -68
  665. package/dist/reddit-Z4REP3DB.js +0 -31
  666. package/dist/refresh-J4EVW5NK.js +0 -101
  667. package/dist/refresh-J4EVW5NK.js.map +0 -1
  668. package/dist/release-J7PM3S26.js +0 -67
  669. package/dist/release-J7PM3S26.js.map +0 -1
  670. package/dist/relevant-pages-OFFMPMKG.js +0 -101
  671. package/dist/remove-47SNXAN4.js +0 -55
  672. package/dist/remove-47SNXAN4.js.map +0 -1
  673. package/dist/reopen-QZ5H7BM4.js +0 -70
  674. package/dist/reopen-QZ5H7BM4.js.map +0 -1
  675. package/dist/rerun-NXCWZO6J.js +0 -102
  676. package/dist/rerun-NXCWZO6J.js.map +0 -1
  677. package/dist/research-FYPPBDZD.js +0 -267
  678. package/dist/research-FYPPBDZD.js.map +0 -1
  679. package/dist/research-M6YZMTCC.js +0 -78
  680. package/dist/reset-HOZN4FOM.js +0 -59
  681. package/dist/reset-HOZN4FOM.js.map +0 -1
  682. package/dist/reset-YSI4KD65.js +0 -59
  683. package/dist/reset-YSI4KD65.js.map +0 -1
  684. package/dist/resolve-4LGAMITK.js +0 -126
  685. package/dist/resolve-4LGAMITK.js.map +0 -1
  686. package/dist/retry-JE7MVPCY.js +0 -67
  687. package/dist/retry-JE7MVPCY.js.map +0 -1
  688. package/dist/retry-NF5WFRK3.js +0 -67
  689. package/dist/retry-NF5WFRK3.js.map +0 -1
  690. package/dist/revenue-UNKQMFEP.js +0 -100
  691. package/dist/revenue-UNKQMFEP.js.map +0 -1
  692. package/dist/rules-ZQVMBEGF.js +0 -164
  693. package/dist/rules-ZQVMBEGF.js.map +0 -1
  694. package/dist/run-3AFY2WEP.js +0 -74
  695. package/dist/run-3AFY2WEP.js.map +0 -1
  696. package/dist/run-MBVV64FY.js +0 -79
  697. package/dist/scaffold-ad-5BDDIBIE.js +0 -1601
  698. package/dist/scaffold-ad-5BDDIBIE.js.map +0 -1
  699. package/dist/scaffold-static-ad-VI4HHQXS.js +0 -999
  700. package/dist/scaffold-static-ad-VI4HHQXS.js.map +0 -1
  701. package/dist/scaffold-video-EPMMQHUN.js +0 -889
  702. package/dist/scaffold-video-EPMMQHUN.js.map +0 -1
  703. package/dist/schedule-MYNSAWBJ.js +0 -66
  704. package/dist/schedule-MYNSAWBJ.js.map +0 -1
  705. package/dist/scheduled-agents-T7CITLJL.js +0 -59
  706. package/dist/schema-4WMUT43Q.js +0 -137
  707. package/dist/schema-4WMUT43Q.js.map +0 -1
  708. package/dist/schema-6WONG4NR.js +0 -241
  709. package/dist/search-AF7G5TRI.js +0 -193
  710. package/dist/search-AF7G5TRI.js.map +0 -1
  711. package/dist/search-terms-OFLKWSEF.js +0 -412
  712. package/dist/select-LUFSBEFK.js +0 -135
  713. package/dist/select-LUFSBEFK.js.map +0 -1
  714. package/dist/set-Z754PYIP.js +0 -275
  715. package/dist/set-Z754PYIP.js.map +0 -1
  716. package/dist/set-prompt-WDCKB4GU.js +0 -205
  717. package/dist/set-prompt-WDCKB4GU.js.map +0 -1
  718. package/dist/setup-links-3FCP4CMO.js +0 -146
  719. package/dist/setup-links-3FCP4CMO.js.map +0 -1
  720. package/dist/shopify-OMTDOM6H.js +0 -4033
  721. package/dist/shopify-OMTDOM6H.js.map +0 -1
  722. package/dist/site-E6VDWABB.js +0 -182
  723. package/dist/site-E6VDWABB.js.map +0 -1
  724. package/dist/sources-3RQZ3AR2.js +0 -30
  725. package/dist/sources-IB2WBJLU.js +0 -464
  726. package/dist/sources-IB2WBJLU.js.map +0 -1
  727. package/dist/stale-V4NS3MDH.js +0 -93
  728. package/dist/stale-V4NS3MDH.js.map +0 -1
  729. package/dist/status-T67ZC4E3.js +0 -69
  730. package/dist/status-T67ZC4E3.js.map +0 -1
  731. package/dist/stock-V2ITAW3L.js +0 -214
  732. package/dist/stock-V2ITAW3L.js.map +0 -1
  733. package/dist/sync-O5OC466B.js +0 -59
  734. package/dist/sync-O5OC466B.js.map +0 -1
  735. package/dist/sync-definition-MR7XESTS.js +0 -75
  736. package/dist/tags-ACDAA5T6.js +0 -25
  737. package/dist/tags-ACDAA5T6.js.map +0 -1
  738. package/dist/tags-I3AJEMKF.js +0 -26
  739. package/dist/tags-IMTMMKH3.js +0 -25
  740. package/dist/tags-IMTMMKH3.js.map +0 -1
  741. package/dist/tags-Q32N3AGN.js +0 -25
  742. package/dist/tags-Q32N3AGN.js.map +0 -1
  743. package/dist/tags-YWZLXCDK.js +0 -183
  744. package/dist/tags-YWZLXCDK.js.map +0 -1
  745. package/dist/targeting-criteria-QFFAYBGE.js +0 -113
  746. package/dist/targets-VJ7FDIRY.js +0 -111
  747. package/dist/targets-VJ7FDIRY.js.map +0 -1
  748. package/dist/testimonials-67Q3OTBU.js +0 -32
  749. package/dist/themes-VAKXKG4M.js +0 -102
  750. package/dist/top-companies-6XTBQ26K.js +0 -251
  751. package/dist/top-companies-6XTBQ26K.js.map +0 -1
  752. package/dist/transcript-VJ3SAEUV.js +0 -169
  753. package/dist/transcript-VJ3SAEUV.js.map +0 -1
  754. package/dist/translate-ET2MK3H2.js +0 -608
  755. package/dist/translate-ET2MK3H2.js.map +0 -1
  756. package/dist/triggers-JP6VF7BW.js +0 -149
  757. package/dist/triggers-JP6VF7BW.js.map +0 -1
  758. package/dist/unlink-KMFC3LDG.js +0 -74
  759. package/dist/unlink-KMFC3LDG.js.map +0 -1
  760. package/dist/unstage-GPI2NIBV.js +0 -93
  761. package/dist/unstage-GPI2NIBV.js.map +0 -1
  762. package/dist/update-2FH5MZVD.js +0 -238
  763. package/dist/update-2FH5MZVD.js.map +0 -1
  764. package/dist/update-ACOQHC7J.js +0 -194
  765. package/dist/update-ACOQHC7J.js.map +0 -1
  766. package/dist/update-CUQLNEAD.js +0 -176
  767. package/dist/update-CUQLNEAD.js.map +0 -1
  768. package/dist/update-RZXG7Z62.js +0 -70
  769. package/dist/update-RZXG7Z62.js.map +0 -1
  770. package/dist/upload-HVE7JHOF.js +0 -186
  771. package/dist/upload-HVE7JHOF.js.map +0 -1
  772. package/dist/url-options-DOOHH2JE.js +0 -137
  773. package/dist/url-params-EHRE7RFC.js +0 -103
  774. package/dist/url-params-EHRE7RFC.js.map +0 -1
  775. package/dist/validate-2SL473DR.js +0 -181
  776. package/dist/validate-2SL473DR.js.map +0 -1
  777. package/dist/videos-URSOTIHU.js +0 -41
  778. package/dist/viewer-check-N3SEOOMX.js +0 -90
  779. package/dist/visuals-2Q643EXW.js +0 -130
  780. package/dist/visuals-2Q643EXW.js.map +0 -1
  781. package/dist/web-SEZ7DJLY.js +0 -181
  782. package/dist/web-SEZ7DJLY.js.map +0 -1
  783. package/dist/winning-ads-TCRRYKCR.js +0 -88
  784. package/dist/write-commands-DSQDZBN7.js +0 -1556
  785. package/dist/write-commands-DSQDZBN7.js.map +0 -1
  786. package/dist/x-K6IWYLK3.js +0 -47
  787. /package/dist/{account-reads-XOGHJB3K.js.map → account-reads-WSCCHXVJ.js.map} +0 -0
  788. /package/dist/{accounts-7CHGRXBP.js.map → accounts-IJSVR6DJ.js.map} +0 -0
  789. /package/dist/{actions-KWHMTMLD.js.map → actions-CHEA2XHB.js.map} +0 -0
  790. /package/dist/{ads-7Q7PRFJ4.js.map → ads-FFOZYOTX.js.map} +0 -0
  791. /package/dist/{avatars-PILXCCPG.js.map → avatars-T4KI7MGJ.js.map} +0 -0
  792. /package/dist/{campaigns-XS52PZQL.js.map → campaigns-SFWGE46K.js.map} +0 -0
  793. /package/dist/{canvas-3AHETASK.js.map → canvas-FU77RUVS.js.map} +0 -0
  794. /package/dist/{changes-YOTRCCNB.js.map → changes-NZ3VD4DX.js.map} +0 -0
  795. /package/dist/{check-3SVCK3V3.js.map → check-UI7GO6WL.js.map} +0 -0
  796. /package/dist/{chunk-M6RQJCDW.js.map → chunk-2AEGQHER.js.map} +0 -0
  797. /package/dist/{chunk-BMUAE5IR.js.map → chunk-2CZG4RWO.js.map} +0 -0
  798. /package/dist/{chunk-X4NF7IMQ.js.map → chunk-3KHNCHQG.js.map} +0 -0
  799. /package/dist/{chunk-TR72BZ4D.js.map → chunk-4KLOD6BZ.js.map} +0 -0
  800. /package/dist/{chunk-Z7WMTBGD.js.map → chunk-57NMT4HK.js.map} +0 -0
  801. /package/dist/{chunk-NZ3PQBRV.js.map → chunk-6W4IWZS6.js.map} +0 -0
  802. /package/dist/{chunk-V7T6HAPO.js.map → chunk-7FH3IREG.js.map} +0 -0
  803. /package/dist/{chunk-2PNBK7KZ.js.map → chunk-ABUK7QTA.js.map} +0 -0
  804. /package/dist/{chunk-G4IFJB4Z.js.map → chunk-AMK4DLOY.js.map} +0 -0
  805. /package/dist/{chunk-BPQY4KIM.js.map → chunk-BTILLYVG.js.map} +0 -0
  806. /package/dist/{chunk-T55DY36I.js.map → chunk-BTUY3BKY.js.map} +0 -0
  807. /package/dist/{chunk-GJPS6SUI.js.map → chunk-CYT3HWSV.js.map} +0 -0
  808. /package/dist/{chunk-HSPOURUB.js.map → chunk-D4U4UTAW.js.map} +0 -0
  809. /package/dist/{chunk-YCCTIFI7.js.map → chunk-DKKBLSSV.js.map} +0 -0
  810. /package/dist/{chunk-H2IG6MOX.js.map → chunk-EYR2FNGL.js.map} +0 -0
  811. /package/dist/{chunk-UTOVP53O.js.map → chunk-F4XOJA6P.js.map} +0 -0
  812. /package/dist/{chunk-VZQHMRYM.js.map → chunk-FSCP6ABR.js.map} +0 -0
  813. /package/dist/{chunk-4GM3TBGL.js.map → chunk-GXW6WVY5.js.map} +0 -0
  814. /package/dist/{chunk-ZIZBAKJF.js.map → chunk-GZV7523D.js.map} +0 -0
  815. /package/dist/{chunk-3B7GRVIM.js.map → chunk-HRVWFNHN.js.map} +0 -0
  816. /package/dist/{chunk-DJLTDVRD.js.map → chunk-I3KZTXTZ.js.map} +0 -0
  817. /package/dist/{chunk-YAMDF3DT.js.map → chunk-J3VU2WTT.js.map} +0 -0
  818. /package/dist/{chunk-SELCZP76.js.map → chunk-JMIWK222.js.map} +0 -0
  819. /package/dist/{chunk-BYYIJMLP.js.map → chunk-KLGXKDF3.js.map} +0 -0
  820. /package/dist/{chunk-T5FACY43.js.map → chunk-KLY3M46A.js.map} +0 -0
  821. /package/dist/{chunk-QLSNKH5D.js.map → chunk-L653Z5Y6.js.map} +0 -0
  822. /package/dist/{chunk-VPWLH6VS.js.map → chunk-LNF7UX4Z.js.map} +0 -0
  823. /package/dist/{chunk-3MJTL763.js.map → chunk-MFQS4F3S.js.map} +0 -0
  824. /package/dist/{chunk-AOXHDVWS.js.map → chunk-O3KKPPQZ.js.map} +0 -0
  825. /package/dist/{chunk-Y4XW2LW3.js.map → chunk-POPVDF5D.js.map} +0 -0
  826. /package/dist/{chunk-X6CSCKXX.js.map → chunk-PSUMRBER.js.map} +0 -0
  827. /package/dist/{chunk-N5IR2T2B.js.map → chunk-QADB45DW.js.map} +0 -0
  828. /package/dist/{chunk-CDU64GKK.js.map → chunk-QGDORYTY.js.map} +0 -0
  829. /package/dist/{chunk-YWHOPJG5.js.map → chunk-QOU5FOOS.js.map} +0 -0
  830. /package/dist/{chunk-AYW4VFTH.js.map → chunk-RJCPZBLI.js.map} +0 -0
  831. /package/dist/{chunk-RZOHIOPP.js.map → chunk-SYUPKPEB.js.map} +0 -0
  832. /package/dist/{chunk-GHEURTBN.js.map → chunk-TMCRKUCE.js.map} +0 -0
  833. /package/dist/{chunk-5UG7AJB5.js.map → chunk-TY5WIUV3.js.map} +0 -0
  834. /package/dist/{chunk-DA634ZIV.js.map → chunk-URLGCG7H.js.map} +0 -0
  835. /package/dist/{chunk-NZFVC7RP.js.map → chunk-VJYMJQC6.js.map} +0 -0
  836. /package/dist/{chunk-VXLFFMW6.js.map → chunk-W44IK3XR.js.map} +0 -0
  837. /package/dist/{chunk-IAOXI7MJ.js.map → chunk-WW54TX3Z.js.map} +0 -0
  838. /package/dist/{chunk-2CV2LEJN.js.map → chunk-XHBCLWET.js.map} +0 -0
  839. /package/dist/{chunk-HVVE3GT6.js.map → chunk-XQQGDAN3.js.map} +0 -0
  840. /package/dist/{chunk-CE6M4VLG.js.map → chunk-Z2ZHZ63Y.js.map} +0 -0
  841. /package/dist/{chunk-VDHPAQUM.js.map → chunk-Z5HFLB26.js.map} +0 -0
  842. /package/dist/{chunk-RN3IVT3B.js.map → chunk-ZMIYMQXQ.js.map} +0 -0
  843. /package/dist/{companies-6FM3CALY.js.map → companies-4HVE4Q6R.js.map} +0 -0
  844. /package/dist/{connect-J6M3W7WW.js.map → connect-DQ4UEXTA.js.map} +0 -0
  845. /package/dist/{conversion-upload-command-6TY2DIBM.js.map → conversion-upload-command-2MWV3HNQ.js.map} +0 -0
  846. /package/dist/{creatives-PW2P7VMU.js.map → creatives-JFBLKD57.js.map} +0 -0
  847. /package/dist/{currency-CLB7ROUV.js.map → currency-ONT4GYB3.js.map} +0 -0
  848. /package/dist/{customers-OHB5EY7Z.js.map → customers-LV5ZBX6E.js.map} +0 -0
  849. /package/dist/{discover-EAI4WDSL.js.map → discover-T3V6CZN6.js.map} +0 -0
  850. /package/dist/{draft-R3GI7JWY.js.map → draft-7GALT4VY.js.map} +0 -0
  851. /package/dist/{fit-BNMTWIDZ.js.map → fit-BHEY5AJ2.js.map} +0 -0
  852. /package/dist/{forecast-YFCLMXAV.js.map → forecast-KSGBXVVI.js.map} +0 -0
  853. /package/dist/{ideas-UK74GJGE.js.map → ideas-E2AT6UC2.js.map} +0 -0
  854. /package/dist/{images-OH7KDUR5.js.map → images-CYYSGAIY.js.map} +0 -0
  855. /package/dist/{ingest-2BC3W4WC.js.map → ingest-AFID4ITN.js.map} +0 -0
  856. /package/dist/{inspect-ZMCRHR2P.js.map → inspect-TQF3CHYA.js.map} +0 -0
  857. /package/dist/{intent-6NJBN3OR.js.map → intent-YQSJW3ML.js.map} +0 -0
  858. /package/dist/{keyword-gap-Y5J2VZDP.js.map → keyword-gap-4UK4GCVM.js.map} +0 -0
  859. /package/dist/{languages-H4VPFO7Y.js.map → languages-NVU327GJ.js.map} +0 -0
  860. /package/dist/{line-items-RUC54PIV.js.map → line-items-KR2LVAHD.js.map} +0 -0
  861. /package/dist/{locations-UPY33JUY.js.map → locations-CUE3CPNC.js.map} +0 -0
  862. /package/dist/{media-sources-KUEQ45V5.js.map → media-sources-A6OA52B6.js.map} +0 -0
  863. /package/dist/{metrics-BNLDV4BU.js.map → metrics-TPYUYVQG.js.map} +0 -0
  864. /package/dist/{performance-BIH653SL.js.map → performance-Q45ZTIGE.js.map} +0 -0
  865. /package/dist/{promoted-tweets-6YCNFVJK.js.map → promoted-tweets-C7RJ66FU.js.map} +0 -0
  866. /package/dist/{query-FZAFUWCX.js.map → query-D5CI5W3N.js.map} +0 -0
  867. /package/dist/{reddit-Z4REP3DB.js.map → reddit-NRGE6NTA.js.map} +0 -0
  868. /package/dist/{relevant-pages-OFFMPMKG.js.map → relevant-pages-UMT5ZDRY.js.map} +0 -0
  869. /package/dist/{research-M6YZMTCC.js.map → research-ZLLP2VOB.js.map} +0 -0
  870. /package/dist/{run-MBVV64FY.js.map → run-ELP43NMT.js.map} +0 -0
  871. /package/dist/{scheduled-agents-T7CITLJL.js.map → scheduled-agents-3CGSEALY.js.map} +0 -0
  872. /package/dist/{schema-6WONG4NR.js.map → schema-4PS5KOSS.js.map} +0 -0
  873. /package/dist/{search-terms-OFLKWSEF.js.map → search-terms-KNCX3COA.js.map} +0 -0
  874. /package/dist/{sources-3RQZ3AR2.js.map → sources-2CAHK6AB.js.map} +0 -0
  875. /package/dist/{sync-definition-MR7XESTS.js.map → sync-definition-YTZY6NSH.js.map} +0 -0
  876. /package/dist/{tags-I3AJEMKF.js.map → tags-KT4NJSKY.js.map} +0 -0
  877. /package/dist/{targeting-criteria-QFFAYBGE.js.map → targeting-criteria-3URPDGYI.js.map} +0 -0
  878. /package/dist/{testimonials-67Q3OTBU.js.map → testimonials-IFKSIRNF.js.map} +0 -0
  879. /package/dist/{themes-VAKXKG4M.js.map → themes-VINUDRB5.js.map} +0 -0
  880. /package/dist/{url-options-DOOHH2JE.js.map → url-options-WB24UWPV.js.map} +0 -0
  881. /package/dist/{videos-URSOTIHU.js.map → videos-LDJBOSGX.js.map} +0 -0
  882. /package/dist/{viewer-check-N3SEOOMX.js.map → viewer-check-DHTJISCO.js.map} +0 -0
  883. /package/dist/{winning-ads-TCRRYKCR.js.map → winning-ads-2YTDMOWE.js.map} +0 -0
  884. /package/dist/{x-K6IWYLK3.js.map → x-TJOFGBFR.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../api/src/experiments/composition.ts","../../api/src/experiments/goal.ts","../../api/src/experiments/hypothesis.ts","../../api/src/experiments/wait.ts","../../api/src/experiments/wire.ts","../src/commands/experiment/index.ts","../src/commands/experiment/composition.ts","../src/commands/experiment/fold.ts","../src/commands/experiment/hints.ts","../src/commands/experiment/hypothesis.ts","../src/commands/experiment/identity.ts","../src/commands/experiment/measurement.ts","../src/commands/experiment/readout.ts","../src/commands/experiment/said-in-chat.ts","../src/commands/experiment/update.ts"],"sourcesContent":["/**\n * What the two arms of a test are actually made of.\n *\n * A variant page imports the control's sections and owns a copy of only what\n * was forked (`baker landings variant <control> <slug> --fork Hero.astro`). That\n * is what makes the arms differ by the hypothesis and nothing else — see\n * `docs/experiments.md` § Shared components.\n *\n * Recording the split is what lets the review say what is being tested without\n * guessing. It matters more than it looks, for two reasons:\n *\n * - **It is the exact claim.** A picture of two pages shows a difference; this\n * names it. Anything derived from pixels is an illustration of this, never a\n * substitute — change a headline and every pixel below it moves, so a pixel\n * comparison alone cannot tell one change from the whole page shifting.\n * - **`shared` is the reason to trust the test at all.** \"Proof, pricing and\n * the FAQ are the same file on both pages\" is what says the number at the end\n * will be about the hypothesis rather than about drift, and nobody is told it\n * today.\n *\n * Computed at the moment the test starts, from the real import graph, rather\n * than passed along from whenever the page happened to be built.\n */\n\nimport { z } from \"zod\";\n\nexport const experimentCompositionSchema = z.object({\n /** Components the variant owns its own copy of — the thing under test. */\n forked: z.array(z.string().max(300)).max(50),\n /** Components both pages render from one file, so an edit reaches both arms. */\n shared: z.array(z.string().max(300)).max(200),\n});\nexport type ExperimentComposition = z.infer<typeof experimentCompositionSchema>;\n\n/**\n * Words that are initialisms, not words.\n *\n * Sentence case is right for a section name — \"Social proof\", not \"Social\n * Proof\" — and wrong for these: a file called `Faq.astro` is the FAQ, and\n * `StickyCta.astro` is the sticky CTA. Rendering them \"Faq\" and \"Sticky cta\"\n * reads as a typo in a sentence a client is shown on every A/B card. Kept to\n * the vocabulary the scaffold's own sections actually use rather than opened\n * into a general dictionary, which would start guessing.\n */\nconst INITIALISMS = new Set([\"faq\", \"cta\"]);\n\n/**\n * A component path as a person would say it.\n *\n * `_components/SocialProof.astro` is \"Social proof\". The basename only: a\n * nested component is known by its own name, and its folder is a detail of how\n * the page is organised rather than of what the visitor sees.\n */\nexport function componentLabel(path: string): string {\n const base = (path.split(\"/\").pop() ?? path).replace(/\\.[^.]+$/, \"\");\n const words = base\n .replace(/([a-z0-9])([A-Z])/g, \"$1 $2\")\n .replace(/[-_]+/g, \" \")\n .toLowerCase()\n .split(/\\s+/)\n .filter((word) => word.length > 0)\n .map((word) => (INITIALISMS.has(word) ? word.toUpperCase() : word));\n const first = words[0] ?? \"\";\n return [first.charAt(0).toUpperCase() + first.slice(1), ...words.slice(1)].join(\" \");\n}\n\n/** `[\"a\", \"b\", \"c\"]` → `\"a, b and c\"`. */\nfunction list(items: readonly string[]): string {\n if (items.length <= 1) return items[0] ?? \"\";\n return `${items.slice(0, -1).join(\", \")} and ${items[items.length - 1]}`;\n}\n\n/**\n * The composition in one sentence, in product language.\n *\n * The empty-`forked` case is not defensive: `baker landings variant` with no\n * `--fork` succeeds on purpose and produces a page that renders exactly the\n * control. A test on those two pages runs for weeks and concludes nothing, so\n * the brief has to say it outright rather than describe an absence.\n */\nexport function describeComposition(composition: ExperimentComposition): string {\n const forked = composition.forked.map(componentLabel);\n const shared = composition.shared.map(componentLabel);\n if (forked.length === 0) {\n return \"Nothing is different — both pages render exactly the same sections.\";\n }\n const difference = forked.length === 1 ? `Only ${forked[0]} is different.` : `${list(forked)} are different.`;\n if (shared.length === 0) {\n return difference;\n }\n const verb = shared.length === 1 ? \"is\" : \"are\";\n return `${difference} ${list(shared)} ${verb} the same file on both pages.`;\n}\n","/**\n * What an experiment measures.\n *\n * The half of an A/B test that decides whether the answer is worth anything.\n * Everything else — the split, the posteriors, the stopping rule — is machinery\n * that works identically whatever is being counted; this names the thing being\n * counted, and getting it wrong produces a confident answer to a question\n * nobody asked.\n *\n * ## A goal is one event, named by its key\n *\n * Baker's event stream has one vocabulary for \"a thing that happened on a\n * page\": the event key (`form:<flow>:<node>:<trigger>`, `submit:<flow>`,\n * `page:<name>`, `exit:<host>` — see `analytics/eventKey.ts`). A test's goal is\n * one of those keys: *this* Form reaching *this* step, *this* button, *this*\n * click out. `baker analytics conversions --candidates` lists the ones the\n * company's pages actually produce.\n *\n * It used to be a conversion *name* — \"Quote requested\" — which groups several\n * keys. That was the wrong grain for a test in exactly the case a test is most\n * often about: a variant that replaces the page's Form with a shorter one\n * converts on a different key, and a name either counted both endings as one\n * outcome or, if the new key was never added under it, counted the new version\n * as never converting at all. A key is specific, and each version can have its\n * own — see `variantGoal` on the plan.\n *\n * The goal is the **primary** metric: the one the verdict is read from. Every\n * conversion the company has named is reported beside it as a secondary metric\n * — shown, never decided on. See `wire.ts`.\n *\n * ## A goal is chosen before the test starts and never changes\n *\n * Running one test and reading six metrics off it, then reporting the one that\n * moved, is not an A/B test — it is six tests with the failure rate of six and\n * the confidence of one. Fixing the goal at creation, and printing the\n * secondaries with no verdict attached, is what keeps the stopping rule meaning\n * what it says. Changing your mind costs a new test, which is the honest price.\n */\n\nimport { z } from \"zod\";\nimport { parseEventKey } from \"../analytics/eventKey\";\nimport { triggerDescription } from \"../analytics/triggers\";\n\nexport const GOAL_KEY_HELP =\n \"A goal is one event, by its key — `form:<flow>:<node>:<trigger>`, `submit:<flow>`, `page:<name>` or `exit:<host>`. `baker analytics conversions --candidates` lists the ones these pages produce\";\n\n/** One event key, as `eventKeySql` spells it. */\nexport const experimentGoalSchema = z\n .string()\n .trim()\n .min(1)\n .max(400)\n .refine((key) => parseEventKey(key) !== null, { message: GOAL_KEY_HELP });\n\nexport type ExperimentGoal = z.infer<typeof experimentGoalSchema>;\n\n/** A Form's name for its slug, when the caller knows it. */\nexport type FlowNameOf = (slug: string) => string | undefined;\n\nconst noNames: FlowNameOf = () => undefined;\n\n/**\n * A Form trigger, in words — from the shared table and nowhere else.\n *\n * The trigger id is the engine's name for a moment\n * (`text.onTextDisplayed`, `calendlyEvent.eventScheduled`); `TRIGGERS` in\n * `analytics/triggers.ts` says what that moment is to the visitor, and it is\n * what the Conversions screen, the picker, the events feed and the replay all\n * render. A goal is shown to the same marketer on a card beside those, so it\n * has to say the same words: a private table here answered \"step reached\"\n * where the screen next door said \"Screen shown\", and \"booking made\" where it\n * said \"Call booked\".\n *\n * Every trigger Baker itself raises is in the table. The one family that falls\n * through is `iframe.<whatever the embed posts>`, and there the raw name is\n * printed as it is — the same rule as a `page:` event's name above. It used to\n * be de-camelCased here (`iframe.checkout_completed` → \"Checkout completed\")\n * and `eventKeyLabel` prints it raw, so a staged test's brief showed the\n * hypothesis and the goal card spelling one event two ways, and the prettier\n * of the two was the spelling a reviewer could not find on Measure.\n */\nfunction describeTrigger(triggerId: string): string {\n return triggerDescription(triggerId)?.what ?? triggerId;\n}\n\n/**\n * What to call this goal in front of a marketer.\n *\n * The key names a Form by slug and a step by id, neither of which a person\n * reads; the label names the Form by its name when the caller can supply it and\n * the moment in words. An unparseable key is shown raw, quoted — it is still\n * the truth about what is being counted.\n */\nexport function describeExperimentGoal(goal: string, flowName: FlowNameOf = noNames): string {\n const parsed = parseEventKey(goal);\n if (!parsed) return `“${goal}”`;\n switch (parsed.family) {\n case \"form\":\n return `“${flowName(parsed.flowSlug) ?? parsed.flowSlug}” Form · ${describeTrigger(parsed.triggerId)}`;\n case \"submit\":\n return `“${flowName(parsed.flowSlug) ?? parsed.flowSlug}” Form finished`;\n case \"page\":\n // The name exactly as it is sent, underscores and all. It used to be\n // de-underscored — `deal_won` → `deal won` — which reads better and is\n // the one spelling a reviewer cannot look up: Measure, the events feed\n // and the conversions picker all list the raw name, so a brief saying\n // “request quote” sent somebody looking for an event that is not there.\n return `“${parsed.eventName}”`;\n case \"exit\":\n return `a click out to ${parsed.host}`;\n default:\n return `“${goal}”`;\n }\n}\n\n/**\n * Both goals in one clause, when the two versions are read on different events.\n *\n * The common case — one event on both — reads as one label. When the variant\n * converts on its own event (a new Form, a different button), both are named\n * and it is said which version each belongs to, because a card that named one\n * would be describing half the test.\n */\nexport function describeExperimentGoals(\n goal: string,\n variantGoal: string | null | undefined,\n flowName: FlowNameOf = noNames,\n): string {\n const page = describeExperimentGoal(goal, flowName);\n if (!variantGoal || variantGoal === goal) return page;\n return `${page} on the page, ${describeExperimentGoal(variantGoal, flowName)} on the new version`;\n}\n","/**\n * Why a test is being run, in the shape the rest of the feature can read.\n *\n * ## Why this is not a sentence\n *\n * The canonical hypothesis is \"Because **[observation]**, if we **[change]**,\n * then **[metric]** will **[direction]** by about **[magnitude]**.\" Three of\n * those five parts are already first-class, machine-readable and immutable\n * elsewhere in this feature:\n *\n * - the change → `plan.variantSlug`, and exactly which component was forked\n * - the metric → {@link ExperimentGoal}, fixed at creation and refused if it\n * has never fired\n * - the magnitude → `plan.minDetectableRelativeLift`\n *\n * A free-text sentence therefore restates three stored fields in a worse form —\n * one that can silently disagree with them, because nothing compares the two —\n * while burying the one part that has nowhere else to live. Storing the parts\n * removes the disagreement by construction: {@link renderHypothesis} is the\n * only thing allowed to produce the sentence, and it reads the goal and the\n * lift from the plan rather than from the prose.\n *\n * ## Why `expect` is here\n *\n * It looks like decoration and it is the load-bearing field. A test is not\n * symmetric: \"the new hero converts better\" and \"the new hero converts worse\"\n * are different claims, and the verdict already knows which arm won. Pairing\n * the two gives {@link hypothesisOutcome}, which is derived and never entered —\n * so a `winner` the CONTROL won stops being announced as \"we have a winner\"\n * and starts being reported as what it is, the most useful thing a test can\n * find: the change made it worse.\n *\n * Without `expect` that finding is unreachable, because nothing in the stored\n * plan says which direction was hoped for.\n */\n\nimport { z } from \"zod\";\n\n/**\n * Where the observation came from.\n *\n * A closed set rather than free text, because the point of recording it is to\n * be able to ask later which kinds of evidence produced tests that held. The\n * names are the tools the agent already has (`baker ga4`, `baker gsc`,\n * `baker ads`, the Clarity MCP, the research agents, the inspiration library),\n * plus the two honest non-tool answers.\n *\n * `hunch` is deliberately spellable. A hypothesis with no data behind it is\n * still a hypothesis, and forcing the agent to dress one up as analytics is\n * worse than letting it say so.\n */\nexport const experimentEvidenceSourceSchema = z.enum([\n \"baker_analytics\",\n \"clarity\",\n \"ads\",\n \"search_console\",\n \"research\",\n \"inspiration\",\n \"client\",\n \"hunch\",\n]);\nexport type ExperimentEvidenceSource = z.infer<typeof experimentEvidenceSourceSchema>;\n\nexport const experimentEvidenceSchema = z.object({\n source: experimentEvidenceSourceSchema,\n note: z.string().min(1).max(200),\n /**\n * Where to go and look. Not a `z.url()` — a report inside Baker is reached by\n * a relative path, and rejecting those would push every in-product citation\n * into the note where nothing can link it.\n */\n href: z.string().max(500).optional(),\n});\nexport type ExperimentEvidence = z.infer<typeof experimentEvidenceSchema>;\n\nexport const experimentHypothesisSchema = z.object({\n /**\n * The observation. The one genuinely new field, and the reason for the rest.\n *\n * Without it a lost test teaches nothing, because there is no belief for the\n * result to be evidence against — which is how a testing programme ends up as\n * a list of tests instead of a list of things learned.\n */\n because: z.string().min(1).max(300),\n /**\n * The change, in the client's words.\n *\n * The machine-checkable truth lives in `plan.composition.forked`; this is what\n * a person reads. The two are allowed to differ in wording and cannot differ\n * in fact, because the brief shows both.\n */\n change: z.string().min(1).max(200),\n /** Which way the goal is expected to move. See the note at the top of this file. */\n expect: z.enum([\"increase\", \"decrease\"]).default(\"increase\"),\n evidence: z.array(experimentEvidenceSchema).max(5).optional(),\n});\nexport type ExperimentHypothesis = z.infer<typeof experimentHypothesisSchema>;\n\n/**\n * What the test found out about the belief.\n *\n * Deliberately not the verdict. The verdict says what the numbers did; this\n * says what it meant. They come apart in exactly the case worth catching — a\n * `winner` the control won.\n *\n * `refuted_no_effect` and `unanswered` are kept apart for the same reason\n * `no_difference` and `abandoned` are: \"measured and found alike\" and \"nobody\n * ever found out\" are opposite claims, and collapsing them manufactures a\n * finding that is not there.\n */\nexport const experimentHypothesisOutcomeSchema = z.enum([\n \"supported\",\n \"refuted_opposite\",\n \"refuted_no_effect\",\n \"unanswered\",\n]);\nexport type ExperimentHypothesisOutcome = z.infer<typeof experimentHypothesisOutcomeSchema>;\n\n/**\n * Derived from the verdict and the belief, never entered.\n *\n * **`winner` is the arm the NUMBERS favoured, never the arm that was kept.**\n * The two come apart in exactly the case this function exists for: a client may\n * keep the original after a variant win, and that decision does not make the\n * belief wrong — the belief is about the page, not about what anybody did next.\n * Passing the survivor here would report a supported hypothesis as\n * `refuted_opposite` on the card and in History. `stopped_early_harmful` has no\n * winner and needs none: nothing beat the control, so a rise was not seen.\n *\n * `null` on every verdict that decides nothing, which is why those all fall\n * through to `unanswered`.\n */\nexport function hypothesisOutcome(\n verdict: string,\n winner: \"control\" | \"variant\" | null,\n expect: ExperimentHypothesis[\"expect\"],\n): ExperimentHypothesisOutcome {\n if (verdict === \"no_difference\") {\n return \"refuted_no_effect\";\n }\n // Even its best case is under the lift the test was looking for: a rise did\n // not happen, and a fall may have.\n if (verdict === \"cannot_win\") {\n return expect === \"increase\" ? \"refuted_no_effect\" : \"unanswered\";\n }\n if (verdict !== \"winner\" && verdict !== \"stopped_early_harmful\") {\n return \"unanswered\";\n }\n // The variant is the page the belief is about, so the belief held when the\n // variant won a test that expected a rise, or lost one that expected a fall.\n const variantWon = winner === \"variant\";\n return variantWon === (expect === \"increase\") ? \"supported\" : \"refuted_opposite\";\n}\n\n/**\n * The sentence, built from the parts. Nothing else may store one.\n *\n * `goalLabel` comes from the plan rather than from the hypothesis, so the\n * sentence a person reads cannot disagree with the thing being measured.\n *\n * The lift the test was sized for is deliberately NOT in it. It used to end\n * \"by at least 20%\", and a marketer reading it asked what the 20% meant — it\n * is the sizing parameter, not part of the belief, and the stopping rule is\n * anytime-valid, so the test does not stop at 20% or wait for it. The claim is\n * the direction; the numbers are the evidence.\n */\nexport function renderHypothesis(hypothesis: ExperimentHypothesis, goalLabel: string): string {\n const direction = hypothesis.expect === \"increase\" ? \"go up\" : \"go down\";\n return `Because ${hypothesis.because}, if we ${hypothesis.change}, ${goalLabel} should ${direction}.`;\n}\n","const DAY_MS = 24 * 60 * 60 * 1000;\n\nfunction count(value: number, unit: string): string {\n return `about ${value} ${unit}${value === 1 ? \"\" : \"s\"}`;\n}\n\n/**\n * How long until a running test is expected to have an answer, in the unit a\n * marketer plans in: days under two weeks, weeks under two months, then months.\n *\n * Shared because the card and the agent both say it, and a test \"about 4 weeks\"\n * out on the dashboard and \"2026-10-22\" in chat reads as two different answers.\n * Always \"about\": it is today's traffic projected forward, never a promise.\n */\nexport function describeWait(earliestDecisionAt: number, now: number): string {\n const days = (earliestDecisionAt - now) / DAY_MS;\n if (days <= 0) return \"any moment now\";\n if (days < 1) return \"within a day\";\n if (days < 14) return count(Math.round(days), \"day\");\n if (days < 60) return count(Math.round(days / 7), \"week\");\n return count(Math.round(days / 30), \"month\");\n}\n\n/**\n * `2,115` → `about 2,100`, `38` → `about 40`: a projected count said at the\n * precision it is known to. Shared for the same reason as {@link describeWait}.\n */\nexport function roughCount(count: number): string {\n if (count < 10) return `about ${Math.max(1, Math.round(count)).toLocaleString(\"en-US\")}`;\n const magnitude = 10 ** Math.max(1, Math.floor(Math.log10(count)) - 1);\n return `about ${(Math.round(count / magnitude) * magnitude).toLocaleString(\"en-US\")}`;\n}\n","/**\n * The request and response shapes `baker experiment` and the backend agree on.\n *\n * One schema per direction, used by both sides, so a field renamed in one place\n * is a compile error rather than a request the other silently ignores.\n */\n\nimport { z } from \"zod\";\nimport { chatInspectStatusSchema } from \"../chats\";\nimport { experimentCompositionSchema } from \"./composition\";\nimport { experimentGoalSchema } from \"./goal\";\nimport { experimentHypothesisOutcomeSchema, experimentHypothesisSchema } from \"./hypothesis\";\nimport { variantOfSlug } from \"./variants\";\n\n/** Page slugs, as the Company Workspace writes them: `src/pages/<slug>/`. */\nconst slugSchema = z\n .string()\n .min(1)\n .max(120)\n .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, \"Use a page slug, like `oferta`\");\n\n/**\n * A variant's slug, `<page>--<n>`.\n *\n * Its own schema, because the page pattern above forbids the double dash that\n * marks a variant — and with one schema for both fields every `plan` and\n * `start` was refused at the boundary with \"Use a page slug\", before the\n * backend could say which page the variant belongs to.\n */\nconst variantSlugSchema = z\n .string()\n .min(1)\n .max(130)\n .refine((slug) => {\n const page = variantOfSlug(slug);\n return page !== null && slugSchema.safeParse(page).success;\n }, \"Use the variant's slug, `<page>--<n>` — `baker landings variant <page>` chooses it\");\n\nexport const experimentPlanRequestSchema = z.object({\n landingSlug: slugSchema,\n /**\n * The new version's slug, when it already exists. Optional because `plan`\n * runs before the variant is built, and `baker landings variant` chooses its\n * slug: the sizing depends on the page, never on the variant's name.\n */\n variantSlug: variantSlugSchema.optional(),\n /**\n * Which of the company's conversions the test is about.\n *\n * Optional only when the company counts exactly one outcome, in which case\n * it is that one. A company counting several has to say which — a test that\n * \"measures conversions\" on a page with a newsletter box and a demo request\n * is measuring two things and deciding on their sum.\n */\n goal: experimentGoalSchema.optional(),\n /**\n * The event the NEW version converts on, when it is not the page's.\n *\n * The test asks one question — did more visitors do the thing we want — but\n * the thing can be a different event on each version: a variant that swaps\n * the page's Form for a shorter one converts on the new Form's ending. Absent,\n * the variant is read on `goal`, which is the common case.\n */\n variantGoal: experimentGoalSchema.optional(),\n /**\n * The smallest lift worth detecting, relative to the baseline. `0.2` is +20%.\n *\n * The single most consequential number a caller supplies, and the one it is\n * most tempting to set small. A test sized for +5% on a 3% page needs a\n * quarter of a million visitors per arm; `plan` will say so rather than\n * running it.\n */\n minDetectableRelativeLift: z.number().gt(0).max(10).optional(),\n /**\n * The share of visitors expected to do the goal, as a fraction — `0.05` is\n * 5% — for a page whose history cannot say.\n *\n * A page about to get its first campaign has no rate to size on. Without\n * this the plan stands on the company-wide rate for the outcome, or on a\n * conventional 3%; with it, on what the person setting the test up knows.\n * Either way the brief says which, because the sizing is a guide and never a\n * finish line — the test runs until the numbers are clear.\n */\n baselineRate: z.number().gt(0).lt(1).optional(),\n});\nexport type ExperimentPlanRequest = z.infer<typeof experimentPlanRequestSchema>;\n\n/**\n * How much recent traffic the page had when the test was sized.\n *\n * `none` and `low` used to be refusals, and the refusal was wrong for the\n * commonest reason a test gets set up: a page built for a campaign that starts\n * next week. Its history says nothing about the traffic it is about to get.\n */\nexport const experimentTrafficSchema = z.enum([\"none\", \"low\", \"enough\"]);\nexport type ExperimentTrafficReading = z.infer<typeof experimentTrafficSchema>;\n\n/**\n * Where the baseline came from: this page's own history, the company-wide rate\n * for the same outcome, or a rate somebody stated or Baker assumed.\n */\nexport const experimentBaselineSourceSchema = z.enum([\"page\", \"company\", \"assumed\"]);\nexport type ExperimentBaselineSource = z.infer<typeof experimentBaselineSourceSchema>;\n\n/** What the sizing stood on: the page's visitors over the window, and how many did the goal. */\nexport const experimentSizedOnSchema = z.object({\n visitors: z.number(),\n convertingVisitors: z.number(),\n windowDays: z.number(),\n});\nexport type ExperimentSizedOn = z.infer<typeof experimentSizedOnSchema>;\n\n/**\n * Starting a test needs everything planning it did, plus the reason for it.\n *\n * The hypothesis is structured rather than a sentence, and that is the point:\n * the change, the metric and the magnitude are already fields on this request,\n * so a sentence restating them can disagree with them and nothing would notice.\n * See `hypothesis.ts`.\n */\nexport const experimentStartRequestSchema = experimentPlanRequestSchema.extend({\n variantSlug: variantSlugSchema,\n hypothesis: experimentHypothesisSchema,\n /**\n * The two pages' own identities, read off their `_definition.md` by the CLI.\n *\n * The backend prefers the `landings` rows, but the variant has no row until\n * the Session that built it is published — which is after the test is\n * staged. Without this the variant's identity was never recorded, so a\n * renamed variant folder detached its running test and a fold archived the\n * loser under the wrong key. Optional because a workspace that cannot read\n * its own definition must still be able to start a test.\n */\n landingInternalId: z.string().min(1).max(64).optional(),\n variantInternalId: z.string().min(1).max(64).optional(),\n /**\n * What the two arms are made of, read off the import graph by the caller at\n * the moment the test starts.\n *\n * Optional on the wire because the backend cannot compute it — only the\n * Company Workspace has the files — and a workspace that cannot answer must\n * not be blocked from running a test. The brief degrades to naming the two\n * pages instead of naming the section under test.\n */\n composition: experimentCompositionSchema.optional(),\n /**\n * Publish both versions without switching the split on.\n *\n * For a new version somebody has to see before any visitor does — usually\n * the client. Once published, `/<page>/?_bkr_preview=b` shows it to anyone\n * with the link while everyone else keeps getting the page; `resume` switches\n * the split on, and the test is dated from then.\n */\n held: z.boolean().optional(),\n});\nexport type ExperimentStartRequest = z.infer<typeof experimentStartRequestSchema>;\n\n/** Which version of the page stays live once a test is over. */\nexport const experimentKeepSchema = z.enum([\"original\", \"variant\"]);\nexport type ExperimentKeep = z.infer<typeof experimentKeepSchema>;\n\n/**\n * Why the test was ended — the person's reason, as distinct from the verdict.\n *\n * The verdict says what the numbers had reached; this says why somebody\n * stopped looking. The two come apart in every case worth recording: a test\n * ended on `keep_running` because the page had to change for a campaign is\n * not the same record as one ended because it was never going to settle, and\n * the next test on the page is planned differently after each.\n *\n * `numbers_clear` — the result was clear enough to act on.\n * `not_settling` — too little traffic or too small a difference; waiting would not help.\n * `page_changing` — the page has to change for another reason, so the test cannot go on.\n * `test_flawed` — something about the test itself was wrong (the wrong goal, a broken variant).\n */\nexport const experimentEndReasonSchema = z.enum([\"numbers_clear\", \"not_settling\", \"page_changing\", \"test_flawed\"]);\nexport type ExperimentEndReason = z.infer<typeof experimentEndReasonSchema>;\nexport const EXPERIMENT_END_REASON_LABEL: Record<ExperimentEndReason, string> = {\n numbers_clear: \"The numbers were clear\",\n not_settling: \"It was not going to settle\",\n page_changing: \"The page has to change for another reason\",\n test_flawed: \"Something was wrong with the test\",\n};\n\n/**\n * Ending a test is a decision a person or an agent makes, and says out loud.\n *\n * `keep` is required. The stopping rule produces a verdict, and the verdict is\n * what the caller should act on — but the call is theirs: a client can keep the\n * original after a variant win because the variant broke a brand rule, or ship\n * a variant a test could not settle because it is the only version that fits a\n * campaign starting Monday. Both are legitimate and both are recorded as what\n * they are: the outcome the numbers produced, and the version that was kept.\n * Nothing here ends a test on its own.\n */\n/**\n * What was learned, in the caller's words. The one field on a finished test\n * that the numbers cannot produce: \"the price is not the objection, the\n * install date is\" is a conclusion, and the next test on this page starts from\n * it. Optional at finish and addable later through `update`, because the\n * conclusion is often clearer a week after the decision.\n */\nexport const experimentLearningSchema = z.string().trim().min(1).max(2000);\n\nexport const experimentFinishRequestSchema = z.object({\n experimentId: z.string().min(1).max(64),\n keep: experimentKeepSchema,\n /** Why it is being ended. The dashboard always asks; the agent should say. */\n reason: experimentEndReasonSchema.optional(),\n learning: experimentLearningSchema.optional(),\n});\nexport type ExperimentFinishRequest = z.infer<typeof experimentFinishRequestSchema>;\n\n/**\n * Pausing stops the split and serves everyone the original; resuming restarts\n * it. Visitors already assigned keep their side, so a paused-and-resumed test\n * is one test rather than two.\n */\nexport const experimentPauseRequestSchema = z.object({\n experimentId: z.string().min(1).max(64),\n});\nexport type ExperimentPauseRequest = z.infer<typeof experimentPauseRequestSchema>;\n\n/**\n * Changing what a test says about itself, never what it measures.\n *\n * A test that has started is a measurement in progress: its goal, its lift and\n * the direction it expects are what the verdict is read against, and moving any\n * of them mid-flight is how a result gets argued into existence. So on a live\n * test only the wording can change — the observation, the change as the client\n * would say it, and the evidence cited — which is the half that carries into\n * the next test and the half that is most often wrong on the first draft.\n *\n * A test that is still staged has not measured anything, so everything about\n * it may still change; the backend re-sizes it exactly as `start` did.\n */\nexport const experimentUpdateRequestSchema = z.object({\n experimentId: z.string().min(1).max(64),\n because: experimentHypothesisSchema.shape.because.optional(),\n change: experimentHypothesisSchema.shape.change.optional(),\n evidence: experimentHypothesisSchema.shape.evidence,\n /**\n * Staged tests only. Spelled out rather than borrowed from the hypothesis\n * schema, whose `expect` defaults to `increase`: through `.optional()` that\n * default still fires, so every wording-only update arrived carrying a\n * direction and was refused for trying to change it.\n */\n expect: z.enum([\"increase\", \"decrease\"]).optional(),\n /** Staged tests only. */\n goal: experimentGoalSchema.optional(),\n /** Staged tests only. The new version's own event, when it differs. */\n variantGoal: experimentGoalSchema.optional(),\n /** Staged tests only. */\n minDetectableRelativeLift: z.number().gt(0).max(10).optional(),\n /** Finished tests only: what the test taught, written or corrected after the fact. */\n learning: experimentLearningSchema.optional(),\n});\nexport type ExperimentUpdateRequest = z.infer<typeof experimentUpdateRequestSchema>;\n\nexport const experimentUpdateResponseSchema = z.object({\n /** True when the test had not been published, so its whole plan was re-sized. */\n staged: z.boolean(),\n hypothesisStatement: z.string(),\n});\nexport type ExperimentUpdateResponse = z.infer<typeof experimentUpdateResponseSchema>;\n\n/**\n * The second beat of a finish: making the repo say what the URL serves.\n *\n * A test ends in three beats. `finish` records which version is live and the\n * edge starts serving it within seconds. The **fold** moves the winning\n * variant's files into the page's own folder and archives the loser, which\n * needs a Company Workspace. Then the promotion is dropped and the page is an\n * ordinary page again.\n *\n * A read and a write through one shape: with no `applied`, this ASKS what is\n * owed; with `applied`, it reports that the files have been written and are on\n * their way to the bucket. Two calls rather than one because only the workspace\n * can do the middle step, and only Baker can decide when the promotion is safe\n * to drop — which is after the build lands, never at Publish.\n */\nexport const experimentFoldRequestSchema = z.object({\n /** Which test to fold. Omitted ⇒ every fold this company owes. */\n experimentId: z.string().max(64).optional(),\n /** The files are written. Baker drops the promotion once the build lands. */\n applied: z.boolean().optional(),\n /**\n * Which of the owed folds were actually written, on an `applied` call.\n *\n * Folding is per page and one page failing must not hold back the others, so\n * a run that folds two of three has to be able to say which two. Without it\n * the report was \"the company\", every owed test was stamped as written, and\n * the one that failed had its promotion dropped when the build landed — so\n * its page served the version that LOST, with nothing owed and nothing\n * logged. Omitted ⇒ everything owed, which is the whole-company case.\n */\n experimentIds: z.array(z.string().max(64)).max(200).optional(),\n});\nexport type ExperimentFoldRequest = z.infer<typeof experimentFoldRequestSchema>;\n\nexport const experimentFoldTargetSchema = z.object({\n experimentId: z.string(),\n /** The page. Keeps its slug, its identity, its history and its ads. */\n landingSlug: z.string(),\n /** The variant folder, `<page>--<n>`. Gone from `src/pages/` afterwards. */\n variantSlug: z.string(),\n /** Which variant won, and therefore which files become the page's own. */\n survivor: z.union([z.literal(\"control\"), z.literal(\"variant\")]),\n /** For the archive path, which is keyed on identity rather than on a slug. */\n landingInternalId: z.string().nullable(),\n});\nexport type ExperimentFoldTarget = z.infer<typeof experimentFoldTargetSchema>;\n\nexport const experimentFoldResponseSchema = z.object({\n owed: z.array(experimentFoldTargetSchema),\n /** How many were recorded as written, when `applied` was set. */\n recorded: z.number().optional(),\n});\nexport type ExperimentFoldResponse = z.infer<typeof experimentFoldResponseSchema>;\n\nexport const experimentStatusValueSchema = z.enum([\"running\", \"paused\", \"finished\"]);\nexport type ExperimentStatusValue = z.infer<typeof experimentStatusValueSchema>;\n\nexport const experimentStatusRequestSchema = z.object({\n experimentId: z.string().max(64).optional(),\n /** Only the tests on one page, by its slug. */\n landingSlug: z.string().max(200).optional(),\n /** Only the tests in these states: `[\"running\", \"paused\"]` for the live ones. */\n status: z.array(experimentStatusValueSchema).min(1).optional(),\n full: z.boolean().optional(),\n});\nexport type ExperimentStatusRequest = z.infer<typeof experimentStatusRequestSchema>;\n\n/**\n * What was tested before, and what it taught — the record an agent reads\n * before proposing the next test.\n *\n * Finished tests only, newest first, optionally on one page. Every entry is\n * complete on its own: the claim, what was different, what the numbers said,\n * what was kept and whether that went against the numbers, and what was\n * learned. `plan` hands the same entries back for the page being planned, so\n * a test that repeats a refuted idea has to be chosen over the record rather\n * than in ignorance of it.\n */\nexport const experimentHistoryRequestSchema = z.object({\n landingSlug: z.string().max(200).optional(),\n limit: z.number().int().positive().max(100).optional(),\n});\nexport type ExperimentHistoryRequest = z.infer<typeof experimentHistoryRequestSchema>;\n\n/**\n * One of the company's conversions, as seen on the page over the sizing window.\n *\n * What `plan` hands back so a caller can choose a goal from what the page\n * actually produces rather than from what it hopes it produces.\n */\nexport const experimentPageConversionSchema = z.object({\n /** The event, by key — what `--goal` takes. */\n eventKey: z.string(),\n /** The conversion name the company counts it under, or null when nobody has named it. */\n name: z.string().nullable(),\n /** Distinct visitors to the page who went on to do this. */\n convertingVisitors: z.number(),\n});\nexport type ExperimentPageConversion = z.infer<typeof experimentPageConversionSchema>;\n\n/**\n * What a window of days could settle on this page's traffic.\n *\n * \"I have three weeks\" is the question a refusal leaves hanging. The plan\n * answers it for a few fixed windows so the caller can see the shape of the\n * trade — a bigger change needs fewer visitors — without asking again.\n */\nexport const experimentHorizonSchema = z.object({\n days: z.number(),\n /** The smallest relative lift detectable in that many days. `null` when none would be. */\n detectableLift: z.number().nullable(),\n});\nexport type ExperimentHorizon = z.infer<typeof experimentHorizonSchema>;\n\n/**\n * The windows every plan projects for. Two weeks is the shortest a landing-page\n * test should run; twelve weeks the longest one is allowed to be expected to.\n */\nexport const PLAN_HORIZON_DAYS = [14, 28, 56, 84] as const;\n\n/**\n * What to do instead of a test refused for its length: the smallest change\n * each window could settle, as a `--lift` to plan again with. It reaches the\n * agent as `error.fix` when `start` or `update` refuses, and as `fix` on a plan.\n */\nexport const experimentPlanFixSchema = z.object({\n action: z.string(),\n explanation: z.string(),\n /** `smallestLift` is `null` when the window settles nothing at any size of change. */\n windows: z.array(z.object({ weeks: z.number(), smallestLift: z.number().nullable() })),\n});\nexport type ExperimentPlanFix = z.infer<typeof experimentPlanFixSchema>;\n\n/**\n * The chat whose staged, unpublished test holds a page.\n *\n * Beside the refusal so the agent can name it and link it in one message: a\n * sentence alone sent it through `baker chats` to find which chat it meant.\n */\nexport const experimentBlockingChatSchema = z.object({\n chatId: z.string(),\n title: z.string(),\n createdAt: z.number(),\n status: chatInspectStatusSchema,\n /** Where a person opens it in Baker, to publish or drop it. */\n url: z.string(),\n});\nexport type ExperimentBlockingChat = z.infer<typeof experimentBlockingChatSchema>;\n\n/**\n * What a plan comes back with.\n *\n * `canRun` is the field to branch on. The numbers beside it are for printing —\n * an agent that reads `requiredPerVariant` and decides for itself is exactly\n * what the verdict shape elsewhere in this feature exists to prevent.\n */\nexport const experimentPlanResponseSchema = z.object({\n canRun: z.boolean(),\n /** Present when `canRun` is false. Product language, ready to show. */\n reason: z.string().optional(),\n /** Beside `reason` when the test would take too long: what could be settled instead. */\n fix: experimentPlanFixSchema.optional(),\n /** Beside `reason` when another chat's unpublished test holds the page. */\n blockedBy: experimentBlockingChatSchema.optional(),\n /** The event the test would be read on. Absent when none could be chosen. */\n goal: experimentGoalSchema.optional(),\n /** The new version's own event, when one was given. */\n variantGoal: experimentGoalSchema.optional(),\n /** Every event this page's visitors went on to do over the sizing window, most common first. */\n conversions: z.array(experimentPageConversionSchema),\n /** Distinct visitors the page had over the sizing window. `null` when the page is taken and was not read. */\n visitors: z.number().nullable(),\n baselineRate: z.number(),\n minDetectableRelativeLift: z.number(),\n /** `null` when no amount of traffic could settle the hypothesis. */\n requiredPerVariant: z.number().nullable(),\n /** Visitors a day the page has been getting, per arm once split. */\n dailyVisitorsPerVariant: z.number(),\n /** `null` when the page has no traffic to project from. */\n estimatedDays: z.number().nullable(),\n horizons: z.array(experimentHorizonSchema),\n /** `null` when the page is taken and was not read: not the same as `\"none\"`. */\n traffic: experimentTrafficSchema.nullable(),\n baselineSource: experimentBaselineSourceSchema,\n sizedOn: experimentSizedOnSchema,\n /**\n * Why the sizing is a guide rather than a measurement, when it is one.\n * Product language, ready to show; absent on a page with real traffic that\n * has produced the goal.\n */\n warning: z.string().optional(),\n /**\n * Every finished test on this page, newest first — see\n * `experimentHistoryEntrySchema`. On the plan because the plan is the moment\n * a hypothesis is chosen, and a page's own record is the first thing that\n * should inform it: a refuted idea proposed again, or a supported one never\n * built on, is what this exists to prevent.\n */\n pastTests: z.array(z.lazy(() => experimentHistoryEntrySchema)).default([]),\n});\nexport type ExperimentPlanResponse = z.infer<typeof experimentPlanResponseSchema>;\n\n/**\n * Planning every published page at once: which of them could settle a test.\n *\n * The same sizing `plan` runs for one page, on every page, in one request —\n * so ranking the pages is one call rather than a loop of them. What a single\n * page's plan needs (`--variant-goal`) has no meaning across pages.\n */\nexport const experimentPlanAllRequestSchema = experimentPlanRequestSchema.pick({\n goal: true,\n minDetectableRelativeLift: true,\n baselineRate: true,\n});\nexport type ExperimentPlanAllRequest = z.infer<typeof experimentPlanAllRequestSchema>;\n\n/** One page's plan, cut to what ranking the pages needs. `plan --landing <slug>` has the rest. */\nexport const experimentPagePlanSchema = z.object({\n landing: z.string(),\n canRun: z.boolean(),\n reason: z.string().optional(),\n goal: experimentGoalSchema.optional(),\n traffic: experimentTrafficSchema.nullable(),\n visitors: z.number().nullable(),\n blockedBy: experimentBlockingChatSchema.optional(),\n estimatedDays: z.number().nullable(),\n /** The smallest relative lift 28 days of this page's traffic could settle; `null` when none. */\n liftIn28Days: z.number().nullable(),\n warning: z.string().optional(),\n /** Set when no --goal was given and none could be chosen for the page: the events its visitors went on to. */\n goalChoices: z.array(z.string()).optional(),\n});\nexport type ExperimentPagePlan = z.infer<typeof experimentPagePlanSchema>;\n\n/** Every page, the ones that could run a test first and the quickest of those first. */\nexport const experimentPlanAllResponseSchema = z.object({ pages: z.array(experimentPagePlanSchema) });\nexport type ExperimentPlanAllResponse = z.infer<typeof experimentPlanAllResponseSchema>;\n\n/**\n * The verdict, and the evidence behind it.\n *\n * `verdict` is the only actionable field, and that is the whole design: an\n * agent handed `probabilityVariantBetter: 0.94` will find a reason to ship, and\n * an agent handed `keep_running` has nothing to argue with. Everything under\n * `evidence` exists to be printed to a person, never to be re-decided from.\n */\nexport const experimentVerdictSchema = z.enum([\n \"keep_running\",\n \"winner\",\n \"no_difference\",\n /**\n * Even the best case is under the lift the test was built to find, so there\n * is nothing left for it to discover: keep the original. The \"is this a\n * failure\" answer — not proven worse, but proven not worth running.\n */\n \"cannot_win\",\n \"invalid\",\n /**\n * Only on tests read before the stopping rule was one interval: a version\n * proven worse is now `winner` with `winner: \"control\"`, whenever it is seen.\n */\n \"stopped_early_harmful\",\n /**\n * Ended before the numbers could say anything. Never produced by the\n * stopping rule — only by ending a `keep_running` test.\n *\n * Its own verdict rather than folded into `no_difference`, because they are\n * opposite claims: one says the two versions were measured and found alike,\n * the other says nobody ever found out. Collapsing them would manufacture the\n * exact finding this feature exists to refuse.\n */\n \"inconclusive\",\n]);\nexport type ExperimentVerdict = z.infer<typeof experimentVerdictSchema>;\n\nexport const experimentArmSchema = z.object({\n slug: z.string(),\n visitors: z.number(),\n conversions: z.number(),\n rate: z.number(),\n /**\n * The page's own preview shot, so a reader can see which version this is.\n *\n * The landing's stored capture rather than anything taken for the test: it is\n * the picture the Landings screen already shows for that page, so the two\n * screens cannot show a client two different \"this is your offer page\".\n * `null` before the first capture, and on a page whose capture failed.\n */\n previewUrl: z.string().nullable().optional(),\n /**\n * This version as it was when the test started — the test's own capture,\n * taken off the live site once the split was being served.\n *\n * `previewUrl` above is the page as it is *today*, which is right while a\n * test runs and wrong the day after somebody edits the page, and absent\n * altogether for a variant that lost and was archived. This is the record;\n * a card prefers it and says which of the two it is showing.\n */\n snapshotUrl: z.string().nullable().optional(),\n snapshotCapturedAt: z.number().nullable().optional(),\n});\nexport type ExperimentArm = z.infer<typeof experimentArmSchema>;\n\n/**\n * One conversion the test did not decide on, read the same way the goal is.\n *\n * Every conversion the company has defined, other than the goal, comes back\n * like this. It carries the same anytime-valid interval the verdict is read\n * from, so a reader can see whether a variant that won on the goal moved\n * anything else — and `reading` says what the interval says, in one word, so\n * nobody has to eyeball two rates.\n *\n * What it deliberately does NOT carry is a verdict. A secondary that reads\n * `better` is context for the decision the goal already made, never a second\n * decision; a test read against six metrics is six tests with the confidence\n * of one.\n */\nexport const experimentMetricSchema = z.object({\n name: z.string(),\n control: z.object({ conversions: z.number(), rate: z.number() }),\n variant: z.object({ conversions: z.number(), rate: z.number() }),\n relativeLift: z.number(),\n /** The anytime-valid interval on the relative lift. */\n liftInterval: z.tuple([z.number(), z.number()]),\n /** `better` when the interval sits above zero, `worse` below it, `unclear` across it. */\n reading: z.enum([\"better\", \"worse\", \"unclear\"]),\n});\nexport type ExperimentMetric = z.infer<typeof experimentMetricSchema>;\n\n/**\n * One arm at one point in the test, as a RUNNING TOTAL.\n *\n * Cumulative rather than per-bucket, and that is the whole reason this exists\n * in a readable form. A daily conversion rate on a page with forty visitors a\n * day is noise — 0% Tuesday, 12% Wednesday — and a reader watching it cross\n * over and back learns nothing except how to mistrust the test. The running\n * rate is the quantity the verdict is actually about, and its last point is the\n * number printed on the card.\n *\n * `rate` is null until the arm has a visitor. A bucket before the test had\n * traffic is not a 0% conversion rate, and drawing it as one puts a cliff at\n * the left edge of every chart.\n */\nexport const experimentTimelineArmSchema = z.object({\n visitors: z.number(),\n conversions: z.number(),\n rate: z.number().nullable(),\n});\n\nexport const experimentTimelinePointSchema = z.object({\n /** Bucket start, ISO 8601. */\n bucket: z.string(),\n control: experimentTimelineArmSchema,\n variant: experimentTimelineArmSchema,\n});\nexport type ExperimentTimelinePoint = z.infer<typeof experimentTimelinePointSchema>;\n\nexport const experimentStatusRowSchema = z.object({\n experimentId: z.string(),\n landingSlug: z.string(),\n variantSlug: z.string(),\n hypothesis: experimentHypothesisSchema,\n /**\n * The hypothesis as one sentence, built from its parts plus the goal and the\n * lift on this same row. Rendered backend-side so what a client reads in chat\n * and what they read on the dashboard can never be two different sentences.\n */\n hypothesisStatement: z.string(),\n /**\n * What the test found out about the belief — derived from `verdict` and\n * `winner`, never entered.\n *\n * Its own field because the verdict and the outcome come apart in exactly the\n * case worth catching: a `winner` the *control* won is not a win, it is the\n * change having made things worse.\n */\n hypothesisOutcome: experimentHypothesisOutcomeSchema,\n /** What the two arms differ by. Absent for a test started before this was recorded. */\n composition: experimentCompositionSchema.optional(),\n /**\n * The finish line this test was sized for. On the row rather than only inside\n * the plan because the claim is not readable without it — \"leads should go up\"\n * is not a hypothesis, \"leads should go up by at least 20%\" is.\n */\n minDetectableRelativeLift: z.number(),\n /** The event the verdict is read from on the page, by key. */\n goal: experimentGoalSchema,\n /** The event the new version is read on, when it differs from `goal`. */\n variantGoal: experimentGoalSchema.nullable(),\n /** Both, in words a marketer reads — the Form's name, the moment. */\n goalLabel: z.string(),\n status: experimentStatusValueSchema,\n startedAt: z.number(),\n /** Set while paused. The split is off and everyone sees the original. */\n pausedAt: z.number().nullable(),\n /**\n * Published with the split off and never switched on: both versions are\n * live, nobody has been split, and the new version is reachable only by its\n * preview link. A `resume` starts the test, and dates it from then. Paused\n * too, so everything that reads `status` treats it as a pause; this only\n * changes what it is called. Defaulted for a backend from before it existed.\n */\n onHold: z.boolean().default(false),\n finishedAt: z.number().nullable(),\n verdict: experimentVerdictSchema,\n /** Set only on `winner`. Which version the numbers favour. */\n winner: z.enum([\"control\", \"variant\"]).nullable(),\n /**\n * Which version is live, once the test has ended. Chosen by whoever ended it,\n * and allowed to disagree with `winner` — the card says so when it does.\n */\n survivor: z.enum([\"control\", \"variant\"]).nullable(),\n /** Set only on `invalid`. Why the numbers cannot be read. */\n invalidReason: z.enum([\"sample_ratio_mismatch\", \"crossover\"]).nullable(),\n /**\n * Where the page's own content stands after the test, once it has ended.\n *\n * `owed` — the new variant was kept and is served by a rewrite; the page's\n * source still says otherwise. `landing` — the files are written and the\n * next publish carries them. `done` — the page's own content is the version\n * that was kept, and nothing routes either arm any more. `none` — the\n * original was kept, so there was never anything to move.\n *\n * On the row because two things on the card read it: whether \"open this\n * version\" links still show the right file, and whether there is anything\n * left for a person to do.\n */\n fold: z.enum([\"none\", \"owed\", \"landing\", \"done\"]).nullable(),\n /**\n * Whether `?_bkr_preview=a|b` still reaches both versions of the page.\n *\n * True for the whole life of a pair — running, paused, and after a finish\n * either way — and false only once the page has been folded to one version,\n * because that is when the other file leaves the repo and the bucket.\n *\n * Its own field rather than something read off `fold`, which answers a\n * different question and cannot answer this one: `fold` says `none` for\n * every test the original was kept on, folded or not. The card used to guess\n * from it and got both halves wrong — it withheld the links on every test the\n * original won, where both files were still there, and offered them on a\n * paused test, where the edge answered with the page under the other\n * version's name and nothing about it looked wrong.\n *\n * Defaulted for a backend deployed before the field existed; the dashboard\n * never reads one of those, and no agent-facing output carries it.\n */\n armsServed: z.boolean().default(true),\n /** What a person should be told, in one sentence, in product language. */\n summary: z.string(),\n /** What the test taught, once somebody wrote it down. Null until then, and always null while it runs. */\n learning: z.string().nullable(),\n /** Why it was ended, when whoever ended it said. Null while it runs. */\n endReason: experimentEndReasonSchema.nullable(),\n control: experimentArmSchema,\n variant: experimentArmSchema,\n /** Every other conversion the company counts, on the same two arms. */\n secondary: z.array(experimentMetricSchema),\n /**\n * How close this test is to being able to say anything at all, 0 to 1.\n *\n * Not progress toward a planned sample — there is no longer one to progress\n * toward. It is the traffic behind the test as a share of the traffic its own\n * measured variance says it needs, so it moves when the page gets noisier or\n * steadier rather than only when visitors arrive.\n */\n precision: z.number(),\n /** When the test could first say something. `null` with no traffic to project from. */\n earliestDecisionAt: z.number().nullable(),\n /**\n * What the test is still missing before its verdict changes, if the gap it\n * is seeing holds: visitors across both arms, and the conversions they bring.\n * A test is gated on data, never on days — `earliestDecisionAt` is only this\n * divided by the page's pace. Null once it has spoken, before anyone has\n * arrived, or when no amount of traffic would settle it.\n */\n stillNeeded: z.object({ visitors: z.number(), conversions: z.number() }).nullable().default(null),\n /**\n * True when no amount of this page's traffic would settle the comparison.\n * A different thing from a page that is merely slow, and the reason to end\n * a test rather than leave it running.\n */\n willNotConclude: z.boolean(),\n /**\n * How the two arms got where they are, one running total per bucket.\n *\n * Absent unless asked for, and only the dashboard asks. It is a picture, and\n * a picture costs an agent a page of numbers to read something the verdict\n * already told it in one word — the same reason everything else here is\n * compact by default.\n */\n timeline: z.array(experimentTimelinePointSchema).optional(),\n /** Printing only. Never a reason to act — `verdict` is. */\n evidence: z\n .object({\n relativeLift: z.number(),\n probabilityVariantBetter: z.number(),\n /**\n * How sure the numbers are that the two versions differ at all, 0 to 1.\n * Anytime-valid — the same construction the verdict is read from, so it\n * holds however often it is read — and a winner is called exactly when\n * it crosses 85%. The figure a card leads with.\n */\n confidence: z.number(),\n controlInterval: z.tuple([z.number(), z.number()]),\n variantInterval: z.tuple([z.number(), z.number()]),\n /** The anytime-valid interval on the relative lift — what the verdict is read from. */\n liftInterval: z.tuple([z.number(), z.number()]),\n })\n .optional(),\n});\nexport type ExperimentStatusRow = z.infer<typeof experimentStatusRowSchema>;\n\nexport const experimentStatusResponseSchema = z.object({\n experiments: z.array(experimentStatusRowSchema),\n});\nexport type ExperimentStatusResponse = z.infer<typeof experimentStatusResponseSchema>;\n\n/**\n * One finished test, as the record of it.\n *\n * Shaped for the reader who was not there: the claim in full, what the two\n * versions differed by, what the numbers said, what was kept and whether that\n * went against them, and what was learned. Everything on it is settled — a\n * running test is not history and never appears here.\n */\nexport const experimentHistoryEntrySchema = z.object({\n experimentId: z.string(),\n landingSlug: z.string(),\n variantSlug: z.string(),\n startedAt: z.number(),\n finishedAt: z.number(),\n /** Days the split ran, whole. */\n ranForDays: z.number(),\n hypothesis: experimentHypothesisSchema,\n hypothesisStatement: z.string(),\n /** The sections the new version owned, as labels — what was actually different. */\n changed: z.array(z.string()),\n goal: experimentGoalSchema,\n variantGoal: experimentGoalSchema.nullable(),\n goalLabel: z.string(),\n verdict: experimentVerdictSchema,\n /** Which version the numbers favoured, on `winner`. */\n winner: z.enum([\"control\", \"variant\"]).nullable(),\n /** Which version kept the traffic. */\n survivor: z.enum([\"control\", \"variant\"]),\n /** True when what was kept is not what the numbers favoured. */\n againstVerdict: z.boolean(),\n hypothesisOutcome: experimentHypothesisOutcomeSchema,\n /** The numbers, as they were when the test ended. */\n result: z.object({\n control: z.object({ visitors: z.number(), conversions: z.number(), rate: z.number() }),\n variant: z.object({ visitors: z.number(), conversions: z.number(), rate: z.number() }),\n relativeLift: z.number(),\n liftInterval: z.tuple([z.number(), z.number()]),\n confidence: z.number(),\n secondary: z.array(experimentMetricSchema),\n }),\n summary: z.string(),\n /** Why it was ended, when whoever ended it said. */\n endReason: experimentEndReasonSchema.nullable(),\n /** What the test taught, or null when nobody has written it down yet. */\n learning: z.string().nullable(),\n});\nexport type ExperimentHistoryEntry = z.infer<typeof experimentHistoryEntrySchema>;\n\nexport const experimentHistoryResponseSchema = z.object({\n tests: z.array(experimentHistoryEntrySchema),\n});\nexport type ExperimentHistoryResponse = z.infer<typeof experimentHistoryResponseSchema>;\n\n/** What ending a test hands back: what the numbers said, and what was kept. */\nexport const experimentFinishResponseSchema = z.object({\n verdict: experimentVerdictSchema,\n survivor: z.enum([\"control\", \"variant\"]),\n /** True when `keep` went against a verdict the numbers had reached. */\n againstVerdict: z.boolean(),\n summary: z.string(),\n});\nexport type ExperimentFinishResponse = z.infer<typeof experimentFinishResponseSchema>;\n","import {\n type ExperimentFinishResponse,\n type ExperimentFoldResponse,\n type ExperimentHistoryResponse,\n type ExperimentPlanAllResponse,\n type ExperimentPlanResponse,\n type ExperimentStatusResponse,\n type ExperimentUpdateResponse,\n experimentStatusValueSchema,\n} from \"@baker/api/experiments\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiPost } from \"../../client.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { writeJsonEnvelope } from \"../ads/output.ts\";\nimport { formsOnlyIn, readComposition, readForms } from \"./composition.ts\";\nimport { type FoldResult, foldExperiment } from \"./fold.ts\";\nimport { buildHistoryHints, buildPlanAllHints, buildPlanHints, buildStartHints } from \"./hints.ts\";\nimport { parseEvidence } from \"./hypothesis.ts\";\nimport { readPageInternalId } from \"./identity.ts\";\nimport { readMeasurementDrift } from \"./measurement.ts\";\nimport { statusEnvelope } from \"./readout.ts\";\nimport { firstTimeInChat } from \"./said-in-chat.ts\";\nimport { buildUpdateRequest } from \"./update.ts\";\n\nconst GOAL_ARG = {\n type: \"string\",\n description:\n \"The ONE event the test is read on, by its key: `form:<flow>:<node>:<trigger>` (a Form reaching a step), `submit:<flow>` (a Form finished), `page:<name>` (a page event or one the client's systems post), `exit:<host>` (a click out). `baker analytics conversions --candidates` lists the keys these pages produce, and `plan` lists the ones this page's visitors went on to do. Fixed for the life of the test. Optional when exactly one of them is a named conversion; otherwise say which. Every conversion the company has named is reported beside the goal and decides nothing.\",\n required: false,\n} as const;\n\nconst VARIANT_GOAL_ARG = {\n type: \"string\",\n description:\n \"The event the NEW version is read on, when it is not the page's — a variant that swaps the Form for a shorter one converts on the new Form's ending (`submit:<new-flow>`, or its confirmation step's `form:` key). Same vocabulary as --goal. Leave it out when both versions convert on the same event, which is the common case.\",\n required: false,\n} as const;\n\nconst LIFT_ARG = {\n type: \"string\",\n description:\n \"The smallest improvement worth detecting, relative — 0.2 is +20% (default). The single most consequential number here: halving it roughly quadruples the traffic needed. Ask for the smallest lift that would actually change what the client does, not the smallest one you would like to see.\",\n required: false,\n} as const;\n\n/**\n * The hypothesis, in parts.\n *\n * Not one `--hypothesis` sentence, and the reason is not tidiness: the change,\n * the metric and the magnitude are already `--variant`, `--goal` and `--lift`\n * on this same command. A sentence restating them can disagree with them and\n * nothing would notice, while the one part with nowhere else to live — what was\n * observed that makes this worth testing — gets buried inside it.\n */\nconst BECAUSE_ARG = {\n type: \"string\",\n description:\n \"What you SAW that makes this worth testing — the observation, not the change. “60% of visitors never scroll past the hero”, “CPL doubled after the new headline”. This is the field that makes a losing test worth something: without it there is no belief for the result to be evidence against, and the next test is no better informed than this one.\",\n required: true,\n} as const;\n\nconst CHANGE_ARG = {\n type: \"string\",\n description:\n \"What is different about the alternative version, in the client's words — “put the booking form in the hero”. One thing. Say it as the reader of the report would.\",\n required: true,\n} as const;\n\nconst EXPECT_ARG = {\n type: \"string\",\n description:\n \"Which way you expect the goal to move: `increase` (default) or `decrease`. This is what lets Baker report whether your hypothesis HELD, rather than only which page won — a test the original page wins is not a win, it is the change having made things worse, and that is the most useful thing a test can tell you.\",\n required: false,\n} as const;\n\nconst EVIDENCE_ARG = {\n type: \"string\",\n description:\n \"Where the observation came from, as `source:what it showed`, optionally `|link`. Repeatable. Sources: baker_analytics, clarity, ads, search_console, research, inspiration, client, hunch. Use `hunch` honestly when there is no data — a stated guess is worth more than a guess dressed as analytics.\",\n required: false,\n} as const;\n\nconst HOLD_ARG = {\n type: \"boolean\",\n required: false,\n description:\n \"Publish both versions with the split off, so the client can look at the new version by its link (`/<page>/?_bkr_preview=b`) before any visitor is sent to it. Switch it on afterwards with `baker experiment resume --id <id>`. Use it whenever somebody has to approve the new version first.\",\n} as const;\n\nconst BASELINE_ARG = {\n type: \"string\",\n description:\n \"The share of visitors you expect to do the goal, as a fraction — 0.05 is 5% — for a page whose history cannot say: a new page, or one about to get its first campaign. Without it a page with no conversions yet is sized on the company-wide rate for the outcome, or on 3%. The sizing is a guide either way: the test runs until the numbers are clear.\",\n required: false,\n} as const;\n\nconst ID_ARG = { type: \"string\", description: \"The test, by its id\", required: true } as const;\n\nconst LEARNING_ARG = {\n type: \"string\",\n description:\n \"What this test taught, in one or two sentences the client should believe about this page from now on — “the price is not the objection, the install date is”. The one part of the record the numbers cannot write, and what `plan` hands the next test on this page. Finished tests only.\",\n required: false,\n} as const;\n\nconst REASON_ARG = {\n type: \"string\",\n description:\n \"Why the test is being ended, as distinct from what the numbers said: `numbers_clear` (the result was clear enough to act on), `not_settling` (too little traffic or too small a difference — waiting would not help), `page_changing` (the page has to change for another reason), `test_flawed` (the wrong goal, a broken variant). Always say — the dashboard asks a person the same question, and the next test on this page is planned differently after each answer.\",\n required: false,\n} as const;\n\nconst LANDING_FILTER_ARG = {\n type: \"string\",\n description: \"Only the tests on one page, by its slug\",\n required: false,\n} as const;\n\nconst STATUS_FILTER_ARG = {\n type: \"string\",\n description:\n \"Only the tests in these states, comma-separated: running, paused, finished. `--status running,paused` answers what is live now\",\n required: false,\n} as const;\n\n/**\n * The sizing stood on a stand-in. Said at start as well as at plan, because\n * the agent tells the client how long it will take from whichever of the two\n * it read last.\n */\nfunction sizingHints(data: Record<string, unknown>): string[] {\n return typeof data.warning === \"string\" ? [data.warning] : [];\n}\n\nfunction fail(message: string): never {\n writeJsonEnvelope({ ok: false, error: { code: \"VALIDATION_ERROR\", message } });\n process.exit(1);\n}\n\nfunction reportApiError(error: unknown): never {\n if (error instanceof ApiError) {\n writeJsonEnvelope({\n ok: false,\n error: { code: error.code ?? \"ERROR\", message: error.message, ...(error.fix ? { fix: error.fix } : {}) },\n });\n process.exit(1);\n }\n throw error;\n}\n\nconst PLAN_VARIANT_ARG = {\n type: \"string\",\n description:\n \"The new variant's slug, `<page>--<n>`, once it exists. Leave it out before building: `baker landings variant` chooses the slug, and the sizing depends on the page alone\",\n required: false,\n} as const;\n\nconst PLAN_LANDING_ARG = {\n type: \"string\",\n description: \"The page under test, by slug. Or `--all` for every page\",\n required: false,\n} as const;\n\nconst PLAN_ALL_ARG = {\n type: \"boolean\",\n description:\n \"Every published page at once, in one call: which of them could settle a test, the quickest first — one compact row per page (`canRun`, `traffic`, `estimatedDays`, `liftIn28Days`, `reason`). Use it to choose WHICH page to test, then `plan --landing <slug>` on that one for the full sizing and its past tests. Takes --goal, --lift and --baseline, applied to every page\",\n required: false,\n} as const;\n\nregisterSchema({\n command: \"experiment.plan\",\n routes: [\"POST /api/experiments/plan\", \"POST /api/experiments/plan-all\"],\n effect: \"read\",\n description: \"Whether a page can settle a question, and how long it might take, before anything is built\",\n args: {\n landing: PLAN_LANDING_ARG,\n all: PLAN_ALL_ARG,\n variant: PLAN_VARIANT_ARG,\n goal: GOAL_ARG,\n variantGoal: VARIANT_GOAL_ARG,\n lift: LIFT_ARG,\n baseline: BASELINE_ARG,\n },\n});\n\n/** The sizing options every plan takes, present only when asked for. */\nfunction sizingOptions(args: { goal?: unknown; lift?: unknown; baseline?: unknown }) {\n return {\n ...(args.goal ? { goal: String(args.goal) } : {}),\n ...(args.lift ? { minDetectableRelativeLift: Number(args.lift) } : {}),\n ...(args.baseline ? { baselineRate: Number(args.baseline) } : {}),\n };\n}\n\n/** Every page in one request — choosing which page to test is one call, not one per page. */\nasync function planAllPages(args: { goal?: unknown; lift?: unknown; baseline?: unknown }): Promise<void> {\n try {\n const response = await apiPost<{ ok: true; data: ExperimentPlanAllResponse }>(\n \"/api/experiments/plan-all\",\n sizingOptions(args),\n );\n writeJsonEnvelope({ ok: true, data: response.data, hints: buildPlanAllHints(response.data.pages) });\n } catch (error) {\n reportApiError(error);\n }\n}\n\n/**\n * A re-size of a page this chat already planned: `conversions` is the page's over the\n * sizing window, the same whatever the goal or lift, and on a busy page it was most of\n * the output (BAKER-1992).\n */\nfunction withoutConversions(plan: ExperimentPlanResponse): Omit<ExperimentPlanResponse, \"conversions\"> {\n const { conversions: _conversions, ...sizing } = plan;\n return sizing;\n}\n\nconst planCommand = defineCommand({\n meta: {\n name: \"plan\",\n description:\n \"Start here, BEFORE building the alternative page. Says which event the test would be read on, which events the page's visitors actually go on to do (by key, with the conversion name each is counted under), how long it might take at this page's traffic, and what a 14, 28, 56 or 84-day window could settle. The duration is a guide, never a finish line — a test ends when the numbers are clear, and a page with no traffic yet can still be tested (`warning` says what it was sized on). What IS refused is a test that could not be measured (a goal this page has demonstrably never produced) and one expected to take longer than 12 weeks at this page's traffic — the refusal says what change 4, 8 and 12 weeks could settle.\",\n },\n args: {\n landing: PLAN_LANDING_ARG,\n all: PLAN_ALL_ARG,\n variant: PLAN_VARIANT_ARG,\n goal: GOAL_ARG,\n variantGoal: VARIANT_GOAL_ARG,\n lift: LIFT_ARG,\n baseline: BASELINE_ARG,\n },\n run: async ({ args }) => {\n if (args.all === true) {\n if (args.landing || args.variant || args.variantGoal) {\n fail(\"`--all` plans every page; leave out --landing, --variant and --variant-goal, or drop --all\");\n }\n return planAllPages(args);\n }\n if (!args.landing) fail(\"Say which page with `--landing <slug>`, or `--all` to plan every page at once\");\n try {\n const response = await apiPost<{ ok: true; data: ExperimentPlanResponse }>(\"/api/experiments/plan\", {\n landingSlug: String(args.landing),\n ...(args.variant ? { variantSlug: String(args.variant) } : {}),\n ...(args.variantGoal ? { variantGoal: String(args.variantGoal) } : {}),\n ...sizingOptions(args),\n });\n const firstInChat = !response.data.canRun || firstTimeInChat(`experiment plan: ${String(args.landing)}`);\n writeJsonEnvelope({\n ok: true,\n data: firstInChat ? response.data : withoutConversions(response.data),\n hints: buildPlanHints(response.data, firstInChat),\n });\n } catch (error) {\n reportApiError(error);\n }\n },\n});\n\nregisterSchema({\n command: \"experiment.start\",\n description: \"Stage an A/B test between a page and a new variant of it\",\n args: {\n landing: { type: \"string\", description: \"The page under test, by slug\", required: true },\n variant: { type: \"string\", description: \"The new variant's slug, `<page>--<n>`\", required: true },\n because: BECAUSE_ARG,\n change: CHANGE_ARG,\n expect: EXPECT_ARG,\n evidence: EVIDENCE_ARG,\n goal: GOAL_ARG,\n variantGoal: VARIANT_GOAL_ARG,\n lift: LIFT_ARG,\n baseline: BASELINE_ARG,\n hold: HOLD_ARG,\n },\n});\n\n/** The optional parts of a start request, present only when asked for. */\nfunction startOptions(args: {\n goal?: unknown;\n variantGoal?: unknown;\n lift?: unknown;\n baseline?: unknown;\n hold?: unknown;\n}) {\n return {\n ...(args.goal ? { goal: String(args.goal) } : {}),\n ...(args.variantGoal ? { variantGoal: String(args.variantGoal) } : {}),\n ...(args.lift ? { minDetectableRelativeLift: Number(args.lift) } : {}),\n ...(args.baseline ? { baselineRate: Number(args.baseline) } : {}),\n ...(args.hold ? { held: true } : {}),\n };\n}\n\n/** What happens at Publish, said once the start is staged. */\nfunction stagedHint(held: boolean, landing: string): string {\n return held\n ? `Staged on hold. Publishing puts both versions live but splits nobody: everyone keeps getting the page, and the new version opens only at /${landing}/?_bkr_preview=b — send that link to whoever has to approve it, and say that anyone with it can open it (it is not a private link). Once they have, \\`baker experiment status --landing ${landing}\\` gives the test's id and \\`baker experiment resume --id <id>\\` switches the split on; the test is dated from then.`\n : \"Staged. The split starts when this session is published — publishing is the review of the new variant.\";\n}\n\nconst startCommand = defineCommand({\n meta: {\n name: \"start\",\n description:\n \"Stage a test between the page and its new variant. Visitors are split between the two versions at the edge, so there is no flicker and nothing for an ad blocker to suppress. Nothing goes live until the session is published — the person publishing is the review of the new variant. Re-runs `plan` first and refuses on the same grounds.\",\n },\n args: {\n landing: { type: \"string\", description: \"The page under test, by slug\", required: true },\n variant: { type: \"string\", description: \"The new variant's slug, `<page>--<n>`\", required: true },\n because: BECAUSE_ARG,\n change: CHANGE_ARG,\n expect: EXPECT_ARG,\n evidence: EVIDENCE_ARG,\n goal: GOAL_ARG,\n variantGoal: VARIANT_GOAL_ARG,\n lift: LIFT_ARG,\n baseline: BASELINE_ARG,\n hold: HOLD_ARG,\n },\n run: async ({ args, rawArgs }) => {\n const expect = args.expect === undefined ? \"increase\" : String(args.expect);\n if (expect !== \"increase\" && expect !== \"decrease\") {\n fail(\"`--expect` is either `increase` or `decrease` — which way should the goal move if you are right?\");\n }\n const evidence = parseEvidence(args.evidence as string | string[] | undefined, rawArgs);\n if (evidence && \"error\" in evidence) fail(evidence.error);\n\n const { composition, newForms, drift, landingInternalId, variantInternalId } = await readStartContext(\n String(args.landing),\n String(args.variant),\n );\n\n try {\n const response = await apiPost<{ ok: true; data: Record<string, unknown> }>(\"/api/experiments/start\", {\n landingSlug: String(args.landing),\n variantSlug: String(args.variant),\n ...(landingInternalId ? { landingInternalId } : {}),\n ...(variantInternalId ? { variantInternalId } : {}),\n hypothesis: {\n because: String(args.because),\n change: String(args.change),\n expect,\n ...(evidence ? { evidence } : {}),\n },\n ...(composition ? { composition } : {}),\n ...startOptions(args),\n });\n writeJsonEnvelope({\n ok: true,\n data: response.data,\n hints: [\n ...sizingHints(response.data),\n ...buildStartHints({\n landing: String(args.landing),\n variant: String(args.variant),\n goal: String(response.data.goal),\n variantGoal: args.variantGoal === undefined ? undefined : String(args.variantGoal),\n composition,\n newForms,\n drift,\n }),\n stagedHint(Boolean(args.hold), String(args.landing)),\n \"Check it as often as you like — `baker experiment status` is safe to read at any moment and holds its error rate however often you ask. What is never safe is reading the numbers instead of the verdict: `keep_running` means this test cannot yet tell the two pages apart, whatever the rates happen to say today.\",\n ],\n });\n } catch (error) {\n reportApiError(error);\n }\n },\n});\n\nregisterSchema({\n command: \"experiment.status\",\n routes: [\"POST /api/experiments/status\"],\n effect: \"read\",\n description: \"The verdict on every A/B test, running, paused and finished\",\n args: {\n id: { type: \"string\", description: \"One test, by its id\", required: false },\n landing: LANDING_FILTER_ARG,\n status: STATUS_FILTER_ARG,\n full: {\n type: \"boolean\",\n description:\n \"Every field the dashboard reads too — the hypothesis, the goal's key, a finished test's learning, what each version owns, the preview pictures and the posteriors behind the verdict\",\n required: false,\n },\n },\n});\n\nconst statusCommand = defineCommand({\n meta: {\n name: \"status\",\n description:\n \"The verdict on each test. Read `verdict` and nothing else to decide: keep_running | winner | no_difference | cannot_win | invalid. `cannot_win` means even the best case is under the lift the test was looking for — end it and keep the original. `stillNeeded` is the data (visitors, conversions) the test still needs; a test is gated on data, never on days. `earliestDecisionAt` is the day this page's traffic would get it there (YYYY-MM-DD) and `earliestDecisionIn` how far off that is — say those, never work a date out yourself. `summary` is one sentence you can show the client, and `secondary` lists every other conversion the company counts on the same two arms — context, never a second decision. `--status running,paused` answers what is live now. The hypothesis sentence, the goal's key and a finished test's learning are under `--full` (the record of finished tests is `baker experiment history`). The numbers under `--full` are for printing, never for deciding — a test that says keep_running has not finished, however good its numbers look.\",\n },\n args: {\n id: { type: \"string\", description: \"One test, by its id\", required: false },\n landing: LANDING_FILTER_ARG,\n status: STATUS_FILTER_ARG,\n full: {\n type: \"boolean\",\n description:\n \"Every field the dashboard reads too — the hypothesis, the goal's key, a finished test's learning, what each version owns, the preview pictures and the posteriors behind the verdict\",\n required: false,\n },\n },\n run: async ({ args }) => {\n const status = args.status\n ? experimentStatusValueSchema\n .array()\n .min(1)\n .safeParse(\n String(args.status)\n .split(\",\")\n .map((value) => value.trim())\n .filter((value) => value.length > 0),\n )\n : undefined;\n if (status && !status.success) {\n fail(`--status takes running, paused or finished, comma-separated (got \"${String(args.status)}\")`);\n }\n try {\n const response = await apiPost<{ ok: true; data: ExperimentStatusResponse }>(\"/api/experiments/status\", {\n ...(args.id ? { experimentId: String(args.id) } : {}),\n ...(args.landing ? { landingSlug: String(args.landing) } : {}),\n ...(status?.success ? { status: status.data } : {}),\n ...(args.full === true ? { full: true } : {}),\n });\n writeJsonEnvelope(\n statusEnvelope(response.data.experiments, {\n full: args.full === true,\n now: Date.now(),\n ...(status?.success ? { statuses: status.data } : {}),\n }),\n );\n } catch (error) {\n reportApiError(error);\n }\n },\n});\n\nregisterSchema({\n command: \"experiment.history\",\n routes: [\"POST /api/experiments/history\"],\n effect: \"read\",\n description:\n \"Every finished A/B test with what it found and what it taught — the record to read before proposing the next one\",\n args: {\n landing: LANDING_FILTER_ARG,\n limit: { type: \"string\", description: \"At most this many, newest first (default all)\", required: false },\n },\n});\n\nconst historyCommand = defineCommand({\n meta: {\n name: \"history\",\n description:\n \"What was tested before and what it taught. Finished tests only, newest first: the claim, what was different, what the numbers said, what was kept and whether that went against them, and the `learning` somebody wrote down. Read it — `--landing <slug>` for one page — BEFORE proposing a test: a refuted idea proposed again spends the page's traffic to return the same answer, and a supported one is what the next test should build on. `plan` hands the same entries back as `pastTests` for the page it sizes.\",\n },\n args: {\n landing: LANDING_FILTER_ARG,\n limit: { type: \"string\", description: \"At most this many, newest first\", required: false },\n },\n run: async ({ args }) => {\n const limit = args.limit === undefined ? undefined : Number(args.limit);\n if (limit !== undefined && !(Number.isInteger(limit) && limit > 0)) fail(\"`--limit` is a whole number above zero\");\n try {\n const response = await apiPost<{ ok: true; data: ExperimentHistoryResponse }>(\"/api/experiments/history\", {\n ...(args.landing ? { landingSlug: String(args.landing) } : {}),\n ...(limit === undefined ? {} : { limit }),\n });\n writeJsonEnvelope({\n ok: true,\n data: response.data,\n hints: buildHistoryHints(response.data.tests, args.landing === undefined ? undefined : String(args.landing)),\n });\n } catch (error) {\n reportApiError(error);\n }\n },\n});\n\nregisterSchema({\n command: \"experiment.finish\",\n description: \"End a test now and send all its traffic to the version you name\",\n args: {\n id: ID_ARG,\n keep: {\n type: \"string\",\n description:\n \"Which version stays live: `original` or `variant`. Required — the verdict is a recommendation and this is the decision. A test that has not concluded can be ended too; it is recorded as inconclusive, never as a finding. Going against a verdict is allowed and is recorded as such.\",\n required: true,\n },\n reason: REASON_ARG,\n learning: LEARNING_ARG,\n },\n});\n\nconst END_REASONS = [\"numbers_clear\", \"not_settling\", \"page_changing\", \"test_flawed\"] as const;\n\n/** What to do next, once a test has ended. */\nfunction finishHints(\n data: ExperimentFinishResponse,\n given: { reason: string | undefined; learning: unknown },\n): string[] {\n const { reason } = given;\n const args = { learning: given.learning };\n return [\n `Done. Everyone now sees the ${data.survivor === \"variant\" ? \"new variant\" : \"original\"}.`,\n ...(data.againstVerdict\n ? [\n `You kept the ${data.survivor === \"variant\" ? \"new variant\" : \"original\"} although the numbers favoured the other version (${data.verdict}). That is recorded on the test — say why in the write-up.`,\n ]\n : []),\n ...(data.verdict === \"keep_running\"\n ? [\n \"This test had not concluded, so it is recorded as inconclusive — nobody found out. Never report it as no difference.\",\n ]\n : []),\n ...(data.survivor === \"variant\"\n ? [\n \"Now run `baker experiment fold` — it moves the winning version into the page itself and archives the other one. Until that lands the page is served by a rewrite, and it cannot be tested again.\",\n ]\n : []),\n ...(args.learning || data.verdict === \"keep_running\"\n ? []\n : [\n 'Write down what this taught while it is fresh: `baker experiment update --id <id> --learning \"…\"` — one or two sentences the client should believe about this page now. It is what the next test on this page starts from.',\n ]),\n ...(reason\n ? []\n : [\n \"No `--reason` was given, so the record says what the numbers had reached but not why anyone stopped looking. Next time pass one: numbers_clear, not_settling, page_changing or test_flawed.\",\n ]),\n ];\n}\n\nconst finishCommand = defineCommand({\n meta: {\n name: \"finish\",\n description:\n \"End a test now and send all its traffic to the version you name. Takes effect within seconds — nothing to publish. Read `baker experiment status` first: `winner` says which version the numbers favour, `keep_running` means they have not spoken yet and ending records `inconclusive`. Keeping the variant owes a `fold`. A test staged in this session and not yet published is simply taken back off it.\",\n },\n args: {\n id: ID_ARG,\n keep: {\n type: \"string\",\n description: \"Which version stays live: `original` or `variant`.\",\n required: true,\n },\n reason: REASON_ARG,\n learning: LEARNING_ARG,\n },\n run: async ({ args }) => {\n const keep = String(args.keep);\n if (keep !== \"original\" && keep !== \"variant\") {\n fail(\"`--keep` is either `original` or `variant` — which version should everyone see from now on?\");\n }\n const reason = args.reason === undefined ? undefined : String(args.reason);\n if (reason !== undefined && !END_REASONS.some((known) => known === reason)) {\n fail(`\\`--reason\\` is one of ${END_REASONS.join(\", \")} — why is this test being ended?`);\n }\n try {\n const response = await apiPost<{ ok: true; data: ExperimentFinishResponse | { unstaged: true } }>(\n \"/api/experiments/finish\",\n {\n experimentId: String(args.id),\n keep,\n ...(reason ? { reason } : {}),\n ...(args.learning ? { learning: String(args.learning) } : {}),\n },\n );\n if (\"unstaged\" in response.data) {\n writeJsonEnvelope({\n ok: true,\n data: response.data,\n hints: [\"That test had not been published yet, so it was taken back off this session. Nothing was split.\"],\n });\n return;\n }\n const data = response.data;\n writeJsonEnvelope({ ok: true, data, hints: finishHints(data, { reason, learning: args.learning }) });\n } catch (error) {\n reportApiError(error);\n }\n },\n});\n\nregisterSchema({\n command: \"experiment.cancel\",\n description: \"Call a test off — take a staged one back off the session, or end a live one keeping the original\",\n args: { id: ID_ARG },\n});\n\nconst cancelCommand = defineCommand({\n meta: {\n name: \"cancel\",\n description:\n \"Call a test off. A test staged in this session and not yet published is simply taken back off it — nothing was split. A test that is live is ended now with everyone sent back to the original: what the numbers had said is recorded as it stood (usually `inconclusive`), and the variant page stays in the workspace, unserved. `finish --keep` is the same act with the choice of version; this is the shortcut for “stop, keep the page as it is”.\",\n },\n args: { id: ID_ARG },\n run: async ({ args }) => {\n try {\n const response = await apiPost<{ ok: true; data: ExperimentFinishResponse | { unstaged: true } }>(\n \"/api/experiments/finish\",\n { experimentId: String(args.id), keep: \"original\" },\n );\n if (\"unstaged\" in response.data) {\n writeJsonEnvelope({\n ok: true,\n data: response.data,\n hints: [\"That test had not been published yet, so it was taken back off this session. Nothing was split.\"],\n });\n return;\n }\n const data = response.data;\n writeJsonEnvelope({\n ok: true,\n data,\n hints: [\n \"Ended. Everyone sees the original page now, and the split stopped within seconds.\",\n ...(data.verdict === \"keep_running\"\n ? [\n \"It had not concluded, so it is recorded as inconclusive — nobody found out. Never report it as no difference.\",\n ]\n : data.againstVerdict\n ? [\n `The numbers favoured the new variant (${data.verdict}), so this is recorded as a decision against them. Say why in the write-up.`,\n ]\n : []),\n \"The variant page is still in the workspace and served to nobody. Run `baker experiment fold` to archive it, or leave it for a later test.\",\n ],\n });\n } catch (error) {\n reportApiError(error);\n }\n },\n});\n\nregisterSchema({\n command: \"experiment.update\",\n description:\n \"Change what a test says about itself — its wording always, its measurement only while it is still staged\",\n args: {\n id: ID_ARG,\n because: { ...BECAUSE_ARG, required: false },\n change: { ...CHANGE_ARG, required: false },\n evidence: EVIDENCE_ARG,\n expect: { ...EXPECT_ARG, description: \"Staged tests only. `increase` or `decrease`.\" },\n goal: { ...GOAL_ARG, description: \"Staged tests only. The event the test is read on, by key.\" },\n variantGoal: {\n ...VARIANT_GOAL_ARG,\n description: \"Staged tests only. The new version's own event, when it differs.\",\n },\n lift: { ...LIFT_ARG, description: \"Staged tests only. The smallest lift worth detecting.\" },\n learning: LEARNING_ARG,\n },\n});\n\nconst updateCommand = defineCommand({\n meta: {\n name: \"update\",\n description:\n \"Change what a test says about itself. The observation (`--because`), the change in the client's words (`--change`) and the evidence cited (`--evidence`) can change at any time — they describe the test, and a write-up corrected after the fact is still the write-up of the same test. On a FINISHED test, `--learning` writes down what it taught. What the test MEASURES — `--goal`, `--lift`, `--expect` — can only change while it is still staged in this session: once visitors have been split, moving the goal or the finish line is how a result gets argued into existence. To measure something else on a live test, `finish` it and start a new one.\",\n },\n args: {\n id: ID_ARG,\n because: { ...BECAUSE_ARG, required: false },\n change: { ...CHANGE_ARG, required: false },\n evidence: EVIDENCE_ARG,\n expect: { ...EXPECT_ARG, description: \"Staged tests only. `increase` or `decrease`.\" },\n goal: { ...GOAL_ARG, description: \"Staged tests only. The event the test is read on, by key.\" },\n variantGoal: {\n ...VARIANT_GOAL_ARG,\n description: \"Staged tests only. The new version's own event, when it differs.\",\n },\n lift: { ...LIFT_ARG, description: \"Staged tests only. The smallest lift worth detecting.\" },\n learning: LEARNING_ARG,\n },\n run: async ({ args, rawArgs }) => {\n const request = buildUpdateRequest(args, rawArgs);\n if (\"error\" in request) fail(request.error);\n try {\n const response = await apiPost<{ ok: true; data: ExperimentUpdateResponse }>(\"/api/experiments/update\", request);\n writeJsonEnvelope({\n ok: true,\n data: response.data,\n hints: [\n response.data.staged\n ? \"Updated and re-sized. It still starts when this session is published.\"\n : request.learning !== undefined\n ? \"Updated. What this test taught is on its record now, and `plan` hands it to the next test on this page.\"\n : \"Updated. The test keeps running exactly as it was — only its wording changed.\",\n `It now reads: ${response.data.hypothesisStatement}`,\n ],\n });\n } catch (error) {\n reportApiError(error);\n }\n },\n});\n\nregisterSchema({\n command: \"experiment.pause\",\n description: \"Switch a test's split off — everyone sees the original until it is resumed\",\n args: { id: ID_ARG },\n});\n\nconst pauseCommand = defineCommand({\n meta: {\n name: \"pause\",\n description:\n \"Switch the split off now. Everyone sees the original; visitors already assigned keep their side, so resuming continues the same test rather than starting a new one. Use it when the new variant has to come down for a while — a broken price, a campaign that needs the original — without throwing the test away.\",\n },\n args: { id: ID_ARG },\n run: async ({ args }) => {\n try {\n await apiPost(\"/api/experiments/pause\", { experimentId: String(args.id) });\n writeJsonEnvelope({\n ok: true,\n data: { paused: true },\n hints: [\n `Paused. Everyone sees the original page now. \\`baker experiment resume --id ${String(args.id)}\\` restarts the split with the same sides.`,\n ],\n });\n } catch (error) {\n reportApiError(error);\n }\n },\n});\n\nregisterSchema({\n command: \"experiment.resume\",\n description:\n \"Switch a paused test's split back on — or, for a test published on hold, switch it on for the first time\",\n args: { id: ID_ARG },\n});\n\nconst resumeCommand = defineCommand({\n meta: {\n name: \"resume\",\n description:\n \"Switch a paused test's split back on. Visitors already assigned see the same side they saw before. A test published on hold (`start --hold`) starts here, and is dated from now.\",\n },\n args: { id: ID_ARG },\n run: async ({ args }) => {\n try {\n await apiPost(\"/api/experiments/resume\", { experimentId: String(args.id) });\n writeJsonEnvelope({\n ok: true,\n data: { resumed: true },\n hints: [\"Resumed. The split is back on, with the same sides.\"],\n });\n } catch (error) {\n reportApiError(error);\n }\n },\n});\n\nregisterSchema({\n command: \"experiment.fold\",\n description: \"Make the page's own content the version that won, and archive the one that lost\",\n args: {\n id: { type: \"string\", description: \"One test, by its id. Omit to fold every test that owes one\", required: false },\n },\n});\n\nconst foldCommand = defineCommand({\n meta: {\n name: \"fold\",\n description:\n \"Finish the job a finished test started: move the winning version into the page's own folder, archive the version that lost, and delete the extra page. Until this runs, the page is served by a rewrite at the edge while its own source says something else — so the repo does not say what the URL serves, and the page cannot be tested again. Start here: run it with no arguments after any test ends, then publish.\",\n },\n args: {\n id: { type: \"string\", description: \"One test, by its id. Omit to fold every test that owes one\", required: false },\n },\n run: async ({ args }) => {\n try {\n const asked = await apiPost<{ ok: true; data: ExperimentFoldResponse }>(\"/api/experiments/fold\", {\n ...(args.id ? { experimentId: String(args.id) } : {}),\n });\n const owed = asked.data.owed;\n if (owed.length === 0) {\n writeJsonEnvelope({\n ok: true,\n data: { folded: [] },\n hints: [\"Nothing to fold — every finished test's result is already the page's own content.\"],\n });\n return;\n }\n\n const folded: FoldResult[] = [];\n const failures: string[] = [];\n for (const target of owed) {\n const result = await foldExperiment(process.cwd(), target);\n // One page that cannot be folded must not hold back the others: each is\n // an independent test on an independent page, and stopping would leave\n // every later one served by a rewrite for another week.\n if (\"error\" in result) failures.push(`${target.landingSlug}: ${result.error}`);\n else folded.push(result);\n }\n\n if (folded.length > 0) {\n // Name the ones that were written, never \"the company\". A target whose\n // fold failed has to stay owed: recorded, it would lose its promotion\n // when the build lands and the page would serve the version that lost.\n await apiPost(\"/api/experiments/fold\", {\n applied: true,\n experimentIds: folded.map((result) => result.experimentId),\n ...(args.id ? { experimentId: String(args.id) } : {}),\n });\n }\n\n writeJsonEnvelope({\n ok: true,\n data: { folded, failures },\n hints: [\n folded.length > 0\n ? `Publish this session to make it real. Until the build lands, the winning version is still served by a rewrite — Baker drops that by itself once the new pages are live, so there is nothing to do afterwards.`\n : \"Nothing was folded.\",\n ...(failures.length > 0 ? [`Could not fold: ${failures.join(\"; \")}`] : []),\n ...(folded.length > 0\n ? [\n `The version that lost is kept at ${folded.map((f) => f.archivedTo).join(\", \")} — a self-contained copy, so it still shows what was actually measured after the page moves on. Never edit it.`,\n ]\n : []),\n ],\n });\n } catch (error) {\n reportApiError(error);\n }\n },\n});\n\nexport const experimentCommand = defineCommand({\n meta: {\n name: \"experiment\",\n description:\n \"Run an A/B test between a landing page and a new variant of it, and be told which one is better. Always `plan` first: most pages do not get enough traffic to settle most questions, and a test that cannot conclude still produces a number somebody will act on. Nothing ends a test on its own — `finish` does, when you or the client decide.\",\n },\n subCommands: {\n plan: planCommand,\n start: startCommand,\n update: updateCommand,\n status: statusCommand,\n history: historyCommand,\n pause: pauseCommand,\n resume: resumeCommand,\n finish: finishCommand,\n cancel: cancelCommand,\n fold: foldCommand,\n },\n});\n\n/**\n * Everything about this test that only the workspace can answer, read once.\n *\n * All of it is best-effort: a graph that cannot be walked costs the brief its\n * detail, never the test. Gathered here rather than inline so the command's\n * handler stays a request and a response.\n */\nasync function readStartContext(landing: string, variant: string) {\n const root = process.cwd();\n // Read off the workspace's own import graph, so the review says which section\n // is under test rather than only which two pages are.\n const composition = await readComposition(root, landing, variant);\n const [controlForms, variantForms, landingInternalId, variantInternalId] = await Promise.all([\n readForms(root, landing),\n readForms(root, variant),\n // Each page's own identity, so a renamed folder cannot detach the test —\n // the variant has no row in Baker until this session is published.\n readPageInternalId(root, landing),\n readPageInternalId(root, variant),\n ]);\n return {\n composition,\n newForms: formsOnlyIn(variantForms, controlForms),\n // Whether the two versions still fire the company's conversions on the same\n // action. Nothing downstream can ask this — a split can be perfect while the\n // two pages disagree about what an event means — and the only place the\n // answer exists is the workspace this command is already standing in.\n drift: await readMeasurementDrift(root, landing, composition),\n landingInternalId,\n variantInternalId,\n };\n}\n","import { readdir, readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { ExperimentComposition } from \"@baker/api/experiments\";\nimport { landingGraphFiles } from \"../landings/import-graph.ts\";\n\n/**\n * What the two arms of a test are actually made of, read off the real import\n * graph rather than off whatever was typed when the page was built.\n *\n * A variant imports the control's sections and owns a copy of only the one\n * under test. So the split falls straight out of the variant's own transitive\n * graph: a section that lives under the variant's folder is the thing being\n * tested, and one that lives under the control's is shared with it.\n *\n * Computed at the moment the test starts, not passed along from\n * `baker landings variant`, because the page can be edited in between — and a\n * brief that describes the fork as it was when the folder was created would\n * describe a test that is not the one about to run.\n */\n\n/** Sections only. `index.astro` is the page, and every variant owns its own. */\nfunction sectionsUnder(files: readonly string[], slug: string): string[] {\n const prefix = `src/pages/${slug}/`;\n return files.filter((file) => file.startsWith(prefix) && !file.slice(prefix.length).startsWith(\"index.\")).sort();\n}\n\n/**\n * Pure half, so the rule is testable without a fixture tree on disk.\n *\n * `src/layouts/**` and `src/components/**` are deliberately absent from both\n * lists. They reach every page and are force-synced onto every client, so\n * naming them as \"shared with the control\" would bury the one fact this exists\n * to state — that the sections of these two pages are the same files.\n */\nexport function compositionOf(\n controlSlug: string,\n variantSlug: string,\n variantGraph: readonly string[],\n): ExperimentComposition {\n return {\n forked: sectionsUnder(variantGraph, variantSlug),\n shared: sectionsUnder(variantGraph, controlSlug),\n };\n}\n\n/**\n * The same answer, read from the workspace.\n *\n * Returns `undefined` rather than throwing when the graph cannot be walked: a\n * brief without the section names is worse than one with them and much better\n * than a test that could not be started. The backend takes the field as\n * optional for the same reason.\n */\nexport async function readComposition(\n root: string,\n controlSlug: string,\n variantSlug: string,\n): Promise<ExperimentComposition | undefined> {\n try {\n const graph = await landingGraphFiles(root, variantSlug);\n return compositionOf(controlSlug, variantSlug, [...graph]);\n } catch {\n return undefined;\n }\n}\n\n/**\n * Ways a Form is named in source, each anchored to a quoted string so prose\n * cannot match — the same three shapes `detect-landing-flows.mjs` reads in the\n * scaffold: an import of the flow's module, the rendered markup, its selector.\n */\nconst FLOW_REFERENCE_RES = [\n /[\"'][^\"']*flow-engine\\/flows\\/([A-Za-z0-9._-]+)/g,\n /data-flow-form\\s*=\\s*[\"']([^\"']+)[\"']/g,\n /flowName\\s*=\\s*[\"']([^\"']+)[\"']/g,\n];\n\n/** The Forms these sources reference, among the ones that exist. Pure, for the tests. */\nexport function formsReferenced(texts: readonly string[], knownFlows: ReadonlySet<string>): string[] {\n const found = new Set<string>();\n for (const text of texts) {\n for (const re of FLOW_REFERENCE_RES) {\n for (const match of text.matchAll(re)) {\n const flow = match[1];\n if (flow && knownFlows.has(flow)) found.add(flow);\n }\n }\n }\n return [...found].sort();\n}\n\n/** The Forms one version uses that the other does not. */\nexport function formsOnlyIn(these: readonly string[], those: readonly string[]): string[] {\n const other = new Set(those);\n return these.filter((flow) => !other.has(flow));\n}\n\nasync function knownFlows(root: string): Promise<Set<string>> {\n try {\n const entries = await readdir(path.join(root, \"src/lib/flow-engine/flows\"), { withFileTypes: true });\n return new Set(entries.filter((entry) => entry.isDirectory()).map((entry) => entry.name));\n } catch {\n return new Set();\n }\n}\n\n/**\n * The Forms a version of the page renders, read off its import graph.\n *\n * Asked of both versions at `start`, because the goal is a conversion NAME and\n * a name counts only the events named under it: a variant that swaps the\n * page's Form for a new one converts on an event nobody has named yet, and a\n * test read on the old Form's ending would report the new version as harmful\n * for the whole of its run. Best effort — an unreadable tree returns nothing,\n * and the hint simply does not fire.\n */\nexport async function readForms(root: string, slug: string): Promise<string[]> {\n try {\n const [files, flows] = await Promise.all([landingGraphFiles(root, slug), knownFlows(root)]);\n if (flows.size === 0) return [];\n const texts = await Promise.all(\n [...files]\n .filter((file) => /\\.(astro|ts|tsx|js|mjs)$/.test(file))\n .map((file) => readFile(path.join(root, file), \"utf8\")),\n );\n return formsReferenced(texts, flows);\n } catch {\n return [];\n }\n}\n","import { type Dirent, statSync } from \"node:fs\";\nimport { cp, mkdir, readdir, readFile, rm, stat, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { variantNumberOf } from \"@baker/api/experiments/variants\";\nimport { landingGraphFiles } from \"../landings/import-graph.ts\";\nimport { repointMoved } from \"../landings/repoint.ts\";\n\n/**\n * Folding a finished test back into the page it was about.\n *\n * The resting state a test used to leave behind: `/oferta/` served the\n * variant's file through a permanent rewrite at the edge, `/oferta--3/` served\n * the same file at its own indexed URL, and `src/pages/oferta/` was served\n * nowhere. One page with two addresses, one address with no page, and a repo\n * that no longer said what a URL serves.\n *\n * The fold ends that. The page keeps its slug, its `_definition.md` and its\n * `internalId` — so history, leads, `landing_metadata` and every ad pointing at\n * the URL are untouched — and its content becomes whichever variant won. The\n * variant folder stops existing.\n *\n * ## Why the loser is archived rather than deleted\n *\n * A test's whole value is the finding, and the finding is unreadable six months\n * later if the version that lost is gone. The archive lives at\n * `src/_variants/<page internalId>/<n>/`, and every part of that path is a\n * decision:\n *\n * - **Outside `src/pages/`**, because `getLandingsOnRef` does not filter\n * `_`-prefixed folders while `discoverLandings` does — anything under\n * `src/pages/` that classify excludes and `git ls-tree` includes becomes a\n * permanent phantom deleted landing on every sync. And because `walkFiles`\n * recurses into `_`-dirs, so an archive under the page would fold into the\n * page's own import graph and change what every reader of it sees.\n * - **Keyed on `internalId`, not the slug**, so renaming the page cannot orphan\n * its own history. Same identity-over-address rule as everything else here.\n * - **Numbered by the test's variant number**, which is never reused.\n * - **No `_definition.md`.** The collection loader's `**\\/_definition.md` glob is\n * depth-agnostic, so one would make the archive a collection entry and a\n * sitemap URL that 404s. It is a record, not a landing.\n *\n * ## Why the archive is self-contained\n *\n * A variant borrows the page's sections and forks only the one under test —\n * that sharing is what makes the test measure one difference. An archive that\n * kept those imports pointing at the live page would silently rewrite itself on\n * the page's next edit, which makes it a record of nothing. So every file the\n * archived arm renders is copied in and repointed to the copy.\n *\n * Self-contained stops at the arm's own folders. The shared library —\n * `src/layouts/**`, `src/components/**`, `src/lib/**` — is referenced rather\n * than copied, because snapshotting the whole scaffold for every test any\n * client ever ran is not affordable. Those references are still rewritten, for\n * the depth reason in `repointIntoArchive`.\n *\n * ## Why the archive is out of the verify gate\n *\n * A record nobody may edit cannot also be something a gate can turn red, and it\n * cannot be something the gate rewrites either — the first leaves destroying\n * the record as the only way past, the second does the destroying itself. Four\n * scopes in the scaffold therefore exclude `src/_variants`, pinned from this\n * side by `archive-scope.parity.test.ts` because the scaffold ships standalone\n * and cannot import this file: typecheck (`tsconfig.json`, and\n * `tsconfig.sandbox.json` separately — `exclude` replaces rather than merges),\n * biome (`_biome.json`) and the CSS import formatter, both of which write.\n *\n * Knip is the fourth and is not an exclusion at all. Dropping the archive from\n * its graph would make a shared component only an archive imports read as\n * unused, and deleting it on knip's word is this file's own \"record of nothing\"\n * arriving quietly instead of loudly. So every archived file is an `entry`: its\n * imports count as used, and `includeEntryExports: false` keeps its own exports\n * out of the report. Making only the arm's `index.astro` an entry does neither\n * — a section's export then reports unused, on a file nobody may edit.\n *\n * What is NOT excluded, deliberately: the validators that walk `src/**` and can\n * only warn (`validate-mux-video-library` and friends). A warning does not\n * block a publish and does not rewrite anything, so it fails neither half of\n * the rule above. It is noise on a file nobody can act on, and worth removing —\n * but not by widening a rule whose whole value is that it is about red gates\n * and writers.\n */\n\n/** Where a page's past versions live. Never built, never served, never synced. */\nexport const ARCHIVE_ROOT = \"src/_variants\";\n\nexport interface FoldTarget {\n readonly experimentId: string;\n readonly landingSlug: string;\n readonly variantSlug: string;\n readonly survivor: \"control\" | \"variant\";\n readonly landingInternalId: string | null;\n}\n\nexport interface FoldResult {\n readonly experimentId: string;\n readonly page: string;\n readonly archivedTo: string;\n readonly written: string[];\n readonly removed: string[];\n}\n\n/** Quoted relative specifiers: imports, and `src=\"./_images/…\"` in markup alike. */\nconst QUOTED_RELATIVE = /(['\"])(\\.\\.?\\/[^'\"]*)\\1/g;\n\nfunction posix(p: string): string {\n return p.split(path.sep).join(\"/\");\n}\n\nasync function isDir(p: string): Promise<boolean> {\n try {\n return (await stat(p)).isDirectory();\n } catch {\n return false;\n }\n}\n\n/** Every file under `dir`, recursively, as paths relative to it. */\nasync function filesUnder(dir: string, prefix = \"\"): Promise<string[]> {\n let entries: Dirent[];\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return [];\n }\n const out: string[] = [];\n for (const entry of entries) {\n const rel = prefix ? `${prefix}/${entry.name}` : entry.name;\n if (entry.isDirectory()) out.push(...(await filesUnder(path.join(dir, entry.name), rel)));\n else out.push(rel);\n }\n return out.sort();\n}\n\nconst TEXT_EXT = /\\.(astro|ts|tsx|js|jsx|mjs|cjs|vue|svelte|md|json|css)$/;\n\n/**\n * Where a file lands inside the snapshot, or null when it is not `base`'s.\n *\n * The arm's own files keep their place; the ones it borrowed from the page keep\n * the place they had under the page. Two disjoint trees flattened into one, so\n * a borrowed `_components/Proof.astro` and a forked `_components/Hero.astro`\n * sit side by side exactly as the page rendered them.\n */\nfunction archiveRelPath(abs: string, base: string): string | null {\n if (!abs.startsWith(base + path.sep)) return null;\n return posix(path.relative(base, abs));\n}\n\n/**\n * Copy one arm into an archive that renders the same thing forever.\n *\n * Only the two landing folders are pulled in. `src/components/**` and\n * `src/layouts/**` are the shared library rather than this page's content, and\n * the archive is never built — copying them would snapshot the whole scaffold\n * for every test any client ever ran.\n */\nasync function archiveArm(opts: {\n root: string;\n armDir: string;\n pageDir: string;\n archiveDir: string;\n armSlug: string;\n}): Promise<string[]> {\n const { root, armDir, pageDir, archiveDir, armSlug } = opts;\n const targets = await archiveContents({ root, armDir, pageDir, armSlug });\n const archivedBySource = new Map([...targets].map(([rel, abs]) => [abs, path.join(archiveDir, rel)]));\n const written: string[] = [];\n for (const [rel, abs] of [...targets].sort()) {\n const dest = path.join(archiveDir, rel);\n await mkdir(path.dirname(dest), { recursive: true });\n if (!TEXT_EXT.test(rel)) {\n await cp(abs, dest);\n } else {\n const text = await readFile(abs, \"utf8\");\n await writeFile(dest, repointIntoArchive(text, abs, dest, archivedBySource), \"utf8\");\n }\n written.push(posix(path.relative(root, dest)));\n }\n return written;\n}\n\n/**\n * Every file the archive holds: archive-relative path → where it is copied from.\n *\n * Two passes, so the result does not depend on set iteration order — the page's\n * files first, then the arm's own on top. Where both hold a path the arm's\n * wins, and that fork is the entire difference the test was measuring.\n */\nasync function archiveContents(opts: {\n root: string;\n armDir: string;\n pageDir: string;\n armSlug: string;\n}): Promise<Map<string, string>> {\n const { root, armDir, pageDir, armSlug } = opts;\n const graph = await landingGraphFiles(root, armSlug);\n const reachable = new Set([...graph].map((rel) => path.resolve(root, rel)));\n // Assets are not in the import graph but are part of what the arm was. The\n // graph adds only the files it BORROWED from the page.\n for (const rel of await filesUnder(armDir)) reachable.add(path.join(armDir, rel));\n\n const sorted = [...reachable].sort();\n const targets = new Map<string, string>();\n for (const base of [pageDir, armDir]) {\n for (const abs of sorted) {\n const rel = archiveRelPath(abs, base);\n // Outside this folder, or not a landing — a `_definition.md` here would\n // become a collection entry and therefore a URL that 404s.\n if (rel === null || rel === \"_definition.md\") continue;\n targets.set(rel, abs);\n }\n }\n return targets;\n}\n\n/**\n * Re-aim one archived file's relative paths, so every one of them still names\n * the file it named when this arm was live.\n *\n * Two kinds, and both have to move. A specifier that resolves to something the\n * archive holds points at that copy — that is what makes the snapshot\n * self-contained. A specifier that escapes the arm's folder — the shared\n * layout, a component from `src/components/` — is referenced rather than\n * copied, deliberately: snapshotting `src/components/**` for every test any\n * client ever ran is not affordable.\n *\n * Leaving that second kind exactly as written was the first version of this,\n * and it was wrong for a reason that is pure arithmetic: the archive sits at\n * `src/_variants/<id>/<n>/`, one folder deeper than the `src/pages/<slug>/` it\n * was copied from, so every `../../layouts/Layout.astro` it inherited lands on\n * `src/_variants/layouts/Layout.astro` and names nothing at all. A reference\n * that drifts with the shared library still says which module rendered here; a\n * reference to a path that cannot exist says nothing, and it is what made the\n * first fold any client ever ran fail its own typecheck 16 times over.\n */\nfunction repointIntoArchive(\n text: string,\n sourceAbs: string,\n destAbs: string,\n archivedBySource: ReadonlyMap<string, string>,\n): string {\n const fromDir = path.dirname(sourceAbs);\n const toDir = path.dirname(destAbs);\n return text.replace(QUOTED_RELATIVE, (match, quote: string, spec: string, offset: number) => {\n const [specPath, suffix] = splitSuffix(spec);\n const target = path.resolve(fromDir, specPath);\n const resolved =\n resolveInArchive(target, archivedBySource) ?? resolveOnDisk(target, isImportPosition(text, offset));\n if (resolved === null) return match;\n const rel = posix(path.relative(toDir, resolved));\n return `${quote}${rel.startsWith(\".\") ? rel : `./${rel}`}${suffix}${quote}`;\n });\n}\n\n/**\n * `\"./shot.png?w=800\"` → `[\"./shot.png\", \"?w=800\"]`.\n *\n * A Vite query or a fragment is not part of the filename, and resolving one as\n * if it were is how `./_images/shot.png?w=800` missed the archive's own copy of\n * `shot.png` and got re-aimed at the variant folder the fold then deleted.\n */\nfunction splitSuffix(spec: string): [string, string] {\n const cut = spec.search(/[?#]/);\n return cut === -1 ? [spec, \"\"] : [spec.slice(0, cut), spec.slice(cut)];\n}\n\n/** Spellings of one specifier that name the same file: the path, or an elided extension. */\nconst EXTENSIONS = [\"\", \".astro\", \".ts\", \".tsx\", \".js\", \".jsx\", \".mjs\"];\n\n/**\n * An extensionless specifier still names a file the archive holds.\n *\n * `/index.*` is a candidate here and deliberately not in `resolveOnDisk`: this\n * map holds files the archive really contains, so a hit is proof. On disk it\n * would be a guess, and the wrong one — see below.\n */\nfunction resolveInArchive(base: string, archivedBySource: ReadonlyMap<string, string>): string | null {\n for (const suffix of [...EXTENSIONS, \"/index.astro\", \"/index.ts\"]) {\n const hit = archivedBySource.get(base + suffix);\n if (hit !== undefined) return hit;\n }\n return null;\n}\n\n/**\n * Is the quote at `offset` the start of an import specifier, or of a value?\n *\n * The distinction decides whether `../../components/Widget` may be read as\n * `Widget/index.astro`. Both a directory import and `<a href=\"../gracias/\">`\n * name a directory that exists, so nothing about the path itself separates\n * them — only where it is written does. `import \"./styles.css\"` has no `from`,\n * which is why a bare `import` counts.\n */\nfunction isImportPosition(text: string, offset: number): boolean {\n return /\\b(?:from|import|require)\\s*\\(?\\s*$/.test(text.slice(Math.max(0, offset - 64), offset));\n}\n\n/**\n * The same question asked of the repo, for the references the archive does not\n * hold — the shared layout, a component from `src/components/`.\n *\n * A **file**, never a directory, and that is the whole precision of it.\n * `QUOTED_RELATIVE` matches any quoted relative string, so `<a href=\"../gracias/\">`\n * and `const redirect = \"../thanks\"` arrive here looking exactly like an\n * import. Those are not paths into the source tree, and rewriting one restates\n * the journey the snapshot was measuring as a path through the repo.\n *\n * \"Does something live there\" is too weak to separate them: a link usually\n * points at a sibling page, whose directory exists. `/index.*` is the case\n * where that matters most in both directions — `import X from \"../../components/Widget\"`\n * is a real shape (`landing/import-graph.ts` resolves it, so an arm can hold\n * one), and `href=\"../gracias/\"` resolves to that page's own entry file. So the\n * index candidates are offered only where an import can actually be written,\n * and the `isFile` check governs everywhere.\n */\nfunction resolveOnDisk(base: string, allowDirectoryIndex: boolean): string | null {\n const candidates = allowDirectoryIndex ? [...EXTENSIONS, \"/index.astro\", \"/index.ts\", \"/index.js\"] : EXTENSIONS;\n for (const suffix of candidates) {\n try {\n if (statSync(base + suffix).isFile()) return base + suffix;\n } catch {\n // Nothing at that path. Try the next spelling.\n }\n }\n return null;\n}\n\n/**\n * Move the winning variant's files into the page's own folder.\n *\n * `_definition.md` is deliberately not copied: the page keeps its identity, and\n * that identity is what every analytics row, every lead and every ad already\n * points at. The variant's own definition dies with the folder.\n */\nasync function promoteVariantFiles(opts: { root: string; pageDir: string; variantDir: string }): Promise<string[]> {\n const { root, pageDir, variantDir } = opts;\n const written: string[] = [];\n for (const rel of await filesUnder(variantDir)) {\n if (rel === \"_definition.md\") continue;\n const from = path.join(variantDir, rel);\n const to = path.join(pageDir, rel);\n await mkdir(path.dirname(to), { recursive: true });\n if (!TEXT_EXT.test(rel)) {\n await cp(from, to);\n } else {\n const text = await readFile(from, \"utf8\");\n // A borrowed section written as `../oferta/_components/Proof.astro`\n // becomes `./_components/Proof.astro`; a forked one moves with the file\n // and stays `./_components/Hero.astro`; the shared layout is unchanged.\n await writeFile(\n to,\n repointMoved(text, {\n fromDir: path.dirname(from),\n toDir: path.dirname(to),\n movedFrom: variantDir,\n movedTo: pageDir,\n }),\n \"utf8\",\n );\n }\n written.push(posix(path.relative(root, to)));\n }\n return written;\n}\n\n/**\n * The record beside the snapshot: what this version was and why it stopped\n * being live.\n *\n * JSON rather than markdown with frontmatter, and named `_variant.json` rather\n * than `_definition.md`, for the reason above — a `_definition.md` anywhere\n * under `src/` becomes a landing collection entry and therefore a URL.\n */\nfunction archiveRecord(target: FoldTarget, variantNumber: number): string {\n return `${JSON.stringify(\n {\n experimentId: target.experimentId,\n page: target.landingSlug,\n pageInternalId: target.landingInternalId,\n variant: target.variantSlug,\n variantNumber,\n // Which arm this snapshot is. On a control win the variant lost; on a\n // variant win what lost is the page's own previous content, which never\n // had a number of its own — so it is filed under the test that rejected\n // it, which is the only number that means anything about it.\n arm: target.survivor === \"variant\" ? \"page-before-this-test\" : \"variant\",\n },\n null,\n 2,\n )}\\n`;\n}\n\n/**\n * Fold one finished test in, and report every path touched.\n *\n * Refuses rather than half-applies: a variant folder that is already gone means\n * somebody folded this test by hand, and writing an archive of the page's\n * current content over it would record the wrong thing as the loser.\n */\nexport async function foldExperiment(root: string, target: FoldTarget): Promise<FoldResult | { error: string }> {\n const pageDir = path.resolve(root, \"src/pages\", target.landingSlug);\n const variantDir = path.resolve(root, \"src/pages\", target.variantSlug);\n const variantNumber = variantNumberOf(target.variantSlug);\n\n if (variantNumber === null) {\n return {\n error: `“${target.variantSlug}” is not a variant of “${target.landingSlug}”, so there is nothing to fold`,\n };\n }\n if (!(await isDir(pageDir))) {\n return { error: `There is no page at src/pages/${target.landingSlug}/` };\n }\n if (!(await isDir(variantDir))) {\n return { error: `src/pages/${target.variantSlug}/ is already gone — this test looks folded in already` };\n }\n\n const archiveKey = target.landingInternalId ?? target.landingSlug;\n const archiveDir = path.resolve(root, ARCHIVE_ROOT, archiveKey, String(variantNumber));\n await rm(archiveDir, { recursive: true, force: true });\n await mkdir(archiveDir, { recursive: true });\n\n // The arm that stops being served is the one worth keeping. When the page as\n // it was won, that is the variant; when the new variant won, it is the page's\n // own outgoing content.\n const written = await archiveArm({\n root,\n armDir: target.survivor === \"variant\" ? pageDir : variantDir,\n pageDir,\n archiveDir,\n armSlug: target.survivor === \"variant\" ? target.landingSlug : target.variantSlug,\n });\n await writeFile(path.join(archiveDir, \"_variant.json\"), archiveRecord(target, variantNumber), \"utf8\");\n written.push(posix(path.join(ARCHIVE_ROOT, archiveKey, String(variantNumber), \"_variant.json\")));\n\n if (target.survivor === \"variant\") {\n written.push(...(await promoteVariantFiles({ root, pageDir, variantDir })));\n }\n\n await rm(variantDir, { recursive: true, force: true });\n\n return {\n experimentId: target.experimentId,\n page: target.landingSlug,\n archivedTo: posix(path.join(ARCHIVE_ROOT, archiveKey, String(variantNumber))),\n written,\n removed: [`src/pages/${target.variantSlug}`],\n };\n}\n","/**\n * What to do next, given a verdict or a plan.\n *\n * The verdict already decides; these say what the decision means for the work.\n * They exist because the single most likely misuse of this command is an agent\n * reading `keep_running` and going looking for a number that agrees with it.\n *\n * Pure, so the wording is testable and cannot drift from the rules it describes.\n */\n\nimport {\n describeWait as describeWaitFor,\n type ExperimentBlockingChat,\n type ExperimentComposition,\n type ExperimentHistoryEntry,\n type ExperimentPagePlan,\n type ExperimentPlanResponse,\n type ExperimentStatusRow,\n roughCount,\n} from \"@baker/api/experiments\";\nimport type { MeasurementDrift } from \"./measurement.ts\";\n\n/**\n * The one line to print for a live test, by its verdict.\n *\n * A record rather than a switch so the set stays exhaustive by type: a verdict\n * added upstream without a line here fails to compile, where a switch would\n * quietly print nothing for the very case somebody needs to act on.\n *\n * Nothing ends a test on its own, so every line that has an action names the\n * command that takes it.\n */\nconst LIVE_HINT: Record<ExperimentStatusRow[\"verdict\"], (row: ExperimentStatusRow, now: number) => string> = {\n keep_running: (row, now) =>\n `${row.experimentId} cannot yet tell the two pages apart — do not end it hoping for a result. ${describeWait(row, now)}`,\n winner: (row) =>\n row.winner === \"variant\"\n ? `${row.experimentId} has a winner: the new variant. Run \\`baker experiment finish --id ${row.experimentId} --keep variant\\` to show it to everyone, then \\`baker experiment fold\\`.`\n : `${row.experimentId}: the new version is proven worse and is STILL being shown to half the visitors. Run \\`baker experiment finish --id ${row.experimentId} --keep original\\` now.`,\n no_difference: (row) =>\n `${row.experimentId} measured the two pages as alike — it collected enough traffic to see the change it was looking for, and there was none. End it with \\`--keep original\\` and test a bigger change — a headline, an offer, the shape of the page, not a button colour.`,\n cannot_win: (row) =>\n `${row.experimentId}: the new version cannot win — even its best case is under the lift this test was looking for, so there is nothing left to find. Run \\`baker experiment finish --id ${row.experimentId} --keep original --reason numbers_clear\\` and write down what it taught.`,\n stopped_early_harmful: (row) =>\n `${row.experimentId} is doing damage and is STILL being shown to visitors. Run \\`baker experiment finish --id ${row.experimentId} --keep original\\` now.`,\n // Unreachable on a live test — only ending one produces it. The Record is\n // exhaustive by type so a verdict added upstream fails to compile here rather\n // than printing nothing.\n inconclusive: (row) => `${row.experimentId} was ended before it concluded and found nothing.`,\n invalid: (row) =>\n `${row.experimentId} cannot be read: ${\n row.invalidReason === \"crossover\" ? \"too many visitors saw both versions\" : \"the traffic did not split evenly\"\n }. End it with \\`--keep original\\` and start again rather than reporting anything from it.`,\n};\n\n/**\n * When a running test could first say something, in one clause.\n *\n * Three states rather than two, because they need different actions: a page\n * that has not been seen yet, a page that will get there, and a page whose\n * traffic never will. The last one used to be indistinguishable from the\n * second, so a hopeless test simply ran forever.\n */\nfunction describeWait(row: ExperimentStatusRow, now: number): string {\n if (row.willNotConclude) {\n return \"This page's traffic will not settle it at any point, so end it with `--keep original` and test a bigger change.\";\n }\n if (row.earliestDecisionAt === null) {\n return \"This page has produced no visitors yet, so there is nothing to project a finish date from.\";\n }\n if (row.stillNeeded === null) {\n return `It already has the data it needs; the verdict waits only until it has seen a full day of visitors — ${describeWaitFor(row.earliestDecisionAt, now)}.`;\n }\n const needed = `It needs ${roughCount(row.stillNeeded.visitors)} more visitors (${roughCount(row.stillNeeded.conversions)} more conversions) for an answer if the gap holds — `;\n return `${needed}${describeWaitFor(row.earliestDecisionAt, now)} at today's traffic (${new Date(row.earliestDecisionAt).toISOString().slice(0, 10)}).`;\n}\n\n/**\n * How to word an unfinished test to the user, said once for every such test:\n * repeated on each test's line it was a third of a four-test print (BAKER-2569).\n */\nconst KEEP_RUNNING_WORDING =\n \"To the user, say only each unfinished test's `summary` in plain words, then the data it still needs and roughly when. Never quote confidence, chance-better or intervals — they decide nothing.\";\n\n/** A paused test says so first, because nothing else in the row does. */\nfunction pausedNote(row: ExperimentStatusRow): string {\n return row.status === \"paused\"\n ? `${row.experimentId} is paused — everyone sees the original. \\`baker experiment resume --id ${row.experimentId}\\` restarts the split with the same sides. `\n : \"\";\n}\n\n/**\n * A finished test with nothing written down is a result without a conclusion,\n * and the conclusion is the part the next test is built from.\n */\nfunction unlearnedHint(experiments: readonly ExperimentStatusRow[]): string | null {\n const unlearned = experiments.filter(\n (row) => row.status === \"finished\" && row.learning === null && row.verdict !== \"inconclusive\",\n );\n if (unlearned.length === 0) return null;\n const ids = unlearned.map((row) => row.experimentId).join(\", \");\n return `${unlearned.length === 1 ? \"One finished test has\" : `${unlearned.length} finished tests have`} no learning written down yet (${ids}). Say what it taught in one or two sentences — what the client should believe about this page now — with \\`baker experiment update --id <id> --learning \"…\"\\`. It is what \\`plan\\` hands the next test.`;\n}\n\n/**\n * A running test that will settle once it has the data its row names. Its\n * numbers are on its row already (`stillNeeded`, `earliestDecisionAt`), so it\n * shares one line with the others instead of restating them per test: four of\n * those lines were a third of a four-test print (BAKER-2587).\n */\nfunction isGatheringData(row: ExperimentStatusRow): boolean {\n return (\n row.status === \"running\" &&\n row.verdict === \"keep_running\" &&\n !row.willNotConclude &&\n row.earliestDecisionAt !== null &&\n row.stillNeeded !== null\n );\n}\n\nfunction gatheringHint(gathering: readonly ExperimentStatusRow[]): string | null {\n if (gathering.length === 0) return null;\n const ids = gathering.map((row) => row.experimentId);\n const named = ids.length === 1 ? ids.join(\"\") : `${ids.slice(0, -1).join(\", \")} and ${ids.at(-1)}`;\n return `${named} cannot yet tell the two pages apart — do not end ${ids.length === 1 ? \"it\" : \"them\"} hoping for a result; each needs its \\`stillNeeded\\` if the gap holds, which today's traffic gathers by its \\`earliestDecisionAt\\`.`;\n}\n\nexport function buildStatusHints(\n experiments: readonly ExperimentStatusRow[],\n now = Date.now(),\n statuses?: readonly ExperimentStatusRow[\"status\"][],\n): string[] {\n const hints = experiments\n .filter((row) => row.status !== \"finished\" && !isGatheringData(row))\n .map((row) => pausedNote(row) + LIVE_HINT[row.verdict](row, now));\n const gathering = gatheringHint(experiments.filter(isGatheringData));\n if (gathering) hints.push(gathering);\n if (experiments.some((row) => row.status !== \"finished\" && row.verdict === \"keep_running\")) {\n hints.push(KEEP_RUNNING_WORDING);\n }\n const unlearned = unlearnedHint(experiments);\n if (unlearned) hints.push(unlearned);\n\n if (experiments.length === 0 && statuses) {\n hints.push(`No test is ${statuses.join(\" or \")}. Leave --status off to see every test.`);\n } else if (experiments.length === 0) {\n hints.push(\n \"No tests yet. `baker experiment plan --all` says which pages have enough traffic for one, in one call, before you build anything.\",\n );\n }\n return hints;\n}\n\n/**\n * What the fixed windows mean for the design, as one line.\n *\n * The counterpart to a refusal: \"this page cannot settle +20%\" sends somebody\n * away to guess; \"make it at least as different as a window can settle\" tells\n * them what to design. The numbers stay in `horizons`, said once (BAKER-1992).\n */\nfunction horizonsHint(plan: Pick<ExperimentPlanResponse, \"horizons\">): string {\n if (plan.horizons.every((horizon) => horizon.detectableLift === null)) {\n return \"At this page's traffic no window up to 84 days would gather enough visitors to settle anything, at any size of change. The constraint is the traffic, not the test.\";\n }\n return \"Design the alternative to be at least as different as the `detectableLift` of the `horizons` window you can wait for.\";\n}\n\n/** One finished test, as a line the next hypothesis has to be chosen against. */\nfunction pastTestLine(test: ExperimentHistoryEntry): string {\n const outcome: Record<ExperimentHistoryEntry[\"hypothesisOutcome\"], string> = {\n supported: \"the idea held\",\n refuted_opposite: \"the idea was WRONG — the change made it worse\",\n refuted_no_effect: \"no difference — the change did not matter\",\n unanswered: \"never answered\",\n };\n const kept = test.survivor === \"variant\" ? \"the new version was kept\" : \"the original was kept\";\n const learning = test.learning ? ` Learning: ${test.learning}` : \"\";\n return `“${test.hypothesis.change}” (${test.experimentId}, ${test.ranForDays} days): ${outcome[test.hypothesisOutcome]}; ${kept}${test.againstVerdict ? \" against the numbers\" : \"\"}.${learning}`;\n}\n\n/**\n * What this page has already taught, before a new hypothesis is chosen.\n *\n * First among the hints because it is the one thing the agent cannot know\n * from the page and cannot recover once it has proposed something: a refuted\n * idea proposed again spends the page's traffic to return the same answer.\n */\nfunction pastTestsHint(plan: Pick<ExperimentPlanResponse, \"pastTests\">): string | null {\n if (plan.pastTests.length === 0) return null;\n const lines = plan.pastTests.slice(0, 5).map(pastTestLine);\n const more =\n plan.pastTests.length > 5\n ? ` …and ${plan.pastTests.length - 5} more — \\`baker experiment history --landing <slug>\\` lists them all.`\n : \"\";\n return `This page has been tested before — read this before choosing what to change, and build on it rather than repeating it: ${lines.join(\" \")}${more}`;\n}\n\nconst RERUN_WITH_GOAL =\n \"Choose the event the client means from a row's `goalChoices` (the events its visitors went on to, e.g. `page:hero`) and run `baker experiment plan --all --goal <event>` again before saying which pages could take a test.\";\n\n/**\n * The pages no goal could be chosen for: no --goal, and no single named conversion among the events\n * their visitors did, listed as `goalChoices`. A page whose visitors did nothing countable has none,\n * and its own `reason` says so; a page whose only named event was chosen for it carries that goal.\n */\nfunction unsizedHint(pages: readonly ExperimentPagePlan[]): { everyPage: boolean; hint: string } | null {\n const unsized = pages.filter((page) => page.goal === undefined && (page.goalChoices?.length ?? 0) > 0);\n if (unsized.length === 0) return null;\n if (pages.every((page) => page.goal === undefined)) {\n return { everyPage: true, hint: `No page was sized: no --goal was given. ${RERUN_WITH_GOAL}` };\n }\n const one = unsized.length === 1;\n const named = unsized.map((page) => `\\`${page.landing}\\``).join(\", \");\n return {\n everyPage: false,\n hint: `${unsized.length} ${one ? \"page\" : \"pages\"} (${named}) ${one ? \"was\" : \"were\"} not sized: no --goal was given and no single conversion could be chosen for ${one ? \"it\" : \"them\"}. ${RERUN_WITH_GOAL}`,\n };\n}\n\n/** What to do with the ranking: the page chosen gets a plan of its own, and that one is the brief. */\nexport function buildPlanAllHints(pages: readonly ExperimentPagePlan[]): string[] {\n // A page with no visitors is allowed to start, but has no traffic to settle anything on.\n const runnable = pages.filter((page) => page.canRun && page.estimatedDays !== null);\n if (pages.length === 0) return [\"There are no published pages to test yet.\"];\n if (runnable.length === 0) {\n const unsized = unsizedHint(pages);\n if (unsized?.everyPage) return [unsized.hint];\n const reasons = new Set(pages.map((page) => page.reason));\n const [onlyReason] = reasons;\n if (reasons.size === 1 && onlyReason) return [onlyReason];\n return [\n \"No page can settle a test as asked — each row's `reason` says why, and a row with no `reason` has no visitors yet. Where the reason is the page's traffic, a bigger change (--lift) or more traffic first is the way forward; name the quietest pages to the client rather than testing them.\",\n ...(unsized ? [unsized.hint] : []),\n ];\n }\n return [\n `${runnable.length} of ${pages.length} pages could settle a test, the quickest first. Run \\`baker experiment plan --landing <slug>\\` on the one you choose: it adds the events its visitors do, what each window could settle and its past tests.`,\n ];\n}\n\n/** How to choose the change, said once per chat and page (`buildPlanHints`). */\nconst CHOOSING_THE_CHANGE = [\n \"The goal is fixed when the test starts and cannot be changed later.\",\n // Fires at the exact moment the hypothesis gets invented, whether or not\n // the agent read the family doc. `plan` says a question CAN be settled here\n // and says nothing about which question is worth asking — and a well-run\n // test of a bad idea spends the page's traffic and returns `no_difference`.\n \"Now decide WHAT to change, from evidence rather than taste. These numbers say which page and which step; they cannot say why. A second opinion answers why — Microsoft Clarity for what visitors actually do on the page, `baker gsc` for what they searched, `baker ads <platform>` for what the ad promised, `baker ga4` for the client's own measurement. `baker capabilities` lists everything this client has in one call. Message match — what the ad or the search promised against what the page opens with — is the cheapest hypothesis worth testing and is wrong surprisingly often.\",\n // The base always works, so a missing integration is never a reason to\n // stop. Naming what it would have shown is worth more to the client than\n // either a silent gap or a run that waited.\n \"If none of that is connected, this page's own drop-off is enough to test on — say which source you lacked and what it would have told you, then run the test anyway. A test never waits on an integration.\",\n];\n\n/** Where the holding chat stands, in the words the person sees it in. */\nconst HOLDER_STATE: Partial<Record<ExperimentBlockingChat[\"status\"], string>> = {\n draft: \"not published yet\",\n in_progress: \"not published yet\",\n publishing: \"being published now\",\n publish_failed: \"its publish did not finish\",\n};\n\n/** The chat whose staged test holds the page, named and linked so the agent never has to search for it. */\nfunction blockedByHint(chat: ExperimentBlockingChat): string {\n const started = new Date(chat.createdAt).toISOString().slice(0, 10);\n const state = HOLDER_STATE[chat.status] ?? chat.status;\n return `The page is held by “${chat.title}” (chat ${chat.chatId}, started ${started}, ${state}): ${chat.url}. Give the person that link and say publishing or dropping that chat frees the page; there is no need to look it up with \\`baker chats\\`.`;\n}\n\n/**\n * `firstInChat` is false once this chat has already been told how to choose the\n * change for this page: the guidance does not change with the goal or the lift,\n * and re-sizing printed it on every call (BAKER-1992). Nor does `conversions`, which\n * such a call leaves out of its data.\n */\nexport function buildPlanHints(plan: ExperimentPlanResponse, firstInChat = true): string[] {\n const horizons = horizonsHint(plan);\n const past = pastTestsHint(plan);\n if (plan.blockedBy) {\n return [plan.reason ?? \"Another chat has already prepared a test on this page.\", blockedByHint(plan.blockedBy)];\n }\n if (!plan.canRun) {\n return [\n plan.reason ?? \"This test cannot run on this page.\",\n ...((plan.visitors ?? 0) > 0 ? [horizons] : []),\n ...(past ? [past] : []),\n \"A test that cannot conclude is worse than no test — it still produces a number, and somebody acts on it.\",\n ];\n }\n const hints = [\n ...(past ? [past] : []),\n // First, because it changes how every number below should be read: a plan\n // sized on a stand-in is a guide, and the agent must say so to the client\n // rather than quote \"about 70 days\" as though it were measured.\n ...(plan.warning ? [plan.warning] : []),\n ...(firstInChat\n ? CHOOSING_THE_CHANGE\n : [\"`conversions` is left out: it is the same as in this chat's first `plan` of this page.\"]),\n ];\n if (plan.estimatedDays !== null && plan.estimatedDays > 60) {\n hints.push(\n `At this page's recent traffic it would take about ${plan.estimatedDays} days — a guide: it ends when the numbers are clear, and more traffic (a campaign, ads) shortens it. If the traffic will stay as it is, test a bigger change, which needs fewer visitors to detect.`,\n );\n }\n hints.push(horizons);\n return hints;\n}\n\n/**\n * What to make of the record, once it has been read.\n *\n * The record is for informing the next hypothesis, so the hints say what it\n * settles: which ideas held and which were refuted on this page, and which\n * tests still have no conclusion written down.\n */\nexport function buildHistoryHints(tests: readonly ExperimentHistoryEntry[], landing: string | undefined): string[] {\n if (tests.length === 0) {\n return [\n landing\n ? `No finished test on “${landing}” yet — nothing to build on, and nothing to avoid repeating. \\`baker experiment plan\\` says whether the page can settle one.`\n : \"No finished tests yet. `baker experiment plan --all` says which pages can settle one, in one call.\",\n ];\n }\n const hints: string[] = [];\n const supported = tests.filter((test) => test.hypothesisOutcome === \"supported\");\n const refuted = tests.filter((test) => test.hypothesisOutcome === \"refuted_opposite\");\n const noEffect = tests.filter((test) => test.hypothesisOutcome === \"refuted_no_effect\");\n if (supported.length > 0) {\n hints.push(\n `Held: ${supported.map((test) => `“${test.hypothesis.change}” on ${test.landingSlug}`).join(\"; \")}. Build on these — the same insight usually has more in it.`,\n );\n }\n if (refuted.length > 0) {\n hints.push(\n `Made it worse: ${refuted.map((test) => `“${test.hypothesis.change}” on ${test.landingSlug}`).join(\"; \")}. Do not propose these again as they were; the observation behind each may still be right, the change was not.`,\n );\n }\n if (noEffect.length > 0) {\n hints.push(\n `Did not matter: ${noEffect.map((test) => `“${test.hypothesis.change}” on ${test.landingSlug}`).join(\"; \")}. The next change on these pages has to be bigger — a headline, an offer, the shape of the page.`,\n );\n }\n const unlearned = tests.filter((test) => test.learning === null && test.verdict !== \"inconclusive\");\n if (unlearned.length > 0) {\n hints.push(\n `${unlearned.length === 1 ? \"One test has\" : `${unlearned.length} tests have`} no learning written down (${unlearned.map((test) => test.experimentId).join(\", \")}). Read its numbers and write one: \\`baker experiment update --id <id> --learning \"…\"\\`.`,\n );\n }\n return hints;\n}\n\n/**\n * What is worth saying about the two versions as staged, before the split.\n *\n * Two things, both read off the workspace rather than off the request: a\n * variant that owns no section renders the page itself, so the test would run\n * for weeks against itself; and a variant that uses a Form the page does not\n * converts on that Form's ending — a different event from the page's — so\n * unless the caller said which event the new version is read on\n * (`--variant-goal`), it would read as never converting for the whole run.\n */\nexport function buildStartHints(staged: {\n landing: string;\n variant: string;\n goal: string;\n /** The new version's own event, when the caller gave one. */\n variantGoal: string | undefined;\n composition: ExperimentComposition | undefined;\n /** Forms the variant renders that the page does not. */\n newForms: readonly string[];\n /** Conversions the two versions may no longer fire on the same action. */\n drift: readonly MeasurementDrift[];\n}): string[] {\n const hints: string[] = [];\n for (const reason of new Set(staged.drift.map((entry) => entry.reason))) {\n const names = staged.drift.filter((entry) => entry.reason === reason).map((entry) => entry.name);\n hints.push(driftHint(staged, reason, names));\n }\n if (staged.composition && staged.composition.forked.length === 0) {\n hints.push(\n `“${staged.variant}” does not have its own copy of any section — it renders exactly the same page as “${staged.landing}”, so this test cannot find anything. Fork the section you want to test (\\`baker landings variant ${staged.landing} --fork Hero.astro\\`) and edit only that file.`,\n );\n }\n if (staged.newForms.length > 0 && staged.variantGoal === undefined) {\n const forms = staged.newForms.map((flow) => `“${flow}”`).join(\", \");\n hints.push(\n `“${staged.variant}” uses ${staged.newForms.length === 1 ? \"a Form\" : \"Forms\"} the page does not: ${forms}. The test reads the new version on \\`${staged.goal}\\`, the page's event — if the new version converts by reaching this Form's ending instead, it can never convert on that key and the test will call it harmful. Say its own event: \\`baker experiment update --id <id> --variant-goal submit:${staged.newForms[0]}\\` (or the confirmation step's \\`form:${staged.newForms[0]}:<node>:<trigger>\\` key, from \\`baker analytics conversions --candidates\\` once the Form has been opened in the preview).`,\n );\n }\n return hints;\n}\n\n/**\n * The conversions the two versions may not be counting the same way, one line\n * per kind of difference: six events a rewrite declares that the page does not\n * are one fact, and said once per event they were 2.3 KB (BAKER-2089).\n *\n * Phrased as a question about named events rather than as a refusal,\n * because whether the trigger still means the same thing is a judgement about\n * markup that a person makes in a glance and this cannot: a forked section is\n * *supposed* to change, and most of these are harmless. What is not acceptable\n * is nobody looking — the measured cost of not looking was a step that \"won\" by\n * 2.6x on two pages while comparing a click against a scroll.\n *\n * It names `baker analytics conversions` rather than describing the fix,\n * because the answer is in what the two pages actually declare and the command\n * that lists it is one hop away.\n */\nfunction driftHint(\n staged: { landing: string; variant: string },\n reason: MeasurementDrift[\"reason\"],\n names: readonly string[],\n): string {\n const one = names.length === 1;\n const listed = names.map((name) => `\\`${name}\\``).join(\", \");\n const suffix = ` Check both versions before reading ${one ? \"that number\" : \"those numbers\"}, and give the new version's step its own name if it is not the same action (\\`baker analytics conversions --candidates\\`).`;\n if (reason === \"trigger_differs\") {\n return `“${staged.landing}” and “${staged.variant}” both count ${listed}, but one fires ${one ? \"it\" : \"each\"} when the element is **scrolled into view** and the other when the visitor **does something**. Those are two different questions with one answer, and the test will report a difference that is the trigger rather than the page.${suffix}`;\n }\n if (reason === \"variant_only_missing\" || reason === \"control_only_missing\") {\n const missing = reason === \"variant_only_missing\" ? staged.variant : staged.landing;\n return `Only one version fires ${listed} — “${missing}” does not declare ${one ? \"it\" : \"them\"} at all, so it can only ever read zero for ${one ? \"that conversion\" : \"each\"} and the comparison will look like a collapse.${suffix}`;\n }\n return `Both versions count ${listed}, and the section the test changed is what fires ${one ? \"it\" : \"them\"} — the markup around ${one ? \"it\" : \"them\"} is not the same on the two pages. If the new version fires ${one ? \"it\" : \"one\"} on a different action (a block that is visible from the start rather than one the visitor opens), that conversion is comparing two different things.${suffix}`;\n}\n","import { type ExperimentEvidence, experimentEvidenceSourceSchema } from \"@baker/api/experiments\";\nimport { repeatedValues } from \"../../lib/repeatedFlags.ts\";\n\n/**\n * `--evidence` as an agent would type it, into the structured citation.\n *\n * `source:note`, with an optional `|href` on the end:\n *\n * ```\n * --evidence \"baker_analytics:60% of visitors never reach the price\"\n * --evidence \"research:ICP interviews|https://…\"\n * ```\n *\n * Split on the **first** colon only, because a note routinely contains one —\n * \"rage clicks: 18 on the CTA\" — and losing half a citation to a separator is\n * worse than the flag being slightly loose. The link goes after a pipe for the\n * same reason: a URL is mostly colons.\n *\n * The source is a closed set so that \"which kinds of evidence produced tests\n * that held\" is answerable later, and `hunch` is deliberately in it: a belief\n * with no data behind it is still a belief, and forcing the agent to dress one\n * up as analytics is worse than letting it say so.\n */\ntype EvidenceResult = ExperimentEvidence[] | { error: string } | undefined;\n\nconst SOURCES = experimentEvidenceSourceSchema.options.join(\", \");\n\nfunction parseOne(raw: string): ExperimentEvidence | { error: string } {\n const separator = raw.indexOf(\":\");\n if (separator === -1) {\n return { error: `Write the evidence as source:note — for example \\`${raw}:what you saw\\`. Sources: ${SOURCES}` };\n }\n const source = experimentEvidenceSourceSchema.safeParse(raw.slice(0, separator).trim());\n if (!source.success) {\n return { error: `“${raw.slice(0, separator).trim()}” is not one of the evidence sources. Use one of: ${SOURCES}` };\n }\n\n const rest = raw.slice(separator + 1).trim();\n const pipe = rest.lastIndexOf(\"|\");\n const note = (pipe === -1 ? rest : rest.slice(0, pipe)).trim();\n const href = pipe === -1 ? undefined : rest.slice(pipe + 1).trim();\n if (note === \"\") {\n return { error: `Say what ${source.data} showed: --evidence \"${source.data}:what you saw\"` };\n }\n return href ? { source: source.data, note, href } : { source: source.data, note };\n}\n\n/**\n * `rawArgs` rather than the parsed arg, because citty declares no array arg\n * type: a repeated `--evidence` collapses to its LAST value and arrives as a\n * plain string, so `Array.isArray` never fires and\n * `--evidence \"clarity:…\" --evidence \"ads:…\"` records only the second citation,\n * with `ok: true` and nothing saying the first was dropped. The arg\n * description, the family doc and the `ab-test` skill all call it repeatable,\n * and the sources it loses are the whole point of recording evidence at all.\n */\nexport function parseEvidence(raw: string | string[] | undefined, rawArgs?: readonly string[]): EvidenceResult {\n const entries = repeatedValues(rawArgs, \"evidence\", raw)\n .map((entry) => entry.trim())\n .filter((entry) => entry !== \"\");\n if (entries.length === 0) return undefined;\n\n const parsed: ExperimentEvidence[] = [];\n for (const entry of entries) {\n const one = parseOne(entry);\n if (\"error\" in one) return one;\n parsed.push(one);\n }\n return parsed;\n}\n","import { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\n/**\n * A page's own identity, read off its `_definition.md`.\n *\n * `experiment start` sends both pages' identities along with their slugs. The\n * backend prefers the `landings` rows, but the variant has no row until this\n * Session is published — which is after the test is staged — so without this\n * the variant's identity was never recorded: a renamed variant folder detached\n * its running test, and a fold archived the loser under the page's slug rather\n * than its id. Best-effort: a definition that cannot be read costs the test\n * its rename-safety, never the test.\n */\nexport async function readPageInternalId(root: string, slug: string): Promise<string | undefined> {\n try {\n const text = await readFile(path.resolve(root, \"src\", \"pages\", slug, \"_definition.md\"), \"utf8\");\n return /^internalId:\\s*\"?([^\"\\s]+)\"?\\s*$/m.exec(text)?.[1];\n } catch {\n return undefined;\n }\n}\n","/**\n * Do the two versions of a page measure the same thing?\n *\n * Every other validity check a test has asks whether the *split* was sound —\n * that the traffic divided as intended, that nobody saw both pages, that both\n * arms exist. This asks the question underneath all of them, and nothing else\n * asks it: **the two versions agree about what an event means only because a\n * person made them agree.**\n *\n * A conversion is a name the company chose, matched against `data-baker-*`\n * declarations in the page's own source. Move the thing that carries one and\n * the name keeps counting, from a different action, and every number\n * downstream is arithmetic on two incomparable quantities. Nothing detects it:\n * the split is fine, there is no crossover, both arms are counted the same way,\n * and the defect is entirely in what the two pages chose to call the same.\n *\n * Found on a live test, which is why this exists. The page fired\n * `data-baker-view=\"checkout_popup\"` from inside a modal that starts `hidden`,\n * so it counted a visitor who **opened** the purchase form. The new version\n * moved that form inline and kept the name, so the same attribute fired when\n * the block **scrolled into view**. The new version \"won\" that step by 2.6x on\n * two separate pages, and the comparison was between a click and a scroll. The\n * source comment on the variant said the name was kept \"so they can be\n * compared\": the intent was right and nobody could see the result was not.\n *\n * ## Only the sections the two arms do not share\n *\n * A shared section is literally the same file — the variant imports it out of\n * the page's folder — so an event declared there cannot differ, by\n * construction. The comparison is between the sections the variant **forked**\n * and the sections of the page they replaced. That is also what keeps this\n * quiet: it can only fire on markup the test itself changed.\n *\n * ## Declarative triggers only\n *\n * It reads `data-baker-view=\"x\"` and `data-baker-event=\"x\"` out of the source.\n * An event fired from script, or named by an expression rather than a literal,\n * is invisible to it — so a clean result is \"nothing declared differs\", never\n * \"the two versions measure the same thing\". That is worth knowing and does not\n * make the declarative half less worth catching: the defect above was\n * declarative, and so is every trigger the scaffold's own components emit.\n */\n\nimport { readFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport type { ExperimentComposition } from \"@baker/api/experiments\";\nimport { landingGraphFiles } from \"../landings/import-graph.ts\";\n\n/** One `data-baker-*` declaration, as the page's source carries it. */\nexport interface EventDeclaration {\n /** The event name a conversion is matched on — `page:<name>` once counted. */\n readonly name: string;\n /** `data-baker-view` (scrolled into view) or `data-baker-event` (did something). */\n readonly attribute: string;\n /** The opening tag that carries it — what actually decides when the event fires. */\n readonly markup: string;\n}\n\n/**\n * Why two versions may not be measuring the same thing, worst first.\n *\n * - `trigger_differs` — one version fires the name on a view and the other on\n * an action. Two different questions with one answer.\n * - `markup_differs` — the same kind of trigger on an element the test changed.\n * Often harmless and never safe to assume so: whether it still fires on the\n * same action is a question about the surrounding markup, which a person can\n * answer in a glance and this cannot.\n * - `variant_only_missing` / `control_only_missing` — only one version fires\n * the name at all, so the other can only ever read zero for it.\n */\nexport type MeasurementDriftReason =\n | \"trigger_differs\"\n | \"markup_differs\"\n | \"variant_only_missing\"\n | \"control_only_missing\";\n\nexport interface MeasurementDrift {\n readonly name: string;\n readonly reason: MeasurementDriftReason;\n}\n\n/**\n * `data-baker-view=\"x\"` and `data-baker-event=\"x\"`, with the tag around them.\n *\n * The tag is taken by scanning back to the `<` that opens it and forward to the\n * `>` that closes it, rather than by parsing: these are Astro files, so any\n * parser would have to understand the template syntax too, and the opening tag\n * is the whole of what this needs.\n */\nexport function eventDeclarationsIn(source: string): EventDeclaration[] {\n const found: EventDeclaration[] = [];\n const pattern = /\\b(data-baker-(?:view|event))\\s*=\\s*[\"']([^\"']+)[\"']/g;\n for (const match of source.matchAll(pattern)) {\n const at = match.index;\n const opens = source.lastIndexOf(\"<\", at);\n const closes = source.indexOf(\">\", at);\n found.push({\n name: match[2] as string,\n attribute: match[1] as string,\n markup: normalise(source.slice(opens < 0 ? at : opens, closes < 0 ? at + match[0].length : closes + 1)),\n });\n }\n return found;\n}\n\n/** Whitespace is layout, not meaning: a reflowed attribute list is the same element. */\nfunction normalise(markup: string): string {\n return markup.replace(/\\s+/g, \" \").trim();\n}\n\n/**\n * Every event name the two versions might not agree about.\n *\n * A name declared identically on both sides is left out — the point of this is\n * to be worth reading, and a warning on every event a forked section happens to\n * carry is a warning nobody reads.\n */\nexport function measurementDrift(\n control: readonly EventDeclaration[],\n variant: readonly EventDeclaration[],\n): MeasurementDrift[] {\n const names = [...new Set([...control, ...variant].map((entry) => entry.name))].sort();\n return names.flatMap((name): MeasurementDrift[] => {\n const left = control.filter((entry) => entry.name === name);\n const right = variant.filter((entry) => entry.name === name);\n if (right.length === 0) return [{ name, reason: \"variant_only_missing\" }];\n if (left.length === 0) return [{ name, reason: \"control_only_missing\" }];\n if (setOf(left, (entry) => entry.attribute) !== setOf(right, (entry) => entry.attribute)) {\n return [{ name, reason: \"trigger_differs\" }];\n }\n if (setOf(left, (entry) => entry.markup) !== setOf(right, (entry) => entry.markup)) {\n return [{ name, reason: \"markup_differs\" }];\n }\n return [];\n });\n}\n\n/**\n * Two sets of declarations, compared as one string. Joined on a newline because\n * {@link normalise} has already collapsed every run of whitespace, so no member\n * can contain one and no two different sets can join to the same value.\n */\nfunction setOf(entries: readonly EventDeclaration[], of: (entry: EventDeclaration) => string): string {\n return [...new Set(entries.map(of))].sort().join(\"\\n\");\n}\n\n/**\n * The same answer, read from the workspace.\n *\n * Compares only what the two arms do not share: the sections the variant owns\n * (`composition.forked`), against the sections of the page they replaced. The\n * variant's slug is not needed — the composition already names its files. Returns an empty list rather\n * than throwing when the files cannot be read — a brief without this warning is\n * worse than one with it and much better than a test that could not be started,\n * which is the same trade `readComposition` makes beside it.\n */\nexport async function readMeasurementDrift(\n root: string,\n controlSlug: string,\n composition: ExperimentComposition | undefined,\n): Promise<MeasurementDrift[]> {\n if (!composition) return [];\n try {\n const pageSections = sectionsOf([...(await landingGraphFiles(root, controlSlug))], controlSlug);\n const shared = new Set(composition.shared);\n const [control, variant] = await Promise.all([\n declarationsOf(\n root,\n pageSections.filter((file) => !shared.has(file)),\n ),\n declarationsOf(root, composition.forked),\n ]);\n return measurementDrift(control, variant);\n } catch {\n return [];\n }\n}\n\n/** Sections only. `index.astro` is the page, and every arm owns its own. */\nfunction sectionsOf(files: readonly string[], slug: string): string[] {\n const prefix = `src/pages/${slug}/`;\n return files.filter((file) => file.startsWith(prefix) && !file.slice(prefix.length).startsWith(\"index.\"));\n}\n\nasync function declarationsOf(root: string, files: readonly string[]): Promise<EventDeclaration[]> {\n const sources = await Promise.all(files.map((file) => readFile(path.join(root, file), \"utf8\").catch(() => \"\")));\n return sources.flatMap(eventDeclarationsIn);\n}\n","/**\n * One test's status row, as the agent reads it.\n *\n * The wire row is shaped for the dashboard, which formats its own dates and\n * draws its own pictures: epoch milliseconds (a projection is fractional),\n * preview and snapshot URLs, the hypothesis in parts. Printed as-is it cost an\n * agent three calls to find one date, and a hand-converted epoch once told a\n * client a test needed ten more months.\n *\n * So every moment is a date a reader can say aloud, the projection says how\n * far off it is in the same words the hint and the card use, and the fields\n * that decide come first. `--full` keeps every field the server sent, with the\n * same dates.\n */\n\nimport {\n describeWait,\n type ExperimentArm,\n type ExperimentMetric,\n type ExperimentStatusRow,\n} from \"@baker/api/experiments\";\nimport { buildStatusHints } from \"./hints.ts\";\n\ninterface ReadoutOptions {\n readonly full: boolean;\n readonly now: number;\n}\n\nfunction isoMoment(ms: number): string;\nfunction isoMoment(ms: number | null): string | null;\nfunction isoMoment(ms: number | null): string | null {\n return ms === null ? null : new Date(ms).toISOString();\n}\n\n/**\n * A projection from today's traffic is known to the day, never to the millisecond.\n * The day is UTC's: a company has no timezone to read it in, and a projection is\n * not precise enough for the hour to matter.\n */\nfunction isoDay(ms: number | null): string | null {\n return ms === null ? null : new Date(ms).toISOString().slice(0, 10);\n}\n\n/** A rate to the precision anyone reads one at: 4.61%, not 4.611650485436893%. */\nfunction compactArm(arm: ExperimentArm) {\n return { visitors: arm.visitors, conversions: arm.conversions, rate: Math.round(arm.rate * 10_000) / 10_000 };\n}\n\n/** A secondary is context, read by its one word; its rates, lift and interval are for --full. */\nfunction compactMetric(metric: ExperimentMetric) {\n return {\n name: metric.name,\n reading: metric.reading,\n control: metric.control.conversions,\n variant: metric.variant.conversions,\n };\n}\n\nfunction fullArm(arm: ExperimentArm) {\n return {\n ...arm,\n ...(arm.snapshotCapturedAt === undefined ? {} : { snapshotCapturedAt: isoMoment(arm.snapshotCapturedAt) }),\n };\n}\n\nexport function statusReadout(row: ExperimentStatusRow, { full, now }: ReadoutOptions): Record<string, unknown> {\n const decisionWhen = {\n earliestDecisionAt: isoDay(row.earliestDecisionAt),\n ...(row.earliestDecisionAt === null ? {} : { earliestDecisionIn: describeWait(row.earliestDecisionAt, now) }),\n };\n const moments = {\n // A held test has not started; its `startedAt` is a placeholder the first\n // resume replaces, and `pausedAt` already dates the hold.\n ...(row.onHold ? {} : { startedAt: isoMoment(row.startedAt) }),\n pausedAt: isoMoment(row.pausedAt),\n finishedAt: isoMoment(row.finishedAt),\n };\n // A moment that has not happened is left off the compact row: four running\n // tests printed eight `null`s (BAKER-2587).\n const happened = Object.fromEntries(Object.entries(moments).filter(([, moment]) => moment !== null));\n\n if (full) {\n return {\n ...row,\n ...moments,\n ...decisionWhen,\n control: fullArm(row.control),\n variant: fullArm(row.variant),\n };\n }\n\n return {\n experimentId: row.experimentId,\n landingSlug: row.landingSlug,\n variantSlug: row.variantSlug,\n status: row.status,\n // Published with the split off: `resume` is what starts it, not what restarts it.\n ...(row.onHold ? { onHold: true } : {}),\n verdict: row.verdict,\n summary: row.summary,\n ...(row.winner === null ? {} : { winner: row.winner }),\n ...(row.invalidReason === null ? {} : { invalidReason: row.invalidReason }),\n stillNeeded: row.stillNeeded,\n ...decisionWhen,\n // Said only when it is so, like `onHold`: a test that will conclude is the usual case.\n ...(row.willNotConclude ? { willNotConclude: true } : {}),\n control: compactArm(row.control),\n variant: compactArm(row.variant),\n ...(row.secondary.length === 0 ? {} : { secondary: row.secondary.map(compactMetric) }),\n // The hypothesis prose, the goal's key and a finished test's learning are\n // read once, not on every look: they were most of a four-test print\n // (BAKER-2587, BAKER-2789). `--full` and `experiment history` carry them.\n goalLabel: row.goalLabel,\n ...happened,\n ...(row.status === \"finished\"\n ? {\n survivor: row.survivor,\n hypothesisOutcome: row.hypothesisOutcome,\n fold: row.fold,\n endReason: row.endReason,\n }\n : {}),\n };\n}\n\n/** What `experiment status` prints: every row as the agent reads it, and the hints on what to do next. */\nexport function statusEnvelope(\n rows: readonly ExperimentStatusRow[],\n options: ReadoutOptions & { readonly statuses?: readonly ExperimentStatusRow[\"status\"][] },\n) {\n return {\n ok: true as const,\n data: { experiments: rows.map((row) => statusReadout(row, options)) },\n hints: buildStatusHints(rows, options.now, options.statuses),\n };\n}\n","/**\n * Whether this chat is hearing something for the first time, so guidance that\n * does not change between calls is said once rather than on every re-size: two\n * goals × two lifts printed the same ~2 KB four times (BAKER-1992).\n *\n * Kept in the Runtime's temp directory. A fresh Runtime, or a call outside a\n * chat, says it again — repeating is the safe side of forgetting.\n */\n\nimport { createHash } from \"node:crypto\";\nimport { mkdirSync, writeFileSync } from \"node:fs\";\nimport { tmpdir } from \"node:os\";\nimport path from \"node:path\";\nimport { optionalChatId } from \"../../env.ts\";\n\nexport function firstTimeInChat(topic: string): boolean {\n const chatId = optionalChatId();\n if (!chatId) return true;\n const dir = path.join(tmpdir(), \"baker-said-in-chat\");\n const key = createHash(\"sha256\")\n .update(JSON.stringify([chatId, topic]))\n .digest(\"hex\");\n try {\n mkdirSync(dir, { recursive: true });\n writeFileSync(path.join(dir, key), \"\", { flag: \"wx\" });\n return true;\n } catch (error) {\n return !(error instanceof Error && \"code\" in error && error.code === \"EEXIST\");\n }\n}\n","import type { ExperimentUpdateRequest } from \"@baker/api/experiments\";\nimport { parseEvidence } from \"./hypothesis.ts\";\n\n/**\n * `baker experiment update`'s flags, into the request — or the reason they\n * cannot be.\n *\n * Pure so the two rules that matter are pinned: a call that changes nothing is\n * refused before it reaches the network, and `--expect` is checked here for the\n * same two values `start` accepts. Which fields a *live* test may change is\n * decided by the backend, which knows whether the test has started; this only\n * shapes what was typed.\n */\nexport function buildUpdateRequest(\n args: {\n id: unknown;\n because?: unknown;\n change?: unknown;\n expect?: unknown;\n evidence?: unknown;\n goal?: unknown;\n variantGoal?: unknown;\n lift?: unknown;\n learning?: unknown;\n },\n /** The command line, so a repeated `--evidence` keeps every citation. */\n rawArgs?: readonly string[],\n): ExperimentUpdateRequest | { error: string } {\n const expect = args.expect === undefined ? undefined : String(args.expect);\n if (expect !== undefined && expect !== \"increase\" && expect !== \"decrease\") {\n return {\n error: \"`--expect` is either `increase` or `decrease` — which way should the goal move if you are right?\",\n };\n }\n const evidence = parseEvidence(args.evidence as string | string[] | undefined, rawArgs);\n if (evidence && \"error\" in evidence) return evidence;\n\n const lift = args.lift === undefined ? undefined : Number(args.lift);\n if (lift !== undefined && !(lift > 0)) {\n return {\n error: \"`--lift` is the smallest improvement worth detecting, relative — 0.2 is +20%. It must be above zero.\",\n };\n }\n\n const request: ExperimentUpdateRequest = {\n experimentId: String(args.id),\n ...typed(\"because\", args.because),\n ...typed(\"change\", args.change),\n ...typed(\"goal\", args.goal),\n ...typed(\"variantGoal\", args.variantGoal),\n ...typed(\"learning\", args.learning),\n ...(expect === undefined ? {} : { expect }),\n ...(evidence ? { evidence } : {}),\n ...(lift === undefined ? {} : { minDetectableRelativeLift: lift }),\n };\n if (Object.keys(request).length === 1) {\n return {\n error:\n \"Nothing to change. Pass --because, --change or --evidence; on a finished test, --learning; on a test that has not been published yet, also --expect, --goal, --variant-goal or --lift\",\n };\n }\n return request;\n}\n\n/** The flag as typed, or nothing at all — so an absent flag never blanks a field. */\nfunction typed<K extends \"because\" | \"change\" | \"goal\" | \"variantGoal\" | \"learning\">(\n key: K,\n value: unknown,\n): { [P in K]?: string } {\n return value === undefined ? {} : ({ [key]: String(value) } as { [P in K]: string });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAS,SAAS;AAEX,IAAM,8BAA8B,EAAE,OAAO;AAAA;AAAA,EAElD,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,EAAE;AAAA;AAAA,EAE3C,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG;AAC9C,CAAC;;;ACQD,SAAS,KAAAA,UAAS;AAIX,IAA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,OAAO,QAAQ,IAAI;AAGzB,QAAM,cAAc,MAAM,gBAAgB,MAAM,SAAS,OAAO;AAChE,QAAM,CAAC,cAAc,cAAc,mBAAmB,iBAAiB,IAAI,MAAM,QAAQ,IAAI;AAAA,IAC3F,UAAU,MAAM,OAAO;AAAA,IACvB,UAAU,MAAM,OAAO;AAAA;AAAA;AAAA,IAGvB,mBAAmB,MAAM,OAAO;AAAA,IAChC,mBAAmB,MAAM,OAAO;AAAA,EAClC,CAAC;AACD,SAAO;AAAA,IACL;AAAA,IACA,UAAU,YAAY,cAAc,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA,IAKhD,OAAO,MAAM,qBAAqB,MAAM,SAAS,WAAW;AAAA,IAC5D;AAAA,IACA;AAAA,EACF;AACF;","names":["z","z","z","count","z","z","z","z","knownFlows","readdir","readFile","path","path","readdir","readFile","describeWait","readFile","path","readFile","path","readFile","path","path","path"]}