@camstack/server 1.2.813 → 1.2.814

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 (87) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +8 -9
  3. package/system/dist/{agent-https-D9QbrCJe.js → agent-https-Dwbpz4K6.js} +1 -1
  4. package/system/dist/{agent-https-D9rppK7L.mjs → agent-https-eMihTWJ4.mjs} +1 -1
  5. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  6. package/system/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  7. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  8. package/system/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  9. package/system/dist/builtins/alerts/alerts.addon.js +1 -1
  10. package/system/dist/builtins/alerts/alerts.addon.mjs +1 -1
  11. package/system/dist/builtins/autotrack/index.js +1 -1
  12. package/system/dist/builtins/autotrack/index.mjs +1 -1
  13. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  14. package/system/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  15. package/system/dist/builtins/calendars/calendars.addon.js +1 -1
  16. package/system/dist/builtins/calendars/calendars.addon.mjs +1 -1
  17. package/system/dist/builtins/camera-grid/index.js +1 -1
  18. package/system/dist/builtins/camera-grid/index.mjs +1 -1
  19. package/system/dist/builtins/composer/composer.addon.js +3 -3
  20. package/system/dist/builtins/composer/composer.addon.mjs +3 -3
  21. package/system/dist/builtins/console-logging/index.js +1 -1
  22. package/system/dist/builtins/console-logging/index.mjs +1 -1
  23. package/system/dist/builtins/core-blocks/core-blocks.addon.js +126 -9
  24. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +126 -9
  25. package/system/dist/builtins/core-blocks/remote-service.d.ts +3 -0
  26. package/system/dist/builtins/core-blocks/timed-run/timed-run-service.d.ts +7 -0
  27. package/system/dist/builtins/device-history/device-history.addon.js +2 -2
  28. package/system/dist/builtins/device-history/device-history.addon.mjs +2 -2
  29. package/system/dist/builtins/device-manager/device-manager.addon.js +1 -1
  30. package/system/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  31. package/system/dist/builtins/hub-forwarder/index.js +1 -1
  32. package/system/dist/builtins/hub-forwarder/index.mjs +1 -1
  33. package/system/dist/builtins/keychain/index.js +4 -4
  34. package/system/dist/builtins/keychain/index.mjs +4 -4
  35. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  36. package/system/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  37. package/system/dist/builtins/local-auth/local-auth.addon.js +2 -2
  38. package/system/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  39. package/system/dist/builtins/local-network/local-network.addon.js +2 -2
  40. package/system/dist/builtins/local-network/local-network.addon.mjs +2 -2
  41. package/system/dist/builtins/loki-logging/index.js +1 -1
  42. package/system/dist/builtins/loki-logging/index.mjs +1 -1
  43. package/system/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  44. package/system/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  45. package/system/dist/builtins/platform-probe/index.js +1 -1
  46. package/system/dist/builtins/platform-probe/index.mjs +1 -1
  47. package/system/dist/builtins/record-entries/index.js +1 -1
  48. package/system/dist/builtins/record-entries/index.mjs +1 -1
  49. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  50. package/system/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  51. package/system/dist/builtins/snapshot/index.js +1 -1
  52. package/system/dist/builtins/snapshot/index.mjs +1 -1
  53. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  54. package/system/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  55. package/system/dist/builtins/sqlite-storage/index.js +1 -1
  56. package/system/dist/builtins/sqlite-storage/index.mjs +1 -1
  57. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.js +3 -3
  58. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +3 -3
  59. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  60. package/system/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  61. package/system/dist/builtins/system-config/system-config.addon.js +3 -3
  62. package/system/dist/builtins/system-config/system-config.addon.mjs +3 -3
  63. package/system/dist/builtins/winston-logging/index.js +1 -1
  64. package/system/dist/builtins/winston-logging/index.mjs +1 -1
  65. package/system/dist/{capture-engine-BI6Z09IS.mjs → capture-engine-CYPDOIF6.mjs} +1 -1
  66. package/system/dist/{capture-engine-Ba49uIhh.js → capture-engine-uxR5sOQN.js} +1 -1
  67. package/system/dist/{composition-sources-BYhi_QpF.mjs → composition-sources-CU3p3INI.mjs} +1 -1
  68. package/system/dist/{composition-sources-zbe-WMDR.js → composition-sources-DkvntZci.js} +1 -1
  69. package/system/dist/{constants-Cz0UABmc.js → constants-BP-Txn_J.js} +1 -1
  70. package/system/dist/{constants-ZS2PeV26.mjs → constants-DMFJ6Fky.mjs} +1 -1
  71. package/system/dist/{device-ca-BR52z--E.js → device-ca-D-0zxmFi.js} +1 -1
  72. package/system/dist/{device-ca-B0vxd075.mjs → device-ca-tmcd_VBC.mjs} +1 -1
  73. package/system/dist/{dist-Cjomt5bM.js → dist-CznnwtQ8.js} +230 -48
  74. package/system/dist/{dist-fY4FYIt2.mjs → dist-DmCVWvtK.mjs} +219 -43
  75. package/system/dist/file-host-worker.js +1 -1
  76. package/system/dist/file-host-worker.mjs +1 -1
  77. package/system/dist/{hub-mdns-ciao-CYUWFhn7.mjs → hub-mdns-ciao-DbwyiHD5.mjs} +2 -2
  78. package/system/dist/{hub-mdns-ciao-BIyx3H2u.js → hub-mdns-ciao-FTf16-JR.js} +2 -2
  79. package/system/dist/index.js +8 -8
  80. package/system/dist/index.mjs +8 -8
  81. package/system/dist/{legacy-integration-rows-door-is18rCsc.mjs → legacy-integration-rows-door-CASQgifG.mjs} +1 -1
  82. package/system/dist/{legacy-integration-rows-door-CoUG5oxu.js → legacy-integration-rows-door-gW0xpMJI.js} +1 -1
  83. package/system/dist/{restore-archive-ScKSg4cI.js → restore-archive-B9TEFWRE.js} +1 -1
  84. package/system/dist/{restore-archive-Ce8tTRv4.mjs → restore-archive-DlaC_gyl.mjs} +1 -1
  85. package/system/dist/{wal-maintenance-gY_QtcBe.mjs → wal-maintenance-Cn164tp0.mjs} +0 -0
  86. package/system/dist/{wal-maintenance-oyAWwOGI.js → wal-maintenance-Da2Rozz6.js} +0 -0
  87. package/system/package.json +1 -1
