@camstack/system 1.2.472 → 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.
Files changed (86) hide show
  1. package/dist/{agent-https-JhvY1axF.mjs → agent-https-CbczsyM0.mjs} +3 -6
  2. package/dist/{agent-https-bnyFRK7Y.js → agent-https-DRwEbLL7.js} +2 -5
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/autotrack/index.js +1 -1
  10. package/dist/builtins/autotrack/index.mjs +1 -1
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  13. package/dist/builtins/calendars/calendars.addon.js +1 -1
  14. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  15. package/dist/builtins/camera-grid/index.js +1 -1
  16. package/dist/builtins/camera-grid/index.mjs +1 -1
  17. package/dist/builtins/composer/composer.addon.js +2 -2
  18. package/dist/builtins/composer/composer.addon.mjs +2 -2
  19. package/dist/builtins/console-logging/index.js +1 -1
  20. package/dist/builtins/console-logging/index.mjs +1 -1
  21. package/dist/builtins/core-blocks/core-blocks.addon.js +2 -2
  22. package/dist/builtins/core-blocks/core-blocks.addon.mjs +2 -2
  23. package/dist/builtins/device-history/device-history.addon.js +1 -1
  24. package/dist/builtins/device-history/device-history.addon.mjs +1 -1
  25. package/dist/builtins/device-manager/device-manager.addon.js +72 -2
  26. package/dist/builtins/device-manager/device-manager.addon.mjs +72 -2
  27. package/dist/builtins/device-manager/device-state-mirror.d.ts +4 -0
  28. package/dist/builtins/device-manager/running-flip.d.ts +11 -0
  29. package/dist/builtins/hub-forwarder/index.js +1 -1
  30. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  31. package/dist/builtins/keychain/index.js +3 -3
  32. package/dist/builtins/keychain/index.mjs +3 -3
  33. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  34. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  35. package/dist/builtins/local-auth/local-auth.addon.js +16 -2
  36. package/dist/builtins/local-auth/local-auth.addon.mjs +16 -2
  37. package/dist/builtins/local-auth/person-scopes.d.ts +7 -0
  38. package/dist/builtins/local-network/local-network.addon.js +2 -2
  39. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  40. package/dist/builtins/loki-logging/index.js +1 -1
  41. package/dist/builtins/loki-logging/index.mjs +1 -1
  42. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  43. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  44. package/dist/builtins/platform-probe/accelerator-facts-probe.d.ts +24 -0
  45. package/dist/builtins/platform-probe/index.js +110 -10
  46. package/dist/builtins/platform-probe/index.mjs +109 -10
  47. package/dist/builtins/platform-probe/platform-scorer.d.ts +10 -2
  48. package/dist/builtins/record-entries/index.js +1 -1
  49. package/dist/builtins/record-entries/index.mjs +1 -1
  50. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  51. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  52. package/dist/builtins/snapshot/index.js +1 -1
  53. package/dist/builtins/snapshot/index.mjs +1 -1
  54. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  55. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  56. package/dist/builtins/sqlite-storage/index.js +1 -1
  57. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  58. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  59. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  60. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  61. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  62. package/dist/builtins/system-config/system-config.addon.js +3 -3
  63. package/dist/builtins/system-config/system-config.addon.mjs +3 -3
  64. package/dist/builtins/winston-logging/index.js +1 -1
  65. package/dist/builtins/winston-logging/index.mjs +1 -1
  66. package/dist/{composition-sources-D3h-tNoJ.js → composition-sources-CJv3W669.js} +1 -1
  67. package/dist/{composition-sources-BY6rFuAE.mjs → composition-sources-CsBIIit3.mjs} +1 -1
  68. package/dist/{constants-CqbO6e9i.js → constants-C0hrXcEr.js} +1 -1
  69. package/dist/{constants-zBiEodEM.mjs → constants-Dy8CaDeT.mjs} +1 -1
  70. package/dist/{device-ca-BWTWWBcc.mjs → device-ca-CHdsePe5.mjs} +1 -1
  71. package/dist/{device-ca-CfiIg3a9.js → device-ca-Dg3rSU48.js} +1 -1
  72. package/dist/{dist-CdFkkmXW.mjs → dist-BugavoVR.mjs} +302 -110
  73. package/dist/{dist-DX5Fu3mV.js → dist-Sn-HiZ4e.js} +307 -109
  74. package/dist/file-host-worker.js +1 -1
  75. package/dist/file-host-worker.mjs +1 -1
  76. package/dist/{hub-mdns-ciao-CYp1Gipm.mjs → hub-mdns-ciao-BDvqGIw4.mjs} +2 -2
  77. package/dist/{hub-mdns-ciao-C174UDzO.js → hub-mdns-ciao-DkncLbg9.js} +2 -2
  78. package/dist/index.js +15 -7
  79. package/dist/index.mjs +15 -7
  80. package/dist/{restore-archive-BX0gaKtG.mjs → restore-archive-CFBm30Gk.mjs} +1 -1
  81. package/dist/{restore-archive-B2jIFfu_.js → restore-archive-gYKzaJ4Y.js} +1 -1
  82. package/dist/{retired-settings-keys-C_Kjp-Bj.mjs → retired-settings-keys-CWp7ZSeA.mjs} +8 -0
  83. package/dist/{retired-settings-keys-CGUqX-Oz.js → retired-settings-keys-DorakcxV.js} +8 -0
  84. package/dist/{wal-maintenance-KHzJXlF2.mjs → wal-maintenance-BnhkcEkI.mjs} +0 -0
  85. package/dist/{wal-maintenance-Dxqd5igw.js → wal-maintenance-DyMUz_Hy.js} +0 -0
  86. package/package.json +6 -6
