@camstack/addon-osd-manager 0.1.151 → 0.1.153

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 (18) hide show
  1. package/dist/{MotionZonesSettings-C5JP-D9r.mjs → MotionZonesSettings-Bi_uB8oT.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-BhVDaMHE.mjs → PrivacyMaskSettings-DuzJnDoQ.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-Bt7UBGiu.mjs → SceneMonitorEditor-CnpHHB8l.mjs} +3 -3
  4. package/dist/_stub.js +2418 -2417
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-BdJcTI3r.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-BD9qu2T3.mjs} +4 -4
  6. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DhxFiL0z.mjs +26 -0
  7. package/dist/{hostInit-tyNFvZo9.mjs → hostInit-Bo6e-m_F.mjs} +3 -3
  8. package/dist/index.js +571 -389
  9. package/dist/index.mjs +571 -389
  10. package/dist/{player-overlays-qwCKS5Oy.mjs → player-overlays-CPVNj3Th.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-D-UTdp-i.mjs → responsive-CmW26rtV.mjs} +1 -1
  13. package/dist/{scene-monitor-copy-BWmGHVvh.mjs → scene-monitor-copy-BP0Z6F7z.mjs} +1 -1
  14. package/dist/{square-DIs3wUiy.mjs → square-CaTP7VKX.mjs} +1 -1
  15. package/dist/{trash-2-DzfMGb1n.mjs → trash-2-IrsDpmSJ.mjs} +1 -1
  16. package/dist/{virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-CHKQMC7P.mjs → virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-DLXGJNFv.mjs} +1 -1
  17. package/package.json +2 -2
  18. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-BC1x5E1q.mjs +0 -26
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- //#region ../types/dist/event-category-C5xZWqz6.mjs
5
+ //#region ../types/dist/event-category-BGmz_oxW.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -535,6 +535,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
535
535
  */
536
536
  EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
537
537
  EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
538
+ /**
539
+ * A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
540
+ * data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
541
+ * consumer is the orchestrator's camera-sensors bridge, which re-emits the
542
+ * camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
543
+ * for a camera with no attached sensor). Providers must not emit
544
+ * `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
545
+ * keeps it so (camera-grid is a named, deferred exception).
546
+ */
538
547
  EventCategory["ProviderMotion"] = "provider.motion";
539
548
  EventCategory["ProviderDetection"] = "provider.detection";
540
549
  EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
@@ -5373,7 +5382,7 @@ var ZodIssueCode = {
5373
5382
  var ZodFirstPartyTypeKind;
5374
5383
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5375
5384
  //#endregion
5376
- //#region ../types/dist/sleep-gU6hqv4_.mjs
5385
+ //#region ../types/dist/sleep-CDCONfkt.mjs
5377
5386
  /**
5378
5387
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5379
5388
  * window to float samples (D455).
@@ -7514,7 +7523,7 @@ var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
7514
7523
  return DeviceRole;
7515
7524
  }({});
7516
7525
  //#endregion
7517
- //#region ../types/dist/composition-Dq42XWp0.mjs
7526
+ //#region ../types/dist/composition-43aqsZQj.mjs
7518
7527
  /**
7519
7528
  * The ffmpeg build every CamStack node downloads, per platform and arch.
7520
7529
  *
@@ -7571,13 +7580,12 @@ portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac
7571
7580
  * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
7572
7581
  * valutatore puro del suo FRONTE.
7573
7582
  *
7574
- * Viveva dentro il builtin virtual-doorbell
7575
- * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
7576
- * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
7577
- * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
7578
- * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
7579
- * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
7580
- * SPOSTA qui e il doorbell la ri-esporta.
7583
+ * UNA tabella per tutti quelli che chiedono "questo device è ALTO?": il
7584
+ * trigger `RecordingTriggers.sensorDeviceIds` del recorder, i marker dei
7585
+ * sensori della post-analysis, il bridge camera-sensors dell'orchestratore e
7586
+ * le sorgenti di un campanello composto (`doorbellFeatureSources`, D671).
7587
+ * Una seconda copia divergerebbe alla prima cap aggiunta, e il sintomo — "il
7588
+ * sensore fa suonare il campanello ma non registra" — è esattamente D62.
7581
7589
  *
7582
7590
  * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
7583
7591
  * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
@@ -7603,8 +7611,6 @@ var SOURCE_CAP_ACTIVE_FIELD = {
7603
7611
  vibration: "detected",
7604
7612
  tamper: "tampered"
7605
7613
  };
7606
- /** Cap names whose presence in a device's bindings qualify it as a source. */
7607
- var SOURCE_CAPS = Object.keys(SOURCE_CAP_ACTIVE_FIELD);
7608
7614
  /**
7609
7615
  * Error types for the safe expression engine. Two distinct classes so callers
7610
7616
  * can tell a compile-time (grammar) failure from a runtime (evaluation)
@@ -9314,7 +9320,7 @@ var RecordingTriggersSchema = object({
9314
9320
  *
9315
9321
  * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
9316
9322
  * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
9317
- * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
9323
+ * la stessa del campanello composto (D671). Ed è il FRONTE, non
9318
9324
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
9319
9325
  * registrare.
9320
9326
  */
@@ -11901,6 +11907,103 @@ var authProviderCapability = {
11901
11907
  mount: { kind: "skip" }
11902
11908
  };
11903
11909
  /**
11910
+ * How long one snapshot may take end to end: the pinned copy of the whole
11911
+ * database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
11912
+ * disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
11913
+ * generous because a timeout fails the whole backup run.
11914
+ */
11915
+ var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
11916
+ /**
11917
+ * The databases an owner snapshots — declared by the OWNER, so a caller never
11918
+ * guesses which file is live from what sits beside it (a cleanly closed
11919
+ * database has no sidecars and is just as owned). Paths are absolute on the
11920
+ * owner's host.
11921
+ */
11922
+ var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
11923
+ /** One b-tree table of the snapshot and the rows it holds. */
11924
+ var DatabaseSnapshotTableSchema = object({
11925
+ name: string(),
11926
+ rows: number().int().nonnegative()
11927
+ });
11928
+ /**
11929
+ * What the owner wrote. Every path is ABSOLUTE on the owner's host — the
11930
+ * caller pins the call to its own node, so it can read the file; a caller
11931
+ * that finds the path outside its own data root refuses it rather than
11932
+ * archiving something it cannot place.
11933
+ */
11934
+ var DatabaseSnapshotResultSchema = object({
11935
+ /** The live database the snapshot copies. Never to be copied as a file. */
11936
+ livePath: string(),
11937
+ /** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
11938
+ snapshotPath: string(),
11939
+ sizeBytes: number().int().nonnegative(),
11940
+ pageCount: number().int().nonnegative(),
11941
+ pageSize: number().int().positive(),
11942
+ /**
11943
+ * Every b-tree table with its row count. Read inside the SAME read
11944
+ * transaction the copy was taken from, and found EQUAL on the copy — so
11945
+ * this is the content of the snapshot, not an estimate of the source.
11946
+ */
11947
+ tables: array(DatabaseSnapshotTableSchema),
11948
+ /** Wall time of the pinned copy (row counts included). */
11949
+ copyMs: number().nonnegative(),
11950
+ /** Wall time of the checks on the copy (`integrity_check`, row counts). */
11951
+ verifyMs: number().nonnegative(),
11952
+ /** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
11953
+ takenAt: number()
11954
+ });
11955
+ /**
11956
+ * A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
11957
+ * the same facts, with both paths relative to the archive root (the node's
11958
+ * data dir), because an archive outlives the host that made it.
11959
+ */
11960
+ var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
11961
+ /** Archive-relative path of the live database the archive does NOT carry. */
11962
+ livePath: string(),
11963
+ /** Archive-relative path of the verified copy it carries in its place. */
11964
+ snapshotPath: string()
11965
+ });
11966
+ /**
11967
+ * database-snapshot — the OWNER of a live SQLite database writes a consistent,
11968
+ * verified copy of it (D693).
11969
+ *
11970
+ * A live database cannot be copied as files: three files written by a live
11971
+ * process cannot be read at one instant from outside it, and a tar of the
11972
+ * `.db` / `-wal` / `-shm` trio was measured torn in 6/6 archives (D679). Nor may
11973
+ * another process open it (D679 rule 2). So the process that owns the
11974
+ * connection writes the copy — through its own connection, on a thread,
11975
+ * pinned to one read transaction — and checks it before handing it out.
11976
+ *
11977
+ * Hub-only and internal: `sqlite-settings` is the registrant, and its consumer
11978
+ * is `backup-orchestrator`, which calls it pinned to its own node so the path
11979
+ * it gets back is on its own host. `auth: 'admin'` explicitly — `internal`
11980
+ * does not gate the mount (see `data-store-provider`).
11981
+ */
11982
+ var databaseSnapshotCapability = {
11983
+ name: "database-snapshot",
11984
+ scope: "system",
11985
+ mode: "singleton",
11986
+ internal: true,
11987
+ methods: {
11988
+ /**
11989
+ * Which databases this owner snapshots. Answered from memory — no file is
11990
+ * touched — so a backup can ask it before deciding anything.
11991
+ */
11992
+ listDatabases: method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }),
11993
+ /**
11994
+ * Write `<db>.backup-snapshot` and return what it holds. Throws — and
11995
+ * leaves no file under the final name — when the copy fails
11996
+ * `integrity_check` or its row counts differ from the pinned source's.
11997
+ * A second call while one is running joins it.
11998
+ */
11999
+ writeSnapshot: method(object({}), DatabaseSnapshotResultSchema, {
12000
+ kind: "mutation",
12001
+ auth: "admin",
12002
+ timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
12003
+ })
12004
+ }
12005
+ };
12006
+ /**
11904
12007
  * Orchestrator-side destination metadata. The orchestrator computes
11905
12008
  * `id = <addonId>:<subId>` from its provider lookup so consumers
11906
12009
  * (admin UI, restore flow) see one canonical key.
@@ -12011,7 +12114,12 @@ var ArchiveManifestSchema = object({
12011
12114
  locations: array(string()),
12012
12115
  entries: array(ArchiveEntrySchema),
12013
12116
  totalBytes: number(),
12014
- totalFiles: number()
12117
+ totalFiles: number(),
12118
+ /**
12119
+ * Live SQLite databases this archive carries as their OWNER's verified
12120
+ * snapshot instead of as files (D693). Absent on archives made before.
12121
+ */
12122
+ sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
12015
12123
  });
