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

sonde bridge: an MCP client's stdio connection to this checkout's application, or to one in a container (--docker). More...

#include "bridgecommand.h"
#include "commands.h"
#include "arguments.h"
#include "bridge.h"
#include "common.h"
#include "endpoints.h"
#include "project.h"
#include "replaceprocess.h"
#include <QtCore/QDir>
#include <QtCore/QProcess>
#include <QtCore/QRegularExpression>
#include <QtCore/QStandardPaths>
#include <QtCore/QThread>
#include <cstdio>
#include <cstdlib>
#include <optional>

Namespaces

namespace  Sonde
 Embeddable Model Context Protocol server for Qt applications.

Functions

QStringList Sonde::Cli::anonymous_namespace{bridgecommand.cpp}::dockerPs (const QString &filter)
 The IDs of the running containers that pass docker ps filter filter (all of them if it is empty).
bool Sonde::Cli::anonymous_namespace{bridgecommand.cpp}::hasSocket (const QString &id, const QString &socket)
 Whether a local socket socket exists in container id, where the application would create it: as given if it is a path, else in the container's temporary directory, as QLocalServer does.
QStringList Sonde::Cli::anonymous_namespace{bridgecommand.cpp}::findContainers (const QString &target, const QString &socket)
 The running containers that target names: "auto" (those where socket exists), a docker ps filter (anything with '=', such as label=KEY=VALUE or ancestor=IMAGE), or a name or an id.
void Sonde::Cli::anonymous_namespace{bridgecommand.cpp}::dockerBridge (const QString &target, const QString &socket, const QString &user, int timeout)
 Becomes docker exec -i <container> sonde-bridge --wait <socket> for the running container that target matches, waiting for one (up to timeout seconds, or for ever if 0).
void Sonde::Cli::anonymous_namespace{bridgecommand.cpp}::runBridge (const QJsonObject &config, const Project &project, const QString &local, const QString &hold)
 Runs the bridge on this checkout's socket, local, holding requests hold seconds (empty: the default) while the application is away: the program in "bridge", if set, otherwise in this process.
void Sonde::Cli::bridgeCommand (const Options &options, const QStringList &rest)
 sonde bridge with the arguments after it in rest, on the project of options.

Detailed Description

sonde bridge: an MCP client's stdio connection to this checkout's application, or to one in a container (--docker).

Function Documentation

◆ bridgeCommand()

void Sonde::Cli::bridgeCommand ( const Options & options,
const QStringList & rest )

sonde bridge with the arguments after it in rest, on the project of options.

Doesn't return: the bridge runs until its client or the application is done, and then sonde exits.