@codingame/monaco-vscode-chat-service-override 23.1.0 → 23.2.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/index.js +1 -1
- package/package.json +41 -43
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +48 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatSessionActions.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionViewModel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsView.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +101 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/chatAccessibilityService.js +3 -3
- 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 +18 -18
- 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.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
- 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 +8 -8
- 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/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.js +8 -8
- 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 +21 -21
- 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 +4 -4
- 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
package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js
CHANGED
|
@@ -57,17 +57,17 @@ let PromptHoverProvider = class PromptHoverProvider {
|
|
|
57
57
|
switch (attribute.key) {
|
|
58
58
|
case PromptHeaderAttributes.name:
|
|
59
59
|
return this.createHover(( localize(
|
|
60
|
-
|
|
60
|
+
5868,
|
|
61
61
|
'The name of the instruction file as shown in the UI. If not set, the name is derived from the file name.'
|
|
62
62
|
)), attribute.range);
|
|
63
63
|
case PromptHeaderAttributes.description:
|
|
64
64
|
return this.createHover(( localize(
|
|
65
|
-
|
|
65
|
+
5869,
|
|
66
66
|
'The description of the instruction file. It can be used to provide additional context or information about the instructions and is passed to the language model as part of the prompt.'
|
|
67
67
|
)), attribute.range);
|
|
68
68
|
case PromptHeaderAttributes.applyTo:
|
|
69
69
|
return this.createHover(( localize(
|
|
70
|
-
|
|
70
|
+
5870,
|
|
71
71
|
'One or more glob pattern (separated by comma) that describe for which files the instructions apply to. Based on these patterns, the file is automatically included in the prompt, when the context contains a file that matches one or more of these patterns. Use `**` when you want this file to always be added.\nExample: `**/*.ts`, `**/*.js`, `client/**`'
|
|
72
72
|
)), attribute.range);
|
|
73
73
|
}
|
|
@@ -80,26 +80,26 @@ let PromptHoverProvider = class PromptHoverProvider {
|
|
|
80
80
|
if (attribute.range.containsPosition(position)) {
|
|
81
81
|
switch (attribute.key) {
|
|
82
82
|
case PromptHeaderAttributes.name:
|
|
83
|
-
return this.createHover(( localize(
|
|
83
|
+
return this.createHover(( localize(5871, 'The name of the agent as shown in the UI.')), attribute.range);
|
|
84
84
|
case PromptHeaderAttributes.description:
|
|
85
85
|
return this.createHover(( localize(
|
|
86
|
-
|
|
86
|
+
5872,
|
|
87
87
|
'The description of the custom agent, what it does and when to use it.'
|
|
88
88
|
)), attribute.range);
|
|
89
89
|
case PromptHeaderAttributes.argumentHint:
|
|
90
90
|
return this.createHover(( localize(
|
|
91
|
-
|
|
91
|
+
5873,
|
|
92
92
|
'The argument-hint describes what inputs the custom agent expects or supports.'
|
|
93
93
|
)), attribute.range);
|
|
94
94
|
case PromptHeaderAttributes.model:
|
|
95
|
-
return this.getModelHover(attribute, attribute.range, ( localize(
|
|
95
|
+
return this.getModelHover(attribute, attribute.range, ( localize(5874, 'Specify the model that runs this custom agent.')), isGitHubTarget);
|
|
96
96
|
case PromptHeaderAttributes.tools:
|
|
97
|
-
return this.getToolHover(attribute, position, ( localize(
|
|
97
|
+
return this.getToolHover(attribute, position, ( localize(5875, 'The set of tools that the custom agent has access to.')), header.target);
|
|
98
98
|
case PromptHeaderAttributes.handOffs:
|
|
99
99
|
return this.getHandsOffHover(attribute, position, isGitHubTarget);
|
|
100
100
|
case PromptHeaderAttributes.target:
|
|
101
101
|
return this.createHover(( localize(
|
|
102
|
-
|
|
102
|
+
5876,
|
|
103
103
|
'The target to which the header attributes like tools apply to. Possible values are `github-copilot` and `vscode`.'
|
|
104
104
|
)), attribute.range);
|
|
105
105
|
}
|
|
@@ -112,23 +112,23 @@ let PromptHoverProvider = class PromptHoverProvider {
|
|
|
112
112
|
switch (attribute.key) {
|
|
113
113
|
case PromptHeaderAttributes.name:
|
|
114
114
|
return this.createHover(( localize(
|
|
115
|
-
|
|
115
|
+
5877,
|
|
116
116
|
'The name of the prompt. This is also the name of the slash command that will run this prompt.'
|
|
117
117
|
)), attribute.range);
|
|
118
118
|
case PromptHeaderAttributes.description:
|
|
119
119
|
return this.createHover(( localize(
|
|
120
|
-
|
|
120
|
+
5878,
|
|
121
121
|
'The description of the reusable prompt, what it does and when to use it.'
|
|
122
122
|
)), attribute.range);
|
|
123
123
|
case PromptHeaderAttributes.argumentHint:
|
|
124
124
|
return this.createHover(( localize(
|
|
125
|
-
|
|
125
|
+
5879,
|
|
126
126
|
'The argument-hint describes what inputs the prompt expects or supports.'
|
|
127
127
|
)), attribute.range);
|
|
128
128
|
case PromptHeaderAttributes.model:
|
|
129
|
-
return this.getModelHover(attribute, attribute.range, ( localize(
|
|
129
|
+
return this.getModelHover(attribute, attribute.range, ( localize(5880, 'The model to use in this prompt.')), false);
|
|
130
130
|
case PromptHeaderAttributes.tools:
|
|
131
|
-
return this.getToolHover(attribute, position, ( localize(
|
|
131
|
+
return this.getToolHover(attribute, position, ( localize(5881, 'The tools to use in this prompt.')), Target.VSCode);
|
|
132
132
|
case PromptHeaderAttributes.agent:
|
|
133
133
|
case PromptHeaderAttributes.mode:
|
|
134
134
|
return this.getAgentHover(attribute, position);
|
|
@@ -177,7 +177,7 @@ let PromptHoverProvider = class PromptHoverProvider {
|
|
|
177
177
|
}
|
|
178
178
|
getToolsetHover(toolSet, range) {
|
|
179
179
|
const lines = [];
|
|
180
|
-
lines.push(( localize(
|
|
180
|
+
lines.push(( localize(5882, 'ToolSet: {0}\n\n', toolSet.referenceName)));
|
|
181
181
|
if (toolSet.description) {
|
|
182
182
|
lines.push(toolSet.description);
|
|
183
183
|
}
|
|
@@ -188,7 +188,7 @@ let PromptHoverProvider = class PromptHoverProvider {
|
|
|
188
188
|
}
|
|
189
189
|
getModelHover(node, range, baseMessage, isGitHubTarget) {
|
|
190
190
|
if (isGitHubTarget) {
|
|
191
|
-
return this.createHover(baseMessage + '\n\n' + ( localize(
|
|
191
|
+
return this.createHover(baseMessage + '\n\n' + ( localize(5883, 'Note: This attribute is not used when target is github-copilot.')), range);
|
|
192
192
|
}
|
|
193
193
|
if (node.value.type === 'string') {
|
|
194
194
|
for (const id of this.languageModelsService.getLanguageModelIds()) {
|
|
@@ -196,9 +196,9 @@ let PromptHoverProvider = class PromptHoverProvider {
|
|
|
196
196
|
if (meta && ILanguageModelChatMetadata.matchesQualifiedName(node.value.value, meta)) {
|
|
197
197
|
const lines = [];
|
|
198
198
|
lines.push(baseMessage + '\n');
|
|
199
|
-
lines.push(( localize(
|
|
200
|
-
lines.push(( localize(
|
|
201
|
-
lines.push(( localize(
|
|
199
|
+
lines.push(( localize(5884, '- Name: {0}', meta.name)));
|
|
200
|
+
lines.push(( localize(5885, '- Family: {0}', meta.family)));
|
|
201
|
+
lines.push(( localize(5886, '- Vendor: {0}', meta.vendor)));
|
|
202
202
|
if (meta.tooltip) {
|
|
203
203
|
lines.push('', '', meta.tooltip);
|
|
204
204
|
}
|
|
@@ -214,33 +214,33 @@ let PromptHoverProvider = class PromptHoverProvider {
|
|
|
214
214
|
if (value.type === 'string' && value.range.containsPosition(position)) {
|
|
215
215
|
const agent = this.chatModeService.findModeByName(value.value);
|
|
216
216
|
if (agent) {
|
|
217
|
-
const description = agent.description.get() || (isBuiltinChatMode(agent) ? ( localize(
|
|
217
|
+
const description = agent.description.get() || (isBuiltinChatMode(agent) ? ( localize(5887, 'Built-in agent')) : ( localize(5888, 'Custom agent')));
|
|
218
218
|
lines.push(`\`${agent.name.get()}\`: ${description}`);
|
|
219
219
|
}
|
|
220
220
|
}
|
|
221
221
|
else {
|
|
222
222
|
const agents = this.chatModeService.getModes();
|
|
223
|
-
lines.push(( localize(
|
|
223
|
+
lines.push(( localize(5889, 'The agent to use when running this prompt.')));
|
|
224
224
|
lines.push('');
|
|
225
|
-
lines.push(( localize(
|
|
225
|
+
lines.push(( localize(5890, '**Built-in agents:**')));
|
|
226
226
|
for (const agent of agents.builtin) {
|
|
227
227
|
lines.push(`- \`${agent.name.get()}\`: ${agent.description.get() || agent.label.get()}`);
|
|
228
228
|
}
|
|
229
229
|
if (agents.custom.length > 0) {
|
|
230
230
|
lines.push('');
|
|
231
|
-
lines.push(( localize(
|
|
231
|
+
lines.push(( localize(5891, '**Custom agents:**')));
|
|
232
232
|
for (const agent of agents.custom) {
|
|
233
233
|
const description = agent.description.get();
|
|
234
|
-
lines.push(`- \`${agent.name.get()}\`: ${description || ( localize(
|
|
234
|
+
lines.push(`- \`${agent.name.get()}\`: ${description || ( localize(5888, 'Custom agent'))}`);
|
|
235
235
|
}
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
return this.createHover(lines.join('\n'), agentAttribute.range);
|
|
239
239
|
}
|
|
240
240
|
getHandsOffHover(attribute, position, isGitHubTarget) {
|
|
241
|
-
const handoffsBaseMessage = ( localize(
|
|
241
|
+
const handoffsBaseMessage = ( localize(5892, 'Possible handoff actions when the agent has completed its task.'));
|
|
242
242
|
if (isGitHubTarget) {
|
|
243
|
-
return this.createHover(handoffsBaseMessage + '\n\n' + ( localize(
|
|
243
|
+
return this.createHover(handoffsBaseMessage + '\n\n' + ( localize(5893, 'Note: This attribute is not used when target is github-copilot.')), attribute.range);
|
|
244
244
|
}
|
|
245
245
|
return this.createHover(handoffsBaseMessage, attribute.range);
|
|
246
246
|
}
|
|
@@ -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
|
+
5894,
|
|
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
|
+
5895,
|
|
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(5896, "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(5897, "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
|
+
5898,
|
|
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(5899, "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
|
+
5900,
|
|
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
|
+
5901,
|
|
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
|
+
5902,
|
|
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
|
+
5903,
|
|
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
|
+
5904,
|
|
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
|
+
5905,
|
|
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(5906, "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(5907, "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
|
+
5908,
|
|
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(5909, "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(5910, "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(5911, "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(5912, "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(5913, "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(5914, "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(5915, "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(5916, "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
|
+
5917,
|
|
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
|
+
5918,
|
|
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(5919, "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(5920, "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
|
+
5921,
|
|
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
|
+
5922,
|
|
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(5923, "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(5924, "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
|
+
5925,
|
|
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(5926, "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(5927, "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(5928, "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(5928, "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(5928, "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(5929, "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(5930, "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
|
+
5931,
|
|
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(5932, "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(5933, "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(5934, "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(5935, "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
|
+
5936,
|
|
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
|
+
5937,
|
|
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(5938, "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(5939, "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
|
+
5940,
|
|
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(5941, 'Execute shell commands')),
|
|
550
|
+
'edit': ( localize(5942, 'Edit files')),
|
|
551
|
+
'search': ( localize(5943, 'Search in files')),
|
|
552
|
+
'custom-agent': ( localize(5944, '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(5945, '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
|
+
5945,
|
|
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(5946, 'User Data');
|
|
337
337
|
case PromptsStorage.extension: {
|
|
338
338
|
return localize(
|
|
339
|
-
|
|
339
|
+
5947,
|
|
340
340
|
'Extension: {0}',
|
|
341
341
|
promptPath.extension.displayName ?? promptPath.extension.id
|
|
342
342
|
);
|