@@ -56,7 +56,7 @@ import { registerChatFileTreeActions } from 'vs/workbench/contrib/chat/browser/a
56
56
import { QuickChatService } from 'vs/workbench/contrib/chat/browser/chatQuick' ;
57
57
import { ChatAgentService , IChatAgentService } from 'vs/workbench/contrib/chat/common/chatAgents' ;
58
58
import { ChatVariablesService } from 'vs/workbench/contrib/chat/browser/chatVariables' ;
59
- import { chatAgentLeader , chatSubcommandLeader } from 'vs/workbench/contrib/chat/common/chatParserTypes' ;
59
+ import { chatAgentLeader , chatSubcommandLeader , chatVariableLeader } from 'vs/workbench/contrib/chat/common/chatParserTypes' ;
60
60
import { CancellationToken } from 'vs/base/common/cancellation' ;
61
61
import { IVoiceChatService , VoiceChatService } from 'vs/workbench/contrib/chat/common/voiceChat' ;
62
62
@@ -228,6 +228,7 @@ class ChatSlashStaticSlashCommandsContribution extends Disposable {
228
228
@IChatSlashCommandService slashCommandService : IChatSlashCommandService ,
229
229
@ICommandService commandService : ICommandService ,
230
230
@IChatAgentService chatAgentService : IChatAgentService ,
231
+ @IChatVariablesService chatVariablesService : IChatVariablesService ,
231
232
) {
232
233
super ( ) ;
233
234
this . _store . add ( slashCommandService . registerSlashCommand ( {
@@ -246,6 +247,8 @@ class ChatSlashStaticSlashCommandsContribution extends Disposable {
246
247
} , async ( prompt , progress ) => {
247
248
const defaultAgent = chatAgentService . getDefaultAgent ( ) ;
248
249
const agents = chatAgentService . getAgents ( ) ;
250
+
251
+ // Report prefix
249
252
if ( defaultAgent ?. metadata . helpTextPrefix ) {
250
253
if ( isMarkdownString ( defaultAgent . metadata . helpTextPrefix ) ) {
251
254
progress . report ( { content : defaultAgent . metadata . helpTextPrefix , kind : 'markdownContent' } ) ;
@@ -255,6 +258,7 @@ class ChatSlashStaticSlashCommandsContribution extends Disposable {
255
258
progress . report ( { content : '\n\n' , kind : 'content' } ) ;
256
259
}
257
260
261
+ // Report agent list
258
262
const agentText = ( await Promise . all ( agents
259
263
. filter ( a => a . id !== defaultAgent ?. id )
260
264
. map ( async a => {
@@ -272,6 +276,23 @@ class ChatSlashStaticSlashCommandsContribution extends Disposable {
272
276
return ( agentLine + '\n' + commandText ) . trim ( ) ;
273
277
} ) ) ) . join ( '\n' ) ;
274
278
progress . report ( { content : new MarkdownString ( agentText , { isTrusted : { enabledCommands : [ SubmitAction . ID ] } } ) , kind : 'markdownContent' } ) ;
279
+
280
+ // Report variables
281
+ if ( defaultAgent ?. metadata . helpTextVariablesPrefix ) {
282
+ progress . report ( { content : '\n\n' , kind : 'content' } ) ;
283
+ if ( isMarkdownString ( defaultAgent . metadata . helpTextVariablesPrefix ) ) {
284
+ progress . report ( { content : defaultAgent . metadata . helpTextVariablesPrefix , kind : 'markdownContent' } ) ;
285
+ } else {
286
+ progress . report ( { content : defaultAgent . metadata . helpTextVariablesPrefix , kind : 'content' } ) ;
287
+ }
288
+
289
+ const variableText = Array . from ( chatVariablesService . getVariables ( ) )
290
+ . map ( v => `* \`${ chatVariableLeader } ${ v . name } \` - ${ v . description } ` )
291
+ . join ( '\n' ) ;
292
+ progress . report ( { content : '\n' + variableText , kind : 'content' } ) ;
293
+ }
294
+
295
+ // Report help text ending
275
296
if ( defaultAgent ?. metadata . helpTextPostfix ) {
276
297
progress . report ( { content : '\n\n' , kind : 'content' } ) ;
277
298
if ( isMarkdownString ( defaultAgent . metadata . helpTextPostfix ) ) {
0 commit comments