@koda-sl/baker-cli 0.449.0-dev.bd86e5817 → 0.450.0-dev.b454c3dd2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (443) hide show
  1. package/README.md +11 -6
  2. package/dist/{account-AL2ZDSR7.js → account-XQXC7BR6.js} +5 -4
  3. package/dist/{account-AL2ZDSR7.js.map → account-XQXC7BR6.js.map} +1 -1
  4. package/dist/{accounts-HAFCLSR5.js → accounts-722UY53A.js} +4 -3
  5. package/dist/{accounts-HAFCLSR5.js.map → accounts-722UY53A.js.map} +1 -1
  6. package/dist/{accounts-O5MFO3QQ.js → accounts-E67BMK7T.js} +6 -5
  7. package/dist/{accounts-O5MFO3QQ.js.map → accounts-E67BMK7T.js.map} +1 -1
  8. package/dist/{actions-P35MEMGN.js → actions-6TQMSVWD.js} +18 -18
  9. package/dist/{add-5GAN6CVO.js → add-2BEGRHUX.js} +28 -5
  10. package/dist/add-2BEGRHUX.js.map +1 -0
  11. package/dist/{add-6DTC6X5G.js → add-LEMKEOPO.js} +3 -2
  12. package/dist/{add-6DTC6X5G.js.map → add-LEMKEOPO.js.map} +1 -1
  13. package/dist/{ads-73PGA4YC.js → ads-AGYCVD62.js} +4 -4
  14. package/dist/{advertisers-AE75CGVE.js → advertisers-2VQKAYKG.js} +4 -3
  15. package/dist/{advertisers-AE75CGVE.js.map → advertisers-2VQKAYKG.js.map} +1 -1
  16. package/dist/{analytics-FKCXIMPO.js → analytics-IFELDWLL.js} +24 -20
  17. package/dist/analytics-IFELDWLL.js.map +1 -0
  18. package/dist/{analytics-FPWQQGRM.js → analytics-OH5QEH7F.js} +4 -3
  19. package/dist/{analytics-FPWQQGRM.js.map → analytics-OH5QEH7F.js.map} +1 -1
  20. package/dist/{assign-ABN2AQ4J.js → assign-PTUJUCEL.js} +4 -3
  21. package/dist/{assign-ABN2AQ4J.js.map → assign-PTUJUCEL.js.map} +1 -1
  22. package/dist/{audience-size-GNBJY35X.js → audience-size-LRI6GJRT.js} +4 -3
  23. package/dist/{audience-size-GNBJY35X.js.map → audience-size-LRI6GJRT.js.map} +1 -1
  24. package/dist/{audit-3VS63TBW.js → audit-HWP7OPB7.js} +4 -3
  25. package/dist/{audit-3VS63TBW.js.map → audit-HWP7OPB7.js.map} +1 -1
  26. package/dist/{autocomplete-VS3XG3B7.js → autocomplete-J6DHU6MR.js} +4 -3
  27. package/dist/{autocomplete-VS3XG3B7.js.map → autocomplete-J6DHU6MR.js.map} +1 -1
  28. package/dist/{avatars-EKCKHCC3.js → avatars-467OSBD6.js} +4 -4
  29. package/dist/{bid-pricing-Q72B65AY.js → bid-pricing-EO5WLHGV.js} +4 -3
  30. package/dist/{bid-pricing-Q72B65AY.js.map → bid-pricing-EO5WLHGV.js.map} +1 -1
  31. package/dist/{brand-C6PFGGQN.js → brand-YRTEPGBK.js} +2 -2
  32. package/dist/{brief-YFJHQ5VQ.js → brief-OSFJ2V7F.js} +8 -7
  33. package/dist/{brief-YFJHQ5VQ.js.map → brief-OSFJ2V7F.js.map} +1 -1
  34. package/dist/{campaign-groups-KFFYQPU3.js → campaign-groups-PQ6KSQJR.js} +9 -8
  35. package/dist/{campaign-groups-KFFYQPU3.js.map → campaign-groups-PQ6KSQJR.js.map} +1 -1
  36. package/dist/{campaign-writes-FHOS5XZY.js → campaign-writes-5OVLUD5E.js} +4 -3
  37. package/dist/{campaign-writes-FHOS5XZY.js.map → campaign-writes-5OVLUD5E.js.map} +1 -1
  38. package/dist/{campaigns-2NHWBF5C.js → campaigns-6T3NSUT2.js} +12 -11
  39. package/dist/{campaigns-2NHWBF5C.js.map → campaigns-6T3NSUT2.js.map} +1 -1
  40. package/dist/{campaigns-KZYZTXDS.js → campaigns-OYMXDGWX.js} +5 -5
  41. package/dist/{canvas-UJNSHD3B.js → canvas-YQFG52IG.js} +13 -13
  42. package/dist/{capabilities-DJFTRJKS.js → capabilities-PXBKUN2G.js} +4 -3
  43. package/dist/{capabilities-DJFTRJKS.js.map → capabilities-PXBKUN2G.js.map} +1 -1
  44. package/dist/{catalog-ZQX6BGXS.js → catalog-XLXIM7IW.js} +4 -4
  45. package/dist/{chats-D2CSDX5Q.js → chats-UK47UE7C.js} +4 -3
  46. package/dist/{chats-D2CSDX5Q.js.map → chats-UK47UE7C.js.map} +1 -1
  47. package/dist/{chunk-7YCRFMXF.js → chunk-24EB7EDR.js} +3 -3
  48. package/dist/{chunk-5ZDLTE5T.js → chunk-2AOE2MZQ.js} +3 -3
  49. package/dist/{chunk-4SG4RW2P.js → chunk-2VPBIT65.js} +8 -8
  50. package/dist/chunk-4PDHHHUJ.js +537 -0
  51. package/dist/chunk-4PDHHHUJ.js.map +1 -0
  52. package/dist/{chunk-NPY4QUMQ.js → chunk-54C6YDGJ.js} +2 -2
  53. package/dist/{chunk-LZ73CZGP.js → chunk-5WCSKQ7Z.js} +6 -6
  54. package/dist/{chunk-3G3ZDLMI.js → chunk-5ZNTADVR.js} +2 -2
  55. package/dist/{chunk-AEOSAVVL.js → chunk-6F7DVPOS.js} +3 -3
  56. package/dist/{chunk-CJCVIEJ5.js → chunk-6NY2GPR4.js} +3 -3
  57. package/dist/{chunk-CXWFX2AM.js → chunk-6Y7ZBENQ.js} +6 -6
  58. package/dist/{chunk-M242LHLX.js → chunk-7CTMH5AK.js} +3 -3
  59. package/dist/{chunk-XF4JUKVF.js → chunk-7EPXVICM.js} +38 -5
  60. package/dist/chunk-7EPXVICM.js.map +1 -0
  61. package/dist/{chunk-T2PC5AVH.js → chunk-ASI4P6X2.js} +6 -6
  62. package/dist/chunk-ASI4P6X2.js.map +1 -0
  63. package/dist/{chunk-QD7ESRLN.js → chunk-C46GUI2S.js} +2 -2
  64. package/dist/{chunk-6N6WKAJM.js → chunk-CWYAELVG.js} +2 -2
  65. package/dist/{chunk-MXYBTMKB.js → chunk-DCRPXOJJ.js} +2 -2
  66. package/dist/{chunk-GKZ2WU75.js → chunk-FPOGPFAG.js} +3 -14
  67. package/dist/chunk-FPOGPFAG.js.map +1 -0
  68. package/dist/{chunk-JQJDXPCO.js → chunk-FUHN4MFY.js} +2 -2
  69. package/dist/{chunk-S77PZVYM.js → chunk-FYGR3I2A.js} +3 -3
  70. package/dist/{chunk-OZRUJVIQ.js → chunk-H3427GPU.js} +2 -2
  71. package/dist/{chunk-RPUSTYHL.js → chunk-HDLYPC6K.js} +5 -3
  72. package/dist/{chunk-RPUSTYHL.js.map → chunk-HDLYPC6K.js.map} +1 -1
  73. package/dist/{chunk-SSJK7FEV.js → chunk-HR6IWNKE.js} +1196 -1140
  74. package/dist/chunk-HR6IWNKE.js.map +1 -0
  75. package/dist/{chunk-YRQYA2LR.js → chunk-HROZYQ5H.js} +63 -5
  76. package/dist/chunk-HROZYQ5H.js.map +1 -0
  77. package/dist/{chunk-IR6D7K4H.js → chunk-I3ZR655O.js} +2 -2
  78. package/dist/{chunk-YK32GUBN.js → chunk-KMKEYI37.js} +3 -3
  79. package/dist/{chunk-W3ZHJJVT.js → chunk-KS2QY6MK.js} +4 -4
  80. package/dist/{chunk-WNRV4QH7.js → chunk-LYQJ4PZW.js} +5 -5
  81. package/dist/{chunk-B5SCU7MJ.js → chunk-MACCF4JZ.js} +16 -22
  82. package/dist/{chunk-B5SCU7MJ.js.map → chunk-MACCF4JZ.js.map} +1 -1
  83. package/dist/{chunk-CSYSX4D2.js → chunk-N4LAYIIN.js} +2 -2
  84. package/dist/{chunk-4AUMTNVB.js → chunk-NA63BH7V.js} +3 -3
  85. package/dist/{chunk-4BQXAE7Z.js → chunk-NDEE6G2J.js} +2 -2
  86. package/dist/{chunk-EDLZGTGN.js → chunk-NYIGXDUG.js} +1 -39
  87. package/dist/chunk-NYIGXDUG.js.map +1 -0
  88. package/dist/{chunk-DWHIOO7E.js → chunk-QE7W555R.js} +163 -12
  89. package/dist/chunk-QE7W555R.js.map +1 -0
  90. package/dist/{chunk-MELOSESI.js → chunk-R25YLW6H.js} +2 -2
  91. package/dist/{chunk-Y6O7EWYY.js → chunk-RL5CP7N6.js} +5 -5
  92. package/dist/{chunk-DGUNI37S.js → chunk-RX2DKU3W.js} +2 -2
  93. package/dist/{chunk-3HJLHTWP.js → chunk-SJYEY5MV.js} +12 -3
  94. package/dist/{chunk-3HJLHTWP.js.map → chunk-SJYEY5MV.js.map} +1 -1
  95. package/dist/{chunk-VTDMKARH.js → chunk-ULG4QRTV.js} +2 -2
  96. package/dist/{chunk-QRP3PXWN.js → chunk-VL43TNIP.js} +2 -2
  97. package/dist/{chunk-SHL7LOC3.js → chunk-VLMBTPXU.js} +3 -3
  98. package/dist/{chunk-KHRXPQID.js → chunk-VYQ3QJ3C.js} +2 -2
  99. package/dist/{chunk-A4LOJ2VD.js → chunk-WGUQHAJY.js} +2 -2
  100. package/dist/{chunk-ZEYEWPK6.js → chunk-WKQG6TER.js} +2 -2
  101. package/dist/{chunk-3IBYKLXR.js → chunk-ZDMTXQ2Q.js} +2 -2
  102. package/dist/{claim-FZ5OQLMU.js → claim-W6G6VEG5.js} +4 -3
  103. package/dist/{claim-FZ5OQLMU.js.map → claim-W6G6VEG5.js.map} +1 -1
  104. package/dist/cli.js +30 -30
  105. package/dist/{companies-DNI634RC.js → companies-TS6KBATJ.js} +4 -3
  106. package/dist/{companies-DNI634RC.js.map → companies-TS6KBATJ.js.map} +1 -1
  107. package/dist/{complete-2FZMGJV5.js → complete-LYR2HMQU.js} +4 -3
  108. package/dist/{complete-2FZMGJV5.js.map → complete-LYR2HMQU.js.map} +1 -1
  109. package/dist/{connect-QCOGEPP4.js → connect-FCXNVTXG.js} +13 -6
  110. package/dist/{conversation-6IOGV7B7.js → conversation-6ZJGPCXM.js} +4 -3
  111. package/dist/{conversation-6IOGV7B7.js.map → conversation-6ZJGPCXM.js.map} +1 -1
  112. package/dist/{conversions-4SRZPBBX.js → conversions-UHB55MMQ.js} +8 -7
  113. package/dist/{conversions-4SRZPBBX.js.map → conversions-UHB55MMQ.js.map} +1 -1
  114. package/dist/{create-BJNMO6HT.js → create-EX6OWLNM.js} +3 -2
  115. package/dist/{create-BJNMO6HT.js.map → create-EX6OWLNM.js.map} +1 -1
  116. package/dist/{create-RM7HV77Y.js → create-JCA7JPLP.js} +4 -3
  117. package/dist/{create-RM7HV77Y.js.map → create-JCA7JPLP.js.map} +1 -1
  118. package/dist/{create-FX4OJ2XF.js → create-JFSK4BOP.js} +4 -3
  119. package/dist/{create-FX4OJ2XF.js.map → create-JFSK4BOP.js.map} +1 -1
  120. package/dist/{create-VXM34ZWH.js → create-WU22YYU2.js} +4 -3
  121. package/dist/{create-VXM34ZWH.js.map → create-WU22YYU2.js.map} +1 -1
  122. package/dist/{creatives-NJF2U763.js → creatives-FXUQ5WSD.js} +10 -10
  123. package/dist/{creatives-JSWBFQ5R.js → creatives-KGXUOYPE.js} +9 -8
  124. package/dist/{creatives-JSWBFQ5R.js.map → creatives-KGXUOYPE.js.map} +1 -1
  125. package/dist/{credentials-C33K6XCJ.js → credentials-MJC7PGKR.js} +4 -3
  126. package/dist/{credentials-C33K6XCJ.js.map → credentials-MJC7PGKR.js.map} +1 -1
  127. package/dist/{critique-YDKPYZLD.js → critique-GS5VV5ZC.js} +7 -6
  128. package/dist/{critique-YDKPYZLD.js.map → critique-GS5VV5ZC.js.map} +1 -1
  129. package/dist/{critique-ZS4ON3SU.js → critique-TPHR27KH.js} +4 -3
  130. package/dist/{critique-ZS4ON3SU.js.map → critique-TPHR27KH.js.map} +1 -1
  131. package/dist/{crm-R5IXIFIV.js → crm-AVCM5D4G.js} +5 -4
  132. package/dist/{crm-R5IXIFIV.js.map → crm-AVCM5D4G.js.map} +1 -1
  133. package/dist/{crm-52ROSWH5.js → crm-VK44O3ED.js} +5 -4
  134. package/dist/{crm-52ROSWH5.js.map → crm-VK44O3ED.js.map} +1 -1
  135. package/dist/{customers-A36LOZOB.js → customers-XH2DMTFH.js} +6 -5
  136. package/dist/{delete-M2GDLPYN.js → delete-E3R3TKIL.js} +3 -2
  137. package/dist/{delete-M2GDLPYN.js.map → delete-E3R3TKIL.js.map} +1 -1
  138. package/dist/{delete-HGHXY24R.js → delete-KRH2YMSZ.js} +4 -3
  139. package/dist/{delete-HGHXY24R.js.map → delete-KRH2YMSZ.js.map} +1 -1
  140. package/dist/{delete-AIGE4Y4H.js → delete-WI5E3DR3.js} +4 -3
  141. package/dist/{delete-AIGE4Y4H.js.map → delete-WI5E3DR3.js.map} +1 -1
  142. package/dist/{demographics-NTWB2IMG.js → demographics-XV5PBA77.js} +4 -3
  143. package/dist/{demographics-NTWB2IMG.js.map → demographics-XV5PBA77.js.map} +1 -1
  144. package/dist/{discard-2WWQG6OU.js → discard-HTQUUHJR.js} +4 -3
  145. package/dist/{discard-2WWQG6OU.js.map → discard-HTQUUHJR.js.map} +1 -1
  146. package/dist/{domain-Y2LT6JLT.js → domain-RECGZXJB.js} +4 -3
  147. package/dist/{domain-Y2LT6JLT.js.map → domain-RECGZXJB.js.map} +1 -1
  148. package/dist/{draft-SLHAKJ2A.js → draft-2IBSJEKC.js} +4 -3
  149. package/dist/{draft-SLHAKJ2A.js.map → draft-2IBSJEKC.js.map} +1 -1
  150. package/dist/{draft-FJ7WHIXW.js → draft-PVTX6QT6.js} +4 -3
  151. package/dist/{draft-FJ7WHIXW.js.map → draft-PVTX6QT6.js.map} +1 -1
  152. package/dist/{draft-EJXNNJ3Y.js → draft-Q546QPPU.js} +5 -4
  153. package/dist/{draft-EJXNNJ3Y.js.map → draft-Q546QPPU.js.map} +1 -1
  154. package/dist/engine/index.js +3 -3
  155. package/dist/{facets-U7AQC4H6.js → facets-7EVPJMKS.js} +4 -3
  156. package/dist/{facets-U7AQC4H6.js.map → facets-7EVPJMKS.js.map} +1 -1
  157. package/dist/{feedback-PPQMOQ46.js → feedback-EIZKS4JU.js} +2 -2
  158. package/dist/{feedback-record-V66HWVRR.js → feedback-record-TKO54BOE.js} +9 -8
  159. package/dist/{feedback-record-V66HWVRR.js.map → feedback-record-TKO54BOE.js.map} +1 -1
  160. package/dist/{fetch-W7NULDEO.js → fetch-4BY6HYUM.js} +4 -3
  161. package/dist/{fetch-W7NULDEO.js.map → fetch-4BY6HYUM.js.map} +1 -1
  162. package/dist/{find-OTDIX6V4.js → find-FRRHAPWX.js} +4 -4
  163. package/dist/{flows-KABCBS3S.js → flows-KTFAML22.js} +21 -17
  164. package/dist/flows-KTFAML22.js.map +1 -0
  165. package/dist/{fonts-EMMX3KII.js → fonts-MXR3ZKDX.js} +6 -5
  166. package/dist/{forecast-GNODEIIC.js → forecast-3QTJYVND.js} +4 -3
  167. package/dist/{forecast-GNODEIIC.js.map → forecast-3QTJYVND.js.map} +1 -1
  168. package/dist/{funnel-AAX27NH4.js → funnel-I6XIAEHG.js} +11 -455
  169. package/dist/funnel-I6XIAEHG.js.map +1 -0
  170. package/dist/{ga4-UDQ2HA2J.js → ga4-DV2AXCSL.js} +1 -1
  171. package/dist/{get-QEYJRLV3.js → get-5PKNKJ5S.js} +7 -4
  172. package/dist/get-5PKNKJ5S.js.map +1 -0
  173. package/dist/{get-RTVUZM6E.js → get-72YPHJGV.js} +4 -3
  174. package/dist/{get-RTVUZM6E.js.map → get-72YPHJGV.js.map} +1 -1
  175. package/dist/{google-M7KEXVK5.js → google-6OGZX47I.js} +2 -2
  176. package/dist/{google-KTO3PLEU.js → google-QYYYSSXI.js} +5 -5
  177. package/dist/{google-ads-OK6IG3UV.js → google-ads-QGMQKZQD.js} +4 -3
  178. package/dist/{google-ads-OK6IG3UV.js.map → google-ads-QGMQKZQD.js.map} +1 -1
  179. package/dist/{gsc-P3QYGDV2.js → gsc-TAKOF7J5.js} +1 -1
  180. package/dist/{history-PQUJKK26.js → history-6AVQX2OQ.js} +4 -3
  181. package/dist/{history-PQUJKK26.js.map → history-6AVQX2OQ.js.map} +1 -1
  182. package/dist/{hubspot-Y77VLY6Y.js → hubspot-SVEMFK5S.js} +9 -8
  183. package/dist/{hubspot-Y77VLY6Y.js.map → hubspot-SVEMFK5S.js.map} +1 -1
  184. package/dist/{icon-I43F77FV.js → icon-L4RSS6PZ.js} +4 -4
  185. package/dist/{ideas-MIDU7YOA.js → ideas-NFOW3HKJ.js} +3 -2
  186. package/dist/{images-S254MS6O.js → images-2EFFUNNV.js} +9 -9
  187. package/dist/{ingest-YV2NLDBE.js → ingest-2EIKN4QC.js} +4 -3
  188. package/dist/{ingest-J4I3HKM3.js → ingest-2SO62RRI.js} +3 -2
  189. package/dist/{ingest-J4I3HKM3.js.map → ingest-2SO62RRI.js.map} +1 -1
  190. package/dist/{inspect-Q5NHBBHX.js → inspect-4OOS4APT.js} +4 -3
  191. package/dist/{inspect-Q5NHBBHX.js.map → inspect-4OOS4APT.js.map} +1 -1
  192. package/dist/{inspiration-P265QJ2H.js → inspiration-S3DU4CMQ.js} +1 -1
  193. package/dist/{keyword-metrics-PDY4ZXSP.js → keyword-metrics-SF4CSNZ2.js} +4 -3
  194. package/dist/{keyword-metrics-PDY4ZXSP.js.map → keyword-metrics-SF4CSNZ2.js.map} +1 -1
  195. package/dist/{keywords-for-site-GALSCV77.js → keywords-for-site-WDAOPNKC.js} +4 -3
  196. package/dist/{keywords-for-site-GALSCV77.js.map → keywords-for-site-WDAOPNKC.js.map} +1 -1
  197. package/dist/{landing-CJYGWCK4.js → landing-2ZB46LXH.js} +3 -3
  198. package/dist/{leads-PHKG6CP3.js → leads-A4W5KTWB.js} +4 -3
  199. package/dist/{leads-PHKG6CP3.js.map → leads-A4W5KTWB.js.map} +1 -1
  200. package/dist/{learn-FUQSY7DN.js → learn-IPULBCOD.js} +5 -4
  201. package/dist/{learn-FUQSY7DN.js.map → learn-IPULBCOD.js.map} +1 -1
  202. package/dist/{line-item-writes-E6MZPIZZ.js → line-item-writes-EMYSOJKM.js} +4 -3
  203. package/dist/{line-item-writes-E6MZPIZZ.js.map → line-item-writes-EMYSOJKM.js.map} +1 -1
  204. package/dist/{line-items-7ZGIKEF2.js → line-items-5NECXUZT.js} +5 -5
  205. package/dist/{link-QYAW6A2W.js → link-CI45HWFN.js} +4 -3
  206. package/dist/{link-QYAW6A2W.js.map → link-CI45HWFN.js.map} +1 -1
  207. package/dist/{linkedin-FFSDSGGS.js → linkedin-B7SYR75X.js} +27 -26
  208. package/dist/{linkedin-FFSDSGGS.js.map → linkedin-B7SYR75X.js.map} +1 -1
  209. package/dist/{list-NVQC5SNY.js → list-2BARXOT5.js} +3 -2
  210. package/dist/{list-NVQC5SNY.js.map → list-2BARXOT5.js.map} +1 -1
  211. package/dist/{list-SAV3LQHY.js → list-BIEVLEHS.js} +4 -3
  212. package/dist/{list-SAV3LQHY.js.map → list-BIEVLEHS.js.map} +1 -1
  213. package/dist/{list-5IC6KIKO.js → list-ZBT3EBVZ.js} +4 -3
  214. package/dist/{list-5IC6KIKO.js.map → list-ZBT3EBVZ.js.map} +1 -1
  215. package/dist/{log-XZPVOALD.js → log-C23OOAJZ.js} +4 -3
  216. package/dist/{log-XZPVOALD.js.map → log-C23OOAJZ.js.map} +1 -1
  217. package/dist/{logo-2IP663QO.js → logo-Q5D7PZY6.js} +3 -3
  218. package/dist/{lookup-XK45W2SH.js → lookup-ETWY47F7.js} +6 -5
  219. package/dist/{make-J3WBO62B.js → make-TPKKJXGL.js} +18 -17
  220. package/dist/{make-J3WBO62B.js.map → make-TPKKJXGL.js.map} +1 -1
  221. package/dist/{map-4J5WIWIG.js → map-SYZMPHLL.js} +5 -4
  222. package/dist/{map-4J5WIWIG.js.map → map-SYZMPHLL.js.map} +1 -1
  223. package/dist/{mcp-XXD7ZQCP.js → mcp-6FQBVJ6F.js} +3 -2
  224. package/dist/{mcp-XXD7ZQCP.js.map → mcp-6FQBVJ6F.js.map} +1 -1
  225. package/dist/{media-sources-O6ZRUA3N.js → media-sources-ZXHEEP6T.js} +2 -2
  226. package/dist/{members-D5ZYLS4Y.js → members-UDY4OOJW.js} +4 -3
  227. package/dist/{members-D5ZYLS4Y.js.map → members-UDY4OOJW.js.map} +1 -1
  228. package/dist/{normalize-PCNC6E2N.js → normalize-DAKHYS3V.js} +7 -3
  229. package/dist/{normalize-PCNC6E2N.js.map → normalize-DAKHYS3V.js.map} +1 -1
  230. package/dist/{options-MQ65VEVD.js → options-QL3ULED5.js} +7 -6
  231. package/dist/{options-MQ65VEVD.js.map → options-QL3ULED5.js.map} +1 -1
  232. package/dist/{performance-6QW2KEEQ.js → performance-UF5VTY2U.js} +5 -4
  233. package/dist/plan-FT632COT.js +51 -0
  234. package/dist/plan-FT632COT.js.map +1 -0
  235. package/dist/{promoted-tweet-writes-JPLHY3GM.js → promoted-tweet-writes-7HGESJ46.js} +4 -3
  236. package/dist/{promoted-tweet-writes-JPLHY3GM.js.map → promoted-tweet-writes-7HGESJ46.js.map} +1 -1
  237. package/dist/{promoted-tweets-SURKMHFI.js → promoted-tweets-LZKS5JIF.js} +3 -3
  238. package/dist/{publish-HCQ6MXLB.js → publish-NPD3SMZL.js} +4 -3
  239. package/dist/{publish-HCQ6MXLB.js.map → publish-NPD3SMZL.js.map} +1 -1
  240. package/dist/questionnaire-JNGYJTAY.js +37 -0
  241. package/dist/questionnaire-JNGYJTAY.js.map +1 -0
  242. package/dist/{reddit-GIP3ADMS.js → reddit-NU2N3LZD.js} +5 -4
  243. package/dist/{refresh-UXQSLCR3.js → refresh-EBVJ2C6L.js} +3 -2
  244. package/dist/{refresh-UXQSLCR3.js.map → refresh-EBVJ2C6L.js.map} +1 -1
  245. package/dist/{release-5KVLXNP6.js → release-V43YB2PY.js} +4 -3
  246. package/dist/{release-5KVLXNP6.js.map → release-V43YB2PY.js.map} +1 -1
  247. package/dist/{remove-6FIVKCJI.js → remove-QPSWLFI4.js} +3 -2
  248. package/dist/{remove-6FIVKCJI.js.map → remove-QPSWLFI4.js.map} +1 -1
  249. package/dist/{reopen-YM5LNOLB.js → reopen-GQ66NMWF.js} +4 -3
  250. package/dist/{reopen-YM5LNOLB.js.map → reopen-GQ66NMWF.js.map} +1 -1
  251. package/dist/{rerun-WYDRHIUJ.js → rerun-PZK275DY.js} +18 -17
  252. package/dist/{rerun-WYDRHIUJ.js.map → rerun-PZK275DY.js.map} +1 -1
  253. package/dist/{research-2BLEISBG.js → research-FMM6AWZC.js} +10 -10
  254. package/dist/{research-YOGE7GT2.js → research-GEOCUBXB.js} +3 -2
  255. package/dist/{research-YOGE7GT2.js.map → research-GEOCUBXB.js.map} +1 -1
  256. package/dist/{reset-C4UHQ3EU.js → reset-REXJ6AUK.js} +3 -2
  257. package/dist/{reset-C4UHQ3EU.js.map → reset-REXJ6AUK.js.map} +1 -1
  258. package/dist/{reset-OLVB6AE6.js → reset-Y72IVESB.js} +3 -2
  259. package/dist/{reset-OLVB6AE6.js.map → reset-Y72IVESB.js.map} +1 -1
  260. package/dist/{resolve-XYH2GDAE.js → resolve-OGX7C4TV.js} +4 -3
  261. package/dist/{resolve-XYH2GDAE.js.map → resolve-OGX7C4TV.js.map} +1 -1
  262. package/dist/{retry-7EELDEQP.js → retry-CD6JAQ3F.js} +3 -2
  263. package/dist/{retry-7EELDEQP.js.map → retry-CD6JAQ3F.js.map} +1 -1
  264. package/dist/{retry-726GKI6V.js → retry-TCUBBFR5.js} +3 -2
  265. package/dist/{retry-726GKI6V.js.map → retry-TCUBBFR5.js.map} +1 -1
  266. package/dist/{run-P4KR2MXC.js → run-A5ZDXTOI.js} +4 -3
  267. package/dist/{run-P4KR2MXC.js.map → run-A5ZDXTOI.js.map} +1 -1
  268. package/dist/{run-MODGUNGT.js → run-EUO34T2J.js} +18 -17
  269. package/dist/{scaffold-ad-5ZE7KE62.js → scaffold-ad-SW2HEWM3.js} +13 -12
  270. package/dist/{scaffold-ad-5ZE7KE62.js.map → scaffold-ad-SW2HEWM3.js.map} +1 -1
  271. package/dist/{scaffold-static-ad-HJY5HFDL.js → scaffold-static-ad-ECTJL54Y.js} +37 -36
  272. package/dist/scaffold-static-ad-ECTJL54Y.js.map +1 -0
  273. package/dist/{scaffold-video-P2PYPWG2.js → scaffold-video-EI7U7RBK.js} +12 -11
  274. package/dist/{scaffold-video-P2PYPWG2.js.map → scaffold-video-EI7U7RBK.js.map} +1 -1
  275. package/dist/{schedule-RDK4GEPI.js → schedule-S5YZJZ5U.js} +3 -2
  276. package/dist/{schedule-RDK4GEPI.js.map → schedule-S5YZJZ5U.js.map} +1 -1
  277. package/dist/{scheduled-agents-6U44QE76.js → scheduled-agents-N4LJRM4C.js} +11 -11
  278. package/dist/{schema-CHJDC7GQ.js → schema-R7JWWOF4.js} +8 -4
  279. package/dist/{schema-CHJDC7GQ.js.map → schema-R7JWWOF4.js.map} +1 -1
  280. package/dist/{search-PMJRU3C4.js → search-KHMQH3AT.js} +3 -2
  281. package/dist/{search-PMJRU3C4.js.map → search-KHMQH3AT.js.map} +1 -1
  282. package/dist/{select-AB2L4GAA.js → select-O2FN2JEQ.js} +9 -8
  283. package/dist/{select-AB2L4GAA.js.map → select-O2FN2JEQ.js.map} +1 -1
  284. package/dist/{sends-WGJVQUMF.js → sends-BQZM5PLS.js} +5 -4
  285. package/dist/{sends-WGJVQUMF.js.map → sends-BQZM5PLS.js.map} +1 -1
  286. package/dist/{set-prompt-DU2G2WTB.js → set-prompt-2HASHGWC.js} +9 -8
  287. package/dist/{set-prompt-DU2G2WTB.js.map → set-prompt-2HASHGWC.js.map} +1 -1
  288. package/dist/{setup-links-REPREN3C.js → setup-links-GYSE56GX.js} +4 -3
  289. package/dist/{setup-links-REPREN3C.js.map → setup-links-GYSE56GX.js.map} +1 -1
  290. package/dist/{site-WFSWIA3S.js → site-4SKM7RKG.js} +5 -4
  291. package/dist/{site-WFSWIA3S.js.map → site-4SKM7RKG.js.map} +1 -1
  292. package/dist/{sources-YBQ6KPFM.js → sources-FQ2UZTHL.js} +6 -6
  293. package/dist/{sources-AMI2AWKZ.js → sources-R2NKNC6J.js} +10 -9
  294. package/dist/{sources-AMI2AWKZ.js.map → sources-R2NKNC6J.js.map} +1 -1
  295. package/dist/{stale-6MJHVEG4.js → stale-W756ACKC.js} +8 -7
  296. package/dist/{stale-6MJHVEG4.js.map → stale-W756ACKC.js.map} +1 -1
  297. package/dist/{status-7F2KHFGA.js → status-SE2VZJJB.js} +4 -3
  298. package/dist/{status-7F2KHFGA.js.map → status-SE2VZJJB.js.map} +1 -1
  299. package/dist/{stock-2YCDN3N6.js → stock-KXJ26BY4.js} +5 -5
  300. package/dist/{studio-RA7QQH4O.js → studio-SYKOSNDB.js} +1 -1
  301. package/dist/{sync-GWTLKZTU.js → sync-LJGSODK3.js} +3 -2
  302. package/dist/{sync-GWTLKZTU.js.map → sync-LJGSODK3.js.map} +1 -1
  303. package/dist/{sync-definition-IPUFS5XS.js → sync-definition-QR2N233R.js} +12 -11
  304. package/dist/{tags-KFYLZLB3.js → tags-4BAVFH4S.js} +3 -2
  305. package/dist/{tags-KFYLZLB3.js.map → tags-4BAVFH4S.js.map} +1 -1
  306. package/dist/{tags-ABHSX6M5.js → tags-5SBMRC2A.js} +4 -3
  307. package/dist/{tags-ABHSX6M5.js.map → tags-5SBMRC2A.js.map} +1 -1
  308. package/dist/{tags-3WPW6PTV.js → tags-PYWFSBTR.js} +4 -4
  309. package/dist/{tags-6342FQEB.js → tags-QQU3OKMZ.js} +4 -3
  310. package/dist/{tags-6342FQEB.js.map → tags-QQU3OKMZ.js.map} +1 -1
  311. package/dist/{tags-FJIBBBRG.js → tags-YYLNF3PK.js} +4 -3
  312. package/dist/{tags-FJIBBBRG.js.map → tags-YYLNF3PK.js.map} +1 -1
  313. package/dist/{targeting-criteria-NR47AF5C.js → targeting-criteria-RJFLFICN.js} +3 -3
  314. package/dist/{targets-L56KOVQE.js → targets-S2MT2PNB.js} +4 -3
  315. package/dist/{targets-L56KOVQE.js.map → targets-S2MT2PNB.js.map} +1 -1
  316. package/dist/{templates-B6XGDYUF.js → templates-ZE5TOGRT.js} +4 -3
  317. package/dist/{templates-B6XGDYUF.js.map → templates-ZE5TOGRT.js.map} +1 -1
  318. package/dist/{testimonials-CVC4YIXO.js → testimonials-DII5DYLR.js} +6 -6
  319. package/dist/{top-companies-45X3DT7Z.js → top-companies-PGIAEHDF.js} +4 -3
  320. package/dist/{top-companies-45X3DT7Z.js.map → top-companies-PGIAEHDF.js.map} +1 -1
  321. package/dist/{translate-Z66FDB4K.js → translate-GXTS633J.js} +12 -11
  322. package/dist/{translate-Z66FDB4K.js.map → translate-GXTS633J.js.map} +1 -1
  323. package/dist/{triggers-22EMIVFD.js → triggers-2PTONXRU.js} +4 -3
  324. package/dist/{triggers-22EMIVFD.js.map → triggers-2PTONXRU.js.map} +1 -1
  325. package/dist/{unlink-65KUN6ID.js → unlink-XRMYJ6DB.js} +4 -3
  326. package/dist/{unlink-65KUN6ID.js.map → unlink-XRMYJ6DB.js.map} +1 -1
  327. package/dist/{unstage-2E3I5SWF.js → unstage-FY7A3YFF.js} +4 -3
  328. package/dist/{unstage-2E3I5SWF.js.map → unstage-FY7A3YFF.js.map} +1 -1
  329. package/dist/{unstage-4ZEULXEQ.js → unstage-RM2RLXKD.js} +5 -4
  330. package/dist/{unstage-4ZEULXEQ.js.map → unstage-RM2RLXKD.js.map} +1 -1
  331. package/dist/{update-KREBPGBH.js → update-E5SRBXQR.js} +4 -3
  332. package/dist/{update-KREBPGBH.js.map → update-E5SRBXQR.js.map} +1 -1
  333. package/dist/{update-D6DJC6T7.js → update-PJ67D2OG.js} +3 -2
  334. package/dist/{update-D6DJC6T7.js.map → update-PJ67D2OG.js.map} +1 -1
  335. package/dist/{update-2S7CSEAW.js → update-S4562V3O.js} +4 -3
  336. package/dist/{update-2S7CSEAW.js.map → update-S4562V3O.js.map} +1 -1
  337. package/dist/{update-7NCOTAQZ.js → update-V6YVEUI2.js} +4 -3
  338. package/dist/{update-7NCOTAQZ.js.map → update-V6YVEUI2.js.map} +1 -1
  339. package/dist/{upload-O6NHRPS7.js → upload-R6CQVLKF.js} +4 -3
  340. package/dist/{upload-O6NHRPS7.js.map → upload-R6CQVLKF.js.map} +1 -1
  341. package/dist/{url-options-GGXAL3J4.js → url-options-JOKU46F2.js} +4 -3
  342. package/dist/{url-options-GGXAL3J4.js.map → url-options-JOKU46F2.js.map} +1 -1
  343. package/dist/{url-params-3EFGVTZZ.js → url-params-7U2XMOWF.js} +4 -3
  344. package/dist/{url-params-3EFGVTZZ.js.map → url-params-7U2XMOWF.js.map} +1 -1
  345. package/dist/{validate-UMHHNTVU.js → validate-7YPOUKPB.js} +10 -9
  346. package/dist/{validate-UMHHNTVU.js.map → validate-7YPOUKPB.js.map} +1 -1
  347. package/dist/{videos-YSXYGTBM.js → videos-LICG6ACJ.js} +5 -5
  348. package/dist/{web-IGIGVEKS.js → web-BA2PGTWU.js} +4 -3
  349. package/dist/{web-IGIGVEKS.js.map → web-BA2PGTWU.js.map} +1 -1
  350. package/dist/{winning-ads-2WS7FI4E.js → winning-ads-C6S2C5VP.js} +2 -2
  351. package/dist/{write-commands-5C7FUOVN.js → write-commands-7SJ3BOW5.js} +5 -4
  352. package/dist/{write-commands-5C7FUOVN.js.map → write-commands-7SJ3BOW5.js.map} +1 -1
  353. package/dist/{x-BFSKFCZD.js → x-CZHRC6U7.js} +6 -6
  354. package/package.json +1 -1
  355. package/dist/add-5GAN6CVO.js.map +0 -1
  356. package/dist/analytics-FKCXIMPO.js.map +0 -1
  357. package/dist/chunk-DWHIOO7E.js.map +0 -1
  358. package/dist/chunk-EDLZGTGN.js.map +0 -1
  359. package/dist/chunk-GKZ2WU75.js.map +0 -1
  360. package/dist/chunk-SSJK7FEV.js.map +0 -1
  361. package/dist/chunk-T2PC5AVH.js.map +0 -1
  362. package/dist/chunk-XF4JUKVF.js.map +0 -1
  363. package/dist/chunk-YRQYA2LR.js.map +0 -1
  364. package/dist/flows-KABCBS3S.js.map +0 -1
  365. package/dist/funnel-AAX27NH4.js.map +0 -1
  366. package/dist/get-QEYJRLV3.js.map +0 -1
  367. package/dist/scaffold-static-ad-HJY5HFDL.js.map +0 -1
  368. /package/dist/{actions-P35MEMGN.js.map → actions-6TQMSVWD.js.map} +0 -0
  369. /package/dist/{ads-73PGA4YC.js.map → ads-AGYCVD62.js.map} +0 -0
  370. /package/dist/{avatars-EKCKHCC3.js.map → avatars-467OSBD6.js.map} +0 -0
  371. /package/dist/{brand-C6PFGGQN.js.map → brand-YRTEPGBK.js.map} +0 -0
  372. /package/dist/{campaigns-KZYZTXDS.js.map → campaigns-OYMXDGWX.js.map} +0 -0
  373. /package/dist/{canvas-UJNSHD3B.js.map → canvas-YQFG52IG.js.map} +0 -0
  374. /package/dist/{catalog-ZQX6BGXS.js.map → catalog-XLXIM7IW.js.map} +0 -0
  375. /package/dist/{chunk-7YCRFMXF.js.map → chunk-24EB7EDR.js.map} +0 -0
  376. /package/dist/{chunk-5ZDLTE5T.js.map → chunk-2AOE2MZQ.js.map} +0 -0
  377. /package/dist/{chunk-4SG4RW2P.js.map → chunk-2VPBIT65.js.map} +0 -0
  378. /package/dist/{chunk-NPY4QUMQ.js.map → chunk-54C6YDGJ.js.map} +0 -0
  379. /package/dist/{chunk-LZ73CZGP.js.map → chunk-5WCSKQ7Z.js.map} +0 -0
  380. /package/dist/{chunk-3G3ZDLMI.js.map → chunk-5ZNTADVR.js.map} +0 -0
  381. /package/dist/{chunk-AEOSAVVL.js.map → chunk-6F7DVPOS.js.map} +0 -0
  382. /package/dist/{chunk-CJCVIEJ5.js.map → chunk-6NY2GPR4.js.map} +0 -0
  383. /package/dist/{chunk-CXWFX2AM.js.map → chunk-6Y7ZBENQ.js.map} +0 -0
  384. /package/dist/{chunk-M242LHLX.js.map → chunk-7CTMH5AK.js.map} +0 -0
  385. /package/dist/{chunk-QD7ESRLN.js.map → chunk-C46GUI2S.js.map} +0 -0
  386. /package/dist/{chunk-6N6WKAJM.js.map → chunk-CWYAELVG.js.map} +0 -0
  387. /package/dist/{chunk-MXYBTMKB.js.map → chunk-DCRPXOJJ.js.map} +0 -0
  388. /package/dist/{chunk-JQJDXPCO.js.map → chunk-FUHN4MFY.js.map} +0 -0
  389. /package/dist/{chunk-S77PZVYM.js.map → chunk-FYGR3I2A.js.map} +0 -0
  390. /package/dist/{chunk-OZRUJVIQ.js.map → chunk-H3427GPU.js.map} +0 -0
  391. /package/dist/{chunk-IR6D7K4H.js.map → chunk-I3ZR655O.js.map} +0 -0
  392. /package/dist/{chunk-YK32GUBN.js.map → chunk-KMKEYI37.js.map} +0 -0
  393. /package/dist/{chunk-W3ZHJJVT.js.map → chunk-KS2QY6MK.js.map} +0 -0
  394. /package/dist/{chunk-WNRV4QH7.js.map → chunk-LYQJ4PZW.js.map} +0 -0
  395. /package/dist/{chunk-CSYSX4D2.js.map → chunk-N4LAYIIN.js.map} +0 -0
  396. /package/dist/{chunk-4AUMTNVB.js.map → chunk-NA63BH7V.js.map} +0 -0
  397. /package/dist/{chunk-4BQXAE7Z.js.map → chunk-NDEE6G2J.js.map} +0 -0
  398. /package/dist/{chunk-MELOSESI.js.map → chunk-R25YLW6H.js.map} +0 -0
  399. /package/dist/{chunk-Y6O7EWYY.js.map → chunk-RL5CP7N6.js.map} +0 -0
  400. /package/dist/{chunk-DGUNI37S.js.map → chunk-RX2DKU3W.js.map} +0 -0
  401. /package/dist/{chunk-VTDMKARH.js.map → chunk-ULG4QRTV.js.map} +0 -0
  402. /package/dist/{chunk-QRP3PXWN.js.map → chunk-VL43TNIP.js.map} +0 -0
  403. /package/dist/{chunk-SHL7LOC3.js.map → chunk-VLMBTPXU.js.map} +0 -0
  404. /package/dist/{chunk-KHRXPQID.js.map → chunk-VYQ3QJ3C.js.map} +0 -0
  405. /package/dist/{chunk-A4LOJ2VD.js.map → chunk-WGUQHAJY.js.map} +0 -0
  406. /package/dist/{chunk-ZEYEWPK6.js.map → chunk-WKQG6TER.js.map} +0 -0
  407. /package/dist/{chunk-3IBYKLXR.js.map → chunk-ZDMTXQ2Q.js.map} +0 -0
  408. /package/dist/{connect-QCOGEPP4.js.map → connect-FCXNVTXG.js.map} +0 -0
  409. /package/dist/{creatives-NJF2U763.js.map → creatives-FXUQ5WSD.js.map} +0 -0
  410. /package/dist/{customers-A36LOZOB.js.map → customers-XH2DMTFH.js.map} +0 -0
  411. /package/dist/{feedback-PPQMOQ46.js.map → feedback-EIZKS4JU.js.map} +0 -0
  412. /package/dist/{find-OTDIX6V4.js.map → find-FRRHAPWX.js.map} +0 -0
  413. /package/dist/{fonts-EMMX3KII.js.map → fonts-MXR3ZKDX.js.map} +0 -0
  414. /package/dist/{ga4-UDQ2HA2J.js.map → ga4-DV2AXCSL.js.map} +0 -0
  415. /package/dist/{google-M7KEXVK5.js.map → google-6OGZX47I.js.map} +0 -0
  416. /package/dist/{google-KTO3PLEU.js.map → google-QYYYSSXI.js.map} +0 -0
  417. /package/dist/{gsc-P3QYGDV2.js.map → gsc-TAKOF7J5.js.map} +0 -0
  418. /package/dist/{icon-I43F77FV.js.map → icon-L4RSS6PZ.js.map} +0 -0
  419. /package/dist/{ideas-MIDU7YOA.js.map → ideas-NFOW3HKJ.js.map} +0 -0
  420. /package/dist/{images-S254MS6O.js.map → images-2EFFUNNV.js.map} +0 -0
  421. /package/dist/{ingest-YV2NLDBE.js.map → ingest-2EIKN4QC.js.map} +0 -0
  422. /package/dist/{inspiration-P265QJ2H.js.map → inspiration-S3DU4CMQ.js.map} +0 -0
  423. /package/dist/{landing-CJYGWCK4.js.map → landing-2ZB46LXH.js.map} +0 -0
  424. /package/dist/{line-items-7ZGIKEF2.js.map → line-items-5NECXUZT.js.map} +0 -0
  425. /package/dist/{logo-2IP663QO.js.map → logo-Q5D7PZY6.js.map} +0 -0
  426. /package/dist/{lookup-XK45W2SH.js.map → lookup-ETWY47F7.js.map} +0 -0
  427. /package/dist/{media-sources-O6ZRUA3N.js.map → media-sources-ZXHEEP6T.js.map} +0 -0
  428. /package/dist/{performance-6QW2KEEQ.js.map → performance-UF5VTY2U.js.map} +0 -0
  429. /package/dist/{promoted-tweets-SURKMHFI.js.map → promoted-tweets-LZKS5JIF.js.map} +0 -0
  430. /package/dist/{reddit-GIP3ADMS.js.map → reddit-NU2N3LZD.js.map} +0 -0
  431. /package/dist/{research-2BLEISBG.js.map → research-FMM6AWZC.js.map} +0 -0
  432. /package/dist/{run-MODGUNGT.js.map → run-EUO34T2J.js.map} +0 -0
  433. /package/dist/{scheduled-agents-6U44QE76.js.map → scheduled-agents-N4LJRM4C.js.map} +0 -0
  434. /package/dist/{sources-YBQ6KPFM.js.map → sources-FQ2UZTHL.js.map} +0 -0
  435. /package/dist/{stock-2YCDN3N6.js.map → stock-KXJ26BY4.js.map} +0 -0
  436. /package/dist/{studio-RA7QQH4O.js.map → studio-SYKOSNDB.js.map} +0 -0
  437. /package/dist/{sync-definition-IPUFS5XS.js.map → sync-definition-QR2N233R.js.map} +0 -0
  438. /package/dist/{tags-3WPW6PTV.js.map → tags-PYWFSBTR.js.map} +0 -0
  439. /package/dist/{targeting-criteria-NR47AF5C.js.map → targeting-criteria-RJFLFICN.js.map} +0 -0
  440. /package/dist/{testimonials-CVC4YIXO.js.map → testimonials-DII5DYLR.js.map} +0 -0
  441. /package/dist/{videos-YSXYGTBM.js.map → videos-LICG6ACJ.js.map} +0 -0
  442. /package/dist/{winning-ads-2WS7FI4E.js.map → winning-ads-C6S2C5VP.js.map} +0 -0
  443. /package/dist/{x-BFSKFCZD.js.map → x-CZHRC6U7.js.map} +0 -0
