@camstack/addon-export-alexa 1.2.21 → 1.2.23

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.
@@ -26,7 +26,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
26
26
  //#endregion
27
27
  let node_crypto = require("node:crypto");
28
28
  node_crypto = __toESM(node_crypto);
29
- //#region ../types/dist/event-category-Cv9dO26A.mjs
29
+ //#region ../types/dist/event-category-Bxo5yJjt.mjs
30
30
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
31
31
  EventCategory["SystemBoot"] = "system.boot";
32
32
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -233,6 +233,33 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
233
233
  EventCategory["PipelineCameraAssigned"] = "pipeline.camera-assigned";
234
234
  EventCategory["PipelineCameraUnassigned"] = "pipeline.camera-unassigned";
235
235
  /**
236
+ * A node the orchestrator would otherwise place cameras on has NO usable
237
+ * inference device: the operator enabled one or more accelerators there and
238
+ * the live probe reports every one of them unavailable. Emitted once per
239
+ * TRANSITION into that state (never per dispatch), and the node is dropped
240
+ * from the placement candidate set for as long as it holds.
241
+ *
242
+ * This exists because the state was previously invisible: little-unraid
243
+ * absorbed 283k inference errors in a day while still being handed cameras,
244
+ * and nothing in the system said so.
245
+ *
246
+ * A node with no accelerators configured at all is NOT this — its devices
247
+ * are `disabled`, not `unavailable`, and the runner's default CPU pool
248
+ * serves it exactly as before.
249
+ */
250
+ EventCategory["PipelineNodeInferenceUnavailable"] = "pipeline.node-inference-unavailable";
251
+ /**
252
+ * A camera has an OPEN detection session and has produced no detection at
253
+ * all for longer than the blind threshold — the camera is being decoded and
254
+ * inferred and is returning nothing. Emitted once per transition into blind,
255
+ * per camera.
256
+ *
257
+ * The failure it reports: a 1h43 detection blackout on the entrance camera
258
+ * that nobody noticed, because "a camera that detects nothing" and "a quiet
259
+ * camera" produce byte-identical silence.
260
+ */
261
+ EventCategory["PipelineDetectionBlind"] = "pipeline.detection-blind";
262
+ /**
236
263
  * Per-camera pipeline config was mutated by the orchestrator
237
264
  * (3-level settings change via `setAgentAddonDefaults` /
238
265
  * `setCameraStepToggle` / `setCameraPipelineForAgent` or a
@@ -3024,6 +3051,9 @@ function handlePipeResult(left, next, ctx) {
3024
3051
  fallback: left.fallback
3025
3052
  }, ctx);
3026
3053
  }
3054
+ var $ZodPreprocess = /*@__PURE__*/ $constructor("$ZodPreprocess", (inst, def) => {
3055
+ $ZodPipe.init(inst, def);
3056
+ });
3027
3057
  var $ZodReadonly = /*@__PURE__*/ $constructor("$ZodReadonly", (inst, def) => {
3028
3058
  $ZodType.init(inst, def);
3029
3059
  defineLazy(inst._zod, "propValues", () => def.innerType._zod.propValues);
@@ -5209,6 +5239,10 @@ function pipe(in_, out) {
5209
5239
  out
5210
5240
  });
5211
5241
  }
