@recapt/mcp 0.0.17-beta → 0.0.18-beta
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.
|
@@ -9,7 +9,6 @@ import { detectInstalledIdes, addRecaptToIdeConfig, } from "../utils/ide-config.
|
|
|
9
9
|
import { confirm, secret, multiSelect, header, print, success, error, info, warn, newline, } from "../utils/prompts.js";
|
|
10
10
|
import { installAllSkills, installSelectedSkills, getAvailableSkills, } from "./skill.js";
|
|
11
11
|
const SETTINGS_URL = "https://dash.recapt.app/settings";
|
|
12
|
-
const MCP_KEY_PREFIX = "mcp_sk_";
|
|
13
12
|
function openBrowser(url) {
|
|
14
13
|
const platform = process.platform;
|
|
15
14
|
let command;
|
|
@@ -29,9 +28,6 @@ function openBrowser(url) {
|
|
|
29
28
|
}
|
|
30
29
|
});
|
|
31
30
|
}
|
|
32
|
-
function validateMcpKey(key) {
|
|
33
|
-
return (key.startsWith(MCP_KEY_PREFIX) && key.length > MCP_KEY_PREFIX.length + 10);
|
|
34
|
-
}
|
|
35
31
|
async function promptForKey() {
|
|
36
32
|
const hasKey = await confirm("Do you have a Recapt MCP key?", false);
|
|
37
33
|
if (!hasKey) {
|
|
@@ -42,15 +38,12 @@ async function promptForKey() {
|
|
|
42
38
|
openBrowser(SETTINGS_URL);
|
|
43
39
|
await new Promise((resolve) => setTimeout(resolve, 2000));
|
|
44
40
|
}
|
|
45
|
-
const
|
|
41
|
+
const rawKey = await secret("Paste your MCP key");
|
|
42
|
+
const key = rawKey?.trim();
|
|
46
43
|
if (!key) {
|
|
47
44
|
error("No key provided.");
|
|
48
45
|
return null;
|
|
49
46
|
}
|
|
50
|
-
if (!validateMcpKey(key)) {
|
|
51
|
-
error(`Invalid MCP key format. Keys should start with "${MCP_KEY_PREFIX}".`);
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
47
|
return key;
|
|
55
48
|
}
|
|
56
49
|
async function runSetup() {
|
|
@@ -82,6 +75,8 @@ async function runSetup() {
|
|
|
82
75
|
return;
|
|
83
76
|
}
|
|
84
77
|
newline();
|
|
78
|
+
// Small delay to prevent stdin buffering issues from IDE selection
|
|
79
|
+
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
85
80
|
const mcpKey = await promptForKey();
|
|
86
81
|
if (!mcpKey) {
|
|
87
82
|
process.exit(1);
|