@camstack/addon-import-alexa 0.2.196 → 0.2.198

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 (4) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/addon.js +2033 -1985
  3. package/dist/addon.mjs +2033 -1985
  4. package/package.json +2 -2
package/dist/addon.js CHANGED
@@ -48,1194 +48,6 @@ node_fs = __toESM(node_fs, 1);
48
48
  let node_child_process = require("node:child_process");
49
49
  require("node:zlib");
50
50
  let node_url = require("node:url");
51
- //#region ../types/dist/event-category-78tcBemo.mjs
52
- var EventCategory = /* @__PURE__ */ function(EventCategory) {
53
- EventCategory["SystemBoot"] = "system.boot";
54
- EventCategory["SystemAddonsReady"] = "system.addons-ready";
55
- EventCategory["SystemRestarting"] = "system.restarting";
56
- /**
57
- * Fired exactly once after the hub finishes booting following a
58
- * restart that was triggered by `RestartCoordinator` (today: framework
59
- * live-update). Payload is the marker that was on disk at boot
60
- * (`PendingRestartMarkerPayload`); admin UI listens for it to display a
61
- * success toast describing what changed.
62
- *
63
- * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
64
- */
65
- EventCategory["SystemRestartCompleted"] = "system.restart-completed";
66
- /**
67
- * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
68
- * Emitted only when the material on disk actually changed, so an
69
- * operator who trusted the old certificate by hand is told rather than
70
- * discovering it as a browser error. Payload `TlsCertChangedPayload`.
71
- *
72
- * Rule: docs/decisions/adr-0227-*.md
73
- */
74
- EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
75
- /**
76
- * A newer addon or server-root package version was found by the
77
- * authoritative registry check. Emitted once when any observed
78
- * `latestVersion` changes (or a package/node first appears behind);
79
- * the payload carries the full currently-available list. Repeated
80
- * polling of the same latests is silent.
81
- */
82
- EventCategory["UpdateAvailable"] = "update.available";
83
- /**
84
- * Readiness transition for a capability provider. Every producer emits
85
- * this event on `onInitialize` completion, `onDestroy`, and
86
- * `$node.reconnect`; every consumer that needs to gate on a cross-process
87
- * cap subscribes via the kernel's readiness module (`awaitReady` /
88
- * `onReadyState`) instead of polling. Payload is
89
- * `SystemReadyStatePayload` — see event-bus.ts.
90
- */
91
- EventCategory["SystemReadyState"] = "system.ready-state";
92
- EventCategory["AddonStarted"] = "addon.started";
93
- EventCategory["AddonStopped"] = "addon.stopped";
94
- EventCategory["AddonRestarted"] = "addon.restarted";
95
- EventCategory["AddonUpdated"] = "addon.updated";
96
- EventCategory["AddonInstalled"] = "addon.installed";
97
- EventCategory["AddonUninstalled"] = "addon.uninstalled";
98
- EventCategory["AddonCrashed"] = "addon.crashed";
99
- /**
100
- * A RUNNER the D6 crash circuit-breaker gave up on — terminal.
101
- *
102
- * `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
103
- * respawned"); this is the one that never resolves itself. Emitted exactly
104
- * once per trip, by `process-service.ts`, carrying the node, the runner, the
105
- * addons it hosted and the crash count that tripped the breaker.
106
- *
107
- * It exists because a runner marked terminally `failed` used to be SILENT:
108
- * on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
109
- * errors, the breaker stopped respawning it (correctly), `/health` kept
110
- * returning 200, and fleet-wide recording was gone for 3h15 before the
111
- * operator's phone told him. The Notification Center's system-event intake
112
- * consumes this category and maps it to the `addon-crash-loop` kind.
113
- */
114
- EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
115
- /**
116
- * A runner whose addon refused to start with a typed reason (D877) - parked
117
- * in `refused`, never counted by the crash breaker, retried on operator
118
- * action. One event per refusal.
119
- */
120
- EventCategory["AddonRunnerRefused"] = "addon.runner-refused";
121
- /**
122
- * A runner settled on a state (D877): `running` (READY), `crashed`, `failed` or
123
- * `refused`. In-process telemetry for the boot check (re-evaluate while any
124
- * runner is still pending) and the alert centre (close a recovered runner).
125
- */
126
- EventCategory["ProcessStateChanged"] = "process.state-changed";
127
- /**
128
- * The node's one-shot runner boot check (D877): planned runners against the
129
- * process service, `degraded` when any is failed, refused or missing. The
130
- * alert centre turns it into one critical alert.
131
- */
132
- EventCategory["SystemRunnerCheck"] = "system.runner-check";
133
- /**
134
- * An alert EPISODE opened or closed, emitted by the alert centre for alerts
135
- * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
136
- * centre sends no notification of its own: Notification Center turns this
137
- * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
138
- * system-event kinds, and reconciles from the alerts store because a bus
139
- * event may be dropped (D8, D11).
140
- */
141
- EventCategory["AlertEpisode"] = "alert.episode";
142
- EventCategory["AddonError"] = "addon.error";
143
- EventCategory["AddonPageReady"] = "addon.page-ready";
144
- EventCategory["AddonWidgetReady"] = "addon.widget-ready";
145
- /**
146
- * Addon failed to load (import or initialize). Emitted by the kernel's
147
- * AddonHealthMonitor only AFTER the boot grace period ends — failures
148
- * during the first 5 minutes are silently retried without alerting
149
- * (slow-starting addons must have time to come up). Post-grace, this
150
- * event is emitted exactly once per failure-streak; AlertCenter
151
- * consumes it to create a persistent operator-visible alert.
152
- *
153
- * Payload: `{ packageName, addonId?, error: { message, stack }, retryCount, nextRetryAt }`.
154
- */
155
- EventCategory["AddonLoadFailed"] = "addon.load-failed";
156
- /**
157
- * A keychain value was stored or removed (D787). Carries the ref, its
158
- * owner and the new version — NEVER the value. A process holding the ref
159
- * drops its cached copy and the owning `BaseAddon` re-resolves its config.
160
- * Telemetry (D8): a process that misses it still revalidates by version.
161
- */
162
- EventCategory["KeychainChanged"] = "keychain.changed";
163
- /**
164
- * Addon recovered from a previous failure. Emitted when an addon
165
- * transitions from `failed` back to `healthy` (typically via the
166
- * monitor's auto-retry loop, or after manual `addons.retryLoad`).
167
- * AlertCenter dismisses the corresponding `AddonLoadFailed` alert
168
- * on this event.
169
- */
170
- EventCategory["AddonLoadRecovered"] = "addon.load-recovered";
171
- /**
172
- * An addon is RUNNING although its installed package is below what the
173
- * running server requires (`camstack.requires.addons` of the server, or the
174
- * addon's own `requires.server`). Raised once per streak by the unsupported-
175
- * addon tracker, on the hub and on agents; AlertCenter turns it into one
176
- * operator alert per node and package. The addon is never held back for it.
177
- *
178
- * Payload: `{ packageName, addonId, nodeId, installedVersion, requiredMinimum, serverVersion, unmet }`.
179
- */
180
- EventCategory["AddonUnsupportedVersion"] = "addon.unsupported-version";
181
- /**
182
- * The package of an {@link AddonUnsupportedVersion} alert reached a supported
183
- * version, or is no longer installed on the node. AlertCenter dismisses the matching alert.
184
- *
185
- * Payload: `{ packageName, addonId, nodeId }`.
186
- */
187
- EventCategory["AddonUnsupportedResolved"] = "addon.unsupported-resolved";
188
- /**
189
- * Monitor scheduled the next retry for a failed addon. Transient —
190
- * surfaced to the UI for live-updating the "next retry in Ns"
191
- * countdown on the Addons page row, NOT persisted as an alert.
192
- */
193
- EventCategory["AddonRetryScheduled"] = "addon.retry-scheduled";
194
- /**
195
- * A liveness invariant of this node is false — it has no devices, every
196
- * camera is offline, or a camera that was recording has stopped producing
197
- * segments. Emitted by the `liveness-monitor` builtin, once per fault (the
198
- * `findingId` is stable across ticks), only after its boot grace period.
199
- * AlertCenter raises a persistent operator-visible alert.
200
- *
201
- * It exists because on 2026-08-03 the hub ran four hours with zero devices
202
- * and zero recordings while every surface stayed quiet.
203
- *
204
- * Payload: `{ findingId, severity, title, message, deviceId? }`.
205
- */
206
- EventCategory["SystemLivenessFailed"] = "system.liveness-failed";
207
- /**
208
- * A previously reported liveness fault is true again. AlertCenter dismisses
209
- * the matching `SystemLivenessFailed` alert.
210
- *
211
- * Payload: `{ findingId }`.
212
- */
213
- EventCategory["SystemLivenessRecovered"] = "system.liveness-recovered";
214
- /**
215
- * Monitor is attempting to reload a failed addon NOW. UI uses this
216
- * to show a spinner during the retry attempt. Same transient nature
217
- * as AddonRetryScheduled.
218
- */
219
- EventCategory["AddonRetryAttempting"] = "addon.retry-attempting";
220
- EventCategory["DeviceRegistered"] = "device.registered";
221
- EventCategory["DeviceUnregistered"] = "device.unregistered";
222
- EventCategory["DeviceEnabled"] = "device.enabled";
223
- EventCategory["DeviceDisabled"] = "device.disabled";
224
- EventCategory["DeviceSettingsUpdated"] = "device.settings-updated";
225
- /**
226
- * Emitted when the set of native capability providers bound to a device
227
- * changes — e.g. an addon registers a new native cap via
228
- * `DeviceContext.registerNativeCap`, or all native bindings for a device
229
- * are cleared on removal. Hub consumers re-resolve device-proxy routes
230
- * when this fires.
231
- */
232
- EventCategory["DeviceBindingsChanged"] = "device.bindings-changed";
233
- /**
234
- * Emitted when the operator-organisational meta surface changes
235
- * (`name` / `location` / `disabled`). Payload: `{deviceId, field,
236
- * value}`. Live consumers (UI device list, alert center) react
237
- * without polling. Distinct from `DeviceSettingsUpdated` which
238
- * fires on hardware-config changes (host/port/credentials/etc).
239
- */
240
- EventCategory["DeviceMetaChanged"] = "device.meta-changed";
241
- /**
242
- * Emitted by `BaseDevice.updateSourceInfo()` after a successful patch
243
- * to the device's upstream-system identity / rendering envelope. The
244
- * full new SourceInfo travels in the payload so cross-process listeners
245
- * (UI, export adapters) don't need to re-read the meta blob.
246
- *
247
- * Payload: `{deviceId, sourceInfo}`.
248
- *
249
- * Distinct from `DeviceMetaChanged` which covers the operator-edited
250
- * surface (`name` / `location` / `disabled`). The two share the
251
- * persistence layer (both ride on `device-manager.setMetadata` for
252
- * SourceInfo, or `setName`/`setLocation`/`setDisabled` for the meta
253
- * fields) but consumers care about different subsets.
254
- */
255
- EventCategory["DeviceSourceInfoChanged"] = "device.source-info-changed";
256
- /**
257
- * Emitted by DeviceStreamWiringService after a successful
258
- * `stream-broker.registerDeviceStreams` call. Payload includes
259
- * deviceId — consumers look up the full registered device info via
260
- * `brokerManager.getRegisteredDevice(deviceId)`.
261
- *
262
- * Replaces the legacy `StreamRouterService.onDeviceRegistered` callback.
263
- */
264
- EventCategory["DeviceStreamsRegistered"] = "device.streams-registered";
265
- /**
266
- * Device-level "fully provisioned" signal — the EXPORT trigger. Emitted once
267
- * a device's persisted export-relevant shape (its `DeviceFeature` set) is
268
- * established or changes, carrying `{deviceId, fingerprint, generation}`.
269
- * Export adapters (Alexa / HAP) react to THIS instead of the chatty per-cap
270
- * `DeviceBindingsChanged`, turning a boot's incomplete→complete trickle into
271
- * one clean delta. `fingerprint` is `canonicalDeviceFingerprint(shape)`.
272
- *
273
- * Spec: docs/superpowers/specs/2026-06-01-alexa-hap-export-reconciler-design.md
274
- */
275
- EventCategory["DeviceProvisioned"] = "device.provisioned";
276
- /**
277
- * Fires once when a device's initial feature-probe completes successfully
278
- * (lastProbedAt 0→>0); exported shape is now stable. Telemetry (may be
279
- * dropped) — consumers MUST also gate on the device record's `probed` flag.
280
- */
281
- EventCategory["DeviceReady"] = "device.ready";
282
- EventCategory["IntegrationEnabled"] = "integration.enabled";
283
- EventCategory["IntegrationDisabled"] = "integration.disabled";
284
- EventCategory["IntegrationDeleted"] = "integration.deleted";
285
- /** Emitted when a broker connection's status flips (connected /
286
- * disconnected / error). Carries `{ brokerId, status, error? }`. */
287
- EventCategory["BrokerStatusChanged"] = "broker.status-changed";
288
- /** Emitted for every subscription-matched message routed by a
289
- * broker provider. Carries `{ brokerId, subscriptionId, key, payload }`.
290
- * Consumers filter by `brokerId` + `subscriptionId` in the handler. */
291
- EventCategory["BrokerMessage"] = "broker.message";
292
- EventCategory["ProviderStarted"] = "provider.started";
293
- EventCategory["ProviderStopped"] = "provider.stopped";
294
- EventCategory["ProcessCrashed"] = "process.crashed";
295
- EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
296
- EventCategory["ProcessRestarted"] = "process.restarted";
297
- /**
298
- * The SET of storage locations changed — one was created, edited, enabled,
299
- * disabled or deleted through the location instances or the forced-delete action.
300
- *
301
- * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
302
- * it must also converge on its own periodic path, because a dropped event
303
- * must not leave a node writing to yesterday's disk set forever. It exists
304
- * because there was NO signal at all — an operator who added a second
305
- * recordings disk in the admin UI got nothing, and the recorder kept its
306
- * resolved locations until something else happened to re-resolve them
307
- * (D387). Payload `StorageLocationsChangedPayload`.
308
- */
309
- EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
310
- EventCategory["RecordingStarted"] = "recording.started";
311
- EventCategory["RecordingStopped"] = "recording.stopped";
312
- EventCategory["RecordingError"] = "recording.error";
313
- EventCategory["RecordingHealthDegraded"] = "recording.health.degraded";
314
- /** Recording enabled but no segment finalized for the NC stall window. */
315
- EventCategory["RecordingHealthStalled"] = "recording.health.stalled";
316
- /** Recovery from {@link RecordingHealthStalled}. */
317
- EventCategory["RecordingHealthOk"] = "recording.health.ok";
318
- EventCategory["RecordingStorageCritical"] = "recording.storage.critical";
319
- /** Free space on a storage location crossed the warn bar. */
320
- EventCategory["StorageLocationLow"] = "storage.location.low";
321
- /** Free space at/under the critical bar, or capacity probe failed (`null`). */
322
- EventCategory["StorageLocationCritical"] = "storage.location.critical";
323
- /** Recovery from low/critical on a storage location. */
324
- EventCategory["StorageLocationOk"] = "storage.location.ok";
325
- EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
326
- EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
327
- EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
328
- /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
329
- * progress bar the client reconciles via `recordingExport.getExport`. */
330
- EventCategory["RecordingExportProgress"] = "recording.export.progress";
331
- EventCategory["RecordingExportCompleted"] = "recording.export.completed";
332
- EventCategory["RecordingExportFailed"] = "recording.export.failed";
333
- EventCategory["DetectionEvent"] = "detection.event";
334
- EventCategory["SessionTrackNew"] = "session.track.new";
335
- EventCategory["SessionTrackExpired"] = "session.track.expired";
336
- EventCategory["BenchmarkProgress"] = "benchmark.progress";
337
- EventCategory["PlatformProbePhase"] = "platform-probe.phase";
338
- EventCategory["PipelineProgress"] = "pipeline.progress";
339
- /** Per-frame execution trace emitted by the pipeline executor for live observability. */
340
- EventCategory["PipelineTrace"] = "pipeline.trace";
341
- /**
342
- * Raw inference output emitted by `addon-pipeline-runner` after running the
343
- * detection pipeline on a frame. Carries the `FrameResult` (with
344
- * `detections[]`, `width`/`height`, timing debug) — never the frame
345
- * buffer itself. Hub-side consumers (analysis pipeline, class filters,
346
- * notifications) subscribe to this and re-emit `detection.result` after
347
- * post-processing.
348
- */
349
- EventCategory["PipelineInferenceResult"] = "pipeline.inference-result";
350
- /**
351
- * Camera lifecycle event emitted by `addon-pipeline-orchestrator` when it
352
- * assigns or unassigns a camera to/from an agent. Carries no frame data;
353
- * pure observability for UI dashboards and metrics consumers.
354
- */
355
- EventCategory["PipelineCameraAssigned"] = "pipeline.camera-assigned";
356
- EventCategory["PipelineCameraUnassigned"] = "pipeline.camera-unassigned";
357
- /**
358
- * A node the orchestrator would otherwise place cameras on has NO usable
359
- * inference device: the operator enabled one or more accelerators there and
360
- * the live probe reports every one of them unavailable. Emitted once per
361
- * TRANSITION into that state (never per dispatch), and the node is dropped
362
- * from the placement candidate set for as long as it holds.
363
- *
364
- * This exists because the state was previously invisible: agent-a
365
- * absorbed 283k inference errors in a day while still being handed cameras,
366
- * and nothing in the system said so.
367
- *
368
- * A node with no accelerators configured at all is NOT this — its devices
369
- * are `disabled`, not `unavailable`, and the runner's default CPU pool
370
- * serves it exactly as before.
371
- */
372
- EventCategory["PipelineNodeInferenceUnavailable"] = "pipeline.node-inference-unavailable";
373
- /**
374
- * A camera has an OPEN detection session and has produced no detection at
375
- * all for longer than the blind threshold — the camera is being decoded and
376
- * inferred and is returning nothing. Emitted once per transition into blind,
377
- * per camera.
378
- *
379
- * The failure it reports: a 1h43 detection blackout on the entrance camera
380
- * that nobody noticed, because "a camera that detects nothing" and "a quiet
381
- * camera" produce byte-identical silence.
382
- */
383
- EventCategory["PipelineDetectionBlind"] = "pipeline.detection-blind";
384
- /**
385
- * A camera's motion source has fired constantly with no subject for an hour
386
- * (motion duty or session count over the bar, zero detections) — it is not
387
- * blind, its motion zones or sensitivity want tuning (D907). Paired with
388
- * {@link PipelineMotionCalm}.
389
- */
390
- EventCategory["PipelineMotionNoisy"] = "pipeline.motion-noisy";
391
- /** The recovery edge of {@link PipelineMotionNoisy}: the motion fell back, or a detection arrived. */
392
- EventCategory["PipelineMotionCalm"] = "pipeline.motion-calm";
393
- /**
394
- * A camera's package LLM confirm has failed closed three times in a row
395
- * (D931, 2026-10-26). One edge per camera until
396
- * {@link PipelinePackageLlmAnswered}.
397
- */
398
- EventCategory["PipelinePackageLlmSilent"] = "pipeline.package-llm-silent";
399
- /** The recovery edge of {@link PipelinePackageLlmSilent}: a confirm returned yes or no. */
400
- EventCategory["PipelinePackageLlmAnswered"] = "pipeline.package-llm-answered";
401
- /**
402
- * Per-camera pipeline config was mutated by the orchestrator
403
- * (a settings change via `setAgentInferenceDevices` /
404
- * `setCameraStepToggle` / `setCameraStepSettings`). Orchestrator
405
- * subscribes to its own emission to hot-reload the assigned runner
406
- * via `attachCamera` so the next frame executes against the new
407
- * engine/steps without waiting for a rebalance or the next
408
- * `DeviceStreamsRegistered` cycle.
409
- */
410
- EventCategory["PipelineCameraUpdated"] = "pipeline.camera-updated";
411
- /**
412
- * The cluster camera-source OWNER changed (`clusterRoles.ingestNode`).
413
- * Emitted by addon-pipeline-orchestrator whenever it (re)derives node
414
- * capabilities — at boot, on agent online/offline, and on an ingest-node
415
- * flip. Carries the resolved `ownerNodeId`. The stream-broker consumes it to
416
- * keep its ingest-owner-gate decision current WITHOUT a per-`ensureBroker`
417
- * cross-process `getIngestOwner` query (push the authority's decision instead
418
- * of polling it on the hot path). Idempotent state — re-emitted on every
419
- * topology change, so a dropped event self-heals on the next one (plus the
420
- * broker's long backstop reconcile query).
421
- */
422
- EventCategory["PipelineIngestOwnerChanged"] = "pipeline.ingest-owner-changed";
423
- /**
424
- * Periodic snapshot of per-node pipeline-runner load
425
- * (`RunnerLocalLoad`). Emitted ~1Hz by every runner so UI dashboards
426
- * subscribe instead of polling `pipelineRunner.getLocalLoad`.
427
- * `nodeId` carried in the payload + on `event.source.nodeId`.
428
- */
429
- EventCategory["PipelineRunnerLoadSnapshot"] = "pipeline.runner-load-snapshot";
430
- /**
431
- * Periodic snapshot of per-camera pipeline metrics (`CameraMetrics`
432
- * + `deviceId` + `nodeId`). Emitted ~1Hz by every runner for each
433
- * attached camera. UI subscribes to drive overlay phase / fps /
434
- * inference time without polling `getCameraMetrics`.
435
- */
436
- EventCategory["PipelineCameraMetricsSnapshot"] = "pipeline.camera-metrics-snapshot";
437
- /**
438
- * Periodic snapshot of stream-broker per-broker statistics (input
439
- * fps, decoded fps, bitrate, codec). Emitted ~1Hz by every
440
- * stream-broker process for each active broker so the UI can drive
441
- * the Stream / Cluster dashboards without polling
442
- * `streamBroker.listAllProfileSlots` and friends.
443
- */
444
- EventCategory["StreamBrokerMetricsSnapshot"] = "stream-broker.metrics-snapshot";
445
- /**
446
- * Cap event fired by `stream-broker` when a profile slot enters
447
- * "demanded" state — a cam stream has been assigned and at least one
448
- * consumer (RTSP restream, decoded subscriber, WebRTC session, …) is
449
- * present. Camera-provider addons (Reolink Baichuan push, …)
450
- * subscribe to this category to start their underlying transport
451
- * lazily. Payload: `{ deviceId, camStreamId, profile }`.
452
- */
453
- EventCategory["StreamBrokerOnCamStreamDemand"] = "stream-broker.onCamStreamDemand";
454
- /**
455
- * Cap event fired by `stream-broker` when the last consumer leaves a
456
- * previously-demanded cam stream. Providers tear down their
457
- * underlying transport on receipt. Payload: `{ deviceId, camStreamId }`.
458
- */
459
- EventCategory["StreamBrokerOnCamStreamIdle"] = "stream-broker.onCamStreamIdle";
460
- /**
461
- * Cap event fired by `stream-broker` when a broker fails to dial a
462
- * managed-loopback source (today: `pull-rfc4571`) and the publisher
463
- * needs to refresh the cached URL. The lib's TCP server idle-tears-down
464
- * on its own schedule, so a re-publish with a fresh `host:port` is the
465
- * only way to keep the broker dialable. Camera providers (Reolink
466
- * Baichuan native, …) subscribe and respond by re-running their publish
467
- * pipeline.
468
- * Payload: `{ deviceId, camStreamId, brokerId }`.
469
- */
470
- EventCategory["StreamBrokerOnRequestStreamSourceRefresh"] = "stream-broker.onRequestStreamSourceRefresh";
471
- /**
472
- * A camera provider changed a device's stream parameters (codec /
473
- * resolution / bitrate / a stream added or removed). A LOW-LATENCY NUDGE
474
- * for the stream-broker's catalog reconcile: it carries NO authoritative
475
- * data — the broker re-PULLS that device's `stream-catalog` cap on receipt
476
- * (the 30s reconcile poll is the backstop if this nudge is dropped). Emitted
477
- * by providers from `stream-params.setProfile`. Payload: `{ deviceId }`.
478
- */
479
- EventCategory["StreamParamsChanged"] = "stream-params.changed";
480
- /**
481
- * Generic per-device runtime-state change. Fired by `device-manager`
482
- * whenever a persisted slice in any cap's `runtimeState` shape
483
- * mutates. Payload: `{deviceId, capName, slice}`. Subscribers are
484
- * the `deviceState` cap router (cross-process listeners) and the
485
- * deviceProxy reactive bindings (`device.state.<capName>.value`).
486
- * Cap-specific events (`battery.onStatusChanged`, …) still fire
487
- * — they're authoritative for callers that want a typed payload
488
- * without filtering on `capName`.
489
- */
490
- EventCategory["DeviceStateChanged"] = "device.state-changed";
491
- /**
492
- * The NATIVE shadow of a cap a composition has claimed fields of moved
493
- * (D663). Payload: `{ deviceId, capName, native }` — what the provider
494
- * wrote, BEFORE the owned fields are overlaid. Owner-only (D224): it is for
495
- * the composer's native self-reads, and the public event routers refuse it
496
- * (`isOwnerOnlyEventCategory`) so no consumer surface ever shows a second
497
- * truth beside the merged `DeviceStateChanged.slice`. Emitted only under a
498
- * `replace` claim, one per native write of that cap.
499
- */
500
- EventCategory["DeviceNativeShadowChanged"] = "device.native-shadow-changed";
501
- /**
502
- * Frame occupancy for a camera CHANGED — a tracked object was gained or
503
- * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
504
- *
505
- * Emitted only on a change, so a steady scene is silent. It exists so a
506
- * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
507
- * one live badge with no push signal at all, and it cost a request every
508
- * four seconds per visible camera.
509
- *
510
- * Like every event it is telemetry and may be dropped ([D8]) — a consumer
511
- * keeps a slow reconcile rather than trusting it alone.
512
- */
513
- EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
514
- /**
515
- * Cap event fired by every device that registers the `battery`
516
- * capability. Mirrors the cap definition's `onStatusChanged`. Carries
517
- * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
518
- * snapshot wrapper, UI) react to charge/sleep transitions without
519
- * polling `batteryCapability.getStatus`.
520
- */
521
- EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
522
- /**
523
- * Cap event fired by every device that registers the `network-link`
524
- * capability. Mirrors the cap definition's `onStatusChanged`. Carries
525
- * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
526
- * reading that moved.
527
- */
528
- EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
529
- /**
530
- * Emitted by the battery cap provider WHEN `wakeForStream` enters the
531
- * "wake in progress" window — between the Baichuan wake-up issue and
532
- * the camera's first dialed-back RTP packet. The stream-broker
533
- * manager subscribes to flip the per-broker placeholder reason to
534
- * `'waking'` so viewers see a labelled "WAKING UP" tile instead of
535
- * the generic `'reconnecting'` frame. Carries `{ deviceId }`. The
536
- * complementary "wake complete" signal is the existing
537
- * `BatteryOnStatusChanged { sleeping: false }` event.
538
- */
539
- EventCategory["BatteryOnWakeStarted"] = "battery.onWakeStarted";
540
- /**
541
- * Cap event fired by every device that registers the `doorbell`
542
- * capability. Mirrors `doorbellCapability.events.onPressed`. Carries
543
- * `{ deviceId, timestamp }`. Operators consuming the UI subscribe
544
- * here to render transient ring toasts and a "Recent presses" row
545
- * on the device detail page.
546
- */
547
- EventCategory["DoorbellOnPressed"] = "doorbell.onPressed";
548
- /** Mirrors `runningStateCapability.events.onStarted`. */
549
- EventCategory["RunningStarted"] = "running.started";
550
- /** Mirrors `runningStateCapability.events.onFinished`. */
551
- EventCategory["RunningFinished"] = "running.finished";
552
- /** Mirrors `deviceRunsCapability.events.onRunOpened` - a durable run record opened. */
553
- EventCategory["DeviceRunOpened"] = "device-run.opened";
554
- /** Mirrors `deviceRunsCapability.events.onRunClosed` - a durable run record closed. */
555
- EventCategory["DeviceRunClosed"] = "device-run.closed";
556
- /**
557
- * Cap event fired by every device that registers the `event-emitter`
558
- * capability. Mirrors `eventEmitterCapability.events.onEvent`. Carries
559
- * `{ deviceId, eventType, data, timestamp, seq }` — the device's EXACT
560
- * declared event verbatim (NO normalization). Subscribers (UI event
561
- * stream, advanced-notifier rules) react to fired events without
562
- * holding a cap reference.
563
- */
564
- EventCategory["EventEmitted"] = "event-emitter.event";
565
- /**
566
- * Periodic snapshot of the per-node detection-pipeline engine
567
- * registry (loaded engines, models resident, in-use cameras, idle
568
- * TTL). Emitted ~0.2Hz (every 5 s) by every detection-pipeline
569
- * process. The Engines tab subscribes to drive its inventory view
570
- * without polling `pipelineExecutor.listLoadedEngines`.
571
- */
572
- EventCategory["PipelineEngineMetricsSnapshot"] = "pipeline.engine-metrics-snapshot";
573
- /**
574
- * Per-node detection-engine runtime-provisioning transition. Emitted by
575
- * the detection-pipeline provider on every state change of its lazy
576
- * engine-provisioning machine (idle → installing → verifying → ready,
577
- * or → failed with a `nextRetryAt`). Payload is the
578
- * `EngineProvisioningState` snapshot; `event.source.nodeId` carries the
579
- * node. The Pipeline page subscribes to drive a live "installing
580
- * OpenVINO… / ready" indicator per node without polling
581
- * `pipelineExecutor.getEngineProvisioning`. Telemetry-grade (D8): the UI
582
- * also reads the cap snapshot on mount / reconnect. Phase 2.
583
- */
584
- EventCategory["PipelineEngineProvisioning"] = "pipeline.engine-provisioning";
585
- /**
586
- * Cluster topology snapshot. Carries the same payload returned by
587
- * `nodes.topology` (every reachable node + addons + processes).
588
- * Emitted by the hub on any agent / addon lifecycle change
589
- * (debounced) plus a periodic safety net. Replaces UI polling on
590
- * `nodes.topology` — admin-ui dashboards subscribe to drive the
591
- * cluster view directly from the event payload.
592
- */
593
- EventCategory["ClusterTopologySnapshot"] = "cluster.topology-snapshot";
594
- /**
595
- * Periodic per-node system metrics snapshot (CPU / memory / GPU /
596
- * disk / network). Emitted ~0.2 Hz by the metrics-provider addon
597
- * for each node. Drives the dashboard SystemStatus / ProcessResources
598
- * widgets without polling `metricsProvider.getCurrent`.
599
- */
600
- EventCategory["MetricsNodeResourcesSnapshot"] = "metrics.node-resources-snapshot";
601
- /**
602
- * Periodic per-node process-tree snapshot (camstack-related pids
603
- * with root / managed / system classification). Emitted ~0.2 Hz by
604
- * the metrics-provider addon. Drives the Cluster → Processes tab
605
- * without polling `metricsProvider.listNodeProcesses`.
606
- */
607
- EventCategory["MetricsNodeProcessesSnapshot"] = "metrics.node-processes-snapshot";
608
- /**
609
- * Capability binding change event emitted by `addon-pipeline-orchestrator`
610
- * when a user changes which addon implements a cap on a node. Subscribed
611
- * by every kernel process to update its local `preferredProviderRegistry`
612
- * so future capability lookups respect the new binding.
613
- */
614
- /**
615
- * A capability binding was changed for a node — addon X now provides
616
- * capability `cap` on node `nodeId`. Lives under the generic
617
- * `capability.*` namespace because capability bindings are a kernel-
618
- * level concept used by many addons, not strictly pipeline-scoped.
619
- */
620
- EventCategory["CapabilityBindingChanged"] = "capability.binding-changed";
621
- EventCategory["ModelDownloadProgress"] = "model.download.progress";
622
- EventCategory["AgentRegistered"] = "agent.registered";
623
- EventCategory["AgentUnregistered"] = "agent.unregistered";
624
- EventCategory["AgentOnline"] = "agent.online";
625
- EventCategory["AgentOffline"] = "agent.offline";
626
- /** Forked worker process (e.g. hub/pipeline) connected to the broker. */
627
- EventCategory["WorkerOnline"] = "worker.online";
628
- /** Forked worker process disconnected from the broker. */
629
- EventCategory["WorkerOffline"] = "worker.offline";
630
- EventCategory["AgentTaskDispatched"] = "agent.task.dispatched";
631
- EventCategory["AgentTaskAssigned"] = "agent.task.assigned";
632
- EventCategory["AgentTrpcConnected"] = "agent.trpc.connected";
633
- EventCategory["AgentWsConnected"] = "agent.ws.connected";
634
- EventCategory["AgentWsDisconnected"] = "agent.ws.disconnected";
635
- EventCategory["AgentBackupActivated"] = "agent.backup.activated";
636
- EventCategory["OrchestrationSettingsUpdated"] = "orchestration.settings-updated";
637
- EventCategory["MotionAnalysis"] = "detection.motion-analysis";
638
- /** All raw motion zones from CCL before minArea filter — for UI debug overlay. */
639
- EventCategory["MotionZonesRaw"] = "detection.motion-zones-raw";
640
- /**
641
- * Per-camera motion phase transition (`watching ↔ active`) emitted
642
- * by the runner. Mirrors the `motion.onMotionChanged` cap event
643
- * surface — payload `MotionOnMotionChangedPayload` carries
644
- * `{deviceId, detected, timestamp, source, regions?}`. Subscribers
645
- * include addons that need to react to motion state without
646
- * polling the runtime-state mirror.
647
- */
648
- EventCategory["MotionOnMotionChanged"] = "motion.on-motion-changed";
649
- EventCategory["DetectionResult"] = "detection.result";
650
- EventCategory["DetectionRaw"] = "detection.raw";
651
- EventCategory["DetectionCameraNative"] = "detection.camera-native";
652
- /**
653
- * Canonical per-chunk live audio pipeline output. Payload is
654
- * `PipelineAudioInferenceResultPayload` carrying a full `AudioResult`
655
- * (level + detections + debug). Lives on the pipeline.* namespace
656
- * alongside `pipeline.inference-result` (video) for symmetry.
657
- */
658
- EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
659
- EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
660
- /**
661
- * A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
662
- * data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
663
- * consumer is the orchestrator's camera-sensors bridge, which re-emits the
664
- * camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
665
- * for a camera with no attached sensor). Providers must not emit
666
- * `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
667
- * keeps it so (camera-grid is a named, deferred exception).
668
- */
669
- EventCategory["ProviderMotion"] = "provider.motion";
670
- EventCategory["ProviderDetection"] = "provider.detection";
671
- EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
672
- EventCategory["EnrichmentSceneStateChanged"] = "enrichment.scene.state-changed";
673
- EventCategory["EnrichmentActivitySummary"] = "enrichment.activity.summary";
674
- /**
675
- * Unified track-lifecycle event: ONE category carrying `phase:
676
- * 'start' | 'update' | 'end'` with a rich, typed
677
- * `PipelineAnalyticsTrackLifecyclePayload`. Supersedes the thin
678
- * `PipelineAnalyticsTrackStarted` / `PipelineAnalyticsTrackEnded`
679
- * pair — a consumer subscribes once and branches on `phase`.
680
- */
681
- EventCategory["PipelineAnalyticsTrackLifecycle"] = "pipeline-analytics.track-lifecycle";
682
- /**
683
- * @deprecated Superseded by {@link PipelineAnalyticsTrackLifecycle}
684
- * (`phase:'start'`). Kept as a soft alias — no known subscribers.
685
- */
686
- EventCategory["PipelineAnalyticsTrackStarted"] = "pipeline-analytics.track-started";
687
- /**
688
- * @deprecated Superseded by {@link PipelineAnalyticsTrackLifecycle}
689
- * (`phase:'end'`). Kept as a soft alias — no known subscribers.
690
- */
691
- EventCategory["PipelineAnalyticsTrackEnded"] = "pipeline-analytics.track-ended";
692
- EventCategory["PipelineAnalyticsDetectionEvent"] = "pipeline-analytics.detection-event";
693
- EventCategory["PipelineAnalyticsFrameTracked"] = "pipeline-analytics.frame-tracked";
694
- /**
695
- * Fired by `addon-post-analysis` when a parked (stationary) object appears
696
- * (a track was promoted to a stationary-registry entry) or departs (the
697
- * object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
698
- * the dedicated "Stationary" section — never the live event feed. Payload:
699
- * `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
700
- */
701
- EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
702
- /**
703
- * Fired by `addon-post-analysis` when a package-drop is confirmed inside
704
- * a package zone — a newly-appeared stationary object of a package class
705
- * that cleared the class / zone / dwell / size gates. Payload:
706
- * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
707
- * entryId, className, zoneIds, keyFrameMediaId?, bbox, timestamp }`.
708
- * Telemetry (D8): the durable record is the `package-events` store row;
709
- * this bus topic drives notifier rules + live UI. See
710
- * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
711
- */
712
- EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
713
- /**
714
- * Fired by `addon-post-analysis` when a previously-delivered package
715
- * leaves its zone (the stationary entry departed — moved or swept).
716
- * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
717
- * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
718
- * Telemetry (D8). See package-zones-design §5.2.
719
- */
720
- EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
721
- /**
722
- * Fired by `addon-post-analysis` whenever a gallery face row changes:
723
- * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
724
- * `'unassigned'` its identity link changed, `'deleted'` the row was
725
- * removed. Telemetry semantics (D8): a lost event only delays a refresh,
726
- * never a correctness issue. Payload `PipelineAnalyticsFaceGalleryChangedPayload`.
727
- */
728
- EventCategory["PipelineAnalyticsFaceGalleryChanged"] = "pipeline-analytics.face-gallery-changed";
729
- /**
730
- * Fired by `addon-post-analysis` whenever a gallery plate row changes:
731
- * `kind:'buffered'` a new read was persisted (`PlateRecognizer.onTrackEnd`),
732
- * `'assigned'` / `'unassigned'` its vehicle link changed
733
- * (`PlateGalleryProvider`), `'deleted'` the row was removed. Telemetry
734
- * semantics (D8): a lost event only delays a refresh, never a correctness
735
- * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
736
- */
737
- EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
738
- EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
739
- /**
740
- * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
741
- * `stream.offline` fires after STREAM_STALE_TIMEOUT_MS without an encoded
742
- * packet on an active broker. `stream.online` fires on first packet
743
- * after a stale gap (or on initial first packet). Payload includes
744
- * the assigned camStreamId as `profileKey`.
745
- */
746
- EventCategory["StreamOnline"] = "stream.online";
747
- EventCategory["StreamOffline"] = "stream.offline";
748
- EventCategory["NetworkTunnelStarted"] = "network.tunnel.started";
749
- EventCategory["NetworkTunnelStopped"] = "network.tunnel.stopped";
750
- /** Fired by the `local-network` cap when the host's interface set
751
- * changes (new IP from DHCP, VPN connect, docker bridge added). */
752
- EventCategory["LocalNetworkChanged"] = "network.local.changed";
753
- /**
754
- * Fired by a `mesh-network` provider (Tailscale, …) when its
755
- * mesh-reachable host changes (join / leave / MagicDNS or 100.x IP
756
- * change). Lets `local-network` fold the mesh endpoint into its
757
- * connection-endpoint list without a cross-package import. Payload
758
- * carries the preferred host (`host: ''` = no longer reachable),
759
- * the hub port, and the scheme. Telemetry-grade (D8): consumers
760
- * pull-reconcile from the provider's `getStatus` on reconnect. */
761
- EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
762
- EventCategory["BackupCompleted"] = "backup.completed";
763
- /**
764
- * A whole backup RUN finished — every destination attempted, win or lose.
765
- *
766
- * `backup.completed` fires once per DESTINATION, which is the right grain for
767
- * a progress UI and the wrong one for a notification: an operator with three
768
- * destinations would be told three times. And a run where two of three
769
- * destinations succeeded is not a clean success — a single "backup
770
- * completed" that hid the failed one would be a lie, so the count of each is
771
- * carried here and the message says both.
772
- *
773
- * Emitted by the backup orchestrator only after the destination loop, so a
774
- * run that dies during the BUILD phase produces no completion at all.
775
- */
776
- EventCategory["BackupRunCompleted"] = "backup.run-completed";
777
- EventCategory["BackupRestored"] = "backup.restored";
778
- EventCategory["NotificationDispatched"] = "notification.dispatched";
779
- EventCategory["NotificationFailed"] = "notification.failed";
780
- /**
781
- * A notification rule that cannot work (D905): its stored row does not load,
782
- * or it still names a device / delivery target the prune CONFIRMED deleted.
783
- * One edge per rule per distinct set of reasons; never on an unanswered read.
784
- */
785
- EventCategory["NotificationRuleBroken"] = "notification.rule-broken";
786
- /** The clear of {@link NotificationRuleBroken}: the rule loads and names nothing deleted. */
787
- EventCategory["NotificationRuleRepaired"] = "notification.rule-repaired";
788
- /** A migration failed or was blocked; the Alert Center re-reads the ledger. */
789
- EventCategory["MigrationFailed"] = "migration.failed";
790
- /** A migration applied or a failure cleared; the Alert Center re-reads the ledger. */
791
- EventCategory["MigrationApplied"] = "migration.applied";
792
- EventCategory["DeviceUpdated"] = "device.updated";
793
- /**
794
- * Transport-level connectivity. Emitted by the device driver when
795
- * the underlying control socket actually connects / disconnects
796
- * (Baichuan TCP, ONVIF probe response, RTSP DESCRIBE, …) — NOT for
797
- * power-state transitions on a battery camera. For battery wake /
798
- * doze cycles see `DeviceAwake` / `DeviceSleeping`.
799
- */
800
- EventCategory["DeviceOnline"] = "device.online";
801
- /**
802
- * Stream-broker watchdog — emitted when no encoded packet has been
803
- * received for STREAM_STALE_TIMEOUT_MS on an active broker (rtsp or
804
- * push). Paired with DeviceOnline which fires on first packet after
805
- * a stale gap. Payload: DeviceStreamHealthPayload.
806
- */
807
- EventCategory["DeviceOffline"] = "device.offline";
808
- /**
809
- * Battery cam woke up — physical power-state transition reported
810
- * by the device firmware. Distinct from `DeviceOnline` so a UI panel
811
- * watching power state doesn't flap on every UDP socket reconnect.
812
- */
813
- EventCategory["DeviceAwake"] = "device.awake";
814
- /**
815
- * Battery cam went to sleep. See `DeviceAwake`.
816
- */
817
- EventCategory["DeviceSleeping"] = "device.sleeping";
818
- EventCategory["RetentionCleanup"] = "retention.cleanup";
819
- /**
820
- * Legacy bulk-update progress snapshot (payload `BulkUpdateState`). No longer
821
- * emitted — F3 removed the coordinator that produced it; "Update all" now runs
822
- * as one lifecycle engine job (`AddonsJobProgress`/`AddonsJobLog`). Retained
823
- * (with `BulkUpdateState`) only to avoid regenerating the event maps; removed
824
- * in F4 once live bulk progress is re-implemented over the engine events.
825
- */
826
- EventCategory["AddonsBulkUpdateProgress"] = "addons.bulk-update-progress";
827
- EventCategory["AddonsJobProgress"] = "addons.job-progress";
828
- EventCategory["AddonsJobLog"] = "addons.job-log";
829
- /**
830
- * A container's child visibility toggled (hidden/shown). Emitted by the
831
- * `accessories` cap when a child device is hidden or revealed.
832
- * Payload: `{ deviceId, childDeviceId, hidden }`.
833
- */
834
- EventCategory["AccessoriesChildVisibilityChanged"] = "accessories.onChildVisibilityChanged";
835
- /**
836
- * A container's child set changed (children added/removed/reordered).
837
- * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
838
- */
839
- EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
840
- /**
841
- * An action run started or ended. Emitted by the `actions` surface.
842
- * Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
843
- */
844
- EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
845
- /**
846
- * Progress update from a running model conversion job.
847
- * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
848
- * Emitted by `addon-model-studio` on the converting node.
849
- */
850
- EventCategory["ModelConvertProgress"] = "model-convert.progress";
851
- return EventCategory;
852
- }({});
853
- //#endregion
854
- //#region ../types/dist/device-type-D1fH5kaC.mjs
855
- /**
856
- import { errMsg } from '@camstack/types'
857
- * Extract a human-readable message from an unknown error value.
858
- * Replaces the ubiquitous `errMsg(err)` pattern.
859
- */
860
- function errMsg(err) {
861
- if (err instanceof Error) return err.message;
862
- if (typeof err === "string") return err;
863
- return String(err);
864
- }
865
- var DeviceType = /* @__PURE__ */ function(DeviceType) {
866
- DeviceType["Camera"] = "camera";
867
- DeviceType["Hub"] = "hub";
868
- DeviceType["Light"] = "light";
869
- DeviceType["Siren"] = "siren";
870
- DeviceType["Switch"] = "switch";
871
- DeviceType["Sensor"] = "sensor";
872
- DeviceType["Thermostat"] = "thermostat";
873
- /** Air-conditioner / heat-pump climate device (HVAC) — shares the
874
- * `climate-control` cap surface with `Thermostat` but renders a
875
- * dedicated AC-appropriate control UI (mode chips, fan speed,
876
- * independent vertical/horizontal swing). Sources: native Gree, and
877
- * reusable by other AC integrations. */
878
- DeviceType["Climate"] = "climate";
879
- DeviceType["Button"] = "button";
880
- /** Generic stateless event emitter — carries a device's EXACT declared
881
- * event vocabulary verbatim (no normalization). Installed with the
882
- * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
883
- * HA bus events (e.g. `zha_event`, generic). */
884
- DeviceType["EventEmitter"] = "event-emitter";
885
- /** Firmware/software update entity — current vs available version,
886
- * updatable flag, update state, and an install action. Installed with
887
- * the `update` cap. Sources: Homematic firmware-update channels (and
888
- * reusable by other providers, e.g. HA `update.*` entities). */
889
- DeviceType["Update"] = "update";
890
- DeviceType["Generic"] = "generic";
891
- /** Generic notification delivery target (HA `notify.<service>`, future
892
- * Telegram / Discord / ntfy / SMTP, …). One device per delivery
893
- * endpoint; the `notifier` cap defines the send surface. */
894
- DeviceType["Notifier"] = "notifier";
895
- /** Pre-recorded action sequence with optional parameters
896
- * (HA `script.*`). Runnable via `script-runner` cap. */
897
- DeviceType["Script"] = "script";
898
- /** Automation rule (HA `automation.*`) — enable/disable + manual
899
- * trigger surface exposed via `automation-control` cap. */
900
- DeviceType["Automation"] = "automation";
901
- /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
902
- DeviceType["Lock"] = "lock";
903
- /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
904
- * `valve.*`). `cover` cap with sub-roles for variant. */
905
- DeviceType["Cover"] = "cover";
906
- /** Pipe / water / gas valve with open/close/stop and optional
907
- * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
908
- * modelled on the same open/closed lifecycle. */
909
- DeviceType["Valve"] = "valve";
910
- /** Humidifier / dehumidifier with on/off + target humidity + mode
911
- * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
912
- * modelled on the same target / mode lifecycle. */
913
- DeviceType["Humidifier"] = "humidifier";
914
- /** Water heater / boiler with target temperature + operation mode +
915
- * away mode (HA `water_heater.*`). `water-heater` cap — a
916
- * climate-family actuator. */
917
- DeviceType["WaterHeater"] = "water-heater";
918
- /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
919
- DeviceType["Fan"] = "fan";
920
- /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
921
- * the camera surface — those use `Camera`. `media-player` cap. */
922
- DeviceType["MediaPlayer"] = "media-player";
923
- /** Security panel / alarm system (HA `alarm_control_panel.*`).
924
- * `alarm-panel` cap. */
925
- DeviceType["AlarmPanel"] = "alarm-panel";
926
- /** Generic user-settable input (HA `number` / `input_number` / `select`
927
- * / `input_select` / `text` / `input_text` / `input_datetime`).
928
- * Sub-type via `DeviceRole`: NumericControl / SelectControl /
929
- * TextControl / DateTimeControl. */
930
- DeviceType["Control"] = "control";
931
- /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
932
- * `presence` cap. */
933
- DeviceType["Presence"] = "presence";
934
- /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
935
- * `weather` cap. */
936
- DeviceType["Weather"] = "weather";
937
- /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
938
- DeviceType["Vacuum"] = "vacuum";
939
- /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
940
- * `lawn-mower-control` cap. */
941
- DeviceType["LawnMower"] = "lawn-mower";
942
- /** Physical HA device group — parent container for entity-children
943
- * adopted from a single HA device entry. Not renderable as a
944
- * standalone device; exists only to anchor child entities. */
945
- DeviceType["Container"] = "container";
946
- /** Single still-image entity (HA `image.*`). Read-only display of an
947
- * `entity_picture` signed URL the browser loads directly. `image` cap. */
948
- DeviceType["Image"] = "image";
949
- /** Smart pet feeder — cloud-connected food dispenser with a bowl food
950
- * level, battery, desiccant life, feeding state and manual-feed /
951
- * call-pet / maintenance actions. Installed with the `pet-feeder` cap;
952
- * dual-hopper models (D4S/D4SH) expose per-hopper portions. Sources:
953
- * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
954
- * integrations sharing the same food/desiccant/hopper surface. */
955
- DeviceType["PetFeeder"] = "pet-feeder";
956
- /** Pet water fountain — tank level, water drunk, pump and its duty cycle.
957
- * Installed with the `pet-fountain` cap. Reaches CamStack as loose entities
958
- * of a container and is BUILT as a composed device (D967). */
959
- DeviceType["PetFountain"] = "pet-fountain";
960
- /** Built-in dishwasher — program lifecycle, door / remote-start gates,
961
- * salt and rinse-aid levels. Installed with the `dishwasher` cap.
962
- * Sources: native Bosch Home Connect, reusable by similar integrations.
963
- * A plug-built dishwasher carries running-state and power instead. */
964
- DeviceType["Dishwasher"] = "dishwasher";
965
- /** Washing machine. A plug-built one is running while its power stays
966
- * above a threshold. No program cap — that surface is the dishwasher's. */
967
- DeviceType["Washer"] = "washer";
968
- /** A dumb plug-in stove or heater: a switch (and, with a meter, a power
969
- * reading) that only runs while the plug is on. Built from a smart plug;
970
- * the `timed-run` cap switches it off again after a chosen time. */
971
- DeviceType["Heater"] = "heater";
972
- /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
973
- DeviceType["Dryer"] = "dryer";
974
- /** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
975
- * other radio-to-IP bridges). It carries the box's own facts (firmware,
976
- * address, connection state) and the actions the box really supports
977
- * (`reboot`, `device-admin-link`). Products are NOT its children — they are
978
- * adopted beside it — and its connection settings stay on the integration. */
979
- DeviceType["Gateway"] = "gateway";
980
- return DeviceType;
981
- }({});
982
- var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
983
- DeviceFeature["BatteryOperated"] = "battery-operated";
984
- DeviceFeature["Rebootable"] = "rebootable";
985
- /**
986
- * Device supports an on-demand re-sync of its derived spec with its
987
- * upstream source — drives the generic Re-sync button. The owning
988
- * provider implements the action via the `device-adoption.resync` cap.
989
- */
990
- DeviceFeature["Resyncable"] = "resyncable";
991
- DeviceFeature["NativeSnapshot"] = "native-snapshot";
992
- DeviceFeature["DoorbellButton"] = "doorbell-button";
993
- DeviceFeature["TwoWayAudio"] = "two-way-audio";
994
- DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
995
- /**
996
- * Camera supports the on-firmware autotrack subsystem (subject-
997
- * following). Distinct from `PanTiltZoom` because not every PTZ
998
- * camera ships autotrack — the admin UI uses this flag to gate
999
- * the autotrack toggle / settings card without re-deriving from
1000
- * the cap registry. Mirrors `ptz-autotrack` cap registration:
1001
- * driver sets this feature when probe confirms the firmware
1002
- * surface, and registers the cap in the same code path.
1003
- */
1004
- DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
1005
- /**
1006
- * Accessory exposes a "trigger on motion" toggle — the parent camera's
1007
- * motion detection automatically activates this device. Mirrors
1008
- * `motion-trigger` cap registration: drivers set this feature in the
1009
- * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
1010
- *
1011
- * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
1012
- * fast scalar without binding fetch), notifier rules, and `listAll`
1013
- * filters that want "all devices with on-motion behaviour".
1014
- */
1015
- DeviceFeature["MotionTrigger"] = "motion-trigger";
1016
- /** Light supports rgb-triplet color via `color` cap. */
1017
- DeviceFeature["LightColorRgb"] = "light-color-rgb";
1018
- /** Light supports HSV color via `color` cap. */
1019
- DeviceFeature["LightColorHsv"] = "light-color-hsv";
1020
- /** Light supports color-temperature (mired) via `color` cap. */
1021
- DeviceFeature["LightColorMired"] = "light-color-mired";
1022
- /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
1023
- * targetHigh). Gates the range slider UI. */
1024
- DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
1025
- /** Thermostat exposes target humidity and/or current humidity
1026
- * readings. Gates the humidity controls. */
1027
- DeviceFeature["ClimateHumidity"] = "climate-humidity";
1028
- /** Thermostat exposes a fan-mode selector. */
1029
- DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
1030
- /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
1031
- DeviceFeature["ClimatePreset"] = "climate-preset";
1032
- /** Thermostat exposes a vertical louver swing toggle. Gates the
1033
- * vertical-swing switch in the climate UI. Independent of horizontal. */
1034
- DeviceFeature["ClimateSwingVertical"] = "climate-swing-vertical";
1035
- /** Thermostat exposes a horizontal louver swing toggle. Gates the
1036
- * horizontal-swing switch in the climate UI. Independent of vertical. */
1037
- DeviceFeature["ClimateSwingHorizontal"] = "climate-swing-horizontal";
1038
- /** Cover exposes intermediate position control (0..100). Gates the
1039
- * position slider UI. */
1040
- DeviceFeature["CoverPositionable"] = "cover-positionable";
1041
- /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
1042
- DeviceFeature["CoverTilt"] = "cover-tilt";
1043
- /** Cover has a real stop: `stop` halts the travel in place. Gates the stop
1044
- * control in exporters; a provider whose `stop` is a no-op never declares it. */
1045
- DeviceFeature["CoverStoppable"] = "cover-stoppable";
1046
- /** Valve exposes intermediate position control (0..100). Gates the
1047
- * position slider / drag surface UI. */
1048
- DeviceFeature["ValvePositionable"] = "valve-positionable";
1049
- /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
1050
- DeviceFeature["FanSpeed"] = "fan-speed";
1051
- /** Fan exposes a preset mode selector. */
1052
- DeviceFeature["FanPreset"] = "fan-preset";
1053
- /** Fan exposes blade direction (forward/reverse) — typical of
1054
- * ceiling fans. */
1055
- DeviceFeature["FanDirection"] = "fan-direction";
1056
- /** Fan exposes an oscillation toggle. */
1057
- DeviceFeature["FanOscillating"] = "fan-oscillating";
1058
- /** Lock requires a PIN code on lock/unlock. Gates the code-entry
1059
- * field on the UI lock-controls panel. */
1060
- DeviceFeature["LockPinRequired"] = "lock-pin-required";
1061
- /** Lock supports a latch-release ("open door") action distinct from
1062
- * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
1063
- * `supported_features`. Gates the Open Door button in the UI. */
1064
- DeviceFeature["LockOpen"] = "lock-open";
1065
- /** Media player exposes a seek-to-position surface. */
1066
- DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
1067
- /** Media player exposes a volume-level setter. */
1068
- DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
1069
- /** Media player exposes a mute toggle distinct from volume=0. */
1070
- DeviceFeature["MediaPlayerMute"] = "media-player-mute";
1071
- /** Media player exposes a shuffle toggle. */
1072
- DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
1073
- /** Media player exposes a repeat mode (off / all / one). */
1074
- DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
1075
- /** Media player exposes a source / input selector. */
1076
- DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
1077
- /** Media player exposes a play-arbitrary-media surface (URL / id). */
1078
- DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
1079
- /** Media player exposes next-track. */
1080
- DeviceFeature["MediaPlayerNext"] = "media-player-next";
1081
- /** Media player exposes previous-track. */
1082
- DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
1083
- /** Media player exposes stop distinct from pause. */
1084
- DeviceFeature["MediaPlayerStop"] = "media-player-stop";
1085
- /** Media player exposes volume up / down in steps (an infrared TV has no level). */
1086
- DeviceFeature["MediaPlayerVolumeStep"] = "media-player-volume-step";
1087
- /** Media player exposes channel up / down in steps. */
1088
- DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
1089
- /** Media player exposes power on / off. */
1090
- DeviceFeature["MediaPlayerPower"] = "media-player-power";
1091
- /** Alarm panel requires a PIN code on arm/disarm. */
1092
- DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
1093
- /** Presence device carries GPS coordinates (lat/lng/accuracy) in
1094
- * addition to a textual location. */
1095
- DeviceFeature["PresenceGps"] = "presence-gps";
1096
- /** Notifier accepts an inline / URL image attachment. */
1097
- DeviceFeature["NotifierImage"] = "notifier-image";
1098
- /** Notifier accepts a priority hint (high/normal/low). */
1099
- DeviceFeature["NotifierPriority"] = "notifier-priority";
1100
- /** Notifier accepts a free-form `data` payload for platform-specific
1101
- * fields. */
1102
- DeviceFeature["NotifierData"] = "notifier-data";
1103
- /** Notifier supports interactive action buttons / callbacks. */
1104
- DeviceFeature["NotifierActions"] = "notifier-actions";
1105
- /** Notifier supports per-call recipient targeting (multi-user). */
1106
- DeviceFeature["NotifierRecipients"] = "notifier-recipients";
1107
- /** Script runner accepts a variables map on each run invocation. */
1108
- DeviceFeature["ScriptVariables"] = "script-variables";
1109
- /** Automation `trigger` accepts a skipCondition flag — fires the
1110
- * automation's actions while bypassing its condition block. */
1111
- DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
1112
- /** Robot vacuum exposes a live cleaning map (image child). Gates the
1113
- * map tile in the vacuum UI. */
1114
- DeviceFeature["VacuumHasMap"] = "vacuum-has-map";
1115
- /** Robot vacuum exposes AI obstacle-detection toggles. Gates the AI
1116
- * switches group. */
1117
- DeviceFeature["VacuumHasAi"] = "vacuum-has-ai";
1118
- /** Robot mower exposes a live mowing map (SVG image child). Gates the
1119
- * mower map tile. */
1120
- DeviceFeature["MowerHasMap"] = "mower-has-map";
1121
- /** Robot mower exposes targeted mowing (all-area / zones / edges /
1122
- * spots) — gates the Mow action + map selectors. */
1123
- DeviceFeature["MowerHasTargetedMowing"] = "mower-has-targeted-mowing";
1124
- return DeviceFeature;
1125
- }({});
1126
- /**
1127
- * Semantic role a device plays within its parent. Populated by driver
1128
- * addons when creating accessory devices (Reolink siren/floodlight/
1129
- * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
1130
- * admin UI to pick icons, labels, and widgets — a `Switch` with
1131
- * `role: Floodlight` renders as a bulb with a brightness slider,
1132
- * whereas a `Switch` with `role: Siren` renders as a klaxon.
1133
- *
1134
- * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
1135
- * sqlite as a nullable TEXT column — old rows keep working unchanged.
1136
- */
1137
- var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
1138
- DeviceRole["Siren"] = "siren";
1139
- DeviceRole["Floodlight"] = "floodlight";
1140
- DeviceRole["Spotlight"] = "spotlight";
1141
- DeviceRole["PirSensor"] = "pir-sensor";
1142
- DeviceRole["Chime"] = "chime";
1143
- DeviceRole["Autotrack"] = "autotrack";
1144
- DeviceRole["Nightvision"] = "nightvision";
1145
- DeviceRole["PrivacyMask"] = "privacy-mask";
1146
- DeviceRole["Doorbell"] = "doorbell";
1147
- /** Interior blind / shade / roller blind. HA `device_class: blind|shade`. */
1148
- DeviceRole["CoverBlind"] = "cover-blind";
1149
- /** Exterior roller shutter. HA `device_class: shutter`; Homematic BROLL. */
1150
- DeviceRole["CoverShutter"] = "cover-shutter";
1151
- /** Exterior awning. HA `device_class: awning`. */
1152
- DeviceRole["CoverAwning"] = "cover-awning";
1153
- /** Curtain / drape. HA `device_class: curtain`. */
1154
- DeviceRole["CoverCurtain"] = "cover-curtain";
1155
- /** Garage door. HA `device_class: garage`. A security actuator: exports gate it. */
1156
- DeviceRole["CoverGarage"] = "cover-garage";
1157
- /** Gate. HA `device_class: gate`. A security actuator: exports gate it. */
1158
- DeviceRole["CoverGate"] = "cover-gate";
1159
- /** Door. HA `device_class: door`. A security actuator: exports gate it. */
1160
- DeviceRole["CoverDoor"] = "cover-door";
1161
- /** Window. HA `device_class: window`. */
1162
- DeviceRole["CoverWindow"] = "cover-window";
1163
- /** Virtual HA toggle (input_boolean.*) — distinguishable from a
1164
- * real Switch device for UI rendering / export adapters. */
1165
- DeviceRole["BinaryHelper"] = "binary-helper";
1166
- /** A smart plug: a `switch` whose source says it is an outlet (HA
1167
- * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
1168
- DeviceRole["Outlet"] = "outlet";
1169
- /** Generic motion / occupancy / moving event source. Distinct from
1170
- * the camera accessory PirSensor role: that one is a camera child;
1171
- * this is a standalone HA / 3rd-party motion sensor. */
1172
- DeviceRole["MotionSensor"] = "motion-sensor";
1173
- DeviceRole["ContactSensor"] = "contact-sensor";
1174
- DeviceRole["LeakSensor"] = "leak-sensor";
1175
- DeviceRole["SmokeSensor"] = "smoke-sensor";
1176
- DeviceRole["COSensor"] = "co-sensor";
1177
- DeviceRole["GasSensor"] = "gas-sensor";
1178
- DeviceRole["TamperSensor"] = "tamper-sensor";
1179
- DeviceRole["VibrationSensor"] = "vibration-sensor";
1180
- DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
1181
- DeviceRole["SoundSensor"] = "sound-sensor";
1182
- /** Fallback for `binary_sensor` without a known `device_class`. */
1183
- DeviceRole["BinarySensor"] = "binary-sensor";
1184
- DeviceRole["TemperatureSensor"] = "temperature-sensor";
1185
- DeviceRole["HumiditySensor"] = "humidity-sensor";
1186
- DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
1187
- DeviceRole["PressureSensor"] = "pressure-sensor";
1188
- /** Wind speed or direction (weather-station `wind-sensor` cap). */
1189
- DeviceRole["WindSensor"] = "wind-sensor";
1190
- /** Rain accumulation or rate (weather-station `rain-sensor` cap). */
1191
- DeviceRole["RainSensor"] = "rain-sensor";
1192
- /** UV index (weather-station `uv-sensor` cap). */
1193
- DeviceRole["UvSensor"] = "uv-sensor";
1194
- /** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
1195
- * Distinct from AmbientLightSensor (lux). */
1196
- DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
1197
- /** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
1198
- DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
1199
- DeviceRole["PowerSensor"] = "power-sensor";
1200
- DeviceRole["EnergySensor"] = "energy-sensor";
1201
- DeviceRole["VoltageSensor"] = "voltage-sensor";
1202
- DeviceRole["CurrentSensor"] = "current-sensor";
1203
- DeviceRole["AirQualitySensor"] = "air-quality-sensor";
1204
- /** Battery level (numeric % via `sensor` OR low-bool via
1205
- * `binary_sensor` — the cap distinguishes via the value type). */
1206
- DeviceRole["BatterySensor"] = "battery-sensor";
1207
- /** Fallback for `sensor` numeric without a known `device_class`. */
1208
- DeviceRole["NumericSensor"] = "numeric-sensor";
1209
- /** String / enum state (HA `sensor` with `state_class: enum` or
1210
- * `attributes.options`). */
1211
- DeviceRole["EnumSensor"] = "enum-sensor";
1212
- /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
1213
- * or `date`). The slice carries the raw ISO string verbatim (hosted on
1214
- * the `enum-sensor` cap); the UI renders it locale-formatted. */
1215
- DeviceRole["DateTimeSensor"] = "datetime-sensor";
1216
- /** Last-resort fallback when nothing else matches. */
1217
- DeviceRole["GenericSensor"] = "generic-sensor";
1218
- DeviceRole["NumericControl"] = "numeric-control";
1219
- DeviceRole["SelectControl"] = "select-control";
1220
- DeviceRole["TextControl"] = "text-control";
1221
- DeviceRole["DateTimeControl"] = "datetime-control";
1222
- /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
1223
- * rich features (image, priority, channel routing). */
1224
- DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
1225
- /** Chat / messaging service (HA `notify.telegram_*`,
1226
- * `notify.discord_*`, etc.). */
1227
- DeviceRole["MessagingNotifier"] = "messaging-notifier";
1228
- /** Email-based delivery (HA `notify.smtp`, etc.). */
1229
- DeviceRole["EmailNotifier"] = "email-notifier";
1230
- /** Fallback when the notifier service name doesn't match a known
1231
- * pattern. */
1232
- DeviceRole["GenericNotifier"] = "generic-notifier";
1233
- /** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
1234
- * cap. A `DeviceType.Generic` device. */
1235
- DeviceRole["IrTransmitter"] = "ir-transmitter";
1236
- return DeviceRole;
1237
- }({});
1238
- //#endregion
1239
51
  //#region ../../node_modules/zod/v4/core/core.js
1240
52
  var _a$1;
1241
53
  function $constructor(name, initializer, params) {
@@ -6056,12 +4868,1207 @@ var ZodIssueCode = {
6056
4868
  var ZodFirstPartyTypeKind;
6057
4869
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
6058
4870
  //#endregion
6059
- //#region ../../node_modules/zod/v4/classic/coerce.js
6060
- function number(params) {
6061
- return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
4871
+ //#region ../../node_modules/zod/v4/classic/coerce.js
4872
+ function number(params) {
4873
+ return /* @__PURE__ */ _coercedNumber(ZodNumber, params);
4874
+ }
4875
+ //#endregion
4876
+ //#region ../types/dist/event-category-78tcBemo.mjs
4877
+ var EventCategory = /* @__PURE__ */ function(EventCategory) {
4878
+ EventCategory["SystemBoot"] = "system.boot";
4879
+ EventCategory["SystemAddonsReady"] = "system.addons-ready";
4880
+ EventCategory["SystemRestarting"] = "system.restarting";
4881
+ /**
4882
+ * Fired exactly once after the hub finishes booting following a
4883
+ * restart that was triggered by `RestartCoordinator` (today: framework
4884
+ * live-update). Payload is the marker that was on disk at boot
4885
+ * (`PendingRestartMarkerPayload`); admin UI listens for it to display a
4886
+ * success toast describing what changed.
4887
+ *
4888
+ * Spec: docs/superpowers/specs/2026-05-14-framework-live-update-design.md
4889
+ */
4890
+ EventCategory["SystemRestartCompleted"] = "system.restart-completed";
4891
+ /**
4892
+ * The hub reissued its own TLS certificate at boot (`ensureTlsCert`).
4893
+ * Emitted only when the material on disk actually changed, so an
4894
+ * operator who trusted the old certificate by hand is told rather than
4895
+ * discovering it as a browser error. Payload `TlsCertChangedPayload`.
4896
+ *
4897
+ * Rule: docs/decisions/adr-0227-*.md
4898
+ */
4899
+ EventCategory["SystemTlsCertChanged"] = "system.tls-cert-changed";
4900
+ /**
4901
+ * A newer addon or server-root package version was found by the
4902
+ * authoritative registry check. Emitted once when any observed
4903
+ * `latestVersion` changes (or a package/node first appears behind);
4904
+ * the payload carries the full currently-available list. Repeated
4905
+ * polling of the same latests is silent.
4906
+ */
4907
+ EventCategory["UpdateAvailable"] = "update.available";
4908
+ /**
4909
+ * Readiness transition for a capability provider. Every producer emits
4910
+ * this event on `onInitialize` completion, `onDestroy`, and
4911
+ * `$node.reconnect`; every consumer that needs to gate on a cross-process
4912
+ * cap subscribes via the kernel's readiness module (`awaitReady` /
4913
+ * `onReadyState`) instead of polling. Payload is
4914
+ * `SystemReadyStatePayload` — see event-bus.ts.
4915
+ */
4916
+ EventCategory["SystemReadyState"] = "system.ready-state";
4917
+ EventCategory["AddonStarted"] = "addon.started";
4918
+ EventCategory["AddonStopped"] = "addon.stopped";
4919
+ EventCategory["AddonRestarted"] = "addon.restarted";
4920
+ EventCategory["AddonUpdated"] = "addon.updated";
4921
+ EventCategory["AddonInstalled"] = "addon.installed";
4922
+ EventCategory["AddonUninstalled"] = "addon.uninstalled";
4923
+ EventCategory["AddonCrashed"] = "addon.crashed";
4924
+ /**
4925
+ * A RUNNER the D6 crash circuit-breaker gave up on — terminal.
4926
+ *
4927
+ * `AddonCrashed` is the routine, self-healing fact ("it crashed; it is being
4928
+ * respawned"); this is the one that never resolves itself. Emitted exactly
4929
+ * once per trip, by `process-service.ts`, carrying the node, the runner, the
4930
+ * addons it hosted and the crash count that tripped the breaker.
4931
+ *
4932
+ * It exists because a runner marked terminally `failed` used to be SILENT:
4933
+ * on 2026-08-18 the `recorder` runner died of three unhandled ffmpeg spawn
4934
+ * errors, the breaker stopped respawning it (correctly), `/health` kept
4935
+ * returning 200, and fleet-wide recording was gone for 3h15 before the
4936
+ * operator's phone told him. The Notification Center's system-event intake
4937
+ * consumes this category and maps it to the `addon-crash-loop` kind.
4938
+ */
4939
+ EventCategory["AddonRunnerFailed"] = "addon.runner-failed";
4940
+ /**
4941
+ * A runner whose addon refused to start with a typed reason (D877) - parked
4942
+ * in `refused`, never counted by the crash breaker, retried on operator
4943
+ * action. One event per refusal.
4944
+ */
4945
+ EventCategory["AddonRunnerRefused"] = "addon.runner-refused";
4946
+ /**
4947
+ * A runner settled on a state (D877): `running` (READY), `crashed`, `failed` or
4948
+ * `refused`. In-process telemetry for the boot check (re-evaluate while any
4949
+ * runner is still pending) and the alert centre (close a recovered runner).
4950
+ */
4951
+ EventCategory["ProcessStateChanged"] = "process.state-changed";
4952
+ /**
4953
+ * The node's one-shot runner boot check (D877): planned runners against the
4954
+ * process service, `degraded` when any is failed, refused or missing. The
4955
+ * alert centre turns it into one critical alert.
4956
+ */
4957
+ EventCategory["SystemRunnerCheck"] = "system.runner-check";
4958
+ /**
4959
+ * An alert EPISODE opened or closed, emitted by the alert centre for alerts
4960
+ * of severity `critical` or `error` (`AlertEpisodePayload`). The alert
4961
+ * centre sends no notification of its own: Notification Center turns this
4962
+ * into the `alert-critical` / `alert-error` / `alert-critical-resolved`
4963
+ * system-event kinds, and reconciles from the alerts store because a bus
4964
+ * event may be dropped (D8, D11).
4965
+ */
4966
+ EventCategory["AlertEpisode"] = "alert.episode";
4967
+ EventCategory["AddonError"] = "addon.error";
4968
+ EventCategory["AddonPageReady"] = "addon.page-ready";
4969
+ EventCategory["AddonWidgetReady"] = "addon.widget-ready";
4970
+ /**
4971
+ * Addon failed to load (import or initialize). Emitted by the kernel's
4972
+ * AddonHealthMonitor only AFTER the boot grace period ends — failures
4973
+ * during the first 5 minutes are silently retried without alerting
4974
+ * (slow-starting addons must have time to come up). Post-grace, this
4975
+ * event is emitted exactly once per failure-streak; AlertCenter
4976
+ * consumes it to create a persistent operator-visible alert.
4977
+ *
4978
+ * Payload: `{ packageName, addonId?, error: { message, stack }, retryCount, nextRetryAt }`.
4979
+ */
4980
+ EventCategory["AddonLoadFailed"] = "addon.load-failed";
4981
+ /**
4982
+ * A keychain value was stored or removed (D787). Carries the ref, its
4983
+ * owner and the new version — NEVER the value. A process holding the ref
4984
+ * drops its cached copy and the owning `BaseAddon` re-resolves its config.
4985
+ * Telemetry (D8): a process that misses it still revalidates by version.
4986
+ */
4987
+ EventCategory["KeychainChanged"] = "keychain.changed";
4988
+ /**
4989
+ * Addon recovered from a previous failure. Emitted when an addon
4990
+ * transitions from `failed` back to `healthy` (typically via the
4991
+ * monitor's auto-retry loop, or after manual `addons.retryLoad`).
4992
+ * AlertCenter dismisses the corresponding `AddonLoadFailed` alert
4993
+ * on this event.
4994
+ */
4995
+ EventCategory["AddonLoadRecovered"] = "addon.load-recovered";
4996
+ /**
4997
+ * An addon is RUNNING although its installed package is below what the
4998
+ * running server requires (`camstack.requires.addons` of the server, or the
4999
+ * addon's own `requires.server`). Raised once per streak by the unsupported-
5000
+ * addon tracker, on the hub and on agents; AlertCenter turns it into one
5001
+ * operator alert per node and package. The addon is never held back for it.
5002
+ *
5003
+ * Payload: `{ packageName, addonId, nodeId, installedVersion, requiredMinimum, serverVersion, unmet }`.
5004
+ */
5005
+ EventCategory["AddonUnsupportedVersion"] = "addon.unsupported-version";
5006
+ /**
5007
+ * The package of an {@link AddonUnsupportedVersion} alert reached a supported
5008
+ * version, or is no longer installed on the node. AlertCenter dismisses the matching alert.
5009
+ *
5010
+ * Payload: `{ packageName, addonId, nodeId }`.
5011
+ */
5012
+ EventCategory["AddonUnsupportedResolved"] = "addon.unsupported-resolved";
5013
+ /**
5014
+ * Monitor scheduled the next retry for a failed addon. Transient —
5015
+ * surfaced to the UI for live-updating the "next retry in Ns"
5016
+ * countdown on the Addons page row, NOT persisted as an alert.
5017
+ */
5018
+ EventCategory["AddonRetryScheduled"] = "addon.retry-scheduled";
5019
+ /**
5020
+ * A liveness invariant of this node is false — it has no devices, every
5021
+ * camera is offline, or a camera that was recording has stopped producing
5022
+ * segments. Emitted by the `liveness-monitor` builtin, once per fault (the
5023
+ * `findingId` is stable across ticks), only after its boot grace period.
5024
+ * AlertCenter raises a persistent operator-visible alert.
5025
+ *
5026
+ * It exists because on 2026-08-03 the hub ran four hours with zero devices
5027
+ * and zero recordings while every surface stayed quiet.
5028
+ *
5029
+ * Payload: `{ findingId, severity, title, message, deviceId? }`.
5030
+ */
5031
+ EventCategory["SystemLivenessFailed"] = "system.liveness-failed";
5032
+ /**
5033
+ * A previously reported liveness fault is true again. AlertCenter dismisses
5034
+ * the matching `SystemLivenessFailed` alert.
5035
+ *
5036
+ * Payload: `{ findingId }`.
5037
+ */
5038
+ EventCategory["SystemLivenessRecovered"] = "system.liveness-recovered";
5039
+ /**
5040
+ * Monitor is attempting to reload a failed addon NOW. UI uses this
5041
+ * to show a spinner during the retry attempt. Same transient nature
5042
+ * as AddonRetryScheduled.
5043
+ */
5044
+ EventCategory["AddonRetryAttempting"] = "addon.retry-attempting";
5045
+ EventCategory["DeviceRegistered"] = "device.registered";
5046
+ EventCategory["DeviceUnregistered"] = "device.unregistered";
5047
+ EventCategory["DeviceEnabled"] = "device.enabled";
5048
+ EventCategory["DeviceDisabled"] = "device.disabled";
5049
+ EventCategory["DeviceSettingsUpdated"] = "device.settings-updated";
5050
+ /**
5051
+ * Emitted when the set of native capability providers bound to a device
5052
+ * changes — e.g. an addon registers a new native cap via
5053
+ * `DeviceContext.registerNativeCap`, or all native bindings for a device
5054
+ * are cleared on removal. Hub consumers re-resolve device-proxy routes
5055
+ * when this fires.
5056
+ */
5057
+ EventCategory["DeviceBindingsChanged"] = "device.bindings-changed";
5058
+ /**
5059
+ * Emitted when the operator-organisational meta surface changes
5060
+ * (`name` / `location` / `disabled`). Payload: `{deviceId, field,
5061
+ * value}`. Live consumers (UI device list, alert center) react
5062
+ * without polling. Distinct from `DeviceSettingsUpdated` which
5063
+ * fires on hardware-config changes (host/port/credentials/etc).
5064
+ */
5065
+ EventCategory["DeviceMetaChanged"] = "device.meta-changed";
5066
+ /**
5067
+ * Emitted by `BaseDevice.updateSourceInfo()` after a successful patch
5068
+ * to the device's upstream-system identity / rendering envelope. The
5069
+ * full new SourceInfo travels in the payload so cross-process listeners
5070
+ * (UI, export adapters) don't need to re-read the meta blob.
5071
+ *
5072
+ * Payload: `{deviceId, sourceInfo}`.
5073
+ *
5074
+ * Distinct from `DeviceMetaChanged` which covers the operator-edited
5075
+ * surface (`name` / `location` / `disabled`). The two share the
5076
+ * persistence layer (both ride on `device-manager.setMetadata` for
5077
+ * SourceInfo, or `setName`/`setLocation`/`setDisabled` for the meta
5078
+ * fields) but consumers care about different subsets.
5079
+ */
5080
+ EventCategory["DeviceSourceInfoChanged"] = "device.source-info-changed";
5081
+ /**
5082
+ * Emitted by DeviceStreamWiringService after a successful
5083
+ * `stream-broker.registerDeviceStreams` call. Payload includes
5084
+ * deviceId — consumers look up the full registered device info via
5085
+ * `brokerManager.getRegisteredDevice(deviceId)`.
5086
+ *
5087
+ * Replaces the legacy `StreamRouterService.onDeviceRegistered` callback.
5088
+ */
5089
+ EventCategory["DeviceStreamsRegistered"] = "device.streams-registered";
5090
+ /**
5091
+ * Device-level "fully provisioned" signal — the EXPORT trigger. Emitted once
5092
+ * a device's persisted export-relevant shape (its `DeviceFeature` set) is
5093
+ * established or changes, carrying `{deviceId, fingerprint, generation}`.
5094
+ * Export adapters (Alexa / HAP) react to THIS instead of the chatty per-cap
5095
+ * `DeviceBindingsChanged`, turning a boot's incomplete→complete trickle into
5096
+ * one clean delta. `fingerprint` is `canonicalDeviceFingerprint(shape)`.
5097
+ *
5098
+ * Spec: docs/superpowers/specs/2026-06-01-alexa-hap-export-reconciler-design.md
5099
+ */
5100
+ EventCategory["DeviceProvisioned"] = "device.provisioned";
5101
+ /**
5102
+ * Fires once when a device's initial feature-probe completes successfully
5103
+ * (lastProbedAt 0→>0); exported shape is now stable. Telemetry (may be
5104
+ * dropped) — consumers MUST also gate on the device record's `probed` flag.
5105
+ */
5106
+ EventCategory["DeviceReady"] = "device.ready";
5107
+ EventCategory["IntegrationEnabled"] = "integration.enabled";
5108
+ EventCategory["IntegrationDisabled"] = "integration.disabled";
5109
+ EventCategory["IntegrationDeleted"] = "integration.deleted";
5110
+ /** Emitted when a broker connection's status flips (connected /
5111
+ * disconnected / error). Carries `{ brokerId, status, error? }`. */
5112
+ EventCategory["BrokerStatusChanged"] = "broker.status-changed";
5113
+ /** Emitted for every subscription-matched message routed by a
5114
+ * broker provider. Carries `{ brokerId, subscriptionId, key, payload }`.
5115
+ * Consumers filter by `brokerId` + `subscriptionId` in the handler. */
5116
+ EventCategory["BrokerMessage"] = "broker.message";
5117
+ EventCategory["ProviderStarted"] = "provider.started";
5118
+ EventCategory["ProviderStopped"] = "provider.stopped";
5119
+ EventCategory["ProcessCrashed"] = "process.crashed";
5120
+ EventCategory["ProcessRestartScheduled"] = "process.restart_scheduled";
5121
+ EventCategory["ProcessRestarted"] = "process.restarted";
5122
+ /**
5123
+ * The SET of storage locations changed — one was created, edited, enabled,
5124
+ * disabled or deleted through the location instances or the forced-delete action.
5125
+ *
5126
+ * Telemetry, not a transaction (D8/D11): every consumer that re-resolves on
5127
+ * it must also converge on its own periodic path, because a dropped event
5128
+ * must not leave a node writing to yesterday's disk set forever. It exists
5129
+ * because there was NO signal at all — an operator who added a second
5130
+ * recordings disk in the admin UI got nothing, and the recorder kept its
5131
+ * resolved locations until something else happened to re-resolve them
5132
+ * (D387). Payload `StorageLocationsChangedPayload`.
5133
+ */
5134
+ EventCategory["StorageLocationsChanged"] = "storage.locations-changed";
5135
+ EventCategory["RecordingStarted"] = "recording.started";
5136
+ EventCategory["RecordingStopped"] = "recording.stopped";
5137
+ EventCategory["RecordingError"] = "recording.error";
5138
+ EventCategory["RecordingHealthDegraded"] = "recording.health.degraded";
5139
+ /** Recording enabled but no segment finalized for the NC stall window. */
5140
+ EventCategory["RecordingHealthStalled"] = "recording.health.stalled";
5141
+ /** Recovery from {@link RecordingHealthStalled}. */
5142
+ EventCategory["RecordingHealthOk"] = "recording.health.ok";
5143
+ EventCategory["RecordingStorageCritical"] = "recording.storage.critical";
5144
+ /** Free space on a storage location crossed the warn bar. */
5145
+ EventCategory["StorageLocationLow"] = "storage.location.low";
5146
+ /** Free space at/under the critical bar, or capacity probe failed (`null`). */
5147
+ EventCategory["StorageLocationCritical"] = "storage.location.critical";
5148
+ /** Recovery from low/critical on a storage location. */
5149
+ EventCategory["StorageLocationOk"] = "storage.location.ok";
5150
+ EventCategory["RecordingSegmentWritten"] = "recording.segment.written";
5151
+ EventCategory["RecordingPolicyFallback"] = "recording.policy.fallback";
5152
+ EventCategory["RecordingRetentionCompleted"] = "recording.retention.completed";
5153
+ /** Export render progress (0–100). Telemetry (D8): a lost tick is a stale
5154
+ * progress bar the client reconciles via `recordingExport.getExport`. */
5155
+ EventCategory["RecordingExportProgress"] = "recording.export.progress";
5156
+ EventCategory["RecordingExportCompleted"] = "recording.export.completed";
5157
+ EventCategory["RecordingExportFailed"] = "recording.export.failed";
5158
+ EventCategory["DetectionEvent"] = "detection.event";
5159
+ EventCategory["SessionTrackNew"] = "session.track.new";
5160
+ EventCategory["SessionTrackExpired"] = "session.track.expired";
5161
+ EventCategory["BenchmarkProgress"] = "benchmark.progress";
5162
+ EventCategory["PlatformProbePhase"] = "platform-probe.phase";
5163
+ EventCategory["PipelineProgress"] = "pipeline.progress";
5164
+ /** Per-frame execution trace emitted by the pipeline executor for live observability. */
5165
+ EventCategory["PipelineTrace"] = "pipeline.trace";
5166
+ /**
5167
+ * Raw inference output emitted by `addon-pipeline-runner` after running the
5168
+ * detection pipeline on a frame. Carries the `FrameResult` (with
5169
+ * `detections[]`, `width`/`height`, timing debug) — never the frame
5170
+ * buffer itself. Hub-side consumers (analysis pipeline, class filters,
5171
+ * notifications) subscribe to this and re-emit `detection.result` after
5172
+ * post-processing.
5173
+ */
5174
+ EventCategory["PipelineInferenceResult"] = "pipeline.inference-result";
5175
+ /**
5176
+ * Camera lifecycle event emitted by `addon-pipeline-orchestrator` when it
5177
+ * assigns or unassigns a camera to/from an agent. Carries no frame data;
5178
+ * pure observability for UI dashboards and metrics consumers.
5179
+ */
5180
+ EventCategory["PipelineCameraAssigned"] = "pipeline.camera-assigned";
5181
+ EventCategory["PipelineCameraUnassigned"] = "pipeline.camera-unassigned";
5182
+ /**
5183
+ * A node the orchestrator would otherwise place cameras on has NO usable
5184
+ * inference device: the operator enabled one or more accelerators there and
5185
+ * the live probe reports every one of them unavailable. Emitted once per
5186
+ * TRANSITION into that state (never per dispatch), and the node is dropped
5187
+ * from the placement candidate set for as long as it holds.
5188
+ *
5189
+ * This exists because the state was previously invisible: agent-a
5190
+ * absorbed 283k inference errors in a day while still being handed cameras,
5191
+ * and nothing in the system said so.
5192
+ *
5193
+ * A node with no accelerators configured at all is NOT this — its devices
5194
+ * are `disabled`, not `unavailable`, and the runner's default CPU pool
5195
+ * serves it exactly as before.
5196
+ */
5197
+ EventCategory["PipelineNodeInferenceUnavailable"] = "pipeline.node-inference-unavailable";
5198
+ /**
5199
+ * A camera has an OPEN detection session and has produced no detection at
5200
+ * all for longer than the blind threshold — the camera is being decoded and
5201
+ * inferred and is returning nothing. Emitted once per transition into blind,
5202
+ * per camera.
5203
+ *
5204
+ * The failure it reports: a 1h43 detection blackout on the entrance camera
5205
+ * that nobody noticed, because "a camera that detects nothing" and "a quiet
5206
+ * camera" produce byte-identical silence.
5207
+ */
5208
+ EventCategory["PipelineDetectionBlind"] = "pipeline.detection-blind";
5209
+ /**
5210
+ * A camera's motion source has fired constantly with no subject for an hour
5211
+ * (motion duty or session count over the bar, zero detections) — it is not
5212
+ * blind, its motion zones or sensitivity want tuning (D907). Paired with
5213
+ * {@link PipelineMotionCalm}.
5214
+ */
5215
+ EventCategory["PipelineMotionNoisy"] = "pipeline.motion-noisy";
5216
+ /** The recovery edge of {@link PipelineMotionNoisy}: the motion fell back, or a detection arrived. */
5217
+ EventCategory["PipelineMotionCalm"] = "pipeline.motion-calm";
5218
+ /**
5219
+ * A camera's package LLM confirm has failed closed three times in a row
5220
+ * (D931, 2026-10-26). One edge per camera until
5221
+ * {@link PipelinePackageLlmAnswered}.
5222
+ */
5223
+ EventCategory["PipelinePackageLlmSilent"] = "pipeline.package-llm-silent";
5224
+ /** The recovery edge of {@link PipelinePackageLlmSilent}: a confirm returned yes or no. */
5225
+ EventCategory["PipelinePackageLlmAnswered"] = "pipeline.package-llm-answered";
5226
+ /**
5227
+ * Per-camera pipeline config was mutated by the orchestrator
5228
+ * (a settings change via `setAgentInferenceDevices` /
5229
+ * `setCameraStepToggle` / `setCameraStepSettings`). Orchestrator
5230
+ * subscribes to its own emission to hot-reload the assigned runner
5231
+ * via `attachCamera` so the next frame executes against the new
5232
+ * engine/steps without waiting for a rebalance or the next
5233
+ * `DeviceStreamsRegistered` cycle.
5234
+ */
5235
+ EventCategory["PipelineCameraUpdated"] = "pipeline.camera-updated";
5236
+ /**
5237
+ * The cluster camera-source OWNER changed (`clusterRoles.ingestNode`).
5238
+ * Emitted by addon-pipeline-orchestrator whenever it (re)derives node
5239
+ * capabilities — at boot, on agent online/offline, and on an ingest-node
5240
+ * flip. Carries the resolved `ownerNodeId`. The stream-broker consumes it to
5241
+ * keep its ingest-owner-gate decision current WITHOUT a per-`ensureBroker`
5242
+ * cross-process `getIngestOwner` query (push the authority's decision instead
5243
+ * of polling it on the hot path). Idempotent state — re-emitted on every
5244
+ * topology change, so a dropped event self-heals on the next one (plus the
5245
+ * broker's long backstop reconcile query).
5246
+ */
5247
+ EventCategory["PipelineIngestOwnerChanged"] = "pipeline.ingest-owner-changed";
5248
+ /**
5249
+ * Periodic snapshot of per-node pipeline-runner load
5250
+ * (`RunnerLocalLoad`). Emitted ~1Hz by every runner so UI dashboards
5251
+ * subscribe instead of polling `pipelineRunner.getLocalLoad`.
5252
+ * `nodeId` carried in the payload + on `event.source.nodeId`.
5253
+ */
5254
+ EventCategory["PipelineRunnerLoadSnapshot"] = "pipeline.runner-load-snapshot";
5255
+ /**
5256
+ * Periodic snapshot of per-camera pipeline metrics (`CameraMetrics`
5257
+ * + `deviceId` + `nodeId`). Emitted ~1Hz by every runner for each
5258
+ * attached camera. UI subscribes to drive overlay phase / fps /
5259
+ * inference time without polling `getCameraMetrics`.
5260
+ */
5261
+ EventCategory["PipelineCameraMetricsSnapshot"] = "pipeline.camera-metrics-snapshot";
5262
+ /**
5263
+ * Periodic snapshot of stream-broker per-broker statistics (input
5264
+ * fps, decoded fps, bitrate, codec). Emitted ~1Hz by every
5265
+ * stream-broker process for each active broker so the UI can drive
5266
+ * the Stream / Cluster dashboards without polling
5267
+ * `streamBroker.listAllProfileSlots` and friends.
5268
+ */
5269
+ EventCategory["StreamBrokerMetricsSnapshot"] = "stream-broker.metrics-snapshot";
5270
+ /**
5271
+ * Cap event fired by `stream-broker` when a profile slot enters
5272
+ * "demanded" state — a cam stream has been assigned and at least one
5273
+ * consumer (RTSP restream, decoded subscriber, WebRTC session, …) is
5274
+ * present. Camera-provider addons (Reolink Baichuan push, …)
5275
+ * subscribe to this category to start their underlying transport
5276
+ * lazily. Payload: `{ deviceId, camStreamId, profile }`.
5277
+ */
5278
+ EventCategory["StreamBrokerOnCamStreamDemand"] = "stream-broker.onCamStreamDemand";
5279
+ /**
5280
+ * Cap event fired by `stream-broker` when the last consumer leaves a
5281
+ * previously-demanded cam stream. Providers tear down their
5282
+ * underlying transport on receipt. Payload: `{ deviceId, camStreamId }`.
5283
+ */
5284
+ EventCategory["StreamBrokerOnCamStreamIdle"] = "stream-broker.onCamStreamIdle";
5285
+ /**
5286
+ * Cap event fired by `stream-broker` when a broker fails to dial a
5287
+ * managed-loopback source (today: `pull-rfc4571`) and the publisher
5288
+ * needs to refresh the cached URL. The lib's TCP server idle-tears-down
5289
+ * on its own schedule, so a re-publish with a fresh `host:port` is the
5290
+ * only way to keep the broker dialable. Camera providers (Reolink
5291
+ * Baichuan native, …) subscribe and respond by re-running their publish
5292
+ * pipeline.
5293
+ * Payload: `{ deviceId, camStreamId, brokerId }`.
5294
+ */
5295
+ EventCategory["StreamBrokerOnRequestStreamSourceRefresh"] = "stream-broker.onRequestStreamSourceRefresh";
5296
+ /**
5297
+ * A camera provider changed a device's stream parameters (codec /
5298
+ * resolution / bitrate / a stream added or removed). A LOW-LATENCY NUDGE
5299
+ * for the stream-broker's catalog reconcile: it carries NO authoritative
5300
+ * data — the broker re-PULLS that device's `stream-catalog` cap on receipt
5301
+ * (the 30s reconcile poll is the backstop if this nudge is dropped). Emitted
5302
+ * by providers from `stream-params.setProfile`. Payload: `{ deviceId }`.
5303
+ */
5304
+ EventCategory["StreamParamsChanged"] = "stream-params.changed";
5305
+ /**
5306
+ * Generic per-device runtime-state change. Fired by `device-manager`
5307
+ * whenever a persisted slice in any cap's `runtimeState` shape
5308
+ * mutates. Payload: `{deviceId, capName, slice}`. Subscribers are
5309
+ * the `deviceState` cap router (cross-process listeners) and the
5310
+ * deviceProxy reactive bindings (`device.state.<capName>.value`).
5311
+ * Cap-specific events (`battery.onStatusChanged`, …) still fire
5312
+ * — they're authoritative for callers that want a typed payload
5313
+ * without filtering on `capName`.
5314
+ */
5315
+ EventCategory["DeviceStateChanged"] = "device.state-changed";
5316
+ /**
5317
+ * The NATIVE shadow of a cap a composition has claimed fields of moved
5318
+ * (D663). Payload: `{ deviceId, capName, native }` — what the provider
5319
+ * wrote, BEFORE the owned fields are overlaid. Owner-only (D224): it is for
5320
+ * the composer's native self-reads, and the public event routers refuse it
5321
+ * (`isOwnerOnlyEventCategory`) so no consumer surface ever shows a second
5322
+ * truth beside the merged `DeviceStateChanged.slice`. Emitted only under a
5323
+ * `replace` claim, one per native write of that cap.
5324
+ */
5325
+ EventCategory["DeviceNativeShadowChanged"] = "device.native-shadow-changed";
5326
+ /**
5327
+ * Frame occupancy for a camera CHANGED — a tracked object was gained or
5328
+ * lost. Carries `{ deviceId, totalObjects, byClass, zones }`.
5329
+ *
5330
+ * Emitted only on a change, so a steady scene is silent. It exists so a
5331
+ * client can stop polling `zoneAnalytics.getCurrentSnapshot`: that was the
5332
+ * one live badge with no push signal at all, and it cost a request every
5333
+ * four seconds per visible camera.
5334
+ *
5335
+ * Like every event it is telemetry and may be dropped ([D8]) — a consumer
5336
+ * keeps a slow reconcile rather than trusting it alone.
5337
+ */
5338
+ EventCategory["ZoneAnalyticsOccupancyChanged"] = "zone-analytics.occupancy-changed";
5339
+ /**
5340
+ * Cap event fired by every device that registers the `battery`
5341
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
5342
+ * `{ deviceId, status: BatteryStatus }`. Subscribers (alert center,
5343
+ * snapshot wrapper, UI) react to charge/sleep transitions without
5344
+ * polling `batteryCapability.getStatus`.
5345
+ */
5346
+ EventCategory["BatteryOnStatusChanged"] = "battery.onStatusChanged";
5347
+ /**
5348
+ * Cap event fired by every device that registers the `network-link`
5349
+ * capability. Mirrors the cap definition's `onStatusChanged`. Carries
5350
+ * `{ deviceId, status: NetworkLinkStatus }` — a link switch or a signal
5351
+ * reading that moved.
5352
+ */
5353
+ EventCategory["NetworkLinkOnStatusChanged"] = "network-link.onStatusChanged";
5354
+ /**
5355
+ * Emitted by the battery cap provider WHEN `wakeForStream` enters the
5356
+ * "wake in progress" window — between the Baichuan wake-up issue and
5357
+ * the camera's first dialed-back RTP packet. The stream-broker
5358
+ * manager subscribes to flip the per-broker placeholder reason to
5359
+ * `'waking'` so viewers see a labelled "WAKING UP" tile instead of
5360
+ * the generic `'reconnecting'` frame. Carries `{ deviceId }`. The
5361
+ * complementary "wake complete" signal is the existing
5362
+ * `BatteryOnStatusChanged { sleeping: false }` event.
5363
+ */
5364
+ EventCategory["BatteryOnWakeStarted"] = "battery.onWakeStarted";
5365
+ /**
5366
+ * Cap event fired by every device that registers the `doorbell`
5367
+ * capability. Mirrors `doorbellCapability.events.onPressed`. Carries
5368
+ * `{ deviceId, timestamp }`. Operators consuming the UI subscribe
5369
+ * here to render transient ring toasts and a "Recent presses" row
5370
+ * on the device detail page.
5371
+ */
5372
+ EventCategory["DoorbellOnPressed"] = "doorbell.onPressed";
5373
+ /** Mirrors `runningStateCapability.events.onStarted`. */
5374
+ EventCategory["RunningStarted"] = "running.started";
5375
+ /** Mirrors `runningStateCapability.events.onFinished`. */
5376
+ EventCategory["RunningFinished"] = "running.finished";
5377
+ /** Mirrors `deviceRunsCapability.events.onRunOpened` - a durable run record opened. */
5378
+ EventCategory["DeviceRunOpened"] = "device-run.opened";
5379
+ /** Mirrors `deviceRunsCapability.events.onRunClosed` - a durable run record closed. */
5380
+ EventCategory["DeviceRunClosed"] = "device-run.closed";
5381
+ /**
5382
+ * Cap event fired by every device that registers the `event-emitter`
5383
+ * capability. Mirrors `eventEmitterCapability.events.onEvent`. Carries
5384
+ * `{ deviceId, eventType, data, timestamp, seq }` — the device's EXACT
5385
+ * declared event verbatim (NO normalization). Subscribers (UI event
5386
+ * stream, advanced-notifier rules) react to fired events without
5387
+ * holding a cap reference.
5388
+ */
5389
+ EventCategory["EventEmitted"] = "event-emitter.event";
5390
+ /**
5391
+ * Periodic snapshot of the per-node detection-pipeline engine
5392
+ * registry (loaded engines, models resident, in-use cameras, idle
5393
+ * TTL). Emitted ~0.2Hz (every 5 s) by every detection-pipeline
5394
+ * process. The Engines tab subscribes to drive its inventory view
5395
+ * without polling `pipelineExecutor.listLoadedEngines`.
5396
+ */
5397
+ EventCategory["PipelineEngineMetricsSnapshot"] = "pipeline.engine-metrics-snapshot";
5398
+ /**
5399
+ * Per-node detection-engine runtime-provisioning transition. Emitted by
5400
+ * the detection-pipeline provider on every state change of its lazy
5401
+ * engine-provisioning machine (idle → installing → verifying → ready,
5402
+ * or → failed with a `nextRetryAt`). Payload is the
5403
+ * `EngineProvisioningState` snapshot; `event.source.nodeId` carries the
5404
+ * node. The Pipeline page subscribes to drive a live "installing
5405
+ * OpenVINO… / ready" indicator per node without polling
5406
+ * `pipelineExecutor.getEngineProvisioning`. Telemetry-grade (D8): the UI
5407
+ * also reads the cap snapshot on mount / reconnect. Phase 2.
5408
+ */
5409
+ EventCategory["PipelineEngineProvisioning"] = "pipeline.engine-provisioning";
5410
+ /**
5411
+ * Cluster topology snapshot. Carries the same payload returned by
5412
+ * `nodes.topology` (every reachable node + addons + processes).
5413
+ * Emitted by the hub on any agent / addon lifecycle change
5414
+ * (debounced) plus a periodic safety net. Replaces UI polling on
5415
+ * `nodes.topology` — admin-ui dashboards subscribe to drive the
5416
+ * cluster view directly from the event payload.
5417
+ */
5418
+ EventCategory["ClusterTopologySnapshot"] = "cluster.topology-snapshot";
5419
+ /**
5420
+ * Periodic per-node system metrics snapshot (CPU / memory / GPU /
5421
+ * disk / network). Emitted ~0.2 Hz by the metrics-provider addon
5422
+ * for each node. Drives the dashboard SystemStatus / ProcessResources
5423
+ * widgets without polling `metricsProvider.getCurrent`.
5424
+ */
5425
+ EventCategory["MetricsNodeResourcesSnapshot"] = "metrics.node-resources-snapshot";
5426
+ /**
5427
+ * Periodic per-node process-tree snapshot (camstack-related pids
5428
+ * with root / managed / system classification). Emitted ~0.2 Hz by
5429
+ * the metrics-provider addon. Drives the Cluster → Processes tab
5430
+ * without polling `metricsProvider.listNodeProcesses`.
5431
+ */
5432
+ EventCategory["MetricsNodeProcessesSnapshot"] = "metrics.node-processes-snapshot";
5433
+ /**
5434
+ * Capability binding change event emitted by `addon-pipeline-orchestrator`
5435
+ * when a user changes which addon implements a cap on a node. Subscribed
5436
+ * by every kernel process to update its local `preferredProviderRegistry`
5437
+ * so future capability lookups respect the new binding.
5438
+ */
5439
+ /**
5440
+ * A capability binding was changed for a node — addon X now provides
5441
+ * capability `cap` on node `nodeId`. Lives under the generic
5442
+ * `capability.*` namespace because capability bindings are a kernel-
5443
+ * level concept used by many addons, not strictly pipeline-scoped.
5444
+ */
5445
+ EventCategory["CapabilityBindingChanged"] = "capability.binding-changed";
5446
+ EventCategory["ModelDownloadProgress"] = "model.download.progress";
5447
+ EventCategory["AgentRegistered"] = "agent.registered";
5448
+ EventCategory["AgentUnregistered"] = "agent.unregistered";
5449
+ EventCategory["AgentOnline"] = "agent.online";
5450
+ EventCategory["AgentOffline"] = "agent.offline";
5451
+ /** Forked worker process (e.g. hub/pipeline) connected to the broker. */
5452
+ EventCategory["WorkerOnline"] = "worker.online";
5453
+ /** Forked worker process disconnected from the broker. */
5454
+ EventCategory["WorkerOffline"] = "worker.offline";
5455
+ EventCategory["AgentTaskDispatched"] = "agent.task.dispatched";
5456
+ EventCategory["AgentTaskAssigned"] = "agent.task.assigned";
5457
+ EventCategory["AgentTrpcConnected"] = "agent.trpc.connected";
5458
+ EventCategory["AgentWsConnected"] = "agent.ws.connected";
5459
+ EventCategory["AgentWsDisconnected"] = "agent.ws.disconnected";
5460
+ EventCategory["AgentBackupActivated"] = "agent.backup.activated";
5461
+ EventCategory["OrchestrationSettingsUpdated"] = "orchestration.settings-updated";
5462
+ EventCategory["MotionAnalysis"] = "detection.motion-analysis";
5463
+ /** All raw motion zones from CCL before minArea filter — for UI debug overlay. */
5464
+ EventCategory["MotionZonesRaw"] = "detection.motion-zones-raw";
5465
+ /**
5466
+ * Per-camera motion phase transition (`watching ↔ active`) emitted
5467
+ * by the runner. Mirrors the `motion.onMotionChanged` cap event
5468
+ * surface — payload `MotionOnMotionChangedPayload` carries
5469
+ * `{deviceId, detected, timestamp, source, regions?}`. Subscribers
5470
+ * include addons that need to react to motion state without
5471
+ * polling the runtime-state mirror.
5472
+ */
5473
+ EventCategory["MotionOnMotionChanged"] = "motion.on-motion-changed";
5474
+ EventCategory["DetectionResult"] = "detection.result";
5475
+ EventCategory["DetectionRaw"] = "detection.raw";
5476
+ EventCategory["DetectionCameraNative"] = "detection.camera-native";
5477
+ /**
5478
+ * Canonical per-chunk live audio pipeline output. Payload is
5479
+ * `PipelineAudioInferenceResultPayload` carrying a full `AudioResult`
5480
+ * (level + detections + debug). Lives on the pipeline.* namespace
5481
+ * alongside `pipeline.inference-result` (video) for symmetry.
5482
+ */
5483
+ EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
5484
+ EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
5485
+ /**
5486
+ * A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
5487
+ * data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
5488
+ * consumer is the orchestrator's camera-sensors bridge, which re-emits the
5489
+ * camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
5490
+ * for a camera with no attached sensor). Providers must not emit
5491
+ * `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
5492
+ * keeps it so (camera-grid is a named, deferred exception).
5493
+ */
5494
+ EventCategory["ProviderMotion"] = "provider.motion";
5495
+ EventCategory["ProviderDetection"] = "provider.detection";
5496
+ EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
5497
+ EventCategory["EnrichmentSceneStateChanged"] = "enrichment.scene.state-changed";
5498
+ EventCategory["EnrichmentActivitySummary"] = "enrichment.activity.summary";
5499
+ /**
5500
+ * Unified track-lifecycle event: ONE category carrying `phase:
5501
+ * 'start' | 'update' | 'end'` with a rich, typed
5502
+ * `PipelineAnalyticsTrackLifecyclePayload`. Supersedes the thin
5503
+ * `PipelineAnalyticsTrackStarted` / `PipelineAnalyticsTrackEnded`
5504
+ * pair — a consumer subscribes once and branches on `phase`.
5505
+ */
5506
+ EventCategory["PipelineAnalyticsTrackLifecycle"] = "pipeline-analytics.track-lifecycle";
5507
+ /**
5508
+ * @deprecated Superseded by {@link PipelineAnalyticsTrackLifecycle}
5509
+ * (`phase:'start'`). Kept as a soft alias — no known subscribers.
5510
+ */
5511
+ EventCategory["PipelineAnalyticsTrackStarted"] = "pipeline-analytics.track-started";
5512
+ /**
5513
+ * @deprecated Superseded by {@link PipelineAnalyticsTrackLifecycle}
5514
+ * (`phase:'end'`). Kept as a soft alias — no known subscribers.
5515
+ */
5516
+ EventCategory["PipelineAnalyticsTrackEnded"] = "pipeline-analytics.track-ended";
5517
+ EventCategory["PipelineAnalyticsDetectionEvent"] = "pipeline-analytics.detection-event";
5518
+ EventCategory["PipelineAnalyticsFrameTracked"] = "pipeline-analytics.frame-tracked";
5519
+ /**
5520
+ * Fired by `addon-post-analysis` when a parked (stationary) object appears
5521
+ * (a track was promoted to a stationary-registry entry) or departs (the
5522
+ * object moved / was removed). Telemetry (D8): lossy, drives a UI refresh of
5523
+ * the dedicated "Stationary" section — never the live event feed. Payload:
5524
+ * `{ deviceId, entryId, className, phase:'appeared'|'departed', timestamp, observedAt, zones }`.
5525
+ */
5526
+ EventCategory["PipelineAnalyticsStationaryChanged"] = "pipeline-analytics.stationary-changed";
5527
+ /**
5528
+ * Fired by `addon-post-analysis` when a package-drop is confirmed inside
5529
+ * a package zone — a newly-appeared stationary object of a package class
5530
+ * that cleared the class / zone / dwell / size gates. Payload:
5531
+ * `PipelineAnalyticsPackageDeliveredPayload` carrying `{ deviceId,
5532
+ * entryId, className, zoneIds, keyFrameMediaId?, bbox, timestamp }`.
5533
+ * Telemetry (D8): the durable record is the `package-events` store row;
5534
+ * this bus topic drives notifier rules + live UI. See
5535
+ * docs/superpowers/specs/2026-07-17-package-zones-design.md §5.1.
5536
+ */
5537
+ EventCategory["PipelineAnalyticsPackageDelivered"] = "pipeline-analytics.package-delivered";
5538
+ /**
5539
+ * Fired by `addon-post-analysis` when a previously-delivered package
5540
+ * leaves its zone (the stationary entry departed — moved or swept).
5541
+ * Payload: `PipelineAnalyticsPackagePickedUpPayload` carrying
5542
+ * `{ deviceId, entryId, deliveredEventId, className, timestamp }`.
5543
+ * Telemetry (D8). See package-zones-design §5.2.
5544
+ */
5545
+ EventCategory["PipelineAnalyticsPackagePickedUp"] = "pipeline-analytics.package-picked-up";
5546
+ /**
5547
+ * Fired by `addon-post-analysis` whenever a gallery face row changes:
5548
+ * `kind:'buffered'` a new detected face was persisted, `'assigned'` /
5549
+ * `'unassigned'` its identity link changed, `'deleted'` the row was
5550
+ * removed. Telemetry semantics (D8): a lost event only delays a refresh,
5551
+ * never a correctness issue. Payload `PipelineAnalyticsFaceGalleryChangedPayload`.
5552
+ */
5553
+ EventCategory["PipelineAnalyticsFaceGalleryChanged"] = "pipeline-analytics.face-gallery-changed";
5554
+ /**
5555
+ * Fired by `addon-post-analysis` whenever a gallery plate row changes:
5556
+ * `kind:'buffered'` a new read was persisted (`PlateRecognizer.onTrackEnd`),
5557
+ * `'assigned'` / `'unassigned'` its vehicle link changed
5558
+ * (`PlateGalleryProvider`), `'deleted'` the row was removed. Telemetry
5559
+ * semantics (D8): a lost event only delays a refresh, never a correctness
5560
+ * issue. Payload `PipelineAnalyticsPlateGalleryChangedPayload`.
5561
+ */
5562
+ EventCategory["PipelineAnalyticsPlateGalleryChanged"] = "pipeline-analytics.plate-gallery-changed";
5563
+ EventCategory["CameraStreamsProfileSlotsChanged"] = "camera-streams.onProfileSlotsChanged";
5564
+ /**
5565
+ * Stream-broker health watchdog. Per-broker (deviceId/profile) emission.
5566
+ * `stream.offline` fires after STREAM_STALE_TIMEOUT_MS without an encoded
5567
+ * packet on an active broker. `stream.online` fires on first packet
5568
+ * after a stale gap (or on initial first packet). Payload includes
5569
+ * the assigned camStreamId as `profileKey`.
5570
+ */
5571
+ EventCategory["StreamOnline"] = "stream.online";
5572
+ EventCategory["StreamOffline"] = "stream.offline";
5573
+ EventCategory["NetworkTunnelStarted"] = "network.tunnel.started";
5574
+ EventCategory["NetworkTunnelStopped"] = "network.tunnel.stopped";
5575
+ /** Fired by the `local-network` cap when the host's interface set
5576
+ * changes (new IP from DHCP, VPN connect, docker bridge added). */
5577
+ EventCategory["LocalNetworkChanged"] = "network.local.changed";
5578
+ /**
5579
+ * Fired by a `mesh-network` provider (Tailscale, …) when its
5580
+ * mesh-reachable host changes (join / leave / MagicDNS or 100.x IP
5581
+ * change). Lets `local-network` fold the mesh endpoint into its
5582
+ * connection-endpoint list without a cross-package import. Payload
5583
+ * carries the preferred host (`host: ''` = no longer reachable),
5584
+ * the hub port, and the scheme. Telemetry-grade (D8): consumers
5585
+ * pull-reconcile from the provider's `getStatus` on reconnect. */
5586
+ EventCategory["MeshNetworkChanged"] = "network.mesh.changed";
5587
+ EventCategory["BackupCompleted"] = "backup.completed";
5588
+ /**
5589
+ * A whole backup RUN finished — every destination attempted, win or lose.
5590
+ *
5591
+ * `backup.completed` fires once per DESTINATION, which is the right grain for
5592
+ * a progress UI and the wrong one for a notification: an operator with three
5593
+ * destinations would be told three times. And a run where two of three
5594
+ * destinations succeeded is not a clean success — a single "backup
5595
+ * completed" that hid the failed one would be a lie, so the count of each is
5596
+ * carried here and the message says both.
5597
+ *
5598
+ * Emitted by the backup orchestrator only after the destination loop, so a
5599
+ * run that dies during the BUILD phase produces no completion at all.
5600
+ */
5601
+ EventCategory["BackupRunCompleted"] = "backup.run-completed";
5602
+ EventCategory["BackupRestored"] = "backup.restored";
5603
+ EventCategory["NotificationDispatched"] = "notification.dispatched";
5604
+ EventCategory["NotificationFailed"] = "notification.failed";
5605
+ /**
5606
+ * A notification rule that cannot work (D905): its stored row does not load,
5607
+ * or it still names a device / delivery target the prune CONFIRMED deleted.
5608
+ * One edge per rule per distinct set of reasons; never on an unanswered read.
5609
+ */
5610
+ EventCategory["NotificationRuleBroken"] = "notification.rule-broken";
5611
+ /** The clear of {@link NotificationRuleBroken}: the rule loads and names nothing deleted. */
5612
+ EventCategory["NotificationRuleRepaired"] = "notification.rule-repaired";
5613
+ /** A migration failed or was blocked; the Alert Center re-reads the ledger. */
5614
+ EventCategory["MigrationFailed"] = "migration.failed";
5615
+ /** A migration applied or a failure cleared; the Alert Center re-reads the ledger. */
5616
+ EventCategory["MigrationApplied"] = "migration.applied";
5617
+ EventCategory["DeviceUpdated"] = "device.updated";
5618
+ /**
5619
+ * Transport-level connectivity. Emitted by the device driver when
5620
+ * the underlying control socket actually connects / disconnects
5621
+ * (Baichuan TCP, ONVIF probe response, RTSP DESCRIBE, …) — NOT for
5622
+ * power-state transitions on a battery camera. For battery wake /
5623
+ * doze cycles see `DeviceAwake` / `DeviceSleeping`.
5624
+ */
5625
+ EventCategory["DeviceOnline"] = "device.online";
5626
+ /**
5627
+ * Stream-broker watchdog — emitted when no encoded packet has been
5628
+ * received for STREAM_STALE_TIMEOUT_MS on an active broker (rtsp or
5629
+ * push). Paired with DeviceOnline which fires on first packet after
5630
+ * a stale gap. Payload: DeviceStreamHealthPayload.
5631
+ */
5632
+ EventCategory["DeviceOffline"] = "device.offline";
5633
+ /**
5634
+ * Battery cam woke up — physical power-state transition reported
5635
+ * by the device firmware. Distinct from `DeviceOnline` so a UI panel
5636
+ * watching power state doesn't flap on every UDP socket reconnect.
5637
+ */
5638
+ EventCategory["DeviceAwake"] = "device.awake";
5639
+ /**
5640
+ * Battery cam went to sleep. See `DeviceAwake`.
5641
+ */
5642
+ EventCategory["DeviceSleeping"] = "device.sleeping";
5643
+ EventCategory["RetentionCleanup"] = "retention.cleanup";
5644
+ /**
5645
+ * Legacy bulk-update progress snapshot (payload `BulkUpdateState`). No longer
5646
+ * emitted — F3 removed the coordinator that produced it; "Update all" now runs
5647
+ * as one lifecycle engine job (`AddonsJobProgress`/`AddonsJobLog`). Retained
5648
+ * (with `BulkUpdateState`) only to avoid regenerating the event maps; removed
5649
+ * in F4 once live bulk progress is re-implemented over the engine events.
5650
+ */
5651
+ EventCategory["AddonsBulkUpdateProgress"] = "addons.bulk-update-progress";
5652
+ EventCategory["AddonsJobProgress"] = "addons.job-progress";
5653
+ EventCategory["AddonsJobLog"] = "addons.job-log";
5654
+ /**
5655
+ * A container's child visibility toggled (hidden/shown). Emitted by the
5656
+ * `accessories` cap when a child device is hidden or revealed.
5657
+ * Payload: `{ deviceId, childDeviceId, hidden }`.
5658
+ */
5659
+ EventCategory["AccessoriesChildVisibilityChanged"] = "accessories.onChildVisibilityChanged";
5660
+ /**
5661
+ * A container's child set changed (children added/removed/reordered).
5662
+ * Payload: `{ deviceId, childDeviceIds, hiddenChildIds }`.
5663
+ */
5664
+ EventCategory["AccessoriesChanged"] = "accessories.onAccessoriesChanged";
5665
+ /**
5666
+ * An action run started or ended. Emitted by the `actions` surface.
5667
+ * Payload: `ActionRunChanged` (`{ actionId, runId, isRunning, outcome?, lastRunAt, lastError }`).
5668
+ */
5669
+ EventCategory["ActionsRunChanged"] = "actions.onRunChanged";
5670
+ /**
5671
+ * Progress update from a running model conversion job.
5672
+ * Payload: `{ kind: 'model-convert', phase, sessionId?, pct?, detail? }`.
5673
+ * Emitted by `addon-model-studio` on the converting node.
5674
+ */
5675
+ EventCategory["ModelConvertProgress"] = "model-convert.progress";
5676
+ return EventCategory;
5677
+ }({});
5678
+ //#endregion
5679
+ //#region ../types/dist/device-type-DxCT0krO.mjs
5680
+ /**
5681
+ import { errMsg } from '@camstack/types'
5682
+ * Extract a human-readable message from an unknown error value.
5683
+ * Replaces the ubiquitous `errMsg(err)` pattern.
5684
+ */
5685
+ function errMsg(err) {
5686
+ if (err instanceof Error) return err.message;
5687
+ if (typeof err === "string") return err;
5688
+ return String(err);
6062
5689
  }
5690
+ var DeviceType = /* @__PURE__ */ function(DeviceType) {
5691
+ DeviceType["Camera"] = "camera";
5692
+ DeviceType["Hub"] = "hub";
5693
+ DeviceType["Light"] = "light";
5694
+ DeviceType["Siren"] = "siren";
5695
+ DeviceType["Switch"] = "switch";
5696
+ DeviceType["Sensor"] = "sensor";
5697
+ DeviceType["Thermostat"] = "thermostat";
5698
+ /** Air-conditioner / heat-pump climate device (HVAC) — shares the
5699
+ * `climate-control` cap surface with `Thermostat` but renders a
5700
+ * dedicated AC-appropriate control UI (mode chips, fan speed,
5701
+ * independent vertical/horizontal swing). Sources: native Gree, and
5702
+ * reusable by other AC integrations. */
5703
+ DeviceType["Climate"] = "climate";
5704
+ DeviceType["Button"] = "button";
5705
+ /** Generic stateless event emitter — carries a device's EXACT declared
5706
+ * event vocabulary verbatim (no normalization). Installed with the
5707
+ * `event-emitter` cap. Sources: HA `event.*` entities (structured) and
5708
+ * HA bus events (e.g. `zha_event`, generic). */
5709
+ DeviceType["EventEmitter"] = "event-emitter";
5710
+ /** Firmware/software update entity — current vs available version,
5711
+ * updatable flag, update state, and an install action. Installed with
5712
+ * the `update` cap. Sources: Homematic firmware-update channels (and
5713
+ * reusable by other providers, e.g. HA `update.*` entities). */
5714
+ DeviceType["Update"] = "update";
5715
+ DeviceType["Generic"] = "generic";
5716
+ /** Generic notification delivery target (HA `notify.<service>`, future
5717
+ * Telegram / Discord / ntfy / SMTP, …). One device per delivery
5718
+ * endpoint; the `notifier` cap defines the send surface. */
5719
+ DeviceType["Notifier"] = "notifier";
5720
+ /** Pre-recorded action sequence with optional parameters
5721
+ * (HA `script.*`). Runnable via `script-runner` cap. */
5722
+ DeviceType["Script"] = "script";
5723
+ /** Automation rule (HA `automation.*`) — enable/disable + manual
5724
+ * trigger surface exposed via `automation-control` cap. */
5725
+ DeviceType["Automation"] = "automation";
5726
+ /** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
5727
+ DeviceType["Lock"] = "lock";
5728
+ /** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
5729
+ * `valve.*`). `cover` cap with sub-roles for variant. */
5730
+ DeviceType["Cover"] = "cover";
5731
+ /** Pipe / water / gas valve with open/close/stop and optional
5732
+ * position (HA `valve.*`). `valve` cap — a cover-sibling actuator
5733
+ * modelled on the same open/closed lifecycle. */
5734
+ DeviceType["Valve"] = "valve";
5735
+ /** Humidifier / dehumidifier with on/off + target humidity + mode
5736
+ * (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
5737
+ * modelled on the same target / mode lifecycle. */
5738
+ DeviceType["Humidifier"] = "humidifier";
5739
+ /** Water heater / boiler with target temperature + operation mode +
5740
+ * away mode (HA `water_heater.*`). `water-heater` cap — a
5741
+ * climate-family actuator. */
5742
+ DeviceType["WaterHeater"] = "water-heater";
5743
+ /** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
5744
+ DeviceType["Fan"] = "fan";
5745
+ /** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
5746
+ * the camera surface — those use `Camera`. `media-player` cap. */
5747
+ DeviceType["MediaPlayer"] = "media-player";
5748
+ /** Security panel / alarm system (HA `alarm_control_panel.*`).
5749
+ * `alarm-panel` cap. */
5750
+ DeviceType["AlarmPanel"] = "alarm-panel";
5751
+ /** Generic user-settable input (HA `number` / `input_number` / `select`
5752
+ * / `input_select` / `text` / `input_text` / `input_datetime`).
5753
+ * Sub-type via `DeviceRole`: NumericControl / SelectControl /
5754
+ * TextControl / DateTimeControl. */
5755
+ DeviceType["Control"] = "control";
5756
+ /** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
5757
+ * `presence` cap. */
5758
+ DeviceType["Presence"] = "presence";
5759
+ /** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
5760
+ * `weather` cap. */
5761
+ DeviceType["Weather"] = "weather";
5762
+ /** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
5763
+ DeviceType["Vacuum"] = "vacuum";
5764
+ /** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
5765
+ * `lawn-mower-control` cap. */
5766
+ DeviceType["LawnMower"] = "lawn-mower";
5767
+ /** Physical HA device group — parent container for entity-children
5768
+ * adopted from a single HA device entry. Not renderable as a
5769
+ * standalone device; exists only to anchor child entities. */
5770
+ DeviceType["Container"] = "container";
5771
+ /** Single still-image entity (HA `image.*`). Read-only display of an
5772
+ * `entity_picture` signed URL the browser loads directly. `image` cap. */
5773
+ DeviceType["Image"] = "image";
5774
+ /** Smart pet feeder — cloud-connected food dispenser with a bowl food
5775
+ * level, battery, desiccant life, feeding state and manual-feed /
5776
+ * call-pet / maintenance actions. Installed with the `pet-feeder` cap;
5777
+ * dual-hopper models (D4S/D4SH) expose per-hopper portions. Sources:
5778
+ * native PetKit (`nodepetkit` `FeederDevice`), reusable by other feeder
5779
+ * integrations sharing the same food/desiccant/hopper surface. */
5780
+ DeviceType["PetFeeder"] = "pet-feeder";
5781
+ /** Pet water fountain — tank level, water drunk, pump and its duty cycle.
5782
+ * Installed with the `pet-fountain` cap. Reaches CamStack as loose entities
5783
+ * of a container and is BUILT as a composed device (D967). */
5784
+ DeviceType["PetFountain"] = "pet-fountain";
5785
+ /** Built-in dishwasher — program lifecycle, door / remote-start gates,
5786
+ * salt and rinse-aid levels. Installed with the `dishwasher` cap.
5787
+ * Sources: native Bosch Home Connect, reusable by similar integrations.
5788
+ * A plug-built dishwasher carries running-state and power instead. */
5789
+ DeviceType["Dishwasher"] = "dishwasher";
5790
+ /** Washing machine. A plug-built one is running while its power stays
5791
+ * above a threshold. No program cap — that surface is the dishwasher's. */
5792
+ DeviceType["Washer"] = "washer";
5793
+ /** A dumb plug-in stove or heater: a switch (and, with a meter, a power
5794
+ * reading) that only runs while the plug is on. Built from a smart plug;
5795
+ * the `timed-run` cap switches it off again after a chosen time. */
5796
+ DeviceType["Heater"] = "heater";
5797
+ /** Tumble dryer. Same plug-built running surface as {@link Washer}. */
5798
+ DeviceType["Dryer"] = "dryer";
5799
+ /** The physical bridge box of a vendor ecosystem (Velux KLF-200, and later
5800
+ * other radio-to-IP bridges). It carries the box's own facts (firmware,
5801
+ * address, connection state) and the actions the box really supports
5802
+ * (`reboot`, `device-admin-link`). Products are NOT its children — they are
5803
+ * adopted beside it — and its connection settings stay on the integration. */
5804
+ DeviceType["Gateway"] = "gateway";
5805
+ return DeviceType;
5806
+ }({});
5807
+ var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
5808
+ DeviceFeature["BatteryOperated"] = "battery-operated";
5809
+ DeviceFeature["Rebootable"] = "rebootable";
5810
+ /**
5811
+ * Device supports an on-demand re-sync of its derived spec with its
5812
+ * upstream source — drives the generic Re-sync button. The owning
5813
+ * provider implements the action via the `device-adoption.resync` cap.
5814
+ */
5815
+ DeviceFeature["Resyncable"] = "resyncable";
5816
+ DeviceFeature["NativeSnapshot"] = "native-snapshot";
5817
+ DeviceFeature["DoorbellButton"] = "doorbell-button";
5818
+ DeviceFeature["TwoWayAudio"] = "two-way-audio";
5819
+ DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
5820
+ /**
5821
+ * Camera supports the on-firmware autotrack subsystem (subject-
5822
+ * following). Distinct from `PanTiltZoom` because not every PTZ
5823
+ * camera ships autotrack — the admin UI uses this flag to gate
5824
+ * the autotrack toggle / settings card without re-deriving from
5825
+ * the cap registry. Mirrors `ptz-autotrack` cap registration:
5826
+ * driver sets this feature when probe confirms the firmware
5827
+ * surface, and registers the cap in the same code path.
5828
+ */
5829
+ DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
5830
+ /**
5831
+ * Accessory exposes a "trigger on motion" toggle — the parent camera's
5832
+ * motion detection automatically activates this device. Mirrors
5833
+ * `motion-trigger` cap registration: drivers set this feature in the
5834
+ * same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
5835
+ *
5836
+ * Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
5837
+ * fast scalar without binding fetch), notifier rules, and `listAll`
5838
+ * filters that want "all devices with on-motion behaviour".
5839
+ */
5840
+ DeviceFeature["MotionTrigger"] = "motion-trigger";
5841
+ /**
5842
+ * Device can be run for a chosen time and then stopped. Mirrors the
5843
+ * `timed-run` wrapper cap — the cap is bound by the core-blocks addon, not by
5844
+ * a driver, so the flag is derived from the device's bindings
5845
+ * (`featuresOfBoundCaps`). Gates the quick-run control in the viewer.
5846
+ */
5847
+ DeviceFeature["TimedRun"] = "timed-run";
5848
+ /** Light supports rgb-triplet color via `color` cap. */
5849
+ DeviceFeature["LightColorRgb"] = "light-color-rgb";
5850
+ /** Light supports HSV color via `color` cap. */
5851
+ DeviceFeature["LightColorHsv"] = "light-color-hsv";
5852
+ /** Light supports color-temperature (mired) via `color` cap. */
5853
+ DeviceFeature["LightColorMired"] = "light-color-mired";
5854
+ /** Thermostat supports a `heat_cool` dual setpoint (targetLow +
5855
+ * targetHigh). Gates the range slider UI. */
5856
+ DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
5857
+ /** Thermostat exposes target humidity and/or current humidity
5858
+ * readings. Gates the humidity controls. */
5859
+ DeviceFeature["ClimateHumidity"] = "climate-humidity";
5860
+ /** Thermostat exposes a fan-mode selector. */
5861
+ DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
5862
+ /** Thermostat exposes preset modes (eco / away / sleep / vendor). */
5863
+ DeviceFeature["ClimatePreset"] = "climate-preset";
5864
+ /** Thermostat exposes a vertical louver swing toggle. Gates the
5865
+ * vertical-swing switch in the climate UI. Independent of horizontal. */
5866
+ DeviceFeature["ClimateSwingVertical"] = "climate-swing-vertical";
5867
+ /** Thermostat exposes a horizontal louver swing toggle. Gates the
5868
+ * horizontal-swing switch in the climate UI. Independent of vertical. */
5869
+ DeviceFeature["ClimateSwingHorizontal"] = "climate-swing-horizontal";
5870
+ /** Cover exposes intermediate position control (0..100). Gates the
5871
+ * position slider UI. */
5872
+ DeviceFeature["CoverPositionable"] = "cover-positionable";
5873
+ /** Cover exposes slat-tilt control. Gates the tilt slider UI. */
5874
+ DeviceFeature["CoverTilt"] = "cover-tilt";
5875
+ /** Cover has a real stop: `stop` halts the travel in place. Gates the stop
5876
+ * control in exporters; a provider whose `stop` is a no-op never declares it. */
5877
+ DeviceFeature["CoverStoppable"] = "cover-stoppable";
5878
+ /** Valve exposes intermediate position control (0..100). Gates the
5879
+ * position slider / drag surface UI. */
5880
+ DeviceFeature["ValvePositionable"] = "valve-positionable";
5881
+ /** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
5882
+ DeviceFeature["FanSpeed"] = "fan-speed";
5883
+ /** Fan exposes a preset mode selector. */
5884
+ DeviceFeature["FanPreset"] = "fan-preset";
5885
+ /** Fan exposes blade direction (forward/reverse) — typical of
5886
+ * ceiling fans. */
5887
+ DeviceFeature["FanDirection"] = "fan-direction";
5888
+ /** Fan exposes an oscillation toggle. */
5889
+ DeviceFeature["FanOscillating"] = "fan-oscillating";
5890
+ /** Lock requires a PIN code on lock/unlock. Gates the code-entry
5891
+ * field on the UI lock-controls panel. */
5892
+ DeviceFeature["LockPinRequired"] = "lock-pin-required";
5893
+ /** Lock supports a latch-release ("open door") action distinct from
5894
+ * unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
5895
+ * `supported_features`. Gates the Open Door button in the UI. */
5896
+ DeviceFeature["LockOpen"] = "lock-open";
5897
+ /** Media player exposes a seek-to-position surface. */
5898
+ DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
5899
+ /** Media player exposes a volume-level setter. */
5900
+ DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
5901
+ /** Media player exposes a mute toggle distinct from volume=0. */
5902
+ DeviceFeature["MediaPlayerMute"] = "media-player-mute";
5903
+ /** Media player exposes a shuffle toggle. */
5904
+ DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
5905
+ /** Media player exposes a repeat mode (off / all / one). */
5906
+ DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
5907
+ /** Media player exposes a source / input selector. */
5908
+ DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
5909
+ /** Media player exposes a play-arbitrary-media surface (URL / id). */
5910
+ DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
5911
+ /** Media player exposes next-track. */
5912
+ DeviceFeature["MediaPlayerNext"] = "media-player-next";
5913
+ /** Media player exposes previous-track. */
5914
+ DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
5915
+ /** Media player exposes stop distinct from pause. */
5916
+ DeviceFeature["MediaPlayerStop"] = "media-player-stop";
5917
+ /** Media player exposes volume up / down in steps (an infrared TV has no level). */
5918
+ DeviceFeature["MediaPlayerVolumeStep"] = "media-player-volume-step";
5919
+ /** Media player exposes channel up / down in steps. */
5920
+ DeviceFeature["MediaPlayerChannelStep"] = "media-player-channel-step";
5921
+ /** Media player exposes power on / off. */
5922
+ DeviceFeature["MediaPlayerPower"] = "media-player-power";
5923
+ /** Alarm panel requires a PIN code on arm/disarm. */
5924
+ DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
5925
+ /** Presence device carries GPS coordinates (lat/lng/accuracy) in
5926
+ * addition to a textual location. */
5927
+ DeviceFeature["PresenceGps"] = "presence-gps";
5928
+ /** Notifier accepts an inline / URL image attachment. */
5929
+ DeviceFeature["NotifierImage"] = "notifier-image";
5930
+ /** Notifier accepts a priority hint (high/normal/low). */
5931
+ DeviceFeature["NotifierPriority"] = "notifier-priority";
5932
+ /** Notifier accepts a free-form `data` payload for platform-specific
5933
+ * fields. */
5934
+ DeviceFeature["NotifierData"] = "notifier-data";
5935
+ /** Notifier supports interactive action buttons / callbacks. */
5936
+ DeviceFeature["NotifierActions"] = "notifier-actions";
5937
+ /** Notifier supports per-call recipient targeting (multi-user). */
5938
+ DeviceFeature["NotifierRecipients"] = "notifier-recipients";
5939
+ /** Script runner accepts a variables map on each run invocation. */
5940
+ DeviceFeature["ScriptVariables"] = "script-variables";
5941
+ /** Automation `trigger` accepts a skipCondition flag — fires the
5942
+ * automation's actions while bypassing its condition block. */
5943
+ DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
5944
+ /** Robot vacuum exposes a live cleaning map (image child). Gates the
5945
+ * map tile in the vacuum UI. */
5946
+ DeviceFeature["VacuumHasMap"] = "vacuum-has-map";
5947
+ /** Robot vacuum exposes AI obstacle-detection toggles. Gates the AI
5948
+ * switches group. */
5949
+ DeviceFeature["VacuumHasAi"] = "vacuum-has-ai";
5950
+ /** Robot mower exposes a live mowing map (SVG image child). Gates the
5951
+ * mower map tile. */
5952
+ DeviceFeature["MowerHasMap"] = "mower-has-map";
5953
+ /** Robot mower exposes targeted mowing (all-area / zones / edges /
5954
+ * spots) — gates the Mow action + map selectors. */
5955
+ DeviceFeature["MowerHasTargetedMowing"] = "mower-has-targeted-mowing";
5956
+ return DeviceFeature;
5957
+ }({});
5958
+ /**
5959
+ * Semantic role a device plays within its parent. Populated by driver
5960
+ * addons when creating accessory devices (Reolink siren/floodlight/
5961
+ * PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
5962
+ * admin UI to pick icons, labels, and widgets — a `Switch` with
5963
+ * `role: Floodlight` renders as a bulb with a brightness slider,
5964
+ * whereas a `Switch` with `role: Siren` renders as a klaxon.
5965
+ *
5966
+ * Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
5967
+ * sqlite as a nullable TEXT column — old rows keep working unchanged.
5968
+ */
5969
+ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
5970
+ DeviceRole["Siren"] = "siren";
5971
+ DeviceRole["Floodlight"] = "floodlight";
5972
+ DeviceRole["Spotlight"] = "spotlight";
5973
+ DeviceRole["PirSensor"] = "pir-sensor";
5974
+ DeviceRole["Chime"] = "chime";
5975
+ DeviceRole["Autotrack"] = "autotrack";
5976
+ DeviceRole["Nightvision"] = "nightvision";
5977
+ DeviceRole["PrivacyMask"] = "privacy-mask";
5978
+ DeviceRole["Doorbell"] = "doorbell";
5979
+ /** Interior blind / shade / roller blind. HA `device_class: blind|shade`. */
5980
+ DeviceRole["CoverBlind"] = "cover-blind";
5981
+ /** Exterior roller shutter. HA `device_class: shutter`; Homematic BROLL. */
5982
+ DeviceRole["CoverShutter"] = "cover-shutter";
5983
+ /** Exterior awning. HA `device_class: awning`. */
5984
+ DeviceRole["CoverAwning"] = "cover-awning";
5985
+ /** Curtain / drape. HA `device_class: curtain`. */
5986
+ DeviceRole["CoverCurtain"] = "cover-curtain";
5987
+ /** Garage door. HA `device_class: garage`. A security actuator: exports gate it. */
5988
+ DeviceRole["CoverGarage"] = "cover-garage";
5989
+ /** Gate. HA `device_class: gate`. A security actuator: exports gate it. */
5990
+ DeviceRole["CoverGate"] = "cover-gate";
5991
+ /** Door. HA `device_class: door`. A security actuator: exports gate it. */
5992
+ DeviceRole["CoverDoor"] = "cover-door";
5993
+ /** Window. HA `device_class: window`. */
5994
+ DeviceRole["CoverWindow"] = "cover-window";
5995
+ /** Virtual HA toggle (input_boolean.*) — distinguishable from a
5996
+ * real Switch device for UI rendering / export adapters. */
5997
+ DeviceRole["BinaryHelper"] = "binary-helper";
5998
+ /** A smart plug: a `switch` whose source says it is an outlet (HA
5999
+ * `device_class: outlet`). The Alexa export shows it as a SMARTPLUG. */
6000
+ DeviceRole["Outlet"] = "outlet";
6001
+ /** Generic motion / occupancy / moving event source. Distinct from
6002
+ * the camera accessory PirSensor role: that one is a camera child;
6003
+ * this is a standalone HA / 3rd-party motion sensor. */
6004
+ DeviceRole["MotionSensor"] = "motion-sensor";
6005
+ DeviceRole["ContactSensor"] = "contact-sensor";
6006
+ DeviceRole["LeakSensor"] = "leak-sensor";
6007
+ DeviceRole["SmokeSensor"] = "smoke-sensor";
6008
+ DeviceRole["COSensor"] = "co-sensor";
6009
+ DeviceRole["GasSensor"] = "gas-sensor";
6010
+ DeviceRole["TamperSensor"] = "tamper-sensor";
6011
+ DeviceRole["VibrationSensor"] = "vibration-sensor";
6012
+ DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
6013
+ DeviceRole["SoundSensor"] = "sound-sensor";
6014
+ /** Fallback for `binary_sensor` without a known `device_class`. */
6015
+ DeviceRole["BinarySensor"] = "binary-sensor";
6016
+ DeviceRole["TemperatureSensor"] = "temperature-sensor";
6017
+ DeviceRole["HumiditySensor"] = "humidity-sensor";
6018
+ DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
6019
+ DeviceRole["PressureSensor"] = "pressure-sensor";
6020
+ /** Wind speed or direction (weather-station `wind-sensor` cap). */
6021
+ DeviceRole["WindSensor"] = "wind-sensor";
6022
+ /** Rain accumulation or rate (weather-station `rain-sensor` cap). */
6023
+ DeviceRole["RainSensor"] = "rain-sensor";
6024
+ /** UV index (weather-station `uv-sensor` cap). */
6025
+ DeviceRole["UvSensor"] = "uv-sensor";
6026
+ /** Solar irradiance W/m² (weather-station `solar-radiation-sensor` cap).
6027
+ * Distinct from AmbientLightSensor (lux). */
6028
+ DeviceRole["SolarRadiationSensor"] = "solar-radiation-sensor";
6029
+ /** Soil moisture % (garden/weather `soil-moisture-sensor` cap). */
6030
+ DeviceRole["SoilMoistureSensor"] = "soil-moisture-sensor";
6031
+ DeviceRole["PowerSensor"] = "power-sensor";
6032
+ DeviceRole["EnergySensor"] = "energy-sensor";
6033
+ DeviceRole["VoltageSensor"] = "voltage-sensor";
6034
+ DeviceRole["CurrentSensor"] = "current-sensor";
6035
+ DeviceRole["AirQualitySensor"] = "air-quality-sensor";
6036
+ /** Battery level (numeric % via `sensor` OR low-bool via
6037
+ * `binary_sensor` — the cap distinguishes via the value type). */
6038
+ DeviceRole["BatterySensor"] = "battery-sensor";
6039
+ /** Fallback for `sensor` numeric without a known `device_class`. */
6040
+ DeviceRole["NumericSensor"] = "numeric-sensor";
6041
+ /** String / enum state (HA `sensor` with `state_class: enum` or
6042
+ * `attributes.options`). */
6043
+ DeviceRole["EnumSensor"] = "enum-sensor";
6044
+ /** Date / timestamp state (HA `sensor` with `device_class: timestamp`
6045
+ * or `date`). The slice carries the raw ISO string verbatim (hosted on
6046
+ * the `enum-sensor` cap); the UI renders it locale-formatted. */
6047
+ DeviceRole["DateTimeSensor"] = "datetime-sensor";
6048
+ /** Last-resort fallback when nothing else matches. */
6049
+ DeviceRole["GenericSensor"] = "generic-sensor";
6050
+ DeviceRole["NumericControl"] = "numeric-control";
6051
+ DeviceRole["SelectControl"] = "select-control";
6052
+ DeviceRole["TextControl"] = "text-control";
6053
+ DeviceRole["DateTimeControl"] = "datetime-control";
6054
+ /** Mobile push notifier (HA `notify.mobile_app_*`) — supports
6055
+ * rich features (image, priority, channel routing). */
6056
+ DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
6057
+ /** Chat / messaging service (HA `notify.telegram_*`,
6058
+ * `notify.discord_*`, etc.). */
6059
+ DeviceRole["MessagingNotifier"] = "messaging-notifier";
6060
+ /** Email-based delivery (HA `notify.smtp`, etc.). */
6061
+ DeviceRole["EmailNotifier"] = "email-notifier";
6062
+ /** Fallback when the notifier service name doesn't match a known
6063
+ * pattern. */
6064
+ DeviceRole["GenericNotifier"] = "generic-notifier";
6065
+ /** Emits a pulse train (infrared or RF) on request — the `ir-transmitter`
6066
+ * cap. A `DeviceType.Generic` device. */
6067
+ DeviceRole["IrTransmitter"] = "ir-transmitter";
6068
+ return DeviceRole;
6069
+ }({});
6063
6070
  //#endregion
6064
- //#region ../types/dist/sleep-CQP-REJp.mjs
6071
+ //#region ../types/dist/sleep-7El4r5Bl.mjs
6065
6072
  /**
6066
6073
  * The audio chunk plane's byte format, and the ONE expansion from a coded
6067
6074
  * window to float samples (D455).
@@ -6815,7 +6822,7 @@ function switchRecordsOverMigrationApi(api) {
6815
6822
  };
6816
6823
  } };
6817
6824
  }
6818
- function integrationRowsApiOver(api) {
6825
+ function integrationRowsApiOver$1(api) {
6819
6826
  return {
6820
6827
  list: async () => (await api.integrations.list({})).integrations,
6821
6828
  readLegacyIntegrationRows: (input) => api.legacyRows.read(input),
@@ -8446,7 +8453,7 @@ function boundOf(list) {
8446
8453
  * Base class for CamStack addons. Eliminates settings boilerplate:
8447
8454
  *
8448
8455
  * - Typed `config` property with automatic resolution from store + defaults
8449
- * - `getGlobalSettings()` / `updateGlobalSettings()` auto-implemented
8456
+ * - the scoped settings API (`clusterSettings` / `nodeSettings` / `deviceDefaults`) auto-implemented
8450
8457
  * - `getAddonSettings()` / `updateAddonSettings()` auto-implemented
8451
8458
  * - `getDeviceSettings()` / `updateDeviceSettings()` auto-implemented
8452
8459
  * - `ctx` accessor for the AddonContext (no manual `this.ctxRef` storage)
@@ -8456,7 +8463,7 @@ function boundOf(list) {
8456
8463
  * Subclasses override:
8457
8464
  * - `onInitialize()` — addon-specific init logic, return ProviderRegistration[]
8458
8465
  * - `onShutdown()` — cleanup
8459
- * - `globalSettingsSchema()` / `deviceSettingsSchema()` — UI schemas
8466
+ * - `clusterSettingsSchema()` / `nodeSettingsSchema()` / `deviceSettingsSchema()` — UI schemas
8460
8467
  *
8461
8468
  * @example
8462
8469
  * ```ts
@@ -8470,7 +8477,7 @@ function boundOf(list) {
8470
8477
  * super({ maxRetries: 3, endpoint: 'http://localhost' })
8471
8478
  * }
8472
8479
  *
8473
- * protected globalSettingsSchema() {
8480
+ * protected clusterSettingsSchema() {
8474
8481
  * return this.schema({
8475
8482
  * sections: [{
8476
8483
  * id: 'main', title: 'Settings',
@@ -8513,7 +8520,7 @@ var BaseAddon = class {
8513
8520
  defaults;
8514
8521
  /**
8515
8522
  * Hidden-state paths that hold secrets (D787) — values the addon writes
8516
- * itself (`updateGlobalSettings`, `state()`) that no form field declares.
8523
+ * itself (`state()`, the scoped writers) that no form field declares.
8517
8524
  * Stored in the keychain exactly like a `password` field. Syntax:
8518
8525
  * `'snapshotSigningKey'`, `'identity.pincode'`, `'tokens[userId].accessToken'`
8519
8526
  * (`key[<id field>]` addresses array items by id, never by index).
@@ -8523,7 +8530,7 @@ var BaseAddon = class {
8523
8530
  /**
8524
8531
  * D986 M4: the scoped schemas this addon declared, resolved once per capability
8525
8532
  * (`loadScopedSchemas`) so the sync readers (`perNodeKeys`, the secret tree, the restart check)
8526
- * see them. Empty until loaded: the readers then fall back to {@link globalSettingsSchema}.
8533
+ * see them. Empty until loaded.
8527
8534
  */
8528
8535
  _scopedByCap = /* @__PURE__ */ new Map();
8529
8536
  _nodeKeysByCap = /* @__PURE__ */ new Map();
@@ -8647,7 +8654,7 @@ var BaseAddon = class {
8647
8654
  seq: 1e3,
8648
8655
  initialBody: spec.initialBody
8649
8656
  })], (a) => registrySwitchPortsOver({
8650
- api: integrationRowsApiOver(a),
8657
+ api: integrationRowsApiOver$1(a),
8651
8658
  records: switchRecordsOverMigrationApi(a),
8652
8659
  kind: spec.kind
8653
8660
  })).bind(api);
