pinelabs-mcp 1.0.0
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/LICENSE +190 -0
- package/README.md +232 -0
- package/bin/cli.js +67 -0
- package/package.json +57 -0
- package/src/commands/configure.js +95 -0
- package/src/commands/help.js +45 -0
- package/src/commands/proxy.js +83 -0
- package/src/commands/setup.js +241 -0
- package/src/commands/status.js +58 -0
- package/src/commands/test.js +118 -0
- package/src/config-store.js +53 -0
- package/src/config.js +90 -0
- package/src/utils/args.js +37 -0
- package/src/utils/prompt.js +41 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Interactive readline prompts. Zero dependencies.
|
|
5
|
+
*
|
|
6
|
+
* All output goes to stderr (stdout reserved for MCP protocol).
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
const readline = require("node:readline");
|
|
10
|
+
|
|
11
|
+
function askQuestion(question, options = {}) {
|
|
12
|
+
return new Promise((resolve) => {
|
|
13
|
+
const rl = readline.createInterface({
|
|
14
|
+
input: process.stdin,
|
|
15
|
+
output: process.stderr,
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const suffix = options.defaultValue ? ` (default: ${options.defaultValue})` : "";
|
|
19
|
+
rl.question(` ${question}${suffix}: `, (answer) => {
|
|
20
|
+
rl.close();
|
|
21
|
+
const value = answer.trim();
|
|
22
|
+
resolve(value || options.defaultValue || "");
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function confirm(question) {
|
|
28
|
+
return new Promise((resolve) => {
|
|
29
|
+
const rl = readline.createInterface({
|
|
30
|
+
input: process.stdin,
|
|
31
|
+
output: process.stderr,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
rl.question(` ${question} [y/N]: `, (answer) => {
|
|
35
|
+
rl.close();
|
|
36
|
+
resolve(answer.trim().toLowerCase() === "y");
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module.exports = { askQuestion, confirm };
|