Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions tools/ui/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,9 @@ export default ts.config(
{ 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' }],

// Alphabetical order for variable declarations and object keys
Expand Down
12 changes: 6 additions & 6 deletions tools/ui/src/lib/enums/agentic.enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,21 @@ export enum ToolCallType {
* Types of sections in agentic content display.
*/
export enum AgenticSectionType {
REASONING = 'reasoning',
REASONING_PENDING = 'reasoning_pending',
TEXT = 'text',
TOOL_CALL = 'tool_call',
TOOL_CALL_PENDING = 'tool_call_pending',
TOOL_CALL_STREAMING = 'tool_call_streaming',
REASONING = 'reasoning',
REASONING_PENDING = 'reasoning_pending'
TOOL_CALL_STREAMING = 'tool_call_streaming'
}

/**
* 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'
NEXT_TURN = 'next_turn',
RERUN_TURN = 'rerun_turn'
}

/**
Expand All @@ -39,7 +39,7 @@ export enum ToolResultKind {
* Line classification for the unified-diff renderer of `edit_file` results.
*/
export enum DiffLineKind {
CONTEXT = 'context',
ADD = 'add',
CONTEXT = 'context',
REMOVE = 'remove'
}
26 changes: 13 additions & 13 deletions tools/ui/src/lib/enums/attachment.enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,57 +4,57 @@
export enum AttachmentType {
AUDIO = 'AUDIO',
IMAGE = 'IMAGE',
VIDEO = 'VIDEO',
LEGACY_CONTEXT = 'context', // Legacy attachment type for backward compatibility
MCP_PROMPT = 'MCP_PROMPT',
MCP_RESOURCE = 'MCP_RESOURCE',
PDF = 'PDF',
TEXT = 'TEXT',
LEGACY_CONTEXT = 'context' // Legacy attachment type for backward compatibility
VIDEO = 'VIDEO'
}

/**
* 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',
IMAGES = 'images',
MCP_PROMPT = 'mcp-prompt',
MCP_RESOURCES = 'mcp-resources',
PDF = 'pdf',
SYSTEM_MESSAGE = 'system-message',
MCP_PROMPT = 'mcp-prompt',
MCP_RESOURCES = 'mcp-resources'
TEXT = 'text',
VIDEO = 'video'
}

/**
* 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'
HAS_VIDEO_MODALITY = 'hasVideoModality',
HAS_VISION_MODALITY = 'hasVisionModality'
}

/**
* 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'
MCP_RESOURCES_CLICK = 'onMcpResourcesClick',
SYSTEM_PROMPT_CLICK = 'onSystemPromptClick'
}

/**
* Human-readable labels used when embedding attachments in outgoing messages.
*/
export enum AttachmentLabel {
FILE = 'File',
PDF_FILE = 'PDF File',
MCP_PROMPT = 'MCP Prompt',
MCP_RESOURCE = 'MCP Resource'
MCP_RESOURCE = 'MCP Resource',
PDF_FILE = 'PDF File'
}

/**
Expand Down
4 changes: 2 additions & 2 deletions tools/ui/src/lib/enums/boolean-string.enums.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/** String representation of a boolean used in data attributes and persisted values. */
export enum BooleanString {
TRUE = 'true',
FALSE = 'false'
FALSE = 'false',
TRUE = 'true'
}
48 changes: 24 additions & 24 deletions tools/ui/src/lib/enums/chat.enums.ts
Original file line number Diff line number Diff line change
@@ -1,69 +1,69 @@
export enum ChatMessageStatsView {
GENERATION = 'generation',
READING = 'reading',
TOOLS = 'tools',
SUMMARY = 'summary'
SUMMARY = 'summary',
TOOLS = 'tools'
}

export enum ChatMessageStatisticsMode {
SWITCHABLE = 'switchable',
GENERATION = 'generation',
READING = 'reading',
GENERATION = 'generation'
SWITCHABLE = 'switchable'
}

/**
* Connection state of a streamed completion, drives the resume status indicator.
*/
export enum StreamConnectionState {
STREAMING = 'streaming',
LOST = 'lost',
RESUMING = 'resuming',
LOST = 'lost'
STREAMING = 'streaming'
}

/**
* Reasoning format options for API requests.
*/
export enum ReasoningFormat {
NONE = 'none',
AUTO = 'auto'
AUTO = 'auto',
NONE = 'none'
}

/**
* Message roles for chat messages.
*/
export enum MessageRole {
USER = 'user',
ASSISTANT = 'assistant',
SYSTEM = 'system',
TOOL = 'tool'
TOOL = 'tool',
USER = 'user'
}

/**
* Message types for different content kinds.
*/
export enum MessageType {
ROOT = 'root',
SYSTEM = 'system',
TEXT = 'text',
THINK = 'think',
SYSTEM = 'system'
THINK = 'think'
}

/**
* 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'
INPUT_VIDEO = 'input_video',
TEXT = 'text'
}

/**
* Error dialog types for displaying server/timeout errors.
*/
export enum ErrorDialogType {
TIMEOUT = 'timeout',
SERVER = 'server'
SERVER = 'server',
TIMEOUT = 'timeout'
}

export enum ConversationSelectionMode {
Expand All @@ -75,27 +75,27 @@ export enum ConversationSelectionMode {
* PDF view mode options for previewing PDF attachments.
*/
export enum PdfViewMode {
TEXT = 'text',
PAGES = 'pages'
PAGES = 'pages',
TEXT = 'text'
}

export enum ChatFormCommandAction {
PROMPT = 'prompt',
CWD = 'cwd',
MODEL = 'model'
MODEL = 'model',
PROMPT = 'prompt'
}

export enum FileMentionEntryType {
FILE = 'file',
DIRECTORY = 'directory'
DIRECTORY = 'directory',
FILE = 'file'
}

/**
* Kinds of tokens the chat-form-input-rich produces.
*/
export enum ChatFormInputRichTokenKind {
TEXT = 'text',
BADGE = 'badge',
CODE_BLOCK = 'code_block',
CODE_INLINE = 'code_inline',
CODE_BLOCK = 'code_block'
TEXT = 'text'
}
4 changes: 2 additions & 2 deletions tools/ui/src/lib/enums/conversation-import.enums.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
* message record belongs to it.
*/
export enum SessionRecordType {
SESSION = 'session',
MESSAGE = 'message'
MESSAGE = 'message',
SESSION = 'session'
}
Loading
Loading