@@ -8709,7 +8716,7 @@ var BaseAddon = class {
8709
8716
  /** Addon-specific cleanup. Override if needed. */
8710
8717
  async onShutdown() {}
8711
8718
  /**
8712
- * Called after config is resolved during updateGlobalSettings/updateAddonSettings.
8719
+ * Called after config is resolved during a settings write.
8713
8720
  * Override to react to config changes (e.g. restart a sampler, reconnect a service).
8714
8721
  * Not called during initialize() — use onInitialize() for initial setup.
8715
8722
  */
@@ -8738,82 +8745,12 @@ var BaseAddon = class {
8738
8745
  scopedSettingsCapabilities() {
8739
8746
  return [];
8740
8747
  }
8741
- /** Override to provide global-level settings UI schema. */
8742
- globalSettingsSchema(_cap) {
8743
- return null;
8744
- }
8745
8748
  /** Override to provide device-level settings UI schema. */
8746
8749
  deviceSettingsSchema() {
8747
8750
  return null;
8748
8751
  }
8749
8752
  /**
8750
- * INTEGRATION-LEVEL SETTINGS — declare which of this addon's global sections
8751
- * ARE the configuration of its integration.
8752
- *
8753
- * Return the `ConfigSection.id`s, from {@link globalSettingsSchema}, that an
8754
- * operator should find on the addon's integration page (System →
8755
- * Integrations → <name>) rather than only in the cluster-wide list of every
8756
- * addon. Empty (the default) means the addon has no integration-level
8757
- * settings and no such surface is offered — this is opt-in, because whether
8758
- * an addon's configuration IS its integration's configuration depends on the
8759
- * nature of the integration.
8760
- *
8761
- * WHAT THIS IS NOT. It is not a scope. The selected sections keep living in
8762
- * the ONE global schema, in the ONE addon store, written by the ONE
8763
- * `updateGlobalSettings` path. There is deliberately no
8764
- * `updateIntegrationSettings`: a second write path is how a surface acquires
8765
- * a second store key, and this repo has shipped that twice (`btmPath@hub`,
8766
- * D266). Selecting sections cannot introduce a key that selecting cannot.
8767
- *
8768
- * WHY IT IS A LIST OF SECTION IDS AND NOT A MARKER ON THE SECTION.
8769
- * `ConfigFieldBase` used to carry `scope?: 'device' | 'global'` and it was
8770
- * removed with the reason recorded at
8771
- * `packages/types/src/interfaces/config-ui.ts:249` — *"a field's scope is
8772
- * determined by WHICH schema it lives in, not by a field-level marker."* A
8773
- * marker sprinkled across sections also has to borrow a field that already
8774
- * means something else; borrowing `section.tab` put the literal word
8775
- * "integration" into an operator-facing tab bar, because `tab` means "how to
8776
- * GROUP this visually" and cannot also mean "where this lives" (D269
8777
- * supersedes D268). One declaration, in one place, next to the schema whose
8778
- * ids it names.
8779
- */
8780
- integrationSettingSections() {
8781
- return [];
8782
- }
8783
- async getGlobalSettings(overlay, cap, nodeId) {
8784
- await this.loadScopedSchemas(cap);
8785
- const schema = this.globalSettingsSchema(cap) ?? this.scopedFormSchema(cap);
8786
- if (!schema) return { sections: [] };
8787
- const projected = await this.readRawProjectedStore(nodeId, cap);
8788
- return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(projected, overlay) : projected, { inlineSecretsAsViews: true });
8789
- }
8790
- /**
8791
- * The integration-level view of this addon's settings: exactly the sections
8792
- * named by {@link integrationSettingSections}, hydrated from the SAME store
8793
- * `getGlobalSettings` reads, and narrowed to cluster-scoped fields.
8794
- *
8795
- * Returns `null` when the addon declared nothing — an addon that opts out has
8796
- * no integration settings surface at all, rather than an empty one that reads
8797
- * as a failed load.
8798
- *
8799
- * Three properties hold BY CONSTRUCTION, which is why they are here in core
8800
- * and not in whichever UI happens to render this:
8801
- *
8802
- * 1. **One key.** The payload is a SUBSET of the global schema, so a field
8803
- * shown here is the same field, with the same bare key, that the addon's
8804
- * own page shows. There is no integration-specific writer — callers save
8805
- * through `updateGlobalSettings` — so a second store key is unreachable,
8806
- * not merely discouraged.
8807
- * 2. **No node scope.** `perNode: true` fields are DROPPED. Their store key
8808
- * is `<key>@<nodeId>` and an integration is not a node; whichever node
8809
- * such a field silently picked would be a wrong answer for the operator
8810
- * who opened the page (D266).
8811
- * 3. **No silent typo.** A declared id that names no section throws. The
8812
- * alternative — skip it — turns a rename into a surface that quietly
8813
- * empties, which looks exactly like an addon with nothing to configure.
8814
- */
8815
- /**
8816
- * The form schema of ONE integration instance, or `null` to use {@link globalSettingsSchema}.
8753
+ * The form schema of ONE integration instance, or `null` to use the scoped form.
8817
8754
  *
8818
8755
  * Override it only when an `instanceMode: multiple` addon's instances differ: an NVR integration
8819
8756
  * needs its connection fields, the default integration the addon's own sections. It is the
@@ -8986,6 +8923,19 @@ var BaseAddon = class {
8986
8923
  const overlay = await this.scopedSettingsOverlay(scope, cap, nodeId);
8987
8924
  return hydrateSchema(schema, overlay ? await this.overlayKeepingMarkers(stored, overlay) : stored, { inlineSecretsAsViews: true });
8988
8925
  }
8926
+ /**
8927
+ * The scoped schemas this addon serves: one entry per loaded (capability, scope), capabilities
8928
+ * in declaration order, scopes in {@link SCOPED_SETTINGS_SCOPES} order. `[]` when it declares
8929
+ * nothing.
8930
+ */
8931
+ async listScopedSettings() {
8932
+ await this.loadScopedSchemas();
8933
+ return [...this._scopedByCap].flatMap(([cap, entries]) => entries.map((entry) => ({
8934
+ cap,
8935
+ scope: entry.scope,
8936
+ sectionIds: entry.schema.sections.map((section) => section.id)
8937
+ })));
8938
+ }
8989
8939
  /** The OPERATOR's write of declared keys of one scope (D787 secret semantics). */
8990
8940
  async updateScopedSettings(scope, cap, patch, nodeId) {
8991
8941
  this._operatorWriteDepth++;
@@ -9011,32 +8961,15 @@ var BaseAddon = class {
9011
8961
  */
9012
8962
  async getIntegrationFormSchema(instance, nodeId) {
9013
8963
  const scoped = await this.integrationFormSchema(instance);
9014
- if (scoped === null) return this.getGlobalSettings(void 0, void 0, nodeId);
8964
+ if (scoped === null) return this.scopedForm(nodeId);
9015
8965
  return hydrateSchema(scoped, {}, { inlineSecretsAsViews: true });
9016
8966
  }
9017
- async getIntegrationSettings(nodeId) {
9018
- const declared = this.integrationSettingSections();
9019
- if (declared.length === 0) return null;
9020
- const schema = this.globalSettingsSchema();
9021
- if (!schema) throw new Error(`${this.constructor.name}: integrationSettingSections() names [${declared.join(", ")}] but globalSettingsSchema() returns null.`);
9022
- const byId = new Map(schema.sections.map((section) => [section.id, section]));
9023
- const sections = [];
9024
- for (const id of declared) {
9025
- const section = byId.get(id);
9026
- if (!section) throw new Error(`${this.constructor.name}: integrationSettingSections() names unknown section "${id}". Known sections: [${[...byId.keys()].join(", ")}].`);
9027
- const fields = dropPerNodeFields(section.fields);
9028
- if (fields.length === 0) continue;
9029
- sections.push({
9030
- ...section,
9031
- fields
9032
- });
9033
- }
9034
- if (sections.length === 0) return null;
9035
- const projected = await this.readRawProjectedStore(nodeId);
9036
- return hydrateSchema({
9037
- ...schema,
9038
- sections
9039
- }, projected, { inlineSecretsAsViews: true });
8967
+ /** The form of the scoped schemas this addon declared, hydrated from its store. */
8968
+ async scopedForm(nodeId) {
8969
+ await this.loadScopedSchemas();
8970
+ const schema = this.scopedFormSchema();
8971
+ if (!schema) return { sections: [] };
8972
+ return hydrateSchema(schema, await this.readRawProjectedStore(nodeId), { inlineSecretsAsViews: true });
9040
8973
  }
9041
8974
  /**
9042
8975
  * The raw addon store PROJECTED onto the target node's bare per-node keys:
@@ -9045,8 +8978,8 @@ var BaseAddon = class {
9045
8978
  * bare fallback), all `@`-scoped and stray bare per-node keys are dropped.
9046
8979
  * A no-op passthrough when the schema declares no `perNode` field.
9047
8980
  *
9048
- * This is the sanctioned way for a `getGlobalSettings` OVERRIDE that needs
9049
- * the store for custom option logic (option narrowing, value snapping) to
8981
+ * This is the sanctioned way for an addon that needs
8982
+ * the store for custom logic (option narrowing, value snapping) to
9050
8983
  * read it per-node — never `ctx.settings.readAddonStore()` directly.
9051
8984
  * `nodeId` omitted ⇒ the local node (node-blind injection from ctx).
9052
8985
  *
@@ -9098,7 +9031,7 @@ var BaseAddon = class {
9098
9031
  }
9099
9032
  /**
9100
9033
  * Whether ONE global key of this addon's store was written, read three-way
9101
- * (D651). For a question a hydrated view cannot answer: `getGlobalSettings`
9034
+ * (D651). For a question a hydrated view cannot answer: a hydrated form
9102
9035
  * reports `value ?? default`, so "the operator chose the default" and "nobody
9103
9036
  * chose" look the same, and a failed read looks like both. A `perNode` key is
9104
9037
  * not supported here: its stored name is scoped.
@@ -9132,7 +9065,7 @@ var BaseAddon = class {
9132
9065
  }
9133
9066
  /**
9134
9067
  * The OPERATOR's write — a settings form or an admin API call, dispatched by
9135
- * the kernel. Identical to {@link updateGlobalSettings}, except that a secret
9068
+ * the kernel. The one in-process write of the addon blob that is not a scoped write; a secret
9136
9069
  * the operator sends is stored as sent even when it equals a pre-keychain
9137
9070
  * inline value: the operator re-entering a password is a change, an addon
9138
9071
  * writing back what it read is not (D787).
@@ -9145,9 +9078,6 @@ var BaseAddon = class {
9145
9078
  this._operatorWriteDepth--;
9146
9079
  }
9147
9080
  }
9148
- async updateGlobalSettings(patch, nodeId) {
9149
- await this.applyGlobalPatch(patch, nodeId);
9150
- }
9151
9081
  /**
9152
9082
  * REMOVE stored secrets — their keychain values and their markers (D787).
9153
9083
  *
@@ -9190,8 +9120,7 @@ var BaseAddon = class {
9190
9120
  await this.resolveConfig();
9191
9121
  await this.onConfigChanged();
9192
9122
  this.emitLifecycle(EventCategory.AddonUpdated, { level: "global" });
9193
- const legacy = this.globalSettingsSchema();
9194
- this.maybeAutoRestart(Object.keys(barePatch), [...legacy === null ? [] : [legacy], ...this.loadedScopedSchemas().map((entry) => entry.schema)]);
9123
+ this.maybeAutoRestart(Object.keys(barePatch), this.loadedScopedSchemas().map((entry) => entry.schema));
9195
9124
  return true;
9196
9125
  }
9197
9126
  /**
@@ -9229,10 +9158,7 @@ var BaseAddon = class {
9229
9158
  this._nodeKeysByCap = /* @__PURE__ */ new Map();
9230
9159
  this._addonSecretTree = null;
9231
9160
  }
9232
- /**
9233
- * The form the settings API serves while an addon declares no {@link globalSettingsSchema}: the
9234
- * sections of its scoped schemas, so dropping the old hook does not blank the form.
9235
- */
9161
+ /** The form of an addon's scoped schemas: their sections, each shown once. */
9236
9162
  scopedFormSchema(cap) {
9237
9163
  const byId = /* @__PURE__ */ new Map();
9238
9164
  for (const entry of this.loadedScopedSchemas(cap)) for (const section of entry.schema.sections) if (!byId.has(section.id)) byId.set(section.id, section);
@@ -9244,8 +9170,7 @@ var BaseAddon = class {
9244
9170
  return [...this._scopedByCap.values()].flat();
9245
9171
  }
9246
9172
  /**
9247
- * The field keys that are stored per node: every field of a {@link nodeSettingsSchema}, plus
9248
- * the fields the legacy {@link globalSettingsSchema} still marks `perNode: true`. Derived once
9173
+ * The field keys that are stored per node: every field of a {@link nodeSettingsSchema}. Derived once
9249
9174
  * per `cap` argument and memoized (schemas are static declarations). Empty set ⇒ every
9250
9175
  * per-node code path is bypassed and the settings API behaves like the node-agnostic one.
9251
9176
  * Call {@link loadScopedSchemas} first (the async seams do).
@@ -9254,8 +9179,7 @@ var BaseAddon = class {
9254
9179
  const cacheKey = cap ?? "";
9255
9180
  const cached = this._nodeKeysByCap.get(cacheKey);
9256
9181
  if (cached) return cached;
9257
- const legacy = this.globalSettingsSchema(cap);
9258
- const keys = new Set(legacy ? legacy.sections.flatMap((section) => collectPerNodeFieldKeys(section.fields)) : []);
9182
+ const keys = /* @__PURE__ */ new Set();
9259
9183
  for (const { scope, schema } of this.loadedScopedSchemas(cap)) {
9260
9184
  if (scope !== "node") continue;
9261
9185
  for (const section of schema.sections) for (const key of collectValueFieldKeys(section.fields)) keys.add(key);
@@ -9473,8 +9397,6 @@ var BaseAddon = class {
9473
9397
  }
9474
9398
  declaredKeySet() {
9475
9399
  const keys = new Set(Object.keys(this.defaults));
9476
- const schema = this.globalSettingsSchema();
9477
- if (schema) for (const section of schema.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
9478
9400
  for (const { schema: scoped } of this.loadedScopedSchemas()) for (const section of scoped.sections) for (const key of collectFieldKeys(section.fields)) keys.add(key);
9479
9401
  for (const key of this._declaredStateKeys) keys.add(key);
9480
9402
  for (const path of this.secretStatePaths) {
@@ -9572,7 +9494,7 @@ var BaseAddon = class {
9572
9494
  /** The addon store's secret tree: schema fields by TYPE, plus `secretStatePaths`. */
9573
9495
  addonSecretTree() {
9574
9496
  if (this._addonSecretTree === null) {
9575
- const tree = new Map(secretTreeFromSchema(this.globalSettingsSchema()));
9497
+ const tree = /* @__PURE__ */ new Map();
9576
9498
  for (const { schema } of this.loadedScopedSchemas()) for (const [key, node] of secretTreeFromSchema(schema)) tree.set(key, node);
9577
9499
  this._addonSecretTree = mergeSecretStatePaths(tree, this.secretStatePaths);
9578
9500
  }
@@ -9784,47 +9706,6 @@ function classifyStoreError(err) {
9784
9706
  if (TRANSPORT_PHRASES.some((f) => message.includes(f))) return "transport";
9785
9707
  return "permanent";
9786
9708
  }
9787
- /**
9788
- * Collect the keys of every field marked `perNode: true`, recursing into
9789
- * layout containers (`group` fields and `sub-tabs` tabs) the same way
9790
- * `hydrateSchema` does. Valueless structural fields (separator/info/…)
9791
- * don't declare `perNode` and are excluded by the `in` narrowing.
9792
- */
9793
- /**
9794
- * The same fields with every `perNode: true` one removed, recursing into layout
9795
- * containers exactly as {@link collectPerNodeFieldKeys} does. A container left
9796
- * with no child is dropped rather than rendered empty.
9797
- *
9798
- * Used by `getIntegrationSettings`: an integration is not a node, so a field
9799
- * whose store key is `<key>@<nodeId>` has no node to belong to there.
9800
- */
9801
- function dropPerNodeFields(fields) {
9802
- const kept = [];
9803
- for (const field of fields) {
9804
- if (field.type === "group") {
9805
- const inner = dropPerNodeFields(field.fields);
9806
- if (inner.length > 0) kept.push({
9807
- ...field,
9808
- fields: inner
9809
- });
9810
- continue;
9811
- }
9812
- if (field.type === "sub-tabs") {
9813
- const tabs = field.tabs.map((tab) => ({
9814
- ...tab,
9815
- fields: dropPerNodeFields(tab.fields)
9816
- })).filter((tab) => tab.fields.length > 0);
9817
- if (tabs.length > 0) kept.push({
9818
- ...field,
9819
- tabs
9820
- });
9821
- continue;
9822
- }
9823
- if ("perNode" in field && field.perNode === true) continue;
9824
- kept.push(field);
9825
- }
9826
- return kept;
9827
- }
9828
9709
  /** The keys of the value-holding fields, recursing into layout containers. */
9829
9710
  function collectValueFieldKeys(fields) {
9830
9711
  const collected = [];
@@ -9857,21 +9738,6 @@ function collectFieldKeys(fields) {
9857
9738
  }
9858
9739
  return collected;
9859
9740
  }
9860
- function collectPerNodeFieldKeys(fields) {
9861
- const collected = [];
9862
- for (const field of fields) {
9863
- if (field.type === "group") {
9864
- collected.push(...collectPerNodeFieldKeys(field.fields));
9865
- continue;
9866
- }
9867
- if (field.type === "sub-tabs") {
9868
- for (const tab of field.tabs) collected.push(...collectPerNodeFieldKeys(tab.fields));
9869
- continue;
9870
- }
9871
- if ("perNode" in field && field.perNode === true) collected.push(field.key);
9872
- }
9873
- return collected;
9874
- }
9875
9741
  /**
9876
9742
  * Normalize an `ICamstackAddon.initialize()` return value into the
9877
9743
  * `AddonInitResult` envelope. Arrays are wrapped into `{ providers }`;
@@ -12632,13 +12498,25 @@ Object.freeze({
12632
12498
  "path": "temperature",
12633
12499
  "valueType": "number"
12634
12500
  }],
12635
- "timed-run": [{
12636
- "path": "activeUntil",
12637
- "valueType": "number"
12638
- }, {
12639
- "path": "requestedBy",
12640
- "valueType": "string"
12641
- }],
12501
+ "timed-run": [
12502
+ {
12503
+ "path": "activeUntil",
12504
+ "valueType": "number"
12505
+ },
12506
+ {
12507
+ "path": "requestedBy",
12508
+ "valueType": "string"
12509
+ },
12510
+ {
12511
+ "path": "quickRun.duration",
12512
+ "valueType": "number"
12513
+ },
12514
+ {
12515
+ "path": "quickRun.unit",
12516
+ "valueType": "enum",
12517
+ "enumValues": ["s", "min"]
12518
+ }
12519
+ ],
12642
12520
  "update": [
12643
12521
  {
12644
12522
  "path": "currentVersion",
@@ -12862,7 +12740,7 @@ object({
12862
12740
  params: record(string(), union([string(), number$1()])).optional()
12863
12741
  });
12864
12742
  //#endregion
12865
- //#region ../types/dist/composition-BmBHuDTQ.mjs
12743
+ //#region ../types/dist/composition-Bx0JvKUU.mjs
12866
12744
  /**
12867
12745
  * The ffmpeg build every CamStack node downloads, per platform and arch.
12868
12746
  *
@@ -14024,6 +13902,387 @@ var NodeColorIdSchema = _enum([
14024
13902
  "node-h"
14025
13903
  ]);
14026
13904
  //#endregion
13905
+ //#region ../types/dist/convert-BAzH15HU.mjs
13906
+ /**
13907
+ * Frozen unit → spec table. `•` in the doc marks each dimension's canonical
13908
+ * unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
13909
+ * `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
13910
+ * decimals). K derives from `°C = K − 273.15`.
13911
+ */
13912
+ var UNIT_TABLE = {
13913
+ "°C": {
13914
+ dimension: "temperature",
13915
+ factor: 1,
13916
+ offset: 0
13917
+ },
13918
+ "°F": {
13919
+ dimension: "temperature",
13920
+ factor: 5 / 9,
13921
+ offset: -160 / 9
13922
+ },
13923
+ K: {
13924
+ dimension: "temperature",
13925
+ factor: 1,
13926
+ offset: -273.15
13927
+ },
13928
+ hPa: {
13929
+ dimension: "pressure",
13930
+ factor: 1,
13931
+ offset: 0
13932
+ },
13933
+ kPa: {
13934
+ dimension: "pressure",
13935
+ factor: 10,
13936
+ offset: 0
13937
+ },
13938
+ Pa: {
13939
+ dimension: "pressure",
13940
+ factor: .01,
13941
+ offset: 0
13942
+ },
13943
+ mbar: {
13944
+ dimension: "pressure",
13945
+ factor: 1,
13946
+ offset: 0
13947
+ },
13948
+ bar: {
13949
+ dimension: "pressure",
13950
+ factor: 1e3,
13951
+ offset: 0
13952
+ },
13953
+ inHg: {
13954
+ dimension: "pressure",
13955
+ factor: 33.8639,
13956
+ offset: 0
13957
+ },
13958
+ mmHg: {
13959
+ dimension: "pressure",
13960
+ factor: 1.33322,
13961
+ offset: 0
13962
+ },
13963
+ psi: {
13964
+ dimension: "pressure",
13965
+ factor: 68.9476,
13966
+ offset: 0
13967
+ },
13968
+ "m/s": {
13969
+ dimension: "speed",
13970
+ factor: 1,
13971
+ offset: 0
13972
+ },
13973
+ "km/h": {
13974
+ dimension: "speed",
13975
+ factor: 1 / 3.6,
13976
+ offset: 0
13977
+ },
13978
+ mph: {
13979
+ dimension: "speed",
13980
+ factor: .44704,
13981
+ offset: 0
13982
+ },
13983
+ kn: {
13984
+ dimension: "speed",
13985
+ factor: .514444,
13986
+ offset: 0
13987
+ },
13988
+ "mm/h": {
13989
+ dimension: "precipitation-rate",
13990
+ factor: 1,
13991
+ offset: 0
13992
+ },
13993
+ "in/h": {
13994
+ dimension: "precipitation-rate",
13995
+ factor: 25.4,
13996
+ offset: 0
13997
+ },
13998
+ m: {
13999
+ dimension: "length",
14000
+ factor: 1,
14001
+ offset: 0
14002
+ },
14003
+ mm: {
14004
+ dimension: "length",
14005
+ factor: .001,
14006
+ offset: 0
14007
+ },
14008
+ cm: {
14009
+ dimension: "length",
14010
+ factor: .01,
14011
+ offset: 0
14012
+ },
14013
+ km: {
14014
+ dimension: "length",
14015
+ factor: 1e3,
14016
+ offset: 0
14017
+ },
14018
+ in: {
14019
+ dimension: "length",
14020
+ factor: .0254,
14021
+ offset: 0
14022
+ },
14023
+ ft: {
14024
+ dimension: "length",
14025
+ factor: .3048,
14026
+ offset: 0
14027
+ },
14028
+ mi: {
14029
+ dimension: "length",
14030
+ factor: 1609.344,
14031
+ offset: 0
14032
+ },
14033
+ "m²": {
14034
+ dimension: "area",
14035
+ factor: 1,
14036
+ offset: 0
14037
+ },
14038
+ lx: {
14039
+ dimension: "illuminance",
14040
+ factor: 1,
14041
+ offset: 0
14042
+ },
14043
+ "W/m²": {
14044
+ dimension: "irradiance",
14045
+ factor: 1,
14046
+ offset: 0
14047
+ },
14048
+ W: {
14049
+ dimension: "power",
14050
+ factor: 1,
14051
+ offset: 0
14052
+ },
14053
+ kW: {
14054
+ dimension: "power",
14055
+ factor: 1e3,
14056
+ offset: 0
14057
+ },
14058
+ VA: {
14059
+ dimension: "apparent-power",
14060
+ factor: 1,
14061
+ offset: 0
14062
+ },
14063
+ Wh: {
14064
+ dimension: "energy",
14065
+ factor: 1,
14066
+ offset: 0
14067
+ },
14068
+ kWh: {
14069
+ dimension: "energy",
14070
+ factor: 1e3,
14071
+ offset: 0
14072
+ },
14073
+ MWh: {
14074
+ dimension: "energy",
14075
+ factor: 1e6,
14076
+ offset: 0
14077
+ },
14078
+ V: {
14079
+ dimension: "voltage",
14080
+ factor: 1,
14081
+ offset: 0
14082
+ },
14083
+ mV: {
14084
+ dimension: "voltage",
14085
+ factor: .001,
14086
+ offset: 0
14087
+ },
14088
+ A: {
14089
+ dimension: "current",
14090
+ factor: 1,
14091
+ offset: 0
14092
+ },
14093
+ mA: {
14094
+ dimension: "current",
14095
+ factor: .001,
14096
+ offset: 0
14097
+ },
14098
+ ppm: {
14099
+ dimension: "concentration-volume",
14100
+ factor: 1,
14101
+ offset: 0
14102
+ },
14103
+ ppb: {
14104
+ dimension: "concentration-volume",
14105
+ factor: .001,
14106
+ offset: 0
14107
+ },
14108
+ "µg/m³": {
14109
+ dimension: "concentration-mass",
14110
+ factor: 1,
14111
+ offset: 0
14112
+ },
14113
+ "mg/m³": {
14114
+ dimension: "concentration-mass",
14115
+ factor: 1e3,
14116
+ offset: 0
14117
+ },
14118
+ kg: {
14119
+ dimension: "mass",
14120
+ factor: 1,
14121
+ offset: 0
14122
+ },
14123
+ g: {
14124
+ dimension: "mass",
14125
+ factor: .001,
14126
+ offset: 0
14127
+ },
14128
+ lb: {
14129
+ dimension: "mass",
14130
+ factor: .453592,
14131
+ offset: 0
14132
+ },
14133
+ oz: {
14134
+ dimension: "mass",
14135
+ factor: .0283495,
14136
+ offset: 0
14137
+ },
14138
+ "%": {
14139
+ dimension: "percentage",
14140
+ factor: 1,
14141
+ offset: 0
14142
+ },
14143
+ L: {
14144
+ dimension: "volume",
14145
+ factor: 1,
14146
+ offset: 0
14147
+ },
14148
+ mL: {
14149
+ dimension: "volume",
14150
+ factor: .001,
14151
+ offset: 0
14152
+ },
14153
+ gal: {
14154
+ dimension: "volume",
14155
+ factor: 3.785411784,
14156
+ offset: 0
14157
+ },
14158
+ s: {
14159
+ dimension: "duration",
14160
+ factor: 1,
14161
+ offset: 0
14162
+ },
14163
+ ms: {
14164
+ dimension: "duration",
14165
+ factor: .001,
14166
+ offset: 0
14167
+ },
14168
+ min: {
14169
+ dimension: "duration",
14170
+ factor: 60,
14171
+ offset: 0
14172
+ },
14173
+ h: {
14174
+ dimension: "duration",
14175
+ factor: 3600,
14176
+ offset: 0
14177
+ },
14178
+ d: {
14179
+ dimension: "duration",
14180
+ factor: 86400,
14181
+ offset: 0
14182
+ },
14183
+ B: {
14184
+ dimension: "information",
14185
+ factor: 1,
14186
+ offset: 0
14187
+ },
14188
+ KiB: {
14189
+ dimension: "information",
14190
+ factor: 1024,
14191
+ offset: 0
14192
+ },
14193
+ MiB: {
14194
+ dimension: "information",
14195
+ factor: 1024 ** 2,
14196
+ offset: 0
14197
+ },
14198
+ GiB: {
14199
+ dimension: "information",
14200
+ factor: 1024 ** 3,
14201
+ offset: 0
14202
+ },
14203
+ TiB: {
14204
+ dimension: "information",
14205
+ factor: 1024 ** 4,
14206
+ offset: 0
14207
+ },
14208
+ kB: {
14209
+ dimension: "information",
14210
+ factor: 1e3,
14211
+ offset: 0
14212
+ },
14213
+ MB: {
14214
+ dimension: "information",
14215
+ factor: 1e6,
14216
+ offset: 0
14217
+ },
14218
+ GB: {
14219
+ dimension: "information",
14220
+ factor: 1e9,
14221
+ offset: 0
14222
+ },
14223
+ "°": {
14224
+ dimension: "angle",
14225
+ factor: 1,
14226
+ offset: 0
14227
+ },
14228
+ dBFS: {
14229
+ dimension: "sound-level",
14230
+ factor: 1,
14231
+ offset: 0
14232
+ },
14233
+ dBm: {
14234
+ dimension: "signal-level",
14235
+ factor: 1,
14236
+ offset: 0
14237
+ },
14238
+ mired: {
14239
+ dimension: "colour-temperature",
14240
+ factor: 1,
14241
+ offset: 0
14242
+ },
14243
+ kbps: {
14244
+ dimension: "bitrate",
14245
+ factor: 1,
14246
+ offset: 0
14247
+ },
14248
+ Mbps: {
14249
+ dimension: "bitrate",
14250
+ factor: 1e3,
14251
+ offset: 0
14252
+ },
14253
+ fps: {
14254
+ dimension: "rate",
14255
+ factor: 1,
14256
+ offset: 0
14257
+ }
14258
+ };
14259
+ /** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
14260
+ function specFor(unit) {
14261
+ return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
14262
+ }
14263
+ /** Value in `spec`'s unit → its dimension's canonical unit. */
14264
+ function toCanonical(value, spec) {
14265
+ return value * spec.factor + spec.offset;
14266
+ }
14267
+ /** Canonical-unit value → the unit described by `spec`. */
14268
+ function fromCanonical(canonical, spec) {
14269
+ return (canonical - spec.offset) / spec.factor;
14270
+ }
14271
+ /**
14272
+ * Graceful variant for the render path: returns the converted value, or
14273
+ * `undefined` when the conversion is refused (unknown unit / cross-dimension).
14274
+ * Never throws — a render caller falls back to the raw value + source unit.
14275
+ */
14276
+ function tryConvertUnit(value, from, to) {
14277
+ if (from === to) return value;
14278
+ const fromSpec = specFor(from);
14279
+ if (!fromSpec) return void 0;
14280
+ const toSpec = specFor(to);
14281
+ if (!toSpec) return void 0;
14282
+ if (fromSpec.dimension !== toSpec.dimension) return void 0;
14283
+ return fromCanonical(toCanonical(value, fromSpec), toSpec);
14284
+ }
14285
+ //#endregion
14027
14286
  //#region ../types/dist/index.mjs
14028
14287
  var SMTP_INBOUND_DEFAULT_PORT = 2525;
14029
14288
  var SMTP_INBOUND_DEFAULT_DOMAIN = "camstack.local";
@@ -16244,20 +16503,6 @@ async function flattenNestedRecords(ports, spec) {
16244
16503
  summary: { converted: rows.size }
16245
16504
  };
16246
16505
  }
16247
- /** The ports over one kind's records handle. */
16248
- function flattenPortsOver(handle) {
16249
- return {
16250
- listNested: async (legacyKey) => (await handle.query({ limit: 1e3 })).records.filter((r) => legacyKey in r.data).map((r) => r.id),
16251
- readResolved: async (id) => {
16252
- const row = await handle.getResolved(id);
16253
- if (row === null) throw new Error("the record is gone");
16254
- return row.data;
16255
- },
16256
- patch: async (id, patch) => {
16257
- await handle.patch(id, patch);
16258
- }
16259
- };
16260
- }
16261
16506
  /**
16262
16507
  * The addon-side ports of `moveIntegrationRowsToRecords` (planning#416). An addon runs the move
16263
16508
  * from its own process, so the leftover rows are reached through the migration-only door
@@ -16305,25 +16550,6 @@ function integrationRowsPortsOverApi(deps) {
16305
16550
  }
16306
16551
  };
16307
16552
  }
16308
- function defaultIntegrationApiOver(api) {
16309
- return {
16310
- list: () => api.integrations.list.query(),
16311
- readLegacyIntegrationRows: (input) => api.migrations.readLegacyIntegrationRows.query(input),
16312
- clearLegacyIntegrationRows: (input) => api.migrations.clearLegacyIntegrationRows.mutate(input),
16313
- listDevices: (addonId) => api.deviceManager.listAll.query({
16314
- addonId,
16315
- projection: "slim"
16316
- }),
16317
- setDeviceIntegrationId: async (deviceId, integrationId) => {
16318
- await api.deviceManager.setIntegrationId.mutate({
16319
- deviceId,
16320
- integrationId
16321
- });
16322
- },
16323
- readDeviceHasConfig: async (deviceId) => Object.keys((await api.deviceManager.getDevice.query({ deviceId }))?.config ?? {}).length > 0,
16324
- readDeviceIntegrationId: async (deviceId) => (await api.deviceManager.getDevice.query({ deviceId }))?.integrationId ?? null
16325
- };
16326
- }
16327
16553
  /**
16328
16554
  * The trainer contract — what the hub hands the cloud trainer and what it
16329
16555
  * gets back (cloud training, D805+).
@@ -43521,6 +43747,7 @@ var ExpressionBindingSourceSchema = union([
43521
43747
  object({
43522
43748
  kind: literal("global"),
43523
43749
  sourceStableId: string(),
43750
+ addonId: string().optional(),
43524
43751
  cap: string(),
43525
43752
  fieldPath: string()
43526
43753
  })
@@ -43647,385 +43874,6 @@ function extractSourceInfoFromMetadata(metadata) {
43647
43874
  return parsed.data;
43648
43875
  }
43649
43876
  /**
43650
- * Frozen unit → spec table. `•` in the doc marks each dimension's canonical
43651
- * unit (`factor: 1, offset: 0`). °F derives from `°C = (°F − 32) × 5/9` ⇒
43652
- * `factor = 5/9`, `offset = -160/9` (kept as exact expressions, not rounded
43653
- * decimals). K derives from `°C = K − 273.15`.
43654
- */
43655
- var UNIT_TABLE = {
43656
- "°C": {
43657
- dimension: "temperature",
43658
- factor: 1,
43659
- offset: 0
43660
- },
43661
- "°F": {
43662
- dimension: "temperature",
43663
- factor: 5 / 9,
43664
- offset: -160 / 9
43665
- },
43666
- K: {
43667
- dimension: "temperature",
43668
- factor: 1,
43669
- offset: -273.15
43670
- },
43671
- hPa: {
43672
- dimension: "pressure",
43673
- factor: 1,
43674
- offset: 0
43675
- },
43676
- kPa: {
43677
- dimension: "pressure",
43678
- factor: 10,
43679
- offset: 0
43680
- },
43681
- Pa: {
43682
- dimension: "pressure",
43683
- factor: .01,
43684
- offset: 0
43685
- },
43686
- mbar: {
43687
- dimension: "pressure",
43688
- factor: 1,
43689
- offset: 0
43690
- },
43691
- bar: {
43692
- dimension: "pressure",
43693
- factor: 1e3,
43694
- offset: 0
43695
- },
43696
- inHg: {
43697
- dimension: "pressure",
43698
- factor: 33.8639,
43699
- offset: 0
43700
- },
43701
- mmHg: {
43702
- dimension: "pressure",
43703
- factor: 1.33322,
43704
- offset: 0
43705
- },
43706
- psi: {
43707
- dimension: "pressure",
43708
- factor: 68.9476,
43709
- offset: 0
43710
- },
43711
- "m/s": {
43712
- dimension: "speed",
43713
- factor: 1,
43714
- offset: 0
43715
- },
43716
- "km/h": {
43717
- dimension: "speed",
43718
- factor: 1 / 3.6,
43719
- offset: 0
43720
- },
43721
- mph: {
43722
- dimension: "speed",
43723
- factor: .44704,
43724
- offset: 0
43725
- },
43726
- kn: {
43727
- dimension: "speed",
43728
- factor: .514444,
43729
- offset: 0
43730
- },
43731
- "mm/h": {
43732
- dimension: "precipitation-rate",
43733
- factor: 1,
43734
- offset: 0
43735
- },
43736
- "in/h": {
43737
- dimension: "precipitation-rate",
43738
- factor: 25.4,
43739
- offset: 0
43740
- },
43741
- m: {
43742
- dimension: "length",
43743
- factor: 1,
43744
- offset: 0
43745
- },
43746
- mm: {
43747
- dimension: "length",
43748
- factor: .001,
43749
- offset: 0
43750
- },
43751
- cm: {
43752
- dimension: "length",
43753
- factor: .01,
43754
- offset: 0
43755
- },
43756
- km: {
43757
- dimension: "length",
43758
- factor: 1e3,
43759
- offset: 0
43760
- },
43761
- in: {
43762
- dimension: "length",
43763
- factor: .0254,
43764
- offset: 0
43765
- },
43766
- ft: {
43767
- dimension: "length",
43768
- factor: .3048,
43769
- offset: 0
43770
- },
43771
- mi: {
43772
- dimension: "length",
43773
- factor: 1609.344,
43774
- offset: 0
43775
- },
43776
- "m²": {
43777
- dimension: "area",
43778
- factor: 1,
43779
- offset: 0
43780
- },
43781
- lx: {
43782
- dimension: "illuminance",
43783
- factor: 1,
43784
- offset: 0
43785
- },
43786
- "W/m²": {
43787
- dimension: "irradiance",
43788
- factor: 1,
43789
- offset: 0
43790
- },
43791
- W: {
43792
- dimension: "power",
43793
- factor: 1,
43794
- offset: 0
43795
- },
43796
- kW: {
43797
- dimension: "power",
43798
- factor: 1e3,
43799
- offset: 0
43800
- },
43801
- VA: {
43802
- dimension: "apparent-power",
43803
- factor: 1,
43804
- offset: 0
43805
- },
43806
- Wh: {
43807
- dimension: "energy",
43808
- factor: 1,
43809
- offset: 0
43810
- },
43811
- kWh: {
43812
- dimension: "energy",
43813
- factor: 1e3,
43814
- offset: 0
43815
- },
43816
- MWh: {
43817
- dimension: "energy",
43818
- factor: 1e6,
43819
- offset: 0
43820
- },
43821
- V: {
43822
- dimension: "voltage",
43823
- factor: 1,
43824
- offset: 0
43825
- },
43826
- mV: {
43827
- dimension: "voltage",
43828
- factor: .001,
43829
- offset: 0
43830
- },
43831
- A: {
43832
- dimension: "current",
43833
- factor: 1,
43834
- offset: 0
43835
- },
43836
- mA: {
43837
- dimension: "current",
43838
- factor: .001,
43839
- offset: 0
43840
- },
43841
- ppm: {
43842
- dimension: "concentration-volume",
43843
- factor: 1,
43844
- offset: 0
43845
- },
43846
- ppb: {
43847
- dimension: "concentration-volume",
43848
- factor: .001,
43849
- offset: 0
43850
- },
43851
- "µg/m³": {
43852
- dimension: "concentration-mass",
43853
- factor: 1,
43854
- offset: 0
43855
- },
43856
- "mg/m³": {
43857
- dimension: "concentration-mass",
43858
- factor: 1e3,
43859
- offset: 0
43860
- },
43861
- kg: {
43862
- dimension: "mass",
43863
- factor: 1,
43864
- offset: 0
43865
- },
43866
- g: {
43867
- dimension: "mass",
43868
- factor: .001,
43869
- offset: 0
43870
- },
43871
- lb: {
43872
- dimension: "mass",
43873
- factor: .453592,
43874
- offset: 0
43875
- },
43876
- oz: {
43877
- dimension: "mass",
43878
- factor: .0283495,
43879
- offset: 0
43880
- },
43881
- "%": {
43882
- dimension: "percentage",
43883
- factor: 1,
43884
- offset: 0
43885
- },
43886
- L: {
43887
- dimension: "volume",
43888
- factor: 1,
43889
- offset: 0
43890
- },
43891
- mL: {
43892
- dimension: "volume",
43893
- factor: .001,
43894
- offset: 0
43895
- },
43896
- gal: {
43897
- dimension: "volume",
43898
- factor: 3.785411784,
43899
- offset: 0
43900
- },
43901
- s: {
43902
- dimension: "duration",
43903
- factor: 1,
43904
- offset: 0
43905
- },
43906
- ms: {
43907
- dimension: "duration",
43908
- factor: .001,
43909
- offset: 0
43910
- },
43911
- min: {
43912
- dimension: "duration",
43913
- factor: 60,
43914
- offset: 0
43915
- },
43916
- h: {
43917
- dimension: "duration",
43918
- factor: 3600,
43919
- offset: 0
43920
- },
43921
- d: {
43922
- dimension: "duration",
43923
- factor: 86400,
43924
- offset: 0
43925
- },
43926
- B: {
43927
- dimension: "information",
43928
- factor: 1,
43929
- offset: 0
43930
- },
43931
- KiB: {
43932
- dimension: "information",
43933
- factor: 1024,
43934
- offset: 0
43935
- },
43936
- MiB: {
43937
- dimension: "information",
43938
- factor: 1024 ** 2,
43939
- offset: 0
43940
- },
43941
- GiB: {
43942
- dimension: "information",
43943
- factor: 1024 ** 3,
43944
- offset: 0
43945
- },
43946
- TiB: {
43947
- dimension: "information",
43948
- factor: 1024 ** 4,
43949
- offset: 0
43950
- },
43951
- kB: {
43952
- dimension: "information",
43953
- factor: 1e3,
43954
- offset: 0
43955
- },
43956
- MB: {
43957
- dimension: "information",
43958
- factor: 1e6,
43959
- offset: 0
43960
- },
43961
- GB: {
43962
- dimension: "information",
43963
- factor: 1e9,
43964
- offset: 0
43965
- },
43966
- "°": {
43967
- dimension: "angle",
43968
- factor: 1,
43969
- offset: 0
43970
- },
43971
- dBFS: {
43972
- dimension: "sound-level",
43973
- factor: 1,
43974
- offset: 0
43975
- },
43976
- dBm: {
43977
- dimension: "signal-level",
43978
- factor: 1,
43979
- offset: 0
43980
- },
43981
- mired: {
43982
- dimension: "colour-temperature",
43983
- factor: 1,
43984
- offset: 0
43985
- },
43986
- kbps: {
43987
- dimension: "bitrate",
43988
- factor: 1,
43989
- offset: 0
43990
- },
43991
- Mbps: {
43992
- dimension: "bitrate",
43993
- factor: 1e3,
43994
- offset: 0
43995
- },
43996
- fps: {
43997
- dimension: "rate",
43998
- factor: 1,
43999
- offset: 0
44000
- }
44001
- };
44002
- /** Resolve a unit's `UnitSpec`, or `undefined` when the spelling is unknown. */
44003
- function specFor(unit) {
44004
- return Object.hasOwn(UNIT_TABLE, unit) ? UNIT_TABLE[unit] : void 0;
44005
- }
44006
- /** Value in `spec`'s unit → its dimension's canonical unit. */
44007
- function toCanonical(value, spec) {
44008
- return value * spec.factor + spec.offset;
44009
- }
44010
- /** Canonical-unit value → the unit described by `spec`. */
44011
- function fromCanonical(canonical, spec) {
44012
- return (canonical - spec.offset) / spec.factor;
44013
- }
44014
- /**
44015
- * Graceful variant for the render path: returns the converted value, or
44016
- * `undefined` when the conversion is refused (unknown unit / cross-dimension).
44017
- * Never throws — a render caller falls back to the raw value + source unit.
44018
- */
44019
- function tryConvertUnit(value, from, to) {
44020
- if (from === to) return value;
44021
- const fromSpec = specFor(from);
44022
- if (!fromSpec) return void 0;
44023
- const toSpec = specFor(to);
44024
- if (!toSpec) return void 0;
44025
- if (fromSpec.dimension !== toSpec.dimension) return void 0;
44026
- return fromCanonical(toCanonical(value, fromSpec), toSpec);
44027
- }
44028
- /**
44029
43877
  * A number a person types for a physical quantity — the input side of the
44030
43878
  * value + unit contract (D972).
44031
43879
  *
@@ -45723,26 +45571,23 @@ var SettingsSchemaWithValuesSchema = object({
45723
45571
  var SettingsPatchSchema = record(string(), unknown());
45724
45572
  /** The scope of a scoped-settings call (D986): where the capability declared the values. */
45725
45573
  var ScopedSettingsScopeSchema = _enum(SCOPED_SETTINGS_SCOPES);
45574
+ /** One scoped schema an addon serves: its capability, scope and section ids. */
45575
+ var ScopedSettingsDeclarationSchema = object({
45576
+ cap: string(),
45577
+ scope: ScopedSettingsScopeSchema,
45578
+ sectionIds: array(string())
45579
+ });
45726
45580
  /** Standard success response for update operations. */
45727
45581
  var SettingsUpdateResultSchema = object({ success: literal(true) });
45728
45582
  method(object({
45729
- addonId: string(),
45730
- nodeId: string().optional(),
45731
- overlay: record(string(), unknown()).optional(),
45732
- cap: string().optional()
45733
- }), SettingsSchemaWithValuesSchema.nullable()), method(object({
45734
- addonId: string(),
45735
- nodeId: string().optional(),
45736
- patch: SettingsPatchSchema
45737
- }), SettingsUpdateResultSchema, {
45738
- kind: "mutation",
45739
- auth: "admin"
45740
- }), method(object({
45741
45583
  addonId: string(),
45742
45584
  cap: string(),
45743
45585
  scope: ScopedSettingsScopeSchema,
45744
45586
  nodeId: string().optional()
45745
45587
  }), SettingsSchemaWithValuesSchema.nullable()), method(object({
45588
+ addonId: string(),
45589
+ nodeId: string().optional()
45590
+ }), array(ScopedSettingsDeclarationSchema).nullable()), method(object({
45746
45591
  addonId: string(),
45747
45592
  cap: string(),
45748
45593
  scope: ScopedSettingsScopeSchema,
@@ -45757,9 +45602,6 @@ method(object({
45757
45602
  scope: ScopedSettingsScopeSchema,
45758
45603
  nodeId: string().optional()
45759
45604
  }), record(string(), unknown()).nullable()), method(object({
45760
- addonId: string(),
45761
- nodeId: string().optional()
45762
- }), SettingsSchemaWithValuesSchema.nullable()), method(object({
45763
45605
  addonId: string(),
45764
45606
  nodeId: string().optional(),
45765
45607
  instance: IntegrationInstanceRefSchema
@@ -47322,7 +47164,7 @@ var BackupDestinationInfoSchema = object({
47322
47164
  id: string(),
47323
47165
  /**
47324
47166
  * Manifest id of the owning addon. The Settings button on the
47325
- * destination card opens that addon's `globalSettingsSchema` panel.
47167
+ * destination card opens that addon's scoped settings panel.
47326
47168
  */
47327
47169
  addonId: string(),
47328
47170
  /** Operator-toggled enable flag from the destination-policy table. */
@@ -52799,6 +52641,7 @@ method(InstancePinSchema, DeviceExportStatusSchema), method(_void(), array(Expor
52799
52641
  kind: "mutation",
52800
52642
  auth: "admin"
52801
52643
  });
52644
+ var DeviceAliasSchema = string().max(64).regex(/^[a-z][a-z0-9_]*$/);
52802
52645
  /**
52803
52646
  * A SITE ZONE — a named part of the property that several locations belong to.
52804
52647
  *
@@ -53285,6 +53128,12 @@ var DeviceInfoSchema = object({
53285
53128
  addonId: string(),
53286
53129
  type: _enum(DeviceType),
53287
53130
  name: string(),
53131
+ /** The name a value template uses for this device (`{{ stufa_veranda.temperature }}`),
53132
+ * entity_id style. Generated once from the name at first registration, unique
53133
+ * cluster-wide, editable through `setAlias`, NOT changed by a rename (D1021).
53134
+ * Optional: a record produced by an older build omits it until the boot
53135
+ * backfill has run. */
53136
+ alias: DeviceAliasSchema.optional(),
53288
53137
  /** Operator-organisational location label. `null` when unset. */
53289
53138
  location: string().nullable(),
53290
53139
  /** Soft-disabled flag. */
@@ -53604,6 +53453,25 @@ method(object({
53604
53453
  }), _void(), {
53605
53454
  kind: "mutation",
53606
53455
  auth: "admin"
53456
+ }), method(object({
53457
+ deviceId: number$1(),
53458
+ alias: string()
53459
+ }), discriminatedUnion("ok", [object({
53460
+ ok: literal(true),
53461
+ alias: DeviceAliasSchema
53462
+ }), object({
53463
+ ok: literal(false),
53464
+ reason: _enum([
53465
+ "empty",
53466
+ "too-long",
53467
+ "grammar",
53468
+ "reserved",
53469
+ "taken"
53470
+ ]),
53471
+ takenBy: number$1().optional()
53472
+ })]), {
53473
+ kind: "mutation",
53474
+ auth: "admin"
53607
53475
  }), method(object({
53608
53476
  deviceId: number$1(),
53609
53477
  location: string().nullable()
@@ -67704,6 +67572,11 @@ var NcScheduleSchema = object({
67704
67572
  * as a STATE SUMMARY at the end of each window of `schedule`.
67705
67573
  */
67706
67574
  var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
67575
+ _enum([
67576
+ "activation",
67577
+ "deactivation",
67578
+ "schedule"
67579
+ ]);
67707
67580
  /**
67708
67581
  * How a summary window is SENT (D698): `rule` (absent) = ONE notification with
67709
67582
  * every section; `section` = one notification per section with something to
@@ -67720,11 +67593,26 @@ var NcStateSummarySplitSchema = _enum(["rule", "section"]);
67720
67593
  * midnight crossing); the send time is each window's END. Refused on the
67721
67594
  * `alarm` family, which stays instant (`systemEventDeliveryProblems`).
67722
67595
  */
67723
- var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
67724
- mode: literal("summary"),
67725
- schedule: NcScheduleSchema,
67726
- split: NcStateSummarySplitSchema.optional()
67727
- })]);
67596
+ var NcSystemEventDeliverySchema = discriminatedUnion("mode", [
67597
+ object({ mode: literal("instant") }),
67598
+ object({
67599
+ mode: literal("summary"),
67600
+ schedule: NcScheduleSchema,
67601
+ split: NcStateSummarySplitSchema.optional()
67602
+ }),
67603
+ object({
67604
+ mode: literal("modes"),
67605
+ /** The bad edge, and every kind that has a single edge. */
67606
+ onActivation: boolean(),
67607
+ /** The recovery edges of the classes of the selected kinds (derived, never stored per kind). */
67608
+ onDeactivation: boolean(),
67609
+ /** A state summary at the end of each window; absent = no summary. */
67610
+ onSchedule: object({
67611
+ schedule: NcScheduleSchema,
67612
+ grouping: NcStateSummarySplitSchema
67613
+ }).optional()
67614
+ })
67615
+ ]);
67728
67616
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
67729
67617
  var NcPlateMatcherSchema = object({
67730
67618
  /**
@@ -75815,93 +75703,27 @@ var RunningFlipEventDataSchema = object({
75815
75703
  phase: string().nullable()
75816
75704
  });
75817
75705
  var RUNNING_DEVICE_TYPES = Object.values(DeviceType);
75818
- /** Generic Customize target for the running boolean (D936). */
75819
- var runningCustomize = {
75820
- version: 1,
75821
- overridable: [{
75822
- path: "running",
75823
- by: "running"
75824
- }],
75825
- targets: [{
75826
- id: "running",
75827
- cardinality: "scalar",
75828
- vocabulary: {
75829
- cap: "running-state",
75830
- stateField: "running"
75831
- },
75832
- deviceTypes: [
75833
- DeviceType.Washer,
75834
- DeviceType.Dryer,
75835
- DeviceType.Dishwasher,
75836
- DeviceType.Vacuum,
75837
- DeviceType.LawnMower,
75838
- DeviceType.MediaPlayer,
75839
- DeviceType.WaterHeater,
75840
- DeviceType.Humidifier,
75841
- DeviceType.Fan,
75842
- DeviceType.Climate,
75843
- DeviceType.Thermostat,
75844
- DeviceType.PetFeeder,
75845
- DeviceType.Heater
75846
- ],
75847
- apply: "add",
75848
- path: "running",
75849
- sources: [
75850
- {
75851
- kind: "switch",
75852
- transforms: [{ kind: "identity" }]
75853
- },
75854
- {
75855
- kind: "binary",
75856
- transforms: [{ kind: "identity" }, { kind: "invert" }]
75857
- },
75858
- {
75859
- kind: "numeric",
75860
- requiredUnit: "W",
75861
- transforms: [{
75862
- kind: "threshold",
75863
- comparisons: ["gte", "lte"],
75864
- comparison: "gte",
75865
- defaultThreshold: 5,
75866
- defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
75867
- defaultStopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
75868
- thresholdUnit: "W"
75869
- }]
75870
- }
75871
- ],
75872
- companions: [
75873
- {
75874
- kind: "constant",
75875
- path: "source",
75876
- value: "assigned",
75877
- when: "always"
75878
- },
75879
- {
75880
- kind: "constant",
75881
- path: "phase",
75882
- value: null,
75883
- when: "add"
75884
- },
75885
- {
75886
- kind: "clock",
75887
- path: "lastFetchedAt",
75888
- when: "always"
75889
- },
75890
- {
75891
- kind: "transition-time",
75892
- path: "since",
75893
- sourceChangedAt: "prefer"
75894
- }
75895
- ],
75896
- sourceReport: {
75897
- status: "assignment-status",
75898
- runtimeField: "source",
75899
- nativeValue: "native",
75900
- assignedValue: "assigned"
75901
- },
75902
- advancedExpression: true
75903
- }]
75904
- };
75706
+ /**
75707
+ * Customize offers "running" only where a job makes sense (D933): a cycle,
75708
+ * a clean, a mow, playback, or another appliance that is on and working.
75709
+ * The cap itself stays on every type — a camera can still report running
75710
+ * natively; it just has no card.
75711
+ */
75712
+ var RUNNING_CUSTOMIZE_DEVICE_TYPES = [
75713
+ DeviceType.Washer,
75714
+ DeviceType.Dryer,
75715
+ DeviceType.Dishwasher,
75716
+ DeviceType.Vacuum,
75717
+ DeviceType.LawnMower,
75718
+ DeviceType.MediaPlayer,
75719
+ DeviceType.WaterHeater,
75720
+ DeviceType.Humidifier,
75721
+ DeviceType.Fan,
75722
+ DeviceType.Climate,
75723
+ DeviceType.Thermostat,
75724
+ DeviceType.PetFeeder,
75725
+ DeviceType.Heater
75726
+ ];
75905
75727
  var runningStateCapability = {
75906
75728
  name: "running-state",
75907
75729
  scope: "device",
@@ -75921,7 +75743,78 @@ var runningStateCapability = {
75921
75743
  durability: "restored",
75922
75744
  history: { fields: { running: { kind: "boolean" } } },
75923
75745
  volatileStateFields: ["lastFetchedAt"],
75924
- customize: runningCustomize
75746
+ customize: {
75747
+ version: 1,
75748
+ overridable: [{
75749
+ path: "running",
75750
+ by: "running"
75751
+ }],
75752
+ targets: [{
75753
+ id: "running",
75754
+ cardinality: "scalar",
75755
+ vocabulary: {
75756
+ cap: "running-state",
75757
+ stateField: "running"
75758
+ },
75759
+ deviceTypes: RUNNING_CUSTOMIZE_DEVICE_TYPES,
75760
+ apply: "add",
75761
+ path: "running",
75762
+ sources: [
75763
+ {
75764
+ kind: "switch",
75765
+ transforms: [{ kind: "identity" }]
75766
+ },
75767
+ {
75768
+ kind: "binary",
75769
+ transforms: [{ kind: "identity" }, { kind: "invert" }]
75770
+ },
75771
+ {
75772
+ kind: "numeric",
75773
+ requiredUnit: "W",
75774
+ transforms: [{
75775
+ kind: "threshold",
75776
+ comparisons: ["gte", "lte"],
75777
+ comparison: "gte",
75778
+ defaultThreshold: 5,
75779
+ defaultStartDwellMs: RUNNING_POWER_START_DELAY_MS,
75780
+ defaultStopDwellMs: RUNNING_POWER_STOP_DELAY_MS,
75781
+ thresholdUnit: "W"
75782
+ }]
75783
+ }
75784
+ ],
75785
+ companions: [
75786
+ {
75787
+ kind: "constant",
75788
+ path: "source",
75789
+ value: "assigned",
75790
+ when: "always"
75791
+ },
75792
+ {
75793
+ kind: "constant",
75794
+ path: "phase",
75795
+ value: null,
75796
+ when: "add"
75797
+ },
75798
+ {
75799
+ kind: "clock",
75800
+ path: "lastFetchedAt",
75801
+ when: "always"
75802
+ },
75803
+ {
75804
+ kind: "transition-time",
75805
+ path: "since",
75806
+ sourceChangedAt: "prefer"
75807
+ }
75808
+ ],
75809
+ sourceReport: {
75810
+ status: "assignment-status",
75811
+ runtimeField: "source",
75812
+ nativeValue: "native",
75813
+ assignedValue: "assigned"
75814
+ },
75815
+ advancedExpression: true
75816
+ }]
75817
+ }
75925
75818
  };
75926
75819
  /**
75927
75820
  * scene-monitor — device-scoped reference-region state cap. An operator marks
@@ -78855,6 +78748,11 @@ var TimedRunUnitSchema = _enum(["s", "min"]);
78855
78748
  _enum(["switch", "pet-fountain"]);
78856
78749
  DeviceType.Heater, DeviceType.PetFountain;
78857
78750
  var TIMED_RUN_DEVICE_TYPES = [DeviceType.Heater, DeviceType.PetFountain];
78751
+ /** One duration, as the one-tap run asks for it. */
78752
+ var TimedRunQuickRunSchema = object({
78753
+ duration: number$1().positive().finite(),
78754
+ unit: TimedRunUnitSchema
78755
+ });
78858
78756
  /** Why a request was not carried out. Typed, so a caller can say it in words. */
78859
78757
  var TimedRunRefusalSchema = _enum([
78860
78758
  "unsupported-device",
@@ -78875,8 +78773,23 @@ var TimedRunStatusSchema = object({
78875
78773
  activeUntil: number$1().nullable(),
78876
78774
  /** Who asked for the run (a user id or an addon id); `null` when nothing is armed or it did not say. */
78877
78775
  requestedBy: string().nullable(),
78776
+ /**
78777
+ * The one-tap run of THIS device: what a "Run" button on any surface starts. `null` when
78778
+ * the device is gone or its type has no timed run; a status from before this field
78779
+ * existed has none, and a surface falls back to the type's default.
78780
+ */
78781
+ quickRun: TimedRunQuickRunSchema.nullable(),
78878
78782
  lastFetchedAt: number$1()
78879
78783
  });
78784
+ /** What the settings form needs: the unit, the bounds and the type's default. */
78785
+ var TimedRunOptionsSchema = object({
78786
+ unit: TimedRunUnitSchema,
78787
+ /** The longest run, in `unit`. */
78788
+ maxDuration: number$1(),
78789
+ defaultDuration: number$1()
78790
+ });
78791
+ /** The one-tap run duration, in the type's unit; `null` returns to the type's default. */
78792
+ var TimedRunSettingsPatchSchema = object({ quickRunDuration: number$1().positive().finite().nullable().optional() });
78880
78793
  var timedRunCapability = {
78881
78794
  name: "timed-run",
78882
78795
  scope: "device",
@@ -78884,7 +78797,24 @@ var timedRunCapability = {
78884
78797
  kind: "wrapper",
78885
78798
  defaultActive: true,
78886
78799
  deviceTypes: TIMED_RUN_DEVICE_TYPES,
78800
+ deviceConfig: { ui: {
78801
+ kind: "derived-form",
78802
+ builderId: "timed-run",
78803
+ tab: "general"
78804
+ } },
78887
78805
  methods: {
78806
+ getOptions: method(object({ deviceId: number$1().int() }), TimedRunOptionsSchema),
78807
+ /**
78808
+ * The one-tap run of this device. A duration above the type's maximum is
78809
+ * REFUSED (thrown), like `runFor`: the maximum is a safety bound.
78810
+ */
78811
+ setSettings: method(object({
78812
+ deviceId: number$1().int(),
78813
+ settings: TimedRunSettingsPatchSchema
78814
+ }), _void(), {
78815
+ kind: "mutation",
78816
+ auth: "admin"
78817
+ }),
78888
78818
  /**
78889
78819
  * Turn the device on and arm its off. A run already armed is replaced (the
78890
78820
  * new deadline wins). Refuses with a typed reason above the type's maximum.
@@ -83585,13 +83515,6 @@ Object.freeze({
83585
83515
  access: "view",
83586
83516
  role: "admin"
83587
83517
  },
83588
- "addonSettings.getGlobalSettings": {
83589
- capName: "addon-settings",
83590
- capScope: "system",
83591
- addonId: null,
83592
- access: "view",
83593
- role: "admin"
83594
- },
83595
83518
  "addonSettings.getIntegrationFormSchema": {
83596
83519
  capName: "addon-settings",
83597
83520
  capScope: "system",
@@ -83599,14 +83522,14 @@ Object.freeze({
83599
83522
  access: "view",
83600
83523
  role: "admin"
83601
83524
  },
83602
- "addonSettings.getIntegrationSettings": {
83525
+ "addonSettings.getScopedSettings": {
83603
83526
  capName: "addon-settings",
83604
83527
  capScope: "system",
83605
83528
  addonId: null,
83606
83529
  access: "view",
83607
83530
  role: "admin"
83608
83531
  },
83609
- "addonSettings.getScopedSettings": {
83532
+ "addonSettings.listScopedSettings": {
83610
83533
  capName: "addon-settings",
83611
83534
  capScope: "system",
83612
83535
  addonId: null,
@@ -83634,13 +83557,6 @@ Object.freeze({
83634
83557
  access: "create",
83635
83558
  role: "admin"
83636
83559
  },
83637
- "addonSettings.updateGlobalSettings": {
83638
- capName: "addon-settings",
83639
- capScope: "system",
83640
- addonId: null,
83641
- access: "create",
83642
- role: "admin"
83643
- },
83644
83560
  "addonSettings.updateScopedSettings": {
83645
83561
  capName: "addon-settings",
83646
83562
  capScope: "system",
@@ -85811,6 +85727,13 @@ Object.freeze({
85811
85727
  access: "create",
85812
85728
  role: "admin"
85813
85729
  },
85730
+ "deviceManager.setAlias": {
85731
+ capName: "device-manager",
85732
+ capScope: "system",
85733
+ addonId: null,
85734
+ access: "create",
85735
+ role: "admin"
85736
+ },
85814
85737
  "deviceManager.setChildLayout": {
85815
85738
  capName: "device-manager",
85816
85739
  capScope: "system",
@@ -92594,6 +92517,13 @@ Object.freeze({
92594
92517
  access: "create",
92595
92518
  role: "viewer"
92596
92519
  },
92520
+ "timedRun.getOptions": {
92521
+ capName: "timed-run",
92522
+ capScope: "device",
92523
+ addonId: null,
92524
+ access: "view",
92525
+ role: "viewer"
92526
+ },
92597
92527
  "timedRun.getStatus": {
92598
92528
  capName: "timed-run",
92599
92529
  capScope: "device",
@@ -92608,6 +92538,13 @@ Object.freeze({
92608
92538
  access: "create",
92609
92539
  role: "viewer"
92610
92540
  },
92541
+ "timedRun.setSettings": {
92542
+ capName: "timed-run",
92543
+ capScope: "device",
92544
+ addonId: null,
92545
+ access: "create",
92546
+ role: "admin"
92547
+ },
92611
92548
  "toast.onToast": {
92612
92549
  capName: "toast",
92613
92550
  capScope: "system",
@@ -93538,6 +93475,7 @@ function offered(received) {
93538
93475
  };
93539
93476
  }
93540
93477
  offered(HA_AS), withheld(HOMEKIT_REASON), withheld(ALEXA_REASON), withheld(GOOGLE_REASON), withheld(MATTER_REASON);
93478
+ string().min(1).max(4096);
93541
93479
  Object.freeze({
93542
93480
  "accessories.getStatus": [{
93543
93481
  name: "deviceId",
@@ -94221,6 +94159,11 @@ Object.freeze({
94221
94159
  form: "single",
94222
94160
  optional: false
94223
94161
  }],
94162
+ "deviceManager.setAlias": [{
94163
+ name: "deviceId",
94164
+ form: "single",
94165
+ optional: false
94166
+ }],
94224
94167
  "deviceManager.setChildLayout": [{
94225
94168
  name: "deviceId",
94226
94169
  form: "single",
@@ -96285,6 +96228,11 @@ Object.freeze({
96285
96228
  form: "single",
96286
96229
  optional: false
96287
96230
  }],
96231
+ "timedRun.getOptions": [{
96232
+ name: "deviceId",
96233
+ form: "single",
96234
+ optional: false
96235
+ }],
96288
96236
  "timedRun.getStatus": [{
96289
96237
  name: "deviceId",
96290
96238
  form: "single",
@@ -96295,6 +96243,11 @@ Object.freeze({
96295
96243
  form: "single",
96296
96244
  optional: false
96297
96245
  }],
96246
+ "timedRun.setSettings": [{
96247
+ name: "deviceId",
96248
+ form: "single",
96249
+ optional: false
96250
+ }],
96298
96251
  "update.getStatus": [{
96299
96252
  name: "deviceId",
96300
96253
  form: "single",
@@ -97364,6 +97317,7 @@ var STATE_SUMMARY_VARS = [
97364
97317
  [...RULE_TEXT],
97365
97318
  [...RULE_TEXT],
97366
97319
  [...RULE_TEXT],
97320
+ [...RULE_TEXT],
97367
97321
  [...RULE_BODY_ONLY],
97368
97322
  [...RULE_TEXT],
97369
97323
  ([...RULE_TEXT], [...DEVICE_EVENTS]),
@@ -98946,7 +98900,6 @@ function buildLinkedInstances(records, spec) {
98946
98900
  });
98947
98901
  return instances;
98948
98902
  }
98949
- var BROKER_ROWS_MAX = 1e3;
98950
98903
  var STRAY_REGISTRY_ID = /^int_\d+$/;
98951
98904
  async function moveBrokerLinksToConnections(ports) {
98952
98905
  const brokers = await ports.listBrokers();
@@ -98978,36 +98931,6 @@ async function moveBrokerLinksToConnections(ports) {
98978
98931
  }
98979
98932
  };
98980
98933
  }
98981
- /** The ports over the two record kinds of the addon. */
98982
- function brokerLinkPortsOver(deps) {
98983
- return {
98984
- warn: deps.warn,
98985
- listBrokers: async () => {
98986
- return (await deps.brokers.query({ limit: BROKER_ROWS_MAX })).records.map((row) => {
98987
- const name = row.data["name"];
98988
- const link = row.data["integrationId"];
98989
- return {
98990
- id: row.id,
98991
- name: typeof name === "string" && name.length > 0 ? name : row.id,
98992
- integrationId: typeof link === "string" ? link : void 0
98993
- };
98994
- });
98995
- },
98996
- readConnection: async (id) => {
98997
- const row = await deps.connections.get(id);
98998
- return row === null ? null : { brokerId: row.data.brokerId };
98999
- },
99000
- putConnection: async (id, body) => {
99001
- await deps.connections.put({
99002
- id,
99003
- data: body
99004
- }, { ifRev: 0 });
99005
- },
99006
- clearBrokerLink: async (brokerId) => {
99007
- await deps.brokers.patch(brokerId, { integrationId: null });
99008
- }
99009
- };
99010
- }
99011
98934
  //#endregion
99012
98935
  //#region src/speak/constants.ts
99013
98936
  /** Echo speech limits and the worker restart bound (same window as CrashSupervisor). */
@@ -145964,7 +145887,7 @@ function echoTargetStoreOver(records, options = {}) {
145964
145887
  /** The `echoTargets` setting as the legacy source: a row the migration left there is still served. */
145965
145888
  function legacyEchoTargetsOver(setting) {
145966
145889
  return {
145967
- list: async () => readEchoTargets({ echoTargets: setting.readRows() }).map((row) => ({
145890
+ list: async () => readEchoTargets({ echoTargets: await setting.readRows() }).map((row) => ({
145968
145891
  id: row.id,
145969
145892
  name: row.name,
145970
145893
  kind: alexaTargetKind().kind,
@@ -145976,11 +145899,12 @@ function legacyEchoTargetsOver(setting) {
145976
145899
  }
145977
145900
  })),
145978
145901
  delete: async (id) => {
145979
- const rest = setting.readRows().filter((row) => {
145902
+ const rows = await setting.readRows();
145903
+ const rest = rows.filter((row) => {
145980
145904
  const parsed = alexaEchoTargetSchema.safeParse(row);
145981
145905
  return !(parsed.success && parsed.data.id === id);
145982
145906
  });
145983
- if (rest.length !== setting.readRows().length) await setting.writeRows(rest);
145907
+ if (rest.length !== rows.length) await setting.writeRows(rest);
145984
145908
  }
145985
145909
  };
145986
145910
  }
@@ -145997,8 +145921,9 @@ function echoRowOf(target) {
145997
145921
  }
145998
145922
  /** The migration's ports over the `notify-alexa-echo` record kind. */
145999
145923
  function echoRecordPortsOver(records, logger) {
146000
- const handle = echoTargetStoreOver(records).handlesByKind().get(alexaTargetKind().kind);
146001
- if (handle === void 0) throw new Error("import-alexa: the Echo target record kind is not declared");
145924
+ const [kind] = Object.values(alexaNotifyRecordKinds);
145925
+ if (kind === void 0) throw new Error("import-alexa: the Echo target record kind is not declared");
145926
+ const handle = records.kind(kind);
146002
145927
  return {
146003
145928
  readEchoRecord: async (id) => (await handle.getResolved(id))?.data ?? null,
146004
145929
  writeEchoRecord: async (id, body) => {
@@ -147083,17 +147008,42 @@ async function flattenBrokerRecords(ports) {
147083
147008
  //#endregion
147084
147009
  //#region src/migrations/broker-links-to-connections.ts
147085
147010
  var BROKER_LINKS_TO_CONNECTIONS_ID = "import-alexa/2026-11-05-broker-links-to-connections";
147011
+ var BROKER_ROWS_MAX = 1e3;
147086
147012
  /** The broker records and the integration (`connections`) records of this addon. */
147087
147013
  function alexaBrokerLinkPorts(records, warn) {
147088
- return brokerLinkPortsOver({
147089
- brokers: records.kind({
147090
- name: alexaBrokersEntryKind.name,
147091
- declaration: alexaBrokersEntryKind.declaration,
147092
- schema: record(string(), unknown())
147093
- }),
147094
- connections: records.kind(alexaConnectionsEntryKind),
147095
- warn
147014
+ const brokers = records.kind({
147015
+ name: alexaBrokersEntryKind.name,
147016
+ declaration: alexaBrokersEntryKind.declaration,
147017
+ schema: record(string(), unknown())
147096
147018
  });
147019
+ const connections = records.kind(alexaConnectionsEntryKind);
147020
+ return {
147021
+ warn,
147022
+ listBrokers: async () => {
147023
+ return (await brokers.query({ limit: BROKER_ROWS_MAX })).records.map((row) => {
147024
+ const name = row.data["name"];
147025
+ const link = row.data["integrationId"];
147026
+ return {
147027
+ id: row.id,
147028
+ name: typeof name === "string" && name.length > 0 ? name : row.id,
147029
+ integrationId: typeof link === "string" ? link : void 0
147030
+ };
147031
+ });
147032
+ },
147033
+ readConnection: async (id) => {
147034
+ const row = await connections.get(id);
147035
+ return row === null ? null : { brokerId: row.data.brokerId };
147036
+ },
147037
+ putConnection: async (id, body) => {
147038
+ await connections.put({
147039
+ id,
147040
+ data: body
147041
+ }, { ifRev: 0 });
147042
+ },
147043
+ clearBrokerLink: async (brokerId) => {
147044
+ await brokers.patch(brokerId, { integrationId: null });
147045
+ }
147046
+ };
147097
147047
  }
147098
147048
  //#endregion
147099
147049
  //#region src/migrations/strip-echo-target-volume-and-mode.ts
@@ -147109,7 +147059,7 @@ function strippedRow(row) {
147109
147059
  return Object.fromEntries(Object.entries(row).filter(([key]) => !RETIRED_KEYS.includes(key)));
147110
147060
  }
147111
147061
  async function stripEchoTargetVolumeAndMode(ports) {
147112
- const rows = ports.readRows();
147062
+ const rows = await ports.readRows();
147113
147063
  const stripped = rows.filter(carriesRetiredKey).length;
147114
147064
  if (stripped === 0) return {
147115
147065
  outcome: "already-done",
@@ -147142,7 +147092,7 @@ async function stripEchoTargetVolumeAndMode(ports) {
147142
147092
  */
147143
147093
  var ECHO_TARGETS_TO_RECORDS_ID = "import-alexa/2026-11-06-echo-targets-to-records";
147144
147094
  async function moveEchoTargetsToRecords(ports) {
147145
- const rows = ports.readRows();
147095
+ const rows = await ports.readRows();
147146
147096
  if (rows.length === 0) return {
147147
147097
  outcome: "already-done",
147148
147098
  summary: { converted: 0 }
@@ -147293,6 +147243,118 @@ var BROKER_RECORD_MIGRATION_IDS = [
147293
147243
  BROKER_LINKS_TO_CONNECTIONS_ID
147294
147244
  ];
147295
147245
  //#endregion
147246
+ //#region src/migrations/records-door.ts
147247
+ function positionalHandleOver(handle) {
147248
+ return {
147249
+ get: (id) => handle.get({ id }),
147250
+ getResolved: (id) => handle.getResolved({ id }),
147251
+ put: (input, opts) => handle.put({
147252
+ ...input,
147253
+ ...opts?.ifRev === void 0 ? {} : { ifRev: opts.ifRev }
147254
+ }),
147255
+ patch: (id, partial) => handle.patch({
147256
+ id,
147257
+ partial
147258
+ }),
147259
+ delete: (id) => handle.delete({ id }),
147260
+ query: ({ limit }) => handle.query({ limit })
147261
+ };
147262
+ }
147263
+ /** The records door of the migration API, in the shape the migrations call. */
147264
+ function positionalRecordsOver(api) {
147265
+ return { kind: (definition) => positionalHandleOver(api.records.kind(definition)) };
147266
+ }
147267
+ //#endregion
147268
+ //#region src/migrations/ports.ts
147269
+ var NESTED_MAX = 1e3;
147270
+ /** The registry list and the migration-only rows door, over the migration API. */
147271
+ function integrationRowsApiOver(api) {
147272
+ return {
147273
+ list: async () => (await api.integrations.list({})).integrations,
147274
+ readLegacyIntegrationRows: (input) => api.legacyRows.read(input),
147275
+ clearLegacyIntegrationRows: (input) => api.legacyRows.clear(input)
147276
+ };
147277
+ }
147278
+ /** The keychain handle of the migration API: resolve and delete, owner-scoped by the transport. */
147279
+ function secretsOver(api) {
147280
+ return {
147281
+ resolve: async (refs) => {
147282
+ const { values } = await api.secrets.resolve({ refs: [...refs] });
147283
+ const out = {};
147284
+ for (const ref of refs) {
147285
+ const value = values[ref];
147286
+ out[ref] = value === null || value === void 0 ? { kind: "missing" } : {
147287
+ kind: "value",
147288
+ value,
147289
+ version: 0
147290
+ };
147291
+ }
147292
+ return out;
147293
+ },
147294
+ delete: async (refs) => (await api.secrets.delete({ refs: [...refs] })).deleted
147295
+ };
147296
+ }
147297
+ /** The Echo targets kept in the addon's `echoTargets` setting, read and written as stored. */
147298
+ function echoSettingPortsOver(api) {
147299
+ return {
147300
+ readRows: async () => {
147301
+ const { store } = await api.settings.read({});
147302
+ const rows = store["echoTargets"];
147303
+ return Array.isArray(rows) ? rows : [];
147304
+ },
147305
+ writeRows: async (rows) => {
147306
+ await api.settings.write({ patch: { echoTargets: [...rows] } });
147307
+ }
147308
+ };
147309
+ }
147310
+ /** The broker rows' flatten ports over the records door. */
147311
+ function flattenPortsOverDoor(records) {
147312
+ const handle = records.kind({
147313
+ name: alexaBrokersEntryKind.name,
147314
+ declaration: alexaBrokersEntryKind.declaration,
147315
+ schema: record(string(), unknown())
147316
+ });
147317
+ return {
147318
+ listNested: async (legacyKey) => (await handle.query({ limit: NESTED_MAX })).records.filter((row) => legacyKey in row.data).map((row) => row.id),
147319
+ readResolved: async (id) => {
147320
+ const row = await handle.getResolved(id);
147321
+ if (row === null) throw new Error("the record is gone");
147322
+ return row.data;
147323
+ },
147324
+ patch: async (id, patch) => {
147325
+ await handle.patch(id, patch);
147326
+ }
147327
+ };
147328
+ }
147329
+ /**
147330
+ * The catalogue's ports over {@link MigrationApiV1}, and nothing else (planning#447): the addon's
147331
+ * own settings store (the Echo rows), its keychain handle, the legacy integration rows door and its
147332
+ * broker, connection and Echo target records.
147333
+ */
147334
+ function alexaPortsOver(api) {
147335
+ const records = positionalRecordsOver(api);
147336
+ const warn = (message) => {
147337
+ api.log.warn({ message });
147338
+ };
147339
+ return {
147340
+ ...echoSettingPortsOver(api),
147341
+ ...flattenPortsOverDoor(records),
147342
+ ...alexaBrokerLinkPorts(records, warn),
147343
+ ...echoRecordPortsOver(records, { warn: (message, extras) => {
147344
+ api.log.warn({
147345
+ message,
147346
+ ...extras?.meta === void 0 ? {} : { meta: extras.meta }
147347
+ });
147348
+ } }),
147349
+ ...alexaIntegrationRowsPorts({
147350
+ api: integrationRowsApiOver(api),
147351
+ records,
147352
+ secrets: secretsOver(api),
147353
+ warn
147354
+ })
147355
+ };
147356
+ }
147357
+ //#endregion
147296
147358
  //#region src/speak/icon-routes.ts
147297
147359
  var ALEXA_ICON_SVG = "<svg role=\"img\" viewBox=\"0 0 24 24\" xmlns=\"http://www.w3.org/2000/svg\" fill=\"#00CAFF\"><title>Amazon Alexa</title><path d=\"M12 0C5.37 0 0 5.37 0 12C0 18.09 4.53 23.11 10.4 23.9V21.5A1.59 1.59 0 0 0 9.32 19.97A8.41 8.41 0 0 1 3.6 11.8A8.37 8.37 0 0 1 12.09 3.6A8.4 8.4 0 0 1 20.4 12.31L20.39 12.38A8.68 8.68 0 0 1 20.36 12.76C20.36 12.83 20.35 12.9 20.34 12.96C20.34 13.04 20.33 13.12 20.32 13.19L20.3 13.29C19.27 20.07 10.45 23.87 10.4 23.9C10.92 23.97 11.46 24 12 24C18.63 24 24 18.63 24 12S18.63 0 12 0Z\"/></svg>";
147298
147360
  /** One day; the mark is immutable per addon version. */
@@ -147412,7 +147474,7 @@ var AlexaImportAddon = class extends BaseDeviceProvider {
147412
147474
  infoOf: (id) => this.registry?.get(id) ?? null,
147413
147475
  onChanged: (id) => this.syncBrokerRuntime(id)
147414
147476
  });
147415
- await this.runMigrations(defineAddonMigrations(ADDON_MIGRATIONS, this.migrationPorts(records)), { only: BROKER_RECORD_MIGRATION_IDS });
147477
+ await this.runMigrations(ADDON_MIGRATIONS, (api) => alexaPortsOver(api), { only: BROKER_RECORD_MIGRATION_IDS });
147416
147478
  this.activeBrokers = await this.loadPersistedBrokers();
147417
147479
  await this.adoptSessionFiles();
147418
147480
  this.registry = new AlexaBrokerRegistry(this.ctx.logger, {
@@ -147453,7 +147515,7 @@ var AlexaImportAddon = class extends BaseDeviceProvider {
147453
147515
  deviceCode: this.deviceCodeLogin,
147454
147516
  commitCookie: (input) => this.commitCapturedCookie(input)
147455
147517
  }), ...speakIconRoutes()];
147456
- await this.runMigrations(defineAddonMigrations(ADDON_MIGRATIONS, this.migrationPorts(records)), { only: ADDON_MIGRATIONS.map((m) => m.meta.id).filter((id) => !BROKER_RECORD_MIGRATION_IDS.includes(id)) });
147518
+ await this.runMigrations(ADDON_MIGRATIONS, (api) => alexaPortsOver(api), { only: ADDON_MIGRATIONS.map((m) => m.meta.id).filter((id) => !BROKER_RECORD_MIGRATION_IDS.includes(id)) });
147457
147519
  const echoStore = echoTargetStoreOver(records, {
147458
147520
  logger: this.ctx.logger,
147459
147521
  legacy: legacyEchoTargetsOver(this.echoSettingPorts())
@@ -147504,29 +147566,15 @@ var AlexaImportAddon = class extends BaseDeviceProvider {
147504
147566
  }
147505
147567
  ] };
147506
147568
  }
147507
- /** The `echoTargets` setting, read and written as the migration and the legacy store see it. */
147569
+ /**
147570
+ * The `echoTargets` setting the legacy Echo store still serves: the addon's own durable state
147571
+ * under the key it was always stored at, so a row an older release left there is still read.
147572
+ */
147508
147573
  echoSettingPorts() {
147574
+ const rows = this.state("echoTargets", array(unknown()), []);
147509
147575
  return {
147510
- readRows: () => Array.isArray(this.config.echoTargets) ? this.config.echoTargets : [],
147511
- writeRows: async (rows) => {
147512
- await this.updateGlobalSettings({ echoTargets: [...readEchoTargets({ echoTargets: rows })] });
147513
- }
147514
- };
147515
- }
147516
- migrationPorts(records) {
147517
- const secrets = this.ctx.secrets;
147518
- if (secrets === void 0) throw new Error("import-alexa: ctx.secrets is required");
147519
- return {
147520
- ...this.echoSettingPorts(),
147521
- ...flattenPortsOver(records.kind(alexaBrokersEntryKind)),
147522
- ...alexaBrokerLinkPorts(records, (message) => this.ctx.logger.warn(message)),
147523
- ...echoRecordPortsOver(records, this.ctx.logger),
147524
- ...alexaIntegrationRowsPorts({
147525
- api: defaultIntegrationApiOver(this.ctx.api),
147526
- records,
147527
- secrets,
147528
- warn: (message) => this.ctx.logger.warn(message)
147529
- })
147576
+ readRows: () => rows.get(),
147577
+ writeRows: (next) => rows.set([...readEchoTargets({ echoTargets: next })])
147530
147578
  };
147531
147579
  }
147532
147580
  /** One provider over the two record kinds: the account (broker) and the integrations using it. */