Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@re-ai/inner-tool-sdk

Package Overview
Dependencies
Maintainers
0
Versions
37
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@re-ai/inner-tool-sdk - npm Package Compare versions

Comparing version 0.2.12 to 0.2.13

2

dist/libs/WSBridgeAgent.d.ts
import WebSocket from "ws";
import { WSBridgeCallback, WSBridgePayload } from "../types/bridge";
export declare class WSBridgeAgent {
private ws;
private ws?;
private callbacks;

@@ -6,0 +6,0 @@ private static agents;

@@ -19,5 +19,7 @@ "use strict";

Logger_1.Logger.warn(`[WSBridge] ${e.reason}`);
this.ws = undefined;
};
this.ws.onerror = (e) => {
Logger_1.Logger.error(`[WSBridge] ${e.message}`);
this.ws = undefined;
};

@@ -31,2 +33,6 @@ if (END_TAG.split(",").length) {

static setAgent(id, ws) {
const agent = this.getAgent(id);
if (agent) {
agent.ws?.close();
}
const client = new WSBridgeAgent(ws);

@@ -80,3 +86,3 @@ Logger_1.Logger.info(`[WSBridge] set agent ${id}`);

request(id, payload, callback) {
this.ws.send(JSON.stringify({
this.ws?.send(JSON.stringify({
id,

@@ -87,3 +93,3 @@ payload

Logger_1.Logger.error("[WSBridge] send err", err);
throw new Error(err);
// throw new Error(err)
}

@@ -90,0 +96,0 @@ });

{
"name": "@re-ai/inner-tool-sdk",
"version": "0.2.12",
"version": "0.2.13",
"description": "ReAI内部接口sdk",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -9,3 +9,3 @@ import WebSocket, { CloseEvent, ErrorEvent, MessageEvent } from "ws"

private ws: WebSocket
private ws?: WebSocket
private callbacks: Map<string, WSBridgeCallback>

@@ -26,2 +26,3 @@

Logger.warn(`[WSBridge] ${e.reason}`)
this.ws = undefined
}

@@ -31,2 +32,3 @@

Logger.error(`[WSBridge] ${e.message}`)
this.ws = undefined
}

@@ -42,2 +44,7 @@

static setAgent(id: string, ws: WebSocket) {
const agent = this.getAgent(id)
if (agent) {
agent.ws?.close()
}
const client = new WSBridgeAgent(ws)

@@ -94,3 +101,3 @@ Logger.info(`[WSBridge] set agent ${id}`)

request(id: string, payload: WSBridgePayload, callback: WSBridgeCallback) {
this.ws.send(JSON.stringify({
this.ws?.send(JSON.stringify({
id,

@@ -101,3 +108,3 @@ payload

Logger.error("[WSBridge] send err", err)
throw new Error(err)
// throw new Error(err)
}

@@ -104,0 +111,0 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc