Files
moloapp/src/google/sandbox/sandbox_service.h
T
retoorandClaude Sonnet 5.5 1c3fbe1899 feat(clients): sandbox: data plane (JWT proxy, CDP WebSocket), operations, SDK chunk shapes
Data plane per the computer use quickstart and SDK 2.6.0 source: signJwt
minted JWT, /cdp /tabs /cdp_ws_endpoint over HTTP with routing headers, CDP
over the live WsClient with capped reconnect. Operations methods wrapped,
input/output chunk shapes settled from the SDK, ComputerUse moved off execute.
Execution paths remain verified by Discovery, docs and SDK only.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 05:30:44 +02:00

43 lines
1.5 KiB
C++

#pragma once
// Base for every sandbox service: the v1beta1 aiplatform endpoint of the
// sandbox's own location, name validation, and the one execute call that
// code, shell, workspace and computer use all share.
#include <memory>
#include <string>
#include <vector>
#include "google/service.h"
#include "google/sandbox/chunk.h"
#include "google/sandbox/names.h"
namespace molo::google::sandbox {
class SandboxService : public Service {
public:
explicit SandboxService(std::shared_ptr<GoogleClient> client);
// Points every call at `base` (scheme://host[:port], no path) instead of
// https://{location}-aiplatform.googleapis.com. For tests against a local
// server and for proxies; empty restores the default. Only http(s) URLs.
void use_base_url(const std::string& base);
protected:
// https://{location}-aiplatform.googleapis.com/v1 (every call but bidiExecute).
ServiceEndpoint endpoint_in(const std::string& location) const;
// .../v1beta1: bidiExecute exists only there (see calls.h).
ServiceEndpoint beta_endpoint_in(const std::string& location) const;
// POST {sandbox}:execute with the given inputs; returns the raw reply.
clients::body::Json execute_raw(const std::string& sandbox_name,
const std::vector<Chunk>& inputs) const;
ExecutionResult execute(const std::string& sandbox_name,
const std::vector<Chunk>& inputs) const;
private:
std::string base_url_;
};
} // namespace molo::google::sandbox