@stack-spot/ai-chat-widget 1.0.0-dev.1769120820021 → 1.0.0-dev.1769537635610
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/CHANGELOG.md +7 -0
- package/dist/app-metadata.json +3 -3
- package/dist/chat-interceptors/quick-commands.d.ts.map +1 -1
- package/dist/chat-interceptors/quick-commands.js +9 -232
- package/dist/chat-interceptors/quick-commands.js.map +1 -1
- package/dist/views/Editor.d.ts.map +1 -1
- package/dist/views/Editor.js +16 -2
- package/dist/views/Editor.js.map +1 -1
- package/dist/views/Steps/dictionary.d.ts +1 -1
- package/package.json +1 -1
- package/src/app-metadata.json +3 -3
- package/src/chat-interceptors/quick-commands.ts +14 -275
- package/src/views/Editor.tsx +20 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [2.11.1](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v2.11.0...ai-chat-widget@v2.11.1) (2026-01-20)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* accessibility adjustment in code editor ([#494](https://github.com/stack-spot/portal-ai-chat-widget/issues/494)) ([f6727cd](https://github.com/stack-spot/portal-ai-chat-widget/commit/f6727cdcd68368b78bfa6823f74f453fa7330471))
|
|
9
|
+
|
|
3
10
|
## [2.11.0](https://github.com/stack-spot/portal-ai-chat-widget/compare/ai-chat-widget@v2.10.0...ai-chat-widget@v2.11.0) (2026-01-07)
|
|
4
11
|
|
|
5
12
|
|
package/dist/app-metadata.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
4
|
-
"date": "
|
|
3
|
+
"version": "1.0.0-dev.1769537635610",
|
|
4
|
+
"date": "Tue Jan 27 2026 18:14:01 GMT+0000 (Coordinated Universal Time)",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
{
|
|
7
7
|
"name": "@stack-spot/app-metadata",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
"name": "@stack-spot/portal-network",
|
|
128
|
-
"version": "1.0.0-dev.
|
|
128
|
+
"version": "1.0.0-dev.1769537511491(@stack-spot/auth@6.1.0)(@stack-spot/opa@2.5.0(@stack-spot/auth@6.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@stack-spot/portal-translate@2.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@tanstack/react-query@5.59.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
"name": "@stack-spot/portal-theme",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quick-commands.d.ts","sourceRoot":"","sources":["../../src/chat-interceptors/quick-commands.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"quick-commands.d.ts","sourceRoot":"","sources":["../../src/chat-interceptors/quick-commands.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAI3C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAA;AAE9C,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAwBlD;;;;;;;;;;GAUG;AACH,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,MAAM,GAAG,SAAS,WAiJ7D,SAAS,QAAQ,SAAS,UAAU,WAAW,gCAuC9F"}
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
import { aiClient, CancelledError, StackspotAPIError } from '@stack-spot/portal-network';
|
|
2
2
|
import { interpolate, translate } from '@stack-spot/portal-translate';
|
|
3
|
-
import { isNil } from 'lodash';
|
|
4
3
|
import { ulid } from 'ulid';
|
|
5
4
|
import { AbortedError } from '../AbortedError.js';
|
|
6
5
|
import { quickCommandRegex } from '../regex.js';
|
|
7
6
|
import { ChatEntry } from '../state/ChatEntry.js';
|
|
8
7
|
import { buildConversationContext } from '../utils/chat.js';
|
|
9
|
-
import { getSizeOfString } from '../utils/string.js';
|
|
10
8
|
import { CustomInputs } from './CustomInputs.js';
|
|
11
9
|
/**
|
|
12
10
|
* While the quick command is running, if it takes more than `progressMessageDelayMS` a progress message is shown.
|
|
@@ -50,112 +48,6 @@ export function createQuickCommandInterceptor(widget, getEditor) {
|
|
|
50
48
|
ctx.context.upload_ids = chat.getMessages()
|
|
51
49
|
.flatMap(message => (message.getValue().upload || []).map(upload => upload.id));
|
|
52
50
|
}
|
|
53
|
-
/**
|
|
54
|
-
* Runs an Router step of a quick command.
|
|
55
|
-
*/
|
|
56
|
-
async function runRouterStep(ctx, stepIndex, iteration, progress) {
|
|
57
|
-
const { qc: { slug, steps }, code, resultMap, customInputs } = ctx;
|
|
58
|
-
const step = steps[stepIndex];
|
|
59
|
-
const inputData = Object.keys(customInputs).length > 0 && code ? { ...customInputs, [code]: code } : code ?? customInputs;
|
|
60
|
-
try {
|
|
61
|
-
if (step.slug in iteration) {
|
|
62
|
-
iteration[step.slug] = iteration[step.slug] + 1;
|
|
63
|
-
}
|
|
64
|
-
else {
|
|
65
|
-
iteration[step.slug] = 1;
|
|
66
|
-
}
|
|
67
|
-
const { next_step_slug } = await aiClient.calculateNextStep.mutate({
|
|
68
|
-
stepSlug: step.slug,
|
|
69
|
-
slug: slug,
|
|
70
|
-
quickCommandEvaluateStepRouterRequest: {
|
|
71
|
-
executions_count: iteration[step.slug],
|
|
72
|
-
input_data: inputData,
|
|
73
|
-
slugs_executions: resultMap,
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
if (next_step_slug === step.slug) {
|
|
77
|
-
return runStepsRecursively(stepIndex, progress, ctx, iteration);
|
|
78
|
-
}
|
|
79
|
-
const nextStepIndex = steps?.findIndex((step) => step.slug === next_step_slug);
|
|
80
|
-
if (isNil(nextStepIndex) || nextStepIndex === -1)
|
|
81
|
-
return;
|
|
82
|
-
return runStepsRecursively(nextStepIndex, progress, ctx, iteration);
|
|
83
|
-
}
|
|
84
|
-
catch (error) {
|
|
85
|
-
// eslint-disable-next-line no-console
|
|
86
|
-
console.error('Error executing QC step', error);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Runs a fetch step of a quick command and puts the result in the `resultMap` of the context passed as parameter.
|
|
91
|
-
*/
|
|
92
|
-
async function runFetchStep(ctx, stepIndex) {
|
|
93
|
-
const { qc: { slug, steps }, code, context, resultMap, customInputs, executionId, signal } = ctx;
|
|
94
|
-
const step = steps[stepIndex];
|
|
95
|
-
if (step.is_remote) {
|
|
96
|
-
ctx.isRemote = true;
|
|
97
|
-
const { data } = await aiClient.fetchStepOfQuickCommandRemotely.mutate({
|
|
98
|
-
slug, stepSlug: step.slug,
|
|
99
|
-
quickCommandsExecutionRequest: {
|
|
100
|
-
code_selection: code, context, qc_execution_id: executionId,
|
|
101
|
-
slugs_executions: { ...resultMap, ...customInputs },
|
|
102
|
-
},
|
|
103
|
-
});
|
|
104
|
-
//data is the return of the request in the QC so we do not have full control over the response
|
|
105
|
-
//We handle the usual format with body, status_code and headers, but we might also handle other formats
|
|
106
|
-
const responseData = data;
|
|
107
|
-
resultMap[step.slug] = {
|
|
108
|
-
status: responseData.status_code || 200,
|
|
109
|
-
data: JSON.stringify(responseData.body) ?? JSON.stringify(responseData),
|
|
110
|
-
headers: responseData.headers ?? {},
|
|
111
|
-
};
|
|
112
|
-
return;
|
|
113
|
-
}
|
|
114
|
-
const { headers, data, method, url } = await aiClient.fetchStepOfQuickCommand.mutate({
|
|
115
|
-
slug,
|
|
116
|
-
stepSlug: step.slug,
|
|
117
|
-
quickCommandsExecutionRequest: {
|
|
118
|
-
input_data: code, context, qc_execution_id: executionId,
|
|
119
|
-
slugs_executions: { ...resultMap, ...customInputs },
|
|
120
|
-
},
|
|
121
|
-
}, signal);
|
|
122
|
-
const body = ['get', 'head'].includes(method.toLowerCase()) ? undefined : data;
|
|
123
|
-
const response = await fetch(url, { headers: headers || undefined, body, method, signal });
|
|
124
|
-
if (!response.ok)
|
|
125
|
-
throw new Error(`Failed to execute step "${step.slug}" of quick command "${slug}". Status ${response.status}.`);
|
|
126
|
-
resultMap[step.slug] = {
|
|
127
|
-
status: response.status,
|
|
128
|
-
data: await response.text(),
|
|
129
|
-
headers: Object.fromEntries(response.headers.entries()),
|
|
130
|
-
};
|
|
131
|
-
}
|
|
132
|
-
/**
|
|
133
|
-
* Runs an LLM step of a quick command and puts the result in the `resultMap` of the context passed as parameter.
|
|
134
|
-
*/
|
|
135
|
-
async function runLLMStep({ qc: { slug, steps }, code, customInputs, context, executionId, resultMap, signal }, stepIndex) {
|
|
136
|
-
const step = steps[stepIndex];
|
|
137
|
-
let stepContext = context;
|
|
138
|
-
if (!step.use_uploaded_files) {
|
|
139
|
-
const { upload_ids: _upload_ids, ...contextDataProps } = context;
|
|
140
|
-
stepContext = { ...contextDataProps };
|
|
141
|
-
}
|
|
142
|
-
const stream = aiClient.streamLlmStepOfQuickCommand(slug, step.slug, {
|
|
143
|
-
input_data: code,
|
|
144
|
-
context: stepContext,
|
|
145
|
-
qc_execution_id: executionId,
|
|
146
|
-
slugs_executions: { ...resultMap, ...customInputs },
|
|
147
|
-
});
|
|
148
|
-
signal.addEventListener('abort', () => stream.cancel());
|
|
149
|
-
let finalValue;
|
|
150
|
-
try {
|
|
151
|
-
finalValue = await stream.getValue();
|
|
152
|
-
resultMap[step.slug] = finalValue;
|
|
153
|
-
}
|
|
154
|
-
catch (error) {
|
|
155
|
-
// eslint-disable-next-line no-console
|
|
156
|
-
console.error('Error executing QC step', error);
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
51
|
function updateProgressMessageForStep(message, qc, stepIndex) {
|
|
160
52
|
const t = translate(dictionary);
|
|
161
53
|
message.setValue({
|
|
@@ -185,94 +77,14 @@ export function createQuickCommandInterceptor(widget, getEditor) {
|
|
|
185
77
|
}, showImmediately ? 0 : progressMessageDelayMS);
|
|
186
78
|
return controller;
|
|
187
79
|
}
|
|
188
|
-
async function
|
|
189
|
-
if (currentAttempt >= maxAttempts) {
|
|
190
|
-
throw new Error('Max attempts reached in verify script status');
|
|
191
|
-
}
|
|
192
|
-
await aiClient.getStatusScriptStep.invalidate({ scriptExecutionId });
|
|
193
|
-
const response = await aiClient.getStatusScriptStep.query({ scriptExecutionId });
|
|
194
|
-
if (response.status === 'success') {
|
|
195
|
-
return response;
|
|
196
|
-
}
|
|
197
|
-
if (response.status === 'failure') {
|
|
198
|
-
throw response;
|
|
199
|
-
}
|
|
200
|
-
await new Promise(resolve => { setTimeout(resolve, interval); });
|
|
201
|
-
return getScriptStepStatus(scriptExecutionId, interval, maxAttempts, currentAttempt + 1);
|
|
202
|
-
}
|
|
203
|
-
async function runScriptStep({ qc: { slug, steps }, code, context, resultMap, customInputs, signal }, stepIndex) {
|
|
204
|
-
const step = steps[stepIndex];
|
|
205
|
-
let stepContext = context;
|
|
206
|
-
if (!step.use_uploaded_files) {
|
|
207
|
-
const { upload_ids: _upload_ids, ...contextDataProps } = context;
|
|
208
|
-
stepContext = { ...contextDataProps };
|
|
209
|
-
}
|
|
210
|
-
try {
|
|
211
|
-
const { script_execution_id } = await aiClient.startScriptStep.mutate({
|
|
212
|
-
stepSlug: step.slug,
|
|
213
|
-
slug: slug,
|
|
214
|
-
quickCommandStartScriptRequest: {
|
|
215
|
-
input_data: code,
|
|
216
|
-
custom_inputs: customInputs,
|
|
217
|
-
context: stepContext,
|
|
218
|
-
slugs_executions: resultMap,
|
|
219
|
-
},
|
|
220
|
-
}, signal);
|
|
221
|
-
const scriptResult = await getScriptStepStatus(script_execution_id);
|
|
222
|
-
resultMap[step.slug] = scriptResult;
|
|
223
|
-
}
|
|
224
|
-
catch (error) {
|
|
225
|
-
throw new Error(`Failed to execute step "${step.slug}" of quick command "${slug}". Error ${error}.`);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
async function runStepsRecursively(currentIndex, progress, ctx, iteration) {
|
|
229
|
-
const { qc } = ctx;
|
|
230
|
-
if (!qc.steps || currentIndex >= qc.steps?.length)
|
|
231
|
-
return;
|
|
232
|
-
progress.update(currentIndex);
|
|
233
|
-
if (qc.steps[currentIndex].type === 'ROUTER') {
|
|
234
|
-
await runRouterStep(ctx, currentIndex, iteration, progress);
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
if (qc.steps[currentIndex].type === 'SCRIPT') {
|
|
238
|
-
await runScriptStep(ctx, currentIndex);
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
await (qc.steps[currentIndex].type === 'FETCH' ? runFetchStep(ctx, currentIndex) : runLLMStep(ctx, currentIndex));
|
|
242
|
-
}
|
|
243
|
-
const currentStep = qc.steps?.[currentIndex];
|
|
244
|
-
let nextIndex = currentIndex + 1;
|
|
245
|
-
let nextStepSlug = currentStep.next_step_slug;
|
|
246
|
-
const stepResult = ctx.resultMap[currentStep.slug];
|
|
247
|
-
if (stepResult && typeof stepResult !== 'string' && 'answer_status' in stepResult && !!stepResult.answer_status?.next_step_slug) {
|
|
248
|
-
nextStepSlug = stepResult.answer_status.next_step_slug;
|
|
249
|
-
}
|
|
250
|
-
if (nextStepSlug) {
|
|
251
|
-
nextIndex = nextStepSlug === 'end' ?
|
|
252
|
-
qc.steps.length : qc.steps?.findIndex((step) => step.slug === nextStepSlug);
|
|
253
|
-
}
|
|
254
|
-
await runStepsRecursively(nextIndex, progress, ctx, iteration);
|
|
255
|
-
}
|
|
256
|
-
async function runSteps(ctx) {
|
|
80
|
+
async function runQC(ctx) {
|
|
257
81
|
const progress = showProgressMessage(ctx);
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
}
|
|
265
|
-
async function formatResult({ qc, code, executionId, context, resultMap, customInputs, signal }) {
|
|
266
|
-
const formatted = await aiClient.formatResultOfQuickCommand.mutate({
|
|
267
|
-
slug: qc.slug,
|
|
268
|
-
quickCommandsExecutionRequest: {
|
|
269
|
-
input_data: code,
|
|
270
|
-
context,
|
|
271
|
-
qc_execution_id: executionId,
|
|
272
|
-
slugs_executions: { ...resultMap, ...customInputs },
|
|
273
|
-
},
|
|
274
|
-
}, signal);
|
|
275
|
-
return formatted.result;
|
|
82
|
+
// await runStepsRecursively(0, progress, ctx, {}
|
|
83
|
+
const { qc, ...props } = ctx;
|
|
84
|
+
const context = { ...props, slug: qc.slug };
|
|
85
|
+
const finalResult = await aiClient.runQuickCommand(context, progress);
|
|
86
|
+
progress.remove();
|
|
87
|
+
return finalResult;
|
|
276
88
|
}
|
|
277
89
|
// opens a new chat tab if the quick command doesn't preserve the conversation and the current conversation isn't clean.
|
|
278
90
|
function manageConversationContext(ctx) {
|
|
@@ -314,40 +126,8 @@ export function createQuickCommandInterceptor(widget, getEditor) {
|
|
|
314
126
|
}
|
|
315
127
|
manageConversationContext(ctx);
|
|
316
128
|
await computeCustomInputs(ctx);
|
|
317
|
-
await
|
|
318
|
-
return
|
|
319
|
-
}
|
|
320
|
-
/**
|
|
321
|
-
* This registers a quick command event in the backend (analytics).
|
|
322
|
-
*/
|
|
323
|
-
async function registerAnalyticsEvent({ qc, isRemote, executionId, code = '', context }, status, start) {
|
|
324
|
-
const now = new Date().getTime();
|
|
325
|
-
try {
|
|
326
|
-
await aiClient.createEvent.mutate({
|
|
327
|
-
body: [{
|
|
328
|
-
type: 'custom_quick_command_execution',
|
|
329
|
-
quick_command_event: {
|
|
330
|
-
type: qc.type || '',
|
|
331
|
-
duration_execution: now - start,
|
|
332
|
-
status_execution: status,
|
|
333
|
-
slug: qc.slug,
|
|
334
|
-
qc_execution_id: executionId,
|
|
335
|
-
id: qc.id,
|
|
336
|
-
//@ts-ignore
|
|
337
|
-
is_remote: isRemote,
|
|
338
|
-
},
|
|
339
|
-
code,
|
|
340
|
-
context,
|
|
341
|
-
knowledge_sources: [],
|
|
342
|
-
size: getSizeOfString(code),
|
|
343
|
-
generated_at: now,
|
|
344
|
-
}],
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
|
-
catch (error) {
|
|
348
|
-
// eslint-disable-next-line no-console
|
|
349
|
-
console.warn('Failed to register event: quick command.');
|
|
350
|
-
}
|
|
129
|
+
const result = await runQC(ctx);
|
|
130
|
+
return result;
|
|
351
131
|
}
|
|
352
132
|
/**
|
|
353
133
|
* Writes the result in the chat or in the editor.
|
|
@@ -397,12 +177,10 @@ export function createQuickCommandInterceptor(widget, getEditor) {
|
|
|
397
177
|
signal,
|
|
398
178
|
};
|
|
399
179
|
chat.set('isLoading', true);
|
|
400
|
-
const start = new Date().getTime();
|
|
401
180
|
try {
|
|
402
181
|
const result = await runQuickCommand(ctx);
|
|
403
182
|
if (result) {
|
|
404
183
|
outputResult(ctx, result);
|
|
405
|
-
registerAnalyticsEvent(ctx, '200', start);
|
|
406
184
|
}
|
|
407
185
|
}
|
|
408
186
|
catch (error) {
|
|
@@ -418,7 +196,6 @@ export function createQuickCommandInterceptor(widget, getEditor) {
|
|
|
418
196
|
agent: chat.get('agent'),
|
|
419
197
|
type: 'text',
|
|
420
198
|
}));
|
|
421
|
-
registerAnalyticsEvent(ctx, message, start);
|
|
422
199
|
}
|
|
423
200
|
ctx.chat.set('isLoading', false);
|
|
424
201
|
// prevents the next interceptors from running
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quick-commands.js","sourceRoot":"","sources":["../../src/chat-interceptors/quick-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,cAAc,EAAoB,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAE1G,OAAO,EAAc,WAAW,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAA;AACj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;gBACd,KAAK,EAAE,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;gBACxB,IAAI,EAAE,MAAM;aACb,CAAC,CAAC,CAAA;QACL,CAAC;QACD,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,KAAK,CAAC,CAAA;QAChC,8CAA8C;QAC9C,OAAO,KAAK,CAAA;IACd,CAAC;IAED,OAAO,uBAAuB,CAAA;AAChC,CAAC;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,iBAAiB,EAAE,sFAAsF;QACzG,gBAAgB,EAAE,gJAAgJ;QAClK,QAAQ,EAAE,4CAA4C;QACtD,OAAO,EAAE,kDAAkD;QAC3D,QAAQ,EAAE,0HAA0H;KACrI;IACD,EAAE,EAAE;QACF,iBAAiB,EAAE,2FAA2F;QAC9G,gBAAgB,EAAE,wJAAwJ;QAC1K,QAAQ,EAAE,6CAA6C;QACvD,OAAO,EAAE,wDAAwD;QACjE,QAAQ,EAAE,6HAA6H;KACxI;CACmB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../src/views/Editor.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Editor.d.ts","sourceRoot":"","sources":["../../src/views/Editor.tsx"],"names":[],"mappings":"AAyCA;;GAEG;AACH,eAAO,MAAM,MAAM,YAmBlB,CAAA"}
|
package/dist/views/Editor.js
CHANGED
|
@@ -19,6 +19,7 @@ const EditorBox = styled.div `
|
|
|
19
19
|
--vscode-editor-background: transparent !important;
|
|
20
20
|
--vscode-editorGutter-background: transparent !important;
|
|
21
21
|
}
|
|
22
|
+
|
|
22
23
|
`;
|
|
23
24
|
const TitleBox = styled.div `
|
|
24
25
|
position: relative;
|
|
@@ -57,7 +58,7 @@ const Title = () => {
|
|
|
57
58
|
const languageValue = useCurrentChatState('codeLanguage') || defaultLanguage;
|
|
58
59
|
const language = useMemo(() => languages.find(l => l.value === languageValue), [languageValue]);
|
|
59
60
|
const chat = useCurrentChat();
|
|
60
|
-
return (_jsxs(TitleBox, { children: [_jsx(Text, { appearance: "h5", children: "Editor" }), _jsx(Select, { options: languages, renderLabel: l => l?.label ?? defaultLanguage, renderKey: l => l?.value, value: language, onChange: l => chat.set('codeLanguage', l?.value ?? defaultLanguage), className: "language-selector", searchable: true })] }));
|
|
61
|
+
return (_jsxs(TitleBox, { children: [_jsx(Text, { appearance: "h5", tag: "h2", children: "Editor" }), _jsx(Select, { options: languages, renderLabel: l => l?.label ?? defaultLanguage, renderKey: l => l?.value, value: language, onChange: l => chat.set('codeLanguage', l?.value ?? defaultLanguage), className: "language-selector", searchable: true })] }));
|
|
61
62
|
};
|
|
62
63
|
const EditorPanel = () => {
|
|
63
64
|
const themeKind = useThemeKind();
|
|
@@ -66,6 +67,19 @@ const EditorPanel = () => {
|
|
|
66
67
|
const chat = useCurrentChat();
|
|
67
68
|
const selectionObserver = useRef();
|
|
68
69
|
const setup = useCallback(async (editor) => {
|
|
70
|
+
const container = editor.getContainerDomNode();
|
|
71
|
+
const el = container.querySelector('.native-edit-context');
|
|
72
|
+
if (el && el.hasAttribute('aria-label')) {
|
|
73
|
+
el.removeAttribute('aria-label');
|
|
74
|
+
}
|
|
75
|
+
const observer = new MutationObserver(() => {
|
|
76
|
+
const el = container.querySelector('.native-edit-context');
|
|
77
|
+
if (el && el.hasAttribute('aria-label')) {
|
|
78
|
+
el.removeAttribute('aria-label');
|
|
79
|
+
}
|
|
80
|
+
});
|
|
81
|
+
observer.observe(container, { subtree: true, attributes: true, childList: true });
|
|
82
|
+
editor.onDidDispose(() => observer.disconnect());
|
|
69
83
|
selectionObserver.current = editor.onDidChangeCursorSelection(debounce((e) => {
|
|
70
84
|
const selectedText = editor.getModel()?.getValueInRange(e.selection);
|
|
71
85
|
chat.set('codeSelection', selectedText?.trim() ? selectedText : undefined);
|
|
@@ -83,7 +97,7 @@ const EditorPanel = () => {
|
|
|
83
97
|
selectionObserver.current?.dispose();
|
|
84
98
|
};
|
|
85
99
|
}, []);
|
|
86
|
-
return (_jsx(EditorBox, { children: _jsx(MonacoEditor, { height: "100%", language: language, theme: themeKind === 'dark' ? 'vs-dark' : 'light', options: { minimap: { enabled: false } }, value: value, onChange: v => chat.set('code', v), loading: _jsx(ProgressCircular, {}), onMount: setup }) }));
|
|
100
|
+
return (_jsx(EditorBox, { children: _jsx(MonacoEditor, { height: "100%", language: language, theme: themeKind === 'dark' ? 'vs-dark' : 'light', options: { minimap: { enabled: false }, accessibilitySupport: 'off' }, value: value, onChange: v => chat.set('code', v), loading: _jsx(ProgressCircular, {}), onMount: setup }) }));
|
|
87
101
|
};
|
|
88
102
|
const dictionary = {
|
|
89
103
|
en: {
|
package/dist/views/Editor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Editor.js","sourceRoot":"","sources":["../../src/views/Editor.tsx"],"names":[],"mappings":";AAAA,OAAO,YAAyB,MAAM,sBAAsB,CAAA;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAA;AACzE,OAAO,EAAE,KAAK,EAAE,MAAM,+BAA+B,CAAA;AACrD,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AACvD,OAAO,EAAc,YAAY,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAEjC,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC/D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,mBAAmB,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAA;AACjG,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAC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,EAAE,OAAO,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE,oBAAoB,EAAE,KAAK,EAAE,EACrE,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC,EAClC,OAAO,EAAE,KAAC,gBAAgB,KAAG,EAC7B,OAAO,EAAE,KAAK,GACd,GACQ,CACb,CAAA;AACH,CAAC,CAAA;AAED,MAAM,UAAU,GAAG;IACjB,EAAE,EAAE;QACF,WAAW,EAAE,+EAA+E;KAC7F;IACD,EAAE,EAAE;QACF,WAAW,EAAE,iFAAiF;KAC/F;CACmB,CAAA"}
|
|
@@ -38,6 +38,6 @@ export declare const dictionary: {
|
|
|
38
38
|
userPrompt: string;
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
export declare function useStepsDictionary(): Record<"pending" | "input" | "step" | "steps" | "
|
|
41
|
+
export declare function useStepsDictionary(): Record<"pending" | "input" | "step" | "steps" | "tools" | "answer" | "planning" | "running" | "unknown" | "stepsPanelDescription" | "response" | "executionTime" | "nextAttempt" | "previousAttempt" | "finalAnswer" | "userPrompt", string>;
|
|
42
42
|
export type ToolsDictionary = typeof dictionary['en'];
|
|
43
43
|
//# sourceMappingURL=dictionary.d.ts.map
|
package/package.json
CHANGED
package/src/app-metadata.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stack-spot/ai-chat-widget",
|
|
3
|
-
"version": "1.0.0-dev.
|
|
4
|
-
"date": "
|
|
3
|
+
"version": "1.0.0-dev.1769537635610",
|
|
4
|
+
"date": "Tue Jan 27 2026 18:14:01 GMT+0000 (Coordinated Universal Time)",
|
|
5
5
|
"dependencies": [
|
|
6
6
|
{
|
|
7
7
|
"name": "@stack-spot/app-metadata",
|
|
@@ -125,7 +125,7 @@
|
|
|
125
125
|
},
|
|
126
126
|
{
|
|
127
127
|
"name": "@stack-spot/portal-network",
|
|
128
|
-
"version": "1.0.0-dev.
|
|
128
|
+
"version": "1.0.0-dev.1769537511491(@stack-spot/auth@6.1.0)(@stack-spot/opa@2.5.0(@stack-spot/auth@6.1.0)(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@stack-spot/portal-translate@2.1.0(react-dom@18.2.0(react@18.2.0))(react@18.2.0))(@tanstack/react-query@5.59.16(react@18.2.0))(react-dom@18.2.0(react@18.2.0))(react@18.2.0)"
|
|
129
129
|
},
|
|
130
130
|
{
|
|
131
131
|
"name": "@stack-spot/portal-theme",
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import { aiClient, CancelledError, FixedChatRequest, StackspotAPIError } from '@stack-spot/portal-network'
|
|
2
|
-
import {
|
|
1
|
+
import { aiClient, CancelledError, FixedChatRequest, QCContext as QCContextLib, StackspotAPIError } from '@stack-spot/portal-network'
|
|
2
|
+
import { QuickCommandResponse, QuickCommandStepResult } from '@stack-spot/portal-network/api/ai'
|
|
3
3
|
import { Dictionary, interpolate, translate } from '@stack-spot/portal-translate'
|
|
4
|
-
import { isNil } from 'lodash'
|
|
5
4
|
import type { editor } from 'monaco-editor'
|
|
6
5
|
import { ulid } from 'ulid'
|
|
7
6
|
import { AbortedError } from '../AbortedError'
|
|
@@ -11,7 +10,6 @@ import { ChatState } from '../state/ChatState'
|
|
|
11
10
|
import { LabeledWithImage } from '../state/types'
|
|
12
11
|
import { WidgetState } from '../state/WidgetState'
|
|
13
12
|
import { buildConversationContext } from '../utils/chat'
|
|
14
|
-
import { getSizeOfString } from '../utils/string'
|
|
15
13
|
import { CustomInputs } from './CustomInputs'
|
|
16
14
|
|
|
17
15
|
type SlugExecution = Record<string, QuickCommandStepResult>
|
|
@@ -73,132 +71,6 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
73
71
|
)
|
|
74
72
|
}
|
|
75
73
|
|
|
76
|
-
/**
|
|
77
|
-
* Runs an Router step of a quick command.
|
|
78
|
-
*/
|
|
79
|
-
async function runRouterStep(
|
|
80
|
-
ctx: QCContext,
|
|
81
|
-
stepIndex: number, iteration: Record<string, number>,
|
|
82
|
-
progress: { update: (index: number) => void, remove: () => void },
|
|
83
|
-
) {
|
|
84
|
-
const { qc: { slug, steps }, code, resultMap, customInputs } = ctx
|
|
85
|
-
const step = steps![stepIndex]
|
|
86
|
-
const inputData = Object.keys(customInputs).length > 0 && code ? { ...customInputs, [code]: code } : code ?? customInputs
|
|
87
|
-
try {
|
|
88
|
-
if (step.slug in iteration) {
|
|
89
|
-
iteration[step.slug] = iteration[step.slug] + 1
|
|
90
|
-
} else {
|
|
91
|
-
iteration[step.slug] = 1
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
const { next_step_slug } = await aiClient.calculateNextStep.mutate({
|
|
95
|
-
stepSlug: step.slug,
|
|
96
|
-
slug: slug,
|
|
97
|
-
quickCommandEvaluateStepRouterRequest: {
|
|
98
|
-
executions_count: iteration[step.slug],
|
|
99
|
-
input_data: inputData,
|
|
100
|
-
slugs_executions: resultMap,
|
|
101
|
-
},
|
|
102
|
-
})
|
|
103
|
-
|
|
104
|
-
if (next_step_slug === step.slug) {
|
|
105
|
-
return runStepsRecursively(stepIndex, progress, ctx, iteration)
|
|
106
|
-
}
|
|
107
|
-
const nextStepIndex = steps?.findIndex((step) => step.slug === next_step_slug)
|
|
108
|
-
|
|
109
|
-
if (isNil(nextStepIndex) || nextStepIndex === -1) return
|
|
110
|
-
|
|
111
|
-
return runStepsRecursively(nextStepIndex, progress, ctx, iteration)
|
|
112
|
-
}
|
|
113
|
-
catch (error: any) {
|
|
114
|
-
// eslint-disable-next-line no-console
|
|
115
|
-
console.error('Error executing QC step', error)
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
/**
|
|
120
|
-
* Runs a fetch step of a quick command and puts the result in the `resultMap` of the context passed as parameter.
|
|
121
|
-
*/
|
|
122
|
-
async function runFetchStep(ctx: QCContext, stepIndex: number) {
|
|
123
|
-
const { qc: { slug, steps }, code, context, resultMap, customInputs, executionId, signal } = ctx
|
|
124
|
-
const step = steps![stepIndex] as QuickCommandStepFetchResponse
|
|
125
|
-
if (step.is_remote) {
|
|
126
|
-
ctx.isRemote = true
|
|
127
|
-
|
|
128
|
-
const { data } = await aiClient.fetchStepOfQuickCommandRemotely.mutate({
|
|
129
|
-
slug, stepSlug: step.slug,
|
|
130
|
-
quickCommandsExecutionRequest: {
|
|
131
|
-
code_selection: code, context, qc_execution_id: executionId,
|
|
132
|
-
slugs_executions: { ...resultMap, ...customInputs },
|
|
133
|
-
},
|
|
134
|
-
})
|
|
135
|
-
|
|
136
|
-
//data is the return of the request in the QC so we do not have full control over the response
|
|
137
|
-
//We handle the usual format with body, status_code and headers, but we might also handle other formats
|
|
138
|
-
const responseData = data as any
|
|
139
|
-
resultMap[step.slug] = {
|
|
140
|
-
status: responseData.status_code || 200,
|
|
141
|
-
data: JSON.stringify(responseData.body) ?? JSON.stringify(responseData),
|
|
142
|
-
headers: responseData.headers ?? {},
|
|
143
|
-
}
|
|
144
|
-
return
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
const { headers, data, method, url } = await aiClient.fetchStepOfQuickCommand.mutate({
|
|
148
|
-
slug,
|
|
149
|
-
stepSlug: step.slug,
|
|
150
|
-
quickCommandsExecutionRequest: {
|
|
151
|
-
input_data: code, context, qc_execution_id: executionId,
|
|
152
|
-
slugs_executions: { ...resultMap, ...customInputs },
|
|
153
|
-
},
|
|
154
|
-
}, signal)
|
|
155
|
-
const body = ['get', 'head'].includes(method.toLowerCase()) ? undefined : data
|
|
156
|
-
const response = await fetch(url, { headers: headers || undefined, body, method, signal })
|
|
157
|
-
if (!response.ok) throw new Error(`Failed to execute step "${step.slug}" of quick command "${slug}". Status ${response.status}.`)
|
|
158
|
-
resultMap[step.slug] = {
|
|
159
|
-
status: response.status,
|
|
160
|
-
data: await response.text(),
|
|
161
|
-
headers: Object.fromEntries(response.headers.entries()),
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
|
|
165
|
-
/**
|
|
166
|
-
* Runs an LLM step of a quick command and puts the result in the `resultMap` of the context passed as parameter.
|
|
167
|
-
*/
|
|
168
|
-
async function runLLMStep(
|
|
169
|
-
{ qc: { slug, steps }, code, customInputs, context, executionId, resultMap, signal }: QCContext,
|
|
170
|
-
stepIndex: number,
|
|
171
|
-
) {
|
|
172
|
-
const step = steps![stepIndex] as QuickCommandStepLlmResponse
|
|
173
|
-
let stepContext = context
|
|
174
|
-
if (!step.use_uploaded_files) {
|
|
175
|
-
const { upload_ids: _upload_ids, ...contextDataProps } = context
|
|
176
|
-
stepContext = { ...contextDataProps }
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const stream = aiClient.streamLlmStepOfQuickCommand(
|
|
180
|
-
slug,
|
|
181
|
-
step.slug,
|
|
182
|
-
{
|
|
183
|
-
input_data: code,
|
|
184
|
-
context: stepContext,
|
|
185
|
-
qc_execution_id: executionId,
|
|
186
|
-
slugs_executions: { ...resultMap, ...customInputs },
|
|
187
|
-
},
|
|
188
|
-
)
|
|
189
|
-
|
|
190
|
-
signal.addEventListener('abort', () => stream.cancel())
|
|
191
|
-
|
|
192
|
-
let finalValue: QuickCommandPromptResponse2
|
|
193
|
-
try {
|
|
194
|
-
finalValue = await stream.getValue()
|
|
195
|
-
resultMap[step.slug] = finalValue
|
|
196
|
-
} catch (error: any) {
|
|
197
|
-
// eslint-disable-next-line no-console
|
|
198
|
-
console.error('Error executing QC step', error)
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
|
|
202
74
|
function updateProgressMessageForStep(message: ChatEntry, qc: QuickCommandResponse, stepIndex: number) {
|
|
203
75
|
const t = translate(dictionary)
|
|
204
76
|
message.setValue({
|
|
@@ -230,115 +102,17 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
230
102
|
}, showImmediately ? 0 : progressMessageDelayMS)
|
|
231
103
|
return controller
|
|
232
104
|
}
|
|
233
|
-
async function getScriptStepStatus(
|
|
234
|
-
scriptExecutionId: string,
|
|
235
|
-
interval = 5000,
|
|
236
|
-
maxAttempts = 500,
|
|
237
|
-
currentAttempt = 0,
|
|
238
|
-
): Promise<QuickCommandScriptExecutionResponse> {
|
|
239
|
-
if (currentAttempt >= maxAttempts) {
|
|
240
|
-
throw new Error('Max attempts reached in verify script status')
|
|
241
|
-
}
|
|
242
|
-
await aiClient.getStatusScriptStep.invalidate({ scriptExecutionId })
|
|
243
|
-
const response = await aiClient.getStatusScriptStep.query({ scriptExecutionId })
|
|
244
|
-
|
|
245
|
-
if (response.status === 'success') {
|
|
246
|
-
return response
|
|
247
|
-
}
|
|
248
105
|
|
|
249
|
-
|
|
250
|
-
throw response
|
|
251
|
-
}
|
|
252
|
-
|
|
253
|
-
await new Promise(resolve => {setTimeout(resolve, interval)})
|
|
254
|
-
|
|
255
|
-
return getScriptStepStatus(scriptExecutionId, interval, maxAttempts, currentAttempt + 1)
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
async function runScriptStep(
|
|
259
|
-
{ qc: { slug, steps }, code, context, resultMap, customInputs, signal }: QCContext,
|
|
260
|
-
stepIndex: number,
|
|
261
|
-
) {
|
|
262
|
-
const step = steps![stepIndex] as QuickCommandStepLlmResponse
|
|
263
|
-
let stepContext = context
|
|
264
|
-
if (!step.use_uploaded_files) {
|
|
265
|
-
const { upload_ids: _upload_ids, ...contextDataProps } = context
|
|
266
|
-
stepContext = { ...contextDataProps }
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
try {
|
|
270
|
-
const { script_execution_id } = await aiClient.startScriptStep.mutate({
|
|
271
|
-
stepSlug: step.slug,
|
|
272
|
-
slug: slug,
|
|
273
|
-
quickCommandStartScriptRequest: {
|
|
274
|
-
input_data: code,
|
|
275
|
-
custom_inputs: customInputs,
|
|
276
|
-
context: stepContext,
|
|
277
|
-
slugs_executions: resultMap,
|
|
278
|
-
},
|
|
279
|
-
}, signal)
|
|
280
|
-
const scriptResult = await getScriptStepStatus(script_execution_id)
|
|
281
|
-
resultMap[step.slug] = scriptResult
|
|
282
|
-
}
|
|
283
|
-
catch (error: any) {
|
|
284
|
-
throw new Error(`Failed to execute step "${step.slug}" of quick command "${slug}". Error ${error}.`)
|
|
285
|
-
}
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
async function runStepsRecursively(currentIndex: number, progress: { update: (index: number) => void, remove: () => void },
|
|
289
|
-
ctx: QCContext, iteration: Record<string, number>) {
|
|
290
|
-
const { qc } = ctx
|
|
291
|
-
|
|
292
|
-
if (!qc.steps || currentIndex >= qc.steps?.length) return
|
|
293
|
-
progress.update(currentIndex)
|
|
294
|
-
|
|
295
|
-
if (qc.steps[currentIndex].type === 'ROUTER') {
|
|
296
|
-
await runRouterStep(ctx, currentIndex, iteration, progress)
|
|
297
|
-
return
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
if (qc.steps[currentIndex].type === 'SCRIPT') {
|
|
301
|
-
await runScriptStep(ctx, currentIndex)
|
|
302
|
-
} else {
|
|
303
|
-
await (qc.steps[currentIndex].type === 'FETCH' ? runFetchStep(ctx, currentIndex) : runLLMStep(ctx, currentIndex))
|
|
304
|
-
}
|
|
305
|
-
|
|
306
|
-
const currentStep = qc.steps?.[currentIndex] as QuickCommandStepFetchResponse | QuickCommandStepLlmResponse
|
|
307
|
-
let nextIndex = currentIndex + 1
|
|
308
|
-
|
|
309
|
-
let nextStepSlug = currentStep.next_step_slug
|
|
310
|
-
const stepResult = ctx.resultMap[currentStep.slug]
|
|
311
|
-
if (stepResult && typeof stepResult !== 'string' && 'answer_status' in stepResult && !!stepResult.answer_status?.next_step_slug) {
|
|
312
|
-
nextStepSlug = stepResult.answer_status.next_step_slug
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
if (nextStepSlug) {
|
|
316
|
-
nextIndex = nextStepSlug === 'end' ?
|
|
317
|
-
qc.steps.length : qc.steps?.findIndex((step) => step.slug === nextStepSlug)
|
|
318
|
-
}
|
|
319
|
-
await runStepsRecursively(nextIndex, progress, ctx, iteration)
|
|
320
|
-
}
|
|
321
|
-
|
|
322
|
-
async function runSteps(ctx: QCContext) {
|
|
106
|
+
async function runQC(ctx: QCContext) {
|
|
323
107
|
const progress = showProgressMessage(ctx)
|
|
324
|
-
try {
|
|
325
|
-
await runStepsRecursively(0, progress, ctx, {})
|
|
326
|
-
} finally {
|
|
327
|
-
progress.remove()
|
|
328
|
-
}
|
|
329
|
-
}
|
|
330
108
|
|
|
331
|
-
|
|
332
|
-
const
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
slugs_executions: { ...resultMap, ...customInputs },
|
|
339
|
-
},
|
|
340
|
-
}, signal)
|
|
341
|
-
return formatted.result
|
|
109
|
+
// await runStepsRecursively(0, progress, ctx, {}
|
|
110
|
+
const { qc, ...props } = ctx
|
|
111
|
+
const context: QCContextLib = { ...props, slug: qc.slug }
|
|
112
|
+
const finalResult = await aiClient.runQuickCommand(context, progress)
|
|
113
|
+
|
|
114
|
+
progress.remove()
|
|
115
|
+
return finalResult
|
|
342
116
|
}
|
|
343
117
|
|
|
344
118
|
// opens a new chat tab if the quick command doesn't preserve the conversation and the current conversation isn't clean.
|
|
@@ -368,7 +142,7 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
368
142
|
} catch (error) {
|
|
369
143
|
throw error instanceof StackspotAPIError && error.status === 404 ? new Error(t.notFound) : error
|
|
370
144
|
}
|
|
371
|
-
|
|
145
|
+
|
|
372
146
|
if (ctx.qc.use_selected_code && (!code && ctx.context.upload_ids?.length === 0)) {
|
|
373
147
|
widget.set('panel', 'editor')
|
|
374
148
|
ctx.chat.pushMessage(new ChatEntry({
|
|
@@ -377,44 +151,12 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
377
151
|
agent: ctx.chat.get('agent'),
|
|
378
152
|
content: t.requiresSelection,
|
|
379
153
|
}))
|
|
380
|
-
return
|
|
154
|
+
return
|
|
381
155
|
}
|
|
382
156
|
manageConversationContext(ctx)
|
|
383
157
|
await computeCustomInputs(ctx)
|
|
384
|
-
await
|
|
385
|
-
return
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
/**
|
|
389
|
-
* This registers a quick command event in the backend (analytics).
|
|
390
|
-
*/
|
|
391
|
-
async function registerAnalyticsEvent({ qc, isRemote, executionId, code = '', context }: QCContext, status: string, start: number) {
|
|
392
|
-
const now = new Date().getTime()
|
|
393
|
-
try {
|
|
394
|
-
await aiClient.createEvent.mutate({
|
|
395
|
-
body: [{
|
|
396
|
-
type: 'custom_quick_command_execution',
|
|
397
|
-
quick_command_event: {
|
|
398
|
-
type: qc.type || '',
|
|
399
|
-
duration_execution: now - start,
|
|
400
|
-
status_execution: status,
|
|
401
|
-
slug: qc.slug,
|
|
402
|
-
qc_execution_id: executionId,
|
|
403
|
-
id: qc.id,
|
|
404
|
-
//@ts-ignore
|
|
405
|
-
is_remote: isRemote,
|
|
406
|
-
},
|
|
407
|
-
code,
|
|
408
|
-
context,
|
|
409
|
-
knowledge_sources: [],
|
|
410
|
-
size: getSizeOfString(code),
|
|
411
|
-
generated_at: now,
|
|
412
|
-
}],
|
|
413
|
-
})
|
|
414
|
-
} catch (error) {
|
|
415
|
-
// eslint-disable-next-line no-console
|
|
416
|
-
console.warn('Failed to register event: quick command.')
|
|
417
|
-
}
|
|
158
|
+
const result = await runQC(ctx)
|
|
159
|
+
return result
|
|
418
160
|
}
|
|
419
161
|
|
|
420
162
|
/**
|
|
@@ -462,12 +204,10 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
462
204
|
signal,
|
|
463
205
|
}
|
|
464
206
|
chat.set('isLoading', true)
|
|
465
|
-
const start = new Date().getTime()
|
|
466
207
|
try {
|
|
467
208
|
const result = await runQuickCommand(ctx)
|
|
468
209
|
if (result) {
|
|
469
210
|
outputResult(ctx, result)
|
|
470
|
-
registerAnalyticsEvent(ctx, '200', start)
|
|
471
211
|
}
|
|
472
212
|
} catch (error: any) {
|
|
473
213
|
let message = error.message || `${error}`
|
|
@@ -480,7 +220,6 @@ export function createQuickCommandInterceptor(widget: WidgetState, getEditor: ()
|
|
|
480
220
|
agent: chat.get('agent'),
|
|
481
221
|
type: 'text',
|
|
482
222
|
}))
|
|
483
|
-
registerAnalyticsEvent(ctx, message, start)
|
|
484
223
|
}
|
|
485
224
|
ctx.chat.set('isLoading', false)
|
|
486
225
|
// prevents the next interceptors from running
|
package/src/views/Editor.tsx
CHANGED
|
@@ -21,6 +21,7 @@ const EditorBox = styled.div`
|
|
|
21
21
|
--vscode-editor-background: transparent !important;
|
|
22
22
|
--vscode-editorGutter-background: transparent !important;
|
|
23
23
|
}
|
|
24
|
+
|
|
24
25
|
`
|
|
25
26
|
|
|
26
27
|
const TitleBox = styled.div`
|
|
@@ -69,7 +70,7 @@ const Title = () => {
|
|
|
69
70
|
|
|
70
71
|
return (
|
|
71
72
|
<TitleBox>
|
|
72
|
-
<Text appearance="h5">Editor</Text>
|
|
73
|
+
<Text appearance="h5" tag="h2" >Editor</Text>
|
|
73
74
|
<Select
|
|
74
75
|
options={languages}
|
|
75
76
|
renderLabel={l => l?.label ?? defaultLanguage}
|
|
@@ -91,6 +92,22 @@ const EditorPanel = () => {
|
|
|
91
92
|
const selectionObserver = useRef<IDisposable | undefined>()
|
|
92
93
|
|
|
93
94
|
const setup: OnMount = useCallback(async (editor) => {
|
|
95
|
+
const container = editor.getContainerDomNode()
|
|
96
|
+
const el = container.querySelector('.native-edit-context')
|
|
97
|
+
if (el && el.hasAttribute('aria-label')) {
|
|
98
|
+
el.removeAttribute('aria-label')
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
const observer = new MutationObserver(() => {
|
|
102
|
+
const el = container.querySelector('.native-edit-context')
|
|
103
|
+
if (el && el.hasAttribute('aria-label')) {
|
|
104
|
+
el.removeAttribute('aria-label')
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
observer.observe(container, { subtree: true, attributes: true, childList: true })
|
|
108
|
+
|
|
109
|
+
editor.onDidDispose(() => observer.disconnect())
|
|
110
|
+
|
|
94
111
|
selectionObserver.current = editor.onDidChangeCursorSelection(debounce((e) => {
|
|
95
112
|
const selectedText = editor.getModel()?.getValueInRange(e.selection)
|
|
96
113
|
chat.set('codeSelection', selectedText?.trim() ? selectedText : undefined)
|
|
@@ -110,14 +127,14 @@ const EditorPanel = () => {
|
|
|
110
127
|
selectionObserver.current?.dispose()
|
|
111
128
|
}
|
|
112
129
|
}, [])
|
|
113
|
-
|
|
130
|
+
|
|
114
131
|
return (
|
|
115
132
|
<EditorBox>
|
|
116
133
|
<MonacoEditor
|
|
117
134
|
height="100%"
|
|
118
135
|
language={language}
|
|
119
136
|
theme={themeKind === 'dark' ? 'vs-dark' : 'light'}
|
|
120
|
-
options={{ minimap: { enabled: false } }}
|
|
137
|
+
options={{ minimap: { enabled: false }, accessibilitySupport: 'off' }}
|
|
121
138
|
value={value}
|
|
122
139
|
onChange={v => chat.set('code', v)}
|
|
123
140
|
loading={<ProgressCircular />}
|