@codingame/monaco-vscode-chat-service-override 23.0.2 → 23.0.4
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 +43 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +106 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/simpleBrowserEditorOverlay.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +28 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/localChatSessionsProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/chatSessionsView.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsTreeRenderer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/view/sessionsViewPane.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions.contribution.js +33 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup.js +52 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus.js +65 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatViewPane.js +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/contrib/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsConfirmationService.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelToolsService.js +57 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatSessionStore.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +53 -53
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +27 -27
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +22 -23
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatCurrentLine.js +8 -8
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +18 -18
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +10 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +10 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +15 -15
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
|
@@ -45,14 +45,14 @@ let PromptValidator = class PromptValidator {
|
|
|
45
45
|
const location = this.promptsService.getAgentFileURIFromModeFile(promptAST.uri);
|
|
46
46
|
if (location && (await this.fileService.canCreateFile(location))) {
|
|
47
47
|
report(toMarker(( localize(
|
|
48
|
-
|
|
48
|
+
5875,
|
|
49
49
|
"Chat modes have been renamed to agents. Please move this file to {0}",
|
|
50
50
|
(location.toString())
|
|
51
51
|
)), ( new Range(1, 1, 1, 4)), MarkerSeverity.Warning));
|
|
52
52
|
}
|
|
53
53
|
else {
|
|
54
54
|
report(toMarker(( localize(
|
|
55
|
-
|
|
55
|
+
5876,
|
|
56
56
|
"Chat modes have been renamed to agents. Please move the file to {0}",
|
|
57
57
|
AGENTS_SOURCE_FOLDER
|
|
58
58
|
)), ( new Range(1, 1, 1, 4)), MarkerSeverity.Warning));
|
|
@@ -68,7 +68,7 @@ let PromptValidator = class PromptValidator {
|
|
|
68
68
|
for (const ref of body.fileReferences) {
|
|
69
69
|
const resolved = body.resolveFilePath(ref.content);
|
|
70
70
|
if (!resolved) {
|
|
71
|
-
report(toMarker(( localize(
|
|
71
|
+
report(toMarker(( localize(5877, "Invalid file reference '{0}'.", ref.content)), ref.range, MarkerSeverity.Warning));
|
|
72
72
|
continue;
|
|
73
73
|
}
|
|
74
74
|
if (promptAST.uri.scheme === resolved.scheme) {
|
|
@@ -82,7 +82,7 @@ let PromptValidator = class PromptValidator {
|
|
|
82
82
|
catch {
|
|
83
83
|
}
|
|
84
84
|
const loc = this.labelService.getUriLabel(resolved);
|
|
85
|
-
report(toMarker(( localize(
|
|
85
|
+
report(toMarker(( localize(5878, "File '{0}' not found at '{1}'.", ref.content, loc)), ref.range, MarkerSeverity.Warning));
|
|
86
86
|
})());
|
|
87
87
|
}
|
|
88
88
|
}
|
|
@@ -98,21 +98,21 @@ let PromptValidator = class PromptValidator {
|
|
|
98
98
|
if (( deprecatedNames.has(variable.name))) {
|
|
99
99
|
const currentName = deprecatedNames.get(variable.name);
|
|
100
100
|
report(toMarker(( localize(
|
|
101
|
-
|
|
101
|
+
5879,
|
|
102
102
|
"Tool or toolset '{0}' has been renamed, use '{1}' instead.",
|
|
103
103
|
variable.name,
|
|
104
104
|
currentName
|
|
105
105
|
)), variable.range, MarkerSeverity.Info));
|
|
106
106
|
}
|
|
107
107
|
else {
|
|
108
|
-
report(toMarker(( localize(
|
|
108
|
+
report(toMarker(( localize(5880, "Unknown tool or toolset '{0}'.", variable.name)), variable.range, MarkerSeverity.Warning));
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
else if (headerToolsMap) {
|
|
112
112
|
const tool = this.languageModelToolsService.getToolByQualifiedName(variable.name);
|
|
113
113
|
if (tool && headerToolsMap.get(tool) === false) {
|
|
114
114
|
report(toMarker(( localize(
|
|
115
|
-
|
|
115
|
+
5881,
|
|
116
116
|
"Tool or toolset '{0}' also needs to be enabled in the header.",
|
|
117
117
|
variable.name
|
|
118
118
|
)), variable.range, MarkerSeverity.Warning));
|
|
@@ -166,7 +166,7 @@ let PromptValidator = class PromptValidator {
|
|
|
166
166
|
switch (promptType) {
|
|
167
167
|
case PromptsType.prompt:
|
|
168
168
|
report(toMarker(( localize(
|
|
169
|
-
|
|
169
|
+
5882,
|
|
170
170
|
"Attribute '{0}' is not supported in prompt files. Supported: {1}.",
|
|
171
171
|
attribute.key,
|
|
172
172
|
supportedNames.value
|
|
@@ -175,7 +175,7 @@ let PromptValidator = class PromptValidator {
|
|
|
175
175
|
case PromptsType.agent:
|
|
176
176
|
if (isGitHubTarget) {
|
|
177
177
|
report(toMarker(( localize(
|
|
178
|
-
|
|
178
|
+
5883,
|
|
179
179
|
"Attribute '{0}' is not supported in custom GitHub Copilot agent files. Supported: {1}.",
|
|
180
180
|
attribute.key,
|
|
181
181
|
supportedNames.value
|
|
@@ -184,14 +184,14 @@ let PromptValidator = class PromptValidator {
|
|
|
184
184
|
else {
|
|
185
185
|
if (( validGithubCopilotAttributeNames.value.has(attribute.key))) {
|
|
186
186
|
report(toMarker(( localize(
|
|
187
|
-
|
|
187
|
+
5884,
|
|
188
188
|
"Attribute '{0}' is ignored when running locally in VS Code.",
|
|
189
189
|
attribute.key
|
|
190
190
|
)), attribute.range, MarkerSeverity.Info));
|
|
191
191
|
}
|
|
192
192
|
else {
|
|
193
193
|
report(toMarker(( localize(
|
|
194
|
-
|
|
194
|
+
5885,
|
|
195
195
|
"Attribute '{0}' is not supported in VS Code agent files. Supported: {1}.",
|
|
196
196
|
attribute.key,
|
|
197
197
|
supportedNames.value
|
|
@@ -201,7 +201,7 @@ let PromptValidator = class PromptValidator {
|
|
|
201
201
|
break;
|
|
202
202
|
case PromptsType.instructions:
|
|
203
203
|
report(toMarker(( localize(
|
|
204
|
-
|
|
204
|
+
5886,
|
|
205
205
|
"Attribute '{0}' is not supported in instructions files. Supported: {1}.",
|
|
206
206
|
attribute.key,
|
|
207
207
|
supportedNames.value
|
|
@@ -217,16 +217,16 @@ let PromptValidator = class PromptValidator {
|
|
|
217
217
|
return;
|
|
218
218
|
}
|
|
219
219
|
if (nameAttribute.value.type !== 'string') {
|
|
220
|
-
report(toMarker(( localize(
|
|
220
|
+
report(toMarker(( localize(5887, "The 'name' attribute must be a string.")), nameAttribute.range, MarkerSeverity.Error));
|
|
221
221
|
return;
|
|
222
222
|
}
|
|
223
223
|
if (nameAttribute.value.value.trim().length === 0) {
|
|
224
|
-
report(toMarker(( localize(
|
|
224
|
+
report(toMarker(( localize(5888, "The 'name' attribute must not be empty.")), nameAttribute.value.range, MarkerSeverity.Error));
|
|
225
225
|
return;
|
|
226
226
|
}
|
|
227
227
|
if (!PROMPT_NAME_REGEXP.test(nameAttribute.value.value)) {
|
|
228
228
|
report(toMarker(( localize(
|
|
229
|
-
|
|
229
|
+
5889,
|
|
230
230
|
"The 'name' attribute can only consist of letters, digits, underscores, hyphens, and periods."
|
|
231
231
|
)), nameAttribute.value.range, MarkerSeverity.Error));
|
|
232
232
|
}
|
|
@@ -237,11 +237,11 @@ let PromptValidator = class PromptValidator {
|
|
|
237
237
|
return;
|
|
238
238
|
}
|
|
239
239
|
if (descriptionAttribute.value.type !== 'string') {
|
|
240
|
-
report(toMarker(( localize(
|
|
240
|
+
report(toMarker(( localize(5890, "The 'description' attribute must be a string.")), descriptionAttribute.range, MarkerSeverity.Error));
|
|
241
241
|
return;
|
|
242
242
|
}
|
|
243
243
|
if (descriptionAttribute.value.value.trim().length === 0) {
|
|
244
|
-
report(toMarker(( localize(
|
|
244
|
+
report(toMarker(( localize(5891, "The 'description' attribute should not be empty.")), descriptionAttribute.value.range, MarkerSeverity.Error));
|
|
245
245
|
return;
|
|
246
246
|
}
|
|
247
247
|
}
|
|
@@ -251,11 +251,11 @@ let PromptValidator = class PromptValidator {
|
|
|
251
251
|
return;
|
|
252
252
|
}
|
|
253
253
|
if (argumentHintAttribute.value.type !== 'string') {
|
|
254
|
-
report(toMarker(( localize(
|
|
254
|
+
report(toMarker(( localize(5892, "The 'argument-hint' attribute must be a string.")), argumentHintAttribute.range, MarkerSeverity.Error));
|
|
255
255
|
return;
|
|
256
256
|
}
|
|
257
257
|
if (argumentHintAttribute.value.value.trim().length === 0) {
|
|
258
|
-
report(toMarker(( localize(
|
|
258
|
+
report(toMarker(( localize(5893, "The 'argument-hint' attribute should not be empty.")), argumentHintAttribute.value.range, MarkerSeverity.Error));
|
|
259
259
|
return;
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -265,12 +265,12 @@ let PromptValidator = class PromptValidator {
|
|
|
265
265
|
return;
|
|
266
266
|
}
|
|
267
267
|
if (attribute.value.type !== 'string') {
|
|
268
|
-
report(toMarker(( localize(
|
|
268
|
+
report(toMarker(( localize(5894, "The 'model' attribute must be a string.")), attribute.value.range, MarkerSeverity.Error));
|
|
269
269
|
return;
|
|
270
270
|
}
|
|
271
271
|
const modelName = attribute.value.value.trim();
|
|
272
272
|
if (modelName.length === 0) {
|
|
273
|
-
report(toMarker(( localize(
|
|
273
|
+
report(toMarker(( localize(5895, "The 'model' attribute must be a non-empty string.")), attribute.value.range, MarkerSeverity.Error));
|
|
274
274
|
return;
|
|
275
275
|
}
|
|
276
276
|
const languageModes = this.languageModelsService.getLanguageModelIds();
|
|
@@ -279,10 +279,10 @@ let PromptValidator = class PromptValidator {
|
|
|
279
279
|
}
|
|
280
280
|
const modelMetadata = this.findModelByName(languageModes, modelName);
|
|
281
281
|
if (!modelMetadata) {
|
|
282
|
-
report(toMarker(( localize(
|
|
282
|
+
report(toMarker(( localize(5896, "Unknown model '{0}'.", modelName)), attribute.value.range, MarkerSeverity.Warning));
|
|
283
283
|
}
|
|
284
284
|
else if (agentKind === ChatModeKind.Agent && !ILanguageModelChatMetadata.suitableForAgentMode(modelMetadata)) {
|
|
285
|
-
report(toMarker(( localize(
|
|
285
|
+
report(toMarker(( localize(5897, "Model '{0}' is not suited for agent mode.", modelName)), attribute.value.range, MarkerSeverity.Warning));
|
|
286
286
|
}
|
|
287
287
|
}
|
|
288
288
|
findModelByName(languageModes, modelName) {
|
|
@@ -300,13 +300,13 @@ let PromptValidator = class PromptValidator {
|
|
|
300
300
|
if (modeAttribute) {
|
|
301
301
|
if (agentAttribute) {
|
|
302
302
|
report(toMarker(( localize(
|
|
303
|
-
|
|
303
|
+
5898,
|
|
304
304
|
"The 'mode' attribute has been deprecated. The 'agent' attribute is used instead."
|
|
305
305
|
)), modeAttribute.range, MarkerSeverity.Warning));
|
|
306
306
|
}
|
|
307
307
|
else {
|
|
308
308
|
report(toMarker(( localize(
|
|
309
|
-
|
|
309
|
+
5899,
|
|
310
310
|
"The 'mode' attribute has been deprecated. Please rename it to 'agent'."
|
|
311
311
|
)), modeAttribute.range, MarkerSeverity.Error));
|
|
312
312
|
}
|
|
@@ -316,12 +316,12 @@ let PromptValidator = class PromptValidator {
|
|
|
316
316
|
return undefined;
|
|
317
317
|
}
|
|
318
318
|
if (attribute.value.type !== 'string') {
|
|
319
|
-
report(toMarker(( localize(
|
|
319
|
+
report(toMarker(( localize(5900, "The '{0}' attribute must be a string.", attribute.key)), attribute.value.range, MarkerSeverity.Error));
|
|
320
320
|
return undefined;
|
|
321
321
|
}
|
|
322
322
|
const agentValue = attribute.value.value;
|
|
323
323
|
if (agentValue.trim().length === 0) {
|
|
324
|
-
report(toMarker(( localize(
|
|
324
|
+
report(toMarker(( localize(5901, "The '{0}' attribute must be a non-empty string.", attribute.key)), attribute.value.range, MarkerSeverity.Error));
|
|
325
325
|
return undefined;
|
|
326
326
|
}
|
|
327
327
|
return this.validateAgentValue(attribute.value, report);
|
|
@@ -336,7 +336,7 @@ let PromptValidator = class PromptValidator {
|
|
|
336
336
|
availableAgents.push(agent.name.get());
|
|
337
337
|
}
|
|
338
338
|
const errorMessage = ( localize(
|
|
339
|
-
|
|
339
|
+
5902,
|
|
340
340
|
"Unknown agent '{0}'. Available agents: {1}.",
|
|
341
341
|
value.value,
|
|
342
342
|
availableAgents.join(', ')
|
|
@@ -351,7 +351,7 @@ let PromptValidator = class PromptValidator {
|
|
|
351
351
|
}
|
|
352
352
|
if (agentKind !== ChatModeKind.Agent) {
|
|
353
353
|
report(toMarker(( localize(
|
|
354
|
-
|
|
354
|
+
5903,
|
|
355
355
|
"The 'tools' attribute is only supported when using agents. Attribute will be ignored."
|
|
356
356
|
)), attribute.range, MarkerSeverity.Warning));
|
|
357
357
|
}
|
|
@@ -363,7 +363,7 @@ let PromptValidator = class PromptValidator {
|
|
|
363
363
|
}
|
|
364
364
|
break;
|
|
365
365
|
default:
|
|
366
|
-
report(toMarker(( localize(
|
|
366
|
+
report(toMarker(( localize(5904, "The 'tools' attribute must be an array.")), attribute.value.range, MarkerSeverity.Error));
|
|
367
367
|
}
|
|
368
368
|
}
|
|
369
369
|
validateVSCodeTools(valueItem, target, report) {
|
|
@@ -372,7 +372,7 @@ let PromptValidator = class PromptValidator {
|
|
|
372
372
|
const deprecatedNames = this.languageModelToolsService.getDeprecatedQualifiedToolNames();
|
|
373
373
|
for (const item of valueItem.items) {
|
|
374
374
|
if (item.type !== 'string') {
|
|
375
|
-
report(toMarker(( localize(
|
|
375
|
+
report(toMarker(( localize(5905, "Each tool name in the 'tools' attribute must be a string.")), item.range, MarkerSeverity.Error));
|
|
376
376
|
}
|
|
377
377
|
else if (item.value) {
|
|
378
378
|
const toolName = target === undefined ? this.languageModelToolsService.mapGithubToolName(item.value) : item.value;
|
|
@@ -380,14 +380,14 @@ let PromptValidator = class PromptValidator {
|
|
|
380
380
|
if (( deprecatedNames.has(toolName))) {
|
|
381
381
|
const currentName = deprecatedNames.get(toolName);
|
|
382
382
|
report(toMarker(( localize(
|
|
383
|
-
|
|
383
|
+
5906,
|
|
384
384
|
"Tool or toolset '{0}' has been renamed, use '{1}' instead.",
|
|
385
385
|
toolName,
|
|
386
386
|
currentName
|
|
387
387
|
)), item.range, MarkerSeverity.Info));
|
|
388
388
|
}
|
|
389
389
|
else {
|
|
390
|
-
report(toMarker(( localize(
|
|
390
|
+
report(toMarker(( localize(5907, "Unknown tool '{0}'.", toolName)), item.range, MarkerSeverity.Warning));
|
|
391
391
|
}
|
|
392
392
|
}
|
|
393
393
|
}
|
|
@@ -400,26 +400,26 @@ let PromptValidator = class PromptValidator {
|
|
|
400
400
|
return;
|
|
401
401
|
}
|
|
402
402
|
if (attribute.value.type !== 'string') {
|
|
403
|
-
report(toMarker(( localize(
|
|
403
|
+
report(toMarker(( localize(5908, "The 'applyTo' attribute must be a string.")), attribute.value.range, MarkerSeverity.Error));
|
|
404
404
|
return;
|
|
405
405
|
}
|
|
406
406
|
const pattern = attribute.value.value;
|
|
407
407
|
try {
|
|
408
408
|
const patterns = splitGlobAware(pattern, ',');
|
|
409
409
|
if (patterns.length === 0) {
|
|
410
|
-
report(toMarker(( localize(
|
|
410
|
+
report(toMarker(( localize(5909, "The 'applyTo' attribute must be a valid glob pattern.")), attribute.value.range, MarkerSeverity.Error));
|
|
411
411
|
return;
|
|
412
412
|
}
|
|
413
413
|
for (const pattern of patterns) {
|
|
414
414
|
const globPattern = parse(pattern);
|
|
415
415
|
if (isEmptyPattern(globPattern)) {
|
|
416
|
-
report(toMarker(( localize(
|
|
416
|
+
report(toMarker(( localize(5909, "The 'applyTo' attribute must be a valid glob pattern.")), attribute.value.range, MarkerSeverity.Error));
|
|
417
417
|
return;
|
|
418
418
|
}
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
catch (_error) {
|
|
422
|
-
report(toMarker(( localize(
|
|
422
|
+
report(toMarker(( localize(5909, "The 'applyTo' attribute must be a valid glob pattern.")), attribute.value.range, MarkerSeverity.Error));
|
|
423
423
|
}
|
|
424
424
|
}
|
|
425
425
|
validateExcludeAgent(attributes, report) {
|
|
@@ -428,7 +428,7 @@ let PromptValidator = class PromptValidator {
|
|
|
428
428
|
return;
|
|
429
429
|
}
|
|
430
430
|
if (attribute.value.type !== 'array') {
|
|
431
|
-
report(toMarker(( localize(
|
|
431
|
+
report(toMarker(( localize(5910, "The 'excludeAgent' attribute must be an array.")), attribute.value.range, MarkerSeverity.Error));
|
|
432
432
|
return;
|
|
433
433
|
}
|
|
434
434
|
}
|
|
@@ -438,13 +438,13 @@ let PromptValidator = class PromptValidator {
|
|
|
438
438
|
return;
|
|
439
439
|
}
|
|
440
440
|
if (attribute.value.type !== 'array') {
|
|
441
|
-
report(toMarker(( localize(
|
|
441
|
+
report(toMarker(( localize(5911, "The 'handoffs' attribute must be an array.")), attribute.value.range, MarkerSeverity.Error));
|
|
442
442
|
return;
|
|
443
443
|
}
|
|
444
444
|
for (const item of attribute.value.items) {
|
|
445
445
|
if (item.type !== 'object') {
|
|
446
446
|
report(toMarker(( localize(
|
|
447
|
-
|
|
447
|
+
5912,
|
|
448
448
|
"Each handoff in the 'handoffs' attribute must be an object with 'label', 'agent', 'prompt' and optional 'send'."
|
|
449
449
|
)), item.range, MarkerSeverity.Error));
|
|
450
450
|
continue;
|
|
@@ -454,12 +454,12 @@ let PromptValidator = class PromptValidator {
|
|
|
454
454
|
switch (prop.key.value) {
|
|
455
455
|
case 'label':
|
|
456
456
|
if (prop.value.type !== 'string' || prop.value.value.trim().length === 0) {
|
|
457
|
-
report(toMarker(( localize(
|
|
457
|
+
report(toMarker(( localize(5913, "The 'label' property in a handoff must be a non-empty string.")), prop.value.range, MarkerSeverity.Error));
|
|
458
458
|
}
|
|
459
459
|
break;
|
|
460
460
|
case 'agent':
|
|
461
461
|
if (prop.value.type !== 'string' || prop.value.value.trim().length === 0) {
|
|
462
|
-
report(toMarker(( localize(
|
|
462
|
+
report(toMarker(( localize(5914, "The 'agent' property in a handoff must be a non-empty string.")), prop.value.range, MarkerSeverity.Error));
|
|
463
463
|
}
|
|
464
464
|
else {
|
|
465
465
|
this.validateAgentValue(prop.value, report);
|
|
@@ -467,17 +467,17 @@ let PromptValidator = class PromptValidator {
|
|
|
467
467
|
break;
|
|
468
468
|
case 'prompt':
|
|
469
469
|
if (prop.value.type !== 'string') {
|
|
470
|
-
report(toMarker(( localize(
|
|
470
|
+
report(toMarker(( localize(5915, "The 'prompt' property in a handoff must be a string.")), prop.value.range, MarkerSeverity.Error));
|
|
471
471
|
}
|
|
472
472
|
break;
|
|
473
473
|
case 'send':
|
|
474
474
|
if (prop.value.type !== 'boolean') {
|
|
475
|
-
report(toMarker(( localize(
|
|
475
|
+
report(toMarker(( localize(5916, "The 'send' property in a handoff must be a boolean.")), prop.value.range, MarkerSeverity.Error));
|
|
476
476
|
}
|
|
477
477
|
break;
|
|
478
478
|
default:
|
|
479
479
|
report(toMarker(( localize(
|
|
480
|
-
|
|
480
|
+
5917,
|
|
481
481
|
"Unknown property '{0}' in handoff object. Supported properties are 'label', 'agent', 'prompt' and optional 'send'.",
|
|
482
482
|
prop.key.value
|
|
483
483
|
)), prop.value.range, MarkerSeverity.Warning));
|
|
@@ -486,7 +486,7 @@ let PromptValidator = class PromptValidator {
|
|
|
486
486
|
}
|
|
487
487
|
if (required.size > 0) {
|
|
488
488
|
report(toMarker(( localize(
|
|
489
|
-
|
|
489
|
+
5918,
|
|
490
490
|
"Missing required properties {0} in handoff object.",
|
|
491
491
|
( Array.from(required).map(s => `'${s}'`)).join(', ')
|
|
492
492
|
)), item.range, MarkerSeverity.Error));
|
|
@@ -499,18 +499,18 @@ let PromptValidator = class PromptValidator {
|
|
|
499
499
|
return;
|
|
500
500
|
}
|
|
501
501
|
if (attribute.value.type !== 'string') {
|
|
502
|
-
report(toMarker(( localize(
|
|
502
|
+
report(toMarker(( localize(5919, "The 'target' attribute must be a string.")), attribute.value.range, MarkerSeverity.Error));
|
|
503
503
|
return;
|
|
504
504
|
}
|
|
505
505
|
const targetValue = attribute.value.value.trim();
|
|
506
506
|
if (targetValue.length === 0) {
|
|
507
|
-
report(toMarker(( localize(
|
|
507
|
+
report(toMarker(( localize(5920, "The 'target' attribute must be a non-empty string.")), attribute.value.range, MarkerSeverity.Error));
|
|
508
508
|
return;
|
|
509
509
|
}
|
|
510
510
|
const validTargets = ['github-copilot', 'vscode'];
|
|
511
511
|
if (!validTargets.includes(targetValue)) {
|
|
512
512
|
report(toMarker(( localize(
|
|
513
|
-
|
|
513
|
+
5921,
|
|
514
514
|
"The 'target' attribute must be one of: {0}.",
|
|
515
515
|
validTargets.join(', ')
|
|
516
516
|
)), attribute.value.range, MarkerSeverity.Error));
|
|
@@ -546,10 +546,10 @@ function isNonRecommendedAttribute(attributeName) {
|
|
|
546
546
|
return attributeName === PromptHeaderAttributes.advancedOptions || attributeName === PromptHeaderAttributes.excludeAgent || attributeName === PromptHeaderAttributes.mode;
|
|
547
547
|
}
|
|
548
548
|
const knownGithubCopilotTools = {
|
|
549
|
-
'shell': ( localize(
|
|
550
|
-
'edit': ( localize(
|
|
551
|
-
'search': ( localize(
|
|
552
|
-
'custom-agent': ( localize(
|
|
549
|
+
'shell': ( localize(5922, 'Execute shell commands')),
|
|
550
|
+
'edit': ( localize(5923, 'Edit files')),
|
|
551
|
+
'search': ( localize(5924, 'Search in files')),
|
|
552
|
+
'custom-agent': ( localize(5925, 'Call custom agents'))
|
|
553
553
|
};
|
|
554
554
|
function isGithubTarget(promptType, target) {
|
|
555
555
|
return promptType === PromptsType.agent && target === Target.GitHubCopilot;
|
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js
CHANGED
|
@@ -148,7 +148,7 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
148
148
|
}
|
|
149
149
|
asPromptSlashCommand(command) {
|
|
150
150
|
if (command.match(/^[\p{L}\d_\-\.]+$/u)) {
|
|
151
|
-
return { command, detail: ( localize(
|
|
151
|
+
return { command, detail: ( localize(5926, 'Prompt file: {0}', command)) };
|
|
152
152
|
}
|
|
153
153
|
return undefined;
|
|
154
154
|
}
|
|
@@ -228,7 +228,7 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
228
228
|
return {
|
|
229
229
|
command: name,
|
|
230
230
|
detail: ( localize(
|
|
231
|
-
|
|
231
|
+
5926,
|
|
232
232
|
'Prompt file: {0}',
|
|
233
233
|
this.labelService.getUriLabel(promptPath.uri, { relative: true })
|
|
234
234
|
)),
|
|
@@ -333,10 +333,10 @@ let PromptsService = class PromptsService extends Disposable {
|
|
|
333
333
|
getPromptLocationLabel(promptPath) {
|
|
334
334
|
switch (promptPath.storage) {
|
|
335
335
|
case PromptsStorage.local: return this.labelService.getUriLabel(dirname(promptPath.uri), { relative: true });
|
|
336
|
-
case PromptsStorage.user: return localize(
|
|
336
|
+
case PromptsStorage.user: return localize(5927, 'User Data');
|
|
337
337
|
case PromptsStorage.extension: {
|
|
338
338
|
return localize(
|
|
339
|
-
|
|
339
|
+
5928,
|
|
340
340
|
'Extension: {0}',
|
|
341
341
|
promptPath.extension.displayName ?? promptPath.extension.id
|
|
342
342
|
);
|
|
@@ -30,7 +30,7 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
30
30
|
},
|
|
31
31
|
jsonSchema: {
|
|
32
32
|
description: ( localize(
|
|
33
|
-
|
|
33
|
+
5929,
|
|
34
34
|
'Contributes a tool that can be invoked by a language model in a chat session, or from a standalone command. Registered tools can be used by all extensions.'
|
|
35
35
|
)),
|
|
36
36
|
type: 'array',
|
|
@@ -56,7 +56,7 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
56
56
|
properties: {
|
|
57
57
|
name: {
|
|
58
58
|
description: ( localize(
|
|
59
|
-
|
|
59
|
+
5930,
|
|
60
60
|
"A unique name for this tool. This name must be a globally unique identifier, and is also used as a name when presenting this tool to a language model."
|
|
61
61
|
)),
|
|
62
62
|
type: 'string',
|
|
@@ -64,7 +64,7 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
64
64
|
},
|
|
65
65
|
toolReferenceName: {
|
|
66
66
|
markdownDescription: ( localize(
|
|
67
|
-
|
|
67
|
+
5931,
|
|
68
68
|
"If {0} is enabled for this tool, the user may use '#' with this name to invoke the tool in a query. Otherwise, the name is not required. Name must not contain whitespace.",
|
|
69
69
|
'`canBeReferencedInPrompt`'
|
|
70
70
|
)),
|
|
@@ -73,32 +73,32 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
73
73
|
},
|
|
74
74
|
displayName: {
|
|
75
75
|
description: ( localize(
|
|
76
|
-
|
|
76
|
+
5932,
|
|
77
77
|
"A human-readable name for this tool that may be used to describe it in the UI."
|
|
78
78
|
)),
|
|
79
79
|
type: 'string'
|
|
80
80
|
},
|
|
81
81
|
userDescription: {
|
|
82
|
-
description: ( localize(
|
|
82
|
+
description: ( localize(5933, "A description of this tool that may be shown to the user.")),
|
|
83
83
|
type: 'string'
|
|
84
84
|
},
|
|
85
85
|
modelDescription: {
|
|
86
86
|
description: ( localize(
|
|
87
|
-
|
|
87
|
+
5934,
|
|
88
88
|
"A description of this tool that may be used by a language model to select it."
|
|
89
89
|
)),
|
|
90
90
|
type: 'string'
|
|
91
91
|
},
|
|
92
92
|
inputSchema: {
|
|
93
93
|
description: ( localize(
|
|
94
|
-
|
|
94
|
+
5935,
|
|
95
95
|
"A JSON schema for the input this tool accepts. The input must be an object at the top level. A particular language model may not support all JSON schema features. See the documentation for the language model family you are using for more information."
|
|
96
96
|
)),
|
|
97
97
|
$ref: toolsParametersSchemaSchemaId
|
|
98
98
|
},
|
|
99
99
|
canBeReferencedInPrompt: {
|
|
100
100
|
markdownDescription: ( localize(
|
|
101
|
-
|
|
101
|
+
5936,
|
|
102
102
|
"If true, this tool shows up as an attachment that the user can add manually to their request. Chat participants will receive the tool in {0}.",
|
|
103
103
|
'`ChatRequest#toolReferences`'
|
|
104
104
|
)),
|
|
@@ -106,7 +106,7 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
106
106
|
},
|
|
107
107
|
icon: {
|
|
108
108
|
markdownDescription: ( localize(
|
|
109
|
-
|
|
109
|
+
5937,
|
|
110
110
|
'An icon that represents this tool. Either a file path, an object with file paths for dark and light themes, or a theme icon reference, like "\\$(zap)"'
|
|
111
111
|
)),
|
|
112
112
|
anyOf: [{
|
|
@@ -116,11 +116,11 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
116
116
|
type: 'object',
|
|
117
117
|
properties: {
|
|
118
118
|
light: {
|
|
119
|
-
description: ( localize(
|
|
119
|
+
description: ( localize(5938, 'Icon path when a light theme is used')),
|
|
120
120
|
type: 'string'
|
|
121
121
|
},
|
|
122
122
|
dark: {
|
|
123
|
-
description: ( localize(
|
|
123
|
+
description: ( localize(5939, 'Icon path when a dark theme is used')),
|
|
124
124
|
type: 'string'
|
|
125
125
|
}
|
|
126
126
|
}
|
|
@@ -128,14 +128,14 @@ const languageModelToolsExtensionPoint = ExtensionsRegistry.registerExtensionPoi
|
|
|
128
128
|
},
|
|
129
129
|
when: {
|
|
130
130
|
markdownDescription: ( localize(
|
|
131
|
-
|
|
131
|
+
5940,
|
|
132
132
|
"Condition which must be true for this tool to be enabled. Note that a tool may still be invoked by another extension even when its `when` condition is false."
|
|
133
133
|
)),
|
|
134
134
|
type: 'string'
|
|
135
135
|
},
|
|
136
136
|
tags: {
|
|
137
137
|
description: ( localize(
|
|
138
|
-
|
|
138
|
+
5941,
|
|
139
139
|
"A set of tags that roughly describe the tool's capabilities. A tool user may use these to filter the set of tools to just ones that are relevant for the task at hand, or they may want to pick a tag that can be used to identify just the tools contributed by this extension."
|
|
140
140
|
)),
|
|
141
141
|
type: 'array',
|
|
@@ -153,7 +153,7 @@ const languageModelToolSetsExtensionPoint = ExtensionsRegistry.registerExtension
|
|
|
153
153
|
deps: [languageModelToolsExtensionPoint],
|
|
154
154
|
jsonSchema: {
|
|
155
155
|
description: ( localize(
|
|
156
|
-
|
|
156
|
+
5942,
|
|
157
157
|
'Contributes a set of language model tools that can be used together.'
|
|
158
158
|
)),
|
|
159
159
|
type: 'array',
|
|
@@ -171,23 +171,23 @@ const languageModelToolSetsExtensionPoint = ExtensionsRegistry.registerExtension
|
|
|
171
171
|
properties: {
|
|
172
172
|
name: {
|
|
173
173
|
description: ( localize(
|
|
174
|
-
|
|
174
|
+
5943,
|
|
175
175
|
"A name for this tool set. Used as reference and should not contain whitespace."
|
|
176
176
|
)),
|
|
177
177
|
type: 'string',
|
|
178
178
|
pattern: '^[\\w-]+$'
|
|
179
179
|
},
|
|
180
180
|
description: {
|
|
181
|
-
description: ( localize(
|
|
181
|
+
description: ( localize(5944, "A description of this tool set.")),
|
|
182
182
|
type: 'string'
|
|
183
183
|
},
|
|
184
184
|
icon: {
|
|
185
|
-
markdownDescription: ( localize(
|
|
185
|
+
markdownDescription: ( localize(5945, "An icon that represents this tool set, like `$(zap)`")),
|
|
186
186
|
type: 'string'
|
|
187
187
|
},
|
|
188
188
|
tools: {
|
|
189
189
|
markdownDescription: ( localize(
|
|
190
|
-
|
|
190
|
+
5946,
|
|
191
191
|
"A list of tools or tool sets to include in this tool set. Cannot be empty and must reference tools by their `toolReferenceName`."
|
|
192
192
|
)),
|
|
193
193
|
type: 'array',
|
|
@@ -352,9 +352,9 @@ class LanguageModelToolDataRenderer extends Disposable {
|
|
|
352
352
|
return { data: { headers: [], rows: [] }, dispose: () => { } };
|
|
353
353
|
}
|
|
354
354
|
const headers = [
|
|
355
|
-
( localize(
|
|
356
|
-
( localize(
|
|
357
|
-
( localize(
|
|
355
|
+
( localize(5947, "Name")),
|
|
356
|
+
( localize(5948, "Display Name")),
|
|
357
|
+
( localize(5949, "Description")),
|
|
358
358
|
];
|
|
359
359
|
const rows = ( contribs.map(t => {
|
|
360
360
|
return [
|
|
@@ -374,7 +374,7 @@ class LanguageModelToolDataRenderer extends Disposable {
|
|
|
374
374
|
}
|
|
375
375
|
( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
376
376
|
id: 'languageModelTools',
|
|
377
|
-
label: ( localize(
|
|
377
|
+
label: ( localize(5950, "Language Model Tools")),
|
|
378
378
|
access: {
|
|
379
379
|
canToggle: false
|
|
380
380
|
},
|
|
@@ -394,10 +394,10 @@ class LanguageModelToolSetDataRenderer extends Disposable {
|
|
|
394
394
|
return { data: { headers: [], rows: [] }, dispose: () => { } };
|
|
395
395
|
}
|
|
396
396
|
const headers = [
|
|
397
|
-
( localize(
|
|
398
|
-
( localize(
|
|
399
|
-
( localize(
|
|
400
|
-
( localize(
|
|
397
|
+
( localize(5951, "Name")),
|
|
398
|
+
( localize(5952, "Reference Name")),
|
|
399
|
+
( localize(5953, "Tools")),
|
|
400
|
+
( localize(5954, "Description")),
|
|
401
401
|
];
|
|
402
402
|
const rows = ( contribs.map(t => {
|
|
403
403
|
return [
|
|
@@ -418,7 +418,7 @@ class LanguageModelToolSetDataRenderer extends Disposable {
|
|
|
418
418
|
}
|
|
419
419
|
( Registry.as(Extensions.ExtensionFeaturesRegistry)).registerExtensionFeature({
|
|
420
420
|
id: 'languageModelToolSets',
|
|
421
|
-
label: ( localize(
|
|
421
|
+
label: ( localize(5955, "Language Model Tool Sets")),
|
|
422
422
|
access: {
|
|
423
423
|
canToggle: false
|
|
424
424
|
},
|
|
@@ -21,7 +21,7 @@ var PhraseTextType;
|
|
|
21
21
|
const VoiceChatInProgress = ( new RawContextKey(
|
|
22
22
|
'voiceChatInProgress',
|
|
23
23
|
false,
|
|
24
|
-
{ type: 'boolean', description: ( localize(
|
|
24
|
+
{ type: 'boolean', description: ( localize(5969, "A speech-to-text session is in progress for chat.")) }
|
|
25
25
|
));
|
|
26
26
|
let VoiceChatService = class VoiceChatService extends Disposable {
|
|
27
27
|
static { VoiceChatService_1 = this; }
|
|
@@ -34,7 +34,7 @@ const editActionMenuItem = {
|
|
|
34
34
|
order: 0,
|
|
35
35
|
command: {
|
|
36
36
|
id: ChatSubmitAction.ID,
|
|
37
|
-
title: ( localize(
|
|
37
|
+
title: ( localize(8122, "Edit Code")),
|
|
38
38
|
},
|
|
39
39
|
when: ( ContextKeyExpr.and(ChatContextKeys.inputHasText, ( CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.toNegated()), CTX_INLINE_CHAT_EDITING, CTX_INLINE_CHAT_V1_ENABLED)),
|
|
40
40
|
};
|
|
@@ -43,7 +43,7 @@ const generateActionMenuItem = {
|
|
|
43
43
|
order: 0,
|
|
44
44
|
command: {
|
|
45
45
|
id: ChatSubmitAction.ID,
|
|
46
|
-
title: ( localize(
|
|
46
|
+
title: ( localize(8123, "Generate")),
|
|
47
47
|
},
|
|
48
48
|
when: ( ContextKeyExpr.and(ChatContextKeys.inputHasText, ( CTX_INLINE_CHAT_REQUEST_IN_PROGRESS.toNegated()), ( CTX_INLINE_CHAT_EDITING.toNegated()), CTX_INLINE_CHAT_V1_ENABLED)),
|
|
49
49
|
};
|
|
@@ -54,8 +54,8 @@ const cancelActionMenuItem = {
|
|
|
54
54
|
order: 0,
|
|
55
55
|
command: {
|
|
56
56
|
id: CancelAction.ID,
|
|
57
|
-
title: ( localize(
|
|
58
|
-
shortTitle: ( localize(
|
|
57
|
+
title: ( localize(8124, "Cancel Request")),
|
|
58
|
+
shortTitle: ( localize(8125, "Cancel")),
|
|
59
59
|
},
|
|
60
60
|
when: ( ContextKeyExpr.and(CTX_INLINE_CHAT_REQUEST_IN_PROGRESS)),
|
|
61
61
|
};
|