@happyvertical/smrt-messages 0.62.13 → 0.63.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/AGENTS.md +7 -1
  2. package/agents/send-approval.md +101 -0
  3. package/dist/access.d.ts +33 -1
  4. package/dist/access.d.ts.map +1 -1
  5. package/dist/chunks/{AttachmentCollection-Dzz2iKjx.js → AttachmentCollection-CQaFv6FD.js} +4 -4
  6. package/dist/chunks/{AttachmentCollection-Dzz2iKjx.js.map → AttachmentCollection-CQaFv6FD.js.map} +1 -1
  7. package/dist/chunks/{Email-DDMgkm_l.js → Email-YfrfXXmh.js} +185 -9
  8. package/dist/chunks/Email-YfrfXXmh.js.map +1 -0
  9. package/dist/chunks/EmailAccountCollection-DzSW5043.js +2472 -0
  10. package/dist/chunks/EmailAccountCollection-DzSW5043.js.map +1 -0
  11. package/dist/chunks/{EmailCollection-lo8WePl-.js → EmailCollection-BGtIdMhg.js} +3 -3
  12. package/dist/chunks/{EmailCollection-lo8WePl-.js.map → EmailCollection-BGtIdMhg.js.map} +1 -1
  13. package/dist/chunks/{EmailFolder-Bu7y8-VX.js → EmailFolder-DADdGZC0.js} +6 -6
  14. package/dist/chunks/{EmailFolder-Bu7y8-VX.js.map → EmailFolder-DADdGZC0.js.map} +1 -1
  15. package/dist/chunks/{EmailFolderCollection-BpzzKBhM.js → EmailFolderCollection-DSnVCTIB.js} +2 -2
  16. package/dist/chunks/{EmailFolderCollection-BpzzKBhM.js.map → EmailFolderCollection-DSnVCTIB.js.map} +1 -1
  17. package/dist/chunks/{EmailSender-B-Rtq9du.js → EmailSender-0Y6Bo_OK.js} +8 -1
  18. package/dist/chunks/EmailSender-0Y6Bo_OK.js.map +1 -0
  19. package/dist/chunks/{Message-BwW51pgG.js → Message-CGQywP0F.js} +139 -11
  20. package/dist/chunks/Message-CGQywP0F.js.map +1 -0
  21. package/dist/chunks/{MessageCollection-JjZybSMu.js → MessageCollection-Cw1T8ZxA.js} +2 -2
  22. package/dist/chunks/{MessageCollection-JjZybSMu.js.map → MessageCollection-Cw1T8ZxA.js.map} +1 -1
  23. package/dist/chunks/{MessagingEndpointCollection-FmbtiFJy.js → MessagingEndpointCollection-CX2ygSoD.js} +2 -2
  24. package/dist/chunks/{MessagingEndpointCollection-FmbtiFJy.js.map → MessagingEndpointCollection-CX2ygSoD.js.map} +1 -1
  25. package/dist/connect.js +1 -1
  26. package/dist/html-to-text.d.ts +13 -0
  27. package/dist/html-to-text.d.ts.map +1 -0
  28. package/dist/index.d.ts +4 -2
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +129 -14
  31. package/dist/index.js.map +1 -1
  32. package/dist/mail-drafts.d.ts +63 -0
  33. package/dist/mail-drafts.d.ts.map +1 -0
  34. package/dist/mail-triage.d.ts.map +1 -1
  35. package/dist/manifest.json +357 -33
  36. package/dist/models/Email.d.ts +5 -0
  37. package/dist/models/Email.d.ts.map +1 -1
  38. package/dist/models/EmailAccount.d.ts +8 -1
  39. package/dist/models/EmailAccount.d.ts.map +1 -1
  40. package/dist/models/Message.d.ts +11 -0
  41. package/dist/models/Message.d.ts.map +1 -1
  42. package/dist/models/SlackMessage.d.ts +10 -0
  43. package/dist/models/SlackMessage.d.ts.map +1 -1
  44. package/dist/send-approval.d.ts +275 -0
  45. package/dist/send-approval.d.ts.map +1 -0
  46. package/dist/senders/EmailSender.d.ts.map +1 -1
  47. package/dist/smrt-knowledge.json +216 -8
  48. package/dist/smrt-knowledge.okf.md +7 -2
  49. package/dist/types.d.ts +20 -0
  50. package/dist/types.d.ts.map +1 -1
  51. package/package.json +12 -11
  52. package/dist/chunks/Email-DDMgkm_l.js.map +0 -1
  53. package/dist/chunks/EmailAccountCollection-CgZE9YAM.js +0 -1992
  54. package/dist/chunks/EmailAccountCollection-CgZE9YAM.js.map +0 -1
  55. package/dist/chunks/EmailSender-B-Rtq9du.js.map +0 -1
  56. package/dist/chunks/Message-BwW51pgG.js.map +0 -1
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-messages",
5
- "packageVersion": "0.62.13",
5
+ "packageVersion": "0.63.0",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-messages:AccountCollection": {
8
8
  "name": "accountcollection",
@@ -153,7 +153,7 @@
153
153
  ],
154
154
  "schema": {
155
155
  "tableName": "accounts",
156
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
156
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"agent_send_policy\" TEXT,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
157
157
  "columns": {
158
158
  "_sync_origin_device_id": {
159
159
  "type": "TEXT"
@@ -279,6 +279,10 @@
279
279
  "notNull": false,
280
280
  "default": false
281
281
  },
282
+ "agent_send_policy": {
283
+ "type": "TEXT",
284
+ "notNull": false
285
+ },
282
286
  "workspace_id": {
283
287
  "type": "TEXT",
284
288
  "notNull": false
@@ -348,7 +352,7 @@
348
352
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
349
353
  }
350
354
  ],
351
- "version": "f48d7a23"
355
+ "version": "ff134288"
352
356
  },
353
357
  "importPath": "@happyvertical/smrt-messages"
354
358
  },
@@ -1300,7 +1304,7 @@
1300
1304
  ],
1301
1305
  "schema": {
1302
1306
  "tableName": "accounts",
1303
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
1307
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"agent_send_policy\" TEXT,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
1304
1308
  "columns": {
1305
1309
  "_sync_origin_device_id": {
1306
1310
  "type": "TEXT"
@@ -1426,6 +1430,10 @@
1426
1430
  "notNull": false,
1427
1431
  "default": false
1428
1432
  },
1433
+ "agent_send_policy": {
1434
+ "type": "TEXT",
1435
+ "notNull": false
1436
+ },
1429
1437
  "workspace_id": {
1430
1438
  "type": "TEXT",
1431
1439
  "notNull": false
@@ -1495,7 +1503,7 @@
1495
1503
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
1496
1504
  }
1497
1505
  ],
1498
- "version": "f48d7a23"
1506
+ "version": "ff134288"
1499
1507
  },
1500
1508
  "importPath": "@happyvertical/smrt-messages"
1501
1509
  },
@@ -2370,7 +2378,7 @@
2370
2378
  ],
2371
2379
  "schema": {
2372
2380
  "tableName": "messages",
2373
- "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
2381
+ "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"handled_by_id\" TEXT,\n \"handled_by_kind\" TEXT,\n \"handled_at\" TIMESTAMP,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
2374
2382
  "columns": {
2375
2383
  "_sync_origin_device_id": {
2376
2384
  "type": "TEXT"
@@ -2537,6 +2545,18 @@
2537
2545
  "onUpdate": "CASCADE"
2538
2546
  }
2539
2547
  },
2548
+ "handled_by_id": {
2549
+ "type": "TEXT",
2550
+ "notNull": false
2551
+ },
2552
+ "handled_by_kind": {
2553
+ "type": "TEXT",
2554
+ "notNull": false
2555
+ },
2556
+ "handled_at": {
2557
+ "type": "TIMESTAMP",
2558
+ "notNull": false
2559
+ },
2540
2560
  "message_id": {
2541
2561
  "type": "TEXT",
2542
2562
  "notNull": false
@@ -2790,7 +2810,7 @@
2790
2810
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:Tweet') OR \"retweet_count\" IS NOT NULL"
2791
2811
  }
2792
2812
  ],
2793
- "version": "f48614e6"
2813
+ "version": "da95c653"
2794
2814
  },
2795
2815
  "importPath": "@happyvertical/smrt-messages"
2796
2816
  },
@@ -3484,7 +3504,7 @@
3484
3504
  ],
3485
3505
  "schema": {
3486
3506
  "tableName": "messages",
3487
- "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
3507
+ "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"handled_by_id\" TEXT,\n \"handled_by_kind\" TEXT,\n \"handled_at\" TIMESTAMP,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
3488
3508
  "columns": {
3489
3509
  "_sync_origin_device_id": {
3490
3510
  "type": "TEXT"
@@ -3651,6 +3671,18 @@
3651
3671
  "onUpdate": "CASCADE"
3652
3672
  }
3653
3673
  },
3674
+ "handled_by_id": {
3675
+ "type": "TEXT",
3676
+ "notNull": false
3677
+ },
3678
+ "handled_by_kind": {
3679
+ "type": "TEXT",
3680
+ "notNull": false
3681
+ },
3682
+ "handled_at": {
3683
+ "type": "TIMESTAMP",
3684
+ "notNull": false
3685
+ },
3654
3686
  "message_id": {
3655
3687
  "type": "TEXT",
3656
3688
  "notNull": false
@@ -3904,7 +3936,7 @@
3904
3936
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:Tweet') OR \"retweet_count\" IS NOT NULL"
3905
3937
  }
3906
3938
  ],
