@intelligo-dev/core 1.0.0-beta.1 → 1.0.0-beta.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (356) hide show
  1. package/NOTICE +6 -0
  2. package/README.md +102 -0
  3. package/dist/attachments/errors.d.ts +7 -0
  4. package/dist/attachments/errors.d.ts.map +1 -0
  5. package/dist/attachments/errors.js +11 -0
  6. package/dist/attachments/errors.js.map +1 -0
  7. package/dist/attachments/index.d.ts +8 -0
  8. package/dist/attachments/index.d.ts.map +1 -0
  9. package/dist/attachments/index.js +7 -0
  10. package/dist/attachments/index.js.map +1 -0
  11. package/dist/attachments/service.d.ts +45 -0
  12. package/dist/attachments/service.d.ts.map +1 -0
  13. package/dist/attachments/service.js +100 -0
  14. package/dist/attachments/service.js.map +1 -0
  15. package/dist/attachments/types.d.ts +6 -0
  16. package/dist/attachments/types.d.ts.map +1 -0
  17. package/dist/attachments/types.js +2 -0
  18. package/dist/attachments/types.js.map +1 -0
  19. package/dist/conversations/errors.d.ts +2 -8
  20. package/dist/conversations/errors.d.ts.map +1 -1
  21. package/dist/conversations/errors.js +2 -8
  22. package/dist/conversations/errors.js.map +1 -1
  23. package/dist/conversations/index.d.ts +4 -12
  24. package/dist/conversations/index.d.ts.map +1 -1
  25. package/dist/conversations/index.js +2 -11
  26. package/dist/conversations/index.js.map +1 -1
  27. package/dist/conversations/service.d.ts +49 -61
  28. package/dist/conversations/service.d.ts.map +1 -1
  29. package/dist/conversations/service.js +110 -83
  30. package/dist/conversations/service.js.map +1 -1
  31. package/dist/conversations/types.d.ts +1 -4
  32. package/dist/conversations/types.d.ts.map +1 -1
  33. package/dist/conversations/types.js +0 -3
  34. package/dist/conversations/types.js.map +1 -1
  35. package/dist/db/client.d.ts +21 -10
  36. package/dist/db/client.d.ts.map +1 -1
  37. package/dist/db/client.js +43 -18
  38. package/dist/db/client.js.map +1 -1
  39. package/dist/db/index.d.ts +3 -3
  40. package/dist/db/index.d.ts.map +1 -1
  41. package/dist/db/index.js +3 -7
  42. package/dist/db/index.js.map +1 -1
  43. package/dist/db/schema/agents.d.ts +14 -51
  44. package/dist/db/schema/agents.d.ts.map +1 -1
  45. package/dist/db/schema/agents.js +9 -21
  46. package/dist/db/schema/agents.js.map +1 -1
  47. package/dist/db/schema/ai.d.ts +86 -1556
  48. package/dist/db/schema/ai.d.ts.map +1 -1
  49. package/dist/db/schema/ai.js +32 -236
  50. package/dist/db/schema/ai.js.map +1 -1
  51. package/dist/db/schema/auth.d.ts +5 -34
  52. package/dist/db/schema/auth.d.ts.map +1 -1
  53. package/dist/db/schema/auth.js +25 -56
  54. package/dist/db/schema/auth.js.map +1 -1
  55. package/dist/db/schema/billing.d.ts +339 -105
  56. package/dist/db/schema/billing.d.ts.map +1 -1
  57. package/dist/db/schema/billing.js +99 -58
  58. package/dist/db/schema/billing.js.map +1 -1
  59. package/dist/db/schema/feature-flags.d.ts +3 -12
  60. package/dist/db/schema/feature-flags.d.ts.map +1 -1
  61. package/dist/db/schema/feature-flags.js +3 -12
  62. package/dist/db/schema/feature-flags.js.map +1 -1
  63. package/dist/db/schema/identity.d.ts +12 -274
  64. package/dist/db/schema/identity.d.ts.map +1 -1
  65. package/dist/db/schema/identity.js +19 -104
  66. package/dist/db/schema/identity.js.map +1 -1
  67. package/dist/db/schema/index.d.ts +8 -15
  68. package/dist/db/schema/index.d.ts.map +1 -1
  69. package/dist/db/schema/index.js +12 -42
  70. package/dist/db/schema/index.js.map +1 -1
  71. package/dist/db/schema/notifications.d.ts +3 -17
  72. package/dist/db/schema/notifications.d.ts.map +1 -1
  73. package/dist/db/schema/notifications.js +3 -17
  74. package/dist/db/schema/notifications.js.map +1 -1
  75. package/dist/db/schema/usage.d.ts +94 -77
  76. package/dist/db/schema/usage.d.ts.map +1 -1
  77. package/dist/db/schema/usage.js +59 -89
  78. package/dist/db/schema/usage.js.map +1 -1
  79. package/dist/db/validate.d.ts +2 -11
  80. package/dist/db/validate.d.ts.map +1 -1
  81. package/dist/db/validate.js +6 -17
  82. package/dist/db/validate.js.map +1 -1
  83. package/dist/db/workspace-queries.d.ts +5 -29
  84. package/dist/db/workspace-queries.d.ts.map +1 -1
  85. package/dist/db/workspace-queries.js +5 -29
  86. package/dist/db/workspace-queries.js.map +1 -1
  87. package/dist/documents/classifier.d.ts +5 -12
  88. package/dist/documents/classifier.d.ts.map +1 -1
  89. package/dist/documents/classifier.js +16 -16
  90. package/dist/documents/classifier.js.map +1 -1
  91. package/dist/documents/errors.d.ts +2 -10
  92. package/dist/documents/errors.d.ts.map +1 -1
  93. package/dist/documents/errors.js +2 -10
  94. package/dist/documents/errors.js.map +1 -1
  95. package/dist/documents/index.d.ts +4 -13
  96. package/dist/documents/index.d.ts.map +1 -1
  97. package/dist/documents/index.js +3 -12
  98. package/dist/documents/index.js.map +1 -1
  99. package/dist/documents/service.d.ts +19 -26
  100. package/dist/documents/service.d.ts.map +1 -1
  101. package/dist/documents/service.js +44 -38
  102. package/dist/documents/service.js.map +1 -1
  103. package/dist/documents/types.d.ts +6 -10
  104. package/dist/documents/types.d.ts.map +1 -1
  105. package/dist/documents/types.js +0 -3
  106. package/dist/documents/types.js.map +1 -1
  107. package/dist/email/brand.d.ts +17 -0
  108. package/dist/email/brand.d.ts.map +1 -0
  109. package/dist/email/brand.js +9 -0
  110. package/dist/email/brand.js.map +1 -0
  111. package/dist/email/index.d.ts +4 -4
  112. package/dist/email/index.js +4 -4
  113. package/dist/email/provider.d.ts +1 -7
  114. package/dist/email/provider.d.ts.map +1 -1
  115. package/dist/email/provider.js +10 -19
  116. package/dist/email/provider.js.map +1 -1
  117. package/dist/email/send.d.ts +12 -12
  118. package/dist/email/send.d.ts.map +1 -1
  119. package/dist/email/send.js +5 -19
  120. package/dist/email/send.js.map +1 -1
  121. package/dist/email/senders.d.ts +17 -30
  122. package/dist/email/senders.d.ts.map +1 -1
  123. package/dist/email/senders.js +33 -47
  124. package/dist/email/senders.js.map +1 -1
  125. package/dist/email/templates/base-layout.d.ts +1 -1
  126. package/dist/email/templates/base-layout.d.ts.map +1 -1
  127. package/dist/email/templates/base-layout.js +4 -6
  128. package/dist/email/templates/base-layout.js.map +1 -1
  129. package/dist/email/templates/index.d.ts +10 -10
  130. package/dist/email/templates/index.d.ts.map +1 -1
  131. package/dist/email/templates/index.js +10 -16
  132. package/dist/email/templates/index.js.map +1 -1
  133. package/dist/email/templates/password-reset.d.ts +2 -2
  134. package/dist/email/templates/password-reset.d.ts.map +1 -1
  135. package/dist/email/templates/password-reset.js +10 -22
  136. package/dist/email/templates/password-reset.js.map +1 -1
  137. package/dist/email/templates/payment-failed.d.ts +2 -2
  138. package/dist/email/templates/payment-failed.d.ts.map +1 -1
  139. package/dist/email/templates/payment-failed.js +11 -24
  140. package/dist/email/templates/payment-failed.js.map +1 -1
  141. package/dist/email/templates/quota-warning.d.ts +4 -4
  142. package/dist/email/templates/quota-warning.d.ts.map +1 -1
  143. package/dist/email/templates/quota-warning.js +19 -39
  144. package/dist/email/templates/quota-warning.js.map +1 -1
  145. package/dist/email/templates/subscription-confirmed.d.ts +2 -2
  146. package/dist/email/templates/subscription-confirmed.d.ts.map +1 -1
  147. package/dist/email/templates/subscription-confirmed.js +13 -28
  148. package/dist/email/templates/subscription-confirmed.js.map +1 -1
  149. package/dist/email/templates/trial-expiry.d.ts +2 -2
  150. package/dist/email/templates/trial-expiry.d.ts.map +1 -1
  151. package/dist/email/templates/trial-expiry.js +12 -36
  152. package/dist/email/templates/trial-expiry.js.map +1 -1
  153. package/dist/email/templates/trial-warning.d.ts +2 -2
  154. package/dist/email/templates/trial-warning.d.ts.map +1 -1
  155. package/dist/email/templates/trial-warning.js +15 -32
  156. package/dist/email/templates/trial-warning.js.map +1 -1
  157. package/dist/email/templates/verify-email.d.ts +2 -2
  158. package/dist/email/templates/verify-email.d.ts.map +1 -1
  159. package/dist/email/templates/verify-email.js +10 -22
  160. package/dist/email/templates/verify-email.js.map +1 -1
  161. package/dist/email/templates/welcome.d.ts +2 -2
  162. package/dist/email/templates/welcome.d.ts.map +1 -1
  163. package/dist/email/templates/welcome.js +13 -20
  164. package/dist/email/templates/welcome.js.map +1 -1
  165. package/dist/email/templates/workspace-invitation.d.ts +2 -2
  166. package/dist/email/templates/workspace-invitation.d.ts.map +1 -1
  167. package/dist/email/templates/workspace-invitation.js +12 -26
  168. package/dist/email/templates/workspace-invitation.js.map +1 -1
  169. package/dist/env.d.ts +5 -10
  170. package/dist/env.d.ts.map +1 -1
  171. package/dist/env.js +41 -31
  172. package/dist/env.js.map +1 -1
  173. package/dist/identity/audit.d.ts +11 -24
  174. package/dist/identity/audit.d.ts.map +1 -1
  175. package/dist/identity/audit.js +13 -27
  176. package/dist/identity/audit.js.map +1 -1
  177. package/dist/identity/errors.d.ts +4 -12
  178. package/dist/identity/errors.d.ts.map +1 -1
  179. package/dist/identity/errors.js +2 -8
  180. package/dist/identity/errors.js.map +1 -1
  181. package/dist/identity/index.d.ts +6 -13
  182. package/dist/identity/index.d.ts.map +1 -1
  183. package/dist/identity/index.js +5 -12
  184. package/dist/identity/index.js.map +1 -1
  185. package/dist/identity/service.d.ts +29 -47
  186. package/dist/identity/service.d.ts.map +1 -1
  187. package/dist/identity/service.js +107 -79
  188. package/dist/identity/service.js.map +1 -1
  189. package/dist/identity/types.d.ts +28 -4
  190. package/dist/identity/types.d.ts.map +1 -1
  191. package/dist/identity/types.js +0 -3
  192. package/dist/identity/types.js.map +1 -1
  193. package/dist/index.d.ts +1 -2
  194. package/dist/index.d.ts.map +1 -1
  195. package/dist/index.js +3 -10
  196. package/dist/index.js.map +1 -1
  197. package/dist/logger.d.ts +7 -18
  198. package/dist/logger.d.ts.map +1 -1
  199. package/dist/logger.js +45 -49
  200. package/dist/logger.js.map +1 -1
  201. package/dist/money.d.ts +95 -0
  202. package/dist/money.d.ts.map +1 -0
  203. package/dist/money.js +208 -0
  204. package/dist/money.js.map +1 -0
  205. package/dist/notifications/index.d.ts +9 -43
  206. package/dist/notifications/index.d.ts.map +1 -1
  207. package/dist/notifications/index.js +9 -49
  208. package/dist/notifications/index.js.map +1 -1
  209. package/dist/notifications/triggers.d.ts +9 -32
  210. package/dist/notifications/triggers.d.ts.map +1 -1
  211. package/dist/notifications/triggers.js +21 -58
  212. package/dist/notifications/triggers.js.map +1 -1
  213. package/dist/notifications/types.d.ts +6 -8
  214. package/dist/notifications/types.d.ts.map +1 -1
  215. package/dist/notifications/types.js +0 -9
  216. package/dist/notifications/types.js.map +1 -1
  217. package/dist/prompt.d.ts +38 -0
  218. package/dist/prompt.d.ts.map +1 -0
  219. package/dist/prompt.js +118 -0
  220. package/dist/prompt.js.map +1 -0
  221. package/dist/registry.d.ts +32 -0
  222. package/dist/registry.d.ts.map +1 -0
  223. package/dist/registry.js +60 -0
  224. package/dist/registry.js.map +1 -0
  225. package/dist/request-context.d.ts +49 -0
  226. package/dist/request-context.d.ts.map +1 -0
  227. package/dist/request-context.js +100 -0
  228. package/dist/request-context.js.map +1 -0
  229. package/dist/storage/index.d.ts +65 -0
  230. package/dist/storage/index.d.ts.map +1 -0
  231. package/dist/storage/index.js +109 -0
  232. package/dist/storage/index.js.map +1 -0
  233. package/package.json +74 -24
  234. package/src/attachments/errors.ts +18 -0
  235. package/src/attachments/index.ts +22 -0
  236. package/src/attachments/service.ts +178 -0
  237. package/src/attachments/types.ts +6 -0
  238. package/src/conversations/errors.ts +45 -0
  239. package/src/conversations/index.ts +39 -0
  240. package/src/conversations/service.ts +594 -0
  241. package/src/conversations/types.ts +15 -0
  242. package/src/db/client.ts +91 -0
  243. package/src/db/index.ts +3 -0
  244. package/src/db/migrations/0000_baseline.sql +652 -0
  245. package/src/db/migrations/0001_reconcile_chain_built_databases.sql +53 -0
  246. package/src/db/migrations/0002_webhook_claim_lease.sql +1 -0
  247. package/src/db/migrations/0003_local_payments.sql +18 -0
  248. package/src/db/migrations/README.md +103 -36
  249. package/src/db/migrations/legacy-chain.json +206 -0
  250. package/src/db/migrations/meta/0000_snapshot.json +4182 -157
  251. package/src/db/migrations/meta/0002_snapshot.json +2478 -368
  252. package/src/db/migrations/meta/0003_snapshot.json +2567 -554
  253. package/src/db/migrations/meta/_journal.json +8 -274
  254. package/src/db/schema/agents.ts +57 -0
  255. package/src/db/schema/ai.ts +174 -0
  256. package/src/db/schema/auth.ts +183 -0
  257. package/src/db/schema/billing.ts +245 -0
  258. package/src/db/schema/feature-flags.ts +20 -0
  259. package/src/db/schema/identity.ts +250 -0
  260. package/src/db/schema/index.ts +12 -0
  261. package/src/db/schema/notifications.ts +31 -0
  262. package/src/db/schema/usage.ts +269 -0
  263. package/src/db/validate.ts +63 -0
  264. package/src/db/workspace-queries.ts +64 -0
  265. package/src/documents/classifier.ts +61 -0
  266. package/src/documents/errors.ts +44 -0
  267. package/src/documents/index.ts +24 -0
  268. package/src/documents/service.ts +256 -0
  269. package/src/documents/types.ts +24 -0
  270. package/src/email/brand.ts +24 -0
  271. package/src/email/index.ts +19 -0
  272. package/src/email/provider.ts +278 -0
  273. package/src/email/send.ts +169 -0
  274. package/src/email/senders.ts +292 -0
  275. package/src/email/templates/base-layout.tsx +145 -0
  276. package/src/email/templates/index.ts +28 -0
  277. package/src/email/templates/password-reset.tsx +72 -0
  278. package/src/email/templates/payment-failed.tsx +77 -0
  279. package/src/email/templates/quota-warning.tsx +118 -0
  280. package/src/email/templates/subscription-confirmed.tsx +91 -0
  281. package/src/email/templates/trial-expiry.tsx +124 -0
  282. package/src/email/templates/trial-warning.tsx +104 -0
  283. package/src/email/templates/verify-email.tsx +72 -0
  284. package/src/email/templates/welcome.tsx +64 -0
  285. package/src/email/templates/workspace-invitation.tsx +105 -0
  286. package/src/env.ts +180 -0
  287. package/src/identity/audit.ts +65 -0
  288. package/src/identity/errors.ts +44 -0
  289. package/src/identity/index.ts +29 -0
  290. package/src/identity/service.ts +303 -0
  291. package/src/identity/types.ts +58 -0
  292. package/src/index.ts +4 -0
  293. package/src/logger.ts +198 -0
  294. package/src/money.ts +270 -0
  295. package/src/notifications/index.ts +112 -0
  296. package/src/notifications/triggers.ts +158 -0
  297. package/src/notifications/types.ts +26 -0
  298. package/src/prompt.ts +142 -0
  299. package/src/registry.ts +75 -0
  300. package/src/request-context.ts +137 -0
  301. package/src/storage/index.ts +153 -0
  302. package/dist/db/schema/rag.d.ts +0 -171
  303. package/dist/db/schema/rag.d.ts.map +0 -1
  304. package/dist/db/schema/rag.js +0 -42
  305. package/dist/db/schema/rag.js.map +0 -1
  306. package/src/db/migrations/0000_sharp_night_nurse.sql +0 -52
  307. package/src/db/migrations/0001_hesitant_vapor.sql +0 -40
  308. package/src/db/migrations/0002_numerous_lady_vermin.sql +0 -235
  309. package/src/db/migrations/0003_mighty_jean_grey.sql +0 -37
  310. package/src/db/migrations/0004_cynical_grandmaster.sql +0 -2
  311. package/src/db/migrations/0005_careful_switch.sql +0 -8
  312. package/src/db/migrations/0006_tense_blue_marvel.sql +0 -16
  313. package/src/db/migrations/0007_next_squadron_sinister.sql +0 -1
  314. package/src/db/migrations/0008_powerful_scream.sql +0 -39
  315. package/src/db/migrations/0009_sad_ink.sql +0 -1
  316. package/src/db/migrations/0010_shocking_omega_flight.sql +0 -2
  317. package/src/db/migrations/0011_ambiguous_otto_octavius.sql +0 -151
  318. package/src/db/migrations/0011_hnsw_vector_index.sql +0 -17
  319. package/src/db/migrations/0012_user_profiles.sql +0 -30
  320. package/src/db/migrations/0013_trending_seasonal_columns.sql +0 -9
  321. package/src/db/migrations/0014_add_product_type_to_agents.sql +0 -6
  322. package/src/db/migrations/0015_new_v1_tables.sql +0 -149
  323. package/src/db/migrations/0016_document_types.sql +0 -30
  324. package/src/db/migrations/0017_document_metadata.sql +0 -2
  325. package/src/db/migrations/0018_identity_graph.sql +0 -200
  326. package/src/db/migrations/0019_db_driven_prompts.sql +0 -20
  327. package/src/db/migrations/0020_pending_extractions.sql +0 -35
  328. package/src/db/migrations/0021_rag_documents.sql +0 -39
  329. package/src/db/migrations/0022_user_quotas_usage_jsonb.sql +0 -70
  330. package/src/db/migrations/0023_user_facts_user_scoped_unique.sql +0 -17
  331. package/src/db/migrations/0024_user_memories_hnsw.sql +0 -23
  332. package/src/db/migrations/0025_audit_trigger_errcode.sql +0 -21
  333. package/src/db/migrations/0026_user_profile_snapshots_composite_pk.sql +0 -17
  334. package/src/db/migrations/0027_billing_settings_mnt_columns.sql +0 -54
  335. package/src/db/migrations/0028_trial_credits_normalized_email.sql +0 -37
  336. package/src/db/migrations/0029_usage_records_conversation_idx.sql +0 -13
  337. package/src/db/migrations/0030_pending_extractions_composite_idx.sql +0 -11
  338. package/src/db/migrations/0031_rag_documents_hnsw.sql +0 -16
  339. package/src/db/migrations/0032_rate_limit_unique_idx.sql +0 -16
  340. package/src/db/migrations/0033_pending_extractions_partial_idx.sql +0 -18
  341. package/src/db/migrations/0034_rate_limit_count.sql +0 -9
  342. package/src/db/migrations/0035_credit_reservations.sql +0 -24
  343. package/src/db/migrations/0036_executions_audit_jobs.sql +0 -96
  344. package/src/db/migrations/0037_rate_limit_minute_bucket.sql +0 -46
  345. package/src/db/migrations/0038_user_quotas_generic_usage.sql +0 -25
  346. package/src/db/migrations/0039_platform_admin_impersonation.sql +0 -27
  347. package/src/db/migrations/0040_ee_audit_chain.sql +0 -23
  348. package/src/db/migrations/meta/0001_snapshot.json +0 -631
  349. package/src/db/migrations/meta/0004_snapshot.json +0 -2500
  350. package/src/db/migrations/meta/0005_snapshot.json +0 -2548
  351. package/src/db/migrations/meta/0006_snapshot.json +0 -2650
  352. package/src/db/migrations/meta/0007_snapshot.json +0 -2657
  353. package/src/db/migrations/meta/0008_snapshot.json +0 -2719
  354. package/src/db/migrations/meta/0009_snapshot.json +0 -2726
  355. package/src/db/migrations/meta/0010_snapshot.json +0 -2739
  356. package/src/db/migrations/meta/0011_snapshot.json +0 -3886
