@orthacms/copilot-server 0.0.0-reserve.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/dist/index.d.ts +24 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +48 -0
  6. package/dist/lib/chat/application/appliers-registrar.d.ts +16 -0
  7. package/dist/lib/chat/application/appliers-registrar.d.ts.map +1 -0
  8. package/dist/lib/chat/application/appliers-registrar.js +50 -0
  9. package/dist/lib/chat/application/capability-profile.service.d.ts +43 -0
  10. package/dist/lib/chat/application/capability-profile.service.d.ts.map +1 -0
  11. package/dist/lib/chat/application/capability-profile.service.js +75 -0
  12. package/dist/lib/chat/application/content-type-summary.service.d.ts +32 -0
  13. package/dist/lib/chat/application/content-type-summary.service.d.ts.map +1 -0
  14. package/dist/lib/chat/application/content-type-summary.service.js +64 -0
  15. package/dist/lib/chat/application/decide-proposal.service.d.ts +80 -0
  16. package/dist/lib/chat/application/decide-proposal.service.d.ts.map +1 -0
  17. package/dist/lib/chat/application/decide-proposal.service.js +112 -0
  18. package/dist/lib/chat/application/dto/create-run.dto.d.ts +138 -0
  19. package/dist/lib/chat/application/dto/create-run.dto.d.ts.map +1 -0
  20. package/dist/lib/chat/application/dto/create-run.dto.js +253 -0
  21. package/dist/lib/chat/application/dto/decide-tool-permission.dto.d.ts +20 -0
  22. package/dist/lib/chat/application/dto/decide-tool-permission.dto.d.ts.map +1 -0
  23. package/dist/lib/chat/application/dto/decide-tool-permission.dto.js +44 -0
  24. package/dist/lib/chat/application/dto/extend-tool-permission.dto.d.ts +18 -0
  25. package/dist/lib/chat/application/dto/extend-tool-permission.dto.d.ts.map +1 -0
  26. package/dist/lib/chat/application/dto/extend-tool-permission.dto.js +33 -0
  27. package/dist/lib/chat/application/dto/list-conversations-query.dto.d.ts +18 -0
  28. package/dist/lib/chat/application/dto/list-conversations-query.dto.d.ts.map +1 -0
  29. package/dist/lib/chat/application/dto/list-conversations-query.dto.js +39 -0
  30. package/dist/lib/chat/application/dto/list-proposals-query.dto.d.ts +15 -0
  31. package/dist/lib/chat/application/dto/list-proposals-query.dto.d.ts.map +1 -0
  32. package/dist/lib/chat/application/dto/list-proposals-query.dto.js +41 -0
  33. package/dist/lib/chat/application/dto/update-conversation.dto.d.ts +68 -0
  34. package/dist/lib/chat/application/dto/update-conversation.dto.d.ts.map +1 -0
  35. package/dist/lib/chat/application/dto/update-conversation.dto.js +115 -0
  36. package/dist/lib/chat/application/proposal-applier.registry.d.ts +27 -0
  37. package/dist/lib/chat/application/proposal-applier.registry.d.ts.map +1 -0
  38. package/dist/lib/chat/application/proposal-applier.registry.js +62 -0
  39. package/dist/lib/chat/application/run-engine.service.d.ts +243 -0
  40. package/dist/lib/chat/application/run-engine.service.d.ts.map +1 -0
  41. package/dist/lib/chat/application/run-engine.service.js +1058 -0
  42. package/dist/lib/chat/application/summarize-tool-output.d.ts +15 -0
  43. package/dist/lib/chat/application/summarize-tool-output.d.ts.map +1 -0
  44. package/dist/lib/chat/application/summarize-tool-output.js +61 -0
  45. package/dist/lib/chat/application/system-prompt.d.ts +81 -0
  46. package/dist/lib/chat/application/system-prompt.d.ts.map +1 -0
  47. package/dist/lib/chat/application/system-prompt.js +477 -0
  48. package/dist/lib/chat/application/tool-permission.broker.d.ts +118 -0
  49. package/dist/lib/chat/application/tool-permission.broker.d.ts.map +1 -0
  50. package/dist/lib/chat/application/tool-permission.broker.js +221 -0
  51. package/dist/lib/chat/http/controllers/create-run.controller.d.ts +30 -0
  52. package/dist/lib/chat/http/controllers/create-run.controller.d.ts.map +1 -0
  53. package/dist/lib/chat/http/controllers/create-run.controller.js +159 -0
  54. package/dist/lib/chat/http/controllers/get-conversation.controller.d.ts +22 -0
  55. package/dist/lib/chat/http/controllers/get-conversation.controller.d.ts.map +1 -0
  56. package/dist/lib/chat/http/controllers/get-conversation.controller.js +50 -0
  57. package/dist/lib/chat/http/controllers/list-conversations.controller.d.ts +20 -0
  58. package/dist/lib/chat/http/controllers/list-conversations.controller.d.ts.map +1 -0
  59. package/dist/lib/chat/http/controllers/list-conversations.controller.js +47 -0
  60. package/dist/lib/chat/http/controllers/list-models.controller.d.ts +35 -0
  61. package/dist/lib/chat/http/controllers/list-models.controller.d.ts.map +1 -0
  62. package/dist/lib/chat/http/controllers/list-models.controller.js +48 -0
  63. package/dist/lib/chat/http/controllers/proposals.controller.d.ts +43 -0
  64. package/dist/lib/chat/http/controllers/proposals.controller.d.ts.map +1 -0
  65. package/dist/lib/chat/http/controllers/proposals.controller.js +98 -0
  66. package/dist/lib/chat/http/controllers/tool-permission.controller.d.ts +57 -0
  67. package/dist/lib/chat/http/controllers/tool-permission.controller.d.ts.map +1 -0
  68. package/dist/lib/chat/http/controllers/tool-permission.controller.js +116 -0
  69. package/dist/lib/chat/http/controllers/update-conversation.controller.d.ts +37 -0
  70. package/dist/lib/chat/http/controllers/update-conversation.controller.d.ts.map +1 -0
  71. package/dist/lib/chat/http/controllers/update-conversation.controller.js +108 -0
  72. package/dist/lib/chat/http/sse-stream.d.ts +41 -0
  73. package/dist/lib/chat/http/sse-stream.d.ts.map +1 -0
  74. package/dist/lib/chat/http/sse-stream.js +95 -0
  75. package/dist/lib/chat/infrastructure/persistence/conversation.repository.d.ts +159 -0
  76. package/dist/lib/chat/infrastructure/persistence/conversation.repository.d.ts.map +1 -0
  77. package/dist/lib/chat/infrastructure/persistence/conversation.repository.js +249 -0
  78. package/dist/lib/chat/infrastructure/persistence/derive-title.d.ts +13 -0
  79. package/dist/lib/chat/infrastructure/persistence/derive-title.d.ts.map +1 -0
  80. package/dist/lib/chat/infrastructure/persistence/derive-title.js +35 -0
  81. package/dist/lib/chat/infrastructure/persistence/proposal.repository.d.ts +86 -0
  82. package/dist/lib/chat/infrastructure/persistence/proposal.repository.d.ts.map +1 -0
  83. package/dist/lib/chat/infrastructure/persistence/proposal.repository.js +152 -0
  84. package/dist/lib/chat/infrastructure/schema/conversations.d.ts +189 -0
  85. package/dist/lib/chat/infrastructure/schema/conversations.d.ts.map +1 -0
  86. package/dist/lib/chat/infrastructure/schema/conversations.js +100 -0
  87. package/dist/lib/chat/infrastructure/schema/external-refs.d.ts +67 -0
  88. package/dist/lib/chat/infrastructure/schema/external-refs.d.ts.map +1 -0
  89. package/dist/lib/chat/infrastructure/schema/external-refs.js +28 -0
  90. package/dist/lib/chat/infrastructure/schema/index.d.ts +5 -0
  91. package/dist/lib/chat/infrastructure/schema/index.d.ts.map +1 -0
  92. package/dist/lib/chat/infrastructure/schema/index.js +12 -0
  93. package/dist/lib/chat/infrastructure/schema/messages.d.ts +264 -0
  94. package/dist/lib/chat/infrastructure/schema/messages.d.ts.map +1 -0
  95. package/dist/lib/chat/infrastructure/schema/messages.js +96 -0
  96. package/dist/lib/chat/infrastructure/schema/proposals.d.ts +328 -0
  97. package/dist/lib/chat/infrastructure/schema/proposals.d.ts.map +1 -0
  98. package/dist/lib/chat/infrastructure/schema/proposals.js +87 -0
  99. package/dist/lib/chat/infrastructure/schema/tool-calls.d.ts +203 -0
  100. package/dist/lib/chat/infrastructure/schema/tool-calls.d.ts.map +1 -0
  101. package/dist/lib/chat/infrastructure/schema/tool-calls.js +50 -0
  102. package/dist/lib/copilot.module.d.ts +30 -0
  103. package/dist/lib/copilot.module.d.ts.map +1 -0
  104. package/dist/lib/copilot.module.js +146 -0
  105. package/dist/lib/copilot.tokens.d.ts +34 -0
  106. package/dist/lib/copilot.tokens.d.ts.map +1 -0
  107. package/dist/lib/copilot.tokens.js +38 -0
  108. package/dist/lib/infrastructure/model-registry.d.ts +22 -0
  109. package/dist/lib/infrastructure/model-registry.d.ts.map +1 -0
  110. package/dist/lib/infrastructure/model-registry.js +54 -0
  111. package/dist/lib/skills/application/dto/create-skill.dto.d.ts +36 -0
  112. package/dist/lib/skills/application/dto/create-skill.dto.d.ts.map +1 -0
  113. package/dist/lib/skills/application/dto/create-skill.dto.js +106 -0
  114. package/dist/lib/skills/application/dto/update-skill.dto.d.ts +28 -0
  115. package/dist/lib/skills/application/dto/update-skill.dto.d.ts.map +1 -0
  116. package/dist/lib/skills/application/dto/update-skill.dto.js +96 -0
  117. package/dist/lib/skills/application/skill-catalog.service.d.ts +97 -0
  118. package/dist/lib/skills/application/skill-catalog.service.d.ts.map +1 -0
  119. package/dist/lib/skills/application/skill-catalog.service.js +157 -0
  120. package/dist/lib/skills/http/controllers/list-skills.controller.d.ts +19 -0
  121. package/dist/lib/skills/http/controllers/list-skills.controller.d.ts.map +1 -0
  122. package/dist/lib/skills/http/controllers/list-skills.controller.js +50 -0
  123. package/dist/lib/skills/http/controllers/manage-skills.controller.d.ts +64 -0
  124. package/dist/lib/skills/http/controllers/manage-skills.controller.d.ts.map +1 -0
  125. package/dist/lib/skills/http/controllers/manage-skills.controller.js +182 -0
  126. package/dist/lib/skills/infrastructure/persistence/skill.repository.d.ts +78 -0
  127. package/dist/lib/skills/infrastructure/persistence/skill.repository.d.ts.map +1 -0
  128. package/dist/lib/skills/infrastructure/persistence/skill.repository.js +116 -0
  129. package/dist/lib/skills/infrastructure/schema/index.d.ts +2 -0
  130. package/dist/lib/skills/infrastructure/schema/index.d.ts.map +1 -0
  131. package/dist/lib/skills/infrastructure/schema/index.js +6 -0
  132. package/dist/lib/skills/infrastructure/schema/skills.d.ts +212 -0
  133. package/dist/lib/skills/infrastructure/schema/skills.d.ts.map +1 -0
  134. package/dist/lib/skills/infrastructure/schema/skills.js +78 -0
  135. package/dist/lib/types/copilot-config.d.ts +55 -0
  136. package/dist/lib/types/copilot-config.d.ts.map +1 -0
  137. package/dist/lib/types/copilot-config.js +2 -0
  138. package/dist/lib/utils/copilot-plugin.d.ts +66 -0
  139. package/dist/lib/utils/copilot-plugin.d.ts.map +1 -0
  140. package/dist/lib/utils/copilot-plugin.js +87 -0
  141. package/migrations/0000_copilot_chat.sql +48 -0
  142. package/migrations/0001_proposals.sql +34 -0
  143. package/migrations/0002_drop_workspace_policies.sql +1 -0
  144. package/migrations/0003_conversation_allowed_tools.sql +1 -0
  145. package/migrations/0004_message_attachments.sql +1 -0
  146. package/migrations/0005_skills.sql +19 -0
  147. package/migrations/0006_conversation_model_choice.sql +1 -0
  148. package/migrations/meta/0000_snapshot.json +390 -0
  149. package/migrations/meta/0001_snapshot.json +657 -0
  150. package/migrations/meta/0002_snapshot.json +610 -0
  151. package/migrations/meta/0003_snapshot.json +617 -0
  152. package/migrations/meta/0004_snapshot.json +623 -0
  153. package/migrations/meta/0005_snapshot.json +771 -0
  154. package/migrations/meta/0006_snapshot.json +777 -0
  155. package/migrations/meta/_journal.json +55 -0
  156. package/package.json +46 -0