3907
- "version": "d8da74ce"
3939
+ "version": "e51be371"
3908
3940
  },
3909
3941
  "importPath": "@happyvertical/smrt-messages"
3910
3942
  },
@@ -5406,7 +5438,7 @@
5406
5438
  ],
5407
5439
  "schema": {
5408
5440
  "tableName": "accounts",
5409
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
5441
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"agent_send_policy\" TEXT,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
5410
5442
  "columns": {
5411
5443
  "_sync_origin_device_id": {
5412
5444
  "type": "TEXT"
@@ -5532,6 +5564,10 @@
5532
5564
  "notNull": false,
5533
5565
  "default": false
5534
5566
  },
5567
+ "agent_send_policy": {
5568
+ "type": "TEXT",
5569
+ "notNull": false
5570
+ },
5535
5571
  "workspace_id": {
5536
5572
  "type": "TEXT",
5537
5573
  "notNull": false
@@ -5601,7 +5637,7 @@
5601
5637
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
5602
5638
  }
5603
5639
  ],
5604
- "version": "f48d7a23"
5640
+ "version": "ff134288"
5605
5641
  },
5606
5642
  "importPath": "@happyvertical/smrt-messages"
5607
5643
  },
@@ -6860,6 +6896,48 @@
6860
6896
  "related": "Message",
6861
6897
  "description": "The earlier message this one replies to."
6862
6898
  },
6899
+ "handledById": {
6900
+ "type": "text",
6901
+ "_meta": {
6902
+ "__statedOptions": [
6903
+ "readonly",
6904
+ "description"
6905
+ ],
6906
+ "description": "The person or assistant who last acted on this message.",
6907
+ "readonly": true
6908
+ },
6909
+ "required": false,
6910
+ "description": "The person or assistant who last acted on this message.",
6911
+ "readonly": true
6912
+ },
6913
+ "handledByKind": {
6914
+ "type": "text",
6915
+ "_meta": {
6916
+ "__statedOptions": [
6917
+ "readonly",
6918
+ "description"
6919
+ ],
6920
+ "description": "Whether a person or an assistant last acted on this message.",
6921
+ "readonly": true
6922
+ },
6923
+ "required": false,
6924
+ "description": "Whether a person or an assistant last acted on this message.",
6925
+ "readonly": true
6926
+ },
6927
+ "handledAt": {
6928
+ "type": "datetime",
6929
+ "_meta": {
6930
+ "__statedOptions": [
6931
+ "readonly",
6932
+ "description"
6933
+ ],
6934
+ "description": "When someone last acted on this message.",
6935
+ "readonly": true
6936
+ },
6937
+ "required": false,
6938
+ "description": "When someone last acted on this message.",
6939
+ "readonly": true
6940
+ },
6863
6941
  "createdAt": {
6864
6942
  "type": "text",
6865
6943
  "_meta": {
@@ -7261,6 +7339,14 @@
7261
7339
  "isStatic": false,
7262
7340
  "isPublic": true
7263
7341
  },
7342
+ "getHandledBy": {
7343
+ "name": "getHandledBy",
7344
+ "async": false,
7345
+ "parameters": [],
7346
+ "returnType": "object | null",
7347
+ "isStatic": false,
7348
+ "isPublic": true
7349
+ },
7264
7350
  "isSendOutcomeUnknown": {
7265
7351
  "name": "isSendOutcomeUnknown",
7266
7352
  "async": false,
@@ -7527,7 +7613,7 @@
7527
7613
  ],
7528
7614
  "schema": {
7529
7615
  "tableName": "messages",
7530
- "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
7616
+ "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"handled_by_id\" TEXT,\n \"handled_by_kind\" TEXT,\n \"handled_at\" TIMESTAMP,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
7531
7617
  "columns": {
7532
7618
  "_sync_origin_device_id": {
7533
7619
  "type": "TEXT"
@@ -7694,6 +7780,18 @@
7694
7780
  "onUpdate": "CASCADE"
7695
7781
  }
7696
7782
  },
7783
+ "handled_by_id": {
7784
+ "type": "TEXT",
7785
+ "notNull": false
7786
+ },
7787
+ "handled_by_kind": {
7788
+ "type": "TEXT",
7789
+ "notNull": false
7790
+ },
7791
+ "handled_at": {
7792
+ "type": "TIMESTAMP",
7793
+ "notNull": false
7794
+ },
7697
7795
  "message_id": {
7698
7796
  "type": "TEXT",
7699
7797
  "notNull": false
@@ -7947,7 +8045,7 @@
7947
8045
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:Tweet') OR \"retweet_count\" IS NOT NULL"
7948
8046
  }
7949
8047
  ],
7950
- "version": "f48614e6"
8048
+ "version": "da95c653"
7951
8049
  },
