@camstack/addon-provider-rtsp 1.2.116 → 1.2.117

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 (3) hide show
  1. package/dist/addon.js +476 -274
  2. package/dist/addon.mjs +476 -274
  3. package/package.json +2 -2
package/dist/addon.js CHANGED
@@ -11624,6 +11624,68 @@ method(object({
11624
11624
  password: string()
11625
11625
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
11626
11626
  /**
11627
+ * How long one snapshot may take end to end: the pinned copy of the whole
11628
+ * database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
11629
+ * disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
11630
+ * generous because a timeout fails the whole backup run.
11631
+ */
11632
+ var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
11633
+ /**
11634
+ * The databases an owner snapshots — declared by the OWNER, so a caller never
11635
+ * guesses which file is live from what sits beside it (a cleanly closed
11636
+ * database has no sidecars and is just as owned). Paths are absolute on the
11637
+ * owner's host.
11638
+ */
11639
+ var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
11640
+ /** One b-tree table of the snapshot and the rows it holds. */
11641
+ var DatabaseSnapshotTableSchema = object({
11642
+ name: string(),
11643
+ rows: number().int().nonnegative()
11644
+ });
11645
+ /**
11646
+ * What the owner wrote. Every path is ABSOLUTE on the owner's host — the
11647
+ * caller pins the call to its own node, so it can read the file; a caller
11648
+ * that finds the path outside its own data root refuses it rather than
11649
+ * archiving something it cannot place.
11650
+ */
11651
+ var DatabaseSnapshotResultSchema = object({
11652
+ /** The live database the snapshot copies. Never to be copied as a file. */
11653
+ livePath: string(),
11654
+ /** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
11655
+ snapshotPath: string(),
11656
+ sizeBytes: number().int().nonnegative(),
11657
+ pageCount: number().int().nonnegative(),
11658
+ pageSize: number().int().positive(),
11659
+ /**
11660
+ * Every b-tree table with its row count. Read inside the SAME read
11661
+ * transaction the copy was taken from, and found EQUAL on the copy — so
11662
+ * this is the content of the snapshot, not an estimate of the source.
11663
+ */
11664
+ tables: array(DatabaseSnapshotTableSchema),
11665
+ /** Wall time of the pinned copy (row counts included). */
11666
+ copyMs: number().nonnegative(),
11667
+ /** Wall time of the checks on the copy (`integrity_check`, row counts). */
11668
+ verifyMs: number().nonnegative(),
11669
+ /** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
11670
+ takenAt: number()
11671
+ });
11672
+ /**
11673
+ * A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
11674
+ * the same facts, with both paths relative to the archive root (the node's
11675
+ * data dir), because an archive outlives the host that made it.
11676
+ */
11677
+ var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
11678
+ /** Archive-relative path of the live database the archive does NOT carry. */
11679
+ livePath: string(),
11680
+ /** Archive-relative path of the verified copy it carries in its place. */
11681
+ snapshotPath: string()
11682
+ });
11683
+ method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }), method(object({}), DatabaseSnapshotResultSchema, {
11684
+ kind: "mutation",
11685
+ auth: "admin",
11686
+ timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
11687
+ });
11688
+ /**
11627
11689
  * Orchestrator-side destination metadata. The orchestrator computes
11628
11690
  * `id = <addonId>:<subId>` from its provider lookup so consumers
11629
11691
  * (admin UI, restore flow) see one canonical key.
@@ -11734,7 +11796,12 @@ var ArchiveManifestSchema = object({
11734
11796
  locations: array(string()),
11735
11797
  entries: array(ArchiveEntrySchema),
11736
11798
  totalBytes: number(),
11737
- totalFiles: number()
11799
+ totalFiles: number(),
11800
+ /**
11801
+ * Live SQLite databases this archive carries as their OWNER's verified
11802
+ * snapshot instead of as files (D693). Absent on archives made before.
11803
+ */
11804
+ sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
11738
11805
  });
