@camstack/addon-provider-homeassistant 1.2.149 → 1.2.150

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.
@@ -11790,6 +11790,68 @@ method(object({
11790
11790
  password: string()
11791
11791
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
11792
11792
  /**
11793
+ * How long one snapshot may take end to end: the pinned copy of the whole
11794
+ * database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
11795
+ * disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
11796
+ * generous because a timeout fails the whole backup run.
11797
+ */
11798
+ var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
11799
+ /**
11800
+ * The databases an owner snapshots — declared by the OWNER, so a caller never
11801
+ * guesses which file is live from what sits beside it (a cleanly closed
11802
+ * database has no sidecars and is just as owned). Paths are absolute on the
11803
+ * owner's host.
11804
+ */
11805
+ var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
11806
+ /** One b-tree table of the snapshot and the rows it holds. */
11807
+ var DatabaseSnapshotTableSchema = object({
11808
+ name: string(),
11809
+ rows: number().int().nonnegative()
11810
+ });
11811
+ /**
11812
+ * What the owner wrote. Every path is ABSOLUTE on the owner's host — the
11813
+ * caller pins the call to its own node, so it can read the file; a caller
11814
+ * that finds the path outside its own data root refuses it rather than
11815
+ * archiving something it cannot place.
11816
+ */
11817
+ var DatabaseSnapshotResultSchema = object({
11818
+ /** The live database the snapshot copies. Never to be copied as a file. */
11819
+ livePath: string(),
11820
+ /** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
11821
+ snapshotPath: string(),
11822
+ sizeBytes: number().int().nonnegative(),
11823
+ pageCount: number().int().nonnegative(),
11824
+ pageSize: number().int().positive(),
11825
+ /**
11826
+ * Every b-tree table with its row count. Read inside the SAME read
11827
+ * transaction the copy was taken from, and found EQUAL on the copy — so
11828
+ * this is the content of the snapshot, not an estimate of the source.
11829
+ */
11830
+ tables: array(DatabaseSnapshotTableSchema),
11831
+ /** Wall time of the pinned copy (row counts included). */
11832
+ copyMs: number().nonnegative(),
11833
+ /** Wall time of the checks on the copy (`integrity_check`, row counts). */
11834
+ verifyMs: number().nonnegative(),
11835
+ /** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
11836
+ takenAt: number()
11837
+ });
11838
+ /**
11839
+ * A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
11840
+ * the same facts, with both paths relative to the archive root (the node's
11841
+ * data dir), because an archive outlives the host that made it.
11842
+ */
11843
+ var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
11844
+ /** Archive-relative path of the live database the archive does NOT carry. */
11845
+ livePath: string(),
11846
+ /** Archive-relative path of the verified copy it carries in its place. */
11847
+ snapshotPath: string()
11848
+ });
11849
+ method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }), method(object({}), DatabaseSnapshotResultSchema, {
11850
+ kind: "mutation",
11851
+ auth: "admin",
11852
+ timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
11853
+ });
11854
+ /**
11793
11855
  * Orchestrator-side destination metadata. The orchestrator computes
11794
11856
  * `id = <addonId>:<subId>` from its provider lookup so consumers
11795
11857
  * (admin UI, restore flow) see one canonical key.
@@ -11900,7 +11962,12 @@ var ArchiveManifestSchema = object({
11900
11962
  locations: array(string()),
11901
11963
  entries: array(ArchiveEntrySchema),
11902
11964
  totalBytes: number(),
11903
- totalFiles: number()
11965
+ totalFiles: number(),
11966
+ /**
11967
+ * Live SQLite databases this archive carries as their OWNER's verified
11968
+ * snapshot instead of as files (D693). Absent on archives made before.
11969
+ */
11970
+ sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
11904
11971
  });
