@camstack/server 1.2.846 → 1.2.848

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 (94) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/api/trpc/generated-cap-routers.js +9 -0
  3. package/dist/core/addon/instance-lifecycle.js +10 -6
  4. package/package.json +10 -20
  5. package/system/dist/addon-utils.mjs +1 -1
  6. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  7. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +4 -4
  8. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  9. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +5 -5
  10. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  11. package/system/dist/builtins/alerts/alerts.addon.mjs +3 -3
  12. package/system/dist/builtins/autotrack/index.js +1 -1
  13. package/system/dist/builtins/autotrack/index.mjs +1 -1
  14. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  15. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +5 -5
  16. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  17. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  18. package/system/dist/builtins/camera-grid/index.js +1 -1
  19. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  20. package/system/dist/builtins/composer/composer.addon.js +4 -4
  21. package/system/dist/builtins/composer/composer.addon.mjs +4 -4
  22. package/system/dist/builtins/console-logging/index.js +1 -1
  23. package/system/dist/builtins/console-logging/index.mjs +1 -1
  24. package/system/dist/builtins/core-blocks/core-blocks.addon.js +36 -8
  25. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +36 -8
  26. package/system/dist/builtins/core-blocks/remote-service.d.ts +5 -1
  27. package/system/dist/builtins/core-blocks/remote-wiring.d.ts +3 -1
  28. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  29. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  30. package/system/dist/builtins/device-manager/device-manager.addon.js +2 -2
  31. package/system/dist/builtins/device-manager/device-manager.addon.mjs +2 -2
  32. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  33. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  34. package/system/dist/builtins/keychain/index.js +4 -4
  35. package/system/dist/builtins/keychain/index.mjs +4 -4
  36. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  37. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  38. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  39. package/system/dist/builtins/local-auth/local-auth.addon.mjs +5 -5
  40. package/system/dist/builtins/local-network/local-network.addon.js +3 -3
  41. package/system/dist/builtins/local-network/local-network.addon.mjs +3 -3
  42. package/system/dist/builtins/loki-logging/index.js +1 -1
  43. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  44. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  45. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +10 -10
  46. package/system/dist/builtins/platform-probe/index.js +1 -1
  47. package/system/dist/builtins/platform-probe/index.mjs +10 -10
  48. package/system/dist/builtins/record-entries/index.js +1 -1
  49. package/system/dist/builtins/record-entries/index.mjs +1 -1
  50. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  51. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  52. package/system/dist/builtins/snapshot/index.js +1 -1
  53. package/system/dist/builtins/snapshot/index.mjs +1 -1
  54. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  55. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +20 -20
  56. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  57. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  58. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  59. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  60. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  61. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  62. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  63. package/system/dist/builtins/system-config/system-config.addon.mjs +115 -115
  64. package/system/dist/builtins/winston-logging/index.js +1 -1
  65. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  66. package/system/dist/{capture-engine-5Dc1kESK.mjs → capture-engine-BDgAg1_L.mjs} +1 -1
  67. package/system/dist/{capture-engine-CAe07XOa.js → capture-engine-CLow73VK.js} +1 -1
  68. package/system/dist/{composition-sources--rfbIp5Q.mjs → composition-sources-PCla-eR3.mjs} +1 -1
  69. package/system/dist/{composition-sources-DnPdeEpc.js → composition-sources-Xb2YACrP.js} +1 -1
  70. package/system/dist/{constants-BCHaKB-z.mjs → constants-Cjv1STtI.mjs} +1 -1
  71. package/system/dist/{constants-CSzJdfTh.js → constants-Crx9nPwX.js} +1 -1
  72. package/system/dist/{coral-accelerators-BW3OcrLD.mjs → coral-accelerators-DBlgWB8k.mjs} +6 -6
  73. package/system/dist/{custom-action-registry-N7flBDwT.mjs → custom-action-registry-B9zFBNVa.mjs} +37 -37
  74. package/system/dist/{device-ca-wE8cQltR.mjs → device-ca-D5bhkYRx.mjs} +1 -1
  75. package/system/dist/{device-ca-DtTxpBwM.js → device-ca-jaJY-9dh.js} +1 -1
  76. package/system/dist/{dist-fVo218pz.mjs → dist-CUB8zpv-.mjs} +246 -17
  77. package/system/dist/{dist-qTxCMNU_.js → dist-D9G24tL4.js} +246 -17
  78. package/system/dist/file-host-worker.js +1 -1
  79. package/system/dist/file-host-worker.mjs +1 -1
  80. package/system/dist/{hub-identity-DG_5XGOq.mjs → hub-identity-0lAqqUXZ.mjs} +10 -10
  81. package/system/dist/{hub-identity-B3Mwwm1k.js → hub-identity-D6Yzg92a.js} +1 -1
  82. package/system/dist/{hub-mdns-ciao-DeJIUTtf.js → hub-mdns-ciao-0vZomp05.js} +2 -2
  83. package/system/dist/{hub-mdns-ciao-BgfvtyNE.mjs → hub-mdns-ciao-dT75vFJK.mjs} +2 -2
  84. package/system/dist/index.js +22 -10
  85. package/system/dist/index.mjs +233 -221
  86. package/system/dist/{legacy-integration-rows-door-CXQJPQdS.mjs → legacy-integration-rows-door-CkwpRASZ.mjs} +1 -1
  87. package/system/dist/{legacy-integration-rows-door-BERb1HaB.js → legacy-integration-rows-door-V0HNtga9.js} +1 -1
  88. package/system/dist/{rename-composition-block-BldkznZq.mjs → rename-composition-block-CKO6KFN4.mjs} +1 -1
  89. package/system/dist/{rename-composition-block-DulTUVAf.js → rename-composition-block-CmNS12Yh.js} +1 -1
  90. package/system/dist/{restore-archive-myv6HETV.mjs → restore-archive-Cp8P5gxb.mjs} +94 -94
  91. package/system/dist/{restore-archive-D8KARE3l.js → restore-archive-DRyTaAb5.js} +1 -1
  92. package/system/dist/{wal-maintenance-C_RAwz8s.mjs → wal-maintenance-CyW12mpW.mjs} +0 -0
  93. package/system/dist/{wal-maintenance-DmpBLvE9.js → wal-maintenance-EJcAHbIL.js} +0 -0
  94. package/system/package.json +1 -1