@@ -1,9 +1,9 @@
1
- import { As as TransactRefusedError, Bi as orderMigrations, Ca as resolveRunnerId, Cs as RecordKindDeclarationSchema, Ct as MIGRATION_API_V1_METHODS, Di as migrationsCapability, Ec as normalizeSecretOwner, F as DATABASE_SNAPSHOT_TIMEOUT_MS, I as DATA_STORE_DATABASES, Jc as errMsg$1, Ln as catalogueIssues, Ms as UnknownRecordKindError, N as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, Ot as MigrationMetaSchema, P as DATABASE_SNAPSHOT_SUFFIX, Qo as BaseAddon, Ua as storageAdminCapability, Ws as collectSecretMarkerRefs, Xc as EventCategory, Ys as customAction, Zs as defineCustomActions, aa as recordsCapability, ar as databaseSnapshotCapability, gs as RECORD_SWEEP_INTERVAL_MS, ir as dataStoreProviderCapability, is as DeclarationRefusedError, ls as InvalidRecordError, po as vectorStoreCapability, us as NoCallerError, wn as bareAddonId, ys as RUNTIME_DEFAULTS } from "../../dist-fY4FYIt2.mjs";
1
+ import { $o as BaseAddon, Ca as resolveRunnerId, Cn as bareAddonId, Ct as MIGRATION_API_V1_METHODS, Dc as normalizeSecretOwner, Ei as migrationsCapability, F as DATABASE_SNAPSHOT_TIMEOUT_MS, Gs as collectSecretMarkerRefs, I as DATA_STORE_DATABASES, In as catalogueIssues, N as DATABASE_SNAPSHOT_PARTIAL_SUFFIX, Ns as UnknownRecordKindError, Ot as MigrationMetaSchema, P as DATABASE_SNAPSHOT_SUFFIX, Qs as defineCustomActions, Ua as storageAdminCapability, Xs as customAction, Yc as errMsg$1, Zc as EventCategory, _s as RECORD_SWEEP_INTERVAL_MS, aa as recordsCapability, as as DeclarationRefusedError, bs as RUNTIME_DEFAULTS, ds as NoCallerError, ir as databaseSnapshotCapability, js as TransactRefusedError, mo as vectorStoreCapability, rr as dataStoreProviderCapability, us as InvalidRecordError, ws as RecordKindDeclarationSchema, zi as orderMigrations } from "../../dist-DmCVWvtK.mjs";
2
2
  import { r as retiredKeyStoreOf, t as purgeRetiredSettingsKeys } from "../../retired-settings-keys-u6xQA6r7.mjs";
3
- import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-gY_QtcBe.mjs";
3
+ import { A as callRecords, D as RecordsEngine, E as databaseOfStore, M as controlTargetOf, O as callControl, T as trustResult, _ as rehydrateError, a as WalMaintenance, b as collectTransferables, c as vectorProviderOfOwnedFile, d as callMigrate, f as migrateTargetOf, g as DuplicatePlacementError, h as DatabaseBusyError, j as callVector, k as callData, l as SqliteSettingsBackend, m as CrossDatabaseTransactError, o as createVectorIndex, p as CollectionPlacementError, s as vectorProviderOf, u as HUB_MIGRATIONS, x as isFileHostMessage } from "../../wal-maintenance-Cn164tp0.mjs";
4
4
  import { r as isSnapshotWorkerMessage } from "../../sqlite-snapshot-protocol-2QaTouWV.mjs";
5
5
  import { a as isWorkerMessage, t as WAL_CHECKPOINT_LARGE_PASS_FRAMES } from "../../wal-checkpoint-policy-BahrTtyD.mjs";
6
- import { a as patchLegacyIntegrationRows, i as legacyIntegrationAddonId, n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows, r as deleteLegacyIntegrationRowKeys } from "../../legacy-integration-rows-door-is18rCsc.mjs";
6
+ import { a as patchLegacyIntegrationRows, i as legacyIntegrationAddonId, n as clearLegacyIntegrationRows, o as readLegacyIntegrationRows, r as deleteLegacyIntegrationRowKeys } from "../../legacy-integration-rows-door-CASQgifG.mjs";
7
7
  import { createRequire } from "node:module";
8
8
  import { z } from "zod";
9
9
  import { randomUUID } from "node:crypto";
