@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.js CHANGED
@@ -31,7 +31,7 @@ let net = require("net");
31
31
  net = __toESM(net, 1);
32
32
  let node_child_process = require("node:child_process");
33
33
  let node_tls = require("node:tls");
34
- //#region ../types/dist/event-category-C5xZWqz6.mjs
34
+ //#region ../types/dist/event-category-BGmz_oxW.mjs
35
35
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
36
36
  EventCategory["SystemBoot"] = "system.boot";
37
37
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -564,6 +564,15 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
564
564
  */
565
565
  EventCategory["PipelineAudioInferenceResult"] = "pipeline.audio-inference-result";
566
566
  EventCategory["DetectionPhaseTransition"] = "detection.phase-transition";
567
+ /**
568
+ * A camera provider's RAW onboard motion push (D673): the `MotionOnMotionChanged`
569
+ * data shape without `triggeredBy`, built by `providerMotionEvent`. Its one
570
+ * consumer is the orchestrator's camera-sensors bridge, which re-emits the
571
+ * camera's EFFECTIVE onboard motion as `MotionOnMotionChanged` (a pass-through
572
+ * for a camera with no attached sensor). Providers must not emit
573
+ * `MotionOnMotionChanged` themselves; `scripts/check-onboard-motion-emitters.ts`
574
+ * keeps it so (camera-grid is a named, deferred exception).
575
+ */
567
576
  EventCategory["ProviderMotion"] = "provider.motion";
568
577
  EventCategory["ProviderDetection"] = "provider.detection";
569
578
  EventCategory["EnrichmentEmbeddingStored"] = "enrichment.embedding.stored";
@@ -5402,7 +5411,7 @@ var ZodIssueCode = {
5402
5411
  var ZodFirstPartyTypeKind;
5403
5412
  ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {});
5404
5413
  //#endregion
5405
- //#region ../types/dist/sleep-C-v96WpE.mjs
5414
+ //#region ../types/dist/sleep-CDCONfkt.mjs
5406
5415
  /**
5407
5416
  * The audio chunk plane's byte format, and the ONE expansion from a coded
5408
5417
  * window to float samples (D455).
@@ -7445,7 +7454,7 @@ function errMsg(err) {
7445
7454
  return String(err);
7446
7455
  }
7447
7456
  //#endregion
7448
- //#region ../types/dist/composition-Dq42XWp0.mjs
7457
+ //#region ../types/dist/composition-43aqsZQj.mjs
7449
7458
  /**
7450
7459
  * The ffmpeg build every CamStack node downloads, per platform and arch.
7451
7460
  *
@@ -7502,13 +7511,12 @@ portable("linux64"), portable("linuxarm64"), portable("macarm64"), portable("mac
7502
7511
  * LA tabella "quale booleano di questo tipo di device conta come ALTO", e il
7503
7512
  * valutatore puro del suo FRONTE.
7504
7513
  *
7505
- * Viveva dentro il builtin virtual-doorbell
7506
- * (`@camstack/system` — `builtins/doorbell/trigger-engine.ts`) e i suoi
7507
- * predicati erano privati al modulo. Il recorder ne ha bisogno per il trigger
7508
- * `RecordingTriggers.sensorDeviceIds`: copiarla avrebbe creato la SECONDA
7509
- * tabella, che diverge alla prima cap aggiunta e il cui sintomo — "il sensore
7510
- * fa suonare il campanello ma non registra" — è esattamente D62. Quindi si
7511
- * SPOSTA qui e il doorbell la ri-esporta.
7514
+ * UNA tabella per tutti quelli che chiedono "questo device è ALTO?": il
7515
+ * trigger `RecordingTriggers.sensorDeviceIds` del recorder, i marker dei
7516
+ * sensori della post-analysis, il bridge camera-sensors dell'orchestratore e
7517
+ * le sorgenti di un campanello composto (`doorbellFeatureSources`, D671).
7518
+ * Una seconda copia divergerebbe alla prima cap aggiunta, e il sintomo — "il
7519
+ * sensore fa suonare il campanello ma non registra" — è esattamente D62.
7512
7520
  *
7513
7521
  * ⚠ NON è `DEVICE_STATE_READERS` (`catalogs/device-state-vocabulary.ts`), e le
7514
7522
  * due non vanno unificate: quella risponde a "qual è la PAROLA di stato per una
@@ -7534,8 +7542,6 @@ var SOURCE_CAP_ACTIVE_FIELD = {
7534
7542
  vibration: "detected",
7535
7543
  tamper: "tampered"
7536
7544
  };
7537
- /** Cap names whose presence in a device's bindings qualify it as a source. */
7538
- var SOURCE_CAPS = Object.keys(SOURCE_CAP_ACTIVE_FIELD);
7539
7545
  /**
7540
7546
  * Error types for the safe expression engine. Two distinct classes so callers
7541
7547
  * can tell a compile-time (grammar) failure from a runtime (evaluation)
@@ -8991,6 +8997,82 @@ var ArchivedDebugNoteQueryInputSchema = object({
8991
8997
  /** Max rows returned, newest-first. */
8992
8998
  limit: number().int().min(1).max(1e3).optional()
8993
8999
  });
9000
+ var TrackRelationKindSchema = _enum(["same-subject", "different-subjects"]);
9001
+ var TrackSideSchema = _enum(["before", "after"]);
9002
+ var TrackPurityValueSchema = _enum(["mixed", "not-a-subject"]);
9003
+ var TrackRelationSchema = object({
9004
+ id: string(),
9005
+ deviceId: number().int(),
9006
+ leftTrackId: string(),
9007
+ rightTrackId: string(),
9008
+ leftSide: TrackSideSchema.nullable(),
9009
+ rightSide: TrackSideSchema.nullable(),
9010
+ relation: TrackRelationKindSchema,
9011
+ presence: literal("continuous").nullable(),
9012
+ leftStartedAt: number().int().nullable(),
9013
+ rightStartedAt: number().int().nullable(),
9014
+ createdAt: number().int(),
9015
+ updatedAt: number().int(),
9016
+ author: string().nullable()
9017
+ });
9018
+ var TrackPuritySchema = object({
9019
+ id: string(),
9020
+ deviceId: number().int(),
9021
+ sourceTrackId: string(),
9022
+ purity: TrackPurityValueSchema,
9023
+ switchAtMs: number().int().nullable(),
9024
+ startedAt: number().int().nullable(),
9025
+ createdAt: number().int(),
9026
+ updatedAt: number().int(),
9027
+ author: string().nullable()
9028
+ });
9029
+ var SetTrackRelationInputSchema = object({
9030
+ deviceId: number().int(),
9031
+ trackId: string().min(1),
9032
+ otherTrackId: string().min(1),
9033
+ relation: TrackRelationKindSchema,
9034
+ presence: literal("continuous").optional(),
9035
+ trackSide: TrackSideSchema.optional(),
9036
+ otherSide: TrackSideSchema.optional()
9037
+ });
9038
+ var ClearTrackRelationInputSchema = object({
9039
+ deviceId: number().int(),
9040
+ trackId: string().min(1),
9041
+ otherTrackId: string().min(1)
9042
+ });
9043
+ var ClearTrackRelationResultSchema = object({ cleared: boolean() });
9044
+ var SetTrackPurityInputSchema = object({
9045
+ deviceId: number().int(),
9046
+ trackId: string().min(1),
9047
+ purity: _enum([
9048
+ "pure",
9049
+ "mixed",
9050
+ "not-a-subject"
9051
+ ]),
9052
+ switchAtMs: number().int().optional()
9053
+ });
9054
+ /** `null` when `pure` cleared the row. */
9055
+ var SetTrackPurityResultSchema = object({ purity: TrackPuritySchema.nullable() });
9056
+ var ListTrackRelationsInputSchema = object({
9057
+ deviceId: number().int(),
9058
+ trackId: string().optional(),
9059
+ since: number().int().optional(),
9060
+ until: number().int().optional(),
9061
+ limit: number().int().min(1).max(5e3).optional()
9062
+ });
9063
+ var ListTrackRelationsResultSchema = object({
9064
+ relations: array(TrackRelationSchema).readonly(),
9065
+ purities: array(TrackPuritySchema).readonly(),
9066
+ truncated: boolean()
9067
+ });
9068
+ _enum([
9069
+ "unknown-track",
9070
+ "cross-device",
9071
+ "self-relation",
9072
+ "contradiction",
9073
+ "switch-outside-track",
9074
+ "switch-needs-mixed"
9075
+ ]);
8994
9076
  /**
8995
9077
  * Ops-log — the durable, append-only operations audit shared by the
8996
9078
  * recordings and events management surfaces.
@@ -9189,7 +9271,7 @@ var RecordingTriggersSchema = object({
9189
9271
  *
9190
9272
  * Cosa vuol dire "alto" dipende dal TIPO di device e non è deciso qui:
9191
9273
  * `SOURCE_CAP_ACTIVE_FIELD` (`catalogs/sensor-active-state.ts`) è LA tabella,
9192
- * la stessa che il virtual-doorbell usa dal 2026-08-05. Ed è il FRONTE, non
9274
+ * la stessa del campanello composto (D671). Ed è il FRONTE, non
9193
9275
  * il livello: un contatto trovato già aperto al riavvio del runner non fa
9194
9276
  * registrare.
9195
9277
  */
@@ -11544,6 +11626,68 @@ method(object({
11544
11626
  password: string()
11545
11627
  }), AuthResultSchema.nullable(), { kind: "mutation" }), method(object({ state: string() }), string()), method(record(string(), string()), AuthResultSchema, { kind: "mutation" }), method(object({ token: string() }), AuthResultSchema.nullable());
