mqtt-plus 1.4.21 → 1.4.23

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.
@@ -0,0 +1,49 @@
1
+ ase: [2026-05-13 20:15:20.226]: [INFO]: service: listening on port 42226
2
+ ase: [2026-05-13 20:15:20.300]: [INFO]: mcp: POST /mcp [initialize]
3
+ ase: [2026-05-13 20:15:20.317]: [INFO]: mcp: POST /mcp [notifications/initialized]
4
+ ase: [2026-05-13 20:15:20.319]: [INFO]: mcp: POST /mcp [tools/list]
5
+ ase: [2026-05-13 20:15:20.322]: [INFO]: mcp: GET /mcp
6
+ ase: [2026-05-13 20:20:22.656]: [INFO]: mcp: GET /mcp
7
+ ase: [2026-05-13 20:51:20.220]: [INFO]: service: idle timeout reached, stopping
8
+ ase: [2026-05-13 20:55:00.982]: [INFO]: service: listening on port 42413
9
+ ase: [2026-05-13 20:55:01.077]: [INFO]: mcp: POST /mcp [initialize]
10
+ ase: [2026-05-13 20:55:01.096]: [INFO]: mcp: POST /mcp [notifications/initialized]
11
+ ase: [2026-05-13 20:55:01.098]: [INFO]: mcp: POST /mcp [tools/list]
12
+ ase: [2026-05-13 20:55:01.101]: [INFO]: mcp: GET /mcp
13
+ ase: [2026-05-13 20:56:14.582]: [INFO]: mcp: POST /mcp [initialize]
14
+ ase: [2026-05-13 20:56:14.591]: [INFO]: mcp: POST /mcp [notifications/initialized]
15
+ ase: [2026-05-13 20:56:14.593]: [INFO]: mcp: POST /mcp [tools/list]
16
+ ase: [2026-05-13 20:56:14.595]: [INFO]: mcp: GET /mcp
17
+ ase: [2026-05-13 21:01:16.555]: [INFO]: mcp: GET /mcp
18
+ ase: [2026-05-13 21:07:48.526]: [INFO]: mcp: POST /mcp [initialize]
19
+ ase: [2026-05-13 21:07:48.537]: [INFO]: mcp: POST /mcp [notifications/initialized]
20
+ ase: [2026-05-13 21:07:48.538]: [INFO]: mcp: POST /mcp [tools/list]
21
+ ase: [2026-05-13 21:07:48.540]: [INFO]: mcp: GET /mcp
22
+ ase: [2026-05-13 21:12:50.588]: [INFO]: mcp: GET /mcp
23
+ ase: [2026-05-13 21:43:01.037]: [INFO]: service: idle timeout reached, stopping
24
+ ase: [2026-05-14 17:11:46.347]: [INFO]: service: listening on port 42082
25
+ ase: [2026-05-14 17:11:46.437]: [INFO]: mcp: POST /mcp [initialize]
26
+ ase: [2026-05-14 17:11:46.451]: [INFO]: mcp: POST /mcp [notifications/initialized]
27
+ ase: [2026-05-14 17:11:46.453]: [INFO]: mcp: POST /mcp [tools/list]
28
+ ase: [2026-05-14 17:11:46.456]: [INFO]: mcp: GET /mcp
29
+ ase: [2026-05-14 17:42:46.329]: [INFO]: service: idle timeout reached, stopping
30
+ ase: [2026-06-08 17:52:21.737]: [INFO]: service: listening on port 43130
31
+ ase: [2026-06-08 17:52:21.839]: [INFO]: mcp: POST /mcp [initialize]
32
+ ase: [2026-06-08 17:52:21.856]: [INFO]: mcp: POST /mcp [notifications/initialized]
33
+ ase: [2026-06-08 17:52:21.859]: [INFO]: mcp: POST /mcp [tools/list]
34
+ ase: [2026-06-08 17:52:21.864]: [INFO]: mcp: GET /mcp
35
+ ase: [2026-06-08 20:09:05.091]: [INFO]: mcp: POST /mcp [initialize]
36
+ ase: [2026-06-08 20:09:05.111]: [INFO]: mcp: POST /mcp [notifications/initialized]
37
+ ase: [2026-06-08 20:09:05.114]: [INFO]: mcp: POST /mcp [tools/list]
38
+ ase: [2026-06-08 20:09:05.118]: [INFO]: mcp: GET /mcp
39
+ ase: [2026-06-08 20:14:06.973]: [INFO]: mcp: GET /mcp
40
+ ase: [2026-06-08 20:19:08.840]: [INFO]: mcp: GET /mcp
41
+ ase: [2026-06-08 20:24:10.717]: [INFO]: mcp: GET /mcp
42
+ ase: [2026-06-08 20:27:23.946]: [INFO]: mcp: POST /mcp [initialize]
43
+ ase: [2026-06-08 20:27:23.954]: [INFO]: mcp: POST /mcp [notifications/initialized]
44
+ ase: [2026-06-08 20:27:23.957]: [INFO]: mcp: POST /mcp [tools/list]
45
+ ase: [2026-06-08 20:27:23.960]: [INFO]: mcp: GET /mcp
46
+ ase: [2026-06-08 20:29:30.052]: [INFO]: mcp: POST /mcp [initialize]
47
+ ase: [2026-06-08 20:29:30.063]: [INFO]: mcp: POST /mcp [notifications/initialized]
48
+ ase: [2026-06-08 20:29:30.065]: [INFO]: mcp: POST /mcp [tools/list]
49
+ ase: [2026-06-08 20:29:30.073]: [INFO]: mcp: GET /mcp
@@ -0,0 +1 @@
1
+ port: 43130
package/CHANGELOG.md CHANGED
@@ -2,6 +2,13 @@
2
2
  ChangeLog