@@ -16,15 +16,15 @@ Examples:
16
16
  baker testimonials sources remove <source-id>`
17
17
  },
18
18
  subCommands: {
19
- add: () => import("./add-6DTC6X5G.js").then((m) => m.addCommand),
19
+ add: () => import("./add-LEMKEOPO.js").then((m) => m.addCommand),
20
20
  list: () => import("./list-LI4OGQFW.js").then((m) => m.listCommand),
21
- sync: () => import("./sync-GWTLKZTU.js").then((m) => m.syncCommand),
22
- schedule: () => import("./schedule-RDK4GEPI.js").then((m) => m.scheduleCommand),
23
- reset: () => import("./reset-OLVB6AE6.js").then((m) => m.resetCommand),
24
- remove: () => import("./remove-6FIVKCJI.js").then((m) => m.removeCommand)
21
+ sync: () => import("./sync-LJGSODK3.js").then((m) => m.syncCommand),
22
+ schedule: () => import("./schedule-S5YZJZ5U.js").then((m) => m.scheduleCommand),
23
+ reset: () => import("./reset-Y72IVESB.js").then((m) => m.resetCommand),
24
+ remove: () => import("./remove-QPSWLFI4.js").then((m) => m.removeCommand)
25
25
  }
26
26
  });
27
27
  export {
28
28
  sourcesCommand
29
29
  };
30
- //# sourceMappingURL=sources-YBQ6KPFM.js.map
30
+ //# sourceMappingURL=sources-FQ2UZTHL.js.map
@@ -1,36 +1,37 @@
1
1
  import {
2
2
  hubspotDefaultMapping,
3
3
  hubspotTriggerInputSchema
4
- } from "./chunk-AEOSAVVL.js";
4
+ } from "./chunk-6F7DVPOS.js";
5
5
  import {
6
6
  hubspotRefusal
7
- } from "./chunk-SHL7LOC3.js";
8
- import "./chunk-7YCRFMXF.js";
7
+ } from "./chunk-VLMBTPXU.js";
8
+ import "./chunk-24EB7EDR.js";
9
9
  import "./chunk-GRQ2AXDX.js";
10
10
  import {
11
11
  ConversionArgsError,
12
12
  onlyOnce
13
- } from "./chunk-RPUSTYHL.js";
14
- import "./chunk-SSJK7FEV.js";
13
+ } from "./chunk-HDLYPC6K.js";
14
+ import "./chunk-4PDHHHUJ.js";
15
15
  import {
16
16
  SOURCE_FIELD_NAMES,
17
17
  mappingRowProblem,
18
18
  templateMentions
19
- } from "./chunk-EDLZGTGN.js";
19
+ } from "./chunk-NYIGXDUG.js";
20
20
  import {
21
21
  writeJsonEnvelope
22
22
  } from "./chunk-VFIOJD5M.js";
23
- import "./chunk-3HJLHTWP.js";
23
+ import "./chunk-SJYEY5MV.js";
24
24
  import {
25
25
  HUBSPOT_DEAL_CONTACTS,
26
26
  HUBSPOT_OBJECTS,
27
27
  REJECTION_MESSAGES,
28
28
  readsAssociatedContact,
29
29
  validateEventName
30
- } from "./chunk-XF4JUKVF.js";
30
+ } from "./chunk-7EPXVICM.js";
31
31
  import "./chunk-GXDLWBOY.js";
32
32
  import "./chunk-TEINLN64.js";
33
33
  import "./chunk-ZJWUBJYQ.js";
34
+ import "./chunk-HR6IWNKE.js";
34
35
  import "./chunk-NE4F3FHN.js";
35
36
  import {
36
37
  ApiError,
@@ -418,4 +419,4 @@ export {
418
419
  sourcesCommand,
419
420
  sourcesRequest
420
421
  };
421
- //# sourceMappingURL=sources-AMI2AWKZ.js.map
422
+ //# sourceMappingURL=sources-R2NKNC6J.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commands/analytics/sources.ts"],"sourcesContent":["import { REJECTION_MESSAGES, validateEventName } from \"@baker/api/event-ingest\";\nimport {\n HUBSPOT_DEAL_CONTACTS,\n HUBSPOT_OBJECTS,\n type HubspotDealContacts,\n type HubspotObject,\n hubspotDefaultMapping,\n hubspotTriggerInputSchema,\n mappingRowProblem,\n readsAssociatedContact,\n SOURCE_FIELD_NAMES,\n type SourcesRequestInput,\n type SourcesResponse,\n templateMentions,\n} from \"@baker/api/event-sources\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiPost } from \"../../client.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { writeJsonEnvelope } from \"../ads/output.ts\";\nimport { hubspotRefusal } from \"../hubspot/refusal.ts\";\nimport { ConversionArgsError, onlyOnce } from \"./conversionArgs.ts\";\n\n/**\n * `baker analytics sources` — an address for each of the client's own tools to\n * send events to, and what each one's payloads are read as.\n *\n * ## Why a URL and not a key\n *\n * `POST /v1/events` needs the sender to write code to our contract. A CRM's\n * webhook, an automation platform, a billing system cannot be told what to\n * send — they post what they post, to a URL, and set nothing else. A source\n * is that URL: the token in it is the whole credential, the first send\n * teaches Baker the shape, and a person confirms once which path is the\n * email, which the amount. From then on every arrival is an ordinary event.\n *\n * ## `--field` and `--value` repeat, and citty keeps only the last\n *\n * citty hands the LAST value of a repeated flag over as a plain string, so\n * `--field email=a --field value=b` would map `value` and silently drop\n * `email`, and `--value lead --value customer` would watch `customer` alone.\n * Both are read off `process.argv` instead, the way `conversions` reads its\n * repeats.\n */\n\nconst args = {\n server: {\n type: \"boolean\",\n description:\n \"The client's own server door: one address for their developers, made once and the same for ever after, counting at once in Baker's own format (`baker analytics sending-events` has the contract). Prints it; nothing else to set\",\n required: false,\n },\n create: {\n type: \"boolean\",\n description:\n \"Make an address for a tool that cannot be told what to send (a CRM webhook, an automation step). Needs --name. Its first send is kept as a sample and counted as nothing until --map\",\n required: false,\n },\n \"create-hubspot\": {\n type: \"boolean\",\n description:\n \"Make a HubSpot event: HubSpot keeps each change to --property for Baker (Baker's app subscribes the account to that property with the condition as HubSpot's own filter, and nothing else), and every contact whose new value satisfies --operator --value is an event, counted within a minute. Needs --property (names, kinds and operators from `baker hubspot contacts properties`); --operator defaults to `is`; --value repeats for a list (`is` on a dropdown) or a between; --name is optional and defaults to the trigger's words; --field rows (names from `baker hubspot contacts fields`) replace the default rows they name. Counts from now on, never earlier contacts\",\n required: false,\n },\n \"set-trigger\": {\n type: \"boolean\",\n description:\n \"Change what a HubSpot event watches. Needs --source and the same --property --operator --value as --create-hubspot. The rows stay; it counts from now on under the new trigger\",\n required: false,\n },\n preview: {\n type: \"boolean\",\n description:\n \"Ask HubSpot what --property --operator --value would count today, and read one real contact — the one most recently there, or --contact — with the properties the --field rows mention (the defaults when none), to check every row against real data BEFORE --create-hubspot. Makes nothing\",\n required: false,\n },\n object: {\n type: \"string\",\n description:\n \"With --create-hubspot or --preview: what the trigger is on — `contact` (the default), `deal` or `lead`. A deal's and a lead's event is about the contact the record is associated with: its rows read the record's own properties bare ({{amount}}, {{dealstage}}, {{hs_pipeline_stage}}) and the contact's as {{contact.<name>}} (`baker hubspot deals fields` / `baker hubspot leads fields`). A deal's amount defaults to its own amount in its currency; a lead has none, so it counts the step rather than money. Use `lead` for qualification and disqualification — HubSpot records both as a lead stage, and nothing on the contact or the deal says a lead was disqualified\",\n required: false,\n },\n contacts: {\n type: \"string\",\n description:\n \"With --object deal or --object lead (on --create-hubspot or --set-trigger): whose event it is — `every` (the default: every contact on the record, each its own event; on a deal each worth the deal's amount) or `first` (the record's first contact only)\",\n required: false,\n },\n property: {\n type: \"string\",\n description:\n \"With --create-hubspot, --set-trigger or --preview: the property to watch, by HubSpot's internal name (lifecyclestage, hs_lead_status, a custom one on a contact; dealstage, amount, closedate on a deal; hs_pipeline_stage, hs_lead_label on a lead) — any property, whatever its kind\",\n required: false,\n },\n operator: {\n type: \"string\",\n description:\n \"With --property: how the property has to read. By the property's kind — select: is, isNot, isEmpty, isNotEmpty · text: is, isNot, contains, doesNotContain, startsWith, endsWith, isEmpty, isNotEmpty · number: equal, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual, isEmpty, isNotEmpty · date: is, isBefore, isAfter, isOnOrBefore, isOnOrAfter, isBetween, isEmpty, isNotEmpty · yes/no: is, isNot. `is` when unsaid\",\n required: false,\n },\n value: {\n type: \"string\",\n description:\n \"With --property: the value, as HubSpot spells it — a dropdown's internal value (customer, QUALIFIED…), a number, a YYYY-MM-DD, true/false. Repeat it for a list (--value lead --value customer) or the two ends of isBetween; none for isEmpty / isNotEmpty\",\n required: false,\n },\n conditions: {\n type: \"string\",\n description:\n 'With --create-hubspot, --set-trigger or --preview, instead of --property/--operator/--value: several conditions combined the way a Form\\'s filter combines them, as JSON — `{\"logic\":\"And\",\"conditions\":[{\"property\":\"lifecyclestage\",\"values\":[\"customer\"]},{\"logic\":\"Or\",\"conditions\":[{\"property\":\"country\",\"values\":[\"Spain\"]},{\"property\":\"amount\",\"operator\":\"greaterThan\",\"values\":[\"1000\"]}]}]}`. `logic` is And (every row) or Or (any row); a row is a condition or a group with its own logic, one level deep; at most 10 conditions. The event fires when a change to any named property makes the whole combination hold',\n required: false,\n },\n contact: {\n type: \"string\",\n description:\n \"With --preview: the record to draw the sample from — a HubSpot id, or text to search (an email or a name for a contact, a deal's or a lead's name). The one most recently satisfying the trigger when unsaid\",\n required: false,\n },\n \"amount-property\": {\n type: \"string\",\n description:\n \"With --create-hubspot or --set-amount: a NUMBER property of the watched object to read as the event's amount (a deal value synced onto the contact; a deal's own `amount` is read by default on a deal). Needs --currency beside it\",\n required: false,\n },\n currency: {\n type: \"string\",\n description: \"With --amount-property: the three-letter currency the property is in, like EUR or USD\",\n required: false,\n },\n \"set-amount\": {\n type: \"boolean\",\n description:\n \"Change where a HubSpot-read source takes its amount from. Needs --source; with --amount-property and --currency it reads them, with neither it stops reading an amount\",\n required: false,\n },\n backfill: {\n type: \"boolean\",\n description:\n \"Count a HubSpot event's history: every moment its trigger came to hold since --since, at the instant HubSpot says it did. Needs --source and --since. Nothing is invented — a record that merely satisfies the trigger today is not an event today, and only moments HubSpot has a timestamp for are counted. Dry without --write. Reach for it when an event was made after the deals it should have counted, or after fixing one that was refusing everything it received\",\n required: false,\n },\n since: {\n type: \"string\",\n description:\n \"With --backfill: the date to count this event's history from, `2026-09-19` or an ISO instant. At most 400 days back — the store keeps no more\",\n required: false,\n },\n before: {\n type: \"string\",\n description:\n \"With --backfill: carry on from where a capped run stopped, by passing back the `reachedBack` it returned. One run reads at most 500 records, most recently changed first, so a capped run has covered the newest and the rest are the ones nearest --since — narrowing --since cannot reach them, this can. Repeat until `capped` is false; nothing is counted twice. It bounds which records are read, never which of their moments count: those are still the whole of --since to now\",\n required: false,\n },\n write: {\n type: \"boolean\",\n description:\n \"With --backfill: actually count what it found. Without it nothing is counted and the answer says what would be. Events inside the last 72 hours are uploaded to this event's ad platforms within minutes of counting, which spends real budget\",\n required: false,\n },\n name: {\n type: \"string\",\n description:\n \"The tool the source is for — HubSpot, Zapier, Stripe. It is the event's name when the payload does not say one, and every event it sends carries it as `baker_source`\",\n required: false,\n },\n map: {\n type: \"boolean\",\n description:\n \"Set what each field is read from. For an address this starts counting; needs --source, and one --field per row. With no --field the guess is used, which is right for a tool already sending Baker's own format. For a HubSpot-read source it replaces the whole mapping (the row list is on the source as `mapping`; empty means HubSpot's standard properties), so repeat every row you want kept\",\n required: false,\n },\n source: { type: \"string\", description: \"The source id, from the list\", required: false },\n field: {\n type: \"string\",\n description: `<field>=<template>, repeatable. A template is text with {{path}} mentions, one thing per mention: --field email={{contact.email}} --field currency=EUR --field first_name=\"{{who.first}} {{who.last}}\". A bare path (--field email=contact.email) is read as its mention when the sample has that path, so the short spelling still works. Fields: ${SOURCE_FIELD_NAMES.join(\", \")}. An EXTRA PROPERTY of the event — a plan, a stage, anything Measure → Events should break it down by and a send may pass on to a platform — is --field properties.<name>=<template>, e.g. --field properties.plan={{plan_tier}}. Paths come from \\`paths\\` on the source's sample; for a HubSpot event they are contact property names (\\`baker hubspot contacts fields\\`) plus \\`id\\` for the contact id`,\n required: false,\n },\n pause: {\n type: \"boolean\",\n description: \"Stop counting a source's arrivals; they are answered and dropped. Needs --source\",\n required: false,\n },\n resume: { type: \"boolean\", description: \"Count a paused source's arrivals again. Needs --source\", required: false },\n remove: {\n type: \"boolean\",\n description: \"Delete a source; its address stops working at once. Needs --source\",\n required: false,\n },\n full: {\n type: \"boolean\",\n description:\n \"Also return each source's masked sample body. The paths and the guess are always returned; the body is only for reading what a path held\",\n required: false,\n },\n} as const;\n\nregisterSchema({\n command: \"analytics.sources\",\n description:\n \"Where events reach Baker from a server: the client's own server door, and HubSpot events Baker reads — what each one watches and reads, and how it is doing\",\n args,\n});\n\n/** The value a repeated flag carries at this position, in either spelling, or nothing. */\nfunction flagValueAt(argv: readonly string[], flag: string, index: number): string | undefined {\n const arg = argv[index] ?? \"\";\n if (arg === flag) return argv[index + 1];\n return arg.startsWith(`${flag}=`) ? arg.slice(flag.length + 1) : undefined;\n}\n\n/** Every value of a repeated flag on the command line, in order. */\nexport function parseRepeated(argv: readonly string[], flag: string): string[] {\n const values: string[] = [];\n for (let index = 0; index < argv.length; index += 1) {\n const value = flagValueAt(argv, flag, index);\n if (value !== undefined) values.push(value);\n }\n return values;\n}\n\n/** Every `--field k=v` on the command line, in order, refusing a malformed one. */\nexport function parseFieldArgs(argv: readonly string[]): Record<string, string> {\n const mapping: Record<string, string> = {};\n for (const pair of parseRepeated(argv, \"--field\")) {\n const eq = pair.indexOf(\"=\");\n const field = eq === -1 ? pair : pair.slice(0, eq);\n const path = eq === -1 ? \"\" : pair.slice(eq + 1).trim();\n const problem = mappingRowProblem(field);\n if (problem !== null) throw new ConversionArgsError(problem);\n if (path === \"\") throw new ConversionArgsError(`--field ${field} needs a path: --field ${field}=<dotted.path>.`);\n mapping[field] = path;\n }\n return mapping;\n}\n\n/** The amount pair, which travels together or not at all. */\nfunction amountArgs(raw: Record<string, unknown>, argv: readonly string[]) {\n const amountProperty = onlyOnce(raw[\"amount-property\"], \"--amount-property\", argv);\n const currency = onlyOnce(raw.currency, \"--currency\", argv);\n if ((amountProperty === undefined) !== (currency === undefined)) {\n throw new ConversionArgsError(\"--amount-property and --currency go together: name both or neither.\");\n }\n return {\n ...(amountProperty === undefined ? {} : { amountProperty }),\n ...(currency === undefined ? {} : { currency }),\n };\n}\n\nconst NO_VALUE_OPERATORS = new Set([\"isEmpty\", \"isNotEmpty\"]);\n\n/**\n * The trigger every HubSpot verb needs: the property, how it has to read,\n * and the values — repeated on the command line, read off argv. Refused with\n * where the names come from; what the property's kind allows is checked\n * against the account by the backend.\n */\nfunction triggerArgs(raw: Record<string, unknown>, argv: readonly string[], verb: string): TriggerInput {\n const conditions = onlyOnce(raw.conditions, \"--conditions\", argv);\n if (conditions !== undefined) return conditionsArg(conditions, raw, verb);\n const property = onlyOnce(raw.property, \"--property\", argv);\n const operator = onlyOnce(raw.operator, \"--operator\", argv) ?? \"is\";\n // The last --value is what citty kept; every one is what was typed.\n const values = argv.length === 0 && typeof raw.value === \"string\" ? [raw.value] : parseRepeated(argv, \"--value\");\n if (property === undefined) {\n throw new ConversionArgsError(\n `--${verb} needs --property <name> [--operator <op>] --value <value>…, from \\`baker hubspot contacts properties\\`.`,\n );\n }\n if (values.length === 0 && !NO_VALUE_OPERATORS.has(operator)) {\n throw new ConversionArgsError(\n `--${verb} needs --value <value> (repeat it for a list); only --operator isEmpty / isNotEmpty take none.`,\n );\n }\n return { property, operator, values };\n}\n\ntype TriggerInput = NonNullable<SourcesRequestInput[\"createHubspot\"]>[\"trigger\"];\n\n/** `--conditions <json>`: a combination, checked for shape here so a typo is refused before the call. */\nfunction conditionsArg(text: string, raw: Record<string, unknown>, verb: string): TriggerInput {\n if (raw.property !== undefined || raw.value !== undefined || raw.operator !== undefined) {\n throw new ConversionArgsError(`--${verb} takes --conditions or --property/--operator/--value, not both.`);\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n throw new ConversionArgsError(\n '--conditions is JSON: {\"logic\":\"And\",\"conditions\":[{\"property\":\"lifecyclestage\",\"values\":[\"customer\"]}]}.',\n );\n }\n const checked = hubspotTriggerInputSchema.safeParse(parsed);\n if (!checked.success) {\n throw new ConversionArgsError(`--conditions: ${checked.error.issues.map((issue) => issue.message).join(\"; \")}`);\n }\n return parsed as TriggerInput;\n}\n\n/** `--object contact|deal`, spelled the two ways the wire takes and nothing else. */\nfunction objectArg(raw: Record<string, unknown>, argv: readonly string[]): HubspotObject {\n const object = onlyOnce(raw.object, \"--object\", argv) ?? \"contact\";\n if (!(HUBSPOT_OBJECTS as readonly string[]).includes(object)) {\n throw new ConversionArgsError(`--object is one of ${HUBSPOT_OBJECTS.join(\", \")}, not \"${object}\".`);\n }\n return object as HubspotObject;\n}\n\n/** `--contacts first|every`, which only means something on a deal or a lead. */\nfunction contactsArg(raw: Record<string, unknown>, argv: readonly string[]): HubspotDealContacts | undefined {\n const contacts = onlyOnce(raw.contacts, \"--contacts\", argv);\n if (contacts === undefined) return undefined;\n if (!(HUBSPOT_DEAL_CONTACTS as readonly string[]).includes(contacts)) {\n throw new ConversionArgsError(`--contacts is one of ${HUBSPOT_DEAL_CONTACTS.join(\", \")}, not \"${contacts}\".`);\n }\n return contacts as HubspotDealContacts;\n}\n\nfunction createHubspotArgs(\n raw: Record<string, unknown>,\n argv: readonly string[],\n name: string | undefined,\n): NonNullable<SourcesRequestInput[\"createHubspot\"]> {\n const mapping = parseFieldArgs(argv);\n const object = objectArg(raw, argv);\n const contacts = contactsArg(raw, argv);\n if (contacts !== undefined && !readsAssociatedContact(object)) {\n throw new ConversionArgsError(\n \"--contacts says whose event a deal's or a lead's is; it needs --object deal or --object lead.\",\n );\n }\n return {\n // A contact is the wire's default, so it is left unsaid — the way the schema reads it back.\n ...(object === \"contact\" ? {} : { object }),\n trigger: triggerArgs(raw, argv, \"create-hubspot\"),\n ...(contacts === undefined ? {} : { contacts }),\n ...(name === undefined ? {} : { name }),\n ...(Object.keys(mapping).length === 0 ? {} : { mapping }),\n ...amountArgs(raw, argv),\n };\n}\n\n/** What to read off the sample contact: whatever the rows mention, or the default rows' properties. */\nfunction previewArgs(\n raw: Record<string, unknown>,\n argv: readonly string[],\n): NonNullable<SourcesRequestInput[\"preview\"]> {\n const rows = parseFieldArgs(argv);\n const object = objectArg(raw, argv);\n const templates = Object.values(Object.keys(rows).length === 0 ? hubspotDefaultMapping(\"\", object) : rows);\n const properties = [...new Set(templates.flatMap((template) => templateMentions(template ?? \"\")))];\n const contact = onlyOnce(raw.contact, \"--contact\", argv);\n return {\n ...(object === \"contact\" ? {} : { object }),\n trigger: triggerArgs(raw, argv, \"preview\"),\n properties,\n ...(contact === undefined ? {} : { contact }),\n };\n}\n\nconst VERBS = [\n \"server\",\n \"create\",\n \"create-hubspot\",\n \"set-trigger\",\n \"preview\",\n \"backfill\",\n \"set-amount\",\n \"map\",\n \"pause\",\n \"resume\",\n \"remove\",\n] as const;\n\n/**\n * The name, refused here when the ingest door could never accept it.\n *\n * A source's name is the `event_name` of every event it raises, so this is\n * not a label being tidied: a name outside the rule makes a source that\n * counts **nothing**, for ever, while `baker analytics sources` goes on\n * listing it as counting and the only trace is one red line per event on the\n * feed. The contract refuses it too (`sourceNameSchema`), but that comes back\n * as a wire-validation error; the agent is better served by the sentence.\n */\nfunction checkedName(raw: Record<string, unknown>, argv: readonly string[]): string | undefined {\n const name = onlyOnce(raw.name, \"--name\", argv);\n if (name === undefined || validateEventName(name) === null) return name;\n throw new ConversionArgsError(\n `\"${name}\" cannot be an event name, and the name is what every event this source raises will carry. ${REJECTION_MESSAGES.invalid_name}`,\n );\n}\n\n/** What a backfill reads back to, and whether it counts what it finds. */\nfunction backfillArgs(\n raw: Record<string, unknown>,\n argv: readonly string[],\n sourceId: string,\n): NonNullable<SourcesRequestInput[\"backfill\"]> {\n const since = onlyOnce(raw.since, \"--since\", argv);\n if (since === undefined) {\n throw new ConversionArgsError(\n \"--backfill needs --since <date>, e.g. --since 2026-09-19. Nothing before it is read.\",\n );\n }\n const before = onlyOnce(raw.before, \"--before\", argv);\n return {\n sourceId,\n since,\n ...(before === undefined ? {} : { before }),\n ...(raw.write === true ? { write: true } : {}),\n };\n}\n\nexport function sourcesRequest(raw: Record<string, unknown>, argv: readonly string[]): SourcesRequestInput {\n const name = checkedName(raw, argv);\n const source = onlyOnce(raw.source, \"--source\", argv);\n const verbs = VERBS.filter((verb) => raw[verb] === true);\n if (verbs.length > 1) throw new ConversionArgsError(`One of --${verbs.join(\", --\")} per call.`);\n const verb = verbs[0];\n if (verb === undefined) return {};\n if (verb === \"server\") return { server: {} };\n if (verb === \"create\") {\n if (name === undefined) throw new ConversionArgsError(\"--create needs --name <tool>.\");\n return { create: { name } };\n }\n if (verb === \"create-hubspot\") return { createHubspot: createHubspotArgs(raw, argv, name) };\n if (verb === \"preview\") return { preview: previewArgs(raw, argv) };\n if (source === undefined) throw new ConversionArgsError(`--${verb} needs --source <id>, from the list.`);\n if (verb === \"backfill\") return { backfill: backfillArgs(raw, argv, source) };\n if (verb === \"set-trigger\") {\n const contacts = contactsArg(raw, argv);\n return {\n setTrigger: {\n sourceId: source,\n trigger: triggerArgs(raw, argv, verb),\n ...(contacts === undefined ? {} : { contacts }),\n },\n };\n }\n if (verb === \"set-amount\") return { setAmount: { sourceId: source, ...amountArgs(raw, argv) } };\n if (verb === \"map\") return { map: { sourceId: source, mapping: parseFieldArgs(argv) } };\n return { [verb]: { sourceId: source } };\n}\n\nfunction handleError(err: unknown): never {\n if (err instanceof ApiError) {\n // A HubSpot event needs HubSpot connected, and allowed to read what it watches.\n const refusal = hubspotRefusal(err.code, err.message);\n writeJsonEnvelope({\n ok: false,\n error:\n refusal === null\n ? { code: err.code, message: err.message }\n : { code: refusal.code, message: err.message, fix: refusal.fix },\n });\n process.exit(1);\n }\n writeJsonEnvelope({\n ok: false,\n error: { code: \"NETWORK_ERROR\", message: err instanceof Error ? err.message : \"Unexpected error\" },\n });\n process.exit(1);\n}\n\nexport const sourcesCommand = defineCommand({\n meta: {\n name: \"sources\",\n description:\n 'Where events reach Baker from a server, and what each one reads. Two doors. **The client\\'s own server**: `--server` prints one address for their developers — made once, the same for ever, counting at once, Baker\\'s own `POST /v1/events` format (`baker analytics sending-events` has the contract, `X-Baker-Mode: test` rehearses). **HubSpot events**: HubSpot keeps each change to a watched property in a journal Baker reads every half minute — Baker\\'s app subscribes the account to that one property with the condition as HubSpot\\'s own filter, so an account with a million contacts costs nothing to watch — on every plan, nothing to set up in HubSpot. The trigger is *when a contact\\'s* property satisfies a condition — the same conditions a Form\\'s filters take: `--property lifecyclestage --value customer` (a dropdown; `--value lead --value customer` for either), `--property deal_value --operator greaterThan --value 1000`, `--property email --operator endsWith --value @acme.com`, `--property closed_at --operator isAfter --value 2026-01-01`, `--property phone --operator isEmpty`. Several conditions combine the way a Form\\'s filter does — `--conditions \\'{\"logic\":\"And\",\"conditions\":[{\"property\":\"lifecyclestage\",\"values\":[\"customer\"]},{\"property\":\"country\",\"values\":[\"Spain\"]}]}\\'` (AND / OR, groups one level deep, 10 conditions at most) in place of --property/--operator/--value, on --create-hubspot, --set-trigger and --preview; the event fires when a change to any named property makes the whole combination hold. `baker hubspot contacts properties` lists every property with its kind, the operators that kind takes and a dropdown\\'s values; `baker hubspot contacts fields` every property a row can read. `--preview --property … [--operator …] --value … [--field …] [--contact <id or email>]` says how many contacts satisfy it today (NOT counted — only contacts that come to satisfy it from now on are) and reads one real contact so every row can be checked against real data; then `--create-hubspot --property … --value … --name \"Deal won\" --field email={{work_email}} --field value={{deal_value}} --field currency=EUR` makes the event, rows over the defaults (email, phone, the contact id, name, address, hs_google_click_id, hs_facebook_click_id). `--set-trigger --source <id> --property … --operator … --value …` changes what an event watches later (rows kept, counting from now on). Every row is a template — text with {{property}} mentions, one thing per mention; `--map --source <id> --field …` replaces the whole row set later, `--amount-property <number property> --currency EUR` is the short spelling for the amount rows. Each event is an ordinary event named after the source, carrying `baker_source`, listed by `feed --source <name>`, counted with `conversions` under `page:<name>`, and sent to the ad platforms with `sends`. `--pause`, `--resume`, `--remove` by --source. `--create --name <tool>` still makes an address for a tool that cannot be told what to send; its first send is a masked sample counted as nothing until `--map` confirms the rows.',\n },\n args,\n run: async ({ args: raw }) => {\n try {\n const request = sourcesRequest(raw as Record<string, unknown>, process.argv);\n const response = await apiPost<SourcesResponse>(\"/api/analytics/sources\", request);\n const full = raw.full === true;\n const sources = response.data.sources.map((source) => {\n const { sample, ...rest } = source;\n return full || sample === undefined ? source : { ...rest, sample: { receivedAt: sample.receivedAt } };\n });\n writeJsonEnvelope({\n ok: true,\n data: {\n sources,\n ...(response.data.preview === undefined ? {} : { preview: response.data.preview }),\n ...(response.data.staged === undefined ? {} : { staged: response.data.staged }),\n },\n ...(response.hints && response.hints.length > 0 ? { hints: response.hints } : {}),\n });\n } catch (err) {\n if (err instanceof ConversionArgsError) {\n handleError(new ApiError(\"VALIDATION_ERROR\", err.message));\n }\n handleError(err);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,qBAAqB;AA6B9B,IAAM,OAAO;AAAA,EACX,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,eAAe;AAAA,IACb,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN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E,MAAM,IAAI,MAAM;AAC5B,QAAI;AACF,YAAM,UAAU,eAAe,KAAgC,QAAQ,IAAI;AAC3E,YAAM,WAAW,MAAM,QAAyB,0BAA0B,OAAO;AACjF,YAAM,OAAO,IAAI,SAAS;AAC1B,YAAM,UAAU,SAAS,KAAK,QAAQ,IAAI,CAAC,WAAW;AACpD,cAAM,EAAE,QAAQ,GAAG,KAAK,IAAI;AAC5B,eAAO,QAAQ,WAAW,SAAY,SAAS,EAAE,GAAG,MAAM,QAAQ,EAAE,YAAY,OAAO,WAAW,EAAE;AAAA,MACtG,CAAC;AACD,wBAAkB;AAAA,QAChB,IAAI;AAAA,QACJ,MAAM;AAAA,UACJ;AAAA,UACA,GAAI,SAAS,KAAK,YAAY,SAAY,CAAC,IAAI,EAAE,SAAS,SAAS,KAAK,QAAQ;AAAA,UAChF,GAAI,SAAS,KAAK,WAAW,SAAY,CAAC,IAAI,EAAE,QAAQ,SAAS,KAAK,OAAO;AAAA,QAC/E;AAAA,QACA,GAAI,SAAS,SAAS,SAAS,MAAM,SAAS,IAAI,EAAE,OAAO,SAAS,MAAM,IAAI,CAAC;AAAA,MACjF,CAAC;AAAA,IACH,SAAS,KAAK;AACZ,UAAI,eAAe,qBAAqB;AACtC,oBAAY,IAAI,SAAS,oBAAoB,IAAI,OAAO,CAAC;AAAA,MAC3D;AACA,kBAAY,GAAG;AAAA,IACjB;AAAA,EACF;AACF,CAAC;","names":["verb"]}
1
+ {"version":3,"sources":["../src/commands/analytics/sources.ts"],"sourcesContent":["import { REJECTION_MESSAGES, validateEventName } from \"@baker/api/event-ingest\";\nimport {\n HUBSPOT_DEAL_CONTACTS,\n HUBSPOT_OBJECTS,\n type HubspotDealContacts,\n type HubspotObject,\n hubspotDefaultMapping,\n hubspotTriggerInputSchema,\n mappingRowProblem,\n readsAssociatedContact,\n SOURCE_FIELD_NAMES,\n type SourcesRequestInput,\n type SourcesResponse,\n templateMentions,\n} from \"@baker/api/event-sources\";\nimport { defineCommand } from \"citty\";\nimport { ApiError, apiPost } from \"../../client.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { writeJsonEnvelope } from \"../ads/output.ts\";\nimport { hubspotRefusal } from \"../hubspot/refusal.ts\";\nimport { ConversionArgsError, onlyOnce } from \"./conversionArgs.ts\";\n\n/**\n * `baker analytics sources` — an address for each of the client's own tools to\n * send events to, and what each one's payloads are read as.\n *\n * ## Why a URL and not a key\n *\n * `POST /v1/events` needs the sender to write code to our contract. A CRM's\n * webhook, an automation platform, a billing system cannot be told what to\n * send — they post what they post, to a URL, and set nothing else. A source\n * is that URL: the token in it is the whole credential, the first send\n * teaches Baker the shape, and a person confirms once which path is the\n * email, which the amount. From then on every arrival is an ordinary event.\n *\n * ## `--field` and `--value` repeat, and citty keeps only the last\n *\n * citty hands the LAST value of a repeated flag over as a plain string, so\n * `--field email=a --field value=b` would map `value` and silently drop\n * `email`, and `--value lead --value customer` would watch `customer` alone.\n * Both are read off `process.argv` instead, the way `conversions` reads its\n * repeats.\n */\n\nconst args = {\n server: {\n type: \"boolean\",\n description:\n \"The client's own server door: one address for their developers, made once and the same for ever after, counting at once in Baker's own format (`baker analytics sending-events` has the contract). Prints it; nothing else to set\",\n required: false,\n },\n create: {\n type: \"boolean\",\n description:\n \"Make an address for a tool that cannot be told what to send (a CRM webhook, an automation step). Needs --name. Its first send is kept as a sample and counted as nothing until --map\",\n required: false,\n },\n \"create-hubspot\": {\n type: \"boolean\",\n description:\n \"Make a HubSpot event: HubSpot keeps each change to --property for Baker (Baker's app subscribes the account to that property with the condition as HubSpot's own filter, and nothing else), and every contact whose new value satisfies --operator --value is an event, counted within a minute. Needs --property (names, kinds and operators from `baker hubspot contacts properties`); --operator defaults to `is`; --value repeats for a list (`is` on a dropdown) or a between; --name is optional and defaults to the trigger's words; --field rows (names from `baker hubspot contacts fields`) replace the default rows they name. Counts from now on, never earlier contacts\",\n required: false,\n },\n \"set-trigger\": {\n type: \"boolean\",\n description:\n \"Change what a HubSpot event watches. Needs --source and the same --property --operator --value as --create-hubspot. The rows stay; it counts from now on under the new trigger\",\n required: false,\n },\n preview: {\n type: \"boolean\",\n description:\n \"Ask HubSpot what --property --operator --value would count today, and read one real contact — the one most recently there, or --contact — with the properties the --field rows mention (the defaults when none), to check every row against real data BEFORE --create-hubspot. Makes nothing\",\n required: false,\n },\n object: {\n type: \"string\",\n description:\n \"With --create-hubspot or --preview: what the trigger is on — `contact` (the default), `deal` or `lead`. A deal's and a lead's event is about the contact the record is associated with: its rows read the record's own properties bare ({{amount}}, {{dealstage}}, {{hs_pipeline_stage}}) and the contact's as {{contact.<name>}} (`baker hubspot deals fields` / `baker hubspot leads fields`). A deal's amount defaults to its own amount in its currency; a lead has none, so it counts the step rather than money. Use `lead` for qualification and disqualification — HubSpot records both as a lead stage, and nothing on the contact or the deal says a lead was disqualified\",\n required: false,\n },\n contacts: {\n type: \"string\",\n description:\n \"With --object deal or --object lead (on --create-hubspot or --set-trigger): whose event it is — `every` (the default: every contact on the record, each its own event; on a deal each worth the deal's amount) or `first` (the record's first contact only)\",\n required: false,\n },\n property: {\n type: \"string\",\n description:\n \"With --create-hubspot, --set-trigger or --preview: the property to watch, by HubSpot's internal name (lifecyclestage, hs_lead_status, a custom one on a contact; dealstage, amount, closedate on a deal; hs_pipeline_stage, hs_lead_label on a lead) — any property, whatever its kind\",\n required: false,\n },\n operator: {\n type: \"string\",\n description:\n \"With --property: how the property has to read. By the property's kind — select: is, isNot, isEmpty, isNotEmpty · text: is, isNot, contains, doesNotContain, startsWith, endsWith, isEmpty, isNotEmpty · number: equal, notEqual, lessThan, lessThanOrEqual, greaterThan, greaterThanOrEqual, isEmpty, isNotEmpty · date: is, isBefore, isAfter, isOnOrBefore, isOnOrAfter, isBetween, isEmpty, isNotEmpty · yes/no: is, isNot. `is` when unsaid\",\n required: false,\n },\n value: {\n type: \"string\",\n description:\n \"With --property: the value, as HubSpot spells it — a dropdown's internal value (customer, QUALIFIED…), a number, a YYYY-MM-DD, true/false. Repeat it for a list (--value lead --value customer) or the two ends of isBetween; none for isEmpty / isNotEmpty\",\n required: false,\n },\n conditions: {\n type: \"string\",\n description:\n 'With --create-hubspot, --set-trigger or --preview, instead of --property/--operator/--value: several conditions combined the way a Form\\'s filter combines them, as JSON — `{\"logic\":\"And\",\"conditions\":[{\"property\":\"lifecyclestage\",\"values\":[\"customer\"]},{\"logic\":\"Or\",\"conditions\":[{\"property\":\"country\",\"values\":[\"Spain\"]},{\"property\":\"amount\",\"operator\":\"greaterThan\",\"values\":[\"1000\"]}]}]}`. `logic` is And (every row) or Or (any row); a row is a condition or a group with its own logic, one level deep; at most 10 conditions. The event fires when a change to any named property makes the whole combination hold',\n required: false,\n },\n contact: {\n type: \"string\",\n description:\n \"With --preview: the record to draw the sample from — a HubSpot id, or text to search (an email or a name for a contact, a deal's or a lead's name). The one most recently satisfying the trigger when unsaid\",\n required: false,\n },\n \"amount-property\": {\n type: \"string\",\n description:\n \"With --create-hubspot or --set-amount: a NUMBER property of the watched object to read as the event's amount (a deal value synced onto the contact; a deal's own `amount` is read by default on a deal). Needs --currency beside it\",\n required: false,\n },\n currency: {\n type: \"string\",\n description: \"With --amount-property: the three-letter currency the property is in, like EUR or USD\",\n required: false,\n },\n \"set-amount\": {\n type: \"boolean\",\n description:\n \"Change where a HubSpot-read source takes its amount from. Needs --source; with --amount-property and --currency it reads them, with neither it stops reading an amount\",\n required: false,\n },\n backfill: {\n type: \"boolean\",\n description:\n \"Count a HubSpot event's history: every moment its trigger came to hold since --since, at the instant HubSpot says it did. Needs --source and --since. Nothing is invented — a record that merely satisfies the trigger today is not an event today, and only moments HubSpot has a timestamp for are counted. Dry without --write. Reach for it when an event was made after the deals it should have counted, or after fixing one that was refusing everything it received\",\n required: false,\n },\n since: {\n type: \"string\",\n description:\n \"With --backfill: the date to count this event's history from, `2026-09-19` or an ISO instant. At most 400 days back — the store keeps no more\",\n required: false,\n },\n before: {\n type: \"string\",\n description:\n \"With --backfill: carry on from where a capped run stopped, by passing back the `reachedBack` it returned. One run reads at most 500 records, most recently changed first, so a capped run has covered the newest and the rest are the ones nearest --since — narrowing --since cannot reach them, this can. Repeat until `capped` is false; nothing is counted twice. It bounds which records are read, never which of their moments count: those are still the whole of --since to now\",\n required: false,\n },\n write: {\n type: \"boolean\",\n description:\n \"With --backfill: actually count what it found. Without it nothing is counted and the answer says what would be. Events inside the last 72 hours are uploaded to this event's ad platforms within minutes of counting, which spends real budget\",\n required: false,\n },\n name: {\n type: \"string\",\n description:\n \"The tool the source is for — HubSpot, Zapier, Stripe. It is the event's name when the payload does not say one, and every event it sends carries it as `baker_source`\",\n required: false,\n },\n map: {\n type: \"boolean\",\n description:\n \"Set what each field is read from. For an address this starts counting; needs --source, and one --field per row. With no --field the guess is used, which is right for a tool already sending Baker's own format. For a HubSpot-read source it replaces the whole mapping (the row list is on the source as `mapping`; empty means HubSpot's standard properties), so repeat every row you want kept\",\n required: false,\n },\n source: { type: \"string\", description: \"The source id, from the list\", required: false },\n field: {\n type: \"string\",\n description: `<field>=<template>, repeatable. A template is text with {{path}} mentions, one thing per mention: --field email={{contact.email}} --field currency=EUR --field first_name=\"{{who.first}} {{who.last}}\". A bare path (--field email=contact.email) is read as its mention when the sample has that path, so the short spelling still works. Fields: ${SOURCE_FIELD_NAMES.join(\", \")}. An EXTRA PROPERTY of the event — a plan, a stage, anything Measure → Events should break it down by and a send may pass on to a platform — is --field properties.<name>=<template>, e.g. --field properties.plan={{plan_tier}}. Paths come from \\`paths\\` on the source's sample; for a HubSpot event they are contact property names (\\`baker hubspot contacts fields\\`) plus \\`id\\` for the contact id`,\n required: false,\n },\n pause: {\n type: \"boolean\",\n description: \"Stop counting a source's arrivals; they are answered and dropped. Needs --source\",\n required: false,\n },\n resume: { type: \"boolean\", description: \"Count a paused source's arrivals again. Needs --source\", required: false },\n remove: {\n type: \"boolean\",\n description: \"Delete a source; its address stops working at once. Needs --source\",\n required: false,\n },\n full: {\n type: \"boolean\",\n description:\n \"Also return each source's masked sample body. The paths and the guess are always returned; the body is only for reading what a path held\",\n required: false,\n },\n} as const;\n\nregisterSchema({\n command: \"analytics.sources\",\n description:\n \"Where events reach Baker from a server: the client's own server door, and HubSpot events Baker reads — what each one watches and reads, and how it is doing\",\n args,\n});\n\n/** The value a repeated flag carries at this position, in either spelling, or nothing. */\nfunction flagValueAt(argv: readonly string[], flag: string, index: number): string | undefined {\n const arg = argv[index] ?? \"\";\n if (arg === flag) return argv[index + 1];\n return arg.startsWith(`${flag}=`) ? arg.slice(flag.length + 1) : undefined;\n}\n\n/** Every value of a repeated flag on the command line, in order. */\nexport function parseRepeated(argv: readonly string[], flag: string): string[] {\n const values: string[] = [];\n for (let index = 0; index < argv.length; index += 1) {\n const value = flagValueAt(argv, flag, index);\n if (value !== undefined) values.push(value);\n }\n return values;\n}\n\n/** Every `--field k=v` on the command line, in order, refusing a malformed one. */\nexport function parseFieldArgs(argv: readonly string[]): Record<string, string> {\n const mapping: Record<string, string> = {};\n for (const pair of parseRepeated(argv, \"--field\")) {\n const eq = pair.indexOf(\"=\");\n const field = eq === -1 ? pair : pair.slice(0, eq);\n const path = eq === -1 ? \"\" : pair.slice(eq + 1).trim();\n const problem = mappingRowProblem(field);\n if (problem !== null) throw new ConversionArgsError(problem);\n if (path === \"\") throw new ConversionArgsError(`--field ${field} needs a path: --field ${field}=<dotted.path>.`);\n mapping[field] = path;\n }\n return mapping;\n}\n\n/** The amount pair, which travels together or not at all. */\nfunction amountArgs(raw: Record<string, unknown>, argv: readonly string[]) {\n const amountProperty = onlyOnce(raw[\"amount-property\"], \"--amount-property\", argv);\n const currency = onlyOnce(raw.currency, \"--currency\", argv);\n if ((amountProperty === undefined) !== (currency === undefined)) {\n throw new ConversionArgsError(\"--amount-property and --currency go together: name both or neither.\");\n }\n return {\n ...(amountProperty === undefined ? {} : { amountProperty }),\n ...(currency === undefined ? {} : { currency }),\n };\n}\n\nconst NO_VALUE_OPERATORS = new Set([\"isEmpty\", \"isNotEmpty\"]);\n\n/**\n * The trigger every HubSpot verb needs: the property, how it has to read,\n * and the values — repeated on the command line, read off argv. Refused with\n * where the names come from; what the property's kind allows is checked\n * against the account by the backend.\n */\nfunction triggerArgs(raw: Record<string, unknown>, argv: readonly string[], verb: string): TriggerInput {\n const conditions = onlyOnce(raw.conditions, \"--conditions\", argv);\n if (conditions !== undefined) return conditionsArg(conditions, raw, verb);\n const property = onlyOnce(raw.property, \"--property\", argv);\n const operator = onlyOnce(raw.operator, \"--operator\", argv) ?? \"is\";\n // The last --value is what citty kept; every one is what was typed.\n const values = argv.length === 0 && typeof raw.value === \"string\" ? [raw.value] : parseRepeated(argv, \"--value\");\n if (property === undefined) {\n throw new ConversionArgsError(\n `--${verb} needs --property <name> [--operator <op>] --value <value>…, from \\`baker hubspot contacts properties\\`.`,\n );\n }\n if (values.length === 0 && !NO_VALUE_OPERATORS.has(operator)) {\n throw new ConversionArgsError(\n `--${verb} needs --value <value> (repeat it for a list); only --operator isEmpty / isNotEmpty take none.`,\n );\n }\n return { property, operator, values };\n}\n\ntype TriggerInput = NonNullable<SourcesRequestInput[\"createHubspot\"]>[\"trigger\"];\n\n/** `--conditions <json>`: a combination, checked for shape here so a typo is refused before the call. */\nfunction conditionsArg(text: string, raw: Record<string, unknown>, verb: string): TriggerInput {\n if (raw.property !== undefined || raw.value !== undefined || raw.operator !== undefined) {\n throw new ConversionArgsError(`--${verb} takes --conditions or --property/--operator/--value, not both.`);\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n throw new ConversionArgsError(\n '--conditions is JSON: {\"logic\":\"And\",\"conditions\":[{\"property\":\"lifecyclestage\",\"values\":[\"customer\"]}]}.',\n );\n }\n const checked = hubspotTriggerInputSchema.safeParse(parsed);\n if (!checked.success) {\n throw new ConversionArgsError(`--conditions: ${checked.error.issues.map((issue) => issue.message).join(\"; \")}`);\n }\n return parsed as TriggerInput;\n}\n\n/** `--object contact|deal`, spelled the two ways the wire takes and nothing else. */\nfunction objectArg(raw: Record<string, unknown>, argv: readonly string[]): HubspotObject {\n const object = onlyOnce(raw.object, \"--object\", argv) ?? \"contact\";\n if (!(HUBSPOT_OBJECTS as readonly string[]).includes(object)) {\n throw new ConversionArgsError(`--object is one of ${HUBSPOT_OBJECTS.join(\", \")}, not \"${object}\".`);\n }\n return object as HubspotObject;\n}\n\n/** `--contacts first|every`, which only means something on a deal or a lead. */\nfunction contactsArg(raw: Record<string, unknown>, argv: readonly string[]): HubspotDealContacts | undefined {\n const contacts = onlyOnce(raw.contacts, \"--contacts\", argv);\n if (contacts === undefined) return undefined;\n if (!(HUBSPOT_DEAL_CONTACTS as readonly string[]).includes(contacts)) {\n throw new ConversionArgsError(`--contacts is one of ${HUBSPOT_DEAL_CONTACTS.join(\", \")}, not \"${contacts}\".`);\n }\n return contacts as HubspotDealContacts;\n}\n\nfunction createHubspotArgs(\n raw: Record<string, unknown>,\n argv: readonly string[],\n name: string | undefined,\n): NonNullable<SourcesRequestInput[\"createHubspot\"]> {\n const mapping = parseFieldArgs(argv);\n const object = objectArg(raw, argv);\n const contacts = contactsArg(raw, argv);\n if (contacts !== undefined && !readsAssociatedContact(object)) {\n throw new ConversionArgsError(\n \"--contacts says whose event a deal's or a lead's is; it needs --object deal or --object lead.\",\n );\n }\n return {\n // A contact is the wire's default, so it is left unsaid — the way the schema reads it back.\n ...(object === \"contact\" ? {} : { object }),\n trigger: triggerArgs(raw, argv, \"create-hubspot\"),\n ...(contacts === undefined ? {} : { contacts }),\n ...(name === undefined ? {} : { name }),\n ...(Object.keys(mapping).length === 0 ? {} : { mapping }),\n ...amountArgs(raw, argv),\n };\n}\n\n/** What to read off the sample contact: whatever the rows mention, or the default rows' properties. */\nfunction previewArgs(\n raw: Record<string, unknown>,\n argv: readonly string[],\n): NonNullable<SourcesRequestInput[\"preview\"]> {\n const rows = parseFieldArgs(argv);\n const object = objectArg(raw, argv);\n const templates = Object.values(Object.keys(rows).length === 0 ? hubspotDefaultMapping(\"\", object) : rows);\n const properties = [...new Set(templates.flatMap((template) => templateMentions(template ?? \"\")))];\n const contact = onlyOnce(raw.contact, \"--contact\", argv);\n return {\n ...(object === \"contact\" ? {} : { object }),\n trigger: triggerArgs(raw, argv, \"preview\"),\n properties,\n ...(contact === undefined ? {} : { contact }),\n };\n}\n\nconst VERBS = [\n \"server\",\n \"create\",\n \"create-hubspot\",\n \"set-trigger\",\n \"preview\",\n \"backfill\",\n \"set-amount\",\n \"map\",\n \"pause\",\n \"resume\",\n \"remove\",\n] as const;\n\n/**\n * The name, refused here when the ingest door could never accept it.\n *\n * A source's name is the `event_name` of every event it raises, so this is\n * not a label being tidied: a name outside the rule makes a source that\n * counts **nothing**, for ever, while `baker analytics sources` goes on\n * listing it as counting and the only trace is one red line per event on the\n * feed. The contract refuses it too (`sourceNameSchema`), but that comes back\n * as a wire-validation error; the agent is better served by the sentence.\n */\nfunction checkedName(raw: Record<string, unknown>, argv: readonly string[]): string | undefined {\n const name = onlyOnce(raw.name, \"--name\", argv);\n if (name === undefined || validateEventName(name) === null) return name;\n throw new ConversionArgsError(\n `\"${name}\" cannot be an event name, and the name is what every event this source raises will carry. ${REJECTION_MESSAGES.invalid_name}`,\n );\n}\n\n/** What a backfill reads back to, and whether it counts what it finds. */\nfunction backfillArgs(\n raw: Record<string, unknown>,\n argv: readonly string[],\n sourceId: string,\n): NonNullable<SourcesRequestInput[\"backfill\"]> {\n const since = onlyOnce(raw.since, \"--since\", argv);\n if (since === undefined) {\n throw new ConversionArgsError(\n \"--backfill needs --since <date>, e.g. --since 2026-09-19. Nothing before it is read.\",\n );\n }\n const before = onlyOnce(raw.before, \"--before\", argv);\n return {\n sourceId,\n since,\n ...(before === undefined ? {} : { before }),\n ...(raw.write === true ? { write: true } : {}),\n };\n}\n\nexport function sourcesRequest(raw: Record<string, unknown>, argv: readonly string[]): SourcesRequestInput {\n const name = checkedName(raw, argv);\n const source = onlyOnce(raw.source, \"--source\", argv);\n const verbs = VERBS.filter((verb) => raw[verb] === true);\n if (verbs.length > 1) throw new ConversionArgsError(`One of --${verbs.join(\", --\")} per call.`);\n const verb = verbs[0];\n if (verb === undefined) return {};\n if (verb === \"server\") return { server: {} };\n if (verb === \"create\") {\n if (name === undefined) throw new ConversionArgsError(\"--create needs --name <tool>.\");\n return { create: { name } };\n }\n if (verb === \"create-hubspot\") return { createHubspot: createHubspotArgs(raw, argv, name) };\n if (verb === \"preview\") return { preview: previewArgs(raw, argv) };\n if (source === undefined) throw new ConversionArgsError(`--${verb} needs --source <id>, from the list.`);\n if (verb === \"backfill\") return { backfill: backfillArgs(raw, argv, source) };\n if (verb === \"set-trigger\") {\n const contacts = contactsArg(raw, argv);\n return {\n setTrigger: {\n sourceId: source,\n trigger: triggerArgs(raw, argv, verb),\n ...(contacts === undefined ? {} : { contacts }),\n },\n };\n }\n if (verb === \"set-amount\") return { setAmount: { sourceId: source, ...amountArgs(raw, argv) } };\n if (verb === \"map\") return { map: { sourceId: source, mapping: parseFieldArgs(argv) } };\n return { [verb]: { sourceId: source } };\n}\n\nfunction handleError(err: unknown): never {\n if (err instanceof ApiError) {\n // A HubSpot event needs HubSpot connected, and allowed to read what it watches.\n const refusal = hubspotRefusal(err.code, err.message);\n writeJsonEnvelope({\n ok: false,\n error:\n refusal === null\n ? { code: err.code, message: err.message }\n : { code: refusal.code, message: err.message, fix: refusal.fix },\n });\n process.exit(1);\n }\n writeJsonEnvelope({\n ok: false,\n error: { code: \"NETWORK_ERROR\", message: err instanceof Error ? err.message : \"Unexpected error\" },\n });\n process.exit(1);\n}\n\nexport const sourcesCommand = defineCommand({\n meta: {\n name: \"sources\",\n description:\n 'Where events reach Baker from a server, and what each one reads. Two doors. **The client\\'s own server**: `--server` prints one address for their developers — made once, the same for ever, counting at once, Baker\\'s own `POST /v1/events` format (`baker analytics sending-events` has the contract, `X-Baker-Mode: test` rehearses). **HubSpot events**: HubSpot keeps each change to a watched property in a journal Baker reads every half minute — Baker\\'s app subscribes the account to that one property with the condition as HubSpot\\'s own filter, so an account with a million contacts costs nothing to watch — on every plan, nothing to set up in HubSpot. The trigger is *when a contact\\'s* property satisfies a condition — the same conditions a Form\\'s filters take: `--property lifecyclestage --value customer` (a dropdown; `--value lead --value customer` for either), `--property deal_value --operator greaterThan --value 1000`, `--property email --operator endsWith --value @acme.com`, `--property closed_at --operator isAfter --value 2026-01-01`, `--property phone --operator isEmpty`. Several conditions combine the way a Form\\'s filter does — `--conditions \\'{\"logic\":\"And\",\"conditions\":[{\"property\":\"lifecyclestage\",\"values\":[\"customer\"]},{\"property\":\"country\",\"values\":[\"Spain\"]}]}\\'` (AND / OR, groups one level deep, 10 conditions at most) in place of --property/--operator/--value, on --create-hubspot, --set-trigger and --preview; the event fires when a change to any named property makes the whole combination hold. `baker hubspot contacts properties` lists every property with its kind, the operators that kind takes and a dropdown\\'s values; `baker hubspot contacts fields` every property a row can read. `--preview --property … [--operator …] --value … [--field …] [--contact <id or email>]` says how many contacts satisfy it today (NOT counted — only contacts that come to satisfy it from now on are) and reads one real contact so every row can be checked against real data; then `--create-hubspot --property … --value … --name \"Deal won\" --field email={{work_email}} --field value={{deal_value}} --field currency=EUR` makes the event, rows over the defaults (email, phone, the contact id, name, address, hs_google_click_id, hs_facebook_click_id). `--set-trigger --source <id> --property … --operator … --value …` changes what an event watches later (rows kept, counting from now on). Every row is a template — text with {{property}} mentions, one thing per mention; `--map --source <id> --field …` replaces the whole row set later, `--amount-property <number property> --currency EUR` is the short spelling for the amount rows. Each event is an ordinary event named after the source, carrying `baker_source`, listed by `feed --source <name>`, counted with `conversions` under `page:<name>`, and sent to the ad platforms with `sends`. `--pause`, `--resume`, `--remove` by --source. `--create --name <tool>` still makes an address for a tool that cannot be told what to send; its first send is a masked sample counted as nothing until `--map` confirms the rows.',\n },\n args,\n run: async ({ args: raw }) => {\n try {\n const request = sourcesRequest(raw as Record<string, unknown>, process.argv);\n const response = await apiPost<SourcesResponse>(\"/api/analytics/sources\", request);\n const full = raw.full === true;\n const sources = response.data.sources.map((source) => {\n const { sample, ...rest } = source;\n return full || sample === undefined ? source : { ...rest, sample: { receivedAt: sample.receivedAt } };\n });\n writeJsonEnvelope({\n ok: true,\n data: {\n sources,\n ...(response.data.preview === undefined ? {} : { preview: response.data.preview }),\n ...(response.data.staged === undefined ? {} : { staged: response.data.staged }),\n },\n ...(response.hints && response.hints.length > 0 ? { hints: response.hints } : {}),\n });\n } catch (err) {\n if (err instanceof ConversionArgsError) {\n handleError(new ApiError(\"VALIDATION_ERROR\", err.message));\n }\n handleError(err);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,SAAS,qBAAqB;AA6B9B,IAAM,OAAO;AAAA,EACX,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,eAAe;AAAA,IACb,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,SAAS;AAAA,IACP,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,IACR,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,IACR,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,UAAU;AAAA,IACR,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,OAAO;AAAA,IACL,MAAM;AAAA,IACN,aACE;AAAA,IACF,UAAU;AAAA,EACZ;AAAA,EACA,YAAY;AAAA,IACV,MAAM;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,SAAY,CAAC,IAAI,EAAE,SAAS,SAAS,KAAK,QAAQ;AAAA,UAChF,GAAI,SAAS,KAAK,WAAW,SAAY,CAAC,IAAI,EAAE,QAAQ,SAAS,KAAK,OAAO;AAAA,QAC/E;AAAA,QACA,GAAI,SAAS,SAAS,SAAS,MAAM,SAAS,IAAI,EAAE,OAAO,SAAS,MAAM,IAAI,CAAC;AAAA,MACjF,CAAC;AAAA,IACH,SAAS,KAAK;AACZ,UAAI,eAAe,qBAAqB;AACtC,oBAAY,IAAI,SAAS,oBAAoB,IAAI,OAAO,CAAC;AAAA,MAC3D;AACA,kBAAY,GAAG;AAAA,IACjB;AAAA,EACF;AACF,CAAC;","names":["verb"]}
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  staleCreatives
3
- } from "./chunk-M242LHLX.js";
4
- import "./chunk-T2PC5AVH.js";
3
+ } from "./chunk-7CTMH5AK.js";
4
+ import "./chunk-ASI4P6X2.js";
5
5
  import "./chunk-4QEY2L6U.js";
