@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.
- package/README.md +20 -1
- package/dist/{account-PISI6UMC.js → account-QX4G4BJ7.js} +4 -4
- package/dist/{account-JNBDG6PB.js → account-UFYZS3K6.js} +4 -4
- package/dist/{account-BA3IO3AN.js → account-ZY655BIU.js} +3 -3
- package/dist/{account-assets-T3VVNBUG.js → account-assets-J5Z4URLQ.js} +8 -8
- package/dist/{account-level-MPFWRPEK.js → account-level-4SBYYHRS.js} +5 -5
- package/dist/{account-reads-ATFFFKV4.js → account-reads-FOEVPWDP.js} +4 -4
- package/dist/{account-users-FBA7PDBK.js → account-users-UTIF7MIT.js} +4 -4
- package/dist/{account-writes-R5T3F5QT.js → account-writes-QAQXRIEY.js} +4 -4
- package/dist/{accounts-4R3MBNJG.js → accounts-FT2SRKMD.js} +4 -4
- package/dist/{accounts-JNVS3HEX.js → accounts-JK3OAS5U.js} +2 -2
- package/dist/{accounts-VPWCLF6X.js → accounts-K5XLEO6W.js} +3 -3
- package/dist/{accounts-KELFJVQM.js → accounts-OE33CKWD.js} +4 -4
- package/dist/{accounts-5WF7VE7J.js → accounts-SNB65ZEW.js} +4 -4
- package/dist/{active-entities-WDPW7652.js → active-entities-3BAPHE4P.js} +3 -3
- package/dist/{activities-WGPHYSFU.js → activities-LKLPORDI.js} +4 -4
- package/dist/{ad-group-writes-4OCFZI33.js → ad-group-writes-XY5JYTKT.js} +4 -4
- package/dist/{ad-groups-7NE3A255.js → ad-groups-YEO5ZS5U.js} +8 -8
- package/dist/{ad-writes-FWUMC6AE.js → ad-writes-XRCPK4SP.js} +4 -4
- package/dist/{ads-MUFH7FLP.js → ads-AYJAYLFR.js} +7 -7
- package/dist/{ads-ITEUGEUV.js → ads-H7H7H2CM.js} +9 -9
- package/dist/{ads-F7AUJWK7.js → ads-MAOI7S6V.js} +13 -13
- package/dist/{adsets-XH2ULWPM.js → adsets-QRKICEFD.js} +12 -12
- package/dist/{analytics-ZFWZ5YD5.js → analytics-ADIWEM6G.js} +10 -10
- package/dist/{analytics-TPI27PJL.js → analytics-XB6FRNVJ.js} +3 -3
- package/dist/{asset-writes-4X3AJQ4Q.js → asset-writes-JLVUAVUZ.js} +5 -5
- package/dist/{audience-size-4JPP222L.js → audience-size-P5L6MZ4C.js} +3 -3
- package/dist/{audience-writes-TXWPDJ2F.js → audience-writes-CDKQB3SM.js} +4 -4
- package/dist/{audiences-YUG5JLL4.js → audiences-34IQKOGS.js} +3 -3
- package/dist/{audiences-MBBXWEOI.js → audiences-CDDI5HR5.js} +8 -8
- package/dist/{audiences-5QFAMXWP.js → audiences-XKERWKKE.js} +4 -4
- package/dist/{audit-WFXS5ELM.js → audit-7ED6CUTQ.js} +3 -3
- package/dist/{audit-QQAM5QJ2.js → audit-SEADLC6F.js} +3 -3
- package/dist/{bid-pricing-JKUFSCZG.js → bid-pricing-NWSUO3VM.js} +3 -3
- package/dist/{businesses-24JNY46Z.js → businesses-MGP2YCEU.js} +3 -3
- package/dist/{campaign-groups-QUEKAHHT.js → campaign-groups-PH64UXZJ.js} +9 -9
- package/dist/{campaign-writes-GZ5MKJ63.js → campaign-writes-BN3EGDK5.js} +4 -4
- package/dist/{campaign-writes-UO5P7OD7.js → campaign-writes-CLV5ZSUK.js} +4 -4
- package/dist/{campaigns-7V7PYIHJ.js → campaigns-5XRY27JZ.js} +8 -8
- package/dist/{campaigns-KXYGSH27.js → campaigns-HES5MDUG.js} +12 -12
- package/dist/{campaigns-QNBBQTMU.js → campaigns-JF4TYYUP.js} +12 -12
- package/dist/{campaigns-G24AEUCM.js → campaigns-ZYU4BXDP.js} +8 -8
- package/dist/{cards-NSNAFTEB.js → cards-A7GQVC7B.js} +3 -3
- package/dist/{catalogs-I4WWTCIZ.js → catalogs-6XLBWAUS.js} +4 -4
- package/dist/{catalogs-VZYAATUR.js → catalogs-TGLSJEK5.js} +4 -4
- package/dist/{changes-BPC2O52H.js → changes-OOUVQDBY.js} +3 -3
- package/dist/{chatgpt-WFGSWJ5N.js → chatgpt-NAXIFWXV.js} +13 -13
- package/dist/{chunk-KGYTIPS2.js → chunk-3G3GC5N4.js} +2 -2
- package/dist/{chunk-LNODLR7W.js → chunk-3GAR4AZK.js} +2 -2
- package/dist/{chunk-Z53DY5HT.js → chunk-3M45PYU7.js} +3 -3
- package/dist/{chunk-DHVFI7AE.js → chunk-4LF4AYPT.js} +2 -2
- package/dist/{chunk-Z35KUMBW.js → chunk-4UQRXKYJ.js} +2 -2
- package/dist/{chunk-TYXZ2SRW.js → chunk-7BUIOP36.js} +2 -2
- package/dist/{chunk-GX5333QH.js → chunk-7I6ZVBLM.js} +3 -3
- package/dist/{chunk-IDSDJHRS.js → chunk-7NF73SCB.js} +2 -2
- package/dist/{chunk-M7QZSEHF.js → chunk-B2POVFR2.js} +2 -2
- package/dist/{chunk-VXWG4ZS2.js → chunk-BJOK7QD4.js} +2 -2
- package/dist/{chunk-FCHZ5TNG.js → chunk-DM3Q6F5F.js} +2 -2
- package/dist/{chunk-DN6ZZTQE.js → chunk-DMJUIUAL.js} +2 -2
- package/dist/{chunk-C3IO4R4B.js → chunk-EW7JSTRZ.js} +2 -2
- package/dist/{chunk-ASRS37QE.js → chunk-GAYRBIEF.js} +3 -1
- package/dist/chunk-GAYRBIEF.js.map +1 -0
- package/dist/{chunk-HHVWV5BJ.js → chunk-GU5MXV2Y.js} +2 -2
- package/dist/{chunk-I3WGTSDY.js → chunk-HGUYC5K6.js} +2 -2
- package/dist/{chunk-HCQJYI6X.js → chunk-HMIROUFV.js} +2 -2
- package/dist/{chunk-SBNBYRGZ.js → chunk-K7IE6UYV.js} +3 -3
- package/dist/{chunk-2F4DELSV.js → chunk-KUY26RCF.js} +2 -2
- package/dist/{chunk-VPABGAN4.js → chunk-NWF2LRKO.js} +2 -2
- package/dist/{chunk-ILPHIYAL.js → chunk-QDQZ62FL.js} +3 -3
- package/dist/{chunk-TU5LQUJM.js → chunk-RCJKABOS.js} +2 -2
- package/dist/{chunk-IPO33JRU.js → chunk-TGPGQTZA.js} +3 -3
- package/dist/{chunk-TU7DWSTW.js → chunk-TLQOMWLQ.js} +2 -2
- package/dist/{chunk-6DPSWLGY.js → chunk-ZRP7Y2DM.js} +3 -7
- package/dist/chunk-ZRP7Y2DM.js.map +1 -0
- package/dist/cli.js +15 -14
- package/dist/cli.js.map +1 -1
- package/dist/{companies-NVQJ5EBX.js → companies-KMMV6EJW.js} +3 -3
- package/dist/{config-55WGRLY3.js → config-SMVIY6RW.js} +3 -3
- package/dist/{conversation-A3ROPGFG.js → conversation-KHTZBGX2.js} +3 -3
- package/dist/{conversion-report-BN4Q27MI.js → conversion-report-U66HW6JM.js} +3 -3
- package/dist/{conversion-upload-command-S4DGGI7K.js → conversion-upload-command-IHFKVX2M.js} +3 -3
- package/dist/{conversion-writes-IZ7WLCYM.js → conversion-writes-RSGDOAET.js} +4 -4
- package/dist/{conversions-RFJM3YRJ.js → conversions-BVOL43W4.js} +6 -6
- package/dist/{conversions-YFIVZRLB.js → conversions-SUMZAV2T.js} +8 -8
- package/dist/{copy-writes-E3V5TUVU.js → copy-writes-CIHIFLY6.js} +5 -5
- package/dist/{create-HXGBZAOM.js → create-UL2OYXOA.js} +3 -3
- package/dist/{creatives-DUR5Z5AN.js → creatives-BB6S2OF6.js} +6 -6
- package/dist/{creatives-6XGPDWCK.js → creatives-FU3YELGU.js} +9 -9
- package/dist/{crm-MFI4NZA3.js → crm-MQQRBITZ.js} +2 -2
- package/dist/{currency-5ED5P4JQ.js → currency-CGKO5GKH.js} +3 -3
- package/dist/{custom-conversions-OIA5Y2GX.js → custom-conversions-HAGG72LF.js} +6 -6
- package/dist/{delete-CUFKAGJF.js → delete-UIKB5ZXS.js} +3 -3
- package/dist/{demographics-JHKN3EOT.js → demographics-ABZODD45.js} +3 -3
- package/dist/{discover-BSQ35XIS.js → discover-VM3O7CQM.js} +2 -2
- package/dist/{draft-6XYWFCIO.js → draft-5UUJC675.js} +4 -4
- package/dist/{draft-KB6WX63J.js → draft-BATA5CVI.js} +4 -4
- package/dist/{draft-EK5PKBUR.js → draft-CRDBU6LF.js} +3 -3
- package/dist/{draft-MJRMZGMP.js → draft-DJIYEMZU.js} +3 -3
- package/dist/{draft-ZRFZJ7Z3.js → draft-P7IDMXWR.js} +4 -4
- package/dist/{draft-2ZX73IRO.js → draft-RIR2V6A2.js} +3 -3
- package/dist/{draft-L5Q6KEER.js → draft-ZCL7FVBH.js} +3 -3
- package/dist/{experiment-3VRHCQN5.js → experiment-I5CRLOVN.js} +2 -2
- package/dist/{experiments-WOZFSKVI.js → experiments-MLLTHMMS.js} +4 -4
- package/dist/{facets-2YXLHG4K.js → facets-KSHR3MBE.js} +3 -3
- package/dist/{forecast-EX5IXM7C.js → forecast-HT46MFL4.js} +3 -3
- package/dist/{forecast-3NKGNWV3.js → forecast-ONVS2QAI.js} +4 -4
- package/dist/{funding-TCEPQXRQ.js → funding-5W4LX6DU.js} +3 -3
- package/dist/{funnel-AX43MHB7.js → funnel-76BAD64Q.js} +2 -2
- package/dist/{ga4-JE3HS36B.js → ga4-BWVCDVIR.js} +15 -15
- package/dist/{get-2RITKOGH.js → get-4KFAO475.js} +3 -3
- package/dist/{google-6KIKJCY7.js → google-7EZP7I6J.js} +22 -22
- package/dist/{gsc-RMVOYIM3.js → gsc-2MPE4N32.js} +4 -4
- package/dist/{history-VDZEOXQ4.js → history-FEBJHFHJ.js} +4 -4
- package/dist/{history-KUC4KEYO.js → history-RDVV7KBN.js} +3 -3
- package/dist/{hubspot-FEKXKUAR.js → hubspot-A3RQNMYN.js} +3 -3
- package/dist/{insights-UJGQ6WCQ.js → insights-UTCMSWSC.js} +3 -3
- package/dist/{insights-HATH3IC6.js → insights-XZL2EM53.js} +3 -3
- package/dist/{instant-experiences-A2SIQNB5.js → instant-experiences-RM4MLJTL.js} +4 -4
- package/dist/{job-SM2OQ2LO.js → job-DRFCQ27M.js} +3 -3
- package/dist/{job-create-ECZHPVKH.js → job-create-2EC25Y3J.js} +3 -3
- package/dist/{job-status-QSYDKIIV.js → job-status-UNVZRPIA.js} +3 -3
- package/dist/{languages-2JLPFE6B.js → languages-DIQ3OG3E.js} +2 -2
- package/dist/lead-routes-57PUNPAS.js +698 -0
- package/dist/lead-routes-57PUNPAS.js.map +1 -0
- package/dist/{leads-57S7XBRP.js → leads-LAATTW5G.js} +3 -3
- package/dist/{leads-QAYS7AJO.js → leads-ULYHTG22.js} +4 -4
- package/dist/{line-item-writes-ONK72SG7.js → line-item-writes-XJTTA3X5.js} +4 -4
- package/dist/{line-items-L4HQHJP3.js → line-items-JR25T2C5.js} +8 -8
- package/dist/{linkedin-YEAXKAG6.js → linkedin-W5BJ6HEH.js} +30 -30
- package/dist/{list-KHWFCIBV.js → list-3653DIYB.js} +3 -3
- package/dist/{locations-FB5RGOA4.js → locations-HTVYJSDJ.js} +2 -2
- package/dist/{locations-ZVEU3XNW.js → locations-M2B5XDU4.js} +3 -3
- package/dist/{lookup-MELV3RUL.js → lookup-S5VG7AWH.js} +3 -3
- package/dist/{mcp-6T4PEZ5R.js → mcp-TFQTME4P.js} +3 -15
- package/dist/mcp-TFQTME4P.js.map +1 -0
- package/dist/{media-EEWZZU3P.js → media-P4T4ZBNS.js} +3 -3
- package/dist/{media-BPI2VE6A.js → media-XCTZJIW4.js} +3 -3
- package/dist/{meta-SMJUQP37.js → meta-IPLWNYC7.js} +38 -38
- package/dist/{metrics-S45EIREU.js → metrics-WYWUX6Y5.js} +2 -2
- package/dist/{output-4QBQEM4C.js → output-WTEPRUPE.js} +2 -2
- package/dist/{page-photos-HRKPDQBM.js → page-photos-OQ5QATQH.js} +4 -4
- package/dist/{pages-DTQWQUKP.js → pages-J6AF5NDU.js} +3 -3
- package/dist/{pixels-ISHV4JZD.js → pixels-THEGYRXT.js} +4 -4
- package/dist/{pixels-2BKADWE6.js → pixels-ZZTB6NWF.js} +3 -3
- package/dist/{plan-A6VC3ZO7.js → plan-7UF76Q6U.js} +3 -3
- package/dist/{preview-GGIGXPJW.js → preview-LRJOQ7LM.js} +3 -3
- package/dist/{promoted-tweet-writes-WDSUBZ6D.js → promoted-tweet-writes-SBXWKO23.js} +4 -4
- package/dist/{promoted-tweets-UFWAFTKD.js → promoted-tweets-W42FNWS7.js} +5 -5
- package/dist/{properties-VWKO3AAK.js → properties-RBLJCVSG.js} +3 -3
- package/dist/{query-RBZFAIDK.js → query-BJJYUGQZ.js} +3 -3
- package/dist/{query-EG7R6MIA.js → query-IQICLABN.js} +4 -4
- package/dist/{query-OOP63DJF.js → query-KQ675KJZ.js} +3 -3
- package/dist/{questionnaire-7SHYRTMJ.js → questionnaire-DWEH5II4.js} +2 -2
- package/dist/{read-GOULD7YL.js → read-QME7JYVF.js} +4 -4
- package/dist/{resolve-5IWZBGO2.js → resolve-KRKIJKT7.js} +3 -3
- package/dist/{revenue-E5RDAGBU.js → revenue-UBZUTSXN.js} +4 -4
- package/dist/{rule-writes-K4P3XBJW.js → rule-writes-UAVWT4XS.js} +4 -4
- package/dist/{rules-HY7S2YTD.js → rules-ZVS2MWED.js} +9 -9
- package/dist/{run-GQEZCRPX.js → run-K2DOMOAN.js} +3 -3
- package/dist/{scheduled-agents-3J3B5O3T.js → scheduled-agents-ZGCUZ6SB.js} +11 -11
- package/dist/{schema-6Y3IXFDC.js → schema-D6BMZAPB.js} +2 -2
- package/dist/{sends-WBYTALR7.js → sends-LAY5C74B.js} +2 -2
- package/dist/{shared-CGEJI2RB.js → shared-ZFULUOPQ.js} +3 -3
- package/dist/{shopify-SL7L364P.js → shopify-LXSR37XI.js} +3 -3
- package/dist/{sitemaps-5SP7PVQ6.js → sitemaps-F3HYH5ZP.js} +3 -3
- package/dist/{sites-YZDPHBST.js → sites-JSMF72BY.js} +3 -3
- package/dist/{sources-SRV7RSHI.js → sources-AOF2YDYX.js} +2 -2
- package/dist/{stats-EGGNFTKI.js → stats-QP4LFQZJ.js} +5 -5
- package/dist/{studies-6VUUOMZD.js → studies-EPO2AM4M.js} +7 -7
- package/dist/{study-writes-IR7RSSTK.js → study-writes-7FP443QQ.js} +4 -4
- package/dist/{sync-SCM6JGJP.js → sync-PHH65JFS.js} +3 -3
- package/dist/{tag-manager-REKD4WGU.js → tag-manager-F7PVTDBB.js} +9 -9
- package/dist/{targeting-BQUD54MF.js → targeting-NKZFEZD7.js} +4 -4
- package/dist/{targeting-constants-MRQB4N5I.js → targeting-constants-236ES5HE.js} +3 -3
- package/dist/{targeting-criteria-3RSGL4PU.js → targeting-criteria-AU5CSMAU.js} +5 -5
- package/dist/{targets-EQ6PS7BY.js → targets-IOIH5JYS.js} +3 -3
- package/dist/{terms-D2KAFHKJ.js → terms-O6ODXEOK.js} +2 -2
- package/dist/{themes-IAJPT5Y7.js → themes-PGPIAKAO.js} +4 -4
- package/dist/{top-companies-P33JBCQI.js → top-companies-FSITN3ZR.js} +3 -3
- package/dist/{triggers-J42TLW7M.js → triggers-MONMZSKT.js} +3 -3
- package/dist/{tweets-JN6ARKF6.js → tweets-IUINLOXF.js} +3 -3
- package/dist/{unstage-F73JVWEC.js → unstage-JXG5AU5Q.js} +3 -3
- package/dist/{unstage-5C27F2LZ.js → unstage-ZA3WQBEA.js} +2 -2
- package/dist/{update-G7QXDY74.js → update-RZSV4NYP.js} +3 -3
- package/dist/{url-options-VI76IGTY.js → url-options-63DED6CR.js} +3 -3
- package/dist/{url-params-4H2EZWWH.js → url-params-TRFI2PMD.js} +3 -3
- package/dist/{write-commands-GNNEUVDW.js → write-commands-5J47ZNO4.js} +3 -3
- package/dist/{write-commands-KWO3X6OW.js → write-commands-NVCX7IAU.js} +4 -4
- package/dist/{write-commands-NXJQQ62W.js → write-commands-OGVDWWBV.js} +10 -10
- package/dist/{write-commands-B25W4FP5.js → write-commands-OTWH6BKZ.js} +3 -3
- package/dist/{x-4GPADHQR.js → x-ZQNHYIDU.js} +15 -15
- package/package.json +1 -1
- package/dist/chunk-6DPSWLGY.js.map +0 -1
- package/dist/chunk-ASRS37QE.js.map +0 -1
- package/dist/mcp-6T4PEZ5R.js.map +0 -1
- /package/dist/{account-PISI6UMC.js.map → account-QX4G4BJ7.js.map} +0 -0
- /package/dist/{account-JNBDG6PB.js.map → account-UFYZS3K6.js.map} +0 -0
- /package/dist/{account-BA3IO3AN.js.map → account-ZY655BIU.js.map} +0 -0
- /package/dist/{account-assets-T3VVNBUG.js.map → account-assets-J5Z4URLQ.js.map} +0 -0
- /package/dist/{account-level-MPFWRPEK.js.map → account-level-4SBYYHRS.js.map} +0 -0
- /package/dist/{account-reads-ATFFFKV4.js.map → account-reads-FOEVPWDP.js.map} +0 -0
- /package/dist/{account-users-FBA7PDBK.js.map → account-users-UTIF7MIT.js.map} +0 -0
- /package/dist/{account-writes-R5T3F5QT.js.map → account-writes-QAQXRIEY.js.map} +0 -0
- /package/dist/{accounts-4R3MBNJG.js.map → accounts-FT2SRKMD.js.map} +0 -0
- /package/dist/{accounts-JNVS3HEX.js.map → accounts-JK3OAS5U.js.map} +0 -0
- /package/dist/{accounts-VPWCLF6X.js.map → accounts-K5XLEO6W.js.map} +0 -0
- /package/dist/{accounts-KELFJVQM.js.map → accounts-OE33CKWD.js.map} +0 -0
- /package/dist/{accounts-5WF7VE7J.js.map → accounts-SNB65ZEW.js.map} +0 -0
- /package/dist/{active-entities-WDPW7652.js.map → active-entities-3BAPHE4P.js.map} +0 -0
- /package/dist/{activities-WGPHYSFU.js.map → activities-LKLPORDI.js.map} +0 -0
- /package/dist/{ad-group-writes-4OCFZI33.js.map → ad-group-writes-XY5JYTKT.js.map} +0 -0
- /package/dist/{ad-groups-7NE3A255.js.map → ad-groups-YEO5ZS5U.js.map} +0 -0
- /package/dist/{ad-writes-FWUMC6AE.js.map → ad-writes-XRCPK4SP.js.map} +0 -0
- /package/dist/{ads-MUFH7FLP.js.map → ads-AYJAYLFR.js.map} +0 -0
- /package/dist/{ads-ITEUGEUV.js.map → ads-H7H7H2CM.js.map} +0 -0
- /package/dist/{ads-F7AUJWK7.js.map → ads-MAOI7S6V.js.map} +0 -0
- /package/dist/{adsets-XH2ULWPM.js.map → adsets-QRKICEFD.js.map} +0 -0
- /package/dist/{analytics-ZFWZ5YD5.js.map → analytics-ADIWEM6G.js.map} +0 -0
- /package/dist/{analytics-TPI27PJL.js.map → analytics-XB6FRNVJ.js.map} +0 -0
- /package/dist/{asset-writes-4X3AJQ4Q.js.map → asset-writes-JLVUAVUZ.js.map} +0 -0
- /package/dist/{audience-size-4JPP222L.js.map → audience-size-P5L6MZ4C.js.map} +0 -0
- /package/dist/{audience-writes-TXWPDJ2F.js.map → audience-writes-CDKQB3SM.js.map} +0 -0
- /package/dist/{audiences-YUG5JLL4.js.map → audiences-34IQKOGS.js.map} +0 -0
- /package/dist/{audiences-MBBXWEOI.js.map → audiences-CDDI5HR5.js.map} +0 -0
- /package/dist/{audiences-5QFAMXWP.js.map → audiences-XKERWKKE.js.map} +0 -0
- /package/dist/{audit-WFXS5ELM.js.map → audit-7ED6CUTQ.js.map} +0 -0
- /package/dist/{audit-QQAM5QJ2.js.map → audit-SEADLC6F.js.map} +0 -0
- /package/dist/{bid-pricing-JKUFSCZG.js.map → bid-pricing-NWSUO3VM.js.map} +0 -0
- /package/dist/{businesses-24JNY46Z.js.map → businesses-MGP2YCEU.js.map} +0 -0
- /package/dist/{campaign-groups-QUEKAHHT.js.map → campaign-groups-PH64UXZJ.js.map} +0 -0
- /package/dist/{campaign-writes-GZ5MKJ63.js.map → campaign-writes-BN3EGDK5.js.map} +0 -0
- /package/dist/{campaign-writes-UO5P7OD7.js.map → campaign-writes-CLV5ZSUK.js.map} +0 -0
- /package/dist/{campaigns-7V7PYIHJ.js.map → campaigns-5XRY27JZ.js.map} +0 -0
- /package/dist/{campaigns-KXYGSH27.js.map → campaigns-HES5MDUG.js.map} +0 -0
- /package/dist/{campaigns-QNBBQTMU.js.map → campaigns-JF4TYYUP.js.map} +0 -0
- /package/dist/{campaigns-G24AEUCM.js.map → campaigns-ZYU4BXDP.js.map} +0 -0
- /package/dist/{cards-NSNAFTEB.js.map → cards-A7GQVC7B.js.map} +0 -0
- /package/dist/{catalogs-I4WWTCIZ.js.map → catalogs-6XLBWAUS.js.map} +0 -0
- /package/dist/{catalogs-VZYAATUR.js.map → catalogs-TGLSJEK5.js.map} +0 -0
- /package/dist/{changes-BPC2O52H.js.map → changes-OOUVQDBY.js.map} +0 -0
- /package/dist/{chatgpt-WFGSWJ5N.js.map → chatgpt-NAXIFWXV.js.map} +0 -0
- /package/dist/{chunk-KGYTIPS2.js.map → chunk-3G3GC5N4.js.map} +0 -0
- /package/dist/{chunk-LNODLR7W.js.map → chunk-3GAR4AZK.js.map} +0 -0
- /package/dist/{chunk-Z53DY5HT.js.map → chunk-3M45PYU7.js.map} +0 -0
- /package/dist/{chunk-DHVFI7AE.js.map → chunk-4LF4AYPT.js.map} +0 -0
- /package/dist/{chunk-Z35KUMBW.js.map → chunk-4UQRXKYJ.js.map} +0 -0
- /package/dist/{chunk-TYXZ2SRW.js.map → chunk-7BUIOP36.js.map} +0 -0
- /package/dist/{chunk-GX5333QH.js.map → chunk-7I6ZVBLM.js.map} +0 -0
- /package/dist/{chunk-IDSDJHRS.js.map → chunk-7NF73SCB.js.map} +0 -0
- /package/dist/{chunk-M7QZSEHF.js.map → chunk-B2POVFR2.js.map} +0 -0
- /package/dist/{chunk-VXWG4ZS2.js.map → chunk-BJOK7QD4.js.map} +0 -0
- /package/dist/{chunk-FCHZ5TNG.js.map → chunk-DM3Q6F5F.js.map} +0 -0
- /package/dist/{chunk-DN6ZZTQE.js.map → chunk-DMJUIUAL.js.map} +0 -0
- /package/dist/{chunk-C3IO4R4B.js.map → chunk-EW7JSTRZ.js.map} +0 -0
- /package/dist/{chunk-HHVWV5BJ.js.map → chunk-GU5MXV2Y.js.map} +0 -0
- /package/dist/{chunk-I3WGTSDY.js.map → chunk-HGUYC5K6.js.map} +0 -0
- /package/dist/{chunk-HCQJYI6X.js.map → chunk-HMIROUFV.js.map} +0 -0
- /package/dist/{chunk-SBNBYRGZ.js.map → chunk-K7IE6UYV.js.map} +0 -0
- /package/dist/{chunk-2F4DELSV.js.map → chunk-KUY26RCF.js.map} +0 -0
- /package/dist/{chunk-VPABGAN4.js.map → chunk-NWF2LRKO.js.map} +0 -0
- /package/dist/{chunk-ILPHIYAL.js.map → chunk-QDQZ62FL.js.map} +0 -0
- /package/dist/{chunk-TU5LQUJM.js.map → chunk-RCJKABOS.js.map} +0 -0
- /package/dist/{chunk-IPO33JRU.js.map → chunk-TGPGQTZA.js.map} +0 -0
- /package/dist/{chunk-TU7DWSTW.js.map → chunk-TLQOMWLQ.js.map} +0 -0
- /package/dist/{companies-NVQJ5EBX.js.map → companies-KMMV6EJW.js.map} +0 -0
- /package/dist/{config-55WGRLY3.js.map → config-SMVIY6RW.js.map} +0 -0
- /package/dist/{conversation-A3ROPGFG.js.map → conversation-KHTZBGX2.js.map} +0 -0
- /package/dist/{conversion-report-BN4Q27MI.js.map → conversion-report-U66HW6JM.js.map} +0 -0
- /package/dist/{conversion-upload-command-S4DGGI7K.js.map → conversion-upload-command-IHFKVX2M.js.map} +0 -0
- /package/dist/{conversion-writes-IZ7WLCYM.js.map → conversion-writes-RSGDOAET.js.map} +0 -0
- /package/dist/{conversions-RFJM3YRJ.js.map → conversions-BVOL43W4.js.map} +0 -0
- /package/dist/{conversions-YFIVZRLB.js.map → conversions-SUMZAV2T.js.map} +0 -0
- /package/dist/{copy-writes-E3V5TUVU.js.map → copy-writes-CIHIFLY6.js.map} +0 -0
- /package/dist/{create-HXGBZAOM.js.map → create-UL2OYXOA.js.map} +0 -0
- /package/dist/{creatives-DUR5Z5AN.js.map → creatives-BB6S2OF6.js.map} +0 -0
- /package/dist/{creatives-6XGPDWCK.js.map → creatives-FU3YELGU.js.map} +0 -0
- /package/dist/{crm-MFI4NZA3.js.map → crm-MQQRBITZ.js.map} +0 -0
- /package/dist/{currency-5ED5P4JQ.js.map → currency-CGKO5GKH.js.map} +0 -0
- /package/dist/{custom-conversions-OIA5Y2GX.js.map → custom-conversions-HAGG72LF.js.map} +0 -0
- /package/dist/{delete-CUFKAGJF.js.map → delete-UIKB5ZXS.js.map} +0 -0
- /package/dist/{demographics-JHKN3EOT.js.map → demographics-ABZODD45.js.map} +0 -0
- /package/dist/{discover-BSQ35XIS.js.map → discover-VM3O7CQM.js.map} +0 -0
- /package/dist/{draft-6XYWFCIO.js.map → draft-5UUJC675.js.map} +0 -0
- /package/dist/{draft-KB6WX63J.js.map → draft-BATA5CVI.js.map} +0 -0
- /package/dist/{draft-EK5PKBUR.js.map → draft-CRDBU6LF.js.map} +0 -0
- /package/dist/{draft-MJRMZGMP.js.map → draft-DJIYEMZU.js.map} +0 -0
- /package/dist/{draft-ZRFZJ7Z3.js.map → draft-P7IDMXWR.js.map} +0 -0
- /package/dist/{draft-2ZX73IRO.js.map → draft-RIR2V6A2.js.map} +0 -0
- /package/dist/{draft-L5Q6KEER.js.map → draft-ZCL7FVBH.js.map} +0 -0
- /package/dist/{experiment-3VRHCQN5.js.map → experiment-I5CRLOVN.js.map} +0 -0
- /package/dist/{experiments-WOZFSKVI.js.map → experiments-MLLTHMMS.js.map} +0 -0
- /package/dist/{facets-2YXLHG4K.js.map → facets-KSHR3MBE.js.map} +0 -0
- /package/dist/{forecast-EX5IXM7C.js.map → forecast-HT46MFL4.js.map} +0 -0
- /package/dist/{forecast-3NKGNWV3.js.map → forecast-ONVS2QAI.js.map} +0 -0
- /package/dist/{funding-TCEPQXRQ.js.map → funding-5W4LX6DU.js.map} +0 -0
- /package/dist/{funnel-AX43MHB7.js.map → funnel-76BAD64Q.js.map} +0 -0
- /package/dist/{ga4-JE3HS36B.js.map → ga4-BWVCDVIR.js.map} +0 -0
- /package/dist/{get-2RITKOGH.js.map → get-4KFAO475.js.map} +0 -0
- /package/dist/{google-6KIKJCY7.js.map → google-7EZP7I6J.js.map} +0 -0
- /package/dist/{gsc-RMVOYIM3.js.map → gsc-2MPE4N32.js.map} +0 -0
- /package/dist/{history-VDZEOXQ4.js.map → history-FEBJHFHJ.js.map} +0 -0
- /package/dist/{history-KUC4KEYO.js.map → history-RDVV7KBN.js.map} +0 -0
- /package/dist/{hubspot-FEKXKUAR.js.map → hubspot-A3RQNMYN.js.map} +0 -0
- /package/dist/{insights-UJGQ6WCQ.js.map → insights-UTCMSWSC.js.map} +0 -0
- /package/dist/{insights-HATH3IC6.js.map → insights-XZL2EM53.js.map} +0 -0
- /package/dist/{instant-experiences-A2SIQNB5.js.map → instant-experiences-RM4MLJTL.js.map} +0 -0
- /package/dist/{job-SM2OQ2LO.js.map → job-DRFCQ27M.js.map} +0 -0
- /package/dist/{job-create-ECZHPVKH.js.map → job-create-2EC25Y3J.js.map} +0 -0
- /package/dist/{job-status-QSYDKIIV.js.map → job-status-UNVZRPIA.js.map} +0 -0
- /package/dist/{languages-2JLPFE6B.js.map → languages-DIQ3OG3E.js.map} +0 -0
- /package/dist/{leads-57S7XBRP.js.map → leads-LAATTW5G.js.map} +0 -0
- /package/dist/{leads-QAYS7AJO.js.map → leads-ULYHTG22.js.map} +0 -0
- /package/dist/{line-item-writes-ONK72SG7.js.map → line-item-writes-XJTTA3X5.js.map} +0 -0
- /package/dist/{line-items-L4HQHJP3.js.map → line-items-JR25T2C5.js.map} +0 -0
- /package/dist/{linkedin-YEAXKAG6.js.map → linkedin-W5BJ6HEH.js.map} +0 -0
- /package/dist/{list-KHWFCIBV.js.map → list-3653DIYB.js.map} +0 -0
- /package/dist/{locations-FB5RGOA4.js.map → locations-HTVYJSDJ.js.map} +0 -0
- /package/dist/{locations-ZVEU3XNW.js.map → locations-M2B5XDU4.js.map} +0 -0
- /package/dist/{lookup-MELV3RUL.js.map → lookup-S5VG7AWH.js.map} +0 -0
- /package/dist/{media-EEWZZU3P.js.map → media-P4T4ZBNS.js.map} +0 -0
- /package/dist/{media-BPI2VE6A.js.map → media-XCTZJIW4.js.map} +0 -0
- /package/dist/{meta-SMJUQP37.js.map → meta-IPLWNYC7.js.map} +0 -0
- /package/dist/{metrics-S45EIREU.js.map → metrics-WYWUX6Y5.js.map} +0 -0
- /package/dist/{output-4QBQEM4C.js.map → output-WTEPRUPE.js.map} +0 -0
- /package/dist/{page-photos-HRKPDQBM.js.map → page-photos-OQ5QATQH.js.map} +0 -0
- /package/dist/{pages-DTQWQUKP.js.map → pages-J6AF5NDU.js.map} +0 -0
- /package/dist/{pixels-ISHV4JZD.js.map → pixels-THEGYRXT.js.map} +0 -0
- /package/dist/{pixels-2BKADWE6.js.map → pixels-ZZTB6NWF.js.map} +0 -0
- /package/dist/{plan-A6VC3ZO7.js.map → plan-7UF76Q6U.js.map} +0 -0
- /package/dist/{preview-GGIGXPJW.js.map → preview-LRJOQ7LM.js.map} +0 -0
- /package/dist/{promoted-tweet-writes-WDSUBZ6D.js.map → promoted-tweet-writes-SBXWKO23.js.map} +0 -0
- /package/dist/{promoted-tweets-UFWAFTKD.js.map → promoted-tweets-W42FNWS7.js.map} +0 -0
- /package/dist/{properties-VWKO3AAK.js.map → properties-RBLJCVSG.js.map} +0 -0
- /package/dist/{query-RBZFAIDK.js.map → query-BJJYUGQZ.js.map} +0 -0
- /package/dist/{query-EG7R6MIA.js.map → query-IQICLABN.js.map} +0 -0
- /package/dist/{query-OOP63DJF.js.map → query-KQ675KJZ.js.map} +0 -0
- /package/dist/{questionnaire-7SHYRTMJ.js.map → questionnaire-DWEH5II4.js.map} +0 -0
- /package/dist/{read-GOULD7YL.js.map → read-QME7JYVF.js.map} +0 -0
- /package/dist/{resolve-5IWZBGO2.js.map → resolve-KRKIJKT7.js.map} +0 -0
- /package/dist/{revenue-E5RDAGBU.js.map → revenue-UBZUTSXN.js.map} +0 -0
- /package/dist/{rule-writes-K4P3XBJW.js.map → rule-writes-UAVWT4XS.js.map} +0 -0
- /package/dist/{rules-HY7S2YTD.js.map → rules-ZVS2MWED.js.map} +0 -0
- /package/dist/{run-GQEZCRPX.js.map → run-K2DOMOAN.js.map} +0 -0
- /package/dist/{scheduled-agents-3J3B5O3T.js.map → scheduled-agents-ZGCUZ6SB.js.map} +0 -0
- /package/dist/{schema-6Y3IXFDC.js.map → schema-D6BMZAPB.js.map} +0 -0
- /package/dist/{sends-WBYTALR7.js.map → sends-LAY5C74B.js.map} +0 -0
- /package/dist/{shared-CGEJI2RB.js.map → shared-ZFULUOPQ.js.map} +0 -0
- /package/dist/{shopify-SL7L364P.js.map → shopify-LXSR37XI.js.map} +0 -0
- /package/dist/{sitemaps-5SP7PVQ6.js.map → sitemaps-F3HYH5ZP.js.map} +0 -0
- /package/dist/{sites-YZDPHBST.js.map → sites-JSMF72BY.js.map} +0 -0
- /package/dist/{sources-SRV7RSHI.js.map → sources-AOF2YDYX.js.map} +0 -0
- /package/dist/{stats-EGGNFTKI.js.map → stats-QP4LFQZJ.js.map} +0 -0
- /package/dist/{studies-6VUUOMZD.js.map → studies-EPO2AM4M.js.map} +0 -0
- /package/dist/{study-writes-IR7RSSTK.js.map → study-writes-7FP443QQ.js.map} +0 -0
- /package/dist/{sync-SCM6JGJP.js.map → sync-PHH65JFS.js.map} +0 -0
- /package/dist/{tag-manager-REKD4WGU.js.map → tag-manager-F7PVTDBB.js.map} +0 -0
- /package/dist/{targeting-BQUD54MF.js.map → targeting-NKZFEZD7.js.map} +0 -0
- /package/dist/{targeting-constants-MRQB4N5I.js.map → targeting-constants-236ES5HE.js.map} +0 -0
- /package/dist/{targeting-criteria-3RSGL4PU.js.map → targeting-criteria-AU5CSMAU.js.map} +0 -0
- /package/dist/{targets-EQ6PS7BY.js.map → targets-IOIH5JYS.js.map} +0 -0
- /package/dist/{terms-D2KAFHKJ.js.map → terms-O6ODXEOK.js.map} +0 -0
- /package/dist/{themes-IAJPT5Y7.js.map → themes-PGPIAKAO.js.map} +0 -0
- /package/dist/{top-companies-P33JBCQI.js.map → top-companies-FSITN3ZR.js.map} +0 -0
- /package/dist/{triggers-J42TLW7M.js.map → triggers-MONMZSKT.js.map} +0 -0
- /package/dist/{tweets-JN6ARKF6.js.map → tweets-IUINLOXF.js.map} +0 -0
- /package/dist/{unstage-F73JVWEC.js.map → unstage-JXG5AU5Q.js.map} +0 -0
- /package/dist/{unstage-5C27F2LZ.js.map → unstage-ZA3WQBEA.js.map} +0 -0
- /package/dist/{update-G7QXDY74.js.map → update-RZSV4NYP.js.map} +0 -0
- /package/dist/{url-options-VI76IGTY.js.map → url-options-63DED6CR.js.map} +0 -0
- /package/dist/{url-params-4H2EZWWH.js.map → url-params-TRFI2PMD.js.map} +0 -0
- /package/dist/{write-commands-GNNEUVDW.js.map → write-commands-5J47ZNO4.js.map} +0 -0
- /package/dist/{write-commands-KWO3X6OW.js.map → write-commands-NVCX7IAU.js.map} +0 -0
- /package/dist/{write-commands-NXJQQ62W.js.map → write-commands-OGVDWWBV.js.map} +0 -0
- /package/dist/{write-commands-B25W4FP5.js.map → write-commands-OTWH6BKZ.js.map} +0 -0
- /package/dist/{x-4GPADHQR.js.map → x-ZQNHYIDU.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../api/src/lead-routes.ts","../src/commands/lead-routes/index.ts","../src/commands/lead-routes/args.ts"],"sourcesContent":["import { z } from \"zod\";\n\n/**\n * `/api/lead-routes/*` — the `baker lead-routes` contract the CLI and the\n * backend share.\n *\n * A lead route sends every lead one ad platform's lead form collects (a Meta\n * Instant Form, a LinkedIn Lead Gen Form, a Google lead form) to one of the\n * places a website Form can send to: a Google Sheet, a HubSpot form, a webhook,\n * Zapier, an email, Pipedrive, GoHighLevel, ActiveCampaign. Delivery goes\n * through the same door a Form's side effect takes, so a destination is sealed\n * and mapped exactly the way a Form's is.\n *\n * Staged in a chat and applied at Publish: a route sends real people's details\n * to an outside system from the moment it is live.\n */\n\nexport const LEAD_ROUTE_PLATFORMS = [\"meta\", \"linkedin\", \"google\"] as const;\nexport const leadRoutePlatformSchema = z.enum(LEAD_ROUTE_PLATFORMS);\nexport type LeadRoutePlatform = z.infer<typeof leadRoutePlatformSchema>;\n\nexport const LEAD_ROUTE_PLATFORM_LABEL: Record<LeadRoutePlatform, string> = {\n meta: \"Meta\",\n linkedin: \"LinkedIn\",\n google: \"Google Ads\",\n};\n\n/** Where a route can send. A Form's delivery types, less Crmble, whose token only the dashboard's card may hold. */\nexport const LEAD_ROUTE_DESTINATION_TYPES = [\n \"googleSpreadsheet\",\n \"hubspotForm\",\n \"httpWebhook\",\n \"zapier\",\n \"email\",\n \"pipedrive\",\n \"goHighlevelContact\",\n \"activeCampaignContact\",\n] as const;\nexport const leadRouteDestinationTypeSchema = z.enum(LEAD_ROUTE_DESTINATION_TYPES);\nexport type LeadRouteDestinationType = z.infer<typeof leadRouteDestinationTypeSchema>;\n\nexport const LEAD_ROUTE_DESTINATION_LABEL: Record<LeadRouteDestinationType, string> = {\n googleSpreadsheet: \"Google Sheets\",\n hubspotForm: \"HubSpot\",\n httpWebhook: \"Webhook\",\n zapier: \"Zapier\",\n email: \"Email\",\n pipedrive: \"Pipedrive\",\n goHighlevelContact: \"GoHighLevel\",\n activeCampaignContact: \"ActiveCampaign\",\n};\n\n/**\n * What a lead knows about the person, under one name whatever the platform\n * called the question. A platform's own predefined question (Meta's `EMAIL`,\n * LinkedIn's `EMAIL`, Google's `EMAIL`) lands here; a question the client\n * worded themselves stays an answer.\n */\nexport const LEAD_CONTACT_FIELDS = [\n \"email\",\n \"phone\",\n \"first_name\",\n \"last_name\",\n \"full_name\",\n \"company\",\n \"job_title\",\n \"city\",\n \"state\",\n \"zip\",\n \"country\",\n \"street_address\",\n \"work_email\",\n \"work_phone\",\n] as const;\nexport type LeadContactField = (typeof LEAD_CONTACT_FIELDS)[number];\n\n/** Where the lead came from: the form, the ad that opened it, when. */\nexport const LEAD_CONTEXT_FIELDS = [\n \"platform\",\n \"lead_id\",\n \"submitted_at\",\n \"form_id\",\n \"form_name\",\n \"campaign_id\",\n \"campaign_name\",\n \"ad_set_id\",\n \"ad_set_name\",\n \"ad_id\",\n \"ad_name\",\n \"is_test\",\n \"gclid\",\n] as const;\nexport type LeadContextField = (typeof LEAD_CONTEXT_FIELDS)[number];\n\n/** Every answer as `Question: answer` lines, and every consent as `Consent: yes|no`. */\nexport const LEAD_SUMMARY_FIELDS = [\"answers\", \"consents\"] as const;\n\nexport const LEAD_ANSWER_PREFIX = \"answer:\";\nexport const LEAD_TEXT_PREFIX = \"text:\";\n\n/**\n * Whether `from` names something a lead can fill: a contact or context field,\n * the answers or consents summary, one answer (`answer:<question key>`), or\n * fixed text (`text:<words>`). Pure.\n */\nexport function isLeadPath(from: string): boolean {\n if (from.startsWith(LEAD_ANSWER_PREFIX)) return from.length > LEAD_ANSWER_PREFIX.length;\n if (from.startsWith(LEAD_TEXT_PREFIX)) return true;\n return (\n (LEAD_CONTACT_FIELDS as readonly string[]).includes(from) ||\n (LEAD_CONTEXT_FIELDS as readonly string[]).includes(from) ||\n (LEAD_SUMMARY_FIELDS as readonly string[]).includes(from)\n );\n}\n\n/**\n * One value the destination receives. `key` is the destination's own name for\n * it, in the format a Form's mapping uses for the same destination: a column\n * letter for a sheet (`A`), a HubSpot field (`email`, `0-1.string.firstname`),\n * a dotted path for a webhook (`contact.email`), an ActiveCampaign field\n * (`standard.email`), a Pipedrive or GoHighLevel field\n * (`person.text.false.email`).\n */\nexport const leadRouteFieldSchema = z.object({\n key: z.string().trim().min(1),\n from: z\n .string()\n .trim()\n .min(1)\n .refine(isLeadPath, { message: \"not something a lead carries — see `baker lead-routes fields`\" }),\n});\nexport type LeadRouteField = z.infer<typeof leadRouteFieldSchema>;\n\n/** How the agent names the destination; the backend seals it the way `baker flows connect` does. */\nexport const leadRouteDestinationInputSchema = z.discriminatedUnion(\"type\", [\n z.object({\n type: z.literal(\"googleSpreadsheet\"),\n account: z.string().optional(),\n /** An existing spreadsheet id (from `baker flows options googleSpreadsheet`). */\n resourceId: z.string().optional(),\n tab: z.string().optional(),\n /** Create a spreadsheet for these leads instead, headed with the route's columns. */\n newSheet: z.object({ title: z.string().trim().min(1) }).optional(),\n }),\n /** A HubSpot form by id (`baker hubspot forms list`): the lead is submitted to it as a contact. */\n z.object({ type: z.literal(\"hubspotForm\"), formId: z.string().trim().min(1) }),\n /** A webhook with no credential in its headers. */\n z.object({ type: z.literal(\"httpWebhook\"), url: z.string().trim().url() }),\n /** A Zapier \"Catch Hook\" address. */\n z.object({ type: z.literal(\"zapier\"), url: z.string().trim().url() }),\n /** A notification email to the team: one or more addresses, comma-separated. */\n z.object({ type: z.literal(\"email\"), email: z.string().trim().min(1), subject: z.string().trim().min(1).optional() }),\n z.object({ type: z.literal(\"pipedrive\"), account: z.string().optional() }),\n z.object({ type: z.literal(\"goHighlevelContact\"), account: z.string().optional() }),\n z.object({ type: z.literal(\"activeCampaignContact\"), account: z.string().optional() }),\n]);\nexport type LeadRouteDestinationInput = z.infer<typeof leadRouteDestinationInputSchema>;\n\n/** The farthest back a new route may start: platforms keep leads for 90 days, and a re-send of months is a flood. */\nexport const LEAD_ROUTE_MAX_BACKFILL_DAYS = 30;\n\n/** How many routes one company may have, live and staged together. */\nexport const MAX_LEAD_ROUTES = 50;\n\n// --- stage (`baker lead-routes set` / `remove`) ---\n\nexport const leadRouteSetSchema = z.object({\n /** Change this live or staged route instead of adding one. */\n id: z.string().trim().min(1).optional(),\n name: z.string().trim().min(1).max(120).optional(),\n platform: leadRoutePlatformSchema,\n /** LinkedIn: the ad account. Google: the customer id. Meta: not needed — a form id is the Page's. */\n account: z.string().trim().min(1).optional(),\n formId: z.string().trim().min(1),\n destination: leadRouteDestinationInputSchema,\n /** Omitted: the destination's own defaults (see `baker lead-routes fields`). */\n fields: z.array(leadRouteFieldSchema).max(100).optional(),\n /** Also send the leads submitted since this day (YYYY-MM-DD), at most 30 days back. Default: only new leads. */\n since: z\n .string()\n .regex(/^\\d{4}-\\d{2}-\\d{2}$/, \"a date like 2026-10-01\")\n .optional(),\n});\nexport type LeadRouteSet = z.infer<typeof leadRouteSetSchema>;\n\n/** `set --id` without `--to`: change a route's mapping, start or name, keeping its form and destination. */\nexport const leadRouteAmendSchema = z.object({\n id: z.string().trim().min(1),\n name: z.string().trim().min(1).max(120).optional(),\n /** Replaces the whole mapping. */\n fields: z.array(leadRouteFieldSchema).max(100).optional(),\n /** Laid over the existing mapping by key: a new key is added, a known one replaced. */\n addFields: z.array(leadRouteFieldSchema).max(100).optional(),\n since: z\n .string()\n .regex(/^\\d{4}-\\d{2}-\\d{2}$/, \"a date like 2026-10-01\")\n .optional(),\n});\nexport type LeadRouteAmend = z.infer<typeof leadRouteAmendSchema>;\n\nexport const leadRouteStageRequestSchema = z.object({\n chatId: z.string().min(1),\n set: leadRouteSetSchema.optional(),\n amend: leadRouteAmendSchema.optional(),\n /** Stop these live routes at Publish. */\n remove: z.array(z.string().trim().min(1)).max(MAX_LEAD_ROUTES).optional(),\n});\nexport type LeadRouteStageRequest = z.infer<typeof leadRouteStageRequestSchema>;\n\n/** A destination as anyone may read it: its kind and what it points at, never its credentials. */\nexport const leadRouteDestinationViewSchema = z.object({\n type: leadRouteDestinationTypeSchema,\n label: z.string(),\n url: z.string().optional(),\n});\nexport type LeadRouteDestinationView = z.infer<typeof leadRouteDestinationViewSchema>;\n\nexport const LEAD_ROUTE_STATUSES = [\"active\", \"paused\"] as const;\n\nexport const leadRouteViewSchema = z.object({\n id: z.string(),\n name: z.string(),\n platform: leadRoutePlatformSchema,\n account: z.string().optional(),\n formId: z.string(),\n formName: z.string().optional(),\n destination: leadRouteDestinationViewSchema,\n fields: z.array(z.object({ key: z.string(), from: z.string() })),\n status: z.enum(LEAD_ROUTE_STATUSES),\n /** Leads submitted from this moment on are delivered. 0 on a staged route: from the moment it is published. */\n startAt: z.number(),\n /** Only on a live route. */\n delivered: z.number().optional(),\n lastLeadAt: z.number().optional(),\n lastCheckedAt: z.number().optional(),\n /** Why the last check could not read or deliver, in words. Cleared by the next one that could. */\n lastError: z.string().optional(),\n});\nexport type LeadRouteView = z.infer<typeof leadRouteViewSchema>;\n\nexport const leadRouteStagedOpSchema = z.object({\n kind: z.enum([\"set\", \"remove\"]),\n routeId: z.string(),\n summary: z.string(),\n stagedAt: z.number(),\n route: leadRouteViewSchema.optional(),\n result: z.object({ status: z.enum([\"applied\", \"skipped\"]), reason: z.string().optional() }).optional(),\n});\nexport type LeadRouteStagedOp = z.infer<typeof leadRouteStagedOpSchema>;\n\nexport const leadRouteStageResponseSchema = z.object({\n ok: z.literal(true),\n data: z.object({ staged: z.array(leadRouteStagedOpSchema) }),\n hints: z.array(z.string()).optional(),\n});\nexport type LeadRouteStageResponse = z.infer<typeof leadRouteStageResponseSchema>;\n\n// --- list (`baker lead-routes`) ---\n\nexport const leadRouteListResponseSchema = z.object({\n ok: z.literal(true),\n data: z.object({ routes: z.array(leadRouteViewSchema), staged: z.array(leadRouteStagedOpSchema) }),\n hints: z.array(z.string()).optional(),\n});\nexport type LeadRouteListResponse = z.infer<typeof leadRouteListResponseSchema>;\n\n// --- unstage (`baker lead-routes unstage`) ---\n\nexport const leadRouteUnstageRequestSchema = z.object({\n chatId: z.string().min(1),\n /** Omitted: every staged route change on this chat. */\n routeId: z.string().optional(),\n});\nexport const leadRouteUnstageResponseSchema = z.object({\n ok: z.literal(true),\n data: z.object({ removed: z.number() }),\n});\nexport type LeadRouteUnstageResponse = z.infer<typeof leadRouteUnstageResponseSchema>;\n\n// --- fields (`baker lead-routes fields`) ---\n\nexport const leadRouteFieldsRequestSchema = z.object({\n platform: leadRoutePlatformSchema,\n account: z.string().optional(),\n formId: z.string().trim().min(1),\n});\nexport type LeadRouteFieldsRequest = z.infer<typeof leadRouteFieldsRequestSchema>;\n\n/** One question on the form, and the name a route's `from` uses for it. */\nexport const leadFormQuestionSchema = z.object({\n /** What `--field <key>=<from>` takes: a contact field, or `answer:<key>`. */\n from: z.string(),\n label: z.string(),\n});\n\nexport const leadRouteFieldsResponseSchema = z.object({\n ok: z.literal(true),\n data: z.object({\n platform: leadRoutePlatformSchema,\n formId: z.string(),\n formName: z.string().optional(),\n questions: z.array(leadFormQuestionSchema),\n /** Always available, whatever the form asks. */\n context: z.array(z.string()),\n }),\n hints: z.array(z.string()).optional(),\n});\nexport type LeadRouteFieldsResponse = z.infer<typeof leadRouteFieldsResponseSchema>;\n\n// --- preview (`baker lead-routes preview`) ---\n\nexport const leadRoutePreviewRequestSchema = z\n .object({\n /** A route staged on `chatId` or live: preview it exactly as it will send. */\n id: z.string().trim().min(1).optional(),\n chatId: z.string().optional(),\n platform: leadRoutePlatformSchema.optional(),\n account: z.string().optional(),\n formId: z.string().trim().min(1).optional(),\n destinationType: leadRouteDestinationTypeSchema.optional(),\n fields: z.array(leadRouteFieldSchema).max(100).optional(),\n /** How many of the latest leads to show. */\n limit: z.number().int().min(1).max(5).optional(),\n /** Show contact details unmasked. */\n full: z.boolean().optional(),\n })\n .refine((request) => request.id !== undefined || (request.platform && request.formId && request.destinationType), {\n message: \"Name a route (--id) or a form and a destination (--platform, --form, --to)\",\n });\nexport type LeadRoutePreviewRequest = z.infer<typeof leadRoutePreviewRequestSchema>;\n\nexport const leadRoutePreviewResponseSchema = z.object({\n ok: z.literal(true),\n data: z.object({\n fields: z.array(z.object({ key: z.string(), from: z.string() })),\n /** What the destination would have received for each of the latest leads, newest first. */\n samples: z.array(z.object({ leadId: z.string(), submittedAt: z.string(), sent: z.record(z.string(), z.string()) })),\n masked: z.boolean(),\n }),\n hints: z.array(z.string()).optional(),\n});\nexport type LeadRoutePreviewResponse = z.infer<typeof leadRoutePreviewResponseSchema>;\n","import {\n LEAD_ROUTE_DESTINATION_TYPES,\n type LeadRouteDestinationType,\n type LeadRouteFieldsRequest,\n type LeadRouteFieldsResponse,\n type LeadRouteListResponse,\n type LeadRoutePlatform,\n type LeadRoutePreviewRequest,\n type LeadRoutePreviewResponse,\n type LeadRouteStageRequest,\n type LeadRouteStageResponse,\n type LeadRouteUnstageResponse,\n} from \"@baker/api/lead-routes\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiGet, apiPost } from \"../../client.ts\";\nimport { optionalChatId, requireChatId } from \"../../env.ts\";\nimport { repeatedValues } from \"../../lib/repeatedFlags.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { LeadRouteArgsError, parseFields, parseStageArgs } from \"./args.ts\";\n\n/**\n * `baker lead-routes` — send the leads an ad platform's lead form collects (a\n * Meta Instant Form, a LinkedIn Lead Gen Form, a Google lead form) to the\n * places a website Form can send to. Every change stages on this chat and\n * applies when it is published; from then on each new lead is delivered within\n * a few minutes.\n */\n\nfunction fail(err: unknown): never {\n if (err instanceof LeadRouteArgsError) {\n writeJson({ ok: false, error: { code: \"VALIDATION_ERROR\", message: err.message } });\n } else if (err instanceof ApiError) {\n writeJson({ ok: false, error: { code: err.code, message: err.message } });\n } else {\n writeJson({\n ok: false,\n error: { code: \"INTERNAL_ERROR\", message: err instanceof Error ? err.message : \"Unexpected error\" },\n });\n }\n process.exit(1);\n}\n\nconst PLATFORM_ARG = { type: \"string\", description: \"meta | linkedin | google\", required: true } as const;\nconst ACCOUNT_ARG = {\n type: \"string\",\n description: \"LinkedIn ad account id, or Google Ads customer id. Not needed for Meta\",\n required: false,\n} as const;\nconst FORM_ARG = {\n type: \"string\",\n description: \"The lead form's id (`ads meta lead-forms`, `ads linkedin lead-forms`, a Google LEAD_FORM asset id)\",\n required: true,\n} as const;\nconst FIELD_ARG = {\n type: \"string\",\n description:\n \"Repeatable. <destination key>=<lead field>: C=email, firstname=first_name, notes=answer:budget, source=text:Meta lead ad\",\n required: false,\n} as const;\n\nregisterSchema({\n command: \"lead-routes.list\",\n description:\n \"Start here: every lead form whose leads Baker sends somewhere — the form, where they go, the fields sent, whether it is active or paused, how many were delivered, the last lead and the last problem — plus `staged`: what this chat changed. Read-only.\",\n args: {},\n});\n\nregisterSchema({\n command: \"lead-routes.fields\",\n description:\n \"What a lead form asks, by the names `--field` uses: a contact field (email, phone, first_name, company…) for the platform's own questions, answer:<key> for the client's own, plus the context every lead carries (campaign_name, ad_name, submitted_at, form_name, answers, consents…). Read-only.\",\n args: { platform: PLATFORM_ARG, account: ACCOUNT_ARG, form: FORM_ARG },\n});\n\nconst OPTIONAL_PLATFORM_ARG = {\n ...PLATFORM_ARG,\n description: \"meta | linkedin | google (not with --id)\",\n required: false,\n} as const;\nconst OPTIONAL_FORM_ARG = { ...FORM_ARG, description: \"The lead form's id (not with --id)\", required: false } as const;\nconst OPTIONAL_TO_ARG = {\n type: \"string\",\n description: `${LEAD_ROUTE_DESTINATION_TYPES.join(\" | \")} (not with --id)`,\n required: false,\n} as const;\nconst PREVIEW_ID_ARG = {\n type: \"string\",\n description:\n \"A route staged on this chat or live (r1): preview it exactly as it will send — its destination and fields\",\n required: false,\n} as const;\n\nregisterSchema({\n command: \"lead-routes.preview\",\n description:\n \"What a destination would receive for the form's latest leads, contact details masked unless --full. Reads the platform only; nothing is sent. After `set`, `--id <route>` shows exactly what the staged route will send (an existing sheet's or a HubSpot form's own defaults included); before it, --platform/--form/--to [--field] try a mapping.\",\n args: {\n id: PREVIEW_ID_ARG,\n platform: OPTIONAL_PLATFORM_ARG,\n account: ACCOUNT_ARG,\n form: OPTIONAL_FORM_ARG,\n to: OPTIONAL_TO_ARG,\n field: FIELD_ARG,\n limit: { type: \"string\", description: \"How many of the latest leads, 1-5 (default 1)\", required: false },\n full: { type: \"boolean\", description: \"Show contact details unmasked\", required: false },\n },\n});\n\nconst SET_PLATFORM_ARG = { ...PLATFORM_ARG, description: \"meta | linkedin | google\", required: false } as const;\nconst SET_FORM_ARG = { ...FORM_ARG, required: false } as const;\nconst SET_TO_ARG = {\n type: \"string\",\n description: `${LEAD_ROUTE_DESTINATION_TYPES.join(\" | \")}. Leave out with --id to keep the route's destination`,\n required: false,\n} as const;\nconst ADD_FIELD_ARG = {\n type: \"string\",\n description: \"Repeatable, with --id and no --to: add or replace one column of the route's mapping, M=answer:budget\",\n required: false,\n} as const;\n\nregisterSchema({\n command: \"lead-routes.set\",\n description:\n \"Stage a lead route: every new lead of one lead form goes to one destination, from when this chat is published. --to googleSpreadsheet (--sheet <id> | --new-sheet <title>, [--tab]), hubspotForm (--hubspot-form <id>), httpWebhook (--url, no credential), zapier (--url, a Catch Hook), email (--email, [--subject]), pipedrive | goHighlevelContact | activeCampaignContact (the connected account). Without --field the destination's defaults apply: a new sheet gets standard columns, an existing sheet its recognised headers, HubSpot the contact fields its form has, a webhook/Zapier/email the whole lead. --since YYYY-MM-DD also sends the leads since that day (at most 30 days back). --id changes an existing route: with --to and its destination flags, the whole route; without --to, only its mapping (--add-field M=answer:budget adds or replaces one column, --field replaces them all), --since or --name — its form and destination are kept.\",\n args: {\n platform: SET_PLATFORM_ARG,\n account: ACCOUNT_ARG,\n form: SET_FORM_ARG,\n to: SET_TO_ARG,\n sheet: {\n type: \"string\",\n description: \"Existing spreadsheet id (`baker flows options googleSpreadsheet`)\",\n required: false,\n },\n \"new-sheet\": { type: \"string\", description: \"Create a spreadsheet with this title for the leads\", required: false },\n tab: { type: \"string\", description: \"The sheet's tab to append to (default: the first)\", required: false },\n \"destination-account\": {\n type: \"string\",\n description:\n \"Which connected Google Drive / Pipedrive / GoHighLevel / ActiveCampaign account, when there are several\",\n required: false,\n },\n \"hubspot-form\": { type: \"string\", description: \"HubSpot form id (`baker hubspot forms list`)\", required: false },\n url: { type: \"string\", description: \"Webhook or Zapier hook address\", required: false },\n email: { type: \"string\", description: \"Who is emailed each lead, comma-separated\", required: false },\n subject: { type: \"string\", description: \"Email subject (default: New lead: <form>)\", required: false },\n field: FIELD_ARG,\n \"add-field\": ADD_FIELD_ARG,\n since: {\n type: \"string\",\n description: \"Also send leads since this day, YYYY-MM-DD, at most 30 days back\",\n required: false,\n },\n id: { type: \"string\", description: \"Change this route instead of adding one\", required: false },\n name: { type: \"string\", description: \"A name for the route\", required: false },\n },\n});\n\nregisterSchema({\n command: \"lead-routes.remove\",\n description:\n \"Stage stopping live lead routes, by id; they stop when this chat is published. A route staged in this same chat is simply taken back.\",\n args: { id: { type: \"string\", description: \"Route ids, comma-separated (r1,r2)\", required: true } },\n});\n\nregisterSchema({\n command: \"lead-routes.unstage\",\n description: \"Take back a lead route change this chat staged, before publish. --all takes back every one.\",\n args: {\n id: { type: \"string\", description: \"A routeId from `baker lead-routes list` → staged\", required: false },\n all: { type: \"boolean\", description: \"Take back every staged lead route change\", required: false },\n },\n});\n\nfunction asPlatform(value: unknown): LeadRoutePlatform {\n return value as LeadRoutePlatform;\n}\n\nconst listCommand = defineCommand({\n meta: {\n name: \"list\",\n description: \"Every lead route, live and staged in this chat.\\n\\nExample: baker lead-routes list\",\n },\n run: async () => {\n try {\n const chatId = optionalChatId();\n writeJson(await apiGet<LeadRouteListResponse>(\"/api/lead-routes\", chatId ? { chatId } : undefined));\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst fieldsCommand = defineCommand({\n meta: {\n name: \"fields\",\n description:\n \"What a lead form asks, by the names --field uses.\\n\\nExamples:\\n baker lead-routes fields --platform meta --form 1234567890\\n baker lead-routes fields --platform linkedin --account 513852526 --form 987654\",\n },\n args: { platform: PLATFORM_ARG, account: ACCOUNT_ARG, form: FORM_ARG },\n run: async ({ args }) => {\n try {\n const body: LeadRouteFieldsRequest = {\n platform: asPlatform(args.platform),\n formId: String(args.form),\n ...(args.account ? { account: String(args.account) } : {}),\n };\n writeJson(await apiPost<LeadRouteFieldsResponse>(\"/api/lead-routes/fields\", body));\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst previewCommand = defineCommand({\n meta: {\n name: \"preview\",\n description:\n \"What a destination would receive for the latest leads. Sends nothing.\\n\\nExamples:\\n baker lead-routes preview --id r1\\n baker lead-routes preview --platform meta --form 1234567890 --to httpWebhook\\n baker lead-routes preview --platform meta --form 1234567890 --to hubspotForm --field email=email --field firstname=first_name\",\n },\n args: {\n id: PREVIEW_ID_ARG,\n platform: OPTIONAL_PLATFORM_ARG,\n account: ACCOUNT_ARG,\n form: OPTIONAL_FORM_ARG,\n to: OPTIONAL_TO_ARG,\n field: FIELD_ARG,\n limit: { type: \"string\", description: \"1-5\", required: false },\n full: { type: \"boolean\", description: \"Unmasked\", required: false },\n },\n run: async ({ args, rawArgs }) => {\n try {\n const fields = parseFields(repeatedValues(rawArgs, \"field\", args.field));\n if (!args.id && !(args.platform && args.form && args.to)) {\n throw new LeadRouteArgsError(\n \"Name a route with --id r1, or a form and a destination: --platform, --form, --to\",\n );\n }\n const chatId = optionalChatId();\n const body: LeadRoutePreviewRequest = {\n ...(args.id ? { id: String(args.id) } : {}),\n ...(chatId ? { chatId } : {}),\n ...(args.platform ? { platform: asPlatform(args.platform) } : {}),\n ...(args.form ? { formId: String(args.form) } : {}),\n ...(args.to ? { destinationType: args.to as LeadRouteDestinationType } : {}),\n ...(args.account ? { account: String(args.account) } : {}),\n ...(fields.length > 0 ? { fields } : {}),\n ...(args.limit ? { limit: Number(args.limit) } : {}),\n ...(args.full === true ? { full: true } : {}),\n };\n writeJson(await apiPost<LeadRoutePreviewResponse>(\"/api/lead-routes/preview\", body));\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst setCommand = defineCommand({\n meta: {\n name: \"set\",\n description:\n 'Stage a lead route; it starts delivering when this chat is published.\\n\\nExamples:\\n baker lead-routes set --platform meta --form 1234567890 --to googleSpreadsheet --new-sheet \"Meta leads\"\\n baker lead-routes set --platform linkedin --account 513852526 --form 987654 --to hubspotForm --hubspot-form 3f2a…\\n baker lead-routes set --platform meta --form 1234567890 --to httpWebhook --url https://hooks.example.com/leads\\n baker lead-routes set --platform google --account 3865083115 --form 555 --to email --email sales@acme.com\\n baker lead-routes set --id r1 --add-field M=answer:budget --add-field \"N=text:Facebook lead ad\"',\n },\n args: {\n platform: SET_PLATFORM_ARG,\n account: ACCOUNT_ARG,\n form: SET_FORM_ARG,\n to: SET_TO_ARG,\n sheet: { type: \"string\", description: \"Existing spreadsheet id\", required: false },\n \"new-sheet\": { type: \"string\", description: \"Create a spreadsheet with this title\", required: false },\n tab: { type: \"string\", description: \"Tab to append to\", required: false },\n \"destination-account\": { type: \"string\", description: \"Which connected account\", required: false },\n \"hubspot-form\": { type: \"string\", description: \"HubSpot form id\", required: false },\n url: { type: \"string\", description: \"Webhook or Zapier hook address\", required: false },\n email: { type: \"string\", description: \"Recipients, comma-separated\", required: false },\n subject: { type: \"string\", description: \"Email subject\", required: false },\n field: FIELD_ARG,\n \"add-field\": ADD_FIELD_ARG,\n since: { type: \"string\", description: \"YYYY-MM-DD, at most 30 days back\", required: false },\n id: { type: \"string\", description: \"Change this route\", required: false },\n name: { type: \"string\", description: \"Route name\", required: false },\n },\n run: async ({ args, rawArgs }) => {\n try {\n const text = (key: string) => {\n const value = (args as Record<string, unknown>)[key];\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n };\n const staged = parseStageArgs(\n {\n id: text(\"id\"),\n name: text(\"name\"),\n platform: text(\"platform\"),\n account: text(\"account\"),\n form: text(\"form\"),\n to: text(\"to\"),\n sheet: text(\"sheet\"),\n \"new-sheet\": text(\"new-sheet\"),\n tab: text(\"tab\"),\n \"destination-account\": text(\"destination-account\"),\n \"hubspot-form\": text(\"hubspot-form\"),\n url: text(\"url\"),\n email: text(\"email\"),\n subject: text(\"subject\"),\n since: text(\"since\"),\n },\n {\n fields: repeatedValues(rawArgs, \"field\", args.field),\n addFields: repeatedValues(rawArgs, \"add-field\", args[\"add-field\"]),\n },\n );\n const body: LeadRouteStageRequest = { chatId: requireChatId(), ...staged };\n writeJson(await apiPost<LeadRouteStageResponse>(\"/api/lead-routes/stage\", body));\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst removeCommand = defineCommand({\n meta: {\n name: \"remove\",\n description: \"Stage stopping live lead routes.\\n\\nExample: baker lead-routes remove r1\",\n },\n args: { id: { type: \"positional\", description: \"Route ids, comma-separated\", required: true } },\n run: async ({ args }) => {\n try {\n const remove = String(args.id)\n .split(\",\")\n .map((id) => id.trim())\n .filter(Boolean);\n const body: LeadRouteStageRequest = { chatId: requireChatId(), remove };\n writeJson(await apiPost<LeadRouteStageResponse>(\"/api/lead-routes/stage\", body));\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst unstageCommand = defineCommand({\n meta: {\n name: \"unstage\",\n description:\n \"Take back a staged lead route change.\\n\\nExamples:\\n baker lead-routes unstage r2\\n baker lead-routes unstage --all\",\n },\n args: {\n id: { type: \"positional\", description: \"A staged routeId\", required: false },\n all: { type: \"boolean\", description: \"Every staged change\", required: false },\n },\n run: async ({ args }) => {\n try {\n const id = typeof args.id === \"string\" && args.id.length > 0 ? args.id : undefined;\n if ((id === undefined) === (args.all !== true)) {\n throw new LeadRouteArgsError(\"Pass one route id (see `baker lead-routes list` → staged) or --all.\");\n }\n const body = { chatId: requireChatId(), ...(id ? { routeId: id } : {}) };\n writeJson(await apiPost<LeadRouteUnstageResponse>(\"/api/lead-routes/unstage\", body));\n } catch (err) {\n fail(err);\n }\n },\n});\n\nexport const leadRoutesCommand = defineCommand({\n meta: {\n name: \"lead-routes\",\n description: `Send the leads an ad platform's lead form collects — a Meta Instant Form, a LinkedIn Lead Gen Form, a Google lead form — to a Google Sheet, HubSpot, a webhook, Zapier, an email, Pipedrive, GoHighLevel or ActiveCampaign. Staged on this chat; delivering from when it is published. Subcommands: list, fields, preview, set, remove, unstage.\n\nExamples:\n baker lead-routes list\n baker lead-routes fields --platform meta --form 1234567890\n baker lead-routes set --platform meta --form 1234567890 --to googleSpreadsheet --new-sheet \"Meta leads\"\n baker lead-routes remove r1\nFull guide: __tooling__/docs/tools/baker/lead-routes.md`,\n },\n subCommands: {\n list: listCommand,\n fields: fieldsCommand,\n preview: previewCommand,\n set: setCommand,\n remove: removeCommand,\n unstage: unstageCommand,\n },\n});\n","import {\n LEAD_ROUTE_DESTINATION_TYPES,\n LEAD_ROUTE_PLATFORMS,\n type LeadRouteAmend,\n type LeadRouteDestinationInput,\n type LeadRouteField,\n type LeadRouteSet,\n leadRouteAmendSchema,\n leadRouteSetSchema,\n} from \"@baker/api/lead-routes\";\n\n/** A `baker lead-routes` call the CLI can refuse before any request. */\nexport class LeadRouteArgsError extends Error {}\n\nexport type SetFlags = {\n id?: string;\n name?: string;\n platform?: string;\n account?: string;\n form?: string;\n to?: string;\n sheet?: string;\n \"new-sheet\"?: string;\n tab?: string;\n \"destination-account\"?: string;\n \"hubspot-form\"?: string;\n url?: string;\n email?: string;\n subject?: string;\n since?: string;\n};\n\n/** `--field <key>=<from>`, each one: the destination's key, then what the lead fills it with. */\nexport function parseFields(values: readonly string[]): LeadRouteField[] {\n return values.map((value) => {\n const at = value.indexOf(\"=\");\n if (at <= 0 || at === value.length - 1) {\n throw new LeadRouteArgsError(\n `--field \"${value}\" needs the form <destination key>=<lead field>, e.g. --field C=email or --field firstname=first_name.`,\n );\n }\n return { key: value.slice(0, at).trim(), from: value.slice(at + 1).trim() };\n });\n}\n\n/** Which destination flags each `--to` takes; any other one is a mistake worth saying out loud. */\nconst DESTINATION_FLAGS = {\n googleSpreadsheet: [\"sheet\", \"new-sheet\", \"tab\", \"destination-account\"],\n hubspotForm: [\"hubspot-form\"],\n httpWebhook: [\"url\"],\n zapier: [\"url\"],\n email: [\"email\", \"subject\"],\n pipedrive: [\"destination-account\"],\n goHighlevelContact: [\"destination-account\"],\n activeCampaignContact: [\"destination-account\"],\n} as const satisfies Record<(typeof LEAD_ROUTE_DESTINATION_TYPES)[number], readonly (keyof SetFlags)[]>;\n\nconst ALL_DESTINATION_FLAGS = new Set<string>(Object.values(DESTINATION_FLAGS).flat());\n\ntype DestinationType = keyof typeof DESTINATION_FLAGS;\n\nfunction need(value: string | undefined, message: string): string {\n if (!value) throw new LeadRouteArgsError(message);\n return value;\n}\n\nfunction sheetDestination(flags: SetFlags): LeadRouteDestinationInput {\n if (!flags.sheet === !flags[\"new-sheet\"]) {\n throw new LeadRouteArgsError(\n \"Name the spreadsheet with --sheet <id> (`baker flows options googleSpreadsheet`) or make one with --new-sheet <title>.\",\n );\n }\n return {\n type: \"googleSpreadsheet\",\n ...(flags[\"destination-account\"] ? { account: flags[\"destination-account\"] } : {}),\n ...(flags.sheet ? { resourceId: flags.sheet } : {}),\n ...(flags[\"new-sheet\"] ? { newSheet: { title: flags[\"new-sheet\"] } } : {}),\n ...(flags.tab ? { tab: flags.tab } : {}),\n };\n}\n\nfunction accountDestination(type: \"pipedrive\" | \"goHighlevelContact\" | \"activeCampaignContact\") {\n return (flags: SetFlags): LeadRouteDestinationInput => ({\n type,\n ...(flags[\"destination-account\"] ? { account: flags[\"destination-account\"] } : {}),\n });\n}\n\n/** Each `--to`'s destination, from the flags it takes. */\nconst DESTINATIONS: Record<DestinationType, (flags: SetFlags) => LeadRouteDestinationInput> = {\n googleSpreadsheet: sheetDestination,\n hubspotForm: (flags) => ({\n type: \"hubspotForm\",\n formId: need(flags[\"hubspot-form\"], \"--to hubspotForm needs --hubspot-form <id> (`baker hubspot forms list`).\"),\n }),\n httpWebhook: (flags) => ({ type: \"httpWebhook\", url: need(flags.url, \"--to httpWebhook needs --url <address>.\") }),\n zapier: (flags) => ({ type: \"zapier\", url: need(flags.url, \"--to zapier needs --url <address>.\") }),\n email: (flags) => ({\n type: \"email\",\n email: need(flags.email, \"--to email needs --email <address>[,<address>…].\"),\n ...(flags.subject ? { subject: flags.subject } : {}),\n }),\n pipedrive: accountDestination(\"pipedrive\"),\n goHighlevelContact: accountDestination(\"goHighlevelContact\"),\n activeCampaignContact: accountDestination(\"activeCampaignContact\"),\n};\n\nfunction destinationOf(flags: SetFlags): LeadRouteDestinationInput {\n const to = flags.to;\n if (!to || !(LEAD_ROUTE_DESTINATION_TYPES as readonly string[]).includes(to)) {\n throw new LeadRouteArgsError(`--to must be one of ${LEAD_ROUTE_DESTINATION_TYPES.join(\", \")}.`);\n }\n const type = to as DestinationType;\n const allowed = new Set<string>(DESTINATION_FLAGS[type]);\n const stray = [...ALL_DESTINATION_FLAGS].filter((flag) => !allowed.has(flag) && flags[flag as keyof SetFlags]);\n if (stray.length > 0) {\n throw new LeadRouteArgsError(`--to ${type} does not take ${stray.map((flag) => `--${flag}`).join(\", \")}.`);\n }\n return DESTINATIONS[type](flags);\n}\n\n/** The route one `baker lead-routes set` describes, checked against the shared contract. */\nexport function parseSetArgs(flags: SetFlags, fieldValues: readonly string[]): LeadRouteSet {\n if (!flags.platform || !(LEAD_ROUTE_PLATFORMS as readonly string[]).includes(flags.platform)) {\n throw new LeadRouteArgsError(`--platform must be one of ${LEAD_ROUTE_PLATFORMS.join(\", \")}.`);\n }\n if (!flags.form) throw new LeadRouteArgsError(\"--form <lead form id> is required.\");\n const fields = parseFields(fieldValues);\n const parsed = leadRouteSetSchema.safeParse({\n ...(flags.id ? { id: flags.id } : {}),\n ...(flags.name ? { name: flags.name } : {}),\n platform: flags.platform,\n ...(flags.account ? { account: flags.account } : {}),\n formId: flags.form,\n destination: destinationOf(flags),\n ...(fields.length > 0 ? { fields } : {}),\n ...(flags.since ? { since: flags.since } : {}),\n });\n if (!parsed.success) {\n const issue = parsed.error.issues[0];\n throw new LeadRouteArgsError(`${issue?.path.join(\".\") || \"route\"}: ${issue?.message ?? \"invalid\"}`);\n }\n return parsed.data;\n}\n\n/** Flags that name a form or a destination: a change keeping both takes none of them. */\nconst ROUTE_FLAGS = [\"platform\", \"account\", \"form\", ...ALL_DESTINATION_FLAGS] as const;\n\nfunction amendArgs(flags: SetFlags, fieldValues: readonly string[], addFieldValues: readonly string[]): LeadRouteAmend {\n const named = ROUTE_FLAGS.filter((flag) => flags[flag as keyof SetFlags]);\n if (named.length > 0) {\n throw new LeadRouteArgsError(\n `set --id without --to keeps the route's form and destination, so it takes no ${named.map((flag) => `--${flag}`).join(\", \")}. Change the mapping with --add-field or --field; to move the route, pass --to with its destination flags too.`,\n );\n }\n const fields = parseFields(fieldValues);\n const addFields = parseFields(addFieldValues);\n const parsed = leadRouteAmendSchema.safeParse({\n id: flags.id,\n ...(flags.name ? { name: flags.name } : {}),\n ...(fields.length > 0 ? { fields } : {}),\n ...(addFields.length > 0 ? { addFields } : {}),\n ...(flags.since ? { since: flags.since } : {}),\n });\n if (!parsed.success) {\n const issue = parsed.error.issues[0];\n throw new LeadRouteArgsError(`${issue?.path.join(\".\") || \"route\"}: ${issue?.message ?? \"invalid\"}`);\n }\n return parsed.data;\n}\n\n/**\n * What one `baker lead-routes set` stages: a whole route when `--to` names\n * where it sends, else — with `--id` — a change to that route's mapping,\n * start or name that keeps its form and destination.\n */\nexport function parseStageArgs(\n flags: SetFlags,\n values: { fields: readonly string[]; addFields: readonly string[] },\n): { set: LeadRouteSet } | { amend: LeadRouteAmend } {\n if (flags.id && !flags.to) return { amend: amendArgs(flags, values.fields, values.addFields) };\n if (values.addFields.length > 0) {\n throw new LeadRouteArgsError(\n \"--add-field changes an existing route: use it with --id <route> and without --to. A new route names its fields with --field.\",\n );\n }\n return { set: parseSetArgs(flags, values.fields) };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS;AAiBX,IAAM,uBAAuB,CAAC,QAAQ,YAAY,QAAQ;AAC1D,IAAM,0BAA0B,EAAE,KAAK,oBAAoB;AAU3D,IAAM,+BAA+B;AAAA,EAC1C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AACO,IAAM,iCAAiC,EAAE,KAAK,4BAA4B;AAoB1E,IAAM,sBAAsB;AAAA,EACjC;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;AACF;AAIO,IAAM,sBAAsB;AAAA,EACjC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,IAAM,sBAAsB,CAAC,WAAW,UAAU;AAElD,IAAM,qBAAqB;AAC3B,IAAM,mBAAmB;AAOzB,SAAS,WAAW,MAAuB;AAChD,MAAI,KAAK,WAAW,kBAAkB,EAAG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,KAAK,KAAK;AACzE,UAAK,OAAO,YAAgB,KAAK,QAAQ,OAAO;AAC9C,cAAM,IAAI,mBAAmB,0EAAqE;AAAA,MACpG;AACA,YAAM,OAAO,EAAE,QAAQ,cAAc,GAAG,GAAI,KAAK,EAAE,SAAS,GAAG,IAAI,CAAC,EAAG;AACvE,gBAAU,MAAM,QAAkC,4BAA4B,IAAI,CAAC;AAAA,IACrF,SAAS,KAAK;AACZ,WAAK,GAAG;AAAA,IACV;AAAA,EACF;AACF,CAAC;AAEM,IAAM,oBAAoB,cAAc;AAAA,EAC7C,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQf;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AACF,CAAC;","names":[]}
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
csvOrJson,
|
|
3
3
|
handleLinkedinError,
|
|
4
4
|
resolveAccountIdArg
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-BJOK7QD4.js";
|
|
6
6
|
import {
|
|
7
7
|
writeAdsJson,
|
|
8
8
|
writeAdsOutput
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZRP7Y2DM.js";
|
|
10
10
|
import {
|
|
11
11
|
NO_CACHE_ARG
|
|
12
12
|
} from "./chunk-AGBBTTKA.js";
|
|
@@ -112,4 +112,4 @@ the option chosen. Form ids are the ones \`baker ads linkedin lead-forms\` lists
|
|
|
112
112
|
export {
|
|
113
113
|
leadsCommand
|
|
114
114
|
};
|
|
115
|
-
//# sourceMappingURL=leads-
|
|
115
|
+
//# sourceMappingURL=leads-LAATTW5G.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
requireTarget,
|
|
7
7
|
stageOp,
|
|
8
8
|
upper
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-QDQZ62FL.js";
|
|
10
10
|
import {
|
|
11
11
|
isMetaLeadAdsRefusal
|
|
12
12
|
} from "./chunk-Q3GSVLE5.js";
|
|
@@ -14,7 +14,7 @@ import "./chunk-GDFJOCDO.js";
|
|
|
14
14
|
import {
|
|
15
15
|
csvOrJson,
|
|
16
16
|
handleMetaError
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-B2POVFR2.js";
|
|
18
18
|
import {
|
|
19
19
|
repeatedValues
|
|
20
20
|
} from "./chunk-ERSX3MKH.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
writeAdsJson,
|
|
28
28
|
writeAdsOutput,
|
|
29
29
|
writeJsonEnvelope
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ZRP7Y2DM.js";
|
|
31
31
|
import "./chunk-E44NXCTL.js";
|
|
32
32
|
import "./chunk-EJGAJHLB.js";
|
|
33
33
|
import "./chunk-LNNTHEL7.js";
|
|
@@ -537,4 +537,4 @@ export {
|
|
|
537
537
|
leadPageHints,
|
|
538
538
|
leadsCommand
|
|
539
539
|
};
|
|
540
|
-
//# sourceMappingURL=leads-
|
|
540
|
+
//# sourceMappingURL=leads-ULYHTG22.js.map
|
|
@@ -7,10 +7,10 @@ import {
|
|
|
7
7
|
stageAccountId,
|
|
8
8
|
stageXOp,
|
|
9
9
|
stageXOps
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-TGPGQTZA.js";
|
|
11
11
|
import "./chunk-FIN4ZXGJ.js";
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-7NF73SCB.js";
|
|
13
|
+
import "./chunk-ZRP7Y2DM.js";
|
|
14
14
|
import {
|
|
15
15
|
OBJECTIVES,
|
|
16
16
|
PLACEMENTS,
|
|
@@ -208,4 +208,4 @@ export {
|
|
|
208
208
|
lineItemsResumeCommand,
|
|
209
209
|
lineItemsUpdateCommand
|
|
210
210
|
};
|
|
211
|
-
//# sourceMappingURL=line-item-writes-
|
|
211
|
+
//# sourceMappingURL=line-item-writes-XJTTA3X5.js.map
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
} from "./chunk-MKAYMOZY.js";
|
|
4
4
|
import {
|
|
5
5
|
runListCommand
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TLQOMWLQ.js";
|
|
7
7
|
import "./chunk-FIN4ZXGJ.js";
|
|
8
8
|
import {
|
|
9
9
|
resolveXAccountId
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-7NF73SCB.js";
|
|
11
|
+
import "./chunk-ZRP7Y2DM.js";
|
|
12
12
|
import "./chunk-X7VQFLHI.js";
|
|
13
13
|
import "./chunk-LU4HI4KI.js";
|
|
14
14
|
import "./chunk-LGK7UWBN.js";
|
|
@@ -86,10 +86,10 @@ Examples:
|
|
|
86
86
|
},
|
|
87
87
|
subCommands: {
|
|
88
88
|
list: lineItemsListCommand,
|
|
89
|
-
create: () => import("./line-item-writes-
|
|
90
|
-
update: () => import("./line-item-writes-
|
|
91
|
-
pause: () => import("./line-item-writes-
|
|
92
|
-
resume: () => import("./line-item-writes-
|
|
89
|
+
create: () => import("./line-item-writes-XJTTA3X5.js").then((m) => m.lineItemsCreateCommand),
|
|
90
|
+
update: () => import("./line-item-writes-XJTTA3X5.js").then((m) => m.lineItemsUpdateCommand),
|
|
91
|
+
pause: () => import("./line-item-writes-XJTTA3X5.js").then((m) => m.lineItemsPauseCommand),
|
|
92
|
+
resume: () => import("./line-item-writes-XJTTA3X5.js").then((m) => m.lineItemsResumeCommand)
|
|
93
93
|
},
|
|
94
94
|
args: {
|
|
95
95
|
"account-id": { type: "string", description: "X Ads account ID" },
|
|
@@ -104,4 +104,4 @@ Examples:
|
|
|
104
104
|
export {
|
|
105
105
|
lineItemsCommand
|
|
106
106
|
};
|
|
107
|
-
//# sourceMappingURL=line-items-
|
|
107
|
+
//# sourceMappingURL=line-items-JR25T2C5.js.map
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TOTAL_BUDGET_HELP
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7I6ZVBLM.js";
|
|
4
4
|
import {
|
|
5
5
|
statusesArgDescription
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-BJOK7QD4.js";
|
|
7
7
|
import "./chunk-SCAGMX2I.js";
|
|
8
8
|
import "./chunk-4NZ47VXO.js";
|
|
9
9
|
import "./chunk-D5FY4FAK.js";
|
|
10
10
|
import "./chunk-QPESDKZC.js";
|
|
11
11
|
import {
|
|
12
12
|
AVAILABLE_ARG
|
|
13
|
-
} from "./chunk-
|
|
14
|
-
import "./chunk-
|
|
13
|
+
} from "./chunk-DM3Q6F5F.js";
|
|
14
|
+
import "./chunk-ZRP7Y2DM.js";
|
|
15
15
|
import "./chunk-E44NXCTL.js";
|
|
16
16
|
import "./chunk-EJGAJHLB.js";
|
|
17
17
|
import {
|
|
@@ -1283,34 +1283,34 @@ Account ID format:
|
|
|
1283
1283
|
Full guide: __tooling__/docs/tools/baker/ads-linkedin.md`
|
|
1284
1284
|
},
|
|
1285
1285
|
subCommands: {
|
|
1286
|
-
accounts: () => import("./accounts-
|
|
1287
|
-
account: () => import("./account-
|
|
1288
|
-
"account-users": () => import("./account-users-
|
|
1289
|
-
"campaign-groups": () => import("./campaign-groups-
|
|
1290
|
-
campaigns: () => import("./campaigns-
|
|
1291
|
-
creatives: () => import("./creatives-
|
|
1292
|
-
audiences: () => import("./write-commands-
|
|
1293
|
-
"lead-forms": () => import("./write-commands-
|
|
1294
|
-
experiments: () => import("./experiments-
|
|
1295
|
-
draft: () => import("./draft-
|
|
1296
|
-
analytics: () => import("./analytics-
|
|
1297
|
-
demographics: () => import("./demographics-
|
|
1298
|
-
companies: () => import("./companies-
|
|
1299
|
-
"top-companies": () => import("./top-companies-
|
|
1300
|
-
resolve: () => import("./resolve-
|
|
1301
|
-
facets: () => import("./facets-
|
|
1302
|
-
"audience-size": () => import("./audience-size-
|
|
1303
|
-
"bid-pricing": () => import("./bid-pricing-
|
|
1304
|
-
forecast: () => import("./forecast-
|
|
1305
|
-
leads: () => import("./leads-
|
|
1306
|
-
revenue: () => import("./revenue-
|
|
1307
|
-
conversions: () => import("./conversions-
|
|
1308
|
-
conversation: () => import("./conversation-
|
|
1309
|
-
audit: () => import("./audit-
|
|
1310
|
-
"url-params": () => import("./url-params-
|
|
1286
|
+
accounts: () => import("./accounts-OE33CKWD.js").then((m) => m.accountsCommand),
|
|
1287
|
+
account: () => import("./account-QX4G4BJ7.js").then((m) => m.accountCommand),
|
|
1288
|
+
"account-users": () => import("./account-users-UTIF7MIT.js").then((m) => m.accountUsersCommand),
|
|
1289
|
+
"campaign-groups": () => import("./campaign-groups-PH64UXZJ.js").then((m) => m.campaignGroupsCommand),
|
|
1290
|
+
campaigns: () => import("./campaigns-JF4TYYUP.js").then((m) => m.campaignsCommand),
|
|
1291
|
+
creatives: () => import("./creatives-FU3YELGU.js").then((m) => m.creativesCommand),
|
|
1292
|
+
audiences: () => import("./write-commands-NVCX7IAU.js").then((m) => m.audiencesCommand),
|
|
1293
|
+
"lead-forms": () => import("./write-commands-NVCX7IAU.js").then((m) => m.leadFormsCommand),
|
|
1294
|
+
experiments: () => import("./experiments-MLLTHMMS.js").then((m) => m.experimentsCommand),
|
|
1295
|
+
draft: () => import("./draft-P7IDMXWR.js").then((m) => m.linkedinDraftCommand),
|
|
1296
|
+
analytics: () => import("./analytics-XB6FRNVJ.js").then((m) => m.analyticsCommand),
|
|
1297
|
+
demographics: () => import("./demographics-ABZODD45.js").then((m) => m.demographicsCommand),
|
|
1298
|
+
companies: () => import("./companies-KMMV6EJW.js").then((m) => m.companiesCommand),
|
|
1299
|
+
"top-companies": () => import("./top-companies-FSITN3ZR.js").then((m) => m.topCompaniesCommand),
|
|
1300
|
+
resolve: () => import("./resolve-KRKIJKT7.js").then((m) => m.resolveCommand),
|
|
1301
|
+
facets: () => import("./facets-KSHR3MBE.js").then((m) => m.facetsCommand),
|
|
1302
|
+
"audience-size": () => import("./audience-size-P5L6MZ4C.js").then((m) => m.audienceSizeCommand),
|
|
1303
|
+
"bid-pricing": () => import("./bid-pricing-NWSUO3VM.js").then((m) => m.bidPricingCommand),
|
|
1304
|
+
forecast: () => import("./forecast-HT46MFL4.js").then((m) => m.forecastCommand),
|
|
1305
|
+
leads: () => import("./leads-LAATTW5G.js").then((m) => m.leadsCommand),
|
|
1306
|
+
revenue: () => import("./revenue-UBZUTSXN.js").then((m) => m.revenueCommand),
|
|
1307
|
+
conversions: () => import("./conversions-SUMZAV2T.js").then((m) => m.conversionsCommand),
|
|
1308
|
+
conversation: () => import("./conversation-KHTZBGX2.js").then((m) => m.conversationCommand),
|
|
1309
|
+
audit: () => import("./audit-SEADLC6F.js").then((m) => m.auditCommand),
|
|
1310
|
+
"url-params": () => import("./url-params-TRFI2PMD.js").then((m) => m.urlParamsCommand)
|
|
1311
1311
|
}
|
|
1312
1312
|
});
|
|
1313
1313
|
export {
|
|
1314
1314
|
linkedinCommand
|
|
1315
1315
|
};
|
|
1316
|
-
//# sourceMappingURL=linkedin-
|
|
1316
|
+
//# sourceMappingURL=linkedin-W5BJ6HEH.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
failApi
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import "./chunk-
|
|
3
|
+
} from "./chunk-3G3GC5N4.js";
|
|
4
|
+
import "./chunk-GAYRBIEF.js";
|
|
5
5
|
import {
|
|
6
6
|
CHAT_READ_ARG
|
|
7
7
|
} from "./chunk-PFBQERWX.js";
|
|
@@ -64,4 +64,4 @@ var listCommand = defineCommand({
|
|
|
64
64
|
export {
|
|
65
65
|
listCommand
|
|
66
66
|
};
|
|
67
|
-
//# sourceMappingURL=list-
|
|
67
|
+
//# sourceMappingURL=list-3653DIYB.js.map
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
import "./chunk-IZABTTW5.js";
|
|
5
5
|
import {
|
|
6
6
|
writeAdsJson
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-ZRP7Y2DM.js";
|
|
8
8
|
import "./chunk-MUS2UTWU.js";
|
|
9
9
|
import "./chunk-X7VQFLHI.js";
|
|
10
10
|
import "./chunk-LU4HI4KI.js";
|
|
@@ -37,4 +37,4 @@ var locationsCommand = defineCommand({
|
|
|
37
37
|
export {
|
|
38
38
|
locationsCommand
|
|
39
39
|
};
|
|
40
|
-
//# sourceMappingURL=locations-
|
|
40
|
+
//# sourceMappingURL=locations-HTVYJSDJ.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
CHATGPT_ADS_REFERENCE,
|
|
3
3
|
runChatgptRead
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-EW7JSTRZ.js";
|
|
5
|
+
import "./chunk-ZRP7Y2DM.js";
|
|
6
6
|
import "./chunk-SOPVIIUW.js";
|
|
7
7
|
import "./chunk-G4FG5EQO.js";
|
|
8
8
|
import {
|
|
@@ -66,4 +66,4 @@ export {
|
|
|
66
66
|
locationHints,
|
|
67
67
|
locationsCommand
|
|
68
68
|
};
|
|
69
|
-
//# sourceMappingURL=locations-
|
|
69
|
+
//# sourceMappingURL=locations-M2B5XDU4.js.map
|
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
lookupReport,
|
|
4
4
|
peopleArgs,
|
|
5
5
|
peopleLimitError
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NWF2LRKO.js";
|
|
7
7
|
import "./chunk-WLESMH4J.js";
|
|
8
8
|
import "./chunk-JOE42ZW6.js";
|
|
9
9
|
import "./chunk-NKQWDEB7.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-ZRP7Y2DM.js";
|
|
11
11
|
import "./chunk-G4FG5EQO.js";
|
|
12
12
|
import "./chunk-X7VQFLHI.js";
|
|
13
13
|
import "./chunk-LU4HI4KI.js";
|
|
@@ -20,4 +20,4 @@ export {
|
|
|
20
20
|
peopleArgs,
|
|
21
21
|
peopleLimitError
|
|
22
22
|
};
|
|
23
|
-
//# sourceMappingURL=lookup-
|
|
23
|
+
//# sourceMappingURL=lookup-S5VG7AWH.js.map
|
|
@@ -324,24 +324,12 @@ function readsKey(label) {
|
|
|
324
324
|
return [first.toLowerCase(), ...rest].join("");
|
|
325
325
|
}
|
|
326
326
|
function platformEntry(platform) {
|
|
327
|
-
const status = signInStatus(platform);
|
|
328
327
|
return {
|
|
329
328
|
platform: platform.label,
|
|
330
329
|
...platform.account ? { account: platform.account } : {},
|
|
331
|
-
...platform.readsLabel && platform.reads.length > 0 ? { [readsKey(platform.readsLabel)]: platform.reads } : {}
|
|
332
|
-
...status ? { status } : {}
|
|
330
|
+
...platform.readsLabel && platform.reads.length > 0 ? { [readsKey(platform.readsLabel)]: platform.reads } : {}
|
|
333
331
|
};
|
|
334
332
|
}
|
|
335
|
-
function signInStatus(platform) {
|
|
336
|
-
const request = `request_connection { platform: "${platform.type}" }`;
|
|
337
|
-
if (platform.signIn === "needs_reconnect") {
|
|
338
|
-
return `sign-in no longer works \u2014 needs reconnecting: call ${request}`;
|
|
339
|
-
}
|
|
340
|
-
if (platform.signIn === "expiring") {
|
|
341
|
-
return `signed in, but the sign-in lapses within days \u2014 tell the user and offer to renew it now with ${request}`;
|
|
342
|
-
}
|
|
343
|
-
return null;
|
|
344
|
-
}
|
|
345
333
|
|
|
346
334
|
// src/commands/mcp/index.ts
|
|
347
335
|
var SCOPES = ["user", "user_org", "company", "org"];
|
|
@@ -391,7 +379,7 @@ function fail2(err) {
|
|
|
391
379
|
writeJson({ ok: false, error: { code: "NETWORK_ERROR", message: "Unexpected error" } });
|
|
392
380
|
process.exit(1);
|
|
393
381
|
}
|
|
394
|
-
var PLATFORMS_HINT = "`platforms` are connected accounts you reach through `baker` commands (HubSpot, Google Ads, GA4, Search Console, Tag Manager, \u2026), NOT mcp__* tools \u2014 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.
|
|
382
|
+
var PLATFORMS_HINT = "`platforms` are connected accounts you reach through `baker` commands (HubSpot, Google Ads, GA4, Search Console, Tag Manager, \u2026), NOT mcp__* tools \u2014 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. Read what it holds with its own command family (`baker hubspot \u2026`, `baker ads google \u2026`, `baker ga4 \u2026`, and so on).";
|
|
395
383
|
registerSchema({
|
|
396
384
|
command: "mcp.connected",
|
|
397
385
|
description: "List everything this chat can reach: managed integrations (Attio, Slack, Gmail, Google Sheets, \u2026), 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.",
|
|
@@ -726,4 +714,4 @@ Full guide: __tooling__/docs/tools/baker/mcp.md`
|
|
|
726
714
|
export {
|
|
727
715
|
mcpCommand
|
|
728
716
|
};
|
|
729
|
-
//# sourceMappingURL=mcp-
|
|
717
|
+
//# sourceMappingURL=mcp-TFQTME4P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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. 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}\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 return {\n platform: platform.label,\n ...(platform.account ? { account: platform.account } : {}),\n ...(platform.readsLabel && platform.reads.length > 0 ? { [readsKey(platform.readsLabel)]: platform.reads } : {}),\n };\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,SA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;AAAA;AAAA;AAAA,EAIf;AAAA,EACA,MAAM;AAAA,EACN,KAAK,OAAO,EAAE,KAAK,MAAM;AACvB,UAAM,SAAS,iCAAiC,UAAU,EAAE,MAAM,KAAK,MAAM,cAAcF,cAAa,EAAE,CAAC;AAC3G,QAAI,CAAC,OAAO,SAAS;AACnB,MAAAC,MAAK,IAAI,SAAS,oBAAoB,OAAO,MAAM,OAAO,CAAC,GAAG,WAAW,mBAAmB,CAAC;AAAA,IAC/F;AACA,QAAI;AACF,YAAM,OAAO,MAAM,QAAkC,2BAA2B,OAAO,IAAI;AAC3F,gBAAU;AAAA,QACR,IAAI;AAAA,QACJ;AAAA,QACA,OAAO;AAAA,UACL;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH,SAAS,KAAK;AACZ,MAAAA,MAAK,GAAG;AAAA,IACV;AAAA,EACF;AACF,CAAC;AAEM,IAAM,aAAaC,eAAc;AAAA,EACtC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAqBf;AAAA,EACA,aAAa;AAAA,IACX,WAAW;AAAA,IACX,SAAS;AAAA,IACT,OAAO;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,IACN,KAAK;AAAA,IACL,QAAQ;AAAA,IACR,QAAQ;AAAA,IACR,SAAS;AAAA,EACX;AACF,CAAC;","names":["defineCommand","z","parsed","actingUserId","fail","defineCommand"]}
|
|
@@ -8,11 +8,11 @@ var metaMediaCommand = defineCommand({
|
|
|
8
8
|
description: "Stage Baker library media uploads to Meta so creatives can reference them (upload), or take an image out of the account's image library (delete --image-hash). Upload publishes an ad-image hash or video id a creative binds via --image-ref/--video-ref."
|
|
9
9
|
},
|
|
10
10
|
subCommands: {
|
|
11
|
-
upload: () => import("./write-commands-
|
|
12
|
-
delete: () => import("./asset-writes-
|
|
11
|
+
upload: () => import("./write-commands-OGVDWWBV.js").then((m) => m.mediaUploadCommand),
|
|
12
|
+
delete: () => import("./asset-writes-JLVUAVUZ.js").then((m) => m.mediaDeleteCommand)
|
|
13
13
|
}
|
|
14
14
|
});
|
|
15
15
|
export {
|
|
16
16
|
metaMediaCommand
|
|
17
17
|
};
|
|
18
|
-
//# sourceMappingURL=media-
|
|
18
|
+
//# sourceMappingURL=media-P4T4ZBNS.js.map
|