@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,3547 @@
1
+ {
2
+ "version": "6",
3
+ "dialect": "sqlite",
4
+ "id": "f7a2e51c-bab5-4ea7-9bc7-94405e6e4ff2",
5
+ "prevId": "4c430364-1d58-4d85-adf3-0cb90dc95cef",
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
+ "request_log_daily": {
1364
+ "name": "request_log_daily",
1365
+ "columns": {
1366
+ "day": {
1367
+ "name": "day",
1368
+ "type": "text",
1369
+ "primaryKey": false,
1370
+ "notNull": true,
1371
+ "autoincrement": false
1372
+ },
1373
+ "scope": {
1374
+ "name": "scope",
1375
+ "type": "text",
1376
+ "primaryKey": false,
1377
+ "notNull": true,
1378
+ "autoincrement": false
1379
+ },
1380
+ "ok": {
1381
+ "name": "ok",
1382
+ "type": "integer",
1383
+ "primaryKey": false,
1384
+ "notNull": true,
1385
+ "autoincrement": false
1386
+ },
1387
+ "client": {
1388
+ "name": "client",
1389
+ "type": "integer",
1390
+ "primaryKey": false,
1391
+ "notNull": true,
1392
+ "autoincrement": false
1393
+ },
1394
+ "server": {
1395
+ "name": "server",
1396
+ "type": "integer",
1397
+ "primaryKey": false,
1398
+ "notNull": true,
1399
+ "autoincrement": false
1400
+ },
1401
+ "p50_ms": {
1402
+ "name": "p50_ms",
1403
+ "type": "integer",
1404
+ "primaryKey": false,
1405
+ "notNull": false,
1406
+ "autoincrement": false
1407
+ },
1408
+ "p95_ms": {
1409
+ "name": "p95_ms",
1410
+ "type": "integer",
1411
+ "primaryKey": false,
1412
+ "notNull": false,
1413
+ "autoincrement": false
1414
+ },
1415
+ "computed_at": {
1416
+ "name": "computed_at",
1417
+ "type": "text",
1418
+ "primaryKey": false,
1419
+ "notNull": true,
1420
+ "autoincrement": false
1421
+ }
1422
+ },
1423
+ "indexes": {},
1424
+ "foreignKeys": {},
1425
+ "compositePrimaryKeys": {
1426
+ "request_log_daily_day_scope_pk": {
1427
+ "columns": [
1428
+ "day",
1429
+ "scope"
1430
+ ],
1431
+ "name": "request_log_daily_day_scope_pk"
1432
+ }
1433
+ },
1434
+ "uniqueConstraints": {},
1435
+ "checkConstraints": {}
1436
+ },
1437
+ "usage_limit_snapshots": {
1438
+ "name": "usage_limit_snapshots",
1439
+ "columns": {
1440
+ "id": {
1441
+ "name": "id",
1442
+ "type": "text",
1443
+ "primaryKey": true,
1444
+ "notNull": true,
1445
+ "autoincrement": false
1446
+ },
1447
+ "provider": {
1448
+ "name": "provider",
1449
+ "type": "text",
1450
+ "primaryKey": false,
1451
+ "notNull": true,
1452
+ "autoincrement": false
1453
+ },
1454
+ "account_ref": {
1455
+ "name": "account_ref",
1456
+ "type": "text",
1457
+ "primaryKey": false,
1458
+ "notNull": true,
1459
+ "autoincrement": false,
1460
+ "default": "'default'"
1461
+ },
1462
+ "limit_window": {
1463
+ "name": "limit_window",
1464
+ "type": "text",
1465
+ "primaryKey": false,
1466
+ "notNull": true,
1467
+ "autoincrement": false
1468
+ },
1469
+ "bucket_start": {
1470
+ "name": "bucket_start",
1471
+ "type": "text",
1472
+ "primaryKey": false,
1473
+ "notNull": true,
1474
+ "autoincrement": false
1475
+ },
1476
+ "captured_at": {
1477
+ "name": "captured_at",
1478
+ "type": "text",
1479
+ "primaryKey": false,
1480
+ "notNull": true,
1481
+ "autoincrement": false
1482
+ },
1483
+ "used_percent": {
1484
+ "name": "used_percent",
1485
+ "type": "integer",
1486
+ "primaryKey": false,
1487
+ "notNull": true,
1488
+ "autoincrement": false
1489
+ },
1490
+ "remaining_percent": {
1491
+ "name": "remaining_percent",
1492
+ "type": "integer",
1493
+ "primaryKey": false,
1494
+ "notNull": true,
1495
+ "autoincrement": false
1496
+ },
1497
+ "resets_at": {
1498
+ "name": "resets_at",
1499
+ "type": "text",
1500
+ "primaryKey": false,
1501
+ "notNull": false,
1502
+ "autoincrement": false
1503
+ },
1504
+ "source": {
1505
+ "name": "source",
1506
+ "type": "text",
1507
+ "primaryKey": false,
1508
+ "notNull": true,
1509
+ "autoincrement": false
1510
+ },
1511
+ "metadata": {
1512
+ "name": "metadata",
1513
+ "type": "text",
1514
+ "primaryKey": false,
1515
+ "notNull": false,
1516
+ "autoincrement": false
1517
+ }
1518
+ },
1519
+ "indexes": {
1520
+ "uniq_usage_limit_snapshots_bucket": {
1521
+ "name": "uniq_usage_limit_snapshots_bucket",
1522
+ "columns": [
1523
+ "provider",
1524
+ "account_ref",
1525
+ "limit_window",
1526
+ "bucket_start"
1527
+ ],
1528
+ "isUnique": true
1529
+ },
1530
+ "idx_usage_limit_snapshots_window_bucket": {
1531
+ "name": "idx_usage_limit_snapshots_window_bucket",
1532
+ "columns": [
1533
+ "limit_window",
1534
+ "bucket_start"
1535
+ ],
1536
+ "isUnique": false
1537
+ },
1538
+ "idx_usage_limit_snapshots_provider_window_bucket": {
1539
+ "name": "idx_usage_limit_snapshots_provider_window_bucket",
1540
+ "columns": [
1541
+ "provider",
1542
+ "limit_window",
1543
+ "bucket_start"
1544
+ ],
1545
+ "isUnique": false
1546
+ }
1547
+ },
1548
+ "foreignKeys": {},
1549
+ "compositePrimaryKeys": {},
1550
+ "uniqueConstraints": {},
1551
+ "checkConstraints": {}
1552
+ },
1553
+ "usage_reports": {
1554
+ "name": "usage_reports",
1555
+ "columns": {
1556
+ "id": {
1557
+ "name": "id",
1558
+ "type": "text",
1559
+ "primaryKey": true,
1560
+ "notNull": true,
1561
+ "autoincrement": false
1562
+ },
1563
+ "workspace_id": {
1564
+ "name": "workspace_id",
1565
+ "type": "text",
1566
+ "primaryKey": false,
1567
+ "notNull": true,
1568
+ "autoincrement": false
1569
+ },
1570
+ "month": {
1571
+ "name": "month",
1572
+ "type": "text",
1573
+ "primaryKey": false,
1574
+ "notNull": true,
1575
+ "autoincrement": false
1576
+ },
1577
+ "generated_at": {
1578
+ "name": "generated_at",
1579
+ "type": "text",
1580
+ "primaryKey": false,
1581
+ "notNull": true,
1582
+ "autoincrement": false
1583
+ },
1584
+ "source_range": {
1585
+ "name": "source_range",
1586
+ "type": "text",
1587
+ "primaryKey": false,
1588
+ "notNull": true,
1589
+ "autoincrement": false
1590
+ },
1591
+ "tier": {
1592
+ "name": "tier",
1593
+ "type": "text",
1594
+ "primaryKey": false,
1595
+ "notNull": true,
1596
+ "autoincrement": false
1597
+ },
1598
+ "total_tokens": {
1599
+ "name": "total_tokens",
1600
+ "type": "integer",
1601
+ "primaryKey": false,
1602
+ "notNull": true,
1603
+ "autoincrement": false
1604
+ },
1605
+ "total_cost_usd": {
1606
+ "name": "total_cost_usd",
1607
+ "type": "real",
1608
+ "primaryKey": false,
1609
+ "notNull": true,
1610
+ "autoincrement": false
1611
+ },
1612
+ "payload": {
1613
+ "name": "payload",
1614
+ "type": "text",
1615
+ "primaryKey": false,
1616
+ "notNull": true,
1617
+ "autoincrement": false
1618
+ },
1619
+ "payload_hash": {
1620
+ "name": "payload_hash",
1621
+ "type": "text",
1622
+ "primaryKey": false,
1623
+ "notNull": false,
1624
+ "autoincrement": false
1625
+ },
1626
+ "signature": {
1627
+ "name": "signature",
1628
+ "type": "text",
1629
+ "primaryKey": false,
1630
+ "notNull": false,
1631
+ "autoincrement": false
1632
+ },
1633
+ "signed_at": {
1634
+ "name": "signed_at",
1635
+ "type": "text",
1636
+ "primaryKey": false,
1637
+ "notNull": false,
1638
+ "autoincrement": false
1639
+ },
1640
+ "issuer": {
1641
+ "name": "issuer",
1642
+ "type": "text",
1643
+ "primaryKey": false,
1644
+ "notNull": false,
1645
+ "autoincrement": false
1646
+ }
1647
+ },
1648
+ "indexes": {
1649
+ "uniq_usage_reports_ws_month": {
1650
+ "name": "uniq_usage_reports_ws_month",
1651
+ "columns": [
1652
+ "workspace_id",
1653
+ "month"
1654
+ ],
1655
+ "isUnique": true
1656
+ }
1657
+ },
1658
+ "foreignKeys": {},
1659
+ "compositePrimaryKeys": {},
1660
+ "uniqueConstraints": {},
1661
+ "checkConstraints": {}
1662
+ },
1663
+ "notification_reads": {
1664
+ "name": "notification_reads",
1665
+ "columns": {
1666
+ "notification_id": {
1667
+ "name": "notification_id",
1668
+ "type": "text",
1669
+ "primaryKey": false,
1670
+ "notNull": true,
1671
+ "autoincrement": false
1672
+ },
1673
+ "user_id": {
1674
+ "name": "user_id",
1675
+ "type": "text",
1676
+ "primaryKey": false,
1677
+ "notNull": true,
1678
+ "autoincrement": false
1679
+ },
1680
+ "read_at": {
1681
+ "name": "read_at",
1682
+ "type": "text",
1683
+ "primaryKey": false,
1684
+ "notNull": true,
1685
+ "autoincrement": false
1686
+ }
1687
+ },
1688
+ "indexes": {},
1689
+ "foreignKeys": {},
1690
+ "compositePrimaryKeys": {
1691
+ "notification_reads_notification_id_user_id_pk": {
1692
+ "columns": [
1693
+ "notification_id",
1694
+ "user_id"
1695
+ ],
1696
+ "name": "notification_reads_notification_id_user_id_pk"
1697
+ }
1698
+ },
1699
+ "uniqueConstraints": {},
1700
+ "checkConstraints": {}
1701
+ },
1702
+ "notifications": {
1703
+ "name": "notifications",
1704
+ "columns": {
1705
+ "id": {
1706
+ "name": "id",
1707
+ "type": "text",
1708
+ "primaryKey": true,
1709
+ "notNull": true,
1710
+ "autoincrement": false
1711
+ },
1712
+ "workspace_id": {
1713
+ "name": "workspace_id",
1714
+ "type": "text",
1715
+ "primaryKey": false,
1716
+ "notNull": true,
1717
+ "autoincrement": false
1718
+ },
1719
+ "agent_id": {
1720
+ "name": "agent_id",
1721
+ "type": "text",
1722
+ "primaryKey": false,
1723
+ "notNull": false,
1724
+ "autoincrement": false
1725
+ },
1726
+ "task_id": {
1727
+ "name": "task_id",
1728
+ "type": "text",
1729
+ "primaryKey": false,
1730
+ "notNull": false,
1731
+ "autoincrement": false
1732
+ },
1733
+ "thread_id": {
1734
+ "name": "thread_id",
1735
+ "type": "text",
1736
+ "primaryKey": false,
1737
+ "notNull": false,
1738
+ "autoincrement": false
1739
+ },
1740
+ "source": {
1741
+ "name": "source",
1742
+ "type": "text",
1743
+ "primaryKey": false,
1744
+ "notNull": true,
1745
+ "autoincrement": false,
1746
+ "default": "'agent'"
1747
+ },
1748
+ "level": {
1749
+ "name": "level",
1750
+ "type": "text",
1751
+ "primaryKey": false,
1752
+ "notNull": true,
1753
+ "autoincrement": false,
1754
+ "default": "'info'"
1755
+ },
1756
+ "title": {
1757
+ "name": "title",
1758
+ "type": "text",
1759
+ "primaryKey": false,
1760
+ "notNull": true,
1761
+ "autoincrement": false
1762
+ },
1763
+ "body": {
1764
+ "name": "body",
1765
+ "type": "text",
1766
+ "primaryKey": false,
1767
+ "notNull": false,
1768
+ "autoincrement": false
1769
+ },
1770
+ "target_user_id": {
1771
+ "name": "target_user_id",
1772
+ "type": "text",
1773
+ "primaryKey": false,
1774
+ "notNull": false,
1775
+ "autoincrement": false
1776
+ },
1777
+ "created_at": {
1778
+ "name": "created_at",
1779
+ "type": "text",
1780
+ "primaryKey": false,
1781
+ "notNull": true,
1782
+ "autoincrement": false
1783
+ },
1784
+ "metadata": {
1785
+ "name": "metadata",
1786
+ "type": "text",
1787
+ "primaryKey": false,
1788
+ "notNull": false,
1789
+ "autoincrement": false
1790
+ }
1791
+ },
1792
+ "indexes": {
1793
+ "idx_notifications_ws_created": {
1794
+ "name": "idx_notifications_ws_created",
1795
+ "columns": [
1796
+ "workspace_id",
1797
+ "\"created_at\" DESC"
1798
+ ],
1799
+ "isUnique": false
1800
+ }
1801
+ },
1802
+ "foreignKeys": {},
1803
+ "compositePrimaryKeys": {},
1804
+ "uniqueConstraints": {},
1805
+ "checkConstraints": {}
1806
+ },
1807
+ "agent_suggestions": {
1808
+ "name": "agent_suggestions",
1809
+ "columns": {
1810
+ "id": {
1811
+ "name": "id",
1812
+ "type": "text",
1813
+ "primaryKey": true,
1814
+ "notNull": true,
1815
+ "autoincrement": false
1816
+ },
1817
+ "workspace_id": {
1818
+ "name": "workspace_id",
1819
+ "type": "text",
1820
+ "primaryKey": false,
1821
+ "notNull": true,
1822
+ "autoincrement": false
1823
+ },
1824
+ "agent_id": {
1825
+ "name": "agent_id",
1826
+ "type": "text",
1827
+ "primaryKey": false,
1828
+ "notNull": true,
1829
+ "autoincrement": false
1830
+ },
1831
+ "task_id": {
1832
+ "name": "task_id",
1833
+ "type": "text",
1834
+ "primaryKey": false,
1835
+ "notNull": false,
1836
+ "autoincrement": false
1837
+ },
1838
+ "type": {
1839
+ "name": "type",
1840
+ "type": "text",
1841
+ "primaryKey": false,
1842
+ "notNull": true,
1843
+ "autoincrement": false
1844
+ },
1845
+ "status": {
1846
+ "name": "status",
1847
+ "type": "text",
1848
+ "primaryKey": false,
1849
+ "notNull": true,
1850
+ "autoincrement": false,
1851
+ "default": "'pending'"
1852
+ },
1853
+ "payload": {
1854
+ "name": "payload",
1855
+ "type": "text",
1856
+ "primaryKey": false,
1857
+ "notNull": true,
1858
+ "autoincrement": false
1859
+ },
1860
+ "applied_commit_sha": {
1861
+ "name": "applied_commit_sha",
1862
+ "type": "text",
1863
+ "primaryKey": false,
1864
+ "notNull": false,
1865
+ "autoincrement": false
1866
+ },
1867
+ "created_at": {
1868
+ "name": "created_at",
1869
+ "type": "text",
1870
+ "primaryKey": false,
1871
+ "notNull": true,
1872
+ "autoincrement": false
1873
+ },
1874
+ "updated_at": {
1875
+ "name": "updated_at",
1876
+ "type": "text",
1877
+ "primaryKey": false,
1878
+ "notNull": true,
1879
+ "autoincrement": false
1880
+ }
1881
+ },
1882
+ "indexes": {
1883
+ "idx_agent_suggestions_ws_agent": {
1884
+ "name": "idx_agent_suggestions_ws_agent",
1885
+ "columns": [
1886
+ "workspace_id",
1887
+ "agent_id"
1888
+ ],
1889
+ "isUnique": false
1890
+ },
1891
+ "idx_agent_suggestions_ws_created": {
1892
+ "name": "idx_agent_suggestions_ws_created",
1893
+ "columns": [
1894
+ "workspace_id",
1895
+ "created_at"
1896
+ ],
1897
+ "isUnique": false
1898
+ }
1899
+ },
1900
+ "foreignKeys": {},
1901
+ "compositePrimaryKeys": {},
1902
+ "uniqueConstraints": {},
1903
+ "checkConstraints": {}
1904
+ },
1905
+ "ui_instances": {
1906
+ "name": "ui_instances",
1907
+ "columns": {
1908
+ "id": {
1909
+ "name": "id",
1910
+ "type": "text",
1911
+ "primaryKey": true,
1912
+ "notNull": true,
1913
+ "autoincrement": false
1914
+ },
1915
+ "definition_id": {
1916
+ "name": "definition_id",
1917
+ "type": "text",
1918
+ "primaryKey": false,
1919
+ "notNull": true,
1920
+ "autoincrement": false
1921
+ },
1922
+ "definition_version": {
1923
+ "name": "definition_version",
1924
+ "type": "integer",
1925
+ "primaryKey": false,
1926
+ "notNull": true,
1927
+ "autoincrement": false
1928
+ },
1929
+ "definition_hash": {
1930
+ "name": "definition_hash",
1931
+ "type": "text",
1932
+ "primaryKey": false,
1933
+ "notNull": true,
1934
+ "autoincrement": false
1935
+ },
1936
+ "workspace_id": {
1937
+ "name": "workspace_id",
1938
+ "type": "text",
1939
+ "primaryKey": false,
1940
+ "notNull": true,
1941
+ "autoincrement": false
1942
+ },
1943
+ "thread_id": {
1944
+ "name": "thread_id",
1945
+ "type": "text",
1946
+ "primaryKey": false,
1947
+ "notNull": true,
1948
+ "autoincrement": false
1949
+ },
1950
+ "app_id": {
1951
+ "name": "app_id",
1952
+ "type": "text",
1953
+ "primaryKey": false,
1954
+ "notNull": false,
1955
+ "autoincrement": false
1956
+ },
1957
+ "anchor_task_id": {
1958
+ "name": "anchor_task_id",
1959
+ "type": "text",
1960
+ "primaryKey": false,
1961
+ "notNull": false,
1962
+ "autoincrement": false
1963
+ },
1964
+ "domain_ref_json": {
1965
+ "name": "domain_ref_json",
1966
+ "type": "text",
1967
+ "primaryKey": false,
1968
+ "notNull": true,
1969
+ "autoincrement": false
1970
+ },
1971
+ "state_json": {
1972
+ "name": "state_json",
1973
+ "type": "text",
1974
+ "primaryKey": false,
1975
+ "notNull": true,
1976
+ "autoincrement": false
1977
+ },
1978
+ "revision": {
1979
+ "name": "revision",
1980
+ "type": "integer",
1981
+ "primaryKey": false,
1982
+ "notNull": true,
1983
+ "autoincrement": false,
1984
+ "default": 0
1985
+ },
1986
+ "status": {
1987
+ "name": "status",
1988
+ "type": "text",
1989
+ "primaryKey": false,
1990
+ "notNull": true,
1991
+ "autoincrement": false,
1992
+ "default": "'active'"
1993
+ },
1994
+ "granted_capabilities_json": {
1995
+ "name": "granted_capabilities_json",
1996
+ "type": "text",
1997
+ "primaryKey": false,
1998
+ "notNull": true,
1999
+ "autoincrement": false,
2000
+ "default": "'[]'"
2001
+ },
2002
+ "opened_by_json": {
2003
+ "name": "opened_by_json",
2004
+ "type": "text",
2005
+ "primaryKey": false,
2006
+ "notNull": false,
2007
+ "autoincrement": false
2008
+ },
2009
+ "created_at": {
2010
+ "name": "created_at",
2011
+ "type": "integer",
2012
+ "primaryKey": false,
2013
+ "notNull": true,
2014
+ "autoincrement": false
2015
+ },
2016
+ "updated_at": {
2017
+ "name": "updated_at",
2018
+ "type": "integer",
2019
+ "primaryKey": false,
2020
+ "notNull": true,
2021
+ "autoincrement": false
2022
+ }
2023
+ },
2024
+ "indexes": {
2025
+ "ui_instances_workspace_thread_idx": {
2026
+ "name": "ui_instances_workspace_thread_idx",
2027
+ "columns": [
2028
+ "workspace_id",
2029
+ "thread_id"
2030
+ ],
2031
+ "isUnique": false
2032
+ },
2033
+ "ui_instances_workspace_thread_app_uq": {
2034
+ "name": "ui_instances_workspace_thread_app_uq",
2035
+ "columns": [
2036
+ "workspace_id",
2037
+ "thread_id",
2038
+ "app_id"
2039
+ ],
2040
+ "isUnique": true,
2041
+ "where": "\"ui_instances\".\"status\" = 'active'"
2042
+ }
2043
+ },
2044
+ "foreignKeys": {},
2045
+ "compositePrimaryKeys": {},
2046
+ "uniqueConstraints": {},
2047
+ "checkConstraints": {
2048
+ "ui_instances_id_ck": {
2049
+ "name": "ui_instances_id_ck",
2050
+ "value": "length(\"ui_instances\".\"id\") BETWEEN 5 AND 128 AND \"ui_instances\".\"id\" GLOB 'uic_*'"
2051
+ },
2052
+ "ui_instances_definition_id_ck": {
2053
+ "name": "ui_instances_definition_id_ck",
2054
+ "value": "length(\"ui_instances\".\"definition_id\") BETWEEN 1 AND 128"
2055
+ },
2056
+ "ui_instances_definition_version_ck": {
2057
+ "name": "ui_instances_definition_version_ck",
2058
+ "value": "\"ui_instances\".\"definition_version\" >= 1"
2059
+ },
2060
+ "ui_instances_definition_hash_ck": {
2061
+ "name": "ui_instances_definition_hash_ck",
2062
+ "value": "length(\"ui_instances\".\"definition_hash\") = 64 AND \"ui_instances\".\"definition_hash\" NOT GLOB '*[^0-9a-f]*'"
2063
+ },
2064
+ "ui_instances_workspace_id_ck": {
2065
+ "name": "ui_instances_workspace_id_ck",
2066
+ "value": "length(\"ui_instances\".\"workspace_id\") BETWEEN 1 AND 256"
2067
+ },
2068
+ "ui_instances_thread_id_ck": {
2069
+ "name": "ui_instances_thread_id_ck",
2070
+ "value": "length(\"ui_instances\".\"thread_id\") BETWEEN 1 AND 256"
2071
+ },
2072
+ "ui_instances_app_id_ck": {
2073
+ "name": "ui_instances_app_id_ck",
2074
+ "value": "\"ui_instances\".\"app_id\" IS NULL OR length(\"ui_instances\".\"app_id\") BETWEEN 1 AND 128"
2075
+ },
2076
+ "ui_instances_domain_ref_json_ck": {
2077
+ "name": "ui_instances_domain_ref_json_ck",
2078
+ "value": "json_valid(\"ui_instances\".\"domain_ref_json\") AND json_type(\"ui_instances\".\"domain_ref_json\") = 'object'"
2079
+ },
2080
+ "ui_instances_state_json_ck": {
2081
+ "name": "ui_instances_state_json_ck",
2082
+ "value": "json_valid(\"ui_instances\".\"state_json\") AND json_type(\"ui_instances\".\"state_json\") = 'object'"
2083
+ },
2084
+ "ui_instances_revision_ck": {
2085
+ "name": "ui_instances_revision_ck",
2086
+ "value": "\"ui_instances\".\"revision\" >= 0"
2087
+ },
2088
+ "ui_instances_status_ck": {
2089
+ "name": "ui_instances_status_ck",
2090
+ "value": "\"ui_instances\".\"status\" IN ('active', 'completed', 'expired', 'revoked', 'unsupported')"
2091
+ },
2092
+ "ui_instances_granted_capabilities_json_ck": {
2093
+ "name": "ui_instances_granted_capabilities_json_ck",
2094
+ "value": "json_valid(\"ui_instances\".\"granted_capabilities_json\") AND json_type(\"ui_instances\".\"granted_capabilities_json\") = 'array'"
2095
+ },
2096
+ "ui_instances_opened_by_json_ck": {
2097
+ "name": "ui_instances_opened_by_json_ck",
2098
+ "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')"
2099
+ },
2100
+ "ui_instances_created_at_ck": {
2101
+ "name": "ui_instances_created_at_ck",
2102
+ "value": "\"ui_instances\".\"created_at\" >= 0"
2103
+ },
2104
+ "ui_instances_updated_at_ck": {
2105
+ "name": "ui_instances_updated_at_ck",
2106
+ "value": "\"ui_instances\".\"updated_at\" >= \"ui_instances\".\"created_at\""
2107
+ }
2108
+ }
2109
+ },
2110
+ "ui_action_receipts": {
2111
+ "name": "ui_action_receipts",
2112
+ "columns": {
2113
+ "id": {
2114
+ "name": "id",
2115
+ "type": "text",
2116
+ "primaryKey": true,
2117
+ "notNull": true,
2118
+ "autoincrement": false
2119
+ },
2120
+ "instance_id": {
2121
+ "name": "instance_id",
2122
+ "type": "text",
2123
+ "primaryKey": false,
2124
+ "notNull": true,
2125
+ "autoincrement": false
2126
+ },
2127
+ "definition_id": {
2128
+ "name": "definition_id",
2129
+ "type": "text",
2130
+ "primaryKey": false,
2131
+ "notNull": false,
2132
+ "autoincrement": false
2133
+ },
2134
+ "definition_version": {
2135
+ "name": "definition_version",
2136
+ "type": "integer",
2137
+ "primaryKey": false,
2138
+ "notNull": false,
2139
+ "autoincrement": false
2140
+ },
2141
+ "definition_hash": {
2142
+ "name": "definition_hash",
2143
+ "type": "text",
2144
+ "primaryKey": false,
2145
+ "notNull": false,
2146
+ "autoincrement": false
2147
+ },
2148
+ "request_id": {
2149
+ "name": "request_id",
2150
+ "type": "text",
2151
+ "primaryKey": false,
2152
+ "notNull": true,
2153
+ "autoincrement": false
2154
+ },
2155
+ "action_id": {
2156
+ "name": "action_id",
2157
+ "type": "text",
2158
+ "primaryKey": false,
2159
+ "notNull": true,
2160
+ "autoincrement": false
2161
+ },
2162
+ "actor_json": {
2163
+ "name": "actor_json",
2164
+ "type": "text",
2165
+ "primaryKey": false,
2166
+ "notNull": true,
2167
+ "autoincrement": false
2168
+ },
2169
+ "source": {
2170
+ "name": "source",
2171
+ "type": "text",
2172
+ "primaryKey": false,
2173
+ "notNull": true,
2174
+ "autoincrement": false
2175
+ },
2176
+ "expected_revision": {
2177
+ "name": "expected_revision",
2178
+ "type": "integer",
2179
+ "primaryKey": false,
2180
+ "notNull": true,
2181
+ "autoincrement": false
2182
+ },
2183
+ "before_revision": {
2184
+ "name": "before_revision",
2185
+ "type": "integer",
2186
+ "primaryKey": false,
2187
+ "notNull": true,
2188
+ "autoincrement": false
2189
+ },
2190
+ "after_revision": {
2191
+ "name": "after_revision",
2192
+ "type": "integer",
2193
+ "primaryKey": false,
2194
+ "notNull": false,
2195
+ "autoincrement": false
2196
+ },
2197
+ "status": {
2198
+ "name": "status",
2199
+ "type": "text",
2200
+ "primaryKey": false,
2201
+ "notNull": true,
2202
+ "autoincrement": false
2203
+ },
2204
+ "outcome": {
2205
+ "name": "outcome",
2206
+ "type": "text",
2207
+ "primaryKey": false,
2208
+ "notNull": false,
2209
+ "autoincrement": false
2210
+ },
2211
+ "input_json": {
2212
+ "name": "input_json",
2213
+ "type": "text",
2214
+ "primaryKey": false,
2215
+ "notNull": true,
2216
+ "autoincrement": false
2217
+ },
2218
+ "result_json": {
2219
+ "name": "result_json",
2220
+ "type": "text",
2221
+ "primaryKey": false,
2222
+ "notNull": false,
2223
+ "autoincrement": false
2224
+ },
2225
+ "error_code": {
2226
+ "name": "error_code",
2227
+ "type": "text",
2228
+ "primaryKey": false,
2229
+ "notNull": false,
2230
+ "autoincrement": false
2231
+ },
2232
+ "requested_at": {
2233
+ "name": "requested_at",
2234
+ "type": "integer",
2235
+ "primaryKey": false,
2236
+ "notNull": true,
2237
+ "autoincrement": false
2238
+ },
2239
+ "settled_at": {
2240
+ "name": "settled_at",
2241
+ "type": "integer",
2242
+ "primaryKey": false,
2243
+ "notNull": false,
2244
+ "autoincrement": false
2245
+ }
2246
+ },
2247
+ "indexes": {
2248
+ "ui_action_receipts_instance_request_uq": {
2249
+ "name": "ui_action_receipts_instance_request_uq",
2250
+ "columns": [
2251
+ "instance_id",
2252
+ "request_id"
2253
+ ],
2254
+ "isUnique": true
2255
+ },
2256
+ "ui_action_receipts_instance_id_idx": {
2257
+ "name": "ui_action_receipts_instance_id_idx",
2258
+ "columns": [
2259
+ "instance_id"
2260
+ ],
2261
+ "isUnique": false
2262
+ },
2263
+ "ui_action_receipts_requested_at_idx": {
2264
+ "name": "ui_action_receipts_requested_at_idx",
2265
+ "columns": [
2266
+ "requested_at"
2267
+ ],
2268
+ "isUnique": false
2269
+ }
2270
+ },
2271
+ "foreignKeys": {},
2272
+ "compositePrimaryKeys": {},
2273
+ "uniqueConstraints": {},
2274
+ "checkConstraints": {
2275
+ "ui_action_receipts_id_ck": {
2276
+ "name": "ui_action_receipts_id_ck",
2277
+ "value": "length(\"ui_action_receipts\".\"id\") BETWEEN 5 AND 128"
2278
+ },
2279
+ "ui_action_receipts_instance_id_ck": {
2280
+ "name": "ui_action_receipts_instance_id_ck",
2281
+ "value": "length(\"ui_action_receipts\".\"instance_id\") BETWEEN 1 AND 128"
2282
+ },
2283
+ "ui_action_receipts_request_id_ck": {
2284
+ "name": "ui_action_receipts_request_id_ck",
2285
+ "value": "length(\"ui_action_receipts\".\"request_id\") BETWEEN 1 AND 128"
2286
+ },
2287
+ "ui_action_receipts_action_id_ck": {
2288
+ "name": "ui_action_receipts_action_id_ck",
2289
+ "value": "length(\"ui_action_receipts\".\"action_id\") BETWEEN 1 AND 128"
2290
+ },
2291
+ "ui_action_receipts_actor_json_ck": {
2292
+ "name": "ui_action_receipts_actor_json_ck",
2293
+ "value": "json_valid(\"ui_action_receipts\".\"actor_json\") AND json_type(\"ui_action_receipts\".\"actor_json\") = 'object'"
2294
+ },
2295
+ "ui_action_receipts_source_ck": {
2296
+ "name": "ui_action_receipts_source_ck",
2297
+ "value": "\"ui_action_receipts\".\"source\" IN ('ui_host', 'cli', 'system', 'mcp')"
2298
+ },
2299
+ "ui_action_receipts_expected_revision_ck": {
2300
+ "name": "ui_action_receipts_expected_revision_ck",
2301
+ "value": "\"ui_action_receipts\".\"expected_revision\" >= 0"
2302
+ },
2303
+ "ui_action_receipts_before_revision_ck": {
2304
+ "name": "ui_action_receipts_before_revision_ck",
2305
+ "value": "\"ui_action_receipts\".\"before_revision\" >= 0"
2306
+ },
2307
+ "ui_action_receipts_after_revision_ck": {
2308
+ "name": "ui_action_receipts_after_revision_ck",
2309
+ "value": "\"ui_action_receipts\".\"after_revision\" IS NULL OR \"ui_action_receipts\".\"after_revision\" >= 0"
2310
+ },
2311
+ "ui_action_receipts_status_ck": {
2312
+ "name": "ui_action_receipts_status_ck",
2313
+ "value": "\"ui_action_receipts\".\"status\" IN ('requested', 'settled')"
2314
+ },
2315
+ "ui_action_receipts_outcome_ck": {
2316
+ "name": "ui_action_receipts_outcome_ck",
2317
+ "value": "\"ui_action_receipts\".\"outcome\" IS NULL OR \"ui_action_receipts\".\"outcome\" IN ('succeeded', 'rejected', 'failed', 'conflicted', 'expired')"
2318
+ },
2319
+ "ui_action_receipts_input_json_ck": {
2320
+ "name": "ui_action_receipts_input_json_ck",
2321
+ "value": "json_valid(\"ui_action_receipts\".\"input_json\") AND json_type(\"ui_action_receipts\".\"input_json\") = 'object'"
2322
+ },
2323
+ "ui_action_receipts_result_json_ck": {
2324
+ "name": "ui_action_receipts_result_json_ck",
2325
+ "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')"
2326
+ },
2327
+ "ui_action_receipts_requested_at_ck": {
2328
+ "name": "ui_action_receipts_requested_at_ck",
2329
+ "value": "\"ui_action_receipts\".\"requested_at\" >= 0"
2330
+ },
2331
+ "ui_action_receipts_settled_at_ck": {
2332
+ "name": "ui_action_receipts_settled_at_ck",
2333
+ "value": "\"ui_action_receipts\".\"settled_at\" IS NULL OR \"ui_action_receipts\".\"settled_at\" >= \"ui_action_receipts\".\"requested_at\""
2334
+ },
2335
+ "ui_action_receipts_status_transition_ck": {
2336
+ "name": "ui_action_receipts_status_transition_ck",
2337
+ "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 )"
2338
+ }
2339
+ }
2340
+ },
2341
+ "ui_instance_repins": {
2342
+ "name": "ui_instance_repins",
2343
+ "columns": {
2344
+ "instance_id": {
2345
+ "name": "instance_id",
2346
+ "type": "text",
2347
+ "primaryKey": false,
2348
+ "notNull": true,
2349
+ "autoincrement": false
2350
+ },
2351
+ "from_version": {
2352
+ "name": "from_version",
2353
+ "type": "integer",
2354
+ "primaryKey": false,
2355
+ "notNull": true,
2356
+ "autoincrement": false
2357
+ },
2358
+ "from_hash": {
2359
+ "name": "from_hash",
2360
+ "type": "text",
2361
+ "primaryKey": false,
2362
+ "notNull": true,
2363
+ "autoincrement": false
2364
+ },
2365
+ "to_version": {
2366
+ "name": "to_version",
2367
+ "type": "integer",
2368
+ "primaryKey": false,
2369
+ "notNull": true,
2370
+ "autoincrement": false
2371
+ },
2372
+ "to_hash": {
2373
+ "name": "to_hash",
2374
+ "type": "text",
2375
+ "primaryKey": false,
2376
+ "notNull": true,
2377
+ "autoincrement": false
2378
+ },
2379
+ "from_revision": {
2380
+ "name": "from_revision",
2381
+ "type": "integer",
2382
+ "primaryKey": false,
2383
+ "notNull": true,
2384
+ "autoincrement": false
2385
+ },
2386
+ "to_revision": {
2387
+ "name": "to_revision",
2388
+ "type": "integer",
2389
+ "primaryKey": false,
2390
+ "notNull": false,
2391
+ "autoincrement": false
2392
+ },
2393
+ "status": {
2394
+ "name": "status",
2395
+ "type": "text",
2396
+ "primaryKey": false,
2397
+ "notNull": true,
2398
+ "autoincrement": false
2399
+ },
2400
+ "code": {
2401
+ "name": "code",
2402
+ "type": "text",
2403
+ "primaryKey": false,
2404
+ "notNull": false,
2405
+ "autoincrement": false
2406
+ },
2407
+ "attempts": {
2408
+ "name": "attempts",
2409
+ "type": "integer",
2410
+ "primaryKey": false,
2411
+ "notNull": true,
2412
+ "autoincrement": false,
2413
+ "default": 1
2414
+ },
2415
+ "first_at": {
2416
+ "name": "first_at",
2417
+ "type": "integer",
2418
+ "primaryKey": false,
2419
+ "notNull": true,
2420
+ "autoincrement": false
2421
+ },
2422
+ "last_at": {
2423
+ "name": "last_at",
2424
+ "type": "integer",
2425
+ "primaryKey": false,
2426
+ "notNull": true,
2427
+ "autoincrement": false
2428
+ }
2429
+ },
2430
+ "indexes": {},
2431
+ "foreignKeys": {},
2432
+ "compositePrimaryKeys": {
2433
+ "ui_instance_repins_pk": {
2434
+ "columns": [
2435
+ "instance_id",
2436
+ "to_hash"
2437
+ ],
2438
+ "name": "ui_instance_repins_pk"
2439
+ }
2440
+ },
2441
+ "uniqueConstraints": {},
2442
+ "checkConstraints": {
2443
+ "ui_instance_repins_instance_id_ck": {
2444
+ "name": "ui_instance_repins_instance_id_ck",
2445
+ "value": "length(\"ui_instance_repins\".\"instance_id\") BETWEEN 5 AND 128 AND \"ui_instance_repins\".\"instance_id\" GLOB 'uic_*'"
2446
+ },
2447
+ "ui_instance_repins_from_version_ck": {
2448
+ "name": "ui_instance_repins_from_version_ck",
2449
+ "value": "\"ui_instance_repins\".\"from_version\" >= 1"
2450
+ },
2451
+ "ui_instance_repins_to_version_ck": {
2452
+ "name": "ui_instance_repins_to_version_ck",
2453
+ "value": "\"ui_instance_repins\".\"to_version\" >= 1"
2454
+ },
2455
+ "ui_instance_repins_from_hash_ck": {
2456
+ "name": "ui_instance_repins_from_hash_ck",
2457
+ "value": "length(\"ui_instance_repins\".\"from_hash\") = 64 AND \"ui_instance_repins\".\"from_hash\" NOT GLOB '*[^0-9a-f]*'"
2458
+ },
2459
+ "ui_instance_repins_to_hash_ck": {
2460
+ "name": "ui_instance_repins_to_hash_ck",
2461
+ "value": "length(\"ui_instance_repins\".\"to_hash\") = 64 AND \"ui_instance_repins\".\"to_hash\" NOT GLOB '*[^0-9a-f]*'"
2462
+ },
2463
+ "ui_instance_repins_from_revision_ck": {
2464
+ "name": "ui_instance_repins_from_revision_ck",
2465
+ "value": "\"ui_instance_repins\".\"from_revision\" >= 0"
2466
+ },
2467
+ "ui_instance_repins_to_revision_ck": {
2468
+ "name": "ui_instance_repins_to_revision_ck",
2469
+ "value": "\"ui_instance_repins\".\"to_revision\" IS NULL OR \"ui_instance_repins\".\"to_revision\" >= 0"
2470
+ },
2471
+ "ui_instance_repins_status_ck": {
2472
+ "name": "ui_instance_repins_status_ck",
2473
+ "value": "\"ui_instance_repins\".\"status\" IN ('applied', 'deferred', 'failed')"
2474
+ },
2475
+ "ui_instance_repins_attempts_ck": {
2476
+ "name": "ui_instance_repins_attempts_ck",
2477
+ "value": "\"ui_instance_repins\".\"attempts\" >= 1"
2478
+ },
2479
+ "ui_instance_repins_dates_ck": {
2480
+ "name": "ui_instance_repins_dates_ck",
2481
+ "value": "\"ui_instance_repins\".\"first_at\" >= 0 AND \"ui_instance_repins\".\"last_at\" >= \"ui_instance_repins\".\"first_at\""
2482
+ },
2483
+ "ui_instance_repins_result_ck": {
2484
+ "name": "ui_instance_repins_result_ck",
2485
+ "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 )"
2486
+ }
2487
+ }
2488
+ },
2489
+ "project_criteria": {
2490
+ "name": "project_criteria",
2491
+ "columns": {
2492
+ "id": {
2493
+ "name": "id",
2494
+ "type": "text",
2495
+ "primaryKey": true,
2496
+ "notNull": true,
2497
+ "autoincrement": false
2498
+ },
2499
+ "project_id": {
2500
+ "name": "project_id",
2501
+ "type": "text",
2502
+ "primaryKey": false,
2503
+ "notNull": true,
2504
+ "autoincrement": false
2505
+ },
2506
+ "position": {
2507
+ "name": "position",
2508
+ "type": "integer",
2509
+ "primaryKey": false,
2510
+ "notNull": true,
2511
+ "autoincrement": false
2512
+ },
2513
+ "statement": {
2514
+ "name": "statement",
2515
+ "type": "text",
2516
+ "primaryKey": false,
2517
+ "notNull": true,
2518
+ "autoincrement": false
2519
+ },
2520
+ "verify_status": {
2521
+ "name": "verify_status",
2522
+ "type": "text",
2523
+ "primaryKey": false,
2524
+ "notNull": true,
2525
+ "autoincrement": false,
2526
+ "default": "'pending'"
2527
+ },
2528
+ "verified_at": {
2529
+ "name": "verified_at",
2530
+ "type": "text",
2531
+ "primaryKey": false,
2532
+ "notNull": false,
2533
+ "autoincrement": false
2534
+ },
2535
+ "evidence_json": {
2536
+ "name": "evidence_json",
2537
+ "type": "text",
2538
+ "primaryKey": false,
2539
+ "notNull": true,
2540
+ "autoincrement": false,
2541
+ "default": "'[]'"
2542
+ },
2543
+ "created_at": {
2544
+ "name": "created_at",
2545
+ "type": "text",
2546
+ "primaryKey": false,
2547
+ "notNull": true,
2548
+ "autoincrement": false
2549
+ },
2550
+ "updated_at": {
2551
+ "name": "updated_at",
2552
+ "type": "text",
2553
+ "primaryKey": false,
2554
+ "notNull": true,
2555
+ "autoincrement": false
2556
+ }
2557
+ },
2558
+ "indexes": {
2559
+ "project_criteria_project_position_uq": {
2560
+ "name": "project_criteria_project_position_uq",
2561
+ "columns": [
2562
+ "project_id",
2563
+ "position"
2564
+ ],
2565
+ "isUnique": true
2566
+ }
2567
+ },
2568
+ "foreignKeys": {
2569
+ "project_criteria_project_id_projects_id_fk": {
2570
+ "name": "project_criteria_project_id_projects_id_fk",
2571
+ "tableFrom": "project_criteria",
2572
+ "tableTo": "projects",
2573
+ "columnsFrom": [
2574
+ "project_id"
2575
+ ],
2576
+ "columnsTo": [
2577
+ "id"
2578
+ ],
2579
+ "onDelete": "cascade",
2580
+ "onUpdate": "no action"
2581
+ }
2582
+ },
2583
+ "compositePrimaryKeys": {},
2584
+ "uniqueConstraints": {},
2585
+ "checkConstraints": {
2586
+ "project_criteria_id_ck": {
2587
+ "name": "project_criteria_id_ck",
2588
+ "value": "\"project_criteria\".\"id\" GLOB 'pjc_*'"
2589
+ },
2590
+ "project_criteria_verify_status_ck": {
2591
+ "name": "project_criteria_verify_status_ck",
2592
+ "value": "\"project_criteria\".\"verify_status\" IN ('pending', 'verifying', 'passed', 'failed')"
2593
+ },
2594
+ "project_criteria_evidence_json_ck": {
2595
+ "name": "project_criteria_evidence_json_ck",
2596
+ "value": "json_valid(\"project_criteria\".\"evidence_json\") AND json_type(\"project_criteria\".\"evidence_json\") = 'array'"
2597
+ }
2598
+ }
2599
+ },
2600
+ "project_events": {
2601
+ "name": "project_events",
2602
+ "columns": {
2603
+ "id": {
2604
+ "name": "id",
2605
+ "type": "text",
2606
+ "primaryKey": true,
2607
+ "notNull": true,
2608
+ "autoincrement": false
2609
+ },
2610
+ "project_id": {
2611
+ "name": "project_id",
2612
+ "type": "text",
2613
+ "primaryKey": false,
2614
+ "notNull": true,
2615
+ "autoincrement": false
2616
+ },
2617
+ "seq": {
2618
+ "name": "seq",
2619
+ "type": "integer",
2620
+ "primaryKey": false,
2621
+ "notNull": true,
2622
+ "autoincrement": false
2623
+ },
2624
+ "actor_type": {
2625
+ "name": "actor_type",
2626
+ "type": "text",
2627
+ "primaryKey": false,
2628
+ "notNull": true,
2629
+ "autoincrement": false
2630
+ },
2631
+ "actor_id": {
2632
+ "name": "actor_id",
2633
+ "type": "text",
2634
+ "primaryKey": false,
2635
+ "notNull": false,
2636
+ "autoincrement": false
2637
+ },
2638
+ "type": {
2639
+ "name": "type",
2640
+ "type": "text",
2641
+ "primaryKey": false,
2642
+ "notNull": true,
2643
+ "autoincrement": false
2644
+ },
2645
+ "title": {
2646
+ "name": "title",
2647
+ "type": "text",
2648
+ "primaryKey": false,
2649
+ "notNull": true,
2650
+ "autoincrement": false
2651
+ },
2652
+ "summary": {
2653
+ "name": "summary",
2654
+ "type": "text",
2655
+ "primaryKey": false,
2656
+ "notNull": false,
2657
+ "autoincrement": false
2658
+ },
2659
+ "payload_json": {
2660
+ "name": "payload_json",
2661
+ "type": "text",
2662
+ "primaryKey": false,
2663
+ "notNull": true,
2664
+ "autoincrement": false,
2665
+ "default": "'{}'"
2666
+ },
2667
+ "created_at": {
2668
+ "name": "created_at",
2669
+ "type": "text",
2670
+ "primaryKey": false,
2671
+ "notNull": true,
2672
+ "autoincrement": false
2673
+ }
2674
+ },
2675
+ "indexes": {
2676
+ "project_events_project_seq_uq": {
2677
+ "name": "project_events_project_seq_uq",
2678
+ "columns": [
2679
+ "project_id",
2680
+ "seq"
2681
+ ],
2682
+ "isUnique": true
2683
+ }
2684
+ },
2685
+ "foreignKeys": {
2686
+ "project_events_project_id_projects_id_fk": {
2687
+ "name": "project_events_project_id_projects_id_fk",
2688
+ "tableFrom": "project_events",
2689
+ "tableTo": "projects",
2690
+ "columnsFrom": [
2691
+ "project_id"
2692
+ ],
2693
+ "columnsTo": [
2694
+ "id"
2695
+ ],
2696
+ "onDelete": "restrict",
2697
+ "onUpdate": "no action"
2698
+ }
2699
+ },
2700
+ "compositePrimaryKeys": {},
2701
+ "uniqueConstraints": {},
2702
+ "checkConstraints": {
2703
+ "project_events_id_ck": {
2704
+ "name": "project_events_id_ck",
2705
+ "value": "\"project_events\".\"id\" GLOB 'pje_*'"
2706
+ },
2707
+ "project_events_actor_type_ck": {
2708
+ "name": "project_events_actor_type_ck",
2709
+ "value": "\"project_events\".\"actor_type\" IN ('user', 'project_manager', 'system')"
2710
+ },
2711
+ "project_events_payload_json_ck": {
2712
+ "name": "project_events_payload_json_ck",
2713
+ "value": "json_valid(\"project_events\".\"payload_json\") AND json_type(\"project_events\".\"payload_json\") = 'object'"
2714
+ }
2715
+ }
2716
+ },
2717
+ "projects": {
2718
+ "name": "projects",
2719
+ "columns": {
2720
+ "id": {
2721
+ "name": "id",
2722
+ "type": "text",
2723
+ "primaryKey": true,
2724
+ "notNull": true,
2725
+ "autoincrement": false
2726
+ },
2727
+ "workspace_id": {
2728
+ "name": "workspace_id",
2729
+ "type": "text",
2730
+ "primaryKey": false,
2731
+ "notNull": true,
2732
+ "autoincrement": false
2733
+ },
2734
+ "name": {
2735
+ "name": "name",
2736
+ "type": "text",
2737
+ "primaryKey": false,
2738
+ "notNull": true,
2739
+ "autoincrement": false
2740
+ },
2741
+ "outcome": {
2742
+ "name": "outcome",
2743
+ "type": "text",
2744
+ "primaryKey": false,
2745
+ "notNull": true,
2746
+ "autoincrement": false
2747
+ },
2748
+ "due_date": {
2749
+ "name": "due_date",
2750
+ "type": "text",
2751
+ "primaryKey": false,
2752
+ "notNull": false,
2753
+ "autoincrement": false
2754
+ },
2755
+ "scene": {
2756
+ "name": "scene",
2757
+ "type": "text",
2758
+ "primaryKey": false,
2759
+ "notNull": true,
2760
+ "autoincrement": false,
2761
+ "default": "'planning'"
2762
+ },
2763
+ "stages_json": {
2764
+ "name": "stages_json",
2765
+ "type": "text",
2766
+ "primaryKey": false,
2767
+ "notNull": true,
2768
+ "autoincrement": false
2769
+ },
2770
+ "stage_index": {
2771
+ "name": "stage_index",
2772
+ "type": "integer",
2773
+ "primaryKey": false,
2774
+ "notNull": true,
2775
+ "autoincrement": false
2776
+ },
2777
+ "created_at": {
2778
+ "name": "created_at",
2779
+ "type": "text",
2780
+ "primaryKey": false,
2781
+ "notNull": true,
2782
+ "autoincrement": false
2783
+ },
2784
+ "updated_at": {
2785
+ "name": "updated_at",
2786
+ "type": "text",
2787
+ "primaryKey": false,
2788
+ "notNull": true,
2789
+ "autoincrement": false
2790
+ },
2791
+ "accepted_at": {
2792
+ "name": "accepted_at",
2793
+ "type": "text",
2794
+ "primaryKey": false,
2795
+ "notNull": false,
2796
+ "autoincrement": false
2797
+ },
2798
+ "archived_at": {
2799
+ "name": "archived_at",
2800
+ "type": "text",
2801
+ "primaryKey": false,
2802
+ "notNull": false,
2803
+ "autoincrement": false
2804
+ }
2805
+ },
2806
+ "indexes": {},
2807
+ "foreignKeys": {},
2808
+ "compositePrimaryKeys": {},
2809
+ "uniqueConstraints": {},
2810
+ "checkConstraints": {
2811
+ "projects_id_ck": {
2812
+ "name": "projects_id_ck",
2813
+ "value": "\"projects\".\"id\" GLOB 'prj_*'"
2814
+ },
2815
+ "projects_scene_ck": {
2816
+ "name": "projects_scene_ck",
2817
+ "value": "\"projects\".\"scene\" IN ('planning', 'plan_review', 'running', 'human_wait', 'limit_wait', 'failed_stop', 'analyzing_feedback', 'replanned', 'awaiting_review', 'accepted')"
2818
+ },
2819
+ "projects_stages_json_ck": {
2820
+ "name": "projects_stages_json_ck",
2821
+ "value": "json_valid(\"projects\".\"stages_json\") AND json_type(\"projects\".\"stages_json\") = 'array'"
2822
+ },
2823
+ "projects_stage_index_ck": {
2824
+ "name": "projects_stage_index_ck",
2825
+ "value": "\"projects\".\"stage_index\" >= 1"
2826
+ }
2827
+ }
2828
+ },
2829
+ "common_codes": {
2830
+ "name": "common_codes",
2831
+ "columns": {
2832
+ "code_group": {
2833
+ "name": "code_group",
2834
+ "type": "text",
2835
+ "primaryKey": false,
2836
+ "notNull": true,
2837
+ "autoincrement": false
2838
+ },
2839
+ "code": {
2840
+ "name": "code",
2841
+ "type": "text",
2842
+ "primaryKey": false,
2843
+ "notNull": true,
2844
+ "autoincrement": false
2845
+ },
2846
+ "code_name": {
2847
+ "name": "code_name",
2848
+ "type": "text",
2849
+ "primaryKey": false,
2850
+ "notNull": false,
2851
+ "autoincrement": false
2852
+ },
2853
+ "color": {
2854
+ "name": "color",
2855
+ "type": "text",
2856
+ "primaryKey": false,
2857
+ "notNull": true,
2858
+ "autoincrement": false,
2859
+ "default": "'gray'"
2860
+ },
2861
+ "sort_order": {
2862
+ "name": "sort_order",
2863
+ "type": "integer",
2864
+ "primaryKey": false,
2865
+ "notNull": true,
2866
+ "autoincrement": false
2867
+ },
2868
+ "workspace_id": {
2869
+ "name": "workspace_id",
2870
+ "type": "text",
2871
+ "primaryKey": false,
2872
+ "notNull": false,
2873
+ "autoincrement": false
2874
+ },
2875
+ "is_builtin": {
2876
+ "name": "is_builtin",
2877
+ "type": "integer",
2878
+ "primaryKey": false,
2879
+ "notNull": true,
2880
+ "autoincrement": false,
2881
+ "default": 0
2882
+ },
2883
+ "is_archived": {
2884
+ "name": "is_archived",
2885
+ "type": "integer",
2886
+ "primaryKey": false,
2887
+ "notNull": true,
2888
+ "autoincrement": false,
2889
+ "default": 0
2890
+ },
2891
+ "metadata": {
2892
+ "name": "metadata",
2893
+ "type": "text",
2894
+ "primaryKey": false,
2895
+ "notNull": false,
2896
+ "autoincrement": false
2897
+ },
2898
+ "created_at": {
2899
+ "name": "created_at",
2900
+ "type": "text",
2901
+ "primaryKey": false,
2902
+ "notNull": true,
2903
+ "autoincrement": false
2904
+ },
2905
+ "updated_at": {
2906
+ "name": "updated_at",
2907
+ "type": "text",
2908
+ "primaryKey": false,
2909
+ "notNull": true,
2910
+ "autoincrement": false
2911
+ }
2912
+ },
2913
+ "indexes": {
2914
+ "idx_common_codes_group_archived_order": {
2915
+ "name": "idx_common_codes_group_archived_order",
2916
+ "columns": [
2917
+ "code_group",
2918
+ "is_archived",
2919
+ "sort_order"
2920
+ ],
2921
+ "isUnique": false
2922
+ }
2923
+ },
2924
+ "foreignKeys": {},
2925
+ "compositePrimaryKeys": {
2926
+ "common_codes_code_group_code_pk": {
2927
+ "columns": [
2928
+ "code_group",
2929
+ "code"
2930
+ ],
2931
+ "name": "common_codes_code_group_code_pk"
2932
+ }
2933
+ },
2934
+ "uniqueConstraints": {},
2935
+ "checkConstraints": {
2936
+ "common_codes_metadata_ck": {
2937
+ "name": "common_codes_metadata_ck",
2938
+ "value": "\"common_codes\".\"metadata\" IS NULL OR (json_valid(\"common_codes\".\"metadata\") AND json_type(\"common_codes\".\"metadata\") = 'object')"
2939
+ },
2940
+ "common_codes_builtin_ck": {
2941
+ "name": "common_codes_builtin_ck",
2942
+ "value": "\"common_codes\".\"is_builtin\" IN (0, 1)"
2943
+ },
2944
+ "common_codes_archived_ck": {
2945
+ "name": "common_codes_archived_ck",
2946
+ "value": "\"common_codes\".\"is_archived\" IN (0, 1)"
2947
+ }
2948
+ }
2949
+ },
2950
+ "thread_events": {
2951
+ "name": "thread_events",
2952
+ "columns": {
2953
+ "id": {
2954
+ "name": "id",
2955
+ "type": "text",
2956
+ "primaryKey": true,
2957
+ "notNull": true,
2958
+ "autoincrement": false
2959
+ },
2960
+ "thread_id": {
2961
+ "name": "thread_id",
2962
+ "type": "text",
2963
+ "primaryKey": false,
2964
+ "notNull": true,
2965
+ "autoincrement": false
2966
+ },
2967
+ "seq": {
2968
+ "name": "seq",
2969
+ "type": "integer",
2970
+ "primaryKey": false,
2971
+ "notNull": true,
2972
+ "autoincrement": false
2973
+ },
2974
+ "type": {
2975
+ "name": "type",
2976
+ "type": "text",
2977
+ "primaryKey": false,
2978
+ "notNull": true,
2979
+ "autoincrement": false
2980
+ },
2981
+ "actor_type": {
2982
+ "name": "actor_type",
2983
+ "type": "text",
2984
+ "primaryKey": false,
2985
+ "notNull": true,
2986
+ "autoincrement": false
2987
+ },
2988
+ "payload_json": {
2989
+ "name": "payload_json",
2990
+ "type": "text",
2991
+ "primaryKey": false,
2992
+ "notNull": true,
2993
+ "autoincrement": false
2994
+ },
2995
+ "created_at": {
2996
+ "name": "created_at",
2997
+ "type": "text",
2998
+ "primaryKey": false,
2999
+ "notNull": true,
3000
+ "autoincrement": false
3001
+ },
3002
+ "actor_id": {
3003
+ "name": "actor_id",
3004
+ "type": "text",
3005
+ "primaryKey": false,
3006
+ "notNull": false,
3007
+ "autoincrement": false
3008
+ },
3009
+ "task_id": {
3010
+ "name": "task_id",
3011
+ "type": "text",
3012
+ "primaryKey": false,
3013
+ "notNull": false,
3014
+ "autoincrement": false
3015
+ },
3016
+ "highlight_id": {
3017
+ "name": "highlight_id",
3018
+ "type": "text",
3019
+ "primaryKey": false,
3020
+ "notNull": false,
3021
+ "autoincrement": false
3022
+ }
3023
+ },
3024
+ "indexes": {
3025
+ "idx_thread_events_thread_seq": {
3026
+ "name": "idx_thread_events_thread_seq",
3027
+ "columns": [
3028
+ "thread_id",
3029
+ "seq"
3030
+ ],
3031
+ "isUnique": false
3032
+ },
3033
+ "idx_thread_events_thread_created": {
3034
+ "name": "idx_thread_events_thread_created",
3035
+ "columns": [
3036
+ "thread_id",
3037
+ "created_at"
3038
+ ],
3039
+ "isUnique": false
3040
+ },
3041
+ "thread_events_thread_seq_uq": {
3042
+ "name": "thread_events_thread_seq_uq",
3043
+ "columns": [
3044
+ "thread_id",
3045
+ "seq"
3046
+ ],
3047
+ "isUnique": true
3048
+ }
3049
+ },
3050
+ "foreignKeys": {
3051
+ "thread_events_thread_id_threads_id_fk": {
3052
+ "name": "thread_events_thread_id_threads_id_fk",
3053
+ "tableFrom": "thread_events",
3054
+ "tableTo": "threads",
3055
+ "columnsFrom": [
3056
+ "thread_id"
3057
+ ],
3058
+ "columnsTo": [
3059
+ "id"
3060
+ ],
3061
+ "onDelete": "cascade",
3062
+ "onUpdate": "no action"
3063
+ }
3064
+ },
3065
+ "compositePrimaryKeys": {},
3066
+ "uniqueConstraints": {},
3067
+ "checkConstraints": {
3068
+ "thread_events_type_ck": {
3069
+ "name": "thread_events_type_ck",
3070
+ "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')"
3071
+ },
3072
+ "thread_events_actor_type_ck": {
3073
+ "name": "thread_events_actor_type_ck",
3074
+ "value": "\"thread_events\".\"actor_type\" IN ('user', 'agent', 'system')"
3075
+ },
3076
+ "thread_events_payload_json_ck": {
3077
+ "name": "thread_events_payload_json_ck",
3078
+ "value": "json_valid(\"thread_events\".\"payload_json\") AND json_type(\"thread_events\".\"payload_json\") = 'object'"
3079
+ }
3080
+ }
3081
+ },
3082
+ "thread_highlight_runs": {
3083
+ "name": "thread_highlight_runs",
3084
+ "columns": {
3085
+ "id": {
3086
+ "name": "id",
3087
+ "type": "text",
3088
+ "primaryKey": true,
3089
+ "notNull": true,
3090
+ "autoincrement": false
3091
+ },
3092
+ "thread_id": {
3093
+ "name": "thread_id",
3094
+ "type": "text",
3095
+ "primaryKey": false,
3096
+ "notNull": true,
3097
+ "autoincrement": false
3098
+ },
3099
+ "request_id": {
3100
+ "name": "request_id",
3101
+ "type": "text",
3102
+ "primaryKey": false,
3103
+ "notNull": true,
3104
+ "autoincrement": false
3105
+ },
3106
+ "status": {
3107
+ "name": "status",
3108
+ "type": "text",
3109
+ "primaryKey": false,
3110
+ "notNull": true,
3111
+ "autoincrement": false
3112
+ },
3113
+ "detector_version": {
3114
+ "name": "detector_version",
3115
+ "type": "text",
3116
+ "primaryKey": false,
3117
+ "notNull": true,
3118
+ "autoincrement": false
3119
+ },
3120
+ "requested_at": {
3121
+ "name": "requested_at",
3122
+ "type": "text",
3123
+ "primaryKey": false,
3124
+ "notNull": true,
3125
+ "autoincrement": false
3126
+ },
3127
+ "started_at": {
3128
+ "name": "started_at",
3129
+ "type": "text",
3130
+ "primaryKey": false,
3131
+ "notNull": false,
3132
+ "autoincrement": false
3133
+ },
3134
+ "completed_at": {
3135
+ "name": "completed_at",
3136
+ "type": "text",
3137
+ "primaryKey": false,
3138
+ "notNull": false,
3139
+ "autoincrement": false
3140
+ },
3141
+ "error_code": {
3142
+ "name": "error_code",
3143
+ "type": "text",
3144
+ "primaryKey": false,
3145
+ "notNull": false,
3146
+ "autoincrement": false
3147
+ },
3148
+ "previous_auto_count": {
3149
+ "name": "previous_auto_count",
3150
+ "type": "integer",
3151
+ "primaryKey": false,
3152
+ "notNull": false,
3153
+ "autoincrement": false
3154
+ },
3155
+ "new_auto_count": {
3156
+ "name": "new_auto_count",
3157
+ "type": "integer",
3158
+ "primaryKey": false,
3159
+ "notNull": false,
3160
+ "autoincrement": false
3161
+ }
3162
+ },
3163
+ "indexes": {
3164
+ "thread_highlight_runs_thread_request_uq": {
3165
+ "name": "thread_highlight_runs_thread_request_uq",
3166
+ "columns": [
3167
+ "thread_id",
3168
+ "request_id"
3169
+ ],
3170
+ "isUnique": true
3171
+ },
3172
+ "thread_highlight_runs_in_progress_thread_uq": {
3173
+ "name": "thread_highlight_runs_in_progress_thread_uq",
3174
+ "columns": [
3175
+ "thread_id"
3176
+ ],
3177
+ "isUnique": true,
3178
+ "where": "\"thread_highlight_runs\".\"status\" IN ('queued', 'running')"
3179
+ },
3180
+ "idx_thread_highlight_runs_thread_status_requested": {
3181
+ "name": "idx_thread_highlight_runs_thread_status_requested",
3182
+ "columns": [
3183
+ "thread_id",
3184
+ "status",
3185
+ "requested_at"
3186
+ ],
3187
+ "isUnique": false
3188
+ }
3189
+ },
3190
+ "foreignKeys": {
3191
+ "thread_highlight_runs_thread_id_threads_id_fk": {
3192
+ "name": "thread_highlight_runs_thread_id_threads_id_fk",
3193
+ "tableFrom": "thread_highlight_runs",
3194
+ "tableTo": "threads",
3195
+ "columnsFrom": [
3196
+ "thread_id"
3197
+ ],
3198
+ "columnsTo": [
3199
+ "id"
3200
+ ],
3201
+ "onDelete": "cascade",
3202
+ "onUpdate": "no action"
3203
+ }
3204
+ },
3205
+ "compositePrimaryKeys": {},
3206
+ "uniqueConstraints": {},
3207
+ "checkConstraints": {
3208
+ "thread_highlight_runs_status_ck": {
3209
+ "name": "thread_highlight_runs_status_ck",
3210
+ "value": "\"thread_highlight_runs\".\"status\" IN ('queued', 'running', 'completed', 'failed')"
3211
+ },
3212
+ "thread_highlight_runs_counts_ck": {
3213
+ "name": "thread_highlight_runs_counts_ck",
3214
+ "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)"
3215
+ }
3216
+ }
3217
+ },
3218
+ "thread_highlights": {
3219
+ "name": "thread_highlights",
3220
+ "columns": {
3221
+ "id": {
3222
+ "name": "id",
3223
+ "type": "text",
3224
+ "primaryKey": true,
3225
+ "notNull": true,
3226
+ "autoincrement": false
3227
+ },
3228
+ "thread_id": {
3229
+ "name": "thread_id",
3230
+ "type": "text",
3231
+ "primaryKey": false,
3232
+ "notNull": true,
3233
+ "autoincrement": false
3234
+ },
3235
+ "source": {
3236
+ "name": "source",
3237
+ "type": "text",
3238
+ "primaryKey": false,
3239
+ "notNull": true,
3240
+ "autoincrement": false
3241
+ },
3242
+ "kind": {
3243
+ "name": "kind",
3244
+ "type": "text",
3245
+ "primaryKey": false,
3246
+ "notNull": true,
3247
+ "autoincrement": false
3248
+ },
3249
+ "status": {
3250
+ "name": "status",
3251
+ "type": "text",
3252
+ "primaryKey": false,
3253
+ "notNull": true,
3254
+ "autoincrement": false,
3255
+ "default": "'active'"
3256
+ },
3257
+ "text": {
3258
+ "name": "text",
3259
+ "type": "text",
3260
+ "primaryKey": false,
3261
+ "notNull": false,
3262
+ "autoincrement": false
3263
+ },
3264
+ "covers_from_task_id": {
3265
+ "name": "covers_from_task_id",
3266
+ "type": "text",
3267
+ "primaryKey": false,
3268
+ "notNull": true,
3269
+ "autoincrement": false
3270
+ },
3271
+ "covers_to_task_id": {
3272
+ "name": "covers_to_task_id",
3273
+ "type": "text",
3274
+ "primaryKey": false,
3275
+ "notNull": true,
3276
+ "autoincrement": false
3277
+ },
3278
+ "revision": {
3279
+ "name": "revision",
3280
+ "type": "integer",
3281
+ "primaryKey": false,
3282
+ "notNull": true,
3283
+ "autoincrement": false,
3284
+ "default": 0
3285
+ },
3286
+ "created_at": {
3287
+ "name": "created_at",
3288
+ "type": "text",
3289
+ "primaryKey": false,
3290
+ "notNull": true,
3291
+ "autoincrement": false
3292
+ },
3293
+ "updated_at": {
3294
+ "name": "updated_at",
3295
+ "type": "text",
3296
+ "primaryKey": false,
3297
+ "notNull": true,
3298
+ "autoincrement": false
3299
+ },
3300
+ "agent_id": {
3301
+ "name": "agent_id",
3302
+ "type": "text",
3303
+ "primaryKey": false,
3304
+ "notNull": false,
3305
+ "autoincrement": false
3306
+ },
3307
+ "source_task_id": {
3308
+ "name": "source_task_id",
3309
+ "type": "text",
3310
+ "primaryKey": false,
3311
+ "notNull": false,
3312
+ "autoincrement": false
3313
+ },
3314
+ "detector_version": {
3315
+ "name": "detector_version",
3316
+ "type": "text",
3317
+ "primaryKey": false,
3318
+ "notNull": false,
3319
+ "autoincrement": false
3320
+ },
3321
+ "content_fingerprint": {
3322
+ "name": "content_fingerprint",
3323
+ "type": "text",
3324
+ "primaryKey": false,
3325
+ "notNull": false,
3326
+ "autoincrement": false
3327
+ },
3328
+ "dismissed_at": {
3329
+ "name": "dismissed_at",
3330
+ "type": "text",
3331
+ "primaryKey": false,
3332
+ "notNull": false,
3333
+ "autoincrement": false
3334
+ }
3335
+ },
3336
+ "indexes": {
3337
+ "idx_thread_highlights_thread_status_created": {
3338
+ "name": "idx_thread_highlights_thread_status_created",
3339
+ "columns": [
3340
+ "thread_id",
3341
+ "status",
3342
+ "created_at"
3343
+ ],
3344
+ "isUnique": false
3345
+ },
3346
+ "idx_thread_highlights_thread_covers": {
3347
+ "name": "idx_thread_highlights_thread_covers",
3348
+ "columns": [
3349
+ "thread_id",
3350
+ "covers_from_task_id",
3351
+ "covers_to_task_id"
3352
+ ],
3353
+ "isUnique": false
3354
+ },
3355
+ "thread_highlights_auto_idempotency_uq": {
3356
+ "name": "thread_highlights_auto_idempotency_uq",
3357
+ "columns": [
3358
+ "thread_id",
3359
+ "source_task_id",
3360
+ "detector_version",
3361
+ "content_fingerprint"
3362
+ ],
3363
+ "isUnique": true,
3364
+ "where": "\"thread_highlights\".\"source\" = 'auto'"
3365
+ }
3366
+ },
3367
+ "foreignKeys": {
3368
+ "thread_highlights_thread_id_threads_id_fk": {
3369
+ "name": "thread_highlights_thread_id_threads_id_fk",
3370
+ "tableFrom": "thread_highlights",
3371
+ "tableTo": "threads",
3372
+ "columnsFrom": [
3373
+ "thread_id"
3374
+ ],
3375
+ "columnsTo": [
3376
+ "id"
3377
+ ],
3378
+ "onDelete": "cascade",
3379
+ "onUpdate": "no action"
3380
+ }
3381
+ },
3382
+ "compositePrimaryKeys": {},
3383
+ "uniqueConstraints": {},
3384
+ "checkConstraints": {
3385
+ "thread_highlights_source_ck": {
3386
+ "name": "thread_highlights_source_ck",
3387
+ "value": "\"thread_highlights\".\"source\" IN ('auto', 'manual')"
3388
+ },
3389
+ "thread_highlights_kind_ck": {
3390
+ "name": "thread_highlights_kind_ck",
3391
+ "value": "\"thread_highlights\".\"kind\" IN ('decision', 'judgment', 'issue', 'result', 'pivot')"
3392
+ },
3393
+ "thread_highlights_status_ck": {
3394
+ "name": "thread_highlights_status_ck",
3395
+ "value": "\"thread_highlights\".\"status\" IN ('active', 'dismissed')"
3396
+ },
3397
+ "thread_highlights_active_text_ck": {
3398
+ "name": "thread_highlights_active_text_ck",
3399
+ "value": "\"thread_highlights\".\"status\" = 'dismissed' OR (\"thread_highlights\".\"text\" IS NOT NULL AND length(\"thread_highlights\".\"text\") > 0)"
3400
+ },
3401
+ "thread_highlights_covers_ck": {
3402
+ "name": "thread_highlights_covers_ck",
3403
+ "value": "length(\"thread_highlights\".\"covers_from_task_id\") > 0 AND length(\"thread_highlights\".\"covers_to_task_id\") > 0"
3404
+ },
3405
+ "thread_highlights_auto_key_ck": {
3406
+ "name": "thread_highlights_auto_key_ck",
3407
+ "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)"
3408
+ }
3409
+ }
3410
+ },
3411
+ "storage_metadata": {
3412
+ "name": "storage_metadata",
3413
+ "columns": {
3414
+ "source_kind": {
3415
+ "name": "source_kind",
3416
+ "type": "text",
3417
+ "primaryKey": false,
3418
+ "notNull": true,
3419
+ "autoincrement": false
3420
+ },
3421
+ "source_id": {
3422
+ "name": "source_id",
3423
+ "type": "text",
3424
+ "primaryKey": false,
3425
+ "notNull": true,
3426
+ "autoincrement": false
3427
+ },
3428
+ "utc_ts": {
3429
+ "name": "utc_ts",
3430
+ "type": "text",
3431
+ "primaryKey": false,
3432
+ "notNull": false,
3433
+ "autoincrement": false
3434
+ },
3435
+ "bytes": {
3436
+ "name": "bytes",
3437
+ "type": "integer",
3438
+ "primaryKey": false,
3439
+ "notNull": true,
3440
+ "autoincrement": false
3441
+ }
3442
+ },
3443
+ "indexes": {
3444
+ "idx_storage_metadata_kind_ts_bytes": {
3445
+ "name": "idx_storage_metadata_kind_ts_bytes",
3446
+ "columns": [
3447
+ "source_kind",
3448
+ "utc_ts",
3449
+ "bytes"
3450
+ ],
3451
+ "isUnique": false
3452
+ }
3453
+ },
3454
+ "foreignKeys": {},
3455
+ "compositePrimaryKeys": {
3456
+ "storage_metadata_source_kind_source_id_pk": {
3457
+ "columns": [
3458
+ "source_kind",
3459
+ "source_id"
3460
+ ],
3461
+ "name": "storage_metadata_source_kind_source_id_pk"
3462
+ }
3463
+ },
3464
+ "uniqueConstraints": {},
3465
+ "checkConstraints": {}
3466
+ },
3467
+ "storage_metadata_state": {
3468
+ "name": "storage_metadata_state",
3469
+ "columns": {
3470
+ "unit": {
3471
+ "name": "unit",
3472
+ "type": "text",
3473
+ "primaryKey": true,
3474
+ "notNull": true,
3475
+ "autoincrement": false
3476
+ },
3477
+ "cursor_rowid": {
3478
+ "name": "cursor_rowid",
3479
+ "type": "integer",
3480
+ "primaryKey": false,
3481
+ "notNull": true,
3482
+ "autoincrement": false,
3483
+ "default": 0
3484
+ },
3485
+ "end_rowid": {
3486
+ "name": "end_rowid",
3487
+ "type": "integer",
3488
+ "primaryKey": false,
3489
+ "notNull": false,
3490
+ "autoincrement": false
3491
+ },
3492
+ "complete": {
3493
+ "name": "complete",
3494
+ "type": "integer",
3495
+ "primaryKey": false,
3496
+ "notNull": true,
3497
+ "autoincrement": false,
3498
+ "default": 0
3499
+ },
3500
+ "updated_at": {
3501
+ "name": "updated_at",
3502
+ "type": "text",
3503
+ "primaryKey": false,
3504
+ "notNull": true,
3505
+ "autoincrement": false
3506
+ }
3507
+ },
3508
+ "indexes": {},
3509
+ "foreignKeys": {},
3510
+ "compositePrimaryKeys": {},
3511
+ "uniqueConstraints": {},
3512
+ "checkConstraints": {}
3513
+ }
3514
+ },
3515
+ "views": {},
3516
+ "enums": {},
3517
+ "_meta": {
3518
+ "schemas": {},
3519
+ "tables": {},
3520
+ "columns": {}
3521
+ },
3522
+ "internal": {
3523
+ "indexes": {
3524
+ "idx_threads_workspace_thread_state": {
3525
+ "columns": {
3526
+ "json_extract(metadata, '$.threadTitle.state')": {
3527
+ "isExpression": true
3528
+ }
3529
+ }
3530
+ },
3531
+ "idx_threads_workspace_thread_priority": {
3532
+ "columns": {
3533
+ "json_extract(metadata, '$.threadTitle.priority')": {
3534
+ "isExpression": true
3535
+ }
3536
+ }
3537
+ },
3538
+ "idx_notifications_ws_created": {
3539
+ "columns": {
3540
+ "\"created_at\" DESC": {
3541
+ "isExpression": true
3542
+ }
3543
+ }
3544
+ }
3545
+ }
3546
+ }
3547
+ }