@camstack/addon-osd-manager 0.1.151 → 0.1.152

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-D5c6b4QP.mjs} +2 -2
  2. package/dist/{PrivacyMaskSettings-BhVDaMHE.mjs → PrivacyMaskSettings-DMve7K-c.mjs} +4 -4
  3. package/dist/{SceneMonitorEditor-Bt7UBGiu.mjs → SceneMonitorEditor-e1z_C79o.mjs} +3 -3
  4. package/dist/_stub.js +79 -79
  5. package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-BdJcTI3r.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-C8rKpVdZ.mjs} +4 -4
  6. package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DQC5oc2I.mjs +26 -0
  7. package/dist/{hostInit-tyNFvZo9.mjs → hostInit-B8_o5hJj.mjs} +3 -3
  8. package/dist/index.js +469 -315
  9. package/dist/index.mjs +469 -315
  10. package/dist/{player-overlays-qwCKS5Oy.mjs → player-overlays-BchlNvHO.mjs} +1 -1
  11. package/dist/remoteEntry.js +1 -1
  12. package/dist/{responsive-D-UTdp-i.mjs → responsive-DRZ6VoYV.mjs} +1 -1
  13. package/dist/{scene-monitor-copy-BWmGHVvh.mjs → scene-monitor-copy-CmtMsrJb.mjs} +1 -1
  14. package/dist/{square-DIs3wUiy.mjs → square-BYLYL5VB.mjs} +1 -1
  15. package/dist/{trash-2-DzfMGb1n.mjs → trash-2-BdEqSrHt.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-p2S4DkBF.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.mjs CHANGED
@@ -11897,6 +11897,103 @@ var authProviderCapability = {
11897
11897
  mount: { kind: "skip" }
11898
11898
  };
11899
11899
  /**
11900
+ * How long one snapshot may take end to end: the pinned copy of the whole
11901
+ * database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
11902
+ * disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
11903
+ * generous because a timeout fails the whole backup run.
11904
+ */
11905
+ var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
11906
+ /**
11907
+ * The databases an owner snapshots — declared by the OWNER, so a caller never
11908
+ * guesses which file is live from what sits beside it (a cleanly closed
11909
+ * database has no sidecars and is just as owned). Paths are absolute on the
11910
+ * owner's host.
11911
+ */
11912
+ var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
11913
+ /** One b-tree table of the snapshot and the rows it holds. */
11914
+ var DatabaseSnapshotTableSchema = object({
11915
+ name: string(),
11916
+ rows: number().int().nonnegative()
11917
+ });
11918
+ /**
11919
+ * What the owner wrote. Every path is ABSOLUTE on the owner's host — the
11920
+ * caller pins the call to its own node, so it can read the file; a caller
11921
+ * that finds the path outside its own data root refuses it rather than
11922
+ * archiving something it cannot place.
11923
+ */
11924
+ var DatabaseSnapshotResultSchema = object({
11925
+ /** The live database the snapshot copies. Never to be copied as a file. */
11926
+ livePath: string(),
11927
+ /** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
11928
+ snapshotPath: string(),
11929
+ sizeBytes: number().int().nonnegative(),
11930
+ pageCount: number().int().nonnegative(),
11931
+ pageSize: number().int().positive(),
11932
+ /**
11933
+ * Every b-tree table with its row count. Read inside the SAME read
11934
+ * transaction the copy was taken from, and found EQUAL on the copy — so
11935
+ * this is the content of the snapshot, not an estimate of the source.
11936
+ */
11937
+ tables: array(DatabaseSnapshotTableSchema),
11938
+ /** Wall time of the pinned copy (row counts included). */
11939
+ copyMs: number().nonnegative(),
11940
+ /** Wall time of the checks on the copy (`integrity_check`, row counts). */
11941
+ verifyMs: number().nonnegative(),
11942
+ /** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
11943
+ takenAt: number()
11944
+ });
11945
+ /**
11946
+ * A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
11947
+ * the same facts, with both paths relative to the archive root (the node's
11948
+ * data dir), because an archive outlives the host that made it.
11949
+ */
11950
+ var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
11951
+ /** Archive-relative path of the live database the archive does NOT carry. */
11952
+ livePath: string(),
11953
+ /** Archive-relative path of the verified copy it carries in its place. */
11954
+ snapshotPath: string()
11955
+ });
11956
+ /**
11957
+ * database-snapshot — the OWNER of a live SQLite database writes a consistent,
11958
+ * verified copy of it (D693).
11959
+ *
11960
+ * A live database cannot be copied as files: three files written by a live
11961
+ * process cannot be read at one instant from outside it, and a tar of the
11962
+ * `.db` / `-wal` / `-shm` trio was measured torn in 6/6 archives (D679). Nor may
11963
+ * another process open it (D679 rule 2). So the process that owns the
11964
+ * connection writes the copy — through its own connection, on a thread,
11965
+ * pinned to one read transaction — and checks it before handing it out.
11966
+ *
11967
+ * Hub-only and internal: `sqlite-settings` is the registrant, and its consumer
11968
+ * is `backup-orchestrator`, which calls it pinned to its own node so the path
11969
+ * it gets back is on its own host. `auth: 'admin'` explicitly — `internal`
11970
+ * does not gate the mount (see `data-store-provider`).
11971
+ */
11972
+ var databaseSnapshotCapability = {
11973
+ name: "database-snapshot",
11974
+ scope: "system",
11975
+ mode: "singleton",
11976
+ internal: true,
11977
+ methods: {
11978
+ /**
11979
+ * Which databases this owner snapshots. Answered from memory — no file is
11980
+ * touched — so a backup can ask it before deciding anything.
11981
+ */
11982
+ listDatabases: method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }),
11983
+ /**
11984
+ * Write `<db>.backup-snapshot` and return what it holds. Throws — and
11985
+ * leaves no file under the final name — when the copy fails
11986
+ * `integrity_check` or its row counts differ from the pinned source's.
11987
+ * A second call while one is running joins it.
11988
+ */
11989
+ writeSnapshot: method(object({}), DatabaseSnapshotResultSchema, {
11990
+ kind: "mutation",
11991
+ auth: "admin",
11992
+ timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
11993
+ })
11994
+ }
11995
+ };
11996
+ /**
11900
11997
  * Orchestrator-side destination metadata. The orchestrator computes
11901
11998
  * `id = <addonId>:<subId>` from its provider lookup so consumers
11902
11999
  * (admin UI, restore flow) see one canonical key.
@@ -12007,7 +12104,12 @@ var ArchiveManifestSchema = object({
12007
12104
  locations: array(string()),
12008
12105
  entries: array(ArchiveEntrySchema),
12009
12106
  totalBytes: number(),
12010
- totalFiles: number()
12107
+ totalFiles: number(),
12108
+ /**
12109
+ * Live SQLite databases this archive carries as their OWNER's verified
12110
+ * snapshot instead of as files (D693). Absent on archives made before.
12111
+ */
12112
+ sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
12011
12113
  });