12016
12124
  var LocationStatSchema = object({
12017
12125
  name: string(),
@@ -13979,6 +14087,65 @@ var CompositionBlockStateSchema = object({
13979
14087
  reason: string().optional(),
13980
14088
  fields: array(CompositionFieldStateSchema)
13981
14089
  });
14090
+ var ComposerBlockSchema = object({
14091
+ id: string().min(1),
14092
+ name: string().min(1).max(120),
14093
+ enabled: boolean(),
14094
+ updatedAt: number(),
14095
+ composition: CompositionSchema
14096
+ });
14097
+ /**
14098
+ * A stored composition row that no longer PARSES — a schema a release
14099
+ * tightened, a row written by a newer build. Sent by id so the composer keeps
14100
+ * its device as a placeholder and reports the block `failed` naming the parse
14101
+ * error. Leaving it out would read, twice, exactly like a delete (D49).
14102
+ */
14103
+ var ComposerUnreadableBlockSchema = object({
14104
+ id: string().min(1),
14105
+ /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
14106
+ name: string().nullable(),
14107
+ /** The parse error, in the operator's words. */
14108
+ error: string()
14109
+ });
14110
+ var composerCapability = {
14111
+ name: "composer",
14112
+ scope: "system",
14113
+ mode: "singleton",
14114
+ internal: true,
14115
+ methods: {
14116
+ /**
14117
+ * Not `apply`: tRPC reserves `apply`, `call` and `then` as router keys, and
14118
+ * `router({})` throws on one — every cap router is built at boot.
14119
+ */
14120
+ applyBlocks: method(object({
14121
+ /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
14122
+ integrationId: string().nullable(),
14123
+ /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
14124
+ storeLoaded: boolean(),
14125
+ blocks: array(ComposerBlockSchema),
14126
+ /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
14127
+ restartBlockIds: array(string()),
14128
+ /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
14129
+ unreadableBlocks: array(ComposerUnreadableBlockSchema)
14130
+ }), object({
14131
+ blocks: array(object({
14132
+ blockId: string(),
14133
+ status: CompositionRunStatusSchema,
14134
+ reason: string().optional()
14135
+ })),
14136
+ /**
14137
+ * False when the composer declared and withdrew NOTHING (store not loaded,
14138
+ * integration unknown, its own rows unread or read empty once). An empty
14139
+ * apply the caller owes is paid off only by one the composer acted on (D49).
14140
+ */
14141
+ acted: boolean()
14142
+ }), {
14143
+ kind: "mutation",
14144
+ auth: "admin"
14145
+ }),
14146
+ getStates: method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" })
14147
+ }
14148
+ };
13982
14149
  var NUMBER = {
13983
14150
  kind: "fixed",
13984
14151
  result: ["number"]
@@ -14294,65 +14461,6 @@ var coreBlocksCapability = {
14294
14461
  })
14295
14462
  }
14296
14463
  };
