mirror of
https://github.com/lightpanda-io/browser.git
synced 2026-03-31 01:28:55 +00:00
mcp: inline mcpVersion helper from Config
This commit is contained in:
@@ -189,12 +189,6 @@ pub fn webBotAuth(self: *const Config) ?WebBotAuthConfig {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn mcpVersion(self: *const Config) []const u8 {
|
|
||||||
return switch (self.mode) {
|
|
||||||
.mcp => |opts| @tagName(opts.version),
|
|
||||||
else => @tagName(mcp.Version.default),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn maxConnections(self: *const Config) u16 {
|
pub fn maxConnections(self: *const Config) u16 {
|
||||||
return switch (self.mode) {
|
return switch (self.mode) {
|
||||||
|
|||||||
@@ -81,8 +81,12 @@ pub fn handleMessage(server: *Server, arena: std.mem.Allocator, msg: []const u8)
|
|||||||
|
|
||||||
fn handleInitialize(server: *Server, req: protocol.Request) !void {
|
fn handleInitialize(server: *Server, req: protocol.Request) !void {
|
||||||
const id = req.id orelse return;
|
const id = req.id orelse return;
|
||||||
|
const version: protocol.Version = switch (server.app.config.mode) {
|
||||||
|
.mcp => |opts| opts.version,
|
||||||
|
else => .default,
|
||||||
|
};
|
||||||
const result: protocol.InitializeResult = .{
|
const result: protocol.InitializeResult = .{
|
||||||
.protocolVersion = server.app.config.mcpVersion(),
|
.protocolVersion = @tagName(version),
|
||||||
.capabilities = .{
|
.capabilities = .{
|
||||||
.resources = .{},
|
.resources = .{},
|
||||||
.tools = .{},
|
.tools = .{},
|
||||||
|
|||||||
Reference in New Issue
Block a user