nexus-channel 1.7.4 → 1.7.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.
@@ -38,7 +38,7 @@ const nexusSetupPlugin = {
38
38
  const channelCfg = cfg?.channels?.[CHANNEL] || {};
39
39
  return {
40
40
  accountId: DEFAULT_ACCOUNT,
41
- configured: Boolean(channelCfg.hub2dUrl && channelCfg.agentName),
41
+ configured: Boolean(channelCfg.agentName),
42
42
  };
43
43
  },
44
44
  defaultAccountId: () => DEFAULT_ACCOUNT,
@@ -12,11 +12,11 @@ const directory_1 = require("./runtime/directory");
12
12
  const status_1 = require("./runtime/status");
13
13
  const tools_1 = require("./runtime/tools");
14
14
  const meta = {
15
- id: 'nexus-channel',
16
- label: 'Nexus Channel',
17
- selectionLabel: 'Nexus Hub 2.0 (WS)',
18
- detailLabel: 'Nexus Hub',
19
- docsPath: '/channels/nexus-channel',
15
+ id: 'nexus',
16
+ label: 'Nexus Hub 2.0',
17
+ selectionLabel: 'Nexus Hub (WebSocket)',
18
+ detailLabel: 'Nexus Hub 2.0',
19
+ docsPath: '/channels/nexus',
20
20
  blurb: 'Multi-agent hub with WS + persistence.',
21
21
  };
22
22
  let currentConfig = {};
@@ -49,7 +49,7 @@ const agentTools = (0, tools_1.createAgentTools)({
49
49
  });
50
50
  exports.nexusPlugin = (0, core_1.createChatChannelPlugin)({
51
51
  base: {
52
- id: 'nexus-channel',
52
+ id: 'nexus',
53
53
  meta,
54
54
  capabilities: {
55
55
  chatTypes: ['group'],
@@ -23,10 +23,6 @@ function readChannelsConfig(cfg) {
23
23
  }
24
24
  function getMissingRequiredFields(config) {
25
25
  const missing = [];
26
- if (!isNonEmptyString(config.hub2dUrl))
27
- missing.push('hub2dUrl');
28
- if (!isNonEmptyString(config.roomId))
29
- missing.push('roomId');
30
26
  if (!isNonEmptyString(config.agentName))
31
27
  missing.push('agentName');
32
28
  return missing;
@@ -52,7 +48,7 @@ function resolveNexusConfig(cfg) {
52
48
  longTextThreshold: channelsCfg.longTextThreshold ?? schema_1.DEFAULT_LONG_TEXT,
53
49
  contextInjection: normalizeContextInjection(channelsCfg.contextInjection),
54
50
  };
55
- const missingFields = getMissingRequiredFields(channelsCfg);
51
+ const missingFields = getMissingRequiredFields(resolved);
56
52
  const configured = hasConfig && missingFields.length === 0;
57
53
  return {
58
54
  ...resolved,
@@ -38,7 +38,7 @@ function createOutboundClient(config, sendMessage) {
38
38
  return {
39
39
  async sendText(params) {
40
40
  if (!params.text.trim() || SILENT_PATTERNS.some((pattern) => params.text.trim().startsWith(pattern))) {
41
- return { channel: 'nexus-channel', messageId: `suppressed-${Date.now()}` };
41
+ return { channel: 'nexus', messageId: `suppressed-${Date.now()}` };
42
42
  }
43
43
  const resolved = resolveOutboundTarget(params.to);
44
44
  if (isResolvedOutboundTargetError(resolved)) {
@@ -48,7 +48,7 @@ function createOutboundClient(config, sendMessage) {
48
48
  const targetRoom = exports.KNOWN_ROOMS.some((room) => room.id === resolved.to) ? resolved.to : defaultRoom;
49
49
  const mentions = isAgent && resolved.to !== agentName ? [resolved.to] : undefined;
50
50
  sendMessage(targetRoom, params.text, mentions, `out-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`);
51
- return { channel: 'nexus-channel', messageId: `out-${Date.now()}` };
51
+ return { channel: 'nexus', messageId: `out-${Date.now()}` };
52
52
  },
53
53
  async sendMedia(params) {
54
54
  const resolved = resolveOutboundTarget(params.to);
@@ -58,7 +58,7 @@ function createOutboundClient(config, sendMessage) {
58
58
  const targetRoom = exports.KNOWN_ROOMS.some((room) => room.id === resolved.to) ? resolved.to : defaultRoom;
59
59
  const fallbackText = params.text || `[Media: ${params.mediaUrl || 'unsupported'}]`;
60
60
  sendMessage(targetRoom, fallbackText, undefined, `media-${Date.now()}-${Math.random().toString(36).slice(2, 8)}`);
61
- return { channel: 'nexus-channel', messageId: `media-${Date.now()}` };
61
+ return { channel: 'nexus', messageId: `media-${Date.now()}` };
62
62
  },
63
63
  };
64
64
  }
@@ -25,7 +25,19 @@ const resolve_config_1 = require("../../src/config/resolve-config");
25
25
  (0, node_test_1.default)('validateNexusConfig reports missing required fields', () => {
26
26
  const result = (0, resolve_config_1.validateNexusConfig)({});
27
27
  strict_1.default.equal(result.valid, false);
28
- strict_1.default.ok(result.errors.includes('hub2dUrl is required'));
29
- strict_1.default.ok(result.errors.includes('roomId is required'));
30
28
  strict_1.default.ok(result.errors.includes('agentName is required'));
31
29
  });
30
+ (0, node_test_1.default)('resolveNexusConfig uses defaults and only requires agentName', () => {
31
+ const result = (0, resolve_config_1.resolveNexusConfig)({
32
+ channels: {
33
+ nexus: {
34
+ agentName: 'roland',
35
+ },
36
+ },
37
+ });
38
+ strict_1.default.equal(result.agentName, 'roland');
39
+ strict_1.default.equal(result.hub2dUrl, 'ws://111.231.105.183:3001');
40
+ strict_1.default.equal(result.roomId, 'general,boss,alpha');
41
+ strict_1.default.equal(result.__nexusMeta.configured, true);
42
+ strict_1.default.equal(result.__nexusMeta.missingFields.length, 0);
43
+ });
@@ -10,7 +10,7 @@
10
10
  "properties": {}
11
11
  },
12
12
  "channelConfigs": {
13
- "nexus-channel": {
13
+ "nexus": {
14
14
  "schema": {
15
15
  "type": "object",
16
16
  "additionalProperties": false,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nexus-channel",
3
- "version": "1.7.4",
3
+ "version": "1.7.6",
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",