From a2bd5985572d71492e7652b9e6c895eab5eeab67 Mon Sep 17 00:00:00 2001 From: davida-ps Date: Mon, 16 Feb 2026 09:00:52 +0000 Subject: [PATCH] fix(lint): use globalThis fetch/AbortController in catalog script --- .../clawsec-suite/scripts/discover_skill_catalog.mjs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/skills/clawsec-suite/scripts/discover_skill_catalog.mjs b/skills/clawsec-suite/scripts/discover_skill_catalog.mjs index 36d9ec4..198d232 100644 --- a/skills/clawsec-suite/scripts/discover_skill_catalog.mjs +++ b/skills/clawsec-suite/scripts/discover_skill_catalog.mjs @@ -174,11 +174,18 @@ function mergeWithFallbackMetadata(remoteSkills, fallbackSkills) { } async function loadRemoteCatalog(indexUrl, timeoutMs) { - const controller = new AbortController(); + if (typeof globalThis.fetch !== "function") { + throw new Error("fetch is unavailable in this runtime"); + } + if (typeof globalThis.AbortController !== "function") { + throw new Error("AbortController is unavailable in this runtime"); + } + + const controller = new globalThis.AbortController(); const timeout = setTimeout(() => controller.abort(), timeoutMs); try { - const response = await fetch(indexUrl, { + const response = await globalThis.fetch(indexUrl, { method: "GET", headers: { Accept: "application/json" }, signal: controller.signal,