@codingame/monaco-vscode-xterm-addons-common 26.2.2 → 28.0.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/package.json +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContext.js +62 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugAttachment.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugAttachment.js +72 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +79 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptSourceFolder.js +25 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js +117 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.js +11 -12
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +28 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.d.ts +0 -42
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.js +0 -209
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +0 -112
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +0 -1314
package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js
CHANGED
|
@@ -6,7 +6,7 @@ import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codi
|
|
|
6
6
|
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
7
7
|
import { PromptsStorage, AgentFileType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
8
8
|
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
|
|
9
|
-
import { extUri, dirname, joinPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
9
|
+
import { extUri, dirname, joinPath, basename } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
10
10
|
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
11
11
|
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
12
12
|
import { IOpenerService } from '@codingame/monaco-vscode-api/vscode/vs/platform/opener/common/opener.service';
|
|
@@ -15,6 +15,7 @@ import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform
|
|
|
15
15
|
import { getCleanPromptName } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/config/promptFileLocations';
|
|
16
16
|
import { PromptsType, HOOK_DOCUMENTATION_URL, SKILL_DOCUMENTATION_URL, AGENT_DOCUMENTATION_URL, INSTRUCTIONS_DOCUMENTATION_URL, PROMPT_DOCUMENTATION_URL } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
17
17
|
import { NEW_PROMPT_COMMAND_ID, NEW_INSTRUCTIONS_COMMAND_ID, NEW_AGENT_COMMAND_ID, NEW_SKILL_COMMAND_ID } from '../newPromptFileActions.js';
|
|
18
|
+
import { GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID, GENERATE_ON_DEMAND_INSTRUCTIONS_COMMAND_ID, GENERATE_PROMPT_COMMAND_ID, GENERATE_SKILL_COMMAND_ID, GENERATE_AGENT_COMMAND_ID } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
18
19
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
19
20
|
import { askForPromptFileName } from './askForPromptName.js';
|
|
20
21
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
@@ -24,37 +25,38 @@ import { ILabelService } from '@codingame/monaco-vscode-api/vscode/vs/platform/l
|
|
|
24
25
|
import { IProductService } from '@codingame/monaco-vscode-api/vscode/vs/platform/product/common/productService.service';
|
|
25
26
|
import { PromptFileRewriter } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/promptSyntax/promptFileRewriter';
|
|
26
27
|
import { isOrganizationPromptFile } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/utils/promptsServiceUtils';
|
|
28
|
+
import { assertNever } from '@codingame/monaco-vscode-api/vscode/vs/base/common/assert';
|
|
27
29
|
|
|
28
30
|
function newHelpButton(type) {
|
|
29
31
|
const iconClass = ThemeIcon.asClassName(Codicon.question);
|
|
30
32
|
switch (type) {
|
|
31
33
|
case PromptsType.prompt:
|
|
32
34
|
return {
|
|
33
|
-
tooltip: ( localize(
|
|
35
|
+
tooltip: ( localize(6348, "Show help on prompt files")),
|
|
34
36
|
helpURI: ( URI.parse(PROMPT_DOCUMENTATION_URL)),
|
|
35
37
|
iconClass
|
|
36
38
|
};
|
|
37
39
|
case PromptsType.instructions:
|
|
38
40
|
return {
|
|
39
|
-
tooltip: ( localize(
|
|
41
|
+
tooltip: ( localize(6349, "Show help on instruction files")),
|
|
40
42
|
helpURI: ( URI.parse(INSTRUCTIONS_DOCUMENTATION_URL)),
|
|
41
43
|
iconClass
|
|
42
44
|
};
|
|
43
45
|
case PromptsType.agent:
|
|
44
46
|
return {
|
|
45
|
-
tooltip: ( localize(
|
|
47
|
+
tooltip: ( localize(6350, "Show help on custom agent files")),
|
|
46
48
|
helpURI: ( URI.parse(AGENT_DOCUMENTATION_URL)),
|
|
47
49
|
iconClass
|
|
48
50
|
};
|
|
49
51
|
case PromptsType.skill:
|
|
50
52
|
return {
|
|
51
|
-
tooltip: ( localize(
|
|
53
|
+
tooltip: ( localize(6351, "Show help on skill files")),
|
|
52
54
|
helpURI: ( URI.parse(SKILL_DOCUMENTATION_URL)),
|
|
53
55
|
iconClass
|
|
54
56
|
};
|
|
55
57
|
case PromptsType.hook:
|
|
56
58
|
return {
|
|
57
|
-
tooltip: ( localize(
|
|
59
|
+
tooltip: ( localize(6352, "Show help on hook files")),
|
|
58
60
|
helpURI: ( URI.parse(HOOK_DOCUMENTATION_URL)),
|
|
59
61
|
iconClass
|
|
60
62
|
};
|
|
@@ -71,7 +73,7 @@ function isExtensionPromptPath(prompt) {
|
|
|
71
73
|
}
|
|
72
74
|
const NEW_PROMPT_FILE_OPTION = {
|
|
73
75
|
type: "item",
|
|
74
|
-
label: `$(plus) ${( localize(
|
|
76
|
+
label: `$(plus) ${( localize(6353, "New prompt file..."))}`,
|
|
75
77
|
pickable: false,
|
|
76
78
|
alwaysShow: true,
|
|
77
79
|
buttons: [newHelpButton(PromptsType.prompt)],
|
|
@@ -79,23 +81,31 @@ const NEW_PROMPT_FILE_OPTION = {
|
|
|
79
81
|
};
|
|
80
82
|
const NEW_INSTRUCTIONS_FILE_OPTION = {
|
|
81
83
|
type: "item",
|
|
82
|
-
label: `$(plus) ${( localize(
|
|
84
|
+
label: `$(plus) ${( localize(6354, "New instruction file..."))}`,
|
|
83
85
|
pickable: false,
|
|
84
86
|
alwaysShow: true,
|
|
85
87
|
buttons: [newHelpButton(PromptsType.instructions)],
|
|
86
88
|
commandId: NEW_INSTRUCTIONS_COMMAND_ID
|
|
87
89
|
};
|
|
88
|
-
const
|
|
90
|
+
const GENERATE_AGENT_INSTRUCTIONS_OPTION = {
|
|
89
91
|
type: "item",
|
|
90
|
-
label: `$(
|
|
92
|
+
label: `$(sparkle) ${( localize(6355, "Generate agent instructions..."))}`,
|
|
91
93
|
pickable: false,
|
|
92
94
|
alwaysShow: true,
|
|
93
95
|
buttons: [newHelpButton(PromptsType.instructions)],
|
|
94
|
-
commandId:
|
|
96
|
+
commandId: GENERATE_AGENT_INSTRUCTIONS_COMMAND_ID
|
|
97
|
+
};
|
|
98
|
+
const GENERATE_ON_DEMAND_INSTRUCTIONS_OPTION = {
|
|
99
|
+
type: "item",
|
|
100
|
+
label: `$(sparkle) ${( localize(6356, "Generate on-demand instructions..."))}`,
|
|
101
|
+
pickable: false,
|
|
102
|
+
alwaysShow: true,
|
|
103
|
+
buttons: [newHelpButton(PromptsType.instructions)],
|
|
104
|
+
commandId: GENERATE_ON_DEMAND_INSTRUCTIONS_COMMAND_ID
|
|
95
105
|
};
|
|
96
106
|
const NEW_AGENT_FILE_OPTION = {
|
|
97
107
|
type: "item",
|
|
98
|
-
label: `$(plus) ${( localize(
|
|
108
|
+
label: `$(plus) ${( localize(6357, "Create new custom agent..."))}`,
|
|
99
109
|
pickable: false,
|
|
100
110
|
alwaysShow: true,
|
|
101
111
|
buttons: [newHelpButton(PromptsType.agent)],
|
|
@@ -103,36 +113,64 @@ const NEW_AGENT_FILE_OPTION = {
|
|
|
103
113
|
};
|
|
104
114
|
const NEW_SKILL_FILE_OPTION = {
|
|
105
115
|
type: "item",
|
|
106
|
-
label: `$(plus) ${( localize(
|
|
116
|
+
label: `$(plus) ${( localize(6358, "New skill..."))}`,
|
|
107
117
|
pickable: false,
|
|
108
118
|
alwaysShow: true,
|
|
109
119
|
buttons: [newHelpButton(PromptsType.skill)],
|
|
110
120
|
commandId: NEW_SKILL_COMMAND_ID
|
|
111
121
|
};
|
|
122
|
+
const GENERATE_PROMPT_OPTION = {
|
|
123
|
+
type: "item",
|
|
124
|
+
label: `$(sparkle) ${( localize(6359, "Generate prompt..."))}`,
|
|
125
|
+
pickable: false,
|
|
126
|
+
alwaysShow: true,
|
|
127
|
+
buttons: [newHelpButton(PromptsType.prompt)],
|
|
128
|
+
commandId: GENERATE_PROMPT_COMMAND_ID
|
|
129
|
+
};
|
|
130
|
+
const GENERATE_SKILL_OPTION = {
|
|
131
|
+
type: "item",
|
|
132
|
+
label: `$(sparkle) ${( localize(6360, "Generate skill..."))}`,
|
|
133
|
+
pickable: false,
|
|
134
|
+
alwaysShow: true,
|
|
135
|
+
buttons: [newHelpButton(PromptsType.skill)],
|
|
136
|
+
commandId: GENERATE_SKILL_COMMAND_ID
|
|
137
|
+
};
|
|
138
|
+
const GENERATE_AGENT_OPTION = {
|
|
139
|
+
type: "item",
|
|
140
|
+
label: `$(sparkle) ${( localize(6361, "Generate agent..."))}`,
|
|
141
|
+
pickable: false,
|
|
142
|
+
alwaysShow: true,
|
|
143
|
+
buttons: [newHelpButton(PromptsType.agent)],
|
|
144
|
+
commandId: GENERATE_AGENT_COMMAND_ID
|
|
145
|
+
};
|
|
112
146
|
const EDIT_BUTTON = {
|
|
113
|
-
tooltip: ( localize(
|
|
147
|
+
tooltip: ( localize(6362, "Open in Editor")),
|
|
114
148
|
iconClass: ThemeIcon.asClassName(Codicon.fileCode)
|
|
115
149
|
};
|
|
116
150
|
const DELETE_BUTTON = {
|
|
117
|
-
tooltip: ( localize(
|
|
151
|
+
tooltip: ( localize(6363, "Delete")),
|
|
118
152
|
iconClass: ThemeIcon.asClassName(Codicon.trash)
|
|
119
153
|
};
|
|
120
154
|
const RENAME_BUTTON = {
|
|
121
|
-
tooltip: ( localize(
|
|
155
|
+
tooltip: ( localize(6364, "Move and/or Rename")),
|
|
122
156
|
iconClass: ThemeIcon.asClassName(Codicon.replace)
|
|
123
157
|
};
|
|
124
158
|
const COPY_BUTTON = {
|
|
125
|
-
tooltip: ( localize(
|
|
159
|
+
tooltip: ( localize(6365, "Make a Copy")),
|
|
126
160
|
iconClass: ThemeIcon.asClassName(Codicon.copy)
|
|
127
161
|
};
|
|
128
162
|
const MAKE_VISIBLE_BUTTON = {
|
|
129
|
-
tooltip: ( localize(
|
|
163
|
+
tooltip: ( localize(6366, "Hidden from chat view agent picker. Click to show.")),
|
|
130
164
|
iconClass: ThemeIcon.asClassName(Codicon.eyeClosed),
|
|
131
165
|
alwaysVisible: true
|
|
132
166
|
};
|
|
133
167
|
const MAKE_INVISIBLE_BUTTON = {
|
|
134
|
-
tooltip: ( localize(
|
|
135
|
-
iconClass: ThemeIcon.asClassName(Codicon.
|
|
168
|
+
tooltip: ( localize(6367, "Shown in chat view agent picker. Click to hide.")),
|
|
169
|
+
iconClass: ThemeIcon.asClassName(Codicon.eye)
|
|
170
|
+
};
|
|
171
|
+
const RUN_IN_CHAT_BUTTON = {
|
|
172
|
+
tooltip: ( localize(6368, "Run in Chat View")),
|
|
173
|
+
iconClass: ThemeIcon.asClassName(Codicon.play)
|
|
136
174
|
};
|
|
137
175
|
let PromptFilePickers = class PromptFilePickers {
|
|
138
176
|
constructor(
|
|
@@ -162,7 +200,7 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
162
200
|
useSeparators: true
|
|
163
201
|
});
|
|
164
202
|
quickPick.busy = true;
|
|
165
|
-
quickPick.placeholder = ( localize(
|
|
203
|
+
quickPick.placeholder = ( localize(6369, "Searching file system..."));
|
|
166
204
|
try {
|
|
167
205
|
const fileOptions = await this._createPromptPickItems(options, cts.token);
|
|
168
206
|
const activeItem = options.resource && fileOptions.find(
|
|
@@ -234,6 +272,9 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
234
272
|
}
|
|
235
273
|
async _createPromptPickItems(options, token) {
|
|
236
274
|
const buttons = [];
|
|
275
|
+
if (options.type === PromptsType.prompt && options.optionRun !== false) {
|
|
276
|
+
buttons.push(RUN_IN_CHAT_BUTTON);
|
|
277
|
+
}
|
|
237
278
|
if (options.optionEdit !== false) {
|
|
238
279
|
buttons.push(EDIT_BUTTON);
|
|
239
280
|
}
|
|
@@ -260,7 +301,7 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
260
301
|
if (locals.length) {
|
|
261
302
|
result.push({
|
|
262
303
|
type: "separator",
|
|
263
|
-
label: ( localize(
|
|
304
|
+
label: ( localize(6370, "Workspace"))
|
|
264
305
|
});
|
|
265
306
|
result.push(...sortByLabel(await Promise.all(( locals.map(l => this._createPromptPickItem(l, buttons, getVisibility(l), token))))));
|
|
266
307
|
}
|
|
@@ -283,13 +324,16 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
283
324
|
const agentButtons = buttons.filter(b => b !== RENAME_BUTTON);
|
|
284
325
|
result.push({
|
|
285
326
|
type: "separator",
|
|
286
|
-
label: ( localize(
|
|
327
|
+
label: ( localize(6371, "Agent Instructions"))
|
|
287
328
|
});
|
|
288
329
|
result.push(...sortByLabel(await Promise.all(( agentInstructionFiles.map(l => this._createPromptPickItem(l, agentButtons, getVisibility(l), token))))));
|
|
289
330
|
}
|
|
290
331
|
const exts = (await this._promptsService.listPromptFilesForStorage(options.type, PromptsStorage.extension, token)).filter(isExtensionPromptPath);
|
|
291
332
|
if (exts.length) {
|
|
292
333
|
const extButtons = [];
|
|
334
|
+
if (options.type === PromptsType.prompt && options.optionRun !== false) {
|
|
335
|
+
extButtons.push(RUN_IN_CHAT_BUTTON);
|
|
336
|
+
}
|
|
293
337
|
if (options.optionEdit !== false) {
|
|
294
338
|
extButtons.push(EDIT_BUTTON);
|
|
295
339
|
}
|
|
@@ -317,28 +361,44 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
317
361
|
if (users.length) {
|
|
318
362
|
result.push({
|
|
319
363
|
type: "separator",
|
|
320
|
-
label: ( localize(
|
|
364
|
+
label: ( localize(6372, "User Data"))
|
|
321
365
|
});
|
|
322
366
|
result.push(...sortByLabel(await Promise.all(( users.map(u => this._createPromptPickItem(u, buttons, getVisibility(u), token))))));
|
|
323
367
|
}
|
|
368
|
+
const plugins = await this._promptsService.listPromptFilesForStorage(options.type, PromptsStorage.plugin, token);
|
|
369
|
+
if (plugins.length) {
|
|
370
|
+
const pluginButtons = [];
|
|
371
|
+
if (options.optionCopy !== false) {
|
|
372
|
+
pluginButtons.push(COPY_BUTTON);
|
|
373
|
+
}
|
|
374
|
+
result.push({
|
|
375
|
+
type: "separator",
|
|
376
|
+
label: ( localize(6373, "Plugins"))
|
|
377
|
+
});
|
|
378
|
+
result.push(...sortByLabel(await Promise.all(( plugins.map(p => this._createPromptPickItem(p, pluginButtons, getVisibility(p), token))))));
|
|
379
|
+
}
|
|
324
380
|
return result;
|
|
325
381
|
}
|
|
326
382
|
_getExtensionGroupLabel(extPath) {
|
|
327
383
|
if (isOrganizationPromptFile(extPath.uri, extPath.extension.identifier, this._productService)) {
|
|
328
|
-
return localize(
|
|
384
|
+
return localize(6374, "Organization");
|
|
329
385
|
}
|
|
330
|
-
return localize(
|
|
386
|
+
return localize(6375, "Extensions");
|
|
331
387
|
}
|
|
332
388
|
_getNewItems(type) {
|
|
333
389
|
switch (type) {
|
|
334
390
|
case PromptsType.prompt:
|
|
335
|
-
return [NEW_PROMPT_FILE_OPTION];
|
|
391
|
+
return [NEW_PROMPT_FILE_OPTION, GENERATE_PROMPT_OPTION];
|
|
336
392
|
case PromptsType.instructions:
|
|
337
|
-
return [
|
|
393
|
+
return [
|
|
394
|
+
NEW_INSTRUCTIONS_FILE_OPTION,
|
|
395
|
+
GENERATE_ON_DEMAND_INSTRUCTIONS_OPTION,
|
|
396
|
+
GENERATE_AGENT_INSTRUCTIONS_OPTION
|
|
397
|
+
];
|
|
338
398
|
case PromptsType.agent:
|
|
339
|
-
return [NEW_AGENT_FILE_OPTION];
|
|
399
|
+
return [NEW_AGENT_FILE_OPTION, GENERATE_AGENT_OPTION];
|
|
340
400
|
case PromptsType.skill:
|
|
341
|
-
return [NEW_SKILL_FILE_OPTION];
|
|
401
|
+
return [NEW_SKILL_FILE_OPTION, GENERATE_SKILL_OPTION];
|
|
342
402
|
default:
|
|
343
403
|
throw ( new Error(`Unknown prompt type '${type}'.`));
|
|
344
404
|
}
|
|
@@ -360,12 +420,17 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
360
420
|
case PromptsStorage.user:
|
|
361
421
|
tooltip = undefined;
|
|
362
422
|
break;
|
|
423
|
+
case PromptsStorage.plugin:
|
|
424
|
+
tooltip = promptFile.name;
|
|
425
|
+
break;
|
|
426
|
+
default:
|
|
427
|
+
assertNever();
|
|
363
428
|
}
|
|
364
429
|
let iconClass;
|
|
365
430
|
if (visibility === false) {
|
|
366
431
|
buttons = (buttons ?? []).concat(MAKE_VISIBLE_BUTTON);
|
|
367
|
-
promptName = ( localize(
|
|
368
|
-
tooltip = ( localize(
|
|
432
|
+
promptName = ( localize(6376, "{0} (hidden)", promptName));
|
|
433
|
+
tooltip = ( localize(6377, "Hidden from chat view agent picker"));
|
|
369
434
|
} else if (visibility === true) {
|
|
370
435
|
buttons = (buttons ?? []).concat(MAKE_INVISIBLE_BUTTON);
|
|
371
436
|
}
|
|
@@ -403,6 +468,12 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
403
468
|
throw ( new Error(`Unknown button '${JSON.stringify(button)}'.`));
|
|
404
469
|
}
|
|
405
470
|
const value = item.promptFileUri;
|
|
471
|
+
if (button === RUN_IN_CHAT_BUTTON) {
|
|
472
|
+
const commandId = quickPick.keyMods.ctrlCmd === true ? "workbench.action.chat.run-in-new-chat.prompt.current" : "workbench.action.chat.run.prompt.current";
|
|
473
|
+
await this._commandService.executeCommand(commandId, value);
|
|
474
|
+
quickPick.hide();
|
|
475
|
+
return false;
|
|
476
|
+
}
|
|
406
477
|
if (button === EDIT_BUTTON) {
|
|
407
478
|
await this._openerService.open(value);
|
|
408
479
|
return false;
|
|
@@ -432,8 +503,13 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
432
503
|
}
|
|
433
504
|
if (button === DELETE_BUTTON) {
|
|
434
505
|
return await this.keepQuickPickOpen(quickPick, async () => {
|
|
435
|
-
const
|
|
436
|
-
const
|
|
506
|
+
const isSkill = options.type === PromptsType.skill;
|
|
507
|
+
const filename = isSkill ? basename(dirname(value)) : item.label;
|
|
508
|
+
const message = isSkill ? ( localize(
|
|
509
|
+
6378,
|
|
510
|
+
"Are you sure you want to delete skill '{0}' and its folder?",
|
|
511
|
+
filename
|
|
512
|
+
)) : ( localize(6379, "Are you sure you want to delete '{0}'?", filename));
|
|
437
513
|
const {
|
|
438
514
|
confirmed
|
|
439
515
|
} = await this._dialogService.confirm({
|
|
@@ -442,7 +518,11 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
442
518
|
if (!confirmed) {
|
|
443
519
|
return false;
|
|
444
520
|
}
|
|
445
|
-
|
|
521
|
+
const deleteTarget = isSkill ? dirname(value) : value;
|
|
522
|
+
await this._fileService.del(deleteTarget, {
|
|
523
|
+
recursive: isSkill,
|
|
524
|
+
useTrash: true
|
|
525
|
+
});
|
|
446
526
|
return true;
|
|
447
527
|
});
|
|
448
528
|
}
|
|
@@ -476,7 +556,8 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
476
556
|
optionDelete: true,
|
|
477
557
|
optionRename: true,
|
|
478
558
|
optionCopy: true,
|
|
479
|
-
optionVisibility: false
|
|
559
|
+
optionVisibility: false,
|
|
560
|
+
optionRun: false
|
|
480
561
|
};
|
|
481
562
|
try {
|
|
482
563
|
const items = await this._createPromptPickItems(options, cts.token);
|
package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.js
CHANGED
|
@@ -18,9 +18,9 @@ import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
18
18
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
19
19
|
import { isProposedApiEnabled } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions';
|
|
20
20
|
import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/extensions/common/extensions.service';
|
|
21
|
-
import { IChatVariablesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariables.service';
|
|
22
21
|
import { IChatWidgetService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chat.service';
|
|
23
|
-
import {
|
|
22
|
+
import { getDynamicVariablesForWidget } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatVariables';
|
|
23
|
+
import { ChatDynamicVariableModel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables';
|
|
24
24
|
import { cleanupOldImages, createFileForMedia, resizeImage, imageToHash } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatImageUtils';
|
|
25
25
|
|
|
26
26
|
var CopyAttachmentsProvider_1;
|
|
@@ -78,7 +78,7 @@ let PasteImageProvider = class PasteImageProvider {
|
|
|
78
78
|
return;
|
|
79
79
|
}
|
|
80
80
|
const attachedVariables = widget.attachmentModel.attachments;
|
|
81
|
-
const displayName = ( localize(
|
|
81
|
+
const displayName = ( localize(6832, "Pasted Image"));
|
|
82
82
|
let tempDisplayName = displayName;
|
|
83
83
|
for (let appendValue = 2; ( attachedVariables.some(attachment => attachment.name === tempDisplayName)); appendValue++)
|
|
84
84
|
{
|
|
@@ -100,7 +100,7 @@ let PasteImageProvider = class PasteImageProvider {
|
|
|
100
100
|
if (( currentContextIds.has(scaledImageContext.id))) {
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
|
-
const edit = createCustomPasteEdit(model, [scaledImageContext], mimeType, this.kind, ( localize(
|
|
103
|
+
const edit = createCustomPasteEdit(model, [scaledImageContext], mimeType, this.kind, ( localize(6833, "Pasted Image Attachment")), this.chatWidgetService);
|
|
104
104
|
return createEditSession(edit);
|
|
105
105
|
}
|
|
106
106
|
};
|
|
@@ -163,9 +163,8 @@ let CopyAttachmentsProvider = class CopyAttachmentsProvider {
|
|
|
163
163
|
static {
|
|
164
164
|
this.ATTACHMENT_MIME_TYPE = "application/vnd.chat.attachment+json";
|
|
165
165
|
}
|
|
166
|
-
constructor(chatWidgetService
|
|
166
|
+
constructor(chatWidgetService) {
|
|
167
167
|
this.chatWidgetService = chatWidgetService;
|
|
168
|
-
this.chatVariableService = chatVariableService;
|
|
169
168
|
this.kind = ( new HierarchicalKind("chat.attach.attachments"));
|
|
170
169
|
this.providedPasteEditKinds = [this.kind];
|
|
171
170
|
this.copyMimeTypes = [CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE];
|
|
@@ -177,7 +176,7 @@ let CopyAttachmentsProvider = class CopyAttachmentsProvider {
|
|
|
177
176
|
return undefined;
|
|
178
177
|
}
|
|
179
178
|
const attachments = widget.attachmentModel.attachments;
|
|
180
|
-
const dynamicVariables =
|
|
179
|
+
const dynamicVariables = getDynamicVariablesForWidget(widget);
|
|
181
180
|
if (attachments.length === 0 && dynamicVariables.length === 0) {
|
|
182
181
|
return undefined;
|
|
183
182
|
}
|
|
@@ -219,7 +218,7 @@ let CopyAttachmentsProvider = class CopyAttachmentsProvider {
|
|
|
219
218
|
}
|
|
220
219
|
const edit = {
|
|
221
220
|
insertText: textdata,
|
|
222
|
-
title: ( localize(
|
|
221
|
+
title: ( localize(6834, "Insert Prompt & Attachments")),
|
|
223
222
|
kind: this.kind,
|
|
224
223
|
handledMimeType: CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE,
|
|
225
224
|
additionalEdit: {
|
|
@@ -243,7 +242,7 @@ let CopyAttachmentsProvider = class CopyAttachmentsProvider {
|
|
|
243
242
|
return createEditSession(edit);
|
|
244
243
|
}
|
|
245
244
|
};
|
|
246
|
-
CopyAttachmentsProvider = CopyAttachmentsProvider_1 = ( __decorate([( __param(0, IChatWidgetService))
|
|
245
|
+
CopyAttachmentsProvider = CopyAttachmentsProvider_1 = ( __decorate([( __param(0, IChatWidgetService))], CopyAttachmentsProvider));
|
|
247
246
|
class PasteTextProvider {
|
|
248
247
|
constructor(chatWidgetService, modelService) {
|
|
249
248
|
this.chatWidgetService = chatWidgetService;
|
|
@@ -295,7 +294,7 @@ class PasteTextProvider {
|
|
|
295
294
|
if (( currentContextIds.has(copiedContext.id))) {
|
|
296
295
|
return;
|
|
297
296
|
}
|
|
298
|
-
const edit = createCustomPasteEdit(model, [copiedContext], Mimes.text, this.kind, ( localize(
|
|
297
|
+
const edit = createCustomPasteEdit(model, [copiedContext], Mimes.text, this.kind, ( localize(6835, "Pasted Code Attachment")), this.chatWidgetService);
|
|
299
298
|
edit.yieldTo = [{
|
|
300
299
|
kind: HierarchicalKind.Empty.append("text", "plain")
|
|
301
300
|
}];
|
|
@@ -307,7 +306,7 @@ function getCopiedContext(code, file, language, range) {
|
|
|
307
306
|
const start = range.startLineNumber;
|
|
308
307
|
const end = range.endLineNumber;
|
|
309
308
|
const resultText = `Copied Selection of Code: \n\n\n From the file: ${fileName} From lines ${start} to ${end} \n \`\`\`${code}\`\`\``;
|
|
310
|
-
const pastedLines = start === end ? ( localize(
|
|
309
|
+
const pastedLines = start === end ? ( localize(6836, "1 line")) : ( localize(6837, "{0} lines", end + 1 - start));
|
|
311
310
|
return {
|
|
312
311
|
kind: "paste",
|
|
313
312
|
value: resultText,
|
|
@@ -329,7 +328,7 @@ function getCopiedContext(code, file, language, range) {
|
|
|
329
328
|
};
|
|
330
329
|
}
|
|
331
330
|
function createCustomPasteEdit(model, context, handledMimeType, kind, title, chatWidgetService) {
|
|
332
|
-
const label = context.length === 1 ? context[0].name : ( localize(
|
|
331
|
+
const label = context.length === 1 ? context[0].name : ( localize(6838, "{0} and {1} more", context[0].name, context.length - 1));
|
|
333
332
|
const customEdit = {
|
|
334
333
|
resource: model.uri,
|
|
335
334
|
variable: context,
|
|
@@ -410,7 +410,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
410
410
|
})];
|
|
411
411
|
}
|
|
412
412
|
_getContextMenuActions() {
|
|
413
|
-
const label = ( localize(
|
|
413
|
+
const label = ( localize(13201, "Toggle Visibility"));
|
|
414
414
|
return [{
|
|
415
415
|
class: undefined,
|
|
416
416
|
tooltip: label,
|
|
@@ -433,7 +433,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
433
433
|
actions.push(attachToChatAction, ( new Separator()));
|
|
434
434
|
}
|
|
435
435
|
if (command.command !== "") {
|
|
436
|
-
const labelRun = ( localize(
|
|
436
|
+
const labelRun = ( localize(13202, "Rerun Command"));
|
|
437
437
|
actions.push({
|
|
438
438
|
class: undefined,
|
|
439
439
|
tooltip: labelRun,
|
|
@@ -446,11 +446,11 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
446
446
|
}
|
|
447
447
|
if (!command.isTrusted) {
|
|
448
448
|
const shouldRun = await ( new Promise(r => {
|
|
449
|
-
this._notificationService.prompt(Severity.Info, ( localize(
|
|
450
|
-
label: ( localize(
|
|
449
|
+
this._notificationService.prompt(Severity.Info, ( localize(13203, "Do you want to run the command: {0}", command.command)), [{
|
|
450
|
+
label: ( localize(13204, "Yes")),
|
|
451
451
|
run: () => r(true)
|
|
452
452
|
}, {
|
|
453
|
-
label: ( localize(
|
|
453
|
+
label: ( localize(13205, "No")),
|
|
454
454
|
run: () => r(false)
|
|
455
455
|
}]);
|
|
456
456
|
}));
|
|
@@ -464,7 +464,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
464
464
|
}
|
|
465
465
|
});
|
|
466
466
|
actions.push(( new Separator()));
|
|
467
|
-
const labelCopy = ( localize(
|
|
467
|
+
const labelCopy = ( localize(13206, "Copy Command"));
|
|
468
468
|
actions.push({
|
|
469
469
|
class: undefined,
|
|
470
470
|
tooltip: labelCopy,
|
|
@@ -475,7 +475,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
475
475
|
});
|
|
476
476
|
}
|
|
477
477
|
if (command.hasOutput()) {
|
|
478
|
-
const labelCopyCommandAndOutput = ( localize(
|
|
478
|
+
const labelCopyCommandAndOutput = ( localize(13207, "Copy Command and Output"));
|
|
479
479
|
actions.push({
|
|
480
480
|
class: undefined,
|
|
481
481
|
tooltip: labelCopyCommandAndOutput,
|
|
@@ -489,7 +489,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
});
|
|
492
|
-
const labelText = ( localize(
|
|
492
|
+
const labelText = ( localize(13208, "Copy Output"));
|
|
493
493
|
actions.push({
|
|
494
494
|
class: undefined,
|
|
495
495
|
tooltip: labelText,
|
|
@@ -503,7 +503,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
503
503
|
}
|
|
504
504
|
}
|
|
505
505
|
});
|
|
506
|
-
const labelHtml = ( localize(
|
|
506
|
+
const labelHtml = ( localize(13209, "Copy Output as HTML"));
|
|
507
507
|
actions.push({
|
|
508
508
|
class: undefined,
|
|
509
509
|
tooltip: labelHtml,
|
|
@@ -518,7 +518,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
518
518
|
if (actions.length > 0) {
|
|
519
519
|
actions.push(( new Separator()));
|
|
520
520
|
}
|
|
521
|
-
const labelRunRecent = ( localize(
|
|
521
|
+
const labelRunRecent = ( localize(13210, "Run Recent Command"));
|
|
522
522
|
actions.push({
|
|
523
523
|
class: undefined,
|
|
524
524
|
tooltip: labelRunRecent,
|
|
@@ -527,7 +527,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
527
527
|
enabled: true,
|
|
528
528
|
run: () => this._commandService.executeCommand("workbench.action.terminal.runRecentCommand")
|
|
529
529
|
});
|
|
530
|
-
const labelGoToRecent = ( localize(
|
|
530
|
+
const labelGoToRecent = ( localize(13211, "Go To Recent Directory"));
|
|
531
531
|
actions.push({
|
|
532
532
|
class: undefined,
|
|
533
533
|
tooltip: labelRunRecent,
|
|
@@ -537,7 +537,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
537
537
|
run: () => this._commandService.executeCommand("workbench.action.terminal.goToRecentDirectory")
|
|
538
538
|
});
|
|
539
539
|
actions.push(( new Separator()));
|
|
540
|
-
const labelAbout = ( localize(
|
|
540
|
+
const labelAbout = ( localize(13212, "Learn About Shell Integration"));
|
|
541
541
|
actions.push({
|
|
542
542
|
class: undefined,
|
|
543
543
|
tooltip: labelAbout,
|
|
@@ -553,7 +553,7 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
553
553
|
if (!chatIsEnabled) {
|
|
554
554
|
return undefined;
|
|
555
555
|
}
|
|
556
|
-
const labelAttachToChat = ( localize(
|
|
556
|
+
const labelAttachToChat = ( localize(13213, "Attach To Chat"));
|
|
557
557
|
return {
|
|
558
558
|
class: undefined,
|
|
559
559
|
tooltip: labelAttachToChat,
|
|
@@ -595,14 +595,14 @@ let DecorationAddon = class DecorationAddon extends Disposable {
|
|
|
595
595
|
quickPick.hideInput = true;
|
|
596
596
|
quickPick.hideCheckAll = true;
|
|
597
597
|
quickPick.canSelectMany = true;
|
|
598
|
-
quickPick.title = ( localize(
|
|
598
|
+
quickPick.title = ( localize(13214, "Toggle visibility"));
|
|
599
599
|
const configValue = this._configurationService.getValue(TerminalSettingId.ShellIntegrationDecorationsEnabled);
|
|
600
600
|
const gutterIcon = {
|
|
601
|
-
label: ( localize(
|
|
601
|
+
label: ( localize(13215, "Gutter command decorations")),
|
|
602
602
|
picked: configValue !== "never" && configValue !== "overviewRuler"
|
|
603
603
|
};
|
|
604
604
|
const overviewRulerIcon = {
|
|
605
|
-
label: ( localize(
|
|
605
|
+
label: ( localize(13216, "Overview ruler command decorations")),
|
|
606
606
|
picked: configValue !== "never" && configValue !== "gutter"
|
|
607
607
|
};
|
|
608
608
|
quickPick.items = [gutterIcon, overviewRulerIcon];
|
|
@@ -174,6 +174,7 @@ export declare class XtermTerminal extends Disposable implements IXtermTerminal,
|
|
|
174
174
|
focus(): void;
|
|
175
175
|
copySelection(asHtml?: boolean, command?: ITerminalCommand): Promise<void>;
|
|
176
176
|
private _setCursorBlink;
|
|
177
|
+
private _setTextBlinking;
|
|
177
178
|
private _setCursorStyle;
|
|
178
179
|
private _setCursorStyleInactive;
|
|
179
180
|
private _setCursorWidth;
|