Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
server_p.h File Reference

Internal declarations shared by the core implementation files. More...

#include "httpparser_p.h"
#include "stacksampler_p.h"
#include <sonde/eventsource.h>
#include <sonde/server.h>
#include <sonde/stalleventsource.h>
#include <QtCore/QElapsedTimer>
#include <QtCore/QJsonArray>
#include <QtCore/QJsonDocument>
#include <QtCore/QHash>
#include <QtCore/QMap>
#include <QtCore/QPointer>
#include <QtCore/QRegularExpression>
#include <QtCore/QSet>
#include <QtCore/QThread>
#include <QtCore/QTimer>
#include <atomic>
#include <deque>
#include <functional>
#include <memory>
#include <mutex>

Go to the source code of this file.

Classes

class  Sonde::SessionRequestPrivate
 Shared state behind SessionRequest handles (design 0033). More...
struct  Sonde::Session
 State of one MCP session (one local connection, or one HTTP Mcp-Session-Id). More...
 Shared state behind ToolCall handles. More...
class  Sonde::ToolCallPrivate
 The shared state of one tool call. More...
struct  Sonde::EventFilter
 Filter shared by event_read and event_wait. More...
class  Sonde::EventBuffer
 The event buffer and the event_wait waiters. More...
struct  Sonde::EventBuffer::Waiter
 A pending event_wait call. More...
struct  Sonde::EventBuffer::Match
 A waiter that matched, with the events to answer it with. More...
struct  Sonde::EventBuffer::Pending
 Work for the sessions' thread, taken by takePending(). More...
struct  Sonde::Catalog
 What dispatch needs to know about the registries, as an immutable snapshot. More...
class  Sonde::ServerPrivate
 Implementation of Server: registries, sessions, dispatch and events. More...
struct  Sonde::ServerPrivate::ToolEntry
 A registered tool. More...
struct  Sonde::ServerPrivate::ResourceEntry
 A registered resource. More...
class  Sonde::HttpTransport
 MCP Streamable HTTP transport on a QTcpServer (httptransport.cpp). More...
class  Sonde::LocalTransport
 Newline-delimited JSON-RPC over a QLocalServer (localtransport.cpp). More...

Namespaces

namespace  Sonde
 Embeddable Model Context Protocol server for Qt applications.
namespace  Sonde::JsonRpc
 JSON-RPC 2.0 message helpers.

Typedefs

using Sonde::ReplyFunction = std::function<void(const QJsonObject &response)>
 Delivers the response to one request.
using Sonde::NotifyFunction = std::function<void(const QJsonObject &message)>
 Delivers a server-to-client message on a session's stream.
using Sonde::SessionPtr = std::shared_ptr<Session>
 Sessions are shared between the registry and in-flight calls.

Enumerations

enum  Sonde::JsonRpc::ErrorCode {
  Sonde::JsonRpc::ParseError = -32700 , Sonde::JsonRpc::InvalidRequest = -32600 , Sonde::JsonRpc::MethodNotFound = -32601 , Sonde::JsonRpc::InvalidParams = -32602 ,
  Sonde::JsonRpc::InternalError = -32603 , Sonde::JsonRpc::NotAdmitted = -32002
}
 Standard JSON-RPC error codes. More...

Functions

QString Sonde::jsonText (const QJsonValue &value)
 value as compact JSON text, e.g. "abc", 42 or {"x":1}.
QJsonObject Sonde::JsonRpc::result (const QJsonValue &id, const QJsonValue &result)
 A success response.
QJsonObject Sonde::JsonRpc::error (const QJsonValue &id, int code, const QString &message, const QJsonValue &data={ })
 An error response (a missing id becomes null).
QJsonObject Sonde::JsonRpc::notification (const QString &method, const QJsonObject &params)
 A notification; params are omitted when empty.
bool Sonde::JsonRpc::isRequest (const QJsonObject &message)
 Whether message is a request (has both method and id).
bool Sonde::JsonRpc::expectsResponse (const QJsonObject &message)
 Whether message must be answered: it has an id and is not itself a response.

Detailed Description

Internal declarations shared by the core implementation files.

Not part of the public API.