@koda-sl/baker-cli 0.386.0-dev.8b1f99042 → 0.386.0-dev.d6e55699d
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 +1091 -211
- package/canvas/tiktok-captions-composition/index.html +5 -6
- package/canvas/tiktok-captions-composition/meta.json +5 -0
- package/dist/account-5TGX45FO.js +79 -0
- package/dist/account-5TGX45FO.js.map +1 -0
- package/dist/account-CLOKMTTC.js +49 -0
- package/dist/account-CLOKMTTC.js.map +1 -0
- package/dist/account-XFK6VX2R.js +80 -0
- package/dist/account-XFK6VX2R.js.map +1 -0
- package/dist/account-reads-ZK5RMLB2.js +218 -0
- package/dist/account-reads-ZK5RMLB2.js.map +1 -0
- package/dist/account-writes-Y7EQXDXF.js +66 -0
- package/dist/account-writes-Y7EQXDXF.js.map +1 -0
- package/dist/accounts-7YD457YN.js +114 -0
- package/dist/accounts-7YD457YN.js.map +1 -0
- package/dist/accounts-BJ3X5JQT.js +115 -0
- package/dist/accounts-BJ3X5JQT.js.map +1 -0
- package/dist/accounts-HGAFFOA7.js +77 -0
- package/dist/accounts-HGAFFOA7.js.map +1 -0
- package/dist/accounts-OWMXUT6D.js +611 -0
- package/dist/accounts-OWMXUT6D.js.map +1 -0
- package/dist/accounts-RYBDLQ6H.js +75 -0
- package/dist/accounts-RYBDLQ6H.js.map +1 -0
- package/dist/actions-NSQYW7YS.js +55 -0
- package/dist/actions-NSQYW7YS.js.map +1 -0
- package/dist/active-entities-R6GZIO6Z.js +103 -0
- package/dist/active-entities-R6GZIO6Z.js.map +1 -0
- package/dist/activities-ESBF3GFS.js +74 -0
- package/dist/activities-ESBF3GFS.js.map +1 -0
- package/dist/ad-group-writes-I225OYDZ.js +170 -0
- package/dist/ad-group-writes-I225OYDZ.js.map +1 -0
- package/dist/ad-groups-O35MWNF6.js +68 -0
- package/dist/ad-groups-O35MWNF6.js.map +1 -0
- package/dist/ad-writes-SS5YZO5W.js +174 -0
- package/dist/ad-writes-SS5YZO5W.js.map +1 -0
- package/dist/add-HWIE5PGR.js +302 -0
- package/dist/add-HWIE5PGR.js.map +1 -0
- package/dist/add-IIW3NHZH.js +104 -0
- package/dist/add-IIW3NHZH.js.map +1 -0
- package/dist/add-QZHAWUBA.js +97 -0
- package/dist/add-QZHAWUBA.js.map +1 -0
- package/dist/add-TGQIVVXH.js +105 -0
- package/dist/add-TGQIVVXH.js.map +1 -0
- package/dist/add-accounts-6QYPOPR2.js +91 -0
- package/dist/add-accounts-6QYPOPR2.js.map +1 -0
- package/dist/ads-AUSRB4GU.js +128 -0
- package/dist/ads-AUSRB4GU.js.map +1 -0
- package/dist/ads-COYOTEKE.js +77 -0
- package/dist/ads-COYOTEKE.js.map +1 -0
- package/dist/ads-D6KKCQ3Q.js +40 -0
- package/dist/ads-D6KKCQ3Q.js.map +1 -0
- package/dist/ads-QKIHHXP5.js +113 -0
- package/dist/ads-QKIHHXP5.js.map +1 -0
- package/dist/adsets-7WMWU45E.js +176 -0
- package/dist/adsets-7WMWU45E.js.map +1 -0
- package/dist/advertisers-6NZ2M57X.js +120 -0
- package/dist/advertisers-6NZ2M57X.js.map +1 -0
- package/dist/advertisers-BCGKUMEH.js +125 -0
- package/dist/advertisers-BCGKUMEH.js.map +1 -0
- package/dist/analytics-QJC2BTZY.js +433 -0
- package/dist/analytics-QJC2BTZY.js.map +1 -0
- package/dist/analytics-SN6K7J7M.js +1980 -0
- package/dist/analytics-SN6K7J7M.js.map +1 -0
- package/dist/animate-JXIT77Y5.js +480 -0
- package/dist/animate-JXIT77Y5.js.map +1 -0
- package/dist/assign-XFDA42KL.js +77 -0
- package/dist/assign-XFDA42KL.js.map +1 -0
- package/dist/audience-size-DJPFYHPJ.js +94 -0
- package/dist/audience-size-DJPFYHPJ.js.map +1 -0
- package/dist/audiences-DC3IOG34.js +85 -0
- package/dist/audiences-DC3IOG34.js.map +1 -0
- package/dist/audiences-NEW3LLQR.js +268 -0
- package/dist/audiences-NEW3LLQR.js.map +1 -0
- package/dist/audiences-VXTIBZP6.js +78 -0
- package/dist/audiences-VXTIBZP6.js.map +1 -0
- package/dist/audit-M5B7TZGT.js +151 -0
- package/dist/audit-M5B7TZGT.js.map +1 -0
- package/dist/audit-UIPMTI5C.js +88 -0
- package/dist/audit-UIPMTI5C.js.map +1 -0
- package/dist/autocomplete-NWHEASQY.js +111 -0
- package/dist/autocomplete-NWHEASQY.js.map +1 -0
- package/dist/avatars-RNMUVMFM.js +38 -0
- package/dist/avatars-RNMUVMFM.js.map +1 -0
- package/dist/bid-pricing-EAY3HAHY.js +99 -0
- package/dist/bid-pricing-EAY3HAHY.js.map +1 -0
- package/dist/brand-XBHWYPMT.js +22 -0
- package/dist/brand-XBHWYPMT.js.map +1 -0
- package/dist/brief-XBAAPKRR.js +492 -0
- package/dist/brief-XBAAPKRR.js.map +1 -0
- package/dist/businesses-J7OP7MSK.js +53 -0
- package/dist/businesses-J7OP7MSK.js.map +1 -0
- package/dist/campaign-groups-7KA2RA5V.js +95 -0
- package/dist/campaign-groups-7KA2RA5V.js.map +1 -0
- package/dist/campaign-writes-5XA727KI.js +170 -0
- package/dist/campaign-writes-5XA727KI.js.map +1 -0
- package/dist/campaign-writes-D2UID2I6.js +165 -0
- package/dist/campaign-writes-D2UID2I6.js.map +1 -0
- package/dist/campaigns-JPYNVFQI.js +76 -0
- package/dist/campaigns-JPYNVFQI.js.map +1 -0
- package/dist/campaigns-NJ3KOPJS.js +107 -0
- package/dist/campaigns-NJ3KOPJS.js.map +1 -0
- package/dist/campaigns-QUTTH2TB.js +110 -0
- package/dist/campaigns-QUTTH2TB.js.map +1 -0
- package/dist/campaigns-SOO5RHYG.js +109 -0
- package/dist/campaigns-SOO5RHYG.js.map +1 -0
- package/dist/canvas-3VZ46BCF.js +46 -0
- package/dist/canvas-3VZ46BCF.js.map +1 -0
- package/dist/capabilities-KAYDPH7E.js +144 -0
- package/dist/capabilities-KAYDPH7E.js.map +1 -0
- package/dist/cards-7H32TNMO.js +85 -0
- package/dist/cards-7H32TNMO.js.map +1 -0
- package/dist/catalog-OTICZPJA.js +64 -0
- package/dist/catalog-OTICZPJA.js.map +1 -0
- package/dist/catalogs-ABCQLCDU.js +128 -0
- package/dist/catalogs-ABCQLCDU.js.map +1 -0
- package/dist/changes-22EO52IY.js +135 -0
- package/dist/changes-22EO52IY.js.map +1 -0
- package/dist/chatgpt-B3NHRJUE.js +47 -0
- package/dist/chatgpt-B3NHRJUE.js.map +1 -0
- package/dist/chats-QG3IRHOD.js +262 -0
- package/dist/chats-QG3IRHOD.js.map +1 -0
- package/dist/chunk-2CV7LX23.js +474 -0
- package/dist/chunk-2CV7LX23.js.map +1 -0
- package/dist/chunk-2SQJL7ZN.js +56 -0
- package/dist/chunk-2SQJL7ZN.js.map +1 -0
- package/dist/chunk-2Y5V23PU.js +29 -0
- package/dist/chunk-2Y5V23PU.js.map +1 -0
- package/dist/chunk-32CPGJPL.js +149 -0
- package/dist/chunk-32CPGJPL.js.map +1 -0
- package/dist/chunk-32PSERWG.js +363 -0
- package/dist/chunk-32PSERWG.js.map +1 -0
- package/dist/chunk-3ACMDRSE.js +39 -0
- package/dist/chunk-3ACMDRSE.js.map +1 -0
- package/dist/chunk-3UDSYYND.js +42 -0
- package/dist/chunk-3UDSYYND.js.map +1 -0
- package/dist/chunk-3V5E5SVE.js +382 -0
- package/dist/chunk-3V5E5SVE.js.map +1 -0
- package/dist/chunk-455BTAHM.js +57 -0
- package/dist/chunk-455BTAHM.js.map +1 -0
- package/dist/chunk-4MH6LONO.js +274 -0
- package/dist/chunk-4MH6LONO.js.map +1 -0
- package/dist/chunk-4NZ47VXO.js +137 -0
- package/dist/chunk-4NZ47VXO.js.map +1 -0
- package/dist/chunk-4OBO75XU.js +275 -0
- package/dist/chunk-4OBO75XU.js.map +1 -0
- package/dist/chunk-5HYSKH77.js +315 -0
- package/dist/chunk-5HYSKH77.js.map +1 -0
- package/dist/chunk-5MBPIONY.js +29 -0
- package/dist/chunk-5MBPIONY.js.map +1 -0
- package/dist/chunk-5OVOLYY3.js +74 -0
- package/dist/chunk-5OVOLYY3.js.map +1 -0
- package/dist/chunk-66USKCVY.js +4410 -0
- package/dist/chunk-66USKCVY.js.map +1 -0
- package/dist/chunk-6I7SYEYN.js +166 -0
- package/dist/chunk-6I7SYEYN.js.map +1 -0
- package/dist/chunk-6O7ISBC7.js +65 -0
- package/dist/chunk-6O7ISBC7.js.map +1 -0
- package/dist/chunk-752S7JF6.js +35 -0
- package/dist/chunk-752S7JF6.js.map +1 -0
- package/dist/chunk-AFJGYJ7Z.js +45 -0
- package/dist/chunk-AFJGYJ7Z.js.map +1 -0
- package/dist/chunk-AR7PU7BB.js +76 -0
- package/dist/chunk-AR7PU7BB.js.map +1 -0
- package/dist/chunk-ASL7JFBD.js +96 -0
- package/dist/chunk-ASL7JFBD.js.map +1 -0
- package/dist/chunk-AUCITRRT.js +310 -0
- package/dist/chunk-AUCITRRT.js.map +1 -0
- package/dist/chunk-AUSKKFVH.js +84 -0
- package/dist/chunk-AUSKKFVH.js.map +1 -0
- package/dist/chunk-BEGARAVC.js +174 -0
- package/dist/chunk-BEGARAVC.js.map +1 -0
- package/dist/{chunk-XHC4LMK4.js → chunk-BVM5IRZW.js} +16 -8
- package/dist/chunk-BVM5IRZW.js.map +1 -0
- package/dist/chunk-CAMX6OHF.js +3182 -0
- package/dist/chunk-CAMX6OHF.js.map +1 -0
- package/dist/chunk-CKI3RLMU.js +159 -0
- package/dist/chunk-CKI3RLMU.js.map +1 -0
- package/dist/chunk-CZENWCBS.js +333 -0
- package/dist/chunk-CZENWCBS.js.map +1 -0
- package/dist/chunk-D5FY4FAK.js +24 -0
- package/dist/chunk-D5FY4FAK.js.map +1 -0
- package/dist/chunk-DGCUPJZD.js +39 -0
- package/dist/chunk-DGCUPJZD.js.map +1 -0
- package/dist/chunk-DIICZGIS.js +509 -0
- package/dist/chunk-DIICZGIS.js.map +1 -0
- package/dist/chunk-DNCLWSHO.js +41 -0
- package/dist/chunk-DNCLWSHO.js.map +1 -0
- package/dist/chunk-DX4GIDO7.js +296 -0
- package/dist/chunk-DX4GIDO7.js.map +1 -0
- package/dist/chunk-DYZJBWT2.js +1079 -0
- package/dist/chunk-DYZJBWT2.js.map +1 -0
- package/dist/chunk-EDLZGTGN.js +216 -0
- package/dist/chunk-EDLZGTGN.js.map +1 -0
- package/dist/chunk-EDNX3AOS.js +76 -0
- package/dist/chunk-EDNX3AOS.js.map +1 -0
- package/dist/chunk-EF5DP6EB.js +52 -0
- package/dist/chunk-EF5DP6EB.js.map +1 -0
- package/dist/chunk-EQEZAYPL.js +541 -0
- package/dist/chunk-EQEZAYPL.js.map +1 -0
- package/dist/chunk-ERSX3MKH.js +34 -0
- package/dist/chunk-ERSX3MKH.js.map +1 -0
- package/dist/chunk-FKOECEVC.js +126 -0
- package/dist/chunk-FKOECEVC.js.map +1 -0
- package/dist/chunk-FYWWTMXP.js +2902 -0
- package/dist/chunk-FYWWTMXP.js.map +1 -0
- package/dist/chunk-G7AFVTUS.js +106 -0
- package/dist/chunk-G7AFVTUS.js.map +1 -0
- package/dist/chunk-GIW7ABMM.js +74 -0
- package/dist/chunk-GIW7ABMM.js.map +1 -0
- package/dist/chunk-GIWHHCD6.js +145 -0
- package/dist/chunk-GIWHHCD6.js.map +1 -0
- package/dist/chunk-GOJXKIFQ.js +1605 -0
- package/dist/chunk-GOJXKIFQ.js.map +1 -0
- package/dist/chunk-GPXIUYIA.js +592 -0
- package/dist/chunk-GPXIUYIA.js.map +1 -0
- package/dist/chunk-GRQ2AXDX.js +9 -0
- package/dist/chunk-GRQ2AXDX.js.map +1 -0
- package/dist/chunk-GXDLWBOY.js +73 -0
- package/dist/chunk-GXDLWBOY.js.map +1 -0
- package/dist/chunk-H7MLHG2I.js +94 -0
- package/dist/chunk-H7MLHG2I.js.map +1 -0
- package/dist/chunk-HAE4WWFQ.js +455 -0
- package/dist/chunk-HAE4WWFQ.js.map +1 -0
- package/dist/chunk-HB3LNR4Y.js +197 -0
- package/dist/chunk-HB3LNR4Y.js.map +1 -0
- package/dist/chunk-HDHWIEJJ.js +136 -0
- package/dist/chunk-HDHWIEJJ.js.map +1 -0
- package/dist/chunk-HJTIBTF7.js +98 -0
- package/dist/chunk-HJTIBTF7.js.map +1 -0
- package/dist/{chunk-VZEDAFAR.js → chunk-HLXWKMTK.js} +47 -8
- package/dist/chunk-HLXWKMTK.js.map +1 -0
- package/dist/{chunk-MF7YA62W.js → chunk-HREWXNTO.js} +10 -5
- package/dist/chunk-HREWXNTO.js.map +1 -0
- package/dist/chunk-HVJUMQYY.js +494 -0
- package/dist/chunk-HVJUMQYY.js.map +1 -0
- package/dist/chunk-I3DIZWN5.js +97 -0
- package/dist/chunk-I3DIZWN5.js.map +1 -0
- package/dist/chunk-IJMWEO4P.js +57 -0
- package/dist/chunk-IJMWEO4P.js.map +1 -0
- package/dist/chunk-IMORFIUT.js +207 -0
- package/dist/chunk-IMORFIUT.js.map +1 -0
- package/dist/chunk-IOCSDFF2.js +23992 -0
- package/dist/chunk-IOCSDFF2.js.map +1 -0
- package/dist/chunk-IRTYTT5D.js +665 -0
- package/dist/chunk-IRTYTT5D.js.map +1 -0
- package/dist/chunk-IVIJJXXT.js +62 -0
- package/dist/chunk-IVIJJXXT.js.map +1 -0
- package/dist/chunk-J57GWTPK.js +106 -0
- package/dist/chunk-J57GWTPK.js.map +1 -0
- package/dist/chunk-JAYT43KX.js +4227 -0
- package/dist/chunk-JAYT43KX.js.map +1 -0
- package/dist/chunk-JPK34QPS.js +134 -0
- package/dist/chunk-JPK34QPS.js.map +1 -0
- package/dist/chunk-JRCFCIE3.js +188 -0
- package/dist/chunk-JRCFCIE3.js.map +1 -0
- package/dist/chunk-JRGPCPT2.js +479 -0
- package/dist/chunk-JRGPCPT2.js.map +1 -0
- package/dist/chunk-JUAIGJ2A.js +76 -0
- package/dist/chunk-JUAIGJ2A.js.map +1 -0
- package/dist/chunk-K2RYUZ5Y.js +51 -0
- package/dist/chunk-K2RYUZ5Y.js.map +1 -0
- package/dist/chunk-K5OQES4V.js +58 -0
- package/dist/chunk-K5OQES4V.js.map +1 -0
- package/dist/chunk-KAHMADFH.js +455 -0
- package/dist/chunk-KAHMADFH.js.map +1 -0
- package/dist/chunk-KIGGMKAE.js +66 -0
- package/dist/chunk-KIGGMKAE.js.map +1 -0
- package/dist/chunk-KKJ4KJCW.js +29 -0
- package/dist/chunk-KKJ4KJCW.js.map +1 -0
- package/dist/chunk-KLK6KQLQ.js +55 -0
- package/dist/chunk-KLK6KQLQ.js.map +1 -0
- package/dist/chunk-KRIK2JR4.js +6212 -0
- package/dist/chunk-KRIK2JR4.js.map +1 -0
- package/dist/chunk-KZUHRZ2C.js +5187 -0
- package/dist/chunk-KZUHRZ2C.js.map +1 -0
- package/dist/chunk-L5WIRYNB.js +19 -0
- package/dist/chunk-L5WIRYNB.js.map +1 -0
- package/dist/chunk-LA6PPSNA.js +65 -0
- package/dist/chunk-LA6PPSNA.js.map +1 -0
- package/dist/chunk-LEIQAHWF.js +25 -0
- package/dist/chunk-LEIQAHWF.js.map +1 -0
- package/dist/chunk-LWBWCIWL.js +297 -0
- package/dist/chunk-LWBWCIWL.js.map +1 -0
- package/dist/chunk-M4PPFVYL.js +346 -0
- package/dist/chunk-M4PPFVYL.js.map +1 -0
- package/dist/chunk-M6UNISGO.js +66 -0
- package/dist/chunk-M6UNISGO.js.map +1 -0
- package/dist/chunk-MGKHFGLV.js +75 -0
- package/dist/chunk-MGKHFGLV.js.map +1 -0
- package/dist/chunk-MUVSWFLL.js +111 -0
- package/dist/chunk-MUVSWFLL.js.map +1 -0
- package/dist/chunk-NFSLRRIE.js +77 -0
- package/dist/chunk-NFSLRRIE.js.map +1 -0
- package/dist/chunk-NHU33T2S.js +60 -0
- package/dist/chunk-NHU33T2S.js.map +1 -0
- package/dist/chunk-O6QKCJE4.js +455 -0
- package/dist/chunk-O6QKCJE4.js.map +1 -0
- package/dist/chunk-OBNWER4H.js +1599 -0
- package/dist/chunk-OBNWER4H.js.map +1 -0
- package/dist/chunk-OFFAMC5H.js +225 -0
- package/dist/chunk-OFFAMC5H.js.map +1 -0
- package/dist/chunk-P4NSJS54.js +20 -0
- package/dist/chunk-P4NSJS54.js.map +1 -0
- package/dist/chunk-P5T7OZKV.js +26 -0
- package/dist/chunk-P5T7OZKV.js.map +1 -0
- package/dist/chunk-PAHLJMC3.js +175 -0
- package/dist/chunk-PAHLJMC3.js.map +1 -0
- package/dist/chunk-PBVLPFJ6.js +169 -0
- package/dist/chunk-PBVLPFJ6.js.map +1 -0
- package/dist/chunk-PFBQERWX.js +10 -0
- package/dist/chunk-PFBQERWX.js.map +1 -0
- package/dist/chunk-Q6ULQMWG.js +41 -0
- package/dist/chunk-Q6ULQMWG.js.map +1 -0
- package/dist/chunk-QKE7GXZ7.js +6683 -0
- package/dist/chunk-QKE7GXZ7.js.map +1 -0
- package/dist/chunk-QL573PLH.js +150 -0
- package/dist/chunk-QL573PLH.js.map +1 -0
- package/dist/chunk-QO23YHLK.js +84 -0
- package/dist/chunk-QO23YHLK.js.map +1 -0
- package/dist/chunk-R5OQM7FF.js +179 -0
- package/dist/chunk-R5OQM7FF.js.map +1 -0
- package/dist/chunk-RDLB54KF.js +629 -0
- package/dist/chunk-RDLB54KF.js.map +1 -0
- package/dist/chunk-RGIXQEGJ.js +502 -0
- package/dist/chunk-RGIXQEGJ.js.map +1 -0
- package/dist/chunk-RRIAHUWP.js +304 -0
- package/dist/chunk-RRIAHUWP.js.map +1 -0
- package/dist/chunk-S4LZ7KTG.js +160 -0
- package/dist/chunk-S4LZ7KTG.js.map +1 -0
- package/dist/chunk-SHTESUB6.js +1442 -0
- package/dist/chunk-SHTESUB6.js.map +1 -0
- package/dist/chunk-SLB46MSS.js +64 -0
- package/dist/chunk-SLB46MSS.js.map +1 -0
- package/dist/chunk-T7M4WFNV.js +172 -0
- package/dist/chunk-T7M4WFNV.js.map +1 -0
- package/dist/{chunk-VLUGGVJL.js → chunk-TPXI2GCW.js} +12 -4
- package/dist/chunk-TPXI2GCW.js.map +1 -0
- package/dist/chunk-TWNFQUBS.js +23 -0
- package/dist/chunk-TWNFQUBS.js.map +1 -0
- package/dist/chunk-U6VRBDNQ.js +1830 -0
- package/dist/chunk-U6VRBDNQ.js.map +1 -0
- package/dist/chunk-U7BBXM67.js +1743 -0
- package/dist/chunk-U7BBXM67.js.map +1 -0
- package/dist/chunk-UI6BKYQD.js +225 -0
- package/dist/chunk-UI6BKYQD.js.map +1 -0
- package/dist/chunk-USL5ARRE.js +26 -0
- package/dist/chunk-USL5ARRE.js.map +1 -0
- package/dist/chunk-UYC45JNS.js +139 -0
- package/dist/chunk-UYC45JNS.js.map +1 -0
- package/dist/chunk-V5GSRREZ.js +846 -0
- package/dist/chunk-V5GSRREZ.js.map +1 -0
- package/dist/chunk-V5HDRJQW.js +337 -0
- package/dist/chunk-V5HDRJQW.js.map +1 -0
- package/dist/chunk-VS4C7VAR.js +533 -0
- package/dist/chunk-VS4C7VAR.js.map +1 -0
- package/dist/chunk-W4W4ZRBP.js +191 -0
- package/dist/chunk-W4W4ZRBP.js.map +1 -0
- package/dist/chunk-WIRBRCTJ.js +228 -0
- package/dist/chunk-WIRBRCTJ.js.map +1 -0
- package/dist/chunk-WN4KX7GE.js +25 -0
- package/dist/chunk-WN4KX7GE.js.map +1 -0
- package/dist/chunk-WNFTXSGR.js +111 -0
- package/dist/chunk-WNFTXSGR.js.map +1 -0
- package/dist/chunk-WOTDHRNF.js +2109 -0
- package/dist/chunk-WOTDHRNF.js.map +1 -0
- package/dist/chunk-WPKOEFOE.js +103 -0
- package/dist/chunk-WPKOEFOE.js.map +1 -0
- package/dist/chunk-XE3WS3QE.js +183 -0
- package/dist/chunk-XE3WS3QE.js.map +1 -0
- package/dist/chunk-XGWKTYXQ.js +67 -0
- package/dist/chunk-XGWKTYXQ.js.map +1 -0
- package/dist/chunk-XIGIJJSF.js +66 -0
- package/dist/chunk-XIGIJJSF.js.map +1 -0
- package/dist/chunk-XNUXB63I.js +817 -0
- package/dist/chunk-XNUXB63I.js.map +1 -0
- package/dist/chunk-XQ3CCNJD.js +610 -0
- package/dist/chunk-XQ3CCNJD.js.map +1 -0
- package/dist/chunk-Y362QH54.js +98 -0
- package/dist/chunk-Y362QH54.js.map +1 -0
- package/dist/chunk-Y4HZNSBN.js +3151 -0
- package/dist/chunk-Y4HZNSBN.js.map +1 -0
- package/dist/chunk-Y4T6ATDQ.js +74 -0
- package/dist/chunk-Y4T6ATDQ.js.map +1 -0
- package/dist/chunk-YIMGUMXX.js +206 -0
- package/dist/chunk-YIMGUMXX.js.map +1 -0
- package/dist/chunk-YQSBHWOI.js +41 -0
- package/dist/chunk-YU26SDNT.js +46 -0
- package/dist/chunk-YU26SDNT.js.map +1 -0
- package/dist/chunk-YULENNA7.js +501 -0
- package/dist/chunk-YULENNA7.js.map +1 -0
- package/dist/chunk-YYSZYSAG.js +150 -0
- package/dist/chunk-YYSZYSAG.js.map +1 -0
- package/dist/chunk-Z3ENMCFE.js +94 -0
- package/dist/chunk-Z3ENMCFE.js.map +1 -0
- package/dist/chunk-ZCFSHQBF.js +92 -0
- package/dist/chunk-ZCFSHQBF.js.map +1 -0
- package/dist/chunk-ZH7ZM3ZM.js +125 -0
- package/dist/chunk-ZH7ZM3ZM.js.map +1 -0
- package/dist/chunk-ZIXHS6AM.js +42 -0
- package/dist/chunk-ZIXHS6AM.js.map +1 -0
- package/dist/chunk-ZLLJKSNS.js +96 -0
- package/dist/chunk-ZLLJKSNS.js.map +1 -0
- package/dist/claim-4AFNDV3A.js +197 -0
- package/dist/claim-4AFNDV3A.js.map +1 -0
- package/dist/cli.js +104 -69909
- package/dist/cli.js.map +1 -1
- package/dist/client-26SAJ46D.js +19 -0
- package/dist/code-MOWYJMDH.js +76 -0
- package/dist/code-MOWYJMDH.js.map +1 -0
- package/dist/companies-PZRRZZNV.js +195 -0
- package/dist/companies-PZRRZZNV.js.map +1 -0
- package/dist/complete-IBW5DNVZ.js +81 -0
- package/dist/complete-IBW5DNVZ.js.map +1 -0
- package/dist/config-X6GKOVQ6.js +88 -0
- package/dist/config-X6GKOVQ6.js.map +1 -0
- package/dist/connect-WYUYS5V4.js +42 -0
- package/dist/content-UYZC4AKN.js +85 -0
- package/dist/content-UYZC4AKN.js.map +1 -0
- package/dist/conversation-6AG3UBYY.js +93 -0
- package/dist/conversation-6AG3UBYY.js.map +1 -0
- package/dist/conversion-report-R4GJWWTK.js +125 -0
- package/dist/conversion-report-R4GJWWTK.js.map +1 -0
- package/dist/conversion-upload-command-YML2UNJB.js +438 -0
- package/dist/conversion-upload-command-YML2UNJB.js.map +1 -0
- package/dist/conversion-writes-WHFFUWWL.js +120 -0
- package/dist/conversion-writes-WHFFUWWL.js.map +1 -0
- package/dist/conversions-NOBBFNIU.js +135 -0
- package/dist/conversions-NOBBFNIU.js.map +1 -0
- package/dist/conversions-OXJAX5GB.js +76 -0
- package/dist/conversions-OXJAX5GB.js.map +1 -0
- package/dist/countries-PBXNB3BR.js +82 -0
- package/dist/countries-PBXNB3BR.js.map +1 -0
- package/dist/create-JK42P564.js +59 -0
- package/dist/create-JK42P564.js.map +1 -0
- package/dist/create-LAWUVPCY.js +207 -0
- package/dist/create-LAWUVPCY.js.map +1 -0
- package/dist/create-MUPQ5CTH.js +138 -0
- package/dist/create-MUPQ5CTH.js.map +1 -0
- package/dist/create-NQJNCFRO.js +236 -0
- package/dist/create-NQJNCFRO.js.map +1 -0
- package/dist/creatives-KCWFZIM5.js +182 -0
- package/dist/creatives-KCWFZIM5.js.map +1 -0
- package/dist/creatives-NNDWCSKJ.js +51 -0
- package/dist/creatives-NNDWCSKJ.js.map +1 -0
- package/dist/creatives-RHNHTS2R.js +87 -0
- package/dist/creatives-RHNHTS2R.js.map +1 -0
- package/dist/credentials-CEKGXR2C.js +287 -0
- package/dist/credentials-CEKGXR2C.js.map +1 -0
- package/dist/critique-HDDYER52.js +1449 -0
- package/dist/critique-HDDYER52.js.map +1 -0
- package/dist/critique-QIN2FO4F.js +216 -0
- package/dist/critique-QIN2FO4F.js.map +1 -0
- package/dist/crm-KBPWZC6J.js +318 -0
- package/dist/crm-KBPWZC6J.js.map +1 -0
- package/dist/crm-QBWD7CWB.js +224 -0
- package/dist/crm-QBWD7CWB.js.map +1 -0
- package/dist/crop-U3AD4DDR.js +113 -0
- package/dist/crop-U3AD4DDR.js.map +1 -0
- package/dist/currency-XTFGZFGB.js +88 -0
- package/dist/currency-XTFGZFGB.js.map +1 -0
- package/dist/custom-conversions-W3K33V33.js +125 -0
- package/dist/custom-conversions-W3K33V33.js.map +1 -0
- package/dist/customers-HYE7N2H5.js +56 -0
- package/dist/decide-YTHCBKM6.js +199 -0
- package/dist/decide-YTHCBKM6.js.map +1 -0
- package/dist/delete-64REPCY2.js +54 -0
- package/dist/delete-64REPCY2.js.map +1 -0
- package/dist/delete-AY3KL3N3.js +63 -0
- package/dist/delete-AY3KL3N3.js.map +1 -0
- package/dist/delete-DZUDLYPC.js +69 -0
- package/dist/delete-DZUDLYPC.js.map +1 -0
- package/dist/delete-NZGZP4YP.js +71 -0
- package/dist/delete-NZGZP4YP.js.map +1 -0
- package/dist/delete-VO2LZXE4.js +66 -0
- package/dist/delete-VO2LZXE4.js.map +1 -0
- package/dist/delete-VQMU56OH.js +71 -0
- package/dist/delete-VQMU56OH.js.map +1 -0
- package/dist/demographics-KOFLMGVW.js +138 -0
- package/dist/demographics-KOFLMGVW.js.map +1 -0
- package/dist/describe-JNTCQZNL.js +97 -0
- package/dist/describe-JNTCQZNL.js.map +1 -0
- package/dist/describe-MT4334NG.js +97 -0
- package/dist/describe-MT4334NG.js.map +1 -0
- package/dist/dimensions-FEZUJRAG.js +101 -0
- package/dist/dimensions-FEZUJRAG.js.map +1 -0
- package/dist/discard-H4RPXZHX.js +66 -0
- package/dist/discard-H4RPXZHX.js.map +1 -0
- package/dist/discover-4GD7QSF5.js +93 -0
- package/dist/discover-4GD7QSF5.js.map +1 -0
- package/dist/discover-L7OVXW4V.js +172 -0
- package/dist/discover-L7OVXW4V.js.map +1 -0
- package/dist/domain-HURQ23KR.js +98 -0
- package/dist/domain-HURQ23KR.js.map +1 -0
- package/dist/download-L27HWEOE.js +299 -0
- package/dist/download-L27HWEOE.js.map +1 -0
- package/dist/draft-25G2P2TE.js +281 -0
- package/dist/draft-25G2P2TE.js.map +1 -0
- package/dist/draft-5VH2PW3R.js +307 -0
- package/dist/draft-5VH2PW3R.js.map +1 -0
- package/dist/draft-D6UTKSAA.js +217 -0
- package/dist/draft-D6UTKSAA.js.map +1 -0
- package/dist/draft-KLULNBWP.js +233 -0
- package/dist/draft-KLULNBWP.js.map +1 -0
- package/dist/draft-MI7RWY2K.js +100 -0
- package/dist/draft-MI7RWY2K.js.map +1 -0
- package/dist/draft-P4IVYTY3.js +103 -0
- package/dist/draft-P4IVYTY3.js.map +1 -0
- package/dist/draft-UQYWDZS7.js +306 -0
- package/dist/draft-UQYWDZS7.js.map +1 -0
- package/dist/draft-YFAJHCKM.js +328 -0
- package/dist/draft-YFAJHCKM.js.map +1 -0
- package/dist/engine/index.d.ts +213 -127
- package/dist/engine/index.js +18 -4
- package/dist/{env-4P5HOGNA.js → env-FBTHZKGN.js} +12 -2
- package/dist/env-FBTHZKGN.js.map +1 -0
- package/dist/experiment-HDYTJPUY.js +1397 -0
- package/dist/experiment-HDYTJPUY.js.map +1 -0
- package/dist/export-TS5GYEMA.js +168 -0
- package/dist/export-TS5GYEMA.js.map +1 -0
- package/dist/extract-QVQFUOIK.js +113 -0
- package/dist/extract-QVQFUOIK.js.map +1 -0
- package/dist/facets-WYQUZMFJ.js +114 -0
- package/dist/facets-WYQUZMFJ.js.map +1 -0
- package/dist/favorites-7QP7BY5K.js +178 -0
- package/dist/favorites-7QP7BY5K.js.map +1 -0
- package/dist/feed-EETRO2FG.js +177 -0
- package/dist/feed-EETRO2FG.js.map +1 -0
- package/dist/feedback-SIMPRE37.js +66 -0
- package/dist/feedback-SIMPRE37.js.map +1 -0
- package/dist/feedback-record-L4MPIVML.js +177 -0
- package/dist/feedback-record-L4MPIVML.js.map +1 -0
- package/dist/fetch-DTBM3DE2.js +176 -0
- package/dist/fetch-DTBM3DE2.js.map +1 -0
- package/dist/fetch-Z7O3ZL4D.js +139 -0
- package/dist/fetch-Z7O3ZL4D.js.map +1 -0
- package/dist/find-KAQ6JDMO.js +134 -0
- package/dist/find-KAQ6JDMO.js.map +1 -0
- package/dist/fit-MY5GVZZZ.js +45 -0
- package/dist/fit-MY5GVZZZ.js.map +1 -0
- package/dist/flows-IUDXVDOS.js +247 -0
- package/dist/flows-IUDXVDOS.js.map +1 -0
- package/dist/follow-IX4XVK5Y.js +94 -0
- package/dist/follow-IX4XVK5Y.js.map +1 -0
- package/dist/follow-competitors-UZBUOYTH.js +112 -0
- package/dist/follow-competitors-UZBUOYTH.js.map +1 -0
- package/dist/following-VGOIUCIZ.js +113 -0
- package/dist/following-VGOIUCIZ.js.map +1 -0
- package/dist/fonts-EUDHI6CA.js +34 -0
- package/dist/fonts-EUDHI6CA.js.map +1 -0
- package/dist/forecast-BRSEH2H3.js +104 -0
- package/dist/forecast-BRSEH2H3.js.map +1 -0
- package/dist/forecast-QV4U7TOY.js +168 -0
- package/dist/forecast-QV4U7TOY.js.map +1 -0
- package/dist/funding-H5YO37OW.js +85 -0
- package/dist/funding-H5YO37OW.js.map +1 -0
- package/dist/funnel-JLF77MLF.js +394 -0
- package/dist/funnel-JLF77MLF.js.map +1 -0
- package/dist/ga4-YHJ2XMLC.js +55 -0
- package/dist/ga4-YHJ2XMLC.js.map +1 -0
- package/dist/generate-M2ZX5DMI.js +262 -0
- package/dist/generate-M2ZX5DMI.js.map +1 -0
- package/dist/get-4EYKCZ6F.js +59 -0
- package/dist/get-4EYKCZ6F.js.map +1 -0
- package/dist/get-637GALM2.js +63 -0
- package/dist/get-637GALM2.js.map +1 -0
- package/dist/get-AYX5HS64.js +56 -0
- package/dist/get-AYX5HS64.js.map +1 -0
- package/dist/get-AZARFR6O.js +61 -0
- package/dist/get-AZARFR6O.js.map +1 -0
- package/dist/get-EG2U7MIL.js +78 -0
- package/dist/get-EG2U7MIL.js.map +1 -0
- package/dist/get-N4BPOQCB.js +63 -0
- package/dist/get-N4BPOQCB.js.map +1 -0
- package/dist/get-RPZHLQ56.js +92 -0
- package/dist/get-RPZHLQ56.js.map +1 -0
- package/dist/gif-6PRTB2VR.js +94 -0
- package/dist/gif-6PRTB2VR.js.map +1 -0
- package/dist/google-52JRH7X3.js +136 -0
- package/dist/google-52JRH7X3.js.map +1 -0
- package/dist/google-ITTPCJ7N.js +3190 -0
- package/dist/google-ITTPCJ7N.js.map +1 -0
- package/dist/google-ads-U3JFFQLU.js +195 -0
- package/dist/google-ads-U3JFFQLU.js.map +1 -0
- package/dist/group-AAZ5QKC3.js +43 -0
- package/dist/group-AAZ5QKC3.js.map +1 -0
- package/dist/group-GSYCZORC.js +43 -0
- package/dist/group-GSYCZORC.js.map +1 -0
- package/dist/gsc-TS5T7ML2.js +30 -0
- package/dist/gsc-TS5T7ML2.js.map +1 -0
- package/dist/history-EW6LFFCX.js +67 -0
- package/dist/history-EW6LFFCX.js.map +1 -0
- package/dist/history-YTNCWSV3.js +133 -0
- package/dist/history-YTNCWSV3.js.map +1 -0
- package/dist/hubspot-LXWQNKKB.js +779 -0
- package/dist/hubspot-LXWQNKKB.js.map +1 -0
- package/dist/icon-K75KI6BV.js +137 -0
- package/dist/icon-K75KI6BV.js.map +1 -0
- package/dist/ideas-JJIHQFV4.js +35 -0
- package/dist/ideas-JJIHQFV4.js.map +1 -0
- package/dist/images-MWETBYKB.js +90 -0
- package/dist/images-MWETBYKB.js.map +1 -0
- package/dist/improve-L3BW4EQG.js +86 -0
- package/dist/improve-L3BW4EQG.js.map +1 -0
- package/dist/ingest-THFAV4NO.js +107 -0
- package/dist/ingest-THFAV4NO.js.map +1 -0
- package/dist/ingest-U6B7GR4A.js +23 -0
- package/dist/ingest-U6B7GR4A.js.map +1 -0
- package/dist/insights-FA6T6PT6.js +423 -0
- package/dist/insights-FA6T6PT6.js.map +1 -0
- package/dist/insights-PELVD4RY.js +122 -0
- package/dist/insights-PELVD4RY.js.map +1 -0
- package/dist/inspect-N2WVVWGP.js +189 -0
- package/dist/inspect-N2WVVWGP.js.map +1 -0
- package/dist/inspiration-Y2J2PUPC.js +53 -0
- package/dist/inspiration-Y2J2PUPC.js.map +1 -0
- package/dist/intent-YNAAVNHK.js +95 -0
- package/dist/intent-YNAAVNHK.js.map +1 -0
- package/dist/job-E2U4FS5P.js +202 -0
- package/dist/job-E2U4FS5P.js.map +1 -0
- package/dist/job-create-DFYCHVQ7.js +109 -0
- package/dist/job-create-DFYCHVQ7.js.map +1 -0
- package/dist/job-status-FFPMTSHB.js +74 -0
- package/dist/job-status-FFPMTSHB.js.map +1 -0
- package/dist/keep-GYZS2UTL.js +78 -0
- package/dist/keep-GYZS2UTL.js.map +1 -0
- package/dist/keyword-gap-4JKLWIBJ.js +130 -0
- package/dist/keyword-gap-4JKLWIBJ.js.map +1 -0
- package/dist/keyword-metrics-KU3OHTQK.js +197 -0
- package/dist/keyword-metrics-KU3OHTQK.js.map +1 -0
- package/dist/keywords-for-site-M4MFWMVK.js +128 -0
- package/dist/keywords-for-site-M4MFWMVK.js.map +1 -0
- package/dist/landing-7UVZ7IPP.js +28 -0
- package/dist/landing-7UVZ7IPP.js.map +1 -0
- package/dist/landings-F7LOAEJE.js +151 -0
- package/dist/landings-F7LOAEJE.js.map +1 -0
- package/dist/languages-PKYCZNUB.js +40 -0
- package/dist/languages-PKYCZNUB.js.map +1 -0
- package/dist/languages-XEJKTIFP.js +55 -0
- package/dist/languages-XEJKTIFP.js.map +1 -0
- package/dist/launches-TCFAYUA5.js +19 -0
- package/dist/launches-TCFAYUA5.js.map +1 -0
- package/dist/layerize-ZSKFIPZA.js +190 -0
- package/dist/layerize-ZSKFIPZA.js.map +1 -0
- package/dist/leads-CSRESOB2.js +293 -0
- package/dist/leads-CSRESOB2.js.map +1 -0
- package/dist/leads-MQPEA7DG.js +90 -0
- package/dist/leads-MQPEA7DG.js.map +1 -0
- package/dist/learn-K5YBUMBT.js +203 -0
- package/dist/learn-K5YBUMBT.js.map +1 -0
- package/dist/library-IP2UKNRU.js +109 -0
- package/dist/library-IP2UKNRU.js.map +1 -0
- package/dist/lighthouse-57XBJRCO.js +75 -0
- package/dist/lighthouse-57XBJRCO.js.map +1 -0
- package/dist/line-item-writes-73NR2J5L.js +208 -0
- package/dist/line-item-writes-73NR2J5L.js.map +1 -0
- package/dist/line-items-2YBGXOAQ.js +103 -0
- package/dist/line-items-2YBGXOAQ.js.map +1 -0
- package/dist/link-GVAWECJO.js +64 -0
- package/dist/link-GVAWECJO.js.map +1 -0
- package/dist/linkedin-PZDT22AT.js +1008 -0
- package/dist/linkedin-PZDT22AT.js.map +1 -0
- package/dist/list-6IKPWQGG.js +57 -0
- package/dist/list-6IKPWQGG.js.map +1 -0
- package/dist/list-CAUH3BMG.js +65 -0
- package/dist/list-CAUH3BMG.js.map +1 -0
- package/dist/list-FNDRV25Y.js +151 -0
- package/dist/list-FNDRV25Y.js.map +1 -0
- package/dist/list-GTOSN7DP.js +50 -0
- package/dist/list-GTOSN7DP.js.map +1 -0
- package/dist/list-HLJP4NVE.js +51 -0
- package/dist/list-HLJP4NVE.js.map +1 -0
- package/dist/list-LCUPF7EF.js +76 -0
- package/dist/list-LCUPF7EF.js.map +1 -0
- package/dist/list-REZGFWC5.js +63 -0
- package/dist/list-REZGFWC5.js.map +1 -0
- package/dist/list-S6MNXDTV.js +303 -0
- package/dist/list-S6MNXDTV.js.map +1 -0
- package/dist/locations-2BYWKIYA.js +67 -0
- package/dist/locations-2BYWKIYA.js.map +1 -0
- package/dist/locations-GJHHMV6Z.js +40 -0
- package/dist/locations-GJHHMV6Z.js.map +1 -0
- package/dist/log-HGDNLDUX.js +92 -0
- package/dist/log-HGDNLDUX.js.map +1 -0
- package/dist/logo-AJK2TDQU.js +18 -0
- package/dist/logo-AJK2TDQU.js.map +1 -0
- package/dist/lookup-H5GEM77H.js +22 -0
- package/dist/lookup-H5GEM77H.js.map +1 -0
- package/dist/make-BT26YJXZ.js +640 -0
- package/dist/make-BT26YJXZ.js.map +1 -0
- package/dist/map-J5EX4HOX.js +404 -0
- package/dist/map-J5EX4HOX.js.map +1 -0
- package/dist/mcp-MHDW6AFL.js +463 -0
- package/dist/mcp-MHDW6AFL.js.map +1 -0
- package/dist/media-RAGEJTZX.js +89 -0
- package/dist/media-RAGEJTZX.js.map +1 -0
- package/dist/media-RNB7JFJP.js +15 -0
- package/dist/media-RNB7JFJP.js.map +1 -0
- package/dist/media-sources-4NN3DWSG.js +32 -0
- package/dist/media-sources-4NN3DWSG.js.map +1 -0
- package/dist/members-AIWMXAQD.js +44 -0
- package/dist/members-AIWMXAQD.js.map +1 -0
- package/dist/meta-WAPZMZI7.js +69 -0
- package/dist/meta-WAPZMZI7.js.map +1 -0
- package/dist/metrics-6EHC4ESN.js +152 -0
- package/dist/metrics-6EHC4ESN.js.map +1 -0
- package/dist/models-5J4WFUD3.js +155 -0
- package/dist/models-5J4WFUD3.js.map +1 -0
- package/dist/normalize-DSFVTRXN.js +806 -0
- package/dist/normalize-DSFVTRXN.js.map +1 -0
- package/dist/normalize-ZAWN4XCS.js +141 -0
- package/dist/normalize-ZAWN4XCS.js.map +1 -0
- package/dist/options-3CZNT5KP.js +121 -0
- package/dist/options-3CZNT5KP.js.map +1 -0
- package/dist/output-DTCLVPUF.js +24 -0
- package/dist/output-DTCLVPUF.js.map +1 -0
- package/dist/page-N2ZO3O7F.js +105 -0
- package/dist/page-N2ZO3O7F.js.map +1 -0
- package/dist/pages-FQ4CBAJ2.js +66 -0
- package/dist/pages-FQ4CBAJ2.js.map +1 -0
- package/dist/performance-GOMJMHPE.js +24 -0
- package/dist/performance-GOMJMHPE.js.map +1 -0
- package/dist/pinterest-NV5XTNJE.js +96 -0
- package/dist/pinterest-NV5XTNJE.js.map +1 -0
- package/dist/pixels-CTJ43FZ4.js +108 -0
- package/dist/pixels-CTJ43FZ4.js.map +1 -0
- package/dist/pixels-HKINGZCH.js +60 -0
- package/dist/pixels-HKINGZCH.js.map +1 -0
- package/dist/plan-ZYTWLGWK.js +207 -0
- package/dist/plan-ZYTWLGWK.js.map +1 -0
- package/dist/preview-UKYLPAW2.js +169 -0
- package/dist/preview-UKYLPAW2.js.map +1 -0
- package/dist/profile-Q3PHR6FU.js +159 -0
- package/dist/profile-Q3PHR6FU.js.map +1 -0
- package/dist/promoted-tweet-writes-IYOAZTA5.js +180 -0
- package/dist/promoted-tweet-writes-IYOAZTA5.js.map +1 -0
- package/dist/promoted-tweets-G3XFD5YM.js +119 -0
- package/dist/promoted-tweets-G3XFD5YM.js.map +1 -0
- package/dist/properties-WLL6M2P6.js +101 -0
- package/dist/properties-WLL6M2P6.js.map +1 -0
- package/dist/publish-ZG4J2GTH.js +322 -0
- package/dist/publish-ZG4J2GTH.js.map +1 -0
- package/dist/query-7AGG77WH.js +61 -0
- package/dist/query-7AGG77WH.js.map +1 -0
- package/dist/query-IYZN5KHO.js +236 -0
- package/dist/query-IYZN5KHO.js.map +1 -0
- package/dist/query-UN2P6DBA.js +247 -0
- package/dist/query-UN2P6DBA.js.map +1 -0
- package/dist/questionnaire-Z2ZIKNBV.js +93 -0
- package/dist/questionnaire-Z2ZIKNBV.js.map +1 -0
- package/dist/read-GM7PQYJA.js +141 -0
- package/dist/read-GM7PQYJA.js.map +1 -0
- package/dist/reddit-FTO4SFQE.js +26 -0
- package/dist/reddit-FTO4SFQE.js.map +1 -0
- package/dist/refresh-OUENQ2FS.js +94 -0
- package/dist/refresh-OUENQ2FS.js.map +1 -0
- package/dist/release-5OG7AAFY.js +60 -0
- package/dist/release-5OG7AAFY.js.map +1 -0
- package/dist/relevant-pages-KUVDZPRU.js +99 -0
- package/dist/relevant-pages-KUVDZPRU.js.map +1 -0
- package/dist/remove-33HI27KM.js +50 -0
- package/dist/remove-33HI27KM.js.map +1 -0
- package/dist/remove-GOYW2G4R.js +48 -0
- package/dist/remove-GOYW2G4R.js.map +1 -0
- package/dist/reopen-KFFYE53A.js +63 -0
- package/dist/reopen-KFFYE53A.js.map +1 -0
- package/dist/rerun-P6XACA5Z.js +86 -0
- package/dist/rerun-P6XACA5Z.js.map +1 -0
- package/dist/research-BEO3JMZI.js +262 -0
- package/dist/research-BEO3JMZI.js.map +1 -0
- package/dist/research-QOC53DLS.js +62 -0
- package/dist/research-QOC53DLS.js.map +1 -0
- package/dist/reset-E3OWE2WF.js +54 -0
- package/dist/reset-E3OWE2WF.js.map +1 -0
- package/dist/reset-I7M3HYMB.js +54 -0
- package/dist/reset-I7M3HYMB.js.map +1 -0
- package/dist/resolve-GP7BHM6L.js +121 -0
- package/dist/resolve-GP7BHM6L.js.map +1 -0
- package/dist/retry-33ZJCNQI.js +62 -0
- package/dist/retry-33ZJCNQI.js.map +1 -0
- package/dist/retry-X5PU7QO3.js +60 -0
- package/dist/retry-X5PU7QO3.js.map +1 -0
- package/dist/retry-failed-BEFWRV4Z.js +45 -0
- package/dist/retry-failed-BEFWRV4Z.js.map +1 -0
- package/dist/run-REK3TEGY.js +65 -0
- package/dist/run-REK3TEGY.js.map +1 -0
- package/dist/run-TH2662IC.js +61 -0
- package/dist/run-TH2662IC.js.map +1 -0
- package/dist/scaffold-ad-3WDRKUFT.js +1550 -0
- package/dist/scaffold-ad-3WDRKUFT.js.map +1 -0
- package/dist/scaffold-static-ad-X5NT52NF.js +973 -0
- package/dist/scaffold-static-ad-X5NT52NF.js.map +1 -0
- package/dist/scaffold-video-WZPVACLE.js +874 -0
- package/dist/scaffold-video-WZPVACLE.js.map +1 -0
- package/dist/schedule-KQ7UIR3N.js +66 -0
- package/dist/schedule-KQ7UIR3N.js.map +1 -0
- package/dist/schedule-V4UHGY3V.js +61 -0
- package/dist/schedule-V4UHGY3V.js.map +1 -0
- package/dist/scheduled-agents-KLQ5H2PA.js +49 -0
- package/dist/scheduled-agents-KLQ5H2PA.js.map +1 -0
- package/dist/schema-G3T4PZDI.js +132 -0
- package/dist/schema-G3T4PZDI.js.map +1 -0
- package/dist/schema-QXTDLZVC.js +63 -0
- package/dist/schema-QXTDLZVC.js.map +1 -0
- package/dist/scrape-7YKJWFZE.js +2241 -0
- package/dist/scrape-7YKJWFZE.js.map +1 -0
- package/dist/screenshot-ZHBSG3SI.js +102 -0
- package/dist/screenshot-ZHBSG3SI.js.map +1 -0
- package/dist/search-332KFYZ6.js +224 -0
- package/dist/search-332KFYZ6.js.map +1 -0
- package/dist/search-4PBMXXUY.js +91 -0
- package/dist/search-4PBMXXUY.js.map +1 -0
- package/dist/search-6XKEGABN.js +174 -0
- package/dist/search-6XKEGABN.js.map +1 -0
- package/dist/search-AVNUU6TJ.js +26 -0
- package/dist/search-AVNUU6TJ.js.map +1 -0
- package/dist/search-F5INRFFK.js +92 -0
- package/dist/search-F5INRFFK.js.map +1 -0
- package/dist/search-copy-DZVBYG2B.js +168 -0
- package/dist/search-copy-DZVBYG2B.js.map +1 -0
- package/dist/seeds-5JTQN5WI.js +101 -0
- package/dist/seeds-5JTQN5WI.js.map +1 -0
- package/dist/select-N2V55BEX.js +96 -0
- package/dist/select-N2V55BEX.js.map +1 -0
- package/dist/sends-3L6QBS46.js +309 -0
- package/dist/sends-3L6QBS46.js.map +1 -0
- package/dist/sequences-YKFV7BDH.js +146 -0
- package/dist/sequences-YKFV7BDH.js.map +1 -0
- package/dist/set-prompt-7HVHERRU.js +188 -0
- package/dist/set-prompt-7HVHERRU.js.map +1 -0
- package/dist/setup-links-4VVNQVPU.js +141 -0
- package/dist/setup-links-4VVNQVPU.js.map +1 -0
- package/dist/{shared-J7DQZ2ED.js → shared-QAMP7FZV.js} +8 -6
- package/dist/shared-QAMP7FZV.js.map +1 -0
- package/dist/shopify-FSHM5M4I.js +3346 -0
- package/dist/shopify-FSHM5M4I.js.map +1 -0
- package/dist/site-Q2HTRLIW.js +177 -0
- package/dist/site-Q2HTRLIW.js.map +1 -0
- package/dist/sitemaps-XPGLW24S.js +87 -0
- package/dist/sitemaps-XPGLW24S.js.map +1 -0
- package/dist/sites-WMBY2HJV.js +101 -0
- package/dist/sites-WMBY2HJV.js.map +1 -0
- package/dist/skills-3HEILQCU.js +47 -0
- package/dist/skills-3HEILQCU.js.map +1 -0
- package/dist/sources-2KN4RJNJ.js +30 -0
- package/dist/sources-2KN4RJNJ.js.map +1 -0
- package/dist/sources-4I2YMS2K.js +421 -0
- package/dist/sources-4I2YMS2K.js.map +1 -0
- package/dist/stale-IN7WSBLC.js +66 -0
- package/dist/stale-IN7WSBLC.js.map +1 -0
- package/dist/stats-GNILHSKK.js +34 -0
- package/dist/stats-GNILHSKK.js.map +1 -0
- package/dist/status-6SLKZWNR.js +62 -0
- package/dist/status-6SLKZWNR.js.map +1 -0
- package/dist/sticker-KCV3VZHY.js +94 -0
- package/dist/sticker-KCV3VZHY.js.map +1 -0
- package/dist/stock-VTORKR4C.js +179 -0
- package/dist/stock-VTORKR4C.js.map +1 -0
- package/dist/studio-QCRA6BY5.js +49 -0
- package/dist/studio-QCRA6BY5.js.map +1 -0
- package/dist/sync-455DB46Y.js +54 -0
- package/dist/sync-455DB46Y.js.map +1 -0
- package/dist/sync-A4KKQ3B6.js +265 -0
- package/dist/sync-A4KKQ3B6.js.map +1 -0
- package/dist/sync-LFZV5NBN.js +54 -0
- package/dist/sync-LFZV5NBN.js.map +1 -0
- package/dist/sync-definition-IJISZ5VQ.js +55 -0
- package/dist/sync-definition-IJISZ5VQ.js.map +1 -0
- package/dist/tag-manager-E7QTXBWQ.js +43 -0
- package/dist/tag-manager-E7QTXBWQ.js.map +1 -0
- package/dist/tags-6OAZOQYO.js +26 -0
- package/dist/tags-6OAZOQYO.js.map +1 -0
- package/dist/tags-6YRMDX3R.js +20 -0
- package/dist/tags-6YRMDX3R.js.map +1 -0
- package/dist/tags-EWXZSZYE.js +20 -0
- package/dist/tags-EWXZSZYE.js.map +1 -0
- package/dist/tags-SZCNPE2D.js +224 -0
- package/dist/tags-SZCNPE2D.js.map +1 -0
- package/dist/tags-TCFFP534.js +20 -0
- package/dist/tags-TCFFP534.js.map +1 -0
- package/dist/targeting-constants-D64YO3E7.js +118 -0
- package/dist/targeting-constants-D64YO3E7.js.map +1 -0
- package/dist/targeting-criteria-ESOC7KNX.js +113 -0
- package/dist/targeting-criteria-ESOC7KNX.js.map +1 -0
- package/dist/targets-IPBEB5KU.js +102 -0
- package/dist/targets-IPBEB5KU.js.map +1 -0
- package/dist/templates-IJ7FR3LA.js +178 -0
- package/dist/templates-IJ7FR3LA.js.map +1 -0
- package/dist/testimonials-IXS7CP6P.js +32 -0
- package/dist/testimonials-IXS7CP6P.js.map +1 -0
- package/dist/themes-MXNKJWMW.js +94 -0
- package/dist/themes-MXNKJWMW.js.map +1 -0
- package/dist/top-companies-NO6L2V6M.js +108 -0
- package/dist/top-companies-NO6L2V6M.js.map +1 -0
- package/dist/translate-QCE5ZB7M.js +600 -0
- package/dist/translate-QCE5ZB7M.js.map +1 -0
- package/dist/triggers-KXUDMDSA.js +141 -0
- package/dist/triggers-KXUDMDSA.js.map +1 -0
- package/dist/tweets-ZUKQAAUQ.js +123 -0
- package/dist/tweets-ZUKQAAUQ.js.map +1 -0
- package/dist/unfollow-A4JVCJBF.js +46 -0
- package/dist/unfollow-A4JVCJBF.js.map +1 -0
- package/dist/unlink-E3N36NYQ.js +67 -0
- package/dist/unlink-E3N36NYQ.js.map +1 -0
- package/dist/unstage-TRMHSHED.js +84 -0
- package/dist/unstage-TRMHSHED.js.map +1 -0
- package/dist/unstage-ZRLLCSQF.js +95 -0
- package/dist/unstage-ZRLLCSQF.js.map +1 -0
- package/dist/update-EWGWAXAQ.js +142 -0
- package/dist/update-EWGWAXAQ.js.map +1 -0
- package/dist/update-OKOQE7U2.js +155 -0
- package/dist/update-OKOQE7U2.js.map +1 -0
- package/dist/update-VSFHID2D.js +63 -0
- package/dist/update-VSFHID2D.js.map +1 -0
- package/dist/update-XGCGQDJ4.js +98 -0
- package/dist/update-XGCGQDJ4.js.map +1 -0
- package/dist/upload-BOYMDDEQ.js +126 -0
- package/dist/upload-BOYMDDEQ.js.map +1 -0
- package/dist/upload-XEHWYMJG.js +150 -0
- package/dist/upload-XEHWYMJG.js.map +1 -0
- package/dist/upscale-I5P2OHTN.js +109 -0
- package/dist/upscale-I5P2OHTN.js.map +1 -0
- package/dist/url-options-PCZEQE66.js +130 -0
- package/dist/url-options-PCZEQE66.js.map +1 -0
- package/dist/url-params-DV37GEQF.js +98 -0
- package/dist/url-params-DV37GEQF.js.map +1 -0
- package/dist/use-U4HG2NF3.js +95 -0
- package/dist/use-U4HG2NF3.js.map +1 -0
- package/dist/validate-5AV4FJZ5.js +91 -0
- package/dist/validate-5AV4FJZ5.js.map +1 -0
- package/dist/variant-FOVE6URJ.js +338 -0
- package/dist/variant-FOVE6URJ.js.map +1 -0
- package/dist/videos-IJ67PPJV.js +39 -0
- package/dist/videos-IJ67PPJV.js.map +1 -0
- package/dist/view-HRI3FHCH.js +121 -0
- package/dist/view-HRI3FHCH.js.map +1 -0
- package/dist/viewer-check-JYUE24M6.js +68 -0
- package/dist/viewer-check-JYUE24M6.js.map +1 -0
- package/dist/web-LJ36FRWD.js +140 -0
- package/dist/web-LJ36FRWD.js.map +1 -0
- package/dist/winners-SMMDN6LW.js +113 -0
- package/dist/winners-SMMDN6LW.js.map +1 -0
- package/dist/winning-ads-JIG2MQHJ.js +84 -0
- package/dist/winning-ads-JIG2MQHJ.js.map +1 -0
- package/dist/write-commands-7Z34WG2J.js +206 -0
- package/dist/write-commands-7Z34WG2J.js.map +1 -0
- package/dist/write-commands-BLT2SEC4.js +713 -0
- package/dist/write-commands-BLT2SEC4.js.map +1 -0
- package/dist/write-commands-GOZU6ENR.js +1015 -0
- package/dist/write-commands-GOZU6ENR.js.map +1 -0
- package/dist/write-commands-KA3QXVSF.js +737 -0
- package/dist/write-commands-KA3QXVSF.js.map +1 -0
- package/dist/x-6HBVXIKH.js +47 -0
- package/dist/x-6HBVXIKH.js.map +1 -0
- package/package.json +9 -2
- package/dist/chunk-CHJOTJTZ.js +0 -9989
- package/dist/chunk-CHJOTJTZ.js.map +0 -1
- package/dist/chunk-HJEMOSPH.js +0 -1292
- package/dist/chunk-HJEMOSPH.js.map +0 -1
- package/dist/chunk-MF7YA62W.js.map +0 -1
- package/dist/chunk-VLUGGVJL.js.map +0 -1
- package/dist/chunk-VZEDAFAR.js.map +0 -1
- package/dist/chunk-XHC4LMK4.js.map +0 -1
- package/dist/client-GR6YL3YX.js +0 -17
- package/dist/output-NMQXZF3Z.js +0 -18
- /package/dist/{client-GR6YL3YX.js.map → chunk-YQSBHWOI.js.map} +0 -0
- /package/dist/{env-4P5HOGNA.js.map → client-26SAJ46D.js.map} +0 -0
- /package/dist/{output-NMQXZF3Z.js.map → connect-WYUYS5V4.js.map} +0 -0
- /package/dist/{shared-J7DQZ2ED.js.map → customers-HYE7N2H5.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/brand/fonts.ts"],"sourcesContent":["import type { Dirent } from \"node:fs\";\nimport { mkdir, readdir, readFile, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { defineCommand } from \"citty\";\nimport {\n type BrandFontFace,\n checkFontRequests,\n DEFAULT_SUBSETS,\n type FetchCss,\n FONT_PROVIDERS,\n type FontProviderName,\n type FontStyle,\n fontFileName,\n fontsourceCatalogue,\n fontsourceFamilies,\n type GoogleCssLookup,\n googleFontRequests,\n missingFontFiles,\n planFontAdoption,\n type ResolveOutcome,\n renderFontFaceCss,\n resolveBrandFaces,\n resolveFetchStyles,\n resolveFetchSubsets,\n resolveFetchWeights,\n selfHostedStyles,\n selfHostedSubsets,\n selfHostedWeights,\n stripFontFaceBlocks,\n suggestFamilies,\n unresolvedBrandFamilies,\n upsertFontFaceCss,\n} from \"../../engine/brand/fonts.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\n\nconst GLOBAL_CSS = path.join(\"src\", \"styles\", \"global.css\");\nconst FONTS_DIR = path.join(\"src\", \"brand\", \"fonts\");\nconst DEFAULT_SUBSETS_LABEL = DEFAULT_SUBSETS.join(\",\");\n\n// Google serves different CSS per user agent — an old UA gets ttf instead of\n// woff2. Ask as a modern browser so the response is the woff2 set we want.\nconst BROWSER_UA = \"Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/120.0 Safari/537.36\";\n\nregisterSchema({\n command: \"brand.fonts.check\",\n description:\n \"Start here when a brand's fonts are 'confirmed' but nobody verified it. Fails if any --font-* family in src/styles/global.css has nothing loading it (no @font-face, no Google import) — the silent fallback that also fails the client's verify — then asks Google Fonts what it ACTUALLY serves for every family/weight the stylesheet requests.\",\n args: {},\n});\n\nregisterSchema({\n command: \"brand.fonts.adopt\",\n description:\n \"Move brand faces a page already self-hosts into src/styles/global.css, so every page loads them rather than only the page that declared them. Use when `check` reports a family as not loaded but its files are already in src/brand/fonts/. Never downloads: re-fetching would hand that page a different build of the same face.\",\n args: {},\n});\n\nregisterSchema({\n command: \"brand.fonts.fetch\",\n description:\n \"Download a font into src/brand/fonts/ so the brand stops depending on a third party at page load, and write its @font-face into src/styles/global.css above @theme. Resolves against Google Fonts first, then Fontsource — which carries ~2000 open-licence families Google does not, so a name Google 400s is often still fetchable. Idempotent: re-running replaces that family's faces rather than stacking duplicates.\",\n args: {\n family: { type: \"string\", description: 'Font family, e.g. \"DM Sans\"', required: true },\n weights: {\n type: \"string\",\n description: \"Comma-separated weights (default: the weights global.css already requests or self-hosts, else 400)\",\n required: false,\n },\n subsets: {\n type: \"string\",\n description: `Comma-separated unicode subsets (default: the subsets global.css already self-hosts, else ${DEFAULT_SUBSETS_LABEL})`,\n required: false,\n },\n italic: {\n type: \"boolean\",\n description:\n \"Also self-host the family's italic faces. On automatically when global.css already loads one, so a re-fetch never strands it.\",\n required: false,\n },\n },\n});\n\nfunction fail(\n code: string,\n message: string,\n fix?: { action: string; explanation: string } & Record<string, unknown>,\n): never {\n writeJson({ ok: false, error: { code, message, ...(fix ? { fix } : {}) } });\n process.exit(2);\n}\n\n// A hung request would otherwise stall the agent's whole turn — these commands\n// are on demand, so a bounded wait is strictly better than an open one.\nconst REQUEST_TIMEOUT_MS = 15_000;\n\n/**\n * JSON body from a catalogue API, or null when the catalogue itself answers\n * that there is no such family.\n *\n * Only a 404 is that answer. Every other failure THROWS, because \"Fontsource\n * did not answer\" is not \"Fontsource does not have it\" — collapsed into null it\n * became `unknown-family`, and the agent was told to check the spelling or\n * hand-write an @font-face for a commercial face, on the strength of a 503.\n * Same rule `lookupGoogleCss` follows, and the scaffold's `getJson` mirror.\n */\nexport async function fetchJson(url: string): Promise<unknown> {\n const res = await fetch(url, {\n headers: { \"User-Agent\": BROWSER_UA },\n signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),\n });\n if (res.status === 404) return null;\n if (!res.ok) throw new Error(`Fontsource answered ${res.status}`);\n return await res.json();\n}\n\nexport async function lookupGoogleCss(url: string): Promise<GoogleCssLookup> {\n try {\n const res = await fetch(url, {\n headers: { \"User-Agent\": BROWSER_UA },\n signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),\n });\n if (res.ok) return { status: \"served\", css: await res.text() };\n // Measured: Google answers 400 for a family it does not carry and for a\n // weight it does not serve, and 200 otherwise. A 429 or a 503 says nothing\n // about the family, so it must not read as one.\n return { status: res.status === 400 ? \"absent\" : \"unreachable\" };\n } catch {\n return { status: \"unreachable\" };\n }\n}\n\n/** `check` only asks what Google serves, so it collapses both silences into null. */\nconst fetchGoogleCss: FetchCss = async (url) => {\n const got = await lookupGoogleCss(url);\n return got.status === \"served\" ? got.css : null;\n};\n\n/** What became of `global.css` — three outcomes, because two of them read the same. */\ntype Wiring = \"written\" | \"already-wired\" | \"no-stylesheet\";\n\nconst WIRING_HINT: Record<Wiring, (family: string) => string> = {\n written: (family) =>\n `Wrote the @font-face for \"${family}\" into ${GLOBAL_CSS}, above @theme. Remove \"${family}\" from the Google @import if one is still there, so the page stops fetching it at load.`,\n // Told apart from \"no stylesheet\" on purpose: they used to share one hint, so\n // an idempotent re-run instructed the agent to paste a block that was already\n // in the file, and doing as it was told duplicated the face.\n \"already-wired\": (family) => `${GLOBAL_CSS} already loads exactly these faces for \"${family}\" — nothing to change.`,\n \"no-stylesheet\": () =>\n `No ${GLOBAL_CSS} to write to — paste the \\`fontFace\\` block above the @theme block once the stylesheet exists, or the files just downloaded will never load.`,\n};\n\n/** The network boundary for every catalogue, in one place. */\nconst PROVIDER_DEPS = { lookupGoogleCss, fetchJson };\n\n/** Catalogue names as a human writes them — the ids are lowercase slugs. */\nconst PROVIDER_LABEL: Record<FontProviderName, string> = { google: \"Google Fonts\", fontsource: \"Fontsource\" };\n\n/**\n * What became of the italic, said out loud either way.\n *\n * Both silences cost something. Asking for an italic a catalogue does not ship\n * and being told nothing reads as success, so the brand keeps promising an\n * italic the browser will synthesize. And NOT asking, when the catalogue has\n * one, is the state most brands are in — the one request already made knows the\n * answer, so saying it costs nothing.\n */\nfunction italicHints(\n family: string,\n wantedStyles: readonly FontStyle[],\n availableStyles: string[],\n downloadedStyles: string[],\n provider: FontProviderName,\n): string[] {\n const wanted = wantedStyles.includes(\"italic\");\n const available = availableStyles.includes(\"italic\");\n if (wanted && !downloadedStyles.includes(\"italic\")) {\n return [\n `NO ITALIC: ${PROVIDER_LABEL[provider]} does not ship an italic for \"${family}\", so none was written. Drop italic from src/brand/BRAND.md, or the browser will slant the upright face instead.`,\n ];\n }\n if (!wanted && available) {\n return [\n `${PROVIDER_LABEL[provider]} also ships an italic for \"${family}\", which was NOT downloaded. If the brand uses italic anywhere, re-run with \\`--italic\\` — otherwise the browser slants the upright face, which is not the same shapes.`,\n ];\n }\n return [];\n}\n\nfunction fetchHints({\n family,\n downloadedWeights,\n downloadedStyles,\n incomplete,\n wiring,\n provider,\n wantedStyles,\n availableStyles,\n}: {\n family: string;\n downloadedWeights: number[];\n downloadedStyles: string[];\n incomplete: number[];\n wiring: Wiring;\n provider: FontProviderName;\n wantedStyles: readonly FontStyle[];\n availableStyles: string[];\n}): string[] {\n return [\n WIRING_HINT[wiring](family),\n ...italicHints(family, wantedStyles, availableStyles, downloadedStyles, provider),\n `Record the exact weights (${downloadedWeights.join(\", \")}) in src/brand/tokens.json and BRAND.md — a weight tokens.json lists but nothing loads renders as a synthesized fallback, and verify warns about it.`,\n ...(incomplete.length > 0\n ? [\n // The remedy is provider-specific: only a Google family has an @import\n // to fall back on, and telling an agent to keep one for a Fontsource\n // family sends it to write an import Google will 400.\n provider === \"google\"\n ? `PARTIAL: ${incomplete.join(\", \")} did not download and is NOT in the \\`fontFace\\` block. Re-run \\`baker brand fonts fetch \"${family}\" --weights ${incomplete.join(\",\")}\\` — a Google @import cannot cover those weights, because the build drops it before the page loads.`\n : `PARTIAL: ${incomplete.join(\", \")} did not download and is NOT in the \\`fontFace\\` block. ${PROVIDER_LABEL[provider]} does not serve them, so re-run \\`baker brand fonts fetch \"${family}\" --weights ${downloadedWeights.join(\",\")}\\` and record only those weights in src/brand/BRAND.md.`,\n ]\n : []),\n `Licensing: ${PROVIDER_LABEL[provider]} carries open-licensed families, which are safe to self-host. A client's own commercial face is not — confirm before re-hosting one.`,\n ];\n}\n\n/**\n * Put the downloaded face in charge of the family in `global.css`, and say what\n * happened. `readGlobalCss` yields \"\" when the stylesheet is missing, and a\n * stylesheet holding nothing but a @font-face would be worse than none — so\n * that case writes nothing and the caller says so.\n */\nasync function wireFontFaceIntoStylesheet(css: string, family: string, fontFace: string): Promise<Wiring> {\n if (!css) return \"no-stylesheet\";\n const wired = upsertFontFaceCss(css, family, fontFace);\n if (wired === css) return \"already-wired\";\n await writeFile(path.resolve(process.cwd(), GLOBAL_CSS), wired);\n return \"written\";\n}\n\n/**\n * Turn a failed lookup into the one remediation that fits it, then exit.\n *\n * Each reason wants a different sentence, and saying the wrong one is worse\n * than saying nothing: a subset miss reported as a weight miss answered\n * `\"Inter\" exists but not at weight 400 — retry with --weights 400`, which an\n * agent can obey forever without ever getting a different result.\n */\nfunction failResolution(family: string, weights: number[], outcome: ResolveOutcome & { ok: false }): Promise<never> {\n if (outcome.reason === \"unreachable\") {\n // Whichever catalogue went quiet, the answer is the same: ask again. On\n // Google we deliberately do NOT retry against Fontsource — it very likely\n // has the family, and taking it would swap the foundry for good on the\n // strength of one failed request.\n return fail(\n \"CATALOGUE_UNREACHABLE\",\n `Could not reach ${PROVIDER_LABEL[outcome.provider]} to ask about \"${family}\".`,\n {\n action: \"Run the same command again.\",\n explanation: `${PROVIDER_LABEL[outcome.provider]} did not answer, which is not the same as not having the family — so nothing was concluded from it. Guessing either way would self-host the wrong build, or report a real family as missing.`,\n provider: outcome.provider,\n },\n );\n }\n if (outcome.reason === \"ambiguous-subsets\") {\n return fail(\n \"SUBSET_AMBIGUOUS\",\n `${PROVIDER_LABEL[outcome.provider]} serves \"${family}\" in several subsets but reports no unicode-range to tell them apart.`,\n {\n action: `Retry with a single --subsets value, e.g. --subsets ${outcome.available[0] ?? \"latin\"}.`,\n explanation:\n \"Two @font-face rules with the same family, style and weight and no unicode-range both claim every character, so the last one silently wins and the other file is downloaded and never read.\",\n available: outcome.available,\n },\n );\n }\n if (outcome.reason === \"subset\") {\n return fail(\"SUBSET_NOT_SERVED\", `${PROVIDER_LABEL[outcome.provider]} has \"${family}\", but not in that subset.`, {\n action: `Retry with --subsets set to one it serves: ${outcome.available.join(\",\")}.`,\n explanation:\n \"A family is split into unicode subsets and not every family ships every one. The weights you asked for are fine — only the subset is wrong.\",\n available: outcome.available,\n });\n }\n if (outcome.reason === \"weight\") {\n return fail(\n \"FONT_NOT_SERVED\",\n `${PROVIDER_LABEL[outcome.provider]} has \"${family}\", but not at weight ${weights.join(\"/\")}.`,\n {\n action: `Retry with --weights set to one of these: ${outcome.available.join(\",\")}.`,\n explanation: \"The family exists; the weight you asked for is not one it ships.\",\n served: outcome.available,\n },\n );\n }\n return failUnknownFamily(family);\n}\n\n/**\n * A name no catalogue knows. `resolveBrandFaces` has already probed Google\n * weight by weight before answering `unknown-family`, so there is nothing left\n * to ask it — re-probing here just spent nine more requests to be told the same\n * thing. The usual cause is not a typo but a family that ships only as variants:\n * a client asks for \"Open Sauce\", which nothing carries, while Fontsource has\n * One, Sans and Two. Nothing can pick between those for the brand, so they go in\n * the error for a human to choose from.\n */\nasync function failUnknownFamily(family: string): Promise<never> {\n const didYouMean = suggestFamilies(family, await fontsourceCatalogue(PROVIDER_DEPS));\n return fail(\"FONT_NOT_SERVED\", `No font catalogue carries a family called \"${family}\".`, {\n action: didYouMean.length\n ? `Did you mean one of these? ${didYouMean.join(\", \")}. Retry with the exact name, and update the --font-* token in ${GLOBAL_CSS} to match whichever you pick.`\n : `Check the exact spelling, then retry. If it is a commercial typeface, add the file to ${FONTS_DIR} and write the @font-face by hand — it cannot be downloaded.`,\n explanation: `Tried ${FONT_PROVIDERS.join(\" then \")}. Family names are case- and space-sensitive in every catalogue.`,\n tried: [...FONT_PROVIDERS],\n ...(didYouMean.length ? { didYouMean } : {}),\n });\n}\n\n/** Filenames actually present in src/brand/fonts/. */\nasync function listFontFiles(): Promise<string[]> {\n try {\n const entries = await readdir(path.resolve(process.cwd(), FONTS_DIR), { withFileTypes: true });\n return entries.filter((e) => e.isFile()).map((e) => e.name);\n } catch {\n return [];\n }\n}\n\nasync function readGlobalCss(): Promise<string> {\n try {\n return await readFile(path.resolve(process.cwd(), GLOBAL_CSS), \"utf8\");\n } catch {\n return \"\";\n }\n}\n\n/**\n * Which repair this repo actually needs — the three have different consequences\n * and only one of them is `fetch`.\n *\n * Recommending `fetch` for a family a page already self-hosts is the mistake\n * `adopt` exists to prevent: it downloads a DIFFERENT foundry's build of the\n * same name, so the page that rendered correctly starts rendering something\n * else. And `--font-body: \"Open Sauce\"` on a live client is carried by no\n * catalogue at all, so `fetch` cannot even succeed — while the file sat in\n * src/brand/fonts/ the whole time.\n */\nasync function unresolvedAction(css: string, unresolved: string[]): Promise<string> {\n const { plans } = planFontAdoption(await astroSources(), unresolved);\n if (plans.length > 0) {\n const names = plans.map((p) => `\"${p.family}\"`).join(\", \");\n return `Run \\`baker brand fonts adopt\\` — ${names} is already self-hosted by ${plans[0]?.files.join(\", \")}, so it only needs moving into ${GLOBAL_CSS} to load on every page. Don't fetch it: that downloads a different build of the same face.`;\n }\n const viaFontsource = [...fontsourceFamilies(css)];\n const stranded = unresolved.filter((family) => viaFontsource.includes(family.toLowerCase()));\n if (stranded.length > 0) {\n return `Run \\`baker brand fonts fetch \"${stranded[0]}\"\\` to self-host it. Its only provider is an @fontsource import, and that package does not survive a workspace sync — the import is left pointing at nothing, which fails the build before the font check even runs.`;\n }\n return `Run \\`baker brand fonts fetch \"${unresolved[0]}\"\\` to self-host it, which writes the @font-face for you. For a face no catalogue carries, add an @font-face pointing at a file in ${FONTS_DIR}.`;\n}\n\nexport const fontsCheckCommand = defineCommand({\n meta: {\n name: \"check\",\n description:\n \"Verify the brand's fonts really exist. First: every --font-* family in src/styles/global.css must be provided by a local @font-face, or it renders as a fallback on every page — a Google @import does not provide one here, the build drops it before the page loads. Then, for families still requested from Google, ask Google what it actually serves — a weight nobody serves is silently synthesized.\",\n },\n async run() {\n const css = await readGlobalCss();\n const requests = googleFontRequests(css);\n\n // Asked first, and asked of every brand — including the ones with no Google\n // import at all. This command used to answer `selfHosted: true` for those,\n // which is the one answer that is never safe: a `--font-*` token with no\n // @font-face and no import is a family nothing hosts, and the page has been\n // rendering a fallback ever since. 56 of 60 client repos have no Google\n // import, so that was the answer almost everyone got.\n const unresolved = unresolvedBrandFamilies(css);\n if (unresolved.length > 0) {\n fail(\"FONT_NOT_LOADED\", `Nothing loads ${unresolved.map((f) => `\"${f}\"`).join(\", \")} in ${GLOBAL_CSS}.`, {\n action: await unresolvedAction(css, unresolved),\n explanation:\n \"The family is declared as a brand font but no @font-face provides it, so every page silently renders a fallback. A Google @import does not count: Astro merges component CSS ahead of global.css into one inlined <style>, so the import lands after rules and the browser drops it — measured on a live client site. The client's verify fails on this too.\",\n unresolved,\n });\n }\n\n if (requests.length === 0) {\n writeJson({\n ok: true,\n data: { families: [], selfHosted: true },\n hints: [\n `No Google Fonts requested in ${GLOBAL_CSS}, and every brand face is provided by an @font-face — nothing to verify against Google.`,\n ],\n });\n return;\n }\n\n const families = await checkFontRequests(requests, fetchGoogleCss);\n const broken = families.filter((f) => f.missing.length > 0);\n\n if (broken.length > 0) {\n const summary = broken\n .map((f) =>\n f.cause === \"unknown-family\"\n ? `${f.family} (no such family on Google Fonts — check the exact spelling)`\n : `${f.family} ${f.missing.join(\"/\")} (served: ${f.served.join(\"/\") || \"none\"})`,\n )\n .join(\"; \");\n fail(\"FONT_NOT_SERVED\", `Google Fonts does not serve: ${summary}`, {\n action: `Correct the family name or weight in ${GLOBAL_CSS} and src/brand/BRAND.md, picking from the \\`served\\` weights below.`,\n explanation:\n \"A requested weight Google does not serve is silently synthesized by the browser, so the page looks subtly wrong with nothing failing.\",\n // The per-family breakdown is the point of the command, so it ships on\n // the failure path too — otherwise the only remedy is re-running the\n // command that just failed. Healthy families are included so a\n // multi-family brand shows what NOT to touch.\n families,\n });\n }\n\n writeJson({\n ok: true,\n data: { families },\n hints: [\n \"Every requested family and weight is really served by Google.\",\n `To stop depending on Google at page load, run \\`baker brand fonts fetch \"<family>\"\\` to self-host into ${FONTS_DIR}.`,\n ],\n });\n },\n});\n\nexport const fontsFetchCommand = defineCommand({\n meta: {\n name: \"fetch\",\n description:\n \"Download a font from Google Fonts or Fontsource into src/brand/fonts/ and write its @font-face into src/styles/global.css above @theme, so the family actually loads. Use when a brand font should be self-hosted rather than requested from a third party on every page load.\",\n },\n args: {\n family: { type: \"positional\", required: true, description: 'Font family, e.g. \"DM Sans\"' },\n weights: {\n type: \"string\",\n description: \"Comma-separated weights (default: the weights global.css already requests or self-hosts, else 400)\",\n },\n subsets: {\n type: \"string\",\n description: `Comma-separated unicode subsets (default: the subsets global.css already self-hosts, else ${DEFAULT_SUBSETS_LABEL})`,\n },\n italic: {\n type: \"boolean\",\n description:\n \"Also self-host the family's italic faces (default: on when global.css already loads one, off otherwise)\",\n },\n },\n async run({ args }) {\n const family = String(args.family).trim();\n if (!family) fail(\"INVALID_FAMILY\", 'Pass a font family, e.g. `baker brand fonts fetch \"DM Sans\"`.');\n\n const css = await readGlobalCss();\n const declared = googleFontRequests(css).find((r) => r.family.toLowerCase() === family.toLowerCase());\n // Self-hosted weights count as \"already requested\". Once the first fetch\n // has been done and the Google @import removed — which the hints tell the\n // agent to do — the stylesheet's own @font-face rules are the only surviving\n // record of which weights this brand uses.\n const provided = declared?.weights.length ? declared.weights : selfHostedWeights(css, family);\n const weights = resolveFetchWeights(args.weights, provided);\n if (weights.length === 0) {\n fail(\"INVALID_WEIGHTS\", `\"${args.weights}\" has no usable weight — pass whole hundreds, e.g. --weights 400,700.`);\n }\n\n // Self-hosted subsets count the same way self-hosted weights do above. The\n // family's rules are REPLACED, so defaulting a re-run to latin deleted the\n // latin-ext face an earlier `--subsets latin,latin-ext` downloaded and\n // orphaned its file — nothing fails, the family stays resolved, and every\n // accented character quietly falls back.\n const wanted = new Set(resolveFetchSubsets(args.subsets, selfHostedSubsets(css, family)));\n // An italic already in the stylesheet turns this on by itself. `fetch` has\n // no `--no-italic`, so the family can only ever gain its italic here, never\n // lose one to a flag nobody passed.\n const styles = resolveFetchStyles(args.italic, selfHostedStyles(css, family));\n\n const resolved = await resolveBrandFaces(family, weights, [...wanted], PROVIDER_DEPS, styles);\n if (!resolved.ok) return failResolution(family, weights, resolved);\n const faces = resolved.faces;\n\n const fontsDir = path.resolve(process.cwd(), FONTS_DIR);\n await mkdir(fontsDir, { recursive: true });\n\n // Only faces whose file really landed may appear in the @font-face block —\n // a rule pointing at a file that failed to download is exactly the silent\n // fallback this command exists to prevent.\n const downloaded: BrandFontFace[] = [];\n for (const face of faces) {\n const res = await fetch(face.url, {\n headers: { \"User-Agent\": BROWSER_UA },\n signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),\n });\n if (!res.ok) continue;\n await writeFile(path.join(fontsDir, fontFileName(face)), Buffer.from(await res.arrayBuffer()));\n downloaded.push(face);\n }\n const written = downloaded.map(fontFileName);\n\n if (written.length === 0) {\n fail(\"DOWNLOAD_FAILED\", `Could not download any file for \"${family}\".`, {\n action: \"Retry; if it keeps failing, keep the Google @import and note it in BRAND.md.\",\n explanation: \"The font stylesheet resolved but the font files themselves did not download.\",\n });\n }\n\n const fontFace = renderFontFaceCss(downloaded);\n const downloadedWeights = [...new Set(downloaded.map((f) => f.weight))].sort((a, b) => a - b);\n const downloadedStyles = [...new Set(downloaded.map((f) => f.style))].sort();\n const incomplete = weights.filter((w) => !downloadedWeights.includes(w));\n\n // Wire the face up here rather than handing back a block to paste. The\n // download above is a real side effect, so a skipped paste left the repo\n // with the files on disk and nothing loading them — a state that looks done,\n // renders as a fallback, and only surfaces when the client's verify fails.\n const wiring = await wireFontFaceIntoStylesheet(css, family, fontFace);\n\n writeJson({\n ok: true,\n data: {\n family,\n provider: resolved.provider,\n weights: downloadedWeights,\n styles: downloadedStyles,\n files: written,\n fontFace,\n stylesheet: wiring,\n },\n hints: fetchHints({\n family,\n downloadedWeights,\n downloadedStyles,\n incomplete,\n wiring,\n provider: resolved.provider,\n wantedStyles: styles,\n availableStyles: resolved.availableStyles,\n }),\n });\n },\n});\n\n/** Every `.astro` under src/, so a face declared in any page or component is found. */\nasync function astroSources(): Promise<{ path: string; source: string }[]> {\n const out: { path: string; source: string }[] = [];\n let entries: Dirent[];\n try {\n entries = await readdir(\"src\", { recursive: true, withFileTypes: true });\n } catch {\n return out;\n }\n for (const entry of entries) {\n if (!entry.isFile() || !entry.name.endsWith(\".astro\")) continue;\n const file = path.posix.join(entry.parentPath ?? \"src\", entry.name);\n try {\n out.push({ path: file, source: await readFile(file, \"utf8\") });\n } catch {\n // A file that cannot be read is a file this command leaves alone.\n }\n }\n return out;\n}\n\nexport const fontsAdoptCommand = defineCommand({\n meta: {\n name: \"adopt\",\n description:\n \"Move brand faces a page already self-hosts into src/styles/global.css, so every page loads them instead of just that one. Use when `check` reports a family as not loaded but the font files are already in src/brand/fonts/ — downloading it again would hand that page a different build of the same face.\",\n },\n async run() {\n const css = await readGlobalCss();\n if (!css) fail(\"NO_STYLESHEET\", `There is no ${GLOBAL_CSS} to adopt faces into.`);\n\n const unresolved = unresolvedBrandFamilies(css);\n if (unresolved.length === 0) {\n writeJson({\n ok: true,\n data: { adopted: [], conflicts: [] },\n hints: [`Every --font-* family in ${GLOBAL_CSS} is already loaded by it — nothing to adopt.`],\n });\n return;\n }\n\n const { plans, conflicts } = planFontAdoption(await astroSources(), unresolved);\n const available = new Set(await listFontFiles());\n const adopted: { family: string; files: string[]; weights: string[] }[] = [];\n const skipped: { family: string; reason: string }[] = [];\n let next = css;\n\n for (const plan of plans) {\n // A rule pointing at a file that is not there is the same silent fallback\n // this command exists to remove, so the whole family is left alone.\n const missing = missingFontFiles(plan.urls, available);\n if (missing.length > 0) {\n skipped.push({ family: plan.family, reason: `${missing.join(\", \")} is not in ${FONTS_DIR}` });\n continue;\n }\n next = upsertFontFaceCss(next, plan.family, plan.blocks.join(\"\\n\"));\n adopted.push({\n family: plan.family,\n files: plan.files,\n weights: plan.blocks.map((b) => b.match(/font-weight\\s*:\\s*([^;]+)/i)?.[1]?.trim() ?? \"400\"),\n });\n }\n\n if (adopted.length === 0) {\n // Three different facts used to share one sentence. \"No page declares it\"\n // is false whenever a plan was skipped or conflicted — a page declares it\n // fine — and the `fetch` it recommended downloads the very substitute\n // build this command exists to avoid. Say which one actually happened.\n if (conflicts.length > 0) {\n fail(\n \"ADOPTION_CONFLICT\",\n `${conflicts.map((c) => `\"${c.family}\" is declared differently in ${c.files.join(\" and \")}`).join(\"; \")}.`,\n {\n action:\n \"Make the declarations match — same weights, same files — then re-run. Pick the one whose page renders correctly.\",\n explanation:\n \"One global scope holds one mapping per family, so adopting would silently repaint whichever page lost.\",\n conflicts,\n },\n );\n }\n if (skipped.length > 0) {\n fail(\"FONT_FILE_MISSING\", `${skipped.map((s) => `${s.family} — ${s.reason}`).join(\"; \")}.`, {\n action: `Add the missing file to ${FONTS_DIR}, or fix the src: url() in the page that declares it, then re-run.`,\n explanation:\n \"The page declares the face but points at a file that is not in the repo, so the rule renders as a fallback. Moving it into the stylesheet would spread that fallback to every page.\",\n skipped,\n });\n }\n fail(\"NOTHING_TO_ADOPT\", `No page declares a face for ${unresolved.map((f) => `\"${f}\"`).join(\", \")}.`, {\n action: `Self-host it instead: \\`baker brand fonts fetch \"${unresolved[0]}\"\\`.`,\n explanation: \"Adopting only moves faces the repo already ships; it never downloads one.\",\n });\n }\n\n await writeFile(path.resolve(process.cwd(), GLOBAL_CSS), next);\n for (const plan of plans.filter((p) => adopted.some((a) => a.family === p.family))) {\n for (const file of plan.files) {\n const source = await readFile(file, \"utf8\");\n await writeFile(file, stripFontFaceBlocks(source, plan.family));\n }\n }\n\n writeJson({\n ok: true,\n data: { adopted, conflicts, skipped },\n hints: [\n `Moved ${adopted.map((a) => `\"${a.family}\" (${a.weights.join(\"/\")})`).join(\", \")} into ${GLOBAL_CSS} and removed the page copies, so every page loads them — not just the one that declared them.`,\n ...(conflicts.length > 0\n ? [\n `CONFLICT: ${conflicts.map((c) => `\"${c.family}\" is declared differently in ${c.files.join(\" and \")}`).join(\"; \")}. One global scope can hold only one mapping, so pick which files the family should use and make the declarations match before re-running.`,\n ]\n : []),\n ...(skipped.length > 0 ? [`SKIPPED: ${skipped.map((s) => `${s.family} — ${s.reason}`).join(\"; \")}.`] : []),\n `Run \\`baker brand fonts check\\` to confirm nothing is left unresolved.`,\n ],\n });\n },\n});\n\nexport const fontsCommand = defineCommand({\n meta: {\n name: \"fonts\",\n description: `Verify and self-host the brand's typefaces.\n\nStart here: \\`baker brand fonts check\\` — confirms the fonts the brand claims really load.\n\nSubcommands:\n baker brand fonts check — fail if any --font-* family has nothing loading it, then ask Google what it actually serves for the ones global.css requests\n baker brand fonts fetch <family> — download a family into src/brand/fonts/ and wire its @font-face into src/styles/global.css\n baker brand fonts adopt — move faces a page already self-hosts into global.css, so every page loads them. Try this BEFORE fetch when the font files are already in src/brand/fonts/`,\n },\n subCommands: {\n check: fontsCheckCommand,\n fetch: fontsFetchCommand,\n adopt: fontsAdoptCommand,\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,OAAO,SAAS,UAAU,iBAAiB;AACpD,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAiC9B,IAAM,aAAa,KAAK,KAAK,OAAO,UAAU,YAAY;AAC1D,IAAM,YAAY,KAAK,KAAK,OAAO,SAAS,OAAO;AACnD,IAAM,wBAAwB,gBAAgB,KAAK,GAAG;AAItD,IAAM,aAAa;AAEnB,eAAe;AAAA,EACb,SAAS;AAAA,EACT,aACE;AAAA,EACF,MAAM,CAAC;AACT,CAAC;AAED,eAAe;AAAA,EACb,SAAS;AAAA,EACT,aACE;AAAA,EACF,MAAM,CAAC;AACT,CAAC;AAED,eAAe;AAAA,EACb,SAAS;AAAA,EACT,aACE;AAAA,EACF,MAAM;AAAA,IACJ,QAAQ,EAAE,MAAM,UAAU,aAAa,+BAA+B,UAAU,KAAK;AAAA,IACrF,SAAS;AAAA,MACP,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,IACA,SAAS;AAAA,MACP,MAAM;AAAA,MACN,aAAa,6FAA6F,qBAAqB;AAAA,MAC/H,UAAU;AAAA,IACZ;AAAA,IACA,QAAQ;AAAA,MACN,MAAM;AAAA,MACN,aACE;AAAA,MACF,UAAU;AAAA,IACZ;AAAA,EACF;AACF,CAAC;AAED,SAAS,KACP,MACA,SACA,KACO;AACP,YAAU,EAAE,IAAI,OAAO,OAAO,EAAE,MAAM,SAAS,GAAI,MAAM,EAAE,IAAI,IAAI,CAAC,EAAG,EAAE,CAAC;AAC1E,UAAQ,KAAK,CAAC;AAChB;AAIA,IAAM,qBAAqB;AAY3B,eAAsB,UAAU,KAA+B;AAC7D,QAAM,MAAM,MAAM,MAAM,KAAK;AAAA,IAC3B,SAAS,EAAE,cAAc,WA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|
+
JEV_MODEL,
|
|
3
|
+
askJev
|
|
4
|
+
} from "./chunk-MGKHFGLV.js";
|
|
5
|
+
|
|
6
|
+
// src/engine/lib/remembered-nouls.ts
|
|
7
|
+
import { createHash } from "crypto";
|
|
8
|
+
import { readFile } from "fs/promises";
|
|
9
|
+
|
|
10
|
+
// src/engine/lib/file-lock.ts
|
|
11
|
+
import { randomUUID } from "crypto";
|
|
12
|
+
import { mkdir, rename, rm, stat, writeFile } from "fs/promises";
|
|
13
|
+
import path from "path";
|
|
14
|
+
var LOCK_STALE_MS = 1e4;
|
|
15
|
+
var LOCK_WAIT_MS = 20;
|
|
16
|
+
async function updateLockedFile(file, change) {
|
|
17
|
+
await mkdir(path.dirname(file), { recursive: true });
|
|
18
|
+
const lock = `${file}.lock`;
|
|
19
|
+
await acquireLock(lock);
|
|
20
|
+
try {
|
|
21
|
+
const temp = `${file}.${process.pid}.${randomUUID()}.tmp`;
|
|
22
|
+
await writeFile(temp, await change(), "utf8");
|
|
23
|
+
await rename(temp, file);
|
|
24
|
+
} finally {
|
|
25
|
+
await rm(lock, { force: true });
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
async function acquireLock(lock) {
|
|
29
|
+
for (; ; ) {
|
|
30
|
+
try {
|
|
31
|
+
await writeFile(lock, String(process.pid), { flag: "wx" });
|
|
32
|
+
return;
|
|
33
|
+
} catch (e) {
|
|
34
|
+
if (e.code !== "EEXIST") throw e;
|
|
35
|
+
}
|
|
36
|
+
const held = await stat(lock).catch(() => null);
|
|
37
|
+
if (held && Date.now() - held.mtimeMs > LOCK_STALE_MS) await rm(lock, { force: true });
|
|
38
|
+
await new Promise((resolve) => setTimeout(resolve, LOCK_WAIT_MS));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// src/engine/lib/remembered-nouls.ts
|
|
43
|
+
var PER_REQUEST = 200;
|
|
44
|
+
var MAX_REMEMBERED = 2e4;
|
|
45
|
+
function keyOf(question) {
|
|
46
|
+
return createHash("sha256").update(JSON.stringify([JEV_MODEL, question.instructions])).digest("hex").slice(0, 32);
|
|
47
|
+
}
|
|
48
|
+
async function remembered(file) {
|
|
49
|
+
const parsed = await readFile(file, "utf8").then(JSON.parse, () => ({}));
|
|
50
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed)) return {};
|
|
51
|
+
return Object.fromEntries(
|
|
52
|
+
Object.entries(parsed).filter((e) => typeof e[1] === "number")
|
|
53
|
+
);
|
|
54
|
+
}
|
|
55
|
+
async function rememberedNouls(questions, opts) {
|
|
56
|
+
if (questions.length === 0) return [];
|
|
57
|
+
const keys = questions.map(keyOf);
|
|
58
|
+
const known = opts.file ? await remembered(opts.file) : {};
|
|
59
|
+
const missing = [...new Set(keys.filter((k) => known[k] === void 0))];
|
|
60
|
+
const byKey = new Map(questions.map((q, i) => [keys[i], q]));
|
|
61
|
+
const batches = [];
|
|
62
|
+
for (let i = 0; i < missing.length; i += PER_REQUEST) batches.push(missing.slice(i, i + PER_REQUEST));
|
|
63
|
+
const answered = await Promise.all(
|
|
64
|
+
batches.map((batch) => opts.ask(batch.flatMap((k) => byKey.get(k) ?? [])).catch(() => null))
|
|
65
|
+
);
|
|
66
|
+
if (answered.some((a) => a === null || a.length === 0)) return null;
|
|
67
|
+
const fresh = {};
|
|
68
|
+
batches.forEach((batch, b) => {
|
|
69
|
+
batch.forEach((k, i) => {
|
|
70
|
+
const answer = answered[b]?.[i];
|
|
71
|
+
if (answer !== void 0) fresh[k] = answer;
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
const all = { ...known, ...fresh };
|
|
75
|
+
const file = opts.file;
|
|
76
|
+
if (file && missing.length > 0) {
|
|
77
|
+
await updateLockedFile(file, async () => {
|
|
78
|
+
const kept = Object.entries({ ...await remembered(file), ...fresh }).slice(-MAX_REMEMBERED);
|
|
79
|
+
return JSON.stringify(Object.fromEntries(kept));
|
|
80
|
+
}).catch(() => void 0);
|
|
81
|
+
}
|
|
82
|
+
const answers = keys.map((k) => all[k]);
|
|
83
|
+
return answers.every((a) => a !== void 0) ? answers : null;
|
|
84
|
+
}
|
|
85
|
+
function jevAsker(onSpend) {
|
|
86
|
+
return (questions) => askJev(questions, onSpend);
|
|
87
|
+
}
|
|
88
|
+
function rememberedJev(file, onSpend) {
|
|
89
|
+
const ask = jevAsker(onSpend);
|
|
90
|
+
return (questions) => rememberedNouls(questions, { ask, file });
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export {
|
|
94
|
+
updateLockedFile,
|
|
95
|
+
rememberedJev
|
|
96
|
+
};
|
|
97
|
+
//# sourceMappingURL=chunk-I3DIZWN5.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/engine/lib/remembered-nouls.ts","../src/engine/lib/file-lock.ts"],"sourcesContent":["/**\n * Yes/no answers from the decision model (Jev, `askJev`), asked in batches and remembered by\n * question, so the same text asked the same question gets the same answer on every run. A gate\n * that counts findings (the landing critique's block count, an idea's warnings) must not flip\n * because Jev answered 0.69 one run and 0.71 the next.\n */\nimport { createHash } from \"node:crypto\";\nimport { readFile } from \"node:fs/promises\";\nimport { askJev, JEV_MODEL } from \"../nodes/local/lib/jev.ts\";\nimport type { ReviewUsage } from \"../nodes/local/lib/render-review.ts\";\nimport { updateLockedFile } from \"./file-lock.ts\";\n\nexport type NoulQuestion = { instructions: Record<string, string> };\n/** Each question's probability, in order, or null when no answer came back. */\nexport type AskNouls = (questions: readonly NoulQuestion[]) => Promise<number[] | null>;\n\n/** Several hundred fit in one request at the same latency; this keeps each well inside Jev's context. */\nconst PER_REQUEST = 200;\n/** The file never grows past this many answers; the oldest are dropped first. */\nconst MAX_REMEMBERED = 20_000;\n\nfunction keyOf(question: NoulQuestion): string {\n return createHash(\"sha256\")\n .update(JSON.stringify([JEV_MODEL, question.instructions]))\n .digest(\"hex\")\n .slice(0, 32);\n}\n\nasync function remembered(file: string): Promise<Record<string, number>> {\n const parsed: unknown = await readFile(file, \"utf8\").then(JSON.parse, () => ({}));\n if (!parsed || typeof parsed !== \"object\" || Array.isArray(parsed)) return {};\n return Object.fromEntries(\n Object.entries(parsed as Record<string, unknown>).filter((e): e is [string, number] => typeof e[1] === \"number\"),\n );\n}\n\n/**\n * The probability each statement is true, in order: from `file` when asked before, else from\n * `ask`, in requests of `PER_REQUEST` sent at once. Null when any request failed, so the caller\n * takes its fallback for the whole decision rather than half of it. Never throws.\n */\nexport async function rememberedNouls(\n questions: readonly NoulQuestion[],\n opts: { ask: AskNouls; file?: string },\n): Promise<number[] | null> {\n if (questions.length === 0) return [];\n const keys = questions.map(keyOf);\n const known = opts.file ? await remembered(opts.file) : {};\n const missing = [...new Set(keys.filter((k) => known[k] === undefined))];\n const byKey = new Map(questions.map((q, i) => [keys[i], q]));\n const batches: string[][] = [];\n for (let i = 0; i < missing.length; i += PER_REQUEST) batches.push(missing.slice(i, i + PER_REQUEST));\n const answered = await Promise.all(\n batches.map((batch) => opts.ask(batch.flatMap((k) => byKey.get(k) ?? [])).catch(() => null)),\n );\n if (answered.some((a) => a === null || a.length === 0)) return null;\n const fresh: Record<string, number> = {};\n batches.forEach((batch, b) => {\n batch.forEach((k, i) => {\n const answer = answered[b]?.[i];\n if (answer !== undefined) fresh[k] = answer;\n });\n });\n const all = { ...known, ...fresh };\n const file = opts.file;\n if (file && missing.length > 0) {\n // Read again under the lock: another caller sharing the file may have written its answers since.\n await updateLockedFile(file, async () => {\n const kept = Object.entries({ ...(await remembered(file)), ...fresh }).slice(-MAX_REMEMBERED);\n return JSON.stringify(Object.fromEntries(kept));\n }).catch(() => undefined);\n }\n const answers = keys.map((k) => all[k]);\n return answers.every((a): a is number => a !== undefined) ? answers : null;\n}\n\n/** The real decision model, its spend reported to `onSpend`. */\nexport function jevAsker(onSpend?: (usage: ReviewUsage) => void): AskNouls {\n return (questions) => askJev(questions, onSpend);\n}\n\n/** The real decision model behind the answers kept in `file`: what every CLI caller asks through. */\nexport function rememberedJev(file: string, onSpend?: (usage: ReviewUsage) => void): AskNouls {\n const ask = jevAsker(onSpend);\n return (questions) => rememberedNouls(questions, { ask, file });\n}\n","/**\n * Change a JSON file that several processes (or several calls in one) update at once: read,\n * change and write it whole under a lock file, through a temp file renamed into place, so no\n * writer erases another's entries and no reader sees half a file.\n */\nimport { randomUUID } from \"node:crypto\";\nimport { mkdir, rename, rm, stat, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\n\nconst LOCK_STALE_MS = 10_000;\nconst LOCK_WAIT_MS = 20;\n\n/** Run `change` with `file` locked, and write what it returns as the file's whole new content. */\nexport async function updateLockedFile(file: string, change: () => Promise<string>): Promise<void> {\n await mkdir(path.dirname(file), { recursive: true });\n const lock = `${file}.lock`;\n await acquireLock(lock);\n try {\n const temp = `${file}.${process.pid}.${randomUUID()}.tmp`;\n await writeFile(temp, await change(), \"utf8\");\n await rename(temp, file);\n } finally {\n await rm(lock, { force: true });\n }\n}\n\nasync function acquireLock(lock: string): Promise<void> {\n for (;;) {\n try {\n await writeFile(lock, String(process.pid), { flag: \"wx\" });\n return;\n } catch (e) {\n if ((e as NodeJS.ErrnoException).code !== \"EEXIST\") throw e;\n }\n // A process that died holding the lock leaves it behind: a lock this old is no one's.\n const held = await stat(lock).catch(() => null);\n if (held && Date.now() - held.mtimeMs > LOCK_STALE_MS) await rm(lock, { force: true });\n await new Promise((resolve) => setTimeout(resolve, LOCK_WAIT_MS));\n }\n}\n"],"mappings":";;;;;;AAMA,SAAS,kBAAkB;AAC3B,SAAS,gBAAgB;;;ACFzB,SAAS,kBAAkB;AAC3B,SAAS,OAAO,QAAQ,IAAI,MAAM,iBAAiB;AACnD,OAAO,UAAU;AAEjB,IAAM,gBAAgB;AACtB,IAAM,eAAe;AAGrB,eAAsB,iBAAiB,MAAc,QAA8C;AACjG,QAAM,MAAM,KAAK,QAAQ,IAAI,GAAG,EAAE,WAAW,KAAK,CAAC;AACnD,QAAM,OAAO,GAAG,IAAI;AACpB,QAAM,YAAY,IAAI;AACtB,MAAI;AAC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K,UAAU,OAAO,YAAY,IAAI,CAAC;AAAA,IAChD,CAAC,EAAE,MAAM,MAAM,MAAS;AAAA,EAC1B;AACA,QAAM,UAAU,KAAK,IAAI,CAAC,MAAM,IAAI,CAAC,CAAC;AACtC,SAAO,QAAQ,MAAM,CAAC,MAAmB,MAAM,MAAS,IAAI,UAAU;AACxE;AAGO,SAAS,SAAS,SAAkD;AACzE,SAAO,CAAC,cAAc,OAAO,WAAW,OAAO;AACjD;AAGO,SAAS,cAAc,MAAc,SAAkD;AAC5F,QAAM,MAAM,SAAS,OAAO;AAC5B,SAAO,CAAC,cAAc,gBAAgB,WAAW,EAAE,KAAK,KAAK,CAAC;AAChE;","names":[]}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
// src/commands/avatars/profile.ts
|
|
2
|
+
var TEXT_FIELDS = [
|
|
3
|
+
["subject", "subjectDescription"],
|
|
4
|
+
["persona", "persona"],
|
|
5
|
+
["speech", "speech"],
|
|
6
|
+
["accent", "accent"],
|
|
7
|
+
["motion", "motion"],
|
|
8
|
+
["wardrobe", "wardrobe"],
|
|
9
|
+
["setting", "setting"]
|
|
10
|
+
];
|
|
11
|
+
function parseGuardrails(value) {
|
|
12
|
+
if (typeof value !== "string") {
|
|
13
|
+
return void 0;
|
|
14
|
+
}
|
|
15
|
+
return [
|
|
16
|
+
...new Set(
|
|
17
|
+
value.split(",").map((rule) => rule.trim()).filter((rule) => rule.length > 0)
|
|
18
|
+
)
|
|
19
|
+
];
|
|
20
|
+
}
|
|
21
|
+
function buildProfilePatch(args) {
|
|
22
|
+
const patch = {};
|
|
23
|
+
for (const [flag, field] of TEXT_FIELDS) {
|
|
24
|
+
const value = args[flag];
|
|
25
|
+
if (typeof value === "string") {
|
|
26
|
+
Object.assign(patch, { [field]: value.trim() });
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const guardrails = parseGuardrails(args.guardrails);
|
|
30
|
+
if (guardrails) {
|
|
31
|
+
patch.guardrails = guardrails;
|
|
32
|
+
}
|
|
33
|
+
return patch;
|
|
34
|
+
}
|
|
35
|
+
function hasProfileEdit(patch) {
|
|
36
|
+
return Object.keys(patch).length > 0;
|
|
37
|
+
}
|
|
38
|
+
function mergeProfile(current, patch) {
|
|
39
|
+
const merged = { ...current };
|
|
40
|
+
for (const [key, value] of Object.entries(patch)) {
|
|
41
|
+
if (value.length === 0) {
|
|
42
|
+
if (key !== "subjectDescription") {
|
|
43
|
+
delete merged[key];
|
|
44
|
+
}
|
|
45
|
+
continue;
|
|
46
|
+
}
|
|
47
|
+
Object.assign(merged, { [key]: value });
|
|
48
|
+
}
|
|
49
|
+
return merged;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
buildProfilePatch,
|
|
54
|
+
hasProfileEdit,
|
|
55
|
+
mergeProfile
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=chunk-IJMWEO4P.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/avatars/profile.ts"],"sourcesContent":["import type { AvatarProfile } from \"@baker/api\";\n\n/**\n * A partial edit of an avatar's written profile.\n *\n * `update` sends the profile whole — the backend replaces it rather than\n * merging — so an agent that passes `--persona` alone would wipe the subject\n * description, which is the one field the identity depends on. The CLI reads\n * the stored profile first and merges this patch over it.\n */\nexport type AvatarProfilePatch = Partial<AvatarProfile>;\n\n/** Written-profile flags, in the order they read on the command line. */\nexport const PROFILE_FLAGS = [\n \"subject\",\n \"persona\",\n \"speech\",\n \"accent\",\n \"motion\",\n \"wardrobe\",\n \"setting\",\n \"guardrails\",\n] as const;\n\ntype AvatarProfileTextField = Exclude<keyof AvatarProfile, \"guardrails\">;\n\nconst TEXT_FIELDS: ReadonlyArray<[flag: string, field: AvatarProfileTextField]> = [\n [\"subject\", \"subjectDescription\"],\n [\"persona\", \"persona\"],\n [\"speech\", \"speech\"],\n [\"accent\", \"accent\"],\n [\"motion\", \"motion\"],\n [\"wardrobe\", \"wardrobe\"],\n [\"setting\", \"setting\"],\n];\n\n/**\n * Split a `--guardrails \"never a, never b\"` flag into single rules.\n *\n * Returns undefined when the flag was omitted so the caller can tell \"leave the\n * stored rules alone\" from \"clear them\" (an empty string).\n */\nexport function parseGuardrails(value: unknown): string[] | undefined {\n if (typeof value !== \"string\") {\n return undefined;\n }\n return [\n ...new Set(\n value\n .split(\",\")\n .map((rule) => rule.trim())\n .filter((rule) => rule.length > 0),\n ),\n ];\n}\n\n/** Read the profile flags a caller actually passed. Omitted flags stay absent. */\nexport function buildProfilePatch(args: Record<string, unknown>): AvatarProfilePatch {\n const patch: AvatarProfilePatch = {};\n for (const [flag, field] of TEXT_FIELDS) {\n const value = args[flag];\n if (typeof value === \"string\") {\n Object.assign(patch, { [field]: value.trim() });\n }\n }\n const guardrails = parseGuardrails(args.guardrails);\n if (guardrails) {\n patch.guardrails = guardrails;\n }\n return patch;\n}\n\nexport function hasProfileEdit(patch: AvatarProfilePatch): boolean {\n return Object.keys(patch).length > 0;\n}\n\n/**\n * Merge a patch over the stored profile. An empty value clears the field it\n * names — except `subjectDescription`, which the identity sheet was fused from\n * and can only ever be replaced, never removed (`update` rejects the empty\n * flag outright, so this is the second line of defence).\n */\nexport function mergeProfile(current: AvatarProfile, patch: AvatarProfilePatch): AvatarProfile {\n const merged: AvatarProfile = { ...current };\n for (const [key, value] of Object.entries(patch) as [keyof AvatarProfile, string | string[]][]) {\n if (value.length === 0) {\n if (key !== \"subjectDescription\") {\n delete merged[key];\n }\n continue;\n }\n Object.assign(merged, { [key]: value });\n }\n return merged;\n}\n"],"mappings":";AA0BA,IAAM,cAA4E;AAAA,EAChF,CAAC,WAAW,oBAAoB;AAAA,EAChC,CAAC,WAAW,SAAS;AAAA,EACrB,CAAC,UAAU,QAAQ;AAAA,EACnB,CAAC,UAAU,QAAQ;AAAA,EACnB,CAAC,UAAU,QAAQ;AAAA,EACnB,CAAC,YAAY,UAAU;AAAA,EACvB,CAAC,WAAW,SAAS;AACvB;AAQO,SAAS,gBAAgB,OAAsC;AACpE,MAAI,OAAO,UAAU,UAAU;AAC7B,WAAO;AAAA,EACT;AACA,SAAO;AAAA,IACL,GAAG,IAAI;AAAA,MACL,MACG,MAAM,GAAG,EACT,IAAI,CAAC,SAAS,KAAK,KAAK,CAAC,EACzB,OAAO,CAAC,SAAS,KAAK,SAAS,CAAC;AAAA,IACrC;AAAA,EACF;AACF;AAGO,SAAS,kBAAkB,MAAmD;AACnF,QAAM,QAA4B,CAAC;AACnC,aAAW,CAAC,MAAM,KAAK,KAAK,aAAa;AACvC,UAAM,QAAQ,KAAK,IAAI;AACvB,QAAI,OAAO,UAAU,UAAU;AAC7B,aAAO,OAAO,OAAO,EAAE,CAAC,KAAK,GAAG,MAAM,KAAK,EAAE,CAAC;AAAA,IAChD;AAAA,EACF;AACA,QAAM,aAAa,gBAAgB,KAAK,UAAU;AAClD,MAAI,YAAY;AACd,UAAM,aAAa;AAAA,EACrB;AACA,SAAO;AACT;AAEO,SAAS,eAAe,OAAoC;AACjE,SAAO,OAAO,KAAK,KAAK,EAAE,SAAS;AACrC;AAQO,SAAS,aAAa,SAAwB,OAA0C;AAC7F,QAAM,SAAwB,EAAE,GAAG,QAAQ;AAC3C,aAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,KAAK,GAAiD;AAC9F,QAAI,MAAM,WAAW,GAAG;AACtB,UAAI,QAAQ,sBAAsB;AAChC,eAAO,OAAO,GAAG;AAAA,MACnB;AACA;AAAA,IACF;AACA,WAAO,OAAO,QAAQ,EAAE,CAAC,GAAG,GAAG,MAAM,CAAC;AAAA,EACxC;AACA,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import {
|
|
2
|
+
nodeParamsPreview
|
|
3
|
+
} from "./chunk-NHU33T2S.js";
|
|
4
|
+
import {
|
|
5
|
+
creativeSlugFromCanvasPath,
|
|
6
|
+
parseDefinitionSeriesPlace,
|
|
7
|
+
parseDefinitionSourceFields,
|
|
8
|
+
parseDefinitionStrategyFields
|
|
9
|
+
} from "./chunk-RRIAHUWP.js";
|
|
10
|
+
import {
|
|
11
|
+
prepareCanvas
|
|
12
|
+
} from "./chunk-QKE7GXZ7.js";
|
|
13
|
+
import {
|
|
14
|
+
BackendClient
|
|
15
|
+
} from "./chunk-KZUHRZ2C.js";
|
|
16
|
+
import {
|
|
17
|
+
nodeDependencies
|
|
18
|
+
} from "./chunk-66USKCVY.js";
|
|
19
|
+
import {
|
|
20
|
+
requireCredentialsFromEnv
|
|
21
|
+
} from "./chunk-U7BBXM67.js";
|
|
22
|
+
|
|
23
|
+
// src/commands/canvas/sync-definition.ts
|
|
24
|
+
import { readdir, readFile, stat } from "fs/promises";
|
|
25
|
+
import path from "path";
|
|
26
|
+
import { parseDocument } from "yaml";
|
|
27
|
+
import { defineCommand } from "citty";
|
|
28
|
+
|
|
29
|
+
// src/commands/canvas/definition-graph.ts
|
|
30
|
+
var MAX_NODES = 300;
|
|
31
|
+
var PREVIEWABLE_INGEST_EXPECTS = /* @__PURE__ */ new Set(["image"]);
|
|
32
|
+
function nodeInputPreviewUrl(type, params) {
|
|
33
|
+
if (type !== "ingest" || !params || typeof params !== "object") return void 0;
|
|
34
|
+
const p = params;
|
|
35
|
+
if (p.source !== "url" || typeof p.url !== "string") return void 0;
|
|
36
|
+
if (!/^https?:\/\//i.test(p.url)) return void 0;
|
|
37
|
+
if (typeof p.expect === "string" && !PREVIEWABLE_INGEST_EXPECTS.has(p.expect)) return void 0;
|
|
38
|
+
return p.url;
|
|
39
|
+
}
|
|
40
|
+
function canvasToDefinitionGraph(canvas) {
|
|
41
|
+
const rawNodes = canvas?.nodes;
|
|
42
|
+
if (!Array.isArray(rawNodes)) return null;
|
|
43
|
+
const parsed = [];
|
|
44
|
+
for (const raw of rawNodes) {
|
|
45
|
+
const id = raw?.id;
|
|
46
|
+
const type = raw?.type;
|
|
47
|
+
if (typeof id !== "string" || typeof type !== "string") continue;
|
|
48
|
+
parsed.push({ id, type, inputs: raw.inputs, params: raw.params });
|
|
49
|
+
if (parsed.length >= MAX_NODES) break;
|
|
50
|
+
}
|
|
51
|
+
if (parsed.length === 0) return null;
|
|
52
|
+
const ids = new Set(parsed.map((n) => n.id));
|
|
53
|
+
const nodes = parsed.map(({ id, type, inputs, params }) => {
|
|
54
|
+
const deps = nodeDependencies({ id, inputs, params }, ids);
|
|
55
|
+
deps.delete(id);
|
|
56
|
+
const depList = [...deps];
|
|
57
|
+
const paramsPreview = nodeParamsPreview(params, depList);
|
|
58
|
+
const base = { id, type };
|
|
59
|
+
if (depList.length > 0) base.deps = depList;
|
|
60
|
+
if (paramsPreview) base.paramsPreview = paramsPreview;
|
|
61
|
+
const inputPreviewUrl = nodeInputPreviewUrl(type, params);
|
|
62
|
+
if (inputPreviewUrl) base.inputPreviewUrl = inputPreviewUrl;
|
|
63
|
+
return base;
|
|
64
|
+
});
|
|
65
|
+
const rawOutput = canvas?.output;
|
|
66
|
+
const outNode = rawOutput?.node;
|
|
67
|
+
const outSlot = rawOutput?.output;
|
|
68
|
+
const output = typeof outNode === "string" && typeof outSlot === "string" ? { node: outNode, output: outSlot } : void 0;
|
|
69
|
+
return { nodes, output };
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
// src/commands/canvas/sync-definition.ts
|
|
73
|
+
function buildDefinitionSyncPayload(input, graph, chatId) {
|
|
74
|
+
const { canvas: _canvas, ...fields } = input;
|
|
75
|
+
return Object.fromEntries([
|
|
76
|
+
...Object.entries(fields).filter(([, v]) => v !== void 0),
|
|
77
|
+
["graph", graph],
|
|
78
|
+
["chatId", chatId]
|
|
79
|
+
]);
|
|
80
|
+
}
|
|
81
|
+
async function readDefinitionSourceFields(canvasPath) {
|
|
82
|
+
try {
|
|
83
|
+
return parseDefinitionSourceFields(await readFile(path.join(path.dirname(canvasPath), "_definition.md"), "utf8"));
|
|
84
|
+
} catch {
|
|
85
|
+
return {};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
async function readDefinitionTitle(canvasPath) {
|
|
89
|
+
try {
|
|
90
|
+
const raw = await readFile(path.join(path.dirname(canvasPath), "_definition.md"), "utf8");
|
|
91
|
+
const match = raw.match(/^---\r?\n([\s\S]*?\r?\n)?---/);
|
|
92
|
+
const doc = match ? parseDocument(match[1] ?? "") : null;
|
|
93
|
+
const title = doc && doc.errors.length === 0 ? doc.get("title") : void 0;
|
|
94
|
+
return typeof title === "string" && title.trim() ? title.trim() : void 0;
|
|
95
|
+
} catch {
|
|
96
|
+
return void 0;
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
async function readDefinitionStrategyFields(canvasPath) {
|
|
100
|
+
try {
|
|
101
|
+
return parseDefinitionStrategyFields(await readFile(path.join(path.dirname(canvasPath), "_definition.md"), "utf8"));
|
|
102
|
+
} catch {
|
|
103
|
+
return {};
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
async function readDefinitionSeriesPlace(canvasPath) {
|
|
107
|
+
try {
|
|
108
|
+
return parseDefinitionSeriesPlace(await readFile(path.join(path.dirname(canvasPath), "_definition.md"), "utf8")) ?? {};
|
|
109
|
+
} catch {
|
|
110
|
+
return {};
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
async function syncCreativeDefinitionBestEffort(input) {
|
|
114
|
+
const chatId = process.env.BAKER_CHAT_ID;
|
|
115
|
+
if (!chatId) return;
|
|
116
|
+
const graph = canvasToDefinitionGraph(input.canvas);
|
|
117
|
+
if (!graph || graph.nodes.length === 0) return;
|
|
118
|
+
try {
|
|
119
|
+
const creds = requireCredentialsFromEnv();
|
|
120
|
+
const client = new BackendClient({ baseUrl: creds.url, apiKey: creds.apiKey });
|
|
121
|
+
await client.syncCreativeDefinition(buildDefinitionSyncPayload(input, graph, chatId));
|
|
122
|
+
process.stdout.write(`[definition] synced workflow graph (${graph.nodes.length} nodes) \u2014 view it in the dashboard
|
|
123
|
+
`);
|
|
124
|
+
} catch (e) {
|
|
125
|
+
const msg = e instanceof Error ? e.message : String(e);
|
|
126
|
+
process.stderr.write(`[warn] workflow graph not synced (${msg})
|
|
127
|
+
`);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
async function resolveCanvasPath(inputPath) {
|
|
131
|
+
const resolved = path.resolve(inputPath);
|
|
132
|
+
let dir = resolved;
|
|
133
|
+
try {
|
|
134
|
+
if ((await stat(resolved)).isFile()) {
|
|
135
|
+
if (resolved.endsWith(".canvas.json")) return resolved;
|
|
136
|
+
dir = path.dirname(resolved);
|
|
137
|
+
}
|
|
138
|
+
} catch {
|
|
139
|
+
dir = resolved.endsWith(".canvas.json") ? path.dirname(resolved) : resolved;
|
|
140
|
+
}
|
|
141
|
+
let entries;
|
|
142
|
+
try {
|
|
143
|
+
entries = await readdir(dir);
|
|
144
|
+
} catch {
|
|
145
|
+
return null;
|
|
146
|
+
}
|
|
147
|
+
const canvases = entries.filter((name) => name.endsWith(".canvas.json"));
|
|
148
|
+
const slug = creativeSlugFromCanvasPath(`${dir}/x/`);
|
|
149
|
+
const chosen = (slug ? canvases.find((name) => name === `${slug}.canvas.json`) : void 0) ?? canvases[0];
|
|
150
|
+
return chosen ? path.join(dir, chosen) : null;
|
|
151
|
+
}
|
|
152
|
+
var syncDefinitionCommand = defineCommand({
|
|
153
|
+
meta: {
|
|
154
|
+
name: "sync-definition",
|
|
155
|
+
description: "Push a creative's current node-graph + input thumbnails to the dashboard without rendering. The graph has the creative's blueprint applied (prompt.json and scenes/*.json edits), exactly as `run` would render it, without changing any file. Runs automatically when you edit a creative's canvas.json or prompt.json."
|
|
156
|
+
},
|
|
157
|
+
args: {
|
|
158
|
+
file: {
|
|
159
|
+
type: "positional",
|
|
160
|
+
required: true,
|
|
161
|
+
description: "A path under src/creatives/<slug>/ (the .canvas.json, its prompt.json, or the folder)"
|
|
162
|
+
},
|
|
163
|
+
title: {
|
|
164
|
+
type: "boolean",
|
|
165
|
+
description: "Also record the title its _definition.md gives. Only for a creative just made from another (a series ad, a translation), never on an edit re-sync."
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
async run({ args }) {
|
|
169
|
+
const canvasPath = await resolveCanvasPath(String(args.file));
|
|
170
|
+
if (!canvasPath) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
const slug = creativeSlugFromCanvasPath(canvasPath);
|
|
174
|
+
if (!slug) return;
|
|
175
|
+
let canvas;
|
|
176
|
+
let sourceSha;
|
|
177
|
+
try {
|
|
178
|
+
const prepared = await prepareCanvas(canvasPath, { write: false });
|
|
179
|
+
canvas = prepared.fileGraph;
|
|
180
|
+
sourceSha = prepared.sourceSha;
|
|
181
|
+
} catch {
|
|
182
|
+
return;
|
|
183
|
+
}
|
|
184
|
+
const title = args.title ? await readDefinitionTitle(canvasPath) : void 0;
|
|
185
|
+
await syncCreativeDefinitionBestEffort({
|
|
186
|
+
slug,
|
|
187
|
+
canvas,
|
|
188
|
+
sourceSha,
|
|
189
|
+
...title ? { title } : {},
|
|
190
|
+
...await readDefinitionSourceFields(canvasPath),
|
|
191
|
+
...await readDefinitionStrategyFields(canvasPath),
|
|
192
|
+
...await readDefinitionSeriesPlace(canvasPath)
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
|
|
197
|
+
export {
|
|
198
|
+
buildDefinitionSyncPayload,
|
|
199
|
+
readDefinitionSourceFields,
|
|
200
|
+
readDefinitionTitle,
|
|
201
|
+
readDefinitionStrategyFields,
|
|
202
|
+
readDefinitionSeriesPlace,
|
|
203
|
+
syncCreativeDefinitionBestEffort,
|
|
204
|
+
resolveCanvasPath,
|
|
205
|
+
syncDefinitionCommand
|
|
206
|
+
};
|
|
207
|
+
//# sourceMappingURL=chunk-IMORFIUT.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/commands/canvas/sync-definition.ts","../src/commands/canvas/definition-graph.ts"],"sourcesContent":["import { readdir, readFile, stat } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { parseDocument } from \"yaml\";\nimport { defineCommand } from \"citty\";\nimport { BackendClient } from \"../../engine/index.ts\";\nimport { requireCredentialsFromEnv } from \"../../engine/client/env.ts\";\nimport {\n type DefinitionSeriesPlace,\n type DefinitionSourceFields,\n type DefinitionStrategyFields,\n parseDefinitionSeriesPlace,\n parseDefinitionSourceFields,\n parseDefinitionStrategyFields,\n} from \"./creative-definition.ts\";\nimport { canvasToDefinitionGraph } from \"./definition-graph.ts\";\nimport { prepareCanvas } from \"./prepare-canvas.ts\";\nimport { creativeSlugFromCanvasPath } from \"./run-record.ts\";\n\n/** Why the creative exists (`_definition.md` idea / message / evidence / angle / persona / awareness / hypothesis). */\ntype DefinitionSyncInput = Omit<DefinitionStrategyFields, \"seriesLead\" | \"language\"> & {\n slug: string;\n /** The series lead and language: omitted when not read (the backend keeps them), null when the definition names none (cleared). */\n seriesLead?: string | null;\n language?: string | null;\n /** Omitted on an edit re-sync so the backend keeps the creative's existing title. */\n title?: string;\n platform?: string;\n formats?: string[];\n sourceReferenceUrl?: string;\n /** The library ad it adapted (`_definition.md` sourceAdId / sourcePlatform / sourceAdvertiserId). */\n sourceAdId?: string;\n sourcePlatform?: string;\n sourceAdvertiserId?: string;\n canvas: unknown;\n /** The creative's source fingerprint (`computeSourceSha`): powers the \"edited since last render\" staleness signal. */\n sourceSha?: string;\n};\n\n/**\n * The body `POST /api/creatives/definition` receives. Absent fields are left out rather than\n * sent as undefined so the backend's `?? existing` keeps what an earlier sync recorded.\n */\nexport function buildDefinitionSyncPayload(\n input: DefinitionSyncInput,\n graph: unknown,\n chatId: string,\n): Record<string, unknown> {\n const { canvas: _canvas, ...fields } = input;\n return Object.fromEntries([\n ...Object.entries(fields).filter(([, v]) => v !== undefined),\n [\"graph\", graph],\n [\"chatId\", chatId],\n ]);\n}\n\n/** The library ids the creative's `_definition.md` names, read from beside its canvas; empty when there is none. */\nexport async function readDefinitionSourceFields(canvasPath: string): Promise<DefinitionSourceFields> {\n try {\n return parseDefinitionSourceFields(await readFile(path.join(path.dirname(canvasPath), \"_definition.md\"), \"utf8\"));\n } catch {\n return {};\n }\n}\n\n/** The creative's title, read from the `_definition.md` beside its canvas; undefined when it names none. */\nexport async function readDefinitionTitle(canvasPath: string): Promise<string | undefined> {\n try {\n const raw = await readFile(path.join(path.dirname(canvasPath), \"_definition.md\"), \"utf8\");\n const match = raw.match(/^---\\r?\\n([\\s\\S]*?\\r?\\n)?---/);\n const doc = match ? parseDocument(match[1] ?? \"\") : null;\n const title = doc && doc.errors.length === 0 ? doc.get(\"title\") : undefined;\n return typeof title === \"string\" && title.trim() ? title.trim() : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** The creative's strategy, read from the `_definition.md` beside its canvas; empty when there is none. */\nexport async function readDefinitionStrategyFields(canvasPath: string): Promise<DefinitionStrategyFields> {\n try {\n return parseDefinitionStrategyFields(await readFile(path.join(path.dirname(canvasPath), \"_definition.md\"), \"utf8\"));\n } catch {\n return {};\n }\n}\n\n/** The series place the `_definition.md` beside the canvas names; empty when it cannot be read, so nothing is cleared. */\nexport async function readDefinitionSeriesPlace(canvasPath: string): Promise<DefinitionSeriesPlace | Record<never, never>> {\n try {\n return (\n parseDefinitionSeriesPlace(await readFile(path.join(path.dirname(canvasPath), \"_definition.md\"), \"utf8\")) ?? {}\n );\n } catch {\n return {};\n }\n}\n\n/**\n * Push a creative's parsed node-graph to the backend so the dashboard can draw\n * its workflow (and its wired input thumbnails) BEFORE — and BETWEEN — billed\n * runs. Best-effort: a missing chat id, missing creds, an unparseable canvas, or\n * a failed POST warns and returns — it must never fail the caller (a scaffold\n * that just did the real work, or a watcher reacting to an edit).\n */\nexport async function syncCreativeDefinitionBestEffort(input: DefinitionSyncInput): Promise<void> {\n const chatId = process.env.BAKER_CHAT_ID;\n if (!chatId) return; // Not chat-attached — nothing to preview against.\n const graph = canvasToDefinitionGraph(input.canvas);\n if (!graph || graph.nodes.length === 0) return;\n try {\n const creds = requireCredentialsFromEnv();\n const client = new BackendClient({ baseUrl: creds.url, apiKey: creds.apiKey });\n await client.syncCreativeDefinition(buildDefinitionSyncPayload(input, graph, chatId));\n process.stdout.write(`[definition] synced workflow graph (${graph.nodes.length} nodes) — view it in the dashboard\\n`);\n } catch (e) {\n const msg = e instanceof Error ? e.message : String(e);\n process.stderr.write(`[warn] workflow graph not synced (${msg})\\n`);\n }\n}\n\n/**\n * Resolve the canvas file backing a creative from ANY path under its dir — the\n * `{slug}.canvas.json` itself, its sibling `prompt.json`, or the creative\n * directory. Lets a file watcher hand us whichever file changed and still find\n * the one canvas to project. Prefers `{slug}.canvas.json`, else the sole\n * `*.canvas.json` in the directory; null when there is no single canvas.\n */\nexport async function resolveCanvasPath(inputPath: string): Promise<string | null> {\n const resolved = path.resolve(inputPath);\n let dir = resolved;\n try {\n if ((await stat(resolved)).isFile()) {\n if (resolved.endsWith(\".canvas.json\")) return resolved;\n dir = path.dirname(resolved);\n }\n } catch {\n // A deleted/renamed file: fall back to treating the path as its directory.\n dir = resolved.endsWith(\".canvas.json\") ? path.dirname(resolved) : resolved;\n }\n let entries: string[];\n try {\n entries = await readdir(dir);\n } catch {\n return null;\n }\n const canvases = entries.filter((name) => name.endsWith(\".canvas.json\"));\n const slug = creativeSlugFromCanvasPath(`${dir}/x/`);\n const chosen = (slug ? canvases.find((name) => name === `${slug}.canvas.json`) : undefined) ?? canvases[0];\n return chosen ? path.join(dir, chosen) : null;\n}\n\nexport const syncDefinitionCommand = defineCommand({\n meta: {\n name: \"sync-definition\",\n description:\n \"Push a creative's current node-graph + input thumbnails to the dashboard without rendering. The graph has the creative's blueprint applied (prompt.json and scenes/*.json edits), exactly as `run` would render it, without changing any file. Runs automatically when you edit a creative's canvas.json or prompt.json.\",\n },\n args: {\n file: {\n type: \"positional\",\n required: true,\n description: \"A path under src/creatives/<slug>/ (the .canvas.json, its prompt.json, or the folder)\",\n },\n title: {\n type: \"boolean\",\n description:\n \"Also record the title its _definition.md gives. Only for a creative just made from another (a series ad, a translation), never on an edit re-sync.\",\n },\n },\n async run({ args }) {\n const canvasPath = await resolveCanvasPath(String(args.file));\n if (!canvasPath) {\n // Nothing to sync (not a creative path, or no canvas yet) — a no-op, not an error.\n return;\n }\n const slug = creativeSlugFromCanvasPath(canvasPath);\n if (!slug) return;\n // The same preflight `run` uses, so the dashboard draws the graph that will render\n // (the scene and copy projections included), in the file's canvas-relative spelling,\n // never this machine's absolute paths. Read-only: the watcher runs this over every\n // creative on every edit, and must never rewrite a creative nobody touched. The\n // fingerprint is taken over the projected graph, as `run` and `baker canvas stale` take it.\n let canvas: unknown;\n let sourceSha: string | undefined;\n try {\n const prepared = await prepareCanvas(canvasPath, { write: false });\n canvas = prepared.fileGraph;\n sourceSha = prepared.sourceSha;\n } catch {\n // Mid-edit invalid JSON (canvas, prompt.json or a scene): skip this tick; the next\n // save re-fires the watcher.\n return;\n }\n // No title/platform/formats: an edit re-sync must never rename or re-classify\n // the creative — the backend preserves what the scaffold already set. The library\n // ids are re-read from `_definition.md`, so an agent that adds or fixes them after\n // the scaffold still gets them recorded without waiting for Publish — and so is the\n // creative's strategy, the moment the agent writes it.\n const title = args.title ? await readDefinitionTitle(canvasPath) : undefined;\n await syncCreativeDefinitionBestEffort({\n slug,\n canvas,\n sourceSha,\n ...(title ? { title } : {}),\n ...(await readDefinitionSourceFields(canvasPath)),\n ...(await readDefinitionStrategyFields(canvasPath)),\n ...(await readDefinitionSeriesPlace(canvasPath)),\n });\n },\n});\n","import { nodeDependencies } from \"../../engine/engine/graph.ts\";\nimport { nodeParamsPreview } from \"./node-preview.ts\";\n\nexport type DefinitionGraphNode = {\n id: string;\n type: string;\n deps?: string[];\n paramsPreview?: string;\n /**\n * A directly-viewable input image/video for the node BEFORE any run — today\n * an `ingest` node's `source:\"url\"` src. Lets the dashboard show a real\n * thumbnail (a swapped logo/hero) the moment the canvas changes, with no\n * render. Path-source ingests carry no preview (their bytes aren't uploaded\n * outside a run); the graph still shows the `path:` line via paramsPreview.\n */\n inputPreviewUrl?: string;\n};\nexport type CanvasDefinitionGraph = {\n nodes: DefinitionGraphNode[];\n output?: { node: string; output: string };\n};\n\n// Keep the synced blueprint bounded — matches the backend's cap.\nconst MAX_NODES = 300;\n\n// Only image ingests become a pre-run thumbnail: absent `expect` defaults to an\n// image, and a still renders unambiguously in the graph card. Video/font/json\n// ingests carry no preview (a video would need its own player wiring) — their\n// `url:`/`path:` line still shows via paramsPreview.\nconst PREVIEWABLE_INGEST_EXPECTS = new Set([\"image\"]);\n\n/**\n * A directly-viewable input URL for a node's pre-run thumbnail: an `ingest`\n * node pulling an image from a `source:\"url\"` src. Everything else (path-source\n * ingests, generators, non-image expects) returns undefined — only image bytes\n * the dashboard can already fetch become a thumbnail without a run.\n */\nfunction nodeInputPreviewUrl(type: string, params: unknown): string | undefined {\n if (type !== \"ingest\" || !params || typeof params !== \"object\") return undefined;\n const p = params as { source?: unknown; url?: unknown; expect?: unknown };\n if (p.source !== \"url\" || typeof p.url !== \"string\") return undefined;\n if (!/^https?:\\/\\//i.test(p.url)) return undefined;\n if (typeof p.expect === \"string\" && !PREVIEWABLE_INGEST_EXPECTS.has(p.expect)) return undefined;\n return p.url;\n}\n\n/**\n * Parse a canvas JSON into the compact node-graph the dashboard draws before any\n * run — shares the engine's `nodeDependencies` ($ref edges from inputs AND params) so\n * the pre-run blueprint matches the eventual run graph. Best-effort and defensive:\n * a not-yet-valid canvas (mid-edit) returns whatever nodes it can read, or null\n * if there are none, so a caller can skip the sync without failing the command.\n */\nexport function canvasToDefinitionGraph(canvas: unknown): CanvasDefinitionGraph | null {\n const rawNodes = (canvas as { nodes?: unknown })?.nodes;\n if (!Array.isArray(rawNodes)) return null;\n\n const parsed: Array<{ id: string; type: string; inputs: unknown; params: unknown }> = [];\n for (const raw of rawNodes) {\n const id = (raw as { id?: unknown })?.id;\n const type = (raw as { type?: unknown })?.type;\n if (typeof id !== \"string\" || typeof type !== \"string\") continue;\n parsed.push({ id, type, inputs: (raw as { inputs?: unknown }).inputs, params: (raw as { params?: unknown }).params });\n if (parsed.length >= MAX_NODES) break;\n }\n if (parsed.length === 0) return null;\n\n const ids = new Set(parsed.map((n) => n.id));\n const nodes: DefinitionGraphNode[] = parsed.map(({ id, type, inputs, params }) => {\n const deps = nodeDependencies({ id, inputs, params }, ids);\n deps.delete(id);\n const depList = [...deps];\n // The pre-run graph carries each node's spec (model / aspect / size / expect …) +\n // its wired props so a freshly-scaffolded creative shows full node detail in the\n // inspector BEFORE the first billed run, matching what a run later records.\n const paramsPreview = nodeParamsPreview(params, depList);\n const base: DefinitionGraphNode = { id, type };\n if (depList.length > 0) base.deps = depList;\n if (paramsPreview) base.paramsPreview = paramsPreview;\n const inputPreviewUrl = nodeInputPreviewUrl(type, params);\n if (inputPreviewUrl) base.inputPreviewUrl = inputPreviewUrl;\n return base;\n });\n\n const rawOutput = (canvas as { output?: unknown })?.output;\n const outNode = (rawOutput as { node?: unknown })?.node;\n const outSlot = (rawOutput as { output?: unknown })?.output;\n const output =\n typeof outNode === \"string\" && typeof outSlot === \"string\" ? { node: outNode, output: outSlot } : undefined;\n\n return { nodes, output };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,SAAS,UAAU,YAAY;AACxC,OAAO,UAAU;AACjB,SAAS,qBAAqB;AAC9B,SAAS,qBAAqB;;;ACoB9B,IAAM,YAAY;AAMlB,IAAM,6BAA6B,oBAAI,IAAI,CAAC,OAAO,CAAC;AAQpD,SAAS,oBAAoB,MAAc,QAAqC;AAC9E,MAAI,SAAS,YAAY,CAAC,UAAU,OAAO,WAAW,SAAU,QAAO;AACvE,QAAM,IAAI;AACV,MAAI,EAAE,WAAW,SAAS,OAAO,EAAE,QAAQ,SAAU,QAAO;AAC5D,MAAI,CAAC,gBAAgB,KAAK,EAAE,GAAG,EAAG,QAAO;AACzC,MAAI,OAAO,EAAE,WAAW,YAAY,CAAC,2BAA2B,IAAI,EAAE,MAAM,EAAG,QAAO;AACtF,SAAO,EAAE;AACX;AASO,SAAS,wBAAwB,QAA+C;AACrF,QAAM,WAAY,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