@codingame/monaco-vscode-xterm-addons-common 29.1.1 → 30.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.js +66 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugAttachment.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/newPromptFileActions.js +15 -15
- 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.js +32 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.js +8 -8
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminal/browser/xterm/xtermTerminal.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-xterm-addons-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "30.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - common package depending on xterm addons",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,15 +15,15 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
19
|
-
"@xterm/addon-clipboard": "0.3.0-beta.
|
|
20
|
-
"@xterm/addon-image": "0.10.0-beta.
|
|
21
|
-
"@xterm/addon-ligatures": "0.11.0-beta.
|
|
22
|
-
"@xterm/addon-progress": "0.3.0-beta.
|
|
23
|
-
"@xterm/addon-search": "0.17.0-beta.
|
|
24
|
-
"@xterm/addon-serialize": "0.15.0-beta.
|
|
25
|
-
"@xterm/addon-unicode11": "0.10.0-beta.
|
|
26
|
-
"@xterm/addon-webgl": "0.20.0-beta.
|
|
18
|
+
"@codingame/monaco-vscode-api": "30.0.0",
|
|
19
|
+
"@xterm/addon-clipboard": "0.3.0-beta.195",
|
|
20
|
+
"@xterm/addon-image": "0.10.0-beta.195",
|
|
21
|
+
"@xterm/addon-ligatures": "0.11.0-beta.195",
|
|
22
|
+
"@xterm/addon-progress": "0.3.0-beta.195",
|
|
23
|
+
"@xterm/addon-search": "0.17.0-beta.195",
|
|
24
|
+
"@xterm/addon-serialize": "0.15.0-beta.195",
|
|
25
|
+
"@xterm/addon-unicode11": "0.10.0-beta.195",
|
|
26
|
+
"@xterm/addon-webgl": "0.20.0-beta.194"
|
|
27
27
|
},
|
|
28
28
|
"exports": {
|
|
29
29
|
".": {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
4
|
+
import { CancellationToken } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
4
5
|
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
6
|
import { isElectron } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
6
7
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
@@ -17,11 +18,14 @@ import { NotebookEditorInput } from '@codingame/monaco-vscode-api/vscode/vs/work
|
|
|
17
18
|
import { IChatContextPickService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatContextPickService.service';
|
|
18
19
|
import { toToolSetVariableEntry, toToolVariableEntry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/attachments/chatVariableEntries';
|
|
19
20
|
import { isToolSet, ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
21
|
+
import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
|
|
20
22
|
import { isImage } from '../widget/input/editor/chatPasteProviders.js';
|
|
21
23
|
import { convertBufferToScreenshotVariable } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/attachments/chatScreenshotContext';
|
|
22
24
|
import { ChatInstructionsPickerPick } from '../promptSyntax/attachInstructionsAction.js';
|
|
23
25
|
import { createDebugEventsAttachment } from '../chatDebug/chatDebugAttachment.js';
|
|
24
26
|
import { IChatDebugService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service';
|
|
27
|
+
import { IChatSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService.service';
|
|
28
|
+
import { AgentSessionProviders, getAgentSessionProviderIcon } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessions';
|
|
25
29
|
import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
26
30
|
import { TerminalCapability } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities';
|
|
27
31
|
import { imageToHash } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/chatImageUtils';
|
|
@@ -50,13 +54,16 @@ let ChatContextContributions = class ChatContextContributions extends Disposable
|
|
|
50
54
|
this._store.add(
|
|
51
55
|
contextPickService.registerChatContextItem(instantiationService.createInstance(DebugEventsSnapshotContextValuePick))
|
|
52
56
|
);
|
|
57
|
+
this._store.add(
|
|
58
|
+
contextPickService.registerChatContextItem(instantiationService.createInstance(SessionReferenceContextPickerPick))
|
|
59
|
+
);
|
|
53
60
|
}
|
|
54
61
|
};
|
|
55
62
|
ChatContextContributions = ( __decorate([( __param(0, IInstantiationService)), ( __param(1, IChatContextPickService))], ChatContextContributions));
|
|
56
63
|
class ToolsContextPickerPick {
|
|
57
64
|
constructor() {
|
|
58
65
|
this.type = "pickerPick";
|
|
59
|
-
this.label = ( localize(
|
|
66
|
+
this.label = ( localize(4861, "Tools..."));
|
|
60
67
|
this.icon = Codicon.tools;
|
|
61
68
|
this.ordinal = -500;
|
|
62
69
|
}
|
|
@@ -107,7 +114,7 @@ class ToolsContextPickerPick {
|
|
|
107
114
|
picks.push(item);
|
|
108
115
|
}
|
|
109
116
|
return {
|
|
110
|
-
placeholder: ( localize(
|
|
117
|
+
placeholder: ( localize(4862, "Select a tool")),
|
|
111
118
|
picks: Promise.resolve(picks)
|
|
112
119
|
};
|
|
113
120
|
}
|
|
@@ -117,7 +124,7 @@ let OpenEditorContextValuePick = class OpenEditorContextValuePick {
|
|
|
117
124
|
this._editorService = _editorService;
|
|
118
125
|
this._labelService = _labelService;
|
|
119
126
|
this.type = "valuePick";
|
|
120
|
-
this.label = ( localize(
|
|
127
|
+
this.label = ( localize(4863, "Open Editors"));
|
|
121
128
|
this.icon = Codicon.file;
|
|
122
129
|
this.ordinal = 800;
|
|
123
130
|
}
|
|
@@ -153,7 +160,7 @@ let ClipboardImageContextValuePick = class ClipboardImageContextValuePick {
|
|
|
153
160
|
constructor(_clipboardService) {
|
|
154
161
|
this._clipboardService = _clipboardService;
|
|
155
162
|
this.type = "valuePick";
|
|
156
|
-
this.label = ( localize(
|
|
163
|
+
this.label = ( localize(4864, "Image from Clipboard"));
|
|
157
164
|
this.icon = Codicon.fileMedia;
|
|
158
165
|
}
|
|
159
166
|
async isEnabled(widget) {
|
|
@@ -170,8 +177,8 @@ let ClipboardImageContextValuePick = class ClipboardImageContextValuePick {
|
|
|
170
177
|
const fileBuffer = await this._clipboardService.readImage();
|
|
171
178
|
return {
|
|
172
179
|
id: await imageToHash(fileBuffer),
|
|
173
|
-
name: ( localize(
|
|
174
|
-
fullName: ( localize(
|
|
180
|
+
name: ( localize(4865, "Pasted Image")),
|
|
181
|
+
fullName: ( localize(4865, "Pasted Image")),
|
|
175
182
|
value: fileBuffer,
|
|
176
183
|
kind: "image"
|
|
177
184
|
};
|
|
@@ -184,7 +191,7 @@ let TerminalContext = class TerminalContext {
|
|
|
184
191
|
this._terminalService = _terminalService;
|
|
185
192
|
this.type = "valuePick";
|
|
186
193
|
this.icon = Codicon.terminal;
|
|
187
|
-
this.label = ( localize(
|
|
194
|
+
this.label = ( localize(4866, "Terminal"));
|
|
188
195
|
}
|
|
189
196
|
isEnabled(widget) {
|
|
190
197
|
const terminal = this._terminalService.getInstanceFromResource(this._resource);
|
|
@@ -249,7 +256,7 @@ let ScreenshotContextValuePick = class ScreenshotContextValuePick {
|
|
|
249
256
|
this._hostService = _hostService;
|
|
250
257
|
this.type = "valuePick";
|
|
251
258
|
this.icon = Codicon.deviceCamera;
|
|
252
|
-
this.label = (isElectron ? ( localize(
|
|
259
|
+
this.label = (isElectron ? ( localize(4867, "Screenshot Window")) : ( localize(4868, "Screenshot")));
|
|
253
260
|
}
|
|
254
261
|
async isEnabled(widget) {
|
|
255
262
|
return !!widget.attachmentCapabilities.supportsImageAttachments && !!widget.input.selectedLanguageModel.get()?.metadata.capabilities?.vision;
|
|
@@ -265,7 +272,7 @@ let DebugEventsSnapshotContextValuePick = class DebugEventsSnapshotContextValueP
|
|
|
265
272
|
this._chatDebugService = _chatDebugService;
|
|
266
273
|
this.type = "valuePick";
|
|
267
274
|
this.icon = Codicon.output;
|
|
268
|
-
this.label = ( localize(
|
|
275
|
+
this.label = ( localize(4869, "Debug Events Snapshot"));
|
|
269
276
|
this.ordinal = -600;
|
|
270
277
|
}
|
|
271
278
|
isEnabled(widget) {
|
|
@@ -281,5 +288,55 @@ let DebugEventsSnapshotContextValuePick = class DebugEventsSnapshotContextValueP
|
|
|
281
288
|
}
|
|
282
289
|
};
|
|
283
290
|
DebugEventsSnapshotContextValuePick = ( __decorate([( __param(0, IChatDebugService))], DebugEventsSnapshotContextValuePick));
|
|
291
|
+
let SessionReferenceContextPickerPick = class SessionReferenceContextPickerPick {
|
|
292
|
+
constructor(_chatSessionsService) {
|
|
293
|
+
this._chatSessionsService = _chatSessionsService;
|
|
294
|
+
this.type = "pickerPick";
|
|
295
|
+
this.icon = Codicon.comment;
|
|
296
|
+
this.label = ( localize(4870, "Sessions..."));
|
|
297
|
+
this.ordinal = -400;
|
|
298
|
+
}
|
|
299
|
+
isEnabled(widget) {
|
|
300
|
+
return widget.location === ChatAgentLocation.Chat;
|
|
301
|
+
}
|
|
302
|
+
asPicker(widget) {
|
|
303
|
+
const currentSessionResource = widget.viewModel?.sessionResource;
|
|
304
|
+
return {
|
|
305
|
+
placeholder: ( localize(4871, "Select a session")),
|
|
306
|
+
picks: (async () => {
|
|
307
|
+
const picks = [];
|
|
308
|
+
const sessionProviderFilter = [
|
|
309
|
+
AgentSessionProviders.Local,
|
|
310
|
+
AgentSessionProviders.Background,
|
|
311
|
+
AgentSessionProviders.Claude
|
|
312
|
+
];
|
|
313
|
+
for await (const group of this._chatSessionsService.getChatSessionItems(sessionProviderFilter, CancellationToken.None)) {
|
|
314
|
+
const providerIcon = getAgentSessionProviderIcon(group.chatSessionType);
|
|
315
|
+
for (const item of group.items) {
|
|
316
|
+
if (currentSessionResource && ( item.resource.toString()) === ( currentSessionResource.toString())) {
|
|
317
|
+
continue;
|
|
318
|
+
}
|
|
319
|
+
const sessionResource = item.resource;
|
|
320
|
+
const icon = item.iconPath ?? providerIcon;
|
|
321
|
+
picks.push({
|
|
322
|
+
label: item.label,
|
|
323
|
+
description: ( new Date(item.timing.lastRequestEnded ?? item.timing.created)).toLocaleString(),
|
|
324
|
+
asAttachment: () => ({
|
|
325
|
+
kind: "sessionReference",
|
|
326
|
+
id: ( sessionResource.toString()),
|
|
327
|
+
name: item.label,
|
|
328
|
+
value: sessionResource,
|
|
329
|
+
icon
|
|
330
|
+
})
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
picks.sort((a, b) => (b.description ?? "").localeCompare(a.description ?? ""));
|
|
335
|
+
return picks;
|
|
336
|
+
})()
|
|
337
|
+
};
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
SessionReferenceContextPickerPick = ( __decorate([( __param(0, IChatSessionsService))], SessionReferenceContextPickerPick));
|
|
284
341
|
|
|
285
342
|
export { ChatContextContributions, TerminalContext };
|
|
@@ -9,10 +9,10 @@ async function createDebugEventsAttachment(sessionResource, chatDebugService) {
|
|
|
9
9
|
await chatDebugService.invokeProviders(sessionResource);
|
|
10
10
|
}
|
|
11
11
|
const events = chatDebugService.getEvents(sessionResource);
|
|
12
|
-
const summary = events.length > 0 ? formatDebugEventsForContext(events) : ( localize(
|
|
12
|
+
const summary = events.length > 0 ? formatDebugEventsForContext(events) : ( localize(5789, "No debug events found for this conversation."));
|
|
13
13
|
return {
|
|
14
14
|
id: "chatDebugEvents",
|
|
15
|
-
name: ( localize(
|
|
15
|
+
name: ( localize(5790, "Debug Events Snapshot")),
|
|
16
16
|
icon: Codicon.output,
|
|
17
17
|
kind: "debugEvents",
|
|
18
18
|
snapshotTime: Date.now(),
|
package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/attachInstructionsAction.js
CHANGED
|
@@ -23,8 +23,8 @@ class ManageInstructionsFilesAction extends Action2 {
|
|
|
23
23
|
constructor() {
|
|
24
24
|
super({
|
|
25
25
|
id: CONFIGURE_INSTRUCTIONS_ACTION_ID,
|
|
26
|
-
title: ( localize2(
|
|
27
|
-
shortTitle: ( localize2(
|
|
26
|
+
title: ( localize2(6472, "Configure Instructions & Rules...")),
|
|
27
|
+
shortTitle: ( localize2(6473, "Instructions & Rules")),
|
|
28
28
|
icon: Codicon.bookmark,
|
|
29
29
|
f1: true,
|
|
30
30
|
precondition: ChatContextKeys.enabled,
|
|
@@ -41,7 +41,7 @@ class ManageInstructionsFilesAction extends Action2 {
|
|
|
41
41
|
const openerService = accessor.get(IOpenerService);
|
|
42
42
|
const instaService = accessor.get(IInstantiationService);
|
|
43
43
|
const pickers = instaService.createInstance(PromptFilePickers);
|
|
44
|
-
const placeholder = ( localize(
|
|
44
|
+
const placeholder = ( localize(6474, "Select the instructions file to open"));
|
|
45
45
|
const result = await pickers.selectPromptFile({
|
|
46
46
|
placeholder,
|
|
47
47
|
type: PromptsType.instructions,
|
|
@@ -59,7 +59,7 @@ let ChatInstructionsPickerPick = class ChatInstructionsPickerPick {
|
|
|
59
59
|
constructor(promptsService) {
|
|
60
60
|
this.promptsService = promptsService;
|
|
61
61
|
this.type = "pickerPick";
|
|
62
|
-
this.label = ( localize(
|
|
62
|
+
this.label = ( localize(6475, "Instructions..."));
|
|
63
63
|
this.icon = Codicon.bookmark;
|
|
64
64
|
this.commandId = ATTACH_INSTRUCTIONS_ACTION_ID;
|
|
65
65
|
}
|
|
@@ -89,10 +89,10 @@ let ChatInstructionsPickerPick = class ChatInstructionsPickerPick {
|
|
|
89
89
|
return result;
|
|
90
90
|
});
|
|
91
91
|
return {
|
|
92
|
-
placeholder: ( localize(
|
|
92
|
+
placeholder: ( localize(6476, "Select instructions files to attach")),
|
|
93
93
|
picks,
|
|
94
94
|
configure: {
|
|
95
|
-
label: ( localize(
|
|
95
|
+
label: ( localize(6477, "Configure Instructions...")),
|
|
96
96
|
commandId: CONFIGURE_INSTRUCTIONS_ACTION_ID
|
|
97
97
|
}
|
|
98
98
|
};
|
|
@@ -104,17 +104,17 @@ class AbstractNewPromptFileAction extends Action2 {
|
|
|
104
104
|
return;
|
|
105
105
|
}
|
|
106
106
|
notificationService.prompt(Severity.Info, ( localize(
|
|
107
|
-
|
|
107
|
+
6509,
|
|
108
108
|
"Do you want to backup and sync your user prompt, instruction and custom agent files with Setting Sync?'"
|
|
109
109
|
)), [{
|
|
110
|
-
label: ( localize(
|
|
110
|
+
label: ( localize(6510, "Enable")),
|
|
111
111
|
run: () => {
|
|
112
112
|
commandService.executeCommand(CONFIGURE_SYNC_COMMAND_ID).catch(error => {
|
|
113
113
|
logService.error(`Failed to run '${CONFIGURE_SYNC_COMMAND_ID}' command: ${error}.`);
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
116
|
}, {
|
|
117
|
-
label: ( localize(
|
|
117
|
+
label: ( localize(6511, "Learn More")),
|
|
118
118
|
run: () => {
|
|
119
119
|
openerService.open(( URI.parse("https://aka.ms/vscode-settings-sync-help")));
|
|
120
120
|
}
|
|
@@ -212,24 +212,24 @@ const NEW_AGENT_COMMAND_ID = "workbench.command.new.agent";
|
|
|
212
212
|
const NEW_SKILL_COMMAND_ID = "workbench.command.new.skill";
|
|
213
213
|
class NewPromptFileAction extends AbstractNewPromptFileAction {
|
|
214
214
|
constructor() {
|
|
215
|
-
super(NEW_PROMPT_COMMAND_ID, ( localize(
|
|
215
|
+
super(NEW_PROMPT_COMMAND_ID, ( localize(6512, "New Prompt File...")), PromptsType.prompt);
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
218
|
class NewInstructionsFileAction extends AbstractNewPromptFileAction {
|
|
219
219
|
constructor() {
|
|
220
|
-
super(NEW_INSTRUCTIONS_COMMAND_ID, ( localize(
|
|
220
|
+
super(NEW_INSTRUCTIONS_COMMAND_ID, ( localize(6513, "New Instructions File...")), PromptsType.instructions);
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
class NewAgentFileAction extends AbstractNewPromptFileAction {
|
|
224
224
|
constructor() {
|
|
225
|
-
super(NEW_AGENT_COMMAND_ID, ( localize(
|
|
225
|
+
super(NEW_AGENT_COMMAND_ID, ( localize(6514, "New Custom Agent...")), PromptsType.agent);
|
|
226
226
|
}
|
|
227
227
|
}
|
|
228
228
|
class NewSkillFileAction extends Action2 {
|
|
229
229
|
constructor() {
|
|
230
230
|
super({
|
|
231
231
|
id: NEW_SKILL_COMMAND_ID,
|
|
232
|
-
title: ( localize(
|
|
232
|
+
title: ( localize(6515, "New Skill File...")),
|
|
233
233
|
f1: false,
|
|
234
234
|
precondition: ChatContextKeys.enabled,
|
|
235
235
|
category: CHAT_CATEGORY,
|
|
@@ -260,29 +260,29 @@ class NewSkillFileAction extends Action2 {
|
|
|
260
260
|
}
|
|
261
261
|
const skillName = await quickInputService.input({
|
|
262
262
|
prompt: ( localize(
|
|
263
|
-
|
|
263
|
+
6516,
|
|
264
264
|
"Enter a name for the skill (lowercase letters, numbers, and hyphens only)"
|
|
265
265
|
)),
|
|
266
|
-
placeHolder: ( localize(
|
|
266
|
+
placeHolder: ( localize(6517, "e.g., pdf-processing, data-analysis")),
|
|
267
267
|
validateInput: async value => {
|
|
268
268
|
if (!value || !value.trim()) {
|
|
269
|
-
return localize(
|
|
269
|
+
return localize(6518, "Skill name is required");
|
|
270
270
|
}
|
|
271
271
|
const name = value.trim();
|
|
272
272
|
if (name.length > 64) {
|
|
273
|
-
return localize(
|
|
273
|
+
return localize(6519, "Skill name must be 64 characters or less");
|
|
274
274
|
}
|
|
275
275
|
if (!VALID_SKILL_NAME_REGEX.test(name)) {
|
|
276
276
|
return localize(
|
|
277
|
-
|
|
277
|
+
6520,
|
|
278
278
|
"Skill name may only contain lowercase letters, numbers, and hyphens"
|
|
279
279
|
);
|
|
280
280
|
}
|
|
281
281
|
if (name.startsWith("-") || name.endsWith("-")) {
|
|
282
|
-
return localize(
|
|
282
|
+
return localize(6521, "Skill name must not start or end with a hyphen");
|
|
283
283
|
}
|
|
284
284
|
if (name.includes("--")) {
|
|
285
|
-
return localize(
|
|
285
|
+
return localize(6522, "Skill name must not contain consecutive hyphens");
|
|
286
286
|
}
|
|
287
287
|
return undefined;
|
|
288
288
|
}
|
|
@@ -314,7 +314,7 @@ class NewUntitledPromptFileAction extends Action2 {
|
|
|
314
314
|
constructor() {
|
|
315
315
|
super({
|
|
316
316
|
id: "workbench.command.new.untitled.prompt",
|
|
317
|
-
title: ( localize2(
|
|
317
|
+
title: ( localize2(6523, "New Untitled Prompt File")),
|
|
318
318
|
f1: true,
|
|
319
319
|
precondition: ChatContextKeys.enabled,
|
|
320
320
|
category: CHAT_CATEGORY,
|
package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/askForPromptName.js
CHANGED
|
@@ -23,20 +23,20 @@ async function askForPromptFileName(accessor, type, selectedFolder, existingFile
|
|
|
23
23
|
const fileName = sanitizeInput(value);
|
|
24
24
|
if (!fileName) {
|
|
25
25
|
return {
|
|
26
|
-
content: ( localize(
|
|
26
|
+
content: ( localize(6524, "Please enter a name.")),
|
|
27
27
|
severity: Severity.Warning
|
|
28
28
|
};
|
|
29
29
|
}
|
|
30
30
|
if (!isValidBasename(fileName)) {
|
|
31
31
|
return {
|
|
32
|
-
content: ( localize(
|
|
32
|
+
content: ( localize(6525, "The name contains invalid characters.")),
|
|
33
33
|
severity: Severity.Error
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
const fileUri = URI.joinPath(selectedFolder, fileName);
|
|
37
37
|
if (await fileService.exists(fileUri)) {
|
|
38
38
|
return {
|
|
39
|
-
content: ( localize(
|
|
39
|
+
content: ( localize(6526, "A file for the given name already exists.")),
|
|
40
40
|
severity: Severity.Error
|
|
41
41
|
};
|
|
42
42
|
}
|
|
@@ -56,11 +56,11 @@ async function askForPromptFileName(accessor, type, selectedFolder, existingFile
|
|
|
56
56
|
function getPlaceholderStringForNew(type) {
|
|
57
57
|
switch (type) {
|
|
58
58
|
case PromptsType.instructions:
|
|
59
|
-
return localize(
|
|
59
|
+
return localize(6527, "Enter the name of the instructions file");
|
|
60
60
|
case PromptsType.prompt:
|
|
61
|
-
return localize(
|
|
61
|
+
return localize(6528, "Enter the name of the prompt file");
|
|
62
62
|
case PromptsType.agent:
|
|
63
|
-
return localize(
|
|
63
|
+
return localize(6529, "Enter the name of the agent file");
|
|
64
64
|
default:
|
|
65
65
|
throw ( new Error("Unknown prompt type"));
|
|
66
66
|
}
|
|
@@ -68,11 +68,11 @@ function getPlaceholderStringForNew(type) {
|
|
|
68
68
|
function getPlaceholderStringForRename(type) {
|
|
69
69
|
switch (type) {
|
|
70
70
|
case PromptsType.instructions:
|
|
71
|
-
return localize(
|
|
71
|
+
return localize(6530, "Enter a new name of the instructions file");
|
|
72
72
|
case PromptsType.prompt:
|
|
73
|
-
return localize(
|
|
73
|
+
return localize(6531, "Enter a new name of the prompt file");
|
|
74
74
|
case PromptsType.agent:
|
|
75
|
-
return localize(
|
|
75
|
+
return localize(6532, "Enter a new name of the agent file");
|
|
76
76
|
default:
|
|
77
77
|
throw ( new Error("Unknown prompt type"));
|
|
78
78
|
}
|
|
@@ -27,7 +27,7 @@ async function askForPromptSourceFolder(accessor, type, existingFolder, isMove =
|
|
|
27
27
|
};
|
|
28
28
|
const foldersList = ( folders.map(folder => {
|
|
29
29
|
const uri = folder.uri;
|
|
30
|
-
const detail = (existingFolder && isEqual(uri, existingFolder)) ? ( localize(
|
|
30
|
+
const detail = (existingFolder && isEqual(uri, existingFolder)) ? ( localize(6533, "Current Location")) : undefined;
|
|
31
31
|
if (folder.storage !== PromptsStorage.local) {
|
|
32
32
|
return {
|
|
33
33
|
type: "item",
|
|
@@ -55,7 +55,7 @@ async function askForPromptSourceFolder(accessor, type, existingFolder, isMove =
|
|
|
55
55
|
}
|
|
56
56
|
return {
|
|
57
57
|
type: "item",
|
|
58
|
-
label: ( localize(
|
|
58
|
+
label: ( localize(6534, "Current Workspace")),
|
|
59
59
|
detail,
|
|
60
60
|
tooltip: labelService.getUriLabel(uri),
|
|
61
61
|
folder
|
|
@@ -70,15 +70,15 @@ async function askForPromptSourceFolder(accessor, type, existingFolder, isMove =
|
|
|
70
70
|
function getPlaceholderStringforNew(type) {
|
|
71
71
|
switch (type) {
|
|
72
72
|
case PromptsType.instructions:
|
|
73
|
-
return localize(
|
|
73
|
+
return localize(6535, "Select a location to create the instructions file");
|
|
74
74
|
case PromptsType.prompt:
|
|
75
|
-
return localize(
|
|
75
|
+
return localize(6536, "Select a location to create the prompt file");
|
|
76
76
|
case PromptsType.agent:
|
|
77
|
-
return localize(
|
|
77
|
+
return localize(6537, "Select a location to create the agent file");
|
|
78
78
|
case PromptsType.skill:
|
|
79
|
-
return localize(
|
|
79
|
+
return localize(6538, "Select a location to create the skill");
|
|
80
80
|
case PromptsType.hook:
|
|
81
|
-
return localize(
|
|
81
|
+
return localize(6539, "Select a location to create the hook file");
|
|
82
82
|
default:
|
|
83
83
|
throw ( new Error("Unknown prompt type"));
|
|
84
84
|
}
|
|
@@ -87,13 +87,13 @@ function getPlaceholderStringforMove(type, isMove) {
|
|
|
87
87
|
if (isMove) {
|
|
88
88
|
switch (type) {
|
|
89
89
|
case PromptsType.instructions:
|
|
90
|
-
return localize(
|
|
90
|
+
return localize(6540, "Select a location to move the instructions file to");
|
|
91
91
|
case PromptsType.prompt:
|
|
92
|
-
return localize(
|
|
92
|
+
return localize(6541, "Select a location to move the prompt file to");
|
|
93
93
|
case PromptsType.agent:
|
|
94
|
-
return localize(
|
|
94
|
+
return localize(6542, "Select a location to move the agent file to");
|
|
95
95
|
case PromptsType.skill:
|
|
96
|
-
return localize(
|
|
96
|
+
return localize(6543, "Select a location to move the skill to");
|
|
97
97
|
case PromptsType.hook:
|
|
98
98
|
throw ( new Error("Hooks cannot be moved"));
|
|
99
99
|
default:
|
|
@@ -102,13 +102,13 @@ function getPlaceholderStringforMove(type, isMove) {
|
|
|
102
102
|
}
|
|
103
103
|
switch (type) {
|
|
104
104
|
case PromptsType.instructions:
|
|
105
|
-
return localize(
|
|
105
|
+
return localize(6544, "Select a location to copy the instructions file to");
|
|
106
106
|
case PromptsType.prompt:
|
|
107
|
-
return localize(
|
|
107
|
+
return localize(6545, "Select a location to copy the prompt file to");
|
|
108
108
|
case PromptsType.agent:
|
|
109
|
-
return localize(
|
|
109
|
+
return localize(6546, "Select a location to copy the agent file to");
|
|
110
110
|
case PromptsType.skill:
|
|
111
|
-
return localize(
|
|
111
|
+
return localize(6547, "Select a location to copy the skill to");
|
|
112
112
|
case PromptsType.hook:
|
|
113
113
|
throw ( new Error("Hooks cannot be copied"));
|
|
114
114
|
default:
|
|
@@ -136,15 +136,15 @@ async function showNoFoldersDialog(accessor, type) {
|
|
|
136
136
|
function getLearnLabel(type) {
|
|
137
137
|
switch (type) {
|
|
138
138
|
case PromptsType.prompt:
|
|
139
|
-
return localize(
|
|
139
|
+
return localize(6548, "Learn how to configure reusable prompts");
|
|
140
140
|
case PromptsType.instructions:
|
|
141
|
-
return localize(
|
|
141
|
+
return localize(6549, "Learn how to configure reusable instructions");
|
|
142
142
|
case PromptsType.agent:
|
|
143
|
-
return localize(
|
|
143
|
+
return localize(6550, "Learn how to configure custom agents");
|
|
144
144
|
case PromptsType.skill:
|
|
145
|
-
return localize(
|
|
145
|
+
return localize(6551, "Learn how to configure skills");
|
|
146
146
|
case PromptsType.hook:
|
|
147
|
-
return localize(
|
|
147
|
+
return localize(6552, "Learn how to configure hooks");
|
|
148
148
|
default:
|
|
149
149
|
throw ( new Error("Unknown prompt type"));
|
|
150
150
|
}
|
|
@@ -152,15 +152,15 @@ function getLearnLabel(type) {
|
|
|
152
152
|
function getMissingSourceFolderString(type) {
|
|
153
153
|
switch (type) {
|
|
154
154
|
case PromptsType.instructions:
|
|
155
|
-
return localize(
|
|
155
|
+
return localize(6553, "No instruction source folders found.");
|
|
156
156
|
case PromptsType.prompt:
|
|
157
|
-
return localize(
|
|
157
|
+
return localize(6554, "No prompt source folders found.");
|
|
158
158
|
case PromptsType.agent:
|
|
159
|
-
return localize(
|
|
159
|
+
return localize(6555, "No agent source folders found.");
|
|
160
160
|
case PromptsType.skill:
|
|
161
|
-
return localize(
|
|
161
|
+
return localize(6556, "No skill source folders found.");
|
|
162
162
|
case PromptsType.hook:
|
|
163
|
-
return localize(
|
|
163
|
+
return localize(6557, "No hook source folders found.");
|
|
164
164
|
default:
|
|
165
165
|
throw ( new Error("Unknown prompt type"));
|
|
166
166
|
}
|
package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/pickers/promptFilePickers.js
CHANGED
|
@@ -32,31 +32,31 @@ function newHelpButton(type) {
|
|
|
32
32
|
switch (type) {
|
|
33
33
|
case PromptsType.prompt:
|
|
34
34
|
return {
|
|
35
|
-
tooltip: ( localize(
|
|
35
|
+
tooltip: ( localize(6558, "Show help on prompt files")),
|
|
36
36
|
helpURI: ( URI.parse(PROMPT_DOCUMENTATION_URL)),
|
|
37
37
|
iconClass
|
|
38
38
|
};
|
|
39
39
|
case PromptsType.instructions:
|
|
40
40
|
return {
|
|
41
|
-
tooltip: ( localize(
|
|
41
|
+
tooltip: ( localize(6559, "Show help on instruction files")),
|
|
42
42
|
helpURI: ( URI.parse(INSTRUCTIONS_DOCUMENTATION_URL)),
|
|
43
43
|
iconClass
|
|
44
44
|
};
|
|
45
45
|
case PromptsType.agent:
|
|
46
46
|
return {
|
|
47
|
-
tooltip: ( localize(
|
|
47
|
+
tooltip: ( localize(6560, "Show help on custom agent files")),
|
|
48
48
|
helpURI: ( URI.parse(AGENT_DOCUMENTATION_URL)),
|
|
49
49
|
iconClass
|
|
50
50
|
};
|
|
51
51
|
case PromptsType.skill:
|
|
52
52
|
return {
|
|
53
|
-
tooltip: ( localize(
|
|
53
|
+
tooltip: ( localize(6561, "Show help on skill files")),
|
|
54
54
|
helpURI: ( URI.parse(SKILL_DOCUMENTATION_URL)),
|
|
55
55
|
iconClass
|
|
56
56
|
};
|
|
57
57
|
case PromptsType.hook:
|
|
58
58
|
return {
|
|
59
|
-
tooltip: ( localize(
|
|
59
|
+
tooltip: ( localize(6562, "Show help on hook files")),
|
|
60
60
|
helpURI: ( URI.parse(HOOK_DOCUMENTATION_URL)),
|
|
61
61
|
iconClass
|
|
62
62
|
};
|
|
@@ -73,7 +73,7 @@ function isExtensionPromptPath(prompt) {
|
|
|
73
73
|
}
|
|
74
74
|
const NEW_PROMPT_FILE_OPTION = {
|
|
75
75
|
type: "item",
|
|
76
|
-
label: `$(plus) ${( localize(
|
|
76
|
+
label: `$(plus) ${( localize(6563, "New prompt file..."))}`,
|
|
77
77
|
pickable: false,
|
|
78
78
|
alwaysShow: true,
|
|
79
79
|
buttons: [newHelpButton(PromptsType.prompt)],
|
|
@@ -81,7 +81,7 @@ const NEW_PROMPT_FILE_OPTION = {
|
|
|
81
81
|
};
|
|
82
82
|
const NEW_INSTRUCTIONS_FILE_OPTION = {
|
|
83
83
|
type: "item",
|
|
84
|
-
label: `$(plus) ${( localize(
|
|
84
|
+
label: `$(plus) ${( localize(6564, "New instruction file..."))}`,
|
|
85
85
|
pickable: false,
|
|
86
86
|
alwaysShow: true,
|
|
87
87
|
buttons: [newHelpButton(PromptsType.instructions)],
|
|
@@ -89,7 +89,7 @@ const NEW_INSTRUCTIONS_FILE_OPTION = {
|
|
|
89
89
|
};
|
|
90
90
|
const GENERATE_AGENT_INSTRUCTIONS_OPTION = {
|
|
91
91
|
type: "item",
|
|
92
|
-
label: `$(sparkle) ${( localize(
|
|
92
|
+
label: `$(sparkle) ${( localize(6565, "Generate agent instructions..."))}`,
|
|
93
93
|
pickable: false,
|
|
94
94
|
alwaysShow: true,
|
|
95
95
|
buttons: [newHelpButton(PromptsType.instructions)],
|
|
@@ -97,7 +97,7 @@ const GENERATE_AGENT_INSTRUCTIONS_OPTION = {
|
|
|
97
97
|
};
|
|
98
98
|
const GENERATE_ON_DEMAND_INSTRUCTIONS_OPTION = {
|
|
99
99
|
type: "item",
|
|
100
|
-
label: `$(sparkle) ${( localize(
|
|
100
|
+
label: `$(sparkle) ${( localize(6566, "Generate on-demand instructions..."))}`,
|
|
101
101
|
pickable: false,
|
|
102
102
|
alwaysShow: true,
|
|
103
103
|
buttons: [newHelpButton(PromptsType.instructions)],
|
|
@@ -105,7 +105,7 @@ const GENERATE_ON_DEMAND_INSTRUCTIONS_OPTION = {
|
|
|
105
105
|
};
|
|
106
106
|
const NEW_AGENT_FILE_OPTION = {
|
|
107
107
|
type: "item",
|
|
108
|
-
label: `$(plus) ${( localize(
|
|
108
|
+
label: `$(plus) ${( localize(6567, "Create new custom agent..."))}`,
|
|
109
109
|
pickable: false,
|
|
110
110
|
alwaysShow: true,
|
|
111
111
|
buttons: [newHelpButton(PromptsType.agent)],
|
|
@@ -113,7 +113,7 @@ const NEW_AGENT_FILE_OPTION = {
|
|
|
113
113
|
};
|
|
114
114
|
const NEW_SKILL_FILE_OPTION = {
|
|
115
115
|
type: "item",
|
|
116
|
-
label: `$(plus) ${( localize(
|
|
116
|
+
label: `$(plus) ${( localize(6568, "New skill..."))}`,
|
|
117
117
|
pickable: false,
|
|
118
118
|
alwaysShow: true,
|
|
119
119
|
buttons: [newHelpButton(PromptsType.skill)],
|
|
@@ -121,7 +121,7 @@ const NEW_SKILL_FILE_OPTION = {
|
|
|
121
121
|
};
|
|
122
122
|
const GENERATE_PROMPT_OPTION = {
|
|
123
123
|
type: "item",
|
|
124
|
-
label: `$(sparkle) ${( localize(
|
|
124
|
+
label: `$(sparkle) ${( localize(6569, "Generate prompt..."))}`,
|
|
125
125
|
pickable: false,
|
|
126
126
|
alwaysShow: true,
|
|
127
127
|
buttons: [newHelpButton(PromptsType.prompt)],
|
|
@@ -129,7 +129,7 @@ const GENERATE_PROMPT_OPTION = {
|
|
|
129
129
|
};
|
|
130
130
|
const GENERATE_SKILL_OPTION = {
|
|
131
131
|
type: "item",
|
|
132
|
-
label: `$(sparkle) ${( localize(
|
|
132
|
+
label: `$(sparkle) ${( localize(6570, "Generate skill..."))}`,
|
|
133
133
|
pickable: false,
|
|
134
134
|
alwaysShow: true,
|
|
135
135
|
buttons: [newHelpButton(PromptsType.skill)],
|
|
@@ -137,39 +137,39 @@ const GENERATE_SKILL_OPTION = {
|
|
|
137
137
|
};
|
|
138
138
|
const GENERATE_AGENT_OPTION = {
|
|
139
139
|
type: "item",
|
|
140
|
-
label: `$(sparkle) ${( localize(
|
|
140
|
+
label: `$(sparkle) ${( localize(6571, "Generate agent..."))}`,
|
|
141
141
|
pickable: false,
|
|
142
142
|
alwaysShow: true,
|
|
143
143
|
buttons: [newHelpButton(PromptsType.agent)],
|
|
144
144
|
commandId: GENERATE_AGENT_COMMAND_ID
|
|
145
145
|
};
|
|
146
146
|
const EDIT_BUTTON = {
|
|
147
|
-
tooltip: ( localize(
|
|
147
|
+
tooltip: ( localize(6572, "Open in Editor")),
|
|
148
148
|
iconClass: ThemeIcon.asClassName(Codicon.fileCode)
|
|
149
149
|
};
|
|
150
150
|
const DELETE_BUTTON = {
|
|
151
|
-
tooltip: ( localize(
|
|
151
|
+
tooltip: ( localize(6573, "Delete")),
|
|
152
152
|
iconClass: ThemeIcon.asClassName(Codicon.trash)
|
|
153
153
|
};
|
|
154
154
|
const RENAME_BUTTON = {
|
|
155
|
-
tooltip: ( localize(
|
|
155
|
+
tooltip: ( localize(6574, "Move and/or Rename")),
|
|
156
156
|
iconClass: ThemeIcon.asClassName(Codicon.replace)
|
|
157
157
|
};
|
|
158
158
|
const COPY_BUTTON = {
|
|
159
|
-
tooltip: ( localize(
|
|
159
|
+
tooltip: ( localize(6575, "Make a Copy")),
|
|
160
160
|
iconClass: ThemeIcon.asClassName(Codicon.copy)
|
|
161
161
|
};
|
|
162
162
|
const MAKE_VISIBLE_BUTTON = {
|
|
163
|
-
tooltip: ( localize(
|
|
163
|
+
tooltip: ( localize(6576, "Hidden from chat view agent picker. Click to show.")),
|
|
164
164
|
iconClass: ThemeIcon.asClassName(Codicon.eyeClosed),
|
|
165
165
|
alwaysVisible: true
|
|
166
166
|
};
|
|
167
167
|
const MAKE_INVISIBLE_BUTTON = {
|
|
168
|
-
tooltip: ( localize(
|
|
168
|
+
tooltip: ( localize(6577, "Shown in chat view agent picker. Click to hide.")),
|
|
169
169
|
iconClass: ThemeIcon.asClassName(Codicon.eye)
|
|
170
170
|
};
|
|
171
171
|
const RUN_IN_CHAT_BUTTON = {
|
|
172
|
-
tooltip: ( localize(
|
|
172
|
+
tooltip: ( localize(6578, "Run in Chat View")),
|
|
173
173
|
iconClass: ThemeIcon.asClassName(Codicon.play)
|
|
174
174
|
};
|
|
175
175
|
let PromptFilePickers = class PromptFilePickers {
|
|
@@ -200,7 +200,7 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
200
200
|
useSeparators: true
|
|
201
201
|
});
|
|
202
202
|
quickPick.busy = true;
|
|
203
|
-
quickPick.placeholder = ( localize(
|
|
203
|
+
quickPick.placeholder = ( localize(6579, "Searching file system..."));
|
|
204
204
|
try {
|
|
205
205
|
const fileOptions = await this._createPromptPickItems(options, cts.token);
|
|
206
206
|
const activeItem = options.resource && fileOptions.find(
|
|
@@ -301,7 +301,7 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
301
301
|
if (locals.length) {
|
|
302
302
|
result.push({
|
|
303
303
|
type: "separator",
|
|
304
|
-
label: ( localize(
|
|
304
|
+
label: ( localize(6580, "Workspace"))
|
|
305
305
|
});
|
|
306
306
|
result.push(...sortByLabel(await Promise.all(( locals.map(l => this._createPromptPickItem(l, buttons, getVisibility(l), token))))));
|
|
307
307
|
}
|
|
@@ -324,7 +324,7 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
324
324
|
const agentButtons = buttons.filter(b => b !== RENAME_BUTTON);
|
|
325
325
|
result.push({
|
|
326
326
|
type: "separator",
|
|
327
|
-
label: ( localize(
|
|
327
|
+
label: ( localize(6581, "Agent Instructions"))
|
|
328
328
|
});
|
|
329
329
|
result.push(...sortByLabel(await Promise.all(( agentInstructionFiles.map(l => this._createPromptPickItem(l, agentButtons, getVisibility(l), token))))));
|
|
330
330
|
}
|
|
@@ -361,7 +361,7 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
361
361
|
if (users.length) {
|
|
362
362
|
result.push({
|
|
363
363
|
type: "separator",
|
|
364
|
-
label: ( localize(
|
|
364
|
+
label: ( localize(6582, "User Data"))
|
|
365
365
|
});
|
|
366
366
|
result.push(...sortByLabel(await Promise.all(( users.map(u => this._createPromptPickItem(u, buttons, getVisibility(u), token))))));
|
|
367
367
|
}
|
|
@@ -373,28 +373,17 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
373
373
|
}
|
|
374
374
|
result.push({
|
|
375
375
|
type: "separator",
|
|
376
|
-
label: ( localize(
|
|
376
|
+
label: ( localize(6583, "Plugins"))
|
|
377
377
|
});
|
|
378
378
|
result.push(...sortByLabel(await Promise.all(( plugins.map(p => this._createPromptPickItem(p, pluginButtons, getVisibility(p), token))))));
|
|
379
379
|
}
|
|
380
|
-
const internals = await this._promptsService.listPromptFilesForStorage(options.type, PromptsStorage.internal, token);
|
|
381
|
-
if (internals.length) {
|
|
382
|
-
const internalButtons = [];
|
|
383
|
-
result.push({
|
|
384
|
-
type: "separator",
|
|
385
|
-
label: ( localize(6532, "Built-in"))
|
|
386
|
-
});
|
|
387
|
-
result.push(...sortByLabel(await Promise.all(( internals.map(
|
|
388
|
-
p => this._createPromptPickItem(p, internalButtons, getVisibility(p), token)
|
|
389
|
-
)))));
|
|
390
|
-
}
|
|
391
380
|
return result;
|
|
392
381
|
}
|
|
393
382
|
_getExtensionGroupLabel(extPath) {
|
|
394
383
|
if (isOrganizationPromptFile(extPath.uri, extPath.extension.identifier, this._productService)) {
|
|
395
|
-
return localize(
|
|
384
|
+
return localize(6584, "Organization");
|
|
396
385
|
}
|
|
397
|
-
return localize(
|
|
386
|
+
return localize(6585, "Extensions");
|
|
398
387
|
}
|
|
399
388
|
_getNewItems(type) {
|
|
400
389
|
switch (type) {
|
|
@@ -434,17 +423,14 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
434
423
|
case PromptsStorage.plugin:
|
|
435
424
|
tooltip = promptFile.name;
|
|
436
425
|
break;
|
|
437
|
-
case PromptsStorage.internal:
|
|
438
|
-
tooltip = undefined;
|
|
439
|
-
break;
|
|
440
426
|
default:
|
|
441
427
|
assertNever();
|
|
442
428
|
}
|
|
443
429
|
let iconClass;
|
|
444
430
|
if (visibility === false) {
|
|
445
431
|
buttons = (buttons ?? []).concat(MAKE_VISIBLE_BUTTON);
|
|
446
|
-
promptName = ( localize(
|
|
447
|
-
tooltip = ( localize(
|
|
432
|
+
promptName = ( localize(6586, "{0} (hidden)", promptName));
|
|
433
|
+
tooltip = ( localize(6587, "Hidden from chat view agent picker"));
|
|
448
434
|
} else if (visibility === true) {
|
|
449
435
|
buttons = (buttons ?? []).concat(MAKE_INVISIBLE_BUTTON);
|
|
450
436
|
}
|
|
@@ -520,10 +506,10 @@ let PromptFilePickers = class PromptFilePickers {
|
|
|
520
506
|
const isSkill = options.type === PromptsType.skill;
|
|
521
507
|
const filename = isSkill ? basename(dirname(value)) : item.label;
|
|
522
508
|
const message = isSkill ? ( localize(
|
|
523
|
-
|
|
509
|
+
6588,
|
|
524
510
|
"Are you sure you want to delete skill '{0}' and its folder?",
|
|
525
511
|
filename
|
|
526
|
-
)) : ( localize(
|
|
512
|
+
)) : ( localize(6589, "Are you sure you want to delete '{0}'?", filename));
|
|
527
513
|
const {
|
|
528
514
|
confirmed
|
|
529
515
|
} = await this._dialogService.confirm({
|
package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.js
CHANGED
|
@@ -85,7 +85,7 @@ let PasteImageProvider = class PasteImageProvider {
|
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
const attachedVariables = widget.attachmentModel.attachments;
|
|
88
|
-
const displayName = ( localize(
|
|
88
|
+
const displayName = ( localize(7091, "Pasted Image"));
|
|
89
89
|
let tempDisplayName = displayName;
|
|
90
90
|
for (let appendValue = 2; ( attachedVariables.some(attachment => attachment.name === tempDisplayName)); appendValue++)
|
|
91
91
|
{
|
|
@@ -107,7 +107,7 @@ let PasteImageProvider = class PasteImageProvider {
|
|
|
107
107
|
if (( currentContextIds.has(scaledImageContext.id))) {
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
110
|
-
const edit = createCustomPasteEdit(model, [scaledImageContext], mimeType, this.kind, ( localize(
|
|
110
|
+
const edit = createCustomPasteEdit(model, [scaledImageContext], mimeType, this.kind, ( localize(7092, "Pasted Image Attachment")), this.chatWidgetService);
|
|
111
111
|
return createEditSession(edit);
|
|
112
112
|
}
|
|
113
113
|
};
|
|
@@ -251,7 +251,7 @@ let CopyAttachmentsProvider = class CopyAttachmentsProvider {
|
|
|
251
251
|
}
|
|
252
252
|
const edit = {
|
|
253
253
|
insertText: textdata,
|
|
254
|
-
title: ( localize(
|
|
254
|
+
title: ( localize(7093, "Insert Prompt & Attachments")),
|
|
255
255
|
kind: this.kind,
|
|
256
256
|
handledMimeType: CopyAttachmentsProvider_1.ATTACHMENT_MIME_TYPE,
|
|
257
257
|
additionalEdit: {
|
|
@@ -327,7 +327,7 @@ class PasteTextProvider {
|
|
|
327
327
|
if (( currentContextIds.has(copiedContext.id))) {
|
|
328
328
|
return;
|
|
329
329
|
}
|
|
330
|
-
const edit = createCustomPasteEdit(model, [copiedContext], Mimes.text, this.kind, ( localize(
|
|
330
|
+
const edit = createCustomPasteEdit(model, [copiedContext], Mimes.text, this.kind, ( localize(7094, "Pasted Code Attachment")), this.chatWidgetService);
|
|
331
331
|
edit.yieldTo = [{
|
|
332
332
|
kind: HierarchicalKind.Empty.append("text", "plain")
|
|
333
333
|
}];
|
|
@@ -339,7 +339,7 @@ function getCopiedContext(code, file, language, range) {
|
|
|
339
339
|
const start = range.startLineNumber;
|
|
340
340
|
const end = range.endLineNumber;
|
|
341
341
|
const resultText = `Copied Selection of Code: \n\n\n From the file: ${fileName} From lines ${start} to ${end} \n \`\`\`${code}\`\`\``;
|
|
342
|
-
const pastedLines = start === end ? ( localize(
|
|
342
|
+
const pastedLines = start === end ? ( localize(7095, "1 line")) : ( localize(7096, "{0} lines", end + 1 - start));
|
|
343
343
|
return {
|
|
344
344
|
kind: "paste",
|
|
345
345
|
value: resultText,
|
|
@@ -361,7 +361,7 @@ function getCopiedContext(code, file, language, range) {
|
|
|
361
361
|
};
|
|
362
362
|
}
|
|
363
363
|
function createCustomPasteEdit(model, context, handledMimeType, kind, title, chatWidgetService) {
|
|
364
|
-
const label = context.length === 1 ? context[0].name : ( localize(
|
|
364
|
+
const label = context.length === 1 ? context[0].name : ( localize(7097, "{0} and {1} more", context[0].name, context.length - 1));
|
|
365
365
|
const announceImageAttachment = context.length === 1 && isImageVariableEntry(context[0]);
|
|
366
366
|
const customEdit = {
|
|
367
367
|
resource: model.uri,
|
|
@@ -380,7 +380,7 @@ function createCustomPasteEdit(model, context, handledMimeType, kind, title, cha
|
|
|
380
380
|
}
|
|
381
381
|
widget.attachmentModel.addContext(...context);
|
|
382
382
|
if (announceImageAttachment) {
|
|
383
|
-
alert(( localize(
|
|
383
|
+
alert(( localize(7098, "Attached image")));
|
|
384
384
|
}
|
|
385
385
|
},
|
|
386
386
|
metadata: {
|
|
@@ -564,7 +564,7 @@ let PasteSymbolProvider = class PasteSymbolProvider {
|
|
|
564
564
|
};
|
|
565
565
|
const edit = {
|
|
566
566
|
insertText,
|
|
567
|
-
title: ( localize(
|
|
567
|
+
title: ( localize(7099, "Pasted Symbol Reference")),
|
|
568
568
|
kind: this.kind,
|
|
569
569
|
handledMimeType: COPY_MIME_TYPES,
|
|
570
570
|
additionalEdit: {
|
|
@@ -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(13515, "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(13516, "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(13517, "Do you want to run the command: {0}", command.command)), [{
|
|
450
|
+
label: ( localize(13518, "Yes")),
|
|
451
451
|
run: () => r(true)
|
|
452
452
|
}, {
|
|
453
|
-
label: ( localize(
|
|
453
|
+
label: ( localize(13519, "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(13520, "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(13521, "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(13522, "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(13523, "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(13524, "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(13525, "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(13526, "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(13527, "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(13528, "Toggle visibility"));
|
|
599
599
|
const configValue = this._configurationService.getValue(TerminalSettingId.ShellIntegrationDecorationsEnabled);
|
|
600
600
|
const gutterIcon = {
|
|
601
|
-
label: ( localize(
|
|
601
|
+
label: ( localize(13529, "Gutter command decorations")),
|
|
602
602
|
picked: configValue !== "never" && configValue !== "overviewRuler"
|
|
603
603
|
};
|
|
604
604
|
const overviewRulerIcon = {
|
|
605
|
-
label: ( localize(
|
|
605
|
+
label: ( localize(13530, "Overview ruler command decorations")),
|
|
606
606
|
picked: configValue !== "never" && configValue !== "gutter"
|
|
607
607
|
};
|
|
608
608
|
quickPick.items = [gutterIcon, overviewRulerIcon];
|
|
@@ -750,7 +750,7 @@ let XtermTerminal = class XtermTerminal extends Disposable {
|
|
|
750
750
|
await this._clipboardService.writeText(this.raw.getSelection());
|
|
751
751
|
}
|
|
752
752
|
} else {
|
|
753
|
-
this._notificationService.warn(( localize(
|
|
753
|
+
this._notificationService.warn(( localize(13541, "The terminal has no selection to copy")));
|
|
754
754
|
}
|
|
755
755
|
}
|
|
756
756
|
_setCursorBlink(blink) {
|