11739
11806
  var LocationStatSchema = object({
11740
11807
  name: string(),
@@ -13260,6 +13327,52 @@ var CompositionBlockStateSchema = object({
13260
13327
  reason: string().optional(),
13261
13328
  fields: array(CompositionFieldStateSchema)
13262
13329
  });
13330
+ var ComposerBlockSchema = object({
13331
+ id: string().min(1),
13332
+ name: string().min(1).max(120),
13333
+ enabled: boolean(),
13334
+ updatedAt: number(),
13335
+ composition: CompositionSchema
13336
+ });
13337
+ /**
13338
+ * A stored composition row that no longer PARSES — a schema a release
13339
+ * tightened, a row written by a newer build. Sent by id so the composer keeps
13340
+ * its device as a placeholder and reports the block `failed` naming the parse
13341
+ * error. Leaving it out would read, twice, exactly like a delete (D49).
13342
+ */
13343
+ var ComposerUnreadableBlockSchema = object({
13344
+ id: string().min(1),
13345
+ /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
13346
+ name: string().nullable(),
13347
+ /** The parse error, in the operator's words. */
13348
+ error: string()
13349
+ });
13350
+ method(object({
13351
+ /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
13352
+ integrationId: string().nullable(),
13353
+ /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
13354
+ storeLoaded: boolean(),
13355
+ blocks: array(ComposerBlockSchema),
13356
+ /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
13357
+ restartBlockIds: array(string()),
13358
+ /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
13359
+ unreadableBlocks: array(ComposerUnreadableBlockSchema)
13360
+ }), object({
13361
+ blocks: array(object({
13362
+ blockId: string(),
13363
+ status: CompositionRunStatusSchema,
13364
+ reason: string().optional()
13365
+ })),
13366
+ /**
13367
+ * False when the composer declared and withdrew NOTHING (store not loaded,
13368
+ * integration unknown, its own rows unread or read empty once). An empty
13369
+ * apply the caller owes is paid off only by one the composer acted on (D49).
13370
+ */
13371
+ acted: boolean()
13372
+ }), {
13373
+ kind: "mutation",
13374
+ auth: "admin"
13375
+ }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
13263
13376
  var NUMBER = {
13264
13377
  kind: "fixed",
13265
13378
  result: ["number"]
@@ -13496,52 +13609,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
13496
13609
  auth: "admin",
13497
13610
  access: "view"
13498
13611
  });
13499
- var ComposerBlockSchema = object({
13500
- id: string().min(1),
13501
- name: string().min(1).max(120),
13502
- enabled: boolean(),
13503
- updatedAt: number(),
13504
- composition: CompositionSchema
13505
- });
13506
- /**
13507
- * A stored composition row that no longer PARSES — a schema a release
13508
- * tightened, a row written by a newer build. Sent by id so the composer keeps
13509
- * its device as a placeholder and reports the block `failed` naming the parse
13510
- * error. Leaving it out would read, twice, exactly like a delete (D49).
13511
- */
13512
- var ComposerUnreadableBlockSchema = object({
13513
- id: string().min(1),
13514
- /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
13515
- name: string().nullable(),
13516
- /** The parse error, in the operator's words. */
13517
- error: string()
13518
- });
13519
- method(object({
13520
- /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
13521
- integrationId: string().nullable(),
13522
- /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
13523
- storeLoaded: boolean(),
13524
- blocks: array(ComposerBlockSchema),
13525
- /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
13526
- restartBlockIds: array(string()),
13527
- /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
13528
- unreadableBlocks: array(ComposerUnreadableBlockSchema)
13529
- }), object({
13530
- blocks: array(object({
13531
- blockId: string(),
13532
- status: CompositionRunStatusSchema,
13533
- reason: string().optional()
13534
- })),
13535
- /**
13536
- * False when the composer declared and withdrew NOTHING (store not loaded,
13537
- * integration unknown, its own rows unread or read empty once). An empty
13538
- * apply the caller owes is paid off only by one the composer acted on (D49).
13539
- */
13540
- acted: boolean()
13541
- }), {
13542
- kind: "mutation",
13543
- auth: "admin"
13544
- }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
13545
13612
  /**
13546
13613
  * `custom-model-registry` — collection cap exposing operator-registered
13547
13614
  * custom detection models. Each provider (today: `addon-model-studio`)
@@ -15579,6 +15646,219 @@ method(object({
15579
15646
  caps: array(string()).readonly().optional()
15580
15647
  }), record(string(), record(string(), unknown().nullable())));
15581
15648
  /**
15649
+ * Doorbell button cap. Two kinds of providers coexist behind this cap
15650
+ * name (same pattern as `snapshot`):
15651
+ *
15652
+ * - **Native** providers: registered per-device by device-driver
15653
+ * addons via `ctx.registerNativeCap` — either on a
15654
+ * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
15655
+ * or directly on the camera (Reolink registers at camera level).
15656
+ * Emits an `onPressed` event every time the firmware pushes a
15657
+ * ring; status tracks the last press and a pressCount since start
15658
+ * (diagnostic).
15659
+ *
15660
+ * - **Wrapper** provider: the `virtual-doorbell` system builtin
15661
+ * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
15662
+ * device (contact / switch / event-emitter …) into a doorbell for
15663
+ * a camera. `defaultActive: false` — the operator explicitly binds
15664
+ * it per camera in the device-bindings UI, then picks the source
15665
+ * device + trigger in the per-device settings.
15666
+ *
15667
+ * The DeviceEventPropagator re-emits `onPressed` on the camera parent
15668
+ * — subscribers listening at the camera level receive ring events
15669
+ * with `via[]` populated. No code on the parent needed.
15670
+ */
15671
+ var DoorbellStatusSchema = object({
15672
+ /** Ms epoch of the last press. null = never observed since this provider started. */
15673
+ lastPressedAt: number().nullable(),
15674
+ /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
15675
+ pressCountSinceStart: number()
15676
+ });
15677
+ var DoorbellPressEventSchema = object({
15678
+ deviceId: number(),
15679
+ timestamp: number()
15680
+ });
15681
+ /**
15682
+ * The `doorbell-source` extension slot's editable value (D648): the camera's
15683
+ * virtual-doorbell trigger devices, exactly what the wrapper's
15684
+ * `doorbellSources` persists (as `{ deviceId }` records).
15685
+ */
15686
+ var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
15687
+ /**
15688
+ * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
15689
+ * doorbell, owned by the `virtual-doorbell` wrapper over its
15690
+ * `doorbellSources` store (D648). A source rings when one of its
15691
+ * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
15692
+ * different authority (`deviceManager.setWrapperActive`, D62) — the slot
15693
+ * reports it, it never writes it.
15694
+ */
15695
+ var DOORBELL_SOURCE_SLOT = {
15696
+ id: "doorbell-source",
15697
+ label: "Doorbell trigger devices",
15698
+ 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.",
15699
+ shape: "association",
15700
+ hostDeviceTypes: [DeviceType.Camera],
15701
+ sourceCaps: SOURCE_CAPS,
15702
+ cardinality: "many",
15703
+ value: DoorbellSourceSlotValueSchema
15704
+ };
15705
+ var doorbellCapability = {
15706
+ name: "doorbell",
15707
+ scope: "device",
15708
+ deviceNative: true,
15709
+ mode: "singleton",
15710
+ kind: "wrapper",
15711
+ defaultActive: false,
15712
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
15713
+ extensionSlots: [DOORBELL_SOURCE_SLOT],
15714
+ methods: {},
15715
+ events: {
15716
+ /**
15717
+ * Fires once per physical press. Reolink delivers via Baichuan
15718
+ * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
15719
+ * release/duration — it's a pulse.
15720
+ */
15721
+ onPressed: {
15722
+ data: DoorbellPressEventSchema,
15723
+ fromState: {
15724
+ field: "lastPressedAt",
15725
+ on: "advance"
15726
+ }
15727
+ } },
15728
+ status: {
15729
+ schema: DoorbellStatusSchema,
15730
+ kind: "push"
15731
+ },
15732
+ /**
15733
+ * Runtime-state slice — last press timestamp + lifetime press count.
15734
+ * Mirrored by the kernel and readable via
15735
+ * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
15736
+ * without subscribing.
15737
+ */
15738
+ runtimeState: DoorbellStatusSchema,
15739
+ /**
15740
+ * 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.
15741
+ *
15742
+ * See `RuntimeStateDurability`. Enforced by
15743
+ * `scripts/check-runtime-state-durability.ts`.
15744
+ */
15745
+ durability: "restored"
15746
+ };
15747
+ var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
15748
+ DeviceType.Camera, DeviceType.Camera;
15749
+ /** A slot's editable value, discriminated on `slot`. */
15750
+ var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
15751
+ DeviceType.Camera;
15752
+ var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
15753
+ state: literal("unreachable"),
15754
+ reason: string()
15755
+ })]);
15756
+ /** One provider of slots — the D554 source-listing row. */
15757
+ var ExtensionSourceSchema = object({
15758
+ /** The routing prefix of every `slotRef` this provider serves. */
15759
+ source: string(),
15760
+ label: string(),
15761
+ /** Stamped by the dispatcher from the registry (D557). */
15762
+ addonId: string().optional(),
15763
+ availability: ExtensionSourceAvailabilitySchema
15764
+ });
15765
+ /**
15766
+ * How one picked source stands. `missing` — no such device (deleted, or an id
15767
+ * that never existed); `foreign` — a device the slot's owner cannot read from
15768
+ * (a source owned by another addon); `unavailable` — it exists but is not a
15769
+ * valid source now (a container, which is never a pick). A source in any of
15770
+ * these states is SHOWN, never silently dropped or re-pointed.
15771
+ */
15772
+ var ExtensionSourceHealthSchema = _enum([
15773
+ "ok",
15774
+ "missing",
15775
+ "foreign",
15776
+ "unavailable"
15777
+ ]);
15778
+ var ExtensionSlotSourceSchema = object({
15779
+ deviceId: number().int(),
15780
+ /** The device's name, or null when it could not be resolved (`missing`). */
15781
+ name: string().nullable(),
15782
+ health: ExtensionSourceHealthSchema,
15783
+ detail: string().optional()
15784
+ });
15785
+ /**
15786
+ * A DIFFERENT authority that gates whether the slot's sources do anything —
15787
+ * reported read-only, named, never written through this contract (D62). The
15788
+ * virtual doorbell's sources ring only while the wrapper is bound to the
15789
+ * camera, and that binding belongs to `deviceManager.setWrapperActive`.
15790
+ * `unknown` means the gate could not be read; it is not "inactive" (D315).
15791
+ */
15792
+ var ExtensionSlotActivationSchema = object({
15793
+ state: _enum([
15794
+ "active",
15795
+ "inactive",
15796
+ "unknown"
15797
+ ]),
15798
+ authority: string(),
15799
+ detail: string().optional()
15800
+ });
15801
+ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
15802
+ state: literal("ok"),
15803
+ /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
15804
+ slotRef: string(),
15805
+ slot: ExtensionSlotIdSchema,
15806
+ /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
15807
+ authority: string(),
15808
+ activation: ExtensionSlotActivationSchema.nullable(),
15809
+ value: ExtensionSlotValueSchema,
15810
+ sources: array(ExtensionSlotSourceSchema),
15811
+ /**
15812
+ * Devices the owner links to the host ON ITS OWN, by structure, and that
15813
+ * are therefore not in `value` (D655): a camera's device-tree children, and
15814
+ * the child a picked container stands for (D356 — a container is never a
15815
+ * pick, its children are). Read-only; the editor shows them and may offer
15816
+ * per-device options on them (the linked-devices tracked-event opt-in).
15817
+ * Absent when the owner links nothing beyond the picks, and from an owner
15818
+ * older than D655.
15819
+ */
15820
+ impliedSources: array(ExtensionSlotSourceSchema).optional()
15821
+ }), object({
15822
+ state: literal("unreachable"),
15823
+ addonId: string(),
15824
+ reason: string()
15825
+ })]);
15826
+ var ExtensionCandidatesSchema = object({ candidates: array(object({
15827
+ deviceId: number().int(),
15828
+ name: string(),
15829
+ type: string(),
15830
+ location: string().nullable(),
15831
+ /** The container a child belongs to — "Spotlight 2" alone does not say which. */
15832
+ parentName: string().nullable(),
15833
+ /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
15834
+ suggested: boolean(),
15835
+ /** Why it is suggested ("same location"), null when it is not. */
15836
+ reason: string().nullable()
15837
+ })) });
15838
+ /**
15839
+ * What a write did. `none` — applied in place. `host` / `parent` — the owner
15840
+ * reloaded the host (or, for an accessory child, its parent) because the
15841
+ * write changed what the host REGISTERS. A slot never adds a capability to its
15842
+ * host — that is a composition (D663) — so today's owners answer `none`.
15843
+ */
15844
+ var ExtensionSetResultSchema = object({
15845
+ applied: literal(true),
15846
+ reload: _enum([
15847
+ "none",
15848
+ "host",
15849
+ "parent"
15850
+ ])
15851
+ });
15852
+ var ExtensionSlotRefInputSchema = object({
15853
+ deviceId: number().int(),
15854
+ slotRef: string().min(1)
15855
+ });
15856
+ var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
15857
+ method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
15858
+ kind: "mutation",
15859
+ auth: "admin"
15860
+ });
15861
+ /**
15582
15862
  * Per-field ownership (D663). A composition may CLAIM fields of a native
15583
15863
  * cap's runtime-state slice on an existing device: `replace` overlays the
15584
15864
  * claimed fields on the native slice, `add` builds a slice the device does
@@ -18588,17 +18868,25 @@ var NcScheduleSchema = object({
18588
18868
  */
