char-fork/llama.cpp

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

Aleksander Grygierui: enforce alphabetical enum member ordering (#27272)01818e495

char/aliceai-t5-moe
1.6 KiB55 linesraw
1export enum ToolSource {
2	BROWSER = 'browser',
3	CUSTOM = 'custom',
4	MCP = 'mcp',
5	SERVER = 'server'
6}
7
8export enum ToolPermissionDecision {
9	ALWAYS = 'always',
10	ALWAYS_SERVER = 'always_server',
11	DENY = 'deny',
12	ONCE = 'once'
13}
14
15export enum ToolResponseField {
16	ERROR = 'error',
17	PLAIN_TEXT = 'plain_text_response'
18}
19
20/**
21 * Entry types accepted by the `file_glob_search` tool's `type` parameter.
22 * Mirrors the server-side validation in server-tools.cpp.
23 */
24export enum GlobSearchType {
25	ALL = 'all',
26	DIR = 'dir',
27	FILE = 'file'
28}
29
30/**
31 * Wire-format identifiers for server and browser tools. The string
32 * value matches what the model emits in tool call names, so comparing
33 * against `BuiltInTool.SERVER_READ_FILE` is equivalent to comparing
34 * against the raw `'read_file'` literal - the enum just keeps the two in
35 * lock-step and gives TypeScript a single source of truth for autocomplete
36 * / rename support.
37 *
38 * The `SERVER_` / `BROWSER_` prefixes mirror the tool's primary source
39 * (llama-server vs llama-ui). `get_info` is the exception: it is served by
40 * the server, but llama-ui falls back to a browser implementation when the
41 * server does not provide it, so it can surface under both categories in
42 * the UI while keeping a single wire name.
43 */
44export enum BuiltInTool {
45	BROWSER_GET_DATETIME = 'get_datetime',
46	BROWSER_READ_MEDIA = 'read_media',
47	BROWSER_RUN_JAVASCRIPT = 'run_javascript',
48	SERVER_EDIT_FILE = 'edit_file',
49	SERVER_EXEC_SHELL_COMMAND = 'exec_shell_command',
50	SERVER_FILE_GLOB_SEARCH = 'file_glob_search',
51	SERVER_GET_INFO = 'get_info',
52	SERVER_GREP_SEARCH = 'grep_search',
53	SERVER_READ_FILE = 'read_file',
54	SERVER_WRITE_FILE = 'write_file'
55}