char-fork/llama.cpp

git clone https://git.t4t.associates/char-fork/llama.cpp

Aleksander Grygierui: Constants refactor (#26908)e21152dc9

char/aliceai-t5-moe
1.1 KiB35 linesraw
1import { SET_WORKING_DIRECTORY_LABEL } from '$lib/constants';
2import { ChatFormCommandAction } from '$lib/enums';
3import type { ChatCommandsOptions, ChatFormCommand } from '$lib/types';
4
5/**
6 * The slash commands surfaced by the `/` command picker, in display order.
7 *
8 * Availability is supplied as predicates rather than store imports: this
9 * module is re-exported through the `$lib/utils` barrel, and importing
10 * stores at module load would create a circular dependency (the stores
11 * themselves import from `$lib/utils`).
12 */
13export function getChatCommands(options: ChatCommandsOptions): ChatFormCommand[] {
14	return [
15		{
16			action: ChatFormCommandAction.PROMPT,
17			description: 'Insert an MCP prompt',
18			disabled: !options.hasPrompts(),
19			name: 'prompt'
20		},
21		{
22			action: ChatFormCommandAction.CWD,
23			description: SET_WORKING_DIRECTORY_LABEL,
24			disabled: !options.hasCwdTools(),
25			keywords: ['current working directory'],
26			name: 'cwd'
27		},
28		{
29			action: ChatFormCommandAction.MODEL,
30			description: 'Select model',
31			disabled: !options.showModelSelector,
32			name: 'model'
33		}
34	];
35}