webui: Agentic Loop + MCP Client with support for Tools, Resources and Prompts (#18655)

This commit is contained in:
Aleksander Grygier
2026-03-06 10:00:39 +01:00
committed by GitHub
parent 2850bc6a13
commit f6235a41ef
147 changed files with 15285 additions and 366 deletions
@@ -0,0 +1,18 @@
/**
* 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'
}
@@ -4,6 +4,8 @@
export enum AttachmentType {
AUDIO = 'AUDIO',
IMAGE = 'IMAGE',
MCP_PROMPT = 'MCP_PROMPT',
MCP_RESOURCE = 'MCP_RESOURCE',
PDF = 'PDF',
TEXT = 'TEXT',
LEGACY_CONTEXT = 'context' // Legacy attachment type for backward compatibility
@@ -11,6 +11,13 @@ export enum FileTypeCategory {
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',
+15 -2
View File
@@ -1,5 +1,7 @@
export { AttachmentType } from './attachment';
export { AgenticSectionType, ToolCallType } from './agentic';
export {
ChatMessageStatsView,
ContentPartType,
@@ -25,15 +27,26 @@ export {
MimeTypeApplication,
MimeTypeAudio,
MimeTypeImage,
MimeTypeText
MimeTypeText,
SpecialFileType
} from './files';
export {
MCPConnectionPhase,
MCPLogLevel,
MCPTransportType,
HealthCheckStatus,
MCPContentType,
MCPRefType,
JsonSchemaType
} from './mcp';
export { ModelModality } from './model';
export { ServerRole, ServerModelStatus } from './server';
export { ParameterSource, SyncableParameterType, SettingsFieldType } from './settings';
export { ColorMode, UrlPrefix } from './ui';
export { ColorMode, McpPromptVariant, UrlProtocol } from './ui';
export { KeyboardKey } from './keyboard';
+66
View File
@@ -0,0 +1,66 @@
/**
* 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'
}
/**
* Reference types for MCP completions
*/
export enum MCPRefType {
PROMPT = 'ref/prompt',
RESOURCE = 'ref/resource'
}
+9 -1
View File
@@ -4,10 +4,18 @@ export enum ColorMode {
SYSTEM = 'system'
}
/**
* MCP prompt display variant
*/
export enum McpPromptVariant {
MESSAGE = 'message',
ATTACHMENT = 'attachment'
}
/**
* URL prefixes for protocol detection
*/
export enum UrlPrefix {
export enum UrlProtocol {
DATA = 'data:',
HTTP = 'http://',
HTTPS = 'https://',