@koda-sl/baker-cli 0.553.0 → 0.555.0

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 (857) hide show
  1. package/README.md +8 -4
  2. package/dist/account-H5CL6KUY.js +82 -0
  3. package/dist/account-assets-QMKT5AT7.js +290 -0
  4. package/dist/account-level-BELF6JHB.js +611 -0
  5. package/dist/account-reads-T6GTSAXE.js +219 -0
  6. package/dist/account-users-ZGJCVGX4.js +64 -0
  7. package/dist/accounts-EXQNPSYH.js +701 -0
  8. package/dist/accounts-GNVLFZ3X.js +80 -0
  9. package/dist/actions-Q2BMP27K.js +55 -0
  10. package/dist/activecampaign-SJO2YK6M.js +938 -0
  11. package/dist/add-Q3FGYX5Q.js +305 -0
  12. package/dist/add-YGQBSEVK.js +107 -0
  13. package/dist/ads-7QKQEHKT.js +48 -0
  14. package/dist/ads-H5AEYIY3.js +120 -0
  15. package/dist/adsets-BUIT7HF2.js +182 -0
  16. package/dist/advertisers-ZAHXMIAT.js +123 -0
  17. package/dist/analytics-B6ER4TQ7.js +2437 -0
  18. package/dist/analytics-QW5ZXDJR.js +447 -0
  19. package/dist/animate-Q43SOWB4.js +480 -0
  20. package/dist/asset-writes-JVFE457M.js +50 -0
  21. package/dist/assign-HJ2NXW4W.js +80 -0
  22. package/dist/audience-size-IM3N6W7C.js +76 -0
  23. package/dist/audience-writes-DWSCHYQF.js +327 -0
  24. package/dist/audiences-PYBJU2GV.js +106 -0
  25. package/dist/audit-N3LAQMD4.js +154 -0
  26. package/dist/autocomplete-FBTPT5MA.js +114 -0
  27. package/dist/avatars-Y3DALQIU.js +38 -0
  28. package/dist/bid-pricing-UUAC4GTQ.js +103 -0
  29. package/dist/brand-IZYD5SBJ.js +22 -0
  30. package/dist/brief-NA3E2W4P.js +543 -0
  31. package/dist/campaign-groups-3IUOLEK2.js +99 -0
  32. package/dist/campaign-writes-Y7QNFOE7.js +168 -0
  33. package/dist/campaigns-2Z6WXIVA.js +130 -0
  34. package/dist/campaigns-B2AUW4TV.js +111 -0
  35. package/dist/campaigns-IDEA3LOK.js +113 -0
  36. package/dist/canvas-WHFDCHUP.js +46 -0
  37. package/dist/capabilities-FVMMLKPY.js +147 -0
  38. package/dist/catalog-URTZYAPU.js +66 -0
  39. package/dist/catalogs-OEUNVE4N.js +782 -0
  40. package/dist/chatgpt-YBHXCXWZ.js +47 -0
  41. package/dist/chats-EENMDXWZ.js +449 -0
  42. package/dist/check-7735BPTR.js +107 -0
  43. package/dist/chunk-2QGGI7MF.js +831 -0
  44. package/dist/chunk-3HKZU3Y5.js +19 -0
  45. package/dist/chunk-3OMFSYQ3.js +344 -0
  46. package/dist/chunk-4N3Y5QWW.js +29 -0
  47. package/dist/chunk-4N3Y5QWW.js.map +1 -0
  48. package/dist/chunk-65CQYRMK.js +98 -0
  49. package/dist/chunk-6MZFOMLU.js +225 -0
  50. package/dist/chunk-6PT22YSR.js +91 -0
  51. package/dist/chunk-6WVYBY2G.js +8954 -0
  52. package/dist/chunk-757ZFIL4.js +910 -0
  53. package/dist/chunk-75HAGIH6.js +61 -0
  54. package/dist/chunk-7BVRFQN4.js +430 -0
  55. package/dist/chunk-7TDJCDKT.js +163 -0
  56. package/dist/chunk-AL4MRNYI.js +709 -0
  57. package/dist/chunk-BMNOMOWP.js +156 -0
  58. package/dist/chunk-BS2MC62Y.js +203 -0
  59. package/dist/chunk-C6PWVZQE.js +103 -0
  60. package/dist/chunk-CDTAKCJR.js +178 -0
  61. package/dist/chunk-CH44XVPE.js +142 -0
  62. package/dist/chunk-CJWLDKFO.js +494 -0
  63. package/dist/chunk-DAMC4FKK.js +224 -0
  64. package/dist/chunk-DSDI5DY3.js +115 -0
  65. package/dist/chunk-DSDI5DY3.js.map +1 -0
  66. package/dist/chunk-DWPOAU4Z.js +5471 -0
  67. package/dist/chunk-EENYLJUN.js +225 -0
  68. package/dist/chunk-EJBLF2LI.js +167 -0
  69. package/dist/chunk-EJMPKO6V.js +287 -0
  70. package/dist/chunk-EKXLJRO3.js +197 -0
  71. package/dist/chunk-EL3TDR5S.js +1744 -0
  72. package/dist/chunk-GRDZWZKQ.js +249 -0
  73. package/dist/chunk-GVUBRSD3.js +51 -0
  74. package/dist/chunk-GYREQDTJ.js +392 -0
  75. package/dist/chunk-HBRXFQQV.js +3510 -0
  76. package/dist/chunk-HLHR3EK2.js +23 -0
  77. package/dist/chunk-IMFIRELA.js +547 -0
  78. package/dist/chunk-IOKD77L2.js +89 -0
  79. package/dist/chunk-KDAINT54.js +131 -0
  80. package/dist/chunk-KKKZRQFY.js +297 -0
  81. package/dist/chunk-KOEXPN3G.js +2209 -0
  82. package/dist/chunk-KT5JVIPZ.js +91 -0
  83. package/dist/chunk-LC6PVPJX.js +76 -0
  84. package/dist/chunk-LETR3RQE.js +275 -0
  85. package/dist/chunk-MKLAZD23.js +7857 -0
  86. package/dist/chunk-MKLAZD23.js.map +1 -0
  87. package/dist/chunk-N3PASNUA.js +136 -0
  88. package/dist/chunk-NL77JRKE.js +170 -0
  89. package/dist/chunk-OBQ5YUOZ.js +1902 -0
  90. package/dist/chunk-OTFHIGEO.js +207 -0
  91. package/dist/chunk-PCUWBZM3.js +169 -0
  92. package/dist/chunk-PNWXTOQ4.js +455 -0
  93. package/dist/chunk-PQFTKHDA.js +479 -0
  94. package/dist/chunk-Q5DFEVLE.js +148 -0
  95. package/dist/chunk-QXCGWAC6.js +399 -0
  96. package/dist/chunk-RKDMYL4A.js +438 -0
  97. package/dist/chunk-SCBSAIVV.js +392 -0
  98. package/dist/chunk-SPBUE7R4.js +685 -0
  99. package/dist/chunk-TWFZIHKK.js +219 -0
  100. package/dist/chunk-U6G6ALXP.js +66 -0
  101. package/dist/chunk-UCJAPB5Y.js +334 -0
  102. package/dist/chunk-VFDWUIGR.js +57 -0
  103. package/dist/chunk-WC3YSN7L.js +604 -0
  104. package/dist/chunk-WIOPEK7K.js +930 -0
  105. package/dist/chunk-X3GWGFZP.js +5368 -0
  106. package/dist/chunk-X6U3B6YK.js +343 -0
  107. package/dist/chunk-X6U3B6YK.js.map +1 -0
  108. package/dist/chunk-XYKODRQR.js +191 -0
  109. package/dist/chunk-XZAVBONI.js +64 -0
  110. package/dist/chunk-Y5PNLB24.js +84 -0
  111. package/dist/claim-PGDIRXIC.js +200 -0
  112. package/dist/cli.js +34 -34
  113. package/dist/companies-WTPKGEB3.js +198 -0
  114. package/dist/company-6H2H73YP.js +308 -0
  115. package/dist/complete-2QBC3POO.js +84 -0
  116. package/dist/connect-35YPFAUL.js +45 -0
  117. package/dist/conversation-YZFNEWDV.js +96 -0
  118. package/dist/conversion-upload-command-J2FIO74Y.js +439 -0
  119. package/dist/conversions-ZFDBD3OU.js +140 -0
  120. package/dist/copy-writes-2B36QJUY.js +170 -0
  121. package/dist/create-3H67EUTO.js +62 -0
  122. package/dist/create-ALTOBDP4.js +239 -0
  123. package/dist/create-C3MWUYX2.js +210 -0
  124. package/dist/create-WHTT6IXY.js +135 -0
  125. package/dist/creatives-22BYP5VN.js +118 -0
  126. package/dist/creatives-LTIV3XPT.js +58 -0
  127. package/dist/creatives-Y2WLGDJW.js +223 -0
  128. package/dist/credentials-J5DMQJWN.js +290 -0
  129. package/dist/critique-RFTS2I46.js +232 -0
  130. package/dist/critique-X6XVPIUG.js +1451 -0
  131. package/dist/crm-LWRGJYHW.js +227 -0
  132. package/dist/crm-RUNEJY2R.js +323 -0
  133. package/dist/crop-4V4P3SKI.js +113 -0
  134. package/dist/custom-conversions-V7QPZIB4.js +128 -0
  135. package/dist/customers-IDB6NLQ6.js +65 -0
  136. package/dist/delete-2QKVUKKB.js +67 -0
  137. package/dist/delete-B7BKF24X.js +57 -0
  138. package/dist/delete-HBRYUWAA.js +69 -0
  139. package/dist/demographics-JHB3NFLU.js +141 -0
  140. package/dist/dimensions-KI3OENZD.js +101 -0
  141. package/dist/discard-FEJ6YL22.js +69 -0
  142. package/dist/domain-JYWNXBKS.js +101 -0
  143. package/dist/download-H3ZDQTFG.js +337 -0
  144. package/dist/download-H3ZDQTFG.js.map +1 -0
  145. package/dist/download-LOBPOIU5.js +172 -0
  146. package/dist/draft-2JVWCYRF.js +134 -0
  147. package/dist/draft-2JVWCYRF.js.map +1 -0
  148. package/dist/draft-4WMYCA7I.js +315 -0
  149. package/dist/draft-4WMYCA7I.js.map +1 -0
  150. package/dist/draft-7VGBJIJU.js +260 -0
  151. package/dist/draft-7VGBJIJU.js.map +1 -0
  152. package/dist/draft-DR5BJK7V.js +138 -0
  153. package/dist/draft-DR5BJK7V.js.map +1 -0
  154. package/dist/draft-EB5ZFDVN.js +557 -0
  155. package/dist/draft-EB5ZFDVN.js.map +1 -0
  156. package/dist/draft-I2FLECEX.js +220 -0
  157. package/dist/draft-N56HPS36.js +374 -0
  158. package/dist/draft-N56HPS36.js.map +1 -0
  159. package/dist/draft-ZLZRTPY6.js +332 -0
  160. package/dist/draft-ZLZRTPY6.js.map +1 -0
  161. package/dist/engine/index.js +5 -5
  162. package/dist/experiments-WVTBHD6G.js +236 -0
  163. package/dist/extract-UELZV3NI.js +142 -0
  164. package/dist/extract-UELZV3NI.js.map +1 -0
  165. package/dist/facets-V2ITIUKD.js +117 -0
  166. package/dist/feedback-PXWPR3NZ.js +136 -0
  167. package/dist/feedback-QSIPSNAL.js +115 -0
  168. package/dist/feedback-record-DJHJWJAF.js +269 -0
  169. package/dist/fetch-QVOOC3FA.js +204 -0
  170. package/dist/fit-REGMM46H.js +65 -0
  171. package/dist/flows-EZV3KCV6.js +250 -0
  172. package/dist/fonts-NUX66HEI.js +39 -0
  173. package/dist/forecast-W6HKYVX5.js +121 -0
  174. package/dist/forecast-XDRKCR65.js +169 -0
  175. package/dist/funnel-3YABA3G2.js +397 -0
  176. package/dist/ga4-IJ2UUICC.js +55 -0
  177. package/dist/generate-22HT24SA.js +263 -0
  178. package/dist/get-GQQLBE5C.js +82 -0
  179. package/dist/get-NL3YZFUJ.js +62 -0
  180. package/dist/google-BPB5JLJG.js +162 -0
  181. package/dist/google-BPB5JLJG.js.map +1 -0
  182. package/dist/google-UJ4YJGTJ.js +3285 -0
  183. package/dist/google-ads-RRKKSKDD.js +198 -0
  184. package/dist/history-2UANIBRN.js +102 -0
  185. package/dist/history-YZ727ZRG.js +153 -0
  186. package/dist/hubspot-KWLXJ6QD.js +782 -0
  187. package/dist/ideas-ZO533P5Y.js +45 -0
  188. package/dist/images-VUWUKGD6.js +92 -0
  189. package/dist/ingest-C2HJ5LUY.js +27 -0
  190. package/dist/ingest-H53JR4GK.js +123 -0
  191. package/dist/inspect-BM6GJHQV.js +192 -0
  192. package/dist/instant-experiences-U6U3FYIH.js +264 -0
  193. package/dist/keyword-metrics-R2QCEDYW.js +200 -0
  194. package/dist/keywords-for-site-NBV72C3W.js +131 -0
  195. package/dist/landing-L3WDTW4D.js +28 -0
  196. package/dist/leads-6PF7ZWCH.js +115 -0
  197. package/dist/leads-IG3IIHXG.js +541 -0
  198. package/dist/learn-V2LIBEEY.js +207 -0
  199. package/dist/line-item-writes-GMNWL4DI.js +211 -0
  200. package/dist/line-items-KPIKXLG4.js +107 -0
  201. package/dist/link-X7IYKR5V.js +67 -0
  202. package/dist/linkedin-RONIUYLJ.js +1330 -0
  203. package/dist/linkedin-RONIUYLJ.js.map +1 -0
  204. package/dist/linkedin-person-47XFTBIN.js +139 -0
  205. package/dist/list-PHNA7QIF.js +154 -0
  206. package/dist/list-QF3BANBM.js +306 -0
  207. package/dist/list-SB3SUTH6.js +67 -0
  208. package/dist/log-JFLSSUJ6.js +95 -0
  209. package/dist/make-ZIJQZD5K.js +1367 -0
  210. package/dist/map-NYJT2MGI.js +436 -0
  211. package/dist/mcp-ABQEICYR.js +729 -0
  212. package/dist/media-AT3VV3PU.js +18 -0
  213. package/dist/media-sources-L4BI7HFL.js +35 -0
  214. package/dist/members-BX37KHKO.js +47 -0
  215. package/dist/meta-2GJZPVKM.js +122 -0
  216. package/dist/normalize-M3VMWF4W.js +806 -0
  217. package/dist/normalize-MA2FBBIV.js +144 -0
  218. package/dist/options-NMWWF2HN.js +125 -0
  219. package/dist/organization-GRAA6ZXU.js +949 -0
  220. package/dist/page-photos-ABK4CJME.js +118 -0
  221. package/dist/performance-MQLRSH44.js +5565 -0
  222. package/dist/performance-RUBIGEAQ.js +27 -0
  223. package/dist/promoted-tweet-writes-3P6QFGLN.js +183 -0
  224. package/dist/promoted-tweets-TGFPH7UI.js +119 -0
  225. package/dist/publish-OUVO65Z5.js +344 -0
  226. package/dist/reddit-HWQCUSEM.js +29 -0
  227. package/dist/refresh-ENQDQGTK.js +97 -0
  228. package/dist/release-ZTVXLUQS.js +63 -0
  229. package/dist/remove-XAFRT7O7.js +53 -0
  230. package/dist/reopen-SWSZHXJZ.js +66 -0
  231. package/dist/rerun-MA2GB6WL.js +96 -0
  232. package/dist/research-TDH4OBX6.js +265 -0
  233. package/dist/research-WWJUNYSJ.js +75 -0
  234. package/dist/reset-34HTKUBQ.js +57 -0
  235. package/dist/reset-KMMGLM7W.js +57 -0
  236. package/dist/resolve-2CIIKADD.js +124 -0
  237. package/dist/retry-V7KZIZKR.js +63 -0
  238. package/dist/retry-YXM23NSB.js +65 -0
  239. package/dist/revenue-D4L6U2CW.js +91 -0
  240. package/dist/rule-writes-HUBHHYEO.js +530 -0
  241. package/dist/rules-47LFGCPW.js +217 -0
  242. package/dist/rules-F6RNUOXP.js +99 -0
  243. package/dist/rules-add-SAQRESVK.js +465 -0
  244. package/dist/run-FRPO2WNQ.js +69 -0
  245. package/dist/run-HENSSAQW.js +71 -0
  246. package/dist/scaffold-ad-QQBCUYUO.js +1513 -0
  247. package/dist/scaffold-static-ad-WUOAQEXS.js +1011 -0
  248. package/dist/scaffold-video-KFQAKQUO.js +885 -0
  249. package/dist/schedule-S4XAVVEI.js +64 -0
  250. package/dist/scheduled-agents-ZWAP6QLC.js +55 -0
  251. package/dist/schema-EJ2XPUN6.js +135 -0
  252. package/dist/search-2BAY3KKX.js +177 -0
  253. package/dist/select-K2SXPDDJ.js +110 -0
  254. package/dist/set-prompt-BZFOV3EB.js +199 -0
  255. package/dist/setup-links-QT63UZBR.js +144 -0
  256. package/dist/shopify-Q7TQIQ6N.js +4009 -0
  257. package/dist/shopify-Q7TQIQ6N.js.map +1 -0
  258. package/dist/site-S6QVMP7W.js +180 -0
  259. package/dist/sources-DTQ4NQAM.js +30 -0
  260. package/dist/sources-ORG5KQSW.js +457 -0
  261. package/dist/stale-5O7BQVTN.js +90 -0
  262. package/dist/status-4G2YUCZR.js +65 -0
  263. package/dist/stock-5SQ2PGEC.js +211 -0
  264. package/dist/stock-5SQ2PGEC.js.map +1 -0
  265. package/dist/studies-QLSKON6M.js +250 -0
  266. package/dist/studio-IDXFTGHP.js +49 -0
  267. package/dist/study-writes-GBUUKX4O.js +471 -0
  268. package/dist/sync-7LJZPHM3.js +57 -0
  269. package/dist/sync-definition-Q3XUSEZJ.js +70 -0
  270. package/dist/tag-manager-5WZPX2FJ.js +43 -0
  271. package/dist/tags-2ARVNEYS.js +23 -0
  272. package/dist/tags-F4IT7RQR.js +23 -0
  273. package/dist/tags-F7ZO52EM.js +23 -0
  274. package/dist/tags-NBGGBHXR.js +227 -0
  275. package/dist/tags-TCSGQYDR.js +26 -0
  276. package/dist/targeting-DAUTJDUB.js +762 -0
  277. package/dist/targeting-criteria-H42LRULY.js +113 -0
  278. package/dist/targets-WB4E5XL2.js +106 -0
  279. package/dist/testimonials-KLF3Y4QO.js +32 -0
  280. package/dist/themes-BGBDYQQK.js +95 -0
  281. package/dist/top-companies-C2W5TJ7G.js +111 -0
  282. package/dist/transcript-S7VR2GJE.js +165 -0
  283. package/dist/translate-CBITGC7C.js +603 -0
  284. package/dist/triggers-EOKMR74O.js +144 -0
  285. package/dist/unlink-PC3TMWUT.js +70 -0
  286. package/dist/unstage-SU2ATDSZ.js +88 -0
  287. package/dist/update-DKX3EEES.js +155 -0
  288. package/dist/update-JYZ45YJG.js +66 -0
  289. package/dist/update-TAZSUOAS.js +192 -0
  290. package/dist/update-WRJUH2NM.js +101 -0
  291. package/dist/upload-BLXTMK5Q.js +130 -0
  292. package/dist/url-params-YVOFU6MK.js +101 -0
  293. package/dist/validate-SAQEORZY.js +125 -0
  294. package/dist/videos-GOIDZVVD.js +41 -0
  295. package/dist/viewer-check-KTRRUVZN.js +83 -0
  296. package/dist/web-6KUM7Q7S.js +173 -0
  297. package/dist/winning-ads-LOMI72Q2.js +86 -0
  298. package/dist/write-commands-3U5ZMIHH.js +1524 -0
  299. package/dist/write-commands-F5XPPLOO.js +1169 -0
  300. package/dist/x-APVY4YHX.js +47 -0
  301. package/package.json +1 -1
  302. package/dist/account-XIC5TTV3.js +0 -82
  303. package/dist/account-assets-V7KSSTVP.js +0 -290
  304. package/dist/account-level-2KLG6HTG.js +0 -611
  305. package/dist/account-reads-ZPZUCB3P.js +0 -219
  306. package/dist/account-users-XTUKRDWK.js +0 -64
  307. package/dist/accounts-25JL77F7.js +0 -701
  308. package/dist/accounts-AF72N4NV.js +0 -80
  309. package/dist/actions-IJO4JW7J.js +0 -55
  310. package/dist/activecampaign-PBTUMTO5.js +0 -938
  311. package/dist/add-KHQXXHC5.js +0 -107
  312. package/dist/add-YQPFRDVM.js +0 -305
  313. package/dist/ads-EVQ37EV3.js +0 -120
  314. package/dist/ads-O5PUYU7H.js +0 -48
  315. package/dist/adsets-4IW5TRAK.js +0 -182
  316. package/dist/advertisers-JNOWSZZC.js +0 -123
  317. package/dist/analytics-CZMCM7XC.js +0 -2437
  318. package/dist/analytics-K5FCQLI5.js +0 -447
  319. package/dist/animate-C6BRMRRD.js +0 -480
  320. package/dist/asset-writes-RF6XTWLY.js +0 -50
  321. package/dist/assign-WXZNXVJH.js +0 -80
  322. package/dist/audience-size-ZCWH4CFC.js +0 -76
  323. package/dist/audience-writes-5KT6FHUY.js +0 -327
  324. package/dist/audiences-ZDOK3OYC.js +0 -106
  325. package/dist/audit-RBRXPPKK.js +0 -154
  326. package/dist/autocomplete-P5OU7QVL.js +0 -114
  327. package/dist/avatars-UHBA2BQ3.js +0 -38
  328. package/dist/bid-pricing-LHNYSDG4.js +0 -103
  329. package/dist/brand-7WL3O74X.js +0 -22
  330. package/dist/brief-HWZU75WP.js +0 -543
  331. package/dist/campaign-groups-BYS3GNEP.js +0 -99
  332. package/dist/campaign-writes-N6OHAK6V.js +0 -168
  333. package/dist/campaigns-2E4AQBFB.js +0 -113
  334. package/dist/campaigns-3U5IRXSV.js +0 -130
  335. package/dist/campaigns-QLKGN4FB.js +0 -111
  336. package/dist/canvas-GGHJ26ZM.js +0 -46
  337. package/dist/capabilities-TKEEHR7K.js +0 -147
  338. package/dist/catalog-7KQN43HS.js +0 -66
  339. package/dist/catalogs-5CHPI4H6.js +0 -782
  340. package/dist/chatgpt-RQQWU7AP.js +0 -47
  341. package/dist/chats-PBXYH2LT.js +0 -449
  342. package/dist/check-SVYI72DF.js +0 -107
  343. package/dist/chunk-2RL2T5JO.js +0 -142
  344. package/dist/chunk-3HLQZTQ3.js +0 -685
  345. package/dist/chunk-42JTSTQ3.js +0 -207
  346. package/dist/chunk-4AEAL63J.js +0 -203
  347. package/dist/chunk-4PM32OS3.js +0 -57
  348. package/dist/chunk-4ULGRGBG.js +0 -333
  349. package/dist/chunk-4ULGRGBG.js.map +0 -1
  350. package/dist/chunk-4XMPL3RU.js +0 -19
  351. package/dist/chunk-5AOTCCTT.js +0 -831
  352. package/dist/chunk-5NLUTJCQ.js +0 -5368
  353. package/dist/chunk-6FWVRXDW.js +0 -64
  354. package/dist/chunk-6MXM6DA6.js +0 -225
  355. package/dist/chunk-73MLPGI2.js +0 -66
  356. package/dist/chunk-7OVPQX4X.js +0 -163
  357. package/dist/chunk-B5UVOCYA.js +0 -344
  358. package/dist/chunk-BRNZMKO4.js +0 -604
  359. package/dist/chunk-CJFCQMUY.js +0 -438
  360. package/dist/chunk-D6VQPBVM.js +0 -5471
  361. package/dist/chunk-DK66PUXL.js +0 -275
  362. package/dist/chunk-DNH2ZPZP.js +0 -287
  363. package/dist/chunk-DWSSQBLO.js +0 -103
  364. package/dist/chunk-ESXUIV6V.js +0 -169
  365. package/dist/chunk-FSEFZZ2T.js +0 -930
  366. package/dist/chunk-I4BQTVMY.js +0 -225
  367. package/dist/chunk-IBBGABK2.js +0 -91
  368. package/dist/chunk-IC4MREQH.js +0 -219
  369. package/dist/chunk-IJ6NQKAT.js +0 -61
  370. package/dist/chunk-IZROFBH7.js +0 -167
  371. package/dist/chunk-J5UTL4HE.js +0 -3510
  372. package/dist/chunk-JBMZVC5D.js +0 -91
  373. package/dist/chunk-LFELUKCA.js +0 -249
  374. package/dist/chunk-LMOZWB4G.js +0 -98
  375. package/dist/chunk-LVLTWPRR.js +0 -392
  376. package/dist/chunk-N5AIO23H.js +0 -2209
  377. package/dist/chunk-NE3OMP7R.js +0 -23
  378. package/dist/chunk-NO52OH3Y.js +0 -156
  379. package/dist/chunk-NRIKX35V.js +0 -399
  380. package/dist/chunk-NZYWKZ3Q.js +0 -76
  381. package/dist/chunk-OIORUNKH.js +0 -1902
  382. package/dist/chunk-OKXLOLEV.js +0 -455
  383. package/dist/chunk-P4MXGSSJ.js +0 -178
  384. package/dist/chunk-PYAR343F.js +0 -479
  385. package/dist/chunk-QFVZIQRQ.js +0 -8954
  386. package/dist/chunk-QI5UKQX3.js +0 -297
  387. package/dist/chunk-RCNAKWK7.js +0 -7852
  388. package/dist/chunk-RCNAKWK7.js.map +0 -1
  389. package/dist/chunk-RHNNFCRY.js +0 -494
  390. package/dist/chunk-RJQT7QXX.js +0 -547
  391. package/dist/chunk-RMZLB4AH.js +0 -197
  392. package/dist/chunk-S4NMWYHW.js +0 -51
  393. package/dist/chunk-S6XZIBWV.js +0 -392
  394. package/dist/chunk-SFQFUQDW.js +0 -170
  395. package/dist/chunk-SP3MHBME.js +0 -89
  396. package/dist/chunk-TGT4XHLX.js +0 -131
  397. package/dist/chunk-VX6GTRT3.js +0 -910
  398. package/dist/chunk-WGJ2QEW4.js +0 -334
  399. package/dist/chunk-XB4NKZAQ.js +0 -136
  400. package/dist/chunk-XSBX3LJP.js +0 -430
  401. package/dist/chunk-XXBP73RV.js +0 -148
  402. package/dist/chunk-Y3SK6EMU.js +0 -84
  403. package/dist/chunk-Y4ZBNZBU.js +0 -191
  404. package/dist/chunk-YCAJCVW4.js +0 -224
  405. package/dist/chunk-ZANXEMON.js +0 -1744
  406. package/dist/chunk-ZMTWQDFC.js +0 -709
  407. package/dist/claim-Q76T3MYA.js +0 -200
  408. package/dist/companies-MLWRWQ73.js +0 -198
  409. package/dist/company-X5Z67PMK.js +0 -308
  410. package/dist/complete-3CFP6XVY.js +0 -84
  411. package/dist/connect-QXFAB4RJ.js +0 -45
  412. package/dist/conversation-C6K6IZTH.js +0 -96
  413. package/dist/conversion-upload-command-D7S5HF22.js +0 -439
  414. package/dist/conversions-4ILDIG3K.js +0 -140
  415. package/dist/copy-writes-FYXKHJDB.js +0 -170
  416. package/dist/create-LDQ3YHET.js +0 -62
  417. package/dist/create-TKOG7DNJ.js +0 -210
  418. package/dist/create-WFMJOZLO.js +0 -135
  419. package/dist/create-WQNT345R.js +0 -239
  420. package/dist/creatives-45SJAD3G.js +0 -118
  421. package/dist/creatives-E4CTMZJJ.js +0 -223
  422. package/dist/creatives-Q4OXNCTT.js +0 -58
  423. package/dist/credentials-E2AIMWKX.js +0 -290
  424. package/dist/critique-EWV3O3TD.js +0 -1451
  425. package/dist/critique-JVT6X2T3.js +0 -232
  426. package/dist/crm-NQH5FTK6.js +0 -227
  427. package/dist/crm-YGQKK76D.js +0 -323
  428. package/dist/crop-KV24WHOR.js +0 -113
  429. package/dist/custom-conversions-EJNX4MCK.js +0 -128
  430. package/dist/customers-YFEPJF4G.js +0 -65
  431. package/dist/delete-2UJVTHRE.js +0 -67
  432. package/dist/delete-7QAJSOCO.js +0 -69
  433. package/dist/delete-O4RO2HMR.js +0 -57
  434. package/dist/demographics-YWBHAMZ5.js +0 -141
  435. package/dist/dimensions-YXOXHOXW.js +0 -101
  436. package/dist/discard-YX4XUXG3.js +0 -69
  437. package/dist/domain-5R6CYVFY.js +0 -101
  438. package/dist/download-D2O4RYJ3.js +0 -172
  439. package/dist/download-SYWQXF57.js +0 -299
  440. package/dist/download-SYWQXF57.js.map +0 -1
  441. package/dist/draft-2NKXOBT6.js +0 -106
  442. package/dist/draft-2NKXOBT6.js.map +0 -1
  443. package/dist/draft-3MPADYS4.js +0 -220
  444. package/dist/draft-AAEGEQZZ.js +0 -247
  445. package/dist/draft-AAEGEQZZ.js.map +0 -1
  446. package/dist/draft-CRDQR5I3.js +0 -342
  447. package/dist/draft-CRDQR5I3.js.map +0 -1
  448. package/dist/draft-I63QQ7LY.js +0 -106
  449. package/dist/draft-I63QQ7LY.js.map +0 -1
  450. package/dist/draft-PO5X4UVA.js +0 -313
  451. package/dist/draft-PO5X4UVA.js.map +0 -1
  452. package/dist/draft-QCKJT7XQ.js +0 -288
  453. package/dist/draft-QCKJT7XQ.js.map +0 -1
  454. package/dist/draft-VMLXZQQX.js +0 -408
  455. package/dist/draft-VMLXZQQX.js.map +0 -1
  456. package/dist/experiments-DYNNWQRB.js +0 -236
  457. package/dist/extract-DWDZI35Y.js +0 -121
  458. package/dist/extract-DWDZI35Y.js.map +0 -1
  459. package/dist/facets-Y2IEM37E.js +0 -117
  460. package/dist/feedback-HJRVTU6C.js +0 -115
  461. package/dist/feedback-IVSLM5PN.js +0 -136
  462. package/dist/feedback-record-P7CO3IGE.js +0 -269
  463. package/dist/fetch-V2U5VUQZ.js +0 -204
  464. package/dist/fit-JDG6E46O.js +0 -65
  465. package/dist/flows-DP574PEX.js +0 -250
  466. package/dist/fonts-RMROS3LX.js +0 -39
  467. package/dist/forecast-AAHHVTBK.js +0 -169
  468. package/dist/forecast-BRXNGMGD.js +0 -121
  469. package/dist/funnel-FQX3DOE7.js +0 -397
  470. package/dist/ga4-A3HLGTSI.js +0 -55
  471. package/dist/generate-SYOQE3F7.js +0 -263
  472. package/dist/get-HMTI2IR6.js +0 -82
  473. package/dist/get-VFDNTZ54.js +0 -62
  474. package/dist/google-HWEDJ4YS.js +0 -144
  475. package/dist/google-HWEDJ4YS.js.map +0 -1
  476. package/dist/google-WH3IXXMX.js +0 -3285
  477. package/dist/google-ads-4DLYASRC.js +0 -198
  478. package/dist/history-6B6RXNV3.js +0 -102
  479. package/dist/history-NLZSX4BK.js +0 -153
  480. package/dist/hubspot-LABBRJ44.js +0 -782
  481. package/dist/ideas-A4ELJN23.js +0 -45
  482. package/dist/images-JVNT7KYM.js +0 -92
  483. package/dist/ingest-GQWR3RHR.js +0 -27
  484. package/dist/ingest-JYN2IDKV.js +0 -123
  485. package/dist/inspect-72DY33YD.js +0 -192
  486. package/dist/instant-experiences-6NTBX4SL.js +0 -264
  487. package/dist/keyword-metrics-GP7L2MQE.js +0 -200
  488. package/dist/keywords-for-site-6YWAUOKJ.js +0 -131
  489. package/dist/landing-EKHAZS5P.js +0 -28
  490. package/dist/leads-RN6RYOMU.js +0 -541
  491. package/dist/leads-UCXIIA5K.js +0 -115
  492. package/dist/learn-EJEFERQZ.js +0 -207
  493. package/dist/line-item-writes-IMCE2FDW.js +0 -211
  494. package/dist/line-items-ISUC3WDO.js +0 -107
  495. package/dist/link-6QL4ZVSU.js +0 -67
  496. package/dist/linkedin-ZOBYUBGV.js +0 -1330
  497. package/dist/linkedin-ZOBYUBGV.js.map +0 -1
  498. package/dist/linkedin-person-C24CBKCH.js +0 -139
  499. package/dist/list-2VNI3U7I.js +0 -154
  500. package/dist/list-PZD2QOZL.js +0 -67
  501. package/dist/list-SUXUMXPJ.js +0 -306
  502. package/dist/log-VLI7KQF2.js +0 -95
  503. package/dist/make-365ZJ25L.js +0 -1367
  504. package/dist/map-OEFL45WA.js +0 -436
  505. package/dist/mcp-NCZYQXQL.js +0 -729
  506. package/dist/media-WASM45QW.js +0 -18
  507. package/dist/media-sources-CZDK4W5Q.js +0 -35
  508. package/dist/members-N3PQSVQC.js +0 -47
  509. package/dist/meta-IRXPQRBH.js +0 -122
  510. package/dist/normalize-4OKUF5BJ.js +0 -806
  511. package/dist/normalize-6DEJPTBF.js +0 -144
  512. package/dist/options-OJX77MYT.js +0 -125
  513. package/dist/organization-URQGKFEC.js +0 -949
  514. package/dist/page-photos-N4S7U7FR.js +0 -118
  515. package/dist/performance-P5T4LJRG.js +0 -27
  516. package/dist/performance-SIWBDORI.js +0 -5565
  517. package/dist/promoted-tweet-writes-S2HP5DEI.js +0 -183
  518. package/dist/promoted-tweets-WZT4N5IR.js +0 -119
  519. package/dist/publish-EDYBQHGJ.js +0 -344
  520. package/dist/reddit-DEGGHR4M.js +0 -29
  521. package/dist/refresh-HPNJGI2U.js +0 -97
  522. package/dist/release-H7M37CEO.js +0 -63
  523. package/dist/remove-MV4YS72N.js +0 -53
  524. package/dist/reopen-EFW2SKOY.js +0 -66
  525. package/dist/rerun-OM4N74YK.js +0 -96
  526. package/dist/research-7YDQOKA6.js +0 -265
  527. package/dist/research-MHXKAQW4.js +0 -75
  528. package/dist/reset-HT4AGJPR.js +0 -57
  529. package/dist/reset-XPZQ5F4D.js +0 -57
  530. package/dist/resolve-RTTXEN2B.js +0 -124
  531. package/dist/retry-DVLVWHEK.js +0 -63
  532. package/dist/retry-SBGWOUQO.js +0 -65
  533. package/dist/revenue-KJLJ53XY.js +0 -91
  534. package/dist/rule-writes-DNXELESR.js +0 -530
  535. package/dist/rules-KCSET46P.js +0 -217
  536. package/dist/rules-NVKU732Z.js +0 -99
  537. package/dist/rules-add-KY42EHJE.js +0 -465
  538. package/dist/run-2LQ7XJEO.js +0 -69
  539. package/dist/run-M7YU6KCV.js +0 -71
  540. package/dist/scaffold-ad-6YPZ75YJ.js +0 -1513
  541. package/dist/scaffold-static-ad-UJEWTDU5.js +0 -1011
  542. package/dist/scaffold-video-M4VWSVJ6.js +0 -885
  543. package/dist/schedule-J7HZQ2EL.js +0 -64
  544. package/dist/scheduled-agents-IVUQUKF4.js +0 -55
  545. package/dist/schema-LHBKBUV7.js +0 -135
  546. package/dist/search-3AW52FO6.js +0 -177
  547. package/dist/select-STIWQ36I.js +0 -110
  548. package/dist/set-prompt-TODWV2F4.js +0 -199
  549. package/dist/setup-links-MNBD3UMH.js +0 -144
  550. package/dist/shopify-PVMHMVIC.js +0 -3980
  551. package/dist/shopify-PVMHMVIC.js.map +0 -1
  552. package/dist/site-ZZUKS6MQ.js +0 -180
  553. package/dist/sources-36MJ6T4V.js +0 -30
  554. package/dist/sources-GNLQHTSJ.js +0 -457
  555. package/dist/stale-GJN7UO3D.js +0 -90
  556. package/dist/status-6EGB6ORB.js +0 -65
  557. package/dist/stock-DJ6I3CTO.js +0 -187
  558. package/dist/stock-DJ6I3CTO.js.map +0 -1
  559. package/dist/studies-4XXCEAHH.js +0 -250
  560. package/dist/studio-OARORMDJ.js +0 -49
  561. package/dist/study-writes-J56UIIE3.js +0 -471
  562. package/dist/sync-QHM3LMAX.js +0 -57
  563. package/dist/sync-definition-YXGN6PIQ.js +0 -70
  564. package/dist/tag-manager-XAX5AI42.js +0 -43
  565. package/dist/tags-GHV5R7NI.js +0 -26
  566. package/dist/tags-IDWUV2FY.js +0 -227
  567. package/dist/tags-MBBRBZJH.js +0 -23
  568. package/dist/tags-MQYF2JHQ.js +0 -23
  569. package/dist/tags-ZGXJHATH.js +0 -23
  570. package/dist/targeting-KJ4DI56R.js +0 -762
  571. package/dist/targeting-criteria-GDCXOAUD.js +0 -113
  572. package/dist/targets-MYHOPAYY.js +0 -106
  573. package/dist/testimonials-R6RFGAKP.js +0 -32
  574. package/dist/themes-LHVXXVTX.js +0 -95
  575. package/dist/top-companies-POTV3Y2A.js +0 -111
  576. package/dist/transcript-4RVYKDVZ.js +0 -165
  577. package/dist/translate-UCASCVMN.js +0 -603
  578. package/dist/triggers-XHMMOZJK.js +0 -144
  579. package/dist/unlink-3IW3EORE.js +0 -70
  580. package/dist/unstage-APVF6KHB.js +0 -88
  581. package/dist/update-2VSJH4LQ.js +0 -66
  582. package/dist/update-42QYBUE3.js +0 -101
  583. package/dist/update-ESK6PSME.js +0 -192
  584. package/dist/update-V7SRDGHN.js +0 -155
  585. package/dist/upload-42IR5RIL.js +0 -130
  586. package/dist/url-params-GEESXN57.js +0 -101
  587. package/dist/validate-Z5SSEUES.js +0 -125
  588. package/dist/videos-PJAPZPOT.js +0 -41
  589. package/dist/viewer-check-6M34VY7K.js +0 -83
  590. package/dist/web-PUVVFMV3.js +0 -173
  591. package/dist/winning-ads-ZCP4MIEQ.js +0 -86
  592. package/dist/write-commands-5LEEPKA7.js +0 -1169
  593. package/dist/write-commands-ZS4O4DSV.js +0 -1524
  594. package/dist/x-2IZMW46M.js +0 -47
  595. /package/dist/{account-XIC5TTV3.js.map → account-H5CL6KUY.js.map} +0 -0
  596. /package/dist/{account-assets-V7KSSTVP.js.map → account-assets-QMKT5AT7.js.map} +0 -0
  597. /package/dist/{account-level-2KLG6HTG.js.map → account-level-BELF6JHB.js.map} +0 -0
  598. /package/dist/{account-reads-ZPZUCB3P.js.map → account-reads-T6GTSAXE.js.map} +0 -0
  599. /package/dist/{account-users-XTUKRDWK.js.map → account-users-ZGJCVGX4.js.map} +0 -0
  600. /package/dist/{accounts-25JL77F7.js.map → accounts-EXQNPSYH.js.map} +0 -0
  601. /package/dist/{accounts-AF72N4NV.js.map → accounts-GNVLFZ3X.js.map} +0 -0
  602. /package/dist/{actions-IJO4JW7J.js.map → actions-Q2BMP27K.js.map} +0 -0
  603. /package/dist/{activecampaign-PBTUMTO5.js.map → activecampaign-SJO2YK6M.js.map} +0 -0
  604. /package/dist/{add-YQPFRDVM.js.map → add-Q3FGYX5Q.js.map} +0 -0
  605. /package/dist/{add-KHQXXHC5.js.map → add-YGQBSEVK.js.map} +0 -0
  606. /package/dist/{ads-O5PUYU7H.js.map → ads-7QKQEHKT.js.map} +0 -0
  607. /package/dist/{ads-EVQ37EV3.js.map → ads-H5AEYIY3.js.map} +0 -0
  608. /package/dist/{adsets-4IW5TRAK.js.map → adsets-BUIT7HF2.js.map} +0 -0
  609. /package/dist/{advertisers-JNOWSZZC.js.map → advertisers-ZAHXMIAT.js.map} +0 -0
  610. /package/dist/{analytics-CZMCM7XC.js.map → analytics-B6ER4TQ7.js.map} +0 -0
  611. /package/dist/{analytics-K5FCQLI5.js.map → analytics-QW5ZXDJR.js.map} +0 -0
  612. /package/dist/{animate-C6BRMRRD.js.map → animate-Q43SOWB4.js.map} +0 -0
  613. /package/dist/{asset-writes-RF6XTWLY.js.map → asset-writes-JVFE457M.js.map} +0 -0
  614. /package/dist/{assign-WXZNXVJH.js.map → assign-HJ2NXW4W.js.map} +0 -0
  615. /package/dist/{audience-size-ZCWH4CFC.js.map → audience-size-IM3N6W7C.js.map} +0 -0
  616. /package/dist/{audience-writes-5KT6FHUY.js.map → audience-writes-DWSCHYQF.js.map} +0 -0
  617. /package/dist/{audiences-ZDOK3OYC.js.map → audiences-PYBJU2GV.js.map} +0 -0
  618. /package/dist/{audit-RBRXPPKK.js.map → audit-N3LAQMD4.js.map} +0 -0
  619. /package/dist/{autocomplete-P5OU7QVL.js.map → autocomplete-FBTPT5MA.js.map} +0 -0
  620. /package/dist/{avatars-UHBA2BQ3.js.map → avatars-Y3DALQIU.js.map} +0 -0
  621. /package/dist/{bid-pricing-LHNYSDG4.js.map → bid-pricing-UUAC4GTQ.js.map} +0 -0
  622. /package/dist/{brand-7WL3O74X.js.map → brand-IZYD5SBJ.js.map} +0 -0
  623. /package/dist/{brief-HWZU75WP.js.map → brief-NA3E2W4P.js.map} +0 -0
  624. /package/dist/{campaign-groups-BYS3GNEP.js.map → campaign-groups-3IUOLEK2.js.map} +0 -0
  625. /package/dist/{campaign-writes-N6OHAK6V.js.map → campaign-writes-Y7QNFOE7.js.map} +0 -0
  626. /package/dist/{campaigns-3U5IRXSV.js.map → campaigns-2Z6WXIVA.js.map} +0 -0
  627. /package/dist/{campaigns-QLKGN4FB.js.map → campaigns-B2AUW4TV.js.map} +0 -0
  628. /package/dist/{campaigns-2E4AQBFB.js.map → campaigns-IDEA3LOK.js.map} +0 -0
  629. /package/dist/{canvas-GGHJ26ZM.js.map → canvas-WHFDCHUP.js.map} +0 -0
  630. /package/dist/{capabilities-TKEEHR7K.js.map → capabilities-FVMMLKPY.js.map} +0 -0
  631. /package/dist/{catalog-7KQN43HS.js.map → catalog-URTZYAPU.js.map} +0 -0
  632. /package/dist/{catalogs-5CHPI4H6.js.map → catalogs-OEUNVE4N.js.map} +0 -0
  633. /package/dist/{chatgpt-RQQWU7AP.js.map → chatgpt-YBHXCXWZ.js.map} +0 -0
  634. /package/dist/{chats-PBXYH2LT.js.map → chats-EENMDXWZ.js.map} +0 -0
  635. /package/dist/{check-SVYI72DF.js.map → check-7735BPTR.js.map} +0 -0
  636. /package/dist/{chunk-5AOTCCTT.js.map → chunk-2QGGI7MF.js.map} +0 -0
  637. /package/dist/{chunk-4XMPL3RU.js.map → chunk-3HKZU3Y5.js.map} +0 -0
  638. /package/dist/{chunk-B5UVOCYA.js.map → chunk-3OMFSYQ3.js.map} +0 -0
  639. /package/dist/{chunk-LMOZWB4G.js.map → chunk-65CQYRMK.js.map} +0 -0
  640. /package/dist/{chunk-I4BQTVMY.js.map → chunk-6MZFOMLU.js.map} +0 -0
  641. /package/dist/{chunk-IBBGABK2.js.map → chunk-6PT22YSR.js.map} +0 -0
  642. /package/dist/{chunk-QFVZIQRQ.js.map → chunk-6WVYBY2G.js.map} +0 -0
  643. /package/dist/{chunk-VX6GTRT3.js.map → chunk-757ZFIL4.js.map} +0 -0
  644. /package/dist/{chunk-IJ6NQKAT.js.map → chunk-75HAGIH6.js.map} +0 -0
  645. /package/dist/{chunk-XSBX3LJP.js.map → chunk-7BVRFQN4.js.map} +0 -0
  646. /package/dist/{chunk-7OVPQX4X.js.map → chunk-7TDJCDKT.js.map} +0 -0
  647. /package/dist/{chunk-ZMTWQDFC.js.map → chunk-AL4MRNYI.js.map} +0 -0
  648. /package/dist/{chunk-NO52OH3Y.js.map → chunk-BMNOMOWP.js.map} +0 -0
  649. /package/dist/{chunk-4AEAL63J.js.map → chunk-BS2MC62Y.js.map} +0 -0
  650. /package/dist/{chunk-DWSSQBLO.js.map → chunk-C6PWVZQE.js.map} +0 -0
  651. /package/dist/{chunk-P4MXGSSJ.js.map → chunk-CDTAKCJR.js.map} +0 -0
  652. /package/dist/{chunk-2RL2T5JO.js.map → chunk-CH44XVPE.js.map} +0 -0
  653. /package/dist/{chunk-RHNNFCRY.js.map → chunk-CJWLDKFO.js.map} +0 -0
  654. /package/dist/{chunk-YCAJCVW4.js.map → chunk-DAMC4FKK.js.map} +0 -0
  655. /package/dist/{chunk-D6VQPBVM.js.map → chunk-DWPOAU4Z.js.map} +0 -0
  656. /package/dist/{chunk-6MXM6DA6.js.map → chunk-EENYLJUN.js.map} +0 -0
  657. /package/dist/{chunk-IZROFBH7.js.map → chunk-EJBLF2LI.js.map} +0 -0
  658. /package/dist/{chunk-DNH2ZPZP.js.map → chunk-EJMPKO6V.js.map} +0 -0
  659. /package/dist/{chunk-RMZLB4AH.js.map → chunk-EKXLJRO3.js.map} +0 -0
  660. /package/dist/{chunk-ZANXEMON.js.map → chunk-EL3TDR5S.js.map} +0 -0
  661. /package/dist/{chunk-LFELUKCA.js.map → chunk-GRDZWZKQ.js.map} +0 -0
  662. /package/dist/{chunk-S4NMWYHW.js.map → chunk-GVUBRSD3.js.map} +0 -0
  663. /package/dist/{chunk-LVLTWPRR.js.map → chunk-GYREQDTJ.js.map} +0 -0
  664. /package/dist/{chunk-J5UTL4HE.js.map → chunk-HBRXFQQV.js.map} +0 -0
  665. /package/dist/{chunk-NE3OMP7R.js.map → chunk-HLHR3EK2.js.map} +0 -0
  666. /package/dist/{chunk-RJQT7QXX.js.map → chunk-IMFIRELA.js.map} +0 -0
  667. /package/dist/{chunk-SP3MHBME.js.map → chunk-IOKD77L2.js.map} +0 -0
  668. /package/dist/{chunk-TGT4XHLX.js.map → chunk-KDAINT54.js.map} +0 -0
  669. /package/dist/{chunk-QI5UKQX3.js.map → chunk-KKKZRQFY.js.map} +0 -0
  670. /package/dist/{chunk-N5AIO23H.js.map → chunk-KOEXPN3G.js.map} +0 -0
  671. /package/dist/{chunk-JBMZVC5D.js.map → chunk-KT5JVIPZ.js.map} +0 -0
  672. /package/dist/{chunk-NZYWKZ3Q.js.map → chunk-LC6PVPJX.js.map} +0 -0
  673. /package/dist/{chunk-DK66PUXL.js.map → chunk-LETR3RQE.js.map} +0 -0
  674. /package/dist/{chunk-XB4NKZAQ.js.map → chunk-N3PASNUA.js.map} +0 -0
  675. /package/dist/{chunk-SFQFUQDW.js.map → chunk-NL77JRKE.js.map} +0 -0
  676. /package/dist/{chunk-OIORUNKH.js.map → chunk-OBQ5YUOZ.js.map} +0 -0
  677. /package/dist/{chunk-42JTSTQ3.js.map → chunk-OTFHIGEO.js.map} +0 -0
  678. /package/dist/{chunk-ESXUIV6V.js.map → chunk-PCUWBZM3.js.map} +0 -0
  679. /package/dist/{chunk-OKXLOLEV.js.map → chunk-PNWXTOQ4.js.map} +0 -0
  680. /package/dist/{chunk-PYAR343F.js.map → chunk-PQFTKHDA.js.map} +0 -0
  681. /package/dist/{chunk-XXBP73RV.js.map → chunk-Q5DFEVLE.js.map} +0 -0
  682. /package/dist/{chunk-NRIKX35V.js.map → chunk-QXCGWAC6.js.map} +0 -0
  683. /package/dist/{chunk-CJFCQMUY.js.map → chunk-RKDMYL4A.js.map} +0 -0
  684. /package/dist/{chunk-S6XZIBWV.js.map → chunk-SCBSAIVV.js.map} +0 -0
  685. /package/dist/{chunk-3HLQZTQ3.js.map → chunk-SPBUE7R4.js.map} +0 -0
  686. /package/dist/{chunk-IC4MREQH.js.map → chunk-TWFZIHKK.js.map} +0 -0
  687. /package/dist/{chunk-73MLPGI2.js.map → chunk-U6G6ALXP.js.map} +0 -0
  688. /package/dist/{chunk-WGJ2QEW4.js.map → chunk-UCJAPB5Y.js.map} +0 -0
  689. /package/dist/{chunk-4PM32OS3.js.map → chunk-VFDWUIGR.js.map} +0 -0
  690. /package/dist/{chunk-BRNZMKO4.js.map → chunk-WC3YSN7L.js.map} +0 -0
  691. /package/dist/{chunk-FSEFZZ2T.js.map → chunk-WIOPEK7K.js.map} +0 -0
  692. /package/dist/{chunk-5NLUTJCQ.js.map → chunk-X3GWGFZP.js.map} +0 -0
  693. /package/dist/{chunk-Y4ZBNZBU.js.map → chunk-XYKODRQR.js.map} +0 -0
  694. /package/dist/{chunk-6FWVRXDW.js.map → chunk-XZAVBONI.js.map} +0 -0
  695. /package/dist/{chunk-Y3SK6EMU.js.map → chunk-Y5PNLB24.js.map} +0 -0
  696. /package/dist/{claim-Q76T3MYA.js.map → claim-PGDIRXIC.js.map} +0 -0
  697. /package/dist/{companies-MLWRWQ73.js.map → companies-WTPKGEB3.js.map} +0 -0
  698. /package/dist/{company-X5Z67PMK.js.map → company-6H2H73YP.js.map} +0 -0
  699. /package/dist/{complete-3CFP6XVY.js.map → complete-2QBC3POO.js.map} +0 -0
  700. /package/dist/{connect-QXFAB4RJ.js.map → connect-35YPFAUL.js.map} +0 -0
  701. /package/dist/{conversation-C6K6IZTH.js.map → conversation-YZFNEWDV.js.map} +0 -0
  702. /package/dist/{conversion-upload-command-D7S5HF22.js.map → conversion-upload-command-J2FIO74Y.js.map} +0 -0
  703. /package/dist/{conversions-4ILDIG3K.js.map → conversions-ZFDBD3OU.js.map} +0 -0
  704. /package/dist/{copy-writes-FYXKHJDB.js.map → copy-writes-2B36QJUY.js.map} +0 -0
  705. /package/dist/{create-LDQ3YHET.js.map → create-3H67EUTO.js.map} +0 -0
  706. /package/dist/{create-WQNT345R.js.map → create-ALTOBDP4.js.map} +0 -0
  707. /package/dist/{create-TKOG7DNJ.js.map → create-C3MWUYX2.js.map} +0 -0
  708. /package/dist/{create-WFMJOZLO.js.map → create-WHTT6IXY.js.map} +0 -0
  709. /package/dist/{creatives-45SJAD3G.js.map → creatives-22BYP5VN.js.map} +0 -0
  710. /package/dist/{creatives-Q4OXNCTT.js.map → creatives-LTIV3XPT.js.map} +0 -0
  711. /package/dist/{creatives-E4CTMZJJ.js.map → creatives-Y2WLGDJW.js.map} +0 -0
  712. /package/dist/{credentials-E2AIMWKX.js.map → credentials-J5DMQJWN.js.map} +0 -0
  713. /package/dist/{critique-JVT6X2T3.js.map → critique-RFTS2I46.js.map} +0 -0
  714. /package/dist/{critique-EWV3O3TD.js.map → critique-X6XVPIUG.js.map} +0 -0
  715. /package/dist/{crm-NQH5FTK6.js.map → crm-LWRGJYHW.js.map} +0 -0
  716. /package/dist/{crm-YGQKK76D.js.map → crm-RUNEJY2R.js.map} +0 -0
  717. /package/dist/{crop-KV24WHOR.js.map → crop-4V4P3SKI.js.map} +0 -0
  718. /package/dist/{custom-conversions-EJNX4MCK.js.map → custom-conversions-V7QPZIB4.js.map} +0 -0
  719. /package/dist/{customers-YFEPJF4G.js.map → customers-IDB6NLQ6.js.map} +0 -0
  720. /package/dist/{delete-2UJVTHRE.js.map → delete-2QKVUKKB.js.map} +0 -0
  721. /package/dist/{delete-O4RO2HMR.js.map → delete-B7BKF24X.js.map} +0 -0
  722. /package/dist/{delete-7QAJSOCO.js.map → delete-HBRYUWAA.js.map} +0 -0
  723. /package/dist/{demographics-YWBHAMZ5.js.map → demographics-JHB3NFLU.js.map} +0 -0
  724. /package/dist/{dimensions-YXOXHOXW.js.map → dimensions-KI3OENZD.js.map} +0 -0
  725. /package/dist/{discard-YX4XUXG3.js.map → discard-FEJ6YL22.js.map} +0 -0
  726. /package/dist/{domain-5R6CYVFY.js.map → domain-JYWNXBKS.js.map} +0 -0
  727. /package/dist/{download-D2O4RYJ3.js.map → download-LOBPOIU5.js.map} +0 -0
  728. /package/dist/{draft-3MPADYS4.js.map → draft-I2FLECEX.js.map} +0 -0
  729. /package/dist/{experiments-DYNNWQRB.js.map → experiments-WVTBHD6G.js.map} +0 -0
  730. /package/dist/{facets-Y2IEM37E.js.map → facets-V2ITIUKD.js.map} +0 -0
  731. /package/dist/{feedback-IVSLM5PN.js.map → feedback-PXWPR3NZ.js.map} +0 -0
  732. /package/dist/{feedback-HJRVTU6C.js.map → feedback-QSIPSNAL.js.map} +0 -0
  733. /package/dist/{feedback-record-P7CO3IGE.js.map → feedback-record-DJHJWJAF.js.map} +0 -0
  734. /package/dist/{fetch-V2U5VUQZ.js.map → fetch-QVOOC3FA.js.map} +0 -0
  735. /package/dist/{fit-JDG6E46O.js.map → fit-REGMM46H.js.map} +0 -0
  736. /package/dist/{flows-DP574PEX.js.map → flows-EZV3KCV6.js.map} +0 -0
  737. /package/dist/{fonts-RMROS3LX.js.map → fonts-NUX66HEI.js.map} +0 -0
  738. /package/dist/{forecast-BRXNGMGD.js.map → forecast-W6HKYVX5.js.map} +0 -0
  739. /package/dist/{forecast-AAHHVTBK.js.map → forecast-XDRKCR65.js.map} +0 -0
  740. /package/dist/{funnel-FQX3DOE7.js.map → funnel-3YABA3G2.js.map} +0 -0
  741. /package/dist/{ga4-A3HLGTSI.js.map → ga4-IJ2UUICC.js.map} +0 -0
  742. /package/dist/{generate-SYOQE3F7.js.map → generate-22HT24SA.js.map} +0 -0
  743. /package/dist/{get-HMTI2IR6.js.map → get-GQQLBE5C.js.map} +0 -0
  744. /package/dist/{get-VFDNTZ54.js.map → get-NL3YZFUJ.js.map} +0 -0
  745. /package/dist/{google-WH3IXXMX.js.map → google-UJ4YJGTJ.js.map} +0 -0
  746. /package/dist/{google-ads-4DLYASRC.js.map → google-ads-RRKKSKDD.js.map} +0 -0
  747. /package/dist/{history-6B6RXNV3.js.map → history-2UANIBRN.js.map} +0 -0
  748. /package/dist/{history-NLZSX4BK.js.map → history-YZ727ZRG.js.map} +0 -0
  749. /package/dist/{hubspot-LABBRJ44.js.map → hubspot-KWLXJ6QD.js.map} +0 -0
  750. /package/dist/{ideas-A4ELJN23.js.map → ideas-ZO533P5Y.js.map} +0 -0
  751. /package/dist/{images-JVNT7KYM.js.map → images-VUWUKGD6.js.map} +0 -0
  752. /package/dist/{ingest-GQWR3RHR.js.map → ingest-C2HJ5LUY.js.map} +0 -0
  753. /package/dist/{ingest-JYN2IDKV.js.map → ingest-H53JR4GK.js.map} +0 -0
  754. /package/dist/{inspect-72DY33YD.js.map → inspect-BM6GJHQV.js.map} +0 -0
  755. /package/dist/{instant-experiences-6NTBX4SL.js.map → instant-experiences-U6U3FYIH.js.map} +0 -0
  756. /package/dist/{keyword-metrics-GP7L2MQE.js.map → keyword-metrics-R2QCEDYW.js.map} +0 -0
  757. /package/dist/{keywords-for-site-6YWAUOKJ.js.map → keywords-for-site-NBV72C3W.js.map} +0 -0
  758. /package/dist/{landing-EKHAZS5P.js.map → landing-L3WDTW4D.js.map} +0 -0
  759. /package/dist/{leads-UCXIIA5K.js.map → leads-6PF7ZWCH.js.map} +0 -0
  760. /package/dist/{leads-RN6RYOMU.js.map → leads-IG3IIHXG.js.map} +0 -0
  761. /package/dist/{learn-EJEFERQZ.js.map → learn-V2LIBEEY.js.map} +0 -0
  762. /package/dist/{line-item-writes-IMCE2FDW.js.map → line-item-writes-GMNWL4DI.js.map} +0 -0
  763. /package/dist/{line-items-ISUC3WDO.js.map → line-items-KPIKXLG4.js.map} +0 -0
  764. /package/dist/{link-6QL4ZVSU.js.map → link-X7IYKR5V.js.map} +0 -0
  765. /package/dist/{linkedin-person-C24CBKCH.js.map → linkedin-person-47XFTBIN.js.map} +0 -0
  766. /package/dist/{list-2VNI3U7I.js.map → list-PHNA7QIF.js.map} +0 -0
  767. /package/dist/{list-SUXUMXPJ.js.map → list-QF3BANBM.js.map} +0 -0
  768. /package/dist/{list-PZD2QOZL.js.map → list-SB3SUTH6.js.map} +0 -0
  769. /package/dist/{log-VLI7KQF2.js.map → log-JFLSSUJ6.js.map} +0 -0
  770. /package/dist/{make-365ZJ25L.js.map → make-ZIJQZD5K.js.map} +0 -0
  771. /package/dist/{map-OEFL45WA.js.map → map-NYJT2MGI.js.map} +0 -0
  772. /package/dist/{mcp-NCZYQXQL.js.map → mcp-ABQEICYR.js.map} +0 -0
  773. /package/dist/{media-WASM45QW.js.map → media-AT3VV3PU.js.map} +0 -0
  774. /package/dist/{media-sources-CZDK4W5Q.js.map → media-sources-L4BI7HFL.js.map} +0 -0
  775. /package/dist/{members-N3PQSVQC.js.map → members-BX37KHKO.js.map} +0 -0
  776. /package/dist/{meta-IRXPQRBH.js.map → meta-2GJZPVKM.js.map} +0 -0
  777. /package/dist/{normalize-4OKUF5BJ.js.map → normalize-M3VMWF4W.js.map} +0 -0
  778. /package/dist/{normalize-6DEJPTBF.js.map → normalize-MA2FBBIV.js.map} +0 -0
  779. /package/dist/{options-OJX77MYT.js.map → options-NMWWF2HN.js.map} +0 -0
  780. /package/dist/{organization-URQGKFEC.js.map → organization-GRAA6ZXU.js.map} +0 -0
  781. /package/dist/{page-photos-N4S7U7FR.js.map → page-photos-ABK4CJME.js.map} +0 -0
  782. /package/dist/{performance-SIWBDORI.js.map → performance-MQLRSH44.js.map} +0 -0
  783. /package/dist/{performance-P5T4LJRG.js.map → performance-RUBIGEAQ.js.map} +0 -0
  784. /package/dist/{promoted-tweet-writes-S2HP5DEI.js.map → promoted-tweet-writes-3P6QFGLN.js.map} +0 -0
  785. /package/dist/{promoted-tweets-WZT4N5IR.js.map → promoted-tweets-TGFPH7UI.js.map} +0 -0
  786. /package/dist/{publish-EDYBQHGJ.js.map → publish-OUVO65Z5.js.map} +0 -0
  787. /package/dist/{reddit-DEGGHR4M.js.map → reddit-HWQCUSEM.js.map} +0 -0
  788. /package/dist/{refresh-HPNJGI2U.js.map → refresh-ENQDQGTK.js.map} +0 -0
  789. /package/dist/{release-H7M37CEO.js.map → release-ZTVXLUQS.js.map} +0 -0
  790. /package/dist/{remove-MV4YS72N.js.map → remove-XAFRT7O7.js.map} +0 -0
  791. /package/dist/{reopen-EFW2SKOY.js.map → reopen-SWSZHXJZ.js.map} +0 -0
  792. /package/dist/{rerun-OM4N74YK.js.map → rerun-MA2GB6WL.js.map} +0 -0
  793. /package/dist/{research-7YDQOKA6.js.map → research-TDH4OBX6.js.map} +0 -0
  794. /package/dist/{research-MHXKAQW4.js.map → research-WWJUNYSJ.js.map} +0 -0
  795. /package/dist/{reset-HT4AGJPR.js.map → reset-34HTKUBQ.js.map} +0 -0
  796. /package/dist/{reset-XPZQ5F4D.js.map → reset-KMMGLM7W.js.map} +0 -0
  797. /package/dist/{resolve-RTTXEN2B.js.map → resolve-2CIIKADD.js.map} +0 -0
  798. /package/dist/{retry-DVLVWHEK.js.map → retry-V7KZIZKR.js.map} +0 -0
  799. /package/dist/{retry-SBGWOUQO.js.map → retry-YXM23NSB.js.map} +0 -0
  800. /package/dist/{revenue-KJLJ53XY.js.map → revenue-D4L6U2CW.js.map} +0 -0
  801. /package/dist/{rule-writes-DNXELESR.js.map → rule-writes-HUBHHYEO.js.map} +0 -0
  802. /package/dist/{rules-KCSET46P.js.map → rules-47LFGCPW.js.map} +0 -0
  803. /package/dist/{rules-NVKU732Z.js.map → rules-F6RNUOXP.js.map} +0 -0
  804. /package/dist/{rules-add-KY42EHJE.js.map → rules-add-SAQRESVK.js.map} +0 -0
  805. /package/dist/{run-2LQ7XJEO.js.map → run-FRPO2WNQ.js.map} +0 -0
  806. /package/dist/{run-M7YU6KCV.js.map → run-HENSSAQW.js.map} +0 -0
  807. /package/dist/{scaffold-ad-6YPZ75YJ.js.map → scaffold-ad-QQBCUYUO.js.map} +0 -0
  808. /package/dist/{scaffold-static-ad-UJEWTDU5.js.map → scaffold-static-ad-WUOAQEXS.js.map} +0 -0
  809. /package/dist/{scaffold-video-M4VWSVJ6.js.map → scaffold-video-KFQAKQUO.js.map} +0 -0
  810. /package/dist/{schedule-J7HZQ2EL.js.map → schedule-S4XAVVEI.js.map} +0 -0
  811. /package/dist/{scheduled-agents-IVUQUKF4.js.map → scheduled-agents-ZWAP6QLC.js.map} +0 -0
  812. /package/dist/{schema-LHBKBUV7.js.map → schema-EJ2XPUN6.js.map} +0 -0
  813. /package/dist/{search-3AW52FO6.js.map → search-2BAY3KKX.js.map} +0 -0
  814. /package/dist/{select-STIWQ36I.js.map → select-K2SXPDDJ.js.map} +0 -0
  815. /package/dist/{set-prompt-TODWV2F4.js.map → set-prompt-BZFOV3EB.js.map} +0 -0
  816. /package/dist/{setup-links-MNBD3UMH.js.map → setup-links-QT63UZBR.js.map} +0 -0
  817. /package/dist/{site-ZZUKS6MQ.js.map → site-S6QVMP7W.js.map} +0 -0
  818. /package/dist/{sources-36MJ6T4V.js.map → sources-DTQ4NQAM.js.map} +0 -0
  819. /package/dist/{sources-GNLQHTSJ.js.map → sources-ORG5KQSW.js.map} +0 -0
  820. /package/dist/{stale-GJN7UO3D.js.map → stale-5O7BQVTN.js.map} +0 -0
  821. /package/dist/{status-6EGB6ORB.js.map → status-4G2YUCZR.js.map} +0 -0
  822. /package/dist/{studies-4XXCEAHH.js.map → studies-QLSKON6M.js.map} +0 -0
  823. /package/dist/{studio-OARORMDJ.js.map → studio-IDXFTGHP.js.map} +0 -0
  824. /package/dist/{study-writes-J56UIIE3.js.map → study-writes-GBUUKX4O.js.map} +0 -0
  825. /package/dist/{sync-QHM3LMAX.js.map → sync-7LJZPHM3.js.map} +0 -0
  826. /package/dist/{sync-definition-YXGN6PIQ.js.map → sync-definition-Q3XUSEZJ.js.map} +0 -0
  827. /package/dist/{tag-manager-XAX5AI42.js.map → tag-manager-5WZPX2FJ.js.map} +0 -0
  828. /package/dist/{tags-MQYF2JHQ.js.map → tags-2ARVNEYS.js.map} +0 -0
  829. /package/dist/{tags-ZGXJHATH.js.map → tags-F4IT7RQR.js.map} +0 -0
  830. /package/dist/{tags-MBBRBZJH.js.map → tags-F7ZO52EM.js.map} +0 -0
  831. /package/dist/{tags-IDWUV2FY.js.map → tags-NBGGBHXR.js.map} +0 -0
  832. /package/dist/{tags-GHV5R7NI.js.map → tags-TCSGQYDR.js.map} +0 -0
  833. /package/dist/{targeting-KJ4DI56R.js.map → targeting-DAUTJDUB.js.map} +0 -0
  834. /package/dist/{targeting-criteria-GDCXOAUD.js.map → targeting-criteria-H42LRULY.js.map} +0 -0
  835. /package/dist/{targets-MYHOPAYY.js.map → targets-WB4E5XL2.js.map} +0 -0
  836. /package/dist/{testimonials-R6RFGAKP.js.map → testimonials-KLF3Y4QO.js.map} +0 -0
  837. /package/dist/{themes-LHVXXVTX.js.map → themes-BGBDYQQK.js.map} +0 -0
  838. /package/dist/{top-companies-POTV3Y2A.js.map → top-companies-C2W5TJ7G.js.map} +0 -0
  839. /package/dist/{transcript-4RVYKDVZ.js.map → transcript-S7VR2GJE.js.map} +0 -0
  840. /package/dist/{translate-UCASCVMN.js.map → translate-CBITGC7C.js.map} +0 -0
  841. /package/dist/{triggers-XHMMOZJK.js.map → triggers-EOKMR74O.js.map} +0 -0
  842. /package/dist/{unlink-3IW3EORE.js.map → unlink-PC3TMWUT.js.map} +0 -0
  843. /package/dist/{unstage-APVF6KHB.js.map → unstage-SU2ATDSZ.js.map} +0 -0
  844. /package/dist/{update-V7SRDGHN.js.map → update-DKX3EEES.js.map} +0 -0
  845. /package/dist/{update-2VSJH4LQ.js.map → update-JYZ45YJG.js.map} +0 -0
  846. /package/dist/{update-ESK6PSME.js.map → update-TAZSUOAS.js.map} +0 -0
  847. /package/dist/{update-42QYBUE3.js.map → update-WRJUH2NM.js.map} +0 -0
  848. /package/dist/{upload-42IR5RIL.js.map → upload-BLXTMK5Q.js.map} +0 -0
  849. /package/dist/{url-params-GEESXN57.js.map → url-params-YVOFU6MK.js.map} +0 -0
  850. /package/dist/{validate-Z5SSEUES.js.map → validate-SAQEORZY.js.map} +0 -0
  851. /package/dist/{videos-PJAPZPOT.js.map → videos-GOIDZVVD.js.map} +0 -0
  852. /package/dist/{viewer-check-6M34VY7K.js.map → viewer-check-KTRRUVZN.js.map} +0 -0
  853. /package/dist/{web-PUVVFMV3.js.map → web-6KUM7Q7S.js.map} +0 -0
  854. /package/dist/{winning-ads-ZCP4MIEQ.js.map → winning-ads-LOMI72Q2.js.map} +0 -0
  855. /package/dist/{write-commands-ZS4O4DSV.js.map → write-commands-3U5ZMIHH.js.map} +0 -0
  856. /package/dist/{write-commands-5LEEPKA7.js.map → write-commands-F5XPPLOO.js.map} +0 -0
  857. /package/dist/{x-2IZMW46M.js.map → x-APVY4YHX.js.map} +0 -0
