diff --git a/tools/agent-transport.mjs b/tools/agent-transport.mjs index 5f7c54e..755eda8 100644 --- a/tools/agent-transport.mjs +++ b/tools/agent-transport.mjs @@ -810,10 +810,6 @@ function resolveOptionPath(path) { return resolve(process.cwd(), path); } -function ensureTrailingSlash(value) { - return value.endsWith("/") ? value : `${value}/`; -} - function runNodeJson(args, cwd) { const result = spawnSync(process.execPath, args, { cwd, diff --git a/tools/bifrost-bridge.mjs b/tools/bifrost-bridge.mjs index 1e872e6..5b4179b 100644 --- a/tools/bifrost-bridge.mjs +++ b/tools/bifrost-bridge.mjs @@ -1302,42 +1302,6 @@ function rejectRemovedHttpBridgeConfig(options) { } } -async function postBridgeJson(baseUrl, token, path, payload, allowedStatuses) { - const url = new URL(path, ensureTrailingSlash(baseUrl)); - const response = await fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - "X-Bifrost-Bridge-Token": token, - }, - body: payload === undefined ? undefined : JSON.stringify(payload), - }); - - const text = await response.text(); - let body = null; - if (text) { - try { - body = JSON.parse(text); - } catch { - body = null; - } - } - - if (!allowedStatuses.has(response.status)) { - throw new Error(`Bifrost bridge call to ${path} failed with ${response.status}: ${text}`); - } - - return { - status: response.status, - text, - body, - }; -} - -function ensureTrailingSlash(value) { - return value.endsWith("/") ? value : `${value}/`; -} - function detectGitHubRepositoryFullName(options, repoRoot) { const result = runGitHubCli( options, diff --git a/tools/dispatch-agent-requests.mjs b/tools/dispatch-agent-requests.mjs index 2376641..ca474f8 100644 --- a/tools/dispatch-agent-requests.mjs +++ b/tools/dispatch-agent-requests.mjs @@ -849,42 +849,6 @@ async function beginDispatchRun(request, input) { return null; } -async function postDispatchRunJson(baseUrl, token, path, payload, allowedStatuses) { - const url = new URL(path, ensureTrailingSlash(baseUrl)); - const response = await fetch(url, { - method: "POST", - headers: { - "Content-Type": "application/json", - "X-Bifrost-Bridge-Token": token, - }, - body: JSON.stringify(payload), - }); - - const text = await response.text(); - let body = null; - if (text) { - try { - body = JSON.parse(text); - } catch { - body = null; - } - } - - if (!allowedStatuses.has(response.status)) { - throw new Error(`Bifrost dispatch run call to ${path} failed with ${response.status}: ${text}`); - } - - return { - status: response.status, - text, - body, - }; -} - -function ensureTrailingSlash(value) { - return value.endsWith("/") ? value : `${value}/`; -} - function summarizeError(error) { if (error instanceof Error) { return error.stack ?? error.message; diff --git a/tools/governance-threads.mjs b/tools/governance-threads.mjs index f2c34d5..52f7bdb 100644 --- a/tools/governance-threads.mjs +++ b/tools/governance-threads.mjs @@ -917,10 +917,6 @@ function resolveOptionPath(path) { return resolve(process.cwd(), path); } -function ensureTrailingSlash(value) { - return value.endsWith("/") ? value : `${value}/`; -} - function printJson(value) { process.stdout.write(`${JSON.stringify(value, null, 2)}\n`); }