@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.
@@ -1,6 +1,7 @@
1
1
  import * as _hono_node_server from '@hono/node-server';
2
2
  import * as hono_types from 'hono/types';
3
3
  import { Hono } from 'hono';
4
+ import { LiopTlsOptions } from '@nekzus/liop';
4
5
 
5
6
  type TargetTransportType = "stdio" | "http" | "grpc" | "mesh";
6
7
  interface TargetConnectionConfig {
@@ -19,6 +20,7 @@ interface TargetConnectionConfig {
19
20
  target: string;
20
21
  useTls?: boolean;
21
22
  token?: string;
23
+ tls?: LiopTlsOptions;
22
24
  };
23
25
  mesh?: {
24
26
  bootstrapNodes?: string[];
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { T as TargetConnectionConfig, S as ScanReport, a as ScannedTargetNode, E as EnrichedTool, b as StudioTransport, c as TargetTransportType, d as ExecutionResult } from './index-DLA-Sm4s.js';
2
- export { e as ExecutionTelemetry, f as ServerOptions, g as createStudioServer } from './index-DLA-Sm4s.js';
1
+ import { T as TargetConnectionConfig, S as ScanReport, a as ScannedTargetNode, E as EnrichedTool, b as StudioTransport, c as TargetTransportType, d as ExecutionResult } from './index-Cl7IupN0.js';
2
+ export { e as ExecutionTelemetry, f as ServerOptions, g as createStudioServer } from './index-Cl7IupN0.js';
3
+ import { LiopTlsOptions } from '@nekzus/liop';
3
4
  import '@hono/node-server';
4
5
  import 'hono/types';
5
6
  import 'hono';
@@ -80,6 +81,7 @@ interface GrpcTransportOptions {
80
81
  target: string;
81
82
  useTls?: boolean;
82
83
  token?: string;
84
+ tls?: LiopTlsOptions;
83
85
  }
84
86
  declare class GrpcTransport implements StudioTransport {
85
87
  readonly type: TargetTransportType;
@@ -87,6 +89,7 @@ declare class GrpcTransport implements StudioTransport {
87
89
  private connected;
88
90
  private target;
89
91
  private token?;
92
+ private tlsConfig?;
90
93
  constructor(options: GrpcTransportOptions);
91
94
  isConnected(): boolean;
92
95
  connect(): Promise<void>;
package/dist/index.js CHANGED
@@ -399,16 +399,22 @@ var GrpcTransport = class {
399
399
  connected = false;
400
400
  target;
401
401
  token;
402
+ tlsConfig;
402
403
  constructor(options) {
403
404
  this.target = options.target.replace(/^grpc:\/\//, "");
404
405
  this.token = options.token;
406
+ this.tlsConfig = options.tls;
405
407
  }
406
408
  isConnected() {
407
409
  return this.connected && this.client !== null;
408
410
  }
409
411
  async connect() {
410
412
  const tokenProvider = this.token || createStudioTokenProvider();
411
- this.client = new LiopRpcClient(this.target, void 0, tokenProvider);
413
+ const tls = this.tlsConfig || {
414
+ insecure: true,
415
+ suppressWarning: true
416
+ };
417
+ this.client = new LiopRpcClient(this.target, tls, tokenProvider);
412
418
  this.connected = true;
413
419
  }
414
420
  async disconnect() {
@@ -1956,7 +1962,11 @@ function resolveTargetConfig(target, options = {}) {
1956
1962
  if (isGrpcExplicit || /^([a-zA-Z0-9.-]+):(\d+)$/.test(trimmed) || trimmed.startsWith("grpc://")) {
1957
1963
  return {
1958
1964
  type: "grpc",
1959
- grpc: { target: trimmed, token }
1965
+ grpc: {
1966
+ target: trimmed,
1967
+ token,
1968
+ tls: { insecure: true, suppressWarning: true }
1969
+ }
1960
1970
  };
1961
1971
  }
1962
1972
  const parts = trimmed.split(/\s+/);
@@ -1969,6 +1979,9 @@ function resolveTargetConfig(target, options = {}) {
1969
1979
  };
1970
1980
  }
1971
1981
  async function runScan(targetStr, options) {
1982
+ if (!process3.env.LIOP_SUPPRESS_TLS_WARNING) {
1983
+ process3.env.LIOP_SUPPRESS_TLS_WARNING = "true";
1984
+ }
1972
1985
  const config = resolveTargetConfig(targetStr, options.token);
1973
1986
  const transport = createTransport(config);
1974
1987
  try {
@@ -2002,6 +2015,9 @@ import { Hono } from "hono";
2002
2015
  import { streamSSE } from "hono/streaming";
2003
2016
  var __dirname = path.dirname(fileURLToPath(import.meta.url));
2004
2017
  function createStudioServer(options = {}) {
2018
+ if (!process4.env.LIOP_SUPPRESS_TLS_WARNING) {
2019
+ process4.env.LIOP_SUPPRESS_TLS_WARNING = "true";
2020
+ }
2005
2021
  const app = new Hono();
2006
2022
  const port = options.port || 16e3;
2007
2023
  const distPath = options.distPath || path.resolve(__dirname, "../../ui/dist");