@camstack/system 1.2.473 → 1.2.474
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/{agent-https-DOwn4pqL.mjs → agent-https-CbczsyM0.mjs} +1 -1
- package/dist/{agent-https-B9Q3-IKd.js → agent-https-DRwEbLL7.js} +1 -1
- 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/autotrack/index.js +1 -1
- package/dist/builtins/autotrack/index.mjs +1 -1
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
- package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
- package/dist/builtins/calendars/calendars.addon.js +1 -1
- package/dist/builtins/calendars/calendars.addon.mjs +1 -1
- package/dist/builtins/camera-grid/index.js +1 -1
- package/dist/builtins/camera-grid/index.mjs +1 -1
- package/dist/builtins/composer/composer.addon.js +2 -2
- package/dist/builtins/composer/composer.addon.mjs +2 -2
- 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 +2 -2
- package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
- package/dist/builtins/device-history/device-history.addon.js +1 -1
- package/dist/builtins/device-history/device-history.addon.mjs +1 -1
- package/dist/builtins/device-manager/device-manager.addon.js +71 -1
- package/dist/builtins/device-manager/device-manager.addon.mjs +71 -1
- package/dist/builtins/device-manager/device-state-mirror.d.ts +4 -0
- package/dist/builtins/device-manager/running-flip.d.ts +11 -0
- package/dist/builtins/hub-forwarder/index.js +1 -1
- package/dist/builtins/hub-forwarder/index.mjs +1 -1
- package/dist/builtins/keychain/index.js +3 -3
- package/dist/builtins/keychain/index.mjs +3 -3
- 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 +2 -2
- package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
- package/dist/builtins/local-network/local-network.addon.js +2 -2
- package/dist/builtins/local-network/local-network.addon.mjs +2 -2
- 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/record-entries/index.js +1 -1
- package/dist/builtins/record-entries/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/index.js +1 -1
- package/dist/builtins/sqlite-storage/index.mjs +1 -1
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
- package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
- package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
- package/dist/builtins/system-config/system-config.addon.js +3 -3
- package/dist/builtins/system-config/system-config.addon.mjs +3 -3
- package/dist/builtins/winston-logging/index.js +1 -1
- package/dist/builtins/winston-logging/index.mjs +1 -1
- package/dist/{composition-sources-Dj_nInUQ.js → composition-sources-CJv3W669.js} +1 -1
- package/dist/{composition-sources-cwD35HB0.mjs → composition-sources-CsBIIit3.mjs} +1 -1
- package/dist/{constants-XkWSVvgY.js → constants-C0hrXcEr.js} +1 -1
- package/dist/{constants-p5mPM1iL.mjs → constants-Dy8CaDeT.mjs} +1 -1
- package/dist/{device-ca-DyUtcpf4.mjs → device-ca-CHdsePe5.mjs} +1 -1
- package/dist/{device-ca-BXzQ1pYj.js → device-ca-Dg3rSU48.js} +1 -1
- package/dist/{dist-C9lbdBL5.mjs → dist-BugavoVR.mjs} +198 -97
- package/dist/{dist-Bmah6waF.js → dist-Sn-HiZ4e.js} +198 -97
- package/dist/file-host-worker.js +1 -1
- package/dist/file-host-worker.mjs +1 -1
- package/dist/{hub-mdns-ciao-BemeCNGe.mjs → hub-mdns-ciao-BDvqGIw4.mjs} +2 -2
- package/dist/{hub-mdns-ciao-CUr6ewsX.js → hub-mdns-ciao-DkncLbg9.js} +2 -2
- package/dist/index.js +13 -7
- package/dist/index.mjs +13 -7
- package/dist/{restore-archive-C0aohmAK.mjs → restore-archive-CFBm30Gk.mjs} +1 -1
- package/dist/{restore-archive-DbPmyjiM.js → restore-archive-gYKzaJ4Y.js} +1 -1
- package/dist/{wal-maintenance-BuB731DK.mjs → wal-maintenance-BnhkcEkI.mjs} +0 -0
- package/dist/{wal-maintenance-BT8Ns0W3.js → wal-maintenance-DyMUz_Hy.js} +0 -0
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
import "node:crypto";
|
|
3
|
-
//#region ../types/dist/event-category-
|
|
3
|
+
//#region ../types/dist/event-category-Ceif8n-v.mjs
|
|
4
4
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
5
5
|
EventCategory["SystemBoot"] = "system.boot";
|
|
6
6
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -472,6 +472,10 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
472
472
|
* on the device detail page.
|
|
473
473
|
*/
|
|
474
474
|
EventCategory["DoorbellOnPressed"] = "doorbell.onPressed";
|
|
475
|
+
/** Mirrors `runningStateCapability.events.onStarted`. */
|
|
476
|
+
EventCategory["RunningStarted"] = "running.started";
|
|
477
|
+
/** Mirrors `runningStateCapability.events.onFinished`. */
|
|
478
|
+
EventCategory["RunningFinished"] = "running.finished";
|
|
475
479
|
/**
|
|
476
480
|
* Cap event fired by every device that registers the `event-emitter`
|
|
477
481
|
* capability. Mirrors `eventEmitterCapability.events.onEvent`. Carries
|
|
@@ -761,7 +765,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
761
765
|
return EventCategory;
|
|
762
766
|
}({});
|
|
763
767
|
//#endregion
|
|
764
|
-
//#region ../types/dist/sleep-
|
|
768
|
+
//#region ../types/dist/sleep-CYfIZzGv.mjs
|
|
765
769
|
/**
|
|
766
770
|
* The audio chunk plane's byte format, and the ONE expansion from a coded
|
|
767
771
|
* window to float samples (D455).
|
|
@@ -1152,7 +1156,7 @@ var WELL_KNOWN_TAB_MAP = Object.fromEntries([
|
|
|
1152
1156
|
* `hydrateSchema` to skip the `value` injection for structural-only fields.
|
|
1153
1157
|
*/
|
|
1154
1158
|
function isValuelessField(field) {
|
|
1155
|
-
return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button";
|
|
1159
|
+
return field.type === "separator" || field.type === "info" || field.type === "qr-code" || field.type === "button" || field.type === "object-array" || field.type === "widget" || field.type === "addon-action-button" || field.type === "device-action-button" || field.type === "account-sign-in" || field.type === "secret-presence";
|
|
1156
1160
|
}
|
|
1157
1161
|
function hydrateSchema(schema, values, options = {}) {
|
|
1158
1162
|
return {
|
|
@@ -5480,7 +5484,7 @@ function errMsg(err) {
|
|
|
5480
5484
|
return String(err);
|
|
5481
5485
|
}
|
|
5482
5486
|
//#endregion
|
|
5483
|
-
//#region ../types/dist/composition-
|
|
5487
|
+
//#region ../types/dist/composition-xz-ud5EQ.mjs
|
|
5484
5488
|
var AUDIO_ENCODER_BY_CODEC = {
|
|
5485
5489
|
opus: "libopus",
|
|
5486
5490
|
aac: "aac",
|
|
@@ -6011,7 +6015,7 @@ var ExpressionEvalError = class extends Error {
|
|
|
6011
6015
|
}
|
|
6012
6016
|
};
|
|
6013
6017
|
function isStatefulBuiltin(name) {
|
|
6014
|
-
return name === "rose" || name === "count";
|
|
6018
|
+
return name === "rose" || name === "count" || name === "dwell" || name === "latchedAt";
|
|
6015
6019
|
}
|
|
6016
6020
|
function asFiniteNumber(value, name, index) {
|
|
6017
6021
|
if (typeof value !== "number" || !Number.isFinite(value)) throw new ExpressionEvalError(`${name}: argument ${index + 1} must be a finite number`);
|
|
@@ -6102,6 +6106,57 @@ function disarmRoseMemory(memory) {
|
|
|
6102
6106
|
* input is its own `lastPressedAt`, which only advances on a `rose` edge that
|
|
6103
6107
|
* also emits the press — but an external input can overcount by one.
|
|
6104
6108
|
*/
|
|
6109
|
+
function asNonNegativeMs(value, name, index) {
|
|
6110
|
+
const ms = asFiniteNumber(value, name, index);
|
|
6111
|
+
if (ms < 0) throw new ExpressionEvalError(`${name}: delay must be a non-negative finite number`);
|
|
6112
|
+
return ms;
|
|
6113
|
+
}
|
|
6114
|
+
/**
|
|
6115
|
+
* `dwell(active, onForMs, offForMs)`: unknown until a delay elapses, then holds
|
|
6116
|
+
* the latched boolean through gaps shorter than the opposing delay (D933).
|
|
6117
|
+
*/
|
|
6118
|
+
function evaluateDwell(activeRaw, onForMsRaw, offForMsRaw, call, nowMs, hooks) {
|
|
6119
|
+
const active = asBoolean(activeRaw, "dwell", 0);
|
|
6120
|
+
const onForMs = asNonNegativeMs(onForMsRaw, "dwell", 1);
|
|
6121
|
+
const offForMs = asNonNegativeMs(offForMsRaw, "dwell", 2);
|
|
6122
|
+
if (call.latched === null) {
|
|
6123
|
+
if (call.seenSince === null) call.seenSince = nowMs;
|
|
6124
|
+
const delay = active ? onForMs : offForMs;
|
|
6125
|
+
if (nowMs - call.seenSince >= delay) {
|
|
6126
|
+
call.latched = active;
|
|
6127
|
+
return call.latched;
|
|
6128
|
+
}
|
|
6129
|
+
hooks?.noteDeadline?.(call.seenSince + delay);
|
|
6130
|
+
return null;
|
|
6131
|
+
}
|
|
6132
|
+
if (active === call.latched) {
|
|
6133
|
+
call.pendingSince = null;
|
|
6134
|
+
return call.latched;
|
|
6135
|
+
}
|
|
6136
|
+
if (call.pendingSince === null) call.pendingSince = nowMs;
|
|
6137
|
+
const delay = active ? onForMs : offForMs;
|
|
6138
|
+
if (nowMs - call.pendingSince >= delay) {
|
|
6139
|
+
call.latched = active;
|
|
6140
|
+
call.pendingSince = null;
|
|
6141
|
+
return call.latched;
|
|
6142
|
+
}
|
|
6143
|
+
hooks?.noteDeadline?.(call.pendingSince + delay);
|
|
6144
|
+
return call.latched;
|
|
6145
|
+
}
|
|
6146
|
+
/** `latchedAt(value)`: epoch ms when `value` last changed; null clears the stamp. */
|
|
6147
|
+
function evaluateLatchedAt(value, call, nowMs) {
|
|
6148
|
+
if (value === null) {
|
|
6149
|
+
call.last = null;
|
|
6150
|
+
call.at = null;
|
|
6151
|
+
return null;
|
|
6152
|
+
}
|
|
6153
|
+
if (typeof value !== "boolean" && typeof value !== "number" && typeof value !== "string") return call.at;
|
|
6154
|
+
if (call.last !== value) {
|
|
6155
|
+
call.last = value;
|
|
6156
|
+
call.at = nowMs;
|
|
6157
|
+
}
|
|
6158
|
+
return call.at;
|
|
6159
|
+
}
|
|
6105
6160
|
function evaluateCount(input, call, currentOutput) {
|
|
6106
6161
|
const currentCount = typeof currentOutput === "number" && Number.isFinite(currentOutput) && currentOutput >= 0 ? currentOutput : 0;
|
|
6107
6162
|
if (input === null) {
|
|
@@ -6271,6 +6326,20 @@ var table = {
|
|
|
6271
6326
|
apply: () => {
|
|
6272
6327
|
throw new ExpressionEvalError("count: stateful evaluation context is required");
|
|
6273
6328
|
}
|
|
6329
|
+
},
|
|
6330
|
+
dwell: {
|
|
6331
|
+
minArgs: 3,
|
|
6332
|
+
maxArgs: 3,
|
|
6333
|
+
apply: () => {
|
|
6334
|
+
throw new ExpressionEvalError("dwell: stateful evaluation context is required");
|
|
6335
|
+
}
|
|
6336
|
+
},
|
|
6337
|
+
latchedAt: {
|
|
6338
|
+
minArgs: 1,
|
|
6339
|
+
maxArgs: 1,
|
|
6340
|
+
apply: () => {
|
|
6341
|
+
throw new ExpressionEvalError("latchedAt: stateful evaluation context is required");
|
|
6342
|
+
}
|
|
6274
6343
|
}
|
|
6275
6344
|
};
|
|
6276
6345
|
/** Frozen, null-prototype builtin table. */
|
|
@@ -6816,7 +6885,7 @@ function cloneStatefulExpressionMemory(memory) {
|
|
|
6816
6885
|
disarmRoseNext: memory.disarmRoseNext
|
|
6817
6886
|
};
|
|
6818
6887
|
}
|
|
6819
|
-
function evaluateStatefulExpressionCall(invocation, memory, env) {
|
|
6888
|
+
function evaluateStatefulExpressionCall(invocation, memory, env, hooks) {
|
|
6820
6889
|
const existing = memory.calls.get(invocation.path);
|
|
6821
6890
|
switch (invocation.name) {
|
|
6822
6891
|
case "rose": {
|
|
@@ -6838,6 +6907,25 @@ function evaluateStatefulExpressionCall(invocation, memory, env) {
|
|
|
6838
6907
|
memory.calls.set(invocation.path, call);
|
|
6839
6908
|
return evaluateCount(invocation.args[0], call, env.currentOutput);
|
|
6840
6909
|
}
|
|
6910
|
+
case "dwell": {
|
|
6911
|
+
const call = existing?.kind === "dwell" ? existing : {
|
|
6912
|
+
kind: "dwell",
|
|
6913
|
+
pendingSince: null,
|
|
6914
|
+
latched: null,
|
|
6915
|
+
seenSince: null
|
|
6916
|
+
};
|
|
6917
|
+
memory.calls.set(invocation.path, call);
|
|
6918
|
+
return evaluateDwell(invocation.args[0], invocation.args[1], invocation.args[2], call, env.nowMs, hooks);
|
|
6919
|
+
}
|
|
6920
|
+
case "latchedAt": {
|
|
6921
|
+
const call = existing?.kind === "latchedAt" ? existing : {
|
|
6922
|
+
kind: "latchedAt",
|
|
6923
|
+
last: void 0,
|
|
6924
|
+
at: null
|
|
6925
|
+
};
|
|
6926
|
+
memory.calls.set(invocation.path, call);
|
|
6927
|
+
return evaluateLatchedAt(invocation.args[0], call, env.nowMs);
|
|
6928
|
+
}
|
|
6841
6929
|
}
|
|
6842
6930
|
}
|
|
6843
6931
|
/**
|
|
@@ -15531,7 +15619,15 @@ var BUILTIN_RESULT_KINDS = Object.freeze({
|
|
|
15531
15619
|
kind: "fixed",
|
|
15532
15620
|
result: ["number", "null"]
|
|
15533
15621
|
},
|
|
15534
|
-
count: NUMBER
|
|
15622
|
+
count: NUMBER,
|
|
15623
|
+
dwell: {
|
|
15624
|
+
kind: "fixed",
|
|
15625
|
+
result: ["boolean", "null"]
|
|
15626
|
+
},
|
|
15627
|
+
latchedAt: {
|
|
15628
|
+
kind: "fixed",
|
|
15629
|
+
result: ["number", "null"]
|
|
15630
|
+
}
|
|
15535
15631
|
});
|
|
15536
15632
|
var KindInferenceError = class extends Error {};
|
|
15537
15633
|
function kindOfValue(value) {
|
|
@@ -45183,9 +45279,6 @@ var NcSystemEventKindSchema = z.enum([
|
|
|
45183
45279
|
"device-battery-normal",
|
|
45184
45280
|
"device-consumable-low",
|
|
45185
45281
|
"device-consumable-normal",
|
|
45186
|
-
"device-tank-low",
|
|
45187
|
-
"device-tank-full",
|
|
45188
|
-
"device-tank-normal",
|
|
45189
45282
|
"stream-online",
|
|
45190
45283
|
"stream-offline",
|
|
45191
45284
|
"node-online",
|
|
@@ -45232,13 +45325,14 @@ var NcSystemEventKindSchema = z.enum([
|
|
|
45232
45325
|
"camera-enabled"
|
|
45233
45326
|
]);
|
|
45234
45327
|
/** The legacy tail of {@link NcSystemEventKindSchema} — see its docblock. */
|
|
45235
|
-
var NC_LEGACY_SYSTEM_EVENT_KINDS =
|
|
45328
|
+
var NC_LEGACY_SYSTEM_EVENT_KINDS = [
|
|
45236
45329
|
"camera-online",
|
|
45237
45330
|
"camera-offline",
|
|
45238
45331
|
"camera-disabled",
|
|
45239
45332
|
"camera-enabled"
|
|
45240
|
-
]
|
|
45241
|
-
|
|
45333
|
+
];
|
|
45334
|
+
var NC_LEGACY_SYSTEM_EVENT_KIND_SET = new Set(NC_LEGACY_SYSTEM_EVENT_KINDS);
|
|
45335
|
+
NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KIND_SET.has(kind));
|
|
45242
45336
|
/**
|
|
45243
45337
|
* The panel's transitions, as ONE list.
|
|
45244
45338
|
*
|
|
@@ -46368,18 +46462,11 @@ var NcRuleSchema = NcRuleInputSchema.extend({
|
|
|
46368
46462
|
*/
|
|
46369
46463
|
disabledTargetIds: z.array(z.string()).default([])
|
|
46370
46464
|
});
|
|
46371
|
-
/**
|
|
46372
|
-
* The state-summary SECTIONS (D647 / D698 / D708): the D637 kind groups that
|
|
46373
|
-
* report a still-true state. `addons` is the crash-looped addons only and
|
|
46374
|
-
* `addon-updates` the addons that are behind (D708 split them). `backups-exports` and `alarm` are not sections — a completed
|
|
46375
|
-
* job is not an open state, and the alarm stays instant.
|
|
46376
|
-
*/
|
|
46377
46465
|
var NcStateSummarySectionIdSchema = z.enum([
|
|
46378
46466
|
"device-state",
|
|
46379
46467
|
"streams",
|
|
46380
46468
|
"battery",
|
|
46381
46469
|
"consumables",
|
|
46382
|
-
"tanks",
|
|
46383
46470
|
"detection-blind",
|
|
46384
46471
|
"nodes",
|
|
46385
46472
|
"addons",
|
|
@@ -68115,6 +68202,41 @@ var ptzAutotrackCapability = {
|
|
|
68115
68202
|
*/
|
|
68116
68203
|
history: "none"
|
|
68117
68204
|
};
|
|
68205
|
+
var RunningStateSourceSchema = z.enum(["native", "assigned"]);
|
|
68206
|
+
var RunningStateStatusSchema = z.object({
|
|
68207
|
+
/** null = unknown — never coerced to false (D393). */
|
|
68208
|
+
running: z.boolean().nullable(),
|
|
68209
|
+
/** Epoch ms the current boolean began; null while `running` is null. */
|
|
68210
|
+
since: z.number().nullable(),
|
|
68211
|
+
source: RunningStateSourceSchema,
|
|
68212
|
+
phase: z.string().nullable(),
|
|
68213
|
+
lastFetchedAt: z.number()
|
|
68214
|
+
});
|
|
68215
|
+
var RunningFlipEventDataSchema = z.object({
|
|
68216
|
+
deviceId: z.number(),
|
|
68217
|
+
since: z.number().nullable(),
|
|
68218
|
+
phase: z.string().nullable()
|
|
68219
|
+
});
|
|
68220
|
+
var runningStateCapability = {
|
|
68221
|
+
name: "running-state",
|
|
68222
|
+
scope: "device",
|
|
68223
|
+
deviceNative: true,
|
|
68224
|
+
mode: "singleton",
|
|
68225
|
+
deviceTypes: Object.values(DeviceType),
|
|
68226
|
+
methods: {},
|
|
68227
|
+
events: {
|
|
68228
|
+
onStarted: { data: RunningFlipEventDataSchema },
|
|
68229
|
+
onFinished: { data: RunningFlipEventDataSchema }
|
|
68230
|
+
},
|
|
68231
|
+
status: {
|
|
68232
|
+
schema: RunningStateStatusSchema,
|
|
68233
|
+
kind: "push"
|
|
68234
|
+
},
|
|
68235
|
+
runtimeState: RunningStateStatusSchema,
|
|
68236
|
+
durability: "restored",
|
|
68237
|
+
history: { fields: { running: { kind: "boolean" } } },
|
|
68238
|
+
volatileStateFields: ["lastFetchedAt"]
|
|
68239
|
+
};
|
|
68118
68240
|
/**
|
|
68119
68241
|
* reboot — device-scoped capability for "soft" device reboots (firmware
|
|
68120
68242
|
* reboot via vendor protocol; cameras, NVRs, doorbells). Surfaces a
|
|
@@ -74167,11 +74289,12 @@ function expressionOutcome(source, read, now, stateful) {
|
|
|
74167
74289
|
return unavailable;
|
|
74168
74290
|
}
|
|
74169
74291
|
const deadlines = [];
|
|
74292
|
+
const hooks = {
|
|
74293
|
+
noteDeadline: (at) => deadlines.push(at),
|
|
74294
|
+
convert: (value, from, to) => tryConvertUnit(value, normalizeUnit(from) ?? from, normalizeUnit(to) ?? to) ?? null
|
|
74295
|
+
};
|
|
74170
74296
|
const result = evaluateExpressionSource(source.expr, values, now, {
|
|
74171
|
-
hooks
|
|
74172
|
-
noteDeadline: (at) => deadlines.push(at),
|
|
74173
|
-
convert: (value, from, to) => tryConvertUnit(value, normalizeUnit(from) ?? from, normalizeUnit(to) ?? to) ?? null
|
|
74174
|
-
},
|
|
74297
|
+
hooks,
|
|
74175
74298
|
...stateful === void 0 ? {} : { invokeStateful: (invocation) => evaluateStatefulExpressionCall(stateful.callPathPrefix === void 0 ? invocation : {
|
|
74176
74299
|
...invocation,
|
|
74177
74300
|
path: `${stateful.callPathPrefix}@${invocation.path}`
|
|
@@ -74179,7 +74302,7 @@ function expressionOutcome(source, read, now, stateful) {
|
|
|
74179
74302
|
currentOutput: stateful.currentOutput,
|
|
74180
74303
|
startedAtMs: stateful.startedAtMs,
|
|
74181
74304
|
nowMs: now
|
|
74182
|
-
}) }
|
|
74305
|
+
}, hooks) }
|
|
74183
74306
|
});
|
|
74184
74307
|
if (!result.ok) return {
|
|
74185
74308
|
state: "unavailable",
|
|
@@ -74561,6 +74684,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
|
|
|
74561
74684
|
ptzAutotrack: ptzAutotrackCapability,
|
|
74562
74685
|
recordingOnboard: recordingOnboardCapability,
|
|
74563
74686
|
recordingSignal: recordingSignalCapability,
|
|
74687
|
+
runningState: runningStateCapability,
|
|
74564
74688
|
sceneMonitor: sceneMonitorCapability,
|
|
74565
74689
|
scriptRunner: scriptRunnerCapability,
|
|
74566
74690
|
smoke: smokeCapability,
|
|
@@ -83081,6 +83205,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
|
|
|
83081
83205
|
access: "create",
|
|
83082
83206
|
role: "admin"
|
|
83083
83207
|
},
|
|
83208
|
+
"runningState.getStatus": {
|
|
83209
|
+
capName: "running-state",
|
|
83210
|
+
capScope: "device",
|
|
83211
|
+
addonId: null,
|
|
83212
|
+
access: "view",
|
|
83213
|
+
role: "viewer"
|
|
83214
|
+
},
|
|
83084
83215
|
"sceneMonitor.captureReference": {
|
|
83085
83216
|
capName: "scene-monitor",
|
|
83086
83217
|
capScope: "device",
|
|
@@ -87795,6 +87926,32 @@ var APPLIANCE_CAP_VOCABULARY = {
|
|
|
87795
87926
|
}],
|
|
87796
87927
|
events: { onSent: { notOperatorFacing: "a delivery receipt of a send this system made — not a fact about the world" } }
|
|
87797
87928
|
},
|
|
87929
|
+
"running-state": {
|
|
87930
|
+
scope: "device",
|
|
87931
|
+
noun: t("Running", "In funzione"),
|
|
87932
|
+
state: [{
|
|
87933
|
+
kind: "boolean",
|
|
87934
|
+
field: "running",
|
|
87935
|
+
label: t("Running", "In funzione"),
|
|
87936
|
+
whenTrue: t("When {device} starts", "Quando {device} inizia"),
|
|
87937
|
+
whenFalse: t("When {device} finishes", "Quando {device} finisce"),
|
|
87938
|
+
icon: "play"
|
|
87939
|
+
}],
|
|
87940
|
+
events: {
|
|
87941
|
+
onStarted: {
|
|
87942
|
+
category: EventCategory.RunningStarted,
|
|
87943
|
+
label: t("Started running", "Ha iniziato a funzionare"),
|
|
87944
|
+
phrase: t("When {device} starts running", "Quando {device} inizia a funzionare"),
|
|
87945
|
+
icon: "play"
|
|
87946
|
+
},
|
|
87947
|
+
onFinished: {
|
|
87948
|
+
category: EventCategory.RunningFinished,
|
|
87949
|
+
label: t("Finished", "Ha finito"),
|
|
87950
|
+
phrase: t("When {device} finishes", "Quando {device} finisce"),
|
|
87951
|
+
icon: "square"
|
|
87952
|
+
}
|
|
87953
|
+
}
|
|
87954
|
+
},
|
|
87798
87955
|
update: {
|
|
87799
87956
|
scope: "device",
|
|
87800
87957
|
noun: t("Firmware update", "Aggiornamento firmware"),
|
|
@@ -89130,6 +89287,7 @@ var CAP_NAMES_WITH_STATUS = [
|
|
|
89130
89287
|
"recording-archive",
|
|
89131
89288
|
"recording-onboard",
|
|
89132
89289
|
"recording-signal",
|
|
89290
|
+
"running-state",
|
|
89133
89291
|
"scene-monitor",
|
|
89134
89292
|
"script-runner",
|
|
89135
89293
|
"smoke",
|
|
@@ -89292,6 +89450,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
|
|
|
89292
89450
|
recordingOnboardCapability,
|
|
89293
89451
|
recordingSignalCapability,
|
|
89294
89452
|
recordsCapability,
|
|
89453
|
+
runningStateCapability,
|
|
89295
89454
|
sceneMonitorCapability,
|
|
89296
89455
|
scriptRunnerCapability,
|
|
89297
89456
|
serverManagementCapability,
|
|
@@ -91606,6 +91765,11 @@ Object.freeze({
|
|
|
91606
91765
|
form: "single",
|
|
91607
91766
|
optional: true
|
|
91608
91767
|
}],
|
|
91768
|
+
"runningState.getStatus": [{
|
|
91769
|
+
name: "deviceId",
|
|
91770
|
+
form: "single",
|
|
91771
|
+
optional: false
|
|
91772
|
+
}],
|
|
91609
91773
|
"sceneMonitor.captureReference": [{
|
|
91610
91774
|
name: "deviceId",
|
|
91611
91775
|
form: "single",
|
|
@@ -92105,7 +92269,7 @@ Object.freeze({
|
|
|
92105
92269
|
});
|
|
92106
92270
|
/**
|
|
92107
92271
|
* Per-cap runtime-state policy, projected from every `*.cap.ts` that declares
|
|
92108
|
-
* `runtimeState`.
|
|
92272
|
+
* `runtimeState`. 72 caps: 38 `restored`, 34 `session`.
|
|
92109
92273
|
*
|
|
92110
92274
|
* A cap absent from this map has no runtime-state slice at all. A cap PRESENT
|
|
92111
92275
|
* with `durability: 'session'` has one and has decided not to keep it.
|
|
@@ -92323,6 +92487,10 @@ var RUNTIME_STATE_POLICY = {
|
|
|
92323
92487
|
durability: "session",
|
|
92324
92488
|
volatileFields: []
|
|
92325
92489
|
},
|
|
92490
|
+
"running-state": {
|
|
92491
|
+
durability: "restored",
|
|
92492
|
+
volatileFields: ["lastFetchedAt"]
|
|
92493
|
+
},
|
|
92326
92494
|
"scene-monitor": {
|
|
92327
92495
|
durability: "session",
|
|
92328
92496
|
volatileFields: []
|
|
@@ -92413,7 +92581,7 @@ var SESSION_ONLY_POLICY = {
|
|
|
92413
92581
|
};
|
|
92414
92582
|
/**
|
|
92415
92583
|
* Cap history catalog, projected from every `*.cap.ts` `history` block.
|
|
92416
|
-
*
|
|
92584
|
+
* 41 caps with series (74 series), 30 caps answered `'none'`.
|
|
92417
92585
|
* Field keys are `runtimeState` paths (`a.b` into fixed objects only).
|
|
92418
92586
|
*/
|
|
92419
92587
|
var HISTORY_CATALOG = {
|
|
@@ -92690,6 +92858,7 @@ var HISTORY_CATALOG = {
|
|
|
92690
92858
|
unit: "hPa",
|
|
92691
92859
|
deadband: .1
|
|
92692
92860
|
} },
|
|
92861
|
+
"running-state": { "running": { kind: "boolean" } },
|
|
92693
92862
|
"smoke": { "detected": { kind: "boolean" } },
|
|
92694
92863
|
"stream-params": {
|
|
92695
92864
|
"main.bitrate": {
|
|
@@ -92849,40 +93018,7 @@ var NC_AUDIO_DEFAULTS = {
|
|
|
92849
93018
|
samplingSeconds: 10
|
|
92850
93019
|
};
|
|
92851
93020
|
new Set(["devices", "classes"]);
|
|
92852
|
-
|
|
92853
|
-
* WHICH narrowing filter speaks about WHICH system-event kind — one predicate,
|
|
92854
|
-
* consumed by the rule ENGINE and by every rule EDITOR.
|
|
92855
|
-
*
|
|
92856
|
-
* ── The failure this file exists for ───────────────────────────────────────
|
|
92857
|
-
* `NcSystemEventConditionSchema` carries four optional narrowing lists
|
|
92858
|
-
* (`deviceIds`, `deviceTypes`, `nodeIds`, `packageNames`) beside a required
|
|
92859
|
-
* `kinds` gate. They are not four filters over one vocabulary: each belongs to
|
|
92860
|
-
* a FAMILY of kinds and is meaningless outside it. A node going away has no
|
|
92861
|
-
* device type; a completed export has no package; `stream-offline` deliberately
|
|
92862
|
-
* carries no device type at all (a stream belongs to a camera by construction).
|
|
92863
|
-
*
|
|
92864
|
-
* The engine applied all four to every kind, so a filter from one family failed
|
|
92865
|
-
* a kind from another family CLOSED. The operator's live rule "Eventi di
|
|
92866
|
-
* sistema" selected eleven kinds and set `deviceTypes: ['camera']` — the only
|
|
92867
|
-
* way to say "only my cameras" about the two liveness kinds — and NINE of the
|
|
92868
|
-
* eleven silently stopped being deliverable. Four days of history contained
|
|
92869
|
-
* `device-online` and `device-offline` and nothing else, across a window in
|
|
92870
|
-
* which agents were restarted and addons were updated.
|
|
92871
|
-
*
|
|
92872
|
-
* Both editors already computed this scoping, to decide which filter boxes to
|
|
92873
|
-
* render; the cap's own docblock already promised it ("Narrow a `device-*` kind
|
|
92874
|
-
* to these device TYPES"). Only the engine disagreed, and it disagreed in the
|
|
92875
|
-
* destructive direction. So the rule is stated ONCE, here, and the engine and
|
|
92876
|
-
* the editors are readers of it rather than three independent authors.
|
|
92877
|
-
*
|
|
92878
|
-
* ── The direction ─────────────────────────────────────────────────────────
|
|
92879
|
-
* Out of family ⇒ the filter is IGNORED, never fail-closed. An editor that
|
|
92880
|
-
* hides a box has already told the operator this filter does not speak about
|
|
92881
|
-
* these kinds, so honouring it as an exclusion contradicts the only
|
|
92882
|
-
* explanation the operator was ever given. Inside its family the filter still
|
|
92883
|
-
* narrows, and still fails CLOSED on a subject that cannot produce the identity
|
|
92884
|
-
* it tests (a device the mirror cannot name is not evidence of a camera).
|
|
92885
|
-
*/
|
|
93021
|
+
new Set(NC_LEGACY_SYSTEM_EVENT_KINDS);
|
|
92886
93022
|
/**
|
|
92887
93023
|
* Every filter, for the callers that must cover all of them (guards, tests).
|
|
92888
93024
|
*
|
|
@@ -92908,9 +93044,6 @@ new Map(Object.entries({
|
|
|
92908
93044
|
"device-battery-normal": "device-events",
|
|
92909
93045
|
"device-consumable-low": "device-events",
|
|
92910
93046
|
"device-consumable-normal": "device-events",
|
|
92911
|
-
"device-tank-low": "device-events",
|
|
92912
|
-
"device-tank-full": "device-events",
|
|
92913
|
-
"device-tank-normal": "device-events",
|
|
92914
93047
|
"stream-online": "device-events",
|
|
92915
93048
|
"stream-offline": "device-events",
|
|
92916
93049
|
"detection-blind": "device-events",
|
|
@@ -92987,16 +93120,6 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
|
|
|
92987
93120
|
label: "Consumables",
|
|
92988
93121
|
kinds: ["device-consumable-low", "device-consumable-normal"]
|
|
92989
93122
|
},
|
|
92990
|
-
{
|
|
92991
|
-
id: "tanks",
|
|
92992
|
-
family: "device-events",
|
|
92993
|
-
label: "Tanks",
|
|
92994
|
-
kinds: [
|
|
92995
|
-
"device-tank-low",
|
|
92996
|
-
"device-tank-full",
|
|
92997
|
-
"device-tank-normal"
|
|
92998
|
-
]
|
|
92999
|
-
},
|
|
93000
93123
|
{
|
|
93001
93124
|
id: "detection-blind",
|
|
93002
93125
|
family: "device-events",
|
|
@@ -93196,11 +93319,6 @@ var RULE_BODY_ONLY = ["body"];
|
|
|
93196
93319
|
var RULE_TEXT = ["title", "body"];
|
|
93197
93320
|
var BATTERY = ["device-battery-low", "device-battery-normal"];
|
|
93198
93321
|
var CONSUMABLE = ["device-consumable-low", "device-consumable-normal"];
|
|
93199
|
-
var TANK = [
|
|
93200
|
-
"device-tank-low",
|
|
93201
|
-
"device-tank-full",
|
|
93202
|
-
"device-tank-normal"
|
|
93203
|
-
];
|
|
93204
93322
|
var ALERT_EPISODE = [
|
|
93205
93323
|
"alert-critical",
|
|
93206
93324
|
"alert-error",
|
|
@@ -93232,7 +93350,6 @@ var DEVICE_EVENTS = [
|
|
|
93232
93350
|
"device-enabled",
|
|
93233
93351
|
...BATTERY,
|
|
93234
93352
|
...CONSUMABLE,
|
|
93235
|
-
...TANK,
|
|
93236
93353
|
"stream-online",
|
|
93237
93354
|
"stream-offline",
|
|
93238
93355
|
"detection-blind",
|
|
@@ -93278,12 +93395,6 @@ var STATE_SUMMARY_SECTION_VARS = [
|
|
|
93278
93395
|
example: "Robot — filter 10 %",
|
|
93279
93396
|
kinds: CONSUMABLE
|
|
93280
93397
|
},
|
|
93281
|
-
{
|
|
93282
|
-
name: "summaryTanks",
|
|
93283
|
-
label: "Summary: tanks",
|
|
93284
|
-
example: "Robot — clean water low",
|
|
93285
|
-
kinds: TANK
|
|
93286
|
-
},
|
|
93287
93398
|
{
|
|
93288
93399
|
name: "summaryDetection",
|
|
93289
93400
|
label: "Summary: cameras detecting nothing",
|
|
@@ -93399,8 +93510,7 @@ var STATE_SUMMARY_VARS = [
|
|
|
93399
93510
|
([...RULE_TEXT], [...COMBINED_ALARM]),
|
|
93400
93511
|
([...RULE_TEXT], [...DEVICE_EVENTS]),
|
|
93401
93512
|
([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
|
|
93402
|
-
([...RULE_TEXT], [...CONSUMABLE
|
|
93403
|
-
([...RULE_TEXT], [...TANK]),
|
|
93513
|
+
([...RULE_TEXT], [...CONSUMABLE]),
|
|
93404
93514
|
[...RULE_TEXT],
|
|
93405
93515
|
([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
|
|
93406
93516
|
([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
|
|
@@ -93504,15 +93614,6 @@ new Map([
|
|
|
93504
93614
|
snapshotLabel: "Consumables low now",
|
|
93505
93615
|
snapshotSection: "consumables"
|
|
93506
93616
|
},
|
|
93507
|
-
{
|
|
93508
|
-
id: "tanks",
|
|
93509
|
-
family: "device-events",
|
|
93510
|
-
label: "Tanks (low or full / back to normal)",
|
|
93511
|
-
bad: ["device-tank-low", "device-tank-full"],
|
|
93512
|
-
recovery: ["device-tank-normal"],
|
|
93513
|
-
snapshotLabel: "Tanks low or full now",
|
|
93514
|
-
snapshotSection: "tanks"
|
|
93515
|
-
},
|
|
93516
93617
|
{
|
|
93517
93618
|
id: "motion-noise",
|
|
93518
93619
|
family: "device-events",
|