14297
- var ComposerBlockSchema = object({
14298
- id: string().min(1),
14299
- name: string().min(1).max(120),
14300
- enabled: boolean(),
14301
- updatedAt: number(),
14302
- composition: CompositionSchema
14303
- });
14304
- /**
14305
- * A stored composition row that no longer PARSES — a schema a release
14306
- * tightened, a row written by a newer build. Sent by id so the composer keeps
14307
- * its device as a placeholder and reports the block `failed` naming the parse
14308
- * error. Leaving it out would read, twice, exactly like a delete (D49).
14309
- */
14310
- var ComposerUnreadableBlockSchema = object({
14311
- id: string().min(1),
14312
- /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
14313
- name: string().nullable(),
14314
- /** The parse error, in the operator's words. */
14315
- error: string()
14316
- });
14317
- var composerCapability = {
14318
- name: "composer",
14319
- scope: "system",
14320
- mode: "singleton",
14321
- internal: true,
14322
- methods: {
14323
- /**
14324
- * Not `apply`: tRPC reserves `apply`, `call` and `then` as router keys, and
14325
- * `router({})` throws on one — every cap router is built at boot.
14326
- */
14327
- applyBlocks: method(object({
14328
- /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
14329
- integrationId: string().nullable(),
14330
- /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
14331
- storeLoaded: boolean(),
14332
- blocks: array(ComposerBlockSchema),
14333
- /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
14334
- restartBlockIds: array(string()),
14335
- /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
14336
- unreadableBlocks: array(ComposerUnreadableBlockSchema)
14337
- }), object({
14338
- blocks: array(object({
14339
- blockId: string(),
14340
- status: CompositionRunStatusSchema,
14341
- reason: string().optional()
14342
- })),
14343
- /**
14344
- * False when the composer declared and withdrew NOTHING (store not loaded,
14345
- * integration unknown, its own rows unread or read empty once). An empty
14346
- * apply the caller owes is paid off only by one the composer acted on (D49).
14347
- */
14348
- acted: boolean()
14349
- }), {
14350
- kind: "mutation",
14351
- auth: "admin"
14352
- }),
14353
- getStates: method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" })
14354
- }
14355
- };
14356
14464
  /**
14357
14465
  * `custom-model-registry` — collection cap exposing operator-registered
14358
14466
  * custom detection models. Each provider (today: `addon-model-studio`)
@@ -17096,8 +17204,8 @@ var deviceManagerCapability = {
17096
17204
  * (`value` / `missing` / `failed`, see {@link WrapperActivationReadSchema}).
17097
17205
  *
17098
17206
  * The narrow read of the durable authority behind `getBindings`: a
17099
- * consumer that must know what the operator PERSISTED (virtual-doorbell,
17100
- * before it drops a press) asks this instead of pulling device-manager's
17207
+ * consumer that must know what the operator PERSISTED (before it drops
17208
+ * work on the strength of an unbind) asks this instead of pulling device-manager's
17101
17209
  * whole addon store through `addonSettingsRaw.getGlobal` — which answered
17102
17210
  * `{}` on every isolated-engine hub and so never worked (D675). It reads
17103
17211
  * ONE row (the activation map, ~1.6 KB), never the ~625 KB store.
@@ -17387,6 +17495,153 @@ var deviceManagerCapability = {
17387
17495
  }), record(string(), record(string(), unknown().nullable())))
17388
17496
  }
17389
17497
  };
17498
+ var ExtensionSlotIdSchema = _enum(["linked-devices"]);
17499
+ DeviceType.Camera;
17500
+ /** A slot's editable value, discriminated on `slot`. */
17501
+ var ExtensionSlotValueSchema = discriminatedUnion("slot", [LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
17502
+ /** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
17503
+ var EXTENSION_HOST_DEVICE_TYPES = [DeviceType.Camera];
17504
+ var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
17505
+ state: literal("unreachable"),
17506
+ reason: string()
17507
+ })]);
17508
+ /** One provider of slots — the D554 source-listing row. */
17509
+ var ExtensionSourceSchema = object({
17510
+ /** The routing prefix of every `slotRef` this provider serves. */
17511
+ source: string(),
17512
+ label: string(),
17513
+ /** Stamped by the dispatcher from the registry (D557). */
17514
+ addonId: string().optional(),
17515
+ availability: ExtensionSourceAvailabilitySchema
17516
+ });
17517
+ /**
17518
+ * How one picked source stands. `missing` — no such device (deleted, or an id
17519
+ * that never existed); `foreign` — a device the slot's owner cannot read from
17520
+ * (a source owned by another addon); `unavailable` — it exists but is not a
17521
+ * valid source now (a container, which is never a pick). A source in any of
17522
+ * these states is SHOWN, never silently dropped or re-pointed.
17523
+ */
17524
+ var ExtensionSourceHealthSchema = _enum([
17525
+ "ok",
17526
+ "missing",
17527
+ "foreign",
17528
+ "unavailable"
17529
+ ]);
17530
+ var ExtensionSlotSourceSchema = object({
17531
+ deviceId: number().int(),
17532
+ /** The device's name, or null when it could not be resolved (`missing`). */
17533
+ name: string().nullable(),
17534
+ health: ExtensionSourceHealthSchema,
17535
+ detail: string().optional()
17536
+ });
17537
+ /**
17538
+ * A DIFFERENT authority that gates whether the slot's sources do anything —
17539
+ * reported read-only, named, never written through this contract (D62) — e.g.
17540
+ * a slot whose sources act only while a wrapper is bound to the host, a
17541
+ * binding that belongs to `deviceManager.setWrapperActive`. No slot reports
17542
+ * one today (`linked-devices` answers `null`). `unknown` means the gate could
17543
+ * not be read; it is not "inactive" (D315).
17544
+ */
17545
+ var ExtensionSlotActivationSchema = object({
17546
+ state: _enum([
17547
+ "active",
17548
+ "inactive",
17549
+ "unknown"
17550
+ ]),
17551
+ authority: string(),
17552
+ detail: string().optional()
17553
+ });
17554
+ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
17555
+ state: literal("ok"),
17556
+ /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
17557
+ slotRef: string(),
17558
+ slot: ExtensionSlotIdSchema,
17559
+ /** Names the store written (D62), e.g. `device-manager:_linkedDeviceIds`. */
17560
+ authority: string(),
17561
+ activation: ExtensionSlotActivationSchema.nullable(),
17562
+ value: ExtensionSlotValueSchema,
17563
+ sources: array(ExtensionSlotSourceSchema),
17564
+ /**
17565
+ * Devices the owner links to the host ON ITS OWN, by structure, and that
17566
+ * are therefore not in `value` (D655): a camera's device-tree children, and
17567
+ * the child a picked container stands for (D356 — a container is never a
17568
+ * pick, its children are). Read-only; the editor shows them and may offer
17569
+ * per-device options on them (the linked-devices tracked-event opt-in).
17570
+ * Absent when the owner links nothing beyond the picks, and from an owner
17571
+ * older than D655.
17572
+ */
17573
+ impliedSources: array(ExtensionSlotSourceSchema).optional()
17574
+ }), object({
17575
+ state: literal("unreachable"),
17576
+ addonId: string(),
17577
+ reason: string()
17578
+ })]);
17579
+ var ExtensionCandidatesSchema = object({ candidates: array(object({
17580
+ deviceId: number().int(),
17581
+ name: string(),
17582
+ type: string(),
17583
+ location: string().nullable(),
17584
+ /** The container a child belongs to — "Spotlight 2" alone does not say which. */
17585
+ parentName: string().nullable(),
17586
+ /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
17587
+ suggested: boolean(),
17588
+ /** Why it is suggested ("same location"), null when it is not. */
17589
+ reason: string().nullable()
17590
+ })) });
17591
+ /**
17592
+ * What a write did. `none` — applied in place. `host` / `parent` — the owner
17593
+ * reloaded the host (or, for an accessory child, its parent) because the
17594
+ * write changed what the host REGISTERS. A slot never adds a capability to its
17595
+ * host — that is a composition (D663) — so today's owners answer `none`.
17596
+ */
17597
+ var ExtensionSetResultSchema = object({
17598
+ applied: literal(true),
17599
+ reload: _enum([
17600
+ "none",
17601
+ "host",
17602
+ "parent"
17603
+ ])
17604
+ });
17605
+ var ExtensionSlotRefInputSchema = object({
17606
+ deviceId: number().int(),
17607
+ slotRef: string().min(1)
17608
+ });
17609
+ var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
17610
+ var deviceExtensionCapability = {
17611
+ name: "device-extension",
17612
+ scope: "device",
17613
+ mode: "collection",
17614
+ kind: "wrapper",
17615
+ defaultActive: true,
17616
+ deviceTypes: EXTENSION_HOST_DEVICE_TYPES,
17617
+ deviceConfig: { ui: {
17618
+ kind: "widget",
17619
+ widgetId: "host/extensions-panel",
17620
+ tab: "general",
17621
+ label: "Extensions",
17622
+ order: 72
17623
+ } },
17624
+ methods: {
17625
+ /** One row per slot owner — the D554 source listing `slotRef` routes by. */
17626
+ listSources: method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)),
17627
+ /**
17628
+ * Every slot this device is offered, read by each owner from its own
17629
+ * store. A provider that throws is ONE `unreachable` row (D554.4).
17630
+ */
17631
+ listSlots: method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)),
17632
+ /** The devices the slot's editor may offer, suggestions pre-marked (D356). */
17633
+ listCandidates: method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema),
17634
+ /**
17635
+ * Write one slot through its owner's EXISTING write path. The owner
17636
+ * validates (a container is never a linked device, a camera is never its
17637
+ * own source) and refuses by name before persisting.
17638
+ */
17639
+ setSlot: method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
17640
+ kind: "mutation",
17641
+ auth: "admin"
17642
+ })
17643
+ }
17644
+ };
17390
17645
  /**
17391
17646
  * Per-field ownership (D663). A composition may CLAIM fields of a native
17392
17647
  * cap's runtime-state slice on an existing device: `replace` overlays the
@@ -17486,8 +17741,8 @@ var deviceStateCapability = {
17486
17741
  * Canonical cross-layer WRITE for one cap-keyed slice. Used by
17487
17742
  * everyone who needs to publish runtime state for a device:
17488
17743
  * device providers (via `BaseDevice.runtimeState.setCapState`
17489
- * which delegates here), system-scope addons (e.g. the pipeline
17490
- * runner writing the `motion` slice on phase transitions), and
17744
+ * which delegates here), system-scope addons (e.g. the orchestrator
17745
+ * writing a camera's effective `motion` slice, D696), and
17491
17746
  * direct cap-router callers in tests.
17492
17747
  *
17493
17748
  * Behavior on the hub:
@@ -20875,17 +21130,25 @@ var NcScheduleSchema = object({
20875
21130
  */
