prest-js-sdk 0.3.0 → 0.4.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.
@@ -0,0 +1,1534 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ const accounts = {
4
+ tableName: 'accounts',
5
+ columns: ['access_token', 'access_token_expires_at', 'account_id', 'created_at', 'id', 'id_token', 'password', 'provider_id', 'refresh_token', 'refresh_token_expires_at', 'scope', 'updated_at', 'user_id'],
6
+ requiredForInsert: ['account_id', 'id', 'provider_id', 'updated_at', 'user_id'],
7
+ primaryKey: 'id',
8
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
9
+ $type: null,
10
+ $input: null
11
+ };
12
+ const agent_bot_providers = {
13
+ tableName: 'agent_bot_providers',
14
+ columns: ['id', 'agent_id', 'user_id', 'platform', 'application_id', 'credentials', 'enabled', 'accessed_at', 'created_at', 'updated_at', 'settings', 'workspace_id'],
15
+ requiredForInsert: ['agent_id', 'user_id', 'platform', 'application_id'],
16
+ primaryKey: 'id',
17
+ foreignKeys: {
18
+ agent_id: { table: 'agents', column: 'id', $type: null },
19
+ user_id: { table: 'users', column: 'id', $type: null },
20
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
21
+ },
22
+ $type: null,
23
+ $input: null
24
+ };
25
+ const agent_cron_jobs = {
26
+ tableName: 'agent_cron_jobs',
27
+ columns: ['id', 'agent_id', 'group_id', 'user_id', 'name', 'description', 'enabled', 'cron_pattern', 'timezone', 'content', 'edit_data', 'max_executions', 'remaining_executions', 'execution_conditions', 'last_executed_at', 'total_executions', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
28
+ requiredForInsert: ['id', 'agent_id', 'user_id', 'cron_pattern', 'content'],
29
+ primaryKey: 'id',
30
+ foreignKeys: {
31
+ agent_id: { table: 'agents', column: 'id', $type: null },
32
+ group_id: { table: 'chat_groups', column: 'id', $type: null },
33
+ user_id: { table: 'users', column: 'id', $type: null },
34
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
35
+ },
36
+ $type: null,
37
+ $input: null
38
+ };
39
+ const agent_documents = {
40
+ tableName: 'agent_documents',
41
+ columns: ['id', 'user_id', 'agent_id', 'document_id', 'template_id', 'access_self', 'access_shared', 'access_public', 'policy_load', 'policy', 'policy_load_position', 'policy_load_format', 'policy_load_rule', 'deleted_at', 'deleted_by_user_id', 'deleted_by_agent_id', 'delete_reason', 'created_at', 'updated_at', 'workspace_id'],
42
+ requiredForInsert: ['user_id', 'agent_id', 'document_id'],
43
+ primaryKey: 'id',
44
+ foreignKeys: {
45
+ user_id: { table: 'users', column: 'id', $type: null },
46
+ agent_id: { table: 'agents', column: 'id', $type: null },
47
+ document_id: { table: 'documents', column: 'id', $type: null },
48
+ deleted_by_user_id: { table: 'users', column: 'id', $type: null },
49
+ deleted_by_agent_id: { table: 'agents', column: 'id', $type: null },
50
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
51
+ },
52
+ $type: null,
53
+ $input: null
54
+ };
55
+ const agent_eval_benchmarks = {
56
+ tableName: 'agent_eval_benchmarks',
57
+ columns: ['id', 'identifier', 'name', 'description', 'rubrics', 'reference_url', 'metadata', 'is_system', 'accessed_at', 'created_at', 'updated_at', 'user_id', 'workspace_id'],
58
+ requiredForInsert: ['id', 'identifier', 'name', 'rubrics'],
59
+ primaryKey: 'id',
60
+ foreignKeys: {
61
+ user_id: { table: 'users', column: 'id', $type: null },
62
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
63
+ },
64
+ $type: null,
65
+ $input: null
66
+ };
67
+ const agent_eval_datasets = {
68
+ tableName: 'agent_eval_datasets',
69
+ columns: ['id', 'benchmark_id', 'identifier', 'user_id', 'name', 'description', 'eval_mode', 'eval_config', 'metadata', 'accessed_at', 'created_at', 'updated_at', 'source_experiment_id', 'workspace_id'],
70
+ requiredForInsert: ['id', 'benchmark_id', 'identifier', 'name'],
71
+ primaryKey: 'id',
72
+ foreignKeys: {
73
+ benchmark_id: { table: 'agent_eval_benchmarks', column: 'id', $type: null },
74
+ user_id: { table: 'users', column: 'id', $type: null },
75
+ source_experiment_id: { table: 'agent_eval_experiments', column: 'id', $type: null },
76
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
77
+ },
78
+ $type: null,
79
+ $input: null
80
+ };
81
+ const agent_eval_experiment_benchmarks = {
82
+ tableName: 'agent_eval_experiment_benchmarks',
83
+ columns: ['experiment_id', 'benchmark_id', 'user_id', 'created_at', 'workspace_id'],
84
+ requiredForInsert: ['experiment_id', 'benchmark_id', 'user_id'],
85
+ primaryKey: 'experiment_id',
86
+ foreignKeys: {
87
+ experiment_id: { table: 'agent_eval_experiments', column: 'id', $type: null },
88
+ benchmark_id: { table: 'agent_eval_benchmarks', column: 'id', $type: null },
89
+ user_id: { table: 'users', column: 'id', $type: null },
90
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
91
+ },
92
+ $type: null,
93
+ $input: null
94
+ };
95
+ const agent_eval_experiments = {
96
+ tableName: 'agent_eval_experiments',
97
+ columns: ['id', 'user_id', 'name', 'description', 'metadata', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
98
+ requiredForInsert: ['id', 'user_id', 'name'],
99
+ primaryKey: 'id',
100
+ foreignKeys: {
101
+ user_id: { table: 'users', column: 'id', $type: null },
102
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
103
+ },
104
+ $type: null,
105
+ $input: null
106
+ };
107
+ const agent_eval_run_topics = {
108
+ tableName: 'agent_eval_run_topics',
109
+ columns: ['user_id', 'run_id', 'topic_id', 'test_case_id', 'status', 'score', 'passed', 'eval_result', 'created_at', 'workspace_id'],
110
+ requiredForInsert: ['user_id', 'run_id', 'topic_id', 'test_case_id'],
111
+ primaryKey: 'run_id',
112
+ foreignKeys: {
113
+ user_id: { table: 'users', column: 'id', $type: null },
114
+ run_id: { table: 'agent_eval_runs', column: 'id', $type: null },
115
+ topic_id: { table: 'topics', column: 'id', $type: null },
116
+ test_case_id: { table: 'agent_eval_test_cases', column: 'id', $type: null },
117
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
118
+ },
119
+ $type: null,
120
+ $input: null
121
+ };
122
+ const agent_eval_runs = {
123
+ tableName: 'agent_eval_runs',
124
+ columns: ['id', 'dataset_id', 'target_agent_id', 'user_id', 'name', 'status', 'config', 'metrics', 'started_at', 'accessed_at', 'created_at', 'updated_at', 'experiment_id', 'parent_run_id', 'workspace_id'],
125
+ requiredForInsert: ['id', 'dataset_id', 'user_id'],
126
+ primaryKey: 'id',
127
+ foreignKeys: {
128
+ dataset_id: { table: 'agent_eval_datasets', column: 'id', $type: null },
129
+ target_agent_id: { table: 'agents', column: 'id', $type: null },
130
+ user_id: { table: 'users', column: 'id', $type: null },
131
+ experiment_id: { table: 'agent_eval_experiments', column: 'id', $type: null },
132
+ parent_run_id: { table: 'agent_eval_runs', column: 'id', $type: null },
133
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
134
+ },
135
+ $type: null,
136
+ $input: null
137
+ };
138
+ const agent_eval_test_cases = {
139
+ tableName: 'agent_eval_test_cases',
140
+ columns: ['id', 'user_id', 'dataset_id', 'content', 'eval_mode', 'eval_config', 'metadata', 'sort_order', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
141
+ requiredForInsert: ['id', 'user_id', 'dataset_id', 'content'],
142
+ primaryKey: 'id',
143
+ foreignKeys: {
144
+ user_id: { table: 'users', column: 'id', $type: null },
145
+ dataset_id: { table: 'agent_eval_datasets', column: 'id', $type: null },
146
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
147
+ },
148
+ $type: null,
149
+ $input: null
150
+ };
151
+ const agent_operations = {
152
+ tableName: 'agent_operations',
153
+ columns: ['id', 'user_id', 'agent_id', 'topic_id', 'thread_id', 'task_id', 'chat_group_id', 'parent_operation_id', 'status', 'completion_reason', 'started_at', 'completed_at', 'step_count', 'max_steps', 'force_finish', 'interruption', 'error', 'total_cost', 'currency', 'total_input_tokens', 'total_output_tokens', 'total_tokens', 'llm_calls', 'tool_calls', 'human_interventions', 'processing_time_ms', 'human_waiting_time_ms', 'cost', 'usage', 'cost_limit', 'model', 'provider', 'model_runtime_config', 'trigger', 'app_context', 'trace_s3_key', 'metadata', 'accessed_at', 'created_at', 'updated_at', 'workspace_id', 'verify_status', 'verify_plan', 'verify_plan_confirmed_at'],
154
+ requiredForInsert: ['id', 'user_id', 'status'],
155
+ primaryKey: 'id',
156
+ foreignKeys: {
157
+ agent_id: { table: 'agents', column: 'id', $type: null },
158
+ topic_id: { table: 'topics', column: 'id', $type: null },
159
+ thread_id: { table: 'threads', column: 'id', $type: null },
160
+ task_id: { table: 'tasks', column: 'id', $type: null },
161
+ chat_group_id: { table: 'chat_groups', column: 'id', $type: null },
162
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
163
+ },
164
+ $type: null,
165
+ $input: null
166
+ };
167
+ const agent_shares = {
168
+ tableName: 'agent_shares',
169
+ columns: ['id', 'agent_id', 'visibility', 'share_config', 'user_view_count', 'accessed_at', 'created_at', 'updated_at'],
170
+ requiredForInsert: ['agent_id'],
171
+ primaryKey: 'id',
172
+ foreignKeys: { agent_id: { table: 'agents', column: 'id', $type: null }, },
173
+ $type: null,
174
+ $input: null
175
+ };
176
+ const agent_skills = {
177
+ tableName: 'agent_skills',
178
+ columns: ['id', 'name', 'description', 'identifier', 'source', 'manifest', 'content', 'editor_data', 'resources', 'zip_file_hash', 'user_id', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
179
+ requiredForInsert: ['id', 'name', 'description', 'identifier', 'source', 'user_id'],
180
+ primaryKey: 'id',
181
+ foreignKeys: {
182
+ zip_file_hash: { table: 'global_files', column: 'hash_id', $type: null },
183
+ user_id: { table: 'users', column: 'id', $type: null },
184
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
185
+ },
186
+ $type: null,
187
+ $input: null
188
+ };
189
+ const agents = {
190
+ tableName: 'agents',
191
+ columns: ['id', 'slug', 'title', 'description', 'tags', 'avatar', 'background_color', 'plugins', 'user_id', 'chat_config', 'few_shots', 'model', 'params', 'provider', 'system_role', 'tts', 'created_at', 'updated_at', 'accessed_at', 'client_id', 'opening_message', 'opening_questions', 'virtual', 'market_identifier', 'editor_data', 'pinned', 'session_group_id', 'agency_config', 'workspace_id', 'agents_tsv'],
192
+ requiredForInsert: ['id', 'user_id'],
193
+ primaryKey: 'id',
194
+ foreignKeys: {
195
+ user_id: { table: 'users', column: 'id', $type: null },
196
+ session_group_id: { table: 'session_groups', column: 'id', $type: null },
197
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
198
+ },
199
+ $type: null,
200
+ $input: null
201
+ };
202
+ const agents_files = {
203
+ tableName: 'agents_files',
204
+ columns: ['file_id', 'agent_id', 'enabled', 'user_id', 'created_at', 'updated_at', 'accessed_at', 'workspace_id'],
205
+ requiredForInsert: ['file_id', 'agent_id', 'user_id'],
206
+ primaryKey: 'file_id',
207
+ foreignKeys: {
208
+ file_id: { table: 'files', column: 'id', $type: null },
209
+ agent_id: { table: 'agents', column: 'id', $type: null },
210
+ user_id: { table: 'users', column: 'id', $type: null },
211
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
212
+ },
213
+ $type: null,
214
+ $input: null
215
+ };
216
+ const agents_knowledge_bases = {
217
+ tableName: 'agents_knowledge_bases',
218
+ columns: ['agent_id', 'knowledge_base_id', 'user_id', 'enabled', 'created_at', 'updated_at', 'accessed_at', 'workspace_id'],
219
+ requiredForInsert: ['agent_id', 'knowledge_base_id', 'user_id'],
220
+ primaryKey: 'agent_id',
221
+ foreignKeys: {
222
+ agent_id: { table: 'agents', column: 'id', $type: null },
223
+ knowledge_base_id: { table: 'knowledge_bases', column: 'id', $type: null },
224
+ user_id: { table: 'users', column: 'id', $type: null },
225
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
226
+ },
227
+ $type: null,
228
+ $input: null
229
+ };
230
+ const agents_to_sessions = {
231
+ tableName: 'agents_to_sessions',
232
+ columns: ['agent_id', 'session_id', 'user_id', 'workspace_id'],
233
+ requiredForInsert: ['agent_id', 'session_id', 'user_id'],
234
+ primaryKey: 'agent_id',
235
+ foreignKeys: {
236
+ agent_id: { table: 'agents', column: 'id', $type: null },
237
+ session_id: { table: 'sessions', column: 'id', $type: null },
238
+ user_id: { table: 'users', column: 'id', $type: null },
239
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
240
+ },
241
+ $type: null,
242
+ $input: null
243
+ };
244
+ const ai_models = {
245
+ tableName: 'ai_models',
246
+ columns: ['id', 'display_name', 'description', 'organization', 'enabled', 'provider_id', 'type', 'sort', 'user_id', 'pricing', 'parameters', 'config', 'abilities', 'context_window_tokens', 'source', 'released_at', 'accessed_at', 'created_at', 'updated_at', 'settings', 'workspace_id', '_id'],
247
+ requiredForInsert: ['id', 'provider_id', 'user_id'],
248
+ primaryKey: 'id',
249
+ foreignKeys: {
250
+ user_id: { table: 'users', column: 'id', $type: null },
251
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
252
+ },
253
+ $type: null,
254
+ $input: null
255
+ };
256
+ const ai_providers = {
257
+ tableName: 'ai_providers',
258
+ columns: ['id', 'name', 'user_id', 'sort', 'enabled', 'fetch_on_client', 'check_model', 'logo', 'description', 'key_vaults', 'source', 'settings', 'accessed_at', 'created_at', 'updated_at', 'config', 'workspace_id', '_id'],
259
+ requiredForInsert: ['id', 'user_id'],
260
+ primaryKey: 'id',
261
+ foreignKeys: {
262
+ user_id: { table: 'users', column: 'id', $type: null },
263
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
264
+ },
265
+ $type: null,
266
+ $input: null
267
+ };
268
+ const api_keys = {
269
+ tableName: 'api_keys',
270
+ columns: ['name', 'key', 'enabled', 'expires_at', 'last_used_at', 'user_id', 'accessed_at', 'created_at', 'updated_at', 'id', 'key_hash', 'workspace_id'],
271
+ requiredForInsert: ['name', 'key', 'user_id', 'id'],
272
+ primaryKey: 'id',
273
+ foreignKeys: {
274
+ user_id: { table: 'users', column: 'id', $type: null },
275
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
276
+ },
277
+ $type: null,
278
+ $input: null
279
+ };
280
+ const async_tasks = {
281
+ tableName: 'async_tasks',
282
+ columns: ['id', 'type', 'status', 'error', 'user_id', 'duration', 'created_at', 'updated_at', 'accessed_at', 'parent_id', 'metadata', 'inference_id', 'workspace_id'],
283
+ requiredForInsert: ['user_id'],
284
+ primaryKey: 'id',
285
+ foreignKeys: {
286
+ user_id: { table: 'users', column: 'id', $type: null },
287
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
288
+ },
289
+ $type: null,
290
+ $input: null
291
+ };
292
+ const auth_sessions = {
293
+ tableName: 'auth_sessions',
294
+ columns: ['created_at', 'expires_at', 'id', 'ip_address', 'token', 'updated_at', 'user_agent', 'user_id', 'impersonated_by'],
295
+ requiredForInsert: ['expires_at', 'id', 'token', 'updated_at', 'user_id'],
296
+ primaryKey: 'id',
297
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
298
+ $type: null,
299
+ $input: null
300
+ };
301
+ const briefs = {
302
+ tableName: 'briefs',
303
+ columns: ['id', 'user_id', 'task_id', 'cron_job_id', 'topic_id', 'agent_id', 'type', 'priority', 'title', 'summary', 'artifacts', 'actions', 'resolved_action', 'resolved_comment', 'read_at', 'resolved_at', 'created_at', 'trigger', 'metadata', 'workspace_id'],
304
+ requiredForInsert: ['id', 'user_id', 'type', 'title', 'summary'],
305
+ primaryKey: 'id',
306
+ foreignKeys: {
307
+ user_id: { table: 'users', column: 'id', $type: null },
308
+ task_id: { table: 'tasks', column: 'id', $type: null },
309
+ cron_job_id: { table: 'agent_cron_jobs', column: 'id', $type: null },
310
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
311
+ },
312
+ $type: null,
313
+ $input: null
314
+ };
315
+ const chat_groups = {
316
+ tableName: 'chat_groups',
317
+ columns: ['id', 'title', 'description', 'config', 'client_id', 'user_id', 'pinned', 'accessed_at', 'created_at', 'updated_at', 'group_id', 'avatar', 'background_color', 'content', 'editor_data', 'market_identifier', 'workspace_id', 'chat_groups_tsv'],
318
+ requiredForInsert: ['id', 'user_id'],
319
+ primaryKey: 'id',
320
+ foreignKeys: {
321
+ user_id: { table: 'users', column: 'id', $type: null },
322
+ group_id: { table: 'session_groups', column: 'id', $type: null },
323
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
324
+ },
325
+ $type: null,
326
+ $input: null
327
+ };
328
+ const chat_groups_agents = {
329
+ tableName: 'chat_groups_agents',
330
+ columns: ['chat_group_id', 'agent_id', 'user_id', 'enabled', 'order', 'role', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
331
+ requiredForInsert: ['chat_group_id', 'agent_id', 'user_id'],
332
+ primaryKey: 'chat_group_id',
333
+ foreignKeys: {
334
+ chat_group_id: { table: 'chat_groups', column: 'id', $type: null },
335
+ agent_id: { table: 'agents', column: 'id', $type: null },
336
+ user_id: { table: 'users', column: 'id', $type: null },
337
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
338
+ },
339
+ $type: null,
340
+ $input: null
341
+ };
342
+ const chunks = {
343
+ tableName: 'chunks',
344
+ columns: ['id', 'text', 'abstract', 'metadata', 'index', 'type', 'created_at', 'updated_at', 'user_id', 'accessed_at', 'client_id', 'workspace_id'],
345
+ requiredForInsert: [],
346
+ primaryKey: 'id',
347
+ foreignKeys: {
348
+ user_id: { table: 'users', column: 'id', $type: null },
349
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
350
+ },
351
+ $type: null,
352
+ $input: null
353
+ };
354
+ const devices = {
355
+ tableName: 'devices',
356
+ columns: ['id', 'user_id', 'device_id', 'identity_source', 'hostname', 'platform', 'friendly_name', 'default_cwd', 'recent_cwds', 'first_seen_at', 'last_seen_at', 'accessed_at', 'created_at', 'updated_at', 'workspace_id', 'working_dirs'],
357
+ requiredForInsert: ['user_id', 'device_id', 'identity_source'],
358
+ primaryKey: 'id',
359
+ foreignKeys: {
360
+ user_id: { table: 'users', column: 'id', $type: null },
361
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
362
+ },
363
+ $type: null,
364
+ $input: null
365
+ };
366
+ const document_chunks = {
367
+ tableName: 'document_chunks',
368
+ columns: ['document_id', 'chunk_id', 'page_index', 'user_id', 'created_at', 'workspace_id'],
369
+ requiredForInsert: ['document_id', 'chunk_id', 'user_id'],
370
+ primaryKey: 'document_id',
371
+ foreignKeys: {
372
+ document_id: { table: 'documents', column: 'id', $type: null },
373
+ chunk_id: { table: 'chunks', column: 'id', $type: null },
374
+ user_id: { table: 'users', column: 'id', $type: null },
375
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
376
+ },
377
+ $type: null,
378
+ $input: null
379
+ };
380
+ const document_histories = {
381
+ tableName: 'document_histories',
382
+ columns: ['id', 'document_id', 'user_id', 'editor_data', 'save_source', 'saved_at', 'workspace_id'],
383
+ requiredForInsert: ['id', 'document_id', 'user_id', 'editor_data', 'save_source', 'saved_at'],
384
+ primaryKey: 'id',
385
+ foreignKeys: {
386
+ document_id: { table: 'documents', column: 'id', $type: null },
387
+ user_id: { table: 'users', column: 'id', $type: null },
388
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
389
+ },
390
+ $type: null,
391
+ $input: null
392
+ };
393
+ const document_shares = {
394
+ tableName: 'document_shares',
395
+ columns: ['id', 'document_id', 'user_id', 'visibility', 'permission', 'page_view_count', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
396
+ requiredForInsert: ['document_id', 'user_id'],
397
+ primaryKey: 'id',
398
+ foreignKeys: {
399
+ document_id: { table: 'documents', column: 'id', $type: null },
400
+ user_id: { table: 'users', column: 'id', $type: null },
401
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
402
+ },
403
+ $type: null,
404
+ $input: null
405
+ };
406
+ const documents = {
407
+ tableName: 'documents',
408
+ columns: ['id', 'title', 'content', 'file_type', 'filename', 'total_char_count', 'total_line_count', 'metadata', 'pages', 'source_type', 'source', 'file_id', 'user_id', 'client_id', 'accessed_at', 'created_at', 'updated_at', 'editor_data', 'parent_id', 'slug', 'description', 'knowledge_base_id', 'workspace_id', 'documents_tsv'],
409
+ requiredForInsert: ['id', 'file_type', 'total_char_count', 'total_line_count', 'source_type', 'source', 'user_id'],
410
+ primaryKey: 'id',
411
+ foreignKeys: {
412
+ file_id: { table: 'files', column: 'id', $type: null },
413
+ user_id: { table: 'users', column: 'id', $type: null },
414
+ parent_id: { table: 'documents', column: 'id', $type: null },
415
+ knowledge_base_id: { table: 'knowledge_bases', column: 'id', $type: null },
416
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
417
+ },
418
+ $type: null,
419
+ $input: null
420
+ };
421
+ const embeddings = {
422
+ tableName: 'embeddings',
423
+ columns: ['id', 'chunk_id', 'embeddings', 'model', 'user_id', 'client_id', 'workspace_id'],
424
+ requiredForInsert: [],
425
+ primaryKey: 'id',
426
+ foreignKeys: {
427
+ chunk_id: { table: 'chunks', column: 'id', $type: null },
428
+ user_id: { table: 'users', column: 'id', $type: null },
429
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
430
+ },
431
+ $type: null,
432
+ $input: null
433
+ };
434
+ const file_chunks = {
435
+ tableName: 'file_chunks',
436
+ columns: ['file_id', 'chunk_id', 'created_at', 'user_id', 'workspace_id'],
437
+ requiredForInsert: ['file_id', 'chunk_id', 'user_id'],
438
+ primaryKey: 'file_id',
439
+ foreignKeys: {
440
+ file_id: { table: 'files', column: 'id', $type: null },
441
+ chunk_id: { table: 'chunks', column: 'id', $type: null },
442
+ user_id: { table: 'users', column: 'id', $type: null },
443
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
444
+ },
445
+ $type: null,
446
+ $input: null
447
+ };
448
+ const files = {
449
+ tableName: 'files',
450
+ columns: ['id', 'user_id', 'file_type', 'name', 'size', 'url', 'metadata', 'created_at', 'updated_at', 'file_hash', 'chunk_task_id', 'embedding_task_id', 'accessed_at', 'client_id', 'source', 'parent_id', 'workspace_id', 'files_tsv'],
451
+ requiredForInsert: ['id', 'user_id', 'file_type', 'name', 'size', 'url'],
452
+ primaryKey: 'id',
453
+ foreignKeys: {
454
+ user_id: { table: 'users', column: 'id', $type: null },
455
+ file_hash: { table: 'global_files', column: 'hash_id', $type: null },
456
+ chunk_task_id: { table: 'async_tasks', column: 'id', $type: null },
457
+ embedding_task_id: { table: 'async_tasks', column: 'id', $type: null },
458
+ parent_id: { table: 'documents', column: 'id', $type: null },
459
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
460
+ },
461
+ $type: null,
462
+ $input: null
463
+ };
464
+ const files_to_sessions = {
465
+ tableName: 'files_to_sessions',
466
+ columns: ['file_id', 'session_id', 'user_id', 'workspace_id'],
467
+ requiredForInsert: ['file_id', 'session_id', 'user_id'],
468
+ primaryKey: 'file_id',
469
+ foreignKeys: {
470
+ file_id: { table: 'files', column: 'id', $type: null },
471
+ session_id: { table: 'sessions', column: 'id', $type: null },
472
+ user_id: { table: 'users', column: 'id', $type: null },
473
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
474
+ },
475
+ $type: null,
476
+ $input: null
477
+ };
478
+ const generation_batches = {
479
+ tableName: 'generation_batches',
480
+ columns: ['id', 'user_id', 'generation_topic_id', 'provider', 'model', 'prompt', 'width', 'height', 'ratio', 'config', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
481
+ requiredForInsert: ['id', 'user_id', 'generation_topic_id', 'provider', 'model', 'prompt'],
482
+ primaryKey: 'id',
483
+ foreignKeys: {
484
+ user_id: { table: 'users', column: 'id', $type: null },
485
+ generation_topic_id: { table: 'generation_topics', column: 'id', $type: null },
486
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
487
+ },
488
+ $type: null,
489
+ $input: null
490
+ };
491
+ const generation_topics = {
492
+ tableName: 'generation_topics',
493
+ columns: ['id', 'user_id', 'title', 'cover_url', 'accessed_at', 'created_at', 'updated_at', 'type', 'workspace_id'],
494
+ requiredForInsert: ['id', 'user_id'],
495
+ primaryKey: 'id',
496
+ foreignKeys: {
497
+ user_id: { table: 'users', column: 'id', $type: null },
498
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
499
+ },
500
+ $type: null,
501
+ $input: null
502
+ };
503
+ const generations = {
504
+ tableName: 'generations',
505
+ columns: ['id', 'user_id', 'generation_batch_id', 'async_task_id', 'file_id', 'seed', 'asset', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
506
+ requiredForInsert: ['id', 'user_id', 'generation_batch_id'],
507
+ primaryKey: 'id',
508
+ foreignKeys: {
509
+ user_id: { table: 'users', column: 'id', $type: null },
510
+ generation_batch_id: { table: 'generation_batches', column: 'id', $type: null },
511
+ async_task_id: { table: 'async_tasks', column: 'id', $type: null },
512
+ file_id: { table: 'files', column: 'id', $type: null },
513
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
514
+ },
515
+ $type: null,
516
+ $input: null
517
+ };
518
+ const global_files = {
519
+ tableName: 'global_files',
520
+ columns: ['hash_id', 'file_type', 'size', 'url', 'metadata', 'created_at', 'accessed_at', 'creator'],
521
+ requiredForInsert: ['hash_id', 'file_type', 'size', 'url'],
522
+ primaryKey: 'hash_id',
523
+ foreignKeys: { creator: { table: 'users', column: 'id', $type: null }, },
524
+ $type: null,
525
+ $input: null
526
+ };
527
+ const knowledge_base_files = {
528
+ tableName: 'knowledge_base_files',
529
+ columns: ['knowledge_base_id', 'file_id', 'created_at', 'user_id', 'workspace_id'],
530
+ requiredForInsert: ['knowledge_base_id', 'file_id', 'user_id'],
531
+ primaryKey: 'knowledge_base_id',
532
+ foreignKeys: {
533
+ knowledge_base_id: { table: 'knowledge_bases', column: 'id', $type: null },
534
+ file_id: { table: 'files', column: 'id', $type: null },
535
+ user_id: { table: 'users', column: 'id', $type: null },
536
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
537
+ },
538
+ $type: null,
539
+ $input: null
540
+ };
541
+ const knowledge_bases = {
542
+ tableName: 'knowledge_bases',
543
+ columns: ['id', 'name', 'description', 'avatar', 'type', 'user_id', 'is_public', 'settings', 'created_at', 'updated_at', 'accessed_at', 'client_id', 'workspace_id', 'knowledge_bases_tsv'],
544
+ requiredForInsert: ['id', 'name', 'user_id'],
545
+ primaryKey: 'id',
546
+ foreignKeys: {
547
+ user_id: { table: 'users', column: 'id', $type: null },
548
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
549
+ },
550
+ $type: null,
551
+ $input: null
552
+ };
553
+ const llm_generation_tracing = {
554
+ tableName: 'llm_generation_tracing',
555
+ columns: ['id', 'scenario', 'prompt_version', 'prompt_hash', 'schema_name', 'user_id', 'agent_id', 'topic_id', 'trigger', 'parent_tracing_id', 'provider', 'model', 'success', 'error_code', 'error_detail', 'validation_failed', 'input_hash', 'input_hint', 'latency_ms', 'input_tokens', 'output_tokens', 'cost_usd', 'storage_key', 'feedback_signal', 'feedback_score', 'feedback_source', 'feedback_data', 'feedback_updated_at', 'trace_id', 'span_id', 'metadata', 'created_at', 'workspace_id'],
556
+ requiredForInsert: ['scenario', 'prompt_version', 'prompt_hash', 'user_id', 'success'],
557
+ primaryKey: 'id',
558
+ foreignKeys: { workspace_id: { table: 'workspaces', column: 'id', $type: null }, },
559
+ $type: null,
560
+ $input: null
561
+ };
562
+ const message_chunks = {
563
+ tableName: 'message_chunks',
564
+ columns: ['message_id', 'chunk_id', 'user_id', 'workspace_id'],
565
+ requiredForInsert: ['message_id', 'chunk_id', 'user_id'],
566
+ primaryKey: 'chunk_id',
567
+ foreignKeys: {
568
+ message_id: { table: 'messages', column: 'id', $type: null },
569
+ chunk_id: { table: 'chunks', column: 'id', $type: null },
570
+ user_id: { table: 'users', column: 'id', $type: null },
571
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
572
+ },
573
+ $type: null,
574
+ $input: null
575
+ };
576
+ const message_groups = {
577
+ tableName: 'message_groups',
578
+ columns: ['id', 'topic_id', 'user_id', 'parent_group_id', 'parent_message_id', 'title', 'description', 'client_id', 'accessed_at', 'created_at', 'updated_at', 'type', 'content', 'editor_data', 'metadata', 'workspace_id'],
579
+ requiredForInsert: ['id', 'user_id'],
580
+ primaryKey: 'id',
581
+ foreignKeys: {
582
+ topic_id: { table: 'topics', column: 'id', $type: null },
583
+ user_id: { table: 'users', column: 'id', $type: null },
584
+ parent_group_id: { table: 'message_groups', column: 'id', $type: null },
585
+ parent_message_id: { table: 'messages', column: 'id', $type: null },
586
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
587
+ },
588
+ $type: null,
589
+ $input: null
590
+ };
591
+ const message_plugins = {
592
+ tableName: 'message_plugins',
593
+ columns: ['id', 'tool_call_id', 'type', 'api_name', 'arguments', 'identifier', 'state', 'error', 'user_id', 'client_id', 'intervention', 'workspace_id'],
594
+ requiredForInsert: ['id', 'user_id'],
595
+ primaryKey: 'id',
596
+ foreignKeys: {
597
+ id: { table: 'messages', column: 'id', $type: null },
598
+ user_id: { table: 'users', column: 'id', $type: null },
599
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
600
+ },
601
+ $type: null,
602
+ $input: null
603
+ };
604
+ const message_queries = {
605
+ tableName: 'message_queries',
606
+ columns: ['id', 'message_id', 'rewrite_query', 'user_query', 'embeddings_id', 'user_id', 'client_id', 'workspace_id'],
607
+ requiredForInsert: ['message_id', 'user_id'],
608
+ primaryKey: 'id',
609
+ foreignKeys: {
610
+ message_id: { table: 'messages', column: 'id', $type: null },
611
+ embeddings_id: { table: 'embeddings', column: 'id', $type: null },
612
+ user_id: { table: 'users', column: 'id', $type: null },
613
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
614
+ },
615
+ $type: null,
616
+ $input: null
617
+ };
618
+ const message_query_chunks = {
619
+ tableName: 'message_query_chunks',
620
+ columns: ['id', 'query_id', 'chunk_id', 'similarity', 'user_id', 'workspace_id'],
621
+ requiredForInsert: ['id', 'query_id', 'chunk_id', 'user_id'],
622
+ primaryKey: 'chunk_id',
623
+ foreignKeys: {
624
+ id: { table: 'messages', column: 'id', $type: null },
625
+ query_id: { table: 'message_queries', column: 'id', $type: null },
626
+ chunk_id: { table: 'chunks', column: 'id', $type: null },
627
+ user_id: { table: 'users', column: 'id', $type: null },
628
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
629
+ },
630
+ $type: null,
631
+ $input: null
632
+ };
633
+ const message_translates = {
634
+ tableName: 'message_translates',
635
+ columns: ['id', 'content', 'from', 'to', 'user_id', 'client_id', 'workspace_id'],
636
+ requiredForInsert: ['id', 'user_id'],
637
+ primaryKey: 'id',
638
+ foreignKeys: {
639
+ id: { table: 'messages', column: 'id', $type: null },
640
+ user_id: { table: 'users', column: 'id', $type: null },
641
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
642
+ },
643
+ $type: null,
644
+ $input: null
645
+ };
646
+ const message_tts = {
647
+ tableName: 'message_tts',
648
+ columns: ['id', 'content_md5', 'file_id', 'voice', 'user_id', 'client_id', 'workspace_id'],
649
+ requiredForInsert: ['id', 'user_id'],
650
+ primaryKey: 'id',
651
+ foreignKeys: {
652
+ id: { table: 'messages', column: 'id', $type: null },
653
+ file_id: { table: 'files', column: 'id', $type: null },
654
+ user_id: { table: 'users', column: 'id', $type: null },
655
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
656
+ },
657
+ $type: null,
658
+ $input: null
659
+ };
660
+ const messages = {
661
+ tableName: 'messages',
662
+ columns: ['id', 'role', 'content', 'model', 'provider', 'favorite', 'error', 'tools', 'trace_id', 'observation_id', 'user_id', 'session_id', 'topic_id', 'parent_id', 'quota_id', 'agent_id', 'created_at', 'updated_at', 'client_id', 'accessed_at', 'thread_id', 'reasoning', 'search', 'metadata', 'group_id', 'target_id', 'message_group_id', 'editor_data', 'summary', 'usage', 'workspace_id', 'messages_tsv'],
663
+ requiredForInsert: ['id', 'role', 'user_id'],
664
+ primaryKey: 'id',
665
+ foreignKeys: {
666
+ user_id: { table: 'users', column: 'id', $type: null },
667
+ session_id: { table: 'sessions', column: 'id', $type: null },
668
+ topic_id: { table: 'topics', column: 'id', $type: null },
669
+ parent_id: { table: 'messages', column: 'id', $type: null },
670
+ quota_id: { table: 'messages', column: 'id', $type: null },
671
+ agent_id: { table: 'agents', column: 'id', $type: null },
672
+ thread_id: { table: 'threads', column: 'id', $type: null },
673
+ group_id: { table: 'chat_groups', column: 'id', $type: null },
674
+ message_group_id: { table: 'message_groups', column: 'id', $type: null },
675
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
676
+ },
677
+ $type: null,
678
+ $input: null
679
+ };
680
+ const messages_files = {
681
+ tableName: 'messages_files',
682
+ columns: ['file_id', 'message_id', 'user_id', 'workspace_id'],
683
+ requiredForInsert: ['file_id', 'message_id', 'user_id'],
684
+ primaryKey: 'file_id',
685
+ foreignKeys: {
686
+ file_id: { table: 'files', column: 'id', $type: null },
687
+ message_id: { table: 'messages', column: 'id', $type: null },
688
+ user_id: { table: 'users', column: 'id', $type: null },
689
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
690
+ },
691
+ $type: null,
692
+ $input: null
693
+ };
694
+ const messenger_account_links = {
695
+ tableName: 'messenger_account_links',
696
+ columns: ['id', 'user_id', 'platform', 'tenant_id', 'platform_user_id', 'platform_username', 'active_agent_id', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
697
+ requiredForInsert: ['user_id', 'platform', 'platform_user_id'],
698
+ primaryKey: 'id',
699
+ foreignKeys: {
700
+ user_id: { table: 'users', column: 'id', $type: null },
701
+ active_agent_id: { table: 'agents', column: 'id', $type: null },
702
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
703
+ },
704
+ $type: null,
705
+ $input: null
706
+ };
707
+ const messenger_installations = {
708
+ tableName: 'messenger_installations',
709
+ columns: ['id', 'platform', 'tenant_id', 'application_id', 'account_id', 'credentials', 'metadata', 'token_expires_at', 'installed_by_user_id', 'installed_by_platform_user_id', 'revoked_at', 'accessed_at', 'created_at', 'updated_at'],
710
+ requiredForInsert: ['platform', 'tenant_id', 'application_id', 'credentials'],
711
+ primaryKey: 'id',
712
+ foreignKeys: { installed_by_user_id: { table: 'users', column: 'id', $type: null }, },
713
+ $type: null,
714
+ $input: null
715
+ };
716
+ const nextauth_accounts = {
717
+ tableName: 'nextauth_accounts',
718
+ columns: ['access_token', 'expires_at', 'id_token', 'provider', 'providerAccountId', 'refresh_token', 'scope', 'session_state', 'token_type', 'type', 'user_id'],
719
+ requiredForInsert: ['provider', 'providerAccountId', 'type', 'user_id'],
720
+ primaryKey: 'provider',
721
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
722
+ $type: null,
723
+ $input: null
724
+ };
725
+ const nextauth_authenticators = {
726
+ tableName: 'nextauth_authenticators',
727
+ columns: ['counter', 'credentialBackedUp', 'credentialDeviceType', 'credentialID', 'credentialPublicKey', 'providerAccountId', 'transports', 'user_id'],
728
+ requiredForInsert: ['counter', 'credentialBackedUp', 'credentialDeviceType', 'credentialID', 'credentialPublicKey', 'providerAccountId', 'user_id'],
729
+ primaryKey: 'user_id',
730
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
731
+ $type: null,
732
+ $input: null
733
+ };
734
+ const nextauth_sessions = {
735
+ tableName: 'nextauth_sessions',
736
+ columns: ['expires', 'sessionToken', 'user_id'],
737
+ requiredForInsert: ['expires', 'sessionToken', 'user_id'],
738
+ primaryKey: 'sessionToken',
739
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
740
+ $type: null,
741
+ $input: null
742
+ };
743
+ const nextauth_verificationtokens = {
744
+ tableName: 'nextauth_verificationtokens',
745
+ columns: ['expires', 'identifier', 'token'],
746
+ requiredForInsert: ['expires', 'identifier', 'token'],
747
+ primaryKey: 'identifier',
748
+ foreignKeys: {},
749
+ $type: null,
750
+ $input: null
751
+ };
752
+ const notification_deliveries = {
753
+ tableName: 'notification_deliveries',
754
+ columns: ['id', 'notification_id', 'channel', 'status', 'provider_message_id', 'failed_reason', 'sent_at', 'created_at'],
755
+ requiredForInsert: ['notification_id', 'channel', 'status'],
756
+ primaryKey: 'id',
757
+ foreignKeys: { notification_id: { table: 'notifications', column: 'id', $type: null }, },
758
+ $type: null,
759
+ $input: null
760
+ };
761
+ const notifications = {
762
+ tableName: 'notifications',
763
+ columns: ['id', 'user_id', 'category', 'type', 'title', 'content', 'dedupe_key', 'action_url', 'is_read', 'is_archived', 'created_at', 'updated_at'],
764
+ requiredForInsert: ['user_id', 'category', 'type', 'title', 'content'],
765
+ primaryKey: 'id',
766
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
767
+ $type: null,
768
+ $input: null
769
+ };
770
+ const oauth_handoffs = {
771
+ tableName: 'oauth_handoffs',
772
+ columns: ['id', 'client', 'payload', 'accessed_at', 'created_at', 'updated_at'],
773
+ requiredForInsert: ['id', 'client', 'payload'],
774
+ primaryKey: 'id',
775
+ foreignKeys: {},
776
+ $type: null,
777
+ $input: null
778
+ };
779
+ const oidc_access_tokens = {
780
+ tableName: 'oidc_access_tokens',
781
+ columns: ['id', 'data', 'expires_at', 'consumed_at', 'user_id', 'client_id', 'grant_id', 'accessed_at', 'created_at', 'updated_at'],
782
+ requiredForInsert: ['id', 'data', 'expires_at', 'user_id', 'client_id'],
783
+ primaryKey: 'id',
784
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
785
+ $type: null,
786
+ $input: null
787
+ };
788
+ const oidc_authorization_codes = {
789
+ tableName: 'oidc_authorization_codes',
790
+ columns: ['id', 'data', 'expires_at', 'consumed_at', 'user_id', 'client_id', 'grant_id', 'accessed_at', 'created_at', 'updated_at'],
791
+ requiredForInsert: ['id', 'data', 'expires_at', 'user_id', 'client_id'],
792
+ primaryKey: 'id',
793
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
794
+ $type: null,
795
+ $input: null
796
+ };
797
+ const oidc_clients = {
798
+ tableName: 'oidc_clients',
799
+ columns: ['id', 'name', 'description', 'client_secret', 'redirect_uris', 'grants', 'response_types', 'scopes', 'token_endpoint_auth_method', 'application_type', 'client_uri', 'logo_uri', 'policy_uri', 'tos_uri', 'is_first_party', 'accessed_at', 'created_at', 'updated_at'],
800
+ requiredForInsert: ['id', 'name', 'redirect_uris', 'grants', 'response_types', 'scopes'],
801
+ primaryKey: 'id',
802
+ foreignKeys: {},
803
+ $type: null,
804
+ $input: null
805
+ };
806
+ const oidc_consents = {
807
+ tableName: 'oidc_consents',
808
+ columns: ['user_id', 'client_id', 'scopes', 'expires_at', 'accessed_at', 'created_at', 'updated_at'],
809
+ requiredForInsert: ['user_id', 'client_id', 'scopes'],
810
+ primaryKey: 'user_id',
811
+ foreignKeys: {
812
+ user_id: { table: 'users', column: 'id', $type: null },
813
+ client_id: { table: 'oidc_clients', column: 'id', $type: null },
814
+ },
815
+ $type: null,
816
+ $input: null
817
+ };
818
+ const oidc_device_codes = {
819
+ tableName: 'oidc_device_codes',
820
+ columns: ['id', 'data', 'expires_at', 'consumed_at', 'user_id', 'client_id', 'grant_id', 'user_code', 'accessed_at', 'created_at', 'updated_at'],
821
+ requiredForInsert: ['id', 'data', 'expires_at', 'client_id'],
822
+ primaryKey: 'id',
823
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
824
+ $type: null,
825
+ $input: null
826
+ };
827
+ const oidc_grants = {
828
+ tableName: 'oidc_grants',
829
+ columns: ['id', 'data', 'expires_at', 'consumed_at', 'user_id', 'client_id', 'accessed_at', 'created_at', 'updated_at'],
830
+ requiredForInsert: ['id', 'data', 'expires_at', 'user_id', 'client_id'],
831
+ primaryKey: 'id',
832
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
833
+ $type: null,
834
+ $input: null
835
+ };
836
+ const oidc_interactions = {
837
+ tableName: 'oidc_interactions',
838
+ columns: ['id', 'data', 'expires_at', 'accessed_at', 'created_at', 'updated_at'],
839
+ requiredForInsert: ['id', 'data', 'expires_at'],
840
+ primaryKey: 'id',
841
+ foreignKeys: {},
842
+ $type: null,
843
+ $input: null
844
+ };
845
+ const oidc_refresh_tokens = {
846
+ tableName: 'oidc_refresh_tokens',
847
+ columns: ['id', 'data', 'expires_at', 'consumed_at', 'user_id', 'client_id', 'grant_id', 'accessed_at', 'created_at', 'updated_at'],
848
+ requiredForInsert: ['id', 'data', 'expires_at', 'user_id', 'client_id'],
849
+ primaryKey: 'id',
850
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
851
+ $type: null,
852
+ $input: null
853
+ };
854
+ const oidc_sessions = {
855
+ tableName: 'oidc_sessions',
856
+ columns: ['id', 'data', 'expires_at', 'user_id', 'accessed_at', 'created_at', 'updated_at'],
857
+ requiredForInsert: ['id', 'data', 'expires_at', 'user_id'],
858
+ primaryKey: 'id',
859
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
860
+ $type: null,
861
+ $input: null
862
+ };
863
+ const passkey = {
864
+ tableName: 'passkey',
865
+ columns: ['aaguid', 'backedUp', 'counter', 'createdAt', 'credentialID', 'deviceType', 'id', 'name', 'publicKey', 'transports', 'userId'],
866
+ requiredForInsert: ['credentialID', 'id', 'publicKey', 'userId'],
867
+ primaryKey: 'id',
868
+ foreignKeys: { userId: { table: 'users', column: 'id', $type: null }, },
869
+ $type: null,
870
+ $input: null
871
+ };
872
+ const push_tokens = {
873
+ tableName: 'push_tokens',
874
+ columns: ['id', 'user_id', 'expo_token', 'device_id', 'platform', 'app_version', 'locale', 'created_at', 'last_seen_at'],
875
+ requiredForInsert: ['user_id', 'expo_token', 'device_id', 'platform'],
876
+ primaryKey: 'id',
877
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
878
+ $type: null,
879
+ $input: null
880
+ };
881
+ const rag_eval_dataset_records = {
882
+ tableName: 'rag_eval_dataset_records',
883
+ columns: ['dataset_id', 'ideal', 'question', 'reference_files', 'metadata', 'user_id', 'created_at', 'accessed_at', 'updated_at', 'id', 'workspace_id'],
884
+ requiredForInsert: ['dataset_id', 'id'],
885
+ primaryKey: 'id',
886
+ foreignKeys: {
887
+ dataset_id: { table: 'rag_eval_datasets', column: 'id', $type: null },
888
+ user_id: { table: 'users', column: 'id', $type: null },
889
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
890
+ },
891
+ $type: null,
892
+ $input: null
893
+ };
894
+ const rag_eval_datasets = {
895
+ tableName: 'rag_eval_datasets',
896
+ columns: ['description', 'name', 'knowledge_base_id', 'user_id', 'updated_at', 'created_at', 'accessed_at', 'id', 'workspace_id'],
897
+ requiredForInsert: ['name', 'id'],
898
+ primaryKey: 'id',
899
+ foreignKeys: {
900
+ knowledge_base_id: { table: 'knowledge_bases', column: 'id', $type: null },
901
+ user_id: { table: 'users', column: 'id', $type: null },
902
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
903
+ },
904
+ $type: null,
905
+ $input: null
906
+ };
907
+ const rag_eval_evaluation_records = {
908
+ tableName: 'rag_eval_evaluation_records',
909
+ columns: ['question', 'answer', 'context', 'ideal', 'status', 'error', 'language_model', 'embedding_model', 'question_embedding_id', 'duration', 'dataset_record_id', 'evaluation_id', 'user_id', 'created_at', 'accessed_at', 'updated_at', 'id', 'workspace_id'],
910
+ requiredForInsert: ['question', 'dataset_record_id', 'evaluation_id', 'id'],
911
+ primaryKey: 'id',
912
+ foreignKeys: {
913
+ question_embedding_id: { table: 'embeddings', column: 'id', $type: null },
914
+ user_id: { table: 'users', column: 'id', $type: null },
915
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
916
+ },
917
+ $type: null,
918
+ $input: null
919
+ };
920
+ const rag_eval_evaluations = {
921
+ tableName: 'rag_eval_evaluations',
922
+ columns: ['name', 'description', 'eval_records_url', 'status', 'error', 'dataset_id', 'knowledge_base_id', 'language_model', 'embedding_model', 'user_id', 'created_at', 'updated_at', 'accessed_at', 'id', 'workspace_id'],
923
+ requiredForInsert: ['name', 'dataset_id', 'id'],
924
+ primaryKey: 'id',
925
+ foreignKeys: {
926
+ dataset_id: { table: 'rag_eval_datasets', column: 'id', $type: null },
927
+ knowledge_base_id: { table: 'knowledge_bases', column: 'id', $type: null },
928
+ user_id: { table: 'users', column: 'id', $type: null },
929
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
930
+ },
931
+ $type: null,
932
+ $input: null
933
+ };
934
+ const rbac_permissions = {
935
+ tableName: 'rbac_permissions',
936
+ columns: ['code', 'name', 'description', 'category', 'is_active', 'accessed_at', 'created_at', 'updated_at', 'id'],
937
+ requiredForInsert: ['code', 'name', 'category', 'id'],
938
+ primaryKey: 'id',
939
+ foreignKeys: {},
940
+ $type: null,
941
+ $input: null
942
+ };
943
+ const rbac_role_permissions = {
944
+ tableName: 'rbac_role_permissions',
945
+ columns: ['role_id', 'permission_id', 'created_at'],
946
+ requiredForInsert: ['role_id', 'permission_id'],
947
+ primaryKey: 'role_id',
948
+ foreignKeys: {
949
+ role_id: { table: 'rbac_roles', column: 'id', $type: null },
950
+ permission_id: { table: 'rbac_permissions', column: 'id', $type: null },
951
+ },
952
+ $type: null,
953
+ $input: null
954
+ };
955
+ const rbac_roles = {
956
+ tableName: 'rbac_roles',
957
+ columns: ['name', 'display_name', 'description', 'is_system', 'is_active', 'accessed_at', 'created_at', 'updated_at', 'metadata', 'id', 'workspace_id'],
958
+ requiredForInsert: ['name', 'display_name', 'id'],
959
+ primaryKey: 'id',
960
+ foreignKeys: { workspace_id: { table: 'workspaces', column: 'id', $type: null }, },
961
+ $type: null,
962
+ $input: null
963
+ };
964
+ const rbac_user_roles = {
965
+ tableName: 'rbac_user_roles',
966
+ columns: ['user_id', 'role_id', 'created_at', 'expires_at', 'workspace_id', 'id'],
967
+ requiredForInsert: ['user_id', 'role_id'],
968
+ primaryKey: 'id',
969
+ foreignKeys: {
970
+ user_id: { table: 'users', column: 'id', $type: null },
971
+ role_id: { table: 'rbac_roles', column: 'id', $type: null },
972
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
973
+ },
974
+ $type: null,
975
+ $input: null
976
+ };
977
+ const session_groups = {
978
+ tableName: 'session_groups',
979
+ columns: ['id', 'name', 'sort', 'user_id', 'created_at', 'updated_at', 'client_id', 'accessed_at', 'workspace_id'],
980
+ requiredForInsert: ['id', 'name', 'user_id'],
981
+ primaryKey: 'id',
982
+ foreignKeys: {
983
+ user_id: { table: 'users', column: 'id', $type: null },
984
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
985
+ },
986
+ $type: null,
987
+ $input: null
988
+ };
989
+ const sessions = {
990
+ tableName: 'sessions',
991
+ columns: ['id', 'slug', 'title', 'description', 'avatar', 'background_color', 'type', 'user_id', 'group_id', 'pinned', 'created_at', 'updated_at', 'client_id', 'accessed_at', 'workspace_id'],
992
+ requiredForInsert: ['id', 'slug', 'user_id'],
993
+ primaryKey: 'id',
994
+ foreignKeys: {
995
+ user_id: { table: 'users', column: 'id', $type: null },
996
+ group_id: { table: 'session_groups', column: 'id', $type: null },
997
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
998
+ },
999
+ $type: null,
1000
+ $input: null
1001
+ };
1002
+ const system_bot_providers = {
1003
+ tableName: 'system_bot_providers',
1004
+ columns: ['id', 'platform', 'enabled', 'credentials', 'application_id', 'settings', 'connection_mode', 'accessed_at', 'created_at', 'updated_at'],
1005
+ requiredForInsert: ['platform', 'credentials'],
1006
+ primaryKey: 'id',
1007
+ foreignKeys: {},
1008
+ $type: null,
1009
+ $input: null
1010
+ };
1011
+ const task_comments = {
1012
+ tableName: 'task_comments',
1013
+ columns: ['id', 'task_id', 'user_id', 'author_user_id', 'author_agent_id', 'content', 'editor_data', 'brief_id', 'topic_id', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
1014
+ requiredForInsert: ['id', 'task_id', 'user_id', 'content'],
1015
+ primaryKey: 'id',
1016
+ foreignKeys: {
1017
+ task_id: { table: 'tasks', column: 'id', $type: null },
1018
+ user_id: { table: 'users', column: 'id', $type: null },
1019
+ author_user_id: { table: 'users', column: 'id', $type: null },
1020
+ author_agent_id: { table: 'agents', column: 'id', $type: null },
1021
+ brief_id: { table: 'briefs', column: 'id', $type: null },
1022
+ topic_id: { table: 'topics', column: 'id', $type: null },
1023
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1024
+ },
1025
+ $type: null,
1026
+ $input: null
1027
+ };
1028
+ const task_dependencies = {
1029
+ tableName: 'task_dependencies',
1030
+ columns: ['id', 'task_id', 'depends_on_id', 'user_id', 'type', 'condition', 'created_at', 'workspace_id'],
1031
+ requiredForInsert: ['task_id', 'depends_on_id', 'user_id'],
1032
+ primaryKey: 'id',
1033
+ foreignKeys: {
1034
+ task_id: { table: 'tasks', column: 'id', $type: null },
1035
+ depends_on_id: { table: 'tasks', column: 'id', $type: null },
1036
+ user_id: { table: 'users', column: 'id', $type: null },
1037
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1038
+ },
1039
+ $type: null,
1040
+ $input: null
1041
+ };
1042
+ const task_documents = {
1043
+ tableName: 'task_documents',
1044
+ columns: ['id', 'task_id', 'document_id', 'user_id', 'pinned_by', 'created_at', 'workspace_id'],
1045
+ requiredForInsert: ['task_id', 'document_id', 'user_id'],
1046
+ primaryKey: 'id',
1047
+ foreignKeys: {
1048
+ task_id: { table: 'tasks', column: 'id', $type: null },
1049
+ document_id: { table: 'documents', column: 'id', $type: null },
1050
+ user_id: { table: 'users', column: 'id', $type: null },
1051
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1052
+ },
1053
+ $type: null,
1054
+ $input: null
1055
+ };
1056
+ const task_topics = {
1057
+ tableName: 'task_topics',
1058
+ columns: ['id', 'task_id', 'topic_id', 'user_id', 'seq', 'operation_id', 'status', 'handoff', 'review_passed', 'review_score', 'review_scores', 'review_iteration', 'reviewed_at', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
1059
+ requiredForInsert: ['task_id', 'user_id', 'seq'],
1060
+ primaryKey: 'id',
1061
+ foreignKeys: {
1062
+ task_id: { table: 'tasks', column: 'id', $type: null },
1063
+ topic_id: { table: 'topics', column: 'id', $type: null },
1064
+ user_id: { table: 'users', column: 'id', $type: null },
1065
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1066
+ },
1067
+ $type: null,
1068
+ $input: null
1069
+ };
1070
+ const tasks = {
1071
+ tableName: 'tasks',
1072
+ columns: ['id', 'identifier', 'seq', 'created_by_user_id', 'created_by_agent_id', 'assignee_user_id', 'assignee_agent_id', 'parent_task_id', 'name', 'description', 'instruction', 'status', 'priority', 'sort_order', 'heartbeat_interval', 'heartbeat_timeout', 'last_heartbeat_at', 'schedule_pattern', 'schedule_timezone', 'total_topics', 'max_topics', 'current_topic_id', 'context', 'config', 'error', 'started_at', 'completed_at', 'accessed_at', 'created_at', 'updated_at', 'automation_mode', 'editor_data', 'workspace_id'],
1073
+ requiredForInsert: ['id', 'identifier', 'seq', 'created_by_user_id', 'instruction'],
1074
+ primaryKey: 'id',
1075
+ foreignKeys: {
1076
+ created_by_user_id: { table: 'users', column: 'id', $type: null },
1077
+ created_by_agent_id: { table: 'agents', column: 'id', $type: null },
1078
+ assignee_user_id: { table: 'users', column: 'id', $type: null },
1079
+ assignee_agent_id: { table: 'agents', column: 'id', $type: null },
1080
+ parent_task_id: { table: 'tasks', column: 'id', $type: null },
1081
+ current_topic_id: { table: 'topics', column: 'id', $type: null },
1082
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1083
+ },
1084
+ $type: null,
1085
+ $input: null
1086
+ };
1087
+ const threads = {
1088
+ tableName: 'threads',
1089
+ columns: ['id', 'title', 'type', 'status', 'topic_id', 'source_message_id', 'parent_thread_id', 'user_id', 'last_active_at', 'accessed_at', 'created_at', 'updated_at', 'client_id', 'content', 'editor_data', 'agent_id', 'group_id', 'metadata', 'workspace_id'],
1090
+ requiredForInsert: ['id', 'type', 'topic_id', 'user_id'],
1091
+ primaryKey: 'id',
1092
+ foreignKeys: {
1093
+ topic_id: { table: 'topics', column: 'id', $type: null },
1094
+ parent_thread_id: { table: 'threads', column: 'id', $type: null },
1095
+ user_id: { table: 'users', column: 'id', $type: null },
1096
+ agent_id: { table: 'agents', column: 'id', $type: null },
1097
+ group_id: { table: 'chat_groups', column: 'id', $type: null },
1098
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1099
+ },
1100
+ $type: null,
1101
+ $input: null
1102
+ };
1103
+ const topic_documents = {
1104
+ tableName: 'topic_documents',
1105
+ columns: ['document_id', 'topic_id', 'user_id', 'created_at', 'workspace_id'],
1106
+ requiredForInsert: ['document_id', 'topic_id', 'user_id'],
1107
+ primaryKey: 'document_id',
1108
+ foreignKeys: {
1109
+ document_id: { table: 'documents', column: 'id', $type: null },
1110
+ topic_id: { table: 'topics', column: 'id', $type: null },
1111
+ user_id: { table: 'users', column: 'id', $type: null },
1112
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1113
+ },
1114
+ $type: null,
1115
+ $input: null
1116
+ };
1117
+ const topic_shares = {
1118
+ tableName: 'topic_shares',
1119
+ columns: ['id', 'topic_id', 'user_id', 'visibility', 'page_view_count', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
1120
+ requiredForInsert: ['id', 'topic_id', 'user_id'],
1121
+ primaryKey: 'id',
1122
+ foreignKeys: {
1123
+ topic_id: { table: 'topics', column: 'id', $type: null },
1124
+ user_id: { table: 'users', column: 'id', $type: null },
1125
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1126
+ },
1127
+ $type: null,
1128
+ $input: null
1129
+ };
1130
+ const topics = {
1131
+ tableName: 'topics',
1132
+ columns: ['id', 'session_id', 'user_id', 'favorite', 'title', 'created_at', 'updated_at', 'client_id', 'accessed_at', 'history_summary', 'metadata', 'group_id', 'content', 'editor_data', 'agent_id', 'trigger', 'mode', 'description', 'status', 'completed_at', 'total_cost', 'total_input_tokens', 'total_output_tokens', 'total_tokens', 'cost', 'usage', 'model', 'provider', 'sender_id', 'workspace_id', 'topics_tsv'],
1133
+ requiredForInsert: ['id', 'user_id'],
1134
+ primaryKey: 'id',
1135
+ foreignKeys: {
1136
+ session_id: { table: 'sessions', column: 'id', $type: null },
1137
+ user_id: { table: 'users', column: 'id', $type: null },
1138
+ group_id: { table: 'chat_groups', column: 'id', $type: null },
1139
+ agent_id: { table: 'agents', column: 'id', $type: null },
1140
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1141
+ },
1142
+ $type: null,
1143
+ $input: null
1144
+ };
1145
+ const two_factor = {
1146
+ tableName: 'two_factor',
1147
+ columns: ['backup_codes', 'id', 'secret', 'user_id'],
1148
+ requiredForInsert: ['backup_codes', 'id', 'secret', 'user_id'],
1149
+ primaryKey: 'id',
1150
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
1151
+ $type: null,
1152
+ $input: null
1153
+ };
1154
+ const unstructured_chunks = {
1155
+ tableName: 'unstructured_chunks',
1156
+ columns: ['id', 'text', 'metadata', 'index', 'type', 'created_at', 'updated_at', 'parent_id', 'composite_id', 'user_id', 'file_id', 'accessed_at', 'client_id', 'workspace_id'],
1157
+ requiredForInsert: [],
1158
+ primaryKey: 'id',
1159
+ foreignKeys: {
1160
+ composite_id: { table: 'chunks', column: 'id', $type: null },
1161
+ user_id: { table: 'users', column: 'id', $type: null },
1162
+ file_id: { table: 'files', column: 'id', $type: null },
1163
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1164
+ },
1165
+ $type: null,
1166
+ $input: null
1167
+ };
1168
+ const user_connector_tools = {
1169
+ tableName: 'user_connector_tools',
1170
+ columns: ['id', 'user_connector_id', 'user_id', 'tool_name', 'display_name', 'description', 'input_schema', 'output_schema', 'crud_type', 'render_config', 'permission', 'is_work_artifact', 'work_artifact_config', 'limit_config', 'metadata', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
1171
+ requiredForInsert: ['user_connector_id', 'user_id', 'tool_name', 'crud_type', 'permission'],
1172
+ primaryKey: 'id',
1173
+ foreignKeys: {
1174
+ user_connector_id: { table: 'user_connectors', column: 'id', $type: null },
1175
+ user_id: { table: 'users', column: 'id', $type: null },
1176
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1177
+ },
1178
+ $type: null,
1179
+ $input: null
1180
+ };
1181
+ const user_connectors = {
1182
+ tableName: 'user_connectors',
1183
+ columns: ['id', 'user_id', 'identifier', 'name', 'source_type', 'mcp_server_url', 'mcp_connection_type', 'mcp_stdio_config', 'status', 'is_enabled', 'oidc_config', 'credentials', 'token_expires_at', 'metadata', 'accessed_at', 'created_at', 'updated_at', 'workspace_id'],
1184
+ requiredForInsert: ['user_id', 'identifier', 'name', 'source_type', 'status'],
1185
+ primaryKey: 'id',
1186
+ foreignKeys: {
1187
+ user_id: { table: 'users', column: 'id', $type: null },
1188
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1189
+ },
1190
+ $type: null,
1191
+ $input: null
1192
+ };
1193
+ const user_installed_plugins = {
1194
+ tableName: 'user_installed_plugins',
1195
+ columns: ['user_id', 'identifier', 'type', 'manifest', 'settings', 'custom_params', 'created_at', 'updated_at', 'accessed_at', 'source', 'workspace_id'],
1196
+ requiredForInsert: ['user_id', 'identifier', 'type'],
1197
+ primaryKey: 'user_id',
1198
+ foreignKeys: {
1199
+ user_id: { table: 'users', column: 'id', $type: null },
1200
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1201
+ },
1202
+ $type: null,
1203
+ $input: null
1204
+ };
1205
+ const user_memories = {
1206
+ tableName: 'user_memories',
1207
+ columns: ['id', 'user_id', 'memory_category', 'memory_layer', 'memory_type', 'title', 'summary', 'summary_vector_1024', 'details', 'details_vector_1024', 'status', 'accessed_count', 'last_accessed_at', 'accessed_at', 'created_at', 'updated_at', 'metadata', 'tags', 'captured_at', 'user_memories_tsv'],
1208
+ requiredForInsert: ['id', 'last_accessed_at'],
1209
+ primaryKey: 'id',
1210
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
1211
+ $type: null,
1212
+ $input: null
1213
+ };
1214
+ const user_memories_activities = {
1215
+ tableName: 'user_memories_activities',
1216
+ columns: ['id', 'user_id', 'user_memory_id', 'metadata', 'tags', 'type', 'status', 'timezone', 'starts_at', 'ends_at', 'associated_objects', 'associated_subjects', 'associated_locations', 'notes', 'narrative', 'narrative_vector', 'feedback', 'feedback_vector', 'captured_at', 'accessed_at', 'created_at', 'updated_at', 'user_memories_activities_tsv'],
1217
+ requiredForInsert: ['id', 'type'],
1218
+ primaryKey: 'id',
1219
+ foreignKeys: {
1220
+ user_id: { table: 'users', column: 'id', $type: null },
1221
+ user_memory_id: { table: 'user_memories', column: 'id', $type: null },
1222
+ },
1223
+ $type: null,
1224
+ $input: null
1225
+ };
1226
+ const user_memories_contexts = {
1227
+ tableName: 'user_memories_contexts',
1228
+ columns: ['id', 'user_memory_ids', 'associated_objects', 'associated_subjects', 'title', 'description', 'description_vector', 'type', 'current_status', 'score_impact', 'score_urgency', 'accessed_at', 'created_at', 'updated_at', 'user_id', 'metadata', 'tags', 'captured_at', 'user_memories_contexts_tsv'],
1229
+ requiredForInsert: ['id'],
1230
+ primaryKey: 'id',
1231
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
1232
+ $type: null,
1233
+ $input: null
1234
+ };
1235
+ const user_memories_experiences = {
1236
+ tableName: 'user_memories_experiences',
1237
+ columns: ['id', 'user_memory_id', 'type', 'situation', 'situation_vector', 'reasoning', 'possible_outcome', 'action', 'action_vector', 'key_learning', 'key_learning_vector', 'metadata', 'score_confidence', 'accessed_at', 'created_at', 'updated_at', 'user_id', 'tags', 'captured_at', 'user_memories_experiences_tsv'],
1238
+ requiredForInsert: ['id'],
1239
+ primaryKey: 'id',
1240
+ foreignKeys: {
1241
+ user_memory_id: { table: 'user_memories', column: 'id', $type: null },
1242
+ user_id: { table: 'users', column: 'id', $type: null },
1243
+ },
1244
+ $type: null,
1245
+ $input: null
1246
+ };
1247
+ const user_memories_identities = {
1248
+ tableName: 'user_memories_identities',
1249
+ columns: ['description', 'description_vector', 'id', 'relationship', 'role', 'type', 'user_memory_id', 'accessed_at', 'created_at', 'updated_at', 'user_id', 'metadata', 'tags', 'episodic_date', 'captured_at', 'user_memories_identities_tsv'],
1250
+ requiredForInsert: ['id'],
1251
+ primaryKey: 'id',
1252
+ foreignKeys: {
1253
+ user_memory_id: { table: 'user_memories', column: 'id', $type: null },
1254
+ user_id: { table: 'users', column: 'id', $type: null },
1255
+ },
1256
+ $type: null,
1257
+ $input: null
1258
+ };
1259
+ const user_memories_preferences = {
1260
+ tableName: 'user_memories_preferences',
1261
+ columns: ['id', 'user_memory_id', 'conclusion_directives', 'conclusion_directives_vector', 'type', 'suggestions', 'score_priority', 'accessed_at', 'created_at', 'updated_at', 'user_id', 'metadata', 'tags', 'captured_at', 'user_memories_preferences_tsv'],
1262
+ requiredForInsert: ['id'],
1263
+ primaryKey: 'id',
1264
+ foreignKeys: {
1265
+ user_memory_id: { table: 'user_memories', column: 'id', $type: null },
1266
+ user_id: { table: 'users', column: 'id', $type: null },
1267
+ },
1268
+ $type: null,
1269
+ $input: null
1270
+ };
1271
+ const user_memory_persona_document_histories = {
1272
+ tableName: 'user_memory_persona_document_histories',
1273
+ columns: ['id', 'user_id', 'persona_id', 'profile', 'snapshot_persona', 'snapshot_tagline', 'reasoning', 'diff_persona', 'diff_tagline', 'snapshot', 'summary', 'edited_by', 'memory_ids', 'source_ids', 'metadata', 'previous_version', 'next_version', 'captured_at', 'accessed_at', 'created_at', 'updated_at'],
1274
+ requiredForInsert: ['id'],
1275
+ primaryKey: 'id',
1276
+ foreignKeys: {
1277
+ user_id: { table: 'users', column: 'id', $type: null },
1278
+ persona_id: { table: 'user_memory_persona_documents', column: 'id', $type: null },
1279
+ },
1280
+ $type: null,
1281
+ $input: null
1282
+ };
1283
+ const user_memory_persona_documents = {
1284
+ tableName: 'user_memory_persona_documents',
1285
+ columns: ['id', 'user_id', 'profile', 'tagline', 'persona', 'memory_ids', 'source_ids', 'metadata', 'version', 'captured_at', 'accessed_at', 'created_at', 'updated_at', 'user_memory_persona_documents_tsv'],
1286
+ requiredForInsert: ['id'],
1287
+ primaryKey: 'id',
1288
+ foreignKeys: { user_id: { table: 'users', column: 'id', $type: null }, },
1289
+ $type: null,
1290
+ $input: null
1291
+ };
1292
+ const user_settings = {
1293
+ tableName: 'user_settings',
1294
+ columns: ['id', 'tts', 'key_vaults', 'general', 'language_model', 'system_agent', 'default_agent', 'tool', 'hotkey', 'image', 'market', 'memory', 'notification'],
1295
+ requiredForInsert: ['id'],
1296
+ primaryKey: 'id',
1297
+ foreignKeys: { id: { table: 'users', column: 'id', $type: null }, },
1298
+ $type: null,
1299
+ $input: null
1300
+ };
1301
+ const users = {
1302
+ tableName: 'users',
1303
+ columns: ['id', 'username', 'email', 'avatar', 'phone', 'first_name', 'last_name', 'is_onboarded', 'clerk_created_at', 'preference', 'created_at', 'updated_at', 'full_name', 'email_verified_at', 'accessed_at', 'email_verified', 'role', 'banned', 'ban_reason', 'ban_expires', 'two_factor_enabled', 'phone_number_verified', 'normalized_email', 'last_active_at', 'interests', 'onboarding', 'agent_onboarding'],
1304
+ requiredForInsert: ['id'],
1305
+ primaryKey: 'id',
1306
+ foreignKeys: {},
1307
+ $type: null,
1308
+ $input: null
1309
+ };
1310
+ const verifications = {
1311
+ tableName: 'verifications',
1312
+ columns: ['created_at', 'expires_at', 'id', 'identifier', 'updated_at', 'value'],
1313
+ requiredForInsert: ['expires_at', 'id', 'identifier', 'value'],
1314
+ primaryKey: 'id',
1315
+ foreignKeys: {},
1316
+ $type: null,
1317
+ $input: null
1318
+ };
1319
+ const verify_check_results = {
1320
+ tableName: 'verify_check_results',
1321
+ columns: ['id', 'operation_id', 'user_id', 'workspace_id', 'check_item_id', 'check_item_title', 'required', 'check_item_index', 'verifier_type', 'verifier_config_hash', 'verifier_operation_id', 'verifier_tracing_id', 'status', 'verdict', 'confidence', 'toulmin', 'suggestion', 'user_decision', 'is_false_positive', 'is_false_negative', 'repair_operation_id', 'started_at', 'completed_at', 'created_at'],
1322
+ requiredForInsert: ['operation_id', 'user_id', 'check_item_id', 'verifier_type'],
1323
+ primaryKey: 'id',
1324
+ foreignKeys: {
1325
+ operation_id: { table: 'agent_operations', column: 'id', $type: null },
1326
+ user_id: { table: 'users', column: 'id', $type: null },
1327
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1328
+ verifier_operation_id: { table: 'agent_operations', column: 'id', $type: null },
1329
+ verifier_tracing_id: { table: 'llm_generation_tracing', column: 'id', $type: null },
1330
+ repair_operation_id: { table: 'agent_operations', column: 'id', $type: null },
1331
+ },
1332
+ $type: null,
1333
+ $input: null
1334
+ };
1335
+ const verify_criteria = {
1336
+ tableName: 'verify_criteria',
1337
+ columns: ['id', 'user_id', 'title', 'description', 'required', 'verifier_type', 'verifier_config', 'on_fail', 'document_id', 'workspace_id', 'accessed_at', 'created_at', 'updated_at'],
1338
+ requiredForInsert: ['user_id', 'title', 'verifier_type'],
1339
+ primaryKey: 'id',
1340
+ foreignKeys: {
1341
+ user_id: { table: 'users', column: 'id', $type: null },
1342
+ document_id: { table: 'documents', column: 'id', $type: null },
1343
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1344
+ },
1345
+ $type: null,
1346
+ $input: null
1347
+ };
1348
+ const verify_rubric_criteria = {
1349
+ tableName: 'verify_rubric_criteria',
1350
+ columns: ['rubric_id', 'criterion_id', 'user_id', 'workspace_id', 'sort_order', 'created_at'],
1351
+ requiredForInsert: ['rubric_id', 'criterion_id', 'user_id'],
1352
+ primaryKey: 'rubric_id',
1353
+ foreignKeys: {
1354
+ rubric_id: { table: 'verify_rubrics', column: 'id', $type: null },
1355
+ criterion_id: { table: 'verify_criteria', column: 'id', $type: null },
1356
+ user_id: { table: 'users', column: 'id', $type: null },
1357
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1358
+ },
1359
+ $type: null,
1360
+ $input: null
1361
+ };
1362
+ const verify_rubrics = {
1363
+ tableName: 'verify_rubrics',
1364
+ columns: ['id', 'user_id', 'title', 'description', 'config', 'workspace_id', 'accessed_at', 'created_at', 'updated_at'],
1365
+ requiredForInsert: ['user_id', 'title'],
1366
+ primaryKey: 'id',
1367
+ foreignKeys: {
1368
+ user_id: { table: 'users', column: 'id', $type: null },
1369
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1370
+ },
1371
+ $type: null,
1372
+ $input: null
1373
+ };
1374
+ const workspace_audit_logs = {
1375
+ tableName: 'workspace_audit_logs',
1376
+ columns: ['id', 'workspace_id', 'user_id', 'action', 'resource_type', 'resource_id', 'metadata', 'ip_address', 'created_at'],
1377
+ requiredForInsert: ['id', 'workspace_id', 'action'],
1378
+ primaryKey: 'id',
1379
+ foreignKeys: { workspace_id: { table: 'workspaces', column: 'id', $type: null }, },
1380
+ $type: null,
1381
+ $input: null
1382
+ };
1383
+ const workspace_invitations = {
1384
+ tableName: 'workspace_invitations',
1385
+ columns: ['id', 'workspace_id', 'inviter_id', 'email', 'role', 'token', 'status', 'expires_at', 'created_at', 'updated_at'],
1386
+ requiredForInsert: ['id', 'workspace_id', 'inviter_id', 'token', 'expires_at'],
1387
+ primaryKey: 'id',
1388
+ foreignKeys: {
1389
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1390
+ inviter_id: { table: 'users', column: 'id', $type: null },
1391
+ },
1392
+ $type: null,
1393
+ $input: null
1394
+ };
1395
+ const workspace_members = {
1396
+ tableName: 'workspace_members',
1397
+ columns: ['workspace_id', 'user_id', 'role', 'joined_at', 'updated_at', 'deleted_at'],
1398
+ requiredForInsert: ['workspace_id', 'user_id'],
1399
+ primaryKey: 'workspace_id',
1400
+ foreignKeys: {
1401
+ workspace_id: { table: 'workspaces', column: 'id', $type: null },
1402
+ user_id: { table: 'users', column: 'id', $type: null },
1403
+ },
1404
+ $type: null,
1405
+ $input: null
1406
+ };
1407
+ const workspaces = {
1408
+ tableName: 'workspaces',
1409
+ columns: ['id', 'slug', 'name', 'description', 'avatar', 'primary_owner_id', 'settings', 'created_at', 'updated_at'],
1410
+ requiredForInsert: ['id', 'slug', 'name', 'primary_owner_id'],
1411
+ primaryKey: 'id',
1412
+ foreignKeys: { primary_owner_id: { table: 'users', column: 'id', $type: null }, },
1413
+ $type: null,
1414
+ $input: null
1415
+ };
1416
+ export const tables = {
1417
+ accounts,
1418
+ agent_bot_providers,
1419
+ agent_cron_jobs,
1420
+ agent_documents,
1421
+ agent_eval_benchmarks,
1422
+ agent_eval_datasets,
1423
+ agent_eval_experiment_benchmarks,
1424
+ agent_eval_experiments,
1425
+ agent_eval_run_topics,
1426
+ agent_eval_runs,
1427
+ agent_eval_test_cases,
1428
+ agent_operations,
1429
+ agent_shares,
1430
+ agent_skills,
1431
+ agents,
1432
+ agents_files,
1433
+ agents_knowledge_bases,
1434
+ agents_to_sessions,
1435
+ ai_models,
1436
+ ai_providers,
1437
+ api_keys,
1438
+ async_tasks,
1439
+ auth_sessions,
1440
+ briefs,
1441
+ chat_groups,
1442
+ chat_groups_agents,
1443
+ chunks,
1444
+ devices,
1445
+ document_chunks,
1446
+ document_histories,
1447
+ document_shares,
1448
+ documents,
1449
+ embeddings,
1450
+ file_chunks,
1451
+ files,
1452
+ files_to_sessions,
1453
+ generation_batches,
1454
+ generation_topics,
1455
+ generations,
1456
+ global_files,
1457
+ knowledge_base_files,
1458
+ knowledge_bases,
1459
+ llm_generation_tracing,
1460
+ message_chunks,
1461
+ message_groups,
1462
+ message_plugins,
1463
+ message_queries,
1464
+ message_query_chunks,
1465
+ message_translates,
1466
+ message_tts,
1467
+ messages,
1468
+ messages_files,
1469
+ messenger_account_links,
1470
+ messenger_installations,
1471
+ nextauth_accounts,
1472
+ nextauth_authenticators,
1473
+ nextauth_sessions,
1474
+ nextauth_verificationtokens,
1475
+ notification_deliveries,
1476
+ notifications,
1477
+ oauth_handoffs,
1478
+ oidc_access_tokens,
1479
+ oidc_authorization_codes,
1480
+ oidc_clients,
1481
+ oidc_consents,
1482
+ oidc_device_codes,
1483
+ oidc_grants,
1484
+ oidc_interactions,
1485
+ oidc_refresh_tokens,
1486
+ oidc_sessions,
1487
+ passkey,
1488
+ push_tokens,
1489
+ rag_eval_dataset_records,
1490
+ rag_eval_datasets,
1491
+ rag_eval_evaluation_records,
1492
+ rag_eval_evaluations,
1493
+ rbac_permissions,
1494
+ rbac_role_permissions,
1495
+ rbac_roles,
1496
+ rbac_user_roles,
1497
+ session_groups,
1498
+ sessions,
1499
+ system_bot_providers,
1500
+ task_comments,
1501
+ task_dependencies,
1502
+ task_documents,
1503
+ task_topics,
1504
+ tasks,
1505
+ threads,
1506
+ topic_documents,
1507
+ topic_shares,
1508
+ topics,
1509
+ two_factor,
1510
+ unstructured_chunks,
1511
+ user_connector_tools,
1512
+ user_connectors,
1513
+ user_installed_plugins,
1514
+ user_memories,
1515
+ user_memories_activities,
1516
+ user_memories_contexts,
1517
+ user_memories_experiences,
1518
+ user_memories_identities,
1519
+ user_memories_preferences,
1520
+ user_memory_persona_document_histories,
1521
+ user_memory_persona_documents,
1522
+ user_settings,
1523
+ users,
1524
+ verifications,
1525
+ verify_check_results,
1526
+ verify_criteria,
1527
+ verify_rubric_criteria,
1528
+ verify_rubrics,
1529
+ workspace_audit_logs,
1530
+ workspace_invitations,
1531
+ workspace_members,
1532
+ workspaces,
1533
+ };
1534
+ //# sourceMappingURL=lobehub-types.js.map