@gonzih/meet-the-one-ai 1.0.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/.env.example +41 -0
- package/.node-version +1 -0
- package/basis/BERNAYS.md +233 -0
- package/basis/FOUNDING_TRANSCRIPT.md +218 -0
- package/basis/TECH_SPEC.md +303 -0
- package/basis/VALS.md +255 -0
- package/basis/layers/L1_IDENTITY_AUTH.md +78 -0
- package/basis/layers/L2_CONVERSATION.md +159 -0
- package/basis/layers/L3_RECORDING_STORE.md +104 -0
- package/basis/layers/L4_ANALYSIS_PIPELINE.md +257 -0
- package/basis/layers/L5_MATCHING_ENGINE.md +164 -0
- package/basis/layers/L6_CONSENT_INTRODUCTION.md +143 -0
- package/basis/layers/L7_PORTABLE_IDENTITY.md +139 -0
- package/basis/layers/STACK.md +64 -0
- package/basis/schema.sql +203 -0
- package/dist/agent.d.ts +2 -0
- package/dist/agent.d.ts.map +1 -0
- package/dist/agent.js +114 -0
- package/dist/agent.js.map +1 -0
- package/dist/api/routes/auth.d.ts +2 -0
- package/dist/api/routes/auth.d.ts.map +1 -0
- package/dist/api/routes/auth.js +79 -0
- package/dist/api/routes/auth.js.map +1 -0
- package/dist/api/routes/identity.d.ts +2 -0
- package/dist/api/routes/identity.d.ts.map +1 -0
- package/dist/api/routes/identity.js +92 -0
- package/dist/api/routes/identity.js.map +1 -0
- package/dist/api/routes/text-submission.d.ts +2 -0
- package/dist/api/routes/text-submission.d.ts.map +1 -0
- package/dist/api/routes/text-submission.js +56 -0
- package/dist/api/routes/text-submission.js.map +1 -0
- package/dist/api/webhooks/twilio.d.ts +2 -0
- package/dist/api/webhooks/twilio.d.ts.map +1 -0
- package/dist/api/webhooks/twilio.js +144 -0
- package/dist/api/webhooks/twilio.js.map +1 -0
- package/dist/api/webhooks/vapi.d.ts +2 -0
- package/dist/api/webhooks/vapi.d.ts.map +1 -0
- package/dist/api/webhooks/vapi.js +177 -0
- package/dist/api/webhooks/vapi.js.map +1 -0
- package/dist/bot.d.ts +3 -0
- package/dist/bot.d.ts.map +1 -0
- package/dist/bot.js +39 -0
- package/dist/bot.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/jobs/compact-identity.d.ts +2 -0
- package/dist/jobs/compact-identity.d.ts.map +1 -0
- package/dist/jobs/compact-identity.js +159 -0
- package/dist/jobs/compact-identity.js.map +1 -0
- package/dist/jobs/consent-call.d.ts +2 -0
- package/dist/jobs/consent-call.d.ts.map +1 -0
- package/dist/jobs/consent-call.js +70 -0
- package/dist/jobs/consent-call.js.map +1 -0
- package/dist/jobs/export-identity.d.ts +2 -0
- package/dist/jobs/export-identity.d.ts.map +1 -0
- package/dist/jobs/export-identity.js +129 -0
- package/dist/jobs/export-identity.js.map +1 -0
- package/dist/jobs/introduction-call.d.ts +2 -0
- package/dist/jobs/introduction-call.d.ts.map +1 -0
- package/dist/jobs/introduction-call.js +86 -0
- package/dist/jobs/introduction-call.js.map +1 -0
- package/dist/jobs/reanalyze-identity.d.ts +2 -0
- package/dist/jobs/reanalyze-identity.d.ts.map +1 -0
- package/dist/jobs/reanalyze-identity.js +56 -0
- package/dist/jobs/reanalyze-identity.js.map +1 -0
- package/dist/jobs/run-matching.d.ts +2 -0
- package/dist/jobs/run-matching.d.ts.map +1 -0
- package/dist/jobs/run-matching.js +200 -0
- package/dist/jobs/run-matching.js.map +1 -0
- package/dist/jobs/scheduled-matching.d.ts +2 -0
- package/dist/jobs/scheduled-matching.d.ts.map +1 -0
- package/dist/jobs/scheduled-matching.js +44 -0
- package/dist/jobs/scheduled-matching.js.map +1 -0
- package/dist/jobs/transcribe-session.d.ts +2 -0
- package/dist/jobs/transcribe-session.d.ts.map +1 -0
- package/dist/jobs/transcribe-session.js +66 -0
- package/dist/jobs/transcribe-session.js.map +1 -0
- package/dist/lib/anthropic.d.ts +4 -0
- package/dist/lib/anthropic.d.ts.map +1 -0
- package/dist/lib/anthropic.js +32 -0
- package/dist/lib/anthropic.js.map +1 -0
- package/dist/lib/config.d.ts +57 -0
- package/dist/lib/config.d.ts.map +1 -0
- package/dist/lib/config.js +73 -0
- package/dist/lib/config.js.map +1 -0
- package/dist/lib/deepgram.d.ts +15 -0
- package/dist/lib/deepgram.d.ts.map +1 -0
- package/dist/lib/deepgram.js +37 -0
- package/dist/lib/deepgram.js.map +1 -0
- package/dist/lib/inngest.d.ts +42 -0
- package/dist/lib/inngest.d.ts.map +1 -0
- package/dist/lib/inngest.js +7 -0
- package/dist/lib/inngest.js.map +1 -0
- package/dist/lib/openai.d.ts +3 -0
- package/dist/lib/openai.d.ts.map +1 -0
- package/dist/lib/openai.js +13 -0
- package/dist/lib/openai.js.map +1 -0
- package/dist/lib/prompts.d.ts +8 -0
- package/dist/lib/prompts.d.ts.map +1 -0
- package/dist/lib/prompts.js +258 -0
- package/dist/lib/prompts.js.map +1 -0
- package/dist/lib/r2.d.ts +7 -0
- package/dist/lib/r2.d.ts.map +1 -0
- package/dist/lib/r2.js +49 -0
- package/dist/lib/r2.js.map +1 -0
- package/dist/lib/session-helpers.d.ts +8 -0
- package/dist/lib/session-helpers.d.ts.map +1 -0
- package/dist/lib/session-helpers.js +31 -0
- package/dist/lib/session-helpers.js.map +1 -0
- package/dist/lib/supabase.d.ts +2 -0
- package/dist/lib/supabase.d.ts.map +1 -0
- package/dist/lib/supabase.js +11 -0
- package/dist/lib/supabase.js.map +1 -0
- package/dist/lib/twilio.d.ts +7 -0
- package/dist/lib/twilio.d.ts.map +1 -0
- package/dist/lib/twilio.js +34 -0
- package/dist/lib/twilio.js.map +1 -0
- package/dist/lib/vapi.d.ts +4 -0
- package/dist/lib/vapi.d.ts.map +1 -0
- package/dist/lib/vapi.js +59 -0
- package/dist/lib/vapi.js.map +1 -0
- package/dist/mcp-server.d.ts +3 -0
- package/dist/mcp-server.d.ts.map +1 -0
- package/dist/mcp-server.js +177 -0
- package/dist/mcp-server.js.map +1 -0
- package/dist/types/index.d.ts +104 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +3 -0
- package/dist/types/index.js.map +1 -0
- package/package.json +28 -0
- package/railway.json +14 -0
- package/src/agent.ts +123 -0
- package/src/api/routes/auth.ts +95 -0
- package/src/api/routes/identity.ts +112 -0
- package/src/api/routes/text-submission.ts +64 -0
- package/src/api/webhooks/twilio.ts +181 -0
- package/src/api/webhooks/vapi.ts +219 -0
- package/src/bot.ts +44 -0
- package/src/index.ts +11 -0
- package/src/jobs/compact-identity.ts +211 -0
- package/src/jobs/consent-call.ts +87 -0
- package/src/jobs/export-identity.ts +166 -0
- package/src/jobs/introduction-call.ts +101 -0
- package/src/jobs/reanalyze-identity.ts +65 -0
- package/src/jobs/run-matching.ts +243 -0
- package/src/jobs/scheduled-matching.ts +59 -0
- package/src/jobs/transcribe-session.ts +77 -0
- package/src/lib/anthropic.ts +37 -0
- package/src/lib/config.ts +81 -0
- package/src/lib/deepgram.ts +57 -0
- package/src/lib/inngest.ts +33 -0
- package/src/lib/openai.ts +14 -0
- package/src/lib/prompts.ts +266 -0
- package/src/lib/r2.ts +79 -0
- package/src/lib/session-helpers.ts +37 -0
- package/src/lib/supabase.ts +15 -0
- package/src/lib/twilio.ts +49 -0
- package/src/lib/vapi.ts +80 -0
- package/src/mcp-server.ts +195 -0
- package/src/types/index.ts +146 -0
- package/supabase/.branches/_current_branch +1 -0
- package/supabase/.temp/cli-latest +1 -0
- package/supabase/.temp/gotrue-version +1 -0
- package/supabase/.temp/pooler-url +1 -0
- package/supabase/.temp/postgres-version +1 -0
- package/supabase/.temp/project-ref +1 -0
- package/supabase/.temp/rest-version +1 -0
- package/supabase/.temp/storage-migration +1 -0
- package/supabase/.temp/storage-version +1 -0
- package/supabase/config.toml +384 -0
- package/supabase/migrations/20260303000000_initial_schema.sql +203 -0
- package/supabase/migrations/20260304000000_brand_consents.sql +13 -0
- package/tsconfig.json +25 -0
|
@@ -0,0 +1,384 @@
|
|
|
1
|
+
# For detailed configuration reference documentation, visit:
|
|
2
|
+
# https://supabase.com/docs/guides/local-development/cli/config
|
|
3
|
+
# A string used to distinguish different Supabase projects on the same host. Defaults to the
|
|
4
|
+
# working directory name when running `supabase init`.
|
|
5
|
+
project_id = "meet-the-one"
|
|
6
|
+
|
|
7
|
+
[api]
|
|
8
|
+
enabled = true
|
|
9
|
+
# Port to use for the API URL.
|
|
10
|
+
port = 54331
|
|
11
|
+
# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API
|
|
12
|
+
# endpoints. `public` and `graphql_public` schemas are included by default.
|
|
13
|
+
schemas = ["public", "graphql_public"]
|
|
14
|
+
# Extra schemas to add to the search_path of every request.
|
|
15
|
+
extra_search_path = ["public", "extensions"]
|
|
16
|
+
# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size
|
|
17
|
+
# for accidental or malicious requests.
|
|
18
|
+
max_rows = 1000
|
|
19
|
+
|
|
20
|
+
[api.tls]
|
|
21
|
+
# Enable HTTPS endpoints locally using a self-signed certificate.
|
|
22
|
+
enabled = false
|
|
23
|
+
# Paths to self-signed certificate pair.
|
|
24
|
+
# cert_path = "../certs/my-cert.pem"
|
|
25
|
+
# key_path = "../certs/my-key.pem"
|
|
26
|
+
|
|
27
|
+
[db]
|
|
28
|
+
# Port to use for the local database URL.
|
|
29
|
+
port = 54332
|
|
30
|
+
# Port used by db diff command to initialize the shadow database.
|
|
31
|
+
shadow_port = 54330
|
|
32
|
+
# Maximum amount of time to wait for health check when starting the local database.
|
|
33
|
+
health_timeout = "2m"
|
|
34
|
+
# The database major version to use. This has to be the same as your remote database's. Run `SHOW
|
|
35
|
+
# server_version;` on the remote database to check.
|
|
36
|
+
major_version = 17
|
|
37
|
+
|
|
38
|
+
[db.pooler]
|
|
39
|
+
enabled = false
|
|
40
|
+
# Port to use for the local connection pooler.
|
|
41
|
+
port = 54329
|
|
42
|
+
# Specifies when a server connection can be reused by other clients.
|
|
43
|
+
# Configure one of the supported pooler modes: `transaction`, `session`.
|
|
44
|
+
pool_mode = "transaction"
|
|
45
|
+
# How many server connections to allow per user/database pair.
|
|
46
|
+
default_pool_size = 20
|
|
47
|
+
# Maximum number of client connections allowed.
|
|
48
|
+
max_client_conn = 100
|
|
49
|
+
|
|
50
|
+
# [db.vault]
|
|
51
|
+
# secret_key = "env(SECRET_VALUE)"
|
|
52
|
+
|
|
53
|
+
[db.migrations]
|
|
54
|
+
# If disabled, migrations will be skipped during a db push or reset.
|
|
55
|
+
enabled = true
|
|
56
|
+
# Specifies an ordered list of schema files that describe your database.
|
|
57
|
+
# Supports glob patterns relative to supabase directory: "./schemas/*.sql"
|
|
58
|
+
schema_paths = []
|
|
59
|
+
|
|
60
|
+
[db.seed]
|
|
61
|
+
# If enabled, seeds the database after migrations during a db reset.
|
|
62
|
+
enabled = true
|
|
63
|
+
# Specifies an ordered list of seed files to load during db reset.
|
|
64
|
+
# Supports glob patterns relative to supabase directory: "./seeds/*.sql"
|
|
65
|
+
sql_paths = ["./seed.sql"]
|
|
66
|
+
|
|
67
|
+
[db.network_restrictions]
|
|
68
|
+
# Enable management of network restrictions.
|
|
69
|
+
enabled = false
|
|
70
|
+
# List of IPv4 CIDR blocks allowed to connect to the database.
|
|
71
|
+
# Defaults to allow all IPv4 connections. Set empty array to block all IPs.
|
|
72
|
+
allowed_cidrs = ["0.0.0.0/0"]
|
|
73
|
+
# List of IPv6 CIDR blocks allowed to connect to the database.
|
|
74
|
+
# Defaults to allow all IPv6 connections. Set empty array to block all IPs.
|
|
75
|
+
allowed_cidrs_v6 = ["::/0"]
|
|
76
|
+
|
|
77
|
+
[realtime]
|
|
78
|
+
enabled = true
|
|
79
|
+
# Bind realtime via either IPv4 or IPv6. (default: IPv4)
|
|
80
|
+
# ip_version = "IPv6"
|
|
81
|
+
# The maximum length in bytes of HTTP request headers. (default: 4096)
|
|
82
|
+
# max_header_length = 4096
|
|
83
|
+
|
|
84
|
+
[studio]
|
|
85
|
+
enabled = true
|
|
86
|
+
# Port to use for Supabase Studio.
|
|
87
|
+
port = 54333
|
|
88
|
+
# External URL of the API server that frontend connects to.
|
|
89
|
+
api_url = "http://127.0.0.1"
|
|
90
|
+
# OpenAI API Key to use for Supabase AI in the Supabase Studio.
|
|
91
|
+
openai_api_key = "env(OPENAI_API_KEY)"
|
|
92
|
+
|
|
93
|
+
# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they
|
|
94
|
+
# are monitored, and you can view the emails that would have been sent from the web interface.
|
|
95
|
+
[inbucket]
|
|
96
|
+
enabled = true
|
|
97
|
+
# Port to use for the email testing server web interface.
|
|
98
|
+
port = 54334
|
|
99
|
+
# Uncomment to expose additional ports for testing user applications that send emails.
|
|
100
|
+
# smtp_port = 54325
|
|
101
|
+
# pop3_port = 54326
|
|
102
|
+
# admin_email = "admin@email.com"
|
|
103
|
+
# sender_name = "Admin"
|
|
104
|
+
|
|
105
|
+
[storage]
|
|
106
|
+
enabled = true
|
|
107
|
+
# The maximum file size allowed (e.g. "5MB", "500KB").
|
|
108
|
+
file_size_limit = "50MiB"
|
|
109
|
+
|
|
110
|
+
# Uncomment to configure local storage buckets
|
|
111
|
+
# [storage.buckets.images]
|
|
112
|
+
# public = false
|
|
113
|
+
# file_size_limit = "50MiB"
|
|
114
|
+
# allowed_mime_types = ["image/png", "image/jpeg"]
|
|
115
|
+
# objects_path = "./images"
|
|
116
|
+
|
|
117
|
+
# Allow connections via S3 compatible clients
|
|
118
|
+
[storage.s3_protocol]
|
|
119
|
+
enabled = true
|
|
120
|
+
|
|
121
|
+
# Image transformation API is available to Supabase Pro plan.
|
|
122
|
+
# [storage.image_transformation]
|
|
123
|
+
# enabled = true
|
|
124
|
+
|
|
125
|
+
# Store analytical data in S3 for running ETL jobs over Iceberg Catalog
|
|
126
|
+
# This feature is only available on the hosted platform.
|
|
127
|
+
[storage.analytics]
|
|
128
|
+
enabled = false
|
|
129
|
+
max_namespaces = 5
|
|
130
|
+
max_tables = 10
|
|
131
|
+
max_catalogs = 2
|
|
132
|
+
|
|
133
|
+
# Analytics Buckets is available to Supabase Pro plan.
|
|
134
|
+
# [storage.analytics.buckets.my-warehouse]
|
|
135
|
+
|
|
136
|
+
# Store vector embeddings in S3 for large and durable datasets
|
|
137
|
+
# This feature is only available on the hosted platform.
|
|
138
|
+
[storage.vector]
|
|
139
|
+
enabled = false
|
|
140
|
+
max_buckets = 10
|
|
141
|
+
max_indexes = 5
|
|
142
|
+
|
|
143
|
+
# Vector Buckets is available to Supabase Pro plan.
|
|
144
|
+
# [storage.vector.buckets.documents-openai]
|
|
145
|
+
|
|
146
|
+
[auth]
|
|
147
|
+
enabled = true
|
|
148
|
+
# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used
|
|
149
|
+
# in emails.
|
|
150
|
+
site_url = "http://127.0.0.1:3000"
|
|
151
|
+
# A list of *exact* URLs that auth providers are permitted to redirect to post authentication.
|
|
152
|
+
additional_redirect_urls = ["https://127.0.0.1:3000"]
|
|
153
|
+
# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week).
|
|
154
|
+
jwt_expiry = 3600
|
|
155
|
+
# JWT issuer URL. If not set, defaults to the local API URL (http://127.0.0.1:<port>/auth/v1).
|
|
156
|
+
# jwt_issuer = ""
|
|
157
|
+
# Path to JWT signing key. DO NOT commit your signing keys file to git.
|
|
158
|
+
# signing_keys_path = "./signing_keys.json"
|
|
159
|
+
# If disabled, the refresh token will never expire.
|
|
160
|
+
enable_refresh_token_rotation = true
|
|
161
|
+
# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds.
|
|
162
|
+
# Requires enable_refresh_token_rotation = true.
|
|
163
|
+
refresh_token_reuse_interval = 10
|
|
164
|
+
# Allow/disallow new user signups to your project.
|
|
165
|
+
enable_signup = true
|
|
166
|
+
# Allow/disallow anonymous sign-ins to your project.
|
|
167
|
+
enable_anonymous_sign_ins = false
|
|
168
|
+
# Allow/disallow testing manual linking of accounts
|
|
169
|
+
enable_manual_linking = false
|
|
170
|
+
# Passwords shorter than this value will be rejected as weak. Minimum 6, recommended 8 or more.
|
|
171
|
+
minimum_password_length = 6
|
|
172
|
+
# Passwords that do not meet the following requirements will be rejected as weak. Supported values
|
|
173
|
+
# are: `letters_digits`, `lower_upper_letters_digits`, `lower_upper_letters_digits_symbols`
|
|
174
|
+
password_requirements = ""
|
|
175
|
+
|
|
176
|
+
[auth.rate_limit]
|
|
177
|
+
# Number of emails that can be sent per hour. Requires auth.email.smtp to be enabled.
|
|
178
|
+
email_sent = 2
|
|
179
|
+
# Number of SMS messages that can be sent per hour. Requires auth.sms to be enabled.
|
|
180
|
+
sms_sent = 30
|
|
181
|
+
# Number of anonymous sign-ins that can be made per hour per IP address. Requires enable_anonymous_sign_ins = true.
|
|
182
|
+
anonymous_users = 30
|
|
183
|
+
# Number of sessions that can be refreshed in a 5 minute interval per IP address.
|
|
184
|
+
token_refresh = 150
|
|
185
|
+
# Number of sign up and sign-in requests that can be made in a 5 minute interval per IP address (excludes anonymous users).
|
|
186
|
+
sign_in_sign_ups = 30
|
|
187
|
+
# Number of OTP / Magic link verifications that can be made in a 5 minute interval per IP address.
|
|
188
|
+
token_verifications = 30
|
|
189
|
+
# Number of Web3 logins that can be made in a 5 minute interval per IP address.
|
|
190
|
+
web3 = 30
|
|
191
|
+
|
|
192
|
+
# Configure one of the supported captcha providers: `hcaptcha`, `turnstile`.
|
|
193
|
+
# [auth.captcha]
|
|
194
|
+
# enabled = true
|
|
195
|
+
# provider = "hcaptcha"
|
|
196
|
+
# secret = ""
|
|
197
|
+
|
|
198
|
+
[auth.email]
|
|
199
|
+
# Allow/disallow new user signups via email to your project.
|
|
200
|
+
enable_signup = true
|
|
201
|
+
# If enabled, a user will be required to confirm any email change on both the old, and new email
|
|
202
|
+
# addresses. If disabled, only the new email is required to confirm.
|
|
203
|
+
double_confirm_changes = true
|
|
204
|
+
# If enabled, users need to confirm their email address before signing in.
|
|
205
|
+
enable_confirmations = false
|
|
206
|
+
# If enabled, users will need to reauthenticate or have logged in recently to change their password.
|
|
207
|
+
secure_password_change = false
|
|
208
|
+
# Controls the minimum amount of time that must pass before sending another signup confirmation or password reset email.
|
|
209
|
+
max_frequency = "1s"
|
|
210
|
+
# Number of characters used in the email OTP.
|
|
211
|
+
otp_length = 6
|
|
212
|
+
# Number of seconds before the email OTP expires (defaults to 1 hour).
|
|
213
|
+
otp_expiry = 3600
|
|
214
|
+
|
|
215
|
+
# Use a production-ready SMTP server
|
|
216
|
+
# [auth.email.smtp]
|
|
217
|
+
# enabled = true
|
|
218
|
+
# host = "smtp.sendgrid.net"
|
|
219
|
+
# port = 587
|
|
220
|
+
# user = "apikey"
|
|
221
|
+
# pass = "env(SENDGRID_API_KEY)"
|
|
222
|
+
# admin_email = "admin@email.com"
|
|
223
|
+
# sender_name = "Admin"
|
|
224
|
+
|
|
225
|
+
# Uncomment to customize email template
|
|
226
|
+
# [auth.email.template.invite]
|
|
227
|
+
# subject = "You have been invited"
|
|
228
|
+
# content_path = "./supabase/templates/invite.html"
|
|
229
|
+
|
|
230
|
+
# Uncomment to customize notification email template
|
|
231
|
+
# [auth.email.notification.password_changed]
|
|
232
|
+
# enabled = true
|
|
233
|
+
# subject = "Your password has been changed"
|
|
234
|
+
# content_path = "./templates/password_changed_notification.html"
|
|
235
|
+
|
|
236
|
+
[auth.sms]
|
|
237
|
+
# Allow/disallow new user signups via SMS to your project.
|
|
238
|
+
enable_signup = false
|
|
239
|
+
# If enabled, users need to confirm their phone number before signing in.
|
|
240
|
+
enable_confirmations = false
|
|
241
|
+
# Template for sending OTP to users
|
|
242
|
+
template = "Your code is {{ .Code }}"
|
|
243
|
+
# Controls the minimum amount of time that must pass before sending another sms otp.
|
|
244
|
+
max_frequency = "5s"
|
|
245
|
+
|
|
246
|
+
# Use pre-defined map of phone number to OTP for testing.
|
|
247
|
+
# [auth.sms.test_otp]
|
|
248
|
+
# 4152127777 = "123456"
|
|
249
|
+
|
|
250
|
+
# Configure logged in session timeouts.
|
|
251
|
+
# [auth.sessions]
|
|
252
|
+
# Force log out after the specified duration.
|
|
253
|
+
# timebox = "24h"
|
|
254
|
+
# Force log out if the user has been inactive longer than the specified duration.
|
|
255
|
+
# inactivity_timeout = "8h"
|
|
256
|
+
|
|
257
|
+
# This hook runs before a new user is created and allows developers to reject the request based on the incoming user object.
|
|
258
|
+
# [auth.hook.before_user_created]
|
|
259
|
+
# enabled = true
|
|
260
|
+
# uri = "pg-functions://postgres/auth/before-user-created-hook"
|
|
261
|
+
|
|
262
|
+
# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used.
|
|
263
|
+
# [auth.hook.custom_access_token]
|
|
264
|
+
# enabled = true
|
|
265
|
+
# uri = "pg-functions://<database>/<schema>/<hook_name>"
|
|
266
|
+
|
|
267
|
+
# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`.
|
|
268
|
+
[auth.sms.twilio]
|
|
269
|
+
enabled = false
|
|
270
|
+
account_sid = ""
|
|
271
|
+
message_service_sid = ""
|
|
272
|
+
# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead:
|
|
273
|
+
auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)"
|
|
274
|
+
|
|
275
|
+
# Multi-factor-authentication is available to Supabase Pro plan.
|
|
276
|
+
[auth.mfa]
|
|
277
|
+
# Control how many MFA factors can be enrolled at once per user.
|
|
278
|
+
max_enrolled_factors = 10
|
|
279
|
+
|
|
280
|
+
# Control MFA via App Authenticator (TOTP)
|
|
281
|
+
[auth.mfa.totp]
|
|
282
|
+
enroll_enabled = false
|
|
283
|
+
verify_enabled = false
|
|
284
|
+
|
|
285
|
+
# Configure MFA via Phone Messaging
|
|
286
|
+
[auth.mfa.phone]
|
|
287
|
+
enroll_enabled = false
|
|
288
|
+
verify_enabled = false
|
|
289
|
+
otp_length = 6
|
|
290
|
+
template = "Your code is {{ .Code }}"
|
|
291
|
+
max_frequency = "5s"
|
|
292
|
+
|
|
293
|
+
# Configure MFA via WebAuthn
|
|
294
|
+
# [auth.mfa.web_authn]
|
|
295
|
+
# enroll_enabled = true
|
|
296
|
+
# verify_enabled = true
|
|
297
|
+
|
|
298
|
+
# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`,
|
|
299
|
+
# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin_oidc`, `notion`, `twitch`,
|
|
300
|
+
# `twitter`, `x`, `slack`, `spotify`, `workos`, `zoom`.
|
|
301
|
+
[auth.external.apple]
|
|
302
|
+
enabled = false
|
|
303
|
+
client_id = ""
|
|
304
|
+
# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead:
|
|
305
|
+
secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)"
|
|
306
|
+
# Overrides the default auth redirectUrl.
|
|
307
|
+
redirect_uri = ""
|
|
308
|
+
# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure,
|
|
309
|
+
# or any other third-party OIDC providers.
|
|
310
|
+
url = ""
|
|
311
|
+
# If enabled, the nonce check will be skipped. Required for local sign in with Google auth.
|
|
312
|
+
skip_nonce_check = false
|
|
313
|
+
# If enabled, it will allow the user to successfully authenticate when the provider does not return an email address.
|
|
314
|
+
email_optional = false
|
|
315
|
+
|
|
316
|
+
# Allow Solana wallet holders to sign in to your project via the Sign in with Solana (SIWS, EIP-4361) standard.
|
|
317
|
+
# You can configure "web3" rate limit in the [auth.rate_limit] section and set up [auth.captcha] if self-hosting.
|
|
318
|
+
[auth.web3.solana]
|
|
319
|
+
enabled = false
|
|
320
|
+
|
|
321
|
+
# Use Firebase Auth as a third-party provider alongside Supabase Auth.
|
|
322
|
+
[auth.third_party.firebase]
|
|
323
|
+
enabled = false
|
|
324
|
+
# project_id = "my-firebase-project"
|
|
325
|
+
|
|
326
|
+
# Use Auth0 as a third-party provider alongside Supabase Auth.
|
|
327
|
+
[auth.third_party.auth0]
|
|
328
|
+
enabled = false
|
|
329
|
+
# tenant = "my-auth0-tenant"
|
|
330
|
+
# tenant_region = "us"
|
|
331
|
+
|
|
332
|
+
# Use AWS Cognito (Amplify) as a third-party provider alongside Supabase Auth.
|
|
333
|
+
[auth.third_party.aws_cognito]
|
|
334
|
+
enabled = false
|
|
335
|
+
# user_pool_id = "my-user-pool-id"
|
|
336
|
+
# user_pool_region = "us-east-1"
|
|
337
|
+
|
|
338
|
+
# Use Clerk as a third-party provider alongside Supabase Auth.
|
|
339
|
+
[auth.third_party.clerk]
|
|
340
|
+
enabled = false
|
|
341
|
+
# Obtain from https://clerk.com/setup/supabase
|
|
342
|
+
# domain = "example.clerk.accounts.dev"
|
|
343
|
+
|
|
344
|
+
# OAuth server configuration
|
|
345
|
+
[auth.oauth_server]
|
|
346
|
+
# Enable OAuth server functionality
|
|
347
|
+
enabled = false
|
|
348
|
+
# Path for OAuth consent flow UI
|
|
349
|
+
authorization_url_path = "/oauth/consent"
|
|
350
|
+
# Allow dynamic client registration
|
|
351
|
+
allow_dynamic_registration = false
|
|
352
|
+
|
|
353
|
+
[edge_runtime]
|
|
354
|
+
enabled = true
|
|
355
|
+
# Supported request policies: `oneshot`, `per_worker`.
|
|
356
|
+
# `per_worker` (default) — enables hot reload during local development.
|
|
357
|
+
# `oneshot` — fallback mode if hot reload causes issues (e.g. in large repos or with symlinks).
|
|
358
|
+
policy = "per_worker"
|
|
359
|
+
# Port to attach the Chrome inspector for debugging edge functions.
|
|
360
|
+
inspector_port = 8083
|
|
361
|
+
# The Deno major version to use.
|
|
362
|
+
deno_version = 2
|
|
363
|
+
|
|
364
|
+
# [edge_runtime.secrets]
|
|
365
|
+
# secret_key = "env(SECRET_VALUE)"
|
|
366
|
+
|
|
367
|
+
[analytics]
|
|
368
|
+
enabled = true
|
|
369
|
+
port = 54337
|
|
370
|
+
# Configure one of the supported backends: `postgres`, `bigquery`.
|
|
371
|
+
backend = "postgres"
|
|
372
|
+
|
|
373
|
+
# Experimental features may be deprecated any time
|
|
374
|
+
[experimental]
|
|
375
|
+
# Configures Postgres storage engine to use OrioleDB (S3)
|
|
376
|
+
orioledb_version = ""
|
|
377
|
+
# Configures S3 bucket URL, eg. <bucket_name>.s3-<region>.amazonaws.com
|
|
378
|
+
s3_host = "env(S3_HOST)"
|
|
379
|
+
# Configures S3 bucket region, eg. us-east-1
|
|
380
|
+
s3_region = "env(S3_REGION)"
|
|
381
|
+
# Configures AWS_ACCESS_KEY_ID for S3 bucket
|
|
382
|
+
s3_access_key = "env(S3_ACCESS_KEY)"
|
|
383
|
+
# Configures AWS_SECRET_ACCESS_KEY for S3 bucket
|
|
384
|
+
s3_secret_key = "env(S3_SECRET_KEY)"
|
|
@@ -0,0 +1,203 @@
|
|
|
1
|
+
-- meet-the-one.ai — Supabase schema
|
|
2
|
+
-- Run this in Supabase SQL editor (or via supabase db push)
|
|
3
|
+
|
|
4
|
+
-- ─── Extensions ───────────────────────────────────────────────────────────────
|
|
5
|
+
create extension if not exists vector;
|
|
6
|
+
|
|
7
|
+
-- ─── users ────────────────────────────────────────────────────────────────────
|
|
8
|
+
create table if not exists users (
|
|
9
|
+
id uuid primary key default gen_random_uuid(),
|
|
10
|
+
phone text unique not null, -- E.164
|
|
11
|
+
brand text not null default 'flagship',
|
|
12
|
+
created_at timestamptz not null default now(),
|
|
13
|
+
last_active timestamptz
|
|
14
|
+
);
|
|
15
|
+
|
|
16
|
+
create index if not exists users_phone_idx on users (phone);
|
|
17
|
+
|
|
18
|
+
-- ─── sessions ─────────────────────────────────────────────────────────────────
|
|
19
|
+
create table if not exists sessions (
|
|
20
|
+
id uuid primary key default gen_random_uuid(),
|
|
21
|
+
user_id uuid not null references users(id) on delete cascade,
|
|
22
|
+
source text not null check (source in ('vapi','twilio_direct','text')),
|
|
23
|
+
audio_r2_key text, -- null for text sessions
|
|
24
|
+
transcript_r2_key text,
|
|
25
|
+
raw_text text, -- for text submissions
|
|
26
|
+
time_of_day text check (time_of_day in ('morning','afternoon','evening','late_night')),
|
|
27
|
+
duration_seconds int,
|
|
28
|
+
analysis_status text not null default 'pending'
|
|
29
|
+
check (analysis_status in ('pending','processing','complete','error')),
|
|
30
|
+
created_at timestamptz not null default now()
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
create index if not exists sessions_user_idx on sessions (user_id);
|
|
34
|
+
create index if not exists sessions_status_idx on sessions (analysis_status);
|
|
35
|
+
|
|
36
|
+
-- ─── identities ───────────────────────────────────────────────────────────────
|
|
37
|
+
create table if not exists identities (
|
|
38
|
+
id uuid primary key default gen_random_uuid(),
|
|
39
|
+
user_id uuid unique not null references users(id) on delete cascade,
|
|
40
|
+
base_profile jsonb not null default '{}',
|
|
41
|
+
modality_weights jsonb not null default '{}',
|
|
42
|
+
signal_completeness_score float not null default 0,
|
|
43
|
+
session_count int not null default 0,
|
|
44
|
+
ready_for_matching boolean not null default false,
|
|
45
|
+
last_updated timestamptz not null default now()
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
create index if not exists identities_user_idx on identities (user_id);
|
|
49
|
+
create index if not exists identities_ready_idx on identities (ready_for_matching);
|
|
50
|
+
|
|
51
|
+
-- ─── identity_modality_embeddings ─────────────────────────────────────────────
|
|
52
|
+
-- One row per (user, modality) — 3072-dim vector
|
|
53
|
+
create table if not exists identity_modality_embeddings (
|
|
54
|
+
id uuid primary key default gen_random_uuid(),
|
|
55
|
+
user_id uuid not null references users(id) on delete cascade,
|
|
56
|
+
modality text not null,
|
|
57
|
+
embedding vector(1536) not null,
|
|
58
|
+
updated_at timestamptz not null default now(),
|
|
59
|
+
unique (user_id, modality)
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
-- IVFFlat index (1536 dims fits within pgvector 2000-dim limit)
|
|
63
|
+
create index if not exists ime_embedding_idx
|
|
64
|
+
on identity_modality_embeddings
|
|
65
|
+
using ivfflat (embedding vector_cosine_ops)
|
|
66
|
+
with (lists = 100);
|
|
67
|
+
|
|
68
|
+
-- ─── matches ──────────────────────────────────────────────────────────────────
|
|
69
|
+
create table if not exists matches (
|
|
70
|
+
id uuid primary key default gen_random_uuid(),
|
|
71
|
+
user_a_id uuid not null references users(id),
|
|
72
|
+
user_b_id uuid not null references users(id),
|
|
73
|
+
primary_modality text not null,
|
|
74
|
+
cross_modality boolean not null default false,
|
|
75
|
+
cross_modality_bridge text,
|
|
76
|
+
confidence_score float not null,
|
|
77
|
+
resonances jsonb,
|
|
78
|
+
tensions jsonb,
|
|
79
|
+
tension_fatal boolean not null default false,
|
|
80
|
+
consent_call_framing text,
|
|
81
|
+
status text not null default 'pending_consent'
|
|
82
|
+
check (status in ('pending_consent','a_accepted','b_accepted','both_accepted','a_declined','b_declined','introduced','expired')),
|
|
83
|
+
created_at timestamptz not null default now(),
|
|
84
|
+
updated_at timestamptz not null default now()
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
create index if not exists matches_user_a_idx on matches (user_a_id);
|
|
88
|
+
create index if not exists matches_user_b_idx on matches (user_b_id);
|
|
89
|
+
create index if not exists matches_status_idx on matches (status);
|
|
90
|
+
|
|
91
|
+
-- ─── declined_pairs ───────────────────────────────────────────────────────────
|
|
92
|
+
create table if not exists declined_pairs (
|
|
93
|
+
id uuid primary key default gen_random_uuid(),
|
|
94
|
+
user_a_id uuid not null references users(id),
|
|
95
|
+
user_b_id uuid not null references users(id),
|
|
96
|
+
declined_by uuid not null references users(id),
|
|
97
|
+
reason text,
|
|
98
|
+
created_at timestamptz not null default now(),
|
|
99
|
+
unique (user_a_id, user_b_id)
|
|
100
|
+
);
|
|
101
|
+
|
|
102
|
+
-- ─── RPC: upsert_modality_embedding ──────────────────────────────────────────
|
|
103
|
+
create or replace function upsert_modality_embedding(
|
|
104
|
+
p_user_id uuid,
|
|
105
|
+
p_modality text,
|
|
106
|
+
p_embedding vector(1536)
|
|
107
|
+
)
|
|
108
|
+
returns void
|
|
109
|
+
language plpgsql
|
|
110
|
+
as $$
|
|
111
|
+
begin
|
|
112
|
+
insert into identity_modality_embeddings (user_id, modality, embedding, updated_at)
|
|
113
|
+
values (p_user_id, p_modality, p_embedding, now())
|
|
114
|
+
on conflict (user_id, modality)
|
|
115
|
+
do update set
|
|
116
|
+
embedding = excluded.embedding,
|
|
117
|
+
updated_at = now();
|
|
118
|
+
end;
|
|
119
|
+
$$;
|
|
120
|
+
|
|
121
|
+
-- ─── RPC: match_identities (global cosine search) ────────────────────────────
|
|
122
|
+
create or replace function match_identities(
|
|
123
|
+
p_user_id uuid,
|
|
124
|
+
p_modality text,
|
|
125
|
+
p_embedding vector(1536),
|
|
126
|
+
p_limit int default 50
|
|
127
|
+
)
|
|
128
|
+
returns table (
|
|
129
|
+
user_id uuid,
|
|
130
|
+
modality text,
|
|
131
|
+
similarity float
|
|
132
|
+
)
|
|
133
|
+
language plpgsql
|
|
134
|
+
as $$
|
|
135
|
+
begin
|
|
136
|
+
return query
|
|
137
|
+
select
|
|
138
|
+
ime.user_id,
|
|
139
|
+
ime.modality,
|
|
140
|
+
1 - (ime.embedding <=> p_embedding) as similarity
|
|
141
|
+
from identity_modality_embeddings ime
|
|
142
|
+
join identities i on i.user_id = ime.user_id
|
|
143
|
+
where
|
|
144
|
+
ime.user_id <> p_user_id
|
|
145
|
+
and ime.modality = p_modality
|
|
146
|
+
and i.ready_for_matching = true
|
|
147
|
+
order by ime.embedding <=> p_embedding
|
|
148
|
+
limit p_limit;
|
|
149
|
+
end;
|
|
150
|
+
$$;
|
|
151
|
+
|
|
152
|
+
-- ─── RPC: match_identities_by_modality (multi-modality) ──────────────────────
|
|
153
|
+
create or replace function match_identities_by_modality(
|
|
154
|
+
p_user_id uuid,
|
|
155
|
+
p_embeddings jsonb, -- {"long_term": [...], "casual": [...], ...}
|
|
156
|
+
p_limit int default 50
|
|
157
|
+
)
|
|
158
|
+
returns table (
|
|
159
|
+
user_id uuid,
|
|
160
|
+
best_modality text,
|
|
161
|
+
best_similarity float
|
|
162
|
+
)
|
|
163
|
+
language plpgsql
|
|
164
|
+
as $$
|
|
165
|
+
declare
|
|
166
|
+
modality_key text;
|
|
167
|
+
emb vector(1536);
|
|
168
|
+
begin
|
|
169
|
+
create temp table _scores (
|
|
170
|
+
user_id uuid,
|
|
171
|
+
modality text,
|
|
172
|
+
similarity float
|
|
173
|
+
) on commit drop;
|
|
174
|
+
|
|
175
|
+
for modality_key in select jsonb_object_keys(p_embeddings)
|
|
176
|
+
loop
|
|
177
|
+
emb := (select array_agg(v::float)::vector(1536)
|
|
178
|
+
from jsonb_array_elements_text(p_embeddings->modality_key) as v);
|
|
179
|
+
|
|
180
|
+
insert into _scores
|
|
181
|
+
select
|
|
182
|
+
ime.user_id,
|
|
183
|
+
ime.modality,
|
|
184
|
+
1 - (ime.embedding <=> emb)
|
|
185
|
+
from identity_modality_embeddings ime
|
|
186
|
+
join identities i on i.user_id = ime.user_id
|
|
187
|
+
where
|
|
188
|
+
ime.user_id <> p_user_id
|
|
189
|
+
and ime.modality = modality_key
|
|
190
|
+
and i.ready_for_matching = true
|
|
191
|
+
order by ime.embedding <=> emb
|
|
192
|
+
limit p_limit;
|
|
193
|
+
end loop;
|
|
194
|
+
|
|
195
|
+
return query
|
|
196
|
+
select distinct on (s.user_id)
|
|
197
|
+
s.user_id,
|
|
198
|
+
s.modality as best_modality,
|
|
199
|
+
s.similarity as best_similarity
|
|
200
|
+
from _scores s
|
|
201
|
+
order by s.user_id, s.similarity desc;
|
|
202
|
+
end;
|
|
203
|
+
$$;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
-- user_brand_consents — tracks per-brand opt-in for identity sharing
|
|
2
|
+
create table if not exists user_brand_consents (
|
|
3
|
+
id uuid primary key default gen_random_uuid(),
|
|
4
|
+
user_id uuid not null references users(id) on delete cascade,
|
|
5
|
+
brand text not null,
|
|
6
|
+
consented boolean not null default true,
|
|
7
|
+
consented_at timestamptz not null default now(),
|
|
8
|
+
revoked_at timestamptz,
|
|
9
|
+
unique (user_id, brand)
|
|
10
|
+
);
|
|
11
|
+
|
|
12
|
+
create index if not exists ubc_user_idx on user_brand_consents (user_id);
|
|
13
|
+
create index if not exists ubc_brand_idx on user_brand_consents (brand);
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2022",
|
|
4
|
+
"module": "NodeNext",
|
|
5
|
+
"moduleResolution": "NodeNext",
|
|
6
|
+
"lib": ["ES2022"],
|
|
7
|
+
"outDir": "./dist",
|
|
8
|
+
"rootDir": "./src",
|
|
9
|
+
"strict": true,
|
|
10
|
+
"esModuleInterop": true,
|
|
11
|
+
"skipLibCheck": true,
|
|
12
|
+
"forceConsistentCasingInFileNames": true,
|
|
13
|
+
"resolveJsonModule": true,
|
|
14
|
+
"declaration": true,
|
|
15
|
+
"declarationMap": true,
|
|
16
|
+
"sourceMap": true
|
|
17
|
+
},
|
|
18
|
+
"include": [
|
|
19
|
+
"src/index.ts",
|
|
20
|
+
"src/bot.ts",
|
|
21
|
+
"src/agent.ts",
|
|
22
|
+
"src/mcp-server.ts"
|
|
23
|
+
],
|
|
24
|
+
"exclude": ["node_modules", "dist"]
|
|
25
|
+
}
|