nexus-channel 1.8.0 → 1.8.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.
Files changed (2) hide show
  1. package/dist/index.js +16 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -110,7 +110,7 @@ var require_buffer_util = __commonJS({
110
110
  toBuffer,
111
111
  unmask: _unmask
112
112
  };
113
- if (!process.env.WS_NO_BUFFER_UTIL) {
113
+ if (true) {
114
114
  try {
115
115
  const bufferUtil = require("bufferutil");
116
116
  module2.exports.mask = function(source, mask, output, offset, length) {
@@ -749,7 +749,7 @@ var require_validation = __commonJS({
749
749
  module2.exports.isValidUTF8 = function(buf) {
750
750
  return buf.length < 24 ? _isValidUTF8(buf) : isUtf8(buf);
751
751
  };
752
- } else if (!process.env.WS_NO_UTF_8_VALIDATE) {
752
+ } else if (true) {
753
753
  try {
754
754
  const isValidUTF8 = require("utf-8-validate");
755
755
  module2.exports.isValidUTF8 = function(buf) {
@@ -3724,8 +3724,19 @@ function resolveNexusConfig(cfg) {
3724
3724
  // src/transport/resume-store.ts
3725
3725
  var fs = __toESM(require("fs"));
3726
3726
  var path = __toESM(require("path"));
3727
+
3728
+ // src/utils/env.ts
3729
+ var _env = typeof process !== "undefined" && process ? process.env : {};
3730
+ function getEnv(key) {
3731
+ return _env[key];
3732
+ }
3733
+ function getEnvOr(key, fallback) {
3734
+ return _env[key] || fallback;
3735
+ }
3736
+
3737
+ // src/transport/resume-store.ts
3727
3738
  var RESUME_TOKEN_PATH = path.join(
3728
- process.env.HOME || "~",
3739
+ getEnvOr("HOME", "~"),
3729
3740
  ".openclaw",
3730
3741
  "state",
3731
3742
  "nexus-resume.json"
@@ -3935,7 +3946,7 @@ var WSClient = class {
3935
3946
  rooms: this.config.rooms,
3936
3947
  resumeToken: getResumeTokens(),
3937
3948
  token: this.config.token,
3938
- openclawVersion: process.env.OPENCLAW_SERVICE_VERSION || process.env.OPENCLAW_VERSION || "unknown",
3949
+ openclawVersion: getEnv("OPENCLAW_SERVICE_VERSION") || getEnv("OPENCLAW_VERSION") || "unknown",
3939
3950
  pluginVersion: this.readPluginVersion()
3940
3951
  });
3941
3952
  this.ws?.send(JSON.stringify(frame));
@@ -4268,7 +4279,7 @@ function normalizeHub2dHttpBase(hub2dUrl, apiPort) {
4268
4279
  }
4269
4280
  function buildAuthHeaders(config) {
4270
4281
  const headers = {};
4271
- const apiKey = config.nexusApiKey ?? process.env.NEXUS_API_KEY ?? "";
4282
+ const apiKey = config.nexusApiKey ?? getEnv("NEXUS_API_KEY") ?? "";
4272
4283
  if (apiKey) {
4273
4284
  headers["x-api-key"] = apiKey;
4274
4285
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexus-channel",
3
- "version": "1.8.0",
3
+ "version": "1.8.1",
4
4
  "description": "Nexus Hub 2.0 channel plugin for OpenClaw — enables agents to connect to Nexus Hub as a channel, with A2A dispatch, room summary, and Control Plane management.",
5
5
  "type": "commonjs",
6
6
  "main": "dist/index.js",