7952
8050
  "importPath": "@happyvertical/smrt-messages"
7953
8051
  },
@@ -8248,6 +8346,25 @@
8248
8346
  "required": true,
8249
8347
  "default": false,
8250
8348
  "description": "Whether more mail was still waiting after the last check."
8349
+ },
8350
+ "agentSendPolicy": {
8351
+ "type": "text",
8352
+ "_meta": {
8353
+ "__statedOptions": [
8354
+ "readonly",
8355
+ "description",
8356
+ "enum"
8357
+ ],
8358
+ "description": "Whether an assistant may send from this mailbox on its own, or needs a person to approve each message first.",
8359
+ "readonly": true
8360
+ },
8361
+ "required": false,
8362
+ "description": "Whether an assistant may send from this mailbox on its own, or needs a person to approve each message first.",
8363
+ "enum": [
8364
+ "require_approval",
8365
+ "auto_send"
8366
+ ],
8367
+ "readonly": true
8251
8368
  }
8252
8369
  },
8253
8370
  "methods": {
@@ -8583,7 +8700,7 @@
8583
8700
  ],
8584
8701
  "schema": {
8585
8702
  "tableName": "accounts",
8586
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
8703
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"agent_send_policy\" TEXT,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
8587
8704
  "columns": {
8588
8705
  "_sync_origin_device_id": {
8589
8706
  "type": "TEXT"
@@ -8709,6 +8826,10 @@
8709
8826
  "notNull": false,
8710
8827
  "default": false
8711
8828
  },
8829
+ "agent_send_policy": {
8830
+ "type": "TEXT",
8831
+ "notNull": false
8832
+ },
8712
8833
  "workspace_id": {
8713
8834
  "type": "TEXT",
8714
8835
  "notNull": false
@@ -8778,7 +8899,7 @@
8778
8899
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
8779
8900
  }
8780
8901
  ],
8781
- "version": "f48d7a23"
8902
+ "version": "ff134288"
8782
8903
  },
8783
8904
  "importPath": "@happyvertical/smrt-messages"
8784
8905
  },
@@ -9912,6 +10033,48 @@
9912
10033
  "related": "Message",
9913
10034
  "description": "The earlier message this one replies to."
9914
10035
  },
10036
+ "handledById": {
10037
+ "type": "text",
10038
+ "_meta": {
10039
+ "__statedOptions": [
10040
+ "readonly",
10041
+ "description"
10042
+ ],
10043
+ "description": "The person or assistant who last acted on this message.",
10044
+ "readonly": true
10045
+ },
10046
+ "required": false,
10047
+ "description": "The person or assistant who last acted on this message.",
10048
+ "readonly": true
10049
+ },
10050
+ "handledByKind": {
10051
+ "type": "text",
10052
+ "_meta": {
10053
+ "__statedOptions": [
10054
+ "readonly",
10055
+ "description"
10056
+ ],
10057
+ "description": "Whether a person or an assistant last acted on this message.",
10058
+ "readonly": true
10059
+ },
10060
+ "required": false,
10061
+ "description": "Whether a person or an assistant last acted on this message.",
10062
+ "readonly": true
10063
+ },
10064
+ "handledAt": {
10065
+ "type": "datetime",
10066
+ "_meta": {
10067
+ "__statedOptions": [
10068
+ "readonly",
10069
+ "description"
10070
+ ],
10071
+ "description": "When someone last acted on this message.",
10072
+ "readonly": true
10073
+ },
10074
+ "required": false,
10075
+ "description": "When someone last acted on this message.",
10076
+ "readonly": true
10077
+ },
9915
10078
  "createdAt": {
9916
10079
  "type": "text",
9917
10080
  "_meta": {
@@ -10122,6 +10285,14 @@
10122
10285
  "isStatic": false,
10123
10286
  "isPublic": true
10124
10287
  },
10288
+ "getHandledBy": {
10289
+ "name": "getHandledBy",
10290
+ "async": false,
10291
+ "parameters": [],
10292
+ "returnType": "object | null",
10293
+ "isStatic": false,
10294
+ "isPublic": true
10295
+ },
10125
10296
  "isSendOutcomeUnknown": {
10126
10297
  "name": "isSendOutcomeUnknown",
10127
10298
  "async": false,
@@ -10248,7 +10419,7 @@
10248
10419
  ],
10249
10420
  "schema": {
10250
10421
  "tableName": "messages",
10251
- "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
10422
+ "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"handled_by_id\" TEXT,\n \"handled_by_kind\" TEXT,\n \"handled_at\" TIMESTAMP,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
10252
10423
  "columns": {
10253
10424
  "_sync_origin_device_id": {
10254
10425
  "type": "TEXT"
@@ -10415,6 +10586,18 @@
10415
10586
  "onUpdate": "CASCADE"
10416
10587
  }
10417
10588
  },
10589
+ "handled_by_id": {
10590
+ "type": "TEXT",
10591
+ "notNull": false
10592
+ },
10593
+ "handled_by_kind": {
10594
+ "type": "TEXT",
10595
+ "notNull": false
10596
+ },
10597
+ "handled_at": {
10598
+ "type": "TIMESTAMP",
10599
+ "notNull": false
10600
+ },
10418
10601
  "message_id": {
10419
10602
  "type": "TEXT",
10420
10603
  "notNull": false
@@ -10668,7 +10851,7 @@
10668
10851
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:Tweet') OR \"retweet_count\" IS NOT NULL"
10669
10852
  }
10670
10853
  ],
10671
- "version": "d8da74ce"
10854
+ "version": "e51be371"
10672
10855
  },