@@ -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-Cjomt5bM.js");
6
+ const require_dist = require("../../dist-CznnwtQ8.js");
7
7
  const require_read_all_rows$1 = require("../../read-all-rows-CVoO1ONM.js");
8
8
  let zod = require("zod");
9
9
  let node_crypto = require("node:crypto");
@@ -1,4 +1,4 @@
1
- import { $s as defineRecordKinds, Bc as toSecretFieldView, Br as gbToBytes, Dr as evictionPolicyOfLocation, Ga as storageMigrationCapability, Gr as integrationInstancesCapability, Hs as collectSecretConfigKeys, Jt as STORAGE_LOCATION_MODES, Na as settingsStoreCapability, Nc as resolveSecretMarkers, Oi as modeForSwitch, Qa as switchStateOfMode, Qo as BaseAddon, Tc as normalizeNodeId, Vs as buildSecretRef, Wa as storageCapability, Xc as EventCategory, Xs as defineAddonMigrations, Ys as customAction, Zs as defineCustomActions, _c as isSecretFieldView, _s as REDACTED_SECRET, bi as mayReadLocation, gc as isSecretClear, go as withLocationMode, in as StorageMigrationJobSchema, jc as recordSecretRef, kc as parseSecretRef, ki as modeMayWrite, ni as isLocationEnabled, nn as StorageLocationModeSchema, rn as StorageLocationTypeSchema, tn as StorageCleanupJobSchema, ui as legacyModeOf, va as resolveLocationMode, vc as isSecretMarker, xc as makeSecretMarker, xi as mayWriteToLocation, xt as LegacyStorageLocationDefaultSchema } from "../../dist-fY4FYIt2.mjs";
1
+ import { $o as BaseAddon, Ac as parseSecretRef, Di as modeForSwitch, Ec as normalizeNodeId, Er as evictionPolicyOfLocation, Ga as storageMigrationCapability, Hs as buildSecretRef, Mc as recordSecretRef, Na as settingsStoreCapability, Oi as modeMayWrite, Pc as resolveSecretMarkers, Qa as switchStateOfMode, Qs as defineCustomActions, Sc as makeSecretMarker, Us as collectSecretConfigKeys, Vc as toSecretFieldView, Wa as storageCapability, Wr as integrationInstancesCapability, Xs as customAction, Zc as EventCategory, Zs as defineAddonMigrations, _c as isSecretClear, _o as withLocationMode, bi as mayWriteToLocation, ec as defineRecordKinds, en as StorageCleanupJobSchema, li as legacyModeOf, nn as StorageLocationTypeSchema, qt as STORAGE_LOCATION_MODES, rn as StorageMigrationJobSchema, ti as isLocationEnabled, tn as StorageLocationModeSchema, va as resolveLocationMode, vc as isSecretFieldView, vs as REDACTED_SECRET, xt as LegacyStorageLocationDefaultSchema, yc as isSecretMarker, yi as mayReadLocation, zr as gbToBytes } from "../../dist-DmCVWvtK.mjs";
2
2
  import { t as require_read_all_rows } from "../../read-all-rows-TaPqdWNF.mjs";
3
3
  import { z } from "zod";
4
4
  import { randomUUID } from "node:crypto";
@@ -3,11 +3,11 @@ 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-Cjomt5bM.js");
6
+ const require_dist = require("../../dist-CznnwtQ8.js");
7
7
  const require_safe_buffer$1 = require("../../safe-buffer-D3aoa-7X.js");
8
8
  const require_x509_es = require("../../x509.es-WtnRNyYS.js");
9
- const require_agent_https = require("../../agent-https-D9QbrCJe.js");
10
- const require_constants$8 = require("../../constants-Cz0UABmc.js");
9
+ const require_agent_https = require("../../agent-https-Dwbpz4K6.js");
10
+ const require_constants$8 = require("../../constants-BP-Txn_J.js");
11
11
  const require_src$1 = require("../../src-CnAqG6EF.js");
12
12
  let zod = require("zod");
13
13
  let node_crypto = require("node:crypto");
@@ -1,9 +1,9 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM, r as __exportAll, t as __commonJSMin } from "../../chunk-CNf5ZN-e.mjs";
2
- import { $t as ServerNameSchema, Jc as errMsg, La as shortHostname, Qo as BaseAddon, Ys as customAction, Zs as defineCustomActions, cc as hydrateSchema } from "../../dist-fY4FYIt2.mjs";
2
+ import { $o as BaseAddon, La as shortHostname, Qs as defineCustomActions, Qt as ServerNameSchema, Xs as customAction, Yc as errMsg, lc as hydrateSchema } from "../../dist-DmCVWvtK.mjs";
3
3
  import { t as require_safe_buffer } from "../../safe-buffer-B1OjL1I9.mjs";
4
4
  import { C as backdatedNotBefore, S as withUtcTimeEncoding, a as KeyUsageFlags, c as Pkcs10CertificateRequest, d as SubjectKeyIdentifierExtension, f as X509Certificate$1, l as Pkcs10CertificateRequestGenerator, m as cryptoProvider, n as BasicConstraintsExtension, o as KeyUsagesExtension, p as X509CertificateGenerator, r as ExtendedKeyUsageExtension, s as PemConverter, t as AuthorityKeyIdentifierExtension } from "../../x509.es-BRiJgOvu.mjs";
