...
This commit is contained in:
@@ -16,35 +16,31 @@ pub:
|
||||
// new_server creates a new MCP server
|
||||
pub fn new_server(backend Backend, params ServerParams) !&Server {
|
||||
mut server := &Server{
|
||||
ServerConfiguration: params.config,
|
||||
backend: backend,
|
||||
ServerConfiguration: params.config
|
||||
backend: backend
|
||||
}
|
||||
|
||||
// Create a handler with the core MCP procedures registered
|
||||
handler := jsonrpc.new_handler(jsonrpc.Handler{
|
||||
procedures: {
|
||||
...params.handlers,
|
||||
//...params.handlers,
|
||||
// Core handlers
|
||||
'initialize': server.initialize_handler,
|
||||
'notifications/initialized': initialized_notification_handler,
|
||||
|
||||
'initialize': server.initialize_handler
|
||||
'notifications/initialized': initialized_notification_handler
|
||||
// Resource handlers
|
||||
'resources/list': server.resources_list_handler,
|
||||
'resources/read': server.resources_read_handler,
|
||||
'resources/templates/list': server.resources_templates_list_handler,
|
||||
'resources/subscribe': server.resources_subscribe_handler,
|
||||
|
||||
'resources/list': server.resources_list_handler
|
||||
'resources/read': server.resources_read_handler
|
||||
'resources/templates/list': server.resources_templates_list_handler
|
||||
'resources/subscribe': server.resources_subscribe_handler
|
||||
// Prompt handlers
|
||||
'prompts/list': server.prompts_list_handler,
|
||||
'prompts/get': server.prompts_get_handler,
|
||||
'completion/complete': server.prompts_get_handler,
|
||||
|
||||
'prompts/list': server.prompts_list_handler
|
||||
'prompts/get': server.prompts_get_handler
|
||||
'completion/complete': server.prompts_get_handler
|
||||
// Tool handlers
|
||||
'tools/list': server.tools_list_handler,
|
||||
'tools/call': server.tools_call_handler,
|
||||
|
||||
'tools/list': server.tools_list_handler
|
||||
'tools/call': server.tools_call_handler
|
||||
// Sampling handlers
|
||||
'sampling/createMessage': server.sampling_create_message_handler
|
||||
'sampling/createMessage': server.sampling_create_message_handler
|
||||
}
|
||||
})!
|
||||
|
||||
|
||||
@@ -3,11 +3,11 @@ module rhai
|
||||
import log
|
||||
import freeflowuniverse.herolib.ai.escalayer
|
||||
|
||||
pub struct WrapperGenerator {
|
||||
pub:
|
||||
function string
|
||||
structs []string
|
||||
}
|
||||
// pub struct WrapperGenerator {
|
||||
// pub:
|
||||
// function string
|
||||
// structs []string
|
||||
// }
|
||||
|
||||
// generate_rhai_function_wrapper generates a Rhai wrapper function for a given Rust function.
|
||||
//
|
||||
Reference in New Issue
Block a user