@torqon/mcp 0.1.9 → 0.2.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/dist/install.js +20 -4
- package/package.json +1 -1
package/dist/install.js
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'fs';
|
|
3
3
|
import { join } from 'path';
|
|
4
4
|
import { homedir, platform } from 'os';
|
|
5
|
+
// ── Terminal colors ───────────────────────────────────────────────────────────
|
|
6
|
+
const dim = (s) => `\x1b[2m${s}\x1b[0m`;
|
|
7
|
+
const green = (s) => `\x1b[32m${s}\x1b[0m`;
|
|
8
|
+
const bold = (s) => `\x1b[1m${s}\x1b[0m`;
|
|
9
|
+
const gray = (s) => `\x1b[90m${s}\x1b[0m`;
|
|
10
|
+
const white = (s) => `\x1b[97m${s}\x1b[0m`;
|
|
5
11
|
const TORQON_API_URL = process.env.TORQON_API_URL ?? 'https://torqon-production.up.railway.app';
|
|
6
12
|
function getConfigPath(client) {
|
|
7
13
|
const home = homedir();
|
|
@@ -82,17 +88,27 @@ function installToml(configPath, apiKey, apiUrl) {
|
|
|
82
88
|
writeFileSync(configPath, (existing + block).trimStart(), 'utf8');
|
|
83
89
|
}
|
|
84
90
|
function install(client, apiKey, apiUrl) {
|
|
85
|
-
console.log(`\n🔧 Installing Torqon MCP for ${client}...\n`);
|
|
86
91
|
const { path: configPath, format } = getConfigPath(client);
|
|
92
|
+
const line = gray('─'.repeat(48));
|
|
93
|
+
const label = (k) => gray(k.padEnd(10));
|
|
94
|
+
console.log();
|
|
95
|
+
console.log(` ${bold(white('torqon'))} ${dim('mcp installer')}`);
|
|
96
|
+
console.log(` ${line}`);
|
|
97
|
+
console.log();
|
|
87
98
|
if (format === 'toml') {
|
|
88
99
|
installToml(configPath, apiKey, apiUrl);
|
|
89
100
|
}
|
|
90
101
|
else {
|
|
91
102
|
installJson(client, configPath, apiKey, apiUrl);
|
|
92
103
|
}
|
|
93
|
-
|
|
94
|
-
console.log(
|
|
95
|
-
console.log(
|
|
104
|
+
const clientDisplay = client.charAt(0).toUpperCase() + client.slice(1);
|
|
105
|
+
console.log(` ${label('Client')} ${white(clientDisplay)}`);
|
|
106
|
+
console.log(` ${label('Config')} ${dim(configPath)}`);
|
|
107
|
+
console.log(` ${label('Key')} ${dim(apiKey.slice(0, 10) + '••••••••••••')}`);
|
|
108
|
+
console.log(` ${label('Status')} ${green('installed')}`);
|
|
109
|
+
console.log();
|
|
110
|
+
console.log(` ${dim('Restart')} ${white(clientDisplay)} ${dim('to connect.')}`);
|
|
111
|
+
console.log();
|
|
96
112
|
}
|
|
97
113
|
// Parse args — supports two formats:
|
|
98
114
|
// add <client> --api-key <key> (new, from Connect page)
|