MCPcopy Index your code
hub / github.com/MrgSub/opencode-debug / sendLog

Function sendLog

example/test-debug.ts:12–24  ·  view source on GitHub ↗
(label: string, data?: unknown)

Source from the content-addressed store, hash-verified

10const DEBUG_URL = `http://localhost:${DEBUG_PORT}/debug`;
11
12async function sendLog(label: string, data?: unknown): Promise<boolean> {
13 try {
14 const res = await fetch(DEBUG_URL, {
15 method: "POST",
16 headers: { "Content-Type": "application/json" },
17 body: JSON.stringify({ label, data }),
18 });
19 return res.ok;
20 } catch (err) {
21 console.error(`Failed to send log "${label}":`, err);
22 return false;
23 }
24}
25
26async function main() {
27 console.log(`Testing debug server at ${DEBUG_URL}\n`);

Callers 1

mainFunction · 0.85

Calls 1

fetchFunction · 0.70

Tested by

no test coverage detected