18589
18869
  var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
18590
18870
  /**
18871
+ * How a summary window is SENT (D698): `rule` (absent) = ONE notification with
18872
+ * every section; `section` = one notification per section with something to
18873
+ * say (an unavailable section included), each titled by its section.
18874
+ */
18875
+ var NcStateSummarySplitSchema = _enum(["rule", "section"]);
18876
+ /**
18591
18877
  * `summary`: the rule sends NOTHING per event. When a window of `schedule`
18592
18878
  * CLOSES, it sends one notification with the current state of its kinds
18593
18879
  * (low batteries, consumables to replace, devices offline, updates
18594
- * available, ...), after its own filters. Nothing to report sends nothing.
18880
+ * available, ...), after its own filters — or, with `split: 'section'`
18881
+ * (D698), one notification per section. Nothing to report sends nothing.
18595
18882
  * The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
18596
18883
  * midnight crossing); the send time is each window's END. Refused on the
18597
18884
  * `alarm` family, which stays instant (`systemEventDeliveryProblems`).
18598
18885
  */
18599
18886
  var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
18600
18887
  mode: literal("summary"),
18601
- schedule: NcScheduleSchema
18888
+ schedule: NcScheduleSchema,
18889
+ split: NcStateSummarySplitSchema.optional()
18602
18890
  })]);
