@crewx/sdk 0.9.0-rc.14 → 0.9.0-rc.141

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 (288) hide show
  1. package/README.md +1 -1
  2. package/dist/account/auth-client.d.ts +61 -0
  3. package/dist/account/auth-json-v2.d.ts +1 -0
  4. package/dist/account/auth-json.d.ts +30 -0
  5. package/dist/account/config.d.ts +37 -0
  6. package/dist/account/env-bootstrap.d.ts +11 -0
  7. package/dist/account/errors.d.ts +24 -0
  8. package/dist/account/index.d.ts +12 -0
  9. package/dist/account/index.js +2 -0
  10. package/dist/account/session-manager.d.ts +47 -0
  11. package/dist/activity-log/builder.d.ts +59 -6
  12. package/dist/agent/agent-list-view.d.ts +19 -0
  13. package/dist/app/app.d.ts +148 -0
  14. package/dist/app/backend-env.d.ts +3 -0
  15. package/dist/app/content-media-types.d.ts +2 -0
  16. package/dist/app/context.d.ts +2 -0
  17. package/dist/app/entry.d.ts +7 -0
  18. package/dist/app/frame.d.ts +56 -0
  19. package/dist/app/index.d.ts +10 -0
  20. package/dist/app/index.js +10 -0
  21. package/dist/app/protocol.d.ts +9 -0
  22. package/dist/app/runtime.d.ts +21 -0
  23. package/dist/app/tool-mode.d.ts +3 -0
  24. package/dist/boxing/box.types.d.ts +4 -0
  25. package/dist/config/canonicalize-agent-options.d.ts +18 -0
  26. package/dist/config/default-agent-models.d.ts +11 -0
  27. package/dist/config/global-settings.d.ts +33 -0
  28. package/dist/config/migrate-grok-mode.d.ts +6 -0
  29. package/dist/config/model-compat.d.ts +31 -0
  30. package/dist/config/models.generated.d.ts +37 -0
  31. package/dist/config/models.remote.d.ts +1 -0
  32. package/dist/config/overdrive.d.ts +7 -0
  33. package/dist/config/pricing.d.ts +6 -3
  34. package/dist/config/pricing.generated.d.ts +4 -0
  35. package/dist/config/pricing.types.d.ts +4 -0
  36. package/dist/config/timeout.config.d.ts +4 -0
  37. package/dist/config/wi-boards.d.ts +19 -0
  38. package/dist/context-budget/continuity.d.ts +61 -0
  39. package/dist/context-budget/index.d.ts +141 -0
  40. package/dist/conversation/index.d.ts +1 -1
  41. package/dist/conversation/sqlite-provider.d.ts +6 -3
  42. package/dist/conversation/to-template-messages.d.ts +9 -0
  43. package/dist/conversation/types.d.ts +48 -1
  44. package/dist/desktop/command-runner.d.ts +4 -0
  45. package/dist/desktop/default-adapters.d.ts +4 -0
  46. package/dist/desktop/global-install.d.ts +19 -0
  47. package/dist/desktop/index.d.ts +3 -0
  48. package/dist/desktop/index.js +3 -0
  49. package/dist/desktop/install.d.ts +5 -0
  50. package/dist/desktop/lnk.d.ts +22 -0
  51. package/dist/desktop/manifest.d.ts +21 -0
  52. package/dist/desktop/types.d.ts +67 -0
  53. package/dist/desktop/version.d.ts +1 -0
  54. package/dist/desktop/windows-paths.d.ts +21 -0
  55. package/dist/desktop/wrapper.d.ts +18 -0
  56. package/dist/esm/account/index.js +2 -0
  57. package/dist/esm/app/index.js +10 -0
  58. package/dist/esm/desktop/index.js +3 -0
  59. package/dist/esm/index.js +1104 -226
  60. package/dist/esm/node/index.js +2 -0
  61. package/dist/esm/plugins/index.js +474 -216
  62. package/dist/esm/process/index.js +1 -0
  63. package/dist/esm/publish/index.js +2 -0
  64. package/dist/esm/repository/index.js +586 -213
  65. package/dist/esm/skills/index.js +2 -0
  66. package/dist/esm/testing/index.js +1 -1
  67. package/dist/events/types.d.ts +9 -0
  68. package/dist/facade/Crewx.d.ts +60 -5
  69. package/dist/facade/task-ticket.d.ts +14 -0
  70. package/dist/highlight/thread-highlight-prompt.d.ts +2 -0
  71. package/dist/highlight/thread-highlighter.d.ts +326 -0
  72. package/dist/index.browser.d.ts +17 -1
  73. package/dist/index.browser.js +6 -2
  74. package/dist/index.d.ts +125 -17
  75. package/dist/index.js +1104 -226
  76. package/dist/internal/console-decoder.d.ts +38 -0
  77. package/dist/internal/windows-spawn.d.ts +10 -0
  78. package/dist/layout/types.d.ts +18 -1
  79. package/dist/lifecycle/process-lease.d.ts +80 -0
  80. package/dist/lifecycle/process-owner.d.ts +20 -0
  81. package/dist/lifecycle/task-heartbeat.d.ts +41 -0
  82. package/dist/lifecycle/task-stop.d.ts +82 -0
  83. package/dist/lifecycle/update-admission.d.ts +45 -0
  84. package/dist/local-server/base-url.d.ts +18 -0
  85. package/dist/local-server/index.d.ts +8 -0
  86. package/dist/local-server/opencode.d.ts +8 -0
  87. package/dist/local-server/probe.d.ts +3 -0
  88. package/dist/local-server/runtime.d.ts +26 -0
  89. package/dist/local-server/types.d.ts +43 -0
  90. package/dist/mcp-app/agent-access.d.ts +26 -0
  91. package/dist/mcp-app/apps-context.d.ts +20 -0
  92. package/dist/mcp-app/bundle-provenance.d.ts +3 -0
  93. package/dist/mcp-app/catalog.d.ts +7 -0
  94. package/dist/mcp-app/content-channel.d.ts +86 -0
  95. package/dist/mcp-app/content-declarations.d.ts +31 -0
  96. package/dist/mcp-app/dev-checks.d.ts +29 -0
  97. package/dist/mcp-app/diagnostic-reason.d.ts +3 -0
  98. package/dist/mcp-app/discovery.d.ts +160 -0
  99. package/dist/mcp-app/errors.d.ts +7 -0
  100. package/dist/mcp-app/index.d.ts +33 -0
  101. package/dist/mcp-app/installed-app-ref.d.ts +25 -0
  102. package/dist/mcp-app/model-context.d.ts +29 -0
  103. package/dist/mcp-app/node-app-discovery-fs.d.ts +23 -0
  104. package/dist/mcp-app/product-bundle-assets.d.ts +27 -0
  105. package/dist/mcp-app/product-bundle-loader.d.ts +53 -0
  106. package/dist/mcp-app/projection.d.ts +14 -0
  107. package/dist/mcp-app/registry.d.ts +28 -0
  108. package/dist/mcp-app/skill-backend.d.ts +132 -0
  109. package/dist/mcp-app/state-set.d.ts +9 -0
  110. package/dist/mcp-app/types.d.ts +472 -0
  111. package/dist/mcp-app/workspace-app-assets.d.ts +42 -0
  112. package/dist/mcp-app/workspace-app-scan-cache.d.ts +24 -0
  113. package/dist/mcp-app/workspace-snapshot.d.ts +71 -0
  114. package/dist/migrations/0011_far_black_tarantula.sql +1 -0
  115. package/dist/migrations/0012_blue_turbo.sql +23 -0
  116. package/dist/migrations/0013_hesitant_adam_destine.sql +15 -0
  117. package/dist/migrations/0014_organic_mongu.sql +73 -0
  118. package/dist/migrations/0015_panoramic_gorilla_man.sql +71 -0
  119. package/dist/migrations/0016_fuzzy_hemingway.sql +14 -0
  120. package/dist/migrations/0017_project_stage_sdk_migration.sql +29 -0
  121. package/dist/migrations/0018_bored_jackal.sql +33 -0
  122. package/dist/migrations/0019_backfill_task_thread_ids.sql +74 -0
  123. package/dist/migrations/0020_useful_iron_lad.sql +55 -0
  124. package/dist/migrations/0021_dashing_peter_quill.sql +51 -0
  125. package/dist/migrations/0022_wandering_bucky.sql +1 -0
  126. package/dist/migrations/0023_red_payback.sql +1 -0
  127. package/dist/migrations/0024_storage_metadata.sql +262 -0
  128. package/dist/migrations/0025_task_heartbeat.sql +8 -0
  129. package/dist/migrations/0025_thread_app_instance_ledger.sql +2 -0
  130. package/dist/migrations/0026_mcp_action_source.sql +47 -0
  131. package/dist/migrations/0027_task_stop_scope_cleanup.sql +5 -0
  132. package/dist/migrations/0027_ui_instance_active_unique.sql +2 -0
  133. package/dist/migrations/0029_nice_rhino.sql +1 -0
  134. package/dist/migrations/0031_petite_arclight.sql +6 -0
  135. package/dist/migrations/0032_ui_instance_opened_by.sql +1 -0
  136. package/dist/migrations/0033_thread_creator_boundary_guard.sql +38 -0
  137. package/dist/migrations/0034_keen_fallen_one.sql +36 -0
  138. package/dist/migrations/0035_request_log_daily.sql +11 -0
  139. package/dist/migrations/0036_ui_definition_archive.sql +8 -0
  140. package/dist/migrations/meta/0011_snapshot.json +1342 -0
  141. package/dist/migrations/meta/0012_snapshot.json +1494 -0
  142. package/dist/migrations/meta/0013_snapshot.json +1592 -0
  143. package/dist/migrations/meta/0014_snapshot.json +1975 -0
  144. package/dist/migrations/meta/0015_snapshot.json +2315 -0
  145. package/dist/migrations/meta/0016_snapshot.json +2419 -0
  146. package/dist/migrations/meta/0017_snapshot.json +2419 -0
  147. package/dist/migrations/meta/0018_snapshot.json +2570 -0
  148. package/dist/migrations/meta/0020_snapshot.json +2895 -0
  149. package/dist/migrations/meta/0021_snapshot.json +3031 -0
  150. package/dist/migrations/meta/0022_snapshot.json +3039 -0
  151. package/dist/migrations/meta/0023_snapshot.json +3047 -0
  152. package/dist/migrations/meta/0029_snapshot.json +3206 -0
  153. package/dist/migrations/meta/0031_snapshot.json +3251 -0
  154. package/dist/migrations/meta/0034_snapshot.json +3473 -0
  155. package/dist/migrations/meta/0035_snapshot.json +3547 -0
  156. package/dist/migrations/meta/0036_snapshot.json +3591 -0
  157. package/dist/migrations/meta/_journal.json +182 -0
  158. package/dist/node/index.d.ts +1 -0
  159. package/dist/node/index.js +2 -0
  160. package/dist/paths.d.ts +1 -0
  161. package/dist/plugin/types.d.ts +1 -0
  162. package/dist/plugins/index.d.ts +1 -1
  163. package/dist/plugins/index.js +474 -216
  164. package/dist/plugins/sqlite-tracing.d.ts +46 -0
  165. package/dist/process/index.d.ts +2 -0
  166. package/dist/process/index.js +1 -0
  167. package/dist/process/process-control.d.ts +41 -0
  168. package/dist/prompt/tag-names.d.ts +22 -0
  169. package/dist/provider/acp/connection.d.ts +6 -0
  170. package/dist/provider/acp/meta.d.ts +11 -0
  171. package/dist/provider/bridge.d.ts +7 -1
  172. package/dist/provider/classify-task-error.d.ts +2 -0
  173. package/dist/provider/cli/adapter.types.d.ts +14 -2
  174. package/dist/provider/cli/adapters/agent-call.util.d.ts +1 -1
  175. package/dist/provider/cli/adapters/cli-knob.util.d.ts +7 -0
  176. package/dist/provider/cli/adapters/codex-item.d.ts +1 -0
  177. package/dist/provider/cli/adapters/event-timestamp.util.d.ts +1 -0
  178. package/dist/provider/cli/adapters/grok.d.ts +2 -0
  179. package/dist/provider/cli/adapters/index.d.ts +5 -0
  180. package/dist/provider/cli/index.d.ts +3 -2
  181. package/dist/provider/cli/meta.d.ts +5 -0
  182. package/dist/provider/cli/protocol-envelope.d.ts +3 -0
  183. package/dist/provider/errors.d.ts +5 -1
  184. package/dist/provider/idle-watchdog.d.ts +19 -0
  185. package/dist/provider/models.d.ts +17 -12
  186. package/dist/provider/order.d.ts +1 -1
  187. package/dist/provider/parse-usage.d.ts +6 -0
  188. package/dist/provider/provider-selection.d.ts +8 -0
  189. package/dist/provider/redact-technical-message.d.ts +1 -0
  190. package/dist/provider/task-error.types.d.ts +17 -0
  191. package/dist/publish/constants.d.ts +6 -0
  192. package/dist/publish/errors.d.ts +7 -0
  193. package/dist/publish/index.d.ts +50 -0
  194. package/dist/publish/index.js +2 -0
  195. package/dist/publish/manifest.d.ts +47 -0
  196. package/dist/publish/marketplace-api.constants.d.ts +1 -0
  197. package/dist/publish/pack.d.ts +6 -0
  198. package/dist/publish/scan.d.ts +9 -0
  199. package/dist/publish/secrets.d.ts +6 -0
  200. package/dist/publish/upload.d.ts +19 -0
  201. package/dist/remote/execution-profile.d.ts +9 -0
  202. package/dist/remote/index.d.ts +1 -0
  203. package/dist/remote/types.d.ts +28 -0
  204. package/dist/repository/agent-suggestion.repository.d.ts +34 -0
  205. package/dist/repository/base-sqlite-repository.d.ts +1 -0
  206. package/dist/repository/common-code.repository.d.ts +45 -0
  207. package/dist/repository/db.d.ts +12 -1
  208. package/dist/repository/index.d.ts +41 -5
  209. package/dist/repository/index.js +586 -213
  210. package/dist/repository/logs-db.d.ts +12 -0
  211. package/dist/repository/notification.repository.d.ts +58 -0
  212. package/dist/repository/project.repository.d.ts +90 -0
  213. package/dist/repository/request-log-mover.d.ts +70 -0
  214. package/dist/repository/request-log.repository.d.ts +7 -3
  215. package/dist/repository/storage-metadata.repository.d.ts +64 -0
  216. package/dist/repository/task-log-migration.d.ts +74 -0
  217. package/dist/repository/task-log.repository.d.ts +44 -0
  218. package/dist/repository/task-status.d.ts +21 -0
  219. package/dist/repository/task.repository.d.ts +229 -7
  220. package/dist/repository/thread-history.repository.d.ts +193 -0
  221. package/dist/repository/thread-origin-verdict.d.ts +27 -0
  222. package/dist/repository/thread-title.types.d.ts +29 -0
  223. package/dist/repository/thread.repository.d.ts +115 -7
  224. package/dist/repository/usage-backfill.d.ts +62 -0
  225. package/dist/repository/usage-from-logs.d.ts +21 -0
  226. package/dist/repository/workspace.repository.d.ts +3 -0
  227. package/dist/schema/agent-suggestions.d.ts +199 -0
  228. package/dist/schema/common-codes.d.ts +216 -0
  229. package/dist/schema/index.d.ts +13 -0
  230. package/dist/schema/notifications.d.ts +303 -0
  231. package/dist/schema/projects.d.ts +610 -0
  232. package/dist/schema/request-log-daily.d.ts +151 -0
  233. package/dist/schema/storage-metadata.d.ts +181 -0
  234. package/dist/schema/task-log-events.d.ts +119 -0
  235. package/dist/schema/tasks.d.ts +165 -0
  236. package/dist/schema/thread-creator-unverified.d.ts +45 -0
  237. package/dist/schema/thread-history.d.ts +734 -0
  238. package/dist/schema/threads.d.ts +59 -0
  239. package/dist/schema/ui-action-receipts.d.ts +358 -0
  240. package/dist/schema/ui-definition-archive.d.ts +63 -0
  241. package/dist/schema/ui-instance-repins.d.ts +222 -0
  242. package/dist/schema/ui-instances.d.ts +305 -0
  243. package/dist/schema/workspaces.d.ts +17 -0
  244. package/dist/skills/index.d.ts +15 -0
  245. package/dist/skills/index.js +2 -0
  246. package/dist/skills/types.d.ts +18 -0
  247. package/dist/task-log/anchor-child-tasks.d.ts +7 -0
  248. package/dist/task-log/delegation-trailer.d.ts +34 -0
  249. package/dist/template/engine.d.ts +2 -2
  250. package/dist/template/helpers/exec.browser.d.ts +4 -3
  251. package/dist/template/helpers/exec.d.ts +4 -3
  252. package/dist/template/types.d.ts +20 -0
  253. package/dist/testing/index.js +1 -1
  254. package/dist/types/index.d.ts +1574 -3
  255. package/dist/types/task-log.types.d.ts +3 -0
  256. package/dist/ui-card/index.d.ts +2 -0
  257. package/dist/ui-card/legacy-card-parser.d.ts +11 -0
  258. package/dist/ui-instance/definition.d.ts +6 -0
  259. package/dist/ui-instance/errors.d.ts +18 -0
  260. package/dist/ui-instance/index.d.ts +11 -0
  261. package/dist/ui-instance/json.d.ts +19 -0
  262. package/dist/ui-instance/lineage.d.ts +24 -0
  263. package/dist/ui-instance/runtime.d.ts +18 -0
  264. package/dist/ui-instance/store.d.ts +198 -0
  265. package/dist/ui-instance/types.d.ts +319 -0
  266. package/dist/ui-plugin/app-manifest.d.ts +64 -0
  267. package/dist/ui-plugin/csp.d.ts +28 -0
  268. package/dist/ui-plugin/index.d.ts +6 -0
  269. package/dist/ui-plugin/limits.d.ts +27 -0
  270. package/dist/ui-plugin/manifest.d.ts +3 -0
  271. package/dist/ui-plugin/types.d.ts +203 -0
  272. package/dist/ui-plugin/validator.d.ts +18 -0
  273. package/dist/utils/crewx-executable.d.ts +76 -0
  274. package/dist/utils/crewx-home.d.ts +1 -0
  275. package/dist/utils/env-defaults.d.ts +3 -0
  276. package/dist/utils/id.d.ts +1 -1
  277. package/dist/utils/local-identity.d.ts +2 -0
  278. package/dist/utils/runner-env.d.ts +3 -0
  279. package/dist/utils/timestamp.d.ts +1 -0
  280. package/dist/utils/workspace.d.ts +1 -0
  281. package/dist/wi/create.d.ts +48 -0
  282. package/dist/wi/select.d.ts +20 -0
  283. package/package.json +57 -3
  284. package/templates/agents/default.yaml +296 -128
  285. package/templates/documents/crewx-manual.md +138 -138
  286. package/templates/documents/crewx-quick-guide.md +8 -7
  287. package/templates/workflows/wi-default-flow.yaml +65 -0
  288. package/templates/workflows/wi-plan-flow.yaml +140 -0
