@hogsend/engine 0.67.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.
- package/README.md +3 -2
- package/dist/account-links/__fixtures__/fake-fetch.d.ts +38 -0
- package/dist/account-links/__fixtures__/fake-fetch.d.ts.map +1 -0
- package/dist/account-links/battlenet.d.ts +36 -0
- package/dist/account-links/battlenet.d.ts.map +1 -0
- package/dist/account-links/epic.d.ts +36 -0
- package/dist/account-links/epic.d.ts.map +1 -0
- package/dist/account-links/index.d.ts +7 -0
- package/dist/account-links/index.d.ts.map +1 -0
- package/dist/account-links/riot.d.ts +35 -0
- package/dist/account-links/riot.d.ts.map +1 -0
- package/dist/account-links/steam.d.ts +35 -0
- package/dist/account-links/steam.d.ts.map +1 -0
- package/dist/account-links/twitch.d.ts +38 -0
- package/dist/account-links/twitch.d.ts.map +1 -0
- package/dist/account-links/xbox.d.ts +39 -0
- package/dist/account-links/xbox.d.ts.map +1 -0
- package/dist/app.d.ts +50 -0
- package/dist/app.d.ts.map +1 -0
- package/dist/buckets/bucket-access.d.ts +60 -0
- package/dist/buckets/bucket-access.d.ts.map +1 -0
- package/dist/buckets/bucket-reactions.d.ts +100 -0
- package/dist/buckets/bucket-reactions.d.ts.map +1 -0
- package/dist/buckets/check-membership.d.ts +105 -0
- package/dist/buckets/check-membership.d.ts.map +1 -0
- package/dist/buckets/define-bucket.d.ts +53 -0
- package/dist/buckets/define-bucket.d.ts.map +1 -0
- package/dist/buckets/membership-epoch.d.ts +74 -0
- package/dist/buckets/membership-epoch.d.ts.map +1 -0
- package/dist/buckets/registry-singleton.d.ts +6 -0
- package/dist/buckets/registry-singleton.d.ts.map +1 -0
- package/dist/buckets/registry.d.ts +59 -0
- package/dist/buckets/registry.d.ts.map +1 -0
- package/dist/campaigns/cohort-sql.d.ts +54 -0
- package/dist/campaigns/cohort-sql.d.ts.map +1 -0
- package/dist/campaigns/define-campaign.d.ts +105 -0
- package/dist/campaigns/define-campaign.d.ts.map +1 -0
- package/dist/campaigns/reconcile.d.ts +13 -0
- package/dist/campaigns/reconcile.d.ts.map +1 -0
- package/dist/campaigns/steps.d.ts +29 -0
- package/dist/campaigns/steps.d.ts.map +1 -0
- package/dist/cold-connect/index.d.ts +98 -0
- package/dist/cold-connect/index.d.ts.map +1 -0
- package/dist/cold-connect/page.d.ts +69 -0
- package/dist/cold-connect/page.d.ts.map +1 -0
- package/dist/cold-connect/throttle.d.ts +39 -0
- package/dist/cold-connect/throttle.d.ts.map +1 -0
- package/dist/cold-connect/token.d.ts +57 -0
- package/dist/cold-connect/token.d.ts.map +1 -0
- package/dist/connectors/action-registry-singleton.d.ts +21 -0
- package/dist/connectors/action-registry-singleton.d.ts.map +1 -0
- package/dist/connectors/define-action.d.ts +117 -0
- package/dist/connectors/define-action.d.ts.map +1 -0
- package/dist/connectors/define-connector.d.ts +172 -0
- package/dist/connectors/define-connector.d.ts.map +1 -0
- package/dist/connectors/presets/index.d.ts +17 -0
- package/dist/connectors/presets/index.d.ts.map +1 -0
- package/dist/connectors/registry-singleton.d.ts +34 -0
- package/dist/connectors/registry-singleton.d.ts.map +1 -0
- package/dist/connectors/runtime.d.ts +68 -0
- package/dist/connectors/runtime.d.ts.map +1 -0
- package/dist/container.d.ts +678 -0
- package/dist/container.d.ts.map +1 -0
- package/dist/destinations/define-destination.d.ts +96 -0
- package/dist/destinations/define-destination.d.ts.map +1 -0
- package/dist/destinations/presets/index.d.ts +42 -0
- package/dist/destinations/presets/index.d.ts.map +1 -0
- package/dist/destinations/presets/posthog.d.ts +12 -0
- package/dist/destinations/presets/posthog.d.ts.map +1 -0
- package/dist/destinations/presets/segment.d.ts +15 -0
- package/dist/destinations/presets/segment.d.ts.map +1 -0
- package/dist/destinations/presets/slack.d.ts +10 -0
- package/dist/destinations/presets/slack.d.ts.map +1 -0
- package/dist/destinations/presets/webhook.d.ts +14 -0
- package/dist/destinations/presets/webhook.d.ts.map +1 -0
- package/dist/destinations/registry-singleton.d.ts +44 -0
- package/dist/destinations/registry-singleton.d.ts.map +1 -0
- package/dist/env.d.ts +119 -0
- package/dist/env.d.ts.map +1 -0
- package/dist/flags/reconcile.d.ts +36 -0
- package/dist/flags/reconcile.d.ts.map +1 -0
- package/dist/index.d.ts +210 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/journeys/authoring.d.ts +15 -0
- package/dist/journeys/authoring.d.ts.map +1 -0
- package/dist/journeys/client-defaults-singleton.d.ts +16 -0
- package/dist/journeys/client-defaults-singleton.d.ts.map +1 -0
- package/dist/journeys/constants.d.ts +32 -0
- package/dist/journeys/constants.d.ts.map +1 -0
- package/dist/journeys/define-journey.d.ts +33 -0
- package/dist/journeys/define-journey.d.ts.map +1 -0
- package/dist/journeys/durable-law-harness.d.ts +74 -0
- package/dist/journeys/durable-law-harness.d.ts.map +1 -0
- package/dist/journeys/errors.d.ts +13 -0
- package/dist/journeys/errors.d.ts.map +1 -0
- package/dist/journeys/execute-journey-run.d.ts +160 -0
- package/dist/journeys/execute-journey-run.d.ts.map +1 -0
- package/dist/journeys/graph/build-graph.d.ts +24 -0
- package/dist/journeys/graph/build-graph.d.ts.map +1 -0
- package/dist/journeys/group-scope.d.ts +56 -0
- package/dist/journeys/group-scope.d.ts.map +1 -0
- package/dist/journeys/journey-boundary.d.ts +264 -0
- package/dist/journeys/journey-boundary.d.ts.map +1 -0
- package/dist/journeys/journey-context.d.ts +60 -0
- package/dist/journeys/journey-context.d.ts.map +1 -0
- package/dist/journeys/journey-log.d.ts +42 -0
- package/dist/journeys/journey-log.d.ts.map +1 -0
- package/dist/journeys/journey-source-locations-singleton.d.ts +6 -0
- package/dist/journeys/journey-source-locations-singleton.d.ts.map +1 -0
- package/dist/journeys/journey-sources-singleton.d.ts +5 -0
- package/dist/journeys/journey-sources-singleton.d.ts.map +1 -0
- package/dist/journeys/journey-task-factory.d.ts +11 -0
- package/dist/journeys/journey-task-factory.d.ts.map +1 -0
- package/dist/journeys/journey-task-runtime.d.ts +2 -0
- package/dist/journeys/journey-task-runtime.d.ts.map +1 -0
- package/dist/journeys/journey-version.d.ts +71 -0
- package/dist/journeys/journey-version.d.ts.map +1 -0
- package/dist/journeys/record-once.d.ts +56 -0
- package/dist/journeys/record-once.d.ts.map +1 -0
- package/dist/journeys/registry-singleton.d.ts +6 -0
- package/dist/journeys/registry-singleton.d.ts.map +1 -0
- package/dist/journeys/registry.d.ts +59 -0
- package/dist/journeys/registry.d.ts.map +1 -0
- package/dist/journeys/with-durable-gate.d.ts +97 -0
- package/dist/journeys/with-durable-gate.d.ts.map +1 -0
- package/dist/lib/account-link-emit.d.ts +69 -0
- package/dist/lib/account-link-emit.d.ts.map +1 -0
- package/dist/lib/account-link-events.d.ts +128 -0
- package/dist/lib/account-link-events.d.ts.map +1 -0
- package/dist/lib/account-link-hooks.d.ts +32 -0
- package/dist/lib/account-link-hooks.d.ts.map +1 -0
- package/dist/lib/account-link-ingest.d.ts +78 -0
- package/dist/lib/account-link-ingest.d.ts.map +1 -0
- package/dist/lib/account-link-nonce.d.ts +29 -0
- package/dist/lib/account-link-nonce.d.ts.map +1 -0
- package/dist/lib/account-link-origins.d.ts +37 -0
- package/dist/lib/account-link-origins.d.ts.map +1 -0
- package/dist/lib/account-link-pkce.d.ts +48 -0
- package/dist/lib/account-link-pkce.d.ts.map +1 -0
- package/dist/lib/account-link-provider-registry.d.ts +35 -0
- package/dist/lib/account-link-provider-registry.d.ts.map +1 -0
- package/dist/lib/account-link-throttle.d.ts +76 -0
- package/dist/lib/account-link-throttle.d.ts.map +1 -0
- package/dist/lib/account-link-url.d.ts +41 -0
- package/dist/lib/account-link-url.d.ts.map +1 -0
- package/dist/lib/account-links-from-env.d.ts +62 -0
- package/dist/lib/account-links-from-env.d.ts.map +1 -0
- package/dist/lib/account-links.d.ts +353 -0
- package/dist/lib/account-links.d.ts.map +1 -0
- package/dist/lib/agent/config.d.ts +14 -0
- package/dist/lib/agent/config.d.ts.map +1 -0
- package/dist/lib/agent/proposals.d.ts +52 -0
- package/dist/lib/agent/proposals.d.ts.map +1 -0
- package/dist/lib/agent/provider.d.ts +9 -0
- package/dist/lib/agent/provider.d.ts.map +1 -0
- package/dist/lib/agent/risk.d.ts +24 -0
- package/dist/lib/agent/risk.d.ts.map +1 -0
- package/dist/lib/agent/system-prompt.d.ts +8 -0
- package/dist/lib/agent/system-prompt.d.ts.map +1 -0
- package/dist/lib/agent/tools.d.ts +258 -0
- package/dist/lib/agent/tools.d.ts.map +1 -0
- package/dist/lib/alerting.d.ts +7 -0
- package/dist/lib/alerting.d.ts.map +1 -0
- package/dist/lib/analytics-adapter.d.ts +24 -0
- package/dist/lib/analytics-adapter.d.ts.map +1 -0
- package/dist/lib/analytics-identity.d.ts +60 -0
- package/dist/lib/analytics-identity.d.ts.map +1 -0
- package/dist/lib/analytics-provider-registry.d.ts +20 -0
- package/dist/lib/analytics-provider-registry.d.ts.map +1 -0
- package/dist/lib/analytics-providers-from-env.d.ts +41 -0
- package/dist/lib/analytics-providers-from-env.d.ts.map +1 -0
- package/dist/lib/analytics-singleton.d.ts +10 -0
- package/dist/lib/analytics-singleton.d.ts.map +1 -0
- package/dist/lib/api-key-hash.d.ts +9 -0
- package/dist/lib/api-key-hash.d.ts.map +1 -0
- package/dist/lib/app-secret.d.ts +29 -0
- package/dist/lib/app-secret.d.ts.map +1 -0
- package/dist/lib/attachments.d.ts +53 -0
- package/dist/lib/attachments.d.ts.map +1 -0
- package/dist/lib/attribution-backfill.d.ts +48 -0
- package/dist/lib/attribution-backfill.d.ts.map +1 -0
- package/dist/lib/attribution.d.ts +44 -0
- package/dist/lib/attribution.d.ts.map +1 -0
- package/dist/lib/auth.d.ts +136 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/backfill.d.ts +41 -0
- package/dist/lib/backfill.d.ts.map +1 -0
- package/dist/lib/banner.d.ts +52 -0
- package/dist/lib/banner.d.ts.map +1 -0
- package/dist/lib/blueprint-lock.d.ts +19 -0
- package/dist/lib/blueprint-lock.d.ts.map +1 -0
- package/dist/lib/blueprints.d.ts +573 -0
- package/dist/lib/blueprints.d.ts.map +1 -0
- package/dist/lib/boot-api-key.d.ts +38 -0
- package/dist/lib/boot-api-key.d.ts.map +1 -0
- package/dist/lib/boot.d.ts +23 -0
- package/dist/lib/boot.d.ts.map +1 -0
- package/dist/lib/bootstrap-admin.d.ts +33 -0
- package/dist/lib/bootstrap-admin.d.ts.map +1 -0
- package/dist/lib/bot-prefetch.d.ts +21 -0
- package/dist/lib/bot-prefetch.d.ts.map +1 -0
- package/dist/lib/bucket-emit.d.ts +75 -0
- package/dist/lib/bucket-emit.d.ts.map +1 -0
- package/dist/lib/bucket-posthog-sync.d.ts +29 -0
- package/dist/lib/bucket-posthog-sync.d.ts.map +1 -0
- package/dist/lib/campaign-send-key.d.ts +31 -0
- package/dist/lib/campaign-send-key.d.ts.map +1 -0
- package/dist/lib/connector-actions.d.ts +83 -0
- package/dist/lib/connector-actions.d.ts.map +1 -0
- package/dist/lib/connector-heartbeat.d.ts +35 -0
- package/dist/lib/connector-heartbeat.d.ts.map +1 -0
- package/dist/lib/connector-link-codes.d.ts +105 -0
- package/dist/lib/connector-link-codes.d.ts.map +1 -0
- package/dist/lib/connector-state.d.ts +97 -0
- package/dist/lib/connector-state.d.ts.map +1 -0
- package/dist/lib/contacts.d.ts +622 -0
- package/dist/lib/contacts.d.ts.map +1 -0
- package/dist/lib/conversion-dispatch.d.ts +98 -0
- package/dist/lib/conversion-dispatch.d.ts.map +1 -0
- package/dist/lib/conversions.d.ts +75 -0
- package/dist/lib/conversions.d.ts.map +1 -0
- package/dist/lib/create-admin.d.ts +54 -0
- package/dist/lib/create-admin.d.ts.map +1 -0
- package/dist/lib/crm-deals.d.ts +66 -0
- package/dist/lib/crm-deals.d.ts.map +1 -0
- package/dist/lib/crm-ingest.d.ts +38 -0
- package/dist/lib/crm-ingest.d.ts.map +1 -0
- package/dist/lib/crm-provider-registry.d.ts +20 -0
- package/dist/lib/crm-provider-registry.d.ts.map +1 -0
- package/dist/lib/crm-registry-singleton.d.ts +18 -0
- package/dist/lib/crm-registry-singleton.d.ts.map +1 -0
- package/dist/lib/db.d.ts +3 -0
- package/dist/lib/db.d.ts.map +1 -0
- package/dist/lib/deal-money-events.d.ts +35 -0
- package/dist/lib/deal-money-events.d.ts.map +1 -0
- package/dist/lib/discord-gateway-heartbeat.d.ts +47 -0
- package/dist/lib/discord-gateway-heartbeat.d.ts.map +1 -0
- package/dist/lib/domain-status.d.ts +87 -0
- package/dist/lib/domain-status.d.ts.map +1 -0
- package/dist/lib/email-provider-registry.d.ts +30 -0
- package/dist/lib/email-provider-registry.d.ts.map +1 -0
- package/dist/lib/email-providers-from-env.d.ts +12 -0
- package/dist/lib/email-providers-from-env.d.ts.map +1 -0
- package/dist/lib/email-service-types.d.ts +189 -0
- package/dist/lib/email-service-types.d.ts.map +1 -0
- package/dist/lib/email-stats.d.ts +12 -0
- package/dist/lib/email-stats.d.ts.map +1 -0
- package/dist/lib/email.d.ts +73 -0
- package/dist/lib/email.d.ts.map +1 -0
- package/dist/lib/enrichment-ledger.d.ts +101 -0
- package/dist/lib/enrichment-ledger.d.ts.map +1 -0
- package/dist/lib/enrichment-provider-registry.d.ts +20 -0
- package/dist/lib/enrichment-provider-registry.d.ts.map +1 -0
- package/dist/lib/enrichment-providers-from-env.d.ts +13 -0
- package/dist/lib/enrichment-providers-from-env.d.ts.map +1 -0
- package/dist/lib/enrichment-registry-singleton.d.ts +9 -0
- package/dist/lib/enrichment-registry-singleton.d.ts.map +1 -0
- package/dist/lib/enrollment-guards.d.ts +28 -0
- package/dist/lib/enrollment-guards.d.ts.map +1 -0
- package/dist/lib/enrollment-policy.d.ts +25 -0
- package/dist/lib/enrollment-policy.d.ts.map +1 -0
- package/dist/lib/event-names.d.ts +27 -0
- package/dist/lib/event-names.d.ts.map +1 -0
- package/dist/lib/feed.d.ts +64 -0
- package/dist/lib/feed.d.ts.map +1 -0
- package/dist/lib/flags-registry.d.ts +23 -0
- package/dist/lib/flags-registry.d.ts.map +1 -0
- package/dist/lib/flags.d.ts +143 -0
- package/dist/lib/flags.d.ts.map +1 -0
- package/dist/lib/frequency-cap.d.ts +38 -0
- package/dist/lib/frequency-cap.d.ts.map +1 -0
- package/dist/lib/from-address.d.ts +15 -0
- package/dist/lib/from-address.d.ts.map +1 -0
- package/dist/lib/funnel-progress.d.ts +37 -0
- package/dist/lib/funnel-progress.d.ts.map +1 -0
- package/dist/lib/funnel-registry.d.ts +44 -0
- package/dist/lib/funnel-registry.d.ts.map +1 -0
- package/dist/lib/funnel-transitions.d.ts +63 -0
- package/dist/lib/funnel-transitions.d.ts.map +1 -0
- package/dist/lib/fx.d.ts +118 -0
- package/dist/lib/fx.d.ts.map +1 -0
- package/dist/lib/global-control-readout.d.ts +72 -0
- package/dist/lib/global-control-readout.d.ts.map +1 -0
- package/dist/lib/groups.d.ts +138 -0
- package/dist/lib/groups.d.ts.map +1 -0
- package/dist/lib/hatchet-duration.d.ts +14 -0
- package/dist/lib/hatchet-duration.d.ts.map +1 -0
- package/dist/lib/hatchet.d.ts +3 -0
- package/dist/lib/hatchet.d.ts.map +1 -0
- package/dist/lib/headers.d.ts +8 -0
- package/dist/lib/headers.d.ts.map +1 -0
- package/dist/lib/holdout.d.ts +36 -0
- package/dist/lib/holdout.d.ts.map +1 -0
- package/dist/lib/html.d.ts +5 -0
- package/dist/lib/html.d.ts.map +1 -0
- package/dist/lib/identity-service.d.ts +60 -0
- package/dist/lib/identity-service.d.ts.map +1 -0
- package/dist/lib/identity-token.d.ts +81 -0
- package/dist/lib/identity-token.d.ts.map +1 -0
- package/dist/lib/ingestion.d.ts +218 -0
- package/dist/lib/ingestion.d.ts.map +1 -0
- package/dist/lib/journey-lift.d.ts +56 -0
- package/dist/lib/journey-lift.d.ts.map +1 -0
- package/dist/lib/journey-suppress.d.ts +59 -0
- package/dist/lib/journey-suppress.d.ts.map +1 -0
- package/dist/lib/leader-lease.d.ts +36 -0
- package/dist/lib/leader-lease.d.ts.map +1 -0
- package/dist/lib/lift-stats.d.ts +46 -0
- package/dist/lib/lift-stats.d.ts.map +1 -0
- package/dist/lib/links.d.ts +186 -0
- package/dist/lib/links.d.ts.map +1 -0
- package/dist/lib/load-optional-plugin.d.ts +47 -0
- package/dist/lib/load-optional-plugin.d.ts.map +1 -0
- package/dist/lib/logger.d.ts +4 -0
- package/dist/lib/logger.d.ts.map +1 -0
- package/dist/lib/mailer.d.ts +43 -0
- package/dist/lib/mailer.d.ts.map +1 -0
- package/dist/lib/metrics-sql.d.ts +11 -0
- package/dist/lib/metrics-sql.d.ts.map +1 -0
- package/dist/lib/notifications.d.ts +17 -0
- package/dist/lib/notifications.d.ts.map +1 -0
- package/dist/lib/oauth-token-manager.d.ts +74 -0
- package/dist/lib/oauth-token-manager.d.ts.map +1 -0
- package/dist/lib/operator-settings.d.ts +33 -0
- package/dist/lib/operator-settings.d.ts.map +1 -0
- package/dist/lib/operator.d.ts +20 -0
- package/dist/lib/operator.d.ts.map +1 -0
- package/dist/lib/outbound-endpoint-cache.d.ts +25 -0
- package/dist/lib/outbound-endpoint-cache.d.ts.map +1 -0
- package/dist/lib/outbound.d.ts +687 -0
- package/dist/lib/outbound.d.ts.map +1 -0
- package/dist/lib/phone.d.ts +11 -0
- package/dist/lib/phone.d.ts.map +1 -0
- package/dist/lib/posthog-scopes.d.ts +30 -0
- package/dist/lib/posthog-scopes.d.ts.map +1 -0
- package/dist/lib/posthog.d.ts +16 -0
- package/dist/lib/posthog.d.ts.map +1 -0
- package/dist/lib/preferences.d.ts +72 -0
- package/dist/lib/preferences.d.ts.map +1 -0
- package/dist/lib/provider-credentials.d.ts +149 -0
- package/dist/lib/provider-credentials.d.ts.map +1 -0
- package/dist/lib/provision-posthog-loop.d.ts +100 -0
- package/dist/lib/provision-posthog-loop.d.ts.map +1 -0
- package/dist/lib/recipient-preferences.d.ts +29 -0
- package/dist/lib/recipient-preferences.d.ts.map +1 -0
- package/dist/lib/redis.d.ts +33 -0
- package/dist/lib/redis.d.ts.map +1 -0
- package/dist/lib/referral-intent.d.ts +99 -0
- package/dist/lib/referral-intent.d.ts.map +1 -0
- package/dist/lib/referral-link.d.ts +59 -0
- package/dist/lib/referral-link.d.ts.map +1 -0
- package/dist/lib/referral-registry.d.ts +37 -0
- package/dist/lib/referral-registry.d.ts.map +1 -0
- package/dist/lib/referral-report.d.ts +178 -0
- package/dist/lib/referral-report.d.ts.map +1 -0
- package/dist/lib/referral-runtime.d.ts +43 -0
- package/dist/lib/referral-runtime.d.ts.map +1 -0
- package/dist/lib/referrals.d.ts +184 -0
- package/dist/lib/referrals.d.ts.map +1 -0
- package/dist/lib/refine-chain.d.ts +236 -0
- package/dist/lib/refine-chain.d.ts.map +1 -0
- package/dist/lib/refine-traits.d.ts +78 -0
- package/dist/lib/refine-traits.d.ts.map +1 -0
- package/dist/lib/refine.d.ts +35 -0
- package/dist/lib/refine.d.ts.map +1 -0
- package/dist/lib/reset-email.d.ts +38 -0
- package/dist/lib/reset-email.d.ts.map +1 -0
- package/dist/lib/revenue.d.ts +61 -0
- package/dist/lib/revenue.d.ts.map +1 -0
- package/dist/lib/schemas.d.ts +9 -0
- package/dist/lib/schemas.d.ts.map +1 -0
- package/dist/lib/seed-posthog-destination.d.ts +22 -0
- package/dist/lib/seed-posthog-destination.d.ts.map +1 -0
- package/dist/lib/semantic-click.d.ts +58 -0
- package/dist/lib/semantic-click.d.ts.map +1 -0
- package/dist/lib/sending-domain-guidance.d.ts +40 -0
- package/dist/lib/sending-domain-guidance.d.ts.map +1 -0
- package/dist/lib/singleton.d.ts +24 -0
- package/dist/lib/singleton.d.ts.map +1 -0
- package/dist/lib/sms-frequency-cap.d.ts +16 -0
- package/dist/lib/sms-frequency-cap.d.ts.map +1 -0
- package/dist/lib/sms-inbound.d.ts +37 -0
- package/dist/lib/sms-inbound.d.ts.map +1 -0
- package/dist/lib/sms-link-tracking.d.ts +53 -0
- package/dist/lib/sms-link-tracking.d.ts.map +1 -0
- package/dist/lib/sms-mailer.d.ts +12 -0
- package/dist/lib/sms-mailer.d.ts.map +1 -0
- package/dist/lib/sms-provider-registry.d.ts +20 -0
- package/dist/lib/sms-provider-registry.d.ts.map +1 -0
- package/dist/lib/sms-providers-from-env.d.ts +4 -0
- package/dist/lib/sms-providers-from-env.d.ts.map +1 -0
- package/dist/lib/sms-service-types.d.ts +131 -0
- package/dist/lib/sms-service-types.d.ts.map +1 -0
- package/dist/lib/sms-tracked.d.ts +36 -0
- package/dist/lib/sms-tracked.d.ts.map +1 -0
- package/dist/lib/sms.d.ts +58 -0
- package/dist/lib/sms.d.ts.map +1 -0
- package/dist/lib/snippet.d.ts +32 -0
- package/dist/lib/snippet.d.ts.map +1 -0
- package/dist/lib/stable-stringify.d.ts +12 -0
- package/dist/lib/stable-stringify.d.ts.map +1 -0
- package/dist/lib/studio.d.ts +21 -0
- package/dist/lib/studio.d.ts.map +1 -0
- package/dist/lib/survey.d.ts +35 -0
- package/dist/lib/survey.d.ts.map +1 -0
- package/dist/lib/test-mode.d.ts +77 -0
- package/dist/lib/test-mode.d.ts.map +1 -0
- package/dist/lib/timezone.d.ts +55 -0
- package/dist/lib/timezone.d.ts.map +1 -0
- package/dist/lib/tracked.d.ts +95 -0
- package/dist/lib/tracked.d.ts.map +1 -0
- package/dist/lib/tracking-event-names.d.ts +7 -0
- package/dist/lib/tracking-event-names.d.ts.map +1 -0
- package/dist/lib/tracking-events.d.ts +232 -0
- package/dist/lib/tracking-events.d.ts.map +1 -0
- package/dist/lib/tracking.d.ts +47 -0
- package/dist/lib/tracking.d.ts.map +1 -0
- package/dist/lib/unconfigured-email-provider.d.ts +20 -0
- package/dist/lib/unconfigured-email-provider.d.ts.map +1 -0
- package/dist/lib/unique-violation.d.ts +22 -0
- package/dist/lib/unique-violation.d.ts.map +1 -0
- package/dist/lib/user-token.d.ts +44 -0
- package/dist/lib/user-token.d.ts.map +1 -0
- package/dist/lib/variant.d.ts +44 -0
- package/dist/lib/variant.d.ts.map +1 -0
- package/dist/lib/webhook-signing.d.ts +120 -0
- package/dist/lib/webhook-signing.d.ts.map +1 -0
- package/dist/lib/worker-heartbeat.d.ts +18 -0
- package/dist/lib/worker-heartbeat.d.ts.map +1 -0
- package/dist/lists/channels.d.ts +43 -0
- package/dist/lists/channels.d.ts.map +1 -0
- package/dist/lists/define-list.d.ts +76 -0
- package/dist/lists/define-list.d.ts.map +1 -0
- package/dist/lists/registry-singleton.d.ts +8 -0
- package/dist/lists/registry-singleton.d.ts.map +1 -0
- package/dist/lists/registry.d.ts +66 -0
- package/dist/lists/registry.d.ts.map +1 -0
- package/dist/lists/subscription.d.ts +10 -0
- package/dist/lists/subscription.d.ts.map +1 -0
- package/dist/mcp/authoring-guide.d.ts +33 -0
- package/dist/mcp/authoring-guide.d.ts.map +1 -0
- package/dist/mcp/blueprint-tools.d.ts +266 -0
- package/dist/mcp/blueprint-tools.d.ts.map +1 -0
- package/dist/middleware/api-key.d.ts +45 -0
- package/dist/middleware/api-key.d.ts.map +1 -0
- package/dist/middleware/audit.d.ts +3 -0
- package/dist/middleware/audit.d.ts.map +1 -0
- package/dist/middleware/error-handler.d.ts +4 -0
- package/dist/middleware/error-handler.d.ts.map +1 -0
- package/dist/middleware/publishable-key.d.ts +27 -0
- package/dist/middleware/publishable-key.d.ts.map +1 -0
- package/dist/middleware/rate-limit.d.ts +105 -0
- package/dist/middleware/rate-limit.d.ts.map +1 -0
- package/dist/middleware/request-logger.d.ts +4 -0
- package/dist/middleware/request-logger.d.ts.map +1 -0
- package/dist/middleware/require-admin.d.ts +3 -0
- package/dist/middleware/require-admin.d.ts.map +1 -0
- package/dist/routes/_shared.d.ts +52 -0
- package/dist/routes/_shared.d.ts.map +1 -0
- package/dist/routes/accounts/callback.d.ts +18 -0
- package/dist/routes/accounts/callback.d.ts.map +1 -0
- package/dist/routes/accounts/emit.d.ts +96 -0
- package/dist/routes/accounts/emit.d.ts.map +1 -0
- package/dist/routes/accounts/import-links.d.ts +4 -0
- package/dist/routes/accounts/import-links.d.ts.map +1 -0
- package/dist/routes/accounts/index.d.ts +39 -0
- package/dist/routes/accounts/index.d.ts.map +1 -0
- package/dist/routes/accounts/lookup.d.ts +6 -0
- package/dist/routes/accounts/lookup.d.ts.map +1 -0
- package/dist/routes/accounts/me.d.ts +5 -0
- package/dist/routes/accounts/me.d.ts.map +1 -0
- package/dist/routes/accounts/mint.d.ts +5 -0
- package/dist/routes/accounts/mint.d.ts.map +1 -0
- package/dist/routes/accounts/pages.d.ts +23 -0
- package/dist/routes/accounts/pages.d.ts.map +1 -0
- package/dist/routes/accounts/resolve.d.ts +33 -0
- package/dist/routes/accounts/resolve.d.ts.map +1 -0
- package/dist/routes/accounts/serialize.d.ts +57 -0
- package/dist/routes/accounts/serialize.d.ts.map +1 -0
- package/dist/routes/accounts/shared.d.ts +68 -0
- package/dist/routes/accounts/shared.d.ts.map +1 -0
- package/dist/routes/accounts/start.d.ts +16 -0
- package/dist/routes/accounts/start.d.ts.map +1 -0
- package/dist/routes/accounts/unlink.d.ts +36 -0
- package/dist/routes/accounts/unlink.d.ts.map +1 -0
- package/dist/routes/admin/agent.d.ts +4 -0
- package/dist/routes/admin/agent.d.ts.map +1 -0
- package/dist/routes/admin/alerts.d.ts +190 -0
- package/dist/routes/admin/alerts.d.ts.map +1 -0
- package/dist/routes/admin/analytics.d.ts +137 -0
- package/dist/routes/admin/analytics.d.ts.map +1 -0
- package/dist/routes/admin/api-keys.d.ts +158 -0
- package/dist/routes/admin/api-keys.d.ts.map +1 -0
- package/dist/routes/admin/attribution.d.ts +93 -0
- package/dist/routes/admin/attribution.d.ts.map +1 -0
- package/dist/routes/admin/audit-logs.d.ts +40 -0
- package/dist/routes/admin/audit-logs.d.ts.map +1 -0
- package/dist/routes/admin/blueprints.d.ts +4 -0
- package/dist/routes/admin/blueprints.d.ts.map +1 -0
- package/dist/routes/admin/buckets.d.ts +215 -0
- package/dist/routes/admin/buckets.d.ts.map +1 -0
- package/dist/routes/admin/bulk.d.ts +203 -0
- package/dist/routes/admin/bulk.d.ts.map +1 -0
- package/dist/routes/admin/campaigns.d.ts +198 -0
- package/dist/routes/admin/campaigns.d.ts.map +1 -0
- package/dist/routes/admin/connectors.d.ts +116 -0
- package/dist/routes/admin/connectors.d.ts.map +1 -0
- package/dist/routes/admin/contacts.d.ts +246 -0
- package/dist/routes/admin/contacts.d.ts.map +1 -0
- package/dist/routes/admin/conversions.d.ts +103 -0
- package/dist/routes/admin/conversions.d.ts.map +1 -0
- package/dist/routes/admin/deals.d.ts +136 -0
- package/dist/routes/admin/deals.d.ts.map +1 -0
- package/dist/routes/admin/dlq.d.ts +100 -0
- package/dist/routes/admin/dlq.d.ts.map +1 -0
- package/dist/routes/admin/domain.d.ts +314 -0
- package/dist/routes/admin/domain.d.ts.map +1 -0
- package/dist/routes/admin/emails.d.ts +127 -0
- package/dist/routes/admin/emails.d.ts.map +1 -0
- package/dist/routes/admin/events.d.ts +140 -0
- package/dist/routes/admin/events.d.ts.map +1 -0
- package/dist/routes/admin/flags.d.ts +719 -0
- package/dist/routes/admin/flags.d.ts.map +1 -0
- package/dist/routes/admin/funnels.d.ts +71 -0
- package/dist/routes/admin/funnels.d.ts.map +1 -0
- package/dist/routes/admin/groups.d.ts +169 -0
- package/dist/routes/admin/groups.d.ts.map +1 -0
- package/dist/routes/admin/identity.d.ts +72 -0
- package/dist/routes/admin/identity.d.ts.map +1 -0
- package/dist/routes/admin/impact-schemas.d.ts +48 -0
- package/dist/routes/admin/impact-schemas.d.ts.map +1 -0
- package/dist/routes/admin/impact.d.ts +316 -0
- package/dist/routes/admin/impact.d.ts.map +1 -0
- package/dist/routes/admin/index.d.ts +4 -0
- package/dist/routes/admin/index.d.ts.map +1 -0
- package/dist/routes/admin/journey-impact.d.ts +320 -0
- package/dist/routes/admin/journey-impact.d.ts.map +1 -0
- package/dist/routes/admin/journey-logs.d.ts +57 -0
- package/dist/routes/admin/journey-logs.d.ts.map +1 -0
- package/dist/routes/admin/journeys.d.ts +736 -0
- package/dist/routes/admin/journeys.d.ts.map +1 -0
- package/dist/routes/admin/links.d.ts +382 -0
- package/dist/routes/admin/links.d.ts.map +1 -0
- package/dist/routes/admin/lists.d.ts +22 -0
- package/dist/routes/admin/lists.d.ts.map +1 -0
- package/dist/routes/admin/maintenance.d.ts +72 -0
- package/dist/routes/admin/maintenance.d.ts.map +1 -0
- package/dist/routes/admin/metrics.d.ts +212 -0
- package/dist/routes/admin/metrics.d.ts.map +1 -0
- package/dist/routes/admin/open-editor.d.ts +36 -0
- package/dist/routes/admin/open-editor.d.ts.map +1 -0
- package/dist/routes/admin/preferences.d.ts +109 -0
- package/dist/routes/admin/preferences.d.ts.map +1 -0
- package/dist/routes/admin/provider-credentials.d.ts +108 -0
- package/dist/routes/admin/provider-credentials.d.ts.map +1 -0
- package/dist/routes/admin/readiness.d.ts +24 -0
- package/dist/routes/admin/readiness.d.ts.map +1 -0
- package/dist/routes/admin/referrals.d.ts +230 -0
- package/dist/routes/admin/referrals.d.ts.map +1 -0
- package/dist/routes/admin/reporting.d.ts +149 -0
- package/dist/routes/admin/reporting.d.ts.map +1 -0
- package/dist/routes/admin/settings.d.ts +80 -0
- package/dist/routes/admin/settings.d.ts.map +1 -0
- package/dist/routes/admin/suppressions.d.ts +90 -0
- package/dist/routes/admin/suppressions.d.ts.map +1 -0
- package/dist/routes/admin/targeting.d.ts +58 -0
- package/dist/routes/admin/targeting.d.ts.map +1 -0
- package/dist/routes/admin/templates.d.ts +197 -0
- package/dist/routes/admin/templates.d.ts.map +1 -0
- package/dist/routes/admin/timeline.d.ts +51 -0
- package/dist/routes/admin/timeline.d.ts.map +1 -0
- package/dist/routes/admin/webhooks.d.ts +250 -0
- package/dist/routes/admin/webhooks.d.ts.map +1 -0
- package/dist/routes/campaigns/index.d.ts +239 -0
- package/dist/routes/campaigns/index.d.ts.map +1 -0
- package/dist/routes/connectors/index.d.ts +16 -0
- package/dist/routes/connectors/index.d.ts.map +1 -0
- package/dist/routes/contacts/index.d.ts +187 -0
- package/dist/routes/contacts/index.d.ts.map +1 -0
- package/dist/routes/email/index.d.ts +4 -0
- package/dist/routes/email/index.d.ts.map +1 -0
- package/dist/routes/email/preferences.d.ts +17 -0
- package/dist/routes/email/preferences.d.ts.map +1 -0
- package/dist/routes/email/unsubscribe.d.ts +17 -0
- package/dist/routes/email/unsubscribe.d.ts.map +1 -0
- package/dist/routes/emails/index.d.ts +90 -0
- package/dist/routes/emails/index.d.ts.map +1 -0
- package/dist/routes/events/index.d.ts +116 -0
- package/dist/routes/events/index.d.ts.map +1 -0
- package/dist/routes/feed/index.d.ts +248 -0
- package/dist/routes/feed/index.d.ts.map +1 -0
- package/dist/routes/feed/recipient.d.ts +65 -0
- package/dist/routes/feed/recipient.d.ts.map +1 -0
- package/dist/routes/flags/index.d.ts +94 -0
- package/dist/routes/flags/index.d.ts.map +1 -0
- package/dist/routes/groups/index.d.ts +192 -0
- package/dist/routes/groups/index.d.ts.map +1 -0
- package/dist/routes/health.d.ts +57 -0
- package/dist/routes/health.d.ts.map +1 -0
- package/dist/routes/index.d.ts +8 -0
- package/dist/routes/index.d.ts.map +1 -0
- package/dist/routes/lists/index.d.ts +266 -0
- package/dist/routes/lists/index.d.ts.map +1 -0
- package/dist/routes/referrals/index.d.ts +22 -0
- package/dist/routes/referrals/index.d.ts.map +1 -0
- package/dist/routes/referrals/me.d.ts +4 -0
- package/dist/routes/referrals/me.d.ts.map +1 -0
- package/dist/routes/referrals/report.d.ts +5 -0
- package/dist/routes/referrals/report.d.ts.map +1 -0
- package/dist/routes/referrals/shared.d.ts +16 -0
- package/dist/routes/referrals/shared.d.ts.map +1 -0
- package/dist/routes/referrals/touch.d.ts +5 -0
- package/dist/routes/referrals/touch.d.ts.map +1 -0
- package/dist/routes/snippet.d.ts +12 -0
- package/dist/routes/snippet.d.ts.map +1 -0
- package/dist/routes/tracking/answer.d.ts +56 -0
- package/dist/routes/tracking/answer.d.ts.map +1 -0
- package/dist/routes/tracking/arrive.d.ts +32 -0
- package/dist/routes/tracking/arrive.d.ts.map +1 -0
- package/dist/routes/tracking/click-pipeline.d.ts +213 -0
- package/dist/routes/tracking/click-pipeline.d.ts.map +1 -0
- package/dist/routes/tracking/click.d.ts +26 -0
- package/dist/routes/tracking/click.d.ts.map +1 -0
- package/dist/routes/tracking/identify.d.ts +32 -0
- package/dist/routes/tracking/identify.d.ts.map +1 -0
- package/dist/routes/tracking/index.d.ts +4 -0
- package/dist/routes/tracking/index.d.ts.map +1 -0
- package/dist/routes/tracking/open.d.ts +17 -0
- package/dist/routes/tracking/open.d.ts.map +1 -0
- package/dist/routes/tracking/short.d.ts +17 -0
- package/dist/routes/tracking/short.d.ts.map +1 -0
- package/dist/routes/tracking/vanity.d.ts +17 -0
- package/dist/routes/tracking/vanity.d.ts.map +1 -0
- package/dist/routes/webhooks/crm-provider.d.ts +24 -0
- package/dist/routes/webhooks/crm-provider.d.ts.map +1 -0
- package/dist/routes/webhooks/email-provider.d.ts +21 -0
- package/dist/routes/webhooks/email-provider.d.ts.map +1 -0
- package/dist/routes/webhooks/index.d.ts +8 -0
- package/dist/routes/webhooks/index.d.ts.map +1 -0
- package/dist/routes/webhooks/resend.d.ts +35 -0
- package/dist/routes/webhooks/resend.d.ts.map +1 -0
- package/dist/routes/webhooks/sms-provider.d.ts +23 -0
- package/dist/routes/webhooks/sms-provider.d.ts.map +1 -0
- package/dist/routes/webhooks/sources.d.ts +12 -0
- package/dist/routes/webhooks/sources.d.ts.map +1 -0
- package/dist/sources/define-contact-source.d.ts +114 -0
- package/dist/sources/define-contact-source.d.ts.map +1 -0
- package/dist/sources/registry.d.ts +31 -0
- package/dist/sources/registry.d.ts.map +1 -0
- package/dist/sources/webhook-source.d.ts +53 -0
- package/dist/sources/webhook-source.d.ts.map +1 -0
- package/dist/testing.d.ts +10 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/webhook-sources/define-webhook-source.d.ts +60 -0
- package/dist/webhook-sources/define-webhook-source.d.ts.map +1 -0
- package/dist/webhook-sources/presets/clerk.d.ts +9 -0
- package/dist/webhook-sources/presets/clerk.d.ts.map +1 -0
- package/dist/webhook-sources/presets/index.d.ts +140 -0
- package/dist/webhook-sources/presets/index.d.ts.map +1 -0
- package/dist/webhook-sources/presets/intercom.d.ts +44 -0
- package/dist/webhook-sources/presets/intercom.d.ts.map +1 -0
- package/dist/webhook-sources/presets/segment.d.ts +16 -0
- package/dist/webhook-sources/presets/segment.d.ts.map +1 -0
- package/dist/webhook-sources/presets/stripe.d.ts +20 -0
- package/dist/webhook-sources/presets/stripe.d.ts.map +1 -0
- package/dist/webhook-sources/presets/supabase.d.ts +23 -0
- package/dist/webhook-sources/presets/supabase.d.ts.map +1 -0
- package/dist/webhook-sources/verify.d.ts +48 -0
- package/dist/webhook-sources/verify.d.ts.map +1 -0
- package/dist/worker.d.ts +37 -0
- package/dist/worker.d.ts.map +1 -0
- package/dist/workflows/backfill-contact-id.d.ts +202 -0
- package/dist/workflows/backfill-contact-id.d.ts.map +1 -0
- package/dist/workflows/bucket-backfill.d.ts +64 -0
- package/dist/workflows/bucket-backfill.d.ts.map +1 -0
- package/dist/workflows/bucket-reconcile.d.ts +73 -0
- package/dist/workflows/bucket-reconcile.d.ts.map +1 -0
- package/dist/workflows/check-alerts.d.ts +10 -0
- package/dist/workflows/check-alerts.d.ts.map +1 -0
- package/dist/workflows/confirm-semantic-click.d.ts +15 -0
- package/dist/workflows/confirm-semantic-click.d.ts.map +1 -0
- package/dist/workflows/crm-reconcile.d.ts +27 -0
- package/dist/workflows/crm-reconcile.d.ts.map +1 -0
- package/dist/workflows/deliver-webhook.d.ts +88 -0
- package/dist/workflows/deliver-webhook.d.ts.map +1 -0
- package/dist/workflows/dispatch-conversion.d.ts +14 -0
- package/dist/workflows/dispatch-conversion.d.ts.map +1 -0
- package/dist/workflows/identity-alias-backfill.d.ts +96 -0
- package/dist/workflows/identity-alias-backfill.d.ts.map +1 -0
- package/dist/workflows/impact-digest.d.ts +142 -0
- package/dist/workflows/impact-digest.d.ts.map +1 -0
- package/dist/workflows/import-contacts.d.ts +14 -0
- package/dist/workflows/import-contacts.d.ts.map +1 -0
- package/dist/workflows/import-suppressions.d.ts +55 -0
- package/dist/workflows/import-suppressions.d.ts.map +1 -0
- package/dist/workflows/journey-blueprint-interpreter.d.ts +73 -0
- package/dist/workflows/journey-blueprint-interpreter.d.ts.map +1 -0
- package/dist/workflows/send-campaign.d.ts +128 -0
- package/dist/workflows/send-campaign.d.ts.map +1 -0
- package/dist/workflows/send-email.d.ts +15 -0
- package/dist/workflows/send-email.d.ts.map +1 -0
- package/dist/workflows/send-feed.d.ts +37 -0
- package/dist/workflows/send-feed.d.ts.map +1 -0
- package/package.json +60 -22
- package/src/app.ts +9 -1
- package/src/buckets/check-membership.ts +54 -20
- package/src/env.ts +30 -0
- package/src/journeys/journey-log.ts +25 -8
- package/src/lib/contacts.ts +47 -1
- package/src/lib/email-service-types.ts +10 -0
- package/src/lib/ingestion.ts +30 -19
- package/src/lib/mailer-bounce-idempotency.test.ts +7 -2
- package/src/lib/mailer-replied.test.ts +7 -2
- package/src/lib/mailer.ts +1 -0
- package/src/lib/outbound-endpoint-cache.ts +83 -0
- package/src/lib/outbound.ts +56 -37
- package/src/lib/seed-posthog-destination.ts +5 -1
- package/src/lib/tracked.ts +11 -3
- package/src/lib/tracking-events.ts +20 -3
- package/src/middleware/api-key.ts +69 -60
- package/src/middleware/publishable-key.ts +11 -23
- package/src/middleware/rate-limit.ts +165 -3
- package/src/routes/admin/api-keys.ts +148 -0
- package/src/routes/admin/targeting.ts +6 -1
- package/src/routes/admin/webhooks.ts +4 -0
- package/src/routes/index.ts +67 -24
- package/src/workflows/backfill-contact-id.ts +3 -7
- package/src/workflows/bucket-backfill.ts +2 -2
- package/src/workflows/bucket-reconcile.ts +28 -12
- package/src/workflows/check-alerts.ts +3 -9
- package/src/workflows/crm-reconcile.ts +3 -2
- package/src/workflows/deliver-webhook.ts +21 -8
- package/src/workflows/dispatch-conversion.ts +2 -2
- package/src/workflows/identity-alias-backfill.ts +3 -2
- package/src/workflows/impact-digest.ts +2 -2
- package/src/workflows/import-contacts.ts +3 -4
- package/src/workflows/import-suppressions.ts +4 -5
- package/src/workflows/send-campaign.ts +10 -1
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import type { HogsendClient } from "../../container.js";
|
|
2
|
+
/**
|
|
3
|
+
* The agent's tool set. READ tools auto-run (in-process against the container,
|
|
4
|
+
* the same query the corresponding admin route runs). WRITE tools are MINT-ONLY:
|
|
5
|
+
* their execute() builds a human summary, mints a single-use proposal token, and
|
|
6
|
+
* returns `{ status: "needs_confirmation", ... }` — they NEVER perform the side
|
|
7
|
+
* effect. The real write happens only in POST /v1/admin/agent/confirm.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildAgentTools({ container, actorEmail, sessionId, }: {
|
|
10
|
+
container: HogsendClient;
|
|
11
|
+
actorEmail: string;
|
|
12
|
+
sessionId?: string;
|
|
13
|
+
}): {
|
|
14
|
+
list_journeys: import("ai").Tool<Record<string, never>, {
|
|
15
|
+
id: string;
|
|
16
|
+
name: string;
|
|
17
|
+
enabled: boolean;
|
|
18
|
+
trigger: string;
|
|
19
|
+
}[]>;
|
|
20
|
+
list_buckets: import("ai").Tool<Record<string, never>, {
|
|
21
|
+
id: string;
|
|
22
|
+
name: string;
|
|
23
|
+
}[]>;
|
|
24
|
+
overview_stats: import("ai").Tool<Record<string, never>, {
|
|
25
|
+
totalContacts: number;
|
|
26
|
+
activeJourneyEnrollments: number;
|
|
27
|
+
}>;
|
|
28
|
+
query_events: import("ai").Tool<{
|
|
29
|
+
limit: number;
|
|
30
|
+
event?: string | undefined;
|
|
31
|
+
}, {
|
|
32
|
+
event: string;
|
|
33
|
+
userId: string;
|
|
34
|
+
source: string | null;
|
|
35
|
+
occurredAt: Date;
|
|
36
|
+
}[]>;
|
|
37
|
+
find_contacts: import("ai").Tool<{
|
|
38
|
+
search: string;
|
|
39
|
+
limit: number;
|
|
40
|
+
}, {
|
|
41
|
+
id: string;
|
|
42
|
+
email: string | null;
|
|
43
|
+
externalId: string | null;
|
|
44
|
+
lastSeenAt: Date;
|
|
45
|
+
}[]>;
|
|
46
|
+
get_contact: import("ai").Tool<{
|
|
47
|
+
id: string;
|
|
48
|
+
}, {
|
|
49
|
+
error: string;
|
|
50
|
+
contact?: undefined;
|
|
51
|
+
preferences?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
contact: {
|
|
54
|
+
email: string | null;
|
|
55
|
+
id: string;
|
|
56
|
+
createdAt: Date;
|
|
57
|
+
updatedAt: Date;
|
|
58
|
+
organizationId: string | null;
|
|
59
|
+
externalId: string | null;
|
|
60
|
+
anonymousId: string | null;
|
|
61
|
+
discordId: string | null;
|
|
62
|
+
phone: string | null;
|
|
63
|
+
source: string | null;
|
|
64
|
+
sourcedAt: Date | null;
|
|
65
|
+
timezone: string | null;
|
|
66
|
+
properties: Record<string, unknown> | null;
|
|
67
|
+
firstSeenAt: Date;
|
|
68
|
+
lastSeenAt: Date;
|
|
69
|
+
deletedAt: Date | null;
|
|
70
|
+
};
|
|
71
|
+
preferences: {
|
|
72
|
+
createdAt: Date;
|
|
73
|
+
updatedAt: Date;
|
|
74
|
+
id: string;
|
|
75
|
+
userId: string;
|
|
76
|
+
email: string;
|
|
77
|
+
contactId: string | null;
|
|
78
|
+
unsubscribedAll: boolean;
|
|
79
|
+
suppressed: boolean;
|
|
80
|
+
bounceCount: number;
|
|
81
|
+
categories: Record<string, boolean> | null;
|
|
82
|
+
suppressedAt: Date | null;
|
|
83
|
+
lastBounceAt: Date | null;
|
|
84
|
+
} | null;
|
|
85
|
+
error?: undefined;
|
|
86
|
+
}>;
|
|
87
|
+
get_contact_timeline: import("ai").Tool<{
|
|
88
|
+
id: string;
|
|
89
|
+
limit: number;
|
|
90
|
+
}, {
|
|
91
|
+
error: string;
|
|
92
|
+
contactKey?: undefined;
|
|
93
|
+
events?: undefined;
|
|
94
|
+
journeys?: undefined;
|
|
95
|
+
} | {
|
|
96
|
+
contactKey: string;
|
|
97
|
+
events: {
|
|
98
|
+
event: string;
|
|
99
|
+
source: string | null;
|
|
100
|
+
occurredAt: Date;
|
|
101
|
+
}[];
|
|
102
|
+
journeys: {
|
|
103
|
+
journeyId: string;
|
|
104
|
+
status: "active" | "waiting" | "completed" | "failed" | "exited" | "held_out";
|
|
105
|
+
createdAt: Date;
|
|
106
|
+
}[];
|
|
107
|
+
error?: undefined;
|
|
108
|
+
}>;
|
|
109
|
+
list_sends: import("ai").Tool<{
|
|
110
|
+
limit: number;
|
|
111
|
+
}, {
|
|
112
|
+
id: string;
|
|
113
|
+
templateKey: string | null;
|
|
114
|
+
to: string;
|
|
115
|
+
status: "failed" | "queued" | "rendered" | "sent" | "delivered" | "opened" | "clicked" | "bounced" | "complained" | "suppressed";
|
|
116
|
+
sentAt: Date | null;
|
|
117
|
+
openedAt: Date | null;
|
|
118
|
+
clickedAt: Date | null;
|
|
119
|
+
}[]>;
|
|
120
|
+
build_audience: import("ai").Tool<{
|
|
121
|
+
kind: "event" | "property";
|
|
122
|
+
property?: string | undefined;
|
|
123
|
+
op?: "eq" | "neq" | "gt" | "gte" | "lt" | "lte" | "exists" | "contains" | undefined;
|
|
124
|
+
value?: string | number | boolean | undefined;
|
|
125
|
+
event?: string | undefined;
|
|
126
|
+
withinDays?: number | undefined;
|
|
127
|
+
}, {
|
|
128
|
+
count: number;
|
|
129
|
+
sample: string[];
|
|
130
|
+
capped: boolean;
|
|
131
|
+
}>;
|
|
132
|
+
fire_event: import("ai").Tool<{
|
|
133
|
+
event: string;
|
|
134
|
+
eventProperties: Record<string, unknown>;
|
|
135
|
+
userId?: string | undefined;
|
|
136
|
+
userEmail?: string | undefined;
|
|
137
|
+
}, {
|
|
138
|
+
status: "needs_confirmation";
|
|
139
|
+
proposalId: string;
|
|
140
|
+
token: string;
|
|
141
|
+
tool: string;
|
|
142
|
+
summary: string;
|
|
143
|
+
tier: import("./risk.js").Tier;
|
|
144
|
+
expiresAt: string;
|
|
145
|
+
}>;
|
|
146
|
+
send_transactional_email: import("ai").Tool<{
|
|
147
|
+
template: string;
|
|
148
|
+
to: string;
|
|
149
|
+
props: Record<string, unknown>;
|
|
150
|
+
subject?: string | undefined;
|
|
151
|
+
userId?: string | undefined;
|
|
152
|
+
}, {
|
|
153
|
+
status: "needs_confirmation";
|
|
154
|
+
proposalId: string;
|
|
155
|
+
token: string;
|
|
156
|
+
tool: string;
|
|
157
|
+
summary: string;
|
|
158
|
+
tier: import("./risk.js").Tier;
|
|
159
|
+
expiresAt: string;
|
|
160
|
+
}>;
|
|
161
|
+
send_campaign: import("ai").Tool<{
|
|
162
|
+
template: string;
|
|
163
|
+
props: Record<string, unknown>;
|
|
164
|
+
name?: string | undefined;
|
|
165
|
+
list?: string | undefined;
|
|
166
|
+
bucket?: string | undefined;
|
|
167
|
+
subject?: string | undefined;
|
|
168
|
+
from?: string | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
status: "needs_confirmation";
|
|
171
|
+
proposalId: string;
|
|
172
|
+
token: string;
|
|
173
|
+
tool: string;
|
|
174
|
+
summary: string;
|
|
175
|
+
tier: import("./risk.js").Tier;
|
|
176
|
+
expiresAt: string;
|
|
177
|
+
}>;
|
|
178
|
+
enroll_in_journey: import("ai").Tool<{
|
|
179
|
+
journeyId: string;
|
|
180
|
+
properties: Record<string, unknown>;
|
|
181
|
+
userId?: string | undefined;
|
|
182
|
+
userEmail?: string | undefined;
|
|
183
|
+
}, {
|
|
184
|
+
status: "needs_confirmation";
|
|
185
|
+
proposalId: string;
|
|
186
|
+
token: string;
|
|
187
|
+
tool: string;
|
|
188
|
+
summary: string;
|
|
189
|
+
tier: import("./risk.js").Tier;
|
|
190
|
+
expiresAt: string;
|
|
191
|
+
}>;
|
|
192
|
+
subscribe_list: import("ai").Tool<{
|
|
193
|
+
list: string;
|
|
194
|
+
userId?: string | undefined;
|
|
195
|
+
email?: string | undefined;
|
|
196
|
+
}, {
|
|
197
|
+
status: "needs_confirmation";
|
|
198
|
+
proposalId: string;
|
|
199
|
+
token: string;
|
|
200
|
+
tool: string;
|
|
201
|
+
summary: string;
|
|
202
|
+
tier: import("./risk.js").Tier;
|
|
203
|
+
expiresAt: string;
|
|
204
|
+
}>;
|
|
205
|
+
unsubscribe_list: import("ai").Tool<{
|
|
206
|
+
list: string;
|
|
207
|
+
userId?: string | undefined;
|
|
208
|
+
email?: string | undefined;
|
|
209
|
+
}, {
|
|
210
|
+
status: "needs_confirmation";
|
|
211
|
+
proposalId: string;
|
|
212
|
+
token: string;
|
|
213
|
+
tool: string;
|
|
214
|
+
summary: string;
|
|
215
|
+
tier: import("./risk.js").Tier;
|
|
216
|
+
expiresAt: string;
|
|
217
|
+
}>;
|
|
218
|
+
upsert_contact: import("ai").Tool<{
|
|
219
|
+
properties: Record<string, unknown>;
|
|
220
|
+
userId?: string | undefined;
|
|
221
|
+
email?: string | undefined;
|
|
222
|
+
anonymousId?: string | undefined;
|
|
223
|
+
}, {
|
|
224
|
+
status: "needs_confirmation";
|
|
225
|
+
proposalId: string;
|
|
226
|
+
token: string;
|
|
227
|
+
tool: string;
|
|
228
|
+
summary: string;
|
|
229
|
+
tier: import("./risk.js").Tier;
|
|
230
|
+
expiresAt: string;
|
|
231
|
+
}>;
|
|
232
|
+
update_contact: import("ai").Tool<{
|
|
233
|
+
id: string;
|
|
234
|
+
properties: Record<string, unknown>;
|
|
235
|
+
email?: string | undefined;
|
|
236
|
+
}, {
|
|
237
|
+
status: "needs_confirmation";
|
|
238
|
+
proposalId: string;
|
|
239
|
+
token: string;
|
|
240
|
+
tool: string;
|
|
241
|
+
summary: string;
|
|
242
|
+
tier: import("./risk.js").Tier;
|
|
243
|
+
expiresAt: string;
|
|
244
|
+
}>;
|
|
245
|
+
delete_contact: import("ai").Tool<{
|
|
246
|
+
email?: string | undefined;
|
|
247
|
+
userId?: string | undefined;
|
|
248
|
+
}, {
|
|
249
|
+
status: "needs_confirmation";
|
|
250
|
+
proposalId: string;
|
|
251
|
+
token: string;
|
|
252
|
+
tool: string;
|
|
253
|
+
summary: string;
|
|
254
|
+
tier: import("./risk.js").Tier;
|
|
255
|
+
expiresAt: string;
|
|
256
|
+
}>;
|
|
257
|
+
};
|
|
258
|
+
//# sourceMappingURL=tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools.d.ts","sourceRoot":"","sources":["../../../src/lib/agent/tools.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AASxD;;;;;;GAMG;AACH,wBAAgB,eAAe,CAAC,EAC9B,SAAS,EACT,UAAU,EACV,SAAS,GACV,EAAE;IACD,SAAS,EAAE,aAAa,CAAC;IACzB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAicA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alerting.d.ts","sourceRoot":"","sources":["../../src/lib/alerting.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,QAAQ,EAEd,MAAM,aAAa,CAAC;AAGrB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAmD1C,wBAAsB,eAAe,CAAC,IAAI,EAAE;IAC1C,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,IAAI,CAAC,CA0IhB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { AnalyticsProvider, PostHogService } from "@hogsend/core";
|
|
2
|
+
/**
|
|
3
|
+
* Wrap a legacy `PostHogService` (the deprecated PostHog-shaped interface
|
|
4
|
+
* accepted by `createHogsendClient({ analytics })` since before the neutral
|
|
5
|
+
* `AnalyticsProvider` contract existed) so it satisfies the contract the
|
|
6
|
+
* engine now speaks internally. Capabilities are assumed-on: a hand-built
|
|
7
|
+
* service predates capability reporting, and every method is best-effort
|
|
8
|
+
* anyway.
|
|
9
|
+
*
|
|
10
|
+
* Mapping notes:
|
|
11
|
+
* - `setPersonProperties.set` → `identify(distinctId, set)` (the legacy $set
|
|
12
|
+
* path). `setOnce` ALSO maps to `identify` — legacy services have no
|
|
13
|
+
* set-once wire, so overwrite semantics apply; `unset` maps to the legacy
|
|
14
|
+
* raw `$set` capture with `$unset`, mirroring what the bucket sync used to
|
|
15
|
+
* emit directly.
|
|
16
|
+
*/
|
|
17
|
+
export declare function wrapLegacyAnalyticsService(service: PostHogService): AnalyticsProvider;
|
|
18
|
+
/**
|
|
19
|
+
* Runtime discrimination for the `analytics` option union: a neutral
|
|
20
|
+
* `AnalyticsProvider` carries `meta` + `capture`; the legacy `PostHogService`
|
|
21
|
+
* carries `captureEvent` and no `meta`.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isAnalyticsProvider(value: AnalyticsProvider | PostHogService): value is AnalyticsProvider;
|
|
24
|
+
//# sourceMappingURL=analytics-adapter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics-adapter.d.ts","sourceRoot":"","sources":["../../src/lib/analytics-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEvE;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,cAAc,GACtB,iBAAiB,CAkCnB;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,GAAG,cAAc,GACxC,KAAK,IAAI,iBAAiB,CAK5B"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { AnalyticsProvider } from "@hogsend/core";
|
|
2
|
+
import type { Logger } from "./logger.js";
|
|
3
|
+
/**
|
|
4
|
+
* The reason a merge was emitted — surfaced on the `identity.merge.emitted`
|
|
5
|
+
* structured log so an operator can see WHICH resolver path stitched (§10.5). A
|
|
6
|
+
* declining `collide_merge` / `key_flip` volume after anon threading lands
|
|
7
|
+
* (Stage 1) is the empirical "forks prevented" signal.
|
|
8
|
+
*/
|
|
9
|
+
export type IdentityMergeReason = "collide_merge" | "key_flip" | "click_identify" | "discord_link";
|
|
10
|
+
/**
|
|
11
|
+
* Fan out the provider-neutral `mergeIdentities` primitive (§5.3) once per
|
|
12
|
+
* loser key, folding each absorbed (anonymous/uuid) key INTO the surviving
|
|
13
|
+
* canonical contact key. Fire-and-forget and never throws: analytics is
|
|
14
|
+
* non-load-bearing, so a provider error must not fail the ingest that triggered
|
|
15
|
+
* the merge.
|
|
16
|
+
*
|
|
17
|
+
* Direction is load-bearing (MF-1): `survivorKey` is the SURVIVING/canonical
|
|
18
|
+
* (identified) id and each `loserKey` is the ABSORBED (anonymous) one — mapped
|
|
19
|
+
* straight to `mergeIdentities({ distinctId: survivorKey, alias: loserKey })`.
|
|
20
|
+
*
|
|
21
|
+
* No-ops cleanly when:
|
|
22
|
+
* - no provider is injected (`!analytics`),
|
|
23
|
+
* - the active provider can't merge (`!capabilities.identityMerge` — a legacy
|
|
24
|
+
* adapter or a provider without an `alias` wire),
|
|
25
|
+
* - or it carries no `mergeIdentities` method.
|
|
26
|
+
*
|
|
27
|
+
* MF-2: callers MUST pass only the SAFE-to-absorb loser keys (anonymous/uuid,
|
|
28
|
+
* never an `external_id` that already identified a PostHog person). Aliasing an
|
|
29
|
+
* already-identified key is the identified→identified merge PostHog refuses
|
|
30
|
+
* (R2/R4) — it silently no-ops AND spams "Refused to merge" warnings on the
|
|
31
|
+
* normal merge path. The filtering happens at the emission point (the resolver
|
|
32
|
+
* splits its loser keys into safe vs. identified); this helper only fans out
|
|
33
|
+
* what it is given and skips a self-alias (`loserKey === survivorKey`).
|
|
34
|
+
*/
|
|
35
|
+
export declare function mergeAnalyticsIdentities(opts: {
|
|
36
|
+
analytics?: AnalyticsProvider;
|
|
37
|
+
survivorKey: string;
|
|
38
|
+
loserKeys: string[];
|
|
39
|
+
/** Stitching path, for the `identity.merge.emitted` observability log. */
|
|
40
|
+
reason: IdentityMergeReason;
|
|
41
|
+
/** The contact id, for correlating the merge log to a contact row. */
|
|
42
|
+
contactId?: string;
|
|
43
|
+
logger?: Logger;
|
|
44
|
+
}): void;
|
|
45
|
+
/**
|
|
46
|
+
* Emit the `identity.merge.residual_twin` observability log (§10.5) for each
|
|
47
|
+
* loser key MF-2 excluded from the safe fan-out: a loser carrying an
|
|
48
|
+
* `external_id` is, by the engine's own model, an already-identified PostHog
|
|
49
|
+
* person, and PostHog refuses to merge two identified persons on the safe path.
|
|
50
|
+
* These twins are the known steady-state residual (OQ-1) made visible — NOT an
|
|
51
|
+
* error, just the honest "one email → one person, except across two prior
|
|
52
|
+
* identified persons" outcome surfaced for monitoring.
|
|
53
|
+
*/
|
|
54
|
+
export declare function logResidualTwins(opts: {
|
|
55
|
+
survivorKey: string;
|
|
56
|
+
identifiedLoserKeys: string[];
|
|
57
|
+
contactId?: string;
|
|
58
|
+
logger?: Logger;
|
|
59
|
+
}): void;
|
|
60
|
+
//# sourceMappingURL=analytics-identity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics-identity.d.ts","sourceRoot":"","sources":["../../src/lib/analytics-identity.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAC3B,eAAe,GACf,UAAU,GACV,gBAAgB,GAChB,cAAc,CAAC;AAEnB;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE;IAC7C,SAAS,CAAC,EAAE,iBAAiB,CAAC;IAC9B,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,0EAA0E;IAC1E,MAAM,EAAE,mBAAmB,CAAC;IAC5B,sEAAsE;IACtE,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,IAAI,CAoCP;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,IAAI,EAAE;IACrC,WAAW,EAAE,MAAM,CAAC;IACpB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,GAAG,IAAI,CAUP"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AnalyticsProvider } from "@hogsend/core";
|
|
2
|
+
/**
|
|
3
|
+
* Container-held registry of analytics providers, keyed by `provider.meta.id`
|
|
4
|
+
* — the analytics sibling of `EmailProviderRegistry`. The container picks ONE
|
|
5
|
+
* `active` provider out of it (env `ANALYTICS_PROVIDER` /
|
|
6
|
+
* `analytics.defaultProvider`, default `"posthog"`) for the identity PULL,
|
|
7
|
+
* person writes, and capture.
|
|
8
|
+
*
|
|
9
|
+
* Keyed with last-writer-wins, so a consumer-supplied provider of the same id
|
|
10
|
+
* overrides an env preset of that id.
|
|
11
|
+
*/
|
|
12
|
+
export declare class AnalyticsProviderRegistry {
|
|
13
|
+
private byId;
|
|
14
|
+
constructor(providers?: AnalyticsProvider[]);
|
|
15
|
+
register(provider: AnalyticsProvider): void;
|
|
16
|
+
get(id: string): AnalyticsProvider | undefined;
|
|
17
|
+
getAll(): AnalyticsProvider[];
|
|
18
|
+
count(): number;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=analytics-provider-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics-provider-registry.d.ts","sourceRoot":"","sources":["../../src/lib/analytics-provider-registry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAEvD;;;;;;;;;GASG;AACH,qBAAa,yBAAyB;IACpC,OAAO,CAAC,IAAI,CAAwC;gBAExC,SAAS,GAAE,iBAAiB,EAAO;IAI/C,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,GAAG,IAAI;IAI3C,GAAG,CAAC,EAAE,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS;IAI9C,MAAM,IAAI,iBAAiB,EAAE;IAI7B,KAAK,IAAI,MAAM;CAGhB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { AnalyticsProvider } from "@hogsend/core";
|
|
2
|
+
import type { Database } from "@hogsend/db";
|
|
3
|
+
import type { env as envSchema } from "../env.js";
|
|
4
|
+
import type { Logger } from "./logger.js";
|
|
5
|
+
/**
|
|
6
|
+
* Env-driven analytics-provider presets — the analytics sibling of
|
|
7
|
+
* `emailProvidersFromEnv`. PostHog is built when `POSTHOG_API_KEY` is set;
|
|
8
|
+
* person READS additionally need a privileged credential: an OAuth credential
|
|
9
|
+
* stored via `hogsend connect posthog` (preferred, token-manager-backed) or
|
|
10
|
+
* `POSTHOG_PERSONAL_API_KEY` (the public phc_ key is write-only by PostHog's
|
|
11
|
+
* design) — without either the provider still captures and writes person
|
|
12
|
+
* properties, and reads soft-fail to the engine's contact-property fallback.
|
|
13
|
+
*
|
|
14
|
+
* Consumer-supplied providers (`analytics.providers` / `analytics.provider`)
|
|
15
|
+
* merge AFTER these in the registry, so a consumer build of the same id wins.
|
|
16
|
+
*/
|
|
17
|
+
export declare function analyticsProvidersFromEnv(env: typeof envSchema, deps?: {
|
|
18
|
+
db?: Database;
|
|
19
|
+
logger?: Logger;
|
|
20
|
+
}): AnalyticsProvider[];
|
|
21
|
+
/**
|
|
22
|
+
* Boot-time reader for the phc_ persisted by `hogsend connect posthog`
|
|
23
|
+
* (provider_credentials kind="derived", `projectApiKey`): a PURE builder —
|
|
24
|
+
* reads the stored credential and constructs the PostHog provider from it, or
|
|
25
|
+
* resolves null when there is nothing stored (or it can't be decrypted, which
|
|
26
|
+
* must behave exactly like "unconfigured"). ALL activation side effects
|
|
27
|
+
* (registry, `client.analytics`, the module singleton, identity rebind) live
|
|
28
|
+
* at the single call site in `container.ts`. Without this reader the
|
|
29
|
+
* persisted key is dead weight and outbound capture silently keeps requiring
|
|
30
|
+
* a hand-pasted env var.
|
|
31
|
+
*
|
|
32
|
+
* The capture host resolves env-first, then the ingestion host derived from
|
|
33
|
+
* the stored PRIVATE host (`eu.posthog.com` → `eu.i.posthog.com`) so an
|
|
34
|
+
* EU-connected instance never captures to the US default.
|
|
35
|
+
*/
|
|
36
|
+
export declare function buildStoredPosthogProvider(opts: {
|
|
37
|
+
env: typeof envSchema;
|
|
38
|
+
db: Database;
|
|
39
|
+
logger: Logger;
|
|
40
|
+
}): Promise<AnalyticsProvider | null>;
|
|
41
|
+
//# sourceMappingURL=analytics-providers-from-env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics-providers-from-env.d.ts","sourceRoot":"","sources":["../../src/lib/analytics-providers-from-env.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAM5C,OAAO,KAAK,EAAE,GAAG,IAAI,SAAS,EAAE,MAAM,WAAW,CAAC;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAK1C;;;;;;;;;;;GAWG;AACH,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,OAAO,SAAS,EACrB,IAAI,CAAC,EAAE;IAAE,EAAE,CAAC,EAAE,QAAQ,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,GACxC,iBAAiB,EAAE,CAUrB;AA+DD;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,0BAA0B,CAAC,IAAI,EAAE;IACrD,GAAG,EAAE,OAAO,SAAS,CAAC;IACtB,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,OAAO,CAAC,iBAAiB,GAAG,IAAI,CAAC,CAqBpC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { AnalyticsEventMirrorConfig, AnalyticsProvider } from "@hogsend/core";
|
|
2
|
+
export declare const setAnalytics: (value: AnalyticsProvider | undefined) => void;
|
|
3
|
+
export declare const getAnalytics: () => AnalyticsProvider | undefined;
|
|
4
|
+
/** Reset the singleton — only for test cleanup. */
|
|
5
|
+
export declare const resetAnalytics: () => void;
|
|
6
|
+
export declare const setAnalyticsEventMirror: (value: AnalyticsEventMirrorConfig | undefined) => void;
|
|
7
|
+
export declare const getAnalyticsEventMirror: () => AnalyticsEventMirrorConfig | undefined;
|
|
8
|
+
/** Reset the singleton — only for test cleanup. */
|
|
9
|
+
export declare const resetAnalyticsEventMirror: () => void;
|
|
10
|
+
//# sourceMappingURL=analytics-singleton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"analytics-singleton.d.ts","sourceRoot":"","sources":["../../src/lib/analytics-singleton.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,iBAAiB,EAClB,MAAM,eAAe,CAAC;AA4BvB,eAAO,MAAM,YAAY,gDAAgB,CAAC;AAC1C,eAAO,MAAM,YAAY,qCAAgB,CAAC;AAC1C,mDAAmD;AACnD,eAAO,MAAM,cAAc,YAAkB,CAAC;AAW9C,eAAO,MAAM,uBAAuB,yDAAsB,CAAC;AAC3D,eAAO,MAAM,uBAAuB,8CAAsB,CAAC;AAC3D,mDAAmD;AACnD,eAAO,MAAM,yBAAyB,YAAwB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"api-key-hash.d.ts","sourceRoot":"","sources":["../../src/lib/api-key-hash.ts"],"names":[],"mappings":"AAIA,wBAAgB,cAAc,CAAC,IAAI,CAAC,EAAE;IAAE,WAAW,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG;IAChE,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;CACd,CAWA;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Lazy access to `env.BETTER_AUTH_SECRET`, the engine's one master secret
|
|
3
|
+
* (AES-256-GCM key material for sealed link tokens and stored provider
|
|
4
|
+
* credentials).
|
|
5
|
+
*
|
|
6
|
+
* WHY THIS MODULE EXISTS: `../env.js` calls `createEnv` at MODULE SCOPE, so a
|
|
7
|
+
* static `import { env }` anywhere makes that file's whole import graph
|
|
8
|
+
* unloadable without a full, valid environment. `lib/account-links.ts` and
|
|
9
|
+
* `lib/provider-credentials.ts` are both reachable from `src/testing.ts` — the
|
|
10
|
+
* `@hogsend/engine/testing` entry point, which `@hogsend/testing` imports from
|
|
11
|
+
* a consumer app that has NO environment at all (the scaffold's packed-consumer
|
|
12
|
+
* smoke runs it under plain `tsx` with every var stripped). A static env import
|
|
13
|
+
* on that path turns "import a journey test helper" into "Invalid environment
|
|
14
|
+
* variables".
|
|
15
|
+
*
|
|
16
|
+
* Neither module reads the secret at module scope — only inside functions that
|
|
17
|
+
* are already `async` — so resolving it lazily costs nothing and validates
|
|
18
|
+
* EXACTLY the same contract: this loads the real `env.js`, it does not re-read
|
|
19
|
+
* or re-validate `process.env` itself. In a running API/worker `env.js` is
|
|
20
|
+
* already in the module cache (the container imports it at boot, so a bad
|
|
21
|
+
* environment still fails fast at startup); here the `await` just hands back
|
|
22
|
+
* the cached module.
|
|
23
|
+
*
|
|
24
|
+
* The promise is memoised, so the module is loaded — and, on a bad
|
|
25
|
+
* environment, throws — exactly once.
|
|
26
|
+
*/
|
|
27
|
+
/** The validated `BETTER_AUTH_SECRET`, loading `env.js` on first use. */
|
|
28
|
+
export declare function getAppSecret(): Promise<string>;
|
|
29
|
+
//# sourceMappingURL=app-secret.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-secret.d.ts","sourceRoot":"","sources":["../../src/lib/app-secret.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAIH,yEAAyE;AACzE,wBAAgB,YAAY,IAAI,OAAO,CAAC,MAAM,CAAC,CAG9C"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { EmailAttachment, EmailProvider } from "@hogsend/core";
|
|
2
|
+
/**
|
|
3
|
+
* Thrown when a send carries attachments but the resolved provider does not
|
|
4
|
+
* declare `capabilities.attachments`. A named class (mirroring
|
|
5
|
+
* `TestModeNoRedirectError`) so callers can branch on it without
|
|
6
|
+
* string-matching the message; the message itself names the provider id AND
|
|
7
|
+
* the capability so an operator reading a log can act on it directly.
|
|
8
|
+
*/
|
|
9
|
+
export declare class AttachmentsUnsupportedError extends Error {
|
|
10
|
+
readonly providerId: string;
|
|
11
|
+
readonly code = "attachments_unsupported";
|
|
12
|
+
constructor(providerId: string);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The engine-side attachment gate, run BEFORE any other send work (no DB row,
|
|
16
|
+
* no render, no provider call happens first). Two checks, in order:
|
|
17
|
+
*
|
|
18
|
+
* 1. `assertValidAttachments` — shape/size/count validation. The relay
|
|
19
|
+
* validates too, and that is deliberate defence in depth rather than
|
|
20
|
+
* duplication: a Resend or Postmark send never passes through the relay at
|
|
21
|
+
* all, so for those providers THIS is the only gate before the wire.
|
|
22
|
+
*
|
|
23
|
+
* 2. The capability gate — throw unless the provider DECLARES
|
|
24
|
+
* `capabilities.attachments === true`. The quiet alternative (send the
|
|
25
|
+
* message, drop the files) is genuinely tempting and genuinely wrong: a
|
|
26
|
+
* receipt that arrives without its invoice looks *delivered* from every
|
|
27
|
+
* dashboard, from `email_sends`, and from the provider's own logs — nobody
|
|
28
|
+
* discovers it until the customer does. Absence of the flag is NOT consent
|
|
29
|
+
* (same rule as `consumesIdempotencyKey`): an absent or `false` flag means
|
|
30
|
+
* the provider cannot carry the files, so the send must fail loudly here,
|
|
31
|
+
* before anything is written or dispatched.
|
|
32
|
+
*/
|
|
33
|
+
export declare function assertAttachmentsSendable(provider: EmailProvider, attachments: EmailAttachment[]): void;
|
|
34
|
+
/**
|
|
35
|
+
* One recorded metadata entry per attachment on the `email_sends` row:
|
|
36
|
+
* filename, raw byte size, and content type when declared.
|
|
37
|
+
*/
|
|
38
|
+
export interface AttachmentSendMetadata {
|
|
39
|
+
filename: string;
|
|
40
|
+
sizeBytes: number;
|
|
41
|
+
contentType?: string;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* What `email_sends.metadata.attachments` records: that the message HAD
|
|
45
|
+
* attachments — their filenames, raw sizes, and content types. NEVER the
|
|
46
|
+
* content itself. Storing customer invoices indefinitely is a data-protection
|
|
47
|
+
* decision nobody has made, and quietly making it here by persisting bytes
|
|
48
|
+
* would be the wrong default. Size comes from `attachmentByteLength` (raw
|
|
49
|
+
* bytes, decoded for `{ base64 }` content) so the recorded number matches the
|
|
50
|
+
* one the size cap enforces.
|
|
51
|
+
*/
|
|
52
|
+
export declare function attachmentSendMetadata(attachments: EmailAttachment[]): AttachmentSendMetadata[];
|
|
53
|
+
//# sourceMappingURL=attachments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attachments.d.ts","sourceRoot":"","sources":["../../src/lib/attachments.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAGpE;;;;;;GAMG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IAExC,QAAQ,CAAC,UAAU,EAAE,MAAM;IADvC,QAAQ,CAAC,IAAI,6BAA6B;gBACrB,UAAU,EAAE,MAAM;CAQxC;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,aAAa,EACvB,WAAW,EAAE,eAAe,EAAE,GAC7B,IAAI,CAKN;AAED;;;GAGG;AACH,MAAM,WAAW,sBAAsB;IACrC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED;;;;;;;;GAQG;AACH,wBAAgB,sBAAsB,CACpC,WAAW,EAAE,eAAe,EAAE,GAC7B,sBAAsB,EAAE,CAQ1B"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { type Database } from "@hogsend/db";
|
|
2
|
+
import type { ConversionRegistry } from "./conversions.js";
|
|
3
|
+
import type { Logger } from "./logger.js";
|
|
4
|
+
/**
|
|
5
|
+
* Attribution backfill (impact plan §5.1) — replays HISTORY through the
|
|
6
|
+
* same idempotent machinery ingest uses, so an existing deploy that
|
|
7
|
+
* upgrades gets its whole event history credited, and a definition/window
|
|
8
|
+
* change gets a deliberate, logged recompute path.
|
|
9
|
+
*
|
|
10
|
+
* Two stages behind one cursor (`events:<id>` → `credits:<id>`):
|
|
11
|
+
*
|
|
12
|
+
* 1. `events` — scan historical `user_events` matching the registry's
|
|
13
|
+
* trigger set and run conversion evaluation. The unique
|
|
14
|
+
* (definition, event) index makes replays no-ops; only genuinely new
|
|
15
|
+
* conversions are minted. Ad-platform dispatches are deliberately NOT
|
|
16
|
+
* enqueued — historical conversions must never re-fire to destinations.
|
|
17
|
+
* 2. `credits` — scan conversions rows (of the scoped definitions) that
|
|
18
|
+
* have NO credit rows yet and write their ledger entries under the
|
|
19
|
+
* definition's CURRENT window config.
|
|
20
|
+
*
|
|
21
|
+
* `recompute: true` (requires `definitionId`) deletes the definition's
|
|
22
|
+
* existing credit rows up front, then stage 2 re-credits everything — the
|
|
23
|
+
* ONE sanctioned exception to the ledger's write-once philosophy, guarded
|
|
24
|
+
* and logged. Conversion rows themselves are never deleted.
|
|
25
|
+
*
|
|
26
|
+
* Batch-shaped by design: each call processes up to `limit` rows of the
|
|
27
|
+
* current stage and returns `nextCursor` (null = done). The CLI loops it;
|
|
28
|
+
* an admin can curl it. Contacts are matched only — a historical event
|
|
29
|
+
* whose user never became a contact is skipped, never minted.
|
|
30
|
+
*/
|
|
31
|
+
export interface BackfillBatchResult {
|
|
32
|
+
stage: "events" | "credits";
|
|
33
|
+
processed: number;
|
|
34
|
+
conversionsFired: number;
|
|
35
|
+
creditsWritten: number;
|
|
36
|
+
nextCursor: string | null;
|
|
37
|
+
}
|
|
38
|
+
export declare function backfillAttributionBatch(opts: {
|
|
39
|
+
db: Database;
|
|
40
|
+
logger: Logger;
|
|
41
|
+
registry: ConversionRegistry | undefined;
|
|
42
|
+
definitionId?: string;
|
|
43
|
+
since?: Date;
|
|
44
|
+
cursor?: string;
|
|
45
|
+
limit?: number;
|
|
46
|
+
recompute?: boolean;
|
|
47
|
+
}): Promise<BackfillBatchResult>;
|
|
48
|
+
//# sourceMappingURL=attribution-backfill.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"attribution-backfill.d.ts","sourceRoot":"","sources":["../../src/lib/attribution-backfill.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,KAAK,QAAQ,EAEd,MAAM,aAAa,CAAC;AAarB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE3D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B;AAKD,wBAAsB,wBAAwB,CAAC,IAAI,EAAE;IACnD,EAAE,EAAE,QAAQ,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,kBAAkB,GAAG,SAAS,CAAC;IACzC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,KAAK,CAAC,EAAE,IAAI,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAqP/B"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { type DurationObject, type TouchpointChannel } from "@hogsend/core";
|
|
2
|
+
import { type Database } from "@hogsend/db";
|
|
3
|
+
import type { Logger } from "./logger.js";
|
|
4
|
+
/**
|
|
5
|
+
* The attribution ledger writer (plan §6.1): when a conversion fires, read
|
|
6
|
+
* the contact's touchpoint path inside the definition's lookback window and
|
|
7
|
+
* persist EVERY model's credit allocation into `attribution_credits`.
|
|
8
|
+
* Computing all models up front makes "switch the reporting model" a WHERE
|
|
9
|
+
* clause instead of a historical re-derivation.
|
|
10
|
+
*
|
|
11
|
+
* Idempotent: the unique (conversion, model, touchpoint) index turns any
|
|
12
|
+
* replay into a no-op — same inheritance as the conversion row itself.
|
|
13
|
+
*/
|
|
14
|
+
export declare function recordAttributionCredits(opts: {
|
|
15
|
+
db: Database;
|
|
16
|
+
logger: Logger;
|
|
17
|
+
conversionId: string;
|
|
18
|
+
/** The contact's canonical event key (`user_events.user_id`). */
|
|
19
|
+
userKey: string;
|
|
20
|
+
/**
|
|
21
|
+
* The trusted owner uuid (`conversions.contact_id`). REQUIRED (not
|
|
22
|
+
* optional) for the same reason the enrollment guards' is: an optional
|
|
23
|
+
* field silently defaults a new caller onto the mutable text key, and the
|
|
24
|
+
* touchpoint path is precisely the history written BEFORE the person was
|
|
25
|
+
* identified — a key-scoped read drops the anonymous half of every journey
|
|
26
|
+
* and credits the conversion to nothing. Pass `null` explicitly for a
|
|
27
|
+
* subject with no contact; `userKey` still serves that case.
|
|
28
|
+
*/
|
|
29
|
+
contactId: string | null;
|
|
30
|
+
value: number | null;
|
|
31
|
+
currency: string | null;
|
|
32
|
+
/** When the conversion happened. */
|
|
33
|
+
occurredAt: Date;
|
|
34
|
+
/** Lookback window in days (defineConversion attributionWindowDays). */
|
|
35
|
+
windowDays: number;
|
|
36
|
+
/**
|
|
37
|
+
* Per-channel window overrides (plan §2.1). A listed channel's touches
|
|
38
|
+
* qualify only inside its own window; unlisted channels use `windowDays`.
|
|
39
|
+
*/
|
|
40
|
+
windows?: Partial<Record<TouchpointChannel, DurationObject>>;
|
|
41
|
+
}): Promise<{
|
|
42
|
+
touchpoints: number;
|
|
43
|
+
}>;
|
|
44
|
+
//# sourceMappingURL=attribution.d.ts.map
|