229
}
230
231
>
const capabilities = context?.attachmentCapabilities ?? usedAgent?.capabilities;
chatRequestParser.ts
232
>
const slashCommands = this.slashCommandService.getCommands(location, context?.mode ?? ChatModeKind.Ask);
233
>
const slashCommand = slashCommands.find(c => c.command === command && matchesSessionType(c.sessionTypes, context?.sessionType));
234
>
// If there is no agent, we allow any slash command.
235
>
// If there is an agent, we let
236
>
// * silent ones go through since they are only UI-facing and don't influence chat history
237
>
// * slash commands that support prompt attachments, since those are meant to be used in conjunction with an agent and we can assume the agent can handle them.
238
>
if (!usedAgent || slashCommand?.silent || capabilities?.supportsPromptAttachments) {
239
if (slashCommand) {
240
// Valid standalone slash command