18603
18891
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
18604
18892
  var NcPlateMatcherSchema = object({
@@ -18738,8 +19026,14 @@ var NcSensorTransitionSchema = _enum(["raised", "cleared"]);
18738
19026
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
18739
19027
  var NcZoneConditionSchema = object({
18740
19028
  ids: array(string().min(1)).min(1),
18741
- /** Quantifier over `ids` — at least one / every one visited. */
18742
- match: _enum(["any", "all"]).default("any")
19029
+ /**
19030
+ * LEGACY quantifier over `ids`. Absent = `any` (at least one visited), which
19031
+ * is what both editors mean and all they write since D690: "all of" was
19032
+ * removed from the editors because on an immediate rule it asked one
19033
+ * detection to stand in every zone at once. Still ACCEPTED, and `all` still
19034
+ * evaluated, so a stored rule keeps parsing and meaning what it meant.
19035
+ */
19036
+ match: _enum(["any", "all"]).optional()
18743
19037
  });
18744
19038
  /**
18745
19039
  * The P1 condition set — a flat AND of groups; absent group = pass;
@@ -19243,10 +19537,12 @@ var NcMediaPolicySchema = object({
19243
19537
  /**
19244
19538
  * Cooldown GRANULARITY over the subject's class — how much a fired
19245
19539
  * notification suppresses.
19246
- * - `shared` (default, and the absent value) — one window for the whole
19247
- * rule/scope: a cat silences the next dog for `cooldownSec`.
19248
- * - `per-class` — an independent window per detected class, so cat→dog fires
19249
- * at once and cat→cat still waits.
19540
+ * - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
19541
+ * independent window per detected class: cat→dog fires at once, cat→cat
19542
+ * still waits.
19543
+ * - `shared` — one window for the whole rule/scope: a cat silences the next
19544
+ * dog for `cooldownSec`. Only written when an operator picks it; it is no
19545
+ * longer what an unset rule means.
19250
19546
  *
19251
19547
  * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
19252
19548
  * must not be swallowed by a bark's window (the precedent this generalizes —
@@ -19261,8 +19557,11 @@ var NcThrottleSchema = object({
19261
19557
  /**
19262
19558
  * Class granularity of the cooldown key. Optional rather than defaulted:
19263
19559
  * a Zod default does NOT run on the addon→addon cap path, so a persisted
19264
- * rule authored before this field simply carries none — and the engine
19265
- * reads absent as `shared`, the pre-existing behaviour.
19560
+ * rule authored before this field simply carries none. The engine used to
19561
+ * read absent as `shared` (D36); since 2026-10-01 it reads absent as
19562
+ * `per-class` — the operator's default — and only an explicit `shared`
19563
+ * still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
19564
+ * engine, and D36's dated note.
19266
19565
  */
19267
19566
  granularity: NcThrottleGranularitySchema.optional()
19268
19567
  });