20876
21131
  var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
20877
21132
  /**
21133
+ * How a summary window is SENT (D698): `rule` (absent) = ONE notification with
21134
+ * every section; `section` = one notification per section with something to
21135
+ * say (an unavailable section included), each titled by its section.
21136
+ */
21137
+ var NcStateSummarySplitSchema = _enum(["rule", "section"]);
21138
+ /**
20878
21139
  * `summary`: the rule sends NOTHING per event. When a window of `schedule`
20879
21140
  * CLOSES, it sends one notification with the current state of its kinds
20880
21141
  * (low batteries, consumables to replace, devices offline, updates
20881
- * available, ...), after its own filters. Nothing to report sends nothing.
21142
+ * available, ...), after its own filters — or, with `split: 'section'`
21143
+ * (D698), one notification per section. Nothing to report sends nothing.
20882
21144
  * The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
20883
21145
  * midnight crossing); the send time is each window's END. Refused on the
20884
21146
  * `alarm` family, which stays instant (`systemEventDeliveryProblems`).
20885
21147
  */
20886
21148
  var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
20887
21149
  mode: literal("summary"),
20888
- schedule: NcScheduleSchema
21150
+ schedule: NcScheduleSchema,
21151
+ split: NcStateSummarySplitSchema.optional()
20889
21152
  })]);
