ui: enforce alphabetical enum member ordering (#27272)

This commit is contained in:
Aleksander Grygier
2026-08-17 23:52:00 +02:00
committed by GitHub
parent 0021a77de0
commit 01818e4956
17 changed files with 246 additions and 243 deletions
+3
View File
@@ -61,6 +61,9 @@ export default ts.config(
{ blankLine: 'always', next: ['return', 'throw', 'break', 'continue'], prev: '*' } { blankLine: 'always', next: ['return', 'throw', 'break', 'continue'], prev: '*' }
], ],
// Alphabetical order for enum members
'perfectionist/sort-enums': ['error', { type: 'natural' }],
'perfectionist/sort-objects': ['error', { type: 'natural' }], 'perfectionist/sort-objects': ['error', { type: 'natural' }],
// Alphabetical order for variable declarations and object keys // Alphabetical order for variable declarations and object keys
+6 -6
View File
@@ -9,12 +9,12 @@ export enum ToolCallType {
* Types of sections in agentic content display. * Types of sections in agentic content display.
*/ */
export enum AgenticSectionType { export enum AgenticSectionType {
REASONING = 'reasoning',
REASONING_PENDING = 'reasoning_pending',
TEXT = 'text', TEXT = 'text',
TOOL_CALL = 'tool_call', TOOL_CALL = 'tool_call',
TOOL_CALL_PENDING = 'tool_call_pending', TOOL_CALL_PENDING = 'tool_call_pending',
TOOL_CALL_STREAMING = 'tool_call_streaming', TOOL_CALL_STREAMING = 'tool_call_streaming'
REASONING = 'reasoning',
REASONING_PENDING = 'reasoning_pending'
} }
/** /**
@@ -22,8 +22,8 @@ export enum AgenticSectionType {
*/ */
export enum ContinueIntentKind { export enum ContinueIntentKind {
APPEND_TEXT = 'append_text', APPEND_TEXT = 'append_text',
RERUN_TURN = 'rerun_turn', NEXT_TURN = 'next_turn',
NEXT_TURN = 'next_turn' RERUN_TURN = 'rerun_turn'
} }
/** /**
@@ -39,7 +39,7 @@ export enum ToolResultKind {
* Line classification for the unified-diff renderer of `edit_file` results. * Line classification for the unified-diff renderer of `edit_file` results.
*/ */
export enum DiffLineKind { export enum DiffLineKind {
CONTEXT = 'context',
ADD = 'add', ADD = 'add',
CONTEXT = 'context',
REMOVE = 'remove' REMOVE = 'remove'
} }
+13 -13
View File
@@ -4,12 +4,12 @@
export enum AttachmentType { export enum AttachmentType {
AUDIO = 'AUDIO', AUDIO = 'AUDIO',
IMAGE = 'IMAGE', IMAGE = 'IMAGE',
VIDEO = 'VIDEO', LEGACY_CONTEXT = 'context', // Legacy attachment type for backward compatibility
MCP_PROMPT = 'MCP_PROMPT', MCP_PROMPT = 'MCP_PROMPT',
MCP_RESOURCE = 'MCP_RESOURCE', MCP_RESOURCE = 'MCP_RESOURCE',
PDF = 'PDF', PDF = 'PDF',
TEXT = 'TEXT', TEXT = 'TEXT',
LEGACY_CONTEXT = 'context' // Legacy attachment type for backward compatibility VIDEO = 'VIDEO'
} }
/** /**
@@ -17,14 +17,14 @@ export enum AttachmentType {
* Used to select which file upload or attachment action is triggered. * Used to select which file upload or attachment action is triggered.
*/ */
export enum AttachmentMenuItemId { export enum AttachmentMenuItemId {
IMAGES = 'images',
AUDIO = 'audio', AUDIO = 'audio',
VIDEO = 'video', IMAGES = 'images',
TEXT = 'text', MCP_PROMPT = 'mcp-prompt',
MCP_RESOURCES = 'mcp-resources',
PDF = 'pdf', PDF = 'pdf',
SYSTEM_MESSAGE = 'system-message', SYSTEM_MESSAGE = 'system-message',
MCP_PROMPT = 'mcp-prompt', TEXT = 'text',
MCP_RESOURCES = 'mcp-resources' VIDEO = 'video'
} }
/** /**
@@ -32,9 +32,9 @@ export enum AttachmentMenuItemId {
*/ */
export enum AttachmentItemEnabledWhen { export enum AttachmentItemEnabledWhen {
ALWAYS = 'always', ALWAYS = 'always',
HAS_VISION_MODALITY = 'hasVisionModality',
HAS_AUDIO_MODALITY = 'hasAudioModality', HAS_AUDIO_MODALITY = 'hasAudioModality',
HAS_VIDEO_MODALITY = 'hasVideoModality' HAS_VIDEO_MODALITY = 'hasVideoModality',
HAS_VISION_MODALITY = 'hasVisionModality'
} }
/** /**
@@ -42,9 +42,9 @@ export enum AttachmentItemEnabledWhen {
*/ */
export enum AttachmentAction { export enum AttachmentAction {
FILE_UPLOAD = 'onFileUpload', FILE_UPLOAD = 'onFileUpload',
SYSTEM_PROMPT_CLICK = 'onSystemPromptClick',
MCP_PROMPT_CLICK = 'onMcpPromptClick', MCP_PROMPT_CLICK = 'onMcpPromptClick',
MCP_RESOURCES_CLICK = 'onMcpResourcesClick' MCP_RESOURCES_CLICK = 'onMcpResourcesClick',
SYSTEM_PROMPT_CLICK = 'onSystemPromptClick'
} }
/** /**
@@ -52,9 +52,9 @@ export enum AttachmentAction {
*/ */
export enum AttachmentLabel { export enum AttachmentLabel {
FILE = 'File', FILE = 'File',
PDF_FILE = 'PDF File',
MCP_PROMPT = 'MCP Prompt', MCP_PROMPT = 'MCP Prompt',
MCP_RESOURCE = 'MCP Resource' MCP_RESOURCE = 'MCP Resource',
PDF_FILE = 'PDF File'
} }
/** /**
@@ -1,5 +1,5 @@
/** String representation of a boolean used in data attributes and persisted values. */ /** String representation of a boolean used in data attributes and persisted values. */
export enum BooleanString { export enum BooleanString {
TRUE = 'true', FALSE = 'false',
FALSE = 'false' TRUE = 'true'
} }
+24 -24
View File
@@ -1,41 +1,41 @@
export enum ChatMessageStatsView { export enum ChatMessageStatsView {
GENERATION = 'generation', GENERATION = 'generation',
READING = 'reading', READING = 'reading',
TOOLS = 'tools', SUMMARY = 'summary',
SUMMARY = 'summary' TOOLS = 'tools'
} }
export enum ChatMessageStatisticsMode { export enum ChatMessageStatisticsMode {
SWITCHABLE = 'switchable', GENERATION = 'generation',
READING = 'reading', READING = 'reading',
GENERATION = 'generation' SWITCHABLE = 'switchable'
} }
/** /**
* Connection state of a streamed completion, drives the resume status indicator. * Connection state of a streamed completion, drives the resume status indicator.
*/ */
export enum StreamConnectionState { export enum StreamConnectionState {
STREAMING = 'streaming', LOST = 'lost',
RESUMING = 'resuming', RESUMING = 'resuming',
LOST = 'lost' STREAMING = 'streaming'
} }
/** /**
* Reasoning format options for API requests. * Reasoning format options for API requests.
*/ */
export enum ReasoningFormat { export enum ReasoningFormat {
NONE = 'none', AUTO = 'auto',
AUTO = 'auto' NONE = 'none'
} }
/** /**
* Message roles for chat messages. * Message roles for chat messages.
*/ */
export enum MessageRole { export enum MessageRole {
USER = 'user',
ASSISTANT = 'assistant', ASSISTANT = 'assistant',
SYSTEM = 'system', SYSTEM = 'system',
TOOL = 'tool' TOOL = 'tool',
USER = 'user'
} }
/** /**
@@ -43,27 +43,27 @@ export enum MessageRole {
*/ */
export enum MessageType { export enum MessageType {
ROOT = 'root', ROOT = 'root',
SYSTEM = 'system',
TEXT = 'text', TEXT = 'text',
THINK = 'think', THINK = 'think'
SYSTEM = 'system'
} }
/** /**
* Content part types for API chat message content. * Content part types for API chat message content.
*/ */
export enum ContentPartType { export enum ContentPartType {
TEXT = 'text',
IMAGE_URL = 'image_url', IMAGE_URL = 'image_url',
INPUT_AUDIO = 'input_audio', INPUT_AUDIO = 'input_audio',
INPUT_VIDEO = 'input_video' INPUT_VIDEO = 'input_video',
TEXT = 'text'
} }
/** /**
* Error dialog types for displaying server/timeout errors. * Error dialog types for displaying server/timeout errors.
*/ */
export enum ErrorDialogType { export enum ErrorDialogType {
TIMEOUT = 'timeout', SERVER = 'server',
SERVER = 'server' TIMEOUT = 'timeout'
} }
export enum ConversationSelectionMode { export enum ConversationSelectionMode {
@@ -75,27 +75,27 @@ export enum ConversationSelectionMode {
* PDF view mode options for previewing PDF attachments. * PDF view mode options for previewing PDF attachments.
*/ */
export enum PdfViewMode { export enum PdfViewMode {
TEXT = 'text', PAGES = 'pages',
PAGES = 'pages' TEXT = 'text'
} }
export enum ChatFormCommandAction { export enum ChatFormCommandAction {
PROMPT = 'prompt',
CWD = 'cwd', CWD = 'cwd',
MODEL = 'model' MODEL = 'model',
PROMPT = 'prompt'
} }
export enum FileMentionEntryType { export enum FileMentionEntryType {
FILE = 'file', DIRECTORY = 'directory',
DIRECTORY = 'directory' FILE = 'file'
} }
/** /**
* Kinds of tokens the chat-form-input-rich produces. * Kinds of tokens the chat-form-input-rich produces.
*/ */
export enum ChatFormInputRichTokenKind { export enum ChatFormInputRichTokenKind {
TEXT = 'text',
BADGE = 'badge', BADGE = 'badge',
CODE_BLOCK = 'code_block',
CODE_INLINE = 'code_inline', CODE_INLINE = 'code_inline',
CODE_BLOCK = 'code_block' TEXT = 'text'
} }
@@ -4,6 +4,6 @@
* message record belongs to it. * message record belongs to it.
*/ */
export enum SessionRecordType { export enum SessionRecordType {
SESSION = 'session', MESSAGE = 'message',
MESSAGE = 'message' SESSION = 'session'
} }
+132 -132
View File
@@ -5,11 +5,11 @@
// File type category enum // File type category enum
export enum FileTypeCategory { export enum FileTypeCategory {
IMAGE = 'image',
AUDIO = 'audio', AUDIO = 'audio',
VIDEO = 'video', IMAGE = 'image',
PDF = 'pdf', PDF = 'pdf',
TEXT = 'text' TEXT = 'text',
VIDEO = 'video'
} }
/** /**
@@ -21,13 +21,13 @@ export enum SpecialFileType {
// Specific file type enums for each category // Specific file type enums for each category
export enum FileTypeImage { export enum FileTypeImage {
GIF = 'gif',
HEIC = 'heic',
HEIF = 'heif',
JPEG = 'jpeg', JPEG = 'jpeg',
PNG = 'png', PNG = 'png',
GIF = 'gif',
WEBP = 'webp',
SVG = 'svg', SVG = 'svg',
HEIC = 'heic', WEBP = 'webp'
HEIF = 'heif'
} }
export enum FileTypeAudio { export enum FileTypeAudio {
@@ -46,55 +46,55 @@ export enum FileTypePdf {
} }
export enum FileTypeText { export enum FileTypeText {
PLAIN_TEXT = 'plainText',
MARKDOWN = 'md',
ASCIIDOC = 'asciidoc', ASCIIDOC = 'asciidoc',
JAVASCRIPT = 'js', BIBTEX = 'bibtex',
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', CPP = 'cpp',
PHP = 'php', CSHARP = 'csharp',
RUBY = 'ruby', CSS = 'css',
CSV = 'csv',
CUDA = 'cuda',
DART = 'dart',
GO = 'go', GO = 'go',
HASKELL = 'haskell',
HTML = 'html',
JAVA = 'java',
JAVASCRIPT = 'js',
JSON = 'json',
JSX = 'jsx',
KOTLIN = 'kotlin',
LATEX = 'latex',
LOG = 'log',
MARKDOWN = 'md',
PHP = 'php',
PLAIN_TEXT = 'plainText',
PROPERTIES = 'properties',
PYTHON = 'python',
R = 'r',
RUBY = 'ruby',
RUST = 'rust', RUST = 'rust',
SCALA = 'scala',
SHELL = 'shell', SHELL = 'shell',
SQL = 'sql', SQL = 'sql',
R = 'r',
SCALA = 'scala',
KOTLIN = 'kotlin',
SWIFT = 'swift',
DART = 'dart',
VUE = 'vue',
SVELTE = 'svelte', SVELTE = 'svelte',
LATEX = 'latex', SWIFT = 'swift',
BIBTEX = 'bibtex', TSX = 'tsx',
CUDA = 'cuda', TYPESCRIPT = 'ts',
VUE = 'vue',
VULKAN = 'vulkan', VULKAN = 'vulkan',
HASKELL = 'haskell', XML = 'xml',
CSHARP = 'csharp', YAML = 'yaml'
PROPERTIES = 'properties'
} }
// File extension enums // File extension enums
export enum FileExtensionImage { export enum FileExtensionImage {
JPG = '.jpg',
JPEG = '.jpeg',
PNG = '.png',
GIF = '.gif', GIF = '.gif',
WEBP = '.webp',
SVG = '.svg',
HEIC = '.heic', HEIC = '.heic',
HEIF = '.heif' HEIF = '.heif',
JPEG = '.jpeg',
JPG = '.jpg',
PNG = '.png',
SVG = '.svg',
WEBP = '.webp'
} }
export enum FileExtensionAudio { export enum FileExtensionAudio {
@@ -112,64 +112,64 @@ export enum FileExtensionPdf {
} }
export enum FileExtensionText { export enum FileExtensionText {
TXT = '.txt',
MD = '.md',
ADOC = '.adoc', ADOC = '.adoc',
JS = '.js', BAT = '.bat',
TS = '.ts', BIB = '.bib',
JSX = '.jsx', C = '.c',
TSX = '.tsx', COMP = '.comp',
CPP = '.cpp',
CS = '.cs',
CSS = '.css', CSS = '.css',
HTML = '.html', CSV = '.csv',
CU = '.cu',
CUH = '.cuh',
DART = '.dart',
GO = '.go',
H = '.h',
HPP = '.hpp',
HS = '.hs',
HTM = '.htm', HTM = '.htm',
HTML = '.html',
JAVA = '.java',
JS = '.js',
JSON = '.json', JSON = '.json',
JSONL = '.jsonl', JSONL = '.jsonl',
ZIP = '.zip', JSX = '.jsx',
KT = '.kt',
LOG = '.log',
MD = '.md',
PHP = '.php',
PROPERTIES = '.properties',
PY = '.py',
R = '.r',
RB = '.rb',
RS = '.rs',
SCALA = '.scala',
SH = '.sh',
SQL = '.sql',
SVELTE = '.svelte',
SWIFT = '.swift',
TEX = '.tex',
TS = '.ts',
TSX = '.tsx',
TXT = '.txt',
VUE = '.vue',
XML = '.xml', XML = '.xml',
YAML = '.yaml', YAML = '.yaml',
YML = '.yml', YML = '.yml',
CSV = '.csv', ZIP = '.zip'
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 // MIME type prefixes and includes for content detection
export enum MimeTypePrefix { export enum MimeTypePrefix {
IMAGE = 'image/',
AUDIO = 'audio/', AUDIO = 'audio/',
IMAGE = 'image/',
TEXT = 'text' TEXT = 'text'
} }
export enum MimeTypeIncludes { export enum MimeTypeIncludes {
JSON = 'json',
JAVASCRIPT = 'javascript', JAVASCRIPT = 'javascript',
JSON = 'json',
TYPESCRIPT = 'typescript' TYPESCRIPT = 'typescript'
} }
@@ -182,23 +182,23 @@ export enum UriPattern {
// MIME type enums // MIME type enums
export enum MimeTypeApplication { export enum MimeTypeApplication {
JSON = 'application/json', JSON = 'application/json',
PDF = 'application/pdf',
OCTET_STREAM = 'application/octet-stream', OCTET_STREAM = 'application/octet-stream',
PDF = 'application/pdf',
ZIP = 'application/zip' ZIP = 'application/zip'
} }
export enum MimeTypeAudio { export enum MimeTypeAudio {
MP3_MPEG = 'audio/mpeg',
MP3 = 'audio/mp3', MP3 = 'audio/mp3',
MP3_MPEG = 'audio/mpeg',
MP4 = 'audio/mp4', MP4 = 'audio/mp4',
VND_WAVE = 'audio/vnd.wave',
WAV = 'audio/wav', WAV = 'audio/wav',
WAVE = 'audio/wave', 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 = 'audio/webm',
WEBM_OPUS = 'audio/webm;codecs=opus' WEBM_OPUS = 'audio/webm;codecs=opus',
X_PN_WAV = 'audio/x-pn-wav',
X_WAV = 'audio/x-wav',
X_WAVE = 'audio/x-wave'
} }
export enum MimeTypeVideo { export enum MimeTypeVideo {
@@ -207,62 +207,62 @@ export enum MimeTypeVideo {
} }
export enum MimeTypeImage { export enum MimeTypeImage {
GIF = 'image/gif',
HEIC = 'image/heic',
HEIF = 'image/heif',
ICO = 'image/x-icon',
ICO_MICROSOFT = 'image/vnd.microsoft.icon',
JPEG = 'image/jpeg', JPEG = 'image/jpeg',
JPG = 'image/jpg', JPG = 'image/jpg',
PNG = 'image/png', PNG = 'image/png',
GIF = 'image/gif',
WEBP = 'image/webp',
SVG = 'image/svg+xml', SVG = 'image/svg+xml',
ICO = 'image/x-icon', WEBP = 'image/webp'
ICO_MICROSOFT = 'image/vnd.microsoft.icon',
HEIC = 'image/heic',
HEIF = 'image/heif'
} }
export enum MimeTypeText { export enum MimeTypeText {
PLAIN = 'text/plain',
MARKDOWN = 'text/markdown',
ASCIIDOC = 'text/asciidoc', ASCIIDOC = 'text/asciidoc',
JAVASCRIPT = 'text/javascript', BAT = 'application/x-bat',
JAVASCRIPT_APP = 'application/javascript', BIBTEX = 'text/x-bibtex',
TYPESCRIPT = 'text/typescript', C_HDR = 'text/x-chdr',
JSX = 'text/jsx', C_SRC = 'text/x-csrc',
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_HDR = 'text/x-c++hdr',
CPP_SRC = 'text/x-c++src', CPP_SRC = 'text/x-c++src',
CSHARP = 'text/x-csharp', CSHARP = 'text/x-csharp',
HASKELL = 'text/x-haskell', CSS = 'text/css',
C_SRC = 'text/x-csrc', CSV = 'text/csv',
C_HDR = 'text/x-chdr', CUDA = 'text/x-cuda',
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', DART = 'text/x-dart',
VUE = 'text/x-vue', GO = 'text/x-go',
HASKELL = 'text/x-haskell',
HTML = 'text/html',
JAVA = 'text/x-java-source',
JAVASCRIPT = 'text/javascript',
JAVASCRIPT_APP = 'application/javascript',
JSON = 'application/json',
JSONL = 'application/jsonl',
JSX = 'text/jsx',
KOTLIN = 'text/x-kotlin',
LATEX = 'application/x-latex',
MARKDOWN = 'text/markdown',
PHP = 'text/x-php',
PLAIN = 'text/plain',
PROPERTIES = 'text/properties',
PYTHON = 'text/x-python',
R = 'text/x-r',
RUBY = 'text/x-ruby',
RUST = 'text/x-rust',
SCALA = 'text/x-scala',
SHELL = 'text/x-shellscript',
SQL = 'text/x-sql',
SVELTE = 'text/x-svelte', SVELTE = 'text/x-svelte',
SWIFT = 'text/x-swift',
TEX = 'text/x-tex', TEX = 'text/x-tex',
TEX_APP = 'application/x-tex', TEX_APP = 'application/x-tex',
LATEX = 'application/x-latex', TSX = 'text/tsx',
BIBTEX = 'text/x-bibtex', TYPESCRIPT = 'text/typescript',
CUDA = 'text/x-cuda', VUE = 'text/x-vue',
PROPERTIES = 'text/properties' XML_APP = 'application/xml',
XML_TEXT = 'text/xml',
YAML_APP = 'application/yaml',
YAML_TEXT = 'text/yaml'
} }
+5 -5
View File
@@ -2,19 +2,19 @@
* Keyboard key names for event handling * Keyboard key names for event handling
*/ */
export enum KeyboardKey { export enum KeyboardKey {
ENTER = 'Enter',
ESCAPE = 'Escape',
ARROW_UP = 'ArrowUp',
ARROW_DOWN = 'ArrowDown', ARROW_DOWN = 'ArrowDown',
ARROW_LEFT = 'ArrowLeft', ARROW_LEFT = 'ArrowLeft',
ARROW_RIGHT = 'ArrowRight', ARROW_RIGHT = 'ArrowRight',
TAB = 'Tab', ARROW_UP = 'ArrowUp',
B_LOWER = 'b', B_LOWER = 'b',
D_LOWER = 'd', D_LOWER = 'd',
D_UPPER = 'D', D_UPPER = 'D',
E_UPPER = 'E', E_UPPER = 'E',
ENTER = 'Enter',
ESCAPE = 'Escape',
K_LOWER = 'k', K_LOWER = 'k',
O_LOWER = 'o', O_LOWER = 'o',
O_UPPER = 'O', O_UPPER = 'O',
SPACE = ' ' SPACE = ' ',
TAB = 'Tab'
} }
+17 -17
View File
@@ -2,61 +2,61 @@
* Connection lifecycle phases for MCP protocol * Connection lifecycle phases for MCP protocol
*/ */
export enum MCPConnectionPhase { export enum MCPConnectionPhase {
IDLE = 'idle',
TRANSPORT_CREATING = 'transport_creating',
TRANSPORT_READY = 'transport_ready',
INITIALIZING = 'initializing',
CAPABILITIES_EXCHANGED = 'capabilities_exchanged', CAPABILITIES_EXCHANGED = 'capabilities_exchanged',
LISTING_TOOLS = 'listing_tools',
CONNECTED = 'connected', CONNECTED = 'connected',
DISCONNECTED = 'disconnected',
ERROR = 'error', ERROR = 'error',
DISCONNECTED = 'disconnected' IDLE = 'idle',
INITIALIZING = 'initializing',
LISTING_TOOLS = 'listing_tools',
TRANSPORT_CREATING = 'transport_creating',
TRANSPORT_READY = 'transport_ready'
} }
/** /**
* Log level for connection events * Log level for connection events
*/ */
export enum MCPLogLevel { export enum MCPLogLevel {
ERROR = 'error',
INFO = 'info', INFO = 'info',
WARN = 'warn', WARN = 'warn'
ERROR = 'error'
} }
/** /**
* Transport types for MCP connections * Transport types for MCP connections
*/ */
export enum MCPTransportType { export enum MCPTransportType {
WEBSOCKET = 'websocket', SSE = 'sse',
STREAMABLE_HTTP = 'streamable_http', STREAMABLE_HTTP = 'streamable_http',
SSE = 'sse' WEBSOCKET = 'websocket'
} }
/** /**
* Health check status for MCP servers * Health check status for MCP servers
*/ */
export enum HealthCheckStatus { export enum HealthCheckStatus {
IDLE = 'idle',
CONNECTING = 'connecting', CONNECTING = 'connecting',
SUCCESS = 'success', ERROR = 'error',
ERROR = 'error' IDLE = 'idle',
SUCCESS = 'success'
} }
/** /**
* Content types for MCP tool results * Content types for MCP tool results
*/ */
export enum MCPContentType { export enum MCPContentType {
TEXT = 'text',
IMAGE = 'image', IMAGE = 'image',
RESOURCE = 'resource' RESOURCE = 'resource',
TEXT = 'text'
} }
/** /**
* JSON Schema types used in MCP tool definitions * JSON Schema types used in MCP tool definitions
*/ */
export enum JsonSchemaType { export enum JsonSchemaType {
NUMBER = 'number',
OBJECT = 'object', OBJECT = 'object',
STRING = 'string', STRING = 'string'
NUMBER = 'number'
} }
/** /**
+3 -3
View File
@@ -1,6 +1,6 @@
export enum ModelModality { export enum ModelModality {
TEXT = 'TEXT',
AUDIO = 'AUDIO', AUDIO = 'AUDIO',
VISION = 'VISION', TEXT = 'TEXT',
VIDEO = 'VIDEO' VIDEO = 'VIDEO',
VISION = 'VISION'
} }
@@ -4,9 +4,9 @@
*/ */
export enum ReasoningEffort { export enum ReasoningEffort {
DEFAULT = 'default', DEFAULT = 'default',
OFF = 'off',
LOW = 'low',
MEDIUM = 'medium',
HIGH = 'high', HIGH = 'high',
MAX = 'max' LOW = 'low',
MAX = 'max',
MEDIUM = 'medium',
OFF = 'off'
} }
+8 -8
View File
@@ -13,11 +13,11 @@ export enum ServerRole {
* Used as the `value` field in the status object from /models endpoint * Used as the `value` field in the status object from /models endpoint
*/ */
export enum ServerModelStatus { export enum ServerModelStatus {
UNLOADED = 'unloaded', FAILED = 'failed',
LOADING = 'loading',
LOADED = 'loaded', LOADED = 'loaded',
LOADING = 'loading',
SLEEPING = 'sleeping', SLEEPING = 'sleeping',
FAILED = 'failed' UNLOADED = 'unloaded'
} }
/** /**
@@ -26,10 +26,10 @@ export enum ServerModelStatus {
* tools/server/server-models.cpp from the C++ server. * tools/server/server-models.cpp from the C++ server.
*/ */
export enum ServerModelsSseEventType { export enum ServerModelsSseEventType {
STATUS_CHANGE = 'status_change', DOWNLOAD_PROGRESS = 'download_progress',
MODEL_STATUS = 'model_status',
STATUS_UPDATE = 'status_update',
MODELS_RELOAD = 'models_reload',
MODEL_REMOVE = 'model_remove', MODEL_REMOVE = 'model_remove',
DOWNLOAD_PROGRESS = 'download_progress' MODEL_STATUS = 'model_status',
MODELS_RELOAD = 'models_reload',
STATUS_CHANGE = 'status_change',
STATUS_UPDATE = 'status_update'
} }
+7 -7
View File
@@ -2,26 +2,26 @@
* Parameter source - indicates whether a parameter uses default or custom value * Parameter source - indicates whether a parameter uses default or custom value
*/ */
export enum ParameterSource { export enum ParameterSource {
DEFAULT = 'default', CUSTOM = 'custom',
CUSTOM = 'custom' DEFAULT = 'default'
} }
/** /**
* Syncable parameter type - data types for parameters that can be synced with server * Syncable parameter type - data types for parameters that can be synced with server
*/ */
export enum SyncableParameterType { export enum SyncableParameterType {
BOOLEAN = 'boolean',
NUMBER = 'number', NUMBER = 'number',
STRING = 'string', STRING = 'string'
BOOLEAN = 'boolean'
} }
/** /**
* Settings field type - defines the input type for settings fields * Settings field type - defines the input type for settings fields
*/ */
export enum SettingsFieldType { export enum SettingsFieldType {
INPUT = 'input',
TEXTAREA = 'textarea',
CHECKBOX = 'checkbox', CHECKBOX = 'checkbox',
INPUT = 'input',
RADIO = 'radio',
SELECT = 'select', SELECT = 'select',
RADIO = 'radio' TEXTAREA = 'textarea'
} }
+2 -2
View File
@@ -2,6 +2,6 @@
* Splash screen orientation for iOS apple-touch-startup-image * Splash screen orientation for iOS apple-touch-startup-image
*/ */
export enum SplashOrientation { export enum SplashOrientation {
PORTRAIT = 'portrait', LANDSCAPE = 'landscape',
LANDSCAPE = 'landscape' PORTRAIT = 'portrait'
} }
+6 -6
View File
@@ -8,13 +8,13 @@ export enum ToolSource {
export enum ToolPermissionDecision { export enum ToolPermissionDecision {
ALWAYS = 'always', ALWAYS = 'always',
ALWAYS_SERVER = 'always_server', ALWAYS_SERVER = 'always_server',
ONCE = 'once', DENY = 'deny',
DENY = 'deny' ONCE = 'once'
} }
export enum ToolResponseField { export enum ToolResponseField {
PLAIN_TEXT = 'plain_text_response', ERROR = 'error',
ERROR = 'error' PLAIN_TEXT = 'plain_text_response'
} }
/** /**
@@ -22,9 +22,9 @@ export enum ToolResponseField {
* Mirrors the server-side validation in server-tools.cpp. * Mirrors the server-side validation in server-tools.cpp.
*/ */
export enum GlobSearchType { export enum GlobSearchType {
FILE = 'file', ALL = 'all',
DIR = 'dir', DIR = 'dir',
ALL = 'all' FILE = 'file'
} }
/** /**
+9 -9
View File
@@ -1,22 +1,22 @@
export enum ColorMode { export enum ColorMode {
LIGHT = 'light',
DARK = 'dark', DARK = 'dark',
LIGHT = 'light',
SYSTEM = 'system' SYSTEM = 'system'
} }
export enum TooltipSide { export enum TooltipSide {
TOP = 'top',
RIGHT = 'right',
BOTTOM = 'bottom', BOTTOM = 'bottom',
LEFT = 'left' LEFT = 'left',
RIGHT = 'right',
TOP = 'top'
} }
/** /**
* MCP prompt display variant * MCP prompt display variant
*/ */
export enum McpPromptVariant { export enum McpPromptVariant {
MESSAGE = 'message', ATTACHMENT = 'attachment',
ATTACHMENT = 'attachment' MESSAGE = 'message'
} }
/** /**
@@ -39,8 +39,8 @@ export enum HtmlInputType {
* Alert level that drives the context gauge dial color. * Alert level that drives the context gauge dial color.
*/ */
export enum ColorLevel { export enum ColorLevel {
OK = 'ok',
WARNING = 'warning',
CRITICAL = 'critical', CRITICAL = 'critical',
NEUTRAL = 'neutral' NEUTRAL = 'neutral',
OK = 'ok',
WARNING = 'warning'
} }
+3 -3
View File
@@ -50,10 +50,10 @@ const FAVICON_PATH = '/favicon.ico';
// (and that callers read off `SearchResult`), so `FieldKey.TITLE` is a // (and that callers read off `SearchResult`), so `FieldKey.TITLE` is a
// drop-in for the literal `'title'`. // drop-in for the literal `'title'`.
enum FieldKey { enum FieldKey {
TITLE = 'title', AUTHOR = 'author',
URL = 'url',
PUBLISHED = 'published', PUBLISHED = 'published',
AUTHOR = 'author' TITLE = 'title',
URL = 'url'
} }
const FIELD_PREFIXES: ReadonlyArray<{ key: FieldKey; prefix: string }> = [ const FIELD_PREFIXES: ReadonlyArray<{ key: FieldKey; prefix: string }> = [
{ key: FieldKey.TITLE, prefix: 'Title:' }, { key: FieldKey.TITLE, prefix: 'Title:' },