11905
11972
  var LocationStatSchema = object({
11906
11973
  name: string(),
@@ -13475,6 +13542,52 @@ var CompositionBlockStateSchema = object({
13475
13542
  reason: string().optional(),
13476
13543
  fields: array(CompositionFieldStateSchema)
13477
13544
  });
13545
+ var ComposerBlockSchema = object({
13546
+ id: string().min(1),
13547
+ name: string().min(1).max(120),
13548
+ enabled: boolean(),
13549
+ updatedAt: number(),
13550
+ composition: CompositionSchema
13551
+ });
13552
+ /**
13553
+ * A stored composition row that no longer PARSES — a schema a release
13554
+ * tightened, a row written by a newer build. Sent by id so the composer keeps
13555
+ * its device as a placeholder and reports the block `failed` naming the parse
13556
+ * error. Leaving it out would read, twice, exactly like a delete (D49).
13557
+ */
13558
+ var ComposerUnreadableBlockSchema = object({
13559
+ id: string().min(1),
13560
+ /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
13561
+ name: string().nullable(),
13562
+ /** The parse error, in the operator's words. */
13563
+ error: string()
13564
+ });
13565
+ method(object({
13566
+ /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
13567
+ integrationId: string().nullable(),
13568
+ /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
13569
+ storeLoaded: boolean(),
13570
+ blocks: array(ComposerBlockSchema),
13571
+ /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
13572
+ restartBlockIds: array(string()),
13573
+ /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
13574
+ unreadableBlocks: array(ComposerUnreadableBlockSchema)
13575
+ }), object({
13576
+ blocks: array(object({
13577
+ blockId: string(),
13578
+ status: CompositionRunStatusSchema,
13579
+ reason: string().optional()
13580
+ })),
13581
+ /**
13582
+ * False when the composer declared and withdrew NOTHING (store not loaded,
13583
+ * integration unknown, its own rows unread or read empty once). An empty
13584
+ * apply the caller owes is paid off only by one the composer acted on (D49).
13585
+ */
13586
+ acted: boolean()
13587
+ }), {
13588
+ kind: "mutation",
13589
+ auth: "admin"
13590
+ }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
13478
13591
  var NUMBER = {
13479
13592
  kind: "fixed",
13480
13593
  result: ["number"]
@@ -13711,52 +13824,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
13711
13824
  auth: "admin",
13712
13825
  access: "view"
13713
13826
  });
13714
- var ComposerBlockSchema = object({
13715
- id: string().min(1),
13716
- name: string().min(1).max(120),
13717
- enabled: boolean(),
13718
- updatedAt: number(),
13719
- composition: CompositionSchema
13720
- });
13721
- /**
13722
- * A stored composition row that no longer PARSES — a schema a release
13723
- * tightened, a row written by a newer build. Sent by id so the composer keeps
13724
- * its device as a placeholder and reports the block `failed` naming the parse
13725
- * error. Leaving it out would read, twice, exactly like a delete (D49).
13726
- */
13727
- var ComposerUnreadableBlockSchema = object({
13728
- id: string().min(1),
13729
- /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
13730
- name: string().nullable(),
13731
- /** The parse error, in the operator's words. */
13732
- error: string()
13733
- });
13734
- method(object({
13735
- /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
13736
- integrationId: string().nullable(),
13737
- /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
13738
- storeLoaded: boolean(),
13739
- blocks: array(ComposerBlockSchema),
13740
- /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
13741
- restartBlockIds: array(string()),
13742
- /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
13743
- unreadableBlocks: array(ComposerUnreadableBlockSchema)
13744
- }), object({
13745
- blocks: array(object({
13746
- blockId: string(),
13747
- status: CompositionRunStatusSchema,
13748
- reason: string().optional()
13749
- })),
13750
- /**
13751
- * False when the composer declared and withdrew NOTHING (store not loaded,
13752
- * integration unknown, its own rows unread or read empty once). An empty
13753
- * apply the caller owes is paid off only by one the composer acted on (D49).
13754
- */
13755
- acted: boolean()
13756
- }), {
13757
- kind: "mutation",
13758
- auth: "admin"
13759
- }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
13760
13827
  /**
13761
13828
  * `custom-model-registry` — collection cap exposing operator-registered
13762
13829
  * custom detection models. Each provider (today: `addon-model-studio`)
@@ -16028,6 +16095,219 @@ method(object({
16028
16095
  caps: array(string()).readonly().optional()
16029
16096
  }), record(string(), record(string(), unknown().nullable())));
16030
16097
  /**
16098
+ * Doorbell button cap. Two kinds of providers coexist behind this cap
16099
+ * name (same pattern as `snapshot`):
16100
+ *
16101
+ * - **Native** providers: registered per-device by device-driver
16102
+ * addons via `ctx.registerNativeCap` — either on a
16103
+ * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
16104
+ * or directly on the camera (Reolink registers at camera level).
16105
+ * Emits an `onPressed` event every time the firmware pushes a
16106
+ * ring; status tracks the last press and a pressCount since start
16107
+ * (diagnostic).
16108
+ *
16109
+ * - **Wrapper** provider: the `virtual-doorbell` system builtin
16110
+ * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
16111
+ * device (contact / switch / event-emitter …) into a doorbell for
16112
+ * a camera. `defaultActive: false` — the operator explicitly binds
16113
+ * it per camera in the device-bindings UI, then picks the source
16114
+ * device + trigger in the per-device settings.
16115
+ *
16116
+ * The DeviceEventPropagator re-emits `onPressed` on the camera parent
16117
+ * — subscribers listening at the camera level receive ring events
16118
+ * with `via[]` populated. No code on the parent needed.
16119
+ */
16120
+ var DoorbellStatusSchema = object({
16121
+ /** Ms epoch of the last press. null = never observed since this provider started. */
16122
+ lastPressedAt: number().nullable(),
16123
+ /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
16124
+ pressCountSinceStart: number()
16125
+ });
16126
+ var DoorbellPressEventSchema = object({
16127
+ deviceId: number(),
16128
+ timestamp: number()
16129
+ });
16130
+ /**
16131
+ * The `doorbell-source` extension slot's editable value (D648): the camera's
16132
+ * virtual-doorbell trigger devices, exactly what the wrapper's
16133
+ * `doorbellSources` persists (as `{ deviceId }` records).
16134
+ */
16135
+ var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
16136
+ /**
16137
+ * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
16138
+ * doorbell, owned by the `virtual-doorbell` wrapper over its
16139
+ * `doorbellSources` store (D648). A source rings when one of its
16140
+ * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
16141
+ * different authority (`deviceManager.setWrapperActive`, D62) — the slot
16142
+ * reports it, it never writes it.
16143
+ */
16144
+ var DOORBELL_SOURCE_SLOT = {
16145
+ id: "doorbell-source",
16146
+ label: "Doorbell trigger devices",
16147
+ 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.",
16148
+ shape: "association",
16149
+ hostDeviceTypes: [DeviceType.Camera],
16150
+ sourceCaps: SOURCE_CAPS,
16151
+ cardinality: "many",
16152
+ value: DoorbellSourceSlotValueSchema
16153
+ };
16154
+ var doorbellCapability = {
16155
+ name: "doorbell",
16156
+ scope: "device",
16157
+ deviceNative: true,
16158
+ mode: "singleton",
16159
+ kind: "wrapper",
16160
+ defaultActive: false,
16161
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
16162
+ extensionSlots: [DOORBELL_SOURCE_SLOT],
16163
+ methods: {},
16164
+ events: {
16165
+ /**
16166
+ * Fires once per physical press. Reolink delivers via Baichuan
16167
+ * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
16168
+ * release/duration — it's a pulse.
16169
+ */
16170
+ onPressed: {
16171
+ data: DoorbellPressEventSchema,
16172
+ fromState: {
16173
+ field: "lastPressedAt",
16174
+ on: "advance"
16175
+ }
16176
+ } },
16177
+ status: {
16178
+ schema: DoorbellStatusSchema,
16179
+ kind: "push"
16180
+ },
16181
+ /**
16182
+ * Runtime-state slice — last press timestamp + lifetime press count.
16183
+ * Mirrored by the kernel and readable via
16184
+ * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
16185
+ * without subscribing.
16186
+ */
16187
+ runtimeState: DoorbellStatusSchema,
16188
+ /**
16189
+ * 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.
16190
+ *
16191
+ * See `RuntimeStateDurability`. Enforced by
16192
+ * `scripts/check-runtime-state-durability.ts`.
16193
+ */
16194
+ durability: "restored"
16195
+ };
16196
+ var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
16197
+ DeviceType.Camera, DeviceType.Camera;
16198
+ /** A slot's editable value, discriminated on `slot`. */
16199
+ var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
16200
+ DeviceType.Camera;
16201
+ var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
16202
+ state: literal("unreachable"),
16203
+ reason: string()
16204
+ })]);
16205
+ /** One provider of slots — the D554 source-listing row. */
16206
+ var ExtensionSourceSchema = object({
16207
+ /** The routing prefix of every `slotRef` this provider serves. */
16208
+ source: string(),
16209
+ label: string(),
16210
+ /** Stamped by the dispatcher from the registry (D557). */
16211
+ addonId: string().optional(),
16212
+ availability: ExtensionSourceAvailabilitySchema
16213
+ });
16214
+ /**
16215
+ * How one picked source stands. `missing` — no such device (deleted, or an id
16216
+ * that never existed); `foreign` — a device the slot's owner cannot read from
16217
+ * (a source owned by another addon); `unavailable` — it exists but is not a
16218
+ * valid source now (a container, which is never a pick). A source in any of
16219
+ * these states is SHOWN, never silently dropped or re-pointed.
16220
+ */
16221
+ var ExtensionSourceHealthSchema = _enum([
16222
+ "ok",
16223
+ "missing",
16224
+ "foreign",
16225
+ "unavailable"
16226
+ ]);
16227
+ var ExtensionSlotSourceSchema = object({
16228
+ deviceId: number().int(),
16229
+ /** The device's name, or null when it could not be resolved (`missing`). */
16230
+ name: string().nullable(),
16231
+ health: ExtensionSourceHealthSchema,
16232
+ detail: string().optional()
16233
+ });
16234
+ /**
16235
+ * A DIFFERENT authority that gates whether the slot's sources do anything —
16236
+ * reported read-only, named, never written through this contract (D62). The
16237
+ * virtual doorbell's sources ring only while the wrapper is bound to the
16238
+ * camera, and that binding belongs to `deviceManager.setWrapperActive`.
16239
+ * `unknown` means the gate could not be read; it is not "inactive" (D315).
16240
+ */
16241
+ var ExtensionSlotActivationSchema = object({
16242
+ state: _enum([
16243
+ "active",
16244
+ "inactive",
16245
+ "unknown"
16246
+ ]),
16247
+ authority: string(),
16248
+ detail: string().optional()
16249
+ });
16250
+ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
16251
+ state: literal("ok"),
16252
+ /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
16253
+ slotRef: string(),
16254
+ slot: ExtensionSlotIdSchema,
16255
+ /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
16256
+ authority: string(),
16257
+ activation: ExtensionSlotActivationSchema.nullable(),
16258
+ value: ExtensionSlotValueSchema,
16259
+ sources: array(ExtensionSlotSourceSchema),
16260
+ /**
16261
+ * Devices the owner links to the host ON ITS OWN, by structure, and that
16262
+ * are therefore not in `value` (D655): a camera's device-tree children, and
16263
+ * the child a picked container stands for (D356 — a container is never a
16264
+ * pick, its children are). Read-only; the editor shows them and may offer
16265
+ * per-device options on them (the linked-devices tracked-event opt-in).
16266
+ * Absent when the owner links nothing beyond the picks, and from an owner
16267
+ * older than D655.
16268
+ */
16269
+ impliedSources: array(ExtensionSlotSourceSchema).optional()
16270
+ }), object({
16271
+ state: literal("unreachable"),
16272
+ addonId: string(),
16273
+ reason: string()
16274
+ })]);
16275
+ var ExtensionCandidatesSchema = object({ candidates: array(object({
16276
+ deviceId: number().int(),
16277
+ name: string(),
16278
+ type: string(),
16279
+ location: string().nullable(),
16280
+ /** The container a child belongs to — "Spotlight 2" alone does not say which. */
16281
+ parentName: string().nullable(),
16282
+ /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
16283
+ suggested: boolean(),
16284
+ /** Why it is suggested ("same location"), null when it is not. */
16285
+ reason: string().nullable()
16286
+ })) });
16287
+ /**
16288
+ * What a write did. `none` — applied in place. `host` / `parent` — the owner
16289
+ * reloaded the host (or, for an accessory child, its parent) because the
16290
+ * write changed what the host REGISTERS. A slot never adds a capability to its
16291
+ * host — that is a composition (D663) — so today's owners answer `none`.
16292
+ */
16293
+ var ExtensionSetResultSchema = object({
16294
+ applied: literal(true),
16295
+ reload: _enum([
16296
+ "none",
16297
+ "host",
16298
+ "parent"
16299
+ ])
16300
+ });
16301
+ var ExtensionSlotRefInputSchema = object({
16302
+ deviceId: number().int(),
16303
+ slotRef: string().min(1)
16304
+ });
16305
+ var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
16306
+ method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
16307
+ kind: "mutation",
16308
+ auth: "admin"
16309
+ });
16310
+ /**
16031
16311
  * Per-field ownership (D663). A composition may CLAIM fields of a native
16032
16312
  * cap's runtime-state slice on an existing device: `replace` overlays the
16033
16313
  * claimed fields on the native slice, `add` builds a slice the device does
@@ -19051,17 +19331,25 @@ var NcScheduleSchema = object({
19051
19331
  */
