(call-remote-method context {:keys [method params] :as message})
Calls a remote method via JSON-RPC. Returns a promise which either resolves with the message's result or rejects with the message's error.
Args: context - The session context containing session state and send-message function message - Map with :method and optional :params keys
Returns: A promise that resolves to the method result or rejects with the error.
Calls a remote method via JSON-RPC. Returns a promise which either resolves with the message's result or rejects with the message's error. Args: context - The session context containing session state and send-message function message - Map with :method and optional :params keys Returns: A promise that resolves to the method result or rejects with the error.
(close-connection context)
Closes the connection if a close-connection function is available in the context.
Args: context - The session context that may contain a close-connection function
Returns: The result of calling close-connection, or nil if not available.
Closes the connection if a close-connection function is available in the context. Args: context - The session context that may contain a close-connection function Returns: The result of calling close-connection, or nil if not available.
(handle-message context)
Handles incoming JSON-RPC messages, supporting both single messages and batch requests. Routes messages to appropriate handlers and manages responses.
Args: context - The session context containing message, session, and send-message
Returns: A promise that resolves when message handling is complete.
Handles incoming JSON-RPC messages, supporting both single messages and batch requests. Routes messages to appropriate handlers and manages responses. Args: context - The session context containing message, session, and send-message Returns: A promise that resolves when message handling is complete.
(invalid-tool-name id tool-name)
Creates a JSON-RPC error response for when a tool name is invalid or unknown.
Args: id - The request ID from the original method call tool-name - The name of the tool that was invalid/unknown
Returns: A JSON-RPC error response map with invalid params error (-32602).
Creates a JSON-RPC error response for when a tool name is invalid or unknown. Args: id - The request ID from the original method call tool-name - The name of the tool that was invalid/unknown Returns: A JSON-RPC error response map with invalid params error (-32602).
(method-not-found-response id)
Creates a JSON-RPC error response for when a requested method is not found.
Args: id - The request ID from the original method call
Returns: A JSON-RPC error response map with method not found error (-32601).
Creates a JSON-RPC error response for when a requested method is not found. Args: id - The request ID from the original method call Returns: A JSON-RPC error response map with method not found error (-32601).
(notification topic)
(notification topic params)
Creates a JSON-RPC notification message.
Args: topic - The notification topic (string) params - (Optional) Parameters map to include with the notification
Returns: A JSON-RPC notification map with method set to 'notifications/<topic>'.
Creates a JSON-RPC notification message. Args: topic - The notification topic (string) params - (Optional) Parameters map to include with the notification Returns: A JSON-RPC notification map with method set to 'notifications/<topic>'.
(resource-not-found id uri)
Creates a JSON-RPC error response for when a requested resource is not found.
Args: id - The request ID from the original method call uri - The URI of the resource that was not found
Returns: A JSON-RPC error response map with resource not found error (-32002).
Creates a JSON-RPC error response for when a requested resource is not found. Args: id - The request ID from the original method call uri - The URI of the resource that was not found Returns: A JSON-RPC error response map with resource not found error (-32002).
(send-message context message)
Sends a message using the context's send-message function.
Args: context - The session context containing the send-message function message - The message to send
Returns: The result of calling the send-message function.
Sends a message using the context's send-message function. Args: context - The session context containing the send-message function message - The message to send Returns: The result of calling the send-message function.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close