@solongate/proxy 0.1.4 → 0.1.6
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/create.js +37 -9
- package/dist/index.js +94 -23
- package/dist/init.js +23 -4
- package/dist/inject.js +32 -10
- package/package.json +1 -1
package/dist/create.js
CHANGED
|
@@ -190,20 +190,52 @@ dist/
|
|
|
190
190
|
`
|
|
191
191
|
);
|
|
192
192
|
}
|
|
193
|
+
var c = {
|
|
194
|
+
reset: "\x1B[0m",
|
|
195
|
+
bold: "\x1B[1m",
|
|
196
|
+
dim: "\x1B[2m",
|
|
197
|
+
white: "\x1B[97m",
|
|
198
|
+
blue1: "\x1B[38;2;30;64;175m",
|
|
199
|
+
// dark blue
|
|
200
|
+
blue2: "\x1B[38;2;50;100;200m",
|
|
201
|
+
blue3: "\x1B[38;2;80;140;220m",
|
|
202
|
+
blue4: "\x1B[38;2;120;170;235m",
|
|
203
|
+
blue5: "\x1B[38;2;170;200;245m",
|
|
204
|
+
// light blue → white
|
|
205
|
+
green: "\x1B[32m",
|
|
206
|
+
red: "\x1B[31m"
|
|
207
|
+
};
|
|
208
|
+
function printBanner(subtitle) {
|
|
209
|
+
const lines = [
|
|
210
|
+
" ______ ______ __ ______ __ __ ______ ______ ______ ______ ",
|
|
211
|
+
'/\\ ___\\ /\\ __ \\ /\\ \\ /\\ __ \\ /\\ "-.\\ \\ /\\ ___\\ /\\ __ \\ /\\__ _\\ /\\ ___\\ ',
|
|
212
|
+
"\\ \\___ \\ \\ \\ \\/\\ \\ \\ \\ \\____ \\ \\ \\/\\ \\ \\ \\ \\-. \\ \\ \\ \\__ \\ \\ \\ __ \\ \\/_/\\ \\/ \\ \\ __\\ ",
|
|
213
|
+
' \\/\\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_\\\\"\\_\\ \\ \\_____\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_____\\',
|
|
214
|
+
" \\/_____/ \\/_____/ \\/_____/ \\/_____/ \\/_/ \\/_/ \\/_____/ \\/_/\\/_/ \\/_/ \\/_____/"
|
|
215
|
+
];
|
|
216
|
+
const colors = [c.blue1, c.blue2, c.blue3, c.blue4, c.blue5];
|
|
217
|
+
log("");
|
|
218
|
+
for (let i = 0; i < lines.length; i++) {
|
|
219
|
+
log(`${c.bold}${colors[i]}${lines[i]}${c.reset}`);
|
|
220
|
+
}
|
|
221
|
+
log("");
|
|
222
|
+
log(` ${c.dim}${subtitle}${c.reset}`);
|
|
223
|
+
log("");
|
|
224
|
+
}
|
|
193
225
|
function withSpinner(message, fn) {
|
|
194
|
-
const frames = ["\
|
|
226
|
+
const frames = ["\u28FE", "\u28FD", "\u28FB", "\u28BF", "\u287F", "\u28DF", "\u28EF", "\u28F7"];
|
|
195
227
|
let i = 0;
|
|
196
228
|
const id = setInterval(() => {
|
|
197
|
-
process.stderr.write(`\r ${frames[i++ % frames.length]} ${message}`);
|
|
229
|
+
process.stderr.write(`\r ${c.blue3}${frames[i++ % frames.length]}${c.reset} ${message}`);
|
|
198
230
|
}, 80);
|
|
199
231
|
try {
|
|
200
232
|
fn();
|
|
201
233
|
clearInterval(id);
|
|
202
|
-
process.stderr.write(`\r \u2713 ${message}
|
|
234
|
+
process.stderr.write(`\r ${c.green}\u2713${c.reset} ${message}
|
|
203
235
|
`);
|
|
204
236
|
} catch {
|
|
205
237
|
clearInterval(id);
|
|
206
|
-
process.stderr.write(`\r \u2717 ${message} \u2014 failed
|
|
238
|
+
process.stderr.write(`\r ${c.red}\u2717${c.reset} ${message} \u2014 failed
|
|
207
239
|
`);
|
|
208
240
|
}
|
|
209
241
|
}
|
|
@@ -215,11 +247,7 @@ function installDeps(dir) {
|
|
|
215
247
|
async function main() {
|
|
216
248
|
const opts = parseCreateArgs(process.argv);
|
|
217
249
|
const dir = resolve(opts.name);
|
|
218
|
-
|
|
219
|
-
log(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557");
|
|
220
|
-
log(" \u2551 SolonGate \u2014 Create MCP Server \u2551");
|
|
221
|
-
log(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D");
|
|
222
|
-
log("");
|
|
250
|
+
printBanner("Create MCP Server");
|
|
223
251
|
if (existsSync(dir)) {
|
|
224
252
|
log(` Error: Directory "${opts.name}" already exists.`);
|
|
225
253
|
process.exit(1);
|
package/dist/index.js
CHANGED
|
@@ -143,11 +143,30 @@ POLICY PRESETS
|
|
|
143
143
|
}
|
|
144
144
|
async function main() {
|
|
145
145
|
const options = parseInitArgs(process.argv);
|
|
146
|
+
const _c = {
|
|
147
|
+
reset: "\x1B[0m",
|
|
148
|
+
bold: "\x1B[1m",
|
|
149
|
+
dim: "\x1B[2m",
|
|
150
|
+
blue1: "\x1B[38;2;30;64;175m",
|
|
151
|
+
blue2: "\x1B[38;2;50;100;200m",
|
|
152
|
+
blue3: "\x1B[38;2;80;140;220m",
|
|
153
|
+
blue4: "\x1B[38;2;120;170;235m",
|
|
154
|
+
blue5: "\x1B[38;2;170;200;245m"
|
|
155
|
+
};
|
|
156
|
+
const bannerLines = [
|
|
157
|
+
" ______ ______ __ ______ __ __ ______ ______ ______ ______ ",
|
|
158
|
+
'/\\ ___\\ /\\ __ \\ /\\ \\ /\\ __ \\ /\\ "-.\\ \\ /\\ ___\\ /\\ __ \\ /\\__ _\\ /\\ ___\\ ',
|
|
159
|
+
"\\ \\___ \\ \\ \\ \\/\\ \\ \\ \\ \\____ \\ \\ \\/\\ \\ \\ \\ \\-. \\ \\ \\ \\__ \\ \\ \\ __ \\ \\/_/\\ \\/ \\ \\ __\\ ",
|
|
160
|
+
' \\/\\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_\\\\"\\_\\ \\ \\_____\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_____\\',
|
|
161
|
+
" \\/_____/ \\/_____/ \\/_____/ \\/_____/ \\/_/ \\/_/ \\/_____/ \\/_/\\/_/ \\/_/ \\/_____/"
|
|
162
|
+
];
|
|
163
|
+
const bannerColors = [_c.blue1, _c.blue2, _c.blue3, _c.blue4, _c.blue5];
|
|
164
|
+
console.error("");
|
|
165
|
+
for (let i = 0; i < bannerLines.length; i++) {
|
|
166
|
+
console.error(`${_c.bold}${bannerColors[i]}${bannerLines[i]}${_c.reset}`);
|
|
167
|
+
}
|
|
146
168
|
console.error("");
|
|
147
|
-
console.error(
|
|
148
|
-
console.error(" \u2551 SolonGate \u2014 Init Setup \u2551");
|
|
149
|
-
console.error(" \u2551 Secure your MCP servers in seconds \u2551");
|
|
150
|
-
console.error(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D");
|
|
169
|
+
console.error(` ${_c.dim}Init Setup${_c.reset}`);
|
|
151
170
|
console.error("");
|
|
152
171
|
const configInfo = findConfigFile(options.configPath);
|
|
153
172
|
if (!configInfo) {
|
|
@@ -347,6 +366,23 @@ WHAT IT DOES
|
|
|
347
366
|
function log2(msg) {
|
|
348
367
|
process.stderr.write(msg + "\n");
|
|
349
368
|
}
|
|
369
|
+
function printBanner(subtitle) {
|
|
370
|
+
const lines = [
|
|
371
|
+
" ______ ______ __ ______ __ __ ______ ______ ______ ______ ",
|
|
372
|
+
'/\\ ___\\ /\\ __ \\ /\\ \\ /\\ __ \\ /\\ "-.\\ \\ /\\ ___\\ /\\ __ \\ /\\__ _\\ /\\ ___\\ ',
|
|
373
|
+
"\\ \\___ \\ \\ \\ \\/\\ \\ \\ \\ \\____ \\ \\ \\/\\ \\ \\ \\ \\-. \\ \\ \\ \\__ \\ \\ \\ __ \\ \\/_/\\ \\/ \\ \\ __\\ ",
|
|
374
|
+
' \\/\\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_\\\\"\\_\\ \\ \\_____\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_____\\',
|
|
375
|
+
" \\/_____/ \\/_____/ \\/_____/ \\/_____/ \\/_/ \\/_/ \\/_____/ \\/_/\\/_/ \\/_/ \\/_____/"
|
|
376
|
+
];
|
|
377
|
+
const colors = [c.blue1, c.blue2, c.blue3, c.blue4, c.blue5];
|
|
378
|
+
log2("");
|
|
379
|
+
for (let i = 0; i < lines.length; i++) {
|
|
380
|
+
log2(`${c.bold}${colors[i]}${lines[i]}${c.reset}`);
|
|
381
|
+
}
|
|
382
|
+
log2("");
|
|
383
|
+
log2(` ${c.dim}${subtitle}${c.reset}`);
|
|
384
|
+
log2("");
|
|
385
|
+
}
|
|
350
386
|
function detectProject() {
|
|
351
387
|
if (!existsSync3(resolve3("package.json"))) return false;
|
|
352
388
|
try {
|
|
@@ -382,8 +418,8 @@ function findTsEntryFile() {
|
|
|
382
418
|
"server.ts",
|
|
383
419
|
"main.ts"
|
|
384
420
|
];
|
|
385
|
-
for (const
|
|
386
|
-
const full = resolve3(
|
|
421
|
+
for (const c3 of candidates) {
|
|
422
|
+
const full = resolve3(c3);
|
|
387
423
|
if (existsSync3(full)) {
|
|
388
424
|
try {
|
|
389
425
|
const content = readFileSync3(full, "utf-8");
|
|
@@ -394,8 +430,8 @@ function findTsEntryFile() {
|
|
|
394
430
|
}
|
|
395
431
|
}
|
|
396
432
|
}
|
|
397
|
-
for (const
|
|
398
|
-
if (existsSync3(resolve3(
|
|
433
|
+
for (const c3 of candidates) {
|
|
434
|
+
if (existsSync3(resolve3(c3))) return resolve3(c3);
|
|
399
435
|
}
|
|
400
436
|
return null;
|
|
401
437
|
}
|
|
@@ -533,12 +569,7 @@ function showDiff(result) {
|
|
|
533
569
|
}
|
|
534
570
|
async function main2() {
|
|
535
571
|
const opts = parseInjectArgs(process.argv);
|
|
536
|
-
|
|
537
|
-
log2(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557");
|
|
538
|
-
log2(" \u2551 SolonGate \u2014 Inject SDK \u2551");
|
|
539
|
-
log2(" \u2551 Add security to your MCP server \u2551");
|
|
540
|
-
log2(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D");
|
|
541
|
-
log2("");
|
|
572
|
+
printBanner("Inject SDK");
|
|
542
573
|
if (!detectProject()) {
|
|
543
574
|
log2(" Could not detect a TypeScript MCP server project.");
|
|
544
575
|
log2(" Make sure you are in a project directory with:");
|
|
@@ -619,9 +650,20 @@ async function main2() {
|
|
|
619
650
|
log2(" \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518");
|
|
620
651
|
log2("");
|
|
621
652
|
}
|
|
653
|
+
var c;
|
|
622
654
|
var init_inject = __esm({
|
|
623
655
|
"src/inject.ts"() {
|
|
624
656
|
"use strict";
|
|
657
|
+
c = {
|
|
658
|
+
reset: "\x1B[0m",
|
|
659
|
+
bold: "\x1B[1m",
|
|
660
|
+
dim: "\x1B[2m",
|
|
661
|
+
blue1: "\x1B[38;2;30;64;175m",
|
|
662
|
+
blue2: "\x1B[38;2;50;100;200m",
|
|
663
|
+
blue3: "\x1B[38;2;80;140;220m",
|
|
664
|
+
blue4: "\x1B[38;2;120;170;235m",
|
|
665
|
+
blue5: "\x1B[38;2;170;200;245m"
|
|
666
|
+
};
|
|
625
667
|
main2().catch((err) => {
|
|
626
668
|
log2(`Fatal: ${err instanceof Error ? err.message : String(err)}`);
|
|
627
669
|
process.exit(1);
|
|
@@ -820,20 +862,37 @@ dist/
|
|
|
820
862
|
`
|
|
821
863
|
);
|
|
822
864
|
}
|
|
865
|
+
function printBanner2(subtitle) {
|
|
866
|
+
const lines = [
|
|
867
|
+
" ______ ______ __ ______ __ __ ______ ______ ______ ______ ",
|
|
868
|
+
'/\\ ___\\ /\\ __ \\ /\\ \\ /\\ __ \\ /\\ "-.\\ \\ /\\ ___\\ /\\ __ \\ /\\__ _\\ /\\ ___\\ ',
|
|
869
|
+
"\\ \\___ \\ \\ \\ \\/\\ \\ \\ \\ \\____ \\ \\ \\/\\ \\ \\ \\ \\-. \\ \\ \\ \\__ \\ \\ \\ __ \\ \\/_/\\ \\/ \\ \\ __\\ ",
|
|
870
|
+
' \\/\\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_\\\\"\\_\\ \\ \\_____\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_____\\',
|
|
871
|
+
" \\/_____/ \\/_____/ \\/_____/ \\/_____/ \\/_/ \\/_/ \\/_____/ \\/_/\\/_/ \\/_/ \\/_____/"
|
|
872
|
+
];
|
|
873
|
+
const colors = [c2.blue1, c2.blue2, c2.blue3, c2.blue4, c2.blue5];
|
|
874
|
+
log3("");
|
|
875
|
+
for (let i = 0; i < lines.length; i++) {
|
|
876
|
+
log3(`${c2.bold}${colors[i]}${lines[i]}${c2.reset}`);
|
|
877
|
+
}
|
|
878
|
+
log3("");
|
|
879
|
+
log3(` ${c2.dim}${subtitle}${c2.reset}`);
|
|
880
|
+
log3("");
|
|
881
|
+
}
|
|
823
882
|
function withSpinner(message, fn) {
|
|
824
|
-
const frames = ["\
|
|
883
|
+
const frames = ["\u28FE", "\u28FD", "\u28FB", "\u28BF", "\u287F", "\u28DF", "\u28EF", "\u28F7"];
|
|
825
884
|
let i = 0;
|
|
826
885
|
const id = setInterval(() => {
|
|
827
|
-
process.stderr.write(`\r ${frames[i++ % frames.length]} ${message}`);
|
|
886
|
+
process.stderr.write(`\r ${c2.blue3}${frames[i++ % frames.length]}${c2.reset} ${message}`);
|
|
828
887
|
}, 80);
|
|
829
888
|
try {
|
|
830
889
|
fn();
|
|
831
890
|
clearInterval(id);
|
|
832
|
-
process.stderr.write(`\r \u2713 ${message}
|
|
891
|
+
process.stderr.write(`\r ${c2.green}\u2713${c2.reset} ${message}
|
|
833
892
|
`);
|
|
834
893
|
} catch {
|
|
835
894
|
clearInterval(id);
|
|
836
|
-
process.stderr.write(`\r \u2717 ${message} \u2014 failed
|
|
895
|
+
process.stderr.write(`\r ${c2.red}\u2717${c2.reset} ${message} \u2014 failed
|
|
837
896
|
`);
|
|
838
897
|
}
|
|
839
898
|
}
|
|
@@ -845,11 +904,7 @@ function installDeps(dir) {
|
|
|
845
904
|
async function main3() {
|
|
846
905
|
const opts = parseCreateArgs(process.argv);
|
|
847
906
|
const dir = resolve4(opts.name);
|
|
848
|
-
|
|
849
|
-
log3(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557");
|
|
850
|
-
log3(" \u2551 SolonGate \u2014 Create MCP Server \u2551");
|
|
851
|
-
log3(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D");
|
|
852
|
-
log3("");
|
|
907
|
+
printBanner2("Create MCP Server");
|
|
853
908
|
if (existsSync4(dir)) {
|
|
854
909
|
log3(` Error: Directory "${opts.name}" already exists.`);
|
|
855
910
|
process.exit(1);
|
|
@@ -887,9 +942,25 @@ async function main3() {
|
|
|
887
942
|
log3(` \u2514${"\u2500".repeat(W + 2)}\u2518`);
|
|
888
943
|
log3("");
|
|
889
944
|
}
|
|
945
|
+
var c2;
|
|
890
946
|
var init_create = __esm({
|
|
891
947
|
"src/create.ts"() {
|
|
892
948
|
"use strict";
|
|
949
|
+
c2 = {
|
|
950
|
+
reset: "\x1B[0m",
|
|
951
|
+
bold: "\x1B[1m",
|
|
952
|
+
dim: "\x1B[2m",
|
|
953
|
+
white: "\x1B[97m",
|
|
954
|
+
blue1: "\x1B[38;2;30;64;175m",
|
|
955
|
+
// dark blue
|
|
956
|
+
blue2: "\x1B[38;2;50;100;200m",
|
|
957
|
+
blue3: "\x1B[38;2;80;140;220m",
|
|
958
|
+
blue4: "\x1B[38;2;120;170;235m",
|
|
959
|
+
blue5: "\x1B[38;2;170;200;245m",
|
|
960
|
+
// light blue → white
|
|
961
|
+
green: "\x1B[32m",
|
|
962
|
+
red: "\x1B[31m"
|
|
963
|
+
};
|
|
893
964
|
main3().catch((err) => {
|
|
894
965
|
log3(`Fatal: ${err instanceof Error ? err.message : String(err)}`);
|
|
895
966
|
process.exit(1);
|
package/dist/init.js
CHANGED
|
@@ -145,11 +145,30 @@ POLICY PRESETS
|
|
|
145
145
|
}
|
|
146
146
|
async function main() {
|
|
147
147
|
const options = parseInitArgs(process.argv);
|
|
148
|
+
const _c = {
|
|
149
|
+
reset: "\x1B[0m",
|
|
150
|
+
bold: "\x1B[1m",
|
|
151
|
+
dim: "\x1B[2m",
|
|
152
|
+
blue1: "\x1B[38;2;30;64;175m",
|
|
153
|
+
blue2: "\x1B[38;2;50;100;200m",
|
|
154
|
+
blue3: "\x1B[38;2;80;140;220m",
|
|
155
|
+
blue4: "\x1B[38;2;120;170;235m",
|
|
156
|
+
blue5: "\x1B[38;2;170;200;245m"
|
|
157
|
+
};
|
|
158
|
+
const bannerLines = [
|
|
159
|
+
" ______ ______ __ ______ __ __ ______ ______ ______ ______ ",
|
|
160
|
+
'/\\ ___\\ /\\ __ \\ /\\ \\ /\\ __ \\ /\\ "-.\\ \\ /\\ ___\\ /\\ __ \\ /\\__ _\\ /\\ ___\\ ',
|
|
161
|
+
"\\ \\___ \\ \\ \\ \\/\\ \\ \\ \\ \\____ \\ \\ \\/\\ \\ \\ \\ \\-. \\ \\ \\ \\__ \\ \\ \\ __ \\ \\/_/\\ \\/ \\ \\ __\\ ",
|
|
162
|
+
' \\/\\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_\\\\"\\_\\ \\ \\_____\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_____\\',
|
|
163
|
+
" \\/_____/ \\/_____/ \\/_____/ \\/_____/ \\/_/ \\/_/ \\/_____/ \\/_/\\/_/ \\/_/ \\/_____/"
|
|
164
|
+
];
|
|
165
|
+
const bannerColors = [_c.blue1, _c.blue2, _c.blue3, _c.blue4, _c.blue5];
|
|
166
|
+
console.error("");
|
|
167
|
+
for (let i = 0; i < bannerLines.length; i++) {
|
|
168
|
+
console.error(`${_c.bold}${bannerColors[i]}${bannerLines[i]}${_c.reset}`);
|
|
169
|
+
}
|
|
148
170
|
console.error("");
|
|
149
|
-
console.error(
|
|
150
|
-
console.error(" \u2551 SolonGate \u2014 Init Setup \u2551");
|
|
151
|
-
console.error(" \u2551 Secure your MCP servers in seconds \u2551");
|
|
152
|
-
console.error(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D");
|
|
171
|
+
console.error(` ${_c.dim}Init Setup${_c.reset}`);
|
|
153
172
|
console.error("");
|
|
154
173
|
const configInfo = findConfigFile(options.configPath);
|
|
155
174
|
if (!configInfo) {
|
package/dist/inject.js
CHANGED
|
@@ -61,6 +61,33 @@ WHAT IT DOES
|
|
|
61
61
|
function log(msg) {
|
|
62
62
|
process.stderr.write(msg + "\n");
|
|
63
63
|
}
|
|
64
|
+
var c = {
|
|
65
|
+
reset: "\x1B[0m",
|
|
66
|
+
bold: "\x1B[1m",
|
|
67
|
+
dim: "\x1B[2m",
|
|
68
|
+
blue1: "\x1B[38;2;30;64;175m",
|
|
69
|
+
blue2: "\x1B[38;2;50;100;200m",
|
|
70
|
+
blue3: "\x1B[38;2;80;140;220m",
|
|
71
|
+
blue4: "\x1B[38;2;120;170;235m",
|
|
72
|
+
blue5: "\x1B[38;2;170;200;245m"
|
|
73
|
+
};
|
|
74
|
+
function printBanner(subtitle) {
|
|
75
|
+
const lines = [
|
|
76
|
+
" ______ ______ __ ______ __ __ ______ ______ ______ ______ ",
|
|
77
|
+
'/\\ ___\\ /\\ __ \\ /\\ \\ /\\ __ \\ /\\ "-.\\ \\ /\\ ___\\ /\\ __ \\ /\\__ _\\ /\\ ___\\ ',
|
|
78
|
+
"\\ \\___ \\ \\ \\ \\/\\ \\ \\ \\ \\____ \\ \\ \\/\\ \\ \\ \\ \\-. \\ \\ \\ \\__ \\ \\ \\ __ \\ \\/_/\\ \\/ \\ \\ __\\ ",
|
|
79
|
+
' \\/\\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_____\\ \\ \\_\\\\"\\_\\ \\ \\_____\\ \\ \\_\\ \\_\\ \\ \\_\\ \\ \\_____\\',
|
|
80
|
+
" \\/_____/ \\/_____/ \\/_____/ \\/_____/ \\/_/ \\/_/ \\/_____/ \\/_/\\/_/ \\/_/ \\/_____/"
|
|
81
|
+
];
|
|
82
|
+
const colors = [c.blue1, c.blue2, c.blue3, c.blue4, c.blue5];
|
|
83
|
+
log("");
|
|
84
|
+
for (let i = 0; i < lines.length; i++) {
|
|
85
|
+
log(`${c.bold}${colors[i]}${lines[i]}${c.reset}`);
|
|
86
|
+
}
|
|
87
|
+
log("");
|
|
88
|
+
log(` ${c.dim}${subtitle}${c.reset}`);
|
|
89
|
+
log("");
|
|
90
|
+
}
|
|
64
91
|
function detectProject() {
|
|
65
92
|
if (!existsSync(resolve("package.json"))) return false;
|
|
66
93
|
try {
|
|
@@ -96,8 +123,8 @@ function findTsEntryFile() {
|
|
|
96
123
|
"server.ts",
|
|
97
124
|
"main.ts"
|
|
98
125
|
];
|
|
99
|
-
for (const
|
|
100
|
-
const full = resolve(
|
|
126
|
+
for (const c2 of candidates) {
|
|
127
|
+
const full = resolve(c2);
|
|
101
128
|
if (existsSync(full)) {
|
|
102
129
|
try {
|
|
103
130
|
const content = readFileSync(full, "utf-8");
|
|
@@ -108,8 +135,8 @@ function findTsEntryFile() {
|
|
|
108
135
|
}
|
|
109
136
|
}
|
|
110
137
|
}
|
|
111
|
-
for (const
|
|
112
|
-
if (existsSync(resolve(
|
|
138
|
+
for (const c2 of candidates) {
|
|
139
|
+
if (existsSync(resolve(c2))) return resolve(c2);
|
|
113
140
|
}
|
|
114
141
|
return null;
|
|
115
142
|
}
|
|
@@ -247,12 +274,7 @@ function showDiff(result) {
|
|
|
247
274
|
}
|
|
248
275
|
async function main() {
|
|
249
276
|
const opts = parseInjectArgs(process.argv);
|
|
250
|
-
|
|
251
|
-
log(" \u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557");
|
|
252
|
-
log(" \u2551 SolonGate \u2014 Inject SDK \u2551");
|
|
253
|
-
log(" \u2551 Add security to your MCP server \u2551");
|
|
254
|
-
log(" \u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D");
|
|
255
|
-
log("");
|
|
277
|
+
printBanner("Inject SDK");
|
|
256
278
|
if (!detectProject()) {
|
|
257
279
|
log(" Could not detect a TypeScript MCP server project.");
|
|
258
280
|
log(" Make sure you are in a project directory with:");
|
package/package.json
CHANGED