10673
10856
  "importPath": "@happyvertical/smrt-messages"
10674
10857
  },
@@ -12679,7 +12862,7 @@
12679
12862
  ],
12680
12863
  "schema": {
12681
12864
  "tableName": "accounts",
12682
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
12865
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"agent_send_policy\" TEXT,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
12683
12866
  "columns": {
12684
12867
  "_sync_origin_device_id": {
12685
12868
  "type": "TEXT"
@@ -12805,6 +12988,10 @@
12805
12988
  "notNull": false,
12806
12989
  "default": false
12807
12990
  },
12991
+ "agent_send_policy": {
12992
+ "type": "TEXT",
12993
+ "notNull": false
12994
+ },
12808
12995
  "workspace_id": {
12809
12996
  "type": "TEXT",
12810
12997
  "notNull": false
@@ -12874,7 +13061,7 @@
12874
13061
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
12875
13062
  }
12876
13063
  ],
12877
- "version": "f48d7a23"
13064
+ "version": "ff134288"
12878
13065
  },
12879
13066
  "importPath": "@happyvertical/smrt-messages"
12880
13067
  },
@@ -13210,6 +13397,48 @@
13210
13397
  "related": "Message",
13211
13398
  "description": "The earlier message this one replies to."
13212
13399
  },
13400
+ "handledById": {
13401
+ "type": "text",
13402
+ "_meta": {
13403
+ "__statedOptions": [
13404
+ "readonly",
13405
+ "description"
13406
+ ],
13407
+ "description": "The person or assistant who last acted on this message.",
13408
+ "readonly": true
13409
+ },
13410
+ "required": false,
13411
+ "description": "The person or assistant who last acted on this message.",
13412
+ "readonly": true
13413
+ },
13414
+ "handledByKind": {
13415
+ "type": "text",
13416
+ "_meta": {
13417
+ "__statedOptions": [
13418
+ "readonly",
13419
+ "description"
13420
+ ],
13421
+ "description": "Whether a person or an assistant last acted on this message.",
13422
+ "readonly": true
13423
+ },
13424
+ "required": false,
13425
+ "description": "Whether a person or an assistant last acted on this message.",
13426
+ "readonly": true
13427
+ },
13428
+ "handledAt": {
13429
+ "type": "datetime",
13430
+ "_meta": {
13431
+ "__statedOptions": [
13432
+ "readonly",
13433
+ "description"
13434
+ ],
13435
+ "description": "When someone last acted on this message.",
13436
+ "readonly": true
13437
+ },
13438
+ "required": false,
13439
+ "description": "When someone last acted on this message.",
13440
+ "readonly": true
13441
+ },
13213
13442
  "createdAt": {
13214
13443
  "type": "text",
13215
13444
  "_meta": {
@@ -13510,6 +13739,14 @@
13510
13739
  "isStatic": false,
13511
13740
  "isPublic": true
13512
13741
  },
13742
+ "getHandledBy": {
13743
+ "name": "getHandledBy",
13744
+ "async": false,
13745
+ "parameters": [],
13746
+ "returnType": "object | null",
13747
+ "isStatic": false,
13748
+ "isPublic": true
13749
+ },
13513
13750
  "isSendOutcomeUnknown": {
13514
13751
  "name": "isSendOutcomeUnknown",
13515
13752
  "async": false,
@@ -13551,7 +13788,7 @@
13551
13788
  "async": false,
13552
13789
  "parameters": [
13553
13790
  {
13554
- "name": "_options",
13791
+ "name": "options",
13555
13792
  "type": "object",
13556
13793
  "optional": true,
13557
13794
  "memberTypes": [
@@ -13559,7 +13796,7 @@
13559
13796
  ]
13560
13797
  }
13561
13798
  ],
13562
- "returnType": "Message",
13799
+ "returnType": "SlackMessage",
13563
13800
  "isStatic": false,
13564
13801
  "isPublic": true
13565
13802
  },
@@ -13567,7 +13804,7 @@
13567
13804
  "name": "createForward",
13568
13805
  "async": false,
13569
13806
  "parameters": [],
13570
- "returnType": "Message",
13807
+ "returnType": "SlackMessage",
13571
13808
  "isStatic": false,
13572
13809
  "isPublic": true
13573
13810
  },
