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>
This commit is contained in:
@@ -31,6 +31,25 @@ int main() {
|
||||
{"/agent/sandbox/computer",
|
||||
"{\"name\":\"" + sandbox + "\",\"action\":\"navigate\",\"url\":\"https://example.com\"}"},
|
||||
{"/agent/sandbox/files", "{\"name\":\"" + sandbox + "\",\"op\":\"list\"}"},
|
||||
{"/agent/sandbox/dataplane", "{\"name\":\"" + sandbox + "\",\"action\":\"health\"}"},
|
||||
{"/agent/sandbox/dataplane",
|
||||
"{\"name\":\"" + sandbox + "\",\"action\":\"command\",\"command\":\"Page.reload\"}"},
|
||||
{"/agent/sandbox/cdp", "{\"name\":\"" + sandbox + "\",\"method\":\"Page.reload\"}"},
|
||||
{"/agent/sandbox/stream", "{\"name\":\"" + sandbox + "\",\"mode\":\"shell\",\"input\":\"echo hi\"}"},
|
||||
{"/agent/sandbox/stream", "{\"name\":\"" + sandbox + "\",\"mode\":\"code\",\"input\":\"print(1)\"}"},
|
||||
{"/agent/sandbox/operations",
|
||||
"{\"name\":\"" + sandbox + "/operations/1\",\"op\":\"get\"}"},
|
||||
{"/agent/sandbox/operations",
|
||||
"{\"name\":\"" + sandbox + "/operations/1\",\"op\":\"wait\",\"timeout\":\"5\"}"},
|
||||
{"/agent/sandbox/operations", "{\"name\":\"" + sandbox + "\",\"op\":\"list\"}"},
|
||||
{"/agent/sandbox/operations",
|
||||
"{\"name\":\"" + sandbox + "/operations/1\",\"op\":\"cancel\"}"},
|
||||
{"/agent/sandbox/resource",
|
||||
"{\"name\":\"" + engine + "/sandboxEnvironmentTemplates/7\",\"kind\":\"template\"}"},
|
||||
{"/agent/sandbox/resource",
|
||||
"{\"name\":\"" + engine + "/sandboxEnvironmentSnapshots/8\",\"kind\":\"snapshot\"}"},
|
||||
{"/agent/sandbox/template",
|
||||
"{\"engine\":\"" + engine + "\",\"display_name\":\"t\",\"category\":\"computer\"}"},
|
||||
};
|
||||
for (const Case& c : cases) {
|
||||
auto res = f.client->post(c.route, c.body, "application/json");
|
||||
@@ -40,6 +59,15 @@ int main() {
|
||||
auto del = f.client->request(molo::example::fw::Method::Delete,
|
||||
"/agent/sandbox/delete?name=" + sandbox);
|
||||
check(del.status == 503, "delete answers 503 without a credential");
|
||||
auto del_op = f.client->request(molo::example::fw::Method::Delete,
|
||||
"/agent/sandbox/operation?name=" + sandbox + "/operations/1");
|
||||
check(del_op.status == 503 && contains(del_op.body, "google_not_configured"),
|
||||
"operation delete answers 503 without a credential");
|
||||
auto del_res = f.client->request(
|
||||
molo::example::fw::Method::Delete,
|
||||
"/agent/sandbox/resource?kind=template&name=" + engine + "/sandboxEnvironmentTemplates/7");
|
||||
check(del_res.status == 503 && contains(del_res.body, "google_not_configured"),
|
||||
"template delete answers 503 without a credential");
|
||||
check(contains(del.body, "google_not_configured"), "delete names the error");
|
||||
check(rig.mock->send_count() == 0, "side effect: no upstream traffic");
|
||||
return finish("agent/sandbox/not_configured");
|
||||
|
||||
Reference in New Issue
Block a user