@crewx/sdk 0.9.0-rc.16 → 0.9.0-rc.161

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