@camstack/addon-provider-homematic 1.2.121 → 1.2.122

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 +760 -321
  2. package/dist/addon.mjs +760 -321
  3. package/package.json +2 -2
package/dist/addon.js CHANGED
@@ -5379,7 +5379,7 @@ var ZodIssueCode = {
5379
5379
  var ZodFirstPartyTypeKind;
5380
5380
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5381
5381
  //#endregion
5382
- //#region ../types/dist/sleep-C-v96WpE.mjs
5382
+ //#region ../types/dist/sleep-gU6hqv4_.mjs
5383
5383
  /**
5384
5384
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5385
5385
  * window to float samples (D455).
@@ -7422,7 +7422,59 @@ function errMsg(err) {
7422
7422
  return String(err);
7423
7423
  }
7424
7424
  //#endregion
7425
- //#region ../types/dist/composition-BK-GTFYb.mjs
7425
+ //#region ../types/dist/composition-Dq42XWp0.mjs
7426
+ /**
7427
+ * The ffmpeg build every CamStack node downloads, per platform and arch.
7428
+ *
7429
+ * ## Why a download, on every node, including the container
7430
+ *
7431
+ * The version of ffmpeg used to be CODE: baked into the image, changeable only
7432
+ * by rebuilding and rolling it. Now it is DATA — this file states the release,
7433
+ * and a node that boots with a different one downloads it. Changing ffmpeg is a
7434
+ * framework bump, not an image rebuild.
7435
+ *
7436
+ * It also settles the licence question by removing it. FFmpeg's licence is
7437
+ * chosen at compile time: the core is LGPL 2.1+, `--enable-gpl` makes it GPL
7438
+ * (for x264/x265), `--enable-version3` makes that v3, and `--enable-nonfree`
7439
+ * makes the result undistributable. These are GPL v3 builds, and we do not
7440
+ * distribute them: the user's own node fetches the archive from the project
7441
+ * that publishes it, so we convey no GPL work and inherit none of the
7442
+ * obligations that come with conveying one. That is the whole reason the image
7443
+ * no longer installs ffmpeg at all — not a technical preference.
7444
+ *
7445
+ * ## Why jellyfin-ffmpeg
7446
+ *
7447
+ * One vendor covering linux-amd64, linux-arm64, darwin-arm64 and darwin-x64
7448
+ * from one release, with the widest hardware surface of anything maintained:
7449
+ * VAAPI, QSV, NVENC/NVDEC, AMF, Vulkan, OpenCL and DRM on amd64, plus Rockchip
7450
+ * MPP on arm64. It reaches the vendor libraries through dlopen trampolines,
7451
+ * so the binary is not linked against a driver stack it may not find.
7452
+ *
7453
+ * **What it still needs from the host, measured 2026-09-19.** On the Unraid
7454
+ * HOST, which has no libva, `-vaapi_device` aborts the process outright —
7455
+ * `implib-gen: libva-drm.so.2: failed to load library ... Assertion '0 &&
7456
+ * "Assertion in generated code"' failed`. Inside our container, which installs
7457
+ * libva plus the iHD driver, the same command encodes: verified end to end with
7458
+ * `testsrc → format=nv12,hwupload → h264_vaapi`. So the image drops ffmpeg and
7459
+ * KEEPS the Intel media stack; the drivers are the part a binary cannot bring.
7460
+ *
7461
+ * ## Why each artifact carries a checksum and a claim
7462
+ *
7463
+ * The download is now the only source, so `sha256` is verified before anything
7464
+ * is extracted — jellyfin publishes no checksums on its release assets, so
7465
+ * these are ours, taken at the version bump. And `expectedHwaccels` is what the
7466
+ * build is supposed to be able to do: a binary that probes short of its own
7467
+ * claim is a source that changed under us, which is precisely what went
7468
+ * unnoticed for months when a static build turned out to carry no VAAPI at all
7469
+ * (D536).
7470
+ */
7471
+ /** The pinned jellyfin-ffmpeg release. Changing this is the version change. */
7472
+ var FFMPEG_RELEASE = "8.1.2-5";
7473
+ var BASE = `https://github.com/jellyfin/jellyfin-ffmpeg/releases/download/v${FFMPEG_RELEASE}`;
7474
+ function portable(target) {
7475
+ return `${BASE}/jellyfin-ffmpeg_${FFMPEG_RELEASE}_portable_${target}-gpl.tar.xz`;
7476
+ }
7477
+ portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac64");
7426
7478
  /**
7427
7479
  * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
7428
7480
  * valutatore puro del suo FRONTE.
@@ -8896,6 +8948,82 @@ var ArchivedDebugNoteQueryInputSchema = object({
8896
8948
  /** Max rows returned, newest-first. */
8897
8949
  limit: number().int().min(1).max(1e3).optional()
8898
8950
  });