11546
11628
  /**
11629
+ * How long one snapshot may take end to end: the pinned copy of the whole
11630
+ * database plus `PRAGMA integrity_check` over the copy, on the hub's slowest
11631
+ * disk. ~800 MB at a pessimistic 10 MB/s is under 3 minutes; the bound is
11632
+ * generous because a timeout fails the whole backup run.
11633
+ */
11634
+ var DATABASE_SNAPSHOT_TIMEOUT_MS = 30 * 6e4;
11635
+ /**
11636
+ * The databases an owner snapshots — declared by the OWNER, so a caller never
11637
+ * guesses which file is live from what sits beside it (a cleanly closed
11638
+ * database has no sidecars and is just as owned). Paths are absolute on the
11639
+ * owner's host.
11640
+ */
11641
+ var DatabaseSnapshotTargetsSchema = object({ databases: array(object({ livePath: string() })) });
11642
+ /** One b-tree table of the snapshot and the rows it holds. */
11643
+ var DatabaseSnapshotTableSchema = object({
11644
+ name: string(),
11645
+ rows: number().int().nonnegative()
11646
+ });
11647
+ /**
11648
+ * What the owner wrote. Every path is ABSOLUTE on the owner's host — the
11649
+ * caller pins the call to its own node, so it can read the file; a caller
11650
+ * that finds the path outside its own data root refuses it rather than
11651
+ * archiving something it cannot place.
11652
+ */
11653
+ var DatabaseSnapshotResultSchema = object({
11654
+ /** The live database the snapshot copies. Never to be copied as a file. */
11655
+ livePath: string(),
11656
+ /** The verified copy: `<livePath>` + {@link DATABASE_SNAPSHOT_SUFFIX}. */
11657
+ snapshotPath: string(),
11658
+ sizeBytes: number().int().nonnegative(),
11659
+ pageCount: number().int().nonnegative(),
11660
+ pageSize: number().int().positive(),
11661
+ /**
11662
+ * Every b-tree table with its row count. Read inside the SAME read
11663
+ * transaction the copy was taken from, and found EQUAL on the copy — so
11664
+ * this is the content of the snapshot, not an estimate of the source.
11665
+ */
11666
+ tables: array(DatabaseSnapshotTableSchema),
11667
+ /** Wall time of the pinned copy (row counts included). */
11668
+ copyMs: number().nonnegative(),
11669
+ /** Wall time of the checks on the copy (`integrity_check`, row counts). */
11670
+ verifyMs: number().nonnegative(),
11671
+ /** When the pinned read transaction began (ms epoch) — the snapshot's instant. */
11672
+ takenAt: number()
11673
+ });
11674
+ /**
11675
+ * A snapshot as an ARCHIVE records it (`ArchiveManifest.sqliteSnapshots`):
11676
+ * the same facts, with both paths relative to the archive root (the node's
11677
+ * data dir), because an archive outlives the host that made it.
11678
+ */
11679
+ var ArchiveSqliteSnapshotSchema = DatabaseSnapshotResultSchema.extend({
11680
+ /** Archive-relative path of the live database the archive does NOT carry. */
11681
+ livePath: string(),
11682
+ /** Archive-relative path of the verified copy it carries in its place. */
11683
+ snapshotPath: string()
11684
+ });
11685
+ method(object({}), DatabaseSnapshotTargetsSchema, { auth: "admin" }), method(object({}), DatabaseSnapshotResultSchema, {
11686
+ kind: "mutation",
11687
+ auth: "admin",
11688
+ timeoutMs: DATABASE_SNAPSHOT_TIMEOUT_MS
11689
+ });
11690
+ /**
11547
11691
  * Orchestrator-side destination metadata. The orchestrator computes
11548
11692
  * `id = <addonId>:<subId>` from its provider lookup so consumers
11549
11693
  * (admin UI, restore flow) see one canonical key.
@@ -11654,7 +11798,12 @@ var ArchiveManifestSchema = object({
11654
11798
  locations: array(string()),
11655
11799
  entries: array(ArchiveEntrySchema),
11656
11800
  totalBytes: number(),
11657
- totalFiles: number()
11801
+ totalFiles: number(),
11802
+ /**
11803
+ * Live SQLite databases this archive carries as their OWNER's verified
11804
+ * snapshot instead of as files (D693). Absent on archives made before.
11805
+ */
11806
+ sqliteSnapshots: array(ArchiveSqliteSnapshotSchema).optional()
11658
11807
  });
11659
11808
  var LocationStatSchema = object({
11660
11809
  name: string(),
@@ -13180,6 +13329,116 @@ var CompositionBlockStateSchema = object({
13180
13329
  reason: string().optional(),
13181
13330
  fields: array(CompositionFieldStateSchema)
13182
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
+ })) });
13183
13442
  /** Where a block runs. The operator chooses — a block driving a device on an
13184
13443
  * agent is the reason placement is not fixed to the hub. */
13185
13444
  var CoreBlockPlacementSchema = union([literal("hub"), string().min(1)]);
@@ -13344,7 +13603,7 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
13344
13603
  }), method(object({ blockId: string() }), CompositionGetReadSchema, { auth: "admin" }), method(object({}), CompositionListReadSchema, { auth: "admin" }), method(object({
13345
13604
  addonId: string().min(1),
13346
13605
  stableId: string().min(1)
13347
- }), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({
13606
+ }), CompositionCustomizationReadSchema, { auth: "admin" }), method(object({ deviceType: _enum(DeviceType) }), ComposableCapabilitiesSchema, { auth: "admin" }), method(object({
13348
13607
  composition: CompositionSchema,
13349
13608
  blockId: string().optional()
13350
13609
  }), CompositionValidationSchema, {
@@ -13352,52 +13611,6 @@ method(object({}), object({ blocks: array(CoreBlockSchema) }), { auth: "admin" }
13352
13611
  auth: "admin",
13353
13612
  access: "view"
13354
13613
  });
13355
- var ComposerBlockSchema = object({
13356
- id: string().min(1),
13357
- name: string().min(1).max(120),
13358
- enabled: boolean(),
13359
- updatedAt: number(),
13360
- composition: CompositionSchema
13361
- });
13362
- /**
13363
- * A stored composition row that no longer PARSES — a schema a release
13364
- * tightened, a row written by a newer build. Sent by id so the composer keeps
13365
- * its device as a placeholder and reports the block `failed` naming the parse
13366
- * error. Leaving it out would read, twice, exactly like a delete (D49).
13367
- */
13368
- var ComposerUnreadableBlockSchema = object({
13369
- id: string().min(1),
13370
- /** The row's stored name column; null when even that is unreadable (the device keeps the name it has). */
13371
- name: string().nullable(),
13372
- /** The parse error, in the operator's words. */
13373
- error: string()
13374
- });
13375
- method(object({
13376
- /** The shared Blocks integration; null until `core-blocks` has reconciled it. */
13377
- integrationId: string().nullable(),
13378
- /** False when the `core_blocks` read failed: then nothing may be withdrawn (D49). */
13379
- storeLoaded: boolean(),
13380
- blocks: array(ComposerBlockSchema),
13381
- /** Operator restarts: rebuild these runtimes and re-resolve their sources. Stores nothing (D62). */
13382
- restartBlockIds: array(string()),
13383
- /** Composition rows that exist but do not parse: held, never withdrawn, reported failed. */
13384
- unreadableBlocks: array(ComposerUnreadableBlockSchema)
13385
- }), object({
13386
- blocks: array(object({
13387
- blockId: string(),
13388
- status: CompositionRunStatusSchema,
13389
- reason: string().optional()
13390
- })),
13391
- /**
13392
- * False when the composer declared and withdrew NOTHING (store not loaded,
13393
- * integration unknown, its own rows unread or read empty once). An empty
13394
- * apply the caller owes is paid off only by one the composer acted on (D49).
13395
- */
13396
- acted: boolean()
13397
- }), {
13398
- kind: "mutation",
13399
- auth: "admin"
13400
- }), method(object({ blockIds: array(string()) }), object({ states: array(CompositionBlockStateSchema) }), { auth: "admin" });
13401
13614
  /**
13402
13615
  * `custom-model-registry` — collection cap exposing operator-registered
13403
13616
  * custom detection models. Each provider (today: `addon-model-studio`)
@@ -15451,6 +15664,121 @@ method(object({
15451
15664
  deviceIds: array(number()).readonly(),
15452
15665
  caps: array(string()).readonly().optional()
15453
15666
  }), record(string(), record(string(), unknown().nullable())));
15667
+ var ExtensionSlotIdSchema = _enum(["linked-devices"]);
15668
+ DeviceType.Camera;
15669
+ /** A slot's editable value, discriminated on `slot`. */
15670
+ var ExtensionSlotValueSchema = discriminatedUnion("slot", [LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
15671
+ DeviceType.Camera;
15672
+ var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
15673
+ state: literal("unreachable"),
15674
+ reason: string()
15675
+ })]);
15676
+ /** One provider of slots — the D554 source-listing row. */
15677
+ var ExtensionSourceSchema = object({
15678
+ /** The routing prefix of every `slotRef` this provider serves. */
15679
+ source: string(),
15680
+ label: string(),
15681
+ /** Stamped by the dispatcher from the registry (D557). */
15682
+ addonId: string().optional(),
15683
+ availability: ExtensionSourceAvailabilitySchema
15684
+ });
15685
+ /**
15686
+ * How one picked source stands. `missing` — no such device (deleted, or an id
15687
+ * that never existed); `foreign` — a device the slot's owner cannot read from
15688
+ * (a source owned by another addon); `unavailable` — it exists but is not a
15689
+ * valid source now (a container, which is never a pick). A source in any of
15690
+ * these states is SHOWN, never silently dropped or re-pointed.
15691
+ */
15692
+ var ExtensionSourceHealthSchema = _enum([
15693
+ "ok",
15694
+ "missing",
15695
+ "foreign",
15696
+ "unavailable"
15697
+ ]);
15698
+ var ExtensionSlotSourceSchema = object({
15699
+ deviceId: number().int(),
15700
+ /** The device's name, or null when it could not be resolved (`missing`). */
15701
+ name: string().nullable(),
15702
+ health: ExtensionSourceHealthSchema,
15703
+ detail: string().optional()
15704
+ });
15705
+ /**
15706
+ * A DIFFERENT authority that gates whether the slot's sources do anything —
15707
+ * reported read-only, named, never written through this contract (D62) — e.g.
15708
+ * a slot whose sources act only while a wrapper is bound to the host, a
15709
+ * binding that belongs to `deviceManager.setWrapperActive`. No slot reports
15710
+ * one today (`linked-devices` answers `null`). `unknown` means the gate could
15711
+ * not be read; it is not "inactive" (D315).
15712
+ */
15713
+ var ExtensionSlotActivationSchema = object({
15714
+ state: _enum([
15715
+ "active",
15716
+ "inactive",
15717
+ "unknown"
15718
+ ]),
15719
+ authority: string(),
15720
+ detail: string().optional()
15721
+ });
15722
+ var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
15723
+ state: literal("ok"),
15724
+ /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
15725
+ slotRef: string(),
15726
+ slot: ExtensionSlotIdSchema,
15727
+ /** Names the store written (D62), e.g. `device-manager:_linkedDeviceIds`. */
15728
+ authority: string(),
15729
+ activation: ExtensionSlotActivationSchema.nullable(),
15730
+ value: ExtensionSlotValueSchema,
15731
+ sources: array(ExtensionSlotSourceSchema),
15732
+ /**
15733
+ * Devices the owner links to the host ON ITS OWN, by structure, and that
15734
+ * are therefore not in `value` (D655): a camera's device-tree children, and
15735
+ * the child a picked container stands for (D356 — a container is never a
15736
+ * pick, its children are). Read-only; the editor shows them and may offer
15737
+ * per-device options on them (the linked-devices tracked-event opt-in).
15738
+ * Absent when the owner links nothing beyond the picks, and from an owner
15739
+ * older than D655.
15740
+ */
15741
+ impliedSources: array(ExtensionSlotSourceSchema).optional()
15742
+ }), object({
15743
+ state: literal("unreachable"),
15744
+ addonId: string(),
15745
+ reason: string()
15746
+ })]);
15747
+ var ExtensionCandidatesSchema = object({ candidates: array(object({
15748
+ deviceId: number().int(),
15749
+ name: string(),
15750
+ type: string(),
15751
+ location: string().nullable(),
15752
+ /** The container a child belongs to — "Spotlight 2" alone does not say which. */
15753
+ parentName: string().nullable(),
15754
+ /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
15755
+ suggested: boolean(),
15756
+ /** Why it is suggested ("same location"), null when it is not. */
15757
+ reason: string().nullable()
15758
+ })) });
15759
+ /**
15760
+ * What a write did. `none` — applied in place. `host` / `parent` — the owner
15761
+ * reloaded the host (or, for an accessory child, its parent) because the
15762
+ * write changed what the host REGISTERS. A slot never adds a capability to its
15763
+ * host — that is a composition (D663) — so today's owners answer `none`.
15764
+ */
15765
+ var ExtensionSetResultSchema = object({
15766
+ applied: literal(true),
15767
+ reload: _enum([
15768
+ "none",
15769
+ "host",
15770
+ "parent"
15771
+ ])
15772
+ });
15773
+ var ExtensionSlotRefInputSchema = object({
15774
+ deviceId: number().int(),
15775
+ slotRef: string().min(1)
15776
+ });
15777
+ var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
15778
+ method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
15779
+ kind: "mutation",
15780
+ auth: "admin"
15781
+ });
15454
15782
  /**
15455
15783
  * Per-field ownership (D663). A composition may CLAIM fields of a native
15456
15784
  * cap's runtime-state slice on an existing device: `replace` overlays the
@@ -18461,17 +18789,25 @@ var NcScheduleSchema = object({
18461
18789
  */
