mirror of
https://github.com/logos-co/logos-protocol.git
synced 2026-08-31 05:51:08 +00:00
* Extract the Logos protocol layer from logos-cpp-sdk
Transports (plain TCP/TLS, qt_local, qt_remote/QRO, mock), token manager,
consumer core (LogosAPIClient/LogosAPIConsumer incl. the capability
auto-requestModule flow), ModuleProxy, the abstract LogosProviderObject
interface, and the canonical QVariant<->JSON conversion — now behind the
language-neutral lp_* C ABI (logos_protocol.h) carrying the protocol
semver (LOGOS_PROTOCOL_VERSION_*, lp_protocol_version()).
Bytes crossing the ABI use the lossless {"_bytes": base64url} tagging
(NUL-safe), matching the plain wire encoding.
Provider lp_* surface is compiled groundwork; serving lands with module
authoring.
* consumer: typed requestModule for the capability flow
Port of logos-cpp-sdk master f5a127dd ('use updated capability module',
cpp-sdk#85, Iuri Matias) — the touched files (logos_api_client.cpp,
logos_api_consumer.{h,cpp}) moved into this repo in the P1 extraction.
The capability auto-requestModule path now calls a typed std::string
helper on the consumer (which acquires the capability object directly)
instead of a stringly invokeRemoteMethod round-trip. 111/111 tests.
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
#ifndef LOGOS_PLAIN_QVARIANT_RPC_VALUE_H
|
|
#define LOGOS_PLAIN_QVARIANT_RPC_VALUE_H
|
|
|
|
// Qt ↔ plain adapter. This is THE place the plain-C++ transport tier
|
|
// touches Qt — isolated here so when Qt is eventually removed from the
|
|
// SDK interface, there's one file to delete.
|
|
|
|
#include "rpc_message.h"
|
|
#include "rpc_value.h"
|
|
|
|
#include <QByteArray>
|
|
#include <QJsonArray>
|
|
#include <QJsonObject>
|
|
#include <QJsonValue>
|
|
#include <QString>
|
|
#include <QVariant>
|
|
#include <QVariantList>
|
|
#include <QVariantMap>
|
|
|
|
namespace logos::plain {
|
|
|
|
RpcValue qvariantToRpcValue(const QVariant& v);
|
|
QVariant rpcValueToQVariant(const RpcValue& v);
|
|
|
|
std::vector<RpcValue> qvariantListToRpcList(const QVariantList& list);
|
|
QVariantList rpcListToQVariantList(const std::vector<RpcValue>& list);
|
|
|
|
// Method metadata round-trip (used for introspection).
|
|
QJsonArray methodsToJsonArray(const std::vector<MethodMetadata>& methods);
|
|
std::vector<MethodMetadata> methodsFromJsonArray(const QJsonArray& arr);
|
|
|
|
} // namespace logos::plain
|
|
|
|
#endif // LOGOS_PLAIN_QVARIANT_RPC_VALUE_H
|