@@ -1,40 +1,22 @@
1
1
  /**
2
- * User Identity Graph Schema (AI-ARCHITECTURE Phase B)
2
+ * The user identity graph: a user's facts, episodic memories and audit
3
+ * trail, synthesized into one profile snapshot an agent session reads in
4
+ * one query.
3
5
  *
4
- * Platform-level memory primitive — separate from any single product. The
5
- * four tables below turn a user's scattered signals (facts, episodic
6
- * memories, audit trails) into a single synthesized profile snapshot that
7
- * every agent session hydrates from in one DB read.
8
- *
9
- * Why four tables instead of a JSON blob:
10
- * 1. `user_facts` is the structured source of truth — queryable by
11
- * category and weightable by confidence / importance.
12
- * 2. `user_memories` is the unstructured narrative surface — pgvector
13
- * search for episodic recall during long-running conversations.
14
- * 3. `user_profile_snapshots` is the cached synthesis layer — voice
15
- * agents can't afford to rebuild the profile at the top of every
16
- * turn (<500ms budget), so we pre-render to this table and refresh
17
- * on trigger events (session close, fact threshold, daily cron).
18
- * 4. `user_memory_audit` is the trust layer — every write is logged
19
- * so the "My Memory" settings page can show provenance per fact.
20
- *
21
- * See docs/AI-ARCHITECTURE.md §2 for the full design.
22
- *
23
- * Migration: src/db/migrations/0018_identity_graph.sql creates all four
24
- * tables, their indexes, and the append-only triggers on
25
- * user_memory_audit. Apply via `pnpm --filter @intelligo-dev/core db:push`
26
- * before any code path calls into @intelligo-dev/agents/memory.
6
+ * - `user_facts`: the structured source of truth, queryable by category
7
+ * and weighted by confidence and importance.
8
+ * - `user_memories`: unstructured episodic recall via pgvector search.
9
+ * - `user_profile_snapshots`: the cached synthesis, since voice agents
10
+ * cannot rebuild the profile inside a turn's latency budget.
11
+ * - `user_memory_audit`: append-only log of every write, so a user can see
12
+ * where each fact came from.
27
13
  */