18462
18790
  var NcSystemEventDeliveryModeSchema = _enum(["instant", "summary"]);
18463
18791
  /**
18792
+ * How a summary window is SENT (D698): `rule` (absent) = ONE notification with
18793
+ * every section; `section` = one notification per section with something to
18794
+ * say (an unavailable section included), each titled by its section.
18795
+ */
18796
+ var NcStateSummarySplitSchema = _enum(["rule", "section"]);
18797
+ /**
18464
18798
  * `summary`: the rule sends NOTHING per event. When a window of `schedule`
18465
18799
  * CLOSES, it sends one notification with the current state of its kinds
18466
18800
  * (low batteries, consumables to replace, devices offline, updates
18467
- * available, ...), after its own filters. Nothing to report sends nothing.
18801
+ * available, ...), after its own filters — or, with `split: 'section'`
18802
+ * (D698), one notification per section. Nothing to report sends nothing.
18468
18803
  * The schedule is the ordinary `NcSchedule` (weekly windows, IANA timezone,
18469
18804
  * midnight crossing); the send time is each window's END. Refused on the
18470
18805
  * `alarm` family, which stays instant (`systemEventDeliveryProblems`).
18471
18806
  */
18472
18807
  var NcSystemEventDeliverySchema = discriminatedUnion("mode", [object({ mode: literal("instant") }), object({
18473
18808
  mode: literal("summary"),
18474
- schedule: NcScheduleSchema
18809
+ schedule: NcScheduleSchema,
18810
+ split: NcStateSummarySplitSchema.optional()
18475
18811
  })]);
18476
18812
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
18477
18813
  var NcPlateMatcherSchema = object({
@@ -18611,8 +18947,14 @@ var NcSensorTransitionSchema = _enum(["raised", "cleared"]);
18611
18947
  /** Admin-zone membership condition (zone IDs as stamped by the ZoneEngine). */
18612
18948
  var NcZoneConditionSchema = object({
18613
18949
  ids: array(string().min(1)).min(1),
18614
- /** Quantifier over `ids` — at least one / every one visited. */
18615
- match: _enum(["any", "all"]).default("any")
18950
+ /**
18951
+ * LEGACY quantifier over `ids`. Absent = `any` (at least one visited), which
18952
+ * is what both editors mean and all they write since D690: "all of" was
18953
+ * removed from the editors because on an immediate rule it asked one
18954
+ * detection to stand in every zone at once. Still ACCEPTED, and `all` still
18955
+ * evaluated, so a stored rule keeps parsing and meaning what it meant.
18956
+ */
18957
+ match: _enum(["any", "all"]).optional()
18616
18958
  });
18617
18959
  /**
18618
18960
  * The P1 condition set — a flat AND of groups; absent group = pass;
@@ -19116,10 +19458,12 @@ var NcMediaPolicySchema = object({
19116
19458
  /**
19117
19459
  * Cooldown GRANULARITY over the subject's class — how much a fired
19118
19460
  * notification suppresses.
19119
- * - `shared` (default, and the absent value) — one window for the whole
19120
- * rule/scope: a cat silences the next dog for `cooldownSec`.
19121
- * - `per-class` — an independent window per detected class, so cat→dog fires
19122
- * at once and cat→cat still waits.
19461
+ * - `per-class` (default, and the absent value since 2026-10-01 — D36) — an
19462
+ * independent window per detected class: cat→dog fires at once, cat→cat
19463
+ * still waits.
19464
+ * - `shared` — one window for the whole rule/scope: a cat silences the next
19465
+ * dog for `cooldownSec`. Only written when an operator picks it; it is no
19466
+ * longer what an unset rule means.
19123
19467
  *
19124
19468
  * AUDIO subjects are ALWAYS per-class regardless of this setting: a scream
19125
19469
  * must not be swallowed by a bark's window (the precedent this generalizes —
@@ -19134,8 +19478,11 @@ var NcThrottleSchema = object({
19134
19478
  /**
19135
19479
  * Class granularity of the cooldown key. Optional rather than defaulted:
19136
19480
  * a Zod default does NOT run on the addon→addon cap path, so a persisted
19137
- * rule authored before this field simply carries none — and the engine
19138
- * reads absent as `shared`, the pre-existing behaviour.
19481
+ * rule authored before this field simply carries none. The engine used to
19482
+ * read absent as `shared` (D36); since 2026-10-01 it reads absent as
19483
+ * `per-class` — the operator's default — and only an explicit `shared`
19484
+ * still means `shared`. See `cooldownKey` / `keysPerClass` in the rule
19485
+ * engine, and D36's dated note.
19139
19486
  */
19140
19487
  granularity: NcThrottleGranularitySchema.optional()
19141
19488
  });
@@ -19459,11 +19806,23 @@ var NcStateSummaryPreviewSectionSchema = object({
19459
19806
  reason: string().optional()
19460
19807
  });
19461
19808
  /**
19809
+ * One notification a previewed summary would send (D698): the whole summary on
19810
+ * a `rule` split (no `section`), one section's on a `section` split.
19811
+ */
19812
+ var NcStateSummaryPreviewRowSchema = object({
19813
+ section: string().optional(),
19814
+ /** The section's name on a per-section row; every reported section's, joined, on a combined one. */
19815
+ title: string(),
19816
+ text: string(),
19817
+ count: number().int().nonnegative()
19818
+ });
19819
+ /**
19462
19820
  * The summary a rule would send now. `empty` = nothing to report and every
19463
19821
  * section read: such a summary is NOT sent. `dropped` counts the open states
19464
19822
  * the rule's own filters (or a camera mute) left out, by reason.
19465
19823
  * `excludedGroups` names the kind groups selected that have no state to report
19466
- * (backups & exports).
19824
+ * (backups & exports). `split` and `rows` (D698) say how it would be sent —
19825
+ * optional, so an older hub's answer still parses.
19467
19826
  */
