openvolo 0.1.2

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 (208) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +175 -0
  3. package/components.json +20 -0
  4. package/dist/cli.js +992 -0
  5. package/drizzle.config.ts +14 -0
  6. package/next.config.mjs +7 -0
  7. package/package.json +91 -0
  8. package/postcss.config.mjs +7 -0
  9. package/public/android-chrome-192x192.png +0 -0
  10. package/public/android-chrome-512x512.png +0 -0
  11. package/public/apple-touch-icon.png +0 -0
  12. package/public/assets/openvolo-logo-black.png +0 -0
  13. package/public/assets/openvolo-logo-name.png +0 -0
  14. package/public/assets/openvolo-logo-transparent.png +0 -0
  15. package/public/favicon-16x16.png +0 -0
  16. package/public/favicon-32x32.png +0 -0
  17. package/public/favicon.ico +0 -0
  18. package/public/site.webmanifest +19 -0
  19. package/src/app/api/analytics/agents/route.ts +30 -0
  20. package/src/app/api/analytics/content/route.ts +24 -0
  21. package/src/app/api/analytics/engagement/route.ts +24 -0
  22. package/src/app/api/analytics/overview/route.ts +22 -0
  23. package/src/app/api/analytics/sync-health/route.ts +22 -0
  24. package/src/app/api/contacts/[id]/identities/[identityId]/route.ts +24 -0
  25. package/src/app/api/contacts/[id]/identities/route.ts +61 -0
  26. package/src/app/api/contacts/[id]/route.ts +72 -0
  27. package/src/app/api/contacts/route.ts +91 -0
  28. package/src/app/api/content/[id]/route.ts +61 -0
  29. package/src/app/api/content/route.ts +48 -0
  30. package/src/app/api/platforms/gmail/auth/route.ts +50 -0
  31. package/src/app/api/platforms/gmail/callback/route.ts +126 -0
  32. package/src/app/api/platforms/gmail/route.ts +60 -0
  33. package/src/app/api/platforms/gmail/sync/route.ts +96 -0
  34. package/src/app/api/platforms/linkedin/auth/route.ts +40 -0
  35. package/src/app/api/platforms/linkedin/callback/route.ts +128 -0
  36. package/src/app/api/platforms/linkedin/import/route.ts +40 -0
  37. package/src/app/api/platforms/linkedin/route.ts +60 -0
  38. package/src/app/api/platforms/linkedin/sync/route.ts +85 -0
  39. package/src/app/api/platforms/x/auth/route.ts +52 -0
  40. package/src/app/api/platforms/x/browser-session/route.ts +79 -0
  41. package/src/app/api/platforms/x/callback/route.ts +130 -0
  42. package/src/app/api/platforms/x/compose/route.ts +247 -0
  43. package/src/app/api/platforms/x/engage/route.ts +113 -0
  44. package/src/app/api/platforms/x/enrich/route.ts +79 -0
  45. package/src/app/api/platforms/x/route.ts +63 -0
  46. package/src/app/api/platforms/x/sync/route.ts +142 -0
  47. package/src/app/api/settings/route.ts +43 -0
  48. package/src/app/api/settings/search-api/route.ts +180 -0
  49. package/src/app/api/tasks/[id]/route.ts +60 -0
  50. package/src/app/api/tasks/route.ts +39 -0
  51. package/src/app/api/workflows/[id]/progress/route.ts +45 -0
  52. package/src/app/api/workflows/[id]/route.ts +20 -0
  53. package/src/app/api/workflows/route.ts +30 -0
  54. package/src/app/api/workflows/run-agent/route.ts +44 -0
  55. package/src/app/api/workflows/templates/[id]/activate/route.ts +64 -0
  56. package/src/app/api/workflows/templates/[id]/route.ts +75 -0
  57. package/src/app/api/workflows/templates/route.ts +60 -0
  58. package/src/app/dashboard/analytics/analytics-dashboard.tsx +535 -0
  59. package/src/app/dashboard/analytics/page.tsx +15 -0
  60. package/src/app/dashboard/contacts/[id]/contact-detail-client.tsx +334 -0
  61. package/src/app/dashboard/contacts/[id]/page.tsx +21 -0
  62. package/src/app/dashboard/contacts/contact-list-client.tsx +213 -0
  63. package/src/app/dashboard/contacts/page.tsx +38 -0
  64. package/src/app/dashboard/content/[id]/engagement-actions.tsx +167 -0
  65. package/src/app/dashboard/content/[id]/page.tsx +253 -0
  66. package/src/app/dashboard/content/content-list-client.tsx +428 -0
  67. package/src/app/dashboard/content/page.tsx +39 -0
  68. package/src/app/dashboard/help/page.tsx +1247 -0
  69. package/src/app/dashboard/layout.tsx +19 -0
  70. package/src/app/dashboard/page.tsx +187 -0
  71. package/src/app/dashboard/settings/page.tsx +1664 -0
  72. package/src/app/dashboard/workflows/[id]/page.tsx +90 -0
  73. package/src/app/dashboard/workflows/[id]/workflow-detail-steps.tsx +55 -0
  74. package/src/app/dashboard/workflows/[id]/workflow-run-live.tsx +195 -0
  75. package/src/app/dashboard/workflows/activate-dialog.tsx +251 -0
  76. package/src/app/dashboard/workflows/page.tsx +41 -0
  77. package/src/app/dashboard/workflows/template-gallery.tsx +201 -0
  78. package/src/app/dashboard/workflows/workflow-quick-actions.tsx +121 -0
  79. package/src/app/dashboard/workflows/workflow-view-switcher.tsx +62 -0
  80. package/src/app/globals.css +232 -0
  81. package/src/app/layout.tsx +57 -0
  82. package/src/app/page.tsx +5 -0
  83. package/src/components/add-contact-dialog.tsx +74 -0
  84. package/src/components/add-task-dialog.tsx +153 -0
  85. package/src/components/animated-stat.tsx +53 -0
  86. package/src/components/app-sidebar.tsx +130 -0
  87. package/src/components/charts/area-chart-card.tsx +99 -0
  88. package/src/components/charts/bar-chart-card.tsx +128 -0
  89. package/src/components/charts/chart-skeleton.tsx +43 -0
  90. package/src/components/charts/donut-chart-card.tsx +100 -0
  91. package/src/components/charts/ranked-table-card.tsx +127 -0
  92. package/src/components/charts/stat-cards-row.tsx +45 -0
  93. package/src/components/compose-dialog.tsx +344 -0
  94. package/src/components/contact-form.tsx +218 -0
  95. package/src/components/dashboard-greeting.tsx +27 -0
  96. package/src/components/dashboard-header.tsx +87 -0
  97. package/src/components/empty-state.tsx +32 -0
  98. package/src/components/enrich-button.tsx +107 -0
  99. package/src/components/enrichment-score-badge.tsx +30 -0
  100. package/src/components/funnel-stage-badge.tsx +19 -0
  101. package/src/components/funnel-visualization.tsx +66 -0
  102. package/src/components/identities-section.tsx +219 -0
  103. package/src/components/pagination-controls.tsx +115 -0
  104. package/src/components/platform-connection-card.tsx +292 -0
  105. package/src/components/priority-badge.tsx +17 -0
  106. package/src/components/step-output-renderer.tsx +63 -0
  107. package/src/components/tweet-input.tsx +126 -0
  108. package/src/components/ui/alert-dialog.tsx +196 -0
  109. package/src/components/ui/avatar.tsx +109 -0
  110. package/src/components/ui/badge.tsx +48 -0
  111. package/src/components/ui/button.tsx +64 -0
  112. package/src/components/ui/card.tsx +92 -0
  113. package/src/components/ui/chart.tsx +357 -0
  114. package/src/components/ui/dialog.tsx +158 -0
  115. package/src/components/ui/dropdown-menu.tsx +257 -0
  116. package/src/components/ui/input.tsx +21 -0
  117. package/src/components/ui/label.tsx +24 -0
  118. package/src/components/ui/progress.tsx +31 -0
  119. package/src/components/ui/scroll-area.tsx +58 -0
  120. package/src/components/ui/select.tsx +190 -0
  121. package/src/components/ui/separator.tsx +28 -0
  122. package/src/components/ui/sheet.tsx +143 -0
  123. package/src/components/ui/sidebar.tsx +726 -0
  124. package/src/components/ui/skeleton.tsx +13 -0
  125. package/src/components/ui/table.tsx +116 -0
  126. package/src/components/ui/tabs.tsx +91 -0
  127. package/src/components/ui/textarea.tsx +18 -0
  128. package/src/components/ui/tooltip.tsx +57 -0
  129. package/src/components/workflow-graph-view.tsx +205 -0
  130. package/src/components/workflow-kanban-view.tsx +69 -0
  131. package/src/components/workflow-list-view.tsx +201 -0
  132. package/src/components/workflow-progress-card.tsx +150 -0
  133. package/src/components/workflow-run-card.tsx +144 -0
  134. package/src/components/workflow-step-timeline.tsx +173 -0
  135. package/src/components/workflow-swimlane-view.tsx +87 -0
  136. package/src/hooks/use-mobile.ts +19 -0
  137. package/src/hooks/use-workflow-polling.ts +85 -0
  138. package/src/lib/agents/router.ts +79 -0
  139. package/src/lib/agents/run-agent-workflow.ts +605 -0
  140. package/src/lib/agents/tools/browser-scrape.ts +118 -0
  141. package/src/lib/agents/tools/enrich-contact.ts +128 -0
  142. package/src/lib/agents/tools/search-web.ts +473 -0
  143. package/src/lib/agents/tools/update-progress.ts +40 -0
  144. package/src/lib/agents/tools/url-fetch.ts +152 -0
  145. package/src/lib/agents/types.ts +79 -0
  146. package/src/lib/analytics/utils.ts +33 -0
  147. package/src/lib/auth/claude-auth.ts +134 -0
  148. package/src/lib/auth/crypto.ts +58 -0
  149. package/src/lib/browser/anti-detection.ts +79 -0
  150. package/src/lib/browser/extractors/profile-merger.ts +71 -0
  151. package/src/lib/browser/extractors/profile-parser.ts +133 -0
  152. package/src/lib/browser/platforms/x-scraper.ts +269 -0
  153. package/src/lib/browser/scraper.ts +92 -0
  154. package/src/lib/browser/session.ts +229 -0
  155. package/src/lib/browser/types.ts +80 -0
  156. package/src/lib/db/client.ts +24 -0
  157. package/src/lib/db/enrichment.ts +90 -0
  158. package/src/lib/db/migrate-identities.ts +95 -0
  159. package/src/lib/db/migrate.ts +33 -0
  160. package/src/lib/db/migrations/0000_tired_thanos.sql +296 -0
  161. package/src/lib/db/migrations/meta/0000_snapshot.json +2169 -0
  162. package/src/lib/db/migrations/meta/_journal.json +13 -0
  163. package/src/lib/db/queries/analytics.ts +449 -0
  164. package/src/lib/db/queries/contacts.ts +170 -0
  165. package/src/lib/db/queries/content.ts +215 -0
  166. package/src/lib/db/queries/dashboard.ts +79 -0
  167. package/src/lib/db/queries/engagements.ts +35 -0
  168. package/src/lib/db/queries/identities.ts +51 -0
  169. package/src/lib/db/queries/platform-accounts.ts +53 -0
  170. package/src/lib/db/queries/sync.ts +74 -0
  171. package/src/lib/db/queries/tasks.ts +88 -0
  172. package/src/lib/db/queries/workflow-templates.ts +213 -0
  173. package/src/lib/db/queries/workflows.ts +167 -0
  174. package/src/lib/db/schema.ts +437 -0
  175. package/src/lib/db/seed-templates.ts +221 -0
  176. package/src/lib/db/types.ts +78 -0
  177. package/src/lib/pagination.ts +12 -0
  178. package/src/lib/platforms/adapter.ts +75 -0
  179. package/src/lib/platforms/gmail/adapter.ts +112 -0
  180. package/src/lib/platforms/gmail/auth.ts +137 -0
  181. package/src/lib/platforms/gmail/client.ts +255 -0
  182. package/src/lib/platforms/gmail/mappers.ts +125 -0
  183. package/src/lib/platforms/gmail/oauth-state-store.ts +65 -0
  184. package/src/lib/platforms/index.ts +22 -0
  185. package/src/lib/platforms/linkedin/adapter.ts +164 -0
  186. package/src/lib/platforms/linkedin/auth.ts +124 -0
  187. package/src/lib/platforms/linkedin/client.ts +183 -0
  188. package/src/lib/platforms/linkedin/csv-import.ts +283 -0
  189. package/src/lib/platforms/linkedin/mappers.ts +123 -0
  190. package/src/lib/platforms/linkedin/oauth-state-store.ts +65 -0
  191. package/src/lib/platforms/rate-limiter.ts +88 -0
  192. package/src/lib/platforms/sync-contacts.ts +121 -0
  193. package/src/lib/platforms/sync-content.ts +225 -0
  194. package/src/lib/platforms/sync-gmail-contacts.ts +186 -0
  195. package/src/lib/platforms/sync-gmail-metadata.ts +158 -0
  196. package/src/lib/platforms/sync-linkedin-contacts.ts +148 -0
  197. package/src/lib/platforms/sync-x-profiles.ts +280 -0
  198. package/src/lib/platforms/x/adapter.ts +129 -0
  199. package/src/lib/platforms/x/auth.ts +165 -0
  200. package/src/lib/platforms/x/client.ts +390 -0
  201. package/src/lib/platforms/x/mappers.ts +134 -0
  202. package/src/lib/platforms/x/pkce-store.ts +67 -0
  203. package/src/lib/utils.ts +6 -0
  204. package/src/lib/workflows/format-error.test.ts +177 -0
  205. package/src/lib/workflows/format-error.ts +207 -0
  206. package/src/lib/workflows/run-sync-workflow.ts +141 -0
  207. package/src/lib/workflows/types.ts +71 -0
  208. package/tsconfig.json +42 -0