28
14
  import { pgTable, primaryKey, text, timestamp, integer, index, uniqueIndex, jsonb, doublePrecision, } from "drizzle-orm/pg-core";
29
15
  import { vector } from "drizzle-orm/pg-core/columns/vector_extension/vector";
30
- import { organization, users } from "./auth";
31
- // ---------------------------------------------------------------------------
32
- // 1. user_facts — structured, evidence-backed facts
33
- // ---------------------------------------------------------------------------
16
+ import { organization, users } from "./auth.js";
34
17
  /**
35
- * Discriminated category for a fact. Used as a filter axis when querying
36
- * facts for synthesis or display. Keep this list tight — adding a new
37
- * category should be a product decision, not a free-form string.
18
+ * A fact's category, the filter axis for synthesis and display. A closed
19
+ * list on purpose: a new category is a decision, not a free-form string.
38
20
  */
39
21
  export const USER_FACT_CATEGORIES = [
40
22
  "interest",
@@ -82,14 +64,10 @@ export const userFacts = pgTable("user_facts", {
82
64
  index("user_facts_user_idx").on(table.userId),
83
65
  index("user_facts_workspace_idx").on(table.workspaceId),
84
66
  index("user_facts_category_idx").on(table.workspaceId, table.category),
85
- // Uniqueness is scoped to (user, workspace, category, key) — a shared
86
- // workspace (e.g. a family or classroom org) can hold the same fact
87
- // key for multiple members without collision.
67
+ // Scoped to (user, workspace, category, key) so members of a shared
68
+ // workspace can hold the same fact key without collision.
88
69
  uniqueIndex("user_facts_user_workspace_category_key_uniq").on(table.userId, table.workspaceId, table.category, table.key),
89
70
  ]);
90
- // ---------------------------------------------------------------------------
91
- // 2. user_memories — episodic, semantic recall via pgvector
92
- // ---------------------------------------------------------------------------
93
71
  export const USER_MEMORY_KINDS = [
94
72
  "conversation_summary",
95
73
  "event",
@@ -121,12 +99,9 @@ export const userMemories = pgTable("user_memories", {
121
99
  index("user_memories_user_idx").on(table.userId),
122
100
  index("user_memories_workspace_idx").on(table.workspaceId),
123
101
  index("user_memories_kind_idx").on(table.workspaceId, table.kind),
124
- // pgvector IVFFlat / HNSW index is added in the migration SQL because
125
- // drizzle-orm doesn't expose the syntax natively.
102
+ // The pgvector index is created in migration SQL: drizzle-orm cannot
103
+ // express it.
126
104
  ]);
127
- // ---------------------------------------------------------------------------
128
- // 3. user_profile_snapshots — synthesized, fast-read cache
129
- // ---------------------------------------------------------------------------
130
105
  export const SYNTHESIS_TRIGGER_REASONS = [
131
106
  "fact_threshold",
132
107
  "session_close",
@@ -153,17 +128,12 @@ export const userProfileSnapshots = pgTable("user_profile_snapshots", {
153
128
  nextSynthesisAt: timestamp("next_synthesis_at"),
154
129
  triggerReason: text("trigger_reason").$type(),
155
130
  },
156
- // Composite PK: a user can have one snapshot per workspace. Scoping
157
- // by workspace matters the moment a user belongs to more than one
158
- // org — e.g. a student in both their family workspace and a
159
- // classroom workspace should get two distinct synthesized profiles.
131
+ // One snapshot per user per workspace: a user in two workspaces gets two
132
+ // distinct profiles.
160
133
  (table) => [
161
134
  primaryKey({ columns: [table.userId, table.workspaceId] }),
162
135
  index("user_profile_snapshots_workspace_idx").on(table.workspaceId),
163
136
  ]);
164
- // ---------------------------------------------------------------------------
165
- // 4. user_memory_audit — privacy + trust audit trail
166
- // ---------------------------------------------------------------------------
167
137
  export const AUDIT_TARGET_KINDS = ["fact", "memory", "snapshot"];
168
138
  export const AUDIT_ACTIONS = [
169
139
  "create",
@@ -200,59 +170,4 @@ export const userMemoryAudit = pgTable("user_memory_audit", {
200
170
  index("user_memory_audit_workspace_idx").on(table.workspaceId),
201
171
  index("user_memory_audit_target_idx").on(table.targetKind, table.targetId),
202
172
  ]);
203
- // ---------------------------------------------------------------------------
204
- // 5. pending_extractions — queue of conversations awaiting fact extraction
205
- // ---------------------------------------------------------------------------
206
- /**
207
- * Background-job queue for fact extraction (Phase F). When a chat
208
- * session ends the chat handler enqueues the conversation id here;
209
- * the worker (packages/agents/src/extraction/worker.ts) polls and
210
- * processes pending rows. Status starts as 'pending', flips to
211
- * 'processing' while the worker holds the row, then 'completed' or
212
- * 'failed' on exit. Failed rows track attempts so we can retry with
213
- * exponential backoff and a hard cap.
214
- *
215
- * Keeping the queue in Postgres rather than Inngest/QStash for now —
216
- * launch traffic is small enough that DB polling is sufficient and
217
- * the doc explicitly calls this out as the V1 design.
218
- */
219
- export const EXTRACTION_STATUSES = [
220
- "pending",
221
- "processing",
222
- "completed",
223
- "failed",
224
- ];
225
- export const pendingExtractions = pgTable("pending_extractions", {
226
- id: text("id").primaryKey(),
227
- conversationId: text("conversation_id").notNull(),
228
- workspaceId: text("workspace_id")
229
- .notNull()
230
- .references(() => organization.id, { onDelete: "cascade" }),
231
- userId: text("user_id")
232
- .notNull()
233
- .references(() => users.id, { onDelete: "cascade" }),
234
- productSlug: text("product_slug").notNull(),
235
- status: text("status")
236
- .$type()
237
- .notNull()
238
- .default("pending"),
239
- attempts: integer("attempts").notNull().default(0),
240
- maxAttempts: integer("max_attempts").notNull().default(3),
241
- lastError: text("last_error"),
242
- nextRetryAt: timestamp("next_retry_at"),
243
- enqueuedAt: timestamp("enqueued_at").notNull().defaultNow(),
244
- startedAt: timestamp("started_at"),
245
- completedAt: timestamp("completed_at"),
246
- }, (table) => [
247
- index("pending_extractions_status_idx").on(table.status),
248
- index("pending_extractions_workspace_idx").on(table.workspaceId),
249
- uniqueIndex("pending_extractions_conversation_uniq").on(table.conversationId),
250
- // Composite index for listPendingExtractions + claimNextExtraction
251
- // queries that filter by (status = 'pending' AND next_retry_at IS NULL / <= now).
252
- // Without this, the OR clause forces a seq scan on status='pending' rows.
253
- index("pending_extractions_status_retry_idx").on(table.status, table.nextRetryAt),
254
- // 0033_pending_extractions_partial_idx.sql adds a partial index
255
- // (workspace_id) WHERE status = 'pending' — used by claimNextExtraction
256
- // and listPendingExtractions for per-workspace queue polling.
257
- ]);
258
173
  //# sourceMappingURL=identity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"identity.js","sourceRoot":"","sources":["../../../src/db/schema/identity.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EACL,OAAO,EACP,UAAU,EACV,IAAI,EACJ,SAAS,EACT,OAAO,EACP,KAAK,EACL,WAAW,EACX,KAAK,EACL,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,MAAM,EAAE,MAAM,qDAAqD,CAAC;AAC7E,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAE7C,8EAA8E;AAC9E,oDAAoD;AACpD,8EAA8E;AAE9E;;;;GAIG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,UAAU;IACV,OAAO;IACP,MAAM;IACN,YAAY;IACZ,OAAO;IACP,OAAO;IACP,YA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EAAE;CAC1D,EACD,CAAC,KAAK,EAAE,EAAE,CAAC;IACT,KAAK,CAAC,4BAA4B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,MAAM,CAAC;IACpD,KAAK,CAAC,iCAAiC,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC;IAC9D,KAAK,CAAC,8BAA8B,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,UAAU,EAAE,KAAK,CAAC,QAAQ,CAAC;CAC3E,CACF,CAAC"}
@@ -1,16 +1,9 @@
1
- /**
2
- * Drizzle Database Schema
3
- *
4
- * Central export point for all database tables.
5
- * This file will be extended in future phases with workspace, billing, and AI schemas.
6
- */
7
- export * from "./auth";
8
- export * from "./billing";
9
- export * from "./usage";
10
- export * from "./notifications";
11
- export * from "./feature-flags";
12
- export * from "./ai";
13
- export * from "./agents";
14
- export * from "./identity";
15
- export * from "./rag";
1
+ export * from "./auth.js";
2
+ export * from "./billing.js";
3
+ export * from "./usage.js";
4
+ export * from "./notifications.js";
5
+ export * from "./feature-flags.js";
6
+ export * from "./ai.js";
7
+ export * from "./agents.js";
8
+ export * from "./identity.js";
16
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/db/schema/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,cAAc,QAAQ,CAAC;AAiBvB,cAAc,WAAW,CAAC;AAG1B,cAAc,SAAS,CAAC;AAGxB,cAAc,iBAAiB,CAAC;AAGhC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,MAAM,CAAC;AAGrB,cAAc,UAAU,CAAC;AAKzB,cAAc,YAAY,CAAC;AAM3B,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/db/schema/index.ts"],"names":[],"mappings":"AAIA,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
@@ -1,43 +1,13 @@
1
- /**
2
- * Drizzle Database Schema
3
- *
4
- * Central export point for all database tables.
5
- * This file will be extended in future phases with workspace, billing, and AI schemas.
6
- */
7
- // Auth tables (Better-Auth managed)
8
- export * from "./auth";
9
- // Organization/Workspace tables are managed by Better-Auth organization plugin (Phase 10)
10
- // Tables: organization, member, invitation (auto-created by plugin on first API use)
11
- // These tables are NOT in our Drizzle schema — Better-Auth manages them directly.
12
- // Access via Better-Auth API: auth.api.listOrganizations(), auth.api.createInvitation(), etc.
13
- //
14
- // Organization plugin indexes (TECH-02 verified pattern):
15
- // Better-Auth's organization plugin creates these indexes automatically:
16
- // - member.organizationId (workspace member lookup)
17
- // - member.userId (user's memberships lookup)
18
- // - invitation.organizationId (workspace invitations lookup)
19
- // - invitation.email (invited email lookup)
20
- // These indexes are created by Better-Auth when tables are auto-created on first use.
21
- // No manual migration needed — plugin handles all schema management.
22
- // Billing tables (Phase 11)
23
- export * from "./billing";
24
- // Usage tracking tables (Phase 12)
25
- export * from "./usage";
26
- // Notification tables (Phase 14)
27
- export * from "./notifications";
28
- // Feature flags (Phase 15)
29
- export * from "./feature-flags";
30
- // AI tables (Phase 16)
31
- export * from "./ai";
32
- // Agents table (Phase 37)
33
- export * from "./agents";
34
- // User Identity Graph (AI-ARCHITECTURE Phase B)
35
- // Four tables that back the cross-product memory system:
36
- // user_facts, user_memories, user_profile_snapshots, user_memory_audit.
37
- export * from "./identity";
38
- // RAG documents table (AI-ARCHITECTURE Phase H)
39
- // Single shared table that backs every collection in
40
- // @intelligo-dev/agents/rag. Per-collection wrappers live in the
41
- // product packages.
42
- export * from "./rag";
1
+ // Better-Auth's tables, including organization, member and invitation.
2
+ // Product code goes through the Better-Auth API rather than querying the
3
+ // organization tables directly, so membership and role rules stay in one
4
+ // place.
5
+ export * from "./auth.js";
6
+ export * from "./billing.js";
7
+ export * from "./usage.js";
8
+ export * from "./notifications.js";
9
+ export * from "./feature-flags.js";
10
+ export * from "./ai.js";
11
+ export * from "./agents.js";
12
+ export * from "./identity.js";
43
13
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/schema/index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,oCAAoC;AACpC,cAAc,QAAQ,CAAC;AAEvB,0FAA0F;AAC1F,qFAAqF;AACrF,kFAAkF;AAClF,8FAA8F;AAC9F,EAAE;AACF,0DAA0D;AAC1D,yEAAyE;AACzE,oDAAoD;AACpD,8CAA8C;AAC9C,6DAA6D;AAC7D,4CAA4C;AAC5C,sFAAsF;AACtF,qEAAqE;AAErE,4BAA4B;AAC5B,cAAc,WAAW,CAAC;AAE1B,mCAAmC;AACnC,cAAc,SAAS,CAAC;AAExB,iCAAiC;AACjC,cAAc,iBAAiB,CAAC;AAEhC,2BAA2B;AAC3B,cAAc,iBAAiB,CAAC;AAEhC,uBAAuB;AACvB,cAAc,MAAM,CAAC;AAErB,0BAA0B;AAC1B,cAAc,UAAU,CAAC;AAEzB,gDAAgD;AAChD,yDAAyD;AACzD,wEAAwE;AACxE,cAAc,YAAY,CAAC;AAE3B,gDAAgD;AAChD,qDAAqD;AACrD,iEAAiE;AACjE,oBAAoB;AACpB,cAAc,OAAO,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/db/schema/index.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yEAAyE;AACzE,yEAAyE;AACzE,SAAS;AACT,cAAc,QAAQ,CAAC;AACvB,cAAc,WAAW,CAAC;AAC1B,cAAc,SAAS,CAAC;AACxB,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,MAAM,CAAC;AACrB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC"}
@@ -1,21 +1,7 @@
1
1
  /**
2
- * Notifications Database Schema
3
- *
4
- * Persistent notifications for users (quota warnings, payment events, team updates).
5
- * These are user-scoped (not workspace-scoped) so a user sees all their notifications
6
- * across workspaces in one place.
7
- *
8
- * Pattern: snake_case columns in PostgreSQL, camelCase TypeScript API (via Drizzle mapping)
9
- */
10
- /**
11
- * Notifications table - User-facing notification records (NOTIF-06)
12
- *
13
- * Each notification has a type (matching NotificationType), a title/message for display,
14
- * and optional metadata for additional context. The isRead flag supports read/unread
15
- * filtering for the notification bell badge.
16
- *
17
- * userId references Better-Auth's user table by convention (no FK constraint).
18
- * workspaceId is nullable — some notifications are user-level (e.g., payment_failed).
2
+ * User-scoped, not workspace-scoped, so a user sees their notifications from
3
+ * every workspace in one place. `userId` references the users table by
4
+ * convention (no FK); `workspaceId` is null for user-level notifications.
19
5
  */
20
6
  export declare const notifications: import("drizzle-orm/pg-core").PgTableWithColumns<{
21
7
  name: "notifications";
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/db/schema/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAIH;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBzB,CAAC;AAGF,MAAM,MAAM,YAAY,GAAG,OAAO,aAAa,CAAC,YAAY,CAAC;AAC7D,MAAM,MAAM,kBAAkB,GAAG,OAAO,aAAa,CAAC,YAAY,CAAC"}
1
+ {"version":3,"file":"notifications.d.ts","sourceRoot":"","sources":["../../../src/db/schema/notifications.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAoBzB,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG,OAAO,aAAa,CAAC,YAAY,CAAC;AAC7D,MAAM,MAAM,kBAAkB,GAAG,OAAO,aAAa,CAAC,YAAY,CAAC"}
@@ -1,22 +1,8 @@
1
- /**
2
- * Notifications Database Schema
3
- *
4
- * Persistent notifications for users (quota warnings, payment events, team updates).
5
- * These are user-scoped (not workspace-scoped) so a user sees all their notifications
6
- * across workspaces in one place.
7
- *
8
- * Pattern: snake_case columns in PostgreSQL, camelCase TypeScript API (via Drizzle mapping)
9
- */
10
1
  import { pgTable, text, timestamp, boolean, index } from "drizzle-orm/pg-core";
11
2
  /**
12
- * Notifications table - User-facing notification records (NOTIF-06)
13
- *
14
- * Each notification has a type (matching NotificationType), a title/message for display,
15
- * and optional metadata for additional context. The isRead flag supports read/unread
16
- * filtering for the notification bell badge.
17
- *
18
- * userId references Better-Auth's user table by convention (no FK constraint).
19
- * workspaceId is nullable — some notifications are user-level (e.g., payment_failed).
3
+ * User-scoped, not workspace-scoped, so a user sees their notifications from
4
+ * every workspace in one place. `userId` references the users table by
5
+ * convention (no FK); `workspaceId` is null for user-level notifications.
20
6
  */
21
7
  export const notifications = pgTable("notifications", {
22
8
  id: text("id")
@@ -1 +1 @@
1
- {"version":3,"file":"notifications.js","sourceRoot":"","sources":["../../../src/db/schema/notifications.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,qBAAqB,CAAC;AAE/E;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,OAAO,CAClC,eAAe,EACf;IACE,EAAE,EAAE,IAA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