@camstack/server 1.2.733 → 1.2.735

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 (99) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/core/agent/node-removal-hooks.js +25 -0
  3. package/dist/manual-boot.js +11 -0
  4. package/package.json +4 -6
  5. package/system/dist/addon-runner.js +94 -17
  6. package/system/dist/addon-runner.mjs +95 -18
  7. package/system/dist/{agent-https-D3dptveB.mjs → agent-https-BVCIU0eH.mjs} +1 -1
  8. package/system/dist/{agent-https-v5uyVgpk.js → agent-https-DrCbFr4p.js} +1 -1
  9. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  10. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  11. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  12. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  13. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  14. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  15. package/system/dist/builtins/autotrack/index.js +1 -1
  16. package/system/dist/builtins/autotrack/index.mjs +1 -1
  17. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  18. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  19. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  20. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  21. package/system/dist/builtins/camera-grid/index.js +1 -1
  22. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  23. package/system/dist/builtins/composer/composer.addon.js +3 -3
  24. package/system/dist/builtins/composer/composer.addon.mjs +3 -3
  25. package/system/dist/builtins/console-logging/index.js +1 -1
  26. package/system/dist/builtins/console-logging/index.mjs +1 -1
  27. package/system/dist/builtins/core-blocks/core-blocks.addon.js +79 -8
  28. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +90 -21
  29. package/system/dist/builtins/core-blocks/index.mjs +1 -1
  30. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  31. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  32. package/system/dist/builtins/device-manager/device-manager.addon.js +2 -2
  33. package/system/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  34. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  35. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  36. package/system/dist/builtins/keychain/index.js +3 -3
  37. package/system/dist/builtins/keychain/index.mjs +3 -3
  38. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  39. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  40. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  41. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  42. package/system/dist/builtins/local-network/local-network.addon.js +91 -21
  43. package/system/dist/builtins/local-network/local-network.addon.mjs +91 -21
  44. package/system/dist/builtins/local-network/scan/dns-wire.d.ts +29 -0
  45. package/system/dist/builtins/loki-logging/index.js +1 -1
  46. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  47. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  48. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  49. package/system/dist/builtins/platform-probe/index.js +1 -1
  50. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  51. package/system/dist/builtins/record-entries/index.js +1 -1
  52. package/system/dist/builtins/record-entries/index.mjs +1 -1
  53. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  54. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  55. package/system/dist/builtins/snapshot/index.js +1 -1
  56. package/system/dist/builtins/snapshot/index.mjs +1 -1
  57. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  58. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  59. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  60. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  61. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  62. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  63. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  64. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  65. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  66. package/system/dist/builtins/system-config/system-config.addon.mjs +284 -284
  67. package/system/dist/builtins/winston-logging/index.js +1 -1
  68. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  69. package/system/dist/{composition-sources-j_bFq7Tx.js → composition-sources-BV9n2ivT.js} +1 -1
  70. package/system/dist/{composition-sources-Dnyu7-1p.mjs → composition-sources-CI2tZzAo.mjs} +1 -1
  71. package/system/dist/{constants-GDBin8zB.mjs → constants-Bskr2h1W.mjs} +1 -1
  72. package/system/dist/{constants-C6zJ_38f.js → constants-dYIQm8ab.js} +1 -1
  73. package/system/dist/{device-ca-Bpqrad00.mjs → device-ca-04o7NByo.mjs} +1 -1
  74. package/system/dist/{device-ca-CV9QZvoy.js → device-ca-BF8N9fC6.js} +1 -1
  75. package/system/dist/{dist-CwYYyGAB.js → dist-B4r3_aYb.js} +61 -4
  76. package/system/dist/{dist-DcHvuBfD.mjs → dist-CnC8-kF6.mjs} +56 -5
  77. package/system/dist/{dns-wire-CqgMi_uB.js → dns-wire-B1BvF9Ao.js} +78 -10
  78. package/system/dist/{dns-wire-DO56tOHL.mjs → dns-wire-Dm3H_7ST.mjs} +55 -11
  79. package/system/dist/file-host-worker.js +1 -1
  80. package/system/dist/file-host-worker.mjs +1 -1
  81. package/system/dist/{hub-mdns-ciao-D2sU6sKd.mjs → hub-mdns-ciao-BE1vqriF.mjs} +2 -2
  82. package/system/dist/{hub-mdns-ciao-DNLnbJNG.js → hub-mdns-ciao-MdXDARI0.js} +2 -2
  83. package/system/dist/index.d.ts +1 -0
  84. package/system/dist/index.js +45 -19
  85. package/system/dist/index.mjs +46 -21
  86. package/system/dist/kernel/addon-settings-store.d.ts +25 -0
  87. package/system/dist/kernel/device-settings-resolver.d.ts +27 -0
  88. package/system/dist/kernel/moleculer/runner-device-settings.d.ts +2 -0
  89. package/system/dist/kernel/settings-door-view.d.ts +5 -1
  90. package/system/dist/kernel/settings-view-types.d.ts +7 -1
  91. package/system/dist/migrations/hub/2026-11-02-addon-settings-node-id.d.ts +3 -0
  92. package/system/dist/migrations/hub/index.d.ts +3 -4
  93. package/system/dist/{restore-archive-xTqhDFkW.js → restore-archive-BEUIhG8U.js} +1 -1
  94. package/system/dist/{restore-archive-BGK6EnYj.mjs → restore-archive-Dx9F-3zV.mjs} +82 -82
  95. package/system/dist/{retention-CXu8PB2L.mjs → retention-fsBjIfxP.mjs} +1 -1
  96. package/system/dist/{retention-gQ3GIUA3.js → retention-nNCAON-6.js} +1 -1
  97. package/system/dist/{wal-maintenance-D7XmFaUD.mjs → wal-maintenance-0XhlopB5.mjs} +0 -0
  98. package/system/dist/{wal-maintenance-Hwzm3DCe.js → wal-maintenance-UKXXEEoS.js} +0 -0
  99. package/system/package.json +1 -1
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-CwYYyGAB.js");
6
+ const require_dist = require("../../dist-B4r3_aYb.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.js");
8
8
  const require_log_file_read_protocol = require("../../log-file-read-protocol-D0WcLbIV.js");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Xr as logDestinationCapability, do as BaseAddon } from "../../dist-DcHvuBfD.mjs";
1
+ import { Xr as logDestinationCapability, do as BaseAddon } from "../../dist-CnC8-kF6.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-DkYZ4LXp.mjs";
3
3
  import { a as LogFileIndexStore, i as serveRead, n as isFromReader, t as CancelBook } from "../../log-file-read-protocol-B7M3X3bT.mjs";
4
4
  import { createRequire } from "node:module";
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-CwYYyGAB.js");
1
+ const require_dist = require("./dist-B4r3_aYb.js");
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- import { Ja as compositionSourceKey, Ks as errMsg } from "./dist-DcHvuBfD.mjs";
1
+ import { Ja as compositionSourceKey, qs as errMsg } from "./dist-CnC8-kF6.mjs";
2
2
  //#region src/builtins/shared/device-state-changed.ts
3
3
  /** Structural narrowing helper for untrusted bus payloads. */