12012
12114
  var LocationStatSchema = object({
12013
12115
  name: string(),
@@ -13975,6 +14077,65 @@ var CompositionBlockStateSchema = object({
13975
14077
  reason: string().optional(),
13976
14078
  fields: array(CompositionFieldStateSchema)
13977
14079
  });
14080
+ var ComposerBlockSchema = object({
14081
+ id: string().min(1),
14082
+ name: string().min(1).max(120),
14083
+ enabled: boolean(),
14084
+ updatedAt: number(),
14085
+ composition: CompositionSchema
14086
+ });
14087
+ /**
14088
+ * A stored composition row that no longer PARSES — a schema a release
14089
+ * tightened, a row written by a newer build. Sent by id so the composer keeps
14090
+ * its device as a placeholder and reports the block `failed` naming the parse
14091
+ * error. Leaving it out would read, twice, exactly like a delete (D49).
14092
+ */
14093
+ var ComposerUnreadableBlockSchema = object({
14094
+ id: string().min(1),
14095
+ /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
14096
+ name: string().nullable(),
14097
+ /** The parse error, in the operator's words. */
14098
+ error: string()
14099
+ });
14100
+ var composerCapability = {
14101
+ name: "composer",
14102
+ scope: "system",
14103
+ mode: "singleton",
14104
+ internal: true,
14105
+ methods: {
14106
+ /**
14107
+ * Not `apply`: tRPC reserves `apply`, `call` and `then` as router keys, and
14108
+ * `router({})` throws on one — every cap router is built at boot.
14109
+ */
14110
+ applyBlocks: method(object({
14111
+ /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
14112
+ integrationId: string().nullable(),
14113
+ /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
14114
+ storeLoaded: boolean(),
14115
+ blocks: array(ComposerBlockSchema),
14116
+ /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
14117
+ restartBlockIds: array(string()),
14118
+ /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
14119
+ unreadableBlocks: array(ComposerUnreadableBlockSchema)
14120
+ }), object({
14121
+ blocks: array(object({
14122
+ blockId: string(),
14123
+ status: CompositionRunStatusSchema,
14124
+ reason: string().optional()
14125
+ })),
14126
+ /**
14127
+ * False when the composer declared and withdrew NOTHING (store not loaded,
14128
+ * integration unknown, its own rows unread or read empty once). An empty
14129
+ * apply the caller owes is paid off only by one the composer acted on (D49).
14130
+ */
14131
+ acted: boolean()
14132
+ }), {
14133
+ kind: "mutation",
14134
+ auth: "admin"
14135
+ }),
14136
+ getStates: method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" })
14137
+ }
14138
+ };
13978
14139
  var NUMBER = {
13979
14140
  kind: "fixed",
13980
14141
  result: ["number"]
@@ -14290,65 +14451,6 @@ var coreBlocksCapability = {
14290
14451
  })
14291
14452
  }
14292
14453
  };
