@koda-sl/baker-cli 0.515.0-dev.14a31186e → 0.515.0-dev.8df53bffe

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 (375) hide show
  1. package/README.md +20 -1
  2. package/dist/{account-PISI6UMC.js → account-QX4G4BJ7.js} +4 -4
  3. package/dist/{account-JNBDG6PB.js → account-UFYZS3K6.js} +4 -4
  4. package/dist/{account-BA3IO3AN.js → account-ZY655BIU.js} +3 -3
  5. package/dist/{account-assets-T3VVNBUG.js → account-assets-J5Z4URLQ.js} +8 -8
  6. package/dist/{account-level-MPFWRPEK.js → account-level-4SBYYHRS.js} +5 -5
  7. package/dist/{account-reads-ATFFFKV4.js → account-reads-FOEVPWDP.js} +4 -4
  8. package/dist/{account-users-FBA7PDBK.js → account-users-UTIF7MIT.js} +4 -4
  9. package/dist/{account-writes-R5T3F5QT.js → account-writes-QAQXRIEY.js} +4 -4
  10. package/dist/{accounts-4R3MBNJG.js → accounts-FT2SRKMD.js} +4 -4
  11. package/dist/{accounts-JNVS3HEX.js → accounts-JK3OAS5U.js} +2 -2
  12. package/dist/{accounts-VPWCLF6X.js → accounts-K5XLEO6W.js} +3 -3
  13. package/dist/{accounts-KELFJVQM.js → accounts-OE33CKWD.js} +4 -4
  14. package/dist/{accounts-5WF7VE7J.js → accounts-SNB65ZEW.js} +4 -4
  15. package/dist/{active-entities-WDPW7652.js → active-entities-3BAPHE4P.js} +3 -3
  16. package/dist/{activities-WGPHYSFU.js → activities-LKLPORDI.js} +4 -4
  17. package/dist/{ad-group-writes-4OCFZI33.js → ad-group-writes-XY5JYTKT.js} +4 -4
  18. package/dist/{ad-groups-7NE3A255.js → ad-groups-YEO5ZS5U.js} +8 -8
  19. package/dist/{ad-writes-FWUMC6AE.js → ad-writes-XRCPK4SP.js} +4 -4
  20. package/dist/{ads-MUFH7FLP.js → ads-AYJAYLFR.js} +7 -7
  21. package/dist/{ads-ITEUGEUV.js → ads-H7H7H2CM.js} +9 -9
  22. package/dist/{ads-F7AUJWK7.js → ads-MAOI7S6V.js} +13 -13
  23. package/dist/{adsets-XH2ULWPM.js → adsets-QRKICEFD.js} +12 -12
  24. package/dist/{analytics-ZFWZ5YD5.js → analytics-ADIWEM6G.js} +10 -10
  25. package/dist/{analytics-TPI27PJL.js → analytics-XB6FRNVJ.js} +3 -3
  26. package/dist/{asset-writes-4X3AJQ4Q.js → asset-writes-JLVUAVUZ.js} +5 -5
  27. package/dist/{audience-size-4JPP222L.js → audience-size-P5L6MZ4C.js} +3 -3
  28. package/dist/{audience-writes-TXWPDJ2F.js → audience-writes-CDKQB3SM.js} +4 -4
  29. package/dist/{audiences-YUG5JLL4.js → audiences-34IQKOGS.js} +3 -3
  30. package/dist/{audiences-MBBXWEOI.js → audiences-CDDI5HR5.js} +8 -8
  31. package/dist/{audiences-5QFAMXWP.js → audiences-XKERWKKE.js} +4 -4
  32. package/dist/{audit-WFXS5ELM.js → audit-7ED6CUTQ.js} +3 -3
  33. package/dist/{audit-QQAM5QJ2.js → audit-SEADLC6F.js} +3 -3
  34. package/dist/{bid-pricing-JKUFSCZG.js → bid-pricing-NWSUO3VM.js} +3 -3
  35. package/dist/{businesses-24JNY46Z.js → businesses-MGP2YCEU.js} +3 -3
  36. package/dist/{campaign-groups-QUEKAHHT.js → campaign-groups-PH64UXZJ.js} +9 -9
  37. package/dist/{campaign-writes-GZ5MKJ63.js → campaign-writes-BN3EGDK5.js} +4 -4
  38. package/dist/{campaign-writes-UO5P7OD7.js → campaign-writes-CLV5ZSUK.js} +4 -4
  39. package/dist/{campaigns-7V7PYIHJ.js → campaigns-5XRY27JZ.js} +8 -8
  40. package/dist/{campaigns-KXYGSH27.js → campaigns-HES5MDUG.js} +12 -12
  41. package/dist/{campaigns-QNBBQTMU.js → campaigns-JF4TYYUP.js} +12 -12
  42. package/dist/{campaigns-G24AEUCM.js → campaigns-ZYU4BXDP.js} +8 -8
  43. package/dist/{cards-NSNAFTEB.js → cards-A7GQVC7B.js} +3 -3
  44. package/dist/{catalogs-I4WWTCIZ.js → catalogs-6XLBWAUS.js} +4 -4
  45. package/dist/{catalogs-VZYAATUR.js → catalogs-TGLSJEK5.js} +4 -4
  46. package/dist/{changes-BPC2O52H.js → changes-OOUVQDBY.js} +3 -3
  47. package/dist/{chatgpt-WFGSWJ5N.js → chatgpt-NAXIFWXV.js} +13 -13
  48. package/dist/{chunk-KGYTIPS2.js → chunk-3G3GC5N4.js} +2 -2
  49. package/dist/{chunk-LNODLR7W.js → chunk-3GAR4AZK.js} +2 -2
  50. package/dist/{chunk-Z53DY5HT.js → chunk-3M45PYU7.js} +3 -3
  51. package/dist/{chunk-DHVFI7AE.js → chunk-4LF4AYPT.js} +2 -2
  52. package/dist/{chunk-Z35KUMBW.js → chunk-4UQRXKYJ.js} +2 -2
  53. package/dist/{chunk-TYXZ2SRW.js → chunk-7BUIOP36.js} +2 -2
  54. package/dist/{chunk-GX5333QH.js → chunk-7I6ZVBLM.js} +3 -3
  55. package/dist/{chunk-IDSDJHRS.js → chunk-7NF73SCB.js} +2 -2
  56. package/dist/{chunk-M7QZSEHF.js → chunk-B2POVFR2.js} +2 -2
  57. package/dist/{chunk-VXWG4ZS2.js → chunk-BJOK7QD4.js} +2 -2
  58. package/dist/{chunk-FCHZ5TNG.js → chunk-DM3Q6F5F.js} +2 -2
  59. package/dist/{chunk-DN6ZZTQE.js → chunk-DMJUIUAL.js} +2 -2
  60. package/dist/{chunk-C3IO4R4B.js → chunk-EW7JSTRZ.js} +2 -2
  61. package/dist/{chunk-ASRS37QE.js → chunk-GAYRBIEF.js} +3 -1
  62. package/dist/chunk-GAYRBIEF.js.map +1 -0
  63. package/dist/{chunk-HHVWV5BJ.js → chunk-GU5MXV2Y.js} +2 -2
  64. package/dist/{chunk-I3WGTSDY.js → chunk-HGUYC5K6.js} +2 -2
  65. package/dist/{chunk-HCQJYI6X.js → chunk-HMIROUFV.js} +2 -2
  66. package/dist/{chunk-SBNBYRGZ.js → chunk-K7IE6UYV.js} +3 -3
  67. package/dist/{chunk-2F4DELSV.js → chunk-KUY26RCF.js} +2 -2
  68. package/dist/{chunk-VPABGAN4.js → chunk-NWF2LRKO.js} +2 -2
  69. package/dist/{chunk-ILPHIYAL.js → chunk-QDQZ62FL.js} +3 -3
  70. package/dist/{chunk-TU5LQUJM.js → chunk-RCJKABOS.js} +2 -2
  71. package/dist/{chunk-IPO33JRU.js → chunk-TGPGQTZA.js} +3 -3
  72. package/dist/{chunk-TU7DWSTW.js → chunk-TLQOMWLQ.js} +2 -2
  73. package/dist/{chunk-6DPSWLGY.js → chunk-ZRP7Y2DM.js} +3 -7
  74. package/dist/chunk-ZRP7Y2DM.js.map +1 -0
  75. package/dist/cli.js +15 -14
  76. package/dist/cli.js.map +1 -1
  77. package/dist/{companies-NVQJ5EBX.js → companies-KMMV6EJW.js} +3 -3
  78. package/dist/{config-55WGRLY3.js → config-SMVIY6RW.js} +3 -3
  79. package/dist/{conversation-A3ROPGFG.js → conversation-KHTZBGX2.js} +3 -3
  80. package/dist/{conversion-report-BN4Q27MI.js → conversion-report-U66HW6JM.js} +3 -3
  81. package/dist/{conversion-upload-command-S4DGGI7K.js → conversion-upload-command-IHFKVX2M.js} +3 -3
  82. package/dist/{conversion-writes-IZ7WLCYM.js → conversion-writes-RSGDOAET.js} +4 -4
  83. package/dist/{conversions-RFJM3YRJ.js → conversions-BVOL43W4.js} +6 -6
  84. package/dist/{conversions-YFIVZRLB.js → conversions-SUMZAV2T.js} +8 -8
  85. package/dist/{copy-writes-E3V5TUVU.js → copy-writes-CIHIFLY6.js} +5 -5
  86. package/dist/{create-HXGBZAOM.js → create-UL2OYXOA.js} +3 -3
  87. package/dist/{creatives-DUR5Z5AN.js → creatives-BB6S2OF6.js} +6 -6
  88. package/dist/{creatives-6XGPDWCK.js → creatives-FU3YELGU.js} +9 -9
  89. package/dist/{crm-MFI4NZA3.js → crm-MQQRBITZ.js} +2 -2
  90. package/dist/{currency-5ED5P4JQ.js → currency-CGKO5GKH.js} +3 -3
  91. package/dist/{custom-conversions-OIA5Y2GX.js → custom-conversions-HAGG72LF.js} +6 -6
  92. package/dist/{delete-CUFKAGJF.js → delete-UIKB5ZXS.js} +3 -3
  93. package/dist/{demographics-JHKN3EOT.js → demographics-ABZODD45.js} +3 -3
  94. package/dist/{discover-BSQ35XIS.js → discover-VM3O7CQM.js} +2 -2
  95. package/dist/{draft-6XYWFCIO.js → draft-5UUJC675.js} +4 -4
  96. package/dist/{draft-KB6WX63J.js → draft-BATA5CVI.js} +4 -4
  97. package/dist/{draft-EK5PKBUR.js → draft-CRDBU6LF.js} +3 -3
  98. package/dist/{draft-MJRMZGMP.js → draft-DJIYEMZU.js} +3 -3
  99. package/dist/{draft-ZRFZJ7Z3.js → draft-P7IDMXWR.js} +4 -4
  100. package/dist/{draft-2ZX73IRO.js → draft-RIR2V6A2.js} +3 -3
  101. package/dist/{draft-L5Q6KEER.js → draft-ZCL7FVBH.js} +3 -3
  102. package/dist/{experiment-3VRHCQN5.js → experiment-I5CRLOVN.js} +2 -2
  103. package/dist/{experiments-WOZFSKVI.js → experiments-MLLTHMMS.js} +4 -4
  104. package/dist/{facets-2YXLHG4K.js → facets-KSHR3MBE.js} +3 -3
  105. package/dist/{forecast-EX5IXM7C.js → forecast-HT46MFL4.js} +3 -3
  106. package/dist/{forecast-3NKGNWV3.js → forecast-ONVS2QAI.js} +4 -4
  107. package/dist/{funding-TCEPQXRQ.js → funding-5W4LX6DU.js} +3 -3
  108. package/dist/{funnel-AX43MHB7.js → funnel-76BAD64Q.js} +2 -2
  109. package/dist/{ga4-JE3HS36B.js → ga4-BWVCDVIR.js} +15 -15
  110. package/dist/{get-2RITKOGH.js → get-4KFAO475.js} +3 -3
  111. package/dist/{google-6KIKJCY7.js → google-7EZP7I6J.js} +22 -22
  112. package/dist/{gsc-RMVOYIM3.js → gsc-2MPE4N32.js} +4 -4
  113. package/dist/{history-VDZEOXQ4.js → history-FEBJHFHJ.js} +4 -4
  114. package/dist/{history-KUC4KEYO.js → history-RDVV7KBN.js} +3 -3
  115. package/dist/{hubspot-FEKXKUAR.js → hubspot-A3RQNMYN.js} +3 -3
  116. package/dist/{insights-UJGQ6WCQ.js → insights-UTCMSWSC.js} +3 -3
  117. package/dist/{insights-HATH3IC6.js → insights-XZL2EM53.js} +3 -3
  118. package/dist/{instant-experiences-A2SIQNB5.js → instant-experiences-RM4MLJTL.js} +4 -4
  119. package/dist/{job-SM2OQ2LO.js → job-DRFCQ27M.js} +3 -3
  120. package/dist/{job-create-ECZHPVKH.js → job-create-2EC25Y3J.js} +3 -3
  121. package/dist/{job-status-QSYDKIIV.js → job-status-UNVZRPIA.js} +3 -3
  122. package/dist/{languages-2JLPFE6B.js → languages-DIQ3OG3E.js} +2 -2
  123. package/dist/lead-routes-57PUNPAS.js +698 -0
  124. package/dist/lead-routes-57PUNPAS.js.map +1 -0
  125. package/dist/{leads-57S7XBRP.js → leads-LAATTW5G.js} +3 -3
  126. package/dist/{leads-QAYS7AJO.js → leads-ULYHTG22.js} +4 -4
  127. package/dist/{line-item-writes-ONK72SG7.js → line-item-writes-XJTTA3X5.js} +4 -4
  128. package/dist/{line-items-L4HQHJP3.js → line-items-JR25T2C5.js} +8 -8
  129. package/dist/{linkedin-YEAXKAG6.js → linkedin-W5BJ6HEH.js} +30 -30
  130. package/dist/{list-KHWFCIBV.js → list-3653DIYB.js} +3 -3
  131. package/dist/{locations-FB5RGOA4.js → locations-HTVYJSDJ.js} +2 -2
  132. package/dist/{locations-ZVEU3XNW.js → locations-M2B5XDU4.js} +3 -3
  133. package/dist/{lookup-MELV3RUL.js → lookup-S5VG7AWH.js} +3 -3
  134. package/dist/{mcp-6T4PEZ5R.js → mcp-TFQTME4P.js} +3 -15
  135. package/dist/mcp-TFQTME4P.js.map +1 -0
  136. package/dist/{media-EEWZZU3P.js → media-P4T4ZBNS.js} +3 -3
  137. package/dist/{media-BPI2VE6A.js → media-XCTZJIW4.js} +3 -3
  138. package/dist/{meta-SMJUQP37.js → meta-IPLWNYC7.js} +38 -38
  139. package/dist/{metrics-S45EIREU.js → metrics-WYWUX6Y5.js} +2 -2
  140. package/dist/{output-4QBQEM4C.js → output-WTEPRUPE.js} +2 -2
  141. package/dist/{page-photos-HRKPDQBM.js → page-photos-OQ5QATQH.js} +4 -4
  142. package/dist/{pages-DTQWQUKP.js → pages-J6AF5NDU.js} +3 -3
  143. package/dist/{pixels-ISHV4JZD.js → pixels-THEGYRXT.js} +4 -4
  144. package/dist/{pixels-2BKADWE6.js → pixels-ZZTB6NWF.js} +3 -3
  145. package/dist/{plan-A6VC3ZO7.js → plan-7UF76Q6U.js} +3 -3
  146. package/dist/{preview-GGIGXPJW.js → preview-LRJOQ7LM.js} +3 -3
  147. package/dist/{promoted-tweet-writes-WDSUBZ6D.js → promoted-tweet-writes-SBXWKO23.js} +4 -4
  148. package/dist/{promoted-tweets-UFWAFTKD.js → promoted-tweets-W42FNWS7.js} +5 -5
  149. package/dist/{properties-VWKO3AAK.js → properties-RBLJCVSG.js} +3 -3
  150. package/dist/{query-RBZFAIDK.js → query-BJJYUGQZ.js} +3 -3
  151. package/dist/{query-EG7R6MIA.js → query-IQICLABN.js} +4 -4
  152. package/dist/{query-OOP63DJF.js → query-KQ675KJZ.js} +3 -3
  153. package/dist/{questionnaire-7SHYRTMJ.js → questionnaire-DWEH5II4.js} +2 -2
  154. package/dist/{read-GOULD7YL.js → read-QME7JYVF.js} +4 -4
  155. package/dist/{resolve-5IWZBGO2.js → resolve-KRKIJKT7.js} +3 -3
  156. package/dist/{revenue-E5RDAGBU.js → revenue-UBZUTSXN.js} +4 -4
  157. package/dist/{rule-writes-K4P3XBJW.js → rule-writes-UAVWT4XS.js} +4 -4
  158. package/dist/{rules-HY7S2YTD.js → rules-ZVS2MWED.js} +9 -9
  159. package/dist/{run-GQEZCRPX.js → run-K2DOMOAN.js} +3 -3
  160. package/dist/{scheduled-agents-3J3B5O3T.js → scheduled-agents-ZGCUZ6SB.js} +11 -11
  161. package/dist/{schema-6Y3IXFDC.js → schema-D6BMZAPB.js} +2 -2
  162. package/dist/{sends-WBYTALR7.js → sends-LAY5C74B.js} +2 -2
  163. package/dist/{shared-CGEJI2RB.js → shared-ZFULUOPQ.js} +3 -3
  164. package/dist/{shopify-SL7L364P.js → shopify-LXSR37XI.js} +3 -3
  165. package/dist/{sitemaps-5SP7PVQ6.js → sitemaps-F3HYH5ZP.js} +3 -3
  166. package/dist/{sites-YZDPHBST.js → sites-JSMF72BY.js} +3 -3
  167. package/dist/{sources-SRV7RSHI.js → sources-AOF2YDYX.js} +2 -2
  168. package/dist/{stats-EGGNFTKI.js → stats-QP4LFQZJ.js} +5 -5
  169. package/dist/{studies-6VUUOMZD.js → studies-EPO2AM4M.js} +7 -7
  170. package/dist/{study-writes-IR7RSSTK.js → study-writes-7FP443QQ.js} +4 -4
  171. package/dist/{sync-SCM6JGJP.js → sync-PHH65JFS.js} +3 -3
  172. package/dist/{tag-manager-REKD4WGU.js → tag-manager-F7PVTDBB.js} +9 -9
  173. package/dist/{targeting-BQUD54MF.js → targeting-NKZFEZD7.js} +4 -4
  174. package/dist/{targeting-constants-MRQB4N5I.js → targeting-constants-236ES5HE.js} +3 -3
  175. package/dist/{targeting-criteria-3RSGL4PU.js → targeting-criteria-AU5CSMAU.js} +5 -5
  176. package/dist/{targets-EQ6PS7BY.js → targets-IOIH5JYS.js} +3 -3
  177. package/dist/{terms-D2KAFHKJ.js → terms-O6ODXEOK.js} +2 -2
  178. package/dist/{themes-IAJPT5Y7.js → themes-PGPIAKAO.js} +4 -4
  179. package/dist/{top-companies-P33JBCQI.js → top-companies-FSITN3ZR.js} +3 -3
  180. package/dist/{triggers-J42TLW7M.js → triggers-MONMZSKT.js} +3 -3
  181. package/dist/{tweets-JN6ARKF6.js → tweets-IUINLOXF.js} +3 -3
  182. package/dist/{unstage-F73JVWEC.js → unstage-JXG5AU5Q.js} +3 -3
  183. package/dist/{unstage-5C27F2LZ.js → unstage-ZA3WQBEA.js} +2 -2
  184. package/dist/{update-G7QXDY74.js → update-RZSV4NYP.js} +3 -3
  185. package/dist/{url-options-VI76IGTY.js → url-options-63DED6CR.js} +3 -3
  186. package/dist/{url-params-4H2EZWWH.js → url-params-TRFI2PMD.js} +3 -3
  187. package/dist/{write-commands-GNNEUVDW.js → write-commands-5J47ZNO4.js} +3 -3
  188. package/dist/{write-commands-KWO3X6OW.js → write-commands-NVCX7IAU.js} +4 -4
  189. package/dist/{write-commands-NXJQQ62W.js → write-commands-OGVDWWBV.js} +10 -10
  190. package/dist/{write-commands-B25W4FP5.js → write-commands-OTWH6BKZ.js} +3 -3
  191. package/dist/{x-4GPADHQR.js → x-ZQNHYIDU.js} +15 -15
  192. package/package.json +1 -1
  193. package/dist/chunk-6DPSWLGY.js.map +0 -1
  194. package/dist/chunk-ASRS37QE.js.map +0 -1
  195. package/dist/mcp-6T4PEZ5R.js.map +0 -1
  196. /package/dist/{account-PISI6UMC.js.map → account-QX4G4BJ7.js.map} +0 -0
  197. /package/dist/{account-JNBDG6PB.js.map → account-UFYZS3K6.js.map} +0 -0
  198. /package/dist/{account-BA3IO3AN.js.map → account-ZY655BIU.js.map} +0 -0
  199. /package/dist/{account-assets-T3VVNBUG.js.map → account-assets-J5Z4URLQ.js.map} +0 -0
  200. /package/dist/{account-level-MPFWRPEK.js.map → account-level-4SBYYHRS.js.map} +0 -0
  201. /package/dist/{account-reads-ATFFFKV4.js.map → account-reads-FOEVPWDP.js.map} +0 -0
  202. /package/dist/{account-users-FBA7PDBK.js.map → account-users-UTIF7MIT.js.map} +0 -0
  203. /package/dist/{account-writes-R5T3F5QT.js.map → account-writes-QAQXRIEY.js.map} +0 -0
  204. /package/dist/{accounts-4R3MBNJG.js.map → accounts-FT2SRKMD.js.map} +0 -0
  205. /package/dist/{accounts-JNVS3HEX.js.map → accounts-JK3OAS5U.js.map} +0 -0
  206. /package/dist/{accounts-VPWCLF6X.js.map → accounts-K5XLEO6W.js.map} +0 -0
  207. /package/dist/{accounts-KELFJVQM.js.map → accounts-OE33CKWD.js.map} +0 -0
  208. /package/dist/{accounts-5WF7VE7J.js.map → accounts-SNB65ZEW.js.map} +0 -0
  209. /package/dist/{active-entities-WDPW7652.js.map → active-entities-3BAPHE4P.js.map} +0 -0
  210. /package/dist/{activities-WGPHYSFU.js.map → activities-LKLPORDI.js.map} +0 -0
  211. /package/dist/{ad-group-writes-4OCFZI33.js.map → ad-group-writes-XY5JYTKT.js.map} +0 -0
  212. /package/dist/{ad-groups-7NE3A255.js.map → ad-groups-YEO5ZS5U.js.map} +0 -0
  213. /package/dist/{ad-writes-FWUMC6AE.js.map → ad-writes-XRCPK4SP.js.map} +0 -0
  214. /package/dist/{ads-MUFH7FLP.js.map → ads-AYJAYLFR.js.map} +0 -0
  215. /package/dist/{ads-ITEUGEUV.js.map → ads-H7H7H2CM.js.map} +0 -0
  216. /package/dist/{ads-F7AUJWK7.js.map → ads-MAOI7S6V.js.map} +0 -0
  217. /package/dist/{adsets-XH2ULWPM.js.map → adsets-QRKICEFD.js.map} +0 -0
  218. /package/dist/{analytics-ZFWZ5YD5.js.map → analytics-ADIWEM6G.js.map} +0 -0
  219. /package/dist/{analytics-TPI27PJL.js.map → analytics-XB6FRNVJ.js.map} +0 -0
  220. /package/dist/{asset-writes-4X3AJQ4Q.js.map → asset-writes-JLVUAVUZ.js.map} +0 -0
  221. /package/dist/{audience-size-4JPP222L.js.map → audience-size-P5L6MZ4C.js.map} +0 -0
  222. /package/dist/{audience-writes-TXWPDJ2F.js.map → audience-writes-CDKQB3SM.js.map} +0 -0
  223. /package/dist/{audiences-YUG5JLL4.js.map → audiences-34IQKOGS.js.map} +0 -0
  224. /package/dist/{audiences-MBBXWEOI.js.map → audiences-CDDI5HR5.js.map} +0 -0
  225. /package/dist/{audiences-5QFAMXWP.js.map → audiences-XKERWKKE.js.map} +0 -0
  226. /package/dist/{audit-WFXS5ELM.js.map → audit-7ED6CUTQ.js.map} +0 -0
  227. /package/dist/{audit-QQAM5QJ2.js.map → audit-SEADLC6F.js.map} +0 -0
  228. /package/dist/{bid-pricing-JKUFSCZG.js.map → bid-pricing-NWSUO3VM.js.map} +0 -0
  229. /package/dist/{businesses-24JNY46Z.js.map → businesses-MGP2YCEU.js.map} +0 -0
  230. /package/dist/{campaign-groups-QUEKAHHT.js.map → campaign-groups-PH64UXZJ.js.map} +0 -0
  231. /package/dist/{campaign-writes-GZ5MKJ63.js.map → campaign-writes-BN3EGDK5.js.map} +0 -0
  232. /package/dist/{campaign-writes-UO5P7OD7.js.map → campaign-writes-CLV5ZSUK.js.map} +0 -0
  233. /package/dist/{campaigns-7V7PYIHJ.js.map → campaigns-5XRY27JZ.js.map} +0 -0
  234. /package/dist/{campaigns-KXYGSH27.js.map → campaigns-HES5MDUG.js.map} +0 -0
  235. /package/dist/{campaigns-QNBBQTMU.js.map → campaigns-JF4TYYUP.js.map} +0 -0
  236. /package/dist/{campaigns-G24AEUCM.js.map → campaigns-ZYU4BXDP.js.map} +0 -0
  237. /package/dist/{cards-NSNAFTEB.js.map → cards-A7GQVC7B.js.map} +0 -0
  238. /package/dist/{catalogs-I4WWTCIZ.js.map → catalogs-6XLBWAUS.js.map} +0 -0
  239. /package/dist/{catalogs-VZYAATUR.js.map → catalogs-TGLSJEK5.js.map} +0 -0
  240. /package/dist/{changes-BPC2O52H.js.map → changes-OOUVQDBY.js.map} +0 -0
  241. /package/dist/{chatgpt-WFGSWJ5N.js.map → chatgpt-NAXIFWXV.js.map} +0 -0
  242. /package/dist/{chunk-KGYTIPS2.js.map → chunk-3G3GC5N4.js.map} +0 -0
  243. /package/dist/{chunk-LNODLR7W.js.map → chunk-3GAR4AZK.js.map} +0 -0
  244. /package/dist/{chunk-Z53DY5HT.js.map → chunk-3M45PYU7.js.map} +0 -0
  245. /package/dist/{chunk-DHVFI7AE.js.map → chunk-4LF4AYPT.js.map} +0 -0
  246. /package/dist/{chunk-Z35KUMBW.js.map → chunk-4UQRXKYJ.js.map} +0 -0
  247. /package/dist/{chunk-TYXZ2SRW.js.map → chunk-7BUIOP36.js.map} +0 -0
  248. /package/dist/{chunk-GX5333QH.js.map → chunk-7I6ZVBLM.js.map} +0 -0
  249. /package/dist/{chunk-IDSDJHRS.js.map → chunk-7NF73SCB.js.map} +0 -0
  250. /package/dist/{chunk-M7QZSEHF.js.map → chunk-B2POVFR2.js.map} +0 -0
  251. /package/dist/{chunk-VXWG4ZS2.js.map → chunk-BJOK7QD4.js.map} +0 -0
  252. /package/dist/{chunk-FCHZ5TNG.js.map → chunk-DM3Q6F5F.js.map} +0 -0
  253. /package/dist/{chunk-DN6ZZTQE.js.map → chunk-DMJUIUAL.js.map} +0 -0
  254. /package/dist/{chunk-C3IO4R4B.js.map → chunk-EW7JSTRZ.js.map} +0 -0
  255. /package/dist/{chunk-HHVWV5BJ.js.map → chunk-GU5MXV2Y.js.map} +0 -0
  256. /package/dist/{chunk-I3WGTSDY.js.map → chunk-HGUYC5K6.js.map} +0 -0
  257. /package/dist/{chunk-HCQJYI6X.js.map → chunk-HMIROUFV.js.map} +0 -0
  258. /package/dist/{chunk-SBNBYRGZ.js.map → chunk-K7IE6UYV.js.map} +0 -0
  259. /package/dist/{chunk-2F4DELSV.js.map → chunk-KUY26RCF.js.map} +0 -0
  260. /package/dist/{chunk-VPABGAN4.js.map → chunk-NWF2LRKO.js.map} +0 -0
  261. /package/dist/{chunk-ILPHIYAL.js.map → chunk-QDQZ62FL.js.map} +0 -0
  262. /package/dist/{chunk-TU5LQUJM.js.map → chunk-RCJKABOS.js.map} +0 -0
  263. /package/dist/{chunk-IPO33JRU.js.map → chunk-TGPGQTZA.js.map} +0 -0
  264. /package/dist/{chunk-TU7DWSTW.js.map → chunk-TLQOMWLQ.js.map} +0 -0
  265. /package/dist/{companies-NVQJ5EBX.js.map → companies-KMMV6EJW.js.map} +0 -0
  266. /package/dist/{config-55WGRLY3.js.map → config-SMVIY6RW.js.map} +0 -0
  267. /package/dist/{conversation-A3ROPGFG.js.map → conversation-KHTZBGX2.js.map} +0 -0
  268. /package/dist/{conversion-report-BN4Q27MI.js.map → conversion-report-U66HW6JM.js.map} +0 -0
  269. /package/dist/{conversion-upload-command-S4DGGI7K.js.map → conversion-upload-command-IHFKVX2M.js.map} +0 -0
  270. /package/dist/{conversion-writes-IZ7WLCYM.js.map → conversion-writes-RSGDOAET.js.map} +0 -0
  271. /package/dist/{conversions-RFJM3YRJ.js.map → conversions-BVOL43W4.js.map} +0 -0
  272. /package/dist/{conversions-YFIVZRLB.js.map → conversions-SUMZAV2T.js.map} +0 -0
  273. /package/dist/{copy-writes-E3V5TUVU.js.map → copy-writes-CIHIFLY6.js.map} +0 -0
  274. /package/dist/{create-HXGBZAOM.js.map → create-UL2OYXOA.js.map} +0 -0
  275. /package/dist/{creatives-DUR5Z5AN.js.map → creatives-BB6S2OF6.js.map} +0 -0
  276. /package/dist/{creatives-6XGPDWCK.js.map → creatives-FU3YELGU.js.map} +0 -0
  277. /package/dist/{crm-MFI4NZA3.js.map → crm-MQQRBITZ.js.map} +0 -0
  278. /package/dist/{currency-5ED5P4JQ.js.map → currency-CGKO5GKH.js.map} +0 -0
  279. /package/dist/{custom-conversions-OIA5Y2GX.js.map → custom-conversions-HAGG72LF.js.map} +0 -0
  280. /package/dist/{delete-CUFKAGJF.js.map → delete-UIKB5ZXS.js.map} +0 -0
  281. /package/dist/{demographics-JHKN3EOT.js.map → demographics-ABZODD45.js.map} +0 -0
  282. /package/dist/{discover-BSQ35XIS.js.map → discover-VM3O7CQM.js.map} +0 -0
  283. /package/dist/{draft-6XYWFCIO.js.map → draft-5UUJC675.js.map} +0 -0
  284. /package/dist/{draft-KB6WX63J.js.map → draft-BATA5CVI.js.map} +0 -0
  285. /package/dist/{draft-EK5PKBUR.js.map → draft-CRDBU6LF.js.map} +0 -0
  286. /package/dist/{draft-MJRMZGMP.js.map → draft-DJIYEMZU.js.map} +0 -0
  287. /package/dist/{draft-ZRFZJ7Z3.js.map → draft-P7IDMXWR.js.map} +0 -0
  288. /package/dist/{draft-2ZX73IRO.js.map → draft-RIR2V6A2.js.map} +0 -0
  289. /package/dist/{draft-L5Q6KEER.js.map → draft-ZCL7FVBH.js.map} +0 -0
  290. /package/dist/{experiment-3VRHCQN5.js.map → experiment-I5CRLOVN.js.map} +0 -0
  291. /package/dist/{experiments-WOZFSKVI.js.map → experiments-MLLTHMMS.js.map} +0 -0
  292. /package/dist/{facets-2YXLHG4K.js.map → facets-KSHR3MBE.js.map} +0 -0
  293. /package/dist/{forecast-EX5IXM7C.js.map → forecast-HT46MFL4.js.map} +0 -0
  294. /package/dist/{forecast-3NKGNWV3.js.map → forecast-ONVS2QAI.js.map} +0 -0
  295. /package/dist/{funding-TCEPQXRQ.js.map → funding-5W4LX6DU.js.map} +0 -0
  296. /package/dist/{funnel-AX43MHB7.js.map → funnel-76BAD64Q.js.map} +0 -0
  297. /package/dist/{ga4-JE3HS36B.js.map → ga4-BWVCDVIR.js.map} +0 -0
  298. /package/dist/{get-2RITKOGH.js.map → get-4KFAO475.js.map} +0 -0
  299. /package/dist/{google-6KIKJCY7.js.map → google-7EZP7I6J.js.map} +0 -0
  300. /package/dist/{gsc-RMVOYIM3.js.map → gsc-2MPE4N32.js.map} +0 -0
  301. /package/dist/{history-VDZEOXQ4.js.map → history-FEBJHFHJ.js.map} +0 -0
  302. /package/dist/{history-KUC4KEYO.js.map → history-RDVV7KBN.js.map} +0 -0
  303. /package/dist/{hubspot-FEKXKUAR.js.map → hubspot-A3RQNMYN.js.map} +0 -0
  304. /package/dist/{insights-UJGQ6WCQ.js.map → insights-UTCMSWSC.js.map} +0 -0
  305. /package/dist/{insights-HATH3IC6.js.map → insights-XZL2EM53.js.map} +0 -0
  306. /package/dist/{instant-experiences-A2SIQNB5.js.map → instant-experiences-RM4MLJTL.js.map} +0 -0
  307. /package/dist/{job-SM2OQ2LO.js.map → job-DRFCQ27M.js.map} +0 -0
  308. /package/dist/{job-create-ECZHPVKH.js.map → job-create-2EC25Y3J.js.map} +0 -0
  309. /package/dist/{job-status-QSYDKIIV.js.map → job-status-UNVZRPIA.js.map} +0 -0
  310. /package/dist/{languages-2JLPFE6B.js.map → languages-DIQ3OG3E.js.map} +0 -0
  311. /package/dist/{leads-57S7XBRP.js.map → leads-LAATTW5G.js.map} +0 -0
  312. /package/dist/{leads-QAYS7AJO.js.map → leads-ULYHTG22.js.map} +0 -0
  313. /package/dist/{line-item-writes-ONK72SG7.js.map → line-item-writes-XJTTA3X5.js.map} +0 -0
  314. /package/dist/{line-items-L4HQHJP3.js.map → line-items-JR25T2C5.js.map} +0 -0
  315. /package/dist/{linkedin-YEAXKAG6.js.map → linkedin-W5BJ6HEH.js.map} +0 -0
  316. /package/dist/{list-KHWFCIBV.js.map → list-3653DIYB.js.map} +0 -0
  317. /package/dist/{locations-FB5RGOA4.js.map → locations-HTVYJSDJ.js.map} +0 -0
  318. /package/dist/{locations-ZVEU3XNW.js.map → locations-M2B5XDU4.js.map} +0 -0
  319. /package/dist/{lookup-MELV3RUL.js.map → lookup-S5VG7AWH.js.map} +0 -0
  320. /package/dist/{media-EEWZZU3P.js.map → media-P4T4ZBNS.js.map} +0 -0
  321. /package/dist/{media-BPI2VE6A.js.map → media-XCTZJIW4.js.map} +0 -0
  322. /package/dist/{meta-SMJUQP37.js.map → meta-IPLWNYC7.js.map} +0 -0
  323. /package/dist/{metrics-S45EIREU.js.map → metrics-WYWUX6Y5.js.map} +0 -0
  324. /package/dist/{output-4QBQEM4C.js.map → output-WTEPRUPE.js.map} +0 -0
  325. /package/dist/{page-photos-HRKPDQBM.js.map → page-photos-OQ5QATQH.js.map} +0 -0
  326. /package/dist/{pages-DTQWQUKP.js.map → pages-J6AF5NDU.js.map} +0 -0
  327. /package/dist/{pixels-ISHV4JZD.js.map → pixels-THEGYRXT.js.map} +0 -0
  328. /package/dist/{pixels-2BKADWE6.js.map → pixels-ZZTB6NWF.js.map} +0 -0
  329. /package/dist/{plan-A6VC3ZO7.js.map → plan-7UF76Q6U.js.map} +0 -0
  330. /package/dist/{preview-GGIGXPJW.js.map → preview-LRJOQ7LM.js.map} +0 -0
  331. /package/dist/{promoted-tweet-writes-WDSUBZ6D.js.map → promoted-tweet-writes-SBXWKO23.js.map} +0 -0
  332. /package/dist/{promoted-tweets-UFWAFTKD.js.map → promoted-tweets-W42FNWS7.js.map} +0 -0
  333. /package/dist/{properties-VWKO3AAK.js.map → properties-RBLJCVSG.js.map} +0 -0
  334. /package/dist/{query-RBZFAIDK.js.map → query-BJJYUGQZ.js.map} +0 -0
  335. /package/dist/{query-EG7R6MIA.js.map → query-IQICLABN.js.map} +0 -0
  336. /package/dist/{query-OOP63DJF.js.map → query-KQ675KJZ.js.map} +0 -0
  337. /package/dist/{questionnaire-7SHYRTMJ.js.map → questionnaire-DWEH5II4.js.map} +0 -0
  338. /package/dist/{read-GOULD7YL.js.map → read-QME7JYVF.js.map} +0 -0
  339. /package/dist/{resolve-5IWZBGO2.js.map → resolve-KRKIJKT7.js.map} +0 -0
  340. /package/dist/{revenue-E5RDAGBU.js.map → revenue-UBZUTSXN.js.map} +0 -0
  341. /package/dist/{rule-writes-K4P3XBJW.js.map → rule-writes-UAVWT4XS.js.map} +0 -0
  342. /package/dist/{rules-HY7S2YTD.js.map → rules-ZVS2MWED.js.map} +0 -0
  343. /package/dist/{run-GQEZCRPX.js.map → run-K2DOMOAN.js.map} +0 -0
  344. /package/dist/{scheduled-agents-3J3B5O3T.js.map → scheduled-agents-ZGCUZ6SB.js.map} +0 -0
  345. /package/dist/{schema-6Y3IXFDC.js.map → schema-D6BMZAPB.js.map} +0 -0
  346. /package/dist/{sends-WBYTALR7.js.map → sends-LAY5C74B.js.map} +0 -0
  347. /package/dist/{shared-CGEJI2RB.js.map → shared-ZFULUOPQ.js.map} +0 -0
  348. /package/dist/{shopify-SL7L364P.js.map → shopify-LXSR37XI.js.map} +0 -0
  349. /package/dist/{sitemaps-5SP7PVQ6.js.map → sitemaps-F3HYH5ZP.js.map} +0 -0
  350. /package/dist/{sites-YZDPHBST.js.map → sites-JSMF72BY.js.map} +0 -0
  351. /package/dist/{sources-SRV7RSHI.js.map → sources-AOF2YDYX.js.map} +0 -0
  352. /package/dist/{stats-EGGNFTKI.js.map → stats-QP4LFQZJ.js.map} +0 -0
  353. /package/dist/{studies-6VUUOMZD.js.map → studies-EPO2AM4M.js.map} +0 -0
  354. /package/dist/{study-writes-IR7RSSTK.js.map → study-writes-7FP443QQ.js.map} +0 -0
  355. /package/dist/{sync-SCM6JGJP.js.map → sync-PHH65JFS.js.map} +0 -0
  356. /package/dist/{tag-manager-REKD4WGU.js.map → tag-manager-F7PVTDBB.js.map} +0 -0
  357. /package/dist/{targeting-BQUD54MF.js.map → targeting-NKZFEZD7.js.map} +0 -0
  358. /package/dist/{targeting-constants-MRQB4N5I.js.map → targeting-constants-236ES5HE.js.map} +0 -0
  359. /package/dist/{targeting-criteria-3RSGL4PU.js.map → targeting-criteria-AU5CSMAU.js.map} +0 -0
  360. /package/dist/{targets-EQ6PS7BY.js.map → targets-IOIH5JYS.js.map} +0 -0
  361. /package/dist/{terms-D2KAFHKJ.js.map → terms-O6ODXEOK.js.map} +0 -0
  362. /package/dist/{themes-IAJPT5Y7.js.map → themes-PGPIAKAO.js.map} +0 -0
  363. /package/dist/{top-companies-P33JBCQI.js.map → top-companies-FSITN3ZR.js.map} +0 -0
  364. /package/dist/{triggers-J42TLW7M.js.map → triggers-MONMZSKT.js.map} +0 -0
  365. /package/dist/{tweets-JN6ARKF6.js.map → tweets-IUINLOXF.js.map} +0 -0
  366. /package/dist/{unstage-F73JVWEC.js.map → unstage-JXG5AU5Q.js.map} +0 -0
  367. /package/dist/{unstage-5C27F2LZ.js.map → unstage-ZA3WQBEA.js.map} +0 -0
  368. /package/dist/{update-G7QXDY74.js.map → update-RZSV4NYP.js.map} +0 -0
  369. /package/dist/{url-options-VI76IGTY.js.map → url-options-63DED6CR.js.map} +0 -0
  370. /package/dist/{url-params-4H2EZWWH.js.map → url-params-TRFI2PMD.js.map} +0 -0
  371. /package/dist/{write-commands-GNNEUVDW.js.map → write-commands-5J47ZNO4.js.map} +0 -0
  372. /package/dist/{write-commands-KWO3X6OW.js.map → write-commands-NVCX7IAU.js.map} +0 -0
  373. /package/dist/{write-commands-NXJQQ62W.js.map → write-commands-OGVDWWBV.js.map} +0 -0
  374. /package/dist/{write-commands-B25W4FP5.js.map → write-commands-OTWH6BKZ.js.map} +0 -0
  375. /package/dist/{x-4GPADHQR.js.map → x-ZQNHYIDU.js.map} +0 -0