@@ -1243,7 +1243,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1243
1243
  */
1244
1244
  var COMPOSED_DEVICE_STABLE_ID_PREFIX = "composed-";
1245
1245
  //#endregion
1246
- //#region ../types/dist/sleep-D0roI_CZ.mjs
1246
+ //#region ../types/dist/sleep-Ba1dJYDo.mjs
1247
1247
  /**
1248
1248
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1249
1249
  * window to float samples (D455).
@@ -8266,7 +8266,10 @@ var ACTUATOR_CAP_VOCABULARY = {
8266
8266
  "ir-transmitter": {
8267
8267
  scope: "device",
8268
8268
  noun: t("IR / RF transmitter", "Trasmettitore IR / RF"),
8269
- notOperatorFacing: { send: "a raw pulse train is not something an operator composes in an automation; the remote that owns the command table sends it" }
8269
+ notOperatorFacing: {
8270
+ send: "a raw pulse train is not something an operator composes in an automation; the remote that owns the command table sends it",
8271
+ learn: "an interactive capture the operator starts from the source dialog and answers by pressing a physical remote; no automation can supply the signal"
8272
+ }
8270
8273
  },
8271
8274
  control: {
8272
8275
  scope: "device",
@@ -53685,11 +53688,13 @@ var IrCodecError = class extends Error {
53685
53688
  this.code = code;
53686
53689
  }
53687
53690
  };
53691
+ /** Maximum number of mark/space entries one pulse train may carry. */
53692
+ var IR_TIMINGS_MAX = 1024;
53688
53693
  /**
53689
53694
  * A pulse train in signed microseconds: mark (+) first, then space (-), strictly
53690
53695
  * alternating, no zeros, 2..1024 entries.
53691
53696
  */
