MCPcopy Create free account
hub / github.com/EvoMap/evolver / readProxySnapshots

Function readProxySnapshots

src/webui/observer/interactions.js:33–53  ·  view source on GitHub ↗
(baseUrl)

Source from the content-addressed store, hash-verified

31}
32
33async function readProxySnapshots(baseUrl) {
34 const endpoints = {
35 status: '/proxy/status',
36 hubStatus: '/proxy/hub-status',
37 taskMetrics: '/task/metrics',
38 assetSubmissions: '/asset/submissions?limit=20',
39 sessions: '/session/list?limit=20',
40 dms: '/dm/list?limit=20',
41 atpPolicy: '/atp/policy',
42 atpProofs: '/atp/proofs?limit=20',
43 };
44 // Issue all proxy requests concurrently. Sequential await meant the
45 // worst-case (every endpoint timing out at 1500ms each) blocked the
46 // /webui/interactions response for ~12s; parallel keeps it ~1.5s.
47 const entries = await Promise.all(
48 Object.entries(endpoints).map(async ([key, endpoint]) =>
49 [key, await requestJson(baseUrl + endpoint)],
50 ),
51 );
52 return redactValue(Object.fromEntries(entries));
53}
54
55function requestJson(url) {
56 return new Promise((resolve) => {

Callers 1

getInteractionsFunction · 0.85

Calls 2

requestJsonFunction · 0.85
redactValueFunction · 0.85

Tested by

no test coverage detected