| import { SET_WORKING_DIRECTORY_LABEL } from '$lib/constants/working-directory'; |
| import { ChatFormCommandAction } from '$lib/enums'; |
| import type { ChatFormCommand } from '$lib/types'; |
|
|
| interface ChatCommandsOptions { |
| |
| showModelSelector: boolean; |
| |
| hasPrompts: () => boolean; |
| |
| hasCwdTools: () => boolean; |
| } |
|
|
| |
| |
| |
| |
| |
| |
| |
| |
| export function getChatCommands(options: ChatCommandsOptions): ChatFormCommand[] { |
| return [ |
| { |
| action: ChatFormCommandAction.PROMPT, |
| description: 'Insert an MCP prompt', |
| disabled: !options.hasPrompts(), |
| name: 'prompt' |
| }, |
| { |
| action: ChatFormCommandAction.CWD, |
| description: SET_WORKING_DIRECTORY_LABEL, |
| disabled: !options.hasCwdTools(), |
| keywords: ['current working directory'], |
| name: 'cwd' |
| }, |
| { |
| action: ChatFormCommandAction.MODEL, |
| description: 'Select model', |
| disabled: !options.showModelSelector, |
| name: 'model' |
| } |
| ]; |
| } |
|
|