@camstack/addon-provider-wyze 0.2.120 → 0.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 +836 -399
  2. package/dist/addon.mjs +836 -399
  3. package/package.json +2 -2
package/dist/addon.mjs CHANGED
@@ -10,7 +10,7 @@ import { getCACertificates, setDefaultCACertificates } from "node:tls";
10
10
  //#region \0rolldown/runtime.js
11
11
  var __require$1 = /* @__PURE__ */ createRequire(import.meta.url);
12
12
  //#endregion
13
- //#region ../types/dist/event-category-C5xZWqz6.mjs
13
+ //#region ../types/dist/event-category-BGmz_oxW.mjs
14
14
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
15
15
  EventCategory["SystemBoot"] = "system.boot";
16
16
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -543,6 +543,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
543
543
  */
544
544
  EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
545
545
  EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
546
+ /**
547
+ * A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
548
+ * data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
549
+ * consumer is the orchestrator's camera-sensors bridge, which re-emits the
550
+ * camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
551
+ * for a camera with no attached sensor). Providers must not emit
552
+ * `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
553
+ * keeps it so (camera-grid is a named, deferred exception).
554
+ */
546
555
  EventCategory["ProviderMotion"] = "provider.motion";
547
556
  EventCategory["ProviderDetection"] = "provider.detection";
548
557
  EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
@@ -5381,7 +5390,7 @@ var ZodIssueCode = {
5381
5390
  var ZodFirstPartyTypeKind;
5382
5391
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5383
5392
  //#endregion
5384
- //#region ../types/dist/sleep-C-v96WpE.mjs
5393
+ //#region ../types/dist/sleep-CDCONfkt.mjs
5385
5394
  /**
5386
5395
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5387
5396
  * window to float samples (D455).
@@ -7424,7 +7433,7 @@ function errMsg(err) {
7424
7433
  return String(err);
7425
7434
  }
7426
7435
  //#endregion
7427
- //#region ../types/dist/composition-Dq42XWp0.mjs
7436
+ //#region ../types/dist/composition-43aqsZQj.mjs
7428
7437
  /**
7429
7438
  * The ffmpeg build every CamStack node downloads, per platform and arch.
7430
7439
  *
@@ -7481,13 +7490,12 @@ portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac
7481
7490
  * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
7482
7491
  * valutatore puro del suo FRONTE.
7483
7492
  *
7484
- * Viveva dentro il builtin virtual-doorbell
7485
- * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
7486
- * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
7487
- * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
7488
- * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
7489
- * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
7490
- * SPOSTA qui e il doorbell la ri-esporta.
7493
+ * UNA tabella per tutti quelli che chiedono "questo device è ALTO?": il
7494
+ * trigger `RecordingTriggers.sensorDeviceIds` del recorder, i marker dei
7495
+ * sensori della post-analysis, il bridge camera-sensors dell'orchestratore e
7496
+ * le sorgenti di un campanello composto (`doorbellFeatureSources`, D671).
7497
+ * Una seconda copia divergerebbe alla prima cap aggiunta, e il sintomo — "il
7498
+ * sensore fa suonare il campanello ma non registra" — è esattamente D62.
7491
7499
  *
7492
7500
  * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
7493
7501
  * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
@@ -7513,8 +7521,6 @@ var SOURCE_CAP_ACTIVE_FIELD = {
7513
7521
  vibration: "detected",
7514
7522
  tamper: "tampered"
7515
7523
  };
7516
- /** Cap names whose presence in a device's bindings qualify it as a source. */
7517
- var SOURCE_CAPS = Object.keys(SOURCE_CAP_ACTIVE_FIELD);
7518
7524
  /**
7519
7525
  * Error types for the safe expression engine. Two distinct classes so callers
7520
7526
  * can tell a compile-time (grammar) failure from a runtime (evaluation)
@@ -8970,6 +8976,82 @@ var ArchivedDebugNoteQueryInputSchema = object({
8970
8976
  /** Max rows returned, newest-first. */
8971
8977
  limit: number().int().min(1).max(1e3).optional()
8972
8978
  });
8979
+ var TrackRelationKindSchema = _enum(["same-subject", "different-subjects"]);
8980
+ var TrackSideSchema = _enum(["before", "after"]);
8981
+ var TrackPurityValueSchema = _enum(["mixed", "not-a-subject"]);
8982
+ var TrackRelationSchema = object({
8983
+ id: string(),
8984
+ deviceId: number().int(),
8985
+ leftTrackId: string(),
8986
+ rightTrackId: string(),
8987
+ leftSide: TrackSideSchema.nullable(),
8988
+ rightSide: TrackSideSchema.nullable(),
8989
+ relation: TrackRelationKindSchema,
8990
+ presence: literal("continuous").nullable(),
8991
+ leftStartedAt: number().int().nullable(),
8992
+ rightStartedAt: number().int().nullable(),
8993
+ createdAt: number().int(),
8994
+ updatedAt: number().int(),
8995
+ author: string().nullable()
8996
+ });
8997
+ var TrackPuritySchema = object({
8998
+ id: string(),
8999
+ deviceId: number().int(),
9000
+ sourceTrackId: string(),
9001
+ purity: TrackPurityValueSchema,
9002
+ switchAtMs: number().int().nullable(),
9003
+ startedAt: number().int().nullable(),
9004
+ createdAt: number().int(),
9005
+ updatedAt: number().int(),
9006
+ author: string().nullable()
9007
+ });
9008
+ var SetTrackRelationInputSchema = object({
9009
+ deviceId: number().int(),
9010
+ trackId: string().min(1),
9011
+ otherTrackId: string().min(1),
9012
+ relation: TrackRelationKindSchema,
9013
+ presence: literal("continuous").optional(),
9014
+ trackSide: TrackSideSchema.optional(),
9015
+ otherSide: TrackSideSchema.optional()
9016
+ });
9017
+ var ClearTrackRelationInputSchema = object({
9018
+ deviceId: number().int(),
9019
+ trackId: string().min(1),
9020
+ otherTrackId: string().min(1)
9021
+ });
9022
+ var ClearTrackRelationResultSchema = object({ cleared: boolean() });
9023
+ var SetTrackPurityInputSchema = object({
9024
+ deviceId: number().int(),
9025
+ trackId: string().min(1),
9026
+ purity: _enum([
9027
+ "pure",
9028
+ "mixed",
9029
+ "not-a-subject"
9030
+ ]),
9031
+ switchAtMs: number().int().optional()
9032
+ });
9033
+ /** `null` when `pure` cleared the row. */
9034
+ var SetTrackPurityResultSchema = object({ purity: TrackPuritySchema.nullable() });
9035
+ var ListTrackRelationsInputSchema = object({
9036
+ deviceId: number().int(),
9037
+ trackId: string().optional(),
9038
+ since: number().int().optional(),
9039
+ until: number().int().optional(),
9040
+ limit: number().int().min(1).max(5e3).optional()
9041
+ });
9042
+ var ListTrackRelationsResultSchema = object({
9043
+ relations: array(TrackRelationSchema).readonly(),
9044
+ purities: array(TrackPuritySchema).readonly(),
9045
+ truncated: boolean()
9046
+ });
9047
+ _enum([
9048
+ "unknown-track",
9049
+ "cross-device",
9050
+ "self-relation",
9051
+ "contradiction",
9052
+ "switch-outside-track",
9053
+ "switch-needs-mixed"
9054
+ ]);
8973
9055
  /**
8974
9056
  * Ops-log — the durable, append-only operations audit shared by the
8975
9057
  * recordings and events management surfaces.
@@ -9168,7 +9250,7 @@ var RecordingTriggersSchema = object({
9168
9250
  *
9169
9251
  * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
9170
9252
  * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
9171
- * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
9253
+ * la stessa del campanello composto (D671). Ed è il FRONTE, non
9172
9254
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
9173
9255
  * registrare.
9174
9256
  */