@@ -13671,7 +13908,7 @@
13671
13908
  ],
13672
13909
  "schema": {
13673
13910
  "tableName": "messages",
13674
- "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
13911
+ "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"handled_by_id\" TEXT,\n \"handled_by_kind\" TEXT,\n \"handled_at\" TIMESTAMP,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
13675
13912
  "columns": {
13676
13913
  "_sync_origin_device_id": {
13677
13914
  "type": "TEXT"
@@ -13838,6 +14075,18 @@
13838
14075
  "onUpdate": "CASCADE"
13839
14076
  }
13840
14077
  },
14078
+ "handled_by_id": {
14079
+ "type": "TEXT",
14080
+ "notNull": false
14081
+ },
14082
+ "handled_by_kind": {
14083
+ "type": "TEXT",
14084
+ "notNull": false
14085
+ },
14086
+ "handled_at": {
14087
+ "type": "TIMESTAMP",
14088
+ "notNull": false
14089
+ },
13841
14090
  "message_id": {
13842
14091
  "type": "TEXT",
13843
14092
  "notNull": false
@@ -14091,7 +14340,7 @@
14091
14340
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:Tweet') OR \"retweet_count\" IS NOT NULL"
14092
14341
  }
14093
14342
  ],
14094
- "version": "63b1a1ae"
14343
+ "version": "2f466c21"
14095
14344
  },
14096
14345
  "importPath": "@happyvertical/smrt-messages"
14097
14346
  },
@@ -14469,7 +14718,7 @@
14469
14718
  ],
14470
14719
  "schema": {
14471
14720
  "tableName": "accounts",
14472
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
14721
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"agent_send_policy\" TEXT,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
14473
14722
  "columns": {
14474
14723
  "_sync_origin_device_id": {
14475
14724
  "type": "TEXT"
@@ -14595,6 +14844,10 @@
14595
14844
  "notNull": false,
14596
14845
  "default": false
14597
14846
  },
14847
+ "agent_send_policy": {
14848
+ "type": "TEXT",
14849
+ "notNull": false
14850
+ },
14598
14851
  "workspace_id": {
14599
14852
  "type": "TEXT",
14600
14853
  "notNull": false
@@ -14664,7 +14917,7 @@
14664
14917
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
14665
14918
  }
14666
14919
  ],
14667
- "version": "f48d7a23"
14920
+ "version": "ff134288"
14668
14921
  },
14669
14922
  "importPath": "@happyvertical/smrt-messages"
14670
14923
  },
@@ -15000,6 +15253,48 @@
15000
15253
  "related": "Message",
15001
15254
  "description": "The earlier message this one replies to."
15002
15255
  },