53692
- var IrTimingsSchema = zod.z.array(zod.z.number().int()).min(2).max(1024).superRefine((timings, ctx) => {
53697
+ var IrTimingsSchema = zod.z.array(zod.z.number().int()).min(2).max(IR_TIMINGS_MAX).superRefine((timings, ctx) => {
53693
53698
  timings.forEach((value, index) => {
53694
53699
  const expectMark = index % 2 === 0;
53695
53700
  if (value === 0 || value > 0 !== expectMark) ctx.addIssue({
@@ -53736,15 +53741,186 @@ function decodePronto(code) {
53736
53741
  carrierHz: Math.round(1e6 / unitUs)
53737
53742
  };
53738
53743
  }
53739
- /** What a remote command stores: a raw pulse train, or a learned Pronto code. */
53740
- var IrPayloadSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
53741
- kind: zod.z.literal("raw"),
53742
- timings: zod.z.array(zod.z.number().int()),
53743
- settings: TransmitSettingsSchema.optional()
53744
- }), zod.z.object({
53745
- kind: zod.z.literal("pronto"),
53746
- code: zod.z.string()
53747
- })]);
53744
+ /**
53745
+ * FastLZ level 1: a byte-oriented LZ77 stream. A control byte below 32 starts a
53746
+ * literal run of `ctrl + 1` bytes; otherwise it is a back-reference whose length
53747
+ * is `ctrl >> 5` (extended by one byte when 7) and whose distance is split
53748
+ * between the low 5 bits and the next byte.
53749
+ */
53750
+ var MAX_DISTANCE = 8192;
53751
+ var MAX_LITERAL_RUN = 32;
53752
+ var MIN_MATCH = 3;
53753
+ var MAX_MATCH = 264;
53754
+ /**
53755
+ * Most bytes a decoded IR code may hold: two bytes per timing. A level-1 stream
53756
+ * can expand ~130x, so the decoder checks this bound before every write.
53757
+ */
53758
+ var IR_DECOMPRESSED_MAX = IR_TIMINGS_MAX * 2;
53759
+ function fastlzDecompress(input) {
53760
+ const out = [];
53761
+ let ip = 0;
53762
+ const room = (count) => {
53763
+ if (out.length + count > IR_DECOMPRESSED_MAX) throw new IrCodecError("tuya-malformed", "decompressed code is larger than any IR train");
53764
+ };
53765
+ const next = () => {
53766
+ const byte = input[ip++];
53767
+ if (byte === void 0) throw new IrCodecError("tuya-malformed", "compressed stream is truncated");
53768
+ return byte;
53769
+ };
53770
+ while (ip < input.length) {
53771
+ const ctrl = next();
53772
+ if (ctrl < 32) {
53773
+ room(ctrl + 1);
53774
+ for (let i = 0; i <= ctrl; i++) out.push(next());
53775
+ continue;
53776
+ }
53777
+ let len = (ctrl >> 5) - 1;
53778
+ if (len === 6) len += next();
53779
+ const distance = ((ctrl & 31) << 8) + next() + 1;
53780
+ const start = out.length - distance;
53781
+ if (start < 0) throw new IrCodecError("tuya-malformed", "back-reference points before the stream");
53782
+ room(len + 3);
53783
+ for (let i = 0; i < len + 3; i++) {
53784
+ const byte = out[start + i];
53785
+ if (byte === void 0) throw new IrCodecError("tuya-malformed", "back-reference is invalid");
53786
+ out.push(byte);
53787
+ }
53788
+ }
53789
+ return Uint8Array.from(out);
53790
+ }
53791
+ function fastlzCompress(input) {
53792
+ const out = [];
53793
+ const lastSeen = /* @__PURE__ */ new Map();
53794
+ let literalStart = 0;
53795
+ const flushLiterals = (end) => {
53796
+ for (let from = literalStart; from < end; from += MAX_LITERAL_RUN) {
53797
+ const to = Math.min(from + MAX_LITERAL_RUN, end);
53798
+ out.push(to - from - 1);
53799
+ for (let i = from; i < to; i++) out.push(input[i] ?? 0);
53800
+ }
53801
+ };
53802
+ let pos = 0;
53803
+ while (pos < input.length) {
53804
+ let matchLen = 0;
53805
+ let matchDistance = 0;
53806
+ if (pos + MIN_MATCH <= input.length) {
53807
+ const key = (input[pos] ?? 0) << 16 | (input[pos + 1] ?? 0) << 8 | (input[pos + 2] ?? 0);
53808
+ const candidate = lastSeen.get(key);
53809
+ lastSeen.set(key, pos);
53810
+ if (candidate !== void 0 && pos - candidate <= MAX_DISTANCE) {
53811
+ let len = 0;
53812
+ while (pos + len < input.length && len < MAX_MATCH && input[candidate + len] === input[pos + len]) len++;
53813
+ if (len >= MIN_MATCH) {
53814
+ matchLen = len;
53815
+ matchDistance = pos - candidate - 1;
53816
+ }
53817
+ }
53818
+ }
53819
+ if (matchLen === 0) {
53820
+ pos++;
53821
+ continue;
53822
+ }
53823
+ flushLiterals(pos);
53824
+ const enc = matchLen - 2;
53825
+ if (enc < 7) out.push(enc << 5 | matchDistance >> 8);
53826
+ else out.push(224 | matchDistance >> 8, enc - 7);
53827
+ out.push(matchDistance & 255);
53828
+ pos += matchLen;
53829
+ literalStart = pos;
53830
+ }
53831
+ flushLiterals(input.length);
53832
+ return Uint8Array.from(out);
53833
+ }
53834
+ var ALPHABET = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
53835
+ var MAX_DURATION_US = 65535;
53836
+ function toBase64(bytes) {
53837
+ let out = "";
53838
+ for (let i = 0; i < bytes.length; i += 3) {
53839
+ const a = bytes[i] ?? 0;
53840
+ const b = bytes[i + 1] ?? 0;
53841
+ const c = bytes[i + 2] ?? 0;
53842
+ const word = a << 16 | b << 8 | c;
53843
+ out += ALPHABET[word >> 18 & 63];
53844
+ out += ALPHABET[word >> 12 & 63];
53845
+ out += i + 1 < bytes.length ? ALPHABET[word >> 6 & 63] : "=";
53846
+ out += i + 2 < bytes.length ? ALPHABET[word & 63] : "=";
53847
+ }
53848
+ return out;
53849
+ }
53850
+ function fromBase64(text) {
53851
+ const clean = text.trim().replace(/=+$/, "");
53852
+ if (clean.length === 0 || clean.length % 4 === 1) throw new IrCodecError("tuya-malformed", "not a base64 string");
53853
+ const out = [];
53854
+ let bits = 0;
53855
+ let acc = 0;
53856
+ for (const ch of clean) {
53857
+ const value = ALPHABET.indexOf(ch);
53858
+ if (value < 0) throw new IrCodecError("tuya-malformed", "not a base64 string");
53859
+ acc = acc << 6 | value;
53860
+ bits += 6;
53861
+ if (bits >= 8) {
53862
+ bits -= 8;
53863
+ out.push(acc >> bits & 255);
53864
+ }
53865
+ }
53866
+ return Uint8Array.from(out);
53867
+ }
53868
+ /** Signed pulse train to a Tuya IR code: base64(FastLZ(uint16 LE durations)). */
53869
+ function encodeTuya(timings) {
53870
+ const bytes = new Uint8Array(timings.length * 2);
53871
+ timings.forEach((value, index) => {
53872
+ const duration = Math.abs(value);
53873
+ if (duration === 0 || duration > MAX_DURATION_US) throw new IrCodecError("invalid-timings", `timing ${index} does not fit 16 bits`);
53874
+ bytes[index * 2] = duration & 255;
53875
+ bytes[index * 2 + 1] = duration >> 8;
53876
+ });
53877
+ return toBase64(fastlzCompress(bytes));
53878
+ }
53879
+ /** A Tuya IR code to a signed pulse train (mark first). Throws `IrCodecError`. */
53880
+ function decodeTuya(code) {
53881
+ const bytes = fastlzDecompress(fromBase64(code));
53882
+ if (bytes.length === 0 || bytes.length % 2 !== 0) throw new IrCodecError("tuya-malformed", "payload is not a list of 16-bit durations");
53883
+ const timings = [];
53884
+ for (let i = 0; i < bytes.length; i += 2) {
53885
+ const duration = (bytes[i] ?? 0) | (bytes[i + 1] ?? 0) << 8;
53886
+ timings.push(i / 2 % 2 === 0 ? duration : -duration);
53887
+ }
53888
+ const checked = IrTimingsSchema.safeParse(timings);
53889
+ if (!checked.success) throw new IrCodecError("tuya-malformed", checked.error.message);
53890
+ return checked.data;
53891
+ }
53892
+ /** Device-native IR code formats a transmitter can replay verbatim. */
53893
+ var IrNativeFormatSchema = zod.z.enum(["tuya"]);
53894
+ /**
53895
+ * Longest native code accepted: base64 of the worst-case compressed stream
53896
+ * (every decoded byte as a literal, plus one control byte per 32), with margin.
53897
+ */
53898
+ var IR_NATIVE_CODE_MAX_CHARS = Math.ceil((IR_DECOMPRESSED_MAX + Math.ceil(IR_DECOMPRESSED_MAX / 32)) / 3) * 4 + 256;
53899
+ var IrNativeCodeSchema = zod.z.object({
53900
+ format: IrNativeFormatSchema,
53901
+ code: zod.z.string().min(1).max(IR_NATIVE_CODE_MAX_CHARS)
53902
+ });
53903
+ var IR_NATIVE_CODECS = { tuya: {
53904
+ encode: encodeTuya,
53905
+ decode: decodeTuya
53906
+ } };
53907
+ /** What a remote command stores: a raw pulse train, a learned Pronto code, or a device-native code. */
53908
+ var IrPayloadSchema = zod.z.discriminatedUnion("kind", [
53909
+ zod.z.object({
53910
+ kind: zod.z.literal("raw"),
53911
+ timings: zod.z.array(zod.z.number().int()),
53912
+ settings: TransmitSettingsSchema.optional()
53913
+ }),
53914
+ zod.z.object({
53915
+ kind: zod.z.literal("pronto"),
53916
+ code: zod.z.string()
53917
+ }),
53918
+ zod.z.object({
53919
+ kind: zod.z.literal("native"),
53920
+ format: IrNativeFormatSchema,
53921
+ code: zod.z.string()
53922
+ })
53923
+ ]);
53748
53924
  /** Resolve a payload to what `ir-transmitter.send` takes. Throws `IrCodecError`. */
53749
53925
  function toTimings(payload) {
53750
53926
  if (payload.kind === "pronto") {
@@ -53754,6 +53930,10 @@ function toTimings(payload) {
53754
53930
  settings: { carrierHz: decoded.carrierHz }
53755
53931
  };
53756
53932
  }
53933
+ if (payload.kind === "native") return {
53934
+ timings: IR_NATIVE_CODECS[payload.format].decode(payload.code),
53935
+ settings: {}
53936
+ };
53757
53937
  const checked = IrTimingsSchema.safeParse(payload.timings);
53758
53938
  if (!checked.success) throw new IrCodecError("invalid-timings", checked.error.message);
53759
53939
  return {
@@ -68128,7 +68308,19 @@ var IrSendResultSchema = zod.z.object({
68128
68308
  var IrTransmitterInfoSchema = zod.z.object({
68129
68309
  media: zod.z.array(IrMediumSchema),
68130
68310
  settable: zod.z.array(TransmitSettingKeySchema),
68131
- maxTimings: zod.z.number().int().positive()
68311
+ maxTimings: zod.z.number().int().positive(),
68312
+ /** The transmitter can learn a code (`learn`). */
68313
+ learn: zod.z.boolean().default(false),
68314
+ /** Native code formats the transmitter replays verbatim (`send.native`). */
68315
+ formats: zod.z.array(IrNativeFormatSchema).default([])
68316
+ });
68317
+ var IR_LEARN_TIMEOUT_DEFAULT_MS = 2e4;
68318
+ var IR_LEARN_TIMEOUT_MAX_MS = 6e4;
68319
+ var IrLearnResultSchema = zod.z.object({
68320
+ /** The code in the device's own format, when it reports one. */
68321
+ native: IrNativeCodeSchema.nullable(),
68322
+ timings: IrTimingsSchema,
68323
+ carrierHz: zod.z.number().int().positive().nullable()
68132
68324
  });
68133
68325
  /**
68134
68326
  * ir-transmitter — emit a pulse train (infrared or RF) with settings. One cap
@@ -68139,7 +68331,12 @@ var IrTransmitterInfoSchema = zod.z.object({
68139
68331
  * transmitter cannot be reached) and `ir-transmitter.too-long` (more pulses
68140
68332
  * than the transmitter's `maxTimings`). A setting the transmitter cannot apply
68141
68333
  * is NOT a refusal: the train is sent and the key comes back in
68142
- * `ignoredSettings`.
68334
+ * `ignoredSettings`. `send` takes exactly one of `timings` or `native` (a code
68335
+ * in a format listed in `getInfo.formats`).
68336
+ *
68337
+ * `learn` waits for the user to point a remote at the transmitter and refuses
68338
+ * with `ir-transmitter.learn-unsupported`, `ir-transmitter.learn-timeout` or
68339
+ * `ir-transmitter.learn-undecodable`.
68143
68340
  */
68144
68341
  var irTransmitterCapability = {
68145
68342
  name: "ir-transmitter",
@@ -68150,9 +68347,17 @@ var irTransmitterCapability = {
68150
68347
  methods: {
68151
68348
  send: method(zod.z.object({
68152
68349
  deviceId: zod.z.number().int().nonnegative(),
68153
- timings: IrTimingsSchema,
68350
+ timings: IrTimingsSchema.optional(),
68351
+ native: IrNativeCodeSchema.optional(),
68154
68352
  settings: TransmitSettingsSchema.optional()
68155
- }), IrSendResultSchema, {
68353
+ }).refine((input) => input.timings === void 0 !== (input.native === void 0), { message: "send takes exactly one of timings or native" }), IrSendResultSchema, {
68354
+ kind: "mutation",
68355
+ auth: "protected"
68356
+ }),
68357
+ learn: method(zod.z.object({
68358
+ deviceId: zod.z.number().int().nonnegative(),
68359
+ timeoutMs: zod.z.number().int().positive().max(IR_LEARN_TIMEOUT_MAX_MS).default(IR_LEARN_TIMEOUT_DEFAULT_MS)
68360
+ }), IrLearnResultSchema, {
68156
68361
  kind: "mutation",
68157
68362
  auth: "protected"
68158
68363
  }),
@@ -81635,6 +81840,13 @@ var NcRuleInputSchema = zod.z.object({
81635
81840
  */
81636
81841
  groupingSec: zod.z.number().int().min(5).max(60).optional(),
81637
81842
  /**
81843
+ * Hold deliveries of this rule to one target and, when two or more arrive
81844
+ * before the window ends, send them as one summary. Absent = the kind's
81845
+ * default (`groupWithinSecOf`): 5 s for a system-event rule, 0 for every
81846
+ * other kind. `0` sends each delivery as it does today.
81847
+ */
81848
+ groupWithinSec: zod.z.number().int().min(0).max(300).optional(),
81849
+ /**
81638
81850
  * ASK ME TO CONFIRM DETECTIONS (#243): a DETECTION notification of this rule
81639
81851
  * carries "Correct" / "Wrong" buttons (and, where the channel has room, a
81640
81852
  * "Wrong, it is a <class>" choice). A tap marks the track for retraining, the
@@ -82073,7 +82285,12 @@ var NcHistoryEntrySchema = zod.z.object({
82073
82285
  * Assistant export) must render as "no image right now", never as a
82074
82286
  * broken link.
82075
82287
  */
82076
- artifactIds: zod.z.array(zod.z.string().min(1)).optional()
82288
+ artifactIds: zod.z.array(zod.z.string().min(1)).optional(),
82289
+ /**
82290
+ * When this row was folded into a group-window summary, the outbox id of
82291
+ * that one notification. Absent on a row that was sent as itself.
82292
+ */
82293
+ groupedInto: zod.z.string().min(1).optional()
82077
82294
  });
82078
82295
  /**
82079
82296
  * Query filter for `getHistory` (spec §4.2). Every field is a narrowing
@@ -108657,6 +108874,13 @@ var METHOD_ACCESS_MAP = Object.freeze({
108657
108874
  access: "view",
108658
108875
  role: "viewer"
108659
108876
  },
108877
+ "irTransmitter.learn": {
108878
+ capName: "ir-transmitter",
108879
+ capScope: "device",
108880
+ addonId: null,
108881
+ access: "create",
108882
+ role: "viewer"
108883
+ },
108660
108884
  "irTransmitter.send": {
108661
108885
  capName: "ir-transmitter",
108662
108886
  capScope: "device",
@@ -116754,6 +116978,11 @@ Object.freeze({
116754
116978
  form: "single",
116755
116979
  optional: false
116756
116980
  }],
116981
+ "irTransmitter.learn": [{
116982
+ name: "deviceId",
116983
+ form: "single",
116984
+ optional: false
116985
+ }],
116757
116986
  "irTransmitter.send": [{
116758
116987
  name: "deviceId",
116759
116988
  form: "single",
@@ -1,5 +1,5 @@
1
1
  require("./chunk-Cek0wNdY.js");
2
- const require_wal_maintenance = require("./wal-maintenance-DmpBLvE9.js");
2
+ const require_wal_maintenance = require("./wal-maintenance-EJcAHbIL.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-C_RAwz8s.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-CyW12mpW.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,10 +1,10 @@
1
- import { Cc as defineRecordKinds } from "./dist-fVo218pz.mjs";
1
+ import { Cc as defineRecordKinds } from "./dist-CUB8zpv-.mjs";
2
2
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, _ as NameConstraints, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, g as GeneralSubtrees, h as GeneralSubtree, i as Extension, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension, u as SubjectAlternativeNameExtension, v as GeneralName, x as AsnConvert } from "./x509.es-BRiJgOvu.mjs";
3
3
  import { z } from "zod";
4
4
  import { X509Certificate, createHash, createPrivateKey, randomBytes, webcrypto } from "node:crypto";
5
5
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
6
6
  import { isIP } from "node:net";
7
- import * as fs from "node:fs";
7
+ import * as fs$1 from "node:fs";
8
8
  import { existsSync, mkdirSync, readFileSync, renameSync, writeFileSync } from "node:fs";
9
9
  import * as path$1 from "node:path";
10
10
  import { join } from "node:path";
@@ -1067,7 +1067,7 @@ var HUB_IDENTITY_RELATIVE = `tls/${HUB_IDENTITY_FILE}`;
1067
1067
  function readHubIdFile(file) {
1068
1068
  let parsed;
1069
1069
  try {
1070
- parsed = JSON.parse(fs.readFileSync(file, "utf8"));
1070
+ parsed = JSON.parse(fs$1.readFileSync(file, "utf8"));
1071
1071
  } catch (err) {
1072
1072
  return {
1073
1073
  hubId: null,
@@ -1094,18 +1094,18 @@ function identityPath(dataDir) {
1094
1094
  function writeHubIdFile(file, hubId) {
1095
1095
  const tmp = `${file}.${process.pid}.tmp`;
1096
1096
  try {
1097
- fs.mkdirSync(path$1.dirname(file), { recursive: true });
1098
- fs.writeFileSync(tmp, `${JSON.stringify({ hubId }, null, 2)}\n`);
1099
- fs.linkSync(tmp, file);
1097
+ fs$1.mkdirSync(path$1.dirname(file), { recursive: true });
1098
+ fs$1.writeFileSync(tmp, `${JSON.stringify({ hubId }, null, 2)}\n`);
1099
+ fs$1.linkSync(tmp, file);
1100
1100
  } catch (err) {
1101
- if (fs.existsSync(file)) return readHubIdFile(file);
1101
+ if (fs$1.existsSync(file)) return readHubIdFile(file);
1102
1102
  return {
1103
1103
  hubId: null,
1104
1104
  created: false,
1105
1105
  problem: `could not write ${file}: ${err instanceof Error ? err.message : String(err)}`
1106
1106
  };
1107
1107
  } finally {
1108
- fs.rmSync(tmp, { force: true });
1108
+ fs$1.rmSync(tmp, { force: true });
1109
1109
  }
1110
1110
  return {
1111
1111
  hubId,
@@ -1119,9 +1119,9 @@ function writeHubIdFile(file, hubId) {
1119
1119
  */
1120
1120
  function loadOrCreateHubId(dataDir) {
1121
1121
  const file = identityPath(dataDir);
1122
- if (fs.existsSync(file)) return readHubIdFile(file);
1122
+ if (fs$1.existsSync(file)) return readHubIdFile(file);
1123
1123
  const legacy = path$1.join(dataDir, HUB_IDENTITY_FILE);
1124
- if (fs.existsSync(legacy)) {
1124
+ if (fs$1.existsSync(legacy)) {
1125
1125
  const read = readHubIdFile(legacy);
1126
1126
  if (read.hubId === null) return read;
1127
1127
  if (writeHubIdFile(file, read.hubId).hubId === null) return read;
@@ -1,5 +1,5 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-qTxCMNU_.js");
2
+ const require_dist = require("./dist-D9G24tL4.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
4
  let zod = require("zod");
5
5
  let node_crypto = require("node:crypto");
@@ -1,7 +1,7 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- const require_dist = require("./dist-qTxCMNU_.js");
2
+ const require_dist = require("./dist-D9G24tL4.js");
3
3
  const require_x509_es = require("./x509.es-WtnRNyYS.js");
4
- const require_hub_identity = require("./hub-identity-B3Mwwm1k.js");
4
+ const require_hub_identity = require("./hub-identity-D6Yzg92a.js");
5
5
  let node_crypto = require("node:crypto");
6
6
  let _camstack_types_node = require("@camstack/types/node");
7
7
  let node_fs = require("node:fs");
@@ -1,7 +1,7 @@
1
1
  import { o as __toESM } from "./chunk-CNf5ZN-e.mjs";
2
- import { pl as userError } from "./dist-fVo218pz.mjs";
2
+ import { pl as userError } from "./dist-CUB8zpv-.mjs";
3
3
  import { f as X509Certificate$1 } from "./x509.es-BRiJgOvu.mjs";
4
- import { A as evaluateExistingCert, C as localCaCommonName, F as isConstrainedCa, L as permitsIdentity, S as loadCa, b as generateCa, j as reasonRequiresNewCa, w as collectCertIdentity, x as issueLeaf, z as readNameConstraints } from "./hub-identity-DG_5XGOq.mjs";
4
+ import { A as evaluateExistingCert, C as localCaCommonName, F as isConstrainedCa, L as permitsIdentity, S as loadCa, b as generateCa, j as reasonRequiresNewCa, w as collectCertIdentity, x as issueLeaf, z as readNameConstraints } from "./hub-identity-0lAqqUXZ.mjs";
5
5
  import { X509Certificate, createPrivateKey } from "node:crypto";
6
6
  import { writeOwnerOnlyFileSync } from "@camstack/types/node";
7
7
  import { copyFileSync, existsSync, mkdirSync, readFileSync, renameSync, rmSync, writeFileSync } from "node:fs";
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-Cek0wNdY.js");
3
- const require_dist = require("./dist-qTxCMNU_.js");
4
- const require_device_ca = require("./device-ca-DtTxpBwM.js");
3
+ const require_dist = require("./dist-D9G24tL4.js");
4
+ const require_device_ca = require("./device-ca-jaJY-9dh.js");
5
5
  const require_read_all_rows$1 = require("./read-all-rows-CVoO1ONM.js");
6
6
  const require_log_redactor = require("./log-redactor-BhIEMaG9.js");
7
7
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
@@ -28,22 +28,22 @@ const require_builtins_loki_logging_index = require("./builtins/loki-logging/ind
28
28
  const require_builtins_native_metrics_native_metrics_addon = require("./builtins/native-metrics/native-metrics.addon.js");
29
29
  const require_builtins_device_history_device_history_addon = require("./builtins/device-history/device-history.addon.js");
30
30
  const require_builtins_sqlite_storage_filesystem_storage_addon = require("./builtins/sqlite-storage/filesystem-storage.addon.js");
31
- const require_wal_maintenance = require("./wal-maintenance-DmpBLvE9.js");
32
- const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-BERb1HaB.js");
31
+ const require_wal_maintenance = require("./wal-maintenance-EJcAHbIL.js");
32
+ const require_legacy_integration_rows_door = require("./legacy-integration-rows-door-V0HNtga9.js");
33
33
  const require_builtins_sqlite_storage_sqlite_settings_addon = require("./builtins/sqlite-storage/sqlite-settings.addon.js");
34
34
  const require_builtins_sqlite_storage_index = require("./builtins/sqlite-storage/index.js");
35
35
  const require_builtins_storage_orchestrator_storage_orchestrator_addon = require("./builtins/storage-orchestrator/storage-orchestrator.addon.js");
36
36
  require("./builtins/storage-orchestrator/index.js");
37
- const require_hub_identity = require("./hub-identity-B3Mwwm1k.js");
38
- const require_constants = require("./constants-CSzJdfTh.js");
37
+ const require_hub_identity = require("./hub-identity-D6Yzg92a.js");
38
+ const require_constants = require("./constants-Crx9nPwX.js");
39
39
  const require_builtins_system_config_system_config_addon = require("./builtins/system-config/system-config.addon.js");
40
40
  require("./builtins/system-config/index.js");
41
41
  const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
42
42
  const require_custom_action_registry = require("./custom-action-registry-CmWpSeMS.js");
43
- const require_hub_mdns_ciao = require("./hub-mdns-ciao-DeJIUTtf.js");
43
+ const require_hub_mdns_ciao = require("./hub-mdns-ciao-0vZomp05.js");
44
44
  const require_platform_key_source = require("./platform-key-source-Di7HrlGR.js");
45
45
  const require_resource_monitor = require("./resource-monitor-mio9dSCT.js");
46
- const require_restore_archive = require("./restore-archive-D8KARE3l.js");
46
+ const require_restore_archive = require("./restore-archive-DRyTaAb5.js");
47
47
  const require_coral_accelerators = require("./coral-accelerators-BSVsBVzt.js");
48
48
  let zod = require("zod");
49
49
  let node_crypto = require("node:crypto");
@@ -28175,7 +28175,13 @@ var en_default = {
28175
28175
  "timedRunConfig.timedRun_quickRunDuration.label": "One-tap run",
28176
28176
  "section.s_timed-run.title": "One-tap run",
28177
28177
  "section.s_timed-run.description": "How long the Run button starts this device for. The hub switches it off when the time is up.",
28178
- "integration-instances.addon-not-running": "\"{{addon}}\" is not running: start it first"
28178
+ "integration-instances.addon-not-running": "\"{{addon}}\" is not running: start it first",
28179
+ "ir-transmitter.learn-unsupported": "The transmitter {{name}} cannot learn a code",
28180
+ "ir-transmitter.learn-timeout": "The transmitter {{name}} learned nothing within the time limit. Point the remote at it and try again.",
28181
+ "ir-transmitter.learn-undecodable": "The code learned by {{name}} could not be read",
28182
+ "ir-transmitter.learn-busy": "The transmitter {{name}} is already learning a code",
28183
+ "ir-transmitter.native-unsupported": "The transmitter {{name}} cannot send this kind of code",
28184
+ "ir-transmitter.no-code": "Nothing to send: give a pulse train or a native code"
28179
28185
  };
28180
28186
  //#endregion
28181
28187
  //#region src/i18n/it.json
@@ -28438,7 +28444,13 @@ var it_default = {
28438
28444
  "timedRunConfig.timedRun_quickRunDuration.label": "Avvio rapido",
28439
28445
  "section.s_timed-run.title": "Avvio rapido",
28440
28446
  "section.s_timed-run.description": "Per quanto tempo il pulsante Avvia accende questo dispositivo. L'hub lo spegne allo scadere del tempo.",
28441
- "integration-instances.addon-not-running": "\"{{addon}}\" non è in esecuzione: avvialo prima"
28447
+ "integration-instances.addon-not-running": "\"{{addon}}\" non è in esecuzione: avvialo prima",
28448
+ "ir-transmitter.learn-unsupported": "Il trasmettitore {{name}} non può apprendere un codice",
28449
+ "ir-transmitter.learn-timeout": "Il trasmettitore {{name}} non ha appreso nulla entro il tempo limite. Punta il telecomando verso di esso e riprova.",
28450
+ "ir-transmitter.learn-undecodable": "Il codice appreso da {{name}} non può essere letto",
28451
+ "ir-transmitter.learn-busy": "Il trasmettitore {{name}} sta già apprendendo un codice",
28452
+ "ir-transmitter.native-unsupported": "Il trasmettitore {{name}} non può inviare questo tipo di codice",
28453
+ "ir-transmitter.no-code": "Niente da inviare: indica un treno di impulsi o un codice nativo"
28442
28454
  };
28443
28455
  //#endregion
28444
28456
  //#region src/i18n/catalog-registry.ts