@alvax-ai/db 0.1.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 (304) hide show
  1. package/dist/check-migration-numbering.d.ts +2 -0
  2. package/dist/check-migration-numbering.d.ts.map +1 -0
  3. package/dist/check-migration-numbering.js +64 -0
  4. package/dist/check-migration-numbering.js.map +1 -0
  5. package/dist/client.d.ts +33 -0
  6. package/dist/client.d.ts.map +1 -0
  7. package/dist/client.js +382 -0
  8. package/dist/client.js.map +1 -0
  9. package/dist/embedded-postgres-error.d.ts +9 -0
  10. package/dist/embedded-postgres-error.d.ts.map +1 -0
  11. package/dist/embedded-postgres-error.js +73 -0
  12. package/dist/embedded-postgres-error.js.map +1 -0
  13. package/dist/index.d.ts +6 -0
  14. package/dist/index.d.ts.map +1 -0
  15. package/dist/index.js +6 -0
  16. package/dist/index.js.map +1 -0
  17. package/dist/migrate.d.ts +2 -0
  18. package/dist/migrate.d.ts.map +1 -0
  19. package/dist/migrate.js +25 -0
  20. package/dist/migrate.js.map +1 -0
  21. package/dist/migration-runtime.d.ts +7 -0
  22. package/dist/migration-runtime.d.ts.map +1 -0
  23. package/dist/migration-runtime.js +164 -0
  24. package/dist/migration-runtime.js.map +1 -0
  25. package/dist/migrations/0000_solid_sir_ram.sql +21 -0
  26. package/dist/migrations/0001_goofy_reavers.sql +185 -0
  27. package/dist/migrations/0002_majestic_vanisher.sql +188 -0
  28. package/dist/migrations/0003_narrow_kabuki.sql +58 -0
  29. package/dist/migrations/0004_stormy_vapor.sql +65 -0
  30. package/dist/migrations/0005_public_blade.sql +59 -0
  31. package/dist/migrations/0006_clean_firestar.sql +52 -0
  32. package/dist/migrations/0007_modern_wilson_fisk.sql +22 -0
  33. package/dist/migrations/0008_slim_beyonder.sql +20 -0
  34. package/dist/migrations/0009_minor_charles_xavier.sql +108 -0
  35. package/dist/migrations/0010_glamorous_tusk.sql +37 -0
  36. package/dist/migrations/0011_neat_mystique.sql +120 -0
  37. package/dist/migrations/0012_clumsy_dazzler.sql +36 -0
  38. package/dist/migrations/0013_perfect_ares.sql +96 -0
  39. package/dist/migrations/0014_overjoyed_hitman.sql +1 -0
  40. package/dist/migrations/0015_graceful_ultimo.sql +43 -0
  41. package/dist/migrations/0016_far_reavers.sql +68 -0
  42. package/dist/migrations/0017_lame_sauron.sql +34 -0
  43. package/dist/migrations/0018_ambiguous_master_mold.sql +51 -0
  44. package/dist/migrations/0019_material_joshua_kane.sql +15 -0
  45. package/dist/migrations/0020_mature_jack_murdock.sql +3 -0
  46. package/dist/migrations/0021_safe_vulture.sql +2 -0
  47. package/dist/migrations/0022_bumpy_wrecker.sql +73 -0
  48. package/dist/migrations/0023_tan_bruce_banner.sql +1 -0
  49. package/dist/migrations/0024_moaning_guardsmen.sql +44 -0
  50. package/dist/migrations/meta/0000_snapshot.json +162 -0
  51. package/dist/migrations/meta/0001_snapshot.json +1761 -0
  52. package/dist/migrations/meta/0002_snapshot.json +3466 -0
  53. package/dist/migrations/meta/0003_snapshot.json +4003 -0
  54. package/dist/migrations/meta/0004_snapshot.json +4628 -0
  55. package/dist/migrations/meta/0005_snapshot.json +5156 -0
  56. package/dist/migrations/meta/0006_snapshot.json +5613 -0
  57. package/dist/migrations/meta/0007_snapshot.json +5786 -0
  58. package/dist/migrations/meta/0008_snapshot.json +5966 -0
  59. package/dist/migrations/meta/0009_snapshot.json +6944 -0
  60. package/dist/migrations/meta/0010_snapshot.json +7243 -0
  61. package/dist/migrations/meta/0011_snapshot.json +8324 -0
  62. package/dist/migrations/meta/0012_snapshot.json +8647 -0
  63. package/dist/migrations/meta/0013_snapshot.json +9448 -0
  64. package/dist/migrations/meta/0014_snapshot.json +9455 -0
  65. package/dist/migrations/meta/0015_snapshot.json +9845 -0
  66. package/dist/migrations/meta/0016_snapshot.json +10457 -0
  67. package/dist/migrations/meta/0017_snapshot.json +10802 -0
  68. package/dist/migrations/meta/0018_snapshot.json +11289 -0
  69. package/dist/migrations/meta/0019_snapshot.json +11425 -0
  70. package/dist/migrations/meta/0020_snapshot.json +11445 -0
  71. package/dist/migrations/meta/0021_snapshot.json +11459 -0
  72. package/dist/migrations/meta/0022_snapshot.json +12063 -0
  73. package/dist/migrations/meta/0023_snapshot.json +12069 -0
  74. package/dist/migrations/meta/0024_snapshot.json +12524 -0
  75. package/dist/migrations/meta/_journal.json +181 -0
  76. package/dist/runtime-config.d.ts +11 -0
  77. package/dist/runtime-config.d.ts.map +1 -0
  78. package/dist/runtime-config.js +56 -0
  79. package/dist/runtime-config.js.map +1 -0
  80. package/dist/schema/activity_log.d.ts +197 -0
  81. package/dist/schema/activity_log.d.ts.map +1 -0
  82. package/dist/schema/activity_log.js +24 -0
  83. package/dist/schema/activity_log.js.map +1 -0
  84. package/dist/schema/agent_runtime_state.d.ts +248 -0
  85. package/dist/schema/agent_runtime_state.d.ts.map +1 -0
  86. package/dist/schema/agent_runtime_state.js +23 -0
  87. package/dist/schema/agent_runtime_state.js.map +1 -0
  88. package/dist/schema/agent_task_sessions.d.ts +197 -0
  89. package/dist/schema/agent_task_sessions.d.ts.map +1 -0
  90. package/dist/schema/agent_task_sessions.js +22 -0
  91. package/dist/schema/agent_task_sessions.js.map +1 -0
  92. package/dist/schema/agent_wakeup_requests.d.ts +333 -0
  93. package/dist/schema/agent_wakeup_requests.d.ts.map +1 -0
  94. package/dist/schema/agent_wakeup_requests.js +29 -0
  95. package/dist/schema/agent_wakeup_requests.js.map +1 -0
  96. package/dist/schema/agents.d.ts +390 -0
  97. package/dist/schema/agents.d.ts.map +1 -0
  98. package/dist/schema/agents.js +32 -0
  99. package/dist/schema/agents.js.map +1 -0
  100. package/dist/schema/approval_comments.d.ts +144 -0
  101. package/dist/schema/approval_comments.d.ts.map +1 -0
  102. package/dist/schema/approval_comments.js +19 -0
  103. package/dist/schema/approval_comments.js.map +1 -0
  104. package/dist/schema/approvals.d.ts +214 -0
  105. package/dist/schema/approvals.d.ts.map +1 -0
  106. package/dist/schema/approvals.js +20 -0
  107. package/dist/schema/approvals.js.map +1 -0
  108. package/dist/schema/assets.d.ts +212 -0
  109. package/dist/schema/assets.d.ts.map +1 -0
  110. package/dist/schema/assets.js +23 -0
  111. package/dist/schema/assets.js.map +1 -0
  112. package/dist/schema/budget_incidents.d.ts +297 -0
  113. package/dist/schema/budget_incidents.d.ts.map +1 -0
  114. package/dist/schema/budget_incidents.js +29 -0
  115. package/dist/schema/budget_incidents.js.map +1 -0
  116. package/dist/schema/budget_policies.d.ts +263 -0
  117. package/dist/schema/budget_policies.d.ts.map +1 -0
  118. package/dist/schema/budget_policies.js +24 -0
  119. package/dist/schema/budget_policies.js.map +1 -0
  120. package/dist/schema/command_context_summaries.d.ts +127 -0
  121. package/dist/schema/command_context_summaries.d.ts.map +1 -0
  122. package/dist/schema/command_context_summaries.js +16 -0
  123. package/dist/schema/command_context_summaries.js.map +1 -0
  124. package/dist/schema/command_messages.d.ts +163 -0
  125. package/dist/schema/command_messages.d.ts.map +1 -0
  126. package/dist/schema/command_messages.js +20 -0
  127. package/dist/schema/command_messages.js.map +1 -0
  128. package/dist/schema/command_threads.d.ts +127 -0
  129. package/dist/schema/command_threads.d.ts.map +1 -0
  130. package/dist/schema/command_threads.js +14 -0
  131. package/dist/schema/command_threads.js.map +1 -0
  132. package/dist/schema/companies.d.ts +301 -0
  133. package/dist/schema/companies.d.ts.map +1 -0
  134. package/dist/schema/companies.js +27 -0
  135. package/dist/schema/companies.js.map +1 -0
  136. package/dist/schema/company_profile_setup_messages.d.ts +171 -0
  137. package/dist/schema/company_profile_setup_messages.d.ts.map +1 -0
  138. package/dist/schema/company_profile_setup_messages.js +18 -0
  139. package/dist/schema/company_profile_setup_messages.js.map +1 -0
  140. package/dist/schema/company_profile_setup_runs.d.ts +234 -0
  141. package/dist/schema/company_profile_setup_runs.d.ts.map +1 -0
  142. package/dist/schema/company_profile_setup_runs.js +22 -0
  143. package/dist/schema/company_profile_setup_runs.js.map +1 -0
  144. package/dist/schema/company_profile_setup_sessions.d.ts +179 -0
  145. package/dist/schema/company_profile_setup_sessions.d.ts.map +1 -0
  146. package/dist/schema/company_profile_setup_sessions.js +18 -0
  147. package/dist/schema/company_profile_setup_sessions.js.map +1 -0
  148. package/dist/schema/company_profiles.d.ts +291 -0
  149. package/dist/schema/company_profiles.d.ts.map +1 -0
  150. package/dist/schema/company_profiles.js +24 -0
  151. package/dist/schema/company_profiles.js.map +1 -0
  152. package/dist/schema/company_runtime_adapter_checks.d.ts +206 -0
  153. package/dist/schema/company_runtime_adapter_checks.d.ts.map +1 -0
  154. package/dist/schema/company_runtime_adapter_checks.js +19 -0
  155. package/dist/schema/company_runtime_adapter_checks.js.map +1 -0
  156. package/dist/schema/company_runtime_profiles.d.ts +165 -0
  157. package/dist/schema/company_runtime_profiles.d.ts.map +1 -0
  158. package/dist/schema/company_runtime_profiles.js +18 -0
  159. package/dist/schema/company_runtime_profiles.js.map +1 -0
  160. package/dist/schema/company_secret_versions.d.ts +163 -0
  161. package/dist/schema/company_secret_versions.d.ts.map +1 -0
  162. package/dist/schema/company_secret_versions.js +19 -0
  163. package/dist/schema/company_secret_versions.js.map +1 -0
  164. package/dist/schema/company_secrets.d.ts +195 -0
  165. package/dist/schema/company_secrets.d.ts.map +1 -0
  166. package/dist/schema/company_secrets.js +21 -0
  167. package/dist/schema/company_secrets.js.map +1 -0
  168. package/dist/schema/company_skills.d.ts +284 -0
  169. package/dist/schema/company_skills.d.ts.map +1 -0
  170. package/dist/schema/company_skills.js +24 -0
  171. package/dist/schema/company_skills.js.map +1 -0
  172. package/dist/schema/cost_events.d.ts +314 -0
  173. package/dist/schema/cost_events.d.ts.map +1 -0
  174. package/dist/schema/cost_events.js +34 -0
  175. package/dist/schema/cost_events.js.map +1 -0
  176. package/dist/schema/document_revisions.d.ts +212 -0
  177. package/dist/schema/document_revisions.d.ts.map +1 -0
  178. package/dist/schema/document_revisions.js +23 -0
  179. package/dist/schema/document_revisions.js.map +1 -0
  180. package/dist/schema/documents.d.ts +229 -0
  181. package/dist/schema/documents.d.ts.map +1 -0
  182. package/dist/schema/documents.js +22 -0
  183. package/dist/schema/documents.js.map +1 -0
  184. package/dist/schema/environments.d.ts +182 -0
  185. package/dist/schema/environments.d.ts.map +1 -0
  186. package/dist/schema/environments.js +22 -0
  187. package/dist/schema/environments.js.map +1 -0
  188. package/dist/schema/execution_workspaces.d.ts +418 -0
  189. package/dist/schema/execution_workspaces.d.ts.map +1 -0
  190. package/dist/schema/execution_workspaces.js +38 -0
  191. package/dist/schema/execution_workspaces.js.map +1 -0
  192. package/dist/schema/goals.d.ts +178 -0
  193. package/dist/schema/goals.d.ts.map +1 -0
  194. package/dist/schema/goals.js +18 -0
  195. package/dist/schema/goals.js.map +1 -0
  196. package/dist/schema/heartbeat_run_events.d.ts +214 -0
  197. package/dist/schema/heartbeat_run_events.d.ts.map +1 -0
  198. package/dist/schema/heartbeat_run_events.js +23 -0
  199. package/dist/schema/heartbeat_run_events.js.map +1 -0
  200. package/dist/schema/heartbeat_runs.d.ts +830 -0
  201. package/dist/schema/heartbeat_runs.d.ts.map +1 -0
  202. package/dist/schema/heartbeat_runs.js +62 -0
  203. package/dist/schema/heartbeat_runs.js.map +1 -0
  204. package/dist/schema/inbox_dismissals.d.ts +127 -0
  205. package/dist/schema/inbox_dismissals.d.ts.map +1 -0
  206. package/dist/schema/inbox_dismissals.js +16 -0
  207. package/dist/schema/inbox_dismissals.js.map +1 -0
  208. package/dist/schema/index.d.ts +56 -0
  209. package/dist/schema/index.d.ts.map +1 -0
  210. package/dist/schema/index.js +56 -0
  211. package/dist/schema/index.js.map +1 -0
  212. package/dist/schema/issue_approvals.d.ts +110 -0
  213. package/dist/schema/issue_approvals.d.ts.map +1 -0
  214. package/dist/schema/issue_approvals.js +19 -0
  215. package/dist/schema/issue_approvals.js.map +1 -0
  216. package/dist/schema/issue_comments.d.ts +216 -0
  217. package/dist/schema/issue_comments.d.ts.map +1 -0
  218. package/dist/schema/issue_comments.js +25 -0
  219. package/dist/schema/issue_comments.js.map +1 -0
  220. package/dist/schema/issue_documents.d.ts +127 -0
  221. package/dist/schema/issue_documents.d.ts.map +1 -0
  222. package/dist/schema/issue_documents.js +18 -0
  223. package/dist/schema/issue_documents.js.map +1 -0
  224. package/dist/schema/issue_inbox_archives.d.ts +127 -0
  225. package/dist/schema/issue_inbox_archives.d.ts.map +1 -0
  226. package/dist/schema/issue_inbox_archives.js +17 -0
  227. package/dist/schema/issue_inbox_archives.js.map +1 -0
  228. package/dist/schema/issue_read_states.d.ts +127 -0
  229. package/dist/schema/issue_read_states.d.ts.map +1 -0
  230. package/dist/schema/issue_read_states.js +17 -0
  231. package/dist/schema/issue_read_states.js.map +1 -0
  232. package/dist/schema/issue_relations.d.ts +163 -0
  233. package/dist/schema/issue_relations.d.ts.map +1 -0
  234. package/dist/schema/issue_relations.js +21 -0
  235. package/dist/schema/issue_relations.js.map +1 -0
  236. package/dist/schema/issue_thread_interactions.d.ts +352 -0
  237. package/dist/schema/issue_thread_interactions.d.ts.map +1 -0
  238. package/dist/schema/issue_thread_interactions.js +38 -0
  239. package/dist/schema/issue_thread_interactions.js.map +1 -0
  240. package/dist/schema/issue_tree_hold_members.d.ts +280 -0
  241. package/dist/schema/issue_tree_hold_members.d.ts.map +1 -0
  242. package/dist/schema/issue_tree_hold_members.js +29 -0
  243. package/dist/schema/issue_tree_hold_members.js.map +1 -0
  244. package/dist/schema/issue_tree_holds.d.ts +352 -0
  245. package/dist/schema/issue_tree_holds.d.ts.map +1 -0
  246. package/dist/schema/issue_tree_holds.js +31 -0
  247. package/dist/schema/issue_tree_holds.js.map +1 -0
  248. package/dist/schema/issue_work_products.d.ts +350 -0
  249. package/dist/schema/issue_work_products.d.ts.map +1 -0
  250. package/dist/schema/issue_work_products.js +33 -0
  251. package/dist/schema/issue_work_products.js.map +1 -0
  252. package/dist/schema/issues.d.ts +781 -0
  253. package/dist/schema/issues.d.ts.map +1 -0
  254. package/dist/schema/issues.js +104 -0
  255. package/dist/schema/issues.js.map +1 -0
  256. package/dist/schema/knowledge_data_table_columns.d.ts +280 -0
  257. package/dist/schema/knowledge_data_table_columns.d.ts.map +1 -0
  258. package/dist/schema/knowledge_data_table_columns.js +37 -0
  259. package/dist/schema/knowledge_data_table_columns.js.map +1 -0
  260. package/dist/schema/knowledge_data_table_rows.d.ts +214 -0
  261. package/dist/schema/knowledge_data_table_rows.d.ts.map +1 -0
  262. package/dist/schema/knowledge_data_table_rows.js +27 -0
  263. package/dist/schema/knowledge_data_table_rows.js.map +1 -0
  264. package/dist/schema/knowledge_data_tables.d.ts +212 -0
  265. package/dist/schema/knowledge_data_tables.d.ts.map +1 -0
  266. package/dist/schema/knowledge_data_tables.js +25 -0
  267. package/dist/schema/knowledge_data_tables.js.map +1 -0
  268. package/dist/schema/knowledge_documents.d.ts +231 -0
  269. package/dist/schema/knowledge_documents.d.ts.map +1 -0
  270. package/dist/schema/knowledge_documents.js +29 -0
  271. package/dist/schema/knowledge_documents.js.map +1 -0
  272. package/dist/schema/project_goals.d.ts +93 -0
  273. package/dist/schema/project_goals.d.ts.map +1 -0
  274. package/dist/schema/project_goals.js +17 -0
  275. package/dist/schema/project_goals.js.map +1 -0
  276. package/dist/schema/project_workspaces.d.ts +333 -0
  277. package/dist/schema/project_workspaces.d.ts.map +1 -0
  278. package/dist/schema/project_workspaces.js +31 -0
  279. package/dist/schema/project_workspaces.js.map +1 -0
  280. package/dist/schema/projects.d.ts +284 -0
  281. package/dist/schema/projects.d.ts.map +1 -0
  282. package/dist/schema/projects.js +25 -0
  283. package/dist/schema/projects.js.map +1 -0
  284. package/dist/schema/routines.d.ts +1277 -0
  285. package/dist/schema/routines.d.ts.map +1 -0
  286. package/dist/schema/routines.js +108 -0
  287. package/dist/schema/routines.js.map +1 -0
  288. package/dist/schema/system_assistant_run_events.d.ts +180 -0
  289. package/dist/schema/system_assistant_run_events.d.ts.map +1 -0
  290. package/dist/schema/system_assistant_run_events.js +19 -0
  291. package/dist/schema/system_assistant_run_events.js.map +1 -0
  292. package/dist/schema/system_assistant_runs.d.ts +195 -0
  293. package/dist/schema/system_assistant_runs.d.ts.map +1 -0
  294. package/dist/schema/system_assistant_runs.js +23 -0
  295. package/dist/schema/system_assistant_runs.js.map +1 -0
  296. package/dist/schema/workspace_operations.d.ts +367 -0
  297. package/dist/schema/workspace_operations.d.ts.map +1 -0
  298. package/dist/schema/workspace_operations.js +35 -0
  299. package/dist/schema/workspace_operations.js.map +1 -0
  300. package/dist/schema/workspace_runtime_services.d.ts +469 -0
  301. package/dist/schema/workspace_runtime_services.d.ts.map +1 -0
  302. package/dist/schema/workspace_runtime_services.js +46 -0
  303. package/dist/schema/workspace_runtime_services.js.map +1 -0
  304. package/package.json +56 -0
