summaryrefslogtreecommitdiff
path: root/llama.cpp/tools/server/webui/src/lib/enums
diff options
context:
space:
mode:
Diffstat (limited to 'llama.cpp/tools/server/webui/src/lib/enums')
-rw-r--r--llama.cpp/tools/server/webui/src/lib/enums/attachment.ts10
-rw-r--r--llama.cpp/tools/server/webui/src/lib/enums/chat.ts4
-rw-r--r--llama.cpp/tools/server/webui/src/lib/enums/files.ts206
-rw-r--r--llama.cpp/tools/server/webui/src/lib/enums/index.ts23
-rw-r--r--llama.cpp/tools/server/webui/src/lib/enums/model.ts5
-rw-r--r--llama.cpp/tools/server/webui/src/lib/enums/server.ts20
6 files changed, 268 insertions, 0 deletions
diff --git a/llama.cpp/tools/server/webui/src/lib/enums/attachment.ts b/llama.cpp/tools/server/webui/src/lib/enums/attachment.ts
new file mode 100644
index 0000000..7c7d0da
--- /dev/null
+++ b/llama.cpp/tools/server/webui/src/lib/enums/attachment.ts
@@ -0,0 +1,10 @@
+/**
+ * Attachment type enum for database message extras
+ */
+export enum AttachmentType {
+ AUDIO = 'AUDIO',
+ IMAGE = 'IMAGE',
+ PDF = 'PDF',
+ TEXT = 'TEXT',
+ LEGACY_CONTEXT = 'context' // Legacy attachment type for backward compatibility
+}
diff --git a/llama.cpp/tools/server/webui/src/lib/enums/chat.ts b/llama.cpp/tools/server/webui/src/lib/enums/chat.ts
new file mode 100644
index 0000000..2b9eb7b
--- /dev/null
+++ b/llama.cpp/tools/server/webui/src/lib/enums/chat.ts
@@ -0,0 +1,4 @@
+export enum ChatMessageStatsView {
+ GENERATION = 'generation',
+ READING = 'reading'
+}
diff --git a/llama.cpp/tools/server/webui/src/lib/enums/files.ts b/llama.cpp/tools/server/webui/src/lib/enums/files.ts
new file mode 100644
index 0000000..a4f079d
--- /dev/null
+++ b/llama.cpp/tools/server/webui/src/lib/enums/files.ts
@@ -0,0 +1,206 @@
+/**
+ * Comprehensive dictionary of all supported file types in webui
+ * Organized by category with TypeScript enums for better type safety
+ */
+
+// File type category enum
+export enum FileTypeCategory {
+ IMAGE = 'image',
+ AUDIO = 'audio',
+ PDF = 'pdf',
+ TEXT = 'text'
+}
+
+// Specific file type enums for each category
+export enum FileTypeImage {
+ JPEG = 'jpeg',
+ PNG = 'png',
+ GIF = 'gif',
+ WEBP = 'webp',
+ SVG = 'svg'
+}
+
+export enum FileTypeAudio {
+ MP3 = 'mp3',
+ WAV = 'wav',
+ WEBM = 'webm'
+}
+
+export enum FileTypePdf {
+ PDF = 'pdf'
+}
+
+export enum FileTypeText {
+ PLAIN_TEXT = 'plainText',
+ MARKDOWN = 'md',
+ ASCIIDOC = 'asciidoc',
+ JAVASCRIPT = 'js',
+ TYPESCRIPT = 'ts',
+ JSX = 'jsx',
+ TSX = 'tsx',
+ CSS = 'css',
+ HTML = 'html',
+ JSON = 'json',
+ XML = 'xml',
+ YAML = 'yaml',
+ CSV = 'csv',
+ LOG = 'log',
+ PYTHON = 'python',
+ JAVA = 'java',
+ CPP = 'cpp',
+ PHP = 'php',
+ RUBY = 'ruby',
+ GO = 'go',
+ RUST = 'rust',
+ SHELL = 'shell',
+ SQL = 'sql',
+ R = 'r',
+ SCALA = 'scala',
+ KOTLIN = 'kotlin',
+ SWIFT = 'swift',
+ DART = 'dart',
+ VUE = 'vue',
+ SVELTE = 'svelte',
+ LATEX = 'latex',
+ BIBTEX = 'bibtex',
+ CUDA = 'cuda',
+ VULKAN = 'vulkan',
+ HASKELL = 'haskell',
+ CSHARP = 'csharp',
+ PROPERTIES = 'properties'
+}
+
+// File extension enums
+export enum FileExtensionImage {
+ JPG = '.jpg',
+ JPEG = '.jpeg',
+ PNG = '.png',
+ GIF = '.gif',
+ WEBP = '.webp',
+ SVG = '.svg'
+}
+
+export enum FileExtensionAudio {
+ MP3 = '.mp3',
+ WAV = '.wav'
+}
+
+export enum FileExtensionPdf {
+ PDF = '.pdf'
+}
+
+export enum FileExtensionText {
+ TXT = '.txt',
+ MD = '.md',
+ ADOC = '.adoc',
+ JS = '.js',
+ TS = '.ts',
+ JSX = '.jsx',
+ TSX = '.tsx',
+ CSS = '.css',
+ HTML = '.html',
+ HTM = '.htm',
+ JSON = '.json',
+ XML = '.xml',
+ YAML = '.yaml',
+ YML = '.yml',
+ CSV = '.csv',
+ LOG = '.log',
+ PY = '.py',
+ JAVA = '.java',
+ CPP = '.cpp',
+ C = '.c',
+ H = '.h',
+ PHP = '.php',
+ RB = '.rb',
+ GO = '.go',
+ RS = '.rs',
+ SH = '.sh',
+ BAT = '.bat',
+ SQL = '.sql',
+ R = '.r',
+ SCALA = '.scala',
+ KT = '.kt',
+ SWIFT = '.swift',
+ DART = '.dart',
+ VUE = '.vue',
+ SVELTE = '.svelte',
+ TEX = '.tex',
+ BIB = '.bib',
+ CU = '.cu',
+ CUH = '.cuh',
+ COMP = '.comp',
+ HPP = '.hpp',
+ HS = '.hs',
+ PROPERTIES = '.properties',
+ CS = '.cs'
+}
+
+// MIME type enums
+export enum MimeTypeApplication {
+ PDF = 'application/pdf'
+}
+
+export enum MimeTypeAudio {
+ MP3_MPEG = 'audio/mpeg',
+ MP3 = 'audio/mp3',
+ MP4 = 'audio/mp4',
+ WAV = 'audio/wav',
+ WEBM = 'audio/webm',
+ WEBM_OPUS = 'audio/webm;codecs=opus'
+}
+
+export enum MimeTypeImage {
+ JPEG = 'image/jpeg',
+ PNG = 'image/png',
+ GIF = 'image/gif',
+ WEBP = 'image/webp',
+ SVG = 'image/svg+xml'
+}
+
+export enum MimeTypeText {
+ PLAIN = 'text/plain',
+ MARKDOWN = 'text/markdown',
+ ASCIIDOC = 'text/asciidoc',
+ JAVASCRIPT = 'text/javascript',
+ JAVASCRIPT_APP = 'application/javascript',
+ TYPESCRIPT = 'text/typescript',
+ JSX = 'text/jsx',
+ TSX = 'text/tsx',
+ CSS = 'text/css',
+ HTML = 'text/html',
+ JSON = 'application/json',
+ XML_TEXT = 'text/xml',
+ XML_APP = 'application/xml',
+ YAML_TEXT = 'text/yaml',
+ YAML_APP = 'application/yaml',
+ CSV = 'text/csv',
+ PYTHON = 'text/x-python',
+ JAVA = 'text/x-java-source',
+ CPP_HDR = 'text/x-c++hdr',
+ CPP_SRC = 'text/x-c++src',
+ CSHARP = 'text/x-csharp',
+ HASKELL = 'text/x-haskell',
+ C_SRC = 'text/x-csrc',
+ C_HDR = 'text/x-chdr',
+ PHP = 'text/x-php',
+ RUBY = 'text/x-ruby',
+ GO = 'text/x-go',
+ RUST = 'text/x-rust',
+ SHELL = 'text/x-shellscript',
+ BAT = 'application/x-bat',
+ SQL = 'text/x-sql',
+ R = 'text/x-r',
+ SCALA = 'text/x-scala',
+ KOTLIN = 'text/x-kotlin',
+ SWIFT = 'text/x-swift',
+ DART = 'text/x-dart',
+ VUE = 'text/x-vue',
+ SVELTE = 'text/x-svelte',
+ TEX = 'text/x-tex',
+ TEX_APP = 'application/x-tex',
+ LATEX = 'application/x-latex',
+ BIBTEX = 'text/x-bibtex',
+ CUDA = 'text/x-cuda',
+ PROPERTIES = 'text/properties'
+}
diff --git a/llama.cpp/tools/server/webui/src/lib/enums/index.ts b/llama.cpp/tools/server/webui/src/lib/enums/index.ts
new file mode 100644
index 0000000..83c86ca
--- /dev/null
+++ b/llama.cpp/tools/server/webui/src/lib/enums/index.ts
@@ -0,0 +1,23 @@
+export { AttachmentType } from './attachment';
+
+export { ChatMessageStatsView } from './chat';
+
+export {
+ FileTypeCategory,
+ FileTypeImage,
+ FileTypeAudio,
+ FileTypePdf,
+ FileTypeText,
+ FileExtensionImage,
+ FileExtensionAudio,
+ FileExtensionPdf,
+ FileExtensionText,
+ MimeTypeApplication,
+ MimeTypeAudio,
+ MimeTypeImage,
+ MimeTypeText
+} from './files';
+
+export { ModelModality } from './model';
+
+export { ServerRole, ServerModelStatus } from './server';
diff --git a/llama.cpp/tools/server/webui/src/lib/enums/model.ts b/llama.cpp/tools/server/webui/src/lib/enums/model.ts
new file mode 100644
index 0000000..7729ecf
--- /dev/null
+++ b/llama.cpp/tools/server/webui/src/lib/enums/model.ts
@@ -0,0 +1,5 @@
+export enum ModelModality {
+ TEXT = 'TEXT',
+ AUDIO = 'AUDIO',
+ VISION = 'VISION'
+}
diff --git a/llama.cpp/tools/server/webui/src/lib/enums/server.ts b/llama.cpp/tools/server/webui/src/lib/enums/server.ts
new file mode 100644
index 0000000..7f30eab
--- /dev/null
+++ b/llama.cpp/tools/server/webui/src/lib/enums/server.ts
@@ -0,0 +1,20 @@
+/**
+ * Server role enum - used for single/multi-model mode
+ */
+export enum ServerRole {
+ /** Single model mode - server running with a specific model loaded */
+ MODEL = 'model',
+ /** Router mode - server managing multiple model instances */
+ ROUTER = 'router'
+}
+
+/**
+ * Model status enum - matches tools/server/server-models.h from C++ server
+ * Used as the `value` field in the status object from /models endpoint
+ */
+export enum ServerModelStatus {
+ UNLOADED = 'unloaded',
+ LOADING = 'loading',
+ LOADED = 'loaded',
+ FAILED = 'failed'
+}