Inital commit

This commit is contained in:
2026-07-29 01:00:10 -05:00
commit 23e8ea90e4
3301 changed files with 1376308 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
/**
* OpenAI-compatible tool call type.
*/
export enum ToolCallType {
FUNCTION = 'function'
}
/**
* Types of sections in agentic content display.
*/
export enum AgenticSectionType {
TEXT = 'text',
TOOL_CALL = 'tool_call',
TOOL_CALL_PENDING = 'tool_call_pending',
TOOL_CALL_STREAMING = 'tool_call_streaming',
REASONING = 'reasoning',
REASONING_PENDING = 'reasoning_pending'
}
/**
* How a Continue click on an assistant message resumes generation.
*/
export enum ContinueIntentKind {
APPEND_TEXT = 'append_text',
RERUN_TURN = 'rerun_turn',
NEXT_TURN = 'next_turn'
}
/**
* Renderer tier for a tool-result blob shown in the default tool-call block.
*/
export enum ToolResultKind {
JSON = 'json',
MARKDOWN = 'markdown',
TEXT = 'text'
}
/**
* Line classification for the unified-diff renderer of `edit_file` results.
*/
export enum DiffLineKind {
CONTEXT = 'context',
ADD = 'add',
REMOVE = 'remove'
}
@@ -0,0 +1,56 @@
/**
* Attachment type enum for database message extras
*/
export enum AttachmentType {
AUDIO = 'AUDIO',
IMAGE = 'IMAGE',
VIDEO = 'VIDEO',
MCP_PROMPT = 'MCP_PROMPT',
MCP_RESOURCE = 'MCP_RESOURCE',
PDF = 'PDF',
TEXT = 'TEXT',
LEGACY_CONTEXT = 'context' // Legacy attachment type for backward compatibility
}
/**
* Unique identifiers for attachment menu items in the chat form action dropdowns.
* Used to select which file upload or attachment action is triggered.
*/
export enum AttachmentMenuItemId {
IMAGES = 'images',
AUDIO = 'audio',
VIDEO = 'video',
TEXT = 'text',
PDF = 'pdf',
SYSTEM_MESSAGE = 'system-message',
MCP_PROMPT = 'mcp-prompt',
MCP_RESOURCES = 'mcp-resources'
}
/**
* Defines when an attachment menu item should be enabled.
*/
export enum AttachmentItemEnabledWhen {
ALWAYS = 'always',
HAS_VISION_MODALITY = 'hasVisionModality',
HAS_AUDIO_MODALITY = 'hasAudioModality',
HAS_VIDEO_MODALITY = 'hasVideoModality'
}
/**
* Defines the callback action triggered when an attachment menu item is clicked.
*/
export enum AttachmentAction {
FILE_UPLOAD = 'onFileUpload',
SYSTEM_PROMPT_CLICK = 'onSystemPromptClick',
MCP_PROMPT_CLICK = 'onMcpPromptClick',
MCP_RESOURCES_CLICK = 'onMcpResourcesClick'
}
/**
* Visibility conditions for attachment menu items.
*/
export enum AttachmentItemVisibleWhen {
HAS_MCP_PROMPTS_SUPPORT = 'hasMcpPromptsSupport',
HAS_MCP_RESOURCES_SUPPORT = 'hasMcpResourcesSupport'
}
+80
View File
@@ -0,0 +1,80 @@
export enum ChatMessageStatsView {
GENERATION = 'generation',
READING = 'reading',
TOOLS = 'tools',
SUMMARY = 'summary'
}
export enum ChatMessageStatisticsMode {
SWITCHABLE = 'switchable',
READING = 'reading',
GENERATION = 'generation'
}
/**
* Connection state of a streamed completion, drives the resume status indicator.
*/
export enum StreamConnectionState {
STREAMING = 'streaming',
RESUMING = 'resuming',
LOST = 'lost'
}
/**
* Reasoning format options for API requests.
*/
export enum ReasoningFormat {
NONE = 'none',
AUTO = 'auto'
}
/**
* Message roles for chat messages.
*/
export enum MessageRole {
USER = 'user',
ASSISTANT = 'assistant',
SYSTEM = 'system',
TOOL = 'tool'
}
/**
* Message types for different content kinds.
*/
export enum MessageType {
ROOT = 'root',
TEXT = 'text',
THINK = 'think',
SYSTEM = 'system'
}
/**
* Content part types for API chat message content.
*/
export enum ContentPartType {
TEXT = 'text',
IMAGE_URL = 'image_url',
INPUT_AUDIO = 'input_audio',
INPUT_VIDEO = 'input_video'
}
/**
* Error dialog types for displaying server/timeout errors.
*/
export enum ErrorDialogType {
TIMEOUT = 'timeout',
SERVER = 'server'
}
export enum ConversationSelectionMode {
EXPORT = 'export',
IMPORT = 'import'
}
/**
* PDF view mode options for previewing PDF attachments.
*/
export enum PdfViewMode {
TEXT = 'text',
PAGES = 'pages'
}
@@ -0,0 +1,9 @@
/**
* Discriminator of a record line in the JSONL conversation format. A session
* record opens a conversation and carries its properties; every following
* message record belongs to it.
*/
export enum SessionRecordType {
SESSION = 'session',
MESSAGE = 'message'
}
+267
View File
@@ -0,0 +1,267 @@
/**
* Comprehensive dictionary of all supported file types in llama-ui
* Organized by category with TypeScript enums for better type safety
*/
// File type category enum
export enum FileTypeCategory {
IMAGE = 'image',
AUDIO = 'audio',
VIDEO = 'video',
PDF = 'pdf',
TEXT = 'text'
}
/**
* Special file types for internal use (not MIME types)
*/
export enum SpecialFileType {
MCP_PROMPT = 'mcp-prompt'
}
// Specific file type enums for each category
export enum FileTypeImage {
JPEG = 'jpeg',
PNG = 'png',
GIF = 'gif',
WEBP = 'webp',
SVG = 'svg',
HEIC = 'heic',
HEIF = 'heif'
}
export enum FileTypeAudio {
MP3 = 'mp3',
WAV = 'wav',
WEBM = 'webm'
}
export enum FileTypeVideo {
MP4 = 'mp4',
OGG = 'ogg'
}
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',
HEIC = '.heic',
HEIF = '.heif'
}
export enum FileExtensionAudio {
MP3 = '.mp3',
WAV = '.wav'
}
export enum FileExtensionVideo {
MP4 = '.mp4',
OGG = '.ogg'
}
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',
JSONL = '.jsonl',
ZIP = '.zip',
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 prefixes and includes for content detection
export enum MimeTypePrefix {
IMAGE = 'image/',
TEXT = 'text'
}
export enum MimeTypeIncludes {
JSON = 'json',
JAVASCRIPT = 'javascript',
TYPESCRIPT = 'typescript'
}
// URI patterns for content detection
export enum UriPattern {
DATABASE_KEYWORD = 'database',
DATABASE_SCHEME = 'db://'
}
// MIME type enums
export enum MimeTypeApplication {
JSON = 'application/json',
PDF = 'application/pdf',
OCTET_STREAM = 'application/octet-stream',
ZIP = 'application/zip'
}
export enum MimeTypeAudio {
MP3_MPEG = 'audio/mpeg',
MP3 = 'audio/mp3',
MP4 = 'audio/mp4',
WAV = 'audio/wav',
WAVE = 'audio/wave',
X_WAV = 'audio/x-wav',
X_WAVE = 'audio/x-wave',
VND_WAVE = 'audio/vnd.wave',
X_PN_WAV = 'audio/x-pn-wav',
WEBM = 'audio/webm',
WEBM_OPUS = 'audio/webm;codecs=opus'
}
export enum MimeTypeVideo {
MP4 = 'video/mp4',
OGG = 'video/ogg'
}
export enum MimeTypeImage {
JPEG = 'image/jpeg',
JPG = 'image/jpg',
PNG = 'image/png',
GIF = 'image/gif',
WEBP = 'image/webp',
SVG = 'image/svg+xml',
ICO = 'image/x-icon',
ICO_MICROSOFT = 'image/vnd.microsoft.icon',
HEIC = 'image/heic',
HEIF = 'image/heif'
}
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',
JSONL = 'application/jsonl',
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'
}
+77
View File
@@ -0,0 +1,77 @@
export {
AttachmentType,
AttachmentMenuItemId,
AttachmentItemEnabledWhen,
AttachmentAction,
AttachmentItemVisibleWhen
} from './attachment.enums';
export {
AgenticSectionType,
ContinueIntentKind,
DiffLineKind,
ToolResultKind,
ToolCallType
} from './agentic.enums';
export {
ChatMessageStatsView,
ChatMessageStatisticsMode,
StreamConnectionState,
ContentPartType,
ConversationSelectionMode,
ErrorDialogType,
MessageRole,
MessageType,
PdfViewMode,
ReasoningFormat
} from './chat.enums';
export { SessionRecordType } from './conversation-import.enums';
export { ReasoningEffort } from './reasoning-effort.enums';
export {
FileTypeCategory,
FileTypeImage,
FileTypeAudio,
FileTypePdf,
FileTypeText,
FileExtensionImage,
FileExtensionAudio,
FileExtensionPdf,
FileExtensionText,
MimeTypePrefix,
MimeTypeIncludes,
UriPattern,
MimeTypeApplication,
MimeTypeAudio,
MimeTypeVideo,
MimeTypeImage,
MimeTypeText,
SpecialFileType
} from './files.enums';
export {
MCPConnectionPhase,
MCPLogLevel,
MCPTransportType,
HealthCheckStatus,
MCPContentType,
MCPRefType,
JsonSchemaType
} from './mcp.enums';
export { ModelModality } from './model.enums';
export { ServerRole, ServerModelStatus, ServerModelsSseEventType } from './server.enums';
export { ParameterSource, SyncableParameterType, SettingsFieldType } from './settings.enums';
export { ColorMode, HtmlInputType, McpPromptVariant, TooltipSide, UrlProtocol } from './ui.enums';
export { KeyboardKey } from './keyboard.enums';
export { BuiltInTool, ToolSource, ToolPermissionDecision, ToolResponseField } from './tools.enums';
export { SplashOrientation } from './splash.enums';
+20
View File
@@ -0,0 +1,20 @@
/**
* Keyboard key names for event handling
*/
export enum KeyboardKey {
ENTER = 'Enter',
ESCAPE = 'Escape',
ARROW_UP = 'ArrowUp',
ARROW_DOWN = 'ArrowDown',
ARROW_LEFT = 'ArrowLeft',
ARROW_RIGHT = 'ArrowRight',
TAB = 'Tab',
B_LOWER = 'b',
D_LOWER = 'd',
D_UPPER = 'D',
E_UPPER = 'E',
K_LOWER = 'k',
O_LOWER = 'o',
O_UPPER = 'O',
SPACE = ' '
}
+68
View File
@@ -0,0 +1,68 @@
/**
* Connection lifecycle phases for MCP protocol
*/
export enum MCPConnectionPhase {
IDLE = 'idle',
TRANSPORT_CREATING = 'transport_creating',
TRANSPORT_READY = 'transport_ready',
INITIALIZING = 'initializing',
CAPABILITIES_EXCHANGED = 'capabilities_exchanged',
LISTING_TOOLS = 'listing_tools',
CONNECTED = 'connected',
ERROR = 'error',
DISCONNECTED = 'disconnected'
}
/**
* Log level for connection events
*/
export enum MCPLogLevel {
INFO = 'info',
WARN = 'warn',
ERROR = 'error'
}
/**
* Transport types for MCP connections
*/
export enum MCPTransportType {
WEBSOCKET = 'websocket',
STREAMABLE_HTTP = 'streamable_http',
SSE = 'sse'
}
/**
* Health check status for MCP servers
*/
export enum HealthCheckStatus {
IDLE = 'idle',
CONNECTING = 'connecting',
SUCCESS = 'success',
ERROR = 'error'
}
/**
* Content types for MCP tool results
*/
export enum MCPContentType {
TEXT = 'text',
IMAGE = 'image',
RESOURCE = 'resource'
}
/**
* JSON Schema types used in MCP tool definitions
*/
export enum JsonSchemaType {
OBJECT = 'object',
STRING = 'string',
NUMBER = 'number'
}
/**
* Reference types for MCP completions
*/
export enum MCPRefType {
PROMPT = 'ref/prompt',
RESOURCE = 'ref/resource'
}
+6
View File
@@ -0,0 +1,6 @@
export enum ModelModality {
TEXT = 'TEXT',
AUDIO = 'AUDIO',
VISION = 'VISION',
VIDEO = 'VIDEO'
}
@@ -0,0 +1,12 @@
/**
* Reasoning effort levels for thinking models.
* These values are sent to the server and mapped to token budgets.
*/
export enum ReasoningEffort {
DEFAULT = 'default',
OFF = 'off',
LOW = 'low',
MEDIUM = 'medium',
HIGH = 'high',
MAX = 'max'
}
+35
View File
@@ -0,0 +1,35 @@
/**
* 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',
SLEEPING = 'sleeping',
FAILED = 'failed'
}
/**
* /models/sse event type enum - discriminates the records broadcast on the
* model status feed in ROUTER mode. Matches the event names emitted by
* tools/server/server-models.cpp from the C++ server.
*/
export enum ServerModelsSseEventType {
STATUS_CHANGE = 'status_change',
MODEL_STATUS = 'model_status',
STATUS_UPDATE = 'status_update',
MODELS_RELOAD = 'models_reload',
MODEL_REMOVE = 'model_remove',
DOWNLOAD_PROGRESS = 'download_progress'
}
+27
View File
@@ -0,0 +1,27 @@
/**
* Parameter source - indicates whether a parameter uses default or custom value
*/
export enum ParameterSource {
DEFAULT = 'default',
CUSTOM = 'custom'
}
/**
* Syncable parameter type - data types for parameters that can be synced with server
*/
export enum SyncableParameterType {
NUMBER = 'number',
STRING = 'string',
BOOLEAN = 'boolean'
}
/**
* Settings field type - defines the input type for settings fields
*/
export enum SettingsFieldType {
INPUT = 'input',
TEXTAREA = 'textarea',
CHECKBOX = 'checkbox',
SELECT = 'select',
RADIO = 'radio'
}
+7
View File
@@ -0,0 +1,7 @@
/**
* Splash screen orientation for iOS apple-touch-startup-image
*/
export enum SplashOrientation {
PORTRAIT = 'portrait',
LANDSCAPE = 'landscape'
}
+37
View File
@@ -0,0 +1,37 @@
export enum ToolSource {
BUILTIN = 'builtin',
MCP = 'mcp',
CUSTOM = 'custom',
FRONTEND = 'frontend'
}
export enum ToolPermissionDecision {
ALWAYS = 'always',
ALWAYS_SERVER = 'always_server',
ONCE = 'once',
DENY = 'deny'
}
export enum ToolResponseField {
PLAIN_TEXT = 'plain_text_response',
ERROR = 'error'
}
/**
* Wire-format identifiers for built-in and frontend tools. The string
* value matches what the model emits in tool call names, so comparing
* against `BuiltInTool.READ_FILE` is equivalent to comparing against the
* raw `'read_file'` literal - the enum just keeps the two in lock-step
* and gives TypeScript a single source of truth for autocomplete / rename
* support.
*/
export enum BuiltInTool {
READ_FILE = 'read_file',
EDIT_FILE = 'edit_file',
WRITE_FILE = 'write_file',
GET_DATETIME = 'get_datetime',
FILE_GLOB_SEARCH = 'file_glob_search',
GREP_SEARCH = 'grep_search',
EXEC_SHELL_COMMAND = 'exec_shell_command',
RUN_JAVASCRIPT = 'run_javascript'
}
+35
View File
@@ -0,0 +1,35 @@
export enum ColorMode {
LIGHT = 'light',
DARK = 'dark',
SYSTEM = 'system'
}
export enum TooltipSide {
TOP = 'top',
RIGHT = 'right',
BOTTOM = 'bottom',
LEFT = 'left'
}
/**
* MCP prompt display variant
*/
export enum McpPromptVariant {
MESSAGE = 'message',
ATTACHMENT = 'attachment'
}
/**
* URL prefixes for protocol detection
*/
export enum UrlProtocol {
DATA = 'data:',
HTTP = 'http:',
HTTPS = 'https:',
WEBSOCKET = 'ws:',
WEBSOCKET_SECURE = 'wss:'
}
export enum HtmlInputType {
FILE = 'file'
}