19052
19332
  var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
19053
19333
  /**
19334
+ * How a summary window is SENT (D698): `rule` (absent) = ONE notification with
19335
+ * every section; `section` = one notification per section with something to
19336
+ * say (an unavailable section included), each titled by its section.
19337
+ */
19338
+ var NcStateSummarySplitSchema = _enum(["rule", "section"]);
19339
+ /**
19054
19340
  * `summary`: the rule sends NOTHING per event. When a window of `schedule`
19055
19341
  * CLOSES, it sends one notification with the current state of its kinds
19056
19342
  * (low batteries, consumables to replace, devices offline, updates
19057
- * available, ...), after its own filters. Nothing to report sends nothing.
19343
+ * available, ...), after its own filters — or, with `split: 'section'`
19344
+ * (D698), one notification per section. Nothing to report sends nothing.
19058
19345
  * The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
19059
19346
  * midnight crossing); the send time is each window's END. Refused on the
19060
19347
  * `alarm` family, which stays instant (`systemEventDeliveryProblems`).
19061
19348
  */
19062
19349
  var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
19063
19350
  mode: literal("summary"),
19064
- schedule: NcScheduleSchema
19351
+ schedule: NcScheduleSchema,
19352
+ split: NcStateSummarySplitSchema.optional()
19065
19353
  })]);