15256
+ "handledById": {
15257
+ "type": "text",
15258
+ "_meta": {
15259
+ "__statedOptions": [
15260
+ "readonly",
15261
+ "description"
15262
+ ],
15263
+ "description": "The person or assistant who last acted on this message.",
15264
+ "readonly": true
15265
+ },
15266
+ "required": false,
15267
+ "description": "The person or assistant who last acted on this message.",
15268
+ "readonly": true
15269
+ },
15270
+ "handledByKind": {
15271
+ "type": "text",
15272
+ "_meta": {
15273
+ "__statedOptions": [
15274
+ "readonly",
15275
+ "description"
15276
+ ],
15277
+ "description": "Whether a person or an assistant last acted on this message.",
15278
+ "readonly": true
15279
+ },
15280
+ "required": false,
15281
+ "description": "Whether a person or an assistant last acted on this message.",
15282
+ "readonly": true
15283
+ },
15284
+ "handledAt": {
15285
+ "type": "datetime",
15286
+ "_meta": {
15287
+ "__statedOptions": [
15288
+ "readonly",
15289
+ "description"
15290
+ ],
15291
+ "description": "When someone last acted on this message.",
15292
+ "readonly": true
15293
+ },
15294
+ "required": false,
15295
+ "description": "When someone last acted on this message.",
15296
+ "readonly": true
15297
+ },
15003
15298
  "createdAt": {
15004
15299
  "type": "text",
15005
15300
  "_meta": {
@@ -15288,6 +15583,14 @@
15288
15583
  "isStatic": false,
15289
15584
  "isPublic": true
15290
15585
  },
15586
+ "getHandledBy": {
15587
+ "name": "getHandledBy",
15588
+ "async": false,
15589
+ "parameters": [],
15590
+ "returnType": "object | null",
15591
+ "isStatic": false,
15592
+ "isPublic": true
15593
+ },
15291
15594
  "isSendOutcomeUnknown": {
15292
15595
  "name": "isSendOutcomeUnknown",
15293
15596
  "async": false,
@@ -15469,7 +15772,7 @@
15469
15772
  ],
15470
15773
  "schema": {
15471
15774
  "tableName": "messages",
15472
- "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
15775
+ "ddl": "CREATE TABLE IF NOT EXISTS \"messages\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"account_id\" UUID,\n \"persona_id\" UUID,\n \"endpoint_id\" UUID,\n \"correlation_id\" TEXT,\n \"thread_id\" TEXT,\n \"subject\" TEXT,\n \"body\" TEXT,\n \"from_address\" TEXT,\n \"from_name\" TEXT,\n \"to_addresses\" TEXT,\n \"date\" TIMESTAMP,\n \"is_read\" BOOLEAN DEFAULT FALSE,\n \"is_flagged\" BOOLEAN DEFAULT FALSE,\n \"has_attachments\" BOOLEAN DEFAULT FALSE,\n \"size\" INTEGER DEFAULT 0,\n \"metadata\" TEXT,\n \"send_status\" TEXT DEFAULT 'draft',\n \"sent_at\" TIMESTAMP,\n \"send_error\" TEXT,\n \"retry_count\" INTEGER DEFAULT 0,\n \"max_retries\" INTEGER DEFAULT 3,\n \"scheduled_send_at\" TIMESTAMP,\n \"in_reply_to_message_id\" UUID,\n \"handled_by_id\" TEXT,\n \"handled_by_kind\" TEXT,\n \"handled_at\" TIMESTAMP,\n \"message_id\" TEXT,\n \"in_reply_to\" TEXT,\n \"provider_message_id\" TEXT,\n \"cc_addresses\" TEXT,\n \"bcc_addresses\" TEXT,\n \"reply_to_address\" TEXT,\n \"reply_to_name\" TEXT,\n \"text_body\" TEXT,\n \"html_body\" TEXT,\n \"folder_id\" TEXT,\n \"folder_path\" TEXT,\n \"labels\" TEXT,\n \"flags\" TEXT,\n \"is_answered\" BOOLEAN DEFAULT FALSE,\n \"is_draft\" BOOLEAN DEFAULT FALSE,\n \"raw_message\" TEXT,\n \"headers\" TEXT,\n \"channel_id\" TEXT,\n \"channel_name\" TEXT,\n \"slack_ts\" TEXT,\n \"slack_thread_ts\" TEXT,\n \"reactions\" TEXT,\n \"is_edited\" BOOLEAN DEFAULT FALSE,\n \"message_type\" TEXT,\n \"blocks\" TEXT,\n \"tweet_id\" TEXT,\n \"retweet_count\" INTEGER DEFAULT 0,\n \"like_count\" INTEGER DEFAULT 0,\n \"reply_count\" INTEGER DEFAULT 0,\n \"is_retweet\" BOOLEAN DEFAULT FALSE,\n \"is_reply\" BOOLEAN DEFAULT FALSE,\n \"media_urls\" TEXT,\n \"hashtags\" TEXT,\n \"mentions\" TEXT\n);",
15473
15776
  "columns": {
15474
15777
  "_sync_origin_device_id": {
15475
15778
  "type": "TEXT"
@@ -15636,6 +15939,18 @@
15636
15939
  "onUpdate": "CASCADE"
15637
15940
  }
15638
15941
  },
15942
+ "handled_by_id": {
15943
+ "type": "TEXT",
15944
+ "notNull": false
15945
+ },
15946
+ "handled_by_kind": {
15947
+ "type": "TEXT",
15948
+ "notNull": false
15949
+ },
15950
+ "handled_at": {
15951
+ "type": "TIMESTAMP",
15952
+ "notNull": false
15953
+ },
15639
15954
  "message_id": {
15640
15955
  "type": "TEXT",
15641
15956
  "notNull": false
@@ -15889,7 +16204,7 @@
15889
16204
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:Tweet') OR \"retweet_count\" IS NOT NULL"
15890
16205
  }
15891
16206
  ],
15892
- "version": "28598df2"
16207
+ "version": "8541efa0"
15893
16208
  },
