Sonde v1.1.0
Embeddable Model Context Protocol server for Qt applications
Loading...
Searching...
No Matches
anonymous_namespace{main.cpp} Namespace Reference

Classes

class  Arguments
 Arguments for a tool, drawn from its schema (design 0029, decision 1). More...
class  Client
 An MCP client that checks what comes back (invariants 2 and 3). More...
class  ClientsDialog
 The connected assistants, with a Disconnect button. More...
class  DialogAsker
 Asks the user with dialogs. More...
class  HttpClient
 A client over Streamable HTTP: a session, requests as POSTs, an optional SSE stream. More...
class  LocalClient
 A client on the local socket: newline-delimited JSON. More...
class  Log
 The last operations, for the failure report. More...
class  MainWindow
 The notebook's window. More...
struct  Pending
 One request in flight. More...
class  Random
 The seeded source of every random choice. More...
class  Run
 One run: a world, a server, clients, and the steps. More...
struct  Verdict
 What went wrong, if anything: the first violation ends the run. More...
class  World
 The application the tools look at, and the changes made to it (the mutator). More...

Functions

Options takeOptions (QStringList &args)
 Takes the options before the command off the front of args.
int runExternal (const QString &command, const QStringList &rest)
 Runs sonde-<command> from PATH with rest, as git does, and returns its exit status.
bool isApplicationCommand (const QString &command)
 Whether command runs or watches the application, or says its endpoints.
void applicationCommand (const Options &options, const QString &command, const QStringList &rest)
 sonde start, restart, stop, status, log or endpoint, with the arguments after it in rest, on the project of options.
int run (QStringList args)
 Runs the command in args (the arguments after the program's name).
void filterQtMessages (QtMsgType type, const QMessageLogContext &context, const QString &message)
 Passes Qt's messages on, except its own about how logging is set up: with QT_LOGGING_DEBUG in the environment (meant for the application, which sonde starts with the same environment), they would mix with sonde's output.
QString clientLabel (const QString &name, const QString &version)
 "name version" of a client, as it says, or "An unnamed client".
QString peerLabel (const Sonde::SessionPeer &peer)
 What the operating system says about a client, for a person to read.
bool callable (const QString &tool)
 Whether the driver may call tool: not the ones that write files into the libraries.

Variables

QtMessageHandler g_previousHandler = nullptr
 The message handler in place before ours.
constexpr qint64 kResponseTimeoutMs = 20000
 How long a request may go unanswered before it counts as lost.
constexpr std::size_t kLogLines = 200
 Lines of the operation log printed on a failure.
const QStringList kAgentQml
 QML for agent windows the driver opens.

Function Documentation

◆ runExternal()

int anonymous_namespace{main.cpp}::runExternal ( const QString & command,
const QStringList & rest )

Runs sonde-<command> from PATH with rest, as git does, and returns its exit status.

Fails if there is none.

Variable Documentation

◆ kAgentQml

const QStringList anonymous_namespace{main.cpp}::kAgentQml
Initial value:
{
QStringLiteral("import QtQuick\nRectangle { width: 120; height: 60; color: 'teal' }"),
QStringLiteral("import QtQuick\nItem { width: 100; height: 50; Text { text: 'chaos' } }"),
QStringLiteral(
"import QtQuick\nItem { Connections { target: sonde; function onEvent(e) {} } }"),
QStringLiteral("import QtQuick\nItem { width: 50; height: 50; Timer { interval: 5; running: "
"true; repeat: true } }"),
}

QML for agent windows the driver opens.