19468
19827
  var NcStateSummaryPreviewSchema = object({
19469
19828
  empty: boolean(),
@@ -19471,7 +19830,9 @@ var NcStateSummaryPreviewSchema = object({
19471
19830
  text: string(),
19472
19831
  sections: array(NcStateSummaryPreviewSectionSchema),
19473
19832
  dropped: record(string(), number().int().nonnegative()),
19474
- excludedGroups: array(string())
19833
+ excludedGroups: array(string()),
19834
+ split: NcStateSummarySplitSchema.optional(),
19835
+ rows: array(NcStateSummaryPreviewRowSchema).optional()
19475
19836
  });
19476
19837
  var NcTestResultSchema = object({
19477
19838
  recordId: string(),
@@ -20485,12 +20846,26 @@ var CameraSensorRefSchema = object({
20485
20846
  function cameraSensorRefKey(ref) {
20486
20847
  return `${ref.addonId}/${ref.stableId}`;
20487
20848
  }
20488
- /** CS-1 accepts exactly one mode; CS-2 (D673) widens it to confirm / replace. */
20489
- var CameraSensorsModeSchema = _enum(["in-addition"]);
20490
- object({
20491
- mode: CameraSensorsModeSchema,
20492
- sensors: array(CameraSensorRefSchema).min(1).max(8)
20493
- }).superRefine((value, ctx) => {
20849
+ /**
20850
+ * A sensor's mode (D673). `in-addition`: its motion is the camera's motion too.
20851
+ * `replace`: its motion is the camera's, and while one is READY the camera's
20852
+ * own motion no longer counts on its own. `confirm`: while one is READY the
20853
+ * camera's own motion counts only while a confirm sensor is active — with or
20854
+ * without a replace sensor (spec C2, the controller's ruling on Q1).
20855
+ */
20856
+ var CameraSensorModeSchema = _enum([
20857
+ "in-addition",
20858
+ "confirm",
20859
+ "replace"
20860
+ ]);
20861
+ /** A stored sensor with no mode — every CS-1 row — is in addition. */
20862
+ var DEFAULT_CAMERA_SENSOR_MODE = "in-addition";
20863
+ /**
20864
+ * A camera's attached sensors. A CS-1 row carried an envelope
20865
+ * `mode: 'in-addition'`: `z.object` drops it on parse, and the PARSED value is
20866
+ * what the write stores (D672 rule 3), so it is never written again.
20867
+ */
20868
+ var CameraSensorsConfigSchema = object({ sensors: array(CameraSensorRefSchema.extend({ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE) })).min(1).max(8) }).superRefine((value, ctx) => {
20494
20869
  const seen = /* @__PURE__ */ new Set();
20495
20870
  value.sensors.forEach((ref, index) => {
20496
20871
  const key = cameraSensorRefKey(ref);
@@ -20502,39 +20877,41 @@ object({
20502
20877
  seen.add(key);
20503
20878
  });
20504
20879
  });
20505
- var RefFields = {
20880
+ /** Every attachment names its mode; an older orchestrator that does not is in addition. */
20881
+ var AttachmentFields = {
20506
20882
  addonId: string(),
20507
- stableId: string()
20883
+ stableId: string(),
20884
+ mode: CameraSensorModeSchema.default(DEFAULT_CAMERA_SENSOR_MODE)
20508
20885
  };
20509
20886
  var CameraSensorAttachmentSchema = discriminatedUnion("state", [
20510
20887
  object({
20511
- ...RefFields,
20888
+ ...AttachmentFields,
20512
20889
  state: literal("ready"),
20513
20890
  deviceId: number(),
20514
20891
  name: string(),
20515
20892
  caps: array(string()).readonly()
20516
20893
  }),
20517
20894
  object({
20518
- ...RefFields,
20895
+ ...AttachmentFields,
20519
20896
  state: literal("offline"),
20520
20897
  deviceId: number(),
20521
20898
  name: string(),
20522
20899
  reason: _enum(["offline", "disabled"])
20523
20900
  }),
20524
20901
  object({
20525
- ...RefFields,
20902
+ ...AttachmentFields,
20526
20903
  state: literal("missing"),
20527
20904
  reason: string()
20528
20905
  }),
20529
20906
  object({
20530
- ...RefFields,
20907
+ ...AttachmentFields,
20531
20908
  state: literal("unsupported"),
20532
20909
  deviceId: number(),
20533
20910
  name: string(),
20534
20911
  reason: string()
20535
20912
  }),
20536
20913
  object({
20537
- ...RefFields,
20914
+ ...AttachmentFields,
20538
20915
  state: literal("unreadable"),
20539
20916
  reason: string()
20540
20917
  })
@@ -20547,17 +20924,49 @@ var CameraSensorAttachmentSchema = discriminatedUnion("state", [
20547
20924
  * say.
20548
20925
  */
20549
20926
  var CameraSensorsNotForwardedSchema = _enum(["onboard-not-listed", "no-active-detection"]);
20927
+ /** Whether the camera's OWN motion counts on its own (D673 C2), from its READY sensors (C3). */
20928
+ var CameraOwnMotionSchema = _enum([
20929
+ "always",
20930
+ "when-confirmed",
20931
+ "never"
20932
+ ]);
20933
+ /** Confirm / Replace cannot suppress this camera's motion: its provider still emits it directly (D673 C13). */
20934
+ var CameraSensorsNotEnforcedSchema = _enum(["provider-not-split"]);
20935
+ /**
20936
+ * The camera's OWN onboard motion (D696): the raw input the bridge combines,
20937
+ * never the effective value. The camera's `motion` slice is the effective one,
20938
+ * so a view of the camera's own row reads this.
20939
+ * - `atMs`: when the bridge received the camera's last own edge.
20940
+ * - `detected`: evaluated WHEN THE STATUS IS ASKED — the last edge said `true`
20941
+ * AND it is younger than the window the bridge counts the camera's own motion
20942
+ * for (`motionCooldownMs`, floored at two sustain ticks). A camera that never
20943
+ * sends a clear (heartbeats only) therefore reads `false` once no push came
20944
+ * within the window; a status read is a snapshot, so a live view re-asks.
20945
+ * Absent = this orchestrator has not received the camera's own motion since it
20946
+ * started (unknown, never "quiet"), or an orchestrator older than D696.
20947
+ */
20948
+ var CameraRawLevelSchema = object({
20949
+ detected: boolean(),
20950
+ atMs: number()
20951
+ });
20550
20952
  var CameraSensorsStatusSchema = discriminatedUnion("state", [
20551
- object({ state: literal("not-configured") }),
20953
+ object({
20954
+ state: literal("not-configured"),
20955
+ cameraLevel: CameraRawLevelSchema.optional()
20956
+ }),
20552
20957
  object({
20553
20958
  state: literal("unreadable"),
20554
- reason: string()
20959
+ reason: string(),
20960
+ cameraLevel: CameraRawLevelSchema.optional()
20555
20961
  }),
20556
20962
  object({
20557
20963
  state: literal("configured"),
20558
- mode: CameraSensorsModeSchema,
20964
+ cameraLevel: CameraRawLevelSchema.optional(),
20559
20965
  sensors: array(CameraSensorAttachmentSchema).readonly(),
20560
- notForwarded: CameraSensorsNotForwardedSchema.optional()
20966
+ /** Absent = an orchestrator older than CS-2: it does not say (D315). */
20967
+ cameraMotion: CameraOwnMotionSchema.optional(),
20968
+ notForwarded: CameraSensorsNotForwardedSchema.optional(),
20969
+ notEnforced: CameraSensorsNotEnforcedSchema.optional()
20561
20970
  })
20562
20971
  ]);
20563
20972
  Object.freeze({
@@ -22392,7 +22801,8 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22392
22801
  trackIds: array(string()).min(1)
22393
22802
  }), object({
22394
22803
  deleted: number().int(),
22395
- failed: array(string()).readonly()
22804
+ failed: array(string()).readonly(),
22805
+ sparedMediaIds: array(number().int()).readonly().optional()
22396
22806
  }), {
22397
22807
  kind: "mutation",
22398
22808
  auth: "admin"
@@ -22401,7 +22811,7 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
22401
22811
  deviceId: number(),
22402
22812
  trackId: string(),
22403
22813
  flags: TrackFlagsPatchSchema
22404
- }), TrackFlagsSchema, { kind: "mutation" }), method(ArchivedDebugNoteQueryInputSchema, array(ArchivedDebugNoteSchema).readonly(), { kind: "query" }), method(BirthDecisionQueryInputSchema, array(BirthDecisionRecordSchema).readonly(), { kind: "query" }), method(object({}), EventStoreFootprintSchema, {
22814
+ }), 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, {
22405
22815
  kind: "query",
22406
22816
  auth: "admin"
22407
22817
  }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
@@ -23787,8 +24197,10 @@ var RunnerCameraConfigSchema = object({
23787
24197
  * - `analyzer`: ML/frame-diff motion detection (motion-wasm or other
23788
24198
  * analyzer providers) running on decoded frames in this runner.
23789
24199
  * - `onboard`: camera-native motion pushes (Reolink Baichuan, ONVIF
23790
- * analytics). The provider emits ProviderMotion
23791
- * events; the orchestrator forwards to `reportMotion`.
24200
+ * analytics). The provider emits its raw push as `ProviderMotion`
24201
+ * (D673); the orchestrator's camera-sensors bridge re-emits the camera's
24202
+ * effective motion as `MotionOnMotionChanged`, which is what reaches
24203
+ * `reportMotion`.
23792
24204
  */
23793
24205
  motionSources: MotionSourcesSchema.default(["analyzer"]),
23794
24206
  /**
@@ -23965,7 +24377,15 @@ var RunnerLocalLoadSchema = object({
23965
24377
  hasGpu: boolean(),
23966
24378
  inferenceBackend: string().optional(),
23967
24379
  cpuCores: number().optional()
23968
- })
24380
+ }),
24381
+ /**
24382
+ * Who writes a camera's `motion` runtime slice (D696). `'orchestrator'`: this
24383
+ * runner never writes it. ABSENT = a runner older than D696, which still
24384
+ * writes the slice from its phase machine; the orchestrator does not write
24385
+ * while any runner node is absent-or-unanswered, so one slice never has two
24386
+ * writers.
24387
+ */
24388
+ motionSliceWriter: literal("orchestrator").optional()
23969
24389
  });
23970
24390
  /**
23971
24391
  * Aggregate runtime metrics for the runner's whole local pool. Mirrors the
@@ -24599,7 +25019,64 @@ var NodeInferenceDevicesSchema = object({
24599
25019
  reachable: boolean(),
24600
25020
  devices: array(NodeInferenceDeviceSchema).readonly()
24601
25021
  });
24602
- method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
25022
+ /**
25023
+ * Pipeline Orchestrator capability — global load balancer + camera dispatcher.
25024
+ *
25025
+ * Lives on the hub. Tracks the camera-to-agent assignment map, listens to
25026
+ * device lifecycle events, queries each runner's capacity + hardware
25027
+ * profile, and dispatches `attachCamera` / `detachCamera` cap calls to the
25028
+ * appropriate runner instances. Persists assignments via the multi-level
25029
+ * settings store so they survive hub restarts.
25030
+ *
25031
+ * Strictly the control plane: never sees a frame, never calls inference,
25032
+ * never drains queues. The runner does that work locally on each agent.
25033
+ */
25034
+ /**
25035
+ * The input of `setCameraSensors` (G5, D676): the ONE typed write path of a
25036
+ * camera's attached sensors (D672). `config: null` removes the attachment —
25037
+ * the camera reads `not-configured` again, never `unreadable`.
25038
+ */
25039
+ var SetCameraSensorsInputSchema = object({
25040
+ deviceId: number().int().nonnegative(),
25041
+ /** `null` removes the attachment: the camera goes back to `not-configured`. */
25042
+ config: CameraSensorsConfigSchema.nullable()
25043
+ });
25044
+ /**
25045
+ * Why an early occupancy look (D691) was not scheduled.
25046
+ *
25047
+ * - `unknown-camera` — no session was ever dispatched for it, so there is no
25048
+ * node and no config to attach a burst with.
25049
+ * - `out-of-range` — the ask is negative or further out than the orchestrator
25050
+ * will hold a timer for; the parked-object cadence is the answer there.
25051
+ * - `no-burst-producer` — this build has no burst producer at all.
25052
+ * - `already-looked` — this camera's ONE early look since its last session has
25053
+ * been spent. A look's own burst can re-arm a flickering flip, and a look
25054
+ * per arm would chain a burst every ~30 s forever (review H2); the next
25055
+ * real session re-arms the budget.
25056
+ */
25057
+ var OccupancyLookRefusalSchema = _enum([
25058
+ "unknown-camera",
25059
+ "out-of-range",
25060
+ "no-burst-producer",
25061
+ "already-looked"
25062
+ ]);
25063
+ method(object({
25064
+ deviceId: number().int().nonnegative(),
25065
+ /** How long from NOW until the pending flip's sustain window ends. RELATIVE,
25066
+ * so the caller's clock and the orchestrator's never have to agree. */
25067
+ afterMs: number().finite(),
25068
+ /** Why, for the log. */
25069
+ reason: string()
25070
+ }), object({
25071
+ scheduled: boolean(),
25072
+ /** When `scheduled`: how long until the burst is dialled. */
25073
+ dueInMs: number().optional(),
25074
+ /** When not `scheduled`: why. */
25075
+ refusedBecause: OccupancyLookRefusalSchema.optional()
25076
+ }), {
25077
+ kind: "mutation",
25078
+ auth: "admin"
25079
+ }), method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
24603
25080
  kind: "mutation",
24604
25081
  auth: "admin"
24605
25082
  }), method(StorageMigrationLeaseInputSchema, object({ resumed: literal(true) }), {
@@ -24753,7 +25230,10 @@ method(StorageMigrationLeaseInputSchema, object({ paused: literal(true) }), {
24753
25230
  }), CameraSwitchGroupSchema, {
24754
25231
  kind: "mutation",
24755
25232
  auth: "admin"
24756
- }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), DiskReconcileJobSchema, {
25233
+ }), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(SetCameraSensorsInputSchema, object({ success: literal(true) }), {
25234
+ kind: "mutation",
25235
+ auth: "admin"
25236
+ }), method(_void(), DiskReconcileJobSchema, {
24757
25237
  kind: "mutation",
24758
25238
  auth: "admin"
24759
25239
  }), method(_void(), DiskReconcileJobSchema, { auth: "admin" }), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
@@ -27063,219 +27543,6 @@ DeviceType.Camera, method(object({
27063
27543
  auth: "protected"
27064
27544
  });
27065
27545
  /**
27066
- * Doorbell button cap. Two kinds of providers coexist behind this cap
27067
- * name (same pattern as `snapshot`):
27068
- *
27069
- * - **Native** providers: registered per-device by device-driver
27070
- * addons via `ctx.registerNativeCap` — either on a
27071
- * `DeviceType.Button` accessory with `role: DeviceRole.Doorbell`,
27072
- * or directly on the camera (Reolink registers at camera level).
27073
- * Emits an `onPressed` event every time the firmware pushes a
27074
- * ring; status tracks the last press and a pressCount since start
27075
- * (diagnostic).
27076
- *
27077
- * - **Wrapper** provider: the `virtual-doorbell` system builtin
27078
- * (`@camstack/system/builtins/doorbell`). Turns ANY binary-ish
27079
- * device (contact / switch / event-emitter …) into a doorbell for
27080
- * a camera. `defaultActive: false` — the operator explicitly binds
27081
- * it per camera in the device-bindings UI, then picks the source
27082
- * device + trigger in the per-device settings.
27083
- *
27084
- * The DeviceEventPropagator re-emits `onPressed` on the camera parent
27085
- * — subscribers listening at the camera level receive ring events
27086
- * with `via[]` populated. No code on the parent needed.
27087
- */
27088
- var DoorbellStatusSchema = object({
27089
- /** Ms epoch of the last press. null = never observed since this provider started. */
27090
- lastPressedAt: number().nullable(),
27091
- /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
27092
- pressCountSinceStart: number()
27093
- });
27094
- var DoorbellPressEventSchema = object({
27095
- deviceId: number(),
27096
- timestamp: number()
27097
- });
27098
- /**
27099
- * The `doorbell-source` extension slot's editable value (D648): the camera's
27100
- * virtual-doorbell trigger devices, exactly what the wrapper's
27101
- * `doorbellSources` persists (as `{ deviceId }` records).
27102
- */
27103
- var DoorbellSourceSlotValueSchema = object({ deviceIds: array(number().int().positive()) });
27104
- /**
27105
- * The `doorbell-source` slot — which devices ring this camera's VIRTUAL
27106
- * doorbell, owned by the `virtual-doorbell` wrapper over its
27107
- * `doorbellSources` store (D648). A source rings when one of its
27108
- * `SOURCE_CAPS` rises. Whether the wrapper is bound to the camera at all is a
27109
- * different authority (`deviceManager.setWrapperActive`, D62) — the slot
27110
- * reports it, it never writes it.
27111
- */
27112
- var DOORBELL_SOURCE_SLOT = {
27113
- id: "doorbell-source",
27114
- label: "Doorbell trigger devices",
27115
- 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.",
27116
- shape: "association",
27117
- hostDeviceTypes: [DeviceType.Camera],
27118
- sourceCaps: SOURCE_CAPS,
27119
- cardinality: "many",
27120
- value: DoorbellSourceSlotValueSchema
27121
- };
27122
- var doorbellCapability = {
27123
- name: "doorbell",
27124
- scope: "device",
27125
- deviceNative: true,
27126
- mode: "singleton",
27127
- kind: "wrapper",
27128
- defaultActive: false,
27129
- deviceTypes: [DeviceType.Button, DeviceType.Camera],
27130
- extensionSlots: [DOORBELL_SOURCE_SLOT],
27131
- methods: {},
27132
- events: {
27133
- /**
27134
- * Fires once per physical press. Reolink delivers via Baichuan
27135
- * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
27136
- * release/duration — it's a pulse.
27137
- */
27138
- onPressed: {
27139
- data: DoorbellPressEventSchema,
27140
- fromState: {
27141
- field: "lastPressedAt",
27142
- on: "advance"
27143
- }
27144
- } },
27145
- status: {
27146
- schema: DoorbellStatusSchema,
27147
- kind: "push"
27148
- },
27149
- /**
27150
- * Runtime-state slice — last press timestamp + lifetime press count.
27151
- * Mirrored by the kernel and readable via
27152
- * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
27153
- * without subscribing.
27154
- */
27155
- runtimeState: DoorbellStatusSchema,
27156
- /**
27157
- * 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.
27158
- *
27159
- * See `RuntimeStateDurability`. Enforced by
27160
- * `scripts/check-runtime-state-durability.ts`.
27161
- */
27162
- durability: "restored"
27163
- };
27164
- var ExtensionSlotIdSchema = _enum(["doorbell-source", "linked-devices"]);
27165
- DeviceType.Camera, DeviceType.Camera;
27166
- /** A slot's editable value, discriminated on `slot`. */
27167
- var ExtensionSlotValueSchema = discriminatedUnion("slot", [DoorbellSourceSlotValueSchema.extend({ slot: literal("doorbell-source") }), LinkedDevicesSlotValueSchema.extend({ slot: literal("linked-devices") })]);
27168
- DeviceType.Camera;
27169
- var ExtensionSourceAvailabilitySchema = discriminatedUnion("state", [object({ state: literal("ok") }), object({
27170
- state: literal("unreachable"),
27171
- reason: string()
27172
- })]);
27173
- /** One provider of slots — the D554 source-listing row. */
27174
- var ExtensionSourceSchema = object({
27175
- /** The routing prefix of every `slotRef` this provider serves. */
27176
- source: string(),
27177
- label: string(),
27178
- /** Stamped by the dispatcher from the registry (D557). */
27179
- addonId: string().optional(),
27180
- availability: ExtensionSourceAvailabilitySchema
27181
- });
27182
- /**
27183
- * How one picked source stands. `missing` — no such device (deleted, or an id
27184
- * that never existed); `foreign` — a device the slot's owner cannot read from
27185
- * (a source owned by another addon); `unavailable` — it exists but is not a
27186
- * valid source now (a container, which is never a pick). A source in any of
27187
- * these states is SHOWN, never silently dropped or re-pointed.
27188
- */
27189
- var ExtensionSourceHealthSchema = _enum([
27190
- "ok",
27191
- "missing",
27192
- "foreign",
27193
- "unavailable"
27194
- ]);
27195
- var ExtensionSlotSourceSchema = object({
27196
- deviceId: number().int(),
27197
- /** The device's name, or null when it could not be resolved (`missing`). */
27198
- name: string().nullable(),
27199
- health: ExtensionSourceHealthSchema,
27200
- detail: string().optional()
27201
- });
27202
- /**
27203
- * A DIFFERENT authority that gates whether the slot's sources do anything —
27204
- * reported read-only, named, never written through this contract (D62). The
27205
- * virtual doorbell's sources ring only while the wrapper is bound to the
27206
- * camera, and that binding belongs to `deviceManager.setWrapperActive`.
27207
- * `unknown` means the gate could not be read; it is not "inactive" (D315).
27208
- */
27209
- var ExtensionSlotActivationSchema = object({
27210
- state: _enum([
27211
- "active",
27212
- "inactive",
27213
- "unknown"
27214
- ]),
27215
- authority: string(),
27216
- detail: string().optional()
27217
- });
27218
- var ExtensionSlotRowSchema = discriminatedUnion("state", [object({
27219
- state: literal("ok"),
27220
- /** `<source>:<slotId>` — the routing key for `listCandidates` / `setSlot`. */
27221
- slotRef: string(),
27222
- slot: ExtensionSlotIdSchema,
27223
- /** Names the store written (D62), e.g. `virtual-doorbell:doorbellSources`. */
27224
- authority: string(),
27225
- activation: ExtensionSlotActivationSchema.nullable(),
27226
- value: ExtensionSlotValueSchema,
27227
- sources: array(ExtensionSlotSourceSchema),
27228
- /**
27229
- * Devices the owner links to the host ON ITS OWN, by structure, and that
27230
- * are therefore not in `value` (D655): a camera's device-tree children, and
27231
- * the child a picked container stands for (D356 — a container is never a
27232
- * pick, its children are). Read-only; the editor shows them and may offer
27233
- * per-device options on them (the linked-devices tracked-event opt-in).
27234
- * Absent when the owner links nothing beyond the picks, and from an owner
27235
- * older than D655.
27236
- */
27237
- impliedSources: array(ExtensionSlotSourceSchema).optional()
27238
- }), object({
27239
- state: literal("unreachable"),
27240
- addonId: string(),
27241
- reason: string()
27242
- })]);
27243
- var ExtensionCandidatesSchema = object({ candidates: array(object({
27244
- deviceId: number().int(),
27245
- name: string(),
27246
- type: string(),
27247
- location: string().nullable(),
27248
- /** The container a child belongs to — "Spotlight 2" alone does not say which. */
27249
- parentName: string().nullable(),
27250
- /** Pre-marked by the owner's suggestion rule. NEVER saved on its own (D356). */
27251
- suggested: boolean(),
27252
- /** Why it is suggested ("same location"), null when it is not. */
27253
- reason: string().nullable()
27254
- })) });
27255
- /**
27256
- * What a write did. `none` — applied in place. `host` / `parent` — the owner
27257
- * reloaded the host (or, for an accessory child, its parent) because the
27258
- * write changed what the host REGISTERS. A slot never adds a capability to its
27259
- * host — that is a composition (D663) — so today's owners answer `none`.
27260
- */
27261
- var ExtensionSetResultSchema = object({
27262
- applied: literal(true),
27263
- reload: _enum([
27264
- "none",
27265
- "host",
27266
- "parent"
27267
- ])
27268
- });
27269
- var ExtensionSlotRefInputSchema = object({
27270
- deviceId: number().int(),
27271
- slotRef: string().min(1)
27272
- });
27273
- var ExtensionSetSlotInputSchema = ExtensionSlotRefInputSchema.extend({ value: ExtensionSlotValueSchema });
27274
- method(object({ deviceId: number().int() }), array(ExtensionSourceSchema)), method(object({ deviceId: number().int() }), array(ExtensionSlotRowSchema)), method(ExtensionSlotRefInputSchema, ExtensionCandidatesSchema), method(ExtensionSetSlotInputSchema, ExtensionSetResultSchema, {
27275
- kind: "mutation",
27276
- auth: "admin"
27277
- });
27278
- /**
27279
27546
  * Optional client-side hints sent at session creation to help the provider
27280
27547
  * pick the best native source. All fields optional — a viewer that knows
27281
27548
  * nothing still gets a sane default. (Relocated from the retired `webrtc`
@@ -29751,6 +30018,70 @@ onStatusChanged: { data: object({
29751
30018
  * whether persisting is worth a SQLite commit. */
29752
30019
  volatileStateFields: ["lastChangedAt"]
29753
30020
  };
30021
+ var DoorbellStatusSchema = object({
30022
+ /** Ms epoch of the last press. null = never observed since this provider started. */
30023
+ lastPressedAt: number().nullable(),
30024
+ /** Counter since provider start. Resets on reboot. Useful for metrics/debug. */
30025
+ pressCountSinceStart: number()
30026
+ });
30027
+ var DoorbellPressEventSchema = object({
30028
+ deviceId: number(),
30029
+ timestamp: number()
30030
+ });
30031
+ /**
30032
+ * Doorbell button cap. Two kinds of provider serve it, and to every consumer
30033
+ * they are the same cap:
30034
+ *
30035
+ * - **Native** providers, registered per device by a driver addon through
30036
+ * `ctx.registerNativeCap` — a `DeviceType.Button` accessory with
30037
+ * `role: DeviceRole.Doorbell`, or the camera itself (Reolink registers at
30038
+ * camera level). They emit `onPressed` on every firmware ring.
30039
+ * - **A composed doorbell** (D670, D671): a camera's customization gives it
30040
+ * the cap, its `lastPressedAt` rising from the sources the operator
30041
+ * assigned in Customize → Doorbell, and the composer emits `onPressed`
30042
+ * from that field's advance (`fromState`).
30043
+ *
30044
+ * The DeviceEventPropagator re-emits `onPressed` on the camera parent.
30045
+ */
30046
+ var doorbellCapability = {
30047
+ name: "doorbell",
30048
+ scope: "device",
30049
+ deviceNative: true,
30050
+ mode: "singleton",
30051
+ deviceTypes: [DeviceType.Button, DeviceType.Camera],
30052
+ methods: {},
30053
+ events: {
30054
+ /**
30055
+ * Fires once per physical press. Reolink delivers via Baichuan
30056
+ * push (`ReolinkSimpleEvent.type === 'doorbell'`). There is no
30057
+ * release/duration — it's a pulse.
30058
+ */
30059
+ onPressed: {
30060
+ data: DoorbellPressEventSchema,
30061
+ fromState: {
30062
+ field: "lastPressedAt",
30063
+ on: "advance"
30064
+ }
30065
+ } },
30066
+ status: {
30067
+ schema: DoorbellStatusSchema,
30068
+ kind: "push"
30069
+ },
30070
+ /**
30071
+ * Runtime-state slice — last press timestamp + lifetime press count.
30072
+ * Mirrored by the kernel and readable via
30073
+ * `device.state.doorbell.value`. UIs can show "last ring 5m ago"
30074
+ * without subscribing.
30075
+ */
30076
+ runtimeState: DoorbellStatusSchema,
30077
+ /**
30078
+ * 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.
30079
+ *
30080
+ * See `RuntimeStateDurability`. Enforced by
30081
+ * `scripts/check-runtime-state-durability.ts`.
30082
+ */
30083
+ durability: "restored"
30084
+ };
29754
30085
  /**
29755
30086
  * Enum-state sensor — a string value picked from a finite option set.
29756
30087
  * Drives HA `sensor` entries with `state_class: enum` (HVAC action
@@ -31895,9 +32226,9 @@ var MotionStatusSchema = object({
31895
32226
  /** Ms epoch of the last detected-true observation. Null if never detected. */
31896
32227
  lastDetectedAt: number().nullable(),
31897
32228
  /**
31898
- * `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device,
31899
- * `null` while false and on every `Sensor` device (D475) — see that
31900
- * constant's doc for the one-authority rule.
32229
+ * `MOTION_CLOSE_AFTER_MS` while `detected: true` on a `Camera` device (the
32230
+ * orchestrator writes it, D696), `null` while false and on every `Sensor`
32231
+ * device (D475) — see that constant's doc for the one-authority rule.
31901
32232
  *
31902
32233
  * ## Reading this field still arms nothing
31903
32234
  *
@@ -31915,34 +32246,31 @@ var MotionStatusSchema = object({
31915
32246
  * `addon-export-alexa/src/motion-clear-hold.ts` and
31916
32247
  * `addon-export-hap`'s `RESET_DEBOUNCE_MS` both do.
31917
32248
  *
31918
- * ## Who writes it
31919
- *
31920
- * - **Cameras** — the runner's phase machine, `active → watching` on
31921
- * `cooldown_expired`, which then writes this slice with
31922
- * `detected: false` (`handlePhaseChanged` in
31923
- * `pipeline-runner/index.ts`). It produces the FALLING edge, which
31924
- * matters most for the sources that only ever push a rising one:
31925
- * Reolink emits `MotionOnMotionChanged { detected: true }` and never
31926
- * a false.
31927
- * - **Sensors** (Home Assistant binary sensors, Homematic) — the
31928
- * provider pushes the false itself, from the upstream system's own
31929
- * state change. No phase machine is involved.
31930
- *
31931
- * ### The phase machine is CANONICAL, not sole — and that is a defect
31932
- *
31933
- * An earlier revision of this docblock (mine, 2026-09-12) claimed the
31934
- * phase machine is the sole writer for a camera. It is not.
31935
- * `hikvision-camera.ts:3464` and `amcrest-camera.ts:445` both call
31936
- * `setCapSlice(motionCapability, …)` on their own rising edge, and
31937
- * Hikvision's comment says why: it read THIS docblock, agreed the
31938
- * runner is canonical, and wrote anyway to avoid per-tick churn. So
31939
- * two authorities can disagree about one slice, which this repo
31940
- * forbids, and the doc said otherwise — which is worse than saying
31941
- * nothing, because it reads as verification.
31942
- *
31943
- * This predates D475 and is not fixed there: the fix touches every
31944
- * camera provider. Recorded in D475's Consequences. Do not restore the
31945
- * "sole writer" wording without also removing the other writers.
32249
+ * ## Who writes it (D696)
32250
+ *
32251
+ * - **Cameras** — the orchestrator, and nothing else. It writes the camera's
32252
+ * EFFECTIVE motion (`addon-pipeline-orchestrator`
32253
+ * `camera-sensors/motion-slice.ts`), alongside the effective
32254
+ * `MotionOnMotionChanged` it emits or receives: the camera-sensors bridge
32255
+ * for a split camera, an unsplit emitter's direct event, the analyzer and
32256
+ * device activity, as the camera's `motionSources` counts them. A source
32257
+ * that never sends a clear falls one window after its last `true`.
32258
+ * `lastDetectedAt` moves only on an effective rise. No camera provider
32259
+ * writes this slice (not even a boot seed), and neither does the runner's
32260
+ * phase machine: its phase is "a session is attached" for every on-motion
32261
+ * session, not motion, and it now has its own `DetectionPhaseTransition`.
32262
+ * A provider's `isDetected` answers from the hub's slice.
32263
+ * - **Sensors** (Home Assistant binary sensors, Homematic, Matter, Alexa
32264
+ * imports) — the provider pushes both edges itself, from the upstream
32265
+ * system's own state change. That is the sensor's own fact.
32266
+ *
32267
+ * `scripts/check-onboard-motion-emitters.ts` refuses any other writer of a
32268
+ * `motion` slice; each sensor writer is a named exemption.
32269
+ *
32270
+ * This replaces the D475 §4 rule ("the phase machine is the sole writer").
32271
+ * That rule was never true: Hikvision and Amcrest wrote the slice raw beside
32272
+ * it, every provider seeded it at boot, and every session left it
32273
+ * `detected: true` after its detach.
31946
32274
  */
31947
32275
  autoClearAfterMs: number().nullable()
31948
32276
  });
@@ -32014,11 +32342,12 @@ onMotionChanged: { data: MotionOnMotionChangedDataSchema } },
32014
32342
  */
32015
32343
  runtimeState: MotionStatusSchema,
32016
32344
  /**
32017
- * Runtime-state durability: **session** — every writer of this slice
32345
+ * Runtime-state durability: **session** — the writer of this slice
32018
32346
  * writes only on an EDGE, so a restored `detected: true` would stay
32019
32347
  * frozen until the next one instead of being corrected. The next edge
32020
- * re-publishes the real state. (On who the writers are, and why there
32021
- * is more than one, see `autoClearAfterMs` above.)
32348
+ * re-publishes the real state, and the orchestrator re-publishes every
32349
+ * camera when it starts writing (D696; on who writes it, see
32350
+ * `autoClearAfterMs` above).
32022
32351
  *
32023
32352
  * See `RuntimeStateDurability`. Enforced by
32024
32353
  * `scripts/check-runtime-state-durability.ts`.
@@ -34401,8 +34730,7 @@ var ptzAutotrackCapability = {
34401
34730
  deviceNative: true,
34402
34731
  mode: "singleton",
34403
34732
  /**
34404
- * Two kinds of provider behind one name, the same shape `snapshot` and
34405
- * `doorbell` use:
34733
+ * Two kinds of provider behind one name, the same shape `snapshot` uses:
34406
34734
  *
34407
34735
  * - **Native**: the camera's own firmware autotrack, registered per device by
34408
34736
  * the driver when the probe says it exists (Reolink: yes; Hikvision:
@@ -34410,7 +34738,7 @@ var ptzAutotrackCapability = {
34410
34738
  * - **Wrapper**: the emulated implementation (`@camstack/system`'s `autotrack` builtin),
34411
34739
  * which follows a subject with `ptz.move` pulses driven by the detection
34412
34740
  * pipeline. `defaultActive: false` — the operator binds it per camera in
34413
- * the bindings UI, exactly as `virtual-doorbell` is bound.
34741
+ * the bindings UI.
34414
34742
  *
34415
34743
  * The binding chooses WHICH implementation answers; `setEnabled` stays the
34416
34744
  * one switch for the function either way. A camera never has both driving its
@@ -38449,47 +38777,6 @@ var zoneRulesCapability = {
38449
38777
  */
38450
38778
  durability: "restored"
38451
38779
  };
38452
- var NUMBER = {
38453
- kind: "fixed",
38454
- result: ["number"]
38455
- };
38456
- var BOOLEAN = {
38457
- kind: "fixed",
38458
- result: ["boolean"]
38459
- };
38460
- Object.freeze({
38461
- min: NUMBER,
38462
- max: NUMBER,
38463
- abs: NUMBER,
38464
- floor: NUMBER,
38465
- ceil: NUMBER,
38466
- sqrt: NUMBER,
38467
- round: NUMBER,
38468
- pow: NUMBER,
38469
- clamp: NUMBER,
38470
- avg: NUMBER,
38471
- sum: NUMBER,
38472
- age: NUMBER,
38473
- convert: NUMBER,
38474
- coalesce: { kind: "coalesce" },
38475
- any: BOOLEAN,
38476
- all: BOOLEAN,
38477
- within: BOOLEAN,
38478
- latest: {
38479
- kind: "fixed",
38480
- result: ["number", "null"]
38481
- },
38482
- number: {
38483
- kind: "fixed",
38484
- result: ["number", "null"]
38485
- },
38486
- rose: {
38487
- kind: "fixed",
38488
- result: ["number", "null"]
38489
- },
38490
- count: NUMBER
38491
- });
38492
- `${COMPOSED_DEVICE_STABLE_ID_PREFIX}`;
38493
38780
  /**
38494
38781
  * Accessory device helpers — shared across drivers.
38495
38782
  *
@@ -42435,6 +42722,12 @@ Object.freeze({
42435
42722
  addonId: null,
42436
42723
  access: "view"
42437
42724
  },
42725
+ "coreBlocks.listComposableCaps": {
42726
+ capName: "core-blocks",
42727
+ capScope: "system",
42728
+ addonId: null,
42729
+ access: "view"
42730
+ },
42438
42731
  "coreBlocks.listCompositions": {
42439
42732
  capName: "core-blocks",
42440
42733
  capScope: "system",
@@ -42513,6 +42806,18 @@ Object.freeze({
42513
42806
  addonId: null,
42514
42807
  access: "view"
42515
42808
  },
42809
+ "databaseSnapshot.listDatabases": {
42810
+ capName: "database-snapshot",
42811
+ capScope: "system",
42812
+ addonId: null,
42813
+ access: "view"
42814
+ },
42815
+ "databaseSnapshot.writeSnapshot": {
42816
+ capName: "database-snapshot",
42817
+ capScope: "system",
42818
+ addonId: null,
42819
+ access: "create"
42820
+ },
42516
42821
  "dataStoreProvider.aggregate": {
42517
42822
  capName: "data-store-provider",
42518
42823
  capScope: "system",
@@ -45249,6 +45554,12 @@ Object.freeze({
45249
45554
  addonId: null,
45250
45555
  access: "create"
45251
45556
  },
45557
+ "pipelineAnalytics.clearTrackRelation": {
45558
+ capName: "pipeline-analytics",
45559
+ capScope: "device",
45560
+ addonId: null,
45561
+ access: "delete"
45562
+ },
45252
45563
  "pipelineAnalytics.clearTracks": {
45253
45564
  capName: "pipeline-analytics",
45254
45565
  capScope: "device",
@@ -45501,6 +45812,12 @@ Object.freeze({
45501
45812
  addonId: null,
45502
45813
  access: "view"
45503
45814
  },
45815
+ "pipelineAnalytics.listTrackRelations": {
45816
+ capName: "pipeline-analytics",
45817
+ capScope: "device",
45818
+ addonId: null,
45819
+ access: "view"
45820
+ },
45504
45821
  "pipelineAnalytics.listTracks": {
45505
45822
  capName: "pipeline-analytics",
45506
45823
  capScope: "device",
@@ -45615,6 +45932,18 @@ Object.freeze({
45615
45932
  addonId: null,
45616
45933
  access: "create"
45617
45934
  },
45935
+ "pipelineAnalytics.setTrackPurity": {
45936
+ capName: "pipeline-analytics",
45937
+ capScope: "device",
45938
+ addonId: null,
45939
+ access: "create"
45940
+ },
45941
+ "pipelineAnalytics.setTrackRelation": {
45942
+ capName: "pipeline-analytics",
45943
+ capScope: "device",
45944
+ addonId: null,
45945
+ access: "create"
45946
+ },
45618
45947
  "pipelineAnalytics.startStorageMigrationMove": {
45619
45948
  capName: "pipeline-analytics",
45620
45949
  capScope: "device",
@@ -46053,6 +46382,12 @@ Object.freeze({
46053
46382
  addonId: null,
46054
46383
  access: "delete"
46055
46384
  },
46385
+ "pipelineOrchestrator.requestOccupancyLook": {
46386
+ capName: "pipeline-orchestrator",
46387
+ capScope: "system",
46388
+ addonId: null,
46389
+ access: "create"
46390
+ },
46056
46391
  "pipelineOrchestrator.resetNodePipelineDefaults": {
46057
46392
  capName: "pipeline-orchestrator",
46058
46393
  capScope: "system",
@@ -46119,6 +46454,12 @@ Object.freeze({
46119
46454
  addonId: null,
46120
46455
  access: "create"
46121
46456
  },
46457
+ "pipelineOrchestrator.setCameraSensors": {
46458
+ capName: "pipeline-orchestrator",
46459
+ capScope: "system",
46460
+ addonId: null,
46461
+ access: "create"
46462
+ },
46122
46463
  "pipelineOrchestrator.setCameraStepOverride": {
46123
46464
  capName: "pipeline-orchestrator",
46124
46465
  capScope: "system",
@@ -49529,6 +49870,11 @@ Object.freeze({
49529
49870
  form: "single",
49530
49871
  optional: false
49531
49872
  }],
49873
+ "pipelineAnalytics.clearTrackRelation": [{
49874
+ name: "deviceId",
49875
+ form: "single",
49876
+ optional: false
49877
+ }],
49532
49878
  "pipelineAnalytics.clearTracks": [{
49533
49879
  name: "deviceId",
49534
49880
  form: "single",
@@ -49679,6 +50025,11 @@ Object.freeze({
49679
50025
  form: "single",
49680
50026
  optional: false
49681
50027
  }],
50028
+ "pipelineAnalytics.listTrackRelations": [{
50029
+ name: "deviceId",
50030
+ form: "single",
50031
+ optional: false
50032
+ }],
49682
50033
  "pipelineAnalytics.listTracks": [{
49683
50034
  name: "deviceId",
49684
50035
  form: "single",
@@ -49749,6 +50100,16 @@ Object.freeze({
49749
50100
  form: "single",
49750
50101
  optional: false
49751
50102
  }],
50103
+ "pipelineAnalytics.setTrackPurity": [{
50104
+ name: "deviceId",
50105
+ form: "single",
50106
+ optional: false
50107
+ }],
50108
+ "pipelineAnalytics.setTrackRelation": [{
50109
+ name: "deviceId",
50110
+ form: "single",
50111
+ optional: false
50112
+ }],
49752
50113
  "pipelineAnalytics.wipeAllAnalytics": [{
49753
50114
  name: "deviceId",
49754
50115
  form: "single",
@@ -49819,6 +50180,11 @@ Object.freeze({
49819
50180
  form: "single",
49820
50181
  optional: false
49821
50182
  }],
50183
+ "pipelineOrchestrator.requestOccupancyLook": [{
50184
+ name: "deviceId",
50185
+ form: "single",
50186
+ optional: false
50187
+ }],
49822
50188
  "pipelineOrchestrator.resolvePipeline": [{
49823
50189
  name: "deviceId",
49824
50190
  form: "single",
@@ -49829,6 +50195,11 @@ Object.freeze({
49829
50195
  form: "single",
49830
50196
  optional: false
49831
50197
  }],
50198
+ "pipelineOrchestrator.setCameraSensors": [{
50199
+ name: "deviceId",
50200
+ form: "single",
50201
+ optional: false
50202
+ }],
49832
50203
  "pipelineOrchestrator.setCameraStepOverride": [{
49833
50204
  name: "deviceId",
49834
50205
  form: "single",
@@ -50975,6 +51346,18 @@ var STATE_SUMMARY_VARS = [
50975
51346
  systemEventKinds: [...SUMMARISABLE],
50976
51347
  systemEventDeliveries: ["summary"]
50977
51348
  },
51349
+ {
51350
+ name: "summarySection",
51351
+ label: "Summary: this section",
51352
+ description: "The section a per-section summary row is about (D698); on a summary sent as one message, every section it reports, comma-separated.",
51353
+ example: "Batterie scariche",
51354
+ group: "system",
51355
+ families: ["rule"],
51356
+ fields: [...RULE_TEXT],
51357
+ kinds: ["system"],
51358
+ systemEventKinds: [...SUMMARISABLE],
51359
+ systemEventDeliveries: ["summary"]
51360
+ },
50978
51361
  ...STATE_SUMMARY_SECTION_VARS.map((v) => ({
50979
51362
  name: v.name,
50980
51363
  label: v.label,
@@ -51051,6 +51434,37 @@ var STATE_SUMMARY_VARS = [
51051
51434
  [...RULE_TEXT],
51052
51435
  ...STATE_SUMMARY_VARS
51053
51436
  ];
51437
+ new Set([
51438
+ "disarmed",
51439
+ "armed_home",
51440
+ "armed_away",
51441
+ "armed_night",
51442
+ "armed_vacation",
51443
+ "armed_custom_bypass",
51444
+ "arming",
51445
+ "disarming",
51446
+ "pending",
51447
+ "triggered",
51448
+ "open",
51449
+ "opening",
51450
+ "closing",
51451
+ "closed",
51452
+ "stopped",
51453
+ "locked",
51454
+ "unlocked",
51455
+ "locking",
51456
+ "unlocking",
51457
+ "jammed",
51458
+ "on",
51459
+ "off",
51460
+ "home",
51461
+ "not_home",
51462
+ "matched",
51463
+ "diverged",
51464
+ "unknown",
51465
+ "latched",
51466
+ "live"
51467
+ ]);
51054
51468
  /**
51055
51469
  * TimelapseRule — the STANDALONE scheduled timelapse producer's rule model.
51056
51470
  *
@@ -51282,6 +51696,25 @@ TimelapseRuleInputSchema.extend({
51282
51696
  createdAt: number(),
51283
51697
  updatedAt: number()
51284
51698
  });
51699
+ async function readHubMotionDetected(deviceState, deviceId) {
51700
+ let slice;
51701
+ try {
51702
+ slice = await deviceState.getCapSlice.query({
51703
+ deviceId,
51704
+ capName: "motion"
51705
+ });
51706
+ } catch (err) {
51707
+ const reason = err instanceof Error ? err.message : String(err);
51708
+ throw new Error(`motion state of device ${deviceId} is unreadable: ${reason}`, { cause: err });
51709
+ }
51710
+ const detected = slice?.["detected"];
51711
+ if (typeof detected !== "boolean") throw new Error(`motion state of device ${deviceId} is not published yet (unknown)`);
51712
+ return detected;
51713
+ }
51714
+ MotionOnMotionChangedDataSchema.omit({ triggeredBy: true });
51715
+ function providerMotionEvent(source, data) {
51716
+ return createEvent(EventCategory.ProviderMotion, source, data);
51717
+ }
51285
51718
  object({
51286
51719
  /**
51287
51720
  * Fraction of the box's own size added on EACH side before cutting.
@@ -55750,16 +56183,18 @@ var WyzeCamera = class extends BaseDevice {
55750
56183
  return null;
55751
56184
  }
55752
56185
  }
56186
+ /**
56187
+ * The native `motion` cap. This provider writes NO `motion` slice (D696): the
56188
+ * orchestrator is its only writer, with the EFFECTIVE motion, on the hub.
56189
+ * `isDetected` answers from the HUB's slice; an unreadable hub, or a slice
56190
+ * nobody has published yet, fails the call — never `false` for unknown
56191
+ * (D49, D393).
56192
+ */
55753
56193
  registerMotionProvider() {
55754
56194
  this.ctx.registerNativeCap(motionCapability, { isDetected: async ({ deviceId }) => {
55755
- if (deviceId !== this.id) return false;
55756
- return this.state.motion.detected ?? false;
56195
+ if (deviceId !== this.id) throw new Error(`WyzeCamera: deviceId mismatch, expected ${this.id}, got ${deviceId}`);
56196
+ return readHubMotionDetected(this.ctx.api.deviceState, this.id);
55757
56197
  } });
55758
- this.setCapSlice(motionCapability, {
55759
- detected: false,
55760
- lastDetectedAt: null,
55761
- autoClearAfterMs: null
55762
- });
55763
56198
  }
55764
56199
  /**
55765
56200
  * Start the configured motion source. `cloud` polls the Wyze events API
@@ -55803,12 +56238,14 @@ var WyzeCamera = class extends BaseDevice {
55803
56238
  }
55804
56239
  }
55805
56240
  /**
55806
- * Emit `MotionOnMotionChanged` (`source: 'onboard'`). The pipeline-runner
55807
- * subscribes and is the sole writer of the `motion` runtime-state slice
55808
- * — symmetric with the Reolink onboard-motion path.
56241
+ * Emit the camera's RAW motion push as `ProviderMotion`
56242
+ * (`source: 'onboard'`, D673). The orchestrator's camera-sensors bridge
56243
+ * re-emits it as the effective `MotionOnMotionChanged`, and the
56244
+ * orchestrator is the only writer of the camera's `motion` runtime-state
56245
+ * slice (D696) — symmetric with the Reolink onboard-motion path.
55809
56246
  */
55810
56247
  emitMotion(timestamp) {
55811
- this.ctx.eventBus.emit(createEvent(EventCategory.MotionOnMotionChanged, {
56248
+ this.ctx.eventBus.emit(providerMotionEvent({
55812
56249
  type: "device",
55813
56250
  id: this.id,
55814
56251
  addonId: WYZE_ADDON_ID,