@stack-spot/ai-chat-widget 0.6.0 → 0.7.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.
- package/dist/StackspotAIWidget.d.ts.map +1 -1
- package/dist/StackspotAIWidget.js +3 -2
- package/dist/StackspotAIWidget.js.map +1 -1
- package/dist/features.d.ts +1 -1
- package/dist/features.d.ts.map +1 -1
- package/dist/features.js +1 -0
- package/dist/features.js.map +1 -1
- package/dist/state/ChatEntry.d.ts +1 -1
- package/dist/state/ChatEntry.d.ts.map +1 -1
- package/dist/state/ChatEntry.js +2 -2
- package/dist/state/ChatEntry.js.map +1 -1
- package/dist/state/ChatState.d.ts +12 -0
- package/dist/state/ChatState.d.ts.map +1 -1
- package/dist/state/ChatState.js.map +1 -1
- package/dist/state/WidgetState.d.ts +0 -4
- package/dist/state/WidgetState.d.ts.map +1 -1
- package/dist/state/WidgetState.js.map +1 -1
- package/dist/utils/chat.d.ts.map +1 -1
- package/dist/utils/chat.js +1 -2
- package/dist/utils/chat.js.map +1 -1
- package/dist/utils/programming-languages.d.ts +6 -0
- package/dist/utils/programming-languages.d.ts.map +1 -0
- package/dist/utils/programming-languages.js +463 -0
- package/dist/utils/programming-languages.js.map +1 -0
- package/dist/views/Agents.js +1 -3
- package/dist/views/Agents.js.map +1 -1
- package/dist/views/Chat/ChatMessage.d.ts.map +1 -1
- package/dist/views/Chat/ChatMessage.js +5 -3
- package/dist/views/Chat/ChatMessage.js.map +1 -1
- package/dist/views/Chat/styled.d.ts.map +1 -1
- package/dist/views/Chat/styled.js +8 -0
- package/dist/views/Chat/styled.js.map +1 -1
- package/dist/views/ChatHistory/HistoryItem.js +1 -1
- package/dist/views/ChatHistory/HistoryItem.js.map +1 -1
- package/dist/views/Editor.d.ts.map +1 -1
- package/dist/views/Editor.js +87 -1
- package/dist/views/Editor.js.map +1 -1
- package/dist/views/MessageInput/ButtonGroup.d.ts.map +1 -1
- package/dist/views/MessageInput/ButtonGroup.js +2 -2
- package/dist/views/MessageInput/ButtonGroup.js.map +1 -1
- package/dist/views/MessageInput/InfoBar.d.ts.map +1 -1
- package/dist/views/MessageInput/InfoBar.js +9 -2
- package/dist/views/MessageInput/InfoBar.js.map +1 -1
- package/dist/views/MessageInput/dictionary.d.ts +1 -1
- package/dist/views/MessageInput/dictionary.d.ts.map +1 -1
- package/dist/views/MessageInput/dictionary.js +4 -0
- package/dist/views/MessageInput/dictionary.js.map +1 -1
- package/dist/views/MessageInput/index.d.ts.map +1 -1
- package/dist/views/MessageInput/index.js +4 -1
- package/dist/views/MessageInput/index.js.map +1 -1
- package/package.json +3 -1
- package/src/StackspotAIWidget.tsx +3 -1
- package/src/chat-interceptors/send-message.ts +1 -1
- package/src/features.ts +2 -1
- package/src/state/ChatEntry.ts +2 -2
- package/src/state/ChatState.ts +12 -0
- package/src/state/WidgetState.ts +0 -4
- package/src/utils/chat.ts +1 -2
- package/src/utils/programming-languages.ts +462 -0
- package/src/views/Agents.tsx +1 -3
- package/src/views/Chat/ChatMessage.tsx +16 -7
- package/src/views/Chat/styled.ts +8 -0
- package/src/views/ChatHistory/HistoryItem.tsx +1 -1
- package/src/views/Editor.tsx +126 -1
- package/src/views/MessageInput/ButtonGroup.tsx +6 -1
- package/src/views/MessageInput/InfoBar.tsx +14 -1
- package/src/views/MessageInput/dictionary.ts +4 -0
- package/src/views/MessageInput/index.tsx +4 -1
|
@@ -0,0 +1,462 @@
|
|
|
1
|
+
export const languages = [
|
|
2
|
+
{
|
|
3
|
+
'value': 'abap',
|
|
4
|
+
'label': 'ABAP',
|
|
5
|
+
'extensions': ['.abap'],
|
|
6
|
+
},
|
|
7
|
+
{
|
|
8
|
+
'value': 'ada',
|
|
9
|
+
'label': 'ADA',
|
|
10
|
+
'extensions': ['.ada', '.adb', '.ads'],
|
|
11
|
+
},
|
|
12
|
+
{
|
|
13
|
+
'value': 'aes',
|
|
14
|
+
'label': 'AES - Advanced Encryption Standard',
|
|
15
|
+
'extensions': ['.aes'],
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
'value': 'apex',
|
|
19
|
+
'label': 'Apex',
|
|
20
|
+
'extensions': ['.cls'],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
'value': 'azcli',
|
|
24
|
+
'label': 'Azure CLI',
|
|
25
|
+
'extensions': ['.azcli'],
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
'value': 'bat',
|
|
29
|
+
'label': 'BAT',
|
|
30
|
+
'extensions': ['.bat', '.cmd'],
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
'value': 'bicep',
|
|
34
|
+
'label': 'Bicep',
|
|
35
|
+
'extensions': ['.bicep'],
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
'value': 'c',
|
|
39
|
+
'label': 'C',
|
|
40
|
+
'extensions': ['.c', '.h'],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
'value': 'csharp',
|
|
44
|
+
'label': 'C#',
|
|
45
|
+
'extensions': ['.cs'],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
'value': 'cpp',
|
|
49
|
+
'label': 'C++',
|
|
50
|
+
'extensions': ['.cpp', '.cc', '.cxx', '.h', '.hh', '.hpp', '.hxx'],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
'value': 'cameligo',
|
|
54
|
+
'label': 'Cameligo',
|
|
55
|
+
'extensions': ['.mligo'],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
'value': 'clojure',
|
|
59
|
+
'label': 'Clojure',
|
|
60
|
+
'extensions': ['.clj', '.cljs', '.cljc', '.edn'],
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
'value': 'cobol',
|
|
64
|
+
'label': 'COBOL',
|
|
65
|
+
'extensions': ['.cob', '.cbl'],
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
'value': 'coffeescript',
|
|
69
|
+
'label': 'CoffeeScript',
|
|
70
|
+
'extensions': ['.coffee'],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
'value': 'csp',
|
|
74
|
+
'label': 'CSP',
|
|
75
|
+
'extensions': ['.csp'],
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
'value': 'css',
|
|
79
|
+
'label': 'CSS',
|
|
80
|
+
'extensions': ['.css'],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
'value': 'd',
|
|
84
|
+
'label': 'D',
|
|
85
|
+
'extensions': ['.d'],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
'value': 'dart',
|
|
89
|
+
'label': 'Dart',
|
|
90
|
+
'extensions': ['.dart'],
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
'value': 'dockerfile',
|
|
94
|
+
'label': 'Dockerfile',
|
|
95
|
+
'extensions': ['.dockerfile'],
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
'value': 'ecl',
|
|
99
|
+
'label': 'ECL',
|
|
100
|
+
'extensions': ['.ecl'],
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
'value': 'elixir',
|
|
104
|
+
'label': 'Elixir',
|
|
105
|
+
'extensions': ['.ex', '.exs'],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
'value': 'erlang',
|
|
109
|
+
'label': 'Erlang',
|
|
110
|
+
'extensions': ['.erl', '.hrl'],
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
'value': 'fsharp',
|
|
114
|
+
'label': 'F#',
|
|
115
|
+
'extensions': ['.fs', '.fsi', '.ml', '.mli'],
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
'value': 'flow9',
|
|
119
|
+
'label': 'Flow 9',
|
|
120
|
+
'extensions': ['.flow'],
|
|
121
|
+
},
|
|
122
|
+
{
|
|
123
|
+
'value': 'fortran',
|
|
124
|
+
'label': 'Fortran',
|
|
125
|
+
'extensions': ['.f90', '.f', '.for', '.f77'],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
'value': 'freemarker2',
|
|
129
|
+
'label': 'Freemarker 2',
|
|
130
|
+
'extensions': ['.ftl'],
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
'value': 'go',
|
|
134
|
+
'label': 'GO',
|
|
135
|
+
'extensions': ['.go'],
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
'value': 'graphql',
|
|
139
|
+
'label': 'GraphQL',
|
|
140
|
+
'extensions': ['.graphql', '.gql'],
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
'value': 'groovy',
|
|
144
|
+
'label': 'Groovy',
|
|
145
|
+
'extensions': ['.groovy', '.gvy', '.gy', '.gsh'],
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
'value': 'handlebars',
|
|
149
|
+
'label': 'Handlebars',
|
|
150
|
+
'extensions': ['.handlebars', '.hbs'],
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
'value': 'haskell',
|
|
154
|
+
'label': 'Haskell',
|
|
155
|
+
'extensions': ['.hs'],
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
'value': 'hcl',
|
|
159
|
+
'label': 'HCL',
|
|
160
|
+
'extensions': ['.hcl', '.tf'],
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
'value': 'html',
|
|
164
|
+
'label': 'HTML',
|
|
165
|
+
'extensions': ['.html', '.htm'],
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
'value': 'ini',
|
|
169
|
+
'label': 'INI',
|
|
170
|
+
'extensions': ['.ini'],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
'value': 'java',
|
|
174
|
+
'label': 'Java',
|
|
175
|
+
'extensions': ['.java'],
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
'value': 'javascript',
|
|
179
|
+
'label': 'JavaScript',
|
|
180
|
+
'extensions': ['.js', '.mjs', '.jsx'],
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
'value': 'json',
|
|
184
|
+
'label': 'JSON',
|
|
185
|
+
'extensions': ['.json'],
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
'value': 'julia',
|
|
189
|
+
'label': 'Julia',
|
|
190
|
+
'extensions': ['.jl'],
|
|
191
|
+
},
|
|
192
|
+
{
|
|
193
|
+
'value': 'kotlin',
|
|
194
|
+
'label': 'Kotlin',
|
|
195
|
+
'extensions': ['.kt', '.kts'],
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
'value': 'less',
|
|
199
|
+
'label': 'LESS',
|
|
200
|
+
'extensions': ['.less'],
|
|
201
|
+
},
|
|
202
|
+
{
|
|
203
|
+
'value': 'lexon',
|
|
204
|
+
'label': 'Lexon',
|
|
205
|
+
'extensions': ['.lex'],
|
|
206
|
+
},
|
|
207
|
+
{
|
|
208
|
+
'value': 'liquid',
|
|
209
|
+
'label': 'Liquid',
|
|
210
|
+
'extensions': ['.liquid'],
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
'value': 'lua',
|
|
214
|
+
'label': 'Lua',
|
|
215
|
+
'extensions': ['.lua'],
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
'value': 'm3',
|
|
219
|
+
'label': 'M3',
|
|
220
|
+
'extensions': ['.m3'],
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
'value': 'markdown',
|
|
224
|
+
'label': 'Markdown',
|
|
225
|
+
'extensions': ['.md'],
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
'value': 'msdax',
|
|
229
|
+
'label': 'Microsoft DAX',
|
|
230
|
+
'extensions': ['.dax'],
|
|
231
|
+
},
|
|
232
|
+
{
|
|
233
|
+
'value': 'mips',
|
|
234
|
+
'label': 'MIPS Assembly Language',
|
|
235
|
+
'extensions': ['.asm'],
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
'value': 'mysql',
|
|
239
|
+
'label': 'MySQL',
|
|
240
|
+
'extensions': ['.sql'],
|
|
241
|
+
},
|
|
242
|
+
{
|
|
243
|
+
'value': 'objective-c',
|
|
244
|
+
'label': 'Objective-C',
|
|
245
|
+
'extensions': ['.m', '.h'],
|
|
246
|
+
},
|
|
247
|
+
{
|
|
248
|
+
'value': 'ocaml',
|
|
249
|
+
'label': 'OCAML',
|
|
250
|
+
'extensions': ['.ml', '.mli'],
|
|
251
|
+
},
|
|
252
|
+
{
|
|
253
|
+
'value': 'octave',
|
|
254
|
+
'label': 'Octave',
|
|
255
|
+
'extensions': ['.m'],
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
'value': 'pascal',
|
|
259
|
+
'label': 'Pascal',
|
|
260
|
+
'extensions': ['.pas', '.pp'],
|
|
261
|
+
},
|
|
262
|
+
{
|
|
263
|
+
'value': 'pascaligo',
|
|
264
|
+
'label': 'Pascaligo',
|
|
265
|
+
'extensions': ['.ligo'],
|
|
266
|
+
},
|
|
267
|
+
{
|
|
268
|
+
'value': 'perl',
|
|
269
|
+
'label': 'Perl',
|
|
270
|
+
'extensions': ['.pl', '.pm'],
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
'value': 'php',
|
|
274
|
+
'label': 'PHP',
|
|
275
|
+
'extensions': ['.php'],
|
|
276
|
+
},
|
|
277
|
+
{
|
|
278
|
+
'value': 'pla',
|
|
279
|
+
'label': 'PLA',
|
|
280
|
+
'extensions': ['.pla'],
|
|
281
|
+
},
|
|
282
|
+
{
|
|
283
|
+
'value': 'plaintext',
|
|
284
|
+
'label': 'Plain Text',
|
|
285
|
+
'extensions': ['.txt'],
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
'value': 'pgsql',
|
|
289
|
+
'label': 'PostgreSQL',
|
|
290
|
+
'extensions': ['.sql'],
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
'value': 'postiats',
|
|
294
|
+
'label': 'Postiats',
|
|
295
|
+
'extensions': ['.dats', '.sats', '.hats'],
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
'value': 'powerquery',
|
|
299
|
+
'label': 'Power Query',
|
|
300
|
+
'extensions': ['.pq'],
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
'value': 'powershell',
|
|
304
|
+
'label': 'PowerShell',
|
|
305
|
+
'extensions': ['.ps1', '.psm1', '.psd1'],
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
'value': 'proto',
|
|
309
|
+
'label': 'Proto',
|
|
310
|
+
'extensions': ['.proto'],
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
'value': 'pug',
|
|
314
|
+
'label': 'PUG',
|
|
315
|
+
'extensions': ['.pug'],
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
'value': 'python',
|
|
319
|
+
'label': 'Python',
|
|
320
|
+
'extensions': ['.py'],
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
'value': 'qsharp',
|
|
324
|
+
'label': 'Q#',
|
|
325
|
+
'extensions': ['.qs'],
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
'value': 'r',
|
|
329
|
+
'label': 'R',
|
|
330
|
+
'extensions': ['.r'],
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
'value': 'racket',
|
|
334
|
+
'label': 'Racket',
|
|
335
|
+
'extensions': ['.rkt'],
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
'value': 'razor',
|
|
339
|
+
'label': 'Razor',
|
|
340
|
+
'extensions': ['.cshtml'],
|
|
341
|
+
},
|
|
342
|
+
{
|
|
343
|
+
'value': 'redis',
|
|
344
|
+
'label': 'Redis',
|
|
345
|
+
'extensions': ['.redis'],
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
'value': 'redshift',
|
|
349
|
+
'label': 'Redshift',
|
|
350
|
+
'extensions': ['.sql'],
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
'value': 'restructuredtext',
|
|
354
|
+
'label': 'Restructured Text',
|
|
355
|
+
'extensions': ['.rst'],
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
'value': 'ruby',
|
|
359
|
+
'label': 'Ruby',
|
|
360
|
+
'extensions': ['.rb'],
|
|
361
|
+
},
|
|
362
|
+
{
|
|
363
|
+
'value': 'rust',
|
|
364
|
+
'label': 'Rust',
|
|
365
|
+
'extensions': ['.rs'],
|
|
366
|
+
},
|
|
367
|
+
{
|
|
368
|
+
'value': 'sb',
|
|
369
|
+
'label': 'SB',
|
|
370
|
+
'extensions': ['.sb'],
|
|
371
|
+
},
|
|
372
|
+
{
|
|
373
|
+
'value': 'sbcl',
|
|
374
|
+
'label': 'SBCL',
|
|
375
|
+
'extensions': ['.lisp'],
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
'value': 'scala',
|
|
379
|
+
'label': 'Scala',
|
|
380
|
+
'extensions': ['.scala'],
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
'value': 'scheme',
|
|
384
|
+
'label': 'Scheme',
|
|
385
|
+
'extensions': ['.scm'],
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
'value': 'scss',
|
|
389
|
+
'label': 'SCSS',
|
|
390
|
+
'extensions': ['.scss'],
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
'value': 'shell',
|
|
394
|
+
'label': 'Shell',
|
|
395
|
+
'extensions': ['.sh'],
|
|
396
|
+
},
|
|
397
|
+
{
|
|
398
|
+
'value': 'sol',
|
|
399
|
+
'label': 'SOL',
|
|
400
|
+
'extensions': ['.sol'],
|
|
401
|
+
},
|
|
402
|
+
{
|
|
403
|
+
'value': 'sparql',
|
|
404
|
+
'label': 'SPARQL',
|
|
405
|
+
'extensions': ['.rq'],
|
|
406
|
+
},
|
|
407
|
+
{
|
|
408
|
+
'value': 'sql',
|
|
409
|
+
'label': 'SQL',
|
|
410
|
+
'extensions': ['.sql'],
|
|
411
|
+
},
|
|
412
|
+
{
|
|
413
|
+
'value': 'st',
|
|
414
|
+
'label': 'ST',
|
|
415
|
+
'extensions': ['.st'],
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
'value': 'swift',
|
|
419
|
+
'label': 'Swift',
|
|
420
|
+
'extensions': ['.swift'],
|
|
421
|
+
},
|
|
422
|
+
{
|
|
423
|
+
'value': 'systemverilog',
|
|
424
|
+
'label': 'System Verilog',
|
|
425
|
+
'extensions': ['.sv'],
|
|
426
|
+
},
|
|
427
|
+
{
|
|
428
|
+
'value': 'tcl',
|
|
429
|
+
'label': 'TCL',
|
|
430
|
+
'extensions': ['.tcl'],
|
|
431
|
+
},
|
|
432
|
+
{
|
|
433
|
+
'value': 'twig',
|
|
434
|
+
'label': 'Twig',
|
|
435
|
+
'extensions': ['.twig'],
|
|
436
|
+
},
|
|
437
|
+
{
|
|
438
|
+
'value': 'typescript',
|
|
439
|
+
'label': 'TypeScript',
|
|
440
|
+
'extensions': ['.ts', '.tsx'],
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
'value': 'vb',
|
|
444
|
+
'label': 'VB',
|
|
445
|
+
'extensions': ['.vb'],
|
|
446
|
+
},
|
|
447
|
+
{
|
|
448
|
+
'value': 'verilog',
|
|
449
|
+
'label': 'Verilog',
|
|
450
|
+
'extensions': ['.v'],
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
'value': 'xml',
|
|
454
|
+
'label': 'XML',
|
|
455
|
+
'extensions': ['.xml'],
|
|
456
|
+
},
|
|
457
|
+
{
|
|
458
|
+
'value': 'yaml',
|
|
459
|
+
'label': 'YAML',
|
|
460
|
+
'extensions': ['.yaml', '.yml'],
|
|
461
|
+
},
|
|
462
|
+
]
|
package/src/views/Agents.tsx
CHANGED
|
@@ -100,7 +100,7 @@ const AgentsTab = ({ visibility }: { visibility: VisibilityLevel | 'BUILT-IN' })
|
|
|
100
100
|
const chat = useCurrentChat()
|
|
101
101
|
const [filter, setFilter] = useState('')
|
|
102
102
|
const defaultAgent = useMemo(() => ({
|
|
103
|
-
name:
|
|
103
|
+
name: 'Stackspot AI',
|
|
104
104
|
description: t.defaultAgentDescription,
|
|
105
105
|
llm_config: { model_slug: 'gpt4o' },
|
|
106
106
|
} as AgentResponse), [])
|
|
@@ -181,7 +181,6 @@ const dictionary = {
|
|
|
181
181
|
noSearchResultsDescription: 'Please, try another search term.',
|
|
182
182
|
noData: 'There are no agents in this category yet.',
|
|
183
183
|
noDataDescription: 'Use the tabs above to try other categories or use the AI portal to create new agents.',
|
|
184
|
-
defaultAgentName: 'Stackspot AI (default)',
|
|
185
184
|
defaultAgentDescription: 'The StackSpot CodeGen is an advanced artificial intelligence agent designed to optimize and accelerate software development. Integrated directly into your integrated development environment, StackSpot CodeGen offers real-time code suggestions, helping developers write high-quality code more efficiently. With robust features such as creating Stacks AI, customized knowledge sources, and quick commands, StackSpot CodeGen contextualizes your development needs to provide the best answers and code suggestions.',
|
|
186
185
|
},
|
|
187
186
|
pt: {
|
|
@@ -196,7 +195,6 @@ const dictionary = {
|
|
|
196
195
|
noSearchResultsDescription: 'Por favor, tente outra busca.',
|
|
197
196
|
noData: 'Ainda não há agentes nesta categoria.',
|
|
198
197
|
noDataDescription: 'Use as abas acima para tentar outras categorias ou use o Portal AI para criar novos agentes.',
|
|
199
|
-
defaultAgentName: 'Stackspot AI (padrão)',
|
|
200
198
|
defaultAgentDescription: 'O StackSpot CodeGen é um agente de inteligência artificial avançado projetado para otimizar e acelerar o desenvolvimento de software. Integrado diretamente ao seu ambiente de desenvolvimento, o StackSpot CodeGen oferece sugestões de código em tempo real, ajudando os desenvolvedores a escreverem código de alta qualidade de forma mais eficiente. Com recursos robustos, como a criação de Stacks AI, Knowledge Sources personalizadas e comandos rápidos, o StackSpot CodeGen contextualiza suas necessidades de desenvolvimento para fornecer as melhores respostas e sugestões de código.',
|
|
201
199
|
},
|
|
202
200
|
} satisfies Dictionary
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Button, IconBox, Text } from '@citric/core'
|
|
2
|
-
import { Dislike, DislikeFill, Like, LikeFill, TimesCircle } from '@citric/icons'
|
|
2
|
+
import { Copy, Dislike, DislikeFill, Like, LikeFill, TimesCircle } from '@citric/icons'
|
|
3
3
|
import { Avatar, IconButton } from '@citric/ui'
|
|
4
4
|
import { aiClient } from '@stack-spot/portal-network'
|
|
5
5
|
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
@@ -77,13 +77,20 @@ export const ChatMessage = ({ message, username }: { message: ChatEntry, usernam
|
|
|
77
77
|
))}</ul>
|
|
78
78
|
</div>}
|
|
79
79
|
<div className="message-footer">
|
|
80
|
-
{entry.agentType === 'bot' &&
|
|
81
|
-
<IconButton title={t.
|
|
82
|
-
|
|
83
|
-
</IconButton>
|
|
84
|
-
<IconButton title={t.dislike} aria-label={t.dislike} onClick={dislike}>
|
|
85
|
-
{liked === false ? <DislikeFill /> : <Dislike />}
|
|
80
|
+
{entry.agentType === 'bot' && !entry.error && <div className="message-actions">
|
|
81
|
+
<IconButton title={t.copy} aria-label={t.copy} onClick={() => navigator.clipboard.writeText(entry.content)}>
|
|
82
|
+
<Copy />
|
|
86
83
|
</IconButton>
|
|
84
|
+
{entry.messageId && (
|
|
85
|
+
<>
|
|
86
|
+
<IconButton title={t.like} aria-label={t.like} onClick={like}>
|
|
87
|
+
{liked === true ? <LikeFill /> : <Like />}
|
|
88
|
+
</IconButton>
|
|
89
|
+
<IconButton title={t.dislike} aria-label={t.dislike} onClick={dislike}>
|
|
90
|
+
{liked === false ? <DislikeFill /> : <Dislike />}
|
|
91
|
+
</IconButton>
|
|
92
|
+
</>
|
|
93
|
+
)}
|
|
87
94
|
</div>}
|
|
88
95
|
{shouldShowDate && <Text appearance="microtext1" className="chat-date">{dateFormatter.formatForChatMessage(date)}</Text>}
|
|
89
96
|
</div>
|
|
@@ -93,10 +100,12 @@ export const ChatMessage = ({ message, username }: { message: ChatEntry, usernam
|
|
|
93
100
|
|
|
94
101
|
const dictionary = {
|
|
95
102
|
en: {
|
|
103
|
+
copy: 'Copy',
|
|
96
104
|
like: 'Like',
|
|
97
105
|
dislike: 'Dislike',
|
|
98
106
|
},
|
|
99
107
|
pt: {
|
|
108
|
+
copy: 'Copiar',
|
|
100
109
|
like: 'Gostei',
|
|
101
110
|
dislike: 'Não gostei',
|
|
102
111
|
},
|
package/src/views/Chat/styled.ts
CHANGED
|
@@ -112,6 +112,14 @@ export const ChatList = styled.ul`
|
|
|
112
112
|
padding: 10px;
|
|
113
113
|
background-color: ${theme.color.light[500]};
|
|
114
114
|
border-radius: 4px;
|
|
115
|
+
|
|
116
|
+
> p:first-child {
|
|
117
|
+
margin-top: 0;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
> p:last-child {
|
|
121
|
+
margin-bottom: 0;
|
|
122
|
+
}
|
|
115
123
|
}
|
|
116
124
|
}
|
|
117
125
|
}
|
|
@@ -95,7 +95,7 @@ export const HistoryItem = ({ item, interceptors }: { item: ConversationResponse
|
|
|
95
95
|
entries: chat.history?.map(item => new ChatEntry({
|
|
96
96
|
agentType: item.agent === 'USER' ? 'user' : 'bot',
|
|
97
97
|
content: item.content,
|
|
98
|
-
type:
|
|
98
|
+
type: 'md',
|
|
99
99
|
agent: agents.find(a => a.id === item.custom_agent?.id),
|
|
100
100
|
messageId: item.message_id,
|
|
101
101
|
knowledgeSources: item.agent === 'USER' ? undefined : genericSourcesToKnowledgeSources(item.sources),
|
package/src/views/Editor.tsx
CHANGED
|
@@ -1 +1,126 @@
|
|
|
1
|
-
|
|
1
|
+
import { Text } from '@citric/core'
|
|
2
|
+
import { LoadingCircular } from '@citric/ui'
|
|
3
|
+
import MonacoEditor, { OnMount } from '@monaco-editor/react'
|
|
4
|
+
import { Select } from '@stack-spot/portal-components/Select'
|
|
5
|
+
import { useThemeKind } from '@stack-spot/portal-theme'
|
|
6
|
+
import { Dictionary, useTranslate } from '@stack-spot/portal-translate'
|
|
7
|
+
import { debounce } from 'lodash'
|
|
8
|
+
import { IDisposable } from 'monaco-editor'
|
|
9
|
+
import { useCallback, useEffect, useMemo, useRef } from 'react'
|
|
10
|
+
import { styled } from 'styled-components'
|
|
11
|
+
import { useCurrentChat, useCurrentChatState, useWidget, useWidgetState } from '../context/hooks'
|
|
12
|
+
import { useRightPanel } from '../right-panel/hooks'
|
|
13
|
+
import { languages } from '../utils/programming-languages'
|
|
14
|
+
|
|
15
|
+
const DEFAULT_LANGUAGE = 'python'
|
|
16
|
+
const MIN_SELECTION_UPDATE_MS = 200
|
|
17
|
+
|
|
18
|
+
const EditorBox = styled.div`
|
|
19
|
+
flex: 1;
|
|
20
|
+
|
|
21
|
+
.monaco-editor {
|
|
22
|
+
--vscode-editor-background: transparent !important;
|
|
23
|
+
--vscode-editorGutter-background: transparent !important;
|
|
24
|
+
}
|
|
25
|
+
`
|
|
26
|
+
|
|
27
|
+
const TitleBox = styled.div`
|
|
28
|
+
.language-selector {
|
|
29
|
+
width: 150px;
|
|
30
|
+
position: absolute;
|
|
31
|
+
top: 21px;
|
|
32
|
+
right: 61px;
|
|
33
|
+
|
|
34
|
+
.options {
|
|
35
|
+
max-height: 250px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.current-value {
|
|
39
|
+
padding: 2px 8px;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
`
|
|
43
|
+
|
|
44
|
+
export const Editor = () => {
|
|
45
|
+
const t = useTranslate(dictionary)
|
|
46
|
+
const panel = useWidgetState('panel')
|
|
47
|
+
const { open } = useRightPanel()
|
|
48
|
+
const widget = useWidget()
|
|
49
|
+
const chat = useCurrentChat()
|
|
50
|
+
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (panel === 'editor') open(
|
|
53
|
+
<EditorPanel key={chat.id} />,
|
|
54
|
+
{
|
|
55
|
+
title: <Title key={chat.id} />,
|
|
56
|
+
description: t.description,
|
|
57
|
+
onClose: () => widget.set('panel', undefined),
|
|
58
|
+
},
|
|
59
|
+
)
|
|
60
|
+
}, [panel, t, chat])
|
|
61
|
+
|
|
62
|
+
return null
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
const Title = () => {
|
|
66
|
+
const languageValue = useCurrentChatState('codeLanguage') || DEFAULT_LANGUAGE
|
|
67
|
+
const language = useMemo(() => languages.find(l => l.value === languageValue), [languageValue])
|
|
68
|
+
const chat = useCurrentChat()
|
|
69
|
+
return (
|
|
70
|
+
<TitleBox>
|
|
71
|
+
<Text appearance="h5">Editor</Text>
|
|
72
|
+
<Select
|
|
73
|
+
options={languages}
|
|
74
|
+
renderLabel={l => l.label}
|
|
75
|
+
renderValue={l => l.value}
|
|
76
|
+
value={language}
|
|
77
|
+
onChange={l => chat.set('codeLanguage', l.value)}
|
|
78
|
+
className="language-selector"
|
|
79
|
+
/>
|
|
80
|
+
</TitleBox>
|
|
81
|
+
)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
const EditorPanel = () => {
|
|
85
|
+
const themeKind = useThemeKind()
|
|
86
|
+
const value = useCurrentChatState('code')
|
|
87
|
+
const language = useCurrentChatState('codeLanguage') || DEFAULT_LANGUAGE
|
|
88
|
+
const chat = useCurrentChat()
|
|
89
|
+
const selectionObserver = useRef<IDisposable | undefined>()
|
|
90
|
+
|
|
91
|
+
const setup: OnMount = useCallback((editor) => {
|
|
92
|
+
selectionObserver.current = editor.onDidChangeCursorSelection(debounce((e) => {
|
|
93
|
+
const selectedText = editor.getModel()?.getValueInRange(e.selection)
|
|
94
|
+
chat.set('codeSelection', selectedText?.trim() ? selectedText : undefined)
|
|
95
|
+
}, MIN_SELECTION_UPDATE_MS))
|
|
96
|
+
}, [])
|
|
97
|
+
|
|
98
|
+
useEffect(() => () => {
|
|
99
|
+
chat.set('codeSelection', undefined)
|
|
100
|
+
selectionObserver.current?.dispose()
|
|
101
|
+
}, [])
|
|
102
|
+
|
|
103
|
+
return (
|
|
104
|
+
<EditorBox>
|
|
105
|
+
<MonacoEditor
|
|
106
|
+
height="100%"
|
|
107
|
+
language={language}
|
|
108
|
+
theme={themeKind === 'dark' ? 'vs-dark' : 'light'}
|
|
109
|
+
options={{ minimap: { enabled: false } }}
|
|
110
|
+
value={value}
|
|
111
|
+
onChange={v => chat.set('code', v)}
|
|
112
|
+
loading={<LoadingCircular />}
|
|
113
|
+
onMount={setup}
|
|
114
|
+
/>
|
|
115
|
+
</EditorBox>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const dictionary = {
|
|
120
|
+
en: {
|
|
121
|
+
description: 'The selected code in the editor below will be used as part of your questions.',
|
|
122
|
+
},
|
|
123
|
+
pt: {
|
|
124
|
+
description: 'O código selecionado no editor abaixo será usado como parte das suas perguntas.',
|
|
125
|
+
},
|
|
126
|
+
} satisfies Dictionary
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChevronRight, KnowledgeSource, Send, Stack, Times, Workspace } from '@citric/icons'
|
|
1
|
+
import { ChevronRight, Code, KnowledgeSource, Send, Stack, Times, Workspace } from '@citric/icons'
|
|
2
2
|
import { IconButton } from '@citric/ui'
|
|
3
3
|
import { MiniLogo } from '@stack-spot/portal-components/svg'
|
|
4
4
|
import { listToClass } from '@stack-spot/portal-theme'
|
|
@@ -62,6 +62,11 @@ export const ButtonGroup = ({ features, onSend, onCancel, expanded, setExpanded,
|
|
|
62
62
|
<Stack />
|
|
63
63
|
</IconButton>
|
|
64
64
|
)}
|
|
65
|
+
{features.editor && (
|
|
66
|
+
<IconButton aria-label={t.stack} title={t.stack} onClick={() => widget.set('panel', 'editor')}>
|
|
67
|
+
<Code />
|
|
68
|
+
</IconButton>
|
|
69
|
+
)}
|
|
65
70
|
</div>
|
|
66
71
|
<IconButton
|
|
67
72
|
title={expanded ? t.collapse : t.expand}
|