3
3
  =========
4
4
 
5
+ 1.4.22 (2026-06-08)
6
+ -------------------
7
+
8
+ - IMPROVEMENT: derive instance id from MQTT client's clientId when none is explicitly provided
9
+ - UPDATE: upgrade NPM dependencies
10
+ - CLEANUP: add .ase directory to .gitignore
11
+
5
12
  1.4.21 (2026-05-13)
6
13
  -------------------
7
14
 
@@ -21,6 +21,7 @@
21
21
  ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
22
  ** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
  */
24
+ import { nanoid } from "nanoid";
24
25
  import { TraceTrait } from "./mqtt-plus-trace";
25
26
  import { ensureError } from "./mqtt-plus-error";
26
27
  import { PLazy } from "./mqtt-plus-util";
@@ -55,6 +56,18 @@ export class BaseTrait extends TraceTrait {
55
56
  }
56
57
  /* store MQTT client */
57
58
  this.mqtt = mqtt;
59
+ /* resolve the instance "id": if the user did not provide an
60
+ explicit one, fetch the "clientId" from the underlying MQTT
61
+ client, and only as a last resort fall back to a generated id
62
+ (e.g. for the fake proxy MQTT client without a real clientId) */
63
+ if (this.options.id === "") {
64
+ const clientId = mqtt.isFakeProxy
65
+ ? undefined
66
+ : mqtt.options?.clientId;
67
+ this.options.id = (typeof clientId === "string" && clientId !== "")
68
+ ? clientId
69
+ : nanoid();
70
+ }
58
71
  /* hook into the MQTT message processing */
59
72
  this.log("info", "hooking into MQTT client");
60
73
  this.messageHandler = (topic, message, packet) => {
@@ -21,15 +21,13 @@
21
21
  ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
22
22
  ** SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23
23
  */
24
- /* external requirements */
25
- import { nanoid } from "nanoid";
26
24
  /* Options trait */
27
25
  export class OptionsTrait {
28
26
  /* construct API class */
29
27
  constructor(options = {}) {
30
28
  /* determine options and provide defaults */
31
29
  this.options = {
32
- id: nanoid(),
30
+ id: "", /* intentionally resolved later in BaseTrait */
33
31
  codec: "cbor",
34
32
  timeout: 10 * 1000,
35
33
  share: "",
@@ -402,7 +402,7 @@ function run(...args) {
402
402
  var OptionsTrait = class {
403
403
  constructor(options = {}) {
404
404
  this.options = {
405
- id: (0, nanoid.nanoid)(),
405
+ id: "",
406
406
  codec: "cbor",
407
407
  timeout: 10 * 1e3,
408
408
  share: "",
@@ -931,6 +931,10 @@ var BaseTrait = class extends TraceTrait {
931
931
  } });
932
932
  }
933
933
  this.mqtt = mqtt;
934
+ if (this.options.id === "") {
935
+ const clientId = mqtt.isFakeProxy ? void 0 : mqtt.options?.clientId;
936
+ this.options.id = typeof clientId === "string" && clientId !== "" ? clientId : (0, nanoid.nanoid)();
937
+ }
934
938
  this.log("info", "hooking into MQTT client");
935
939
  this.messageHandler = (topic, message, packet) => {
936
940
  if (this.destroyed) return;
@@ -375,7 +375,7 @@ function run(...args) {
375
375
  var OptionsTrait = class {
376
376
  constructor(options = {}) {
377
377
  this.options = {
378
- id: nanoid(),
378
+ id: "",
379
379
  codec: "cbor",
380
380
  timeout: 10 * 1e3,
381
381
  share: "",
@@ -904,6 +904,10 @@ var BaseTrait = class extends TraceTrait {
904
904
  } });
905
905
  }
906
906
  this.mqtt = mqtt;
907
+ if (this.options.id === "") {
908
+ const clientId = mqtt.isFakeProxy ? void 0 : mqtt.options?.clientId;
909
+ this.options.id = typeof clientId === "string" && clientId !== "" ? clientId : nanoid();
910
+ }
907
911
  this.log("info", "hooking into MQTT client");
908
912
  this.messageHandler = (topic, message, packet) => {
909
913
  if (this.destroyed) return;