5242
+ var ZodPreprocess = /*@__PURE__*/ $constructor("ZodPreprocess", (inst, def) => {
5243
+ ZodPipe.init(inst, def);
5244
+ $ZodPreprocess.init(inst, def);
5245
+ });
5212
5246
  var ZodReadonly = /*@__PURE__*/ $constructor("ZodReadonly", (inst, def) => {
5213
5247
  $ZodReadonly.init(inst, def);
5214
5248
  ZodType.init(inst, def);
@@ -5267,6 +5301,13 @@ function _instanceof(cls, params = {}) {
5267
5301
  };
5268
5302
  return inst;
5269
5303
  }
5304
+ function preprocess(fn, schema) {
5305
+ return new ZodPreprocess({
5306
+ type: "pipe",
5307
+ in: transform(fn),
5308
+ out: schema
5309
+ });
5310
+ }
5270
5311
  //#endregion
5271
5312
  //#region ../../node_modules/zod/v4/classic/compat.js
5272
5313
  /** @deprecated Use the raw string literal codes instead, e.g. "invalid_type". */
@@ -12445,6 +12486,17 @@ var LlmImageSchema = object({
12445
12486
  bytes: _instanceof(Uint8Array),
12446
12487
  mimeType: string()
12447
12488
  });
12489
+ /**
12490
+ * Retry policy. `enabled: false` is NOT the same as `maxAttempts: 1` in intent —
12491
+ * the flag is what a consumer table flips, the count is what the operator tunes.
12492
+ * A retry doubles the wall time of a call, so the two gates that run inside a
12493
+ * notification's budget keep it off (see `CONSUMER_RETRY_POLICY` in addon-ai).
12494
+ */
12495
+ var LlmRetryPolicySchema = object({
12496
+ enabled: boolean().default(false),
12497
+ /** Total attempts INCLUDING the first. 1 = no retry. */
12498
+ maxAttempts: number().int().min(1).max(5).default(1)
12499
+ });
12448
12500
  var LlmGenerateBaseInputSchema = object({
12449
12501
  /** Collection routing (the notification-output posture). */
12450
12502
  addonId: string().optional(),
@@ -12459,7 +12511,28 @@ var LlmGenerateBaseInputSchema = object({
12459
12511
  jsonSchema: record(string(), unknown()).optional(),
12460
12512
  /** Per-call override of the profile default. */
12461
12513
  maxTokens: number().int().positive().optional(),
12462
- temperature: number().optional()
12514
+ temperature: number().optional(),
12515
+ /** Per-call override of the profile default (nucleus sampling). */
12516
+ topP: number().min(0).max(1).optional(),
12517
+ /** Per-call override of the profile default (top-k sampling). */
12518
+ topK: number().int().positive().optional(),
12519
+ /** Per-call override of `profile.timeoutMs` — the total generation bound. */
12520
+ timeoutMs: number().int().positive().optional(),
12521
+ /** Per-call override; beats both the consumer table and the profile. */
12522
+ retry: LlmRetryPolicySchema.optional(),
12523
+ /**
12524
+ * Caller-minted id that makes this generation CANCELLABLE.
12525
+ *
12526
+ * Without it a caller that stops waiting cannot stop the work: the gates race
12527
+ * the call against 8 s and free their own slot when the timer wins, while the
12528
+ * generation upstream keeps running to `profile.timeoutMs` — 60 s by default,
12529
+ * on a single-threaded local model. The per-camera bound then counts WAITS,
12530
+ * not generations, and the real load is unbounded.
12531
+ *
12532
+ * `AbortSignal` cannot cross a process boundary; an id can. Pass one here and
12533
+ * `llm.cancel({ requestId })` tears the socket down.
12534
+ */
12535
+ requestId: string().optional()
12463
12536
  });
12464
12537
  /**
12465
12538
  * `llm-runtime` — node-side managed llama.cpp executor (spec §4). Registered
@@ -12472,6 +12545,18 @@ var LlmGenerateBaseInputSchema = object({
12472
12545
  * Resource ceiling = llama-server flags + idleStopMinutes ONLY (no RSS
12473
12546
  * watchdog — operator decision #3).
12474
12547
  */
12548
+ /**
12549
+ * A companion artifact that MUST land beside the main GGUF: the `mmproj`
12550
+ * projector of a vision model, or shards 2..N of a split GGUF. Carried on the
12551
+ * REF rather than looked up at install time, so what the operator approved in
12552
+ * the preview is exactly what the node downloads.
12553
+ */
12554
+ var ManagedModelExtraFileSchema = object({
12555
+ url: string(),
12556
+ filename: string(),
12557
+ sizeBytes: number(),
12558
+ sha256: string().optional()
12559
+ });
12475
12560
  var ManagedModelRefSchema = discriminatedUnion("kind", [
12476
12561
  object({
12477
12562
  kind: literal("catalog"),
@@ -12480,7 +12565,11 @@ var ManagedModelRefSchema = discriminatedUnion("kind", [
12480
12565
  object({
12481
12566
  kind: literal("url"),
12482
12567
  url: string(),
12483
- sha256: string().optional()
12568
+ sha256: string().optional(),
12569
+ /** Picker/status label; the file basename when absent. */
12570
+ label: string().optional(),
12571
+ sizeBytes: number().optional(),
12572
+ extraFiles: array(ManagedModelExtraFileSchema).optional()
12484
12573
  }),
12485
12574
  object({
12486
12575
  kind: literal("path"),
@@ -12498,13 +12587,82 @@ var ManagedRuntimeConfigSchema = object({
12498
12587
  gpuLayers: number().int().default(0),
12499
12588
  /** Default: cpus-2, clamped ≥1 (resolved node-side). */
12500
12589
  threads: number().int().optional(),
12501
- /** Concurrent slots. */
12590
+ /** Concurrent slots (`--parallel`). */
12502
12591
  parallel: number().int().default(1),
12592
+ /** Logical batch size (`-b`). Larger = faster prompt ingest, more RAM. */
12593
+ batchSize: number().int().positive().optional(),
12594
+ /** Physical batch / micro-batch (`-ub`). */
12595
+ ubatchSize: number().int().positive().optional(),
12596
+ /**
12597
+ * `--flash-attn`. Cuts KV-cache memory on the backends that implement it and
12598
+ * is a no-op elsewhere, so it is offered rather than assumed.
12599
+ */
12600
+ flashAttention: boolean().default(false),
12601
+ /**
12602
+ * `--mlock`. Pins the weights in RAM so the OS cannot page them out mid
12603
+ * inference. Costs the full model size in resident memory — which is exactly
12604
+ * what the RAM budget is counting.
12605
+ */
12606
+ mlock: boolean().default(false),
12607
+ /**
12608
+ * `--no-mmap`. Reads the whole GGUF up front instead of mapping it. Slower to
12609
+ * start, but avoids the page-fault stalls a network or spinning-disk model
12610
+ * store produces on every first token.
12611
+ */
12612
+ noMmap: boolean().default(false),
12613
+ /** `--cache-type-k` / `--cache-type-v` — quantising the KV cache is the
12614
+ * cheapest way to fit a longer context in the same RAM. */
12615
+ cacheTypeK: _enum([
12616
+ "f32",
12617
+ "f16",
12618
+ "q8_0",
12619
+ "q5_1",
12620
+ "q5_0",
12621
+ "q4_1",
12622
+ "q4_0"
12623
+ ]).optional(),
12624
+ cacheTypeV: _enum([
12625
+ "f32",
12626
+ "f16",
12627
+ "q8_0",
12628
+ "q5_1",
12629
+ "q5_0",
12630
+ "q4_1",
12631
+ "q4_0"
12632
+ ]).optional(),
12633
+ /**
12634
+ * Escape hatch for llama-server flags this schema does NOT model — `--jinja`
12635
+ * (which most vision chat templates need and some language-only models
12636
+ * dislike), `--cont-batching`, `--rope-scaling`, …
12637
+ *
12638
+ * It is NOT a second place to set the flags above. A token that collides
12639
+ * with a typed field is REJECTED at start, naming the field that owns it
12640
+ * (`assertNoOwnedFlags`), because two knobs writing the same argv is exactly
12641
+ * the "two switches that disagree" failure this repo has already shipped
12642
+ * twice (D62).
12643
+ */
12644
+ extraArgs: array(string()).default([]),
12503
12645
  /** Else lazy: first generate boots it. */
12504
12646
  autoStart: boolean().default(false),
12505
12647
  /** 0 = never; frees RAM after quiet periods. */
12506
12648
  idleStopMinutes: number().int().default(30)
12507
12649
  });
12650
+ /**
12651
+ * Where a multi-GB install currently is. A single 0..1 fraction cannot answer
12652
+ * "is it stuck?" for an install that is three files (shards + mmproj) followed
12653
+ * by a sha256 pass over 22 GB — during which the fraction sat at 1.0 and the
12654
+ * node looked hung. Phase + file + bytes is the smallest shape that does.
12655
+ */
12656
+ var LlmDownloadProgressSchema = object({
12657
+ phase: _enum(["downloading", "verifying"]),
12658
+ /** The artifact currently moving, e.g. `mmproj-F16.gguf`. */
12659
+ file: string(),
12660
+ fileIndex: number().int(),
12661
+ fileCount: number().int(),
12662
+ /** Across the WHOLE install, not the current file. */
12663
+ downloadedBytes: number(),
12664
+ totalBytes: number().optional()
12665
+ });
12508
12666
  var LlmRuntimeStatusSchema = object({
12509
12667
  /** Status is ALWAYS node-qualified. */
12510
12668
  nodeId: string(),
@@ -12521,6 +12679,8 @@ var LlmRuntimeStatusSchema = object({
12521
12679
  modelPath: string().optional(),
12522
12680
  modelId: string().optional(),
12523
12681
  downloadProgress: number().min(0).max(1).optional(),
12682
+ /** Detail behind `downloadProgress`; present for the same lifetime. */
12683
+ download: LlmDownloadProgressSchema.optional(),
12524
12684
  lastError: string().optional(),
12525
12685
  crashesInWindow: number(),
12526
12686
  /** Child RSS (sampled best-effort). */
@@ -12531,7 +12691,14 @@ var LlmNodeModelSchema = object({
12531
12691
  file: string(),
12532
12692
  sizeBytes: number(),
12533
12693
  catalogId: string().optional(),
12534
- installedAt: number().optional()
12694
+ installedAt: number().optional(),
12695
+ /**
12696
+ * Absolute path on the node. Present so a file that is on disk but matches
12697
+ * no catalog entry — a custom Hugging Face install, or a GGUF the operator
12698
+ * copied in by hand — is still SELECTABLE, as a `{kind:'path'}` ref. Without
12699
+ * it the picker could list such a file and do nothing with it.
12700
+ */
12701
+ path: string().optional()
12535
12702
  });
12536
12703
  var LlmRuntimeDiskUsageSchema = object({
12537
12704
  nodeId: string(),
@@ -12587,10 +12754,47 @@ var LlmProfileSchema = object({
12587
12754
  baseUrl: string().optional(),
12588
12755
  /** ConfigUISchema type:'password' — never round-trips (spec §5). */
12589
12756
  apiKey: string().optional(),
12757
+ /** Vision on/off. A vision call against a `false` profile is REFUSED, never
12758
+ * degraded to text — that shipped once and produced a confident answer to a
12759
+ * question about a picture nobody sent. */
12590
12760
  supportsVision: boolean(),
12591
12761
  temperature: number().min(0).max(2).optional(),
12762
+ /** Nucleus sampling. Every wire we speak has it. */
12763
+ topP: number().min(0).max(1).optional(),
12764
+ /** Top-k sampling. Carried only by the wires that have it — NEITHER OpenAI
12765
+ * wire does, and the client drops it there (measured: the request body gets
12766
+ * `top_p` and no `top_k`). The profile editor hides the field wherever it
12767
+ * would change nothing; `KINDS_WITH_TOP_K` is the single owner of that list. */
12768
+ topK: number().int().positive().optional(),
12592
12769
  maxTokens: number().int().positive().optional(),
12770
+ /** Prompt context window. Advisory for cloud kinds (they enforce their own);
12771
+ * for `managed-local` it is the llama.cpp `--ctx-size` the runtime starts
12772
+ * the model with, so it is the one field that changes a PROCESS. */
12773
+ contextLength: number().int().positive().optional(),
12774
+ /** Default system prompt. A caller's `system` REPLACES it (never appends —
12775
+ * two system prompts fighting is worse than either alone). */
12776
+ systemPrompt: string().optional(),
12777
+ /** Total generation bound — the only one a unary call has. */
12593
12778
  timeoutMs: number().int().positive().default(6e4),
12779
+ /** The TCP handshake only — "is the port even open". NOT the wait for
12780
+ * response headers: on the LM Studio / llama-server wire those are written
12781
+ * once the model has finished loading, so they belong to the bound below. */
12782
+ connectTimeoutMs: number().int().positive().default(1e4),
12783
+ /** Accepted, but no output yet — response headers included, because a cold
12784
+ * GPU load is exactly what happens before them. */
12785
+ firstTokenTimeoutMs: number().int().positive().default(12e4),
12786
+ /** Output started then stopped. */
12787
+ idleTimeoutMs: number().int().positive().default(6e4),
12788
+ /** Profile-level default. The per-consumer table and a per-call override
12789
+ * both beat it — see `resolveRetryPolicy`. */
12790
+ retry: LlmRetryPolicySchema.default({
12791
+ enabled: false,
12792
+ maxAttempts: 1
12793
+ }),
12794
+ /** Whether this profile may use tools. The tool-call plumbing rides the
12795
+ * library; the REGISTRY of callable tools is ours and is empty in v1, so a
12796
+ * `true` here buys the wiring, not behaviour, until tools are registered. */
12797
+ toolsEnabled: boolean().default(false),
12594
12798
  extraHeaders: record(string(), string()).optional(),
12595
12799
  /** kind === 'managed-local' only (spec §4). */
12596
12800
  runtime: ManagedRuntimeConfigSchema.optional()
@@ -12640,6 +12844,36 @@ var ManagedModelCatalogEntrySchema = object({
12640
12844
  /** Vision models: companion projector file. */
12641
12845
  mmprojUrl: string().optional()
12642
12846
  });
12847
+ /**
12848
+ * The outcome of turning one operator-typed Hugging Face reference into a
12849
+ * download plan. A RESULT, never a throw: "this repo has 24 quantizations and
12850
+ * I will not pick for you" is a normal answer the UI has to render, not an
12851
+ * exception.
12852
+ *
12853
+ * `candidates` is the whole reason the refusal is usable — every string in it
12854
+ * is a tag that resolves when pasted back as `<org>/<repo>:<TAG>`.
12855
+ */
12856
+ var HfModelResolutionSchema = discriminatedUnion("ok", [object({
12857
+ ok: literal(true),
12858
+ /** Ready to hand to `installModel` unchanged. */
12859
+ model: ManagedModelRefSchema,
12860
+ label: string(),
12861
+ repo: string(),
12862
+ quantization: string(),
12863
+ purpose: _enum(["text", "vision"]),
12864
+ totalBytes: number(),
12865
+ /** mmproj + shards, for the preview: an operator approving 23 GB should
12866
+ * see that 0.9 GB of it is a projector they did not name. */
12867
+ extraFilenames: array(string())
12868
+ }), object({
12869
+ ok: literal(false),
12870
+ code: string(),
12871
+ message: string(),
12872
+ candidates: array(string()).optional(),
12873
+ /** Set when the refusal was only the ceiling: re-calling with
12874
+ * `maxBytes: requiredBytes` is the operator's explicit override. */
12875
+ requiredBytes: number().optional()
12876
+ })]);
12643
12877
  var LlmRuntimeNodeSchema = object({
12644
12878
  nodeId: string(),
12645
12879
  reachable: boolean(),
@@ -12652,7 +12886,10 @@ var ProfileRefInputSchema = object({
12652
12886
  addonId: string(),
12653
12887
  profileId: string()
12654
12888
  });
12655
- method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(GenerateVisionInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
12889
+ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(GenerateVisionInputSchema, LlmGenerateResultSchema, { kind: "mutation" }), method(object({
12890
+ addonId: string().optional(),
12891
+ requestId: string()
12892
+ }), _void(), { kind: "mutation" }), method(object({}), array(LlmProfileKindDescriptorSchema)), method(object({}), array(LlmProfileSchema)), method(object({ profile: LlmProfileSchema }), LlmProfileSchema, {
12656
12893
  kind: "mutation",
12657
12894
  auth: "admin"
12658
12895
  }), method(ProfileRefInputSchema, _void(), {
@@ -12673,6 +12910,15 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
12673
12910
  consumer: string().optional(),
12674
12911
  profileId: string().optional()
12675
12912
  }), array(LlmUsageRollupSchema)), method(object({}), array(ManagedModelCatalogEntrySchema)), method(object({}), array(LlmRuntimeNodeSchema)), method(object({ nodeId: string() }), array(LlmNodeModelSchema)), method(object({
12913
+ /** `https://huggingface.co/<org>/<repo>/resolve/main/<f>.gguf`,
12914
+ * `<org>/<repo>/<f>.gguf`, `<org>/<repo>` or `<org>/<repo>:<QUANT>`. */
12915
+ ref: string(),
12916
+ /** Explicit ceiling override, in bytes. Absent = the built-in ceiling. */
12917
+ maxBytes: number().positive().optional()
12918
+ }), HfModelResolutionSchema, {
12919
+ kind: "mutation",
12920
+ auth: "admin"
12921
+ }), method(object({
12676
12922
  nodeId: string(),
12677
12923
  model: ManagedModelRefSchema
12678
12924
  }), _void(), {
@@ -14282,6 +14528,8 @@ var NcSystemEventKindSchema = _enum([
14282
14528
  "stream-offline",
14283
14529
  "node-online",
14284
14530
  "node-offline",
14531
+ "node-inference-unavailable",
14532
+ "detection-blind",
14285
14533
  "addon-update-available",
14286
14534
  "server-update-available",
14287
14535
  "alarm-triggered",
@@ -14343,7 +14591,16 @@ var NcScheduleSchema = object({
14343
14591
  });
14344
14592
  /** Fuzzy plate matcher — OCR noise makes exact match useless (spec row 12/13). */
14345
14593
  var NcPlateMatcherSchema = object({
14346
- values: array(string().min(1)).min(1),
14594
+ /**
14595
+ * Plate texts (or gallery vehicle names) to match. EMPTY = **any plate the
14596
+ * pipeline could read** — the plate half of "no selection = no narrowing",
14597
+ * and the switch that says this rule is about vehicles that were IDENTIFIED
14598
+ * rather than merely seen. A subject carrying no plate still fails.
14599
+ *
14600
+ * The `.min(1)` this used to carry made that state unauthorable; nothing has
14601
+ * ever persisted an empty list, so widening it cannot change an existing rule.
14602
+ */
14603
+ values: array(string().min(1)),
14347
14604
  /** Max Levenshtein distance after normalization (uppercase alphanumeric). */
14348
14605
  maxDistance: number().int().min(0).max(3).default(1)
14349
14606
  });
@@ -14377,28 +14634,36 @@ var NcOccupancyConditionSchema = object({
14377
14634
  /**
14378
14635
  * Audio condition (IMMEDIATE trigger) — a rule on SOUND, not on a picture.
14379
14636
  *
14380
- * Operator-approved vocabulary (2026-08-12, option A — the same one the
14381
- * reference notifier uses, so an operator moving between them re-uses what
14382
- * they already know): a rule matches when, over a sampling window of
14383
- * `samplingSeconds`, at least `hitPercent`% of the audio samples in that
14384
- * window are HITS. A sample is a hit when it satisfies BOTH present filters:
14385
- *
14386
- * - `dbThreshold` — its level is at or above this many dBFS (see
14387
- * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale);
14388
- * - `labels` — the classifier put at least one of these labels on it.
14389
- *
14390
- * Both are OPTIONAL and independent, which is the point of the shape: a
14391
- * loudness rule ("something loud at 3am") needs no model to be right, and a
14392
- * label rule ("a dog barked") needs no threshold. **Fail-closed when NEITHER
14393
- * is given** — a window in which every sample is trivially a hit would fire on
14394
- * silence, so the engine refuses such a condition rather than notifying on
14395
- * nothing (the schema cannot express "at least one of" without becoming a
14396
- * ZodEffects the cap path would have to special-case).
14397
- *
14398
- * `hitPercent` is over the samples the window actually HOLDS, and the window
14399
- * must be FULL before it can match — a window that has been open for two
14400
- * seconds of its ten is 100% of nothing, and firing on it would make
14401
- * `samplingSeconds` decorative.
14637
+ * **TWO EXCLUSIVE MODES** (operator decision 2026-08-14, D157). Which one a
14638
+ * rule is in is not a stored field — it is WHICH FILTER the rule carries, so
14639
+ * there is no second switch that can disagree with the first and every rule
14640
+ * authored before the decision migrates for free (`audioModeOf`):
14641
+ *
14642
+ * - **LABEL mode — `labels` present.** The rule fires on the FIRST frame the
14643
+ * classifier labels with one of them. No window, no percentage:
14644
+ * `hitPercent` and `samplingSeconds` are ignored, and the rule's own
14645
+ * `throttle` cooldown is the only brake. The per-label confidence floor is
14646
+ * the analyzer's (`classificationMinScore`, per device) — a label only
14647
+ * reaches this condition if the classifier was already confident enough.
14648
+ * - **LEVEL mode — `dbThreshold` present, no labels.** The sampling window IS
14649
+ * the condition: at least `hitPercent`% of the samples over
14650
+ * `samplingSeconds` must be at or above `dbThreshold` dBFS (see
14651
+ * {@link NC_AUDIO_DBFS_FLOOR}: negative-going, `0` = full scale). The window
14652
+ * must be FULL before it can match — a window open for two of its ten
14653
+ * seconds is 100% of nothing.
14654
+ *
14655
+ * **Why label mode has no window.** It had one, and it never fired: the
14656
+ * analyzer emits ~1 audio frame per second but YAMNet only LABELS one to three
14657
+ * of them per episode, even through continuous crying. The measured maximum
14658
+ * `hitPercent` over the whole live history was 40 — under the shipped default
14659
+ * of 60, so a label rule could not fire at all, ever. A percentage of frames is
14660
+ * the wrong question to ask of a sparse classifier.
14661
+ *
14662
+ * **Fail-closed when NEITHER is given** — every sample would be a trivial hit
14663
+ * and the rule would fire on silence. The schema cannot express "exactly one
14664
+ * of" without becoming a ZodEffects the cap path would have to special-case, so
14665
+ * the exclusivity is enforced where every editor writes (`patchAudio`) and a
14666
+ * legacy rule carrying both resolves to LABEL (the mode that fires).
14402
14667
  *
14403
14668
  * Labels are the audio macro classes (`AUDIO_MACRO_LABELS` / the NC taxonomy's
14404
14669
  * `audio-*` ids). Both spellings are accepted — the matcher normalizes the
@@ -14406,13 +14671,13 @@ var NcOccupancyConditionSchema = object({
14406
14671
  * an operator who typed `dog` mean the same thing.
14407
14672
  */
14408
14673
  var NcAudioConditionSchema = object({
14409
- /** Audio macro labels; absent = any sound (level-only rule). */
14674
+ /** LABEL MODE: audio macro labels. Present ⇒ fires on the first labelled frame. */
14410
14675
  labels: array(string().min(1)).min(1).optional(),
14411
- /** Level floor in dBFS (negative-going, `0` = full scale); absent = any level. */
14676
+ /** LEVEL MODE: floor in dBFS (negative-going, `0` = full scale). */
14412
14677
  dbThreshold: number().min(-96).max(0).optional(),
14413
- /** Percentage of the window's samples that must be hits (1–100). */
14678
+ /** LEVEL MODE ONLY: percentage of the window's samples that must be hits (1–100). */
14414
14679
  hitPercent: number().int().min(1).max(100).default(60),
14415
- /** Length of the sampling window in seconds. */
14680
+ /** LEVEL MODE ONLY: length of the sampling window in seconds. */
14416
14681
  samplingSeconds: number().int().min(1).max(300).default(10)
14417
14682
  });
14418
14683
  /**
@@ -14550,13 +14815,81 @@ var NcRuleActionsSchema = object({
14550
14815
  */
14551
14816
  buttons: array(NcRuleNotificationButtonSchema).max(8).optional()
14552
14817
  });
14818
+ /**
14819
+ * "This rule applies only while `deviceId` is in one of `states`."
14820
+ *
14821
+ * The states are the DEVICE's own vocabulary — `AlarmState` for a panel,
14822
+ * `on`/`off` for a switch — not a normalised set, because normalising would
14823
+ * make the condition lie about devices whose states have no equivalent.
14824
+ *
14825
+ * An unreadable state does NOT match: see the engine's fail-closed gate. A
14826
+ * condition that fired on "I could not read it" would be worse than no gate.
14827
+ */
14828
+ var NcDeviceStateConditionSchema = object({
14829
+ deviceId: number().int(),
14830
+ /** Any of these matches. */
14831
+ states: array(string().min(1)).min(1)
14832
+ });
14833
+ /**
14834
+ * "This rule applies only while scene `sceneId` is `matched` / `diverged`."
14835
+ *
14836
+ * A GATE, not a trigger. `occupancy` and `audio` each DISCRIMINATE their rule —
14837
+ * carrying one makes the rule fire on that subject and nothing else. Scene is
14838
+ * the other shape entirely, the `deviceState` shape: it narrows a rule that
14839
+ * already has a trigger ("tell me about a person at the front door, but only
14840
+ * while the bin is still out"). That is why it composes with every delivery
14841
+ * instead of owning one, and why no new `NcDelivery` member and no new subject
14842
+ * kind exist for it — see D159.
14843
+ *
14844
+ * ── Identity ───────────────────────────────────────────────────────────────
14845
+ * `sceneId` is `SceneMonitor.id`, a `randomUUID()` minted by `createScene` —
14846
+ * globally unique, so it needs no device to disambiguate it. `deviceId` is
14847
+ * carried as a HINT for the editor and for the log line, never as part of the
14848
+ * lookup key: a rule whose hint drifted must still gate correctly.
14849
+ *
14850
+ * ── Which boolean ──────────────────────────────────────────────────────────
14851
+ * `latched` ABSENT means "whatever the scene itself says" — `SceneMonitor.emit`
14852
+ * already declares which boolean drives notification rules, and a second knob
14853
+ * that could disagree with it is exactly the D62 failure. Set it only to
14854
+ * override one rule against the scene's own default.
14855
+ *
14856
+ * - LIVE reading (`emit`/`latched` resolve to live): passes iff
14857
+ * `verdict === requiredState`. `unknown` — no reference for this light, view
14858
+ * shifted, no snapshot — passes NEITHER. A scene that cannot judge is not
14859
+ * evidence, in either direction.
14860
+ * - LATCHED reading: passes iff `latched === (requiredState === 'diverged')`.
14861
+ * The latch is a durable fact about the past ("it has diverged since I armed
14862
+ * it"), so a camera that has gone dark does not clear it — that is the whole
14863
+ * reason the operator asked for a latch.
14864
+ *
14865
+ * The gate reads an in-memory mirror (`NcSceneStateCache`) refreshed OFF the
14866
+ * event path, never the cap: D49. A mirror that has never loaded, or a scene it
14867
+ * does not carry, reads absent and the rule does NOT fire — fail closed, and
14868
+ * said out loud in the log rather than dropped in silence.
14869
+ */
14870
+ var NcSceneConditionSchema = object({
14871
+ /** `SceneMonitor.id` — the uuid the cap mints. The whole lookup key. */
14872
+ sceneId: string().min(1),
14873
+ /** The camera the scene lives on. A hint for the editor and the log line. */
14874
+ deviceId: number().int().optional(),
14875
+ /** The state the scene must be in for the rule to fire. */
14876
+ requiredState: _enum(["matched", "diverged"]),
14877
+ /**
14878
+ * Read the LATCH (`true`) or the LIVE verdict (`false`). Absent = follow the
14879
+ * scene's own `emit` field, which is the only place that decision belongs.
14880
+ */
14881
+ latched: boolean().optional()
14882
+ });
14553
14883
  var NcConditionsSchema = object({
14554
14884
  /** Gate on ANOTHER device's current state (the alarm armed, a switch on). */
14555
- deviceState: object({
14556
- deviceId: number().int(),
14557
- /** Any of these matches. */
14558
- states: array(string().min(1)).min(1)
14559
- }).optional(),
14885
+ deviceState: NcDeviceStateConditionSchema.optional(),
14886
+ /**
14887
+ * Gate on a SCENE's state — "only while the bin is still out". Composes with
14888
+ * every trigger (detection, occupancy, audio, sensor, package, track-end);
14889
+ * unlike `occupancy`/`audio` it discriminates nothing. See
14890
+ * {@link NcSceneCondition} and D159.
14891
+ */
14892
+ scene: NcSceneConditionSchema.optional(),
14560
14893
  /** Device scope — absent = all devices. */
14561
14894
  devices: array(number()).optional(),
14562
14895
  /** Detector class names (any overlap with the record's class set). */
@@ -14582,18 +14915,47 @@ var NcConditionsSchema = object({
14582
14915
  */
14583
14916
  labelEquals: array(string().min(1)).optional(),
14584
14917
  /**
14585
- * Identity matcher. P1 boundary: matched against the record's collapsed
14586
- * `label` (the identity display name propagated by the face pipeline) —
14587
- * identity-ID matching rides in P2 when identity ids reach the record.
14918
+ * KNOWN FACES — the rule's identity scope, and the switch that says the rule
14919
+ * is about recognised people at all.
14920
+ *
14921
+ * Three states, and the empty one is the point:
14922
+ *
14923
+ * | value | meaning |
14924
+ * | --- | --- |
14925
+ * | absent | the rule does not care who it is; an unrecognised person matches |
14926
+ * | `[]` | **only known faces** — any identity in the gallery, nobody in particular |
14927
+ * | a list | only these identities |
14928
+ *
14929
+ * `[]` is the repo-wide "no selection = no narrowing" reading (an absent
14930
+ * `devices` list is every device), applied one level down: the operator has
14931
+ * turned the face scope ON and narrowed it to nothing, which is every known
14932
+ * face. No second field states the same thing — a switch that can disagree
14933
+ * with the list under it is worse than no switch (D62).
14934
+ *
14935
+ * MEMBERS ARE FACE-GALLERY `Identity.id`s (uuid), not display names. A name is
14936
+ * renameable, and a rule authored on "Gianluca" went silently dark the moment
14937
+ * the operator fixed the spelling. The id reaches the record on
14938
+ * `LabelAttribution.identityId`; the name is what the editor shows and what
14939
+ * `{{label}}` renders.
14940
+ *
14941
+ * Rules written before this carry NAMES, and are resolved to ids lazily at
14942
+ * load (`NcRuleStore.load`) against the live gallery — a name nothing answers
14943
+ * for is left as it stands and reported, never dropped. The engine also
14944
+ * accepts a display-name hit as a compatibility leg, so a rule whose
14945
+ * migration could not resolve keeps matching exactly what it matched before.
14588
14946
  */
14589
14947
  identities: array(string().min(1)).optional(),
14590
- /** Fuzzy plate matcher against the record's `label` (plate text). */
14948
+ /**
14949
+ * KNOWN PLATES / VEHICLES — the plate mirror of {@link identities}, including
14950
+ * the empty-list reading: `values: []` is "any plate the OCR could read",
14951
+ * a non-empty list is those plates (fuzzily). See {@link NcPlateMatcherSchema}.
14952
+ */
14591
14953
  plates: NcPlateMatcherSchema.optional(),
14592
14954
  /**
14593
- * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics.
14594
- * Same P1 boundary: matched against the record's collapsed `label` (the
14595
- * identity display name). A record with NO label passes (nothing to
14596
- * exclude), unlike the include variant which fails on an absent label.
14955
+ * Identity EXCLUDE — mirror of {@link identities} with `notIn` semantics, and
14956
+ * the same id members and the same lazy name→id migration. A record with NO
14957
+ * identity passes (nothing to exclude), unlike the include variant which
14958
+ * fails on an unrecognised subject. An EMPTY list excludes nobody.
14597
14959
  */
14598
14960
  identitiesExclude: array(string().min(1)).optional(),
14599
14961
  /**
@@ -14985,7 +15347,80 @@ var NcRuleInputSchema = object({
14985
15347
  * a rule that predates the gate must keep delivering byte-for-byte as it
14986
15348
  * did, and absent is the only way to say that without a migration.
14987
15349
  */
14988
- confirm: NcConfirmSchema.optional()
15350
+ confirm: NcConfirmSchema.optional(),
15351
+ /**
15352
+ * WAIT for face/plate recognition before saying anything.
15353
+ *
15354
+ * A notification's TEXT is frozen at enqueue and its media is re-resolved at
15355
+ * send; the identity is neither. A face is confirmed after `confirmFrames`
15356
+ * agreeing observations — p50 **11.4 s** after the track was first seen,
15357
+ * measured on this hub — and an `immediate` rule enqueues on the first object
15358
+ * event, seconds before that. So "Gianluca è arrivato" is unsayable on the
15359
+ * immediate path, and no amount of media re-resolution fixes a sentence.
15360
+ *
15361
+ * Only two honest answers exist, and this flag picks between them. It has
15362
+ * effect ONLY on a rule that declares a recognition scope
15363
+ * ({@link NcConditions.identities} or {@link NcConditions.plates}) — on any
15364
+ * other rule there is nothing to wait for and the flag is inert.
15365
+ *
15366
+ * | value | what happens |
15367
+ * | --- | --- |
15368
+ * | `true` | the rule stops firing on the object event and fires at TRACK CLOSE instead, once, with the name — later, and complete |
15369
+ * | absent / `false` | it fires at once WITHOUT the name, and if recognition lands before the track closes a SECOND, "…is Gianluca" notification follows (one per track, per rule, per target) |
15370
+ *
15371
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
15372
+ * on the addon cap path, and absent has to keep meaning exactly what every
15373
+ * rule authored before this field meant.
15374
+ *
15375
+ * The cost of `true` is stated here because the editor states it too: a rule
15376
+ * that waits also inherits track-close SEMANTICS — its `zones` condition
15377
+ * tests every zone the track visited and a `crossing` condition can no longer
15378
+ * be satisfied, because a closed track carries no crossing.
15379
+ */
15380
+ waitForEnhancement: boolean().optional(),
15381
+ /**
15382
+ * GROUP a burst of subjects into ONE notification that grows.
15383
+ *
15384
+ * Seconds of quiet after the last matching subject before the burst is
15385
+ * considered over. While it is open, the first subject enqueues immediately —
15386
+ * **exactly as today, with no added latency** — and every real growth (a new
15387
+ * subject, or a name confirmed on one already in it) REPLACES that
15388
+ * notification with an updated one naming everybody. The push carries the
15389
+ * group's own coalescing tag, so the phone replaces rather than stacks.
15390
+ *
15391
+ * `0` / absent = off, and off is today's behaviour byte for byte.
15392
+ *
15393
+ * ### Why an idle cutoff and not a window
15394
+ *
15395
+ * The measured seven-person arrival on device 590 spans 110 s with every
15396
+ * internal gap under 30 s. A 12 s fixed window cuts it into three groups; an
15397
+ * idle cutoff holds it as one and ends it when the arrival actually ends.
15398
+ * 30 is Frigate's shipped value for the same decision.
15399
+ *
15400
+ * ### What it replaces
15401
+ *
15402
+ * The blind cooldown, which collapses a burst by DISCARDING it. Measured on
15403
+ * device 615 / *Persona su Uscio* over six days: 116 qualifying tracks → 74
15404
+ * notifications, **44 (37.9%) suppressed outright**, 23 of them overlapping a
15405
+ * track that did fire and 7 carrying a confirmed identity nobody heard about.
15406
+ * A group collapses the same volume by MERGING, so the cooldown becomes a
15407
+ * budget over GROUPS — which is what it always meant — and a growth is never
15408
+ * throttled by the window its own first member spent.
15409
+ *
15410
+ * ### Interaction with {@link waitForEnhancement}
15411
+ *
15412
+ * They compose, and the order matters. `waitForEnhancement` defers the rule to
15413
+ * TRACK CLOSE, so with both set the group is opened by the first member to
15414
+ * CLOSE — already carrying its name — and grows as later members close. That
15415
+ * is later, and complete. With grouping alone the group opens on the first
15416
+ * object event and picks up names as they are confirmed, through the growth
15417
+ * path. Neither combination fires twice for one subject.
15418
+ *
15419
+ * `.optional()` and deliberately NOT `.default()`: a Zod default does not run
15420
+ * on the addon cap path, so absent must keep meaning what it meant before this
15421
+ * field existed.
15422
+ */
15423
+ groupIdleSec: number().int().min(0).max(600).optional()
14989
15424
  });
14990
15425
  /**
14991
15426
  * Partial patch for `updateRule` — any subset of the input fields, plus the
@@ -15092,6 +15527,7 @@ var NcConditionDescriptorSchema = object({
15092
15527
  "occupancy",
15093
15528
  "audio",
15094
15529
  "deviceState",
15530
+ "scene",
15095
15531
  "systemEvent"
15096
15532
  ]),
15097
15533
  operator: _enum([
@@ -15497,7 +15933,87 @@ var MethodAccessSchema = _enum([
15497
15933
  var AllowedProviderSchema = union([literal("*"), array(string())]);
15498
15934
  var AllowedDevicesSchema = record(string(), union([literal("*"), array(string())]));
15499
15935
  var CapScopeSchema = _enum(["device", "system"]);
15500
- var TokenScopeSchema = discriminatedUnion("type", [
15936
+ /**
15937
+ * DeviceSelector (scope model v3 — 2026-08-12).
15938
+ *
15939
+ * A `device` grant no longer carries a frozen list of deviceIds. It carries
15940
+ * a SELECTOR the matcher resolves against the live fleet, so the grant can be
15941
+ * DYNAMIC: a `types:['camera']` selector automatically covers a camera added
15942
+ * AFTER the grant was minted — no re-grant, no re-login.
15943
+ *
15944
+ * - `all` — every device in the deployment. The broad viewer/operator
15945
+ * lever without a `category` grant (a `category` grant also covers device
15946
+ * caps that carry no deviceId; `all` is specifically the device set).
15947
+ * - `ids` — an explicit deviceId list. This is what a v2 `device:[…]`
15948
+ * grant migrates to (see {@link TokenScopeSchema}); STATIC — a new camera
15949
+ * is NOT covered until the grant is edited.
15950
+ * - `types` — every device of a `DeviceType` (e.g. every `camera`).
15951
+ * DYNAMIC. A device that changes type, or a new device of the type,
15952
+ * re-resolves on the next request.
15953
+ * - `locations` — every device whose operator-assigned `location` label is
15954
+ * in the set (e.g. "Garden", "Front door"). DYNAMIC. A device with a
15955
+ * null/unset location matches NO `locations` selector.
15956
+ */
15957
+ var DeviceSelectorSchema = discriminatedUnion("kind", [
15958
+ object({ kind: literal("all") }),
15959
+ object({
15960
+ kind: literal("ids"),
15961
+ ids: array(number().int()).min(1)
15962
+ }),
15963
+ object({
15964
+ kind: literal("types"),
15965
+ types: array(_enum(DeviceType)).min(1)
15966
+ }),
15967
+ object({
15968
+ kind: literal("locations"),
15969
+ locations: array(string().min(1)).min(1)
15970
+ })
15971
+ ]);
15972
+ var DeviceTokenScopeSchema = object({
15973
+ type: literal("device"),
15974
+ /** The device SET this grant covers — resolved against the live fleet. */
15975
+ selector: DeviceSelectorSchema,
15976
+ access: array(MethodAccessSchema).min(1),
15977
+ /**
15978
+ * Whether a grant on a PARENT device transparently covers its accessory
15979
+ * CHILDREN (siren / floodlight / PIR) via the persisted-parentage walk.
15980
+ * Direction is parent → children ONLY.
15981
+ *
15982
+ * Absent → the matcher DERIVES it from the access flavour: `view`
15983
+ * inherits (a camera viewer sees the camera's accessories), `create` /
15984
+ * `delete` do NOT (actuating/removing a child is an explicit act the
15985
+ * operator must grant on the child, not inherit from the parent). Set it
15986
+ * explicitly to override that default per grant.
15987
+ */
15988
+ includeLinked: boolean().optional()
15989
+ });
15990
+ /**
15991
+ * v2 → v3 lazy migration. A pre-v3 `device` grant carried
15992
+ * `targets: string[]` (stringified deviceIds); it rewrites to the equivalent
15993
+ * `selector: {kind:'ids', ids}`. Applied as a `preprocess` so it runs on
15994
+ * EVERY parse path — stored records AND the JWT-carried scope arrays
15995
+ * normalised at the request boundary ({@link normalizeTokenScopes} in
15996
+ * `device-selector.ts`). Chosen over a one-time DB migration because a
15997
+ * migration cannot reach a JWT already in a client's hands; parse-time
15998
+ * migration covers both without a flag day. No cast — the raw object is read
15999
+ * through `Reflect.get` (its static type is `unknown`).
16000
+ */
16001
+ function migrateLegacyTokenScope(raw) {
16002
+ if (raw === null || typeof raw !== "object" || Array.isArray(raw)) return raw;
16003
+ if (Reflect.get(raw, "type") !== "device") return raw;
16004
+ if (Reflect.get(raw, "selector") !== void 0) return raw;
16005
+ const targets = Reflect.get(raw, "targets");
16006
+ if (!Array.isArray(targets)) return raw;
16007
+ return {
16008
+ type: "device",
16009
+ selector: {
16010
+ kind: "ids",
16011
+ ids: targets.map((t) => typeof t === "string" ? Number(t) : t).filter((n) => typeof n === "number" && Number.isInteger(n))
16012
+ },
16013
+ access: Reflect.get(raw, "access")
16014
+ };
16015
+ }
16016
+ var TokenScopeSchema = preprocess(migrateLegacyTokenScope, discriminatedUnion("type", [
15501
16017
  object({
15502
16018
  type: literal("category"),
15503
16019
  target: CapScopeSchema,
@@ -15513,18 +16029,8 @@ var TokenScopeSchema = discriminatedUnion("type", [
15513
16029
  target: string(),
15514
16030
  access: array(MethodAccessSchema).min(1)
15515
16031
  }),
15516
- object({
15517
- type: literal("device"),
15518
- /**
15519
- * One or more deviceIds (serialised as strings for wire-format
15520
- * consistency with the rest of the union). Matcher accepts if
15521
- * `input.deviceId` ∈ `targets`. Array shape avoids the row-explosion
15522
- * of one scope-per-device when granting access to a set of cameras.
15523
- */
15524
- targets: array(string()).min(1),
15525
- access: array(MethodAccessSchema).min(1)
15526
- })
15527
- ]);
16032
+ DeviceTokenScopeSchema
16033
+ ]));
15528
16034
  object({
15529
16035
  id: string(),
15530
16036
  username: string(),
@@ -15847,7 +16353,7 @@ var TrackEnvelopeSchema = object({
15847
16353
  * `snapshots[]` references — megabytes across a page of tracks. `slim`
15848
16354
  * keeps every scalar the list surfaces actually render (ids, class(es),
15849
16355
  * label / audioLabels / importance enrichment, firstSeen/lastSeen, state,
15850
- * zonesVisited, bestEventId, envelope, hasFace) and returns `positions` /
16356
+ * zonesVisited, bestEventId, envelope, hasFace, hasRider) and returns `positions` /
15851
16357
  * `snapshots` as EMPTY arrays — detail views re-fetch the full row via
15852
16358
  * `getTrack`. Mirrors the event-store `projection` convention
15853
16359
  * (`getObjectEvents` et al.).
@@ -15983,7 +16489,21 @@ union([literal(1), literal(2)]);
15983
16489
  var LabelAttributionSchema = object({
15984
16490
  stepId: string(),
15985
16491
  modelId: string().optional(),
15986
- decidedAt: number()
16492
+ decidedAt: number(),
16493
+ /**
16494
+ * The GALLERY id behind a recognised tier-2 label — a face-gallery
16495
+ * `Identity.id` or a plate-gallery `Vehicle.id` (both `randomUUID`).
16496
+ *
16497
+ * The text alone is a DISPLAY NAME, and a display name is renameable: a
16498
+ * notification rule authored on "Gianluca" stopped matching the moment the
16499
+ * operator fixed the spelling in the gallery, and nothing said so. The id is
16500
+ * the thing that does not move, so it is what a rule matches on
16501
+ * (`NcConditions.identities`) and the text is what a human is shown.
16502
+ *
16503
+ * Absent when the label names no gallery row — a plate the OCR read but no
16504
+ * vehicle claims, a sub-class, a species, any tier-1 value.
16505
+ */
16506
+ identityId: string().optional()
15987
16507
  });
15988
16508
  /**
15989
16509
  * The TIERED label model (roadmap 4g), spread into `TrackSchema` and
@@ -16120,6 +16640,28 @@ var TrackSchema = object({
16120
16640
  * `=== true` and render nothing otherwise, never infer "no face".
16121
16641
  */
16122
16642
  hasFace: boolean().optional(),
16643
+ /**
16644
+ * This subject CONTAINS a folded rider — a person the rider-pairing step
16645
+ * ([D34](../decisions/adr-0034.md)) removed from the frame BEFORE the tracker,
16646
+ * so the passage is tracked once and as a VEHICLE.
16647
+ *
16648
+ * It exists because the fold's record was dishonest. D34 and the code both
16649
+ * said "the person is not lost — it is reported so both entities stay on the
16650
+ * record"; in fact the pair went into a per-processor RAM field behind an
16651
+ * accessor nobody called, and every durable surface said `vehicle`, full
16652
+ * stop. This is the composition note that makes the row true.
16653
+ *
16654
+ * A COMPOSITION, never a class and never a label. "This vehicle contains a
16655
+ * person" is not an answer to "what is this" — both label tiers would refuse
16656
+ * a macro token anyway (D89), and correctly. Nothing here changes what the
16657
+ * subject IS: a cyclist stays one vehicle track, occupancy still counts one,
16658
+ * and a `person` rule still does not fire for someone cycling past.
16659
+ *
16660
+ * **Absent ≠ false**, exactly like {@link hasFace}: every row written before
16661
+ * the column, and every hub that predates the field, omits it. Test
16662
+ * `=== true` and render nothing otherwise — never infer "no rider".
16663
+ */
16664
+ hasRider: boolean().optional(),
16123
16665
  ...TrackFlagFields,
16124
16666
  ...TrackRetrainFields
16125
16667
  });
@@ -17515,6 +18057,17 @@ var maxSessionHoldMsField = {
17515
18057
  default: 12e4,
17516
18058
  step: 5e3
17517
18059
  };
18060
+ /**
18061
+ * Quiet period that closes an `audioMode: 'on-motion'` audio window. Floor of
18062
+ * 5s so a rearm can never degenerate into per-event stream churn; default 90s
18063
+ * comfortably outlives the gap between two PIR wakes on a battery camera.
18064
+ */
18065
+ var audioMotionWindowMsField = {
18066
+ min: 5e3,
18067
+ max: 6e5,
18068
+ default: 9e4,
18069
+ step: 5e3
18070
+ };
17518
18071
  var motionFpsField = {
17519
18072
  min: 1,
17520
18073
  max: 30,
@@ -17546,7 +18099,7 @@ var detectionFpsField = {
17546
18099
  var occupancyRecheckSecField = {
17547
18100
  min: 0,
17548
18101
  max: 300,
17549
- default: 30,
18102
+ default: 300,
17550
18103
  step: 5
17551
18104
  };
17552
18105
  var occupancyRecheckFramesField = {
@@ -17691,6 +18244,27 @@ var RunnerCameraConfigSchema = object({
17691
18244
  * resolved `CameraDetectionConfig`.
17692
18245
  */
17693
18246
  maxSessionHoldMs: number().min(maxSessionHoldMsField.min).max(maxSessionHoldMsField.max).optional(),
18247
+ /**
18248
+ * Orchestrator-side quiet period (ms) that closes an `audioMode:
18249
+ * 'on-motion'` audio window, measured from the LAST motion event.
18250
+ *
18251
+ * This exists because the falling edge cannot be relied on. Camera-native
18252
+ * providers emit motion as a RISING EDGE ONLY (Reolink's Baichuan push and
18253
+ * its email-push SMTP path both emit `detected: true` and never the
18254
+ * counterpart); only the frame-diff analyzer emits falls. So on an
18255
+ * onboard-only camera a window that closed only on `detected: false` never
18256
+ * closed at all, and `on-motion` silently behaved as `always-on` — on a
18257
+ * battery camera, the one failure mode the mode exists to prevent.
18258
+ *
18259
+ * Every motion event rearms this timer WITHOUT restarting the stream, so a
18260
+ * burst of re-fires costs nothing. A falling edge, when one does arrive,
18261
+ * still closes earlier via `motionCooldownMs` — whichever comes first wins.
18262
+ *
18263
+ * Not consumed by the runner: carried here so it shares the per-camera
18264
+ * device-settings surface with `motionCooldownMs`, exactly like
18265
+ * `maxSessionHoldMs`.
18266
+ */
18267
+ audioMotionWindowMs: number().min(audioMotionWindowMsField.min).max(audioMotionWindowMsField.max).optional(),
17694
18268
  motionFps: number().min(motionFpsField.min).max(motionFpsField.max).default(motionFpsField.default),
17695
18269
  detectionFps: number().min(detectionFpsField.min).max(detectionFpsField.max).default(detectionFpsField.default),
17696
18270
  motionStreamId: string(),
@@ -17786,7 +18360,7 @@ var RunnerCameraConfigSchema = object({
17786
18360
  */
17787
18361
  inferenceDevices: array(RunnerInferenceDeviceSchema).readonly().optional()
17788
18362
  });
17789
- motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
18363
+ motionFpsField.min, motionFpsField.max, motionFpsField.step, motionFpsField.default, detectionFpsField.min, detectionFpsField.max, detectionFpsField.step, detectionFpsField.default, motionCooldownMsField.min, motionCooldownMsField.max, motionCooldownMsField.step, motionCooldownMsField.default, maxSessionHoldMsField.min, maxSessionHoldMsField.max, maxSessionHoldMsField.step, maxSessionHoldMsField.default, audioMotionWindowMsField.min, audioMotionWindowMsField.max, audioMotionWindowMsField.step, audioMotionWindowMsField.default, occupancyRecheckSecField.min, occupancyRecheckSecField.max, occupancyRecheckSecField.step, occupancyRecheckSecField.default, occupancyRecheckFramesField.min, occupancyRecheckFramesField.max, occupancyRecheckFramesField.step, occupancyRecheckFramesField.default;
17790
18364
  /**
17791
18365
  * Runtime load summary returned by `getLocalLoad`. Used by the orchestrator's
17792
18366
  * load-balancing levels (L2 capacity-based, L3 hardware-aware) to decide
@@ -18802,7 +19376,16 @@ targets: array(object({
18802
19376
  /** A sleeping battery camera: the frame is deliberately stale and will
18803
19377
  * NOT refresh in the background. A surface should say so rather than
18804
19378
  * present it as current. */
18805
- sleeping: boolean()
19379
+ sleeping: boolean(),
19380
+ /** Current device state rendered over the cached frame. State images
19381
+ * remain authoritative even when their photographic background is
19382
+ * old; null means the link must carry a current camera frame. */
19383
+ stateReason: _enum([
19384
+ "disabled",
19385
+ "sleeping",
19386
+ "unreachable",
19387
+ "waking"
19388
+ ]).nullable()
18806
19389
  })));
18807
19390
  /**
18808
19391
  * `sso-bridge` — internal hub-only cap that lets SSO-style auth
@@ -20324,6 +20907,25 @@ var BatteryStatusSchema = object({
20324
20907
  /** Ms epoch of the last observation. Lets consumers reason about freshness. */
20325
20908
  lastUpdated: number(),
20326
20909
  /**
20910
+ * Ms epoch of the last time the device PROVED it was reachable — a
20911
+ * completed firmware round-trip, an observed wake, or an inbound push
20912
+ * (firmware event, email). `0`/absent = never since this slice was born.
20913
+ *
20914
+ * This is the ONLY input that separates "asleep" from "gone", and it is
20915
+ * fed exclusively by PASSIVE signals: nothing may write it by reaching
20916
+ * for the radio, because a poll that confirms reachability is the same
20917
+ * poll that drains the battery. See {@link deriveBatteryPresence} — the
20918
+ * single derivation every consumer must use; no surface computes its own.
20919
+ *
20920
+ * It is deliberately NOT a clock in the
20921
+ * `scripts/check-runtime-state-durability.ts` sense: it is the
20922
+ * observation itself, and it is the only thing a 30-hour silence is
20923
+ * visible in. Writers quantise it (see `CONTACT_WRITE_QUANTUM_MS` in the
20924
+ * Reolink provider) so a value that means "recently" cannot cost a
20925
+ * SQLite commit per round-trip.
20926
+ */
20927
+ lastContactAt: number().optional(),
20928
+ /**
20327
20929
  * True when the source is a BINARY low-battery indicator (HA
20328
20930
  * `binary_sensor` device_class=battery / `LOW_BAT`) that has no real
20329
20931
  * charge level — `percentage` is then a coarse stand-in (100 = normal,
@@ -23861,7 +24463,7 @@ method(object({
23861
24463
  toMs: number()
23862
24464
  }), RecordingAvailabilitySchema, {
23863
24465
  kind: "query",
23864
- auth: "admin"
24466
+ auth: "protected"
23865
24467
  }), method(object({
23866
24468
  deviceId: number(),
23867
24469
  fromMs: number(),
@@ -23869,14 +24471,14 @@ method(object({
23869
24471
  tzOffsetMinutes: number()
23870
24472
  }), RecordingDaysSchema, {
23871
24473
  kind: "query",
23872
- auth: "admin"
24474
+ auth: "protected"
23873
24475
  }), method(object({
23874
24476
  deviceId: number(),
23875
24477
  fromMs: number(),
23876
24478
  toMs: number()
23877
24479
  }), RecordingManifestSchema, {
23878
24480
  kind: "query",
23879
- auth: "admin"
24481
+ auth: "protected"
23880
24482
  }), method(object({}), RecordingStorageUsageSchema, {
23881
24483
  kind: "query",
23882
24484
  auth: "admin"
@@ -24166,14 +24768,77 @@ method(object({
24166
24768
  * thing except the comparator: `similarity` (CLIP cosine at the same ROI coords
24167
24769
  * vs condition-tagged references) and `llm` (vision-LLM judgment over the crop).
24168
24770
  *
24169
- * D14 device-config archetype (`deviceConfig.ui.kind:'widget'`) — the framework
24170
- * derives the device-detail contribution; the provider carries NO hand-written
24171
- * settings-contribution methods. `status.kind:'push'` — the engine pushes on
24172
- * every hysteresis flip / availability change; consumers never poll.
24173
- */
24174
- /** Extensible condition tag. Seeded 'day' | 'night'; open by design so more can
24175
- * be added without a wire break (matching falls back to any-condition refs). */
24771
+ * **No `deviceConfig`, deliberately.** This shipped as the D14 widget archetype,
24772
+ * which put a "Scenes" tab on one camera's detail page. That is the wrong shape
24773
+ * for the thing: a scene is a standing question about the property ("is the bin
24774
+ * still out"), and the operator's question is "which of my scenes have tripped",
24775
+ * across every camera at once — not "what does camera 617 think". Buried one
24776
+ * camera deep it also could not be found. The surface is now a top-level admin
24777
+ * page (`/scenes`, `pages/Scenes.tsx`) that lists every scene on every camera and
24778
+ * picks the camera inside the create flow, the same shape Events and Faces have.
24779
+ *
24780
+ * The consequence to keep in mind: `host/scene-monitor-editor` is gone from
24781
+ * `HOST_WIDGETS` too. `scripts/check-host-widget-resolves.ts` asserts BOTH
24782
+ * directions, so a registration nobody declares fails exactly as loudly as a
24783
+ * declaration nobody registers. The editor is imported directly by the page.
24784
+ *
24785
+ * `status.kind:'push'` — the engine pushes on every hysteresis flip /
24786
+ * availability change; consumers never poll.
24787
+ */
24788
+ /** Extensible condition tag. Seeded 'day' | 'ir' (the two variants the operator
24789
+ * captures) plus 'night' | 'dawn' | 'dusk' from the resolver's sun-times band.
24790
+ * Open by design so more can be added without a wire break.
24791
+ *
24792
+ * Matching does NOT fall back across conditions: cross-condition cosines are
24793
+ * not comparable, so "I have never seen this scene in this light" is reported
24794
+ * as `unknown`, never guessed. A day reference scored against an IR frame
24795
+ * collapses the cosine and would latch a false alarm every single night. */
24176
24796
  var SceneConditionSchema = string();
24797
+ /**
24798
+ * What a scene does when the CURRENT light has no reference of its own.
24799
+ *
24800
+ * The lighting variants are not equally likely to exist. Almost every operator
24801
+ * captures daylight and then never stands outside at 22:00 to capture IR, and a
24802
+ * scene that is only ever going to be asked about a daytime question ("is the
24803
+ * bin still on the kerb at 08:00") does not need a night reference at all. The
24804
+ * night half must therefore be OPTIONAL, and optional means the scene keeps
24805
+ * working without it rather than degrading into a permanent complaint.
24806
+ *
24807
+ * - `skip` (default) — the check in that light is not made. Not a verdict, not
24808
+ * an alarm, not even an `unknown`: the live state simply stays whatever the
24809
+ * last covered light left it at, the latch is untouched, and the hysteresis
24810
+ * run is neither spent nor cleared. The scene resumes by itself at first
24811
+ * light. This is the only behaviour under which "I never captured IR" is a
24812
+ * configuration choice instead of a nightly fault.
24813
+ * - `judge-anyway` — score against the OTHER conditions' references. Available
24814
+ * for cameras whose IR frame is close enough to daylight (a floodlit
24815
+ * driveway, an always-white-light doorbell), and wrong for everything else:
24816
+ * cross-condition cosines are not comparable, so a day reference against a
24817
+ * true IR frame collapses and the scene reports a theft at 21:40.
24818
+ *
24819
+ * Never applies when the scene has NO comparable reference at all — that is
24820
+ * "not armed yet", it is reported as `no-reference-for-condition`, and silence
24821
+ * there would hide a scene the operator never finished setting up.
24822
+ */
24823
+ var SceneUncoveredPolicySchema = _enum(["skip", "judge-anyway"]);
24824
+ /** `matched` = the baseline is what we see; `diverged` = it demonstrably is not;
24825
+ * `unknown` = we cannot judge (no reference for this condition, encoder model
24826
+ * changed, view shifted, no snapshot). `unknown` is a real value, not a null,
24827
+ * and never counts toward hysteresis in either direction. */
24828
+ var SceneVerdictSchema = _enum([
24829
+ "matched",
24830
+ "diverged",
24831
+ "unknown"
24832
+ ]);
24833
+ /** Why a scene cannot judge. Named, because this feature's failure mode is
24834
+ * silence that reads as "nothing has happened". */
24835
+ var SceneUnavailableSchema = _enum([
24836
+ "no-reference-for-condition",
24837
+ "view-shifted",
24838
+ "no-vision-profile",
24839
+ "encoder-model-changed",
24840
+ "no-snapshot"
24841
+ ]);
24177
24842
  /** One captured reference — condition-tagged, model-version-gated. `embedding`
24178
24843
  * is `number[]` (Float32Array does NOT survive MsgPack/UDS). */
24179
24844
  var SceneReferenceSchema = object({
@@ -24181,7 +24846,14 @@ var SceneReferenceSchema = object({
24181
24846
  modelId: string(),
24182
24847
  condition: SceneConditionSchema,
24183
24848
  capturedAt: number(),
24184
- thumbnailMediaId: string().optional()
24849
+ thumbnailMediaId: string().optional(),
24850
+ /** Whole-frame (downscaled) embedding captured alongside the ROI crop. The
24851
+ * anti-view-shift anchor: a bumped camera, a PTZ preset or a re-aim makes the
24852
+ * normalized rect frame a different piece of world, and the scene would
24853
+ * diverge forever with a perfectly plausible cosine. Checked LAZILY, only
24854
+ * when hysteresis is about to flip — one extra encode per candidate
24855
+ * transition, not per poll. */
24856
+ anchorEmbedding: array(number()).optional()
24185
24857
  });
24186
24858
  var SceneMonitorStateSchema = object({
24187
24859
  id: string(),
@@ -24203,6 +24875,28 @@ var SceneCheckSchema = discriminatedUnion("mode", [object({
24203
24875
  profileId: string().optional(),
24204
24876
  hysteresisCount: number().int().positive()
24205
24877
  })]);
24878
+ var SCENE_DEFAULT_ANCHOR_THRESHOLD = .85;
24879
+ /** Night is OPTIONAL. A scene with only a daylight reference sits the IR hours
24880
+ * out in silence rather than reporting a fault every night. */
24881
+ var SCENE_DEFAULT_UNCOVERED_POLICY = "skip";
24882
+ /**
24883
+ * Vision-model adjudication of a candidate flip. Field names deliberately
24884
+ * mirror `NcConfirmSchema` so an operator meets one vocabulary, not two.
24885
+ *
24886
+ * `onTimeout` defaults to **'hold'**, the OPPOSITE of `NcConfirmGate`'s
24887
+ * fail-open: a notification suppressed is the worse error there, but a vision
24888
+ * model that timed out has not told us the bin is gone, and a latch is a
24889
+ * stateful claim that costs the operator a trip to reset.
24890
+ */
24891
+ var SceneConfirmSchema = object({
24892
+ enabled: boolean().default(false),
24893
+ prompt: string().min(1).max(1e3),
24894
+ profileId: string().optional(),
24895
+ timeoutMs: number().int().min(1e3).max(2e4).default(8e3),
24896
+ maxImagePx: number().int().min(64).max(2048).default(448),
24897
+ /** What a timeout / unavailable model means for the PENDING flip. */
24898
+ onTimeout: _enum(["flip", "hold"]).default("hold")
24899
+ });
24206
24900
  var SceneMonitorSchema = object({
24207
24901
  id: string(),
24208
24902
  label: string(),
@@ -24221,7 +24915,56 @@ var SceneMonitorSchema = object({
24221
24915
  lastConfidence: number().nullable(),
24222
24916
  currentCondition: SceneConditionSchema.nullable(),
24223
24917
  availability: _enum(["ok", "unavailable"]),
24224
- unavailableReason: string().nullable()
24918
+ unavailableReason: string().nullable(),
24919
+ /** Which state is "the initial screen". `null` until the first capture. */
24920
+ baselineStateId: string().nullable(),
24921
+ /** Which boolean drives notification rules and any export. */
24922
+ emit: _enum(["latched", "live"]).default("latched"),
24923
+ /** Live: does the region match the baseline RIGHT NOW. */
24924
+ verdict: SceneVerdictSchema,
24925
+ /** Has it been `diverged` at least once since `armedAt` — the operator's boolean. */
24926
+ latched: boolean(),
24927
+ /** Last reset (or creation). */
24928
+ armedAt: number(),
24929
+ divergedAt: number().nullable(),
24930
+ restoredAt: number().nullable(),
24931
+ /** A check is only COUNTED when the device has been quiet this long. Motion
24932
+ * during the window DISCARDS the observation — a car pulling up in front of
24933
+ * the bin must not be able to spend hysteresis credit. */
24934
+ quietSeconds: number().int().min(0).max(3600).default(60),
24935
+ /** An observation only advances the pending count when it is at least this
24936
+ * far from the previously counted one, so N agreeing checks span real time
24937
+ * rather than N adjacent polls inside one occlusion. */
24938
+ minObservationSpacingSec: number().int().min(0).max(3600).default(120),
24939
+ /** Vision-model adjudication of a candidate flip. Similarity primary only. */
24940
+ confirm: SceneConfirmSchema.optional(),
24941
+ /** Whole-frame anchor cosine below which a flip is REFUSED as `view-shifted`. */
24942
+ anchorThreshold: number().min(0).max(1).default(SCENE_DEFAULT_ANCHOR_THRESHOLD),
24943
+ /** Clear the latch on its own when the scene matches again? Default false —
24944
+ * `restoredAt` and the `scene-restored` edge are recorded regardless, so an
24945
+ * automation can react to the bin coming back without the operator's own
24946
+ * alarm silently clearing itself. */
24947
+ autoRestore: boolean().default(false),
24948
+ /** What to do when the current light has no reference of its own. See
24949
+ * {@link SceneUncoveredPolicySchema} — the default makes night OPTIONAL. */
24950
+ onUncoveredCondition: SceneUncoveredPolicySchema.default(SCENE_DEFAULT_UNCOVERED_POLICY),
24951
+ /**
24952
+ * The light whose checks are currently being SAT OUT under
24953
+ * `onUncoveredCondition: 'skip'` — `null` when the scene is checking normally.
24954
+ *
24955
+ * Engine-reported and advisory only: it moves no verdict, no latch and no
24956
+ * hysteresis. It exists so the card can say *"night (IR) — checks paused,
24957
+ * nothing captured in this light"* in the same calm voice as the coverage
24958
+ * line, because the alternative is a scene that silently stops answering
24959
+ * after sunset with nothing anywhere saying why. A skipped check must never
24960
+ * read as a broken one.
24961
+ */
24962
+ suspendedCondition: SceneConditionSchema.nullable().default(null),
24963
+ /** Named cause when `verdict === 'unknown'`. */
24964
+ unavailable: SceneUnavailableSchema.nullable(),
24965
+ /** Conditions that have at least one comparable reference — the coverage line
24966
+ * ("day ✓ · ir ✓ · dusk ✗") that turns a silent fallback into a visible fact. */
24967
+ coveredConditions: array(SceneConditionSchema)
24225
24968
  });
24226
24969
  var SceneMonitorStatusSchema = object({
24227
24970
  monitors: array(SceneMonitorSchema),
@@ -24254,7 +24997,15 @@ DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSche
24254
24997
  "both"
24255
24998
  ]).optional(),
24256
24999
  checkIntervalSec: number().optional(),
24257
- check: SceneCheckSchema.optional()
25000
+ check: SceneCheckSchema.optional(),
25001
+ emit: _enum(["latched", "live"]).optional(),
25002
+ quietSeconds: number().int().min(0).max(3600).optional(),
25003
+ minObservationSpacingSec: number().int().min(0).max(3600).optional(),
25004
+ anchorThreshold: number().min(0).max(1).optional(),
25005
+ autoRestore: boolean().optional(),
25006
+ onUncoveredCondition: SceneUncoveredPolicySchema.optional(),
25007
+ /** `null` clears the vision-model adjudicator. */
25008
+ confirm: SceneConfirmSchema.nullable().optional()
24258
25009
  })
24259
25010
  }), _void(), {
24260
25011
  kind: "mutation",
@@ -24291,6 +25042,14 @@ DeviceType.Camera, method(object({ deviceId: number() }), SceneMonitorStatusSche
24291
25042
  }), _void(), {
24292
25043
  kind: "mutation",
24293
25044
  auth: "admin"
25045
+ }), method(object({
25046
+ deviceId: number(),
25047
+ monitorId: string(),
25048
+ /** Defaults to TRUE at the provider seam — see `SCENE_RESET_RECAPTURES`. */
25049
+ recapture: boolean().optional()
25050
+ }), _void(), {
25051
+ kind: "mutation",
25052
+ auth: "admin"
24294
25053
  });
24295
25054
  /**
24296
25055
  * Per-stage gating mode applied to the zones a rule references.
@@ -24444,6 +25203,16 @@ var CamStreamDescriptorSchema = object({
24444
25203
  /** Transport-specific opaque metadata (e.g. rfc4571 SDP). */
24445
25204
  metadata: record(string(), unknown()).optional()
24446
25205
  });
25206
+ object({
25207
+ /** The descriptors as last built from a real camera response. Never a guess:
25208
+ * a failed or refused build writes NOTHING, so a restored catalog is always
25209
+ * one the camera itself once produced. */
25210
+ descriptors: array(CamStreamDescriptorSchema),
25211
+ /** Ms epoch of the build that produced {@link descriptors}. Lets the wake
25212
+ * path decide whether the camera's own awake window is worth spending on a
25213
+ * re-read. */
25214
+ lastFetchedAt: number()
25215
+ });
24447
25216
  DeviceType.Camera, method(object({ deviceId: number().int().nonnegative() }), array(CamStreamDescriptorSchema).readonly());
24448
25217
  /** One of the camera's stream profiles. */
24449
25218
  var StreamProfileSchema = _enum([
@@ -24599,12 +25368,64 @@ var NetworkAddressSchema = object({
24599
25368
  family: string(),
24600
25369
  internal: boolean()
24601
25370
  });
25371
+ /**
25372
+ * Provenance of the site coordinates, and the whole reason this is not just two
25373
+ * numbers.
25374
+ *
25375
+ * - `operator-set` — a human typed it, or accepted a detection. Authoritative;
25376
+ * nothing overwrites it.
25377
+ * - `derived-from-ip` — the hub geolocated its own public IP once, because a
25378
+ * default that is right to a few kilometres beats the coarse UTC clock split
25379
+ * the sun-times consumers otherwise fall back to.
25380
+ *
25381
+ * The UI shows which one it is. An operator who cannot tell a guess from their
25382
+ * own input will eventually trust the guess.
25383
+ */
25384
+ var SiteLocationSourceSchema = _enum(["operator-set", "derived-from-ip"]);
25385
+ /**
25386
+ * The read shape: the location plus the honest state of the one-shot derivation.
25387
+ *
25388
+ * `derivationAttemptedAt` is what makes the "one call, ever" contract
25389
+ * inspectable. When it is set and `location` is null, the geo-IP lookup ran and
25390
+ * failed; the hub will NOT try again on its own — the fallback is declared
25391
+ * (consumers degrade to their own last resort) and the operator either types the
25392
+ * coordinates or presses detect.
25393
+ */
25394
+ var SiteLocationStatusSchema = object({
25395
+ location: object({
25396
+ /** WGS84 decimal degrees. */
25397
+ latitude: number().min(-90).max(90),
25398
+ longitude: number().min(-180).max(180),
25399
+ source: SiteLocationSourceSchema,
25400
+ /** Epoch ms the value was last written. */
25401
+ updatedAt: number(),
25402
+ /**
25403
+ * Human-readable place the geo-IP service reported ("Napoli, IT"). Display
25404
+ * only — never parsed, never matched on. Absent for an operator-typed value.
25405
+ */
25406
+ label: string().optional()
25407
+ }).nullable(),
25408
+ derivationAttemptedAt: number().nullable(),
25409
+ /** Why the last derivation failed, for the UI to show instead of a shrug. */
25410
+ derivationError: string().nullable()
25411
+ });
25412
+ /** `null` clears the location and re-arms nothing — the derivation stays spent. */
25413
+ var SetSiteLocationInputSchema = object({
25414
+ latitude: number().min(-90).max(90),
25415
+ longitude: number().min(-180).max(180)
25416
+ }).nullable();
24602
25417
  method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), method(_void(), FeatureManifestSchema), method(_void(), array(NetworkAddressSchema).readonly()), method(_void(), unknown().nullable(), { auth: "admin" }), method(record(string(), unknown()), _null(), {
24603
25418
  kind: "mutation",
24604
25419
  auth: "admin"
24605
25420
  }), method(_void(), _void(), {
24606
25421
  kind: "mutation",
24607
25422
  auth: "admin"
25423
+ }), method(_void(), SiteLocationStatusSchema), method(SetSiteLocationInputSchema, SiteLocationStatusSchema, {
25424
+ kind: "mutation",
25425
+ auth: "admin"
25426
+ }), method(_void(), SiteLocationStatusSchema, {
25427
+ kind: "mutation",
25428
+ auth: "admin"
24608
25429
  });
24609
25430
  object({
24610
25431
  /** True when the device's tamper switch / case-open contact is
@@ -27334,6 +28155,12 @@ Object.freeze({
27334
28155
  addonId: null,
27335
28156
  access: "create"
27336
28157
  },
28158
+ "llm.cancel": {
28159
+ capName: "llm",
28160
+ capScope: "system",
28161
+ addonId: null,
28162
+ access: "create"
28163
+ },
27337
28164
  "llm.deleteModel": {
27338
28165
  capName: "llm",
27339
28166
  capScope: "system",
@@ -27418,6 +28245,12 @@ Object.freeze({
27418
28245
  addonId: null,
27419
28246
  access: "view"
27420
28247
  },
28248
+ "llm.resolveModelRef": {
28249
+ capName: "llm",
28250
+ capScope: "system",
28251
+ addonId: null,
28252
+ access: "create"
28253
+ },
27421
28254
  "llm.setDefault": {
27422
28255
  capName: "llm",
27423
28256
  capScope: "system",
@@ -29584,6 +30417,12 @@ Object.freeze({
29584
30417
  addonId: null,
29585
30418
  access: "create"
29586
30419
  },
30420
+ "sceneMonitor.resetScene": {
30421
+ capName: "scene-monitor",
30422
+ capScope: "device",
30423
+ addonId: null,
30424
+ access: "delete"
30425
+ },
29587
30426
  "sceneMonitor.updateScene": {
29588
30427
  capName: "scene-monitor",
29589
30428
  capScope: "device",
@@ -30262,6 +31101,12 @@ Object.freeze({
30262
31101
  addonId: null,
30263
31102
  access: "create"
30264
31103
  },
31104
+ "system.detectSiteLocation": {
31105
+ capName: "system",
31106
+ capScope: "system",
31107
+ addonId: null,
31108
+ access: "create"
31109
+ },
30265
31110
  "system.featureFlags": {
30266
31111
  capName: "system",
30267
31112
  capScope: "system",
@@ -30280,6 +31125,12 @@ Object.freeze({
30280
31125
  addonId: null,
30281
31126
  access: "view"
30282
31127
  },
31128
+ "system.getSiteLocation": {
31129
+ capName: "system",
31130
+ capScope: "system",
31131
+ addonId: null,
31132
+ access: "view"
31133
+ },
30283
31134
  "system.health": {
30284
31135
  capName: "system",
30285
31136
  capScope: "system",
@@ -30304,6 +31155,12 @@ Object.freeze({
30304
31155
  addonId: null,
30305
31156
  access: "create"
30306
31157
  },
31158
+ "system.setSiteLocation": {
31159
+ capName: "system",
31160
+ capScope: "system",
31161
+ addonId: null,
31162
+ access: "create"
31163
+ },
30307
31164
  "terminalSession.adoptLegacyMonitor": {
30308
31165
  capName: "terminal-session",
30309
31166
  capScope: "system",
@@ -30875,6 +31732,1683 @@ Object.freeze({
30875
31732
  access: "create"
30876
31733
  }
30877
31734
  });
31735
+ Object.freeze({
31736
+ "accessories.setChildHidden": [{
31737
+ name: "childDeviceId",
31738
+ form: "single",
31739
+ optional: false
31740
+ }, {
31741
+ name: "deviceId",
31742
+ form: "single",
31743
+ optional: false
31744
+ }],
31745
+ "addonSettings.getDeviceSettings": [{
31746
+ name: "deviceId",
31747
+ form: "single",
31748
+ optional: false
31749
+ }],
31750
+ "addonSettings.updateDeviceSettings": [{
31751
+ name: "deviceId",
31752
+ form: "single",
31753
+ optional: false
31754
+ }],
31755
+ "alarmPanel.arm": [{
31756
+ name: "deviceId",
31757
+ form: "single",
31758
+ optional: false
31759
+ }],
31760
+ "alarmPanel.disarm": [{
31761
+ name: "deviceId",
31762
+ form: "single",
31763
+ optional: false
31764
+ }],
31765
+ "alarmPanel.trigger": [{
31766
+ name: "deviceId",
31767
+ form: "single",
31768
+ optional: false
31769
+ }],
31770
+ "audioAnalysis.resolveDeviceSettings": [{
31771
+ name: "deviceId",
31772
+ form: "single",
31773
+ optional: false
31774
+ }],
31775
+ "audioAnalyzer.classify": [{
31776
+ name: "deviceId",
31777
+ form: "single",
31778
+ optional: true
31779
+ }],
31780
+ "audioMetrics.getCurrentSnapshot": [{
31781
+ name: "deviceId",
31782
+ form: "single",
31783
+ optional: false
31784
+ }],
31785
+ "audioMetrics.getHistory": [{
31786
+ name: "deviceId",
31787
+ form: "single",
31788
+ optional: false
31789
+ }],
31790
+ "automationControl.disable": [{
31791
+ name: "deviceId",
31792
+ form: "single",
31793
+ optional: false
31794
+ }],
31795
+ "automationControl.enable": [{
31796
+ name: "deviceId",
31797
+ form: "single",
31798
+ optional: false
31799
+ }],
31800
+ "automationControl.trigger": [{
31801
+ name: "deviceId",
31802
+ form: "single",
31803
+ optional: false
31804
+ }],
31805
+ "battery.wakeForStream": [{
31806
+ name: "deviceId",
31807
+ form: "single",
31808
+ optional: false
31809
+ }],
31810
+ "brightness.setBrightness": [{
31811
+ name: "deviceId",
31812
+ form: "single",
31813
+ optional: false
31814
+ }],
31815
+ "button.press": [{
31816
+ name: "deviceId",
31817
+ form: "single",
31818
+ optional: false
31819
+ }],
31820
+ "cameraCredentials.getCredentials": [{
31821
+ name: "deviceId",
31822
+ form: "single",
31823
+ optional: false
31824
+ }],
31825
+ "cameraStreams.getBrokerStreams": [{
31826
+ name: "deviceId",
31827
+ form: "single",
31828
+ optional: false
31829
+ }],
31830
+ "cameraStreams.getCameraStreams": [{
31831
+ name: "deviceId",
31832
+ form: "single",
31833
+ optional: false
31834
+ }],
31835
+ "cameraStreams.getProfileRtspEntries": [{
31836
+ name: "deviceId",
31837
+ form: "single",
31838
+ optional: false
31839
+ }],
31840
+ "cameraStreams.getRtspEntries": [{
31841
+ name: "deviceId",
31842
+ form: "single",
31843
+ optional: false
31844
+ }],
31845
+ "cameraStreams.pickStream": [{
31846
+ name: "deviceId",
31847
+ form: "single",
31848
+ optional: false
31849
+ }],
31850
+ "climateControl.setFanMode": [{
31851
+ name: "deviceId",
31852
+ form: "single",
31853
+ optional: false
31854
+ }],
31855
+ "climateControl.setMode": [{
31856
+ name: "deviceId",
31857
+ form: "single",
31858
+ optional: false
31859
+ }],
31860
+ "climateControl.setPreset": [{
31861
+ name: "deviceId",
31862
+ form: "single",
31863
+ optional: false
31864
+ }],
31865
+ "climateControl.setSwingHorizontal": [{
31866
+ name: "deviceId",
31867
+ form: "single",
31868
+ optional: false
31869
+ }],
31870
+ "climateControl.setSwingVertical": [{
31871
+ name: "deviceId",
31872
+ form: "single",
31873
+ optional: false
31874
+ }],
31875
+ "climateControl.setTarget": [{
31876
+ name: "deviceId",
31877
+ form: "single",
31878
+ optional: false
31879
+ }],
31880
+ "climateControl.setTargetHumidity": [{
31881
+ name: "deviceId",
31882
+ form: "single",
31883
+ optional: false
31884
+ }],
31885
+ "climateControl.setTargetRange": [{
31886
+ name: "deviceId",
31887
+ form: "single",
31888
+ optional: false
31889
+ }],
31890
+ "color.setColor": [{
31891
+ name: "deviceId",
31892
+ form: "single",
31893
+ optional: false
31894
+ }],
31895
+ "consumables.reset": [{
31896
+ name: "deviceId",
31897
+ form: "single",
31898
+ optional: false
31899
+ }],
31900
+ "control.setValue": [{
31901
+ name: "deviceId",
31902
+ form: "single",
31903
+ optional: false
31904
+ }],
31905
+ "cover.close": [{
31906
+ name: "deviceId",
31907
+ form: "single",
31908
+ optional: false
31909
+ }],
31910
+ "cover.open": [{
31911
+ name: "deviceId",
31912
+ form: "single",
31913
+ optional: false
31914
+ }],
31915
+ "cover.setPosition": [{
31916
+ name: "deviceId",
31917
+ form: "single",
31918
+ optional: false
31919
+ }],
31920
+ "cover.setTiltPosition": [{
31921
+ name: "deviceId",
31922
+ form: "single",
31923
+ optional: false
31924
+ }],
31925
+ "cover.stop": [{
31926
+ name: "deviceId",
31927
+ form: "single",
31928
+ optional: false
31929
+ }],
31930
+ "dayNight.getOptions": [{
31931
+ name: "deviceId",
31932
+ form: "single",
31933
+ optional: false
31934
+ }],
31935
+ "dayNight.setSettings": [{
31936
+ name: "deviceId",
31937
+ form: "single",
31938
+ optional: false
31939
+ }],
31940
+ "decoder.createSession": [{
31941
+ name: "deviceId",
31942
+ form: "single",
31943
+ optional: true
31944
+ }],
31945
+ "deviceAdoption.release": [{
31946
+ name: "camDeviceId",
31947
+ form: "single",
31948
+ optional: false
31949
+ }],
31950
+ "deviceAdoption.resync": [{
31951
+ name: "camDeviceId",
31952
+ form: "single",
31953
+ optional: false
31954
+ }],
31955
+ "deviceDiscovery.adoptDevice": [{
31956
+ name: "deviceId",
31957
+ form: "single",
31958
+ optional: false
31959
+ }],
31960
+ "deviceDiscovery.listDiscovered": [{
31961
+ name: "deviceId",
31962
+ form: "single",
31963
+ optional: false
31964
+ }],
31965
+ "deviceDiscovery.refreshDiscovery": [{
31966
+ name: "deviceId",
31967
+ form: "single",
31968
+ optional: false
31969
+ }],
31970
+ "deviceDiscovery.releaseDevice": [{
31971
+ name: "childDeviceId",
31972
+ form: "single",
31973
+ optional: false
31974
+ }, {
31975
+ name: "deviceId",
31976
+ form: "single",
31977
+ optional: false
31978
+ }],
31979
+ "deviceManager.adoptionRelease": [{
31980
+ name: "camDeviceId",
31981
+ form: "single",
31982
+ optional: false
31983
+ }],
31984
+ "deviceManager.adoptionResync": [{
31985
+ name: "camDeviceId",
31986
+ form: "single",
31987
+ optional: false
31988
+ }],
31989
+ "deviceManager.applyInitialMeta": [{
31990
+ name: "deviceId",
31991
+ form: "single",
31992
+ optional: false
31993
+ }, {
31994
+ name: "linkDeviceId",
31995
+ form: "single",
31996
+ optional: true
31997
+ }],
31998
+ "deviceManager.disable": [{
31999
+ name: "deviceId",
32000
+ form: "single",
32001
+ optional: false
32002
+ }],
32003
+ "deviceManager.enable": [{
32004
+ name: "deviceId",
32005
+ form: "single",
32006
+ optional: false
32007
+ }],
32008
+ "deviceManager.getBindings": [{
32009
+ name: "deviceId",
32010
+ form: "single",
32011
+ optional: false
32012
+ }],
32013
+ "deviceManager.getChildren": [{
32014
+ name: "parentDeviceId",
32015
+ form: "single",
32016
+ optional: false
32017
+ }],
32018
+ "deviceManager.getConfigSchema": [{
32019
+ name: "deviceId",
32020
+ form: "single",
32021
+ optional: false
32022
+ }],
32023
+ "deviceManager.getDevice": [{
32024
+ name: "deviceId",
32025
+ form: "single",
32026
+ optional: false
32027
+ }],
32028
+ "deviceManager.getDeviceAggregate": [{
32029
+ name: "deviceId",
32030
+ form: "single",
32031
+ optional: false
32032
+ }],
32033
+ "deviceManager.getDeviceLiveInfoAggregate": [{
32034
+ name: "deviceId",
32035
+ form: "single",
32036
+ optional: false
32037
+ }],
32038
+ "deviceManager.getDeviceSettingsAggregate": [{
32039
+ name: "deviceId",
32040
+ form: "single",
32041
+ optional: false
32042
+ }],
32043
+ "deviceManager.getDeviceStatusAggregate": [{
32044
+ name: "deviceId",
32045
+ form: "single",
32046
+ optional: false
32047
+ }],
32048
+ "deviceManager.getDeviceStatusAggregateBatch": [{
32049
+ name: "deviceIds",
32050
+ form: "array",
32051
+ optional: false
32052
+ }],
32053
+ "deviceManager.getLinkedDevices": [{
32054
+ name: "deviceId",
32055
+ form: "single",
32056
+ optional: false
32057
+ }],
32058
+ "deviceManager.getSettingsSchema": [{
32059
+ name: "deviceId",
32060
+ form: "single",
32061
+ optional: false
32062
+ }],
32063
+ "deviceManager.getStreamProfileMap": [{
32064
+ name: "deviceId",
32065
+ form: "single",
32066
+ optional: false
32067
+ }],
32068
+ "deviceManager.getStreamSources": [{
32069
+ name: "deviceId",
32070
+ form: "single",
32071
+ optional: false
32072
+ }],
32073
+ "deviceManager.getWireableFields": [{
32074
+ name: "deviceId",
32075
+ form: "single",
32076
+ optional: false
32077
+ }],
32078
+ "deviceManager.loadConfig": [{
32079
+ name: "deviceId",
32080
+ form: "single",
32081
+ optional: false
32082
+ }],
32083
+ "deviceManager.loadMeta": [{
32084
+ name: "deviceId",
32085
+ form: "single",
32086
+ optional: false
32087
+ }],
32088
+ "deviceManager.loadRuntimeState": [{
32089
+ name: "deviceId",
32090
+ form: "single",
32091
+ optional: false
32092
+ }],
32093
+ "deviceManager.persistConfig": [{
32094
+ name: "deviceId",
32095
+ form: "single",
32096
+ optional: false
32097
+ }],
32098
+ "deviceManager.probeStreams": [{
32099
+ name: "deviceId",
32100
+ form: "single",
32101
+ optional: false
32102
+ }],
32103
+ "deviceManager.registerDevice": [{
32104
+ name: "parentDeviceId",
32105
+ form: "single",
32106
+ optional: true
32107
+ }],
32108
+ "deviceManager.remove": [{
32109
+ name: "deviceId",
32110
+ form: "single",
32111
+ optional: false
32112
+ }],
32113
+ "deviceManager.removeDevice": [{
32114
+ name: "deviceId",
32115
+ form: "single",
32116
+ optional: false
32117
+ }],
32118
+ "deviceManager.runDeviceAction": [{
32119
+ name: "deviceId",
32120
+ form: "single",
32121
+ optional: false
32122
+ }],
32123
+ "deviceManager.setChildLayout": [{
32124
+ name: "deviceId",
32125
+ form: "single",
32126
+ optional: false
32127
+ }],
32128
+ "deviceManager.setDisabled": [{
32129
+ name: "deviceId",
32130
+ form: "single",
32131
+ optional: false
32132
+ }],
32133
+ "deviceManager.setDisplay": [{
32134
+ name: "deviceId",
32135
+ form: "single",
32136
+ optional: false
32137
+ }],
32138
+ "deviceManager.setIntegrationId": [{
32139
+ name: "deviceId",
32140
+ form: "single",
32141
+ optional: false
32142
+ }],
32143
+ "deviceManager.setLinkDeviceId": [{
32144
+ name: "deviceId",
32145
+ form: "single",
32146
+ optional: false
32147
+ }, {
32148
+ name: "linkDeviceId",
32149
+ form: "single",
32150
+ optional: true
32151
+ }],
32152
+ "deviceManager.setLocation": [{
32153
+ name: "deviceId",
32154
+ form: "single",
32155
+ optional: false
32156
+ }],
32157
+ "deviceManager.setMetadata": [{
32158
+ name: "deviceId",
32159
+ form: "single",
32160
+ optional: false
32161
+ }],
32162
+ "deviceManager.setName": [{
32163
+ name: "deviceId",
32164
+ form: "single",
32165
+ optional: false
32166
+ }],
32167
+ "deviceManager.setPrimaryChildEntityId": [{
32168
+ name: "deviceId",
32169
+ form: "single",
32170
+ optional: false
32171
+ }],
32172
+ "deviceManager.setRole": [{
32173
+ name: "deviceId",
32174
+ form: "single",
32175
+ optional: false
32176
+ }],
32177
+ "deviceManager.setStreamProfileMap": [{
32178
+ name: "deviceId",
32179
+ form: "single",
32180
+ optional: false
32181
+ }],
32182
+ "deviceManager.setType": [{
32183
+ name: "deviceId",
32184
+ form: "single",
32185
+ optional: false
32186
+ }],
32187
+ "deviceManager.setWrapperActive": [{
32188
+ name: "deviceId",
32189
+ form: "single",
32190
+ optional: false
32191
+ }],
32192
+ "deviceManager.testField": [{
32193
+ name: "deviceId",
32194
+ form: "single",
32195
+ optional: false
32196
+ }],
32197
+ "deviceManager.updateConfig": [{
32198
+ name: "deviceId",
32199
+ form: "single",
32200
+ optional: false
32201
+ }],
32202
+ "deviceManager.updateDeviceField": [{
32203
+ name: "deviceId",
32204
+ form: "single",
32205
+ optional: false
32206
+ }],
32207
+ "deviceManager.updateDeviceFieldsBatch": [{
32208
+ name: "deviceId",
32209
+ form: "single",
32210
+ optional: false
32211
+ }],
32212
+ "deviceOps.getConfigEntries": [{
32213
+ name: "deviceId",
32214
+ form: "single",
32215
+ optional: false
32216
+ }],
32217
+ "deviceOps.getRawState": [{
32218
+ name: "deviceId",
32219
+ form: "single",
32220
+ optional: false
32221
+ }],
32222
+ "deviceOps.getSettingsSchema": [{
32223
+ name: "deviceId",
32224
+ form: "single",
32225
+ optional: false
32226
+ }],
32227
+ "deviceOps.getStreamSources": [{
32228
+ name: "deviceId",
32229
+ form: "single",
32230
+ optional: false
32231
+ }],
32232
+ "deviceOps.removeDevice": [{
32233
+ name: "deviceId",
32234
+ form: "single",
32235
+ optional: false
32236
+ }],
32237
+ "deviceOps.runAction": [{
32238
+ name: "deviceId",
32239
+ form: "single",
32240
+ optional: false
32241
+ }],
32242
+ "deviceOps.setConfig": [{
32243
+ name: "deviceId",
32244
+ form: "single",
32245
+ optional: false
32246
+ }],
32247
+ "deviceState.getCapSlice": [{
32248
+ name: "deviceId",
32249
+ form: "single",
32250
+ optional: false
32251
+ }],
32252
+ "deviceState.getSnapshot": [{
32253
+ name: "deviceId",
32254
+ form: "single",
32255
+ optional: false
32256
+ }],
32257
+ "deviceState.setCapSlice": [{
32258
+ name: "deviceId",
32259
+ form: "single",
32260
+ optional: false
32261
+ }],
32262
+ "events.getEventClipUrl": [{
32263
+ name: "deviceId",
32264
+ form: "single",
32265
+ optional: false
32266
+ }],
32267
+ "events.getEvents": [{
32268
+ name: "deviceId",
32269
+ form: "single",
32270
+ optional: false
32271
+ }],
32272
+ "events.getEventThumbnail": [{
32273
+ name: "deviceId",
32274
+ form: "single",
32275
+ optional: false
32276
+ }],
32277
+ "faceGallery.getFaceByTrack": [{
32278
+ name: "deviceId",
32279
+ form: "single",
32280
+ optional: false
32281
+ }],
32282
+ "faceGallery.listRecentFaces": [{
32283
+ name: "deviceId",
32284
+ form: "single",
32285
+ optional: true
32286
+ }],
32287
+ "fanControl.setDirection": [{
32288
+ name: "deviceId",
32289
+ form: "single",
32290
+ optional: false
32291
+ }],
32292
+ "fanControl.setOscillating": [{
32293
+ name: "deviceId",
32294
+ form: "single",
32295
+ optional: false
32296
+ }],
32297
+ "fanControl.setPercentage": [{
32298
+ name: "deviceId",
32299
+ form: "single",
32300
+ optional: false
32301
+ }],
32302
+ "fanControl.setPreset": [{
32303
+ name: "deviceId",
32304
+ form: "single",
32305
+ optional: false
32306
+ }],
32307
+ "humidifier.setMode": [{
32308
+ name: "deviceId",
32309
+ form: "single",
32310
+ optional: false
32311
+ }],
32312
+ "humidifier.setOn": [{
32313
+ name: "deviceId",
32314
+ form: "single",
32315
+ optional: false
32316
+ }],
32317
+ "humidifier.setTargetHumidity": [{
32318
+ name: "deviceId",
32319
+ form: "single",
32320
+ optional: false
32321
+ }],
32322
+ "imageSettings.getOptions": [{
32323
+ name: "deviceId",
32324
+ form: "single",
32325
+ optional: false
32326
+ }],
32327
+ "imageSettings.setSettings": [{
32328
+ name: "deviceId",
32329
+ form: "single",
32330
+ optional: false
32331
+ }],
32332
+ "intercom.endTalkSession": [{
32333
+ name: "deviceId",
32334
+ form: "single",
32335
+ optional: false
32336
+ }],
32337
+ "intercom.handleAnswer": [{
32338
+ name: "deviceId",
32339
+ form: "single",
32340
+ optional: false
32341
+ }],
32342
+ "intercom.pushTalkAudio": [{
32343
+ name: "deviceId",
32344
+ form: "single",
32345
+ optional: false
32346
+ }],
32347
+ "intercom.startSession": [{
32348
+ name: "deviceId",
32349
+ form: "single",
32350
+ optional: false
32351
+ }],
32352
+ "intercom.startTalkSession": [{
32353
+ name: "deviceId",
32354
+ form: "single",
32355
+ optional: false
32356
+ }],
32357
+ "intercom.stopSession": [{
32358
+ name: "deviceId",
32359
+ form: "single",
32360
+ optional: false
32361
+ }],
32362
+ "lawnMowerControl.dock": [{
32363
+ name: "deviceId",
32364
+ form: "single",
32365
+ optional: false
32366
+ }],
32367
+ "lawnMowerControl.pause": [{
32368
+ name: "deviceId",
32369
+ form: "single",
32370
+ optional: false
32371
+ }],
32372
+ "lawnMowerControl.startMowing": [{
32373
+ name: "deviceId",
32374
+ form: "single",
32375
+ optional: false
32376
+ }],
32377
+ "lockControl.lock": [{
32378
+ name: "deviceId",
32379
+ form: "single",
32380
+ optional: false
32381
+ }],
32382
+ "lockControl.open": [{
32383
+ name: "deviceId",
32384
+ form: "single",
32385
+ optional: false
32386
+ }],
32387
+ "lockControl.unlock": [{
32388
+ name: "deviceId",
32389
+ form: "single",
32390
+ optional: false
32391
+ }],
32392
+ "mediaPlayer.next": [{
32393
+ name: "deviceId",
32394
+ form: "single",
32395
+ optional: false
32396
+ }],
32397
+ "mediaPlayer.pause": [{
32398
+ name: "deviceId",
32399
+ form: "single",
32400
+ optional: false
32401
+ }],
32402
+ "mediaPlayer.play": [{
32403
+ name: "deviceId",
32404
+ form: "single",
32405
+ optional: false
32406
+ }],
32407
+ "mediaPlayer.playMedia": [{
32408
+ name: "deviceId",
32409
+ form: "single",
32410
+ optional: false
32411
+ }],
32412
+ "mediaPlayer.previous": [{
32413
+ name: "deviceId",
32414
+ form: "single",
32415
+ optional: false
32416
+ }],
32417
+ "mediaPlayer.seek": [{
32418
+ name: "deviceId",
32419
+ form: "single",
32420
+ optional: false
32421
+ }],
32422
+ "mediaPlayer.selectSource": [{
32423
+ name: "deviceId",
32424
+ form: "single",
32425
+ optional: false
32426
+ }],
32427
+ "mediaPlayer.setMute": [{
32428
+ name: "deviceId",
32429
+ form: "single",
32430
+ optional: false
32431
+ }],
32432
+ "mediaPlayer.setRepeat": [{
32433
+ name: "deviceId",
32434
+ form: "single",
32435
+ optional: false
32436
+ }],
32437
+ "mediaPlayer.setShuffle": [{
32438
+ name: "deviceId",
32439
+ form: "single",
32440
+ optional: false
32441
+ }],
32442
+ "mediaPlayer.setVolume": [{
32443
+ name: "deviceId",
32444
+ form: "single",
32445
+ optional: false
32446
+ }],
32447
+ "mediaPlayer.stop": [{
32448
+ name: "deviceId",
32449
+ form: "single",
32450
+ optional: false
32451
+ }],
32452
+ "motion.isDetected": [{
32453
+ name: "deviceId",
32454
+ form: "single",
32455
+ optional: false
32456
+ }],
32457
+ "motionDetection.analyze": [{
32458
+ name: "deviceId",
32459
+ form: "single",
32460
+ optional: false
32461
+ }],
32462
+ "motionDetection.removeCamera": [{
32463
+ name: "deviceId",
32464
+ form: "single",
32465
+ optional: false
32466
+ }],
32467
+ "motionTrigger.setMotionTrigger": [{
32468
+ name: "deviceId",
32469
+ form: "single",
32470
+ optional: false
32471
+ }],
32472
+ "motionZones.getOptions": [{
32473
+ name: "deviceId",
32474
+ form: "single",
32475
+ optional: false
32476
+ }],
32477
+ "motionZones.setZone": [{
32478
+ name: "deviceId",
32479
+ form: "single",
32480
+ optional: false
32481
+ }],
32482
+ "nativeObjectDetection.setEnabled": [{
32483
+ name: "deviceId",
32484
+ form: "single",
32485
+ optional: false
32486
+ }],
32487
+ "networkQuality.getDeviceStats": [{
32488
+ name: "deviceId",
32489
+ form: "single",
32490
+ optional: false
32491
+ }],
32492
+ "networkQuality.reportClientStats": [{
32493
+ name: "deviceId",
32494
+ form: "single",
32495
+ optional: false
32496
+ }],
32497
+ "notificationRules.setDeviceMuted": [{
32498
+ name: "deviceId",
32499
+ form: "single",
32500
+ optional: false
32501
+ }],
32502
+ "notifier.cancel": [{
32503
+ name: "deviceId",
32504
+ form: "single",
32505
+ optional: false
32506
+ }],
32507
+ "notifier.send": [{
32508
+ name: "deviceId",
32509
+ form: "single",
32510
+ optional: false
32511
+ }],
32512
+ "osd.setOverlay": [{
32513
+ name: "deviceId",
32514
+ form: "single",
32515
+ optional: false
32516
+ }],
32517
+ "osdManager.clearSlotBinding": [{
32518
+ name: "deviceId",
32519
+ form: "single",
32520
+ optional: false
32521
+ }],
32522
+ "osdManager.copyDeviceConfiguration": [{
32523
+ name: "sourceDeviceId",
32524
+ form: "single",
32525
+ optional: false
32526
+ }, {
32527
+ name: "targetDeviceId",
32528
+ form: "single",
32529
+ optional: false
32530
+ }],
32531
+ "osdManager.getDeviceOsd": [{
32532
+ name: "deviceId",
32533
+ form: "single",
32534
+ optional: false
32535
+ }],
32536
+ "osdManager.getSourceCatalog": [{
32537
+ name: "deviceId",
32538
+ form: "single",
32539
+ optional: false
32540
+ }],
32541
+ "osdManager.previewSlot": [{
32542
+ name: "deviceId",
32543
+ form: "single",
32544
+ optional: false
32545
+ }],
32546
+ "osdManager.renderDevice": [{
32547
+ name: "deviceId",
32548
+ form: "single",
32549
+ optional: false
32550
+ }],
32551
+ "osdManager.setSlotBinding": [{
32552
+ name: "deviceId",
32553
+ form: "single",
32554
+ optional: false
32555
+ }],
32556
+ "petFeeder.callPet": [{
32557
+ name: "deviceId",
32558
+ form: "single",
32559
+ optional: false
32560
+ }],
32561
+ "petFeeder.cancelFeed": [{
32562
+ name: "deviceId",
32563
+ form: "single",
32564
+ optional: false
32565
+ }],
32566
+ "petFeeder.feed": [{
32567
+ name: "deviceId",
32568
+ form: "single",
32569
+ optional: false
32570
+ }],
32571
+ "petFeeder.markFoodReplenished": [{
32572
+ name: "deviceId",
32573
+ form: "single",
32574
+ optional: false
32575
+ }],
32576
+ "petFeeder.playSound": [{
32577
+ name: "deviceId",
32578
+ form: "single",
32579
+ optional: false
32580
+ }],
32581
+ "petFeeder.resetDesiccant": [{
32582
+ name: "deviceId",
32583
+ form: "single",
32584
+ optional: false
32585
+ }],
32586
+ "petFeeder.setChildLock": [{
32587
+ name: "deviceId",
32588
+ form: "single",
32589
+ optional: false
32590
+ }],
32591
+ "petFeeder.setFeedSound": [{
32592
+ name: "deviceId",
32593
+ form: "single",
32594
+ optional: false
32595
+ }],
32596
+ "petFeeder.setIndicatorLight": [{
32597
+ name: "deviceId",
32598
+ form: "single",
32599
+ optional: false
32600
+ }],
32601
+ "petFeeder.setVolume": [{
32602
+ name: "deviceId",
32603
+ form: "single",
32604
+ optional: false
32605
+ }],
32606
+ "pipelineAnalytics.clearTracks": [{
32607
+ name: "deviceId",
32608
+ form: "single",
32609
+ optional: false
32610
+ }],
32611
+ "pipelineAnalytics.completeRetrainTrack": [{
32612
+ name: "deviceId",
32613
+ form: "single",
32614
+ optional: false
32615
+ }],
32616
+ "pipelineAnalytics.deleteDeviceEvents": [{
32617
+ name: "deviceId",
32618
+ form: "single",
32619
+ optional: false
32620
+ }],
32621
+ "pipelineAnalytics.deleteTracks": [{
32622
+ name: "deviceId",
32623
+ form: "single",
32624
+ optional: false
32625
+ }],
32626
+ "pipelineAnalytics.deselectRetrainFrame": [{
32627
+ name: "deviceId",
32628
+ form: "single",
32629
+ optional: false
32630
+ }],
32631
+ "pipelineAnalytics.getActiveTracks": [{
32632
+ name: "deviceId",
32633
+ form: "single",
32634
+ optional: false
32635
+ }],
32636
+ "pipelineAnalytics.getAudioEvents": [{
32637
+ name: "deviceId",
32638
+ form: "single",
32639
+ optional: false
32640
+ }],
32641
+ "pipelineAnalytics.getEventDensity": [{
32642
+ name: "deviceId",
32643
+ form: "single",
32644
+ optional: false
32645
+ }],
32646
+ "pipelineAnalytics.getKeyEvents": [{
32647
+ name: "deviceId",
32648
+ form: "single",
32649
+ optional: false
32650
+ }],
32651
+ "pipelineAnalytics.getMotionEvents": [{
32652
+ name: "deviceId",
32653
+ form: "single",
32654
+ optional: false
32655
+ }],
32656
+ "pipelineAnalytics.getObjectEvents": [{
32657
+ name: "deviceId",
32658
+ form: "single",
32659
+ optional: false
32660
+ }],
32661
+ "pipelineAnalytics.getRetrainExportUrl": [{
32662
+ name: "deviceIds",
32663
+ form: "array",
32664
+ optional: true
32665
+ }],
32666
+ "pipelineAnalytics.getSensorEvents": [{
32667
+ name: "deviceId",
32668
+ form: "single",
32669
+ optional: false
32670
+ }],
32671
+ "pipelineAnalytics.getTrack": [{
32672
+ name: "deviceId",
32673
+ form: "single",
32674
+ optional: false
32675
+ }],
32676
+ "pipelineAnalytics.getTrainingExportSummary": [{
32677
+ name: "deviceIds",
32678
+ form: "array",
32679
+ optional: true
32680
+ }],
32681
+ "pipelineAnalytics.getTrainingExportUrl": [{
32682
+ name: "deviceIds",
32683
+ form: "array",
32684
+ optional: true
32685
+ }],
32686
+ "pipelineAnalytics.listEventKinds": [{
32687
+ name: "deviceId",
32688
+ form: "single",
32689
+ optional: false
32690
+ }],
32691
+ "pipelineAnalytics.listEventKindsBatch": [{
32692
+ name: "deviceIds",
32693
+ form: "array",
32694
+ optional: false
32695
+ }],
32696
+ "pipelineAnalytics.listOpsLog": [{
32697
+ name: "deviceId",
32698
+ form: "single",
32699
+ optional: true
32700
+ }],
32701
+ "pipelineAnalytics.listRecentTracks": [{
32702
+ name: "deviceIds",
32703
+ form: "array",
32704
+ optional: false
32705
+ }],
32706
+ "pipelineAnalytics.listRetrainStaging": [{
32707
+ name: "deviceIds",
32708
+ form: "array",
32709
+ optional: true
32710
+ }],
32711
+ "pipelineAnalytics.listTracks": [{
32712
+ name: "deviceId",
32713
+ form: "single",
32714
+ optional: false
32715
+ }],
32716
+ "pipelineAnalytics.proposeRetrainAnnotations": [{
32717
+ name: "deviceId",
32718
+ form: "single",
32719
+ optional: false
32720
+ }],
32721
+ "pipelineAnalytics.pruneEventsBefore": [{
32722
+ name: "deviceId",
32723
+ form: "single",
32724
+ optional: false
32725
+ }],
32726
+ "pipelineAnalytics.pruneTracksBefore": [{
32727
+ name: "deviceId",
32728
+ form: "single",
32729
+ optional: false
32730
+ }],
32731
+ "pipelineAnalytics.rebuildObjectEmbeddings": [{
32732
+ name: "deviceId",
32733
+ form: "single",
32734
+ optional: true
32735
+ }],
32736
+ "pipelineAnalytics.restageRetrainTrack": [{
32737
+ name: "deviceId",
32738
+ form: "single",
32739
+ optional: false
32740
+ }],
32741
+ "pipelineAnalytics.saveRetrainAnnotations": [{
32742
+ name: "deviceId",
32743
+ form: "single",
32744
+ optional: false
32745
+ }],
32746
+ "pipelineAnalytics.searchObjectEvents": [{
32747
+ name: "deviceId",
32748
+ form: "single",
32749
+ optional: true
32750
+ }],
32751
+ "pipelineAnalytics.selectRetrainFrames": [{
32752
+ name: "deviceId",
32753
+ form: "single",
32754
+ optional: false
32755
+ }],
32756
+ "pipelineAnalytics.setTrackFlags": [{
32757
+ name: "deviceId",
32758
+ form: "single",
32759
+ optional: false
32760
+ }],
32761
+ "pipelineAnalytics.wipeAllAnalytics": [{
32762
+ name: "deviceId",
32763
+ form: "single",
32764
+ optional: false
32765
+ }],
32766
+ "pipelineExecutor.runPipeline": [{
32767
+ name: "deviceId",
32768
+ form: "single",
32769
+ optional: true
32770
+ }],
32771
+ "pipelineExecutor.runPipelineBatch": [{
32772
+ name: "deviceId",
32773
+ form: "single",
32774
+ optional: true
32775
+ }],
32776
+ "pipelineOrchestrator.assignAudio": [{
32777
+ name: "deviceId",
32778
+ form: "single",
32779
+ optional: false
32780
+ }],
32781
+ "pipelineOrchestrator.assignPipeline": [{
32782
+ name: "deviceId",
32783
+ form: "single",
32784
+ optional: false
32785
+ }],
32786
+ "pipelineOrchestrator.getAudioAssignment": [{
32787
+ name: "deviceId",
32788
+ form: "single",
32789
+ optional: false
32790
+ }],
32791
+ "pipelineOrchestrator.getCameraMetrics": [{
32792
+ name: "deviceId",
32793
+ form: "single",
32794
+ optional: false
32795
+ }],
32796
+ "pipelineOrchestrator.getCameraSettings": [{
32797
+ name: "deviceId",
32798
+ form: "single",
32799
+ optional: false
32800
+ }],
32801
+ "pipelineOrchestrator.getCameraStatus": [{
32802
+ name: "deviceId",
32803
+ form: "single",
32804
+ optional: false
32805
+ }],
32806
+ "pipelineOrchestrator.getCameraStatuses": [{
32807
+ name: "deviceIds",
32808
+ form: "array",
32809
+ optional: true
32810
+ }],
32811
+ "pipelineOrchestrator.getCameraStepOverrides": [{
32812
+ name: "deviceId",
32813
+ form: "single",
32814
+ optional: false
32815
+ }],
32816
+ "pipelineOrchestrator.getCameraSwitches": [{
32817
+ name: "deviceId",
32818
+ form: "single",
32819
+ optional: false
32820
+ }],
32821
+ "pipelineOrchestrator.getPipelineAssignment": [{
32822
+ name: "deviceId",
32823
+ form: "single",
32824
+ optional: false
32825
+ }],
32826
+ "pipelineOrchestrator.getPipelineDevicePin": [{
32827
+ name: "deviceId",
32828
+ form: "single",
32829
+ optional: false
32830
+ }],
32831
+ "pipelineOrchestrator.resolvePipeline": [{
32832
+ name: "deviceId",
32833
+ form: "single",
32834
+ optional: false
32835
+ }],
32836
+ "pipelineOrchestrator.setCameraPipelineForAgent": [{
32837
+ name: "deviceId",
32838
+ form: "single",
32839
+ optional: false
32840
+ }],
32841
+ "pipelineOrchestrator.setCameraStepOverride": [{
32842
+ name: "deviceId",
32843
+ form: "single",
32844
+ optional: false
32845
+ }],
32846
+ "pipelineOrchestrator.setCameraStepToggle": [{
32847
+ name: "deviceId",
32848
+ form: "single",
32849
+ optional: false
32850
+ }],
32851
+ "pipelineOrchestrator.setCameraSwitch": [{
32852
+ name: "deviceId",
32853
+ form: "single",
32854
+ optional: false
32855
+ }],
32856
+ "pipelineOrchestrator.setPipelineDevicePin": [{
32857
+ name: "deviceId",
32858
+ form: "single",
32859
+ optional: false
32860
+ }],
32861
+ "pipelineOrchestrator.unassignAudio": [{
32862
+ name: "deviceId",
32863
+ form: "single",
32864
+ optional: false
32865
+ }],
32866
+ "pipelineOrchestrator.unassignPipeline": [{
32867
+ name: "deviceId",
32868
+ form: "single",
32869
+ optional: false
32870
+ }],
32871
+ "pipelineRunner.attachCamera": [{
32872
+ name: "deviceId",
32873
+ form: "single",
32874
+ optional: false
32875
+ }],
32876
+ "pipelineRunner.detachCamera": [{
32877
+ name: "deviceId",
32878
+ form: "single",
32879
+ optional: false
32880
+ }],
32881
+ "pipelineRunner.getCameraMetrics": [{
32882
+ name: "deviceId",
32883
+ form: "single",
32884
+ optional: false
32885
+ }],
32886
+ "pipelineRunner.reportMotion": [{
32887
+ name: "deviceId",
32888
+ form: "single",
32889
+ optional: false
32890
+ }],
32891
+ "pipelineRunner.runDetailSubtree": [{
32892
+ name: "deviceId",
32893
+ form: "single",
32894
+ optional: false
32895
+ }],
32896
+ "pipelineRunner.runStatelessStep": [{
32897
+ name: "sourceDeviceId",
32898
+ form: "single",
32899
+ optional: false
32900
+ }],
32901
+ "plateGallery.getPlateByTrack": [{
32902
+ name: "deviceId",
32903
+ form: "single",
32904
+ optional: false
32905
+ }],
32906
+ "plateGallery.listPlates": [{
32907
+ name: "deviceId",
32908
+ form: "single",
32909
+ optional: true
32910
+ }],
32911
+ "privacyMask.getOptions": [{
32912
+ name: "deviceId",
32913
+ form: "single",
32914
+ optional: false
32915
+ }],
32916
+ "privacyMask.setAudioEnabled": [{
32917
+ name: "deviceId",
32918
+ form: "single",
32919
+ optional: false
32920
+ }],
32921
+ "privacyMask.setMask": [{
32922
+ name: "deviceId",
32923
+ form: "single",
32924
+ optional: false
32925
+ }],
32926
+ "ptz.continuousMove": [{
32927
+ name: "deviceId",
32928
+ form: "single",
32929
+ optional: false
32930
+ }],
32931
+ "ptz.deletePreset": [{
32932
+ name: "deviceId",
32933
+ form: "single",
32934
+ optional: false
32935
+ }],
32936
+ "ptz.getOptions": [{
32937
+ name: "deviceId",
32938
+ form: "single",
32939
+ optional: false
32940
+ }],
32941
+ "ptz.getPosition": [{
32942
+ name: "deviceId",
32943
+ form: "single",
32944
+ optional: false
32945
+ }],
32946
+ "ptz.getPresets": [{
32947
+ name: "deviceId",
32948
+ form: "single",
32949
+ optional: false
32950
+ }],
32951
+ "ptz.goHome": [{
32952
+ name: "deviceId",
32953
+ form: "single",
32954
+ optional: false
32955
+ }],
32956
+ "ptz.goToPreset": [{
32957
+ name: "deviceId",
32958
+ form: "single",
32959
+ optional: false
32960
+ }],
32961
+ "ptz.move": [{
32962
+ name: "deviceId",
32963
+ form: "single",
32964
+ optional: false
32965
+ }],
32966
+ "ptz.savePreset": [{
32967
+ name: "deviceId",
32968
+ form: "single",
32969
+ optional: false
32970
+ }],
32971
+ "ptz.setAutofocus": [{
32972
+ name: "deviceId",
32973
+ form: "single",
32974
+ optional: false
32975
+ }],
32976
+ "ptz.stop": [{
32977
+ name: "deviceId",
32978
+ form: "single",
32979
+ optional: false
32980
+ }],
32981
+ "ptzAutotrack.getSettings": [{
32982
+ name: "deviceId",
32983
+ form: "single",
32984
+ optional: false
32985
+ }],
32986
+ "ptzAutotrack.getStatus": [{
32987
+ name: "deviceId",
32988
+ form: "single",
32989
+ optional: false
32990
+ }],
32991
+ "ptzAutotrack.setEnabled": [{
32992
+ name: "deviceId",
32993
+ form: "single",
32994
+ optional: false
32995
+ }],
32996
+ "ptzAutotrack.setSettings": [{
32997
+ name: "deviceId",
32998
+ form: "single",
32999
+ optional: false
33000
+ }],
33001
+ "reboot.reboot": [{
33002
+ name: "deviceId",
33003
+ form: "single",
33004
+ optional: false
33005
+ }],
33006
+ "recording.deleteFootprint": [{
33007
+ name: "deviceId",
33008
+ form: "single",
33009
+ optional: false
33010
+ }],
33011
+ "recording.getAvailability": [{
33012
+ name: "deviceId",
33013
+ form: "single",
33014
+ optional: false
33015
+ }],
33016
+ "recording.getDaysWithRecordings": [{
33017
+ name: "deviceId",
33018
+ form: "single",
33019
+ optional: false
33020
+ }],
33021
+ "recording.getDeviceConfig": [{
33022
+ name: "deviceId",
33023
+ form: "single",
33024
+ optional: false
33025
+ }],
33026
+ "recording.getPlaybackManifest": [{
33027
+ name: "deviceId",
33028
+ form: "single",
33029
+ optional: false
33030
+ }],
33031
+ "recording.listOpsLog": [{
33032
+ name: "deviceId",
33033
+ form: "single",
33034
+ optional: true
33035
+ }],
33036
+ "recording.locateSegment": [{
33037
+ name: "deviceId",
33038
+ form: "single",
33039
+ optional: false
33040
+ }],
33041
+ "recording.pruneFootage": [{
33042
+ name: "deviceId",
33043
+ form: "single",
33044
+ optional: false
33045
+ }],
33046
+ "recording.readGopBytes": [{
33047
+ name: "deviceId",
33048
+ form: "single",
33049
+ optional: false
33050
+ }],
33051
+ "recording.readSegmentBytes": [{
33052
+ name: "deviceId",
33053
+ form: "single",
33054
+ optional: false
33055
+ }],
33056
+ "recording.relocateFootage": [{
33057
+ name: "deviceId",
33058
+ form: "single",
33059
+ optional: true
33060
+ }],
33061
+ "recording.renderClip": [{
33062
+ name: "deviceId",
33063
+ form: "single",
33064
+ optional: false
33065
+ }],
33066
+ "recording.renderGif": [{
33067
+ name: "deviceId",
33068
+ form: "single",
33069
+ optional: false
33070
+ }],
33071
+ "recording.rescanStorage": [{
33072
+ name: "deviceId",
33073
+ form: "single",
33074
+ optional: false
33075
+ }],
33076
+ "recording.setDeviceConfig": [{
33077
+ name: "deviceId",
33078
+ form: "single",
33079
+ optional: false
33080
+ }],
33081
+ "recording.startStorageMigrationMove": [{
33082
+ name: "deviceId",
33083
+ form: "single",
33084
+ optional: true
33085
+ }],
33086
+ "recordingExport.createExport": [{
33087
+ name: "deviceId",
33088
+ form: "single",
33089
+ optional: false
33090
+ }],
33091
+ "recordingExport.listExports": [{
33092
+ name: "deviceId",
33093
+ form: "single",
33094
+ optional: true
33095
+ }],
33096
+ "sceneMonitor.captureReference": [{
33097
+ name: "deviceId",
33098
+ form: "single",
33099
+ optional: false
33100
+ }],
33101
+ "sceneMonitor.createScene": [{
33102
+ name: "deviceId",
33103
+ form: "single",
33104
+ optional: false
33105
+ }],
33106
+ "sceneMonitor.deleteReference": [{
33107
+ name: "deviceId",
33108
+ form: "single",
33109
+ optional: false
33110
+ }],
33111
+ "sceneMonitor.deleteScene": [{
33112
+ name: "deviceId",
33113
+ form: "single",
33114
+ optional: false
33115
+ }],
33116
+ "sceneMonitor.listScenes": [{
33117
+ name: "deviceId",
33118
+ form: "single",
33119
+ optional: false
33120
+ }],
33121
+ "sceneMonitor.recheckNow": [{
33122
+ name: "deviceId",
33123
+ form: "single",
33124
+ optional: false
33125
+ }],
33126
+ "sceneMonitor.resetScene": [{
33127
+ name: "deviceId",
33128
+ form: "single",
33129
+ optional: false
33130
+ }],
33131
+ "sceneMonitor.updateScene": [{
33132
+ name: "deviceId",
33133
+ form: "single",
33134
+ optional: false
33135
+ }],
33136
+ "scriptRunner.run": [{
33137
+ name: "deviceId",
33138
+ form: "single",
33139
+ optional: false
33140
+ }],
33141
+ "scriptRunner.stop": [{
33142
+ name: "deviceId",
33143
+ form: "single",
33144
+ optional: false
33145
+ }],
33146
+ "snapshot.getSnapshot": [{
33147
+ name: "deviceId",
33148
+ form: "single",
33149
+ optional: false
33150
+ }],
33151
+ "snapshot.getSnapshotOverview": [{
33152
+ name: "deviceIds",
33153
+ form: "array",
33154
+ optional: false
33155
+ }],
33156
+ "snapshot.invalidateCache": [{
33157
+ name: "deviceId",
33158
+ form: "single",
33159
+ optional: false
33160
+ }],
33161
+ "streamBroker.acquireEgressTranscode": [{
33162
+ name: "deviceId",
33163
+ form: "single",
33164
+ optional: false
33165
+ }],
33166
+ "streamBroker.assignProfile": [{
33167
+ name: "deviceId",
33168
+ form: "single",
33169
+ optional: false
33170
+ }],
33171
+ "streamBroker.getDeviceAudioMute": [{
33172
+ name: "deviceId",
33173
+ form: "single",
33174
+ optional: false
33175
+ }],
33176
+ "streamBroker.getStreamWithCodec": [{
33177
+ name: "deviceId",
33178
+ form: "single",
33179
+ optional: false
33180
+ }],
33181
+ "streamBroker.produceEventMedia": [{
33182
+ name: "deviceId",
33183
+ form: "single",
33184
+ optional: false
33185
+ }],
33186
+ "streamBroker.publishCameraStream": [{
33187
+ name: "deviceId",
33188
+ form: "single",
33189
+ optional: false
33190
+ }],
33191
+ "streamBroker.renderPreBufferClip": [{
33192
+ name: "deviceId",
33193
+ form: "single",
33194
+ optional: false
33195
+ }],
33196
+ "streamBroker.restartProfile": [{
33197
+ name: "deviceId",
33198
+ form: "single",
33199
+ optional: false
33200
+ }],
33201
+ "streamBroker.retractCameraStream": [{
33202
+ name: "deviceId",
33203
+ form: "single",
33204
+ optional: false
33205
+ }],
33206
+ "streamBroker.setDeviceAudioMute": [{
33207
+ name: "deviceId",
33208
+ form: "single",
33209
+ optional: false
33210
+ }],
33211
+ "streamBroker.unassignProfile": [{
33212
+ name: "deviceId",
33213
+ form: "single",
33214
+ optional: false
33215
+ }],
33216
+ "streamCatalog.getCatalog": [{
33217
+ name: "deviceId",
33218
+ form: "single",
33219
+ optional: false
33220
+ }],
33221
+ "streamParams.getConfigSchema": [{
33222
+ name: "deviceId",
33223
+ form: "single",
33224
+ optional: false
33225
+ }],
33226
+ "streamParams.getOptions": [{
33227
+ name: "deviceId",
33228
+ form: "single",
33229
+ optional: false
33230
+ }],
33231
+ "streamParams.setProfile": [{
33232
+ name: "deviceId",
33233
+ form: "single",
33234
+ optional: false
33235
+ }],
33236
+ "switch.setState": [{
33237
+ name: "deviceId",
33238
+ form: "single",
33239
+ optional: false
33240
+ }],
33241
+ "vacuumControl.locate": [{
33242
+ name: "deviceId",
33243
+ form: "single",
33244
+ optional: false
33245
+ }],
33246
+ "vacuumControl.pause": [{
33247
+ name: "deviceId",
33248
+ form: "single",
33249
+ optional: false
33250
+ }],
33251
+ "vacuumControl.returnToBase": [{
33252
+ name: "deviceId",
33253
+ form: "single",
33254
+ optional: false
33255
+ }],
33256
+ "vacuumControl.setFanSpeed": [{
33257
+ name: "deviceId",
33258
+ form: "single",
33259
+ optional: false
33260
+ }],
33261
+ "vacuumControl.start": [{
33262
+ name: "deviceId",
33263
+ form: "single",
33264
+ optional: false
33265
+ }],
33266
+ "vacuumControl.stop": [{
33267
+ name: "deviceId",
33268
+ form: "single",
33269
+ optional: false
33270
+ }],
33271
+ "valve.close": [{
33272
+ name: "deviceId",
33273
+ form: "single",
33274
+ optional: false
33275
+ }],
33276
+ "valve.open": [{
33277
+ name: "deviceId",
33278
+ form: "single",
33279
+ optional: false
33280
+ }],
33281
+ "valve.setPosition": [{
33282
+ name: "deviceId",
33283
+ form: "single",
33284
+ optional: false
33285
+ }],
33286
+ "valve.stop": [{
33287
+ name: "deviceId",
33288
+ form: "single",
33289
+ optional: false
33290
+ }],
33291
+ "videoclips.getClipPlayback": [{
33292
+ name: "deviceId",
33293
+ form: "single",
33294
+ optional: false
33295
+ }],
33296
+ "videoclips.listClips": [{
33297
+ name: "deviceId",
33298
+ form: "single",
33299
+ optional: false
33300
+ }],
33301
+ "waterHeater.setAway": [{
33302
+ name: "deviceId",
33303
+ form: "single",
33304
+ optional: false
33305
+ }],
33306
+ "waterHeater.setOperationMode": [{
33307
+ name: "deviceId",
33308
+ form: "single",
33309
+ optional: false
33310
+ }],
33311
+ "waterHeater.setTargetTemp": [{
33312
+ name: "deviceId",
33313
+ form: "single",
33314
+ optional: false
33315
+ }],
33316
+ "webrtcSession.addIceCandidate": [{
33317
+ name: "deviceId",
33318
+ form: "single",
33319
+ optional: false
33320
+ }],
33321
+ "webrtcSession.closeSession": [{
33322
+ name: "deviceId",
33323
+ form: "single",
33324
+ optional: false
33325
+ }],
33326
+ "webrtcSession.createSession": [{
33327
+ name: "deviceId",
33328
+ form: "single",
33329
+ optional: false
33330
+ }],
33331
+ "webrtcSession.getIceCandidates": [{
33332
+ name: "deviceId",
33333
+ form: "single",
33334
+ optional: false
33335
+ }],
33336
+ "webrtcSession.getSessionState": [{
33337
+ name: "deviceId",
33338
+ form: "single",
33339
+ optional: false
33340
+ }],
33341
+ "webrtcSession.handleAnswer": [{
33342
+ name: "deviceId",
33343
+ form: "single",
33344
+ optional: false
33345
+ }],
33346
+ "webrtcSession.handleOffer": [{
33347
+ name: "deviceId",
33348
+ form: "single",
33349
+ optional: false
33350
+ }],
33351
+ "webrtcSession.hasAdaptiveBitrate": [{
33352
+ name: "deviceId",
33353
+ form: "single",
33354
+ optional: false
33355
+ }],
33356
+ "webrtcSession.listStreams": [{
33357
+ name: "deviceId",
33358
+ form: "single",
33359
+ optional: false
33360
+ }],
33361
+ "zoneAnalytics.getCameraHistory": [{
33362
+ name: "deviceId",
33363
+ form: "single",
33364
+ optional: false
33365
+ }],
33366
+ "zoneAnalytics.getCurrentSnapshot": [{
33367
+ name: "deviceId",
33368
+ form: "single",
33369
+ optional: false
33370
+ }],
33371
+ "zoneAnalytics.getUnzonedHistory": [{
33372
+ name: "deviceId",
33373
+ form: "single",
33374
+ optional: false
33375
+ }],
33376
+ "zoneAnalytics.getZoneHistory": [{
33377
+ name: "deviceId",
33378
+ form: "single",
33379
+ optional: false
33380
+ }],
33381
+ "zoneRules.listRules": [{
33382
+ name: "deviceId",
33383
+ form: "single",
33384
+ optional: false
33385
+ }],
33386
+ "zoneRules.setRules": [{
33387
+ name: "deviceId",
33388
+ form: "single",
33389
+ optional: false
33390
+ }],
33391
+ "zones.addZone": [{
33392
+ name: "deviceId",
33393
+ form: "single",
33394
+ optional: false
33395
+ }],
33396
+ "zones.listZones": [{
33397
+ name: "deviceId",
33398
+ form: "single",
33399
+ optional: false
33400
+ }],
33401
+ "zones.removeZone": [{
33402
+ name: "deviceId",
33403
+ form: "single",
33404
+ optional: false
33405
+ }],
33406
+ "zones.updateZone": [{
33407
+ name: "deviceId",
33408
+ form: "single",
33409
+ optional: false
33410
+ }]
33411
+ });
30878
33412
  Object.freeze({
30879
33413
  "broker": "broker",
30880
33414
  "device-export": "device-export",
@@ -31815,6 +34349,9 @@ function errorEnvelope(header, type, message) {
31815
34349
  * route to the right cap on the right device.
31816
34350
  */
31817
34351
  var discoveryPayloadSchema = DiscoveryDirectiveSchema.shape.payload;
34352
+ /** Devices built at once in `handleDiscovery` — latency-bound tRPC reads, so
34353
+ * six lanes hide the round-trips without stampeding a booting hub. */
34354
+ var DISCOVERY_BUILD_CONCURRENCY = 6;
31818
34355
  var CAP_DOORBELL = "doorbell";
31819
34356
  var CAP_INTERCOM = "intercom";
31820
34357
  var CAP_MOTION = "motion";
@@ -31827,16 +34364,28 @@ var CAP_PRIVACY_MASK = "privacy-mask";
31827
34364
  async function handleDiscovery(header, payloadRaw, deps, callerIdentity) {
31828
34365
  if (!discoveryPayloadSchema.safeParse(payloadRaw).success) return errorEnvelope(header, "INVALID_DIRECTIVE", "Discovery payload shape unexpected");
31829
34366
  const exposed = await deps.listExposed();
31830
- const endpoints = [];
31831
- for (const entry of exposed) try {
31832
- const built = await buildEndpointsForExposedDevice(entry.deviceId, deps);
31833
- endpoints.push(...built);
31834
- } catch (err) {
31835
- deps.logger.warn("alexa discovery (on-demand): skipping device — build failed", {
31836
- tags: { deviceId: entry.deviceId },
31837
- meta: { error: err instanceof Error ? err.message : String(err) }
31838
- });
31839
- }
34367
+ const built = new Array(exposed.length).fill(null);
34368
+ const queue = exposed.map((entry, index) => ({
34369
+ entry,
34370
+ index
34371
+ }));
34372
+ const lane = async () => {
34373
+ for (;;) {
34374
+ const item = queue.shift();
34375
+ if (item === void 0) return;
34376
+ try {
34377
+ built[item.index] = await buildEndpointsForExposedDevice(item.entry.deviceId, deps);
34378
+ } catch (err) {
34379
+ deps.logger.warn("alexa discovery (on-demand): skipping device — build failed", {
34380
+ tags: { deviceId: item.entry.deviceId },
34381
+ meta: { error: err instanceof Error ? err.message : String(err) }
34382
+ });
34383
+ }
34384
+ }
34385
+ };
34386
+ const lanes = Math.min(DISCOVERY_BUILD_CONCURRENCY, Math.max(1, queue.length));
34387
+ await Promise.all(Array.from({ length: lanes }, lane));
34388
+ const endpoints = built.flatMap((b) => b ?? []);
31840
34389
  deps.logger.info("alexa discovery returned endpoints", { meta: {
31841
34390
  count: endpoints.length,
31842
34391
  userId: callerIdentity.userId
@@ -32163,28 +34712,6 @@ async function handleInitiateSessionWithOffer(header, endpointRaw, payloadRaw, d
32163
34712
  if (pref === "low" || pref === "mid" || pref === "high") return pref;
32164
34713
  })();
32165
34714
  const sourceProfile = explicitSourceProfile ?? mappedFromPreference ?? "high";
32166
- try {
32167
- if (isSleepingBatteryStatus(null)) {
32168
- const wakeStart = Date.now();
32169
- const wake = await api.battery.wakeForStream.mutate({
32170
- deviceId,
32171
- timeoutMs: 8e3
32172
- }).catch(() => ({
32173
- awoke: false,
32174
- durationMs: 0
32175
- }));
32176
- log.info("alexa rtc-session: battery pre-wake", { meta: {
32177
- awoke: wake.awoke,
32178
- waitedMs: wake.durationMs || Date.now() - wakeStart
32179
- } });
32180
- }
32181
- } catch (err) {
32182
- log.debug("alexa rtc-session: pre-wake skipped", { meta: { error: err instanceof Error ? err.message : String(err) } });
32183
- }
32184
- function isSleepingBatteryStatus(value) {
32185
- if (typeof value !== "object" || value === null) return false;
32186
- return value["sleeping"] === true;
32187
- }
32188
34715
  let derivedTarget;
32189
34716
  /**
32190
34717
  * The primitive's release handle, when this session acquired one. Recorded so
@@ -34223,8 +36750,30 @@ function endpointsSignature(endpoints) {
34223
36750
  }
34224
36751
  //#endregion
34225
36752
  //#region src/sync-engine.ts
36753
+ /**
36754
+ * Devices reconciled at once in {@link SyncEngine.reconcileAllExposed}. Each
36755
+ * lane's device build is a handful of cross-process tRPC calls — latency, not
36756
+ * CPU — so four lanes hide most of it without turning a boot-time cap
36757
+ * registration burst into a second stampede.
36758
+ */
36759
+ var RECONCILE_ALL_CONCURRENCY = 4;
34226
36760
  var SyncEngine = class {
34227
36761
  deps;
36762
+ /**
36763
+ * Serializes the `recordEndpoints` read-modify-write. The build/push half of
36764
+ * a reconcile runs parallel across devices, but the persisted maps are
36765
+ * whole-object snapshots: two concurrent `get → mutate → set` cycles would
36766
+ * silently drop one device's ids/signature (last writer wins).
36767
+ */
36768
+ recordChain = Promise.resolve();
36769
+ /**
36770
+ * One in-flight reconcile per device. At boot the 60 s full pass and the
36771
+ * debounced bindings-change reconciles overlap, and each one rebuilt the
36772
+ * same device serially — the live hub built camera 615's endpoint shape
36773
+ * four times inside one boot (2026-08-15). Joining the running pass costs
36774
+ * the duplicate nothing.
36775
+ */
36776
+ reconcileFlights = /* @__PURE__ */ new Map();
34228
36777
  constructor(deps) {
34229
36778
  this.deps = deps;
34230
36779
  }
@@ -34335,6 +36884,15 @@ var SyncEngine = class {
34335
36884
  * re-push a shape Alexa already has.
34336
36885
  */
34337
36886
  async reconcileDevice(deviceId) {
36887
+ const inFlight = this.reconcileFlights.get(deviceId);
36888
+ if (inFlight) return inFlight;
36889
+ const flight = this.reconcileDeviceNow(deviceId).finally(() => {
36890
+ if (this.reconcileFlights.get(deviceId) === flight) this.reconcileFlights.delete(deviceId);
36891
+ });
36892
+ this.reconcileFlights.set(deviceId, flight);
36893
+ return flight;
36894
+ }
36895
+ async reconcileDeviceNow(deviceId) {
34338
36896
  if (!this.deps.listExposed().some((e) => e.deviceId === deviceId)) return {
34339
36897
  deviceId,
34340
36898
  pushed: false
@@ -34375,26 +36933,42 @@ var SyncEngine = class {
34375
36933
  async reconcileAllExposed() {
34376
36934
  const checkedDeviceIds = [];
34377
36935
  const pushedDeviceIds = [];
34378
- for (const { deviceId } of this.deps.listExposed()) {
34379
- checkedDeviceIds.push(deviceId);
34380
- if ((await this.reconcileDevice(deviceId)).pushed) pushedDeviceIds.push(deviceId);
34381
- }
36936
+ const queue = [...this.deps.listExposed()];
36937
+ const lane = async () => {
36938
+ for (;;) {
36939
+ const entry = queue.shift();
36940
+ if (entry === void 0) return;
36941
+ checkedDeviceIds.push(entry.deviceId);
36942
+ if ((await this.reconcileDevice(entry.deviceId)).pushed) pushedDeviceIds.push(entry.deviceId);
36943
+ }
36944
+ };
36945
+ const lanes = Math.min(RECONCILE_ALL_CONCURRENCY, Math.max(1, queue.length));
36946
+ await Promise.all(Array.from({ length: lanes }, lane));
34382
36947
  return {
34383
36948
  checkedDeviceIds,
34384
36949
  pushedDeviceIds
34385
36950
  };
34386
36951
  }
34387
36952
  /** Persist the endpoint ids AND the shape signature for a device.
34388
- * `signature === null` forgets both (delete / empty build). */
36953
+ * `signature === null` forgets both (delete / empty build).
36954
+ *
36955
+ * Serialized through `recordChain`: the maps are whole-object snapshots
36956
+ * (`get` → spread → `set`), so parallel reconciles would otherwise race —
36957
+ * two devices' writes computed off the same stale snapshot, the second
36958
+ * `set` erasing the first's entry. */
34389
36959
  async recordEndpoints(deviceId, ids, signature) {
34390
- const next = { ...this.deps.getExportedEndpoints() };
34391
- if (ids.length > 0) next[deviceId] = ids;
34392
- else delete next[deviceId];
34393
- await this.deps.setExportedEndpoints(next);
34394
- const nextSignatures = { ...this.deps.getExportedSignatures() };
34395
- if (signature !== null) nextSignatures[deviceId] = signature;
34396
- else delete nextSignatures[deviceId];
34397
- await this.deps.setExportedSignatures(nextSignatures);
36960
+ const write = this.recordChain.then(async () => {
36961
+ const next = { ...this.deps.getExportedEndpoints() };
36962
+ if (ids.length > 0) next[deviceId] = ids;
36963
+ else delete next[deviceId];
36964
+ await this.deps.setExportedEndpoints(next);
36965
+ const nextSignatures = { ...this.deps.getExportedSignatures() };
36966
+ if (signature !== null) nextSignatures[deviceId] = signature;
36967
+ else delete nextSignatures[deviceId];
36968
+ await this.deps.setExportedSignatures(nextSignatures);
36969
+ });
36970
+ this.recordChain = write.then(() => void 0, () => void 0);
36971
+ return write;
34398
36972
  }
34399
36973
  };
34400
36974
  //#endregion