@hogsend/engine 0.66.0 → 0.68.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (760) hide show
  1. package/README.md +3 -2
  2. package/dist/account-links/__fixtures__/fake-fetch.d.ts +38 -0
  3. package/dist/account-links/__fixtures__/fake-fetch.d.ts.map +1 -0
  4. package/dist/account-links/battlenet.d.ts +36 -0
  5. package/dist/account-links/battlenet.d.ts.map +1 -0
  6. package/dist/account-links/epic.d.ts +36 -0
  7. package/dist/account-links/epic.d.ts.map +1 -0
  8. package/dist/account-links/index.d.ts +7 -0
  9. package/dist/account-links/index.d.ts.map +1 -0
  10. package/dist/account-links/riot.d.ts +35 -0
  11. package/dist/account-links/riot.d.ts.map +1 -0
  12. package/dist/account-links/steam.d.ts +35 -0
  13. package/dist/account-links/steam.d.ts.map +1 -0
  14. package/dist/account-links/twitch.d.ts +38 -0
  15. package/dist/account-links/twitch.d.ts.map +1 -0
  16. package/dist/account-links/xbox.d.ts +39 -0
  17. package/dist/account-links/xbox.d.ts.map +1 -0
  18. package/dist/app.d.ts +50 -0
  19. package/dist/app.d.ts.map +1 -0
  20. package/dist/buckets/bucket-access.d.ts +60 -0
  21. package/dist/buckets/bucket-access.d.ts.map +1 -0
  22. package/dist/buckets/bucket-reactions.d.ts +100 -0
  23. package/dist/buckets/bucket-reactions.d.ts.map +1 -0
  24. package/dist/buckets/check-membership.d.ts +105 -0
  25. package/dist/buckets/check-membership.d.ts.map +1 -0
  26. package/dist/buckets/define-bucket.d.ts +53 -0
  27. package/dist/buckets/define-bucket.d.ts.map +1 -0
  28. package/dist/buckets/membership-epoch.d.ts +74 -0
  29. package/dist/buckets/membership-epoch.d.ts.map +1 -0
  30. package/dist/buckets/registry-singleton.d.ts +6 -0
  31. package/dist/buckets/registry-singleton.d.ts.map +1 -0
  32. package/dist/buckets/registry.d.ts +59 -0
  33. package/dist/buckets/registry.d.ts.map +1 -0
  34. package/dist/campaigns/cohort-sql.d.ts +54 -0
  35. package/dist/campaigns/cohort-sql.d.ts.map +1 -0
  36. package/dist/campaigns/define-campaign.d.ts +105 -0
  37. package/dist/campaigns/define-campaign.d.ts.map +1 -0
  38. package/dist/campaigns/reconcile.d.ts +13 -0
  39. package/dist/campaigns/reconcile.d.ts.map +1 -0
  40. package/dist/campaigns/steps.d.ts +29 -0
  41. package/dist/campaigns/steps.d.ts.map +1 -0
  42. package/dist/cold-connect/index.d.ts +98 -0
  43. package/dist/cold-connect/index.d.ts.map +1 -0
  44. package/dist/cold-connect/page.d.ts +69 -0
  45. package/dist/cold-connect/page.d.ts.map +1 -0
  46. package/dist/cold-connect/throttle.d.ts +39 -0
  47. package/dist/cold-connect/throttle.d.ts.map +1 -0
  48. package/dist/cold-connect/token.d.ts +57 -0
  49. package/dist/cold-connect/token.d.ts.map +1 -0
  50. package/dist/connectors/action-registry-singleton.d.ts +21 -0
  51. package/dist/connectors/action-registry-singleton.d.ts.map +1 -0
  52. package/dist/connectors/define-action.d.ts +117 -0
  53. package/dist/connectors/define-action.d.ts.map +1 -0
  54. package/dist/connectors/define-connector.d.ts +172 -0
  55. package/dist/connectors/define-connector.d.ts.map +1 -0
  56. package/dist/connectors/presets/index.d.ts +17 -0
  57. package/dist/connectors/presets/index.d.ts.map +1 -0
  58. package/dist/connectors/registry-singleton.d.ts +34 -0
  59. package/dist/connectors/registry-singleton.d.ts.map +1 -0
  60. package/dist/connectors/runtime.d.ts +68 -0
  61. package/dist/connectors/runtime.d.ts.map +1 -0
  62. package/dist/container.d.ts +678 -0
  63. package/dist/container.d.ts.map +1 -0
  64. package/dist/destinations/define-destination.d.ts +96 -0
  65. package/dist/destinations/define-destination.d.ts.map +1 -0
  66. package/dist/destinations/presets/index.d.ts +42 -0
  67. package/dist/destinations/presets/index.d.ts.map +1 -0
  68. package/dist/destinations/presets/posthog.d.ts +12 -0
  69. package/dist/destinations/presets/posthog.d.ts.map +1 -0
  70. package/dist/destinations/presets/segment.d.ts +15 -0
  71. package/dist/destinations/presets/segment.d.ts.map +1 -0
  72. package/dist/destinations/presets/slack.d.ts +10 -0
  73. package/dist/destinations/presets/slack.d.ts.map +1 -0
  74. package/dist/destinations/presets/webhook.d.ts +14 -0
  75. package/dist/destinations/presets/webhook.d.ts.map +1 -0
  76. package/dist/destinations/registry-singleton.d.ts +44 -0
  77. package/dist/destinations/registry-singleton.d.ts.map +1 -0
  78. package/dist/env.d.ts +119 -0
  79. package/dist/env.d.ts.map +1 -0
  80. package/dist/flags/reconcile.d.ts +36 -0
  81. package/dist/flags/reconcile.d.ts.map +1 -0
  82. package/dist/index.d.ts +210 -0
  83. package/dist/index.d.ts.map +1 -0
  84. package/dist/journeys/authoring.d.ts +15 -0
  85. package/dist/journeys/authoring.d.ts.map +1 -0
  86. package/dist/journeys/client-defaults-singleton.d.ts +16 -0
  87. package/dist/journeys/client-defaults-singleton.d.ts.map +1 -0
  88. package/dist/journeys/constants.d.ts +32 -0
  89. package/dist/journeys/constants.d.ts.map +1 -0
  90. package/dist/journeys/define-journey.d.ts +33 -0
  91. package/dist/journeys/define-journey.d.ts.map +1 -0
  92. package/dist/journeys/durable-law-harness.d.ts +74 -0
  93. package/dist/journeys/durable-law-harness.d.ts.map +1 -0
  94. package/dist/journeys/errors.d.ts +13 -0
  95. package/dist/journeys/errors.d.ts.map +1 -0
  96. package/dist/journeys/execute-journey-run.d.ts +160 -0
  97. package/dist/journeys/execute-journey-run.d.ts.map +1 -0
  98. package/dist/journeys/graph/build-graph.d.ts +24 -0
  99. package/dist/journeys/graph/build-graph.d.ts.map +1 -0
  100. package/dist/journeys/group-scope.d.ts +56 -0
  101. package/dist/journeys/group-scope.d.ts.map +1 -0
  102. package/dist/journeys/journey-boundary.d.ts +264 -0
  103. package/dist/journeys/journey-boundary.d.ts.map +1 -0
  104. package/dist/journeys/journey-context.d.ts +60 -0
  105. package/dist/journeys/journey-context.d.ts.map +1 -0
  106. package/dist/journeys/journey-log.d.ts +42 -0
  107. package/dist/journeys/journey-log.d.ts.map +1 -0
  108. package/dist/journeys/journey-source-locations-singleton.d.ts +6 -0
  109. package/dist/journeys/journey-source-locations-singleton.d.ts.map +1 -0
  110. package/dist/journeys/journey-sources-singleton.d.ts +5 -0
  111. package/dist/journeys/journey-sources-singleton.d.ts.map +1 -0
  112. package/dist/journeys/journey-task-factory.d.ts +11 -0
  113. package/dist/journeys/journey-task-factory.d.ts.map +1 -0
  114. package/dist/journeys/journey-task-runtime.d.ts +2 -0
  115. package/dist/journeys/journey-task-runtime.d.ts.map +1 -0
  116. package/dist/journeys/journey-version.d.ts +71 -0
  117. package/dist/journeys/journey-version.d.ts.map +1 -0
  118. package/dist/journeys/record-once.d.ts +56 -0
  119. package/dist/journeys/record-once.d.ts.map +1 -0
  120. package/dist/journeys/registry-singleton.d.ts +6 -0
  121. package/dist/journeys/registry-singleton.d.ts.map +1 -0
  122. package/dist/journeys/registry.d.ts +59 -0
  123. package/dist/journeys/registry.d.ts.map +1 -0
  124. package/dist/journeys/with-durable-gate.d.ts +97 -0
  125. package/dist/journeys/with-durable-gate.d.ts.map +1 -0
  126. package/dist/lib/account-link-emit.d.ts +69 -0
  127. package/dist/lib/account-link-emit.d.ts.map +1 -0
  128. package/dist/lib/account-link-events.d.ts +128 -0
  129. package/dist/lib/account-link-events.d.ts.map +1 -0
  130. package/dist/lib/account-link-hooks.d.ts +32 -0
  131. package/dist/lib/account-link-hooks.d.ts.map +1 -0
  132. package/dist/lib/account-link-ingest.d.ts +78 -0
  133. package/dist/lib/account-link-ingest.d.ts.map +1 -0
  134. package/dist/lib/account-link-nonce.d.ts +29 -0
  135. package/dist/lib/account-link-nonce.d.ts.map +1 -0
  136. package/dist/lib/account-link-origins.d.ts +37 -0
  137. package/dist/lib/account-link-origins.d.ts.map +1 -0
  138. package/dist/lib/account-link-pkce.d.ts +48 -0
  139. package/dist/lib/account-link-pkce.d.ts.map +1 -0
  140. package/dist/lib/account-link-provider-registry.d.ts +35 -0
  141. package/dist/lib/account-link-provider-registry.d.ts.map +1 -0
  142. package/dist/lib/account-link-throttle.d.ts +76 -0
  143. package/dist/lib/account-link-throttle.d.ts.map +1 -0
  144. package/dist/lib/account-link-url.d.ts +41 -0
  145. package/dist/lib/account-link-url.d.ts.map +1 -0
  146. package/dist/lib/account-links-from-env.d.ts +62 -0
  147. package/dist/lib/account-links-from-env.d.ts.map +1 -0
  148. package/dist/lib/account-links.d.ts +353 -0
  149. package/dist/lib/account-links.d.ts.map +1 -0
  150. package/dist/lib/agent/config.d.ts +14 -0
  151. package/dist/lib/agent/config.d.ts.map +1 -0
  152. package/dist/lib/agent/proposals.d.ts +52 -0
  153. package/dist/lib/agent/proposals.d.ts.map +1 -0
  154. package/dist/lib/agent/provider.d.ts +9 -0
  155. package/dist/lib/agent/provider.d.ts.map +1 -0
  156. package/dist/lib/agent/risk.d.ts +24 -0
  157. package/dist/lib/agent/risk.d.ts.map +1 -0
  158. package/dist/lib/agent/system-prompt.d.ts +8 -0
  159. package/dist/lib/agent/system-prompt.d.ts.map +1 -0
  160. package/dist/lib/agent/tools.d.ts +258 -0
  161. package/dist/lib/agent/tools.d.ts.map +1 -0
  162. package/dist/lib/alerting.d.ts +7 -0
  163. package/dist/lib/alerting.d.ts.map +1 -0
  164. package/dist/lib/analytics-adapter.d.ts +24 -0
  165. package/dist/lib/analytics-adapter.d.ts.map +1 -0
  166. package/dist/lib/analytics-identity.d.ts +60 -0
  167. package/dist/lib/analytics-identity.d.ts.map +1 -0
  168. package/dist/lib/analytics-provider-registry.d.ts +20 -0
  169. package/dist/lib/analytics-provider-registry.d.ts.map +1 -0
  170. package/dist/lib/analytics-providers-from-env.d.ts +41 -0
  171. package/dist/lib/analytics-providers-from-env.d.ts.map +1 -0
  172. package/dist/lib/analytics-singleton.d.ts +10 -0
  173. package/dist/lib/analytics-singleton.d.ts.map +1 -0
  174. package/dist/lib/api-key-hash.d.ts +9 -0
  175. package/dist/lib/api-key-hash.d.ts.map +1 -0
  176. package/dist/lib/app-secret.d.ts +29 -0
  177. package/dist/lib/app-secret.d.ts.map +1 -0
  178. package/dist/lib/attachments.d.ts +53 -0
  179. package/dist/lib/attachments.d.ts.map +1 -0
  180. package/dist/lib/attribution-backfill.d.ts +48 -0
  181. package/dist/lib/attribution-backfill.d.ts.map +1 -0
  182. package/dist/lib/attribution.d.ts +44 -0
  183. package/dist/lib/attribution.d.ts.map +1 -0
  184. package/dist/lib/auth.d.ts +136 -0
  185. package/dist/lib/auth.d.ts.map +1 -0
  186. package/dist/lib/backfill.d.ts +41 -0
  187. package/dist/lib/backfill.d.ts.map +1 -0
  188. package/dist/lib/banner.d.ts +52 -0
  189. package/dist/lib/banner.d.ts.map +1 -0
  190. package/dist/lib/blueprint-lock.d.ts +19 -0
  191. package/dist/lib/blueprint-lock.d.ts.map +1 -0
  192. package/dist/lib/blueprints.d.ts +573 -0
  193. package/dist/lib/blueprints.d.ts.map +1 -0
  194. package/dist/lib/boot-api-key.d.ts +38 -0
  195. package/dist/lib/boot-api-key.d.ts.map +1 -0
  196. package/dist/lib/boot.d.ts +23 -0
  197. package/dist/lib/boot.d.ts.map +1 -0
  198. package/dist/lib/bootstrap-admin.d.ts +33 -0
  199. package/dist/lib/bootstrap-admin.d.ts.map +1 -0
  200. package/dist/lib/bot-prefetch.d.ts +21 -0
  201. package/dist/lib/bot-prefetch.d.ts.map +1 -0
  202. package/dist/lib/bucket-emit.d.ts +75 -0
  203. package/dist/lib/bucket-emit.d.ts.map +1 -0
  204. package/dist/lib/bucket-posthog-sync.d.ts +29 -0
  205. package/dist/lib/bucket-posthog-sync.d.ts.map +1 -0
  206. package/dist/lib/campaign-send-key.d.ts +31 -0
  207. package/dist/lib/campaign-send-key.d.ts.map +1 -0
  208. package/dist/lib/connector-actions.d.ts +83 -0
  209. package/dist/lib/connector-actions.d.ts.map +1 -0
  210. package/dist/lib/connector-heartbeat.d.ts +35 -0
  211. package/dist/lib/connector-heartbeat.d.ts.map +1 -0
  212. package/dist/lib/connector-link-codes.d.ts +105 -0
  213. package/dist/lib/connector-link-codes.d.ts.map +1 -0
  214. package/dist/lib/connector-state.d.ts +97 -0
  215. package/dist/lib/connector-state.d.ts.map +1 -0
  216. package/dist/lib/contacts.d.ts +622 -0
  217. package/dist/lib/contacts.d.ts.map +1 -0
  218. package/dist/lib/conversion-dispatch.d.ts +98 -0
  219. package/dist/lib/conversion-dispatch.d.ts.map +1 -0
  220. package/dist/lib/conversions.d.ts +75 -0
  221. package/dist/lib/conversions.d.ts.map +1 -0
  222. package/dist/lib/create-admin.d.ts +54 -0
  223. package/dist/lib/create-admin.d.ts.map +1 -0
  224. package/dist/lib/crm-deals.d.ts +66 -0
  225. package/dist/lib/crm-deals.d.ts.map +1 -0
  226. package/dist/lib/crm-ingest.d.ts +38 -0
  227. package/dist/lib/crm-ingest.d.ts.map +1 -0
  228. package/dist/lib/crm-provider-registry.d.ts +20 -0
  229. package/dist/lib/crm-provider-registry.d.ts.map +1 -0
  230. package/dist/lib/crm-registry-singleton.d.ts +18 -0
  231. package/dist/lib/crm-registry-singleton.d.ts.map +1 -0
  232. package/dist/lib/db.d.ts +3 -0
  233. package/dist/lib/db.d.ts.map +1 -0
  234. package/dist/lib/deal-money-events.d.ts +35 -0
  235. package/dist/lib/deal-money-events.d.ts.map +1 -0
  236. package/dist/lib/discord-gateway-heartbeat.d.ts +47 -0
  237. package/dist/lib/discord-gateway-heartbeat.d.ts.map +1 -0
  238. package/dist/lib/domain-status.d.ts +87 -0
  239. package/dist/lib/domain-status.d.ts.map +1 -0
  240. package/dist/lib/email-provider-registry.d.ts +30 -0
  241. package/dist/lib/email-provider-registry.d.ts.map +1 -0
  242. package/dist/lib/email-providers-from-env.d.ts +12 -0
  243. package/dist/lib/email-providers-from-env.d.ts.map +1 -0
  244. package/dist/lib/email-service-types.d.ts +189 -0
  245. package/dist/lib/email-service-types.d.ts.map +1 -0
  246. package/dist/lib/email-stats.d.ts +12 -0
  247. package/dist/lib/email-stats.d.ts.map +1 -0
  248. package/dist/lib/email.d.ts +73 -0
  249. package/dist/lib/email.d.ts.map +1 -0
  250. package/dist/lib/enrichment-ledger.d.ts +101 -0
  251. package/dist/lib/enrichment-ledger.d.ts.map +1 -0
  252. package/dist/lib/enrichment-provider-registry.d.ts +20 -0
  253. package/dist/lib/enrichment-provider-registry.d.ts.map +1 -0
  254. package/dist/lib/enrichment-providers-from-env.d.ts +13 -0
  255. package/dist/lib/enrichment-providers-from-env.d.ts.map +1 -0
  256. package/dist/lib/enrichment-registry-singleton.d.ts +9 -0
  257. package/dist/lib/enrichment-registry-singleton.d.ts.map +1 -0
  258. package/dist/lib/enrollment-guards.d.ts +28 -0
  259. package/dist/lib/enrollment-guards.d.ts.map +1 -0
  260. package/dist/lib/enrollment-policy.d.ts +25 -0
  261. package/dist/lib/enrollment-policy.d.ts.map +1 -0
  262. package/dist/lib/event-names.d.ts +27 -0
  263. package/dist/lib/event-names.d.ts.map +1 -0
  264. package/dist/lib/feed.d.ts +64 -0
  265. package/dist/lib/feed.d.ts.map +1 -0
  266. package/dist/lib/flags-registry.d.ts +23 -0
  267. package/dist/lib/flags-registry.d.ts.map +1 -0
  268. package/dist/lib/flags.d.ts +143 -0
  269. package/dist/lib/flags.d.ts.map +1 -0
  270. package/dist/lib/frequency-cap.d.ts +38 -0
  271. package/dist/lib/frequency-cap.d.ts.map +1 -0
  272. package/dist/lib/from-address.d.ts +15 -0
  273. package/dist/lib/from-address.d.ts.map +1 -0
  274. package/dist/lib/funnel-progress.d.ts +37 -0
  275. package/dist/lib/funnel-progress.d.ts.map +1 -0
  276. package/dist/lib/funnel-registry.d.ts +44 -0
  277. package/dist/lib/funnel-registry.d.ts.map +1 -0
  278. package/dist/lib/funnel-transitions.d.ts +63 -0
  279. package/dist/lib/funnel-transitions.d.ts.map +1 -0
  280. package/dist/lib/fx.d.ts +118 -0
  281. package/dist/lib/fx.d.ts.map +1 -0
  282. package/dist/lib/global-control-readout.d.ts +72 -0
  283. package/dist/lib/global-control-readout.d.ts.map +1 -0
  284. package/dist/lib/groups.d.ts +138 -0
  285. package/dist/lib/groups.d.ts.map +1 -0
  286. package/dist/lib/hatchet-duration.d.ts +14 -0
  287. package/dist/lib/hatchet-duration.d.ts.map +1 -0
  288. package/dist/lib/hatchet.d.ts +3 -0
  289. package/dist/lib/hatchet.d.ts.map +1 -0
  290. package/dist/lib/headers.d.ts +8 -0
  291. package/dist/lib/headers.d.ts.map +1 -0
  292. package/dist/lib/holdout.d.ts +36 -0
  293. package/dist/lib/holdout.d.ts.map +1 -0
  294. package/dist/lib/html.d.ts +5 -0
  295. package/dist/lib/html.d.ts.map +1 -0
  296. package/dist/lib/identity-service.d.ts +60 -0
  297. package/dist/lib/identity-service.d.ts.map +1 -0
  298. package/dist/lib/identity-token.d.ts +81 -0
  299. package/dist/lib/identity-token.d.ts.map +1 -0
  300. package/dist/lib/ingestion.d.ts +218 -0
  301. package/dist/lib/ingestion.d.ts.map +1 -0
  302. package/dist/lib/journey-lift.d.ts +56 -0
  303. package/dist/lib/journey-lift.d.ts.map +1 -0
  304. package/dist/lib/journey-suppress.d.ts +59 -0
  305. package/dist/lib/journey-suppress.d.ts.map +1 -0
  306. package/dist/lib/leader-lease.d.ts +36 -0
  307. package/dist/lib/leader-lease.d.ts.map +1 -0
  308. package/dist/lib/lift-stats.d.ts +46 -0
  309. package/dist/lib/lift-stats.d.ts.map +1 -0
  310. package/dist/lib/links.d.ts +186 -0
  311. package/dist/lib/links.d.ts.map +1 -0
  312. package/dist/lib/load-optional-plugin.d.ts +47 -0
  313. package/dist/lib/load-optional-plugin.d.ts.map +1 -0
  314. package/dist/lib/logger.d.ts +4 -0
  315. package/dist/lib/logger.d.ts.map +1 -0
  316. package/dist/lib/mailer.d.ts +43 -0
  317. package/dist/lib/mailer.d.ts.map +1 -0
  318. package/dist/lib/metrics-sql.d.ts +11 -0
  319. package/dist/lib/metrics-sql.d.ts.map +1 -0
  320. package/dist/lib/notifications.d.ts +17 -0
  321. package/dist/lib/notifications.d.ts.map +1 -0
  322. package/dist/lib/oauth-token-manager.d.ts +74 -0
  323. package/dist/lib/oauth-token-manager.d.ts.map +1 -0
  324. package/dist/lib/operator-settings.d.ts +33 -0
  325. package/dist/lib/operator-settings.d.ts.map +1 -0
  326. package/dist/lib/operator.d.ts +20 -0
  327. package/dist/lib/operator.d.ts.map +1 -0
  328. package/dist/lib/outbound-endpoint-cache.d.ts +25 -0
  329. package/dist/lib/outbound-endpoint-cache.d.ts.map +1 -0
  330. package/dist/lib/outbound.d.ts +687 -0
  331. package/dist/lib/outbound.d.ts.map +1 -0
  332. package/dist/lib/phone.d.ts +11 -0
  333. package/dist/lib/phone.d.ts.map +1 -0
  334. package/dist/lib/posthog-scopes.d.ts +30 -0
  335. package/dist/lib/posthog-scopes.d.ts.map +1 -0
  336. package/dist/lib/posthog.d.ts +16 -0
  337. package/dist/lib/posthog.d.ts.map +1 -0
  338. package/dist/lib/preferences.d.ts +72 -0
  339. package/dist/lib/preferences.d.ts.map +1 -0
  340. package/dist/lib/provider-credentials.d.ts +149 -0
  341. package/dist/lib/provider-credentials.d.ts.map +1 -0
  342. package/dist/lib/provision-posthog-loop.d.ts +100 -0
  343. package/dist/lib/provision-posthog-loop.d.ts.map +1 -0
  344. package/dist/lib/recipient-preferences.d.ts +29 -0
  345. package/dist/lib/recipient-preferences.d.ts.map +1 -0
  346. package/dist/lib/redis.d.ts +33 -0
  347. package/dist/lib/redis.d.ts.map +1 -0
  348. package/dist/lib/referral-intent.d.ts +99 -0
  349. package/dist/lib/referral-intent.d.ts.map +1 -0
  350. package/dist/lib/referral-link.d.ts +59 -0
  351. package/dist/lib/referral-link.d.ts.map +1 -0
  352. package/dist/lib/referral-registry.d.ts +37 -0
  353. package/dist/lib/referral-registry.d.ts.map +1 -0
  354. package/dist/lib/referral-report.d.ts +178 -0
  355. package/dist/lib/referral-report.d.ts.map +1 -0
  356. package/dist/lib/referral-runtime.d.ts +43 -0
  357. package/dist/lib/referral-runtime.d.ts.map +1 -0
  358. package/dist/lib/referrals.d.ts +184 -0
  359. package/dist/lib/referrals.d.ts.map +1 -0
  360. package/dist/lib/refine-chain.d.ts +236 -0
  361. package/dist/lib/refine-chain.d.ts.map +1 -0
  362. package/dist/lib/refine-traits.d.ts +78 -0
  363. package/dist/lib/refine-traits.d.ts.map +1 -0
  364. package/dist/lib/refine.d.ts +35 -0
  365. package/dist/lib/refine.d.ts.map +1 -0
  366. package/dist/lib/reset-email.d.ts +38 -0
  367. package/dist/lib/reset-email.d.ts.map +1 -0
  368. package/dist/lib/revenue.d.ts +61 -0
  369. package/dist/lib/revenue.d.ts.map +1 -0
  370. package/dist/lib/schemas.d.ts +9 -0
  371. package/dist/lib/schemas.d.ts.map +1 -0
  372. package/dist/lib/seed-posthog-destination.d.ts +22 -0
  373. package/dist/lib/seed-posthog-destination.d.ts.map +1 -0
  374. package/dist/lib/semantic-click.d.ts +58 -0
  375. package/dist/lib/semantic-click.d.ts.map +1 -0
  376. package/dist/lib/sending-domain-guidance.d.ts +40 -0
  377. package/dist/lib/sending-domain-guidance.d.ts.map +1 -0
  378. package/dist/lib/singleton.d.ts +24 -0
  379. package/dist/lib/singleton.d.ts.map +1 -0
  380. package/dist/lib/sms-frequency-cap.d.ts +16 -0
  381. package/dist/lib/sms-frequency-cap.d.ts.map +1 -0
  382. package/dist/lib/sms-inbound.d.ts +37 -0
  383. package/dist/lib/sms-inbound.d.ts.map +1 -0
  384. package/dist/lib/sms-link-tracking.d.ts +53 -0
  385. package/dist/lib/sms-link-tracking.d.ts.map +1 -0
  386. package/dist/lib/sms-mailer.d.ts +12 -0
  387. package/dist/lib/sms-mailer.d.ts.map +1 -0
  388. package/dist/lib/sms-provider-registry.d.ts +20 -0
  389. package/dist/lib/sms-provider-registry.d.ts.map +1 -0
  390. package/dist/lib/sms-providers-from-env.d.ts +4 -0
  391. package/dist/lib/sms-providers-from-env.d.ts.map +1 -0
  392. package/dist/lib/sms-service-types.d.ts +131 -0
  393. package/dist/lib/sms-service-types.d.ts.map +1 -0
  394. package/dist/lib/sms-tracked.d.ts +36 -0
  395. package/dist/lib/sms-tracked.d.ts.map +1 -0
  396. package/dist/lib/sms.d.ts +58 -0
  397. package/dist/lib/sms.d.ts.map +1 -0
  398. package/dist/lib/snippet.d.ts +32 -0
  399. package/dist/lib/snippet.d.ts.map +1 -0
  400. package/dist/lib/stable-stringify.d.ts +12 -0
  401. package/dist/lib/stable-stringify.d.ts.map +1 -0
  402. package/dist/lib/studio.d.ts +21 -0
  403. package/dist/lib/studio.d.ts.map +1 -0
  404. package/dist/lib/survey.d.ts +35 -0
  405. package/dist/lib/survey.d.ts.map +1 -0
  406. package/dist/lib/test-mode.d.ts +77 -0
  407. package/dist/lib/test-mode.d.ts.map +1 -0
  408. package/dist/lib/timezone.d.ts +55 -0
  409. package/dist/lib/timezone.d.ts.map +1 -0
  410. package/dist/lib/tracked.d.ts +95 -0
  411. package/dist/lib/tracked.d.ts.map +1 -0
  412. package/dist/lib/tracking-event-names.d.ts +7 -0
  413. package/dist/lib/tracking-event-names.d.ts.map +1 -0
  414. package/dist/lib/tracking-events.d.ts +232 -0
  415. package/dist/lib/tracking-events.d.ts.map +1 -0
  416. package/dist/lib/tracking.d.ts +47 -0
  417. package/dist/lib/tracking.d.ts.map +1 -0
  418. package/dist/lib/unconfigured-email-provider.d.ts +20 -0
  419. package/dist/lib/unconfigured-email-provider.d.ts.map +1 -0
  420. package/dist/lib/unique-violation.d.ts +22 -0
  421. package/dist/lib/unique-violation.d.ts.map +1 -0
  422. package/dist/lib/user-token.d.ts +44 -0
  423. package/dist/lib/user-token.d.ts.map +1 -0
  424. package/dist/lib/variant.d.ts +44 -0
  425. package/dist/lib/variant.d.ts.map +1 -0
  426. package/dist/lib/webhook-signing.d.ts +120 -0
  427. package/dist/lib/webhook-signing.d.ts.map +1 -0
  428. package/dist/lib/worker-heartbeat.d.ts +18 -0
  429. package/dist/lib/worker-heartbeat.d.ts.map +1 -0
  430. package/dist/lists/channels.d.ts +43 -0
  431. package/dist/lists/channels.d.ts.map +1 -0
  432. package/dist/lists/define-list.d.ts +76 -0
  433. package/dist/lists/define-list.d.ts.map +1 -0
  434. package/dist/lists/registry-singleton.d.ts +8 -0
  435. package/dist/lists/registry-singleton.d.ts.map +1 -0
  436. package/dist/lists/registry.d.ts +66 -0
  437. package/dist/lists/registry.d.ts.map +1 -0
  438. package/dist/lists/subscription.d.ts +10 -0
  439. package/dist/lists/subscription.d.ts.map +1 -0
  440. package/dist/mcp/authoring-guide.d.ts +33 -0
  441. package/dist/mcp/authoring-guide.d.ts.map +1 -0
  442. package/dist/mcp/blueprint-tools.d.ts +266 -0
  443. package/dist/mcp/blueprint-tools.d.ts.map +1 -0
  444. package/dist/middleware/api-key.d.ts +45 -0
  445. package/dist/middleware/api-key.d.ts.map +1 -0
  446. package/dist/middleware/audit.d.ts +3 -0
  447. package/dist/middleware/audit.d.ts.map +1 -0
  448. package/dist/middleware/error-handler.d.ts +4 -0
  449. package/dist/middleware/error-handler.d.ts.map +1 -0
  450. package/dist/middleware/publishable-key.d.ts +27 -0
  451. package/dist/middleware/publishable-key.d.ts.map +1 -0
  452. package/dist/middleware/rate-limit.d.ts +105 -0
  453. package/dist/middleware/rate-limit.d.ts.map +1 -0
  454. package/dist/middleware/request-logger.d.ts +4 -0
  455. package/dist/middleware/request-logger.d.ts.map +1 -0
  456. package/dist/middleware/require-admin.d.ts +3 -0
  457. package/dist/middleware/require-admin.d.ts.map +1 -0
  458. package/dist/routes/_shared.d.ts +52 -0
  459. package/dist/routes/_shared.d.ts.map +1 -0
  460. package/dist/routes/accounts/callback.d.ts +18 -0
  461. package/dist/routes/accounts/callback.d.ts.map +1 -0
  462. package/dist/routes/accounts/emit.d.ts +96 -0
  463. package/dist/routes/accounts/emit.d.ts.map +1 -0
  464. package/dist/routes/accounts/import-links.d.ts +4 -0
  465. package/dist/routes/accounts/import-links.d.ts.map +1 -0
  466. package/dist/routes/accounts/index.d.ts +39 -0
  467. package/dist/routes/accounts/index.d.ts.map +1 -0
  468. package/dist/routes/accounts/lookup.d.ts +6 -0
  469. package/dist/routes/accounts/lookup.d.ts.map +1 -0
  470. package/dist/routes/accounts/me.d.ts +5 -0
  471. package/dist/routes/accounts/me.d.ts.map +1 -0
  472. package/dist/routes/accounts/mint.d.ts +5 -0
  473. package/dist/routes/accounts/mint.d.ts.map +1 -0
  474. package/dist/routes/accounts/pages.d.ts +23 -0
  475. package/dist/routes/accounts/pages.d.ts.map +1 -0
  476. package/dist/routes/accounts/resolve.d.ts +33 -0
  477. package/dist/routes/accounts/resolve.d.ts.map +1 -0
  478. package/dist/routes/accounts/serialize.d.ts +57 -0
  479. package/dist/routes/accounts/serialize.d.ts.map +1 -0
  480. package/dist/routes/accounts/shared.d.ts +68 -0
  481. package/dist/routes/accounts/shared.d.ts.map +1 -0
  482. package/dist/routes/accounts/start.d.ts +16 -0
  483. package/dist/routes/accounts/start.d.ts.map +1 -0
  484. package/dist/routes/accounts/unlink.d.ts +36 -0
  485. package/dist/routes/accounts/unlink.d.ts.map +1 -0
  486. package/dist/routes/admin/agent.d.ts +4 -0
  487. package/dist/routes/admin/agent.d.ts.map +1 -0
  488. package/dist/routes/admin/alerts.d.ts +190 -0
  489. package/dist/routes/admin/alerts.d.ts.map +1 -0
  490. package/dist/routes/admin/analytics.d.ts +137 -0
  491. package/dist/routes/admin/analytics.d.ts.map +1 -0
  492. package/dist/routes/admin/api-keys.d.ts +158 -0
  493. package/dist/routes/admin/api-keys.d.ts.map +1 -0
  494. package/dist/routes/admin/attribution.d.ts +93 -0
  495. package/dist/routes/admin/attribution.d.ts.map +1 -0
  496. package/dist/routes/admin/audit-logs.d.ts +40 -0
  497. package/dist/routes/admin/audit-logs.d.ts.map +1 -0
  498. package/dist/routes/admin/blueprints.d.ts +4 -0
  499. package/dist/routes/admin/blueprints.d.ts.map +1 -0
  500. package/dist/routes/admin/buckets.d.ts +215 -0
  501. package/dist/routes/admin/buckets.d.ts.map +1 -0
  502. package/dist/routes/admin/bulk.d.ts +203 -0
  503. package/dist/routes/admin/bulk.d.ts.map +1 -0
  504. package/dist/routes/admin/campaigns.d.ts +198 -0
  505. package/dist/routes/admin/campaigns.d.ts.map +1 -0
  506. package/dist/routes/admin/connectors.d.ts +116 -0
  507. package/dist/routes/admin/connectors.d.ts.map +1 -0
  508. package/dist/routes/admin/contacts.d.ts +246 -0
  509. package/dist/routes/admin/contacts.d.ts.map +1 -0
  510. package/dist/routes/admin/conversions.d.ts +103 -0
  511. package/dist/routes/admin/conversions.d.ts.map +1 -0
  512. package/dist/routes/admin/deals.d.ts +136 -0
  513. package/dist/routes/admin/deals.d.ts.map +1 -0
  514. package/dist/routes/admin/dlq.d.ts +100 -0
  515. package/dist/routes/admin/dlq.d.ts.map +1 -0
  516. package/dist/routes/admin/domain.d.ts +314 -0
  517. package/dist/routes/admin/domain.d.ts.map +1 -0
  518. package/dist/routes/admin/emails.d.ts +127 -0
  519. package/dist/routes/admin/emails.d.ts.map +1 -0
  520. package/dist/routes/admin/events.d.ts +140 -0
  521. package/dist/routes/admin/events.d.ts.map +1 -0
  522. package/dist/routes/admin/flags.d.ts +719 -0
  523. package/dist/routes/admin/flags.d.ts.map +1 -0
  524. package/dist/routes/admin/funnels.d.ts +71 -0
  525. package/dist/routes/admin/funnels.d.ts.map +1 -0
  526. package/dist/routes/admin/groups.d.ts +169 -0
  527. package/dist/routes/admin/groups.d.ts.map +1 -0
  528. package/dist/routes/admin/identity.d.ts +72 -0
  529. package/dist/routes/admin/identity.d.ts.map +1 -0
  530. package/dist/routes/admin/impact-schemas.d.ts +48 -0
  531. package/dist/routes/admin/impact-schemas.d.ts.map +1 -0
  532. package/dist/routes/admin/impact.d.ts +316 -0
  533. package/dist/routes/admin/impact.d.ts.map +1 -0
  534. package/dist/routes/admin/index.d.ts +4 -0
  535. package/dist/routes/admin/index.d.ts.map +1 -0
  536. package/dist/routes/admin/journey-impact.d.ts +320 -0
  537. package/dist/routes/admin/journey-impact.d.ts.map +1 -0
  538. package/dist/routes/admin/journey-logs.d.ts +57 -0
  539. package/dist/routes/admin/journey-logs.d.ts.map +1 -0
  540. package/dist/routes/admin/journeys.d.ts +736 -0
  541. package/dist/routes/admin/journeys.d.ts.map +1 -0
  542. package/dist/routes/admin/links.d.ts +382 -0
  543. package/dist/routes/admin/links.d.ts.map +1 -0
  544. package/dist/routes/admin/lists.d.ts +22 -0
  545. package/dist/routes/admin/lists.d.ts.map +1 -0
  546. package/dist/routes/admin/maintenance.d.ts +72 -0
  547. package/dist/routes/admin/maintenance.d.ts.map +1 -0
  548. package/dist/routes/admin/metrics.d.ts +212 -0
  549. package/dist/routes/admin/metrics.d.ts.map +1 -0
  550. package/dist/routes/admin/open-editor.d.ts +36 -0
  551. package/dist/routes/admin/open-editor.d.ts.map +1 -0
  552. package/dist/routes/admin/preferences.d.ts +109 -0
  553. package/dist/routes/admin/preferences.d.ts.map +1 -0
  554. package/dist/routes/admin/provider-credentials.d.ts +108 -0
  555. package/dist/routes/admin/provider-credentials.d.ts.map +1 -0
  556. package/dist/routes/admin/readiness.d.ts +24 -0
  557. package/dist/routes/admin/readiness.d.ts.map +1 -0
  558. package/dist/routes/admin/referrals.d.ts +230 -0
  559. package/dist/routes/admin/referrals.d.ts.map +1 -0
  560. package/dist/routes/admin/reporting.d.ts +149 -0
  561. package/dist/routes/admin/reporting.d.ts.map +1 -0
  562. package/dist/routes/admin/settings.d.ts +80 -0
  563. package/dist/routes/admin/settings.d.ts.map +1 -0
  564. package/dist/routes/admin/suppressions.d.ts +90 -0
  565. package/dist/routes/admin/suppressions.d.ts.map +1 -0
  566. package/dist/routes/admin/targeting.d.ts +58 -0
  567. package/dist/routes/admin/targeting.d.ts.map +1 -0
  568. package/dist/routes/admin/templates.d.ts +197 -0
  569. package/dist/routes/admin/templates.d.ts.map +1 -0
  570. package/dist/routes/admin/timeline.d.ts +51 -0
  571. package/dist/routes/admin/timeline.d.ts.map +1 -0
  572. package/dist/routes/admin/webhooks.d.ts +250 -0
  573. package/dist/routes/admin/webhooks.d.ts.map +1 -0
  574. package/dist/routes/campaigns/index.d.ts +239 -0
  575. package/dist/routes/campaigns/index.d.ts.map +1 -0
  576. package/dist/routes/connectors/index.d.ts +16 -0
  577. package/dist/routes/connectors/index.d.ts.map +1 -0
  578. package/dist/routes/contacts/index.d.ts +187 -0
  579. package/dist/routes/contacts/index.d.ts.map +1 -0
  580. package/dist/routes/email/index.d.ts +4 -0
  581. package/dist/routes/email/index.d.ts.map +1 -0
  582. package/dist/routes/email/preferences.d.ts +17 -0
  583. package/dist/routes/email/preferences.d.ts.map +1 -0
  584. package/dist/routes/email/unsubscribe.d.ts +17 -0
  585. package/dist/routes/email/unsubscribe.d.ts.map +1 -0
  586. package/dist/routes/emails/index.d.ts +90 -0
  587. package/dist/routes/emails/index.d.ts.map +1 -0
  588. package/dist/routes/events/index.d.ts +116 -0
  589. package/dist/routes/events/index.d.ts.map +1 -0
  590. package/dist/routes/feed/index.d.ts +248 -0
  591. package/dist/routes/feed/index.d.ts.map +1 -0
  592. package/dist/routes/feed/recipient.d.ts +65 -0
  593. package/dist/routes/feed/recipient.d.ts.map +1 -0
  594. package/dist/routes/flags/index.d.ts +94 -0
  595. package/dist/routes/flags/index.d.ts.map +1 -0
  596. package/dist/routes/groups/index.d.ts +192 -0
  597. package/dist/routes/groups/index.d.ts.map +1 -0
  598. package/dist/routes/health.d.ts +57 -0
  599. package/dist/routes/health.d.ts.map +1 -0
  600. package/dist/routes/index.d.ts +8 -0
  601. package/dist/routes/index.d.ts.map +1 -0
  602. package/dist/routes/lists/index.d.ts +266 -0
  603. package/dist/routes/lists/index.d.ts.map +1 -0
  604. package/dist/routes/referrals/index.d.ts +22 -0
  605. package/dist/routes/referrals/index.d.ts.map +1 -0
  606. package/dist/routes/referrals/me.d.ts +4 -0
  607. package/dist/routes/referrals/me.d.ts.map +1 -0
  608. package/dist/routes/referrals/report.d.ts +5 -0
  609. package/dist/routes/referrals/report.d.ts.map +1 -0
  610. package/dist/routes/referrals/shared.d.ts +16 -0
  611. package/dist/routes/referrals/shared.d.ts.map +1 -0
  612. package/dist/routes/referrals/touch.d.ts +5 -0
  613. package/dist/routes/referrals/touch.d.ts.map +1 -0
  614. package/dist/routes/snippet.d.ts +12 -0
  615. package/dist/routes/snippet.d.ts.map +1 -0
  616. package/dist/routes/tracking/answer.d.ts +56 -0
  617. package/dist/routes/tracking/answer.d.ts.map +1 -0
  618. package/dist/routes/tracking/arrive.d.ts +32 -0
  619. package/dist/routes/tracking/arrive.d.ts.map +1 -0
  620. package/dist/routes/tracking/click-pipeline.d.ts +213 -0
  621. package/dist/routes/tracking/click-pipeline.d.ts.map +1 -0
  622. package/dist/routes/tracking/click.d.ts +26 -0
  623. package/dist/routes/tracking/click.d.ts.map +1 -0
  624. package/dist/routes/tracking/identify.d.ts +32 -0
  625. package/dist/routes/tracking/identify.d.ts.map +1 -0
  626. package/dist/routes/tracking/index.d.ts +4 -0
  627. package/dist/routes/tracking/index.d.ts.map +1 -0
  628. package/dist/routes/tracking/open.d.ts +17 -0
  629. package/dist/routes/tracking/open.d.ts.map +1 -0
  630. package/dist/routes/tracking/short.d.ts +17 -0
  631. package/dist/routes/tracking/short.d.ts.map +1 -0
  632. package/dist/routes/tracking/vanity.d.ts +17 -0
  633. package/dist/routes/tracking/vanity.d.ts.map +1 -0
  634. package/dist/routes/webhooks/crm-provider.d.ts +24 -0
  635. package/dist/routes/webhooks/crm-provider.d.ts.map +1 -0
  636. package/dist/routes/webhooks/email-provider.d.ts +21 -0
  637. package/dist/routes/webhooks/email-provider.d.ts.map +1 -0
  638. package/dist/routes/webhooks/index.d.ts +8 -0
  639. package/dist/routes/webhooks/index.d.ts.map +1 -0
  640. package/dist/routes/webhooks/resend.d.ts +35 -0
  641. package/dist/routes/webhooks/resend.d.ts.map +1 -0
  642. package/dist/routes/webhooks/sms-provider.d.ts +23 -0
  643. package/dist/routes/webhooks/sms-provider.d.ts.map +1 -0
  644. package/dist/routes/webhooks/sources.d.ts +12 -0
  645. package/dist/routes/webhooks/sources.d.ts.map +1 -0
  646. package/dist/sources/define-contact-source.d.ts +114 -0
  647. package/dist/sources/define-contact-source.d.ts.map +1 -0
  648. package/dist/sources/registry.d.ts +31 -0
  649. package/dist/sources/registry.d.ts.map +1 -0
  650. package/dist/sources/webhook-source.d.ts +53 -0
  651. package/dist/sources/webhook-source.d.ts.map +1 -0
  652. package/dist/testing.d.ts +10 -0
  653. package/dist/testing.d.ts.map +1 -0
  654. package/dist/webhook-sources/define-webhook-source.d.ts +60 -0
  655. package/dist/webhook-sources/define-webhook-source.d.ts.map +1 -0
  656. package/dist/webhook-sources/presets/clerk.d.ts +9 -0
  657. package/dist/webhook-sources/presets/clerk.d.ts.map +1 -0
  658. package/dist/webhook-sources/presets/index.d.ts +140 -0
  659. package/dist/webhook-sources/presets/index.d.ts.map +1 -0
  660. package/dist/webhook-sources/presets/intercom.d.ts +44 -0
  661. package/dist/webhook-sources/presets/intercom.d.ts.map +1 -0
  662. package/dist/webhook-sources/presets/segment.d.ts +16 -0
  663. package/dist/webhook-sources/presets/segment.d.ts.map +1 -0
  664. package/dist/webhook-sources/presets/stripe.d.ts +20 -0
  665. package/dist/webhook-sources/presets/stripe.d.ts.map +1 -0
  666. package/dist/webhook-sources/presets/supabase.d.ts +23 -0
  667. package/dist/webhook-sources/presets/supabase.d.ts.map +1 -0
  668. package/dist/webhook-sources/verify.d.ts +48 -0
  669. package/dist/webhook-sources/verify.d.ts.map +1 -0
  670. package/dist/worker.d.ts +37 -0
  671. package/dist/worker.d.ts.map +1 -0
  672. package/dist/workflows/backfill-contact-id.d.ts +202 -0
  673. package/dist/workflows/backfill-contact-id.d.ts.map +1 -0
  674. package/dist/workflows/bucket-backfill.d.ts +64 -0
  675. package/dist/workflows/bucket-backfill.d.ts.map +1 -0
  676. package/dist/workflows/bucket-reconcile.d.ts +73 -0
  677. package/dist/workflows/bucket-reconcile.d.ts.map +1 -0
  678. package/dist/workflows/check-alerts.d.ts +10 -0
  679. package/dist/workflows/check-alerts.d.ts.map +1 -0
  680. package/dist/workflows/confirm-semantic-click.d.ts +15 -0
  681. package/dist/workflows/confirm-semantic-click.d.ts.map +1 -0
  682. package/dist/workflows/crm-reconcile.d.ts +27 -0
  683. package/dist/workflows/crm-reconcile.d.ts.map +1 -0
  684. package/dist/workflows/deliver-webhook.d.ts +88 -0
  685. package/dist/workflows/deliver-webhook.d.ts.map +1 -0
  686. package/dist/workflows/dispatch-conversion.d.ts +14 -0
  687. package/dist/workflows/dispatch-conversion.d.ts.map +1 -0
  688. package/dist/workflows/identity-alias-backfill.d.ts +96 -0
  689. package/dist/workflows/identity-alias-backfill.d.ts.map +1 -0
  690. package/dist/workflows/impact-digest.d.ts +142 -0
  691. package/dist/workflows/impact-digest.d.ts.map +1 -0
  692. package/dist/workflows/import-contacts.d.ts +14 -0
  693. package/dist/workflows/import-contacts.d.ts.map +1 -0
  694. package/dist/workflows/import-suppressions.d.ts +55 -0
  695. package/dist/workflows/import-suppressions.d.ts.map +1 -0
  696. package/dist/workflows/journey-blueprint-interpreter.d.ts +73 -0
  697. package/dist/workflows/journey-blueprint-interpreter.d.ts.map +1 -0
  698. package/dist/workflows/send-campaign.d.ts +128 -0
  699. package/dist/workflows/send-campaign.d.ts.map +1 -0
  700. package/dist/workflows/send-email.d.ts +15 -0
  701. package/dist/workflows/send-email.d.ts.map +1 -0
  702. package/dist/workflows/send-feed.d.ts +37 -0
  703. package/dist/workflows/send-feed.d.ts.map +1 -0
  704. package/package.json +60 -22
  705. package/src/app.ts +9 -1
  706. package/src/buckets/check-membership.ts +54 -20
  707. package/src/container.ts +77 -0
  708. package/src/env.ts +30 -0
  709. package/src/index.ts +78 -0
  710. package/src/journeys/journey-log.ts +25 -8
  711. package/src/lib/contacts.ts +117 -1
  712. package/src/lib/email-service-types.ts +10 -0
  713. package/src/lib/ingestion.ts +91 -19
  714. package/src/lib/links.ts +94 -11
  715. package/src/lib/mailer-bounce-idempotency.test.ts +7 -2
  716. package/src/lib/mailer-replied.test.ts +7 -2
  717. package/src/lib/mailer.ts +1 -0
  718. package/src/lib/outbound-endpoint-cache.ts +83 -0
  719. package/src/lib/outbound.ts +150 -37
  720. package/src/lib/referral-intent.ts +723 -0
  721. package/src/lib/referral-link.ts +200 -0
  722. package/src/lib/referral-registry.ts +83 -0
  723. package/src/lib/referral-report.ts +739 -0
  724. package/src/lib/referral-runtime.ts +49 -0
  725. package/src/lib/referrals-no-emit.test.ts +109 -0
  726. package/src/lib/referrals.ts +712 -0
  727. package/src/lib/seed-posthog-destination.ts +5 -1
  728. package/src/lib/tracked.ts +11 -3
  729. package/src/lib/tracking-events.ts +20 -3
  730. package/src/lib/webhook-signing.ts +10 -0
  731. package/src/middleware/api-key.ts +69 -60
  732. package/src/middleware/publishable-key.ts +11 -23
  733. package/src/middleware/rate-limit.ts +165 -3
  734. package/src/routes/admin/api-keys.ts +153 -0
  735. package/src/routes/admin/index.ts +2 -0
  736. package/src/routes/admin/links.ts +14 -5
  737. package/src/routes/admin/referrals.ts +565 -0
  738. package/src/routes/admin/targeting.ts +6 -1
  739. package/src/routes/admin/webhooks.ts +4 -0
  740. package/src/routes/contacts/index.ts +78 -0
  741. package/src/routes/index.ts +104 -22
  742. package/src/routes/referrals/index.ts +41 -0
  743. package/src/routes/referrals/me.ts +123 -0
  744. package/src/routes/referrals/report.ts +285 -0
  745. package/src/routes/referrals/shared.ts +34 -0
  746. package/src/routes/referrals/touch.ts +313 -0
  747. package/src/routes/tracking/arrive.ts +90 -0
  748. package/src/routes/tracking/click-pipeline.ts +8 -0
  749. package/src/workflows/backfill-contact-id.ts +3 -7
  750. package/src/workflows/bucket-backfill.ts +2 -2
  751. package/src/workflows/bucket-reconcile.ts +28 -12
  752. package/src/workflows/check-alerts.ts +3 -9
  753. package/src/workflows/crm-reconcile.ts +3 -2
  754. package/src/workflows/deliver-webhook.ts +21 -8
  755. package/src/workflows/dispatch-conversion.ts +2 -2
  756. package/src/workflows/identity-alias-backfill.ts +3 -2
  757. package/src/workflows/impact-digest.ts +2 -2
  758. package/src/workflows/import-contacts.ts +3 -4
  759. package/src/workflows/import-suppressions.ts +4 -5
  760. package/src/workflows/send-campaign.ts +10 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journey-source-locations-singleton.d.ts","sourceRoot":"","sources":["../../src/journeys/journey-source-locations-singleton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAe3D,eAAO,MAAM,yBAAyB,qDAAgB,CAAC;AACvD,eAAO,MAAM,yBAAyB,0CAAgB,CAAC;AACvD,mDAAmD;AACnD,eAAO,MAAM,2BAA2B,YAAkB,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const setJourneySources: (value: Map<string, string>) => void;
