@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,617 @@
1
+ {
2
+ "id": "b8029c22-d2db-4ee2-bf7e-bec84f545a44",
3
+ "prevId": "dfd2bfcd-d83b-4b05-9b9e-bdab3f3f0ad6",
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
+ "allowed_tools": {
51
+ "name": "allowed_tools",
52
+ "type": "jsonb",
53
+ "primaryKey": false,
54
+ "notNull": true,
55
+ "default": "'[]'::jsonb"
56
+ },
57
+ "created_at": {
58
+ "name": "created_at",
59
+ "type": "timestamp with time zone",
60
+ "primaryKey": false,
61
+ "notNull": true,
62
+ "default": "now()"
63
+ },
64
+ "updated_at": {
65
+ "name": "updated_at",
66
+ "type": "timestamp with time zone",
67
+ "primaryKey": false,
68
+ "notNull": true,
69
+ "default": "now()"
70
+ }
71
+ },
72
+ "indexes": {
73
+ "copilot_conversations_owner_idx": {
74
+ "name": "copilot_conversations_owner_idx",
75
+ "columns": [
76
+ {
77
+ "expression": "user_id",
78
+ "isExpression": false,
79
+ "asc": true,
80
+ "nulls": "last"
81
+ },
82
+ {
83
+ "expression": "workspace_id",
84
+ "isExpression": false,
85
+ "asc": true,
86
+ "nulls": "last"
87
+ },
88
+ {
89
+ "expression": "updated_at",
90
+ "isExpression": false,
91
+ "asc": true,
92
+ "nulls": "last"
93
+ }
94
+ ],
95
+ "isUnique": false,
96
+ "concurrently": false,
97
+ "method": "btree",
98
+ "with": {}
99
+ }
100
+ },
101
+ "foreignKeys": {
102
+ "copilot_conversations_user_id_users_id_fk": {
103
+ "name": "copilot_conversations_user_id_users_id_fk",
104
+ "tableFrom": "copilot_conversations",
105
+ "tableTo": "users",
106
+ "columnsFrom": [
107
+ "user_id"
108
+ ],
109
+ "columnsTo": [
110
+ "id"
111
+ ],
112
+ "onDelete": "cascade",
113
+ "onUpdate": "no action"
114
+ },
115
+ "copilot_conversations_workspace_id_workspaces_id_fk": {
116
+ "name": "copilot_conversations_workspace_id_workspaces_id_fk",
117
+ "tableFrom": "copilot_conversations",
118
+ "tableTo": "workspaces",
119
+ "columnsFrom": [
120
+ "workspace_id"
121
+ ],
122
+ "columnsTo": [
123
+ "id"
124
+ ],
125
+ "onDelete": "cascade",
126
+ "onUpdate": "no action"
127
+ }
128
+ },
129
+ "compositePrimaryKeys": {},
130
+ "uniqueConstraints": {},
131
+ "policies": {},
132
+ "checkConstraints": {},
133
+ "isRLSEnabled": false
134
+ },
135
+ "public.copilot_messages": {
136
+ "name": "copilot_messages",
137
+ "schema": "",
138
+ "columns": {
139
+ "id": {
140
+ "name": "id",
141
+ "type": "uuid",
142
+ "primaryKey": true,
143
+ "notNull": true,
144
+ "default": "gen_random_uuid()"
145
+ },
146
+ "conversation_id": {
147
+ "name": "conversation_id",
148
+ "type": "uuid",
149
+ "primaryKey": false,
150
+ "notNull": true
151
+ },
152
+ "run_id": {
153
+ "name": "run_id",
154
+ "type": "uuid",
155
+ "primaryKey": false,
156
+ "notNull": true
157
+ },
158
+ "role": {
159
+ "name": "role",
160
+ "type": "copilot_message_role",
161
+ "typeSchema": "public",
162
+ "primaryKey": false,
163
+ "notNull": true
164
+ },
165
+ "content": {
166
+ "name": "content",
167
+ "type": "jsonb",
168
+ "primaryKey": false,
169
+ "notNull": true
170
+ },
171
+ "model": {
172
+ "name": "model",
173
+ "type": "text",
174
+ "primaryKey": false,
175
+ "notNull": false
176
+ },
177
+ "provider": {
178
+ "name": "provider",
179
+ "type": "text",
180
+ "primaryKey": false,
181
+ "notNull": false
182
+ },
183
+ "stop_reason": {
184
+ "name": "stop_reason",
185
+ "type": "text",
186
+ "primaryKey": false,
187
+ "notNull": false
188
+ },
189
+ "input_tokens": {
190
+ "name": "input_tokens",
191
+ "type": "integer",
192
+ "primaryKey": false,
193
+ "notNull": false
194
+ },
195
+ "output_tokens": {
196
+ "name": "output_tokens",
197
+ "type": "integer",
198
+ "primaryKey": false,
199
+ "notNull": false
200
+ },
201
+ "position": {
202
+ "name": "position",
203
+ "type": "integer",
204
+ "primaryKey": false,
205
+ "notNull": true
206
+ },
207
+ "created_at": {
208
+ "name": "created_at",
209
+ "type": "timestamp with time zone",
210
+ "primaryKey": false,
211
+ "notNull": true,
212
+ "default": "now()"
213
+ }
214
+ },
215
+ "indexes": {
216
+ "copilot_messages_thread_idx": {
217
+ "name": "copilot_messages_thread_idx",
218
+ "columns": [
219
+ {
220
+ "expression": "conversation_id",
221
+ "isExpression": false,
222
+ "asc": true,
223
+ "nulls": "last"
224
+ },
225
+ {
226
+ "expression": "position",
227
+ "isExpression": false,
228
+ "asc": true,
229
+ "nulls": "last"
230
+ }
231
+ ],
232
+ "isUnique": false,
233
+ "concurrently": false,
234
+ "method": "btree",
235
+ "with": {}
236
+ }
237
+ },
238
+ "foreignKeys": {
239
+ "copilot_messages_conversation_id_copilot_conversations_id_fk": {
240
+ "name": "copilot_messages_conversation_id_copilot_conversations_id_fk",
241
+ "tableFrom": "copilot_messages",
242
+ "tableTo": "copilot_conversations",
243
+ "columnsFrom": [
244
+ "conversation_id"
245
+ ],
246
+ "columnsTo": [
247
+ "id"
248
+ ],
249
+ "onDelete": "cascade",
250
+ "onUpdate": "no action"
251
+ }
252
+ },
253
+ "compositePrimaryKeys": {},
254
+ "uniqueConstraints": {},
255
+ "policies": {},
256
+ "checkConstraints": {},
257
+ "isRLSEnabled": false
258
+ },
259
+ "public.copilot_proposals": {
260
+ "name": "copilot_proposals",
261
+ "schema": "",
262
+ "columns": {
263
+ "id": {
264
+ "name": "id",
265
+ "type": "uuid",
266
+ "primaryKey": true,
267
+ "notNull": true,
268
+ "default": "gen_random_uuid()"
269
+ },
270
+ "conversation_id": {
271
+ "name": "conversation_id",
272
+ "type": "uuid",
273
+ "primaryKey": false,
274
+ "notNull": true
275
+ },
276
+ "run_id": {
277
+ "name": "run_id",
278
+ "type": "uuid",
279
+ "primaryKey": false,
280
+ "notNull": true
281
+ },
282
+ "tool_call_id": {
283
+ "name": "tool_call_id",
284
+ "type": "text",
285
+ "primaryKey": false,
286
+ "notNull": true
287
+ },
288
+ "tool_name": {
289
+ "name": "tool_name",
290
+ "type": "text",
291
+ "primaryKey": false,
292
+ "notNull": true
293
+ },
294
+ "kind": {
295
+ "name": "kind",
296
+ "type": "text",
297
+ "primaryKey": false,
298
+ "notNull": true
299
+ },
300
+ "workspace_id": {
301
+ "name": "workspace_id",
302
+ "type": "uuid",
303
+ "primaryKey": false,
304
+ "notNull": true
305
+ },
306
+ "created_by": {
307
+ "name": "created_by",
308
+ "type": "uuid",
309
+ "primaryKey": false,
310
+ "notNull": true
311
+ },
312
+ "target": {
313
+ "name": "target",
314
+ "type": "jsonb",
315
+ "primaryKey": false,
316
+ "notNull": true
317
+ },
318
+ "patch": {
319
+ "name": "patch",
320
+ "type": "jsonb",
321
+ "primaryKey": false,
322
+ "notNull": true
323
+ },
324
+ "summary": {
325
+ "name": "summary",
326
+ "type": "text",
327
+ "primaryKey": false,
328
+ "notNull": true
329
+ },
330
+ "changes": {
331
+ "name": "changes",
332
+ "type": "jsonb",
333
+ "primaryKey": false,
334
+ "notNull": false
335
+ },
336
+ "status": {
337
+ "name": "status",
338
+ "type": "text",
339
+ "primaryKey": false,
340
+ "notNull": true,
341
+ "default": "'pending'"
342
+ },
343
+ "decided_by": {
344
+ "name": "decided_by",
345
+ "type": "uuid",
346
+ "primaryKey": false,
347
+ "notNull": false
348
+ },
349
+ "decided_at": {
350
+ "name": "decided_at",
351
+ "type": "timestamp with time zone",
352
+ "primaryKey": false,
353
+ "notNull": false
354
+ },
355
+ "result": {
356
+ "name": "result",
357
+ "type": "jsonb",
358
+ "primaryKey": false,
359
+ "notNull": false
360
+ },
361
+ "error": {
362
+ "name": "error",
363
+ "type": "text",
364
+ "primaryKey": false,
365
+ "notNull": false
366
+ },
367
+ "created_at": {
368
+ "name": "created_at",
369
+ "type": "timestamp with time zone",
370
+ "primaryKey": false,
371
+ "notNull": true,
372
+ "default": "now()"
373
+ }
374
+ },
375
+ "indexes": {
376
+ "copilot_proposals_workspace_idx": {
377
+ "name": "copilot_proposals_workspace_idx",
378
+ "columns": [
379
+ {
380
+ "expression": "workspace_id",
381
+ "isExpression": false,
382
+ "asc": true,
383
+ "nulls": "last"
384
+ },
385
+ {
386
+ "expression": "status",
387
+ "isExpression": false,
388
+ "asc": true,
389
+ "nulls": "last"
390
+ },
391
+ {
392
+ "expression": "created_at",
393
+ "isExpression": false,
394
+ "asc": true,
395
+ "nulls": "last"
396
+ }
397
+ ],
398
+ "isUnique": false,
399
+ "concurrently": false,
400
+ "method": "btree",
401
+ "with": {}
402
+ },
403
+ "copilot_proposals_run_idx": {
404
+ "name": "copilot_proposals_run_idx",
405
+ "columns": [
406
+ {
407
+ "expression": "run_id",
408
+ "isExpression": false,
409
+ "asc": true,
410
+ "nulls": "last"
411
+ }
412
+ ],
413
+ "isUnique": false,
414
+ "concurrently": false,
415
+ "method": "btree",
416
+ "with": {}
417
+ }
418
+ },
419
+ "foreignKeys": {
420
+ "copilot_proposals_conversation_id_copilot_conversations_id_fk": {
421
+ "name": "copilot_proposals_conversation_id_copilot_conversations_id_fk",
422
+ "tableFrom": "copilot_proposals",
423
+ "tableTo": "copilot_conversations",
424
+ "columnsFrom": [
425
+ "conversation_id"
426
+ ],
427
+ "columnsTo": [
428
+ "id"
429
+ ],
430
+ "onDelete": "cascade",
431
+ "onUpdate": "no action"
432
+ },
433
+ "copilot_proposals_workspace_id_workspaces_id_fk": {
434
+ "name": "copilot_proposals_workspace_id_workspaces_id_fk",
435
+ "tableFrom": "copilot_proposals",
436
+ "tableTo": "workspaces",
437
+ "columnsFrom": [
438
+ "workspace_id"
439
+ ],
440
+ "columnsTo": [
441
+ "id"
442
+ ],
443
+ "onDelete": "cascade",
444
+ "onUpdate": "no action"
445
+ },
446
+ "copilot_proposals_created_by_users_id_fk": {
447
+ "name": "copilot_proposals_created_by_users_id_fk",
448
+ "tableFrom": "copilot_proposals",
449
+ "tableTo": "users",
450
+ "columnsFrom": [
451
+ "created_by"
452
+ ],
453
+ "columnsTo": [
454
+ "id"
455
+ ],
456
+ "onDelete": "cascade",
457
+ "onUpdate": "no action"
458
+ },
459
+ "copilot_proposals_decided_by_users_id_fk": {
460
+ "name": "copilot_proposals_decided_by_users_id_fk",
461
+ "tableFrom": "copilot_proposals",
462
+ "tableTo": "users",
463
+ "columnsFrom": [
464
+ "decided_by"
465
+ ],
466
+ "columnsTo": [
467
+ "id"
468
+ ],
469
+ "onDelete": "set null",
470
+ "onUpdate": "no action"
471
+ }
472
+ },
473
+ "compositePrimaryKeys": {},
474
+ "uniqueConstraints": {},
475
+ "policies": {},
476
+ "checkConstraints": {},
477
+ "isRLSEnabled": false
478
+ },
479
+ "public.copilot_tool_calls": {
480
+ "name": "copilot_tool_calls",
481
+ "schema": "",
482
+ "columns": {
483
+ "id": {
484
+ "name": "id",
485
+ "type": "uuid",
486
+ "primaryKey": true,
487
+ "notNull": true,
488
+ "default": "gen_random_uuid()"
489
+ },
490
+ "conversation_id": {
491
+ "name": "conversation_id",
492
+ "type": "uuid",
493
+ "primaryKey": false,
494
+ "notNull": true
495
+ },
496
+ "run_id": {
497
+ "name": "run_id",
498
+ "type": "uuid",
499
+ "primaryKey": false,
500
+ "notNull": true
501
+ },
502
+ "call_id": {
503
+ "name": "call_id",
504
+ "type": "text",
505
+ "primaryKey": false,
506
+ "notNull": true
507
+ },
508
+ "name": {
509
+ "name": "name",
510
+ "type": "text",
511
+ "primaryKey": false,
512
+ "notNull": true
513
+ },
514
+ "input": {
515
+ "name": "input",
516
+ "type": "jsonb",
517
+ "primaryKey": false,
518
+ "notNull": false
519
+ },
520
+ "output_summary": {
521
+ "name": "output_summary",
522
+ "type": "text",
523
+ "primaryKey": false,
524
+ "notNull": false
525
+ },
526
+ "ok": {
527
+ "name": "ok",
528
+ "type": "boolean",
529
+ "primaryKey": false,
530
+ "notNull": true
531
+ },
532
+ "error": {
533
+ "name": "error",
534
+ "type": "text",
535
+ "primaryKey": false,
536
+ "notNull": false
537
+ },
538
+ "duration_ms": {
539
+ "name": "duration_ms",
540
+ "type": "integer",
541
+ "primaryKey": false,
542
+ "notNull": true
543
+ },
544
+ "created_at": {
545
+ "name": "created_at",
546
+ "type": "timestamp with time zone",
547
+ "primaryKey": false,
548
+ "notNull": true,
549
+ "default": "now()"
550
+ }
551
+ },
552
+ "indexes": {
553
+ "copilot_tool_calls_run_idx": {
554
+ "name": "copilot_tool_calls_run_idx",
555
+ "columns": [
556
+ {
557
+ "expression": "run_id",
558
+ "isExpression": false,
559
+ "asc": true,
560
+ "nulls": "last"
561
+ },
562
+ {
563
+ "expression": "created_at",
564
+ "isExpression": false,
565
+ "asc": true,
566
+ "nulls": "last"
567
+ }
568
+ ],
569
+ "isUnique": false,
570
+ "concurrently": false,
571
+ "method": "btree",
572
+ "with": {}
573
+ }
574
+ },
575
+ "foreignKeys": {
576
+ "copilot_tool_calls_conversation_id_copilot_conversations_id_fk": {
577
+ "name": "copilot_tool_calls_conversation_id_copilot_conversations_id_fk",
578
+ "tableFrom": "copilot_tool_calls",
579
+ "tableTo": "copilot_conversations",
580
+ "columnsFrom": [
581
+ "conversation_id"
582
+ ],
583
+ "columnsTo": [
584
+ "id"
585
+ ],
586
+ "onDelete": "cascade",
587
+ "onUpdate": "no action"
588
+ }
589
+ },
590
+ "compositePrimaryKeys": {},
591
+ "uniqueConstraints": {},
592
+ "policies": {},
593
+ "checkConstraints": {},
594
+ "isRLSEnabled": false
595
+ }
596
+ },
597
+ "enums": {
598
+ "public.copilot_message_role": {
599
+ "name": "copilot_message_role",
600
+ "schema": "public",
601
+ "values": [
602
+ "user",
603
+ "assistant"
604
+ ]
605
+ }
606
+ },
607
+ "schemas": {},
608
+ "sequences": {},
609
+ "roles": {},
610
+ "policies": {},
611
+ "views": {},
612
+ "_meta": {
613
+ "columns": {},
614
+ "schemas": {},
615
+ "tables": {}
616
+ }
617
+ }