15894
16209
  "importPath": "@happyvertical/smrt-messages"
15895
16210
  },
@@ -16281,7 +16596,7 @@
16281
16596
  ],
16282
16597
  "schema": {
16283
16598
  "tableName": "accounts",
16284
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
16599
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"agent_send_policy\" TEXT,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
16285
16600
  "columns": {
16286
16601
  "_sync_origin_device_id": {
16287
16602
  "type": "TEXT"
@@ -16407,6 +16722,10 @@
16407
16722
  "notNull": false,
16408
16723
  "default": false
16409
16724
  },
16725
+ "agent_send_policy": {
16726
+ "type": "TEXT",
16727
+ "notNull": false
16728
+ },
16410
16729
  "workspace_id": {
16411
16730
  "type": "TEXT",
16412
16731
  "notNull": false
@@ -16476,7 +16795,7 @@
16476
16795
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
16477
16796
  }
16478
16797
  ],
16479
- "version": "f48d7a23"
16798
+ "version": "ff134288"
16480
16799
  },
16481
16800
  "importPath": "@happyvertical/smrt-messages"
16482
16801
  },
@@ -17354,7 +17673,7 @@
17354
17673
  ],
17355
17674
  "schema": {
17356
17675
  "tableName": "accounts",
17357
- "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
17676
+ "ddl": "CREATE TABLE IF NOT EXISTS \"accounts\" (\n \"_sync_origin_device_id\" TEXT,\n \"_sync_revision\" INTEGER,\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT,\n \"provider_type\" TEXT,\n \"channel_type\" TEXT,\n \"credential_secret_id\" TEXT,\n \"is_active\" BOOLEAN DEFAULT TRUE,\n \"owner_user_id\" UUID,\n \"label\" TEXT,\n \"connection_status\" TEXT,\n \"status_message\" TEXT,\n \"last_sync_at\" TIMESTAMP,\n \"settings\" TEXT,\n \"configuration\" TEXT,\n \"email\" TEXT,\n \"sync_interval_minutes\" INTEGER DEFAULT 60,\n \"sync_cursor\" TEXT,\n \"backfill_since\" TIMESTAMP,\n \"cursor_horizon\" TIMESTAMP,\n \"last_sync_error\" TEXT,\n \"backlog\" BOOLEAN DEFAULT FALSE,\n \"agent_send_policy\" TEXT,\n \"workspace_id\" TEXT,\n \"workspace_name\" TEXT,\n \"bot_user_id\" TEXT,\n \"handle\" TEXT,\n \"twitter_user_id\" TEXT\n);",
17358
17677
  "columns": {
17359
17678
  "_sync_origin_device_id": {
17360
17679
  "type": "TEXT"
@@ -17480,6 +17799,10 @@
17480
17799
  "notNull": false,
17481
17800
  "default": false
17482
17801
  },
17802
+ "agent_send_policy": {
17803
+ "type": "TEXT",
17804
+ "notNull": false
17805
+ },
17483
17806
  "workspace_id": {
17484
17807
  "type": "TEXT",
17485
17808
  "notNull": false
@@ -17549,7 +17872,7 @@
17549
17872
  "expression": "_meta_type NOT IN ('@happyvertical/smrt-messages:EmailAccount') OR \"sync_interval_minutes\" IS NOT NULL"
17550
17873
  }
17551
17874
  ],
17552
- "version": "f48d7a23"
17875
+ "version": "ff134288"
17553
17876
  },
17554
17877
  "importPath": "@happyvertical/smrt-messages"
17555
17878
  }
@@ -18010,6 +18333,7 @@
18010
18333
  }
18011
18334
  ],
18012
18335
  "smrtDependencies": [
18336
+ "@happyvertical/smrt-approvals",
18013
18337
  "@happyvertical/smrt-core",
18014
18338
  "@happyvertical/smrt-jobs",
18015
18339
  "@happyvertical/smrt-ledgers",
@@ -18035,6 +18359,6 @@
18035
18359
  "@happyvertical/smrt-users"
18036
18360
  ]
18037
18361
  },
18038
- "schemaFingerprint": "81a3bacdca7cfb0b0c5f75ea8edea68fd046b51d83e21b60a1f64ed7f3d829ef",
18362
+ "schemaFingerprint": "6c2d289dee64b26574af5772316114fe544e87d90bbd30b5b70472341882fdb7",
18039
18363
  "stampsConstructors": true
18040
18364
  }