19066
19354
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
19067
19355
  var NcPlateMatcherSchema = object({
@@ -19712,10 +20000,12 @@ var NcMediaPolicySchema = object({
19712
20000
  /**
19713
20001
  * Cooldown GRANULARITY over the subject's class — how much a fired
19714
20002
  * notification suppresses.
19715
- * - `shared` (default, and the absent value) — one window for the whole
19716
- * rule/scope: a cat silences the next dog for `cooldownSec`.
19717
- * - `per-class` — an independent window per detected class, so cat→dog fires
19718
- * at once and cat→cat still waits.
20003
+ * - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
20004
+ * independent window per detected class: cat→dog fires at once, cat→cat
20005
+ * still waits.
20006
+ * - `shared` — one window for the whole rule/scope: a cat silences the next
20007
+ * dog for `cooldownSec`. Only written when an operator picks it; it is no
20008
+ * longer what an unset rule means.
19719
20009
  *
19720
20010
  * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
19721
20011
  * must not be swallowed by a bark's window (the precedent this generalizes —
@@ -19730,8 +20020,11 @@ var NcThrottleSchema = object({
19730
20020
  /**
19731
20021
  * Class granularity of the cooldown key. Optional rather than defaulted:
19732
20022
  * a Zod default does NOT run on the addon→addon cap path, so a persisted
19733
- * rule authored before this field simply carries none — and the engine
19734
- * reads absent as `shared`, the pre-existing behaviour.
20023
+ * rule authored before this field simply carries none. The engine used to
20024
+ * read absent as `shared` (D36); since 2026-10-01 it reads absent as
20025
+ * `per-class` — the operator's default — and only an explicit `shared`
20026
+ * still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
20027
+ * engine, and D36's dated note.
19735
20028
  */
19736
20029
  granularity: NcThrottleGranularitySchema.optional()
19737
20030
  });
@@ -20055,11 +20348,23 @@ var NcStateSummaryPreviewSectionSchema = object({
20055
20348
  reason: string().optional()
20056
20349
  });
20057
20350
  /**
20351
+ * One notification a previewed summary would send (D698): the whole summary on
20352
+ * a `rule` split (no `section`), one section's on a `section` split.
20353
+ */
20354
+ var NcStateSummaryPreviewRowSchema = object({
20355
+ section: string().optional(),
20356
+ /** The section's name on a per-section row; every reported section's, joined, on a combined one. */
20357
+ title: string(),
20358
+ text: string(),
20359
+ count: number().int().nonnegative()
20360
+ });
20361
+ /**
20058
20362
  * The summary a rule would send now. `empty` = nothing to report and every
20059
20363
  * section read: such a summary is NOT sent. `dropped` counts the open states
20060
20364
  * the rule's own filters (or a camera mute) left out, by reason.
20061
20365
  * `excludedGroups` names the kind groups selected that have no state to report
20062
- * (backups & exports).
20366
+ * (backups & exports). `split` and `rows` (D698) say how it would be sent —
20367
+ * optional, so an older hub's answer still parses.
20063
20368
  */
20064
20369
  var NcStateSummaryPreviewSchema = object({
20065
20370
  empty: boolean(),
@@ -20067,7 +20372,9 @@ var NcStateSummaryPreviewSchema = object({
20067
20372
  text: string(),
20068
20373
  sections: array(NcStateSummaryPreviewSectionSchema),
20069
20374
  dropped: record(string(), number().int().nonnegative()),
20070
- excludedGroups: array(string())
20375
+ excludedGroups: array(string()),
20376
+ split: NcStateSummarySplitSchema.optional(),
20377
+ rows: array(NcStateSummaryPreviewRowSchema).optional()
20071
20378
  });
20072
20379
  var NcTestResultSchema = object({
20073
20380
  recordId: string(),
@@ -27632,219 +27939,6 @@ DeviceType.Camera, method(object({
27632
27939
  auth: "protected"
27633
27940
  });
27634
27941
  /**
27635
- * Doorbell button cap. Two kinds of providers coexist behind this cap
27636
- * name (same pattern as `snapshot`):
27637
- *
27638
- * - **Native** providers: registered per-device by device-driver
27639
- * addons via `ctx.registerNativeCap` — either on a
27640
- * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
27641
- * or directly on the camera (Reolink registers at camera level).
27642
- * Emits an `onPressed` event every time the firmware pushes a
27643
- * ring; status tracks the last press and a pressCount since start
27644
- * (diagnostic).
27645
- *
27646
- * - **Wrapper** provider: the `virtual-doorbell` system builtin
27647
- * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
27648
- * device (contact / switch / event-emitter …) into a doorbell for
27649
- * a camera. `defaultActive: false` — the operator explicitly binds
27650
- * it per camera in the device-bindings UI, then picks the source
27651
- * device + trigger in the per-device settings.
27652
- *
27653
- * The DeviceEventPropagator re-emits `onPressed` on the camera parent
27654
- * — subscribers listening at the camera level receive ring events
27655
- * with `via[]` populated. No code on the parent needed.
27656
- */
27657
- var DoorbellStatusSchema = object({
27658
- /** Ms epoch of the last press. null = never observed since this provider started. */
27659
- lastPressedAt: number().nullable(),
27660
- /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
27661
- pressCountSinceStart: number()
27662
- });
27663
- var DoorbellPressEventSchema = object({
27664
- deviceId: number(),
27665
- timestamp: number()
27666
- });
27667
- /**
27668
- * The `doorbell-source` extension slot's editable value (D648): the camera's
27669
- * virtual-doorbell trigger devices, exactly what the wrapper's
27670
- * `doorbellSources` persists (as `{ deviceId }` records).
27671
- */
27672
- var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
27673
- /**
27674
- * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
27675
- * doorbell, owned by the `virtual-doorbell` wrapper over its
27676
- * `doorbellSources` store (D648). A source rings when one of its
27677
- * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
27678
- * different authority (`deviceManager.setWrapperActive`, D62) — the slot
27679
- * reports it, it never writes it.
27680
- */
27681
- var DOORBELL_SOURCE_SLOT = {
27682
- id: "doorbell-source",
27683
- label: "Doorbell trigger devices",
27684
- 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.",
27685
- shape: "association",
27686
- hostDeviceTypes: [DeviceType.Camera],
27687
- sourceCaps: SOURCE_CAPS,
27688
- cardinality: "many",
27689
- value: DoorbellSourceSlotValueSchema
27690
- };
27691
- var doorbellCapability = {
27692
- name: "doorbell",
27693
- scope: "device",
27694
- deviceNative: true,
27695
- mode: "singleton",
27696
- kind: "wrapper",
27697
- defaultActive: false,
27698
- deviceTypes: [DeviceType.Button, DeviceType.Camera],
27699
- extensionSlots: [DOORBELL_SOURCE_SLOT],
27700
- methods: {},
27701
- events: {
27702
- /**
27703
- * Fires once per physical press. Reolink delivers via Baichuan
27704
- * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
27705
- * release/duration — it's a pulse.
27706
- */
27707
- onPressed: {
27708
- data: DoorbellPressEventSchema,
27709
- fromState: {
27710
- field: "lastPressedAt",
27711
- on: "advance"
27712
- }
27713
- } },
27714
- status: {
27715
- schema: DoorbellStatusSchema,
27716
- kind: "push"
27717
- },
27718
- /**
27719
- * Runtime-state slice — last press timestamp + lifetime press count.
27720
- * Mirrored by the kernel and readable via
27721
- * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
27722
- * without subscribing.
27723
- */
27724
- runtimeState: DoorbellStatusSchema,
27725
- /**
27726
- * 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.
27727
- *
27728
- * See `RuntimeStateDurability`. Enforced by
27729
- * `scripts/check-runtime-state-durability.ts`.
27730
- */
27731
- durability: "restored"
27732
- };
27733
- var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
27734
- DeviceType.Camera, DeviceType.Camera;
27735
- /** A slot's editable value, discriminated on `slot`. */
27736
- var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
27737
- DeviceType.Camera;
27738
- var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
27739
- state: literal("unreachable"),
27740
- reason: string()
27741
- })]);
27742
- /** One provider of slots — the D554 source-listing row. */
27743
- var ExtensionSourceSchema = object({
27744
- /** The routing prefix of every `slotRef` this provider serves. */
27745
- source: string(),
27746
- label: string(),
27747
- /** Stamped by the dispatcher from the registry (D557). */
27748
- addonId: string().optional(),
27749
- availability: ExtensionSourceAvailabilitySchema
27750
- });
27751
- /**
27752
- * How one picked source stands. `missing` — no such device (deleted, or an id
27753
- * that never existed); `foreign` — a device the slot's owner cannot read from
27754
- * (a source owned by another addon); `unavailable` — it exists but is not a
27755
- * valid source now (a container, which is never a pick). A source in any of
27756
- * these states is SHOWN, never silently dropped or re-pointed.
27757
- */
27758
- var ExtensionSourceHealthSchema = _enum([
27759
- "ok",
27760
- "missing",
27761
- "foreign",
27762
- "unavailable"
27763
- ]);
27764
- var ExtensionSlotSourceSchema = object({
27765
- deviceId: number().int(),
27766
- /** The device's name, or null when it could not be resolved (`missing`). */
27767
- name: string().nullable(),
27768
- health: ExtensionSourceHealthSchema,
27769
- detail: string().optional()
27770
- });
27771
- /**
27772
- * A DIFFERENT authority that gates whether the slot's sources do anything —
27773
- * reported read-only, named, never written through this contract (D62). The
27774
- * virtual doorbell's sources ring only while the wrapper is bound to the
27775
- * camera, and that binding belongs to `deviceManager.setWrapperActive`.
27776
- * `unknown` means the gate could not be read; it is not "inactive" (D315).
27777
- */
27778
- var ExtensionSlotActivationSchema = object({
27779
- state: _enum([
27780
- "active",
27781
- "inactive",
27782
- "unknown"
27783
- ]),
27784
- authority: string(),
27785
- detail: string().optional()
27786
- });
27787
- var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
27788
- state: literal("ok"),
27789
- /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
27790
- slotRef: string(),
27791
- slot: ExtensionSlotIdSchema,
27792
- /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
27793
- authority: string(),
27794
- activation: ExtensionSlotActivationSchema.nullable(),
27795
- value: ExtensionSlotValueSchema,
27796
- sources: array(ExtensionSlotSourceSchema),
27797
- /**
27798
- * Devices the owner links to the host ON ITS OWN, by structure, and that
27799
- * are therefore not in `value` (D655): a camera's device-tree children, and
27800
- * the child a picked container stands for (D356 — a container is never a
27801
- * pick, its children are). Read-only; the editor shows them and may offer
27802
- * per-device options on them (the linked-devices tracked-event opt-in).
27803
- * Absent when the owner links nothing beyond the picks, and from an owner
27804
- * older than D655.
27805
- */
27806
- impliedSources: array(ExtensionSlotSourceSchema).optional()
27807
- }), object({
27808
- state: literal("unreachable"),
27809
- addonId: string(),
27810
- reason: string()
27811
- })]);
27812
- var ExtensionCandidatesSchema = object({ candidates: array(object({
27813
- deviceId: number().int(),
27814
- name: string(),
27815
- type: string(),
27816
- location: string().nullable(),
27817
- /** The container a child belongs to — "Spotlight 2" alone does not say which. */
27818
- parentName: string().nullable(),
27819
- /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
27820
- suggested: boolean(),
27821
- /** Why it is suggested ("same location"), null when it is not. */
27822
- reason: string().nullable()
27823
- })) });
27824
- /**
27825
- * What a write did. `none` — applied in place. `host` / `parent` — the owner
27826
- * reloaded the host (or, for an accessory child, its parent) because the
27827
- * write changed what the host REGISTERS. A slot never adds a capability to its
27828
- * host — that is a composition (D663) — so today's owners answer `none`.
27829
- */
27830
- var ExtensionSetResultSchema = object({
27831
- applied: literal(true),
27832
- reload: _enum([
27833
- "none",
27834
- "host",
27835
- "parent"
27836
- ])
27837
- });
27838
- var ExtensionSlotRefInputSchema = object({
27839
- deviceId: number().int(),
27840
- slotRef: string().min(1)
27841
- });
27842
- var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
27843
- method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
27844
- kind: "mutation",
27845
- auth: "admin"
27846
- });
27847
- /**
27848
27942
  * Optional client-side hints sent at session creation to help the provider
27849
27943
  * pick the best native source. All fields optional — a viewer that knows
27850
27944
  * nothing still gets a sane default. (Relocated from the retired `webrtc`
@@ -43128,6 +43222,18 @@ Object.freeze({
43128
43222
  addonId: null,
43129
43223
  access: "view"
43130
43224
  },
43225
+ "databaseSnapshot.listDatabases": {
43226
+ capName: "database-snapshot",
43227
+ capScope: "system",
43228
+ addonId: null,
43229
+ access: "view"
43230
+ },
43231
+ "databaseSnapshot.writeSnapshot": {
43232
+ capName: "database-snapshot",
43233
+ capScope: "system",
43234
+ addonId: null,
43235
+ access: "create"
43236
+ },
43131
43237
  "dataStoreProvider.aggregate": {
43132
43238
  capName: "data-store-provider",
43133
43239
  capScope: "system",
@@ -51863,6 +51969,18 @@ var STATE_SUMMARY_VARS = [
51863
51969
  systemEventKinds: [...SUMMARISABLE],
51864
51970
  systemEventDeliveries: ["summary"]
51865
51971
  },
51972
+ {
51973
+ name: "summarySection",
51974
+ label: "Summary: this section",
51975
+ description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
51976
+ example: "Batterie scariche",
51977
+ group: "system",
51978
+ families: ["rule"],
51979
+ fields: [...RULE_TEXT],
51980
+ kinds: ["system"],
51981
+ systemEventKinds: [...SUMMARISABLE],
51982
+ systemEventDeliveries: ["summary"]
51983
+ },
51866
51984
  ...STATE_SUMMARY_SECTION_VARS.map((v) => ({
51867
51985
  name: v.name,
51868
51986
  label: v.label,