@@ -0,0 +1,4003 @@
1
+ {
2
+ "id": "dbe97cd5-b07f-4cd2-88a9-f2c89d1408ee",
3
+ "prevId": "a666d6cd-9dfc-401b-a66f-674219ebab28",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.agent_runtime_state": {
8
+ "name": "agent_runtime_state",
9
+ "schema": "",
10
+ "columns": {
11
+ "agent_id": {
12
+ "name": "agent_id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true
16
+ },
17
+ "company_id": {
18
+ "name": "company_id",
19
+ "type": "uuid",
20
+ "primaryKey": false,
21
+ "notNull": true
22
+ },
23
+ "adapter_type": {
24
+ "name": "adapter_type",
25
+ "type": "text",
26
+ "primaryKey": false,
27
+ "notNull": true
28
+ },
29
+ "session_id": {
30
+ "name": "session_id",
31
+ "type": "text",
32
+ "primaryKey": false,
33
+ "notNull": false
34
+ },
35
+ "state_json": {
36
+ "name": "state_json",
37
+ "type": "jsonb",
38
+ "primaryKey": false,
39
+ "notNull": true,
40
+ "default": "'{}'::jsonb"
41
+ },
42
+ "last_run_id": {
43
+ "name": "last_run_id",
44
+ "type": "uuid",
45
+ "primaryKey": false,
46
+ "notNull": false
47
+ },
48
+ "last_run_status": {
49
+ "name": "last_run_status",
50
+ "type": "text",
51
+ "primaryKey": false,
52
+ "notNull": false
53
+ },
54
+ "total_input_tokens": {
55
+ "name": "total_input_tokens",
56
+ "type": "bigint",
57
+ "primaryKey": false,
58
+ "notNull": true,
59
+ "default": 0
60
+ },
61
+ "total_output_tokens": {
62
+ "name": "total_output_tokens",
63
+ "type": "bigint",
64
+ "primaryKey": false,
65
+ "notNull": true,
66
+ "default": 0
67
+ },
68
+ "total_cached_input_tokens": {
69
+ "name": "total_cached_input_tokens",
70
+ "type": "bigint",
71
+ "primaryKey": false,
72
+ "notNull": true,
73
+ "default": 0
74
+ },
75
+ "total_cost_cents": {
76
+ "name": "total_cost_cents",
77
+ "type": "bigint",
78
+ "primaryKey": false,
79
+ "notNull": true,
80
+ "default": 0
81
+ },
82
+ "last_error": {
83
+ "name": "last_error",
84
+ "type": "text",
85
+ "primaryKey": false,
86
+ "notNull": false
87
+ },
88
+ "created_at": {
89
+ "name": "created_at",
90
+ "type": "timestamp with time zone",
91
+ "primaryKey": false,
92
+ "notNull": true,
93
+ "default": "now()"
94
+ },
95
+ "updated_at": {
96
+ "name": "updated_at",
97
+ "type": "timestamp with time zone",
98
+ "primaryKey": false,
99
+ "notNull": true,
100
+ "default": "now()"
101
+ }
102
+ },
103
+ "indexes": {
104
+ "agent_runtime_state_company_agent_idx": {
105
+ "name": "agent_runtime_state_company_agent_idx",
106
+ "columns": [
107
+ {
108
+ "expression": "company_id",
109
+ "isExpression": false,
110
+ "asc": true,
111
+ "nulls": "last"
112
+ },
113
+ {
114
+ "expression": "agent_id",
115
+ "isExpression": false,
116
+ "asc": true,
117
+ "nulls": "last"
118
+ }
119
+ ],
120
+ "isUnique": false,
121
+ "concurrently": false,
122
+ "method": "btree",
123
+ "with": {}
124
+ },
125
+ "agent_runtime_state_company_updated_idx": {
126
+ "name": "agent_runtime_state_company_updated_idx",
127
+ "columns": [
128
+ {
129
+ "expression": "company_id",
130
+ "isExpression": false,
131
+ "asc": true,
132
+ "nulls": "last"
133
+ },
134
+ {
135
+ "expression": "updated_at",
136
+ "isExpression": false,
137
+ "asc": true,
138
+ "nulls": "last"
139
+ }
140
+ ],
141
+ "isUnique": false,
142
+ "concurrently": false,
143
+ "method": "btree",
144
+ "with": {}
145
+ }
146
+ },
147
+ "foreignKeys": {
148
+ "agent_runtime_state_agent_id_agents_id_fk": {
149
+ "name": "agent_runtime_state_agent_id_agents_id_fk",
150
+ "tableFrom": "agent_runtime_state",
151
+ "tableTo": "agents",
152
+ "columnsFrom": [
153
+ "agent_id"
154
+ ],
155
+ "columnsTo": [
156
+ "id"
157
+ ],
158
+ "onDelete": "no action",
159
+ "onUpdate": "no action"
160
+ },
161
+ "agent_runtime_state_company_id_companies_id_fk": {
162
+ "name": "agent_runtime_state_company_id_companies_id_fk",
163
+ "tableFrom": "agent_runtime_state",
164
+ "tableTo": "companies",
165
+ "columnsFrom": [
166
+ "company_id"
167
+ ],
168
+ "columnsTo": [
169
+ "id"
170
+ ],
171
+ "onDelete": "no action",
172
+ "onUpdate": "no action"
173
+ }
174
+ },
175
+ "compositePrimaryKeys": {},
176
+ "uniqueConstraints": {},
177
+ "policies": {},
178
+ "checkConstraints": {},
179
+ "isRLSEnabled": false
180
+ },
181
+ "public.agent_task_sessions": {
182
+ "name": "agent_task_sessions",
183
+ "schema": "",
184
+ "columns": {
185
+ "id": {
186
+ "name": "id",
187
+ "type": "uuid",
188
+ "primaryKey": true,
189
+ "notNull": true,
190
+ "default": "gen_random_uuid()"
191
+ },
192
+ "company_id": {
193
+ "name": "company_id",
194
+ "type": "uuid",
195
+ "primaryKey": false,
196
+ "notNull": true
197
+ },
198
+ "agent_id": {
199
+ "name": "agent_id",
200
+ "type": "uuid",
201
+ "primaryKey": false,
202
+ "notNull": true
203
+ },
204
+ "adapter_type": {
205
+ "name": "adapter_type",
206
+ "type": "text",
207
+ "primaryKey": false,
208
+ "notNull": true
209
+ },
210
+ "task_key": {
211
+ "name": "task_key",
212
+ "type": "text",
213
+ "primaryKey": false,
214
+ "notNull": true
215
+ },
216
+ "session_params_json": {
217
+ "name": "session_params_json",
218
+ "type": "jsonb",
219
+ "primaryKey": false,
220
+ "notNull": false
221
+ },
222
+ "session_display_id": {
223
+ "name": "session_display_id",
224
+ "type": "text",
225
+ "primaryKey": false,
226
+ "notNull": false
227
+ },
228
+ "last_run_id": {
229
+ "name": "last_run_id",
230
+ "type": "uuid",
231
+ "primaryKey": false,
232
+ "notNull": false
233
+ },
234
+ "last_error": {
235
+ "name": "last_error",
236
+ "type": "text",
237
+ "primaryKey": false,
238
+ "notNull": false
239
+ },
240
+ "created_at": {
241
+ "name": "created_at",
242
+ "type": "timestamp with time zone",
243
+ "primaryKey": false,
244
+ "notNull": true,
245
+ "default": "now()"
246
+ },
247
+ "updated_at": {
248
+ "name": "updated_at",
249
+ "type": "timestamp with time zone",
250
+ "primaryKey": false,
251
+ "notNull": true,
252
+ "default": "now()"
253
+ }
254
+ },
255
+ "indexes": {
256
+ "agent_task_sessions_company_agent_adapter_task_uniq": {
257
+ "name": "agent_task_sessions_company_agent_adapter_task_uniq",
258
+ "columns": [
259
+ {
260
+ "expression": "company_id",
261
+ "isExpression": false,
262
+ "asc": true,
263
+ "nulls": "last"
264
+ },
265
+ {
266
+ "expression": "agent_id",
267
+ "isExpression": false,
268
+ "asc": true,
269
+ "nulls": "last"
270
+ },
271
+ {
272
+ "expression": "adapter_type",
273
+ "isExpression": false,
274
+ "asc": true,
275
+ "nulls": "last"
276
+ },
277
+ {
278
+ "expression": "task_key",
279
+ "isExpression": false,
280
+ "asc": true,
281
+ "nulls": "last"
282
+ }
283
+ ],
284
+ "isUnique": true,
285
+ "concurrently": false,
286
+ "method": "btree",
287
+ "with": {}
288
+ },
289
+ "agent_task_sessions_company_agent_updated_idx": {
290
+ "name": "agent_task_sessions_company_agent_updated_idx",
291
+ "columns": [
292
+ {
293
+ "expression": "company_id",
294
+ "isExpression": false,
295
+ "asc": true,
296
+ "nulls": "last"
297
+ },
298
+ {
299
+ "expression": "agent_id",
300
+ "isExpression": false,
301
+ "asc": true,
302
+ "nulls": "last"
303
+ },
304
+ {
305
+ "expression": "updated_at",
306
+ "isExpression": false,
307
+ "asc": true,
308
+ "nulls": "last"
309
+ }
310
+ ],
311
+ "isUnique": false,
312
+ "concurrently": false,
313
+ "method": "btree",
314
+ "with": {}
315
+ },
316
+ "agent_task_sessions_company_task_updated_idx": {
317
+ "name": "agent_task_sessions_company_task_updated_idx",
318
+ "columns": [
319
+ {
320
+ "expression": "company_id",
321
+ "isExpression": false,
322
+ "asc": true,
323
+ "nulls": "last"
324
+ },
325
+ {
326
+ "expression": "task_key",
327
+ "isExpression": false,
328
+ "asc": true,
329
+ "nulls": "last"
330
+ },
331
+ {
332
+ "expression": "updated_at",
333
+ "isExpression": false,
334
+ "asc": true,
335
+ "nulls": "last"
336
+ }
337
+ ],
338
+ "isUnique": false,
339
+ "concurrently": false,
340
+ "method": "btree",
341
+ "with": {}
342
+ }
343
+ },
344
+ "foreignKeys": {
345
+ "agent_task_sessions_company_id_companies_id_fk": {
346
+ "name": "agent_task_sessions_company_id_companies_id_fk",
347
+ "tableFrom": "agent_task_sessions",
348
+ "tableTo": "companies",
349
+ "columnsFrom": [
350
+ "company_id"
351
+ ],
352
+ "columnsTo": [
353
+ "id"
354
+ ],
355
+ "onDelete": "no action",
356
+ "onUpdate": "no action"
357
+ },
358
+ "agent_task_sessions_agent_id_agents_id_fk": {
359
+ "name": "agent_task_sessions_agent_id_agents_id_fk",
360
+ "tableFrom": "agent_task_sessions",
361
+ "tableTo": "agents",
362
+ "columnsFrom": [
363
+ "agent_id"
364
+ ],
365
+ "columnsTo": [
366
+ "id"
367
+ ],
368
+ "onDelete": "no action",
369
+ "onUpdate": "no action"
370
+ },
371
+ "agent_task_sessions_last_run_id_heartbeat_runs_id_fk": {
372
+ "name": "agent_task_sessions_last_run_id_heartbeat_runs_id_fk",
373
+ "tableFrom": "agent_task_sessions",
374
+ "tableTo": "heartbeat_runs",
375
+ "columnsFrom": [
376
+ "last_run_id"
377
+ ],
378
+ "columnsTo": [
379
+ "id"
380
+ ],
381
+ "onDelete": "no action",
382
+ "onUpdate": "no action"
383
+ }
384
+ },
385
+ "compositePrimaryKeys": {},
386
+ "uniqueConstraints": {},
387
+ "policies": {},
388
+ "checkConstraints": {},
389
+ "isRLSEnabled": false
390
+ },
391
+ "public.agent_wakeup_requests": {
392
+ "name": "agent_wakeup_requests",
393
+ "schema": "",
394
+ "columns": {
395
+ "id": {
396
+ "name": "id",
397
+ "type": "uuid",
398
+ "primaryKey": true,
399
+ "notNull": true,
400
+ "default": "gen_random_uuid()"
401
+ },
402
+ "company_id": {
403
+ "name": "company_id",
404
+ "type": "uuid",
405
+ "primaryKey": false,
406
+ "notNull": true
407
+ },
408
+ "agent_id": {
409
+ "name": "agent_id",
410
+ "type": "uuid",
411
+ "primaryKey": false,
412
+ "notNull": true
413
+ },
414
+ "source": {
415
+ "name": "source",
416
+ "type": "text",
417
+ "primaryKey": false,
418
+ "notNull": true
419
+ },
420
+ "trigger_detail": {
421
+ "name": "trigger_detail",
422
+ "type": "text",
423
+ "primaryKey": false,
424
+ "notNull": false
425
+ },
426
+ "reason": {
427
+ "name": "reason",
428
+ "type": "text",
429
+ "primaryKey": false,
430
+ "notNull": false
431
+ },
432
+ "payload": {
433
+ "name": "payload",
434
+ "type": "jsonb",
435
+ "primaryKey": false,
436
+ "notNull": false
437
+ },
438
+ "status": {
439
+ "name": "status",
440
+ "type": "text",
441
+ "primaryKey": false,
442
+ "notNull": true,
443
+ "default": "'queued'"
444
+ },
445
+ "coalesced_count": {
446
+ "name": "coalesced_count",
447
+ "type": "integer",
448
+ "primaryKey": false,
449
+ "notNull": true,
450
+ "default": 0
451
+ },
452
+ "requested_by_actor_type": {
453
+ "name": "requested_by_actor_type",
454
+ "type": "text",
455
+ "primaryKey": false,
456
+ "notNull": false
457
+ },
458
+ "requested_by_actor_id": {
459
+ "name": "requested_by_actor_id",
460
+ "type": "text",
461
+ "primaryKey": false,
462
+ "notNull": false
463
+ },
464
+ "idempotency_key": {
465
+ "name": "idempotency_key",
466
+ "type": "text",
467
+ "primaryKey": false,
468
+ "notNull": false
469
+ },
470
+ "run_id": {
471
+ "name": "run_id",
472
+ "type": "uuid",
473
+ "primaryKey": false,
474
+ "notNull": false
475
+ },
476
+ "requested_at": {
477
+ "name": "requested_at",
478
+ "type": "timestamp with time zone",
479
+ "primaryKey": false,
480
+ "notNull": true,
481
+ "default": "now()"
482
+ },
483
+ "claimed_at": {
484
+ "name": "claimed_at",
485
+ "type": "timestamp with time zone",
486
+ "primaryKey": false,
487
+ "notNull": false
488
+ },
489
+ "finished_at": {
490
+ "name": "finished_at",
491
+ "type": "timestamp with time zone",
492
+ "primaryKey": false,
493
+ "notNull": false
494
+ },
495
+ "error": {
496
+ "name": "error",
497
+ "type": "text",
498
+ "primaryKey": false,
499
+ "notNull": false
500
+ },
501
+ "created_at": {
502
+ "name": "created_at",
503
+ "type": "timestamp with time zone",
504
+ "primaryKey": false,
505
+ "notNull": true,
506
+ "default": "now()"
507
+ },
508
+ "updated_at": {
509
+ "name": "updated_at",
510
+ "type": "timestamp with time zone",
511
+ "primaryKey": false,
512
+ "notNull": true,
513
+ "default": "now()"
514
+ }
515
+ },
516
+ "indexes": {
517
+ "agent_wakeup_requests_company_agent_status_idx": {
518
+ "name": "agent_wakeup_requests_company_agent_status_idx",
519
+ "columns": [
520
+ {
521
+ "expression": "company_id",
522
+ "isExpression": false,
523
+ "asc": true,
524
+ "nulls": "last"
525
+ },
526
+ {
527
+ "expression": "agent_id",
528
+ "isExpression": false,
529
+ "asc": true,
530
+ "nulls": "last"
531
+ },
532
+ {
533
+ "expression": "status",
534
+ "isExpression": false,
535
+ "asc": true,
536
+ "nulls": "last"
537
+ }
538
+ ],
539
+ "isUnique": false,
540
+ "concurrently": false,
541
+ "method": "btree",
542
+ "with": {}
543
+ },
544
+ "agent_wakeup_requests_company_requested_idx": {
545
+ "name": "agent_wakeup_requests_company_requested_idx",
546
+ "columns": [
547
+ {
548
+ "expression": "company_id",
549
+ "isExpression": false,
550
+ "asc": true,
551
+ "nulls": "last"
552
+ },
553
+ {
554
+ "expression": "requested_at",
555
+ "isExpression": false,
556
+ "asc": true,
557
+ "nulls": "last"
558
+ }
559
+ ],
560
+ "isUnique": false,
561
+ "concurrently": false,
562
+ "method": "btree",
563
+ "with": {}
564
+ },
565
+ "agent_wakeup_requests_agent_requested_idx": {
566
+ "name": "agent_wakeup_requests_agent_requested_idx",
567
+ "columns": [
568
+ {
569
+ "expression": "agent_id",
570
+ "isExpression": false,
571
+ "asc": true,
572
+ "nulls": "last"
573
+ },
574
+ {
575
+ "expression": "requested_at",
576
+ "isExpression": false,
577
+ "asc": true,
578
+ "nulls": "last"
579
+ }
580
+ ],
581
+ "isUnique": false,
582
+ "concurrently": false,
583
+ "method": "btree",
584
+ "with": {}
585
+ }
586
+ },
587
+ "foreignKeys": {
588
+ "agent_wakeup_requests_company_id_companies_id_fk": {
589
+ "name": "agent_wakeup_requests_company_id_companies_id_fk",
590
+ "tableFrom": "agent_wakeup_requests",
591
+ "tableTo": "companies",
592
+ "columnsFrom": [
593
+ "company_id"
594
+ ],
595
+ "columnsTo": [
596
+ "id"
597
+ ],
598
+ "onDelete": "no action",
599
+ "onUpdate": "no action"
600
+ },
601
+ "agent_wakeup_requests_agent_id_agents_id_fk": {
602
+ "name": "agent_wakeup_requests_agent_id_agents_id_fk",
603
+ "tableFrom": "agent_wakeup_requests",
604
+ "tableTo": "agents",
605
+ "columnsFrom": [
606
+ "agent_id"
607
+ ],
608
+ "columnsTo": [
609
+ "id"
610
+ ],
611
+ "onDelete": "no action",
612
+ "onUpdate": "no action"
613
+ }
614
+ },
615
+ "compositePrimaryKeys": {},
616
+ "uniqueConstraints": {},
617
+ "policies": {},
618
+ "checkConstraints": {},
619
+ "isRLSEnabled": false
620
+ },
621
+ "public.agents": {
622
+ "name": "agents",
623
+ "schema": "",
624
+ "columns": {
625
+ "id": {
626
+ "name": "id",
627
+ "type": "uuid",
628
+ "primaryKey": true,
629
+ "notNull": true,
630
+ "default": "gen_random_uuid()"
631
+ },
632
+ "company_id": {
633
+ "name": "company_id",
634
+ "type": "uuid",
635
+ "primaryKey": false,
636
+ "notNull": true
637
+ },
638
+ "name": {
639
+ "name": "name",
640
+ "type": "text",
641
+ "primaryKey": false,
642
+ "notNull": true
643
+ },
644
+ "role": {
645
+ "name": "role",
646
+ "type": "text",
647
+ "primaryKey": false,
648
+ "notNull": true,
649
+ "default": "'general'"
650
+ },
651
+ "title": {
652
+ "name": "title",
653
+ "type": "text",
654
+ "primaryKey": false,
655
+ "notNull": false
656
+ },
657
+ "icon": {
658
+ "name": "icon",
659
+ "type": "text",
660
+ "primaryKey": false,
661
+ "notNull": false
662
+ },
663
+ "status": {
664
+ "name": "status",
665
+ "type": "text",
666
+ "primaryKey": false,
667
+ "notNull": true,
668
+ "default": "'idle'"
669
+ },
670
+ "reports_to": {
671
+ "name": "reports_to",
672
+ "type": "uuid",
673
+ "primaryKey": false,
674
+ "notNull": false
675
+ },
676
+ "capabilities": {
677
+ "name": "capabilities",
678
+ "type": "text",
679
+ "primaryKey": false,
680
+ "notNull": false
681
+ },
682
+ "adapter_type": {
683
+ "name": "adapter_type",
684
+ "type": "text",
685
+ "primaryKey": false,
686
+ "notNull": true,
687
+ "default": "'process'"
688
+ },
689
+ "adapter_config": {
690
+ "name": "adapter_config",
691
+ "type": "jsonb",
692
+ "primaryKey": false,
693
+ "notNull": true,
694
+ "default": "'{}'::jsonb"
695
+ },
696
+ "runtime_config": {
697
+ "name": "runtime_config",
698
+ "type": "jsonb",
699
+ "primaryKey": false,
700
+ "notNull": true,
701
+ "default": "'{}'::jsonb"
702
+ },
703
+ "default_environment_id": {
704
+ "name": "default_environment_id",
705
+ "type": "uuid",
706
+ "primaryKey": false,
707
+ "notNull": false
708
+ },
709
+ "budget_monthly_cents": {
710
+ "name": "budget_monthly_cents",
711
+ "type": "integer",
712
+ "primaryKey": false,
713
+ "notNull": true,
714
+ "default": 0
715
+ },
716
+ "spent_monthly_cents": {
717
+ "name": "spent_monthly_cents",
718
+ "type": "integer",
719
+ "primaryKey": false,
720
+ "notNull": true,
721
+ "default": 0
722
+ },
723
+ "pause_reason": {
724
+ "name": "pause_reason",
725
+ "type": "text",
726
+ "primaryKey": false,
727
+ "notNull": false
728
+ },
729
+ "paused_at": {
730
+ "name": "paused_at",
731
+ "type": "timestamp with time zone",
732
+ "primaryKey": false,
733
+ "notNull": false
734
+ },
735
+ "permissions": {
736
+ "name": "permissions",
737
+ "type": "jsonb",
738
+ "primaryKey": false,
739
+ "notNull": true,
740
+ "default": "'{}'::jsonb"
741
+ },
742
+ "last_heartbeat_at": {
743
+ "name": "last_heartbeat_at",
744
+ "type": "timestamp with time zone",
745
+ "primaryKey": false,
746
+ "notNull": false
747
+ },
748
+ "metadata": {
749
+ "name": "metadata",
750
+ "type": "jsonb",
751
+ "primaryKey": false,
752
+ "notNull": false
753
+ },
754
+ "created_at": {
755
+ "name": "created_at",
756
+ "type": "timestamp with time zone",
757
+ "primaryKey": false,
758
+ "notNull": true,
759
+ "default": "now()"
760
+ },
761
+ "updated_at": {
762
+ "name": "updated_at",
763
+ "type": "timestamp with time zone",
764
+ "primaryKey": false,
765
+ "notNull": true,
766
+ "default": "now()"
767
+ }
768
+ },
769
+ "indexes": {
770
+ "agents_company_status_idx": {
771
+ "name": "agents_company_status_idx",
772
+ "columns": [
773
+ {
774
+ "expression": "company_id",
775
+ "isExpression": false,
776
+ "asc": true,
777
+ "nulls": "last"
778
+ },
779
+ {
780
+ "expression": "status",
781
+ "isExpression": false,
782
+ "asc": true,
783
+ "nulls": "last"
784
+ }
785
+ ],
786
+ "isUnique": false,
787
+ "concurrently": false,
788
+ "method": "btree",
789
+ "with": {}
790
+ },
791
+ "agents_company_reports_to_idx": {
792
+ "name": "agents_company_reports_to_idx",
793
+ "columns": [
794
+ {
795
+ "expression": "company_id",
796
+ "isExpression": false,
797
+ "asc": true,
798
+ "nulls": "last"
799
+ },
800
+ {
801
+ "expression": "reports_to",
802
+ "isExpression": false,
803
+ "asc": true,
804
+ "nulls": "last"
805
+ }
806
+ ],
807
+ "isUnique": false,
808
+ "concurrently": false,
809
+ "method": "btree",
810
+ "with": {}
811
+ },
812
+ "agents_company_default_environment_idx": {
813
+ "name": "agents_company_default_environment_idx",
814
+ "columns": [
815
+ {
816
+ "expression": "company_id",
817
+ "isExpression": false,
818
+ "asc": true,
819
+ "nulls": "last"
820
+ },
821
+ {
822
+ "expression": "default_environment_id",
823
+ "isExpression": false,
824
+ "asc": true,
825
+ "nulls": "last"
826
+ }
827
+ ],
828
+ "isUnique": false,
829
+ "concurrently": false,
830
+ "method": "btree",
831
+ "with": {}
832
+ }
833
+ },
834
+ "foreignKeys": {
835
+ "agents_company_id_companies_id_fk": {
836
+ "name": "agents_company_id_companies_id_fk",
837
+ "tableFrom": "agents",
838
+ "tableTo": "companies",
839
+ "columnsFrom": [
840
+ "company_id"
841
+ ],
842
+ "columnsTo": [
843
+ "id"
844
+ ],
845
+ "onDelete": "no action",
846
+ "onUpdate": "no action"
847
+ },
848
+ "agents_reports_to_agents_id_fk": {
849
+ "name": "agents_reports_to_agents_id_fk",
850
+ "tableFrom": "agents",
851
+ "tableTo": "agents",
852
+ "columnsFrom": [
853
+ "reports_to"
854
+ ],
855
+ "columnsTo": [
856
+ "id"
857
+ ],
858
+ "onDelete": "no action",
859
+ "onUpdate": "no action"
860
+ },
861
+ "agents_default_environment_id_environments_id_fk": {
862
+ "name": "agents_default_environment_id_environments_id_fk",
863
+ "tableFrom": "agents",
864
+ "tableTo": "environments",
865
+ "columnsFrom": [
866
+ "default_environment_id"
867
+ ],
868
+ "columnsTo": [
869
+ "id"
870
+ ],
871
+ "onDelete": "set null",
872
+ "onUpdate": "no action"
873
+ }
874
+ },
875
+ "compositePrimaryKeys": {},
876
+ "uniqueConstraints": {},
877
+ "policies": {},
878
+ "checkConstraints": {},
879
+ "isRLSEnabled": false
880
+ },
881
+ "public.companies": {
882
+ "name": "companies",
883
+ "schema": "",
884
+ "columns": {
885
+ "id": {
886
+ "name": "id",
887
+ "type": "uuid",
888
+ "primaryKey": true,
889
+ "notNull": true,
890
+ "default": "gen_random_uuid()"
891
+ },
892
+ "name": {
893
+ "name": "name",
894
+ "type": "text",
895
+ "primaryKey": false,
896
+ "notNull": true
897
+ },
898
+ "description": {
899
+ "name": "description",
900
+ "type": "text",
901
+ "primaryKey": false,
902
+ "notNull": false
903
+ },
904
+ "issue_prefix": {
905
+ "name": "issue_prefix",
906
+ "type": "text",
907
+ "primaryKey": false,
908
+ "notNull": true,
909
+ "default": "'ALV-' || substr(replace(gen_random_uuid()::text, '-', ''), 1, 12)"
910
+ },
911
+ "issue_counter": {
912
+ "name": "issue_counter",
913
+ "type": "integer",
914
+ "primaryKey": false,
915
+ "notNull": true,
916
+ "default": 0
917
+ },
918
+ "created_at": {
919
+ "name": "created_at",
920
+ "type": "timestamp with time zone",
921
+ "primaryKey": false,
922
+ "notNull": true,
923
+ "default": "now()"
924
+ },
925
+ "updated_at": {
926
+ "name": "updated_at",
927
+ "type": "timestamp with time zone",
928
+ "primaryKey": false,
929
+ "notNull": true,
930
+ "default": "now()"
931
+ }
932
+ },
933
+ "indexes": {
934
+ "companies_issue_prefix_idx": {
935
+ "name": "companies_issue_prefix_idx",
936
+ "columns": [
937
+ {
938
+ "expression": "issue_prefix",
939
+ "isExpression": false,
940
+ "asc": true,
941
+ "nulls": "last"
942
+ }
943
+ ],
944
+ "isUnique": true,
945
+ "concurrently": false,
946
+ "method": "btree",
947
+ "with": {}
948
+ }
949
+ },
950
+ "foreignKeys": {},
951
+ "compositePrimaryKeys": {},
952
+ "uniqueConstraints": {},
953
+ "policies": {},
954
+ "checkConstraints": {},
955
+ "isRLSEnabled": false
956
+ },
957
+ "public.document_revisions": {
958
+ "name": "document_revisions",
959
+ "schema": "",
960
+ "columns": {
961
+ "id": {
962
+ "name": "id",
963
+ "type": "uuid",
964
+ "primaryKey": true,
965
+ "notNull": true,
966
+ "default": "gen_random_uuid()"
967
+ },
968
+ "company_id": {
969
+ "name": "company_id",
970
+ "type": "uuid",
971
+ "primaryKey": false,
972
+ "notNull": true
973
+ },
974
+ "document_id": {
975
+ "name": "document_id",
976
+ "type": "uuid",
977
+ "primaryKey": false,
978
+ "notNull": true
979
+ },
980
+ "revision_number": {
981
+ "name": "revision_number",
982
+ "type": "integer",
983
+ "primaryKey": false,
984
+ "notNull": true
985
+ },
986
+ "title": {
987
+ "name": "title",
988
+ "type": "text",
989
+ "primaryKey": false,
990
+ "notNull": false
991
+ },
992
+ "format": {
993
+ "name": "format",
994
+ "type": "text",
995
+ "primaryKey": false,
996
+ "notNull": true,
997
+ "default": "'markdown'"
998
+ },
999
+ "body": {
1000
+ "name": "body",
1001
+ "type": "text",
1002
+ "primaryKey": false,
1003
+ "notNull": true
1004
+ },
1005
+ "change_summary": {
1006
+ "name": "change_summary",
1007
+ "type": "text",
1008
+ "primaryKey": false,
1009
+ "notNull": false
1010
+ },
1011
+ "created_by_agent_id": {
1012
+ "name": "created_by_agent_id",
1013
+ "type": "uuid",
1014
+ "primaryKey": false,
1015
+ "notNull": false
1016
+ },
1017
+ "created_by_user_id": {
1018
+ "name": "created_by_user_id",
1019
+ "type": "text",
1020
+ "primaryKey": false,
1021
+ "notNull": false
1022
+ },
1023
+ "created_by_run_id": {
1024
+ "name": "created_by_run_id",
1025
+ "type": "uuid",
1026
+ "primaryKey": false,
1027
+ "notNull": false
1028
+ },
1029
+ "created_at": {
1030
+ "name": "created_at",
1031
+ "type": "timestamp with time zone",
1032
+ "primaryKey": false,
1033
+ "notNull": true,
1034
+ "default": "now()"
1035
+ }
1036
+ },
1037
+ "indexes": {
1038
+ "document_revisions_document_revision_uq": {
1039
+ "name": "document_revisions_document_revision_uq",
1040
+ "columns": [
1041
+ {
1042
+ "expression": "document_id",
1043
+ "isExpression": false,
1044
+ "asc": true,
1045
+ "nulls": "last"
1046
+ },
1047
+ {
1048
+ "expression": "revision_number",
1049
+ "isExpression": false,
1050
+ "asc": true,
1051
+ "nulls": "last"
1052
+ }
1053
+ ],
1054
+ "isUnique": true,
1055
+ "concurrently": false,
1056
+ "method": "btree",
1057
+ "with": {}
1058
+ },
1059
+ "document_revisions_company_document_created_idx": {
1060
+ "name": "document_revisions_company_document_created_idx",
1061
+ "columns": [
1062
+ {
1063
+ "expression": "company_id",
1064
+ "isExpression": false,
1065
+ "asc": true,
1066
+ "nulls": "last"
1067
+ },
1068
+ {
1069
+ "expression": "document_id",
1070
+ "isExpression": false,
1071
+ "asc": true,
1072
+ "nulls": "last"
1073
+ },
1074
+ {
1075
+ "expression": "created_at",
1076
+ "isExpression": false,
1077
+ "asc": true,
1078
+ "nulls": "last"
1079
+ }
1080
+ ],
1081
+ "isUnique": false,
1082
+ "concurrently": false,
1083
+ "method": "btree",
1084
+ "with": {}
1085
+ }
1086
+ },
1087
+ "foreignKeys": {
1088
+ "document_revisions_company_id_companies_id_fk": {
1089
+ "name": "document_revisions_company_id_companies_id_fk",
1090
+ "tableFrom": "document_revisions",
1091
+ "tableTo": "companies",
1092
+ "columnsFrom": [
1093
+ "company_id"
1094
+ ],
1095
+ "columnsTo": [
1096
+ "id"
1097
+ ],
1098
+ "onDelete": "no action",
1099
+ "onUpdate": "no action"
1100
+ },
1101
+ "document_revisions_document_id_documents_id_fk": {
1102
+ "name": "document_revisions_document_id_documents_id_fk",
1103
+ "tableFrom": "document_revisions",
1104
+ "tableTo": "documents",
1105
+ "columnsFrom": [
1106
+ "document_id"
1107
+ ],
1108
+ "columnsTo": [
1109
+ "id"
1110
+ ],
1111
+ "onDelete": "cascade",
1112
+ "onUpdate": "no action"
1113
+ },
1114
+ "document_revisions_created_by_agent_id_agents_id_fk": {
1115
+ "name": "document_revisions_created_by_agent_id_agents_id_fk",
1116
+ "tableFrom": "document_revisions",
1117
+ "tableTo": "agents",
1118
+ "columnsFrom": [
1119
+ "created_by_agent_id"
1120
+ ],
1121
+ "columnsTo": [
1122
+ "id"
1123
+ ],
1124
+ "onDelete": "set null",
1125
+ "onUpdate": "no action"
1126
+ },
1127
+ "document_revisions_created_by_run_id_heartbeat_runs_id_fk": {
1128
+ "name": "document_revisions_created_by_run_id_heartbeat_runs_id_fk",
1129
+ "tableFrom": "document_revisions",
1130
+ "tableTo": "heartbeat_runs",
1131
+ "columnsFrom": [
1132
+ "created_by_run_id"
1133
+ ],
1134
+ "columnsTo": [
1135
+ "id"
1136
+ ],
1137
+ "onDelete": "set null",
1138
+ "onUpdate": "no action"
1139
+ }
1140
+ },
1141
+ "compositePrimaryKeys": {},
1142
+ "uniqueConstraints": {},
1143
+ "policies": {},
1144
+ "checkConstraints": {},
1145
+ "isRLSEnabled": false
1146
+ },
1147
+ "public.documents": {
1148
+ "name": "documents",
1149
+ "schema": "",
1150
+ "columns": {
1151
+ "id": {
1152
+ "name": "id",
1153
+ "type": "uuid",
1154
+ "primaryKey": true,
1155
+ "notNull": true,
1156
+ "default": "gen_random_uuid()"
1157
+ },
1158
+ "company_id": {
1159
+ "name": "company_id",
1160
+ "type": "uuid",
1161
+ "primaryKey": false,
1162
+ "notNull": true
1163
+ },
1164
+ "title": {
1165
+ "name": "title",
1166
+ "type": "text",
1167
+ "primaryKey": false,
1168
+ "notNull": false
1169
+ },
1170
+ "format": {
1171
+ "name": "format",
1172
+ "type": "text",
1173
+ "primaryKey": false,
1174
+ "notNull": true,
1175
+ "default": "'markdown'"
1176
+ },
1177
+ "latest_body": {
1178
+ "name": "latest_body",
1179
+ "type": "text",
1180
+ "primaryKey": false,
1181
+ "notNull": true
1182
+ },
1183
+ "latest_revision_id": {
1184
+ "name": "latest_revision_id",
1185
+ "type": "uuid",
1186
+ "primaryKey": false,
1187
+ "notNull": false
1188
+ },
1189
+ "latest_revision_number": {
1190
+ "name": "latest_revision_number",
1191
+ "type": "integer",
1192
+ "primaryKey": false,
1193
+ "notNull": true,
1194
+ "default": 1
1195
+ },
1196
+ "created_by_agent_id": {
1197
+ "name": "created_by_agent_id",
1198
+ "type": "uuid",
1199
+ "primaryKey": false,
1200
+ "notNull": false
1201
+ },
1202
+ "created_by_user_id": {
1203
+ "name": "created_by_user_id",
1204
+ "type": "text",
1205
+ "primaryKey": false,
1206
+ "notNull": false
1207
+ },
1208
+ "updated_by_agent_id": {
1209
+ "name": "updated_by_agent_id",
1210
+ "type": "uuid",
1211
+ "primaryKey": false,
1212
+ "notNull": false
1213
+ },
1214
+ "updated_by_user_id": {
1215
+ "name": "updated_by_user_id",
1216
+ "type": "text",
1217
+ "primaryKey": false,
1218
+ "notNull": false
1219
+ },
1220
+ "created_at": {
1221
+ "name": "created_at",
1222
+ "type": "timestamp with time zone",
1223
+ "primaryKey": false,
1224
+ "notNull": true,
1225
+ "default": "now()"
1226
+ },
1227
+ "updated_at": {
1228
+ "name": "updated_at",
1229
+ "type": "timestamp with time zone",
1230
+ "primaryKey": false,
1231
+ "notNull": true,
1232
+ "default": "now()"
1233
+ }
1234
+ },
1235
+ "indexes": {
1236
+ "documents_company_updated_idx": {
1237
+ "name": "documents_company_updated_idx",
1238
+ "columns": [
1239
+ {
1240
+ "expression": "company_id",
1241
+ "isExpression": false,
1242
+ "asc": true,
1243
+ "nulls": "last"
1244
+ },
1245
+ {
1246
+ "expression": "updated_at",
1247
+ "isExpression": false,
1248
+ "asc": true,
1249
+ "nulls": "last"
1250
+ }
1251
+ ],
1252
+ "isUnique": false,
1253
+ "concurrently": false,
1254
+ "method": "btree",
1255
+ "with": {}
1256
+ },
1257
+ "documents_company_created_idx": {
1258
+ "name": "documents_company_created_idx",
1259
+ "columns": [
1260
+ {
1261
+ "expression": "company_id",
1262
+ "isExpression": false,
1263
+ "asc": true,
1264
+ "nulls": "last"
1265
+ },
1266
+ {
1267
+ "expression": "created_at",
1268
+ "isExpression": false,
1269
+ "asc": true,
1270
+ "nulls": "last"
1271
+ }
1272
+ ],
1273
+ "isUnique": false,
1274
+ "concurrently": false,
1275
+ "method": "btree",
1276
+ "with": {}
1277
+ }
1278
+ },
1279
+ "foreignKeys": {
1280
+ "documents_company_id_companies_id_fk": {
1281
+ "name": "documents_company_id_companies_id_fk",
1282
+ "tableFrom": "documents",
1283
+ "tableTo": "companies",
1284
+ "columnsFrom": [
1285
+ "company_id"
1286
+ ],
1287
+ "columnsTo": [
1288
+ "id"
1289
+ ],
1290
+ "onDelete": "no action",
1291
+ "onUpdate": "no action"
1292
+ },
1293
+ "documents_created_by_agent_id_agents_id_fk": {
1294
+ "name": "documents_created_by_agent_id_agents_id_fk",
1295
+ "tableFrom": "documents",
1296
+ "tableTo": "agents",
1297
+ "columnsFrom": [
1298
+ "created_by_agent_id"
1299
+ ],
1300
+ "columnsTo": [
1301
+ "id"
1302
+ ],
1303
+ "onDelete": "set null",
1304
+ "onUpdate": "no action"
1305
+ },
1306
+ "documents_updated_by_agent_id_agents_id_fk": {
1307
+ "name": "documents_updated_by_agent_id_agents_id_fk",
1308
+ "tableFrom": "documents",
1309
+ "tableTo": "agents",
1310
+ "columnsFrom": [
1311
+ "updated_by_agent_id"
1312
+ ],
1313
+ "columnsTo": [
1314
+ "id"
1315
+ ],
1316
+ "onDelete": "set null",
1317
+ "onUpdate": "no action"
1318
+ }
1319
+ },
1320
+ "compositePrimaryKeys": {},
1321
+ "uniqueConstraints": {},
1322
+ "policies": {},
1323
+ "checkConstraints": {},
1324
+ "isRLSEnabled": false
1325
+ },
1326
+ "public.environments": {
1327
+ "name": "environments",
1328
+ "schema": "",
1329
+ "columns": {
1330
+ "id": {
1331
+ "name": "id",
1332
+ "type": "uuid",
1333
+ "primaryKey": true,
1334
+ "notNull": true,
1335
+ "default": "gen_random_uuid()"
1336
+ },
1337
+ "company_id": {
1338
+ "name": "company_id",
1339
+ "type": "uuid",
1340
+ "primaryKey": false,
1341
+ "notNull": true
1342
+ },
1343
+ "name": {
1344
+ "name": "name",
1345
+ "type": "text",
1346
+ "primaryKey": false,
1347
+ "notNull": true
1348
+ },
1349
+ "description": {
1350
+ "name": "description",
1351
+ "type": "text",
1352
+ "primaryKey": false,
1353
+ "notNull": false
1354
+ },
1355
+ "driver": {
1356
+ "name": "driver",
1357
+ "type": "text",
1358
+ "primaryKey": false,
1359
+ "notNull": true,
1360
+ "default": "'local'"
1361
+ },
1362
+ "status": {
1363
+ "name": "status",
1364
+ "type": "text",
1365
+ "primaryKey": false,
1366
+ "notNull": true,
1367
+ "default": "'active'"
1368
+ },
1369
+ "config": {
1370
+ "name": "config",
1371
+ "type": "jsonb",
1372
+ "primaryKey": false,
1373
+ "notNull": true,
1374
+ "default": "'{}'::jsonb"
1375
+ },
1376
+ "metadata": {
1377
+ "name": "metadata",
1378
+ "type": "jsonb",
1379
+ "primaryKey": false,
1380
+ "notNull": false
1381
+ },
1382
+ "created_at": {
1383
+ "name": "created_at",
1384
+ "type": "timestamp with time zone",
1385
+ "primaryKey": false,
1386
+ "notNull": true,
1387
+ "default": "now()"
1388
+ },
1389
+ "updated_at": {
1390
+ "name": "updated_at",
1391
+ "type": "timestamp with time zone",
1392
+ "primaryKey": false,
1393
+ "notNull": true,
1394
+ "default": "now()"
1395
+ }
1396
+ },
1397
+ "indexes": {
1398
+ "environments_company_status_idx": {
1399
+ "name": "environments_company_status_idx",
1400
+ "columns": [
1401
+ {
1402
+ "expression": "company_id",
1403
+ "isExpression": false,
1404
+ "asc": true,
1405
+ "nulls": "last"
1406
+ },
1407
+ {
1408
+ "expression": "status",
1409
+ "isExpression": false,
1410
+ "asc": true,
1411
+ "nulls": "last"
1412
+ }
1413
+ ],
1414
+ "isUnique": false,
1415
+ "concurrently": false,
1416
+ "method": "btree",
1417
+ "with": {}
1418
+ },
1419
+ "environments_company_driver_idx": {
1420
+ "name": "environments_company_driver_idx",
1421
+ "columns": [
1422
+ {
1423
+ "expression": "company_id",
1424
+ "isExpression": false,
1425
+ "asc": true,
1426
+ "nulls": "last"
1427
+ },
1428
+ {
1429
+ "expression": "driver",
1430
+ "isExpression": false,
1431
+ "asc": true,
1432
+ "nulls": "last"
1433
+ }
1434
+ ],
1435
+ "isUnique": true,
1436
+ "where": "\"environments\".\"driver\" = 'local'",
1437
+ "concurrently": false,
1438
+ "method": "btree",
1439
+ "with": {}
1440
+ },
1441
+ "environments_company_name_idx": {
1442
+ "name": "environments_company_name_idx",
1443
+ "columns": [
1444
+ {
1445
+ "expression": "company_id",
1446
+ "isExpression": false,
1447
+ "asc": true,
1448
+ "nulls": "last"
1449
+ },
1450
+ {
1451
+ "expression": "name",
1452
+ "isExpression": false,
1453
+ "asc": true,
1454
+ "nulls": "last"
1455
+ }
1456
+ ],
1457
+ "isUnique": false,
1458
+ "concurrently": false,
1459
+ "method": "btree",
1460
+ "with": {}
1461
+ }
1462
+ },
1463
+ "foreignKeys": {
1464
+ "environments_company_id_companies_id_fk": {
1465
+ "name": "environments_company_id_companies_id_fk",
1466
+ "tableFrom": "environments",
1467
+ "tableTo": "companies",
1468
+ "columnsFrom": [
1469
+ "company_id"
1470
+ ],
1471
+ "columnsTo": [
1472
+ "id"
1473
+ ],
1474
+ "onDelete": "cascade",
1475
+ "onUpdate": "no action"
1476
+ }
1477
+ },
1478
+ "compositePrimaryKeys": {},
1479
+ "uniqueConstraints": {},
1480
+ "policies": {},
1481
+ "checkConstraints": {},
1482
+ "isRLSEnabled": false
1483
+ },
1484
+ "public.heartbeat_run_events": {
1485
+ "name": "heartbeat_run_events",
1486
+ "schema": "",
1487
+ "columns": {
1488
+ "id": {
1489
+ "name": "id",
1490
+ "type": "bigserial",
1491
+ "primaryKey": true,
1492
+ "notNull": true
1493
+ },
1494
+ "company_id": {
1495
+ "name": "company_id",
1496
+ "type": "uuid",
1497
+ "primaryKey": false,
1498
+ "notNull": true
1499
+ },
1500
+ "run_id": {
1501
+ "name": "run_id",
1502
+ "type": "uuid",
1503
+ "primaryKey": false,
1504
+ "notNull": true
1505
+ },
1506
+ "agent_id": {
1507
+ "name": "agent_id",
1508
+ "type": "uuid",
1509
+ "primaryKey": false,
1510
+ "notNull": true
1511
+ },
1512
+ "seq": {
1513
+ "name": "seq",
1514
+ "type": "integer",
1515
+ "primaryKey": false,
1516
+ "notNull": true
1517
+ },
1518
+ "event_type": {
1519
+ "name": "event_type",
1520
+ "type": "text",
1521
+ "primaryKey": false,
1522
+ "notNull": true
1523
+ },
1524
+ "stream": {
1525
+ "name": "stream",
1526
+ "type": "text",
1527
+ "primaryKey": false,
1528
+ "notNull": false
1529
+ },
1530
+ "level": {
1531
+ "name": "level",
1532
+ "type": "text",
1533
+ "primaryKey": false,
1534
+ "notNull": false
1535
+ },
1536
+ "color": {
1537
+ "name": "color",
1538
+ "type": "text",
1539
+ "primaryKey": false,
1540
+ "notNull": false
1541
+ },
1542
+ "message": {
1543
+ "name": "message",
1544
+ "type": "text",
1545
+ "primaryKey": false,
1546
+ "notNull": false
1547
+ },
1548
+ "payload": {
1549
+ "name": "payload",
1550
+ "type": "jsonb",
1551
+ "primaryKey": false,
1552
+ "notNull": false
1553
+ },
1554
+ "created_at": {
1555
+ "name": "created_at",
1556
+ "type": "timestamp with time zone",
1557
+ "primaryKey": false,
1558
+ "notNull": true,
1559
+ "default": "now()"
1560
+ }
1561
+ },
1562
+ "indexes": {
1563
+ "heartbeat_run_events_run_seq_idx": {
1564
+ "name": "heartbeat_run_events_run_seq_idx",
1565
+ "columns": [
1566
+ {
1567
+ "expression": "run_id",
1568
+ "isExpression": false,
1569
+ "asc": true,
1570
+ "nulls": "last"
1571
+ },
1572
+ {
1573
+ "expression": "seq",
1574
+ "isExpression": false,
1575
+ "asc": true,
1576
+ "nulls": "last"
1577
+ }
1578
+ ],
1579
+ "isUnique": false,
1580
+ "concurrently": false,
1581
+ "method": "btree",
1582
+ "with": {}
1583
+ },
1584
+ "heartbeat_run_events_company_run_idx": {
1585
+ "name": "heartbeat_run_events_company_run_idx",
1586
+ "columns": [
1587
+ {
1588
+ "expression": "company_id",
1589
+ "isExpression": false,
1590
+ "asc": true,
1591
+ "nulls": "last"
1592
+ },
1593
+ {
1594
+ "expression": "run_id",
1595
+ "isExpression": false,
1596
+ "asc": true,
1597
+ "nulls": "last"
1598
+ }
1599
+ ],
1600
+ "isUnique": false,
1601
+ "concurrently": false,
1602
+ "method": "btree",
1603
+ "with": {}
1604
+ },
1605
+ "heartbeat_run_events_company_created_idx": {
1606
+ "name": "heartbeat_run_events_company_created_idx",
1607
+ "columns": [
1608
+ {
1609
+ "expression": "company_id",
1610
+ "isExpression": false,
1611
+ "asc": true,
1612
+ "nulls": "last"
1613
+ },
1614
+ {
1615
+ "expression": "created_at",
1616
+ "isExpression": false,
1617
+ "asc": true,
1618
+ "nulls": "last"
1619
+ }
1620
+ ],
1621
+ "isUnique": false,
1622
+ "concurrently": false,
1623
+ "method": "btree",
1624
+ "with": {}
1625
+ }
1626
+ },
1627
+ "foreignKeys": {
1628
+ "heartbeat_run_events_company_id_companies_id_fk": {
1629
+ "name": "heartbeat_run_events_company_id_companies_id_fk",
1630
+ "tableFrom": "heartbeat_run_events",
1631
+ "tableTo": "companies",
1632
+ "columnsFrom": [
1633
+ "company_id"
1634
+ ],
1635
+ "columnsTo": [
1636
+ "id"
1637
+ ],
1638
+ "onDelete": "no action",
1639
+ "onUpdate": "no action"
1640
+ },
1641
+ "heartbeat_run_events_run_id_heartbeat_runs_id_fk": {
1642
+ "name": "heartbeat_run_events_run_id_heartbeat_runs_id_fk",
1643
+ "tableFrom": "heartbeat_run_events",
1644
+ "tableTo": "heartbeat_runs",
1645
+ "columnsFrom": [
1646
+ "run_id"
1647
+ ],
1648
+ "columnsTo": [
1649
+ "id"
1650
+ ],
1651
+ "onDelete": "no action",
1652
+ "onUpdate": "no action"
1653
+ },
1654
+ "heartbeat_run_events_agent_id_agents_id_fk": {
1655
+ "name": "heartbeat_run_events_agent_id_agents_id_fk",
1656
+ "tableFrom": "heartbeat_run_events",
1657
+ "tableTo": "agents",
1658
+ "columnsFrom": [
1659
+ "agent_id"
1660
+ ],
1661
+ "columnsTo": [
1662
+ "id"
1663
+ ],
1664
+ "onDelete": "no action",
1665
+ "onUpdate": "no action"
1666
+ }
1667
+ },
1668
+ "compositePrimaryKeys": {},
1669
+ "uniqueConstraints": {},
1670
+ "policies": {},
1671
+ "checkConstraints": {},
1672
+ "isRLSEnabled": false
1673
+ },
1674
+ "public.heartbeat_runs": {
1675
+ "name": "heartbeat_runs",
1676
+ "schema": "",
1677
+ "columns": {
1678
+ "id": {
1679
+ "name": "id",
1680
+ "type": "uuid",
1681
+ "primaryKey": true,
1682
+ "notNull": true,
1683
+ "default": "gen_random_uuid()"
1684
+ },
1685
+ "company_id": {
1686
+ "name": "company_id",
1687
+ "type": "uuid",
1688
+ "primaryKey": false,
1689
+ "notNull": true
1690
+ },
1691
+ "agent_id": {
1692
+ "name": "agent_id",
1693
+ "type": "uuid",
1694
+ "primaryKey": false,
1695
+ "notNull": true
1696
+ },
1697
+ "invocation_source": {
1698
+ "name": "invocation_source",
1699
+ "type": "text",
1700
+ "primaryKey": false,
1701
+ "notNull": true,
1702
+ "default": "'on_demand'"
1703
+ },
1704
+ "trigger_detail": {
1705
+ "name": "trigger_detail",
1706
+ "type": "text",
1707
+ "primaryKey": false,
1708
+ "notNull": false
1709
+ },
1710
+ "status": {
1711
+ "name": "status",
1712
+ "type": "text",
1713
+ "primaryKey": false,
1714
+ "notNull": true,
1715
+ "default": "'queued'"
1716
+ },
1717
+ "started_at": {
1718
+ "name": "started_at",
1719
+ "type": "timestamp with time zone",
1720
+ "primaryKey": false,
1721
+ "notNull": false
1722
+ },
1723
+ "finished_at": {
1724
+ "name": "finished_at",
1725
+ "type": "timestamp with time zone",
1726
+ "primaryKey": false,
1727
+ "notNull": false
1728
+ },
1729
+ "error": {
1730
+ "name": "error",
1731
+ "type": "text",
1732
+ "primaryKey": false,
1733
+ "notNull": false
1734
+ },
1735
+ "wakeup_request_id": {
1736
+ "name": "wakeup_request_id",
1737
+ "type": "uuid",
1738
+ "primaryKey": false,
1739
+ "notNull": false
1740
+ },
1741
+ "exit_code": {
1742
+ "name": "exit_code",
1743
+ "type": "integer",
1744
+ "primaryKey": false,
1745
+ "notNull": false
1746
+ },
1747
+ "signal": {
1748
+ "name": "signal",
1749
+ "type": "text",
1750
+ "primaryKey": false,
1751
+ "notNull": false
1752
+ },
1753
+ "usage_json": {
1754
+ "name": "usage_json",
1755
+ "type": "jsonb",
1756
+ "primaryKey": false,
1757
+ "notNull": false
1758
+ },
1759
+ "result_json": {
1760
+ "name": "result_json",
1761
+ "type": "jsonb",
1762
+ "primaryKey": false,
1763
+ "notNull": false
1764
+ },
1765
+ "session_id_before": {
1766
+ "name": "session_id_before",
1767
+ "type": "text",
1768
+ "primaryKey": false,
1769
+ "notNull": false
1770
+ },
1771
+ "session_id_after": {
1772
+ "name": "session_id_after",
1773
+ "type": "text",
1774
+ "primaryKey": false,
1775
+ "notNull": false
1776
+ },
1777
+ "log_store": {
1778
+ "name": "log_store",
1779
+ "type": "text",
1780
+ "primaryKey": false,
1781
+ "notNull": false
1782
+ },
1783
+ "log_ref": {
1784
+ "name": "log_ref",
1785
+ "type": "text",
1786
+ "primaryKey": false,
1787
+ "notNull": false
1788
+ },
1789
+ "log_bytes": {
1790
+ "name": "log_bytes",
1791
+ "type": "bigint",
1792
+ "primaryKey": false,
1793
+ "notNull": false
1794
+ },
1795
+ "log_sha256": {
1796
+ "name": "log_sha256",
1797
+ "type": "text",
1798
+ "primaryKey": false,
1799
+ "notNull": false
1800
+ },
1801
+ "log_compressed": {
1802
+ "name": "log_compressed",
1803
+ "type": "boolean",
1804
+ "primaryKey": false,
1805
+ "notNull": true,
1806
+ "default": false
1807
+ },
1808
+ "stdout_excerpt": {
1809
+ "name": "stdout_excerpt",
1810
+ "type": "text",
1811
+ "primaryKey": false,
1812
+ "notNull": false
1813
+ },
1814
+ "stderr_excerpt": {
1815
+ "name": "stderr_excerpt",
1816
+ "type": "text",
1817
+ "primaryKey": false,
1818
+ "notNull": false
1819
+ },
1820
+ "error_code": {
1821
+ "name": "error_code",
1822
+ "type": "text",
1823
+ "primaryKey": false,
1824
+ "notNull": false
1825
+ },
1826
+ "external_run_id": {
1827
+ "name": "external_run_id",
1828
+ "type": "text",
1829
+ "primaryKey": false,
1830
+ "notNull": false
1831
+ },
1832
+ "process_pid": {
1833
+ "name": "process_pid",
1834
+ "type": "integer",
1835
+ "primaryKey": false,
1836
+ "notNull": false
1837
+ },
1838
+ "process_group_id": {
1839
+ "name": "process_group_id",
1840
+ "type": "integer",
1841
+ "primaryKey": false,
1842
+ "notNull": false
1843
+ },
1844
+ "process_started_at": {
1845
+ "name": "process_started_at",
1846
+ "type": "timestamp with time zone",
1847
+ "primaryKey": false,
1848
+ "notNull": false
1849
+ },
1850
+ "last_output_at": {
1851
+ "name": "last_output_at",
1852
+ "type": "timestamp with time zone",
1853
+ "primaryKey": false,
1854
+ "notNull": false
1855
+ },
1856
+ "last_output_seq": {
1857
+ "name": "last_output_seq",
1858
+ "type": "integer",
1859
+ "primaryKey": false,
1860
+ "notNull": true,
1861
+ "default": 0
1862
+ },
1863
+ "last_output_stream": {
1864
+ "name": "last_output_stream",
1865
+ "type": "text",
1866
+ "primaryKey": false,
1867
+ "notNull": false
1868
+ },
1869
+ "last_output_bytes": {
1870
+ "name": "last_output_bytes",
1871
+ "type": "bigint",
1872
+ "primaryKey": false,
1873
+ "notNull": false
1874
+ },
1875
+ "retry_of_run_id": {
1876
+ "name": "retry_of_run_id",
1877
+ "type": "uuid",
1878
+ "primaryKey": false,
1879
+ "notNull": false
1880
+ },
1881
+ "process_loss_retry_count": {
1882
+ "name": "process_loss_retry_count",
1883
+ "type": "integer",
1884
+ "primaryKey": false,
1885
+ "notNull": true,
1886
+ "default": 0
1887
+ },
1888
+ "scheduled_retry_at": {
1889
+ "name": "scheduled_retry_at",
1890
+ "type": "timestamp with time zone",
1891
+ "primaryKey": false,
1892
+ "notNull": false
1893
+ },
1894
+ "scheduled_retry_attempt": {
1895
+ "name": "scheduled_retry_attempt",
1896
+ "type": "integer",
1897
+ "primaryKey": false,
1898
+ "notNull": true,
1899
+ "default": 0
1900
+ },
1901
+ "scheduled_retry_reason": {
1902
+ "name": "scheduled_retry_reason",
1903
+ "type": "text",
1904
+ "primaryKey": false,
1905
+ "notNull": false
1906
+ },
1907
+ "issue_comment_status": {
1908
+ "name": "issue_comment_status",
1909
+ "type": "text",
1910
+ "primaryKey": false,
1911
+ "notNull": true,
1912
+ "default": "'not_applicable'"
1913
+ },
1914
+ "issue_comment_satisfied_by_comment_id": {
1915
+ "name": "issue_comment_satisfied_by_comment_id",
1916
+ "type": "uuid",
1917
+ "primaryKey": false,
1918
+ "notNull": false
1919
+ },
1920
+ "issue_comment_retry_queued_at": {
1921
+ "name": "issue_comment_retry_queued_at",
1922
+ "type": "timestamp with time zone",
1923
+ "primaryKey": false,
1924
+ "notNull": false
1925
+ },
1926
+ "liveness_state": {
1927
+ "name": "liveness_state",
1928
+ "type": "text",
1929
+ "primaryKey": false,
1930
+ "notNull": false
1931
+ },
1932
+ "liveness_reason": {
1933
+ "name": "liveness_reason",
1934
+ "type": "text",
1935
+ "primaryKey": false,
1936
+ "notNull": false
1937
+ },
1938
+ "continuation_attempt": {
1939
+ "name": "continuation_attempt",
1940
+ "type": "integer",
1941
+ "primaryKey": false,
1942
+ "notNull": true,
1943
+ "default": 0
1944
+ },
1945
+ "last_useful_action_at": {
1946
+ "name": "last_useful_action_at",
1947
+ "type": "timestamp with time zone",
1948
+ "primaryKey": false,
1949
+ "notNull": false
1950
+ },
1951
+ "next_action": {
1952
+ "name": "next_action",
1953
+ "type": "text",
1954
+ "primaryKey": false,
1955
+ "notNull": false
1956
+ },
1957
+ "context_snapshot": {
1958
+ "name": "context_snapshot",
1959
+ "type": "jsonb",
1960
+ "primaryKey": false,
1961
+ "notNull": false
1962
+ },
1963
+ "created_at": {
1964
+ "name": "created_at",
1965
+ "type": "timestamp with time zone",
1966
+ "primaryKey": false,
1967
+ "notNull": true,
1968
+ "default": "now()"
1969
+ },
1970
+ "updated_at": {
1971
+ "name": "updated_at",
1972
+ "type": "timestamp with time zone",
1973
+ "primaryKey": false,
1974
+ "notNull": true,
1975
+ "default": "now()"
1976
+ }
1977
+ },
1978
+ "indexes": {
1979
+ "heartbeat_runs_company_agent_started_idx": {
1980
+ "name": "heartbeat_runs_company_agent_started_idx",
1981
+ "columns": [
1982
+ {
1983
+ "expression": "company_id",
1984
+ "isExpression": false,
1985
+ "asc": true,
1986
+ "nulls": "last"
1987
+ },
1988
+ {
1989
+ "expression": "agent_id",
1990
+ "isExpression": false,
1991
+ "asc": true,
1992
+ "nulls": "last"
1993
+ },
1994
+ {
1995
+ "expression": "started_at",
1996
+ "isExpression": false,
1997
+ "asc": true,
1998
+ "nulls": "last"
1999
+ }
2000
+ ],
2001
+ "isUnique": false,
2002
+ "concurrently": false,
2003
+ "method": "btree",
2004
+ "with": {}
2005
+ },
2006
+ "heartbeat_runs_company_liveness_idx": {
2007
+ "name": "heartbeat_runs_company_liveness_idx",
2008
+ "columns": [
2009
+ {
2010
+ "expression": "company_id",
2011
+ "isExpression": false,
2012
+ "asc": true,
2013
+ "nulls": "last"
2014
+ },
2015
+ {
2016
+ "expression": "liveness_state",
2017
+ "isExpression": false,
2018
+ "asc": true,
2019
+ "nulls": "last"
2020
+ },
2021
+ {
2022
+ "expression": "created_at",
2023
+ "isExpression": false,
2024
+ "asc": true,
2025
+ "nulls": "last"
2026
+ }
2027
+ ],
2028
+ "isUnique": false,
2029
+ "concurrently": false,
2030
+ "method": "btree",
2031
+ "with": {}
2032
+ },
2033
+ "heartbeat_runs_company_status_last_output_idx": {
2034
+ "name": "heartbeat_runs_company_status_last_output_idx",
2035
+ "columns": [
2036
+ {
2037
+ "expression": "company_id",
2038
+ "isExpression": false,
2039
+ "asc": true,
2040
+ "nulls": "last"
2041
+ },
2042
+ {
2043
+ "expression": "status",
2044
+ "isExpression": false,
2045
+ "asc": true,
2046
+ "nulls": "last"
2047
+ },
2048
+ {
2049
+ "expression": "last_output_at",
2050
+ "isExpression": false,
2051
+ "asc": true,
2052
+ "nulls": "last"
2053
+ }
2054
+ ],
2055
+ "isUnique": false,
2056
+ "concurrently": false,
2057
+ "method": "btree",
2058
+ "with": {}
2059
+ },
2060
+ "heartbeat_runs_company_status_process_started_idx": {
2061
+ "name": "heartbeat_runs_company_status_process_started_idx",
2062
+ "columns": [
2063
+ {
2064
+ "expression": "company_id",
2065
+ "isExpression": false,
2066
+ "asc": true,
2067
+ "nulls": "last"
2068
+ },
2069
+ {
2070
+ "expression": "status",
2071
+ "isExpression": false,
2072
+ "asc": true,
2073
+ "nulls": "last"
2074
+ },
2075
+ {
2076
+ "expression": "process_started_at",
2077
+ "isExpression": false,
2078
+ "asc": true,
2079
+ "nulls": "last"
2080
+ }
2081
+ ],
2082
+ "isUnique": false,
2083
+ "concurrently": false,
2084
+ "method": "btree",
2085
+ "with": {}
2086
+ }
2087
+ },
2088
+ "foreignKeys": {
2089
+ "heartbeat_runs_company_id_companies_id_fk": {
2090
+ "name": "heartbeat_runs_company_id_companies_id_fk",
2091
+ "tableFrom": "heartbeat_runs",
2092
+ "tableTo": "companies",
2093
+ "columnsFrom": [
2094
+ "company_id"
2095
+ ],
2096
+ "columnsTo": [
2097
+ "id"
2098
+ ],
2099
+ "onDelete": "no action",
2100
+ "onUpdate": "no action"
2101
+ },
2102
+ "heartbeat_runs_agent_id_agents_id_fk": {
2103
+ "name": "heartbeat_runs_agent_id_agents_id_fk",
2104
+ "tableFrom": "heartbeat_runs",
2105
+ "tableTo": "agents",
2106
+ "columnsFrom": [
2107
+ "agent_id"
2108
+ ],
2109
+ "columnsTo": [
2110
+ "id"
2111
+ ],
2112
+ "onDelete": "no action",
2113
+ "onUpdate": "no action"
2114
+ },
2115
+ "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk": {
2116
+ "name": "heartbeat_runs_wakeup_request_id_agent_wakeup_requests_id_fk",
2117
+ "tableFrom": "heartbeat_runs",
2118
+ "tableTo": "agent_wakeup_requests",
2119
+ "columnsFrom": [
2120
+ "wakeup_request_id"
2121
+ ],
2122
+ "columnsTo": [
2123
+ "id"
2124
+ ],
2125
+ "onDelete": "no action",
2126
+ "onUpdate": "no action"
2127
+ },
2128
+ "heartbeat_runs_retry_of_run_id_heartbeat_runs_id_fk": {
2129
+ "name": "heartbeat_runs_retry_of_run_id_heartbeat_runs_id_fk",
2130
+ "tableFrom": "heartbeat_runs",
2131
+ "tableTo": "heartbeat_runs",
2132
+ "columnsFrom": [
2133
+ "retry_of_run_id"
2134
+ ],
2135
+ "columnsTo": [
2136
+ "id"
2137
+ ],
2138
+ "onDelete": "set null",
2139
+ "onUpdate": "no action"
2140
+ }
2141
+ },
2142
+ "compositePrimaryKeys": {},
2143
+ "uniqueConstraints": {},
2144
+ "policies": {},
2145
+ "checkConstraints": {},
2146
+ "isRLSEnabled": false
2147
+ },
2148
+ "public.issue_comments": {
2149
+ "name": "issue_comments",
2150
+ "schema": "",
2151
+ "columns": {
2152
+ "id": {
2153
+ "name": "id",
2154
+ "type": "uuid",
2155
+ "primaryKey": true,
2156
+ "notNull": true,
2157
+ "default": "gen_random_uuid()"
2158
+ },
2159
+ "company_id": {
2160
+ "name": "company_id",
2161
+ "type": "uuid",
2162
+ "primaryKey": false,
2163
+ "notNull": true
2164
+ },
2165
+ "issue_id": {
2166
+ "name": "issue_id",
2167
+ "type": "uuid",
2168
+ "primaryKey": false,
2169
+ "notNull": true
2170
+ },
2171
+ "author_agent_id": {
2172
+ "name": "author_agent_id",
2173
+ "type": "uuid",
2174
+ "primaryKey": false,
2175
+ "notNull": false
2176
+ },
2177
+ "author_user_id": {
2178
+ "name": "author_user_id",
2179
+ "type": "text",
2180
+ "primaryKey": false,
2181
+ "notNull": false
2182
+ },
2183
+ "author_type": {
2184
+ "name": "author_type",
2185
+ "type": "text",
2186
+ "primaryKey": false,
2187
+ "notNull": false
2188
+ },
2189
+ "created_by_run_id": {
2190
+ "name": "created_by_run_id",
2191
+ "type": "uuid",
2192
+ "primaryKey": false,
2193
+ "notNull": false
2194
+ },
2195
+ "body": {
2196
+ "name": "body",
2197
+ "type": "text",
2198
+ "primaryKey": false,
2199
+ "notNull": true
2200
+ },
2201
+ "presentation": {
2202
+ "name": "presentation",
2203
+ "type": "jsonb",
2204
+ "primaryKey": false,
2205
+ "notNull": false
2206
+ },
2207
+ "metadata": {
2208
+ "name": "metadata",
2209
+ "type": "jsonb",
2210
+ "primaryKey": false,
2211
+ "notNull": false
2212
+ },
2213
+ "created_at": {
2214
+ "name": "created_at",
2215
+ "type": "timestamp with time zone",
2216
+ "primaryKey": false,
2217
+ "notNull": true,
2218
+ "default": "now()"
2219
+ },
2220
+ "updated_at": {
2221
+ "name": "updated_at",
2222
+ "type": "timestamp with time zone",
2223
+ "primaryKey": false,
2224
+ "notNull": true,
2225
+ "default": "now()"
2226
+ }
2227
+ },
2228
+ "indexes": {
2229
+ "issue_comments_issue_idx": {
2230
+ "name": "issue_comments_issue_idx",
2231
+ "columns": [
2232
+ {
2233
+ "expression": "issue_id",
2234
+ "isExpression": false,
2235
+ "asc": true,
2236
+ "nulls": "last"
2237
+ }
2238
+ ],
2239
+ "isUnique": false,
2240
+ "concurrently": false,
2241
+ "method": "btree",
2242
+ "with": {}
2243
+ },
2244
+ "issue_comments_company_idx": {
2245
+ "name": "issue_comments_company_idx",
2246
+ "columns": [
2247
+ {
2248
+ "expression": "company_id",
2249
+ "isExpression": false,
2250
+ "asc": true,
2251
+ "nulls": "last"
2252
+ }
2253
+ ],
2254
+ "isUnique": false,
2255
+ "concurrently": false,
2256
+ "method": "btree",
2257
+ "with": {}
2258
+ },
2259
+ "issue_comments_company_issue_created_at_idx": {
2260
+ "name": "issue_comments_company_issue_created_at_idx",
2261
+ "columns": [
2262
+ {
2263
+ "expression": "company_id",
2264
+ "isExpression": false,
2265
+ "asc": true,
2266
+ "nulls": "last"
2267
+ },
2268
+ {
2269
+ "expression": "issue_id",
2270
+ "isExpression": false,
2271
+ "asc": true,
2272
+ "nulls": "last"
2273
+ },
2274
+ {
2275
+ "expression": "created_at",
2276
+ "isExpression": false,
2277
+ "asc": true,
2278
+ "nulls": "last"
2279
+ }
2280
+ ],
2281
+ "isUnique": false,
2282
+ "concurrently": false,
2283
+ "method": "btree",
2284
+ "with": {}
2285
+ },
2286
+ "issue_comments_company_author_issue_created_at_idx": {
2287
+ "name": "issue_comments_company_author_issue_created_at_idx",
2288
+ "columns": [
2289
+ {
2290
+ "expression": "company_id",
2291
+ "isExpression": false,
2292
+ "asc": true,
2293
+ "nulls": "last"
2294
+ },
2295
+ {
2296
+ "expression": "author_user_id",
2297
+ "isExpression": false,
2298
+ "asc": true,
2299
+ "nulls": "last"
2300
+ },
2301
+ {
2302
+ "expression": "issue_id",
2303
+ "isExpression": false,
2304
+ "asc": true,
2305
+ "nulls": "last"
2306
+ },
2307
+ {
2308
+ "expression": "created_at",
2309
+ "isExpression": false,
2310
+ "asc": true,
2311
+ "nulls": "last"
2312
+ }
2313
+ ],
2314
+ "isUnique": false,
2315
+ "concurrently": false,
2316
+ "method": "btree",
2317
+ "with": {}
2318
+ }
2319
+ },
2320
+ "foreignKeys": {
2321
+ "issue_comments_company_id_companies_id_fk": {
2322
+ "name": "issue_comments_company_id_companies_id_fk",
2323
+ "tableFrom": "issue_comments",
2324
+ "tableTo": "companies",
2325
+ "columnsFrom": [
2326
+ "company_id"
2327
+ ],
2328
+ "columnsTo": [
2329
+ "id"
2330
+ ],
2331
+ "onDelete": "no action",
2332
+ "onUpdate": "no action"
2333
+ },
2334
+ "issue_comments_issue_id_issues_id_fk": {
2335
+ "name": "issue_comments_issue_id_issues_id_fk",
2336
+ "tableFrom": "issue_comments",
2337
+ "tableTo": "issues",
2338
+ "columnsFrom": [
2339
+ "issue_id"
2340
+ ],
2341
+ "columnsTo": [
2342
+ "id"
2343
+ ],
2344
+ "onDelete": "no action",
2345
+ "onUpdate": "no action"
2346
+ },
2347
+ "issue_comments_author_agent_id_agents_id_fk": {
2348
+ "name": "issue_comments_author_agent_id_agents_id_fk",
2349
+ "tableFrom": "issue_comments",
2350
+ "tableTo": "agents",
2351
+ "columnsFrom": [
2352
+ "author_agent_id"
2353
+ ],
2354
+ "columnsTo": [
2355
+ "id"
2356
+ ],
2357
+ "onDelete": "no action",
2358
+ "onUpdate": "no action"
2359
+ },
2360
+ "issue_comments_created_by_run_id_heartbeat_runs_id_fk": {
2361
+ "name": "issue_comments_created_by_run_id_heartbeat_runs_id_fk",
2362
+ "tableFrom": "issue_comments",
2363
+ "tableTo": "heartbeat_runs",
2364
+ "columnsFrom": [
2365
+ "created_by_run_id"
2366
+ ],
2367
+ "columnsTo": [
2368
+ "id"
2369
+ ],
2370
+ "onDelete": "set null",
2371
+ "onUpdate": "no action"
2372
+ }
2373
+ },
2374
+ "compositePrimaryKeys": {},
2375
+ "uniqueConstraints": {},
2376
+ "policies": {},
2377
+ "checkConstraints": {},
2378
+ "isRLSEnabled": false
2379
+ },
2380
+ "public.issue_documents": {
2381
+ "name": "issue_documents",
2382
+ "schema": "",
2383
+ "columns": {
2384
+ "id": {
2385
+ "name": "id",
2386
+ "type": "uuid",
2387
+ "primaryKey": true,
2388
+ "notNull": true,
2389
+ "default": "gen_random_uuid()"
2390
+ },
2391
+ "company_id": {
2392
+ "name": "company_id",
2393
+ "type": "uuid",
2394
+ "primaryKey": false,
2395
+ "notNull": true
2396
+ },
2397
+ "issue_id": {
2398
+ "name": "issue_id",
2399
+ "type": "uuid",
2400
+ "primaryKey": false,
2401
+ "notNull": true
2402
+ },
2403
+ "document_id": {
2404
+ "name": "document_id",
2405
+ "type": "uuid",
2406
+ "primaryKey": false,
2407
+ "notNull": true
2408
+ },
2409
+ "key": {
2410
+ "name": "key",
2411
+ "type": "text",
2412
+ "primaryKey": false,
2413
+ "notNull": true
2414
+ },
2415
+ "created_at": {
2416
+ "name": "created_at",
2417
+ "type": "timestamp with time zone",
2418
+ "primaryKey": false,
2419
+ "notNull": true,
2420
+ "default": "now()"
2421
+ },
2422
+ "updated_at": {
2423
+ "name": "updated_at",
2424
+ "type": "timestamp with time zone",
2425
+ "primaryKey": false,
2426
+ "notNull": true,
2427
+ "default": "now()"
2428
+ }
2429
+ },
2430
+ "indexes": {
2431
+ "issue_documents_company_issue_key_uq": {
2432
+ "name": "issue_documents_company_issue_key_uq",
2433
+ "columns": [
2434
+ {
2435
+ "expression": "company_id",
2436
+ "isExpression": false,
2437
+ "asc": true,
2438
+ "nulls": "last"
2439
+ },
2440
+ {
2441
+ "expression": "issue_id",
2442
+ "isExpression": false,
2443
+ "asc": true,
2444
+ "nulls": "last"
2445
+ },
2446
+ {
2447
+ "expression": "key",
2448
+ "isExpression": false,
2449
+ "asc": true,
2450
+ "nulls": "last"
2451
+ }
2452
+ ],
2453
+ "isUnique": true,
2454
+ "concurrently": false,
2455
+ "method": "btree",
2456
+ "with": {}
2457
+ },
2458
+ "issue_documents_document_uq": {
2459
+ "name": "issue_documents_document_uq",
2460
+ "columns": [
2461
+ {
2462
+ "expression": "document_id",
2463
+ "isExpression": false,
2464
+ "asc": true,
2465
+ "nulls": "last"
2466
+ }
2467
+ ],
2468
+ "isUnique": true,
2469
+ "concurrently": false,
2470
+ "method": "btree",
2471
+ "with": {}
2472
+ },
2473
+ "issue_documents_company_issue_updated_idx": {
2474
+ "name": "issue_documents_company_issue_updated_idx",
2475
+ "columns": [
2476
+ {
2477
+ "expression": "company_id",
2478
+ "isExpression": false,
2479
+ "asc": true,
2480
+ "nulls": "last"
2481
+ },
2482
+ {
2483
+ "expression": "issue_id",
2484
+ "isExpression": false,
2485
+ "asc": true,
2486
+ "nulls": "last"
2487
+ },
2488
+ {
2489
+ "expression": "updated_at",
2490
+ "isExpression": false,
2491
+ "asc": true,
2492
+ "nulls": "last"
2493
+ }
2494
+ ],
2495
+ "isUnique": false,
2496
+ "concurrently": false,
2497
+ "method": "btree",
2498
+ "with": {}
2499
+ }
2500
+ },
2501
+ "foreignKeys": {
2502
+ "issue_documents_company_id_companies_id_fk": {
2503
+ "name": "issue_documents_company_id_companies_id_fk",
2504
+ "tableFrom": "issue_documents",
2505
+ "tableTo": "companies",
2506
+ "columnsFrom": [
2507
+ "company_id"
2508
+ ],
2509
+ "columnsTo": [
2510
+ "id"
2511
+ ],
2512
+ "onDelete": "no action",
2513
+ "onUpdate": "no action"
2514
+ },
2515
+ "issue_documents_issue_id_issues_id_fk": {
2516
+ "name": "issue_documents_issue_id_issues_id_fk",
2517
+ "tableFrom": "issue_documents",
2518
+ "tableTo": "issues",
2519
+ "columnsFrom": [
2520
+ "issue_id"
2521
+ ],
2522
+ "columnsTo": [
2523
+ "id"
2524
+ ],
2525
+ "onDelete": "cascade",
2526
+ "onUpdate": "no action"
2527
+ },
2528
+ "issue_documents_document_id_documents_id_fk": {
2529
+ "name": "issue_documents_document_id_documents_id_fk",
2530
+ "tableFrom": "issue_documents",
2531
+ "tableTo": "documents",
2532
+ "columnsFrom": [
2533
+ "document_id"
2534
+ ],
2535
+ "columnsTo": [
2536
+ "id"
2537
+ ],
2538
+ "onDelete": "cascade",
2539
+ "onUpdate": "no action"
2540
+ }
2541
+ },
2542
+ "compositePrimaryKeys": {},
2543
+ "uniqueConstraints": {},
2544
+ "policies": {},
2545
+ "checkConstraints": {},
2546
+ "isRLSEnabled": false
2547
+ },
2548
+ "public.issue_relations": {
2549
+ "name": "issue_relations",
2550
+ "schema": "",
2551
+ "columns": {
2552
+ "id": {
2553
+ "name": "id",
2554
+ "type": "uuid",
2555
+ "primaryKey": true,
2556
+ "notNull": true,
2557
+ "default": "gen_random_uuid()"
2558
+ },
2559
+ "company_id": {
2560
+ "name": "company_id",
2561
+ "type": "uuid",
2562
+ "primaryKey": false,
2563
+ "notNull": true
2564
+ },
2565
+ "issue_id": {
2566
+ "name": "issue_id",
2567
+ "type": "uuid",
2568
+ "primaryKey": false,
2569
+ "notNull": true
2570
+ },
2571
+ "related_issue_id": {
2572
+ "name": "related_issue_id",
2573
+ "type": "uuid",
2574
+ "primaryKey": false,
2575
+ "notNull": true
2576
+ },
2577
+ "type": {
2578
+ "name": "type",
2579
+ "type": "text",
2580
+ "primaryKey": false,
2581
+ "notNull": true
2582
+ },
2583
+ "created_by_agent_id": {
2584
+ "name": "created_by_agent_id",
2585
+ "type": "uuid",
2586
+ "primaryKey": false,
2587
+ "notNull": false
2588
+ },
2589
+ "created_by_user_id": {
2590
+ "name": "created_by_user_id",
2591
+ "type": "text",
2592
+ "primaryKey": false,
2593
+ "notNull": false
2594
+ },
2595
+ "created_at": {
2596
+ "name": "created_at",
2597
+ "type": "timestamp with time zone",
2598
+ "primaryKey": false,
2599
+ "notNull": true,
2600
+ "default": "now()"
2601
+ },
2602
+ "updated_at": {
2603
+ "name": "updated_at",
2604
+ "type": "timestamp with time zone",
2605
+ "primaryKey": false,
2606
+ "notNull": true,
2607
+ "default": "now()"
2608
+ }
2609
+ },
2610
+ "indexes": {
2611
+ "issue_relations_company_issue_idx": {
2612
+ "name": "issue_relations_company_issue_idx",
2613
+ "columns": [
2614
+ {
2615
+ "expression": "company_id",
2616
+ "isExpression": false,
2617
+ "asc": true,
2618
+ "nulls": "last"
2619
+ },
2620
+ {
2621
+ "expression": "issue_id",
2622
+ "isExpression": false,
2623
+ "asc": true,
2624
+ "nulls": "last"
2625
+ }
2626
+ ],
2627
+ "isUnique": false,
2628
+ "concurrently": false,
2629
+ "method": "btree",
2630
+ "with": {}
2631
+ },
2632
+ "issue_relations_company_related_issue_idx": {
2633
+ "name": "issue_relations_company_related_issue_idx",
2634
+ "columns": [
2635
+ {
2636
+ "expression": "company_id",
2637
+ "isExpression": false,
2638
+ "asc": true,
2639
+ "nulls": "last"
2640
+ },
2641
+ {
2642
+ "expression": "related_issue_id",
2643
+ "isExpression": false,
2644
+ "asc": true,
2645
+ "nulls": "last"
2646
+ }
2647
+ ],
2648
+ "isUnique": false,
2649
+ "concurrently": false,
2650
+ "method": "btree",
2651
+ "with": {}
2652
+ },
2653
+ "issue_relations_company_type_idx": {
2654
+ "name": "issue_relations_company_type_idx",
2655
+ "columns": [
2656
+ {
2657
+ "expression": "company_id",
2658
+ "isExpression": false,
2659
+ "asc": true,
2660
+ "nulls": "last"
2661
+ },
2662
+ {
2663
+ "expression": "type",
2664
+ "isExpression": false,
2665
+ "asc": true,
2666
+ "nulls": "last"
2667
+ }
2668
+ ],
2669
+ "isUnique": false,
2670
+ "concurrently": false,
2671
+ "method": "btree",
2672
+ "with": {}
2673
+ },
2674
+ "issue_relations_company_edge_uq": {
2675
+ "name": "issue_relations_company_edge_uq",
2676
+ "columns": [
2677
+ {
2678
+ "expression": "company_id",
2679
+ "isExpression": false,
2680
+ "asc": true,
2681
+ "nulls": "last"
2682
+ },
2683
+ {
2684
+ "expression": "issue_id",
2685
+ "isExpression": false,
2686
+ "asc": true,
2687
+ "nulls": "last"
2688
+ },
2689
+ {
2690
+ "expression": "related_issue_id",
2691
+ "isExpression": false,
2692
+ "asc": true,
2693
+ "nulls": "last"
2694
+ },
2695
+ {
2696
+ "expression": "type",
2697
+ "isExpression": false,
2698
+ "asc": true,
2699
+ "nulls": "last"
2700
+ }
2701
+ ],
2702
+ "isUnique": true,
2703
+ "concurrently": false,
2704
+ "method": "btree",
2705
+ "with": {}
2706
+ }
2707
+ },
2708
+ "foreignKeys": {
2709
+ "issue_relations_company_id_companies_id_fk": {
2710
+ "name": "issue_relations_company_id_companies_id_fk",
2711
+ "tableFrom": "issue_relations",
2712
+ "tableTo": "companies",
2713
+ "columnsFrom": [
2714
+ "company_id"
2715
+ ],
2716
+ "columnsTo": [
2717
+ "id"
2718
+ ],
2719
+ "onDelete": "no action",
2720
+ "onUpdate": "no action"
2721
+ },
2722
+ "issue_relations_issue_id_issues_id_fk": {
2723
+ "name": "issue_relations_issue_id_issues_id_fk",
2724
+ "tableFrom": "issue_relations",
2725
+ "tableTo": "issues",
2726
+ "columnsFrom": [
2727
+ "issue_id"
2728
+ ],
2729
+ "columnsTo": [
2730
+ "id"
2731
+ ],
2732
+ "onDelete": "cascade",
2733
+ "onUpdate": "no action"
2734
+ },
2735
+ "issue_relations_related_issue_id_issues_id_fk": {
2736
+ "name": "issue_relations_related_issue_id_issues_id_fk",
2737
+ "tableFrom": "issue_relations",
2738
+ "tableTo": "issues",
2739
+ "columnsFrom": [
2740
+ "related_issue_id"
2741
+ ],
2742
+ "columnsTo": [
2743
+ "id"
2744
+ ],
2745
+ "onDelete": "cascade",
2746
+ "onUpdate": "no action"
2747
+ },
2748
+ "issue_relations_created_by_agent_id_agents_id_fk": {
2749
+ "name": "issue_relations_created_by_agent_id_agents_id_fk",
2750
+ "tableFrom": "issue_relations",
2751
+ "tableTo": "agents",
2752
+ "columnsFrom": [
2753
+ "created_by_agent_id"
2754
+ ],
2755
+ "columnsTo": [
2756
+ "id"
2757
+ ],
2758
+ "onDelete": "set null",
2759
+ "onUpdate": "no action"
2760
+ }
2761
+ },
2762
+ "compositePrimaryKeys": {},
2763
+ "uniqueConstraints": {},
2764
+ "policies": {},
2765
+ "checkConstraints": {},
2766
+ "isRLSEnabled": false
2767
+ },
2768
+ "public.issues": {
2769
+ "name": "issues",
2770
+ "schema": "",
2771
+ "columns": {
2772
+ "id": {
2773
+ "name": "id",
2774
+ "type": "uuid",
2775
+ "primaryKey": true,
2776
+ "notNull": true,
2777
+ "default": "gen_random_uuid()"
2778
+ },
2779
+ "company_id": {
2780
+ "name": "company_id",
2781
+ "type": "uuid",
2782
+ "primaryKey": false,
2783
+ "notNull": true
2784
+ },
2785
+ "project_id": {
2786
+ "name": "project_id",
2787
+ "type": "uuid",
2788
+ "primaryKey": false,
2789
+ "notNull": false
2790
+ },
2791
+ "project_workspace_id": {
2792
+ "name": "project_workspace_id",
2793
+ "type": "uuid",
2794
+ "primaryKey": false,
2795
+ "notNull": false
2796
+ },
2797
+ "goal_id": {
2798
+ "name": "goal_id",
2799
+ "type": "uuid",
2800
+ "primaryKey": false,
2801
+ "notNull": false
2802
+ },
2803
+ "parent_id": {
2804
+ "name": "parent_id",
2805
+ "type": "uuid",
2806
+ "primaryKey": false,
2807
+ "notNull": false
2808
+ },
2809
+ "title": {
2810
+ "name": "title",
2811
+ "type": "text",
2812
+ "primaryKey": false,
2813
+ "notNull": true
2814
+ },
2815
+ "description": {
2816
+ "name": "description",
2817
+ "type": "text",
2818
+ "primaryKey": false,
2819
+ "notNull": false
2820
+ },
2821
+ "status": {
2822
+ "name": "status",
2823
+ "type": "text",
2824
+ "primaryKey": false,
2825
+ "notNull": true,
2826
+ "default": "'backlog'"
2827
+ },
2828
+ "work_mode": {
2829
+ "name": "work_mode",
2830
+ "type": "text",
2831
+ "primaryKey": false,
2832
+ "notNull": true,
2833
+ "default": "'standard'"
2834
+ },
2835
+ "priority": {
2836
+ "name": "priority",
2837
+ "type": "text",
2838
+ "primaryKey": false,
2839
+ "notNull": true,
2840
+ "default": "'medium'"
2841
+ },
2842
+ "assignee_agent_id": {
2843
+ "name": "assignee_agent_id",
2844
+ "type": "uuid",
2845
+ "primaryKey": false,
2846
+ "notNull": false
2847
+ },
2848
+ "assignee_user_id": {
2849
+ "name": "assignee_user_id",
2850
+ "type": "text",
2851
+ "primaryKey": false,
2852
+ "notNull": false
2853
+ },
2854
+ "checkout_run_id": {
2855
+ "name": "checkout_run_id",
2856
+ "type": "uuid",
2857
+ "primaryKey": false,
2858
+ "notNull": false
2859
+ },
2860
+ "execution_run_id": {
2861
+ "name": "execution_run_id",
2862
+ "type": "uuid",
2863
+ "primaryKey": false,
2864
+ "notNull": false
2865
+ },
2866
+ "execution_agent_name_key": {
2867
+ "name": "execution_agent_name_key",
2868
+ "type": "text",
2869
+ "primaryKey": false,
2870
+ "notNull": false
2871
+ },
2872
+ "execution_locked_at": {
2873
+ "name": "execution_locked_at",
2874
+ "type": "timestamp with time zone",
2875
+ "primaryKey": false,
2876
+ "notNull": false
2877
+ },
2878
+ "created_by_agent_id": {
2879
+ "name": "created_by_agent_id",
2880
+ "type": "uuid",
2881
+ "primaryKey": false,
2882
+ "notNull": false
2883
+ },
2884
+ "created_by_user_id": {
2885
+ "name": "created_by_user_id",
2886
+ "type": "text",
2887
+ "primaryKey": false,
2888
+ "notNull": false
2889
+ },
2890
+ "issue_number": {
2891
+ "name": "issue_number",
2892
+ "type": "integer",
2893
+ "primaryKey": false,
2894
+ "notNull": false
2895
+ },
2896
+ "identifier": {
2897
+ "name": "identifier",
2898
+ "type": "text",
2899
+ "primaryKey": false,
2900
+ "notNull": false
2901
+ },
2902
+ "origin_kind": {
2903
+ "name": "origin_kind",
2904
+ "type": "text",
2905
+ "primaryKey": false,
2906
+ "notNull": true,
2907
+ "default": "'manual'"
2908
+ },
2909
+ "origin_id": {
2910
+ "name": "origin_id",
2911
+ "type": "text",
2912
+ "primaryKey": false,
2913
+ "notNull": false
2914
+ },
2915
+ "origin_run_id": {
2916
+ "name": "origin_run_id",
2917
+ "type": "text",
2918
+ "primaryKey": false,
2919
+ "notNull": false
2920
+ },
2921
+ "origin_fingerprint": {
2922
+ "name": "origin_fingerprint",
2923
+ "type": "text",
2924
+ "primaryKey": false,
2925
+ "notNull": true,
2926
+ "default": "'default'"
2927
+ },
2928
+ "request_depth": {
2929
+ "name": "request_depth",
2930
+ "type": "integer",
2931
+ "primaryKey": false,
2932
+ "notNull": true,
2933
+ "default": 0
2934
+ },
2935
+ "billing_code": {
2936
+ "name": "billing_code",
2937
+ "type": "text",
2938
+ "primaryKey": false,
2939
+ "notNull": false
2940
+ },
2941
+ "assignee_adapter_overrides": {
2942
+ "name": "assignee_adapter_overrides",
2943
+ "type": "jsonb",
2944
+ "primaryKey": false,
2945
+ "notNull": false
2946
+ },
2947
+ "execution_policy": {
2948
+ "name": "execution_policy",
2949
+ "type": "jsonb",
2950
+ "primaryKey": false,
2951
+ "notNull": false
2952
+ },
2953
+ "execution_state": {
2954
+ "name": "execution_state",
2955
+ "type": "jsonb",
2956
+ "primaryKey": false,
2957
+ "notNull": false
2958
+ },
2959
+ "monitor_next_check_at": {
2960
+ "name": "monitor_next_check_at",
2961
+ "type": "timestamp with time zone",
2962
+ "primaryKey": false,
2963
+ "notNull": false
2964
+ },
2965
+ "monitor_wake_requested_at": {
2966
+ "name": "monitor_wake_requested_at",
2967
+ "type": "timestamp with time zone",
2968
+ "primaryKey": false,
2969
+ "notNull": false
2970
+ },
2971
+ "monitor_last_triggered_at": {
2972
+ "name": "monitor_last_triggered_at",
2973
+ "type": "timestamp with time zone",
2974
+ "primaryKey": false,
2975
+ "notNull": false
2976
+ },
2977
+ "monitor_attempt_count": {
2978
+ "name": "monitor_attempt_count",
2979
+ "type": "integer",
2980
+ "primaryKey": false,
2981
+ "notNull": true,
2982
+ "default": 0
2983
+ },
2984
+ "monitor_notes": {
2985
+ "name": "monitor_notes",
2986
+ "type": "text",
2987
+ "primaryKey": false,
2988
+ "notNull": false
2989
+ },
2990
+ "monitor_scheduled_by": {
2991
+ "name": "monitor_scheduled_by",
2992
+ "type": "text",
2993
+ "primaryKey": false,
2994
+ "notNull": false
2995
+ },
2996
+ "execution_workspace_id": {
2997
+ "name": "execution_workspace_id",
2998
+ "type": "uuid",
2999
+ "primaryKey": false,
3000
+ "notNull": false
3001
+ },
3002
+ "execution_workspace_preference": {
3003
+ "name": "execution_workspace_preference",
3004
+ "type": "text",
3005
+ "primaryKey": false,
3006
+ "notNull": false
3007
+ },
3008
+ "execution_workspace_settings": {
3009
+ "name": "execution_workspace_settings",
3010
+ "type": "jsonb",
3011
+ "primaryKey": false,
3012
+ "notNull": false
3013
+ },
3014
+ "started_at": {
3015
+ "name": "started_at",
3016
+ "type": "timestamp with time zone",
3017
+ "primaryKey": false,
3018
+ "notNull": false
3019
+ },
3020
+ "completed_at": {
3021
+ "name": "completed_at",
3022
+ "type": "timestamp with time zone",
3023
+ "primaryKey": false,
3024
+ "notNull": false
3025
+ },
3026
+ "cancelled_at": {
3027
+ "name": "cancelled_at",
3028
+ "type": "timestamp with time zone",
3029
+ "primaryKey": false,
3030
+ "notNull": false
3031
+ },
3032
+ "hidden_at": {
3033
+ "name": "hidden_at",
3034
+ "type": "timestamp with time zone",
3035
+ "primaryKey": false,
3036
+ "notNull": false
3037
+ },
3038
+ "created_at": {
3039
+ "name": "created_at",
3040
+ "type": "timestamp with time zone",
3041
+ "primaryKey": false,
3042
+ "notNull": true,
3043
+ "default": "now()"
3044
+ },
3045
+ "updated_at": {
3046
+ "name": "updated_at",
3047
+ "type": "timestamp with time zone",
3048
+ "primaryKey": false,
3049
+ "notNull": true,
3050
+ "default": "now()"
3051
+ }
3052
+ },
3053
+ "indexes": {
3054
+ "issues_company_status_idx": {
3055
+ "name": "issues_company_status_idx",
3056
+ "columns": [
3057
+ {
3058
+ "expression": "company_id",
3059
+ "isExpression": false,
3060
+ "asc": true,
3061
+ "nulls": "last"
3062
+ },
3063
+ {
3064
+ "expression": "status",
3065
+ "isExpression": false,
3066
+ "asc": true,
3067
+ "nulls": "last"
3068
+ }
3069
+ ],
3070
+ "isUnique": false,
3071
+ "concurrently": false,
3072
+ "method": "btree",
3073
+ "with": {}
3074
+ },
3075
+ "issues_company_assignee_status_idx": {
3076
+ "name": "issues_company_assignee_status_idx",
3077
+ "columns": [
3078
+ {
3079
+ "expression": "company_id",
3080
+ "isExpression": false,
3081
+ "asc": true,
3082
+ "nulls": "last"
3083
+ },
3084
+ {
3085
+ "expression": "assignee_agent_id",
3086
+ "isExpression": false,
3087
+ "asc": true,
3088
+ "nulls": "last"
3089
+ },
3090
+ {
3091
+ "expression": "status",
3092
+ "isExpression": false,
3093
+ "asc": true,
3094
+ "nulls": "last"
3095
+ }
3096
+ ],
3097
+ "isUnique": false,
3098
+ "concurrently": false,
3099
+ "method": "btree",
3100
+ "with": {}
3101
+ },
3102
+ "issues_company_assignee_user_status_idx": {
3103
+ "name": "issues_company_assignee_user_status_idx",
3104
+ "columns": [
3105
+ {
3106
+ "expression": "company_id",
3107
+ "isExpression": false,
3108
+ "asc": true,
3109
+ "nulls": "last"
3110
+ },
3111
+ {
3112
+ "expression": "assignee_user_id",
3113
+ "isExpression": false,
3114
+ "asc": true,
3115
+ "nulls": "last"
3116
+ },
3117
+ {
3118
+ "expression": "status",
3119
+ "isExpression": false,
3120
+ "asc": true,
3121
+ "nulls": "last"
3122
+ }
3123
+ ],
3124
+ "isUnique": false,
3125
+ "concurrently": false,
3126
+ "method": "btree",
3127
+ "with": {}
3128
+ },
3129
+ "issues_company_parent_idx": {
3130
+ "name": "issues_company_parent_idx",
3131
+ "columns": [
3132
+ {
3133
+ "expression": "company_id",
3134
+ "isExpression": false,
3135
+ "asc": true,
3136
+ "nulls": "last"
3137
+ },
3138
+ {
3139
+ "expression": "parent_id",
3140
+ "isExpression": false,
3141
+ "asc": true,
3142
+ "nulls": "last"
3143
+ }
3144
+ ],
3145
+ "isUnique": false,
3146
+ "concurrently": false,
3147
+ "method": "btree",
3148
+ "with": {}
3149
+ },
3150
+ "issues_company_project_idx": {
3151
+ "name": "issues_company_project_idx",
3152
+ "columns": [
3153
+ {
3154
+ "expression": "company_id",
3155
+ "isExpression": false,
3156
+ "asc": true,
3157
+ "nulls": "last"
3158
+ },
3159
+ {
3160
+ "expression": "project_id",
3161
+ "isExpression": false,
3162
+ "asc": true,
3163
+ "nulls": "last"
3164
+ }
3165
+ ],
3166
+ "isUnique": false,
3167
+ "concurrently": false,
3168
+ "method": "btree",
3169
+ "with": {}
3170
+ },
3171
+ "issues_company_origin_idx": {
3172
+ "name": "issues_company_origin_idx",
3173
+ "columns": [
3174
+ {
3175
+ "expression": "company_id",
3176
+ "isExpression": false,
3177
+ "asc": true,
3178
+ "nulls": "last"
3179
+ },
3180
+ {
3181
+ "expression": "origin_kind",
3182
+ "isExpression": false,
3183
+ "asc": true,
3184
+ "nulls": "last"
3185
+ },
3186
+ {
3187
+ "expression": "origin_id",
3188
+ "isExpression": false,
3189
+ "asc": true,
3190
+ "nulls": "last"
3191
+ }
3192
+ ],
3193
+ "isUnique": false,
3194
+ "concurrently": false,
3195
+ "method": "btree",
3196
+ "with": {}
3197
+ },
3198
+ "issues_company_project_workspace_idx": {
3199
+ "name": "issues_company_project_workspace_idx",
3200
+ "columns": [
3201
+ {
3202
+ "expression": "company_id",
3203
+ "isExpression": false,
3204
+ "asc": true,
3205
+ "nulls": "last"
3206
+ },
3207
+ {
3208
+ "expression": "project_workspace_id",
3209
+ "isExpression": false,
3210
+ "asc": true,
3211
+ "nulls": "last"
3212
+ }
3213
+ ],
3214
+ "isUnique": false,
3215
+ "concurrently": false,
3216
+ "method": "btree",
3217
+ "with": {}
3218
+ },
3219
+ "issues_company_execution_workspace_idx": {
3220
+ "name": "issues_company_execution_workspace_idx",
3221
+ "columns": [
3222
+ {
3223
+ "expression": "company_id",
3224
+ "isExpression": false,
3225
+ "asc": true,
3226
+ "nulls": "last"
3227
+ },
3228
+ {
3229
+ "expression": "execution_workspace_id",
3230
+ "isExpression": false,
3231
+ "asc": true,
3232
+ "nulls": "last"
3233
+ }
3234
+ ],
3235
+ "isUnique": false,
3236
+ "concurrently": false,
3237
+ "method": "btree",
3238
+ "with": {}
3239
+ },
3240
+ "issues_company_monitor_due_idx": {
3241
+ "name": "issues_company_monitor_due_idx",
3242
+ "columns": [
3243
+ {
3244
+ "expression": "company_id",
3245
+ "isExpression": false,
3246
+ "asc": true,
3247
+ "nulls": "last"
3248
+ },
3249
+ {
3250
+ "expression": "monitor_next_check_at",
3251
+ "isExpression": false,
3252
+ "asc": true,
3253
+ "nulls": "last"
3254
+ }
3255
+ ],
3256
+ "isUnique": false,
3257
+ "concurrently": false,
3258
+ "method": "btree",
3259
+ "with": {}
3260
+ },
3261
+ "issues_identifier_idx": {
3262
+ "name": "issues_identifier_idx",
3263
+ "columns": [
3264
+ {
3265
+ "expression": "identifier",
3266
+ "isExpression": false,
3267
+ "asc": true,
3268
+ "nulls": "last"
3269
+ }
3270
+ ],
3271
+ "isUnique": true,
3272
+ "concurrently": false,
3273
+ "method": "btree",
3274
+ "with": {}
3275
+ },
3276
+ "issues_open_routine_execution_uq": {
3277
+ "name": "issues_open_routine_execution_uq",
3278
+ "columns": [
3279
+ {
3280
+ "expression": "company_id",
3281
+ "isExpression": false,
3282
+ "asc": true,
3283
+ "nulls": "last"
3284
+ },
3285
+ {
3286
+ "expression": "origin_kind",
3287
+ "isExpression": false,
3288
+ "asc": true,
3289
+ "nulls": "last"
3290
+ },
3291
+ {
3292
+ "expression": "origin_id",
3293
+ "isExpression": false,
3294
+ "asc": true,
3295
+ "nulls": "last"
3296
+ },
3297
+ {
3298
+ "expression": "origin_fingerprint",
3299
+ "isExpression": false,
3300
+ "asc": true,
3301
+ "nulls": "last"
3302
+ }
3303
+ ],
3304
+ "isUnique": true,
3305
+ "where": "\"issues\".\"origin_kind\" = 'routine_execution'\n and \"issues\".\"origin_id\" is not null\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"execution_run_id\" is not null\n and \"issues\".\"status\" in ('backlog', 'todo', 'in_progress', 'in_review', 'blocked')",
3306
+ "concurrently": false,
3307
+ "method": "btree",
3308
+ "with": {}
3309
+ },
3310
+ "issues_active_liveness_recovery_incident_uq": {
3311
+ "name": "issues_active_liveness_recovery_incident_uq",
3312
+ "columns": [
3313
+ {
3314
+ "expression": "company_id",
3315
+ "isExpression": false,
3316
+ "asc": true,
3317
+ "nulls": "last"
3318
+ },
3319
+ {
3320
+ "expression": "origin_kind",
3321
+ "isExpression": false,
3322
+ "asc": true,
3323
+ "nulls": "last"
3324
+ },
3325
+ {
3326
+ "expression": "origin_id",
3327
+ "isExpression": false,
3328
+ "asc": true,
3329
+ "nulls": "last"
3330
+ }
3331
+ ],
3332
+ "isUnique": true,
3333
+ "where": "\"issues\".\"origin_kind\" = 'harness_liveness_escalation'\n and \"issues\".\"origin_id\" is not null\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"status\" not in ('done', 'cancelled')",
3334
+ "concurrently": false,
3335
+ "method": "btree",
3336
+ "with": {}
3337
+ },
3338
+ "issues_active_liveness_recovery_leaf_uq": {
3339
+ "name": "issues_active_liveness_recovery_leaf_uq",
3340
+ "columns": [
3341
+ {
3342
+ "expression": "company_id",
3343
+ "isExpression": false,
3344
+ "asc": true,
3345
+ "nulls": "last"
3346
+ },
3347
+ {
3348
+ "expression": "origin_kind",
3349
+ "isExpression": false,
3350
+ "asc": true,
3351
+ "nulls": "last"
3352
+ },
3353
+ {
3354
+ "expression": "origin_fingerprint",
3355
+ "isExpression": false,
3356
+ "asc": true,
3357
+ "nulls": "last"
3358
+ }
3359
+ ],
3360
+ "isUnique": true,
3361
+ "where": "\"issues\".\"origin_kind\" = 'harness_liveness_escalation'\n and \"issues\".\"origin_fingerprint\" <> 'default'\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"status\" not in ('done', 'cancelled')",
3362
+ "concurrently": false,
3363
+ "method": "btree",
3364
+ "with": {}
3365
+ },
3366
+ "issues_active_stale_run_evaluation_uq": {
3367
+ "name": "issues_active_stale_run_evaluation_uq",
3368
+ "columns": [
3369
+ {
3370
+ "expression": "company_id",
3371
+ "isExpression": false,
3372
+ "asc": true,
3373
+ "nulls": "last"
3374
+ },
3375
+ {
3376
+ "expression": "origin_kind",
3377
+ "isExpression": false,
3378
+ "asc": true,
3379
+ "nulls": "last"
3380
+ },
3381
+ {
3382
+ "expression": "origin_id",
3383
+ "isExpression": false,
3384
+ "asc": true,
3385
+ "nulls": "last"
3386
+ }
3387
+ ],
3388
+ "isUnique": true,
3389
+ "where": "\"issues\".\"origin_kind\" = 'stale_active_run_evaluation'\n and \"issues\".\"origin_id\" is not null\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"status\" not in ('done', 'cancelled')",
3390
+ "concurrently": false,
3391
+ "method": "btree",
3392
+ "with": {}
3393
+ },
3394
+ "issues_active_productivity_review_uq": {
3395
+ "name": "issues_active_productivity_review_uq",
3396
+ "columns": [
3397
+ {
3398
+ "expression": "company_id",
3399
+ "isExpression": false,
3400
+ "asc": true,
3401
+ "nulls": "last"
3402
+ },
3403
+ {
3404
+ "expression": "origin_kind",
3405
+ "isExpression": false,
3406
+ "asc": true,
3407
+ "nulls": "last"
3408
+ },
3409
+ {
3410
+ "expression": "origin_id",
3411
+ "isExpression": false,
3412
+ "asc": true,
3413
+ "nulls": "last"
3414
+ }
3415
+ ],
3416
+ "isUnique": true,
3417
+ "where": "\"issues\".\"origin_kind\" = 'issue_productivity_review'\n and \"issues\".\"origin_id\" is not null\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"status\" not in ('done', 'cancelled')",
3418
+ "concurrently": false,
3419
+ "method": "btree",
3420
+ "with": {}
3421
+ },
3422
+ "issues_active_stranded_issue_recovery_uq": {
3423
+ "name": "issues_active_stranded_issue_recovery_uq",
3424
+ "columns": [
3425
+ {
3426
+ "expression": "company_id",
3427
+ "isExpression": false,
3428
+ "asc": true,
3429
+ "nulls": "last"
3430
+ },
3431
+ {
3432
+ "expression": "origin_kind",
3433
+ "isExpression": false,
3434
+ "asc": true,
3435
+ "nulls": "last"
3436
+ },
3437
+ {
3438
+ "expression": "origin_id",
3439
+ "isExpression": false,
3440
+ "asc": true,
3441
+ "nulls": "last"
3442
+ }
3443
+ ],
3444
+ "isUnique": true,
3445
+ "where": "\"issues\".\"origin_kind\" = 'stranded_issue_recovery'\n and \"issues\".\"origin_id\" is not null\n and \"issues\".\"hidden_at\" is null\n and \"issues\".\"status\" not in ('done', 'cancelled')",
3446
+ "concurrently": false,
3447
+ "method": "btree",
3448
+ "with": {}
3449
+ }
3450
+ },
3451
+ "foreignKeys": {
3452
+ "issues_company_id_companies_id_fk": {
3453
+ "name": "issues_company_id_companies_id_fk",
3454
+ "tableFrom": "issues",
3455
+ "tableTo": "companies",
3456
+ "columnsFrom": [
3457
+ "company_id"
3458
+ ],
3459
+ "columnsTo": [
3460
+ "id"
3461
+ ],
3462
+ "onDelete": "no action",
3463
+ "onUpdate": "no action"
3464
+ },
3465
+ "issues_project_id_projects_id_fk": {
3466
+ "name": "issues_project_id_projects_id_fk",
3467
+ "tableFrom": "issues",
3468
+ "tableTo": "projects",
3469
+ "columnsFrom": [
3470
+ "project_id"
3471
+ ],
3472
+ "columnsTo": [
3473
+ "id"
3474
+ ],
3475
+ "onDelete": "no action",
3476
+ "onUpdate": "no action"
3477
+ },
3478
+ "issues_project_workspace_id_project_workspaces_id_fk": {
3479
+ "name": "issues_project_workspace_id_project_workspaces_id_fk",
3480
+ "tableFrom": "issues",
3481
+ "tableTo": "project_workspaces",
3482
+ "columnsFrom": [
3483
+ "project_workspace_id"
3484
+ ],
3485
+ "columnsTo": [
3486
+ "id"
3487
+ ],
3488
+ "onDelete": "set null",
3489
+ "onUpdate": "no action"
3490
+ },
3491
+ "issues_parent_id_issues_id_fk": {
3492
+ "name": "issues_parent_id_issues_id_fk",
3493
+ "tableFrom": "issues",
3494
+ "tableTo": "issues",
3495
+ "columnsFrom": [
3496
+ "parent_id"
3497
+ ],
3498
+ "columnsTo": [
3499
+ "id"
3500
+ ],
3501
+ "onDelete": "no action",
3502
+ "onUpdate": "no action"
3503
+ },
3504
+ "issues_assignee_agent_id_agents_id_fk": {
3505
+ "name": "issues_assignee_agent_id_agents_id_fk",
3506
+ "tableFrom": "issues",
3507
+ "tableTo": "agents",
3508
+ "columnsFrom": [
3509
+ "assignee_agent_id"
3510
+ ],
3511
+ "columnsTo": [
3512
+ "id"
3513
+ ],
3514
+ "onDelete": "no action",
3515
+ "onUpdate": "no action"
3516
+ },
3517
+ "issues_checkout_run_id_heartbeat_runs_id_fk": {
3518
+ "name": "issues_checkout_run_id_heartbeat_runs_id_fk",
3519
+ "tableFrom": "issues",
3520
+ "tableTo": "heartbeat_runs",
3521
+ "columnsFrom": [
3522
+ "checkout_run_id"
3523
+ ],
3524
+ "columnsTo": [
3525
+ "id"
3526
+ ],
3527
+ "onDelete": "set null",
3528
+ "onUpdate": "no action"
3529
+ },
3530
+ "issues_execution_run_id_heartbeat_runs_id_fk": {
3531
+ "name": "issues_execution_run_id_heartbeat_runs_id_fk",
3532
+ "tableFrom": "issues",
3533
+ "tableTo": "heartbeat_runs",
3534
+ "columnsFrom": [
3535
+ "execution_run_id"
3536
+ ],
3537
+ "columnsTo": [
3538
+ "id"
3539
+ ],
3540
+ "onDelete": "set null",
3541
+ "onUpdate": "no action"
3542
+ },
3543
+ "issues_created_by_agent_id_agents_id_fk": {
3544
+ "name": "issues_created_by_agent_id_agents_id_fk",
3545
+ "tableFrom": "issues",
3546
+ "tableTo": "agents",
3547
+ "columnsFrom": [
3548
+ "created_by_agent_id"
3549
+ ],
3550
+ "columnsTo": [
3551
+ "id"
3552
+ ],
3553
+ "onDelete": "no action",
3554
+ "onUpdate": "no action"
3555
+ }
3556
+ },
3557
+ "compositePrimaryKeys": {},
3558
+ "uniqueConstraints": {},
3559
+ "policies": {},
3560
+ "checkConstraints": {},
3561
+ "isRLSEnabled": false
3562
+ },
3563
+ "public.project_workspaces": {
3564
+ "name": "project_workspaces",
3565
+ "schema": "",
3566
+ "columns": {
3567
+ "id": {
3568
+ "name": "id",
3569
+ "type": "uuid",
3570
+ "primaryKey": true,
3571
+ "notNull": true,
3572
+ "default": "gen_random_uuid()"
3573
+ },
3574
+ "company_id": {
3575
+ "name": "company_id",
3576
+ "type": "uuid",
3577
+ "primaryKey": false,
3578
+ "notNull": true
3579
+ },
3580
+ "project_id": {
3581
+ "name": "project_id",
3582
+ "type": "uuid",
3583
+ "primaryKey": false,
3584
+ "notNull": true
3585
+ },
3586
+ "name": {
3587
+ "name": "name",
3588
+ "type": "text",
3589
+ "primaryKey": false,
3590
+ "notNull": true
3591
+ },
3592
+ "source_type": {
3593
+ "name": "source_type",
3594
+ "type": "text",
3595
+ "primaryKey": false,
3596
+ "notNull": true,
3597
+ "default": "'local_path'"
3598
+ },
3599
+ "cwd": {
3600
+ "name": "cwd",
3601
+ "type": "text",
3602
+ "primaryKey": false,
3603
+ "notNull": false
3604
+ },
3605
+ "repo_url": {
3606
+ "name": "repo_url",
3607
+ "type": "text",
3608
+ "primaryKey": false,
3609
+ "notNull": false
3610
+ },
3611
+ "repo_ref": {
3612
+ "name": "repo_ref",
3613
+ "type": "text",
3614
+ "primaryKey": false,
3615
+ "notNull": false
3616
+ },
3617
+ "default_ref": {
3618
+ "name": "default_ref",
3619
+ "type": "text",
3620
+ "primaryKey": false,
3621
+ "notNull": false
3622
+ },
3623
+ "visibility": {
3624
+ "name": "visibility",
3625
+ "type": "text",
3626
+ "primaryKey": false,
3627
+ "notNull": true,
3628
+ "default": "'default'"
3629
+ },
3630
+ "setup_command": {
3631
+ "name": "setup_command",
3632
+ "type": "text",
3633
+ "primaryKey": false,
3634
+ "notNull": false
3635
+ },
3636
+ "cleanup_command": {
3637
+ "name": "cleanup_command",
3638
+ "type": "text",
3639
+ "primaryKey": false,
3640
+ "notNull": false
3641
+ },
3642
+ "remote_provider": {
3643
+ "name": "remote_provider",
3644
+ "type": "text",
3645
+ "primaryKey": false,
3646
+ "notNull": false
3647
+ },
3648
+ "remote_workspace_ref": {
3649
+ "name": "remote_workspace_ref",
3650
+ "type": "text",
3651
+ "primaryKey": false,
3652
+ "notNull": false
3653
+ },
3654
+ "shared_workspace_key": {
3655
+ "name": "shared_workspace_key",
3656
+ "type": "text",
3657
+ "primaryKey": false,
3658
+ "notNull": false
3659
+ },
3660
+ "metadata": {
3661
+ "name": "metadata",
3662
+ "type": "jsonb",
3663
+ "primaryKey": false,
3664
+ "notNull": false
3665
+ },
3666
+ "is_primary": {
3667
+ "name": "is_primary",
3668
+ "type": "boolean",
3669
+ "primaryKey": false,
3670
+ "notNull": true,
3671
+ "default": false
3672
+ },
3673
+ "created_at": {
3674
+ "name": "created_at",
3675
+ "type": "timestamp with time zone",
3676
+ "primaryKey": false,
3677
+ "notNull": true,
3678
+ "default": "now()"
3679
+ },
3680
+ "updated_at": {
3681
+ "name": "updated_at",
3682
+ "type": "timestamp with time zone",
3683
+ "primaryKey": false,
3684
+ "notNull": true,
3685
+ "default": "now()"
3686
+ }
3687
+ },
3688
+ "indexes": {
3689
+ "project_workspaces_company_project_idx": {
3690
+ "name": "project_workspaces_company_project_idx",
3691
+ "columns": [
3692
+ {
3693
+ "expression": "company_id",
3694
+ "isExpression": false,
3695
+ "asc": true,
3696
+ "nulls": "last"
3697
+ },
3698
+ {
3699
+ "expression": "project_id",
3700
+ "isExpression": false,
3701
+ "asc": true,
3702
+ "nulls": "last"
3703
+ }
3704
+ ],
3705
+ "isUnique": false,
3706
+ "concurrently": false,
3707
+ "method": "btree",
3708
+ "with": {}
3709
+ },
3710
+ "project_workspaces_project_primary_idx": {
3711
+ "name": "project_workspaces_project_primary_idx",
3712
+ "columns": [
3713
+ {
3714
+ "expression": "project_id",
3715
+ "isExpression": false,
3716
+ "asc": true,
3717
+ "nulls": "last"
3718
+ },
3719
+ {
3720
+ "expression": "is_primary",
3721
+ "isExpression": false,
3722
+ "asc": true,
3723
+ "nulls": "last"
3724
+ }
3725
+ ],
3726
+ "isUnique": false,
3727
+ "concurrently": false,
3728
+ "method": "btree",
3729
+ "with": {}
3730
+ },
3731
+ "project_workspaces_project_source_type_idx": {
3732
+ "name": "project_workspaces_project_source_type_idx",
3733
+ "columns": [
3734
+ {
3735
+ "expression": "project_id",
3736
+ "isExpression": false,
3737
+ "asc": true,
3738
+ "nulls": "last"
3739
+ },
3740
+ {
3741
+ "expression": "source_type",
3742
+ "isExpression": false,
3743
+ "asc": true,
3744
+ "nulls": "last"
3745
+ }
3746
+ ],
3747
+ "isUnique": false,
3748
+ "concurrently": false,
3749
+ "method": "btree",
3750
+ "with": {}
3751
+ },
3752
+ "project_workspaces_company_shared_key_idx": {
3753
+ "name": "project_workspaces_company_shared_key_idx",
3754
+ "columns": [
3755
+ {
3756
+ "expression": "company_id",
3757
+ "isExpression": false,
3758
+ "asc": true,
3759
+ "nulls": "last"
3760
+ },
3761
+ {
3762
+ "expression": "shared_workspace_key",
3763
+ "isExpression": false,
3764
+ "asc": true,
3765
+ "nulls": "last"
3766
+ }
3767
+ ],
3768
+ "isUnique": false,
3769
+ "concurrently": false,
3770
+ "method": "btree",
3771
+ "with": {}
3772
+ },
3773
+ "project_workspaces_project_remote_ref_idx": {
3774
+ "name": "project_workspaces_project_remote_ref_idx",
3775
+ "columns": [
3776
+ {
3777
+ "expression": "project_id",
3778
+ "isExpression": false,
3779
+ "asc": true,
3780
+ "nulls": "last"
3781
+ },
3782
+ {
3783
+ "expression": "remote_provider",
3784
+ "isExpression": false,
3785
+ "asc": true,
3786
+ "nulls": "last"
3787
+ },
3788
+ {
3789
+ "expression": "remote_workspace_ref",
3790
+ "isExpression": false,
3791
+ "asc": true,
3792
+ "nulls": "last"
3793
+ }
3794
+ ],
3795
+ "isUnique": true,
3796
+ "concurrently": false,
3797
+ "method": "btree",
3798
+ "with": {}
3799
+ }
3800
+ },
3801
+ "foreignKeys": {
3802
+ "project_workspaces_company_id_companies_id_fk": {
3803
+ "name": "project_workspaces_company_id_companies_id_fk",
3804
+ "tableFrom": "project_workspaces",
3805
+ "tableTo": "companies",
3806
+ "columnsFrom": [
3807
+ "company_id"
3808
+ ],
3809
+ "columnsTo": [
3810
+ "id"
3811
+ ],
3812
+ "onDelete": "no action",
3813
+ "onUpdate": "no action"
3814
+ },
3815
+ "project_workspaces_project_id_projects_id_fk": {
3816
+ "name": "project_workspaces_project_id_projects_id_fk",
3817
+ "tableFrom": "project_workspaces",
3818
+ "tableTo": "projects",
3819
+ "columnsFrom": [
3820
+ "project_id"
3821
+ ],
3822
+ "columnsTo": [
3823
+ "id"
3824
+ ],
3825
+ "onDelete": "cascade",
3826
+ "onUpdate": "no action"
3827
+ }
3828
+ },
3829
+ "compositePrimaryKeys": {},
3830
+ "uniqueConstraints": {},
3831
+ "policies": {},
3832
+ "checkConstraints": {},
3833
+ "isRLSEnabled": false
3834
+ },
3835
+ "public.projects": {
3836
+ "name": "projects",
3837
+ "schema": "",
3838
+ "columns": {
3839
+ "id": {
3840
+ "name": "id",
3841
+ "type": "uuid",
3842
+ "primaryKey": true,
3843
+ "notNull": true,
3844
+ "default": "gen_random_uuid()"
3845
+ },
3846
+ "company_id": {
3847
+ "name": "company_id",
3848
+ "type": "uuid",
3849
+ "primaryKey": false,
3850
+ "notNull": true
3851
+ },
3852
+ "goal_id": {
3853
+ "name": "goal_id",
3854
+ "type": "uuid",
3855
+ "primaryKey": false,
3856
+ "notNull": false
3857
+ },
3858
+ "name": {
3859
+ "name": "name",
3860
+ "type": "text",
3861
+ "primaryKey": false,
3862
+ "notNull": true
3863
+ },
3864
+ "description": {
3865
+ "name": "description",
3866
+ "type": "text",
3867
+ "primaryKey": false,
3868
+ "notNull": false
3869
+ },
3870
+ "status": {
3871
+ "name": "status",
3872
+ "type": "text",
3873
+ "primaryKey": false,
3874
+ "notNull": true,
3875
+ "default": "'backlog'"
3876
+ },
3877
+ "lead_agent_id": {
3878
+ "name": "lead_agent_id",
3879
+ "type": "uuid",
3880
+ "primaryKey": false,
3881
+ "notNull": false
3882
+ },
3883
+ "target_date": {
3884
+ "name": "target_date",
3885
+ "type": "date",
3886
+ "primaryKey": false,
3887
+ "notNull": false
3888
+ },
3889
+ "color": {
3890
+ "name": "color",
3891
+ "type": "text",
3892
+ "primaryKey": false,
3893
+ "notNull": false
3894
+ },
3895
+ "env": {
3896
+ "name": "env",
3897
+ "type": "jsonb",
3898
+ "primaryKey": false,
3899
+ "notNull": false
3900
+ },
3901
+ "pause_reason": {
3902
+ "name": "pause_reason",
3903
+ "type": "text",
3904
+ "primaryKey": false,
3905
+ "notNull": false
3906
+ },
3907
+ "paused_at": {
3908
+ "name": "paused_at",
3909
+ "type": "timestamp with time zone",
3910
+ "primaryKey": false,
3911
+ "notNull": false
3912
+ },
3913
+ "execution_workspace_policy": {
3914
+ "name": "execution_workspace_policy",
3915
+ "type": "jsonb",
3916
+ "primaryKey": false,
3917
+ "notNull": false
3918
+ },
3919
+ "archived_at": {
3920
+ "name": "archived_at",
3921
+ "type": "timestamp with time zone",
3922
+ "primaryKey": false,
3923
+ "notNull": false
3924
+ },
3925
+ "created_at": {
3926
+ "name": "created_at",
3927
+ "type": "timestamp with time zone",
3928
+ "primaryKey": false,
3929
+ "notNull": true,
3930
+ "default": "now()"
3931
+ },
3932
+ "updated_at": {
3933
+ "name": "updated_at",
3934
+ "type": "timestamp with time zone",
3935
+ "primaryKey": false,
3936
+ "notNull": true,
3937
+ "default": "now()"
3938
+ }
3939
+ },
3940
+ "indexes": {
3941
+ "projects_company_idx": {
3942
+ "name": "projects_company_idx",
3943
+ "columns": [
3944
+ {
3945
+ "expression": "company_id",
3946
+ "isExpression": false,
3947
+ "asc": true,
3948
+ "nulls": "last"
3949
+ }
3950
+ ],
3951
+ "isUnique": false,
3952
+ "concurrently": false,
3953
+ "method": "btree",
3954
+ "with": {}
3955
+ }
3956
+ },
3957
+ "foreignKeys": {
3958
+ "projects_company_id_companies_id_fk": {
3959
+ "name": "projects_company_id_companies_id_fk",
3960
+ "tableFrom": "projects",
3961
+ "tableTo": "companies",
3962
+ "columnsFrom": [
3963
+ "company_id"
3964
+ ],
3965
+ "columnsTo": [
3966
+ "id"
3967
+ ],
3968
+ "onDelete": "no action",
3969
+ "onUpdate": "no action"
3970
+ },
3971
+ "projects_lead_agent_id_agents_id_fk": {
3972
+ "name": "projects_lead_agent_id_agents_id_fk",
3973
+ "tableFrom": "projects",
3974
+ "tableTo": "agents",
3975
+ "columnsFrom": [
3976
+ "lead_agent_id"
3977
+ ],
3978
+ "columnsTo": [
3979
+ "id"
3980
+ ],
3981
+ "onDelete": "no action",
3982
+ "onUpdate": "no action"
3983
+ }
3984
+ },
3985
+ "compositePrimaryKeys": {},
3986
+ "uniqueConstraints": {},
3987
+ "policies": {},
3988
+ "checkConstraints": {},
3989
+ "isRLSEnabled": false
3990
+ }
3991
+ },
3992
+ "enums": {},
3993
+ "schemas": {},
3994
+ "sequences": {},
3995
+ "roles": {},
3996
+ "policies": {},
3997
+ "views": {},
3998
+ "_meta": {
3999
+ "columns": {},
4000
+ "schemas": {},
4001
+ "tables": {}
4002
+ }
4003
+ }