8951
+ var TrackRelationKindSchema = _enum(["same-subject", "different-subjects"]);
8952
+ var TrackSideSchema = _enum(["before", "after"]);
8953
+ var TrackPurityValueSchema = _enum(["mixed", "not-a-subject"]);
8954
+ var TrackRelationSchema = object({
8955
+ id: string(),
8956
+ deviceId: number().int(),
8957
+ leftTrackId: string(),
8958
+ rightTrackId: string(),
8959
+ leftSide: TrackSideSchema.nullable(),
8960
+ rightSide: TrackSideSchema.nullable(),
8961
+ relation: TrackRelationKindSchema,
8962
+ presence: literal("continuous").nullable(),
8963
+ leftStartedAt: number().int().nullable(),
8964
+ rightStartedAt: number().int().nullable(),
8965
+ createdAt: number().int(),
8966
+ updatedAt: number().int(),
8967
+ author: string().nullable()
8968
+ });
8969
+ var TrackPuritySchema = object({
8970
+ id: string(),
8971
+ deviceId: number().int(),
8972
+ sourceTrackId: string(),
8973
+ purity: TrackPurityValueSchema,
8974
+ switchAtMs: number().int().nullable(),
8975
+ startedAt: number().int().nullable(),
8976
+ createdAt: number().int(),
8977
+ updatedAt: number().int(),
8978
+ author: string().nullable()
8979
+ });
8980
+ var SetTrackRelationInputSchema = object({
8981
+ deviceId: number().int(),
8982
+ trackId: string().min(1),
8983
+ otherTrackId: string().min(1),
8984
+ relation: TrackRelationKindSchema,
8985
+ presence: literal("continuous").optional(),
8986
+ trackSide: TrackSideSchema.optional(),
8987
+ otherSide: TrackSideSchema.optional()
8988
+ });
8989
+ var ClearTrackRelationInputSchema = object({
8990
+ deviceId: number().int(),
8991
+ trackId: string().min(1),
8992
+ otherTrackId: string().min(1)
8993
+ });
8994
+ var ClearTrackRelationResultSchema = object({ cleared: boolean() });
8995
+ var SetTrackPurityInputSchema = object({
8996
+ deviceId: number().int(),
8997
+ trackId: string().min(1),
8998
+ purity: _enum([
8999
+ "pure",
9000
+ "mixed",
9001
+ "not-a-subject"
9002
+ ]),
9003
+ switchAtMs: number().int().optional()
9004
+ });
9005
+ /** `null` when `pure` cleared the row. */
9006
+ var SetTrackPurityResultSchema = object({ purity: TrackPuritySchema.nullable() });
9007
+ var ListTrackRelationsInputSchema = object({
9008
+ deviceId: number().int(),
9009
+ trackId: string().optional(),
9010
+ since: number().int().optional(),
9011
+ until: number().int().optional(),
9012
+ limit: number().int().min(1).max(5e3).optional()
9013
+ });
9014
+ var ListTrackRelationsResultSchema = object({
9015
+ relations: array(TrackRelationSchema).readonly(),
9016
+ purities: array(TrackPuritySchema).readonly(),
9017
+ truncated: boolean()
9018
+ });
9019
+ _enum([
9020
+ "unknown-track",
9021
+ "cross-device",
9022
+ "self-relation",
9023
+ "contradiction",
9024
+ "switch-outside-track",
9025
+ "switch-needs-mixed"
9026
+ ]);
8899
9027
  /**
8900
9028
  * Ops-log — the durable, append-only operations audit shared by the
8901
9029
  * recordings and events management surfaces.
@@ -11449,6 +11577,68 @@ method(object({
11449
11577
  password: string()
11450
11578
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
11451
11579
  /**
11580
+ * How long one snapshot may take end to end: the pinned copy of the whole
11581
+ * database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
11582
+ * disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
11583
+ * generous because a timeout fails the whole backup run.
11584
+ */
11585
+ var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
11586
+ /**
11587
+ * The databases an owner snapshots — declared by the OWNER, so a caller never
11588
+ * guesses which file is live from what sits beside it (a cleanly closed
11589
+ * database has no sidecars and is just as owned). Paths are absolute on the
11590
+ * owner's host.
11591
+ */
11592
+ var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
11593
+ /** One b-tree table of the snapshot and the rows it holds. */
11594
+ var DatabaseSnapshotTableSchema = object({
11595
+ name: string(),
11596
+ rows: number().int().nonnegative()
11597
+ });
11598
+ /**
11599
+ * What the owner wrote. Every path is ABSOLUTE on the owner's host — the
11600
+ * caller pins the call to its own node, so it can read the file; a caller
11601
+ * that finds the path outside its own data root refuses it rather than
11602
+ * archiving something it cannot place.
11603
+ */
11604
+ var DatabaseSnapshotResultSchema = object({
11605
+ /** The live database the snapshot copies. Never to be copied as a file. */
11606
+ livePath: string(),
11607
+ /** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
11608
+ snapshotPath: string(),
11609
+ sizeBytes: number().int().nonnegative(),
11610
+ pageCount: number().int().nonnegative(),
11611
+ pageSize: number().int().positive(),
11612
+ /**
11613
+ * Every b-tree table with its row count. Read inside the SAME read
11614
+ * transaction the copy was taken from, and found EQUAL on the copy — so
11615
+ * this is the content of the snapshot, not an estimate of the source.
11616
+ */
11617
+ tables: array(DatabaseSnapshotTableSchema),
11618
+ /** Wall time of the pinned copy (row counts included). */
11619
+ copyMs: number().nonnegative(),
11620
+ /** Wall time of the checks on the copy (`integrity_check`, row counts). */
11621
+ verifyMs: number().nonnegative(),
11622
+ /** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
11623
+ takenAt: number()
11624
+ });
11625
+ /**
11626
+ * A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
11627
+ * the same facts, with both paths relative to the archive root (the node's
11628
+ * data dir), because an archive outlives the host that made it.
11629
+ */
11630
+ var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
11631
+ /** Archive-relative path of the live database the archive does NOT carry. */
11632
+ livePath: string(),
11633
+ /** Archive-relative path of the verified copy it carries in its place. */
11634
+ snapshotPath: string()
11635
+ });
11636
+ method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }), method(object({}), DatabaseSnapshotResultSchema, {
11637
+ kind: "mutation",
11638
+ auth: "admin",
11639
+ timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
11640
+ });
11641
+ /**
11452
11642
  * Orchestrator-side destination metadata. The orchestrator computes
11453
11643
  * `id = <addonId>:<subId>` from its provider lookup so consumers
11454
11644
  * (admin UI, restore flow) see one canonical key.
@@ -11559,7 +11749,12 @@ var ArchiveManifestSchema = object({
11559
11749
  locations: array(string()),
11560
11750
  entries: array(ArchiveEntrySchema),
11561
11751
  totalBytes: number(),
11562
- totalFiles: number()
11752
+ totalFiles: number(),
11753
+ /**
11754
+ * Live SQLite databases this archive carries as their OWNER's verified
11755
+ * snapshot instead of as files (D693). Absent on archives made before.
11756
+ */
11757
+ sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
11563
11758
  });