6
- import "./chunk-QRP3PXWN.js";
7
- import "./chunk-3IBYKLXR.js";
6
+ import "./chunk-VL43TNIP.js";
7
+ import "./chunk-ZDMTXQ2Q.js";
8
8
  import "./chunk-F2S5BLPE.js";
9
9
  import "./chunk-WTOYCUKH.js";
10
10
  import {
11
11
  findWorkspaceRoot
12
12
  } from "./chunk-DZSIUEGH.js";
13
- import "./chunk-GKZ2WU75.js";
13
+ import "./chunk-FPOGPFAG.js";
14
14
  import "./chunk-NCWCZY5P.js";
15
15
  import "./chunk-DGCUPJZD.js";
16
16
  import "./chunk-PZXCWSKV.js";
@@ -22,10 +22,11 @@ import "./chunk-VAJBWA2U.js";
22
22
  import "./chunk-HRYOZUSK.js";
23
23
  import "./chunk-VVZBBKRC.js";
24
24
  import "./chunk-YBMVHGY3.js";
25
- import "./chunk-XF4JUKVF.js";
25
+ import "./chunk-7EPXVICM.js";
26
26
  import "./chunk-GXDLWBOY.js";
27
27
  import "./chunk-TEINLN64.js";
28
28
  import "./chunk-ZJWUBJYQ.js";
