smart-home-engine 1.5.3 → 1.6.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.
@@ -1,4 +1,4 @@
1
- import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-D7MHM_y0.js";/*!-----------------------------------------------------------------------------
1
+ import{m as O}from"./monaco-langs-BW2J83t5.js";import{t as I}from"./index-DBAKaUFL.js";/*!-----------------------------------------------------------------------------
2
2
  * Copyright (c) Microsoft Corporation. All rights reserved.
3
3
  * Version: 0.52.2(404545bded1df6ffa41ea0af4e8ddb219018c6c1)
4
4
  * Released under the MIT license
@@ -172,10 +172,10 @@
172
172
  }
173
173
  })();
174
174
  </script>
175
- <script type="module" crossorigin src="/assets/index-D7MHM_y0.js"></script>
175
+ <script type="module" crossorigin src="/assets/index-DBAKaUFL.js"></script>
176
176
  <link rel="modulepreload" crossorigin href="/assets/monaco-langs-BW2J83t5.js">
177
177
  <link rel="stylesheet" crossorigin href="/assets/monaco-langs-DyX1CsEw.css">
178
- <link rel="stylesheet" crossorigin href="/assets/index-CTq7JERy.css">
178
+ <link rel="stylesheet" crossorigin href="/assets/index-D-Rifjr_.css">
179
179
  </head>
180
180
  <body>
181
181
  <div id="app"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "smart-home-engine",
3
- "version": "1.5.3",
3
+ "version": "1.6.1",
4
4
  "description": "Node.js based script runner for use in MQTT based Smart Home environments",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/lib/dynsec.js CHANGED
@@ -64,6 +64,11 @@ function _drain() {
64
64
  clearTimeout(timer);
65
65
  _inflight = false;
66
66
  _inflightResolve = null;
67
+ // Any response from the plugin proves it is active, regardless of the startup probe result.
68
+ if (!_dynsecReady) {
69
+ _dynsecReady = true;
70
+ if (_log) _log.info('dynsec: plugin confirmed active (via response)');
71
+ }
67
72
  const r = responses.find((resp) => resp.command === command);
68
73
  if (r && r.error) {
69
74
  if (_log) _log.debug(`dynsec: ✕ "${command}" error: ${r.error}`);
@@ -937,6 +937,29 @@ router.post('/ca/trusted/addpath', async (req, res) => {
937
937
 
938
938
  module.exports = { router, setLogger, setStore };
939
939
 
940
+ // ── Local tool check ──────────────────────────────────────────────────────────
941
+
942
+ /**
943
+ * GET /she/broker/local/check
944
+ * Check whether local mosquitto tools are available in PATH.
945
+ * Resolves by spawning each tool; ENOENT = not found, any other outcome = found.
946
+ */
947
+ router.get('/local/check', async (req, res) => {
948
+ function probe(cmd) {
949
+ return new Promise((resolve) => {
950
+ const cp = require('child_process').spawn(cmd, ['--help'], { stdio: 'ignore' });
951
+ cp.on('error', (e) => resolve(e.code !== 'ENOENT'));
952
+ cp.on('close', () => resolve(true));
953
+ });
954
+ }
955
+ try {
956
+ const [mosquittoCtrl, mosquitto] = await Promise.all([probe('mosquitto_ctrl'), probe('mosquitto')]);
957
+ res.json({ mosquittoCtrl, mosquitto });
958
+ } catch (err) {
959
+ handleError(res, err);
960
+ }
961
+ });
962
+
940
963
  // ── SSH routes ─────────────────────────────────────────────────────────────────
941
964
  // Note: these routes are mounted on the same router but defined after module.exports
942
965
  // because they add to `router` (which is already exported by reference).