@@ -0,0 +1,2169 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "37e58bfd-e4c7-414e-8a5d-aee2825b5b15",
5
+ "prevId": "00000000-0000-0000-0000-000000000000",
6
+ "tables": {
7
+ "contact_identities": {
8
+ "name": "contact_identities",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "contact_id": {
18
+ "name": "contact_id",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "platform": {
25
+ "name": "platform",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "platform_user_id": {
32
+ "name": "platform_user_id",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": true,
36
+ "autoincrement": false
37
+ },
38
+ "platform_handle": {
39
+ "name": "platform_handle",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "platform_url": {
46
+ "name": "platform_url",
47
+ "type": "text",
48
+ "primaryKey": false,
49
+ "notNull": false,
50
+ "autoincrement": false
51
+ },
52
+ "platform_data": {
53
+ "name": "platform_data",
54
+ "type": "text",
55
+ "primaryKey": false,
56
+ "notNull": false,
57
+ "autoincrement": false,
58
+ "default": "'{}'"
59
+ },
60
+ "is_primary": {
61
+ "name": "is_primary",
62
+ "type": "integer",
63
+ "primaryKey": false,
64
+ "notNull": true,
65
+ "autoincrement": false,
66
+ "default": 0
67
+ },
68
+ "is_active": {
69
+ "name": "is_active",
70
+ "type": "integer",
71
+ "primaryKey": false,
72
+ "notNull": true,
73
+ "autoincrement": false,
74
+ "default": 1
75
+ },
76
+ "last_synced_at": {
77
+ "name": "last_synced_at",
78
+ "type": "integer",
79
+ "primaryKey": false,
80
+ "notNull": false,
81
+ "autoincrement": false
82
+ },
83
+ "sync_errors": {
84
+ "name": "sync_errors",
85
+ "type": "text",
86
+ "primaryKey": false,
87
+ "notNull": false,
88
+ "autoincrement": false
89
+ },
90
+ "created_at": {
91
+ "name": "created_at",
92
+ "type": "integer",
93
+ "primaryKey": false,
94
+ "notNull": true,
95
+ "autoincrement": false,
96
+ "default": "(unixepoch())"
97
+ },
98
+ "updated_at": {
99
+ "name": "updated_at",
100
+ "type": "integer",
101
+ "primaryKey": false,
102
+ "notNull": true,
103
+ "autoincrement": false,
104
+ "default": "(unixepoch())"
105
+ }
106
+ },
107
+ "indexes": {
108
+ "idx_identity_platform_user": {
109
+ "name": "idx_identity_platform_user",
110
+ "columns": [
111
+ "platform",
112
+ "platform_user_id"
113
+ ],
114
+ "isUnique": true
115
+ },
116
+ "idx_identity_contact": {
117
+ "name": "idx_identity_contact",
118
+ "columns": [
119
+ "contact_id"
120
+ ],
121
+ "isUnique": false
122
+ }
123
+ },
124
+ "foreignKeys": {
125
+ "contact_identities_contact_id_contacts_id_fk": {
126
+ "name": "contact_identities_contact_id_contacts_id_fk",
127
+ "tableFrom": "contact_identities",
128
+ "tableTo": "contacts",
129
+ "columnsFrom": [
130
+ "contact_id"
131
+ ],
132
+ "columnsTo": [
133
+ "id"
134
+ ],
135
+ "onDelete": "cascade",
136
+ "onUpdate": "no action"
137
+ }
138
+ },
139
+ "compositePrimaryKeys": {},
140
+ "uniqueConstraints": {},
141
+ "checkConstraints": {}
142
+ },
143
+ "contacts": {
144
+ "name": "contacts",
145
+ "columns": {
146
+ "id": {
147
+ "name": "id",
148
+ "type": "text",
149
+ "primaryKey": true,
150
+ "notNull": true,
151
+ "autoincrement": false
152
+ },
153
+ "name": {
154
+ "name": "name",
155
+ "type": "text",
156
+ "primaryKey": false,
157
+ "notNull": true,
158
+ "autoincrement": false
159
+ },
160
+ "first_name": {
161
+ "name": "first_name",
162
+ "type": "text",
163
+ "primaryKey": false,
164
+ "notNull": false,
165
+ "autoincrement": false
166
+ },
167
+ "last_name": {
168
+ "name": "last_name",
169
+ "type": "text",
170
+ "primaryKey": false,
171
+ "notNull": false,
172
+ "autoincrement": false
173
+ },
174
+ "headline": {
175
+ "name": "headline",
176
+ "type": "text",
177
+ "primaryKey": false,
178
+ "notNull": false,
179
+ "autoincrement": false
180
+ },
181
+ "company": {
182
+ "name": "company",
183
+ "type": "text",
184
+ "primaryKey": false,
185
+ "notNull": false,
186
+ "autoincrement": false
187
+ },
188
+ "title": {
189
+ "name": "title",
190
+ "type": "text",
191
+ "primaryKey": false,
192
+ "notNull": false,
193
+ "autoincrement": false
194
+ },
195
+ "platform": {
196
+ "name": "platform",
197
+ "type": "text",
198
+ "primaryKey": false,
199
+ "notNull": false,
200
+ "autoincrement": false
201
+ },
202
+ "platform_user_id": {
203
+ "name": "platform_user_id",
204
+ "type": "text",
205
+ "primaryKey": false,
206
+ "notNull": false,
207
+ "autoincrement": false
208
+ },
209
+ "profile_url": {
210
+ "name": "profile_url",
211
+ "type": "text",
212
+ "primaryKey": false,
213
+ "notNull": false,
214
+ "autoincrement": false
215
+ },
216
+ "avatar_url": {
217
+ "name": "avatar_url",
218
+ "type": "text",
219
+ "primaryKey": false,
220
+ "notNull": false,
221
+ "autoincrement": false
222
+ },
223
+ "email": {
224
+ "name": "email",
225
+ "type": "text",
226
+ "primaryKey": false,
227
+ "notNull": false,
228
+ "autoincrement": false
229
+ },
230
+ "phone": {
231
+ "name": "phone",
232
+ "type": "text",
233
+ "primaryKey": false,
234
+ "notNull": false,
235
+ "autoincrement": false
236
+ },
237
+ "bio": {
238
+ "name": "bio",
239
+ "type": "text",
240
+ "primaryKey": false,
241
+ "notNull": false,
242
+ "autoincrement": false
243
+ },
244
+ "location": {
245
+ "name": "location",
246
+ "type": "text",
247
+ "primaryKey": false,
248
+ "notNull": false,
249
+ "autoincrement": false
250
+ },
251
+ "website": {
252
+ "name": "website",
253
+ "type": "text",
254
+ "primaryKey": false,
255
+ "notNull": false,
256
+ "autoincrement": false
257
+ },
258
+ "photo_url": {
259
+ "name": "photo_url",
260
+ "type": "text",
261
+ "primaryKey": false,
262
+ "notNull": false,
263
+ "autoincrement": false
264
+ },
265
+ "verified_email": {
266
+ "name": "verified_email",
267
+ "type": "integer",
268
+ "primaryKey": false,
269
+ "notNull": true,
270
+ "autoincrement": false,
271
+ "default": 0
272
+ },
273
+ "enrichment_score": {
274
+ "name": "enrichment_score",
275
+ "type": "integer",
276
+ "primaryKey": false,
277
+ "notNull": true,
278
+ "autoincrement": false,
279
+ "default": 0
280
+ },
281
+ "tags": {
282
+ "name": "tags",
283
+ "type": "text",
284
+ "primaryKey": false,
285
+ "notNull": false,
286
+ "autoincrement": false,
287
+ "default": "'[]'"
288
+ },
289
+ "funnel_stage": {
290
+ "name": "funnel_stage",
291
+ "type": "text",
292
+ "primaryKey": false,
293
+ "notNull": true,
294
+ "autoincrement": false,
295
+ "default": "'prospect'"
296
+ },
297
+ "score": {
298
+ "name": "score",
299
+ "type": "integer",
300
+ "primaryKey": false,
301
+ "notNull": true,
302
+ "autoincrement": false,
303
+ "default": 0
304
+ },
305
+ "metadata": {
306
+ "name": "metadata",
307
+ "type": "text",
308
+ "primaryKey": false,
309
+ "notNull": false,
310
+ "autoincrement": false,
311
+ "default": "'{}'"
312
+ },
313
+ "last_interaction_at": {
314
+ "name": "last_interaction_at",
315
+ "type": "integer",
316
+ "primaryKey": false,
317
+ "notNull": false,
318
+ "autoincrement": false
319
+ },
320
+ "created_at": {
321
+ "name": "created_at",
322
+ "type": "integer",
323
+ "primaryKey": false,
324
+ "notNull": true,
325
+ "autoincrement": false,
326
+ "default": "(unixepoch())"
327
+ },
328
+ "updated_at": {
329
+ "name": "updated_at",
330
+ "type": "integer",
331
+ "primaryKey": false,
332
+ "notNull": true,
333
+ "autoincrement": false,
334
+ "default": "(unixepoch())"
335
+ }
336
+ },
337
+ "indexes": {
338
+ "idx_contacts_email": {
339
+ "name": "idx_contacts_email",
340
+ "columns": [
341
+ "email"
342
+ ],
343
+ "isUnique": false
344
+ },
345
+ "idx_contacts_name": {
346
+ "name": "idx_contacts_name",
347
+ "columns": [
348
+ "name"
349
+ ],
350
+ "isUnique": false
351
+ },
352
+ "idx_contacts_company": {
353
+ "name": "idx_contacts_company",
354
+ "columns": [
355
+ "company"
356
+ ],
357
+ "isUnique": false
358
+ }
359
+ },
360
+ "foreignKeys": {},
361
+ "compositePrimaryKeys": {},
362
+ "uniqueConstraints": {},
363
+ "checkConstraints": {}
364
+ },
365
+ "content_items": {
366
+ "name": "content_items",
367
+ "columns": {
368
+ "id": {
369
+ "name": "id",
370
+ "type": "text",
371
+ "primaryKey": true,
372
+ "notNull": true,
373
+ "autoincrement": false
374
+ },
375
+ "title": {
376
+ "name": "title",
377
+ "type": "text",
378
+ "primaryKey": false,
379
+ "notNull": false,
380
+ "autoincrement": false
381
+ },
382
+ "body": {
383
+ "name": "body",
384
+ "type": "text",
385
+ "primaryKey": false,
386
+ "notNull": false,
387
+ "autoincrement": false
388
+ },
389
+ "content_type": {
390
+ "name": "content_type",
391
+ "type": "text",
392
+ "primaryKey": false,
393
+ "notNull": true,
394
+ "autoincrement": false
395
+ },
396
+ "platform_target": {
397
+ "name": "platform_target",
398
+ "type": "text",
399
+ "primaryKey": false,
400
+ "notNull": false,
401
+ "autoincrement": false
402
+ },
403
+ "media_paths": {
404
+ "name": "media_paths",
405
+ "type": "text",
406
+ "primaryKey": false,
407
+ "notNull": false,
408
+ "autoincrement": false,
409
+ "default": "'[]'"
410
+ },
411
+ "status": {
412
+ "name": "status",
413
+ "type": "text",
414
+ "primaryKey": false,
415
+ "notNull": true,
416
+ "autoincrement": false,
417
+ "default": "'draft'"
418
+ },
419
+ "ai_generated": {
420
+ "name": "ai_generated",
421
+ "type": "integer",
422
+ "primaryKey": false,
423
+ "notNull": true,
424
+ "autoincrement": false,
425
+ "default": false
426
+ },
427
+ "generation_prompt": {
428
+ "name": "generation_prompt",
429
+ "type": "text",
430
+ "primaryKey": false,
431
+ "notNull": false,
432
+ "autoincrement": false
433
+ },
434
+ "scheduled_at": {
435
+ "name": "scheduled_at",
436
+ "type": "integer",
437
+ "primaryKey": false,
438
+ "notNull": false,
439
+ "autoincrement": false
440
+ },
441
+ "origin": {
442
+ "name": "origin",
443
+ "type": "text",
444
+ "primaryKey": false,
445
+ "notNull": false,
446
+ "autoincrement": false
447
+ },
448
+ "direction": {
449
+ "name": "direction",
450
+ "type": "text",
451
+ "primaryKey": false,
452
+ "notNull": false,
453
+ "autoincrement": false
454
+ },
455
+ "platform_account_id": {
456
+ "name": "platform_account_id",
457
+ "type": "text",
458
+ "primaryKey": false,
459
+ "notNull": false,
460
+ "autoincrement": false
461
+ },
462
+ "thread_id": {
463
+ "name": "thread_id",
464
+ "type": "text",
465
+ "primaryKey": false,
466
+ "notNull": false,
467
+ "autoincrement": false
468
+ },
469
+ "parent_item_id": {
470
+ "name": "parent_item_id",
471
+ "type": "text",
472
+ "primaryKey": false,
473
+ "notNull": false,
474
+ "autoincrement": false
475
+ },
476
+ "contact_id": {
477
+ "name": "contact_id",
478
+ "type": "text",
479
+ "primaryKey": false,
480
+ "notNull": false,
481
+ "autoincrement": false
482
+ },
483
+ "platform_data": {
484
+ "name": "platform_data",
485
+ "type": "text",
486
+ "primaryKey": false,
487
+ "notNull": false,
488
+ "autoincrement": false,
489
+ "default": "'{}'"
490
+ },
491
+ "created_at": {
492
+ "name": "created_at",
493
+ "type": "integer",
494
+ "primaryKey": false,
495
+ "notNull": true,
496
+ "autoincrement": false,
497
+ "default": "(unixepoch())"
498
+ },
499
+ "updated_at": {
500
+ "name": "updated_at",
501
+ "type": "integer",
502
+ "primaryKey": false,
503
+ "notNull": true,
504
+ "autoincrement": false,
505
+ "default": "(unixepoch())"
506
+ }
507
+ },
508
+ "indexes": {
509
+ "idx_content_items_type": {
510
+ "name": "idx_content_items_type",
511
+ "columns": [
512
+ "content_type"
513
+ ],
514
+ "isUnique": false
515
+ },
516
+ "idx_content_items_status": {
517
+ "name": "idx_content_items_status",
518
+ "columns": [
519
+ "status"
520
+ ],
521
+ "isUnique": false
522
+ },
523
+ "idx_content_items_origin": {
524
+ "name": "idx_content_items_origin",
525
+ "columns": [
526
+ "origin"
527
+ ],
528
+ "isUnique": false
529
+ },
530
+ "idx_content_items_account": {
531
+ "name": "idx_content_items_account",
532
+ "columns": [
533
+ "platform_account_id"
534
+ ],
535
+ "isUnique": false
536
+ }
537
+ },
538
+ "foreignKeys": {
539
+ "content_items_platform_account_id_platform_accounts_id_fk": {
540
+ "name": "content_items_platform_account_id_platform_accounts_id_fk",
541
+ "tableFrom": "content_items",
542
+ "tableTo": "platform_accounts",
543
+ "columnsFrom": [
544
+ "platform_account_id"
545
+ ],
546
+ "columnsTo": [
547
+ "id"
548
+ ],
549
+ "onDelete": "no action",
550
+ "onUpdate": "no action"
551
+ },
552
+ "content_items_contact_id_contacts_id_fk": {
553
+ "name": "content_items_contact_id_contacts_id_fk",
554
+ "tableFrom": "content_items",
555
+ "tableTo": "contacts",
556
+ "columnsFrom": [
557
+ "contact_id"
558
+ ],
559
+ "columnsTo": [
560
+ "id"
561
+ ],
562
+ "onDelete": "no action",
563
+ "onUpdate": "no action"
564
+ }
565
+ },
566
+ "compositePrimaryKeys": {},
567
+ "uniqueConstraints": {},
568
+ "checkConstraints": {}
569
+ },
570
+ "content_posts": {
571
+ "name": "content_posts",
572
+ "columns": {
573
+ "id": {
574
+ "name": "id",
575
+ "type": "text",
576
+ "primaryKey": true,
577
+ "notNull": true,
578
+ "autoincrement": false
579
+ },
580
+ "content_item_id": {
581
+ "name": "content_item_id",
582
+ "type": "text",
583
+ "primaryKey": false,
584
+ "notNull": true,
585
+ "autoincrement": false
586
+ },
587
+ "platform_account_id": {
588
+ "name": "platform_account_id",
589
+ "type": "text",
590
+ "primaryKey": false,
591
+ "notNull": true,
592
+ "autoincrement": false
593
+ },
594
+ "platform_post_id": {
595
+ "name": "platform_post_id",
596
+ "type": "text",
597
+ "primaryKey": false,
598
+ "notNull": false,
599
+ "autoincrement": false
600
+ },
601
+ "platform_url": {
602
+ "name": "platform_url",
603
+ "type": "text",
604
+ "primaryKey": false,
605
+ "notNull": false,
606
+ "autoincrement": false
607
+ },
608
+ "published_at": {
609
+ "name": "published_at",
610
+ "type": "integer",
611
+ "primaryKey": false,
612
+ "notNull": false,
613
+ "autoincrement": false
614
+ },
615
+ "status": {
616
+ "name": "status",
617
+ "type": "text",
618
+ "primaryKey": false,
619
+ "notNull": true,
620
+ "autoincrement": false,
621
+ "default": "'scheduled'"
622
+ },
623
+ "engagement_snapshot": {
624
+ "name": "engagement_snapshot",
625
+ "type": "text",
626
+ "primaryKey": false,
627
+ "notNull": false,
628
+ "autoincrement": false,
629
+ "default": "'{}'"
630
+ }
631
+ },
632
+ "indexes": {
633
+ "idx_content_posts_platform_id": {
634
+ "name": "idx_content_posts_platform_id",
635
+ "columns": [
636
+ "platform_post_id",
637
+ "platform_account_id"
638
+ ],
639
+ "isUnique": true
640
+ }
641
+ },
642
+ "foreignKeys": {
643
+ "content_posts_content_item_id_content_items_id_fk": {
644
+ "name": "content_posts_content_item_id_content_items_id_fk",
645
+ "tableFrom": "content_posts",
646
+ "tableTo": "content_items",
647
+ "columnsFrom": [
648
+ "content_item_id"
649
+ ],
650
+ "columnsTo": [
651
+ "id"
652
+ ],
653
+ "onDelete": "cascade",
654
+ "onUpdate": "no action"
655
+ },
656
+ "content_posts_platform_account_id_platform_accounts_id_fk": {
657
+ "name": "content_posts_platform_account_id_platform_accounts_id_fk",
658
+ "tableFrom": "content_posts",
659
+ "tableTo": "platform_accounts",
660
+ "columnsFrom": [
661
+ "platform_account_id"
662
+ ],
663
+ "columnsTo": [
664
+ "id"
665
+ ],
666
+ "onDelete": "cascade",
667
+ "onUpdate": "no action"
668
+ }
669
+ },
670
+ "compositePrimaryKeys": {},
671
+ "uniqueConstraints": {},
672
+ "checkConstraints": {}
673
+ },
674
+ "engagement_metrics": {
675
+ "name": "engagement_metrics",
676
+ "columns": {
677
+ "id": {
678
+ "name": "id",
679
+ "type": "text",
680
+ "primaryKey": true,
681
+ "notNull": true,
682
+ "autoincrement": false
683
+ },
684
+ "content_post_id": {
685
+ "name": "content_post_id",
686
+ "type": "text",
687
+ "primaryKey": false,
688
+ "notNull": true,
689
+ "autoincrement": false
690
+ },
691
+ "snapshot_at": {
692
+ "name": "snapshot_at",
693
+ "type": "integer",
694
+ "primaryKey": false,
695
+ "notNull": true,
696
+ "autoincrement": false,
697
+ "default": "(unixepoch())"
698
+ },
699
+ "likes": {
700
+ "name": "likes",
701
+ "type": "integer",
702
+ "primaryKey": false,
703
+ "notNull": true,
704
+ "autoincrement": false,
705
+ "default": 0
706
+ },
707
+ "comments": {
708
+ "name": "comments",
709
+ "type": "integer",
710
+ "primaryKey": false,
711
+ "notNull": true,
712
+ "autoincrement": false,
713
+ "default": 0
714
+ },
715
+ "shares": {
716
+ "name": "shares",
717
+ "type": "integer",
718
+ "primaryKey": false,
719
+ "notNull": true,
720
+ "autoincrement": false,
721
+ "default": 0
722
+ },
723
+ "impressions": {
724
+ "name": "impressions",
725
+ "type": "integer",
726
+ "primaryKey": false,
727
+ "notNull": true,
728
+ "autoincrement": false,
729
+ "default": 0
730
+ },
731
+ "clicks": {
732
+ "name": "clicks",
733
+ "type": "integer",
734
+ "primaryKey": false,
735
+ "notNull": true,
736
+ "autoincrement": false,
737
+ "default": 0
738
+ },
739
+ "bookmarks": {
740
+ "name": "bookmarks",
741
+ "type": "integer",
742
+ "primaryKey": false,
743
+ "notNull": true,
744
+ "autoincrement": false,
745
+ "default": 0
746
+ },
747
+ "quotes": {
748
+ "name": "quotes",
749
+ "type": "integer",
750
+ "primaryKey": false,
751
+ "notNull": true,
752
+ "autoincrement": false,
753
+ "default": 0
754
+ },
755
+ "retweets": {
756
+ "name": "retweets",
757
+ "type": "integer",
758
+ "primaryKey": false,
759
+ "notNull": true,
760
+ "autoincrement": false,
761
+ "default": 0
762
+ }
763
+ },
764
+ "indexes": {
765
+ "idx_engagement_metrics_post": {
766
+ "name": "idx_engagement_metrics_post",
767
+ "columns": [
768
+ "content_post_id"
769
+ ],
770
+ "isUnique": false
771
+ },
772
+ "idx_engagement_metrics_snapshot": {
773
+ "name": "idx_engagement_metrics_snapshot",
774
+ "columns": [
775
+ "snapshot_at"
776
+ ],
777
+ "isUnique": false
778
+ }
779
+ },
780
+ "foreignKeys": {
781
+ "engagement_metrics_content_post_id_content_posts_id_fk": {
782
+ "name": "engagement_metrics_content_post_id_content_posts_id_fk",
783
+ "tableFrom": "engagement_metrics",
784
+ "tableTo": "content_posts",
785
+ "columnsFrom": [
786
+ "content_post_id"
787
+ ],
788
+ "columnsTo": [
789
+ "id"
790
+ ],
791
+ "onDelete": "cascade",
792
+ "onUpdate": "no action"
793
+ }
794
+ },
795
+ "compositePrimaryKeys": {},
796
+ "uniqueConstraints": {},
797
+ "checkConstraints": {}
798
+ },
799
+ "engagements": {
800
+ "name": "engagements",
801
+ "columns": {
802
+ "id": {
803
+ "name": "id",
804
+ "type": "text",
805
+ "primaryKey": true,
806
+ "notNull": true,
807
+ "autoincrement": false
808
+ },
809
+ "contact_id": {
810
+ "name": "contact_id",
811
+ "type": "text",
812
+ "primaryKey": false,
813
+ "notNull": false,
814
+ "autoincrement": false
815
+ },
816
+ "platform_account_id": {
817
+ "name": "platform_account_id",
818
+ "type": "text",
819
+ "primaryKey": false,
820
+ "notNull": false,
821
+ "autoincrement": false
822
+ },
823
+ "engagement_type": {
824
+ "name": "engagement_type",
825
+ "type": "text",
826
+ "primaryKey": false,
827
+ "notNull": true,
828
+ "autoincrement": false
829
+ },
830
+ "direction": {
831
+ "name": "direction",
832
+ "type": "text",
833
+ "primaryKey": false,
834
+ "notNull": true,
835
+ "autoincrement": false
836
+ },
837
+ "content": {
838
+ "name": "content",
839
+ "type": "text",
840
+ "primaryKey": false,
841
+ "notNull": false,
842
+ "autoincrement": false
843
+ },
844
+ "template_id": {
845
+ "name": "template_id",
846
+ "type": "text",
847
+ "primaryKey": false,
848
+ "notNull": false,
849
+ "autoincrement": false
850
+ },
851
+ "workflow_run_id": {
852
+ "name": "workflow_run_id",
853
+ "type": "text",
854
+ "primaryKey": false,
855
+ "notNull": false,
856
+ "autoincrement": false
857
+ },
858
+ "content_post_id": {
859
+ "name": "content_post_id",
860
+ "type": "text",
861
+ "primaryKey": false,
862
+ "notNull": false,
863
+ "autoincrement": false
864
+ },
865
+ "platform": {
866
+ "name": "platform",
867
+ "type": "text",
868
+ "primaryKey": false,
869
+ "notNull": false,
870
+ "autoincrement": false
871
+ },
872
+ "platform_engagement_id": {
873
+ "name": "platform_engagement_id",
874
+ "type": "text",
875
+ "primaryKey": false,
876
+ "notNull": false,
877
+ "autoincrement": false
878
+ },
879
+ "thread_id": {
880
+ "name": "thread_id",
881
+ "type": "text",
882
+ "primaryKey": false,
883
+ "notNull": false,
884
+ "autoincrement": false
885
+ },
886
+ "source": {
887
+ "name": "source",
888
+ "type": "text",
889
+ "primaryKey": false,
890
+ "notNull": false,
891
+ "autoincrement": false
892
+ },
893
+ "platform_data": {
894
+ "name": "platform_data",
895
+ "type": "text",
896
+ "primaryKey": false,
897
+ "notNull": false,
898
+ "autoincrement": false,
899
+ "default": "'{}'"
900
+ },
901
+ "created_at": {
902
+ "name": "created_at",
903
+ "type": "integer",
904
+ "primaryKey": false,
905
+ "notNull": true,
906
+ "autoincrement": false,
907
+ "default": "(unixepoch())"
908
+ }
909
+ },
910
+ "indexes": {
911
+ "idx_engagements_contact": {
912
+ "name": "idx_engagements_contact",
913
+ "columns": [
914
+ "contact_id"
915
+ ],
916
+ "isUnique": false
917
+ },
918
+ "idx_engagements_content_post": {
919
+ "name": "idx_engagements_content_post",
920
+ "columns": [
921
+ "content_post_id"
922
+ ],
923
+ "isUnique": false
924
+ },
925
+ "idx_engagements_platform_id": {
926
+ "name": "idx_engagements_platform_id",
927
+ "columns": [
928
+ "platform_engagement_id"
929
+ ],
930
+ "isUnique": false
931
+ }
932
+ },
933
+ "foreignKeys": {
934
+ "engagements_contact_id_contacts_id_fk": {
935
+ "name": "engagements_contact_id_contacts_id_fk",
936
+ "tableFrom": "engagements",
937
+ "tableTo": "contacts",
938
+ "columnsFrom": [
939
+ "contact_id"
940
+ ],
941
+ "columnsTo": [
942
+ "id"
943
+ ],
944
+ "onDelete": "cascade",
945
+ "onUpdate": "no action"
946
+ },
947
+ "engagements_platform_account_id_platform_accounts_id_fk": {
948
+ "name": "engagements_platform_account_id_platform_accounts_id_fk",
949
+ "tableFrom": "engagements",
950
+ "tableTo": "platform_accounts",
951
+ "columnsFrom": [
952
+ "platform_account_id"
953
+ ],
954
+ "columnsTo": [
955
+ "id"
956
+ ],
957
+ "onDelete": "no action",
958
+ "onUpdate": "no action"
959
+ },
960
+ "engagements_template_id_workflow_templates_id_fk": {
961
+ "name": "engagements_template_id_workflow_templates_id_fk",
962
+ "tableFrom": "engagements",
963
+ "tableTo": "workflow_templates",
964
+ "columnsFrom": [
965
+ "template_id"
966
+ ],
967
+ "columnsTo": [
968
+ "id"
969
+ ],
970
+ "onDelete": "no action",
971
+ "onUpdate": "no action"
972
+ },
973
+ "engagements_workflow_run_id_workflow_runs_id_fk": {
974
+ "name": "engagements_workflow_run_id_workflow_runs_id_fk",
975
+ "tableFrom": "engagements",
976
+ "tableTo": "workflow_runs",
977
+ "columnsFrom": [
978
+ "workflow_run_id"
979
+ ],
980
+ "columnsTo": [
981
+ "id"
982
+ ],
983
+ "onDelete": "no action",
984
+ "onUpdate": "no action"
985
+ },
986
+ "engagements_content_post_id_content_posts_id_fk": {
987
+ "name": "engagements_content_post_id_content_posts_id_fk",
988
+ "tableFrom": "engagements",
989
+ "tableTo": "content_posts",
990
+ "columnsFrom": [
991
+ "content_post_id"
992
+ ],
993
+ "columnsTo": [
994
+ "id"
995
+ ],
996
+ "onDelete": "no action",
997
+ "onUpdate": "no action"
998
+ }
999
+ },
1000
+ "compositePrimaryKeys": {},
1001
+ "uniqueConstraints": {},
1002
+ "checkConstraints": {}
1003
+ },
1004
+ "platform_accounts": {
1005
+ "name": "platform_accounts",
1006
+ "columns": {
1007
+ "id": {
1008
+ "name": "id",
1009
+ "type": "text",
1010
+ "primaryKey": true,
1011
+ "notNull": true,
1012
+ "autoincrement": false
1013
+ },
1014
+ "platform": {
1015
+ "name": "platform",
1016
+ "type": "text",
1017
+ "primaryKey": false,
1018
+ "notNull": true,
1019
+ "autoincrement": false
1020
+ },
1021
+ "display_name": {
1022
+ "name": "display_name",
1023
+ "type": "text",
1024
+ "primaryKey": false,
1025
+ "notNull": true,
1026
+ "autoincrement": false
1027
+ },
1028
+ "auth_type": {
1029
+ "name": "auth_type",
1030
+ "type": "text",
1031
+ "primaryKey": false,
1032
+ "notNull": true,
1033
+ "autoincrement": false
1034
+ },
1035
+ "credentials_encrypted": {
1036
+ "name": "credentials_encrypted",
1037
+ "type": "text",
1038
+ "primaryKey": false,
1039
+ "notNull": false,
1040
+ "autoincrement": false
1041
+ },
1042
+ "rate_limit_state": {
1043
+ "name": "rate_limit_state",
1044
+ "type": "text",
1045
+ "primaryKey": false,
1046
+ "notNull": false,
1047
+ "autoincrement": false
1048
+ },
1049
+ "status": {
1050
+ "name": "status",
1051
+ "type": "text",
1052
+ "primaryKey": false,
1053
+ "notNull": true,
1054
+ "autoincrement": false,
1055
+ "default": "'active'"
1056
+ },
1057
+ "last_synced_at": {
1058
+ "name": "last_synced_at",
1059
+ "type": "integer",
1060
+ "primaryKey": false,
1061
+ "notNull": false,
1062
+ "autoincrement": false
1063
+ },
1064
+ "created_at": {
1065
+ "name": "created_at",
1066
+ "type": "integer",
1067
+ "primaryKey": false,
1068
+ "notNull": true,
1069
+ "autoincrement": false,
1070
+ "default": "(unixepoch())"
1071
+ },
1072
+ "updated_at": {
1073
+ "name": "updated_at",
1074
+ "type": "integer",
1075
+ "primaryKey": false,
1076
+ "notNull": true,
1077
+ "autoincrement": false,
1078
+ "default": "(unixepoch())"
1079
+ }
1080
+ },
1081
+ "indexes": {},
1082
+ "foreignKeys": {},
1083
+ "compositePrimaryKeys": {},
1084
+ "uniqueConstraints": {},
1085
+ "checkConstraints": {}
1086
+ },
1087
+ "scheduled_jobs": {
1088
+ "name": "scheduled_jobs",
1089
+ "columns": {
1090
+ "id": {
1091
+ "name": "id",
1092
+ "type": "text",
1093
+ "primaryKey": true,
1094
+ "notNull": true,
1095
+ "autoincrement": false
1096
+ },
1097
+ "job_type": {
1098
+ "name": "job_type",
1099
+ "type": "text",
1100
+ "primaryKey": false,
1101
+ "notNull": true,
1102
+ "autoincrement": false
1103
+ },
1104
+ "payload": {
1105
+ "name": "payload",
1106
+ "type": "text",
1107
+ "primaryKey": false,
1108
+ "notNull": false,
1109
+ "autoincrement": false,
1110
+ "default": "'{}'"
1111
+ },
1112
+ "status": {
1113
+ "name": "status",
1114
+ "type": "text",
1115
+ "primaryKey": false,
1116
+ "notNull": true,
1117
+ "autoincrement": false,
1118
+ "default": "'pending'"
1119
+ },
1120
+ "run_at": {
1121
+ "name": "run_at",
1122
+ "type": "integer",
1123
+ "primaryKey": false,
1124
+ "notNull": true,
1125
+ "autoincrement": false
1126
+ },
1127
+ "started_at": {
1128
+ "name": "started_at",
1129
+ "type": "integer",
1130
+ "primaryKey": false,
1131
+ "notNull": false,
1132
+ "autoincrement": false
1133
+ },
1134
+ "completed_at": {
1135
+ "name": "completed_at",
1136
+ "type": "integer",
1137
+ "primaryKey": false,
1138
+ "notNull": false,
1139
+ "autoincrement": false
1140
+ },
1141
+ "retry_count": {
1142
+ "name": "retry_count",
1143
+ "type": "integer",
1144
+ "primaryKey": false,
1145
+ "notNull": true,
1146
+ "autoincrement": false,
1147
+ "default": 0
1148
+ },
1149
+ "max_retries": {
1150
+ "name": "max_retries",
1151
+ "type": "integer",
1152
+ "primaryKey": false,
1153
+ "notNull": true,
1154
+ "autoincrement": false,
1155
+ "default": 3
1156
+ },
1157
+ "error": {
1158
+ "name": "error",
1159
+ "type": "text",
1160
+ "primaryKey": false,
1161
+ "notNull": false,
1162
+ "autoincrement": false
1163
+ },
1164
+ "created_at": {
1165
+ "name": "created_at",
1166
+ "type": "integer",
1167
+ "primaryKey": false,
1168
+ "notNull": true,
1169
+ "autoincrement": false,
1170
+ "default": "(unixepoch())"
1171
+ }
1172
+ },
1173
+ "indexes": {},
1174
+ "foreignKeys": {},
1175
+ "compositePrimaryKeys": {},
1176
+ "uniqueConstraints": {},
1177
+ "checkConstraints": {}
1178
+ },
1179
+ "sync_cursors": {
1180
+ "name": "sync_cursors",
1181
+ "columns": {
1182
+ "id": {
1183
+ "name": "id",
1184
+ "type": "text",
1185
+ "primaryKey": true,
1186
+ "notNull": true,
1187
+ "autoincrement": false
1188
+ },
1189
+ "platform_account_id": {
1190
+ "name": "platform_account_id",
1191
+ "type": "text",
1192
+ "primaryKey": false,
1193
+ "notNull": true,
1194
+ "autoincrement": false
1195
+ },
1196
+ "data_type": {
1197
+ "name": "data_type",
1198
+ "type": "text",
1199
+ "primaryKey": false,
1200
+ "notNull": true,
1201
+ "autoincrement": false
1202
+ },
1203
+ "cursor": {
1204
+ "name": "cursor",
1205
+ "type": "text",
1206
+ "primaryKey": false,
1207
+ "notNull": false,
1208
+ "autoincrement": false
1209
+ },
1210
+ "oldest_fetched_at": {
1211
+ "name": "oldest_fetched_at",
1212
+ "type": "integer",
1213
+ "primaryKey": false,
1214
+ "notNull": false,
1215
+ "autoincrement": false
1216
+ },
1217
+ "newest_fetched_at": {
1218
+ "name": "newest_fetched_at",
1219
+ "type": "integer",
1220
+ "primaryKey": false,
1221
+ "notNull": false,
1222
+ "autoincrement": false
1223
+ },
1224
+ "total_items_synced": {
1225
+ "name": "total_items_synced",
1226
+ "type": "integer",
1227
+ "primaryKey": false,
1228
+ "notNull": true,
1229
+ "autoincrement": false,
1230
+ "default": 0
1231
+ },
1232
+ "sync_status": {
1233
+ "name": "sync_status",
1234
+ "type": "text",
1235
+ "primaryKey": false,
1236
+ "notNull": true,
1237
+ "autoincrement": false,
1238
+ "default": "'idle'"
1239
+ },
1240
+ "sync_progress": {
1241
+ "name": "sync_progress",
1242
+ "type": "text",
1243
+ "primaryKey": false,
1244
+ "notNull": false,
1245
+ "autoincrement": false
1246
+ },
1247
+ "sync_direction": {
1248
+ "name": "sync_direction",
1249
+ "type": "text",
1250
+ "primaryKey": false,
1251
+ "notNull": true,
1252
+ "autoincrement": false,
1253
+ "default": "'backward'"
1254
+ },
1255
+ "last_sync_started_at": {
1256
+ "name": "last_sync_started_at",
1257
+ "type": "integer",
1258
+ "primaryKey": false,
1259
+ "notNull": false,
1260
+ "autoincrement": false
1261
+ },
1262
+ "last_sync_completed_at": {
1263
+ "name": "last_sync_completed_at",
1264
+ "type": "integer",
1265
+ "primaryKey": false,
1266
+ "notNull": false,
1267
+ "autoincrement": false
1268
+ },
1269
+ "last_error": {
1270
+ "name": "last_error",
1271
+ "type": "text",
1272
+ "primaryKey": false,
1273
+ "notNull": false,
1274
+ "autoincrement": false
1275
+ },
1276
+ "created_at": {
1277
+ "name": "created_at",
1278
+ "type": "integer",
1279
+ "primaryKey": false,
1280
+ "notNull": true,
1281
+ "autoincrement": false,
1282
+ "default": "(unixepoch())"
1283
+ },
1284
+ "updated_at": {
1285
+ "name": "updated_at",
1286
+ "type": "integer",
1287
+ "primaryKey": false,
1288
+ "notNull": true,
1289
+ "autoincrement": false,
1290
+ "default": "(unixepoch())"
1291
+ }
1292
+ },
1293
+ "indexes": {
1294
+ "idx_sync_cursor_account_type": {
1295
+ "name": "idx_sync_cursor_account_type",
1296
+ "columns": [
1297
+ "platform_account_id",
1298
+ "data_type"
1299
+ ],
1300
+ "isUnique": true
1301
+ }
1302
+ },
1303
+ "foreignKeys": {
1304
+ "sync_cursors_platform_account_id_platform_accounts_id_fk": {
1305
+ "name": "sync_cursors_platform_account_id_platform_accounts_id_fk",
1306
+ "tableFrom": "sync_cursors",
1307
+ "tableTo": "platform_accounts",
1308
+ "columnsFrom": [
1309
+ "platform_account_id"
1310
+ ],
1311
+ "columnsTo": [
1312
+ "id"
1313
+ ],
1314
+ "onDelete": "cascade",
1315
+ "onUpdate": "no action"
1316
+ }
1317
+ },
1318
+ "compositePrimaryKeys": {},
1319
+ "uniqueConstraints": {},
1320
+ "checkConstraints": {}
1321
+ },
1322
+ "tasks": {
1323
+ "name": "tasks",
1324
+ "columns": {
1325
+ "id": {
1326
+ "name": "id",
1327
+ "type": "text",
1328
+ "primaryKey": true,
1329
+ "notNull": true,
1330
+ "autoincrement": false
1331
+ },
1332
+ "title": {
1333
+ "name": "title",
1334
+ "type": "text",
1335
+ "primaryKey": false,
1336
+ "notNull": true,
1337
+ "autoincrement": false
1338
+ },
1339
+ "description": {
1340
+ "name": "description",
1341
+ "type": "text",
1342
+ "primaryKey": false,
1343
+ "notNull": false,
1344
+ "autoincrement": false
1345
+ },
1346
+ "task_type": {
1347
+ "name": "task_type",
1348
+ "type": "text",
1349
+ "primaryKey": false,
1350
+ "notNull": true,
1351
+ "autoincrement": false,
1352
+ "default": "'manual'"
1353
+ },
1354
+ "status": {
1355
+ "name": "status",
1356
+ "type": "text",
1357
+ "primaryKey": false,
1358
+ "notNull": true,
1359
+ "autoincrement": false,
1360
+ "default": "'todo'"
1361
+ },
1362
+ "priority": {
1363
+ "name": "priority",
1364
+ "type": "text",
1365
+ "primaryKey": false,
1366
+ "notNull": true,
1367
+ "autoincrement": false,
1368
+ "default": "'medium'"
1369
+ },
1370
+ "assignee": {
1371
+ "name": "assignee",
1372
+ "type": "text",
1373
+ "primaryKey": false,
1374
+ "notNull": true,
1375
+ "autoincrement": false,
1376
+ "default": "'user'"
1377
+ },
1378
+ "related_contact_id": {
1379
+ "name": "related_contact_id",
1380
+ "type": "text",
1381
+ "primaryKey": false,
1382
+ "notNull": false,
1383
+ "autoincrement": false
1384
+ },
1385
+ "related_template_id": {
1386
+ "name": "related_template_id",
1387
+ "type": "text",
1388
+ "primaryKey": false,
1389
+ "notNull": false,
1390
+ "autoincrement": false
1391
+ },
1392
+ "due_at": {
1393
+ "name": "due_at",
1394
+ "type": "integer",
1395
+ "primaryKey": false,
1396
+ "notNull": false,
1397
+ "autoincrement": false
1398
+ },
1399
+ "completed_at": {
1400
+ "name": "completed_at",
1401
+ "type": "integer",
1402
+ "primaryKey": false,
1403
+ "notNull": false,
1404
+ "autoincrement": false
1405
+ },
1406
+ "created_at": {
1407
+ "name": "created_at",
1408
+ "type": "integer",
1409
+ "primaryKey": false,
1410
+ "notNull": true,
1411
+ "autoincrement": false,
1412
+ "default": "(unixepoch())"
1413
+ },
1414
+ "updated_at": {
1415
+ "name": "updated_at",
1416
+ "type": "integer",
1417
+ "primaryKey": false,
1418
+ "notNull": true,
1419
+ "autoincrement": false,
1420
+ "default": "(unixepoch())"
1421
+ }
1422
+ },
1423
+ "indexes": {},
1424
+ "foreignKeys": {
1425
+ "tasks_related_contact_id_contacts_id_fk": {
1426
+ "name": "tasks_related_contact_id_contacts_id_fk",
1427
+ "tableFrom": "tasks",
1428
+ "tableTo": "contacts",
1429
+ "columnsFrom": [
1430
+ "related_contact_id"
1431
+ ],
1432
+ "columnsTo": [
1433
+ "id"
1434
+ ],
1435
+ "onDelete": "no action",
1436
+ "onUpdate": "no action"
1437
+ },
1438
+ "tasks_related_template_id_workflow_templates_id_fk": {
1439
+ "name": "tasks_related_template_id_workflow_templates_id_fk",
1440
+ "tableFrom": "tasks",
1441
+ "tableTo": "workflow_templates",
1442
+ "columnsFrom": [
1443
+ "related_template_id"
1444
+ ],
1445
+ "columnsTo": [
1446
+ "id"
1447
+ ],
1448
+ "onDelete": "no action",
1449
+ "onUpdate": "no action"
1450
+ }
1451
+ },
1452
+ "compositePrimaryKeys": {},
1453
+ "uniqueConstraints": {},
1454
+ "checkConstraints": {}
1455
+ },
1456
+ "workflow_enrollments": {
1457
+ "name": "workflow_enrollments",
1458
+ "columns": {
1459
+ "id": {
1460
+ "name": "id",
1461
+ "type": "text",
1462
+ "primaryKey": true,
1463
+ "notNull": true,
1464
+ "autoincrement": false
1465
+ },
1466
+ "template_id": {
1467
+ "name": "template_id",
1468
+ "type": "text",
1469
+ "primaryKey": false,
1470
+ "notNull": true,
1471
+ "autoincrement": false
1472
+ },
1473
+ "contact_id": {
1474
+ "name": "contact_id",
1475
+ "type": "text",
1476
+ "primaryKey": false,
1477
+ "notNull": true,
1478
+ "autoincrement": false
1479
+ },
1480
+ "workflow_run_id": {
1481
+ "name": "workflow_run_id",
1482
+ "type": "text",
1483
+ "primaryKey": false,
1484
+ "notNull": false,
1485
+ "autoincrement": false
1486
+ },
1487
+ "status": {
1488
+ "name": "status",
1489
+ "type": "text",
1490
+ "primaryKey": false,
1491
+ "notNull": true,
1492
+ "autoincrement": false,
1493
+ "default": "'pending'"
1494
+ },
1495
+ "current_step_index": {
1496
+ "name": "current_step_index",
1497
+ "type": "integer",
1498
+ "primaryKey": false,
1499
+ "notNull": true,
1500
+ "autoincrement": false,
1501
+ "default": 0
1502
+ },
1503
+ "enrolled_at": {
1504
+ "name": "enrolled_at",
1505
+ "type": "integer",
1506
+ "primaryKey": false,
1507
+ "notNull": true,
1508
+ "autoincrement": false,
1509
+ "default": "(unixepoch())"
1510
+ },
1511
+ "completed_at": {
1512
+ "name": "completed_at",
1513
+ "type": "integer",
1514
+ "primaryKey": false,
1515
+ "notNull": false,
1516
+ "autoincrement": false
1517
+ }
1518
+ },
1519
+ "indexes": {},
1520
+ "foreignKeys": {
1521
+ "workflow_enrollments_template_id_workflow_templates_id_fk": {
1522
+ "name": "workflow_enrollments_template_id_workflow_templates_id_fk",
1523
+ "tableFrom": "workflow_enrollments",
1524
+ "tableTo": "workflow_templates",
1525
+ "columnsFrom": [
1526
+ "template_id"
1527
+ ],
1528
+ "columnsTo": [
1529
+ "id"
1530
+ ],
1531
+ "onDelete": "cascade",
1532
+ "onUpdate": "no action"
1533
+ },
1534
+ "workflow_enrollments_contact_id_contacts_id_fk": {
1535
+ "name": "workflow_enrollments_contact_id_contacts_id_fk",
1536
+ "tableFrom": "workflow_enrollments",
1537
+ "tableTo": "contacts",
1538
+ "columnsFrom": [
1539
+ "contact_id"
1540
+ ],
1541
+ "columnsTo": [
1542
+ "id"
1543
+ ],
1544
+ "onDelete": "cascade",
1545
+ "onUpdate": "no action"
1546
+ },
1547
+ "workflow_enrollments_workflow_run_id_workflow_runs_id_fk": {
1548
+ "name": "workflow_enrollments_workflow_run_id_workflow_runs_id_fk",
1549
+ "tableFrom": "workflow_enrollments",
1550
+ "tableTo": "workflow_runs",
1551
+ "columnsFrom": [
1552
+ "workflow_run_id"
1553
+ ],
1554
+ "columnsTo": [
1555
+ "id"
1556
+ ],
1557
+ "onDelete": "no action",
1558
+ "onUpdate": "no action"
1559
+ }
1560
+ },
1561
+ "compositePrimaryKeys": {},
1562
+ "uniqueConstraints": {},
1563
+ "checkConstraints": {}
1564
+ },
1565
+ "workflow_runs": {
1566
+ "name": "workflow_runs",
1567
+ "columns": {
1568
+ "id": {
1569
+ "name": "id",
1570
+ "type": "text",
1571
+ "primaryKey": true,
1572
+ "notNull": true,
1573
+ "autoincrement": false
1574
+ },
1575
+ "template_id": {
1576
+ "name": "template_id",
1577
+ "type": "text",
1578
+ "primaryKey": false,
1579
+ "notNull": false,
1580
+ "autoincrement": false
1581
+ },
1582
+ "workflow_type": {
1583
+ "name": "workflow_type",
1584
+ "type": "text",
1585
+ "primaryKey": false,
1586
+ "notNull": true,
1587
+ "autoincrement": false
1588
+ },
1589
+ "platform_account_id": {
1590
+ "name": "platform_account_id",
1591
+ "type": "text",
1592
+ "primaryKey": false,
1593
+ "notNull": false,
1594
+ "autoincrement": false
1595
+ },
1596
+ "status": {
1597
+ "name": "status",
1598
+ "type": "text",
1599
+ "primaryKey": false,
1600
+ "notNull": true,
1601
+ "autoincrement": false,
1602
+ "default": "'pending'"
1603
+ },
1604
+ "total_items": {
1605
+ "name": "total_items",
1606
+ "type": "integer",
1607
+ "primaryKey": false,
1608
+ "notNull": false,
1609
+ "autoincrement": false
1610
+ },
1611
+ "processed_items": {
1612
+ "name": "processed_items",
1613
+ "type": "integer",
1614
+ "primaryKey": false,
1615
+ "notNull": true,
1616
+ "autoincrement": false,
1617
+ "default": 0
1618
+ },
1619
+ "success_items": {
1620
+ "name": "success_items",
1621
+ "type": "integer",
1622
+ "primaryKey": false,
1623
+ "notNull": true,
1624
+ "autoincrement": false,
1625
+ "default": 0
1626
+ },
1627
+ "skipped_items": {
1628
+ "name": "skipped_items",
1629
+ "type": "integer",
1630
+ "primaryKey": false,
1631
+ "notNull": true,
1632
+ "autoincrement": false,
1633
+ "default": 0
1634
+ },
1635
+ "error_items": {
1636
+ "name": "error_items",
1637
+ "type": "integer",
1638
+ "primaryKey": false,
1639
+ "notNull": true,
1640
+ "autoincrement": false,
1641
+ "default": 0
1642
+ },
1643
+ "config": {
1644
+ "name": "config",
1645
+ "type": "text",
1646
+ "primaryKey": false,
1647
+ "notNull": false,
1648
+ "autoincrement": false,
1649
+ "default": "'{}'"
1650
+ },
1651
+ "result": {
1652
+ "name": "result",
1653
+ "type": "text",
1654
+ "primaryKey": false,
1655
+ "notNull": false,
1656
+ "autoincrement": false,
1657
+ "default": "'{}'"
1658
+ },
1659
+ "errors": {
1660
+ "name": "errors",
1661
+ "type": "text",
1662
+ "primaryKey": false,
1663
+ "notNull": false,
1664
+ "autoincrement": false,
1665
+ "default": "'[]'"
1666
+ },
1667
+ "trigger": {
1668
+ "name": "trigger",
1669
+ "type": "text",
1670
+ "primaryKey": false,
1671
+ "notNull": true,
1672
+ "autoincrement": false,
1673
+ "default": "'user'"
1674
+ },
1675
+ "model": {
1676
+ "name": "model",
1677
+ "type": "text",
1678
+ "primaryKey": false,
1679
+ "notNull": false,
1680
+ "autoincrement": false
1681
+ },
1682
+ "input_tokens": {
1683
+ "name": "input_tokens",
1684
+ "type": "integer",
1685
+ "primaryKey": false,
1686
+ "notNull": true,
1687
+ "autoincrement": false,
1688
+ "default": 0
1689
+ },
1690
+ "output_tokens": {
1691
+ "name": "output_tokens",
1692
+ "type": "integer",
1693
+ "primaryKey": false,
1694
+ "notNull": true,
1695
+ "autoincrement": false,
1696
+ "default": 0
1697
+ },
1698
+ "cost_usd": {
1699
+ "name": "cost_usd",
1700
+ "type": "real",
1701
+ "primaryKey": false,
1702
+ "notNull": true,
1703
+ "autoincrement": false,
1704
+ "default": 0
1705
+ },
1706
+ "parent_workflow_id": {
1707
+ "name": "parent_workflow_id",
1708
+ "type": "text",
1709
+ "primaryKey": false,
1710
+ "notNull": false,
1711
+ "autoincrement": false
1712
+ },
1713
+ "source_total": {
1714
+ "name": "source_total",
1715
+ "type": "integer",
1716
+ "primaryKey": false,
1717
+ "notNull": false,
1718
+ "autoincrement": false
1719
+ },
1720
+ "source_processed": {
1721
+ "name": "source_processed",
1722
+ "type": "integer",
1723
+ "primaryKey": false,
1724
+ "notNull": true,
1725
+ "autoincrement": false,
1726
+ "default": 0
1727
+ },
1728
+ "started_at": {
1729
+ "name": "started_at",
1730
+ "type": "integer",
1731
+ "primaryKey": false,
1732
+ "notNull": false,
1733
+ "autoincrement": false
1734
+ },
1735
+ "completed_at": {
1736
+ "name": "completed_at",
1737
+ "type": "integer",
1738
+ "primaryKey": false,
1739
+ "notNull": false,
1740
+ "autoincrement": false
1741
+ },
1742
+ "created_at": {
1743
+ "name": "created_at",
1744
+ "type": "integer",
1745
+ "primaryKey": false,
1746
+ "notNull": true,
1747
+ "autoincrement": false,
1748
+ "default": "(unixepoch())"
1749
+ },
1750
+ "updated_at": {
1751
+ "name": "updated_at",
1752
+ "type": "integer",
1753
+ "primaryKey": false,
1754
+ "notNull": true,
1755
+ "autoincrement": false,
1756
+ "default": "(unixepoch())"
1757
+ }
1758
+ },
1759
+ "indexes": {
1760
+ "idx_workflow_runs_template": {
1761
+ "name": "idx_workflow_runs_template",
1762
+ "columns": [
1763
+ "template_id"
1764
+ ],
1765
+ "isUnique": false
1766
+ },
1767
+ "idx_workflow_runs_status": {
1768
+ "name": "idx_workflow_runs_status",
1769
+ "columns": [
1770
+ "status"
1771
+ ],
1772
+ "isUnique": false
1773
+ },
1774
+ "idx_workflow_runs_type": {
1775
+ "name": "idx_workflow_runs_type",
1776
+ "columns": [
1777
+ "workflow_type"
1778
+ ],
1779
+ "isUnique": false
1780
+ }
1781
+ },
1782
+ "foreignKeys": {
1783
+ "workflow_runs_template_id_workflow_templates_id_fk": {
1784
+ "name": "workflow_runs_template_id_workflow_templates_id_fk",
1785
+ "tableFrom": "workflow_runs",
1786
+ "tableTo": "workflow_templates",
1787
+ "columnsFrom": [
1788
+ "template_id"
1789
+ ],
1790
+ "columnsTo": [
1791
+ "id"
1792
+ ],
1793
+ "onDelete": "no action",
1794
+ "onUpdate": "no action"
1795
+ },
1796
+ "workflow_runs_platform_account_id_platform_accounts_id_fk": {
1797
+ "name": "workflow_runs_platform_account_id_platform_accounts_id_fk",
1798
+ "tableFrom": "workflow_runs",
1799
+ "tableTo": "platform_accounts",
1800
+ "columnsFrom": [
1801
+ "platform_account_id"
1802
+ ],
1803
+ "columnsTo": [
1804
+ "id"
1805
+ ],
1806
+ "onDelete": "no action",
1807
+ "onUpdate": "no action"
1808
+ }
1809
+ },
1810
+ "compositePrimaryKeys": {},
1811
+ "uniqueConstraints": {},
1812
+ "checkConstraints": {}
1813
+ },
1814
+ "workflow_steps": {
1815
+ "name": "workflow_steps",
1816
+ "columns": {
1817
+ "id": {
1818
+ "name": "id",
1819
+ "type": "text",
1820
+ "primaryKey": true,
1821
+ "notNull": true,
1822
+ "autoincrement": false
1823
+ },
1824
+ "workflow_run_id": {
1825
+ "name": "workflow_run_id",
1826
+ "type": "text",
1827
+ "primaryKey": false,
1828
+ "notNull": true,
1829
+ "autoincrement": false
1830
+ },
1831
+ "step_index": {
1832
+ "name": "step_index",
1833
+ "type": "integer",
1834
+ "primaryKey": false,
1835
+ "notNull": true,
1836
+ "autoincrement": false
1837
+ },
1838
+ "step_type": {
1839
+ "name": "step_type",
1840
+ "type": "text",
1841
+ "primaryKey": false,
1842
+ "notNull": true,
1843
+ "autoincrement": false
1844
+ },
1845
+ "status": {
1846
+ "name": "status",
1847
+ "type": "text",
1848
+ "primaryKey": false,
1849
+ "notNull": true,
1850
+ "autoincrement": false,
1851
+ "default": "'pending'"
1852
+ },
1853
+ "contact_id": {
1854
+ "name": "contact_id",
1855
+ "type": "text",
1856
+ "primaryKey": false,
1857
+ "notNull": false,
1858
+ "autoincrement": false
1859
+ },
1860
+ "url": {
1861
+ "name": "url",
1862
+ "type": "text",
1863
+ "primaryKey": false,
1864
+ "notNull": false,
1865
+ "autoincrement": false
1866
+ },
1867
+ "tool": {
1868
+ "name": "tool",
1869
+ "type": "text",
1870
+ "primaryKey": false,
1871
+ "notNull": false,
1872
+ "autoincrement": false
1873
+ },
1874
+ "input": {
1875
+ "name": "input",
1876
+ "type": "text",
1877
+ "primaryKey": false,
1878
+ "notNull": false,
1879
+ "autoincrement": false,
1880
+ "default": "'{}'"
1881
+ },
1882
+ "output": {
1883
+ "name": "output",
1884
+ "type": "text",
1885
+ "primaryKey": false,
1886
+ "notNull": false,
1887
+ "autoincrement": false,
1888
+ "default": "'{}'"
1889
+ },
1890
+ "error": {
1891
+ "name": "error",
1892
+ "type": "text",
1893
+ "primaryKey": false,
1894
+ "notNull": false,
1895
+ "autoincrement": false
1896
+ },
1897
+ "duration_ms": {
1898
+ "name": "duration_ms",
1899
+ "type": "integer",
1900
+ "primaryKey": false,
1901
+ "notNull": false,
1902
+ "autoincrement": false
1903
+ },
1904
+ "created_at": {
1905
+ "name": "created_at",
1906
+ "type": "integer",
1907
+ "primaryKey": false,
1908
+ "notNull": true,
1909
+ "autoincrement": false,
1910
+ "default": "(unixepoch())"
1911
+ }
1912
+ },
1913
+ "indexes": {
1914
+ "idx_workflow_steps_run": {
1915
+ "name": "idx_workflow_steps_run",
1916
+ "columns": [
1917
+ "workflow_run_id"
1918
+ ],
1919
+ "isUnique": false
1920
+ }
1921
+ },
1922
+ "foreignKeys": {
1923
+ "workflow_steps_workflow_run_id_workflow_runs_id_fk": {
1924
+ "name": "workflow_steps_workflow_run_id_workflow_runs_id_fk",
1925
+ "tableFrom": "workflow_steps",
1926
+ "tableTo": "workflow_runs",
1927
+ "columnsFrom": [
1928
+ "workflow_run_id"
1929
+ ],
1930
+ "columnsTo": [
1931
+ "id"
1932
+ ],
1933
+ "onDelete": "cascade",
1934
+ "onUpdate": "no action"
1935
+ },
1936
+ "workflow_steps_contact_id_contacts_id_fk": {
1937
+ "name": "workflow_steps_contact_id_contacts_id_fk",
1938
+ "tableFrom": "workflow_steps",
1939
+ "tableTo": "contacts",
1940
+ "columnsFrom": [
1941
+ "contact_id"
1942
+ ],
1943
+ "columnsTo": [
1944
+ "id"
1945
+ ],
1946
+ "onDelete": "no action",
1947
+ "onUpdate": "no action"
1948
+ }
1949
+ },
1950
+ "compositePrimaryKeys": {},
1951
+ "uniqueConstraints": {},
1952
+ "checkConstraints": {}
1953
+ },
1954
+ "workflow_template_steps": {
1955
+ "name": "workflow_template_steps",
1956
+ "columns": {
1957
+ "id": {
1958
+ "name": "id",
1959
+ "type": "text",
1960
+ "primaryKey": true,
1961
+ "notNull": true,
1962
+ "autoincrement": false
1963
+ },
1964
+ "template_id": {
1965
+ "name": "template_id",
1966
+ "type": "text",
1967
+ "primaryKey": false,
1968
+ "notNull": true,
1969
+ "autoincrement": false
1970
+ },
1971
+ "step_index": {
1972
+ "name": "step_index",
1973
+ "type": "integer",
1974
+ "primaryKey": false,
1975
+ "notNull": true,
1976
+ "autoincrement": false
1977
+ },
1978
+ "step_type": {
1979
+ "name": "step_type",
1980
+ "type": "text",
1981
+ "primaryKey": false,
1982
+ "notNull": true,
1983
+ "autoincrement": false
1984
+ },
1985
+ "config": {
1986
+ "name": "config",
1987
+ "type": "text",
1988
+ "primaryKey": false,
1989
+ "notNull": false,
1990
+ "autoincrement": false,
1991
+ "default": "'{}'"
1992
+ },
1993
+ "delay_hours": {
1994
+ "name": "delay_hours",
1995
+ "type": "integer",
1996
+ "primaryKey": false,
1997
+ "notNull": false,
1998
+ "autoincrement": false,
1999
+ "default": 0
2000
+ }
2001
+ },
2002
+ "indexes": {},
2003
+ "foreignKeys": {
2004
+ "workflow_template_steps_template_id_workflow_templates_id_fk": {
2005
+ "name": "workflow_template_steps_template_id_workflow_templates_id_fk",
2006
+ "tableFrom": "workflow_template_steps",
2007
+ "tableTo": "workflow_templates",
2008
+ "columnsFrom": [
2009
+ "template_id"
2010
+ ],
2011
+ "columnsTo": [
2012
+ "id"
2013
+ ],
2014
+ "onDelete": "cascade",
2015
+ "onUpdate": "no action"
2016
+ }
2017
+ },
2018
+ "compositePrimaryKeys": {},
2019
+ "uniqueConstraints": {},
2020
+ "checkConstraints": {}
2021
+ },
2022
+ "workflow_templates": {
2023
+ "name": "workflow_templates",
2024
+ "columns": {
2025
+ "id": {
2026
+ "name": "id",
2027
+ "type": "text",
2028
+ "primaryKey": true,
2029
+ "notNull": true,
2030
+ "autoincrement": false
2031
+ },
2032
+ "name": {
2033
+ "name": "name",
2034
+ "type": "text",
2035
+ "primaryKey": false,
2036
+ "notNull": true,
2037
+ "autoincrement": false
2038
+ },
2039
+ "description": {
2040
+ "name": "description",
2041
+ "type": "text",
2042
+ "primaryKey": false,
2043
+ "notNull": false,
2044
+ "autoincrement": false
2045
+ },
2046
+ "platform": {
2047
+ "name": "platform",
2048
+ "type": "text",
2049
+ "primaryKey": false,
2050
+ "notNull": false,
2051
+ "autoincrement": false
2052
+ },
2053
+ "template_type": {
2054
+ "name": "template_type",
2055
+ "type": "text",
2056
+ "primaryKey": false,
2057
+ "notNull": true,
2058
+ "autoincrement": false
2059
+ },
2060
+ "status": {
2061
+ "name": "status",
2062
+ "type": "text",
2063
+ "primaryKey": false,
2064
+ "notNull": true,
2065
+ "autoincrement": false,
2066
+ "default": "'draft'"
2067
+ },
2068
+ "config": {
2069
+ "name": "config",
2070
+ "type": "text",
2071
+ "primaryKey": false,
2072
+ "notNull": false,
2073
+ "autoincrement": false,
2074
+ "default": "'{}'"
2075
+ },
2076
+ "goal_metrics": {
2077
+ "name": "goal_metrics",
2078
+ "type": "text",
2079
+ "primaryKey": false,
2080
+ "notNull": false,
2081
+ "autoincrement": false,
2082
+ "default": "'{}'"
2083
+ },
2084
+ "starts_at": {
2085
+ "name": "starts_at",
2086
+ "type": "integer",
2087
+ "primaryKey": false,
2088
+ "notNull": false,
2089
+ "autoincrement": false
2090
+ },
2091
+ "ends_at": {
2092
+ "name": "ends_at",
2093
+ "type": "integer",
2094
+ "primaryKey": false,
2095
+ "notNull": false,
2096
+ "autoincrement": false
2097
+ },
2098
+ "system_prompt": {
2099
+ "name": "system_prompt",
2100
+ "type": "text",
2101
+ "primaryKey": false,
2102
+ "notNull": false,
2103
+ "autoincrement": false
2104
+ },
2105
+ "target_persona": {
2106
+ "name": "target_persona",
2107
+ "type": "text",
2108
+ "primaryKey": false,
2109
+ "notNull": false,
2110
+ "autoincrement": false
2111
+ },
2112
+ "estimated_cost": {
2113
+ "name": "estimated_cost",
2114
+ "type": "real",
2115
+ "primaryKey": false,
2116
+ "notNull": true,
2117
+ "autoincrement": false,
2118
+ "default": 0
2119
+ },
2120
+ "total_runs": {
2121
+ "name": "total_runs",
2122
+ "type": "integer",
2123
+ "primaryKey": false,
2124
+ "notNull": true,
2125
+ "autoincrement": false,
2126
+ "default": 0
2127
+ },
2128
+ "last_run_at": {
2129
+ "name": "last_run_at",
2130
+ "type": "integer",
2131
+ "primaryKey": false,
2132
+ "notNull": false,
2133
+ "autoincrement": false
2134
+ },
2135
+ "created_at": {
2136
+ "name": "created_at",
2137
+ "type": "integer",
2138
+ "primaryKey": false,
2139
+ "notNull": true,
2140
+ "autoincrement": false,
2141
+ "default": "(unixepoch())"
2142
+ },
2143
+ "updated_at": {
2144
+ "name": "updated_at",
2145
+ "type": "integer",
2146
+ "primaryKey": false,
2147
+ "notNull": true,
2148
+ "autoincrement": false,
2149
+ "default": "(unixepoch())"
2150
+ }
2151
+ },
2152
+ "indexes": {},
2153
+ "foreignKeys": {},
2154
+ "compositePrimaryKeys": {},
2155
+ "uniqueConstraints": {},
2156
+ "checkConstraints": {}
2157
+ }
2158
+ },
2159
+ "views": {},
2160
+ "enums": {},
2161
+ "_meta": {
2162
+ "schemas": {},
2163
+ "tables": {},
2164
+ "columns": {}
2165
+ },
2166
+ "internal": {
2167
+ "indexes": {}
2168
+ }
2169
+ }