29
+ import "./chunk-HR6IWNKE.js";
29
30
  import "./chunk-NE4F3FHN.js";
30
31
  import "./chunk-IFWP3ZDO.js";
31
32
  import "./chunk-NAWWC5I3.js";
@@ -60,4 +61,4 @@ var staleCommand = defineCommand({
60
61
  export {
61
62
  staleCommand
62
63
  };
63
- //# sourceMappingURL=stale-6MJHVEG4.js.map
64
+ //# sourceMappingURL=stale-W756ACKC.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commands/canvas/stale.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport { findWorkspaceRoot } from \"./normalize-paths.ts\";\nimport { staleCreatives } from \"./render-state.ts\";\n\nexport const staleCommand = defineCommand({\n meta: {\n name: \"stale\",\n description:\n \"List the creatives edited since their last render in this workspace: what the models would be sent (the projected canvas, prompt.json without its `reference`/`source_context`/`notes` bookkeeping, scenes/*.json, the compositions it renders, the formats in _definition.md) no longer matches what the last completed `baker canvas run` drew, so the preview shows an older creative. Reformatting a file is not an edit. Read-only, offline and free. During a turn, re-render each one listed that the person should see with `baker canvas run <canvasPath>`. During a publish, never: Publish ships the last version the person was shown. Creatives never rendered here and half-built ones (unfilled [TODO] asset slots) are not listed.\",\n },\n args: {},\n async run() {\n const cwd = process.cwd();\n const stale = await staleCreatives(findWorkspaceRoot(cwd) ?? cwd);\n process.stdout.write(\n `${JSON.stringify(\n {\n ok: true,\n data: { stale },\n ...(stale.length > 0\n ? { hints: stale.map((c) => `Re-render ${c.slug} before showing it (never during a publish): baker canvas run ${c.canvasPath}`) }\n : {}),\n },\n null,\n 2,\n )}\\n`,\n );\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,qBAAqB;AAIvB,IAAM,eAAe,cAAc;AAAA,EACxC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aACE;AAAA,EACJ;AAAA,EACA,MAAM,CAAC;AAAA,EACP,MAAM,MAAM;AACV,UAAM,MAAM,QAAQ,IAAI;AACxB,UAAM,QAAQ,MAAM,eAAe,kBAAkB,GAAG,KAAK,GAAG;AAChE,YAAQ,OAAO;AAAA,MACb,GAAG,KAAK;AAAA,QACN;AAAA,UACE,IAAI;AAAA,UACJ,MAAM,EAAE,MAAM;AAAA,UACd,GAAI,MAAM,SAAS,IACf,EAAE,OAAO,MAAM,IAAI,CAAC,MAAM,aAAa,EAAE,IAAI,iEAAiE,EAAE,UAAU,EAAE,EAAE,IAC9H,CAAC;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA;AAAA,IACH;AAAA,EACF;AACF,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/commands/canvas/stale.ts"],"sourcesContent":["import { defineCommand } from \"citty\";\nimport { findWorkspaceRoot } from \"./normalize-paths.ts\";\nimport { staleCreatives } from \"./render-state.ts\";\n\nexport const staleCommand = defineCommand({\n meta: {\n name: \"stale\",\n description:\n \"List the creatives edited since their last render in this workspace: what the models would be sent (the projected canvas, prompt.json without its `reference`/`source_context`/`notes` bookkeeping, scenes/*.json, the compositions it renders, the formats in _definition.md) no longer matches what the last completed `baker canvas run` drew, so the preview shows an older creative. Reformatting a file is not an edit. Read-only, offline and free. During a turn, re-render each one listed that the person should see with `baker canvas run <canvasPath>`. During a publish, never: Publish ships the last version the person was shown. Creatives never rendered here and half-built ones (unfilled [TODO] asset slots) are not listed.\",\n },\n args: {},\n async run() {\n const cwd = process.cwd();\n const stale = await staleCreatives(findWorkspaceRoot(cwd) ?? cwd);\n process.stdout.write(\n `${JSON.stringify(\n {\n ok: true,\n data: { stale },\n ...(stale.length > 0\n ? { hints: stale.map((c) => `Re-render ${c.slug} before showing it (never during a publish): baker canvas run ${c.canvasPath}`) }\n : {}),\n },\n null,\n 2,\n )}\\n`,\n );\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,qBAAqB;AAIvB,IAAM,eAAe,cAAc;AAAA,EACxC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aACE;AAAA,EACJ;AAAA,EACA,MAAM,CAAC;AAAA,EACP,MAAM,MAAM;AACV,UAAM,MAAM,QAAQ,IAAI;AACxB,UAAM,QAAQ,MAAM,eAAe,kBAAkB,GAAG,KAAK,GAAG;AAChE,YAAQ,OAAO;AAAA,MACb,GAAG,KAAK;AAAA,QACN;AAAA,UACE,IAAI;AAAA,UACJ,MAAM,EAAE,MAAM;AAAA,UACd,GAAI,MAAM,SAAS,IACf,EAAE,OAAO,MAAM,IAAI,CAAC,MAAM,aAAa,EAAE,IAAI,iEAAiE,EAAE,UAAU,EAAE,EAAE,IAC9H,CAAC;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,MACF,CAAC;AAAA;AAAA,IACH;AAAA,EACF;AACF,CAAC;","names":[]}
@@ -1,11 +1,12 @@
1
1
  import {
2
2
  failApi,
3
3
  failValidation
4
- } from "./chunk-3HJLHTWP.js";
5
- import "./chunk-XF4JUKVF.js";
4
+ } from "./chunk-SJYEY5MV.js";
5
+ import "./chunk-7EPXVICM.js";
6
6
  import "./chunk-GXDLWBOY.js";
7
7
  import "./chunk-TEINLN64.js";
8
8
  import "./chunk-ZJWUBJYQ.js";
9
+ import "./chunk-HR6IWNKE.js";
9
10
  import "./chunk-NE4F3FHN.js";
10
11
  import {
11
12
  apiPost
@@ -59,4 +60,4 @@ var statusCommand = defineCommand({
59
60
  export {
60
61
  statusCommand
61
62
  };
62
- //# sourceMappingURL=status-7F2KHFGA.js.map
63
+ //# sourceMappingURL=status-SE2VZJJB.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commands/actions/status.ts"],"sourcesContent":["import type { ActionsStatusResponse } from \"@baker/api\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { getEnv } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { failApi, failValidation } from \"./shared.ts\";\n\nregisterSchema({\n command: \"actions.status\",\n description:\n \"Resolve one or more Work Action refs by real action ID or temp_* ref in a single batch call. When BAKER_CHAT_ID is set, a temp_* ref still staged in THIS chat resolves to status 'draft' (not 'not_found') — staged ops only become published actions on chat publish.\",\n args: {\n ref: {\n type: \"positional\",\n description: \"One or more action refs: real action IDs or temp_* refs (space-separated)\",\n required: true,\n },\n },\n});\n\nexport const statusCommand = defineCommand({\n meta: {\n name: \"status\",\n description: \"Resolve Work Action refs by real ID or temp_* ref. Example: baker actions status temp_hero jx123\",\n },\n args: {\n ref: { type: \"positional\", description: \"Action ID or temp_* ref; accepts multiple refs\", required: false },\n },\n run: async ({ args }) => {\n try {\n const refs = [args.ref, ...(Array.isArray(args._) ? args._ : [])]\n .filter((ref): ref is string => typeof ref === \"string\")\n .map((ref) => ref.trim())\n .filter(Boolean);\n if (refs.length === 0) {\n failValidation(\"At least one action ref is required.\");\n }\n\n // Pass the caller's own chat (if any) so temps still staged in THIS chat\n // resolve to \"draft\". status stays usable without a chat — temps just\n // resolve to not_found until published, as before.\n const { BAKER_CHAT_ID } = getEnv();\n const body = BAKER_CHAT_ID ? { refs, chatId: BAKER_CHAT_ID } : { refs };\n const response = await apiPost<ActionsStatusResponse>(\"/api/actions/status\", body);\n writeJson(response);\n } catch (err) {\n failApi(err);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,qBAAqB;AAO9B,eAAe;AAAA,EACb,SAAS;AAAA,EACT,aACE;AAAA,EACF,MAAM;AAAA,IACJ,KAAK;AAAA,MACH,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,EACF;AACF,CAAC;AAEM,IAAM,gBAAgB,cAAc;AAAA,EACzC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA,MAAM;AAAA,IACJ,KAAK,EAAE,MAAM,cAAc,aAAa,kDAAkD,UAAU,MAAM;AAAA,EAC5G;AAAA,EACA,KAAK,OAAO,EAAE,KAAK,MAAM;AACvB,QAAI;AACF,YAAM,OAAO,CAAC,KAAK,KAAK,GAAI,MAAM,QAAQ,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAE,EAC7D,OAAO,CAAC,QAAuB,OAAO,QAAQ,QAAQ,EACtD,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,EACvB,OAAO,OAAO;AACjB,UAAI,KAAK,WAAW,GAAG;AACrB,uBAAe,sCAAsC;AAAA,MACvD;AAKA,YAAM,EAAE,cAAc,IAAI,OAAO;AACjC,YAAM,OAAO,gBAAgB,EAAE,MAAM,QAAQ,cAAc,IAAI,EAAE,KAAK;AACtE,YAAM,WAAW,MAAM,QAA+B,uBAAuB,IAAI;AACjF,gBAAU,QAAQ;AAAA,IACpB,SAAS,KAAK;AACZ,cAAQ,GAAG;AAAA,IACb;AAAA,EACF;AACF,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/commands/actions/status.ts"],"sourcesContent":["import type { ActionsStatusResponse } from \"@baker/api\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { getEnv } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { failApi, failValidation } from \"./shared.ts\";\n\nregisterSchema({\n command: \"actions.status\",\n description:\n \"Resolve one or more Work Action refs by real action ID or temp_* ref in a single batch call. When BAKER_CHAT_ID is set, a temp_* ref still staged in THIS chat resolves to status 'draft' (not 'not_found') — staged ops only become published actions on chat publish.\",\n args: {\n ref: {\n type: \"positional\",\n description: \"One or more action refs: real action IDs or temp_* refs (space-separated)\",\n required: true,\n },\n },\n});\n\nexport const statusCommand = defineCommand({\n meta: {\n name: \"status\",\n description: \"Resolve Work Action refs by real ID or temp_* ref. Example: baker actions status temp_hero jx123\",\n },\n args: {\n ref: { type: \"positional\", description: \"Action ID or temp_* ref; accepts multiple refs\", required: false },\n },\n run: async ({ args }) => {\n try {\n const refs = [args.ref, ...(Array.isArray(args._) ? args._ : [])]\n .filter((ref): ref is string => typeof ref === \"string\")\n .map((ref) => ref.trim())\n .filter(Boolean);\n if (refs.length === 0) {\n failValidation(\"At least one action ref is required.\");\n }\n\n // Pass the caller's own chat (if any) so temps still staged in THIS chat\n // resolve to \"draft\". status stays usable without a chat — temps just\n // resolve to not_found until published, as before.\n const { BAKER_CHAT_ID } = getEnv();\n const body = BAKER_CHAT_ID ? { refs, chatId: BAKER_CHAT_ID } : { refs };\n const response = await apiPost<ActionsStatusResponse>(\"/api/actions/status\", body);\n writeJson(response);\n } catch (err) {\n failApi(err);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,qBAAqB;AAO9B,eAAe;AAAA,EACb,SAAS;AAAA,EACT,aACE;AAAA,EACF,MAAM;AAAA,IACJ,KAAK;AAAA,MACH,MAAM;AAAA,MACN,aAAa;AAAA,MACb,UAAU;AAAA,IACZ;AAAA,EACF;AACF,CAAC;AAEM,IAAM,gBAAgB,cAAc;AAAA,EACzC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA,MAAM;AAAA,IACJ,KAAK,EAAE,MAAM,cAAc,aAAa,kDAAkD,UAAU,MAAM;AAAA,EAC5G;AAAA,EACA,KAAK,OAAO,EAAE,KAAK,MAAM;AACvB,QAAI;AACF,YAAM,OAAO,CAAC,KAAK,KAAK,GAAI,MAAM,QAAQ,KAAK,CAAC,IAAI,KAAK,IAAI,CAAC,CAAE,EAC7D,OAAO,CAAC,QAAuB,OAAO,QAAQ,QAAQ,EACtD,IAAI,CAAC,QAAQ,IAAI,KAAK,CAAC,EACvB,OAAO,OAAO;AACjB,UAAI,KAAK,WAAW,GAAG;AACrB,uBAAe,sCAAsC;AAAA,MACvD;AAKA,YAAM,EAAE,cAAc,IAAI,OAAO;AACjC,YAAM,OAAO,gBAAgB,EAAE,MAAM,QAAQ,cAAc,IAAI,EAAE,KAAK;AACtE,YAAM,WAAW,MAAM,QAA+B,uBAAuB,IAAI;AACjF,gBAAU,QAAQ;AAAA,IACpB,SAAS,KAAK;AACZ,cAAQ,GAAG;AAAA,IACb;AAAA,EACF;AACF,CAAC;","names":[]}
@@ -1,11 +1,11 @@
1
- import {
2
- activeFilterFlags,
3
- emptyResultHints
4
- } from "./chunk-Q6ULQMWG.js";
5
1
  import {
6
2
  AUTO_INGEST_MAX,
7
3
  parseAutoIngest
8
4
  } from "./chunk-KKJ4KJCW.js";
5
+ import {
6
+ activeFilterFlags,
7
+ emptyResultHints
8
+ } from "./chunk-Q6ULQMWG.js";
9
9
  import {
10
10
  ApiError,
11
11
  apiPost
@@ -176,4 +176,4 @@ export {
176
176
  partialLibraryHints,
177
177
  stockCommand
178
178
  };
179
- //# sourceMappingURL=stock-2YCDN3N6.js.map
179
+ //# sourceMappingURL=stock-KXJ26BY4.js.map
@@ -46,4 +46,4 @@ Full guide: __tooling__/docs/tools/baker/studio.md`
46
46
  export {
47
47
  studioCommand
48
48
  };
49
- //# sourceMappingURL=studio-RA7QQH4O.js.map
49
+ //# sourceMappingURL=studio-SYKOSNDB.js.map
@@ -4,10 +4,11 @@ import {
4
4
  } from "./chunk-6G5K6ZC6.js";
5
5
  import {
6
6
  testimonialSourcesSyncRequestSchema
7
- } from "./chunk-XF4JUKVF.js";
7
+ } from "./chunk-7EPXVICM.js";
8
8
  import "./chunk-GXDLWBOY.js";
9
9
  import "./chunk-TEINLN64.js";
10
10
  import "./chunk-ZJWUBJYQ.js";
11
+ import "./chunk-HR6IWNKE.js";
11
12
  import "./chunk-NE4F3FHN.js";
12
13
  import {
13
14
  apiPost
@@ -51,4 +52,4 @@ var syncCommand = defineCommand({
51
52
  export {
52
53
  syncCommand
53
54
  };
54
- //# sourceMappingURL=sync-GWTLKZTU.js.map
55
+ //# sourceMappingURL=sync-LJGSODK3.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commands/testimonials/sources/sync.ts"],"sourcesContent":["import { type TestimonialSourcesSyncResponse, testimonialSourcesSyncRequestSchema } from \"@baker/api\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../../client.ts\";\nimport { writeJson } from \"../../../output.ts\";\nimport { registerSchema } from \"../../../schemas.ts\";\nimport { reportError, reportInvalid } from \"./shared.ts\";\n\nregisterSchema({\n command: \"testimonials.sources.sync\",\n description:\n \"Import a review source's new reviews now. Only reviews newer than the last import are read where the site allows it.\",\n args: { id: { type: \"string\", description: \"Source id from `testimonials sources list`\", required: true } },\n});\n\nexport const syncCommand = defineCommand({\n meta: {\n name: \"sync\",\n description: \"Import a review source's new reviews now.\\n\\nExample: baker testimonials sources sync <source-id>\",\n },\n args: { id: { type: \"positional\", description: \"Source id from `testimonials sources list`\", required: true } },\n run: async ({ args }) => {\n const parsed = testimonialSourcesSyncRequestSchema.safeParse({ id: String(args.id ?? \"\") });\n if (!parsed.success) reportInvalid(parsed.error.issues[0]);\n try {\n const data = await apiPost<TestimonialSourcesSyncResponse>(\"/api/testimonials/sources/sync\", parsed.data);\n writeJson({\n ok: true,\n data,\n hints: data.started ? undefined : [\"An import was already running for this source; nothing new was started.\"],\n });\n } catch (err) {\n reportError(err);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,qBAAqB;AAM9B,eAAe;AAAA,EACb,SAAS;AAAA,EACT,aACE;AAAA,EACF,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,aAAa,8CAA8C,UAAU,KAAK,EAAE;AAC5G,CAAC;AAEM,IAAM,cAAc,cAAc;AAAA,EACvC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,aAAa,8CAA8C,UAAU,KAAK,EAAE;AAAA,EAC9G,KAAK,OAAO,EAAE,KAAK,MAAM;AACvB,UAAM,SAAS,oCAAoC,UAAU,EAAE,IAAI,OAAO,KAAK,MAAM,EAAE,EAAE,CAAC;AAC1F,QAAI,CAAC,OAAO,QAAS,eAAc,OAAO,MAAM,OAAO,CAAC,CAAC;AACzD,QAAI;AACF,YAAM,OAAO,MAAM,QAAwC,kCAAkC,OAAO,IAAI;AACxG,gBAAU;AAAA,QACR,IAAI;AAAA,QACJ;AAAA,QACA,OAAO,KAAK,UAAU,SAAY,CAAC,yEAAyE;AAAA,MAC9G,CAAC;AAAA,IACH,SAAS,KAAK;AACZ,kBAAY,GAAG;AAAA,IACjB;AAAA,EACF;AACF,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/commands/testimonials/sources/sync.ts"],"sourcesContent":["import { type TestimonialSourcesSyncResponse, testimonialSourcesSyncRequestSchema } from \"@baker/api\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../../client.ts\";\nimport { writeJson } from \"../../../output.ts\";\nimport { registerSchema } from \"../../../schemas.ts\";\nimport { reportError, reportInvalid } from \"./shared.ts\";\n\nregisterSchema({\n command: \"testimonials.sources.sync\",\n description:\n \"Import a review source's new reviews now. Only reviews newer than the last import are read where the site allows it.\",\n args: { id: { type: \"string\", description: \"Source id from `testimonials sources list`\", required: true } },\n});\n\nexport const syncCommand = defineCommand({\n meta: {\n name: \"sync\",\n description: \"Import a review source's new reviews now.\\n\\nExample: baker testimonials sources sync <source-id>\",\n },\n args: { id: { type: \"positional\", description: \"Source id from `testimonials sources list`\", required: true } },\n run: async ({ args }) => {\n const parsed = testimonialSourcesSyncRequestSchema.safeParse({ id: String(args.id ?? \"\") });\n if (!parsed.success) reportInvalid(parsed.error.issues[0]);\n try {\n const data = await apiPost<TestimonialSourcesSyncResponse>(\"/api/testimonials/sources/sync\", parsed.data);\n writeJson({\n ok: true,\n data,\n hints: data.started ? undefined : [\"An import was already running for this source; nothing new was started.\"],\n });\n } catch (err) {\n reportError(err);\n }\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,qBAAqB;AAM9B,eAAe;AAAA,EACb,SAAS;AAAA,EACT,aACE;AAAA,EACF,MAAM,EAAE,IAAI,EAAE,MAAM,UAAU,aAAa,8CAA8C,UAAU,KAAK,EAAE;AAC5G,CAAC;AAEM,IAAM,cAAc,cAAc;AAAA,EACvC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA,MAAM,EAAE,IAAI,EAAE,MAAM,cAAc,aAAa,8CAA8C,UAAU,KAAK,EAAE;AAAA,EAC9G,KAAK,OAAO,EAAE,KAAK,MAAM;AACvB,UAAM,SAAS,oCAAoC,UAAU,EAAE,IAAI,OAAO,KAAK,MAAM,EAAE,EAAE,CAAC;AAC1F,QAAI,CAAC,OAAO,QAAS,eAAc,OAAO,MAAM,OAAO,CAAC,CAAC;AACzD,QAAI;AACF,YAAM,OAAO,MAAM,QAAwC,kCAAkC,OAAO,IAAI;AACxG,gBAAU;AAAA,QACR,IAAI;AAAA,QACJ;AAAA,QACA,OAAO,KAAK,UAAU,SAAY,CAAC,yEAAyE;AAAA,MAC9G,CAAC;AAAA,IACH,SAAS,KAAK;AACZ,kBAAY,GAAG;AAAA,IACjB;AAAA,EACF;AACF,CAAC;","names":[]}
@@ -7,21 +7,21 @@ import {
7
7
  resolveCanvasPath,
8
8
  syncCreativeDefinitionBestEffort,
9
9
  syncDefinitionCommand
10
- } from "./chunk-CXWFX2AM.js";
11
- import "./chunk-6N6WKAJM.js";
12
- import "./chunk-CJCVIEJ5.js";
13
- import "./chunk-T2PC5AVH.js";
10
+ } from "./chunk-6Y7ZBENQ.js";
11
+ import "./chunk-CWYAELVG.js";
12
+ import "./chunk-6NY2GPR4.js";
13
+ import "./chunk-ASI4P6X2.js";
14
14
  import "./chunk-4QEY2L6U.js";
15
- import "./chunk-QRP3PXWN.js";
16
- import "./chunk-3IBYKLXR.js";
15
+ import "./chunk-VL43TNIP.js";
16
+ import "./chunk-ZDMTXQ2Q.js";
17
17
  import "./chunk-F2S5BLPE.js";
18
18
  import "./chunk-WTOYCUKH.js";
19
19
  import "./chunk-DZSIUEGH.js";
20
- import "./chunk-WNRV4QH7.js";
21
- import "./chunk-GKZ2WU75.js";
22
- import "./chunk-W3B4BHQU.js";
20
+ import "./chunk-LYQJ4PZW.js";
21
+ import "./chunk-FPOGPFAG.js";
23
22
  import "./chunk-NCWCZY5P.js";
24
23
  import "./chunk-DGCUPJZD.js";
24
+ import "./chunk-W3B4BHQU.js";
25
25
  import "./chunk-PZXCWSKV.js";
26
26
  import "./chunk-CAMX6OHF.js";
27
27
  import "./chunk-RX6F3GEA.js";
@@ -31,10 +31,11 @@ import "./chunk-VAJBWA2U.js";
31
31
  import "./chunk-HRYOZUSK.js";
32
32
  import "./chunk-VVZBBKRC.js";
33
33
  import "./chunk-YBMVHGY3.js";
34
- import "./chunk-XF4JUKVF.js";
34
+ import "./chunk-7EPXVICM.js";
35
35
  import "./chunk-GXDLWBOY.js";
36
36
  import "./chunk-TEINLN64.js";
37
37
  import "./chunk-ZJWUBJYQ.js";
38
+ import "./chunk-HR6IWNKE.js";
38
39
  import "./chunk-NE4F3FHN.js";
39
40
  import "./chunk-IFWP3ZDO.js";
40
41
  import "./chunk-NAWWC5I3.js";
@@ -50,4 +51,4 @@ export {
50
51
  syncCreativeDefinitionBestEffort,
51
52
  syncDefinitionCommand
52
53
  };
53
- //# sourceMappingURL=sync-definition-IPUFS5XS.js.map
54
+ //# sourceMappingURL=sync-definition-QR2N233R.js.map
@@ -3,10 +3,11 @@ import {
3
3
  } from "./chunk-PFBQERWX.js";
4
4
  import {
5
5
  TAG_IDENTIFYING_FIELD
6
- } from "./chunk-XF4JUKVF.js";
6
+ } from "./chunk-7EPXVICM.js";
7
7
  import "./chunk-GXDLWBOY.js";
8
8
  import "./chunk-TEINLN64.js";
9
9
  import "./chunk-ZJWUBJYQ.js";
10
+ import "./chunk-HR6IWNKE.js";
10
11
  import "./chunk-NE4F3FHN.js";
11
12
  import {
12
13
  ApiError,
@@ -221,4 +222,4 @@ export {
221
222
  tagsCommand,
222
223
  unstageBody
223
224
  };
224
- //# sourceMappingURL=tags-KFYLZLB3.js.map
225
+ //# sourceMappingURL=tags-4BAVFH4S.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commands/tags/index.ts","../src/commands/tags/shared.ts"],"sourcesContent":["import type { TagsDraftListResponse, TagsListResponse, TagsUnstageRequest, TagsUnstageResponse } from \"@baker/api\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { requireChatId, resolveChatId } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { CHAT_READ_ARG } from \"../chat-arg.ts\";\nimport { failApi, failValidation, renderEffectiveEntry, tagsListHints } from \"./shared.ts\";\n\nregisterSchema({\n command: \"tags.list\",\n description:\n \"Effective marketing tags for this chat: production tags overlaid with the changes staged in this chat. Prints each tag's readable config in full (secrets are never included) — e.g. the Clarity projectId, GA4 measurementId, or the entire custom `code` snippet — so reuse a stored value to pre-fill a follow-up change instead of asking the user for something we already have. The printed refs (tag ids or tag_temp_*) are exactly what flow side-effect tagIds should reference. Read-only — every tag change (create, edit, delete) goes through the request_tag_input approval tool; `baker tags unstage` takes back one this chat staged.\",\n args: {\n json: { type: \"boolean\", description: \"Print the raw JSON envelope instead of the readable list\", required: false },\n },\n});\n\nasync function listTags(json: boolean): Promise<void> {\n try {\n const chatId = requireChatId();\n const response = await apiPost<TagsListResponse>(\"/api/tags/list\", { chatId });\n const hints = tagsListHints();\n if (json) {\n writeJson({ ok: true, data: response, hints });\n return;\n }\n if (response.tags.length === 0) {\n process.stdout.write(\"No tags configured.\\n\");\n } else {\n process.stdout.write(`${response.tags.map(renderEffectiveEntry).join(\"\\n\")}\\n`);\n }\n // stdout stays the list and nothing else, so a reader piping it keeps\n // parsing it; the hints go to stderr, where the agent still reads them.\n for (const hint of hints) {\n process.stderr.write(`${hint}\\n`);\n }\n } catch (err) {\n failApi(err);\n }\n}\n\nconst listArgs = {\n json: { type: \"boolean\", description: \"Print the raw JSON envelope instead of the readable list\" },\n} as const;\n\nconst listCommand = defineCommand({\n meta: {\n name: \"list\",\n description:\n \"Effective tags for this chat (production + staged), with each tag's full readable config (secrets excluded) — reuse a stored value to pre-fill a change rather than asking the user. Refs printed here are what flow side-effect tagIds should use. Example: baker tags list\",\n },\n args: listArgs,\n run: async ({ args }) => {\n await listTags(args.json === true);\n },\n});\n\nasync function listDraft(chat?: unknown): Promise<void> {\n try {\n const chatId = resolveChatId(chat);\n const response = await apiPost<TagsDraftListResponse>(\"/api/tags/draft\", { chatId });\n writeJson({ ok: true, data: response, hints: tagsListHints() });\n } catch (err) {\n failApi(err);\n }\n}\n\nconst draftCommand = defineCommand({\n meta: {\n name: \"draft\",\n description:\n \"Review the tag changes staged in this chat (read-only). Staged changes were approved via request_tag_input and apply when the chat is published. To drop one, `baker tags unstage <ref>` with the ref printed here (or --all); to amend one, propose a follow-up change through the same tool. Takes --chat <id> to read an earlier chat's staged changes instead.\",\n },\n args: { chat: CHAT_READ_ARG },\n run: async ({ args }) => {\n await listDraft(args.chat);\n },\n});\n\nregisterSchema({\n command: \"tags.unstage\",\n description:\n \"Take back a tag change this chat staged, before Publish — the same as discarding its row in the change review. Pass the ref `baker tags draft` prints (a tag id, or tag_temp_* for a staged create), or --all for every staged tag change. Taking back a staged create also drops the secrets the user entered for it. Never touches a live tag: to change or remove one, propose the change through request_tag_input.\",\n args: {\n ref: { type: \"string\", description: \"The staged change's ref, from `baker tags draft`\", required: false },\n all: { type: \"boolean\", description: \"Take back every tag change staged in this chat\", required: false },\n },\n});\n\n/** The request for one unstage, checked before the round trip. */\nexport function unstageBody(args: { ref?: string; all?: boolean }, chatId: string): TagsUnstageRequest {\n const ref = args.ref?.trim();\n if (args.all === true && ref) {\n failValidation(\"Pass one ref to take back that change, or --all for every staged tag change — not both.\");\n }\n if (args.all === true) {\n return { chatId, all: true };\n }\n if (!ref) {\n failValidation(\"Pass the ref of the staged change (from `baker tags draft`), or --all.\");\n }\n return { chatId, ref };\n}\n\nconst unstageCommand = defineCommand({\n meta: {\n name: \"unstage\",\n description:\n \"Take back a tag change this chat staged, before Publish. Examples: baker tags unstage tag_temp_abc123 | baker tags unstage --all\",\n },\n args: {\n ref: { type: \"positional\", description: \"The staged change's ref, from `baker tags draft`\", required: false },\n all: { type: \"boolean\", description: \"Take back every tag change staged in this chat\", required: false },\n },\n run: async ({ args }) => {\n try {\n const body = unstageBody(\n {\n ...(typeof args.ref === \"string\" ? { ref: args.ref } : {}),\n ...(args.all === true ? { all: true } : {}),\n },\n requireChatId(),\n );\n const response = await apiPost<TagsUnstageResponse>(\"/api/tags/draft-op/remove\", body);\n writeJson({\n ...response,\n hints: [\"Taken back: it does not apply when the chat is published. Live tags are unchanged.\"],\n });\n } catch (err) {\n failApi(err);\n }\n },\n});\n\nexport const tagsCommand = defineCommand({\n meta: {\n name: \"tags\",\n description: `Read the client's marketing/analytics tags (Meta pixel, GA4, Google Ads, GTM, Clarity, Hotjar, …) — production tags plus the changes staged in this chat.\n\nEvery tag change — create, edit, or delete — goes through the request_tag_input tool (baker_ui MCP server): propose one or more changes (each becomes a tab in one approval form), pre-fill the non-secret fields you know, and the user reviews, fills secrets, and approves or skips each. Secret values (accessToken, apiSecret, authorizationToken, apiKey, conversionToken, OAuth connections) never pass through the CLI or the chat.\n\nRefs: \\`baker tags list\\` prints each tag's ref — a real tag id, or tag_temp_* for creates staged in this chat. Use these refs as flow side-effect tagIds; they keep resolving after publish.\n\n\\`baker tags list\\` prints each tag's readable config in full (secrets excluded) — the Clarity projectId, GA4 measurementId, the whole custom \\`code\\` snippet, etc. Reuse a stored value to pre-fill a follow-up change instead of asking the user for something already installed.\n\nTo take back a change this chat staged (before Publish), \\`baker tags unstage <ref>\\` — the ref \\`baker tags draft\\` prints — or \\`--all\\`. It never touches a live tag.\n\nExamples:\n baker tags list # production + staged, full readable config + secret status\n baker tags draft # review the staged changes awaiting publish\n baker tags unstage tag_temp_abc123 # take back one staged change\nFull guide: __tooling__/docs/tools/baker/tags.md`,\n },\n subCommands: {\n list: listCommand,\n draft: draftCommand,\n unstage: unstageCommand,\n },\n // Bare `baker tags` lists the effective tags. `args` stays so citty knows this\n // command's flags when it scans rawArgs for a subcommand name, and `default` (not\n // `run`) dispatches the bare invocation — citty falls through to `run` after a\n // subcommand, so a `run` here would also list on every `baker tags draft`.\n args: listArgs,\n default: \"list\",\n});\n","import { TAG_IDENTIFYING_FIELD, type TagsEffectiveEntry } from \"@baker/api\";\nimport { ApiError } from \"../../client.ts\";\nimport { writeJson } from \"../../output.ts\";\n\nexport function failApi(err: unknown): never {\n if (err instanceof ApiError) {\n writeJson({ ok: false, error: { code: err.code, message: err.message } });\n process.exit(1);\n }\n if (err instanceof Error) {\n writeJson({ ok: false, error: { code: \"INTERNAL_ERROR\", message: err.message } });\n process.exit(1);\n }\n writeJson({ ok: false, error: { code: \"INTERNAL_ERROR\", message: \"Unexpected error\" } });\n process.exit(1);\n}\n\nexport function failValidation(message: string): never {\n writeJson({ ok: false, error: { code: \"VALIDATION_ERROR\", message } });\n process.exit(1);\n}\n\n/** Indent a possibly multi-line config value so long snippets (the `code` tag) stay readable. */\nfunction renderConfigValue(value: string): string {\n return value.includes(\"\\n\") ? value.replace(/\\n/g, \"\\n \") : value;\n}\n\nexport function renderEffectiveEntry(entry: TagsEffectiveEntry): string {\n const parts = [entry.ref, entry.type];\n if (entry.identifier !== undefined) {\n parts.push(entry.identifier);\n }\n if (entry.staged !== undefined) {\n parts.push(`[staged: ${entry.staged}]`);\n }\n const secretBits = [\n ...entry.secretsSet.map((field) => `${field} ✓ set`),\n ...entry.secretsPending.map((field) => `${field} ⏳ pending`),\n ];\n if (secretBits.length > 0) {\n parts.push(`[secrets: ${secretBits.join(\", \")}]`);\n }\n const header = parts.join(\" \");\n // All config values here are already redacted server-side (secrets stripped),\n // so every field printed is safe to read and reuse. Printing them in full lets\n // the agent auto-populate a follow-up change (e.g. the Clarity projectId or the\n // whole custom `code` snippet) instead of asking the user for a value we store.\n // Skip the identifying field — it's already on the header line as `identifier`.\n const identifyingField = TAG_IDENTIFYING_FIELD[entry.type];\n const configLines = Object.entries(entry.config)\n .filter(([key]) => key !== identifyingField)\n .map(([key, value]) => ` ${key}: ${renderConfigValue(value)}`);\n return configLines.length > 0 ? `${header}\\n${configLines.join(\"\\n\")}` : header;\n}\n\n/**\n * The write path, restated on every read.\n *\n * This family is read-only, so `list` is where a chat decides what to do about\n * a tag — and a production chat decided, from its tool list alone, that the\n * approval form did not exist, never called it, and filed the change as a Task\n * the user had to carry out by hand. The form is attached to every turn\n * (`baker_ui` rides along on each query), so \"it isn't there\" is a conclusion\n * only a failed call may reach.\n */\nexport function tagsListHints(): string[] {\n return [\n \"To create, edit or delete a tag, call the `request_tag_input` approval form (tool `mcp__baker_ui__request_tag_input`, server `baker_ui`) — it is attached to every turn of this chat and collects any secret values itself.\",\n \"Don't conclude the form is unavailable from your tool list: call it, and report what it returns. And never file a tag change as a Task — a Task hands the user work this chat can stage in one call.\",\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,qBAAqB;;;ACGvB,SAAS,QAAQ,KAAqB;AAC3C,MAAI,eAAe,UAAU;AAC3B,cAAU,EAAE,IAAI,OAAO,OAAO,EAAE,MAAM,IAAI,MAAM,SAAS,IAAI,QAAQ,EAAE,CAAC;AACxE,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,MAAI,eAAe,OAAO;AACxB,cAAU,EAAE,IAAI,OAAO,OAAO,EAAE,MAAM,kBAAkB,SAAS,IAAI,QAAQ,EAAE,CAAC;AAChF,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,YAAU,EAAE,IAAI,OAAO,OAAO,EAAE,MAAM,kBAAkB,SAAS,mBAAmB,EAAE,CAAC;AACvF,UAAQ,KAAK,CAAC;AAChB;AAEO,SAAS,eAAe,SAAwB;AACrD,YAAU,EAAE,IAAI,OAAO,OAAO,EAAE,MAAM,oBAAoB,QAAQ,EAAE,CAAC;AACrE,UAA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AACZ,cAAQ,GAAG;AAAA,IACb;AAAA,EACF;AACF,CAAC;AAEM,IAAM,cAAc,cAAc;AAAA,EACvC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAef;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM;AAAA,EACN,SAAS;AACX,CAAC;","names":[]}
1
+ {"version":3,"sources":["../src/commands/tags/index.ts","../src/commands/tags/shared.ts"],"sourcesContent":["import type { TagsDraftListResponse, TagsListResponse, TagsUnstageRequest, TagsUnstageResponse } from \"@baker/api\";\nimport { defineCommand } from \"citty\";\nimport { apiPost } from \"../../client.ts\";\nimport { requireChatId, resolveChatId } from \"../../env.ts\";\nimport { writeJson } from \"../../output.ts\";\nimport { registerSchema } from \"../../schemas.ts\";\nimport { CHAT_READ_ARG } from \"../chat-arg.ts\";\nimport { failApi, failValidation, renderEffectiveEntry, tagsListHints } from \"./shared.ts\";\n\nregisterSchema({\n command: \"tags.list\",\n description:\n \"Effective marketing tags for this chat: production tags overlaid with the changes staged in this chat. Prints each tag's readable config in full (secrets are never included) — e.g. the Clarity projectId, GA4 measurementId, or the entire custom `code` snippet — so reuse a stored value to pre-fill a follow-up change instead of asking the user for something we already have. The printed refs (tag ids or tag_temp_*) are exactly what flow side-effect tagIds should reference. Read-only — every tag change (create, edit, delete) goes through the request_tag_input approval tool; `baker tags unstage` takes back one this chat staged.\",\n args: {\n json: { type: \"boolean\", description: \"Print the raw JSON envelope instead of the readable list\", required: false },\n },\n});\n\nasync function listTags(json: boolean): Promise<void> {\n try {\n const chatId = requireChatId();\n const response = await apiPost<TagsListResponse>(\"/api/tags/list\", { chatId });\n const hints = tagsListHints();\n if (json) {\n writeJson({ ok: true, data: response, hints });\n return;\n }\n if (response.tags.length === 0) {\n process.stdout.write(\"No tags configured.\\n\");\n } else {\n process.stdout.write(`${response.tags.map(renderEffectiveEntry).join(\"\\n\")}\\n`);\n }\n // stdout stays the list and nothing else, so a reader piping it keeps\n // parsing it; the hints go to stderr, where the agent still reads them.\n for (const hint of hints) {\n process.stderr.write(`${hint}\\n`);\n }\n } catch (err) {\n failApi(err);\n }\n}\n\nconst listArgs = {\n json: { type: \"boolean\", description: \"Print the raw JSON envelope instead of the readable list\" },\n} as const;\n\nconst listCommand = defineCommand({\n meta: {\n name: \"list\",\n description:\n \"Effective tags for this chat (production + staged), with each tag's full readable config (secrets excluded) — reuse a stored value to pre-fill a change rather than asking the user. Refs printed here are what flow side-effect tagIds should use. Example: baker tags list\",\n },\n args: listArgs,\n run: async ({ args }) => {\n await listTags(args.json === true);\n },\n});\n\nasync function listDraft(chat?: unknown): Promise<void> {\n try {\n const chatId = resolveChatId(chat);\n const response = await apiPost<TagsDraftListResponse>(\"/api/tags/draft\", { chatId });\n writeJson({ ok: true, data: response, hints: tagsListHints() });\n } catch (err) {\n failApi(err);\n }\n}\n\nconst draftCommand = defineCommand({\n meta: {\n name: \"draft\",\n description:\n \"Review the tag changes staged in this chat (read-only). Staged changes were approved via request_tag_input and apply when the chat is published. To drop one, `baker tags unstage <ref>` with the ref printed here (or --all); to amend one, propose a follow-up change through the same tool. Takes --chat <id> to read an earlier chat's staged changes instead.\",\n },\n args: { chat: CHAT_READ_ARG },\n run: async ({ args }) => {\n await listDraft(args.chat);\n },\n});\n\nregisterSchema({\n command: \"tags.unstage\",\n description:\n \"Take back a tag change this chat staged, before Publish — the same as discarding its row in the change review. Pass the ref `baker tags draft` prints (a tag id, or tag_temp_* for a staged create), or --all for every staged tag change. Taking back a staged create also drops the secrets the user entered for it. Never touches a live tag: to change or remove one, propose the change through request_tag_input.\",\n args: {\n ref: { type: \"string\", description: \"The staged change's ref, from `baker tags draft`\", required: false },\n all: { type: \"boolean\", description: \"Take back every tag change staged in this chat\", required: false },\n },\n});\n\n/** The request for one unstage, checked before the round trip. */\nexport function unstageBody(args: { ref?: string; all?: boolean }, chatId: string): TagsUnstageRequest {\n const ref = args.ref?.trim();\n if (args.all === true && ref) {\n failValidation(\"Pass one ref to take back that change, or --all for every staged tag change — not both.\");\n }\n if (args.all === true) {\n return { chatId, all: true };\n }\n if (!ref) {\n failValidation(\"Pass the ref of the staged change (from `baker tags draft`), or --all.\");\n }\n return { chatId, ref };\n}\n\nconst unstageCommand = defineCommand({\n meta: {\n name: \"unstage\",\n description:\n \"Take back a tag change this chat staged, before Publish. Examples: baker tags unstage tag_temp_abc123 | baker tags unstage --all\",\n },\n args: {\n ref: { type: \"positional\", description: \"The staged change's ref, from `baker tags draft`\", required: false },\n all: { type: \"boolean\", description: \"Take back every tag change staged in this chat\", required: false },\n },\n run: async ({ args }) => {\n try {\n const body = unstageBody(\n {\n ...(typeof args.ref === \"string\" ? { ref: args.ref } : {}),\n ...(args.all === true ? { all: true } : {}),\n },\n requireChatId(),\n );\n const response = await apiPost<TagsUnstageResponse>(\"/api/tags/draft-op/remove\", body);\n writeJson({\n ...response,\n hints: [\"Taken back: it does not apply when the chat is published. Live tags are unchanged.\"],\n });\n } catch (err) {\n failApi(err);\n }\n },\n});\n\nexport const tagsCommand = defineCommand({\n meta: {\n name: \"tags\",\n description: `Read the client's marketing/analytics tags (Meta pixel, GA4, Google Ads, GTM, Clarity, Hotjar, …) — production tags plus the changes staged in this chat.\n\nEvery tag change — create, edit, or delete — goes through the request_tag_input tool (baker_ui MCP server): propose one or more changes (each becomes a tab in one approval form), pre-fill the non-secret fields you know, and the user reviews, fills secrets, and approves or skips each. Secret values (accessToken, apiSecret, authorizationToken, apiKey, conversionToken, OAuth connections) never pass through the CLI or the chat.\n\nRefs: \\`baker tags list\\` prints each tag's ref — a real tag id, or tag_temp_* for creates staged in this chat. Use these refs as flow side-effect tagIds; they keep resolving after publish.\n\n\\`baker tags list\\` prints each tag's readable config in full (secrets excluded) — the Clarity projectId, GA4 measurementId, the whole custom \\`code\\` snippet, etc. Reuse a stored value to pre-fill a follow-up change instead of asking the user for something already installed.\n\nTo take back a change this chat staged (before Publish), \\`baker tags unstage <ref>\\` — the ref \\`baker tags draft\\` prints — or \\`--all\\`. It never touches a live tag.\n\nExamples:\n baker tags list # production + staged, full readable config + secret status\n baker tags draft # review the staged changes awaiting publish\n baker tags unstage tag_temp_abc123 # take back one staged change\nFull guide: __tooling__/docs/tools/baker/tags.md`,\n },\n subCommands: {\n list: listCommand,\n draft: draftCommand,\n unstage: unstageCommand,\n },\n // Bare `baker tags` lists the effective tags. `args` stays so citty knows this\n // command's flags when it scans rawArgs for a subcommand name, and `default` (not\n // `run`) dispatches the bare invocation — citty falls through to `run` after a\n // subcommand, so a `run` here would also list on every `baker tags draft`.\n args: listArgs,\n default: \"list\",\n});\n","import { TAG_IDENTIFYING_FIELD, type TagsEffectiveEntry } from \"@baker/api\";\nimport { ApiError } from \"../../client.ts\";\nimport { writeJson } from \"../../output.ts\";\n\nexport function failApi(err: unknown): never {\n if (err instanceof ApiError) {\n writeJson({ ok: false, error: { code: err.code, message: err.message } });\n process.exit(1);\n }\n if (err instanceof Error) {\n writeJson({ ok: false, error: { code: \"INTERNAL_ERROR\", message: err.message } });\n process.exit(1);\n }\n writeJson({ ok: false, error: { code: \"INTERNAL_ERROR\", message: \"Unexpected error\" } });\n process.exit(1);\n}\n\nexport function failValidation(message: string): never {\n writeJson({ ok: false, error: { code: \"VALIDATION_ERROR\", message } });\n process.exit(1);\n}\n\n/** Indent a possibly multi-line config value so long snippets (the `code` tag) stay readable. */\nfunction renderConfigValue(value: string): string {\n return value.includes(\"\\n\") ? value.replace(/\\n/g, \"\\n \") : value;\n}\n\nexport function renderEffectiveEntry(entry: TagsEffectiveEntry): string {\n const parts = [entry.ref, entry.type];\n if (entry.identifier !== undefined) {\n parts.push(entry.identifier);\n }\n if (entry.staged !== undefined) {\n parts.push(`[staged: ${entry.staged}]`);\n }\n const secretBits = [\n ...entry.secretsSet.map((field) => `${field} ✓ set`),\n ...entry.secretsPending.map((field) => `${field} ⏳ pending`),\n ];\n if (secretBits.length > 0) {\n parts.push(`[secrets: ${secretBits.join(\", \")}]`);\n }\n const header = parts.join(\" \");\n // All config values here are already redacted server-side (secrets stripped),\n // so every field printed is safe to read and reuse. Printing them in full lets\n // the agent auto-populate a follow-up change (e.g. the Clarity projectId or the\n // whole custom `code` snippet) instead of asking the user for a value we store.\n // Skip the identifying field — it's already on the header line as `identifier`.\n const identifyingField = TAG_IDENTIFYING_FIELD[entry.type];\n const configLines = Object.entries(entry.config)\n .filter(([key]) => key !== identifyingField)\n .map(([key, value]) => ` ${key}: ${renderConfigValue(value)}`);\n return configLines.length > 0 ? `${header}\\n${configLines.join(\"\\n\")}` : header;\n}\n\n/**\n * The write path, restated on every read.\n *\n * This family is read-only, so `list` is where a chat decides what to do about\n * a tag — and a production chat decided, from its tool list alone, that the\n * approval form did not exist, never called it, and filed the change as a Task\n * the user had to carry out by hand. The form is attached to every turn\n * (`baker_ui` rides along on each query), so \"it isn't there\" is a conclusion\n * only a failed call may reach.\n */\nexport function tagsListHints(): string[] {\n return [\n \"To create, edit or delete a tag, call the `request_tag_input` approval form (tool `mcp__baker_ui__request_tag_input`, server `baker_ui`) — it is attached to every turn of this chat and collects any secret values itself.\",\n \"Don't conclude the form is unavailable from your tool list: call it, and report what it returns. And never file a tag change as a Task — a Task hands the user work this chat can stage in one call.\",\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,qBAAqB;;;ACGvB,SAAS,QAAQ,KAAqB;AAC3C,MAAI,eAAe,UAAU;AAC3B,cAAU,EAAE,IAAI,OAAO,OAAO,EAAE,MAAM,IAAI,MAAM,SAAS,IAAI,QAAQ,EAAE,CAAC;AACxE,YAAQ,KAAK,CAAC;AAAA,EAChB;AACA,MAAI,eAAe,OAAO;AACxB,cAAU,EAAE,IAAI,OAAO,OAAO,EAAE,MAAM,kBAA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W,EAAE,KAAK,KAAK,IAAI,IAAI,CAAC;AAAA,UACxD,GAAI,KAAK,QAAQ,OAAO,EAAE,KAAK,KAAK,IAAI,CAAC;AAAA,QAC3C;AAAA,QACA,cAAc;AAAA,MAChB;AACA,YAAM,WAAW,MAAM,QAA6B,6BAA6B,IAAI;AACrF,gBAAU;AAAA,QACR,GAAG;AAAA,QACH,OAAO,CAAC,oFAAoF;AAAA,MAC9F,CAAC;AAAA,IACH,SAAS,KAAK;AACZ,cAAQ,GAAG;AAAA,IACb;AAAA,EACF;AACF,CAAC;AAEM,IAAM,cAAc,cAAc;AAAA,EACvC,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,aAAa;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAef;AAAA,EACA,aAAa;AAAA,IACX,MAAM;AAAA,IACN,OAAO;AAAA,IACP,SAAS;AAAA,EACX;AAAA;AAAA;AAAA;AAAA;AAAA,EAKA,MAAM;AAAA,EACN,SAAS;AACX,CAAC;","names":[]}
@@ -1,10 +1,11 @@
1
1
  import {
2
2
  makeTagsCommand
3
- } from "./chunk-3G3ZDLMI.js";
4
- import "./chunk-XF4JUKVF.js";
3
+ } from "./chunk-5ZNTADVR.js";
4
+ import "./chunk-7EPXVICM.js";
5
5
  import "./chunk-GXDLWBOY.js";
6
6
  import "./chunk-TEINLN64.js";
7
7
  import "./chunk-ZJWUBJYQ.js";
8
+ import "./chunk-HR6IWNKE.js";
8
9
  import "./chunk-NE4F3FHN.js";
9
10
  import "./chunk-XBOK23HI.js";
10
11
  import "./chunk-IFWP3ZDO.js";
@@ -17,4 +18,4 @@ var tagsCommand = makeTagsCommand("testimonials", "testimonial", "/api/testimoni
17
18
  export {
18
19
  tagsCommand
19
20
  };
20
- //# sourceMappingURL=tags-ABHSX6M5.js.map
21
+ //# sourceMappingURL=tags-5SBMRC2A.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/commands/testimonials/tags.ts"],"sourcesContent":["import { makeTagsCommand } from \"../../lib/tags-command.ts\";\n\nexport const tagsCommand = makeTagsCommand(\"testimonials\", \"testimonial\", \"/api/testimonials/tags\");\n"],"mappings":";;;;;;;;;;;;;;;AAEO,IAAM,cAAc,gBAAgB,gBAAgB,eAAe,wBAAwB;","names":[]}
1
+ {"version":3,"sources":["../src/commands/testimonials/tags.ts"],"sourcesContent":["import { makeTagsCommand } from \"../../lib/tags-command.ts\";\n\nexport const tagsCommand = makeTagsCommand(\"testimonials\", \"testimonial\", \"/api/testimonials/tags\");\n"],"mappings":";;;;;;;;;;;;;;;;AAEO,IAAM,cAAc,gBAAgB,gBAAgB,eAAe,wBAAwB;","names":[]}
@@ -15,12 +15,12 @@ Examples:
15
15
  },
16
16
  subCommands: {
17
17
  list: () => import("./list-7MVBXOJT.js").then((m) => m.tagsListCommand),
18
- create: () => import("./create-FX4OJ2XF.js").then((m) => m.tagsCreateCommand),
19
- update: () => import("./update-2S7CSEAW.js").then((m) => m.tagsUpdateCommand),
20
- delete: () => import("./delete-HGHXY24R.js").then((m) => m.tagsDeleteCommand)
18
+ create: () => import("./create-JFSK4BOP.js").then((m) => m.tagsCreateCommand),
19
+ update: () => import("./update-S4562V3O.js").then((m) => m.tagsUpdateCommand),
20
+ delete: () => import("./delete-KRH2YMSZ.js").then((m) => m.tagsDeleteCommand)
21
21
  }
22
22
  });
23
23
  export {
24
24
  tagsCommand
25
25
  };
26
- //# sourceMappingURL=tags-3WPW6PTV.js.map
26
+ //# sourceMappingURL=tags-PYWFSBTR.js.map