5
- import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-D9rppK7L.mjs";
6
- import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-ZS2PeV26.mjs";
5
+ import { B as setProcessAgentHttpsNames, I as AGENT_HTTPS_NAMES_COLLECTION, L as AGENT_HTTPS_NAMES_COLUMNS, M as isLocalOnlyHostname, R as AgentHttpsNames, V as systemConfigRecordKinds, u as isPrivateAddress, z as getProcessAgentHttpsNames } from "../../agent-https-eMihTWJ4.mjs";
6
+ import { a as MESH_CA_KEY_REF, c as SERVER_AUTH_OID, i as MESH_CA_FIELD, n as DEFAULT_HUB_TLS_TCP_PORT, o as MESH_CA_SETTINGS_KEY, r as MESH_CA_COMMON_NAME, s as MESH_CA_VALIDITY_DAYS, t as CLIENT_AUTH_OID } from "../../constants-DMFJ6Fky.mjs";
7
7
  import { t as require_src } from "../../src-hG4grMU4.mjs";
8
8
  import { z } from "zod";
9
9
  import { X509Certificate, createHash, createPrivateKey, randomBytes, randomInt, sign, timingSafeEqual, verify, webcrypto } from "node:crypto";
@@ -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-Cjomt5bM.js");
6
+ const require_dist = require("../../dist-CznnwtQ8.js");
7
7
  const require_formatter = require("../../formatter-xbxeV4GD.js");
8
8
  const require_log_file_read_protocol = require("../../log-file-read-protocol-DSV_vQRb.js");
9
9
  let node_path = require("node:path");
@@ -1,4 +1,4 @@
1
- import { Qo as BaseAddon, Xs as defineAddonMigrations, Zi as preconditionOf, _i as logDestinationCapability } from "../../dist-fY4FYIt2.mjs";
1
+ import { $o as BaseAddon, Xi as preconditionOf, Zs as defineAddonMigrations, gi as logDestinationCapability } from "../../dist-DmCVWvtK.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-hTaAsYlX.mjs";
4
4
  import { createRequire } from "node:module";
@@ -1,4 +1,4 @@
1
- import { cs as HISTORY_DEFAULT_MIN_INTERVAL_MS, oc as historyItemFieldPath, qc as DeviceType } from "./dist-fY4FYIt2.mjs";
1
+ import { Jc as DeviceType, ls as HISTORY_DEFAULT_MIN_INTERVAL_MS, sc as historyItemFieldPath } from "./dist-DmCVWvtK.mjs";
2
2
  //#region src/builtins/device-history/store/series-registry.ts