4
4
  function isRecord(value) {
@@ -1,4 +1,4 @@
1
- import { Xo as buildSecretRef } from "./dist-DcHvuBfD.mjs";
1
+ import { Xo as buildSecretRef } from "./dist-CnC8-kF6.mjs";
2
2
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
3
3
  var MESH_CA_KEY_REF = buildSecretRef({
4
4
  owner: "system",
@@ -1,5 +1,5 @@
1
1
  /** `secret://system/global/meshCaKey` — EC P-256 PKCS#8 PEM of the hub mesh CA. */
2
- var MESH_CA_KEY_REF = require("./dist-CwYYyGAB.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-B4r3_aYb.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -1,4 +1,4 @@
1
- import { H as DEVICE_SAN_CREDENTIAL_PREFIX, U as DEVICE_SAN_USER_PREFIX, Xo as buildSecretRef } from "./dist-DcHvuBfD.mjs";
1
+ import { H as DEVICE_SAN_CREDENTIAL_PREFIX, U as DEVICE_SAN_USER_PREFIX, Xo as buildSecretRef } from "./dist-CnC8-kF6.mjs";
2
2
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension } from "./x509.es-BRiJgOvu.mjs";
3
3
  import { X509Certificate, createPublicKey, randomBytes, verify, webcrypto } from "node:crypto";
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-CwYYyGAB.js");
1
+ const require_dist = require("./dist-B4r3_aYb.js");
2
2
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
3
3
  let node_crypto = require("node:crypto");
4
4
  //#region src/auth/jwt-signing-key.ts
@@ -1162,7 +1162,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1162
1162
  return DeviceRole;
1163
1163
  }({});
1164
1164
  //#endregion
1165
- //#region ../types/dist/sleep-Bei295Bz.mjs
1165
+ //#region ../types/dist/sleep-47MM9p3b.mjs
1166
1166
  /**
1167
1167
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1168
1168
  * window to float samples (D455).
@@ -3118,6 +3118,44 @@ var BaseAddon = class {
3118
3118
  return null;
3119
3119
  }
3120
3120
  /**
3121
+ * D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
3122
+ * provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
3123
+ * declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
3124
+ * {@link nodeSettingsSchema} and of {@link deviceDefaultsSchema} are disjoint, and a key never
3125
+ * contains `@` (guard `check-scoped-settings-declared`). SHAPE only: values are read by scope.
3126
+ */
3127
+ async clusterSettingsSchema(_cap) {
3128
+ return null;
3129
+ }
3130
+ /**
3131
+ * D986: the form shape of the settings one capability owns PER NODE, or `null`. Stored as
3132
+ * `addon-settings` rows `<addonId>.<field>@<nodeId>` carrying `nodeId` in the row data, so a
3133
+ * forgotten node's rows go in one central delete.
3134
+ */
3135
+ async nodeSettingsSchema(_cap) {
3136
+ return null;
3137
+ }
3138
+ /**
3139
+ * D986: the form shape of the FLEET DEFAULTS of the per-device settings one capability owns,
3140
+ * or `null`. Stored as `addon-settings` rows `<addonId>.<field>`; a device resolves its value
3141
+ * as device row, then this default, then the schema default (`resolveDeviceSettings`).
3142
+ */
3143
+ async deviceDefaultsSchema(_cap) {
3144
+ return null;
3145
+ }
3146
+ /**
3147
+ * The host's read of the scoped declarations: the schema one capability declares for `scope`,
3148
+ * or `null`. Beside {@link getIntegrationFormSchema}, the same shape: the hook is protected, the
3149
+ * host asks this method.
3150
+ */
3151
+ async getScopedSettingsSchema(scope, cap) {
3152
+ switch (scope) {
3153
+ case "cluster": return this.clusterSettingsSchema(cap);
3154
+ case "node": return this.nodeSettingsSchema(cap);
3155
+ case "device-defaults": return this.deviceDefaultsSchema(cap);
3156
+ }
3157
+ }
3158
+ /**
3121
3159
  * What the create wizard and the integration edit page render for one instance: the addon's
3122
3160
  * per-instance schema when it declares one, else its global schema (what they always showed).
3123
3161
  */
@@ -3912,6 +3950,17 @@ function normalizeAddonInitResult(result) {
3912
3950
  return result;
3913
3951
  }
3914
3952
  /**
3953
+ * The node id a node-scoped KEY carries: the part after the `@`. `null` for a key with no `@`
3954
+ * (a cluster or fleet-default key) or an empty node id. A schema key never contains `@`
3955
+ * (guard `check-scoped-settings-declared`), so the first `@` is the separator.
3956
+ */
3957
+ function nodeIdOfScopedKey(key) {
3958
+ const at = key.indexOf("@");
3959
+ if (at <= 0) return null;
3960
+ const nodeId = key.slice(at + 1);
3961
+ return nodeId === "" ? null : nodeId;
3962
+ }
3963
+ /**
3915
3964
  * Per-listener shared-secret header the hub injects on every reverse-proxied
3916
3965
  * data-plane request and the addon's framework wrapper validates — so only the
3917
3966
  * hub can reach the addon's `127.0.0.1` listener. Defined here (shared by the
@@ -8019,7 +8068,7 @@ function sleep(ms) {
8019
8068
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
8020
8069
  }
8021
8070
  //#endregion
8022
- //#region ../types/dist/composition-kKKOdFIG.mjs
8071
+ //#region ../types/dist/composition-BDUoQsw9.mjs
8023
8072
  var AUDIO_ENCODER_BY_CODEC = {
8024
8073
  opus: "libopus",
8025
8074
  aac: "aac",
@@ -8648,7 +8697,9 @@ function asNonNegativeMs(value, name, index) {
8648
8697
  }
8649
8698
  /**
8650
8699
  * `dwell(active, onForMs, offForMs)`: unknown until a delay elapses, then holds
8651
- * the latched boolean through gaps shorter than the opposing delay (D933).
8700
+ * the latched boolean through gaps shorter than the opposing delay (D933). A new
8701
+ * call state seeded with the restored output starts latched on it, so it is never
8702
+ * unknown after a boot.
8652
8703
  */
8653
8704
  function evaluateDwell(activeRaw, onForMsRaw, offForMsRaw, call, nowMs, hooks) {
8654
8705
  const active = asBoolean(activeRaw, "dwell", 0);
@@ -9488,7 +9539,7 @@ function evaluateStatefulExpressionCall(invocation, memory, env, hooks) {
9488
9539
  const call = existing?.kind === "dwell" ? existing : {
9489
9540
  kind: "dwell",
9490
9541
  pendingSince: null,
9491
- latched: null,
9542
+ latched: typeof env.currentOutput === "boolean" ? env.currentOutput : null,
9492
9543
  seenSince: null
9493
9544
  };
9494
9545
  memory.calls.set(invocation.path, call);
@@ -111249,6 +111300,12 @@ Object.defineProperty(exports, "nextOccurrence", {
111249
111300
  return nextOccurrence;
111250
111301
  }
111251
111302
  });
111303
+ Object.defineProperty(exports, "nodeIdOfScopedKey", {
111304
+ enumerable: true,
111305
+ get: function() {
111306
+ return nodeIdOfScopedKey;
111307
+ }
111308
+ });
111252
111309
  Object.defineProperty(exports, "nodePin", {
111253
111310
  enumerable: true,
111254
111311
  get: function() {
@@ -1162,7 +1162,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1162
1162
  return DeviceRole;
1163
1163
  }({});
1164
1164
  //#endregion
1165
- //#region ../types/dist/sleep-Bei295Bz.mjs
1165
+ //#region ../types/dist/sleep-47MM9p3b.mjs
1166
1166
  /**
1167
1167
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1168
1168
  * window to float samples (D455).
@@ -3118,6 +3118,44 @@ var BaseAddon = class {
3118
3118
  return null;
3119
3119
  }
3120
3120
  /**
3121
+ * D986 scoped settings: the form shape of the CLUSTER-wide settings one capability this addon
3122
+ * provides owns, or `null` when it has none. `cap` is a capability name the addon's manifest
3123
+ * declares. Stored as `addon-settings` rows `<addonId>.<field>`. The keys of this schema, of
3124
+ * {@link nodeSettingsSchema} and of {@link deviceDefaultsSchema} are disjoint, and a key never
3125
+ * contains `@` (guard `check-scoped-settings-declared`). SHAPE only: values are read by scope.
3126
+ */
3127
+ async clusterSettingsSchema(_cap) {
3128
+ return null;
3129
+ }
3130
+ /**
3131
+ * D986: the form shape of the settings one capability owns PER NODE, or `null`. Stored as
3132
+ * `addon-settings` rows `<addonId>.<field>@<nodeId>` carrying `nodeId` in the row data, so a
3133
+ * forgotten node's rows go in one central delete.
3134
+ */
3135
+ async nodeSettingsSchema(_cap) {
3136
+ return null;
3137
+ }
3138
+ /**
3139
+ * D986: the form shape of the FLEET DEFAULTS of the per-device settings one capability owns,
3140
+ * or `null`. Stored as `addon-settings` rows `<addonId>.<field>`; a device resolves its value
3141
+ * as device row, then this default, then the schema default (`resolveDeviceSettings`).
3142
+ */
3143
+ async deviceDefaultsSchema(_cap) {
3144
+ return null;
3145
+ }
3146
+ /**
3147
+ * The host's read of the scoped declarations: the schema one capability declares for `scope`,
3148
+ * or `null`. Beside {@link getIntegrationFormSchema}, the same shape: the hook is protected, the
3149
+ * host asks this method.
3150
+ */
3151
+ async getScopedSettingsSchema(scope, cap) {
3152
+ switch (scope) {
3153
+ case "cluster": return this.clusterSettingsSchema(cap);
3154
+ case "node": return this.nodeSettingsSchema(cap);
3155
+ case "device-defaults": return this.deviceDefaultsSchema(cap);
3156
+ }
3157
+ }
3158
+ /**
3121
3159
  * What the create wizard and the integration edit page render for one instance: the addon's
3122
3160
  * per-instance schema when it declares one, else its global schema (what they always showed).
3123
3161
  */
@@ -3912,6 +3950,17 @@ function normalizeAddonInitResult(result) {
3912
3950
  return result;
3913
3951
  }
3914
3952
  /**
3953
+ * The node id a node-scoped KEY carries: the part after the `@`. `null` for a key with no `@`
3954
+ * (a cluster or fleet-default key) or an empty node id. A schema key never contains `@`
3955
+ * (guard `check-scoped-settings-declared`), so the first `@` is the separator.
3956
+ */
3957
+ function nodeIdOfScopedKey(key) {
3958
+ const at = key.indexOf("@");
3959
+ if (at <= 0) return null;
3960
+ const nodeId = key.slice(at + 1);
3961
+ return nodeId === "" ? null : nodeId;
3962
+ }
3963
+ /**
3915
3964
  * Per-listener shared-secret header the hub injects on every reverse-proxied
3916
3965
  * data-plane request and the addon's framework wrapper validates — so only the
3917
3966
  * hub can reach the addon's `127.0.0.1` listener. Defined here (shared by the
@@ -8019,7 +8068,7 @@ function sleep(ms) {
8019
8068
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
8020
8069
  }
8021
8070
  //#endregion
8022
- //#region ../types/dist/composition-kKKOdFIG.mjs
8071
+ //#region ../types/dist/composition-BDUoQsw9.mjs
8023
8072
  var AUDIO_ENCODER_BY_CODEC = {
8024
8073
  opus: "libopus",
8025
8074
  aac: "aac",
@@ -8648,7 +8697,9 @@ function asNonNegativeMs(value, name, index) {
8648
8697
  }
8649
8698
  /**
8650
8699
  * `dwell(active, onForMs, offForMs)`: unknown until a delay elapses, then holds
8651
- * the latched boolean through gaps shorter than the opposing delay (D933).
8700
+ * the latched boolean through gaps shorter than the opposing delay (D933). A new
8701
+ * call state seeded with the restored output starts latched on it, so it is never
8702
+ * unknown after a boot.
8652
8703
  */
8653
8704
  function evaluateDwell(activeRaw, onForMsRaw, offForMsRaw, call, nowMs, hooks) {
8654
8705
  const active = asBoolean(activeRaw, "dwell", 0);
@@ -9488,7 +9539,7 @@ function evaluateStatefulExpressionCall(invocation, memory, env, hooks) {
9488
9539
  const call = existing?.kind === "dwell" ? existing : {
9489
9540
  kind: "dwell",
9490
9541
  pendingSince: null,
9491
- latched: null,
9542
+ latched: typeof env.currentOutput === "boolean" ? env.currentOutput : null,
9492
9543
  seenSince: null
9493
9544
  };
9494
9545
  memory.calls.set(invocation.path, call);
@@ -109329,4 +109380,4 @@ z.object({
109329
109380
  commands: z.record(z.string(), z.unknown())
109330
109381
  });
109331
109382
  //#endregion
109332
- export { EMPTY_REMOTE_CONFIG as $, helperMembers as $a, scoreRuntimes as $i, deviceExtensionCapability as $n, collectSecretMarkerRefs as $o, mayReadLocation as $r, UserRecordSchema as $t, CredentialTokenClaimsSchema as A, vocabActionIdFor as Aa, recordEntriesCapability as Ai, collectWhenMirrorSources as An, REMOVE_LEAF as Ao, isAppLinkBase as Ar, readinessKey as As, PreferenceValueSchema as At, DEVICE_ID_FIELD as B, MINUTE_MS as Ba, resolveCoreBlockFiles as Bi, coverCapability as Bn, StoredRecordKindDeclarationSchema as Bo, keychainAdminCapability as Br, transformSecretWrite as Bs, SchedulerError as Bt, CORE_BLOCK_ADDON_PREFIX as C, validateComposition as Ca, platformProbeCapability as Ci, cameraGridLayoutCapability as Cn, PlaintextSecretError as Co, gbToBytes as Cr, mapSecretLeaves as Cs, MediaPlayerStatusSchema as Ct, ConditionMirror as D, vectorDimFromBase64 as Da, problemsBlockSave as Di, checkRoleAddress as Dn, RECORD_SECRET_COLLECTION_PREFIX as Do, interpolate as Dr, parseJsonObject as Ds, PREFERENCES_MAX_VALUE_BYTES as Dt, CatalogFileSchema as E, valveCapability as Ea, preconditionOf as Ei, catalogueIssues as En, RECORD_DELETE_BATCH as Eo, internalActionId as Er, normalizeSecretOwner as Es, NetworkTunnelStartedDataSchema as Et, DAY_NAMES as F, DAY_MS as Fa, replacedFieldKeys as Fi, coreBlockAddonId as Fn, RecordNotFoundError as Fo, isInternalActionId as Fr, secretTreeFromPaths as Fs, RemoteAssumedStateSchema as Ft, DataStoreDatabaseSchema as G, compositionFeatureEnabled as Ga, resolveNotificationTapAddress as Gi, databaseSnapshotCapability as Gn, asJsonObject as Go, localDateOf as Gr, DeviceType as Gs, StorageCleanupJobSchema as Gt, DEVICE_SAN_CREDENTIAL_PREFIX as H, cloneStatefulExpressionMemory as Ha, resolveLocationMode as Hi, customKeyOfRole as Hn, UnindexedFilterError as Ho, legacyAutoLinkIds as Hr, withoutCallerStamp as Hs, ScopedTokenSchema as Ht, DEFAULT_HOLD_OVERRIDE as I, DEFAULT_HISTORY_RETENTION as Ia, resolveActionVariables as Ii, coreBlockComposition as In, RecordTooLargeError as Io, isLocationEnabled as Ir, secretTreeFromSchema as Is, RemoteConfigSchema as It, DeviceStatusSchema as J, compositionSourceKey as Ja, runSteps as Ji, decodeVectorBase64 as Jn, assertTransactScope as Jo, lockControlCapability as Jr, StorageMigrationJobSchema as Jt, DeclaredDevices as K, compositionItemFieldPath as Ka, resolveStepArgs as Ki, declarationOwnerNodeId as Kn, asNumber as Ko, localNetworkCapability as Kr, errMsg as Ks, StorageLocationModeSchema as Kt, DERIVED_CAMERA_SILENCED_CAP_NAMES as L, HISTORY_FAST_MS as La, resolveAppConnections as Li, coreBlockIdFromAddonId as Ln, RecordUniqueViolationError as Lo, isObjectInput as Lr, sleep as Ls, RunningStateStatusSchema as Lt, DATABASE_SNAPSHOT_SUFFIX as M, withLocationMode as Ma, reducePoints as Mi, composerCapability as Mn, ReadinessRegistry as Mo, isCollectionArrayMethod as Mr, resolveCapMount as Ms, RECORDING_SOURCE_CAMSTACK_ADDON as Mt, DATABASE_SNAPSHOT_TIMEOUT_MS as N, zoneOnlySite as Na, remoteCapability as Ni, compositionFieldKey as Nn, ReadinessTimeoutError as No, isCredentialTokenPayload as Nr, resolveSecretMarkers as Ns, ROOT_BUCKET_KEY as Nt, ControlStatusSchema as O, vectorIndexDimConflictError as Oa, procedureAuthKey as Oi, checkTemplatePayload as On, RECORD_SWEEP_INTERVAL_MS as Oo, isAlertEpisodeOpen as Or, parseJsonUnknown as Os, PreferenceDeviceIdSchema as Ot, DATA_STORE_DATABASES as P, COMPOSER_ADDON_ID as Pa, remoteLayoutComponentsCapability as Pi, compositionSourceRefs as Pn, RecordKindDeclarationSchema as Po, isDefaultAppConnectionEndpoint as Pr, scopeKey as Ps, RecordingStatusSchema as Pt, EMPTY_REMOTE_ASSUMED_STATE as Q, evaluateStatistic as Qa, scopesAllowDeviceCap as Qi, deviceCredentialsCapability as Qn, collectSecretLeaves as Qo, looseSchema as Qr, UNATTRIBUTED_BUCKET_KEY as Qt, DEVICE_ENROLLMENT_TTL_MS as R, HISTORY_SLOW_MS as Ra, resolveBucketMs as Ri, coreBlockSourceKind as Rn, RevConflictError as Ro, isVoidInput as Rr, toNodeId as Rs, STORAGE_ACCESS_FALLBACK as Rt, CORE_BLOCKS_ADDON_ID as S, userManagementCapability as Sa, planComposition as Si, calendarsCapability as Sn, NoCallerError as So, formatMinutes as Sr, makeSecretMarker as Ss, MOTION_CLOSE_AFTER_MS as St, CalendarPreferencesSchema as T, validateSchedulerInput as Ta, powerSourceLinkOfComposition as Ti, capUnitResolver as Tn, RECORD_BATCH_MAX_BYTES as To, groupTemplate as Tr, normalizeNodeId as Ts, MigrationMetaSchema as Tt, DEVICE_SAN_USER_PREFIX as U, composedDeviceRef as Ua, resolveMethodAuth as Ui, customRole as Un, UnknownRecordKindError as Uo, legacyModeOf as Ur, DeviceFeature as Us, ServerNameSchema as Ut, DEVICE_NONCE_TTL_MS as V, buildFfmpegArgs as Va, resolveHubAddressRoles as Vi, createDeviceExtensionProvider as Vn, TransactRefusedError as Vo, keychainCapability as Vr, userError as Vs, SchedulerSchema as Vt, DEVICE_TOMBSTONE_RETENTION_MS as W, composedDeviceStableId as Wa, resolveMutate as Wi, dataStoreProviderCapability as Wn, WELL_KNOWN_TAB_MAP as Wo, lifecycleJobSchema as Wr, DeviceRole as Ws, SsoBridgeClaimsSchema as Wt, DiscoveryProposalBodySchema as X, disarmRoseMemory as Xa, schedulersCapability as Xi, deriveBatteryPresence as Xn, buildSecretRef as Xo, logDestinationCapability as Xr, TemplateKindSchema as Xt, DeviceTombstoneSchema as Y, createStatefulExpressionMemory as Ya, runtimeStatePolicyFor as Yi, defineExtensionSlotProvider as Yn, assertValidDeclaration as Yo, lockDoorLinkOfComposition as Yr, SwitchStatusSchema as Yt, EMPTY_AUTOMATION_STATE as Z, evaluateDerivative as Za, scopesAllowAddon as Zi, describeComposableCaps as Zn, collectSecretConfigKeys as Zo, logLevelAtMost as Zr, TokenScopeSchema as Zt, CAMSTACK_APP_LINK_ORIGIN as _, switchCapability as _a, orderMigrations as _i, buildActionSteps as _n, DeclarationRefusedError as _o, fanPresetsCapability as _r, isReadingQuantity as _s, KeychainResetRecordSchema as _t, AGENT_MDNS_TXT_KEYS as a, siteFor as aa, migrationsCapability as ai, addonSettingsCapability as an, openStatistic as ao, deviceStatusCapability as ar, emitDownForOwnedCaps as as, FieldClaimModeSchema as at, COMPOSED_ITEM_FIXED_FIELDS as b, timedRunLimitOf as ba, parseStreamParamsFormPatch as bi, buildDeviceSignatureMessage as bn, HISTORY_DEFAULT_MIN_INTERVAL_MS as bo, foldSnapshotByFunction as br, isSecretMarkerLike as bs, METHOD_ACCESS_MAP as bt, ActionStepSchema as c, splitTranslationRef as ca, nextOccurrence as ci, alertEpisodePayload as cn, statisticCadenceMs as co, enumerateSchemaFields as cr, formatSecretScope as cs, HISTORY_CATALOG as ct, AlertSchema as d, storageMigrationCapability as da, normalizeCoreBlockWrite as di, armRemovalReconcile as dn, BaseAddon as do, evictionPolicyOfLocation as dr, historyUnitFor as ds, HUB_MDNS_TXT_KEYS as dt, settingsStoreCapability as ea, mayWriteToLocation as ei, actionEffect as en, integrateReading as eo, deviceHistoryCapability as er, collectZodSecretPaths as es, FAN_CAPTURE_FIELDS as et, AutomationStateDocSchema as f, storageOccupancyCapability as fa, normalizeStepTargets as fi, authProviderCapability as fn, BatchTooLargeError as fo, expandContainer as fr, hydrateSchema as fs, HvacModeSchema as ft, CAMERA_SWITCH_ORDER as g, supportedRuntimes as ga, occurrenceOn as gi, brightnessCapability as gn, DEVICE_STATUS_METHOD as go, fanOutTargets as gr, isKeychainStoredField as gs, KeychainAuditEntrySchema as gt, BatteryStatusSchema as h, streamQualityLabel as ha, objectInputDeclaresRequiredDeviceId as hi, batteryCapability as hn, DEVICE_SETTINGS_CONTRIBUTION_METHODS as ho, fanControlCapability as hr, isEvent as hs, KEYCHAIN_RESET_TRIGGER_ACTOR as ht, AGENT_MDNS_SERVICE_TYPE as i, shortHostname as ia, metricsProviderCapability as ii, addonPagesCapability as in, openReset as io, deviceStateCapability as ir, defineRecordKinds as is, FanPresetSchema as it, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as j, weekdayOfLocalDate as ja, recordsCapability as ji, colorCapability as jn, RUNTIME_DEFAULTS as jo, isArrayOutputSchema as jr, recordSecretRef as js, QuantityUnitError as jt, CoreBlockSchema as k, vectorStoreCapability as ka, ptzAutotrackCapability as ki, climateControlCapability as kn, REDACTED_SECRET as ko, isAlertEpisodeSeverity as kr, parseSecretRef as ks, PreferenceNamespaceSchema as kt, ActionTargetResolver as l, storageAdminCapability as la, normalizeActionUnits as li, alertsCapability as ln, toExpressionValue as lo, evaluateCompositionField as lr, getDebugInterest as ls, HISTORY_ITEM_CATALOG as lt, BaseDevice as m, streamCatalogCapability as ma, objectInputDeclaresAddonId as mi, bareAddonId as mn, DATAPLANE_SECRET_HEADER as mo, extractNestedAddonId as mr, isDeviceConfigCap as ms, INTERNAL_ACTION_PREFIX as mt, ACTUATOR_METHODS as n, sharedActuatorMethods as na, memoizePinnedFfmpeg as ni, actionsCapability as nn, isHistoryHelper as no, deviceRemovalHookCapability as nr, customAction as ns, FanControlStatusSchema as nt, ALL_CAPABILITY_DEFINITIONS as o, siteZoneKey as oa, modeMayWrite as oi, addonWidgetsCapability as on, planResetTier as oo, enumerateInferenceDevices as or, emitReadiness as os, FieldClaimSchema as ot, BUILTIN_REMOTE_COMPONENTS as p, storageProviderCapability as pa, normalizeUnit as pi, backupCapability as pn, CALLER_STAMPED_CAPABILITIES as po, expressionContainsBuiltinCall as pr, isDebugChannelName as ps, IDLE_ACTION_STATUS as pt, DeviceRunSchema as q, compositionSliceKey as qa, runFanOut as qi, declaredSeriesKind as qn, asString$1 as qo, locationIconKey as qr, EventCategory as qs, StorageLocationTypeSchema as qt, ACTUATOR_TEMPLATE_IDS as r, sharedColorModes as ra, methodRefusal as ri, addonIdOfActionId as rn, nextLocalMidnight as ro, deviceRunsCapability as rr, defineCustomActions as rs, FanDirectionSchema as rt, ActionError as s, snapshotCapability as sa, motionCapability as si, alertEpisodeId as sn, planStatisticTier as so, enumerateItemArrayFields as sr, expandCapMethods as ss, GroupCommandResultSchema as st, ACTION_TARGET_INVALIDATION_EVENTS as t, sharedActuatorFeatures as ta, mediaPlayerCapability as ti, actionSourceCapability as tn, isForwardInputRef as to, deviceManagerCapability as tr, createEvent as ts, FIRST_LEVEL_MACRO_CLASSES as tt, ActionVariableSchema as u, storageCapability as ua, normalizeCapStep as ui, appendTrace as un, wattMillisecondsToKwh as uo, evaluateWhenTree as ur, historyItemFieldPath as us, HUB_MDNS_SERVICE_TYPE as ut, CAP_NAMES_WITH_STATUS as v, templateCapability as va, parseAcceleratorFactsJson as vi, buildCapabilityLookup as vn, FilterRequiredError as vo, featureForwards as vr, isSecretClear as vs, LOG_LEVEL_RANK as vt, CREDENTIAL_TOKEN_AUDIENCE as w, validateCustomAddress as wa, powerSourceCapability as wi, canonicalIconKey as wn, RECORD_BATCH_MAX as wo, groupCommandsCapability as wr, nodePin as ws, MigrationLedgerEntrySchema as wt, COMPOSER_RUNNER_ID as x, timedRunSeconds as xa, pickAppLinkHub as xi, buildStreamParamsConfigSchema as xn, InvalidRecordError as xo, formatDeviceRevoker as xr, isSecretRefOwnedBy as xs, MINUTES_PER_DAY as xt, CATALOG_LANGS as y, timedRunCapability as ya, parseColorInput as yi, buildDeviceEnrollmentLink as yn, ForeignSecretMarkerError as yo, filesystemBrowseCapability as yr, isSecretMarker as ys, LegacyStorageLocationDefaultSchema as yt, DEVICE_HISTORY_ENERGY_KEY as z, HOUR_MS as za, resolveCoreBlockEntry as zi, coreBlocksCapability as zn, SECRET_CLEAR as zo, kebabToCamel as zr, toSecretFieldView as zs, STREAM_PROFILE_META as zt };
109383
+ export { EMPTY_REMOTE_CONFIG as $, helperMembers as $a, scoreRuntimes as $i, deviceExtensionCapability as $n, collectSecretMarkerRefs as $o, mayReadLocation as $r, UserRecordSchema as $t, CredentialTokenClaimsSchema as A, vocabActionIdFor as Aa, recordEntriesCapability as Ai, collectWhenMirrorSources as An, REMOVE_LEAF as Ao, isAppLinkBase as Ar, parseSecretRef as As, PreferenceValueSchema as At, DEVICE_ID_FIELD as B, MINUTE_MS as Ba, resolveCoreBlockFiles as Bi, coverCapability as Bn, StoredRecordKindDeclarationSchema as Bo, keychainAdminCapability as Br, toSecretFieldView as Bs, SchedulerError as Bt, CORE_BLOCK_ADDON_PREFIX as C, validateComposition as Ca, platformProbeCapability as Ci, cameraGridLayoutCapability as Cn, PlaintextSecretError as Co, gbToBytes as Cr, mapSecretLeaves as Cs, MediaPlayerStatusSchema as Ct, ConditionMirror as D, vectorDimFromBase64 as Da, problemsBlockSave as Di, checkRoleAddress as Dn, RECORD_SECRET_COLLECTION_PREFIX as Do, interpolate as Dr, normalizeSecretOwner as Ds, PREFERENCES_MAX_VALUE_BYTES as Dt, CatalogFileSchema as E, valveCapability as Ea, preconditionOf as Ei, catalogueIssues as En, RECORD_DELETE_BATCH as Eo, internalActionId as Er, normalizeNodeId as Es, NetworkTunnelStartedDataSchema as Et, DAY_NAMES as F, DAY_MS as Fa, replacedFieldKeys as Fi, coreBlockAddonId as Fn, RecordNotFoundError as Fo, isInternalActionId as Fr, scopeKey as Fs, RemoteAssumedStateSchema as Ft, DataStoreDatabaseSchema as G, compositionFeatureEnabled as Ga, resolveNotificationTapAddress as Gi, databaseSnapshotCapability as Gn, asJsonObject as Go, localDateOf as Gr, DeviceRole as Gs, StorageCleanupJobSchema as Gt, DEVICE_SAN_CREDENTIAL_PREFIX as H, cloneStatefulExpressionMemory as Ha, resolveLocationMode as Hi, customKeyOfRole as Hn, UnindexedFilterError as Ho, legacyAutoLinkIds as Hr, userError as Hs, ScopedTokenSchema as Ht, DEFAULT_HOLD_OVERRIDE as I, DEFAULT_HISTORY_RETENTION as Ia, resolveActionVariables as Ii, coreBlockComposition as In, RecordTooLargeError as Io, isLocationEnabled as Ir, secretTreeFromPaths as Is, RemoteConfigSchema as It, DeviceStatusSchema as J, compositionSourceKey as Ja, runSteps as Ji, decodeVectorBase64 as Jn, assertTransactScope as Jo, lockControlCapability as Jr, EventCategory as Js, StorageMigrationJobSchema as Jt, DeclaredDevices as K, compositionItemFieldPath as Ka, resolveStepArgs as Ki, declarationOwnerNodeId as Kn, asNumber as Ko, localNetworkCapability as Kr, DeviceType as Ks, StorageLocationModeSchema as Kt, DERIVED_CAMERA_SILENCED_CAP_NAMES as L, HISTORY_FAST_MS as La, resolveAppConnections as Li, coreBlockIdFromAddonId as Ln, RecordUniqueViolationError as Lo, isObjectInput as Lr, secretTreeFromSchema as Ls, RunningStateStatusSchema as Lt, DATABASE_SNAPSHOT_SUFFIX as M, withLocationMode as Ma, reducePoints as Mi, composerCapability as Mn, ReadinessRegistry as Mo, isCollectionArrayMethod as Mr, recordSecretRef as Ms, RECORDING_SOURCE_CAMSTACK_ADDON as Mt, DATABASE_SNAPSHOT_TIMEOUT_MS as N, zoneOnlySite as Na, remoteCapability as Ni, compositionFieldKey as Nn, ReadinessTimeoutError as No, isCredentialTokenPayload as Nr, resolveCapMount as Ns, ROOT_BUCKET_KEY as Nt, ControlStatusSchema as O, vectorIndexDimConflictError as Oa, procedureAuthKey as Oi, checkTemplatePayload as On, RECORD_SWEEP_INTERVAL_MS as Oo, isAlertEpisodeOpen as Or, parseJsonObject as Os, PreferenceDeviceIdSchema as Ot, DATA_STORE_DATABASES as P, COMPOSER_ADDON_ID as Pa, remoteLayoutComponentsCapability as Pi, compositionSourceRefs as Pn, RecordKindDeclarationSchema as Po, isDefaultAppConnectionEndpoint as Pr, resolveSecretMarkers as Ps, RecordingStatusSchema as Pt, EMPTY_REMOTE_ASSUMED_STATE as Q, evaluateStatistic as Qa, scopesAllowDeviceCap as Qi, deviceCredentialsCapability as Qn, collectSecretLeaves as Qo, looseSchema as Qr, UNATTRIBUTED_BUCKET_KEY as Qt, DEVICE_ENROLLMENT_TTL_MS as R, HISTORY_SLOW_MS as Ra, resolveBucketMs as Ri, coreBlockSourceKind as Rn, RevConflictError as Ro, isVoidInput as Rr, sleep as Rs, STORAGE_ACCESS_FALLBACK as Rt, CORE_BLOCKS_ADDON_ID as S, userManagementCapability as Sa, planComposition as Si, calendarsCapability as Sn, NoCallerError as So, formatMinutes as Sr, makeSecretMarker as Ss, MOTION_CLOSE_AFTER_MS as St, CalendarPreferencesSchema as T, validateSchedulerInput as Ta, powerSourceLinkOfComposition as Ti, capUnitResolver as Tn, RECORD_BATCH_MAX_BYTES as To, groupTemplate as Tr, nodePin as Ts, MigrationMetaSchema as Tt, DEVICE_SAN_USER_PREFIX as U, composedDeviceRef as Ua, resolveMethodAuth as Ui, customRole as Un, UnknownRecordKindError as Uo, legacyModeOf as Ur, withoutCallerStamp as Us, ServerNameSchema as Ut, DEVICE_NONCE_TTL_MS as V, buildFfmpegArgs as Va, resolveHubAddressRoles as Vi, createDeviceExtensionProvider as Vn, TransactRefusedError as Vo, keychainCapability as Vr, transformSecretWrite as Vs, SchedulerSchema as Vt, DEVICE_TOMBSTONE_RETENTION_MS as W, composedDeviceStableId as Wa, resolveMutate as Wi, dataStoreProviderCapability as Wn, WELL_KNOWN_TAB_MAP as Wo, lifecycleJobSchema as Wr, DeviceFeature as Ws, SsoBridgeClaimsSchema as Wt, DiscoveryProposalBodySchema as X, disarmRoseMemory as Xa, schedulersCapability as Xi, deriveBatteryPresence as Xn, buildSecretRef as Xo, logDestinationCapability as Xr, TemplateKindSchema as Xt, DeviceTombstoneSchema as Y, createStatefulExpressionMemory as Ya, runtimeStatePolicyFor as Yi, defineExtensionSlotProvider as Yn, assertValidDeclaration as Yo, lockDoorLinkOfComposition as Yr, SwitchStatusSchema as Yt, EMPTY_AUTOMATION_STATE as Z, evaluateDerivative as Za, scopesAllowAddon as Zi, describeComposableCaps as Zn, collectSecretConfigKeys as Zo, logLevelAtMost as Zr, TokenScopeSchema as Zt, CAMSTACK_APP_LINK_ORIGIN as _, switchCapability as _a, orderMigrations as _i, buildActionSteps as _n, DeclarationRefusedError as _o, fanPresetsCapability as _r, isReadingQuantity as _s, KeychainResetRecordSchema as _t, AGENT_MDNS_TXT_KEYS as a, siteFor as aa, migrationsCapability as ai, addonSettingsCapability as an, openStatistic as ao, deviceStatusCapability as ar, emitDownForOwnedCaps as as, FieldClaimModeSchema as at, COMPOSED_ITEM_FIXED_FIELDS as b, timedRunLimitOf as ba, parseStreamParamsFormPatch as bi, buildDeviceSignatureMessage as bn, HISTORY_DEFAULT_MIN_INTERVAL_MS as bo, foldSnapshotByFunction as br, isSecretMarkerLike as bs, METHOD_ACCESS_MAP as bt, ActionStepSchema as c, splitTranslationRef as ca, nextOccurrence as ci, alertEpisodePayload as cn, statisticCadenceMs as co, enumerateSchemaFields as cr, formatSecretScope as cs, HISTORY_CATALOG as ct, AlertSchema as d, storageMigrationCapability as da, normalizeCoreBlockWrite as di, armRemovalReconcile as dn, BaseAddon as do, evictionPolicyOfLocation as dr, historyUnitFor as ds, HUB_MDNS_TXT_KEYS as dt, settingsStoreCapability as ea, mayWriteToLocation as ei, actionEffect as en, integrateReading as eo, deviceHistoryCapability as er, collectZodSecretPaths as es, FAN_CAPTURE_FIELDS as et, AutomationStateDocSchema as f, storageOccupancyCapability as fa, normalizeStepTargets as fi, authProviderCapability as fn, BatchTooLargeError as fo, expandContainer as fr, hydrateSchema as fs, HvacModeSchema as ft, CAMERA_SWITCH_ORDER as g, supportedRuntimes as ga, occurrenceOn as gi, brightnessCapability as gn, DEVICE_STATUS_METHOD as go, fanOutTargets as gr, isKeychainStoredField as gs, KeychainAuditEntrySchema as gt, BatteryStatusSchema as h, streamQualityLabel as ha, objectInputDeclaresRequiredDeviceId as hi, batteryCapability as hn, DEVICE_SETTINGS_CONTRIBUTION_METHODS as ho, fanControlCapability as hr, isEvent as hs, KEYCHAIN_RESET_TRIGGER_ACTOR as ht, AGENT_MDNS_SERVICE_TYPE as i, shortHostname as ia, metricsProviderCapability as ii, addonPagesCapability as in, openReset as io, deviceStateCapability as ir, defineRecordKinds as is, FanPresetSchema as it, DATABASE_SNAPSHOT_PARTIAL_SUFFIX as j, weekdayOfLocalDate as ja, recordsCapability as ji, colorCapability as jn, RUNTIME_DEFAULTS as jo, isArrayOutputSchema as jr, readinessKey as js, QuantityUnitError as jt, CoreBlockSchema as k, vectorStoreCapability as ka, ptzAutotrackCapability as ki, climateControlCapability as kn, REDACTED_SECRET as ko, isAlertEpisodeSeverity as kr, parseJsonUnknown as ks, PreferenceNamespaceSchema as kt, ActionTargetResolver as l, storageAdminCapability as la, normalizeActionUnits as li, alertsCapability as ln, toExpressionValue as lo, evaluateCompositionField as lr, getDebugInterest as ls, HISTORY_ITEM_CATALOG as lt, BaseDevice as m, streamCatalogCapability as ma, objectInputDeclaresAddonId as mi, bareAddonId as mn, DATAPLANE_SECRET_HEADER as mo, extractNestedAddonId as mr, isDeviceConfigCap as ms, INTERNAL_ACTION_PREFIX as mt, ACTUATOR_METHODS as n, sharedActuatorMethods as na, memoizePinnedFfmpeg as ni, actionsCapability as nn, isHistoryHelper as no, deviceRemovalHookCapability as nr, customAction as ns, FanControlStatusSchema as nt, ALL_CAPABILITY_DEFINITIONS as o, siteZoneKey as oa, modeMayWrite as oi, addonWidgetsCapability as on, planResetTier as oo, enumerateInferenceDevices as or, emitReadiness as os, FieldClaimSchema as ot, BUILTIN_REMOTE_COMPONENTS as p, storageProviderCapability as pa, normalizeUnit as pi, backupCapability as pn, CALLER_STAMPED_CAPABILITIES as po, expressionContainsBuiltinCall as pr, isDebugChannelName as ps, IDLE_ACTION_STATUS as pt, DeviceRunSchema as q, compositionSliceKey as qa, runFanOut as qi, declaredSeriesKind as qn, asString$1 as qo, locationIconKey as qr, errMsg as qs, StorageLocationTypeSchema as qt, ACTUATOR_TEMPLATE_IDS as r, sharedColorModes as ra, methodRefusal as ri, addonIdOfActionId as rn, nextLocalMidnight as ro, deviceRunsCapability as rr, defineCustomActions as rs, FanDirectionSchema as rt, ActionError as s, snapshotCapability as sa, motionCapability as si, alertEpisodeId as sn, planStatisticTier as so, enumerateItemArrayFields as sr, expandCapMethods as ss, GroupCommandResultSchema as st, ACTION_TARGET_INVALIDATION_EVENTS as t, sharedActuatorFeatures as ta, mediaPlayerCapability as ti, actionSourceCapability as tn, isForwardInputRef as to, deviceManagerCapability as tr, createEvent as ts, FIRST_LEVEL_MACRO_CLASSES as tt, ActionVariableSchema as u, storageCapability as ua, normalizeCapStep as ui, appendTrace as un, wattMillisecondsToKwh as uo, evaluateWhenTree as ur, historyItemFieldPath as us, HUB_MDNS_SERVICE_TYPE as ut, CAP_NAMES_WITH_STATUS as v, templateCapability as va, parseAcceleratorFactsJson as vi, buildCapabilityLookup as vn, FilterRequiredError as vo, featureForwards as vr, isSecretClear as vs, LOG_LEVEL_RANK as vt, CREDENTIAL_TOKEN_AUDIENCE as w, validateCustomAddress as wa, powerSourceCapability as wi, canonicalIconKey as wn, RECORD_BATCH_MAX as wo, groupCommandsCapability as wr, nodeIdOfScopedKey as ws, MigrationLedgerEntrySchema as wt, COMPOSER_RUNNER_ID as x, timedRunSeconds as xa, pickAppLinkHub as xi, buildStreamParamsConfigSchema as xn, InvalidRecordError as xo, formatDeviceRevoker as xr, isSecretRefOwnedBy as xs, MINUTES_PER_DAY as xt, CATALOG_LANGS as y, timedRunCapability as ya, parseColorInput as yi, buildDeviceEnrollmentLink as yn, ForeignSecretMarkerError as yo, filesystemBrowseCapability as yr, isSecretMarker as ys, LegacyStorageLocationDefaultSchema as yt, DEVICE_HISTORY_ENERGY_KEY as z, HOUR_MS as za, resolveCoreBlockEntry as zi, coreBlocksCapability as zn, SECRET_CLEAR as zo, kebabToCamel as zr, toNodeId as zs, STREAM_PROFILE_META as zt };
@@ -106,9 +106,51 @@ function buildPtrQuery(serviceTypes, options = {}) {
106
106
  });
107
107
  return Buffer.concat([header, ...questions]);
108
108
  }
109
- /** The services advertised on one mDNS message; a malformed packet yields none. */
110
- function parseMdnsMessage(buf) {
111
- if (buf.length < 12) return [];
109
+ var QUESTION_TYPE_CODE = {
110
+ SRV,
111
+ TXT,
112
+ A
113
+ };
114
+ /** A QM (or QU when `unicastResponse`) question per record, for the follow-up that resolves an instance. */
115
+ function buildRecordQuery(questions, options = {}) {
116
+ const questionClass = options.unicastResponse === true ? MDNS_QU_CLASS : MDNS_QM_CLASS;
117
+ const header = Buffer.alloc(12);
118
+ header.writeUInt16BE(questions.length, 4);
119
+ const encoded = questions.map((q) => {
120
+ const parts = q.name.split(".").filter((part) => part.length > 0).map((l) => {
121
+ const bytes = Buffer.from(l);
122
+ return Buffer.concat([Buffer.from([bytes.length]), bytes]);
123
+ });
124
+ const tail = Buffer.alloc(4);
125
+ tail.writeUInt16BE(QUESTION_TYPE_CODE[q.type], 0);
126
+ tail.writeUInt16BE(questionClass, 2);
127
+ return Buffer.concat([
128
+ ...parts,
129
+ Buffer.from([0]),
130
+ tail
131
+ ]);
132
+ });
133
+ return Buffer.concat([header, ...encoded]);
134
+ }
135
+ function emptyMdnsRecords() {
136
+ return {
137
+ ptrs: [],
138
+ srv: /* @__PURE__ */ new Map(),
139
+ txt: /* @__PURE__ */ new Map(),
140
+ addresses: /* @__PURE__ */ new Map()
141
+ };
142
+ }
143
+ /** Fold the records of one message into `into`: an answer may arrive in any packet (a reflector forwards them). */
144
+ function mergeMdnsRecords(into, from) {
145
+ for (const ptr of from.ptrs) if (!into.ptrs.some((p) => p.instance === ptr.instance && p.serviceType === ptr.serviceType)) into.ptrs.push(ptr);
146
+ for (const [k, v] of from.srv) into.srv.set(k, v);
147
+ for (const [k, v] of from.txt) into.txt.set(k, v);
148
+ for (const [k, v] of from.addresses) into.addresses.set(k, v);
149
+ }
150
+ /** Every PTR/SRV/TXT/A record of one mDNS message; a malformed packet yields none. */
151
+ function parseMdnsRecords(buf) {
152
+ const out = emptyMdnsRecords();
153
+ if (buf.length < 12) return out;
112
154
  const [questions = 0, answers = 0, authorities = 0, extra = 0] = [
113
155
  4,
114
156
  6,
@@ -118,9 +160,9 @@ function parseMdnsMessage(buf) {
118
160
  let pos = 12;
119
161
  for (let i = 0; i < questions; i++) {
120
162
  const name = readName(buf, pos);
121
- if (name === null) return [];
163
+ if (name === null) return out;
122
164
  pos = name.end + 4;
123
- if (pos > buf.length) return [];
165
+ if (pos > buf.length) return out;
124
166
  }
125
167
  const records = [];
126
168
  for (const count of [
@@ -129,14 +171,11 @@ function parseMdnsMessage(buf) {
129
171
  extra
130
172
  ]) {
131
173
  const read = readRecords(buf, pos, count);
132
- if (read === null) return [];
174
+ if (read === null) return out;
133
175
  records.push(...read.records);
134
176
  pos = read.next;
135
177
  }
136
- const ptrs = [];
137
- const srv = /* @__PURE__ */ new Map();
138
- const txt = /* @__PURE__ */ new Map();
139
- const addresses = /* @__PURE__ */ new Map();
178
+ const { ptrs, srv, txt, addresses } = out;
140
179
  for (const rec of records) {
141
180
  const key = rec.name.toLowerCase();
142
181
  if (rec.type === PTR) {
@@ -154,6 +193,11 @@ function parseMdnsMessage(buf) {
154
193
  } else if (rec.type === TXT) txt.set(key, parseTxt(buf, rec.dataOffset, rec.dataLength));
155
194
  else if (rec.type === A && rec.dataLength === 4) addresses.set(key, `${buf[rec.dataOffset]}.${buf[rec.dataOffset + 1]}.${buf[rec.dataOffset + 2]}.${buf[rec.dataOffset + 3]}`);
156
195
  }
196
+ return out;
197
+ }
198
+ /** The services advertised on one mDNS message; a malformed packet yields none. */
199
+ function parseMdnsMessage(buf) {
200
+ const { ptrs, srv, txt, addresses } = parseMdnsRecords(buf);
157
201
  const out = [];
158
202
  for (const { serviceType, instance } of ptrs) {
159
203
  const service = srv.get(instance.toLowerCase());
@@ -188,6 +232,24 @@ Object.defineProperty(exports, "buildPtrQuery", {
188
232
  return buildPtrQuery;
189
233
  }
190
234
  });
235
+ Object.defineProperty(exports, "buildRecordQuery", {
236
+ enumerable: true,
237
+ get: function() {
238
+ return buildRecordQuery;
239
+ }
240
+ });
241
+ Object.defineProperty(exports, "emptyMdnsRecords", {
242
+ enumerable: true,
243
+ get: function() {
244
+ return emptyMdnsRecords;
245
+ }
246
+ });
247
+ Object.defineProperty(exports, "mergeMdnsRecords", {
248
+ enumerable: true,
249
+ get: function() {
250
+ return mergeMdnsRecords;
251
+ }
252
+ });
191
253
  Object.defineProperty(exports, "normalizeServiceType", {
192
254
  enumerable: true,
193
255
  get: function() {
@@ -200,3 +262,9 @@ Object.defineProperty(exports, "parseMdnsMessage", {
200
262
  return parseMdnsMessage;
201
263
  }
202
264
  });
265
+ Object.defineProperty(exports, "parseMdnsRecords", {
266
+ enumerable: true,
267
+ get: function() {
268
+ return parseMdnsRecords;
269
+ }
270
+ });
@@ -106,9 +106,51 @@ function buildPtrQuery(serviceTypes, options = {}) {
106
106
  });
107
107
  return Buffer.concat([header, ...questions]);
108
108
  }
109
- /** The services advertised on one mDNS message; a malformed packet yields none. */
110
- function parseMdnsMessage(buf) {
111
- if (buf.length < 12) return [];
109
+ var QUESTION_TYPE_CODE = {
110
+ SRV,
111
+ TXT,
112
+ A
113
+ };
114
+ /** A QM (or QU when `unicastResponse`) question per record, for the follow-up that resolves an instance. */
115
+ function buildRecordQuery(questions, options = {}) {
116
+ const questionClass = options.unicastResponse === true ? MDNS_QU_CLASS : MDNS_QM_CLASS;
117
+ const header = Buffer.alloc(12);
118
+ header.writeUInt16BE(questions.length, 4);
119
+ const encoded = questions.map((q) => {
120
+ const parts = q.name.split(".").filter((part) => part.length > 0).map((l) => {
121
+ const bytes = Buffer.from(l);
122
+ return Buffer.concat([Buffer.from([bytes.length]), bytes]);
123
+ });
124
+ const tail = Buffer.alloc(4);
125
+ tail.writeUInt16BE(QUESTION_TYPE_CODE[q.type], 0);
126
+ tail.writeUInt16BE(questionClass, 2);
127
+ return Buffer.concat([
128
+ ...parts,
129
+ Buffer.from([0]),
130
+ tail
131
+ ]);
132
+ });
133
+ return Buffer.concat([header, ...encoded]);
134
+ }
135
+ function emptyMdnsRecords() {
136
+ return {
137
+ ptrs: [],
138
+ srv: /* @__PURE__ */ new Map(),
139
+ txt: /* @__PURE__ */ new Map(),
140
+ addresses: /* @__PURE__ */ new Map()
141
+ };
142
+ }
143
+ /** Fold the records of one message into `into`: an answer may arrive in any packet (a reflector forwards them). */
144
+ function mergeMdnsRecords(into, from) {
145
+ for (const ptr of from.ptrs) if (!into.ptrs.some((p) => p.instance === ptr.instance && p.serviceType === ptr.serviceType)) into.ptrs.push(ptr);
146
+ for (const [k, v] of from.srv) into.srv.set(k, v);
147
+ for (const [k, v] of from.txt) into.txt.set(k, v);
148
+ for (const [k, v] of from.addresses) into.addresses.set(k, v);
149
+ }
150
+ /** Every PTR/SRV/TXT/A record of one mDNS message; a malformed packet yields none. */
151
+ function parseMdnsRecords(buf) {
152
+ const out = emptyMdnsRecords();
153
+ if (buf.length < 12) return out;
112
154
  const [questions = 0, answers = 0, authorities = 0, extra = 0] = [
113
155
  4,
114
156
  6,
@@ -118,9 +160,9 @@ function parseMdnsMessage(buf) {
118
160
  let pos = 12;
119
161
  for (let i = 0; i < questions; i++) {
120
162
  const name = readName(buf, pos);
121
- if (name === null) return [];
163
+ if (name === null) return out;
122
164
  pos = name.end + 4;
123
- if (pos > buf.length) return [];
165
+ if (pos > buf.length) return out;
124
166
  }
125
167
  const records = [];
126
168
  for (const count of [
@@ -129,14 +171,11 @@ function parseMdnsMessage(buf) {
129
171
  extra
130
172
  ]) {
131
173
  const read = readRecords(buf, pos, count);
132
- if (read === null) return [];
174
+ if (read === null) return out;
133
175
  records.push(...read.records);
134
176
  pos = read.next;
135
177
  }
136
- const ptrs = [];
137
- const srv = /* @__PURE__ */ new Map();
138
- const txt = /* @__PURE__ */ new Map();
139
- const addresses = /* @__PURE__ */ new Map();
178
+ const { ptrs, srv, txt, addresses } = out;
140
179
  for (const rec of records) {
141
180
  const key = rec.name.toLowerCase();
142
181
  if (rec.type === PTR) {
@@ -154,6 +193,11 @@ function parseMdnsMessage(buf) {
154
193
  } else if (rec.type === TXT) txt.set(key, parseTxt(buf, rec.dataOffset, rec.dataLength));
155
194
  else if (rec.type === A && rec.dataLength === 4) addresses.set(key, `${buf[rec.dataOffset]}.${buf[rec.dataOffset + 1]}.${buf[rec.dataOffset + 2]}.${buf[rec.dataOffset + 3]}`);
156
195
  }
196
+ return out;
197
+ }
198
+ /** The services advertised on one mDNS message; a malformed packet yields none. */
199
+ function parseMdnsMessage(buf) {
200
+ const { ptrs, srv, txt, addresses } = parseMdnsRecords(buf);
157
201
  const out = [];
158
202
  for (const { serviceType, instance } of ptrs) {
159
203
  const service = srv.get(instance.toLowerCase());
@@ -170,4 +214,4 @@ function parseMdnsMessage(buf) {
170
214
  return out;
171
215
  }
172
216
  //#endregion
173
- export { parseMdnsMessage as a, normalizeServiceType as i, MDNS_PORT as n, buildPtrQuery as r, MDNS_GROUP as t };
217
+ export { emptyMdnsRecords as a, parseMdnsMessage as c, buildRecordQuery as i, parseMdnsRecords as l, MDNS_PORT as n, mergeMdnsRecords as o, buildPtrQuery as r, normalizeServiceType as s, MDNS_GROUP as t };
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-Hwzm3DCe.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-UKXXEEoS.js");
3
3
  let node_worker_threads = require("node:worker_threads");
4
4
  //#region src/builtins/sqlite-storage/file-host-worker.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-D7XmFaUD.mjs";
1
+ import { A as callRecords, C as isFileHostWorkerData, D as RecordsEngine, M as controlTargetOf, O as callControl, S as isFileHostRequest, a as WalMaintenance, b as collectTransferables, d as callMigrate, f as migrateTargetOf, j as callVector, k as callData, l as SqliteSettingsBackend, o as createVectorIndex, s as vectorProviderOf, u as HUB_MIGRATIONS, v as serializeError, w as trustInput } from "./wal-maintenance-0XhlopB5.mjs";
2
2
  import { parentPort, threadId, workerData } from "node:worker_threads";
3
3
  //#region src/builtins/sqlite-storage/file-host-worker.ts
4
4
  /**
@@ -1,7 +1,7 @@
1
1
  import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
2
- import { Vs as userError } from "./dist-DcHvuBfD.mjs";
2
+ import { Hs as userError } from "./dist-CnC8-kF6.mjs";
3
3
  import { f as X509Certificate$1 } from "./x509.es-BRiJgOvu.mjs";
4
- import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-D3dptveB.mjs";
4
+ import { D as reasonRequiresNewCa, E as evaluateExistingCert, F as readNameConstraints, N as permitsIdentity, _ as issueLeaf, b as collectCertIdentity, g as generateCa, j as isConstrainedCa, v as loadCa, y as localCaCommonName } from "./agent-https-BVCIU0eH.mjs";
5
5
  import { X509Certificate, createPrivateKey } from "node:crypto";
6
6
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
7
7
  import { mkdir, writeFile } from "node:fs/promises";
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-CwYYyGAB.js");
2
+ const require_dist = require("./dist-B4r3_aYb.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
- const require_agent_https = require("./agent-https-v5uyVgpk.js");
4
+ const require_agent_https = require("./agent-https-DrCbFr4p.js");
5
5
  let node_crypto = require("node:crypto");
6
6
  let _camstack_types_node = require("@camstack/types/node");
7
7
  let node_fs_promises = require("node:fs/promises");
@@ -141,6 +141,7 @@ export type { ClusterNodeHistoryBody, ClusterNodeTombstoneBody } from "./builtin
141
141
  export { storageOrchestratorRecordKinds, STORAGE_DRAIN_STATE_LEGACY } from "./builtins/storage-orchestrator/record-kinds.js";
142
142
  export { backupOrchestratorRecordKinds, backupRecordStoresOf, type BackupRecordStores } from "./builtins/backup-orchestrator/record-kinds.js";
143
143
  export { readAllRows } from "./records/read-all-rows.js";
144
+ export { clearNodeSettings } from "./kernel/addon-settings-store.js";
144
145
  export { RecordsEngine, type RecordsEngineOptions } from "./builtins/sqlite-storage/records/records-engine.js";
145
146
  export { type EnsureAddonNativePrebuildsOptions, ensureAddonNativePrebuilds, type NativeEnsureOutcome, type NativeEnsureResult } from "./kernel/deps/ensure-addon-natives.js";
146
147
  export { type EnsureNativePrebuildsOptions, ensureNativePrebuilds, hasDotNode, NATIVE_SCAN_DEPTH, type PrebuildFetchFn, type PrebuildTarget, TRADITIONAL_NATIVE_PACKAGES } from "./kernel/deps/ensure-native-prebuilds.js";