@@ -7,7 +7,7 @@ import {
7
7
  budgetBoostsFromFlags,
8
8
  clearArg,
9
9
  clearFromFlags
10
- } from "./chunk-TYXZ2SRW.js";
10
+ } from "./chunk-7BUIOP36.js";
11
11
  import {
12
12
  bareAccountId,
13
13
  failWriteValidation,
@@ -23,14 +23,14 @@ import {
23
23
  stageOp,
24
24
  stageStatusChange,
25
25
  upper
26
- } from "./chunk-ILPHIYAL.js";
26
+ } from "./chunk-QDQZ62FL.js";
27
27
  import {
28
28
  buildCustomConversionRule
29
29
  } from "./chunk-Q3GSVLE5.js";
30
30
  import {
31
31
  VISUAL_ENHANCEMENT_FEATURES
32
32
  } from "./chunk-GDFJOCDO.js";
33
- import "./chunk-M7QZSEHF.js";
33
+ import "./chunk-B2POVFR2.js";
34
34
  import {
35
35
  repeatedValues
36
36
  } from "./chunk-ERSX3MKH.js";
@@ -39,7 +39,7 @@ import "./chunk-4NZ47VXO.js";
39
39
  import "./chunk-D5FY4FAK.js";
40
40
  import "./chunk-QPESDKZC.js";