@@ -1,6 +1,6 @@
1
1
  let zod = require("zod");
2
2
  require("node:crypto");
3
- //#region ../types/dist/event-category-fDPduoeC.mjs
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-CHIEEJkY.mjs
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-CB6PMT9p.mjs
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) {
@@ -15543,7 +15639,7 @@ function kindOfValue(value) {
15543
15639
  function only(kind) {
15544
15640
  return new Set([kind]);
15545
15641
  }
15546
- function union(...sets) {
15642
+ function union$1(...sets) {
15547
15643
  return new Set(sets.flatMap((s) => [...s]));
15548
15644
  }
15549
15645
  function withoutNull(set) {
@@ -15571,8 +15667,8 @@ function callKinds(callee, args) {
15571
15667
  const rule = BUILTIN_RESULT_KINDS[callee];
15572
15668
  if (rule === void 0) throw new KindInferenceError(`no result-kind rule for builtin '${callee}'`);
15573
15669
  if (rule.kind === "fixed") return new Set(rule.result);
15574
- const nonNull = union(...args.map(withoutNull));
15575
- return args.every((a) => a.has("null")) ? union(nonNull, only("null")) : nonNull;
15670
+ const nonNull = union$1(...args.map(withoutNull));
15671
+ return args.every((a) => a.has("null")) ? union$1(nonNull, only("null")) : nonNull;
15576
15672
  }
15577
15673
  function kindsOf(node, bindings) {
15578
15674
  switch (node.kind) {
@@ -15585,8 +15681,8 @@ function kindsOf(node, bindings) {
15585
15681
  }
15586
15682
  case "unary": return only(node.op === "!" ? "boolean" : "number");
15587
15683
  case "binary": return binaryKinds(node.op, kindsOf(node.left, bindings), kindsOf(node.right, bindings));
15588
- case "logical": return union(kindsOf(node.left, bindings), kindsOf(node.right, bindings));
15589
- case "conditional": return union(kindsOf(node.consequent, bindings), kindsOf(node.alternate, bindings));
15684
+ case "logical": return union$1(kindsOf(node.left, bindings), kindsOf(node.right, bindings));
15685
+ case "conditional": return union$1(kindsOf(node.consequent, bindings), kindsOf(node.alternate, bindings));
15590
15686
  case "call": return callKinds(node.callee, node.args.map((a) => kindsOf(a, bindings)));
15591
15687
  }
15592
15688
  }
@@ -45183,9 +45279,6 @@ var NcSystemEventKindSchema = zod.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 = zod.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 = new Set([
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
- NcSystemEventKindSchema.options.filter((kind) => !NC_LEGACY_SYSTEM_EVENT_KINDS.has(kind));
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: zod.z.array(zod.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 = zod.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",
@@ -47934,6 +48021,18 @@ Object.freeze({
47934
48021
  reason: "camera sensor mappings not loaded"
47935
48022
  });
47936
48023
  /**
48024
+ * What the vision model must answer before a package event is emitted
48025
+ * when a packages rule has "Confirm with the LLM" on.
48026
+ *
48027
+ * `package` is the verdict. `confidence` is 0..1. `reason` is the model's
48028
+ * one-line explanation, stored on the event so a drop is not silent.
48029
+ */
48030
+ var PackageLlmVerdictSchema = zod.z.object({
48031
+ package: zod.z.boolean(),
48032
+ confidence: zod.z.number().min(0).max(1),
48033
+ reason: zod.z.string().min(1)
48034
+ });
48035
+ /**
47937
48036
  * A model choice has a SCOPE, and a scope change has a workflow.
47938
48037
  *
47939
48038
  * ## The two scopes
@@ -48878,6 +48977,21 @@ var ObjectEventSchema = zod.z.object({
48878
48977
  * pick-up written before D684 — UNKNOWN, never 0 and never `timestamp`.
48879
48978
  */
48880
48979
  observedAt: zod.z.number().optional(),
48980
+ /**
48981
+ * The delivery was emitted without a vision-model yes (D931).
48982
+ *
48983
+ * Set only when the packages rule asked for an LLM confirm and the model
48984
+ * was unreachable, timed out, or answered something that did not parse.
48985
+ * A notification reads it so it can say "possible" instead of a definite
48986
+ * delivery. Absent on every other row, and on a confirm that said yes.
48987
+ */
48988
+ packagePossible: zod.z.boolean().optional(),
48989
+ /**
48990
+ * The vision model's verdict, when a packages rule asked for one and the
48991
+ * model answered the schema (D931). A "no" never becomes a row — the
48992
+ * detector drops it and logs the reason. Present on a yes.
48993
+ */
48994
+ packageLlmVerdict: PackageLlmVerdictSchema.optional(),
48881
48995
  /** The parent track's key-event importance [0,1], propagated to every object
48882
48996
  * event of the track (so an event row can be sorted by importance without a
48883
48997
  * track join). Absent on legacy rows / before the track was scored. */
@@ -52034,11 +52148,18 @@ var KeptReasonSchema = zod.z.enum(["custom-pin"]);
52034
52148
  * Where a choice's latency came from (D791): this node's own benchmark
52035
52149
  * result, or the hardware-class table. Measured on the node beats the table.
52036
52150
  */
52037
- var LatencySourceSchema = zod.z.discriminatedUnion("kind", [zod.z.object({ kind: zod.z.literal("table") }), zod.z.object({
52038
- kind: zod.z.literal("node-benchmark"),
52039
- resultId: zod.z.string(),
52040
- measuredAtMs: zod.z.number()
52041
- })]);
52151
+ var LatencySourceSchema = zod.z.discriminatedUnion("kind", [
52152
+ zod.z.object({ kind: zod.z.literal("table") }),
52153
+ zod.z.object({
52154
+ kind: zod.z.literal("node-benchmark"),
52155
+ resultId: zod.z.string(),
52156
+ measuredAtMs: zod.z.number()
52157
+ }),
52158
+ zod.z.object({
52159
+ kind: zod.z.literal("estimated"),
52160
+ estimatedFrom: HardwareClassIdSchema
52161
+ })
52162
+ ]);
52042
52163
  var DeviceModelChoiceSchema = zod.z.object({
52043
52164
  modelId: zod.z.string(),
52044
52165
  p50Ms: zod.z.number(),
@@ -52046,6 +52167,11 @@ var DeviceModelChoiceSchema = zod.z.object({
52046
52167
  measured: zod.z.boolean(),
52047
52168
  /** Absent on a plan from before D791 — read as the table. */
52048
52169
  source: LatencySourceSchema.optional(),
52170
+ /**
52171
+ * The measured class this latency was scaled from (D930). Absent when the
52172
+ * cell is the table or a node benchmark.
52173
+ */
52174
+ estimatedFrom: HardwareClassIdSchema.optional(),
52049
52175
  /** Parallel sessions at the camera rate with the headroom kept free: ⌊fps × (1 − headroom) / camera fps⌋. */
52050
52176
  capacitySessions: zod.z.number(),
52051
52177
  personRecall: zod.z.number()
@@ -66951,6 +67077,36 @@ includeCrops: zod.z.boolean().optional() }).optional(), zod.z.array(VehicleSchem
66951
67077
  })
66952
67078
  }
66953
67079
  };
67080
+ var CORE_ULTRA_265K_IGPU_CLOCK_MHZ = 2e3;
67081
+ var positiveOrNull = zod.z.number().nullable().transform((value) => value !== null && Number.isFinite(value) && value > 0 ? value : null);
67082
+ var textOrNull = zod.z.string().nullable().transform((value) => value !== null && value.trim() !== "" ? value : null);
67083
+ var PrecisionGopsSchema = zod.z.object({
67084
+ int8: positiveOrNull,
67085
+ fp16: positiveOrNull
67086
+ });
67087
+ /** What one accelerator device reported. Every failed query is null. */
67088
+ var AcceleratorComputeSchema = zod.z.object({
67089
+ deviceKey: zod.z.string(),
67090
+ fullDeviceName: textOrNull,
67091
+ executionUnits: positiveOrNull,
67092
+ clockMHz: positiveOrNull,
67093
+ gops: PrecisionGopsSchema.nullable(),
67094
+ architecture: textOrNull,
67095
+ npuName: textOrNull,
67096
+ tops: positiveOrNull,
67097
+ vendor: textOrNull,
67098
+ webgpuArchitecture: textOrNull,
67099
+ webgpuDevice: textOrNull,
67100
+ computeUnits: positiveOrNull
67101
+ });
67102
+ var AcceleratorFactsPayloadSchema = zod.z.object({ accelerators: zod.z.array(AcceleratorComputeSchema).nullable() });
67103
+ 64 * CORE_ULTRA_265K_IGPU_CLOCK_MHZ;
67104
+ /** Parse a probe payload. `null` means the probe failed — not "no accelerators". */
67105
+ function parseAcceleratorFactsJson(raw) {
67106
+ const parsed = AcceleratorFactsPayloadSchema.safeParse(raw);
67107
+ if (!parsed.success || parsed.data.accelerators === null) return null;
67108
+ return parsed.data.accelerators;
67109
+ }
66954
67110
  var ModelFormatSchema = zod.z.enum(MODEL_FORMATS);
66955
67111
  var HwAccelBackendInputSchema = zod.z.enum([
66956
67112
  "videotoolbox",
@@ -67065,7 +67221,12 @@ var HardwareInfoSchema = zod.z.object({
67065
67221
  availableRAM_MB: zod.z.number(),
67066
67222
  gpu: GpuInfoSchema.nullable(),
67067
67223
  npu: NpuInfoSchema.nullable(),
67068
- coral: CoralInfoSchema.nullable().optional()
67224
+ coral: CoralInfoSchema.nullable().optional(),
67225
+ /**
67226
+ * Per-accelerator compute (D930). Omitted by a node that has not probed it.
67227
+ * `null` fields inside an entry are a failed query, never a zero.
67228
+ */
67229
+ accelerators: zod.z.array(AcceleratorComputeSchema).readonly().optional()
67069
67230
  });
67070
67231
  var PlatformScoreSchema = zod.z.object({
67071
67232
  runtime: zod.z.literal("python"),
@@ -68041,6 +68202,41 @@ var ptzAutotrackCapability = {
68041
68202
  */
68042
68203
  history: "none"
68043
68204
  };
68205
+ var RunningStateSourceSchema = zod.z.enum(["native", "assigned"]);
68206
+ var RunningStateStatusSchema = zod.z.object({
68207
+ /** null = unknown — never coerced to false (D393). */
68208
+ running: zod.z.boolean().nullable(),
68209
+ /** Epoch ms the current boolean began; null while `running` is null. */
68210
+ since: zod.z.number().nullable(),
68211
+ source: RunningStateSourceSchema,
68212
+ phase: zod.z.string().nullable(),
68213
+ lastFetchedAt: zod.z.number()
68214
+ });
68215
+ var RunningFlipEventDataSchema = zod.z.object({
68216
+ deviceId: zod.z.number(),
68217
+ since: zod.z.number().nullable(),
68218
+ phase: zod.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
+ };
68044
68240
  /**
68045
68241
  * reboot — device-scoped capability for "soft" device reboots (firmware
68046
68242
  * reboot via vendor protocol; cameras, NVRs, doorbells). Surfaces a
@@ -70437,7 +70633,20 @@ var ZoneRuleSchema = zod.z.object({
70437
70633
  * Defaults to `true` so operators creating a rule via the UI
70438
70634
  * see it active immediately.
70439
70635
  */
70440
- enabled: zod.z.boolean().default(true)
70636
+ enabled: zod.z.boolean().default(true),
70637
+ /**
70638
+ * Package stage only. When true, a package candidate may open from a
70639
+ * scene difference in this rule's zone after a person leaves. The
70640
+ * package model, when it boxes something overlapping, is extra evidence
70641
+ * and is not the gate. Absent or false keeps today's model path.
70642
+ */
70643
+ detectBySceneDifference: zod.z.boolean().optional(),
70644
+ /**
70645
+ * Package stage only. When true, a promoted package is shown to the
70646
+ * `llm` cap before the delivery event is emitted. Absent or false emits
70647
+ * as today. Usable with or without `detectBySceneDifference`.
70648
+ */
70649
+ confirmWithLlm: zod.z.boolean().optional()
70441
70650
  });
70442
70651
  zod.z.array(ZoneRuleSchema).readonly();
70443
70652
  /**
@@ -74080,11 +74289,12 @@ function expressionOutcome(source, read, now, stateful) {
74080
74289
  return unavailable;
74081
74290
  }
74082
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
+ };
74083
74296
  const result = evaluateExpressionSource(source.expr, values, now, {
74084
- hooks: {
74085
- noteDeadline: (at) => deadlines.push(at),
74086
- convert: (value, from, to) => tryConvertUnit(value, normalizeUnit(from) ?? from, normalizeUnit(to) ?? to) ?? null
74087
- },
74297
+ hooks,
74088
74298
  ...stateful === void 0 ? {} : { invokeStateful: (invocation) => evaluateStatefulExpressionCall(stateful.callPathPrefix === void 0 ? invocation : {
74089
74299
  ...invocation,
74090
74300
  path: `${stateful.callPathPrefix}@${invocation.path}`
@@ -74092,7 +74302,7 @@ function expressionOutcome(source, read, now, stateful) {
74092
74302
  currentOutput: stateful.currentOutput,
74093
74303
  startedAtMs: stateful.startedAtMs,
74094
74304
  nowMs: now
74095
- }) }
74305
+ }, hooks) }
74096
74306
  });
74097
74307
  if (!result.ok) return {
74098
74308
  state: "unavailable",
@@ -74474,6 +74684,7 @@ var DEVICE_LOCAL_STATE_CAPS = {
74474
74684
  ptzAutotrack: ptzAutotrackCapability,
74475
74685
  recordingOnboard: recordingOnboardCapability,
74476
74686
  recordingSignal: recordingSignalCapability,
74687
+ runningState: runningStateCapability,
74477
74688
  sceneMonitor: sceneMonitorCapability,
74478
74689
  scriptRunner: scriptRunnerCapability,
74479
74690
  smoke: smokeCapability,
@@ -82994,6 +83205,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
82994
83205
  access: "create",
82995
83206
  role: "admin"
82996
83207
  },
83208
+ "runningState.getStatus": {
83209
+ capName: "running-state",
83210
+ capScope: "device",
83211
+ addonId: null,
83212
+ access: "view",
83213
+ role: "viewer"
83214
+ },
82997
83215
  "sceneMonitor.captureReference": {
82998
83216
  capName: "scene-monitor",
82999
83217
  capScope: "device",
@@ -87708,6 +87926,32 @@ var APPLIANCE_CAP_VOCABULARY = {
87708
87926
  }],
87709
87927
  events: { onSent: { notOperatorFacing: "a delivery receipt of a send this system made — not a fact about the world" } }
87710
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
+ },
87711
87955
  update: {
87712
87956
  scope: "device",
87713
87957
  noun: t("Firmware update", "Aggiornamento firmware"),
@@ -89043,6 +89287,7 @@ var CAP_NAMES_WITH_STATUS = [
89043
89287
  "recording-archive",
89044
89288
  "recording-onboard",
89045
89289
  "recording-signal",
89290
+ "running-state",
89046
89291
  "scene-monitor",
89047
89292
  "script-runner",
89048
89293
  "smoke",
@@ -89205,6 +89450,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
89205
89450
  recordingOnboardCapability,
89206
89451
  recordingSignalCapability,
89207
89452
  recordsCapability,
89453
+ runningStateCapability,
89208
89454
  sceneMonitorCapability,
89209
89455
  scriptRunnerCapability,
89210
89456
  serverManagementCapability,
@@ -91519,6 +91765,11 @@ Object.freeze({
91519
91765
  form: "single",
91520
91766
  optional: true
91521
91767
  }],
91768
+ "runningState.getStatus": [{
91769
+ name: "deviceId",
91770
+ form: "single",
91771
+ optional: false
91772
+ }],
91522
91773
  "sceneMonitor.captureReference": [{
91523
91774
  name: "deviceId",
91524
91775
  form: "single",
@@ -92018,7 +92269,7 @@ Object.freeze({
92018
92269
  });
92019
92270
  /**
92020
92271
  * Per-cap runtime-state policy, projected from every `*.cap.ts` that declares
92021
- * `runtimeState`. 71 caps: 37 `restored`, 34 `session`.
92272
+ * `runtimeState`. 72 caps: 38 `restored`, 34 `session`.
92022
92273
  *
92023
92274
  * A cap absent from this map has no runtime-state slice at all. A cap PRESENT
92024
92275
  * with `durability: 'session'` has one and has decided not to keep it.
@@ -92236,6 +92487,10 @@ var RUNTIME_STATE_POLICY = {
92236
92487
  durability: "session",
92237
92488
  volatileFields: []
92238
92489
  },
92490
+ "running-state": {
92491
+ durability: "restored",
92492
+ volatileFields: ["lastFetchedAt"]
92493
+ },
92239
92494
  "scene-monitor": {
92240
92495
  durability: "session",
92241
92496
  volatileFields: []
@@ -92326,7 +92581,7 @@ var SESSION_ONLY_POLICY = {
92326
92581
  };
92327
92582
  /**
92328
92583
  * Cap history catalog, projected from every `*.cap.ts` `history` block.
92329
- * 40 caps with series (73 series), 30 caps answered `'none'`.
92584
+ * 41 caps with series (74 series), 30 caps answered `'none'`.
92330
92585
  * Field keys are `runtimeState` paths (`a.b` into fixed objects only).
92331
92586
  */
92332
92587
  var HISTORY_CATALOG = {
@@ -92603,6 +92858,7 @@ var HISTORY_CATALOG = {
92603
92858
  unit: "hPa",
92604
92859
  deadband: .1
92605
92860
  } },
92861
+ "running-state": { "running": { kind: "boolean" } },
92606
92862
  "smoke": { "detected": { kind: "boolean" } },
92607
92863
  "stream-params": {
92608
92864
  "main.bitrate": {
@@ -92762,40 +93018,7 @@ var NC_AUDIO_DEFAULTS = {
92762
93018
  samplingSeconds: 10
92763
93019
  };
92764
93020
  new Set(["devices", "classes"]);
92765
- /**
92766
- * WHICH narrowing filter speaks about WHICH system-event kind — one predicate,
92767
- * consumed by the rule ENGINE and by every rule EDITOR.
92768
- *
92769
- * ── The failure this file exists for ───────────────────────────────────────
92770
- * `NcSystemEventConditionSchema` carries four optional narrowing lists
92771
- * (`deviceIds`, `deviceTypes`, `nodeIds`, `packageNames`) beside a required
92772
- * `kinds` gate. They are not four filters over one vocabulary: each belongs to
92773
- * a FAMILY of kinds and is meaningless outside it. A node going away has no
92774
- * device type; a completed export has no package; `stream-offline` deliberately
92775
- * carries no device type at all (a stream belongs to a camera by construction).
92776
- *
92777
- * The engine applied all four to every kind, so a filter from one family failed
92778
- * a kind from another family CLOSED. The operator's live rule "Eventi di
92779
- * sistema" selected eleven kinds and set `deviceTypes: ['camera']` — the only
92780
- * way to say "only my cameras" about the two liveness kinds — and NINE of the
92781
- * eleven silently stopped being deliverable. Four days of history contained
92782
- * `device-online` and `device-offline` and nothing else, across a window in
92783
- * which agents were restarted and addons were updated.
92784
- *
92785
- * Both editors already computed this scoping, to decide which filter boxes to
92786
- * render; the cap's own docblock already promised it ("Narrow a `device-*` kind
92787
- * to these device TYPES"). Only the engine disagreed, and it disagreed in the
92788
- * destructive direction. So the rule is stated ONCE, here, and the engine and
92789
- * the editors are readers of it rather than three independent authors.
92790
- *
92791
- * ── The direction ─────────────────────────────────────────────────────────
92792
- * Out of family ⇒ the filter is IGNORED, never fail-closed. An editor that
92793
- * hides a box has already told the operator this filter does not speak about
92794
- * these kinds, so honouring it as an exclusion contradicts the only
92795
- * explanation the operator was ever given. Inside its family the filter still
92796
- * narrows, and still fails CLOSED on a subject that cannot produce the identity
92797
- * it tests (a device the mirror cannot name is not evidence of a camera).
92798
- */
93021
+ new Set(NC_LEGACY_SYSTEM_EVENT_KINDS);
92799
93022
  /**
92800
93023
  * Every filter, for the callers that must cover all of them (guards, tests).
92801
93024
  *
@@ -92821,9 +93044,6 @@ new Map(Object.entries({
92821
93044
  "device-battery-normal": "device-events",
92822
93045
  "device-consumable-low": "device-events",
92823
93046
  "device-consumable-normal": "device-events",
92824
- "device-tank-low": "device-events",
92825
- "device-tank-full": "device-events",
92826
- "device-tank-normal": "device-events",
92827
93047
  "stream-online": "device-events",
92828
93048
  "stream-offline": "device-events",
92829
93049
  "detection-blind": "device-events",
@@ -92900,16 +93120,6 @@ var NC_SYSTEM_EVENT_KIND_GROUP_SPECS = [
92900
93120
  label: "Consumables",
92901
93121
  kinds: ["device-consumable-low", "device-consumable-normal"]
92902
93122
  },
92903
- {
92904
- id: "tanks",
92905
- family: "device-events",
92906
- label: "Tanks",
92907
- kinds: [
92908
- "device-tank-low",
92909
- "device-tank-full",
92910
- "device-tank-normal"
92911
- ]
92912
- },
92913
93123
  {
92914
93124
  id: "detection-blind",
92915
93125
  family: "device-events",
@@ -93109,11 +93319,6 @@ var RULE_BODY_ONLY = ["body"];
93109
93319
  var RULE_TEXT = ["title", "body"];
93110
93320
  var BATTERY = ["device-battery-low", "device-battery-normal"];
93111
93321
  var CONSUMABLE = ["device-consumable-low", "device-consumable-normal"];
93112
- var TANK = [
93113
- "device-tank-low",
93114
- "device-tank-full",
93115
- "device-tank-normal"
93116
- ];
93117
93322
  var ALERT_EPISODE = [
93118
93323
  "alert-critical",
93119
93324
  "alert-error",
@@ -93145,7 +93350,6 @@ var DEVICE_EVENTS = [
93145
93350
  "device-enabled",
93146
93351
  ...BATTERY,
93147
93352
  ...CONSUMABLE,
93148
- ...TANK,
93149
93353
  "stream-online",
93150
93354
  "stream-offline",
93151
93355
  "detection-blind",
@@ -93191,12 +93395,6 @@ var STATE_SUMMARY_SECTION_VARS = [
93191
93395
  example: "Robot — filter 10 %",
93192
93396
  kinds: CONSUMABLE
93193
93397
  },
93194
- {
93195
- name: "summaryTanks",
93196
- label: "Summary: tanks",
93197
- example: "Robot — clean water low",
93198
- kinds: TANK
93199
- },
93200
93398
  {
93201
93399
  name: "summaryDetection",
93202
93400
  label: "Summary: cameras detecting nothing",
@@ -93312,8 +93510,7 @@ var STATE_SUMMARY_VARS = [
93312
93510
  ([...RULE_TEXT], [...COMBINED_ALARM]),
93313
93511
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
93314
93512
  ([...RULE_TEXT], [...BATTERY, ...CONSUMABLE]),
93315
- ([...RULE_TEXT], [...CONSUMABLE, ...TANK]),
93316
- ([...RULE_TEXT], [...TANK]),
93513
+ ([...RULE_TEXT], [...CONSUMABLE]),
93317
93514
  [...RULE_TEXT],
93318
93515
  ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
93319
93516
  ([...RULE_TEXT], [...UPDATES, ...ALERT_EPISODE]),
@@ -93417,15 +93614,6 @@ new Map([
93417
93614
  snapshotLabel: "Consumables low now",
93418
93615
  snapshotSection: "consumables"
93419
93616
  },
93420
- {
93421
- id: "tanks",
93422
- family: "device-events",
93423
- label: "Tanks (low or full / back to normal)",
93424
- bad: ["device-tank-low", "device-tank-full"],
93425
- recovery: ["device-tank-normal"],
93426
- snapshotLabel: "Tanks low or full now",
93427
- snapshotSection: "tanks"
93428
- },
93429
93617
  {
93430
93618
  id: "motion-noise",
93431
93619
  family: "device-events",
@@ -93845,6 +94033,10 @@ TimelapseRuleInputSchema.extend({
93845
94033
  updatedAt: zod.z.number()
93846
94034
  });
93847
94035
  MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
94036
+ Object.freeze({
94037
+ person: .8,
94038
+ vehicle: .8
94039
+ });
93848
94040
  zod.z.object({
93849
94041
  /**
93850
94042
  * Fraction of the box's own size added on EACH side before cutting.
@@ -95832,6 +96024,12 @@ Object.defineProperty(exports, "objectInputDeclaresRequiredDeviceId", {
95832
96024
  return objectInputDeclaresRequiredDeviceId;
95833
96025
  }
95834
96026
  });
96027
+ Object.defineProperty(exports, "parseAcceleratorFactsJson", {
96028
+ enumerable: true,
96029
+ get: function() {
96030
+ return parseAcceleratorFactsJson;
96031
+ }
96032
+ });
95835
96033
  Object.defineProperty(exports, "parseJsonObject", {
95836
96034
  enumerable: true,
95837
96035
  get: function() {