@productbrain/mcp 0.0.1-beta.9534 → 0.0.1-beta.9550
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-HOSGKIO6.js → chunk-J2ZAJCHH.js} +3 -3
- package/dist/{chunk-HOSGKIO6.js.map → chunk-J2ZAJCHH.js.map} +1 -1
- package/dist/{chunk-APQ2MKVQ.js → chunk-J5MP5CNG.js} +573 -563
- package/dist/chunk-J5MP5CNG.js.map +1 -0
- package/dist/cli/index.js +1 -1
- package/dist/http.js +14 -5
- package/dist/http.js.map +1 -1
- package/dist/index.js +2 -2
- package/dist/{setup-3SIP3VMW.js → setup-5E7IYWVN.js} +3 -3
- package/dist/{setup-3SIP3VMW.js.map → setup-5E7IYWVN.js.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-APQ2MKVQ.js.map +0 -1
package/dist/cli/index.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// src/cli/index.ts
|
|
4
4
|
var subcommand = process.argv[2];
|
|
5
5
|
if (subcommand === "setup") {
|
|
6
|
-
const { runSetup } = await import("../setup-
|
|
6
|
+
const { runSetup } = await import("../setup-5E7IYWVN.js");
|
|
7
7
|
await runSetup();
|
|
8
8
|
} else {
|
|
9
9
|
await import("../index.js");
|
package/dist/http.js
CHANGED
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
SERVER_VERSION,
|
|
3
3
|
createProductBrainServer,
|
|
4
4
|
initFeatureFlags
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-J5MP5CNG.js";
|
|
6
6
|
import {
|
|
7
7
|
DEFAULT_CLOUD_URL,
|
|
8
8
|
apiKeysUrl,
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
parseFallbackUrls,
|
|
17
17
|
runWithAuth,
|
|
18
18
|
shutdownAnalytics
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-J2ZAJCHH.js";
|
|
20
20
|
|
|
21
21
|
// src/http.ts
|
|
22
22
|
import { createHash, randomUUID } from "crypto";
|
|
@@ -299,6 +299,15 @@ function checkRegistrationRedirects(redirectUris, allowlist) {
|
|
|
299
299
|
}
|
|
300
300
|
|
|
301
301
|
// src/lib/oauthAuthCode.ts
|
|
302
|
+
function normalisePastedKey(raw) {
|
|
303
|
+
if (typeof raw !== "string") return "";
|
|
304
|
+
const trimmed = raw.trim();
|
|
305
|
+
const first = trimmed[0];
|
|
306
|
+
if (trimmed.length >= 2 && (first === '"' || first === "'" || first === "`") && trimmed.endsWith(first)) {
|
|
307
|
+
return trimmed.slice(1, -1).trim();
|
|
308
|
+
}
|
|
309
|
+
return trimmed;
|
|
310
|
+
}
|
|
302
311
|
function pendingCodeRefusal(pending, redirectUri, now) {
|
|
303
312
|
if (!pending) return "unknown_code";
|
|
304
313
|
if (pending.redirectUri !== redirectUri) return "redirect_mismatch";
|
|
@@ -939,7 +948,6 @@ ${cmdScript}
|
|
|
939
948
|
e.preventDefault();
|
|
940
949
|
var v=k.value.trim();
|
|
941
950
|
if(!v){iw.classList.add('has-error');hint.classList.add('is-error');hint.textContent='Paste your key first';hint.removeAttribute('hidden');return}
|
|
942
|
-
if(v.indexOf('pb_sk_')!==0){iw.classList.add('has-error');hint.classList.add('is-error');hint.textContent='Key must start with pb_sk_';hint.removeAttribute('hidden');return}
|
|
943
951
|
sb.disabled=true;bt.textContent='Verifying';
|
|
944
952
|
show(pVerify);
|
|
945
953
|
|
|
@@ -1018,7 +1026,8 @@ app.post(
|
|
|
1018
1026
|
authLimiter,
|
|
1019
1027
|
express.urlencoded({ extended: false }),
|
|
1020
1028
|
async (req, res) => {
|
|
1021
|
-
const {
|
|
1029
|
+
const { redirect_uri, code_challenge, code_challenge_method, state, client_id } = req.body;
|
|
1030
|
+
const api_key = normalisePastedKey(req.body.api_key);
|
|
1022
1031
|
const wantsJson = String(req.headers["accept"] ?? "").includes("application/json");
|
|
1023
1032
|
const retryParams = new URLSearchParams({
|
|
1024
1033
|
redirect_uri: redirect_uri ?? "",
|
|
@@ -1035,7 +1044,7 @@ app.post(
|
|
|
1035
1044
|
res.status(status).type("html").send(authorizeErrorPage(title, trustedDetailHtml, retryUrl));
|
|
1036
1045
|
}
|
|
1037
1046
|
}
|
|
1038
|
-
if (!api_key
|
|
1047
|
+
if (!api_key.startsWith("pb_sk_")) {
|
|
1039
1048
|
sendError(
|
|
1040
1049
|
"Invalid key format",
|
|
1041
1050
|
"API keys start with <code>pb_sk_</code>. Check your key and try again."
|