2
+ export declare const getJourneySources: () => Map<string, string>;
3
+ /** Reset the singleton — only for test cleanup. */
4
+ export declare const resetJourneySources: () => void;
5
+ //# sourceMappingURL=journey-sources-singleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journey-sources-singleton.d.ts","sourceRoot":"","sources":["../../src/journeys/journey-sources-singleton.ts"],"names":[],"mappings":"AAUA,eAAO,MAAM,iBAAiB,sCAAgB,CAAC;AAC/C,eAAO,MAAM,iBAAiB,2BAAgB,CAAC;AAC/C,mDAAmD;AACnD,eAAO,MAAM,mBAAmB,YAAkB,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { HatchetClient } from "@hatchet-dev/typescript-sdk/v1/index.js";
2
+ import type { JourneyMeta, JourneyRunFn } from "@hogsend/core/types";
3
+ /** The durable Hatchet declaration attached to a production journey. */
4
+ export type JourneyTask = ReturnType<HatchetClient["durableTask"]>;
5
+ type JourneyTaskFactory = (meta: JourneyMeta, run: JourneyRunFn) => JourneyTask;
6
+ /** Install the production Hatchet binding without coupling authoring imports to env. */
7
+ export declare function installJourneyTaskFactory(factory: JourneyTaskFactory): void;
8
+ export declare function hasJourneyTaskFactory(): boolean;
9
+ export declare function createJourneyTask(meta: JourneyMeta, run: JourneyRunFn): JourneyTask;
10
+ export {};
11
+ //# sourceMappingURL=journey-task-factory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journey-task-factory.d.ts","sourceRoot":"","sources":["../../src/journeys/journey-task-factory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAErE,wEAAwE;AACxE,MAAM,MAAM,WAAW,GAAG,UAAU,CAAC,aAAa,CAAC,aAAa,CAAC,CAAC,CAAC;AAEnE,KAAK,kBAAkB,GAAG,CAAC,IAAI,EAAE,WAAW,EAAE,GAAG,EAAE,YAAY,KAAK,WAAW,CAAC;AAIhF,wFAAwF;AACxF,wBAAgB,yBAAyB,CAAC,OAAO,EAAE,kBAAkB,GAAG,IAAI,CAE3E;AAED,wBAAgB,qBAAqB,IAAI,OAAO,CAE/C;AAED,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,WAAW,EACjB,GAAG,EAAE,YAAY,GAChB,WAAW,CAQb"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=journey-task-runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journey-task-runtime.d.ts","sourceRoot":"","sources":["../../src/journeys/journey-task-runtime.ts"],"names":[],"mappings":""}
@@ -0,0 +1,71 @@
1
+ import type { JourneyMeta } from "@hogsend/core/types";
2
+ /**
3
+ * Deterministic, dependency-free normalization of a Function.prototype
4
+ * .toString() capture, so formatting- and comment-only edits do not fork a
5
+ * version cohort:
6
+ * 1. strip // line and block comments with a string-aware single-pass
7
+ * scanner (states: code | single | double | template | lineComment |
8
+ * blockComment; a \ inside any string state consumes the next char;
9
+ * each stripped comment is replaced by one space),
10
+ * 2. collapse every whitespace run to a single space, trim.
11
+ * KNOWN LIMITS (documented, deterministic): (a) a // inside a regex literal
12
+ * is misread as a comment start and mangles the rest of that line; (b) the
13
+ * scanner exits `template` state at the first backtick, so a nested
14
+ * template or a string/comment inside ${...} is misclassified. In both
15
+ * cases the output is still a pure function of the input, so the hash
16
+ * stays stable — the only cost is fork-detection fidelity on those lines.
17
+ * Never throws; empty input → "".
18
+ */
19
+ export declare function normalizeRunSource(source: string): string;
20
+ /**
21
+ * Content fingerprint of one journey version: sha256, first 12 hex chars
22
+ * (48 bits — per-journey version counts are tiny; collision negligible).
23
+ * Input = HASH_INPUT_VERSION + "\n" + normalizeRunSource(body ?? "") +
24
+ * "\n" + stableStringify(hashable meta).
25
+ *
26
+ * Hashable meta = the meta MINUS `enabled` (toggling — including the
27
+ * journey_configs admin override — is not a content change), `version`
28
+ * (display label), `versionHash` (self), `name`, `description` (display
29
+ * only — display fields don't fork cohorts; this exclusion list is FROZEN
30
+ * at first release, since changing it later reforks every journey once).
31
+ * Everything else is included BY DEFAULT via rest-destructuring — id,
32
+ * trigger, entryLimit, entryPeriod, exitOn, category, suppress, holdout,
33
+ * goal, sourceBucketId, reactionKind, dwellSchedule, and any FUTURE meta
34
+ * field — because missing a real behavior change is worse than a spurious
35
+ * fork.
36
+ *
37
+ * For blueprints, `body` is stableStringify(row.graph), which ALSO passes
38
+ * through normalizeRunSource. Safe: stableStringify emits no whitespace or
39
+ * comments outside JSON strings, and // inside double-quoted string values
40
+ * (URLs in graph node config) is protected by the string-aware scanner,
41
+ * including \" escapes.
42
+ *
43
+ * ACCEPTED HASH CHURN ACROSS BUILD MODES: runSource is captured from the
44
+ * RUNNING artifact (define-journey.ts) — tsx dev output differs from the
45
+ * consumer tsup bundle, and esbuild identifier aliasing / toolchain-bump
46
+ * emit drift can fork a prod cohort once with zero content change.
47
+ * Accepted: forks are append-only cohort noise; labels give continuity.
48
+ * All readout/digest consumers MUST treat a new hash as "possible new
49
+ * version", never proof of change.
50
+ *
51
+ * TEMPLATE EDITS ARE NOT IN THE HASH: email template components (the
52
+ * consumer's src/emails/*.tsx) are referenced by registry KEY, and that
53
+ * key is all the run source carries — rewriting template copy forks NO
54
+ * cohort. Documented operator practice: bump `meta.version` (the display
55
+ * label) when you rework a template; the impact digest reports a label
56
+ * change as a first-class shipped signal (change: "new_label"). The real
57
+ * fix — folding a rendered-template-registry hash into the body input —
58
+ * is an explicit out-of-scope follow-up.
59
+ *
60
+ * Determinism: `where` builder fns are resolved ONCE into POJOs by
61
+ * normalizeWhere at defineJourney time, so the hashed meta is canonical
62
+ * data, never a function; stableStringify sorts keys and drops undefined,
63
+ * so key order and optional-field spreading cannot churn the hash. NO RNG,
64
+ * NO clock (the replay law).
65
+ */
66
+ export declare function computeJourneyVersionHash(opts: {
67
+ meta: JourneyMeta;
68
+ /** runSource for code journeys; stableStringify(graph) for blueprints. */
69
+ body?: string;
70
+ }): string;
71
+ //# sourceMappingURL=journey-version.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"journey-version.d.ts","sourceRoot":"","sources":["../../src/journeys/journey-version.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAmBvD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAsDzD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,IAAI,EAAE,WAAW,CAAC;IAClB,0EAA0E;IAC1E,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,GAAG,MAAM,CAcT"}
@@ -0,0 +1,56 @@
1
+ import { type Database } from "@hogsend/db";
2
+ /** The reserved `journey_states.context` sub-bags a record-once value can live
3
+ * under. A closed union — the ONLY values reachable at the SQL path, so the
4
+ * token can be interpolated into the jsonb path (see {@link recordOnce}) while
5
+ * `key`/value stay bound parameters. */
6
+ export type RecordNamespace = "__once__" | "__digest__" | "__throttle__" | "__variants__" | "__groupKeys__" | "__waits__";
7
+ /**
8
+ * Durable set-once for a single `(stateId, namespace, key)` — the replay-safety
9
+ * primitive shared by `ctx.once`, `ctx.digest`, `ctx.throttle`, and the
10
+ * journey-suppress guard. Guarantees:
11
+ *
12
+ * - **Set-once**: the first committed write for a `(stateId, namespace, key)`
13
+ * wins; `compute` runs at most once per winning writer and never again once a
14
+ * value is recorded (a replay-from-top re-reads the stored value).
15
+ * - **First-writer-wins under a concurrent race**: a zombie double-writer (a
16
+ * partitioned worker's original execution racing its replay) CANNOT clobber a
17
+ * value the winner already returned to author code. The persist uses a
18
+ * FIRST-writer-wins jsonb merge and returns the value from the UPDATE's
19
+ * RETURNING (the post-merge committed row), so both racers observe the SAME
20
+ * (first-committed) value even if the loser computed something different.
21
+ *
22
+ * Values MUST be JSON-serializable (stored in a jsonb column, round-tripped
23
+ * through `JSON.stringify`/Postgres jsonb).
24
+ */
25
+ export declare function recordOnce<T>(opts: {
26
+ db: Database;
27
+ stateId: string;
28
+ namespace: RecordNamespace;
29
+ key: string;
30
+ compute: () => Promise<T> | T;
31
+ }): Promise<T>;
32
+ /**
33
+ * Read an already-recorded `(stateId, namespace, key)` value WITHOUT computing
34
+ * or writing — `undefined` when nothing is recorded. The read-only companion
35
+ * to {@link recordOnce} for call sites whose compute would issue durable work
36
+ * (recordOnce's `compute` must never add journal nodes).
37
+ */
38
+ export declare function readRecordedValue(opts: {
39
+ db: Database;
40
+ stateId: string;
41
+ namespace: RecordNamespace;
42
+ key: string;
43
+ }): Promise<unknown>;
44
+ /**
45
+ * Drop ALL reserved record-once namespace keys from an event-properties bag.
46
+ * Enrollment seeds `journey_states.context` from trigger-event properties
47
+ * (execute-journey-run.ts — BOTH the fresh-entry and held_out inserts);
48
+ * without this strip a publishable-key browser event carrying e.g.
49
+ * `__variants__` could pre-fill a reserved bag — choosing its own ctx.variant
50
+ * arm AND injecting arbitrary strings into the impact readout's GROUP BY
51
+ * dimension. One filter protects every bag at once. Engine-supplied
52
+ * `extraContext` (e.g. `__blueprintVersion`) is deliberately NOT passed
53
+ * through this filter.
54
+ */
55
+ export declare function stripRecordNamespaces<T>(properties: Record<string, T>): Record<string, T>;
56
+ //# sourceMappingURL=record-once.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-once.d.ts","sourceRoot":"","sources":["../../src/journeys/record-once.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,QAAQ,EAAiB,MAAM,aAAa,CAAC;AAG3D;;;wCAGwC;AACxC,MAAM,MAAM,eAAe,GACvB,UAAU,GACV,YAAY,GACZ,cAAc,GACd,cAAc,GACd,eAAe,GACf,WAAW,CAAC;AAwBhB;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAAE,IAAI,EAAE;IACxC,EAAE,EAAE,QAAQ,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,eAAe,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;CAC/B,GAAG,OAAO,CAAC,CAAC,CAAC,CAyDb;AAED;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAC,IAAI,EAAE;IAC5C,EAAE,EAAE,QAAQ,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,eAAe,CAAC;IAC3B,GAAG,EAAE,MAAM,CAAC;CACb,GAAG,OAAO,CAAC,OAAO,CAAC,CAQnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,qBAAqB,CAAC,CAAC,EACrC,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,GAC5B,MAAM,CAAC,MAAM,EAAE,CAAC,CAAC,CAMnB"}
@@ -0,0 +1,6 @@
1
+ import type { JourneyRegistry } from "@hogsend/core/registry";
2
+ export declare const setJourneyRegistry: (value: JourneyRegistry) => void;
3
+ export declare const getJourneyRegistrySingleton: () => JourneyRegistry;
4
+ /** Reset the singleton — only for test cleanup. */
5
+ export declare const resetJourneyRegistry: () => void;
6
+ //# sourceMappingURL=registry-singleton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry-singleton.d.ts","sourceRoot":"","sources":["../../src/journeys/registry-singleton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAK9D,eAAO,MAAM,kBAAkB,kCAAgB,CAAC;AAChD,eAAO,MAAM,2BAA2B,uBAAgB,CAAC;AACzD,mDAAmD;AACnD,eAAO,MAAM,oBAAoB,YAAkB,CAAC"}
@@ -0,0 +1,59 @@
1
+ import { JourneyRegistry } from "@hogsend/core/registry";
2
+ import type { DefinedJourney } from "./define-journey.js";
3
+ /**
4
+ * Parse the `ENABLED_JOURNEYS` filter. Returns `"*"` to enable all journeys, or
5
+ * a `Set` of journey ids to enable. Only an empty/undefined value or a literal
6
+ * `"*"` (after trim) means all; a whitespace-only value (e.g. `" "`) falls
7
+ * through to an empty `Set` (enables nothing).
8
+ */
9
+ export declare function parseEnabledFilter(filter?: string): "*" | Set<string>;
10
+ /**
11
+ * Resolve AND validate the `ENABLED_JOURNEYS` filter against the closed set of
12
+ * known journey ids. `ENABLED_JOURNEYS` is operator config over a fully-known
13
+ * universe (`journeys.map(j => j.meta.id)` plus `extraKnownIds`), so a filter id
14
+ * that matches no journey is a typo or a stale reference to a renamed/removed
15
+ * journey — silently dropping it means the intended journey never registers and
16
+ * never fires in prod. Fail loud instead (the analog of the EMAIL_PROVIDER /
17
+ * ANALYTICS_PROVIDER boot throws):
18
+ *
19
+ * - `"*"` / empty → `"*"` (enable all); no validation, no throw.
20
+ * - **Empty top-level `journeys[]`** → no validation, no throw. `ENABLED_JOURNEYS`
21
+ * restricts the top-level journeys; a bucket-only client injects none here
22
+ * (its bucket-reaction journeys are registered separately, gated by
23
+ * `ENABLED_BUCKETS`), so there is nothing this filter can validate.
24
+ * - Otherwise validate every filter id against ALL known ids — the top-level
25
+ * journey ids (INCLUDING `meta.enabled: false` ones, since a disabled journey
26
+ * is a known id, not a typo) PLUS `extraKnownIds` (the bucket-reaction journey
27
+ * ids `bucket-<id>-on-<kind>`, which ARE registered journeys even though they
28
+ * bypass this filter). Unknown ids throw a single error naming each one (with a
29
+ * `(did you mean "…"?)` when a close known id exists) plus the known-id list.
30
+ * - An empty `Set` (e.g. filter `","`) has nothing to validate → no throw
31
+ * (enables nothing; pre-existing behavior).
32
+ *
33
+ * @param extraKnownIds additional valid ids not present in `journeys[]` (e.g.
34
+ * bucket-reaction journey ids) — accepted in the filter without a throw.
35
+ *
36
+ * Pure/synchronous; both boot paths ({@link buildJourneyRegistry} at container
37
+ * boot, {@link selectJourneyTasks} at worker boot) route through it.
38
+ */
39
+ export declare function resolveEnabledFilter(journeys: DefinedJourney[], enabledFilter?: string, extraKnownIds?: string[]): "*" | Set<string>;
40
+ /**
41
+ * Build a {@link JourneyRegistry} from an injected array of journeys, applying
42
+ * the enabled filter, and install it as the process singleton (so durable tasks
43
+ * can resolve it). Returns the registry. Throws (via
44
+ * {@link resolveEnabledFilter}) when the filter references an unknown journey.
45
+ *
46
+ * @param extraKnownIds additional valid ids (e.g. bucket-reaction journey ids)
47
+ * accepted in the filter without a throw — see {@link resolveEnabledFilter}.
48
+ */
49
+ export declare function buildJourneyRegistry(journeys: DefinedJourney[], enabledFilter?: string, extraKnownIds?: string[]): JourneyRegistry;
50
+ /**
51
+ * Select the Hatchet durable tasks for the enabled journeys from an injected
52
+ * array of journeys. Throws (via {@link resolveEnabledFilter}) when the filter
53
+ * references an unknown journey.
54
+ *
55
+ * @param extraKnownIds additional valid ids (e.g. bucket-reaction journey ids)
56
+ * accepted in the filter without a throw — see {@link resolveEnabledFilter}.
57
+ */
58
+ export declare function selectJourneyTasks(journeys: DefinedJourney[], enabledFilter?: string, extraKnownIds?: string[]): import("@hatchet-dev/typescript-sdk/index.js").TaskWorkflowDeclaration<import("@hatchet-dev/typescript-sdk/index.js").JsonObject, import("@hatchet-dev/typescript-sdk/index.js").OutputType, {}, {}, {}, {}>[];
59
+ //# sourceMappingURL=registry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/journeys/registry.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK1D;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CAQrE;AAkDD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,cAAc,EAAE,EAC1B,aAAa,CAAC,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,MAAM,EAAE,GACvB,GAAG,GAAG,GAAG,CAAC,MAAM,CAAC,CA6BnB;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,cAAc,EAAE,EAC1B,aAAa,CAAC,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,MAAM,EAAE,GACvB,eAAe,CA4BjB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAChC,QAAQ,EAAE,cAAc,EAAE,EAC1B,aAAa,CAAC,EAAE,MAAM,EACtB,aAAa,CAAC,EAAE,MAAM,EAAE,kNAMzB"}
@@ -0,0 +1,97 @@
1
+ import { type JourneyKeyKind } from "./journey-boundary.js";
2
+ /**
3
+ * The brand is a module-private `unique symbol`: no other module can name it,
4
+ * so no other module can construct a {@link CallerRef} structurally. The ONLY
5
+ * two ways to produce one are {@link callerRefFromArgs} and a deliberate
6
+ * `as CallerRef` cast — the first is the sanctioned chokepoint, the second is
7
+ * greppable and indefensible in review. That is the point: provenance ("this
8
+ * string came from the caller's own arguments, not from an awaited DB read")
9
+ * is not something TypeScript can track through data flow, so the design
10
+ * substitutes a single, named, reviewable construction site for it.
11
+ */
12
+ declare const CALLER_REF: unique symbol;
13
+ /**
14
+ * A string proven — by construction — to be derived from the CALLER'S OWN
15
+ * ARGUMENTS, and therefore legal as a durable-memo key discriminant.
16
+ *
17
+ * THE LAW (`lib/feed.ts:152-165`): the Hatchet journal is positional, and
18
+ * `boundary.memoize` is a durable call, so its KEY must never contain the
19
+ * result of a live DB read. Hatchet re-derives task input from the recorded
20
+ * payload, so an ARGUMENT is identical on a run and its replay — a resolved
21
+ * row value is not (defects 2 and 3 of this class both keyed a memo off a
22
+ * value the database could change mid-sleep).
23
+ *
24
+ * A bare `string` — including every string that arrives via `await` — fails to
25
+ * type-check where a `CallerRef` is required. Route it through
26
+ * {@link callerRefFromArgs} ONLY when the value is an authored argument.
27
+ */
28
+ export type CallerRef = string & {
29
+ readonly [CALLER_REF]: true;
30
+ };
31
+ /**
32
+ * Brand a value from the caller's own arguments as a {@link CallerRef}.
33
+ *
34
+ * CONTRACT (the compiler cannot check this half — the call site carries it):
35
+ * `value` must be derived exclusively from the caller's authored arguments.
36
+ * Never pass a value produced by an awaited read (a `contacts` row, a ledger
37
+ * row, a provider response) — that is precisely the bug class this type
38
+ * exists to make unwritable.
39
+ *
40
+ * Trims, and returns `undefined` for an empty/whitespace value so callers can
41
+ * fall through their argument-precedence chain with `??`/`if`.
42
+ */
43
+ export declare function callerRefFromArgs(value: string | undefined): CallerRef | undefined;
44
+ export interface WithDurableGateOptions {
45
+ /** The side-effect namespace — keeps e.g. a refine and a send from ever
46
+ * colliding under one wait label. */
47
+ kind: JourneyKeyKind;
48
+ /**
49
+ * The memo-key discriminant, derived ONLY from the caller's own arguments —
50
+ * the branded type makes a raw (possibly DB-read) string a type error at the
51
+ * call site. See {@link CallerRef}.
52
+ */
53
+ callerRef: CallerRef;
54
+ /**
55
+ * Disambiguates the key when two sites of the same `kind` in one journey
56
+ * share a nearest wait label. Mirrors `sendEmail`/`sendSms`/`refineContact`.
57
+ */
58
+ idempotencyLabel?: string;
59
+ }
60
+ /**
61
+ * Run `gates` under the positional-journal law, so the law is structural
62
+ * rather than prose.
63
+ *
64
+ * Four bugs of one class shipped in one release, by three different authors,
65
+ * every one green on every gate: an early return placed before the memoize, a
66
+ * memo key derived from a value the function itself writes, a live read
67
+ * feeding both the decision to memoize and the key, and a skip path that
68
+ * issued zero durable calls. Each author re-derived this shape by hand and
69
+ * got one line of it wrong. This primitive owns the shape, so the ordering is
70
+ * no longer the author's to write.
71
+ *
72
+ * What it does, in this order and UNCONDITIONALLY:
73
+ *
74
+ * 1. Resolve the journey boundary. With NO boundary (a webhook, a cron, a
75
+ * test) there is no replay to defend against and no anchor to key from —
76
+ * `gates()` runs directly, zero durable calls, and Layer 2 (the callee's
77
+ * unique-index dedup) carries exactly-once on its own.
78
+ * 2. With a boundary: derive the key from `kind` + the replay-stable
79
+ * `runAnchor` + the site (`idempotencyLabel ?? nearest wait label ??
80
+ * callerRef`) + the branded `callerRef` — arguments only, never a
81
+ * resolved value.
82
+ * 3. `registerKey` — an intra-run collision (two sites, one key) throws
83
+ * loudly at dev time instead of silently over-deduping.
84
+ * 4. Issue `boundary.memoize([key], …)` — EXACTLY ONCE, with nothing between
85
+ * the boundary check and this call that reads a database or branches on
86
+ * one. Every stateful read and every verdict — including every skip —
87
+ * lives INSIDE `gates`, so it is recorded by the durable memo and
88
+ * replayed verbatim.
89
+ *
90
+ * `gates` receives the derived key (undefined outside a boundary) to thread
91
+ * into its Layer-2 writes as the idempotency key. A throw from `gates`
92
+ * propagates unswallowed; the memo layer records no value for a rejected
93
+ * closure, so a replay re-enters it.
94
+ */
95
+ export declare function withDurableGate<T>(opts: WithDurableGateOptions, gates: (idempotencyKey?: string) => Promise<T>): Promise<T>;
96
+ export {};
97
+ //# sourceMappingURL=with-durable-gate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"with-durable-gate.d.ts","sourceRoot":"","sources":["../../src/journeys/with-durable-gate.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EAEpB,MAAM,uBAAuB,CAAC;AAM/B;;;;;;;;;GASG;AACH,OAAO,CAAC,MAAM,UAAU,EAAE,OAAO,MAAM,CAAC;AAExC;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,UAAU,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAEjE;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,MAAM,GAAG,SAAS,GACxB,SAAS,GAAG,SAAS,CAGvB;AAMD,MAAM,WAAW,sBAAsB;IACrC;yCACqC;IACrC,IAAI,EAAE,cAAc,CAAC;IACrB;;;;OAIG;IACH,SAAS,EAAE,SAAS,CAAC;IACrB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,eAAe,CAAC,CAAC,EACrC,IAAI,EAAE,sBAAsB,EAC5B,KAAK,EAAE,CAAC,cAAc,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,GAC7C,OAAO,CAAC,CAAC,CAAC,CAsBZ"}
@@ -0,0 +1,69 @@
1
+ import type { HatchetClient } from "@hatchet-dev/typescript-sdk/v1/index.js";
2
+ import type { Database } from "@hogsend/db";
3
+ import { type AccountUnlinkedFacts } from "./account-link-events.js";
4
+ import { type Logger } from "./logger.js";
5
+ /**
6
+ * The container's handles, when the caller has a container.
7
+ *
8
+ * `logger` attributes the emit to the caller's request. `hatchet` buys exactly
9
+ * one thing — it spares this module the `./hatchet.js` dynamic import below,
10
+ * which is what runs `HatchetClient.init` — plus satisfying `emitOutbound`'s
11
+ * signature. It does NOT redirect delivery, and claiming otherwise would be
12
+ * false: `emitOutbound` destructures
13
+ * `const { db, logger, event, payload, dedupeKey } = opts`
14
+ * (`outbound.ts:619`) and never reads `opts.hatchet`, and the enqueue runs
15
+ * through the MODULE-LEVEL `deliverWebhookTask` built from the singleton at
16
+ * import time, so `opts.overrides.hatchet` cannot reroute it. Both fields are
17
+ * optional so the container-free `lib/contacts.ts` call sites stay a two-arg
18
+ * call.
19
+ */
20
+ export type EmitHandles = {
21
+ hatchet?: HatchetClient;
22
+ logger?: Logger;
23
+ };
24
+ /**
25
+ * Fan out one `account.unlinked` per mutation fact (PRD 08 T3).
26
+ *
27
+ * This exists so the emit SHAPE lives once: `MergedLinkUnlink` (the merge's
28
+ * singleton-collision soft-unlink, `reason: "relinked"`) and
29
+ * `ContactUnlinkFact` (the contact-deletion leg, `reason: "api"`) both satisfy
30
+ * {@link AccountUnlinkedFacts} structurally, so both legs share this loop and
31
+ * cannot drift apart on the payload or the dedupe key.
32
+ *
33
+ * ## Call it AFTER the mutation's transaction has RESOLVED, never inside it
34
+ *
35
+ * DECISIONS §8 puts emission at the commit/intent layer. Both callers hand us
36
+ * facts a `db.transaction(...)` already returned: a rolled-back merge or
37
+ * delete must never have announced an unlink that did not happen, and a
38
+ * subscriber that reacts by re-reading the pull plane inside the write's own
39
+ * transaction window would read pre-commit state.
40
+ *
41
+ * ## Fire-and-forget, and it stays that way
42
+ *
43
+ * `emitOutbound` never throws (`outbound.ts:600-608`); the `void … .catch` is
44
+ * the defence-in-depth its own docstring asks every call site for. A webhook
45
+ * problem must never fail a contact merge or a GDPR deletion, so this function
46
+ * returns `void` rather than a promise — there is deliberately nothing for a
47
+ * caller to await and therefore nothing for a caller to accidentally fail on.
48
+ *
49
+ * `version` is threaded through as the decimal STRING the store produced and
50
+ * is never parsed (DECISIONS §5.1). `userId`/`email` come off `fact.owner`,
51
+ * read inside the mutation's transaction, and are never looked up here.
52
+ *
53
+ * ## The spine is reached by DYNAMIC import, on purpose
54
+ *
55
+ * `lib/contacts.ts` imports this module, and `src/testing.ts` re-exports
56
+ * `softDeleteContact` from `lib/contacts.ts`. A STATIC `./hatchet.js` or
57
+ * `./outbound.js` import here (outbound → `workflows/deliver-webhook.js` →
58
+ * `lib/hatchet.js`) would therefore run `HatchetClient.init(...)` the moment
59
+ * anything touched the `@hogsend/engine/testing` barrel, which is documented
60
+ * side-effect-free and is consumed where no real Hatchet token exists — it
61
+ * throws `Invalid token format` before a single test runs. Resolving both
62
+ * inside the fire-and-forget body keeps that barrel clean; the ESM module
63
+ * cache makes every call after the first free, and the emit is already
64
+ * asynchronous so nothing about the timing or the post-commit ordering
65
+ * changes. `account-links-emit.test.ts` pins the absence of the static form —
66
+ * every gate stays green without it, so only that guard catches a regression.
67
+ */
68
+ export declare function emitAccountUnlinked(db: Database, facts: readonly AccountUnlinkedFacts[], handles?: EmitHandles): void;
69
+ //# sourceMappingURL=account-link-emit.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-link-emit.d.ts","sourceRoot":"","sources":["../../src/lib/account-link-emit.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yCAAyC,CAAC;AAC7E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAgB,KAAK,MAAM,EAAE,MAAM,aAAa,CAAC;AAQxD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,WAAW,GAAG;IACxB,OAAO,CAAC,EAAE,aAAa,CAAC;IACxB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,mBAAmB,CACjC,EAAE,EAAE,QAAQ,EACZ,KAAK,EAAE,SAAS,oBAAoB,EAAE,EACtC,OAAO,GAAE,WAAgB,GACxB,IAAI,CAsBN"}
@@ -0,0 +1,128 @@
1
+ import type { LinkAccountResult, LinkOwner } from "./account-links.js";
2
+ import type { OutboundPayloads } from "./outbound.js";
3
+ /**
4
+ * The ONE place an `account.*` outbound payload or dedupe key is constructed
5
+ * (PRD 08 T3).
6
+ *
7
+ * Six emit sites across four PRDs build these — the hosted callback (linked +
8
+ * four link_failed reasons), the data-plane import, two data-plane revokes,
9
+ * the manage page, the merge's singleton-collision unlink and the
10
+ * contact-deletion leg. Hand-rolling the shape at each of them is how the
11
+ * `email` field ends up carrying the PROVIDER-reported address at one site and
12
+ * the contact's at another, or how one site emits `v3` while another emits
13
+ * `v3.0`. Everything here is a pure function of the facts a mutation already
14
+ * returned.
15
+ *
16
+ * This module has NO runtime imports on purpose (both imports above are
17
+ * `import type`, fully erased). `outbound.ts` reaches the delivery task, which
18
+ * reaches `env.ts`, which validates at IMPORT time — a payload builder must
19
+ * never drag that into a caller that has no env.
20
+ *
21
+ * ## Replay safety — there is none to reach for, and that is deliberate
22
+ *
23
+ * Linking happens in ROUTE-HANDLER runtime (the hosted callback, the data
24
+ * plane), never inside a Hatchet durable task. So nothing here enters the
25
+ * Hatchet journal, the positional-journal law that governs `ctx.sleep` /
26
+ * `ctx.waitForEvent` / the digest+throttle primitives does not apply, and the
27
+ * tracked mailer's exactly-once machinery (auto-keying off the replay-stable
28
+ * Hatchet run id) is NOT involved and must not be reached for.
29
+ *
30
+ * Idempotency here is DB-level, in three layers: the pair advisory lock plus
31
+ * the `(provider, provider_user_id, version)` unique constraint (DECISIONS
32
+ * §5.6) on the write side, and the `(endpointId, dedupeKey)` partial-unique
33
+ * index on the outbound side — which is what {@link buildDedupeKey} feeds. A
34
+ * journey that REACTS to `account.linked` is an ordinary event-triggered
35
+ * journey and obeys every existing replay law unchanged.
36
+ */
37
+ /**
38
+ * `al:<provider>:<providerUserId>:v<version>` — DECISIONS §5.5, riding the
39
+ * existing `(endpointId, dedupeKey)` partial-unique index on
40
+ * `webhook_deliveries`.
41
+ *
42
+ * A PURE TEMPLATE. Do NOT add URL-encoding, escaping or normalization: the key
43
+ * only has to be stable and unique per mutation, and the instant its spelling
44
+ * changes, a re-emit of a version minted before the change no longer collides
45
+ * with the row written after it — the dedupe silently stops deduping, which no
46
+ * delivery assertion can see.
47
+ *
48
+ * `version` is a decimal STRING in and a STRING out, never parsed
49
+ * (DECISIONS §5.1: the column is a Postgres `bigint`, so `Number()` loses
50
+ * fidelity past `Number.MAX_SAFE_INTEGER` and breaks the consumer's
51
+ * `incoming.version > stored.version` guard in exactly the case it exists for).
52
+ */
53
+ export declare function buildDedupeKey(provider: string, providerUserId: string, version: string): string;
54
+ /** The two {@link LinkAccountResult} arms that actually bound something. */
55
+ type LinkedFacts = Extract<LinkAccountResult, {
56
+ status: "linked";
57
+ } | {
58
+ status: "relinked";
59
+ }>;
60
+ /**
61
+ * FULL CURRENT STATE for a successful bind (DECISIONS §5.2), built from the
62
+ * facts `linkAccount()` returned and nothing else.
63
+ *
64
+ * `userId` and `email` come off `facts.owner` — the join to `contacts` the
65
+ * store performed INSIDE its advisory-locked transaction (DECISIONS §15.5).
66
+ * Neither field exists on `linked_accounts`, and re-reading them here would be
67
+ * a read after the lock released: no longer the state that was committed.
68
+ * `userId` is `contactKey()` (`external_id ?? anonymous_id ?? id`), the ONE
69
+ * definition shared by the PULL, PUSH and IN-PROCESS planes — never the raw
70
+ * `externalId`.
71
+ *
72
+ * `email` is the CONTACT's address. `row.verifiedEmail` (the
73
+ * provider-reported one) is deliberately never read here: it is a display
74
+ * property at most, and putting it in a field named `email` beside `contactId`
75
+ * is precisely how a downstream system ends up resolving identity on it.
76
+ */
77
+ export declare function buildAccountLinkedPayload(facts: LinkedFacts, at?: Date): OutboundPayloads["account.linked"];
78
+ /**
79
+ * The facts every unlink site already has in hand.
80
+ *
81
+ * The merge fold's `MergedLinkUnlink` and the delete leg's `ContactUnlinkFact`
82
+ * satisfy this structurally, so `lib/account-link-emit.ts` fans both out
83
+ * without reshaping either. `UnlinkAccountResult` does NOT: its `unlinked` arm
84
+ * carries `provider`/`providerUserId` on `.row`, not at the top level, so a
85
+ * revoke site (PRD 09, PRD 11) passes those two up from `res.row` alongside
86
+ * `res.version`, `res.owner` and its own `reason`.
87
+ */
88
+ export interface AccountUnlinkedFacts {
89
+ provider: string;
90
+ providerUserId: string;
91
+ /** That pair's OWN next version, a decimal STRING (DECISIONS §5.1). */
92
+ version: string;
93
+ reason: "player" | "api" | "relinked";
94
+ /** Read inside the mutation's transaction — see {@link LinkOwner}. */
95
+ owner: LinkOwner;
96
+ }
97
+ /**
98
+ * FULL CURRENT STATE for a release (DECISIONS §5.2). Shares the
99
+ * `(provider, providerUserId)` version sequence with `account.linked`, so a
100
+ * consumer's single monotonic guard makes reorder, duplicate and late delivery
101
+ * all no-ops.
102
+ *
103
+ * `contactId`/`userId`/`email` are read off `owner` and nowhere else, for the
104
+ * same reason as {@link buildAccountLinkedPayload}.
105
+ */
106
+ export declare function buildAccountUnlinkedPayload(facts: AccountUnlinkedFacts, at?: Date): OutboundPayloads["account.unlinked"];
107
+ /**
108
+ * A link flow ended without binding anything.
109
+ *
110
+ * Carries NO `version` and NO `state`: nothing mutated, so there is nothing
111
+ * for the consumer's `incoming.version > stored.version` guard to compare and
112
+ * no current state to report. It gets NO dedupeKey either (the caller passes
113
+ * none) — two genuine failures in a row are two genuine facts, and suppressing
114
+ * the second would hide a brute-force pattern.
115
+ *
116
+ * `reason` is `AccountLinkCallbackError.reason` verbatim; PRD 01 froze that
117
+ * union as the `account.link_failed` union minus `"vetoed"` (which only the
118
+ * hook path produces), so there is no translation table. `contactId` is null
119
+ * whenever the flow failed before a trustworthy contact was in hand, and this
120
+ * event NEVER mints one (DECISIONS §8).
121
+ */
122
+ export declare function buildLinkFailedPayload(args: {
123
+ provider: string;
124
+ reason: "denied" | "vetoed" | "exchange_failed" | "state_invalid";
125
+ contactId: string | null;
126
+ }, at?: Date): OutboundPayloads["account.link_failed"];
127
+ export {};
128
+ //# sourceMappingURL=account-link-events.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-link-events.d.ts","sourceRoot":"","sources":["../../src/lib/account-link-events.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACvE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,cAAc,CAC5B,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,OAAO,EAAE,MAAM,GACd,MAAM,CAER;AAED,4EAA4E;AAC5E,KAAK,WAAW,GAAG,OAAO,CACxB,iBAAiB,EACjB;IAAE,MAAM,EAAE,QAAQ,CAAA;CAAE,GAAG;IAAE,MAAM,EAAE,UAAU,CAAA;CAAE,CAC9C,CAAC;AAEF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,WAAW,EAClB,EAAE,GAAE,IAAiB,GACpB,gBAAgB,CAAC,gBAAgB,CAAC,CAcpC;AAED;;;;;;;;;GASG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,CAAC;IACvB,uEAAuE;IACvE,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,EAAE,QAAQ,GAAG,KAAK,GAAG,UAAU,CAAC;IACtC,sEAAsE;IACtE,KAAK,EAAE,SAAS,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAgB,2BAA2B,CACzC,KAAK,EAAE,oBAAoB,EAC3B,EAAE,GAAE,IAAiB,GACpB,gBAAgB,CAAC,kBAAkB,CAAC,CAYtC;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,sBAAsB,CACpC,IAAI,EAAE;IACJ,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,QAAQ,GAAG,QAAQ,GAAG,iBAAiB,GAAG,eAAe,CAAC;IAClE,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B,EACD,EAAE,GAAE,IAAiB,GACpB,gBAAgB,CAAC,qBAAqB,CAAC,CAOzC"}
@@ -0,0 +1,32 @@
1
+ import type { AccountLinkHooks, BeforeLinkContext } from "@hogsend/core";
2
+ import type { Logger } from "./logger.js";
3
+ /**
4
+ * The `beforeLink` veto runner — FAIL-CLOSED (DECISIONS §6.7).
5
+ *
6
+ * A throw, a timeout at {@link ACCOUNT_LINK_HOOK_TIMEOUT_MS}, and an explicit
7
+ * `{ allow: false }` all collapse to one outcome: `{ allow: false, reason:
8
+ * "vetoed" }`. A `void`/`undefined` return ALLOWS, per PRD 01's
9
+ * `BeforeLinkResult` — denial is never implicit, so a hook that only observes
10
+ * cannot accidentally veto every link. There is no third outcome and no config
11
+ * flag that turns the veto into a warning.
12
+ *
13
+ * **`runBeforeLink` is the ONLY export of this file, deliberately.**
14
+ * `afterLink` / `afterUnlink` have exactly one invoker — the link store,
15
+ * post-commit (DECISIONS §15.4) — and a second bounded runner living here is
16
+ * precisely how they end up firing twice for every link, invisibly, because
17
+ * they are documented at-least-once and nothing would fail loudly. The veto is
18
+ * genuinely route-owned because it is pre-write and the hosted callback is the
19
+ * only pre-write position. If a bounded fail-OPEN runner is ever wanted
20
+ * elsewhere, it lives in `lib/account-links.ts` beside the commit it follows.
21
+ */
22
+ export declare function runBeforeLink(args: {
23
+ hooks: AccountLinkHooks;
24
+ ctx: BeforeLinkContext;
25
+ logger?: Logger;
26
+ }): Promise<{
27
+ allow: true;
28
+ } | {
29
+ allow: false;
30
+ reason: "vetoed";
31
+ }>;
32
+ //# sourceMappingURL=account-link-hooks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"account-link-hooks.d.ts","sourceRoot":"","sources":["../../src/lib/account-link-hooks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEzE,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,aAAa,CAAC,IAAI,EAAE;IACxC,KAAK,EAAE,gBAAgB,CAAC;IACxB,GAAG,EAAE,iBAAiB,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,OAAO,CAAC;IAAE,KAAK,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,KAAK,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,QAAQ,CAAA;CAAE,CAAC,CA6ChE"}