@@ -0,0 +1,3473 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "4c430364-1d58-4d85-adf3-0cb90dc95cef",
5
+ "prevId": "3fc0b9e7-579d-4339-834f-14f4798e6a2a",
6
+ "tables": {
7
+ "workspaces": {
8
+ "name": "workspaces",
9
+ "columns": {
10
+ "id": {
11
+ "name": "id",
12
+ "type": "text",
13
+ "primaryKey": true,
14
+ "notNull": true,
15
+ "autoincrement": false
16
+ },
17
+ "slug": {
18
+ "name": "slug",
19
+ "type": "text",
20
+ "primaryKey": false,
21
+ "notNull": true,
22
+ "autoincrement": false
23
+ },
24
+ "name": {
25
+ "name": "name",
26
+ "type": "text",
27
+ "primaryKey": false,
28
+ "notNull": true,
29
+ "autoincrement": false
30
+ },
31
+ "workspace_path": {
32
+ "name": "workspace_path",
33
+ "type": "text",
34
+ "primaryKey": false,
35
+ "notNull": false,
36
+ "autoincrement": false
37
+ },
38
+ "description": {
39
+ "name": "description",
40
+ "type": "text",
41
+ "primaryKey": false,
42
+ "notNull": false,
43
+ "autoincrement": false
44
+ },
45
+ "is_active": {
46
+ "name": "is_active",
47
+ "type": "integer",
48
+ "primaryKey": false,
49
+ "notNull": true,
50
+ "autoincrement": false,
51
+ "default": 1
52
+ },
53
+ "created_at": {
54
+ "name": "created_at",
55
+ "type": "text",
56
+ "primaryKey": false,
57
+ "notNull": true,
58
+ "autoincrement": false
59
+ },
60
+ "updated_at": {
61
+ "name": "updated_at",
62
+ "type": "text",
63
+ "primaryKey": false,
64
+ "notNull": true,
65
+ "autoincrement": false
66
+ },
67
+ "starred": {
68
+ "name": "starred",
69
+ "type": "integer",
70
+ "primaryKey": false,
71
+ "notNull": true,
72
+ "autoincrement": false,
73
+ "default": 0
74
+ }
75
+ },
76
+ "indexes": {
77
+ "workspaces_slug_unique": {
78
+ "name": "workspaces_slug_unique",
79
+ "columns": [
80
+ "slug"
81
+ ],
82
+ "isUnique": true
83
+ }
84
+ },
85
+ "foreignKeys": {},
86
+ "compositePrimaryKeys": {},
87
+ "uniqueConstraints": {},
88
+ "checkConstraints": {}
89
+ },
90
+ "tasks": {
91
+ "name": "tasks",
92
+ "columns": {
93
+ "id": {
94
+ "name": "id",
95
+ "type": "text",
96
+ "primaryKey": true,
97
+ "notNull": true,
98
+ "autoincrement": false
99
+ },
100
+ "agent_id": {
101
+ "name": "agent_id",
102
+ "type": "text",
103
+ "primaryKey": false,
104
+ "notNull": true,
105
+ "autoincrement": false
106
+ },
107
+ "user_id": {
108
+ "name": "user_id",
109
+ "type": "text",
110
+ "primaryKey": false,
111
+ "notNull": false,
112
+ "autoincrement": false
113
+ },
114
+ "actor_kind": {
115
+ "name": "actor_kind",
116
+ "type": "text",
117
+ "primaryKey": false,
118
+ "notNull": false,
119
+ "autoincrement": false
120
+ },
121
+ "actor_id": {
122
+ "name": "actor_id",
123
+ "type": "text",
124
+ "primaryKey": false,
125
+ "notNull": false,
126
+ "autoincrement": false
127
+ },
128
+ "prompt": {
129
+ "name": "prompt",
130
+ "type": "text",
131
+ "primaryKey": false,
132
+ "notNull": true,
133
+ "autoincrement": false
134
+ },
135
+ "mode": {
136
+ "name": "mode",
137
+ "type": "text",
138
+ "primaryKey": false,
139
+ "notNull": true,
140
+ "autoincrement": false,
141
+ "default": "'execute'"
142
+ },
143
+ "status": {
144
+ "name": "status",
145
+ "type": "text",
146
+ "primaryKey": false,
147
+ "notNull": true,
148
+ "autoincrement": false,
149
+ "default": "'running'"
150
+ },
151
+ "result": {
152
+ "name": "result",
153
+ "type": "text",
154
+ "primaryKey": false,
155
+ "notNull": false,
156
+ "autoincrement": false
157
+ },
158
+ "error": {
159
+ "name": "error",
160
+ "type": "text",
161
+ "primaryKey": false,
162
+ "notNull": false,
163
+ "autoincrement": false
164
+ },
165
+ "started_at": {
166
+ "name": "started_at",
167
+ "type": "text",
168
+ "primaryKey": false,
169
+ "notNull": true,
170
+ "autoincrement": false
171
+ },
172
+ "completed_at": {
173
+ "name": "completed_at",
174
+ "type": "text",
175
+ "primaryKey": false,
176
+ "notNull": false,
177
+ "autoincrement": false
178
+ },
179
+ "duration_ms": {
180
+ "name": "duration_ms",
181
+ "type": "integer",
182
+ "primaryKey": false,
183
+ "notNull": false,
184
+ "autoincrement": false
185
+ },
186
+ "metadata": {
187
+ "name": "metadata",
188
+ "type": "text",
189
+ "primaryKey": false,
190
+ "notNull": false,
191
+ "autoincrement": false
192
+ },
193
+ "workspace_id": {
194
+ "name": "workspace_id",
195
+ "type": "text",
196
+ "primaryKey": false,
197
+ "notNull": false,
198
+ "autoincrement": false
199
+ },
200
+ "trace_id": {
201
+ "name": "trace_id",
202
+ "type": "text",
203
+ "primaryKey": false,
204
+ "notNull": false,
205
+ "autoincrement": false
206
+ },
207
+ "parent_task_id": {
208
+ "name": "parent_task_id",
209
+ "type": "text",
210
+ "primaryKey": false,
211
+ "notNull": false,
212
+ "autoincrement": false
213
+ },
214
+ "caller_agent_id": {
215
+ "name": "caller_agent_id",
216
+ "type": "text",
217
+ "primaryKey": false,
218
+ "notNull": false,
219
+ "autoincrement": false
220
+ },
221
+ "model": {
222
+ "name": "model",
223
+ "type": "text",
224
+ "primaryKey": false,
225
+ "notNull": false,
226
+ "autoincrement": false
227
+ },
228
+ "platform": {
229
+ "name": "platform",
230
+ "type": "text",
231
+ "primaryKey": false,
232
+ "notNull": false,
233
+ "autoincrement": false,
234
+ "default": "'cli'"
235
+ },
236
+ "crewx_version": {
237
+ "name": "crewx_version",
238
+ "type": "text",
239
+ "primaryKey": false,
240
+ "notNull": false,
241
+ "autoincrement": false
242
+ },
243
+ "input_tokens": {
244
+ "name": "input_tokens",
245
+ "type": "integer",
246
+ "primaryKey": false,
247
+ "notNull": false,
248
+ "autoincrement": false,
249
+ "default": 0
250
+ },
251
+ "output_tokens": {
252
+ "name": "output_tokens",
253
+ "type": "integer",
254
+ "primaryKey": false,
255
+ "notNull": false,
256
+ "autoincrement": false,
257
+ "default": 0
258
+ },
259
+ "cost_usd": {
260
+ "name": "cost_usd",
261
+ "type": "real",
262
+ "primaryKey": false,
263
+ "notNull": false,
264
+ "autoincrement": false,
265
+ "default": 0
266
+ },
267
+ "pid": {
268
+ "name": "pid",
269
+ "type": "integer",
270
+ "primaryKey": false,
271
+ "notNull": false,
272
+ "autoincrement": false
273
+ },
274
+ "heartbeat_at": {
275
+ "name": "heartbeat_at",
276
+ "type": "text",
277
+ "primaryKey": false,
278
+ "notNull": false,
279
+ "autoincrement": false
280
+ },
281
+ "stop_requested_at": {
282
+ "name": "stop_requested_at",
283
+ "type": "text",
284
+ "primaryKey": false,
285
+ "notNull": false,
286
+ "autoincrement": false
287
+ },
288
+ "stop_requested_epoch": {
289
+ "name": "stop_requested_epoch",
290
+ "type": "integer",
291
+ "primaryKey": false,
292
+ "notNull": false,
293
+ "autoincrement": false
294
+ },
295
+ "rendered_prompt": {
296
+ "name": "rendered_prompt",
297
+ "type": "text",
298
+ "primaryKey": false,
299
+ "notNull": false,
300
+ "autoincrement": false
301
+ },
302
+ "command": {
303
+ "name": "command",
304
+ "type": "text",
305
+ "primaryKey": false,
306
+ "notNull": false,
307
+ "autoincrement": false
308
+ },
309
+ "coding_agent_command": {
310
+ "name": "coding_agent_command",
311
+ "type": "text",
312
+ "primaryKey": false,
313
+ "notNull": false,
314
+ "autoincrement": false
315
+ },
316
+ "exit_code": {
317
+ "name": "exit_code",
318
+ "type": "integer",
319
+ "primaryKey": false,
320
+ "notNull": false,
321
+ "autoincrement": false
322
+ },
323
+ "logs": {
324
+ "name": "logs",
325
+ "type": "text",
326
+ "primaryKey": false,
327
+ "notNull": false,
328
+ "autoincrement": false
329
+ },
330
+ "log_storage": {
331
+ "name": "log_storage",
332
+ "type": "text",
333
+ "primaryKey": false,
334
+ "notNull": true,
335
+ "autoincrement": false,
336
+ "default": "'blob'"
337
+ },
338
+ "last_log_seq": {
339
+ "name": "last_log_seq",
340
+ "type": "integer",
341
+ "primaryKey": false,
342
+ "notNull": true,
343
+ "autoincrement": false,
344
+ "default": 0
345
+ },
346
+ "log_revision": {
347
+ "name": "log_revision",
348
+ "type": "integer",
349
+ "primaryKey": false,
350
+ "notNull": true,
351
+ "autoincrement": false,
352
+ "default": 0
353
+ },
354
+ "thread_id": {
355
+ "name": "thread_id",
356
+ "type": "text",
357
+ "primaryKey": false,
358
+ "notNull": false,
359
+ "autoincrement": false
360
+ },
361
+ "workspace_ref": {
362
+ "name": "workspace_ref",
363
+ "type": "text",
364
+ "primaryKey": false,
365
+ "notNull": false,
366
+ "autoincrement": false
367
+ },
368
+ "cwd": {
369
+ "name": "cwd",
370
+ "type": "text",
371
+ "primaryKey": false,
372
+ "notNull": false,
373
+ "autoincrement": false
374
+ },
375
+ "project_id": {
376
+ "name": "project_id",
377
+ "type": "text",
378
+ "primaryKey": false,
379
+ "notNull": false,
380
+ "autoincrement": false
381
+ },
382
+ "project_ref": {
383
+ "name": "project_ref",
384
+ "type": "text",
385
+ "primaryKey": false,
386
+ "notNull": false,
387
+ "autoincrement": false
388
+ },
389
+ "cached_input_tokens": {
390
+ "name": "cached_input_tokens",
391
+ "type": "integer",
392
+ "primaryKey": false,
393
+ "notNull": false,
394
+ "autoincrement": false,
395
+ "default": 0
396
+ },
397
+ "run_epoch": {
398
+ "name": "run_epoch",
399
+ "type": "integer",
400
+ "primaryKey": false,
401
+ "notNull": false,
402
+ "autoincrement": false,
403
+ "default": 0
404
+ }
405
+ },
406
+ "indexes": {
407
+ "idx_tasks_agent_id": {
408
+ "name": "idx_tasks_agent_id",
409
+ "columns": [
410
+ "agent_id"
411
+ ],
412
+ "isUnique": false
413
+ },
414
+ "idx_tasks_status": {
415
+ "name": "idx_tasks_status",
416
+ "columns": [
417
+ "status"
418
+ ],
419
+ "isUnique": false
420
+ },
421
+ "idx_tasks_started_at": {
422
+ "name": "idx_tasks_started_at",
423
+ "columns": [
424
+ "started_at"
425
+ ],
426
+ "isUnique": false
427
+ },
428
+ "idx_tasks_trace_id": {
429
+ "name": "idx_tasks_trace_id",
430
+ "columns": [
431
+ "trace_id"
432
+ ],
433
+ "isUnique": false
434
+ },
435
+ "idx_tasks_parent_task_id": {
436
+ "name": "idx_tasks_parent_task_id",
437
+ "columns": [
438
+ "parent_task_id"
439
+ ],
440
+ "isUnique": false
441
+ },
442
+ "idx_tasks_crewx_version": {
443
+ "name": "idx_tasks_crewx_version",
444
+ "columns": [
445
+ "crewx_version"
446
+ ],
447
+ "isUnique": false
448
+ },
449
+ "idx_tasks_pid": {
450
+ "name": "idx_tasks_pid",
451
+ "columns": [
452
+ "pid"
453
+ ],
454
+ "isUnique": false
455
+ },
456
+ "idx_tasks_status_heartbeat": {
457
+ "name": "idx_tasks_status_heartbeat",
458
+ "columns": [
459
+ "status",
460
+ "heartbeat_at"
461
+ ],
462
+ "isUnique": false
463
+ },
464
+ "idx_tasks_thread_id": {
465
+ "name": "idx_tasks_thread_id",
466
+ "columns": [
467
+ "thread_id"
468
+ ],
469
+ "isUnique": false
470
+ },
471
+ "idx_tasks_thread_creator": {
472
+ "name": "idx_tasks_thread_creator",
473
+ "columns": [
474
+ "id",
475
+ "thread_id",
476
+ "actor_kind",
477
+ "actor_id"
478
+ ],
479
+ "isUnique": false
480
+ },
481
+ "idx_tasks_workspace_id": {
482
+ "name": "idx_tasks_workspace_id",
483
+ "columns": [
484
+ "workspace_id"
485
+ ],
486
+ "isUnique": false
487
+ },
488
+ "idx_tasks_workspace_ref": {
489
+ "name": "idx_tasks_workspace_ref",
490
+ "columns": [
491
+ "workspace_ref"
492
+ ],
493
+ "isUnique": false
494
+ },
495
+ "idx_tasks_project_id": {
496
+ "name": "idx_tasks_project_id",
497
+ "columns": [
498
+ "project_id"
499
+ ],
500
+ "isUnique": false
501
+ },
502
+ "idx_tasks_ws_started": {
503
+ "name": "idx_tasks_ws_started",
504
+ "columns": [
505
+ "workspace_id",
506
+ "started_at"
507
+ ],
508
+ "isUnique": false
509
+ }
510
+ },
511
+ "foreignKeys": {},
512
+ "compositePrimaryKeys": {},
513
+ "uniqueConstraints": {},
514
+ "checkConstraints": {
515
+ "tasks_log_storage_ck": {
516
+ "name": "tasks_log_storage_ck",
517
+ "value": "\"tasks\".\"log_storage\" IN ('blob', 'events')"
518
+ }
519
+ }
520
+ },
521
+ "task_log_events": {
522
+ "name": "task_log_events",
523
+ "columns": {
524
+ "id": {
525
+ "name": "id",
526
+ "type": "integer",
527
+ "primaryKey": true,
528
+ "notNull": true,
529
+ "autoincrement": false
530
+ },
531
+ "task_id": {
532
+ "name": "task_id",
533
+ "type": "text",
534
+ "primaryKey": false,
535
+ "notNull": true,
536
+ "autoincrement": false
537
+ },
538
+ "seq": {
539
+ "name": "seq",
540
+ "type": "integer",
541
+ "primaryKey": false,
542
+ "notNull": true,
543
+ "autoincrement": false
544
+ },
545
+ "timestamp": {
546
+ "name": "timestamp",
547
+ "type": "text",
548
+ "primaryKey": false,
549
+ "notNull": true,
550
+ "autoincrement": false
551
+ },
552
+ "level": {
553
+ "name": "level",
554
+ "type": "text",
555
+ "primaryKey": false,
556
+ "notNull": true,
557
+ "autoincrement": false
558
+ },
559
+ "message": {
560
+ "name": "message",
561
+ "type": "text",
562
+ "primaryKey": false,
563
+ "notNull": true,
564
+ "autoincrement": false
565
+ }
566
+ },
567
+ "indexes": {
568
+ "task_log_events_task_seq_uq": {
569
+ "name": "task_log_events_task_seq_uq",
570
+ "columns": [
571
+ "task_id",
572
+ "seq"
573
+ ],
574
+ "isUnique": true
575
+ },
576
+ "task_log_events_timestamp_id_idx": {
577
+ "name": "task_log_events_timestamp_id_idx",
578
+ "columns": [
579
+ "timestamp",
580
+ "id"
581
+ ],
582
+ "isUnique": false
583
+ }
584
+ },
585
+ "foreignKeys": {
586
+ "task_log_events_task_id_tasks_id_fk": {
587
+ "name": "task_log_events_task_id_tasks_id_fk",
588
+ "tableFrom": "task_log_events",
589
+ "tableTo": "tasks",
590
+ "columnsFrom": [
591
+ "task_id"
592
+ ],
593
+ "columnsTo": [
594
+ "id"
595
+ ],
596
+ "onDelete": "cascade",
597
+ "onUpdate": "no action"
598
+ }
599
+ },
600
+ "compositePrimaryKeys": {},
601
+ "uniqueConstraints": {},
602
+ "checkConstraints": {}
603
+ },
604
+ "threads": {
605
+ "name": "threads",
606
+ "columns": {
607
+ "id": {
608
+ "name": "id",
609
+ "type": "text",
610
+ "primaryKey": true,
611
+ "notNull": true,
612
+ "autoincrement": false
613
+ },
614
+ "workspace_id": {
615
+ "name": "workspace_id",
616
+ "type": "text",
617
+ "primaryKey": false,
618
+ "notNull": false,
619
+ "autoincrement": false
620
+ },
621
+ "created_by_kind": {
622
+ "name": "created_by_kind",
623
+ "type": "text",
624
+ "primaryKey": false,
625
+ "notNull": false,
626
+ "autoincrement": false
627
+ },
628
+ "created_by_id": {
629
+ "name": "created_by_id",
630
+ "type": "text",
631
+ "primaryKey": false,
632
+ "notNull": false,
633
+ "autoincrement": false
634
+ },
635
+ "created_by_task_id": {
636
+ "name": "created_by_task_id",
637
+ "type": "text",
638
+ "primaryKey": false,
639
+ "notNull": false,
640
+ "autoincrement": false
641
+ },
642
+ "platform": {
643
+ "name": "platform",
644
+ "type": "text",
645
+ "primaryKey": false,
646
+ "notNull": true,
647
+ "autoincrement": false,
648
+ "default": "'cli'"
649
+ },
650
+ "title": {
651
+ "name": "title",
652
+ "type": "text",
653
+ "primaryKey": false,
654
+ "notNull": false,
655
+ "autoincrement": false
656
+ },
657
+ "first_message": {
658
+ "name": "first_message",
659
+ "type": "text",
660
+ "primaryKey": false,
661
+ "notNull": false,
662
+ "autoincrement": false
663
+ },
664
+ "last_message": {
665
+ "name": "last_message",
666
+ "type": "text",
667
+ "primaryKey": false,
668
+ "notNull": false,
669
+ "autoincrement": false
670
+ },
671
+ "message_count": {
672
+ "name": "message_count",
673
+ "type": "integer",
674
+ "primaryKey": false,
675
+ "notNull": true,
676
+ "autoincrement": false,
677
+ "default": 0
678
+ },
679
+ "created_at": {
680
+ "name": "created_at",
681
+ "type": "text",
682
+ "primaryKey": false,
683
+ "notNull": true,
684
+ "autoincrement": false
685
+ },
686
+ "updated_at": {
687
+ "name": "updated_at",
688
+ "type": "text",
689
+ "primaryKey": false,
690
+ "notNull": true,
691
+ "autoincrement": false
692
+ },
693
+ "metadata": {
694
+ "name": "metadata",
695
+ "type": "text",
696
+ "primaryKey": false,
697
+ "notNull": false,
698
+ "autoincrement": false
699
+ },
700
+ "title_locked": {
701
+ "name": "title_locked",
702
+ "type": "integer",
703
+ "primaryKey": false,
704
+ "notNull": true,
705
+ "autoincrement": false,
706
+ "default": 0
707
+ },
708
+ "pinned": {
709
+ "name": "pinned",
710
+ "type": "integer",
711
+ "primaryKey": false,
712
+ "notNull": true,
713
+ "autoincrement": false,
714
+ "default": 0
715
+ },
716
+ "starred": {
717
+ "name": "starred",
718
+ "type": "integer",
719
+ "primaryKey": false,
720
+ "notNull": true,
721
+ "autoincrement": false,
722
+ "default": 0
723
+ }
724
+ },
725
+ "indexes": {
726
+ "idx_threads_updated_at": {
727
+ "name": "idx_threads_updated_at",
728
+ "columns": [
729
+ "updated_at"
730
+ ],
731
+ "isUnique": false
732
+ },
733
+ "idx_threads_workspace_id": {
734
+ "name": "idx_threads_workspace_id",
735
+ "columns": [
736
+ "workspace_id"
737
+ ],
738
+ "isUnique": false
739
+ },
740
+ "idx_threads_ws_updated": {
741
+ "name": "idx_threads_ws_updated",
742
+ "columns": [
743
+ "workspace_id",
744
+ "updated_at"
745
+ ],
746
+ "isUnique": false
747
+ },
748
+ "idx_threads_workspace_created_by_kind_updated_at": {
749
+ "name": "idx_threads_workspace_created_by_kind_updated_at",
750
+ "columns": [
751
+ "workspace_id",
752
+ "created_by_kind",
753
+ "updated_at"
754
+ ],
755
+ "isUnique": false
756
+ },
757
+ "idx_threads_title": {
758
+ "name": "idx_threads_title",
759
+ "columns": [
760
+ "title"
761
+ ],
762
+ "isUnique": false
763
+ },
764
+ "idx_threads_workspace_thread_state": {
765
+ "name": "idx_threads_workspace_thread_state",
766
+ "columns": [
767
+ "workspace_id",
768
+ "json_extract(metadata, '$.threadTitle.state')"
769
+ ],
770
+ "isUnique": false
771
+ },
772
+ "idx_threads_workspace_thread_priority": {
773
+ "name": "idx_threads_workspace_thread_priority",
774
+ "columns": [
775
+ "workspace_id",
776
+ "json_extract(metadata, '$.threadTitle.priority')"
777
+ ],
778
+ "isUnique": false
779
+ }
780
+ },
781
+ "foreignKeys": {
782
+ "threads_workspace_id_workspaces_id_fk": {
783
+ "name": "threads_workspace_id_workspaces_id_fk",
784
+ "tableFrom": "threads",
785
+ "tableTo": "workspaces",
786
+ "columnsFrom": [
787
+ "workspace_id"
788
+ ],
789
+ "columnsTo": [
790
+ "id"
791
+ ],
792
+ "onDelete": "set null",
793
+ "onUpdate": "no action"
794
+ }
795
+ },
796
+ "compositePrimaryKeys": {},
797
+ "uniqueConstraints": {},
798
+ "checkConstraints": {}
799
+ },
800
+ "thread_creator_unverified": {
801
+ "name": "thread_creator_unverified",
802
+ "columns": {
803
+ "thread_id": {
804
+ "name": "thread_id",
805
+ "type": "text",
806
+ "primaryKey": false,
807
+ "notNull": true,
808
+ "autoincrement": false
809
+ },
810
+ "created_by_task_id": {
811
+ "name": "created_by_task_id",
812
+ "type": "text",
813
+ "primaryKey": false,
814
+ "notNull": true,
815
+ "autoincrement": false
816
+ }
817
+ },
818
+ "indexes": {},
819
+ "foreignKeys": {},
820
+ "compositePrimaryKeys": {
821
+ "thread_creator_unverified_thread_id_created_by_task_id_pk": {
822
+ "columns": [
823
+ "thread_id",
824
+ "created_by_task_id"
825
+ ],
826
+ "name": "thread_creator_unverified_thread_id_created_by_task_id_pk"
827
+ }
828
+ },
829
+ "uniqueConstraints": {},
830
+ "checkConstraints": {}
831
+ },
832
+ "spans": {
833
+ "name": "spans",
834
+ "columns": {
835
+ "id": {
836
+ "name": "id",
837
+ "type": "text",
838
+ "primaryKey": true,
839
+ "notNull": true,
840
+ "autoincrement": false
841
+ },
842
+ "task_id": {
843
+ "name": "task_id",
844
+ "type": "text",
845
+ "primaryKey": false,
846
+ "notNull": false,
847
+ "autoincrement": false
848
+ },
849
+ "parent_span_id": {
850
+ "name": "parent_span_id",
851
+ "type": "text",
852
+ "primaryKey": false,
853
+ "notNull": false,
854
+ "autoincrement": false
855
+ },
856
+ "name": {
857
+ "name": "name",
858
+ "type": "text",
859
+ "primaryKey": false,
860
+ "notNull": true,
861
+ "autoincrement": false
862
+ },
863
+ "kind": {
864
+ "name": "kind",
865
+ "type": "text",
866
+ "primaryKey": false,
867
+ "notNull": true,
868
+ "autoincrement": false,
869
+ "default": "'internal'"
870
+ },
871
+ "status": {
872
+ "name": "status",
873
+ "type": "text",
874
+ "primaryKey": false,
875
+ "notNull": true,
876
+ "autoincrement": false,
877
+ "default": "'ok'"
878
+ },
879
+ "started_at": {
880
+ "name": "started_at",
881
+ "type": "text",
882
+ "primaryKey": false,
883
+ "notNull": true,
884
+ "autoincrement": false
885
+ },
886
+ "completed_at": {
887
+ "name": "completed_at",
888
+ "type": "text",
889
+ "primaryKey": false,
890
+ "notNull": false,
891
+ "autoincrement": false
892
+ },
893
+ "duration_ms": {
894
+ "name": "duration_ms",
895
+ "type": "integer",
896
+ "primaryKey": false,
897
+ "notNull": false,
898
+ "autoincrement": false
899
+ },
900
+ "input": {
901
+ "name": "input",
902
+ "type": "text",
903
+ "primaryKey": false,
904
+ "notNull": false,
905
+ "autoincrement": false
906
+ },
907
+ "output": {
908
+ "name": "output",
909
+ "type": "text",
910
+ "primaryKey": false,
911
+ "notNull": false,
912
+ "autoincrement": false
913
+ },
914
+ "error": {
915
+ "name": "error",
916
+ "type": "text",
917
+ "primaryKey": false,
918
+ "notNull": false,
919
+ "autoincrement": false
920
+ },
921
+ "attributes": {
922
+ "name": "attributes",
923
+ "type": "text",
924
+ "primaryKey": false,
925
+ "notNull": false,
926
+ "autoincrement": false
927
+ }
928
+ },
929
+ "indexes": {
930
+ "idx_spans_task_id": {
931
+ "name": "idx_spans_task_id",
932
+ "columns": [
933
+ "task_id"
934
+ ],
935
+ "isUnique": false
936
+ },
937
+ "idx_spans_parent_span_id": {
938
+ "name": "idx_spans_parent_span_id",
939
+ "columns": [
940
+ "parent_span_id"
941
+ ],
942
+ "isUnique": false
943
+ }
944
+ },
945
+ "foreignKeys": {
946
+ "spans_task_id_tasks_id_fk": {
947
+ "name": "spans_task_id_tasks_id_fk",
948
+ "tableFrom": "spans",
949
+ "tableTo": "tasks",
950
+ "columnsFrom": [
951
+ "task_id"
952
+ ],
953
+ "columnsTo": [
954
+ "id"
955
+ ],
956
+ "onDelete": "set null",
957
+ "onUpdate": "no action"
958
+ },
959
+ "spans_parent_span_id_spans_id_fk": {
960
+ "name": "spans_parent_span_id_spans_id_fk",
961
+ "tableFrom": "spans",
962
+ "tableTo": "spans",
963
+ "columnsFrom": [
964
+ "parent_span_id"
965
+ ],
966
+ "columnsTo": [
967
+ "id"
968
+ ],
969
+ "onDelete": "set null",
970
+ "onUpdate": "no action"
971
+ }
972
+ },
973
+ "compositePrimaryKeys": {},
974
+ "uniqueConstraints": {},
975
+ "checkConstraints": {}
976
+ },
977
+ "tool_calls": {
978
+ "name": "tool_calls",
979
+ "columns": {
980
+ "id": {
981
+ "name": "id",
982
+ "type": "text",
983
+ "primaryKey": true,
984
+ "notNull": true,
985
+ "autoincrement": false
986
+ },
987
+ "task_id": {
988
+ "name": "task_id",
989
+ "type": "text",
990
+ "primaryKey": false,
991
+ "notNull": false,
992
+ "autoincrement": false
993
+ },
994
+ "session_id": {
995
+ "name": "session_id",
996
+ "type": "text",
997
+ "primaryKey": false,
998
+ "notNull": false,
999
+ "autoincrement": false
1000
+ },
1001
+ "tool_name": {
1002
+ "name": "tool_name",
1003
+ "type": "text",
1004
+ "primaryKey": false,
1005
+ "notNull": true,
1006
+ "autoincrement": false
1007
+ },
1008
+ "files": {
1009
+ "name": "files",
1010
+ "type": "text",
1011
+ "primaryKey": false,
1012
+ "notNull": false,
1013
+ "autoincrement": false
1014
+ },
1015
+ "input": {
1016
+ "name": "input",
1017
+ "type": "text",
1018
+ "primaryKey": false,
1019
+ "notNull": false,
1020
+ "autoincrement": false
1021
+ },
1022
+ "output": {
1023
+ "name": "output",
1024
+ "type": "text",
1025
+ "primaryKey": false,
1026
+ "notNull": false,
1027
+ "autoincrement": false
1028
+ },
1029
+ "duration_ms": {
1030
+ "name": "duration_ms",
1031
+ "type": "integer",
1032
+ "primaryKey": false,
1033
+ "notNull": false,
1034
+ "autoincrement": false
1035
+ },
1036
+ "timestamp": {
1037
+ "name": "timestamp",
1038
+ "type": "text",
1039
+ "primaryKey": false,
1040
+ "notNull": true,
1041
+ "autoincrement": false
1042
+ }
1043
+ },
1044
+ "indexes": {
1045
+ "idx_tool_calls_task_id": {
1046
+ "name": "idx_tool_calls_task_id",
1047
+ "columns": [
1048
+ "task_id"
1049
+ ],
1050
+ "isUnique": false
1051
+ },
1052
+ "idx_tool_calls_tool_name": {
1053
+ "name": "idx_tool_calls_tool_name",
1054
+ "columns": [
1055
+ "tool_name"
1056
+ ],
1057
+ "isUnique": false
1058
+ },
1059
+ "idx_tool_calls_timestamp": {
1060
+ "name": "idx_tool_calls_timestamp",
1061
+ "columns": [
1062
+ "timestamp"
1063
+ ],
1064
+ "isUnique": false
1065
+ }
1066
+ },
1067
+ "foreignKeys": {
1068
+ "tool_calls_task_id_tasks_id_fk": {
1069
+ "name": "tool_calls_task_id_tasks_id_fk",
1070
+ "tableFrom": "tool_calls",
1071
+ "tableTo": "tasks",
1072
+ "columnsFrom": [
1073
+ "task_id"
1074
+ ],
1075
+ "columnsTo": [
1076
+ "id"
1077
+ ],
1078
+ "onDelete": "cascade",
1079
+ "onUpdate": "no action"
1080
+ }
1081
+ },
1082
+ "compositePrimaryKeys": {},
1083
+ "uniqueConstraints": {},
1084
+ "checkConstraints": {}
1085
+ },
1086
+ "thread_boxes": {
1087
+ "name": "thread_boxes",
1088
+ "columns": {
1089
+ "id": {
1090
+ "name": "id",
1091
+ "type": "text",
1092
+ "primaryKey": true,
1093
+ "notNull": true,
1094
+ "autoincrement": false
1095
+ },
1096
+ "thread_id": {
1097
+ "name": "thread_id",
1098
+ "type": "text",
1099
+ "primaryKey": false,
1100
+ "notNull": true,
1101
+ "autoincrement": false
1102
+ },
1103
+ "seq": {
1104
+ "name": "seq",
1105
+ "type": "integer",
1106
+ "primaryKey": false,
1107
+ "notNull": true,
1108
+ "autoincrement": false
1109
+ },
1110
+ "first_task_id": {
1111
+ "name": "first_task_id",
1112
+ "type": "text",
1113
+ "primaryKey": false,
1114
+ "notNull": true,
1115
+ "autoincrement": false
1116
+ },
1117
+ "mid_task_id": {
1118
+ "name": "mid_task_id",
1119
+ "type": "text",
1120
+ "primaryKey": false,
1121
+ "notNull": true,
1122
+ "autoincrement": false
1123
+ },
1124
+ "last_task_id": {
1125
+ "name": "last_task_id",
1126
+ "type": "text",
1127
+ "primaryKey": false,
1128
+ "notNull": true,
1129
+ "autoincrement": false
1130
+ },
1131
+ "task_count": {
1132
+ "name": "task_count",
1133
+ "type": "integer",
1134
+ "primaryKey": false,
1135
+ "notNull": true,
1136
+ "autoincrement": false
1137
+ },
1138
+ "summary": {
1139
+ "name": "summary",
1140
+ "type": "text",
1141
+ "primaryKey": false,
1142
+ "notNull": false,
1143
+ "autoincrement": false
1144
+ },
1145
+ "source_tokens": {
1146
+ "name": "source_tokens",
1147
+ "type": "integer",
1148
+ "primaryKey": false,
1149
+ "notNull": true,
1150
+ "autoincrement": false
1151
+ },
1152
+ "summary_tokens": {
1153
+ "name": "summary_tokens",
1154
+ "type": "integer",
1155
+ "primaryKey": false,
1156
+ "notNull": false,
1157
+ "autoincrement": false
1158
+ },
1159
+ "created_at": {
1160
+ "name": "created_at",
1161
+ "type": "text",
1162
+ "primaryKey": false,
1163
+ "notNull": true,
1164
+ "autoincrement": false
1165
+ }
1166
+ },
1167
+ "indexes": {
1168
+ "idx_thread_boxes_thread_id": {
1169
+ "name": "idx_thread_boxes_thread_id",
1170
+ "columns": [
1171
+ "thread_id"
1172
+ ],
1173
+ "isUnique": false
1174
+ },
1175
+ "idx_thread_boxes_seq": {
1176
+ "name": "idx_thread_boxes_seq",
1177
+ "columns": [
1178
+ "thread_id",
1179
+ "seq"
1180
+ ],
1181
+ "isUnique": false
1182
+ },
1183
+ "thread_boxes_thread_id_seq_unique": {
1184
+ "name": "thread_boxes_thread_id_seq_unique",
1185
+ "columns": [
1186
+ "thread_id",
1187
+ "seq"
1188
+ ],
1189
+ "isUnique": true
1190
+ }
1191
+ },
1192
+ "foreignKeys": {
1193
+ "thread_boxes_thread_id_threads_id_fk": {
1194
+ "name": "thread_boxes_thread_id_threads_id_fk",
1195
+ "tableFrom": "thread_boxes",
1196
+ "tableTo": "threads",
1197
+ "columnsFrom": [
1198
+ "thread_id"
1199
+ ],
1200
+ "columnsTo": [
1201
+ "id"
1202
+ ],
1203
+ "onDelete": "cascade",
1204
+ "onUpdate": "no action"
1205
+ }
1206
+ },
1207
+ "compositePrimaryKeys": {},
1208
+ "uniqueConstraints": {},
1209
+ "checkConstraints": {}
1210
+ },
1211
+ "request_logs": {
1212
+ "name": "request_logs",
1213
+ "columns": {
1214
+ "id": {
1215
+ "name": "id",
1216
+ "type": "text",
1217
+ "primaryKey": true,
1218
+ "notNull": true,
1219
+ "autoincrement": false
1220
+ },
1221
+ "path": {
1222
+ "name": "path",
1223
+ "type": "text",
1224
+ "primaryKey": false,
1225
+ "notNull": true,
1226
+ "autoincrement": false
1227
+ },
1228
+ "method": {
1229
+ "name": "method",
1230
+ "type": "text",
1231
+ "primaryKey": false,
1232
+ "notNull": true,
1233
+ "autoincrement": false
1234
+ },
1235
+ "status_code": {
1236
+ "name": "status_code",
1237
+ "type": "integer",
1238
+ "primaryKey": false,
1239
+ "notNull": true,
1240
+ "autoincrement": false
1241
+ },
1242
+ "duration_ms": {
1243
+ "name": "duration_ms",
1244
+ "type": "integer",
1245
+ "primaryKey": false,
1246
+ "notNull": true,
1247
+ "autoincrement": false
1248
+ },
1249
+ "ip": {
1250
+ "name": "ip",
1251
+ "type": "text",
1252
+ "primaryKey": false,
1253
+ "notNull": false,
1254
+ "autoincrement": false
1255
+ },
1256
+ "request_headers": {
1257
+ "name": "request_headers",
1258
+ "type": "text",
1259
+ "primaryKey": false,
1260
+ "notNull": false,
1261
+ "autoincrement": false
1262
+ },
1263
+ "response_headers": {
1264
+ "name": "response_headers",
1265
+ "type": "text",
1266
+ "primaryKey": false,
1267
+ "notNull": false,
1268
+ "autoincrement": false
1269
+ },
1270
+ "request_body": {
1271
+ "name": "request_body",
1272
+ "type": "text",
1273
+ "primaryKey": false,
1274
+ "notNull": false,
1275
+ "autoincrement": false
1276
+ },
1277
+ "response_body": {
1278
+ "name": "response_body",
1279
+ "type": "text",
1280
+ "primaryKey": false,
1281
+ "notNull": false,
1282
+ "autoincrement": false
1283
+ },
1284
+ "query": {
1285
+ "name": "query",
1286
+ "type": "text",
1287
+ "primaryKey": false,
1288
+ "notNull": false,
1289
+ "autoincrement": false
1290
+ },
1291
+ "user_id": {
1292
+ "name": "user_id",
1293
+ "type": "text",
1294
+ "primaryKey": false,
1295
+ "notNull": false,
1296
+ "autoincrement": false
1297
+ },
1298
+ "project_id": {
1299
+ "name": "project_id",
1300
+ "type": "text",
1301
+ "primaryKey": false,
1302
+ "notNull": false,
1303
+ "autoincrement": false
1304
+ },
1305
+ "partition_key": {
1306
+ "name": "partition_key",
1307
+ "type": "text",
1308
+ "primaryKey": false,
1309
+ "notNull": true,
1310
+ "autoincrement": false
1311
+ },
1312
+ "timestamp": {
1313
+ "name": "timestamp",
1314
+ "type": "text",
1315
+ "primaryKey": false,
1316
+ "notNull": true,
1317
+ "autoincrement": false,
1318
+ "default": "(datetime('now'))"
1319
+ },
1320
+ "metadata": {
1321
+ "name": "metadata",
1322
+ "type": "text",
1323
+ "primaryKey": false,
1324
+ "notNull": false,
1325
+ "autoincrement": false
1326
+ }
1327
+ },
1328
+ "indexes": {
1329
+ "idx_request_logs_timestamp": {
1330
+ "name": "idx_request_logs_timestamp",
1331
+ "columns": [
1332
+ "timestamp"
1333
+ ],
1334
+ "isUnique": false
1335
+ },
1336
+ "idx_request_logs_path": {
1337
+ "name": "idx_request_logs_path",
1338
+ "columns": [
1339
+ "path"
1340
+ ],
1341
+ "isUnique": false
1342
+ },
1343
+ "idx_request_logs_status_code": {
1344
+ "name": "idx_request_logs_status_code",
1345
+ "columns": [
1346
+ "status_code"
1347
+ ],
1348
+ "isUnique": false
1349
+ },
1350
+ "idx_request_logs_partition_key": {
1351
+ "name": "idx_request_logs_partition_key",
1352
+ "columns": [
1353
+ "partition_key"
1354
+ ],
1355
+ "isUnique": false
1356
+ }
1357
+ },
1358
+ "foreignKeys": {},
1359
+ "compositePrimaryKeys": {},
1360
+ "uniqueConstraints": {},
1361
+ "checkConstraints": {}
1362
+ },
1363
+ "usage_limit_snapshots": {
1364
+ "name": "usage_limit_snapshots",
1365
+ "columns": {
1366
+ "id": {
1367
+ "name": "id",
1368
+ "type": "text",
1369
+ "primaryKey": true,
1370
+ "notNull": true,
1371
+ "autoincrement": false
1372
+ },
1373
+ "provider": {
1374
+ "name": "provider",
1375
+ "type": "text",
1376
+ "primaryKey": false,
1377
+ "notNull": true,
1378
+ "autoincrement": false
1379
+ },
1380
+ "account_ref": {
1381
+ "name": "account_ref",
1382
+ "type": "text",
1383
+ "primaryKey": false,
1384
+ "notNull": true,
1385
+ "autoincrement": false,
1386
+ "default": "'default'"
1387
+ },
1388
+ "limit_window": {
1389
+ "name": "limit_window",
1390
+ "type": "text",
1391
+ "primaryKey": false,
1392
+ "notNull": true,
1393
+ "autoincrement": false
1394
+ },
1395
+ "bucket_start": {
1396
+ "name": "bucket_start",
1397
+ "type": "text",
1398
+ "primaryKey": false,
1399
+ "notNull": true,
1400
+ "autoincrement": false
1401
+ },
1402
+ "captured_at": {
1403
+ "name": "captured_at",
1404
+ "type": "text",
1405
+ "primaryKey": false,
1406
+ "notNull": true,
1407
+ "autoincrement": false
1408
+ },
1409
+ "used_percent": {
1410
+ "name": "used_percent",
1411
+ "type": "integer",
1412
+ "primaryKey": false,
1413
+ "notNull": true,
1414
+ "autoincrement": false
1415
+ },
1416
+ "remaining_percent": {
1417
+ "name": "remaining_percent",
1418
+ "type": "integer",
1419
+ "primaryKey": false,
1420
+ "notNull": true,
1421
+ "autoincrement": false
1422
+ },
1423
+ "resets_at": {
1424
+ "name": "resets_at",
1425
+ "type": "text",
1426
+ "primaryKey": false,
1427
+ "notNull": false,
1428
+ "autoincrement": false
1429
+ },
1430
+ "source": {
1431
+ "name": "source",
1432
+ "type": "text",
1433
+ "primaryKey": false,
1434
+ "notNull": true,
1435
+ "autoincrement": false
1436
+ },
1437
+ "metadata": {
1438
+ "name": "metadata",
1439
+ "type": "text",
1440
+ "primaryKey": false,
1441
+ "notNull": false,
1442
+ "autoincrement": false
1443
+ }
1444
+ },
1445
+ "indexes": {
1446
+ "uniq_usage_limit_snapshots_bucket": {
1447
+ "name": "uniq_usage_limit_snapshots_bucket",
1448
+ "columns": [
1449
+ "provider",
1450
+ "account_ref",
1451
+ "limit_window",
1452
+ "bucket_start"
1453
+ ],
1454
+ "isUnique": true
1455
+ },
1456
+ "idx_usage_limit_snapshots_window_bucket": {
1457
+ "name": "idx_usage_limit_snapshots_window_bucket",
1458
+ "columns": [
1459
+ "limit_window",
1460
+ "bucket_start"
1461
+ ],
1462
+ "isUnique": false
1463
+ },
1464
+ "idx_usage_limit_snapshots_provider_window_bucket": {
1465
+ "name": "idx_usage_limit_snapshots_provider_window_bucket",
1466
+ "columns": [
1467
+ "provider",
1468
+ "limit_window",
1469
+ "bucket_start"
1470
+ ],
1471
+ "isUnique": false
1472
+ }
1473
+ },
1474
+ "foreignKeys": {},
1475
+ "compositePrimaryKeys": {},
1476
+ "uniqueConstraints": {},
1477
+ "checkConstraints": {}
1478
+ },
1479
+ "usage_reports": {
1480
+ "name": "usage_reports",
1481
+ "columns": {
1482
+ "id": {
1483
+ "name": "id",
1484
+ "type": "text",
1485
+ "primaryKey": true,
1486
+ "notNull": true,
1487
+ "autoincrement": false
1488
+ },
1489
+ "workspace_id": {
1490
+ "name": "workspace_id",
1491
+ "type": "text",
1492
+ "primaryKey": false,
1493
+ "notNull": true,
1494
+ "autoincrement": false
1495
+ },
1496
+ "month": {
1497
+ "name": "month",
1498
+ "type": "text",
1499
+ "primaryKey": false,
1500
+ "notNull": true,
1501
+ "autoincrement": false
1502
+ },
1503
+ "generated_at": {
1504
+ "name": "generated_at",
1505
+ "type": "text",
1506
+ "primaryKey": false,
1507
+ "notNull": true,
1508
+ "autoincrement": false
1509
+ },
1510
+ "source_range": {
1511
+ "name": "source_range",
1512
+ "type": "text",
1513
+ "primaryKey": false,
1514
+ "notNull": true,
1515
+ "autoincrement": false
1516
+ },
1517
+ "tier": {
1518
+ "name": "tier",
1519
+ "type": "text",
1520
+ "primaryKey": false,
1521
+ "notNull": true,
1522
+ "autoincrement": false
1523
+ },
1524
+ "total_tokens": {
1525
+ "name": "total_tokens",
1526
+ "type": "integer",
1527
+ "primaryKey": false,
1528
+ "notNull": true,
1529
+ "autoincrement": false
1530
+ },
1531
+ "total_cost_usd": {
1532
+ "name": "total_cost_usd",
1533
+ "type": "real",
1534
+ "primaryKey": false,
1535
+ "notNull": true,
1536
+ "autoincrement": false
1537
+ },
1538
+ "payload": {
1539
+ "name": "payload",
1540
+ "type": "text",
1541
+ "primaryKey": false,
1542
+ "notNull": true,
1543
+ "autoincrement": false
1544
+ },
1545
+ "payload_hash": {
1546
+ "name": "payload_hash",
1547
+ "type": "text",
1548
+ "primaryKey": false,
1549
+ "notNull": false,
1550
+ "autoincrement": false
1551
+ },
1552
+ "signature": {
1553
+ "name": "signature",
1554
+ "type": "text",
1555
+ "primaryKey": false,
1556
+ "notNull": false,
1557
+ "autoincrement": false
1558
+ },
1559
+ "signed_at": {
1560
+ "name": "signed_at",
1561
+ "type": "text",
1562
+ "primaryKey": false,
1563
+ "notNull": false,
1564
+ "autoincrement": false
1565
+ },
1566
+ "issuer": {
1567
+ "name": "issuer",
1568
+ "type": "text",
1569
+ "primaryKey": false,
1570
+ "notNull": false,
1571
+ "autoincrement": false
1572
+ }
1573
+ },
1574
+ "indexes": {
1575
+ "uniq_usage_reports_ws_month": {
1576
+ "name": "uniq_usage_reports_ws_month",
1577
+ "columns": [
1578
+ "workspace_id",
1579
+ "month"
1580
+ ],
1581
+ "isUnique": true
1582
+ }
1583
+ },
1584
+ "foreignKeys": {},
1585
+ "compositePrimaryKeys": {},
1586
+ "uniqueConstraints": {},
1587
+ "checkConstraints": {}
1588
+ },
1589
+ "notification_reads": {
1590
+ "name": "notification_reads",
1591
+ "columns": {
1592
+ "notification_id": {
1593
+ "name": "notification_id",
1594
+ "type": "text",
1595
+ "primaryKey": false,
1596
+ "notNull": true,
1597
+ "autoincrement": false
1598
+ },
1599
+ "user_id": {
1600
+ "name": "user_id",
1601
+ "type": "text",
1602
+ "primaryKey": false,
1603
+ "notNull": true,
1604
+ "autoincrement": false
1605
+ },
1606
+ "read_at": {
1607
+ "name": "read_at",
1608
+ "type": "text",
1609
+ "primaryKey": false,
1610
+ "notNull": true,
1611
+ "autoincrement": false
1612
+ }
1613
+ },
1614
+ "indexes": {},
1615
+ "foreignKeys": {},
1616
+ "compositePrimaryKeys": {
1617
+ "notification_reads_notification_id_user_id_pk": {
1618
+ "columns": [
1619
+ "notification_id",
1620
+ "user_id"
1621
+ ],
1622
+ "name": "notification_reads_notification_id_user_id_pk"
1623
+ }
1624
+ },
1625
+ "uniqueConstraints": {},
1626
+ "checkConstraints": {}
1627
+ },
1628
+ "notifications": {
1629
+ "name": "notifications",
1630
+ "columns": {
1631
+ "id": {
1632
+ "name": "id",
1633
+ "type": "text",
1634
+ "primaryKey": true,
1635
+ "notNull": true,
1636
+ "autoincrement": false
1637
+ },
1638
+ "workspace_id": {
1639
+ "name": "workspace_id",
1640
+ "type": "text",
1641
+ "primaryKey": false,
1642
+ "notNull": true,
1643
+ "autoincrement": false
1644
+ },
1645
+ "agent_id": {
1646
+ "name": "agent_id",
1647
+ "type": "text",
1648
+ "primaryKey": false,
1649
+ "notNull": false,
1650
+ "autoincrement": false
1651
+ },
1652
+ "task_id": {
1653
+ "name": "task_id",
1654
+ "type": "text",
1655
+ "primaryKey": false,
1656
+ "notNull": false,
1657
+ "autoincrement": false
1658
+ },
1659
+ "thread_id": {
1660
+ "name": "thread_id",
1661
+ "type": "text",
1662
+ "primaryKey": false,
1663
+ "notNull": false,
1664
+ "autoincrement": false
1665
+ },
1666
+ "source": {
1667
+ "name": "source",
1668
+ "type": "text",
1669
+ "primaryKey": false,
1670
+ "notNull": true,
1671
+ "autoincrement": false,
1672
+ "default": "'agent'"
1673
+ },
1674
+ "level": {
1675
+ "name": "level",
1676
+ "type": "text",
1677
+ "primaryKey": false,
1678
+ "notNull": true,
1679
+ "autoincrement": false,
1680
+ "default": "'info'"
1681
+ },
1682
+ "title": {
1683
+ "name": "title",
1684
+ "type": "text",
1685
+ "primaryKey": false,
1686
+ "notNull": true,
1687
+ "autoincrement": false
1688
+ },
1689
+ "body": {
1690
+ "name": "body",
1691
+ "type": "text",
1692
+ "primaryKey": false,
1693
+ "notNull": false,
1694
+ "autoincrement": false
1695
+ },
1696
+ "target_user_id": {
1697
+ "name": "target_user_id",
1698
+ "type": "text",
1699
+ "primaryKey": false,
1700
+ "notNull": false,
1701
+ "autoincrement": false
1702
+ },
1703
+ "created_at": {
1704
+ "name": "created_at",
1705
+ "type": "text",
1706
+ "primaryKey": false,
1707
+ "notNull": true,
1708
+ "autoincrement": false
1709
+ },
1710
+ "metadata": {
1711
+ "name": "metadata",
1712
+ "type": "text",
1713
+ "primaryKey": false,
1714
+ "notNull": false,
1715
+ "autoincrement": false
1716
+ }
1717
+ },
1718
+ "indexes": {
1719
+ "idx_notifications_ws_created": {
1720
+ "name": "idx_notifications_ws_created",
1721
+ "columns": [
1722
+ "workspace_id",
1723
+ "\"created_at\" DESC"
1724
+ ],
1725
+ "isUnique": false
1726
+ }
1727
+ },
1728
+ "foreignKeys": {},
1729
+ "compositePrimaryKeys": {},
1730
+ "uniqueConstraints": {},
1731
+ "checkConstraints": {}
1732
+ },
1733
+ "agent_suggestions": {
1734
+ "name": "agent_suggestions",
1735
+ "columns": {
1736
+ "id": {
1737
+ "name": "id",
1738
+ "type": "text",
1739
+ "primaryKey": true,
1740
+ "notNull": true,
1741
+ "autoincrement": false
1742
+ },
1743
+ "workspace_id": {
1744
+ "name": "workspace_id",
1745
+ "type": "text",
1746
+ "primaryKey": false,
1747
+ "notNull": true,
1748
+ "autoincrement": false
1749
+ },
1750
+ "agent_id": {
1751
+ "name": "agent_id",
1752
+ "type": "text",
1753
+ "primaryKey": false,
1754
+ "notNull": true,
1755
+ "autoincrement": false
1756
+ },
1757
+ "task_id": {
1758
+ "name": "task_id",
1759
+ "type": "text",
1760
+ "primaryKey": false,
1761
+ "notNull": false,
1762
+ "autoincrement": false
1763
+ },
1764
+ "type": {
1765
+ "name": "type",
1766
+ "type": "text",
1767
+ "primaryKey": false,
1768
+ "notNull": true,
1769
+ "autoincrement": false
1770
+ },
1771
+ "status": {
1772
+ "name": "status",
1773
+ "type": "text",
1774
+ "primaryKey": false,
1775
+ "notNull": true,
1776
+ "autoincrement": false,
1777
+ "default": "'pending'"
1778
+ },
1779
+ "payload": {
1780
+ "name": "payload",
1781
+ "type": "text",
1782
+ "primaryKey": false,
1783
+ "notNull": true,
1784
+ "autoincrement": false
1785
+ },
1786
+ "applied_commit_sha": {
1787
+ "name": "applied_commit_sha",
1788
+ "type": "text",
1789
+ "primaryKey": false,
1790
+ "notNull": false,
1791
+ "autoincrement": false
1792
+ },
1793
+ "created_at": {
1794
+ "name": "created_at",
1795
+ "type": "text",
1796
+ "primaryKey": false,
1797
+ "notNull": true,
1798
+ "autoincrement": false
1799
+ },
1800
+ "updated_at": {
1801
+ "name": "updated_at",
1802
+ "type": "text",
1803
+ "primaryKey": false,
1804
+ "notNull": true,
1805
+ "autoincrement": false
1806
+ }
1807
+ },
1808
+ "indexes": {
1809
+ "idx_agent_suggestions_ws_agent": {
1810
+ "name": "idx_agent_suggestions_ws_agent",
1811
+ "columns": [
1812
+ "workspace_id",
1813
+ "agent_id"
1814
+ ],
1815
+ "isUnique": false
1816
+ },
1817
+ "idx_agent_suggestions_ws_created": {
1818
+ "name": "idx_agent_suggestions_ws_created",
1819
+ "columns": [
1820
+ "workspace_id",
1821
+ "created_at"
1822
+ ],
1823
+ "isUnique": false
1824
+ }
1825
+ },
1826
+ "foreignKeys": {},
1827
+ "compositePrimaryKeys": {},
1828
+ "uniqueConstraints": {},
1829
+ "checkConstraints": {}
1830
+ },
1831
+ "ui_instances": {
1832
+ "name": "ui_instances",
1833
+ "columns": {
1834
+ "id": {
1835
+ "name": "id",
1836
+ "type": "text",
1837
+ "primaryKey": true,
1838
+ "notNull": true,
1839
+ "autoincrement": false
1840
+ },
1841
+ "definition_id": {
1842
+ "name": "definition_id",
1843
+ "type": "text",
1844
+ "primaryKey": false,
1845
+ "notNull": true,
1846
+ "autoincrement": false
1847
+ },
1848
+ "definition_version": {
1849
+ "name": "definition_version",
1850
+ "type": "integer",
1851
+ "primaryKey": false,
1852
+ "notNull": true,
1853
+ "autoincrement": false
1854
+ },
1855
+ "definition_hash": {
1856
+ "name": "definition_hash",
1857
+ "type": "text",
1858
+ "primaryKey": false,
1859
+ "notNull": true,
1860
+ "autoincrement": false
1861
+ },
1862
+ "workspace_id": {
1863
+ "name": "workspace_id",
1864
+ "type": "text",
1865
+ "primaryKey": false,
1866
+ "notNull": true,
1867
+ "autoincrement": false
1868
+ },
1869
+ "thread_id": {
1870
+ "name": "thread_id",
1871
+ "type": "text",
1872
+ "primaryKey": false,
1873
+ "notNull": true,
1874
+ "autoincrement": false
1875
+ },
1876
+ "app_id": {
1877
+ "name": "app_id",
1878
+ "type": "text",
1879
+ "primaryKey": false,
1880
+ "notNull": false,
1881
+ "autoincrement": false
1882
+ },
1883
+ "anchor_task_id": {
1884
+ "name": "anchor_task_id",
1885
+ "type": "text",
1886
+ "primaryKey": false,
1887
+ "notNull": false,
1888
+ "autoincrement": false
1889
+ },
1890
+ "domain_ref_json": {
1891
+ "name": "domain_ref_json",
1892
+ "type": "text",
1893
+ "primaryKey": false,
1894
+ "notNull": true,
1895
+ "autoincrement": false
1896
+ },
1897
+ "state_json": {
1898
+ "name": "state_json",
1899
+ "type": "text",
1900
+ "primaryKey": false,
1901
+ "notNull": true,
1902
+ "autoincrement": false
1903
+ },
1904
+ "revision": {
1905
+ "name": "revision",
1906
+ "type": "integer",
1907
+ "primaryKey": false,
1908
+ "notNull": true,
1909
+ "autoincrement": false,
1910
+ "default": 0
1911
+ },
1912
+ "status": {
1913
+ "name": "status",
1914
+ "type": "text",
1915
+ "primaryKey": false,
1916
+ "notNull": true,
1917
+ "autoincrement": false,
1918
+ "default": "'active'"
1919
+ },
1920
+ "granted_capabilities_json": {
1921
+ "name": "granted_capabilities_json",
1922
+ "type": "text",
1923
+ "primaryKey": false,
1924
+ "notNull": true,
1925
+ "autoincrement": false,
1926
+ "default": "'[]'"
1927
+ },
1928
+ "opened_by_json": {
1929
+ "name": "opened_by_json",
1930
+ "type": "text",
1931
+ "primaryKey": false,
1932
+ "notNull": false,
1933
+ "autoincrement": false
1934
+ },
1935
+ "created_at": {
1936
+ "name": "created_at",
1937
+ "type": "integer",
1938
+ "primaryKey": false,
1939
+ "notNull": true,
1940
+ "autoincrement": false
1941
+ },
1942
+ "updated_at": {
1943
+ "name": "updated_at",
1944
+ "type": "integer",
1945
+ "primaryKey": false,
1946
+ "notNull": true,
1947
+ "autoincrement": false
1948
+ }
1949
+ },
1950
+ "indexes": {
1951
+ "ui_instances_workspace_thread_idx": {
1952
+ "name": "ui_instances_workspace_thread_idx",
1953
+ "columns": [
1954
+ "workspace_id",
1955
+ "thread_id"
1956
+ ],
1957
+ "isUnique": false
1958
+ },
1959
+ "ui_instances_workspace_thread_app_uq": {
1960
+ "name": "ui_instances_workspace_thread_app_uq",
1961
+ "columns": [
1962
+ "workspace_id",
1963
+ "thread_id",
1964
+ "app_id"
1965
+ ],
1966
+ "isUnique": true,
1967
+ "where": "\"ui_instances\".\"status\" = 'active'"
1968
+ }
1969
+ },
1970
+ "foreignKeys": {},
1971
+ "compositePrimaryKeys": {},
1972
+ "uniqueConstraints": {},
1973
+ "checkConstraints": {
1974
+ "ui_instances_id_ck": {
1975
+ "name": "ui_instances_id_ck",
1976
+ "value": "length(\"ui_instances\".\"id\") BETWEEN 5 AND 128 AND \"ui_instances\".\"id\" GLOB 'uic_*'"
1977
+ },
1978
+ "ui_instances_definition_id_ck": {
1979
+ "name": "ui_instances_definition_id_ck",
1980
+ "value": "length(\"ui_instances\".\"definition_id\") BETWEEN 1 AND 128"
1981
+ },
1982
+ "ui_instances_definition_version_ck": {
1983
+ "name": "ui_instances_definition_version_ck",
1984
+ "value": "\"ui_instances\".\"definition_version\" >= 1"
1985
+ },
1986
+ "ui_instances_definition_hash_ck": {
1987
+ "name": "ui_instances_definition_hash_ck",
1988
+ "value": "length(\"ui_instances\".\"definition_hash\") = 64 AND \"ui_instances\".\"definition_hash\" NOT GLOB '*[^0-9a-f]*'"
1989
+ },
1990
+ "ui_instances_workspace_id_ck": {
1991
+ "name": "ui_instances_workspace_id_ck",
1992
+ "value": "length(\"ui_instances\".\"workspace_id\") BETWEEN 1 AND 256"
1993
+ },
1994
+ "ui_instances_thread_id_ck": {
1995
+ "name": "ui_instances_thread_id_ck",
1996
+ "value": "length(\"ui_instances\".\"thread_id\") BETWEEN 1 AND 256"
1997
+ },
1998
+ "ui_instances_app_id_ck": {
1999
+ "name": "ui_instances_app_id_ck",
2000
+ "value": "\"ui_instances\".\"app_id\" IS NULL OR length(\"ui_instances\".\"app_id\") BETWEEN 1 AND 128"
2001
+ },
2002
+ "ui_instances_domain_ref_json_ck": {
2003
+ "name": "ui_instances_domain_ref_json_ck",
2004
+ "value": "json_valid(\"ui_instances\".\"domain_ref_json\") AND json_type(\"ui_instances\".\"domain_ref_json\") = 'object'"
2005
+ },
2006
+ "ui_instances_state_json_ck": {
2007
+ "name": "ui_instances_state_json_ck",
2008
+ "value": "json_valid(\"ui_instances\".\"state_json\") AND json_type(\"ui_instances\".\"state_json\") = 'object'"
2009
+ },
2010
+ "ui_instances_revision_ck": {
2011
+ "name": "ui_instances_revision_ck",
2012
+ "value": "\"ui_instances\".\"revision\" >= 0"
2013
+ },
2014
+ "ui_instances_status_ck": {
2015
+ "name": "ui_instances_status_ck",
2016
+ "value": "\"ui_instances\".\"status\" IN ('active', 'completed', 'expired', 'revoked', 'unsupported')"
2017
+ },
2018
+ "ui_instances_granted_capabilities_json_ck": {
2019
+ "name": "ui_instances_granted_capabilities_json_ck",
2020
+ "value": "json_valid(\"ui_instances\".\"granted_capabilities_json\") AND json_type(\"ui_instances\".\"granted_capabilities_json\") = 'array'"
2021
+ },
2022
+ "ui_instances_opened_by_json_ck": {
2023
+ "name": "ui_instances_opened_by_json_ck",
2024
+ "value": "\"ui_instances\".\"opened_by_json\" IS NULL OR (json_valid(\"ui_instances\".\"opened_by_json\") AND json_type(\"ui_instances\".\"opened_by_json\") = 'object')"
2025
+ },
2026
+ "ui_instances_created_at_ck": {
2027
+ "name": "ui_instances_created_at_ck",
2028
+ "value": "\"ui_instances\".\"created_at\" >= 0"
2029
+ },
2030
+ "ui_instances_updated_at_ck": {
2031
+ "name": "ui_instances_updated_at_ck",
2032
+ "value": "\"ui_instances\".\"updated_at\" >= \"ui_instances\".\"created_at\""
2033
+ }
2034
+ }
2035
+ },
2036
+ "ui_action_receipts": {
2037
+ "name": "ui_action_receipts",
2038
+ "columns": {
2039
+ "id": {
2040
+ "name": "id",
2041
+ "type": "text",
2042
+ "primaryKey": true,
2043
+ "notNull": true,
2044
+ "autoincrement": false
2045
+ },
2046
+ "instance_id": {
2047
+ "name": "instance_id",
2048
+ "type": "text",
2049
+ "primaryKey": false,
2050
+ "notNull": true,
2051
+ "autoincrement": false
2052
+ },
2053
+ "definition_id": {
2054
+ "name": "definition_id",
2055
+ "type": "text",
2056
+ "primaryKey": false,
2057
+ "notNull": false,
2058
+ "autoincrement": false
2059
+ },
2060
+ "definition_version": {
2061
+ "name": "definition_version",
2062
+ "type": "integer",
2063
+ "primaryKey": false,
2064
+ "notNull": false,
2065
+ "autoincrement": false
2066
+ },
2067
+ "definition_hash": {
2068
+ "name": "definition_hash",
2069
+ "type": "text",
2070
+ "primaryKey": false,
2071
+ "notNull": false,
2072
+ "autoincrement": false
2073
+ },
2074
+ "request_id": {
2075
+ "name": "request_id",
2076
+ "type": "text",
2077
+ "primaryKey": false,
2078
+ "notNull": true,
2079
+ "autoincrement": false
2080
+ },
2081
+ "action_id": {
2082
+ "name": "action_id",
2083
+ "type": "text",
2084
+ "primaryKey": false,
2085
+ "notNull": true,
2086
+ "autoincrement": false
2087
+ },
2088
+ "actor_json": {
2089
+ "name": "actor_json",
2090
+ "type": "text",
2091
+ "primaryKey": false,
2092
+ "notNull": true,
2093
+ "autoincrement": false
2094
+ },
2095
+ "source": {
2096
+ "name": "source",
2097
+ "type": "text",
2098
+ "primaryKey": false,
2099
+ "notNull": true,
2100
+ "autoincrement": false
2101
+ },
2102
+ "expected_revision": {
2103
+ "name": "expected_revision",
2104
+ "type": "integer",
2105
+ "primaryKey": false,
2106
+ "notNull": true,
2107
+ "autoincrement": false
2108
+ },
2109
+ "before_revision": {
2110
+ "name": "before_revision",
2111
+ "type": "integer",
2112
+ "primaryKey": false,
2113
+ "notNull": true,
2114
+ "autoincrement": false
2115
+ },
2116
+ "after_revision": {
2117
+ "name": "after_revision",
2118
+ "type": "integer",
2119
+ "primaryKey": false,
2120
+ "notNull": false,
2121
+ "autoincrement": false
2122
+ },
2123
+ "status": {
2124
+ "name": "status",
2125
+ "type": "text",
2126
+ "primaryKey": false,
2127
+ "notNull": true,
2128
+ "autoincrement": false
2129
+ },
2130
+ "outcome": {
2131
+ "name": "outcome",
2132
+ "type": "text",
2133
+ "primaryKey": false,
2134
+ "notNull": false,
2135
+ "autoincrement": false
2136
+ },
2137
+ "input_json": {
2138
+ "name": "input_json",
2139
+ "type": "text",
2140
+ "primaryKey": false,
2141
+ "notNull": true,
2142
+ "autoincrement": false
2143
+ },
2144
+ "result_json": {
2145
+ "name": "result_json",
2146
+ "type": "text",
2147
+ "primaryKey": false,
2148
+ "notNull": false,
2149
+ "autoincrement": false
2150
+ },
2151
+ "error_code": {
2152
+ "name": "error_code",
2153
+ "type": "text",
2154
+ "primaryKey": false,
2155
+ "notNull": false,
2156
+ "autoincrement": false
2157
+ },
2158
+ "requested_at": {
2159
+ "name": "requested_at",
2160
+ "type": "integer",
2161
+ "primaryKey": false,
2162
+ "notNull": true,
2163
+ "autoincrement": false
2164
+ },
2165
+ "settled_at": {
2166
+ "name": "settled_at",
2167
+ "type": "integer",
2168
+ "primaryKey": false,
2169
+ "notNull": false,
2170
+ "autoincrement": false
2171
+ }
2172
+ },
2173
+ "indexes": {
2174
+ "ui_action_receipts_instance_request_uq": {
2175
+ "name": "ui_action_receipts_instance_request_uq",
2176
+ "columns": [
2177
+ "instance_id",
2178
+ "request_id"
2179
+ ],
2180
+ "isUnique": true
2181
+ },
2182
+ "ui_action_receipts_instance_id_idx": {
2183
+ "name": "ui_action_receipts_instance_id_idx",
2184
+ "columns": [
2185
+ "instance_id"
2186
+ ],
2187
+ "isUnique": false
2188
+ },
2189
+ "ui_action_receipts_requested_at_idx": {
2190
+ "name": "ui_action_receipts_requested_at_idx",
2191
+ "columns": [
2192
+ "requested_at"
2193
+ ],
2194
+ "isUnique": false
2195
+ }
2196
+ },
2197
+ "foreignKeys": {},
2198
+ "compositePrimaryKeys": {},
2199
+ "uniqueConstraints": {},
2200
+ "checkConstraints": {
2201
+ "ui_action_receipts_id_ck": {
2202
+ "name": "ui_action_receipts_id_ck",
2203
+ "value": "length(\"ui_action_receipts\".\"id\") BETWEEN 5 AND 128"
2204
+ },
2205
+ "ui_action_receipts_instance_id_ck": {
2206
+ "name": "ui_action_receipts_instance_id_ck",
2207
+ "value": "length(\"ui_action_receipts\".\"instance_id\") BETWEEN 1 AND 128"
2208
+ },
2209
+ "ui_action_receipts_request_id_ck": {
2210
+ "name": "ui_action_receipts_request_id_ck",
2211
+ "value": "length(\"ui_action_receipts\".\"request_id\") BETWEEN 1 AND 128"
2212
+ },
2213
+ "ui_action_receipts_action_id_ck": {
2214
+ "name": "ui_action_receipts_action_id_ck",
2215
+ "value": "length(\"ui_action_receipts\".\"action_id\") BETWEEN 1 AND 128"
2216
+ },
2217
+ "ui_action_receipts_actor_json_ck": {
2218
+ "name": "ui_action_receipts_actor_json_ck",
2219
+ "value": "json_valid(\"ui_action_receipts\".\"actor_json\") AND json_type(\"ui_action_receipts\".\"actor_json\") = 'object'"
2220
+ },
2221
+ "ui_action_receipts_source_ck": {
2222
+ "name": "ui_action_receipts_source_ck",
2223
+ "value": "\"ui_action_receipts\".\"source\" IN ('ui_host', 'cli', 'system', 'mcp')"
2224
+ },
2225
+ "ui_action_receipts_expected_revision_ck": {
2226
+ "name": "ui_action_receipts_expected_revision_ck",
2227
+ "value": "\"ui_action_receipts\".\"expected_revision\" >= 0"
2228
+ },
2229
+ "ui_action_receipts_before_revision_ck": {
2230
+ "name": "ui_action_receipts_before_revision_ck",
2231
+ "value": "\"ui_action_receipts\".\"before_revision\" >= 0"
2232
+ },
2233
+ "ui_action_receipts_after_revision_ck": {
2234
+ "name": "ui_action_receipts_after_revision_ck",
2235
+ "value": "\"ui_action_receipts\".\"after_revision\" IS NULL OR \"ui_action_receipts\".\"after_revision\" >= 0"
2236
+ },
2237
+ "ui_action_receipts_status_ck": {
2238
+ "name": "ui_action_receipts_status_ck",
2239
+ "value": "\"ui_action_receipts\".\"status\" IN ('requested', 'settled')"
2240
+ },
2241
+ "ui_action_receipts_outcome_ck": {
2242
+ "name": "ui_action_receipts_outcome_ck",
2243
+ "value": "\"ui_action_receipts\".\"outcome\" IS NULL OR \"ui_action_receipts\".\"outcome\" IN ('succeeded', 'rejected', 'failed', 'conflicted', 'expired')"
2244
+ },
2245
+ "ui_action_receipts_input_json_ck": {
2246
+ "name": "ui_action_receipts_input_json_ck",
2247
+ "value": "json_valid(\"ui_action_receipts\".\"input_json\") AND json_type(\"ui_action_receipts\".\"input_json\") = 'object'"
2248
+ },
2249
+ "ui_action_receipts_result_json_ck": {
2250
+ "name": "ui_action_receipts_result_json_ck",
2251
+ "value": "\"ui_action_receipts\".\"result_json\" IS NULL OR (json_valid(\"ui_action_receipts\".\"result_json\") AND json_type(\"ui_action_receipts\".\"result_json\") = 'object')"
2252
+ },
2253
+ "ui_action_receipts_requested_at_ck": {
2254
+ "name": "ui_action_receipts_requested_at_ck",
2255
+ "value": "\"ui_action_receipts\".\"requested_at\" >= 0"
2256
+ },
2257
+ "ui_action_receipts_settled_at_ck": {
2258
+ "name": "ui_action_receipts_settled_at_ck",
2259
+ "value": "\"ui_action_receipts\".\"settled_at\" IS NULL OR \"ui_action_receipts\".\"settled_at\" >= \"ui_action_receipts\".\"requested_at\""
2260
+ },
2261
+ "ui_action_receipts_status_transition_ck": {
2262
+ "name": "ui_action_receipts_status_transition_ck",
2263
+ "value": "(\n (\"ui_action_receipts\".\"status\" = 'requested' AND \"ui_action_receipts\".\"after_revision\" IS NULL AND \"ui_action_receipts\".\"outcome\" IS NULL AND \"ui_action_receipts\".\"settled_at\" IS NULL)\n OR\n (\"ui_action_receipts\".\"status\" = 'settled' AND \"ui_action_receipts\".\"after_revision\" IS NOT NULL AND \"ui_action_receipts\".\"outcome\" IS NOT NULL AND \"ui_action_receipts\".\"settled_at\" IS NOT NULL)\n )"
2264
+ }
2265
+ }
2266
+ },
2267
+ "ui_instance_repins": {
2268
+ "name": "ui_instance_repins",
2269
+ "columns": {
2270
+ "instance_id": {
2271
+ "name": "instance_id",
2272
+ "type": "text",
2273
+ "primaryKey": false,
2274
+ "notNull": true,
2275
+ "autoincrement": false
2276
+ },
2277
+ "from_version": {
2278
+ "name": "from_version",
2279
+ "type": "integer",
2280
+ "primaryKey": false,
2281
+ "notNull": true,
2282
+ "autoincrement": false
2283
+ },
2284
+ "from_hash": {
2285
+ "name": "from_hash",
2286
+ "type": "text",
2287
+ "primaryKey": false,
2288
+ "notNull": true,
2289
+ "autoincrement": false
2290
+ },
2291
+ "to_version": {
2292
+ "name": "to_version",
2293
+ "type": "integer",
2294
+ "primaryKey": false,
2295
+ "notNull": true,
2296
+ "autoincrement": false
2297
+ },
2298
+ "to_hash": {
2299
+ "name": "to_hash",
2300
+ "type": "text",
2301
+ "primaryKey": false,
2302
+ "notNull": true,
2303
+ "autoincrement": false
2304
+ },
2305
+ "from_revision": {
2306
+ "name": "from_revision",
2307
+ "type": "integer",
2308
+ "primaryKey": false,
2309
+ "notNull": true,
2310
+ "autoincrement": false
2311
+ },
2312
+ "to_revision": {
2313
+ "name": "to_revision",
2314
+ "type": "integer",
2315
+ "primaryKey": false,
2316
+ "notNull": false,
2317
+ "autoincrement": false
2318
+ },
2319
+ "status": {
2320
+ "name": "status",
2321
+ "type": "text",
2322
+ "primaryKey": false,
2323
+ "notNull": true,
2324
+ "autoincrement": false
2325
+ },
2326
+ "code": {
2327
+ "name": "code",
2328
+ "type": "text",
2329
+ "primaryKey": false,
2330
+ "notNull": false,
2331
+ "autoincrement": false
2332
+ },
2333
+ "attempts": {
2334
+ "name": "attempts",
2335
+ "type": "integer",
2336
+ "primaryKey": false,
2337
+ "notNull": true,
2338
+ "autoincrement": false,
2339
+ "default": 1
2340
+ },
2341
+ "first_at": {
2342
+ "name": "first_at",
2343
+ "type": "integer",
2344
+ "primaryKey": false,
2345
+ "notNull": true,
2346
+ "autoincrement": false
2347
+ },
2348
+ "last_at": {
2349
+ "name": "last_at",
2350
+ "type": "integer",
2351
+ "primaryKey": false,
2352
+ "notNull": true,
2353
+ "autoincrement": false
2354
+ }
2355
+ },
2356
+ "indexes": {},
2357
+ "foreignKeys": {},
2358
+ "compositePrimaryKeys": {
2359
+ "ui_instance_repins_pk": {
2360
+ "columns": [
2361
+ "instance_id",
2362
+ "to_hash"
2363
+ ],
2364
+ "name": "ui_instance_repins_pk"
2365
+ }
2366
+ },
2367
+ "uniqueConstraints": {},
2368
+ "checkConstraints": {
2369
+ "ui_instance_repins_instance_id_ck": {
2370
+ "name": "ui_instance_repins_instance_id_ck",
2371
+ "value": "length(\"ui_instance_repins\".\"instance_id\") BETWEEN 5 AND 128 AND \"ui_instance_repins\".\"instance_id\" GLOB 'uic_*'"
2372
+ },
2373
+ "ui_instance_repins_from_version_ck": {
2374
+ "name": "ui_instance_repins_from_version_ck",
2375
+ "value": "\"ui_instance_repins\".\"from_version\" >= 1"
2376
+ },
2377
+ "ui_instance_repins_to_version_ck": {
2378
+ "name": "ui_instance_repins_to_version_ck",
2379
+ "value": "\"ui_instance_repins\".\"to_version\" >= 1"
2380
+ },
2381
+ "ui_instance_repins_from_hash_ck": {
2382
+ "name": "ui_instance_repins_from_hash_ck",
2383
+ "value": "length(\"ui_instance_repins\".\"from_hash\") = 64 AND \"ui_instance_repins\".\"from_hash\" NOT GLOB '*[^0-9a-f]*'"
2384
+ },
2385
+ "ui_instance_repins_to_hash_ck": {
2386
+ "name": "ui_instance_repins_to_hash_ck",
2387
+ "value": "length(\"ui_instance_repins\".\"to_hash\") = 64 AND \"ui_instance_repins\".\"to_hash\" NOT GLOB '*[^0-9a-f]*'"
2388
+ },
2389
+ "ui_instance_repins_from_revision_ck": {
2390
+ "name": "ui_instance_repins_from_revision_ck",
2391
+ "value": "\"ui_instance_repins\".\"from_revision\" >= 0"
2392
+ },
2393
+ "ui_instance_repins_to_revision_ck": {
2394
+ "name": "ui_instance_repins_to_revision_ck",
2395
+ "value": "\"ui_instance_repins\".\"to_revision\" IS NULL OR \"ui_instance_repins\".\"to_revision\" >= 0"
2396
+ },
2397
+ "ui_instance_repins_status_ck": {
2398
+ "name": "ui_instance_repins_status_ck",
2399
+ "value": "\"ui_instance_repins\".\"status\" IN ('applied', 'deferred', 'failed')"
2400
+ },
2401
+ "ui_instance_repins_attempts_ck": {
2402
+ "name": "ui_instance_repins_attempts_ck",
2403
+ "value": "\"ui_instance_repins\".\"attempts\" >= 1"
2404
+ },
2405
+ "ui_instance_repins_dates_ck": {
2406
+ "name": "ui_instance_repins_dates_ck",
2407
+ "value": "\"ui_instance_repins\".\"first_at\" >= 0 AND \"ui_instance_repins\".\"last_at\" >= \"ui_instance_repins\".\"first_at\""
2408
+ },
2409
+ "ui_instance_repins_result_ck": {
2410
+ "name": "ui_instance_repins_result_ck",
2411
+ "value": "(\n (\"ui_instance_repins\".\"status\" = 'applied' AND \"ui_instance_repins\".\"code\" IS NULL\n AND \"ui_instance_repins\".\"to_revision\" = \"ui_instance_repins\".\"from_revision\" + 1)\n OR\n (\"ui_instance_repins\".\"status\" IN ('deferred', 'failed') AND \"ui_instance_repins\".\"code\" IS NOT NULL\n AND \"ui_instance_repins\".\"to_revision\" IS NULL)\n )"
2412
+ }
2413
+ }
2414
+ },
2415
+ "project_criteria": {
2416
+ "name": "project_criteria",
2417
+ "columns": {
2418
+ "id": {
2419
+ "name": "id",
2420
+ "type": "text",
2421
+ "primaryKey": true,
2422
+ "notNull": true,
2423
+ "autoincrement": false
2424
+ },
2425
+ "project_id": {
2426
+ "name": "project_id",
2427
+ "type": "text",
2428
+ "primaryKey": false,
2429
+ "notNull": true,
2430
+ "autoincrement": false
2431
+ },
2432
+ "position": {
2433
+ "name": "position",
2434
+ "type": "integer",
2435
+ "primaryKey": false,
2436
+ "notNull": true,
2437
+ "autoincrement": false
2438
+ },
2439
+ "statement": {
2440
+ "name": "statement",
2441
+ "type": "text",
2442
+ "primaryKey": false,
2443
+ "notNull": true,
2444
+ "autoincrement": false
2445
+ },
2446
+ "verify_status": {
2447
+ "name": "verify_status",
2448
+ "type": "text",
2449
+ "primaryKey": false,
2450
+ "notNull": true,
2451
+ "autoincrement": false,
2452
+ "default": "'pending'"
2453
+ },
2454
+ "verified_at": {
2455
+ "name": "verified_at",
2456
+ "type": "text",
2457
+ "primaryKey": false,
2458
+ "notNull": false,
2459
+ "autoincrement": false
2460
+ },
2461
+ "evidence_json": {
2462
+ "name": "evidence_json",
2463
+ "type": "text",
2464
+ "primaryKey": false,
2465
+ "notNull": true,
2466
+ "autoincrement": false,
2467
+ "default": "'[]'"
2468
+ },
2469
+ "created_at": {
2470
+ "name": "created_at",
2471
+ "type": "text",
2472
+ "primaryKey": false,
2473
+ "notNull": true,
2474
+ "autoincrement": false
2475
+ },
2476
+ "updated_at": {
2477
+ "name": "updated_at",
2478
+ "type": "text",
2479
+ "primaryKey": false,
2480
+ "notNull": true,
2481
+ "autoincrement": false
2482
+ }
2483
+ },
2484
+ "indexes": {
2485
+ "project_criteria_project_position_uq": {
2486
+ "name": "project_criteria_project_position_uq",
2487
+ "columns": [
2488
+ "project_id",
2489
+ "position"
2490
+ ],
2491
+ "isUnique": true
2492
+ }
2493
+ },
2494
+ "foreignKeys": {
2495
+ "project_criteria_project_id_projects_id_fk": {
2496
+ "name": "project_criteria_project_id_projects_id_fk",
2497
+ "tableFrom": "project_criteria",
2498
+ "tableTo": "projects",
2499
+ "columnsFrom": [
2500
+ "project_id"
2501
+ ],
2502
+ "columnsTo": [
2503
+ "id"
2504
+ ],
2505
+ "onDelete": "cascade",
2506
+ "onUpdate": "no action"
2507
+ }
2508
+ },
2509
+ "compositePrimaryKeys": {},
2510
+ "uniqueConstraints": {},
2511
+ "checkConstraints": {
2512
+ "project_criteria_id_ck": {
2513
+ "name": "project_criteria_id_ck",
2514
+ "value": "\"project_criteria\".\"id\" GLOB 'pjc_*'"
2515
+ },
2516
+ "project_criteria_verify_status_ck": {
2517
+ "name": "project_criteria_verify_status_ck",
2518
+ "value": "\"project_criteria\".\"verify_status\" IN ('pending', 'verifying', 'passed', 'failed')"
2519
+ },
2520
+ "project_criteria_evidence_json_ck": {
2521
+ "name": "project_criteria_evidence_json_ck",
2522
+ "value": "json_valid(\"project_criteria\".\"evidence_json\") AND json_type(\"project_criteria\".\"evidence_json\") = 'array'"
2523
+ }
2524
+ }
2525
+ },
2526
+ "project_events": {
2527
+ "name": "project_events",
2528
+ "columns": {
2529
+ "id": {
2530
+ "name": "id",
2531
+ "type": "text",
2532
+ "primaryKey": true,
2533
+ "notNull": true,
2534
+ "autoincrement": false
2535
+ },
2536
+ "project_id": {
2537
+ "name": "project_id",
2538
+ "type": "text",
2539
+ "primaryKey": false,
2540
+ "notNull": true,
2541
+ "autoincrement": false
2542
+ },
2543
+ "seq": {
2544
+ "name": "seq",
2545
+ "type": "integer",
2546
+ "primaryKey": false,
2547
+ "notNull": true,
2548
+ "autoincrement": false
2549
+ },
2550
+ "actor_type": {
2551
+ "name": "actor_type",
2552
+ "type": "text",
2553
+ "primaryKey": false,
2554
+ "notNull": true,
2555
+ "autoincrement": false
2556
+ },
2557
+ "actor_id": {
2558
+ "name": "actor_id",
2559
+ "type": "text",
2560
+ "primaryKey": false,
2561
+ "notNull": false,
2562
+ "autoincrement": false
2563
+ },
2564
+ "type": {
2565
+ "name": "type",
2566
+ "type": "text",
2567
+ "primaryKey": false,
2568
+ "notNull": true,
2569
+ "autoincrement": false
2570
+ },
2571
+ "title": {
2572
+ "name": "title",
2573
+ "type": "text",
2574
+ "primaryKey": false,
2575
+ "notNull": true,
2576
+ "autoincrement": false
2577
+ },
2578
+ "summary": {
2579
+ "name": "summary",
2580
+ "type": "text",
2581
+ "primaryKey": false,
2582
+ "notNull": false,
2583
+ "autoincrement": false
2584
+ },
2585
+ "payload_json": {
2586
+ "name": "payload_json",
2587
+ "type": "text",
2588
+ "primaryKey": false,
2589
+ "notNull": true,
2590
+ "autoincrement": false,
2591
+ "default": "'{}'"
2592
+ },
2593
+ "created_at": {
2594
+ "name": "created_at",
2595
+ "type": "text",
2596
+ "primaryKey": false,
2597
+ "notNull": true,
2598
+ "autoincrement": false
2599
+ }
2600
+ },
2601
+ "indexes": {
2602
+ "project_events_project_seq_uq": {
2603
+ "name": "project_events_project_seq_uq",
2604
+ "columns": [
2605
+ "project_id",
2606
+ "seq"
2607
+ ],
2608
+ "isUnique": true
2609
+ }
2610
+ },
2611
+ "foreignKeys": {
2612
+ "project_events_project_id_projects_id_fk": {
2613
+ "name": "project_events_project_id_projects_id_fk",
2614
+ "tableFrom": "project_events",
2615
+ "tableTo": "projects",
2616
+ "columnsFrom": [
2617
+ "project_id"
2618
+ ],
2619
+ "columnsTo": [
2620
+ "id"
2621
+ ],
2622
+ "onDelete": "restrict",
2623
+ "onUpdate": "no action"
2624
+ }
2625
+ },
2626
+ "compositePrimaryKeys": {},
2627
+ "uniqueConstraints": {},
2628
+ "checkConstraints": {
2629
+ "project_events_id_ck": {
2630
+ "name": "project_events_id_ck",
2631
+ "value": "\"project_events\".\"id\" GLOB 'pje_*'"
2632
+ },
2633
+ "project_events_actor_type_ck": {
2634
+ "name": "project_events_actor_type_ck",
2635
+ "value": "\"project_events\".\"actor_type\" IN ('user', 'project_manager', 'system')"
2636
+ },
2637
+ "project_events_payload_json_ck": {
2638
+ "name": "project_events_payload_json_ck",
2639
+ "value": "json_valid(\"project_events\".\"payload_json\") AND json_type(\"project_events\".\"payload_json\") = 'object'"
2640
+ }
2641
+ }
2642
+ },
2643
+ "projects": {
2644
+ "name": "projects",
2645
+ "columns": {
2646
+ "id": {
2647
+ "name": "id",
2648
+ "type": "text",
2649
+ "primaryKey": true,
2650
+ "notNull": true,
2651
+ "autoincrement": false
2652
+ },
2653
+ "workspace_id": {
2654
+ "name": "workspace_id",
2655
+ "type": "text",
2656
+ "primaryKey": false,
2657
+ "notNull": true,
2658
+ "autoincrement": false
2659
+ },
2660
+ "name": {
2661
+ "name": "name",
2662
+ "type": "text",
2663
+ "primaryKey": false,
2664
+ "notNull": true,
2665
+ "autoincrement": false
2666
+ },
2667
+ "outcome": {
2668
+ "name": "outcome",
2669
+ "type": "text",
2670
+ "primaryKey": false,
2671
+ "notNull": true,
2672
+ "autoincrement": false
2673
+ },
2674
+ "due_date": {
2675
+ "name": "due_date",
2676
+ "type": "text",
2677
+ "primaryKey": false,
2678
+ "notNull": false,
2679
+ "autoincrement": false
2680
+ },
2681
+ "scene": {
2682
+ "name": "scene",
2683
+ "type": "text",
2684
+ "primaryKey": false,
2685
+ "notNull": true,
2686
+ "autoincrement": false,
2687
+ "default": "'planning'"
2688
+ },
2689
+ "stages_json": {
2690
+ "name": "stages_json",
2691
+ "type": "text",
2692
+ "primaryKey": false,
2693
+ "notNull": true,
2694
+ "autoincrement": false
2695
+ },
2696
+ "stage_index": {
2697
+ "name": "stage_index",
2698
+ "type": "integer",
2699
+ "primaryKey": false,
2700
+ "notNull": true,
2701
+ "autoincrement": false
2702
+ },
2703
+ "created_at": {
2704
+ "name": "created_at",
2705
+ "type": "text",
2706
+ "primaryKey": false,
2707
+ "notNull": true,
2708
+ "autoincrement": false
2709
+ },
2710
+ "updated_at": {
2711
+ "name": "updated_at",
2712
+ "type": "text",
2713
+ "primaryKey": false,
2714
+ "notNull": true,
2715
+ "autoincrement": false
2716
+ },
2717
+ "accepted_at": {
2718
+ "name": "accepted_at",
2719
+ "type": "text",
2720
+ "primaryKey": false,
2721
+ "notNull": false,
2722
+ "autoincrement": false
2723
+ },
2724
+ "archived_at": {
2725
+ "name": "archived_at",
2726
+ "type": "text",
2727
+ "primaryKey": false,
2728
+ "notNull": false,
2729
+ "autoincrement": false
2730
+ }
2731
+ },
2732
+ "indexes": {},
2733
+ "foreignKeys": {},
2734
+ "compositePrimaryKeys": {},
2735
+ "uniqueConstraints": {},
2736
+ "checkConstraints": {
2737
+ "projects_id_ck": {
2738
+ "name": "projects_id_ck",
2739
+ "value": "\"projects\".\"id\" GLOB 'prj_*'"
2740
+ },
2741
+ "projects_scene_ck": {
2742
+ "name": "projects_scene_ck",
2743
+ "value": "\"projects\".\"scene\" IN ('planning', 'plan_review', 'running', 'human_wait', 'limit_wait', 'failed_stop', 'analyzing_feedback', 'replanned', 'awaiting_review', 'accepted')"
2744
+ },
2745
+ "projects_stages_json_ck": {
2746
+ "name": "projects_stages_json_ck",
2747
+ "value": "json_valid(\"projects\".\"stages_json\") AND json_type(\"projects\".\"stages_json\") = 'array'"
2748
+ },
2749
+ "projects_stage_index_ck": {
2750
+ "name": "projects_stage_index_ck",
2751
+ "value": "\"projects\".\"stage_index\" >= 1"
2752
+ }
2753
+ }
2754
+ },
2755
+ "common_codes": {
2756
+ "name": "common_codes",
2757
+ "columns": {
2758
+ "code_group": {
2759
+ "name": "code_group",
2760
+ "type": "text",
2761
+ "primaryKey": false,
2762
+ "notNull": true,
2763
+ "autoincrement": false
2764
+ },
2765
+ "code": {
2766
+ "name": "code",
2767
+ "type": "text",
2768
+ "primaryKey": false,
2769
+ "notNull": true,
2770
+ "autoincrement": false
2771
+ },
2772
+ "code_name": {
2773
+ "name": "code_name",
2774
+ "type": "text",
2775
+ "primaryKey": false,
2776
+ "notNull": false,
2777
+ "autoincrement": false
2778
+ },
2779
+ "color": {
2780
+ "name": "color",
2781
+ "type": "text",
2782
+ "primaryKey": false,
2783
+ "notNull": true,
2784
+ "autoincrement": false,
2785
+ "default": "'gray'"
2786
+ },
2787
+ "sort_order": {
2788
+ "name": "sort_order",
2789
+ "type": "integer",
2790
+ "primaryKey": false,
2791
+ "notNull": true,
2792
+ "autoincrement": false
2793
+ },
2794
+ "workspace_id": {
2795
+ "name": "workspace_id",
2796
+ "type": "text",
2797
+ "primaryKey": false,
2798
+ "notNull": false,
2799
+ "autoincrement": false
2800
+ },
2801
+ "is_builtin": {
2802
+ "name": "is_builtin",
2803
+ "type": "integer",
2804
+ "primaryKey": false,
2805
+ "notNull": true,
2806
+ "autoincrement": false,
2807
+ "default": 0
2808
+ },
2809
+ "is_archived": {
2810
+ "name": "is_archived",
2811
+ "type": "integer",
2812
+ "primaryKey": false,
2813
+ "notNull": true,
2814
+ "autoincrement": false,
2815
+ "default": 0
2816
+ },
2817
+ "metadata": {
2818
+ "name": "metadata",
2819
+ "type": "text",
2820
+ "primaryKey": false,
2821
+ "notNull": false,
2822
+ "autoincrement": false
2823
+ },
2824
+ "created_at": {
2825
+ "name": "created_at",
2826
+ "type": "text",
2827
+ "primaryKey": false,
2828
+ "notNull": true,
2829
+ "autoincrement": false
2830
+ },
2831
+ "updated_at": {
2832
+ "name": "updated_at",
2833
+ "type": "text",
2834
+ "primaryKey": false,
2835
+ "notNull": true,
2836
+ "autoincrement": false
2837
+ }
2838
+ },
2839
+ "indexes": {
2840
+ "idx_common_codes_group_archived_order": {
2841
+ "name": "idx_common_codes_group_archived_order",
2842
+ "columns": [
2843
+ "code_group",
2844
+ "is_archived",
2845
+ "sort_order"
2846
+ ],
2847
+ "isUnique": false
2848
+ }
2849
+ },
2850
+ "foreignKeys": {},
2851
+ "compositePrimaryKeys": {
2852
+ "common_codes_code_group_code_pk": {
2853
+ "columns": [
2854
+ "code_group",
2855
+ "code"
2856
+ ],
2857
+ "name": "common_codes_code_group_code_pk"
2858
+ }
2859
+ },
2860
+ "uniqueConstraints": {},
2861
+ "checkConstraints": {
2862
+ "common_codes_metadata_ck": {
2863
+ "name": "common_codes_metadata_ck",
2864
+ "value": "\"common_codes\".\"metadata\" IS NULL OR (json_valid(\"common_codes\".\"metadata\") AND json_type(\"common_codes\".\"metadata\") = 'object')"
2865
+ },
2866
+ "common_codes_builtin_ck": {
2867
+ "name": "common_codes_builtin_ck",
2868
+ "value": "\"common_codes\".\"is_builtin\" IN (0, 1)"
2869
+ },
2870
+ "common_codes_archived_ck": {
2871
+ "name": "common_codes_archived_ck",
2872
+ "value": "\"common_codes\".\"is_archived\" IN (0, 1)"
2873
+ }
2874
+ }
2875
+ },
2876
+ "thread_events": {
2877
+ "name": "thread_events",
2878
+ "columns": {
2879
+ "id": {
2880
+ "name": "id",
2881
+ "type": "text",
2882
+ "primaryKey": true,
2883
+ "notNull": true,
2884
+ "autoincrement": false
2885
+ },
2886
+ "thread_id": {
2887
+ "name": "thread_id",
2888
+ "type": "text",
2889
+ "primaryKey": false,
2890
+ "notNull": true,
2891
+ "autoincrement": false
2892
+ },
2893
+ "seq": {
2894
+ "name": "seq",
2895
+ "type": "integer",
2896
+ "primaryKey": false,
2897
+ "notNull": true,
2898
+ "autoincrement": false
2899
+ },
2900
+ "type": {
2901
+ "name": "type",
2902
+ "type": "text",
2903
+ "primaryKey": false,
2904
+ "notNull": true,
2905
+ "autoincrement": false
2906
+ },
2907
+ "actor_type": {
2908
+ "name": "actor_type",
2909
+ "type": "text",
2910
+ "primaryKey": false,
2911
+ "notNull": true,
2912
+ "autoincrement": false
2913
+ },
2914
+ "payload_json": {
2915
+ "name": "payload_json",
2916
+ "type": "text",
2917
+ "primaryKey": false,
2918
+ "notNull": true,
2919
+ "autoincrement": false
2920
+ },
2921
+ "created_at": {
2922
+ "name": "created_at",
2923
+ "type": "text",
2924
+ "primaryKey": false,
2925
+ "notNull": true,
2926
+ "autoincrement": false
2927
+ },
2928
+ "actor_id": {
2929
+ "name": "actor_id",
2930
+ "type": "text",
2931
+ "primaryKey": false,
2932
+ "notNull": false,
2933
+ "autoincrement": false
2934
+ },
2935
+ "task_id": {
2936
+ "name": "task_id",
2937
+ "type": "text",
2938
+ "primaryKey": false,
2939
+ "notNull": false,
2940
+ "autoincrement": false
2941
+ },
2942
+ "highlight_id": {
2943
+ "name": "highlight_id",
2944
+ "type": "text",
2945
+ "primaryKey": false,
2946
+ "notNull": false,
2947
+ "autoincrement": false
2948
+ }
2949
+ },
2950
+ "indexes": {
2951
+ "idx_thread_events_thread_seq": {
2952
+ "name": "idx_thread_events_thread_seq",
2953
+ "columns": [
2954
+ "thread_id",
2955
+ "seq"
2956
+ ],
2957
+ "isUnique": false
2958
+ },
2959
+ "idx_thread_events_thread_created": {
2960
+ "name": "idx_thread_events_thread_created",
2961
+ "columns": [
2962
+ "thread_id",
2963
+ "created_at"
2964
+ ],
2965
+ "isUnique": false
2966
+ },
2967
+ "thread_events_thread_seq_uq": {
2968
+ "name": "thread_events_thread_seq_uq",
2969
+ "columns": [
2970
+ "thread_id",
2971
+ "seq"
2972
+ ],
2973
+ "isUnique": true
2974
+ }
2975
+ },
2976
+ "foreignKeys": {
2977
+ "thread_events_thread_id_threads_id_fk": {
2978
+ "name": "thread_events_thread_id_threads_id_fk",
2979
+ "tableFrom": "thread_events",
2980
+ "tableTo": "threads",
2981
+ "columnsFrom": [
2982
+ "thread_id"
2983
+ ],
2984
+ "columnsTo": [
2985
+ "id"
2986
+ ],
2987
+ "onDelete": "cascade",
2988
+ "onUpdate": "no action"
2989
+ }
2990
+ },
2991
+ "compositePrimaryKeys": {},
2992
+ "uniqueConstraints": {},
2993
+ "checkConstraints": {
2994
+ "thread_events_type_ck": {
2995
+ "name": "thread_events_type_ck",
2996
+ "value": "\"thread_events\".\"type\" IN ('thread.snapshot.imported', 'thread.title.changed', 'thread.priority.changed', 'thread.state.changed', 'thread.highlight.created', 'thread.highlight.updated', 'thread.highlight.deleted', 'thread.highlights.regenerated')"
2997
+ },
2998
+ "thread_events_actor_type_ck": {
2999
+ "name": "thread_events_actor_type_ck",
3000
+ "value": "\"thread_events\".\"actor_type\" IN ('user', 'agent', 'system')"
3001
+ },
3002
+ "thread_events_payload_json_ck": {
3003
+ "name": "thread_events_payload_json_ck",
3004
+ "value": "json_valid(\"thread_events\".\"payload_json\") AND json_type(\"thread_events\".\"payload_json\") = 'object'"
3005
+ }
3006
+ }
3007
+ },
3008
+ "thread_highlight_runs": {
3009
+ "name": "thread_highlight_runs",
3010
+ "columns": {
3011
+ "id": {
3012
+ "name": "id",
3013
+ "type": "text",
3014
+ "primaryKey": true,
3015
+ "notNull": true,
3016
+ "autoincrement": false
3017
+ },
3018
+ "thread_id": {
3019
+ "name": "thread_id",
3020
+ "type": "text",
3021
+ "primaryKey": false,
3022
+ "notNull": true,
3023
+ "autoincrement": false
3024
+ },
3025
+ "request_id": {
3026
+ "name": "request_id",
3027
+ "type": "text",
3028
+ "primaryKey": false,
3029
+ "notNull": true,
3030
+ "autoincrement": false
3031
+ },
3032
+ "status": {
3033
+ "name": "status",
3034
+ "type": "text",
3035
+ "primaryKey": false,
3036
+ "notNull": true,
3037
+ "autoincrement": false
3038
+ },
3039
+ "detector_version": {
3040
+ "name": "detector_version",
3041
+ "type": "text",
3042
+ "primaryKey": false,
3043
+ "notNull": true,
3044
+ "autoincrement": false
3045
+ },
3046
+ "requested_at": {
3047
+ "name": "requested_at",
3048
+ "type": "text",
3049
+ "primaryKey": false,
3050
+ "notNull": true,
3051
+ "autoincrement": false
3052
+ },
3053
+ "started_at": {
3054
+ "name": "started_at",
3055
+ "type": "text",
3056
+ "primaryKey": false,
3057
+ "notNull": false,
3058
+ "autoincrement": false
3059
+ },
3060
+ "completed_at": {
3061
+ "name": "completed_at",
3062
+ "type": "text",
3063
+ "primaryKey": false,
3064
+ "notNull": false,
3065
+ "autoincrement": false
3066
+ },
3067
+ "error_code": {
3068
+ "name": "error_code",
3069
+ "type": "text",
3070
+ "primaryKey": false,
3071
+ "notNull": false,
3072
+ "autoincrement": false
3073
+ },
3074
+ "previous_auto_count": {
3075
+ "name": "previous_auto_count",
3076
+ "type": "integer",
3077
+ "primaryKey": false,
3078
+ "notNull": false,
3079
+ "autoincrement": false
3080
+ },
3081
+ "new_auto_count": {
3082
+ "name": "new_auto_count",
3083
+ "type": "integer",
3084
+ "primaryKey": false,
3085
+ "notNull": false,
3086
+ "autoincrement": false
3087
+ }
3088
+ },
3089
+ "indexes": {
3090
+ "thread_highlight_runs_thread_request_uq": {
3091
+ "name": "thread_highlight_runs_thread_request_uq",
3092
+ "columns": [
3093
+ "thread_id",
3094
+ "request_id"
3095
+ ],
3096
+ "isUnique": true
3097
+ },
3098
+ "thread_highlight_runs_in_progress_thread_uq": {
3099
+ "name": "thread_highlight_runs_in_progress_thread_uq",
3100
+ "columns": [
3101
+ "thread_id"
3102
+ ],
3103
+ "isUnique": true,
3104
+ "where": "\"thread_highlight_runs\".\"status\" IN ('queued', 'running')"
3105
+ },
3106
+ "idx_thread_highlight_runs_thread_status_requested": {
3107
+ "name": "idx_thread_highlight_runs_thread_status_requested",
3108
+ "columns": [
3109
+ "thread_id",
3110
+ "status",
3111
+ "requested_at"
3112
+ ],
3113
+ "isUnique": false
3114
+ }
3115
+ },
3116
+ "foreignKeys": {
3117
+ "thread_highlight_runs_thread_id_threads_id_fk": {
3118
+ "name": "thread_highlight_runs_thread_id_threads_id_fk",
3119
+ "tableFrom": "thread_highlight_runs",
3120
+ "tableTo": "threads",
3121
+ "columnsFrom": [
3122
+ "thread_id"
3123
+ ],
3124
+ "columnsTo": [
3125
+ "id"
3126
+ ],
3127
+ "onDelete": "cascade",
3128
+ "onUpdate": "no action"
3129
+ }
3130
+ },
3131
+ "compositePrimaryKeys": {},
3132
+ "uniqueConstraints": {},
3133
+ "checkConstraints": {
3134
+ "thread_highlight_runs_status_ck": {
3135
+ "name": "thread_highlight_runs_status_ck",
3136
+ "value": "\"thread_highlight_runs\".\"status\" IN ('queued', 'running', 'completed', 'failed')"
3137
+ },
3138
+ "thread_highlight_runs_counts_ck": {
3139
+ "name": "thread_highlight_runs_counts_ck",
3140
+ "value": "(\"thread_highlight_runs\".\"previous_auto_count\" IS NULL OR \"thread_highlight_runs\".\"previous_auto_count\" >= 0) AND (\"thread_highlight_runs\".\"new_auto_count\" IS NULL OR \"thread_highlight_runs\".\"new_auto_count\" >= 0)"
3141
+ }
3142
+ }
3143
+ },
3144
+ "thread_highlights": {
3145
+ "name": "thread_highlights",
3146
+ "columns": {
3147
+ "id": {
3148
+ "name": "id",
3149
+ "type": "text",
3150
+ "primaryKey": true,
3151
+ "notNull": true,
3152
+ "autoincrement": false
3153
+ },
3154
+ "thread_id": {
3155
+ "name": "thread_id",
3156
+ "type": "text",
3157
+ "primaryKey": false,
3158
+ "notNull": true,
3159
+ "autoincrement": false
3160
+ },
3161
+ "source": {
3162
+ "name": "source",
3163
+ "type": "text",
3164
+ "primaryKey": false,
3165
+ "notNull": true,
3166
+ "autoincrement": false
3167
+ },
3168
+ "kind": {
3169
+ "name": "kind",
3170
+ "type": "text",
3171
+ "primaryKey": false,
3172
+ "notNull": true,
3173
+ "autoincrement": false
3174
+ },
3175
+ "status": {
3176
+ "name": "status",
3177
+ "type": "text",
3178
+ "primaryKey": false,
3179
+ "notNull": true,
3180
+ "autoincrement": false,
3181
+ "default": "'active'"
3182
+ },
3183
+ "text": {
3184
+ "name": "text",
3185
+ "type": "text",
3186
+ "primaryKey": false,
3187
+ "notNull": false,
3188
+ "autoincrement": false
3189
+ },
3190
+ "covers_from_task_id": {
3191
+ "name": "covers_from_task_id",
3192
+ "type": "text",
3193
+ "primaryKey": false,
3194
+ "notNull": true,
3195
+ "autoincrement": false
3196
+ },
3197
+ "covers_to_task_id": {
3198
+ "name": "covers_to_task_id",
3199
+ "type": "text",
3200
+ "primaryKey": false,
3201
+ "notNull": true,
3202
+ "autoincrement": false
3203
+ },
3204
+ "revision": {
3205
+ "name": "revision",
3206
+ "type": "integer",
3207
+ "primaryKey": false,
3208
+ "notNull": true,
3209
+ "autoincrement": false,
3210
+ "default": 0
3211
+ },
3212
+ "created_at": {
3213
+ "name": "created_at",
3214
+ "type": "text",
3215
+ "primaryKey": false,
3216
+ "notNull": true,
3217
+ "autoincrement": false
3218
+ },
3219
+ "updated_at": {
3220
+ "name": "updated_at",
3221
+ "type": "text",
3222
+ "primaryKey": false,
3223
+ "notNull": true,
3224
+ "autoincrement": false
3225
+ },
3226
+ "agent_id": {
3227
+ "name": "agent_id",
3228
+ "type": "text",
3229
+ "primaryKey": false,
3230
+ "notNull": false,
3231
+ "autoincrement": false
3232
+ },
3233
+ "source_task_id": {
3234
+ "name": "source_task_id",
3235
+ "type": "text",
3236
+ "primaryKey": false,
3237
+ "notNull": false,
3238
+ "autoincrement": false
3239
+ },
3240
+ "detector_version": {
3241
+ "name": "detector_version",
3242
+ "type": "text",
3243
+ "primaryKey": false,
3244
+ "notNull": false,
3245
+ "autoincrement": false
3246
+ },
3247
+ "content_fingerprint": {
3248
+ "name": "content_fingerprint",
3249
+ "type": "text",
3250
+ "primaryKey": false,
3251
+ "notNull": false,
3252
+ "autoincrement": false
3253
+ },
3254
+ "dismissed_at": {
3255
+ "name": "dismissed_at",
3256
+ "type": "text",
3257
+ "primaryKey": false,
3258
+ "notNull": false,
3259
+ "autoincrement": false
3260
+ }
3261
+ },
3262
+ "indexes": {
3263
+ "idx_thread_highlights_thread_status_created": {
3264
+ "name": "idx_thread_highlights_thread_status_created",
3265
+ "columns": [
3266
+ "thread_id",
3267
+ "status",
3268
+ "created_at"
3269
+ ],
3270
+ "isUnique": false
3271
+ },
3272
+ "idx_thread_highlights_thread_covers": {
3273
+ "name": "idx_thread_highlights_thread_covers",
3274
+ "columns": [
3275
+ "thread_id",
3276
+ "covers_from_task_id",
3277
+ "covers_to_task_id"
3278
+ ],
3279
+ "isUnique": false
3280
+ },
3281
+ "thread_highlights_auto_idempotency_uq": {
3282
+ "name": "thread_highlights_auto_idempotency_uq",
3283
+ "columns": [
3284
+ "thread_id",
3285
+ "source_task_id",
3286
+ "detector_version",
3287
+ "content_fingerprint"
3288
+ ],
3289
+ "isUnique": true,
3290
+ "where": "\"thread_highlights\".\"source\" = 'auto'"
3291
+ }
3292
+ },
3293
+ "foreignKeys": {
3294
+ "thread_highlights_thread_id_threads_id_fk": {
3295
+ "name": "thread_highlights_thread_id_threads_id_fk",
3296
+ "tableFrom": "thread_highlights",
3297
+ "tableTo": "threads",
3298
+ "columnsFrom": [
3299
+ "thread_id"
3300
+ ],
3301
+ "columnsTo": [
3302
+ "id"
3303
+ ],
3304
+ "onDelete": "cascade",
3305
+ "onUpdate": "no action"
3306
+ }
3307
+ },
3308
+ "compositePrimaryKeys": {},
3309
+ "uniqueConstraints": {},
3310
+ "checkConstraints": {
3311
+ "thread_highlights_source_ck": {
3312
+ "name": "thread_highlights_source_ck",
3313
+ "value": "\"thread_highlights\".\"source\" IN ('auto', 'manual')"
3314
+ },
3315
+ "thread_highlights_kind_ck": {
3316
+ "name": "thread_highlights_kind_ck",
3317
+ "value": "\"thread_highlights\".\"kind\" IN ('decision', 'judgment', 'issue', 'result', 'pivot')"
3318
+ },
3319
+ "thread_highlights_status_ck": {
3320
+ "name": "thread_highlights_status_ck",
3321
+ "value": "\"thread_highlights\".\"status\" IN ('active', 'dismissed')"
3322
+ },
3323
+ "thread_highlights_active_text_ck": {
3324
+ "name": "thread_highlights_active_text_ck",
3325
+ "value": "\"thread_highlights\".\"status\" = 'dismissed' OR (\"thread_highlights\".\"text\" IS NOT NULL AND length(\"thread_highlights\".\"text\") > 0)"
3326
+ },
3327
+ "thread_highlights_covers_ck": {
3328
+ "name": "thread_highlights_covers_ck",
3329
+ "value": "length(\"thread_highlights\".\"covers_from_task_id\") > 0 AND length(\"thread_highlights\".\"covers_to_task_id\") > 0"
3330
+ },
3331
+ "thread_highlights_auto_key_ck": {
3332
+ "name": "thread_highlights_auto_key_ck",
3333
+ "value": "\"thread_highlights\".\"source\" = 'manual' OR (\"thread_highlights\".\"source\" = 'auto' AND \"thread_highlights\".\"source_task_id\" IS NOT NULL AND \"thread_highlights\".\"detector_version\" IS NOT NULL AND \"thread_highlights\".\"content_fingerprint\" IS NOT NULL AND length(\"thread_highlights\".\"source_task_id\") > 0 AND length(\"thread_highlights\".\"detector_version\") > 0 AND length(\"thread_highlights\".\"content_fingerprint\") > 0)"
3334
+ }
3335
+ }
3336
+ },
3337
+ "storage_metadata": {
3338
+ "name": "storage_metadata",
3339
+ "columns": {
3340
+ "source_kind": {
3341
+ "name": "source_kind",
3342
+ "type": "text",
3343
+ "primaryKey": false,
3344
+ "notNull": true,
3345
+ "autoincrement": false
3346
+ },
3347
+ "source_id": {
3348
+ "name": "source_id",
3349
+ "type": "text",
3350
+ "primaryKey": false,
3351
+ "notNull": true,
3352
+ "autoincrement": false
3353
+ },
3354
+ "utc_ts": {
3355
+ "name": "utc_ts",
3356
+ "type": "text",
3357
+ "primaryKey": false,
3358
+ "notNull": false,
3359
+ "autoincrement": false
3360
+ },
3361
+ "bytes": {
3362
+ "name": "bytes",
3363
+ "type": "integer",
3364
+ "primaryKey": false,
3365
+ "notNull": true,
3366
+ "autoincrement": false
3367
+ }
3368
+ },
3369
+ "indexes": {
3370
+ "idx_storage_metadata_kind_ts_bytes": {
3371
+ "name": "idx_storage_metadata_kind_ts_bytes",
3372
+ "columns": [
3373
+ "source_kind",
3374
+ "utc_ts",
3375
+ "bytes"
3376
+ ],
3377
+ "isUnique": false
3378
+ }
3379
+ },
3380
+ "foreignKeys": {},
3381
+ "compositePrimaryKeys": {
3382
+ "storage_metadata_source_kind_source_id_pk": {
3383
+ "columns": [
3384
+ "source_kind",
3385
+ "source_id"
3386
+ ],
3387
+ "name": "storage_metadata_source_kind_source_id_pk"
3388
+ }
3389
+ },
3390
+ "uniqueConstraints": {},
3391
+ "checkConstraints": {}
3392
+ },
3393
+ "storage_metadata_state": {
3394
+ "name": "storage_metadata_state",
3395
+ "columns": {
3396
+ "unit": {
3397
+ "name": "unit",
3398
+ "type": "text",
3399
+ "primaryKey": true,
3400
+ "notNull": true,
3401
+ "autoincrement": false
3402
+ },
3403
+ "cursor_rowid": {
3404
+ "name": "cursor_rowid",
3405
+ "type": "integer",
3406
+ "primaryKey": false,
3407
+ "notNull": true,
3408
+ "autoincrement": false,
3409
+ "default": 0
3410
+ },
3411
+ "end_rowid": {
3412
+ "name": "end_rowid",
3413
+ "type": "integer",
3414
+ "primaryKey": false,
3415
+ "notNull": false,
3416
+ "autoincrement": false
3417
+ },
3418
+ "complete": {
3419
+ "name": "complete",
3420
+ "type": "integer",
3421
+ "primaryKey": false,
3422
+ "notNull": true,
3423
+ "autoincrement": false,
3424
+ "default": 0
3425
+ },
3426
+ "updated_at": {
3427
+ "name": "updated_at",
3428
+ "type": "text",
3429
+ "primaryKey": false,
3430
+ "notNull": true,
3431
+ "autoincrement": false
3432
+ }
3433
+ },
3434
+ "indexes": {},
3435
+ "foreignKeys": {},
3436
+ "compositePrimaryKeys": {},
3437
+ "uniqueConstraints": {},
3438
+ "checkConstraints": {}
3439
+ }
3440
+ },
3441
+ "views": {},
3442
+ "enums": {},
3443
+ "_meta": {
3444
+ "schemas": {},
3445
+ "tables": {},
3446
+ "columns": {}
3447
+ },
3448
+ "internal": {
3449
+ "indexes": {
3450
+ "idx_threads_workspace_thread_state": {
3451
+ "columns": {
3452
+ "json_extract(metadata, '$.threadTitle.state')": {
3453
+ "isExpression": true
3454
+ }
3455
+ }
3456
+ },
3457
+ "idx_threads_workspace_thread_priority": {
3458
+ "columns": {
3459
+ "json_extract(metadata, '$.threadTitle.priority')": {
3460
+ "isExpression": true
3461
+ }
3462
+ }
3463
+ },
3464
+ "idx_notifications_ws_created": {
3465
+ "columns": {
3466
+ "\"created_at\" DESC": {
3467
+ "isExpression": true
3468
+ }
3469
+ }
3470
+ }
3471
+ }
3472
+ }
3473
+ }