@firstlovecenter/ai-chat 0.8.0 → 0.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firstlovecenter/ai-chat",
3
- "version": "0.8.0",
3
+ "version": "0.9.0",
4
4
  "description": "Reusable AI chat module: agent loop, Vertex providers (Claude + Gemini), narrators, persistence schema, and chat UI components. Host injects auth, scope, tools, and credentials via configureAiChat().",
5
5
  "license": "MIT",
6
6
  "author": "First Love Church",
@@ -24,8 +24,12 @@
24
24
  // providers / chat interfaces at runtime without a schema migration.
25
25
  // =============================================================================
26
26
 
27
+ // `chat_sessions.id` and `chat_messages.id` / `chat_messages.session_id`
28
+ // are short URL-safe UIDs (12 chars) generated by the package via
29
+ // `generateChatUid()`. The package writes the id on every insert; the
30
+ // schema has no DB-side default, so don't add `@default()`.
27
31
  model ChatSession {
28
- id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
32
+ id String @id @db.VarChar(12)
29
33
  userId BigInt @map("user_id") @db.UnsignedBigInt
30
34
  title String @db.VarChar(200)
31
35
  createdAt DateTime @default(now()) @map("created_at") @db.DateTime(0)
@@ -36,8 +40,8 @@ model ChatSession {
36
40
  }
37
41
 
38
42
  model ChatMessage {
39
- id BigInt @id @default(autoincrement()) @db.UnsignedBigInt
40
- sessionId BigInt @map("session_id") @db.UnsignedBigInt
43
+ id String @id @db.VarChar(12)
44
+ sessionId String @map("session_id") @db.VarChar(12)
41
45
  role String @db.VarChar(16)
42
46
  question String? @db.Text
43
47
  blocks Json?