@@ -0,0 +1,657 @@
1
+ {
2
+ "id": "6699c7de-1558-478d-8442-2226d42b1482",
3
+ "prevId": "33508968-ba62-47b7-8bc0-047bf3dcc85e",
4
+ "version": "7",
5
+ "dialect": "postgresql",
6
+ "tables": {
7
+ "public.copilot_conversations": {
8
+ "name": "copilot_conversations",
9
+ "schema": "",
10
+ "columns": {
11
+ "id": {
12
+ "name": "id",
13
+ "type": "uuid",
14
+ "primaryKey": true,
15
+ "notNull": true,
16
+ "default": "gen_random_uuid()"
17
+ },
18
+ "user_id": {
19
+ "name": "user_id",
20
+ "type": "uuid",
21
+ "primaryKey": false,
22
+ "notNull": true
23
+ },
24
+ "workspace_id": {
25
+ "name": "workspace_id",
26
+ "type": "uuid",
27
+ "primaryKey": false,
28
+ "notNull": true
29
+ },
30
+ "title": {
31
+ "name": "title",
32
+ "type": "text",
33
+ "primaryKey": false,
34
+ "notNull": false
35
+ },
36
+ "surface": {
37
+ "name": "surface",
38
+ "type": "text",
39
+ "primaryKey": false,
40
+ "notNull": true,
41
+ "default": "'chat'"
42
+ },
43
+ "archived": {
44
+ "name": "archived",
45
+ "type": "boolean",
46
+ "primaryKey": false,
47
+ "notNull": true,
48
+ "default": false
49
+ },
50
+ "created_at": {
51
+ "name": "created_at",
52
+ "type": "timestamp with time zone",
53
+ "primaryKey": false,
54
+ "notNull": true,
55
+ "default": "now()"
56
+ },
57
+ "updated_at": {
58
+ "name": "updated_at",
59
+ "type": "timestamp with time zone",
60
+ "primaryKey": false,
61
+ "notNull": true,
62
+ "default": "now()"
63
+ }
64
+ },
65
+ "indexes": {
66
+ "copilot_conversations_owner_idx": {
67
+ "name": "copilot_conversations_owner_idx",
68
+ "columns": [
69
+ {
70
+ "expression": "user_id",
71
+ "isExpression": false,
72
+ "asc": true,
73
+ "nulls": "last"
74
+ },
75
+ {
76
+ "expression": "workspace_id",
77
+ "isExpression": false,
78
+ "asc": true,
79
+ "nulls": "last"
80
+ },
81
+ {
82
+ "expression": "updated_at",
83
+ "isExpression": false,
84
+ "asc": true,
85
+ "nulls": "last"
86
+ }
87
+ ],
88
+ "isUnique": false,
89
+ "concurrently": false,
90
+ "method": "btree",
91
+ "with": {}
92
+ }
93
+ },
94
+ "foreignKeys": {
95
+ "copilot_conversations_user_id_users_id_fk": {
96
+ "name": "copilot_conversations_user_id_users_id_fk",
97
+ "tableFrom": "copilot_conversations",
98
+ "tableTo": "users",
99
+ "columnsFrom": [
100
+ "user_id"
101
+ ],
102
+ "columnsTo": [
103
+ "id"
104
+ ],
105
+ "onDelete": "cascade",
106
+ "onUpdate": "no action"
107
+ },
108
+ "copilot_conversations_workspace_id_workspaces_id_fk": {
109
+ "name": "copilot_conversations_workspace_id_workspaces_id_fk",
110
+ "tableFrom": "copilot_conversations",
111
+ "tableTo": "workspaces",
112
+ "columnsFrom": [
113
+ "workspace_id"
114
+ ],
115
+ "columnsTo": [
116
+ "id"
117
+ ],
118
+ "onDelete": "cascade",
119
+ "onUpdate": "no action"
120
+ }
121
+ },
122
+ "compositePrimaryKeys": {},
123
+ "uniqueConstraints": {},
124
+ "policies": {},
125
+ "checkConstraints": {},
126
+ "isRLSEnabled": false
127
+ },
128
+ "public.copilot_messages": {
129
+ "name": "copilot_messages",
130
+ "schema": "",
131
+ "columns": {
132
+ "id": {
133
+ "name": "id",
134
+ "type": "uuid",
135
+ "primaryKey": true,
136
+ "notNull": true,
137
+ "default": "gen_random_uuid()"
138
+ },
139
+ "conversation_id": {
140
+ "name": "conversation_id",
141
+ "type": "uuid",
142
+ "primaryKey": false,
143
+ "notNull": true
144
+ },
145
+ "run_id": {
146
+ "name": "run_id",
147
+ "type": "uuid",
148
+ "primaryKey": false,
149
+ "notNull": true
150
+ },
151
+ "role": {
152
+ "name": "role",
153
+ "type": "copilot_message_role",
154
+ "typeSchema": "public",
155
+ "primaryKey": false,
156
+ "notNull": true
157
+ },
158
+ "content": {
159
+ "name": "content",
160
+ "type": "jsonb",
161
+ "primaryKey": false,
162
+ "notNull": true
163
+ },
164
+ "model": {
165
+ "name": "model",
166
+ "type": "text",
167
+ "primaryKey": false,
168
+ "notNull": false
169
+ },
170
+ "provider": {
171
+ "name": "provider",
172
+ "type": "text",
173
+ "primaryKey": false,
174
+ "notNull": false
175
+ },
176
+ "stop_reason": {
177
+ "name": "stop_reason",
178
+ "type": "text",
179
+ "primaryKey": false,
180
+ "notNull": false
181
+ },
182
+ "input_tokens": {
183
+ "name": "input_tokens",
184
+ "type": "integer",
185
+ "primaryKey": false,
186
+ "notNull": false
187
+ },
188
+ "output_tokens": {
189
+ "name": "output_tokens",
190
+ "type": "integer",
191
+ "primaryKey": false,
192
+ "notNull": false
193
+ },
194
+ "position": {
195
+ "name": "position",
196
+ "type": "integer",
197
+ "primaryKey": false,
198
+ "notNull": true
199
+ },
200
+ "created_at": {
201
+ "name": "created_at",
202
+ "type": "timestamp with time zone",
203
+ "primaryKey": false,
204
+ "notNull": true,
205
+ "default": "now()"
206
+ }
207
+ },
208
+ "indexes": {
209
+ "copilot_messages_thread_idx": {
210
+ "name": "copilot_messages_thread_idx",
211
+ "columns": [
212
+ {
213
+ "expression": "conversation_id",
214
+ "isExpression": false,
215
+ "asc": true,
216
+ "nulls": "last"
217
+ },
218
+ {
219
+ "expression": "position",
220
+ "isExpression": false,
221
+ "asc": true,
222
+ "nulls": "last"
223
+ }
224
+ ],
225
+ "isUnique": false,
226
+ "concurrently": false,
227
+ "method": "btree",
228
+ "with": {}
229
+ }
230
+ },
231
+ "foreignKeys": {
232
+ "copilot_messages_conversation_id_copilot_conversations_id_fk": {
233
+ "name": "copilot_messages_conversation_id_copilot_conversations_id_fk",
234
+ "tableFrom": "copilot_messages",
235
+ "tableTo": "copilot_conversations",
236
+ "columnsFrom": [
237
+ "conversation_id"
238
+ ],
239
+ "columnsTo": [
240
+ "id"
241
+ ],
242
+ "onDelete": "cascade",
243
+ "onUpdate": "no action"
244
+ }
245
+ },
246
+ "compositePrimaryKeys": {},
247
+ "uniqueConstraints": {},
248
+ "policies": {},
249
+ "checkConstraints": {},
250
+ "isRLSEnabled": false
251
+ },
252
+ "public.copilot_proposals": {
253
+ "name": "copilot_proposals",
254
+ "schema": "",
255
+ "columns": {
256
+ "id": {
257
+ "name": "id",
258
+ "type": "uuid",
259
+ "primaryKey": true,
260
+ "notNull": true,
261
+ "default": "gen_random_uuid()"
262
+ },
263
+ "conversation_id": {
264
+ "name": "conversation_id",
265
+ "type": "uuid",
266
+ "primaryKey": false,
267
+ "notNull": true
268
+ },
269
+ "run_id": {
270
+ "name": "run_id",
271
+ "type": "uuid",
272
+ "primaryKey": false,
273
+ "notNull": true
274
+ },
275
+ "tool_call_id": {
276
+ "name": "tool_call_id",
277
+ "type": "text",
278
+ "primaryKey": false,
279
+ "notNull": true
280
+ },
281
+ "tool_name": {
282
+ "name": "tool_name",
283
+ "type": "text",
284
+ "primaryKey": false,
285
+ "notNull": true
286
+ },
287
+ "kind": {
288
+ "name": "kind",
289
+ "type": "text",
290
+ "primaryKey": false,
291
+ "notNull": true
292
+ },
293
+ "workspace_id": {
294
+ "name": "workspace_id",
295
+ "type": "uuid",
296
+ "primaryKey": false,
297
+ "notNull": true
298
+ },
299
+ "created_by": {
300
+ "name": "created_by",
301
+ "type": "uuid",
302
+ "primaryKey": false,
303
+ "notNull": true
304
+ },
305
+ "target": {
306
+ "name": "target",
307
+ "type": "jsonb",
308
+ "primaryKey": false,
309
+ "notNull": true
310
+ },
311
+ "patch": {
312
+ "name": "patch",
313
+ "type": "jsonb",
314
+ "primaryKey": false,
315
+ "notNull": true
316
+ },
317
+ "summary": {
318
+ "name": "summary",
319
+ "type": "text",
320
+ "primaryKey": false,
321
+ "notNull": true
322
+ },
323
+ "changes": {
324
+ "name": "changes",
325
+ "type": "jsonb",
326
+ "primaryKey": false,
327
+ "notNull": false
328
+ },
329
+ "status": {
330
+ "name": "status",
331
+ "type": "text",
332
+ "primaryKey": false,
333
+ "notNull": true,
334
+ "default": "'pending'"
335
+ },
336
+ "decided_by": {
337
+ "name": "decided_by",
338
+ "type": "uuid",
339
+ "primaryKey": false,
340
+ "notNull": false
341
+ },
342
+ "decided_at": {
343
+ "name": "decided_at",
344
+ "type": "timestamp with time zone",
345
+ "primaryKey": false,
346
+ "notNull": false
347
+ },
348
+ "result": {
349
+ "name": "result",
350
+ "type": "jsonb",
351
+ "primaryKey": false,
352
+ "notNull": false
353
+ },
354
+ "error": {
355
+ "name": "error",
356
+ "type": "text",
357
+ "primaryKey": false,
358
+ "notNull": false
359
+ },
360
+ "created_at": {
361
+ "name": "created_at",
362
+ "type": "timestamp with time zone",
363
+ "primaryKey": false,
364
+ "notNull": true,
365
+ "default": "now()"
366
+ }
367
+ },
368
+ "indexes": {
369
+ "copilot_proposals_workspace_idx": {
370
+ "name": "copilot_proposals_workspace_idx",
371
+ "columns": [
372
+ {
373
+ "expression": "workspace_id",
374
+ "isExpression": false,
375
+ "asc": true,
376
+ "nulls": "last"
377
+ },
378
+ {
379
+ "expression": "status",
380
+ "isExpression": false,
381
+ "asc": true,
382
+ "nulls": "last"
383
+ },
384
+ {
385
+ "expression": "created_at",
386
+ "isExpression": false,
387
+ "asc": true,
388
+ "nulls": "last"
389
+ }
390
+ ],
391
+ "isUnique": false,
392
+ "concurrently": false,
393
+ "method": "btree",
394
+ "with": {}
395
+ },
396
+ "copilot_proposals_run_idx": {
397
+ "name": "copilot_proposals_run_idx",
398
+ "columns": [
399
+ {
400
+ "expression": "run_id",
401
+ "isExpression": false,
402
+ "asc": true,
403
+ "nulls": "last"
404
+ }
405
+ ],
406
+ "isUnique": false,
407
+ "concurrently": false,
408
+ "method": "btree",
409
+ "with": {}
410
+ }
411
+ },
412
+ "foreignKeys": {
413
+ "copilot_proposals_conversation_id_copilot_conversations_id_fk": {
414
+ "name": "copilot_proposals_conversation_id_copilot_conversations_id_fk",
415
+ "tableFrom": "copilot_proposals",
416
+ "tableTo": "copilot_conversations",
417
+ "columnsFrom": [
418
+ "conversation_id"
419
+ ],
420
+ "columnsTo": [
421
+ "id"
422
+ ],
423
+ "onDelete": "cascade",
424
+ "onUpdate": "no action"
425
+ },
426
+ "copilot_proposals_workspace_id_workspaces_id_fk": {
427
+ "name": "copilot_proposals_workspace_id_workspaces_id_fk",
428
+ "tableFrom": "copilot_proposals",
429
+ "tableTo": "workspaces",
430
+ "columnsFrom": [
431
+ "workspace_id"
432
+ ],
433
+ "columnsTo": [
434
+ "id"
435
+ ],
436
+ "onDelete": "cascade",
437
+ "onUpdate": "no action"
438
+ },
439
+ "copilot_proposals_created_by_users_id_fk": {
440
+ "name": "copilot_proposals_created_by_users_id_fk",
441
+ "tableFrom": "copilot_proposals",
442
+ "tableTo": "users",
443
+ "columnsFrom": [
444
+ "created_by"
445
+ ],
446
+ "columnsTo": [
447
+ "id"
448
+ ],
449
+ "onDelete": "cascade",
450
+ "onUpdate": "no action"
451
+ },
452
+ "copilot_proposals_decided_by_users_id_fk": {
453
+ "name": "copilot_proposals_decided_by_users_id_fk",
454
+ "tableFrom": "copilot_proposals",
455
+ "tableTo": "users",
456
+ "columnsFrom": [
457
+ "decided_by"
458
+ ],
459
+ "columnsTo": [
460
+ "id"
461
+ ],
462
+ "onDelete": "set null",
463
+ "onUpdate": "no action"
464
+ }
465
+ },
466
+ "compositePrimaryKeys": {},
467
+ "uniqueConstraints": {},
468
+ "policies": {},
469
+ "checkConstraints": {},
470
+ "isRLSEnabled": false
471
+ },
472
+ "public.copilot_tool_calls": {
473
+ "name": "copilot_tool_calls",
474
+ "schema": "",
475
+ "columns": {
476
+ "id": {
477
+ "name": "id",
478
+ "type": "uuid",
479
+ "primaryKey": true,
480
+ "notNull": true,
481
+ "default": "gen_random_uuid()"
482
+ },
483
+ "conversation_id": {
484
+ "name": "conversation_id",
485
+ "type": "uuid",
486
+ "primaryKey": false,
487
+ "notNull": true
488
+ },
489
+ "run_id": {
490
+ "name": "run_id",
491
+ "type": "uuid",
492
+ "primaryKey": false,
493
+ "notNull": true
494
+ },
495
+ "call_id": {
496
+ "name": "call_id",
497
+ "type": "text",
498
+ "primaryKey": false,
499
+ "notNull": true
500
+ },
501
+ "name": {
502
+ "name": "name",
503
+ "type": "text",
504
+ "primaryKey": false,
505
+ "notNull": true
506
+ },
507
+ "input": {
508
+ "name": "input",
509
+ "type": "jsonb",
510
+ "primaryKey": false,
511
+ "notNull": false
512
+ },
513
+ "output_summary": {
514
+ "name": "output_summary",
515
+ "type": "text",
516
+ "primaryKey": false,
517
+ "notNull": false
518
+ },
519
+ "ok": {
520
+ "name": "ok",
521
+ "type": "boolean",
522
+ "primaryKey": false,
523
+ "notNull": true
524
+ },
525
+ "error": {
526
+ "name": "error",
527
+ "type": "text",
528
+ "primaryKey": false,
529
+ "notNull": false
530
+ },
531
+ "duration_ms": {
532
+ "name": "duration_ms",
533
+ "type": "integer",
534
+ "primaryKey": false,
535
+ "notNull": true
536
+ },
537
+ "created_at": {
538
+ "name": "created_at",
539
+ "type": "timestamp with time zone",
540
+ "primaryKey": false,
541
+ "notNull": true,
542
+ "default": "now()"
543
+ }
544
+ },
545
+ "indexes": {
546
+ "copilot_tool_calls_run_idx": {
547
+ "name": "copilot_tool_calls_run_idx",
548
+ "columns": [
549
+ {
550
+ "expression": "run_id",
551
+ "isExpression": false,
552
+ "asc": true,
553
+ "nulls": "last"
554
+ },
555
+ {
556
+ "expression": "created_at",
557
+ "isExpression": false,
558
+ "asc": true,
559
+ "nulls": "last"
560
+ }
561
+ ],
562
+ "isUnique": false,
563
+ "concurrently": false,
564
+ "method": "btree",
565
+ "with": {}
566
+ }
567
+ },
568
+ "foreignKeys": {
569
+ "copilot_tool_calls_conversation_id_copilot_conversations_id_fk": {
570
+ "name": "copilot_tool_calls_conversation_id_copilot_conversations_id_fk",
571
+ "tableFrom": "copilot_tool_calls",
572
+ "tableTo": "copilot_conversations",
573
+ "columnsFrom": [
574
+ "conversation_id"
575
+ ],
576
+ "columnsTo": [
577
+ "id"
578
+ ],
579
+ "onDelete": "cascade",
580
+ "onUpdate": "no action"
581
+ }
582
+ },
583
+ "compositePrimaryKeys": {},
584
+ "uniqueConstraints": {},
585
+ "policies": {},
586
+ "checkConstraints": {},
587
+ "isRLSEnabled": false
588
+ },
589
+ "public.copilot_workspace_policies": {
590
+ "name": "copilot_workspace_policies",
591
+ "schema": "",
592
+ "columns": {
593
+ "workspace_id": {
594
+ "name": "workspace_id",
595
+ "type": "uuid",
596
+ "primaryKey": true,
597
+ "notNull": true
598
+ },
599
+ "auto_apply_tools": {
600
+ "name": "auto_apply_tools",
601
+ "type": "jsonb",
602
+ "primaryKey": false,
603
+ "notNull": true,
604
+ "default": "'[]'::jsonb"
605
+ },
606
+ "updated_at": {
607
+ "name": "updated_at",
608
+ "type": "timestamp with time zone",
609
+ "primaryKey": false,
610
+ "notNull": true,
611
+ "default": "now()"
612
+ }
613
+ },
614
+ "indexes": {},
615
+ "foreignKeys": {
616
+ "copilot_workspace_policies_workspace_id_workspaces_id_fk": {
617
+ "name": "copilot_workspace_policies_workspace_id_workspaces_id_fk",
618
+ "tableFrom": "copilot_workspace_policies",
619
+ "tableTo": "workspaces",
620
+ "columnsFrom": [
621
+ "workspace_id"
622
+ ],
623
+ "columnsTo": [
624
+ "id"
625
+ ],
626
+ "onDelete": "cascade",
627
+ "onUpdate": "no action"
628
+ }
629
+ },
630
+ "compositePrimaryKeys": {},
631
+ "uniqueConstraints": {},
632
+ "policies": {},
633
+ "checkConstraints": {},
634
+ "isRLSEnabled": false
635
+ }
636
+ },
637
+ "enums": {
638
+ "public.copilot_message_role": {
639
+ "name": "copilot_message_role",
640
+ "schema": "public",
641
+ "values": [
642
+ "user",
643
+ "assistant"
644
+ ]
645
+ }
646
+ },
647
+ "schemas": {},
648
+ "sequences": {},
649
+ "roles": {},
650
+ "policies": {},
651
+ "views": {},
652
+ "_meta": {
653
+ "columns": {},
654
+ "schemas": {},
655
+ "tables": {}
656
+ }
657
+ }