20890
21153
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
20891
21154
  var NcPlateMatcherSchema = object({
@@ -21536,10 +21799,12 @@ var NcMediaPolicySchema = object({
21536
21799
  /**
21537
21800
  * Cooldown GRANULARITY over the subject's class — how much a fired
21538
21801
  * notification suppresses.
21539
- * - `shared` (default, and the absent value) — one window for the whole
21540
- * rule/scope: a cat silences the next dog for `cooldownSec`.
21541
- * - `per-class` — an independent window per detected class, so cat→dog fires
21542
- * at once and cat→cat still waits.
21802
+ * - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
21803
+ * independent window per detected class: cat→dog fires at once, cat→cat
21804
+ * still waits.
21805
+ * - `shared` — one window for the whole rule/scope: a cat silences the next
21806
+ * dog for `cooldownSec`. Only written when an operator picks it; it is no
21807
+ * longer what an unset rule means.
21543
21808
  *
21544
21809
  * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
21545
21810
  * must not be swallowed by a bark's window (the precedent this generalizes —
@@ -21554,8 +21819,11 @@ var NcThrottleSchema = object({
21554
21819
  /**
21555
21820
  * Class granularity of the cooldown key. Optional rather than defaulted:
21556
21821
  * a Zod default does NOT run on the addon→addon cap path, so a persisted
21557
- * rule authored before this field simply carries none — and the engine
21558
- * reads absent as `shared`, the pre-existing behaviour.
21822
+ * rule authored before this field simply carries none. The engine used to
21823
+ * read absent as `shared` (D36); since 2026-10-01 it reads absent as
21824
+ * `per-class` — the operator's default — and only an explicit `shared`
21825
+ * still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
21826
+ * engine, and D36's dated note.
21559
21827
  */
21560
21828
  granularity: NcThrottleGranularitySchema.optional()
21561
21829
  });
@@ -21879,11 +22147,23 @@ var NcStateSummaryPreviewSectionSchema = object({
21879
22147
  reason: string().optional()
21880
22148
  });
21881
22149
  /**
22150
+ * One notification a previewed summary would send (D698): the whole summary on
22151
+ * a `rule` split (no `section`), one section's on a `section` split.
22152
+ */
22153
+ var NcStateSummaryPreviewRowSchema = object({
22154
+ section: string().optional(),
22155
+ /** The section's name on a per-section row; every reported section's, joined, on a combined one. */
22156
+ title: string(),
22157
+ text: string(),
22158
+ count: number().int().nonnegative()
22159
+ });
22160
+ /**
21882
22161
  * The summary a rule would send now. `empty` = nothing to report and every
21883
22162
  * section read: such a summary is NOT sent. `dropped` counts the open states
21884
22163
  * the rule's own filters (or a camera mute) left out, by reason.
21885
22164
  * `excludedGroups` names the kind groups selected that have no state to report
21886
- * (backups & exports).
22165
+ * (backups & exports). `split` and `rows` (D698) say how it would be sent —
22166
+ * optional, so an older hub's answer still parses.
21887
22167
  */
21888
22168
  var NcStateSummaryPreviewSchema = object({
21889
22169
  empty: boolean(),
@@ -21891,7 +22171,9 @@ var NcStateSummaryPreviewSchema = object({
21891
22171
  text: string(),
21892
22172
  sections: array(NcStateSummaryPreviewSectionSchema),
21893
22173
  dropped: record(string(), number().int().nonnegative()),
21894
- excludedGroups: array(string())
22174
+ excludedGroups: array(string()),
22175
+ split: NcStateSummarySplitSchema.optional(),
22176
+ rows: array(NcStateSummaryPreviewRowSchema).optional()
21895
22177
  });
21896
22178
  var NcTestResultSchema = object({
21897
22179
  recordId: string(),
@@ -23620,12 +23902,26 @@ var CameraSensorRefSchema = object({
23620
23902
  function cameraSensorRefKey(ref) {
23621
23903
  return `${ref.addonId}/${ref.stableId}`;
23622
23904
  }
23623
- /** CS-1 accepts exactly one mode; CS-2 (D673) widens it to confirm / replace. */
23624
- var CameraSensorsModeSchema = _enum(["in-addition"]);
23625
- var CameraSensorsConfigSchema = object({
23626
- mode: CameraSensorsModeSchema,
23627
- sensors: array(CameraSensorRefSchema).min(1).max(8)
23628
- }).superRefine((value, ctx) => {
23905
+ /**
23906
+ * A sensor's mode (D673). `in-addition`: its motion is the camera's motion too.
23907
+ * `replace`: its motion is the camera's, and while one is READY the camera's
23908
+ * own motion no longer counts on its own. `confirm`: while one is READY the
23909
+ * camera's own motion counts only while a confirm sensor is active — with or
23910
+ * without a replace sensor (spec C2, the controller's ruling on Q1).
23911
+ */
23912
+ var CameraSensorModeSchema = _enum([
23913
+ "in-addition",
23914
+ "confirm",
23915
+ "replace"
23916
+ ]);
23917
+ /** A stored sensor with no mode — every CS-1 row — is in addition. */
23918
+ var DEFAULT_CAMERA_SENSOR_MODE = "in-addition";
23919
+ /**
23920
+ * A camera's attached sensors. A CS-1 row carried an envelope
23921
+ * `mode: 'in-addition'`: `z.object` drops it on parse, and the PARSED value is
23922
+ * what the write stores (D672 rule 3), so it is never written again.
23923
+ */
23924
+ var CameraSensorsConfigSchema = object({ sensors: array(CameraSensorRefSchema.extend({ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE) })).min(1).max(8) }).superRefine((value, ctx) => {
23629
23925
  const seen = /* @__PURE__ */ new Set();
23630
23926
  value.sensors.forEach((ref, index) => {
23631
23927
  const key = cameraSensorRefKey(ref);
@@ -23637,39 +23933,41 @@ var CameraSensorsConfigSchema = object({
23637
23933
  seen.add(key);
23638
23934
  });
23639
23935
  });
23640
- var RefFields = {
23936
+ /** Every attachment names its mode; an older orchestrator that does not is in addition. */
23937
+ var AttachmentFields = {
23641
23938
  addonId: string(),
23642
- stableId: string()
23939
+ stableId: string(),
23940
+ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE)
23643
23941
  };
23644
23942
  var CameraSensorAttachmentSchema = discriminatedUnion("state", [
23645
23943
  object({
23646
- ...RefFields,
23944
+ ...AttachmentFields,
23647
23945
  state: literal("ready"),
23648
23946
  deviceId: number(),
23649
23947
  name: string(),
23650
23948
  caps: array(string()).readonly()
23651
23949
  }),
23652
23950
  object({
23653
- ...RefFields,
23951
+ ...AttachmentFields,
23654
23952
  state: literal("offline"),
23655
23953
  deviceId: number(),
23656
23954
  name: string(),
23657
23955
  reason: _enum(["offline", "disabled"])
23658
23956
  }),
23659
23957
  object({
23660
- ...RefFields,
23958
+ ...AttachmentFields,
23661
23959
  state: literal("missing"),
23662
23960
  reason: string()
23663
23961
  }),
23664
23962
  object({
23665
- ...RefFields,
23963
+ ...AttachmentFields,
23666
23964
  state: literal("unsupported"),
23667
23965
  deviceId: number(),
23668
23966
  name: string(),
23669
23967
  reason: string()
23670
23968
  }),
23671
23969
  object({
23672
- ...RefFields,
23970
+ ...AttachmentFields,
23673
23971
  state: literal("unreadable"),
23674
23972
  reason: string()
23675
23973
  })
@@ -23682,17 +23980,49 @@ var CameraSensorAttachmentSchema = discriminatedUnion("state", [
23682
23980
  * say.
23683
23981
  */
23684
23982
  var CameraSensorsNotForwardedSchema = _enum(["onboard-not-listed", "no-active-detection"]);
23983
+ /** Whether the camera's OWN motion counts on its own (D673 C2), from its READY sensors (C3). */
23984
+ var CameraOwnMotionSchema = _enum([
23985
+ "always",
23986
+ "when-confirmed",
23987
+ "never"
23988
+ ]);
23989
+ /** Confirm / Replace cannot suppress this camera's motion: its provider still emits it directly (D673 C13). */
23990
+ var CameraSensorsNotEnforcedSchema = _enum(["provider-not-split"]);
23991
+ /**
23992
+ * The camera's OWN onboard motion (D696): the raw input the bridge combines,
23993
+ * never the effective value. The camera's `motion` slice is the effective one,
23994
+ * so a view of the camera's own row reads this.
23995
+ * - `atMs`: when the bridge received the camera's last own edge.
23996
+ * - `detected`: evaluated WHEN THE STATUS IS ASKED — the last edge said `true`
23997
+ * AND it is younger than the window the bridge counts the camera's own motion
23998
+ * for (`motionCooldownMs`, floored at two sustain ticks). A camera that never
23999
+ * sends a clear (heartbeats only) therefore reads `false` once no push came
24000
+ * within the window; a status read is a snapshot, so a live view re-asks.
24001
+ * Absent = this orchestrator has not received the camera's own motion since it
24002
+ * started (unknown, never "quiet"), or an orchestrator older than D696.
24003
+ */
24004
+ var CameraRawLevelSchema = object({
24005
+ detected: boolean(),
24006
+ atMs: number()
24007
+ });
23685
24008
  var CameraSensorsStatusSchema = discriminatedUnion("state", [
23686
- object({ state: literal("not-configured") }),
24009
+ object({
24010
+ state: literal("not-configured"),
24011
+ cameraLevel: CameraRawLevelSchema.optional()
24012
+ }),
23687
24013
  object({
23688
24014
  state: literal("unreadable"),
23689
- reason: string()
24015
+ reason: string(),
24016
+ cameraLevel: CameraRawLevelSchema.optional()
23690
24017
  }),
23691
24018
  object({
23692
24019
  state: literal("configured"),
23693
- mode: CameraSensorsModeSchema,
24020
+ cameraLevel: CameraRawLevelSchema.optional(),
23694
24021
  sensors: array(CameraSensorAttachmentSchema).readonly(),
23695
- notForwarded: CameraSensorsNotForwardedSchema.optional()
24022
+ /** Absent = an orchestrator older than CS-2: it does not say (D315). */
24023
+ cameraMotion: CameraOwnMotionSchema.optional(),
24024
+ notForwarded: CameraSensorsNotForwardedSchema.optional(),
24025
+ notEnforced: CameraSensorsNotEnforcedSchema.optional()
23696
24026
  })
23697
24027
  ]);
23698
24028
  Object.freeze({
@@ -27779,8 +28109,10 @@ var RunnerCameraConfigSchema = object({
27779
28109
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
27780
28110
  * analyzer providers) running on decoded frames in this runner.
27781
28111
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
27782
- * analytics). The provider emits ProviderMotion
27783
- * events; the orchestrator forwards to `reportMotion`.
28112
+ * analytics). The provider emits its raw push as `ProviderMotion`
28113
+ * (D673); the orchestrator's camera-sensors bridge re-emits the camera's
28114
+ * effective motion as `MotionOnMotionChanged`, which is what reaches
28115
+ * `reportMotion`.
27784
28116
  */
27785
28117
  motionSources: MotionSourcesSchema.default(["analyzer"]),
27786
28118
  /**
@@ -27957,7 +28289,15 @@ var RunnerLocalLoadSchema = object({
27957
28289
  hasGpu: boolean(),
27958
28290
  inferenceBackend: string().optional(),
27959
28291
  cpuCores: number().optional()
27960
- })
28292
+ }),
28293
+ /**
28294
+ * Who writes a camera's `motion` runtime slice (D696). `'orchestrator'`: this
28295
+ * runner never writes it. ABSENT = a runner older than D696, which still
28296
+ * writes the slice from its phase machine; the orchestrator does not write
28297
+ * while any runner node is absent-or-unanswered, so one slice never has two
28298
+ * writers.
28299
+ */
28300
+ motionSliceWriter: literal("orchestrator").optional()
27961
28301
  });
27962
28302
  /**
27963
28303
  * Aggregate runtime metrics for the runner's whole local pool. Mirrors the
@@ -32229,251 +32569,6 @@ var videoclipsCapability = {
32229
32569
  }
32230
32570
  };
32231
32571
  /**
32232
- * Doorbell button cap. Two kinds of providers coexist behind this cap
32233
- * name (same pattern as `snapshot`):
32234
- *
32235
- * - **Native** providers: registered per-device by device-driver
32236
- * addons via `ctx.registerNativeCap` — either on a
32237
- * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
32238
- * or directly on the camera (Reolink registers at camera level).
32239
- * Emits an `onPressed` event every time the firmware pushes a
32240
- * ring; status tracks the last press and a pressCount since start
32241
- * (diagnostic).
32242
- *
32243
- * - **Wrapper** provider: the `virtual-doorbell` system builtin
32244
- * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
32245
- * device (contact / switch / event-emitter …) into a doorbell for
32246
- * a camera. `defaultActive: false` — the operator explicitly binds
32247
- * it per camera in the device-bindings UI, then picks the source
32248
- * device + trigger in the per-device settings.
32249
- *
32250
- * The DeviceEventPropagator re-emits `onPressed` on the camera parent
32251
- * — subscribers listening at the camera level receive ring events
32252
- * with `via[]` populated. No code on the parent needed.
32253
- */
32254
- var DoorbellStatusSchema = object({
32255
- /** Ms epoch of the last press. null = never observed since this provider started. */
32256
- lastPressedAt: number().nullable(),
32257
- /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
32258
- pressCountSinceStart: number()
32259
- });
32260
- var DoorbellPressEventSchema = object({
32261
- deviceId: number(),
32262
- timestamp: number()
32263
- });
32264
- /**
32265
- * The `doorbell-source` extension slot's editable value (D648): the camera's
32266
- * virtual-doorbell trigger devices, exactly what the wrapper's
32267
- * `doorbellSources` persists (as `{ deviceId }` records).
32268
- */
32269
- var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
32270
- /**
32271
- * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
32272
- * doorbell, owned by the `virtual-doorbell` wrapper over its
32273
- * `doorbellSources` store (D648). A source rings when one of its
32274
- * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
32275
- * different authority (`deviceManager.setWrapperActive`, D62) — the slot
32276
- * reports it, it never writes it.
32277
- */
32278
- var DOORBELL_SOURCE_SLOT = {
32279
- id: "doorbell-source",
32280
- label: "Doorbell trigger devices",
32281
- description: "Any of these becoming active rings this camera's virtual doorbell: a binary sensor when it goes active, a switch when it turns on.",
32282
- shape: "association",
32283
- hostDeviceTypes: [DeviceType.Camera],
32284
- sourceCaps: SOURCE_CAPS,
32285
- cardinality: "many",
32286
- value: DoorbellSourceSlotValueSchema
32287
- };
32288
- var doorbellCapability = {
32289
- name: "doorbell",
32290
- scope: "device",
32291
- deviceNative: true,
32292
- mode: "singleton",
32293
- kind: "wrapper",
32294
- defaultActive: false,
32295
- deviceTypes: [DeviceType.Button, DeviceType.Camera],
32296
- extensionSlots: [DOORBELL_SOURCE_SLOT],
32297
- methods: {},
32298
- events: {
32299
- /**
32300
- * Fires once per physical press. Reolink delivers via Baichuan
32301
- * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
32302
- * release/duration — it's a pulse.
32303
- */
32304
- onPressed: {
32305
- data: DoorbellPressEventSchema,
32306
- fromState: {
32307
- field: "lastPressedAt",
32308
- on: "advance"
32309
- }
32310
- } },
32311
- status: {
32312
- schema: DoorbellStatusSchema,
32313
- kind: "push"
32314
- },
32315
- /**
32316
- * Runtime-state slice — last press timestamp + lifetime press count.
32317
- * Mirrored by the kernel and readable via
32318
- * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
32319
- * without subscribing.
32320
- */
32321
- runtimeState: DoorbellStatusSchema,
32322
- /**
32323
- * Runtime-state durability: **restored** — a monotonic accumulator: the slice IS the record. `lastPressedAt` is content here, not a clock, so it is deliberately NOT volatile.
32324
- *
32325
- * See `RuntimeStateDurability`. Enforced by
32326
- * `scripts/check-runtime-state-durability.ts`.
32327
- */
32328
- durability: "restored"
32329
- };
32330
- var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
32331
- DeviceType.Camera, DeviceType.Camera;
32332
- /** A slot's editable value, discriminated on `slot`. */
32333
- var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
32334
- /** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
32335
- var EXTENSION_HOST_DEVICE_TYPES = [DeviceType.Camera];
32336
- var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
32337
- state: literal("unreachable"),
32338
- reason: string()
32339
- })]);
32340
- /** One provider of slots — the D554 source-listing row. */
32341
- var ExtensionSourceSchema = object({
32342
- /** The routing prefix of every `slotRef` this provider serves. */
32343
- source: string(),
32344
- label: string(),
32345
- /** Stamped by the dispatcher from the registry (D557). */
32346
- addonId: string().optional(),
32347
- availability: ExtensionSourceAvailabilitySchema
32348
- });
32349
- /**
32350
- * How one picked source stands. `missing` — no such device (deleted, or an id
32351
- * that never existed); `foreign` — a device the slot's owner cannot read from
32352
- * (a source owned by another addon); `unavailable` — it exists but is not a
32353
- * valid source now (a container, which is never a pick). A source in any of
32354
- * these states is SHOWN, never silently dropped or re-pointed.
32355
- */
32356
- var ExtensionSourceHealthSchema = _enum([
32357
- "ok",
32358
- "missing",
32359
- "foreign",
32360
- "unavailable"
32361
- ]);
32362
- var ExtensionSlotSourceSchema = object({
32363
- deviceId: number().int(),
32364
- /** The device's name, or null when it could not be resolved (`missing`). */
32365
- name: string().nullable(),
32366
- health: ExtensionSourceHealthSchema,
32367
- detail: string().optional()
32368
- });
32369
- /**
32370
- * A DIFFERENT authority that gates whether the slot's sources do anything —
32371
- * reported read-only, named, never written through this contract (D62). The
32372
- * virtual doorbell's sources ring only while the wrapper is bound to the
32373
- * camera, and that binding belongs to `deviceManager.setWrapperActive`.
32374
- * `unknown` means the gate could not be read; it is not "inactive" (D315).
32375
- */
32376
- var ExtensionSlotActivationSchema = object({
32377
- state: _enum([
32378
- "active",
32379
- "inactive",
32380
- "unknown"
32381
- ]),
32382
- authority: string(),
32383
- detail: string().optional()
32384
- });
32385
- var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
32386
- state: literal("ok"),
32387
- /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
32388
- slotRef: string(),
32389
- slot: ExtensionSlotIdSchema,
32390
- /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
32391
- authority: string(),
32392
- activation: ExtensionSlotActivationSchema.nullable(),
32393
- value: ExtensionSlotValueSchema,
32394
- sources: array(ExtensionSlotSourceSchema),
32395
- /**
32396
- * Devices the owner links to the host ON ITS OWN, by structure, and that
32397
- * are therefore not in `value` (D655): a camera's device-tree children, and
32398
- * the child a picked container stands for (D356 — a container is never a
32399
- * pick, its children are). Read-only; the editor shows them and may offer
32400
- * per-device options on them (the linked-devices tracked-event opt-in).
32401
- * Absent when the owner links nothing beyond the picks, and from an owner
32402
- * older than D655.
32403
- */
32404
- impliedSources: array(ExtensionSlotSourceSchema).optional()
32405
- }), object({
32406
- state: literal("unreachable"),
32407
- addonId: string(),
32408
- reason: string()
32409
- })]);
32410
- var ExtensionCandidatesSchema = object({ candidates: array(object({
32411
- deviceId: number().int(),
32412
- name: string(),
32413
- type: string(),
32414
- location: string().nullable(),
32415
- /** The container a child belongs to — "Spotlight 2" alone does not say which. */
32416
- parentName: string().nullable(),
32417
- /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
32418
- suggested: boolean(),
32419
- /** Why it is suggested ("same location"), null when it is not. */
32420
- reason: string().nullable()
32421
- })) });
32422
- /**
32423
- * What a write did. `none` — applied in place. `host` / `parent` — the owner
32424
- * reloaded the host (or, for an accessory child, its parent) because the
32425
- * write changed what the host REGISTERS. A slot never adds a capability to its
32426
- * host — that is a composition (D663) — so today's owners answer `none`.
32427
- */
32428
- var ExtensionSetResultSchema = object({
32429
- applied: literal(true),
32430
- reload: _enum([
32431
- "none",
32432
- "host",
32433
- "parent"
32434
- ])
32435
- });
32436
- var ExtensionSlotRefInputSchema = object({
32437
- deviceId: number().int(),
32438
- slotRef: string().min(1)
32439
- });
32440
- var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
32441
- var deviceExtensionCapability = {
32442
- name: "device-extension",
32443
- scope: "device",
32444
- mode: "collection",
32445
- kind: "wrapper",
32446
- defaultActive: true,
32447
- deviceTypes: EXTENSION_HOST_DEVICE_TYPES,
32448
- deviceConfig: { ui: {
32449
- kind: "widget",
32450
- widgetId: "host/extensions-panel",
32451
- tab: "general",
32452
- label: "Extensions",
32453
- order: 72
32454
- } },
32455
- methods: {
32456
- /** One row per slot owner — the D554 source listing `slotRef` routes by. */
32457
- listSources: method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)),
32458
- /**
32459
- * Every slot this device is offered, read by each owner from its own
32460
- * store. A provider that throws is ONE `unreachable` row (D554.4).
32461
- */
32462
- listSlots: method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)),
32463
- /** The devices the slot's editor may offer, suggestions pre-marked (D356). */
32464
- listCandidates: method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema),
32465
- /**
32466
- * Write one slot through its owner's EXISTING write path. The owner
32467
- * validates (a container is never a linked device, a camera is never its
32468
- * own source) and refuses by name before persisting.
32469
- */
32470
- setSlot: method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
32471
- kind: "mutation",
32472
- auth: "admin"
32473
- })
32474
- }
32475
- };
32476
- /**
32477
32572
  * Optional client-side hints sent at session creation to help the provider
32478
32573
  * pick the best native source. All fields optional — a viewer that knows
32479
32574
  * nothing still gets a sane default. (Relocated from the retired `webrtc`
@@ -35359,6 +35454,70 @@ onStatusChanged: { data: object({
35359
35454
  * whether persisting is worth a SQLite commit. */
35360
35455
  volatileStateFields: ["lastChangedAt"]
35361
35456
  };
35457
+ var DoorbellStatusSchema = object({
35458
+ /** Ms epoch of the last press. null = never observed since this provider started. */
35459
+ lastPressedAt: number().nullable(),
35460
+ /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
35461
+ pressCountSinceStart: number()
35462
+ });
35463
+ var DoorbellPressEventSchema = object({
35464
+ deviceId: number(),
35465
+ timestamp: number()
35466
+ });
35467
+ /**
35468
+ * Doorbell button cap. Two kinds of provider serve it, and to every consumer
35469
+ * they are the same cap:
35470
+ *
35471
+ * - **Native** providers, registered per device by a driver addon through
35472
+ * `ctx.registerNativeCap` — a `DeviceType.Button` accessory with
35473
+ * `role: DeviceRole.Doorbell`, or the camera itself (Reolink registers at
35474
+ * camera level). They emit `onPressed` on every firmware ring.
35475
+ * - **A composed doorbell** (D670, D671): a camera's customization gives it
35476
+ * the cap, its `lastPressedAt` rising from the sources the operator
35477
+ * assigned in Customize → Doorbell, and the composer emits `onPressed`
35478
+ * from that field's advance (`fromState`).
35479
+ *
35480
+ * The DeviceEventPropagator re-emits `onPressed` on the camera parent.
35481
+ */
35482
+ var doorbellCapability = {
35483
+ name: "doorbell",
35484
+ scope: "device",
35485
+ deviceNative: true,
35486
+ mode: "singleton",
35487
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
35488
+ methods: {},
35489
+ events: {
35490
+ /**
35491
+ * Fires once per physical press. Reolink delivers via Baichuan
35492
+ * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
35493
+ * release/duration — it's a pulse.
35494
+ */
35495
+ onPressed: {
35496
+ data: DoorbellPressEventSchema,
35497
+ fromState: {
35498
+ field: "lastPressedAt",
35499
+ on: "advance"
35500
+ }
35501
+ } },
35502
+ status: {
35503
+ schema: DoorbellStatusSchema,
35504
+ kind: "push"
35505
+ },
35506
+ /**
35507
+ * Runtime-state slice — last press timestamp + lifetime press count.
35508
+ * Mirrored by the kernel and readable via
35509
+ * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
35510
+ * without subscribing.
35511
+ */
35512
+ runtimeState: DoorbellStatusSchema,
35513
+ /**
35514
+ * Runtime-state durability: **restored** — a monotonic accumulator: the slice IS the record. `lastPressedAt` is content here, not a clock, so it is deliberately NOT volatile.
35515
+ *
35516
+ * See `RuntimeStateDurability`. Enforced by
35517
+ * `scripts/check-runtime-state-durability.ts`.
35518
+ */
35519
+ durability: "restored"
35520
+ };
35362
35521
  /**
35363
35522
  * Enum-state sensor — a string value picked from a finite option set.
35364
35523
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -37738,9 +37897,9 @@ var MotionStatusSchema = object({
37738
37897
  /** Ms epoch of the last detected-true observation. Null if never detected. */
37739
37898
  lastDetectedAt: number().nullable(),
37740
37899
  /**
37741
- * `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
37742
- * `null` while false and on every `Sensor` device (D475) — see that
37743
- * constant's doc for the one-authority rule.
37900
+ * `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device (the
37901
+ * orchestrator writes it, D696), `null` while false and on every `Sensor`
37902
+ * device (D475) — see that constant's doc for the one-authority rule.
37744
37903
  *
37745
37904
  * ## Reading this field still arms nothing
37746
37905
  *
@@ -37758,34 +37917,31 @@ var MotionStatusSchema = object({
37758
37917
  * `addon-export-alexa/src/motion-clear-hold.ts` and
37759
37918
  * `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
37760
37919
  *
37761
- * ## Who writes it
37762
- *
37763
- * - **Cameras** — the runner's phase machine, `active → watching` on
37764
- * `cooldown_expired`, which then writes this slice with
37765
- * `detected: false` (`handlePhaseChanged` in
37766
- * `pipeline-runner/index.ts`). It produces the FALLING edge, which
37767
- * matters most for the sources that only ever push a rising one:
37768
- * Reolink emits `MotionOnMotionChanged { detected: true }` and never
37769
- * a false.
37770
- * - **Sensors** (Home Assistant binary sensors, Homematic) — the
37771
- * provider pushes the false itself, from the upstream system's own
37772
- * state change. No phase machine is involved.
37773
- *
37774
- * ### The phase machine is CANONICAL, not sole — and that is a defect
37775
- *
37776
- * An earlier revision of this docblock (mine, 2026-09-12) claimed the
37777
- * phase machine is the sole writer for a camera. It is not.
37778
- * `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
37779
- * `setCapSlice(motionCapability, …)` on their own rising edge, and
37780
- * Hikvision's comment says why: it read THIS docblock, agreed the
37781
- * runner is canonical, and wrote anyway to avoid per-tick churn. So
37782
- * two authorities can disagree about one slice, which this repo
37783
- * forbids, and the doc said otherwise — which is worse than saying
37784
- * nothing, because it reads as verification.
37785
- *
37786
- * This predates D475 and is not fixed there: the fix touches every
37787
- * camera provider. Recorded in D475's Consequences. Do not restore the
37788
- * "sole writer" wording without also removing the other writers.
37920
+ * ## Who writes it (D696)
37921
+ *
37922
+ * - **Cameras** — the orchestrator, and nothing else. It writes the camera's
37923
+ * EFFECTIVE motion (`addon-pipeline-orchestrator`
37924
+ * `camera-sensors/motion-slice.ts`), alongside the effective
37925
+ * `MotionOnMotionChanged` it emits or receives: the camera-sensors bridge
37926
+ * for a split camera, an unsplit emitter's direct event, the analyzer and
37927
+ * device activity, as the camera's `motionSources` counts them. A source
37928
+ * that never sends a clear falls one window after its last `true`.
37929
+ * `lastDetectedAt` moves only on an effective rise. No camera provider
37930
+ * writes this slice (not even a boot seed), and neither does the runner's
37931
+ * phase machine: its phase is "a session is attached" for every on-motion
37932
+ * session, not motion, and it now has its own `DetectionPhaseTransition`.
37933
+ * A provider's `isDetected` answers from the hub's slice.
37934
+ * - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
37935
+ * imports) — the provider pushes both edges itself, from the upstream
37936
+ * system's own state change. That is the sensor's own fact.
37937
+ *
37938
+ * `scripts/check-onboard-motion-emitters.ts` refuses any other writer of a
37939
+ * `motion` slice; each sensor writer is a named exemption.
37940
+ *
37941
+ * This replaces the D475 §4 rule ("the phase machine is the sole writer").
37942
+ * That rule was never true: Hikvision and Amcrest wrote the slice raw beside
37943
+ * it, every provider seeded it at boot, and every session left it
37944
+ * `detected: true` after its detach.
37789
37945
  */
37790
37946
  autoClearAfterMs: number().nullable()
37791
37947
  });
