(
assistant: AssistantConfig,
options: { isRemoteMode?: boolean } = {},
)
| 147 | * Get all available slash commands including system commands and assistant prompts |
| 148 | */ |
| 149 | export async function getAllSlashCommands( |
| 150 | assistant: AssistantConfig, |
| 151 | options: { isRemoteMode?: boolean } = {}, |
| 152 | ): Promise<SlashCommand[]> { |
| 153 | const { isRemoteMode = false } = options; |
| 154 | |
| 155 | // In remote mode, only show the exit command |
| 156 | if (isRemoteMode) { |
| 157 | return REMOTE_MODE_SLASH_COMMANDS; |
| 158 | } |
| 159 | |
| 160 | // All system commands are available |
| 161 | const systemCommands = SYSTEM_SLASH_COMMANDS; |
| 162 | |
| 163 | // Get assistant prompt commands |
| 164 | const assistantCommands: SlashCommand[] = |
| 165 | assistant?.prompts?.map((prompt) => ({ |
| 166 | name: prompt?.name || "", |
| 167 | description: prompt?.description || "", |
| 168 | category: "assistant" as const, |
| 169 | })) || []; |
| 170 | |
| 171 | // Get invokable rule commands |
| 172 | const invokableRuleCommands = getInvokableRuleSlashCommands(assistant); |
| 173 | |
| 174 | // Get skill commands |
| 175 | const skillCommands = await getSkillSlashCommands(); |
| 176 | |
| 177 | return [ |
| 178 | ...systemCommands, |
| 179 | ...assistantCommands, |
| 180 | ...invokableRuleCommands, |
| 181 | ...skillCommands, |
| 182 | ]; |
| 183 | } |
| 184 | |
| 185 | /** |
| 186 | * Get assistant prompt commands only |
no test coverage detected