models: EndpointAdmin and PublisherAdmin wrap every remaining method of the owned resources (84 call table rows, 132 Discovery methods covered, v1beta1 twins, IAM, operations, responses, export, config, enableModel); planner rejects undeclared body keys; VertexModel::TurnBuilder replays model turns with every thoughtSignature; Lyria WAV mime from bytes; veo-3.1 default. runtime: v1beta1 feedbackEntries, A2A gateway (40 rpcs), a2aTasks, task store records, scoped operations, beta twin flag (103 rows, 214 methods covered); checker verifies twins, a2aEndpoint patterns and coverage. example: admin routes for both parts. SPECs: live results moved from Unverified to Verified live (Veo, Lyria, thought signatures, v1beta1 routes). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
69 lines
3.0 KiB
JavaScript
69 lines
3.0 KiB
JavaScript
// Agent Runtime page: thin client over /agent/runtime/* (all limits server side).
|
|
(function () {
|
|
"use strict";
|
|
var $ = function (id) { return document.getElementById(id); };
|
|
var out = $("rt-out"), err = $("rt-error");
|
|
|
|
function post(path, body) {
|
|
err.textContent = "";
|
|
out.textContent = "...";
|
|
return fetch(path, {
|
|
method: "POST",
|
|
headers: { "Content-Type": "application/json" },
|
|
body: JSON.stringify(body)
|
|
}).then(function (res) {
|
|
return res.text().then(function (t) {
|
|
var j;
|
|
try { j = JSON.parse(t); } catch (e) { j = { message: t }; }
|
|
if (!res.ok) {
|
|
err.textContent = j.message || ("HTTP " + res.status);
|
|
out.textContent = "";
|
|
} else {
|
|
out.textContent = JSON.stringify(j, null, 2);
|
|
}
|
|
});
|
|
}).catch(function (e) { err.textContent = String(e); out.textContent = ""; });
|
|
}
|
|
function queryBody() {
|
|
var input;
|
|
try { input = JSON.parse($("rt-input").value || "{}"); }
|
|
catch (e) { err.textContent = "Input is not valid JSON"; return null; }
|
|
return { id: $("rt-id").value.trim(), input: input, classMethod: $("rt-method").value.trim() };
|
|
}
|
|
|
|
fetch("/agent/runtime/status").then(function (r) { return r.json(); }).then(function (s) {
|
|
$("rt-config").textContent = s.configured
|
|
? "Google credential found. Location " + s.location + (s.project_set ? "." : "; set GOOGLE_CLOUD_PROJECT.")
|
|
: "No Google credential: calls answer 503 until one is configured.";
|
|
});
|
|
|
|
$("rt-list").onclick = function () { post("/agent/runtime/list", {}); };
|
|
$("rt-get").onclick = function () { post("/agent/runtime/get", { id: $("rt-id").value.trim() }); };
|
|
$("rt-query").onclick = function () { var b = queryBody(); if (b) post("/agent/runtime/query", b); };
|
|
// Body templates for the "More calls" panel: one example per route.
|
|
var templates = {
|
|
"operations": { action: "get", name: "projects/P/locations/L/reasoningEngines/E/operations/O" },
|
|
"revisions": { action: "list", id: "ENGINE_ID" },
|
|
"update": { id: "ENGINE_ID", displayName: "New name" },
|
|
"iam": { action: "get", id: "ENGINE_ID" },
|
|
"code": { id: "ENGINE_ID", inputs: [{ code: "print(1)" }] },
|
|
"async/cancel": { id: "ENGINE_ID", operation: "projects/P/locations/L/operations/O" },
|
|
"feedback": { action: "list", id: "ENGINE_ID" },
|
|
"a2a": { target: "engine", protocol: "v1", op: "card", id: "ENGINE_ID" },
|
|
"a2a/tasks": { action: "list", id: "ENGINE_ID" },
|
|
"a2a/records": { action: "list", store: "STORE_ID" }
|
|
};
|
|
function fillTemplate() {
|
|
$("rt-body").value = JSON.stringify(templates[$("rt-route").value], null, 1);
|
|
}
|
|
$("rt-route").onchange = fillTemplate;
|
|
fillTemplate();
|
|
$("rt-send").onclick = function () {
|
|
var body;
|
|
try { body = JSON.parse($("rt-body").value || "{}"); }
|
|
catch (e) { err.textContent = "Body is not valid JSON"; return; }
|
|
post("/agent/runtime/" + $("rt-route").value, body);
|
|
};
|
|
$("rt-stream").onclick = function () { var b = queryBody(); if (b) post("/agent/runtime/stream", b); };
|
|
})();
|