11564
11759
  var LocationStatSchema = object({
11565
11760
  name: string(),
@@ -13134,6 +13329,116 @@ var CompositionBlockStateSchema = object({
13134
13329
  reason: string().optional(),
13135
13330
  fields: array(CompositionFieldStateSchema)
13136
13331
  });
13332
+ var ComposerBlockSchema = object({
13333
+ id: string().min(1),
13334
+ name: string().min(1).max(120),
13335
+ enabled: boolean(),
13336
+ updatedAt: number(),
13337
+ composition: CompositionSchema
13338
+ });
13339
+ /**
13340
+ * A stored composition row that no longer PARSES — a schema a release
13341
+ * tightened, a row written by a newer build. Sent by id so the composer keeps
13342
+ * its device as a placeholder and reports the block `failed` naming the parse
13343
+ * error. Leaving it out would read, twice, exactly like a delete (D49).
13344
+ */
13345
+ var ComposerUnreadableBlockSchema = object({
13346
+ id: string().min(1),
13347
+ /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
13348
+ name: string().nullable(),
13349
+ /** The parse error, in the operator's words. */
13350
+ error: string()
13351
+ });
13352
+ method(object({
13353
+ /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
13354
+ integrationId: string().nullable(),
13355
+ /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
13356
+ storeLoaded: boolean(),
13357
+ blocks: array(ComposerBlockSchema),
13358
+ /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
13359
+ restartBlockIds: array(string()),
13360
+ /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
13361
+ unreadableBlocks: array(ComposerUnreadableBlockSchema)
13362
+ }), object({
13363
+ blocks: array(object({
13364
+ blockId: string(),
13365
+ status: CompositionRunStatusSchema,
13366
+ reason: string().optional()
13367
+ })),
13368
+ /**
13369
+ * False when the composer declared and withdrew NOTHING (store not loaded,
13370
+ * integration unknown, its own rows unread or read empty once). An empty
13371
+ * apply the caller owes is paid off only by one the composer acted on (D49).
13372
+ */
13373
+ acted: boolean()
13374
+ }), {
13375
+ kind: "mutation",
13376
+ auth: "admin"
13377
+ }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
13378
+ var NUMBER = {
13379
+ kind: "fixed",
13380
+ result: ["number"]
13381
+ };
13382
+ var BOOLEAN = {
13383
+ kind: "fixed",
13384
+ result: ["boolean"]
13385
+ };
13386
+ Object.freeze({
13387
+ min: NUMBER,
13388
+ max: NUMBER,
13389
+ abs: NUMBER,
13390
+ floor: NUMBER,
13391
+ ceil: NUMBER,
13392
+ sqrt: NUMBER,
13393
+ round: NUMBER,
13394
+ pow: NUMBER,
13395
+ clamp: NUMBER,
13396
+ avg: NUMBER,
13397
+ sum: NUMBER,
13398
+ age: NUMBER,
13399
+ convert: NUMBER,
13400
+ coalesce: { kind: "coalesce" },
13401
+ any: BOOLEAN,
13402
+ all: BOOLEAN,
13403
+ within: BOOLEAN,
13404
+ latest: {
13405
+ kind: "fixed",
13406
+ result: ["number", "null"]
13407
+ },
13408
+ number: {
13409
+ kind: "fixed",
13410
+ result: ["number", "null"]
13411
+ },
13412
+ rose: {
13413
+ kind: "fixed",
13414
+ result: ["number", "null"]
13415
+ },
13416
+ count: NUMBER
13417
+ });
13418
+ `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
13419
+ /**
13420
+ * What a composition may BUILD on a device type (G2, D676): the caps a new
13421
+ * device of that type, or an existing one that lacks them, can be given. The
13422
+ * blockers are the validator's own refusal codes, and a spec compares this
13423
+ * listing with `planComposition` for every capability — the editor can never
13424
+ * offer a feature the save would refuse for the same reason.
13425
+ */
13426
+ var ComposableFieldSchema = object({
13427
+ path: string(),
13428
+ kind: CompositionFieldKindSchema,
13429
+ nullable: boolean(),
13430
+ required: boolean(),
13431
+ enumValues: array(string()).optional()
13432
+ });
13433
+ var ComposableCapabilitiesSchema = object({ caps: array(object({
13434
+ cap: string(),
13435
+ fields: array(ComposableFieldSchema),
13436
+ /** Present for an item-array cap (`consumables.items`). */
13437
+ itemArray: object({
13438
+ path: string(),
13439
+ keyField: string()
13440
+ }).optional()
13441
+ })) });
13137
13442
  /** Where a block runs. The operator chooses — a block driving a device on an
13138
13443
  * agent is the reason placement is not fixed to the hub. */
13139
13444
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -13298,7 +13603,7 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
13298
13603
  }), method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }), method(object({}), CompositionListReadSchema, { auth: "admin" }), method(object({
13299
13604
  addonId: string().min(1),
13300
13605
  stableId: string().min(1)
13301
- }), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({
13606
+ }), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({ deviceType: _enum(DeviceType) }), ComposableCapabilitiesSchema, { auth: "admin" }), method(object({
13302
13607
  composition: CompositionSchema,
13303
13608
  blockId: string().optional()
13304
13609
  }), CompositionValidationSchema, {
@@ -13306,52 +13611,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
13306
13611
  auth: "admin",
13307
13612
  access: "view"
13308
13613
  });
13309
- var ComposerBlockSchema = object({
13310
- id: string().min(1),
13311
- name: string().min(1).max(120),
13312
- enabled: boolean(),
13313
- updatedAt: number(),
13314
- composition: CompositionSchema
13315
- });
13316
- /**
13317
- * A stored composition row that no longer PARSES — a schema a release
13318
- * tightened, a row written by a newer build. Sent by id so the composer keeps
13319
- * its device as a placeholder and reports the block `failed` naming the parse
13320
- * error. Leaving it out would read, twice, exactly like a delete (D49).
13321
- */
13322
- var ComposerUnreadableBlockSchema = object({
13323
- id: string().min(1),
13324
- /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
13325
- name: string().nullable(),
13326
- /** The parse error, in the operator's words. */
13327
- error: string()
13328
- });
13329
- method(object({
13330
- /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
13331
- integrationId: string().nullable(),
13332
- /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
13333
- storeLoaded: boolean(),
13334
- blocks: array(ComposerBlockSchema),
13335
- /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
13336
- restartBlockIds: array(string()),
13337
- /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
13338
- unreadableBlocks: array(ComposerUnreadableBlockSchema)
13339
- }), object({
13340
- blocks: array(object({
13341
- blockId: string(),
13342
- status: CompositionRunStatusSchema,
13343
- reason: string().optional()
13344
- })),
13345
- /**
13346
- * False when the composer declared and withdrew NOTHING (store not loaded,
13347
- * integration unknown, its own rows unread or read empty once). An empty
13348
- * apply the caller owes is paid off only by one the composer acted on (D49).
13349
- */
13350
- acted: boolean()
13351
- }), {
13352
- kind: "mutation",
13353
- auth: "admin"
13354
- }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
13355
13614
  /**
13356
13615
  * `custom-model-registry` — collection cap exposing operator-registered
13357
13616
  * custom detection models. Each provider (today: `addon-model-studio`)
@@ -15519,6 +15778,219 @@ method(object({
15519
15778
  caps: array(string()).readonly().optional()
15520
15779
  }), record(string(), record(string(), unknown().nullable())));
15521
15780
  /**
15781
+ * Doorbell button cap. Two kinds of providers coexist behind this cap
15782
+ * name (same pattern as `snapshot`):
15783
+ *
15784
+ * - **Native** providers: registered per-device by device-driver
15785
+ * addons via `ctx.registerNativeCap` — either on a
15786
+ * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
15787
+ * or directly on the camera (Reolink registers at camera level).
15788
+ * Emits an `onPressed` event every time the firmware pushes a
15789
+ * ring; status tracks the last press and a pressCount since start
15790
+ * (diagnostic).
15791
+ *
15792
+ * - **Wrapper** provider: the `virtual-doorbell` system builtin
15793
+ * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
15794
+ * device (contact / switch / event-emitter …) into a doorbell for
15795
+ * a camera. `defaultActive: false` — the operator explicitly binds
15796
+ * it per camera in the device-bindings UI, then picks the source
15797
+ * device + trigger in the per-device settings.
15798
+ *
15799
+ * The DeviceEventPropagator re-emits `onPressed` on the camera parent
15800
+ * — subscribers listening at the camera level receive ring events
15801
+ * with `via[]` populated. No code on the parent needed.
15802
+ */
15803
+ var DoorbellStatusSchema = object({
15804
+ /** Ms epoch of the last press. null = never observed since this provider started. */
15805
+ lastPressedAt: number().nullable(),
15806
+ /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
15807
+ pressCountSinceStart: number()
15808
+ });
15809
+ var DoorbellPressEventSchema = object({
15810
+ deviceId: number(),
15811
+ timestamp: number()
15812
+ });
15813
+ /**
15814
+ * The `doorbell-source` extension slot's editable value (D648): the camera's
15815
+ * virtual-doorbell trigger devices, exactly what the wrapper's
15816
+ * `doorbellSources` persists (as `{ deviceId }` records).
15817
+ */
15818
+ var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
15819
+ /**
15820
+ * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
15821
+ * doorbell, owned by the `virtual-doorbell` wrapper over its
15822
+ * `doorbellSources` store (D648). A source rings when one of its
15823
+ * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
15824
+ * different authority (`deviceManager.setWrapperActive`, D62) — the slot
15825
+ * reports it, it never writes it.
15826
+ */
15827
+ var DOORBELL_SOURCE_SLOT = {
15828
+ id: "doorbell-source",
15829
+ label: "Doorbell trigger devices",
15830
+ 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.",
15831
+ shape: "association",
15832
+ hostDeviceTypes: [DeviceType.Camera],
15833
+ sourceCaps: SOURCE_CAPS,
15834
+ cardinality: "many",
15835
+ value: DoorbellSourceSlotValueSchema
15836
+ };
15837
+ var doorbellCapability = {
15838
+ name: "doorbell",
15839
+ scope: "device",
15840
+ deviceNative: true,
15841
+ mode: "singleton",
15842
+ kind: "wrapper",
15843
+ defaultActive: false,
15844
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
15845
+ extensionSlots: [DOORBELL_SOURCE_SLOT],
15846
+ methods: {},
15847
+ events: {
15848
+ /**
15849
+ * Fires once per physical press. Reolink delivers via Baichuan
15850
+ * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
15851
+ * release/duration — it's a pulse.
15852
+ */
15853
+ onPressed: {
15854
+ data: DoorbellPressEventSchema,
15855
+ fromState: {
15856
+ field: "lastPressedAt",
15857
+ on: "advance"
15858
+ }
15859
+ } },
15860
+ status: {
15861
+ schema: DoorbellStatusSchema,
15862
+ kind: "push"
15863
+ },
15864
+ /**
15865
+ * Runtime-state slice — last press timestamp + lifetime press count.
15866
+ * Mirrored by the kernel and readable via
15867
+ * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
15868
+ * without subscribing.
15869
+ */
15870
+ runtimeState: DoorbellStatusSchema,
15871
+ /**
15872
+ * 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.
15873
+ *
15874
+ * See `RuntimeStateDurability`. Enforced by
15875
+ * `scripts/check-runtime-state-durability.ts`.
15876
+ */
15877
+ durability: "restored"
15878
+ };
15879
+ var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
15880
+ DeviceType.Camera, DeviceType.Camera;
15881
+ /** A slot's editable value, discriminated on `slot`. */
15882
+ var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
15883
+ DeviceType.Camera;
15884
+ var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
15885
+ state: literal("unreachable"),
15886
+ reason: string()
15887
+ })]);
15888
+ /** One provider of slots — the D554 source-listing row. */
15889
+ var ExtensionSourceSchema = object({
15890
+ /** The routing prefix of every `slotRef` this provider serves. */
15891
+ source: string(),
15892
+ label: string(),
15893
+ /** Stamped by the dispatcher from the registry (D557). */
15894
+ addonId: string().optional(),
15895
+ availability: ExtensionSourceAvailabilitySchema
15896
+ });
15897
+ /**
15898
+ * How one picked source stands. `missing` — no such device (deleted, or an id
15899
+ * that never existed); `foreign` — a device the slot's owner cannot read from
15900
+ * (a source owned by another addon); `unavailable` — it exists but is not a
15901
+ * valid source now (a container, which is never a pick). A source in any of
15902
+ * these states is SHOWN, never silently dropped or re-pointed.
15903
+ */
15904
+ var ExtensionSourceHealthSchema = _enum([
15905
+ "ok",
15906
+ "missing",
15907
+ "foreign",
15908
+ "unavailable"
15909
+ ]);
15910
+ var ExtensionSlotSourceSchema = object({
15911
+ deviceId: number().int(),
15912
+ /** The device's name, or null when it could not be resolved (`missing`). */
15913
+ name: string().nullable(),
15914
+ health: ExtensionSourceHealthSchema,
15915
+ detail: string().optional()
15916
+ });
15917
+ /**
15918
+ * A DIFFERENT authority that gates whether the slot's sources do anything —
15919
+ * reported read-only, named, never written through this contract (D62). The
15920
+ * virtual doorbell's sources ring only while the wrapper is bound to the
15921
+ * camera, and that binding belongs to `deviceManager.setWrapperActive`.
15922
+ * `unknown` means the gate could not be read; it is not "inactive" (D315).
15923
+ */
15924
+ var ExtensionSlotActivationSchema = object({
15925
+ state: _enum([
15926
+ "active",
15927
+ "inactive",
15928
+ "unknown"
15929
+ ]),
15930
+ authority: string(),
15931
+ detail: string().optional()
15932
+ });
15933
+ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
15934
+ state: literal("ok"),
15935
+ /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
15936
+ slotRef: string(),
15937
+ slot: ExtensionSlotIdSchema,
15938
+ /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
15939
+ authority: string(),
15940
+ activation: ExtensionSlotActivationSchema.nullable(),
15941
+ value: ExtensionSlotValueSchema,
15942
+ sources: array(ExtensionSlotSourceSchema),
15943
+ /**
15944
+ * Devices the owner links to the host ON ITS OWN, by structure, and that
15945
+ * are therefore not in `value` (D655): a camera's device-tree children, and
15946
+ * the child a picked container stands for (D356 — a container is never a
15947
+ * pick, its children are). Read-only; the editor shows them and may offer
15948
+ * per-device options on them (the linked-devices tracked-event opt-in).
15949
+ * Absent when the owner links nothing beyond the picks, and from an owner
15950
+ * older than D655.
15951
+ */
15952
+ impliedSources: array(ExtensionSlotSourceSchema).optional()
15953
+ }), object({
15954
+ state: literal("unreachable"),
15955
+ addonId: string(),
15956
+ reason: string()
15957
+ })]);
15958
+ var ExtensionCandidatesSchema = object({ candidates: array(object({
15959
+ deviceId: number().int(),
15960
+ name: string(),
15961
+ type: string(),
15962
+ location: string().nullable(),
15963
+ /** The container a child belongs to — "Spotlight 2" alone does not say which. */
15964
+ parentName: string().nullable(),
15965
+ /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
15966
+ suggested: boolean(),
15967
+ /** Why it is suggested ("same location"), null when it is not. */
15968
+ reason: string().nullable()
15969
+ })) });
15970
+ /**
15971
+ * What a write did. `none` — applied in place. `host` / `parent` — the owner
15972
+ * reloaded the host (or, for an accessory child, its parent) because the
15973
+ * write changed what the host REGISTERS. A slot never adds a capability to its
15974
+ * host — that is a composition (D663) — so today's owners answer `none`.
15975
+ */
15976
+ var ExtensionSetResultSchema = object({
15977
+ applied: literal(true),
15978
+ reload: _enum([
15979
+ "none",
15980
+ "host",
15981
+ "parent"
15982
+ ])
15983
+ });
15984
+ var ExtensionSlotRefInputSchema = object({
15985
+ deviceId: number().int(),
15986
+ slotRef: string().min(1)
15987
+ });
15988
+ var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
15989
+ method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
15990
+ kind: "mutation",
15991
+ auth: "admin"
15992
+ });
15993
+ /**
15522
15994
  * Per-field ownership (D663). A composition may CLAIM fields of a native
15523
15995
  * cap's runtime-state slice on an existing device: `replace` overlays the
15524
15996
  * claimed fields on the native slice, `add` builds a slice the device does
@@ -18528,17 +19000,25 @@ var NcScheduleSchema = object({
18528
19000
  */
18529
19001
  var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
18530
19002
  /**
19003
+ * How a summary window is SENT (D698): `rule` (absent) = ONE notification with
19004
+ * every section; `section` = one notification per section with something to
19005
+ * say (an unavailable section included), each titled by its section.
19006
+ */
19007
+ var NcStateSummarySplitSchema = _enum(["rule", "section"]);
19008
+ /**
18531
19009
  * `summary`: the rule sends NOTHING per event. When a window of `schedule`
18532
19010
  * CLOSES, it sends one notification with the current state of its kinds
18533
19011
  * (low batteries, consumables to replace, devices offline, updates
18534
- * available, ...), after its own filters. Nothing to report sends nothing.
19012
+ * available, ...), after its own filters — or, with `split: 'section'`
19013
+ * (D698), one notification per section. Nothing to report sends nothing.
18535
19014
  * The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
18536
19015
  * midnight crossing); the send time is each window's END. Refused on the
18537
19016
  * `alarm` family, which stays instant (`systemEventDeliveryProblems`).
18538
19017
  */
18539
19018
  var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
18540
19019
  mode: literal("summary"),
18541
- schedule: NcScheduleSchema
19020
+ schedule: NcScheduleSchema,
19021
+ split: NcStateSummarySplitSchema.optional()
18542
19022
  })]);
18543
19023
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
18544
19024
  var NcPlateMatcherSchema = object({
@@ -18678,8 +19158,14 @@ var NcSensorTransitionSchema = _enum(["raised", "cleared"]);
18678
19158
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
18679
19159
  var NcZoneConditionSchema = object({
18680
19160
  ids: array(string().min(1)).min(1),
18681
- /** Quantifier over `ids` — at least one / every one visited. */
18682
- match: _enum(["any", "all"]).default("any")
19161
+ /**
19162
+ * LEGACY quantifier over `ids`. Absent = `any` (at least one visited), which
19163
+ * is what both editors mean and all they write since D690: "all of" was
19164
+ * removed from the editors because on an immediate rule it asked one
19165
+ * detection to stand in every zone at once. Still ACCEPTED, and `all` still
19166
+ * evaluated, so a stored rule keeps parsing and meaning what it meant.
19167
+ */
19168
+ match: _enum(["any", "all"]).optional()
18683
19169
  });
18684
19170
  /**
18685
19171
  * The P1 condition set — a flat AND of groups; absent group = pass;
@@ -19183,10 +19669,12 @@ var NcMediaPolicySchema = object({
19183
19669
  /**
19184
19670
  * Cooldown GRANULARITY over the subject's class — how much a fired
19185
19671
  * notification suppresses.
19186
- * - `shared` (default, and the absent value) — one window for the whole
19187
- * rule/scope: a cat silences the next dog for `cooldownSec`.
19188
- * - `per-class` — an independent window per detected class, so cat→dog fires
19189
- * at once and cat→cat still waits.
19672
+ * - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
19673
+ * independent window per detected class: cat→dog fires at once, cat→cat
19674
+ * still waits.
19675
+ * - `shared` — one window for the whole rule/scope: a cat silences the next
19676
+ * dog for `cooldownSec`. Only written when an operator picks it; it is no
19677
+ * longer what an unset rule means.
19190
19678
  *
19191
19679
  * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
19192
19680
  * must not be swallowed by a bark's window (the precedent this generalizes —
@@ -19201,8 +19689,11 @@ var NcThrottleSchema = object({
19201
19689
  /**
19202
19690
  * Class granularity of the cooldown key. Optional rather than defaulted:
19203
19691
  * a Zod default does NOT run on the addon→addon cap path, so a persisted
19204
- * rule authored before this field simply carries none — and the engine
19205
- * reads absent as `shared`, the pre-existing behaviour.
19692
+ * rule authored before this field simply carries none. The engine used to
19693
+ * read absent as `shared` (D36); since 2026-10-01 it reads absent as
19694
+ * `per-class` — the operator's default — and only an explicit `shared`
19695
+ * still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
19696
+ * engine, and D36's dated note.
19206
19697
  */
19207
19698
  granularity: NcThrottleGranularitySchema.optional()
19208
19699
  });
@@ -19526,11 +20017,23 @@ var NcStateSummaryPreviewSectionSchema = object({
19526
20017
  reason: string().optional()
19527
20018
  });
19528
20019
  /**
20020
+ * One notification a previewed summary would send (D698): the whole summary on
20021
+ * a `rule` split (no `section`), one section's on a `section` split.
20022
+ */
20023
+ var NcStateSummaryPreviewRowSchema = object({
20024
+ section: string().optional(),
20025
+ /** The section's name on a per-section row; every reported section's, joined, on a combined one. */
20026
+ title: string(),
20027
+ text: string(),
20028
+ count: number().int().nonnegative()
20029
+ });
20030
+ /**
19529
20031
  * The summary a rule would send now. `empty` = nothing to report and every
19530
20032
  * section read: such a summary is NOT sent. `dropped` counts the open states
19531
20033
  * the rule's own filters (or a camera mute) left out, by reason.
19532
20034
  * `excludedGroups` names the kind groups selected that have no state to report
19533
- * (backups & exports).
20035
+ * (backups & exports). `split` and `rows` (D698) say how it would be sent —
20036
+ * optional, so an older hub's answer still parses.
19534
20037
  */
19535
20038
  var NcStateSummaryPreviewSchema = object({
19536
20039
  empty: boolean(),
@@ -19538,7 +20041,9 @@ var NcStateSummaryPreviewSchema = object({
19538
20041
  text: string(),
19539
20042
  sections: array(NcStateSummaryPreviewSectionSchema),
19540
20043
  dropped: record(string(), number().int().nonnegative()),
19541
- excludedGroups: array(string())
20044
+ excludedGroups: array(string()),
20045
+ split: NcStateSummarySplitSchema.optional(),
20046
+ rows: array(NcStateSummaryPreviewRowSchema).optional()
19542
20047
  });
19543
20048
  var NcTestResultSchema = object({
19544
20049
  recordId: string(),
@@ -20554,7 +21059,7 @@ function cameraSensorRefKey(ref) {
20554
21059
  }
20555
21060
  /** CS-1 accepts exactly one mode; CS-2 (D673) widens it to confirm / replace. */
20556
21061
  var CameraSensorsModeSchema = _enum(["in-addition"]);
20557
- object({
21062
+ var CameraSensorsConfigSchema = object({
20558
21063
  mode: CameraSensorsModeSchema,
20559
21064
  sensors: array(CameraSensorRefSchema).min(1).max(8)
20560
21065
  }).superRefine((value, ctx) => {
@@ -22459,7 +22964,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22459
22964
  trackIds: array(string()).min(1)
22460
22965
  }), object({
22461
22966
  deleted: number().int(),
22462
- failed: array(string()).readonly()
22967
+ failed: array(string()).readonly(),
22968
+ sparedMediaIds: array(number().int()).readonly().optional()
22463
22969
  }), {
22464
22970
  kind: "mutation",
22465
22971
  auth: "admin"
@@ -22468,7 +22974,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22468
22974
  deviceId: number(),
22469
22975
  trackId: string(),
22470
22976
  flags: TrackFlagsPatchSchema
22471
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
22977
+ }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(SetTrackRelationInputSchema, TrackRelationSchema, { kind: "mutation" }), method(ClearTrackRelationInputSchema, ClearTrackRelationResultSchema, { kind: "mutation" }), method(SetTrackPurityInputSchema, SetTrackPurityResultSchema, { kind: "mutation" }), method(ListTrackRelationsInputSchema, ListTrackRelationsResultSchema, { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
22472
22978
  kind: "query",
22473
22979
  auth: "admin"
22474
22980
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -24666,7 +25172,64 @@ var NodeInferenceDevicesSchema = object({
24666
25172
  reachable: boolean(),
24667
25173
  devices: array(NodeInferenceDeviceSchema).readonly()
24668
25174
  });
24669
- method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25175
+ /**
25176
+ * Pipeline Orchestrator capability — global load balancer + camera dispatcher.
25177
+ *
25178
+ * Lives on the hub. Tracks the camera-to-agent assignment map, listens to
25179
+ * device lifecycle events, queries each runner's capacity + hardware
25180
+ * profile, and dispatches `attachCamera` / `detachCamera` cap calls to the
25181
+ * appropriate runner instances. Persists assignments via the multi-level
25182
+ * settings store so they survive hub restarts.
25183
+ *
25184
+ * Strictly the control plane: never sees a frame, never calls inference,
25185
+ * never drains queues. The runner does that work locally on each agent.
25186
+ */
25187
+ /**
25188
+ * The input of `setCameraSensors` (G5, D676): the ONE typed write path of a
25189
+ * camera's attached sensors (D672). `config: null` removes the attachment —
25190
+ * the camera reads `not-configured` again, never `unreadable`.
25191
+ */
25192
+ var SetCameraSensorsInputSchema = object({
25193
+ deviceId: number().int().nonnegative(),
25194
+ /** `null` removes the attachment: the camera goes back to `not-configured`. */
25195
+ config: CameraSensorsConfigSchema.nullable()
25196
+ });
25197
+ /**
25198
+ * Why an early occupancy look (D691) was not scheduled.
25199
+ *
25200
+ * - `unknown-camera` — no session was ever dispatched for it, so there is no
25201
+ * node and no config to attach a burst with.
25202
+ * - `out-of-range` — the ask is negative or further out than the orchestrator
25203
+ * will hold a timer for; the parked-object cadence is the answer there.
25204
+ * - `no-burst-producer` — this build has no burst producer at all.
25205
+ * - `already-looked` — this camera's ONE early look since its last session has
25206
+ * been spent. A look's own burst can re-arm a flickering flip, and a look
25207
+ * per arm would chain a burst every ~30 s forever (review H2); the next
25208
+ * real session re-arms the budget.
25209
+ */
25210
+ var OccupancyLookRefusalSchema = _enum([
25211
+ "unknown-camera",
25212
+ "out-of-range",
25213
+ "no-burst-producer",
25214
+ "already-looked"
25215
+ ]);
25216
+ method(object({
25217
+ deviceId: number().int().nonnegative(),
25218
+ /** How long from NOW until the pending flip's sustain window ends. RELATIVE,
25219
+ * so the caller's clock and the orchestrator's never have to agree. */
25220
+ afterMs: number().finite(),
25221
+ /** Why, for the log. */
25222
+ reason: string()
25223
+ }), object({
25224
+ scheduled: boolean(),
25225
+ /** When `scheduled`: how long until the burst is dialled. */
25226
+ dueInMs: number().optional(),
25227
+ /** When not `scheduled`: why. */
25228
+ refusedBecause: OccupancyLookRefusalSchema.optional()
25229
+ }), {
25230
+ kind: "mutation",
25231
+ auth: "admin"
25232
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
24670
25233
  kind: "mutation",
24671
25234
  auth: "admin"
24672
25235
  }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
@@ -24820,7 +25383,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
24820
25383
  }), CameraSwitchGroupSchema, {
24821
25384
  kind: "mutation",
24822
25385
  auth: "admin"
24823
- }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
25386
+ }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(SetCameraSensorsInputSchema, object({ success: literal(true) }), {
25387
+ kind: "mutation",
25388
+ auth: "admin"
25389
+ }), method(_void(), DiskReconcileJobSchema, {
24824
25390
  kind: "mutation",
24825
25391
  auth: "admin"
24826
25392
  }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
@@ -27026,219 +27592,6 @@ DeviceType.Camera, method(object({
27026
27592
  auth: "protected"
27027
27593
  });
27028
27594
  /**
27029
- * Doorbell button cap. Two kinds of providers coexist behind this cap
27030
- * name (same pattern as `snapshot`):
27031
- *
27032
- * - **Native** providers: registered per-device by device-driver
27033
- * addons via `ctx.registerNativeCap` — either on a
27034
- * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
27035
- * or directly on the camera (Reolink registers at camera level).
27036
- * Emits an `onPressed` event every time the firmware pushes a
27037
- * ring; status tracks the last press and a pressCount since start
27038
- * (diagnostic).
27039
- *
27040
- * - **Wrapper** provider: the `virtual-doorbell` system builtin
27041
- * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
27042
- * device (contact / switch / event-emitter …) into a doorbell for
27043
- * a camera. `defaultActive: false` — the operator explicitly binds
27044
- * it per camera in the device-bindings UI, then picks the source
27045
- * device + trigger in the per-device settings.
27046
- *
27047
- * The DeviceEventPropagator re-emits `onPressed` on the camera parent
27048
- * — subscribers listening at the camera level receive ring events
27049
- * with `via[]` populated. No code on the parent needed.
27050
- */
27051
- var DoorbellStatusSchema = object({
27052
- /** Ms epoch of the last press. null = never observed since this provider started. */
27053
- lastPressedAt: number().nullable(),
27054
- /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
27055
- pressCountSinceStart: number()
27056
- });
27057
- var DoorbellPressEventSchema = object({
27058
- deviceId: number(),
27059
- timestamp: number()
27060
- });
27061
- /**
27062
- * The `doorbell-source` extension slot's editable value (D648): the camera's
27063
- * virtual-doorbell trigger devices, exactly what the wrapper's
27064
- * `doorbellSources` persists (as `{ deviceId }` records).
27065
- */
27066
- var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
27067
- /**
27068
- * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
27069
- * doorbell, owned by the `virtual-doorbell` wrapper over its
27070
- * `doorbellSources` store (D648). A source rings when one of its
27071
- * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
27072
- * different authority (`deviceManager.setWrapperActive`, D62) — the slot
27073
- * reports it, it never writes it.
27074
- */
27075
- var DOORBELL_SOURCE_SLOT = {
27076
- id: "doorbell-source",
27077
- label: "Doorbell trigger devices",
27078
- 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.",
27079
- shape: "association",
27080
- hostDeviceTypes: [DeviceType.Camera],
27081
- sourceCaps: SOURCE_CAPS,
27082
- cardinality: "many",
27083
- value: DoorbellSourceSlotValueSchema
27084
- };
27085
- var doorbellCapability = {
27086
- name: "doorbell",
27087
- scope: "device",
27088
- deviceNative: true,
27089
- mode: "singleton",
27090
- kind: "wrapper",
27091
- defaultActive: false,
27092
- deviceTypes: [DeviceType.Button, DeviceType.Camera],
27093
- extensionSlots: [DOORBELL_SOURCE_SLOT],
27094
- methods: {},
27095
- events: {
27096
- /**
27097
- * Fires once per physical press. Reolink delivers via Baichuan
27098
- * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
27099
- * release/duration — it's a pulse.
27100
- */
27101
- onPressed: {
27102
- data: DoorbellPressEventSchema,
27103
- fromState: {
27104
- field: "lastPressedAt",
27105
- on: "advance"
27106
- }
27107
- } },
27108
- status: {
27109
- schema: DoorbellStatusSchema,
27110
- kind: "push"
27111
- },
27112
- /**
27113
- * Runtime-state slice — last press timestamp + lifetime press count.
27114
- * Mirrored by the kernel and readable via
27115
- * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
27116
- * without subscribing.
27117
- */
27118
- runtimeState: DoorbellStatusSchema,
27119
- /**
27120
- * 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.
27121
- *
27122
- * See `RuntimeStateDurability`. Enforced by
27123
- * `scripts/check-runtime-state-durability.ts`.
27124
- */
27125
- durability: "restored"
27126
- };
27127
- var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
27128
- DeviceType.Camera, DeviceType.Camera;
27129
- /** A slot's editable value, discriminated on `slot`. */
27130
- var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
27131
- DeviceType.Camera;
27132
- var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
27133
- state: literal("unreachable"),
27134
- reason: string()
27135
- })]);
27136
- /** One provider of slots — the D554 source-listing row. */
27137
- var ExtensionSourceSchema = object({
27138
- /** The routing prefix of every `slotRef` this provider serves. */
27139
- source: string(),
27140
- label: string(),
27141
- /** Stamped by the dispatcher from the registry (D557). */
27142
- addonId: string().optional(),
27143
- availability: ExtensionSourceAvailabilitySchema
27144
- });
27145
- /**
27146
- * How one picked source stands. `missing` — no such device (deleted, or an id
27147
- * that never existed); `foreign` — a device the slot's owner cannot read from
27148
- * (a source owned by another addon); `unavailable` — it exists but is not a
27149
- * valid source now (a container, which is never a pick). A source in any of
27150
- * these states is SHOWN, never silently dropped or re-pointed.
27151
- */
27152
- var ExtensionSourceHealthSchema = _enum([
27153
- "ok",
27154
- "missing",
27155
- "foreign",
27156
- "unavailable"
27157
- ]);
27158
- var ExtensionSlotSourceSchema = object({
27159
- deviceId: number().int(),
27160
- /** The device's name, or null when it could not be resolved (`missing`). */
27161
- name: string().nullable(),
27162
- health: ExtensionSourceHealthSchema,
27163
- detail: string().optional()
27164
- });
27165
- /**
27166
- * A DIFFERENT authority that gates whether the slot's sources do anything —
27167
- * reported read-only, named, never written through this contract (D62). The
27168
- * virtual doorbell's sources ring only while the wrapper is bound to the
27169
- * camera, and that binding belongs to `deviceManager.setWrapperActive`.
27170
- * `unknown` means the gate could not be read; it is not "inactive" (D315).
27171
- */
27172
- var ExtensionSlotActivationSchema = object({
27173
- state: _enum([
27174
- "active",
27175
- "inactive",
27176
- "unknown"
27177
- ]),
27178
- authority: string(),
27179
- detail: string().optional()
27180
- });
27181
- var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
27182
- state: literal("ok"),
27183
- /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
27184
- slotRef: string(),
27185
- slot: ExtensionSlotIdSchema,
27186
- /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
27187
- authority: string(),
27188
- activation: ExtensionSlotActivationSchema.nullable(),
27189
- value: ExtensionSlotValueSchema,
27190
- sources: array(ExtensionSlotSourceSchema),
27191
- /**
27192
- * Devices the owner links to the host ON ITS OWN, by structure, and that
27193
- * are therefore not in `value` (D655): a camera's device-tree children, and
27194
- * the child a picked container stands for (D356 — a container is never a
27195
- * pick, its children are). Read-only; the editor shows them and may offer
27196
- * per-device options on them (the linked-devices tracked-event opt-in).
27197
- * Absent when the owner links nothing beyond the picks, and from an owner
27198
- * older than D655.
27199
- */
27200
- impliedSources: array(ExtensionSlotSourceSchema).optional()
27201
- }), object({
27202
- state: literal("unreachable"),
27203
- addonId: string(),
27204
- reason: string()
27205
- })]);
27206
- var ExtensionCandidatesSchema = object({ candidates: array(object({
27207
- deviceId: number().int(),
27208
- name: string(),
27209
- type: string(),
27210
- location: string().nullable(),
27211
- /** The container a child belongs to — "Spotlight 2" alone does not say which. */
27212
- parentName: string().nullable(),
27213
- /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
27214
- suggested: boolean(),
27215
- /** Why it is suggested ("same location"), null when it is not. */
27216
- reason: string().nullable()
27217
- })) });
27218
- /**
27219
- * What a write did. `none` — applied in place. `host` / `parent` — the owner
27220
- * reloaded the host (or, for an accessory child, its parent) because the
27221
- * write changed what the host REGISTERS. A slot never adds a capability to its
27222
- * host — that is a composition (D663) — so today's owners answer `none`.
27223
- */
27224
- var ExtensionSetResultSchema = object({
27225
- applied: literal(true),
27226
- reload: _enum([
27227
- "none",
27228
- "host",
27229
- "parent"
27230
- ])
27231
- });
27232
- var ExtensionSlotRefInputSchema = object({
27233
- deviceId: number().int(),
27234
- slotRef: string().min(1)
27235
- });
27236
- var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
27237
- method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
27238
- kind: "mutation",
27239
- auth: "admin"
27240
- });
27241
- /**
27242
27595
  * Optional client-side hints sent at session creation to help the provider
27243
27596
  * pick the best native source. All fields optional — a viewer that knows
27244
27597
  * nothing still gets a sane default. (Relocated from the retired `webrtc`
@@ -38404,47 +38757,6 @@ var zoneRulesCapability = {
38404
38757
  */
38405
38758
  durability: "restored"
38406
38759
  };
38407
- var NUMBER = {
38408
- kind: "fixed",
38409
- result: ["number"]
38410
- };
38411
- var BOOLEAN = {
38412
- kind: "fixed",
38413
- result: ["boolean"]
38414
- };
38415
- Object.freeze({
38416
- min: NUMBER,
38417
- max: NUMBER,
38418
- abs: NUMBER,
38419
- floor: NUMBER,
38420
- ceil: NUMBER,
38421
- sqrt: NUMBER,
38422
- round: NUMBER,
38423
- pow: NUMBER,
38424
- clamp: NUMBER,
38425
- avg: NUMBER,
38426
- sum: NUMBER,
38427
- age: NUMBER,
38428
- convert: NUMBER,
38429
- coalesce: { kind: "coalesce" },
38430
- any: BOOLEAN,
38431
- all: BOOLEAN,
38432
- within: BOOLEAN,
38433
- latest: {
38434
- kind: "fixed",
38435
- result: ["number", "null"]
38436
- },
38437
- number: {
38438
- kind: "fixed",
38439
- result: ["number", "null"]
38440
- },
38441
- rose: {
38442
- kind: "fixed",
38443
- result: ["number", "null"]
38444
- },
38445
- count: NUMBER
38446
- });
38447
- `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
38448
38760
  /**
38449
38761
  * Accessory device helpers — shared across drivers.
38450
38762
  *
@@ -42390,6 +42702,12 @@ Object.freeze({
42390
42702
  addonId: null,
42391
42703
  access: "view"
42392
42704
  },
42705
+ "coreBlocks.listComposableCaps": {
42706
+ capName: "core-blocks",
42707
+ capScope: "system",
42708
+ addonId: null,
42709
+ access: "view"
42710
+ },
42393
42711
  "coreBlocks.listCompositions": {
42394
42712
  capName: "core-blocks",
42395
42713
  capScope: "system",
@@ -42468,6 +42786,18 @@ Object.freeze({
42468
42786
  addonId: null,
42469
42787
  access: "view"
42470
42788
  },
42789
+ "databaseSnapshot.listDatabases": {
42790
+ capName: "database-snapshot",
42791
+ capScope: "system",
42792
+ addonId: null,
42793
+ access: "view"
42794
+ },
42795
+ "databaseSnapshot.writeSnapshot": {
42796
+ capName: "database-snapshot",
42797
+ capScope: "system",
42798
+ addonId: null,
42799
+ access: "create"
42800
+ },
42471
42801
  "dataStoreProvider.aggregate": {
42472
42802
  capName: "data-store-provider",
42473
42803
  capScope: "system",
@@ -45204,6 +45534,12 @@ Object.freeze({
45204
45534
  addonId: null,
45205
45535
  access: "create"
45206
45536
  },
45537
+ "pipelineAnalytics.clearTrackRelation": {
45538
+ capName: "pipeline-analytics",
45539
+ capScope: "device",
45540
+ addonId: null,
45541
+ access: "delete"
45542
+ },
45207
45543
  "pipelineAnalytics.clearTracks": {
45208
45544
  capName: "pipeline-analytics",
45209
45545
  capScope: "device",
@@ -45456,6 +45792,12 @@ Object.freeze({
45456
45792
  addonId: null,
45457
45793
  access: "view"
45458
45794
  },
45795
+ "pipelineAnalytics.listTrackRelations": {
45796
+ capName: "pipeline-analytics",
45797
+ capScope: "device",
45798
+ addonId: null,
45799
+ access: "view"
45800
+ },
45459
45801
  "pipelineAnalytics.listTracks": {
45460
45802
  capName: "pipeline-analytics",
45461
45803
  capScope: "device",
@@ -45570,6 +45912,18 @@ Object.freeze({
45570
45912
  addonId: null,
45571
45913
  access: "create"
45572
45914
  },
45915
+ "pipelineAnalytics.setTrackPurity": {
45916
+ capName: "pipeline-analytics",
45917
+ capScope: "device",
45918
+ addonId: null,
45919
+ access: "create"
45920
+ },
45921
+ "pipelineAnalytics.setTrackRelation": {
45922
+ capName: "pipeline-analytics",
45923
+ capScope: "device",
45924
+ addonId: null,
45925
+ access: "create"
45926
+ },
45573
45927
  "pipelineAnalytics.startStorageMigrationMove": {
45574
45928
  capName: "pipeline-analytics",
45575
45929
  capScope: "device",
@@ -46008,6 +46362,12 @@ Object.freeze({
46008
46362
  addonId: null,
46009
46363
  access: "delete"
46010
46364
  },
46365
+ "pipelineOrchestrator.requestOccupancyLook": {
46366
+ capName: "pipeline-orchestrator",
46367
+ capScope: "system",
46368
+ addonId: null,
46369
+ access: "create"
46370
+ },
46011
46371
  "pipelineOrchestrator.resetNodePipelineDefaults": {
46012
46372
  capName: "pipeline-orchestrator",
46013
46373
  capScope: "system",
@@ -46074,6 +46434,12 @@ Object.freeze({
46074
46434
  addonId: null,
46075
46435
  access: "create"
46076
46436
  },
46437
+ "pipelineOrchestrator.setCameraSensors": {
46438
+ capName: "pipeline-orchestrator",
46439
+ capScope: "system",
46440
+ addonId: null,
46441
+ access: "create"
46442
+ },
46077
46443
  "pipelineOrchestrator.setCameraStepOverride": {
46078
46444
  capName: "pipeline-orchestrator",
46079
46445
  capScope: "system",
@@ -49484,6 +49850,11 @@ Object.freeze({
49484
49850
  form: "single",
49485
49851
  optional: false
49486
49852
  }],
49853
+ "pipelineAnalytics.clearTrackRelation": [{
49854
+ name: "deviceId",
49855
+ form: "single",
49856
+ optional: false
49857
+ }],
49487
49858
  "pipelineAnalytics.clearTracks": [{
49488
49859
  name: "deviceId",
49489
49860
  form: "single",
@@ -49634,6 +50005,11 @@ Object.freeze({
49634
50005
  form: "single",
49635
50006
  optional: false
49636
50007
  }],
50008
+ "pipelineAnalytics.listTrackRelations": [{
50009
+ name: "deviceId",
50010
+ form: "single",
50011
+ optional: false
50012
+ }],
49637
50013
  "pipelineAnalytics.listTracks": [{
49638
50014
  name: "deviceId",
49639
50015
  form: "single",
@@ -49704,6 +50080,16 @@ Object.freeze({
49704
50080
  form: "single",
49705
50081
  optional: false
49706
50082
  }],
50083
+ "pipelineAnalytics.setTrackPurity": [{
50084
+ name: "deviceId",
50085
+ form: "single",
50086
+ optional: false
50087
+ }],
50088
+ "pipelineAnalytics.setTrackRelation": [{
50089
+ name: "deviceId",
50090
+ form: "single",
50091
+ optional: false
50092
+ }],
49707
50093
  "pipelineAnalytics.wipeAllAnalytics": [{
49708
50094
  name: "deviceId",
49709
50095
  form: "single",
@@ -49774,6 +50160,11 @@ Object.freeze({
49774
50160
  form: "single",
49775
50161
  optional: false
49776
50162
  }],
50163
+ "pipelineOrchestrator.requestOccupancyLook": [{
50164
+ name: "deviceId",
50165
+ form: "single",
50166
+ optional: false
50167
+ }],
49777
50168
  "pipelineOrchestrator.resolvePipeline": [{
49778
50169
  name: "deviceId",
49779
50170
  form: "single",
@@ -49784,6 +50175,11 @@ Object.freeze({
49784
50175
  form: "single",
49785
50176
  optional: false
49786
50177
  }],
50178
+ "pipelineOrchestrator.setCameraSensors": [{
50179
+ name: "deviceId",
50180
+ form: "single",
50181
+ optional: false
50182
+ }],
49787
50183
  "pipelineOrchestrator.setCameraStepOverride": [{
49788
50184
  name: "deviceId",
49789
50185
  form: "single",
@@ -50930,6 +51326,18 @@ var STATE_SUMMARY_VARS = [
50930
51326
  systemEventKinds: [...SUMMARISABLE],
50931
51327
  systemEventDeliveries: ["summary"]
50932
51328
  },
51329
+ {
51330
+ name: "summarySection",
51331
+ label: "Summary: this section",
51332
+ description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
51333
+ example: "Batterie scariche",
51334
+ group: "system",
51335
+ families: ["rule"],
51336
+ fields: [...RULE_TEXT],
51337
+ kinds: ["system"],
51338
+ systemEventKinds: [...SUMMARISABLE],
51339
+ systemEventDeliveries: ["summary"]
51340
+ },
50933
51341
  ...STATE_SUMMARY_SECTION_VARS.map((v) => ({
50934
51342
  name: v.name,
50935
51343
  label: v.label,
@@ -51006,6 +51414,37 @@ var STATE_SUMMARY_VARS = [
51006
51414
  [...RULE_TEXT],
51007
51415
  ...STATE_SUMMARY_VARS
51008
51416
  ];
51417
+ new Set([
51418
+ "disarmed",
51419
+ "armed_home",
51420
+ "armed_away",
51421
+ "armed_night",
51422
+ "armed_vacation",
51423
+ "armed_custom_bypass",
51424
+ "arming",
51425
+ "disarming",
51426
+ "pending",
51427
+ "triggered",
51428
+ "open",
51429
+ "opening",
51430
+ "closing",
51431
+ "closed",
51432
+ "stopped",
51433
+ "locked",
51434
+ "unlocked",
51435
+ "locking",
51436
+ "unlocking",
51437
+ "jammed",
51438
+ "on",
51439
+ "off",
51440
+ "home",
51441
+ "not_home",
51442
+ "matched",
51443
+ "diverged",
51444
+ "unknown",
51445
+ "latched",
51446
+ "live"
51447
+ ]);
51009
51448
  /**
51010
51449
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
51011
51450
  *