14293
- var ComposerBlockSchema = object({
14294
- id: string().min(1),
14295
- name: string().min(1).max(120),
14296
- enabled: boolean(),
14297
- updatedAt: number(),
14298
- composition: CompositionSchema
14299
- });
14300
- /**
14301
- * A stored composition row that no longer PARSES — a schema a release
14302
- * tightened, a row written by a newer build. Sent by id so the composer keeps
14303
- * its device as a placeholder and reports the block `failed` naming the parse
14304
- * error. Leaving it out would read, twice, exactly like a delete (D49).
14305
- */
14306
- var ComposerUnreadableBlockSchema = object({
14307
- id: string().min(1),
14308
- /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
14309
- name: string().nullable(),
14310
- /** The parse error, in the operator's words. */
14311
- error: string()
14312
- });
14313
- var composerCapability = {
14314
- name: "composer",
14315
- scope: "system",
14316
- mode: "singleton",
14317
- internal: true,
14318
- methods: {
14319
- /**
14320
- * Not `apply`: tRPC reserves `apply`, `call` and `then` as router keys, and
14321
- * `router({})` throws on one — every cap router is built at boot.
14322
- */
14323
- applyBlocks: method(object({
14324
- /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
14325
- integrationId: string().nullable(),
14326
- /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
14327
- storeLoaded: boolean(),
14328
- blocks: array(ComposerBlockSchema),
14329
- /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
14330
- restartBlockIds: array(string()),
14331
- /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
14332
- unreadableBlocks: array(ComposerUnreadableBlockSchema)
14333
- }), object({
14334
- blocks: array(object({
14335
- blockId: string(),
14336
- status: CompositionRunStatusSchema,
14337
- reason: string().optional()
14338
- })),
14339
- /**
14340
- * False when the composer declared and withdrew NOTHING (store not loaded,
14341
- * integration unknown, its own rows unread or read empty once). An empty
14342
- * apply the caller owes is paid off only by one the composer acted on (D49).
14343
- */
14344
- acted: boolean()
14345
- }), {
14346
- kind: "mutation",
14347
- auth: "admin"
14348
- }),
14349
- getStates: method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" })
14350
- }
14351
- };
14352
14454
  /**
14353
14455
  * `custom-model-registry` — collection cap exposing operator-registered
14354
14456
  * custom detection models. Each provider (today: `addon-model-studio`)
@@ -17384,6 +17486,251 @@ var deviceManagerCapability = {
17384
17486
  }
17385
17487
  };
17386
17488
  /**
17489
+ * Doorbell button cap. Two kinds of providers coexist behind this cap
17490
+ * name (same pattern as `snapshot`):
17491
+ *
17492
+ * - **Native** providers: registered per-device by device-driver
17493
+ * addons via `ctx.registerNativeCap` — either on a
17494
+ * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
17495
+ * or directly on the camera (Reolink registers at camera level).
17496
+ * Emits an `onPressed` event every time the firmware pushes a
17497
+ * ring; status tracks the last press and a pressCount since start
17498
+ * (diagnostic).
17499
+ *
17500
+ * - **Wrapper** provider: the `virtual-doorbell` system builtin
17501
+ * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
17502
+ * device (contact / switch / event-emitter …) into a doorbell for
17503
+ * a camera. `defaultActive: false` — the operator explicitly binds
17504
+ * it per camera in the device-bindings UI, then picks the source
17505
+ * device + trigger in the per-device settings.
17506
+ *
17507
+ * The DeviceEventPropagator re-emits `onPressed` on the camera parent
17508
+ * — subscribers listening at the camera level receive ring events
17509
+ * with `via[]` populated. No code on the parent needed.
17510
+ */
17511
+ var DoorbellStatusSchema = object({
17512
+ /** Ms epoch of the last press. null = never observed since this provider started. */
17513
+ lastPressedAt: number().nullable(),
17514
+ /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
17515
+ pressCountSinceStart: number()
17516
+ });
17517
+ var DoorbellPressEventSchema = object({
17518
+ deviceId: number(),
17519
+ timestamp: number()
17520
+ });
17521
+ /**
17522
+ * The `doorbell-source` extension slot's editable value (D648): the camera's
17523
+ * virtual-doorbell trigger devices, exactly what the wrapper's
17524
+ * `doorbellSources` persists (as `{ deviceId }` records).
17525
+ */
17526
+ var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
17527
+ /**
17528
+ * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
17529
+ * doorbell, owned by the `virtual-doorbell` wrapper over its
17530
+ * `doorbellSources` store (D648). A source rings when one of its
17531
+ * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
17532
+ * different authority (`deviceManager.setWrapperActive`, D62) — the slot
17533
+ * reports it, it never writes it.
17534
+ */
17535
+ var DOORBELL_SOURCE_SLOT = {
17536
+ id: "doorbell-source",
17537
+ label: "Doorbell trigger devices",
17538
+ 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.",
17539
+ shape: "association",
17540
+ hostDeviceTypes: [DeviceType.Camera],
17541
+ sourceCaps: SOURCE_CAPS,
17542
+ cardinality: "many",
17543
+ value: DoorbellSourceSlotValueSchema
17544
+ };
17545
+ var doorbellCapability = {
17546
+ name: "doorbell",
17547
+ scope: "device",
17548
+ deviceNative: true,
17549
+ mode: "singleton",
17550
+ kind: "wrapper",
17551
+ defaultActive: false,
17552
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
17553
+ extensionSlots: [DOORBELL_SOURCE_SLOT],
17554
+ methods: {},
17555
+ events: {
17556
+ /**
17557
+ * Fires once per physical press. Reolink delivers via Baichuan
17558
+ * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
17559
+ * release/duration — it's a pulse.
17560
+ */
17561
+ onPressed: {
17562
+ data: DoorbellPressEventSchema,
17563
+ fromState: {
17564
+ field: "lastPressedAt",
17565
+ on: "advance"
17566
+ }
17567
+ } },
17568
+ status: {
17569
+ schema: DoorbellStatusSchema,
17570
+ kind: "push"
17571
+ },
17572
+ /**
17573
+ * Runtime-state slice — last press timestamp + lifetime press count.
17574
+ * Mirrored by the kernel and readable via
17575
+ * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
17576
+ * without subscribing.
17577
+ */
17578
+ runtimeState: DoorbellStatusSchema,
17579
+ /**
17580
+ * 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.
17581
+ *
17582
+ * See `RuntimeStateDurability`. Enforced by
17583
+ * `scripts/check-runtime-state-durability.ts`.
17584
+ */
17585
+ durability: "restored"
17586
+ };
17587
+ var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
17588
+ DeviceType.Camera, DeviceType.Camera;
17589
+ /** A slot's editable value, discriminated on `slot`. */
17590
+ var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
17591
+ /** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
17592
+ var EXTENSION_HOST_DEVICE_TYPES = [DeviceType.Camera];
17593
+ var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
17594
+ state: literal("unreachable"),
17595
+ reason: string()
17596
+ })]);
17597
+ /** One provider of slots — the D554 source-listing row. */
17598
+ var ExtensionSourceSchema = object({
17599
+ /** The routing prefix of every `slotRef` this provider serves. */
17600
+ source: string(),
17601
+ label: string(),
17602
+ /** Stamped by the dispatcher from the registry (D557). */
17603
+ addonId: string().optional(),
17604
+ availability: ExtensionSourceAvailabilitySchema
17605
+ });
17606
+ /**
17607
+ * How one picked source stands. `missing` — no such device (deleted, or an id
17608
+ * that never existed); `foreign` — a device the slot's owner cannot read from
17609
+ * (a source owned by another addon); `unavailable` — it exists but is not a
17610
+ * valid source now (a container, which is never a pick). A source in any of
17611
+ * these states is SHOWN, never silently dropped or re-pointed.
17612
+ */
17613
+ var ExtensionSourceHealthSchema = _enum([
17614
+ "ok",
17615
+ "missing",
17616
+ "foreign",
17617
+ "unavailable"
17618
+ ]);
17619
+ var ExtensionSlotSourceSchema = object({
17620
+ deviceId: number().int(),
17621
+ /** The device's name, or null when it could not be resolved (`missing`). */
17622
+ name: string().nullable(),
17623
+ health: ExtensionSourceHealthSchema,
17624
+ detail: string().optional()
17625
+ });
17626
+ /**
17627
+ * A DIFFERENT authority that gates whether the slot's sources do anything —
17628
+ * reported read-only, named, never written through this contract (D62). The
17629
+ * virtual doorbell's sources ring only while the wrapper is bound to the
17630
+ * camera, and that binding belongs to `deviceManager.setWrapperActive`.
17631
+ * `unknown` means the gate could not be read; it is not "inactive" (D315).
17632
+ */
17633
+ var ExtensionSlotActivationSchema = object({
17634
+ state: _enum([
17635
+ "active",
17636
+ "inactive",
17637
+ "unknown"
17638
+ ]),
17639
+ authority: string(),
17640
+ detail: string().optional()
17641
+ });
17642
+ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
17643
+ state: literal("ok"),
17644
+ /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
17645
+ slotRef: string(),
17646
+ slot: ExtensionSlotIdSchema,
17647
+ /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
17648
+ authority: string(),
17649
+ activation: ExtensionSlotActivationSchema.nullable(),
17650
+ value: ExtensionSlotValueSchema,
17651
+ sources: array(ExtensionSlotSourceSchema),
17652
+ /**
17653
+ * Devices the owner links to the host ON ITS OWN, by structure, and that
17654
+ * are therefore not in `value` (D655): a camera's device-tree children, and
17655
+ * the child a picked container stands for (D356 — a container is never a
17656
+ * pick, its children are). Read-only; the editor shows them and may offer
17657
+ * per-device options on them (the linked-devices tracked-event opt-in).
17658
+ * Absent when the owner links nothing beyond the picks, and from an owner
17659
+ * older than D655.
17660
+ */
17661
+ impliedSources: array(ExtensionSlotSourceSchema).optional()
17662
+ }), object({
17663
+ state: literal("unreachable"),
17664
+ addonId: string(),
17665
+ reason: string()
17666
+ })]);
17667
+ var ExtensionCandidatesSchema = object({ candidates: array(object({
17668
+ deviceId: number().int(),
17669
+ name: string(),
17670
+ type: string(),
17671
+ location: string().nullable(),
17672
+ /** The container a child belongs to — "Spotlight 2" alone does not say which. */
17673
+ parentName: string().nullable(),
17674
+ /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
17675
+ suggested: boolean(),
17676
+ /** Why it is suggested ("same location"), null when it is not. */
17677
+ reason: string().nullable()
17678
+ })) });
17679
+ /**
17680
+ * What a write did. `none` — applied in place. `host` / `parent` — the owner
17681
+ * reloaded the host (or, for an accessory child, its parent) because the
17682
+ * write changed what the host REGISTERS. A slot never adds a capability to its
17683
+ * host — that is a composition (D663) — so today's owners answer `none`.
17684
+ */
17685
+ var ExtensionSetResultSchema = object({
17686
+ applied: literal(true),
17687
+ reload: _enum([
17688
+ "none",
17689
+ "host",
17690
+ "parent"
17691
+ ])
17692
+ });
17693
+ var ExtensionSlotRefInputSchema = object({
17694
+ deviceId: number().int(),
17695
+ slotRef: string().min(1)
17696
+ });
17697
+ var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
17698
+ var deviceExtensionCapability = {
17699
+ name: "device-extension",
17700
+ scope: "device",
17701
+ mode: "collection",
17702
+ kind: "wrapper",
17703
+ defaultActive: true,
17704
+ deviceTypes: EXTENSION_HOST_DEVICE_TYPES,
17705
+ deviceConfig: { ui: {
17706
+ kind: "widget",
17707
+ widgetId: "host/extensions-panel",
17708
+ tab: "general",
17709
+ label: "Extensions",
17710
+ order: 72
17711
+ } },
17712
+ methods: {
17713
+ /** One row per slot owner — the D554 source listing `slotRef` routes by. */
17714
+ listSources: method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)),
17715
+ /**
17716
+ * Every slot this device is offered, read by each owner from its own
17717
+ * store. A provider that throws is ONE `unreachable` row (D554.4).
17718
+ */
17719
+ listSlots: method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)),
17720
+ /** The devices the slot's editor may offer, suggestions pre-marked (D356). */
17721
+ listCandidates: method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema),
17722
+ /**
17723
+ * Write one slot through its owner's EXISTING write path. The owner
17724
+ * validates (a container is never a linked device, a camera is never its
17725
+ * own source) and refuses by name before persisting.
17726
+ */
17727
+ setSlot: method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
17728
+ kind: "mutation",
17729
+ auth: "admin"
17730
+ })
17731
+ }
17732
+ };
17733
+ /**
17387
17734
  * Per-field ownership (D663). A composition may CLAIM fields of a native
17388
17735
  * cap's runtime-state slice on an existing device: `replace` overlays the
17389
17736
  * claimed fields on the native slice, `add` builds a slice the device does
@@ -20871,17 +21218,25 @@ var NcScheduleSchema = object({
20871
21218
  */