@@ -11523,6 +11605,68 @@ method(object({
11523
11605
  password: string()
11524
11606
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
11525
11607
  /**
11608
+ * How long one snapshot may take end to end: the pinned copy of the whole
11609
+ * database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
11610
+ * disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
11611
+ * generous because a timeout fails the whole backup run.
11612
+ */
11613
+ var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
11614
+ /**
11615
+ * The databases an owner snapshots — declared by the OWNER, so a caller never
11616
+ * guesses which file is live from what sits beside it (a cleanly closed
11617
+ * database has no sidecars and is just as owned). Paths are absolute on the
11618
+ * owner's host.
11619
+ */
11620
+ var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
11621
+ /** One b-tree table of the snapshot and the rows it holds. */
11622
+ var DatabaseSnapshotTableSchema = object({
11623
+ name: string(),
11624
+ rows: number().int().nonnegative()
11625
+ });
11626
+ /**
11627
+ * What the owner wrote. Every path is ABSOLUTE on the owner's host — the
11628
+ * caller pins the call to its own node, so it can read the file; a caller
11629
+ * that finds the path outside its own data root refuses it rather than
11630
+ * archiving something it cannot place.
11631
+ */
11632
+ var DatabaseSnapshotResultSchema = object({
11633
+ /** The live database the snapshot copies. Never to be copied as a file. */
11634
+ livePath: string(),
11635
+ /** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
11636
+ snapshotPath: string(),
11637
+ sizeBytes: number().int().nonnegative(),
11638
+ pageCount: number().int().nonnegative(),
11639
+ pageSize: number().int().positive(),
11640
+ /**
11641
+ * Every b-tree table with its row count. Read inside the SAME read
11642
+ * transaction the copy was taken from, and found EQUAL on the copy — so
11643
+ * this is the content of the snapshot, not an estimate of the source.
11644
+ */
11645
+ tables: array(DatabaseSnapshotTableSchema),
11646
+ /** Wall time of the pinned copy (row counts included). */
11647
+ copyMs: number().nonnegative(),
11648
+ /** Wall time of the checks on the copy (`integrity_check`, row counts). */
11649
+ verifyMs: number().nonnegative(),
11650
+ /** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
11651
+ takenAt: number()
11652
+ });
11653
+ /**
11654
+ * A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
11655
+ * the same facts, with both paths relative to the archive root (the node's
11656
+ * data dir), because an archive outlives the host that made it.
11657
+ */
11658
+ var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
11659
+ /** Archive-relative path of the live database the archive does NOT carry. */
11660
+ livePath: string(),
11661
+ /** Archive-relative path of the verified copy it carries in its place. */
11662
+ snapshotPath: string()
11663
+ });
11664
+ method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }), method(object({}), DatabaseSnapshotResultSchema, {
11665
+ kind: "mutation",
11666
+ auth: "admin",
11667
+ timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
11668
+ });
11669
+ /**
11526
11670
  * Orchestrator-side destination metadata. The orchestrator computes
11527
11671
  * `id = <addonId>:<subId>` from its provider lookup so consumers
11528
11672
  * (admin UI, restore flow) see one canonical key.
@@ -11633,7 +11777,12 @@ var ArchiveManifestSchema = object({
11633
11777
  locations: array(string()),
11634
11778
  entries: array(ArchiveEntrySchema),
11635
11779
  totalBytes: number(),
11636
- totalFiles: number()
11780
+ totalFiles: number(),
11781
+ /**
11782
+ * Live SQLite databases this archive carries as their OWNER's verified
11783
+ * snapshot instead of as files (D693). Absent on archives made before.
11784
+ */
11785
+ sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
11637
11786
  });
