@sprinterai/supabase 0.3.0 → 0.5.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 (258) hide show
  1. package/LICENSE +21 -0
  2. package/dist/auth/adapter.js +3 -3
  3. package/dist/auth/guards.d.ts +27 -0
  4. package/dist/auth/guards.d.ts.map +1 -0
  5. package/dist/auth/guards.js +61 -0
  6. package/dist/auth/guards.js.map +1 -0
  7. package/dist/auth/index.d.ts +6 -4
  8. package/dist/auth/index.d.ts.map +1 -1
  9. package/dist/auth/index.js +5 -3
  10. package/dist/auth/index.js.map +1 -1
  11. package/dist/auth/permissions.d.ts +9 -1
  12. package/dist/auth/permissions.d.ts.map +1 -1
  13. package/dist/auth/permissions.js +13 -0
  14. package/dist/auth/permissions.js.map +1 -1
  15. package/dist/clients/admin.d.ts +3 -1
  16. package/dist/clients/admin.d.ts.map +1 -1
  17. package/dist/clients/admin.js +3 -3
  18. package/dist/clients/admin.js.map +1 -1
  19. package/dist/clients/browser.d.ts +3 -1
  20. package/dist/clients/browser.d.ts.map +1 -1
  21. package/dist/clients/browser.js +3 -3
  22. package/dist/clients/browser.js.map +1 -1
  23. package/dist/clients/index.d.ts +3 -3
  24. package/dist/clients/index.js +3 -3
  25. package/dist/clients/server.d.ts +2 -1
  26. package/dist/clients/server.d.ts.map +1 -1
  27. package/dist/clients/server.js +1 -1
  28. package/dist/clients/server.js.map +1 -1
  29. package/dist/generated/database-types.d.ts +4020 -0
  30. package/dist/generated/database-types.d.ts.map +1 -0
  31. package/dist/generated/database-types.js +97 -0
  32. package/dist/generated/database-types.js.map +1 -0
  33. package/dist/generated/index.d.ts +48 -0
  34. package/dist/generated/index.d.ts.map +1 -0
  35. package/dist/generated/index.js +2 -0
  36. package/dist/generated/index.js.map +1 -0
  37. package/dist/index.d.ts +12 -10
  38. package/dist/index.d.ts.map +1 -1
  39. package/dist/index.js +7 -5
  40. package/dist/index.js.map +1 -1
  41. package/dist/realtime/index.d.ts +2 -2
  42. package/dist/realtime/index.js +1 -1
  43. package/dist/resolvers.d.ts +23 -0
  44. package/dist/resolvers.d.ts.map +1 -0
  45. package/dist/resolvers.js +57 -0
  46. package/dist/resolvers.js.map +1 -0
  47. package/dist/stores/activity-store.d.ts +21 -0
  48. package/dist/stores/activity-store.d.ts.map +1 -0
  49. package/dist/stores/activity-store.js +122 -0
  50. package/dist/stores/activity-store.js.map +1 -0
  51. package/dist/stores/admin-store.d.ts +27 -0
  52. package/dist/stores/admin-store.d.ts.map +1 -0
  53. package/dist/stores/admin-store.js +171 -0
  54. package/dist/stores/admin-store.js.map +1 -0
  55. package/dist/stores/agent-store.d.ts +6 -2
  56. package/dist/stores/agent-store.d.ts.map +1 -1
  57. package/dist/stores/agent-store.js +83 -6
  58. package/dist/stores/agent-store.js.map +1 -1
  59. package/dist/stores/approval-store.d.ts +19 -0
  60. package/dist/stores/approval-store.d.ts.map +1 -0
  61. package/dist/stores/approval-store.js +108 -0
  62. package/dist/stores/approval-store.js.map +1 -0
  63. package/dist/stores/chat-store.d.ts +2 -1
  64. package/dist/stores/chat-store.d.ts.map +1 -1
  65. package/dist/stores/chat-store.js +46 -36
  66. package/dist/stores/chat-store.js.map +1 -1
  67. package/dist/stores/comment-store.d.ts +13 -0
  68. package/dist/stores/comment-store.d.ts.map +1 -0
  69. package/dist/stores/comment-store.js +67 -0
  70. package/dist/stores/comment-store.js.map +1 -0
  71. package/dist/stores/cost-store.d.ts +15 -0
  72. package/dist/stores/cost-store.d.ts.map +1 -0
  73. package/dist/stores/cost-store.js +69 -0
  74. package/dist/stores/cost-store.js.map +1 -0
  75. package/dist/stores/criteria-set-store.d.ts +16 -0
  76. package/dist/stores/criteria-set-store.d.ts.map +1 -0
  77. package/dist/stores/criteria-set-store.js +127 -0
  78. package/dist/stores/criteria-set-store.js.map +1 -0
  79. package/dist/stores/document-store.d.ts +21 -0
  80. package/dist/stores/document-store.d.ts.map +1 -0
  81. package/dist/stores/document-store.js +191 -0
  82. package/dist/stores/document-store.js.map +1 -0
  83. package/dist/stores/embed-store.d.ts +11 -0
  84. package/dist/stores/embed-store.d.ts.map +1 -0
  85. package/dist/stores/embed-store.js +71 -0
  86. package/dist/stores/embed-store.js.map +1 -0
  87. package/dist/stores/entity-store.d.ts +7 -2
  88. package/dist/stores/entity-store.d.ts.map +1 -1
  89. package/dist/stores/entity-store.js +163 -37
  90. package/dist/stores/entity-store.js.map +1 -1
  91. package/dist/stores/extraction-store.d.ts +18 -0
  92. package/dist/stores/extraction-store.d.ts.map +1 -0
  93. package/dist/stores/extraction-store.js +170 -0
  94. package/dist/stores/extraction-store.js.map +1 -0
  95. package/dist/stores/factory.d.ts +29 -2
  96. package/dist/stores/factory.d.ts.map +1 -1
  97. package/dist/stores/factory.js +60 -9
  98. package/dist/stores/factory.js.map +1 -1
  99. package/dist/stores/favorites-store.d.ts +13 -0
  100. package/dist/stores/favorites-store.d.ts.map +1 -0
  101. package/dist/stores/favorites-store.js +53 -0
  102. package/dist/stores/favorites-store.js.map +1 -0
  103. package/dist/stores/feedback-store.d.ts +12 -0
  104. package/dist/stores/feedback-store.d.ts.map +1 -0
  105. package/dist/stores/feedback-store.js +59 -0
  106. package/dist/stores/feedback-store.js.map +1 -0
  107. package/dist/stores/inbound-store.d.ts +16 -0
  108. package/dist/stores/inbound-store.d.ts.map +1 -0
  109. package/dist/stores/inbound-store.js +133 -0
  110. package/dist/stores/inbound-store.js.map +1 -0
  111. package/dist/stores/index.d.ts +36 -10
  112. package/dist/stores/index.d.ts.map +1 -1
  113. package/dist/stores/index.js +35 -9
  114. package/dist/stores/index.js.map +1 -1
  115. package/dist/stores/member-store.d.ts +23 -0
  116. package/dist/stores/member-store.d.ts.map +1 -0
  117. package/dist/stores/member-store.js +121 -0
  118. package/dist/stores/member-store.js.map +1 -0
  119. package/dist/stores/memory-store.d.ts +4 -1
  120. package/dist/stores/memory-store.d.ts.map +1 -1
  121. package/dist/stores/memory-store.js +31 -3
  122. package/dist/stores/memory-store.js.map +1 -1
  123. package/dist/stores/nav-config-store.d.ts +13 -0
  124. package/dist/stores/nav-config-store.d.ts.map +1 -0
  125. package/dist/stores/nav-config-store.js +104 -0
  126. package/dist/stores/nav-config-store.js.map +1 -0
  127. package/dist/stores/notification-store.d.ts +15 -0
  128. package/dist/stores/notification-store.d.ts.map +1 -0
  129. package/dist/stores/notification-store.js +88 -0
  130. package/dist/stores/notification-store.js.map +1 -0
  131. package/dist/stores/recent-view-store.d.ts +11 -0
  132. package/dist/stores/recent-view-store.d.ts.map +1 -0
  133. package/dist/stores/recent-view-store.js +39 -0
  134. package/dist/stores/recent-view-store.js.map +1 -0
  135. package/dist/stores/response-store.d.ts +15 -0
  136. package/dist/stores/response-store.d.ts.map +1 -0
  137. package/dist/stores/response-store.js +294 -0
  138. package/dist/stores/response-store.js.map +1 -0
  139. package/dist/stores/share-store.d.ts +14 -0
  140. package/dist/stores/share-store.d.ts.map +1 -0
  141. package/dist/stores/share-store.js +153 -0
  142. package/dist/stores/share-store.js.map +1 -0
  143. package/dist/stores/shared-context-store.d.ts +12 -0
  144. package/dist/stores/shared-context-store.d.ts.map +1 -0
  145. package/dist/stores/shared-context-store.js +55 -0
  146. package/dist/stores/shared-context-store.js.map +1 -0
  147. package/dist/stores/skill-store.d.ts +21 -0
  148. package/dist/stores/skill-store.d.ts.map +1 -0
  149. package/dist/stores/skill-store.js +163 -0
  150. package/dist/stores/skill-store.js.map +1 -0
  151. package/dist/stores/source-store.d.ts +23 -0
  152. package/dist/stores/source-store.d.ts.map +1 -0
  153. package/dist/stores/source-store.js +111 -0
  154. package/dist/stores/source-store.js.map +1 -0
  155. package/dist/stores/task-store.d.ts +2 -1
  156. package/dist/stores/task-store.d.ts.map +1 -1
  157. package/dist/stores/task-store.js +58 -6
  158. package/dist/stores/task-store.js.map +1 -1
  159. package/dist/stores/template-store.d.ts +16 -0
  160. package/dist/stores/template-store.d.ts.map +1 -0
  161. package/dist/stores/template-store.js +136 -0
  162. package/dist/stores/template-store.js.map +1 -0
  163. package/dist/stores/tenant-store.d.ts +2 -1
  164. package/dist/stores/tenant-store.d.ts.map +1 -1
  165. package/dist/stores/tenant-store.js +2 -2
  166. package/dist/stores/tenant-store.js.map +1 -1
  167. package/dist/stores/theme-store.d.ts +11 -0
  168. package/dist/stores/theme-store.d.ts.map +1 -0
  169. package/dist/stores/theme-store.js +41 -0
  170. package/dist/stores/theme-store.js.map +1 -0
  171. package/dist/stores/tool-definition-store.d.ts +18 -0
  172. package/dist/stores/tool-definition-store.d.ts.map +1 -0
  173. package/dist/stores/tool-definition-store.js +129 -0
  174. package/dist/stores/tool-definition-store.js.map +1 -0
  175. package/dist/stores/tool-store.d.ts +21 -2
  176. package/dist/stores/tool-store.d.ts.map +1 -1
  177. package/dist/stores/tool-store.js +112 -2
  178. package/dist/stores/tool-store.js.map +1 -1
  179. package/dist/stores/view-store.d.ts +8 -4
  180. package/dist/stores/view-store.d.ts.map +1 -1
  181. package/dist/stores/view-store.js +94 -14
  182. package/dist/stores/view-store.js.map +1 -1
  183. package/dist/stores/webhook-endpoint-store.d.ts +18 -0
  184. package/dist/stores/webhook-endpoint-store.d.ts.map +1 -0
  185. package/dist/stores/webhook-endpoint-store.js +56 -0
  186. package/dist/stores/webhook-endpoint-store.js.map +1 -0
  187. package/dist/stores/workflow-run-store.d.ts +23 -0
  188. package/dist/stores/workflow-run-store.d.ts.map +1 -0
  189. package/dist/stores/workflow-run-store.js +201 -0
  190. package/dist/stores/workflow-run-store.js.map +1 -0
  191. package/dist/tenant/actions.js +1 -1
  192. package/dist/tenant/context.js +1 -1
  193. package/dist/tenant/index.d.ts +5 -5
  194. package/dist/tenant/index.js +4 -4
  195. package/dist/types/index.d.ts +5 -4
  196. package/dist/types/index.d.ts.map +1 -1
  197. package/dist/types/index.js +1 -1
  198. package/package.json +19 -14
  199. package/dist/__test-utils__/mock-supabase.d.ts +0 -18
  200. package/dist/__test-utils__/mock-supabase.d.ts.map +0 -1
  201. package/dist/__test-utils__/mock-supabase.js +0 -89
  202. package/dist/__test-utils__/mock-supabase.js.map +0 -1
  203. package/dist/auth/claims.test.d.ts +0 -2
  204. package/dist/auth/claims.test.d.ts.map +0 -1
  205. package/dist/auth/claims.test.js +0 -32
  206. package/dist/auth/claims.test.js.map +0 -1
  207. package/dist/auth/permissions.test.d.ts +0 -2
  208. package/dist/auth/permissions.test.d.ts.map +0 -1
  209. package/dist/auth/permissions.test.js +0 -40
  210. package/dist/auth/permissions.test.js.map +0 -1
  211. package/dist/clients/admin.test.d.ts +0 -2
  212. package/dist/clients/admin.test.d.ts.map +0 -1
  213. package/dist/clients/admin.test.js +0 -31
  214. package/dist/clients/admin.test.js.map +0 -1
  215. package/dist/clients/browser.test.d.ts +0 -2
  216. package/dist/clients/browser.test.d.ts.map +0 -1
  217. package/dist/clients/browser.test.js +0 -29
  218. package/dist/clients/browser.test.js.map +0 -1
  219. package/dist/clients/server.test.d.ts +0 -2
  220. package/dist/clients/server.test.d.ts.map +0 -1
  221. package/dist/clients/server.test.js +0 -26
  222. package/dist/clients/server.test.js.map +0 -1
  223. package/dist/stores/agent-store.test.d.ts +0 -2
  224. package/dist/stores/agent-store.test.d.ts.map +0 -1
  225. package/dist/stores/agent-store.test.js +0 -64
  226. package/dist/stores/agent-store.test.js.map +0 -1
  227. package/dist/stores/chat-store.test.d.ts +0 -2
  228. package/dist/stores/chat-store.test.d.ts.map +0 -1
  229. package/dist/stores/chat-store.test.js +0 -83
  230. package/dist/stores/chat-store.test.js.map +0 -1
  231. package/dist/stores/entity-store.test.d.ts +0 -2
  232. package/dist/stores/entity-store.test.d.ts.map +0 -1
  233. package/dist/stores/entity-store.test.js +0 -125
  234. package/dist/stores/entity-store.test.js.map +0 -1
  235. package/dist/stores/factory.test.d.ts +0 -2
  236. package/dist/stores/factory.test.d.ts.map +0 -1
  237. package/dist/stores/factory.test.js +0 -41
  238. package/dist/stores/factory.test.js.map +0 -1
  239. package/dist/stores/memory-store.test.d.ts +0 -2
  240. package/dist/stores/memory-store.test.d.ts.map +0 -1
  241. package/dist/stores/memory-store.test.js +0 -70
  242. package/dist/stores/memory-store.test.js.map +0 -1
  243. package/dist/stores/task-store.test.d.ts +0 -2
  244. package/dist/stores/task-store.test.d.ts.map +0 -1
  245. package/dist/stores/task-store.test.js +0 -86
  246. package/dist/stores/task-store.test.js.map +0 -1
  247. package/dist/stores/tool-store.test.d.ts +0 -2
  248. package/dist/stores/tool-store.test.d.ts.map +0 -1
  249. package/dist/stores/tool-store.test.js +0 -56
  250. package/dist/stores/tool-store.test.js.map +0 -1
  251. package/dist/stores/view-store.test.d.ts +0 -2
  252. package/dist/stores/view-store.test.d.ts.map +0 -1
  253. package/dist/stores/view-store.test.js +0 -57
  254. package/dist/stores/view-store.test.js.map +0 -1
  255. package/dist/tenant/constants.test.d.ts +0 -2
  256. package/dist/tenant/constants.test.d.ts.map +0 -1
  257. package/dist/tenant/constants.test.js +0 -25
  258. package/dist/tenant/constants.test.js.map +0 -1
