@nekzus/liop-studio 1.0.0-alpha.4 → 1.0.0-alpha.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/cli/index.js +40 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/{index-DLA-Sm4s.d.ts → index-Cl7IupN0.d.ts} +2 -0
- package/dist/index.d.ts +5 -2
- package/dist/index.js +18 -2
- package/dist/index.js.map +1 -1
- package/dist/server/index.d.ts +2 -1
- package/dist/server/index.js +10 -1
- package/dist/server/index.js.map +1 -1
- package/package.json +2 -2
- package/ui/dist/assets/{index-B7ubja55.js → index-DQC14us6.js} +4 -4
- package/ui/dist/index.html +1 -1
package/dist/cli/index.js
CHANGED
|
@@ -467,16 +467,22 @@ var GrpcTransport = class {
|
|
|
467
467
|
connected = false;
|
|
468
468
|
target;
|
|
469
469
|
token;
|
|
470
|
+
tlsConfig;
|
|
470
471
|
constructor(options) {
|
|
471
472
|
this.target = options.target.replace(/^grpc:\/\//, "");
|
|
472
473
|
this.token = options.token;
|
|
474
|
+
this.tlsConfig = options.tls;
|
|
473
475
|
}
|
|
474
476
|
isConnected() {
|
|
475
477
|
return this.connected && this.client !== null;
|
|
476
478
|
}
|
|
477
479
|
async connect() {
|
|
478
480
|
const tokenProvider = this.token || createStudioTokenProvider();
|
|
479
|
-
|
|
481
|
+
const tls = this.tlsConfig || {
|
|
482
|
+
insecure: true,
|
|
483
|
+
suppressWarning: true
|
|
484
|
+
};
|
|
485
|
+
this.client = new LiopRpcClient(this.target, tls, tokenProvider);
|
|
480
486
|
this.connected = true;
|
|
481
487
|
}
|
|
482
488
|
async disconnect() {
|
|
@@ -1881,6 +1887,9 @@ function createTransport(config) {
|
|
|
1881
1887
|
// src/server/index.ts
|
|
1882
1888
|
var __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
1883
1889
|
function createStudioServer(options = {}) {
|
|
1890
|
+
if (!process3.env.LIOP_SUPPRESS_TLS_WARNING) {
|
|
1891
|
+
process3.env.LIOP_SUPPRESS_TLS_WARNING = "true";
|
|
1892
|
+
}
|
|
1884
1893
|
const app = new Hono();
|
|
1885
1894
|
const port = options.port || 16e3;
|
|
1886
1895
|
const distPath = options.distPath || path.resolve(__dirname, "../../ui/dist");
|
|
@@ -2197,7 +2206,11 @@ function resolveTargetConfig(target, options = {}) {
|
|
|
2197
2206
|
if (isGrpcExplicit || /^([a-zA-Z0-9.-]+):(\d+)$/.test(trimmed) || trimmed.startsWith("grpc://")) {
|
|
2198
2207
|
return {
|
|
2199
2208
|
type: "grpc",
|
|
2200
|
-
grpc: {
|
|
2209
|
+
grpc: {
|
|
2210
|
+
target: trimmed,
|
|
2211
|
+
token,
|
|
2212
|
+
tls: { insecure: true, suppressWarning: true }
|
|
2213
|
+
}
|
|
2201
2214
|
};
|
|
2202
2215
|
}
|
|
2203
2216
|
const parts = trimmed.split(/\s+/);
|
|
@@ -2210,6 +2223,9 @@ function resolveTargetConfig(target, options = {}) {
|
|
|
2210
2223
|
};
|
|
2211
2224
|
}
|
|
2212
2225
|
async function runScan(targetStr, options) {
|
|
2226
|
+
if (!process4.env.LIOP_SUPPRESS_TLS_WARNING) {
|
|
2227
|
+
process4.env.LIOP_SUPPRESS_TLS_WARNING = "true";
|
|
2228
|
+
}
|
|
2213
2229
|
const config = resolveTargetConfig(targetStr, options.token);
|
|
2214
2230
|
const transport = createTransport(config);
|
|
2215
2231
|
try {
|
|
@@ -2243,8 +2259,18 @@ async function main() {
|
|
|
2243
2259
|
).option("--http <url>", "Initial target: HTTP / SSE MCP URL").option("--grpc <target>", "Initial target: Native LIOP gRPC endpoint").option("--mesh <multiaddr>", "Initial target: Libp2p P2P bootstrap node").option(
|
|
2244
2260
|
"--token <token>",
|
|
2245
2261
|
"Bearer or access token for target authentication"
|
|
2262
|
+
).option("--tls-ca <path>", "Path to root CA certificate for gRPC target").option(
|
|
2263
|
+
"--tls-cert <path>",
|
|
2264
|
+
"Path to client certificate chain for gRPC target"
|
|
2265
|
+
).option("--tls-key <path>", "Path to client private key for gRPC target").option(
|
|
2266
|
+
"--insecure",
|
|
2267
|
+
"Explicitly permit unencrypted gRPC credentials",
|
|
2268
|
+
true
|
|
2246
2269
|
).action(async (options) => {
|
|
2247
2270
|
const port = Number.parseInt(options.port, 10) || 16e3;
|
|
2271
|
+
if (!options.tlsCa && !options.tlsCert && !options.tlsKey) {
|
|
2272
|
+
process5.env.LIOP_SUPPRESS_TLS_WARNING = "true";
|
|
2273
|
+
}
|
|
2248
2274
|
let initialTarget;
|
|
2249
2275
|
if (options.stdio) {
|
|
2250
2276
|
const parts = options.stdio.trim().split(/\s+/);
|
|
@@ -2260,7 +2286,18 @@ async function main() {
|
|
|
2260
2286
|
} else if (options.grpc) {
|
|
2261
2287
|
initialTarget = {
|
|
2262
2288
|
type: "grpc",
|
|
2263
|
-
grpc: {
|
|
2289
|
+
grpc: {
|
|
2290
|
+
target: options.grpc,
|
|
2291
|
+
token: options.token,
|
|
2292
|
+
tls: options.tlsCa ? {
|
|
2293
|
+
rootCert: options.tlsCa,
|
|
2294
|
+
certChain: options.tlsCert,
|
|
2295
|
+
privateKey: options.tlsKey
|
|
2296
|
+
} : {
|
|
2297
|
+
insecure: true,
|
|
2298
|
+
suppressWarning: true
|
|
2299
|
+
}
|
|
2300
|
+
}
|
|
2264
2301
|
};
|
|
2265
2302
|
} else if (options.mesh) {
|
|
2266
2303
|
initialTarget = {
|