41
41
  import "./chunk-Y2JZX6JB.js";
42
- import "./chunk-6DPSWLGY.js";
42
+ import "./chunk-ZRP7Y2DM.js";
43
43
  import "./chunk-E44NXCTL.js";
44
44
  import "./chunk-EJGAJHLB.js";
45
45
  import "./chunk-LNNTHEL7.js";
@@ -461,7 +461,7 @@ Example: baker ads meta adsets create --campaign 6123 --name "Reach ES" --optimi
461
461
  const file = loadJsonFileArg(args.file);
462
462
  const payload = mergePayload(file, adSetPayloadFromFlags(args, rawArgs, file));
463
463
  if (args["saved-audience"]) {
464
- const { savedAudienceTargeting, targetingFromSavedAudience } = await import("./audience-writes-TXWPDJ2F.js");
464
+ const { savedAudienceTargeting, targetingFromSavedAudience } = await import("./audience-writes-CDKQB3SM.js");
465
465
  const saved = await savedAudienceTargeting(accountId, String(args["saved-audience"]));
466
466
  const merged = targetingFromSavedAudience(saved, payload.targeting);
467
467
  if ("refusal" in merged) failWriteValidation(merged.refusal);
@@ -872,8 +872,8 @@ Example: baker ads meta ads retag 120252158038400247 --url-tags "utm_source={{si
872
872
  run: async ({ args, rawArgs }) => {
873
873
  const { apiPost } = await import("./client-EYPNMTBH.js");
874
874
  const { requireChatId } = await import("./env-ABXQWHDO.js");
875
- const { writeJsonEnvelope } = await import("./output-4QBQEM4C.js");
876
- const { handleMetaError } = await import("./shared-CGEJI2RB.js");
875
+ const { writeJsonEnvelope } = await import("./output-WTEPRUPE.js");
876
+ const { handleMetaError } = await import("./shared-ZFULUOPQ.js");
877
877
  try {
878
878
  const accountId = bareAccountId(args);
879
879
  const urlTags = typeof args["url-tags"] === "string" ? args["url-tags"] : void 0;
@@ -1095,8 +1095,8 @@ function duplicateCommand(entity, label) {
1095
1095
  run: async ({ args }) => {
1096
1096
  const { apiPost } = await import("./client-EYPNMTBH.js");
1097
1097
  const { requireChatId } = await import("./env-ABXQWHDO.js");
1098
- const { writeJsonEnvelope } = await import("./output-4QBQEM4C.js");
1099
- const { handleMetaError } = await import("./shared-CGEJI2RB.js");
1098
+ const { writeJsonEnvelope } = await import("./output-WTEPRUPE.js");
1099
+ const { handleMetaError } = await import("./shared-ZFULUOPQ.js");
1100
1100
  try {
1101
1101
  const accountId = bareAccountId(args);
1102
1102
  const chatId = requireChatId();
@@ -1169,4 +1169,4 @@ export {
1169
1169
  retagSetPairs,
1170
1170
  targetingFromFlags
1171
1171
  };
1172
- //# sourceMappingURL=write-commands-NXJQQ62W.js.map
1172
+ //# sourceMappingURL=write-commands-OGVDWWBV.js.map
@@ -5,9 +5,9 @@ import {
5
5
  requireTarget,
6
6
  stageOp,
7
7
  stageOps
8
- } from "./chunk-HHVWV5BJ.js";
8
+ } from "./chunk-GU5MXV2Y.js";
9
9
  import "./chunk-D5FY4FAK.js";
10
- import "./chunk-6DPSWLGY.js";
10
+ import "./chunk-ZRP7Y2DM.js";
11
11
  import "./chunk-X7VQFLHI.js";
12
12
  import "./chunk-LU4HI4KI.js";
13
13
  import "./chunk-LGK7UWBN.js";
@@ -710,4 +710,4 @@ export {
710
710
  propertyCommand,
711
711
  retentionValue
712
712
  };
713
- //# sourceMappingURL=write-commands-B25W4FP5.js.map
713
+ //# sourceMappingURL=write-commands-OTWH6BKZ.js.map
@@ -25,23 +25,23 @@ The CLI auto-detects --account-id when exactly one X Ads account is connected, o
25
25
  Full guide: __tooling__/docs/tools/baker/ads-x.md`
26
26
  },
27
27
  subCommands: {
28
- accounts: () => import("./accounts-5WF7VE7J.js").then((m) => m.accountsCommand),
29
- funding: () => import("./funding-TCEPQXRQ.js").then((m) => m.fundingCommand),
30
- campaigns: () => import("./campaigns-G24AEUCM.js").then((m) => m.campaignsCommand),
31
- "line-items": () => import("./line-items-L4HQHJP3.js").then((m) => m.lineItemsCommand),
32
- "promoted-tweets": () => import("./promoted-tweets-UFWAFTKD.js").then((m) => m.promotedTweetsCommand),
33
- tweets: () => import("./tweets-JN6ARKF6.js").then((m) => m.tweetsCommand),
34
- cards: () => import("./cards-NSNAFTEB.js").then((m) => m.cardsCommand),
35
- draft: () => import("./draft-6XYWFCIO.js").then((m) => m.draftCommand),
36
- media: () => import("./media-BPI2VE6A.js").then((m) => m.mediaCommand),
37
- audiences: () => import("./audiences-YUG5JLL4.js").then((m) => m.audiencesCommand),
38
- "targeting-criteria": () => import("./targeting-criteria-3RSGL4PU.js").then((m) => m.targetingCriteriaCommand),
39
- "targeting-constants": () => import("./targeting-constants-MRQB4N5I.js").then((m) => m.targetingConstantsCommand),
40
- "active-entities": () => import("./active-entities-WDPW7652.js").then((m) => m.activeEntitiesCommand),
41
- stats: () => import("./stats-EGGNFTKI.js").then((m) => m.statsCommand)
28
+ accounts: () => import("./accounts-SNB65ZEW.js").then((m) => m.accountsCommand),
29
+ funding: () => import("./funding-5W4LX6DU.js").then((m) => m.fundingCommand),
30
+ campaigns: () => import("./campaigns-ZYU4BXDP.js").then((m) => m.campaignsCommand),
31
+ "line-items": () => import("./line-items-JR25T2C5.js").then((m) => m.lineItemsCommand),
32
+ "promoted-tweets": () => import("./promoted-tweets-W42FNWS7.js").then((m) => m.promotedTweetsCommand),
33
+ tweets: () => import("./tweets-IUINLOXF.js").then((m) => m.tweetsCommand),
34
+ cards: () => import("./cards-A7GQVC7B.js").then((m) => m.cardsCommand),
35
+ draft: () => import("./draft-5UUJC675.js").then((m) => m.draftCommand),
36
+ media: () => import("./media-XCTZJIW4.js").then((m) => m.mediaCommand),
37
+ audiences: () => import("./audiences-34IQKOGS.js").then((m) => m.audiencesCommand),
38
+ "targeting-criteria": () => import("./targeting-criteria-AU5CSMAU.js").then((m) => m.targetingCriteriaCommand),
39
+ "targeting-constants": () => import("./targeting-constants-236ES5HE.js").then((m) => m.targetingConstantsCommand),
40
+ "active-entities": () => import("./active-entities-3BAPHE4P.js").then((m) => m.activeEntitiesCommand),
41
+ stats: () => import("./stats-QP4LFQZJ.js").then((m) => m.statsCommand)
42
42
  }
43
43
  });
44
44
  export {
45
45
  xCommand
46
46
  };
47
- //# sourceMappingURL=x-4GPADHQR.js.map
47
+ //# sourceMappingURL=x-ZQNHYIDU.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@koda-sl/baker-cli",
3
- "version": "0.515.0-dev.14a31186e",
3
+ "version": "0.515.0-dev.8df53bffe",
4
4
  "description": "AI-agent-first CLI for interacting with Baker, including the Baker creative canvas.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/error-handler.ts","../src/commands/ads/cache.ts","../src/commands/ads/output.ts"],"sourcesContent":["import { writeJsonEnvelope } from \"./commands/ads/output.ts\";\nimport { optionalTargetCompany } from \"./env.ts\";\n\ntype ConnectionPlatform = \"google_ads\" | \"ga4\" | \"gsc\" | \"x_ads\" | \"meta_ads\" | \"linkedin_ads\";\n\n/**\n * Platforms the agent can get connected without the user leaving the chat, via\n * the blocking `request_connection` tool, and the id that tool expects. Every\n * platform this CLI can talk to is here — keep it in step with\n * `CONNECTION_PLATFORMS` in `packages/bridge/src/hono/connection-input.ts`: a\n * platform the tool accepts but this map omits sends the user to Settings for a\n * door the agent could have opened itself.\n */\nconst REQUEST_CONNECTION_PLATFORM: Record<ConnectionPlatform, string> = {\n google_ads: \"google-ads\",\n ga4: \"google-analytics\",\n gsc: \"google-search-console\",\n linkedin_ads: \"linkedin\",\n meta_ads: \"meta\",\n x_ads: \"x-ads\",\n};\n\nconst PLATFORM_NAME: Record<ConnectionPlatform, string> = {\n google_ads: \"Google Ads\",\n ga4: \"Google Analytics 4\",\n gsc: \"Google Search Console\",\n x_ads: \"X Ads\",\n meta_ads: \"Meta Ads\",\n linkedin_ads: \"LinkedIn Ads\",\n};\n\n/**\n * How to tell the agent to get a platform connected. Never \"send them to\n * Settings\" for a platform `request_connection` covers — that ends the turn on a\n * wall the agent could have opened itself, and it now covers every platform this\n * CLI talks to. The fallback line matters too: if the `request_connection` call\n * fails, the agent must still be able to say where the connect button is instead\n * of stalling.\n */\nexport function connectionFixExplanation(platform: ConnectionPlatform, originalMessage?: string): string {\n const name = PLATFORM_NAME[platform];\n const slug = REQUEST_CONNECTION_PLATFORM[platform];\n // Read with `--company` from the organization workspace: connecting from here\n // would connect the workspace, not the company the read named.\n if (optionalTargetCompany()) {\n return (\n `${name} is not connected for that company. It can only be connected in that company's own workspace, ` +\n `never with \\`request_connection\\` from here. Show that company as not connected for ${name} and carry on ` +\n \"with the others.\"\n );\n }\n if (originalMessage !== undefined && SIGN_IN_ENDED.test(originalMessage)) {\n return (\n `${name} is connected, but its sign-in no longer works (it expired, or was revoked on the platform) — this is ` +\n `not a Baker error, and retrying later cannot fix it: only the user signing in again can. Call the ` +\n `\\`request_connection\\` tool now with { platform: \"${slug}\", reason } — the card offers Reconnect. If that call ` +\n `fails, give the exact route: dashboard → Brain → Integrations → Platforms → ${name} → Reconnect. Then carry on ` +\n \"with the rest of the task and say what stays unavailable until it is reconnected.\"\n );\n }\n return (\n `${name} is not connected for this company (or no account has been picked). Don't send the user to Settings ` +\n `or end the turn here — call the \\`request_connection\\` tool with { platform: \"${slug}\", reason } and ` +\n `they connect and pick their accounts from inside the chat. If the \\`request_connection\\` call fails, say so ` +\n `plainly and give the exact route: dashboard → Brain → Integrations → Platforms → ${name}. Then carry on with the ` +\n `rest of the task and say what stays unavailable until it is connected.`\n );\n}\n\n/** How the backend says a stored sign-in stopped working (`reconnectMessage`, `convex/oauth/connectedPlatforms.ts`). */\nconst SIGN_IN_ENDED = /connection expired|must reconnect/i;\n\n/**\n * Shared error handler for \"No Connection\" scenarios.\n * Provides a structured error for AI agents with a suggested fix and alternative commands.\n */\nexport function handleConnectionError(platform: ConnectionPlatform, originalMessage?: string): never {\n const platformName = PLATFORM_NAME[platform];\n\n const alternative = {\n google_ads: \"keywords-for-site or research advertisers\",\n ga4: \"lighthouse for page performance\",\n gsc: \"keywords-for-site or research keyword-gap\",\n x_ads: \"research advertisers\",\n meta_ads: \"research advertisers or research keyword-ideas\",\n linkedin_ads: \"research advertisers (LinkedIn Ad Library) or research keyword-ideas\",\n }[platform];\n\n const code = {\n google_ads: \"NO_GOOGLE_ADS_CONNECTION\",\n ga4: \"NO_GA4_CONNECTION\",\n gsc: \"NO_GSC_CONNECTION\",\n x_ads: \"NO_X_ADS_CONNECTION\",\n meta_ads: \"NO_META_ADS_CONNECTION\",\n linkedin_ads: \"NO_LINKEDIN_ADS_CONNECTION\",\n }[platform];\n\n const envelope = {\n ok: false,\n error: {\n code,\n message: originalMessage || `No ${platformName} connection found for this company.`,\n fix: optionalTargetCompany()\n ? { action: \"continue_without\", explanation: connectionFixExplanation(platform) }\n : {\n action: \"request_connection\",\n explanation: `${connectionFixExplanation(platform, originalMessage)} (Optional fallback for estimated external insights: 'baker research ${alternative}'.)`,\n },\n retryable: false,\n },\n };\n\n writeJsonEnvelope(envelope);\n process.exit(1);\n}\n\n/**\n * Does this API failure mean \"the platform isn't connected\"? The read commands\n * surface the backend's own 404/403 verbatim, so the connect fix has to be\n * recognised from the code the client mapped it to plus the message.\n */\nexport function isNotConnectedError(code: string, message: string): boolean {\n if (code !== \"NOT_FOUND\" && code !== \"UNAUTHORIZED\" && code !== \"FORBIDDEN\") {\n return false;\n }\n // The last alternative is the write-path 403 (\"customer X is not in this\n // company's connected Google Ads accounts\") — a different sentence for the\n // same remedy: connect, and pick the account.\n return /no .* connection found|not connected|no .* (selected|picked)|is not in .* connected/i.test(message);\n}\n\n/**\n * Does this failure warrant the connect form? A dead token (401) always does —\n * whatever the wording, the remedy is to sign in again.\n *\n * A 404 or 403 only does when the backend says so. Both codes are overloaded:\n * 403 is also an asset-level refusal on a live connection (reconnecting cannot\n * grant it), and 404 is also how \"no staged op <ref> in this draft\" and a\n * mistyped `--chat` come back. Answering either with \"ask the user to connect\n * Meta Ads\" sends the agent to fix something that was never broken, and the\n * real missing-connection 404 says \"No <platform> connection found\" anyway.\n */\nexport function needsConnectionFix(code: string, message: string): boolean {\n if (code === \"UNAUTHORIZED\") {\n return true;\n }\n return isNotConnectedError(code, message);\n}\n\n/**\n * The organization workspace's refusal of a write to a company (`--company`).\n * It is about where the change belongs, not about the platform, so no\n * platform's permission advice applies to it.\n */\nexport function isOrganizationReadRefusal(message: string): boolean {\n return message.startsWith(\"The organization workspace only reads its companies\");\n}\n","import { createHash } from \"node:crypto\";\nimport { existsSync, mkdirSync, readFileSync, rmSync, writeFileSync } from \"node:fs\";\nimport { homedir } from \"node:os\";\nimport { join } from \"node:path\";\nimport { optionalTargetCompany } from \"../../env.ts\";\nimport type { CacheEntry } from \"./types.ts\";\n\n/**\n * One folder per company a call reads (`--company`), so the organization\n * workspace never answers one company's read with another's cached accounts.\n * Resolved per call: the flag is read after the command's modules load.\n */\nfunction cacheDir(): string {\n const company = optionalTargetCompany()?.replace(/[^a-zA-Z0-9_]/g, \"\");\n return join(homedir(), \".baker\", \"cache\", \"ads\", ...(company ? [\"company\", company] : []));\n}\n\nfunction ensureDir(dir: string): void {\n if (!existsSync(dir)) {\n mkdirSync(dir, { recursive: true });\n }\n}\n\nfunction hashKey(key: string): string {\n return createHash(\"sha256\").update(key).digest(\"hex\").slice(0, 16);\n}\n\nfunction cachePath(category: string, key: string): string {\n const dir = join(cacheDir(), category);\n ensureDir(dir);\n return join(dir, `${hashKey(key)}.json`);\n}\n\nexport function cacheGet<T>(category: string, key: string): CacheEntry<T> | null {\n const path = cachePath(category, key);\n if (!existsSync(path)) {\n return null;\n }\n try {\n const raw = readFileSync(path, \"utf-8\");\n const entry = JSON.parse(raw) as CacheEntry<T>;\n if (entry.expiresAt < Date.now()) {\n rmSync(path, { force: true });\n return null;\n }\n return entry;\n } catch {\n rmSync(path, { force: true });\n return null;\n }\n}\n\nexport function cacheSet<T>(\n category: string,\n key: string,\n data: T,\n ttlMs: number,\n fields?: Record<string, string>,\n): void {\n const path = cachePath(category, key);\n const entry: CacheEntry<T> = {\n expiresAt: Date.now() + ttlMs,\n data,\n fields,\n };\n writeFileSync(path, JSON.stringify(entry), \"utf-8\");\n}\n\nconst HOUR = 60 * 60 * 1000;\nconst MINUTE = 60 * 1000;\n\nexport function getQueryTtl(query: string): number {\n const upper = query.toUpperCase();\n if (upper.includes(\"TODAY\")) {\n return 15 * MINUTE;\n }\n if (upper.includes(\"LAST_7_DAYS\") || upper.includes(\"LAST_14_DAYS\")) {\n return 1 * HOUR;\n }\n // Historical data (BETWEEN, LAST_30_DAYS, LAST_90_DAYS, etc.)\n return 6 * HOUR;\n}\n\nexport function buildQueryCacheKey(customerId: string, query: string): string {\n const today = new Date().toISOString().slice(0, 10);\n return `${customerId}:${today}:${query.trim().replace(/\\s+/g, \" \")}`;\n}\n\ninterface CachedAccount {\n id: string;\n access_type: \"direct\" | \"managed\";\n manager_id?: string;\n}\n\nexport function getManagerIdForCustomer(customerId: string): string | undefined {\n const cached = cacheGet<CachedAccount[]>(\"accounts\", \"list\");\n if (!cached) return undefined;\n const account = cached.data.find((a) => a.id === customerId);\n if (account?.access_type === \"managed\") return account.manager_id;\n return undefined;\n}\n","import { ApiError, apiGet } from \"../../client.ts\";\nimport { getEnv } from \"../../env.ts\";\nimport { handleConnectionError, isNotConnectedError } from \"../../error-handler.ts\";\nimport type { QueryContext } from \"../../geo-context.ts\";\nimport { cacheGet, cacheSet } from \"./cache.ts\";\nimport type { AdsErrorEnvelope, AdsFileSummary, AdsSuccessEnvelope } from \"./types.ts\";\n\ntype AdsOutput =\n | AdsSuccessEnvelope<unknown>\n | AdsErrorEnvelope\n | AdsFileSummary\n | { ok: true; data: unknown; query_context?: QueryContext; cached?: true; fields?: Record<string, string> }\n | { ok: false; error: { code: string; message: string } };\n\nexport function writeAdsJson(envelope: AdsOutput): void {\n process.stdout.write(`${JSON.stringify(envelope, null, 2)}\\n`);\n}\n\nexport function writeJsonEnvelope(envelope: Record<string, unknown>): void {\n process.stdout.write(`${JSON.stringify(envelope, null, 2)}\\n`);\n}\n\n/** The formats `writeAdsOutput` prints. */\nexport const TABLE_OUTPUT_FORMATS = [\"json\", \"csv\", \"jsonl\", \"md\"] as const;\n\n/** Why `--output <format>` cannot be printed, or null — rather than quietly falling back to JSON. */\nexport function outputFormatRefusal(format: string, supported: readonly string[]): string | null {\n if (supported.includes(format)) return null;\n const list =\n supported.length > 1 ? `${supported.slice(0, -1).join(\", \")} or ${supported.at(-1)}` : supported.join(\"\");\n return `--output ${format} is not supported — use ${list}`;\n}\n\nexport function toCsvRow(values: string[]): string {\n return values\n .map((v) => {\n if (v.includes(\",\") || v.includes('\"') || v.includes(\"\\n\")) {\n return `\"${v.replace(/\"/g, '\"\"')}\"`;\n }\n return v;\n })\n .join(\",\");\n}\n\nfunction flattenRow(row: Record<string, unknown>): Record<string, string> {\n const flat: Record<string, string> = {};\n for (const [key, val] of Object.entries(row)) {\n flat[key] = typeof val === \"object\" && val !== null ? JSON.stringify(val) : String(val ?? \"\");\n }\n return flat;\n}\n\n/**\n * One write per table: a line-by-line write piped into `head` hits a closed pipe on\n * the next line and crashes with EPIPE, where a single write lands in the pipe buffer.\n */\nfunction writeWhole(lines: string[]): void {\n process.stdout.write(`${lines.join(\"\\n\")}\\n`);\n}\n\nfunction writeAdsCsv(data: Array<Record<string, unknown>>, fields?: string[]): void {\n if (data.length === 0) return;\n const cols = fields ?? Object.keys(data[0] ?? {});\n const lines = [toCsvRow(cols)];\n for (const row of data) {\n const flat = flattenRow(row);\n lines.push(toCsvRow(cols.map((f) => flat[f] ?? \"\")));\n }\n writeWhole(lines);\n}\n\nfunction writeAdsJsonl(data: Array<Record<string, unknown>>): void {\n if (data.length === 0) return;\n writeWhole(data.map((row) => JSON.stringify(row)));\n}\n\n/** A `|` or line break in a name would split its cell and shift every later column. */\nfunction mdCell(value: string): string {\n return value.replace(/\\|/g, \"\\\\|\").replace(/\\r?\\n/g, \" \");\n}\n\nfunction writeAdsMd(data: Array<Record<string, unknown>>, fields?: string[]): void {\n if (data.length === 0) return;\n const cols = fields ?? Object.keys(data[0] ?? {});\n const lines = [`| ${cols.join(\" | \")} |`, `| ${cols.map(() => \"---\").join(\" | \")} |`];\n for (const row of data) {\n const flat = flattenRow(row);\n lines.push(`| ${cols.map((f) => mdCell(flat[f] ?? \"\")).join(\" | \")} |`);\n }\n writeWhole(lines);\n}\n\n/**\n * `hints` ride in the JSON envelope; csv/jsonl/md stdout has no room for them,\n * and an empty result is exactly when the hint matters, so they go to stderr.\n */\nexport function writeAdsOutput(\n data: Array<Record<string, unknown>>,\n format: string,\n fields?: string[],\n hints: string[] = [],\n): void {\n switch (format) {\n case \"csv\":\n writeAdsCsv(data, fields);\n break;\n case \"jsonl\":\n writeAdsJsonl(data);\n break;\n case \"md\":\n writeAdsMd(data, fields);\n break;\n default:\n writeJsonEnvelope(hints.length > 0 ? { ok: true, data, hints } : { ok: true, data });\n return;\n }\n for (const hint of hints) process.stderr.write(`${hint}\\n`);\n}\n\ninterface AccountInfo {\n id: string;\n name: string;\n access_type: \"direct\" | \"managed\";\n level: number;\n manager_id?: string;\n}\n\nasync function fetchAccounts(useCache = true): Promise<AccountInfo[]> {\n if (useCache) {\n const cached = cacheGet<AccountInfo[]>(\"accounts\", \"list\");\n if (cached) return cached.data;\n }\n const params = !useCache ? { \"skip-cache\": \"true\" } : undefined;\n const data = await apiGet<AccountInfo[]>(\"/api/ads/google/accounts\", params);\n if (useCache) {\n cacheSet(\"accounts\", \"list\", data, 60 * 60 * 1000);\n }\n return data;\n}\n\nexport async function resolveCustomerId(args: Record<string, unknown>): Promise<string> {\n const fromArgs = args[\"customer-id\"] as string | undefined;\n const customerId = fromArgs || getEnv().BAKER_GOOGLE_ADS_CUSTOMER_ID;\n\n if (customerId) {\n if (!/^\\d{10}$/.test(customerId)) {\n writeAdsJson({\n ok: false,\n error: {\n code: \"INVALID_CUSTOMER_ID\",\n message:\n \"Customer ID must be exactly 10 digits without dashes. Pass --customer-id or set BAKER_GOOGLE_ADS_CUSTOMER_ID.\",\n },\n });\n process.exit(1);\n }\n return customerId;\n }\n\n const useCache = !args[\"no-cache\"];\n\n try {\n const accounts = await fetchAccounts(useCache);\n const [single] = accounts;\n if (accounts.length === 1 && single) {\n process.stderr.write(`Using account \"${single.name}\" (${single.id})\\n`);\n return single.id;\n }\n if (accounts.length === 0) {\n handleConnectionError(\"google_ads\");\n }\n const list = accounts.map((a) => ` ${a.id} ${a.name}`).join(\"\\n\");\n writeAdsJson({\n ok: false,\n error: {\n code: \"MULTIPLE_ACCOUNTS\",\n message: `Multiple accounts found. Pass --customer-id or set BAKER_GOOGLE_ADS_CUSTOMER_ID:\\n${list}`,\n },\n });\n process.exit(1);\n } catch (err) {\n // \"No connection\" reaches here as a 404/403 from the accounts lookup. Reporting it as\n // an unusable customer id sends the agent hunting for an id that cannot exist yet.\n if (err instanceof ApiError && isNotConnectedError(err.code, err.message)) {\n handleConnectionError(\"google_ads\", err.message);\n }\n writeAdsJson({\n ok: false,\n error: {\n code: \"INVALID_CUSTOMER_ID\",\n message: \"Could not auto-detect account. Pass --customer-id or set BAKER_GOOGLE_ADS_CUSTOMER_ID.\",\n },\n });\n process.exit(1);\n }\n}\n"],"mappings":";;;;;;;;;;AAaA,IAAM,8BAAkE;AAAA,EACtE,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,KAAK;AAAA,EACL,cAAc;AAAA,EACd,UAAU;AAAA,EACV,OAAO;AACT;AAEA,IAAM,gBAAoD;AAAA,EACxD,YAAY;AAAA,EACZ,KAAK;AAAA,EACL,KAAK;AAAA,EACL,OAAO;AAAA,EACP,UAAU;AAAA,EACV,cAAc;AAChB;AAUO,SAAS,yBAAyB,UAA8B,iBAAkC;AACvG,QAAM,OAAO,cAAc,QAAQ;AACnC,QAAM,OAAO,4BAA4B,QAAQ;AAGjD,MAAI,sBAAsB,GAAG;AAC3B,WACE,GAAG,IAAI,qLACgF,IAAI;AAAA,EAG/F;AACA,MAAI,oBAAoB,UAAa,cAAc,KAAK,eAAe,GAAG;AACxE,WACE,GAAG,IAAI,kQAE8C,IAAI,8JACsB,IAAI;AAAA,EAGvF;AACA,SACE,GAAG,IAAI,0LAC0E,IAAI,oOAED,IAAI;AAG5F;AAGA,IAAM,gBAAgB;AAMf,SAAS,sBAAsB,UAA8B,iBAAiC;AACnG,QAAM,eAAe,cAAc,QAAQ;AAE3C,QAAM,cAAc;AAAA,IAClB,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,IACP,UAAU;AAAA,IACV,cAAc;AAAA,EAChB,EAAE,QAAQ;AAEV,QAAM,OAAO;AAAA,IACX,YAAY;AAAA,IACZ,KAAK;AAAA,IACL,KAAK;AAAA,IACL,OAAO;AAAA,IACP,UAAU;AAAA,IACV,cAAc;A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nC,cAAQ,OAAO,MAAM,kBAAkB,OAAO,IAAI,MAAM,OAAO,EAAE;AAAA,CAAK;AACtE,aAAO,OAAO;AAAA,IAChB;AACA,QAAI,SAAS,WAAW,GAAG;AACzB,4BAAsB,YAAY;AAAA,IACpC;AACA,UAAM,OAAO,SAAS,IAAI,CAAC,MAAM,KAAK,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE,KAAK,IAAI;AAClE,iBAAa;AAAA,MACX,IAAI;AAAA,MACJ,OAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS;AAAA,EAAqF,IAAI;AAAA,MACpG;AAAA,IACF,CAAC;AACD,YAAQ,KAAK,CAAC;AAAA,EAChB,SAAS,KAAK;AAGZ,QAAI,eAAe,YAAY,oBAAoB,IAAI,MAAM,IAAI,OAAO,GAAG;AACzE,4BAAsB,cAAc,IAAI,OAAO;AAAA,IACjD;AACA,iBAAa;AAAA,MACX,IAAI;AAAA,MACJ,OAAO;AAAA,QACL,MAAM;AAAA,QACN,SAAS;AAAA,MACX;AAAA,IACF,CAAC;AACD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/command-loading.ts","../src/profile-help.ts","../src/agent-profile.ts"],"sourcesContent":["import type { Resolvable, SubCommandsDef } from \"citty\";\n\n/**\n * Which command families one `baker` invocation has to load.\n *\n * Loading every family is what made each `baker` process hold ~135 MB of heap\n * while it waited on one HTTP call: twenty parallel agents ran sixty of them and\n * filled an 8 GB Runtime. A command needs its own family and nothing else.\n */\nexport function familiesToLoad(argv: readonly string[], families: readonly string[]): string[] | \"all\" {\n const first = argv.find((token) => !token.startsWith(\"-\"));\n // `schema` reads the registry every family fills as it loads.\n if (first !== undefined && first !== \"schema\" && families.includes(first)) return [first];\n return \"all\";\n}\n\nexport type LoadableCommand = { meta?: Resolvable<unknown>; subCommands?: Resolvable<SubCommandsDef> };\n\nasync function resolved<T>(value: Resolvable<T>): Promise<T> {\n return typeof value === \"function\" ? await (value as () => T | Promise<T>)() : await value;\n}\n\n/** The command's subcommands, loaded in place if they were declared lazily. */\nasync function subCommandsOf(command: LoadableCommand): Promise<SubCommandsDef | undefined> {\n if (command.subCommands === undefined) return undefined;\n const subCommands = await resolved(command.subCommands);\n command.subCommands = subCommands;\n return subCommands;\n}\n\n/**\n * The subcommand of `command` that `token` names, by its name or an alias, as\n * citty finds it — loaded in place. An alias lives in the subcommand's own\n * meta, so a token that is no name loads the siblings to read theirs.\n */\nexport async function loadSubCommandNamed(\n command: LoadableCommand,\n token: string,\n): Promise<[string, LoadableCommand] | null> {\n const subCommands = await subCommandsOf(command);\n if (!subCommands) return null;\n const named = subCommands[token];\n if (named !== undefined) {\n const loaded = await resolved(named);\n subCommands[token] = loaded;\n return [token, loaded];\n }\n for (const [name, sub] of Object.entries(subCommands)) {\n const loaded = await resolved(sub);\n subCommands[name] = loaded;\n const meta = (await resolved(loaded.meta ?? {})) as { alias?: unknown };\n const aliases = Array.isArray(meta.alias) ? meta.alias : meta.alias === undefined ? [] : [meta.alias];\n if (aliases.includes(token)) return [name, loaded];\n }\n return null;\n}\n\n/** Loads, in place, every command at every depth. */\nexport async function loadAllCommands(command: LoadableCommand): Promise<void> {\n const subCommands = await subCommandsOf(command);\n if (!subCommands) return;\n for (const [name, sub] of Object.entries(subCommands)) {\n const loaded = await resolved(sub);\n subCommands[name] = loaded;\n await loadAllCommands(loaded);\n }\n}\n\n/**\n * Loads, in place, the command `argv` names and every parent on the way — and\n * nothing else, so the flag guards in `cli.ts` see the command they judge while\n * its siblings stay unloaded. Everything loads for `schema` and an unknown\n * name, which need the whole tree. It stops at the first flag: the organization\n * guard (`agent-profile.ts`) walks on past one itself, and loads the subtree a\n * `--help` lists.\n */\nexport async function loadCommands<T extends LoadableCommand>(root: T, argv: readonly string[]): Promise<T> {\n const families = Object.keys((await subCommandsOf(root)) ?? {});\n if (familiesToLoad(argv, families) === \"all\") {\n await loadAllCommands(root);\n return root;\n }\n let command: LoadableCommand = root;\n for (const token of argv) {\n if (token === \"--\" || token.startsWith(\"-\")) break;\n const subCommands = await subCommandsOf(command);\n const sub = subCommands?.[token];\n if (!subCommands || sub === undefined) break;\n const loaded = await resolved(sub);\n subCommands[token] = loaded;\n command = loaded;\n }\n return root;\n}\n","/**\n * What a command's help says, for the agent reading it.\n *\n * Descriptions are written for a company's agent, which may run every command:\n * they cite writes as examples (`baker ads meta campaigns create …`) and say a\n * family \"lists campaigns, or stages writes\". Read by the organization's agent,\n * which may only read, each is a call it would make and be refused. So a line\n * that names a command the reader may not run leaves its help, and where a\n * family holds commands the reader may not run, so does the talk of staging\n * them. A family the reader may change whole (the organization's own Scheduled\n * agents) keeps its staging, because it is how that family works.\n */\n\nimport type { AgentProfile } from \"./agent-profile.ts\";\n\ntype HelpNode = { meta?: unknown; subCommands?: unknown };\ntype Offers = (path: string) => boolean;\n\nfunction loadedSubCommands(node: HelpNode): Array<[string, HelpNode]> {\n const subCommands = node.subCommands;\n if (typeof subCommands !== \"object\" || subCommands === null) return [];\n return Object.entries(subCommands as Record<string, unknown>).flatMap(([name, sub]) =>\n typeof sub === \"object\" && sub !== null ? [[name, sub as HelpNode] as [string, HelpNode]] : [],\n );\n}\n\nfunction subCommandNames(node: HelpNode): string[] {\n const subCommands = node.subCommands;\n return typeof subCommands === \"object\" && subCommands !== null ? Object.keys(subCommands) : [];\n}\n\n/**\n * The command words name (`baker <words>`, or a family's command in backticks),\n * as far as the tree reaches; none when the first is no family. Where the tree\n * is not loaded this far (another family, a sibling this call never needed),\n * the words as written stand for the command: `offers` reads a command by its\n * leading words, so an argument after them changes nothing.\n */\nfunction commandOf(root: HelpNode, mention: string): string[] {\n const words = mention.trim().split(/\\s+/);\n let node: HelpNode = root;\n const path: string[] = [];\n for (const word of words) {\n const loaded = loadedSubCommands(node).find(([name]) => name === word)?.[1];\n if (!loaded) {\n // Not loaded is not \"not there\": a lazy entry of that name stands for the words written.\n return subCommandNames(node).includes(word) ? [words.join(\" \")] : path.length > 0 ? [path.join(\" \")] : [];\n }\n node = loaded;\n path.push(word);\n }\n return [path.join(\" \")];\n}\n\nfunction indentOf(line: string): number {\n return line.length - line.trimStart().length;\n}\n\n/**\n * The lines without those `drops` says go, each taken with what continues it:\n * the lines indented under it, the next line after a trailing `\\`, and the rest\n * of a sentence wrapped onto the lines below. `drops` returns the kept text of\n * a line, or null to drop it.\n */\nfunction dropping(lines: string[], drops: (line: string) => string | null): string[] {\n const kept: string[] = [];\n let carried: ((line: string) => boolean) | null = null;\n for (const line of lines) {\n if (carried?.(line)) continue;\n carried = null;\n const rest = drops(line);\n if (rest !== null) {\n kept.push(rest);\n continue;\n }\n const indent = indentOf(line);\n if (/\\\\\\s*$/.test(line)) {\n let open = true;\n carried = (next) => {\n const continues = open;\n open = /\\\\\\s*$/.test(next);\n return continues;\n };\n } else if (indent === 0 && !/[.:!?)]\\s*$/.test(line)) {\n let open = true;\n carried = (next) => {\n const continues = open && next.trim() !== \"\" && indentOf(next) === 0;\n open = continues && !/[.:!?)]\\s*$/.test(next);\n return continues;\n };\n } else if (indent > 0) {\n carried = (next) => next.trim() !== \"\" && indentOf(next) > indent;\n }\n }\n return kept;\n}\n\n/** A line that stands alone — an example, a table row, a \"Label: …\" entry — goes whole. */\nconst STANDALONE_LINE = /^(?:\\s|baker\\b|[A-Z][\\w ]{0,30}:\\s)/;\n\nfunction balanced(text: string): boolean {\n return (text.match(/\\(/g)?.length ?? 0) === (text.match(/\\)/g)?.length ?? 0);\n}\n\n/** Each command the text names, at where it names it: `baker <words>`, or a family's `<words>` in backticks. */\nfunction commandMentions(root: HelpNode, text: string): Array<{ at: number; words: string }> {\n const families = new Set(subCommandNames(root));\n const quoted = [...text.matchAll(/`([a-z][\\w-]*(?:[ \\t][a-z][\\w-]*)*)(?=[`\\s<])/g)].filter((match) =>\n families.has((match[1] ?? \"\").split(/\\s+/)[0] ?? \"\"),\n );\n return [...text.matchAll(/`?\\bbaker ((?:[a-z][\\w-]*[ \\t]?)+)/g), ...quoted].map((match) => ({\n at: match.index,\n words: match[1] ?? \"\",\n }));\n}\n\n/**\n * Where the text first mentions something the reader may not use — a command\n * it is not offered, or a flag it is refused (`--add-trigger`) — or -1.\n */\nfunction firstUnusable(root: HelpNode, text: string, offered: Offers, refusedFlags: readonly string[]): number {\n const commands = commandMentions(root, text)\n .filter(({ words }) => commandOf(root, words).some((path) => !offered(path)))\n .map(({ at }) => at);\n const flags = refusedFlags.flatMap((flag) => {\n const match = new RegExp(`--${flag}(?![\\\\w-])`).exec(text);\n return match ? [match.index] : [];\n });\n const at = [...commands, ...flags];\n return at.length > 0 ? Math.min(...at) : -1;\n}\n\n/**\n * The sentence without what it says about something the reader may not use:\n * cut back to the clause before the mention when one stands on its own, else\n * dropped.\n */\nfunction sentenceWithout(sentence: string, unusableAt: number): string {\n if (unusableAt === -1) return sentence;\n const before = sentence.slice(0, unusableAt).replace(/`$/, \"\");\n const cut = Math.max(before.lastIndexOf(\", \"), before.lastIndexOf(\" — \"), before.lastIndexOf(\"; \"));\n const clause = cut === -1 ? \"\" : before.slice(0, cut).trim();\n // \"To undo one, `baker …`\" only led to the command.\n const leadsIn = /^(?:to|use|run|call|for|with)\\b/i.test(clause);\n return clause.split(/\\s+/).length >= 3 && balanced(clause) && !leadsIn ? `${clause}.` : \"\";\n}\n\n/** A sentence that leans on the one before it (\"It never touches a live tag.\"). */\nconst LEANS_BACK = /^(?:it|they|this|that|these|those)\\b/i;\n\n/** The text without any mention of a command the reader may not run, or a flag it is refused. */\nexport function withoutUnoffered(\n root: HelpNode,\n text: string,\n offered: Offers,\n refusedFlags: readonly string[] = [],\n): string {\n const unusable = (part: string) => firstUnusable(root, part, offered, refusedFlags);\n return dropping(text.split(\"\\n\"), (line) => {\n if (unusable(line) === -1) return line;\n if (STANDALONE_LINE.test(line)) return null;\n const kept: string[] = [];\n let dropped = false;\n for (const sentence of line.split(/(?<=[.!?])\\s+/)) {\n const rest: string = dropped && LEANS_BACK.test(sentence) ? \"\" : sentenceWithout(sentence, unusable(sentence));\n dropped = rest === \"\";\n if (rest !== \"\") kept.push(rest);\n }\n return kept.length === 0 ? null : kept.join(\" \");\n }).join(\"\\n\");\n}\n\n/** Whether anything loaded under `path` is a command the reader may not run. */\nfunction holdsUnoffered(node: HelpNode, path: string[], offered: Offers): boolean {\n return loadedSubCommands(node).some(\n ([name, sub]) => !offered([...path, name].join(\" \")) || holdsUnoffered(sub, [...path, name], offered),\n );\n}\n\n/** A sentence or line that is about staging a change, from its first words. */\nconst WRITE_TALK =\n /^(?:stage\\b|staged\\b|staging\\b|write subcommands\\b|writes\\b|then stage\\b|drafts:|staged vs published\\b|lifecycle:|nothing staged\\b|on publish\\b|\\w+(?: \\/ \\w+)*\\s+—\\s+stage\\b)/i;\n\n/** The tail of a sentence offering a change: \"List campaigns, or stage writes (…)\". */\nconst WRITE_CLAUSE =\n /(?:\\s*(?:[,;]|\\s—|\\s-)\\s*(?:(?:or|plus|and)\\s+)?|\\s+(?:or|plus|and)\\s+)(?:stage[sd]?|staged)\\b[^.]*/gi;\n\n/** \"List, show, amend or clear …\": a sentence opening on a list of this command's own verbs. */\nconst VERB_LIST = /^((?:[A-Za-z]+, )*[A-Za-z]+,? (?:or|and) [a-z]+)\\b/;\n\n/** The sentence naming, of the verbs it opens on, only those the reader may run; \"\" when none. */\nfunction withOfferedVerbs(sentence: string, children: ReadonlySet<string>, unoffered: ReadonlySet<string>): string {\n const list = VERB_LIST.exec(sentence)?.[1];\n if (!list) return sentence;\n const verbs = list.split(/,\\s*(?:(?:or|and)\\s+)?|\\s+(?:or|and)\\s+/).map((verb) => verb.toLowerCase());\n if (!verbs.every((verb) => children.has(verb))) return sentence;\n const kept = verbs.filter((verb) => !unoffered.has(verb));\n if (kept.length === 0) return \"\";\n const named = kept.length === 1 ? (kept[0] ?? \"\") : `${kept.slice(0, -1).join(\", \")} or ${kept.at(-1)}`;\n return `${named.charAt(0).toUpperCase()}${named.slice(1)}${sentence.slice(list.length)}`;\n}\n\n/** Whether text opens on the name of a command here the reader may not run (\"Release if…\", \" associate-campaign / …\"). */\nfunction opensOnUnoffered(text: string, unoffered: ReadonlySet<string>): boolean {\n const first =\n text\n .trim()\n .split(/[\\s/]+/)[0]\n ?.toLowerCase() ?? \"\";\n return unoffered.has(first);\n}\n\n/** A line that is about a change: staging talk, a command it may not run, or \"Library writes (…):\" over reads. */\nfunction isWriteLine(line: string, unoffered: ReadonlySet<string>): boolean {\n if (WRITE_TALK.test(line.trim())) return true;\n if (indentOf(line) > 0) return opensOnUnoffered(line, unoffered);\n return /:\\s*$/.test(line) && /\\bwrites?\\b/i.test(line);\n}\n\nfunction withoutWriteTalk(paragraph: string, children: ReadonlySet<string>, unoffered: ReadonlySet<string>): string {\n const prose = (text: string) =>\n text\n .replace(WRITE_CLAUSE, \"\")\n .split(/(?<=[.!?])\\s+/)\n .map((sentence) => withOfferedVerbs(sentence, children, unoffered))\n .filter(\n (sentence) => sentence !== \"\" && !WRITE_TALK.test(sentence.trim()) && !opensOnUnoffered(sentence, unoffered),\n )\n .join(\" \");\n const lines = paragraph.split(\"\\n\");\n // Examples, tables and headings are kept line by line, and a line of prose among them sentence by sentence.\n if (lines.some((line) => /^\\s/.test(line) || STANDALONE_LINE.test(line) || /:\\s*$/.test(line))) {\n return dropping(lines, (line) => {\n if (isWriteLine(line, unoffered)) return null;\n if (indentOf(line) > 0 || STANDALONE_LINE.test(line) || !/[.!?]\\s*$/.test(line)) return line;\n const kept = prose(line);\n return kept === \"\" ? null : kept;\n }).join(\"\\n\");\n }\n return prose(lines.join(\" \"));\n}\n\n/** \"Subcommands: list (default), remove, clear.\" names only the ones the reader may run. */\nfunction withOfferedSubcommands(text: string, path: string[], offered: Offers): string {\n return text.replace(/Subcommands: ([^.]*)\\./g, (_whole, list: string) => {\n const kept = list.split(/,\\s*/).filter((item) => offered([...path, item.split(/\\s/)[0] ?? \"\"].join(\" \")));\n return kept.length > 0 ? `Subcommands: ${kept.join(\", \")}.` : \"\";\n });\n}\n\n/** Drops a heading whose block below it was emptied, and the blank lines left behind. */\nfunction tidy(text: string): string {\n const lines = text.split(\"\\n\");\n const kept = lines.filter((line, index) => {\n if (!/:\\s*$/.test(line)) return true;\n const next = lines.slice(index + 1).find((later) => later.trim() !== \"\");\n return next !== undefined && /^\\s/.test(next) && lines[index + 1]?.trim() !== \"\";\n });\n return kept\n .join(\"\\n\")\n .replace(/\\n{3,}/g, \"\\n\\n\")\n .replace(/^(?:[ \\t]*\\n)+/, \"\")\n .trimEnd();\n}\n\nexport function describedFor(\n root: HelpNode,\n description: string,\n path: string[],\n node: HelpNode,\n profile: AgentProfile,\n offered: Offers,\n refusedFlags: readonly string[] = [],\n): string {\n const cited = withoutUnoffered(root, description, offered, refusedFlags);\n if (profile === \"company\" || !holdsUnoffered(node, path, offered)) return tidy(cited);\n const children = new Set(subCommandNames(node));\n const unoffered = new Set([...children].filter((name) => !offered([...path, name].join(\" \"))));\n const shaped = cited\n .split(/\\n\\s*\\n/)\n .map((paragraph) => withoutWriteTalk(withOfferedSubcommands(paragraph, path, offered), children, unoffered))\n .join(\"\\n\\n\");\n const text = tidy(shaped);\n if (text !== \"\") return text;\n const reads = loadedSubCommands(node).flatMap(([name]) => (offered([...path, name].join(\" \")) ? [name] : []));\n return reads.length > 0 ? `Read: ${reads.join(\", \")}.` : \"\";\n}\n","import { type LoadableCommand, loadAllCommands, loadSubCommandNamed } from \"./command-loading.ts\";\nimport { optionalWorkspaceKind } from \"./env.ts\";\nimport { describedFor, withoutUnoffered } from \"./profile-help.ts\";\n\n/**\n * Which commands this CLI offers the agent running it.\n *\n * One CLI serves two agents. A company's agent works inside its own workspace\n * and changes it; it is offered everything, except the organization family,\n * which is for reading other companies and means nothing to it. The\n * organization workspace's agent reads every company of its organization and\n * changes none of them: it is offered the reads alone, plus the research and\n * judgment it runs as itself, and its own Scheduled agents.\n *\n * This is what the agent is shown, not what it is allowed: the backend refuses\n * a write naming a company whatever the CLI does (`readNamedCompany`). Kept as\n * an explicit list so a new command is hidden from the organization until\n * someone decides it only reads.\n */\n\nexport type AgentProfile = \"company\" | \"organization\";\n\n/** Set on the organization workspace's Runtime (`runtimeSession/nodeActions.ts`). */\nexport function agentProfile(workspaceKind: string | undefined = optionalWorkspaceKind()): AgentProfile {\n return workspaceKind === \"organization\" ? \"organization\" : \"company\";\n}\n\n/** Families only the organization workspace runs: hidden from a company's agent. */\nconst ORGANIZATION_ONLY = [\"organization\"];\n\n/**\n * Every command the organization workspace's agent is offered, as typed. An\n * entry offers that command and everything under it.\n */\nexport const ORGANIZATION_COMMANDS: readonly string[] = [\n \"schema\",\n \"capabilities\",\n \"organization\",\n // What a company did and has.\n \"chats\",\n \"history\",\n \"actions list\",\n \"actions log\",\n \"actions get\",\n \"actions status\",\n \"actions draft list\",\n \"actions tags list\",\n // The organization's own Scheduled agents, which live in this workspace:\n // staged like a company's, applied at Publish. Naming a company is still a\n // read only (`readNamedCompany`), so none of these reaches one.\n \"scheduled-agents\",\n \"experiment status\",\n \"experiment history\",\n \"flows list\",\n \"flows show\",\n \"flows schema\",\n \"testimonials get\",\n \"testimonials search\",\n \"testimonials list\",\n \"testimonials tags list\",\n \"testimonials sources list\",\n \"images get\",\n \"images search\",\n \"images library\",\n \"images tags list\",\n // A page's or a link's pictures and videos, to the workspace's own disk: a\n // client's logo, the photos on its site, the video it sent. Firecrawl reads\n // the page; nothing reaches any library (`--auto-ingest` is refused below).\n \"images download\",\n \"images extract\",\n \"videos get\",\n \"videos search\",\n \"videos tags list\",\n \"videos fetch\",\n \"studio get\",\n \"studio list\",\n \"avatars list\",\n \"avatars get\",\n \"creatives performance\",\n \"creatives feedback read\",\n \"landing export status\",\n \"landing export list\",\n \"site show\",\n \"site domain list\",\n \"credentials list\",\n \"setup-links list\",\n \"media-sources list\",\n \"posts list\",\n \"posts get\",\n \"posts search\",\n \"mcp connected\",\n \"mcp catalog\",\n \"mcp tools\",\n \"mcp execute\",\n \"mcp list\",\n // Ads, every platform: accounts, structure, results, staged drafts.\n \"ads google accounts\",\n \"ads google currency\",\n \"ads google url-options\",\n \"ads google changes\",\n \"ads google invoices\",\n \"ads google identity-verification\",\n \"ads google previews\",\n \"ads google brands\",\n \"ads google query\",\n \"ads google keywords discover\",\n \"ads google keywords metrics\",\n \"ads google keywords forecast\",\n \"ads google keywords themes\",\n \"ads google keywords locations\",\n \"ads google keywords languages\",\n \"ads google keywords list\",\n \"ads google budgets list\",\n \"ads google campaigns list\",\n \"ads google ad-groups list\",\n \"ads google negative-keywords list\",\n \"ads google keyword-lists list\",\n \"ads google ads list\",\n \"ads google assets list\",\n \"ads google asset-groups list\",\n \"ads google audiences list\",\n \"ads google audiences targeting\",\n \"ads google conversions list\",\n \"ads google bidding-strategies list\",\n \"ads google labels list\",\n \"ads google campaign-criteria list\",\n \"ads google ad-group-criteria list\",\n \"ads google ad-group-bid-modifiers list\",\n \"ads google account-exclusions list\",\n \"ads google asset-group-signals list\",\n \"ads google merchant-center list\",\n \"ads google draft list\",\n \"ads google draft show\",\n \"ads meta accounts\",\n \"ads meta account\",\n \"ads meta businesses\",\n \"ads meta pages\",\n \"ads meta lead-forms list\",\n \"ads meta leads\",\n \"ads meta campaigns list\",\n \"ads meta adsets list\",\n \"ads meta ads list\",\n \"ads meta creatives list\",\n \"ads meta audiences list\",\n \"ads meta custom-conversions list\",\n \"ads meta pixels\",\n \"ads meta activities\",\n \"ads meta insights\",\n \"ads meta draft list\",\n \"ads meta draft show\",\n \"ads linkedin accounts\",\n \"ads linkedin account detail\",\n \"ads linkedin campaign-groups list\",\n \"ads linkedin campaigns list\",\n \"ads linkedin creatives list\",\n \"ads linkedin draft list\",\n \"ads linkedin draft show\",\n \"ads linkedin analytics\",\n \"ads linkedin demographics\",\n \"ads linkedin companies\",\n \"ads linkedin top-companies\",\n \"ads linkedin resolve\",\n \"ads linkedin facets list\",\n \"ads linkedin facets values\",\n \"ads linkedin audience-size\",\n \"ads linkedin bid-pricing\",\n \"ads linkedin forecast\",\n \"ads linkedin leads\",\n \"ads linkedin conversions list\",\n \"ads linkedin conversions health\",\n \"ads linkedin conversation\",\n \"ads linkedin audit\",\n \"ads linkedin url-params\",\n \"ads x accounts\",\n \"ads x funding\",\n \"ads x campaigns list\",\n \"ads x line-items list\",\n \"ads x promoted-tweets list\",\n \"ads x tweets\",\n \"ads x cards\",\n \"ads x draft list\",\n \"ads x draft show\",\n \"ads x media\",\n \"ads x audiences\",\n \"ads x targeting-criteria list\",\n \"ads x targeting-constants\",\n \"ads x active-entities\",\n \"ads x stats job-status\",\n \"ads chatgpt account show\",\n \"ads chatgpt campaigns list\",\n \"ads chatgpt ad-groups list\",\n \"ads chatgpt ads list\",\n \"ads chatgpt conversions list\",\n \"ads chatgpt conversions events\",\n \"ads chatgpt conversions report\",\n \"ads chatgpt audiences list\",\n \"ads chatgpt catalogs list\",\n \"ads chatgpt catalogs uploads\",\n \"ads chatgpt catalogs products\",\n \"ads chatgpt history\",\n \"ads chatgpt insights\",\n \"ads chatgpt locations\",\n \"ads chatgpt draft list\",\n \"ads chatgpt draft show\",\n // Baker's synced copy of every platform's results, which the live reads above\n // point at first. Reads only: each `show` beside its staged changes.\n \"ads performance overview\",\n \"ads performance trend\",\n // Who the ads brought: counts per ad and per persona answer, and the ladder\n // and persona map they are counted by (`adPerformance/peopleRoute.ts`).\n \"ads performance people\",\n \"ads performance personas\",\n \"ads performance ladder\",\n \"ads performance persona-fields\",\n \"ads performance accounts\",\n \"ads performance setup\",\n \"ads performance entities\",\n \"ads performance entity\",\n \"ads performance changes\",\n \"ads performance impact\",\n \"ads performance creatives\",\n \"ads performance families show\",\n \"ads performance families choices\",\n \"ads performance creative-health\",\n \"ads performance creative-assets\",\n \"ads performance health\",\n \"ads performance breakdown\",\n \"ads performance search-terms\",\n \"ads performance pacing\",\n \"ads performance funnel\",\n \"ads performance tracking\",\n \"ads performance landings\",\n \"ads performance live-in\",\n \"ads performance status\",\n \"ads performance goals show\",\n \"ads performance progress\",\n \"ads performance diagnose\",\n \"ads performance pulse\",\n \"ads performance anomalies\",\n \"ads performance recap\",\n \"ads performance targets show\",\n \"ads performance budget-recommendations\",\n \"ads performance attention show\",\n \"ads performance currency show\",\n \"ads performance brand-split\",\n \"ads performance impression-share\",\n \"ads performance keyword-quality\",\n \"ads performance google-report\",\n \"ads performance budgets show\",\n \"ads performance segments show\",\n // Pages and measurement.\n \"analytics overview\",\n \"analytics traffic\",\n \"analytics funnel\",\n \"analytics flow\",\n \"analytics page\",\n \"analytics triggers\",\n \"analytics releases\",\n \"analytics paid\",\n \"analytics delivery\",\n \"analytics submissions\",\n \"analytics geo\",\n \"analytics bots\",\n \"analytics landings\",\n \"analytics tags\",\n \"analytics events\",\n \"analytics feed\",\n \"analytics lookup\",\n \"analytics devices\",\n \"analytics ads\",\n \"analytics conversions\",\n \"analytics sends\",\n \"analytics tracking\",\n \"analytics arrivals\",\n \"analytics sending-events\",\n \"analytics sources\",\n \"analytics website-tag\",\n \"analytics sites\",\n \"analytics questionnaire\",\n \"analytics presets\",\n \"funnel\",\n \"ga4 properties\",\n \"ga4 config\",\n \"ga4 audit\",\n \"ga4 query\",\n \"ga4 draft list\",\n \"ga4 draft show\",\n \"gsc\",\n \"tags list\",\n \"tags draft\",\n \"tag-manager containers\",\n \"tag-manager read\",\n \"tag-manager draft list\",\n \"tag-manager draft show\",\n // CRM and accounts.\n \"hubspot\",\n \"accounts influenced\",\n \"accounts engagement\",\n \"accounts warm\",\n \"accounts company\",\n \"accounts campaigns\",\n \"accounts crm status\",\n \"accounts crm check\",\n \"accounts crm contract\",\n // Research and judgment, run as the workspace itself (never with --company).\n // Not `research customers`, which writes into a company's Knowledge, nor\n // `winning-ads fit`, which judges an ad against a company's own COMPANY.md.\n \"research web\",\n \"research fetch\",\n \"research linkedin-person\",\n \"research transcript\",\n \"research company\",\n \"research google-ads\",\n \"research reddit\",\n \"research advertisers\",\n \"research autocomplete\",\n \"research countries\",\n \"research intent\",\n \"research keyword-metrics\",\n \"research keywords-for-site\",\n \"research keyword-gap\",\n \"research languages\",\n \"research lighthouse\",\n \"research relevant-pages\",\n \"decide\",\n \"winning-ads search\",\n \"winning-ads advertisers\",\n // Adds a brand to Baker's shared library with nobody following it, so a\n // client being set up can be read there: its channels, ads and landings.\n \"winning-ads add\",\n \"winning-ads discover\",\n \"winning-ads following\",\n \"winning-ads feed\",\n \"winning-ads winners\",\n \"winning-ads ads\",\n \"winning-ads profile\",\n \"winning-ads launches\",\n \"winning-ads landings\",\n \"winning-ads search-copy\",\n \"winning-ads content\",\n \"winning-ads hooks\",\n \"winning-ads mechanisms\",\n \"winning-ads formats\",\n];\n\nfunction covers(entry: string, path: string): boolean {\n return path === entry || path.startsWith(`${entry} `);\n}\n\n/**\n * Whether `path` (a command as typed, `\"ads meta campaigns list\"`) is offered\n * to `profile`. A group is offered when anything under it is, so the way to an\n * offered command stays open.\n */\nexport function offers(profile: AgentProfile, path: string): boolean {\n if (path === \"\") return true;\n if (profile === \"company\") {\n return !ORGANIZATION_ONLY.some((family) => covers(family, path));\n }\n return ORGANIZATION_COMMANDS.some((entry) => covers(entry, path) || covers(path, entry));\n}\n\n/**\n * The flags that change something, on commands the organization is offered to\n * read. `funnel` reads the funnel and `funnel --add-trigger` changes it, so the\n * command is offered and these are refused, and left out of its help.\n */\nexport const ORGANIZATION_WRITE_FLAGS: Readonly<Record<string, readonly string[]>> = {\n \"images extract\": [\"auto-ingest\", \"context\"],\n funnel: [\"steps\", \"step\", \"add-trigger\", \"remove-trigger\", \"event\", \"remove-step\", \"preset\"],\n \"analytics conversions\": [\"event\", \"name\", \"rename\", \"to\", \"remove-name\", \"count-mode\", \"remove\"],\n \"analytics sends\": [\n \"set\",\n \"source-event\",\n \"from\",\n \"platform\",\n \"tag\",\n \"event\",\n \"account\",\n \"parameter\",\n \"id\",\n \"remove\",\n ],\n \"analytics sources\": [\n \"server\",\n \"create\",\n \"create-hubspot\",\n \"create-activecampaign\",\n \"events\",\n \"account\",\n \"set-trigger\",\n \"set-amount\",\n \"amount-property\",\n \"currency\",\n \"write\",\n \"name\",\n \"map\",\n \"field\",\n \"pause\",\n \"resume\",\n \"remove\",\n ],\n \"analytics sites\": [\"add\", \"remove\"],\n};\n\nfunction kebabCase(name: string): string {\n return name.replace(/[A-Z]/g, (letter) => `-${letter.toLowerCase()}`);\n}\n\n/** The first flag in `argv` the organization is refused on the command at `path`, if any. */\nfunction refusedFlagIn(path: string, argv: readonly string[]): string | null {\n const refused = ORGANIZATION_WRITE_FLAGS[path];\n if (!refused) return null;\n const end = argv.indexOf(\"--\");\n for (const token of end === -1 ? argv : argv.slice(0, end)) {\n if (!token.startsWith(\"--\")) continue;\n const name = kebabCase(token.slice(2).split(\"=\")[0] ?? \"\").replace(/^no-/, \"\");\n if (refused.includes(name)) return name;\n }\n return null;\n}\n\ntype ProfiledCommand = { meta?: unknown; subCommands?: unknown };\n\n/** What the organization's agent is told when it reaches for a command it is not offered. */\nexport const ORGANIZATION_REFUSAL =\n \"The organization workspace only reads its companies, and this command changes something. A change to a company is made in that company's own chat; here, read it and show it in a Report.\";\n\nfunction hide(command: ProfiledCommand): void {\n if (typeof command.meta === \"object\" && command.meta !== null) {\n (command.meta as { hidden?: boolean }).hidden = true;\n }\n}\n\n/**\n * Rewrites, in place, what each loaded command `profile` is shown says\n * (`profile-help.ts`), and takes off it the flags `profile` is refused. Args are\n * replaced rather than edited: one definition can be shared between commands.\n */\nfunction describeOffered(root: ProfiledCommand, command: ProfiledCommand, profile: AgentProfile, path: string[]): void {\n const meta = command.meta as { hidden?: boolean; description?: unknown } | undefined;\n if (meta?.hidden === true) return;\n const offered = (cited: string) => offers(profile, cited);\n const refusedFlags = profile === \"organization\" ? (ORGANIZATION_WRITE_FLAGS[path.join(\" \")] ?? []) : [];\n if (typeof meta?.description === \"string\") {\n meta.description = describedFor(root, meta.description, path, command, profile, offered, refusedFlags);\n }\n const shaped = command as { args?: unknown };\n if (typeof shaped.args === \"object\" && shaped.args !== null) {\n shaped.args = Object.fromEntries(\n Object.entries(shaped.args as Record<string, unknown>).flatMap(([name, arg]) => {\n if (refusedFlags.includes(kebabCase(name))) return [];\n const description = (arg as { description?: unknown } | null)?.description;\n return [\n [\n name,\n typeof description === \"string\"\n ? { ...(arg as object), description: withoutUnoffered(root, description, offered, refusedFlags) }\n : arg,\n ],\n ];\n }),\n );\n }\n const subCommands = command.subCommands;\n if (typeof subCommands !== \"object\" || subCommands === null) return;\n for (const [name, sub] of Object.entries(subCommands as Record<string, unknown>)) {\n if (typeof sub === \"object\" && sub !== null)\n describeOffered(root, sub as ProfiledCommand, profile, [...path, name]);\n }\n}\n\n/** Marks, in place, every loaded command `profile` is not offered as hidden from help. */\nfunction hideUnoffered(command: ProfiledCommand, profile: AgentProfile, path: string[]): void {\n const subCommands = command.subCommands;\n if (typeof subCommands !== \"object\" || subCommands === null) return;\n for (const [name, sub] of Object.entries(subCommands as Record<string, unknown>)) {\n if (typeof sub !== \"object\" || sub === null) continue;\n const subPath = [...path, name];\n if (!offers(profile, subPath.join(\" \"))) hide(sub as ProfiledCommand);\n hideUnoffered(sub as ProfiledCommand, profile, subPath);\n }\n}\n\ntype ArgDefinition = { type?: unknown; alias?: unknown };\n\nfunction camelCase(name: string): string {\n return name.replace(/-([a-z0-9])/g, (_, letter: string) => letter.toUpperCase());\n}\n\nfunction aliases(of: unknown): unknown[] {\n return Array.isArray(of) ? of : of === undefined ? [] : [of];\n}\n\n/** Whether `flag` takes the token after it as its value on `command`, as citty reads it. */\nfunction takesValue(command: ProfiledCommand & { args?: unknown }, flag: string): boolean {\n if (flag.includes(\"=\") || typeof command.args !== \"object\" || command.args === null) return false;\n const name = flag.replace(/^-{1,2}/, \"\");\n return Object.entries(command.args as Record<string, ArgDefinition>).some(\n ([key, definition]) =>\n (definition.type === \"string\" || definition.type === \"enum\") &&\n (camelCase(key) === camelCase(name) || aliases(definition.alias).includes(name)),\n );\n}\n\n/**\n * The command `argv` addresses, found the way citty finds it: flags, and the\n * value after one that takes it, are skipped, so a flag before a command's name\n * cannot leave the path at its group. Each step is loaded on the way —\n * `loadCommands` stops at the first flag, and `--company` is taken off only\n * after it ran, so the guard cannot lean on what it loaded.\n */\nasync function addressedCommand(\n root: ProfiledCommand,\n argv: readonly string[],\n): Promise<{ path: string; command: ProfiledCommand }> {\n const path: string[] = [];\n let command: ProfiledCommand = root;\n for (let index = 0; index < argv.length; index++) {\n const token = argv[index] ?? \"\";\n if (token === \"--\") break;\n if (token.startsWith(\"-\")) {\n if (takesValue(command, token)) index++;\n continue;\n }\n const next = await loadSubCommandNamed(command as LoadableCommand, token);\n if (!next) break;\n path.push(next[0]);\n command = next[1] as ProfiledCommand;\n }\n return { path: path.join(\" \"), command };\n}\n\n/**\n * Shapes the loaded command tree for the agent running it: what it is not\n * offered leaves its help, and the organization's agent is refused a command it\n * is not offered (the returned message; `null` when it may run). A company's\n * agent is never refused: the organization's commands are only out of its help,\n * because a Report published from the organization workspace runs them on a\n * runner that has no profile of its own.\n */\nexport async function applyAgentProfile(\n root: ProfiledCommand,\n profile: AgentProfile,\n argv: readonly string[],\n): Promise<string | null> {\n const { path, command } = await addressedCommand(root, argv);\n // A walk that ends on a group prints its usage — `--help` anywhere, past `--`\n // too, or no command or an unknown one — listing its subcommands, which are\n // hidden only once loaded. A walk that reaches a command loads nothing more.\n await loadAllCommands(command as LoadableCommand);\n // Judged before the help is shaped, which takes the refused flags off the command.\n const refused = profile === \"organization\" && (!offers(profile, path) || refusedFlagIn(path, argv) !== null);\n hideUnoffered(root, profile, []);\n describeOffered(root, root, profile, []);\n return refused ? ORGANIZATION_REFUSAL : null;\n}\n"],"mappings":";;;;;AASO,SAAS,eAAe,MAAyB,UAA+C;AACrG,QAAM,QAAQ,KAAK,KAAK,CAAC,UAAU,CAAC,MAAM,WAAW,GAAG,CAAC;AAEzD,MAAI,UAAU,UAAa,UAAU,YAAY,SAAS,SAAS,KAAK,EAAG,QAAO,CAAC,KAAK;AACxF,SAAO;AACT;AAIA,eAAe,SAAY,OAAkC;AAC3D,SAAO,OAAO,UAA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AAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA;AAAA;AAAA,EAGA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AA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C1C;","names":["aliases","at"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../../api/src/mcp-catalog.ts","../src/commands/mcp/index.ts","../src/commands/mcp/catalog.ts","../../api/src/mcp-tools.ts","../src/commands/mcp/execute.ts","../src/commands/mcp/platforms.ts"],"sourcesContent":["/**\n * Contract for `GET /api/mcp/catalog` — searching the managed-app catalog the\n * sandbox agent can ask the user to connect when a vendor publishes no MCP\n * server of its own.\n *\n * `connect` mirrors `ToolkitConnectMode` in `convex/composio/types.ts`, folded\n * to what the user will be asked for: a sign-in or a key. Apps that need no\n * sign-in are left out — Composio refuses to connect them.\n */\nimport { z } from \"zod\";\n\nexport const MCP_CATALOG_DEFAULT_LIMIT = 8;\nexport const MCP_CATALOG_DESCRIPTION_MAX = 160;\n\nexport const mcpCatalogRequestSchema = z.object({\n search: z.string().trim().min(1, \"Provide --search\").max(100),\n limit: z.coerce.number().int().min(1).max(20).default(MCP_CATALOG_DEFAULT_LIMIT),\n});\nexport type McpCatalogRequest = z.infer<typeof mcpCatalogRequestSchema>;\n\nexport const mcpCatalogConnectSchema = z.enum([\"sign-in\", \"key\"]);\nexport type McpCatalogConnect = z.infer<typeof mcpCatalogConnectSchema>;\n\nexport const mcpCatalogEntrySchema = z.object({\n /** The toolkit slug — what request_connection `{ app }` takes. */\n app: z.string(),\n name: z.string(),\n description: z.string().max(MCP_CATALOG_DESCRIPTION_MAX),\n connect: mcpCatalogConnectSchema,\n connected: z.boolean(),\n});\nexport type McpCatalogEntry = z.infer<typeof mcpCatalogEntrySchema>;\n\nexport const mcpCatalogResponseSchema = z.object({\n apps: z.array(mcpCatalogEntrySchema),\n /** Baker's own connections this search matched — ask for these with `{ platform }`, never a managed copy. */\n platforms: z.array(z.string()).optional(),\n});\nexport type McpCatalogResponse = z.infer<typeof mcpCatalogResponseSchema>;\n","import {\n type CustomMcpDisableResponse,\n type CustomMcpVerifyResponse,\n customMcpServerNameRequestSchema,\n} from \"@baker/api\";\nimport { type McpCatalogResponse, mcpCatalogRequestSchema } from \"@baker/api/mcp-catalog\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiGet, apiPost } from \"../../client.ts\";\nimport { getEnv } from \"../../env.ts\";\nimport { repeatedValues } from \"../../lib/repeatedFlags.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { catalogHints } from \"./catalog.ts\";\nimport { executeCommand, toolsCommand } from \"./execute.ts\";\nimport { type ConnectedPlatform, platformEntry } from \"./platforms.ts\";\n\nconst SCOPES = [\"user\", \"user_org\", \"company\", \"org\"] as const;\ntype Scope = (typeof SCOPES)[number];\n\nfunction parseScope(raw: unknown): Scope {\n const scope = raw === undefined ? \"company\" : String(raw);\n if (!(SCOPES as readonly string[]).includes(scope)) {\n throw new ApiError(\"VALIDATION_ERROR\", `Invalid --scope \"${scope}\". Use user | user_org | company | org.`);\n }\n return scope as Scope;\n}\n\n/** The turn's message sender, injected by the bridge — required only for user scope. */\nfunction actingUserId(): string | undefined {\n return getEnv().BAKER_ACTING_USER_ID;\n}\n\ntype CustomMcpServer = {\n _id: string;\n scope: \"user\" | \"user_org\" | \"company\" | \"org\";\n name: string;\n url: string;\n headerKeys: string[];\n enabled: boolean;\n /** Absent until the address has been checked; `ok: false` means it serves no tools. */\n health?: { ok: boolean; message?: string; suggestedUrl?: string; transient?: boolean; checkedAt: number };\n createdAt: number;\n};\n\n/**\n * What to report for one custom server. `problem` is the whole point: a server can\n * be signed in, enabled and still serve nothing (wrong address), and reporting it\n * as plain \"connected\" is how an agent ends up promising tools it does not have.\n * A `transient` failure is reported separately — the tool may well answer, so\n * declaring it broken would be its own kind of lie.\n */\nfunction customEntry(server: CustomMcpServer): Record<string, unknown> {\n const failed = server.health && !server.health.ok;\n const problem = server.health?.message ?? \"This server's address is not serving tools.\";\n return {\n name: server.name,\n scope: server.scope,\n enabled: server.enabled,\n ...(failed && !server.health?.transient ? { usable: false, problem } : {}),\n ...(failed && server.health?.transient ? { lastCheck: \"failed\", problem } : {}),\n ...(failed && server.health?.suggestedUrl ? { suggestedAddress: server.health.suggestedUrl } : {}),\n };\n}\n\n/** The hint an unusable server earns — the agent must not offer its tools or invent a reason. */\nconst BROKEN_SERVER_HINT =\n \"A server marked usable=false will NOT answer: its tools are absent from this turn. Say plainly that the tool is not working and relay `problem`; never claim its tools are loading, coming next message, or temporarily unavailable. `problem` names what a person has to fix — the address, the sign-in, or the key the server was added with — so pass on that fix and no other: never tell the user to reconnect a server whose `problem` is its address or its key. The user makes the fix in the dashboard (Brain → Integrations → More apps). If `suggestedAddress` is present, that is the address to use.\";\n\n/** The hint for a server whose last check failed for a reason that may already have passed. */\nconst LAST_CHECK_FAILED_HINT =\n \"A server with lastCheck=failed was unreachable or erroring when it was last checked — that may already have passed, and its tools ARE loaded this turn. Try the tool; if it works, say nothing about the check. If it fails, report `problem` as what happened rather than guessing.\";\n\n/** Turn repeated `--header \"K: V\"` (or `K=V`) flags into a headers record. */\n/** `--header` is repeatable, so its values come off the command line — citty keeps only the last. */\nfunction parseHeaders(raw: unknown, rawArgs?: readonly string[]): Record<string, string> | undefined {\n const list = repeatedValues(rawArgs, \"header\", raw);\n const headers: Record<string, string> = {};\n for (const entry of list) {\n const text = String(entry);\n const sep = text.indexOf(\":\") >= 0 && (text.indexOf(\":\") < text.indexOf(\"=\") || text.indexOf(\"=\") < 0) ? \":\" : \"=\";\n const at = text.indexOf(sep);\n if (at <= 0) {\n throw new ApiError(\"VALIDATION_ERROR\", `Invalid header \"${text}\". Use \"Key: Value\".`);\n }\n headers[text.slice(0, at).trim()] = text.slice(at + 1).trim();\n }\n return Object.keys(headers).length > 0 ? headers : undefined;\n}\n\nfunction fail(err: unknown): never {\n if (err instanceof ApiError) {\n writeJson({ ok: false, error: { code: err.code, message: err.message } });\n process.exit(1);\n }\n writeJson({ ok: false, error: { code: \"NETWORK_ERROR\", message: \"Unexpected error\" } });\n process.exit(1);\n}\n\ntype ManagedConnection = {\n toolkitSlug: string;\n scope: \"user\" | \"user_org\" | \"company\" | \"org\";\n status: string;\n accountLabel: string | null;\n readOnly: boolean;\n};\n\ntype ConnectedResponse = {\n managed: ManagedConnection[];\n custom: CustomMcpServer[];\n platforms: ConnectedPlatform[];\n};\n\n/** The one thing an agent must not do with this list: infer a platform's state from the MCP half. */\nconst PLATFORMS_HINT =\n \"`platforms` are connected accounts you reach through `baker` commands (HubSpot, Google Ads, GA4, Search Console, Tag Manager, …), NOT mcp__* tools — there is no tool to call for them. A platform listed here IS connected: never tell the user to connect it, and never conclude it is missing because it has no mcp__* entry. The one exception is a platform whose `status` says its sign-in no longer works: ask the user to reconnect it with request_connection before reading it — that is their sign-in ending, not a Baker error. Read what it holds with its own command family (`baker hubspot …`, `baker ads google …`, `baker ga4 …`, and so on).\";\n\nregisterSchema({\n command: \"mcp.connected\",\n description:\n \"List everything this chat can reach: managed integrations (Attio, Slack, Gmail, Google Sheets, …), custom MCP servers, and the platforms the company signed in to (HubSpot, Google Ads, GA4, Search Console, Tag Manager) which you read through their own `baker` commands. Start here when the user mentions an external tool or platform.\",\n args: {},\n});\n\nconst connectedCommand = defineCommand({\n meta: {\n name: \"connected\",\n description: `Everything this chat can reach — managed integrations, custom MCP servers, and connected platforms.\n\nManaged tools ride the composio servers (mcp__composio_<scope>__*); custom servers expose mcp__<name>__*.\nPlatforms (HubSpot, Google Ads, GA4, …) have no mcp__* tools at all — you read them with their own\n\\`baker\\` command family, and one listed here is connected and ready to use.\nA tool or platform the user names that is NOT listed anywhere here is simply not connected yet.`,\n },\n run: async () => {\n try {\n const user = actingUserId();\n const data = await apiGet<ConnectedResponse>(\"/api/mcp/connected\", user ? { actingUserId: user } : undefined);\n const managed = data.managed.map((c) => ({\n toolkit: c.toolkitSlug,\n scope: c.scope,\n ...(c.status !== \"ACTIVE\" ? { status: c.status } : {}),\n ...(c.accountLabel ? { account: c.accountLabel } : {}),\n ...(c.readOnly ? { readOnly: true } : {}),\n }));\n const custom = data.custom.map(customEntry);\n const platforms = (data.platforms ?? []).map(platformEntry);\n const hints: string[] = [];\n if (platforms.length > 0) {\n hints.push(PLATFORMS_HINT);\n }\n if (data.custom.some((s) => s.health && !s.health.ok && !s.health.transient)) {\n hints.push(BROKEN_SERVER_HINT);\n }\n if (data.custom.some((s) => s.health && !s.health.ok && s.health.transient)) {\n hints.push(LAST_CHECK_FAILED_HINT);\n }\n if ([...data.managed, ...data.custom].some((e) => e.scope === \"user\" || e.scope === \"user_org\")) {\n hints.push(\n \"user/user_org entries are personal: they belong to the current message sender and load only in their turns — other users in this chat won't have them.\",\n );\n }\n hints.push(\n \"Not listed anywhere = not connected — connect it from the chat with request_connection, never by sending the user to the dashboard: a Baker platform (HubSpot, Google Ads, GA4, …) → { platform }; anything else → the vendor's own MCP server FIRST: use the address the user gave you, or WebSearch '<vendor> MCP server' and WebFetch its official docs for the remote https address and how it signs in, then { server: { name, url, auth, keyHeader } }; only when the vendor has none → `baker mcp catalog --search <name>`, then { app }. Research before you ask the user anything. What they connect loads into this same turn.\",\n );\n writeJson({\n ok: true,\n data: { managed, custom, platforms },\n hints,\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst catalogArgs = {\n search: { type: \"string\", description: \"App or vendor name, e.g. notion, clarity, pipedrive\", required: true },\n limit: { type: \"string\", description: \"Max apps to return, 1-20 (default 8)\", required: false },\n} as const;\n\nregisterSchema({\n command: \"mcp.catalog\",\n description:\n \"Search the managed apps you can ask the user to connect when a vendor has no MCP server of its own. Each app says how the user connects it (sign-in | key) and whether this chat already reaches it. Example: baker mcp catalog --search notion\",\n args: catalogArgs,\n});\n\nconst catalogCommand = defineCommand({\n meta: {\n name: \"catalog\",\n description: `Managed apps you can ask the user to connect when a vendor has no MCP server of its own.\n\nFor a tool \\`baker mcp connected\\` does not list whose vendor has no official remote MCP server:\n baker mcp catalog --search notion\n baker mcp catalog --search \"microsoft clarity\" --limit 3\n\nEach app: app (slug for request_connection), name, description, connect (sign-in | key), connected.\nPrefer the vendor's own MCP server when it publishes one; a catalog app is the fallback.`,\n },\n args: catalogArgs,\n run: async ({ args }) => {\n const parsed = mcpCatalogRequestSchema.safeParse({ search: args.search, limit: args.limit });\n if (!parsed.success) {\n writeJson({\n ok: false,\n error: { code: \"VALIDATION_ERROR\", message: parsed.error.issues[0]?.message ?? \"Invalid arguments\" },\n });\n process.exit(1);\n }\n try {\n const user = actingUserId();\n const data = await apiGet<McpCatalogResponse>(\"/api/mcp/catalog\", {\n search: parsed.data.search,\n limit: String(parsed.data.limit),\n ...(user ? { actingUserId: user } : {}),\n });\n writeJson({\n ok: true,\n data: {\n apps: data.apps,\n ...(data.platforms?.length ? { platforms: data.platforms } : {}),\n },\n hints: catalogHints(data.apps, { platforms: data.platforms ?? [] }),\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nregisterSchema({\n command: \"mcp.list\",\n description: \"List the custom MCP servers this company's chats see (org + company + your own user scope).\",\n args: {},\n});\n\nconst listCommand = defineCommand({\n meta: { name: \"list\", description: \"List custom MCP servers visible to this company's chats.\" },\n run: async () => {\n try {\n const user = actingUserId();\n const data = await apiGet<{ servers: CustomMcpServer[] }>(\n \"/api/mcp/custom\",\n user ? { actingUserId: user } : undefined,\n );\n writeJson({\n ok: true,\n // Detail view: the full row (address included) plus the usability verdict.\n // `health` itself is folded into `usable`/`problem` by `customEntry`.\n data: data.servers.map((server) => ({ ...server, health: undefined, ...customEntry(server) })),\n ...(data.servers.some((s) => s.health && !s.health.ok)\n ? {\n hints: data.servers.some((s) => s.health && !s.health.ok && !s.health.transient)\n ? [BROKEN_SERVER_HINT]\n : [LAST_CHECK_FAILED_HINT],\n }\n : {}),\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nregisterSchema({\n command: \"mcp.add\",\n description:\n \"Register a custom MCP server. Tools appear as mcp__<name>__* on the next message. URL must be HTTPS. Scope: company (default, all chats) | org (org admin key) | user (only the current sender).\",\n args: {\n name: { type: \"string\", description: \"Server name → tools appear as mcp__<name>__*\", required: true },\n url: {\n type: \"string\",\n description: \"Full HTTPS MCP endpoint (commonly ends in /mcp, not just the domain)\",\n required: true,\n },\n scope: { type: \"string\", description: \"user | user_org | company | org (default company)\", required: false },\n header: { type: \"string\", description: 'Auth header \"Key: Value\" (repeatable)', required: false },\n },\n});\n\nconst addCommand = defineCommand({\n meta: {\n name: \"add\",\n description: `Register a custom MCP server. Tools appear as mcp__<name>__* on the NEXT message.\nFor a server the USER asks for, use request_connection { server } instead: they confirm who can use it,\ntype any key into the card (never the chat), and its tools load in this same turn.\n\nScope: company (default — every chat in the company) | org (all companies in the org; needs an admin key) | user (only the current message sender).\n\nExamples:\n baker mcp add --name weather --url https://mcp.example.com/mcp\n baker mcp add --name acme --url https://acme.dev/mcp --header \"Authorization: Bearer sk-…\"\n baker mcp add --name mine --url https://my.dev/mcp --scope user`,\n },\n args: {\n name: { type: \"string\", description: \"Server name (mcp__<name>__*)\", required: true },\n url: {\n type: \"string\",\n description: \"Full HTTPS MCP endpoint (commonly ends in /mcp, not just the domain)\",\n required: true,\n },\n scope: { type: \"string\", description: \"user | user_org | company | org (default company)\", required: false },\n header: { type: \"string\", description: 'Auth header \"Key: Value\" (repeatable)', required: false },\n },\n run: async ({ args, rawArgs }) => {\n try {\n const scope = parseScope(args.scope);\n const user = actingUserId();\n const headers = parseHeaders(args.header, rawArgs);\n const data = await apiPost<{ name: string }>(\"/api/mcp/custom\", {\n name: args.name as string,\n url: args.url as string,\n scope,\n ...(user ? { actingUserId: user } : {}),\n ...(headers ? { headers } : {}),\n });\n writeJson({\n ok: true,\n data,\n hints: [\n \"The address must be the full MCP endpoint (commonly ending in /mcp), not just the domain — a domain on its own usually answers sign-in and then serves no tools.\",\n \"The address is checked in the background. Run `baker mcp connected` on the next message to confirm it serves tools before promising the user anything.\",\n ],\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nregisterSchema({\n command: \"mcp.remove\",\n description: \"Remove a company custom MCP server by name.\",\n args: { name: { type: \"string\", description: \"Server name to remove\", required: true } },\n});\n\nconst removeCommand = defineCommand({\n meta: {\n name: \"remove\",\n description: `Remove a company custom MCP server by name.\n\nExample:\n baker mcp remove --name weather`,\n },\n args: { name: { type: \"string\", description: \"Server name to remove\", required: true } },\n run: async ({ args }) => {\n try {\n const user = actingUserId();\n const data = await apiPost<{ removed: boolean }>(\"/api/mcp/custom/remove\", {\n name: args.name as string,\n ...(user ? { actingUserId: user } : {}),\n });\n writeJson({ ok: true, data });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst serverNameArgs = {\n name: { type: \"string\", description: \"Custom server name, as `baker mcp list` shows it\", required: true },\n} as const;\n\nregisterSchema({\n command: \"mcp.verify\",\n description:\n \"Check a custom MCP server now (the dashboard's 'Check now') and store the result. Use after the user fixed its address or sign-in, or when its tools failed this turn.\",\n args: serverNameArgs,\n});\n\nconst verifyCommand = defineCommand({\n meta: {\n name: \"verify\",\n description: `Check a custom MCP server now and store the result.\n\nExample:\n baker mcp verify --name weather`,\n },\n args: serverNameArgs,\n run: async ({ args }) => {\n const parsed = customMcpServerNameRequestSchema.safeParse({ name: args.name, actingUserId: actingUserId() });\n if (!parsed.success) {\n fail(new ApiError(\"VALIDATION_ERROR\", parsed.error.issues[0]?.message ?? \"Invalid arguments\"));\n }\n try {\n const data = await apiPost<CustomMcpVerifyResponse>(\"/api/mcp/custom/verify\", parsed.data);\n writeJson({\n ok: true,\n data,\n hints: [\n data.ok\n ? \"The server answers and serves tools. Its tools load on the next message.\"\n : data.transient\n ? LAST_CHECK_FAILED_HINT\n : BROKEN_SERVER_HINT,\n ],\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nregisterSchema({\n command: \"mcp.disable\",\n description:\n \"Switch a custom MCP server off so its tools stop loading; its address and sign-in are kept. Turning it back on is done by a person in the dashboard, never by the agent.\",\n args: serverNameArgs,\n});\n\nconst disableCommand = defineCommand({\n meta: {\n name: \"disable\",\n description: `Switch a custom MCP server off (its tools stop loading). Only a person can turn it back on, in the dashboard.\n\nExample:\n baker mcp disable --name weather`,\n },\n args: serverNameArgs,\n run: async ({ args }) => {\n const parsed = customMcpServerNameRequestSchema.safeParse({ name: args.name, actingUserId: actingUserId() });\n if (!parsed.success) {\n fail(new ApiError(\"VALIDATION_ERROR\", parsed.error.issues[0]?.message ?? \"Invalid arguments\"));\n }\n try {\n const data = await apiPost<CustomMcpDisableResponse>(\"/api/mcp/custom/disable\", parsed.data);\n writeJson({\n ok: true,\n data,\n hints: [\n \"Its tools stop loading from the next message, and this applies right away — publishing or discarding this chat does not undo it. Tell the user they can turn it back on in Brain → Integrations → More apps.\",\n ],\n });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nexport const mcpCommand = defineCommand({\n meta: {\n name: \"mcp\",\n description: `Third-party tools for this company — see what's connected, register custom HTTPS MCP endpoints.\n\nTools from a registered server appear as mcp__<name>__* on the next message.\nManaged here are **company-scoped** servers; user- and org-scoped servers are managed in the dashboard.\n\nStart here:\n baker mcp connected # everything this chat can reach: managed integrations, custom servers, connected platforms\n baker mcp catalog --search notion # managed apps you can connect when a vendor has no MCP server of its own\n\nRun a connected app's read-only tool from the command line (JSON on stdout — for reports and scripts):\n baker mcp tools --app googlesheets --search \"read rows\"\n baker mcp execute --tool GOOGLESHEETS_BATCH_GET --get-schema\n baker mcp execute --tool GOOGLESHEETS_BATCH_GET --data '{\"spreadsheet_id\":\"…\",\"ranges\":[\"A1:D50\"]}'\n\nExamples:\n baker mcp add --name weather --url https://mcp.example.com/mcp\n baker mcp add --name acme --url https://acme.dev/mcp --header \"Authorization: Bearer sk-…\"\n baker mcp remove --name weather\n baker mcp verify --name weather # check it now after the user fixed it\n baker mcp disable --name weather # stop its tools loading (only a person turns it back on)\nFull guide: __tooling__/docs/tools/baker/mcp.md`,\n },\n subCommands: {\n connected: connectedCommand,\n catalog: catalogCommand,\n tools: toolsCommand,\n execute: executeCommand,\n list: listCommand,\n add: addCommand,\n remove: removeCommand,\n verify: verifyCommand,\n disable: disableCommand,\n },\n});\n","/**\n * What `baker mcp catalog` tells the agent to do next with the managed apps it\n * found — the fallback when a vendor publishes no MCP server of its own.\n */\nimport type { McpCatalogEntry } from \"@baker/api/mcp-catalog\";\n\nconst PREFER_VENDOR_HINT =\n 'The vendor\\'s own MCP server comes before any app here. If you have not yet, WebSearch \"<vendor> MCP server\" and WebFetch its official docs for the remote https address and how it signs in, then ask for it with request_connection `{ server: { name, url, auth, keyHeader } }`. Only when the vendor has none, ask for an app from this catalog with request_connection `{ app: \"<slug>\", reason }` — the user connects it in the chat and its tools load right after, in this same turn.';\n\nconst ALREADY_CONNECTED_HINT =\n \"An app marked connected is already reachable — use its mcp__composio_* tools; do not ask again.\";\n\nconst NO_MATCH_HINT =\n \"Nothing in the catalog matches. WebSearch for the vendor's official remote MCP server (its docs, its developer site) before telling the user it can't be connected — if one exists, ask for it with request_connection `{ server }`. Only when the web shows no official remote server either, say plainly this tool can't be connected yet and offer a Task.\";\n\n/** Baker's own connection always wins over a catalog app or anyone's MCP server for the same tool. */\nfunction firstPartyHint(platforms: readonly string[]): string {\n const asks = platforms.map((p) => `request_connection \\`{ platform: \"${p}\" }\\``).join(\" or \");\n return `This is one of Baker's own connections — ask for it with ${asks}. It is the one Baker's commands, staging and publish work with, so never connect it as a catalog app or as an MCP server, even one the vendor publishes or the user names. If it is already connected, read it with its own baker command family instead.`;\n}\n\n/** What the agent should do next with a catalog answer. */\nexport function catalogHints(\n apps: readonly McpCatalogEntry[],\n { platforms = [] }: { platforms?: readonly string[] } = {},\n): string[] {\n if (platforms.length > 0) {\n return [firstPartyHint(platforms)];\n }\n const hints = [PREFER_VENDOR_HINT];\n if (apps.some((a) => a.connected)) {\n hints.push(ALREADY_CONNECTED_HINT);\n }\n if (apps.length === 0) {\n hints.push(NO_MATCH_HINT);\n }\n return hints;\n}\n","/**\n * Contract for running a connected app's tools from the `baker` CLI —\n * `GET /api/mcp/tools` (find one), `GET /api/mcp/tool` (its inputs) and\n * `POST /api/mcp/execute` (run it).\n *\n * The same tools the chat reaches as `mcp__composio_*`, but answered as JSON on\n * stdout, so a Report's data endpoint can call one through `runBaker` and a\n * script can keep what it returned. Only tools the app marks read-only run here:\n * a published Report runs them for whoever opens it, and a chat stages every\n * change it makes until Publish.\n */\nimport { z } from \"zod\";\n\nexport const MCP_TOOLS_DEFAULT_LIMIT = 10;\nexport const MCP_TOOL_DESCRIPTION_MAX = 200;\n\n/** A Composio tool slug: `GMAIL_FETCH_EMAILS`, `GOOGLESHEETS_BATCH_GET`. */\nexport const mcpToolSlugSchema = z\n .string()\n .trim()\n .min(1, \"Provide --tool\")\n .max(120)\n .regex(/^[A-Za-z0-9_]+$/, \"A tool is named like GMAIL_FETCH_EMAILS — find one with `baker mcp tools --search`\")\n .transform((slug) => slug.toUpperCase());\n\n/** A toolkit slug as `baker mcp connected` lists it: `gmail`, `googlesheets`. */\nexport const mcpAppSlugSchema = z\n .string()\n .trim()\n .min(1)\n .max(60)\n .regex(/^[a-z0-9_-]+$/i, \"Name the app as `baker mcp connected` lists it, e.g. gmail\")\n .transform((slug) => slug.toLowerCase());\n\nexport const mcpToolsRequestSchema = z\n .object({\n search: z.string().trim().min(1).max(200).optional(),\n app: mcpAppSlugSchema.optional(),\n limit: z.coerce.number().int().min(1).max(50).default(MCP_TOOLS_DEFAULT_LIMIT),\n })\n .refine((request) => request.search !== undefined || request.app !== undefined, {\n message: \"Provide --search, --app, or both\",\n });\nexport type McpToolsRequest = z.infer<typeof mcpToolsRequestSchema>;\n\nexport const mcpToolSummarySchema = z.object({\n tool: z.string(),\n app: z.string(),\n name: z.string(),\n description: z.string().max(MCP_TOOL_DESCRIPTION_MAX),\n /** Only read-only tools run through `baker mcp execute`. */\n readOnly: z.boolean(),\n});\nexport type McpToolSummary = z.infer<typeof mcpToolSummarySchema>;\n\nexport const mcpToolsResponseSchema = z.object({\n tools: z.array(mcpToolSummarySchema),\n /** The connected apps the search ran over. */\n apps: z.array(z.string()),\n});\nexport type McpToolsResponse = z.infer<typeof mcpToolsResponseSchema>;\n\nexport const mcpToolRequestSchema = z.object({\n tool: mcpToolSlugSchema,\n full: z.boolean().default(false),\n});\n\n/** One input, folded to what the agent needs to fill it. */\nexport const mcpToolInputSchema = z.object({\n name: z.string(),\n type: z.string(),\n required: z.boolean(),\n description: z.string().optional(),\n enum: z.array(z.unknown()).optional(),\n default: z.unknown().optional(),\n});\nexport type McpToolInput = z.infer<typeof mcpToolInputSchema>;\n\nexport const mcpToolResponseSchema = z.object({\n tool: z.string(),\n app: z.string(),\n name: z.string(),\n description: z.string(),\n readOnly: z.boolean(),\n inputs: z.array(mcpToolInputSchema),\n /** The raw JSON schemas, with `--full` only. */\n inputSchema: z.unknown().optional(),\n outputSchema: z.unknown().optional(),\n});\nexport type McpToolResponse = z.infer<typeof mcpToolResponseSchema>;\n\nexport const mcpExecuteRequestSchema = z.object({\n tool: mcpToolSlugSchema,\n arguments: z.record(z.string(), z.unknown()).default({}),\n actingUserId: z.string().optional(),\n});\nexport type McpExecuteRequest = z.infer<typeof mcpExecuteRequestSchema>;\n\nexport const mcpExecuteResponseSchema = z.object({\n tool: z.string(),\n app: z.string(),\n /** Whose connection answered: `company` is the one a published Report reads. */\n scope: z.enum([\"user\", \"user_org\", \"company\", \"org\"]),\n account: z.string().nullable(),\n /** What the tool returned, as the app returned it. */\n data: z.unknown(),\n});\nexport type McpExecuteResponse = z.infer<typeof mcpExecuteResponseSchema>;\n","/**\n * `baker mcp tools` and `baker mcp execute`: a connected app's tools run from\n * the command line, so what they return is JSON on stdout — for a Report's data\n * endpoint (`runReportBaker`), a script, or a file — instead of a tool result\n * only the chat sees. The same tools as `mcp__composio_*`, reads only.\n */\nimport {\n type McpExecuteResponse,\n type McpToolResponse,\n type McpToolsResponse,\n mcpExecuteRequestSchema,\n mcpToolRequestSchema,\n mcpToolsRequestSchema,\n} from \"@baker/api/mcp-tools\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiGet, apiPost } from \"../../client.ts\";\nimport { getEnv } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\n\n/** A tool's run gets as long as a report gives one `baker` call, less its own margin. */\nconst EXECUTE_TIMEOUT_MS = 120_000;\n\nfunction fail(err: unknown): never {\n if (err instanceof ApiError) {\n writeJson({ ok: false, error: { code: err.code, message: err.message } });\n process.exit(1);\n }\n writeJson({ ok: false, error: { code: \"NETWORK_ERROR\", message: \"Unexpected error\" } });\n process.exit(1);\n}\n\nfunction invalid(message: string): never {\n return fail(new ApiError(\"VALIDATION_ERROR\", message));\n}\n\n/** The turn's message sender, injected by the bridge; the backend vouches for it, and a report has none. */\nfunction actingUserId(): string | undefined {\n return getEnv().BAKER_ACTING_USER_ID;\n}\n\n/** What to tell the agent after a run: above all, whether a published report will read the same thing. */\nexport function executeHints(ran: Pick<McpExecuteResponse, \"tool\" | \"app\" | \"scope\">): string[] {\n const hints: string[] = [];\n if (ran.scope !== \"company\") {\n hints.push(\n `This answer came from a ${ran.scope === \"org\" ? \"connection shared by the organization\" : \"connection of the person sending this message\"}. A published report reads only apps connected for the whole company, so ${ran.tool} will answer \"not connected\" there: ask the user to connect ${ran.app} for the whole company before building a report on it.`,\n );\n }\n hints.push(\n `In a report endpoint: runReportBaker(event, [\"mcp\", \"execute\", \"--tool\", \"${ran.tool}\", \"--data\", JSON.stringify(args)]) — return only the fields the page shows.`,\n );\n return hints;\n}\n\nconst toolsArgs = {\n search: {\n type: \"string\",\n description: 'What the tool should do, e.g. \"fetch emails\", \"read sheet rows\"',\n required: false,\n },\n app: {\n type: \"string\",\n description: \"Only this connected app, as `baker mcp connected` lists it (gmail)\",\n required: false,\n },\n limit: { type: \"string\", description: \"Max tools to return, 1-50 (default 10)\", required: false },\n} as const;\n\nregisterSchema({\n command: \"mcp.tools\",\n description:\n 'Find a connected app\\'s tools to run with `baker mcp execute`. Searches the apps this chat reaches (or --app). Each tool: tool (slug), app, name, description, readOnly (only read-only tools run). Example: baker mcp tools --app googlesheets --search \"read rows\"',\n args: toolsArgs,\n});\n\nexport const toolsCommand = defineCommand({\n meta: {\n name: \"tools\",\n description: `Find a connected app's tools to run from the command line with \\`baker mcp execute\\`.\n\nStart here:\n baker mcp tools --search \"fetch unread emails\" # across every connected app\n baker mcp tools --app googlesheets --search \"read rows\"\n baker mcp tools --app hubspot --limit 20 # an app's tools, no search\n\nEach tool: tool (the slug execute takes), app, name, description, readOnly.\nOnly readOnly tools run through execute; a tool that changes things is the chat's own mcp__composio_* tool.`,\n },\n args: toolsArgs,\n run: async ({ args }) => {\n const parsed = mcpToolsRequestSchema.safeParse({ search: args.search, app: args.app, limit: args.limit });\n if (!parsed.success) {\n invalid(parsed.error.issues[0]?.message ?? \"Invalid arguments\");\n }\n try {\n const user = actingUserId();\n const data = await apiGet<McpToolsResponse>(\"/api/mcp/tools\", {\n ...(parsed.data.search ? { search: parsed.data.search } : {}),\n ...(parsed.data.app ? { app: parsed.data.app } : {}),\n limit: String(parsed.data.limit),\n ...(user ? { actingUserId: user } : {}),\n });\n const hints =\n data.apps.length === 0\n ? [\n \"No app is connected here. Check `baker mcp connected`; connect one with request_connection, from the chat.\",\n ]\n : [\n \"Run one with `baker mcp execute --tool <TOOL> --get-schema` first to see its inputs, then `--data '<json>'`.\",\n ...(data.tools.some((tool) => !tool.readOnly)\n ? [\n \"readOnly: false tools cannot run through execute — they change things; use the chat's mcp__composio_* tool.\",\n ]\n : []),\n ];\n writeJson({ ok: true, data, hints });\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst executeArgs = {\n tool: { type: \"string\", description: \"Tool slug from `baker mcp tools`, e.g. GMAIL_FETCH_EMAILS\", required: true },\n data: {\n type: \"string\",\n description: \"The tool's arguments as a JSON object, e.g. '{\\\"max_results\\\":10}'\",\n required: false,\n },\n \"get-schema\": { type: \"boolean\", description: \"Show the tool's inputs instead of running it\", required: false },\n full: {\n type: \"boolean\",\n description: \"With --get-schema: the raw input and output JSON schemas too\",\n required: false,\n },\n} as const;\n\nregisterSchema({\n command: \"mcp.execute\",\n description:\n 'Run one read-only tool of a connected app and print what it returned as JSON — for a report\\'s data endpoint, a script, or keeping the answer. `--get-schema` shows its inputs first. A published report reaches only apps connected for the whole company. Example: baker mcp execute --tool GOOGLESHEETS_BATCH_GET --data \\'{\"spreadsheet_id\":\"…\",\"ranges\":[\"A1:D50\"]}\\'',\n args: executeArgs,\n});\n\nfunction parseData(raw: unknown): Record<string, unknown> {\n if (raw === undefined || raw === \"\") {\n return {};\n }\n let value: unknown;\n try {\n value = JSON.parse(String(raw));\n } catch {\n invalid(`--data must be a JSON object, e.g. '{\"max_results\":10}' (keys and strings in double quotes).`);\n }\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n invalid(`--data must be a JSON object, e.g. '{\"max_results\":10}'.`);\n }\n return value as Record<string, unknown>;\n}\n\nexport const executeCommand = defineCommand({\n meta: {\n name: \"execute\",\n description: `Run one read-only tool of a connected app; prints what it returned as JSON.\n\nThe same tools as the chat's mcp__composio_* servers, answered on stdout so a report's data endpoint,\na script or a file can keep it. Find the tool with \\`baker mcp tools\\`, read its inputs, then run it:\n baker mcp execute --tool GOOGLESHEETS_BATCH_GET --get-schema\n baker mcp execute --tool GOOGLESHEETS_BATCH_GET --data '{\"spreadsheet_id\":\"1AbC…\",\"ranges\":[\"Sheet1!A1:D50\"]}'\n baker mcp execute --tool GMAIL_FETCH_EMAILS --data '{\"query\":\"is:unread newer_than:7d\",\"max_results\":20}' > /tmp/inbox.json\n\nReads only: a tool that changes things (send, create, update) is refused — use the chat's own tool for it.\nA published report runs as nobody, so it reaches only apps connected for the whole company; a\nperson's own connection answers in their chat and nowhere else.`,\n },\n args: executeArgs,\n run: async ({ args }) => {\n if (args[\"get-schema\"]) {\n const parsed = mcpToolRequestSchema.safeParse({ tool: args.tool, full: args.full === true });\n if (!parsed.success) {\n invalid(parsed.error.issues[0]?.message ?? \"Invalid arguments\");\n }\n try {\n const data = await apiGet<McpToolResponse>(\"/api/mcp/tool\", {\n tool: parsed.data.tool,\n ...(parsed.data.full ? { full: \"true\" } : {}),\n });\n writeJson({\n ok: true,\n data,\n hints: data.readOnly\n ? [`Run it: baker mcp execute --tool ${data.tool} --data '<json object of the inputs above>'`]\n : [\n `${data.tool} changes things, so execute refuses it. In a chat, use the app's own mcp__composio_* tool.`,\n ],\n });\n } catch (err) {\n fail(err);\n }\n return;\n }\n const parsed = mcpExecuteRequestSchema.safeParse({\n tool: args.tool,\n arguments: parseData(args.data),\n actingUserId: actingUserId(),\n });\n if (!parsed.success) {\n invalid(parsed.error.issues[0]?.message ?? \"Invalid arguments\");\n }\n try {\n const data = await apiPost<McpExecuteResponse>(\"/api/mcp/execute\", parsed.data, {\n timeoutMs: EXECUTE_TIMEOUT_MS,\n });\n writeJson({ ok: true, data, hints: executeHints(data) });\n } catch (err) {\n fail(err);\n }\n },\n});\n","/**\n * How a connected platform reads back to the agent.\n *\n * A platform (HubSpot, Google Ads, GA4, …) is an account the company signed in\n * to, reached through its own `baker` command family rather than an `mcp__*`\n * tool. It rides `mcp connected` because that is the one answer to \"what can\n * this chat reach\" — and because an agent that only saw the tool half had no\n * way to tell a working HubSpot connection from a missing one.\n */\n\nexport interface ConnectedPlatform {\n type: string;\n label: string;\n account: string | null;\n reads: string[];\n readsLabel: string | null;\n /** Absent when the sign-in is good; see `connectedPlatforms` in the backend. */\n signIn?: \"needs_reconnect\" | \"expiring\";\n}\n\n/** \"Ad Accounts\" -> `adAccounts`, \"Properties\" -> `properties`. */\nfunction readsKey(label: string): string {\n const [first = \"\", ...rest] = label.split(\" \");\n return [first.toLowerCase(), ...rest].join(\"\");\n}\n\n/**\n * One platform as the agent sees it. The resources are keyed by the platform's\n * own word for them — `properties` for GA4, `containers` for Tag Manager,\n * `adAccounts` for the ad platforms — so what the agent reads back matches what\n * the user sees in the dashboard.\n */\nexport function platformEntry(platform: ConnectedPlatform): Record<string, unknown> {\n const status = signInStatus(platform);\n return {\n platform: platform.label,\n ...(platform.account ? { account: platform.account } : {}),\n ...(platform.readsLabel && platform.reads.length > 0 ? { [readsKey(platform.readsLabel)]: platform.reads } : {}),\n ...(status ? { status } : {}),\n };\n}\n\n/**\n * A sign-in that is not simply good, said with what to do about it. A listed\n * platform reads as connected, so one whose sign-in died would otherwise be\n * trusted until a read failed — and then reported to the user as Baker's fault.\n */\nfunction signInStatus(platform: ConnectedPlatform): string | null {\n const request = `request_connection { platform: \"${platform.type}\" }`;\n if (platform.signIn === \"needs_reconnect\") {\n return `sign-in no longer works — needs reconnecting: call ${request}`;\n }\n if (platform.signIn === \"expiring\") {\n return `signed in, but the sign-in lapses within days — tell the user and offer to renew it now with ${request}`;\n }\n return null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AASA,SAAS,SAAS;AAEX,IAAM,4BAA4B;AAClC,IAAM,8BAA8B;AAEpC,IAAM,0BAA0B,EAAE,OAAO;AAAA,EAC9C,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,GAAG,kBAAkB,EAAE,IAAI,GAAG;AAAA,EAC5D,OAAO,EAAE,OAAO,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,QAAQ,yBAAyB;AACjF,CAAC;AAGM,IAAM,0BAA0B,EAAE,KAAK,CAAC,WAAW,KAAK,CAAC;AAGzD,IAAM,wBAAwB,EAAE,OAAO;AAAA;AAAA,EAE5C,KAAK,EAAE,OAAO;AAAA,EACd,MAAM,EAAE,OAAO;AAAA,EACf,aAAa,EAAE,OAAO,EAAE,IAAI,2BAA2B;AAAA,EACvD,SAAS;AAAA,EACT,WAAW,EAAE,QAAQ;AACvB,CAAC;AAGM,IAAM,2BAA2B,EAAE,OAAO;AAAA,EAC/C,MAAM,EAAE,MAAM,qBAAqB;AAAA;AAAA,EAEnC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS;AAC1C,CAAC;;;AC/BD,SAAS,iBAAAA,sBAAqB;;;ACA9B,IAAM,qBACJ;AAEF,IAAM,yBACJ;AAEF,IAAM,gBACJ;AAGF,SAAS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