@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,777 @@
1
+ {
2
+ "id": "18ddc35b-626e-48d8-bb73-99277d83a762",
3
+ "prevId": "2e71fa31-0732-49f0-addf-85a5784fe2d8",
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
+ "model_choice": {
51
+ "name": "model_choice",
52
+ "type": "text",
53
+ "primaryKey": false,
54
+ "notNull": false
55
+ },
56
+ "allowed_tools": {
57
+ "name": "allowed_tools",
58
+ "type": "jsonb",
59
+ "primaryKey": false,
60
+ "notNull": true,
61
+ "default": "'[]'::jsonb"
62
+ },
63
+ "created_at": {
64
+ "name": "created_at",
65
+ "type": "timestamp with time zone",
66
+ "primaryKey": false,
67
+ "notNull": true,
68
+ "default": "now()"
69
+ },
70
+ "updated_at": {
71
+ "name": "updated_at",
72
+ "type": "timestamp with time zone",
73
+ "primaryKey": false,
74
+ "notNull": true,
75
+ "default": "now()"
76
+ }
77
+ },
78
+ "indexes": {
79
+ "copilot_conversations_owner_idx": {
80
+ "name": "copilot_conversations_owner_idx",
81
+ "columns": [
82
+ {
83
+ "expression": "user_id",
84
+ "isExpression": false,
85
+ "asc": true,
86
+ "nulls": "last"
87
+ },
88
+ {
89
+ "expression": "workspace_id",
90
+ "isExpression": false,
91
+ "asc": true,
92
+ "nulls": "last"
93
+ },
94
+ {
95
+ "expression": "updated_at",
96
+ "isExpression": false,
97
+ "asc": true,
98
+ "nulls": "last"
99
+ }
100
+ ],
101
+ "isUnique": false,
102
+ "concurrently": false,
103
+ "method": "btree",
104
+ "with": {}
105
+ }
106
+ },
107
+ "foreignKeys": {
108
+ "copilot_conversations_user_id_users_id_fk": {
109
+ "name": "copilot_conversations_user_id_users_id_fk",
110
+ "tableFrom": "copilot_conversations",
111
+ "tableTo": "users",
112
+ "columnsFrom": [
113
+ "user_id"
114
+ ],
115
+ "columnsTo": [
116
+ "id"
117
+ ],
118
+ "onDelete": "cascade",
119
+ "onUpdate": "no action"
120
+ },
121
+ "copilot_conversations_workspace_id_workspaces_id_fk": {
122
+ "name": "copilot_conversations_workspace_id_workspaces_id_fk",
123
+ "tableFrom": "copilot_conversations",
124
+ "tableTo": "workspaces",
125
+ "columnsFrom": [
126
+ "workspace_id"
127
+ ],
128
+ "columnsTo": [
129
+ "id"
130
+ ],
131
+ "onDelete": "cascade",
132
+ "onUpdate": "no action"
133
+ }
134
+ },
135
+ "compositePrimaryKeys": {},
136
+ "uniqueConstraints": {},
137
+ "policies": {},
138
+ "checkConstraints": {},
139
+ "isRLSEnabled": false
140
+ },
141
+ "public.copilot_messages": {
142
+ "name": "copilot_messages",
143
+ "schema": "",
144
+ "columns": {
145
+ "id": {
146
+ "name": "id",
147
+ "type": "uuid",
148
+ "primaryKey": true,
149
+ "notNull": true,
150
+ "default": "gen_random_uuid()"
151
+ },
152
+ "conversation_id": {
153
+ "name": "conversation_id",
154
+ "type": "uuid",
155
+ "primaryKey": false,
156
+ "notNull": true
157
+ },
158
+ "run_id": {
159
+ "name": "run_id",
160
+ "type": "uuid",
161
+ "primaryKey": false,
162
+ "notNull": true
163
+ },
164
+ "role": {
165
+ "name": "role",
166
+ "type": "copilot_message_role",
167
+ "typeSchema": "public",
168
+ "primaryKey": false,
169
+ "notNull": true
170
+ },
171
+ "content": {
172
+ "name": "content",
173
+ "type": "jsonb",
174
+ "primaryKey": false,
175
+ "notNull": true
176
+ },
177
+ "attachments": {
178
+ "name": "attachments",
179
+ "type": "jsonb",
180
+ "primaryKey": false,
181
+ "notNull": false
182
+ },
183
+ "skills": {
184
+ "name": "skills",
185
+ "type": "jsonb",
186
+ "primaryKey": false,
187
+ "notNull": false
188
+ },
189
+ "model": {
190
+ "name": "model",
191
+ "type": "text",
192
+ "primaryKey": false,
193
+ "notNull": false
194
+ },
195
+ "provider": {
196
+ "name": "provider",
197
+ "type": "text",
198
+ "primaryKey": false,
199
+ "notNull": false
200
+ },
201
+ "stop_reason": {
202
+ "name": "stop_reason",
203
+ "type": "text",
204
+ "primaryKey": false,
205
+ "notNull": false
206
+ },
207
+ "input_tokens": {
208
+ "name": "input_tokens",
209
+ "type": "integer",
210
+ "primaryKey": false,
211
+ "notNull": false
212
+ },
213
+ "output_tokens": {
214
+ "name": "output_tokens",
215
+ "type": "integer",
216
+ "primaryKey": false,
217
+ "notNull": false
218
+ },
219
+ "position": {
220
+ "name": "position",
221
+ "type": "integer",
222
+ "primaryKey": false,
223
+ "notNull": true
224
+ },
225
+ "created_at": {
226
+ "name": "created_at",
227
+ "type": "timestamp with time zone",
228
+ "primaryKey": false,
229
+ "notNull": true,
230
+ "default": "now()"
231
+ }
232
+ },
233
+ "indexes": {
234
+ "copilot_messages_thread_idx": {
235
+ "name": "copilot_messages_thread_idx",
236
+ "columns": [
237
+ {
238
+ "expression": "conversation_id",
239
+ "isExpression": false,
240
+ "asc": true,
241
+ "nulls": "last"
242
+ },
243
+ {
244
+ "expression": "position",
245
+ "isExpression": false,
246
+ "asc": true,
247
+ "nulls": "last"
248
+ }
249
+ ],
250
+ "isUnique": false,
251
+ "concurrently": false,
252
+ "method": "btree",
253
+ "with": {}
254
+ }
255
+ },
256
+ "foreignKeys": {
257
+ "copilot_messages_conversation_id_copilot_conversations_id_fk": {
258
+ "name": "copilot_messages_conversation_id_copilot_conversations_id_fk",
259
+ "tableFrom": "copilot_messages",
260
+ "tableTo": "copilot_conversations",
261
+ "columnsFrom": [
262
+ "conversation_id"
263
+ ],
264
+ "columnsTo": [
265
+ "id"
266
+ ],
267
+ "onDelete": "cascade",
268
+ "onUpdate": "no action"
269
+ }
270
+ },
271
+ "compositePrimaryKeys": {},
272
+ "uniqueConstraints": {},
273
+ "policies": {},
274
+ "checkConstraints": {},
275
+ "isRLSEnabled": false
276
+ },
277
+ "public.copilot_proposals": {
278
+ "name": "copilot_proposals",
279
+ "schema": "",
280
+ "columns": {
281
+ "id": {
282
+ "name": "id",
283
+ "type": "uuid",
284
+ "primaryKey": true,
285
+ "notNull": true,
286
+ "default": "gen_random_uuid()"
287
+ },
288
+ "conversation_id": {
289
+ "name": "conversation_id",
290
+ "type": "uuid",
291
+ "primaryKey": false,
292
+ "notNull": true
293
+ },
294
+ "run_id": {
295
+ "name": "run_id",
296
+ "type": "uuid",
297
+ "primaryKey": false,
298
+ "notNull": true
299
+ },
300
+ "tool_call_id": {
301
+ "name": "tool_call_id",
302
+ "type": "text",
303
+ "primaryKey": false,
304
+ "notNull": true
305
+ },
306
+ "tool_name": {
307
+ "name": "tool_name",
308
+ "type": "text",
309
+ "primaryKey": false,
310
+ "notNull": true
311
+ },
312
+ "kind": {
313
+ "name": "kind",
314
+ "type": "text",
315
+ "primaryKey": false,
316
+ "notNull": true
317
+ },
318
+ "workspace_id": {
319
+ "name": "workspace_id",
320
+ "type": "uuid",
321
+ "primaryKey": false,
322
+ "notNull": true
323
+ },
324
+ "created_by": {
325
+ "name": "created_by",
326
+ "type": "uuid",
327
+ "primaryKey": false,
328
+ "notNull": true
329
+ },
330
+ "target": {
331
+ "name": "target",
332
+ "type": "jsonb",
333
+ "primaryKey": false,
334
+ "notNull": true
335
+ },
336
+ "patch": {
337
+ "name": "patch",
338
+ "type": "jsonb",
339
+ "primaryKey": false,
340
+ "notNull": true
341
+ },
342
+ "summary": {
343
+ "name": "summary",
344
+ "type": "text",
345
+ "primaryKey": false,
346
+ "notNull": true
347
+ },
348
+ "changes": {
349
+ "name": "changes",
350
+ "type": "jsonb",
351
+ "primaryKey": false,
352
+ "notNull": false
353
+ },
354
+ "status": {
355
+ "name": "status",
356
+ "type": "text",
357
+ "primaryKey": false,
358
+ "notNull": true,
359
+ "default": "'pending'"
360
+ },
361
+ "decided_by": {
362
+ "name": "decided_by",
363
+ "type": "uuid",
364
+ "primaryKey": false,
365
+ "notNull": false
366
+ },
367
+ "decided_at": {
368
+ "name": "decided_at",
369
+ "type": "timestamp with time zone",
370
+ "primaryKey": false,
371
+ "notNull": false
372
+ },
373
+ "result": {
374
+ "name": "result",
375
+ "type": "jsonb",
376
+ "primaryKey": false,
377
+ "notNull": false
378
+ },
379
+ "error": {
380
+ "name": "error",
381
+ "type": "text",
382
+ "primaryKey": false,
383
+ "notNull": false
384
+ },
385
+ "created_at": {
386
+ "name": "created_at",
387
+ "type": "timestamp with time zone",
388
+ "primaryKey": false,
389
+ "notNull": true,
390
+ "default": "now()"
391
+ }
392
+ },
393
+ "indexes": {
394
+ "copilot_proposals_workspace_idx": {
395
+ "name": "copilot_proposals_workspace_idx",
396
+ "columns": [
397
+ {
398
+ "expression": "workspace_id",
399
+ "isExpression": false,
400
+ "asc": true,
401
+ "nulls": "last"
402
+ },
403
+ {
404
+ "expression": "status",
405
+ "isExpression": false,
406
+ "asc": true,
407
+ "nulls": "last"
408
+ },
409
+ {
410
+ "expression": "created_at",
411
+ "isExpression": false,
412
+ "asc": true,
413
+ "nulls": "last"
414
+ }
415
+ ],
416
+ "isUnique": false,
417
+ "concurrently": false,
418
+ "method": "btree",
419
+ "with": {}
420
+ },
421
+ "copilot_proposals_run_idx": {
422
+ "name": "copilot_proposals_run_idx",
423
+ "columns": [
424
+ {
425
+ "expression": "run_id",
426
+ "isExpression": false,
427
+ "asc": true,
428
+ "nulls": "last"
429
+ }
430
+ ],
431
+ "isUnique": false,
432
+ "concurrently": false,
433
+ "method": "btree",
434
+ "with": {}
435
+ }
436
+ },
437
+ "foreignKeys": {
438
+ "copilot_proposals_conversation_id_copilot_conversations_id_fk": {
439
+ "name": "copilot_proposals_conversation_id_copilot_conversations_id_fk",
440
+ "tableFrom": "copilot_proposals",
441
+ "tableTo": "copilot_conversations",
442
+ "columnsFrom": [
443
+ "conversation_id"
444
+ ],
445
+ "columnsTo": [
446
+ "id"
447
+ ],
448
+ "onDelete": "cascade",
449
+ "onUpdate": "no action"
450
+ },
451
+ "copilot_proposals_workspace_id_workspaces_id_fk": {
452
+ "name": "copilot_proposals_workspace_id_workspaces_id_fk",
453
+ "tableFrom": "copilot_proposals",
454
+ "tableTo": "workspaces",
455
+ "columnsFrom": [
456
+ "workspace_id"
457
+ ],
458
+ "columnsTo": [
459
+ "id"
460
+ ],
461
+ "onDelete": "cascade",
462
+ "onUpdate": "no action"
463
+ },
464
+ "copilot_proposals_created_by_users_id_fk": {
465
+ "name": "copilot_proposals_created_by_users_id_fk",
466
+ "tableFrom": "copilot_proposals",
467
+ "tableTo": "users",
468
+ "columnsFrom": [
469
+ "created_by"
470
+ ],
471
+ "columnsTo": [
472
+ "id"
473
+ ],
474
+ "onDelete": "cascade",
475
+ "onUpdate": "no action"
476
+ },
477
+ "copilot_proposals_decided_by_users_id_fk": {
478
+ "name": "copilot_proposals_decided_by_users_id_fk",
479
+ "tableFrom": "copilot_proposals",
480
+ "tableTo": "users",
481
+ "columnsFrom": [
482
+ "decided_by"
483
+ ],
484
+ "columnsTo": [
485
+ "id"
486
+ ],
487
+ "onDelete": "set null",
488
+ "onUpdate": "no action"
489
+ }
490
+ },
491
+ "compositePrimaryKeys": {},
492
+ "uniqueConstraints": {},
493
+ "policies": {},
494
+ "checkConstraints": {},
495
+ "isRLSEnabled": false
496
+ },
497
+ "public.copilot_tool_calls": {
498
+ "name": "copilot_tool_calls",
499
+ "schema": "",
500
+ "columns": {
501
+ "id": {
502
+ "name": "id",
503
+ "type": "uuid",
504
+ "primaryKey": true,
505
+ "notNull": true,
506
+ "default": "gen_random_uuid()"
507
+ },
508
+ "conversation_id": {
509
+ "name": "conversation_id",
510
+ "type": "uuid",
511
+ "primaryKey": false,
512
+ "notNull": true
513
+ },
514
+ "run_id": {
515
+ "name": "run_id",
516
+ "type": "uuid",
517
+ "primaryKey": false,
518
+ "notNull": true
519
+ },
520
+ "call_id": {
521
+ "name": "call_id",
522
+ "type": "text",
523
+ "primaryKey": false,
524
+ "notNull": true
525
+ },
526
+ "name": {
527
+ "name": "name",
528
+ "type": "text",
529
+ "primaryKey": false,
530
+ "notNull": true
531
+ },
532
+ "input": {
533
+ "name": "input",
534
+ "type": "jsonb",
535
+ "primaryKey": false,
536
+ "notNull": false
537
+ },
538
+ "output_summary": {
539
+ "name": "output_summary",
540
+ "type": "text",
541
+ "primaryKey": false,
542
+ "notNull": false
543
+ },
544
+ "ok": {
545
+ "name": "ok",
546
+ "type": "boolean",
547
+ "primaryKey": false,
548
+ "notNull": true
549
+ },
550
+ "error": {
551
+ "name": "error",
552
+ "type": "text",
553
+ "primaryKey": false,
554
+ "notNull": false
555
+ },
556
+ "duration_ms": {
557
+ "name": "duration_ms",
558
+ "type": "integer",
559
+ "primaryKey": false,
560
+ "notNull": true
561
+ },
562
+ "created_at": {
563
+ "name": "created_at",
564
+ "type": "timestamp with time zone",
565
+ "primaryKey": false,
566
+ "notNull": true,
567
+ "default": "now()"
568
+ }
569
+ },
570
+ "indexes": {
571
+ "copilot_tool_calls_run_idx": {
572
+ "name": "copilot_tool_calls_run_idx",
573
+ "columns": [
574
+ {
575
+ "expression": "run_id",
576
+ "isExpression": false,
577
+ "asc": true,
578
+ "nulls": "last"
579
+ },
580
+ {
581
+ "expression": "created_at",
582
+ "isExpression": false,
583
+ "asc": true,
584
+ "nulls": "last"
585
+ }
586
+ ],
587
+ "isUnique": false,
588
+ "concurrently": false,
589
+ "method": "btree",
590
+ "with": {}
591
+ }
592
+ },
593
+ "foreignKeys": {
594
+ "copilot_tool_calls_conversation_id_copilot_conversations_id_fk": {
595
+ "name": "copilot_tool_calls_conversation_id_copilot_conversations_id_fk",
596
+ "tableFrom": "copilot_tool_calls",
597
+ "tableTo": "copilot_conversations",
598
+ "columnsFrom": [
599
+ "conversation_id"
600
+ ],
601
+ "columnsTo": [
602
+ "id"
603
+ ],
604
+ "onDelete": "cascade",
605
+ "onUpdate": "no action"
606
+ }
607
+ },
608
+ "compositePrimaryKeys": {},
609
+ "uniqueConstraints": {},
610
+ "policies": {},
611
+ "checkConstraints": {},
612
+ "isRLSEnabled": false
613
+ },
614
+ "public.copilot_skills": {
615
+ "name": "copilot_skills",
616
+ "schema": "",
617
+ "columns": {
618
+ "id": {
619
+ "name": "id",
620
+ "type": "uuid",
621
+ "primaryKey": true,
622
+ "notNull": true,
623
+ "default": "gen_random_uuid()"
624
+ },
625
+ "workspace_id": {
626
+ "name": "workspace_id",
627
+ "type": "uuid",
628
+ "primaryKey": false,
629
+ "notNull": true
630
+ },
631
+ "name": {
632
+ "name": "name",
633
+ "type": "text",
634
+ "primaryKey": false,
635
+ "notNull": true
636
+ },
637
+ "title": {
638
+ "name": "title",
639
+ "type": "text",
640
+ "primaryKey": false,
641
+ "notNull": true
642
+ },
643
+ "description": {
644
+ "name": "description",
645
+ "type": "text",
646
+ "primaryKey": false,
647
+ "notNull": true
648
+ },
649
+ "instructions": {
650
+ "name": "instructions",
651
+ "type": "text",
652
+ "primaryKey": false,
653
+ "notNull": true
654
+ },
655
+ "mode": {
656
+ "name": "mode",
657
+ "type": "copilot_skill_mode",
658
+ "typeSchema": "public",
659
+ "primaryKey": false,
660
+ "notNull": true,
661
+ "default": "'manual'"
662
+ },
663
+ "enabled": {
664
+ "name": "enabled",
665
+ "type": "boolean",
666
+ "primaryKey": false,
667
+ "notNull": true,
668
+ "default": true
669
+ },
670
+ "created_by": {
671
+ "name": "created_by",
672
+ "type": "uuid",
673
+ "primaryKey": false,
674
+ "notNull": false
675
+ },
676
+ "created_at": {
677
+ "name": "created_at",
678
+ "type": "timestamp with time zone",
679
+ "primaryKey": false,
680
+ "notNull": true,
681
+ "default": "now()"
682
+ },
683
+ "updated_at": {
684
+ "name": "updated_at",
685
+ "type": "timestamp with time zone",
686
+ "primaryKey": false,
687
+ "notNull": true,
688
+ "default": "now()"
689
+ }
690
+ },
691
+ "indexes": {
692
+ "copilot_skills_workspace_name_idx": {
693
+ "name": "copilot_skills_workspace_name_idx",
694
+ "columns": [
695
+ {
696
+ "expression": "workspace_id",
697
+ "isExpression": false,
698
+ "asc": true,
699
+ "nulls": "last"
700
+ },
701
+ {
702
+ "expression": "name",
703
+ "isExpression": false,
704
+ "asc": true,
705
+ "nulls": "last"
706
+ }
707
+ ],
708
+ "isUnique": true,
709
+ "concurrently": false,
710
+ "method": "btree",
711
+ "with": {}
712
+ }
713
+ },
714
+ "foreignKeys": {
715
+ "copilot_skills_workspace_id_workspaces_id_fk": {
716
+ "name": "copilot_skills_workspace_id_workspaces_id_fk",
717
+ "tableFrom": "copilot_skills",
718
+ "tableTo": "workspaces",
719
+ "columnsFrom": [
720
+ "workspace_id"
721
+ ],
722
+ "columnsTo": [
723
+ "id"
724
+ ],
725
+ "onDelete": "cascade",
726
+ "onUpdate": "no action"
727
+ },
728
+ "copilot_skills_created_by_users_id_fk": {
729
+ "name": "copilot_skills_created_by_users_id_fk",
730
+ "tableFrom": "copilot_skills",
731
+ "tableTo": "users",
732
+ "columnsFrom": [
733
+ "created_by"
734
+ ],
735
+ "columnsTo": [
736
+ "id"
737
+ ],
738
+ "onDelete": "set null",
739
+ "onUpdate": "no action"
740
+ }
741
+ },
742
+ "compositePrimaryKeys": {},
743
+ "uniqueConstraints": {},
744
+ "policies": {},
745
+ "checkConstraints": {},
746
+ "isRLSEnabled": false
747
+ }
748
+ },
749
+ "enums": {
750
+ "public.copilot_message_role": {
751
+ "name": "copilot_message_role",
752
+ "schema": "public",
753
+ "values": [
754
+ "user",
755
+ "assistant"
756
+ ]
757
+ },
758
+ "public.copilot_skill_mode": {
759
+ "name": "copilot_skill_mode",
760
+ "schema": "public",
761
+ "values": [
762
+ "manual",
763
+ "always"
764
+ ]
765
+ }
766
+ },
767
+ "schemas": {},
768
+ "sequences": {},
769
+ "roles": {},
770
+ "policies": {},
771
+ "views": {},
772
+ "_meta": {
773
+ "columns": {},
774
+ "schemas": {},
775
+ "tables": {}
776
+ }
777
+ }