comfy-ts 2.4.0 → 2.4.1

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.
@@ -815,7 +815,7 @@ var ComfySchema = class {
815
815
  };
816
816
  //#endregion
817
817
  //#region package.json
818
- var version = "2.4.0";
818
+ var version = "2.4.1";
819
819
  //#endregion
820
820
  //#region src/litegraph/LiteGraphLinkID.ts
821
821
  const asLiteGraphLinkID = (id) => id;
@@ -3601,6 +3601,7 @@ var ResilientWebSocketClient = class {
3601
3601
  this.messageBuffer = [];
3602
3602
  this.isOpen = false;
3603
3603
  this.debugMessages = [];
3604
+ this.hasEverOpened = false;
3604
3605
  this.permanentlyClosed = false;
3605
3606
  this.url = options.url();
3606
3607
  this.connect();
@@ -3652,6 +3653,7 @@ var ResilientWebSocketClient = class {
3652
3653
  ws.onopen = () => {
3653
3654
  if (ws !== this.currentWS) return;
3654
3655
  this.addInfo("✅ WebSocket connected to " + this.url);
3656
+ this.hasEverOpened = true;
3655
3657
  this.isOpen = true;
3656
3658
  this.options.onConnectOrReconnect();
3657
3659
  this.flushMessageBuffer();
@@ -3662,6 +3664,11 @@ var ResilientWebSocketClient = class {
3662
3664
  this.options.onClose();
3663
3665
  if (this.permanentlyClosed) return;
3664
3666
  this.addError(`WebSocket closed (reason=${JSON.stringify(event.reason)}, code=${event.code})`);
3667
+ if (!this.hasEverOpened && this.options.onFirstConnectFailed != null) {
3668
+ this.permanentlyClosed = true;
3669
+ this.options.onFirstConnectFailed(/* @__PURE__ */ new Error(`connection refused (code=${event.code}${event.reason === "" ? "" : `, ${event.reason}`})`));
3670
+ return;
3671
+ }
3665
3672
  this.addInfo("⏱️ reconnecting in 2 seconds...");
3666
3673
  this.reconnectTimeout = setTimeout(() => void this.connect(), 2e3);
3667
3674
  };
@@ -4076,6 +4083,7 @@ var ComfyHost = class {
4076
4083
  url: () => this.getWSUrl(),
4077
4084
  headers: () => this.authHeaders(),
4078
4085
  onTransportDead: (e) => this.markFailed(e),
4086
+ onFirstConnectFailed: (e) => this.markFailed(new ComfyHostUnreachableError(`host '${this.data.id}' is not reachable at ${this.getWSUrl()} — ${extractErrorMessage(e)}. Is ComfyUI running there ?`)),
4079
4087
  onClose: () => {
4080
4088
  logInfo(`[👢] WEBSOCKET: closed connection to ComfyUI host ${this.data.id}`);
4081
4089
  }
@@ -4861,4 +4869,4 @@ var ComfyTS = class ComfyTS {
4861
4869
  //#endregion
4862
4870
  export { importSharp as a, stripAnsi as i, settingsPathFor as n, ComfySchema as o, readableStringify as r, ComfyTS as t };
4863
4871
 
4864
- //# sourceMappingURL=state-BbKuSDCV.js.map
4872
+ //# sourceMappingURL=state-C0ARiFFM.js.map