@@ -0,0 +1,343 @@
1
+ import {
2
+ captureProxyCredentials,
3
+ isChallengeBody,
4
+ isPrivateAddress,
5
+ isProxyFailure,
6
+ nextPlannedRoute,
7
+ plannedRoutes,
8
+ refuseNonPublicUrl,
9
+ shouldEscalate
10
+ } from "./chunk-45D6WRCJ.js";
11
+
12
+ // ../proxy/src/fetch.ts
13
+ import { lookup as dnsLookup } from "dns";
14
+ import { Agent, ProxyAgent, Response, fetch as undiciFetch } from "undici";
15
+
16
+ // ../proxy/src/fetchDecision.ts
17
+ function classifyFetchOutcome(signal) {
18
+ if (isProxyFailure(signal)) return "proxy_unavailable";
19
+ if (shouldEscalate(signal)) return "blocked";
20
+ if (signal.status != null && signal.status >= 200 && signal.status < 400 && !signal.challenge) return "ok";
21
+ return "failed";
22
+ }
23
+ function shouldTryNextRoute(outcome) {
24
+ return outcome === "blocked" || outcome === "proxy_unavailable";
25
+ }
26
+ var TIMEOUT_CODES = /* @__PURE__ */ new Set([
27
+ "UND_ERR_CONNECT_TIMEOUT",
28
+ "UND_ERR_HEADERS_TIMEOUT",
29
+ "UND_ERR_BODY_TIMEOUT",
30
+ "ETIMEDOUT"
31
+ ]);
32
+ var RESET_CODES = /* @__PURE__ */ new Set(["ECONNRESET", "UND_ERR_SOCKET", "EPIPE"]);
33
+ var PROXY_RESPONSE = /Proxy response \((\d+)\)/;
34
+ function errorCode(error) {
35
+ if (typeof error !== "object" || error === null) return null;
36
+ const code = error.code;
37
+ if (typeof code === "string") return code;
38
+ const name = error.name;
39
+ return typeof name === "string" ? name : null;
40
+ }
41
+ function errorMessage(error) {
42
+ if (typeof error === "object" && error !== null) {
43
+ const message = error.message;
44
+ if (typeof message === "string") return message;
45
+ }
46
+ return String(error);
47
+ }
48
+ function errorBlockSignal(error, proxied) {
49
+ const proxyResponse = PROXY_RESPONSE.exec(errorMessage(error));
50
+ if (proxyResponse) {
51
+ const status = Number(proxyResponse[1]);
52
+ return status === 407 ? { status: 407 } : { netError: "ERR_TUNNEL_CONNECTION_FAILED" };
53
+ }
54
+ const code = errorCode(error);
55
+ if (code !== null && TIMEOUT_CODES.has(code)) return { timedOut: true };
56
+ if (code === "AbortError" || code === "TimeoutError") return { timedOut: true };
57
+ if (proxied) {
58
+ return { netError: "ERR_PROXY_CONNECTION_FAILED" };
59
+ }
60
+ if (code !== null && RESET_CODES.has(code)) return { netError: "ERR_CONNECTION_RESET" };
61
+ return { netError: code ?? "ERR_FAILED" };
62
+ }
63
+ function shouldSniffChallenge(contentType, contentLength, maxSniffBytes) {
64
+ if (contentLength !== null && contentLength > maxSniffBytes) return false;
65
+ if (contentType === null || contentType.trim() === "") return true;
66
+ const type = contentType.toLowerCase();
67
+ if (type.startsWith("image/") || type.startsWith("video/") || type.startsWith("audio/")) return false;
68
+ return type.includes("text/") || type.includes("html") || type.includes("json") || type.includes("xml");
69
+ }
70
+
71
+ // ../proxy/src/fetch.ts
72
+ var DEFAULT_TIMEOUT_MS = 6e4;
73
+ var MAX_SNIFF_BYTES = 64 * 1024;
74
+ function tierOf(route) {
75
+ return route.kind === "proxy" ? route.tier : "direct";
76
+ }
77
+ function agentFor(route) {
78
+ if (route.kind !== "proxy") return directAgent();
79
+ const token = Buffer.from(`${route.username}:${route.password}`).toString("base64");
80
+ return new ProxyAgent({ uri: route.server, token: `Basic ${token}` });
81
+ }
82
+ function directAgent() {
83
+ return new Agent({
84
+ connect: {
85
+ lookup: (hostname, options, callback) => {
86
+ dnsLookup(hostname, options, (error, address, family) => {
87
+ if (error) {
88
+ callback(error, address, family);
89
+ return;
90
+ }
91
+ const found = Array.isArray(address) ? address.map((entry) => entry.address) : [address];
92
+ const blocked = found.find((entry) => isPrivateAddress(entry));
93
+ if (blocked !== void 0) {
94
+ callback(new Error(`${PRIVATE_ADDRESS_CODE}: ${hostname} resolves to ${blocked}`), "", 4);
95
+ return;
96
+ }
97
+ callback(null, address, family);
98
+ });
99
+ }
100
+ }
101
+ });
102
+ }
103
+ var PRIVATE_ADDRESS_CODE = "EPRIVATEADDR";
104
+ var MAX_REDIRECTS = 20;
105
+ var REDIRECT_STATUS = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
106
+ function originOf(url) {
107
+ try {
108
+ return new URL(url).origin;
109
+ } catch {
110
+ return null;
111
+ }
112
+ }
113
+ function refuseRedirect(entry, to) {
114
+ if (refuseNonPublicUrl(to) === null) return false;
115
+ const destination = originOf(to);
116
+ return destination === null || destination !== originOf(entry);
117
+ }
118
+ async function followRedirects(url, init) {
119
+ let current = url;
120
+ let request = { ...init, redirect: "manual" };
121
+ for (let hop = 0; hop <= MAX_REDIRECTS; hop++) {
122
+ const response = await undiciFetch(current, request);
123
+ const location = response.headers.get("location");
124
+ if (!REDIRECT_STATUS.has(response.status) || location === null) return response;
125
+ await response.body?.cancel();
126
+ const next = new URL(location, current).toString();
127
+ if (refuseRedirect(url, next)) {
128
+ throw new Error(`${PRIVATE_ADDRESS_CODE}: redirected to ${next}`);
129
+ }
130
+ const method = (request.method ?? "GET").toUpperCase();
131
+ const downgrade = response.status === 303 || (response.status === 301 || response.status === 302) && method === "POST";
132
+ request = downgrade ? { ...request, method: "GET", body: void 0 } : request;
133
+ current = next;
134
+ }
135
+ throw new Error(`too many redirects following ${url}`);
136
+ }
137
+ var NULL_BODY_STATUS = /* @__PURE__ */ new Set([101, 103, 204, 205, 304]);
138
+ function rebuild(response, body) {
139
+ if (response.status < 200 || response.status > 599 || NULL_BODY_STATUS.has(response.status)) {
140
+ return new Response(null, { status: response.status, headers: response.headers });
141
+ }
142
+ return new Response(body, {
143
+ status: response.status,
144
+ statusText: response.statusText,
145
+ headers: response.headers
146
+ });
147
+ }
148
+ function declaredLength(response) {
149
+ const raw = response.headers.get("content-length");
150
+ if (raw === null) return null;
151
+ const value = Number(raw);
152
+ return Number.isFinite(value) ? value : null;
153
+ }
154
+ async function readOnce(response, sniff, maxBytes) {
155
+ const declared = declaredLength(response);
156
+ if (maxBytes !== void 0 && declared !== null && declared > maxBytes) {
157
+ await response.body?.cancel();
158
+ return { response: rebuild(response, new ArrayBuffer(0)), challenge: false };
159
+ }
160
+ const body = await response.arrayBuffer();
161
+ const wantsSniff = sniff && shouldSniffChallenge(response.headers.get("content-type"), body.byteLength, MAX_SNIFF_BYTES);
162
+ const challenge = wantsSniff ? isChallengeBody(new TextDecoder().decode(body)) : false;
163
+ return { response: rebuild(response, body), challenge };
164
+ }
165
+ async function attemptRoute(url, init, route, options) {
166
+ const tier = tierOf(route);
167
+ const agent = agentFor(route);
168
+ const startedAt = Date.now();
169
+ const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
170
+ const signal = init.signal ? AbortSignal.any([init.signal, AbortSignal.timeout(timeoutMs)]) : AbortSignal.timeout(timeoutMs);
171
+ try {
172
+ const raw = await followRedirects(url, { ...init, dispatcher: agent ?? void 0, signal });
173
+ const read = await readOnce(raw, options.sniffChallenge ?? true, options.maxBytes);
174
+ const outcome = classifyFetchOutcome({ status: raw.status, challenge: read.challenge });
175
+ return {
176
+ attempt: { tier, status: raw.status, ms: Date.now() - startedAt, outcome },
177
+ response: outcome === "proxy_unavailable" ? null : read.response
178
+ };
179
+ } catch (error) {
180
+ const blockSignal = errorBlockSignal(error, route.kind === "proxy");
181
+ return {
182
+ attempt: {
183
+ tier,
184
+ status: blockSignal.status ?? void 0,
185
+ ms: Date.now() - startedAt,
186
+ outcome: classifyFetchOutcome(blockSignal)
187
+ },
188
+ response: null,
189
+ error
190
+ };
191
+ } finally {
192
+ await agent?.close();
193
+ }
194
+ }
195
+ async function fetchWithEscalation(url, init, options) {
196
+ const attempts = [];
197
+ let originResponse = null;
198
+ let originTier = "direct";
199
+ let lastError;
200
+ const routes = plannedRoutes(url, options.credentials, options.routeOptions);
201
+ const tried = [];
202
+ for (let route = routes[0] ?? null; route !== null; route = nextPlannedRoute(routes, tried)) {
203
+ const rung = await attemptRoute(url, init, route, options);
204
+ attempts.push(rung.attempt);
205
+ tried.push({ tier: rung.attempt.tier, proxyFailure: rung.attempt.outcome === "proxy_unavailable" });
206
+ if (rung.response !== null) {
207
+ originResponse = rung.response;
208
+ originTier = rung.attempt.tier;
209
+ }
210
+ if (rung.error !== void 0) lastError = rung.error;
211
+ if (!shouldTryNextRoute(rung.attempt.outcome)) break;
212
+ }
213
+ return {
214
+ response: originResponse,
215
+ attempts,
216
+ finalTier: originResponse !== null ? originTier : lastAttempt(attempts)?.tier ?? "direct",
217
+ ...originResponse === null && lastError !== void 0 ? { error: lastError } : {}
218
+ };
219
+ }
220
+ function lastAttempt(attempts) {
221
+ return attempts[attempts.length - 1];
222
+ }
223
+ function describeLadder(result) {
224
+ const rungs = result.attempts.map((a) => `${a.tier}:${a.outcome}${a.status ? `(${a.status})` : ""}@${a.ms}ms`);
225
+ return `${rungs.join(" \u2192 ")} | final=${result.finalTier}`;
226
+ }
227
+ function rescued(result) {
228
+ return result.attempts.some((attempt) => attempt.outcome === "ok");
229
+ }
230
+ function endedBlocked(result) {
231
+ if (rescued(result)) return false;
232
+ return result.attempts.some((attempt) => attempt.outcome === "blocked");
233
+ }
234
+ function endedProxyUnavailable(result) {
235
+ if (rescued(result) || endedBlocked(result)) return false;
236
+ return result.attempts.some((attempt) => attempt.outcome === "proxy_unavailable");
237
+ }
238
+ function endedPrivateAddress(result) {
239
+ if (rescued(result)) return false;
240
+ for (let error = result.error, depth = 0; error instanceof Error && depth < 5; depth++) {
241
+ if (error.message.includes(PRIVATE_ADDRESS_CODE)) return true;
242
+ error = error.cause;
243
+ }
244
+ return false;
245
+ }
246
+
247
+ // src/lib/externalFetch.ts
248
+ var BROWSER_HEADERS = {
249
+ "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36",
250
+ Accept: "image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8",
251
+ "Accept-Language": "en-US,en;q=0.9"
252
+ };
253
+ var NOT_PUBLIC_MESSAGE = "That address is not reachable from the public web, so there is nothing to read.";
254
+ var NO_ANSWER_MESSAGE = "That address did not answer.";
255
+ var MAX_REMOTE_IMAGE_BYTES = 25e6;
256
+ var ExternalFetchError = class extends Error {
257
+ /** True when the fault was ours — a route we could not open, not a dead host. */
258
+ ourFault;
259
+ /** The HTTP status the host answered with, when it answered at all. */
260
+ status;
261
+ constructor(message, ourFault, status = null) {
262
+ super(message);
263
+ this.name = "ExternalFetchError";
264
+ this.ourFault = ourFault;
265
+ this.status = status;
266
+ }
267
+ };
268
+ var OversizeFetchError = class extends ExternalFetchError {
269
+ constructor(message) {
270
+ super(message, false);
271
+ this.name = "OversizeFetchError";
272
+ }
273
+ };
274
+ async function fetchExternal(url, options = {}) {
275
+ if (refuseNonPublicUrl(url) !== null) {
276
+ throw new ExternalFetchError(NOT_PUBLIC_MESSAGE, false);
277
+ }
278
+ const result = await fetchWithEscalation(
279
+ url,
280
+ { headers: { ...BROWSER_HEADERS, ...options.headers } },
281
+ {
282
+ credentials: captureProxyCredentials(),
283
+ ...options.timeoutMs === void 0 ? {} : { timeoutMs: options.timeoutMs },
284
+ ...options.maxBytes === void 0 ? {} : { maxBytes: options.maxBytes },
285
+ ...options.sniffChallenge === void 0 ? {} : { sniffChallenge: options.sniffChallenge }
286
+ }
287
+ );
288
+ if (result.attempts.length > 1) {
289
+ process.stderr.write(`fetch ladder ${url} \u2014 ${describeLadder(result)}
290
+ `);
291
+ }
292
+ if (result.response === null) {
293
+ if (endedPrivateAddress(result)) {
294
+ throw new ExternalFetchError(NOT_PUBLIC_MESSAGE, false);
295
+ }
296
+ const ourFault = endedProxyUnavailable(result);
297
+ throw new ExternalFetchError(ourFault ? "Could not open a route to that address." : NO_ANSWER_MESSAGE, ourFault);
298
+ }
299
+ return { response: result.response, blocked: endedBlocked(result) };
300
+ }
301
+ function refuseOversize(bytes, maxBytes) {
302
+ if (bytes === null || bytes <= maxBytes) return null;
303
+ return `That file is ${humanBytes(bytes)} \u2014 the limit is ${humanBytes(maxBytes)}.`;
304
+ }
305
+ function humanBytes(n) {
306
+ if (n >= 1024 ** 3) return `${(n / 1024 ** 3).toFixed(1)} GB`;
307
+ if (n >= 1024 ** 2) return `${(n / 1024 ** 2).toFixed(1)} MB`;
308
+ return `${Math.max(1, Math.round(n / 1024))} KB`;
309
+ }
310
+ function declaredBytes(response) {
311
+ const raw = response.headers.get("content-length");
312
+ if (raw === null) return null;
313
+ const value = Number(raw);
314
+ return Number.isFinite(value) ? value : null;
315
+ }
316
+ async function fetchExternalBytes(url, options) {
317
+ const { response, blocked } = await fetchExternal(url, options);
318
+ if (!response.ok) {
319
+ throw new ExternalFetchError(`${response.status} ${response.statusText}`, false, response.status);
320
+ }
321
+ if (blocked) {
322
+ throw new ExternalFetchError("That host served a security check instead of the file.", false);
323
+ }
324
+ const declared = refuseOversize(declaredBytes(response), options.maxBytes);
325
+ if (declared !== null) {
326
+ throw new OversizeFetchError(declared);
327
+ }
328
+ const buffer = Buffer.from(await response.arrayBuffer());
329
+ const actual = refuseOversize(buffer.byteLength, options.maxBytes);
330
+ if (actual !== null) {
331
+ throw new OversizeFetchError(actual);
332
+ }
333
+ return { buffer, contentType: response.headers.get("content-type") };
334
+ }
335
+
336
+ export {
337
+ NO_ANSWER_MESSAGE,
338
+ MAX_REMOTE_IMAGE_BYTES,
339
+ ExternalFetchError,
340
+ OversizeFetchError,
341
+ fetchExternalBytes
342
+ };
343
+ //# sourceMappingURL=chunk-X6U3B6YK.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../proxy/src/fetch.ts","../../proxy/src/fetchDecision.ts","../src/lib/externalFetch.ts"],"sourcesContent":["/**\n * `fetch()` that climbs the ladder when — and only when — it is refused.\n *\n * This is the `undici` half of the pair; `preflight.ts` is the Playwright half's\n * safety net. It is a **subpath export** and is deliberately NOT re-exported\n * from `src/index.ts`, for the same reason `./preflight` is not: the barrel is\n * reachable from Convex's V8 runtime through `lib/env.ts`, and `undici` pulls in\n * Node built-ins that fail that bundle outright. Only a `\"use node\"` module may\n * import `@baker/proxy/fetch`.\n *\n * Three properties are worth stating up front, because each is a decision:\n *\n * - **The dispatcher is per request.** Installing a global one would silently\n * route every unrelated `fetch` in the process — provider APIs included —\n * through a metered exit, which is both a bill and a good way to trip a WAF\n * that has never seen us arrive from Brazil before.\n * - **`undici`'s own `fetch` is used, not the global one.** Node's global fetch\n * is powered by Node's *internal* copy of undici; handing it a `ProxyAgent`\n * built by the userland copy hands it a dispatcher speaking a different\n * handler protocol. Same package name, two module registries.\n * - **The body is read here and re-wrapped.** A proxied response is only alive\n * while its agent is, and the agent has to be closed or the sockets leak; and\n * a wall page cannot be recognised without reading it. Buffering once solves\n * both, at the cost of not supporting streaming callers — none of which exist\n * on the paths this serves, all of which call `arrayBuffer()` immediately.\n */\n\nimport { lookup as dnsLookup } from \"node:dns\";\nimport type { RequestInit } from \"undici\";\nimport { Agent, ProxyAgent, Response, fetch as undiciFetch } from \"undici\";\nimport { isChallengeBody } from \"./challenge.ts\";\nimport type { ProxyCredentials } from \"./credentials.ts\";\nimport type { FetchAttempt } from \"./fetchDecision.ts\";\nimport { classifyFetchOutcome, errorBlockSignal, shouldSniffChallenge, shouldTryNextRoute } from \"./fetchDecision.ts\";\nimport type { TriedRoute } from \"./ladder.ts\";\nimport { nextPlannedRoute, plannedRoutes } from \"./ladder.ts\";\nimport { isPrivateAddress } from \"./privateAddress.ts\";\nimport { refuseNonPublicUrl } from \"./publicAddress.ts\";\nimport type { ProxyRoute, RouteOptions } from \"./route.ts\";\nimport type { ProxyTier } from \"./tiers.ts\";\n\nexport type { FetchAttempt, FetchOutcome } from \"./fetchDecision.ts\";\n\nexport interface EscalatedFetchResult {\n /** The origin's answer, from whichever rung produced one. */\n readonly response: Response | null;\n /** Every rung tried, in order, so the caller can log the whole ladder. */\n readonly attempts: FetchAttempt[];\n /** Which rung produced `response`, or the last one attempted. */\n readonly finalTier: \"direct\" | ProxyTier;\n /** The last thrown error, when no rung produced a response at all. */\n readonly error?: unknown;\n}\n\nexport interface EscalatedFetchOptions {\n readonly credentials: ProxyCredentials;\n /** Country / sticky-session targeting, passed through to the route builder. */\n readonly routeOptions?: RouteOptions;\n /** Per-attempt budget. Each rung gets its own; the ladder is not one clock. */\n readonly timeoutMs?: number;\n /**\n * Read small text bodies looking for a bot wall behind a 200. On by default\n * because that block is invisible from the status line. Turn it off only\n * where a 200 is definitionally the payload.\n */\n readonly sniffChallenge?: boolean;\n /**\n * Refuse to buffer a body that *declares* itself larger than this.\n *\n * Because the body is read here, a caller's own size cap would otherwise fire\n * only after the whole file had already been pulled into memory — the exact\n * download the cap exists to avoid. The response still carries the original\n * `content-length`, so the caller's check is the one that reports it.\n */\n readonly maxBytes?: number;\n}\n\nconst DEFAULT_TIMEOUT_MS = 60_000;\n/**\n * Above this, a body is the thing we asked for, not a wall. Generous next to\n * the 2 KB ceiling the detector itself applies, so a padded challenge page is\n * still caught while a real download is never decoded into a string.\n */\nconst MAX_SNIFF_BYTES = 64 * 1024;\n\nfunction tierOf(route: ProxyRoute): \"direct\" | ProxyTier {\n return route.kind === \"proxy\" ? route.tier : \"direct\";\n}\n\n/**\n * Credentials go in a header we build once, never into the URL.\n *\n * `new ProxyAgent(\"http://user:pass@host\")` would work and is how most examples\n * write it. It also means the password exists as a substring of a URL that any\n * error, log line or stack frame is free to print.\n */\nfunction agentFor(route: ProxyRoute): ProxyAgent | Agent | null {\n if (route.kind !== \"proxy\") return directAgent();\n const token = Buffer.from(`${route.username}:${route.password}`).toString(\"base64\");\n return new ProxyAgent({ uri: route.server, token: `Basic ${token}` });\n}\n\n/**\n * The direct rung, with DNS held to the same rule as the hostname was.\n *\n * `refuseNonPublicUrl` reads the hostname, and a hostname is not an address:\n * `localtest.me` is a public name with a public DNS record pointing at\n * `127.0.0.1`, and nothing stops anyone pointing a domain they own at\n * `169.254.169.254`. Before this, that walked straight past the guard and\n * fetched from loopback.\n *\n * Doing it in `lookup` rather than by resolving first and re-checking closes the\n * gap between the two: undici connects to the address this callback returned, so\n * there is no window in which the record can change to a private one after being\n * approved.\n *\n * Only the direct rung needs it. A proxied request is resolved by the proxy, at\n * the far end of the tunnel — and a private address never gets a proxy route\n * built for it in the first place.\n */\nfunction directAgent(): Agent {\n return new Agent({\n connect: {\n lookup: (hostname, options, callback) => {\n dnsLookup(hostname, options, (error, address, family) => {\n if (error) {\n callback(error, address as string, family as number);\n return;\n }\n const found = Array.isArray(address) ? address.map((entry) => entry.address) : [address];\n const blocked = found.find((entry) => isPrivateAddress(entry));\n if (blocked !== undefined) {\n callback(new Error(`${PRIVATE_ADDRESS_CODE}: ${hostname} resolves to ${blocked}`), \"\", 4);\n return;\n }\n callback(null, address as string, family as number);\n });\n },\n },\n });\n}\n\n/**\n * Marker in the thrown message, so a refusal is not read as a dead host.\n *\n * It travels as text because undici surfaces a `lookup` failure as an ordinary\n * connection error, and there is no field on it we own.\n */\nexport const PRIVATE_ADDRESS_CODE = \"EPRIVATEADDR\";\n\n/** Hops to allow before calling it a loop. Matches what browsers do. */\nconst MAX_REDIRECTS = 20;\nconst REDIRECT_STATUS = new Set([301, 302, 303, 307, 308]);\n\nfunction originOf(url: string): string | null {\n try {\n return new URL(url).origin;\n } catch {\n return null;\n }\n}\n\n/**\n * Whether this hop is a host walking us somewhere we would not have gone.\n *\n * The rule is: a redirect may not land anywhere we would have refused to start,\n * with one exception — the origin we deliberately chose. `entry` is the URL the\n * caller handed in, not the previous hop, so a chain cannot launder itself one\n * step at a time.\n *\n * The previous version compared each hop against the one before it and refused\n * only the *public → private* transition. That is sound as an induction and it\n * was still the wrong rule, for a reason worth keeping: every socket test in\n * this package serves from `127.0.0.1`, so the clause that asks whether we\n * started public was false in all of them and the guard could not fire once. The\n * two fixtures written for it sat in the file unreferenced. A guard whose only\n * possible test cannot reach it is indistinguishable from no guard, and this one\n * had already shipped once returning the metadata body with `outcome: \"ok\"`.\n *\n * Anchoring on the entry origin costs nothing in production — all four consumers\n * refuse a private entry URL, so the two rules never disagree there — and it\n * buys the loopback harness the ability to prove the refusal end to end.\n */\nexport function refuseRedirect(entry: string, to: string): boolean {\n if (refuseNonPublicUrl(to) === null) return false;\n const destination = originOf(to);\n return destination === null || destination !== originOf(entry);\n}\n\n/**\n * Follow redirects ourselves, so every hop is checked and not just the first.\n *\n * `undici` follows them for us by default, and that is the problem: the callers\n * validate the URL they were handed and have no way to see where it went. A\n * public origin answering `302 Location: http://127.0.0.1:…` therefore produced\n * `outcome: \"ok\"` and the loopback body — confirmed against a real public\n * redirector. This is also the hole the `lookup` guard cannot cover, since a\n * hop to an address *literal* never asks DNS anything.\n *\n * Per the fetch spec, 303 becomes a GET, and so does a 301/302 that was a POST.\n */\nasync function followRedirects(url: string, init: RequestInit): Promise<Response> {\n let current = url;\n let request: RequestInit = { ...init, redirect: \"manual\" };\n\n for (let hop = 0; hop <= MAX_REDIRECTS; hop++) {\n const response = await undiciFetch(current, request);\n const location = response.headers.get(\"location\");\n if (!REDIRECT_STATUS.has(response.status) || location === null) return response;\n\n // Nobody will ever read this body, but it is still on the wire, and the\n // dispatcher is not done with the connection until it is drained. The cost\n // lands somewhere unobvious: the response arrives and is correct, and then\n // `agent.close()` in `attemptRoute`'s `finally` sits on the undrained socket\n // until the rung's own AbortSignal fires and releases it. Measured through\n // `fetchWithEscalation` with a 3 s budget — a 64 KB redirect body took\n // 3007 ms, and 5 ms once cancelled. With the 60 s default that is a minute\n // of an image fetch spent inside a Convex action on a body we discarded.\n //\n // Cancel before the refusal check below, so a refused hop releases it too.\n await response.body?.cancel();\n\n // Resolved against the URL that issued it, so a relative `Location` works.\n const next = new URL(location, current).toString();\n if (refuseRedirect(url, next)) {\n throw new Error(`${PRIVATE_ADDRESS_CODE}: redirected to ${next}`);\n }\n const method = (request.method ?? \"GET\").toUpperCase();\n const downgrade =\n response.status === 303 || ((response.status === 301 || response.status === 302) && method === \"POST\");\n request = downgrade ? { ...request, method: \"GET\", body: undefined } : request;\n current = next;\n }\n throw new Error(`too many redirects following ${url}`);\n}\n\n/** Statuses the `Response` constructor refuses to attach a body to. */\nconst NULL_BODY_STATUS = new Set([101, 103, 204, 205, 304]);\n\nfunction rebuild(response: Response, body: ArrayBuffer): Response {\n if (response.status < 200 || response.status > 599 || NULL_BODY_STATUS.has(response.status)) {\n return new Response(null, { status: response.status, headers: response.headers });\n }\n return new Response(body, {\n status: response.status,\n statusText: response.statusText,\n headers: response.headers,\n });\n}\n\nfunction declaredLength(response: Response): number | null {\n const raw = response.headers.get(\"content-length\");\n if (raw === null) return null;\n const value = Number(raw);\n return Number.isFinite(value) ? value : null;\n}\n\nasync function readOnce(\n response: Response,\n sniff: boolean,\n maxBytes: number | undefined,\n): Promise<{ response: Response; challenge: boolean }> {\n const declared = declaredLength(response);\n if (maxBytes !== undefined && declared !== null && declared > maxBytes) {\n await response.body?.cancel();\n return { response: rebuild(response, new ArrayBuffer(0)), challenge: false };\n }\n const body = await response.arrayBuffer();\n const wantsSniff =\n sniff && shouldSniffChallenge(response.headers.get(\"content-type\"), body.byteLength, MAX_SNIFF_BYTES);\n const challenge = wantsSniff ? isChallengeBody(new TextDecoder().decode(body)) : false;\n return { response: rebuild(response, body), challenge };\n}\n\ninterface RungResult {\n readonly attempt: FetchAttempt;\n /** Present only when the origin answered — a proxy's own 407 never is. */\n readonly response: Response | null;\n readonly error?: unknown;\n}\n\n/** One rung: open it, read it, close it. Never throws — a rung is a verdict. */\nasync function attemptRoute(\n url: string,\n init: RequestInit,\n route: ProxyRoute,\n options: EscalatedFetchOptions,\n): Promise<RungResult> {\n const tier = tierOf(route);\n const agent = agentFor(route);\n const startedAt = Date.now();\n const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n // Each rung gets its own budget, and the caller's own signal still cancels\n // the whole thing — a ladder that ignored it would keep paying for a job\n // that has already been abandoned.\n const signal = init.signal\n ? AbortSignal.any([init.signal, AbortSignal.timeout(timeoutMs)])\n : AbortSignal.timeout(timeoutMs);\n\n try {\n const raw = await followRedirects(url, { ...init, dispatcher: agent ?? undefined, signal });\n const read = await readOnce(raw, options.sniffChallenge ?? true, options.maxBytes);\n const outcome = classifyFetchOutcome({ status: raw.status, challenge: read.challenge });\n return {\n attempt: { tier, status: raw.status, ms: Date.now() - startedAt, outcome },\n response: outcome === \"proxy_unavailable\" ? null : read.response,\n };\n } catch (error) {\n const blockSignal = errorBlockSignal(error, route.kind === \"proxy\");\n return {\n attempt: {\n tier,\n status: blockSignal.status ?? undefined,\n ms: Date.now() - startedAt,\n outcome: classifyFetchOutcome(blockSignal),\n },\n response: null,\n error,\n };\n } finally {\n await agent?.close();\n }\n}\n\n/**\n * Fetch `url`, escalating through the configured proxy tiers on a classified\n * block and on nothing else.\n *\n * The returned `response` is the origin's, from whichever rung answered — never\n * a proxy's 407, which would read as the site refusing us. When every rung\n * failed for our own reasons, `response` is null and `attempts` says so, which\n * is the difference between \"this page is unreachable\" and \"our credentials\n * are wrong\" that every caller downstream needs.\n */\nexport async function fetchWithEscalation(\n url: string,\n init: RequestInit,\n options: EscalatedFetchOptions,\n): Promise<EscalatedFetchResult> {\n const attempts: FetchAttempt[] = [];\n let originResponse: Response | null = null;\n let originTier: \"direct\" | ProxyTier = \"direct\";\n let lastError: unknown;\n\n const routes = plannedRoutes(url, options.credentials, options.routeOptions);\n const tried: TriedRoute[] = [];\n for (let route: ProxyRoute | null = routes[0] ?? null; route !== null; route = nextPlannedRoute(routes, tried)) {\n const rung = await attemptRoute(url, init, route, options);\n attempts.push(rung.attempt);\n tried.push({ tier: rung.attempt.tier, proxyFailure: rung.attempt.outcome === \"proxy_unavailable\" });\n if (rung.response !== null) {\n originResponse = rung.response;\n originTier = rung.attempt.tier;\n }\n if (rung.error !== undefined) lastError = rung.error;\n if (!shouldTryNextRoute(rung.attempt.outcome)) break;\n }\n\n return {\n response: originResponse,\n attempts,\n finalTier: originResponse !== null ? originTier : (lastAttempt(attempts)?.tier ?? \"direct\"),\n ...(originResponse === null && lastError !== undefined ? { error: lastError } : {}),\n };\n}\n\n/** `Array.prototype.at` is past the lib Convex's own tsconfig compiles against. */\nfunction lastAttempt(attempts: readonly FetchAttempt[]): FetchAttempt | undefined {\n return attempts[attempts.length - 1];\n}\n\n/** One line per operation, with no credential anywhere in it. */\nexport function describeLadder(result: EscalatedFetchResult): string {\n const rungs = result.attempts.map((a) => `${a.tier}:${a.outcome}${a.status ? `(${a.status})` : \"\"}@${a.ms}ms`);\n return `${rungs.join(\" → \")} | final=${result.finalTier}`;\n}\n\n/** A rung that answered cleanly settles the question; no earlier rung outvotes it. */\nfunction rescued(result: EscalatedFetchResult): boolean {\n return result.attempts.some((attempt) => attempt.outcome === \"ok\");\n}\n\n/**\n * Whether the ladder ran out of rungs while the site was still refusing us.\n *\n * Two mistakes are available here and this function has made both. Reading only\n * the *last* rung reports \"not blocked\" for `[blocked, proxy_unavailable]` — the\n * state a rotated password puts every deployment into — and hands the caller the\n * wall page from rung one as if it were the payload, which `mediaCache` then\n * writes into the S3 cache permanently. Reading *any* rung reports \"blocked\" for\n * `[blocked, ok]`, which is the success case: the caller pays for the paid rung,\n * receives the bytes, and throws them away. That one makes the whole ladder cost\n * money for nothing.\n *\n * So: a clean answer wins outright, and only in its absence does a refusal count.\n */\nexport function endedBlocked(result: EscalatedFetchResult): boolean {\n if (rescued(result)) return false;\n return result.attempts.some((attempt) => attempt.outcome === \"blocked\");\n}\n\n/**\n * Whether the ladder ended on our own fault with no site verdict to report.\n *\n * Narrower than \"a rung was a proxy failure\" twice over: a rung that answered\n * makes the dead rung irrelevant, and a rung that saw the site refuse us gives\n * `endedBlocked` the honest verdict. This is only for the case where we never\n * got far enough to learn anything about the page — which must never be charged\n * to it.\n */\nexport function endedProxyUnavailable(result: EscalatedFetchResult): boolean {\n if (rescued(result) || endedBlocked(result)) return false;\n return result.attempts.some((attempt) => attempt.outcome === \"proxy_unavailable\");\n}\n\n/**\n * The host resolved to an address inside our own network, so we refused it.\n *\n * Worth telling apart from \"that address did not answer\": one is a dead site\n * and the other is a decision we made, and only the second is worth saying\n * plainly to whoever handed us the URL.\n */\nexport function endedPrivateAddress(result: EscalatedFetchResult): boolean {\n if (rescued(result)) return false;\n // The chain, not the top: undici reports this as a bare `TypeError: fetch\n // failed` and hangs the real reason off `cause`. Reading only the outer\n // message found nothing and reported a refusal as a dead host.\n for (let error: unknown = result.error, depth = 0; error instanceof Error && depth < 5; depth++) {\n if (error.message.includes(PRIVATE_ADDRESS_CODE)) return true;\n // Read rather than dereferenced: `Error.cause` is ES2022, and this module is\n // also typechecked by Convex's bundler against an older lib, where the\n // property does not exist on the type even though it does at runtime.\n error = (error as { cause?: unknown }).cause;\n }\n return false;\n}\n","/**\n * Every judgement the escalating fetch makes, with no socket in sight.\n *\n * `fetch.ts` is deliberately thin: it opens connections and hands what came\n * back to the functions here. Everything that decides *money* — is this a\n * block, is this our own broken route, is it worth another rung — lives in this\n * file so it can be pinned by tests rather than by a live request to a site\n * that happens to be refusing us today.\n */\n\nimport type { BlockSignal } from \"./escalate.ts\";\nimport { isProxyFailure, shouldEscalate } from \"./escalate.ts\";\nimport type { ProxyTier } from \"./tiers.ts\";\n\n/** What one rung of the ladder did. */\nexport type FetchOutcome = \"ok\" | \"blocked\" | \"proxy_unavailable\" | \"failed\";\n\n/** One rung, as it happened. Returned to the caller so the ladder is loggable. */\nexport interface FetchAttempt {\n readonly tier: \"direct\" | ProxyTier;\n readonly status?: number;\n readonly ms: number;\n readonly outcome: FetchOutcome;\n}\n\n/**\n * Name what happened, from the signal alone.\n *\n * The order matters and is the whole point:\n *\n * 1. **Our route first.** A 407 or a tunnel that would not open is a fault in\n * the credentials we sent, never the site's opinion of us. Reading it as a\n * block would spend the expensive rung reproducing our own misconfiguration\n * and — worse — would file a perfectly readable page as refused.\n * 2. **Then the block**, delegated to `shouldEscalate`, which is the single\n * closed allow-list every surface shares.\n * 3. **Then success**, which a challenge body can veto even on a 200.\n */\nexport function classifyFetchOutcome(signal: BlockSignal): FetchOutcome {\n if (isProxyFailure(signal)) return \"proxy_unavailable\";\n if (shouldEscalate(signal)) return \"blocked\";\n if (signal.status != null && signal.status >= 200 && signal.status < 400 && !signal.challenge) return \"ok\";\n return \"failed\";\n}\n\n/**\n * Whether a failed rung earns another one.\n *\n * Both reasons move to the next route, and they are not the same reason:\n *\n * - `blocked` climbs — the site refused *us*, and a different exit IP is a\n * different us.\n * - `proxy_unavailable` does not climb, it *degrades*: this rung is unusable,\n * so it is dropped and the ladder carries on without it. A mis-pasted\n * datacenter password must cost the use of the datacenter rung, never the\n * residential one that would have worked.\n *\n * Everything else stops: a 404, a dead domain, a certificate that will not\n * negotiate and a timeout all fail identically from every IP on earth, so a\n * second attempt buys a second identical failure and a bill.\n */\nexport function shouldTryNextRoute(outcome: FetchOutcome): boolean {\n return outcome === \"blocked\" || outcome === \"proxy_unavailable\";\n}\n\n/** Node/undici error codes that mean the attempt ran out of time. */\nconst TIMEOUT_CODES = new Set([\n \"UND_ERR_CONNECT_TIMEOUT\",\n \"UND_ERR_HEADERS_TIMEOUT\",\n \"UND_ERR_BODY_TIMEOUT\",\n \"ETIMEDOUT\",\n]);\n\n/**\n * Node codes that mean the peer hung up mid-conversation.\n *\n * Mapped onto the Chromium names the shared classifier speaks, because a WAF\n * null-routing a datacenter range looks like this from `undici` and like\n * `net::ERR_CONNECTION_RESET` from Playwright, and they have to reach the same\n * verdict.\n */\nconst RESET_CODES = new Set([\"ECONNRESET\", \"UND_ERR_SOCKET\", \"EPIPE\"]);\n\n/**\n * Anything speaking proxy answered the CONNECT with something other than 200.\n *\n * Kept, but do not rely on it: measured against undici 7.29 and a local proxy\n * that answers every CONNECT with 407, `fetch` surfaces only\n * `Error(\"Request was cancelled.\")` with `code: 0` — the status never reaches\n * the caller. The `proxied` fallback below is what actually carries that case,\n * which is why it is a fallback and not a last resort.\n */\nconst PROXY_RESPONSE = /Proxy response \\((\\d+)\\)/;\n\nfunction errorCode(error: unknown): string | null {\n if (typeof error !== \"object\" || error === null) return null;\n const code = (error as { code?: unknown }).code;\n if (typeof code === \"string\") return code;\n const name = (error as { name?: unknown }).name;\n return typeof name === \"string\" ? name : null;\n}\n\nfunction errorMessage(error: unknown): string {\n if (typeof error === \"object\" && error !== null) {\n const message = (error as { message?: unknown }).message;\n if (typeof message === \"string\") return message;\n }\n return String(error);\n}\n\n/**\n * Turn a thrown `fetch` error into the signal the shared classifier reads.\n *\n * `proxied` is not a nicety. Through a tunnel, the target's DNS is resolved at\n * the far end and every connect-level failure we can see belongs to the proxy —\n * so the same `ENOTFOUND` means \"your domain is a typo\" on the direct rung and\n * \"our exit node is down\" on a paid one. Collapsing the two would let one bad\n * credential mark healthy pages as unreachable, which is precisely the failure\n * this ladder exists to avoid.\n */\nexport function errorBlockSignal(error: unknown, proxied: boolean): BlockSignal {\n const proxyResponse = PROXY_RESPONSE.exec(errorMessage(error));\n if (proxyResponse) {\n const status = Number(proxyResponse[1]);\n // Only something speaking proxy produces these, so they are always ours.\n return status === 407 ? { status: 407 } : { netError: \"ERR_TUNNEL_CONNECTION_FAILED\" };\n }\n\n const code = errorCode(error);\n if (code !== null && TIMEOUT_CODES.has(code)) return { timedOut: true };\n // `AbortError` is what a caller's own signal and `AbortSignal.timeout` both\n // raise; either way the attempt ran out of time rather than being refused.\n if (code === \"AbortError\" || code === \"TimeoutError\") return { timedOut: true };\n\n if (proxied) {\n // The tunnel never carried us. Whatever the code says about hostnames, the\n // only host we spoke to was the proxy.\n return { netError: \"ERR_PROXY_CONNECTION_FAILED\" };\n }\n\n if (code !== null && RESET_CODES.has(code)) return { netError: \"ERR_CONNECTION_RESET\" };\n return { netError: code ?? \"ERR_FAILED\" };\n}\n\n/**\n * Is this response worth reading as text to look for a wall behind a 200?\n *\n * Two guards, both about not paying for the check. A CDN handing back the JPEG\n * we asked for is never a challenge, so a body that declares an image, a video\n * or any other binary type is not read. And a wall page is small — a body that\n * announces megabytes is the thing we wanted, so it is left as bytes rather\n * than decoded into a string that would be thrown away.\n */\nexport function shouldSniffChallenge(\n contentType: string | null,\n contentLength: number | null,\n maxSniffBytes: number,\n): boolean {\n if (contentLength !== null && contentLength > maxSniffBytes) return false;\n if (contentType === null || contentType.trim() === \"\") return true;\n const type = contentType.toLowerCase();\n // Media is never a wall, and `image/svg+xml` would otherwise be dragged in by\n // the `xml` test below — refusing an SVG because it says \"captcha\" is a worse\n // failure than missing the wall that never arrives dressed as an image.\n if (type.startsWith(\"image/\") || type.startsWith(\"video/\") || type.startsWith(\"audio/\")) return false;\n return type.includes(\"text/\") || type.includes(\"html\") || type.includes(\"json\") || type.includes(\"xml\");\n}\n","/**\n * Fetching bytes from somebody else's server, with the escalation ladder on.\n *\n * Six commands download from an arbitrary host — canvas ingest, `images\n * download`, the shared image reader, and the two canvas scaffolders — and every\n * one of them was a bare `fetch(url)`. That is the request shape a CDN hotlink\n * filter is tuned to refuse first: no User-Agent, no Referer, and an exit IP\n * that belongs to a datacenter. The agent's instruction for the resulting 403\n * was to give up and re-source the asset.\n *\n * This is where that stops being the answer. One place reads the credentials,\n * one place decides what a refusal looks like, and one place writes the ladder\n * to stderr — so a command that gains a download later inherits all three\n * instead of growing a seventh copy of the mistake.\n *\n * **Nothing here reaches the model.** No hint, no error message and no command\n * description mentions a proxy; an agent that learned it could ask for one would\n * start asking. The escalation is ours to decide and its bill is ours to carry.\n */\n\nimport { refuseNonPublicUrl } from \"@baker/proxy\";\nimport {\n describeLadder,\n endedBlocked,\n endedPrivateAddress,\n endedProxyUnavailable,\n fetchWithEscalation,\n} from \"@baker/proxy/fetch\";\nimport type { Response } from \"undici\";\nimport { captureProxyCredentials } from \"../env.ts\";\n\n/**\n * Browser-shaped headers — the *first* answer to a hotlink filter, and the free\n * one. The ladder is the second, for hosts that refuse the address rather than\n * the request. Mirrors `convex/lib/imageFetch.ts`, which learned it the same way.\n */\nconst BROWSER_HEADERS: Record<string, string> = {\n \"User-Agent\":\n \"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/126.0.0.0 Safari/537.36\",\n Accept: \"image/avif,image/webp,image/apng,image/svg+xml,image/*,*/*;q=0.8\",\n \"Accept-Language\": \"en-US,en;q=0.9\",\n};\n\n/** One sentence for both halves of the rule — the name and the address it resolves to. */\nconst NOT_PUBLIC_MESSAGE = \"That address is not reachable from the public web, so there is nothing to read.\";\n/** The one null-status failure that is the host's outage, not a refusal: worth one retry. */\nexport const NO_ANSWER_MESSAGE = \"That address did not answer.\";\n\n/**\n * The ceiling for anything that is an image rather than a video.\n *\n * The same number the Convex side uses (`MAX_INGEST_BYTES`), and deliberately so\n * — the dashboard and the agent should not disagree about how big an image is\n * allowed to be, and a URL handed to `images download` is frequently the same\n * URL the backend will be asked to ingest afterwards.\n */\nexport const MAX_REMOTE_IMAGE_BYTES = 25_000_000;\n\nexport interface ExternalFetchOptions {\n /** Per-rung budget. The ladder is not one clock; each rung gets its own. */\n readonly timeoutMs?: number;\n /** Refuse to buffer a body that declares itself larger than this. */\n readonly maxBytes?: number;\n /** Extra or overriding request headers. */\n readonly headers?: Record<string, string>;\n /**\n * Off for a download that is definitionally bytes. A challenge sniff decodes\n * a small body as text looking for a wall behind a 200; a video file is not\n * that, and reading one as a string is waste rather than a mistake.\n */\n readonly sniffChallenge?: boolean;\n}\n\nexport interface ExternalFetchResult {\n /** The origin's answer, from whichever rung produced one. */\n readonly response: Response;\n /**\n * Every rung refused us and none produced a clean answer.\n *\n * Distinct from `!response.ok`: a bot wall answers **200** with a page, so the\n * status line alone cannot tell a payload from a refusal.\n */\n readonly blocked: boolean;\n}\n\n/** No rung reached the origin. Named so a caller can tell it from a 404. */\nexport class ExternalFetchError extends Error {\n /** True when the fault was ours — a route we could not open, not a dead host. */\n readonly ourFault: boolean;\n /** The HTTP status the host answered with, when it answered at all. */\n readonly status: number | null;\n\n constructor(message: string, ourFault: boolean, status: number | null = null) {\n super(message);\n this.name = \"ExternalFetchError\";\n this.ourFault = ourFault;\n this.status = status;\n }\n}\n\n/** The host answered, but with more bytes than the caller's ceiling. */\nexport class OversizeFetchError extends ExternalFetchError {\n constructor(message: string) {\n super(message, false);\n this.name = \"OversizeFetchError\";\n }\n}\n\n/**\n * Fetch `url`, climbing to a paid exit only if the host refuses this one.\n *\n * Dormant on the happy path by construction: a 200 costs one request, and so do\n * a 404, a dead domain and a certificate that will not negotiate — none of which\n * a different IP would change. Only a classified refusal opens a rung.\n */\nexport async function fetchExternal(url: string, options: ExternalFetchOptions = {}): Promise<ExternalFetchResult> {\n // The ladder refuses to *bill* a private address, and its comment says one is\n // \"refused upstream\" — which was true of the landing capture, the only caller\n // it had when it was written. It is not true here: every command that reaches\n // the web through this function takes a URL straight from an agent or a\n // stored row, and the direct rung would still go out. In a Runtime that means\n // `169.254.169.254` answers with cloud credentials, and a caller writes them\n // to a file it then reads back. The refusal has to happen before the request,\n // and this is the only place all six download surfaces pass through.\n if (refuseNonPublicUrl(url) !== null) {\n throw new ExternalFetchError(NOT_PUBLIC_MESSAGE, false);\n }\n\n const result = await fetchWithEscalation(\n url,\n { headers: { ...BROWSER_HEADERS, ...options.headers } },\n {\n credentials: captureProxyCredentials(),\n ...(options.timeoutMs === undefined ? {} : { timeoutMs: options.timeoutMs }),\n ...(options.maxBytes === undefined ? {} : { maxBytes: options.maxBytes }),\n ...(options.sniffChallenge === undefined ? {} : { sniffChallenge: options.sniffChallenge }),\n },\n );\n\n // stderr, and only when it actually climbed. stdout is the JSON envelope the\n // agent parses, and a ladder line on the happy path would be noise on every\n // download in the repo.\n if (result.attempts.length > 1) {\n process.stderr.write(`fetch ladder ${url} — ${describeLadder(result)}\\n`);\n }\n\n if (result.response === null) {\n // A name that resolved into our own network is a refusal, not an outage.\n // The hostname guard above cannot catch it — `localtest.me` is a public name\n // with a public record pointing at `127.0.0.1` — so it is caught at the\n // resolved address, and reported as the decision it is.\n if (endedPrivateAddress(result)) {\n throw new ExternalFetchError(NOT_PUBLIC_MESSAGE, false);\n }\n const ourFault = endedProxyUnavailable(result);\n throw new ExternalFetchError(ourFault ? \"Could not open a route to that address.\" : NO_ANSWER_MESSAGE, ourFault);\n }\n\n return { response: result.response, blocked: endedBlocked(result) };\n}\n\n/**\n * Whether `bytes` busts the ceiling, as the sentence to say about it.\n *\n * `null` bytes means the host never said, which must not read as zero — a\n * chunked response has no `content-length` and is not thereby empty.\n *\n * A file, not an image: `scaffold-video` downloads through here too, and it is\n * the surface most likely to meet a limit.\n */\nexport function refuseOversize(bytes: number | null, maxBytes: number): string | null {\n if (bytes === null || bytes <= maxBytes) return null;\n return `That file is ${humanBytes(bytes)} — the limit is ${humanBytes(maxBytes)}.`;\n}\n\n/**\n * A size a person can read, at whatever scale it happens to be.\n *\n * Fixed `MB` looked fine against the two real ceilings and fell over the moment\n * it met anything else: a 13 KB file refused by a 1 KB cap read \"That file is\n * 0.0 MB — the limit is 0.0 MB\", which names no problem at all. The ceilings\n * here span 25 MB to 2 GB, so no single unit was ever going to carry them.\n */\nfunction humanBytes(n: number): string {\n if (n >= 1024 ** 3) return `${(n / 1024 ** 3).toFixed(1)} GB`;\n if (n >= 1024 ** 2) return `${(n / 1024 ** 2).toFixed(1)} MB`;\n return `${Math.max(1, Math.round(n / 1024))} KB`;\n}\n\n/** What the response says it weighs, or `null` when it did not say. */\nfunction declaredBytes(response: Response): number | null {\n const raw = response.headers.get(\"content-length\");\n if (raw === null) return null;\n const value = Number(raw);\n return Number.isFinite(value) ? value : null;\n}\n\n/**\n * The common case: fetch and hand back the bytes.\n *\n * Throws on a refusal rather than returning a wall page, because every caller\n * writes what it gets to disk or uploads it — and an HTML \"just a moment\" page\n * saved as `logo.png` is the failure nothing downstream can detect.\n *\n * `maxBytes` is **required**, and that is the point of it. Four of the five\n * callers here passed nothing, so `images download`, `readImageBuffer` and the\n * static-ad scaffolder would each buffer whatever a URL from agent argv pointed\n * at, with no ceiling anywhere — while every neighbouring surface in the repo\n * caps (`MAX_ASSET_BYTES` streaming in `asset-store`, a required `maxBytes` in\n * `fetchImageBytes`). A default would have closed it today and reopened it for\n * the next caller; a required argument makes each surface say its own number.\n */\nexport async function fetchExternalBytes(\n url: string,\n options: ExternalFetchOptions & { readonly maxBytes: number },\n): Promise<{ buffer: Buffer; contentType: string | null }> {\n const { response, blocked } = await fetchExternal(url, options);\n if (!response.ok) {\n throw new ExternalFetchError(`${response.status} ${response.statusText}`, false, response.status);\n }\n if (blocked) {\n throw new ExternalFetchError(\"That host served a security check instead of the file.\", false);\n }\n\n // The declared size first, and it is not belt-and-braces. `@baker/proxy`\n // answers an oversize body by cancelling it and handing back a 200 with an\n // *empty* buffer, keeping `content-length` so the caller can see what\n // happened. Without this read, that arrives as a successful download of\n // nothing — and the caller's own byte-length check passes, because zero is\n // not too large.\n const declared = refuseOversize(declaredBytes(response), options.maxBytes);\n if (declared !== null) {\n throw new OversizeFetchError(declared);\n }\n\n const buffer = Buffer.from(await response.arrayBuffer());\n // And again on what actually arrived, for the host that said nothing or lied.\n const actual = refuseOversize(buffer.byteLength, options.maxBytes);\n if (actual !== null) {\n throw new OversizeFetchError(actual);\n }\n\n return { buffer, contentType: response.headers.get(\"content-type\") };\n}\n"],"mappings":";;;;;;;;;;;;AA2BA,SAAS,UAAU,iBAAiB;AAEpC,SAAS,OAAO,YAAY,UAAU,SAAS,mBAAmB;;;ACS3D,SAAS,qBAAqB,QAAmC;AACtE,MAAI,eAAe,MAAM,EAAG,QAAO;AACnC,MAAI,eAAe,MAAM,EAAG,QAAO;AACnC,MAAI,OAAO,UAAU,QAAQ,OAAO,UAAU,OAAO,OAAO,SAAS,OAAO,CAAC,OAAO,UAAW,QAAO;AACtG,SAAO;AACT;AAkBO,SAAS,mBAAmB,SAAgC;AACjE,SAAO,YAAY,aAAa,YAAY;AAC9C;AAGA,IAAM,gBAAgB,oBAAI,IAAI;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAUD,IAAM,cAAc,oBAAI,IAAI,CAAC,cAAc,kBAAkB,OAAO,CAAC;AAWrE,IAAM,iBAAiB;AAEvB,SAAS,UAAU,OAA+B;AAChD,MAAI,OAA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Ae,OAAO,YAAY,QAAQ,QAAQ;AACjE,MAAI,WAAW,MAAM;AACnB,UAAM,IAAI,mBAAmB,MAAM;AAAA,EACrC;AAEA,SAAO,EAAE,QAAQ,aAAa,SAAS,QAAQ,IAAI,cAAc,EAAE;AACrE;","names":[]}
@@ -0,0 +1,191 @@
1
+ import {
2
+ readRenderState,
3
+ recordSeen
4
+ } from "./chunk-OBQ5YUOZ.js";
5
+ import {
6
+ GLOBAL_PROMPT_FILE,
7
+ ideaBaseline,
8
+ isVideoBlueprint,
9
+ readIdeaAnchor,
10
+ recordedChanges
11
+ } from "./chunk-6WVYBY2G.js";
12
+ import {
13
+ loadCompositionMeta
14
+ } from "./chunk-DWPOAU4Z.js";
15
+ import {
16
+ parseRefExpr
17
+ } from "./chunk-X3GWGFZP.js";
18
+ import {
19
+ resolveAdaptFormats
20
+ } from "./chunk-MCJ5I5LR.js";
21
+ import {
22
+ apiPost
23
+ } from "./chunk-GFWWHCBF.js";
24
+
25
+ // src/commands/canvas/output-ratio.ts
26
+ import { readFile } from "fs/promises";
27
+ import path from "path";
28
+ function definitionFormats(markdown) {
29
+ const front = markdown.match(/^---\n([\s\S]*?)\n---/)?.[1];
30
+ if (!front) return [];
31
+ const clean = (s) => s.trim().replace(/^["']|["']$/g, "");
32
+ const flow = front.match(/^formats:\s*\[([^\]]*)\]/m);
33
+ if (flow) return (flow[1] ?? "").split(",").map(clean).filter(Boolean);
34
+ const block = front.match(/^formats:\s*\n((?:\s+-\s+.*\n?)+)/m);
35
+ if (!block) return [];
36
+ return (block[1] ?? "").split("\n").map((l) => l.replace(/^\s+-\s+/, "")).map(clean).filter(Boolean);
37
+ }
38
+ function reduce(width, height) {
39
+ const gcd = (a, b) => b === 0 ? a : gcd(b, a % b);
40
+ const d = gcd(width, height);
41
+ return `${width / d}:${height / d}`;
42
+ }
43
+ async function ratiosOf(nodes, id, seen) {
44
+ const node = nodes.get(id);
45
+ if (!node || seen.has(id)) return null;
46
+ seen.add(id);
47
+ const p = node.params ?? {};
48
+ switch (node.type) {
49
+ case "image_generate":
50
+ return typeof p.aspect_ratio === "string" ? [p.aspect_ratio] : null;
51
+ case "image_aspect_adapt":
52
+ return [...resolveAdaptFormats(p)];
53
+ case "hyperframe_snapshot": {
54
+ if (typeof p.composition !== "string") return null;
55
+ const meta = await loadCompositionMeta(p.composition).catch(() => null);
56
+ return meta ? [reduce(meta.width, meta.height)] : null;
57
+ }
58
+ case "collect": {
59
+ const images = node.inputs?.images;
60
+ if (!Array.isArray(images)) return null;
61
+ const out = [];
62
+ for (const entry of images) {
63
+ const ref = typeof entry === "string" ? parseRefExpr(entry) : null;
64
+ if (!ref || ref.kind !== "ref") return null;
65
+ const upstream = await ratiosOf(nodes, ref.nodeId, seen);
66
+ if (!upstream) return null;
67
+ out.push(ref.index !== void 0 && upstream.length > 1 ? upstream[ref.index] ?? "" : upstream[0] ?? "");
68
+ }
69
+ return out.filter(Boolean);
70
+ }
71
+ default:
72
+ return null;
73
+ }
74
+ }
75
+ async function producedRatios(canvas) {
76
+ const c = canvas;
77
+ if (!Array.isArray(c?.nodes) || typeof c?.output?.node !== "string") return null;
78
+ const nodes = new Map(c.nodes.flatMap((n) => typeof n.id === "string" ? [[n.id, n]] : []));
79
+ return ratiosOf(nodes, c.output.node, /* @__PURE__ */ new Set());
80
+ }
81
+ function value(ratio) {
82
+ const [w, h] = ratio.split(":").map(Number);
83
+ return w && h ? w / h : null;
84
+ }
85
+ function outputRatioWarnings(declared, produced) {
86
+ if (!produced || produced.length === 0) return [];
87
+ const shapes = produced.flatMap((r) => value(r) ?? []);
88
+ return declared.flatMap((format) => {
89
+ const want = value(format);
90
+ if (want === null || shapes.some((s) => Math.abs(s / want - 1) <= 0.02)) return [];
91
+ return [
92
+ {
93
+ path: "output",
94
+ code: "OUTPUT_RATIO_MISMATCH",
95
+ severity: "warning",
96
+ message: `_definition.md declares ${format}, but this canvas delivers ${produced.join(", ")}. A ${format} placement would get the wrong shape: re-scaffold with that format, or fix the formats the creative declares.`
97
+ }
98
+ ];
99
+ });
100
+ }
101
+ async function outputRatioWarningsFor(canvas, canvasPath) {
102
+ const definition = await readFile(path.join(path.dirname(canvasPath), "_definition.md"), "utf8").catch(() => null);
103
+ if (!definition) return [];
104
+ return outputRatioWarnings(definitionFormats(definition), await producedRatios(canvas));
105
+ }
106
+
107
+ // src/commands/canvas/shown-version.ts
108
+ import { z } from "zod";
109
+ var ShownResponse = z.object({
110
+ data: z.object({
111
+ runId: z.string(),
112
+ sourceSha: z.string().optional(),
113
+ createdAt: z.number(),
114
+ canvasSnapshotUrl: z.string().optional()
115
+ })
116
+ });
117
+ var SnapshotEntry = z.object({ path: z.string(), url: z.string() });
118
+ var SnapshotFiles = z.object({ canvas: SnapshotEntry.optional(), files: z.array(SnapshotEntry) });
119
+ var HISTORY = {
120
+ shown: async (slug) => ShownResponse.parse(await apiPost("/api/creatives/run", { slug })).data,
121
+ file: async (url) => {
122
+ const res = await fetch(url);
123
+ return res.ok ? res.json() : null;
124
+ },
125
+ text: async (url) => {
126
+ const res = await fetch(url);
127
+ return res.ok ? res.text() : null;
128
+ }
129
+ };
130
+ async function shownVersion(canvasRoot, slug, sources = HISTORY) {
131
+ const here = await readRenderState(canvasRoot, slug);
132
+ if (here.rendered) return here;
133
+ const run = await sources.shown(slug).catch(() => null);
134
+ if (!run) return here;
135
+ const drawn = run.canvasSnapshotUrl ? await drawnFiles(run.canvasSnapshotUrl, sources) : {};
136
+ return {
137
+ ...here,
138
+ rendered: { sourceSha: run.sourceSha ?? "", runId: run.runId, at: run.createdAt },
139
+ ...drawn.prompt !== void 0 ? { prompt: drawn.prompt } : {},
140
+ ...drawn.definition !== void 0 ? { definition: drawn.definition } : {},
141
+ ...drawn.video ? { video: drawn.video } : {}
142
+ };
143
+ }
144
+ async function drawnFiles(manifestUrl, sources) {
145
+ const manifest = SnapshotFiles.safeParse(await sources.file(manifestUrl).catch(() => null));
146
+ const files = manifest.success ? manifest.data.files : [];
147
+ const urlOf = (file) => files.find((f) => f.path === file)?.url;
148
+ const promptUrl = urlOf(GLOBAL_PROMPT_FILE);
149
+ const definitionUrl = urlOf("_definition.md");
150
+ const read = (url) => url ? sources.file(url).catch(() => null) : Promise.resolve(null);
151
+ const sceneEntries = files.filter((f) => /^scenes\/[^/]+\.json$/.test(f.path)).sort((a, b) => a.path.localeCompare(b.path));
152
+ const [prompt, definition, scenes, canvas, adSpec] = await Promise.all([
153
+ read(promptUrl),
154
+ definitionUrl ? sources.text(definitionUrl).catch(() => null) : null,
155
+ Promise.all(sceneEntries.map((f) => read(f.url))),
156
+ read(manifest.success ? manifest.data.canvas?.url : void 0),
157
+ read(urlOf("ad.spec.json"))
158
+ ]);
159
+ return {
160
+ ...prompt !== null && prompt !== void 0 ? { prompt } : {},
161
+ ...typeof definition === "string" ? { definition } : {},
162
+ video: { scenes: scenes.filter((s) => s !== null), canvas, adSpec }
163
+ };
164
+ }
165
+
166
+ // src/commands/canvas/shown-anchor.ts
167
+ async function shownBaseline(opts) {
168
+ const state = await readRenderState(opts.canvasRoot, opts.slug);
169
+ const known = opts.turnId !== void 0 && state.seen?.turnId === opts.turnId;
170
+ let fallback;
171
+ if (!known && !state.anchor) {
172
+ const shown = opts.shown ?? await shownVersion(opts.canvasRoot, opts.slug, opts.sources);
173
+ if (shown.rendered && shown.prompt !== void 0) {
174
+ const video = typeof shown.prompt === "object" && shown.prompt !== null && isVideoBlueprint(shown.prompt);
175
+ const recorded = shown.video;
176
+ const unrecorded = video && (!recorded || recorded.canvas === null || recorded.canvas === void 0);
177
+ const anchor = unrecorded ? void 0 : (await readIdeaAnchor(opts.creativeDir, { spec: shown.prompt, ...video && recorded ? { recorded } : {} }))?.anchor;
178
+ if (anchor) fallback = { ...anchor, changes: shown.definition ? recordedChanges(shown.definition) : [] };
179
+ }
180
+ }
181
+ const { baseline, seen } = ideaBaseline(state, opts.turnId, fallback);
182
+ if (seen && opts.record) await recordSeen(opts.canvasRoot, opts.slug, seen);
183
+ return baseline ? { baseline } : {};
184
+ }
185
+
186
+ export {
187
+ outputRatioWarningsFor,
188
+ shownVersion,
189
+ shownBaseline
190
+ };
191
+ //# sourceMappingURL=chunk-XYKODRQR.js.map