Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
323 commits
Select commit Hold shift + click to select a range
14d014a
chore: update webui build output
allozaur Jan 12, 2026
d87c4c8
feat: MCP Server Details
allozaur Jan 14, 2026
10537b6
chore: update webui build output
allozaur Jan 14, 2026
1ca452f
chore: update webui build output
allozaur Jan 14, 2026
b3b2998
chore: update webui build output
allozaur Jan 14, 2026
64913e7
feat: UI improvement
allozaur Jan 14, 2026
9e116d6
chore: update webui build output
allozaur Jan 14, 2026
5f6034f
feat: UI improvements
allozaur Jan 14, 2026
3d9463c
chore: update webui build output
allozaur Jan 15, 2026
6b1bcdc
fix: Word wrapping
allozaur Jan 15, 2026
30c8a73
webui: fix custom headers persistence in UI
ServeurpersoCom Jan 15, 2026
6433968
webui: fix custom headers persistence in UI (derived)
ServeurpersoCom Jan 15, 2026
9f999a5
feat: persist base64 attachments from tool results
ServeurpersoCom Jan 15, 2026
ce4507e
feat: resolve MCP attachment images via rehype plugin
ServeurpersoCom Jan 16, 2026
c9f2fe0
chore: update webui build output
ServeurpersoCom Jan 16, 2026
0a78bf7
refactor: inline reasoning with tags, remove fixed thinking field
ServeurpersoCom Jan 16, 2026
67428dd
refactor: remove reasoning after first turn filter
ServeurpersoCom Jan 16, 2026
2392673
chore: update webui build output
ServeurpersoCom Jan 16, 2026
0d7d117
fix: strip reasoning content and UI proprietary tags from prompts
ServeurpersoCom Jan 16, 2026
7ab79be
chore: update webui build output
ServeurpersoCom Jan 16, 2026
1dce0d9
refactor: eliminate MCP circular dependency
ServeurpersoCom Jan 17, 2026
4752979
chore: update webui build output
ServeurpersoCom Jan 17, 2026
9060193
fix: ignore assistant attachments (MCP) for modality detection
ServeurpersoCom Jan 17, 2026
1e08865
chore: update webui build output
ServeurpersoCom Jan 17, 2026
897d0b1
refactor: remove multimodal validation from model selector
ServeurpersoCom Jan 18, 2026
1b3819e
chore: update webui build output
ServeurpersoCom Jan 18, 2026
487b48b
fix: unify MCP server label logic with simplified fallback
ServeurpersoCom Jan 18, 2026
7b7a0f0
fix: acurate tool_response display
ServeurpersoCom Jan 19, 2026
b46147a
chore: update webui build output
ServeurpersoCom Jan 19, 2026
d3fa7e8
fix: Missing onModelChange callback running assistant message re-gene…
allozaur Jan 19, 2026
e9b50bf
chore: update webui build output
allozaur Jan 19, 2026
ea62a77
feat: Simplify MCP server enabling logic per chat
allozaur Jan 19, 2026
8ec4ac7
feat: UI improvements
allozaur Jan 19, 2026
267b39f
feat: Improve MCP Server selection UI + lazy load health checks
allozaur Jan 19, 2026
8284231
chore: update webui build output
allozaur Jan 19, 2026
29f4109
feat: Per-conversation agentic loop state
allozaur Jan 22, 2026
8d4a5b7
feat: Architectural improvements
allozaur Jan 22, 2026
83a4532
chore: update webui build output
allozaur Jan 22, 2026
841b8a1
feat: UI improvements
allozaur Jan 23, 2026
618a9a0
chore: update webui build output
allozaur Jan 23, 2026
c4b3c96
feat: MCP Prompts WIP
allozaur Jan 24, 2026
dbff810
chore: update webui build output
allozaur Jan 24, 2026
6224439
fix: Chat Form submission
allozaur Jan 24, 2026
1f1baeb
fix: Save draft message in Chat Form when adding System Prompt from n…
allozaur Jan 24, 2026
ca3d778
fix: System prompt sorting
allozaur Jan 24, 2026
694f716
feat: Improve formatting performance time
allozaur Jan 24, 2026
a466148
chore: update webui build output
allozaur Jan 24, 2026
d952290
webui: enable vision in agentic tool responses
ServeurpersoCom Jan 24, 2026
f1b982c
fix: resolve TypeScript error in tool response content
ServeurpersoCom Jan 24, 2026
dcafe72
refactor: Enums
allozaur Jan 24, 2026
47d852f
refactor: Message Height CSS Variable
allozaur Jan 24, 2026
a176aeb
feat: MCP Prompts implementation improvements
allozaur Jan 24, 2026
fed5b1c
chore: update webui build output
allozaur Jan 24, 2026
bacbd33
refactor: Cleanup
allozaur Jan 24, 2026
5d09c41
refactor: Constants
allozaur Jan 24, 2026
165892a
chore: update webui build output
allozaur Jan 24, 2026
6fbe10b
refactor: Cleanup
allozaur Jan 24, 2026
7ed2a1e
chore: update webui build output
allozaur Jan 24, 2026
f28eb4c
refactor: Remove unused code
allozaur Jan 24, 2026
85659c0
refactor: Naming + remove redundant component
allozaur Jan 24, 2026
ca3f329
refactor: Cleanup
allozaur Jan 24, 2026
0f5768d
chore: update webui build output
allozaur Jan 24, 2026
5cef14f
refactor: Naming & Enums
allozaur Jan 24, 2026
9e1b4ec
refactor: Cleanup
allozaur Jan 24, 2026
4fc9052
chore: update webui build output
allozaur Jan 25, 2026
0eb7da7
chore: Add deprecation comment
allozaur Jan 25, 2026
c60d219
refactor: DRY
allozaur Jan 25, 2026
8c9175d
chore: update webui build output
allozaur Jan 25, 2026
4d39a82
refactor: Types
allozaur Jan 25, 2026
05399f3
chore: update webui build output
allozaur Jan 25, 2026
b1e3083
refactor: Simplify MCP errors
allozaur Jan 25, 2026
5fcc868
chore: update webui build output
allozaur Jan 25, 2026
055dc23
refactor: Cleanup
allozaur Jan 25, 2026
e79ea5e
refactor: Enums
allozaur Jan 25, 2026
aade656
chore: update webui build output
allozaur Jan 25, 2026
ccb4cdb
refactor: Use store methods
allozaur Jan 26, 2026
e5724ab
refactor: Utility function
allozaur Jan 26, 2026
4ef547a
refactor: Componentize Chat Form Prompt Picker
allozaur Jan 26, 2026
477256a
chore: update webui build output
allozaur Jan 26, 2026
8aed13d
refactor: Cleanup
allozaur Jan 26, 2026
af32570
refactor: Components imports/exports structure & documentation
allozaur Jan 26, 2026
c7fe72b
chore: update webui build output
allozaur Jan 26, 2026
7cd382d
feat: Improve Code blocks rendering + add auto scroll + improve globa…
allozaur Jan 26, 2026
3ccf082
chore: update webui build output
allozaur Jan 26, 2026
151bb5e
fix: Scroll issues in DropdownMenuSearchable
allozaur Jan 26, 2026
941dd64
feat: Mcp Server Selector
allozaur Jan 26, 2026
27c75a5
chore: update webui build output
allozaur Jan 26, 2026
b794430
refactor: Cleanup
allozaur Jan 26, 2026
eaf5666
refactor: Cleanup
allozaur Jan 26, 2026
9069bda
fix: Wait for all MCP Servers Health Checks to load
allozaur Jan 26, 2026
4c3a03d
chore: update webui build output
allozaur Jan 26, 2026
65c7271
refactor: Utils
allozaur Jan 27, 2026
1ad7f02
refactor: Components
allozaur Jan 27, 2026
f122937
chore: update webui build output
allozaur Jan 27, 2026
995ad71
webui: remove unused sessionId, SDK handles it automatically
ServeurpersoCom Jan 26, 2026
3d34b7c
webui: remove unused sessionId, SDK handles it automatically
ServeurpersoCom Jan 26, 2026
4c78c64
chore: update webui build output
allozaur Jan 27, 2026
443d496
feat: UI improvements
allozaur Jan 27, 2026
d1daf91
refactor: Use Popover for Chat Form Prompt Picker
allozaur Jan 27, 2026
1c4c1cc
fix: Edit Mode with MCP Prompt in message
allozaur Jan 27, 2026
cb5c8db
feat: Introduce clipboard types for MCP prompt attachments
allozaur Jan 27, 2026
50c9ec8
feat: Implement clipboard serialization/deserialization for MCP prompts
allozaur Jan 27, 2026
dc8cbf6
feat: Add support for pasting MCP prompt attachments in ChatForm
allozaur Jan 27, 2026
24dbcc8
refactor: Improve styling and overflow handling for ChatMessageMcpPro…
allozaur Jan 27, 2026
edb77d1
refactor: Components
allozaur Jan 27, 2026
03ece46
chore: update webui build output
allozaur Jan 27, 2026
32f8831
refactor: Centralize chat-wide actions in ChatMessages.svelte
allozaur Jan 27, 2026
766e1b6
refactor: Encapsulate message editing state and actions in ChatMessag…
allozaur Jan 27, 2026
dda5296
refactor: Adapt message child components to MessageEditContext
allozaur Jan 27, 2026
02804ad
chore: update webui build output
allozaur Jan 27, 2026
612dcb1
feat: Add cache configuration constants
allozaur Jan 27, 2026
abebc75
feat: Implement generic TTL cache utility
allozaur Jan 27, 2026
94863fa
refactor: Use TTL cache for model properties in ModelsStore
allozaur Jan 27, 2026
c288c70
feat: Implement inactive chat conversation state cleanup
allozaur Jan 27, 2026
01cf3f0
refactor: Remove unused `getChatActionsContext` import
allozaur Jan 27, 2026
7d62be0
chore: update webui build output
allozaur Jan 27, 2026
bbfcca7
feat: Add auto-resizing textarea to KeyValuePairs component
allozaur Jan 27, 2026
2946019
feat: Disable server card toggle when in error state
allozaur Jan 27, 2026
e4ced07
feat: Enhance ChatMessageMcpPromptContent display
allozaur Jan 27, 2026
fe903ff
chore: update webui build output
allozaur Jan 27, 2026
dc5a55b
refactor: Create shared ActiveConversationStore to avoid circular dep…
allozaur Jan 27, 2026
b98d820
chore: update webui build output
allozaur Jan 27, 2026
0daa37a
refactor: Improves abort signal handling
allozaur Jan 27, 2026
e6d0778
fix: Missing tool call handling
allozaur Jan 27, 2026
aee7f4b
feat: Introduce centralized API fetch utilities
allozaur Jan 27, 2026
a2e8f58
feat: Introduce BaseClient for common store integration
allozaur Jan 27, 2026
a53f1bb
refactor: Go back to simpler Stores + Services architecture
allozaur Jan 27, 2026
343231b
fix: Sync streaming content to active messages
allozaur Jan 27, 2026
b039ad1
chore: update webui build output
allozaur Jan 27, 2026
2c915ab
refactor: Reuse MCP connections for health checks
allozaur Jan 27, 2026
6d6cc42
refactor: Componentize HorizontalScrollCarousel
allozaur Jan 28, 2026
b1dd964
feat: Introduce MCP Resource Types and Service Methods
allozaur Jan 28, 2026
4af140e
refactor: Use constants
allozaur Jan 28, 2026
fc25ef3
feat: MCP Resources Svelte Store
allozaur Jan 28, 2026
a6677eb
feat: Integrate Resource Store into Main MCP Store
allozaur Jan 28, 2026
5f5a53f
feat: MCP Resources UI
allozaur Jan 28, 2026
c240e30
feat: Integrate Resource Attachments into Chat Form UI
allozaur Jan 28, 2026
4af6e18
feat: Chat logic improvements
allozaur Jan 28, 2026
2db6fa3
refactor: Refine Chat Message Processing State Display
allozaur Jan 28, 2026
dfedb11
fix: Linter errors
allozaur Jan 28, 2026
9c124b1
chore: update webui build output
allozaur Jan 28, 2026
10e3ce5
refactor: Cleanup
allozaur Jan 29, 2026
f5a2d49
fix: Checking for capabilities from store
allozaur Jan 29, 2026
717bea0
chore: update webui build output
allozaur Jan 29, 2026
209a284
demo cors proxy
ngxson Jan 6, 2026
6b229c6
fix
ngxson Jan 6, 2026
a6aa26b
download: use httplib and boringssl by default
ngxson Jan 6, 2026
da49279
https working
ngxson Jan 6, 2026
b2bbee8
feat: Integrate with `llama-server` proxy + improve MCP Server Edit Form
allozaur Jan 29, 2026
b53e699
chore: update webui build output
allozaur Jan 29, 2026
0cf1d53
refactor: Proxy utility
allozaur Jan 29, 2026
6a52d0f
refactor: Use CORS Proxy for favicons calls
allozaur Jan 29, 2026
a3690ec
chore: update webui build output
allozaur Jan 29, 2026
0db63ff
webui: adaptive model selector dropdown width
ServeurpersoCom Jan 30, 2026
bf51087
chore: update webui build output
ServeurpersoCom Jan 30, 2026
b7fe083
fix: responsive MCP server cards for mobile viewports
ServeurpersoCom Jan 31, 2026
eadc60f
fix: responsive MCP server cards, prioritize server name over version
ServeurpersoCom Jan 31, 2026
0e34187
chore: update webui build output
ServeurpersoCom Jan 31, 2026
39a6dba
fix: skip sending image attachments to non-vision backends
ServeurpersoCom Feb 1, 2026
ec74adf
chore: update webui build output
ServeurpersoCom Feb 1, 2026
2dd98b0
fix: also skip image attachments in message history for non-vision ba…
ServeurpersoCom Feb 1, 2026
88a4d99
chore: update webui build output
ServeurpersoCom Feb 1, 2026
e95659b
feat: render images below attachment markers in tool results
ServeurpersoCom Feb 1, 2026
5b84eb1
feat: render images inline below attachment markers in tool results
ServeurpersoCom Feb 1, 2026
91f82f6
chore: update webui build output
ServeurpersoCom Feb 1, 2026
a697601
webui: incremental MDAST transform caching for streaming performance
ServeurpersoCom Feb 1, 2026
250f1d2
chore: update webui build output
ServeurpersoCom Feb 1, 2026
f1b5ead
webui: fix UI freeze at high token rates with RAF yield
ServeurpersoCom Feb 1, 2026
584cc31
chore: update webui build output
ServeurpersoCom Feb 1, 2026
e542611
webui: remove artificial cache limit, let GC handle cleanup on conver…
ServeurpersoCom Feb 2, 2026
2836844
chore: update webui build output
ServeurpersoCom Feb 2, 2026
0d14d2a
webui: add early exit for unchanged content in markdown processing
ServeurpersoCom Feb 2, 2026
bce8e2e
chore: update webui build output
ServeurpersoCom Feb 2, 2026
7469400
Update tools/server/webui/src/lib/components/app/chat/ChatAttachments…
ServeurpersoCom Feb 2, 2026
1670570
chore: update webui build output
ServeurpersoCom Feb 2, 2026
467e51e
refactor: Cleanup
allozaur Feb 2, 2026
f8b108a
refactor: Cleanup
allozaur Feb 3, 2026
9f96992
refactor: Cleanup
allozaur Feb 3, 2026
fe4f7a9
refactor: Cleanup
allozaur Feb 3, 2026
ca6d184
refactor: Cleanup
allozaur Feb 3, 2026
21d61d4
refactor: Cleanup
allozaur Feb 3, 2026
d32041f
refactor: Cleanup
allozaur Feb 3, 2026
76bdfff
refactor: Cleanup
allozaur Feb 3, 2026
cc166a0
refactor: MarkdownContent props API
allozaur Feb 3, 2026
660a96e
refactor: Cleanup
allozaur Feb 3, 2026
768b404
feat: Add `createBase64DataUrl` utility and `MimeTypeApplication.OCTE…
allozaur Feb 3, 2026
bacd1be
refactor: Use `UrlPrefix` enum for data stream parsing
allozaur Feb 3, 2026
0231953
refactor: Componentize MCP Resource Browser
allozaur Feb 3, 2026
a4430da
fix: Storybook
allozaur Feb 3, 2026
f5274a3
chore: update webui build output
allozaur Feb 3, 2026
caea04b
fix: handle MCP WebSocket disconnections with auto-reconnect (SDK pro…
ServeurpersoCom Feb 4, 2026
ba34935
webui: improve when lacking vertical space on mobile with keyboard open
ServeurpersoCom Feb 4, 2026
51b4629
chore: update webui build output
ServeurpersoCom Feb 4, 2026
2b402ec
fix: MCP WebSocket reconnection race conditions
ServeurpersoCom Feb 5, 2026
a44ea55
chore: update webui build output
ServeurpersoCom Feb 5, 2026
2921b70
feat: Improve Stop button UI
allozaur Feb 5, 2026
7aa85fd
feat: Add McpServersSettings to Chat Settings "MCP" section
allozaur Feb 5, 2026
4664494
refactor: Constants
allozaur Feb 5, 2026
f6bb30c
feat: Enable added MCP Server by default
allozaur Feb 5, 2026
309ebe0
feat: Improve prompt picker keyboard navigation
allozaur Feb 5, 2026
4835a54
feat: Prompt Picker and Prompt Attachment UI/UX improvements
allozaur Feb 6, 2026
874d395
fix: UI improvements
allozaur Feb 6, 2026
88e9fef
feat: Navigation UI improvements
allozaur Feb 6, 2026
13f6ab2
chore: update webui build output
allozaur Feb 6, 2026
a2be349
fix: Context info fixes & improvements
allozaur Feb 6, 2026
90da162
chore: update webui build output
allozaur Feb 6, 2026
24b9ea2
feat: MCP Resources
allozaur Feb 7, 2026
5cb75f5
fix: Syntax highlight for `svelte` and `vue`
allozaur Feb 7, 2026
87b69db
chore: update webui build output
allozaur Feb 7, 2026
b5056cf
fix: Naming
allozaur Feb 7, 2026
e12eebc
fix: Proper system message deletion logic
allozaur Feb 8, 2026
ed8db6a
refactor: Consolidate MCP server settings into ChatSettings
allozaur Feb 8, 2026
e537474
feat: Improve MCP server selection UX in chat form dropdown
allozaur Feb 8, 2026
60c7619
refactor: Cleanup
allozaur Feb 8, 2026
ba8d12e
feat: Minor UI tweaks
allozaur Feb 8, 2026
8680ccd
chore: update webui build output
allozaur Feb 8, 2026
1def625
refactor: Cleanup
allozaur Feb 9, 2026
6945377
feat: Implement resource search in MCP Resource browser
allozaur Feb 9, 2026
63ce323
fix: MCP Resources Browser selection & attaching
allozaur Feb 9, 2026
7be5556
fix: Improve word wrapping in resource preview
allozaur Feb 9, 2026
f15ae0a
chore: update webui build output
allozaur Feb 9, 2026
92c1137
chore: Formatting & linting
allozaur Feb 9, 2026
285bbce
chore: update webui build output
allozaur Feb 9, 2026
e7b194d
refactor: Cleanup
allozaur Feb 9, 2026
7dfc028
refactor: Cleanup
allozaur Feb 9, 2026
1b47fc4
refactor: Redesign DropdownMenuSearchable as content provider
allozaur Feb 9, 2026
0daec77
feat: Enable MCP prompt button in chat message edit form
allozaur Feb 9, 2026
815d7f8
docs: Centralize and enhance service documentation
allozaur Feb 9, 2026
5308456
chore: update webui build output
allozaur Feb 9, 2026
2848231
feat: UI improvements
allozaur Feb 9, 2026
0c9ed60
refactor: Move MCP health checks to background process from core layout
allozaur Feb 9, 2026
527ae1d
refactor: Cleanup
allozaur Feb 9, 2026
e0a76f0
chore: update webui build output
allozaur Feb 10, 2026
de20004
chore: Update packages with `npm audit fix`
allozaur Feb 10, 2026
0457300
chore: update webui build output
allozaur Feb 10, 2026
a5de3ba
fix: UI
allozaur Feb 10, 2026
7e24e67
feat: Improve agentic turn visualization and statistics
allozaur Feb 10, 2026
8d297f5
docs: Update diagrams
allozaur Feb 10, 2026
0e8dcd7
chore: Formatting
allozaur Feb 10, 2026
1e80314
chore: update webui build output
allozaur Feb 10, 2026
74172a6
refactor: Cleanup
allozaur Feb 11, 2026
3edb543
refactor: Consolidate MCP resource attachment components
allozaur Feb 11, 2026
1390add
feat: Improve styling for MCP resource attachment chip
allozaur Feb 11, 2026
188f20c
refactor: Use Svelte derived state for non-mutable reactive variables
allozaur Feb 11, 2026
8a499c8
refactor: Standardize MCP server ID generation and prefix
allozaur Feb 11, 2026
b364532
refactor: `ConversationSelection` initial state handling & Minor fixes
allozaur Feb 11, 2026
7080356
build: align CMake and CI with master while keeping CORS proxy
allozaur Feb 11, 2026
ad18143
chore: update webui build output
allozaur Feb 13, 2026
d7d8464
fix: Post-rebase fixes
allozaur Feb 13, 2026
635ac75
chore: update webui build output
allozaur Feb 13, 2026
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
Binary file modified tools/server/public/index.html.gz
Binary file not shown.
23 changes: 20 additions & 3 deletions tools/server/server-models.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1000,11 +1000,20 @@ server_http_proxy::server_http_proxy(
int32_t timeout_write
) {
// shared between reader and writer threads
auto cli = std::make_shared<httplib::Client>(host, port);
auto cli = std::make_shared<httplib::ClientImpl>(host, port);
auto pipe = std::make_shared<pipe_t<msg_t>>();

if (port == 443) {
#ifdef CPPHTTPLIB_OPENSSL_SUPPORT
cli.reset(new httplib::SSLClient(host, port));
#else
throw std::runtime_error("HTTPS requested but CPPHTTPLIB_OPENSSL_SUPPORT is not defined");
#endif
}

// setup Client
cli->set_connection_timeout(0, 200000); // 200 milliseconds
cli->set_follow_location(true);
cli->set_connection_timeout(5, 0); // 5 seconds
cli->set_write_timeout(timeout_read, 0); // reversed for cli (client) vs srv (server)
cli->set_read_timeout(timeout_write, 0);
this->status = 500; // to be overwritten upon response
Expand Down Expand Up @@ -1053,7 +1062,15 @@ server_http_proxy::server_http_proxy(
req.method = method;
req.path = path;
for (const auto & [key, value] : headers) {
req.set_header(key, value);
if (key == "Accept-Encoding") {
// disable Accept-Encoding to avoid compressed responses
continue;
}
if (key == "Host" || key == "host") {
req.set_header(key, host);
} else {
req.set_header(key, value);
}
}
req.body = body;
req.response_handler = response_handler;
Expand Down
50 changes: 48 additions & 2 deletions tools/server/server-models.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include "common.h"
#include "preset.h"
#include "http.h"
#include "server-common.h"
#include "server-http.h"

Expand Down Expand Up @@ -184,8 +185,8 @@ struct server_http_proxy : server_http_res {
const std::map<std::string, std::string> & headers,
const std::string & body,
const std::function<bool()> should_stop,
int32_t timeout_read,
int32_t timeout_write
int32_t timeout_read = 600,
int32_t timeout_write = 600
);
~server_http_proxy() {
if (cleanup) {
Expand All @@ -201,3 +202,48 @@ struct server_http_proxy : server_http_res {
std::string content_type;
};
};

// BELOW IS DEMO CODE FOR PROXY HANDLERS
// DO NOT MERGE IT AS-IS

static server_http_res_ptr proxy_request(const server_http_req & req, std::string method) {
std::string target_url = req.get_param("url");
common_http_url parsed_url = common_http_parse_url(target_url);

if (parsed_url.host.empty()) {
throw std::runtime_error("invalid target URL: missing host");
}

if (parsed_url.path.empty()) {
parsed_url.path = "/";
}

if (!parsed_url.password.empty()) {
throw std::runtime_error("authentication in target URL is not supported");
}

if (parsed_url.scheme != "http" && parsed_url.scheme != "https") {
throw std::runtime_error("unsupported URL scheme in target URL: " + parsed_url.scheme);
}

SRV_INF("proxying %s request to %s://%s%s\n", method.c_str(), parsed_url.scheme.c_str(), parsed_url.host.c_str(), parsed_url.path.c_str());

auto proxy = std::make_unique<server_http_proxy>(
method,
parsed_url.host,
parsed_url.scheme == "http" ? 80 : 443,
parsed_url.path,
req.headers,
req.body,
req.should_stop);

return proxy;
}

static server_http_context::handler_t proxy_handler_post = [](const server_http_req & req) -> server_http_res_ptr {
return proxy_request(req, "POST");
};

static server_http_context::handler_t proxy_handler_get = [](const server_http_req & req) -> server_http_res_ptr {
return proxy_request(req, "GET");
};
3 changes: 3 additions & 0 deletions tools/server/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,9 @@ int main(int argc, char ** argv) {
// Save & load slots
ctx_http.get ("/slots", ex_wrapper(routes.get_slots));
ctx_http.post("/slots/:id_slot", ex_wrapper(routes.post_slots));
// CORS proxy
ctx_http.get ("/cors-proxy", ex_wrapper(proxy_handler_get));
ctx_http.post("/cors-proxy", ex_wrapper(proxy_handler_post));

//
// Start the server
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,13 @@ flowchart TB
C_Form["ChatForm"]
C_Messages["ChatMessages"]
C_Message["ChatMessage"]
C_ChatMessageAgenticContent["ChatMessageAgenticContent"]
C_MessageEditForm["ChatMessageEditForm"]
C_ModelsSelector["ModelsSelector"]
C_Settings["ChatSettings"]
C_McpSettings["McpServersSettings"]
C_McpResourceBrowser["McpResourceBrowser"]
C_McpServersSelector["McpServersSelector"]
end
subgraph Hooks["🪝 Hooks"]
Expand All @@ -24,10 +28,13 @@ flowchart TB
subgraph Stores["🗄️ Stores"]
S1["chatStore<br/><i>Chat interactions & streaming</i>"]
S2["conversationsStore<br/><i>Conversation data & messages</i>"]
SA["agenticStore<br/><i>Multi-turn agentic loop orchestration</i>"]
S2["conversationsStore<br/><i>Conversation data, messages & MCP overrides</i>"]
S3["modelsStore<br/><i>Model selection & loading</i>"]
S4["serverStore<br/><i>Server props & role detection</i>"]
S5["settingsStore<br/><i>User configuration</i>"]
S5["settingsStore<br/><i>User configuration incl. MCP</i>"]
S6["mcpStore<br/><i>MCP servers, tools, prompts</i>"]
S7["mcpResourceStore<br/><i>MCP resources & attachments</i>"]
end
subgraph Services["⚙️ Services"]
Expand All @@ -36,11 +43,12 @@ flowchart TB
SV3["PropsService"]
SV4["DatabaseService"]
SV5["ParameterSyncService"]
SV6["MCPService<br/><i>protocol operations</i>"]
end
subgraph Storage["💾 Storage"]
ST1["IndexedDB<br/><i>conversations, messages</i>"]
ST2["LocalStorage<br/><i>config, userOverrides</i>"]
ST2["LocalStorage<br/><i>config, userOverrides, mcpServers</i>"]
end
subgraph APIs["🌐 llama-server API"]
Expand All @@ -50,15 +58,27 @@ flowchart TB
API4["/v1/models"]
end
subgraph ExternalMCP["🔌 External MCP Servers"]
EXT1["MCP Server 1<br/><i>WebSocket/HTTP/SSE</i>"]
EXT2["MCP Server N"]
end
%% Routes → Components
R1 & R2 --> C_Screen
RL --> C_Sidebar
%% Layout runs MCP health checks
RL --> S6
%% Component hierarchy
C_Screen --> C_Form & C_Messages & C_Settings
C_Messages --> C_Message
C_Message --> C_ChatMessageAgenticContent
C_Message --> C_MessageEditForm
C_Form & C_MessageEditForm --> C_ModelsSelector
C_Form --> C_McpServersSelector
C_Settings --> C_McpSettings
C_McpSettings --> C_McpResourceBrowser
%% Components → Hooks → Stores
C_Form & C_Messages --> H1 & H2
Expand All @@ -70,13 +90,24 @@ flowchart TB
C_Sidebar --> S2
C_ModelsSelector --> S3 & S4
C_Settings --> S5
C_McpSettings --> S6
C_McpResourceBrowser --> S6 & S7
C_McpServersSelector --> S6
C_Form --> S6
%% chatStore → agenticStore → mcpStore (agentic loop)
S1 --> SA
SA --> SV1
SA --> S6
%% Stores → Services
S1 --> SV1 & SV4
S2 --> SV4
S3 --> SV2 & SV3
S4 --> SV3
S5 --> SV5
S6 --> SV6
S7 --> SV6
%% Services → Storage
SV4 --> ST1
Expand All @@ -87,6 +118,9 @@ flowchart TB
SV2 --> API3 & API4
SV3 --> API2
%% MCP → External Servers
SV6 --> EXT1 & EXT2
%% Styling
classDef routeStyle fill:#e1f5fe,stroke:#01579b,stroke-width:2px
classDef componentStyle fill:#f3e5f5,stroke:#7b1fa2,stroke-width:2px
Expand All @@ -95,12 +129,17 @@ flowchart TB
classDef serviceStyle fill:#e8f5e9,stroke:#2e7d32,stroke-width:2px
classDef storageStyle fill:#fce4ec,stroke:#c2185b,stroke-width:2px
classDef apiStyle fill:#e3f2fd,stroke:#1565c0,stroke-width:2px
classDef mcpStyle fill:#e0f2f1,stroke:#00695c,stroke-width:2px
classDef agenticStyle fill:#e8eaf6,stroke:#283593,stroke-width:2px
classDef externalStyle fill:#f3e5f5,stroke:#6a1b9a,stroke-width:2px,stroke-dasharray: 5 5
class R1,R2,RL routeStyle
class C_Sidebar,C_Screen,C_Form,C_Messages,C_Message,C_MessageEditForm,C_ModelsSelector,C_Settings componentStyle
class C_Sidebar,C_Screen,C_Form,C_Messages,C_Message,C_ChatMessageAgenticContent,C_MessageEditForm,C_ModelsSelector,C_Settings componentStyle
class C_McpSettings,C_McpResourceBrowser,C_McpServersSelector componentStyle
class H1,H2 hookStyle
class S1,S2,S3,S4,S5 storeStyle
class SV1,SV2,SV3,SV4,SV5 serviceStyle
class S1,S2,S3,S4,S5,SA,S6,S7 storeStyle
class SV1,SV2,SV3,SV4,SV5,SV6 serviceStyle
class ST1,ST2 storageStyle
class API1,API2,API3,API4 apiStyle
class EXT1,EXT2 externalStyle
```
Loading
Loading