@@ -19586,11 +19885,23 @@ var NcStateSummaryPreviewSectionSchema = object({
19586
19885
  reason: string().optional()
19587
19886
  });
19588
19887
  /**
19888
+ * One notification a previewed summary would send (D698): the whole summary on
19889
+ * a `rule` split (no `section`), one section's on a `section` split.
19890
+ */
19891
+ var NcStateSummaryPreviewRowSchema = object({
19892
+ section: string().optional(),
19893
+ /** The section's name on a per-section row; every reported section's, joined, on a combined one. */
19894
+ title: string(),
19895
+ text: string(),
19896
+ count: number().int().nonnegative()
19897
+ });
19898
+ /**
19589
19899
  * The summary a rule would send now. `empty` = nothing to report and every
19590
19900
  * section read: such a summary is NOT sent. `dropped` counts the open states
19591
19901
  * the rule's own filters (or a camera mute) left out, by reason.
19592
19902
  * `excludedGroups` names the kind groups selected that have no state to report
19593
- * (backups & exports).
19903
+ * (backups & exports). `split` and `rows` (D698) say how it would be sent —
19904
+ * optional, so an older hub's answer still parses.
19594
19905
  */
19595
19906
  var NcStateSummaryPreviewSchema = object({
19596
19907
  empty: boolean(),
@@ -19598,7 +19909,9 @@ var NcStateSummaryPreviewSchema = object({
19598
19909
  text: string(),
19599
19910
  sections: array(NcStateSummaryPreviewSectionSchema),
19600
19911
  dropped: record(string(), number().int().nonnegative()),
19601
- excludedGroups: array(string())
19912
+ excludedGroups: array(string()),
19913
+ split: NcStateSummarySplitSchema.optional(),
19914
+ rows: array(NcStateSummaryPreviewRowSchema).optional()
19602
19915
  });
19603
19916
  var NcTestResultSchema = object({
19604
19917
  recordId: string(),
@@ -22519,7 +22832,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22519
22832
  trackIds: array(string()).min(1)
22520
22833
  }), object({
22521
22834
  deleted: number().int(),
22522
- failed: array(string()).readonly()
22835
+ failed: array(string()).readonly(),
22836
+ sparedMediaIds: array(number().int()).readonly().optional()
22523
22837
  }), {
22524
22838
  kind: "mutation",
22525
22839
  auth: "admin"
@@ -24748,7 +25062,42 @@ var SetCameraSensorsInputSchema = object({
24748
25062
  /** `null` removes the attachment: the camera goes back to `not-configured`. */
24749
25063
  config: CameraSensorsConfigSchema.nullable()
24750
25064
  });
24751
- method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25065
+ /**
25066
+ * Why an early occupancy look (D691) was not scheduled.
25067
+ *
25068
+ * - `unknown-camera` — no session was ever dispatched for it, so there is no
25069
+ * node and no config to attach a burst with.
25070
+ * - `out-of-range` — the ask is negative or further out than the orchestrator
25071
+ * will hold a timer for; the parked-object cadence is the answer there.
25072
+ * - `no-burst-producer` — this build has no burst producer at all.
25073
+ * - `already-looked` — this camera's ONE early look since its last session has
25074
+ * been spent. A look's own burst can re-arm a flickering flip, and a look
25075
+ * per arm would chain a burst every ~30 s forever (review H2); the next
25076
+ * real session re-arms the budget.
25077
+ */
25078
+ var OccupancyLookRefusalSchema = _enum([
25079
+ "unknown-camera",
25080
+ "out-of-range",
25081
+ "no-burst-producer",
25082
+ "already-looked"
25083
+ ]);
25084
+ method(object({
25085
+ deviceId: number().int().nonnegative(),
25086
+ /** How long from NOW until the pending flip's sustain window ends. RELATIVE,
25087
+ * so the caller's clock and the orchestrator's never have to agree. */
25088
+ afterMs: number().finite(),
25089
+ /** Why, for the log. */
25090
+ reason: string()
25091
+ }), object({
25092
+ scheduled: boolean(),
25093
+ /** When `scheduled`: how long until the burst is dialled. */
25094
+ dueInMs: number().optional(),
25095
+ /** When not `scheduled`: why. */
25096
+ refusedBecause: OccupancyLookRefusalSchema.optional()
25097
+ }), {
25098
+ kind: "mutation",
25099
+ auth: "admin"
25100
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
24752
25101
  kind: "mutation",
24753
25102
  auth: "admin"
24754
25103
  }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
@@ -27215,219 +27564,6 @@ DeviceType.Camera, method(object({
27215
27564
  auth: "protected"
27216
27565
  });
27217
27566
  /**
27218
- * Doorbell button cap. Two kinds of providers coexist behind this cap
27219
- * name (same pattern as `snapshot`):
27220
- *
27221
- * - **Native** providers: registered per-device by device-driver
27222
- * addons via `ctx.registerNativeCap` — either on a
27223
- * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
27224
- * or directly on the camera (Reolink registers at camera level).
27225
- * Emits an `onPressed` event every time the firmware pushes a
27226
- * ring; status tracks the last press and a pressCount since start
27227
- * (diagnostic).
27228
- *
27229
- * - **Wrapper** provider: the `virtual-doorbell` system builtin
27230
- * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
27231
- * device (contact / switch / event-emitter …) into a doorbell for
27232
- * a camera. `defaultActive: false` — the operator explicitly binds
27233
- * it per camera in the device-bindings UI, then picks the source
27234
- * device + trigger in the per-device settings.
27235
- *
27236
- * The DeviceEventPropagator re-emits `onPressed` on the camera parent
27237
- * — subscribers listening at the camera level receive ring events
27238
- * with `via[]` populated. No code on the parent needed.
27239
- */
27240
- var DoorbellStatusSchema = object({
27241
- /** Ms epoch of the last press. null = never observed since this provider started. */
27242
- lastPressedAt: number().nullable(),
27243
- /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
27244
- pressCountSinceStart: number()
27245
- });
27246
- var DoorbellPressEventSchema = object({
27247
- deviceId: number(),
27248
- timestamp: number()
27249
- });
27250
- /**
27251
- * The `doorbell-source` extension slot's editable value (D648): the camera's
27252
- * virtual-doorbell trigger devices, exactly what the wrapper's
27253
- * `doorbellSources` persists (as `{ deviceId }` records).
27254
- */
27255
- var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
27256
- /**
27257
- * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
27258
- * doorbell, owned by the `virtual-doorbell` wrapper over its
27259
- * `doorbellSources` store (D648). A source rings when one of its
27260
- * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
27261
- * different authority (`deviceManager.setWrapperActive`, D62) — the slot
27262
- * reports it, it never writes it.
27263
- */
27264
- var DOORBELL_SOURCE_SLOT = {
27265
- id: "doorbell-source",
27266
- label: "Doorbell trigger devices",
27267
- 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.",
27268
- shape: "association",
27269
- hostDeviceTypes: [DeviceType.Camera],
27270
- sourceCaps: SOURCE_CAPS,
27271
- cardinality: "many",
27272
- value: DoorbellSourceSlotValueSchema
27273
- };
27274
- var doorbellCapability = {
27275
- name: "doorbell",
27276
- scope: "device",
27277
- deviceNative: true,
27278
- mode: "singleton",
27279
- kind: "wrapper",
27280
- defaultActive: false,
27281
- deviceTypes: [DeviceType.Button, DeviceType.Camera],
27282
- extensionSlots: [DOORBELL_SOURCE_SLOT],
27283
- methods: {},
27284
- events: {
27285
- /**
27286
- * Fires once per physical press. Reolink delivers via Baichuan
27287
- * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
27288
- * release/duration — it's a pulse.
27289
- */
27290
- onPressed: {
27291
- data: DoorbellPressEventSchema,
27292
- fromState: {
27293
- field: "lastPressedAt",
27294
- on: "advance"
27295
- }
27296
- } },
27297
- status: {
27298
- schema: DoorbellStatusSchema,
27299
- kind: "push"
27300
- },
27301
- /**
27302
- * Runtime-state slice — last press timestamp + lifetime press count.
27303
- * Mirrored by the kernel and readable via
27304
- * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
27305
- * without subscribing.
27306
- */
27307
- runtimeState: DoorbellStatusSchema,
27308
- /**
27309
- * 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.
27310
- *
27311
- * See `RuntimeStateDurability`. Enforced by
27312
- * `scripts/check-runtime-state-durability.ts`.
27313
- */
27314
- durability: "restored"
27315
- };
27316
- var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
27317
- DeviceType.Camera, DeviceType.Camera;
27318
- /** A slot's editable value, discriminated on `slot`. */
27319
- var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
27320
- DeviceType.Camera;
27321
- var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
27322
- state: literal("unreachable"),
27323
- reason: string()
27324
- })]);
27325
- /** One provider of slots — the D554 source-listing row. */
27326
- var ExtensionSourceSchema = object({
27327
- /** The routing prefix of every `slotRef` this provider serves. */
27328
- source: string(),
27329
- label: string(),
27330
- /** Stamped by the dispatcher from the registry (D557). */
27331
- addonId: string().optional(),
27332
- availability: ExtensionSourceAvailabilitySchema
27333
- });
27334
- /**
27335
- * How one picked source stands. `missing` — no such device (deleted, or an id
27336
- * that never existed); `foreign` — a device the slot's owner cannot read from
27337
- * (a source owned by another addon); `unavailable` — it exists but is not a
27338
- * valid source now (a container, which is never a pick). A source in any of
27339
- * these states is SHOWN, never silently dropped or re-pointed.
27340
- */
27341
- var ExtensionSourceHealthSchema = _enum([
27342
- "ok",
27343
- "missing",
27344
- "foreign",
27345
- "unavailable"
27346
- ]);
27347
- var ExtensionSlotSourceSchema = object({
27348
- deviceId: number().int(),
27349
- /** The device's name, or null when it could not be resolved (`missing`). */
27350
- name: string().nullable(),
27351
- health: ExtensionSourceHealthSchema,
27352
- detail: string().optional()
27353
- });
27354
- /**
27355
- * A DIFFERENT authority that gates whether the slot's sources do anything —
27356
- * reported read-only, named, never written through this contract (D62). The
27357
- * virtual doorbell's sources ring only while the wrapper is bound to the
27358
- * camera, and that binding belongs to `deviceManager.setWrapperActive`.
27359
- * `unknown` means the gate could not be read; it is not "inactive" (D315).
27360
- */
27361
- var ExtensionSlotActivationSchema = object({
27362
- state: _enum([
27363
- "active",
27364
- "inactive",
27365
- "unknown"
27366
- ]),
27367
- authority: string(),
27368
- detail: string().optional()
27369
- });
27370
- var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
27371
- state: literal("ok"),
27372
- /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
27373
- slotRef: string(),
27374
- slot: ExtensionSlotIdSchema,
27375
- /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
27376
- authority: string(),
27377
- activation: ExtensionSlotActivationSchema.nullable(),
27378
- value: ExtensionSlotValueSchema,
27379
- sources: array(ExtensionSlotSourceSchema),
27380
- /**
27381
- * Devices the owner links to the host ON ITS OWN, by structure, and that
27382
- * are therefore not in `value` (D655): a camera's device-tree children, and
27383
- * the child a picked container stands for (D356 — a container is never a
27384
- * pick, its children are). Read-only; the editor shows them and may offer
27385
- * per-device options on them (the linked-devices tracked-event opt-in).
27386
- * Absent when the owner links nothing beyond the picks, and from an owner
27387
- * older than D655.
27388
- */
27389
- impliedSources: array(ExtensionSlotSourceSchema).optional()
27390
- }), object({
27391
- state: literal("unreachable"),
27392
- addonId: string(),
27393
- reason: string()
27394
- })]);
27395
- var ExtensionCandidatesSchema = object({ candidates: array(object({
27396
- deviceId: number().int(),
27397
- name: string(),
27398
- type: string(),
27399
- location: string().nullable(),
27400
- /** The container a child belongs to — "Spotlight 2" alone does not say which. */
27401
- parentName: string().nullable(),
27402
- /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
27403
- suggested: boolean(),
27404
- /** Why it is suggested ("same location"), null when it is not. */
27405
- reason: string().nullable()
27406
- })) });
27407
- /**
27408
- * What a write did. `none` — applied in place. `host` / `parent` — the owner
27409
- * reloaded the host (or, for an accessory child, its parent) because the
27410
- * write changed what the host REGISTERS. A slot never adds a capability to its
27411
- * host — that is a composition (D663) — so today's owners answer `none`.
27412
- */
27413
- var ExtensionSetResultSchema = object({
27414
- applied: literal(true),
27415
- reload: _enum([
27416
- "none",
27417
- "host",
27418
- "parent"
27419
- ])
27420
- });
27421
- var ExtensionSlotRefInputSchema = object({
27422
- deviceId: number().int(),
27423
- slotRef: string().min(1)
27424
- });
27425
- var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
27426
- method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
27427
- kind: "mutation",
27428
- auth: "admin"
27429
- });
27430
- /**
27431
27567
  * Optional client-side hints sent at session creation to help the provider
27432
27568
  * pick the best native source. All fields optional — a viewer that knows
27433
27569
  * nothing still gets a sane default. (Relocated from the retired `webrtc`
@@ -42696,6 +42832,18 @@ Object.freeze({
42696
42832
  addonId: null,
42697
42833
  access: "view"
42698
42834
  },
42835
+ "databaseSnapshot.listDatabases": {
42836
+ capName: "database-snapshot",
42837
+ capScope: "system",
42838
+ addonId: null,
42839
+ access: "view"
42840
+ },
42841
+ "databaseSnapshot.writeSnapshot": {
42842
+ capName: "database-snapshot",
42843
+ capScope: "system",
42844
+ addonId: null,
42845
+ access: "create"
42846
+ },
42699
42847
  "dataStoreProvider.aggregate": {
42700
42848
  capName: "data-store-provider",
42701
42849
  capScope: "system",
@@ -46260,6 +46408,12 @@ Object.freeze({
46260
46408
  addonId: null,
46261
46409
  access: "delete"
46262
46410
  },
46411
+ "pipelineOrchestrator.requestOccupancyLook": {
46412
+ capName: "pipeline-orchestrator",
46413
+ capScope: "system",
46414
+ addonId: null,
46415
+ access: "create"
46416
+ },
46263
46417
  "pipelineOrchestrator.resetNodePipelineDefaults": {
46264
46418
  capName: "pipeline-orchestrator",
46265
46419
  capScope: "system",
@@ -50052,6 +50206,11 @@ Object.freeze({
50052
50206
  form: "single",
50053
50207
  optional: false
50054
50208
  }],
50209
+ "pipelineOrchestrator.requestOccupancyLook": [{
50210
+ name: "deviceId",
50211
+ form: "single",
50212
+ optional: false
50213
+ }],
50055
50214
  "pipelineOrchestrator.resolvePipeline": [{
50056
50215
  name: "deviceId",
50057
50216
  form: "single",
@@ -51213,6 +51372,18 @@ var STATE_SUMMARY_VARS = [
51213
51372
  systemEventKinds: [...SUMMARISABLE],
51214
51373
  systemEventDeliveries: ["summary"]
51215
51374
  },
51375
+ {
51376
+ name: "summarySection",
51377
+ label: "Summary: this section",
51378
+ description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
51379
+ example: "Batterie scariche",
51380
+ group: "system",
51381
+ families: ["rule"],
51382
+ fields: [...RULE_TEXT],
51383
+ kinds: ["system"],
51384
+ systemEventKinds: [...SUMMARISABLE],
51385
+ systemEventDeliveries: ["summary"]
51386
+ },
51216
51387
  ...STATE_SUMMARY_SECTION_VARS.map((v) => ({
51217
51388
  name: v.name,
51218
51389
  label: v.label,
@@ -51289,6 +51460,37 @@ var STATE_SUMMARY_VARS = [
51289
51460
  [...RULE_TEXT],
51290
51461
  ...STATE_SUMMARY_VARS
51291
51462
  ];
51463
+ new Set([
51464
+ "disarmed",
51465
+ "armed_home",
51466
+ "armed_away",
51467
+ "armed_night",
51468
+ "armed_vacation",
51469
+ "armed_custom_bypass",
51470
+ "arming",
51471
+ "disarming",
51472
+ "pending",
51473
+ "triggered",
51474
+ "open",
51475
+ "opening",
51476
+ "closing",
51477
+ "closed",
51478
+ "stopped",
51479
+ "locked",
51480
+ "unlocked",
51481
+ "locking",
51482
+ "unlocking",
51483
+ "jammed",
51484
+ "on",
51485
+ "off",
51486
+ "home",
51487
+ "not_home",
51488
+ "matched",
51489
+ "diverged",
51490
+ "unknown",
51491
+ "latched",
51492
+ "live"
51493
+ ]);
51292
51494
  /**
51293
51495
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
51294
51496
  *