@camstack/system 1.2.88 → 1.2.90
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.
- package/dist/addon-runner.js +52 -6
- package/dist/addon-runner.mjs +52 -6
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
- package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
- package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
- package/dist/builtins/alerts/alerts.addon.js +1 -1
- package/dist/builtins/alerts/alerts.addon.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
- package/dist/builtins/console-logging/index.js +1 -1
- package/dist/builtins/console-logging/index.mjs +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +1 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
- package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
- package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
- package/dist/builtins/local-network/local-network.addon.js +1 -1
- package/dist/builtins/local-network/local-network.addon.mjs +1 -1
- package/dist/builtins/loki-logging/index.js +1 -1
- package/dist/builtins/loki-logging/index.mjs +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
- package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
- package/dist/builtins/platform-probe/index.js +1 -1
- package/dist/builtins/platform-probe/index.mjs +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
- package/dist/builtins/snapshot/index.js +1 -1
- package/dist/builtins/snapshot/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
- package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +1 -1
- package/dist/builtins/storage-orchestrator/index.mjs +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +47 -3
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +46 -3
- package/dist/builtins/system-config/system-config.addon.js +1 -1
- package/dist/builtins/system-config/system-config.addon.mjs +1 -1
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{dist-B4WyhfjH.js → dist-CYqL8oZq.js} +2121 -37
- package/dist/{dist-DlDY9mQO.mjs → dist-DMhxx5Kr.mjs} +2121 -37
- package/dist/index.js +2 -46
- package/dist/index.mjs +2 -46
- package/dist/kernel/moleculer/init-watchdog.d.ts +60 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
2
|
const require_chunk = require("./chunk-Cek0wNdY.js");
|
|
3
|
-
const require_dist = require("./dist-
|
|
3
|
+
const require_dist = require("./dist-CYqL8oZq.js");
|
|
4
4
|
const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
|
|
5
5
|
require("./builtins/alerts/index.js");
|
|
6
6
|
const require_formatter = require("./formatter-DqAKDlvN.js");
|
|
@@ -9982,50 +9982,6 @@ var ConfigManager = class ConfigManager {
|
|
|
9982
9982
|
}
|
|
9983
9983
|
};
|
|
9984
9984
|
//#endregion
|
|
9985
|
-
//#region src/kernel/storage-location-registry.ts
|
|
9986
|
-
/**
|
|
9987
|
-
* Aggregates per-addon {@link StorageLocationDeclaration} arrays into a single
|
|
9988
|
-
* {@link StorageLocationRegistry}.
|
|
9989
|
-
*
|
|
9990
|
-
* Merge rules:
|
|
9991
|
-
* - Declarations are keyed by `id`; iteration order follows first occurrence.
|
|
9992
|
-
* - **First declarer wins** for metadata (`displayName`, `description`,
|
|
9993
|
-
* `defaultsTo`): if a later addon declares the same `id`, its metadata is
|
|
9994
|
-
* silently ignored.
|
|
9995
|
-
* - **Cardinality conflict throws**: if two addons declare the same `id` with
|
|
9996
|
-
* different `cardinality` values an `Error` is thrown immediately (message
|
|
9997
|
-
* contains the words "cardinality" and the conflicting `id`).
|
|
9998
|
-
*
|
|
9999
|
-
* @param perAddon - One entry per addon; each entry is that addon's
|
|
10000
|
-
* `storageLocations` declaration array.
|
|
10001
|
-
*/
|
|
10002
|
-
function buildStorageLocationRegistry(perAddon) {
|
|
10003
|
-
const map = /* @__PURE__ */ new Map();
|
|
10004
|
-
for (const addonDeclarations of perAddon) for (const declaration of addonDeclarations) {
|
|
10005
|
-
const existing = map.get(declaration.id);
|
|
10006
|
-
if (existing !== void 0) {
|
|
10007
|
-
if (existing.cardinality !== declaration.cardinality) throw new Error(`Storage location cardinality conflict for id "${declaration.id}": "${existing.cardinality}" (first declarer) vs "${declaration.cardinality}" (later declarer). All addons declaring the same storage location id must agree on cardinality.`);
|
|
10008
|
-
continue;
|
|
10009
|
-
}
|
|
10010
|
-
map.set(declaration.id, declaration);
|
|
10011
|
-
}
|
|
10012
|
-
const frozen = Object.freeze([...map.values()]);
|
|
10013
|
-
return {
|
|
10014
|
-
get(id) {
|
|
10015
|
-
return map.get(id);
|
|
10016
|
-
},
|
|
10017
|
-
has(id) {
|
|
10018
|
-
return map.has(id);
|
|
10019
|
-
},
|
|
10020
|
-
cardinalityOf(id) {
|
|
10021
|
-
return map.get(id)?.cardinality ?? null;
|
|
10022
|
-
},
|
|
10023
|
-
list() {
|
|
10024
|
-
return frozen;
|
|
10025
|
-
}
|
|
10026
|
-
};
|
|
10027
|
-
}
|
|
10028
|
-
//#endregion
|
|
10029
9985
|
//#region ../../node_modules/moleculer/src/constants.js
|
|
10030
9986
|
var require_constants$7 = /* @__PURE__ */ require_chunk.__commonJSMin(((exports, module) => {
|
|
10031
9987
|
module.exports = {
|
|
@@ -95289,7 +95245,7 @@ exports.buildHeapSample = buildHeapSample;
|
|
|
95289
95245
|
exports.buildLinkChain = require_manifest_python_deps.buildLinkChain;
|
|
95290
95246
|
exports.buildNativeCapProxy = require_manifest_python_deps.buildNativeCapProxy;
|
|
95291
95247
|
exports.buildNodeManifest = buildNodeManifest;
|
|
95292
|
-
exports.buildStorageLocationRegistry = buildStorageLocationRegistry;
|
|
95248
|
+
exports.buildStorageLocationRegistry = require_builtins_storage_orchestrator_storage_orchestrator_addon.buildStorageLocationRegistry;
|
|
95293
95249
|
exports.buildUdsNativeCapProxy = require_manifest_python_deps.buildUdsNativeCapProxy;
|
|
95294
95250
|
exports.builderMountedCapNames = builderMountedCapNames;
|
|
95295
95251
|
exports.callRegisterNodeWithRetry = callRegisterNodeWithRetry;
|
package/dist/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
|
|
2
|
-
import { $ as objectInputDeclaresAddonId, At as createEvent, B as isArrayOutputSchema, Bt as resolveCapMount, Dt as asJsonObject$1, G as kebabToCamel, H as isObjectInput, K as lifecycleJobSchema, Lt as parseJsonObject, Nt as expandCapMethods, Ot as asNumber, R as extractNestedAddonId, Rt as parseJsonUnknown$1, Tt as ReadinessTimeoutError, Ut as EventCategory$1, V as isCollectionArrayMethod, Vt as scopeKey, W as isVoidInput, X as looseSchema, Y as logLevelAtMost, at as scopesAllowDeviceCap, bt as DEVICE_STATUS_METHOD, d as METHOD_ACCESS_MAP, f as RUNTIME_DEFAULTS, gt as errMsg$1, it as scopesAllowAddon, jt as emitDownForOwnedCaps, kt as asString$1, nt as procedureAuthKey, t as ALL_CAPABILITY_DEFINITIONS, vt as DATAPLANE_SECRET_HEADER$1, wt as ReadinessRegistry, y as addonSettingsCapability, yt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, zt as readinessKey } from "./dist-
|
|
2
|
+
import { $ as objectInputDeclaresAddonId, At as createEvent, B as isArrayOutputSchema, Bt as resolveCapMount, Dt as asJsonObject$1, G as kebabToCamel, H as isObjectInput, K as lifecycleJobSchema, Lt as parseJsonObject, Nt as expandCapMethods, Ot as asNumber, R as extractNestedAddonId, Rt as parseJsonUnknown$1, Tt as ReadinessTimeoutError, Ut as EventCategory$1, V as isCollectionArrayMethod, Vt as scopeKey, W as isVoidInput, X as looseSchema, Y as logLevelAtMost, at as scopesAllowDeviceCap, bt as DEVICE_STATUS_METHOD, d as METHOD_ACCESS_MAP, f as RUNTIME_DEFAULTS, gt as errMsg$1, it as scopesAllowAddon, jt as emitDownForOwnedCaps, kt as asString$1, nt as procedureAuthKey, t as ALL_CAPABILITY_DEFINITIONS, vt as DATAPLANE_SECRET_HEADER$1, wt as ReadinessRegistry, y as addonSettingsCapability, yt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, zt as readinessKey } from "./dist-DMhxx5Kr.mjs";
|
|
3
3
|
import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
|
|
4
4
|
import "./builtins/alerts/index.mjs";
|
|
5
5
|
import { t as formatLogLine } from "./formatter-B7qW8bPJ.mjs";
|
|
@@ -18,7 +18,7 @@ import NativeMetricsAddon, { t as NativeMetricsProvider } from "./builtins/nativ
|
|
|
18
18
|
import { FilesystemStorageAddon, t as FilesystemStorageProvider } from "./builtins/sqlite-storage/filesystem-storage.addon.mjs";
|
|
19
19
|
import { SqliteSettingsAddon, o as SqliteSettingsBackend } from "./builtins/sqlite-storage/sqlite-settings.addon.mjs";
|
|
20
20
|
import { ConfigStore, DeviceStore } from "./builtins/sqlite-storage/index.mjs";
|
|
21
|
-
import { StorageOrchestratorAddon, t as StorageOrchestratorService } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
21
|
+
import { StorageOrchestratorAddon, n as buildStorageLocationRegistry, t as StorageOrchestratorService } from "./builtins/storage-orchestrator/storage-orchestrator.addon.mjs";
|
|
22
22
|
import "./builtins/storage-orchestrator/index.mjs";
|
|
23
23
|
import { SystemConfigAddon } from "./builtins/system-config/system-config.addon.mjs";
|
|
24
24
|
import "./builtins/system-config/index.mjs";
|
|
@@ -9974,50 +9974,6 @@ var ConfigManager = class ConfigManager {
|
|
|
9974
9974
|
}
|
|
9975
9975
|
};
|
|
9976
9976
|
//#endregion
|
|
9977
|
-
//#region src/kernel/storage-location-registry.ts
|
|
9978
|
-
/**
|
|
9979
|
-
* Aggregates per-addon {@link StorageLocationDeclaration} arrays into a single
|
|
9980
|
-
* {@link StorageLocationRegistry}.
|
|
9981
|
-
*
|
|
9982
|
-
* Merge rules:
|
|
9983
|
-
* - Declarations are keyed by `id`; iteration order follows first occurrence.
|
|
9984
|
-
* - **First declarer wins** for metadata (`displayName`, `description`,
|
|
9985
|
-
* `defaultsTo`): if a later addon declares the same `id`, its metadata is
|
|
9986
|
-
* silently ignored.
|
|
9987
|
-
* - **Cardinality conflict throws**: if two addons declare the same `id` with
|
|
9988
|
-
* different `cardinality` values an `Error` is thrown immediately (message
|
|
9989
|
-
* contains the words "cardinality" and the conflicting `id`).
|
|
9990
|
-
*
|
|
9991
|
-
* @param perAddon - One entry per addon; each entry is that addon's
|
|
9992
|
-
* `storageLocations` declaration array.
|
|
9993
|
-
*/
|
|
9994
|
-
function buildStorageLocationRegistry(perAddon) {
|
|
9995
|
-
const map = /* @__PURE__ */ new Map();
|
|
9996
|
-
for (const addonDeclarations of perAddon) for (const declaration of addonDeclarations) {
|
|
9997
|
-
const existing = map.get(declaration.id);
|
|
9998
|
-
if (existing !== void 0) {
|
|
9999
|
-
if (existing.cardinality !== declaration.cardinality) throw new Error(`Storage location cardinality conflict for id "${declaration.id}": "${existing.cardinality}" (first declarer) vs "${declaration.cardinality}" (later declarer). All addons declaring the same storage location id must agree on cardinality.`);
|
|
10000
|
-
continue;
|
|
10001
|
-
}
|
|
10002
|
-
map.set(declaration.id, declaration);
|
|
10003
|
-
}
|
|
10004
|
-
const frozen = Object.freeze([...map.values()]);
|
|
10005
|
-
return {
|
|
10006
|
-
get(id) {
|
|
10007
|
-
return map.get(id);
|
|
10008
|
-
},
|
|
10009
|
-
has(id) {
|
|
10010
|
-
return map.has(id);
|
|
10011
|
-
},
|
|
10012
|
-
cardinalityOf(id) {
|
|
10013
|
-
return map.get(id)?.cardinality ?? null;
|
|
10014
|
-
},
|
|
10015
|
-
list() {
|
|
10016
|
-
return frozen;
|
|
10017
|
-
}
|
|
10018
|
-
};
|
|
10019
|
-
}
|
|
10020
|
-
//#endregion
|
|
10021
9977
|
//#region ../../node_modules/moleculer/src/constants.js
|
|
10022
9978
|
var require_constants$7 = /* @__PURE__ */ __commonJSMin$1(((exports, module) => {
|
|
10023
9979
|
module.exports = {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The initialize() stall watchdog.
|
|
3
|
+
*
|
|
4
|
+
* ## What it is guarding
|
|
5
|
+
*
|
|
6
|
+
* A runner publishes its capability manifest ONLY once every hosted addon's
|
|
7
|
+
* `initialize()` has returned: `addon-runner.ts` appends to `runnerManifest`
|
|
8
|
+
* AFTER the await, and `refreshChildCaps('post-init')` runs after the whole
|
|
9
|
+
* loop. So an `initialize()` that does not return is not a slow feature — it
|
|
10
|
+
* takes every capability that addon owns OFF the cluster. Callers get
|
|
11
|
+
* `no provider registered for cap "…"`, and the admin UI renders "provider not
|
|
12
|
+
* available".
|
|
13
|
+
*
|
|
14
|
+
* ## Why a log line and not a bound
|
|
15
|
+
*
|
|
16
|
+
* 2026-08-14: `pipeline-analytics` awaited a timelapse back-fill render inside
|
|
17
|
+
* `initialize()`. The window was 19:00→05:00, the export rendered for over half
|
|
18
|
+
* an hour, and for that whole time `notification-rules`, `pipeline-analytics`,
|
|
19
|
+
* `zone-analytics`, `audio-metrics`, `videoclips`, `face-gallery`,
|
|
20
|
+
* `plate-gallery` and `addon-widgets-source` had ZERO providers cluster-wide.
|
|
21
|
+
* The runner was healthy and chatty throughout — its 30 s tick kept logging —
|
|
22
|
+
* which is exactly why nothing looked wrong. Not one line said the manifest had
|
|
23
|
+
* never been published, and the diagnosis cost hours of log correlation.
|
|
24
|
+
*
|
|
25
|
+
* Killing the runner mid-init would be worse than the stall (a half-initialised
|
|
26
|
+
* addon respawning in a loop), so this does not bound anything. It makes the
|
|
27
|
+
* stall NAMED, periodic, and attributable to the addon and the exact
|
|
28
|
+
* capabilities it is holding hostage — which is the one thing that was missing.
|
|
29
|
+
*/
|
|
30
|
+
/** First warning after this long without `initialize()` returning. */
|
|
31
|
+
export declare const INIT_WATCHDOG_FIRST_MS = 60000;
|
|
32
|
+
/** And every this often afterwards, for as long as it stays stuck. */
|
|
33
|
+
export declare const INIT_WATCHDOG_REPEAT_MS = 300000;
|
|
34
|
+
/** The warn sink — narrow on purpose, so this module needs no logger type. */
|
|
35
|
+
export type InitWatchdogWarn = (message: string, meta: Record<string, unknown>) => void;
|
|
36
|
+
export interface InitWatchdogOptions {
|
|
37
|
+
/** The addon whose `initialize()` is being awaited. */
|
|
38
|
+
readonly addonId: string;
|
|
39
|
+
/**
|
|
40
|
+
* The capability names the addon's manifest declares. They are what the
|
|
41
|
+
* cluster is missing while the stall lasts, so they belong in the line — a
|
|
42
|
+
* reader must not have to open the manifest to learn what is offline.
|
|
43
|
+
*/
|
|
44
|
+
readonly declaredCapabilities: readonly string[];
|
|
45
|
+
readonly warn: InitWatchdogWarn;
|
|
46
|
+
readonly now?: () => number;
|
|
47
|
+
readonly firstMs?: number;
|
|
48
|
+
readonly repeatMs?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface InitWatchdogHandle {
|
|
51
|
+
/** Stop warning. Safe to call more than once, and after the last warning. */
|
|
52
|
+
clear(): void;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Start warning if `initialize()` has not returned within `firstMs`.
|
|
56
|
+
*
|
|
57
|
+
* The caller MUST `clear()` in a `finally`, so a throwing initialize (which the
|
|
58
|
+
* runner turns into `process.exit(1)`) does not keep the timer alive.
|
|
59
|
+
*/
|
|
60
|
+
export declare function startInitWatchdog(options: InitWatchdogOptions): InitWatchdogHandle;
|