11638
11787
  var LocationStatSchema = object({
11639
11788
  name: string(),
@@ -13159,6 +13308,116 @@ var CompositionBlockStateSchema = object({
13159
13308
  reason: string().optional(),
13160
13309
  fields: array(CompositionFieldStateSchema)
13161
13310
  });
13311
+ var ComposerBlockSchema = object({
13312
+ id: string().min(1),
13313
+ name: string().min(1).max(120),
13314
+ enabled: boolean(),
13315
+ updatedAt: number(),
13316
+ composition: CompositionSchema
13317
+ });
13318
+ /**
13319
+ * A stored composition row that no longer PARSES — a schema a release
13320
+ * tightened, a row written by a newer build. Sent by id so the composer keeps
13321
+ * its device as a placeholder and reports the block `failed` naming the parse
13322
+ * error. Leaving it out would read, twice, exactly like a delete (D49).
13323
+ */
13324
+ var ComposerUnreadableBlockSchema = object({
13325
+ id: string().min(1),
13326
+ /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
13327
+ name: string().nullable(),
13328
+ /** The parse error, in the operator's words. */
13329
+ error: string()
13330
+ });
13331
+ method(object({
13332
+ /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
13333
+ integrationId: string().nullable(),
13334
+ /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
13335
+ storeLoaded: boolean(),
13336
+ blocks: array(ComposerBlockSchema),
13337
+ /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
13338
+ restartBlockIds: array(string()),
13339
+ /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
13340
+ unreadableBlocks: array(ComposerUnreadableBlockSchema)
13341
+ }), object({
13342
+ blocks: array(object({
13343
+ blockId: string(),
13344
+ status: CompositionRunStatusSchema,
13345
+ reason: string().optional()
13346
+ })),
13347
+ /**
13348
+ * False when the composer declared and withdrew NOTHING (store not loaded,
13349
+ * integration unknown, its own rows unread or read empty once). An empty
13350
+ * apply the caller owes is paid off only by one the composer acted on (D49).
13351
+ */
13352
+ acted: boolean()
13353
+ }), {
13354
+ kind: "mutation",
13355
+ auth: "admin"
13356
+ }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
13357
+ var NUMBER = {
13358
+ kind: "fixed",
13359
+ result: ["number"]
13360
+ };
13361
+ var BOOLEAN = {
13362
+ kind: "fixed",
13363
+ result: ["boolean"]
13364
+ };
13365
+ Object.freeze({
13366
+ min: NUMBER,
13367
+ max: NUMBER,
13368
+ abs: NUMBER,
13369
+ floor: NUMBER,
13370
+ ceil: NUMBER,
13371
+ sqrt: NUMBER,
13372
+ round: NUMBER,
13373
+ pow: NUMBER,
13374
+ clamp: NUMBER,
13375
+ avg: NUMBER,
13376
+ sum: NUMBER,
13377
+ age: NUMBER,
13378
+ convert: NUMBER,
13379
+ coalesce: { kind: "coalesce" },
13380
+ any: BOOLEAN,
13381
+ all: BOOLEAN,
13382
+ within: BOOLEAN,
13383
+ latest: {
13384
+ kind: "fixed",
13385
+ result: ["number", "null"]
13386
+ },
13387
+ number: {
13388
+ kind: "fixed",
13389
+ result: ["number", "null"]
13390
+ },
13391
+ rose: {
13392
+ kind: "fixed",
13393
+ result: ["number", "null"]
13394
+ },
13395
+ count: NUMBER
13396
+ });
13397
+ `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
13398
+ /**
13399
+ * What a composition may BUILD on a device type (G2, D676): the caps a new
13400
+ * device of that type, or an existing one that lacks them, can be given. The
13401
+ * blockers are the validator's own refusal codes, and a spec compares this
13402
+ * listing with `planComposition` for every capability — the editor can never
13403
+ * offer a feature the save would refuse for the same reason.
13404
+ */
13405
+ var ComposableFieldSchema = object({
13406
+ path: string(),
13407
+ kind: CompositionFieldKindSchema,
13408
+ nullable: boolean(),
13409
+ required: boolean(),
13410
+ enumValues: array(string()).optional()
13411
+ });
13412
+ var ComposableCapabilitiesSchema = object({ caps: array(object({
13413
+ cap: string(),
13414
+ fields: array(ComposableFieldSchema),
13415
+ /** Present for an item-array cap (`consumables.items`). */
13416
+ itemArray: object({
13417
+ path: string(),
13418
+ keyField: string()
13419
+ }).optional()
13420
+ })) });
13162
13421
  /** Where a block runs. The operator chooses — a block driving a device on an
13163
13422
  * agent is the reason placement is not fixed to the hub. */
13164
13423
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -13323,7 +13582,7 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
13323
13582
  }), method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }), method(object({}), CompositionListReadSchema, { auth: "admin" }), method(object({
13324
13583
  addonId: string().min(1),
13325
13584
  stableId: string().min(1)
13326
- }), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({
13585
+ }), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({ deviceType: _enum(DeviceType) }), ComposableCapabilitiesSchema, { auth: "admin" }), method(object({
13327
13586
  composition: CompositionSchema,
13328
13587
  blockId: string().optional()
13329
13588
  }), CompositionValidationSchema, {
@@ -13331,52 +13590,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
13331
13590
  auth: "admin",
13332
13591
  access: "view"
13333
13592
  });
13334
- var ComposerBlockSchema = object({
13335
- id: string().min(1),
13336
- name: string().min(1).max(120),
13337
- enabled: boolean(),
13338
- updatedAt: number(),
13339
- composition: CompositionSchema
13340
- });
13341
- /**
13342
- * A stored composition row that no longer PARSES — a schema a release
13343
- * tightened, a row written by a newer build. Sent by id so the composer keeps
13344
- * its device as a placeholder and reports the block `failed` naming the parse
13345
- * error. Leaving it out would read, twice, exactly like a delete (D49).
13346
- */
13347
- var ComposerUnreadableBlockSchema = object({
13348
- id: string().min(1),
13349
- /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
13350
- name: string().nullable(),
13351
- /** The parse error, in the operator's words. */
13352
- error: string()
13353
- });
13354
- method(object({
13355
- /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
13356
- integrationId: string().nullable(),
13357
- /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
13358
- storeLoaded: boolean(),
13359
- blocks: array(ComposerBlockSchema),
13360
- /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
13361
- restartBlockIds: array(string()),
13362
- /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
13363
- unreadableBlocks: array(ComposerUnreadableBlockSchema)
13364
- }), object({
13365
- blocks: array(object({
13366
- blockId: string(),
13367
- status: CompositionRunStatusSchema,
13368
- reason: string().optional()
13369
- })),
13370
- /**
13371
- * False when the composer declared and withdrew NOTHING (store not loaded,
13372
- * integration unknown, its own rows unread or read empty once). An empty
13373
- * apply the caller owes is paid off only by one the composer acted on (D49).
13374
- */
13375
- acted: boolean()
13376
- }), {
13377
- kind: "mutation",
13378
- auth: "admin"
13379
- }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
13380
13593
  /**
13381
13594
  * `custom-model-registry` — collection cap exposing operator-registered
13382
13595
  * custom detection models. Each provider (today: `addon-model-studio`)
@@ -15430,6 +15643,121 @@ method(object({
15430
15643
  deviceIds: array(number()).readonly(),
15431
15644
  caps: array(string()).readonly().optional()
15432
15645
  }), record(string(), record(string(), unknown().nullable())));
15646
+ var ExtensionSlotIdSchema = _enum(["linked-devices"]);
15647
+ DeviceType.Camera;
15648
+ /** A slot's editable value, discriminated on `slot`. */
15649
+ var ExtensionSlotValueSchema = discriminatedUnion("slot", [LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
15650
+ DeviceType.Camera;
15651
+ var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
15652
+ state: literal("unreachable"),
15653
+ reason: string()
15654
+ })]);
15655
+ /** One provider of slots — the D554 source-listing row. */
15656
+ var ExtensionSourceSchema = object({
15657
+ /** The routing prefix of every `slotRef` this provider serves. */
15658
+ source: string(),
15659
+ label: string(),
15660
+ /** Stamped by the dispatcher from the registry (D557). */
15661
+ addonId: string().optional(),
15662
+ availability: ExtensionSourceAvailabilitySchema
15663
+ });
15664
+ /**
15665
+ * How one picked source stands. `missing` — no such device (deleted, or an id
15666
+ * that never existed); `foreign` — a device the slot's owner cannot read from
15667
+ * (a source owned by another addon); `unavailable` — it exists but is not a
15668
+ * valid source now (a container, which is never a pick). A source in any of
15669
+ * these states is SHOWN, never silently dropped or re-pointed.
15670
+ */
15671
+ var ExtensionSourceHealthSchema = _enum([
15672
+ "ok",
15673
+ "missing",
15674
+ "foreign",
15675
+ "unavailable"
15676
+ ]);
15677
+ var ExtensionSlotSourceSchema = object({
15678
+ deviceId: number().int(),
15679
+ /** The device's name, or null when it could not be resolved (`missing`). */
15680
+ name: string().nullable(),
15681
+ health: ExtensionSourceHealthSchema,
15682
+ detail: string().optional()
15683
+ });
15684
+ /**
15685
+ * A DIFFERENT authority that gates whether the slot's sources do anything —
15686
+ * reported read-only, named, never written through this contract (D62) — e.g.
15687
+ * a slot whose sources act only while a wrapper is bound to the host, a
15688
+ * binding that belongs to `deviceManager.setWrapperActive`. No slot reports
15689
+ * one today (`linked-devices` answers `null`). `unknown` means the gate could
15690
+ * not be read; it is not "inactive" (D315).
15691
+ */
15692
+ var ExtensionSlotActivationSchema = object({
15693
+ state: _enum([
15694
+ "active",
15695
+ "inactive",
15696
+ "unknown"
15697
+ ]),
15698
+ authority: string(),
15699
+ detail: string().optional()
15700
+ });
15701
+ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
15702
+ state: literal("ok"),
15703
+ /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
15704
+ slotRef: string(),
15705
+ slot: ExtensionSlotIdSchema,
15706
+ /** Names the store written (D62), e.g. `device-manager:_linkedDeviceIds`. */
15707
+ authority: string(),
15708
+ activation: ExtensionSlotActivationSchema.nullable(),
15709
+ value: ExtensionSlotValueSchema,
15710
+ sources: array(ExtensionSlotSourceSchema),
15711
+ /**
15712
+ * Devices the owner links to the host ON ITS OWN, by structure, and that
15713
+ * are therefore not in `value` (D655): a camera's device-tree children, and
15714
+ * the child a picked container stands for (D356 — a container is never a
15715
+ * pick, its children are). Read-only; the editor shows them and may offer
15716
+ * per-device options on them (the linked-devices tracked-event opt-in).
15717
+ * Absent when the owner links nothing beyond the picks, and from an owner
15718
+ * older than D655.
15719
+ */
15720
+ impliedSources: array(ExtensionSlotSourceSchema).optional()
15721
+ }), object({
15722
+ state: literal("unreachable"),
15723
+ addonId: string(),
15724
+ reason: string()
15725
+ })]);
15726
+ var ExtensionCandidatesSchema = object({ candidates: array(object({
15727
+ deviceId: number().int(),
15728
+ name: string(),
15729
+ type: string(),
15730
+ location: string().nullable(),
15731
+ /** The container a child belongs to — "Spotlight 2" alone does not say which. */
15732
+ parentName: string().nullable(),
15733
+ /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
15734
+ suggested: boolean(),
15735
+ /** Why it is suggested ("same location"), null when it is not. */
15736
+ reason: string().nullable()
15737
+ })) });
15738
+ /**
15739
+ * What a write did. `none` — applied in place. `host` / `parent` — the owner
15740
+ * reloaded the host (or, for an accessory child, its parent) because the
15741
+ * write changed what the host REGISTERS. A slot never adds a capability to its
15742
+ * host — that is a composition (D663) — so today's owners answer `none`.
15743
+ */
15744
+ var ExtensionSetResultSchema = object({
15745
+ applied: literal(true),
15746
+ reload: _enum([
15747
+ "none",
15748
+ "host",
15749
+ "parent"
15750
+ ])
15751
+ });
15752
+ var ExtensionSlotRefInputSchema = object({
15753
+ deviceId: number().int(),
15754
+ slotRef: string().min(1)
15755
+ });
15756
+ var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
15757
+ method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
15758
+ kind: "mutation",
15759
+ auth: "admin"
15760
+ });
15433
15761
  /**
15434
15762
  * Per-field ownership (D663). A composition may CLAIM fields of a native
15435
15763
  * cap's runtime-state slice on an existing device: `replace` overlays the
@@ -18440,17 +18768,25 @@ var NcScheduleSchema = object({
18440
18768
  */
18441
18769
  var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
18442
18770
  /**
18771
+ * How a summary window is SENT (D698): `rule` (absent) = ONE notification with
18772
+ * every section; `section` = one notification per section with something to
18773
+ * say (an unavailable section included), each titled by its section.
18774
+ */
18775
+ var NcStateSummarySplitSchema = _enum(["rule", "section"]);
18776
+ /**
18443
18777
  * `summary`: the rule sends NOTHING per event. When a window of `schedule`
18444
18778
  * CLOSES, it sends one notification with the current state of its kinds
18445
18779
  * (low batteries, consumables to replace, devices offline, updates
18446
- * available, ...), after its own filters. Nothing to report sends nothing.
18780
+ * available, ...), after its own filters — or, with `split: 'section'`
18781
+ * (D698), one notification per section. Nothing to report sends nothing.
18447
18782
  * The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
18448
18783
  * midnight crossing); the send time is each window's END. Refused on the
18449
18784
  * `alarm` family, which stays instant (`systemEventDeliveryProblems`).
18450
18785
  */
18451
18786
  var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
18452
18787
  mode: literal("summary"),
18453
- schedule: NcScheduleSchema
18788
+ schedule: NcScheduleSchema,
18789
+ split: NcStateSummarySplitSchema.optional()
18454
18790
  })]);
18455
18791
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
18456
18792
  var NcPlateMatcherSchema = object({
@@ -18590,8 +18926,14 @@ var NcSensorTransitionSchema = _enum(["raised", "cleared"]);
18590
18926
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
18591
18927
  var NcZoneConditionSchema = object({
18592
18928
  ids: array(string().min(1)).min(1),
18593
- /** Quantifier over `ids` — at least one / every one visited. */
18594
- match: _enum(["any", "all"]).default("any")
18929
+ /**
18930
+ * LEGACY quantifier over `ids`. Absent = `any` (at least one visited), which
18931
+ * is what both editors mean and all they write since D690: "all of" was
18932
+ * removed from the editors because on an immediate rule it asked one
18933
+ * detection to stand in every zone at once. Still ACCEPTED, and `all` still
18934
+ * evaluated, so a stored rule keeps parsing and meaning what it meant.
18935
+ */
18936
+ match: _enum(["any", "all"]).optional()
18595
18937
  });
18596
18938
  /**
18597
18939
  * The P1 condition set — a flat AND of groups; absent group = pass;
@@ -19095,10 +19437,12 @@ var NcMediaPolicySchema = object({
19095
19437
  /**
19096
19438
  * Cooldown GRANULARITY over the subject's class — how much a fired
19097
19439
  * notification suppresses.
19098
- * - `shared` (default, and the absent value) — one window for the whole
19099
- * rule/scope: a cat silences the next dog for `cooldownSec`.
19100
- * - `per-class` — an independent window per detected class, so cat→dog fires
19101
- * at once and cat→cat still waits.
19440
+ * - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
19441
+ * independent window per detected class: cat→dog fires at once, cat→cat
19442
+ * still waits.
19443
+ * - `shared` — one window for the whole rule/scope: a cat silences the next
19444
+ * dog for `cooldownSec`. Only written when an operator picks it; it is no
19445
+ * longer what an unset rule means.
19102
19446
  *
19103
19447
  * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
19104
19448
  * must not be swallowed by a bark's window (the precedent this generalizes —
@@ -19113,8 +19457,11 @@ var NcThrottleSchema = object({
19113
19457
  /**
19114
19458
  * Class granularity of the cooldown key. Optional rather than defaulted:
19115
19459
  * a Zod default does NOT run on the addon→addon cap path, so a persisted
19116
- * rule authored before this field simply carries none — and the engine
19117
- * reads absent as `shared`, the pre-existing behaviour.
19460
+ * rule authored before this field simply carries none. The engine used to
19461
+ * read absent as `shared` (D36); since 2026-10-01 it reads absent as
19462
+ * `per-class` — the operator's default — and only an explicit `shared`
19463
+ * still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
19464
+ * engine, and D36's dated note.
19118
19465
  */
19119
19466
  granularity: NcThrottleGranularitySchema.optional()
19120
19467
  });
@@ -19438,11 +19785,23 @@ var NcStateSummaryPreviewSectionSchema = object({
19438
19785
  reason: string().optional()
19439
19786
  });
19440
19787
  /**
19788
+ * One notification a previewed summary would send (D698): the whole summary on
19789
+ * a `rule` split (no `section`), one section's on a `section` split.
19790
+ */
19791
+ var NcStateSummaryPreviewRowSchema = object({
19792
+ section: string().optional(),
19793
+ /** The section's name on a per-section row; every reported section's, joined, on a combined one. */
19794
+ title: string(),
19795
+ text: string(),
19796
+ count: number().int().nonnegative()
19797
+ });
19798
+ /**
19441
19799
  * The summary a rule would send now. `empty` = nothing to report and every
19442
19800
  * section read: such a summary is NOT sent. `dropped` counts the open states
19443
19801
  * the rule's own filters (or a camera mute) left out, by reason.
19444
19802
  * `excludedGroups` names the kind groups selected that have no state to report
19445
- * (backups & exports).
19803
+ * (backups & exports). `split` and `rows` (D698) say how it would be sent —
19804
+ * optional, so an older hub's answer still parses.
19446
19805
  */
19447
19806
  var NcStateSummaryPreviewSchema = object({
19448
19807
  empty: boolean(),
@@ -19450,7 +19809,9 @@ var NcStateSummaryPreviewSchema = object({
19450
19809
  text: string(),
19451
19810
  sections: array(NcStateSummaryPreviewSectionSchema),
19452
19811
  dropped: record(string(), number().int().nonnegative()),
19453
- excludedGroups: array(string())
19812
+ excludedGroups: array(string()),
19813
+ split: NcStateSummarySplitSchema.optional(),
19814
+ rows: array(NcStateSummaryPreviewRowSchema).optional()
19454
19815
  });
19455
19816
  var NcTestResultSchema = object({
19456
19817
  recordId: string(),
@@ -20464,12 +20825,26 @@ var CameraSensorRefSchema = object({
20464
20825
  function cameraSensorRefKey(ref) {
20465
20826
  return `${ref.addonId}/${ref.stableId}`;
20466
20827
  }
20467
- /** CS-1 accepts exactly one mode; CS-2 (D673) widens it to confirm / replace. */
20468
- var CameraSensorsModeSchema = _enum(["in-addition"]);
20469
- object({
20470
- mode: CameraSensorsModeSchema,
20471
- sensors: array(CameraSensorRefSchema).min(1).max(8)
20472
- }).superRefine((value, ctx) => {
20828
+ /**
20829
+ * A sensor's mode (D673). `in-addition`: its motion is the camera's motion too.
20830
+ * `replace`: its motion is the camera's, and while one is READY the camera's
20831
+ * own motion no longer counts on its own. `confirm`: while one is READY the
20832
+ * camera's own motion counts only while a confirm sensor is active — with or
20833
+ * without a replace sensor (spec C2, the controller's ruling on Q1).
20834
+ */
20835
+ var CameraSensorModeSchema = _enum([
20836
+ "in-addition",
20837
+ "confirm",
20838
+ "replace"
20839
+ ]);
20840
+ /** A stored sensor with no mode — every CS-1 row — is in addition. */
20841
+ var DEFAULT_CAMERA_SENSOR_MODE = "in-addition";
20842
+ /**
20843
+ * A camera's attached sensors. A CS-1 row carried an envelope
20844
+ * `mode: 'in-addition'`: `z.object` drops it on parse, and the PARSED value is
20845
+ * what the write stores (D672 rule 3), so it is never written again.
20846
+ */
20847
+ var CameraSensorsConfigSchema = object({ sensors: array(CameraSensorRefSchema.extend({ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE) })).min(1).max(8) }).superRefine((value, ctx) => {
20473
20848
  const seen = /* @__PURE__ */ new Set();
20474
20849
  value.sensors.forEach((ref, index) => {
20475
20850
  const key = cameraSensorRefKey(ref);
@@ -20481,39 +20856,41 @@ object({
20481
20856
  seen.add(key);
20482
20857
  });
20483
20858
  });
20484
- var RefFields = {
20859
+ /** Every attachment names its mode; an older orchestrator that does not is in addition. */
20860
+ var AttachmentFields = {
20485
20861
  addonId: string(),
20486
- stableId: string()
20862
+ stableId: string(),
20863
+ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE)
20487
20864
  };
20488
20865
  var CameraSensorAttachmentSchema = discriminatedUnion("state", [
20489
20866
  object({
20490
- ...RefFields,
20867
+ ...AttachmentFields,
20491
20868
  state: literal("ready"),
20492
20869
  deviceId: number(),
20493
20870
  name: string(),
20494
20871
  caps: array(string()).readonly()
20495
20872
  }),
20496
20873
  object({
20497
- ...RefFields,
20874
+ ...AttachmentFields,
20498
20875
  state: literal("offline"),
20499
20876
  deviceId: number(),
20500
20877
  name: string(),
20501
20878
  reason: _enum(["offline", "disabled"])
20502
20879
  }),
20503
20880
  object({
20504
- ...RefFields,
20881
+ ...AttachmentFields,
20505
20882
  state: literal("missing"),
20506
20883
  reason: string()
20507
20884
  }),
20508
20885
  object({
20509
- ...RefFields,
20886
+ ...AttachmentFields,
20510
20887
  state: literal("unsupported"),
20511
20888
  deviceId: number(),
20512
20889
  name: string(),
20513
20890
  reason: string()
20514
20891
  }),
20515
20892
  object({
20516
- ...RefFields,
20893
+ ...AttachmentFields,
20517
20894
  state: literal("unreadable"),
20518
20895
  reason: string()
20519
20896
  })
@@ -20526,17 +20903,49 @@ var CameraSensorAttachmentSchema = discriminatedUnion("state", [
20526
20903
  * say.
20527
20904
  */
20528
20905
  var CameraSensorsNotForwardedSchema = _enum(["onboard-not-listed", "no-active-detection"]);
20906
+ /** Whether the camera's OWN motion counts on its own (D673 C2), from its READY sensors (C3). */
20907
+ var CameraOwnMotionSchema = _enum([
20908
+ "always",
20909
+ "when-confirmed",
20910
+ "never"
20911
+ ]);
20912
+ /** Confirm / Replace cannot suppress this camera's motion: its provider still emits it directly (D673 C13). */
20913
+ var CameraSensorsNotEnforcedSchema = _enum(["provider-not-split"]);
20914
+ /**
20915
+ * The camera's OWN onboard motion (D696): the raw input the bridge combines,
20916
+ * never the effective value. The camera's `motion` slice is the effective one,
20917
+ * so a view of the camera's own row reads this.
20918
+ * - `atMs`: when the bridge received the camera's last own edge.
20919
+ * - `detected`: evaluated WHEN THE STATUS IS ASKED — the last edge said `true`
20920
+ * AND it is younger than the window the bridge counts the camera's own motion
20921
+ * for (`motionCooldownMs`, floored at two sustain ticks). A camera that never
20922
+ * sends a clear (heartbeats only) therefore reads `false` once no push came
20923
+ * within the window; a status read is a snapshot, so a live view re-asks.
20924
+ * Absent = this orchestrator has not received the camera's own motion since it
20925
+ * started (unknown, never "quiet"), or an orchestrator older than D696.
20926
+ */
20927
+ var CameraRawLevelSchema = object({
20928
+ detected: boolean(),
20929
+ atMs: number()
20930
+ });
20529
20931
  var CameraSensorsStatusSchema = discriminatedUnion("state", [
20530
- object({ state: literal("not-configured") }),
20932
+ object({
20933
+ state: literal("not-configured"),
20934
+ cameraLevel: CameraRawLevelSchema.optional()
20935
+ }),
20531
20936
  object({
20532
20937
  state: literal("unreadable"),
20533
- reason: string()
20938
+ reason: string(),
20939
+ cameraLevel: CameraRawLevelSchema.optional()
20534
20940
  }),
20535
20941
  object({
20536
20942
  state: literal("configured"),
20537
- mode: CameraSensorsModeSchema,
20943
+ cameraLevel: CameraRawLevelSchema.optional(),
20538
20944
  sensors: array(CameraSensorAttachmentSchema).readonly(),
20539
- notForwarded: CameraSensorsNotForwardedSchema.optional()
20945
+ /** Absent = an orchestrator older than CS-2: it does not say (D315). */
20946
+ cameraMotion: CameraOwnMotionSchema.optional(),
20947
+ notForwarded: CameraSensorsNotForwardedSchema.optional(),
20948
+ notEnforced: CameraSensorsNotEnforcedSchema.optional()
20540
20949
  })
20541
20950
  ]);
20542
20951
  Object.freeze({
@@ -22371,7 +22780,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22371
22780
  trackIds: array(string()).min(1)
22372
22781
  }), object({
22373
22782
  deleted: number().int(),
22374
- failed: array(string()).readonly()
22783
+ failed: array(string()).readonly(),
22784
+ sparedMediaIds: array(number().int()).readonly().optional()
22375
22785
  }), {
22376
22786
  kind: "mutation",
22377
22787
  auth: "admin"
@@ -22380,7 +22790,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22380
22790
  deviceId: number(),
22381
22791
  trackId: string(),
22382
22792
  flags: TrackFlagsPatchSchema
22383
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
22793
+ }), 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, {
22384
22794
  kind: "query",
22385
22795
  auth: "admin"
22386
22796
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -23766,8 +24176,10 @@ var RunnerCameraConfigSchema = object({
23766
24176
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
23767
24177
  * analyzer providers) running on decoded frames in this runner.
23768
24178
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
23769
- * analytics). The provider emits ProviderMotion
23770
- * events; the orchestrator forwards to `reportMotion`.
24179
+ * analytics). The provider emits its raw push as `ProviderMotion`
24180
+ * (D673); the orchestrator's camera-sensors bridge re-emits the camera's
24181
+ * effective motion as `MotionOnMotionChanged`, which is what reaches
24182
+ * `reportMotion`.
23771
24183
  */
23772
24184
  motionSources: MotionSourcesSchema.default(["analyzer"]),
23773
24185
  /**
@@ -23944,7 +24356,15 @@ var RunnerLocalLoadSchema = object({
23944
24356
  hasGpu: boolean(),
23945
24357
  inferenceBackend: string().optional(),
23946
24358
  cpuCores: number().optional()
23947
- })
24359
+ }),
24360
+ /**
24361
+ * Who writes a camera's `motion` runtime slice (D696). `'orchestrator'`: this
24362
+ * runner never writes it. ABSENT = a runner older than D696, which still
24363
+ * writes the slice from its phase machine; the orchestrator does not write
24364
+ * while any runner node is absent-or-unanswered, so one slice never has two
24365
+ * writers.
24366
+ */
24367
+ motionSliceWriter: literal("orchestrator").optional()
23948
24368
  });
23949
24369
  /**
23950
24370
  * Aggregate runtime metrics for the runner's whole local pool. Mirrors the
@@ -24578,7 +24998,64 @@ var NodeInferenceDevicesSchema = object({
24578
24998
  reachable: boolean(),
24579
24999
  devices: array(NodeInferenceDeviceSchema).readonly()
24580
25000
  });
24581
- method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25001
+ /**
25002
+ * Pipeline Orchestrator capability — global load balancer + camera dispatcher.
25003
+ *
25004
+ * Lives on the hub. Tracks the camera-to-agent assignment map, listens to
25005
+ * device lifecycle events, queries each runner's capacity + hardware
25006
+ * profile, and dispatches `attachCamera` / `detachCamera` cap calls to the
25007
+ * appropriate runner instances. Persists assignments via the multi-level
25008
+ * settings store so they survive hub restarts.
25009
+ *
25010
+ * Strictly the control plane: never sees a frame, never calls inference,
25011
+ * never drains queues. The runner does that work locally on each agent.
25012
+ */
25013
+ /**
25014
+ * The input of `setCameraSensors` (G5, D676): the ONE typed write path of a
25015
+ * camera's attached sensors (D672). `config: null` removes the attachment —
25016
+ * the camera reads `not-configured` again, never `unreadable`.
25017
+ */
25018
+ var SetCameraSensorsInputSchema = object({
25019
+ deviceId: number().int().nonnegative(),
25020
+ /** `null` removes the attachment: the camera goes back to `not-configured`. */
25021
+ config: CameraSensorsConfigSchema.nullable()
25022
+ });
25023
+ /**
25024
+ * Why an early occupancy look (D691) was not scheduled.
25025
+ *
25026
+ * - `unknown-camera` — no session was ever dispatched for it, so there is no
25027
+ * node and no config to attach a burst with.
25028
+ * - `out-of-range` — the ask is negative or further out than the orchestrator
25029
+ * will hold a timer for; the parked-object cadence is the answer there.
25030
+ * - `no-burst-producer` — this build has no burst producer at all.
25031
+ * - `already-looked` — this camera's ONE early look since its last session has
25032
+ * been spent. A look's own burst can re-arm a flickering flip, and a look
25033
+ * per arm would chain a burst every ~30 s forever (review H2); the next
25034
+ * real session re-arms the budget.
25035
+ */
25036
+ var OccupancyLookRefusalSchema = _enum([
25037
+ "unknown-camera",
25038
+ "out-of-range",
25039
+ "no-burst-producer",
25040
+ "already-looked"
25041
+ ]);
25042
+ method(object({
25043
+ deviceId: number().int().nonnegative(),
25044
+ /** How long from NOW until the pending flip's sustain window ends. RELATIVE,
25045
+ * so the caller's clock and the orchestrator's never have to agree. */
25046
+ afterMs: number().finite(),
25047
+ /** Why, for the log. */
25048
+ reason: string()
25049
+ }), object({
25050
+ scheduled: boolean(),
25051
+ /** When `scheduled`: how long until the burst is dialled. */
25052
+ dueInMs: number().optional(),
25053
+ /** When not `scheduled`: why. */
25054
+ refusedBecause: OccupancyLookRefusalSchema.optional()
25055
+ }), {
25056
+ kind: "mutation",
25057
+ auth: "admin"
25058
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
24582
25059
  kind: "mutation",
24583
25060
  auth: "admin"
24584
25061
  }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
@@ -24732,7 +25209,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
24732
25209
  }), CameraSwitchGroupSchema, {
24733
25210
  kind: "mutation",
24734
25211
  auth: "admin"
24735
- }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
25212
+ }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(SetCameraSensorsInputSchema, object({ success: literal(true) }), {
25213
+ kind: "mutation",
25214
+ auth: "admin"
25215
+ }), method(_void(), DiskReconcileJobSchema, {
24736
25216
  kind: "mutation",
24737
25217
  auth: "admin"
24738
25218
  }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
@@ -27042,219 +27522,6 @@ DeviceType.Camera, method(object({
27042
27522
  auth: "protected"
27043
27523
  });
27044
27524
  /**
27045
- * Doorbell button cap. Two kinds of providers coexist behind this cap
27046
- * name (same pattern as `snapshot`):
27047
- *
27048
- * - **Native** providers: registered per-device by device-driver
27049
- * addons via `ctx.registerNativeCap` — either on a
27050
- * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
27051
- * or directly on the camera (Reolink registers at camera level).
27052
- * Emits an `onPressed` event every time the firmware pushes a
27053
- * ring; status tracks the last press and a pressCount since start
27054
- * (diagnostic).
27055
- *
27056
- * - **Wrapper** provider: the `virtual-doorbell` system builtin
27057
- * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
27058
- * device (contact / switch / event-emitter …) into a doorbell for
27059
- * a camera. `defaultActive: false` — the operator explicitly binds
27060
- * it per camera in the device-bindings UI, then picks the source
27061
- * device + trigger in the per-device settings.
27062
- *
27063
- * The DeviceEventPropagator re-emits `onPressed` on the camera parent
27064
- * — subscribers listening at the camera level receive ring events
27065
- * with `via[]` populated. No code on the parent needed.
27066
- */
27067
- var DoorbellStatusSchema = object({
27068
- /** Ms epoch of the last press. null = never observed since this provider started. */
27069
- lastPressedAt: number().nullable(),
27070
- /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
27071
- pressCountSinceStart: number()
27072
- });
27073
- var DoorbellPressEventSchema = object({
27074
- deviceId: number(),
27075
- timestamp: number()
27076
- });
27077
- /**
27078
- * The `doorbell-source` extension slot's editable value (D648): the camera's
27079
- * virtual-doorbell trigger devices, exactly what the wrapper's
27080
- * `doorbellSources` persists (as `{ deviceId }` records).
27081
- */
27082
- var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
27083
- /**
27084
- * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
27085
- * doorbell, owned by the `virtual-doorbell` wrapper over its
27086
- * `doorbellSources` store (D648). A source rings when one of its
27087
- * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
27088
- * different authority (`deviceManager.setWrapperActive`, D62) — the slot
27089
- * reports it, it never writes it.
27090
- */
27091
- var DOORBELL_SOURCE_SLOT = {
27092
- id: "doorbell-source",
27093
- label: "Doorbell trigger devices",
27094
- 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.",
27095
- shape: "association",
27096
- hostDeviceTypes: [DeviceType.Camera],
27097
- sourceCaps: SOURCE_CAPS,
27098
- cardinality: "many",
27099
- value: DoorbellSourceSlotValueSchema
27100
- };
27101
- var doorbellCapability = {
27102
- name: "doorbell",
27103
- scope: "device",
27104
- deviceNative: true,
27105
- mode: "singleton",
27106
- kind: "wrapper",
27107
- defaultActive: false,
27108
- deviceTypes: [DeviceType.Button, DeviceType.Camera],
27109
- extensionSlots: [DOORBELL_SOURCE_SLOT],
27110
- methods: {},
27111
- events: {
27112
- /**
27113
- * Fires once per physical press. Reolink delivers via Baichuan
27114
- * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
27115
- * release/duration — it's a pulse.
27116
- */
27117
- onPressed: {
27118
- data: DoorbellPressEventSchema,
27119
- fromState: {
27120
- field: "lastPressedAt",
27121
- on: "advance"
27122
- }
27123
- } },
27124
- status: {
27125
- schema: DoorbellStatusSchema,
27126
- kind: "push"
27127
- },
27128
- /**
27129
- * Runtime-state slice — last press timestamp + lifetime press count.
27130
- * Mirrored by the kernel and readable via
27131
- * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
27132
- * without subscribing.
27133
- */
27134
- runtimeState: DoorbellStatusSchema,
27135
- /**
27136
- * 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.
27137
- *
27138
- * See `RuntimeStateDurability`. Enforced by
27139
- * `scripts/check-runtime-state-durability.ts`.
27140
- */
27141
- durability: "restored"
27142
- };
27143
- var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
27144
- DeviceType.Camera, DeviceType.Camera;
27145
- /** A slot's editable value, discriminated on `slot`. */
27146
- var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
27147
- DeviceType.Camera;
27148
- var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
27149
- state: literal("unreachable"),
27150
- reason: string()
27151
- })]);
27152
- /** One provider of slots — the D554 source-listing row. */
27153
- var ExtensionSourceSchema = object({
27154
- /** The routing prefix of every `slotRef` this provider serves. */
27155
- source: string(),
27156
- label: string(),
27157
- /** Stamped by the dispatcher from the registry (D557). */
27158
- addonId: string().optional(),
27159
- availability: ExtensionSourceAvailabilitySchema
27160
- });
27161
- /**
27162
- * How one picked source stands. `missing` — no such device (deleted, or an id
27163
- * that never existed); `foreign` — a device the slot's owner cannot read from
27164
- * (a source owned by another addon); `unavailable` — it exists but is not a
27165
- * valid source now (a container, which is never a pick). A source in any of
27166
- * these states is SHOWN, never silently dropped or re-pointed.
27167
- */
27168
- var ExtensionSourceHealthSchema = _enum([
27169
- "ok",
27170
- "missing",
27171
- "foreign",
27172
- "unavailable"
27173
- ]);
27174
- var ExtensionSlotSourceSchema = object({
27175
- deviceId: number().int(),
27176
- /** The device's name, or null when it could not be resolved (`missing`). */
27177
- name: string().nullable(),
27178
- health: ExtensionSourceHealthSchema,
27179
- detail: string().optional()
27180
- });
27181
- /**
27182
- * A DIFFERENT authority that gates whether the slot's sources do anything —
27183
- * reported read-only, named, never written through this contract (D62). The
27184
- * virtual doorbell's sources ring only while the wrapper is bound to the
27185
- * camera, and that binding belongs to `deviceManager.setWrapperActive`.
27186
- * `unknown` means the gate could not be read; it is not "inactive" (D315).
27187
- */
27188
- var ExtensionSlotActivationSchema = object({
27189
- state: _enum([
27190
- "active",
27191
- "inactive",
27192
- "unknown"
27193
- ]),
27194
- authority: string(),
27195
- detail: string().optional()
27196
- });
27197
- var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
27198
- state: literal("ok"),
27199
- /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
27200
- slotRef: string(),
27201
- slot: ExtensionSlotIdSchema,
27202
- /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
27203
- authority: string(),
27204
- activation: ExtensionSlotActivationSchema.nullable(),
27205
- value: ExtensionSlotValueSchema,
27206
- sources: array(ExtensionSlotSourceSchema),
27207
- /**
27208
- * Devices the owner links to the host ON ITS OWN, by structure, and that
27209
- * are therefore not in `value` (D655): a camera's device-tree children, and
27210
- * the child a picked container stands for (D356 — a container is never a
27211
- * pick, its children are). Read-only; the editor shows them and may offer
27212
- * per-device options on them (the linked-devices tracked-event opt-in).
27213
- * Absent when the owner links nothing beyond the picks, and from an owner
27214
- * older than D655.
27215
- */
27216
- impliedSources: array(ExtensionSlotSourceSchema).optional()
27217
- }), object({
27218
- state: literal("unreachable"),
27219
- addonId: string(),
27220
- reason: string()
27221
- })]);
27222
- var ExtensionCandidatesSchema = object({ candidates: array(object({
27223
- deviceId: number().int(),
27224
- name: string(),
27225
- type: string(),
27226
- location: string().nullable(),
27227
- /** The container a child belongs to — "Spotlight 2" alone does not say which. */
27228
- parentName: string().nullable(),
27229
- /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
27230
- suggested: boolean(),
27231
- /** Why it is suggested ("same location"), null when it is not. */
27232
- reason: string().nullable()
27233
- })) });
27234
- /**
27235
- * What a write did. `none` — applied in place. `host` / `parent` — the owner
27236
- * reloaded the host (or, for an accessory child, its parent) because the
27237
- * write changed what the host REGISTERS. A slot never adds a capability to its
27238
- * host — that is a composition (D663) — so today's owners answer `none`.
27239
- */
27240
- var ExtensionSetResultSchema = object({
27241
- applied: literal(true),
27242
- reload: _enum([
27243
- "none",
27244
- "host",
27245
- "parent"
27246
- ])
27247
- });
27248
- var ExtensionSlotRefInputSchema = object({
27249
- deviceId: number().int(),
27250
- slotRef: string().min(1)
27251
- });
27252
- var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
27253
- method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
27254
- kind: "mutation",
27255
- auth: "admin"
27256
- });
27257
- /**
27258
27525
  * Optional client-side hints sent at session creation to help the provider
27259
27526
  * pick the best native source. All fields optional — a viewer that knows
27260
27527
  * nothing still gets a sane default. (Relocated from the retired `webrtc`
@@ -29730,6 +29997,70 @@ onStatusChanged: { data: object({
29730
29997
  * whether persisting is worth a SQLite commit. */
29731
29998
  volatileStateFields: ["lastChangedAt"]
29732
29999
  };
30000
+ var DoorbellStatusSchema = object({
30001
+ /** Ms epoch of the last press. null = never observed since this provider started. */
30002
+ lastPressedAt: number().nullable(),
30003
+ /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
30004
+ pressCountSinceStart: number()
30005
+ });
30006
+ var DoorbellPressEventSchema = object({
30007
+ deviceId: number(),
30008
+ timestamp: number()
30009
+ });
30010
+ /**
30011
+ * Doorbell button cap. Two kinds of provider serve it, and to every consumer
30012
+ * they are the same cap:
30013
+ *
30014
+ * - **Native** providers, registered per device by a driver addon through
30015
+ * `ctx.registerNativeCap` — a `DeviceType.Button` accessory with
30016
+ * `role: DeviceRole.Doorbell`, or the camera itself (Reolink registers at
30017
+ * camera level). They emit `onPressed` on every firmware ring.
30018
+ * - **A composed doorbell** (D670, D671): a camera's customization gives it
30019
+ * the cap, its `lastPressedAt` rising from the sources the operator
30020
+ * assigned in Customize → Doorbell, and the composer emits `onPressed`
30021
+ * from that field's advance (`fromState`).
30022
+ *
30023
+ * The DeviceEventPropagator re-emits `onPressed` on the camera parent.
30024
+ */
30025
+ var doorbellCapability = {
30026
+ name: "doorbell",
30027
+ scope: "device",
30028
+ deviceNative: true,
30029
+ mode: "singleton",
30030
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
30031
+ methods: {},
30032
+ events: {
30033
+ /**
30034
+ * Fires once per physical press. Reolink delivers via Baichuan
30035
+ * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
30036
+ * release/duration — it's a pulse.
30037
+ */
30038
+ onPressed: {
30039
+ data: DoorbellPressEventSchema,
30040
+ fromState: {
30041
+ field: "lastPressedAt",
30042
+ on: "advance"
30043
+ }
30044
+ } },
30045
+ status: {
30046
+ schema: DoorbellStatusSchema,
30047
+ kind: "push"
30048
+ },
30049
+ /**
30050
+ * Runtime-state slice — last press timestamp + lifetime press count.
30051
+ * Mirrored by the kernel and readable via
30052
+ * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
30053
+ * without subscribing.
30054
+ */
30055
+ runtimeState: DoorbellStatusSchema,
30056
+ /**
30057
+ * 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.
30058
+ *
30059
+ * See `RuntimeStateDurability`. Enforced by
30060
+ * `scripts/check-runtime-state-durability.ts`.
30061
+ */
30062
+ durability: "restored"
30063
+ };
29733
30064
  /**
29734
30065
  * Enum-state sensor — a string value picked from a finite option set.
29735
30066
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -31874,9 +32205,9 @@ var MotionStatusSchema = object({
31874
32205
  /** Ms epoch of the last detected-true observation. Null if never detected. */
31875
32206
  lastDetectedAt: number().nullable(),
31876
32207
  /**
31877
- * `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
31878
- * `null` while false and on every `Sensor` device (D475) — see that
31879
- * constant's doc for the one-authority rule.
32208
+ * `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device (the
32209
+ * orchestrator writes it, D696), `null` while false and on every `Sensor`
32210
+ * device (D475) — see that constant's doc for the one-authority rule.
31880
32211
  *
31881
32212
  * ## Reading this field still arms nothing
31882
32213
  *
@@ -31894,34 +32225,31 @@ var MotionStatusSchema = object({
31894
32225
  * `addon-export-alexa/src/motion-clear-hold.ts` and
31895
32226
  * `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
31896
32227
  *
31897
- * ## Who writes it
31898
- *
31899
- * - **Cameras** — the runner's phase machine, `active → watching` on
31900
- * `cooldown_expired`, which then writes this slice with
31901
- * `detected: false` (`handlePhaseChanged` in
31902
- * `pipeline-runner/index.ts`). It produces the FALLING edge, which
31903
- * matters most for the sources that only ever push a rising one:
31904
- * Reolink emits `MotionOnMotionChanged { detected: true }` and never
31905
- * a false.
31906
- * - **Sensors** (Home Assistant binary sensors, Homematic) — the
31907
- * provider pushes the false itself, from the upstream system's own
31908
- * state change. No phase machine is involved.
31909
- *
31910
- * ### The phase machine is CANONICAL, not sole — and that is a defect
31911
- *
31912
- * An earlier revision of this docblock (mine, 2026-09-12) claimed the
31913
- * phase machine is the sole writer for a camera. It is not.
31914
- * `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
31915
- * `setCapSlice(motionCapability, …)` on their own rising edge, and
31916
- * Hikvision's comment says why: it read THIS docblock, agreed the
31917
- * runner is canonical, and wrote anyway to avoid per-tick churn. So
31918
- * two authorities can disagree about one slice, which this repo
31919
- * forbids, and the doc said otherwise — which is worse than saying
31920
- * nothing, because it reads as verification.
31921
- *
31922
- * This predates D475 and is not fixed there: the fix touches every
31923
- * camera provider. Recorded in D475's Consequences. Do not restore the
31924
- * "sole writer" wording without also removing the other writers.
32228
+ * ## Who writes it (D696)
32229
+ *
32230
+ * - **Cameras** — the orchestrator, and nothing else. It writes the camera's
32231
+ * EFFECTIVE motion (`addon-pipeline-orchestrator`
32232
+ * `camera-sensors/motion-slice.ts`), alongside the effective
32233
+ * `MotionOnMotionChanged` it emits or receives: the camera-sensors bridge
32234
+ * for a split camera, an unsplit emitter's direct event, the analyzer and
32235
+ * device activity, as the camera's `motionSources` counts them. A source
32236
+ * that never sends a clear falls one window after its last `true`.
32237
+ * `lastDetectedAt` moves only on an effective rise. No camera provider
32238
+ * writes this slice (not even a boot seed), and neither does the runner's
32239
+ * phase machine: its phase is "a session is attached" for every on-motion
32240
+ * session, not motion, and it now has its own `DetectionPhaseTransition`.
32241
+ * A provider's `isDetected` answers from the hub's slice.
32242
+ * - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
32243
+ * imports) — the provider pushes both edges itself, from the upstream
32244
+ * system's own state change. That is the sensor's own fact.
32245
+ *
32246
+ * `scripts/check-onboard-motion-emitters.ts` refuses any other writer of a
32247
+ * `motion` slice; each sensor writer is a named exemption.
32248
+ *
32249
+ * This replaces the D475 §4 rule ("the phase machine is the sole writer").
32250
+ * That rule was never true: Hikvision and Amcrest wrote the slice raw beside
32251
+ * it, every provider seeded it at boot, and every session left it
32252
+ * `detected: true` after its detach.
31925
32253
  */
31926
32254
  autoClearAfterMs: number().nullable()
31927
32255
  });
@@ -31993,11 +32321,12 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
31993
32321
  */
31994
32322
  runtimeState: MotionStatusSchema,
31995
32323
  /**
31996
- * Runtime-state durability: **session** — every writer of this slice
32324
+ * Runtime-state durability: **session** — the writer of this slice
31997
32325
  * writes only on an EDGE, so a restored `detected: true` would stay
31998
32326
  * frozen until the next one instead of being corrected. The next edge
31999
- * re-publishes the real state. (On who the writers are, and why there
32000
- * is more than one, see `autoClearAfterMs` above.)
32327
+ * re-publishes the real state, and the orchestrator re-publishes every
32328
+ * camera when it starts writing (D696; on who writes it, see
32329
+ * `autoClearAfterMs` above).
32001
32330
  *
32002
32331
  * See `RuntimeStateDurability`. Enforced by
32003
32332
  * `scripts/check-runtime-state-durability.ts`.
@@ -34380,8 +34709,7 @@ var ptzAutotrackCapability = {
34380
34709
  deviceNative: true,
34381
34710
  mode: "singleton",
34382
34711
  /**
34383
- * Two kinds of provider behind one name, the same shape `snapshot` and
34384
- * `doorbell` use:
34712
+ * Two kinds of provider behind one name, the same shape `snapshot` uses:
34385
34713
  *
34386
34714
  * - **Native**: the camera's own firmware autotrack, registered per device by
34387
34715
  * the driver when the probe says it exists (Reolink: yes; Hikvision:
@@ -34389,7 +34717,7 @@ var ptzAutotrackCapability = {
34389
34717
  * - **Wrapper**: the emulated implementation (`@camstack/system`'s `autotrack` builtin),
34390
34718
  * which follows a subject with `ptz.move` pulses driven by the detection
34391
34719
  * pipeline. `defaultActive: false` — the operator binds it per camera in
34392
- * the bindings UI, exactly as `virtual-doorbell` is bound.
34720
+ * the bindings UI.
34393
34721
  *
34394
34722
  * The binding chooses WHICH implementation answers; `setEnabled` stays the
34395
34723
  * one switch for the function either way. A camera never has both driving its
@@ -38428,47 +38756,6 @@ var zoneRulesCapability = {
38428
38756
  */
38429
38757
  durability: "restored"
38430
38758
  };
38431
- var NUMBER = {
38432
- kind: "fixed",
38433
- result: ["number"]
38434
- };
38435
- var BOOLEAN = {
38436
- kind: "fixed",
38437
- result: ["boolean"]
38438
- };
38439
- Object.freeze({
38440
- min: NUMBER,
38441
- max: NUMBER,
38442
- abs: NUMBER,
38443
- floor: NUMBER,
38444
- ceil: NUMBER,
38445
- sqrt: NUMBER,
38446
- round: NUMBER,
38447
- pow: NUMBER,
38448
- clamp: NUMBER,
38449
- avg: NUMBER,
38450
- sum: NUMBER,
38451
- age: NUMBER,
38452
- convert: NUMBER,
38453
- coalesce: { kind: "coalesce" },
38454
- any: BOOLEAN,
38455
- all: BOOLEAN,
38456
- within: BOOLEAN,
38457
- latest: {
38458
- kind: "fixed",
38459
- result: ["number", "null"]
38460
- },
38461
- number: {
38462
- kind: "fixed",
38463
- result: ["number", "null"]
38464
- },
38465
- rose: {
38466
- kind: "fixed",
38467
- result: ["number", "null"]
38468
- },
38469
- count: NUMBER
38470
- });
38471
- `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
38472
38759
  /**
38473
38760
  * Accessory device helpers — shared across drivers.
38474
38761
  *
@@ -42414,6 +42701,12 @@ Object.freeze({
42414
42701
  addonId: null,
42415
42702
  access: "view"
42416
42703
  },
42704
+ "coreBlocks.listComposableCaps": {
42705
+ capName: "core-blocks",
42706
+ capScope: "system",
42707
+ addonId: null,
42708
+ access: "view"
42709
+ },
42417
42710
  "coreBlocks.listCompositions": {
42418
42711
  capName: "core-blocks",
42419
42712
  capScope: "system",
@@ -42492,6 +42785,18 @@ Object.freeze({
42492
42785
  addonId: null,
42493
42786
  access: "view"
42494
42787
  },
42788
+ "databaseSnapshot.listDatabases": {
42789
+ capName: "database-snapshot",
42790
+ capScope: "system",
42791
+ addonId: null,
42792
+ access: "view"
42793
+ },
42794
+ "databaseSnapshot.writeSnapshot": {
42795
+ capName: "database-snapshot",
42796
+ capScope: "system",
42797
+ addonId: null,
42798
+ access: "create"
42799
+ },
42495
42800
  "dataStoreProvider.aggregate": {
42496
42801
  capName: "data-store-provider",
42497
42802
  capScope: "system",
@@ -45228,6 +45533,12 @@ Object.freeze({
45228
45533
  addonId: null,
45229
45534
  access: "create"
45230
45535
  },
45536
+ "pipelineAnalytics.clearTrackRelation": {
45537
+ capName: "pipeline-analytics",
45538
+ capScope: "device",
45539
+ addonId: null,
45540
+ access: "delete"
45541
+ },
45231
45542
  "pipelineAnalytics.clearTracks": {
45232
45543
  capName: "pipeline-analytics",
45233
45544
  capScope: "device",
@@ -45480,6 +45791,12 @@ Object.freeze({
45480
45791
  addonId: null,
45481
45792
  access: "view"
45482
45793
  },
45794
+ "pipelineAnalytics.listTrackRelations": {
45795
+ capName: "pipeline-analytics",
45796
+ capScope: "device",
45797
+ addonId: null,
45798
+ access: "view"
45799
+ },
45483
45800
  "pipelineAnalytics.listTracks": {
45484
45801
  capName: "pipeline-analytics",
45485
45802
  capScope: "device",
@@ -45594,6 +45911,18 @@ Object.freeze({
45594
45911
  addonId: null,
45595
45912
  access: "create"
45596
45913
  },
45914
+ "pipelineAnalytics.setTrackPurity": {
45915
+ capName: "pipeline-analytics",
45916
+ capScope: "device",
45917
+ addonId: null,
45918
+ access: "create"
45919
+ },
45920
+ "pipelineAnalytics.setTrackRelation": {
45921
+ capName: "pipeline-analytics",
45922
+ capScope: "device",
45923
+ addonId: null,
45924
+ access: "create"
45925
+ },
45597
45926
  "pipelineAnalytics.startStorageMigrationMove": {
45598
45927
  capName: "pipeline-analytics",
45599
45928
  capScope: "device",
@@ -46032,6 +46361,12 @@ Object.freeze({
46032
46361
  addonId: null,
46033
46362
  access: "delete"
46034
46363
  },
46364
+ "pipelineOrchestrator.requestOccupancyLook": {
46365
+ capName: "pipeline-orchestrator",
46366
+ capScope: "system",
46367
+ addonId: null,
46368
+ access: "create"
46369
+ },
46035
46370
  "pipelineOrchestrator.resetNodePipelineDefaults": {
46036
46371
  capName: "pipeline-orchestrator",
46037
46372
  capScope: "system",
@@ -46098,6 +46433,12 @@ Object.freeze({
46098
46433
  addonId: null,
46099
46434
  access: "create"
46100
46435
  },
46436
+ "pipelineOrchestrator.setCameraSensors": {
46437
+ capName: "pipeline-orchestrator",
46438
+ capScope: "system",
46439
+ addonId: null,
46440
+ access: "create"
46441
+ },
46101
46442
  "pipelineOrchestrator.setCameraStepOverride": {
46102
46443
  capName: "pipeline-orchestrator",
46103
46444
  capScope: "system",
@@ -49508,6 +49849,11 @@ Object.freeze({
49508
49849
  form: "single",
49509
49850
  optional: false
49510
49851
  }],
49852
+ "pipelineAnalytics.clearTrackRelation": [{
49853
+ name: "deviceId",
49854
+ form: "single",
49855
+ optional: false
49856
+ }],
49511
49857
  "pipelineAnalytics.clearTracks": [{
49512
49858
  name: "deviceId",
49513
49859
  form: "single",
@@ -49658,6 +50004,11 @@ Object.freeze({
49658
50004
  form: "single",
49659
50005
  optional: false
49660
50006
  }],
50007
+ "pipelineAnalytics.listTrackRelations": [{
50008
+ name: "deviceId",
50009
+ form: "single",
50010
+ optional: false
50011
+ }],
49661
50012
  "pipelineAnalytics.listTracks": [{
49662
50013
  name: "deviceId",
49663
50014
  form: "single",
@@ -49728,6 +50079,16 @@ Object.freeze({
49728
50079
  form: "single",
49729
50080
  optional: false
49730
50081
  }],
50082
+ "pipelineAnalytics.setTrackPurity": [{
50083
+ name: "deviceId",
50084
+ form: "single",
50085
+ optional: false
50086
+ }],
50087
+ "pipelineAnalytics.setTrackRelation": [{
50088
+ name: "deviceId",
50089
+ form: "single",
50090
+ optional: false
50091
+ }],
49731
50092
  "pipelineAnalytics.wipeAllAnalytics": [{
49732
50093
  name: "deviceId",
49733
50094
  form: "single",
@@ -49798,6 +50159,11 @@ Object.freeze({
49798
50159
  form: "single",
49799
50160
  optional: false
49800
50161
  }],
50162
+ "pipelineOrchestrator.requestOccupancyLook": [{
50163
+ name: "deviceId",
50164
+ form: "single",
50165
+ optional: false
50166
+ }],
49801
50167
  "pipelineOrchestrator.resolvePipeline": [{
49802
50168
  name: "deviceId",
49803
50169
  form: "single",
@@ -49808,6 +50174,11 @@ Object.freeze({
49808
50174
  form: "single",
49809
50175
  optional: false
49810
50176
  }],
50177
+ "pipelineOrchestrator.setCameraSensors": [{
50178
+ name: "deviceId",
50179
+ form: "single",
50180
+ optional: false
50181
+ }],
49811
50182
  "pipelineOrchestrator.setCameraStepOverride": [{
49812
50183
  name: "deviceId",
49813
50184
  form: "single",
@@ -50954,6 +51325,18 @@ var STATE_SUMMARY_VARS = [
50954
51325
  systemEventKinds: [...SUMMARISABLE],
50955
51326
  systemEventDeliveries: ["summary"]
50956
51327
  },
51328
+ {
51329
+ name: "summarySection",
51330
+ label: "Summary: this section",
51331
+ description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
51332
+ example: "Batterie scariche",
51333
+ group: "system",
51334
+ families: ["rule"],
51335
+ fields: [...RULE_TEXT],
51336
+ kinds: ["system"],
51337
+ systemEventKinds: [...SUMMARISABLE],
51338
+ systemEventDeliveries: ["summary"]
51339
+ },
50957
51340
  ...STATE_SUMMARY_SECTION_VARS.map((v) => ({
50958
51341
  name: v.name,
50959
51342
  label: v.label,
@@ -51030,6 +51413,37 @@ var STATE_SUMMARY_VARS = [
51030
51413
  [...RULE_TEXT],
51031
51414
  ...STATE_SUMMARY_VARS
51032
51415
  ];
51416
+ new Set([
51417
+ "disarmed",
51418
+ "armed_home",
51419
+ "armed_away",
51420
+ "armed_night",
51421
+ "armed_vacation",
51422
+ "armed_custom_bypass",
51423
+ "arming",
51424
+ "disarming",
51425
+ "pending",
51426
+ "triggered",
51427
+ "open",
51428
+ "opening",
51429
+ "closing",
51430
+ "closed",
51431
+ "stopped",
51432
+ "locked",
51433
+ "unlocked",
51434
+ "locking",
51435
+ "unlocking",
51436
+ "jammed",
51437
+ "on",
51438
+ "off",
51439
+ "home",
51440
+ "not_home",
51441
+ "matched",
51442
+ "diverged",
51443
+ "unknown",
51444
+ "latched",
51445
+ "live"
51446
+ ]);
51033
51447
  /**
51034
51448
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
51035
51449
  *
@@ -51261,6 +51675,25 @@ TimelapseRuleInputSchema.extend({
51261
51675
  createdAt: number(),
51262
51676
  updatedAt: number()
51263
51677
  });
51678
+ async function readHubMotionDetected(deviceState, deviceId) {
51679
+ let slice;
51680
+ try {
51681
+ slice = await deviceState.getCapSlice.query({
51682
+ deviceId,
51683
+ capName: "motion"
51684
+ });
51685
+ } catch (err) {
51686
+ const reason = err instanceof Error ? err.message : String(err);
51687
+ throw new Error(`motion state of device ${deviceId} is unreadable: ${reason}`, { cause: err });
51688
+ }
51689
+ const detected = slice?.["detected"];
51690
+ if (typeof detected !== "boolean") throw new Error(`motion state of device ${deviceId} is not published yet (unknown)`);
51691
+ return detected;
51692
+ }
51693
+ MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
51694
+ function providerMotionEvent(source, data) {
51695
+ return createEvent(EventCategory.ProviderMotion, source, data);
51696
+ }
51264
51697
  object({
51265
51698
  /**
51266
51699
  * Fraction of the box's own size added on EACH side before cutting.
@@ -55729,16 +56162,18 @@ var WyzeCamera = class extends BaseDevice {
55729
56162
  return null;
55730
56163
  }
55731
56164
  }
56165
+ /**
56166
+ * The native `motion` cap. This provider writes NO `motion` slice (D696): the
56167
+ * orchestrator is its only writer, with the EFFECTIVE motion, on the hub.
56168
+ * `isDetected` answers from the HUB's slice; an unreadable hub, or a slice
56169
+ * nobody has published yet, fails the call — never `false` for unknown
56170
+ * (D49, D393).
56171
+ */
55732
56172
  registerMotionProvider() {
55733
56173
  this.ctx.registerNativeCap(motionCapability, { isDetected: async ({ deviceId }) => {
55734
- if (deviceId !== this.id) return false;
55735
- return this.state.motion.detected ?? false;
56174
+ if (deviceId !== this.id) throw new Error(`WyzeCamera: deviceId mismatch, expected ${this.id}, got ${deviceId}`);
56175
+ return readHubMotionDetected(this.ctx.api.deviceState, this.id);
55736
56176
  } });
55737
- this.setCapSlice(motionCapability, {
55738
- detected: false,
55739
- lastDetectedAt: null,
55740
- autoClearAfterMs: null
55741
- });
55742
56177
  }
55743
56178
  /**
55744
56179
  * Start the configured motion source. `cloud` polls the Wyze events API
@@ -55782,12 +56217,14 @@ var WyzeCamera = class extends BaseDevice {
55782
56217
  }
55783
56218
  }
55784
56219
  /**
55785
- * Emit `MotionOnMotionChanged` (`source: 'onboard'`). The pipeline-runner
55786
- * subscribes and is the sole writer of the `motion` runtime-state slice
55787
- * — symmetric with the Reolink onboard-motion path.
56220
+ * Emit the camera's RAW motion push as `ProviderMotion`
56221
+ * (`source: 'onboard'`, D673). The orchestrator's camera-sensors bridge
56222
+ * re-emits it as the effective `MotionOnMotionChanged`, and the
56223
+ * orchestrator is the only writer of the camera's `motion` runtime-state
56224
+ * slice (D696) — symmetric with the Reolink onboard-motion path.
55788
56225
  */
55789
56226
  emitMotion(timestamp) {
55790
- this.ctx.eventBus.emit(createEvent(EventCategory.MotionOnMotionChanged, {
56227
+ this.ctx.eventBus.emit(providerMotionEvent({
55791
56228
  type: "device",
55792
56229
  id: this.id,
55793
56230
  addonId: WYZE_ADDON_ID,