3
3
  function subjectIdOf(subject) {
4
4
  return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-Cjomt5bM.js");
1
+ const require_dist = require("./dist-CznnwtQ8.js");
2
2
  //#region src/builtins/device-history/store/series-registry.ts
3
3
  function subjectIdOf(subject) {
4
4
  return subject.kind === "device" ? `d:${subject.deviceId}` : `n:${subject.nodeId}`;
@@ -1,4 +1,4 @@
1
- import { Jc as errMsg, Po as compositionSourceKey } from "./dist-fY4FYIt2.mjs";
1
+ import { Fo as compositionSourceKey, Yc as errMsg } from "./dist-DmCVWvtK.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
- const require_dist = require("./dist-Cjomt5bM.js");
1
+ const require_dist = require("./dist-CznnwtQ8.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,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-Cjomt5bM.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-CznnwtQ8.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -1,4 +1,4 @@
1
- import { Vs as buildSecretRef } from "./dist-fY4FYIt2.mjs";
1
+ import { Hs as buildSecretRef } from "./dist-DmCVWvtK.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,4 +1,4 @@
1
- const require_dist = require("./dist-Cjomt5bM.js");
1
+ const require_dist = require("./dist-CznnwtQ8.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
@@ -1,4 +1,4 @@
1
- import { G as DEVICE_SAN_USER_PREFIX, Vs as buildSecretRef, W as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-fY4FYIt2.mjs";
1
+ import { G as DEVICE_SAN_USER_PREFIX, Hs as buildSecretRef, W as DEVICE_SAN_CREDENTIAL_PREFIX } from "./dist-DmCVWvtK.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
@@ -803,7 +803,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
803
803
  return EventCategory;
804
804
  }({});
805
805
  //#endregion
806
- //#region ../types/dist/device-type-DxCT0krO.mjs
806
+ //#region ../types/dist/device-type-CbDhVwFP.mjs
807
807
  /**
808
808
  import { errMsg } from '@camstack/types'
809
809
  * Extract a human-readable message from an unknown error value.
@@ -972,6 +972,13 @@ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
972
972
  * (`featuresOfBoundCaps`). Gates the quick-run control in the viewer.
973
973
  */
974
974
  DeviceFeature["TimedRun"] = "timed-run";
975
+ /**
976
+ * Device binds a plain `switch` cap. Derived from the bindings
977
+ * (`featuresOfBoundCaps`) for a composed device, whose switch is bound by the
978
+ * composition and not by a driver: an appliance (a heater behind a smart
979
+ * plug) has no control of its own, so a surface reads this as its on/off.
980
+ */
981
+ DeviceFeature["Switch"] = "switch";
975
982
  /** Light supports rgb-triplet color via `color` cap. */
976
983
  DeviceFeature["LightColorRgb"] = "light-color-rgb";
977
984
  /** Light supports HSV color via `color` cap. */
@@ -1204,7 +1211,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1204
1211
  return DeviceRole;
1205
1212
  }({});
1206
1213
  //#endregion
1207
- //#region ../types/dist/sleep-t7BftoJG.mjs
1214
+ //#region ../types/dist/sleep-CqvzKIq2.mjs
1208
1215
  /**
1209
1216
  * The audio chunk plane's byte format, and the ONE expansion from a coded
1210
1217
  * window to float samples (D455).
@@ -13644,7 +13651,7 @@ function sleep(ms) {
13644
13651
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
13645
13652
  }
13646
13653
  //#endregion
13647
- //#region ../types/dist/composition-Bx0JvKUU.mjs
13654
+ //#region ../types/dist/composition-CXCX78IR.mjs
13648
13655
  var AUDIO_ENCODER_BY_CODEC = {
13649
13656
  opus: "libopus",
13650
13657
  aac: "aac",
@@ -51803,6 +51810,90 @@ var controlCapability = {
51803
51810
  */
51804
51811
  history: "none"
51805
51812
  };
51813
+ var IrCodecError = class extends Error {
51814
+ code;
51815
+ constructor(code, message) {
51816
+ super(message);
51817
+ this.name = "IrCodecError";
51818
+ this.code = code;
51819
+ }
51820
+ };
51821
+ /**
51822
+ * A pulse train in signed microseconds: mark (+) first, then space (-), strictly
51823
+ * alternating, no zeros, 2..1024 entries.
51824
+ */
51825
+ var IrTimingsSchema = zod.z.array(zod.z.number().int()).min(2).max(1024).superRefine((timings, ctx) => {
51826
+ timings.forEach((value, index) => {
51827
+ const expectMark = index % 2 === 0;
51828
+ if (value === 0 || value > 0 !== expectMark) ctx.addIssue({
51829
+ code: "custom",
51830
+ message: `timing ${index} must be a non-zero ${expectMark ? "mark (positive)" : "space (negative)"}`,
51831
+ path: [index]
51832
+ });
51833
+ });
51834
+ });
51835
+ /** Per-command transmit options. Every key is optional; a transmitter applies what it can. */
51836
+ var TransmitSettingsSchema = zod.z.object({
51837
+ carrierHz: zod.z.number().int().positive().optional(),
51838
+ dutyCyclePercent: zod.z.number().int().min(1).max(100).optional(),
51839
+ repeat: zod.z.number().int().min(0).max(20).optional(),
51840
+ repeatDelayMs: zod.z.number().int().min(0).optional()
51841
+ });
51842
+ /** One Pronto frequency-word unit, in microseconds, per unit of the word. */
51843
+ var PRONTO_CLOCK_US = .241246;
51844
+ var LEARNED_FORM = 0;
51845
+ /**
51846
+ * Decode a learned (0000 form) Pronto hex string. The intro burst is followed by
51847
+ * the repeat burst once; a different form is refused with `pronto-unsupported-form`.
51848
+ */
51849
+ function decodePronto(code) {
51850
+ const words = code.trim().split(/\s+/).filter((w) => w.length > 0);
51851
+ if (words.length < 4) throw new IrCodecError("pronto-malformed", `Pronto code needs at least 4 words, got ${words.length}`);
51852
+ const values = words.map((w) => /^[0-9a-fA-F]{1,4}$/.test(w) ? parseInt(w, 16) : NaN);
51853
+ if (values.some((v) => Number.isNaN(v))) throw new IrCodecError("pronto-malformed", "Pronto code must be 4-digit hexadecimal words");
51854
+ const [form, freqWord, introCount, repeatCount] = values;
51855
+ if (form === void 0 || freqWord === void 0 || introCount === void 0 || repeatCount === void 0) throw new IrCodecError("pronto-malformed", "Pronto header incomplete");
51856
+ if (form !== LEARNED_FORM) throw new IrCodecError("pronto-unsupported-form", `Pronto form ${words[0] ?? ""} is not supported, only the learned 0000 form`);
51857
+ if (freqWord === 0) throw new IrCodecError("pronto-malformed", "Pronto frequency word is zero");
51858
+ const pairs = introCount + repeatCount;
51859
+ if (pairs === 0 || values.length !== 4 + pairs * 2) throw new IrCodecError("pronto-malformed", `Pronto declares ${pairs} burst pairs but carries ${(values.length - 4) / 2} word pairs`);
51860
+ const unitUs = freqWord * PRONTO_CLOCK_US;
51861
+ const timings = values.slice(4).map((count, index) => {
51862
+ const us = Math.max(1, Math.round(count * unitUs));
51863
+ return index % 2 === 0 ? us : -us;
51864
+ });
51865
+ const checked = IrTimingsSchema.safeParse(timings);
51866
+ if (!checked.success) throw new IrCodecError("invalid-timings", `Pronto decoded to invalid timings: ${checked.error.message}`);
51867
+ return {
51868
+ timings: checked.data,
51869
+ carrierHz: Math.round(1e6 / unitUs)
51870
+ };
51871
+ }
51872
+ /** What a remote command stores: a raw pulse train, or a learned Pronto code. */
51873
+ var IrPayloadSchema = zod.z.discriminatedUnion("kind", [zod.z.object({
51874
+ kind: zod.z.literal("raw"),
51875
+ timings: zod.z.array(zod.z.number().int()),
51876
+ settings: TransmitSettingsSchema.optional()
51877
+ }), zod.z.object({
51878
+ kind: zod.z.literal("pronto"),
51879
+ code: zod.z.string()
51880
+ })]);
51881
+ /** Resolve a payload to what `ir-transmitter.send` takes. Throws `IrCodecError`. */
51882
+ function toTimings(payload) {
51883
+ if (payload.kind === "pronto") {
51884
+ const decoded = decodePronto(payload.code);
51885
+ return {
51886
+ timings: decoded.timings,
51887
+ settings: { carrierHz: decoded.carrierHz }
51888
+ };
51889
+ }
51890
+ const checked = IrTimingsSchema.safeParse(payload.timings);
51891
+ if (!checked.success) throw new IrCodecError("invalid-timings", checked.error.message);
51892
+ return {
51893
+ timings: checked.data,
51894
+ settings: payload.settings ?? {}
51895
+ };
51896
+ }
51806
51897
  /**
51807
51898
  * The role vocabulary of a remote (D963): what a button MEANS, independent of
51808
51899
  * how it is wired. A layout template places buttons by role; a device binds a
@@ -51890,11 +51981,18 @@ var RemoteRoleSchema = zod.z.string().refine(isRemoteRole, { message: "a role is
51890
51981
  * a voice command or `playMedia` names.
51891
51982
  * - `sequence`: a name and explicit steps — bound roles pressed in order
51892
51983
  * (an input key, a menu macro such as `source, down, down, ok`).
51984
+ * - `ir`: a name and one infrared code of its own (raw timings or a Pronto
51985
+ * string), sent through a named transmitter (planning#464). It presses no
51986
+ * button: a source the remote's layout has no key for.
51893
51987
  *
51894
51988
  * The name and the number resolve to the SAME declared source. A number no
51895
51989
  * `digits` source declares is not a channel: it is refused, never guessed.
51896
51990
  */
51897
- var REMOTE_SOURCE_KINDS = ["digits", "sequence"];
51991
+ var REMOTE_SOURCE_KINDS = [
51992
+ "digits",
51993
+ "sequence",
51994
+ "ir"
51995
+ ];
51898
51996
  zod.z.enum(REMOTE_SOURCE_KINDS);
51899
51997
  var REMOTE_SOURCE_ID_RE = /^[a-z0-9][a-z0-9_-]{0,47}$/;
51900
51998
  var CHANNEL_NUMBER_RE = new RegExp(`^[0-9]{1,6}$`);
@@ -51914,11 +52012,43 @@ var RemoteSequenceSourceSchema = zod.z.object({
51914
52012
  kind: zod.z.literal("sequence"),
51915
52013
  steps: zod.z.array(RemoteRoleSchema).min(1).max(16)
51916
52014
  });
51917
- var RemoteSourceSchema = zod.z.discriminatedUnion("kind", [RemoteDigitsSourceSchema, RemoteSequenceSourceSchema]);
52015
+ var RemoteIrSourceSchema = zod.z.object({
52016
+ ...sourceBase,
52017
+ kind: zod.z.literal("ir"),
52018
+ /** The `ir-transmitter` device the code is sent through. */
52019
+ transmitterId: zod.z.number().int().nonnegative(),
52020
+ /** The code itself; whether a transmitter could send it is `irSourceProblem`. */
52021
+ payload: IrPayloadSchema
52022
+ });
52023
+ var RemoteSourceSchema = zod.z.discriminatedUnion("kind", [
52024
+ RemoteDigitsSourceSchema,
52025
+ RemoteSequenceSourceSchema,
52026
+ RemoteIrSourceSchema
52027
+ ]);
51918
52028
  var REMOTE_STEP_DELAY_MAX_MS = 3e3;
51919
- /** The roles a source presses, in order. A `digits` number is its digit roles. */
52029
+ /**
52030
+ * The roles a source presses, in order. A `digits` number is its digit roles;
52031
+ * an `ir` source presses none — it carries its own code.
52032
+ */
51920
52033
  function remoteSourceSteps(source) {
51921
- return source.kind === "sequence" ? source.steps : Array.from(source.number, (digit) => `digit_${digit}`);
52034
+ switch (source.kind) {
52035
+ case "sequence": return source.steps;
52036
+ case "digits": return Array.from(source.number, (digit) => `digit_${digit}`);
52037
+ case "ir": return [];
52038
+ }
52039
+ }
52040
+ /**
52041
+ * Why an `ir` source's code could not be sent (the codec's own words), or null
52042
+ * when it resolves to a pulse train. The schema refuses on it; the editor shows it.
52043
+ */
52044
+ function irSourceProblem(source) {
52045
+ try {
52046
+ toTimings(source.payload);
52047
+ return null;
52048
+ } catch (err) {
52049
+ if (err instanceof IrCodecError) return err.message;
52050
+ throw err;
52051
+ }
51922
52052
  }
51923
52053
  function same(a, b) {
51924
52054
  return a.trim().toLowerCase() === b.trim().toLowerCase();
@@ -52720,7 +52850,8 @@ var CAP_CUSTOMIZE_CATALOG = {
52720
52850
  kind: "constant",
52721
52851
  path: "offSeconds",
52722
52852
  value: 10,
52723
- when: "add"
52853
+ when: "add",
52854
+ formerValues: [0]
52724
52855
  }, {
52725
52856
  kind: "clock",
52726
52857
  path: "lastFetchedAt",
@@ -62778,8 +62909,9 @@ var heatingValveCapability = {
62778
62909
  *
62779
62910
  * "Heat for 30 minutes", "run the fountain pump for 2 minutes": the device has
62780
62911
  * no timer of its own, so the hub keeps one. `runFor` turns the device on and
62781
- * records a deadline; `cancel` (or the device being switched off by hand)
62782
- * forgets it; at the deadline the hub issues the off once.
62912
+ * records a deadline; `cancel` switches the device off and forgets the deadline,
62913
+ * and the device being switched off by hand just forgets it; at the deadline
62914
+ * the hub issues the off once.
62783
62915
  *
62784
62916
  * The deadline is DURABLE: it is a row in the records store, so a hub restart
62785
62917
  * neither loses a pending off nor leaves the device running past its time. At
@@ -62910,7 +63042,7 @@ var timedRunCapability = {
62910
63042
  kind: "mutation",
62911
63043
  auth: "protected"
62912
63044
  }),
62913
- /** Forget the pending off. The device is left as it is. */
63045
+ /** Stop the run: switch the device off (once) and forget the pending off. Nothing armed: nothing is sent. */
62914
63046
  cancel: method(zod.z.object({ deviceId: zod.z.number().int() }), zod.z.void(), {
62915
63047
  kind: "mutation",
62916
63048
  auth: "protected"
@@ -64516,27 +64648,6 @@ var intercomCapability = {
64516
64648
  */
64517
64649
  history: "none"
64518
64650
  };
64519
- /**
64520
- * A pulse train in signed microseconds: mark (+) first, then space (-), strictly
64521
- * alternating, no zeros, 2..1024 entries.
64522
- */
64523
- var IrTimingsSchema = zod.z.array(zod.z.number().int()).min(2).max(1024).superRefine((timings, ctx) => {
64524
- timings.forEach((value, index) => {
64525
- const expectMark = index % 2 === 0;
64526
- if (value === 0 || value > 0 !== expectMark) ctx.addIssue({
64527
- code: "custom",
64528
- message: `timing ${index} must be a non-zero ${expectMark ? "mark (positive)" : "space (negative)"}`,
64529
- path: [index]
64530
- });
64531
- });
64532
- });
64533
- /** Per-command transmit options. Every key is optional; a transmitter applies what it can. */
64534
- var TransmitSettingsSchema = zod.z.object({
64535
- carrierHz: zod.z.number().int().positive().optional(),
64536
- dutyCyclePercent: zod.z.number().int().min(1).max(100).optional(),
64537
- repeat: zod.z.number().int().min(0).max(20).optional(),
64538
- repeatDelayMs: zod.z.number().int().min(0).optional()
64539
- });
64540
64651
  /** The setting keys a transmitter may declare as settable (`getInfo.settable`). */
64541
64652
  var TransmitSettingKeySchema = zod.z.enum([
64542
64653
  "carrierHz",
@@ -82709,7 +82820,8 @@ var powerSourceCustomize = {
82709
82820
  kind: "constant",
82710
82821
  path: "offSeconds",
82711
82822
  value: 10,
82712
- when: "add"
82823
+ when: "add",
82824
+ formerValues: [0]
82713
82825
  }, {
82714
82826
  kind: "clock",
82715
82827
  path: "lastFetchedAt",
@@ -86428,6 +86540,10 @@ function refineSources(config, ctx) {
86428
86540
  if (numbers.has(source.number)) fail(`channel ${source.number} is declared twice`, "number");
86429
86541
  numbers.add(source.number);
86430
86542
  }
86543
+ if (source.kind === "ir") {
86544
+ const problem = irSourceProblem(source);
86545
+ if (problem !== null) fail(problem, "payload");
86546
+ }
86431
86547
  for (const role of remoteSourceSteps(source)) if (isRemoteWidgetRole(role)) fail(`"${source.name}" presses ${role}, a layout widget, not a command`, "steps");
86432
86548
  else if (config.bindings[role] === void 0) fail(`"${source.name}" presses ${role}, which is not bound`, "steps");
86433
86549
  });
@@ -86449,6 +86565,14 @@ function refineSources(config, ctx) {
86449
86565
  }
86450
86566
  });
86451
86567
  }
86568
+ /** A stored source that was left out of a read, and why (the UI shows it). */
86569
+ var RemoteRefusedSourceSchema = zod.z.object({
86570
+ /** Position in the stored list. */
86571
+ index: zod.z.number().int().nonnegative(),
86572
+ id: zod.z.string().nullable(),
86573
+ name: zod.z.string().nullable(),
86574
+ reason: zod.z.string()
86575
+ });
86452
86576
  var RemoteConfigSchema = zod.z.object({
86453
86577
  layoutTemplateId: zod.z.string().min(1).nullable(),
86454
86578
  /**
@@ -86466,7 +86590,13 @@ var RemoteConfigSchema = zod.z.object({
86466
86590
  sources: zod.z.array(RemoteSourceSchema).max(200).default([]),
86467
86591
  /** The pause between two steps of a source: the television's receiver, not a repeat. */
86468
86592
  stepDelayMs: zod.z.number().int().min(100).max(REMOTE_STEP_DELAY_MAX_MS).default(500),
86469
- power: zod.z.object({ mode: RemotePowerModeSchema })
86593
+ power: zod.z.object({ mode: RemotePowerModeSchema }),
86594
+ /**
86595
+ * READ-ONLY: sources a stored configuration carries that no longer parse,
86596
+ * left out of `sources` with the reason (`readStoredRemoteConfig`). Never
86597
+ * stored: the store strips it on write.
86598
+ */
86599
+ refusedSources: zod.z.array(RemoteRefusedSourceSchema).optional()
86470
86600
  }).superRefine((config, ctx) => {
86471
86601
  const roles = Object.keys(config.bindings);
86472
86602
  if (roles.length > 200) ctx.addIssue({
@@ -86507,6 +86637,60 @@ var RemoteConfigSchema = zod.z.object({
86507
86637
  }
86508
86638
  refineSources(config, ctx);
86509
86639
  });
86640
+ var StoredSourcesShapeSchema = zod.z.looseObject({ sources: zod.z.array(zod.z.unknown()) });
86641
+ var SourceIdentitySchema = zod.z.object({
86642
+ id: zod.z.string(),
86643
+ name: zod.z.string()
86644
+ }).partial();
86645
+ /**
86646
+ * Read a STORED configuration. A single source that no longer parses (a code
86647
+ * the transmitter could not send, a malformed entry) must not make the whole
86648
+ * remote unreadable: it is left out and named in `refusedSources`, and the other
86649
+ * sources and the bindings load. Writing stays strict (`RemoteConfigSchema`).
86650
+ */
86651
+ function readStoredRemoteConfig(raw) {
86652
+ const shape = StoredSourcesShapeSchema.safeParse(raw);
86653
+ if (!shape.success) return finishRead(RemoteConfigSchema.safeParse(raw));
86654
+ const kept = [];
86655
+ const refused = [];
86656
+ shape.data.sources.forEach((candidate, index) => {
86657
+ const parsed = RemoteSourceSchema.safeParse(candidate);
86658
+ const problem = parsed.success && parsed.data.kind === "ir" ? irSourceProblem(parsed.data) : null;
86659
+ if (parsed.success && problem === null) {
86660
+ kept.push(candidate);
86661
+ return;
86662
+ }
86663
+ const identity = SourceIdentitySchema.safeParse(candidate);
86664
+ const reason = problem ?? parsed.error?.issues[0]?.message ?? "not a source";
86665
+ refused.push({
86666
+ index,
86667
+ id: identity.success ? identity.data.id ?? null : null,
86668
+ name: identity.success ? identity.data.name ?? null : null,
86669
+ reason
86670
+ });
86671
+ });
86672
+ const read = finishRead(RemoteConfigSchema.safeParse({
86673
+ ...shape.data,
86674
+ sources: kept
86675
+ }));
86676
+ if (!read.success || refused.length === 0) return read;
86677
+ return {
86678
+ success: true,
86679
+ data: {
86680
+ ...read.data,
86681
+ refusedSources: refused
86682
+ }
86683
+ };
86684
+ }
86685
+ function finishRead(parsed) {
86686
+ return parsed.success ? {
86687
+ success: true,
86688
+ data: parsed.data
86689
+ } : {
86690
+ success: false,
86691
+ issues: parsed.error.issues.length
86692
+ };
86693
+ }
86510
86694
  var EMPTY_REMOTE_CONFIG = {
86511
86695
  layoutTemplateId: null,
86512
86696
  defaultTransmitterId: null,
@@ -94644,14 +94828,6 @@ var BUILTIN_REMOTE_COMPONENTS = [
94644
94828
  buttons: []
94645
94829
  }
94646
94830
  ];
94647
- zod.z.discriminatedUnion("kind", [zod.z.object({
94648
- kind: zod.z.literal("raw"),
94649
- timings: zod.z.array(zod.z.number().int()),
94650
- settings: TransmitSettingsSchema.optional()
94651
- }), zod.z.object({
94652
- kind: zod.z.literal("pronto"),
94653
- code: zod.z.string()
94654
- })]);
94655
94831
  /**
94656
94832
  * Propose a running threshold from a device's own power history (planning#405).
94657
94833
  *
@@ -115038,12 +115214,6 @@ Object.defineProperty(exports, "RemoteAssumedStateSchema", {
115038
115214
  return RemoteAssumedStateSchema;
115039
115215
  }
115040
115216
  });
115041
- Object.defineProperty(exports, "RemoteConfigSchema", {
115042
- enumerable: true,
115043
- get: function() {
115044
- return RemoteConfigSchema;
115045
- }
115046
- });
115047
115217
  Object.defineProperty(exports, "RevConflictError", {
115048
115218
  enumerable: true,
115049
115219
  get: function() {
@@ -116574,6 +116744,12 @@ Object.defineProperty(exports, "ptzAutotrackCapability", {
116574
116744
  return ptzAutotrackCapability;
116575
116745
  }
116576
116746
  });
116747
+ Object.defineProperty(exports, "readStoredRemoteConfig", {
116748
+ enumerable: true,
116749
+ get: function() {
116750
+ return readStoredRemoteConfig;
116751
+ }
116752
+ });
116577
116753
  Object.defineProperty(exports, "readinessKey", {
116578
116754
  enumerable: true,
116579
116755
  get: function() {
@@ -116982,6 +117158,12 @@ Object.defineProperty(exports, "toSecretFieldView", {
116982
117158
  return toSecretFieldView;
116983
117159
  }
116984
117160
  });
117161
+ Object.defineProperty(exports, "toTimings", {
117162
+ enumerable: true,
117163
+ get: function() {
117164
+ return toTimings;
117165
+ }
117166
+ });
116985
117167
  Object.defineProperty(exports, "transformSecretWrite", {
116986
117168
  enumerable: true,
116987
117169
  get: function() {