@camstack/server 1.2.749 → 1.2.750

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 (85) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/package.json +10 -7
  3. package/system/dist/{agent-https-XIAiPgNs.mjs → agent-https-DoGV9jKg.mjs} +1 -1
  4. package/system/dist/{agent-https-DsAdFC8n.js → agent-https-Oc0Go3Gs.js} +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 +258 -2
  24. package/system/dist/builtins/core-blocks/core-blocks.addon.mjs +258 -2
  25. package/system/dist/builtins/core-blocks/migrations/helper-to-customize.d.ts +35 -0
  26. package/system/dist/builtins/core-blocks/migrations/index.d.ts +1 -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 +3 -3
  34. package/system/dist/builtins/keychain/index.mjs +3 -3
  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 +2 -2
  58. package/system/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  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 +284 -284
  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/{composition-sources-DUF2KY-Q.js → composition-sources-Bxahhz4f.js} +1 -1
  66. package/system/dist/{composition-sources-DKJiErim.mjs → composition-sources-CzRiSzCV.mjs} +1 -1
  67. package/system/dist/{constants-Smr-sgQk.js → constants-0rC5QY6i.js} +1 -1
  68. package/system/dist/{constants-D3cOCDWZ.mjs → constants-uI6uXyjP.mjs} +1 -1
  69. package/system/dist/{device-ca-qPLV2_YM.js → device-ca-CL_Arugd.js} +1 -1
  70. package/system/dist/{device-ca-Bjql3lRF.mjs → device-ca-D7TyMlsS.mjs} +1 -1
  71. package/system/dist/{dist-CrwALoYk.js → dist-CYnRCUzN.js} +262 -2
  72. package/system/dist/{dist-BFiMX6mZ.mjs → dist-Iq3vrBOE.mjs} +251 -3
  73. package/system/dist/file-host-worker.js +1 -1
  74. package/system/dist/file-host-worker.mjs +1 -1
  75. package/system/dist/{hub-mdns-ciao-DBYj4N_8.js → hub-mdns-ciao-CNLYSVyJ.js} +2 -2
  76. package/system/dist/{hub-mdns-ciao-B6JK5wYQ.mjs → hub-mdns-ciao-CvMKderb.mjs} +2 -2
  77. package/system/dist/index.js +7 -7
  78. package/system/dist/index.mjs +7 -7
  79. package/system/dist/{restore-archive-DKZiYRbs.js → restore-archive-Dw04PiG5.js} +1 -1
  80. package/system/dist/{restore-archive-HEmBtC17.mjs → restore-archive-vzWYLf6p.mjs} +82 -82
  81. package/system/dist/{retention-CDhx9ofQ.mjs → retention-C-lijsmN.mjs} +1 -1
  82. package/system/dist/{retention-DUTatu4f.js → retention-WjI-Op7G.js} +1 -1
  83. package/system/dist/{wal-maintenance-C59YCSjx.mjs → wal-maintenance-BzTHorT2.mjs} +0 -0
  84. package/system/dist/{wal-maintenance-BlfNMW7r.js → wal-maintenance-DQXiTaph.js} +0 -0
  85. 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-CrwALoYk.js");
6
+ const require_dist = require("../../dist-CYnRCUzN.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 { ti as logDestinationCapability, vo as BaseAddon } from "../../dist-BFiMX6mZ.mjs";
1
+ import { bo as BaseAddon, ni as logDestinationCapability } from "../../dist-Iq3vrBOE.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-CrwALoYk.js");
1
+ const require_dist = require("./dist-CYnRCUzN.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 { ic as errMsg, to as compositionSourceKey } from "./dist-BFiMX6mZ.mjs";
1
+ import { oc as errMsg, ro as compositionSourceKey } from "./dist-Iq3vrBOE.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,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-CrwALoYk.js").buildSecretRef({
2
+ var MESH_CA_KEY_REF = require("./dist-CYnRCUzN.js").buildSecretRef({
3
3
  owner: "system",
4
4
  scope: { kind: "global" },
5
5
  fieldPath: "meshCaKey"
@@ -1,4 +1,4 @@
1
- import { rs as buildSecretRef } from "./dist-BFiMX6mZ.mjs";
1
+ import { as as buildSecretRef } from "./dist-Iq3vrBOE.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-CrwALoYk.js");
1
+ const require_dist = require("./dist-CYnRCUzN.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 { H as DEVICE_SAN_CREDENTIAL_PREFIX, U as DEVICE_SAN_USER_PREFIX, rs as buildSecretRef } from "./dist-BFiMX6mZ.mjs";
1
+ import { H as DEVICE_SAN_CREDENTIAL_PREFIX, U as DEVICE_SAN_USER_PREFIX, as as buildSecretRef } from "./dist-Iq3vrBOE.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
@@ -8205,7 +8205,7 @@ function sleep(ms) {
8205
8205
  return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
8206
8206
  }
8207
8207
  //#endregion
8208
- //#region ../types/dist/composition-BodkvOV0.mjs
8208
+ //#region ../types/dist/composition-CD1GdFuv.mjs
8209
8209
  var AUDIO_ENCODER_BY_CODEC = {
8210
8210
  opus: "libopus",
8211
8211
  aac: "aac",
@@ -10795,7 +10795,7 @@ var CompositionExistingTargetSchema = zod.z.object({
10795
10795
  var CompositionTargetSchema = zod.z.discriminatedUnion("kind", [CompositionNewTargetSchema, CompositionExistingTargetSchema]);
10796
10796
  var CompositionSchema = zod.z.object({
10797
10797
  target: CompositionTargetSchema,
10798
- features: zod.z.array(CompositionFeatureSchema).min(1).max(16),
10798
+ features: zod.z.array(CompositionFeatureSchema).min(0).max(16),
10799
10799
  /**
10800
10800
  * Present when the block is a helper template. Absent on a free
10801
10801
  * composition (the room example, device 4603). The editor reads this,
@@ -52993,12 +52993,34 @@ function unsignedToken(value) {
52993
52993
  function signedToken(value) {
52994
52994
  return token(value, SIGNED);
52995
52995
  }
52996
+ function constantExpr(value) {
52997
+ if (typeof value === "string") return JSON.stringify(value);
52998
+ if (typeof value === "number") return signedToken(value);
52999
+ if (typeof value === "boolean") return value ? "true" : "false";
53000
+ return "null";
53001
+ }
53002
+ /**
53003
+ * Canonical text of a replace target's override (D984): the field keeps its
53004
+ * NATIVE value (`native`) when that value is one of `unlessNative`, becomes
53005
+ * `whenSourceTrue` while the boolean source (`x`) is true, else keeps native.
53006
+ * A null source is falsy, so an unknown source leaves the native value.
53007
+ */
53008
+ function overrideExpr(whenSourceTrue, unlessNative) {
53009
+ const guard = unlessNative.map((value) => `native == ${JSON.stringify(value)}`).join(" || ");
53010
+ const inner = `(x ? ${JSON.stringify(whenSourceTrue)} : native)`;
53011
+ return guard === "" ? inner.slice(1, -1) : `${guard} ? native : ${inner}`;
53012
+ }
52996
53013
  function isIdentifier(path) {
52997
53014
  return IDENT.test(path);
52998
53015
  }
52999
53016
  function dwellExpr(comparison, threshold, start, stop) {
53000
53017
  return `dwell(x ${comparison === "gte" ? ">=" : "<="} ${threshold}, ${start}, ${stop})`;
53001
53018
  }
53019
+ function linearExpr(inner, scale, offset, clampMin, clampMax) {
53020
+ const arithmetic = `${inner} * ${scale} + ${offset}`;
53021
+ if (clampMin === null || clampMax === null) return arithmetic;
53022
+ return `clamp(${arithmetic}, ${clampMin}, ${clampMax})`;
53023
+ }
53002
53024
  function token(value, pattern) {
53003
53025
  if (!Number.isFinite(value)) return null;
53004
53026
  const text = Object.is(value, -0) ? "0" : String(value);
@@ -80085,6 +80107,14 @@ var powerMeterCapability = {
80085
80107
  deviceNative: true,
80086
80108
  mode: "singleton",
80087
80109
  deviceTypes: POWER_METER_DEVICE_TYPES,
80110
+ deviceConfig: { ui: {
80111
+ kind: "widget",
80112
+ widgetId: "host/power-meter-line",
80113
+ tab: "power",
80114
+ placement: "hero",
80115
+ label: "Power",
80116
+ order: 4
80117
+ } },
80088
80118
  methods: {},
80089
80119
  status: {
80090
80120
  schema: PowerMeterStatusSchema,
@@ -93001,7 +93031,225 @@ function lockDoorLinkOfComposition(composition) {
93001
93031
  };
93002
93032
  }
93003
93033
  SOURCE_CAPS.filter((cap) => cap !== "switch" && cap !== "motion");
93034
+ function fromRead(source, cap, fieldPath) {
93035
+ return {
93036
+ kind: "from",
93037
+ source,
93038
+ cap,
93039
+ fieldPath
93040
+ };
93041
+ }
93042
+ function expression(expr, bindings) {
93043
+ return {
93044
+ kind: "expression",
93045
+ expr,
93046
+ bindings
93047
+ };
93048
+ }
93049
+ function literal(expr) {
93050
+ return expression(expr, {});
93051
+ }
93004
93052
  String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
93053
+ var catalog$4 = CAP_CUSTOMIZE_CATALOG;
93054
+ function compileScalarOverride(input) {
93055
+ const target = catalogTarget$3(input.draft.cap, input.draft.targetId);
93056
+ if (target === null || target.cardinality !== "scalar" || target.path === void 0) return fail$1("target");
93057
+ if (input.draft.transform.kind === "enum-map") return fail$1("enum");
93058
+ const source = sourceSpec$1(target, input.sourceValueKind, input.draft.source.cap);
93059
+ if (source === null) return fail$1("source-kind");
93060
+ if (source.requiredUnit !== void 0 && input.sourceUnit !== source.requiredUnit) return fail$1("unit");
93061
+ const allowed = input.draft.transform.kind === "number" ? "identity" : input.draft.transform.kind;
93062
+ if (!source.transformKinds.includes(allowed)) return fail$1("transform");
93063
+ if (target.override !== void 0) return compileOverride(input, target.path, target.override);
93064
+ const value = compileValue$1(input);
93065
+ if (!value.ok) return value;
93066
+ const fields = compileCompanions$1(input, target, value.value);
93067
+ if (!fields.ok) return fields;
93068
+ return {
93069
+ ok: true,
93070
+ value: {
93071
+ kind: "fields",
93072
+ cap: input.draft.cap,
93073
+ fields: fields.value
93074
+ }
93075
+ };
93076
+ }
93077
+ /**
93078
+ * A replace target (D984): ONE field, derived from the boolean source and the
93079
+ * device's own NATIVE value, which the composer reads from the shadow. No
93080
+ * companion — the native slice keeps its own clock.
93081
+ */
93082
+ function compileOverride(input, path, rule) {
93083
+ if (input.sourceValueKind !== "boolean" || input.draft.transform.kind !== "identity") return fail$1("source-kind");
93084
+ const read = fromRead(refOf$1(input.draft), input.draft.source.cap, input.draft.source.fieldPath);
93085
+ const field = expression(overrideExpr(rule.whenSourceTrue, rule.unlessNative), {
93086
+ x: read,
93087
+ native: fromRead(input.device, input.draft.cap, path)
93088
+ });
93089
+ return {
93090
+ ok: true,
93091
+ value: {
93092
+ kind: "fields",
93093
+ cap: input.draft.cap,
93094
+ fields: { [path]: field }
93095
+ }
93096
+ };
93097
+ }
93098
+ function fail$1(reason) {
93099
+ return {
93100
+ ok: false,
93101
+ reason
93102
+ };
93103
+ }
93104
+ function catalogTarget$3(cap, targetId) {
93105
+ const entry = catalog$4[cap];
93106
+ if (entry === void 0) return null;
93107
+ return entry.targets.find((target) => target.id === targetId) ?? null;
93108
+ }
93109
+ function sourceSpec$1(target, valueKind, sourceCap) {
93110
+ if (valueKind === "boolean" && sourceCap === "switch") return target.sources.find((source) => source.kind === "switch") ?? null;
93111
+ if (valueKind === "boolean") return target.sources.find((source) => source.kind === "binary") ?? fieldSource(target, "boolean");
93112
+ if (valueKind === "number") return target.sources.find((source) => source.kind === "numeric") ?? fieldSource(target, "number");
93113
+ return fieldSource(target, "string");
93114
+ }
93115
+ function fieldSource(target, valueKind) {
93116
+ return target.sources.find((source) => source.kind === "field" && (source.valueKinds ?? []).includes(valueKind)) ?? null;
93117
+ }
93118
+ function compileValue$1(input) {
93119
+ const read = fromRead(refOf$1(input.draft), input.draft.source.cap, input.draft.source.fieldPath);
93120
+ const transform = input.draft.transform;
93121
+ if (transform.kind === "identity" || transform.kind === "number") return {
93122
+ ok: true,
93123
+ value: identityValue(read, input.sourceValueKind)
93124
+ };
93125
+ if (transform.kind === "invert") {
93126
+ if (input.sourceValueKind !== "boolean") return fail$1("source-kind");
93127
+ return {
93128
+ ok: true,
93129
+ value: expression("!x", { x: read })
93130
+ };
93131
+ }
93132
+ if (transform.kind === "threshold") return thresholdValue(transform, read);
93133
+ if (transform.kind === "linear") return linearValue$1(transform, read, input.sourceValueKind);
93134
+ return fail$1("transform");
93135
+ }
93136
+ function identityValue(read, valueKind) {
93137
+ if (valueKind === "string") return expression("number(x)", { x: read });
93138
+ return read;
93139
+ }
93140
+ function thresholdValue(transform, read) {
93141
+ const threshold = unsignedToken(transform.threshold);
93142
+ if (threshold === null) return fail$1("threshold");
93143
+ const start = unsignedToken(transform.startDwellMs);
93144
+ const stop = unsignedToken(transform.stopDwellMs);
93145
+ if (start === null || stop === null) return fail$1("dwell");
93146
+ return {
93147
+ ok: true,
93148
+ value: expression(dwellExpr(transform.comparison, threshold, start, stop), { x: read })
93149
+ };
93150
+ }
93151
+ function linearValue$1(transform, read, valueKind) {
93152
+ const scale = signedToken(transform.scale);
93153
+ const offset = signedToken(transform.offset);
93154
+ if (scale === null || offset === null) return fail$1("scale");
93155
+ const clamps = clampTokens$1(transform.clampMin, transform.clampMax);
93156
+ if (!clamps.ok) return clamps;
93157
+ return {
93158
+ ok: true,
93159
+ value: expression(linearExpr(valueKind === "string" ? "number(x)" : "x", scale, offset, clamps.value.min, clamps.value.max), { x: read })
93160
+ };
93161
+ }
93162
+ function clampTokens$1(clampMin, clampMax) {
93163
+ if (clampMin === void 0 && clampMax === void 0) return {
93164
+ ok: true,
93165
+ value: {
93166
+ min: null,
93167
+ max: null
93168
+ }
93169
+ };
93170
+ if (clampMin === void 0 || clampMax === void 0) return fail$1("clamp");
93171
+ const min = signedToken(clampMin);
93172
+ const max = signedToken(clampMax);
93173
+ if (min === null || max === null || clampMin > clampMax) return fail$1("clamp");
93174
+ return {
93175
+ ok: true,
93176
+ value: {
93177
+ min,
93178
+ max
93179
+ }
93180
+ };
93181
+ }
93182
+ function compileCompanions$1(input, target, value) {
93183
+ if (target.path === void 0) return fail$1("target");
93184
+ const path = target.path;
93185
+ return (target.companions ?? []).filter((companion) => companionIncluded$1(companion, input.apply)).reduce((acc, companion) => {
93186
+ if (!acc.ok) return acc;
93187
+ const built = companionField(input, path, companion, value);
93188
+ if (!built.ok) return {
93189
+ ok: false,
93190
+ reason: built.reason
93191
+ };
93192
+ return {
93193
+ ok: true,
93194
+ value: {
93195
+ ...acc.value,
93196
+ [companion.path]: built.value
93197
+ }
93198
+ };
93199
+ }, {
93200
+ ok: true,
93201
+ value: { [path]: value }
93202
+ });
93203
+ }
93204
+ function companionIncluded$1(companion, apply) {
93205
+ if (companion.kind === "transition-time") return true;
93206
+ return companion.when === "always" || apply === "add";
93207
+ }
93208
+ function companionField(input, path, companion, value) {
93209
+ if (companion.kind === "constant") {
93210
+ const expr = constantExpr(companion.value);
93211
+ if (expr === null) return fail$1("scale");
93212
+ return {
93213
+ ok: true,
93214
+ value: literal(expr)
93215
+ };
93216
+ }
93217
+ if (companion.kind === "clock") return {
93218
+ ok: true,
93219
+ value: literal("now")
93220
+ };
93221
+ return transitionField(input, path, companion.sourceChangedAt, value);
93222
+ }
93223
+ function transitionField(input, path, sourceChangedAt, value) {
93224
+ if (sourceChangedAt === "prefer" && input.sourceValueKind === "boolean" && input.changedAtField !== null && isIdentifier(input.changedAtField)) return {
93225
+ ok: true,
93226
+ value: fromRead(refOf$1(input.draft), input.draft.source.cap, input.changedAtField)
93227
+ };
93228
+ if (input.apply === "replace") return stampOfValue(value);
93229
+ if (!isIdentifier(path)) return fail$1("transform");
93230
+ const bindings = { [path]: fromRead(input.device, input.draft.cap, path) };
93231
+ return {
93232
+ ok: true,
93233
+ value: expression(`latchedAt(${path})`, bindings)
93234
+ };
93235
+ }
93236
+ function stampOfValue(value) {
93237
+ if (value.kind === "expression") return {
93238
+ ok: true,
93239
+ value: expression(`latchedAt(${value.expr})`, value.bindings)
93240
+ };
93241
+ if (value.kind === "from") return {
93242
+ ok: true,
93243
+ value: expression("latchedAt(x)", { x: value })
93244
+ };
93245
+ return fail$1("transform");
93246
+ }
93247
+ function refOf$1(draft) {
93248
+ return {
93249
+ addonId: draft.source.addonId,
93250
+ stableId: draft.source.stableId
93251
+ };
93252
+ }
93005
93253
  DeviceRole.BinarySensor, DeviceRole.MotionSensor;
93006
93254
  new Set(CAP_NAMES);
93007
93255
  function isUnfilledRequiredProblem(problem) {
@@ -110507,6 +110755,12 @@ Object.defineProperty(exports, "CatalogFileSchema", {
110507
110755
  return CatalogFileSchema;
110508
110756
  }
110509
110757
  });
110758
+ Object.defineProperty(exports, "CompositionSchema", {
110759
+ enumerable: true,
110760
+ get: function() {
110761
+ return CompositionSchema;
110762
+ }
110763
+ });
110510
110764
  Object.defineProperty(exports, "ConditionMirror", {
110511
110765
  enumerable: true,
110512
110766
  get: function() {
@@ -111521,6 +111775,12 @@ Object.defineProperty(exports, "colorCapability", {
111521
111775
  return colorCapability;
111522
111776
  }
111523
111777
  });
111778
+ Object.defineProperty(exports, "compileScalarOverride", {
111779
+ enumerable: true,
111780
+ get: function() {
111781
+ return compileScalarOverride;
111782
+ }
111783
+ });
111524
111784
  Object.defineProperty(exports, "composedDeviceRef", {
111525
111785
  enumerable: true,
111526
111786
  get: function() {