9#include <QtCore/QJsonObject>
10#include <QtCore/QList>
11#include <QtCore/QString>
12#include <QtCore/QStringList>
22QString
realPath(
const QString &path);
34std::optional<QString>
applicationPath(
const QJsonObject &config,
const QString &root);
52 Endpoints(
const QJsonObject &config,
const QString &root);
67 bool learnPort(std::optional<qint64> pid = std::nullopt);
73 void write(
const QString &path)
const;
91 std::optional<std::pair<quint16, quint16>>
m_range;
QString local() const
The local socket's name, or an empty string for none.
Definition endpoints.h:80
quint16 m_port
See port().
Definition endpoints.h:90
bool learnPort(std::optional< qint64 > pid=std::nullopt)
Asks the running copy which port it took (design 0019).
Definition endpoints.cpp:330
void write(const QString &path) const
Writes them to path (endpoint.json), as the Python sonde did.
Definition endpoints.cpp:376
QString m_local
See local().
Definition endpoints.h:89
std::optional< std::pair< quint16, quint16 > > m_range
See portRange().
Definition endpoints.h:91
QString m_instance
See instance().
Definition endpoints.h:87
QString instance() const
The instance key, or an empty string if the executable wasn't found.
Definition endpoints.h:76
bool m_confirmed
Whether a running copy said m_port is its port.
Definition endpoints.h:92
std::optional< QString > executable() const
The executable's canonical path, or nothing if it wasn't found.
Definition endpoints.h:78
std::optional< QString > m_executable
See executable().
Definition endpoints.h:88
QString url() const
The MCP URL on the port, or an empty string if there is no port.
Definition endpoints.cpp:313
quint16 port() const
The HTTP port (with {instance}, the first choice until learnPort()), or 0.
Definition endpoints.h:82
QStringList describe() const
The endpoints, as sonde names them in its output.
Definition endpoints.cpp:366
std::optional< std::pair< quint16, quint16 > > portRange() const
The range {instance} chooses from, or nothing without {instance}.
Definition endpoints.h:84
QList< quint16 > candidatePorts() const
The ports the application may have taken: its first choice, then the rest of the range.
Definition endpoints.cpp:318
Endpoints(const QJsonObject &config, const QString &root)
The endpoints of config, whose paths are relative to root.
Definition endpoints.cpp:269
std::optional< QJsonObject > appInfoOverHttp(quint16 port)
app_info's structured result from the Sonde server on port port, or nothing.
Definition endpoints.cpp:219
bool httpReady(quint16 port)
Whether something accepts connections on port port of 127.0.0.1.
Definition endpoints.cpp:209
std::optional< QJsonObject > appInfoOverSocket(const QString &name)
app_info's structured result from the Sonde server on local socket name, or nothing.
Definition endpoints.cpp:238
void showEndpoint(const QJsonObject &config, const Project &project)
sonde endpoint: prints this checkout's endpoints, and writes endpoint.json.
Definition endpoints.cpp:397
QString realPath(const QString &path)
path absolute, with links resolved, as Python's os.path.realpath() gives it: canonical if it exists,...
Definition endpoints.cpp:140
QString resolveProgram(const QString &name, const QString &root)
The program name refers to, from root or PATH, or an empty string.
Definition endpoints.cpp:160
QString bundleBinary(const QString &path)
The executable inside the macOS application bundle path (a directory ending in .app),...
Definition endpoints.cpp:180
std::optional< QString > applicationPath(const QJsonObject &config, const QString &root)
The application's canonical path, as the application sees it, or nothing if it can't be found: "execu...
Definition endpoints.cpp:201
A project's files under .sonde/, and its configuration (design 0028).
Where a project keeps its files: .sonde/ at its root.
Definition project.h:16