@@ -37857,11 +38013,12 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
37857
38013
  */
37858
38014
  runtimeState: MotionStatusSchema,
37859
38015
  /**
37860
- * Runtime-state durability: **session** — every writer of this slice
38016
+ * Runtime-state durability: **session** — the writer of this slice
37861
38017
  * writes only on an EDGE, so a restored `detected: true` would stay
37862
38018
  * frozen until the next one instead of being corrected. The next edge
37863
- * re-publishes the real state. (On who the writers are, and why there
37864
- * is more than one, see `autoClearAfterMs` above.)
38019
+ * re-publishes the real state, and the orchestrator re-publishes every
38020
+ * camera when it starts writing (D696; on who writes it, see
38021
+ * `autoClearAfterMs` above).
37865
38022
  *
37866
38023
  * See `RuntimeStateDurability`. Enforced by
37867
38024
  * `scripts/check-runtime-state-durability.ts`.
@@ -40532,8 +40689,7 @@ var ptzAutotrackCapability = {
40532
40689
  deviceNative: true,
40533
40690
  mode: "singleton",
40534
40691
  /**
40535
- * Two kinds of provider behind one name, the same shape `snapshot` and
40536
- * `doorbell` use:
40692
+ * Two kinds of provider behind one name, the same shape `snapshot` uses:
40537
40693
  *
40538
40694
  * - **Native**: the camera's own firmware autotrack, registered per device by
40539
40695
  * the driver when the probe says it exists (Reolink: yes; Hikvision:
@@ -40541,7 +40697,7 @@ var ptzAutotrackCapability = {
40541
40697
  * - **Wrapper**: the emulated implementation (`@camstack/system`'s `autotrack` builtin),
40542
40698
  * which follows a subject with `ptz.move` pulses driven by the detection
40543
40699
  * pipeline. `defaultActive: false` — the operator binds it per camera in
40544
- * the bindings UI, exactly as `virtual-doorbell` is bound.
40700
+ * the bindings UI.
40545
40701
  *
40546
40702
  * The binding chooses WHICH implementation answers; `setEnabled` stays the
40547
40703
  * one switch for the function either way. A camera never has both driving its
@@ -46539,6 +46695,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
46539
46695
  coverCapability,
46540
46696
  customModelRegistryCapability,
46541
46697
  dataStoreProviderCapability,
46698
+ databaseSnapshotCapability,
46542
46699
  dayNightCapability,
46543
46700
  decoderCapability,
46544
46701
  detectionPipelineCapability,
@@ -47801,6 +47958,18 @@ Object.freeze({
47801
47958
  addonId: null,
47802
47959
  access: "view"
47803
47960
  },
47961
+ "databaseSnapshot.listDatabases": {
47962
+ capName: "database-snapshot",
47963
+ capScope: "system",
47964
+ addonId: null,
47965
+ access: "view"
47966
+ },
47967
+ "databaseSnapshot.writeSnapshot": {
47968
+ capName: "database-snapshot",
47969
+ capScope: "system",
47970
+ addonId: null,
47971
+ access: "create"
47972
+ },
47804
47973
  "dataStoreProvider.aggregate": {
47805
47974
  capName: "data-store-provider",
47806
47975
  capScope: "system",
@@ -56409,6 +56578,18 @@ var STATE_SUMMARY_VARS = [
56409
56578
  systemEventKinds: [...SUMMARISABLE],
56410
56579
  systemEventDeliveries: ["summary"]
56411
56580
  },
56581
+ {
56582
+ name: "summarySection",
56583
+ label: "Summary: this section",
56584
+ description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
56585
+ example: "Batterie scariche",
56586
+ group: "system",
56587
+ families: ["rule"],
56588
+ fields: [...RULE_TEXT],
56589
+ kinds: ["system"],
56590
+ systemEventKinds: [...SUMMARISABLE],
56591
+ systemEventDeliveries: ["summary"]
56592
+ },
56412
56593
  ...STATE_SUMMARY_SECTION_VARS.map((v) => ({
56413
56594
  name: v.name,
56414
56595
  label: v.label,
@@ -56747,6 +56928,7 @@ TimelapseRuleInputSchema.extend({
56747
56928
  createdAt: number(),
56748
56929
  updatedAt: number()
56749
56930
  });
56931
+ MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
56750
56932
  object({
56751
56933
  /**
56752
56934
  * Fraction of the box's own size added on EACH side before cutting.