@@ -0,0 +1,4020 @@
1
+ export type Json = string | number | boolean | null | {
2
+ [key: string]: Json | undefined;
3
+ } | Json[];
4
+ export type Database = {
5
+ __InternalSupabase: {
6
+ PostgrestVersion: '14.4';
7
+ };
8
+ public: {
9
+ Tables: {
10
+ activities: {
11
+ Row: {
12
+ action: string;
13
+ actor_id: string | null;
14
+ changes: Json | null;
15
+ created_at: string;
16
+ description: string | null;
17
+ entity_id: string | null;
18
+ entity_type_slug: string | null;
19
+ id: string;
20
+ metadata: Json | null;
21
+ tenant_id: string;
22
+ title: string | null;
23
+ };
24
+ Insert: {
25
+ action: string;
26
+ actor_id?: string | null;
27
+ changes?: Json | null;
28
+ created_at?: string;
29
+ description?: string | null;
30
+ entity_id?: string | null;
31
+ entity_type_slug?: string | null;
32
+ id?: string;
33
+ metadata?: Json | null;
34
+ tenant_id?: string;
35
+ title?: string | null;
36
+ };
37
+ Update: {
38
+ action?: string;
39
+ actor_id?: string | null;
40
+ changes?: Json | null;
41
+ created_at?: string;
42
+ description?: string | null;
43
+ entity_id?: string | null;
44
+ entity_type_slug?: string | null;
45
+ id?: string;
46
+ metadata?: Json | null;
47
+ tenant_id?: string;
48
+ title?: string | null;
49
+ };
50
+ Relationships: [
51
+ {
52
+ foreignKeyName: 'activities_entity_id_fkey';
53
+ columns: ['entity_id'];
54
+ isOneToOne: false;
55
+ referencedRelation: 'entities';
56
+ referencedColumns: ['id'];
57
+ }
58
+ ];
59
+ };
60
+ agent_config_versions: {
61
+ Row: {
62
+ agent_id: string;
63
+ change_summary: string | null;
64
+ changed_by: string | null;
65
+ config: Json;
66
+ created_at: string;
67
+ id: string;
68
+ model: string | null;
69
+ system_prompt: string | null;
70
+ tenant_id: string;
71
+ version: number;
72
+ };
73
+ Insert: {
74
+ agent_id: string;
75
+ change_summary?: string | null;
76
+ changed_by?: string | null;
77
+ config: Json;
78
+ created_at?: string;
79
+ id?: string;
80
+ model?: string | null;
81
+ system_prompt?: string | null;
82
+ tenant_id: string;
83
+ version: number;
84
+ };
85
+ Update: {
86
+ agent_id?: string;
87
+ change_summary?: string | null;
88
+ changed_by?: string | null;
89
+ config?: Json;
90
+ created_at?: string;
91
+ id?: string;
92
+ model?: string | null;
93
+ system_prompt?: string | null;
94
+ tenant_id?: string;
95
+ version?: number;
96
+ };
97
+ Relationships: [
98
+ {
99
+ foreignKeyName: 'agent_config_versions_agent_id_fkey';
100
+ columns: ['agent_id'];
101
+ isOneToOne: false;
102
+ referencedRelation: 'agents';
103
+ referencedColumns: ['id'];
104
+ },
105
+ {
106
+ foreignKeyName: 'agent_config_versions_tenant_id_fkey';
107
+ columns: ['tenant_id'];
108
+ isOneToOne: false;
109
+ referencedRelation: 'tenants';
110
+ referencedColumns: ['id'];
111
+ }
112
+ ];
113
+ };
114
+ agent_connections: {
115
+ Row: {
116
+ agent_id: string | null;
117
+ auth_config: Json | null;
118
+ capabilities: Json | null;
119
+ created_at: string;
120
+ endpoint_url: string;
121
+ id: string;
122
+ last_tested_at: string | null;
123
+ metadata: Json | null;
124
+ name: string;
125
+ status: string | null;
126
+ tenant_id: string;
127
+ type: string;
128
+ updated_at: string;
129
+ };
130
+ Insert: {
131
+ agent_id?: string | null;
132
+ auth_config?: Json | null;
133
+ capabilities?: Json | null;
134
+ created_at?: string;
135
+ endpoint_url: string;
136
+ id?: string;
137
+ last_tested_at?: string | null;
138
+ metadata?: Json | null;
139
+ name: string;
140
+ status?: string | null;
141
+ tenant_id: string;
142
+ type: string;
143
+ updated_at?: string;
144
+ };
145
+ Update: {
146
+ agent_id?: string | null;
147
+ auth_config?: Json | null;
148
+ capabilities?: Json | null;
149
+ created_at?: string;
150
+ endpoint_url?: string;
151
+ id?: string;
152
+ last_tested_at?: string | null;
153
+ metadata?: Json | null;
154
+ name?: string;
155
+ status?: string | null;
156
+ tenant_id?: string;
157
+ type?: string;
158
+ updated_at?: string;
159
+ };
160
+ Relationships: [
161
+ {
162
+ foreignKeyName: 'agent_connections_agent_id_fkey';
163
+ columns: ['agent_id'];
164
+ isOneToOne: false;
165
+ referencedRelation: 'agents';
166
+ referencedColumns: ['id'];
167
+ },
168
+ {
169
+ foreignKeyName: 'agent_connections_tenant_id_fkey';
170
+ columns: ['tenant_id'];
171
+ isOneToOne: false;
172
+ referencedRelation: 'tenants';
173
+ referencedColumns: ['id'];
174
+ }
175
+ ];
176
+ };
177
+ agent_heartbeat_runs: {
178
+ Row: {
179
+ agent_id: string;
180
+ chat_id: string | null;
181
+ completed_at: string | null;
182
+ cost_cents: number | null;
183
+ created_at: string;
184
+ duration_ms: number | null;
185
+ error_message: string | null;
186
+ id: string;
187
+ messages_created: number | null;
188
+ metadata: Json | null;
189
+ prompt: string | null;
190
+ result: Json | null;
191
+ started_at: string;
192
+ status: string;
193
+ tenant_id: string;
194
+ token_count: number | null;
195
+ tokens_used: number | null;
196
+ trigger_type: string | null;
197
+ };
198
+ Insert: {
199
+ agent_id: string;
200
+ chat_id?: string | null;
201
+ completed_at?: string | null;
202
+ cost_cents?: number | null;
203
+ created_at?: string;
204
+ duration_ms?: number | null;
205
+ error_message?: string | null;
206
+ id?: string;
207
+ messages_created?: number | null;
208
+ metadata?: Json | null;
209
+ prompt?: string | null;
210
+ result?: Json | null;
211
+ started_at?: string;
212
+ status?: string;
213
+ tenant_id: string;
214
+ token_count?: number | null;
215
+ tokens_used?: number | null;
216
+ trigger_type?: string | null;
217
+ };
218
+ Update: {
219
+ agent_id?: string;
220
+ chat_id?: string | null;
221
+ completed_at?: string | null;
222
+ cost_cents?: number | null;
223
+ created_at?: string;
224
+ duration_ms?: number | null;
225
+ error_message?: string | null;
226
+ id?: string;
227
+ messages_created?: number | null;
228
+ metadata?: Json | null;
229
+ prompt?: string | null;
230
+ result?: Json | null;
231
+ started_at?: string;
232
+ status?: string;
233
+ tenant_id?: string;
234
+ token_count?: number | null;
235
+ tokens_used?: number | null;
236
+ trigger_type?: string | null;
237
+ };
238
+ Relationships: [
239
+ {
240
+ foreignKeyName: 'agent_heartbeat_runs_agent_id_fkey';
241
+ columns: ['agent_id'];
242
+ isOneToOne: false;
243
+ referencedRelation: 'agents';
244
+ referencedColumns: ['id'];
245
+ },
246
+ {
247
+ foreignKeyName: 'agent_heartbeat_runs_chat_id_fkey';
248
+ columns: ['chat_id'];
249
+ isOneToOne: false;
250
+ referencedRelation: 'chats';
251
+ referencedColumns: ['id'];
252
+ },
253
+ {
254
+ foreignKeyName: 'agent_heartbeat_runs_tenant_id_fkey';
255
+ columns: ['tenant_id'];
256
+ isOneToOne: false;
257
+ referencedRelation: 'tenants';
258
+ referencedColumns: ['id'];
259
+ }
260
+ ];
261
+ };
262
+ agent_skills: {
263
+ Row: {
264
+ agent_id: string;
265
+ created_at: string | null;
266
+ id: string;
267
+ priority: number | null;
268
+ skill_id: string;
269
+ };
270
+ Insert: {
271
+ agent_id: string;
272
+ created_at?: string | null;
273
+ id?: string;
274
+ priority?: number | null;
275
+ skill_id: string;
276
+ };
277
+ Update: {
278
+ agent_id?: string;
279
+ created_at?: string | null;
280
+ id?: string;
281
+ priority?: number | null;
282
+ skill_id?: string;
283
+ };
284
+ Relationships: [
285
+ {
286
+ foreignKeyName: 'agent_skills_agent_id_fkey';
287
+ columns: ['agent_id'];
288
+ isOneToOne: false;
289
+ referencedRelation: 'agents';
290
+ referencedColumns: ['id'];
291
+ },
292
+ {
293
+ foreignKeyName: 'agent_skills_skill_id_fkey';
294
+ columns: ['skill_id'];
295
+ isOneToOne: false;
296
+ referencedRelation: 'skills';
297
+ referencedColumns: ['id'];
298
+ }
299
+ ];
300
+ };
301
+ agents: {
302
+ Row: {
303
+ config: Json | null;
304
+ connection_id: string | null;
305
+ created_at: string;
306
+ created_by: string | null;
307
+ description: string | null;
308
+ enabled: boolean | null;
309
+ external_agent_id: string | null;
310
+ icon: string | null;
311
+ id: string;
312
+ is_system: boolean | null;
313
+ model: string | null;
314
+ name: string;
315
+ reports_to: string | null;
316
+ role: string | null;
317
+ role_id: string | null;
318
+ slug: string;
319
+ system_prompt: string;
320
+ tenant_id: string | null;
321
+ title: string | null;
322
+ updated_at: string;
323
+ };
324
+ Insert: {
325
+ config?: Json | null;
326
+ connection_id?: string | null;
327
+ created_at?: string;
328
+ created_by?: string | null;
329
+ description?: string | null;
330
+ enabled?: boolean | null;
331
+ external_agent_id?: string | null;
332
+ icon?: string | null;
333
+ id?: string;
334
+ is_system?: boolean | null;
335
+ model?: string | null;
336
+ name: string;
337
+ reports_to?: string | null;
338
+ role?: string | null;
339
+ role_id?: string | null;
340
+ slug: string;
341
+ system_prompt?: string;
342
+ tenant_id?: string | null;
343
+ title?: string | null;
344
+ updated_at?: string;
345
+ };
346
+ Update: {
347
+ config?: Json | null;
348
+ connection_id?: string | null;
349
+ created_at?: string;
350
+ created_by?: string | null;
351
+ description?: string | null;
352
+ enabled?: boolean | null;
353
+ external_agent_id?: string | null;
354
+ icon?: string | null;
355
+ id?: string;
356
+ is_system?: boolean | null;
357
+ model?: string | null;
358
+ name?: string;
359
+ reports_to?: string | null;
360
+ role?: string | null;
361
+ role_id?: string | null;
362
+ slug?: string;
363
+ system_prompt?: string;
364
+ tenant_id?: string | null;
365
+ title?: string | null;
366
+ updated_at?: string;
367
+ };
368
+ Relationships: [
369
+ {
370
+ foreignKeyName: 'agents_reports_to_fkey';
371
+ columns: ['reports_to'];
372
+ isOneToOne: false;
373
+ referencedRelation: 'agents';
374
+ referencedColumns: ['id'];
375
+ },
376
+ {
377
+ foreignKeyName: 'agents_role_id_fkey';
378
+ columns: ['role_id'];
379
+ isOneToOne: false;
380
+ referencedRelation: 'roles';
381
+ referencedColumns: ['id'];
382
+ },
383
+ {
384
+ foreignKeyName: 'agents_tenant_id_tenants_id_fk';
385
+ columns: ['tenant_id'];
386
+ isOneToOne: false;
387
+ referencedRelation: 'tenants';
388
+ referencedColumns: ['id'];
389
+ }
390
+ ];
391
+ };
392
+ agents_tools: {
393
+ Row: {
394
+ agent_id: string;
395
+ created_at: string;
396
+ id: string;
397
+ tool_id: string;
398
+ };
399
+ Insert: {
400
+ agent_id: string;
401
+ created_at?: string;
402
+ id?: string;
403
+ tool_id: string;
404
+ };
405
+ Update: {
406
+ agent_id?: string;
407
+ created_at?: string;
408
+ id?: string;
409
+ tool_id?: string;
410
+ };
411
+ Relationships: [
412
+ {
413
+ foreignKeyName: 'agents_tools_agent_id_fkey';
414
+ columns: ['agent_id'];
415
+ isOneToOne: false;
416
+ referencedRelation: 'agents';
417
+ referencedColumns: ['id'];
418
+ },
419
+ {
420
+ foreignKeyName: 'agents_tools_tool_id_fkey';
421
+ columns: ['tool_id'];
422
+ isOneToOne: false;
423
+ referencedRelation: 'tools';
424
+ referencedColumns: ['id'];
425
+ }
426
+ ];
427
+ };
428
+ ai_models: {
429
+ Row: {
430
+ capabilities: Json;
431
+ cost_per_1m_input: number;
432
+ cost_per_1m_output: number;
433
+ created_at: string;
434
+ description: string | null;
435
+ display_name: string;
436
+ enabled: boolean;
437
+ id: string;
438
+ metadata: Json;
439
+ model_id: string;
440
+ provider: string;
441
+ reasoning_level: string | null;
442
+ sort_order: number;
443
+ speed_tier: string;
444
+ updated_at: string;
445
+ };
446
+ Insert: {
447
+ capabilities?: Json;
448
+ cost_per_1m_input?: number;
449
+ cost_per_1m_output?: number;
450
+ created_at?: string;
451
+ description?: string | null;
452
+ display_name: string;
453
+ enabled?: boolean;
454
+ id?: string;
455
+ metadata?: Json;
456
+ model_id: string;
457
+ provider: string;
458
+ reasoning_level?: string | null;
459
+ sort_order?: number;
460
+ speed_tier?: string;
461
+ updated_at?: string;
462
+ };
463
+ Update: {
464
+ capabilities?: Json;
465
+ cost_per_1m_input?: number;
466
+ cost_per_1m_output?: number;
467
+ created_at?: string;
468
+ description?: string | null;
469
+ display_name?: string;
470
+ enabled?: boolean;
471
+ id?: string;
472
+ metadata?: Json;
473
+ model_id?: string;
474
+ provider?: string;
475
+ reasoning_level?: string | null;
476
+ sort_order?: number;
477
+ speed_tier?: string;
478
+ updated_at?: string;
479
+ };
480
+ Relationships: [];
481
+ };
482
+ analytics_events: {
483
+ Row: {
484
+ browser: string | null;
485
+ city: string | null;
486
+ country: string | null;
487
+ created_at: string | null;
488
+ device_type: string | null;
489
+ element_class: string | null;
490
+ element_id: string | null;
491
+ element_text: string | null;
492
+ event_name: string;
493
+ event_type: string;
494
+ id: string;
495
+ ip_address: unknown;
496
+ metadata: Json | null;
497
+ os: string | null;
498
+ page_url: string | null;
499
+ referrer_url: string | null;
500
+ session_id: string | null;
501
+ target_url: string | null;
502
+ tenant_id: string | null;
503
+ user_agent: string | null;
504
+ user_id: string | null;
505
+ utm_campaign: string | null;
506
+ utm_content: string | null;
507
+ utm_medium: string | null;
508
+ utm_source: string | null;
509
+ utm_term: string | null;
510
+ };
511
+ Insert: {
512
+ browser?: string | null;
513
+ city?: string | null;
514
+ country?: string | null;
515
+ created_at?: string | null;
516
+ device_type?: string | null;
517
+ element_class?: string | null;
518
+ element_id?: string | null;
519
+ element_text?: string | null;
520
+ event_name: string;
521
+ event_type: string;
522
+ id?: string;
523
+ ip_address?: unknown;
524
+ metadata?: Json | null;
525
+ os?: string | null;
526
+ page_url?: string | null;
527
+ referrer_url?: string | null;
528
+ session_id?: string | null;
529
+ target_url?: string | null;
530
+ tenant_id?: string | null;
531
+ user_agent?: string | null;
532
+ user_id?: string | null;
533
+ utm_campaign?: string | null;
534
+ utm_content?: string | null;
535
+ utm_medium?: string | null;
536
+ utm_source?: string | null;
537
+ utm_term?: string | null;
538
+ };
539
+ Update: {
540
+ browser?: string | null;
541
+ city?: string | null;
542
+ country?: string | null;
543
+ created_at?: string | null;
544
+ device_type?: string | null;
545
+ element_class?: string | null;
546
+ element_id?: string | null;
547
+ element_text?: string | null;
548
+ event_name?: string;
549
+ event_type?: string;
550
+ id?: string;
551
+ ip_address?: unknown;
552
+ metadata?: Json | null;
553
+ os?: string | null;
554
+ page_url?: string | null;
555
+ referrer_url?: string | null;
556
+ session_id?: string | null;
557
+ target_url?: string | null;
558
+ tenant_id?: string | null;
559
+ user_agent?: string | null;
560
+ user_id?: string | null;
561
+ utm_campaign?: string | null;
562
+ utm_content?: string | null;
563
+ utm_medium?: string | null;
564
+ utm_source?: string | null;
565
+ utm_term?: string | null;
566
+ };
567
+ Relationships: [
568
+ {
569
+ foreignKeyName: 'analytics_events_tenant_id_fkey';
570
+ columns: ['tenant_id'];
571
+ isOneToOne: false;
572
+ referencedRelation: 'tenants';
573
+ referencedColumns: ['id'];
574
+ },
575
+ {
576
+ foreignKeyName: 'analytics_events_user_id_fkey';
577
+ columns: ['user_id'];
578
+ isOneToOne: false;
579
+ referencedRelation: 'profiles';
580
+ referencedColumns: ['id'];
581
+ }
582
+ ];
583
+ };
584
+ api_keys: {
585
+ Row: {
586
+ created_at: string | null;
587
+ created_by: string | null;
588
+ expires_at: string | null;
589
+ id: string;
590
+ key_hash: string;
591
+ key_prefix: string;
592
+ last_used_at: string | null;
593
+ name: string;
594
+ revoked_at: string | null;
595
+ scopes: string[] | null;
596
+ tenant_id: string;
597
+ };
598
+ Insert: {
599
+ created_at?: string | null;
600
+ created_by?: string | null;
601
+ expires_at?: string | null;
602
+ id?: string;
603
+ key_hash: string;
604
+ key_prefix: string;
605
+ last_used_at?: string | null;
606
+ name: string;
607
+ revoked_at?: string | null;
608
+ scopes?: string[] | null;
609
+ tenant_id: string;
610
+ };
611
+ Update: {
612
+ created_at?: string | null;
613
+ created_by?: string | null;
614
+ expires_at?: string | null;
615
+ id?: string;
616
+ key_hash?: string;
617
+ key_prefix?: string;
618
+ last_used_at?: string | null;
619
+ name?: string;
620
+ revoked_at?: string | null;
621
+ scopes?: string[] | null;
622
+ tenant_id?: string;
623
+ };
624
+ Relationships: [
625
+ {
626
+ foreignKeyName: 'api_keys_tenant_id_fkey';
627
+ columns: ['tenant_id'];
628
+ isOneToOne: false;
629
+ referencedRelation: 'tenants';
630
+ referencedColumns: ['id'];
631
+ }
632
+ ];
633
+ };
634
+ audit_logs: {
635
+ Row: {
636
+ changed_by: string | null;
637
+ id: number;
638
+ new_data: Json | null;
639
+ old_data: Json | null;
640
+ operation: string;
641
+ resource_id: string | null;
642
+ table_name: string;
643
+ tenant_id: string | null;
644
+ timestamp: string;
645
+ };
646
+ Insert: {
647
+ changed_by?: string | null;
648
+ id?: never;
649
+ new_data?: Json | null;
650
+ old_data?: Json | null;
651
+ operation: string;
652
+ resource_id?: string | null;
653
+ table_name: string;
654
+ tenant_id?: string | null;
655
+ timestamp?: string;
656
+ };
657
+ Update: {
658
+ changed_by?: string | null;
659
+ id?: never;
660
+ new_data?: Json | null;
661
+ old_data?: Json | null;
662
+ operation?: string;
663
+ resource_id?: string | null;
664
+ table_name?: string;
665
+ tenant_id?: string | null;
666
+ timestamp?: string;
667
+ };
668
+ Relationships: [];
669
+ };
670
+ chat_feedback: {
671
+ Row: {
672
+ chat_id: string;
673
+ comment: string | null;
674
+ created_at: string;
675
+ id: string;
676
+ message_index: number;
677
+ rating: string;
678
+ tenant_id: string;
679
+ user_id: string;
680
+ };
681
+ Insert: {
682
+ chat_id: string;
683
+ comment?: string | null;
684
+ created_at?: string;
685
+ id?: string;
686
+ message_index: number;
687
+ rating: string;
688
+ tenant_id: string;
689
+ user_id: string;
690
+ };
691
+ Update: {
692
+ chat_id?: string;
693
+ comment?: string | null;
694
+ created_at?: string;
695
+ id?: string;
696
+ message_index?: number;
697
+ rating?: string;
698
+ tenant_id?: string;
699
+ user_id?: string;
700
+ };
701
+ Relationships: [
702
+ {
703
+ foreignKeyName: 'chat_feedback_chat_id_fkey';
704
+ columns: ['chat_id'];
705
+ isOneToOne: false;
706
+ referencedRelation: 'chats';
707
+ referencedColumns: ['id'];
708
+ },
709
+ {
710
+ foreignKeyName: 'chat_feedback_tenant_id_fkey';
711
+ columns: ['tenant_id'];
712
+ isOneToOne: false;
713
+ referencedRelation: 'tenants';
714
+ referencedColumns: ['id'];
715
+ }
716
+ ];
717
+ };
718
+ chat_participants: {
719
+ Row: {
720
+ auto_respond: boolean;
721
+ chat_id: string;
722
+ id: string;
723
+ joined_at: string;
724
+ last_read_at: string;
725
+ participant_id: string;
726
+ participant_type: string;
727
+ role: string;
728
+ tenant_id: string;
729
+ };
730
+ Insert: {
731
+ auto_respond?: boolean;
732
+ chat_id: string;
733
+ id?: string;
734
+ joined_at?: string;
735
+ last_read_at?: string;
736
+ participant_id: string;
737
+ participant_type: string;
738
+ role?: string;
739
+ tenant_id: string;
740
+ };
741
+ Update: {
742
+ auto_respond?: boolean;
743
+ chat_id?: string;
744
+ id?: string;
745
+ joined_at?: string;
746
+ last_read_at?: string;
747
+ participant_id?: string;
748
+ participant_type?: string;
749
+ role?: string;
750
+ tenant_id?: string;
751
+ };
752
+ Relationships: [
753
+ {
754
+ foreignKeyName: 'chat_participants_chat_id_fkey';
755
+ columns: ['chat_id'];
756
+ isOneToOne: false;
757
+ referencedRelation: 'chats';
758
+ referencedColumns: ['id'];
759
+ },
760
+ {
761
+ foreignKeyName: 'chat_participants_tenant_id_fkey';
762
+ columns: ['tenant_id'];
763
+ isOneToOne: false;
764
+ referencedRelation: 'tenants';
765
+ referencedColumns: ['id'];
766
+ }
767
+ ];
768
+ };
769
+ chats: {
770
+ Row: {
771
+ agent_id: string | null;
772
+ chat_type: string;
773
+ created_at: string;
774
+ entity_id: string | null;
775
+ entity_type_slug: string | null;
776
+ id: string;
777
+ tenant_id: string;
778
+ title: string | null;
779
+ updated_at: string;
780
+ user_id: string | null;
781
+ };
782
+ Insert: {
783
+ agent_id?: string | null;
784
+ chat_type?: string;
785
+ created_at?: string;
786
+ entity_id?: string | null;
787
+ entity_type_slug?: string | null;
788
+ id?: string;
789
+ tenant_id: string;
790
+ title?: string | null;
791
+ updated_at?: string;
792
+ user_id?: string | null;
793
+ };
794
+ Update: {
795
+ agent_id?: string | null;
796
+ chat_type?: string;
797
+ created_at?: string;
798
+ entity_id?: string | null;
799
+ entity_type_slug?: string | null;
800
+ id?: string;
801
+ tenant_id?: string;
802
+ title?: string | null;
803
+ updated_at?: string;
804
+ user_id?: string | null;
805
+ };
806
+ Relationships: [
807
+ {
808
+ foreignKeyName: 'chats_entity_id_fkey';
809
+ columns: ['entity_id'];
810
+ isOneToOne: false;
811
+ referencedRelation: 'entities';
812
+ referencedColumns: ['id'];
813
+ },
814
+ {
815
+ foreignKeyName: 'chats_tenant_id_tenants_id_fk';
816
+ columns: ['tenant_id'];
817
+ isOneToOne: false;
818
+ referencedRelation: 'tenants';
819
+ referencedColumns: ['id'];
820
+ }
821
+ ];
822
+ };
823
+ collection_shares: {
824
+ Row: {
825
+ created_at: string;
826
+ created_by: string | null;
827
+ description: string | null;
828
+ entity_type_slug: string | null;
829
+ expires_at: string | null;
830
+ filters: Json | null;
831
+ id: string;
832
+ tenant_id: string;
833
+ title: string | null;
834
+ token: string;
835
+ };
836
+ Insert: {
837
+ created_at?: string;
838
+ created_by?: string | null;
839
+ description?: string | null;
840
+ entity_type_slug?: string | null;
841
+ expires_at?: string | null;
842
+ filters?: Json | null;
843
+ id?: string;
844
+ tenant_id: string;
845
+ title?: string | null;
846
+ token?: string;
847
+ };
848
+ Update: {
849
+ created_at?: string;
850
+ created_by?: string | null;
851
+ description?: string | null;
852
+ entity_type_slug?: string | null;
853
+ expires_at?: string | null;
854
+ filters?: Json | null;
855
+ id?: string;
856
+ tenant_id?: string;
857
+ title?: string | null;
858
+ token?: string;
859
+ };
860
+ Relationships: [
861
+ {
862
+ foreignKeyName: 'collection_shares_tenant_id_fkey';
863
+ columns: ['tenant_id'];
864
+ isOneToOne: false;
865
+ referencedRelation: 'tenants';
866
+ referencedColumns: ['id'];
867
+ }
868
+ ];
869
+ };
870
+ comments: {
871
+ Row: {
872
+ content: string;
873
+ created_at: string;
874
+ entity_id: string;
875
+ id: string;
876
+ metadata: Json | null;
877
+ parent_id: string | null;
878
+ tenant_id: string;
879
+ updated_at: string;
880
+ user_id: string;
881
+ };
882
+ Insert: {
883
+ content: string;
884
+ created_at?: string;
885
+ entity_id: string;
886
+ id?: string;
887
+ metadata?: Json | null;
888
+ parent_id?: string | null;
889
+ tenant_id: string;
890
+ updated_at?: string;
891
+ user_id: string;
892
+ };
893
+ Update: {
894
+ content?: string;
895
+ created_at?: string;
896
+ entity_id?: string;
897
+ id?: string;
898
+ metadata?: Json | null;
899
+ parent_id?: string | null;
900
+ tenant_id?: string;
901
+ updated_at?: string;
902
+ user_id?: string;
903
+ };
904
+ Relationships: [
905
+ {
906
+ foreignKeyName: 'comments_entity_id_fkey';
907
+ columns: ['entity_id'];
908
+ isOneToOne: false;
909
+ referencedRelation: 'entities';
910
+ referencedColumns: ['id'];
911
+ },
912
+ {
913
+ foreignKeyName: 'comments_parent_id_fkey';
914
+ columns: ['parent_id'];
915
+ isOneToOne: false;
916
+ referencedRelation: 'comments';
917
+ referencedColumns: ['id'];
918
+ },
919
+ {
920
+ foreignKeyName: 'comments_tenant_id_fkey';
921
+ columns: ['tenant_id'];
922
+ isOneToOne: false;
923
+ referencedRelation: 'tenants';
924
+ referencedColumns: ['id'];
925
+ },
926
+ {
927
+ foreignKeyName: 'comments_user_id_profiles_fk';
928
+ columns: ['user_id'];
929
+ isOneToOne: false;
930
+ referencedRelation: 'profiles';
931
+ referencedColumns: ['id'];
932
+ }
933
+ ];
934
+ };
935
+ cost_events: {
936
+ Row: {
937
+ agent_id: string | null;
938
+ chat_id: string | null;
939
+ cost_cents: number | null;
940
+ created_at: string;
941
+ id: string;
942
+ input_tokens: number | null;
943
+ model: string;
944
+ output_tokens: number | null;
945
+ provider: string;
946
+ source: string | null;
947
+ tenant_id: string;
948
+ };
949
+ Insert: {
950
+ agent_id?: string | null;
951
+ chat_id?: string | null;
952
+ cost_cents?: number | null;
953
+ created_at?: string;
954
+ id?: string;
955
+ input_tokens?: number | null;
956
+ model: string;
957
+ output_tokens?: number | null;
958
+ provider: string;
959
+ source?: string | null;
960
+ tenant_id: string;
961
+ };
962
+ Update: {
963
+ agent_id?: string | null;
964
+ chat_id?: string | null;
965
+ cost_cents?: number | null;
966
+ created_at?: string;
967
+ id?: string;
968
+ input_tokens?: number | null;
969
+ model?: string;
970
+ output_tokens?: number | null;
971
+ provider?: string;
972
+ source?: string | null;
973
+ tenant_id?: string;
974
+ };
975
+ Relationships: [
976
+ {
977
+ foreignKeyName: 'cost_records_chat_id_fkey';
978
+ columns: ['chat_id'];
979
+ isOneToOne: false;
980
+ referencedRelation: 'chats';
981
+ referencedColumns: ['id'];
982
+ },
983
+ {
984
+ foreignKeyName: 'cost_records_tenant_id_fkey';
985
+ columns: ['tenant_id'];
986
+ isOneToOne: false;
987
+ referencedRelation: 'tenants';
988
+ referencedColumns: ['id'];
989
+ }
990
+ ];
991
+ };
992
+ criteria_sets: {
993
+ Row: {
994
+ aggregate_display: string | null;
995
+ created_at: string;
996
+ created_by: string | null;
997
+ description: string | null;
998
+ dimensions: Json;
999
+ entity_id: string | null;
1000
+ entity_type_slugs: string[] | null;
1001
+ id: string;
1002
+ is_default: boolean | null;
1003
+ kind: string;
1004
+ name: string;
1005
+ promotion_mode: string;
1006
+ slug: string;
1007
+ temporal_key: string | null;
1008
+ tenant_id: string;
1009
+ updated_at: string;
1010
+ };
1011
+ Insert: {
1012
+ aggregate_display?: string | null;
1013
+ created_at?: string;
1014
+ created_by?: string | null;
1015
+ description?: string | null;
1016
+ dimensions?: Json;
1017
+ entity_id?: string | null;
1018
+ entity_type_slugs?: string[] | null;
1019
+ id?: string;
1020
+ is_default?: boolean | null;
1021
+ kind?: string;
1022
+ name: string;
1023
+ promotion_mode?: string;
1024
+ slug: string;
1025
+ temporal_key?: string | null;
1026
+ tenant_id: string;
1027
+ updated_at?: string;
1028
+ };
1029
+ Update: {
1030
+ aggregate_display?: string | null;
1031
+ created_at?: string;
1032
+ created_by?: string | null;
1033
+ description?: string | null;
1034
+ dimensions?: Json;
1035
+ entity_id?: string | null;
1036
+ entity_type_slugs?: string[] | null;
1037
+ id?: string;
1038
+ is_default?: boolean | null;
1039
+ kind?: string;
1040
+ name?: string;
1041
+ promotion_mode?: string;
1042
+ slug?: string;
1043
+ temporal_key?: string | null;
1044
+ tenant_id?: string;
1045
+ updated_at?: string;
1046
+ };
1047
+ Relationships: [
1048
+ {
1049
+ foreignKeyName: 'criteria_sets_entity_id_fkey';
1050
+ columns: ['entity_id'];
1051
+ isOneToOne: false;
1052
+ referencedRelation: 'entities';
1053
+ referencedColumns: ['id'];
1054
+ },
1055
+ {
1056
+ foreignKeyName: 'criteria_sets_tenant_id_fkey';
1057
+ columns: ['tenant_id'];
1058
+ isOneToOne: false;
1059
+ referencedRelation: 'tenants';
1060
+ referencedColumns: ['id'];
1061
+ }
1062
+ ];
1063
+ };
1064
+ document_chunks: {
1065
+ Row: {
1066
+ chunk_index: number;
1067
+ content: string;
1068
+ created_at: string;
1069
+ document_id: string;
1070
+ embedding: string | null;
1071
+ fts: unknown;
1072
+ id: string;
1073
+ metadata: Json | null;
1074
+ page_number: number | null;
1075
+ tenant_id: string;
1076
+ };
1077
+ Insert: {
1078
+ chunk_index: number;
1079
+ content: string;
1080
+ created_at?: string;
1081
+ document_id: string;
1082
+ embedding?: string | null;
1083
+ fts?: unknown;
1084
+ id?: string;
1085
+ metadata?: Json | null;
1086
+ page_number?: number | null;
1087
+ tenant_id: string;
1088
+ };
1089
+ Update: {
1090
+ chunk_index?: number;
1091
+ content?: string;
1092
+ created_at?: string;
1093
+ document_id?: string;
1094
+ embedding?: string | null;
1095
+ fts?: unknown;
1096
+ id?: string;
1097
+ metadata?: Json | null;
1098
+ page_number?: number | null;
1099
+ tenant_id?: string;
1100
+ };
1101
+ Relationships: [
1102
+ {
1103
+ foreignKeyName: 'document_chunks_document_id_fkey';
1104
+ columns: ['document_id'];
1105
+ isOneToOne: false;
1106
+ referencedRelation: 'documents';
1107
+ referencedColumns: ['id'];
1108
+ },
1109
+ {
1110
+ foreignKeyName: 'document_chunks_tenant_id_fkey';
1111
+ columns: ['tenant_id'];
1112
+ isOneToOne: false;
1113
+ referencedRelation: 'tenants';
1114
+ referencedColumns: ['id'];
1115
+ }
1116
+ ];
1117
+ };
1118
+ document_pages: {
1119
+ Row: {
1120
+ content: string;
1121
+ created_at: string;
1122
+ document_id: string;
1123
+ fts: unknown;
1124
+ id: string;
1125
+ metadata: Json | null;
1126
+ page_number: number;
1127
+ };
1128
+ Insert: {
1129
+ content?: string;
1130
+ created_at?: string;
1131
+ document_id: string;
1132
+ fts?: unknown;
1133
+ id?: string;
1134
+ metadata?: Json | null;
1135
+ page_number: number;
1136
+ };
1137
+ Update: {
1138
+ content?: string;
1139
+ created_at?: string;
1140
+ document_id?: string;
1141
+ fts?: unknown;
1142
+ id?: string;
1143
+ metadata?: Json | null;
1144
+ page_number?: number;
1145
+ };
1146
+ Relationships: [
1147
+ {
1148
+ foreignKeyName: 'document_pages_document_id_fkey';
1149
+ columns: ['document_id'];
1150
+ isOneToOne: false;
1151
+ referencedRelation: 'documents';
1152
+ referencedColumns: ['id'];
1153
+ }
1154
+ ];
1155
+ };
1156
+ documents: {
1157
+ Row: {
1158
+ chunk_count: number | null;
1159
+ created_at: string;
1160
+ document_entity_id: string | null;
1161
+ entity_id: string | null;
1162
+ error_message: string | null;
1163
+ file_name: string | null;
1164
+ file_path: string | null;
1165
+ file_size: number | null;
1166
+ file_type: string | null;
1167
+ file_url: string | null;
1168
+ id: string;
1169
+ metadata: Json | null;
1170
+ mime_type: string | null;
1171
+ page_count: number | null;
1172
+ processed_at: string | null;
1173
+ processing_stage: string | null;
1174
+ shared_with: string[] | null;
1175
+ status: string;
1176
+ storage_path: string | null;
1177
+ tenant_id: string;
1178
+ title: string;
1179
+ updated_at: string;
1180
+ uploaded_by: string | null;
1181
+ url: string | null;
1182
+ visibility: Database['public']['Enums']['visibility_level'] | null;
1183
+ };
1184
+ Insert: {
1185
+ chunk_count?: number | null;
1186
+ created_at?: string;
1187
+ document_entity_id?: string | null;
1188
+ entity_id?: string | null;
1189
+ error_message?: string | null;
1190
+ file_name?: string | null;
1191
+ file_path?: string | null;
1192
+ file_size?: number | null;
1193
+ file_type?: string | null;
1194
+ file_url?: string | null;
1195
+ id?: string;
1196
+ metadata?: Json | null;
1197
+ mime_type?: string | null;
1198
+ page_count?: number | null;
1199
+ processed_at?: string | null;
1200
+ processing_stage?: string | null;
1201
+ shared_with?: string[] | null;
1202
+ status?: string;
1203
+ storage_path?: string | null;
1204
+ tenant_id: string;
1205
+ title: string;
1206
+ updated_at?: string;
1207
+ uploaded_by?: string | null;
1208
+ url?: string | null;
1209
+ visibility?: Database['public']['Enums']['visibility_level'] | null;
1210
+ };
1211
+ Update: {
1212
+ chunk_count?: number | null;
1213
+ created_at?: string;
1214
+ document_entity_id?: string | null;
1215
+ entity_id?: string | null;
1216
+ error_message?: string | null;
1217
+ file_name?: string | null;
1218
+ file_path?: string | null;
1219
+ file_size?: number | null;
1220
+ file_type?: string | null;
1221
+ file_url?: string | null;
1222
+ id?: string;
1223
+ metadata?: Json | null;
1224
+ mime_type?: string | null;
1225
+ page_count?: number | null;
1226
+ processed_at?: string | null;
1227
+ processing_stage?: string | null;
1228
+ shared_with?: string[] | null;
1229
+ status?: string;
1230
+ storage_path?: string | null;
1231
+ tenant_id?: string;
1232
+ title?: string;
1233
+ updated_at?: string;
1234
+ uploaded_by?: string | null;
1235
+ url?: string | null;
1236
+ visibility?: Database['public']['Enums']['visibility_level'] | null;
1237
+ };
1238
+ Relationships: [
1239
+ {
1240
+ foreignKeyName: 'documents_document_entity_id_fkey';
1241
+ columns: ['document_entity_id'];
1242
+ isOneToOne: false;
1243
+ referencedRelation: 'entities';
1244
+ referencedColumns: ['id'];
1245
+ },
1246
+ {
1247
+ foreignKeyName: 'documents_entity_id_fkey';
1248
+ columns: ['entity_id'];
1249
+ isOneToOne: false;
1250
+ referencedRelation: 'entities';
1251
+ referencedColumns: ['id'];
1252
+ },
1253
+ {
1254
+ foreignKeyName: 'documents_tenant_id_fkey';
1255
+ columns: ['tenant_id'];
1256
+ isOneToOne: false;
1257
+ referencedRelation: 'tenants';
1258
+ referencedColumns: ['id'];
1259
+ }
1260
+ ];
1261
+ };
1262
+ entities: {
1263
+ Row: {
1264
+ content: Json | null;
1265
+ created_at: string;
1266
+ description: string | null;
1267
+ embedding: string | null;
1268
+ entity_type_id: string;
1269
+ entity_type_slug: string | null;
1270
+ fts: unknown;
1271
+ id: string;
1272
+ image_url: string | null;
1273
+ metadata: Json | null;
1274
+ owner_id: string | null;
1275
+ parent_id: string | null;
1276
+ share_token: string | null;
1277
+ slug: string;
1278
+ tags: string[] | null;
1279
+ tenant_id: string;
1280
+ title: string | null;
1281
+ updated_at: string;
1282
+ visibility: string | null;
1283
+ };
1284
+ Insert: {
1285
+ content?: Json | null;
1286
+ created_at?: string;
1287
+ description?: string | null;
1288
+ embedding?: string | null;
1289
+ entity_type_id: string;
1290
+ entity_type_slug?: string | null;
1291
+ fts?: unknown;
1292
+ id?: string;
1293
+ image_url?: string | null;
1294
+ metadata?: Json | null;
1295
+ owner_id?: string | null;
1296
+ parent_id?: string | null;
1297
+ share_token?: string | null;
1298
+ slug: string;
1299
+ tags?: string[] | null;
1300
+ tenant_id: string;
1301
+ title?: string | null;
1302
+ updated_at?: string;
1303
+ visibility?: string | null;
1304
+ };
1305
+ Update: {
1306
+ content?: Json | null;
1307
+ created_at?: string;
1308
+ description?: string | null;
1309
+ embedding?: string | null;
1310
+ entity_type_id?: string;
1311
+ entity_type_slug?: string | null;
1312
+ fts?: unknown;
1313
+ id?: string;
1314
+ image_url?: string | null;
1315
+ metadata?: Json | null;
1316
+ owner_id?: string | null;
1317
+ parent_id?: string | null;
1318
+ share_token?: string | null;
1319
+ slug?: string;
1320
+ tags?: string[] | null;
1321
+ tenant_id?: string;
1322
+ title?: string | null;
1323
+ updated_at?: string;
1324
+ visibility?: string | null;
1325
+ };
1326
+ Relationships: [
1327
+ {
1328
+ foreignKeyName: 'entities_entity_type_id_entity_types_id_fk';
1329
+ columns: ['entity_type_id'];
1330
+ isOneToOne: false;
1331
+ referencedRelation: 'entity_types';
1332
+ referencedColumns: ['id'];
1333
+ },
1334
+ {
1335
+ foreignKeyName: 'entities_owner_id_profiles_id_fk';
1336
+ columns: ['owner_id'];
1337
+ isOneToOne: false;
1338
+ referencedRelation: 'profiles';
1339
+ referencedColumns: ['id'];
1340
+ },
1341
+ {
1342
+ foreignKeyName: 'entities_parent_id_fkey';
1343
+ columns: ['parent_id'];
1344
+ isOneToOne: false;
1345
+ referencedRelation: 'entities';
1346
+ referencedColumns: ['id'];
1347
+ },
1348
+ {
1349
+ foreignKeyName: 'entities_tenant_id_tenants_id_fk';
1350
+ columns: ['tenant_id'];
1351
+ isOneToOne: false;
1352
+ referencedRelation: 'tenants';
1353
+ referencedColumns: ['id'];
1354
+ }
1355
+ ];
1356
+ };
1357
+ entity_relations: {
1358
+ Row: {
1359
+ created_at: string;
1360
+ from_entity_id: string;
1361
+ id: string;
1362
+ metadata: Json | null;
1363
+ relationship_type: string;
1364
+ tenant_id: string;
1365
+ to_entity_id: string;
1366
+ updated_at: string;
1367
+ };
1368
+ Insert: {
1369
+ created_at?: string;
1370
+ from_entity_id: string;
1371
+ id?: string;
1372
+ metadata?: Json | null;
1373
+ relationship_type: string;
1374
+ tenant_id: string;
1375
+ to_entity_id: string;
1376
+ updated_at?: string;
1377
+ };
1378
+ Update: {
1379
+ created_at?: string;
1380
+ from_entity_id?: string;
1381
+ id?: string;
1382
+ metadata?: Json | null;
1383
+ relationship_type?: string;
1384
+ tenant_id?: string;
1385
+ to_entity_id?: string;
1386
+ updated_at?: string;
1387
+ };
1388
+ Relationships: [
1389
+ {
1390
+ foreignKeyName: 'entity_relations_from_entity_id_fkey';
1391
+ columns: ['from_entity_id'];
1392
+ isOneToOne: false;
1393
+ referencedRelation: 'entities';
1394
+ referencedColumns: ['id'];
1395
+ },
1396
+ {
1397
+ foreignKeyName: 'entity_relations_tenant_id_tenants_id_fk';
1398
+ columns: ['tenant_id'];
1399
+ isOneToOne: false;
1400
+ referencedRelation: 'tenants';
1401
+ referencedColumns: ['id'];
1402
+ },
1403
+ {
1404
+ foreignKeyName: 'entity_relations_to_entity_id_fkey';
1405
+ columns: ['to_entity_id'];
1406
+ isOneToOne: false;
1407
+ referencedRelation: 'entities';
1408
+ referencedColumns: ['id'];
1409
+ }
1410
+ ];
1411
+ };
1412
+ entity_responses: {
1413
+ Row: {
1414
+ created_at: string;
1415
+ criteria_set_id: string;
1416
+ criteria_snapshot: Json;
1417
+ entity_id: string;
1418
+ field_meta: Json;
1419
+ id: string;
1420
+ metadata: Json;
1421
+ normalized_score: number | null;
1422
+ notes: string | null;
1423
+ parent_response_id: string | null;
1424
+ promoted_fields: string[] | null;
1425
+ review_notes: string | null;
1426
+ reviewed_at: string | null;
1427
+ reviewed_by: string | null;
1428
+ source: string;
1429
+ status: string;
1430
+ submitted_by_agent: string | null;
1431
+ submitted_by_user: string | null;
1432
+ temporal_value: string | null;
1433
+ tenant_id: string;
1434
+ updated_at: string;
1435
+ values: Json;
1436
+ weighted_score: number | null;
1437
+ };
1438
+ Insert: {
1439
+ created_at?: string;
1440
+ criteria_set_id: string;
1441
+ criteria_snapshot?: Json;
1442
+ entity_id: string;
1443
+ field_meta?: Json;
1444
+ id?: string;
1445
+ metadata?: Json;
1446
+ normalized_score?: number | null;
1447
+ notes?: string | null;
1448
+ parent_response_id?: string | null;
1449
+ promoted_fields?: string[] | null;
1450
+ review_notes?: string | null;
1451
+ reviewed_at?: string | null;
1452
+ reviewed_by?: string | null;
1453
+ source: string;
1454
+ status?: string;
1455
+ submitted_by_agent?: string | null;
1456
+ submitted_by_user?: string | null;
1457
+ temporal_value?: string | null;
1458
+ tenant_id: string;
1459
+ updated_at?: string;
1460
+ values?: Json;
1461
+ weighted_score?: number | null;
1462
+ };
1463
+ Update: {
1464
+ created_at?: string;
1465
+ criteria_set_id?: string;
1466
+ criteria_snapshot?: Json;
1467
+ entity_id?: string;
1468
+ field_meta?: Json;
1469
+ id?: string;
1470
+ metadata?: Json;
1471
+ normalized_score?: number | null;
1472
+ notes?: string | null;
1473
+ parent_response_id?: string | null;
1474
+ promoted_fields?: string[] | null;
1475
+ review_notes?: string | null;
1476
+ reviewed_at?: string | null;
1477
+ reviewed_by?: string | null;
1478
+ source?: string;
1479
+ status?: string;
1480
+ submitted_by_agent?: string | null;
1481
+ submitted_by_user?: string | null;
1482
+ temporal_value?: string | null;
1483
+ tenant_id?: string;
1484
+ updated_at?: string;
1485
+ values?: Json;
1486
+ weighted_score?: number | null;
1487
+ };
1488
+ Relationships: [
1489
+ {
1490
+ foreignKeyName: 'entity_responses_criteria_set_id_fkey';
1491
+ columns: ['criteria_set_id'];
1492
+ isOneToOne: false;
1493
+ referencedRelation: 'criteria_sets';
1494
+ referencedColumns: ['id'];
1495
+ },
1496
+ {
1497
+ foreignKeyName: 'entity_responses_entity_id_fkey';
1498
+ columns: ['entity_id'];
1499
+ isOneToOne: false;
1500
+ referencedRelation: 'entities';
1501
+ referencedColumns: ['id'];
1502
+ },
1503
+ {
1504
+ foreignKeyName: 'entity_responses_parent_response_id_fkey';
1505
+ columns: ['parent_response_id'];
1506
+ isOneToOne: false;
1507
+ referencedRelation: 'entity_responses';
1508
+ referencedColumns: ['id'];
1509
+ },
1510
+ {
1511
+ foreignKeyName: 'entity_responses_tenant_id_fkey';
1512
+ columns: ['tenant_id'];
1513
+ isOneToOne: false;
1514
+ referencedRelation: 'tenants';
1515
+ referencedColumns: ['id'];
1516
+ }
1517
+ ];
1518
+ };
1519
+ entity_share_links: {
1520
+ Row: {
1521
+ created_at: string;
1522
+ created_by: string | null;
1523
+ entity_id: string;
1524
+ expires_at: string | null;
1525
+ id: string;
1526
+ is_active: boolean;
1527
+ role: string;
1528
+ token: string;
1529
+ };
1530
+ Insert: {
1531
+ created_at?: string;
1532
+ created_by?: string | null;
1533
+ entity_id: string;
1534
+ expires_at?: string | null;
1535
+ id?: string;
1536
+ is_active?: boolean;
1537
+ role?: string;
1538
+ token: string;
1539
+ };
1540
+ Update: {
1541
+ created_at?: string;
1542
+ created_by?: string | null;
1543
+ entity_id?: string;
1544
+ expires_at?: string | null;
1545
+ id?: string;
1546
+ is_active?: boolean;
1547
+ role?: string;
1548
+ token?: string;
1549
+ };
1550
+ Relationships: [
1551
+ {
1552
+ foreignKeyName: 'entity_share_links_entity_id_fkey';
1553
+ columns: ['entity_id'];
1554
+ isOneToOne: false;
1555
+ referencedRelation: 'entities';
1556
+ referencedColumns: ['id'];
1557
+ }
1558
+ ];
1559
+ };
1560
+ entity_shares: {
1561
+ Row: {
1562
+ created_at: string;
1563
+ created_by: string | null;
1564
+ entity_id: string;
1565
+ id: string;
1566
+ role: string;
1567
+ user_id: string;
1568
+ };
1569
+ Insert: {
1570
+ created_at?: string;
1571
+ created_by?: string | null;
1572
+ entity_id: string;
1573
+ id?: string;
1574
+ role?: string;
1575
+ user_id: string;
1576
+ };
1577
+ Update: {
1578
+ created_at?: string;
1579
+ created_by?: string | null;
1580
+ entity_id?: string;
1581
+ id?: string;
1582
+ role?: string;
1583
+ user_id?: string;
1584
+ };
1585
+ Relationships: [
1586
+ {
1587
+ foreignKeyName: 'entity_shares_entity_id_fkey';
1588
+ columns: ['entity_id'];
1589
+ isOneToOne: false;
1590
+ referencedRelation: 'entities';
1591
+ referencedColumns: ['id'];
1592
+ }
1593
+ ];
1594
+ };
1595
+ entity_type_relationships: {
1596
+ Row: {
1597
+ created_at: string;
1598
+ from_type_id: string;
1599
+ id: string;
1600
+ metadata: Json | null;
1601
+ relationship_type: string;
1602
+ to_type_id: string;
1603
+ };
1604
+ Insert: {
1605
+ created_at?: string;
1606
+ from_type_id: string;
1607
+ id?: string;
1608
+ metadata?: Json | null;
1609
+ relationship_type: string;
1610
+ to_type_id: string;
1611
+ };
1612
+ Update: {
1613
+ created_at?: string;
1614
+ from_type_id?: string;
1615
+ id?: string;
1616
+ metadata?: Json | null;
1617
+ relationship_type?: string;
1618
+ to_type_id?: string;
1619
+ };
1620
+ Relationships: [
1621
+ {
1622
+ foreignKeyName: 'entity_type_relationships_from_type_id_fkey';
1623
+ columns: ['from_type_id'];
1624
+ isOneToOne: false;
1625
+ referencedRelation: 'entity_types';
1626
+ referencedColumns: ['id'];
1627
+ },
1628
+ {
1629
+ foreignKeyName: 'entity_type_relationships_to_type_id_fkey';
1630
+ columns: ['to_type_id'];
1631
+ isOneToOne: false;
1632
+ referencedRelation: 'entity_types';
1633
+ referencedColumns: ['id'];
1634
+ }
1635
+ ];
1636
+ };
1637
+ entity_type_versions: {
1638
+ Row: {
1639
+ change_summary: string | null;
1640
+ changed_by: string | null;
1641
+ config: Json;
1642
+ created_at: string;
1643
+ entity_type_id: string;
1644
+ id: string;
1645
+ json_schema: Json;
1646
+ version_number: number;
1647
+ };
1648
+ Insert: {
1649
+ change_summary?: string | null;
1650
+ changed_by?: string | null;
1651
+ config?: Json;
1652
+ created_at?: string;
1653
+ entity_type_id: string;
1654
+ id?: string;
1655
+ json_schema: Json;
1656
+ version_number?: number;
1657
+ };
1658
+ Update: {
1659
+ change_summary?: string | null;
1660
+ changed_by?: string | null;
1661
+ config?: Json;
1662
+ created_at?: string;
1663
+ entity_type_id?: string;
1664
+ id?: string;
1665
+ json_schema?: Json;
1666
+ version_number?: number;
1667
+ };
1668
+ Relationships: [
1669
+ {
1670
+ foreignKeyName: 'entity_type_versions_entity_type_id_fkey';
1671
+ columns: ['entity_type_id'];
1672
+ isOneToOne: false;
1673
+ referencedRelation: 'entity_types';
1674
+ referencedColumns: ['id'];
1675
+ }
1676
+ ];
1677
+ };
1678
+ entity_types: {
1679
+ Row: {
1680
+ behavior_json: Json | null;
1681
+ color: string | null;
1682
+ config: Json | null;
1683
+ created_at: string;
1684
+ description: string | null;
1685
+ icon: string | null;
1686
+ id: string;
1687
+ json_schema: Json | null;
1688
+ name: string;
1689
+ name_plural: string | null;
1690
+ render_code: string | null;
1691
+ shared_with: string[] | null;
1692
+ slug: string;
1693
+ tenant_id: string | null;
1694
+ ui_json: Json | null;
1695
+ updated_at: string;
1696
+ version_number: number;
1697
+ visibility: Database['public']['Enums']['visibility_level'] | null;
1698
+ };
1699
+ Insert: {
1700
+ behavior_json?: Json | null;
1701
+ color?: string | null;
1702
+ config?: Json | null;
1703
+ created_at?: string;
1704
+ description?: string | null;
1705
+ icon?: string | null;
1706
+ id: string;
1707
+ json_schema?: Json | null;
1708
+ name: string;
1709
+ name_plural?: string | null;
1710
+ render_code?: string | null;
1711
+ shared_with?: string[] | null;
1712
+ slug: string;
1713
+ tenant_id?: string | null;
1714
+ ui_json?: Json | null;
1715
+ updated_at?: string;
1716
+ version_number?: number;
1717
+ visibility?: Database['public']['Enums']['visibility_level'] | null;
1718
+ };
1719
+ Update: {
1720
+ behavior_json?: Json | null;
1721
+ color?: string | null;
1722
+ config?: Json | null;
1723
+ created_at?: string;
1724
+ description?: string | null;
1725
+ icon?: string | null;
1726
+ id?: string;
1727
+ json_schema?: Json | null;
1728
+ name?: string;
1729
+ name_plural?: string | null;
1730
+ render_code?: string | null;
1731
+ shared_with?: string[] | null;
1732
+ slug?: string;
1733
+ tenant_id?: string | null;
1734
+ ui_json?: Json | null;
1735
+ updated_at?: string;
1736
+ version_number?: number;
1737
+ visibility?: Database['public']['Enums']['visibility_level'] | null;
1738
+ };
1739
+ Relationships: [
1740
+ {
1741
+ foreignKeyName: 'entity_types_tenant_id_tenants_id_fk';
1742
+ columns: ['tenant_id'];
1743
+ isOneToOne: false;
1744
+ referencedRelation: 'tenants';
1745
+ referencedColumns: ['id'];
1746
+ }
1747
+ ];
1748
+ };
1749
+ extraction_results: {
1750
+ Row: {
1751
+ additional_instructions: string | null;
1752
+ agent_id: string | null;
1753
+ confidence: string | null;
1754
+ created_at: string;
1755
+ created_entity_ids: string[] | null;
1756
+ duration_ms: number | null;
1757
+ entity_id: string;
1758
+ field_name: string;
1759
+ id: string;
1760
+ metadata: Json | null;
1761
+ rejection_reason: string | null;
1762
+ reviewed_at: string | null;
1763
+ reviewed_by: string | null;
1764
+ run_id: string;
1765
+ sources: Json | null;
1766
+ status: string | null;
1767
+ tenant_id: string;
1768
+ tokens_used: number | null;
1769
+ value: Json | null;
1770
+ workflow_node_run_id: string | null;
1771
+ };
1772
+ Insert: {
1773
+ additional_instructions?: string | null;
1774
+ agent_id?: string | null;
1775
+ confidence?: string | null;
1776
+ created_at?: string;
1777
+ created_entity_ids?: string[] | null;
1778
+ duration_ms?: number | null;
1779
+ entity_id: string;
1780
+ field_name: string;
1781
+ id?: string;
1782
+ metadata?: Json | null;
1783
+ rejection_reason?: string | null;
1784
+ reviewed_at?: string | null;
1785
+ reviewed_by?: string | null;
1786
+ run_id: string;
1787
+ sources?: Json | null;
1788
+ status?: string | null;
1789
+ tenant_id: string;
1790
+ tokens_used?: number | null;
1791
+ value?: Json | null;
1792
+ workflow_node_run_id?: string | null;
1793
+ };
1794
+ Update: {
1795
+ additional_instructions?: string | null;
1796
+ agent_id?: string | null;
1797
+ confidence?: string | null;
1798
+ created_at?: string;
1799
+ created_entity_ids?: string[] | null;
1800
+ duration_ms?: number | null;
1801
+ entity_id?: string;
1802
+ field_name?: string;
1803
+ id?: string;
1804
+ metadata?: Json | null;
1805
+ rejection_reason?: string | null;
1806
+ reviewed_at?: string | null;
1807
+ reviewed_by?: string | null;
1808
+ run_id?: string;
1809
+ sources?: Json | null;
1810
+ status?: string | null;
1811
+ tenant_id?: string;
1812
+ tokens_used?: number | null;
1813
+ value?: Json | null;
1814
+ workflow_node_run_id?: string | null;
1815
+ };
1816
+ Relationships: [
1817
+ {
1818
+ foreignKeyName: 'extraction_results_entity_id_fkey';
1819
+ columns: ['entity_id'];
1820
+ isOneToOne: false;
1821
+ referencedRelation: 'entities';
1822
+ referencedColumns: ['id'];
1823
+ },
1824
+ {
1825
+ foreignKeyName: 'extraction_results_run_id_fkey';
1826
+ columns: ['run_id'];
1827
+ isOneToOne: false;
1828
+ referencedRelation: 'extraction_runs';
1829
+ referencedColumns: ['id'];
1830
+ },
1831
+ {
1832
+ foreignKeyName: 'extraction_results_tenant_id_fkey';
1833
+ columns: ['tenant_id'];
1834
+ isOneToOne: false;
1835
+ referencedRelation: 'tenants';
1836
+ referencedColumns: ['id'];
1837
+ },
1838
+ {
1839
+ foreignKeyName: 'extraction_results_workflow_node_run_id_fkey';
1840
+ columns: ['workflow_node_run_id'];
1841
+ isOneToOne: false;
1842
+ referencedRelation: 'workflow_node_runs';
1843
+ referencedColumns: ['id'];
1844
+ }
1845
+ ];
1846
+ };
1847
+ extraction_runs: {
1848
+ Row: {
1849
+ completed_at: string | null;
1850
+ created_at: string;
1851
+ duration_ms: number | null;
1852
+ entity_id: string;
1853
+ fields_requested: string[] | null;
1854
+ id: string;
1855
+ scope: string | null;
1856
+ started_at: string | null;
1857
+ status: string | null;
1858
+ tenant_id: string;
1859
+ triggered_by: string | null;
1860
+ };
1861
+ Insert: {
1862
+ completed_at?: string | null;
1863
+ created_at?: string;
1864
+ duration_ms?: number | null;
1865
+ entity_id: string;
1866
+ fields_requested?: string[] | null;
1867
+ id?: string;
1868
+ scope?: string | null;
1869
+ started_at?: string | null;
1870
+ status?: string | null;
1871
+ tenant_id: string;
1872
+ triggered_by?: string | null;
1873
+ };
1874
+ Update: {
1875
+ completed_at?: string | null;
1876
+ created_at?: string;
1877
+ duration_ms?: number | null;
1878
+ entity_id?: string;
1879
+ fields_requested?: string[] | null;
1880
+ id?: string;
1881
+ scope?: string | null;
1882
+ started_at?: string | null;
1883
+ status?: string | null;
1884
+ tenant_id?: string;
1885
+ triggered_by?: string | null;
1886
+ };
1887
+ Relationships: [
1888
+ {
1889
+ foreignKeyName: 'extraction_runs_entity_id_fkey';
1890
+ columns: ['entity_id'];
1891
+ isOneToOne: false;
1892
+ referencedRelation: 'entities';
1893
+ referencedColumns: ['id'];
1894
+ },
1895
+ {
1896
+ foreignKeyName: 'extraction_runs_tenant_id_fkey';
1897
+ columns: ['tenant_id'];
1898
+ isOneToOne: false;
1899
+ referencedRelation: 'tenants';
1900
+ referencedColumns: ['id'];
1901
+ }
1902
+ ];
1903
+ };
1904
+ inbound_email_addresses: {
1905
+ Row: {
1906
+ address_hash: string;
1907
+ created_at: string;
1908
+ email_address: string;
1909
+ id: string;
1910
+ tenant_id: string;
1911
+ user_id: string;
1912
+ };
1913
+ Insert: {
1914
+ address_hash: string;
1915
+ created_at?: string;
1916
+ email_address: string;
1917
+ id?: string;
1918
+ tenant_id: string;
1919
+ user_id: string;
1920
+ };
1921
+ Update: {
1922
+ address_hash?: string;
1923
+ created_at?: string;
1924
+ email_address?: string;
1925
+ id?: string;
1926
+ tenant_id?: string;
1927
+ user_id?: string;
1928
+ };
1929
+ Relationships: [
1930
+ {
1931
+ foreignKeyName: 'inbound_email_addresses_tenant_id_fkey';
1932
+ columns: ['tenant_id'];
1933
+ isOneToOne: false;
1934
+ referencedRelation: 'tenants';
1935
+ referencedColumns: ['id'];
1936
+ }
1937
+ ];
1938
+ };
1939
+ inbound_emails: {
1940
+ Row: {
1941
+ attachments: Json | null;
1942
+ created_at: string;
1943
+ from_address: string;
1944
+ from_name: string | null;
1945
+ headers: Json | null;
1946
+ html_body: string | null;
1947
+ id: string;
1948
+ processed_at: string | null;
1949
+ processing_result: Json | null;
1950
+ processing_status: string | null;
1951
+ raw_payload: Json | null;
1952
+ subject: string | null;
1953
+ tenant_id: string;
1954
+ text_body: string | null;
1955
+ to_address: string;
1956
+ user_id: string;
1957
+ };
1958
+ Insert: {
1959
+ attachments?: Json | null;
1960
+ created_at?: string;
1961
+ from_address: string;
1962
+ from_name?: string | null;
1963
+ headers?: Json | null;
1964
+ html_body?: string | null;
1965
+ id?: string;
1966
+ processed_at?: string | null;
1967
+ processing_result?: Json | null;
1968
+ processing_status?: string | null;
1969
+ raw_payload?: Json | null;
1970
+ subject?: string | null;
1971
+ tenant_id: string;
1972
+ text_body?: string | null;
1973
+ to_address: string;
1974
+ user_id: string;
1975
+ };
1976
+ Update: {
1977
+ attachments?: Json | null;
1978
+ created_at?: string;
1979
+ from_address?: string;
1980
+ from_name?: string | null;
1981
+ headers?: Json | null;
1982
+ html_body?: string | null;
1983
+ id?: string;
1984
+ processed_at?: string | null;
1985
+ processing_result?: Json | null;
1986
+ processing_status?: string | null;
1987
+ raw_payload?: Json | null;
1988
+ subject?: string | null;
1989
+ tenant_id?: string;
1990
+ text_body?: string | null;
1991
+ to_address?: string;
1992
+ user_id?: string;
1993
+ };
1994
+ Relationships: [
1995
+ {
1996
+ foreignKeyName: 'inbound_emails_tenant_id_fkey';
1997
+ columns: ['tenant_id'];
1998
+ isOneToOne: false;
1999
+ referencedRelation: 'tenants';
2000
+ referencedColumns: ['id'];
2001
+ }
2002
+ ];
2003
+ };
2004
+ inbound_webhook_endpoints: {
2005
+ Row: {
2006
+ created_at: string;
2007
+ created_by: string | null;
2008
+ enabled: boolean | null;
2009
+ entity_type_slug: string | null;
2010
+ field_mapping: Json;
2011
+ id: string;
2012
+ items_created: number | null;
2013
+ last_received_at: string | null;
2014
+ name: string;
2015
+ signature_header: string | null;
2016
+ signature_secret: string | null;
2017
+ tags: string[] | null;
2018
+ tenant_id: string;
2019
+ token: string;
2020
+ updated_at: string;
2021
+ };
2022
+ Insert: {
2023
+ created_at?: string;
2024
+ created_by?: string | null;
2025
+ enabled?: boolean | null;
2026
+ entity_type_slug?: string | null;
2027
+ field_mapping?: Json;
2028
+ id?: string;
2029
+ items_created?: number | null;
2030
+ last_received_at?: string | null;
2031
+ name: string;
2032
+ signature_header?: string | null;
2033
+ signature_secret?: string | null;
2034
+ tags?: string[] | null;
2035
+ tenant_id: string;
2036
+ token?: string;
2037
+ updated_at?: string;
2038
+ };
2039
+ Update: {
2040
+ created_at?: string;
2041
+ created_by?: string | null;
2042
+ enabled?: boolean | null;
2043
+ entity_type_slug?: string | null;
2044
+ field_mapping?: Json;
2045
+ id?: string;
2046
+ items_created?: number | null;
2047
+ last_received_at?: string | null;
2048
+ name?: string;
2049
+ signature_header?: string | null;
2050
+ signature_secret?: string | null;
2051
+ tags?: string[] | null;
2052
+ tenant_id?: string;
2053
+ token?: string;
2054
+ updated_at?: string;
2055
+ };
2056
+ Relationships: [
2057
+ {
2058
+ foreignKeyName: 'inbound_webhook_endpoints_tenant_id_fkey';
2059
+ columns: ['tenant_id'];
2060
+ isOneToOne: false;
2061
+ referencedRelation: 'tenants';
2062
+ referencedColumns: ['id'];
2063
+ }
2064
+ ];
2065
+ };
2066
+ messages: {
2067
+ Row: {
2068
+ chat_id: string;
2069
+ completion_id: string | null;
2070
+ content: string | null;
2071
+ created_at: string;
2072
+ id: string;
2073
+ metadata: Json | null;
2074
+ parts: Json | null;
2075
+ role: string | null;
2076
+ sender_id: string | null;
2077
+ sender_type: string | null;
2078
+ updated_at: string;
2079
+ };
2080
+ Insert: {
2081
+ chat_id: string;
2082
+ completion_id?: string | null;
2083
+ content?: string | null;
2084
+ created_at?: string;
2085
+ id?: string;
2086
+ metadata?: Json | null;
2087
+ parts?: Json | null;
2088
+ role?: string | null;
2089
+ sender_id?: string | null;
2090
+ sender_type?: string | null;
2091
+ updated_at?: string;
2092
+ };
2093
+ Update: {
2094
+ chat_id?: string;
2095
+ completion_id?: string | null;
2096
+ content?: string | null;
2097
+ created_at?: string;
2098
+ id?: string;
2099
+ metadata?: Json | null;
2100
+ parts?: Json | null;
2101
+ role?: string | null;
2102
+ sender_id?: string | null;
2103
+ sender_type?: string | null;
2104
+ updated_at?: string;
2105
+ };
2106
+ Relationships: [
2107
+ {
2108
+ foreignKeyName: 'messages_chat_id_chats_id_fk';
2109
+ columns: ['chat_id'];
2110
+ isOneToOne: false;
2111
+ referencedRelation: 'chats';
2112
+ referencedColumns: ['id'];
2113
+ }
2114
+ ];
2115
+ };
2116
+ nav_configs: {
2117
+ Row: {
2118
+ config: Json;
2119
+ created_at: string;
2120
+ id: string;
2121
+ tenant_id: string;
2122
+ updated_at: string;
2123
+ user_id: string | null;
2124
+ };
2125
+ Insert: {
2126
+ config?: Json;
2127
+ created_at?: string;
2128
+ id?: string;
2129
+ tenant_id: string;
2130
+ updated_at?: string;
2131
+ user_id?: string | null;
2132
+ };
2133
+ Update: {
2134
+ config?: Json;
2135
+ created_at?: string;
2136
+ id?: string;
2137
+ tenant_id?: string;
2138
+ updated_at?: string;
2139
+ user_id?: string | null;
2140
+ };
2141
+ Relationships: [
2142
+ {
2143
+ foreignKeyName: 'nav_configs_tenant_id_fkey';
2144
+ columns: ['tenant_id'];
2145
+ isOneToOne: false;
2146
+ referencedRelation: 'tenants';
2147
+ referencedColumns: ['id'];
2148
+ }
2149
+ ];
2150
+ };
2151
+ notifications: {
2152
+ Row: {
2153
+ body: string | null;
2154
+ created_at: string;
2155
+ data: Json | null;
2156
+ id: string;
2157
+ read_at: string | null;
2158
+ tenant_id: string;
2159
+ title: string;
2160
+ type: string;
2161
+ user_id: string;
2162
+ };
2163
+ Insert: {
2164
+ body?: string | null;
2165
+ created_at?: string;
2166
+ data?: Json | null;
2167
+ id?: string;
2168
+ read_at?: string | null;
2169
+ tenant_id: string;
2170
+ title: string;
2171
+ type?: string;
2172
+ user_id: string;
2173
+ };
2174
+ Update: {
2175
+ body?: string | null;
2176
+ created_at?: string;
2177
+ data?: Json | null;
2178
+ id?: string;
2179
+ read_at?: string | null;
2180
+ tenant_id?: string;
2181
+ title?: string;
2182
+ type?: string;
2183
+ user_id?: string;
2184
+ };
2185
+ Relationships: [
2186
+ {
2187
+ foreignKeyName: 'notifications_tenant_id_fkey';
2188
+ columns: ['tenant_id'];
2189
+ isOneToOne: false;
2190
+ referencedRelation: 'tenants';
2191
+ referencedColumns: ['id'];
2192
+ }
2193
+ ];
2194
+ };
2195
+ profiles: {
2196
+ Row: {
2197
+ active_tenant_id: string | null;
2198
+ created_at: string;
2199
+ display_name: string | null;
2200
+ email: string | null;
2201
+ first_name: string | null;
2202
+ id: string;
2203
+ industry_role: string | null;
2204
+ last_name: string | null;
2205
+ phone: string | null;
2206
+ photo_url: string | null;
2207
+ updated_at: string;
2208
+ };
2209
+ Insert: {
2210
+ active_tenant_id?: string | null;
2211
+ created_at?: string;
2212
+ display_name?: string | null;
2213
+ email?: string | null;
2214
+ first_name?: string | null;
2215
+ id: string;
2216
+ industry_role?: string | null;
2217
+ last_name?: string | null;
2218
+ phone?: string | null;
2219
+ photo_url?: string | null;
2220
+ updated_at?: string;
2221
+ };
2222
+ Update: {
2223
+ active_tenant_id?: string | null;
2224
+ created_at?: string;
2225
+ display_name?: string | null;
2226
+ email?: string | null;
2227
+ first_name?: string | null;
2228
+ id?: string;
2229
+ industry_role?: string | null;
2230
+ last_name?: string | null;
2231
+ phone?: string | null;
2232
+ photo_url?: string | null;
2233
+ updated_at?: string;
2234
+ };
2235
+ Relationships: [
2236
+ {
2237
+ foreignKeyName: 'profiles_active_tenant_id_tenants_id_fk';
2238
+ columns: ['active_tenant_id'];
2239
+ isOneToOne: false;
2240
+ referencedRelation: 'tenants';
2241
+ referencedColumns: ['id'];
2242
+ }
2243
+ ];
2244
+ };
2245
+ role_permissions: {
2246
+ Row: {
2247
+ created_at: string;
2248
+ id: string;
2249
+ permission: Database['public']['Enums']['app_permission'];
2250
+ role_id: string;
2251
+ };
2252
+ Insert: {
2253
+ created_at?: string;
2254
+ id?: string;
2255
+ permission: Database['public']['Enums']['app_permission'];
2256
+ role_id: string;
2257
+ };
2258
+ Update: {
2259
+ created_at?: string;
2260
+ id?: string;
2261
+ permission?: Database['public']['Enums']['app_permission'];
2262
+ role_id?: string;
2263
+ };
2264
+ Relationships: [
2265
+ {
2266
+ foreignKeyName: 'role_permissions_role_id_roles_id_fk';
2267
+ columns: ['role_id'];
2268
+ isOneToOne: false;
2269
+ referencedRelation: 'roles';
2270
+ referencedColumns: ['id'];
2271
+ }
2272
+ ];
2273
+ };
2274
+ roles: {
2275
+ Row: {
2276
+ created_at: string;
2277
+ id: string;
2278
+ is_global_role: boolean;
2279
+ name: string;
2280
+ slug: string;
2281
+ tenant_id: string | null;
2282
+ updated_at: string;
2283
+ };
2284
+ Insert: {
2285
+ created_at?: string;
2286
+ id?: string;
2287
+ is_global_role?: boolean;
2288
+ name: string;
2289
+ slug: string;
2290
+ tenant_id?: string | null;
2291
+ updated_at?: string;
2292
+ };
2293
+ Update: {
2294
+ created_at?: string;
2295
+ id?: string;
2296
+ is_global_role?: boolean;
2297
+ name?: string;
2298
+ slug?: string;
2299
+ tenant_id?: string | null;
2300
+ updated_at?: string;
2301
+ };
2302
+ Relationships: [
2303
+ {
2304
+ foreignKeyName: 'roles_tenant_id_tenants_id_fk';
2305
+ columns: ['tenant_id'];
2306
+ isOneToOne: false;
2307
+ referencedRelation: 'tenants';
2308
+ referencedColumns: ['id'];
2309
+ }
2310
+ ];
2311
+ };
2312
+ shared_context: {
2313
+ Row: {
2314
+ created_at: string;
2315
+ id: string;
2316
+ key: string;
2317
+ tenant_id: string;
2318
+ updated_at: string | null;
2319
+ updated_by: string | null;
2320
+ value: Json;
2321
+ writer_agent_id: string | null;
2322
+ };
2323
+ Insert: {
2324
+ created_at?: string;
2325
+ id?: string;
2326
+ key: string;
2327
+ tenant_id: string;
2328
+ updated_at?: string | null;
2329
+ updated_by?: string | null;
2330
+ value?: Json;
2331
+ writer_agent_id?: string | null;
2332
+ };
2333
+ Update: {
2334
+ created_at?: string;
2335
+ id?: string;
2336
+ key?: string;
2337
+ tenant_id?: string;
2338
+ updated_at?: string | null;
2339
+ updated_by?: string | null;
2340
+ value?: Json;
2341
+ writer_agent_id?: string | null;
2342
+ };
2343
+ Relationships: [
2344
+ {
2345
+ foreignKeyName: 'shared_context_tenant_id_fkey';
2346
+ columns: ['tenant_id'];
2347
+ isOneToOne: false;
2348
+ referencedRelation: 'tenants';
2349
+ referencedColumns: ['id'];
2350
+ },
2351
+ {
2352
+ foreignKeyName: 'shared_context_writer_agent_id_fkey';
2353
+ columns: ['writer_agent_id'];
2354
+ isOneToOne: false;
2355
+ referencedRelation: 'agents';
2356
+ referencedColumns: ['id'];
2357
+ }
2358
+ ];
2359
+ };
2360
+ skill_files: {
2361
+ Row: {
2362
+ created_at: string;
2363
+ file_name: string;
2364
+ file_path: string;
2365
+ file_size: number | null;
2366
+ id: string;
2367
+ mime_type: string | null;
2368
+ skill_id: string;
2369
+ };
2370
+ Insert: {
2371
+ created_at?: string;
2372
+ file_name: string;
2373
+ file_path: string;
2374
+ file_size?: number | null;
2375
+ id?: string;
2376
+ mime_type?: string | null;
2377
+ skill_id: string;
2378
+ };
2379
+ Update: {
2380
+ created_at?: string;
2381
+ file_name?: string;
2382
+ file_path?: string;
2383
+ file_size?: number | null;
2384
+ id?: string;
2385
+ mime_type?: string | null;
2386
+ skill_id?: string;
2387
+ };
2388
+ Relationships: [
2389
+ {
2390
+ foreignKeyName: 'skill_files_skill_id_fkey';
2391
+ columns: ['skill_id'];
2392
+ isOneToOne: false;
2393
+ referencedRelation: 'skills';
2394
+ referencedColumns: ['id'];
2395
+ }
2396
+ ];
2397
+ };
2398
+ skill_invocations: {
2399
+ Row: {
2400
+ agent_id: string | null;
2401
+ chat_id: string | null;
2402
+ created_at: string;
2403
+ duration_ms: number | null;
2404
+ id: string;
2405
+ skill_id: string;
2406
+ status: string | null;
2407
+ tenant_id: string;
2408
+ };
2409
+ Insert: {
2410
+ agent_id?: string | null;
2411
+ chat_id?: string | null;
2412
+ created_at?: string;
2413
+ duration_ms?: number | null;
2414
+ id?: string;
2415
+ skill_id: string;
2416
+ status?: string | null;
2417
+ tenant_id: string;
2418
+ };
2419
+ Update: {
2420
+ agent_id?: string | null;
2421
+ chat_id?: string | null;
2422
+ created_at?: string;
2423
+ duration_ms?: number | null;
2424
+ id?: string;
2425
+ skill_id?: string;
2426
+ status?: string | null;
2427
+ tenant_id?: string;
2428
+ };
2429
+ Relationships: [
2430
+ {
2431
+ foreignKeyName: 'skill_invocations_agent_id_fkey';
2432
+ columns: ['agent_id'];
2433
+ isOneToOne: false;
2434
+ referencedRelation: 'agents';
2435
+ referencedColumns: ['id'];
2436
+ },
2437
+ {
2438
+ foreignKeyName: 'skill_invocations_chat_id_fkey';
2439
+ columns: ['chat_id'];
2440
+ isOneToOne: false;
2441
+ referencedRelation: 'chats';
2442
+ referencedColumns: ['id'];
2443
+ },
2444
+ {
2445
+ foreignKeyName: 'skill_invocations_skill_id_fkey';
2446
+ columns: ['skill_id'];
2447
+ isOneToOne: false;
2448
+ referencedRelation: 'skills';
2449
+ referencedColumns: ['id'];
2450
+ },
2451
+ {
2452
+ foreignKeyName: 'skill_invocations_tenant_id_fkey';
2453
+ columns: ['tenant_id'];
2454
+ isOneToOne: false;
2455
+ referencedRelation: 'tenants';
2456
+ referencedColumns: ['id'];
2457
+ }
2458
+ ];
2459
+ };
2460
+ skills: {
2461
+ Row: {
2462
+ category: string | null;
2463
+ created_at: string | null;
2464
+ created_by: string | null;
2465
+ description: string | null;
2466
+ enabled: boolean | null;
2467
+ id: string;
2468
+ instructions: string | null;
2469
+ metadata: Json | null;
2470
+ name: string;
2471
+ slug: string;
2472
+ source: string | null;
2473
+ tenant_id: string | null;
2474
+ updated_at: string | null;
2475
+ user_invocable: boolean | null;
2476
+ };
2477
+ Insert: {
2478
+ category?: string | null;
2479
+ created_at?: string | null;
2480
+ created_by?: string | null;
2481
+ description?: string | null;
2482
+ enabled?: boolean | null;
2483
+ id?: string;
2484
+ instructions?: string | null;
2485
+ metadata?: Json | null;
2486
+ name: string;
2487
+ slug: string;
2488
+ source?: string | null;
2489
+ tenant_id?: string | null;
2490
+ updated_at?: string | null;
2491
+ user_invocable?: boolean | null;
2492
+ };
2493
+ Update: {
2494
+ category?: string | null;
2495
+ created_at?: string | null;
2496
+ created_by?: string | null;
2497
+ description?: string | null;
2498
+ enabled?: boolean | null;
2499
+ id?: string;
2500
+ instructions?: string | null;
2501
+ metadata?: Json | null;
2502
+ name?: string;
2503
+ slug?: string;
2504
+ source?: string | null;
2505
+ tenant_id?: string | null;
2506
+ updated_at?: string | null;
2507
+ user_invocable?: boolean | null;
2508
+ };
2509
+ Relationships: [
2510
+ {
2511
+ foreignKeyName: 'skills_tenant_id_fkey';
2512
+ columns: ['tenant_id'];
2513
+ isOneToOne: false;
2514
+ referencedRelation: 'tenants';
2515
+ referencedColumns: ['id'];
2516
+ }
2517
+ ];
2518
+ };
2519
+ source_syncs: {
2520
+ Row: {
2521
+ config: Json;
2522
+ created_at: string;
2523
+ id: string;
2524
+ last_synced_at: string | null;
2525
+ name: string;
2526
+ status: string | null;
2527
+ tenant_id: string;
2528
+ type: string;
2529
+ updated_at: string;
2530
+ };
2531
+ Insert: {
2532
+ config?: Json;
2533
+ created_at?: string;
2534
+ id?: string;
2535
+ last_synced_at?: string | null;
2536
+ name: string;
2537
+ status?: string | null;
2538
+ tenant_id: string;
2539
+ type: string;
2540
+ updated_at?: string;
2541
+ };
2542
+ Update: {
2543
+ config?: Json;
2544
+ created_at?: string;
2545
+ id?: string;
2546
+ last_synced_at?: string | null;
2547
+ name?: string;
2548
+ status?: string | null;
2549
+ tenant_id?: string;
2550
+ type?: string;
2551
+ updated_at?: string;
2552
+ };
2553
+ Relationships: [
2554
+ {
2555
+ foreignKeyName: 'source_syncs_tenant_id_fkey';
2556
+ columns: ['tenant_id'];
2557
+ isOneToOne: false;
2558
+ referencedRelation: 'tenants';
2559
+ referencedColumns: ['id'];
2560
+ }
2561
+ ];
2562
+ };
2563
+ tasks: {
2564
+ Row: {
2565
+ assignee_id: string | null;
2566
+ assignee_type: string | null;
2567
+ completed_at: string | null;
2568
+ created_at: string;
2569
+ created_by: string | null;
2570
+ description: string | null;
2571
+ due_at: string | null;
2572
+ entity_id: string | null;
2573
+ id: string;
2574
+ input: Json | null;
2575
+ metadata: Json | null;
2576
+ output: Json | null;
2577
+ parent_task_id: string | null;
2578
+ priority: string;
2579
+ status: string;
2580
+ tags: string[] | null;
2581
+ tenant_id: string;
2582
+ title: string;
2583
+ ui_intent: Json | null;
2584
+ updated_at: string;
2585
+ workflow_node_id: string | null;
2586
+ workflow_run_id: string | null;
2587
+ };
2588
+ Insert: {
2589
+ assignee_id?: string | null;
2590
+ assignee_type?: string | null;
2591
+ completed_at?: string | null;
2592
+ created_at?: string;
2593
+ created_by?: string | null;
2594
+ description?: string | null;
2595
+ due_at?: string | null;
2596
+ entity_id?: string | null;
2597
+ id?: string;
2598
+ input?: Json | null;
2599
+ metadata?: Json | null;
2600
+ output?: Json | null;
2601
+ parent_task_id?: string | null;
2602
+ priority?: string;
2603
+ status?: string;
2604
+ tags?: string[] | null;
2605
+ tenant_id: string;
2606
+ title: string;
2607
+ ui_intent?: Json | null;
2608
+ updated_at?: string;
2609
+ workflow_node_id?: string | null;
2610
+ workflow_run_id?: string | null;
2611
+ };
2612
+ Update: {
2613
+ assignee_id?: string | null;
2614
+ assignee_type?: string | null;
2615
+ completed_at?: string | null;
2616
+ created_at?: string;
2617
+ created_by?: string | null;
2618
+ description?: string | null;
2619
+ due_at?: string | null;
2620
+ entity_id?: string | null;
2621
+ id?: string;
2622
+ input?: Json | null;
2623
+ metadata?: Json | null;
2624
+ output?: Json | null;
2625
+ parent_task_id?: string | null;
2626
+ priority?: string;
2627
+ status?: string;
2628
+ tags?: string[] | null;
2629
+ tenant_id?: string;
2630
+ title?: string;
2631
+ ui_intent?: Json | null;
2632
+ updated_at?: string;
2633
+ workflow_node_id?: string | null;
2634
+ workflow_run_id?: string | null;
2635
+ };
2636
+ Relationships: [
2637
+ {
2638
+ foreignKeyName: 'tasks_entity_id_fkey';
2639
+ columns: ['entity_id'];
2640
+ isOneToOne: false;
2641
+ referencedRelation: 'entities';
2642
+ referencedColumns: ['id'];
2643
+ },
2644
+ {
2645
+ foreignKeyName: 'tasks_parent_task_id_fkey';
2646
+ columns: ['parent_task_id'];
2647
+ isOneToOne: false;
2648
+ referencedRelation: 'tasks';
2649
+ referencedColumns: ['id'];
2650
+ },
2651
+ {
2652
+ foreignKeyName: 'tasks_tenant_id_fkey';
2653
+ columns: ['tenant_id'];
2654
+ isOneToOne: false;
2655
+ referencedRelation: 'tenants';
2656
+ referencedColumns: ['id'];
2657
+ },
2658
+ {
2659
+ foreignKeyName: 'tasks_workflow_run_id_fkey';
2660
+ columns: ['workflow_run_id'];
2661
+ isOneToOne: false;
2662
+ referencedRelation: 'workflow_runs';
2663
+ referencedColumns: ['id'];
2664
+ }
2665
+ ];
2666
+ };
2667
+ tenant_entity_type_settings: {
2668
+ Row: {
2669
+ created_at: string;
2670
+ enabled: boolean;
2671
+ entity_type_id: string;
2672
+ forked_from_version: number | null;
2673
+ id: string;
2674
+ notes: string | null;
2675
+ tenant_id: string;
2676
+ updated_at: string;
2677
+ };
2678
+ Insert: {
2679
+ created_at?: string;
2680
+ enabled?: boolean;
2681
+ entity_type_id: string;
2682
+ forked_from_version?: number | null;
2683
+ id?: string;
2684
+ notes?: string | null;
2685
+ tenant_id: string;
2686
+ updated_at?: string;
2687
+ };
2688
+ Update: {
2689
+ created_at?: string;
2690
+ enabled?: boolean;
2691
+ entity_type_id?: string;
2692
+ forked_from_version?: number | null;
2693
+ id?: string;
2694
+ notes?: string | null;
2695
+ tenant_id?: string;
2696
+ updated_at?: string;
2697
+ };
2698
+ Relationships: [
2699
+ {
2700
+ foreignKeyName: 'tenant_entity_type_settings_entity_type_id_fkey';
2701
+ columns: ['entity_type_id'];
2702
+ isOneToOne: false;
2703
+ referencedRelation: 'entity_types';
2704
+ referencedColumns: ['id'];
2705
+ },
2706
+ {
2707
+ foreignKeyName: 'tenant_entity_type_settings_tenant_id_fkey';
2708
+ columns: ['tenant_id'];
2709
+ isOneToOne: false;
2710
+ referencedRelation: 'tenants';
2711
+ referencedColumns: ['id'];
2712
+ }
2713
+ ];
2714
+ };
2715
+ tenant_settings: {
2716
+ Row: {
2717
+ created_at: string;
2718
+ id: string;
2719
+ key: string;
2720
+ tenant_id: string;
2721
+ updated_at: string;
2722
+ user_id: string | null;
2723
+ value: Json;
2724
+ };
2725
+ Insert: {
2726
+ created_at?: string;
2727
+ id?: string;
2728
+ key: string;
2729
+ tenant_id: string;
2730
+ updated_at?: string;
2731
+ user_id?: string | null;
2732
+ value?: Json;
2733
+ };
2734
+ Update: {
2735
+ created_at?: string;
2736
+ id?: string;
2737
+ key?: string;
2738
+ tenant_id?: string;
2739
+ updated_at?: string;
2740
+ user_id?: string | null;
2741
+ value?: Json;
2742
+ };
2743
+ Relationships: [
2744
+ {
2745
+ foreignKeyName: 'tenant_settings_tenant_id_fkey';
2746
+ columns: ['tenant_id'];
2747
+ isOneToOne: false;
2748
+ referencedRelation: 'tenants';
2749
+ referencedColumns: ['id'];
2750
+ }
2751
+ ];
2752
+ };
2753
+ tenants: {
2754
+ Row: {
2755
+ created_at: string;
2756
+ id: string;
2757
+ logo_url: string | null;
2758
+ name: string | null;
2759
+ slug: string;
2760
+ tenant_type: string;
2761
+ theme: Json | null;
2762
+ updated_at: string;
2763
+ };
2764
+ Insert: {
2765
+ created_at?: string;
2766
+ id: string;
2767
+ logo_url?: string | null;
2768
+ name?: string | null;
2769
+ slug: string;
2770
+ tenant_type: string;
2771
+ theme?: Json | null;
2772
+ updated_at?: string;
2773
+ };
2774
+ Update: {
2775
+ created_at?: string;
2776
+ id?: string;
2777
+ logo_url?: string | null;
2778
+ name?: string | null;
2779
+ slug?: string;
2780
+ tenant_type?: string;
2781
+ theme?: Json | null;
2782
+ updated_at?: string;
2783
+ };
2784
+ Relationships: [];
2785
+ };
2786
+ tool_invocations: {
2787
+ Row: {
2788
+ args: Json | null;
2789
+ completion_id: string | null;
2790
+ created_at: string;
2791
+ id: string;
2792
+ message_id: string | null;
2793
+ metadata: Json | null;
2794
+ result: Json | null;
2795
+ state: Json | null;
2796
+ status: string | null;
2797
+ tenant_id: string;
2798
+ tool_call_id: string | null;
2799
+ tool_id: string | null;
2800
+ tool_name: string | null;
2801
+ updated_at: string;
2802
+ user_id: string | null;
2803
+ };
2804
+ Insert: {
2805
+ args?: Json | null;
2806
+ completion_id?: string | null;
2807
+ created_at?: string;
2808
+ id?: string;
2809
+ message_id?: string | null;
2810
+ metadata?: Json | null;
2811
+ result?: Json | null;
2812
+ state?: Json | null;
2813
+ status?: string | null;
2814
+ tenant_id: string;
2815
+ tool_call_id?: string | null;
2816
+ tool_id?: string | null;
2817
+ tool_name?: string | null;
2818
+ updated_at?: string;
2819
+ user_id?: string | null;
2820
+ };
2821
+ Update: {
2822
+ args?: Json | null;
2823
+ completion_id?: string | null;
2824
+ created_at?: string;
2825
+ id?: string;
2826
+ message_id?: string | null;
2827
+ metadata?: Json | null;
2828
+ result?: Json | null;
2829
+ state?: Json | null;
2830
+ status?: string | null;
2831
+ tenant_id?: string;
2832
+ tool_call_id?: string | null;
2833
+ tool_id?: string | null;
2834
+ tool_name?: string | null;
2835
+ updated_at?: string;
2836
+ user_id?: string | null;
2837
+ };
2838
+ Relationships: [
2839
+ {
2840
+ foreignKeyName: 'tool_invocations_message_id_fkey';
2841
+ columns: ['message_id'];
2842
+ isOneToOne: false;
2843
+ referencedRelation: 'messages';
2844
+ referencedColumns: ['id'];
2845
+ },
2846
+ {
2847
+ foreignKeyName: 'tool_invocations_tenant_id_fkey';
2848
+ columns: ['tenant_id'];
2849
+ isOneToOne: false;
2850
+ referencedRelation: 'tenants';
2851
+ referencedColumns: ['id'];
2852
+ },
2853
+ {
2854
+ foreignKeyName: 'tool_invocations_tool_id_fkey';
2855
+ columns: ['tool_id'];
2856
+ isOneToOne: false;
2857
+ referencedRelation: 'tools';
2858
+ referencedColumns: ['id'];
2859
+ }
2860
+ ];
2861
+ };
2862
+ tool_runs: {
2863
+ Row: {
2864
+ chat_id: string | null;
2865
+ created_at: string;
2866
+ duration_ms: number;
2867
+ error: string | null;
2868
+ id: string;
2869
+ input: Json;
2870
+ output: Json | null;
2871
+ session_id: string | null;
2872
+ source: string;
2873
+ status: string;
2874
+ tenant_id: string;
2875
+ tool_slug: string;
2876
+ user_id: string | null;
2877
+ };
2878
+ Insert: {
2879
+ chat_id?: string | null;
2880
+ created_at?: string;
2881
+ duration_ms?: number;
2882
+ error?: string | null;
2883
+ id?: string;
2884
+ input?: Json;
2885
+ output?: Json | null;
2886
+ session_id?: string | null;
2887
+ source?: string;
2888
+ status?: string;
2889
+ tenant_id?: string;
2890
+ tool_slug: string;
2891
+ user_id?: string | null;
2892
+ };
2893
+ Update: {
2894
+ chat_id?: string | null;
2895
+ created_at?: string;
2896
+ duration_ms?: number;
2897
+ error?: string | null;
2898
+ id?: string;
2899
+ input?: Json;
2900
+ output?: Json | null;
2901
+ session_id?: string | null;
2902
+ source?: string;
2903
+ status?: string;
2904
+ tenant_id?: string;
2905
+ tool_slug?: string;
2906
+ user_id?: string | null;
2907
+ };
2908
+ Relationships: [
2909
+ {
2910
+ foreignKeyName: 'tool_runs_chat_id_fkey';
2911
+ columns: ['chat_id'];
2912
+ isOneToOne: false;
2913
+ referencedRelation: 'chats';
2914
+ referencedColumns: ['id'];
2915
+ },
2916
+ {
2917
+ foreignKeyName: 'tool_runs_session_id_fkey';
2918
+ columns: ['session_id'];
2919
+ isOneToOne: false;
2920
+ referencedRelation: 'tool_sessions';
2921
+ referencedColumns: ['id'];
2922
+ },
2923
+ {
2924
+ foreignKeyName: 'tool_runs_tenant_id_fkey';
2925
+ columns: ['tenant_id'];
2926
+ isOneToOne: false;
2927
+ referencedRelation: 'tenants';
2928
+ referencedColumns: ['id'];
2929
+ }
2930
+ ];
2931
+ };
2932
+ tool_sessions: {
2933
+ Row: {
2934
+ completed_at: string | null;
2935
+ config: Json | null;
2936
+ created_at: string;
2937
+ created_by: string | null;
2938
+ entity_ids: string[] | null;
2939
+ id: string;
2940
+ share_token: string | null;
2941
+ status: string;
2942
+ tenant_id: string;
2943
+ title: string | null;
2944
+ tool_slug: string;
2945
+ };
2946
+ Insert: {
2947
+ completed_at?: string | null;
2948
+ config?: Json | null;
2949
+ created_at?: string;
2950
+ created_by?: string | null;
2951
+ entity_ids?: string[] | null;
2952
+ id?: string;
2953
+ share_token?: string | null;
2954
+ status?: string;
2955
+ tenant_id: string;
2956
+ title?: string | null;
2957
+ tool_slug: string;
2958
+ };
2959
+ Update: {
2960
+ completed_at?: string | null;
2961
+ config?: Json | null;
2962
+ created_at?: string;
2963
+ created_by?: string | null;
2964
+ entity_ids?: string[] | null;
2965
+ id?: string;
2966
+ share_token?: string | null;
2967
+ status?: string;
2968
+ tenant_id?: string;
2969
+ title?: string | null;
2970
+ tool_slug?: string;
2971
+ };
2972
+ Relationships: [
2973
+ {
2974
+ foreignKeyName: 'tool_sessions_tenant_id_fkey';
2975
+ columns: ['tenant_id'];
2976
+ isOneToOne: false;
2977
+ referencedRelation: 'tenants';
2978
+ referencedColumns: ['id'];
2979
+ }
2980
+ ];
2981
+ };
2982
+ tools: {
2983
+ Row: {
2984
+ category: string | null;
2985
+ created_at: string;
2986
+ description: string | null;
2987
+ enabled: boolean | null;
2988
+ execute_code: string | null;
2989
+ icon: string | null;
2990
+ id: string;
2991
+ name: string;
2992
+ schema: Json | null;
2993
+ slug: string;
2994
+ source: string | null;
2995
+ tenant_id: string;
2996
+ type: string | null;
2997
+ updated_at: string;
2998
+ };
2999
+ Insert: {
3000
+ category?: string | null;
3001
+ created_at?: string;
3002
+ description?: string | null;
3003
+ enabled?: boolean | null;
3004
+ execute_code?: string | null;
3005
+ icon?: string | null;
3006
+ id?: string;
3007
+ name: string;
3008
+ schema?: Json | null;
3009
+ slug: string;
3010
+ source?: string | null;
3011
+ tenant_id: string;
3012
+ type?: string | null;
3013
+ updated_at?: string;
3014
+ };
3015
+ Update: {
3016
+ category?: string | null;
3017
+ created_at?: string;
3018
+ description?: string | null;
3019
+ enabled?: boolean | null;
3020
+ execute_code?: string | null;
3021
+ icon?: string | null;
3022
+ id?: string;
3023
+ name?: string;
3024
+ schema?: Json | null;
3025
+ slug?: string;
3026
+ source?: string | null;
3027
+ tenant_id?: string;
3028
+ type?: string | null;
3029
+ updated_at?: string;
3030
+ };
3031
+ Relationships: [
3032
+ {
3033
+ foreignKeyName: 'tools_tenant_id_fkey';
3034
+ columns: ['tenant_id'];
3035
+ isOneToOne: false;
3036
+ referencedRelation: 'tenants';
3037
+ referencedColumns: ['id'];
3038
+ }
3039
+ ];
3040
+ };
3041
+ user_favorites: {
3042
+ Row: {
3043
+ created_at: string;
3044
+ entity_id: string;
3045
+ id: string;
3046
+ tenant_id: string;
3047
+ user_id: string;
3048
+ };
3049
+ Insert: {
3050
+ created_at?: string;
3051
+ entity_id: string;
3052
+ id?: string;
3053
+ tenant_id: string;
3054
+ user_id: string;
3055
+ };
3056
+ Update: {
3057
+ created_at?: string;
3058
+ entity_id?: string;
3059
+ id?: string;
3060
+ tenant_id?: string;
3061
+ user_id?: string;
3062
+ };
3063
+ Relationships: [
3064
+ {
3065
+ foreignKeyName: 'user_favorites_entity_id_fkey';
3066
+ columns: ['entity_id'];
3067
+ isOneToOne: false;
3068
+ referencedRelation: 'entities';
3069
+ referencedColumns: ['id'];
3070
+ },
3071
+ {
3072
+ foreignKeyName: 'user_favorites_tenant_id_fkey';
3073
+ columns: ['tenant_id'];
3074
+ isOneToOne: false;
3075
+ referencedRelation: 'tenants';
3076
+ referencedColumns: ['id'];
3077
+ }
3078
+ ];
3079
+ };
3080
+ user_memories: {
3081
+ Row: {
3082
+ content: string;
3083
+ created_at: string;
3084
+ id: string;
3085
+ source: string;
3086
+ updated_at: string;
3087
+ user_id: string;
3088
+ };
3089
+ Insert: {
3090
+ content: string;
3091
+ created_at?: string;
3092
+ id?: string;
3093
+ source?: string;
3094
+ updated_at?: string;
3095
+ user_id: string;
3096
+ };
3097
+ Update: {
3098
+ content?: string;
3099
+ created_at?: string;
3100
+ id?: string;
3101
+ source?: string;
3102
+ updated_at?: string;
3103
+ user_id?: string;
3104
+ };
3105
+ Relationships: [];
3106
+ };
3107
+ user_nav_configs: {
3108
+ Row: {
3109
+ config: Json;
3110
+ created_at: string;
3111
+ id: string;
3112
+ tenant_id: string;
3113
+ updated_at: string;
3114
+ user_id: string;
3115
+ };
3116
+ Insert: {
3117
+ config?: Json;
3118
+ created_at?: string;
3119
+ id?: string;
3120
+ tenant_id: string;
3121
+ updated_at?: string;
3122
+ user_id: string;
3123
+ };
3124
+ Update: {
3125
+ config?: Json;
3126
+ created_at?: string;
3127
+ id?: string;
3128
+ tenant_id?: string;
3129
+ updated_at?: string;
3130
+ user_id?: string;
3131
+ };
3132
+ Relationships: [
3133
+ {
3134
+ foreignKeyName: 'user_nav_configs_tenant_id_fkey';
3135
+ columns: ['tenant_id'];
3136
+ isOneToOne: false;
3137
+ referencedRelation: 'tenants';
3138
+ referencedColumns: ['id'];
3139
+ }
3140
+ ];
3141
+ };
3142
+ user_permissions: {
3143
+ Row: {
3144
+ created_at: string;
3145
+ is_global_role: boolean;
3146
+ permission: Database['public']['Enums']['app_permission'];
3147
+ role_id: string | null;
3148
+ role_name: string | null;
3149
+ role_slug: string | null;
3150
+ tenant_id: string;
3151
+ user_id: string;
3152
+ };
3153
+ Insert: {
3154
+ created_at?: string;
3155
+ is_global_role?: boolean;
3156
+ permission: Database['public']['Enums']['app_permission'];
3157
+ role_id?: string | null;
3158
+ role_name?: string | null;
3159
+ role_slug?: string | null;
3160
+ tenant_id: string;
3161
+ user_id: string;
3162
+ };
3163
+ Update: {
3164
+ created_at?: string;
3165
+ is_global_role?: boolean;
3166
+ permission?: Database['public']['Enums']['app_permission'];
3167
+ role_id?: string | null;
3168
+ role_name?: string | null;
3169
+ role_slug?: string | null;
3170
+ tenant_id?: string;
3171
+ user_id?: string;
3172
+ };
3173
+ Relationships: [
3174
+ {
3175
+ foreignKeyName: 'user_permissions_role_id_fkey';
3176
+ columns: ['role_id'];
3177
+ isOneToOne: false;
3178
+ referencedRelation: 'roles';
3179
+ referencedColumns: ['id'];
3180
+ },
3181
+ {
3182
+ foreignKeyName: 'user_permissions_tenant_id_fkey';
3183
+ columns: ['tenant_id'];
3184
+ isOneToOne: false;
3185
+ referencedRelation: 'tenants';
3186
+ referencedColumns: ['id'];
3187
+ },
3188
+ {
3189
+ foreignKeyName: 'user_permissions_user_id_fkey';
3190
+ columns: ['user_id'];
3191
+ isOneToOne: false;
3192
+ referencedRelation: 'profiles';
3193
+ referencedColumns: ['id'];
3194
+ }
3195
+ ];
3196
+ };
3197
+ user_recent_views: {
3198
+ Row: {
3199
+ entity_id: string;
3200
+ id: string;
3201
+ tenant_id: string;
3202
+ user_id: string;
3203
+ viewed_at: string;
3204
+ };
3205
+ Insert: {
3206
+ entity_id: string;
3207
+ id?: string;
3208
+ tenant_id: string;
3209
+ user_id: string;
3210
+ viewed_at?: string;
3211
+ };
3212
+ Update: {
3213
+ entity_id?: string;
3214
+ id?: string;
3215
+ tenant_id?: string;
3216
+ user_id?: string;
3217
+ viewed_at?: string;
3218
+ };
3219
+ Relationships: [
3220
+ {
3221
+ foreignKeyName: 'user_recent_views_entity_id_fkey';
3222
+ columns: ['entity_id'];
3223
+ isOneToOne: false;
3224
+ referencedRelation: 'entities';
3225
+ referencedColumns: ['id'];
3226
+ },
3227
+ {
3228
+ foreignKeyName: 'user_recent_views_tenant_id_fkey';
3229
+ columns: ['tenant_id'];
3230
+ isOneToOne: false;
3231
+ referencedRelation: 'tenants';
3232
+ referencedColumns: ['id'];
3233
+ }
3234
+ ];
3235
+ };
3236
+ user_tenants: {
3237
+ Row: {
3238
+ created_at: string;
3239
+ id: string;
3240
+ role_id: string;
3241
+ tenant_id: string;
3242
+ user_id: string;
3243
+ };
3244
+ Insert: {
3245
+ created_at?: string;
3246
+ id?: string;
3247
+ role_id: string;
3248
+ tenant_id: string;
3249
+ user_id: string;
3250
+ };
3251
+ Update: {
3252
+ created_at?: string;
3253
+ id?: string;
3254
+ role_id?: string;
3255
+ tenant_id?: string;
3256
+ user_id?: string;
3257
+ };
3258
+ Relationships: [
3259
+ {
3260
+ foreignKeyName: 'user_tenants_role_id_roles_id_fk';
3261
+ columns: ['role_id'];
3262
+ isOneToOne: false;
3263
+ referencedRelation: 'roles';
3264
+ referencedColumns: ['id'];
3265
+ },
3266
+ {
3267
+ foreignKeyName: 'user_tenants_tenant_id_tenants_id_fk';
3268
+ columns: ['tenant_id'];
3269
+ isOneToOne: false;
3270
+ referencedRelation: 'tenants';
3271
+ referencedColumns: ['id'];
3272
+ },
3273
+ {
3274
+ foreignKeyName: 'user_tenants_user_id_fkey';
3275
+ columns: ['user_id'];
3276
+ isOneToOne: false;
3277
+ referencedRelation: 'profiles';
3278
+ referencedColumns: ['id'];
3279
+ }
3280
+ ];
3281
+ };
3282
+ views: {
3283
+ Row: {
3284
+ config: Json | null;
3285
+ created_at: string;
3286
+ created_by: string | null;
3287
+ description: string | null;
3288
+ entity_type_slug: string | null;
3289
+ id: string;
3290
+ is_default: boolean | null;
3291
+ layout: string;
3292
+ name: string;
3293
+ slug: string;
3294
+ tenant_id: string;
3295
+ updated_at: string;
3296
+ };
3297
+ Insert: {
3298
+ config?: Json | null;
3299
+ created_at?: string;
3300
+ created_by?: string | null;
3301
+ description?: string | null;
3302
+ entity_type_slug?: string | null;
3303
+ id?: string;
3304
+ is_default?: boolean | null;
3305
+ layout?: string;
3306
+ name: string;
3307
+ slug: string;
3308
+ tenant_id: string;
3309
+ updated_at?: string;
3310
+ };
3311
+ Update: {
3312
+ config?: Json | null;
3313
+ created_at?: string;
3314
+ created_by?: string | null;
3315
+ description?: string | null;
3316
+ entity_type_slug?: string | null;
3317
+ id?: string;
3318
+ is_default?: boolean | null;
3319
+ layout?: string;
3320
+ name?: string;
3321
+ slug?: string;
3322
+ tenant_id?: string;
3323
+ updated_at?: string;
3324
+ };
3325
+ Relationships: [
3326
+ {
3327
+ foreignKeyName: 'views_tenant_id_fkey';
3328
+ columns: ['tenant_id'];
3329
+ isOneToOne: false;
3330
+ referencedRelation: 'tenants';
3331
+ referencedColumns: ['id'];
3332
+ }
3333
+ ];
3334
+ };
3335
+ webhooks: {
3336
+ Row: {
3337
+ active: boolean | null;
3338
+ created_at: string | null;
3339
+ created_by: string | null;
3340
+ events: string[];
3341
+ failure_count: number | null;
3342
+ headers: Json | null;
3343
+ id: string;
3344
+ last_triggered_at: string | null;
3345
+ metadata: Json | null;
3346
+ name: string;
3347
+ secret: string;
3348
+ tenant_id: string;
3349
+ updated_at: string | null;
3350
+ url: string;
3351
+ };
3352
+ Insert: {
3353
+ active?: boolean | null;
3354
+ created_at?: string | null;
3355
+ created_by?: string | null;
3356
+ events?: string[];
3357
+ failure_count?: number | null;
3358
+ headers?: Json | null;
3359
+ id?: string;
3360
+ last_triggered_at?: string | null;
3361
+ metadata?: Json | null;
3362
+ name?: string;
3363
+ secret: string;
3364
+ tenant_id: string;
3365
+ updated_at?: string | null;
3366
+ url: string;
3367
+ };
3368
+ Update: {
3369
+ active?: boolean | null;
3370
+ created_at?: string | null;
3371
+ created_by?: string | null;
3372
+ events?: string[];
3373
+ failure_count?: number | null;
3374
+ headers?: Json | null;
3375
+ id?: string;
3376
+ last_triggered_at?: string | null;
3377
+ metadata?: Json | null;
3378
+ name?: string;
3379
+ secret?: string;
3380
+ tenant_id?: string;
3381
+ updated_at?: string | null;
3382
+ url?: string;
3383
+ };
3384
+ Relationships: [
3385
+ {
3386
+ foreignKeyName: 'webhook_endpoints_tenant_id_fkey';
3387
+ columns: ['tenant_id'];
3388
+ isOneToOne: false;
3389
+ referencedRelation: 'tenants';
3390
+ referencedColumns: ['id'];
3391
+ }
3392
+ ];
3393
+ };
3394
+ workflow_node_runs: {
3395
+ Row: {
3396
+ assignee_agent_slug: string | null;
3397
+ assignee_type: string | null;
3398
+ attempt_count: number;
3399
+ block_id: string | null;
3400
+ claimed_at: string | null;
3401
+ claimed_by: string | null;
3402
+ completed_at: string | null;
3403
+ created_at: string;
3404
+ depends_on: string[];
3405
+ duration_ms: number | null;
3406
+ entity_id: string;
3407
+ error_message: string | null;
3408
+ field_name: string | null;
3409
+ id: string;
3410
+ instructions: string | null;
3411
+ label: string;
3412
+ metadata: Json;
3413
+ node_key: string;
3414
+ node_type: string;
3415
+ output_type: string;
3416
+ started_at: string | null;
3417
+ status: string;
3418
+ tenant_id: string;
3419
+ workflow_run_id: string;
3420
+ };
3421
+ Insert: {
3422
+ assignee_agent_slug?: string | null;
3423
+ assignee_type?: string | null;
3424
+ attempt_count?: number;
3425
+ block_id?: string | null;
3426
+ claimed_at?: string | null;
3427
+ claimed_by?: string | null;
3428
+ completed_at?: string | null;
3429
+ created_at?: string;
3430
+ depends_on?: string[];
3431
+ duration_ms?: number | null;
3432
+ entity_id: string;
3433
+ error_message?: string | null;
3434
+ field_name?: string | null;
3435
+ id?: string;
3436
+ instructions?: string | null;
3437
+ label: string;
3438
+ metadata?: Json;
3439
+ node_key: string;
3440
+ node_type: string;
3441
+ output_type?: string;
3442
+ started_at?: string | null;
3443
+ status?: string;
3444
+ tenant_id: string;
3445
+ workflow_run_id: string;
3446
+ };
3447
+ Update: {
3448
+ assignee_agent_slug?: string | null;
3449
+ assignee_type?: string | null;
3450
+ attempt_count?: number;
3451
+ block_id?: string | null;
3452
+ claimed_at?: string | null;
3453
+ claimed_by?: string | null;
3454
+ completed_at?: string | null;
3455
+ created_at?: string;
3456
+ depends_on?: string[];
3457
+ duration_ms?: number | null;
3458
+ entity_id?: string;
3459
+ error_message?: string | null;
3460
+ field_name?: string | null;
3461
+ id?: string;
3462
+ instructions?: string | null;
3463
+ label?: string;
3464
+ metadata?: Json;
3465
+ node_key?: string;
3466
+ node_type?: string;
3467
+ output_type?: string;
3468
+ started_at?: string | null;
3469
+ status?: string;
3470
+ tenant_id?: string;
3471
+ workflow_run_id?: string;
3472
+ };
3473
+ Relationships: [
3474
+ {
3475
+ foreignKeyName: 'workflow_node_runs_entity_id_fkey';
3476
+ columns: ['entity_id'];
3477
+ isOneToOne: false;
3478
+ referencedRelation: 'entities';
3479
+ referencedColumns: ['id'];
3480
+ },
3481
+ {
3482
+ foreignKeyName: 'workflow_node_runs_tenant_id_fkey';
3483
+ columns: ['tenant_id'];
3484
+ isOneToOne: false;
3485
+ referencedRelation: 'tenants';
3486
+ referencedColumns: ['id'];
3487
+ },
3488
+ {
3489
+ foreignKeyName: 'workflow_node_runs_workflow_run_id_fkey';
3490
+ columns: ['workflow_run_id'];
3491
+ isOneToOne: false;
3492
+ referencedRelation: 'workflow_runs';
3493
+ referencedColumns: ['id'];
3494
+ }
3495
+ ];
3496
+ };
3497
+ workflow_runs: {
3498
+ Row: {
3499
+ completed_at: string | null;
3500
+ created_at: string;
3501
+ duration_ms: number | null;
3502
+ entity_id: string;
3503
+ id: string;
3504
+ metadata: Json;
3505
+ started_at: string;
3506
+ status: string;
3507
+ tenant_id: string;
3508
+ trigger_type: string;
3509
+ };
3510
+ Insert: {
3511
+ completed_at?: string | null;
3512
+ created_at?: string;
3513
+ duration_ms?: number | null;
3514
+ entity_id: string;
3515
+ id?: string;
3516
+ metadata?: Json;
3517
+ started_at?: string;
3518
+ status?: string;
3519
+ tenant_id: string;
3520
+ trigger_type?: string;
3521
+ };
3522
+ Update: {
3523
+ completed_at?: string | null;
3524
+ created_at?: string;
3525
+ duration_ms?: number | null;
3526
+ entity_id?: string;
3527
+ id?: string;
3528
+ metadata?: Json;
3529
+ started_at?: string;
3530
+ status?: string;
3531
+ tenant_id?: string;
3532
+ trigger_type?: string;
3533
+ };
3534
+ Relationships: [
3535
+ {
3536
+ foreignKeyName: 'workflow_runs_entity_id_fkey';
3537
+ columns: ['entity_id'];
3538
+ isOneToOne: false;
3539
+ referencedRelation: 'entities';
3540
+ referencedColumns: ['id'];
3541
+ },
3542
+ {
3543
+ foreignKeyName: 'workflow_runs_tenant_id_fkey';
3544
+ columns: ['tenant_id'];
3545
+ isOneToOne: false;
3546
+ referencedRelation: 'tenants';
3547
+ referencedColumns: ['id'];
3548
+ }
3549
+ ];
3550
+ };
3551
+ workspace_templates: {
3552
+ Row: {
3553
+ category: string;
3554
+ config: Json;
3555
+ created_at: string;
3556
+ created_by: string | null;
3557
+ description: string | null;
3558
+ entity_types: Json;
3559
+ icon: string | null;
3560
+ id: string;
3561
+ is_featured: boolean | null;
3562
+ is_public: boolean;
3563
+ name: string;
3564
+ navigation: Json | null;
3565
+ sample_entities: Json | null;
3566
+ slug: string;
3567
+ tenant_id: string | null;
3568
+ updated_at: string;
3569
+ views: Json | null;
3570
+ };
3571
+ Insert: {
3572
+ category?: string;
3573
+ config?: Json;
3574
+ created_at?: string;
3575
+ created_by?: string | null;
3576
+ description?: string | null;
3577
+ entity_types?: Json;
3578
+ icon?: string | null;
3579
+ id?: string;
3580
+ is_featured?: boolean | null;
3581
+ is_public?: boolean;
3582
+ name: string;
3583
+ navigation?: Json | null;
3584
+ sample_entities?: Json | null;
3585
+ slug: string;
3586
+ tenant_id?: string | null;
3587
+ updated_at?: string;
3588
+ views?: Json | null;
3589
+ };
3590
+ Update: {
3591
+ category?: string;
3592
+ config?: Json;
3593
+ created_at?: string;
3594
+ created_by?: string | null;
3595
+ description?: string | null;
3596
+ entity_types?: Json;
3597
+ icon?: string | null;
3598
+ id?: string;
3599
+ is_featured?: boolean | null;
3600
+ is_public?: boolean;
3601
+ name?: string;
3602
+ navigation?: Json | null;
3603
+ sample_entities?: Json | null;
3604
+ slug?: string;
3605
+ tenant_id?: string | null;
3606
+ updated_at?: string;
3607
+ views?: Json | null;
3608
+ };
3609
+ Relationships: [
3610
+ {
3611
+ foreignKeyName: 'workspace_templates_tenant_id_fkey';
3612
+ columns: ['tenant_id'];
3613
+ isOneToOne: false;
3614
+ referencedRelation: 'tenants';
3615
+ referencedColumns: ['id'];
3616
+ }
3617
+ ];
3618
+ };
3619
+ };
3620
+ Views: {
3621
+ [_ in never]: never;
3622
+ };
3623
+ Functions: {
3624
+ authorize: {
3625
+ Args: {
3626
+ requested_permission: Database['public']['Enums']['app_permission'];
3627
+ };
3628
+ Returns: boolean;
3629
+ };
3630
+ check_entity_access: {
3631
+ Args: {
3632
+ action?: string;
3633
+ resource_id: string;
3634
+ };
3635
+ Returns: boolean;
3636
+ };
3637
+ claim_workflow_node_run: {
3638
+ Args: {
3639
+ p_claimed_at?: string;
3640
+ p_claimed_by: string;
3641
+ p_node_run_id: string;
3642
+ };
3643
+ Returns: {
3644
+ assignee_agent_slug: string | null;
3645
+ assignee_type: string | null;
3646
+ attempt_count: number;
3647
+ block_id: string | null;
3648
+ claimed_at: string | null;
3649
+ claimed_by: string | null;
3650
+ completed_at: string | null;
3651
+ created_at: string;
3652
+ depends_on: string[];
3653
+ duration_ms: number | null;
3654
+ entity_id: string;
3655
+ error_message: string | null;
3656
+ field_name: string | null;
3657
+ id: string;
3658
+ instructions: string | null;
3659
+ label: string;
3660
+ metadata: Json;
3661
+ node_key: string;
3662
+ node_type: string;
3663
+ output_type: string;
3664
+ started_at: string | null;
3665
+ status: string;
3666
+ tenant_id: string;
3667
+ workflow_run_id: string;
3668
+ }[];
3669
+ SetofOptions: {
3670
+ from: '*';
3671
+ to: 'workflow_node_runs';
3672
+ isOneToOne: false;
3673
+ isSetofReturn: true;
3674
+ };
3675
+ };
3676
+ enable_audit_tracking: {
3677
+ Args: {
3678
+ tbl: unknown;
3679
+ };
3680
+ Returns: undefined;
3681
+ };
3682
+ get_active_tenant_id: {
3683
+ Args: never;
3684
+ Returns: string;
3685
+ };
3686
+ get_entity_counts_by_type: {
3687
+ Args: {
3688
+ p_tenant_id: string;
3689
+ };
3690
+ Returns: {
3691
+ count: number;
3692
+ entity_type_id: string;
3693
+ }[];
3694
+ };
3695
+ hybrid_search_chunks: {
3696
+ Args: {
3697
+ full_text_weight?: number;
3698
+ match_count?: number;
3699
+ query_embedding: string;
3700
+ query_text: string;
3701
+ rrf_k?: number;
3702
+ semantic_weight?: number;
3703
+ };
3704
+ Returns: {
3705
+ chunk_index: number;
3706
+ content: string;
3707
+ document_id: string;
3708
+ full_text_rank: number;
3709
+ id: string;
3710
+ metadata: Json;
3711
+ rrf_score: number;
3712
+ semantic_rank: number;
3713
+ }[];
3714
+ } | {
3715
+ Args: {
3716
+ filter?: Json;
3717
+ full_text_weight?: number;
3718
+ match_count: number;
3719
+ query_embedding: string;
3720
+ query_text: string;
3721
+ rrf_k?: number;
3722
+ semantic_weight?: number;
3723
+ };
3724
+ Returns: {
3725
+ chunk_index: number;
3726
+ content: string;
3727
+ cosine_similarity: number;
3728
+ created_at: string;
3729
+ document_id: string;
3730
+ id: string;
3731
+ keyword_score: number;
3732
+ metadata: Json;
3733
+ rrf_score: number;
3734
+ similarity: number;
3735
+ tenant_id: string;
3736
+ updated_at: string;
3737
+ }[];
3738
+ };
3739
+ hybrid_search_document_chunks: {
3740
+ Args: {
3741
+ filter_document_ids?: string[];
3742
+ filter_tenant_id?: string;
3743
+ match_count?: number;
3744
+ min_similarity?: number;
3745
+ query_embedding?: string;
3746
+ query_text: string;
3747
+ rrf_k?: number;
3748
+ text_weight?: number;
3749
+ vector_weight?: number;
3750
+ };
3751
+ Returns: {
3752
+ chunk_index: number;
3753
+ combined_score: number;
3754
+ content: string;
3755
+ document_id: string;
3756
+ id: string;
3757
+ metadata: Json;
3758
+ page_number: number;
3759
+ similarity: number;
3760
+ text_rank: number;
3761
+ }[];
3762
+ };
3763
+ hybrid_search_entities: {
3764
+ Args: {
3765
+ full_text_weight?: number;
3766
+ match_count?: number;
3767
+ query_embedding: string;
3768
+ query_text: string;
3769
+ rrf_k?: number;
3770
+ semantic_weight?: number;
3771
+ };
3772
+ Returns: {
3773
+ content: Json;
3774
+ full_text_rank: number;
3775
+ id: string;
3776
+ metadata: Json;
3777
+ rrf_score: number;
3778
+ semantic_rank: number;
3779
+ title: string;
3780
+ }[];
3781
+ } | {
3782
+ Args: {
3783
+ filter?: Json;
3784
+ full_text_weight?: number;
3785
+ match_count: number;
3786
+ query_embedding: string;
3787
+ query_text: string;
3788
+ rrf_k?: number;
3789
+ semantic_weight?: number;
3790
+ };
3791
+ Returns: {
3792
+ content: Json;
3793
+ cosine_similarity: number;
3794
+ created_at: string;
3795
+ entity_type_id: string;
3796
+ id: string;
3797
+ image_url: string;
3798
+ keyword_score: number;
3799
+ owner_id: string;
3800
+ rrf_score: number;
3801
+ similarity: number;
3802
+ slug: string;
3803
+ tenant_id: string;
3804
+ title: string;
3805
+ updated_at: string;
3806
+ }[];
3807
+ };
3808
+ increment_unique_clicks: {
3809
+ Args: {
3810
+ link_id: string;
3811
+ visitor_id: string;
3812
+ };
3813
+ Returns: undefined;
3814
+ };
3815
+ is_entity_owner: {
3816
+ Args: {
3817
+ p_entity_id: string;
3818
+ p_user_id: string;
3819
+ };
3820
+ Returns: boolean;
3821
+ };
3822
+ match_chunks: {
3823
+ Args: {
3824
+ filter?: Json;
3825
+ match_count?: number;
3826
+ query_embedding: string;
3827
+ };
3828
+ Returns: {
3829
+ chunk_index: number;
3830
+ content: string;
3831
+ document_id: string;
3832
+ id: string;
3833
+ metadata: Json;
3834
+ similarity: number;
3835
+ }[];
3836
+ } | {
3837
+ Args: {
3838
+ filter?: Json;
3839
+ match_count?: number;
3840
+ metadata_filter?: Json;
3841
+ query_embedding: string;
3842
+ };
3843
+ Returns: {
3844
+ chunk_index: number;
3845
+ content: string;
3846
+ created_at: string;
3847
+ document_id: string;
3848
+ embedding: Json;
3849
+ id: string;
3850
+ metadata: Json;
3851
+ similarity: number;
3852
+ tenant_id: string;
3853
+ updated_at: string;
3854
+ }[];
3855
+ };
3856
+ match_document_chunks: {
3857
+ Args: {
3858
+ filter_entity_id?: string;
3859
+ filter_tenant_id?: string;
3860
+ match_count?: number;
3861
+ query_embedding: string;
3862
+ };
3863
+ Returns: {
3864
+ chunk_index: number;
3865
+ content: string;
3866
+ document_id: string;
3867
+ id: string;
3868
+ metadata: Json;
3869
+ similarity: number;
3870
+ }[];
3871
+ };
3872
+ primary_key_columns: {
3873
+ Args: {
3874
+ entity_oid: unknown;
3875
+ };
3876
+ Returns: string[];
3877
+ } | {
3878
+ Args: {
3879
+ tbl: unknown;
3880
+ };
3881
+ Returns: string[];
3882
+ };
3883
+ promote_field_value: {
3884
+ Args: {
3885
+ p_entity_id: string;
3886
+ p_field_name: string;
3887
+ p_response_id: string;
3888
+ p_reviewer_id?: string;
3889
+ p_source_meta?: Json;
3890
+ p_value: Json;
3891
+ };
3892
+ Returns: undefined;
3893
+ };
3894
+ rebuild_user_permissions: {
3895
+ Args: never;
3896
+ Returns: undefined;
3897
+ } | {
3898
+ Args: {
3899
+ target_user_id: string;
3900
+ };
3901
+ Returns: undefined;
3902
+ };
3903
+ show_limit: {
3904
+ Args: never;
3905
+ Returns: number;
3906
+ };
3907
+ show_trgm: {
3908
+ Args: {
3909
+ '': string;
3910
+ };
3911
+ Returns: string[];
3912
+ };
3913
+ tenant_users: {
3914
+ Args: never;
3915
+ Returns: {
3916
+ user_id: string;
3917
+ }[];
3918
+ } | {
3919
+ Args: {
3920
+ tenant: string;
3921
+ };
3922
+ Returns: string[];
3923
+ };
3924
+ to_resource_id: {
3925
+ Args: {
3926
+ entity_oid: unknown;
3927
+ pkey_cols: string[];
3928
+ rec: Json;
3929
+ };
3930
+ Returns: string;
3931
+ } | {
3932
+ Args: {
3933
+ row_data: Json;
3934
+ tbl: unknown;
3935
+ };
3936
+ Returns: string;
3937
+ };
3938
+ user_admin_tenant_ids: {
3939
+ Args: never;
3940
+ Returns: string[];
3941
+ };
3942
+ user_participant_chat_ids: {
3943
+ Args: never;
3944
+ Returns: string[];
3945
+ };
3946
+ user_tenant_ids: {
3947
+ Args: never;
3948
+ Returns: string[];
3949
+ };
3950
+ };
3951
+ Enums: {
3952
+ app_permission: 'chats.own.create' | 'chats.own.read' | 'chats.own.update' | 'chats.own.delete' | 'chats.team.create' | 'chats.team.read' | 'chats.team.update' | 'chats.team.delete' | 'users.team.create' | 'users.team.read' | 'users.team.update' | 'users.team.delete' | 'entities.own.create' | 'entities.own.read' | 'entities.own.update' | 'entities.own.delete' | 'entities.team.create' | 'entities.team.read' | 'entities.team.update' | 'entities.team.delete' | 'entities.all.create' | 'entities.all.read' | 'entities.all.update' | 'entities.all.delete' | 'entity_types.own.create' | 'entity_types.own.read' | 'entity_types.own.update' | 'entity_types.own.delete' | 'entity_types.team.create' | 'entity_types.team.read' | 'entity_types.team.update' | 'entity_types.team.delete' | 'entity_types.all.create' | 'entity_types.all.read' | 'entity_types.all.update' | 'entity_types.all.delete' | 'chats.all.create' | 'chats.all.read' | 'chats.all.update' | 'chats.all.delete' | 'messages.own.create' | 'messages.own.read' | 'messages.own.update' | 'messages.own.delete' | 'messages.team.create' | 'messages.team.read' | 'messages.team.update' | 'messages.team.delete' | 'messages.all.create' | 'messages.all.read' | 'messages.all.update' | 'messages.all.delete' | 'documents.own.create' | 'documents.own.read' | 'documents.own.update' | 'documents.own.delete' | 'documents.team.create' | 'documents.team.read' | 'documents.team.update' | 'documents.team.delete' | 'documents.all.create' | 'documents.all.read' | 'documents.all.update' | 'documents.all.delete' | 'users.own.read' | 'users.own.update' | 'users.all.read' | 'users.all.update' | 'users.all.create' | 'users.all.delete' | 'audit_logs.own.read' | 'audit_logs.team.read' | 'audit_logs.all.read' | 'agents.own.create' | 'agents.own.read' | 'agents.own.update' | 'agents.own.delete' | 'agents.team.create' | 'agents.team.read' | 'agents.team.update' | 'agents.team.delete' | 'agents.all.create' | 'agents.all.read' | 'agents.all.update' | 'agents.all.delete' | 'views.team.update';
3953
+ tenant_type: 'public' | 'team';
3954
+ visibility_level: 'public' | 'private' | 'team' | 'shared' | 'tenant';
3955
+ };
3956
+ CompositeTypes: {
3957
+ [_ in never]: never;
3958
+ };
3959
+ };
3960
+ };
3961
+ type DatabaseWithoutInternals = Omit<Database, '__InternalSupabase'>;
3962
+ type DefaultSchema = DatabaseWithoutInternals[Extract<keyof Database, 'public'>];
3963
+ export type Tables<DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema['Tables'] & DefaultSchema['Views']) | {
3964
+ schema: keyof DatabaseWithoutInternals;
3965
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
3966
+ schema: keyof DatabaseWithoutInternals;
3967
+ } ? keyof (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Views']) : never = never> = DefaultSchemaTableNameOrOptions extends {
3968
+ schema: keyof DatabaseWithoutInternals;
3969
+ } ? (DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] & DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Views'])[TableName] extends {
3970
+ Row: infer R;
3971
+ } ? R : never : DefaultSchemaTableNameOrOptions extends keyof (DefaultSchema['Tables'] & DefaultSchema['Views']) ? (DefaultSchema['Tables'] & DefaultSchema['Views'])[DefaultSchemaTableNameOrOptions] extends {
3972
+ Row: infer R;
3973
+ } ? R : never : never;
3974
+ export type TablesInsert<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema['Tables'] | {
3975
+ schema: keyof DatabaseWithoutInternals;
3976
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
3977
+ schema: keyof DatabaseWithoutInternals;
3978
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] : never = never> = DefaultSchemaTableNameOrOptions extends {
3979
+ schema: keyof DatabaseWithoutInternals;
3980
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'][TableName] extends {
3981
+ Insert: infer I;
3982
+ } ? I : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema['Tables'] ? DefaultSchema['Tables'][DefaultSchemaTableNameOrOptions] extends {
3983
+ Insert: infer I;
3984
+ } ? I : never : never;
3985
+ export type TablesUpdate<DefaultSchemaTableNameOrOptions extends keyof DefaultSchema['Tables'] | {
3986
+ schema: keyof DatabaseWithoutInternals;
3987
+ }, TableName extends DefaultSchemaTableNameOrOptions extends {
3988
+ schema: keyof DatabaseWithoutInternals;
3989
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'] : never = never> = DefaultSchemaTableNameOrOptions extends {
3990
+ schema: keyof DatabaseWithoutInternals;
3991
+ } ? DatabaseWithoutInternals[DefaultSchemaTableNameOrOptions['schema']]['Tables'][TableName] extends {
3992
+ Update: infer U;
3993
+ } ? U : never : DefaultSchemaTableNameOrOptions extends keyof DefaultSchema['Tables'] ? DefaultSchema['Tables'][DefaultSchemaTableNameOrOptions] extends {
3994
+ Update: infer U;
3995
+ } ? U : never : never;
3996
+ export type Enums<DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema['Enums'] | {
3997
+ schema: keyof DatabaseWithoutInternals;
3998
+ }, EnumName extends DefaultSchemaEnumNameOrOptions extends {
3999
+ schema: keyof DatabaseWithoutInternals;
4000
+ } ? keyof DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions['schema']]['Enums'] : never = never> = DefaultSchemaEnumNameOrOptions extends {
4001
+ schema: keyof DatabaseWithoutInternals;
4002
+ } ? DatabaseWithoutInternals[DefaultSchemaEnumNameOrOptions['schema']]['Enums'][EnumName] : DefaultSchemaEnumNameOrOptions extends keyof DefaultSchema['Enums'] ? DefaultSchema['Enums'][DefaultSchemaEnumNameOrOptions] : never;
4003
+ export type CompositeTypes<PublicCompositeTypeNameOrOptions extends keyof DefaultSchema['CompositeTypes'] | {
4004
+ schema: keyof DatabaseWithoutInternals;
4005
+ }, CompositeTypeName extends PublicCompositeTypeNameOrOptions extends {
4006
+ schema: keyof DatabaseWithoutInternals;
4007
+ } ? keyof DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes'] : never = never> = PublicCompositeTypeNameOrOptions extends {
4008
+ schema: keyof DatabaseWithoutInternals;
4009
+ } ? DatabaseWithoutInternals[PublicCompositeTypeNameOrOptions['schema']]['CompositeTypes'][CompositeTypeName] : PublicCompositeTypeNameOrOptions extends keyof DefaultSchema['CompositeTypes'] ? DefaultSchema['CompositeTypes'][PublicCompositeTypeNameOrOptions] : never;
4010
+ export declare const Constants: {
4011
+ readonly public: {
4012
+ readonly Enums: {
4013
+ readonly app_permission: readonly ["chats.own.create", "chats.own.read", "chats.own.update", "chats.own.delete", "chats.team.create", "chats.team.read", "chats.team.update", "chats.team.delete", "users.team.create", "users.team.read", "users.team.update", "users.team.delete", "entities.own.create", "entities.own.read", "entities.own.update", "entities.own.delete", "entities.team.create", "entities.team.read", "entities.team.update", "entities.team.delete", "entities.all.create", "entities.all.read", "entities.all.update", "entities.all.delete", "entity_types.own.create", "entity_types.own.read", "entity_types.own.update", "entity_types.own.delete", "entity_types.team.create", "entity_types.team.read", "entity_types.team.update", "entity_types.team.delete", "entity_types.all.create", "entity_types.all.read", "entity_types.all.update", "entity_types.all.delete", "chats.all.create", "chats.all.read", "chats.all.update", "chats.all.delete", "messages.own.create", "messages.own.read", "messages.own.update", "messages.own.delete", "messages.team.create", "messages.team.read", "messages.team.update", "messages.team.delete", "messages.all.create", "messages.all.read", "messages.all.update", "messages.all.delete", "documents.own.create", "documents.own.read", "documents.own.update", "documents.own.delete", "documents.team.create", "documents.team.read", "documents.team.update", "documents.team.delete", "documents.all.create", "documents.all.read", "documents.all.update", "documents.all.delete", "users.own.read", "users.own.update", "users.all.read", "users.all.update", "users.all.create", "users.all.delete", "audit_logs.own.read", "audit_logs.team.read", "audit_logs.all.read", "agents.own.create", "agents.own.read", "agents.own.update", "agents.own.delete", "agents.team.create", "agents.team.read", "agents.team.update", "agents.team.delete", "agents.all.create", "agents.all.read", "agents.all.update", "agents.all.delete", "views.team.update"];
4014
+ readonly tenant_type: readonly ["public", "team"];
4015
+ readonly visibility_level: readonly ["public", "private", "team", "shared", "tenant"];
4016
+ };
4017
+ };
4018
+ };
4019
+ export {};
4020
+ //# sourceMappingURL=database-types.d.ts.map