20872
21219
  var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
20873
21220
  /**
21221
+ * How a summary window is SENT (D698): `rule` (absent) = ONE notification with
21222
+ * every section; `section` = one notification per section with something to
21223
+ * say (an unavailable section included), each titled by its section.
21224
+ */
21225
+ var NcStateSummarySplitSchema = _enum(["rule", "section"]);
21226
+ /**
20874
21227
  * `summary`: the rule sends NOTHING per event. When a window of `schedule`
20875
21228
  * CLOSES, it sends one notification with the current state of its kinds
20876
21229
  * (low batteries, consumables to replace, devices offline, updates
20877
- * available, ...), after its own filters. Nothing to report sends nothing.
21230
+ * available, ...), after its own filters — or, with `split: 'section'`
21231
+ * (D698), one notification per section. Nothing to report sends nothing.
20878
21232
  * The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
20879
21233
  * midnight crossing); the send time is each window's END. Refused on the
20880
21234
  * `alarm` family, which stays instant (`systemEventDeliveryProblems`).
20881
21235
  */
20882
21236
  var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
20883
21237
  mode: literal("summary"),
20884
- schedule: NcScheduleSchema
21238
+ schedule: NcScheduleSchema,
21239
+ split: NcStateSummarySplitSchema.optional()
20885
21240
  })]);
