@productbrain/mcp 0.0.1-beta.9452 → 0.0.1-beta.9464
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-NCTCZQHK.js → chunk-BCQ7KBLE.js} +2 -2
- package/dist/{chunk-Q77SFDBZ.js → chunk-FVH3B7MF.js} +24 -10
- package/dist/{chunk-Q77SFDBZ.js.map → chunk-FVH3B7MF.js.map} +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/http.js +51 -54
- package/dist/http.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{setup-6UYW6XKO.js → setup-YETABTTN.js} +2 -2
- package/package.json +1 -1
- /package/dist/{chunk-NCTCZQHK.js.map → chunk-BCQ7KBLE.js.map} +0 -0
- /package/dist/{setup-6UYW6XKO.js.map → setup-YETABTTN.js.map} +0 -0
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
trackQualityVerdict,
|
|
44
44
|
trackSessionCaptureRate,
|
|
45
45
|
trackZeroCaptureAuditFired
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-FVH3B7MF.js";
|
|
47
47
|
|
|
48
48
|
// src/server.ts
|
|
49
49
|
import { McpServer as McpServer2 } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
@@ -13544,4 +13544,4 @@ export {
|
|
|
13544
13544
|
createProductBrainServer,
|
|
13545
13545
|
initFeatureFlags
|
|
13546
13546
|
};
|
|
13547
|
-
//# sourceMappingURL=chunk-
|
|
13547
|
+
//# sourceMappingURL=chunk-BCQ7KBLE.js.map
|
|
@@ -1086,22 +1086,34 @@ function parseFallbackUrls(raw) {
|
|
|
1086
1086
|
if (!raw) return [];
|
|
1087
1087
|
return raw.split(",").map((u) => u.trim()).filter(Boolean);
|
|
1088
1088
|
}
|
|
1089
|
-
async function
|
|
1090
|
-
|
|
1089
|
+
async function checkKeyAgainstCandidates(candidates, apiKey, timeoutMs) {
|
|
1090
|
+
let rejections = 0;
|
|
1091
|
+
for (const url of candidates) {
|
|
1092
|
+
let data;
|
|
1091
1093
|
try {
|
|
1092
|
-
const
|
|
1094
|
+
const res = await fetch(`${url}/api/key-check`, {
|
|
1093
1095
|
method: "POST",
|
|
1094
1096
|
headers: { "Authorization": `Bearer ${apiKey}`, "Content-Type": "application/json" },
|
|
1095
|
-
signal: AbortSignal.timeout(
|
|
1097
|
+
signal: AbortSignal.timeout(timeoutMs)
|
|
1096
1098
|
});
|
|
1097
|
-
if (
|
|
1098
|
-
|
|
1099
|
-
if (data.ok) return candidate;
|
|
1100
|
-
}
|
|
1099
|
+
if (!res.ok) continue;
|
|
1100
|
+
data = await res.json();
|
|
1101
1101
|
} catch {
|
|
1102
|
+
continue;
|
|
1103
|
+
}
|
|
1104
|
+
if (data?.ok === true) {
|
|
1105
|
+
return { verdict: "ok", url, deploymentUrl: data.deploymentUrl ?? url, workspaceName: data.workspaceName };
|
|
1102
1106
|
}
|
|
1107
|
+
if (data?.ok === false && data.error === "rate_limited") {
|
|
1108
|
+
return { verdict: "rate_limited", url, deploymentUrl: url, retryAfterSeconds: data.retryAfterSeconds };
|
|
1109
|
+
}
|
|
1110
|
+
if (data?.ok === false && data.error === "invalid_key") rejections++;
|
|
1103
1111
|
}
|
|
1104
|
-
return
|
|
1112
|
+
return candidates.length > 0 && rejections === candidates.length ? { verdict: "rejected" } : { verdict: "unreachable" };
|
|
1113
|
+
}
|
|
1114
|
+
async function probeDeploymentCandidates(candidates, apiKey) {
|
|
1115
|
+
const result = await checkKeyAgainstCandidates(candidates, apiKey, 3e3);
|
|
1116
|
+
return result.verdict === "ok" || result.verdict === "rate_limited" ? result.url : null;
|
|
1105
1117
|
}
|
|
1106
1118
|
|
|
1107
1119
|
// src/client.ts
|
|
@@ -1651,6 +1663,8 @@ export {
|
|
|
1651
1663
|
classifyError,
|
|
1652
1664
|
retryIsFutile,
|
|
1653
1665
|
warnOnProdFallthrough,
|
|
1666
|
+
parseFallbackUrls,
|
|
1667
|
+
checkKeyAgainstCandidates,
|
|
1654
1668
|
getConversationId,
|
|
1655
1669
|
runWithToolContext,
|
|
1656
1670
|
DEFAULT_CLOUD_URL,
|
|
@@ -1681,4 +1695,4 @@ export {
|
|
|
1681
1695
|
appUrl,
|
|
1682
1696
|
apiKeysUrl
|
|
1683
1697
|
};
|
|
1684
|
-
//# sourceMappingURL=chunk-
|
|
1698
|
+
//# sourceMappingURL=chunk-FVH3B7MF.js.map
|