@koda-sl/baker-cli 0.513.0 → 0.514.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/account-D6LEVVWT.js +82 -0
- package/dist/account-D6LEVVWT.js.map +1 -0
- package/dist/account-SGK3IJ6N.js +82 -0
- package/dist/account-SGK3IJ6N.js.map +1 -0
- package/dist/account-assets-J5Z4URLQ.js +290 -0
- package/dist/account-level-4SBYYHRS.js +611 -0
- package/dist/account-level-4SBYYHRS.js.map +1 -0
- package/dist/account-reads-2MSUVG46.js +219 -0
- package/dist/account-users-MHC7AD6K.js +64 -0
- package/dist/account-users-MHC7AD6K.js.map +1 -0
- package/dist/account-writes-QQQC54WC.js +68 -0
- package/dist/account-writes-QQQC54WC.js.map +1 -0
- package/dist/accounts-2O6I7YBN.js +80 -0
- package/dist/accounts-2O6I7YBN.js.map +1 -0
- package/dist/accounts-QNE5QWBG.js +701 -0
- package/dist/accounts-QNE5QWBG.js.map +1 -0
- package/dist/actions-D7OWCP36.js +55 -0
- package/dist/activecampaign-LBS4M4C4.js +938 -0
- package/dist/activecampaign-LBS4M4C4.js.map +1 -0
- package/dist/ad-group-writes-CJTTUUIT.js +172 -0
- package/dist/ad-group-writes-CJTTUUIT.js.map +1 -0
- package/dist/ad-groups-HLGSVH74.js +70 -0
- package/dist/ad-groups-HLGSVH74.js.map +1 -0
- package/dist/ad-writes-3UE3U7VE.js +176 -0
- package/dist/ad-writes-3UE3U7VE.js.map +1 -0
- package/dist/add-HFQB2NTU.js +107 -0
- package/dist/add-HFQB2NTU.js.map +1 -0
- package/dist/add-IUYE5H6A.js +305 -0
- package/dist/add-IUYE5H6A.js.map +1 -0
- package/dist/ads-HLUJB5SQ.js +48 -0
- package/dist/ads-MAOI7S6V.js +115 -0
- package/dist/ads-PYNDMHUD.js +79 -0
- package/dist/ads-PYNDMHUD.js.map +1 -0
- package/dist/adsets-QRKICEFD.js +182 -0
- package/dist/advertisers-XXM6POO5.js +123 -0
- package/dist/advertisers-XXM6POO5.js.map +1 -0
- package/dist/analytics-AULKYNNT.js +447 -0
- package/dist/analytics-AULKYNNT.js.map +1 -0
- package/dist/analytics-DNDTC643.js +2437 -0
- package/dist/analytics-DNDTC643.js.map +1 -0
- package/dist/asset-writes-JLVUAVUZ.js +50 -0
- package/dist/assign-2GQVQKKO.js +80 -0
- package/dist/assign-2GQVQKKO.js.map +1 -0
- package/dist/audience-size-C3YHQPZB.js +76 -0
- package/dist/audience-size-C3YHQPZB.js.map +1 -0
- package/dist/audience-writes-CDKQB3SM.js +327 -0
- package/dist/audience-writes-CDKQB3SM.js.map +1 -0
- package/dist/audiences-CDDI5HR5.js +86 -0
- package/dist/audiences-M3A3QK52.js +280 -0
- package/dist/audiences-M3A3QK52.js.map +1 -0
- package/dist/audit-FLPJ7GTE.js +154 -0
- package/dist/audit-FLPJ7GTE.js.map +1 -0
- package/dist/autocomplete-ZYMHHV7E.js +114 -0
- package/dist/autocomplete-ZYMHHV7E.js.map +1 -0
- package/dist/avatars-WZ2JDMHH.js +38 -0
- package/dist/bid-pricing-H3M63PTW.js +103 -0
- package/dist/bid-pricing-H3M63PTW.js.map +1 -0
- package/dist/brand-IZTTBZII.js +22 -0
- package/dist/brief-OPQ7ICOY.js +543 -0
- package/dist/brief-OPQ7ICOY.js.map +1 -0
- package/dist/campaign-groups-IQSDKOVI.js +99 -0
- package/dist/campaign-groups-IQSDKOVI.js.map +1 -0
- package/dist/campaign-writes-APAAV4ZU.js +168 -0
- package/dist/campaign-writes-APAAV4ZU.js.map +1 -0
- package/dist/campaign-writes-BN4PZP4Z.js +176 -0
- package/dist/campaign-writes-BN4PZP4Z.js.map +1 -0
- package/dist/campaigns-4Y3JQC2U.js +111 -0
- package/dist/campaigns-GA34MEN2.js +78 -0
- package/dist/campaigns-GA34MEN2.js.map +1 -0
- package/dist/campaigns-HES5MDUG.js +130 -0
- package/dist/campaigns-K2FVD3XW.js +113 -0
- package/dist/campaigns-K2FVD3XW.js.map +1 -0
- package/dist/canvas-IQ753Q2O.js +46 -0
- package/dist/capabilities-ZITW4RF7.js +147 -0
- package/dist/capabilities-ZITW4RF7.js.map +1 -0
- package/dist/catalogs-TGLSJEK5.js +781 -0
- package/dist/catalogs-TGLSJEK5.js.map +1 -0
- package/dist/catalogs-ZR7DECMG.js +130 -0
- package/dist/catalogs-ZR7DECMG.js.map +1 -0
- package/dist/changes-VWKTM27U.js +135 -0
- package/dist/chatgpt-OPOD2WHB.js +47 -0
- package/dist/chats-AL2SYBJO.js +279 -0
- package/dist/chats-AL2SYBJO.js.map +1 -0
- package/dist/check-U2YLRD6H.js +107 -0
- package/dist/check-U2YLRD6H.js.map +1 -0
- package/dist/chunk-2GYCWRF3.js +170 -0
- package/dist/chunk-2L7F7KR4.js +61 -0
- package/dist/chunk-44ZRCSR7.js +228 -0
- package/dist/chunk-46YLDIQG.js +4254 -0
- package/dist/chunk-4EDWXZ3I.js +363 -0
- package/dist/chunk-4FFBGR5L.js +66 -0
- package/dist/chunk-4UQRXKYJ.js +219 -0
- package/dist/chunk-4UZUUSVL.js +592 -0
- package/dist/chunk-4XHCEYHI.js +831 -0
- package/dist/chunk-4Z6PVR3M.js +479 -0
- package/dist/chunk-5Y5FZV2W.js +122 -0
- package/dist/chunk-6HJXLGDV.js +392 -0
- package/dist/chunk-6S5CWGDA.js +429 -0
- package/dist/chunk-6VYROVWO.js +494 -0
- package/dist/chunk-7BUIOP36.js +287 -0
- package/dist/chunk-AQRXXC6E.js +319 -0
- package/dist/chunk-ARBXT73X.js +387 -0
- package/dist/chunk-BEZHQIEI.js +97 -0
- package/dist/chunk-BFURWHVR.js +547 -0
- package/dist/chunk-BX6B25KK.js +358 -0
- package/dist/chunk-BX6B25KK.js.map +1 -0
- package/dist/chunk-DSCEXBDR.js +676 -0
- package/dist/chunk-FLWDFPXE.js +23 -0
- package/dist/chunk-FRNBRN2C.js +1646 -0
- package/dist/chunk-G4FG5EQO.js +110 -0
- package/dist/chunk-G4FG5EQO.js.map +1 -0
- package/dist/chunk-GE3VT3CA.js +51 -0
- package/dist/chunk-GW2WRZZA.js +24026 -0
- package/dist/chunk-GW2WRZZA.js.map +1 -0
- package/dist/chunk-HGBJQGO5.js +142 -0
- package/dist/chunk-I7AYMJZA.js +783 -0
- package/dist/chunk-IRM273C7.js +207 -0
- package/dist/chunk-IWKD56AY.js +156 -0
- package/dist/chunk-JLAQWMVF.js +3868 -0
- package/dist/chunk-JOE42ZW6.js +2984 -0
- package/dist/chunk-JOE42ZW6.js.map +1 -0
- package/dist/chunk-K6NULQN7.js +57 -0
- package/dist/chunk-L2BRAC2J.js +19 -0
- package/dist/chunk-LGMI4LSY.js +455 -0
- package/dist/chunk-NB2FU6EZ.js +179 -0
- package/dist/chunk-NKQWDEB7.js +115 -0
- package/dist/chunk-NKQWDEB7.js.map +1 -0
- package/dist/chunk-NWF2LRKO.js +188 -0
- package/dist/chunk-OG47L5GG.js +275 -0
- package/dist/chunk-OR6KVLI5.js +169 -0
- package/dist/chunk-PC3FJEZH.js +7211 -0
- package/dist/chunk-PC3FJEZH.js.map +1 -0
- package/dist/chunk-Q3GSVLE5.js +4274 -0
- package/dist/chunk-Q3GSVLE5.js.map +1 -0
- package/dist/chunk-QDQZ62FL.js +207 -0
- package/dist/chunk-QIOFOD4K.js +344 -0
- package/dist/chunk-R2SYF5FC.js +249 -0
- package/dist/chunk-RTH2I55B.js +942 -0
- package/dist/chunk-S6VFDNSQ.js +63 -0
- package/dist/chunk-SG2TDQEE.js +150 -0
- package/dist/chunk-SOPVIIUW.js +68 -0
- package/dist/chunk-SOPVIIUW.js.map +1 -0
- package/dist/chunk-T3P6O2VU.js +89 -0
- package/dist/chunk-TXDE2QJ3.js +604 -0
- package/dist/chunk-UDIEKCIR.js +203 -0
- package/dist/chunk-USCADMM3.js +163 -0
- package/dist/chunk-UUGISMNE.js +910 -0
- package/dist/chunk-VDPOCAQ2.js +197 -0
- package/dist/chunk-VEJ3QX6M.js +103 -0
- package/dist/chunk-VFJB7OG6.js +91 -0
- package/dist/chunk-VRIPVLE7.js +8954 -0
- package/dist/chunk-WFY7KSHB.js +274 -0
- package/dist/chunk-WLESMH4J.js +45 -0
- package/dist/chunk-XHQYFNNK.js +846 -0
- package/dist/chunk-XOQNM7I4.js +396 -0
- package/dist/chunk-XOQNM7I4.js.map +1 -0
- package/dist/chunk-YILZR3XI.js +224 -0
- package/dist/chunk-YJFLXOH4.js +191 -0
- package/dist/chunk-YWHZYR6S.js +297 -0
- package/dist/claim-GOLUTAJ3.js +200 -0
- package/dist/claim-GOLUTAJ3.js.map +1 -0
- package/dist/cli.js +30 -30
- package/dist/companies-4AJJGTMC.js +198 -0
- package/dist/companies-4AJJGTMC.js.map +1 -0
- package/dist/company-MOSPLRZJ.js +308 -0
- package/dist/company-MOSPLRZJ.js.map +1 -0
- package/dist/complete-777BDV45.js +84 -0
- package/dist/complete-777BDV45.js.map +1 -0
- package/dist/connect-3YY7MF3I.js +45 -0
- package/dist/conversation-KROMHDHK.js +96 -0
- package/dist/conversation-KROMHDHK.js.map +1 -0
- package/dist/conversion-report-JZHI2IHY.js +127 -0
- package/dist/conversion-report-JZHI2IHY.js.map +1 -0
- package/dist/conversion-upload-command-7RSZ5ZQU.js +439 -0
- package/dist/conversion-writes-SNCLQDXQ.js +122 -0
- package/dist/conversion-writes-SNCLQDXQ.js.map +1 -0
- package/dist/conversions-43EYP2W2.js +140 -0
- package/dist/conversions-43EYP2W2.js.map +1 -0
- package/dist/conversions-EUOWILCQ.js +78 -0
- package/dist/conversions-EUOWILCQ.js.map +1 -0
- package/dist/copy-writes-CIHIFLY6.js +170 -0
- package/dist/copy-writes-CIHIFLY6.js.map +1 -0
- package/dist/create-3WOZO2XT.js +239 -0
- package/dist/create-3WOZO2XT.js.map +1 -0
- package/dist/create-7IFYLX7P.js +210 -0
- package/dist/create-7IFYLX7P.js.map +1 -0
- package/dist/create-FOHIQC3E.js +62 -0
- package/dist/create-FOHIQC3E.js.map +1 -0
- package/dist/create-UWQSQTK6.js +135 -0
- package/dist/create-UWQSQTK6.js.map +1 -0
- package/dist/creatives-2DR3QHJW.js +58 -0
- package/dist/creatives-BB6S2OF6.js +89 -0
- package/dist/creatives-KUO67WYA.js +223 -0
- package/dist/creatives-KUO67WYA.js.map +1 -0
- package/dist/credentials-IP4L37XP.js +290 -0
- package/dist/credentials-IP4L37XP.js.map +1 -0
- package/dist/critique-LGDNMLBL.js +232 -0
- package/dist/critique-LGDNMLBL.js.map +1 -0
- package/dist/critique-LJMFAURK.js +1451 -0
- package/dist/critique-LJMFAURK.js.map +1 -0
- package/dist/crm-BNYW7PF7.js +323 -0
- package/dist/crm-BNYW7PF7.js.map +1 -0
- package/dist/crm-J53V2QTN.js +227 -0
- package/dist/crm-J53V2QTN.js.map +1 -0
- package/dist/currency-X7Y6TSLF.js +88 -0
- package/dist/custom-conversions-HAGG72LF.js +128 -0
- package/dist/customers-663K2OCP.js +59 -0
- package/dist/delete-5W3YVA4L.js +67 -0
- package/dist/delete-5W3YVA4L.js.map +1 -0
- package/dist/delete-6U7E6YUW.js +57 -0
- package/dist/delete-6U7E6YUW.js.map +1 -0
- package/dist/delete-G4NY6ZG6.js +69 -0
- package/dist/delete-G4NY6ZG6.js.map +1 -0
- package/dist/demographics-4Y5LTCU4.js +141 -0
- package/dist/demographics-4Y5LTCU4.js.map +1 -0
- package/dist/discard-RKCZNKMN.js +69 -0
- package/dist/discard-RKCZNKMN.js.map +1 -0
- package/dist/discover-6DORQWXY.js +172 -0
- package/dist/domain-PLA2O4FW.js +101 -0
- package/dist/domain-PLA2O4FW.js.map +1 -0
- package/dist/download-4EFLVSA4.js +172 -0
- package/dist/download-4EFLVSA4.js.map +1 -0
- package/dist/draft-4V7W5DV2.js +310 -0
- package/dist/draft-4V7W5DV2.js.map +1 -0
- package/dist/draft-HY3U2GHU.js +283 -0
- package/dist/draft-HY3U2GHU.js.map +1 -0
- package/dist/draft-JMNAGW7C.js +220 -0
- package/dist/draft-JMNAGW7C.js.map +1 -0
- package/dist/draft-R6EKORNS.js +308 -0
- package/dist/draft-TRPQCJ4B.js +335 -0
- package/dist/draft-TRPQCJ4B.js.map +1 -0
- package/dist/experiments-4V242DG2.js +236 -0
- package/dist/experiments-4V242DG2.js.map +1 -0
- package/dist/facets-WXJ2MCU6.js +117 -0
- package/dist/facets-WXJ2MCU6.js.map +1 -0
- package/dist/feedback-IRSRPXV6.js +111 -0
- package/dist/feedback-IRSRPXV6.js.map +1 -0
- package/dist/feedback-record-DT3R4NA3.js +265 -0
- package/dist/feedback-record-DT3R4NA3.js.map +1 -0
- package/dist/fetch-YLQP5VQL.js +179 -0
- package/dist/fetch-YLQP5VQL.js.map +1 -0
- package/dist/fit-BEFCY2B4.js +65 -0
- package/dist/flows-FDMF3F3P.js +250 -0
- package/dist/flows-FDMF3F3P.js.map +1 -0
- package/dist/fonts-C6XN5667.js +39 -0
- package/dist/forecast-BTPIXEQ5.js +169 -0
- package/dist/forecast-ZTXZD3HD.js +121 -0
- package/dist/forecast-ZTXZD3HD.js.map +1 -0
- package/dist/funnel-7KOEX7YM.js +397 -0
- package/dist/funnel-7KOEX7YM.js.map +1 -0
- package/dist/get-KBSKPTAV.js +59 -0
- package/dist/get-KBSKPTAV.js.map +1 -0
- package/dist/get-OSVQVMP6.js +82 -0
- package/dist/get-OSVQVMP6.js.map +1 -0
- package/dist/google-M6BJ22UL.js +3267 -0
- package/dist/google-ads-XCJVAXWF.js +198 -0
- package/dist/google-ads-XCJVAXWF.js.map +1 -0
- package/dist/history-3NTM5SFN.js +69 -0
- package/dist/history-3NTM5SFN.js.map +1 -0
- package/dist/history-4TN2A6BL.js +136 -0
- package/dist/history-4TN2A6BL.js.map +1 -0
- package/dist/history-5IWW2X33.js +102 -0
- package/dist/history-5IWW2X33.js.map +1 -0
- package/dist/hubspot-HMVSRJQZ.js +782 -0
- package/dist/hubspot-HMVSRJQZ.js.map +1 -0
- package/dist/ideas-M66FU45H.js +45 -0
- package/dist/images-MM5OPUKV.js +92 -0
- package/dist/ingest-GU3WEBN3.js +110 -0
- package/dist/ingest-GU3WEBN3.js.map +1 -0
- package/dist/ingest-KMLYCFF4.js +26 -0
- package/dist/insights-CQCWOCIT.js +132 -0
- package/dist/insights-CQCWOCIT.js.map +1 -0
- package/dist/insights-XZL2EM53.js +439 -0
- package/dist/insights-XZL2EM53.js.map +1 -0
- package/dist/inspect-4JO2J3D6.js +192 -0
- package/dist/inspect-4JO2J3D6.js.map +1 -0
- package/dist/instant-experiences-RM4MLJTL.js +260 -0
- package/dist/instant-experiences-RM4MLJTL.js.map +1 -0
- package/dist/intent-YCQCUCV3.js +95 -0
- package/dist/keyword-gap-PUSF7EKY.js +130 -0
- package/dist/keyword-metrics-JXBM22ZD.js +200 -0
- package/dist/keyword-metrics-JXBM22ZD.js.map +1 -0
- package/dist/keywords-for-site-OAYA7KP7.js +131 -0
- package/dist/keywords-for-site-OAYA7KP7.js.map +1 -0
- package/dist/landing-OZU5RRFV.js +28 -0
- package/dist/languages-SLFV73GE.js +40 -0
- package/dist/leads-Q7APIJRQ.js +115 -0
- package/dist/leads-Q7APIJRQ.js.map +1 -0
- package/dist/leads-ULYHTG22.js +540 -0
- package/dist/leads-ULYHTG22.js.map +1 -0
- package/dist/learn-NBBJRMVZ.js +207 -0
- package/dist/learn-NBBJRMVZ.js.map +1 -0
- package/dist/line-item-writes-X3L5NQEH.js +211 -0
- package/dist/line-item-writes-X3L5NQEH.js.map +1 -0
- package/dist/line-items-NJMEPEF5.js +107 -0
- package/dist/link-WZSNUQQ2.js +67 -0
- package/dist/link-WZSNUQQ2.js.map +1 -0
- package/dist/linkedin-55PAID62.js +1316 -0
- package/dist/linkedin-55PAID62.js.map +1 -0
- package/dist/linkedin-person-MVRI7LLC.js +139 -0
- package/dist/linkedin-person-MVRI7LLC.js.map +1 -0
- package/dist/list-6S54IAUX.js +67 -0
- package/dist/list-6S54IAUX.js.map +1 -0
- package/dist/list-QRJ4E3SC.js +154 -0
- package/dist/list-QRJ4E3SC.js.map +1 -0
- package/dist/list-RZUDFLJN.js +306 -0
- package/dist/list-RZUDFLJN.js.map +1 -0
- package/dist/locations-T2OMP6QN.js +40 -0
- package/dist/locations-W3VOYBWL.js +69 -0
- package/dist/locations-W3VOYBWL.js.map +1 -0
- package/dist/log-53SAPZZ3.js +95 -0
- package/dist/log-53SAPZZ3.js.map +1 -0
- package/dist/lookup-S5VG7AWH.js +23 -0
- package/dist/make-ZF3YIMKW.js +1370 -0
- package/dist/make-ZF3YIMKW.js.map +1 -0
- package/dist/map-J37QFJSV.js +436 -0
- package/dist/map-J37QFJSV.js.map +1 -0
- package/dist/mcp-YRIFPYNU.js +717 -0
- package/dist/mcp-YRIFPYNU.js.map +1 -0
- package/dist/media-P4T4ZBNS.js +18 -0
- package/dist/media-sources-EQI3U4TC.js +35 -0
- package/dist/members-GYVMSCKL.js +47 -0
- package/dist/members-GYVMSCKL.js.map +1 -0
- package/dist/meta-IPLWNYC7.js +122 -0
- package/dist/metrics-4YVJHYRI.js +152 -0
- package/dist/normalize-MFN3WCH5.js +144 -0
- package/dist/normalize-MFN3WCH5.js.map +1 -0
- package/dist/options-DLHDHO7H.js +125 -0
- package/dist/options-DLHDHO7H.js.map +1 -0
- package/dist/organization-C2VOA2SD.js +949 -0
- package/dist/organization-C2VOA2SD.js.map +1 -0
- package/dist/page-photos-OQ5QATQH.js +118 -0
- package/dist/page-photos-OQ5QATQH.js.map +1 -0
- package/dist/performance-NIF3CESZ.js +27 -0
- package/dist/performance-T6TBVHVU.js +5541 -0
- package/dist/performance-T6TBVHVU.js.map +1 -0
- package/dist/pixels-LQAJOZIM.js +62 -0
- package/dist/pixels-LQAJOZIM.js.map +1 -0
- package/dist/plan-7UF76Q6U.js +208 -0
- package/dist/plan-7UF76Q6U.js.map +1 -0
- package/dist/preview-LRJOQ7LM.js +218 -0
- package/dist/preview-LRJOQ7LM.js.map +1 -0
- package/dist/promoted-tweet-writes-Y6BBOWDL.js +183 -0
- package/dist/promoted-tweet-writes-Y6BBOWDL.js.map +1 -0
- package/dist/promoted-tweets-RJT53DRM.js +119 -0
- package/dist/publish-IOTMJCCY.js +344 -0
- package/dist/publish-IOTMJCCY.js.map +1 -0
- package/dist/query-XZMDGRO5.js +62 -0
- package/dist/questionnaire-DWEH5II4.js +94 -0
- package/dist/questionnaire-DWEH5II4.js.map +1 -0
- package/dist/reddit-JIHMAKAQ.js +29 -0
- package/dist/refresh-OQZ263CS.js +97 -0
- package/dist/refresh-OQZ263CS.js.map +1 -0
- package/dist/release-4CHFURO3.js +63 -0
- package/dist/release-4CHFURO3.js.map +1 -0
- package/dist/relevant-pages-FS7GBVXK.js +99 -0
- package/dist/remove-IJQPHPDI.js +53 -0
- package/dist/remove-IJQPHPDI.js.map +1 -0
- package/dist/reopen-YTLPVKUR.js +66 -0
- package/dist/reopen-YTLPVKUR.js.map +1 -0
- package/dist/rerun-C7NB7B35.js +95 -0
- package/dist/rerun-C7NB7B35.js.map +1 -0
- package/dist/research-PNBACCCP.js +72 -0
- package/dist/research-TLHNPK3O.js +265 -0
- package/dist/research-TLHNPK3O.js.map +1 -0
- package/dist/reset-JVLW7HA2.js +57 -0
- package/dist/reset-JVLW7HA2.js.map +1 -0
- package/dist/reset-Y6FXLAQE.js +57 -0
- package/dist/reset-Y6FXLAQE.js.map +1 -0
- package/dist/resolve-YLRESES5.js +124 -0
- package/dist/resolve-YLRESES5.js.map +1 -0
- package/dist/retry-3V3IGDRR.js +65 -0
- package/dist/retry-3V3IGDRR.js.map +1 -0
- package/dist/retry-AEKQLQMP.js +63 -0
- package/dist/retry-AEKQLQMP.js.map +1 -0
- package/dist/revenue-E4GQIOUY.js +91 -0
- package/dist/revenue-E4GQIOUY.js.map +1 -0
- package/dist/rule-writes-UAVWT4XS.js +525 -0
- package/dist/rule-writes-UAVWT4XS.js.map +1 -0
- package/dist/rules-34BQAWU3.js +99 -0
- package/dist/rules-34BQAWU3.js.map +1 -0
- package/dist/rules-ZVS2MWED.js +217 -0
- package/dist/rules-add-CM5XUYNS.js +465 -0
- package/dist/rules-add-CM5XUYNS.js.map +1 -0
- package/dist/run-MD64RDHZ.js +69 -0
- package/dist/run-MD64RDHZ.js.map +1 -0
- package/dist/run-QCNRR3CA.js +70 -0
- package/dist/scaffold-ad-NADPY3CB.js +1516 -0
- package/dist/scaffold-ad-NADPY3CB.js.map +1 -0
- package/dist/scaffold-static-ad-5YEYYVYH.js +1015 -0
- package/dist/scaffold-static-ad-5YEYYVYH.js.map +1 -0
- package/dist/scaffold-video-W7DF2CBJ.js +888 -0
- package/dist/scaffold-video-W7DF2CBJ.js.map +1 -0
- package/dist/schedule-CTRRF6TS.js +64 -0
- package/dist/schedule-CTRRF6TS.js.map +1 -0
- package/dist/scheduled-agents-OXYAVSIE.js +55 -0
- package/dist/schema-BEUYOGSW.js +135 -0
- package/dist/schema-BEUYOGSW.js.map +1 -0
- package/dist/search-GFJKWPKN.js +177 -0
- package/dist/search-GFJKWPKN.js.map +1 -0
- package/dist/select-S72CCL57.js +106 -0
- package/dist/select-S72CCL57.js.map +1 -0
- package/dist/sends-LAY5C74B.js +349 -0
- package/dist/sends-LAY5C74B.js.map +1 -0
- package/dist/set-prompt-YYFDRXRI.js +198 -0
- package/dist/set-prompt-YYFDRXRI.js.map +1 -0
- package/dist/setup-links-D4JJLESN.js +144 -0
- package/dist/setup-links-D4JJLESN.js.map +1 -0
- package/dist/shopify-T4UWFIQC.js +3958 -0
- package/dist/shopify-T4UWFIQC.js.map +1 -0
- package/dist/site-BBZAUZA3.js +180 -0
- package/dist/site-BBZAUZA3.js.map +1 -0
- package/dist/sources-BUPV7H7F.js +457 -0
- package/dist/sources-BUPV7H7F.js.map +1 -0
- package/dist/sources-FLUGHSVP.js +30 -0
- package/dist/stale-HP54JS5X.js +76 -0
- package/dist/stale-HP54JS5X.js.map +1 -0
- package/dist/status-CLSWQFCQ.js +65 -0
- package/dist/status-CLSWQFCQ.js.map +1 -0
- package/dist/studies-EPO2AM4M.js +250 -0
- package/dist/study-writes-7FP443QQ.js +470 -0
- package/dist/study-writes-7FP443QQ.js.map +1 -0
- package/dist/sync-4YTVVEVC.js +57 -0
- package/dist/sync-4YTVVEVC.js.map +1 -0
- package/dist/sync-definition-OGQ5XTQE.js +69 -0
- package/dist/tags-CZTRQNXV.js +26 -0
- package/dist/tags-FDQXWTCQ.js +23 -0
- package/dist/tags-FDQXWTCQ.js.map +1 -0
- package/dist/tags-R67DKRZ6.js +23 -0
- package/dist/tags-R67DKRZ6.js.map +1 -0
- package/dist/tags-SA2LU6AW.js +227 -0
- package/dist/tags-SA2LU6AW.js.map +1 -0
- package/dist/tags-ZOXX6VRE.js +23 -0
- package/dist/tags-ZOXX6VRE.js.map +1 -0
- package/dist/targeting-NKZFEZD7.js +762 -0
- package/dist/targeting-NKZFEZD7.js.map +1 -0
- package/dist/targeting-criteria-AQYXVSGN.js +113 -0
- package/dist/targets-UUVCEG3F.js +106 -0
- package/dist/targets-UUVCEG3F.js.map +1 -0
- package/dist/testimonials-G3OCNPBY.js +32 -0
- package/dist/themes-FEVYZZCW.js +95 -0
- package/dist/top-companies-BQGWKYUK.js +111 -0
- package/dist/top-companies-BQGWKYUK.js.map +1 -0
- package/dist/transcript-U46AEOEI.js +165 -0
- package/dist/transcript-U46AEOEI.js.map +1 -0
- package/dist/translate-AS7JVKYM.js +609 -0
- package/dist/translate-AS7JVKYM.js.map +1 -0
- package/dist/triggers-ECRBPYYF.js +144 -0
- package/dist/triggers-ECRBPYYF.js.map +1 -0
- package/dist/unlink-VDNCSRJV.js +70 -0
- package/dist/unlink-VDNCSRJV.js.map +1 -0
- package/dist/unstage-ATDXUYP2.js +88 -0
- package/dist/unstage-ATDXUYP2.js.map +1 -0
- package/dist/unstage-ZA3WQBEA.js +96 -0
- package/dist/unstage-ZA3WQBEA.js.map +1 -0
- package/dist/update-FJ6TBV3E.js +101 -0
- package/dist/update-FJ6TBV3E.js.map +1 -0
- package/dist/update-HDBJCSTI.js +66 -0
- package/dist/update-HDBJCSTI.js.map +1 -0
- package/dist/update-U43DJRGV.js +155 -0
- package/dist/update-U43DJRGV.js.map +1 -0
- package/dist/update-Z7TIUBMJ.js +192 -0
- package/dist/update-Z7TIUBMJ.js.map +1 -0
- package/dist/upload-LXCFSRIU.js +129 -0
- package/dist/upload-LXCFSRIU.js.map +1 -0
- package/dist/url-options-Z4BQBEMI.js +131 -0
- package/dist/url-options-Z4BQBEMI.js.map +1 -0
- package/dist/url-params-J7RKP5RB.js +101 -0
- package/dist/url-params-J7RKP5RB.js.map +1 -0
- package/dist/validate-VR3HEOMJ.js +122 -0
- package/dist/validate-VR3HEOMJ.js.map +1 -0
- package/dist/videos-36AXDUGZ.js +41 -0
- package/dist/viewer-check-6HL4OUQY.js +83 -0
- package/dist/web-7BRJRQX7.js +143 -0
- package/dist/web-7BRJRQX7.js.map +1 -0
- package/dist/winning-ads-GMM5W2O4.js +86 -0
- package/dist/write-commands-IM5DPG3R.js +1502 -0
- package/dist/write-commands-IM5DPG3R.js.map +1 -0
- package/dist/write-commands-OGVDWWBV.js +1172 -0
- package/dist/write-commands-OGVDWWBV.js.map +1 -0
- package/dist/x-HGFAL3NY.js +47 -0
- package/package.json +1 -1
- package/dist/account-UUAEQWO3.js +0 -80
- package/dist/account-UUAEQWO3.js.map +0 -1
- package/dist/account-WLQBAQMD.js +0 -80
- package/dist/account-WLQBAQMD.js.map +0 -1
- package/dist/account-assets-O7IA37RE.js +0 -290
- package/dist/account-level-EU7BWCO7.js +0 -609
- package/dist/account-level-EU7BWCO7.js.map +0 -1
- package/dist/account-reads-SNOWDHHF.js +0 -219
- package/dist/account-users-NV37Z2XJ.js +0 -62
- package/dist/account-users-NV37Z2XJ.js.map +0 -1
- package/dist/account-writes-TU3WJRSI.js +0 -66
- package/dist/account-writes-TU3WJRSI.js.map +0 -1
- package/dist/accounts-MZ6SETJJ.js +0 -78
- package/dist/accounts-MZ6SETJJ.js.map +0 -1
- package/dist/accounts-U7ZBEAY6.js +0 -699
- package/dist/accounts-U7ZBEAY6.js.map +0 -1
- package/dist/actions-4JYHXRFH.js +0 -55
- package/dist/activecampaign-IDBV26HH.js +0 -936
- package/dist/activecampaign-IDBV26HH.js.map +0 -1
- package/dist/ad-group-writes-HLBWN4E4.js +0 -170
- package/dist/ad-group-writes-HLBWN4E4.js.map +0 -1
- package/dist/ad-groups-33NZD6J3.js +0 -68
- package/dist/ad-groups-33NZD6J3.js.map +0 -1
- package/dist/ad-writes-7ZDNDZ2E.js +0 -174
- package/dist/ad-writes-7ZDNDZ2E.js.map +0 -1
- package/dist/add-AF42LQQQ.js +0 -105
- package/dist/add-AF42LQQQ.js.map +0 -1
- package/dist/add-LJRZYJ7I.js +0 -303
- package/dist/add-LJRZYJ7I.js.map +0 -1
- package/dist/ads-KBE5JXCH.js +0 -115
- package/dist/ads-LXWXOQHX.js +0 -48
- package/dist/ads-X3AM6M7L.js +0 -77
- package/dist/ads-X3AM6M7L.js.map +0 -1
- package/dist/adsets-YWBJFPAZ.js +0 -182
- package/dist/advertisers-6FOCN2W3.js +0 -121
- package/dist/advertisers-6FOCN2W3.js.map +0 -1
- package/dist/analytics-64HBRJJE.js +0 -2435
- package/dist/analytics-64HBRJJE.js.map +0 -1
- package/dist/analytics-VY5NL2GL.js +0 -445
- package/dist/analytics-VY5NL2GL.js.map +0 -1
- package/dist/asset-writes-72DEVXGO.js +0 -48
- package/dist/assign-N2I2BM67.js +0 -78
- package/dist/assign-N2I2BM67.js.map +0 -1
- package/dist/audience-size-H5DEZXJN.js +0 -74
- package/dist/audience-size-H5DEZXJN.js.map +0 -1
- package/dist/audience-writes-KCHLNFSI.js +0 -325
- package/dist/audience-writes-KCHLNFSI.js.map +0 -1
- package/dist/audiences-QAH42HIM.js +0 -86
- package/dist/audiences-WCDWN64L.js +0 -268
- package/dist/audiences-WCDWN64L.js.map +0 -1
- package/dist/audit-2AAF6AOX.js +0 -152
- package/dist/audit-2AAF6AOX.js.map +0 -1
- package/dist/autocomplete-3GSKRNCZ.js +0 -112
- package/dist/autocomplete-3GSKRNCZ.js.map +0 -1
- package/dist/avatars-N6W6HUPP.js +0 -38
- package/dist/bid-pricing-IMITXHXN.js +0 -101
- package/dist/bid-pricing-IMITXHXN.js.map +0 -1
- package/dist/brand-ITWQVZD2.js +0 -22
- package/dist/brief-JJNEYPYB.js +0 -541
- package/dist/brief-JJNEYPYB.js.map +0 -1
- package/dist/campaign-groups-TTQLP32Q.js +0 -97
- package/dist/campaign-groups-TTQLP32Q.js.map +0 -1
- package/dist/campaign-writes-MAKPHQ3V.js +0 -166
- package/dist/campaign-writes-MAKPHQ3V.js.map +0 -1
- package/dist/campaign-writes-XO74BALZ.js +0 -174
- package/dist/campaign-writes-XO74BALZ.js.map +0 -1
- package/dist/campaigns-5BIDXYSR.js +0 -111
- package/dist/campaigns-LS65QM6W.js +0 -76
- package/dist/campaigns-LS65QM6W.js.map +0 -1
- package/dist/campaigns-XZOQ2VTK.js +0 -130
- package/dist/campaigns-XZPXCS7I.js +0 -111
- package/dist/campaigns-XZPXCS7I.js.map +0 -1
- package/dist/canvas-SL3RMOY5.js +0 -46
- package/dist/capabilities-LSR5GCE6.js +0 -145
- package/dist/capabilities-LSR5GCE6.js.map +0 -1
- package/dist/catalogs-JLCSFZYC.js +0 -779
- package/dist/catalogs-JLCSFZYC.js.map +0 -1
- package/dist/catalogs-T23RKYFC.js +0 -128
- package/dist/catalogs-T23RKYFC.js.map +0 -1
- package/dist/changes-36C754R4.js +0 -135
- package/dist/chatgpt-3WFOPURY.js +0 -47
- package/dist/chats-GGYTXNJS.js +0 -277
- package/dist/chats-GGYTXNJS.js.map +0 -1
- package/dist/check-P7UPBBG7.js +0 -105
- package/dist/check-P7UPBBG7.js.map +0 -1
- package/dist/chunk-2TOIY2WN.js +0 -4254
- package/dist/chunk-4D46PS6J.js +0 -344
- package/dist/chunk-4GAEB6NK.js +0 -228
- package/dist/chunk-5XTGG4PV.js +0 -274
- package/dist/chunk-6JCX3YLM.js +0 -249
- package/dist/chunk-7J3NZBPV.js +0 -2982
- package/dist/chunk-7J3NZBPV.js.map +0 -1
- package/dist/chunk-ALMYGH5U.js +0 -479
- package/dist/chunk-AQKRSEBQ.js +0 -103
- package/dist/chunk-BL6RTOK3.js +0 -297
- package/dist/chunk-C6CBBZBO.js +0 -203
- package/dist/chunk-CCEDZTP7.js +0 -391
- package/dist/chunk-CCEDZTP7.js.map +0 -1
- package/dist/chunk-CKQTJ2LV.js +0 -89
- package/dist/chunk-D3KLDIPQ.js +0 -45
- package/dist/chunk-DL2UJNJ7.js +0 -8954
- package/dist/chunk-DQ54POZN.js +0 -363
- package/dist/chunk-EDLZGTGN.js +0 -216
- package/dist/chunk-EDLZGTGN.js.map +0 -1
- package/dist/chunk-EXSHBYNQ.js +0 -349
- package/dist/chunk-EXSHBYNQ.js.map +0 -1
- package/dist/chunk-FFFJBNHA.js +0 -63
- package/dist/chunk-FKQK22IX.js +0 -51
- package/dist/chunk-FLK6QHOY.js +0 -142
- package/dist/chunk-GACSA5A6.js +0 -1646
- package/dist/chunk-HJKYTNAZ.js +0 -61
- package/dist/chunk-INUU3752.js +0 -392
- package/dist/chunk-IQHO2ABF.js +0 -197
- package/dist/chunk-J3UWMBOP.js +0 -547
- package/dist/chunk-JDR3HUEL.js +0 -191
- package/dist/chunk-JI77AKT6.js +0 -19
- package/dist/chunk-JNURZHZJ.js +0 -942
- package/dist/chunk-JSNMKTFM.js +0 -592
- package/dist/chunk-K4FLWDEX.js +0 -122
- package/dist/chunk-KBRJSPIM.js +0 -676
- package/dist/chunk-LAC6YHHX.js +0 -97
- package/dist/chunk-M7HD42M6.js +0 -24017
- package/dist/chunk-M7HD42M6.js.map +0 -1
- package/dist/chunk-MGYC2IRC.js +0 -783
- package/dist/chunk-MI4HXE7M.js +0 -23
- package/dist/chunk-MJ7RNDD4.js +0 -910
- package/dist/chunk-OBJCNGZL.js +0 -207
- package/dist/chunk-OJGYYH6K.js +0 -179
- package/dist/chunk-OLBLXJNI.js +0 -224
- package/dist/chunk-PFTYKINE.js +0 -207
- package/dist/chunk-PLBITHV6.js +0 -846
- package/dist/chunk-Q6JMMBSQ.js +0 -831
- package/dist/chunk-RAQHUMKS.js +0 -169
- package/dist/chunk-SA22KXWT.js +0 -163
- package/dist/chunk-SIXU5PDF.js +0 -66
- package/dist/chunk-SXMK5AEJ.js +0 -494
- package/dist/chunk-TTLD66NI.js +0 -319
- package/dist/chunk-TVAIOC77.js +0 -287
- package/dist/chunk-TVTSA4EN.js +0 -188
- package/dist/chunk-V5NHJU3M.js +0 -604
- package/dist/chunk-VIPKDXGU.js +0 -4229
- package/dist/chunk-VIPKDXGU.js.map +0 -1
- package/dist/chunk-W4D7C74B.js +0 -387
- package/dist/chunk-WF25CCLD.js +0 -170
- package/dist/chunk-WQPUX3BA.js +0 -275
- package/dist/chunk-WR3FR3K3.js +0 -156
- package/dist/chunk-XDNJC62G.js +0 -91
- package/dist/chunk-XE6N4SZI.js +0 -429
- package/dist/chunk-XGPU2VDU.js +0 -219
- package/dist/chunk-XUJZO7MZ.js +0 -57
- package/dist/chunk-Y67LUJBE.js +0 -455
- package/dist/chunk-Y7XSDJEA.js +0 -3868
- package/dist/chunk-ZNNQK366.js +0 -7198
- package/dist/chunk-ZNNQK366.js.map +0 -1
- package/dist/chunk-ZNRGH4NS.js +0 -150
- package/dist/claim-4KUETSW3.js +0 -198
- package/dist/claim-4KUETSW3.js.map +0 -1
- package/dist/companies-XFO6WPVT.js +0 -196
- package/dist/companies-XFO6WPVT.js.map +0 -1
- package/dist/company-OJGISG7K.js +0 -306
- package/dist/company-OJGISG7K.js.map +0 -1
- package/dist/complete-CXOST5J3.js +0 -82
- package/dist/complete-CXOST5J3.js.map +0 -1
- package/dist/connect-HPQ32KGV.js +0 -43
- package/dist/conversation-D5HKCTDA.js +0 -94
- package/dist/conversation-D5HKCTDA.js.map +0 -1
- package/dist/conversion-report-DKXFHLLX.js +0 -125
- package/dist/conversion-report-DKXFHLLX.js.map +0 -1
- package/dist/conversion-upload-command-KTYAY7IG.js +0 -439
- package/dist/conversion-writes-7ODJDAUP.js +0 -120
- package/dist/conversion-writes-7ODJDAUP.js.map +0 -1
- package/dist/conversions-BKVGNNC6.js +0 -76
- package/dist/conversions-BKVGNNC6.js.map +0 -1
- package/dist/conversions-SYNDEB6D.js +0 -138
- package/dist/conversions-SYNDEB6D.js.map +0 -1
- package/dist/copy-writes-P4WK6OPM.js +0 -168
- package/dist/copy-writes-P4WK6OPM.js.map +0 -1
- package/dist/create-7D4VD4TC.js +0 -208
- package/dist/create-7D4VD4TC.js.map +0 -1
- package/dist/create-7QDEAWZS.js +0 -133
- package/dist/create-7QDEAWZS.js.map +0 -1
- package/dist/create-IQSYEC4M.js +0 -60
- package/dist/create-IQSYEC4M.js.map +0 -1
- package/dist/create-TQSCM7MG.js +0 -237
- package/dist/create-TQSCM7MG.js.map +0 -1
- package/dist/creatives-JPKA2RHU.js +0 -89
- package/dist/creatives-RNOL4F4E.js +0 -58
- package/dist/creatives-RXI27T2D.js +0 -221
- package/dist/creatives-RXI27T2D.js.map +0 -1
- package/dist/credentials-PYW55B52.js +0 -288
- package/dist/credentials-PYW55B52.js.map +0 -1
- package/dist/critique-2SYHNAW5.js +0 -1449
- package/dist/critique-2SYHNAW5.js.map +0 -1
- package/dist/critique-72GFZSHA.js +0 -230
- package/dist/critique-72GFZSHA.js.map +0 -1
- package/dist/crm-EATDSXXB.js +0 -225
- package/dist/crm-EATDSXXB.js.map +0 -1
- package/dist/crm-XXP3VBYD.js +0 -321
- package/dist/crm-XXP3VBYD.js.map +0 -1
- package/dist/currency-R4ORE2U3.js +0 -88
- package/dist/custom-conversions-5HJBB5XL.js +0 -128
- package/dist/customers-OFZTEXST.js +0 -57
- package/dist/delete-FGVZIK4R.js +0 -55
- package/dist/delete-FGVZIK4R.js.map +0 -1
- package/dist/delete-HBZZL4UA.js +0 -67
- package/dist/delete-HBZZL4UA.js.map +0 -1
- package/dist/delete-JOUXMRIX.js +0 -65
- package/dist/delete-JOUXMRIX.js.map +0 -1
- package/dist/demographics-SB7NBYOI.js +0 -139
- package/dist/demographics-SB7NBYOI.js.map +0 -1
- package/dist/discard-YYGIRDII.js +0 -67
- package/dist/discard-YYGIRDII.js.map +0 -1
- package/dist/discover-GSJRZUOC.js +0 -172
- package/dist/domain-3KRAJAUH.js +0 -99
- package/dist/domain-3KRAJAUH.js.map +0 -1
- package/dist/download-QCBKJ6OR.js +0 -170
- package/dist/download-QCBKJ6OR.js.map +0 -1
- package/dist/draft-7CGFFZTH.js +0 -333
- package/dist/draft-7CGFFZTH.js.map +0 -1
- package/dist/draft-BI4NW6AU.js +0 -308
- package/dist/draft-BI4NW6AU.js.map +0 -1
- package/dist/draft-LPVK6YHI.js +0 -281
- package/dist/draft-LPVK6YHI.js.map +0 -1
- package/dist/draft-QF5JEUTH.js +0 -218
- package/dist/draft-QF5JEUTH.js.map +0 -1
- package/dist/draft-WYDMLNYA.js +0 -308
- package/dist/experiments-ZCEYRP3H.js +0 -234
- package/dist/experiments-ZCEYRP3H.js.map +0 -1
- package/dist/facets-G7ZDPI5Q.js +0 -115
- package/dist/facets-G7ZDPI5Q.js.map +0 -1
- package/dist/feedback-3U3CL2VB.js +0 -109
- package/dist/feedback-3U3CL2VB.js.map +0 -1
- package/dist/feedback-record-4ZHPENIP.js +0 -263
- package/dist/feedback-record-4ZHPENIP.js.map +0 -1
- package/dist/fetch-PNVNNWTP.js +0 -177
- package/dist/fetch-PNVNNWTP.js.map +0 -1
- package/dist/fit-53DGYRFD.js +0 -63
- package/dist/flows-JXLQBP5Q.js +0 -248
- package/dist/flows-JXLQBP5Q.js.map +0 -1
- package/dist/fonts-LFMBUT4R.js +0 -37
- package/dist/forecast-4AG5F7YC.js +0 -169
- package/dist/forecast-VZAXI74O.js +0 -119
- package/dist/forecast-VZAXI74O.js.map +0 -1
- package/dist/funnel-EACC35UD.js +0 -395
- package/dist/funnel-EACC35UD.js.map +0 -1
- package/dist/get-AXBVYGAC.js +0 -57
- package/dist/get-AXBVYGAC.js.map +0 -1
- package/dist/get-D6A27Q4E.js +0 -80
- package/dist/get-D6A27Q4E.js.map +0 -1
- package/dist/google-NAA4BASO.js +0 -3267
- package/dist/google-ads-OIYUNDXQ.js +0 -196
- package/dist/google-ads-OIYUNDXQ.js.map +0 -1
- package/dist/history-5MRLNTCI.js +0 -67
- package/dist/history-5MRLNTCI.js.map +0 -1
- package/dist/history-IDYNIB6R.js +0 -134
- package/dist/history-IDYNIB6R.js.map +0 -1
- package/dist/history-IOUKN3WD.js +0 -100
- package/dist/history-IOUKN3WD.js.map +0 -1
- package/dist/hubspot-HL6WGC4G.js +0 -780
- package/dist/hubspot-HL6WGC4G.js.map +0 -1
- package/dist/ideas-NK3KQHAK.js +0 -43
- package/dist/images-2XS3JT7E.js +0 -92
- package/dist/ingest-DHXWZZX4.js +0 -24
- package/dist/ingest-FGTJRCWK.js +0 -108
- package/dist/ingest-FGTJRCWK.js.map +0 -1
- package/dist/insights-M3CYB22P.js +0 -437
- package/dist/insights-M3CYB22P.js.map +0 -1
- package/dist/insights-XCT3ONC7.js +0 -130
- package/dist/insights-XCT3ONC7.js.map +0 -1
- package/dist/inspect-53GGYRC4.js +0 -190
- package/dist/inspect-53GGYRC4.js.map +0 -1
- package/dist/instant-experiences-HT3HB4QZ.js +0 -258
- package/dist/instant-experiences-HT3HB4QZ.js.map +0 -1
- package/dist/intent-NSHW7EJT.js +0 -95
- package/dist/keyword-gap-ITTWKBWZ.js +0 -130
- package/dist/keyword-metrics-LWPE3HHW.js +0 -198
- package/dist/keyword-metrics-LWPE3HHW.js.map +0 -1
- package/dist/keywords-for-site-5K25VJ35.js +0 -129
- package/dist/keywords-for-site-5K25VJ35.js.map +0 -1
- package/dist/landing-QONUUP3C.js +0 -28
- package/dist/languages-MEFQQBJ2.js +0 -40
- package/dist/leads-FSSISJGL.js +0 -113
- package/dist/leads-FSSISJGL.js.map +0 -1
- package/dist/leads-SZOGCQFK.js +0 -538
- package/dist/leads-SZOGCQFK.js.map +0 -1
- package/dist/learn-FWWJWBDN.js +0 -205
- package/dist/learn-FWWJWBDN.js.map +0 -1
- package/dist/line-item-writes-A3UQ44NG.js +0 -209
- package/dist/line-item-writes-A3UQ44NG.js.map +0 -1
- package/dist/line-items-OH426JGT.js +0 -107
- package/dist/link-67E4NVEX.js +0 -65
- package/dist/link-67E4NVEX.js.map +0 -1
- package/dist/linkedin-CT2OSQ2I.js +0 -1314
- package/dist/linkedin-CT2OSQ2I.js.map +0 -1
- package/dist/linkedin-person-OSNLPLJJ.js +0 -137
- package/dist/linkedin-person-OSNLPLJJ.js.map +0 -1
- package/dist/list-J4OUXAKN.js +0 -65
- package/dist/list-J4OUXAKN.js.map +0 -1
- package/dist/list-L2OQK4W3.js +0 -304
- package/dist/list-L2OQK4W3.js.map +0 -1
- package/dist/list-LHMDAA2D.js +0 -152
- package/dist/list-LHMDAA2D.js.map +0 -1
- package/dist/locations-RLWAS6AC.js +0 -40
- package/dist/locations-UKBOT6SB.js +0 -67
- package/dist/locations-UKBOT6SB.js.map +0 -1
- package/dist/log-4EIV54V4.js +0 -93
- package/dist/log-4EIV54V4.js.map +0 -1
- package/dist/lookup-ZJIP2M4X.js +0 -22
- package/dist/make-MFU3CSN7.js +0 -1368
- package/dist/make-MFU3CSN7.js.map +0 -1
- package/dist/map-VWWWMQLK.js +0 -434
- package/dist/map-VWWWMQLK.js.map +0 -1
- package/dist/mcp-EKLO2VD7.js +0 -715
- package/dist/mcp-EKLO2VD7.js.map +0 -1
- package/dist/media-ZWN7E777.js +0 -18
- package/dist/media-sources-7L622UTF.js +0 -35
- package/dist/members-QK5M5NCJ.js +0 -45
- package/dist/members-QK5M5NCJ.js.map +0 -1
- package/dist/meta-EHKXH257.js +0 -122
- package/dist/metrics-K6FDCMK7.js +0 -152
- package/dist/normalize-WI4OGKH5.js +0 -142
- package/dist/normalize-WI4OGKH5.js.map +0 -1
- package/dist/options-FKJ2QXI6.js +0 -123
- package/dist/options-FKJ2QXI6.js.map +0 -1
- package/dist/organization-7A7MPUDG.js +0 -947
- package/dist/organization-7A7MPUDG.js.map +0 -1
- package/dist/page-photos-HWKQOSCU.js +0 -116
- package/dist/page-photos-HWKQOSCU.js.map +0 -1
- package/dist/performance-K4VB6L6Z.js +0 -25
- package/dist/performance-LHAL53YO.js +0 -5539
- package/dist/performance-LHAL53YO.js.map +0 -1
- package/dist/pixels-Z7ZGXAGB.js +0 -60
- package/dist/pixels-Z7ZGXAGB.js.map +0 -1
- package/dist/plan-TVQSEKYL.js +0 -207
- package/dist/plan-TVQSEKYL.js.map +0 -1
- package/dist/preview-CWRGDFCP.js +0 -216
- package/dist/preview-CWRGDFCP.js.map +0 -1
- package/dist/promoted-tweet-writes-V4ZVJOJU.js +0 -181
- package/dist/promoted-tweet-writes-V4ZVJOJU.js.map +0 -1
- package/dist/promoted-tweets-KPG4IUVD.js +0 -119
- package/dist/publish-Y465CVUD.js +0 -342
- package/dist/publish-Y465CVUD.js.map +0 -1
- package/dist/query-QM7MBQD7.js +0 -62
- package/dist/questionnaire-LEZJLMAV.js +0 -93
- package/dist/questionnaire-LEZJLMAV.js.map +0 -1
- package/dist/reddit-Z7DOVIGR.js +0 -27
- package/dist/refresh-A6TW2Z2F.js +0 -95
- package/dist/refresh-A6TW2Z2F.js.map +0 -1
- package/dist/release-UFESJ4TM.js +0 -61
- package/dist/release-UFESJ4TM.js.map +0 -1
- package/dist/relevant-pages-VOICMQ7U.js +0 -99
- package/dist/remove-YONNYA4G.js +0 -51
- package/dist/remove-YONNYA4G.js.map +0 -1
- package/dist/reopen-FYJU2IPO.js +0 -64
- package/dist/reopen-FYJU2IPO.js.map +0 -1
- package/dist/rerun-B5SBG6ZE.js +0 -93
- package/dist/rerun-B5SBG6ZE.js.map +0 -1
- package/dist/research-HW4EVOZU.js +0 -72
- package/dist/research-OV53DIBX.js +0 -263
- package/dist/research-OV53DIBX.js.map +0 -1
- package/dist/reset-R4SIQXFH.js +0 -55
- package/dist/reset-R4SIQXFH.js.map +0 -1
- package/dist/reset-X6ODAKYH.js +0 -55
- package/dist/reset-X6ODAKYH.js.map +0 -1
- package/dist/resolve-DNRJCLCR.js +0 -122
- package/dist/resolve-DNRJCLCR.js.map +0 -1
- package/dist/retry-D5MKBHUB.js +0 -63
- package/dist/retry-D5MKBHUB.js.map +0 -1
- package/dist/retry-DVFLE7JY.js +0 -61
- package/dist/retry-DVFLE7JY.js.map +0 -1
- package/dist/revenue-QGI6XWSK.js +0 -89
- package/dist/revenue-QGI6XWSK.js.map +0 -1
- package/dist/rule-writes-S3RN47OG.js +0 -523
- package/dist/rule-writes-S3RN47OG.js.map +0 -1
- package/dist/rules-KTJ2ZZ62.js +0 -217
- package/dist/rules-TR6BAC23.js +0 -97
- package/dist/rules-TR6BAC23.js.map +0 -1
- package/dist/rules-add-T5ZO5RLR.js +0 -463
- package/dist/rules-add-T5ZO5RLR.js.map +0 -1
- package/dist/run-WZ5IXWA4.js +0 -67
- package/dist/run-WZ5IXWA4.js.map +0 -1
- package/dist/run-YRR3KOUU.js +0 -68
- package/dist/scaffold-ad-DNUCGCIH.js +0 -1514
- package/dist/scaffold-ad-DNUCGCIH.js.map +0 -1
- package/dist/scaffold-static-ad-VR65EZAG.js +0 -1013
- package/dist/scaffold-static-ad-VR65EZAG.js.map +0 -1
- package/dist/scaffold-video-JLMKCCWE.js +0 -886
- package/dist/scaffold-video-JLMKCCWE.js.map +0 -1
- package/dist/schedule-VRHCVBZA.js +0 -62
- package/dist/schedule-VRHCVBZA.js.map +0 -1
- package/dist/scheduled-agents-DG7FTCUZ.js +0 -55
- package/dist/schema-WZKDWF5N.js +0 -133
- package/dist/schema-WZKDWF5N.js.map +0 -1
- package/dist/search-MN66QIKJ.js +0 -175
- package/dist/search-MN66QIKJ.js.map +0 -1
- package/dist/select-IPSM2BF2.js +0 -104
- package/dist/select-IPSM2BF2.js.map +0 -1
- package/dist/sends-6FI7WELX.js +0 -348
- package/dist/sends-6FI7WELX.js.map +0 -1
- package/dist/set-prompt-N6BD3DME.js +0 -196
- package/dist/set-prompt-N6BD3DME.js.map +0 -1
- package/dist/setup-links-GTA2AROS.js +0 -142
- package/dist/setup-links-GTA2AROS.js.map +0 -1
- package/dist/shopify-S4TG6WJH.js +0 -3956
- package/dist/shopify-S4TG6WJH.js.map +0 -1
- package/dist/site-NY622E3H.js +0 -178
- package/dist/site-NY622E3H.js.map +0 -1
- package/dist/sources-4F2XO7Z6.js +0 -455
- package/dist/sources-4F2XO7Z6.js.map +0 -1
- package/dist/sources-562ITR77.js +0 -30
- package/dist/stale-JKM6MXJF.js +0 -74
- package/dist/stale-JKM6MXJF.js.map +0 -1
- package/dist/status-AUWMUDA4.js +0 -63
- package/dist/status-AUWMUDA4.js.map +0 -1
- package/dist/studies-ZOEUY6YP.js +0 -250
- package/dist/study-writes-DTGMCNFP.js +0 -468
- package/dist/study-writes-DTGMCNFP.js.map +0 -1
- package/dist/sync-76MCGHX4.js +0 -55
- package/dist/sync-76MCGHX4.js.map +0 -1
- package/dist/sync-definition-NJPT6ABG.js +0 -67
- package/dist/tags-5KBOJJ5R.js +0 -26
- package/dist/tags-CSMLTHTU.js +0 -21
- package/dist/tags-CSMLTHTU.js.map +0 -1
- package/dist/tags-IFRZYM3G.js +0 -21
- package/dist/tags-IFRZYM3G.js.map +0 -1
- package/dist/tags-S44ADJ75.js +0 -21
- package/dist/tags-S44ADJ75.js.map +0 -1
- package/dist/tags-WR7IY3OT.js +0 -225
- package/dist/tags-WR7IY3OT.js.map +0 -1
- package/dist/targeting-VBQY3HUN.js +0 -760
- package/dist/targeting-VBQY3HUN.js.map +0 -1
- package/dist/targeting-criteria-FJWNK53T.js +0 -113
- package/dist/targets-2EHMMXD4.js +0 -104
- package/dist/targets-2EHMMXD4.js.map +0 -1
- package/dist/testimonials-WAPFIGFJ.js +0 -32
- package/dist/themes-B4LCQUXB.js +0 -95
- package/dist/top-companies-DJ2XQKMW.js +0 -109
- package/dist/top-companies-DJ2XQKMW.js.map +0 -1
- package/dist/transcript-J3LGOHCM.js +0 -163
- package/dist/transcript-J3LGOHCM.js.map +0 -1
- package/dist/translate-6RXO4C6Z.js +0 -607
- package/dist/translate-6RXO4C6Z.js.map +0 -1
- package/dist/triggers-CYXPNHQB.js +0 -142
- package/dist/triggers-CYXPNHQB.js.map +0 -1
- package/dist/unlink-5FJI7XZB.js +0 -68
- package/dist/unlink-5FJI7XZB.js.map +0 -1
- package/dist/unstage-54ZE2SZK.js +0 -86
- package/dist/unstage-54ZE2SZK.js.map +0 -1
- package/dist/unstage-MDSSPUKV.js +0 -95
- package/dist/unstage-MDSSPUKV.js.map +0 -1
- package/dist/update-BVBFNFMO.js +0 -99
- package/dist/update-BVBFNFMO.js.map +0 -1
- package/dist/update-GV3T7ZRC.js +0 -190
- package/dist/update-GV3T7ZRC.js.map +0 -1
- package/dist/update-PUQWUGPJ.js +0 -64
- package/dist/update-PUQWUGPJ.js.map +0 -1
- package/dist/update-YQBK6C3L.js +0 -153
- package/dist/update-YQBK6C3L.js.map +0 -1
- package/dist/upload-PXT5JAEV.js +0 -127
- package/dist/upload-PXT5JAEV.js.map +0 -1
- package/dist/url-options-IHL4OU4C.js +0 -130
- package/dist/url-options-IHL4OU4C.js.map +0 -1
- package/dist/url-params-IYUI6SFJ.js +0 -99
- package/dist/url-params-IYUI6SFJ.js.map +0 -1
- package/dist/validate-AD7F7LQ5.js +0 -120
- package/dist/validate-AD7F7LQ5.js.map +0 -1
- package/dist/videos-ZJCTODEB.js +0 -41
- package/dist/viewer-check-GWZNGWCO.js +0 -81
- package/dist/web-76CWAZNW.js +0 -141
- package/dist/web-76CWAZNW.js.map +0 -1
- package/dist/winning-ads-W7GTXTX7.js +0 -86
- package/dist/write-commands-K6M3RTVK.js +0 -1170
- package/dist/write-commands-K6M3RTVK.js.map +0 -1
- package/dist/write-commands-VPU53DLB.js +0 -1498
- package/dist/write-commands-VPU53DLB.js.map +0 -1
- package/dist/x-V4NNNWRU.js +0 -47
- /package/dist/{account-assets-O7IA37RE.js.map → account-assets-J5Z4URLQ.js.map} +0 -0
- /package/dist/{account-reads-SNOWDHHF.js.map → account-reads-2MSUVG46.js.map} +0 -0
- /package/dist/{actions-4JYHXRFH.js.map → actions-D7OWCP36.js.map} +0 -0
- /package/dist/{ads-LXWXOQHX.js.map → ads-HLUJB5SQ.js.map} +0 -0
- /package/dist/{ads-KBE5JXCH.js.map → ads-MAOI7S6V.js.map} +0 -0
- /package/dist/{adsets-YWBJFPAZ.js.map → adsets-QRKICEFD.js.map} +0 -0
- /package/dist/{asset-writes-72DEVXGO.js.map → asset-writes-JLVUAVUZ.js.map} +0 -0
- /package/dist/{audiences-QAH42HIM.js.map → audiences-CDDI5HR5.js.map} +0 -0
- /package/dist/{avatars-N6W6HUPP.js.map → avatars-WZ2JDMHH.js.map} +0 -0
- /package/dist/{brand-ITWQVZD2.js.map → brand-IZTTBZII.js.map} +0 -0
- /package/dist/{campaigns-5BIDXYSR.js.map → campaigns-4Y3JQC2U.js.map} +0 -0
- /package/dist/{campaigns-XZOQ2VTK.js.map → campaigns-HES5MDUG.js.map} +0 -0
- /package/dist/{canvas-SL3RMOY5.js.map → canvas-IQ753Q2O.js.map} +0 -0
- /package/dist/{changes-36C754R4.js.map → changes-VWKTM27U.js.map} +0 -0
- /package/dist/{chatgpt-3WFOPURY.js.map → chatgpt-OPOD2WHB.js.map} +0 -0
- /package/dist/{chunk-WF25CCLD.js.map → chunk-2GYCWRF3.js.map} +0 -0
- /package/dist/{chunk-HJKYTNAZ.js.map → chunk-2L7F7KR4.js.map} +0 -0
- /package/dist/{chunk-4GAEB6NK.js.map → chunk-44ZRCSR7.js.map} +0 -0
- /package/dist/{chunk-2TOIY2WN.js.map → chunk-46YLDIQG.js.map} +0 -0
- /package/dist/{chunk-DQ54POZN.js.map → chunk-4EDWXZ3I.js.map} +0 -0
- /package/dist/{chunk-SIXU5PDF.js.map → chunk-4FFBGR5L.js.map} +0 -0
- /package/dist/{chunk-XGPU2VDU.js.map → chunk-4UQRXKYJ.js.map} +0 -0
- /package/dist/{chunk-JSNMKTFM.js.map → chunk-4UZUUSVL.js.map} +0 -0
- /package/dist/{chunk-Q6JMMBSQ.js.map → chunk-4XHCEYHI.js.map} +0 -0
- /package/dist/{chunk-ALMYGH5U.js.map → chunk-4Z6PVR3M.js.map} +0 -0
- /package/dist/{chunk-K4FLWDEX.js.map → chunk-5Y5FZV2W.js.map} +0 -0
- /package/dist/{chunk-INUU3752.js.map → chunk-6HJXLGDV.js.map} +0 -0
- /package/dist/{chunk-XE6N4SZI.js.map → chunk-6S5CWGDA.js.map} +0 -0
- /package/dist/{chunk-SXMK5AEJ.js.map → chunk-6VYROVWO.js.map} +0 -0
- /package/dist/{chunk-TVAIOC77.js.map → chunk-7BUIOP36.js.map} +0 -0
- /package/dist/{chunk-TTLD66NI.js.map → chunk-AQRXXC6E.js.map} +0 -0
- /package/dist/{chunk-W4D7C74B.js.map → chunk-ARBXT73X.js.map} +0 -0
- /package/dist/{chunk-LAC6YHHX.js.map → chunk-BEZHQIEI.js.map} +0 -0
- /package/dist/{chunk-J3UWMBOP.js.map → chunk-BFURWHVR.js.map} +0 -0
- /package/dist/{chunk-KBRJSPIM.js.map → chunk-DSCEXBDR.js.map} +0 -0
- /package/dist/{chunk-MI4HXE7M.js.map → chunk-FLWDFPXE.js.map} +0 -0
- /package/dist/{chunk-GACSA5A6.js.map → chunk-FRNBRN2C.js.map} +0 -0
- /package/dist/{chunk-FKQK22IX.js.map → chunk-GE3VT3CA.js.map} +0 -0
- /package/dist/{chunk-FLK6QHOY.js.map → chunk-HGBJQGO5.js.map} +0 -0
- /package/dist/{chunk-MGYC2IRC.js.map → chunk-I7AYMJZA.js.map} +0 -0
- /package/dist/{chunk-PFTYKINE.js.map → chunk-IRM273C7.js.map} +0 -0
- /package/dist/{chunk-WR3FR3K3.js.map → chunk-IWKD56AY.js.map} +0 -0
- /package/dist/{chunk-Y7XSDJEA.js.map → chunk-JLAQWMVF.js.map} +0 -0
- /package/dist/{chunk-XUJZO7MZ.js.map → chunk-K6NULQN7.js.map} +0 -0
- /package/dist/{chunk-JI77AKT6.js.map → chunk-L2BRAC2J.js.map} +0 -0
- /package/dist/{chunk-Y67LUJBE.js.map → chunk-LGMI4LSY.js.map} +0 -0
- /package/dist/{chunk-OJGYYH6K.js.map → chunk-NB2FU6EZ.js.map} +0 -0
- /package/dist/{chunk-TVTSA4EN.js.map → chunk-NWF2LRKO.js.map} +0 -0
- /package/dist/{chunk-WQPUX3BA.js.map → chunk-OG47L5GG.js.map} +0 -0
- /package/dist/{chunk-RAQHUMKS.js.map → chunk-OR6KVLI5.js.map} +0 -0
- /package/dist/{chunk-OBJCNGZL.js.map → chunk-QDQZ62FL.js.map} +0 -0
- /package/dist/{chunk-4D46PS6J.js.map → chunk-QIOFOD4K.js.map} +0 -0
- /package/dist/{chunk-6JCX3YLM.js.map → chunk-R2SYF5FC.js.map} +0 -0
- /package/dist/{chunk-JNURZHZJ.js.map → chunk-RTH2I55B.js.map} +0 -0
- /package/dist/{chunk-FFFJBNHA.js.map → chunk-S6VFDNSQ.js.map} +0 -0
- /package/dist/{chunk-ZNRGH4NS.js.map → chunk-SG2TDQEE.js.map} +0 -0
- /package/dist/{chunk-CKQTJ2LV.js.map → chunk-T3P6O2VU.js.map} +0 -0
- /package/dist/{chunk-V5NHJU3M.js.map → chunk-TXDE2QJ3.js.map} +0 -0
- /package/dist/{chunk-C6CBBZBO.js.map → chunk-UDIEKCIR.js.map} +0 -0
- /package/dist/{chunk-SA22KXWT.js.map → chunk-USCADMM3.js.map} +0 -0
- /package/dist/{chunk-MJ7RNDD4.js.map → chunk-UUGISMNE.js.map} +0 -0
- /package/dist/{chunk-IQHO2ABF.js.map → chunk-VDPOCAQ2.js.map} +0 -0
- /package/dist/{chunk-AQKRSEBQ.js.map → chunk-VEJ3QX6M.js.map} +0 -0
- /package/dist/{chunk-XDNJC62G.js.map → chunk-VFJB7OG6.js.map} +0 -0
- /package/dist/{chunk-DL2UJNJ7.js.map → chunk-VRIPVLE7.js.map} +0 -0
- /package/dist/{chunk-5XTGG4PV.js.map → chunk-WFY7KSHB.js.map} +0 -0
- /package/dist/{chunk-D3KLDIPQ.js.map → chunk-WLESMH4J.js.map} +0 -0
- /package/dist/{chunk-PLBITHV6.js.map → chunk-XHQYFNNK.js.map} +0 -0
- /package/dist/{chunk-OLBLXJNI.js.map → chunk-YILZR3XI.js.map} +0 -0
- /package/dist/{chunk-JDR3HUEL.js.map → chunk-YJFLXOH4.js.map} +0 -0
- /package/dist/{chunk-BL6RTOK3.js.map → chunk-YWHZYR6S.js.map} +0 -0
- /package/dist/{connect-HPQ32KGV.js.map → connect-3YY7MF3I.js.map} +0 -0
- /package/dist/{conversion-upload-command-KTYAY7IG.js.map → conversion-upload-command-7RSZ5ZQU.js.map} +0 -0
- /package/dist/{creatives-RNOL4F4E.js.map → creatives-2DR3QHJW.js.map} +0 -0
- /package/dist/{creatives-JPKA2RHU.js.map → creatives-BB6S2OF6.js.map} +0 -0
- /package/dist/{currency-R4ORE2U3.js.map → currency-X7Y6TSLF.js.map} +0 -0
- /package/dist/{custom-conversions-5HJBB5XL.js.map → custom-conversions-HAGG72LF.js.map} +0 -0
- /package/dist/{customers-OFZTEXST.js.map → customers-663K2OCP.js.map} +0 -0
- /package/dist/{discover-GSJRZUOC.js.map → discover-6DORQWXY.js.map} +0 -0
- /package/dist/{draft-WYDMLNYA.js.map → draft-R6EKORNS.js.map} +0 -0
- /package/dist/{fit-53DGYRFD.js.map → fit-BEFCY2B4.js.map} +0 -0
- /package/dist/{fonts-LFMBUT4R.js.map → fonts-C6XN5667.js.map} +0 -0
- /package/dist/{forecast-4AG5F7YC.js.map → forecast-BTPIXEQ5.js.map} +0 -0
- /package/dist/{google-NAA4BASO.js.map → google-M6BJ22UL.js.map} +0 -0
- /package/dist/{ideas-NK3KQHAK.js.map → ideas-M66FU45H.js.map} +0 -0
- /package/dist/{images-2XS3JT7E.js.map → images-MM5OPUKV.js.map} +0 -0
- /package/dist/{ingest-DHXWZZX4.js.map → ingest-KMLYCFF4.js.map} +0 -0
- /package/dist/{intent-NSHW7EJT.js.map → intent-YCQCUCV3.js.map} +0 -0
- /package/dist/{keyword-gap-ITTWKBWZ.js.map → keyword-gap-PUSF7EKY.js.map} +0 -0
- /package/dist/{landing-QONUUP3C.js.map → landing-OZU5RRFV.js.map} +0 -0
- /package/dist/{languages-MEFQQBJ2.js.map → languages-SLFV73GE.js.map} +0 -0
- /package/dist/{line-items-OH426JGT.js.map → line-items-NJMEPEF5.js.map} +0 -0
- /package/dist/{locations-RLWAS6AC.js.map → locations-T2OMP6QN.js.map} +0 -0
- /package/dist/{lookup-ZJIP2M4X.js.map → lookup-S5VG7AWH.js.map} +0 -0
- /package/dist/{media-ZWN7E777.js.map → media-P4T4ZBNS.js.map} +0 -0
- /package/dist/{media-sources-7L622UTF.js.map → media-sources-EQI3U4TC.js.map} +0 -0
- /package/dist/{meta-EHKXH257.js.map → meta-IPLWNYC7.js.map} +0 -0
- /package/dist/{metrics-K6FDCMK7.js.map → metrics-4YVJHYRI.js.map} +0 -0
- /package/dist/{performance-K4VB6L6Z.js.map → performance-NIF3CESZ.js.map} +0 -0
- /package/dist/{promoted-tweets-KPG4IUVD.js.map → promoted-tweets-RJT53DRM.js.map} +0 -0
- /package/dist/{query-QM7MBQD7.js.map → query-XZMDGRO5.js.map} +0 -0
- /package/dist/{reddit-Z7DOVIGR.js.map → reddit-JIHMAKAQ.js.map} +0 -0
- /package/dist/{relevant-pages-VOICMQ7U.js.map → relevant-pages-FS7GBVXK.js.map} +0 -0
- /package/dist/{research-HW4EVOZU.js.map → research-PNBACCCP.js.map} +0 -0
- /package/dist/{rules-KTJ2ZZ62.js.map → rules-ZVS2MWED.js.map} +0 -0
- /package/dist/{run-YRR3KOUU.js.map → run-QCNRR3CA.js.map} +0 -0
- /package/dist/{scheduled-agents-DG7FTCUZ.js.map → scheduled-agents-OXYAVSIE.js.map} +0 -0
- /package/dist/{sources-562ITR77.js.map → sources-FLUGHSVP.js.map} +0 -0
- /package/dist/{studies-ZOEUY6YP.js.map → studies-EPO2AM4M.js.map} +0 -0
- /package/dist/{sync-definition-NJPT6ABG.js.map → sync-definition-OGQ5XTQE.js.map} +0 -0
- /package/dist/{tags-5KBOJJ5R.js.map → tags-CZTRQNXV.js.map} +0 -0
- /package/dist/{targeting-criteria-FJWNK53T.js.map → targeting-criteria-AQYXVSGN.js.map} +0 -0
- /package/dist/{testimonials-WAPFIGFJ.js.map → testimonials-G3OCNPBY.js.map} +0 -0
- /package/dist/{themes-B4LCQUXB.js.map → themes-FEVYZZCW.js.map} +0 -0
- /package/dist/{videos-ZJCTODEB.js.map → videos-36AXDUGZ.js.map} +0 -0
- /package/dist/{viewer-check-GWZNGWCO.js.map → viewer-check-6HL4OUQY.js.map} +0 -0
- /package/dist/{winning-ads-W7GTXTX7.js.map → winning-ads-GMM5W2O4.js.map} +0 -0
- /package/dist/{x-V4NNNWRU.js.map → x-HGFAL3NY.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/shopify/index.ts","../../api/src/shopify/audiences.ts","../src/commands/shopify/audiences.ts","../src/commands/shopify/audienceHints.ts","../../api/src/shopify/buyers.ts","../../api/src/shopify/writes.ts","../../api/src/shopify/signups.ts","../src/commands/shopify/refusal.ts","../src/commands/shopify/common.ts","../src/commands/shopify/writeCommon.ts","../src/commands/shopify/writeHints.ts","../src/commands/shopify/buyers.ts","../src/commands/shopify/buyerHints.ts","../src/commands/shopify/hints.ts","../../api/src/shopify/catalogAds.ts","../src/commands/shopify/catalog.ts","../src/commands/shopify/catalogReport.ts","../src/commands/shopify/change.ts","../src/commands/shopify/changes.ts","../src/commands/shopify/draft.ts","../src/commands/shopify/promotions.ts","../src/commands/shopify/landingLinks.ts","../src/commands/shopify/promotionHints.ts","../src/commands/shopify/stockHoldReport.ts","../src/commands/shopify/signupOffers.ts","../src/commands/shopify/tracking.ts"],"sourcesContent":["import type {\n ShopifyCollectionsResponse,\n ShopifyProductResponse,\n ShopifyProductsResponse,\n ShopifySalesResponse,\n ShopifyStockResponse,\n ShopifyStoreResponse,\n} from \"@baker/api/shopify\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiGet } from \"../../client.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { audiencesCommand } from \"./audiences.ts\";\nimport {\n bestSellersCommand,\n buyerCommand,\n buyersCommand,\n cohortsCommand,\n countriesCommand,\n segmentsCommand,\n} from \"./buyers.ts\";\nimport { catalogCommand } from \"./catalog.ts\";\nimport { changeCommand } from \"./change.ts\";\nimport { changesCommand, undoCommand } from \"./changes.ts\";\nimport { emit, fail, fullArg, params } from \"./common.ts\";\nimport { draftCommand } from \"./draft.ts\";\nimport { productHints, productsHints, salesHints, stockHints, storeHints, storeStateHints } from \"./hints.ts\";\nimport { promotionsCommand, stockHoldsCommand } from \"./promotions.ts\";\nimport { signupOffersCommand } from \"./signupOffers.ts\";\nimport { trackingCommand } from \"./tracking.ts\";\n\n/**\n * `baker shopify` — the connected Shopify store, as Baker keeps it. Every\n * answer is Baker's own copy (never a live call to Shopify) and carries\n * `meta.store`: whether the copy is complete, whether Baker can still reach\n * the store, and when it last heard from it.\n */\n\nregisterSchema({\n command: \"shopify.store\",\n description:\n 'Start here for the connected Shopify store: its name, currency, home country, how many products and collections it has, how many products are out of stock or partly out, the prices by country it sells at (only when it has more than one), where its buy links send a shopper (`buyDestination`: checkout, store_cart or product_page), its languages and policies, whether it asks for a password, and the link to the Products page in Baker. `capped: true` means a count stopped at its ceiling (100 out of stock or partly out, 500 collections): say \"100 or more\", never the number as exact. `meta.store` says whether Baker\\'s copy is complete and whether Baker can still reach the store. `canChange` says which kinds of store change the store allows Baker to stage (products, publishing, discounts, redirects, marketing); a `false` one is allowed by the user in Shopify (`request_connection`).',\n args: {\n full: {\n ...fullArg,\n description:\n \"Add the store's products page in Shopify admin, every country, each policy's text and the store's brand\",\n },\n },\n});\n\nregisterSchema({\n command: \"shopify.products\",\n description:\n \"Start here for 'what do we sell' and 'at what price': the connected store's products with price, sale price, stock and where they can be bought. A product flagged `availability: not_for_sale` can't be bought on the online store (draft, archived or hidden from it) — never send ads or pages to it; `link_only` is buyable through its link but hidden from the store's search. Filter with --search, --stock or --collection; page with --cursor.\",\n args: {\n search: { type: \"string\", description: \"Words in the title, vendor, type or tags\", required: false },\n collection: {\n type: \"string\",\n description: \"Only one collection's products: its handle or id (`baker shopify collections`)\",\n required: false,\n },\n stock: {\n type: \"string\",\n description: \"in_stock | partly_out (some options out) | out_of_stock (every option out)\",\n required: false,\n enum: [\"in_stock\", \"partly_out\", \"out_of_stock\"],\n },\n limit: { type: \"number\", description: \"Products per page, 1-100 (default 25)\", required: false },\n cursor: {\n type: \"string\",\n description: \"meta.next_cursor from the previous page, with the same filters\",\n required: false,\n },\n full: { ...fullArg, description: \"Add vendor, type, option count, photo link, visibility and status\" },\n },\n});\n\nregisterSchema({\n command: \"shopify.product\",\n description:\n \"One product of the connected store — accepts its id, its handle, a link to it on the store, in Baker or in Shopify admin. Returns its options with price, stock and `buyUrl` (each option's buy link for ads, emails and messages; on a landing use `<ShopifyProduct>` instead — never build a Shopify link yourself, never use `storeUrl` for it), prices by country, the options out of stock, its collections, its photos' library imageIds to place on a landing (`baker images download <imageIds> --out src/pages/<page>/_images/`) or pass to a creative, its videos' playbackIds (`<Video playbackId=…/>`), and `contentSummary`: what else Baker keeps about it. Start here for a landing from a product: add `--content` for the formatted description, every custom field by its name (a size chart, care instructions), the rating, subscriptions and translations; `--field <name>` returns one field whole. `--out-of-stock` lists only the options out of stock.\",\n args: {\n ref: { type: \"positional\", description: \"Product id, handle, or a link to the product\", required: true },\n \"variants-cursor\": {\n type: \"string\",\n description: \"data.variantsNextCursor from the previous call: the next page of options (same flags)\",\n required: false,\n },\n \"out-of-stock\": {\n type: \"boolean\",\n description: \"Only the options that are out of stock, whatever their position\",\n required: false,\n default: false,\n },\n content: {\n type: \"boolean\",\n description:\n \"Its whole details: formatted description, custom fields by name (long ones previewed), rating, subscriptions, YouTube/3D links, translations\",\n required: false,\n default: false,\n },\n field: {\n type: \"string\",\n description: 'One custom field whole, by its name or its key (e.g. \"Size chart\" or custom.size_chart)',\n required: false,\n },\n variant: {\n type: \"string\",\n description:\n \"With --field: the option whose field to return, by its variantId (options share their fields, e.g. --field custom.fit --variant 102)\",\n required: false,\n },\n quantity: {\n type: \"number\",\n description: \"How many of the option each buy link puts in the cart, 1-99 (default 1)\",\n required: false,\n },\n full: {\n ...fullArg,\n description:\n \"Its details (as --content), whole description, SEO, category, admin link, 250 options per page with SKU, prices by country, every buy link and each option's weight, unit price, shipping and tax\",\n },\n },\n});\n\nregisterSchema({\n command: \"shopify.collections\",\n description:\n \"The connected store's collections, with the handle `--collection` takes, how many products Shopify counts in each, and `storeUrl`: the collection's page on the store, the link for an ad, an email or a message, and on a landing `<ShopifyStoreLink href=\\\"<storeUrl>\\\">…</ShopifyStoreLink>` — use it as given, never build a /collections/ link yourself; no `storeUrl` means shoppers can't open that collection. `--full` adds each one's description, image and SEO.\",\n args: {\n search: { type: \"string\", description: \"Words in the collection's title or handle\", required: false },\n full: { ...fullArg, description: \"Add each collection's description, image and SEO\" },\n },\n});\n\nregisterSchema({\n command: \"shopify.stock\",\n description:\n \"Start here for 'what's out of stock': every product with every option out of stock, and every product with some options out, naming them. An option that keeps selling at zero or doesn't track stock is not out of stock — a buyer can still buy it.\",\n args: {\n collection: { type: \"string\", description: \"Only one collection: its handle or id\", required: false },\n limit: { type: \"number\", description: \"Products per list, 1-200 (default 50)\", required: false },\n full: { ...fullArg, description: \"Add each option's SKU and each product's Baker link\" },\n },\n});\n\nregisterSchema({\n command: \"shopify.sales\",\n description:\n \"Start here for 'how much did we sell', 'which campaigns or pages brought sales' and 'which products sold most': the connected store's orders, sales, refunds and net, in the store's currency. --by day (default) and --by product count each sale, addition and refund in the period it happened; --by campaign and --by landing take the orders paid in the period and credit each to the campaign or Baker page that brought its buyer, with what was added to and refunded on it since — so the rows add up to `totals` exactly, with named rows for sales from before Baker measured the store and sales from no campaign. A sale counts when it is paid, at what was received. `salesReporting` says who reports the sales to Meta and Google: `undecided` and `shopify_channel` mean Baker only reports them, and only a manager can change that in Brain → Store. --by weekday|hour|month|month_of_year says when buyers order, in the store's own time, from the store's whole order history (orders placed in the period, with what was refunded on them since): use it for when to run or schedule campaigns; only these take --days up to 3650 or --all.\",\n args: {\n days: {\n type: \"number\",\n description:\n \"The last N days: 1-395 by day, product, campaign or landing; 1-3650 by weekday, hour or month (default 30)\",\n required: false,\n },\n all: {\n type: \"boolean\",\n description: \"Every order the store has (by weekday, hour, month or month_of_year only)\",\n required: false,\n default: false,\n },\n by: {\n type: \"string\",\n description: \"day | product | campaign | landing | weekday | hour | month | month_of_year (default day)\",\n required: false,\n enum: [\"day\", \"product\", \"campaign\", \"landing\", \"weekday\", \"hour\", \"month\", \"month_of_year\"],\n },\n limit: {\n type: \"number\",\n description: \"Rows of a breakdown, 1-100 (by campaign or landing the rest are folded into one 'other' row)\",\n required: false,\n },\n full: {\n ...fullArg,\n description: \"Add each row's source, medium, campaign, click platform, landing id or product id\",\n },\n },\n});\n\nconst salesCommand = defineCommand({\n meta: {\n name: \"sales\",\n description:\n \"What the store sold: orders, sales, refunds and net, by day, product, campaign or landing — or when buyers order (weekday, hour, month). Example: baker shopify sales --days 7 --by campaign\",\n },\n args: {\n days: {\n type: \"string\",\n description: \"The last N days (1-395; up to 3650 by weekday, hour or month)\",\n required: false,\n },\n all: {\n type: \"boolean\",\n description: \"Every order (by weekday, hour or month only)\",\n required: false,\n default: false,\n },\n by: {\n type: \"string\",\n description: \"day | product | campaign | landing | weekday | hour | month | month_of_year (default day)\",\n required: false,\n },\n limit: { type: \"string\", description: \"Rows of a breakdown, 1-100\", required: false },\n full: { type: \"boolean\", description: \"Add sources, campaigns and ids per row\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifySalesResponse>(\n \"/api/shopify/sales\",\n params({ days: args.days, all: args.all, by: args.by, limit: args.limit, full: args.full }),\n );\n const { store, salesReporting, history, ...data } = answer;\n emit(data, { store, salesReporting, history }, [...storeStateHints(store), ...salesHints(answer)]);\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst storeCommand = defineCommand({\n meta: {\n name: \"store\",\n description:\n \"The connected Shopify store: currency, countries, how many products, what is out of stock. Example: baker shopify store\",\n },\n args: {\n full: { type: \"boolean\", description: \"Add the admin link and every country\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifyStoreResponse>(\"/api/shopify/store\", params({ full: args.full }));\n const data = answer.canChange ? { ...answer.summary, canChange: answer.canChange } : answer.summary;\n emit(data, { store: answer.store }, [...storeStateHints(answer.store), ...storeHints(answer.summary)]);\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst productsCommand = defineCommand({\n meta: {\n name: \"products\",\n description:\n 'What the store sells, with price and stock. Example: baker shopify products --search \"snowboard\" --stock out_of_stock',\n },\n args: {\n search: { type: \"string\", description: \"Words in the title, vendor, type or tags\", required: false },\n collection: { type: \"string\", description: \"A collection's handle or id\", required: false },\n stock: { type: \"string\", description: \"in_stock | partly_out | out_of_stock\", required: false },\n limit: { type: \"string\", description: \"Products per page, 1-100 (default 25)\", required: false },\n cursor: { type: \"string\", description: \"meta.next_cursor from the previous page\", required: false },\n full: {\n type: \"boolean\",\n description: \"Add vendor, type, photo link, visibility, status\",\n required: false,\n default: false,\n },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifyProductsResponse>(\n \"/api/shopify/products\",\n params({\n search: args.search,\n collection: args.collection,\n stock: args.stock,\n limit: args.limit,\n cursor: args.cursor,\n full: args.full,\n }),\n );\n const filtered = Boolean(args.search || args.collection || args.stock);\n emit(\n answer.products,\n {\n store: answer.store,\n count: answer.products.length,\n ...(answer.nextCursor ? { next_cursor: answer.nextCursor } : {}),\n },\n [...storeStateHints(answer.store), ...productsHints(answer, { filtered, paged: Boolean(args.cursor) })],\n );\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst productCommand = defineCommand({\n meta: {\n name: \"product\",\n description:\n \"One product: options with buy links, prices by country, stock, photo imageIds, video playbackIds. Accepts an id, handle or link. Example: baker shopify product the-complete-snowboard --content\",\n },\n args: {\n ref: { type: \"positional\", description: \"Product id, handle, or a link to the product\", required: true },\n \"variants-cursor\": {\n type: \"string\",\n description: \"data.variantsNextCursor from the previous call\",\n required: false,\n },\n \"out-of-stock\": { type: \"boolean\", description: \"Only the options out of stock\", required: false, default: false },\n content: {\n type: \"boolean\",\n description: \"Its whole details: formatted description, custom fields, subscriptions, translations\",\n required: false,\n default: false,\n },\n field: { type: \"string\", description: \"One custom field whole, by its name or key\", required: false },\n variant: {\n type: \"string\",\n description: \"With --field: the option whose field it is, by its variantId\",\n required: false,\n },\n quantity: {\n type: \"string\",\n description: \"How many each buy link puts in the cart, 1-99 (default 1)\",\n required: false,\n },\n full: { type: \"boolean\", description: \"Everything Baker keeps about it\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const positionals = Array.isArray(args._) ? args._ : [];\n if (positionals.length > 1) {\n throw new ApiError(\n \"VALIDATION_ERROR\",\n \"ref: Pass one product id, handle or product link — quote a link, and search by words with `baker shopify products --search`.\",\n );\n }\n const answer = await apiGet<ShopifyProductResponse>(\n \"/api/shopify/product\",\n params({\n ref: args.ref,\n variantsCursor: args[\"variants-cursor\"],\n outOfStock: args[\"out-of-stock\"],\n content: args.content,\n field: args.field,\n variant: args.variant,\n quantity: args.quantity,\n full: args.full,\n }),\n );\n emit(answer.product, { store: answer.store }, [\n ...storeStateHints(answer.store),\n ...productHints(answer.product, answer.store),\n ]);\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst collectionsCommand = defineCommand({\n meta: {\n name: \"collections\",\n description:\n \"The store's collections, with the handles --collection takes and each one's page on the store (storeUrl). Example: baker shopify collections --full\",\n },\n args: {\n search: { type: \"string\", description: \"Words in the title or handle\", required: false },\n full: { type: \"boolean\", description: \"Add description, image and SEO\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifyCollectionsResponse>(\n \"/api/shopify/collections\",\n params({ search: args.search, full: args.full }),\n );\n emit(\n answer.collections,\n { store: answer.store, count: answer.collections.length },\n storeStateHints(answer.store),\n );\n } catch (err) {\n fail(err);\n }\n },\n});\n\nconst stockCommand = defineCommand({\n meta: {\n name: \"stock\",\n description: \"Every product with options out of stock, naming them. Example: baker shopify stock\",\n },\n args: {\n collection: { type: \"string\", description: \"A collection's handle or id\", required: false },\n limit: { type: \"string\", description: \"Products per list, 1-200 (default 50)\", required: false },\n full: { type: \"boolean\", description: \"Add SKUs and Baker links\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifyStockResponse>(\n \"/api/shopify/stock\",\n params({ collection: args.collection, limit: args.limit, full: args.full }),\n );\n const { store, ...data } = answer;\n const limit = Number(args.limit ?? 50);\n emit(data, { store }, [...storeStateHints(store), ...stockHints(answer, Number.isFinite(limit) ? limit : 50)]);\n } catch (err) {\n fail(err);\n }\n },\n});\n\nexport const shopifyCommand = defineCommand({\n meta: {\n name: \"shopify\",\n description: `Read the connected Shopify store as Baker keeps it — products, prices by country, stock, collections,\nproduct photos, what it sold, who buys, where and what, and what advertises each product — and stage\nchanges to it (\\`change\\`), applied when the user publishes the chat and undone with \\`undo\\`.\n\nExamples:\n baker shopify store # currency, countries, how many products, what is out of stock\n baker shopify products --search \"snowboard\" # what we sell, with price and stock\n baker shopify products --stock out_of_stock # --stock in_stock|partly_out|out_of_stock, --collection <handle>\n baker shopify product the-complete-snowboard # one product: options with buyUrl, prices, photos, videos\n baker shopify product <handle> --content # its whole details: description, custom fields, subscriptions\n baker shopify product <handle> --field \"Size chart\" # one custom field, whole\n baker shopify product <handle> --field custom.fit --variant <variantId> # one option's field, whole\n baker shopify product <handle> --quantity 2 # buy links that put 2 in the cart\n baker shopify product <id> --out-of-stock # only its options that are out of stock\n baker shopify stock # every product with options out of stock\n baker shopify collections # collections, with handles for --collection\n baker shopify sales --days 7 --by campaign # what sold and which campaigns brought it (--by day|product|landing)\n baker shopify sales --all --by weekday # when buyers order, in the store's time (--by hour|month|month_of_year)\n baker shopify countries --days 90 # where buyers are, with growth (--country DE for its regions)\n baker shopify best-sellers --days 90 # what sells (--view variants|trend|together|repeat|momentum)\n baker shopify buyers --days 90 --by channel # who buys, repeat rate, segments, value by acquisition channel\n baker shopify buyer 1042 # one numbered customer's orders\n baker shopify segments # best, loyal, at risk, new, one-time — and who to find more of\n baker shopify cohorts --months 12 # buyers by first-order month: who came back\n baker shopify promotions <product> # what advertises it: ads, landings, Shopping (read before pausing)\n baker shopify stock-holds --product <product> # what Baker paused because it ran out: what to resume, what to tell the user\n baker shopify change product update <product> --title \"…\" # stage a store change (product|variant|field|collection|discount|redirect|campaign|measurement)\n baker shopify draft list # the store changes staged on this chat\n baker shopify changes # what Baker changed in the store; baker shopify undo <changeId> puts one back\n baker shopify tracking audit # is the store measured right? (reads only)\n\nProduct photos are already in the image library: place them by imageId\n(baker images download <imageIds> --out src/pages/<page>/_images/), never by a cdn.shopify.com link.\nProduct videos are in the video library: place them with <Video playbackId=\"…\" />.\nOn a landing, the buy button is <ShopifyProduct product=\"…\"/> — never a buyUrl or a Shopify link\nwritten by hand. buyUrl is for ads, emails and messages; never use storeUrl (a page to look at) for it.\nA landing links to a page of the store (a collection, another product, the home) with\n<ShopifyStoreLink href=\"<storeUrl or storefrontUrl as given>\">…</ShopifyStoreLink>.\nNO_SHOPIFY_CONNECTION means no store is connected: follow error.fix. SHOPIFY_NOT_AVAILABLE means it cannot be\nconnected here yet: carry on without it. SHOPIFY_ORDERS_IMPORTING means it IS connected and its orders are still\ncoming in: try buyers/segments/audiences again in a few minutes.\nFull guide: __tooling__/docs/tools/baker/shopify.md`,\n },\n subCommands: {\n \"signup-offers\": signupOffersCommand,\n store: storeCommand,\n products: productsCommand,\n product: productCommand,\n collections: collectionsCommand,\n stock: stockCommand,\n sales: salesCommand,\n buyers: buyersCommand,\n buyer: buyerCommand,\n countries: countriesCommand,\n \"best-sellers\": bestSellersCommand,\n cohorts: cohortsCommand,\n segments: segmentsCommand,\n audiences: audiencesCommand,\n promotions: promotionsCommand,\n \"stock-holds\": stockHoldsCommand,\n change: changeCommand,\n draft: draftCommand,\n changes: changesCommand,\n undo: undoCommand,\n tracking: trackingCommand,\n catalog: catalogCommand,\n },\n});\n","/**\n * Shopify buyer audiences — the shared CLI ⇄ backend contract\n * (`baker shopify audiences create|list|remove|refresh`,\n * `/api/shopify/audiences/*`).\n *\n * An audience is a saved definition, never a list: a segment of the store's\n * buyers (Baker's order book), a consent rule, and an ad platform audience it\n * fills. Creating and removing one is staged on the chat like any store change\n * and applies at Publish; the people in it are read from Shopify, hashed and\n * sent at Publish and at every refresh, and never shown or stored. Answers\n * carry counts only.\n *\n * This package must not depend on `convex`: ids are plain strings.\n */\nimport { z } from \"zod\";\n\n/** Baker's buyer segments (`baker shopify segments`), plus every buyer the store has. */\nexport const SHOPIFY_AUDIENCE_SEGMENTS = [\"best\", \"loyal\", \"at_risk\", \"new\", \"one_time\", \"all\"] as const;\nexport const shopifyAudienceSegmentSchema = z.enum(SHOPIFY_AUDIENCE_SEGMENTS);\nexport type ShopifyAudienceSegment = z.infer<typeof shopifyAudienceSegmentSchema>;\n\nexport const SHOPIFY_AUDIENCE_SEGMENT_LABEL: Readonly<Record<ShopifyAudienceSegment, string>> = {\n best: \"Best buyers\",\n loyal: \"Loyal buyers\",\n at_risk: \"At-risk buyers\",\n new: \"New buyers\",\n one_time: \"One-time buyers\",\n all: \"All buyers\",\n};\n\nexport const shopifyAudiencePlatformSchema = z.enum([\"meta\", \"google\"]);\nexport type ShopifyAudiencePlatform = z.infer<typeof shopifyAudiencePlatformSchema>;\n\nexport const SHOPIFY_AUDIENCE_PLATFORM_LABEL: Readonly<Record<ShopifyAudiencePlatform, string>> = {\n meta: \"Meta\",\n google: \"Google Ads\",\n};\n\n/**\n * Who of the segment is sent: only what each person subscribed to — their\n * email when they accept email marketing, their phone when they accept SMS\n * marketing. The one rule today; a looser one would be a company setting a\n * manager chooses, never something a chat stages.\n */\nexport const shopifyAudienceConsentSchema = z.enum([\"marketing_subscribed\"]);\nexport type ShopifyAudienceConsent = z.infer<typeof shopifyAudienceConsentSchema>;\n\n/** `daily`: Baker reads the segment again every day and replaces who is in the audience; `off`: filled once at Publish. */\nexport const shopifyAudienceRefreshSchema = z.enum([\"daily\", \"off\"]);\nexport type ShopifyAudienceRefresh = z.infer<typeof shopifyAudienceRefreshSchema>;\n\n/** Meta `act_123…` or Google Ads `123-456-7890`, as the agent passes it. */\nconst accountIdSchema = z\n .string()\n .trim()\n .regex(/^(act_)?\\d+$|^\\d{3}-?\\d{3}-?\\d{4}$/, \"an ad account id: act_123… for Meta, 123-456-7890 for Google Ads\");\n\nexport const shopifyAudienceNameSchema = z.string().trim().min(1).max(120);\n\n/** The staged `shopify.audience.create` payload: what the audience is, where it goes, how it stays fresh. */\nexport const shopifyAudienceDefinitionSchema = z\n .object({\n segment: shopifyAudienceSegmentSchema,\n platform: shopifyAudiencePlatformSchema,\n accountId: accountIdSchema,\n /** The audience's name on the platform; default \"Shopify: <segment label>\". */\n name: shopifyAudienceNameSchema.optional(),\n consent: shopifyAudienceConsentSchema.optional(),\n refresh: shopifyAudienceRefreshSchema.optional(),\n })\n .strict();\nexport type ShopifyAudienceDefinition = z.infer<typeof shopifyAudienceDefinitionSchema>;\n\n/** The staged `shopify.audience.remove` payload. */\nexport const shopifyAudienceRemovalSchema = z\n .object({\n /** Leave the audience on the ad platform (with whoever it holds) and only stop updating it. */\n keepOnPlatform: z.boolean().optional(),\n })\n .strict();\nexport type ShopifyAudienceRemoval = z.infer<typeof shopifyAudienceRemovalSchema>;\n\n/**\n * Who an audience holds, counted — never named. `people`: buyers in the\n * segment; `withConsent`: those who accept marketing on at least one channel\n * Baker can send; `willSend`: those with a subscribed email or phone to send;\n * `largestCountry`: the country with most `willSend` people (a lookalike needs\n * 100 in one country).\n */\nexport const shopifyAudienceCountsSchema = z.object({\n people: z.number(),\n withConsent: z.number(),\n willSend: z.number(),\n emails: z.number(),\n phones: z.number(),\n largestCountry: z.object({ country: z.string(), people: z.number() }).nullable(),\n});\nexport type ShopifyAudienceCounts = z.infer<typeof shopifyAudienceCountsSchema>;\n\n/**\n * The sizes the platforms publish, said (never enforced) by the staged change's\n * warnings and the CLI's hints. Only numbers on the platforms' own pages:\n * - Google: Search, Display and YouTube each \"must have a minimum of 100 active visitors or users within\n * the last 30 days\"; \"Customer lists also have the same eligibility\" (lists uploaded or refreshed after\n * February 1, 2024). https://support.google.com/google-ads/answer/7558048\n * - Meta publishes no minimum for a customer list to show ads; its guideline is \"Customer lists should: …\n * include at least 1,000 customers.\" https://www.facebook.com/business/help/2082575038703844\n * - Meta lookalike: \"At least 100 seed audience members from a country.\"\n * https://developers.facebook.com/docs/marketing-api/audiences/guides/lookalike-audiences\n */\nexport const GOOGLE_CUSTOMER_LIST_MIN_ACTIVE = 100;\nexport const META_CUSTOMER_LIST_RECOMMENDED = 1_000;\nexport const META_LOOKALIKE_MIN_PER_COUNTRY = 100;\n\n// ---------------------------------------------------------------------------\n// POST /api/shopify/audiences/create\n// ---------------------------------------------------------------------------\n\nexport const shopifyAudienceCreateRequestSchema = z.object({\n chatId: z.string(),\n definition: shopifyAudienceDefinitionSchema,\n});\nexport type ShopifyAudienceCreateRequest = z.infer<typeof shopifyAudienceCreateRequestSchema>;\n\nexport const shopifyAudienceCreateResponseSchema = z.object({\n ref: z.string(),\n staged: z.literal(true),\n summary: z.string(),\n platform: shopifyAudiencePlatformSchema,\n accountId: z.string(),\n counts: shopifyAudienceCountsSchema,\n warnings: z.array(z.string()),\n});\nexport type ShopifyAudienceCreateResponse = z.infer<typeof shopifyAudienceCreateResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// GET /api/shopify/audiences\n// ---------------------------------------------------------------------------\n\nexport const shopifyAudienceStatusSchema = z.enum([\"active\", \"stopped\", \"removed\"]);\n\n/**\n * An audience's last run. `waiting`: the ad platform was still taking in the audience's previous\n * update (Meta says that can take up to 24 hours), so nothing was sent and nothing failed; the next\n * daily update tries again. A waiting run keeps the last run that reached the platform in `sent`,\n * `received` and `invalid`, from `sentAt`.\n */\nexport const shopifyAudienceRunSchema = z.object({\n at: z.number(),\n outcome: z.enum([\"sent\", \"waiting\", \"failed\"]),\n people: z.number(),\n withConsent: z.number(),\n sent: z.number(),\n /** How many of those sent the platform said it took in, when it says (Meta's `num_received`). */\n received: z.number().optional(),\n /** What the platform said it could not use, when it says (Meta). */\n invalid: z.number().optional(),\n /** On a waiting run: when the people in `sent` were sent. */\n sentAt: z.number().optional(),\n error: z.string().optional(),\n /** Google's Data Manager request id(s), comma-joined, for reading its processing report (`requestStatus:retrieve`). */\n requestId: z.string().optional(),\n /**\n * Google only: what Google finally made of what was sent, from its processing report, read from\n * 30 minutes after the run and backing off up to 24 hours. `processing` until then; `unknown` when\n * Google never finished or could not be read in that time. `refused` people Google could not use,\n * `reason` in plain words, `codes` Google's own, `checkedAt` the last read.\n */\n processing: z\n .object({\n status: z.enum([\"processing\", \"success\", \"partial\", \"failed\", \"unknown\"]),\n checkedAt: z.number(),\n records: z.number().optional(),\n refused: z.number().optional(),\n reason: z.string().optional(),\n codes: z.array(z.string()).optional(),\n })\n .optional(),\n});\nexport type ShopifyAudienceRun = z.infer<typeof shopifyAudienceRunSchema>;\n\nexport const shopifyAudienceViewSchema = z.object({\n id: z.string(),\n name: z.string(),\n segment: shopifyAudienceSegmentSchema,\n platform: shopifyAudiencePlatformSchema,\n accountId: z.string(),\n platformAudienceId: z.string(),\n refresh: shopifyAudienceRefreshSchema,\n status: shopifyAudienceStatusSchema,\n stoppedBecause: z.string().optional(),\n lastRun: shopifyAudienceRunSchema.optional(),\n /** Full only. */\n createdAt: z.number().optional(),\n consent: shopifyAudienceConsentSchema.optional(),\n});\nexport type ShopifyAudienceView = z.infer<typeof shopifyAudienceViewSchema>;\n\n/** A query-string flag: `z.coerce.boolean()` would read \"false\" as true. */\nconst flag = z.enum([\"true\", \"false\"]).transform((value) => value === \"true\");\n\nexport const shopifyAudienceListRequestSchema = z.object({\n chatId: z.string().optional(),\n full: flag.optional(),\n});\nexport type ShopifyAudienceListRequest = z.infer<typeof shopifyAudienceListRequestSchema>;\n\nexport const shopifyAudienceListResponseSchema = z.object({\n audiences: z.array(shopifyAudienceViewSchema),\n /** This chat's staged audience changes, not yet published. */\n staged: z.array(z.object({ ref: z.string(), kind: z.string(), summary: z.string() })),\n});\nexport type ShopifyAudienceListResponse = z.infer<typeof shopifyAudienceListResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// POST /api/shopify/audiences/remove, POST /api/shopify/audiences/refresh\n// ---------------------------------------------------------------------------\n\nexport const shopifyAudienceRemoveRequestSchema = z.object({\n chatId: z.string(),\n id: z.string().min(1),\n keepOnPlatform: z.boolean().optional(),\n});\nexport type ShopifyAudienceRemoveRequest = z.infer<typeof shopifyAudienceRemoveRequestSchema>;\n\nexport const shopifyAudienceRemoveResponseSchema = z.object({\n ref: z.string(),\n staged: z.literal(true),\n summary: z.string(),\n});\nexport type ShopifyAudienceRemoveResponse = z.infer<typeof shopifyAudienceRemoveResponseSchema>;\n\nexport const shopifyAudienceRefreshRequestSchema = z.object({ id: z.string().min(1) });\nexport type ShopifyAudienceRefreshRequest = z.infer<typeof shopifyAudienceRefreshRequestSchema>;\n\nexport const shopifyAudienceRefreshResponseSchema = z.object({\n id: z.string(),\n status: z.literal(\"running\"),\n});\nexport type ShopifyAudienceRefreshResponse = z.infer<typeof shopifyAudienceRefreshResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// Refusals the CLI turns into `error.fix`\n// ---------------------------------------------------------------------------\n\n/** Shopify has not approved Baker to read buyers' emails and phones (protected customer data, Level 2). */\nexport const SHOPIFY_AUDIENCE_PROTECTED_DATA_PREFIX = \"Shopify hasn't approved Baker to read buyers' emails and phones\";\n// The ad account's terms not accepted: `termsActionNotice` (`../ads-terms.ts`).\n\n/** The default name on the platform. */\nexport function defaultAudienceName(segment: ShopifyAudienceSegment): string {\n return `Shopify: ${SHOPIFY_AUDIENCE_SEGMENT_LABEL[segment]}`;\n}\n","import {\n type ShopifyAudienceCreateResponse,\n type ShopifyAudienceDefinition,\n type ShopifyAudienceListResponse,\n type ShopifyAudienceRefreshResponse,\n type ShopifyAudienceRemoveResponse,\n shopifyAudienceDefinitionSchema,\n} from \"@baker/api/shopify/audiences\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiGet, apiPost } from \"../../client.ts\";\nimport { optionalChatId, requireChatId } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { failValidation } from \"../ga4/shared.ts\";\nimport { audienceCreateHints, audienceListHints, audienceRefusal } from \"./audienceHints.ts\";\nimport { params } from \"./common.ts\";\nimport { failChange } from \"./writeCommon.ts\";\n\n/**\n * `baker shopify audiences create|list|remove|refresh` — the store's buyers\n * as ad audiences on Meta and Google Ads. An audience is a segment of the\n * store's buyers kept in the platform's customer list: only people who accept\n * marketing, their email or phone hashed and sent at Publish and every day\n * after, never shown or kept by Baker. Create and remove are staged on the\n * chat and apply when the user publishes it.\n */\n\nfunction failAudience(err: unknown): never {\n if (err instanceof ApiError) {\n const refusal = audienceRefusal(err.code, err.message);\n if (refusal) {\n writeJson({ ok: false, error: { code: refusal.code, message: err.message, fix: refusal.fix } });\n process.exit(1);\n }\n }\n failChange(err);\n}\n\nconst SEGMENTS = [\"best\", \"loyal\", \"at_risk\", \"new\", \"one_time\", \"all\"];\n\nconst createDescription =\n \"Start here to reach the store's own buyers with ads: stage a Meta or Google Ads audience made of one buyer segment (`baker shopify segments` explains each). Example: baker shopify audiences create --segment at_risk --to meta --account-id act_123. Only buyers who accept email or SMS marketing are sent, hashed; Baker never shows or keeps who they are. Staged until the user publishes the chat; then it is made, filled, and updated daily (--refresh off: filled once). Answers counts: people in the segment, how many accept marketing, how many will be sent.\";\nregisterSchema({\n command: \"shopify.audiences.create\",\n description: createDescription,\n args: {\n segment: {\n type: \"string\",\n description: \"best | loyal | at_risk | new | one_time | all\",\n required: true,\n enum: SEGMENTS,\n },\n to: { type: \"string\", description: \"meta | google\", required: true, enum: [\"meta\", \"google\"] },\n \"account-id\": {\n type: \"string\",\n description: \"The ad account: act_123… for Meta, 123-456-7890 for Google Ads\",\n required: true,\n },\n name: { type: \"string\", description: 'Its name on the platform (default \"Shopify: <segment>\")', required: false },\n refresh: { type: \"string\", description: \"daily (default) | off\", required: false, enum: [\"daily\", \"off\"] },\n },\n});\nconst createCommand = defineCommand({\n meta: { name: \"create\", description: createDescription },\n args: {\n segment: { type: \"string\", description: \"best | loyal | at_risk | new | one_time | all\", required: true },\n to: { type: \"string\", description: \"meta | google\", required: true },\n \"account-id\": { type: \"string\", description: \"act_123… for Meta, 123-456-7890 for Google Ads\", required: true },\n name: { type: \"string\", description: \"Its name on the platform\", required: false },\n refresh: { type: \"string\", description: \"daily (default) | off\", required: false },\n full: { type: \"boolean\", description: \"Add the definition that was staged\", required: false, default: false },\n },\n async run({ args }) {\n const parsed = shopifyAudienceDefinitionSchema.safeParse({\n segment: args.segment,\n platform: args.to,\n accountId: args[\"account-id\"],\n ...(args.name ? { name: args.name } : {}),\n ...(args.refresh ? { refresh: args.refresh } : {}),\n });\n if (!parsed.success) {\n const issue = parsed.error.issues[0];\n failValidation(`${issue?.path.join(\".\") ?? \"\"}: ${issue?.message ?? \"invalid audience\"}`);\n }\n const definition: ShopifyAudienceDefinition = parsed.data;\n const chatId = requireChatId();\n try {\n const data = await apiPost<ShopifyAudienceCreateResponse>(\n \"/api/shopify/audiences/create\",\n { chatId, definition },\n { timeoutMs: 300_000 },\n );\n const compact = {\n ref: data.ref,\n staged: data.staged,\n platform: data.platform,\n accountId: data.accountId,\n people: data.counts.people,\n withConsent: data.counts.withConsent,\n willSend: data.counts.willSend,\n ...(data.warnings.length > 0 ? { warnings: data.warnings } : {}),\n ...(args.full ? { summary: data.summary, counts: data.counts, definition } : {}),\n };\n writeJson({ ok: true, hints: audienceCreateHints(data), data: compact });\n } catch (err) {\n failAudience(err);\n }\n },\n});\n\nconst listDescription =\n \"The store's buyer audiences on Meta and Google Ads: each one's id, segment, ad account, whether it updates daily, and its last update in counts (people, how many accept marketing, how many were sent). With a chat, also this chat's staged audience changes. Example: baker shopify audiences list\";\nregisterSchema({\n command: \"shopify.audiences.list\",\n description: listDescription,\n args: {\n full: {\n type: \"boolean\",\n description: \"Add removed audiences, when each was made and its consent rule\",\n required: false,\n },\n },\n});\nconst listCommand = defineCommand({\n meta: { name: \"list\", description: listDescription },\n args: { full: { type: \"boolean\", description: \"Add removed ones and more detail\", required: false, default: false } },\n async run({ args }) {\n try {\n const data = await apiGet<ShopifyAudienceListResponse>(\n \"/api/shopify/audiences\",\n params({ chatId: optionalChatId(), full: args.full }),\n );\n writeJson({ ok: true, hints: audienceListHints(data), data });\n } catch (err) {\n failAudience(err);\n }\n },\n});\n\nconst removeDescription =\n \"Stage removing a buyer audience: Baker stops updating it and deletes it from the ad platform when the user publishes (--keep-on-platform: only stop updating). Ads using it stop reaching it once it is deleted. Example: baker shopify audiences remove <id>\";\nregisterSchema({\n command: \"shopify.audiences.remove\",\n description: removeDescription,\n args: {\n id: { type: \"positional\", description: \"The audience's id (`baker shopify audiences list`)\", required: true },\n \"keep-on-platform\": {\n type: \"boolean\",\n description: \"Leave it on the ad platform, only stop updating it\",\n required: false,\n },\n },\n});\nconst removeCommand = defineCommand({\n meta: { name: \"remove\", description: removeDescription },\n args: {\n id: { type: \"positional\", description: \"The audience's id\", required: true },\n \"keep-on-platform\": { type: \"boolean\", description: \"Only stop updating it\", required: false, default: false },\n },\n async run({ args }) {\n const chatId = requireChatId();\n try {\n const data = await apiPost<ShopifyAudienceRemoveResponse>(\"/api/shopify/audiences/remove\", {\n chatId,\n id: args.id,\n ...(args[\"keep-on-platform\"] ? { keepOnPlatform: true } : {}),\n });\n writeJson({\n ok: true,\n hints: [\"Staged on this chat until Publish: the audience keeps updating until the user publishes it.\"],\n data,\n });\n } catch (err) {\n failAudience(err);\n }\n },\n});\n\nconst refreshDescription =\n \"Update a published buyer audience now instead of waiting for its daily update: Baker reads the segment again and sends who is in it now (Meta: the audience then holds exactly them; Google: they are added, people who unsubscribed are taken out, and anyone who only left the group drops off once Google's membership period runs out — 30 days on a daily audience). Not staged — the audience was approved when it was published. Example: baker shopify audiences refresh <id>; read the outcome with `baker shopify audiences list` a minute later.\";\nregisterSchema({\n command: \"shopify.audiences.refresh\",\n description: refreshDescription,\n args: {\n id: { type: \"positional\", description: \"The audience's id (`baker shopify audiences list`)\", required: true },\n },\n});\nconst refreshCommand = defineCommand({\n meta: { name: \"refresh\", description: refreshDescription },\n args: { id: { type: \"positional\", description: \"The audience's id\", required: true } },\n async run({ args }) {\n try {\n const data = await apiPost<ShopifyAudienceRefreshResponse>(\"/api/shopify/audiences/refresh\", { id: args.id });\n writeJson({\n ok: true,\n hints: [\"Updating now; `baker shopify audiences list` shows the outcome under lastRun in a minute or two.\"],\n data,\n });\n } catch (err) {\n failAudience(err);\n }\n },\n});\n\nexport const audiencesCommand = defineCommand({\n meta: {\n name: \"audiences\",\n description:\n \"The store's buyers as Meta and Google Ads audiences: create (staged), list, remove (staged), refresh. Example: baker shopify audiences create --segment best --to meta --account-id act_123\",\n },\n subCommands: { create: createCommand, list: listCommand, remove: removeCommand, refresh: refreshCommand },\n});\n","import {\n GOOGLE_CUSTOMER_LIST_MIN_ACTIVE,\n META_CUSTOMER_LIST_RECOMMENDED,\n META_LOOKALIKE_MIN_PER_COUNTRY,\n SHOPIFY_AUDIENCE_PLATFORM_LABEL,\n SHOPIFY_AUDIENCE_PROTECTED_DATA_PREFIX,\n type ShopifyAudienceCreateResponse,\n type ShopifyAudienceListResponse,\n} from \"@baker/api/shopify/audiences\";\nimport { type TermsRefusal, termsRefusalFix } from \"../ads/terms-output.ts\";\n\n/**\n * What `baker shopify audiences` hands the agent: the next step after staging\n * one, and the refusals only a person can lift, as `error.fix`. Pure.\n */\n\nconst LOOKALIKE_MIN = META_LOOKALIKE_MIN_PER_COUNTRY;\n\n/**\n * Where the list is under what the platform publishes, without inventing a fix: the route counts only\n * this segment, so a bigger one is the fix only if `baker shopify segments` shows it holds enough.\n */\nfunction sizeHint(answer: ShopifyAudienceCreateResponse): string | undefined {\n const sends = answer.counts.willSend;\n if (sends === 0) return undefined;\n const floor =\n answer.platform === \"google\"\n ? sends < GOOGLE_CUSTOMER_LIST_MIN_ACTIVE &&\n `Google shows ads to a customer list only once at least ${GOOGLE_CUSTOMER_LIST_MIN_ACTIVE} of its people are matched and active`\n : sends < META_CUSTOMER_LIST_RECOMMENDED &&\n `Meta recommends a customer list of at least ${META_CUSTOMER_LIST_RECOMMENDED.toLocaleString(\"en-US\")} people`;\n if (!floor) return undefined;\n return `${floor}; this sends ${sends}, so it may not show ads yet — don't call it enough to reach them. The platform shows the matched size once the list is uploaded. Don't offer a bigger segment as the fix unless \\`baker shopify segments\\` shows one with that many buyers (only those who accept marketing are sent); otherwise say the list grows as more people buy and subscribe.`;\n}\n\nexport function audienceCreateHints(answer: ShopifyAudienceCreateResponse): string[] {\n const hints = [\n `Staged on this chat until Publish: nothing is sent before the user publishes it. Tell them the audience will hold ${answer.counts.willSend} of the ${answer.counts.people} buyers in this group — only people who accept marketing.`,\n ];\n const size = sizeHint(answer);\n if (size) hints.push(size);\n const largest = answer.counts.largestCountry;\n if (answer.platform === \"meta\") {\n if (!largest || largest.people < LOOKALIKE_MIN) {\n hints.push(\n `A lookalike needs at least ${LOOKALIKE_MIN} people from one country in its source; this sends ${largest ? `${largest.people} from ${largest.country}` : \"nobody with a known country\"}. Don't stage a lookalike of it yet — it grows as more buyers subscribe.`,\n );\n } else {\n hints.push(\n `To reach people like them, stage a lookalike of this audience once it is published: \\`baker ads meta audiences create --subtype LOOKALIKE\\` with the audience's id from \\`baker shopify audiences list\\` (country ${largest.country}).`,\n );\n }\n }\n return hints;\n}\n\nexport function audienceListHints(answer: ShopifyAudienceListResponse): string[] {\n const hints: string[] = [];\n if (answer.audiences.length === 0 && answer.staged.length === 0) {\n hints.push(\n \"No buyer audience yet. Stage one with `baker shopify audiences create --segment <best|loyal|at_risk|new|one_time|all> --to meta|google --account-id <id>`.\",\n );\n }\n for (const audience of answer.audiences) {\n // Only an active audience is ever updated again; a removed or stopped one's last run is history.\n if (audience.status !== \"active\") continue;\n if (audience.lastRun?.outcome === \"waiting\") {\n const platform = SHOPIFY_AUDIENCE_PLATFORM_LABEL[audience.platform];\n const next =\n audience.refresh === \"daily\"\n ? \"Baker updates it at its next daily update\"\n : `this audience has no daily update, so run \\`baker shopify audiences refresh ${audience.id}\\` again tomorrow, not sooner`;\n hints.push(\n `\"${audience.name}\" was not updated last time because ${platform} is still processing its previous update (${platform} says that can take up to 24 hours). Nothing failed and it keeps the people it already holds; ${next}. Say so in plain words and don't retry it now — it would be refused the same way.`,\n );\n continue;\n }\n const processing = processingHint(audience);\n if (processing) {\n hints.push(processing);\n continue;\n }\n if (audience.lastRun?.outcome === \"failed\") {\n hints.push(\n `\"${audience.name}\" did not update last time: ${(audience.lastRun.error ?? \"the ad platform refused\").replace(/\\.$/, \"\")}. Say so in plain words; \\`baker shopify audiences refresh ${audience.id}\\` tries again.`,\n );\n }\n }\n return hints;\n}\n\ntype ListedAudience = ShopifyAudienceListResponse[\"audiences\"][number];\n\n/** Google reason codes whose fix is a person's, outside the chat, or nobody's. */\nconst TERMS_CODES = [\"PROCESSING_ERROR_REASON_DESTINATION_ACCOUNT_ENHANCED_CONVERSIONS_TERMS_NOT_SIGNED\"];\nconst GOOGLE_SIDE_CODES = [\n \"PROCESSING_ERROR_REASON_INTERNAL_ERROR\",\n \"PROCESSING_ERROR_REASON_DESTINATION_TOO_RECENTLY_CREATED\",\n];\n\nfunction processingFix(audience: ListedAudience, codes: readonly string[]): string {\n const refresh = `\\`baker shopify audiences refresh ${audience.id}\\``;\n if (codes.some((code) => TERMS_CODES.includes(code))) {\n return `Run \\`baker ads terms --platform google --account-id ${audience.accountId}\\` and walk the user through its steps; once they are done, ${refresh} sends the people again.`;\n }\n if (codes.length > 0 && codes.every((code) => GOOGLE_SIDE_CODES.includes(code))) {\n return audience.refresh === \"daily\"\n ? \"Nothing for the user to fix: the next daily update sends them again.\"\n : `Nothing for the user to fix: ${refresh} sends them again.`;\n }\n return `Once the cause is fixed, ${refresh} sends them again.`;\n}\n\n/**\n * Google takes an update before processing it, so \"sent\" is not the end: Baker reads Google's\n * report afterwards (from 30 minutes, up to 24 hours) and a refusal there is a failed update.\n */\nfunction processingHint(audience: ListedAudience): string | undefined {\n const run = audience.lastRun;\n const processing = run?.outcome === \"sent\" ? run.processing : undefined;\n if (!processing) return undefined;\n const reason = (processing.reason ?? \"Google did not say why\").replace(/\\.$/, \"\");\n const codes = processing.codes ?? [];\n if (processing.status === \"failed\") {\n return `\"${audience.name}\": Google later refused everyone sent: ${reason}. Tell the user in plain words that Google holds none of the people from the last update, and why. ${processingFix(audience, codes)}`;\n }\n if (processing.status === \"partial\") {\n const share =\n processing.refused !== undefined && processing.records !== undefined\n ? `${processing.refused} of the ${processing.records} people sent`\n : \"some of the people sent\";\n return `\"${audience.name}\": Google later refused ${share}: ${reason}. Tell the user the rest are on the list and why those were not taken. ${processingFix(audience, codes)}`;\n }\n if (processing.status === \"unknown\") {\n return `\"${audience.name}\": Baker can't confirm Google added the people from the last update (${reason}). Tell the user it is unconfirmed, not failed; Google Ads shows the list's size.`;\n }\n return undefined;\n}\n\nexport type AudienceRefusal =\n | { code: \"SHOPIFY_CUSTOMER_DATA_NOT_APPROVED\"; fix: { action: \"continue_without\"; explanation: string } }\n | TermsRefusal;\n\nexport function audienceRefusal(code: string, message: string): AudienceRefusal | null {\n if (code !== \"FORBIDDEN\") return null;\n if (message.startsWith(SHOPIFY_AUDIENCE_PROTECTED_DATA_PREFIX)) {\n return {\n code: \"SHOPIFY_CUSTOMER_DATA_NOT_APPROVED\",\n fix: {\n action: \"continue_without\",\n explanation:\n \"Shopify hasn't approved Baker to read buyers' emails and phones, so no buyer audience can be made for this store yet; the user cannot change that from the chat. Say so plainly, offer an audience of the store's purchasers seen on the website instead (`baker ads meta audiences create --subtype WEBSITE`), and finish the rest of the task.\",\n },\n };\n }\n return termsRefusalFix(code, message);\n}\n","/**\n * Contract for who buys from a connected store, where and what (S7):\n * `GET /api/shopify/{buyers,buyer,countries,best-sellers,cohorts,segments}` —\n * `baker shopify buyers|buyer|countries|best-sellers|cohorts|segments` — and\n * the Sales view on Measure, which reads the same shapes.\n *\n * Every answer comes from Baker's own copy of the store's orders (the order\n * book), never from Shopify at request time. Money is in the store's currency\n * (`currency`), a plain number, never mixed across currencies. A buyer is a\n * numbered customer (\"Customer #1042\") with a country, region and city —\n * never a name, email or street. Orders are those **placed** in the period,\n * in the store's timezone, with everything refunded on them since.\n *\n * Compact by default; `full` adds the ids and the detail marked below.\n */\nimport { z } from \"zod\";\nimport { shopifyStoreStateSchema } from \"./wire\";\n\nconst flag = z.enum([\"true\", \"false\"]).transform((value) => value === \"true\");\n\n/** How far back a store's behaviour can be read: the order book keeps the whole history. */\nexport const SHOPIFY_STORE_WINDOW_MAX_DAYS = 3650;\n\nconst days = z.coerce.number().int().min(1).max(SHOPIFY_STORE_WINDOW_MAX_DAYS);\nconst countryCode = z\n .string()\n .regex(/^[A-Za-z]{2}$/, \"a two-letter country code, like DE\")\n .transform((value) => value.toUpperCase());\nconst limit = z.coerce.number().int().min(1).max(100);\n\nconst windowRequest = {\n days: days.optional(),\n /** Every order the store has. */\n all: flag.optional(),\n country: countryCode.optional(),\n full: flag.optional(),\n};\n\n// ---------------------------------------------------------------------------\n// What every answer carries\n// ---------------------------------------------------------------------------\n\n/** The period the answer covers: local days in the store's timezone (`from` null with every order). */\nexport const shopifyStoreWindowSchema = z.object({\n from: z.string().nullable(),\n to: z.string(),\n days: z.union([z.number(), z.literal(\"all\")]),\n timezone: z.string(),\n});\nexport type ShopifyStoreWindow = z.infer<typeof shopifyStoreWindowSchema>;\n\n/**\n * The store's past orders Baker brings in when it connects: still coming in,\n * done, failed, or not started; how far back Shopify lets it read (`all`, or\n * the last 60 days without `read_all_orders`) and the oldest order it holds.\n */\nexport const shopifyBuyerHistorySchema = z.object({\n state: z.enum([\"importing\", \"done\", \"failed\", \"none\"]),\n reach: z.enum([\"all\", \"60_days\"]).nullable(),\n /** The day of the oldest order Baker holds (YYYY-MM-DD). */\n from: z.string().nullable(),\n /** Orders brought in so far. */\n orders: z.number(),\n});\nexport type ShopifyBuyerHistory = z.infer<typeof shopifyBuyerHistorySchema>;\n\n/**\n * What \"new\" and \"returning\" were judged on: the store's whole history, or\n * only the last 60 days of orders Baker can see (a buyer whose earlier orders\n * are older counts as new).\n */\nexport const shopifyBuyerBasisSchema = z.enum([\"all_orders\", \"last_60_days\"]);\nexport type ShopifyBuyerBasis = z.infer<typeof shopifyBuyerBasisSchema>;\n\nconst answerCommon = {\n store: shopifyStoreStateSchema,\n window: shopifyStoreWindowSchema,\n /** The store's currency; null when it has no orders yet. */\n currency: z.string().nullable(),\n /** Orders in another currency (the store changed currency), never added to these. */\n otherCurrencies: z.array(z.object({ currency: z.string(), orders: z.number(), net: z.number() })).optional(),\n history: shopifyBuyerHistorySchema,\n basis: shopifyBuyerBasisSchema,\n};\n\n/** Where an order went or a buyer last ordered: never the street. Empty country = unknown. */\nexport const shopifyPlaceSchema = z.object({\n country: z.string(),\n countryName: z.string(),\n region: z.string(),\n city: z.string(),\n});\nexport type ShopifyPlace = z.infer<typeof shopifyPlaceSchema>;\n\n// ---------------------------------------------------------------------------\n// Segments\n// ---------------------------------------------------------------------------\n\nexport const shopifyBuyerSegmentSchema = z.enum([\"best\", \"loyal\", \"at_risk\", \"new\", \"one_time\"]);\nexport type ShopifyBuyerSegment = z.infer<typeof shopifyBuyerSegmentSchema>;\n\n/** The store's own thresholds the segments were judged by. */\nexport const shopifySegmentThresholdsSchema = z.object({\n /** The store's typical days between a repeat buyer's orders (90 with too few to go on). */\n gapDays: z.number(),\n /** The lifetime net that puts a buyer in the top fifth. */\n netP80: z.number(),\n});\n\nexport const shopifySegmentRowSchema = z.object({\n segment: shopifyBuyerSegmentSchema,\n label: z.string(),\n /** The rule in words, with this store's numbers. */\n rule: z.string(),\n buyers: z.number(),\n /** Of every buyer, 0–1. */\n share: z.number(),\n net: z.number(),\n averageOrders: z.number(),\n averageDaysSinceLastOrder: z.number(),\n topCountries: z.array(z.object({ code: z.string(), name: z.string(), buyers: z.number() })),\n /** The products their first orders held most often. */\n topFirstProducts: z.array(z.object({ title: z.string(), buyers: z.number(), productId: z.string().optional() })),\n});\nexport type ShopifySegmentRow = z.infer<typeof shopifySegmentRowSchema>;\n\nexport const shopifySegmentsRequestSchema = z.object({ ...windowRequest });\nexport type ShopifySegmentsRequest = z.infer<typeof shopifySegmentsRequestSchema>;\n\nexport const shopifySegmentsResponseSchema = z.object({\n ...answerCommon,\n thresholds: shopifySegmentThresholdsSchema,\n buyers: z.number(),\n segments: z.array(shopifySegmentRowSchema),\n});\nexport type ShopifySegmentsResponse = z.infer<typeof shopifySegmentsResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// Buyers\n// ---------------------------------------------------------------------------\n\nexport const shopifyBuyersSortSchema = z.enum([\"net\", \"orders\", \"recent\", \"first\"]);\nexport const shopifyAcquisitionBySchema = z.enum([\"campaign\", \"channel\"]);\n\nexport const shopifyBuyersRequestSchema = z.object({\n ...windowRequest,\n segment: shopifyBuyerSegmentSchema.optional(),\n /** Lifetime value by the campaign or channel of each buyer's first order. */\n by: shopifyAcquisitionBySchema.optional(),\n /** Only buyers whose first order came through this channel (a key from `by=channel`). */\n channel: z.string().max(200).optional(),\n sort: shopifyBuyersSortSchema.optional(),\n limit: limit.optional(),\n offset: z.coerce.number().int().min(0).max(100_000).optional(),\n});\nexport type ShopifyBuyersRequest = z.infer<typeof shopifyBuyersRequestSchema>;\n\nexport const shopifyBuyersSummarySchema = z.object({\n /** Buyers who ordered in the period. */\n buyers: z.number(),\n /** Of them, whose first order was in the period. */\n newBuyers: z.number(),\n returningBuyers: z.number(),\n /** Orders with no customer: counted in money, never a buyer. */\n guestOrders: z.number(),\n orders: z.number(),\n net: z.number(),\n averageOrder: z.number(),\n /** Orders that were their buyer's first, and the rest (Shopify's new vs returning). */\n newOrders: z.number(),\n returningOrders: z.number(),\n newNet: z.number(),\n returningNet: z.number(),\n /** Of every buyer up to the period's end, the share who ordered again (0–1). */\n repeatRate: z.number(),\n /** Median days from a buyer's first order to their second; null when nobody ordered twice. */\n medianDaysToSecond: z.number().nullable(),\n});\nexport type ShopifyBuyersSummary = z.infer<typeof shopifyBuyersSummarySchema>;\n\n/** How a buyer first came: the campaign or channel credited with their first order. */\nexport const shopifyCameFromSchema = z.object({\n channel: z.string(),\n label: z.string(),\n campaign: z.string().optional(),\n // --full\n source: z.string().optional(),\n medium: z.string().optional(),\n clickPlatform: z.string().optional(),\n landingId: z.string().optional(),\n});\n\nexport const shopifyBuyerRowSchema = z.object({\n number: z.number(),\n /** \"Customer #1042\". */\n label: z.string(),\n place: shopifyPlaceSchema.nullable(),\n orders: z.number(),\n net: z.number(),\n firstOrderAt: z.string(),\n lastOrderAt: z.string(),\n segment: shopifyBuyerSegmentSchema,\n cameFrom: shopifyCameFromSchema,\n // --full\n gross: z.number().optional(),\n refunded: z.number().optional(),\n ordersWithDiscount: z.number().optional(),\n averageDaysBetweenOrders: z.number().nullable().optional(),\n});\nexport type ShopifyBuyerRow = z.infer<typeof shopifyBuyerRowSchema>;\n\n/** Lifetime value per acquisition campaign or channel, for buyers whose first order is in the period. */\nexport const shopifyAcquisitionRowSchema = z.object({\n key: z.string(),\n label: z.string(),\n buyers: z.number(),\n /** What their first orders came to. */\n firstNet: z.number(),\n /** What they have spent since, to date. */\n lifetimeNet: z.number(),\n lifetimePerBuyer: z.number(),\n averageOrders: z.number(),\n repeatRate: z.number(),\n // --full\n source: z.string().optional(),\n medium: z.string().optional(),\n campaign: z.string().optional(),\n clickPlatform: z.string().optional(),\n});\nexport type ShopifyAcquisitionRow = z.infer<typeof shopifyAcquisitionRowSchema>;\n\nexport const shopifyBuyersResponseSchema = z.object({\n ...answerCommon,\n summary: shopifyBuyersSummarySchema,\n thresholds: shopifySegmentThresholdsSchema,\n segments: z.array(z.object({ segment: shopifyBuyerSegmentSchema, label: z.string(), buyers: z.number() })),\n /** Buyers matching the filters, before the limit. */\n total: z.number(),\n buyers: z.array(shopifyBuyerRowSchema),\n acquisition: z.object({ by: shopifyAcquisitionBySchema, rows: z.array(shopifyAcquisitionRowSchema) }).optional(),\n});\nexport type ShopifyBuyersResponse = z.infer<typeof shopifyBuyersResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// One buyer\n// ---------------------------------------------------------------------------\n\n/** `1042`, `#1042` or `Customer #1042`. */\nexport const shopifyBuyerNumberSchema = z\n .string()\n .trim()\n .transform((value) => value.replace(/^customer\\s*/i, \"\").replace(/^#/, \"\"))\n .pipe(z.string().regex(/^\\d+$/, \"a buyer's number, like 1042 or #1042\"))\n .transform((value) => Number(value))\n .pipe(z.number().int().min(1).max(4_000_000_000));\n\nexport const shopifyBuyerRequestSchema = z.object({ number: shopifyBuyerNumberSchema, full: flag.optional() });\nexport type ShopifyBuyerRequest = z.infer<typeof shopifyBuyerRequestSchema>;\n\n/** A buyer Baker no longer holds: their store asked Baker to erase them, or they were merged into another. */\nexport const SHOPIFY_BUYER_GONE_MESSAGE = \"This buyer is no longer in Baker.\";\nexport const SHOPIFY_BUYER_NOT_FOUND_PREFIX = \"No buyer\";\n\nexport const shopifyBuyerOrderSchema = z.object({\n name: z.string(),\n /** When it was placed, in the store's time (YYYY-MM-DD HH:MM). */\n placedAt: z.string(),\n net: z.number(),\n gross: z.number(),\n refunded: z.number(),\n products: z.array(z.object({ title: z.string(), quantity: z.number() })),\n discountCodes: z.array(z.string()),\n place: shopifyPlaceSchema.nullable(),\n /** Placed before Baker measured the store: counted, credited to no campaign. */\n beforeBaker: z.boolean(),\n // --full\n orderId: z.string().optional(),\n items: z\n .array(z.object({ productId: z.string(), variantId: z.string(), quantity: z.number(), amount: z.number() }))\n .optional(),\n refundedItems: z\n .array(z.object({ productId: z.string(), variantId: z.string(), quantity: z.number(), amount: z.number() }))\n .optional(),\n cameFrom: shopifyCameFromSchema.optional(),\n});\nexport type ShopifyBuyerOrder = z.infer<typeof shopifyBuyerOrderSchema>;\n\nexport const shopifyBuyerProfileSchema = z.object({\n number: z.number(),\n label: z.string(),\n place: shopifyPlaceSchema.nullable(),\n orders: z.number(),\n gross: z.number(),\n refunded: z.number(),\n net: z.number(),\n averageOrder: z.number(),\n /** Average days between their orders; null with one order. */\n averageDaysBetweenOrders: z.number().nullable(),\n firstOrderAt: z.string(),\n lastOrderAt: z.string(),\n ordersWithDiscount: z.number(),\n segment: shopifyBuyerSegmentSchema,\n segmentLabel: z.string(),\n cameFrom: shopifyCameFromSchema,\n});\nexport type ShopifyBuyerProfile = z.infer<typeof shopifyBuyerProfileSchema>;\n\nexport const shopifyBuyerResponseSchema = z.object({\n ...answerCommon,\n buyer: shopifyBuyerProfileSchema,\n /** Newest first. */\n orders: z.array(shopifyBuyerOrderSchema),\n products: z.array(\n z.object({ title: z.string(), quantity: z.number(), orders: z.number(), productId: z.string().optional() }),\n ),\n});\nexport type ShopifyBuyerResponse = z.infer<typeof shopifyBuyerResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// Countries\n// ---------------------------------------------------------------------------\n\nexport const shopifyCountriesRequestSchema = z.object({\n ...windowRequest,\n /** Inside one region of `country` (its code or name): its cities. */\n region: z.string().max(100).optional(),\n /** Only orders holding this product (its id or handle); money is that product's lines. */\n product: z.string().max(255).optional(),\n limit: limit.optional(),\n});\nexport type ShopifyCountriesRequest = z.infer<typeof shopifyCountriesRequestSchema>;\n\nexport const shopifyPlaceRowSchema = z.object({\n /** A country code, a region code (or name) or a city. */\n key: z.string(),\n name: z.string(),\n orders: z.number(),\n buyers: z.number(),\n newBuyers: z.number(),\n net: z.number(),\n averageOrder: z.number(),\n /** Of the total's net, 0–1. */\n share: z.number(),\n /** Net against the period before; null when there was none before. */\n growth: z.number().nullable(),\n ordersGrowth: z.number().nullable(),\n /** The currency its buyers paid in most. */\n paidIn: z.string(),\n // --full\n previousNet: z.number().optional(),\n previousOrders: z.number().optional(),\n});\nexport type ShopifyPlaceRow = z.infer<typeof shopifyPlaceRowSchema>;\n\nexport const shopifyCountriesResponseSchema = z.object({\n ...answerCommon,\n level: z.enum([\"country\", \"region\", \"city\"]),\n country: z.string().optional(),\n region: z.string().optional(),\n product: z.object({ id: z.string(), title: z.string() }).optional(),\n total: shopifyPlaceRowSchema,\n /** Named places, best first; with `unknown` and `other` they add up to `total`. */\n rows: z.array(shopifyPlaceRowSchema),\n /** Orders whose address Baker could not read. Always shown, never folded into `other`. */\n unknown: shopifyPlaceRowSchema.nullable(),\n /** Places past the limit, together. */\n other: shopifyPlaceRowSchema.nullable(),\n});\nexport type ShopifyCountriesResponse = z.infer<typeof shopifyCountriesResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// Best sellers\n// ---------------------------------------------------------------------------\n\nexport const shopifyBestSellersViewSchema = z.enum([\"products\", \"variants\", \"trend\", \"together\", \"repeat\", \"momentum\"]);\nexport type ShopifyBestSellersView = z.infer<typeof shopifyBestSellersViewSchema>;\nexport const shopifyBestSellersSortSchema = z.enum([\"units\", \"revenue\", \"orders\"]);\n\nexport const shopifyBestSellersRequestSchema = z.object({\n ...windowRequest,\n view: shopifyBestSellersViewSchema.optional(),\n sort: shopifyBestSellersSortSchema.optional(),\n /** Only this product (its id or handle): its variants, its trend. */\n product: z.string().max(255).optional(),\n limit: limit.optional(),\n});\nexport type ShopifyBestSellersRequest = z.infer<typeof shopifyBestSellersRequestSchema>;\n\n/** Units ordered (before anything came back) and refunded units side by side: net units are the difference. */\nexport const shopifyBestSellerRowSchema = z.object({\n title: z.string(),\n /** The option's own title, by variant. */\n variantTitle: z.string().optional(),\n units: z.number(),\n refundedUnits: z.number(),\n orders: z.number(),\n buyers: z.number(),\n revenue: z.number(),\n refunded: z.number(),\n /** Refunded units of units ordered, 0–1. */\n refundRate: z.number(),\n /** Units against the period before; null when none sold before. */\n growth: z.number().nullable(),\n // --full\n productId: z.string().optional(),\n variantId: z.string().optional(),\n previousUnits: z.number().optional(),\n previousRevenue: z.number().optional(),\n});\nexport type ShopifyBestSellerRow = z.infer<typeof shopifyBestSellerRowSchema>;\n\nexport const shopifyTrendRowSchema = z.object({\n /** YYYY-MM, in the store's time. */\n month: z.string(),\n title: z.string(),\n units: z.number(),\n revenue: z.number(),\n productId: z.string().optional(),\n});\n\nexport const shopifyTogetherRowSchema = z.object({\n first: z.string(),\n second: z.string(),\n /** Orders holding both. */\n orders: z.number(),\n /** Of the orders holding the first, the share that also held the second (0–1). */\n confidence: z.number(),\n firstId: z.string().optional(),\n secondId: z.string().optional(),\n});\n\nexport const shopifyRepeatRowSchema = z.object({\n title: z.string(),\n /** Buyers whose first order held it. */\n buyers: z.number(),\n /** Of them, who ordered again. */\n buyersAgain: z.number(),\n share: z.number(),\n medianDaysToSecond: z.number().nullable(),\n productId: z.string().optional(),\n});\n\nexport const shopifyMomentumRowSchema = z.object({\n title: z.string(),\n units: z.number(),\n previousUnits: z.number(),\n /** Units against the period before (−0.4 = 40% fewer). */\n change: z.number(),\n revenue: z.number(),\n productId: z.string().optional(),\n});\n\nexport const shopifyBestSellersResponseSchema = z.object({\n ...answerCommon,\n view: shopifyBestSellersViewSchema,\n sort: shopifyBestSellersSortSchema,\n product: z.object({ id: z.string(), title: z.string() }).optional(),\n products: z.array(shopifyBestSellerRowSchema).optional(),\n variants: z.array(shopifyBestSellerRowSchema).optional(),\n trend: z.array(shopifyTrendRowSchema).optional(),\n together: z.array(shopifyTogetherRowSchema).optional(),\n repeat: z.array(shopifyRepeatRowSchema).optional(),\n momentum: z.array(shopifyMomentumRowSchema).optional(),\n});\nexport type ShopifyBestSellersResponse = z.infer<typeof shopifyBestSellersResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// Cohorts\n// ---------------------------------------------------------------------------\n\nexport const shopifyCohortsRequestSchema = z.object({\n months: z.coerce.number().int().min(3).max(36).optional(),\n country: countryCode.optional(),\n full: flag.optional(),\n});\nexport type ShopifyCohortsRequest = z.infer<typeof shopifyCohortsRequestSchema>;\n\nexport const shopifyCohortMonthSchema = z.object({\n /** Months since the first order: 0 is the month they first bought. */\n offset: z.number(),\n activeBuyers: z.number(),\n orders: z.number(),\n net: z.number(),\n /** Of the cohort, who ordered in that month (0–1). */\n retention: z.number(),\n /** What the cohort spent up to that month, per buyer. */\n cumulativeNetPerBuyer: z.number(),\n});\n\nexport const shopifyCohortSchema = z.object({\n /** The month of their first order, YYYY-MM in the store's time. */\n month: z.string(),\n size: z.number(),\n /** Who ordered again 1, 2, 3, 6 and 12 months after; null for a month not reached yet. */\n retention: z.object({\n m1: z.number().nullable(),\n m2: z.number().nullable(),\n m3: z.number().nullable(),\n m6: z.number().nullable(),\n m12: z.number().nullable(),\n }),\n netPerBuyerAt12: z.number().nullable(),\n // --full\n matrix: z.array(shopifyCohortMonthSchema).optional(),\n});\nexport type ShopifyCohort = z.infer<typeof shopifyCohortSchema>;\n\nexport const shopifyCohortsResponseSchema = z.object({\n ...answerCommon,\n months: z.number(),\n cohorts: z.array(shopifyCohortSchema),\n});\nexport type ShopifyCohortsResponse = z.infer<typeof shopifyCohortsResponseSchema>;\n","/**\n * Staged changes to a connected Shopify store — the shared CLI ⇄ backend\n * contract (`baker shopify change …`, `/api/shopify/draft/*`, `/api/shopify/undo`).\n *\n * Nothing here reaches the store while a chat is open: an op is read against\n * the live store, checked, and stored on the chat's store draft; completing the\n * chat applies it, and every applied op can be put back by another publish\n * (`baker shopify undo`). Payloads are strict — an unknown key is a typo the\n * agent can fix now rather than a change that silently does less.\n *\n * Money (a price, any discount code) is only staged once the user has said yes\n * to exactly that change in the chat; the backend answers `needsApproval` with\n * the question to ask, ready to pass to AskUserQuestion.\n *\n * This package must not depend on `convex`: ids are plain strings.\n */\nimport { z } from \"zod\";\nimport {\n defaultAudienceName,\n SHOPIFY_AUDIENCE_PLATFORM_LABEL,\n SHOPIFY_AUDIENCE_SEGMENT_LABEL,\n type ShopifyAudienceDefinition,\n shopifyAudienceDefinitionSchema,\n shopifyAudienceRemovalSchema,\n} from \"./audiences\";\nimport { signupOfferHandleSchema } from \"./signups\";\n\nexport const SHOPIFY_TEMP_REF_PREFIX = \"shopify_temp_\";\n\n/** The start of the refusal for a store change Baker has no permission for yet; the CLI maps it to `request_connection`. */\nexport const SHOPIFY_PERMISSION_NEEDED_PREFIX = \"Baker isn't allowed to change this Shopify store yet\";\n\nexport const shopifyWriteEntitySchema = z.enum([\n \"product\",\n \"variant\",\n \"metafield\",\n \"collection\",\n \"discountCode\",\n \"urlRedirect\",\n \"marketingActivity\",\n \"webPixel\",\n \"signupOffer\",\n \"audience\",\n]);\nexport type ShopifyWriteEntity = z.infer<typeof shopifyWriteEntitySchema>;\n\nexport const shopifyDraftOpKindSchema = z.enum([\n \"shopify.product.update\",\n \"shopify.variant.update\",\n \"shopify.metafield.set\",\n \"shopify.metafield.delete\",\n \"shopify.collection.create\",\n \"shopify.collection.publish\",\n \"shopify.collection.unpublish\",\n \"shopify.collection.update\",\n \"shopify.collection.delete\",\n \"shopify.collection.addProducts\",\n \"shopify.collection.removeProducts\",\n \"shopify.discountCode.create\",\n \"shopify.discountCode.deactivate\",\n \"shopify.discountCode.schedule\",\n \"shopify.urlRedirect.create\",\n \"shopify.urlRedirect.delete\",\n \"shopify.marketingActivity.upsert\",\n \"shopify.marketingActivity.delete\",\n \"shopify.webPixel.update\",\n \"shopify.signupOffer.set\",\n \"shopify.signupOffer.end\",\n \"shopify.audience.create\",\n \"shopify.audience.remove\",\n]);\nexport type ShopifyDraftOpKind = z.infer<typeof shopifyDraftOpKindSchema>;\n\nexport type ShopifyWriteOperation =\n | \"create\"\n | \"update\"\n | \"delete\"\n | \"set\"\n | \"publish\"\n | \"unpublish\"\n | \"addProducts\"\n | \"removeProducts\"\n | \"deactivate\"\n | \"schedule\"\n | \"upsert\"\n | \"end\"\n | \"remove\";\n\n/** `shopify.<entity>.<verb>` — the entity is the second-to-last segment. */\nexport function entityOfKind(kind: ShopifyDraftOpKind): ShopifyWriteEntity {\n return shopifyWriteEntitySchema.parse(kind.split(\".\")[1]);\n}\n\nexport function operationOfKind(kind: ShopifyDraftOpKind): ShopifyWriteOperation {\n return kind.split(\".\")[2] as ShopifyWriteOperation;\n}\n\nexport function isCreateKind(kind: ShopifyDraftOpKind): boolean {\n return operationOfKind(kind) === \"create\";\n}\n\n/** Ops that take something away from the store — they run child-first, after every create and update. */\nexport function isRemovalKind(kind: ShopifyDraftOpKind): boolean {\n return (\n kind === \"shopify.metafield.delete\" ||\n kind === \"shopify.collection.removeProducts\" ||\n kind === \"shopify.collection.unpublish\" ||\n kind === \"shopify.collection.delete\" ||\n kind === \"shopify.discountCode.deactivate\" ||\n kind === \"shopify.urlRedirect.delete\" ||\n kind === \"shopify.marketingActivity.delete\" ||\n kind === \"shopify.signupOffer.end\" ||\n kind === \"shopify.audience.remove\"\n );\n}\n\n// ---------------------------------------------------------------------------\n// Payloads\n// ---------------------------------------------------------------------------\n\n/** A decimal amount as Shopify takes it: \"649.95\", never a float. Minor digits are checked per currency at stage time. */\nexport const shopifyDecimalSchema = z\n .string()\n .regex(/^\\d{1,12}(\\.\\d{1,4})?$/, 'write amounts as a decimal string, e.g. \"19.95\"');\n\nconst tagSchema = z.string().trim().min(1).max(255);\n\nconst seoSchema = z\n .object({ title: z.string().max(255).optional(), description: z.string().max(320).optional() })\n .strict();\n\n/** Shopify's own description ceiling is far higher; this keeps a draft within its storage budget. */\nexport const SHOPIFY_DESCRIPTION_MAX_CHARS = 200_000;\nconst descriptionHtmlSchema = z.string().max(SHOPIFY_DESCRIPTION_MAX_CHARS);\n\nconst productUpdateSchema = z\n .object({\n title: z.string().trim().min(1).max(255).optional(),\n descriptionHtml: descriptionHtmlSchema.optional(),\n seo: seoSchema.optional(),\n /** The WHOLE tag list after the change (Shopify replaces it). `addTags`/`removeTags` are resolved against the live tags. */\n tags: z.array(tagSchema).max(250).optional(),\n addTags: z.array(tagSchema).max(250).optional(),\n removeTags: z.array(tagSchema).max(250).optional(),\n productType: z.string().max(255).optional(),\n })\n .strict()\n .refine((payload) => Object.keys(payload).length > 0, \"name at least one thing to change\")\n .refine(\n (payload) => payload.tags === undefined || (payload.addTags === undefined && payload.removeTags === undefined),\n \"give either the whole `tags` list or `addTags`/`removeTags`, not both\",\n );\n\nexport const shopifyWeightUnitSchema = z.enum([\"GRAMS\", \"KILOGRAMS\", \"OUNCES\", \"POUNDS\"]);\nexport type ShopifyWeightUnit = z.infer<typeof shopifyWeightUnitSchema>;\n\nconst variantUpdateSchema = z\n .object({\n barcode: z.string().trim().max(255).optional(),\n sku: z.string().trim().max(255).optional(),\n weight: z.object({ value: z.number().nonnegative(), unit: shopifyWeightUnitSchema }).strict().optional(),\n price: shopifyDecimalSchema.optional(),\n /** `null` clears the sale (\"compare at\") price. */\n compareAtPrice: shopifyDecimalSchema.nullable().optional(),\n })\n .strict()\n .refine((payload) => Object.keys(payload).length > 0, \"name at least one thing to change\");\n\nconst metafieldKeySchema = z\n .string()\n .min(2)\n .max(64)\n .regex(/^[A-Za-z0-9_-]+$/, \"letters, digits, `_` and `-` only\");\nconst metafieldNamespaceSchema = z\n .string()\n .min(2)\n .max(255)\n .regex(/^[A-Za-z0-9_-]+$/, \"letters, digits, `_` and `-` only\");\n\nconst metafieldSetSchema = z\n .object({\n namespace: metafieldNamespaceSchema,\n key: metafieldKeySchema,\n /** Shopify's metafield type, e.g. `single_line_text_field`, `multi_line_text_field`, `rich_text_field`, `number_integer`, `boolean`, `json`. */\n type: z.string().min(1).max(100),\n value: z.string().max(100_000),\n })\n .strict();\n\nconst metafieldDeleteSchema = z.object({ namespace: metafieldNamespaceSchema, key: metafieldKeySchema }).strict();\n\nexport const shopifyCollectionSortOrderSchema = z.enum([\n \"MANUAL\",\n \"BEST_SELLING\",\n \"ALPHA_ASC\",\n \"ALPHA_DESC\",\n \"PRICE_DESC\",\n \"PRICE_ASC\",\n \"CREATED\",\n \"CREATED_DESC\",\n]);\n\nconst handleSchema = z\n .string()\n .min(1)\n .max(255)\n .regex(/^[a-z0-9]+(?:-[a-z0-9]+)*$/, \"lowercase letters, digits and single dashes, e.g. summer-snowboards\");\n\n/** The most products one collection change carries — one Shopify selection page. */\nexport const SHOPIFY_COLLECTION_PRODUCTS_MAX = 250;\n\nconst collectionCreateSchema = z\n .object({\n title: z.string().trim().min(1).max(255),\n handle: handleSchema.optional(),\n descriptionHtml: descriptionHtmlSchema.optional(),\n seo: seoSchema.optional(),\n sortOrder: shopifyCollectionSortOrderSchema.optional(),\n /** The theme template the collection page uses (the part after `collection.`). Kept when a deleted collection is put back. */\n templateSuffix: z.string().max(255).optional(),\n /** Product ids, handles or links, in the order shown with sort order MANUAL. */\n products: z.array(z.string().min(1)).max(SHOPIFY_COLLECTION_PRODUCTS_MAX).optional(),\n /** Show it on the online store (a second change, staged with it). Default true. */\n onlineStore: z.boolean().optional(),\n })\n .strict();\n\nconst collectionUpdateSchema = z\n .object({\n title: z.string().trim().min(1).max(255).optional(),\n descriptionHtml: descriptionHtmlSchema.optional(),\n seo: seoSchema.optional(),\n sortOrder: shopifyCollectionSortOrderSchema.optional(),\n })\n .strict()\n .refine((payload) => Object.keys(payload).length > 0, \"name at least one thing to change\");\n\nconst collectionProductsSchema = z\n .object({ products: z.array(z.string().min(1)).min(1).max(SHOPIFY_COLLECTION_PRODUCTS_MAX) })\n .strict();\n\nconst isoDateTimeSchema = z.iso.datetime({ offset: true });\n\nexport const discountCodeSchema = z\n .string()\n .regex(/^[A-Za-z0-9_-]{3,64}$/, \"3–64 letters, digits, `_` or `-`, e.g. SPRING10\");\n\nexport const discountValueSchema = z.union([\n z.object({ percentage: z.number().min(1).max(100) }).strict(),\n z.object({ amount: shopifyDecimalSchema }).strict(),\n]);\n\nexport const discountAppliesToSchema = z.union([\n z.object({ all: z.literal(true) }).strict(),\n z.object({ products: z.array(z.string().min(1)).min(1).max(100) }).strict(),\n z.object({ collections: z.array(z.string().min(1)).min(1).max(100) }).strict(),\n]);\n\nconst discountCreateSchema = z\n .object({\n code: discountCodeSchema,\n /** What the store's staff see; defaults to the code. */\n title: z.string().trim().min(1).max(255).optional(),\n value: discountValueSchema,\n appliesTo: discountAppliesToSchema,\n minimumSubtotal: shopifyDecimalSchema.optional(),\n minimumQuantity: z.number().int().min(1).max(10_000).optional(),\n /** Default: the moment it is published. */\n startsAt: isoDateTimeSchema.optional(),\n endsAt: isoDateTimeSchema.optional(),\n usageLimit: z.number().int().min(1).max(1_000_000).optional(),\n /** Default true. */\n oncePerCustomer: z.boolean().optional(),\n combinesWith: z\n .object({\n productDiscounts: z.boolean().optional(),\n orderDiscounts: z.boolean().optional(),\n shippingDiscounts: z.boolean().optional(),\n })\n .strict()\n .optional(),\n })\n .strict()\n .refine(\n (payload) => payload.minimumSubtotal === undefined || payload.minimumQuantity === undefined,\n \"a discount takes a minimum amount or a minimum quantity, not both\",\n );\n\nconst discountScheduleSchema = z.object({ startsAt: isoDateTimeSchema, endsAt: isoDateTimeSchema.nullable() }).strict();\n\n/** A path on the store, e.g. `/collections/old-boards`. */\nconst storePathSchema = z\n .string()\n .min(2)\n .max(1024)\n .regex(/^\\/[^\\s]*$/, 'a path on the store starting with \"/\", e.g. /collections/old');\n\nconst urlRedirectCreateSchema = z\n .object({\n from: storePathSchema,\n to: z.union([storePathSchema, z.url({ protocol: /^https$/ })]),\n })\n .strict();\n\nexport const shopifyMarketingPlatformSchema = z.enum([\"google-ads\", \"meta\"]);\nexport type ShopifyMarketingPlatform = z.infer<typeof shopifyMarketingPlatformSchema>;\n\nconst marketingUpsertSchema = z\n .object({\n platform: shopifyMarketingPlatformSchema,\n accountId: z.string().min(1).max(64),\n campaignId: z.string().regex(/^\\d+$/, \"the campaign's numeric id\"),\n utm: z\n .object({\n campaign: z.string().trim().min(1).max(255),\n source: z.string().trim().min(1).max(255),\n medium: z.string().trim().min(1).max(255),\n })\n .strict(),\n })\n .strict();\n\n/**\n * What every person who signs up gets: their own one-time code, made the\n * moment they sign up, worth `value` on `appliesTo`, valid `validForDays` from\n * then (never past `endsAt`). `maxCodes` caps how many codes the offer gives.\n */\nexport const signupOfferSetSchema = z\n .object({\n /** What the store's staff see in front of each code, and the Store page's row. */\n name: z.string().trim().min(1).max(80),\n value: discountValueSchema,\n appliesTo: discountAppliesToSchema,\n minimumSubtotal: shopifyDecimalSchema.optional(),\n /** Each code's life, from the moment it is given. */\n validForDays: z.number().int().min(1).max(365),\n /** The offer stops giving codes after this; no code outlives it. */\n endsAt: isoDateTimeSchema.optional(),\n /** How many codes the offer gives in all. */\n maxCodes: z.number().int().min(1).max(100_000).optional(),\n /** The start of every code (WELCOME-7Q2M9XKD); default: the handle in capitals. */\n codePrefix: z\n .string()\n .regex(/^[A-Z0-9]{2,12}$/, \"2–12 capital letters or digits, e.g. WELCOME\")\n .optional(),\n combinesWith: z\n .object({\n productDiscounts: z.boolean().optional(),\n orderDiscounts: z.boolean().optional(),\n shippingDiscounts: z.boolean().optional(),\n })\n .strict()\n .optional(),\n })\n .strict();\nexport type SignupOfferSet = z.infer<typeof signupOfferSetSchema>;\n\nconst emptySchema = z.object({}).strict();\n\nconst opFields = {\n /** Optional caller-chosen ref for a create, so later ops in the batch can name it (`shopify_temp_…`). */\n ref: z.string().startsWith(SHOPIFY_TEMP_REF_PREFIX).max(80).optional(),\n};\nconst target = z.string().trim().min(1).max(2048);\n\nexport const shopifyDraftOpInputSchema = z.discriminatedUnion(\"kind\", [\n z.object({ kind: z.literal(\"shopify.product.update\"), target, payload: productUpdateSchema, ...opFields }),\n z.object({ kind: z.literal(\"shopify.variant.update\"), target, payload: variantUpdateSchema, ...opFields }),\n z.object({ kind: z.literal(\"shopify.metafield.set\"), target, payload: metafieldSetSchema, ...opFields }),\n z.object({ kind: z.literal(\"shopify.metafield.delete\"), target, payload: metafieldDeleteSchema, ...opFields }),\n z.object({ kind: z.literal(\"shopify.collection.create\"), payload: collectionCreateSchema, ...opFields }),\n z.object({ kind: z.literal(\"shopify.collection.publish\"), target, payload: emptySchema.optional(), ...opFields }),\n z.object({ kind: z.literal(\"shopify.collection.unpublish\"), target, payload: emptySchema.optional(), ...opFields }),\n z.object({ kind: z.literal(\"shopify.collection.update\"), target, payload: collectionUpdateSchema, ...opFields }),\n z.object({ kind: z.literal(\"shopify.collection.delete\"), target, payload: emptySchema.optional(), ...opFields }),\n z.object({\n kind: z.literal(\"shopify.collection.addProducts\"),\n target,\n payload: collectionProductsSchema,\n ...opFields,\n }),\n z.object({\n kind: z.literal(\"shopify.collection.removeProducts\"),\n target,\n payload: collectionProductsSchema,\n ...opFields,\n }),\n z.object({ kind: z.literal(\"shopify.discountCode.create\"), payload: discountCreateSchema, ...opFields }),\n z.object({\n kind: z.literal(\"shopify.discountCode.deactivate\"),\n target,\n payload: emptySchema.optional(),\n ...opFields,\n }),\n z.object({ kind: z.literal(\"shopify.discountCode.schedule\"), target, payload: discountScheduleSchema, ...opFields }),\n z.object({ kind: z.literal(\"shopify.urlRedirect.create\"), payload: urlRedirectCreateSchema, ...opFields }),\n z.object({ kind: z.literal(\"shopify.urlRedirect.delete\"), target, payload: emptySchema.optional(), ...opFields }),\n z.object({ kind: z.literal(\"shopify.marketingActivity.upsert\"), payload: marketingUpsertSchema, ...opFields }),\n z.object({\n kind: z.literal(\"shopify.marketingActivity.delete\"),\n target,\n payload: emptySchema.optional(),\n ...opFields,\n }),\n z.object({ kind: z.literal(\"shopify.webPixel.update\"), payload: emptySchema.optional(), ...opFields }),\n z.object({\n kind: z.literal(\"shopify.signupOffer.set\"),\n target: signupOfferHandleSchema,\n payload: signupOfferSetSchema,\n ...opFields,\n }),\n z.object({\n kind: z.literal(\"shopify.signupOffer.end\"),\n target: signupOfferHandleSchema,\n payload: emptySchema.optional(),\n ...opFields,\n }),\n z.object({ kind: z.literal(\"shopify.audience.create\"), payload: shopifyAudienceDefinitionSchema, ...opFields }),\n /** `target`: the audience's id (`baker shopify audiences list`). */\n z.object({\n kind: z.literal(\"shopify.audience.remove\"),\n target,\n payload: shopifyAudienceRemovalSchema.optional(),\n ...opFields,\n }),\n]);\nexport type ShopifyDraftOpInput = z.infer<typeof shopifyDraftOpInputSchema>;\nexport type ShopifyDraftOpInputOf<K extends ShopifyDraftOpKind> = Extract<ShopifyDraftOpInput, { kind: K }>;\n\n/** The keys each kind's payload takes, read from the contract itself. */\nconst PAYLOAD_KEYS: ReadonlyMap<string, string[]> = new Map(\n shopifyDraftOpInputSchema.options.map((option) => {\n const payload = option.shape.payload;\n const object = payload instanceof z.ZodOptional ? payload.unwrap() : payload;\n return [option.shape.kind.value, object instanceof z.ZodObject ? Object.keys(object.shape) : []];\n }),\n);\n\n/**\n * For a payload refused for a key it doesn't take (`--json`, `draft amend --patch`):\n * the keys that kind takes, so the agent fixes the call in one go. `root` is\n * what was parsed, the issue's path leading to the payload. Empty otherwise.\n */\nexport function unknownPayloadKeysNote(issue: { code: string; path: readonly PropertyKey[] }, root: unknown): string {\n if (issue.code !== \"unrecognized_keys\" || issue.path[issue.path.length - 1] !== \"payload\") return \"\";\n let op: unknown = root;\n for (const step of issue.path.slice(0, -1)) {\n op = op !== null && typeof op === \"object\" ? (op as Record<PropertyKey, unknown>)[step] : undefined;\n }\n const kind = op !== null && typeof op === \"object\" ? (op as { kind?: unknown }).kind : undefined;\n const keys = typeof kind === \"string\" ? PAYLOAD_KEYS.get(kind) : undefined;\n if (!keys) return \"\";\n return keys.length > 0 ? `${kind} takes: ${keys.join(\", \")}` : `${kind} takes no payload`;\n}\n\n/**\n * Whether an op changes money: a price or sale price, any discount code, or a\n * sign-up offer (which makes discount codes). These are staged only after the\n * user said yes to exactly that change.\n */\nexport function isMoneyOp(input: { kind: ShopifyDraftOpKind; payload?: unknown }): boolean {\n const entity = entityOfKind(input.kind);\n if (entity === \"discountCode\" || entity === \"signupOffer\") return true;\n if (input.kind !== \"shopify.variant.update\") return false;\n const payload = (input.payload ?? {}) as Record<string, unknown>;\n return \"price\" in payload || \"compareAtPrice\" in payload;\n}\n\n// ---------------------------------------------------------------------------\n// Asking the user (AskUserQuestion, passed through verbatim)\n// ---------------------------------------------------------------------------\n\nexport const askUserQuestionInputSchema = z.object({\n questions: z\n .array(\n z.object({\n question: z.string(),\n header: z.string(),\n multiSelect: z.boolean(),\n options: z.array(z.object({ label: z.string(), description: z.string() })).min(2),\n }),\n )\n .min(1),\n});\nexport type AskUserQuestionInput = z.infer<typeof askUserQuestionInputSchema>;\n\nexport const shopifyNeedsApprovalSchema = z.object({\n /** Pass to AskUserQuestion exactly as given. */\n askUserQuestion: askUserQuestionInputSchema,\n /** The user already said no to (at least one of) these changes: don't ask again in this turn. */\n declined: z.boolean(),\n});\nexport type ShopifyNeedsApproval = z.infer<typeof shopifyNeedsApprovalSchema>;\n\n// ---------------------------------------------------------------------------\n// Results and views\n// ---------------------------------------------------------------------------\n\nexport const shopifyVerificationSchema = z.object({\n status: z.enum([\"confirmed\", \"drifted\", \"unconfirmed\"]),\n checkedAt: z.number(),\n note: z.string().optional(),\n});\n\nexport const shopifyDraftOpResultSchema = z.object({\n status: z.enum([\"applied\", \"failed\", \"skipped\"]),\n createdId: z.string().optional(),\n error: z.string().optional(),\n note: z.string().optional(),\n skippedBecause: z.string().optional(),\n executedAt: z.number().optional(),\n pendingJob: z.string().optional(),\n verification: shopifyVerificationSchema.optional(),\n});\nexport type ShopifyDraftOpResult = z.infer<typeof shopifyDraftOpResultSchema>;\n\nconst stagedOpSchema = z.object({\n ref: z.string(),\n kind: shopifyDraftOpKindSchema,\n summary: z.string(),\n warnings: z.array(z.string()),\n});\n\nexport const shopifyDraftStageResponseSchema = z.union([\n z.object({\n staged: z.literal(true),\n count: z.number(),\n ops: z.array(stagedOpSchema),\n amended: z.boolean().optional(),\n }),\n z.object({ staged: z.literal(false), needsApproval: shopifyNeedsApprovalSchema }),\n]);\nexport type ShopifyDraftStageResponse = z.infer<typeof shopifyDraftStageResponseSchema>;\n\n/** At most this many ops in one batch, and in one draft. */\nexport const SHOPIFY_DRAFT_BATCH_MAX = 100;\nexport const SHOPIFY_DRAFT_OPS_MAX = 250;\n/** At most this many money changes in one question. */\nexport const SHOPIFY_MONEY_LINES_MAX = 20;\n\nexport const shopifyDraftStageRequestSchema = z.object({ chatId: z.string(), op: shopifyDraftOpInputSchema });\nexport type ShopifyDraftStageRequest = z.infer<typeof shopifyDraftStageRequestSchema>;\n\nexport const shopifyDraftStageBatchRequestSchema = z.object({\n chatId: z.string(),\n ops: z.array(shopifyDraftOpInputSchema).min(1).max(SHOPIFY_DRAFT_BATCH_MAX),\n});\nexport type ShopifyDraftStageBatchRequest = z.infer<typeof shopifyDraftStageBatchRequestSchema>;\n\nexport const shopifyDraftAmendRequestSchema = z.object({\n chatId: z.string(),\n ref: z.string(),\n patch: z.record(z.string(), z.unknown()),\n});\nexport type ShopifyDraftAmendRequest = z.infer<typeof shopifyDraftAmendRequestSchema>;\n\nexport const shopifyDraftOpViewSchema = z.object({\n ref: z.string(),\n kind: shopifyDraftOpKindSchema,\n entity: shopifyWriteEntitySchema,\n target: z.string().optional(),\n targetLabel: z.string().optional(),\n summary: z.string(),\n money: z.boolean(),\n warnings: z.array(z.string()).optional(),\n dependsOn: z.array(z.string()),\n undoOf: z.string().optional(),\n stagedAt: z.number(),\n result: shopifyDraftOpResultSchema.optional(),\n});\nexport type ShopifyDraftOpView = z.infer<typeof shopifyDraftOpViewSchema>;\n\nexport const shopifyDraftListRequestSchema = z.object({ chatId: z.string() });\nexport type ShopifyDraftListRequest = z.infer<typeof shopifyDraftListRequestSchema>;\n\nexport const shopifyDraftListResponseSchema = z.object({\n status: z.enum([\"active\", \"publishing\", \"applied\", \"discarded\", \"none\"]),\n store: z.string().optional(),\n count: z.number(),\n ops: z.array(shopifyDraftOpViewSchema),\n publishError: z.string().optional(),\n});\nexport type ShopifyDraftListResponse = z.infer<typeof shopifyDraftListResponseSchema>;\n\nexport const shopifyDraftShowRequestSchema = z.object({ chatId: z.string(), ref: z.string() });\nexport type ShopifyDraftShowRequest = z.infer<typeof shopifyDraftShowRequestSchema>;\n\nexport const shopifyDraftShowResponseSchema = z.object({\n op: shopifyDraftOpViewSchema.extend({ payload: z.unknown().optional(), before: z.unknown().optional() }),\n});\nexport type ShopifyDraftShowResponse = z.infer<typeof shopifyDraftShowResponseSchema>;\n\nexport const shopifyDraftRemoveRequestSchema = z.object({ chatId: z.string(), ref: z.string() });\nexport type ShopifyDraftRemoveRequest = z.infer<typeof shopifyDraftRemoveRequestSchema>;\nexport const shopifyDraftRemoveResponseSchema = z.object({ removed: z.array(z.string()) });\nexport type ShopifyDraftRemoveResponse = z.infer<typeof shopifyDraftRemoveResponseSchema>;\n\nexport const shopifyDraftClearRequestSchema = z.object({ chatId: z.string() });\nexport type ShopifyDraftClearRequest = z.infer<typeof shopifyDraftClearRequestSchema>;\nexport const shopifyDraftClearResponseSchema = z.object({ cleared: z.number() });\nexport type ShopifyDraftClearResponse = z.infer<typeof shopifyDraftClearResponseSchema>;\n\n// ---------------------------------------------------------------------------\n// GET /api/shopify/changes, POST /api/shopify/undo\n// ---------------------------------------------------------------------------\n\nexport const shopifyChangeViewSchema = z.object({\n changeId: z.string(),\n when: z.string(),\n kind: shopifyDraftOpKindSchema,\n summary: z.string(),\n status: z.enum([\"applied\", \"failed\", \"undone\"]),\n chatId: z.string(),\n undoable: z.boolean(),\n /** Why it can't be undone, when it can't. Whether the store still holds Baker's change is checked when undo is staged. */\n notUndoableBecause: z.string().optional(),\n});\nexport type ShopifyChangeView = z.infer<typeof shopifyChangeViewSchema>;\n\nexport const shopifyChangesRequestSchema = z.object({\n limit: z.coerce.number().int().min(1).max(100).optional(),\n chatId: z.string().optional(),\n});\nexport type ShopifyChangesRequest = z.infer<typeof shopifyChangesRequestSchema>;\n\nexport const shopifyChangesResponseSchema = z.object({ changes: z.array(shopifyChangeViewSchema) });\nexport type ShopifyChangesResponse = z.infer<typeof shopifyChangesResponseSchema>;\n\nexport const shopifyUndoRequestSchema = z.object({\n chatId: z.string(),\n changeIds: z.array(z.string().min(1)).min(1).max(SHOPIFY_DRAFT_BATCH_MAX),\n});\nexport type ShopifyUndoRequest = z.infer<typeof shopifyUndoRequestSchema>;\n\n// ---------------------------------------------------------------------------\n// Summaries\n// ---------------------------------------------------------------------------\n\nconst ENTITY_NOUN: Record<ShopifyWriteEntity, string> = {\n product: \"product\",\n variant: \"product option\",\n metafield: \"custom field\",\n collection: \"collection\",\n discountCode: \"discount code\",\n urlRedirect: \"redirect\",\n marketingActivity: \"Baker campaign in Shopify Marketing\",\n webPixel: \"Baker's measurement\",\n signupOffer: \"sign-up offer\",\n audience: \"buyer audience\",\n};\n\nexport function entityNoun(entity: ShopifyWriteEntity): string {\n return ENTITY_NOUN[entity];\n}\n\nfunction quoted(label: string | undefined, fallback: string): string {\n return label ? `\"${label}\"` : fallback;\n}\n\nfunction fieldsOf(payload: Record<string, unknown>): string {\n const names: Record<string, string> = {\n title: \"title\",\n descriptionHtml: \"description\",\n seo: \"SEO\",\n tags: \"tags\",\n addTags: \"tags\",\n removeTags: \"tags\",\n productType: \"type\",\n barcode: \"barcode\",\n sku: \"SKU\",\n weight: \"weight\",\n price: \"price\",\n compareAtPrice: \"sale price\",\n sortOrder: \"sort order\",\n };\n return [...new Set(Object.keys(payload).map((key) => names[key] ?? key))].join(\", \");\n}\n\nfunction offText(value: { percentage: number } | { amount: string }): string {\n return \"percentage\" in value ? `${value.percentage}% off` : `${value.amount} off`;\n}\n\nfunction signupOfferSummary(payload: SignupOfferSet): string {\n const days = `${payload.validForDays} day${payload.validForDays === 1 ? \"\" : \"s\"}`;\n return `Sign-up offer \"${payload.name}\": ${offText(payload.value)}, each code valid ${days}`;\n}\n\nfunction audienceSummary(payload: ShopifyAudienceDefinition): string {\n const name = payload.name ?? defaultAudienceName(payload.segment);\n const cadence = payload.refresh === \"off\" ? \"filled once\" : \"updated daily\";\n return `Send ${SHOPIFY_AUDIENCE_SEGMENT_LABEL[payload.segment].toLowerCase()} who accept marketing to the ${SHOPIFY_AUDIENCE_PLATFORM_LABEL[payload.platform]} audience \"${name}\", ${cadence}`;\n}\n\n/**\n * One line naming the change in the reviewer's words. `label` is the target as\n * the store names it (a product's title, a collection's title), known only once\n * the store was read.\n */\nexport function summarizeOp(input: ShopifyDraftOpInput, label?: string): string {\n switch (input.kind) {\n case \"shopify.product.update\":\n return `Change ${fieldsOf(input.payload)} of product ${quoted(label, input.target)}`;\n case \"shopify.variant.update\":\n return `Change ${fieldsOf(input.payload)} of ${quoted(label, `option ${input.target}`)}`;\n case \"shopify.metafield.set\":\n return `Set custom field ${input.payload.namespace}.${input.payload.key} on ${quoted(label, input.target)}`;\n case \"shopify.metafield.delete\":\n return `Remove custom field ${input.payload.namespace}.${input.payload.key} from ${quoted(label, input.target)}`;\n case \"shopify.collection.create\":\n return `Create collection \"${input.payload.title}\"${input.payload.products?.length ? ` with ${input.payload.products.length} product${input.payload.products.length === 1 ? \"\" : \"s\"}` : \"\"}`;\n case \"shopify.collection.publish\":\n return `Show collection ${quoted(label, input.target)} on the online store`;\n case \"shopify.collection.unpublish\":\n return `Hide collection ${quoted(label, input.target)} from the online store`;\n case \"shopify.collection.update\":\n return `Change ${fieldsOf(input.payload)} of collection ${quoted(label, input.target)}`;\n case \"shopify.collection.delete\":\n return `Delete collection ${quoted(label, input.target)}`;\n case \"shopify.collection.addProducts\":\n return `Add ${input.payload.products.length} product${input.payload.products.length === 1 ? \"\" : \"s\"} to collection ${quoted(label, input.target)}`;\n case \"shopify.collection.removeProducts\":\n return `Remove ${input.payload.products.length} product${input.payload.products.length === 1 ? \"\" : \"s\"} from collection ${quoted(label, input.target)}`;\n case \"shopify.discountCode.create\":\n return `Create discount code ${input.payload.code}: ${offText(input.payload.value)}`;\n case \"shopify.discountCode.deactivate\":\n return `Stop discount code ${input.target}`;\n case \"shopify.discountCode.schedule\":\n return `Change the dates of discount code ${input.target}`;\n case \"shopify.urlRedirect.create\":\n return `Redirect ${input.payload.from} to ${input.payload.to}`;\n case \"shopify.urlRedirect.delete\":\n return `Remove the redirect from ${input.target}`;\n case \"shopify.marketingActivity.upsert\":\n return `Show campaign ${quoted(label, input.payload.campaignId)} in Shopify Marketing`;\n case \"shopify.marketingActivity.delete\":\n return `Remove campaign ${quoted(label, input.target)} from Shopify Marketing`;\n case \"shopify.signupOffer.set\":\n return signupOfferSummary(input.payload);\n case \"shopify.signupOffer.end\":\n return `End sign-up offer ${quoted(label, input.target)}`;\n case \"shopify.audience.create\":\n return audienceSummary(input.payload);\n case \"shopify.audience.remove\":\n return input.payload?.keepOnPlatform\n ? `Stop updating the buyer audience ${quoted(label, input.target)} (it stays on the ad platform)`\n : `Stop the buyer audience ${quoted(label, input.target)} and delete it from the ad platform`;\n default:\n return \"Reconnect Baker's measurement on the store\";\n }\n}\n","/**\n * Sign-ups from a landing's Form into a connected Shopify store (S11) — the\n * shared contract.\n *\n * A Form's `shopifyCustomer` side effect adds the person to the store as a\n * customer, with exactly the marketing consent they ticked, and — when it\n * names a sign-up offer — gives them their own one-time discount code. The\n * page reads the answer (`shopifySignupReplySchema`) from the side-effect\n * door and shows the code; the scaffold parses it with its own\n * dependency-free copy (`apps/scaffold-template/src/lib/shopify/signup-client.ts`),\n * held equal to this by `signups.parity.test.ts`.\n *\n * The agent reads the offers with `baker shopify signup-offers`\n * (`GET /api/shopify/signup-offers`).\n *\n * This package must not depend on `convex`: ids are plain strings.\n */\nimport { z } from \"zod\";\n\n/** Every code Baker gives: the offer's prefix, a dash, 8 Crockford base32 characters. */\nexport const SIGNUP_CODE_PATTERN = /^[A-Z0-9]{2,12}-[0-9A-HJKMNP-TV-Z]{8}$/;\n\n/**\n * A sign-up offer's name in Baker: what a landing's Form names (`\"offer\": \"welcome-10\"`).\n * Its terms live in Baker, staged and published like any store change; the page only names it.\n */\nexport const signupOfferHandleSchema = z\n .string()\n .regex(/^[a-z0-9][a-z0-9-]{1,39}$/, \"2–40 lowercase letters, digits and dashes, e.g. welcome-10\");\n\n/**\n * What the page shows. `waiting` while the code is being made; `ready`, `used`\n * and `expired` only to the browser the code was given to, with the code;\n * `already` to any other browser (that email signed up before — no code);\n * `ended` when the offer gives no more codes (the person is still signed up);\n * `none` when the Form names no offer; `unavailable` when the store could not\n * be reached or refused.\n */\nexport const SIGNUP_STATES = [\n \"waiting\",\n \"ready\",\n \"used\",\n \"expired\",\n \"already\",\n \"ended\",\n \"none\",\n \"unavailable\",\n] as const;\nexport type SignupState = (typeof SIGNUP_STATES)[number];\n\n/** The states that carry the code. */\nexport const CODE_STATES: ReadonlySet<SignupState> = new Set([\"ready\", \"used\", \"expired\"]);\n\n/** The states the page stops asking at. */\nexport const FINAL_SIGNUP_STATES: ReadonlySet<SignupState> = new Set([\n \"ready\",\n \"used\",\n \"expired\",\n \"already\",\n \"ended\",\n \"none\",\n \"unavailable\",\n]);\n\nexport const shopifySignupReplySchema = z\n .object({\n state: z.enum(SIGNUP_STATES),\n code: z.string().regex(SIGNUP_CODE_PATTERN).optional(),\n endsAt: z.string().min(1).max(40).optional(),\n })\n .strict()\n .refine(\n (reply) => (CODE_STATES.has(reply.state) ? reply.code !== undefined && reply.endsAt !== undefined : true),\n \"a code state carries the code and when it ends\",\n )\n .refine(\n (reply) => (CODE_STATES.has(reply.state) ? true : reply.code === undefined && reply.endsAt === undefined),\n \"only the browser the code was given to is told it\",\n );\nexport type ShopifySignupReply = z.infer<typeof shopifySignupReplySchema>;\n\n/** The side-effect door's answer to a `shopifyCustomer` post or poll: `{ ok, signup }` or `{ error, signup }`. */\nexport const shopifySignupResponseSchema = z.union([\n z.object({ ok: z.literal(true), signup: shopifySignupReplySchema }).passthrough(),\n z.object({ error: z.string(), signup: shopifySignupReplySchema }).passthrough(),\n]);\n\n/**\n * How the page asks again: first after 1.5 s, then less often (at most every\n * 10 s), for 3 minutes — long enough for a sign-up queued behind another of the\n * same address. The standalone page client keeps its own copy.\n */\nexport const SIGNUP_POLL_FIRST_MS = 1_500;\nexport const SIGNUP_POLL_LONGEST_MS = 10_000;\nexport const SIGNUP_POLL_BUDGET_MS = 180_000;\n\n/** Sign-ups a company's Forms may add per hour, and one visitor (by address) per ten minutes. */\nexport const SIGNUP_COMPANY_PER_HOUR = 600;\nexport const SIGNUP_IP_PER_10_MINUTES = 10;\n\n/** The most refused sign-ups the Store page counts per reason; at it, the count reads \"500+\". */\nexport const SIGNUP_REFUSALS_COUNTED_MAX = 500;\n\n/** The tags Baker puts on every customer and code it makes, so the store's staff can filter them. */\nexport const SIGNUP_TAGS = {\n lead: \"baker-lead\",\n formPrefix: \"baker-form-\",\n campaignPrefix: \"baker-campaign-\",\n offer: \"baker-signup-offer\",\n offerPrefix: \"baker-offer-\",\n} as const;\n\n// ---------------------------------------------------------------------------\n// GET /api/shopify/signup-offers\n// ---------------------------------------------------------------------------\n\nexport const signupOfferStatusSchema = z.enum([\"active\", \"ended\", \"staged\"]);\n\nexport const shopifySignupOfferViewSchema = z.object({\n handle: z.string(),\n name: z.string(),\n /** \"10% off everything, each code valid 14 days, at most 1,000 codes\". */\n summary: z.string(),\n status: signupOfferStatusSchema,\n validForDays: z.number(),\n endsAt: z.string().optional(),\n maxCodes: z.number().optional(),\n codesGiven: z.number(),\n});\nexport type ShopifySignupOfferView = z.infer<typeof shopifySignupOfferViewSchema>;\n\nexport const shopifySignupOffersResponseSchema = z.object({\n /** The company has a store connection Baker can use (connected, not waiting on a reconnect). */\n connected: z.boolean(),\n /** The store allows Baker to add customers (sign-ups work). */\n canAddCustomers: z.boolean(),\n /** The store allows Baker to make discount codes (offers give codes). */\n canGiveCodes: z.boolean(),\n offers: z.array(shopifySignupOfferViewSchema),\n /** Sign-ups the store didn't take in the last 7 days: for a missing permission, and for anything else. */\n refusedLast7Days: z.object({ permission: z.number(), other: z.number() }),\n});\nexport type ShopifySignupOffersResponse = z.infer<typeof shopifySignupOffersResponseSchema>;\n","import {\n SHOPIFY_NOT_CONNECTED_MESSAGE,\n SHOPIFY_NOT_OFFERED_MESSAGE,\n SHOPIFY_ORDERS_IMPORTING_MESSAGE,\n} from \"@baker/api/shopify\";\nimport { SHOPIFY_PERMISSION_NEEDED_PREFIX, type ShopifyNeedsApproval } from \"@baker/api/shopify/writes\";\n\nexport interface ShopifyRefusal {\n code: \"NO_SHOPIFY_CONNECTION\" | \"SHOPIFY_NOT_AVAILABLE\" | \"SHOPIFY_ORDERS_IMPORTING\";\n fix: { action: \"request_connection\" | \"continue_without\"; explanation: string };\n}\n\nconst CONTINUE =\n \"Keep going with the wider task: say which part you could not read, skip it, and finish everything else.\";\n\n/**\n * The two answers to \"no Shopify store\" only a person can change, as the fix\n * the agent relays. Where this Baker can connect a store, the in-chat connect\n * card; where it cannot connect one at all yet, carrying on without it —\n * a card whose connect fails would only send the user in circles. Null for\n * every other refusal.\n *\n * A store connected moments ago whose orders are still being brought in is\n * neither: the agent waits rather than asking for a connection that exists.\n *\n * Matched on the backend's own sentences (`@baker/api/shopify`), because a 404\n * is also \"no such product\".\n */\nexport function shopifyRefusal(code: string, message: string): ShopifyRefusal | null {\n if (code === \"UNAVAILABLE\" && message.includes(SHOPIFY_ORDERS_IMPORTING_MESSAGE)) {\n return {\n code: \"SHOPIFY_ORDERS_IMPORTING\",\n fix: {\n action: \"continue_without\",\n explanation:\n \"The store IS connected: do not call `request_connection` and do not ask the user to connect it. Baker is \" +\n \"still bringing in the store's orders (it started on its own), so buyers, segments and audiences are not \" +\n \"ready yet. Tell the user in those words, run this command again in a few minutes, and meanwhile \" +\n \"finish everything else.\",\n },\n };\n }\n if (code !== \"NOT_FOUND\") return null;\n if (message.includes(SHOPIFY_NOT_CONNECTED_MESSAGE)) {\n return {\n code: \"NO_SHOPIFY_CONNECTION\",\n fix: {\n action: \"request_connection\",\n explanation:\n \"AGENT INSTRUCTION: no Shopify store is connected, and only the user can connect it. Call the \" +\n '`request_connection` tool with { platform: \"shopify\", reason } — reason in their words, e.g. \"so I can use ' +\n 'your real products and prices\" — and they connect it inside the chat; then run this command again. ' +\n CONTINUE,\n },\n };\n }\n if (message.includes(SHOPIFY_NOT_OFFERED_MESSAGE)) {\n return {\n code: \"SHOPIFY_NOT_AVAILABLE\",\n fix: {\n action: \"continue_without\",\n explanation:\n \"Do not call `request_connection` for Shopify and do not tell the user to connect it: a Shopify store cannot \" +\n \"be connected on this Baker yet. Answer from the knowledge vault and the client's own website instead \" +\n \"(`baker images extract <store url>` for product photos, `baker research fetch <url>` for a product page), \" +\n \"say the product facts are unverified, and finish the rest of the task.\",\n },\n };\n }\n return null;\n}\n\n/**\n * A store change the store hasn't allowed Baker to make yet (S9's optional\n * permissions): the in-chat card opens Shopify's own screen, and finishes\n * only when Shopify confirms.\n */\nexport function storeChangeRefusal(\n code: string,\n message: string,\n): { code: \"SHOPIFY_PERMISSION_NEEDED\"; fix: { action: \"request_connection\"; explanation: string } } | null {\n if (code !== \"FORBIDDEN\" || !message.startsWith(SHOPIFY_PERMISSION_NEEDED_PREFIX)) return null;\n return {\n code: \"SHOPIFY_PERMISSION_NEEDED\",\n fix: {\n action: \"request_connection\",\n explanation:\n \"AGENT INSTRUCTION: the store hasn't allowed Baker to make this kind of change yet, and only the user can. Call \" +\n '`request_connection` with { platform: \"shopify\", reason } — reason in their words, e.g. \"so I can update your ' +\n 'product titles\". They allow it in Shopify; the card finishes when Shopify confirms. If its result lists ' +\n \"something under cannotRead, that change is still not allowed: don't promise it. Then run this command again. \" +\n \"Keep going with the rest of the task.\",\n },\n };\n}\n\n/**\n * A price or discount change staged only after the user's yes: the question\n * to pass to AskUserQuestion exactly as given — or, after a no, to carry on\n * without it, keeping the question for a user who later asks for it again.\n */\nexport function approvalRefusal(needsApproval: ShopifyNeedsApproval): {\n code: \"NEEDS_USER_APPROVAL\";\n fix:\n | { action: \"ask_user\"; askUserQuestion: ShopifyNeedsApproval[\"askUserQuestion\"]; explanation: string }\n | {\n action: \"continue_without\";\n askUserQuestion: ShopifyNeedsApproval[\"askUserQuestion\"];\n explanation: string;\n };\n} {\n if (needsApproval.declined) {\n return {\n code: \"NEEDS_USER_APPROVAL\",\n fix: {\n action: \"continue_without\",\n askUserQuestion: needsApproval.askUserQuestion,\n explanation:\n \"The user said no to this change. Don't stage it, don't ask again on your own, and don't find another way to \" +\n \"make it; carry on with the rest of the task. Ask again only if the user asks for it again (they changed \" +\n \"their mind): then call AskUserQuestion with `askUserQuestion` exactly as given, and if they choose \" +\n '\"Yes, make these changes\", run this same command again.',\n },\n };\n }\n return {\n code: \"NEEDS_USER_APPROVAL\",\n fix: {\n action: \"ask_user\",\n askUserQuestion: needsApproval.askUserQuestion,\n explanation:\n \"This changes money in the store, so the user says yes first. Call AskUserQuestion with `askUserQuestion` \" +\n \"exactly as given (you may say a sentence before it, never change it). If the user chooses \" +\n '\"Yes, make these changes\", run this same command again. Do not stage it any other way.',\n },\n };\n}\n","import {\n SHOPIFY_BUYER_GONE_MESSAGE,\n SHOPIFY_PRODUCT_NOT_FOUND_PREFIX,\n type ShopifySalesResponse,\n type ShopifyStoreState,\n} from \"@baker/api/shopify\";\nimport { ApiError } from \"../../client.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { failApi } from \"../actions/shared.ts\";\nimport { shopifyRefusal } from \"./refusal.ts\";\n\n/** What `baker shopify` commands share: their refusals, their answer's shape and their flags. */\n\nconst PRODUCT_NOT_FOUND_HINT =\n \"Find it with `baker shopify products --search <words>`. If `baker shopify store` shows products Baker couldn't \" +\n \"read or products still coming in, it may be one of those — say so rather than that it doesn't exist.\";\n\nexport function fail(err: unknown): never {\n if (err instanceof ApiError) {\n const refusal = shopifyRefusal(err.code, err.message);\n if (refusal) {\n writeJson({ ok: false, error: { code: refusal.code, message: err.message, fix: refusal.fix } });\n process.exit(1);\n }\n if (err.code === \"NOT_FOUND\" && err.message === SHOPIFY_BUYER_GONE_MESSAGE) {\n writeJson({\n ok: false,\n error: { code: err.code, message: err.message },\n hints: [\n \"Their store asked Baker to erase this buyer, or they were merged into another one: say the buyer is no longer in Baker, and never guess who they were.\",\n ],\n });\n process.exit(1);\n }\n if (err.code === \"NOT_FOUND\" && err.message.startsWith(SHOPIFY_PRODUCT_NOT_FOUND_PREFIX)) {\n writeJson({ ok: false, error: { code: err.code, message: err.message }, hints: [PRODUCT_NOT_FOUND_HINT] });\n process.exit(1);\n }\n }\n failApi(err);\n}\n\nexport interface ShopifyMeta {\n store: ShopifyStoreState;\n count?: number;\n next_cursor?: string;\n salesReporting?: ShopifySalesResponse[\"salesReporting\"];\n history?: unknown;\n window?: unknown;\n basis?: string;\n}\n\n/** Hints lead the answer: an agent reading it through `| head` still gets them. */\nexport function emit<T>(data: T, meta: ShopifyMeta, hints: string[]): void {\n writeJson({ ok: true, ...(hints.length > 0 ? { hints } : {}), data, meta });\n}\n\n/** Only the flags that were passed, as the query string names them. */\nexport function params(entries: Record<string, unknown>): Record<string, string> {\n const out: Record<string, string> = {};\n for (const [name, value] of Object.entries(entries)) {\n if (value === undefined || value === \"\" || value === false) continue;\n out[name] = String(value);\n }\n return out;\n}\n\nexport const fullArg = {\n type: \"boolean\",\n description: \"Everything Baker keeps, not just what answers the question\",\n required: false,\n default: false,\n} as const;\n","import type { ShopifyDraftStageResponse } from \"@baker/api/shopify/writes\";\nimport { type ArgsDef, type CommandDef, defineCommand } from \"citty\";\nimport { ApiError, apiPost } from \"../../client.ts\";\nimport { requireChatId } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { loadJsonPayloads } from \"../ga4/shared.ts\";\nimport { fail } from \"./common.ts\";\nimport { approvalRefusal, storeChangeRefusal } from \"./refusal.ts\";\nimport { stageHints } from \"./writeHints.ts\";\n\n/**\n * Shared plumbing for `baker shopify change|draft|undo`. Nothing here changes\n * the store: each command stages onto this chat's store draft, the user\n * reviews it in the chat's changes list, and it applies when the chat is published.\n */\n\n/** A store change refused for a reason only the user can lift: the store's permission, or their money yes. */\nexport function failChange(err: unknown): never {\n if (err instanceof ApiError) {\n const refusal = storeChangeRefusal(err.code, err.message);\n if (refusal) {\n writeJson({ ok: false, error: { code: refusal.code, message: err.message, fix: refusal.fix } });\n process.exit(1);\n }\n }\n fail(err);\n}\n\n/** Prints a stage answer: the staged ops and their next step, or the money question to ask. */\nexport function emitStage(data: ShopifyDraftStageResponse): void {\n if (!data.staged) {\n const refusal = approvalRefusal(data.needsApproval);\n writeJson({\n ok: false,\n error: {\n code: refusal.code,\n message: data.needsApproval.declined\n ? \"The user said no to this change in the chat.\"\n : \"This changes money in the store: the user has to say yes to it in the chat first.\",\n fix: refusal.fix,\n },\n });\n process.exit(1);\n }\n writeJson({ ok: true, hints: stageHints(data), data });\n}\n\nexport async function stage(ops: Record<string, unknown>[]): Promise<void> {\n const chatId = requireChatId();\n try {\n const [only] = ops;\n const data =\n ops.length === 1 && only\n ? await apiPost<ShopifyDraftStageResponse>(\"/api/shopify/draft/stage\", { chatId, op: only })\n : await apiPost<ShopifyDraftStageResponse>(\"/api/shopify/draft/stage-batch\", { chatId, ops });\n emitStage(data);\n } catch (err) {\n failChange(err);\n }\n}\n\n/** A comma list flag (`--products a,b`): citty keeps only the last of a repeated flag, so lists are one value. */\nexport function list(value: unknown): string[] | undefined {\n if (typeof value !== \"string\" || value.trim() === \"\") return undefined;\n return value\n .split(\",\")\n .map((entry) => entry.trim())\n .filter(Boolean);\n}\n\n/** Only the keys whose value was given. */\nexport function defined(entries: Record<string, unknown>): Record<string, unknown> {\n return Object.fromEntries(Object.entries(entries).filter(([, value]) => value !== undefined && value !== \"\"));\n}\n\n/** `--json` / `--file`: one payload, or an array of payloads staged together. */\nexport function payloadsFrom(args: Record<string, unknown>): Record<string, unknown>[] | null {\n if (typeof args.json !== \"string\" && typeof args.file !== \"string\") return null;\n return loadJsonPayloads(args);\n}\n\nexport const JSON_ARGS = {\n json: {\n type: \"string\",\n description:\n 'The change as inline JSON: a payload for the target given (e.g. {\"addTags\":[\"summer\"]}), or an array of {\"kind\",\"target\",\"payload\"} items to stage together in one store read',\n required: false,\n },\n file: { type: \"string\", description: \"A JSON file holding the same\", required: false },\n} as const;\n\n/** A leaf command whose `baker schema` entry is its own arguments, so the two can't drift apart. */\nexport function leaf<A extends ArgsDef>(\n schemaName: string,\n meta: { name: string; description: string },\n args: A,\n run: (args: Record<string, unknown>) => Promise<void>,\n): CommandDef<A> {\n registerSchema({\n command: schemaName,\n description: meta.description,\n args: Object.fromEntries(\n Object.entries(args).map(([name, arg]) => [\n name,\n {\n type: String((arg as { type?: string }).type ?? \"string\"),\n description: String((arg as { description?: string }).description ?? \"\"),\n required: (arg as { required?: boolean }).required === true,\n },\n ]),\n ),\n });\n return defineCommand({ meta, args, run: async ({ args: parsed }) => await run(parsed as Record<string, unknown>) });\n}\n","import type { TrackingAuditResponse } from \"@baker/api/shopify/tracking\";\nimport type { ShopifyChangesResponse, ShopifyDraftStageResponse } from \"@baker/api/shopify/writes\";\n\n/** The next step after a store change command, said once, in the agent's terms. */\n\nconst STAGED =\n \"Staged — nothing changes in the store until the user publishes the chat. Review: `baker shopify draft list`. Say the change is ready and happens when they publish, never that it is done.\";\nconst WARNINGS = \"Read the warnings above before telling the user this is ready.\";\nconst DISCOUNT =\n \"The code works only after the chat is published; don't announce it as live or share it as working yet.\";\nconst EMPTY_COLLECTION =\n \"The new collection has no products yet: add them with `baker shopify change collection add <collection> <product…>`.\";\n\nconst COLLECTION_DELETE =\n \"Its address stops working when it is deleted: keep old links alive with `baker shopify change redirect create --from /collections/<handle> --to <page>` (ask the user where they should land).\";\n\n/** A redirect removed and made again from the same path (an undo, or a repoint): the link still leads somewhere. */\nfunction repointedRedirects(ops: ReadonlyArray<{ ref: string; kind: string; summary: string }>): string[] {\n const removed = ops.flatMap((op) =>\n op.kind === \"shopify.urlRedirect.delete\" && op.ref.startsWith(\"urlRedirect:\")\n ? [op.ref.slice(\"urlRedirect:\".length)]\n : [],\n );\n return removed.flatMap((path) => {\n const made = ops.find(\n (op) => op.kind === \"shopify.urlRedirect.create\" && op.summary.startsWith(`Redirect ${path} to `),\n );\n if (!made) return [];\n const to = made.summary.slice(`Redirect ${path} to `.length);\n return [\n `${path} still redirects after publish, now to ${to}: tell the user the old link goes there, not that its redirect is removed.`,\n ];\n });\n}\n\nexport function stageHints(data: ShopifyDraftStageResponse): string[] {\n if (!data.staged) return [];\n const hints = [STAGED, ...repointedRedirects(data.ops)];\n if (data.ops.some((op) => op.warnings.length > 0)) hints.push(WARNINGS);\n if (data.ops.some((op) => op.kind === \"shopify.discountCode.create\")) hints.push(DISCOUNT);\n if (data.ops.some((op) => op.kind === \"shopify.collection.delete\")) hints.push(COLLECTION_DELETE);\n if (\n data.ops.some(\n (op) => op.kind === \"shopify.collection.create\" && op.warnings.some((warning) => /no products/.test(warning)),\n )\n ) {\n hints.push(EMPTY_COLLECTION);\n }\n return hints;\n}\n\nexport function changesHints(data: ShopifyChangesResponse): string[] {\n if (data.changes.length === 0) return [\"Baker hasn't changed this store yet.\"];\n return data.changes.some((change) => change.undoable)\n ? [\"Undo one with `baker shopify undo <changeId>` (staged like any change, applied when the user publishes).\"]\n : [];\n}\n\n/** Staged fixes first, then what only the merchant can do (as Tasks), then decisions. */\nexport function auditHints(data: TrackingAuditResponse): string[] {\n const hints: string[] = [];\n for (const check of data.checks) {\n if (check.fix?.kind === \"staged\") hints.push(`Stage the fix for \"${check.title}\": \\`${check.fix.command}\\`.`);\n }\n for (const check of data.checks) {\n if (check.fix?.kind === \"merchant\") {\n hints.push(\n `Only the merchant can fix \"${check.title}\": ${check.fix.task}. Make it a Task with \\`baker actions create\\`${check.fix.link ? \" and include the link\" : \"\"}.`,\n );\n }\n }\n for (const check of data.checks) {\n if (check.fix?.kind === \"decision\") hints.push(`A person decides \"${check.title}\": ${check.fix.where}.`);\n }\n return hints;\n}\n","import type {\n ShopifyBestSellersResponse,\n ShopifyBuyerResponse,\n ShopifyBuyersResponse,\n ShopifyCohortsResponse,\n ShopifyCountriesResponse,\n ShopifySegmentsResponse,\n} from \"@baker/api/shopify\";\nimport { defineCommand } from \"citty\";\nimport { apiGet } from \"../../client.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport {\n bestSellersHints,\n buyerHistoryHints,\n buyersHints,\n cohortsHints,\n countriesHints,\n segmentsHints,\n} from \"./buyerHints.ts\";\nimport { emit, fail, fullArg, params } from \"./common.ts\";\nimport { storeStateHints } from \"./hints.ts\";\n\n/**\n * `baker shopify buyers|buyer|countries|best-sellers|cohorts|segments` — who\n * buys from the connected store, where and what, from the store's whole order\n * history as Baker keeps it (S7). Never a live call to Shopify. A buyer is a\n * numbered customer (\"Customer #1042\"), never a name or an email.\n */\n\nconst PERIOD_NOTE =\n \"Orders placed in the period, in the store's own time, with what was refunded on them since (Shopify's own reports date a refund when it happens instead, so a short period can differ by the refunds that cross its edges).\";\n\nconst periodArgs = {\n days: { type: \"number\", description: \"The last N days, 1-3650 (default 365)\", required: false },\n all: { type: \"boolean\", description: \"Every order the store has\", required: false, default: false },\n country: {\n type: \"string\",\n description: \"Only orders to this country: its two-letter code, like DE\",\n required: false,\n },\n} as const;\n\n/** The same flags as citty takes them (numbers arrive as strings). */\nconst periodFlags = {\n days: { type: \"string\", description: \"The last N days, 1-3650 (default 365)\", required: false },\n all: { type: \"boolean\", description: \"Every order the store has\", required: false, default: false },\n country: { type: \"string\", description: \"Only orders to this country (two-letter code, like DE)\", required: false },\n} as const;\n\ntype Common = { store: ShopifyBuyersResponse[\"store\"]; window: unknown; history: unknown; basis: string };\n\nfunction split<T extends Common>(answer: T) {\n const { store, window, history, basis, ...data } = answer;\n return { data, meta: { store, window, history, basis } };\n}\n\n// ---------------------------------------------------------------------------\n// buyers\n// ---------------------------------------------------------------------------\n\nregisterSchema({\n command: \"shopify.buyers\",\n description: `Start here for 'who buys from us', 'how many come back' and 'which campaign brings the best customers': the store's buyers in the period — how many, how many were new, repeat rate, days to a second order, guest orders — their segments (best, loyal, at risk, new, one-time, by this store's own rhythm) and the top buyers as numbered customers with their country, lifetime spend and the channel of their first order. --by campaign|channel adds lifetime value per acquisition campaign or channel (Baker keeps no ad spend: read it with the ads commands for the same dates). ${PERIOD_NOTE} A buyer is a Shopify customer: guest orders count in money, never as buyers.`,\n args: {\n ...periodArgs,\n segment: {\n type: \"string\",\n description: \"Only one segment's buyers: best | loyal | at_risk | new | one_time\",\n required: false,\n enum: [\"best\", \"loyal\", \"at_risk\", \"new\", \"one_time\"],\n },\n by: {\n type: \"string\",\n description: \"Lifetime value by the campaign or channel of each buyer's first order\",\n required: false,\n enum: [\"campaign\", \"channel\"],\n },\n channel: {\n type: \"string\",\n description: \"Only buyers who first came through this channel (a key from --by channel)\",\n required: false,\n },\n sort: {\n type: \"string\",\n description: \"net (lifetime spend, default) | orders | recent (last order) | first (first order)\",\n required: false,\n enum: [\"net\", \"orders\", \"recent\", \"first\"],\n },\n limit: { type: \"number\", description: \"Buyers listed, 1-100 (default 10)\", required: false },\n offset: { type: \"number\", description: \"Skip this many buyers (paging)\", required: false },\n full: {\n ...fullArg,\n description:\n \"Add each buyer's gross, refunds, orders with a discount, days between orders and first-order campaign\",\n },\n },\n});\n\nexport const buyersCommand = defineCommand({\n meta: {\n name: \"buyers\",\n description:\n \"Who buys: buyers, new and returning, repeat rate, segments and the top buyers. Start here: baker shopify buyers --days 90 --by channel\",\n },\n args: {\n ...periodFlags,\n segment: { type: \"string\", description: \"best | loyal | at_risk | new | one_time\", required: false },\n by: { type: \"string\", description: \"campaign | channel\", required: false },\n channel: { type: \"string\", description: \"A channel key from --by channel\", required: false },\n sort: { type: \"string\", description: \"net | orders | recent | first\", required: false },\n limit: { type: \"string\", description: \"Buyers listed, 1-100\", required: false },\n offset: { type: \"string\", description: \"Skip this many buyers\", required: false },\n full: { type: \"boolean\", description: \"Add each buyer's detail\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifyBuyersResponse>(\n \"/api/shopify/buyers\",\n params({\n days: args.days,\n all: args.all,\n country: args.country,\n segment: args.segment,\n by: args.by,\n channel: args.channel,\n sort: args.sort,\n limit: args.limit,\n offset: args.offset,\n full: args.full,\n }),\n );\n const { data, meta } = split(answer);\n emit(data, meta, [...storeStateHints(answer.store), ...buyersHints(answer)]);\n } catch (err) {\n fail(err);\n }\n },\n});\n\n// ---------------------------------------------------------------------------\n// buyer\n// ---------------------------------------------------------------------------\n\nregisterSchema({\n command: \"shopify.buyer\",\n description:\n \"One buyer by their number (1042, #1042 or 'Customer #1042'): where they are, how many orders and how much they spent net of refunds, average order, days between orders, first and last order, discount use, segment and how they first came — then every order (date in the store's time, products and quantities, net, refunded, discount codes, city), newest first, and what they bought. Never a name or an email. A buyer their store asked Baker to erase, or merged into another, answers 'This buyer is no longer in Baker'.\",\n args: {\n number: { type: \"positional\", description: \"The buyer's number: 1042, #1042 or 'Customer #1042'\", required: true },\n full: { ...fullArg, description: \"Add each order's id, lines with their amounts, refunded lines and campaign\" },\n },\n});\n\nexport const buyerCommand = defineCommand({\n meta: {\n name: \"buyer\",\n description: \"One buyer's history by number. Example: baker shopify buyer 1042\",\n },\n args: {\n number: { type: \"positional\", description: \"1042, #1042 or 'Customer #1042'\", required: true },\n full: { type: \"boolean\", description: \"Add ids, lines and campaigns\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifyBuyerResponse>(\n \"/api/shopify/buyer\",\n params({ number: args.number, full: args.full }),\n );\n const { data, meta } = split(answer);\n emit(data, meta, [...storeStateHints(answer.store), ...buyerHistoryHints(answer.history, answer.basis)]);\n } catch (err) {\n fail(err);\n }\n },\n});\n\n// ---------------------------------------------------------------------------\n// countries\n// ---------------------------------------------------------------------------\n\nregisterSchema({\n command: \"shopify.countries\",\n description: `Start here for 'where do our buyers come from' and 'which countries should we push': orders, buyers, new buyers, net, average order, share and growth against the period before, by country — or by region inside --country (straight by city for a country whose addresses carry no region, like Germany), or by city inside --country and --region — with the currency buyers paid in. Orders whose address Baker could not read are 'Unknown' ('No region given' / 'No city given' inside a country), always shown; the rows, that row and 'Other' add up to the total. --product narrows to the orders holding one product, with that product's money. ${PERIOD_NOTE}`,\n args: {\n ...periodArgs,\n region: { type: \"string\", description: \"Inside --country, one region (code or name): its cities\", required: false },\n product: { type: \"string\", description: \"Only orders holding this product: its id or handle\", required: false },\n limit: { type: \"number\", description: \"Places listed, 1-100 (default 25; the rest are 'Other')\", required: false },\n full: { ...fullArg, description: \"Add the period before's net and orders per place\" },\n },\n});\n\nexport const countriesCommand = defineCommand({\n meta: {\n name: \"countries\",\n description:\n \"Where buyers are: orders, buyers and net by country, region or city, with growth. Start here: baker shopify countries --days 90\",\n },\n args: {\n ...periodFlags,\n region: { type: \"string\", description: \"A region inside --country\", required: false },\n product: { type: \"string\", description: \"A product's id or handle\", required: false },\n limit: { type: \"string\", description: \"Places listed, 1-100\", required: false },\n full: { type: \"boolean\", description: \"Add the period before\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifyCountriesResponse>(\n \"/api/shopify/countries\",\n params({\n days: args.days,\n all: args.all,\n country: args.country,\n region: args.region,\n product: args.product,\n limit: args.limit,\n full: args.full,\n }),\n );\n const { data, meta } = split(answer);\n emit(data, meta, [...storeStateHints(answer.store), ...countriesHints(answer)]);\n } catch (err) {\n fail(err);\n }\n },\n});\n\n// ---------------------------------------------------------------------------\n// best-sellers\n// ---------------------------------------------------------------------------\n\nregisterSchema({\n command: \"shopify.bestSellers\",\n description: `Start here for 'what sells best' and 'which product should we lead with': best sellers by units ordered (before anything came back) beside refunded units, orders, buyers, revenue (the lines' price after discounts, before tax and shipping), refunds, refund rate and growth. --view variants (one product's options, with --product), trend (top products by month), together (products bought in one order), repeat (first buys whose buyers came back most) or momentum (products selling 30% or more below the period before). ${PERIOD_NOTE} For the catalog itself use \\`baker shopify products\\`.`,\n args: {\n ...periodArgs,\n view: {\n type: \"string\",\n description: \"products (default) | variants | trend | together | repeat | momentum\",\n required: false,\n enum: [\"products\", \"variants\", \"trend\", \"together\", \"repeat\", \"momentum\"],\n },\n sort: {\n type: \"string\",\n description: \"units (default) | revenue | orders\",\n required: false,\n enum: [\"units\", \"revenue\", \"orders\"],\n },\n product: { type: \"string\", description: \"One product (id or handle): its variants or its trend\", required: false },\n limit: { type: \"number\", description: \"Rows, 1-100 (default 10; 5 products for trend)\", required: false },\n full: { ...fullArg, description: \"Add product and variant ids and the period before\" },\n },\n});\n\nexport const bestSellersCommand = defineCommand({\n meta: {\n name: \"best-sellers\",\n description:\n \"What sells: best sellers, variants, trend, bought together, repeat leaders, losing momentum. Start here: baker shopify best-sellers --days 90\",\n },\n args: {\n ...periodFlags,\n view: {\n type: \"string\",\n description: \"products | variants | trend | together | repeat | momentum\",\n required: false,\n },\n sort: { type: \"string\", description: \"units | revenue | orders\", required: false },\n product: { type: \"string\", description: \"A product's id or handle\", required: false },\n limit: { type: \"string\", description: \"Rows, 1-100\", required: false },\n full: { type: \"boolean\", description: \"Add ids and the period before\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifyBestSellersResponse>(\n \"/api/shopify/best-sellers\",\n params({\n days: args.days,\n all: args.all,\n country: args.country,\n view: args.view,\n sort: args.sort,\n product: args.product,\n limit: args.limit,\n full: args.full,\n }),\n );\n const { data, meta } = split(answer);\n emit(data, meta, [...storeStateHints(answer.store), ...bestSellersHints(answer)]);\n } catch (err) {\n fail(err);\n }\n },\n});\n\n// ---------------------------------------------------------------------------\n// cohorts\n// ---------------------------------------------------------------------------\n\nregisterSchema({\n command: \"shopify.cohorts\",\n description:\n \"Buyers grouped by the month of their first order (the last --months, default 12): how many, the share who ordered again 1, 2, 3, 6 and 12 months later, and what they spent per buyer by month 12. Months not reached yet are null. Use it for 'are buyers coming back more than they used to' and lifetime value over time.\",\n args: {\n months: { type: \"number\", description: \"Cohorts, the last 3-36 months (default 12)\", required: false },\n country: { type: \"string\", description: \"Only orders to this country (two-letter code)\", required: false },\n full: {\n ...fullArg,\n description: \"Add every month of every cohort: active buyers, orders, net, cumulative net per buyer\",\n },\n },\n});\n\nexport const cohortsCommand = defineCommand({\n meta: {\n name: \"cohorts\",\n description:\n \"Buyers by first-order month: who came back and what they spent. Example: baker shopify cohorts --months 12\",\n },\n args: {\n months: { type: \"string\", description: \"The last 3-36 months\", required: false },\n country: { type: \"string\", description: \"A two-letter country code\", required: false },\n full: { type: \"boolean\", description: \"Every month of every cohort\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifyCohortsResponse>(\n \"/api/shopify/cohorts\",\n params({ months: args.months, country: args.country, full: args.full }),\n );\n const { data, meta } = split(answer);\n emit(data, meta, [...storeStateHints(answer.store), ...cohortsHints(answer)]);\n } catch (err) {\n fail(err);\n }\n },\n});\n\n// ---------------------------------------------------------------------------\n// segments\n// ---------------------------------------------------------------------------\n\nregisterSchema({\n command: \"shopify.segments\",\n description:\n \"Every buyer at the period's end by segment — best buyers, loyal, at risk, new and one-time — with how many, their share, net, average orders, days since their last order, the countries they are in and the products their first orders held. Each segment's rule is given in words with this store's own numbers (its typical gap between orders and the spend of its top fifth). Start here for 'who are our best customers' and 'who should we win back'.\",\n args: {\n ...periodArgs,\n full: { ...fullArg, description: \"Add the first products' ids\" },\n },\n});\n\nexport const segmentsCommand = defineCommand({\n meta: {\n name: \"segments\",\n description: \"Buyers by segment: best, loyal, at risk, new, one-time. Example: baker shopify segments\",\n },\n args: {\n ...periodFlags,\n full: { type: \"boolean\", description: \"Add product ids\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifySegmentsResponse>(\n \"/api/shopify/segments\",\n params({ days: args.days, all: args.all, country: args.country, full: args.full }),\n );\n const { data, meta } = split(answer);\n emit(data, meta, [...storeStateHints(answer.store), ...segmentsHints(answer)]);\n } catch (err) {\n fail(err);\n }\n },\n});\n","import type {\n ShopifyBestSellersResponse,\n ShopifyBuyerBasis,\n ShopifyBuyerHistory,\n ShopifyBuyersResponse,\n ShopifyCohortsResponse,\n ShopifyCountriesResponse,\n ShopifySegmentRow,\n ShopifySegmentsResponse,\n} from \"@baker/api/shopify\";\n\n/**\n * The next steps `baker shopify buyers|buyer|countries|best-sellers|cohorts|\n * segments` hand the agent — each a strategy move the numbers support, and\n * the command that takes it. Pure over the parsed answer. Nothing here sends\n * anything: a move that changes an ad platform is staged by its own command\n * and applies at publish.\n */\n\nconst AUDIENCE_PATH =\n \"To show ads to these buyers, stage an audience of a segment on Meta or Google Ads \" +\n \"(`baker shopify audiences create --segment best --to meta|google --account-id <id>`): only buyers who accept marketing are sent, \" +\n \"staged until Publish. On Meta, a lookalike of it (`baker ads meta audiences create --subtype LOOKALIKE`) reaches more people like them once it holds 100 people from one country.\";\n\nconst MIN_ORDERS_TO_SCALE = 5;\n\n/** Said beside any answer with orders in it: the store's numbers are the ground, even when Knowledge tells another story. */\nfunction storeFactsHint(currency: string | null): string {\n return (\n `These are the store's own orders — never a demo or sample store: build the answer on them and quote their numbers${currency ? ` in ${currency}` : \"\"}. ` +\n \"If Knowledge describes other products or markets, say the two disagree and ask which is current — never drop these numbers for it.\"\n );\n}\n\nconst percent = (value: number) => `${Math.round(value * 100)}%`;\n\n/** What every answer about the store's buyers may need said: past orders still coming in, or only 60 days of them. */\nexport function buyerHistoryHints(history: ShopifyBuyerHistory, basis: ShopifyBuyerBasis): string[] {\n const hints: string[] = [];\n if (history.state === \"importing\") {\n hints.push(\n `Baker is still bringing in this store's past orders (${history.orders} so far): older periods, repeat buyers and cohorts are incomplete — say so rather than reporting a drop.`,\n );\n }\n if (history.state === \"failed\") {\n hints.push(\"Baker couldn't finish bringing in this store's past orders; older periods may be incomplete.\");\n }\n if (basis === \"last_60_days\") {\n hints.push(\n \"Shopify gives Baker this store's last 60 days of orders only: older behaviour is not here, and a buyer whose earlier orders are older counts as new.\",\n );\n }\n return hints;\n}\n\n/** The fastest-growing country with enough orders to scale, and a high-value country with too few to know yet. */\nexport function countriesHints(answer: ShopifyCountriesResponse): string[] {\n const hints = buyerHistoryHints(answer.history, answer.basis);\n if (answer.total.orders === 0) {\n hints.push(\"No orders were placed in this period.\");\n return hints;\n }\n hints.push(storeFactsHint(answer.currency));\n const money = (amount: number) => `${answer.currency ?? \"\"} ${amount}`.trim();\n const growing = answer.rows\n .filter((row) => row.orders >= MIN_ORDERS_TO_SCALE && (row.ordersGrowth ?? 0) > 0)\n .sort((a, b) => (b.ordersGrowth ?? 0) - (a.ordersGrowth ?? 0))[0];\n if (growing && answer.level === \"country\") {\n hints.push(\n `Scale ${growing.name}: its orders grew ${percent(growing.ordersGrowth ?? 0)} against the period before (${growing.orders} orders, ${money(growing.net)}). ` +\n \"Check which campaigns already target it (`baker ads meta campaigns`, `baker ads google query --preset campaign-performance`) before staging a change.\",\n );\n }\n const average = answer.total.averageOrder;\n const promising = answer.rows\n .filter((row) => row.orders < MIN_ORDERS_TO_SCALE && average > 0 && row.averageOrder >= 1.5 * average)\n .sort((a, b) => b.averageOrder - a.averageOrder)[0];\n if (promising && answer.level === \"country\") {\n hints.push(\n `Test ${promising.name}: its average order is ${money(promising.averageOrder)}, ${(promising.averageOrder / average).toFixed(1)}× the store's, from only ${promising.orders} orders — a small budget there would show whether it scales.`,\n );\n }\n if (answer.unknown && answer.total.orders > 0 && answer.unknown.orders / answer.total.orders > 0.25) {\n const lack =\n answer.level === \"country\"\n ? \"have no address Baker could read (Unknown)\"\n : `name no ${answer.level} on their address (${answer.unknown.name})`;\n hints.push(\n `${answer.unknown.orders} of these orders ${lack}: say so rather than leaving them out of a place's share.`,\n );\n }\n return hints;\n}\n\n/** The product to lead with, the products to watch, depending on the view. */\nexport function bestSellersHints(answer: ShopifyBestSellersResponse): string[] {\n const hints = buyerHistoryHints(answer.history, answer.basis);\n const leader = answer.repeat?.[0];\n if (leader && leader.buyersAgain > 0) {\n hints.push(\n `Lead a landing with \"${leader.title}\" (find it with \\`baker shopify products --search\\`): ${percent(leader.share)} of the buyers whose first order held it came back.`,\n );\n }\n const top = answer.products?.[0];\n if (top && top.units > 0) {\n hints.push(\n `\"${top.title}\" is the best seller (${top.units} units). For which first buys bring buyers back, run \\`baker shopify best-sellers --view repeat\\`; for what is losing steam, \\`--view momentum\\`.`,\n );\n }\n const losing = answer.momentum?.[0];\n if (losing) {\n hints.push(\n `\"${losing.title}\" sold ${losing.units} against ${losing.previousUnits} the period before: check its stock (\\`baker shopify stock\\`) and the ads that promote it before cutting it.`,\n );\n }\n const sellers = answer.products ?? answer.variants ?? [];\n if (sellers.some((row) => row.units > 0)) hints.push(storeFactsHint(answer.currency));\n const withRefunds = sellers\n .filter((row) => row.refundedUnits > 0)\n .sort((a, b) => b.refundRate - a.refundRate)\n .slice(0, 5);\n if (withRefunds.length > 0) {\n const money = (amount: number) => `${answer.currency ?? \"\"} ${amount}`.trim();\n hints.push(\n `Refunds: ${withRefunds\n .map((row) => `\"${row.title}\" ${percent(row.refundRate)} of units (${money(row.refunded)})`)\n .join(\", \")}. Only a product not named here had no refunds in the period.`,\n );\n }\n const refunded = answer.products?.find((row) => row.units >= 5 && row.refundRate >= 0.2);\n if (refunded) {\n hints.push(\n `\"${refunded.title}\" comes back often (${percent(refunded.refundRate)} of units refunded): don't lead a campaign with it before finding out why.`,\n );\n }\n return hints;\n}\n\nfunction bestBuyersHint(best: ShopifySegmentRow | undefined): string[] {\n if (!best || best.buyers === 0) return [];\n const countries = best.topCountries.map((country) => country.name).join(\", \");\n const products = best.topFirstProducts.map((product) => `\"${product.title}\"`).join(\", \");\n if (!countries && !products) return [];\n return [\n `Find more buyers like your best (${best.buyers}): ${countries ? `target ${countries}` : \"\"}${countries && products ? \"; \" : \"\"}${products ? `lead with ${products}, what their first orders held` : \"\"}.`,\n ];\n}\n\nexport function segmentsHints(answer: ShopifySegmentsResponse): string[] {\n const hints = buyerHistoryHints(answer.history, answer.basis);\n hints.push(...bestBuyersHint(answer.segments.find((segment) => segment.segment === \"best\")));\n const atRisk = answer.segments.find((segment) => segment.segment === \"at_risk\");\n if (atRisk && atRisk.buyers > 0) {\n hints.push(\n `${atRisk.buyers} repeat buyers have not ordered in ${Math.round(2 * answer.thresholds.gapDays)} days (At risk): a win-back offer to them is worth more than a new buyer of the same value.`,\n );\n }\n if (answer.buyers > 0) hints.push(AUDIENCE_PATH);\n return hints;\n}\n\nexport function buyersHints(answer: ShopifyBuyersResponse): string[] {\n const hints = buyerHistoryHints(answer.history, answer.basis);\n if (answer.summary.orders === 0) {\n hints.push(\"No orders were placed in this period.\");\n return hints;\n }\n hints.push(storeFactsHint(answer.currency));\n if (answer.acquisition?.by === \"campaign\" && answer.acquisition.rows.length > 0) {\n hints.push(\n \"Compare each campaign's lifetime value with what it cost for the same dates (`baker ads meta insights`, \" +\n \"`baker ads google query --preset campaign-performance`): Baker keeps no ad spend.\",\n );\n }\n if (!answer.acquisition) {\n hints.push(\n \"For lifetime value by the campaign or channel that brought each buyer, add `--by campaign` or `--by channel`.\",\n );\n }\n if (answer.summary.guestOrders > 0 && answer.summary.guestOrders >= answer.summary.orders / 2) {\n hints.push(\n `${answer.summary.guestOrders} of ${answer.summary.orders} orders were placed as guests: they count in sales, never as buyers, so repeat rates read low.`,\n );\n }\n if (answer.summary.buyers > 0) hints.push(AUDIENCE_PATH);\n return hints;\n}\n\nexport function cohortsHints(answer: ShopifyCohortsResponse): string[] {\n const hints = buyerHistoryHints(answer.history, answer.basis);\n const reached = answer.cohorts.filter((cohort) => cohort.retention.m3 !== null && cohort.size >= 5);\n if (reached.length >= 2) {\n const best = [...reached].sort((a, b) => (b.retention.m3 ?? 0) - (a.retention.m3 ?? 0))[0];\n if (best) {\n hints.push(\n `Buyers who first ordered in ${best.month} came back best (${percent(best.retention.m3 ?? 0)} ordered again in their third month): look at what was running then (\\`baker shopify buyers --by campaign\\`).`,\n );\n }\n }\n return hints;\n}\n","import {\n SHOPIFY_COLLECTION_COUNT_CAP,\n SHOPIFY_STOCK_COUNT_CAP,\n type ShopifyBuyNote,\n type ShopifyProductDetail,\n type ShopifyProductsResponse,\n type ShopifySalesResponse,\n type ShopifyStockResponse,\n type ShopifyStoreState,\n type ShopifyStoreSummary,\n} from \"@baker/api/shopify\";\n\n/**\n * The next steps `baker shopify` hands the agent, beside the data. Pure over\n * the parsed answer. They never promise the copy is current and never name a\n * time as the moment access was lost: `lastActivity` is when Baker last heard\n * from the store, nothing more.\n */\n\nconst RECONNECT =\n \"Baker has lost access to this Shopify store, so these products may be out of date. Say so, and ask the user to \" +\n 'reconnect with `request_connection` { platform: \"shopify\" } — the card offers Reconnect.';\n\nconst OWN_STOREFRONT =\n \"This store sells through its own storefront, not a Shopify online store: Baker links to its product pages once the \" +\n \"website's address is set in Brain → Store (`buyUrlKind` says where each link goes); until then, link to the product \" +\n \"pages on the client's own site, and ask the user for them if you don't know them.\";\n\nfunction day(iso: string | undefined): string | null {\n return iso ? iso.slice(0, 10) : null;\n}\n\nfunction progress(store: ShopifyStoreState): string {\n const done = store.importProgress?.done;\n const total = store.importProgress?.total;\n if (done === undefined) return \"\";\n return total === undefined ? ` (${done} so far)` : ` (${done} of ${total})`;\n}\n\n/** Said on every answer, before the command's own hints. */\nexport function storeStateHints(store: ShopifyStoreState): string[] {\n const hints: string[] = [];\n if (store.connection === \"needs_reconnect\") hints.push(RECONNECT);\n if (store.connection === \"disconnected\") {\n const last = day(store.lastActivity);\n hints.push(\n `This Shopify store is disconnected; these are its products as Baker last saw them${last ? ` (last activity ${last})` : \"\"}. ` +\n \"Don't present prices or stock as current.\",\n );\n }\n if (store.catalog === \"starting\" || store.catalog === \"importing\") {\n hints.push(\n `Baker is still bringing in this store's products${progress(store)}; the list is incomplete — say so rather than concluding a product is missing.`,\n );\n }\n if (store.catalog === \"failed\") {\n hints.push(\"Baker couldn't finish reading this store's products; the list may be incomplete.\");\n }\n if (store.unreadable !== undefined) {\n const count = store.unreadableCapped ? `${store.unreadable}+` : String(store.unreadable);\n hints.push(\n `Baker couldn't read ${count} of this store's products (it keeps retrying); they are missing from these answers — ` +\n \"never tell the user a product doesn't exist or that the catalog is complete.\",\n );\n }\n if (store.checksFailing) {\n hints.push(\"Baker couldn't check this store for changes lately; recent edits in Shopify may not show yet.\");\n }\n if (store.storefront === \"own\") hints.push(OWN_STOREFRONT);\n return hints;\n}\n\nfunction cleanAndReady(store: ShopifyStoreState): boolean {\n return store.catalog === \"ready\" && store.unreadable === undefined && !store.checksFailing;\n}\n\nexport function productsHints(\n answer: ShopifyProductsResponse,\n options: { filtered: boolean; paged?: boolean },\n): string[] {\n const hints: string[] = [];\n const notForSale = answer.products.filter((row) => row.availability === \"not_for_sale\").length;\n const linkOnly = answer.products.filter((row) => row.availability === \"link_only\").length;\n if (notForSale > 0) {\n hints.push(\n `${notForSale} of these can't be bought on the online store (draft, archived or hidden from it) — don't send ads or pages to them.`,\n );\n }\n if (linkOnly > 0) {\n hints.push(\n `${linkOnly} of these are only reachable by direct link — fine to link from an ad or a landing; they won't show in the store's search or collections.`,\n );\n }\n if (answer.nextCursor)\n hints.push(`More products: rerun with \\`--cursor ${answer.nextCursor}\\` and the same filters.`);\n if (answer.products.length === 0 && !answer.nextCursor) {\n if (options.paged) hints.push(\"No more products: the earlier pages were the whole list.\");\n else if (options.filtered) hints.push(\"No products match; drop `--search`/`--stock`/`--collection`.\");\n else if (cleanAndReady(answer.store)) hints.push(\"The store has no products yet.\");\n else {\n hints.push(\n \"Baker has no products for this store right now — see the notes above; don't tell the user the store is empty.\",\n );\n }\n }\n return hints;\n}\n\nfunction photoHints(product: ShopifyProductDetail): string[] {\n const hints: string[] = [];\n if (product.photos.length > 0) {\n const ids = product.photos.map((photo) => photo.imageId).join(\" \");\n hints.push(\n \"Its photos are already in the image library. For a landing: \" +\n `\\`mkdir -p src/pages/<page>/_images && baker images download ${ids} --out src/pages/<page>/_images/\\`; ` +\n `for a creative, pass the imageIds as references and set \\`product: ${product.handle}\\` in its idea, so the store's price, was price and saving count as sourced. Never use a cdn.shopify.com link — pages refuse it.`,\n );\n }\n if (product.photosNotBrought > 0) {\n hints.push(\n `${product.photosNotBrought} more photos stay in Shopify (Baker keeps up to 10 per product); use the ones listed.`,\n );\n }\n if (product.photosAdding > 0) {\n hints.push(`${product.photosAdding} photos are still being added; run this again in a minute if you need them.`);\n }\n return hints;\n}\n\nfunction stockHintsFor(product: ShopifyProductDetail): string[] {\n const hints: string[] = [];\n if (product.stock.optionsOut > 0) {\n const names = product.outOptions.map((option) => option.title).join(\", \");\n hints.push(\n product.stock.state === \"out_of_stock\"\n ? \"Every option is out of stock — don't promote it; `baker shopify stock` lists every product like this.\"\n : `Options out of stock: ${names} — don't promote them; \\`baker shopify stock\\` lists every product like this.`,\n );\n }\n if (product.outOptionsMore) {\n hints.push(\n `${product.outOptionsMore} more options are out of stock: \\`baker shopify product ${product.productId} --out-of-stock\\` (then \\`--variants-cursor\\` for the next page).`,\n );\n }\n if (product.variantsNextCursor) {\n hints.push(`More options: rerun with \\`--variants-cursor ${product.variantsNextCursor}\\`.`);\n }\n return hints;\n}\n\nconst BUY_NOTES: Record<ShopifyBuyNote, string> = {\n password_protected:\n \"The store asks for a password before anyone can see it: a shopper following a buy link meets it first — tell the user before sending traffic.\",\n subscription_optional:\n \"It can also be bought by subscription: on a landing `<ShopifyProduct>` offers the plans; a `buyUrl` elsewhere adds it once.\",\n own_storefront:\n \"The store sells through its own website: `buyUrlKind` says where each link goes — its product page, or its cart page once its developers confirm it in Brain → Store.\",\n details_pending: \"Baker hasn't read this product's details yet (subscriptions among them): its buy links may change.\",\n subscription_only:\n \"It's sold only by subscription: on a landing `<ShopifyProduct>` offers the plans; a `buyUrl` elsewhere is its product page, where the shopper picks one.\",\n};\n\n/** Selling it: the buy component on a landing, `buyUrl` everywhere else, and what a link cannot do. */\nfunction buyHints(product: ShopifyProductDetail): string[] {\n const hints: string[] = [];\n if (product.variants.some((variant) => variant.buyUrl)) {\n hints.push(\n `On a landing, place \\`<ShopifyProduct product=\"${product.handle}\" />\\` (and \\`<ShopifyBuyButton product=\"${product.handle}\">\\` for a second button): ` +\n \"it shows the options, price and stock, and its button hands the shopper to the store. \" +\n \"Never put a `buyUrl` on a landing yourself, and never build an option picker. See /landing `.claude/skills/landing/references/verticals/ecommerce.md`.\",\n \"`buyUrl` is for links outside a landing — an ad, an email, a message: one per option; never `storeUrl` (a page to look at), \" +\n `never a Shopify link built yourself (it follows the store's setting: ${product.buyDestination.replace(\"_\", \" \")}; \\`--quantity <n>\\` sets how many).`,\n );\n }\n const notes = new Set(product.variants.flatMap((variant) => variant.notes ?? []));\n for (const note of notes) hints.push(BUY_NOTES[note]);\n return hints;\n}\n\n/** Building from it: its videos, the details to ask for, and a field shown only in part. */\nfunction contentHints(product: ShopifyProductDetail): string[] {\n const hints: string[] = [];\n const [video] = product.videos;\n if (video) {\n hints.push(\n `Its videos are already in the video library: place one with \\`<Video playbackId=\"${video.playbackId}\" />\\` — never a Shopify video link.`,\n );\n }\n if (product.videosNotBrought > 0) {\n hints.push(\n `${product.videosNotBrought} more videos stay in Shopify (Baker keeps up to 5 per product); use the ones listed.`,\n );\n }\n if (product.videosAdding > 0) hints.push(`${product.videosAdding} videos are still being added.`);\n if (product.contentSummary && !product.content) {\n hints.push(\n \"For a landing or an ad, read the whole of it with `--content` (formatted description, custom fields, subscriptions, translations).\",\n );\n }\n const truncated = product.content?.fields.find((field) => field.truncated);\n if (truncated) {\n const option = truncated.variantId ? ` --variant ${truncated.variantId}` : \"\";\n hints.push(`Some fields are shown in part: read one whole with \\`--field ${truncated.key}${option}\\`.`);\n }\n if (product.content?.unreadable?.length || product.content?.fields.some((field) => field.unreadable)) {\n hints.push(\n \"Some content isn't readable yet: ask the user to open Baker in their Shopify admin and accept the new permissions.\",\n );\n }\n return hints;\n}\n\nexport function productHints(product: ShopifyProductDetail, store: ShopifyStoreState): string[] {\n const hints = [...photoHints(product), ...stockHintsFor(product), ...buyHints(product), ...contentHints(product)];\n if (product.availability === \"not_for_sale\") {\n hints.push(\n `Can't be bought on the online store (${(product.status ?? \"hidden\").toLowerCase()}): a page or ad linking to it sends people to a page they can't buy from.`,\n );\n }\n if (product.availability === \"link_only\") {\n hints.push(\n `This product is only reachable by direct link${product.storeUrl ? ` (${product.storeUrl})` : \"\"} — fine to link from an ad or a landing; it won't show in the store's search or collections.`,\n );\n }\n if (product.compareAt) {\n hints.push(`On sale: was ${product.compareAt}, now ${product.price}.`);\n }\n if (product.pricesByCountry) {\n hints.push(\n \"Prices differ by country — quote the country's price from pricesByCountry, never convert the home price.\",\n );\n }\n if (store.storefront === \"own\" && !product.storeUrl) {\n hints.push(\"Ask the user for this product's page on their own site before linking to it.\");\n }\n return hints;\n}\n\nexport function stockHints(answer: ShopifyStockResponse, limit: number): string[] {\n const hints: string[] = [];\n const any = answer.outOfStock.length > 0 || answer.partlyOut.length > 0;\n const unfinished = answer.more.outOfStock || answer.more.partlyOut;\n const pageThrough =\n \"page through with `baker shopify products --stock out_of_stock` / `--stock partly_out` (and the same `--collection`)\";\n if (any) {\n hints.push(\n \"Before promoting these, check which ads and pages point at them; pausing or swapping them is a staged change.\",\n );\n } else if (!unfinished) hints.push(\"Nothing is out of stock.\");\n if (unfinished) {\n const full =\n (answer.more.outOfStock && answer.outOfStock.length >= limit) ||\n (answer.more.partlyOut && answer.partlyOut.length >= limit);\n hints.push(\n full\n ? `More than ${limit} products in a list; raise \\`--limit\\` (up to 200) or ${pageThrough}.`\n : `Baker didn't check every product in one go, so these lists may be missing some — don't say nothing else is out of stock; ${pageThrough}.`,\n );\n }\n const big = answer.partlyOut.find((row) => row.outOptionsMore);\n if (big) {\n hints.push(\n `Not every out-of-stock option is listed: \\`baker shopify product ${big.productId} --out-of-stock\\` lists them all.`,\n );\n }\n return hints;\n}\n\nexport function storeHints(summary: ShopifyStoreSummary): string[] {\n const hints = [\"Share the Products page link (productsUrl) when the user wants to browse the catalog.\"];\n if (summary.unreadable?.length) {\n hints.push(\n \"Some of the store's content isn't readable yet: ask the user to open Baker in their Shopify admin and accept the new permissions.\",\n );\n }\n if (summary.passwordProtected) {\n hints.push(\n \"The store asks for a password before anyone can see it: shoppers from a landing or an ad meet it first.\",\n );\n }\n if (summary.capped) {\n const atCeiling = [\n summary.outOfStock >= SHOPIFY_STOCK_COUNT_CAP ? `${SHOPIFY_STOCK_COUNT_CAP} or more products out of stock` : null,\n summary.partlyOut >= SHOPIFY_STOCK_COUNT_CAP ? `${SHOPIFY_STOCK_COUNT_CAP} or more products partly out` : null,\n summary.collections >= SHOPIFY_COLLECTION_COUNT_CAP\n ? `${SHOPIFY_COLLECTION_COUNT_CAP} or more collections`\n : null,\n ].filter((count): count is string => count !== null);\n hints.push(\n `Some counts stopped at Baker's ceiling: say ${atCeiling.join(\", \")} — never the number as exact. ` +\n \"`baker shopify stock` and `baker shopify products --stock out_of_stock` page through them.\",\n );\n }\n return hints;\n}\n\n/** When buyers order: the busiest weekday, hour or month, in the store's time. */\nfunction timingHints(answer: ShopifySalesResponse): string[] {\n const peak = [...answer.rows].sort((a, b) => b.orders - a.orders)[0];\n if (!peak || peak.orders === 0) return [];\n const zone = answer.window.timezone ? `, ${answer.window.timezone}` : \"\";\n const when =\n answer.by === \"hour\" ? `at ${peak.label}` : answer.by === \"month_of_year\" ? `in ${peak.label}` : `on ${peak.label}`;\n return [`Most orders are placed ${when} (store time${zone}): weight budgets and sends towards it.`];\n}\n\n/**\n * What to say beside a store's sales (S6): the history still coming in, who\n * reports the sales to the ad platforms, a period mostly credited to no\n * campaign, and the landing that sold most.\n */\nexport function salesHints(answer: ShopifySalesResponse): string[] {\n const hints: string[] = [];\n if (answer.ordersUnreadable) {\n hints.push(\n \"Baker can't read this store's orders right now, so these sales may be incomplete. Ask the user to reconnect the store with `request_connection` { platform: \\\"shopify\\\" }.\",\n );\n }\n if (answer.history === \"importing\") {\n hints.push(\n \"Baker is still bringing in this store's past orders; earlier periods are incomplete — say so rather than reporting a drop.\",\n );\n }\n if (answer.totals.orders === 0) {\n hints.push(\"No orders were paid in this period.\");\n return hints;\n }\n if (answer.by === \"weekday\" || answer.by === \"hour\" || answer.by === \"month_of_year\") {\n return [...hints, ...timingHints(answer)];\n }\n const notBaker = ([\"meta\", \"google\"] as const).filter((family) => answer.salesReporting[family] !== \"baker\");\n if (notBaker.length > 0) {\n const names = notBaker.map((family) => (family === \"meta\" ? \"Meta\" : \"Google\")).join(\" and \");\n hints.push(\n `Baker only reports these sales; it does not send them to ${names}. A manager chooses in Brain → Store whether Baker sends them (where Shopify's own channel already reports sales, its purchase tracking has to be turned off first). Never set up a purchase send yourself.`,\n );\n }\n const unattributed = answer.rows\n .filter((row) => row.credit === \"unattributed\")\n .reduce((total, row) => total + row.net, 0);\n if (\n (answer.by === \"campaign\" || answer.by === \"landing\") &&\n answer.totals.net > 0 &&\n unattributed / answer.totals.net > 0.5\n ) {\n hints.push(\n \"Most of these sales came from no campaign Baker found: buyers who came straight to the store, or from links without campaign tags. Say so rather than crediting them to a campaign; links with UTM tags and Baker landings make the next ones traceable.\",\n );\n }\n const leading = answer.by === \"landing\" ? answer.rows.find((row) => row.credit === \"landing\") : undefined;\n if (leading && leading.net > 0) {\n hints.push(\n `\"${leading.label}\" brought the most sales of the Baker pages (${answer.currency ?? \"\"} ${leading.net}). It is the page to learn from before building the next one.`,\n );\n }\n return hints;\n}\n","import { z } from \"zod\";\n\nexport const catalogAuditRequestSchema = z.strictObject({\n cursor: z.string().max(2000).optional(),\n limit: z.number().int().min(1).max(20).default(10),\n /** Which linked Merchant Center account to compare against, when several are linked. */\n merchantId: z\n .string()\n .regex(/^[1-9][0-9]{0,18}$/, \"merchantId is the numeric Merchant Center account id\")\n .optional(),\n});\nexport const catalogAuditCheckSchema = z.object({\n key: z.enum([\n \"title\",\n \"description\",\n \"images\",\n \"category\",\n \"identifiers\",\n \"feed\",\n \"price\",\n \"availability\",\n \"googleReview\",\n ]),\n state: z.enum([\"ok\", \"problem\", \"unknown\"]),\n message: z.string(),\n variantId: z.string().optional(),\n fix: z.string().optional(),\n});\nexport const catalogProductAuditSchema = z.object({\n productId: z.string(),\n title: z.string(),\n checks: z.array(catalogAuditCheckSchema),\n variantsTruncated: z.boolean().optional(),\n});\nexport const catalogAuditResponseSchema = z.object({\n products: z.array(catalogProductAuditSchema),\n nextCursor: z.string().nullable(),\n feedCompared: z.boolean(),\n merchantCenter: z.object({\n /** The account compared against, when one was. */\n merchantId: z.string().optional(),\n /** Why nothing was compared, in words the agent can pass on. */\n note: z.string().optional(),\n /** More offers than one audit reads: variants past the ceiling read as unmatched. */\n truncated: z.boolean().optional(),\n }),\n});\nexport type CatalogAuditCheck = z.infer<typeof catalogAuditCheckSchema>;\nexport type CatalogProductAudit = z.infer<typeof catalogProductAuditSchema>;\nexport type CatalogAuditResponse = z.infer<typeof catalogAuditResponseSchema>;\n","import { catalogAuditResponseSchema } from \"@baker/api/shopify/catalogAds\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { catalogAuditRequest, compactAudit } from \"./catalogReport.ts\";\nimport { fail, fullArg } from \"./common.ts\";\n\nconst description =\n \"Check products before Shopping, Performance Max or catalog ads. Start here: `baker shopify catalog audit`. Reads Baker's copy of the store and, when the company's Google Ads links one, Merchant Center: titles, descriptions, images, identifiers, category, the feed's price and stock against Shopify, and Google's own verdict on each product. Changes nothing; fixes to Shopify are staged with baker shopify change.\";\nconst args = {\n cursor: { type: \"string\" as const, description: \"data.nextCursor from the previous page\", required: false },\n limit: { type: \"string\" as const, description: \"Products per page, 1–20 (default 10)\", required: false },\n \"merchant-id\": {\n type: \"string\" as const,\n description: \"Merchant Center account to compare against, when Google Ads links several\",\n required: false,\n },\n full: fullArg,\n};\nregisterSchema({ command: \"shopify.catalog.audit\", description, args });\n\nconst audit = defineCommand({\n meta: { name: \"audit\", description },\n args,\n async run({ args }) {\n const parsed = catalogAuditRequest({ cursor: args.cursor, limit: args.limit, merchantId: args[\"merchant-id\"] });\n if (!parsed.ok) {\n writeJson({ ok: false, error: parsed.error });\n process.exit(1);\n }\n const { request } = parsed;\n try {\n const data = catalogAuditResponseSchema.parse(await apiPost<unknown>(\"/api/shopify/catalog/audit\", request));\n writeJson({\n ok: true,\n data: args.full ? data : { ...data, ...compactAudit(data.products) },\n hints: [\n ...(!data.feedCompared\n ? [\n `Merchant Center was not compared${data.merchantCenter.note ? `: ${data.merchantCenter.note}` : \".\"} Do not claim Shopping is ready from this audit alone.`,\n ]\n : []),\n ...(data.merchantCenter.truncated\n ? [\n \"Merchant Center holds more products than one audit reads; unmatched variants may simply be past that point.\",\n ]\n : []),\n ...(data.products.some((product) =>\n product.checks.some((check) => check.key === \"googleReview\" && check.state === \"problem\"),\n )\n ? [\n \"Google's verdicts are fixed in Merchant Center or the Google & YouTube channel, not in Shopify: tell the user what Google said, never promise Baker will fix it.\",\n ]\n : []),\n ...(data.nextCursor\n ? [\"Continue with --cursor from data.nextCursor to check the rest of the products.\"]\n : []),\n ...(data.products.some((product) => product.variantsTruncated)\n ? [\n \"Some products have more than 100 options. Read their remaining options before claiming every option was checked.\",\n ]\n : []),\n ],\n });\n } catch (error) {\n fail(error);\n }\n },\n});\n\nexport const catalogCommand = defineCommand({\n meta: { name: \"catalog\", description: \"Check products for Shopping, Performance Max and catalog ads\" },\n subCommands: { audit },\n});\n","import {\n type CatalogAuditCheck,\n type CatalogProductAudit,\n catalogAuditRequestSchema,\n} from \"@baker/api/shopify/catalogAds\";\n\ninterface Finding {\n check: CatalogAuditCheck[\"key\"];\n message: string;\n variants?: string[];\n}\n\nexport interface CompactCatalogAudit {\n products: {\n productId: string;\n title: string;\n problems?: Finding[];\n unknown?: Finding[];\n variantsTruncated?: boolean;\n }[];\n /** One fix per kind of check, for the whole page: it reads the same on every product. */\n fixes: Partial<Record<CatalogAuditCheck[\"key\"], string>>;\n}\n\n/** Same check, same words: one line naming every variant it applies to. */\nfunction grouped(checks: readonly CatalogAuditCheck[]): Finding[] {\n const findings = new Map<string, Finding>();\n for (const check of checks) {\n const id = `${check.key}\\u0000${check.message}`;\n const finding = findings.get(id) ?? { check: check.key, message: check.message };\n if (check.variantId) finding.variants = [...(finding.variants ?? []), check.variantId];\n findings.set(id, finding);\n }\n return [...findings.values()];\n}\n\nfunction collectFixes(checks: readonly CatalogAuditCheck[], fixes: CompactCatalogAudit[\"fixes\"]): void {\n for (const check of checks) {\n if (check.state === \"problem\" && check.fix) fixes[check.key] ??= check.fix;\n }\n}\n\n/** What the agent reads by default: only what needs attention, without repeating itself. */\nexport function compactAudit(products: readonly CatalogProductAudit[]): CompactCatalogAudit {\n const fixes: CompactCatalogAudit[\"fixes\"] = {};\n const rows: CompactCatalogAudit[\"products\"] = [];\n for (const product of products) {\n const problems = grouped(product.checks.filter((check) => check.state === \"problem\"));\n const unknown = grouped(product.checks.filter((check) => check.state === \"unknown\"));\n collectFixes(product.checks, fixes);\n if (problems.length === 0 && unknown.length === 0 && !product.variantsTruncated) continue;\n rows.push({\n productId: product.productId,\n title: product.title,\n ...(problems.length > 0 ? { problems } : {}),\n ...(unknown.length > 0 ? { unknown } : {}),\n ...(product.variantsTruncated ? { variantsTruncated: true } : {}),\n });\n }\n return { products: rows, fixes };\n}\n\ntype CatalogAuditRequest = ReturnType<typeof catalogAuditRequestSchema.parse>;\n\nconst LIMIT_FIX =\n \"Pass --limit as a whole number from 1 to 20 (default 10); page on with --cursor from data.nextCursor.\";\nconst CATALOG_FLAG_FIX: Record<string, string> = {\n limit: LIMIT_FIX,\n merchantId: \"Pass --merchant-id as the numeric Merchant Center account id, or leave it out.\",\n cursor: \"Pass --cursor exactly as data.nextCursor of the previous page, or leave it out to start over.\",\n};\n\ntype CatalogAuditArgs = { cursor?: string; limit?: string; merchantId?: string };\n\n/** The audit request the flags describe, or the validation error to print for flags that can't make one. */\nexport function catalogAuditRequest(args: CatalogAuditArgs):\n | { ok: true; request: CatalogAuditRequest }\n | {\n ok: false;\n error: { code: \"VALIDATION_ERROR\"; message: string; fix: { action: \"retry_with_flag\"; explanation: string } };\n } {\n const parsed = catalogAuditRequestSchema.safeParse({\n cursor: args.cursor,\n ...(args.limit === undefined ? {} : { limit: Number(args.limit) }),\n ...(args.merchantId ? { merchantId: args.merchantId } : {}),\n });\n if (parsed.success) return { ok: true, request: parsed.data };\n const issue = parsed.error.issues[0];\n const field = String(issue?.path[0] ?? \"limit\");\n return {\n ok: false,\n error: {\n code: \"VALIDATION_ERROR\",\n message: `${field}: ${issue?.message ?? \"invalid value\"}`,\n fix: {\n action: \"retry_with_flag\",\n explanation: CATALOG_FLAG_FIX[field] ?? LIMIT_FIX,\n },\n },\n };\n}\n","import { defineCommand } from \"citty\";\nimport { failValidation } from \"../ga4/shared.ts\";\nimport { defined, JSON_ARGS, leaf, list, payloadsFrom, stage } from \"./writeCommon.ts\";\n\n/**\n * `baker shopify change <thing> <verb>` — staged changes to the connected\n * store. Each reads the live store, refuses what would fail or what undo\n * couldn't put back, and stages the change on this chat; it applies when the\n * user publishes the chat, and `baker shopify undo` puts it back.\n */\n\nconst TARGET = (what: string) => ({ type: \"positional\", description: what, required: false }) as const;\n\nfunction positionals(args: Record<string, unknown>): string[] {\n return Array.isArray(args._) ? args._.filter((value): value is string => typeof value === \"string\") : [];\n}\n\nfunction target(args: Record<string, unknown>, what: string): string {\n const [first] = positionals(args);\n if (!first) failValidation(`pass the ${what} as the first argument`);\n return first;\n}\n\n/** `--json` payloads staged against one target, or the flags as one payload. */\nasync function stageFor(\n kind: string,\n args: Record<string, unknown>,\n flags: () => Record<string, unknown>,\n targetOf?: () => string,\n): Promise<void> {\n const payloads = payloadsFrom(args);\n if (payloads) {\n await stage(\n payloads.map((payload) =>\n \"kind\" in payload ? payload : { kind, ...(targetOf ? { target: targetOf() } : {}), payload },\n ),\n );\n return;\n }\n const payload = flags();\n if (Object.keys(payload).length === 0)\n failValidation(\"name at least one thing to change (see `baker schema` for the flags)\");\n await stage([{ kind, ...(targetOf ? { target: targetOf() } : {}), payload }]);\n}\n\nconst productUpdate = leaf(\n \"shopify.change.product.update\",\n {\n name: \"update\",\n description:\n 'Start here to change a product\\'s title, description, SEO, tags or type. Example: baker shopify change product update the-snowboard --title \"The Snowboard\" --seo-title \"…\" --add-tags summer. Tags: --tags replaces the whole list, --add-tags/--remove-tags edit it. Descriptions are HTML without scripts or frames. Many products in one call: --json \\'[{\"kind\":\"shopify.product.update\",\"target\":\"<handle>\",\"payload\":{\"addTags\":[\"summer\"]}}, …]\\' — payload keys: title, descriptionHtml, seo {title, description}, tags | addTags | removeTags, productType.',\n },\n {\n product: TARGET(\"Product id, handle or link\"),\n title: { type: \"string\", description: \"New title\", required: false },\n description: { type: \"string\", description: \"New description, as HTML (no scripts or frames)\", required: false },\n \"seo-title\": { type: \"string\", description: \"Title shown in search results\", required: false },\n \"seo-description\": { type: \"string\", description: \"Description shown in search results\", required: false },\n tags: { type: \"string\", description: \"The whole tag list, comma separated (replaces it)\", required: false },\n \"add-tags\": { type: \"string\", description: \"Tags to add, comma separated\", required: false },\n \"remove-tags\": { type: \"string\", description: \"Tags to remove, comma separated\", required: false },\n type: { type: \"string\", description: \"Product type\", required: false },\n ...JSON_ARGS,\n },\n async (args) =>\n await stageFor(\n \"shopify.product.update\",\n args,\n () =>\n defined({\n title: args.title,\n descriptionHtml: args.description,\n seo:\n args[\"seo-title\"] !== undefined || args[\"seo-description\"] !== undefined\n ? defined({ title: args[\"seo-title\"], description: args[\"seo-description\"] })\n : undefined,\n tags: list(args.tags),\n addTags: list(args[\"add-tags\"]),\n removeTags: list(args[\"remove-tags\"]),\n productType: args.type,\n }),\n positionals(args).length > 0 ? () => target(args, \"product\") : undefined,\n ),\n);\n\nconst WEIGHT_UNITS: Record<string, string> = {\n g: \"GRAMS\",\n gram: \"GRAMS\",\n grams: \"GRAMS\",\n kg: \"KILOGRAMS\",\n kgs: \"KILOGRAMS\",\n kilogram: \"KILOGRAMS\",\n kilograms: \"KILOGRAMS\",\n oz: \"OUNCES\",\n ounce: \"OUNCES\",\n ounces: \"OUNCES\",\n lb: \"POUNDS\",\n lbs: \"POUNDS\",\n pound: \"POUNDS\",\n pounds: \"POUNDS\",\n};\n\n/** `--weight` with `--weight-unit` (kg, g, lb, oz or Shopify's own names), as the payload takes it. */\nexport function weightOf(value: unknown, unit: unknown): Record<string, unknown> | undefined {\n if (value === undefined) return undefined;\n const named = typeof unit === \"string\" ? unit.trim() : \"\";\n return {\n value: Number(value),\n unit: named ? (WEIGHT_UNITS[named.toLowerCase()] ?? named.toUpperCase()) : \"KILOGRAMS\",\n };\n}\n\nconst variantUpdate = leaf(\n \"shopify.change.variant.update\",\n {\n name: \"update\",\n description:\n \"Change one option (variant) of a product: SKU, barcode (GTIN), weight — and its price or sale price, which the user must approve in the chat first (the command hands you the question). Take the option's id from `baker shopify product <product>` (variantId). Example: baker shopify change variant update 456 --sku SNOW-L --barcode 4006381333931 --weight 1.5 --weight-unit kg. --sale-price none clears it.\",\n },\n {\n variant: TARGET(\"The option's id (variantId from baker shopify product)\"),\n sku: { type: \"string\", description: \"SKU\", required: false },\n barcode: { type: \"string\", description: \"Barcode / GTIN (8, 12, 13 or 14 digits)\", required: false },\n weight: { type: \"string\", description: \"Weight value\", required: false },\n \"weight-unit\": {\n type: \"string\",\n description: \"kg | g | lb | oz (default kg)\",\n required: false,\n },\n price: {\n type: \"string\",\n description: 'Price as a decimal, e.g. \"649.95\" (needs the user\\'s yes)',\n required: false,\n },\n \"sale-price\": {\n type: \"string\",\n description: 'Compare-at price, or \"none\" to clear it (needs the user\\'s yes)',\n required: false,\n },\n ...JSON_ARGS,\n },\n async (args) =>\n await stageFor(\n \"shopify.variant.update\",\n args,\n () =>\n defined({\n sku: args.sku,\n barcode: args.barcode,\n weight: weightOf(args.weight, args[\"weight-unit\"]),\n price: args.price,\n compareAtPrice: args[\"sale-price\"] === \"none\" ? null : args[\"sale-price\"],\n }),\n positionals(args).length > 0 ? () => target(args, \"option id\") : undefined,\n ),\n);\n\nconst fieldSet = leaf(\n \"shopify.change.field.set\",\n {\n name: \"set\",\n description:\n 'Set a custom field (metafield) on a product, an option or a collection. The owner is product:<ref>, variant:<id>, collection:<ref> or a collection staged in this chat (its shopify_temp_ ref); a bare reference is a product. If the store defines the field, send its type. Example: baker shopify change field set product:the-snowboard --namespace custom --key care --type single_line_text_field --value \"Wash cold\".',\n },\n {\n owner: TARGET(\"product:<ref>, variant:<id> or collection:<ref>\"),\n namespace: { type: \"string\", description: \"Namespace, e.g. custom\", required: false },\n key: { type: \"string\", description: \"Key, e.g. care\", required: false },\n type: {\n type: \"string\",\n description: \"Shopify's type, e.g. single_line_text_field, rich_text_field, json\",\n required: false,\n },\n value: { type: \"string\", description: \"The value, as Shopify takes it for that type\", required: false },\n ...JSON_ARGS,\n },\n async (args) =>\n await stageFor(\n \"shopify.metafield.set\",\n args,\n () => defined({ namespace: args.namespace, key: args.key, type: args.type, value: args.value }),\n () => target(args, \"owner\"),\n ),\n);\n\nconst fieldRemove = leaf(\n \"shopify.change.field.remove\",\n {\n name: \"remove\",\n description:\n \"Remove a custom field from a product, an option or a collection. Example: baker shopify change field remove product:the-snowboard custom.care\",\n },\n {\n owner: TARGET(\"product:<ref>, variant:<id> or collection:<ref>\"),\n field: TARGET(\"namespace.key, e.g. custom.care\"),\n },\n async (args) => {\n const [owner, field] = positionals(args);\n const [namespace, ...rest] = (field ?? \"\").split(\".\");\n if (!owner || !namespace || rest.length === 0) failValidation(\"pass the owner and the field as namespace.key\");\n await stage([{ kind: \"shopify.metafield.delete\", target: owner, payload: { namespace, key: rest.join(\".\") } }]);\n },\n);\n\nconst collectionCreate = leaf(\n \"shopify.change.collection.create\",\n {\n name: \"create\",\n description:\n 'Create a collection of hand-picked products, shown on the online store (a second change, staged with it) unless --hidden. Example: baker shopify change collection create --title \"Summer boards\" --products snowboard-a,snowboard-b. Collections whose products join by rules are made in Shopify.',\n },\n {\n title: { type: \"string\", description: \"Title\", required: false },\n handle: {\n type: \"string\",\n description: \"Its address (/collections/<handle>); default from the title\",\n required: false,\n },\n description: { type: \"string\", description: \"Description, as HTML (no scripts or frames)\", required: false },\n \"seo-title\": { type: \"string\", description: \"Title shown in search results\", required: false },\n \"seo-description\": { type: \"string\", description: \"Description shown in search results\", required: false },\n products: {\n type: \"string\",\n description: \"Products, comma separated (ids, handles or links), in order\",\n required: false,\n },\n sort: {\n type: \"string\",\n description: \"MANUAL | BEST_SELLING | ALPHA_ASC | ALPHA_DESC | PRICE_ASC | PRICE_DESC | CREATED | CREATED_DESC\",\n required: false,\n },\n hidden: { type: \"boolean\", description: \"Don't show it on the online store yet\", required: false },\n ...JSON_ARGS,\n },\n async (args) =>\n await stageFor(\"shopify.collection.create\", args, () =>\n defined({\n title: args.title,\n handle: args.handle,\n descriptionHtml: args.description,\n seo:\n args[\"seo-title\"] !== undefined || args[\"seo-description\"] !== undefined\n ? defined({ title: args[\"seo-title\"], description: args[\"seo-description\"] })\n : undefined,\n products: list(args.products),\n sortOrder: typeof args.sort === \"string\" ? args.sort.toUpperCase() : undefined,\n onlineStore: args.hidden === true ? false : undefined,\n }),\n ),\n);\n\nconst collectionUpdate = leaf(\n \"shopify.change.collection.update\",\n {\n name: \"update\",\n description:\n 'Change a collection\\'s title, description, SEO or sort order (its address stays: stage a redirect to move it). Example: baker shopify change collection update summer-boards --title \"Summer\"',\n },\n {\n collection: TARGET(\"Collection id, handle or link\"),\n title: { type: \"string\", description: \"New title\", required: false },\n description: { type: \"string\", description: \"New description, as HTML\", required: false },\n \"seo-title\": { type: \"string\", description: \"Title shown in search results\", required: false },\n \"seo-description\": { type: \"string\", description: \"Description shown in search results\", required: false },\n sort: { type: \"string\", description: \"Sort order (see collection create)\", required: false },\n ...JSON_ARGS,\n },\n async (args) =>\n await stageFor(\n \"shopify.collection.update\",\n args,\n () =>\n defined({\n title: args.title,\n descriptionHtml: args.description,\n seo:\n args[\"seo-title\"] !== undefined || args[\"seo-description\"] !== undefined\n ? defined({ title: args[\"seo-title\"], description: args[\"seo-description\"] })\n : undefined,\n sortOrder: typeof args.sort === \"string\" ? args.sort.toUpperCase() : undefined,\n }),\n () => target(args, \"collection\"),\n ),\n);\n\nfunction collectionVerb(verb: \"show\" | \"hide\" | \"delete\", kind: string, description: string) {\n return leaf(\n `shopify.change.collection.${verb}`,\n { name: verb, description },\n { collection: TARGET(\"Collection id, handle, link or a shopify_temp_ ref staged in this chat\") },\n async (args) => await stage([{ kind, target: target(args, \"collection\") }]),\n );\n}\n\nfunction membership(verb: \"add\" | \"remove\", kind: string, description: string) {\n return leaf(\n `shopify.change.collection.${verb}`,\n { name: verb, description },\n {\n collection: TARGET(\"Collection id, handle, link or a shopify_temp_ ref\"),\n products: TARGET(\"Products (ids, handles or links), space separated\"),\n },\n async (args) => {\n const [collection, ...products] = positionals(args);\n if (!collection || products.length === 0) failValidation(\"pass the collection, then the products\");\n await stage([{ kind, target: collection, payload: { products } }]);\n },\n );\n}\n\nfunction discountValue(args: Record<string, unknown>): Record<string, unknown> | undefined {\n if (args.percent !== undefined) return { percentage: Number(args.percent) };\n if (args.amount !== undefined) return { amount: args.amount };\n return undefined;\n}\n\nfunction appliesToOf(args: Record<string, unknown>): Record<string, unknown> {\n const products = list(args.products);\n if (products) return { products };\n const collections = list(args.collections);\n return collections ? { collections } : { all: true };\n}\n\nfunction combinesOf(value: unknown): Record<string, boolean> | undefined {\n const combines = list(value) ?? [];\n if (combines.length === 0) return undefined;\n return {\n productDiscounts: combines.includes(\"product\"),\n orderDiscounts: combines.includes(\"order\"),\n shippingDiscounts: combines.includes(\"shipping\"),\n };\n}\n\nfunction numberOf(value: unknown): number | undefined {\n return value === undefined ? undefined : Number(value);\n}\n\nfunction discountPayload(args: Record<string, unknown>): Record<string, unknown> {\n return defined({\n code: args.code,\n title: args.title,\n value: discountValue(args),\n appliesTo: appliesToOf(args),\n minimumSubtotal: args[\"min-subtotal\"],\n minimumQuantity: numberOf(args[\"min-quantity\"]),\n startsAt: args.starts,\n endsAt: args.ends,\n usageLimit: numberOf(args.limit),\n oncePerCustomer: args[\"any-times\"] === true ? false : undefined,\n combinesWith: combinesOf(args.combines),\n });\n}\n\n/** The flags a sign-up offer cannot be staged without, said the way the agent fixes them. */\nexport function signupOfferFlagsProblem(args: Record<string, unknown>): string | undefined {\n if (typeof args.name !== \"string\" || args.name.trim() === \"\")\n return 'Add --name \"<what shoppers and store staff see, e.g. 10% off>\": every sign-up offer needs a name.';\n if (args[\"valid-days\"] === undefined)\n return \"Add --valid-days <1-365>: how many days each code lasts after it is given.\";\n return undefined;\n}\n\nexport function signupOfferPayload(args: Record<string, unknown>): Record<string, unknown> {\n return defined({\n name: args.name,\n value: discountValue(args),\n appliesTo: appliesToOf(args),\n minimumSubtotal: args.minimum,\n validForDays: numberOf(args[\"valid-days\"]),\n endsAt: args.ends,\n maxCodes: numberOf(args[\"max-codes\"]),\n codePrefix: args.prefix,\n combinesWith: combinesOf(args.combines),\n });\n}\n\nconst signupOfferSet = leaf(\n \"shopify.change.signupOffer.set\",\n {\n name: \"set\",\n description:\n 'Stage a sign-up offer. Changes money: ask the exact approval question returned by this command. Example: baker shopify change signup-offer set welcome-10 --name \"Welcome\" --percent 10 --valid-days 14 --max-codes 1000',\n },\n {\n handle: TARGET(\"Offer handle, e.g. welcome-10\"),\n name: {\n type: \"string\",\n description: 'Offer name shoppers and store staff see (required), e.g. \"10% off\"',\n required: false,\n },\n percent: { type: \"string\", description: \"Percentage off (choose percent or amount)\", required: false },\n amount: { type: \"string\", description: \"Amount off in the store currency\", required: false },\n products: { type: \"string\", description: \"Product handles or ids, comma separated\", required: false },\n collections: { type: \"string\", description: \"Collection handles or ids, comma separated\", required: false },\n minimum: { type: \"string\", description: \"Minimum subtotal\", required: false },\n \"valid-days\": { type: \"string\", description: \"Each code lasts 1–365 days (required)\", required: false },\n ends: { type: \"string\", description: \"Offer end as ISO date and time; no code outlives it\", required: false },\n \"max-codes\": { type: \"string\", description: \"Total codes the offer may give, 1–100000\", required: false },\n prefix: { type: \"string\", description: \"Code prefix: 2–12 uppercase letters or digits\", required: false },\n combines: {\n type: \"string\",\n description: \"Comma-separated product,order,shipping discounts to combine\",\n required: false,\n },\n ...JSON_ARGS,\n },\n async (args) =>\n await stageFor(\n \"shopify.signupOffer.set\",\n args,\n () => {\n const problem = signupOfferFlagsProblem(args);\n if (problem) failValidation(problem);\n return signupOfferPayload(args);\n },\n () => target(args, \"offer handle\"),\n ),\n);\n\nconst signupOfferEnd = leaf(\n \"shopify.change.signupOffer.end\",\n {\n name: \"end\",\n description:\n \"End a sign-up offer at Publish. Existing codes keep their terms. Example: baker shopify change signup-offer end welcome-10\",\n },\n { handle: TARGET(\"Offer handle\") },\n async (args) => await stage([{ kind: \"shopify.signupOffer.end\", target: target(args, \"offer handle\") }]),\n);\n\nconst discountCreate = leaf(\n \"shopify.change.discount.create\",\n {\n name: \"create\",\n description:\n \"Create a discount code for everyone who has it. Changes money: the user must say yes in the chat first — the command hands you the exact question. Example: baker shopify change discount create --code SPRING10 --percent 10 --ends 2026-10-12T23:59:00Z --limit 500. Applies to everything unless --products or --collections; starts when published unless --starts.\",\n },\n {\n code: { type: \"string\", description: \"The code shoppers type, e.g. SPRING10\", required: false },\n title: { type: \"string\", description: \"What the store's staff see (default: the code)\", required: false },\n percent: { type: \"string\", description: \"Percentage off, 1-100\", required: false },\n amount: { type: \"string\", description: \"Amount off, as a decimal in the store's currency\", required: false },\n products: { type: \"string\", description: \"Only these products, comma separated\", required: false },\n collections: { type: \"string\", description: \"Only these collections, comma separated\", required: false },\n \"min-subtotal\": { type: \"string\", description: \"Minimum order amount\", required: false },\n \"min-quantity\": { type: \"string\", description: \"Minimum number of items\", required: false },\n starts: { type: \"string\", description: \"Start, ISO date-time (default: when published)\", required: false },\n ends: { type: \"string\", description: \"End, ISO date-time (default: no end)\", required: false },\n limit: { type: \"string\", description: \"Total number of uses\", required: false },\n \"any-times\": { type: \"boolean\", description: \"A customer may use it more than once\", required: false },\n combines: {\n type: \"string\",\n description: \"What it combines with, comma separated: product, order, shipping\",\n required: false,\n },\n ...JSON_ARGS,\n },\n async (args) => await stageFor(\"shopify.discountCode.create\", args, () => discountPayload(args)),\n);\n\nconst discountStop = leaf(\n \"shopify.change.discount.stop\",\n {\n name: \"stop\",\n description:\n \"Stop a discount code (it ends when published). Changes money: needs the user's yes. Undo puts its own dates back. Example: baker shopify change discount stop SPRING10\",\n },\n { code: TARGET(\"The discount code\") },\n async (args) => await stage([{ kind: \"shopify.discountCode.deactivate\", target: target(args, \"code\") }]),\n);\n\nconst discountDates = leaf(\n \"shopify.change.discount.dates\",\n {\n name: \"dates\",\n description:\n \"Change when a discount code runs. Changes money: needs the user's yes. Example: baker shopify change discount dates SPRING10 --starts 2026-10-01T00:00:00Z --ends never\",\n },\n {\n code: TARGET(\"The discount code\"),\n starts: { type: \"string\", description: \"Start, ISO date-time\", required: false },\n ends: { type: \"string\", description: 'End, ISO date-time, or \"never\"', required: false },\n },\n async (args) => {\n if (typeof args.starts !== \"string\" || typeof args.ends !== \"string\") failValidation(\"pass --starts and --ends\");\n await stage([\n {\n kind: \"shopify.discountCode.schedule\",\n target: target(args, \"code\"),\n payload: { startsAt: args.starts, endsAt: args.ends === \"never\" ? null : args.ends },\n },\n ]);\n },\n);\n\nconst redirectCreate = leaf(\n \"shopify.change.redirect.create\",\n {\n name: \"create\",\n description:\n \"Redirect an old address on the store to a new one (store paths, or a full https link). Example: baker shopify change redirect create --from /collections/old-boards --to /collections/summer-boards\",\n },\n {\n from: { type: \"string\", description: \"The old path, starting with /\", required: false },\n to: { type: \"string\", description: \"Where it sends shoppers: a path or an https link\", required: false },\n ...JSON_ARGS,\n },\n async (args) => await stageFor(\"shopify.urlRedirect.create\", args, () => defined({ from: args.from, to: args.to })),\n);\n\nconst redirectRemove = leaf(\n \"shopify.change.redirect.remove\",\n {\n name: \"remove\",\n description: \"Remove a redirect, by the path it redirects. Example: baker shopify change redirect remove /old\",\n },\n { from: TARGET(\"The redirected path\") },\n async (args) => await stage([{ kind: \"shopify.urlRedirect.delete\", target: target(args, \"path\") }]),\n);\n\nconst campaignAdd = leaf(\n \"shopify.change.campaign.add\",\n {\n name: \"add\",\n description:\n \"Show a Baker ad campaign in the store's Shopify Marketing, so Shopify's reports credit its sales; Baker then sends its daily figures. Title, status, budget and spend come from the ad platform. Example: baker shopify change campaign add --platform google-ads --account 3865083115 --campaign 2101 --utm-campaign spring --utm-source google --utm-medium cpc\",\n },\n {\n platform: { type: \"string\", description: \"google-ads | meta\", required: false },\n account: { type: \"string\", description: \"The ad account id\", required: false },\n campaign: { type: \"string\", description: \"The campaign id\", required: false },\n \"utm-campaign\": { type: \"string\", description: \"utm_campaign its links carry\", required: false },\n \"utm-source\": { type: \"string\", description: \"utm_source\", required: false },\n \"utm-medium\": { type: \"string\", description: \"utm_medium\", required: false },\n },\n async (args) =>\n await stage([\n {\n kind: \"shopify.marketingActivity.upsert\",\n payload: {\n platform: args.platform,\n accountId: args.account,\n campaignId: args.campaign,\n utm: { campaign: args[\"utm-campaign\"], source: args[\"utm-source\"], medium: args[\"utm-medium\"] },\n },\n },\n ]),\n);\n\nconst campaignRemove = leaf(\n \"shopify.change.campaign.remove\",\n {\n name: \"remove\",\n description:\n \"Take a Baker campaign out of Shopify Marketing. Example: baker shopify change campaign remove google-ads:3865083115:2101\",\n },\n { campaign: TARGET(\"<platform>:<account>:<campaign>\") },\n async (args) => await stage([{ kind: \"shopify.marketingActivity.delete\", target: target(args, \"campaign\") }]),\n);\n\nconst measurementReconnect = leaf(\n \"shopify.change.measurement.reconnect\",\n {\n name: \"reconnect\",\n description:\n \"Reconnect Baker's measurement on the store (the fix `baker shopify tracking audit` names when it is gone). Applies when published; Baker also repairs it on its own once a day.\",\n },\n {},\n async () => await stage([{ kind: \"shopify.webPixel.update\" }]),\n);\n\nconst group = (name: string, description: string, subCommands: Record<string, unknown>) =>\n defineCommand({ meta: { name, description }, subCommands: subCommands as never });\n\nexport const changeCommand = defineCommand({\n meta: {\n name: \"change\",\n description: `Stage a change to the connected store. Nothing changes until the user publishes the chat; every\nchange can be put back with \\`baker shopify undo\\`. Prices and discounts need the user's yes first.\n\n baker shopify change product update <product> --title … --seo-title … --add-tags a,b\n baker shopify change variant update <variantId> --sku … --barcode … --price …\n baker shopify change field set product:<product> --namespace custom --key … --type … --value …\n baker shopify change collection create --title … --products a,b\n baker shopify change discount create --code SPRING10 --percent 10 --ends <iso>\n baker shopify change redirect create --from /old --to /new\n baker shopify change campaign add --platform google-ads --account … --campaign …\n baker shopify change measurement reconnect`,\n },\n subCommands: {\n \"signup-offer\": group(\"signup-offer\", \"Stage or end a sign-up offer\", { set: signupOfferSet, end: signupOfferEnd }),\n product: group(\"product\", \"Change a product's title, description, SEO, tags or type\", { update: productUpdate }),\n variant: group(\"variant\", \"Change an option's SKU, barcode, weight or price\", { update: variantUpdate }),\n field: group(\"field\", \"Set or remove a custom field\", { set: fieldSet, remove: fieldRemove }),\n collection: group(\"collection\", \"Create, change, show, hide, fill or delete a collection\", {\n create: collectionCreate,\n update: collectionUpdate,\n show: collectionVerb(\n \"show\",\n \"shopify.collection.publish\",\n \"Show a collection on the online store. Example: baker shopify change collection show summer-boards\",\n ),\n hide: collectionVerb(\n \"hide\",\n \"shopify.collection.unpublish\",\n \"Hide a collection from the online store. Example: baker shopify change collection hide summer-boards\",\n ),\n delete: collectionVerb(\n \"delete\",\n \"shopify.collection.delete\",\n \"Delete a collection — only one undo could rebuild exactly (hand-picked products, no image, no custom fields, no discount or menu pointing at it); refused otherwise with the reason. Stage a redirect for its address. Example: baker shopify change collection delete old-boards\",\n ),\n add: membership(\n \"add\",\n \"shopify.collection.addProducts\",\n \"Add products to a collection. Example: baker shopify change collection add summer-boards snowboard-a snowboard-b\",\n ),\n remove: membership(\n \"remove\",\n \"shopify.collection.removeProducts\",\n \"Remove products from a collection. Example: baker shopify change collection remove summer-boards snowboard-a\",\n ),\n }),\n discount: group(\"discount\", \"Create, stop or reschedule a discount code (needs the user's yes)\", {\n create: discountCreate,\n stop: discountStop,\n dates: discountDates,\n }),\n redirect: group(\"redirect\", \"Create or remove a redirect\", { create: redirectCreate, remove: redirectRemove }),\n campaign: group(\"campaign\", \"Show or remove a Baker campaign in Shopify Marketing\", {\n add: campaignAdd,\n remove: campaignRemove,\n }),\n measurement: group(\"measurement\", \"Reconnect Baker's measurement on the store\", {\n reconnect: measurementReconnect,\n }),\n },\n});\n","import type { ShopifyChangesResponse, ShopifyDraftStageResponse } from \"@baker/api/shopify/writes\";\nimport { apiGet, apiPost } from \"../../client.ts\";\nimport { requireChatId } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { failValidation } from \"../ga4/shared.ts\";\nimport { params } from \"./common.ts\";\nimport { emitStage, failChange, leaf } from \"./writeCommon.ts\";\nimport { changesHints } from \"./writeHints.ts\";\n\n/** `baker shopify changes` and `baker shopify undo` — what Baker changed in the store, and putting it back. */\n\nexport const changesCommand = leaf(\n \"shopify.changes\",\n {\n name: \"changes\",\n description:\n \"The changes Baker made to the store, newest first, each with its changeId and whether it can be undone. Example: baker shopify changes --limit 20 (or --chat <id> for one chat's).\",\n },\n {\n limit: { type: \"string\", description: \"How many, 1-100 (default 20)\", required: false },\n chat: { type: \"string\", description: \"Only one chat's changes\", required: false },\n },\n async (args) => {\n try {\n const data = await apiGet<ShopifyChangesResponse>(\n \"/api/shopify/changes\",\n params({ limit: args.limit, chatId: args.chat }),\n );\n writeJson({ ok: true, hints: changesHints(data), data });\n } catch (err) {\n failChange(err);\n }\n },\n);\n\nexport const undoCommand = leaf(\n \"shopify.undo\",\n {\n name: \"undo\",\n description:\n \"Stage the change that puts an applied store change back, read from the store as it was before it — applied when the user publishes, like any change. Prices and discounts ask the user again. Refused when the store changed since. Example: baker shopify undo <changeId> [<changeId>…]\",\n },\n { changeIds: { type: \"positional\", description: \"changeIds from `baker shopify changes`\", required: false } },\n async (args) => {\n const changeIds = Array.isArray(args._) ? args._.filter((value): value is string => typeof value === \"string\") : [];\n if (changeIds.length === 0) failValidation(\"pass the changeIds to undo (see `baker shopify changes`)\");\n try {\n const data = await apiPost<ShopifyDraftStageResponse>(\"/api/shopify/undo\", {\n chatId: requireChatId(),\n changeIds,\n });\n emitStage(data);\n } catch (err) {\n failChange(err);\n }\n },\n);\n","import type { ShopifyDraftListResponse, ShopifyDraftStageResponse } from \"@baker/api/shopify/writes\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { requireChatId, resolveChatId } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { CHAT_READ_ARG } from \"../chat-arg.ts\";\nimport { failValidation, loadJsonArg } from \"../ga4/shared.ts\";\nimport { emitStage, failChange, leaf } from \"./writeCommon.ts\";\n\n/** `baker shopify draft list|show|amend|remove|clear` — the store changes staged on this chat. */\n\nfunction refOf(args: Record<string, unknown>): string {\n const [ref] = Array.isArray(args._) ? args._ : [];\n if (typeof ref !== \"string\" || ref === \"\")\n failValidation(\"pass the staged change's ref (see `baker shopify draft list`)\");\n return ref;\n}\n\nfunction listHints(data: ShopifyDraftListResponse): string[] {\n if (data.status === \"none\" || data.count === 0) return [\"No store changes are staged on this chat.\"];\n if (data.status === \"active\") {\n return [\n \"Staged only: these apply when the user publishes the chat. Correct one with `baker shopify draft amend <ref>`, drop one with `remove`.\",\n ];\n }\n const failed = data.ops.filter((op) => op.result?.status === \"failed\" || op.result?.status === \"skipped\");\n return failed.length > 0\n ? [`${failed.length} of ${data.count} changes did not go through — say which and why; never report them as made.`]\n : [];\n}\n\nconst list = leaf(\n \"shopify.draft.list\",\n {\n name: \"list\",\n description:\n \"Start here to review the store changes staged on this chat (or another chat's with --chat): what each is, whether it changes money, and after publish what happened to it.\",\n },\n { chat: CHAT_READ_ARG },\n async (args) => {\n try {\n const data = await apiPost<ShopifyDraftListResponse>(\"/api/shopify/draft/list\", {\n chatId: resolveChatId(args.chat),\n });\n writeJson({ ok: true, hints: listHints(data), data });\n } catch (err) {\n failChange(err);\n }\n },\n);\n\nconst show = leaf(\n \"shopify.draft.show\",\n {\n name: \"show\",\n description:\n \"One staged store change in full: what it sends and the store as it was read when it was staged (the before).\",\n },\n { ref: { type: \"positional\", description: \"The staged change's ref\", required: false }, chat: CHAT_READ_ARG },\n async (args) => {\n try {\n const data = await apiPost(\"/api/shopify/draft/show\", { chatId: resolveChatId(args.chat), ref: refOf(args) });\n writeJson({ ok: true, data });\n } catch (err) {\n failChange(err);\n }\n },\n);\n\nconst amend = leaf(\n \"shopify.draft.amend\",\n {\n name: \"amend\",\n description:\n \"Correct a staged change in place: a JSON patch merged into its payload (objects merge, null removes a key) and every check run again — a changed price asks the user again. Example: baker shopify draft amend product:123 --patch '{\\\"title\\\":\\\"Better\\\"}'. Keys are the payload's, not the flags': productType (not type), seo {title, description}, addTags, compareAtPrice; a key it doesn't take is refused with the ones it does.\",\n },\n {\n ref: { type: \"positional\", description: \"The staged change's ref\", required: false },\n patch: { type: \"string\", description: \"Inline JSON patch\", required: false },\n file: { type: \"string\", description: \"A JSON file with the patch\", required: false },\n },\n async (args) => {\n try {\n const data = await apiPost<ShopifyDraftStageResponse>(\"/api/shopify/draft/amend\", {\n chatId: requireChatId(),\n ref: refOf(args),\n patch: loadJsonArg(args, \"patch\"),\n });\n emitStage(data);\n } catch (err) {\n failChange(err);\n }\n },\n);\n\nconst remove = leaf(\n \"shopify.draft.remove\",\n {\n name: \"remove\",\n description: \"Drop one staged store change, and any change that needs it (a new collection's show).\",\n },\n { ref: { type: \"positional\", description: \"The staged change's ref\", required: false } },\n async (args) => {\n try {\n writeJson({\n ok: true,\n data: await apiPost(\"/api/shopify/draft/remove\", { chatId: requireChatId(), ref: refOf(args) }),\n });\n } catch (err) {\n failChange(err);\n }\n },\n);\n\nconst clear = leaf(\n \"shopify.draft.clear\",\n { name: \"clear\", description: \"Drop every store change staged on this chat.\" },\n {},\n async () => {\n try {\n writeJson({ ok: true, data: await apiPost(\"/api/shopify/draft/clear\", { chatId: requireChatId() }) });\n } catch (err) {\n failChange(err);\n }\n },\n);\n\nexport const draftCommand = defineCommand({\n meta: { name: \"draft\", description: \"List, show, amend, remove or clear the store changes staged on this chat\" },\n subCommands: { list, show, amend, remove, clear },\n});\n","import type { ShopifyProductResponse } from \"@baker/api/shopify\";\nimport type { ShopifyPromotionsResponse } from \"@baker/api/shopify/promotions\";\nimport type { ShopifyStockHoldsResponse } from \"@baker/api/shopify/stockHolds\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiGet, apiPost } from \"../../client.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { emit, fail, fullArg, params } from \"./common.ts\";\nimport { withEveryOption } from \"./everyOption.ts\";\nimport { storeStateHints } from \"./hints.ts\";\nimport { landingLinksOf, readWorkspacePages } from \"./landingLinks.ts\";\nimport { promotionHints } from \"./promotionHints.ts\";\nimport { stockHoldReport } from \"./stockHoldReport.ts\";\n\n/**\n * `baker shopify promotions` and `baker shopify stock-holds` (S8): what\n * advertises a product, and what Baker paused because a product ran out.\n */\n\nregisterSchema({\n command: \"shopify.promotions\",\n description:\n \"Start here when a product runs out of stock or comes back: what is advertising it — ads on Google Ads and Meta that lead to its store page, its buy link or a landing that links to it (`via`), the landings themselves (from this workspace's pages, and from measured visits), and the Shopping campaigns and catalog ads that show it (they stop by themselves when it runs out — never pause them). Read it in the Session that pauses: a pause is remembered only for a product whose promotions that Session read, so that a scheduled agent on the product coming back in stock, if the company has one, can later stage turning it back on for the user to review — nothing restarts by itself, and every pause waits for the user to review and publish. `checked.not_checked` names a platform Baker could not read.\",\n args: {\n product: { type: \"positional\", description: \"Product id, handle, or a link to the product\", required: true },\n full: {\n ...fullArg,\n description:\n \"Add each ad's campaign and ad group or ad set ids and its URL (its id, account and Google resource name are always there)\",\n },\n },\n});\n\nregisterSchema({\n command: \"shopify.stock-holds\",\n description:\n \"Start here when a product is back in stock: what Baker paused because it ran out, answered for the marketer. `resume` holds the one command to stage per ad Baker may turn back on now — stage those and nothing else. `tell_user` holds one sentence per ad (and per piece of out-of-stock work still waiting for review), written for the marketer: tell them those, as written. `pages` names landings the out-of-stock run changed and the read that shows those page changes. Use `--product` for the product that came back: the answer then speaks only of its ads. `--full` adds the codes behind each sentence (verdicts, ids) for debugging, never for the user.\",\n args: {\n product: { type: \"string\", description: \"Only one product's holds: its id, handle or link\", required: false },\n all: { type: \"boolean\", description: \"Resolved holds too (resumed or released)\", required: false, default: false },\n full: fullArg,\n },\n});\n\n/**\n * The answer as printed. Whether the read was remembered decides the hints;\n * printed, runs relayed it to the marketer as a promise, so only `--full` shows it.\n */\nexport function promotionsShown(\n answer: ShopifyPromotionsResponse,\n full: boolean,\n): Omit<ShopifyPromotionsResponse, \"remembered\"> {\n if (full) return answer;\n const { remembered: _remembered, ...shown } = answer;\n return shown;\n}\n\nexport const promotionsCommand = defineCommand({\n meta: {\n name: \"promotions\",\n description:\n \"What advertises one product: ads that lead to it, landings that link to it, Shopping that shows it. Example: baker shopify promotions 10310413942969\",\n },\n args: {\n product: { type: \"positional\", description: \"Product id, handle, or a link to the product\", required: true },\n full: {\n type: \"boolean\",\n description: \"Add campaign and ad group or ad set ids and URLs\",\n required: false,\n default: false,\n },\n },\n run: async ({ args }) => {\n try {\n const positionals = Array.isArray(args._) ? args._ : [];\n if (positionals.length > 1) {\n throw new ApiError(\"VALIDATION_ERROR\", \"product: Pass one product id, handle or product link.\");\n }\n const first = await apiGet<ShopifyProductResponse>(\"/api/shopify/product\", params({ ref: args.product }));\n const { store } = first;\n // A landing linking an option past the first page still counts.\n const product = await withEveryOption(\n first.product,\n async (variantsCursor) =>\n (\n await apiGet<ShopifyProductResponse>(\n \"/api/shopify/product\",\n params({ ref: first.product.productId, variantsCursor }),\n )\n ).product,\n );\n const scan = await readWorkspacePages(process.cwd());\n const linked = scan\n ? landingLinksOf(scan.pages, {\n handle: product.handle,\n productId: product.productId,\n variantIds: product.variants.map((variant) => variant.variantId),\n buyUrls: product.variants.flatMap((variant) => (variant.buyUrl ? [variant.buyUrl] : [])),\n })\n : undefined;\n const answer = await apiPost<ShopifyPromotionsResponse>(\"/api/shopify/promotions\", {\n product: product.productId,\n ...(linked ? { linked_landings: linked.slice(0, 50) } : {}),\n scanned: scan !== null,\n ...(args.full ? { full: true } : {}),\n });\n emit(promotionsShown(answer, args.full === true), { store }, [\n ...storeStateHints(store),\n ...promotionHints(answer, { scanned: scan !== null, skippedPages: scan?.skipped ?? 0 }),\n ]);\n } catch (err) {\n fail(err);\n }\n },\n});\n\nexport const stockHoldsCommand = defineCommand({\n meta: {\n name: \"stock-holds\",\n description:\n \"The ads Baker paused because a product ran out, and whether each may be resumed now. Example: baker shopify stock-holds --product 10310413942969\",\n },\n args: {\n product: { type: \"string\", description: \"Only one product: its id, handle or link\", required: false },\n all: { type: \"boolean\", description: \"Resolved holds too\", required: false, default: false },\n full: { type: \"boolean\", description: \"Everything Baker keeps\", required: false, default: false },\n },\n run: async ({ args }) => {\n try {\n const answer = await apiGet<ShopifyStockHoldsResponse>(\n \"/api/shopify/stock-holds\",\n params({ product: args.product, all: args.all, full: args.full }),\n );\n const report = stockHoldReport(answer, { product: args.product !== undefined, full: args.full === true });\n emit(report.data, { store: answer.store, count: answer.holds.length }, [\n ...storeStateHints(answer.store),\n ...report.hints,\n ]);\n } catch (err) {\n fail(err);\n }\n },\n});\n","import type { Dirent } from \"node:fs\";\nimport { readdir, readFile, stat } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { parse } from \"@astrojs/compiler/sync\";\nimport type { AttributeNode, Node } from \"@astrojs/compiler/types\";\nimport type { LANDING_LINK_EVIDENCE } from \"@baker/api/shopify/promotions\";\nimport { landingGraphFiles } from \"../landing/import-graph.ts\";\n\n/**\n * Which of the workspace's landings link to a product (S8, `baker shopify\n * promotions`). Read from the pages themselves — the Session's own work\n * included, live or not — because Baker's copy of a landing holds no content.\n *\n * A page links to the product when the source its import graph pulls in holds\n * the product's buy link, its store page (`/products/<handle>` on a word\n * boundary), one of its options (`/cart/<id>:` or `variant=<id>`), or a buy\n * component the template renders that names it (`<ShopifyProduct product=\"…\">`,\n * `<ShopifyBuyButton product=\"…\">` or an `items` entry's `product: \"…\"`, by\n * handle or id, S10). A variant folder (`<page>--2`) is filed under its page.\n *\n * Read-only and bounded: at most 300 pages, files up to 256 KB.\n */\n\nexport type LinkEvidence = (typeof LANDING_LINK_EVIDENCE)[number];\n\nexport interface ProductKeys {\n handle: string;\n /** The product's numeric id: a buy component may name it instead of the handle. */\n productId?: string;\n variantIds: readonly string[];\n buyUrls: readonly string[];\n}\n\nexport interface LandingPage {\n slug: string;\n files: ReadonlyArray<{ path: string; text: string }>;\n}\n\nconst PAGES_MAX = 300;\nconst FILE_BYTES_MAX = 256 * 1024;\n\nfunction escaped(text: string): string {\n return text.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\nconst BUY_COMPONENTS = new Set([\"ShopifyProduct\", \"ShopifyBuyButton\"]);\nconst STRING_LITERAL = /^\\s*([\"'`])([^\"'`]*)\\1\\s*$/;\nconst ITEM_PRODUCT = /\\bproduct\\s*:\\s*([\"'`])([^\"'`]*)\\1/g;\n\n/** What one attribute of a buy component names: `product=\"…\"`, `product={\"…\"}` or each `items` entry's `product: \"…\"`. */\nfunction namedBy(attribute: AttributeNode): string[] {\n if (attribute.name === \"product\") {\n if (attribute.kind === \"quoted\" || attribute.kind === \"template-literal\") return [attribute.value];\n if (attribute.kind === \"expression\") return [STRING_LITERAL.exec(attribute.value)?.[2] ?? \"\"];\n }\n if (attribute.name === \"items\" && attribute.kind === \"expression\") {\n return [...attribute.value.matchAll(ITEM_PRODUCT)].map((match) => match[2] ?? \"\");\n }\n return [];\n}\n\nfunction componentProducts(node: Node, into: string[]): string[] {\n if (node.type === \"component\" && BUY_COMPONENTS.has(node.name)) {\n for (const attribute of node.attributes) into.push(...namedBy(attribute));\n }\n if (\"children\" in node) for (const child of node.children) componentProducts(child, into);\n return into;\n}\n\n/**\n * The products the page's `<ShopifyProduct>` and `<ShopifyBuyButton>` name, read\n * with Astro's own parser: only a component the template renders counts — never\n * one in a comment or in the frontmatter, such as the components' own examples.\n */\nfunction buyComponentProducts(file: { path: string; text: string }): string[] {\n if (!file.path.endsWith(\".astro\")) return [];\n try {\n return componentProducts(parse(file.text, undefined).ast, []);\n } catch {\n // A page the parser can't read names no product it can vouch for.\n return [];\n }\n}\n\n/** Whether a `<ShopifyProduct>` or `<ShopifyBuyButton>` on the page names the product. */\nfunction namesProduct(file: { path: string; text: string }, keys: ProductKeys): boolean {\n const wanted = new Set([keys.handle.toLowerCase(), ...(keys.productId ? [keys.productId] : [])].filter(Boolean));\n return buyComponentProducts(file).some((named) => wanted.has(named.trim().toLowerCase()));\n}\n\nfunction evidenceIn(file: { path: string; text: string }, keys: ProductKeys): LinkEvidence[] {\n const { text } = file;\n const evidence: LinkEvidence[] = [];\n if (keys.buyUrls.some((url) => url && text.includes(url))) evidence.push(\"buy_link\");\n const page = new RegExp(`/products/${escaped(keys.handle)}(?![A-Za-z0-9_-])`, \"i\");\n if (keys.handle && page.test(text)) evidence.push(\"product_page\");\n const option = keys.variantIds.some((id) =>\n new RegExp(`(?:/cart/(?:\\\\d+:\\\\d+,)*${id}:|variant=${id}(?!\\\\d))`).test(text),\n );\n if (option) evidence.push(\"variant_id\");\n if (namesProduct(file, keys)) evidence.push(\"buy_button\");\n return evidence;\n}\n\nexport function landingLinksOf(\n pages: readonly LandingPage[],\n keys: ProductKeys,\n): Array<{ slug: string; evidence: LinkEvidence[] }> {\n const bySlug = new Map<string, Set<LinkEvidence>>();\n for (const page of pages) {\n const found = new Set(page.files.flatMap((file) => evidenceIn(file, keys)));\n if (found.size === 0) continue;\n const slug = page.slug.replace(/--\\d+$/, \"\");\n const held = bySlug.get(slug) ?? new Set<LinkEvidence>();\n for (const evidence of found) held.add(evidence);\n bySlug.set(slug, held);\n }\n const order: LinkEvidence[] = [\"buy_link\", \"product_page\", \"variant_id\", \"buy_button\"];\n return [...bySlug].map(([slug, evidence]) => ({ slug, evidence: order.filter((entry) => evidence.has(entry)) }));\n}\n\nasync function isDir(target: string): Promise<boolean> {\n try {\n return (await stat(target)).isDirectory();\n } catch {\n return false;\n }\n}\n\n/** The workspace's pages with their source text, or null outside a workspace (no `src/pages`). */\nexport async function readWorkspacePages(root: string): Promise<{ pages: LandingPage[]; skipped: number } | null> {\n const dir = path.join(root, \"src/pages\");\n if (!(await isDir(dir))) return null;\n let entries: Dirent[];\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return null;\n }\n const slugs = entries\n .filter((entry) => entry.isDirectory() && !entry.name.startsWith(\"_\"))\n .map((entry) => entry.name);\n const pages: LandingPage[] = [];\n for (const slug of slugs.slice(0, PAGES_MAX)) {\n const files: Array<{ path: string; text: string }> = [];\n for (const file of await landingGraphFiles(root, slug)) {\n try {\n const absolute = path.join(root, file);\n if ((await stat(absolute)).size > FILE_BYTES_MAX) continue;\n files.push({ path: file, text: await readFile(absolute, \"utf8\") });\n } catch {\n // A file that went away mid-read says nothing about the product.\n }\n }\n pages.push({ slug, files });\n }\n return { pages, skipped: Math.max(0, slugs.length - PAGES_MAX) };\n}\n","import type { ShopifyPromotionsResponse } from \"@baker/api/shopify/promotions\";\n\n/**\n * The next steps `baker shopify promotions` hands the agent (S8). Pure over\n * the parsed answer. `stock-holds` answers in `stockHoldReport.ts`.\n */\n\nconst PLATFORM = { \"google-ads\": \"Google Ads\", meta: \"Meta\" } as const;\n\nfunction plural(count: number, one: string, many = `${one}s`): string {\n return `${count} ${count === 1 ? one : many}`;\n}\n\n/** The command that stages pausing one promoting ad, filled in from the answer. */\nfunction pauseCommand(ad: ShopifyPromotionsResponse[\"ads\"][number]): string {\n if (ad.platform === \"meta\") return `\\`baker ads meta ads pause ${ad.id ?? \"<id>\"}\\``;\n const target = `${ad.resource ?? \"<resource>\"} --customer-id ${ad.account_id ?? \"<account_id>\"}`;\n return ad.level === \"asset_group\"\n ? `\\`baker ads google asset-groups update ${target} --status PAUSED\\``\n : `\\`baker ads google ads pause ${target}\\``;\n}\n\n/** The active ads whose pause another chat's review already holds: staging them again opens a second review. */\nfunction waitingHints(answer: ShopifyPromotionsResponse): string[] {\n if (answer.product.stock === \"in_stock\") return [];\n return answer.ads.flatMap((ad) =>\n ad.status === \"active\" && ad.pause_waiting_in\n ? [\n `Pausing “${ad.name}” is already waiting for review in the chat “${ad.pause_waiting_in}”: stage nothing for it, and tell the user it is waiting there.`,\n ]\n : [],\n );\n}\n\n/** What to stage for a product out of stock that active ads still send people to. */\nfunction pauseHint(answer: ShopifyPromotionsResponse): string | null {\n if (answer.product.stock === \"in_stock\" || answer.ads.length === 0) return null;\n const active = answer.ads.filter((ad) => ad.status === \"active\" && !ad.pause_waiting_in);\n if (active.length === 0 && answer.ads.some((ad) => ad.status === \"active\")) return null;\n if (active.length === 0) {\n return `Every ad that sends people to “${answer.product.title}” is already paused: stage nothing for it. Tell the user this run paused nothing, and promise nothing about these ads coming back when it is back in stock.`;\n }\n const one = active.length === 1;\n return `${plural(active.length, \"active ad\")} still ${one ? \"sends\" : \"send\"} people to “${answer.product.title}”, which is out of stock. Stage pausing ${one ? \"it\" : \"them\"}: ${active.map(pauseCommand).join(\"; \")}. Each pause waits for the user to review and publish, and nothing turns it back on by itself.`;\n}\n\nexport function promotionHints(\n answer: ShopifyPromotionsResponse,\n scan: { scanned: boolean; skippedPages: number },\n): string[] {\n const hints: string[] = [];\n const pause = pauseHint(answer);\n if (pause) hints.push(pause);\n hints.push(...waitingHints(answer));\n if (answer.shopping.length > 0 || answer.catalog_ads > 0) {\n hints.push(\n \"Shopping campaigns and catalog ads stop showing a product nobody can buy by themselves — never pause them for one product.\",\n );\n }\n for (const missed of answer.checked.not_checked) {\n hints.push(\n `${PLATFORM[missed.platform as keyof typeof PLATFORM] ?? missed.platform} could not be checked (${missed.reason}); say so rather than that nothing runs there.`,\n );\n }\n for (const landing of answer.landings.filter((entry) => !entry.published)) {\n hints.push(`/${landing.slug} links to this product but is not live; no ad can send people to it yet.`);\n }\n if (answer.ads.length === 0 && answer.landings.length === 0 && answer.shopping.length === 0) {\n const nothing = `Nothing advertises “${answer.product.title}” that Baker can see`;\n hints.push(\n answer.product.stock === \"in_stock\"\n ? `${nothing}.`\n : `${nothing}: stage nothing for it. Tell the user this run paused nothing for it, and promise nothing about ads coming back when it is back in stock.`,\n );\n }\n if (!scan.scanned) {\n hints.push(\n \"This workspace's pages were not read (no src/pages here), so landings are from Baker's last scan and measured visits only.\",\n );\n } else if (scan.skippedPages > 0) {\n hints.push(`${plural(scan.skippedPages, \"page\")} not checked for links to this product (past the 300-page bound).`);\n }\n // Without an ad there is no pause to offer back, so there is nothing to warn about.\n if (!answer.remembered && answer.ads.length > 0) {\n hints.push(\n \"This read was made outside a Session (no chat): a pause staged from it will never be offered back for restarting when the product returns.\",\n );\n }\n return hints;\n}\n","import type { ClosedStockHold, ShopifyStockHoldsResponse, StockHold } from \"@baker/api/shopify/stockHolds\";\n\n/**\n * What `baker shopify stock-holds` answers (S8). A back-in-stock run relays\n * the read to the marketer, and runs copied whatever the read held — verdict\n * codes, \"resumable\", chat ids — however the brief asked for plain words. So\n * the compact answer is the plain words: a line per ad to tell, and the one\n * command per ad to stage. The codes stay behind `--full`. Pure over the\n * parsed answer.\n */\n\nconst PLATFORM = { \"google-ads\": \"Google Ads\", meta: \"Meta\" } as const;\n\nconst LEVEL: Record<StockHold[\"level\"], string> = {\n campaign: \"campaign\",\n ad_group: \"ad group\",\n ad: \"ad\",\n asset_group: \"asset group\",\n adset: \"ad set\",\n};\n\ntype Named = { platform: StockHold[\"platform\"]; level: StockHold[\"level\"]; name?: string; entity_id: string };\n\nfunction adName(ad: Named): string {\n return `${PLATFORM[ad.platform]} ${LEVEL[ad.level]} ${ad.name ? `“${ad.name}”` : ad.entity_id}`;\n}\n\nconst GOOGLE_GROUP: Record<StockHold[\"level\"], string> = {\n campaign: \"campaigns\",\n ad_group: \"ad-groups\",\n ad: \"ads\",\n asset_group: \"asset-groups\",\n adset: \"ads\",\n};\nconst META_GROUP: Record<StockHold[\"level\"], string> = {\n campaign: \"campaigns\",\n ad_group: \"adsets\",\n ad: \"ads\",\n asset_group: \"ads\",\n adset: \"adsets\",\n};\n\n/** The command that stages resuming one held ad. An asset group has no resume of its own: its status is updated. */\nfunction resumeCommand(hold: StockHold): string {\n if (hold.platform === \"meta\") return `baker ads meta ${META_GROUP[hold.level]} resume ${hold.entity_id}`;\n const target = `${hold.entity_id} --customer-id ${hold.account_id}`;\n return hold.level === \"asset_group\"\n ? `baker ads google asset-groups update ${target} --status ENABLED`\n : `baker ads google ${GOOGLE_GROUP[hold.level]} resume ${target}`;\n}\n\nfunction quoted(title: string | undefined, fallback: string): string {\n return title ? `“${title}”` : fallback;\n}\n\n/** The sentence for one held ad, as the marketer reads it. */\nfunction heldLine(hold: StockHold): string | null {\n const name = adName(hold);\n const product = quoted(hold.product.title, \"the product\");\n switch (hold.verdict) {\n case \"resumable\":\n return `Ready to turn back on when you publish: ${name} — Baker paused it because ${product} ran out.`;\n case \"still_out_of_stock\":\n return `Stays paused: ${name} — ${product} still cannot be bought.`;\n case \"changed_since\":\n return `Left as it is: ${name} — someone changed it after Baker paused it when ${product} ran out, so check it yourself.`;\n case \"still_promotes_out_of_stock\":\n return `Stays paused: ${name} — it also sends people to ${quoted(hold.verdict_detail, \"another product\")}, which is still out of stock.`;\n case \"cannot_confirm\":\n return `Left as it is: ${name} — Baker cannot tell whether someone changed it after pausing it when ${product} ran out, so check it before turning it back on.`;\n case \"already_active\":\n return `Nothing to do: ${name} is already running again.`;\n default:\n return null;\n }\n}\n\nconst CLOSED_HOW: Record<ClosedStockHold[\"resolved_reason\"], string> = {\n resumed_by_back_in_stock_run: \"turned back on by an earlier back-in-stock run\",\n changed_by_baker: \"turned back on by other work published in Baker\",\n already_active: \"found running again, turned back on by someone\",\n removed: \"removed\",\n product_removed: \"let go when the product left the store\",\n};\n\nfunction plural(count: number, one: string): string {\n return `${count} ${count === 1 ? one : `${one}s`}`;\n}\n\n/**\n * Why nothing is held, without ever saying nothing was paused when something\n * was, or whether an ad is running: the read knows Baker's pauses, not the ad's\n * state now. A pause still waiting for review is the latest word on the product.\n */\nfunction nothingHeldLines(answer: ShopifyStockHoldsResponse, asked: { product: boolean }, product: string): string[] {\n if (!asked.product) {\n return answer.holds.length > 0\n ? [\"None of these is still paused because its product ran out, so there is nothing to turn back on.\"]\n : [\"Baker has no ad paused because a product ran out, so there is nothing to turn back on.\"];\n }\n if (answer.pending_sessions.length > 0) {\n return [\n `Baker's pause for ${product} is still waiting for your review and was never published, so there is nothing to turn back on.`,\n ];\n }\n if (answer.recently_closed.length > 0) {\n return answer.recently_closed.map(\n (hold) =>\n `Already handled: Baker paused ${adName(hold)} when ${product} ran out, and it was later ${CLOSED_HOW[hold.resolved_reason]}.`,\n );\n }\n return [`Baker has nothing paused because ${product} ran out, so there is nothing to turn back on.`];\n}\n\nexport interface StockHoldsCompact {\n /** Sentences written for the marketer, in the order to tell them. */\n tell_user: string[];\n /** The one change to stage per ad Baker may turn back on now. */\n resume: Array<{ ad: string; command: string }>;\n /** Landings the out-of-stock run changed, and the read of those page changes alone. */\n pages?: Array<{ pages: string[]; read: string }>;\n}\n\nexport function stockHoldReport(\n answer: ShopifyStockHoldsResponse,\n asked: { product: boolean; full: boolean },\n): { data: StockHoldsCompact | (StockHoldsCompact & Omit<ShopifyStockHoldsResponse, \"store\">); hints: string[] } {\n const product = quoted(answer.product?.title, \"the product that came back\");\n const held = answer.holds.filter((hold) => hold.state === \"held\");\n const tell_user = [\n ...(held.length === 0 ? nothingHeldLines(answer, asked, product) : []),\n ...held.flatMap((hold) => heldLine(hold) ?? []),\n ...answer.not_paused.map((ad) => `Left as it is: ${adName(ad)} — Baker did not pause it when ${product} ran out.`),\n ...answer.pending_sessions.map(\n (pending) =>\n `Discard the work waiting for your review, “${pending.title}”: it would pause ${plural(pending.staged_pauses, \"ad\")} for ${product}, which can be bought again.`,\n ),\n ];\n const resume = held\n .filter((hold) => hold.verdict === \"resumable\")\n .map((hold) => ({ ad: adName(hold), command: resumeCommand(hold) }));\n const pages = answer.pages_changed.map((run) => ({\n pages: run.pages.map((slug) => `/${slug}`),\n read: `baker chats diff ${run.chat_id} --surface landings --full`,\n }));\n const hints = [\n resume.length > 0\n ? \"Stage each `resume` command, and nothing else.\"\n : `Stage nothing${asked.product ? ` for ${product}` : \"\"}.`,\n \"Tell the user the `tell_user` lines as they are written, and nothing about any other ad: an ad this read does not name is not this run's to explain.\",\n ...pages.map(\n (run) =>\n `The out-of-stock run also changed ${run.pages.join(\", \")}: read those changes with its \\`read\\` command, and put back only what it changed for ${product}.`,\n ),\n ];\n const compact: StockHoldsCompact = { tell_user, resume, ...(pages.length > 0 ? { pages } : {}) };\n if (!asked.full) return { data: compact, hints };\n const { store: _store, ...everything } = answer;\n return { data: { ...compact, ...everything }, hints };\n}\n","import { shopifySignupOffersResponseSchema } from \"@baker/api/shopify/signups\";\nimport { defineCommand } from \"citty\";\nimport { apiGet } from \"../../client.ts\";\nimport { optionalChatId } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { fail, params } from \"./common.ts\";\n\nconst description =\n \"Start here for landing sign-ups: published and this chat's staged offers, codes given and store permissions. Example: baker shopify signup-offers. Forms name an offer handle; terms are staged with baker shopify change signup-offer set.\";\nregisterSchema({ command: \"shopify.signupOffers\", description, args: {} });\nexport const signupOffersCommand = defineCommand({\n meta: { name: \"signup-offers\", description },\n async run() {\n try {\n const data = shopifySignupOffersResponseSchema.parse(\n await apiGet<unknown>(\"/api/shopify/signup-offers\", params({ chatId: optionalChatId() })),\n );\n const hints: string[] = [];\n if (!data.canAddCustomers)\n hints.push(\n 'Sign-ups cannot be added to the store yet: call request_connection with { platform: \"shopify\", reason: \"Add sign-ups from your landing\" }. Keep building the page; the Form works once allowed.',\n );\n if (!data.canGiveCodes)\n hints.push(\n \"Codes need the store to allow discounts: use request_connection for Shopify and keep building the page.\",\n );\n if (data.offers.some((offer) => offer.status === \"ended\"))\n hints.push(\n \"Forms naming ended offers still add customers but give no code: stage a new offer or remove offer from the Form.\",\n );\n if (data.offers.length === 0)\n hints.push(\n \"No sign-up offer exists yet. Omit offer for sign-ups without a code, or stage one after the user approves its terms.\",\n );\n writeJson({ ok: true, hints, data });\n } catch (error) {\n fail(error);\n }\n },\n});\n","import type { TrackingAuditResponse } from \"@baker/api/shopify/tracking\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { fail } from \"./common.ts\";\nimport { leaf } from \"./writeCommon.ts\";\nimport { auditHints } from \"./writeHints.ts\";\n\n/** `baker shopify tracking audit` — whether the store is measured the way Baker needs. Sends nothing to the store. */\n\nconst audit = leaf(\n \"shopify.tracking.audit\",\n {\n name: \"audit\",\n description:\n \"Start here for 'is our store's tracking set up right?': Baker's measurement on the store, Baker switched on in the theme, whether orders carry Baker's visitor, who reports sales to Meta and Google, shoppers' consent, and whether the store sells through its own website. Each check is ok, problem (with its fix: a change to stage, a task for the merchant, or a decision) or unknown (with why). Reads only — it changes nothing.\",\n },\n { full: { type: \"boolean\", description: \"Add the facts behind each check\", required: false } },\n async (args) => {\n try {\n const data = await apiPost<TrackingAuditResponse>(\"/api/shopify/tracking/audit\", { full: args.full === true });\n writeJson({ ok: true, hints: auditHints(data), data });\n } catch (err) {\n fail(err);\n }\n },\n);\n\nexport const trackingCommand = defineCommand({\n meta: { name: \"tracking\", description: \"Check how the store is measured: baker shopify tracking audit\" },\n subCommands: { audit },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,SAAS,iBAAAA,uBAAqB;;;ACM9B,SAAS,SAAS;AAGX,IAAM,4BAA4B,CAAC,QAAQ,SAAS,WAAW,OAAO,YAAY,KAAK;AACvF,IAAM,+BAA+B,EAAE,KAAK,yBAAyB;AAYrE,IAAM,gCAAgC,EAAE,KAAK,CAAC,QAAQ,QAAQ,CAAC;AAG/D,IAAM,kCAAqF;AAAA,EAChG,MAAM;AAAA,EACN,QAAQ;AACV;AAQO,IAAM,+BAA+B,EAAE,KAAK,CAAC,sBAAsB,CAAC;AAIpE,IAAM,+BAA+B,EAAE,KAAK,CAAC,SAAS,KAAK,CAAC;AAInE,IAAM,kBAAkB,EACrB,OAAO,EACP,KAAK,EACL,MAAM,sCAAsC,u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AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EA0Cf;AAAA,EACA,aAAa;AAAA,IACX,iBAAiB;AAAA,IACjB,OAAO;AAAA,IACP,UAAU;AAAA,IACV,SAAS;AAAA,IACT,aAAa;AAAA,IACb,OAAO;AAAA,IACP,OAAO;AAAA,IACP,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,WAAW;AAAA,IACX,gBAAgB;AAAA,IAChB,SAAS;AAAA,IACT,UAAU;AAAA,IACV,WAAW;AAAA,IACX,YAAY;AAAA,IACZ,eAAe;AAAA,IACf,QAAQ;AAAA,IACR,OAAO;AAAA,IACP,SAAS;AAAA,IACT,MAAM;AAAA,IACN,UAAU;AAAA,IACV,SAAS;AAAA,EACX;AACF,CAAC;","names":["defineCommand","defineCommand","z","flag","z","z","flag","z","z","z","z","z","z","z","z","path","args","defineCommand","args","defineCommand","limit","defineCommand","args","z","defineCommand","args","defineCommand","args","defineCommand","args","target","payload","description","defineCommand","args","defineCommand","args","list","defineCommand","defineCommand","target","target","PLATFORM","target","plural","defineCommand","args","positionals","defineCommand","description","defineCommand","defineCommand","audit","args","defineCommand","defineCommand","args","positionals","limit"]}
|