20886
21241
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
20887
21242
  var NcPlateMatcherSchema = object({
@@ -21532,10 +21887,12 @@ var NcMediaPolicySchema = object({
21532
21887
  /**
21533
21888
  * Cooldown GRANULARITY over the subject's class — how much a fired
21534
21889
  * notification suppresses.
21535
- * - `shared` (default, and the absent value) — one window for the whole
21536
- * rule/scope: a cat silences the next dog for `cooldownSec`.
21537
- * - `per-class` — an independent window per detected class, so cat→dog fires
21538
- * at once and cat→cat still waits.
21890
+ * - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
21891
+ * independent window per detected class: cat→dog fires at once, cat→cat
21892
+ * still waits.
21893
+ * - `shared` — one window for the whole rule/scope: a cat silences the next
21894
+ * dog for `cooldownSec`. Only written when an operator picks it; it is no
21895
+ * longer what an unset rule means.
21539
21896
  *
21540
21897
  * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
21541
21898
  * must not be swallowed by a bark's window (the precedent this generalizes —
@@ -21550,8 +21907,11 @@ var NcThrottleSchema = object({
21550
21907
  /**
21551
21908
  * Class granularity of the cooldown key. Optional rather than defaulted:
21552
21909
  * a Zod default does NOT run on the addon→addon cap path, so a persisted
21553
- * rule authored before this field simply carries none — and the engine
21554
- * reads absent as `shared`, the pre-existing behaviour.
21910
+ * rule authored before this field simply carries none. The engine used to
21911
+ * read absent as `shared` (D36); since 2026-10-01 it reads absent as
21912
+ * `per-class` — the operator's default — and only an explicit `shared`
21913
+ * still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
21914
+ * engine, and D36's dated note.
21555
21915
  */
21556
21916
  granularity: NcThrottleGranularitySchema.optional()
21557
21917
  });
@@ -21875,11 +22235,23 @@ var NcStateSummaryPreviewSectionSchema = object({
21875
22235
  reason: string().optional()
21876
22236
  });
21877
22237
  /**
22238
+ * One notification a previewed summary would send (D698): the whole summary on
22239
+ * a `rule` split (no `section`), one section's on a `section` split.
22240
+ */
22241
+ var NcStateSummaryPreviewRowSchema = object({
22242
+ section: string().optional(),
22243
+ /** The section's name on a per-section row; every reported section's, joined, on a combined one. */
22244
+ title: string(),
22245
+ text: string(),
22246
+ count: number().int().nonnegative()
22247
+ });
22248
+ /**
21878
22249
  * The summary a rule would send now. `empty` = nothing to report and every
21879
22250
  * section read: such a summary is NOT sent. `dropped` counts the open states
21880
22251
  * the rule's own filters (or a camera mute) left out, by reason.
21881
22252
  * `excludedGroups` names the kind groups selected that have no state to report
21882
- * (backups & exports).
22253
+ * (backups & exports). `split` and `rows` (D698) say how it would be sent —
22254
+ * optional, so an older hub's answer still parses.
21883
22255
  */
21884
22256
  var NcStateSummaryPreviewSchema = object({
21885
22257
  empty: boolean(),
@@ -21887,7 +22259,9 @@ var NcStateSummaryPreviewSchema = object({
21887
22259
  text: string(),
21888
22260
  sections: array(NcStateSummaryPreviewSectionSchema),
21889
22261
  dropped: record(string(), number().int().nonnegative()),
21890
- excludedGroups: array(string())
22262
+ excludedGroups: array(string()),
22263
+ split: NcStateSummarySplitSchema.optional(),
22264
+ rows: array(NcStateSummaryPreviewRowSchema).optional()
21891
22265
  });
21892
22266
  var NcTestResultSchema = object({
21893
22267
  recordId: string(),
@@ -32225,251 +32599,6 @@ var videoclipsCapability = {
32225
32599
  }
32226
32600
  };
32227
32601
  /**
32228
- * Doorbell button cap. Two kinds of providers coexist behind this cap
32229
- * name (same pattern as `snapshot`):
32230
- *
32231
- * - **Native** providers: registered per-device by device-driver
32232
- * addons via `ctx.registerNativeCap` — either on a
32233
- * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
32234
- * or directly on the camera (Reolink registers at camera level).
32235
- * Emits an `onPressed` event every time the firmware pushes a
32236
- * ring; status tracks the last press and a pressCount since start
32237
- * (diagnostic).
32238
- *
32239
- * - **Wrapper** provider: the `virtual-doorbell` system builtin
32240
- * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
32241
- * device (contact / switch / event-emitter …) into a doorbell for
32242
- * a camera. `defaultActive: false` — the operator explicitly binds
32243
- * it per camera in the device-bindings UI, then picks the source
32244
- * device + trigger in the per-device settings.
32245
- *
32246
- * The DeviceEventPropagator re-emits `onPressed` on the camera parent
32247
- * — subscribers listening at the camera level receive ring events
32248
- * with `via[]` populated. No code on the parent needed.
32249
- */
32250
- var DoorbellStatusSchema = object({
32251
- /** Ms epoch of the last press. null = never observed since this provider started. */
32252
- lastPressedAt: number().nullable(),
32253
- /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
32254
- pressCountSinceStart: number()
32255
- });
32256
- var DoorbellPressEventSchema = object({
32257
- deviceId: number(),
32258
- timestamp: number()
32259
- });
32260
- /**
32261
- * The `doorbell-source` extension slot's editable value (D648): the camera's
32262
- * virtual-doorbell trigger devices, exactly what the wrapper's
32263
- * `doorbellSources` persists (as `{ deviceId }` records).
32264
- */
32265
- var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
32266
- /**
32267
- * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
32268
- * doorbell, owned by the `virtual-doorbell` wrapper over its
32269
- * `doorbellSources` store (D648). A source rings when one of its
32270
- * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
32271
- * different authority (`deviceManager.setWrapperActive`, D62) — the slot
32272
- * reports it, it never writes it.
32273
- */
32274
- var DOORBELL_SOURCE_SLOT = {
32275
- id: "doorbell-source",
32276
- label: "Doorbell trigger devices",
32277
- 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.",
32278
- shape: "association",
32279
- hostDeviceTypes: [DeviceType.Camera],
32280
- sourceCaps: SOURCE_CAPS,
32281
- cardinality: "many",
32282
- value: DoorbellSourceSlotValueSchema
32283
- };
32284
- var doorbellCapability = {
32285
- name: "doorbell",
32286
- scope: "device",
32287
- deviceNative: true,
32288
- mode: "singleton",
32289
- kind: "wrapper",
32290
- defaultActive: false,
32291
- deviceTypes: [DeviceType.Button, DeviceType.Camera],
32292
- extensionSlots: [DOORBELL_SOURCE_SLOT],
32293
- methods: {},
32294
- events: {
32295
- /**
32296
- * Fires once per physical press. Reolink delivers via Baichuan
32297
- * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
32298
- * release/duration — it's a pulse.
32299
- */
32300
- onPressed: {
32301
- data: DoorbellPressEventSchema,
32302
- fromState: {
32303
- field: "lastPressedAt",
32304
- on: "advance"
32305
- }
32306
- } },
32307
- status: {
32308
- schema: DoorbellStatusSchema,
32309
- kind: "push"
32310
- },
32311
- /**
32312
- * Runtime-state slice — last press timestamp + lifetime press count.
32313
- * Mirrored by the kernel and readable via
32314
- * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
32315
- * without subscribing.
32316
- */
32317
- runtimeState: DoorbellStatusSchema,
32318
- /**
32319
- * 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.
32320
- *
32321
- * See `RuntimeStateDurability`. Enforced by
32322
- * `scripts/check-runtime-state-durability.ts`.
32323
- */
32324
- durability: "restored"
32325
- };
32326
- var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
32327
- DeviceType.Camera, DeviceType.Camera;
32328
- /** A slot's editable value, discriminated on `slot`. */
32329
- var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
32330
- /** Every device type at least one slot is offered on — `device-extension`'s `deviceTypes`. */
32331
- var EXTENSION_HOST_DEVICE_TYPES = [DeviceType.Camera];
32332
- var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
32333
- state: literal("unreachable"),
32334
- reason: string()
32335
- })]);
32336
- /** One provider of slots — the D554 source-listing row. */
32337
- var ExtensionSourceSchema = object({
32338
- /** The routing prefix of every `slotRef` this provider serves. */
32339
- source: string(),
32340
- label: string(),
32341
- /** Stamped by the dispatcher from the registry (D557). */
32342
- addonId: string().optional(),
32343
- availability: ExtensionSourceAvailabilitySchema
32344
- });
32345
- /**
32346
- * How one picked source stands. `missing` — no such device (deleted, or an id
32347
- * that never existed); `foreign` — a device the slot's owner cannot read from
32348
- * (a source owned by another addon); `unavailable` — it exists but is not a
32349
- * valid source now (a container, which is never a pick). A source in any of
32350
- * these states is SHOWN, never silently dropped or re-pointed.
32351
- */
32352
- var ExtensionSourceHealthSchema = _enum([
32353
- "ok",
32354
- "missing",
32355
- "foreign",
32356
- "unavailable"
32357
- ]);
32358
- var ExtensionSlotSourceSchema = object({
32359
- deviceId: number().int(),
32360
- /** The device's name, or null when it could not be resolved (`missing`). */
32361
- name: string().nullable(),
32362
- health: ExtensionSourceHealthSchema,
32363
- detail: string().optional()
32364
- });
32365
- /**
32366
- * A DIFFERENT authority that gates whether the slot's sources do anything —
32367
- * reported read-only, named, never written through this contract (D62). The
32368
- * virtual doorbell's sources ring only while the wrapper is bound to the
32369
- * camera, and that binding belongs to `deviceManager.setWrapperActive`.
32370
- * `unknown` means the gate could not be read; it is not "inactive" (D315).
32371
- */
32372
- var ExtensionSlotActivationSchema = object({
32373
- state: _enum([
32374
- "active",
32375
- "inactive",
32376
- "unknown"
32377
- ]),
32378
- authority: string(),
32379
- detail: string().optional()
32380
- });
32381
- var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
32382
- state: literal("ok"),
32383
- /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
32384
- slotRef: string(),
32385
- slot: ExtensionSlotIdSchema,
32386
- /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
32387
- authority: string(),
32388
- activation: ExtensionSlotActivationSchema.nullable(),
32389
- value: ExtensionSlotValueSchema,
32390
- sources: array(ExtensionSlotSourceSchema),
32391
- /**
32392
- * Devices the owner links to the host ON ITS OWN, by structure, and that
32393
- * are therefore not in `value` (D655): a camera's device-tree children, and
32394
- * the child a picked container stands for (D356 — a container is never a
32395
- * pick, its children are). Read-only; the editor shows them and may offer
32396
- * per-device options on them (the linked-devices tracked-event opt-in).
32397
- * Absent when the owner links nothing beyond the picks, and from an owner
32398
- * older than D655.
32399
- */
32400
- impliedSources: array(ExtensionSlotSourceSchema).optional()
32401
- }), object({
32402
- state: literal("unreachable"),
32403
- addonId: string(),
32404
- reason: string()
32405
- })]);
32406
- var ExtensionCandidatesSchema = object({ candidates: array(object({
32407
- deviceId: number().int(),
32408
- name: string(),
32409
- type: string(),
32410
- location: string().nullable(),
32411
- /** The container a child belongs to — "Spotlight 2" alone does not say which. */
32412
- parentName: string().nullable(),
32413
- /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
32414
- suggested: boolean(),
32415
- /** Why it is suggested ("same location"), null when it is not. */
32416
- reason: string().nullable()
32417
- })) });
32418
- /**
32419
- * What a write did. `none` — applied in place. `host` / `parent` — the owner
32420
- * reloaded the host (or, for an accessory child, its parent) because the
32421
- * write changed what the host REGISTERS. A slot never adds a capability to its
32422
- * host — that is a composition (D663) — so today's owners answer `none`.
32423
- */
32424
- var ExtensionSetResultSchema = object({
32425
- applied: literal(true),
32426
- reload: _enum([
32427
- "none",
32428
- "host",
32429
- "parent"
32430
- ])
32431
- });
32432
- var ExtensionSlotRefInputSchema = object({
32433
- deviceId: number().int(),
32434
- slotRef: string().min(1)
32435
- });
32436
- var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
32437
- var deviceExtensionCapability = {
32438
- name: "device-extension",
32439
- scope: "device",
32440
- mode: "collection",
32441
- kind: "wrapper",
32442
- defaultActive: true,
32443
- deviceTypes: EXTENSION_HOST_DEVICE_TYPES,
32444
- deviceConfig: { ui: {
32445
- kind: "widget",
32446
- widgetId: "host/extensions-panel",
32447
- tab: "general",
32448
- label: "Extensions",
32449
- order: 72
32450
- } },
32451
- methods: {
32452
- /** One row per slot owner — the D554 source listing `slotRef` routes by. */
32453
- listSources: method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)),
32454
- /**
32455
- * Every slot this device is offered, read by each owner from its own
32456
- * store. A provider that throws is ONE `unreachable` row (D554.4).
32457
- */
32458
- listSlots: method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)),
32459
- /** The devices the slot's editor may offer, suggestions pre-marked (D356). */
32460
- listCandidates: method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema),
32461
- /**
32462
- * Write one slot through its owner's EXISTING write path. The owner
32463
- * validates (a container is never a linked device, a camera is never its
32464
- * own source) and refuses by name before persisting.
32465
- */
32466
- setSlot: method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
32467
- kind: "mutation",
32468
- auth: "admin"
32469
- })
32470
- }
32471
- };
32472
- /**
32473
32602
  * Optional client-side hints sent at session creation to help the provider
32474
32603
  * pick the best native source. All fields optional — a viewer that knows
32475
32604
  * nothing still gets a sane default. (Relocated from the retired `webrtc`
@@ -46535,6 +46664,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
46535
46664
  coverCapability,
46536
46665
  customModelRegistryCapability,
46537
46666
  dataStoreProviderCapability,
46667
+ databaseSnapshotCapability,
46538
46668
  dayNightCapability,
46539
46669
  decoderCapability,
46540
46670
  detectionPipelineCapability,
@@ -47797,6 +47927,18 @@ Object.freeze({
47797
47927
  addonId: null,
47798
47928
  access: "view"
47799
47929
  },
47930
+ "databaseSnapshot.listDatabases": {
47931
+ capName: "database-snapshot",
47932
+ capScope: "system",
47933
+ addonId: null,
47934
+ access: "view"
47935
+ },
47936
+ "databaseSnapshot.writeSnapshot": {
47937
+ capName: "database-snapshot",
47938
+ capScope: "system",
47939
+ addonId: null,
47940
+ access: "create"
47941
+ },
47800
47942
  "dataStoreProvider.aggregate": {
47801
47943
  capName: "data-store-provider",
47802
47944
  capScope: "system",
@@ -56405,6 +56547,18 @@ var STATE_SUMMARY_VARS = [
56405
56547
  systemEventKinds: [...SUMMARISABLE],
56406
56548
  systemEventDeliveries: ["summary"]
56407
56549
  },
56550
+ {
56551
+ name: "summarySection",
56552
+ label: "Summary: this section",
56553
+ description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
56554
+ example: "Batterie scariche",
56555
+ group: "system",
56556
+ families: ["rule"],
56557
+ fields: [...RULE_TEXT],
56558
+ kinds: ["system"],
56559
+ systemEventKinds: [...SUMMARISABLE],
56560
+ systemEventDeliveries: ["summary"]
56561
+ },
56408
56562
  ...STATE_SUMMARY_SECTION_VARS.map((v) => ({
56409
56563
  name: v.name,
56410
56564
  label: v.label,