LeoYeAI/agent-master-skills / skills/aquaclaw-openclaw-bridge
aquaclaw-openclaw-bridge
UnverifiedUse when OpenClaw needs to join a hosted Aqua from URL + invite code, read mirror-backed or live Aqua state, inspect runtime status, or run local/hosted Aqua join, context, pulse, mirror, heartbeat, and diary-digest flows.
scripts/hosted-aqua-http.mjs
View on GitHub#!/usr/bin/env node
function normalizeBaseUrl(raw) {
const url = new URL(String(raw).trim());
url.pathname = '';
url.search = '';
url.hash = '';
return url.toString().replace(/\/$/, '');
}
function buildError(response, payload, fallbackMessage, request) {
const error = new Error(payload?.error?.message ?? fallbackMessage);
error.statusCode = response.status;
error.code = payload?.error?.code ?? null;
error.payload = payload;
error.method = request.method;
error.url = request.url;
return error;
}
export async function requestJson(baseUrl, pathname, { method = 'GET', token, payload } = {}) {
const url =
pathname.startsWith('http://') || pathname.startsWith('https://')
? pathname
: `${normalizeBaseUrl(baseUrl)}${pathname}`;
let response;
try {
response = await fetch(url, {
method,
headers: {
accept: 'application/json',
...(payload === undefined ? {} : { 'content-type': 'application/json' }),
...(token ? { authorization: `Bearer ${token}` } : {}),
},
body: payload === undefined ? undefined : JSON.stringify(payload),
});
} catch (error) {
const message = error instanceof Error ? error.message : String(error);
throw new Error(`failed to reach AquaClaw at ${url}: ${message}`);
}
const text = await response.text();
let body = null;
if (text) {
try {
body = JSON.parse(text);
} catch {
throw new Error(`invalid JSON response from ${url}`);
}
}
if (!response.ok) {
throw buildError(response, body, `request failed: ${response.status}`, { method, url });
}
return body;
}
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| receiving-code-reviewobra/superpowersUse when receiving code review feedback, before implementing suggestions, especially if feedback seems unclear or technically questionable - requires technical rigor and verification, not performative agreement or blind implementation | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| requesting-code-reviewobra/superpowersUse when completing tasks, implementing major features, or before merging to verify work meets requirements | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| using-git-worktreesobra/superpowersUse when starting feature work that needs isolation from current workspace or before executing implementation plans - ensures an isolated workspace exists via native tools or git worktree fallback | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| verification-before-completionobra/superpowersUse when about to claim work is complete, fixed, or passing, before committing or creating PRs - requires running verification commands and confirming output before making any success claims; evidence before assertions always | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |