@camstack/system 1.2.474 → 1.2.476

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 (91) hide show
  1. package/dist/{agent-https-DRwEbLL7.js → agent-https-DkXBXEvz.js} +8 -8
  2. package/dist/{agent-https-CbczsyM0.mjs → agent-https-vpf_D97z.mjs} +8 -8
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/autotrack/index.js +1 -1
  10. package/dist/builtins/autotrack/index.mjs +1 -1
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +2 -2
  12. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +2 -2
  13. package/dist/builtins/calendars/calendars.addon.js +1 -1
  14. package/dist/builtins/calendars/calendars.addon.mjs +1 -1
  15. package/dist/builtins/camera-grid/index.js +1 -1
  16. package/dist/builtins/camera-grid/index.mjs +1 -1
  17. package/dist/builtins/composer/composer-live-set.d.ts +9 -1
  18. package/dist/builtins/composer/composer.addon.js +130 -11
  19. package/dist/builtins/composer/composer.addon.mjs +130 -11
  20. package/dist/builtins/composer/composer.d.ts +8 -1
  21. package/dist/builtins/composer/composition-runtime.d.ts +2 -0
  22. package/dist/builtins/composer/composition-target.d.ts +6 -0
  23. package/dist/builtins/composer/owned-fields-target.d.ts +9 -0
  24. package/dist/builtins/console-logging/index.js +1 -1
  25. package/dist/builtins/console-logging/index.mjs +1 -1
  26. package/dist/builtins/core-blocks/block-supervisor.d.ts +19 -1
  27. package/dist/builtins/core-blocks/composition-api.d.ts +7 -1
  28. package/dist/builtins/core-blocks/core-blocks.addon.js +108 -10
  29. package/dist/builtins/core-blocks/core-blocks.addon.mjs +108 -10
  30. package/dist/builtins/device-history/device-history.addon.js +1 -1
  31. package/dist/builtins/device-history/device-history.addon.mjs +1 -1
  32. package/dist/builtins/device-manager/device-manager.addon.js +1 -1
  33. package/dist/builtins/device-manager/device-manager.addon.mjs +1 -1
  34. package/dist/builtins/hub-forwarder/index.js +1 -1
  35. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  36. package/dist/builtins/keychain/index.js +3 -3
  37. package/dist/builtins/keychain/index.mjs +3 -3
  38. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  39. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  40. package/dist/builtins/local-auth/local-auth.addon.js +2 -2
  41. package/dist/builtins/local-auth/local-auth.addon.mjs +2 -2
  42. package/dist/builtins/local-network/local-network.addon.js +2 -2
  43. package/dist/builtins/local-network/local-network.addon.mjs +2 -2
  44. package/dist/builtins/loki-logging/index.js +1 -1
  45. package/dist/builtins/loki-logging/index.mjs +1 -1
  46. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  47. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  48. package/dist/builtins/platform-probe/index.js +1 -1
  49. package/dist/builtins/platform-probe/index.mjs +1 -1
  50. package/dist/builtins/record-entries/index.js +1 -1
  51. package/dist/builtins/record-entries/index.mjs +1 -1
  52. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  53. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  54. package/dist/builtins/snapshot/index.js +1 -1
  55. package/dist/builtins/snapshot/index.mjs +1 -1
  56. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  57. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  58. package/dist/builtins/sqlite-storage/index.js +1 -1
  59. package/dist/builtins/sqlite-storage/index.mjs +1 -1
  60. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +2 -2
  61. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +2 -2
  62. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  63. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  64. package/dist/builtins/system-config/system-config.addon.js +8 -8
  65. package/dist/builtins/system-config/system-config.addon.mjs +8 -8
  66. package/dist/builtins/winston-logging/index.js +1 -1
  67. package/dist/builtins/winston-logging/index.mjs +1 -1
  68. package/dist/{composition-sources-CsBIIit3.mjs → composition-sources-B5nK7pHt.mjs} +1 -1
  69. package/dist/{composition-sources-CJv3W669.js → composition-sources-BNOP9mFp.js} +1 -1
  70. package/dist/{constants-C0hrXcEr.js → constants-D4VigrMM.js} +1 -1
  71. package/dist/{constants-Dy8CaDeT.mjs → constants-jbhoFV7w.mjs} +1 -1
  72. package/dist/{device-ca-CHdsePe5.mjs → device-ca-CvBZeyVX.mjs} +14 -13
  73. package/dist/{device-ca-Dg3rSU48.js → device-ca-DhyQeXsa.js} +14 -13
  74. package/dist/{dist-BugavoVR.mjs → dist-B_V9r61Z.mjs} +433 -22
  75. package/dist/{dist-Sn-HiZ4e.js → dist-CNU7cdFf.js} +433 -22
  76. package/dist/file-host-worker.js +1 -1
  77. package/dist/file-host-worker.mjs +1 -1
  78. package/dist/{hub-mdns-ciao-BDvqGIw4.mjs → hub-mdns-ciao-BuUg0gpI.mjs} +4 -4
  79. package/dist/{hub-mdns-ciao-DkncLbg9.js → hub-mdns-ciao-DFidf52M.js} +4 -4
  80. package/dist/index.js +7 -7
  81. package/dist/index.mjs +7 -7
  82. package/dist/{lib-8oZrELLm.js → lib-C3U1yluo.js} +1 -1
  83. package/dist/{lib-DK38ompL.mjs → lib-DFZblCIu.mjs} +1 -1
  84. package/dist/{restore-archive-gYKzaJ4Y.js → restore-archive-BtCheeWu.js} +1 -1
  85. package/dist/{restore-archive-CFBm30Gk.mjs → restore-archive-CDo4Zlmx.mjs} +1 -1
  86. package/dist/tls/cert-utc-time.d.ts +1 -0
  87. package/dist/{wal-maintenance-DyMUz_Hy.js → wal-maintenance-B7xBeIFi.js} +0 -0
  88. package/dist/{wal-maintenance-BnhkcEkI.mjs → wal-maintenance-DItlr0Yu.mjs} +0 -0
  89. package/dist/{x509.es-DK__ETIe.mjs → x509.es-BRiJgOvu.mjs} +24 -1
  90. package/dist/{x509.es-C4cOo48M.js → x509.es-WtnRNyYS.js} +29 -0
  91. package/package.json +1 -1
@@ -5484,7 +5484,7 @@ function errMsg(err) {
5484
5484
  return String(err);
5485
5485
  }
5486
5486
  //#endregion
5487
- //#region ../types/dist/composition-xz-ud5EQ.mjs
5487
+ //#region ../types/dist/composition-BJ8iAZb3.mjs
5488
5488
  var AUDIO_ENCODER_BY_CODEC = {
5489
5489
  opus: "libopus",
5490
5490
  aac: "aac",
@@ -5936,7 +5936,7 @@ portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac
5936
5936
  * ONE table for everyone who asks "is this device HIGH?": the
5937
5937
  * recorder's `RecordingTriggers.sensorDeviceIds` trigger, the post-analysis
5938
5938
  * sensor markers, the orchestrator's camera-sensors bridge and
5939
- * the sources of a composite doorbell (`doorbellFeatureSources`, D671).
5939
+ * the sources of a pulse (`compilePulseOverride`, D936).
5940
5940
  * A second copy would diverge at the first cap added, and the symptom — "the
5941
5941
  * sensor rings the doorbell but does not record" — is exactly D62.
5942
5942
  *
@@ -15519,6 +15519,13 @@ var ComposerUnreadableBlockSchema = z.object({
15519
15519
  /** The parse error, in the operator's words. */
15520
15520
  error: z.string()
15521
15521
  });
15522
+ /** A confirmed release the hub did not accept. `deviceId` is the claim's device. */
15523
+ var UnreleasedClaimSchema = z.object({
15524
+ deviceId: z.number().int(),
15525
+ capName: z.string(),
15526
+ owner: z.string(),
15527
+ error: z.string()
15528
+ });
15522
15529
  var ComposerApplyInputSchema = z.object({
15523
15530
  /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
15524
15531
  integrationId: z.string().nullable(),
@@ -15528,7 +15535,13 @@ var ComposerApplyInputSchema = z.object({
15528
15535
  /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
15529
15536
  restartBlockIds: z.array(z.string()),
15530
15537
  /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
15531
- unreadableBlocks: z.array(ComposerUnreadableBlockSchema)
15538
+ unreadableBlocks: z.array(ComposerUnreadableBlockSchema),
15539
+ /**
15540
+ * Operator-confirmed deletions. Their claims are released on this apply,
15541
+ * before any replacement block claims. A block that merely vanished from the
15542
+ * snapshot is not listed here and still waits for two applies (D49).
15543
+ */
15544
+ retiredBlockIds: z.array(z.string()).optional()
15532
15545
  });
15533
15546
  var ComposerBlockVerdictSchema = z.object({
15534
15547
  blockId: z.string(),
@@ -15552,7 +15565,13 @@ var composerCapability = {
15552
15565
  * integration unknown, its own rows unread or read empty once). An empty
15553
15566
  * apply the caller owes is paid off only by one the composer acted on (D49).
15554
15567
  */
15555
- acted: z.boolean()
15568
+ acted: z.boolean(),
15569
+ /**
15570
+ * Confirmed releases this apply tried and the hub did not accept. Empty when
15571
+ * every one landed (or there was nothing to hand back). Absent on a result
15572
+ * that never got that far.
15573
+ */
15574
+ unreleasedClaims: z.array(UnreleasedClaimSchema).optional()
15556
15575
  }), {
15557
15576
  kind: "mutation",
15558
15577
  auth: "admin"
@@ -60151,20 +60170,68 @@ var BatteryStatusSchema = z.object({
60151
60170
  */
60152
60171
  binary: z.boolean().optional()
60153
60172
  });
60173
+ var BATTERY_DEVICE_TYPES = [
60174
+ DeviceType.Camera,
60175
+ DeviceType.Sensor,
60176
+ DeviceType.Button,
60177
+ DeviceType.Switch,
60178
+ DeviceType.PetFeeder,
60179
+ DeviceType.Container,
60180
+ DeviceType.Thermostat
60181
+ ];
60182
+ /** Generic Customize target for the percentage reading (D936). */
60183
+ var batteryCustomize = {
60184
+ version: 1,
60185
+ targets: [{
60186
+ id: "percentage",
60187
+ cardinality: "scalar",
60188
+ vocabulary: {
60189
+ cap: "battery",
60190
+ stateField: "percentage"
60191
+ },
60192
+ deviceTypes: BATTERY_DEVICE_TYPES,
60193
+ apply: "add-or-replace",
60194
+ path: "percentage",
60195
+ sources: [{
60196
+ kind: "field",
60197
+ valueKinds: ["number", "string"],
60198
+ transforms: [{ kind: "identity" }, {
60199
+ kind: "linear",
60200
+ defaultScale: 1,
60201
+ defaultOffset: 0,
60202
+ clampMin: 0,
60203
+ clampMax: 100
60204
+ }]
60205
+ }],
60206
+ companions: [
60207
+ {
60208
+ kind: "constant",
60209
+ path: "charging",
60210
+ value: "unknown",
60211
+ when: "add"
60212
+ },
60213
+ {
60214
+ kind: "constant",
60215
+ path: "sleeping",
60216
+ value: false,
60217
+ when: "add"
60218
+ },
60219
+ {
60220
+ kind: "clock",
60221
+ path: "lastUpdated",
60222
+ when: "add"
60223
+ }
60224
+ ],
60225
+ sourceReport: { status: "assignment-status" },
60226
+ advancedExpression: true
60227
+ }]
60228
+ };
60154
60229
  var batteryCapability = {
60155
60230
  name: "battery",
60156
60231
  scope: "device",
60157
60232
  deviceNative: true,
60158
60233
  mode: "singleton",
60159
- deviceTypes: [
60160
- DeviceType.Camera,
60161
- DeviceType.Sensor,
60162
- DeviceType.Button,
60163
- DeviceType.Switch,
60164
- DeviceType.PetFeeder,
60165
- DeviceType.Container,
60166
- DeviceType.Thermostat
60167
- ],
60234
+ deviceTypes: BATTERY_DEVICE_TYPES,
60168
60235
  methods: {
60169
60236
  /**
60170
60237
  * Explicitly wake the camera from low-power sleep ahead of a
@@ -60248,6 +60315,7 @@ onStatusChanged: { data: z.object({
60248
60315
  kind: "gauge",
60249
60316
  unit: "%"
60250
60317
  } } },
60318
+ customize: batteryCustomize,
60251
60319
  /** Clock fields: written, but excluded from the compare that decides
60252
60320
  * whether persisting is worth a SQLite commit. */
60253
60321
  volatileStateFields: ["lastUpdated"]
@@ -61313,6 +61381,106 @@ var ConsumablesStatusSchema = z.object({
61313
61381
  items: z.array(ConsumableItemSchema),
61314
61382
  lastChangedAt: z.number()
61315
61383
  });
61384
+ /** Synthesize seed for a link-built status (no native provider).
61385
+ *
61386
+ * ⚠ NO LIVE CALLER since 2026-08-08 (device-links deleted; see
61387
+ * `CapabilityStatusSchema.empty`). The wiring guidance below was written for
61388
+ * exactly the case the operator is asking about again — a Dreame's HA
61389
+ * consumable-life sensors — so it is kept for that conversation, not because
61390
+ * anything reads it today. */
61391
+ var EMPTY_STATUS = {
61392
+ items: [],
61393
+ lastChangedAt: 0
61394
+ };
61395
+ /** Seed for a NEW link-built consumable item. `key`/`label` are overwritten
61396
+ * with the link's `itemKey` (see `status.itemArray`), so the placeholder
61397
+ * empty strings never survive into a validated item. Link-built items are
61398
+ * not resettable — there is no native provider to receive `reset()`.
61399
+ *
61400
+ * Wiring guidance (HA vacuum consumable-life sensors):
61401
+ * - a percent-remaining source (`numeric-sensor`, unit '%') → `level` via
61402
+ * `identity` (or `linear` scale 1 offset 0 clamp [0,100] to be safe);
61403
+ * - an hours-remaining source (e.g. Dreame 'Main Brush Time Left', unit 'h')
61404
+ * → `level` via `linear` with scale = 100 / max-hours for that item
61405
+ * (e.g. main brush 300 h → scale 0.3333) + clamp [0,100];
61406
+ * - a discrete source (`enum-sensor`, e.g. mop pad 'installed') → `status`
61407
+ * via `enum-map` (e.g. { installed: 'ok', missing: 'replace' }).
61408
+ * A numeric→'replace' THRESHOLD (level < 10 → 'replace') is NOT expressible
61409
+ * with the current transform kinds — leave `status` null (valid) until the
61410
+ * expression transform lands. */
61411
+ /** Generic Customize target for one consumable item (D936). Native rows stay read-only. */
61412
+ var consumablesCustomize = {
61413
+ version: 1,
61414
+ targets: [{
61415
+ id: "items",
61416
+ cardinality: "keyedArray",
61417
+ vocabulary: { cap: "consumables" },
61418
+ deviceTypes: Object.values(DeviceType),
61419
+ apply: "add",
61420
+ path: "items",
61421
+ keyField: "key",
61422
+ labelField: "label",
61423
+ itemSchema: ConsumableItemSchema,
61424
+ nativeItems: "read-only",
61425
+ sourceReport: { status: "assignment-status" },
61426
+ fields: [
61427
+ {
61428
+ path: "level",
61429
+ sources: [{
61430
+ kind: "numeric",
61431
+ transforms: [{ kind: "identity" }, {
61432
+ kind: "linear",
61433
+ defaultScale: 1,
61434
+ defaultOffset: 0,
61435
+ clampMin: 0,
61436
+ clampMax: 100
61437
+ }]
61438
+ }]
61439
+ },
61440
+ {
61441
+ path: "remaining.value",
61442
+ sources: [{
61443
+ kind: "numeric",
61444
+ transforms: [{ kind: "identity" }]
61445
+ }],
61446
+ literals: [{
61447
+ path: "remaining.unit",
61448
+ values: [...ConsumableRemainingUnitSchema.options]
61449
+ }]
61450
+ },
61451
+ {
61452
+ path: "status",
61453
+ sources: [{
61454
+ kind: "enum",
61455
+ transforms: [{
61456
+ kind: "enum-map",
61457
+ outputValues: [...ConsumableStatusSchema.options],
61458
+ unmapped: null
61459
+ }]
61460
+ }]
61461
+ }
61462
+ ],
61463
+ traits: [{
61464
+ path: "kind",
61465
+ values: [...ConsumableKindSchema.options],
61466
+ defaultValue: "wear"
61467
+ }, {
61468
+ path: "form",
61469
+ values: [...ConsumableFormSchema.options],
61470
+ defaultValue: "part"
61471
+ }],
61472
+ companions: [{
61473
+ kind: "clock",
61474
+ path: "lastChangedAt",
61475
+ when: "add"
61476
+ }, {
61477
+ kind: "clock",
61478
+ path: "lastFetchedAt",
61479
+ when: "add"
61480
+ }],
61481
+ advancedExpression: true
61482
+ }]
61483
+ };
61316
61484
  var consumablesCapability = {
61317
61485
  name: "consumables",
61318
61486
  scope: "device",
@@ -61350,10 +61518,7 @@ reset: method(z.object({
61350
61518
  status: {
61351
61519
  schema: ConsumablesStatusSchema,
61352
61520
  kind: "push",
61353
- empty: {
61354
- items: [],
61355
- lastChangedAt: 0
61356
- },
61521
+ empty: EMPTY_STATUS,
61357
61522
  itemArray: {
61358
61523
  path: "items",
61359
61524
  keyField: "key",
@@ -61389,6 +61554,7 @@ reset: method(z.object({
61389
61554
  * brush's remaining life and a dishwasher's salt are each recorded the moment
61390
61555
  * their provider reports them; an item that appears later gets its series.
61391
61556
  */
61557
+ customize: consumablesCustomize,
61392
61558
  history: {
61393
61559
  fields: {},
61394
61560
  items: {
@@ -62177,6 +62343,36 @@ var dishwasherCapability = {
62177
62343
  powerOn: { kind: "boolean" }
62178
62344
  } }
62179
62345
  };
62346
+ /** Pulse override: a rising edge advances `lastPressedAt` and the press count. */
62347
+ var doorbellCustomize = {
62348
+ version: 1,
62349
+ targets: [{
62350
+ id: "pressed",
62351
+ cardinality: "event",
62352
+ shape: "pulse",
62353
+ vocabulary: {
62354
+ cap: "doorbell",
62355
+ eventName: "onPressed"
62356
+ },
62357
+ deviceTypes: [DeviceType.Camera],
62358
+ apply: "add",
62359
+ applyAuthority: { kind: "composition-claim" },
62360
+ eventName: "onPressed",
62361
+ edges: ["rising"],
62362
+ timestampPath: "lastPressedAt",
62363
+ counterPath: "pressCountSinceStart",
62364
+ highWater: "composer-advance",
62365
+ combine: "any",
62366
+ debounce: {
62367
+ kind: "rising-edge",
62368
+ defaultDebounceMs: 2e3,
62369
+ changedAtRequired: true
62370
+ },
62371
+ sources: [{ kind: "binary" }, { kind: "switch" }],
62372
+ sourceReport: { status: "assignment-status" },
62373
+ advancedExpression: true
62374
+ }]
62375
+ };
62180
62376
  var DoorbellStatusSchema = z.object({
62181
62377
  /** Ms epoch of the last press. null = never observed since this provider started. */
62182
62378
  lastPressedAt: z.number().nullable(),
@@ -62243,7 +62439,8 @@ onPressed: {
62243
62439
  /**
62244
62440
  * History (D850): none — `pressCountSinceStart` resets with the addon, so it is not a monotonic meter; presses live in the events ledger.
62245
62441
  */
62246
- history: "none"
62442
+ history: "none",
62443
+ customize: doorbellCustomize
62247
62444
  };
62248
62445
  /**
62249
62446
  * Enum-state sensor — a string value picked from a finite option set.
@@ -64949,6 +65146,38 @@ authKey: z.string().optional() }), z.object({
64949
65146
  }), { kind: "mutation" })
64950
65147
  }
64951
65148
  };
65149
+ /** Span override: start on a rising edge, end on a fall or this timeout. */
65150
+ var motionCustomize = {
65151
+ version: 1,
65152
+ targets: [{
65153
+ id: "detected",
65154
+ cardinality: "event",
65155
+ shape: "span",
65156
+ vocabulary: {
65157
+ cap: "motion",
65158
+ eventName: "onMotionChanged"
65159
+ },
65160
+ deviceTypes: [DeviceType.Camera],
65161
+ apply: "replace",
65162
+ applyAuthority: {
65163
+ kind: "camera-sensors",
65164
+ timeoutField: "motionCooldownMs"
65165
+ },
65166
+ eventName: "onMotionChanged",
65167
+ start: "rising-edge",
65168
+ end: "falling-edge-or-timeout",
65169
+ timeoutMs: 3e4,
65170
+ combine: "any",
65171
+ sourceModes: [
65172
+ "in-addition",
65173
+ "confirm",
65174
+ "replace"
65175
+ ],
65176
+ sources: [{ kind: "binary" }, { kind: "switch" }],
65177
+ sourceReport: { status: "assignment-status" },
65178
+ advancedExpression: false
65179
+ }]
65180
+ };
64952
65181
  /**
64953
65182
  * Hardware / firmware motion sensor cap — binary detected state plus
64954
65183
  * a timestamp of the last observation. Distinct from
@@ -65113,7 +65342,8 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
65113
65342
  history: { fields: { detected: {
65114
65343
  kind: "boolean",
65115
65344
  excludeDeviceTypes: [DeviceType.Camera]
65116
- } } }
65345
+ } } },
65346
+ customize: motionCustomize
65117
65347
  };
65118
65348
  /**
65119
65349
  * Motion-trigger toggle for accessory devices.
@@ -68202,6 +68432,8 @@ var ptzAutotrackCapability = {
68202
68432
  */
68203
68433
  history: "none"
68204
68434
  };
68435
+ var RUNNING_POWER_START_DELAY_MS = 3e4;
68436
+ var RUNNING_POWER_STOP_DELAY_MS = 18e4;
68205
68437
  var RunningStateSourceSchema = z.enum(["native", "assigned"]);
68206
68438
  var RunningStateStatusSchema = z.object({
68207
68439
  /** null = unknown — never coerced to false (D393). */
@@ -68210,19 +68442,100 @@ var RunningStateStatusSchema = z.object({
68210
68442
  since: z.number().nullable(),
68211
68443
  source: RunningStateSourceSchema,
68212
68444
  phase: z.string().nullable(),
68213
- lastFetchedAt: z.number()
68445
+ /** null until a reading has been published (D393). */
68446
+ lastFetchedAt: z.number().nullable()
68214
68447
  });
68215
68448
  var RunningFlipEventDataSchema = z.object({
68216
68449
  deviceId: z.number(),
68217
68450
  since: z.number().nullable(),
68218
68451
  phase: z.string().nullable()
68219
68452
  });
68453
+ var RUNNING_DEVICE_TYPES = Object.values(DeviceType);
68454
+ /** Generic Customize target for the running boolean (D936). */
68455
+ var runningCustomize = {
68456
+ version: 1,
68457
+ targets: [{
68458
+ id: "running",
68459
+ cardinality: "scalar",
68460
+ vocabulary: {
68461
+ cap: "running-state",
68462
+ stateField: "running"
68463
+ },
68464
+ deviceTypes: [
68465
+ DeviceType.Dishwasher,
68466
+ DeviceType.Vacuum,
68467
+ DeviceType.LawnMower,
68468
+ DeviceType.MediaPlayer,
68469
+ DeviceType.WaterHeater,
68470
+ DeviceType.Humidifier,
68471
+ DeviceType.Fan,
68472
+ DeviceType.Climate,
68473
+ DeviceType.Thermostat,
68474
+ DeviceType.PetFeeder
68475
+ ],
68476
+ apply: "add-or-replace",
68477
+ path: "running",
68478
+ sources: [
68479
+ {
68480
+ kind: "switch",
68481
+ transforms: [{ kind: "identity" }]
68482
+ },
68483
+ {
68484
+ kind: "binary",
68485
+ transforms: [{ kind: "identity" }, { kind: "invert" }]
68486
+ },
68487
+ {
68488
+ kind: "numeric",
68489
+ requiredUnit: "W",
68490
+ transforms: [{
68491
+ kind: "threshold",
68492
+ comparison: "gte",
68493
+ defaultThreshold: 5,
68494
+ defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
68495
+ defaultStopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
68496
+ thresholdUnit: "W"
68497
+ }]
68498
+ }
68499
+ ],
68500
+ companions: [
68501
+ {
68502
+ kind: "constant",
68503
+ path: "source",
68504
+ value: "assigned",
68505
+ when: "always"
68506
+ },
68507
+ {
68508
+ kind: "constant",
68509
+ path: "phase",
68510
+ value: null,
68511
+ when: "always"
68512
+ },
68513
+ {
68514
+ kind: "clock",
68515
+ path: "lastFetchedAt",
68516
+ when: "always"
68517
+ },
68518
+ {
68519
+ kind: "transition-time",
68520
+ path: "since",
68521
+ sourceChangedAt: "prefer"
68522
+ }
68523
+ ],
68524
+ sourceReport: {
68525
+ status: "assignment-status",
68526
+ runtimeField: "source",
68527
+ nativeValue: "native",
68528
+ assignedValue: "assigned"
68529
+ },
68530
+ advancedExpression: true
68531
+ }]
68532
+ };
68220
68533
  var runningStateCapability = {
68221
68534
  name: "running-state",
68222
68535
  scope: "device",
68223
68536
  deviceNative: true,
68224
68537
  mode: "singleton",
68225
- deviceTypes: Object.values(DeviceType),
68538
+ deviceTypes: RUNNING_DEVICE_TYPES,
68226
68539
  methods: {},
68227
68540
  events: {
68228
68541
  onStarted: { data: RunningFlipEventDataSchema },
@@ -68235,7 +68548,8 @@ var runningStateCapability = {
68235
68548
  runtimeState: RunningStateStatusSchema,
68236
68549
  durability: "restored",
68237
68550
  history: { fields: { running: { kind: "boolean" } } },
68238
- volatileStateFields: ["lastFetchedAt"]
68551
+ volatileStateFields: ["lastFetchedAt"],
68552
+ customize: runningCustomize
68239
68553
  };
68240
68554
  /**
68241
68555
  * reboot — device-scoped capability for "soft" device reboots (firmware
@@ -92966,6 +93280,103 @@ var HISTORY_ITEM_CATALOG = { "consumables": {
92966
93280
  }
92967
93281
  }
92968
93282
  } };
93283
+ DeviceType.Camera, DeviceType.Sensor, DeviceType.Button, DeviceType.Switch, DeviceType.PetFeeder, DeviceType.Container, DeviceType.Thermostat, DeviceType.Camera, DeviceType.Hub, DeviceType.Light, DeviceType.Siren, DeviceType.Switch, DeviceType.Sensor, DeviceType.Thermostat, DeviceType.Climate, DeviceType.Button, DeviceType.EventEmitter, DeviceType.Update, DeviceType.Generic, DeviceType.Notifier, DeviceType.Script, DeviceType.Automation, DeviceType.Lock, DeviceType.Cover, DeviceType.Valve, DeviceType.Humidifier, DeviceType.WaterHeater, DeviceType.Fan, DeviceType.MediaPlayer, DeviceType.AlarmPanel, DeviceType.Control, DeviceType.Presence, DeviceType.Weather, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.Container, DeviceType.Image, DeviceType.PetFeeder, DeviceType.Dishwasher, DeviceType.Camera, DeviceType.Camera, DeviceType.Dishwasher, DeviceType.Vacuum, DeviceType.LawnMower, DeviceType.MediaPlayer, DeviceType.WaterHeater, DeviceType.Humidifier, DeviceType.Fan, DeviceType.Climate, DeviceType.Thermostat, DeviceType.PetFeeder;
93284
+ /**
93285
+ * A saved Customize assignment (D936). The schema is the type: callers use
93286
+ * `z.infer`, they do not restate the shape.
93287
+ */
93288
+ var OverrideSourceSchema = z.object({
93289
+ addonId: z.string().min(1),
93290
+ stableId: z.string().min(1),
93291
+ cap: z.string().min(1),
93292
+ fieldPath: z.string().min(1)
93293
+ });
93294
+ var IdentityTransformDraftSchema = z.object({ kind: z.literal("identity") });
93295
+ var InvertTransformDraftSchema = z.object({ kind: z.literal("invert") });
93296
+ var ThresholdTransformDraftSchema = z.object({
93297
+ kind: z.literal("threshold"),
93298
+ comparison: z.enum(["gte", "lte"]),
93299
+ threshold: z.number(),
93300
+ startDwellMs: z.number().nonnegative(),
93301
+ stopDwellMs: z.number().nonnegative()
93302
+ });
93303
+ var LinearTransformDraftSchema = z.object({
93304
+ kind: z.literal("linear"),
93305
+ scale: z.number(),
93306
+ offset: z.number(),
93307
+ clampMin: z.number().optional(),
93308
+ clampMax: z.number().optional()
93309
+ });
93310
+ var EnumMapTransformDraftSchema = z.object({
93311
+ kind: z.literal("enum-map"),
93312
+ mapping: z.record(z.string(), z.string().nullable())
93313
+ });
93314
+ var NumberBridgeTransformDraftSchema = z.object({ kind: z.literal("number") });
93315
+ var CustomizeTransformDraftSchema = z.discriminatedUnion("kind", [
93316
+ IdentityTransformDraftSchema,
93317
+ InvertTransformDraftSchema,
93318
+ ThresholdTransformDraftSchema,
93319
+ LinearTransformDraftSchema,
93320
+ EnumMapTransformDraftSchema,
93321
+ NumberBridgeTransformDraftSchema
93322
+ ]);
93323
+ var ScalarOverrideDraftSchema = z.object({
93324
+ kind: z.literal("scalar"),
93325
+ cap: z.string().min(1),
93326
+ targetId: z.string().min(1),
93327
+ source: OverrideSourceSchema,
93328
+ transform: CustomizeTransformDraftSchema
93329
+ });
93330
+ var KeyedArrayOverrideDraftSchema = z.object({
93331
+ kind: z.literal("keyedArray"),
93332
+ cap: z.string().min(1),
93333
+ targetId: z.string().min(1),
93334
+ key: z.string().min(1),
93335
+ label: z.string().min(1),
93336
+ fieldPath: z.string().min(1),
93337
+ source: OverrideSourceSchema,
93338
+ transform: CustomizeTransformDraftSchema
93339
+ });
93340
+ var PulseOverrideDraftSchema = z.object({
93341
+ kind: z.literal("pulse"),
93342
+ cap: z.string().min(1),
93343
+ targetId: z.string().min(1),
93344
+ enabled: z.boolean(),
93345
+ debounceMs: z.number().nonnegative(),
93346
+ sources: z.array(OverrideSourceSchema).min(1)
93347
+ });
93348
+ var SpanSourceDraftSchema = OverrideSourceSchema.extend({ mode: z.enum([
93349
+ "in-addition",
93350
+ "confirm",
93351
+ "replace"
93352
+ ]).optional() });
93353
+ var SpanOverrideDraftSchema = z.object({
93354
+ kind: z.literal("span"),
93355
+ cap: z.string().min(1),
93356
+ targetId: z.string().min(1),
93357
+ timeoutMs: z.number().nonnegative(),
93358
+ cooldownMs: z.number().nonnegative().optional(),
93359
+ sources: z.array(SpanSourceDraftSchema)
93360
+ });
93361
+ z.discriminatedUnion("kind", [
93362
+ ScalarOverrideDraftSchema,
93363
+ KeyedArrayOverrideDraftSchema,
93364
+ PulseOverrideDraftSchema,
93365
+ SpanOverrideDraftSchema
93366
+ ]);
93367
+ z.object({
93368
+ targetId: z.string().min(1),
93369
+ configured: z.boolean(),
93370
+ source: z.enum(["native", "assigned"]),
93371
+ state: z.enum([
93372
+ "active",
93373
+ "stale",
93374
+ "released",
93375
+ "unavailable"
93376
+ ]),
93377
+ reason: z.string().nullable()
93378
+ });
93379
+ String.raw`rose\(active(\d+), changed(\d+), (\d+(?:\.\d+)?)\)`;
92969
93380
  var G711_SCALE_CORRECTION_DB = {
92970
93381
  PCMU: 20 * Math.log10(4),
92971
93382
  PCMA: 20 * Math.log10(8)