@camstack/addon-provider-onvif 1.0.4 → 1.0.6
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.
- package/dist/addon.js +1301 -1074
- package/dist/addon.mjs +1301 -1074
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -4631,63 +4631,7 @@ function _instanceof(cls, params = {}) {
|
|
|
4631
4631
|
return inst;
|
|
4632
4632
|
}
|
|
4633
4633
|
//#endregion
|
|
4634
|
-
//#region ../types/dist/
|
|
4635
|
-
/**
|
|
4636
|
-
* Deep wiring healthcheck — snapshot of active reachability probes across
|
|
4637
|
-
* every declared capability + widget of every installed plugin, on every
|
|
4638
|
-
* node. Produced by the backend `WiringHealthService` and surfaced via
|
|
4639
|
-
* `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
|
|
4640
|
-
*
|
|
4641
|
-
* Unlike `/health` (process liveness), this reflects whether each cap/widget
|
|
4642
|
-
* is actually *reachable* over the real cap-dispatch path. See spec
|
|
4643
|
-
* `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
|
|
4644
|
-
*/
|
|
4645
|
-
/** What kind of target a probe addressed. */
|
|
4646
|
-
var wiringProbeKindSchema = _enum([
|
|
4647
|
-
"singleton",
|
|
4648
|
-
"device",
|
|
4649
|
-
"widget"
|
|
4650
|
-
]);
|
|
4651
|
-
/** Result of probing a single (cap|widget [, device]) target. */
|
|
4652
|
-
var wiringProbeResultSchema = object({
|
|
4653
|
-
capName: string(),
|
|
4654
|
-
kind: wiringProbeKindSchema,
|
|
4655
|
-
deviceId: number().optional(),
|
|
4656
|
-
reachable: boolean(),
|
|
4657
|
-
latencyMs: number(),
|
|
4658
|
-
error: string().optional()
|
|
4659
|
-
});
|
|
4660
|
-
/** Per-addon roll-up of cap + widget probe results. */
|
|
4661
|
-
var wiringAddonHealthSchema = object({
|
|
4662
|
-
addonId: string(),
|
|
4663
|
-
caps: array(wiringProbeResultSchema).readonly(),
|
|
4664
|
-
widgets: array(wiringProbeResultSchema).readonly()
|
|
4665
|
-
});
|
|
4666
|
-
/** Per-node roll-up. */
|
|
4667
|
-
var wiringNodeHealthSchema = object({
|
|
4668
|
-
nodeId: string(),
|
|
4669
|
-
addons: array(wiringAddonHealthSchema).readonly()
|
|
4670
|
-
});
|
|
4671
|
-
object({
|
|
4672
|
-
/** True only when every probed target is reachable. */
|
|
4673
|
-
ok: boolean(),
|
|
4674
|
-
/** True when at least one target is unreachable. */
|
|
4675
|
-
degraded: boolean(),
|
|
4676
|
-
checkedAt: string(),
|
|
4677
|
-
nodes: array(wiringNodeHealthSchema).readonly(),
|
|
4678
|
-
summary: object({
|
|
4679
|
-
total: number(),
|
|
4680
|
-
reachable: number(),
|
|
4681
|
-
unreachable: number()
|
|
4682
|
-
})
|
|
4683
|
-
});
|
|
4684
|
-
var MODEL_FORMATS = [
|
|
4685
|
-
"onnx",
|
|
4686
|
-
"coreml",
|
|
4687
|
-
"openvino",
|
|
4688
|
-
"tflite",
|
|
4689
|
-
"pt"
|
|
4690
|
-
];
|
|
4634
|
+
//#region ../types/dist/sleep-D7JeS58T.mjs
|
|
4691
4635
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4692
4636
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4693
4637
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -4985,6 +4929,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
4985
4929
|
*/
|
|
4986
4930
|
EventCategory["PipelineEngineMetricsSnapshot"] = "pipeline.engine-metrics-snapshot";
|
|
4987
4931
|
/**
|
|
4932
|
+
* Per-node detection-engine runtime-provisioning transition. Emitted by
|
|
4933
|
+
* the detection-pipeline provider on every state change of its lazy
|
|
4934
|
+
* engine-provisioning machine (idle → installing → verifying → ready,
|
|
4935
|
+
* or → failed with a `nextRetryAt`). Payload is the
|
|
4936
|
+
* `EngineProvisioningState` snapshot; `event.source.nodeId` carries the
|
|
4937
|
+
* node. The Pipeline page subscribes to drive a live "installing
|
|
4938
|
+
* OpenVINO… / ready" indicator per node without polling
|
|
4939
|
+
* `pipelineExecutor.getEngineProvisioning`. Telemetry-grade (D8): the UI
|
|
4940
|
+
* also reads the cap snapshot on mount / reconnect. Phase 2.
|
|
4941
|
+
*/
|
|
4942
|
+
EventCategory["PipelineEngineProvisioning"] = "pipeline.engine-provisioning";
|
|
4943
|
+
/**
|
|
4988
4944
|
* Cluster topology snapshot. Carries the same payload returned by
|
|
4989
4945
|
* `nodes.topology` (every reachable node + addons + processes).
|
|
4990
4946
|
* Emitted by the hub on any agent / addon lifecycle change
|
|
@@ -5998,7 +5954,7 @@ var ProfileSlotSchema = object({
|
|
|
5998
5954
|
* Zod schema for StreamSourceEntry — the canonical stream descriptor
|
|
5999
5955
|
* exposed by ICameraDevice.getStreamSources() and consumed by the broker.
|
|
6000
5956
|
*/
|
|
6001
|
-
var StreamSourceEntrySchema = object({
|
|
5957
|
+
var StreamSourceEntrySchema$1 = object({
|
|
6002
5958
|
id: string(),
|
|
6003
5959
|
label: string(),
|
|
6004
5960
|
protocol: _enum([
|
|
@@ -6220,904 +6176,1092 @@ var ProfileRtspEntrySchema = object({
|
|
|
6220
6176
|
codec: string().optional(),
|
|
6221
6177
|
resolution: CamStreamResolutionSchema.optional()
|
|
6222
6178
|
});
|
|
6223
|
-
|
|
6224
|
-
|
|
6225
|
-
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
|
|
6230
|
-
|
|
6231
|
-
|
|
6232
|
-
|
|
6233
|
-
|
|
6234
|
-
|
|
6235
|
-
|
|
6236
|
-
|
|
6237
|
-
|
|
6238
|
-
|
|
6239
|
-
|
|
6240
|
-
|
|
6241
|
-
]
|
|
6242
|
-
|
|
6243
|
-
|
|
6244
|
-
*
|
|
6245
|
-
*
|
|
6246
|
-
|
|
6247
|
-
|
|
6248
|
-
*
|
|
6249
|
-
|
|
6250
|
-
|
|
6251
|
-
*
|
|
6252
|
-
|
|
6253
|
-
|
|
6254
|
-
"
|
|
6255
|
-
|
|
6256
|
-
|
|
6257
|
-
]
|
|
6258
|
-
/**
|
|
6259
|
-
|
|
6260
|
-
|
|
6261
|
-
|
|
6262
|
-
|
|
6263
|
-
|
|
6264
|
-
*
|
|
6265
|
-
|
|
6266
|
-
|
|
6267
|
-
*
|
|
6268
|
-
*
|
|
6269
|
-
|
|
6270
|
-
|
|
6271
|
-
|
|
6272
|
-
|
|
6273
|
-
*
|
|
6274
|
-
|
|
6275
|
-
|
|
6276
|
-
|
|
6277
|
-
|
|
6278
|
-
|
|
6279
|
-
*
|
|
6280
|
-
*
|
|
6281
|
-
*
|
|
6282
|
-
|
|
6283
|
-
|
|
6284
|
-
*/
|
|
6285
|
-
|
|
6286
|
-
|
|
6287
|
-
|
|
6288
|
-
|
|
6289
|
-
|
|
6290
|
-
|
|
6291
|
-
|
|
6292
|
-
|
|
6293
|
-
|
|
6294
|
-
|
|
6295
|
-
|
|
6296
|
-
|
|
6297
|
-
|
|
6298
|
-
|
|
6299
|
-
|
|
6300
|
-
|
|
6301
|
-
|
|
6302
|
-
|
|
6303
|
-
|
|
6304
|
-
|
|
6305
|
-
|
|
6306
|
-
/**
|
|
6307
|
-
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
6308
|
-
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
6309
|
-
* live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
|
|
6310
|
-
* (when the volume is too full to keep recording) is NOT a per-camera concern —
|
|
6311
|
-
* it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
|
|
6312
|
-
* shared by every camera writing to that volume.
|
|
6313
|
-
*/
|
|
6314
|
-
var RecordingRetentionSchema = object({
|
|
6315
|
-
maxAgeDays: number().min(0).optional(),
|
|
6316
|
-
maxSizeGb: number().min(0).optional()
|
|
6317
|
-
});
|
|
6318
|
-
/**
|
|
6319
|
-
* The full per-camera recording intent — the wire shape of a RecordingTarget.
|
|
6320
|
-
*
|
|
6321
|
-
* `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
|
|
6322
|
-
* are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
|
|
6323
|
-
* only for transition + migration (`migrateRulesToMode`); the policy engine
|
|
6324
|
-
* consumes the compiled output of `compileRules(config)`, never `rules` directly.
|
|
6325
|
-
*/
|
|
6326
|
-
var RecordingConfigSchema = object({
|
|
6327
|
-
enabled: boolean(),
|
|
6328
|
-
/** Authoritative storage mode. Absent on legacy targets → derived once via
|
|
6329
|
-
* `migrateRulesToMode`, then persisted. */
|
|
6330
|
-
mode: RecordingStorageModeSchema.optional(),
|
|
6331
|
-
profiles: array(CamProfileSchema).optional(),
|
|
6332
|
-
segmentSeconds: number().int().positive().optional(),
|
|
6333
|
-
/** Shared recording time-bands for `events` & `continuous` — record only when
|
|
6334
|
-
* the wall-clock falls inside one of these windows. Omit or empty = always.
|
|
6335
|
-
* `continuous` compiles to one rule per band; `events` to band × trigger. */
|
|
6336
|
-
schedules: array(RecordingScheduleSchema).optional(),
|
|
6337
|
-
/** Legacy single-band predecessor of `schedules`. Read-compat only — it is
|
|
6338
|
-
* normalized into `schedules` on read and never written going forward. (Not
|
|
6339
|
-
* tagged `@deprecated`: the normalization paths must read it cast-free.) */
|
|
6340
|
-
schedule: RecordingScheduleSchema.optional(),
|
|
6341
|
-
/** `events`-mode only — which detectors trigger a recording. */
|
|
6342
|
-
triggers: RecordingTriggersSchema.optional(),
|
|
6343
|
-
/** `events`-mode only — seconds retained before / after a trigger. */
|
|
6344
|
-
preBufferSec: number().min(0).optional(),
|
|
6345
|
-
postBufferSec: number().min(0).optional(),
|
|
6346
|
-
/** DEPRECATED authoring input; retained for migration/transition. */
|
|
6347
|
-
rules: array(RecordingRuleSchema).optional(),
|
|
6348
|
-
/**
|
|
6349
|
-
* AUTHORITATIVE mode-per-band recording model (recorder). When present it
|
|
6350
|
-
* is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
|
|
6351
|
-
* `triggers`/`rules` fields above are kept for READ-COMPAT only and are
|
|
6352
|
-
* derived into bands once via `migrateConfigToBands`.
|
|
6353
|
-
*/
|
|
6354
|
-
bands: array(RecordingBandSchema).optional(),
|
|
6355
|
-
retention: RecordingRetentionSchema.optional()
|
|
6356
|
-
});
|
|
6357
|
-
/**
|
|
6358
|
-
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
6359
|
-
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
6360
|
-
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
6361
|
-
* without forming a circular import. The `storage` cap re-exports it
|
|
6362
|
-
* verbatim for back-compat.
|
|
6363
|
-
*
|
|
6364
|
-
* This Zod schema is the **authoritative source** for `StorageLocationType`.
|
|
6365
|
-
* The TS alias in `./storage.ts` re-exports `z.infer<typeof
|
|
6366
|
-
* StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
|
|
6367
|
-
* `IStorageProvider` interface stay in lockstep.
|
|
6368
|
-
*
|
|
6369
|
-
* The type is now an **open string** (not a closed enum) — addons declare
|
|
6370
|
-
* their own location kinds via `StorageLocationDeclaration.id`. The regex
|
|
6371
|
-
* enforces a safe id format: lowercase-start, alphanumeric + hyphens.
|
|
6372
|
-
*/
|
|
6373
|
-
var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
6374
|
-
/**
|
|
6375
|
-
* Persisted record for a storage location instance. Operators can register
|
|
6376
|
-
* multiple instances for multi-cardinality types (e.g. two `backups`
|
|
6377
|
-
* locations with different `providerId`s). Cardinality is now declared per
|
|
6378
|
-
* location via `StorageLocationDeclaration.cardinality` — the static
|
|
6379
|
-
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
6380
|
-
*
|
|
6381
|
-
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
6382
|
-
* The default location for a type uses `id === <type>:default` by
|
|
6383
|
-
* convention (the bare type ref like `'backups'` resolves to it).
|
|
6384
|
-
*
|
|
6385
|
-
* `isSystem: true` marks a location as orchestrator-seeded and
|
|
6386
|
-
* undeletable. The bootstrap-installed defaults (one per type) carry
|
|
6387
|
-
* this flag; operator-added locations don't. Editing the config of
|
|
6388
|
-
* a system location is allowed (path migration, provider swap) but
|
|
6389
|
-
* deleting it is rejected at the cap level.
|
|
6390
|
-
*/
|
|
6391
|
-
var StorageLocationSchema = object({
|
|
6392
|
-
id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
|
|
6393
|
-
type: string(),
|
|
6394
|
-
displayName: string().min(1),
|
|
6395
|
-
providerId: string().min(1),
|
|
6396
|
-
config: record(string(), unknown()),
|
|
6397
|
-
/**
|
|
6398
|
-
* Cluster node this location physically lives on. REQUIRED for node-local
|
|
6399
|
-
* providers (filesystem — the path exists on one node's disk), null/absent
|
|
6400
|
-
* for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
|
|
6401
|
-
* `'hub'` is the hub node. Validated against the provider's `nodeLocal`
|
|
6402
|
-
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
6403
|
-
*/
|
|
6404
|
-
nodeId: string().optional(),
|
|
6405
|
-
isDefault: boolean().default(false),
|
|
6406
|
-
isSystem: boolean().default(false),
|
|
6407
|
-
createdAt: number(),
|
|
6408
|
-
updatedAt: number()
|
|
6409
|
-
});
|
|
6410
|
-
/**
|
|
6411
|
-
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
6412
|
-
* Either:
|
|
6413
|
-
* - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
|
|
6414
|
-
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
6415
|
-
*
|
|
6416
|
-
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
6417
|
-
*/
|
|
6418
|
-
var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
|
|
6419
|
-
/**
|
|
6420
|
-
* `StorageLocationDeclaration` — a single storage-location entry declared by
|
|
6421
|
-
* an addon in its `package.json` under `camstack.storageLocations`.
|
|
6422
|
-
*
|
|
6423
|
-
* Design intent:
|
|
6424
|
-
* - **Addon declares its needs** — each addon describes the logical storage
|
|
6425
|
-
* slots it requires (e.g. `recordings`, `recordingsLow`) without caring
|
|
6426
|
-
* about the physical path.
|
|
6427
|
-
* - **Kernel aggregates** — at boot the kernel collects declarations from all
|
|
6428
|
-
* installed addons, deduplicates by `id`, and exposes the union via the
|
|
6429
|
-
* storage-locations settings surface.
|
|
6430
|
-
* - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
|
|
6431
|
-
* at least one instance named `<id>:default` is present, using
|
|
6432
|
-
* `defaultsTo` to inherit the resolved root from another location when the
|
|
6433
|
-
* declaration is a derivative slot (e.g. `recordingsLow` defaults to
|
|
6434
|
-
* `recordings`).
|
|
6435
|
-
* - **ids are global** — `id` values are shared across the entire deployment;
|
|
6436
|
-
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
6437
|
-
* at kernel aggregation time, not here).
|
|
6438
|
-
*/
|
|
6439
|
-
var StorageLocationDeclarationSchema = object({
|
|
6440
|
-
/**
|
|
6441
|
-
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
6442
|
-
* Must start with a lowercase letter and may contain letters, digits, and
|
|
6443
|
-
* hyphens.
|
|
6444
|
-
*/
|
|
6445
|
-
id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
|
|
6446
|
-
/** Human-readable name shown in the admin UI. */
|
|
6447
|
-
displayName: string().min(1, { message: "displayName must not be empty" }),
|
|
6448
|
-
/** Optional longer explanation of what data this location stores. */
|
|
6449
|
-
description: string().optional(),
|
|
6450
|
-
/**
|
|
6451
|
-
* `single` — exactly one instance of this location is allowed system-wide
|
|
6452
|
-
* (e.g. `logs`, `models`). The operator can edit it but not add more.
|
|
6453
|
-
* `multi` — the operator may register several instances (e.g. a second
|
|
6454
|
-
* `recordings` on a NAS for disk tiering); one is the default at any time.
|
|
6455
|
-
*/
|
|
6456
|
-
cardinality: _enum(["single", "multi"]),
|
|
6457
|
-
/**
|
|
6458
|
-
* When set, the default instance for this location inherits its resolved
|
|
6459
|
-
* root from the named location's default instance. Useful for derivative
|
|
6460
|
-
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
6461
|
-
* configure the primary location.
|
|
6462
|
-
*/
|
|
6463
|
-
defaultsTo: string().optional()
|
|
6464
|
-
});
|
|
6465
|
-
var DecoderStatsSchema = object({
|
|
6466
|
-
inputFps: number(),
|
|
6467
|
-
outputFps: number(),
|
|
6468
|
-
avgDecodeTimeMs: number(),
|
|
6469
|
-
droppedFrames: number()
|
|
6470
|
-
});
|
|
6471
|
-
var DecoderSessionConfigSchema = object({
|
|
6472
|
-
codec: string(),
|
|
6473
|
-
maxFps: number().default(0),
|
|
6474
|
-
outputFormat: _enum([
|
|
6475
|
-
"jpeg",
|
|
6476
|
-
"rgb",
|
|
6477
|
-
"bgr",
|
|
6478
|
-
"yuv420",
|
|
6479
|
-
"gray"
|
|
6480
|
-
]).default("jpeg"),
|
|
6481
|
-
scale: number().default(1),
|
|
6482
|
-
width: number().optional(),
|
|
6483
|
-
height: number().optional(),
|
|
6179
|
+
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
6180
|
+
DeviceType["Camera"] = "camera";
|
|
6181
|
+
DeviceType["Hub"] = "hub";
|
|
6182
|
+
DeviceType["Light"] = "light";
|
|
6183
|
+
DeviceType["Siren"] = "siren";
|
|
6184
|
+
DeviceType["Switch"] = "switch";
|
|
6185
|
+
DeviceType["Sensor"] = "sensor";
|
|
6186
|
+
DeviceType["Thermostat"] = "thermostat";
|
|
6187
|
+
DeviceType["Button"] = "button";
|
|
6188
|
+
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
6189
|
+
* event vocabulary verbatim (no normalization). Installed with the
|
|
6190
|
+
* `event-emitter` cap. Sources: HA `event.*` entities (structured) and
|
|
6191
|
+
* HA bus events (e.g. `zha_event`, generic). */
|
|
6192
|
+
DeviceType["EventEmitter"] = "event-emitter";
|
|
6193
|
+
/** Firmware/software update entity — current vs available version,
|
|
6194
|
+
* updatable flag, update state, and an install action. Installed with
|
|
6195
|
+
* the `update` cap. Sources: Homematic firmware-update channels (and
|
|
6196
|
+
* reusable by other providers, e.g. HA `update.*` entities). */
|
|
6197
|
+
DeviceType["Update"] = "update";
|
|
6198
|
+
DeviceType["Generic"] = "generic";
|
|
6199
|
+
/** Generic notification delivery target (HA `notify.<service>`, future
|
|
6200
|
+
* Telegram / Discord / ntfy / SMTP, …). One device per delivery
|
|
6201
|
+
* endpoint; the `notifier` cap defines the send surface. */
|
|
6202
|
+
DeviceType["Notifier"] = "notifier";
|
|
6203
|
+
/** Pre-recorded action sequence with optional parameters
|
|
6204
|
+
* (HA `script.*`). Runnable via `script-runner` cap. */
|
|
6205
|
+
DeviceType["Script"] = "script";
|
|
6206
|
+
/** Automation rule (HA `automation.*`) — enable/disable + manual
|
|
6207
|
+
* trigger surface exposed via `automation-control` cap. */
|
|
6208
|
+
DeviceType["Automation"] = "automation";
|
|
6209
|
+
/** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
|
|
6210
|
+
DeviceType["Lock"] = "lock";
|
|
6211
|
+
/** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
|
|
6212
|
+
* `valve.*`). `cover` cap with sub-roles for variant. */
|
|
6213
|
+
DeviceType["Cover"] = "cover";
|
|
6214
|
+
/** Pipe / water / gas valve with open/close/stop and optional
|
|
6215
|
+
* position (HA `valve.*`). `valve` cap — a cover-sibling actuator
|
|
6216
|
+
* modelled on the same open/closed lifecycle. */
|
|
6217
|
+
DeviceType["Valve"] = "valve";
|
|
6218
|
+
/** Humidifier / dehumidifier with on/off + target humidity + mode
|
|
6219
|
+
* (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
|
|
6220
|
+
* modelled on the same target / mode lifecycle. */
|
|
6221
|
+
DeviceType["Humidifier"] = "humidifier";
|
|
6222
|
+
/** Water heater / boiler with target temperature + operation mode +
|
|
6223
|
+
* away mode (HA `water_heater.*`). `water-heater` cap — a
|
|
6224
|
+
* climate-family actuator. */
|
|
6225
|
+
DeviceType["WaterHeater"] = "water-heater";
|
|
6226
|
+
/** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
|
|
6227
|
+
DeviceType["Fan"] = "fan";
|
|
6228
|
+
/** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
|
|
6229
|
+
* the camera surface — those use `Camera`. `media-player` cap. */
|
|
6230
|
+
DeviceType["MediaPlayer"] = "media-player";
|
|
6231
|
+
/** Security panel / alarm system (HA `alarm_control_panel.*`).
|
|
6232
|
+
* `alarm-panel` cap. */
|
|
6233
|
+
DeviceType["AlarmPanel"] = "alarm-panel";
|
|
6234
|
+
/** Generic user-settable input (HA `number` / `input_number` / `select`
|
|
6235
|
+
* / `input_select` / `text` / `input_text` / `input_datetime`).
|
|
6236
|
+
* Sub-type via `DeviceRole`: NumericControl / SelectControl /
|
|
6237
|
+
* TextControl / DateTimeControl. */
|
|
6238
|
+
DeviceType["Control"] = "control";
|
|
6239
|
+
/** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
|
|
6240
|
+
* `presence` cap. */
|
|
6241
|
+
DeviceType["Presence"] = "presence";
|
|
6242
|
+
/** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
|
|
6243
|
+
* `weather` cap. */
|
|
6244
|
+
DeviceType["Weather"] = "weather";
|
|
6245
|
+
/** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
|
|
6246
|
+
DeviceType["Vacuum"] = "vacuum";
|
|
6247
|
+
/** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
|
|
6248
|
+
* `lawn-mower-control` cap. */
|
|
6249
|
+
DeviceType["LawnMower"] = "lawn-mower";
|
|
6250
|
+
/** Physical HA device group — parent container for entity-children
|
|
6251
|
+
* adopted from a single HA device entry. Not renderable as a
|
|
6252
|
+
* standalone device; exists only to anchor child entities. */
|
|
6253
|
+
DeviceType["Container"] = "container";
|
|
6254
|
+
/** Single still-image entity (HA `image.*`). Read-only display of an
|
|
6255
|
+
* `entity_picture` signed URL the browser loads directly. `image` cap. */
|
|
6256
|
+
DeviceType["Image"] = "image";
|
|
6257
|
+
return DeviceType;
|
|
6258
|
+
}({});
|
|
6259
|
+
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
6260
|
+
DeviceFeature["BatteryOperated"] = "battery-operated";
|
|
6261
|
+
DeviceFeature["Rebootable"] = "rebootable";
|
|
6484
6262
|
/**
|
|
6485
|
-
*
|
|
6486
|
-
*
|
|
6487
|
-
*
|
|
6488
|
-
* per-camera filtering when diagnosing failures (e.g. node-av
|
|
6489
|
-
* sendPacket errors on a single hung camera).
|
|
6263
|
+
* Device supports an on-demand re-sync of its derived spec with its
|
|
6264
|
+
* upstream source — drives the generic Re-sync button. The owning
|
|
6265
|
+
* provider implements the action via the `device-adoption.resync` cap.
|
|
6490
6266
|
*/
|
|
6491
|
-
|
|
6267
|
+
DeviceFeature["Resyncable"] = "resyncable";
|
|
6268
|
+
DeviceFeature["NativeSnapshot"] = "native-snapshot";
|
|
6269
|
+
DeviceFeature["DoorbellButton"] = "doorbell-button";
|
|
6270
|
+
DeviceFeature["TwoWayAudio"] = "two-way-audio";
|
|
6271
|
+
DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
|
|
6492
6272
|
/**
|
|
6493
|
-
*
|
|
6494
|
-
* `
|
|
6495
|
-
*
|
|
6496
|
-
*
|
|
6273
|
+
* Camera supports the on-firmware autotrack subsystem (subject-
|
|
6274
|
+
* following). Distinct from `PanTiltZoom` because not every PTZ
|
|
6275
|
+
* camera ships autotrack — the admin UI uses this flag to gate
|
|
6276
|
+
* the autotrack toggle / settings card without re-deriving from
|
|
6277
|
+
* the cap registry. Mirrors `ptz-autotrack` cap registration:
|
|
6278
|
+
* driver sets this feature when probe confirms the firmware
|
|
6279
|
+
* surface, and registers the cap in the same code path.
|
|
6497
6280
|
*/
|
|
6498
|
-
|
|
6281
|
+
DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
|
|
6499
6282
|
/**
|
|
6500
|
-
*
|
|
6283
|
+
* Accessory exposes a "trigger on motion" toggle — the parent camera's
|
|
6284
|
+
* motion detection automatically activates this device. Mirrors
|
|
6285
|
+
* `motion-trigger` cap registration: drivers set this feature in the
|
|
6286
|
+
* same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
|
|
6501
6287
|
*
|
|
6502
|
-
*
|
|
6503
|
-
*
|
|
6504
|
-
*
|
|
6505
|
-
* into an OS shared-memory ring and drained as zero-pixel
|
|
6506
|
-
* `FrameHandle`s via `pullHandles`. A session is one mode or the
|
|
6507
|
-
* other — `pullFrames` returns nothing for an `'shm'` session and
|
|
6508
|
-
* `pullHandles` returns nothing for a `'callback'` session.
|
|
6509
|
-
*/
|
|
6510
|
-
frameSink: _enum(["callback", "shm"]).default("callback")
|
|
6511
|
-
});
|
|
6512
|
-
var EncodeProfileSchema = object({
|
|
6513
|
-
video: object({
|
|
6514
|
-
codec: _enum([
|
|
6515
|
-
"h264",
|
|
6516
|
-
"h265",
|
|
6517
|
-
"copy"
|
|
6518
|
-
]),
|
|
6519
|
-
profile: _enum([
|
|
6520
|
-
"baseline",
|
|
6521
|
-
"main",
|
|
6522
|
-
"high"
|
|
6523
|
-
]).optional(),
|
|
6524
|
-
width: number().int().positive().optional(),
|
|
6525
|
-
height: number().int().positive().optional(),
|
|
6526
|
-
fps: number().positive().optional(),
|
|
6527
|
-
bitrateKbps: number().int().positive().optional(),
|
|
6528
|
-
gopFrames: number().int().positive().optional(),
|
|
6529
|
-
bf: number().int().min(0).optional(),
|
|
6530
|
-
preset: _enum([
|
|
6531
|
-
"ultrafast",
|
|
6532
|
-
"superfast",
|
|
6533
|
-
"veryfast",
|
|
6534
|
-
"faster",
|
|
6535
|
-
"fast",
|
|
6536
|
-
"medium"
|
|
6537
|
-
]).optional(),
|
|
6538
|
-
tune: _enum([
|
|
6539
|
-
"zerolatency",
|
|
6540
|
-
"film",
|
|
6541
|
-
"animation"
|
|
6542
|
-
]).optional()
|
|
6543
|
-
}),
|
|
6544
|
-
audio: union([literal("passthrough"), object({
|
|
6545
|
-
codec: _enum([
|
|
6546
|
-
"opus",
|
|
6547
|
-
"aac",
|
|
6548
|
-
"pcmu",
|
|
6549
|
-
"pcma",
|
|
6550
|
-
"copy"
|
|
6551
|
-
]),
|
|
6552
|
-
bitrateKbps: number().int().positive().optional(),
|
|
6553
|
-
sampleRateHz: number().int().positive().optional(),
|
|
6554
|
-
channels: union([literal(1), literal(2)]).optional()
|
|
6555
|
-
})]),
|
|
6556
|
-
/**
|
|
6557
|
-
* ffmpeg input-side args, inserted between the fixed global flags
|
|
6558
|
-
* (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
|
|
6559
|
-
* — the widget surfaces a textarea + suggestion chips for the most-
|
|
6560
|
-
* used demuxer/format options.
|
|
6561
|
-
*/
|
|
6562
|
-
inputArgs: array(string()).optional(),
|
|
6563
|
-
/**
|
|
6564
|
-
* ffmpeg output-side args, inserted between the encode block and
|
|
6565
|
-
* the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
|
|
6566
|
-
* filters, codec-specific overrides. Free-text array.
|
|
6288
|
+
* Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
|
|
6289
|
+
* fast scalar without binding fetch), notifier rules, and `listAll`
|
|
6290
|
+
* filters that want "all devices with on-motion behaviour".
|
|
6567
6291
|
*/
|
|
6568
|
-
|
|
6569
|
-
|
|
6570
|
-
|
|
6571
|
-
|
|
6572
|
-
|
|
6573
|
-
|
|
6574
|
-
|
|
6575
|
-
|
|
6576
|
-
|
|
6577
|
-
|
|
6578
|
-
|
|
6292
|
+
DeviceFeature["MotionTrigger"] = "motion-trigger";
|
|
6293
|
+
/** Light supports rgb-triplet color via `color` cap. */
|
|
6294
|
+
DeviceFeature["LightColorRgb"] = "light-color-rgb";
|
|
6295
|
+
/** Light supports HSV color via `color` cap. */
|
|
6296
|
+
DeviceFeature["LightColorHsv"] = "light-color-hsv";
|
|
6297
|
+
/** Light supports color-temperature (mired) via `color` cap. */
|
|
6298
|
+
DeviceFeature["LightColorMired"] = "light-color-mired";
|
|
6299
|
+
/** Thermostat supports a `heat_cool` dual setpoint (targetLow +
|
|
6300
|
+
* targetHigh). Gates the range slider UI. */
|
|
6301
|
+
DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
|
|
6302
|
+
/** Thermostat exposes target humidity and/or current humidity
|
|
6303
|
+
* readings. Gates the humidity controls. */
|
|
6304
|
+
DeviceFeature["ClimateHumidity"] = "climate-humidity";
|
|
6305
|
+
/** Thermostat exposes a fan-mode selector. */
|
|
6306
|
+
DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
|
|
6307
|
+
/** Thermostat exposes preset modes (eco / away / sleep / vendor). */
|
|
6308
|
+
DeviceFeature["ClimatePreset"] = "climate-preset";
|
|
6309
|
+
/** Cover exposes intermediate position control (0..100). Gates the
|
|
6310
|
+
* position slider UI. */
|
|
6311
|
+
DeviceFeature["CoverPositionable"] = "cover-positionable";
|
|
6312
|
+
/** Cover exposes slat-tilt control. Gates the tilt slider UI. */
|
|
6313
|
+
DeviceFeature["CoverTilt"] = "cover-tilt";
|
|
6314
|
+
/** Valve exposes intermediate position control (0..100). Gates the
|
|
6315
|
+
* position slider / drag surface UI. */
|
|
6316
|
+
DeviceFeature["ValvePositionable"] = "valve-positionable";
|
|
6317
|
+
/** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
|
|
6318
|
+
DeviceFeature["FanSpeed"] = "fan-speed";
|
|
6319
|
+
/** Fan exposes a preset mode selector. */
|
|
6320
|
+
DeviceFeature["FanPreset"] = "fan-preset";
|
|
6321
|
+
/** Fan exposes blade direction (forward/reverse) — typical of
|
|
6322
|
+
* ceiling fans. */
|
|
6323
|
+
DeviceFeature["FanDirection"] = "fan-direction";
|
|
6324
|
+
/** Fan exposes an oscillation toggle. */
|
|
6325
|
+
DeviceFeature["FanOscillating"] = "fan-oscillating";
|
|
6326
|
+
/** Lock requires a PIN code on lock/unlock. Gates the code-entry
|
|
6327
|
+
* field on the UI lock-controls panel. */
|
|
6328
|
+
DeviceFeature["LockPinRequired"] = "lock-pin-required";
|
|
6329
|
+
/** Lock supports a latch-release ("open door") action distinct from
|
|
6330
|
+
* unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
|
|
6331
|
+
* `supported_features`. Gates the Open Door button in the UI. */
|
|
6332
|
+
DeviceFeature["LockOpen"] = "lock-open";
|
|
6333
|
+
/** Media player exposes a seek-to-position surface. */
|
|
6334
|
+
DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
|
|
6335
|
+
/** Media player exposes a volume-level setter. */
|
|
6336
|
+
DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
|
|
6337
|
+
/** Media player exposes a mute toggle distinct from volume=0. */
|
|
6338
|
+
DeviceFeature["MediaPlayerMute"] = "media-player-mute";
|
|
6339
|
+
/** Media player exposes a shuffle toggle. */
|
|
6340
|
+
DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
|
|
6341
|
+
/** Media player exposes a repeat mode (off / all / one). */
|
|
6342
|
+
DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
|
|
6343
|
+
/** Media player exposes a source / input selector. */
|
|
6344
|
+
DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
|
|
6345
|
+
/** Media player exposes a play-arbitrary-media surface (URL / id). */
|
|
6346
|
+
DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
|
|
6347
|
+
/** Media player exposes next-track. */
|
|
6348
|
+
DeviceFeature["MediaPlayerNext"] = "media-player-next";
|
|
6349
|
+
/** Media player exposes previous-track. */
|
|
6350
|
+
DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
|
|
6351
|
+
/** Media player exposes stop distinct from pause. */
|
|
6352
|
+
DeviceFeature["MediaPlayerStop"] = "media-player-stop";
|
|
6353
|
+
/** Alarm panel requires a PIN code on arm/disarm. */
|
|
6354
|
+
DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
|
|
6355
|
+
/** Presence device carries GPS coordinates (lat/lng/accuracy) in
|
|
6356
|
+
* addition to a textual location. */
|
|
6357
|
+
DeviceFeature["PresenceGps"] = "presence-gps";
|
|
6358
|
+
/** Notifier accepts an inline / URL image attachment. */
|
|
6359
|
+
DeviceFeature["NotifierImage"] = "notifier-image";
|
|
6360
|
+
/** Notifier accepts a priority hint (high/normal/low). */
|
|
6361
|
+
DeviceFeature["NotifierPriority"] = "notifier-priority";
|
|
6362
|
+
/** Notifier accepts a free-form `data` payload for platform-specific
|
|
6363
|
+
* fields. */
|
|
6364
|
+
DeviceFeature["NotifierData"] = "notifier-data";
|
|
6365
|
+
/** Notifier supports interactive action buttons / callbacks. */
|
|
6366
|
+
DeviceFeature["NotifierActions"] = "notifier-actions";
|
|
6367
|
+
/** Notifier supports per-call recipient targeting (multi-user). */
|
|
6368
|
+
DeviceFeature["NotifierRecipients"] = "notifier-recipients";
|
|
6369
|
+
/** Script runner accepts a variables map on each run invocation. */
|
|
6370
|
+
DeviceFeature["ScriptVariables"] = "script-variables";
|
|
6371
|
+
/** Automation `trigger` accepts a skipCondition flag — fires the
|
|
6372
|
+
* automation's actions while bypassing its condition block. */
|
|
6373
|
+
DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
|
|
6374
|
+
return DeviceFeature;
|
|
6375
|
+
}({});
|
|
6376
|
+
/**
|
|
6377
|
+
* Semantic role a device plays within its parent. Populated by driver
|
|
6378
|
+
* addons when creating accessory devices (Reolink siren/floodlight/
|
|
6379
|
+
* PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
|
|
6380
|
+
* admin UI to pick icons, labels, and widgets — a `Switch` with
|
|
6381
|
+
* `role: Floodlight` renders as a bulb with a brightness slider,
|
|
6382
|
+
* whereas a `Switch` with `role: Siren` renders as a klaxon.
|
|
6383
|
+
*
|
|
6384
|
+
* Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
|
|
6385
|
+
* sqlite as a nullable TEXT column — old rows keep working unchanged.
|
|
6386
|
+
*/
|
|
6387
|
+
var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
6388
|
+
DeviceRole["Siren"] = "siren";
|
|
6389
|
+
DeviceRole["Floodlight"] = "floodlight";
|
|
6390
|
+
DeviceRole["Spotlight"] = "spotlight";
|
|
6391
|
+
DeviceRole["PirSensor"] = "pir-sensor";
|
|
6392
|
+
DeviceRole["Chime"] = "chime";
|
|
6393
|
+
DeviceRole["Autotrack"] = "autotrack";
|
|
6394
|
+
DeviceRole["Nightvision"] = "nightvision";
|
|
6395
|
+
DeviceRole["PrivacyMask"] = "privacy-mask";
|
|
6396
|
+
DeviceRole["Doorbell"] = "doorbell";
|
|
6397
|
+
/** Virtual HA toggle (input_boolean.*) — distinguishable from a
|
|
6398
|
+
* real Switch device for UI rendering / export adapters. */
|
|
6399
|
+
DeviceRole["BinaryHelper"] = "binary-helper";
|
|
6400
|
+
/** Generic motion / occupancy / moving event source. Distinct from
|
|
6401
|
+
* the camera accessory PirSensor role: that one is a camera child;
|
|
6402
|
+
* this is a standalone HA / 3rd-party motion sensor. */
|
|
6403
|
+
DeviceRole["MotionSensor"] = "motion-sensor";
|
|
6404
|
+
DeviceRole["ContactSensor"] = "contact-sensor";
|
|
6405
|
+
DeviceRole["LeakSensor"] = "leak-sensor";
|
|
6406
|
+
DeviceRole["SmokeSensor"] = "smoke-sensor";
|
|
6407
|
+
DeviceRole["COSensor"] = "co-sensor";
|
|
6408
|
+
DeviceRole["GasSensor"] = "gas-sensor";
|
|
6409
|
+
DeviceRole["TamperSensor"] = "tamper-sensor";
|
|
6410
|
+
DeviceRole["VibrationSensor"] = "vibration-sensor";
|
|
6411
|
+
DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
|
|
6412
|
+
DeviceRole["SoundSensor"] = "sound-sensor";
|
|
6413
|
+
/** Fallback for `binary_sensor` without a known `device_class`. */
|
|
6414
|
+
DeviceRole["BinarySensor"] = "binary-sensor";
|
|
6415
|
+
DeviceRole["TemperatureSensor"] = "temperature-sensor";
|
|
6416
|
+
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
6417
|
+
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
6418
|
+
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
6419
|
+
DeviceRole["PowerSensor"] = "power-sensor";
|
|
6420
|
+
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
6421
|
+
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
6422
|
+
DeviceRole["CurrentSensor"] = "current-sensor";
|
|
6423
|
+
DeviceRole["AirQualitySensor"] = "air-quality-sensor";
|
|
6424
|
+
/** Battery level (numeric % via `sensor` OR low-bool via
|
|
6425
|
+
* `binary_sensor` — the cap distinguishes via the value type). */
|
|
6426
|
+
DeviceRole["BatterySensor"] = "battery-sensor";
|
|
6427
|
+
/** Fallback for `sensor` numeric without a known `device_class`. */
|
|
6428
|
+
DeviceRole["NumericSensor"] = "numeric-sensor";
|
|
6429
|
+
/** String / enum state (HA `sensor` with `state_class: enum` or
|
|
6430
|
+
* `attributes.options`). */
|
|
6431
|
+
DeviceRole["EnumSensor"] = "enum-sensor";
|
|
6432
|
+
/** Date / timestamp state (HA `sensor` with `device_class: timestamp`
|
|
6433
|
+
* or `date`). The slice carries the raw ISO string verbatim (hosted on
|
|
6434
|
+
* the `enum-sensor` cap); the UI renders it locale-formatted. */
|
|
6435
|
+
DeviceRole["DateTimeSensor"] = "datetime-sensor";
|
|
6436
|
+
/** Last-resort fallback when nothing else matches. */
|
|
6437
|
+
DeviceRole["GenericSensor"] = "generic-sensor";
|
|
6438
|
+
DeviceRole["NumericControl"] = "numeric-control";
|
|
6439
|
+
DeviceRole["SelectControl"] = "select-control";
|
|
6440
|
+
DeviceRole["TextControl"] = "text-control";
|
|
6441
|
+
DeviceRole["DateTimeControl"] = "datetime-control";
|
|
6442
|
+
/** Mobile push notifier (HA `notify.mobile_app_*`) — supports
|
|
6443
|
+
* rich features (image, priority, channel routing). */
|
|
6444
|
+
DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
|
|
6445
|
+
/** Chat / messaging service (HA `notify.telegram_*`,
|
|
6446
|
+
* `notify.discord_*`, etc.). */
|
|
6447
|
+
DeviceRole["MessagingNotifier"] = "messaging-notifier";
|
|
6448
|
+
/** Email-based delivery (HA `notify.smtp`, etc.). */
|
|
6449
|
+
DeviceRole["EmailNotifier"] = "email-notifier";
|
|
6450
|
+
/** Fallback when the notifier service name doesn't match a known
|
|
6451
|
+
* pattern. */
|
|
6452
|
+
DeviceRole["GenericNotifier"] = "generic-notifier";
|
|
6453
|
+
return DeviceRole;
|
|
6454
|
+
}({});
|
|
6455
|
+
/**
|
|
6456
|
+
* Generic types for capability definitions.
|
|
6457
|
+
*
|
|
6458
|
+
* A capability is defined with Zod schemas for methods, events, and settings.
|
|
6459
|
+
* TypeScript types are inferred via z.infer<> — zero duplication.
|
|
6460
|
+
*
|
|
6461
|
+
* Pattern:
|
|
6462
|
+
* 1. Define Zod schemas for data, methods, settings
|
|
6463
|
+
* 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
|
|
6464
|
+
* 3. Export type IProvider = InferProvider<typeof capabilityDef>
|
|
6465
|
+
* 4. Addon implements IProvider
|
|
6466
|
+
* 5. Registry auto-mounts tRPC router from definition.methods
|
|
6467
|
+
*/
|
|
6468
|
+
/**
|
|
6469
|
+
* Output schema shared by the contribution + live methods.
|
|
6470
|
+
*
|
|
6471
|
+
* Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
|
|
6472
|
+
* tabs[]) without importing from `../interfaces/config-ui.js` — a
|
|
6473
|
+
* concrete-but-lenient Zod object keeps tRPC output inference happy
|
|
6474
|
+
* (using `z.unknown()` here collapses unrelated router branches to
|
|
6475
|
+
* `unknown` when the generator re-inlines the huge AppRouter type).
|
|
6476
|
+
*
|
|
6477
|
+
* `.passthrough()` on sections/fields accepts whatever FormBuilder
|
|
6478
|
+
* extensions the caller adds (showWhen, displayScale, …) without
|
|
6479
|
+
* rebuilding every time a new field kind is introduced.
|
|
6480
|
+
*/
|
|
6481
|
+
var ContributionSectionSchema = object({
|
|
6482
|
+
id: string(),
|
|
6483
|
+
title: string(),
|
|
6484
|
+
description: string().optional(),
|
|
6485
|
+
style: _enum(["card", "accordion"]).optional(),
|
|
6486
|
+
defaultCollapsed: boolean().optional(),
|
|
6487
|
+
columns: union([
|
|
6488
|
+
literal(1),
|
|
6489
|
+
literal(2),
|
|
6490
|
+
literal(3),
|
|
6491
|
+
literal(4)
|
|
6492
|
+
]).optional(),
|
|
6493
|
+
tab: string().optional(),
|
|
6494
|
+
location: _enum(["settings", "top-tab"]).optional(),
|
|
6495
|
+
order: number().optional(),
|
|
6496
|
+
fields: array(any())
|
|
6497
|
+
});
|
|
6498
|
+
object({
|
|
6499
|
+
tabs: array(object({
|
|
6500
|
+
id: string(),
|
|
6501
|
+
label: string(),
|
|
6502
|
+
icon: string(),
|
|
6503
|
+
order: number().optional()
|
|
6504
|
+
})).optional(),
|
|
6505
|
+
sections: array(ContributionSectionSchema)
|
|
6506
|
+
}).nullable();
|
|
6507
|
+
object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
6508
|
+
deviceId: number(),
|
|
6509
|
+
patch: record(string(), unknown())
|
|
6510
|
+
}), object({ success: literal(true) });
|
|
6511
|
+
object({ deviceId: number() }), unknown().nullable();
|
|
6512
|
+
/** Shorthand to define a method schema */
|
|
6513
|
+
function method(input, output, options) {
|
|
6514
|
+
return {
|
|
6515
|
+
input,
|
|
6516
|
+
output,
|
|
6517
|
+
kind: options?.kind ?? "query",
|
|
6518
|
+
auth: options?.auth ?? "protected",
|
|
6519
|
+
...options?.access !== void 0 ? { access: options.access } : {},
|
|
6520
|
+
timeoutMs: options?.timeoutMs
|
|
6521
|
+
};
|
|
6579
6522
|
}
|
|
6580
|
-
var
|
|
6581
|
-
|
|
6582
|
-
|
|
6583
|
-
|
|
6584
|
-
|
|
6585
|
-
|
|
6586
|
-
|
|
6587
|
-
|
|
6588
|
-
|
|
6589
|
-
|
|
6590
|
-
|
|
6591
|
-
|
|
6592
|
-
|
|
6593
|
-
|
|
6594
|
-
|
|
6595
|
-
|
|
6596
|
-
|
|
6597
|
-
|
|
6598
|
-
|
|
6599
|
-
|
|
6600
|
-
|
|
6601
|
-
|
|
6602
|
-
|
|
6603
|
-
|
|
6604
|
-
|
|
6605
|
-
|
|
6606
|
-
"
|
|
6607
|
-
|
|
6608
|
-
|
|
6609
|
-
"
|
|
6610
|
-
|
|
6611
|
-
|
|
6612
|
-
|
|
6613
|
-
|
|
6614
|
-
|
|
6615
|
-
|
|
6616
|
-
|
|
6617
|
-
|
|
6618
|
-
|
|
6619
|
-
|
|
6620
|
-
|
|
6621
|
-
|
|
6622
|
-
|
|
6623
|
-
|
|
6624
|
-
|
|
6625
|
-
|
|
6626
|
-
|
|
6627
|
-
|
|
6628
|
-
|
|
6629
|
-
|
|
6630
|
-
|
|
6631
|
-
|
|
6632
|
-
|
|
6633
|
-
|
|
6634
|
-
|
|
6635
|
-
|
|
6636
|
-
|
|
6637
|
-
|
|
6638
|
-
|
|
6639
|
-
|
|
6640
|
-
|
|
6641
|
-
|
|
6642
|
-
|
|
6643
|
-
|
|
6644
|
-
|
|
6645
|
-
|
|
6646
|
-
|
|
6647
|
-
|
|
6648
|
-
|
|
6649
|
-
|
|
6650
|
-
|
|
6651
|
-
|
|
6652
|
-
|
|
6653
|
-
|
|
6654
|
-
|
|
6655
|
-
|
|
6656
|
-
|
|
6657
|
-
|
|
6658
|
-
|
|
6659
|
-
|
|
6660
|
-
|
|
6661
|
-
|
|
6662
|
-
|
|
6663
|
-
|
|
6664
|
-
|
|
6665
|
-
|
|
6666
|
-
|
|
6667
|
-
|
|
6668
|
-
|
|
6669
|
-
|
|
6670
|
-
|
|
6671
|
-
|
|
6672
|
-
|
|
6673
|
-
|
|
6674
|
-
|
|
6675
|
-
|
|
6676
|
-
|
|
6677
|
-
|
|
6678
|
-
|
|
6679
|
-
|
|
6680
|
-
|
|
6681
|
-
|
|
6682
|
-
|
|
6683
|
-
|
|
6684
|
-
|
|
6685
|
-
|
|
6686
|
-
|
|
6687
|
-
|
|
6688
|
-
|
|
6689
|
-
|
|
6690
|
-
|
|
6691
|
-
|
|
6692
|
-
|
|
6693
|
-
|
|
6694
|
-
|
|
6695
|
-
|
|
6696
|
-
|
|
6697
|
-
|
|
6698
|
-
|
|
6699
|
-
|
|
6700
|
-
|
|
6701
|
-
|
|
6702
|
-
|
|
6703
|
-
|
|
6704
|
-
|
|
6705
|
-
|
|
6706
|
-
|
|
6707
|
-
|
|
6708
|
-
|
|
6709
|
-
|
|
6710
|
-
|
|
6711
|
-
|
|
6712
|
-
|
|
6713
|
-
|
|
6714
|
-
|
|
6715
|
-
|
|
6716
|
-
|
|
6717
|
-
|
|
6718
|
-
|
|
6719
|
-
|
|
6720
|
-
|
|
6721
|
-
|
|
6722
|
-
|
|
6723
|
-
|
|
6724
|
-
|
|
6725
|
-
|
|
6726
|
-
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
/**
|
|
6885
|
-
*
|
|
6886
|
-
*
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
*
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6523
|
+
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
6524
|
+
var VersionOutputSchema = object({ version: string() });
|
|
6525
|
+
method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
|
|
6526
|
+
/**
|
|
6527
|
+
* device-ops — device-scoped cap that unifies the per-IDevice operations
|
|
6528
|
+
* previously routed through the `.device-ops` Moleculer bridge service.
|
|
6529
|
+
*
|
|
6530
|
+
* Each worker that hosts live `IDevice` instances auto-registers a native
|
|
6531
|
+
* provider for this cap (per device) backed by its local
|
|
6532
|
+
* `DeviceRegistry`. Hub-side callers reach it transparently through
|
|
6533
|
+
* `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
|
|
6534
|
+
* `deviceId` + `nodeId` and dispatches through the standard cap-router,
|
|
6535
|
+
* so there's no parallel bridge path anymore.
|
|
6536
|
+
*
|
|
6537
|
+
* The surface is intentionally small — every method corresponds to a
|
|
6538
|
+
* single action on the live `IDevice` (or `ICameraDevice` for
|
|
6539
|
+
* `getStreamSources`). Richer orchestration (enable/disable with
|
|
6540
|
+
* integration plumbing, bulk updates) stays in the `device-manager` cap;
|
|
6541
|
+
* `device-ops` is the per-device primitive the device-manager routes to.
|
|
6542
|
+
*/
|
|
6543
|
+
var StreamSourceEntrySchema = object({
|
|
6544
|
+
id: string(),
|
|
6545
|
+
label: string(),
|
|
6546
|
+
protocol: _enum([
|
|
6547
|
+
"rtsp",
|
|
6548
|
+
"rtmp",
|
|
6549
|
+
"annexb",
|
|
6550
|
+
"http-mjpeg",
|
|
6551
|
+
"webrtc",
|
|
6552
|
+
"custom"
|
|
6553
|
+
]),
|
|
6554
|
+
url: string().optional(),
|
|
6555
|
+
resolution: object({
|
|
6556
|
+
width: number(),
|
|
6557
|
+
height: number()
|
|
6558
|
+
}).optional(),
|
|
6559
|
+
fps: number().optional(),
|
|
6560
|
+
bitrate: number().optional(),
|
|
6561
|
+
codec: string().optional(),
|
|
6562
|
+
profileHint: CamProfileSchema.optional(),
|
|
6563
|
+
sdp: string().optional()
|
|
6564
|
+
});
|
|
6565
|
+
var ConfigEntrySchema$1 = object({
|
|
6566
|
+
key: string(),
|
|
6567
|
+
value: unknown()
|
|
6568
|
+
});
|
|
6569
|
+
var RawStateResultSchema = object({
|
|
6570
|
+
/** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
|
|
6571
|
+
source: string(),
|
|
6572
|
+
/** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
|
|
6573
|
+
data: record(string(), unknown())
|
|
6574
|
+
});
|
|
6575
|
+
method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
|
|
6576
|
+
deviceId: number(),
|
|
6577
|
+
values: record(string(), unknown())
|
|
6578
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
6579
|
+
deviceId: number(),
|
|
6580
|
+
action: string().min(1),
|
|
6581
|
+
input: unknown()
|
|
6582
|
+
}), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
|
|
6583
|
+
//#endregion
|
|
6584
|
+
//#region ../types/dist/err-msg-IQTHeDzc.mjs
|
|
6585
|
+
/**
|
|
6586
|
+
import { errMsg } from '@camstack/types'
|
|
6587
|
+
* Extract a human-readable message from an unknown error value.
|
|
6588
|
+
* Replaces the ubiquitous `errMsg(err)` pattern.
|
|
6589
|
+
*/
|
|
6590
|
+
function errMsg(err) {
|
|
6591
|
+
if (err instanceof Error) return err.message;
|
|
6592
|
+
if (typeof err === "string") return err;
|
|
6593
|
+
return String(err);
|
|
6594
|
+
}
|
|
6595
|
+
//#endregion
|
|
6596
|
+
//#region ../types/dist/index.mjs
|
|
6597
|
+
/**
|
|
6598
|
+
* Deep wiring healthcheck — snapshot of active reachability probes across
|
|
6599
|
+
* every declared capability + widget of every installed plugin, on every
|
|
6600
|
+
* node. Produced by the backend `WiringHealthService` and surfaced via
|
|
6601
|
+
* `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
|
|
6602
|
+
*
|
|
6603
|
+
* Unlike `/health` (process liveness), this reflects whether each cap/widget
|
|
6604
|
+
* is actually *reachable* over the real cap-dispatch path. See spec
|
|
6605
|
+
* `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
|
|
6606
|
+
*/
|
|
6607
|
+
/** What kind of target a probe addressed. */
|
|
6608
|
+
var wiringProbeKindSchema = _enum([
|
|
6609
|
+
"singleton",
|
|
6610
|
+
"device",
|
|
6611
|
+
"widget"
|
|
6612
|
+
]);
|
|
6613
|
+
/** Result of probing a single (cap|widget [, device]) target. */
|
|
6614
|
+
var wiringProbeResultSchema = object({
|
|
6615
|
+
capName: string(),
|
|
6616
|
+
kind: wiringProbeKindSchema,
|
|
6617
|
+
deviceId: number().optional(),
|
|
6618
|
+
reachable: boolean(),
|
|
6619
|
+
latencyMs: number(),
|
|
6620
|
+
error: string().optional()
|
|
6621
|
+
});
|
|
6622
|
+
/** Per-addon roll-up of cap + widget probe results. */
|
|
6623
|
+
var wiringAddonHealthSchema = object({
|
|
6624
|
+
addonId: string(),
|
|
6625
|
+
caps: array(wiringProbeResultSchema).readonly(),
|
|
6626
|
+
widgets: array(wiringProbeResultSchema).readonly()
|
|
6627
|
+
});
|
|
6628
|
+
/** Per-node roll-up. */
|
|
6629
|
+
var wiringNodeHealthSchema = object({
|
|
6630
|
+
nodeId: string(),
|
|
6631
|
+
addons: array(wiringAddonHealthSchema).readonly()
|
|
6632
|
+
});
|
|
6633
|
+
object({
|
|
6634
|
+
/** True only when every probed target is reachable. */
|
|
6635
|
+
ok: boolean(),
|
|
6636
|
+
/** True when at least one target is unreachable. */
|
|
6637
|
+
degraded: boolean(),
|
|
6638
|
+
checkedAt: string(),
|
|
6639
|
+
nodes: array(wiringNodeHealthSchema).readonly(),
|
|
6640
|
+
summary: object({
|
|
6641
|
+
total: number(),
|
|
6642
|
+
reachable: number(),
|
|
6643
|
+
unreachable: number()
|
|
6644
|
+
})
|
|
6645
|
+
});
|
|
6646
|
+
var MODEL_FORMATS = [
|
|
6647
|
+
"onnx",
|
|
6648
|
+
"coreml",
|
|
6649
|
+
"openvino",
|
|
6650
|
+
"tflite",
|
|
6651
|
+
"pt"
|
|
6652
|
+
];
|
|
6653
|
+
/**
|
|
6654
|
+
* Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
|
|
6655
|
+
* Named `RecordingWeekday` to avoid collision with the string-union
|
|
6656
|
+
* `Weekday` exported from `interfaces/timezones.ts`.
|
|
6657
|
+
*/
|
|
6658
|
+
var RecordingWeekdaySchema = number().int().min(0).max(6);
|
|
6659
|
+
var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
|
|
6660
|
+
var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
|
|
6661
|
+
kind: literal("timeOfDay"),
|
|
6662
|
+
start: string().regex(HHMM),
|
|
6663
|
+
end: string().regex(HHMM),
|
|
6664
|
+
/** Restrict to these weekdays; omit = every day. */
|
|
6665
|
+
days: array(RecordingWeekdaySchema).optional()
|
|
6666
|
+
})]);
|
|
6667
|
+
var RecordingModeSchema = _enum([
|
|
6668
|
+
"continuous",
|
|
6669
|
+
"onMotion",
|
|
6670
|
+
"onAudioThreshold"
|
|
6671
|
+
]);
|
|
6672
|
+
/**
|
|
6673
|
+
* First-class, authoritative per-camera storage mode — the netta choice the UI
|
|
6674
|
+
* reads directly (never inferred from `rules`):
|
|
6675
|
+
* - `off` — not recording.
|
|
6676
|
+
* - `events` — record only around triggers (motion / audio threshold),
|
|
6677
|
+
* with pre/post-buffer.
|
|
6678
|
+
* - `continuous` — record 24/7 within the schedule.
|
|
6679
|
+
*
|
|
6680
|
+
* `mode` compiles one-way to the internal `rules[]` consumed by the policy
|
|
6681
|
+
* engine (see `compileRules`); `rules[]` is never authored directly anymore.
|
|
6682
|
+
*/
|
|
6683
|
+
var RecordingStorageModeSchema = _enum([
|
|
6684
|
+
"off",
|
|
6685
|
+
"events",
|
|
6686
|
+
"continuous"
|
|
6687
|
+
]);
|
|
6688
|
+
/** Which detectors trigger an `events`-mode recording. */
|
|
6689
|
+
var RecordingTriggersSchema = object({
|
|
6690
|
+
motion: boolean().optional(),
|
|
6691
|
+
audioThresholdDbfs: number().optional()
|
|
6692
|
+
});
|
|
6693
|
+
/**
|
|
6694
|
+
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
6695
|
+
*
|
|
6696
|
+
* Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
|
|
6697
|
+
* only ever `continuous` or `events`; "off" is expressed by the absence of a
|
|
6698
|
+
* covering band, not by a band value.
|
|
6699
|
+
*/
|
|
6700
|
+
var RecordingBandModeSchema = _enum(["continuous", "events"]);
|
|
6701
|
+
/**
|
|
6702
|
+
* Triggers for an `events`-mode band. Identical shape to
|
|
6703
|
+
* `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
|
|
6704
|
+
* two never drift.
|
|
6705
|
+
*/
|
|
6706
|
+
var RecordingBandTriggersSchema = RecordingTriggersSchema;
|
|
6707
|
+
/**
|
|
6708
|
+
* A single mode-per-band window — the canonical recorder band shape, the
|
|
6709
|
+
* single source of truth re-used by `addon-pipeline/recorder`.
|
|
6710
|
+
*
|
|
6711
|
+
* `days` lists the weekdays the band covers (empty = every day, matching the
|
|
6712
|
+
* band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
|
|
6713
|
+
* span wraps past midnight (handled by the band engine).
|
|
6714
|
+
*/
|
|
6715
|
+
var RecordingBandSchema = object({
|
|
6716
|
+
days: array(RecordingWeekdaySchema),
|
|
6717
|
+
start: string().regex(HHMM),
|
|
6718
|
+
end: string().regex(HHMM),
|
|
6719
|
+
mode: RecordingBandModeSchema,
|
|
6720
|
+
triggers: RecordingBandTriggersSchema.optional(),
|
|
6721
|
+
preBufferSec: number().min(0).optional(),
|
|
6722
|
+
postBufferSec: number().min(0).optional()
|
|
6723
|
+
});
|
|
6724
|
+
var RecordingRuleSchema = object({
|
|
6725
|
+
schedule: RecordingScheduleSchema,
|
|
6726
|
+
mode: RecordingModeSchema,
|
|
6727
|
+
/** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
|
|
6728
|
+
preBufferSec: number().min(0).default(0),
|
|
6729
|
+
/** Keep recording until this many seconds after the last trigger. */
|
|
6730
|
+
postBufferSec: number().min(0).default(0),
|
|
6731
|
+
/** Each new trigger restarts the post-buffer window. */
|
|
6732
|
+
resetTimeoutOnNewEvent: boolean().default(true),
|
|
6733
|
+
/** onAudioThreshold only — dBFS level that counts as a trigger. */
|
|
6734
|
+
thresholdDbfs: number().optional()
|
|
6735
|
+
});
|
|
6736
|
+
/**
|
|
6737
|
+
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
6738
|
+
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
6739
|
+
* live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
|
|
6740
|
+
* (when the volume is too full to keep recording) is NOT a per-camera concern —
|
|
6741
|
+
* it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
|
|
6742
|
+
* shared by every camera writing to that volume.
|
|
6743
|
+
*/
|
|
6744
|
+
var RecordingRetentionSchema = object({
|
|
6745
|
+
maxAgeDays: number().min(0).optional(),
|
|
6746
|
+
maxSizeGb: number().min(0).optional()
|
|
6747
|
+
});
|
|
6748
|
+
/**
|
|
6749
|
+
* The full per-camera recording intent — the wire shape of a RecordingTarget.
|
|
6750
|
+
*
|
|
6751
|
+
* `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
|
|
6752
|
+
* are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
|
|
6753
|
+
* only for transition + migration (`migrateRulesToMode`); the policy engine
|
|
6754
|
+
* consumes the compiled output of `compileRules(config)`, never `rules` directly.
|
|
6755
|
+
*/
|
|
6756
|
+
var RecordingConfigSchema = object({
|
|
6757
|
+
enabled: boolean(),
|
|
6758
|
+
/** Authoritative storage mode. Absent on legacy targets → derived once via
|
|
6759
|
+
* `migrateRulesToMode`, then persisted. */
|
|
6760
|
+
mode: RecordingStorageModeSchema.optional(),
|
|
6761
|
+
profiles: array(CamProfileSchema).optional(),
|
|
6762
|
+
segmentSeconds: number().int().positive().optional(),
|
|
6763
|
+
/** Shared recording time-bands for `events` & `continuous` — record only when
|
|
6764
|
+
* the wall-clock falls inside one of these windows. Omit or empty = always.
|
|
6765
|
+
* `continuous` compiles to one rule per band; `events` to band × trigger. */
|
|
6766
|
+
schedules: array(RecordingScheduleSchema).optional(),
|
|
6767
|
+
/** Legacy single-band predecessor of `schedules`. Read-compat only — it is
|
|
6768
|
+
* normalized into `schedules` on read and never written going forward. (Not
|
|
6769
|
+
* tagged `@deprecated`: the normalization paths must read it cast-free.) */
|
|
6770
|
+
schedule: RecordingScheduleSchema.optional(),
|
|
6771
|
+
/** `events`-mode only — which detectors trigger a recording. */
|
|
6772
|
+
triggers: RecordingTriggersSchema.optional(),
|
|
6773
|
+
/** `events`-mode only — seconds retained before / after a trigger. */
|
|
6774
|
+
preBufferSec: number().min(0).optional(),
|
|
6775
|
+
postBufferSec: number().min(0).optional(),
|
|
6776
|
+
/** DEPRECATED authoring input; retained for migration/transition. */
|
|
6777
|
+
rules: array(RecordingRuleSchema).optional(),
|
|
6778
|
+
/**
|
|
6779
|
+
* AUTHORITATIVE mode-per-band recording model (recorder). When present it
|
|
6780
|
+
* is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
|
|
6781
|
+
* `triggers`/`rules` fields above are kept for READ-COMPAT only and are
|
|
6782
|
+
* derived into bands once via `migrateConfigToBands`.
|
|
6783
|
+
*/
|
|
6784
|
+
bands: array(RecordingBandSchema).optional(),
|
|
6785
|
+
retention: RecordingRetentionSchema.optional()
|
|
6786
|
+
});
|
|
6787
|
+
/**
|
|
6788
|
+
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
6789
|
+
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
6790
|
+
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
6791
|
+
* without forming a circular import. The `storage` cap re-exports it
|
|
6792
|
+
* verbatim for back-compat.
|
|
6793
|
+
*
|
|
6794
|
+
* This Zod schema is the **authoritative source** for `StorageLocationType`.
|
|
6795
|
+
* The TS alias in `./storage.ts` re-exports `z.infer<typeof
|
|
6796
|
+
* StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
|
|
6797
|
+
* `IStorageProvider` interface stay in lockstep.
|
|
6798
|
+
*
|
|
6799
|
+
* The type is now an **open string** (not a closed enum) — addons declare
|
|
6800
|
+
* their own location kinds via `StorageLocationDeclaration.id`. The regex
|
|
6801
|
+
* enforces a safe id format: lowercase-start, alphanumeric + hyphens.
|
|
6802
|
+
*/
|
|
6803
|
+
var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
6804
|
+
/**
|
|
6805
|
+
* Persisted record for a storage location instance. Operators can register
|
|
6806
|
+
* multiple instances for multi-cardinality types (e.g. two `backups`
|
|
6807
|
+
* locations with different `providerId`s). Cardinality is now declared per
|
|
6808
|
+
* location via `StorageLocationDeclaration.cardinality` — the static
|
|
6809
|
+
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
6810
|
+
*
|
|
6811
|
+
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
6812
|
+
* The default location for a type uses `id === <type>:default` by
|
|
6813
|
+
* convention (the bare type ref like `'backups'` resolves to it).
|
|
6814
|
+
*
|
|
6815
|
+
* `isSystem: true` marks a location as orchestrator-seeded and
|
|
6816
|
+
* undeletable. The bootstrap-installed defaults (one per type) carry
|
|
6817
|
+
* this flag; operator-added locations don't. Editing the config of
|
|
6818
|
+
* a system location is allowed (path migration, provider swap) but
|
|
6819
|
+
* deleting it is rejected at the cap level.
|
|
6820
|
+
*/
|
|
6821
|
+
var StorageLocationSchema = object({
|
|
6822
|
+
id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
|
|
6823
|
+
type: string(),
|
|
6824
|
+
displayName: string().min(1),
|
|
6825
|
+
providerId: string().min(1),
|
|
6826
|
+
config: record(string(), unknown()),
|
|
6827
|
+
/**
|
|
6828
|
+
* Cluster node this location physically lives on. REQUIRED for node-local
|
|
6829
|
+
* providers (filesystem — the path exists on one node's disk), null/absent
|
|
6830
|
+
* for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
|
|
6831
|
+
* `'hub'` is the hub node. Validated against the provider's `nodeLocal`
|
|
6832
|
+
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
6833
|
+
*/
|
|
6834
|
+
nodeId: string().optional(),
|
|
6835
|
+
isDefault: boolean().default(false),
|
|
6836
|
+
isSystem: boolean().default(false),
|
|
6837
|
+
createdAt: number(),
|
|
6838
|
+
updatedAt: number()
|
|
6839
|
+
});
|
|
6840
|
+
/**
|
|
6841
|
+
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
6842
|
+
* Either:
|
|
6843
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
|
|
6844
|
+
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
6845
|
+
*
|
|
6846
|
+
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
6847
|
+
*/
|
|
6848
|
+
var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
|
|
6849
|
+
/**
|
|
6850
|
+
* `StorageLocationDeclaration` — a single storage-location entry declared by
|
|
6851
|
+
* an addon in its `package.json` under `camstack.storageLocations`.
|
|
6852
|
+
*
|
|
6853
|
+
* Design intent:
|
|
6854
|
+
* - **Addon declares its needs** — each addon describes the logical storage
|
|
6855
|
+
* slots it requires (e.g. `recordings`, `recordingsLow`) without caring
|
|
6856
|
+
* about the physical path.
|
|
6857
|
+
* - **Kernel aggregates** — at boot the kernel collects declarations from all
|
|
6858
|
+
* installed addons, deduplicates by `id`, and exposes the union via the
|
|
6859
|
+
* storage-locations settings surface.
|
|
6860
|
+
* - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
|
|
6861
|
+
* at least one instance named `<id>:default` is present, using
|
|
6862
|
+
* `defaultsTo` to inherit the resolved root from another location when the
|
|
6863
|
+
* declaration is a derivative slot (e.g. `recordingsLow` defaults to
|
|
6864
|
+
* `recordings`).
|
|
6865
|
+
* - **ids are global** — `id` values are shared across the entire deployment;
|
|
6866
|
+
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
6867
|
+
* at kernel aggregation time, not here).
|
|
6868
|
+
*/
|
|
6869
|
+
var StorageLocationDeclarationSchema = object({
|
|
6870
|
+
/**
|
|
6871
|
+
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
6872
|
+
* Must start with a lowercase letter and may contain letters, digits, and
|
|
6873
|
+
* hyphens.
|
|
6874
|
+
*/
|
|
6875
|
+
id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
|
|
6876
|
+
/** Human-readable name shown in the admin UI. */
|
|
6877
|
+
displayName: string().min(1, { message: "displayName must not be empty" }),
|
|
6878
|
+
/** Optional longer explanation of what data this location stores. */
|
|
6879
|
+
description: string().optional(),
|
|
6880
|
+
/**
|
|
6881
|
+
* `single` — exactly one instance of this location is allowed system-wide
|
|
6882
|
+
* (e.g. `logs`, `models`). The operator can edit it but not add more.
|
|
6883
|
+
* `multi` — the operator may register several instances (e.g. a second
|
|
6884
|
+
* `recordings` on a NAS for disk tiering); one is the default at any time.
|
|
6885
|
+
*/
|
|
6886
|
+
cardinality: _enum(["single", "multi"]),
|
|
6887
|
+
/**
|
|
6888
|
+
* When set, the default instance for this location inherits its resolved
|
|
6889
|
+
* root from the named location's default instance. Useful for derivative
|
|
6890
|
+
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
6891
|
+
* configure the primary location.
|
|
6892
|
+
*/
|
|
6893
|
+
defaultsTo: string().optional()
|
|
6894
|
+
});
|
|
6895
|
+
var DecoderStatsSchema = object({
|
|
6896
|
+
inputFps: number(),
|
|
6897
|
+
outputFps: number(),
|
|
6898
|
+
avgDecodeTimeMs: number(),
|
|
6899
|
+
droppedFrames: number()
|
|
6900
|
+
});
|
|
6901
|
+
var DecoderSessionConfigSchema = object({
|
|
6902
|
+
codec: string(),
|
|
6903
|
+
maxFps: number().default(0),
|
|
6904
|
+
outputFormat: _enum([
|
|
6905
|
+
"jpeg",
|
|
6906
|
+
"rgb",
|
|
6907
|
+
"bgr",
|
|
6908
|
+
"yuv420",
|
|
6909
|
+
"gray"
|
|
6910
|
+
]).default("jpeg"),
|
|
6911
|
+
scale: number().default(1),
|
|
6912
|
+
width: number().optional(),
|
|
6913
|
+
height: number().optional(),
|
|
6928
6914
|
/**
|
|
6929
|
-
*
|
|
6930
|
-
*
|
|
6931
|
-
*
|
|
6915
|
+
* Identifier of the camera this decoder session serves. Optional
|
|
6916
|
+
* because the cap is generic (any caller could request decode), but
|
|
6917
|
+
* stream-broker passes it so decoder logs include `deviceId` for
|
|
6918
|
+
* per-camera filtering when diagnosing failures (e.g. node-av
|
|
6919
|
+
* sendPacket errors on a single hung camera).
|
|
6932
6920
|
*/
|
|
6933
|
-
|
|
6934
|
-
DeviceFeature["NativeSnapshot"] = "native-snapshot";
|
|
6935
|
-
DeviceFeature["DoorbellButton"] = "doorbell-button";
|
|
6936
|
-
DeviceFeature["TwoWayAudio"] = "two-way-audio";
|
|
6937
|
-
DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
|
|
6921
|
+
deviceId: number().int().nonnegative().optional(),
|
|
6938
6922
|
/**
|
|
6939
|
-
*
|
|
6940
|
-
*
|
|
6941
|
-
*
|
|
6942
|
-
*
|
|
6943
|
-
* the cap registry. Mirrors `ptz-autotrack` cap registration:
|
|
6944
|
-
* driver sets this feature when probe confirms the firmware
|
|
6945
|
-
* surface, and registers the cap in the same code path.
|
|
6923
|
+
* Free-form tag for log scoping. Stream-broker uses
|
|
6924
|
+
* `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
|
|
6925
|
+
* on every line so `grep tag=broker:5/high` filters one camera
|
|
6926
|
+
* profile cleanly.
|
|
6946
6927
|
*/
|
|
6947
|
-
|
|
6928
|
+
tag: string().optional(),
|
|
6948
6929
|
/**
|
|
6949
|
-
*
|
|
6950
|
-
* motion detection automatically activates this device. Mirrors
|
|
6951
|
-
* `motion-trigger` cap registration: drivers set this feature in the
|
|
6952
|
-
* same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
|
|
6930
|
+
* Where the session delivers decoded frames (Phase 5 / D9):
|
|
6953
6931
|
*
|
|
6954
|
-
*
|
|
6955
|
-
*
|
|
6956
|
-
*
|
|
6932
|
+
* - `'callback'` (default) — the legacy pixel path: decoded frames are
|
|
6933
|
+
* buffered as `DecodedFrame`s and drained via `pullFrames`.
|
|
6934
|
+
* - `'shm'` — the shared-memory frame plane: decoded frames are written
|
|
6935
|
+
* into an OS shared-memory ring and drained as zero-pixel
|
|
6936
|
+
* `FrameHandle`s via `pullHandles`. A session is one mode or the
|
|
6937
|
+
* other — `pullFrames` returns nothing for an `'shm'` session and
|
|
6938
|
+
* `pullHandles` returns nothing for a `'callback'` session.
|
|
6957
6939
|
*/
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
/**
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
|
|
7066
|
-
|
|
7067
|
-
|
|
7068
|
-
|
|
7069
|
-
|
|
7070
|
-
|
|
7071
|
-
|
|
7072
|
-
|
|
7073
|
-
|
|
7074
|
-
|
|
7075
|
-
|
|
7076
|
-
|
|
7077
|
-
|
|
7078
|
-
|
|
7079
|
-
|
|
7080
|
-
|
|
7081
|
-
|
|
7082
|
-
|
|
7083
|
-
|
|
7084
|
-
|
|
7085
|
-
|
|
7086
|
-
|
|
7087
|
-
|
|
7088
|
-
|
|
7089
|
-
|
|
7090
|
-
|
|
7091
|
-
|
|
7092
|
-
|
|
7093
|
-
|
|
7094
|
-
|
|
7095
|
-
|
|
7096
|
-
|
|
7097
|
-
|
|
7098
|
-
|
|
7099
|
-
|
|
7100
|
-
|
|
7101
|
-
|
|
7102
|
-
|
|
7103
|
-
|
|
7104
|
-
|
|
7105
|
-
|
|
7106
|
-
|
|
7107
|
-
|
|
7108
|
-
|
|
7109
|
-
|
|
7110
|
-
|
|
7111
|
-
|
|
7112
|
-
|
|
7113
|
-
|
|
7114
|
-
|
|
7115
|
-
|
|
7116
|
-
|
|
7117
|
-
|
|
7118
|
-
|
|
7119
|
-
|
|
7120
|
-
|
|
6940
|
+
frameSink: _enum(["callback", "shm"]).default("callback")
|
|
6941
|
+
});
|
|
6942
|
+
var EncodeProfileSchema = object({
|
|
6943
|
+
video: object({
|
|
6944
|
+
codec: _enum([
|
|
6945
|
+
"h264",
|
|
6946
|
+
"h265",
|
|
6947
|
+
"copy"
|
|
6948
|
+
]),
|
|
6949
|
+
profile: _enum([
|
|
6950
|
+
"baseline",
|
|
6951
|
+
"main",
|
|
6952
|
+
"high"
|
|
6953
|
+
]).optional(),
|
|
6954
|
+
width: number().int().positive().optional(),
|
|
6955
|
+
height: number().int().positive().optional(),
|
|
6956
|
+
fps: number().positive().optional(),
|
|
6957
|
+
bitrateKbps: number().int().positive().optional(),
|
|
6958
|
+
gopFrames: number().int().positive().optional(),
|
|
6959
|
+
bf: number().int().min(0).optional(),
|
|
6960
|
+
preset: _enum([
|
|
6961
|
+
"ultrafast",
|
|
6962
|
+
"superfast",
|
|
6963
|
+
"veryfast",
|
|
6964
|
+
"faster",
|
|
6965
|
+
"fast",
|
|
6966
|
+
"medium"
|
|
6967
|
+
]).optional(),
|
|
6968
|
+
tune: _enum([
|
|
6969
|
+
"zerolatency",
|
|
6970
|
+
"film",
|
|
6971
|
+
"animation"
|
|
6972
|
+
]).optional()
|
|
6973
|
+
}),
|
|
6974
|
+
audio: union([literal("passthrough"), object({
|
|
6975
|
+
codec: _enum([
|
|
6976
|
+
"opus",
|
|
6977
|
+
"aac",
|
|
6978
|
+
"pcmu",
|
|
6979
|
+
"pcma",
|
|
6980
|
+
"copy"
|
|
6981
|
+
]),
|
|
6982
|
+
bitrateKbps: number().int().positive().optional(),
|
|
6983
|
+
sampleRateHz: number().int().positive().optional(),
|
|
6984
|
+
channels: union([literal(1), literal(2)]).optional()
|
|
6985
|
+
})]),
|
|
6986
|
+
/**
|
|
6987
|
+
* ffmpeg input-side args, inserted between the fixed global flags
|
|
6988
|
+
* (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
|
|
6989
|
+
* — the widget surfaces a textarea + suggestion chips for the most-
|
|
6990
|
+
* used demuxer/format options.
|
|
6991
|
+
*/
|
|
6992
|
+
inputArgs: array(string()).optional(),
|
|
6993
|
+
/**
|
|
6994
|
+
* ffmpeg output-side args, inserted between the encode block and
|
|
6995
|
+
* the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
|
|
6996
|
+
* filters, codec-specific overrides. Free-text array.
|
|
6997
|
+
*/
|
|
6998
|
+
outputArgs: array(string()).optional()
|
|
6999
|
+
});
|
|
7000
|
+
var YAMNET_TO_MACRO = {
|
|
7001
|
+
mapping: {
|
|
7002
|
+
Speech: "speech",
|
|
7003
|
+
"Child speech, kid speaking": "speech",
|
|
7004
|
+
Conversation: "speech",
|
|
7005
|
+
"Narration, monologue": "speech",
|
|
7006
|
+
Babbling: "speech",
|
|
7007
|
+
Whispering: "speech",
|
|
7008
|
+
"Speech synthesizer": "speech",
|
|
7009
|
+
Humming: "speech",
|
|
7010
|
+
Rapping: "speech",
|
|
7011
|
+
Singing: "speech",
|
|
7012
|
+
Choir: "speech",
|
|
7013
|
+
"Child singing": "speech",
|
|
7014
|
+
Shout: "scream",
|
|
7015
|
+
Bellow: "scream",
|
|
7016
|
+
Yell: "scream",
|
|
7017
|
+
Screaming: "scream",
|
|
7018
|
+
"Children shouting": "scream",
|
|
7019
|
+
Whoop: "scream",
|
|
7020
|
+
"Crying, sobbing": "crying",
|
|
7021
|
+
"Baby cry, infant cry": "crying",
|
|
7022
|
+
Whimper: "crying",
|
|
7023
|
+
"Wail, moan": "crying",
|
|
7024
|
+
Groan: "crying",
|
|
7025
|
+
Laughter: "laughter",
|
|
7026
|
+
"Baby laughter": "laughter",
|
|
7027
|
+
Giggle: "laughter",
|
|
7028
|
+
Snicker: "laughter",
|
|
7029
|
+
"Belly laugh": "laughter",
|
|
7030
|
+
"Chuckle, chortle": "laughter",
|
|
7031
|
+
Music: "music",
|
|
7032
|
+
"Musical instrument": "music",
|
|
7033
|
+
Guitar: "music",
|
|
7034
|
+
Piano: "music",
|
|
7035
|
+
Drum: "music",
|
|
7036
|
+
"Drum kit": "music",
|
|
7037
|
+
"Violin, fiddle": "music",
|
|
7038
|
+
Flute: "music",
|
|
7039
|
+
Saxophone: "music",
|
|
7040
|
+
Trumpet: "music",
|
|
7041
|
+
Synthesizer: "music",
|
|
7042
|
+
"Pop music": "music",
|
|
7043
|
+
"Rock music": "music",
|
|
7044
|
+
"Hip hop music": "music",
|
|
7045
|
+
"Classical music": "music",
|
|
7046
|
+
Jazz: "music",
|
|
7047
|
+
"Electronic music": "music",
|
|
7048
|
+
"Background music": "music",
|
|
7049
|
+
Dog: "dog",
|
|
7050
|
+
Bark: "dog",
|
|
7051
|
+
Yip: "dog",
|
|
7052
|
+
Howl: "dog",
|
|
7053
|
+
"Bow-wow": "dog",
|
|
7054
|
+
Growling: "dog",
|
|
7055
|
+
"Whimper (dog)": "dog",
|
|
7056
|
+
Cat: "cat",
|
|
7057
|
+
Purr: "cat",
|
|
7058
|
+
Meow: "cat",
|
|
7059
|
+
Hiss: "cat",
|
|
7060
|
+
Caterwaul: "cat",
|
|
7061
|
+
Bird: "bird",
|
|
7062
|
+
"Bird vocalization, bird call, bird song": "bird",
|
|
7063
|
+
"Chirp, tweet": "bird",
|
|
7064
|
+
Squawk: "bird",
|
|
7065
|
+
Crow: "bird",
|
|
7066
|
+
Owl: "bird",
|
|
7067
|
+
"Pigeon, dove": "bird",
|
|
7068
|
+
Animal: "animal",
|
|
7069
|
+
"Domestic animals, pets": "animal",
|
|
7070
|
+
"Livestock, farm animals, working animals": "animal",
|
|
7071
|
+
Horse: "animal",
|
|
7072
|
+
"Cattle, bovinae": "animal",
|
|
7073
|
+
Pig: "animal",
|
|
7074
|
+
Sheep: "animal",
|
|
7075
|
+
Goat: "animal",
|
|
7076
|
+
Frog: "animal",
|
|
7077
|
+
Insect: "animal",
|
|
7078
|
+
Cricket: "animal",
|
|
7079
|
+
Alarm: "alarm",
|
|
7080
|
+
"Alarm clock": "alarm",
|
|
7081
|
+
"Smoke detector, smoke alarm": "alarm",
|
|
7082
|
+
"Fire alarm": "alarm",
|
|
7083
|
+
Buzzer: "alarm",
|
|
7084
|
+
"Civil defense siren": "alarm",
|
|
7085
|
+
"Car alarm": "alarm",
|
|
7086
|
+
Siren: "siren",
|
|
7087
|
+
"Police car (siren)": "siren",
|
|
7088
|
+
"Ambulance (siren)": "siren",
|
|
7089
|
+
"Fire engine, fire truck (siren)": "siren",
|
|
7090
|
+
"Emergency vehicle": "siren",
|
|
7091
|
+
Foghorn: "siren",
|
|
7092
|
+
Doorbell: "doorbell",
|
|
7093
|
+
"Ding-dong": "doorbell",
|
|
7094
|
+
Knock: "doorbell",
|
|
7095
|
+
Tap: "doorbell",
|
|
7096
|
+
Glass: "glass_breaking",
|
|
7097
|
+
Shatter: "glass_breaking",
|
|
7098
|
+
"Chink, clink": "glass_breaking",
|
|
7099
|
+
"Gunshot, gunfire": "gunshot",
|
|
7100
|
+
"Machine gun": "gunshot",
|
|
7101
|
+
Explosion: "gunshot",
|
|
7102
|
+
Fireworks: "gunshot",
|
|
7103
|
+
Firecracker: "gunshot",
|
|
7104
|
+
"Artillery fire": "gunshot",
|
|
7105
|
+
"Cap gun": "gunshot",
|
|
7106
|
+
Boom: "gunshot",
|
|
7107
|
+
Vehicle: "vehicle",
|
|
7108
|
+
Car: "vehicle",
|
|
7109
|
+
Truck: "vehicle",
|
|
7110
|
+
Bus: "vehicle",
|
|
7111
|
+
Motorcycle: "vehicle",
|
|
7112
|
+
"Car passing by": "vehicle",
|
|
7113
|
+
"Vehicle horn, car horn, honking": "vehicle",
|
|
7114
|
+
"Traffic noise, roadway noise": "vehicle",
|
|
7115
|
+
Train: "vehicle",
|
|
7116
|
+
Aircraft: "vehicle",
|
|
7117
|
+
Helicopter: "vehicle",
|
|
7118
|
+
Bicycle: "vehicle",
|
|
7119
|
+
Skateboard: "vehicle",
|
|
7120
|
+
Fire: "fire",
|
|
7121
|
+
Crackle: "fire",
|
|
7122
|
+
Water: "water",
|
|
7123
|
+
Rain: "water",
|
|
7124
|
+
Raindrop: "water",
|
|
7125
|
+
"Rain on surface": "water",
|
|
7126
|
+
Stream: "water",
|
|
7127
|
+
Waterfall: "water",
|
|
7128
|
+
Ocean: "water",
|
|
7129
|
+
"Waves, surf": "water",
|
|
7130
|
+
"Splash, splatter": "water",
|
|
7131
|
+
Wind: "wind",
|
|
7132
|
+
Thunderstorm: "wind",
|
|
7133
|
+
Thunder: "wind",
|
|
7134
|
+
"Wind noise (microphone)": "wind",
|
|
7135
|
+
"Rustling leaves": "wind",
|
|
7136
|
+
Door: "door",
|
|
7137
|
+
"Sliding door": "door",
|
|
7138
|
+
Slam: "door",
|
|
7139
|
+
"Cupboard open or close": "door",
|
|
7140
|
+
"Walk, footsteps": "footsteps",
|
|
7141
|
+
Run: "footsteps",
|
|
7142
|
+
Shuffle: "footsteps",
|
|
7143
|
+
Crowd: "crowd",
|
|
7144
|
+
Chatter: "crowd",
|
|
7145
|
+
Cheering: "crowd",
|
|
7146
|
+
Applause: "crowd",
|
|
7147
|
+
"Children playing": "crowd",
|
|
7148
|
+
"Hubbub, speech noise, speech babble": "crowd",
|
|
7149
|
+
Telephone: "telephone",
|
|
7150
|
+
"Telephone bell ringing": "telephone",
|
|
7151
|
+
Ringtone: "telephone",
|
|
7152
|
+
"Telephone dialing, DTMF": "telephone",
|
|
7153
|
+
"Busy signal": "telephone",
|
|
7154
|
+
Engine: "engine",
|
|
7155
|
+
"Engine starting": "engine",
|
|
7156
|
+
Idling: "engine",
|
|
7157
|
+
"Accelerating, revving, vroom": "engine",
|
|
7158
|
+
"Light engine (high frequency)": "engine",
|
|
7159
|
+
"Medium engine (mid frequency)": "engine",
|
|
7160
|
+
"Heavy engine (low frequency)": "engine",
|
|
7161
|
+
"Lawn mower": "engine",
|
|
7162
|
+
Chainsaw: "engine",
|
|
7163
|
+
Hammer: "tools",
|
|
7164
|
+
Jackhammer: "tools",
|
|
7165
|
+
Sawing: "tools",
|
|
7166
|
+
"Power tool": "tools",
|
|
7167
|
+
Drill: "tools",
|
|
7168
|
+
Sanding: "tools",
|
|
7169
|
+
Silence: "silence"
|
|
7170
|
+
},
|
|
7171
|
+
preserveOriginal: false
|
|
7172
|
+
};
|
|
7173
|
+
var APPLE_SA_TO_MACRO = {
|
|
7174
|
+
mapping: {
|
|
7175
|
+
speech: "speech",
|
|
7176
|
+
child_speech: "speech",
|
|
7177
|
+
conversation: "speech",
|
|
7178
|
+
whispering: "speech",
|
|
7179
|
+
singing: "speech",
|
|
7180
|
+
humming: "speech",
|
|
7181
|
+
shout: "scream",
|
|
7182
|
+
yell: "scream",
|
|
7183
|
+
screaming: "scream",
|
|
7184
|
+
crying: "crying",
|
|
7185
|
+
baby_crying: "crying",
|
|
7186
|
+
sobbing: "crying",
|
|
7187
|
+
laughter: "laughter",
|
|
7188
|
+
baby_laughter: "laughter",
|
|
7189
|
+
giggling: "laughter",
|
|
7190
|
+
music: "music",
|
|
7191
|
+
guitar: "music",
|
|
7192
|
+
piano: "music",
|
|
7193
|
+
drums: "music",
|
|
7194
|
+
dog_bark: "dog",
|
|
7195
|
+
dog_bow_wow: "dog",
|
|
7196
|
+
dog_growling: "dog",
|
|
7197
|
+
dog_howl: "dog",
|
|
7198
|
+
cat_meow: "cat",
|
|
7199
|
+
cat_purr: "cat",
|
|
7200
|
+
cat_hiss: "cat",
|
|
7201
|
+
bird: "bird",
|
|
7202
|
+
bird_chirp: "bird",
|
|
7203
|
+
bird_squawk: "bird",
|
|
7204
|
+
animal: "animal",
|
|
7205
|
+
horse: "animal",
|
|
7206
|
+
cow_moo: "animal",
|
|
7207
|
+
insect: "animal",
|
|
7208
|
+
alarm: "alarm",
|
|
7209
|
+
smoke_alarm: "alarm",
|
|
7210
|
+
fire_alarm: "alarm",
|
|
7211
|
+
car_alarm: "alarm",
|
|
7212
|
+
siren: "siren",
|
|
7213
|
+
police_siren: "siren",
|
|
7214
|
+
ambulance_siren: "siren",
|
|
7215
|
+
doorbell: "doorbell",
|
|
7216
|
+
door_knock: "doorbell",
|
|
7217
|
+
knocking: "doorbell",
|
|
7218
|
+
glass_breaking: "glass_breaking",
|
|
7219
|
+
glass_shatter: "glass_breaking",
|
|
7220
|
+
gunshot: "gunshot",
|
|
7221
|
+
explosion: "gunshot",
|
|
7222
|
+
fireworks: "gunshot",
|
|
7223
|
+
car: "vehicle",
|
|
7224
|
+
truck: "vehicle",
|
|
7225
|
+
motorcycle: "vehicle",
|
|
7226
|
+
car_horn: "vehicle",
|
|
7227
|
+
vehicle_horn: "vehicle",
|
|
7228
|
+
traffic: "vehicle",
|
|
7229
|
+
fire: "fire",
|
|
7230
|
+
fire_crackle: "fire",
|
|
7231
|
+
water: "water",
|
|
7232
|
+
rain: "water",
|
|
7233
|
+
ocean: "water",
|
|
7234
|
+
splash: "water",
|
|
7235
|
+
wind: "wind",
|
|
7236
|
+
thunder: "wind",
|
|
7237
|
+
thunderstorm: "wind",
|
|
7238
|
+
door: "door",
|
|
7239
|
+
door_slam: "door",
|
|
7240
|
+
sliding_door: "door",
|
|
7241
|
+
footsteps: "footsteps",
|
|
7242
|
+
walking: "footsteps",
|
|
7243
|
+
running: "footsteps",
|
|
7244
|
+
crowd: "crowd",
|
|
7245
|
+
chatter: "crowd",
|
|
7246
|
+
cheering: "crowd",
|
|
7247
|
+
applause: "crowd",
|
|
7248
|
+
telephone_ring: "telephone",
|
|
7249
|
+
ringtone: "telephone",
|
|
7250
|
+
engine: "engine",
|
|
7251
|
+
engine_starting: "engine",
|
|
7252
|
+
lawn_mower: "engine",
|
|
7253
|
+
chainsaw: "engine",
|
|
7254
|
+
hammer: "tools",
|
|
7255
|
+
jackhammer: "tools",
|
|
7256
|
+
drill: "tools",
|
|
7257
|
+
power_tool: "tools",
|
|
7258
|
+
silence: "silence"
|
|
7259
|
+
},
|
|
7260
|
+
preserveOriginal: false
|
|
7261
|
+
};
|
|
7262
|
+
var _macroLookup = /* @__PURE__ */ new Map();
|
|
7263
|
+
for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7264
|
+
for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7121
7265
|
/**
|
|
7122
7266
|
* Accessory device helpers — shared across drivers.
|
|
7123
7267
|
*
|
|
@@ -7381,74 +7525,6 @@ object({
|
|
|
7381
7525
|
});
|
|
7382
7526
|
DeviceType.Sensor;
|
|
7383
7527
|
/**
|
|
7384
|
-
* Generic types for capability definitions.
|
|
7385
|
-
*
|
|
7386
|
-
* A capability is defined with Zod schemas for methods, events, and settings.
|
|
7387
|
-
* TypeScript types are inferred via z.infer<> — zero duplication.
|
|
7388
|
-
*
|
|
7389
|
-
* Pattern:
|
|
7390
|
-
* 1. Define Zod schemas for data, methods, settings
|
|
7391
|
-
* 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
|
|
7392
|
-
* 3. Export type IProvider = InferProvider<typeof capabilityDef>
|
|
7393
|
-
* 4. Addon implements IProvider
|
|
7394
|
-
* 5. Registry auto-mounts tRPC router from definition.methods
|
|
7395
|
-
*/
|
|
7396
|
-
/**
|
|
7397
|
-
* Output schema shared by the contribution + live methods.
|
|
7398
|
-
*
|
|
7399
|
-
* Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
|
|
7400
|
-
* tabs[]) without importing from `../interfaces/config-ui.js` — a
|
|
7401
|
-
* concrete-but-lenient Zod object keeps tRPC output inference happy
|
|
7402
|
-
* (using `z.unknown()` here collapses unrelated router branches to
|
|
7403
|
-
* `unknown` when the generator re-inlines the huge AppRouter type).
|
|
7404
|
-
*
|
|
7405
|
-
* `.passthrough()` on sections/fields accepts whatever FormBuilder
|
|
7406
|
-
* extensions the caller adds (showWhen, displayScale, …) without
|
|
7407
|
-
* rebuilding every time a new field kind is introduced.
|
|
7408
|
-
*/
|
|
7409
|
-
var ContributionSectionSchema = object({
|
|
7410
|
-
id: string(),
|
|
7411
|
-
title: string(),
|
|
7412
|
-
description: string().optional(),
|
|
7413
|
-
style: _enum(["card", "accordion"]).optional(),
|
|
7414
|
-
defaultCollapsed: boolean().optional(),
|
|
7415
|
-
columns: union([
|
|
7416
|
-
literal(1),
|
|
7417
|
-
literal(2),
|
|
7418
|
-
literal(3),
|
|
7419
|
-
literal(4)
|
|
7420
|
-
]).optional(),
|
|
7421
|
-
tab: string().optional(),
|
|
7422
|
-
location: _enum(["settings", "top-tab"]).optional(),
|
|
7423
|
-
order: number().optional(),
|
|
7424
|
-
fields: array(any())
|
|
7425
|
-
});
|
|
7426
|
-
object({
|
|
7427
|
-
tabs: array(object({
|
|
7428
|
-
id: string(),
|
|
7429
|
-
label: string(),
|
|
7430
|
-
icon: string(),
|
|
7431
|
-
order: number().optional()
|
|
7432
|
-
})).optional(),
|
|
7433
|
-
sections: array(ContributionSectionSchema)
|
|
7434
|
-
}).nullable();
|
|
7435
|
-
object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
7436
|
-
deviceId: number(),
|
|
7437
|
-
patch: record(string(), unknown())
|
|
7438
|
-
}), object({ success: literal(true) });
|
|
7439
|
-
object({ deviceId: number() }), unknown().nullable();
|
|
7440
|
-
/** Shorthand to define a method schema */
|
|
7441
|
-
function method(input, output, options) {
|
|
7442
|
-
return {
|
|
7443
|
-
input,
|
|
7444
|
-
output,
|
|
7445
|
-
kind: options?.kind ?? "query",
|
|
7446
|
-
auth: options?.auth ?? "protected",
|
|
7447
|
-
...options?.access !== void 0 ? { access: options.access } : {},
|
|
7448
|
-
timeoutMs: options?.timeoutMs
|
|
7449
|
-
};
|
|
7450
|
-
}
|
|
7451
|
-
/**
|
|
7452
7528
|
* Alarm-panel cap. Models HA `alarm_control_panel.*` on
|
|
7453
7529
|
* `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
|
|
7454
7530
|
* across disarmed / armed_(home|away|night|vacation|custom_bypass) /
|
|
@@ -9263,6 +9339,24 @@ var DetectorOutputSchema = object({
|
|
|
9263
9339
|
inferenceMs: number(),
|
|
9264
9340
|
modelId: string()
|
|
9265
9341
|
});
|
|
9342
|
+
var EngineProvisioningSchema = object({
|
|
9343
|
+
runtimeId: _enum([
|
|
9344
|
+
"onnx",
|
|
9345
|
+
"openvino",
|
|
9346
|
+
"coreml"
|
|
9347
|
+
]).nullable(),
|
|
9348
|
+
device: string().nullable(),
|
|
9349
|
+
state: _enum([
|
|
9350
|
+
"idle",
|
|
9351
|
+
"installing",
|
|
9352
|
+
"verifying",
|
|
9353
|
+
"ready",
|
|
9354
|
+
"failed"
|
|
9355
|
+
]),
|
|
9356
|
+
progress: number().optional(),
|
|
9357
|
+
error: string().optional(),
|
|
9358
|
+
nextRetryAt: number().optional()
|
|
9359
|
+
});
|
|
9266
9360
|
var PipelineStepInputSchema = lazy(() => object({
|
|
9267
9361
|
addonId: string(),
|
|
9268
9362
|
modelId: string(),
|
|
@@ -9331,7 +9425,7 @@ var PipelineRunResultBridge = custom();
|
|
|
9331
9425
|
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(_void(), PipelineEngineChoiceSchema, {
|
|
9332
9426
|
kind: "mutation",
|
|
9333
9427
|
auth: "admin"
|
|
9334
|
-
}), method(_void(), record(string(), object({
|
|
9428
|
+
}), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
9335
9429
|
modelId: string(),
|
|
9336
9430
|
settings: record(string(), unknown()).readonly()
|
|
9337
9431
|
}))), method(object({ steps: record(string(), object({
|
|
@@ -11692,9 +11786,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
11692
11786
|
limit: number().optional(),
|
|
11693
11787
|
tags: record(string(), string()).optional()
|
|
11694
11788
|
}), array(LogEntrySchema).readonly());
|
|
11695
|
-
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
11696
|
-
var VersionOutputSchema = object({ version: string() });
|
|
11697
|
-
method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
|
|
11698
11789
|
/**
|
|
11699
11790
|
* Zod schemas for persisted record types.
|
|
11700
11791
|
*
|
|
@@ -13178,7 +13269,10 @@ var AgentAddonConfigSchema = object({
|
|
|
13178
13269
|
modelId: string(),
|
|
13179
13270
|
settings: record(string(), unknown()).readonly()
|
|
13180
13271
|
});
|
|
13181
|
-
var AgentPipelineSettingsSchema = object({
|
|
13272
|
+
var AgentPipelineSettingsSchema = object({
|
|
13273
|
+
addonDefaults: record(string(), AgentAddonConfigSchema).readonly(),
|
|
13274
|
+
maxCameras: number().int().nonnegative().nullable().default(null)
|
|
13275
|
+
});
|
|
13182
13276
|
var CameraPipelineForAgentSchema = object({
|
|
13183
13277
|
steps: array(PipelineStepInputSchema).readonly(),
|
|
13184
13278
|
audio: object({
|
|
@@ -13280,6 +13374,133 @@ var GlobalMetricsSchema = object({
|
|
|
13280
13374
|
* capability providers.
|
|
13281
13375
|
*/
|
|
13282
13376
|
var CapabilityBindingsSchema = record(string(), string());
|
|
13377
|
+
/** Source block — always present; derives from the stream catalog. */
|
|
13378
|
+
var CameraSourceStatusSchema = object({ streams: array(object({
|
|
13379
|
+
camStreamId: string(),
|
|
13380
|
+
codec: string(),
|
|
13381
|
+
width: number(),
|
|
13382
|
+
height: number(),
|
|
13383
|
+
fps: number(),
|
|
13384
|
+
kind: string()
|
|
13385
|
+
})).readonly() });
|
|
13386
|
+
/** Assignment block — always present (orchestrator-local, no remote call). */
|
|
13387
|
+
var CameraAssignmentStatusSchema = object({
|
|
13388
|
+
detectionNodeId: string().nullable(),
|
|
13389
|
+
decoderNodeId: string().nullable(),
|
|
13390
|
+
audioNodeId: string().nullable(),
|
|
13391
|
+
pinned: object({
|
|
13392
|
+
detection: boolean(),
|
|
13393
|
+
decoder: boolean(),
|
|
13394
|
+
audio: boolean()
|
|
13395
|
+
}),
|
|
13396
|
+
reasons: object({
|
|
13397
|
+
detection: string().optional(),
|
|
13398
|
+
decoder: string().optional(),
|
|
13399
|
+
audio: string().optional()
|
|
13400
|
+
})
|
|
13401
|
+
});
|
|
13402
|
+
/** Broker block — null when the broker stage is unreachable or inactive. */
|
|
13403
|
+
var CameraBrokerStatusSchema = object({
|
|
13404
|
+
profiles: array(object({
|
|
13405
|
+
profile: string(),
|
|
13406
|
+
status: string(),
|
|
13407
|
+
codec: string(),
|
|
13408
|
+
width: number(),
|
|
13409
|
+
height: number(),
|
|
13410
|
+
subscribers: number(),
|
|
13411
|
+
inFps: number(),
|
|
13412
|
+
outFps: number()
|
|
13413
|
+
})).readonly(),
|
|
13414
|
+
webrtcSessions: number(),
|
|
13415
|
+
rtspRestream: boolean()
|
|
13416
|
+
});
|
|
13417
|
+
/** Shared-memory ring statistics within the decoder block. */
|
|
13418
|
+
var CameraDecoderShmSchema = object({
|
|
13419
|
+
framesWritten: number(),
|
|
13420
|
+
getFrameHits: number(),
|
|
13421
|
+
getFrameMisses: number(),
|
|
13422
|
+
budgetMb: number()
|
|
13423
|
+
});
|
|
13424
|
+
/** Decoder block — null when the decoder stage is unreachable or inactive. */
|
|
13425
|
+
var CameraDecoderStatusSchema = object({
|
|
13426
|
+
nodeId: string(),
|
|
13427
|
+
formats: array(string()).readonly(),
|
|
13428
|
+
sessionCount: number(),
|
|
13429
|
+
shm: CameraDecoderShmSchema
|
|
13430
|
+
});
|
|
13431
|
+
/** Motion block — null when motion detection is not active for this device. */
|
|
13432
|
+
var CameraMotionStatusSchema = object({
|
|
13433
|
+
enabled: boolean(),
|
|
13434
|
+
fps: number()
|
|
13435
|
+
});
|
|
13436
|
+
/** Detection provisioning sub-block. */
|
|
13437
|
+
var CameraDetectionProvisioningSchema = object({
|
|
13438
|
+
state: _enum([
|
|
13439
|
+
"idle",
|
|
13440
|
+
"installing",
|
|
13441
|
+
"verifying",
|
|
13442
|
+
"ready",
|
|
13443
|
+
"failed"
|
|
13444
|
+
]),
|
|
13445
|
+
error: string().optional()
|
|
13446
|
+
});
|
|
13447
|
+
/** Detection phase — derived from the runner's engine phase. */
|
|
13448
|
+
var CameraDetectionPhaseSchema = _enum([
|
|
13449
|
+
"idle",
|
|
13450
|
+
"watching",
|
|
13451
|
+
"active"
|
|
13452
|
+
]);
|
|
13453
|
+
/** Detection block — null when no detection node is assigned or reachable. */
|
|
13454
|
+
var CameraDetectionStatusSchema = object({
|
|
13455
|
+
nodeId: string(),
|
|
13456
|
+
engine: object({
|
|
13457
|
+
backend: string(),
|
|
13458
|
+
device: string()
|
|
13459
|
+
}),
|
|
13460
|
+
phase: CameraDetectionPhaseSchema,
|
|
13461
|
+
configuredFps: number(),
|
|
13462
|
+
actualFps: number(),
|
|
13463
|
+
queueDepth: number(),
|
|
13464
|
+
avgInferenceMs: number(),
|
|
13465
|
+
provisioning: CameraDetectionProvisioningSchema
|
|
13466
|
+
});
|
|
13467
|
+
/** Audio block — null when no audio node is assigned or reachable. */
|
|
13468
|
+
var CameraAudioStatusSchema = object({
|
|
13469
|
+
nodeId: string(),
|
|
13470
|
+
enabled: boolean()
|
|
13471
|
+
});
|
|
13472
|
+
/** Recording block — null when no recording cap is active for this device. */
|
|
13473
|
+
var CameraRecordingStatusSchema = object({
|
|
13474
|
+
mode: _enum([
|
|
13475
|
+
"off",
|
|
13476
|
+
"continuous",
|
|
13477
|
+
"events"
|
|
13478
|
+
]),
|
|
13479
|
+
active: boolean(),
|
|
13480
|
+
storageBytes: number()
|
|
13481
|
+
});
|
|
13482
|
+
/**
|
|
13483
|
+
* Aggregated per-camera pipeline status — server-composed, single call.
|
|
13484
|
+
*
|
|
13485
|
+
* The `assignment` and `source` blocks are always present.
|
|
13486
|
+
* Every other block is `null` when the stage is inactive or unreachable
|
|
13487
|
+
* during the bounded parallel fan-out in the orchestrator implementation.
|
|
13488
|
+
*
|
|
13489
|
+
* See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
|
|
13490
|
+
*/
|
|
13491
|
+
var CameraStatusSchema = object({
|
|
13492
|
+
deviceId: number(),
|
|
13493
|
+
assignment: CameraAssignmentStatusSchema,
|
|
13494
|
+
source: CameraSourceStatusSchema,
|
|
13495
|
+
broker: CameraBrokerStatusSchema.nullable(),
|
|
13496
|
+
decoder: CameraDecoderStatusSchema.nullable(),
|
|
13497
|
+
motion: CameraMotionStatusSchema.nullable(),
|
|
13498
|
+
detection: CameraDetectionStatusSchema.nullable(),
|
|
13499
|
+
audio: CameraAudioStatusSchema.nullable(),
|
|
13500
|
+
recording: CameraRecordingStatusSchema.nullable(),
|
|
13501
|
+
/** Unix timestamp (ms) when this snapshot was composed server-side. */
|
|
13502
|
+
fetchedAt: number()
|
|
13503
|
+
});
|
|
13283
13504
|
method(object({
|
|
13284
13505
|
deviceId: number(),
|
|
13285
13506
|
agentNodeId: string()
|
|
@@ -13347,6 +13568,12 @@ method(object({
|
|
|
13347
13568
|
}), {
|
|
13348
13569
|
kind: "mutation",
|
|
13349
13570
|
auth: "admin"
|
|
13571
|
+
}), method(object({
|
|
13572
|
+
agentNodeId: string(),
|
|
13573
|
+
maxCameras: number().int().nonnegative().nullable()
|
|
13574
|
+
}), object({ success: literal(true) }), {
|
|
13575
|
+
kind: "mutation",
|
|
13576
|
+
auth: "admin"
|
|
13350
13577
|
}), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
|
|
13351
13578
|
deviceId: number(),
|
|
13352
13579
|
addonId: string(),
|
|
@@ -13372,7 +13599,7 @@ method(object({
|
|
|
13372
13599
|
}), method(object({
|
|
13373
13600
|
deviceId: number(),
|
|
13374
13601
|
agentNodeId: string().optional()
|
|
13375
|
-
}), CameraPipelineConfigSchema), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
13602
|
+
}), CameraPipelineConfigSchema), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
13376
13603
|
name: string(),
|
|
13377
13604
|
description: string().optional(),
|
|
13378
13605
|
config: CameraPipelineConfigSchema
|
|
@@ -13859,7 +14086,7 @@ method(object({
|
|
|
13859
14086
|
}), _void(), {
|
|
13860
14087
|
kind: "mutation",
|
|
13861
14088
|
auth: "admin"
|
|
13862
|
-
}), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
14089
|
+
}), method(object({ addonId: string() }), array(SavedDeviceRowSchema)), method(object({ addonId: string().optional() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
13863
14090
|
deviceId: number(),
|
|
13864
14091
|
values: record(string(), unknown())
|
|
13865
14092
|
}), object({ success: literal(true) }), {
|
|
@@ -14584,7 +14811,20 @@ var DiskSpaceInfoSchema = object({
|
|
|
14584
14811
|
var PidResourceStatsSchema = object({
|
|
14585
14812
|
pid: number(),
|
|
14586
14813
|
cpu: number(),
|
|
14587
|
-
memory: number()
|
|
14814
|
+
memory: number(),
|
|
14815
|
+
/**
|
|
14816
|
+
* Private (anonymous) resident bytes — the per-process V8 heap + native
|
|
14817
|
+
* allocations NOT shared with other processes (Linux RssAnon). This is the
|
|
14818
|
+
* "real" per-runner cost; summing it across runners is meaningful, unlike
|
|
14819
|
+
* `memory` (RSS), which double-counts the shared mmap'd framework code.
|
|
14820
|
+
* Undefined where /proc is unavailable (e.g. macOS).
|
|
14821
|
+
*/
|
|
14822
|
+
privateBytes: number().optional(),
|
|
14823
|
+
/**
|
|
14824
|
+
* Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
|
|
14825
|
+
* code shared copy-on-write across runners. Undefined on macOS.
|
|
14826
|
+
*/
|
|
14827
|
+
sharedBytes: number().optional()
|
|
14588
14828
|
});
|
|
14589
14829
|
var AddonInstanceSchema = object({
|
|
14590
14830
|
addonId: string(),
|
|
@@ -14633,6 +14873,17 @@ var KillProcessResultSchema = object({
|
|
|
14633
14873
|
reason: string().optional(),
|
|
14634
14874
|
signal: _enum(["SIGTERM", "SIGKILL"]).optional()
|
|
14635
14875
|
});
|
|
14876
|
+
var DumpHeapSnapshotInputSchema = object({
|
|
14877
|
+
/** The addon whose runner should dump a heap snapshot. */
|
|
14878
|
+
addonId: string() });
|
|
14879
|
+
var DumpHeapSnapshotResultSchema = object({
|
|
14880
|
+
success: boolean(),
|
|
14881
|
+
/** Path of the written .heapsnapshot inside the runner's container/host. */
|
|
14882
|
+
path: string().optional(),
|
|
14883
|
+
/** Process pid that was signalled. */
|
|
14884
|
+
pid: number().optional(),
|
|
14885
|
+
reason: string().optional()
|
|
14886
|
+
});
|
|
14636
14887
|
var SystemMetricsSchema = object({
|
|
14637
14888
|
cpuPercent: number(),
|
|
14638
14889
|
memoryPercent: number(),
|
|
@@ -14646,6 +14897,9 @@ var SystemMetricsSchema = object({
|
|
|
14646
14897
|
method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(KillProcessInputSchema, KillProcessResultSchema, {
|
|
14647
14898
|
kind: "mutation",
|
|
14648
14899
|
auth: "admin"
|
|
14900
|
+
}), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
|
|
14901
|
+
kind: "mutation",
|
|
14902
|
+
auth: "admin"
|
|
14649
14903
|
});
|
|
14650
14904
|
var PtzPresetSchema = object({
|
|
14651
14905
|
id: string(),
|
|
@@ -15054,63 +15308,6 @@ method(object({
|
|
|
15054
15308
|
auth: "admin"
|
|
15055
15309
|
});
|
|
15056
15310
|
/**
|
|
15057
|
-
* device-ops — device-scoped cap that unifies the per-IDevice operations
|
|
15058
|
-
* previously routed through the `.device-ops` Moleculer bridge service.
|
|
15059
|
-
*
|
|
15060
|
-
* Each worker that hosts live `IDevice` instances auto-registers a native
|
|
15061
|
-
* provider for this cap (per device) backed by its local
|
|
15062
|
-
* `DeviceRegistry`. Hub-side callers reach it transparently through
|
|
15063
|
-
* `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
|
|
15064
|
-
* `deviceId` + `nodeId` and dispatches through the standard cap-router,
|
|
15065
|
-
* so there's no parallel bridge path anymore.
|
|
15066
|
-
*
|
|
15067
|
-
* The surface is intentionally small — every method corresponds to a
|
|
15068
|
-
* single action on the live `IDevice` (or `ICameraDevice` for
|
|
15069
|
-
* `getStreamSources`). Richer orchestration (enable/disable with
|
|
15070
|
-
* integration plumbing, bulk updates) stays in the `device-manager` cap;
|
|
15071
|
-
* `device-ops` is the per-device primitive the device-manager routes to.
|
|
15072
|
-
*/
|
|
15073
|
-
var StreamSourceEntrySchema$1 = object({
|
|
15074
|
-
id: string(),
|
|
15075
|
-
label: string(),
|
|
15076
|
-
protocol: _enum([
|
|
15077
|
-
"rtsp",
|
|
15078
|
-
"rtmp",
|
|
15079
|
-
"annexb",
|
|
15080
|
-
"http-mjpeg",
|
|
15081
|
-
"webrtc",
|
|
15082
|
-
"custom"
|
|
15083
|
-
]),
|
|
15084
|
-
url: string().optional(),
|
|
15085
|
-
resolution: object({
|
|
15086
|
-
width: number(),
|
|
15087
|
-
height: number()
|
|
15088
|
-
}).optional(),
|
|
15089
|
-
fps: number().optional(),
|
|
15090
|
-
bitrate: number().optional(),
|
|
15091
|
-
codec: string().optional(),
|
|
15092
|
-
profileHint: CamProfileSchema.optional(),
|
|
15093
|
-
sdp: string().optional()
|
|
15094
|
-
});
|
|
15095
|
-
var ConfigEntrySchema$1 = object({
|
|
15096
|
-
key: string(),
|
|
15097
|
-
value: unknown()
|
|
15098
|
-
});
|
|
15099
|
-
var RawStateResultSchema = object({
|
|
15100
|
-
/** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
|
|
15101
|
-
source: string(),
|
|
15102
|
-
/** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
|
|
15103
|
-
data: record(string(), unknown())
|
|
15104
|
-
});
|
|
15105
|
-
method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
|
|
15106
|
-
deviceId: number(),
|
|
15107
|
-
values: record(string(), unknown())
|
|
15108
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
15109
|
-
deviceId: number(),
|
|
15110
|
-
action: string().min(1),
|
|
15111
|
-
input: unknown()
|
|
15112
|
-
}), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
|
|
15113
|
-
/**
|
|
15114
15311
|
* camera-credentials — device-scoped cap exposing the camera's network
|
|
15115
15312
|
* + auth surface in a vendor-neutral shape.
|
|
15116
15313
|
*
|
|
@@ -18793,6 +18990,12 @@ Object.freeze({
|
|
|
18793
18990
|
addonId: null,
|
|
18794
18991
|
access: "view"
|
|
18795
18992
|
},
|
|
18993
|
+
"metricsProvider.dumpHeapSnapshot": {
|
|
18994
|
+
capName: "metrics-provider",
|
|
18995
|
+
capScope: "system",
|
|
18996
|
+
addonId: null,
|
|
18997
|
+
access: "create"
|
|
18998
|
+
},
|
|
18796
18999
|
"metricsProvider.getAddonStats": {
|
|
18797
19000
|
capName: "metrics-provider",
|
|
18798
19001
|
capScope: "system",
|
|
@@ -19249,6 +19452,12 @@ Object.freeze({
|
|
|
19249
19452
|
addonId: null,
|
|
19250
19453
|
access: "view"
|
|
19251
19454
|
},
|
|
19455
|
+
"pipelineExecutor.getEngineProvisioning": {
|
|
19456
|
+
capName: "pipeline-executor",
|
|
19457
|
+
capScope: "system",
|
|
19458
|
+
addonId: null,
|
|
19459
|
+
access: "view"
|
|
19460
|
+
},
|
|
19252
19461
|
"pipelineExecutor.getGlobalPipelineConfig": {
|
|
19253
19462
|
capName: "pipeline-executor",
|
|
19254
19463
|
capScope: "system",
|
|
@@ -19453,6 +19662,18 @@ Object.freeze({
|
|
|
19453
19662
|
addonId: null,
|
|
19454
19663
|
access: "view"
|
|
19455
19664
|
},
|
|
19665
|
+
"pipelineOrchestrator.getCameraStatus": {
|
|
19666
|
+
capName: "pipeline-orchestrator",
|
|
19667
|
+
capScope: "system",
|
|
19668
|
+
addonId: null,
|
|
19669
|
+
access: "view"
|
|
19670
|
+
},
|
|
19671
|
+
"pipelineOrchestrator.getCameraStatuses": {
|
|
19672
|
+
capName: "pipeline-orchestrator",
|
|
19673
|
+
capScope: "system",
|
|
19674
|
+
addonId: null,
|
|
19675
|
+
access: "view"
|
|
19676
|
+
},
|
|
19456
19677
|
"pipelineOrchestrator.getCameraStepOverrides": {
|
|
19457
19678
|
capName: "pipeline-orchestrator",
|
|
19458
19679
|
capScope: "system",
|
|
@@ -19537,6 +19758,12 @@ Object.freeze({
|
|
|
19537
19758
|
addonId: null,
|
|
19538
19759
|
access: "create"
|
|
19539
19760
|
},
|
|
19761
|
+
"pipelineOrchestrator.setAgentMaxCameras": {
|
|
19762
|
+
capName: "pipeline-orchestrator",
|
|
19763
|
+
capScope: "system",
|
|
19764
|
+
addonId: null,
|
|
19765
|
+
access: "create"
|
|
19766
|
+
},
|
|
19540
19767
|
"pipelineOrchestrator.setCameraPipelineForAgent": {
|
|
19541
19768
|
capName: "pipeline-orchestrator",
|
|
19542
19769
|
capScope: "system",
|