@camstack/addon-remote-storage 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/s3.addon.js +1 -1
- package/dist/s3.addon.mjs +1 -1
- package/dist/sftp.addon.js +1 -1
- package/dist/sftp.addon.mjs +1 -1
- package/dist/{shared-uppUFqZL.js → shared-BNnlmGQv.js} +1289 -1064
- package/dist/{shared-uH6t_fje.mjs → shared-fq937ye4.mjs} +1290 -1065
- package/dist/webdav.addon.js +1 -1
- package/dist/webdav.addon.mjs +1 -1
- package/package.json +1 -1
|
@@ -4652,63 +4652,7 @@ function _instanceof(cls, params = {}) {
|
|
|
4652
4652
|
return inst;
|
|
4653
4653
|
}
|
|
4654
4654
|
//#endregion
|
|
4655
|
-
//#region ../types/dist/
|
|
4656
|
-
/**
|
|
4657
|
-
* Deep wiring healthcheck — snapshot of active reachability probes across
|
|
4658
|
-
* every declared capability + widget of every installed plugin, on every
|
|
4659
|
-
* node. Produced by the backend `WiringHealthService` and surfaced via
|
|
4660
|
-
* `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
|
|
4661
|
-
*
|
|
4662
|
-
* Unlike `/health` (process liveness), this reflects whether each cap/widget
|
|
4663
|
-
* is actually *reachable* over the real cap-dispatch path. See spec
|
|
4664
|
-
* `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
|
|
4665
|
-
*/
|
|
4666
|
-
/** What kind of target a probe addressed. */
|
|
4667
|
-
var wiringProbeKindSchema = _enum([
|
|
4668
|
-
"singleton",
|
|
4669
|
-
"device",
|
|
4670
|
-
"widget"
|
|
4671
|
-
]);
|
|
4672
|
-
/** Result of probing a single (cap|widget [, device]) target. */
|
|
4673
|
-
var wiringProbeResultSchema = object({
|
|
4674
|
-
capName: string(),
|
|
4675
|
-
kind: wiringProbeKindSchema,
|
|
4676
|
-
deviceId: number().optional(),
|
|
4677
|
-
reachable: boolean(),
|
|
4678
|
-
latencyMs: number(),
|
|
4679
|
-
error: string().optional()
|
|
4680
|
-
});
|
|
4681
|
-
/** Per-addon roll-up of cap + widget probe results. */
|
|
4682
|
-
var wiringAddonHealthSchema = object({
|
|
4683
|
-
addonId: string(),
|
|
4684
|
-
caps: array(wiringProbeResultSchema).readonly(),
|
|
4685
|
-
widgets: array(wiringProbeResultSchema).readonly()
|
|
4686
|
-
});
|
|
4687
|
-
/** Per-node roll-up. */
|
|
4688
|
-
var wiringNodeHealthSchema = object({
|
|
4689
|
-
nodeId: string(),
|
|
4690
|
-
addons: array(wiringAddonHealthSchema).readonly()
|
|
4691
|
-
});
|
|
4692
|
-
object({
|
|
4693
|
-
/** True only when every probed target is reachable. */
|
|
4694
|
-
ok: boolean(),
|
|
4695
|
-
/** True when at least one target is unreachable. */
|
|
4696
|
-
degraded: boolean(),
|
|
4697
|
-
checkedAt: string(),
|
|
4698
|
-
nodes: array(wiringNodeHealthSchema).readonly(),
|
|
4699
|
-
summary: object({
|
|
4700
|
-
total: number(),
|
|
4701
|
-
reachable: number(),
|
|
4702
|
-
unreachable: number()
|
|
4703
|
-
})
|
|
4704
|
-
});
|
|
4705
|
-
var MODEL_FORMATS = [
|
|
4706
|
-
"onnx",
|
|
4707
|
-
"coreml",
|
|
4708
|
-
"openvino",
|
|
4709
|
-
"tflite",
|
|
4710
|
-
"pt"
|
|
4711
|
-
];
|
|
4655
|
+
//#region ../types/dist/sleep-D7JeS58T.mjs
|
|
4712
4656
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4713
4657
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4714
4658
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -5006,6 +4950,18 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
|
5006
4950
|
*/
|
|
5007
4951
|
EventCategory["PipelineEngineMetricsSnapshot"] = "pipeline.engine-metrics-snapshot";
|
|
5008
4952
|
/**
|
|
4953
|
+
* Per-node detection-engine runtime-provisioning transition. Emitted by
|
|
4954
|
+
* the detection-pipeline provider on every state change of its lazy
|
|
4955
|
+
* engine-provisioning machine (idle → installing → verifying → ready,
|
|
4956
|
+
* or → failed with a `nextRetryAt`). Payload is the
|
|
4957
|
+
* `EngineProvisioningState` snapshot; `event.source.nodeId` carries the
|
|
4958
|
+
* node. The Pipeline page subscribes to drive a live "installing
|
|
4959
|
+
* OpenVINO… / ready" indicator per node without polling
|
|
4960
|
+
* `pipelineExecutor.getEngineProvisioning`. Telemetry-grade (D8): the UI
|
|
4961
|
+
* also reads the cap snapshot on mount / reconnect. Phase 2.
|
|
4962
|
+
*/
|
|
4963
|
+
EventCategory["PipelineEngineProvisioning"] = "pipeline.engine-provisioning";
|
|
4964
|
+
/**
|
|
5009
4965
|
* Cluster topology snapshot. Carries the same payload returned by
|
|
5010
4966
|
* `nodes.topology` (every reachable node + addons + processes).
|
|
5011
4967
|
* Emitted by the hub on any agent / addon lifecycle change
|
|
@@ -6019,7 +5975,7 @@ var ProfileSlotSchema = object({
|
|
|
6019
5975
|
* Zod schema for StreamSourceEntry — the canonical stream descriptor
|
|
6020
5976
|
* exposed by ICameraDevice.getStreamSources() and consumed by the broker.
|
|
6021
5977
|
*/
|
|
6022
|
-
var StreamSourceEntrySchema = object({
|
|
5978
|
+
var StreamSourceEntrySchema$1 = object({
|
|
6023
5979
|
id: string(),
|
|
6024
5980
|
label: string(),
|
|
6025
5981
|
protocol: _enum([
|
|
@@ -6241,894 +6197,1080 @@ var ProfileRtspEntrySchema = object({
|
|
|
6241
6197
|
codec: string().optional(),
|
|
6242
6198
|
resolution: CamStreamResolutionSchema.optional()
|
|
6243
6199
|
});
|
|
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
|
-
|
|
6308
|
-
|
|
6309
|
-
|
|
6310
|
-
|
|
6311
|
-
|
|
6312
|
-
|
|
6313
|
-
|
|
6314
|
-
|
|
6315
|
-
|
|
6316
|
-
|
|
6317
|
-
|
|
6318
|
-
|
|
6319
|
-
|
|
6320
|
-
|
|
6321
|
-
|
|
6322
|
-
|
|
6323
|
-
|
|
6324
|
-
|
|
6325
|
-
|
|
6326
|
-
|
|
6327
|
-
/**
|
|
6328
|
-
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
6329
|
-
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
6330
|
-
* live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
|
|
6331
|
-
* (when the volume is too full to keep recording) is NOT a per-camera concern —
|
|
6332
|
-
* it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
|
|
6333
|
-
* shared by every camera writing to that volume.
|
|
6334
|
-
*/
|
|
6335
|
-
var RecordingRetentionSchema = object({
|
|
6336
|
-
maxAgeDays: number().min(0).optional(),
|
|
6337
|
-
maxSizeGb: number().min(0).optional()
|
|
6338
|
-
});
|
|
6339
|
-
/**
|
|
6340
|
-
* The full per-camera recording intent — the wire shape of a RecordingTarget.
|
|
6341
|
-
*
|
|
6342
|
-
* `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
|
|
6343
|
-
* are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
|
|
6344
|
-
* only for transition + migration (`migrateRulesToMode`); the policy engine
|
|
6345
|
-
* consumes the compiled output of `compileRules(config)`, never `rules` directly.
|
|
6346
|
-
*/
|
|
6347
|
-
var RecordingConfigSchema = object({
|
|
6348
|
-
enabled: boolean(),
|
|
6349
|
-
/** Authoritative storage mode. Absent on legacy targets → derived once via
|
|
6350
|
-
* `migrateRulesToMode`, then persisted. */
|
|
6351
|
-
mode: RecordingStorageModeSchema.optional(),
|
|
6352
|
-
profiles: array(CamProfileSchema).optional(),
|
|
6353
|
-
segmentSeconds: number().int().positive().optional(),
|
|
6354
|
-
/** Shared recording time-bands for `events` & `continuous` — record only when
|
|
6355
|
-
* the wall-clock falls inside one of these windows. Omit or empty = always.
|
|
6356
|
-
* `continuous` compiles to one rule per band; `events` to band × trigger. */
|
|
6357
|
-
schedules: array(RecordingScheduleSchema).optional(),
|
|
6358
|
-
/** Legacy single-band predecessor of `schedules`. Read-compat only — it is
|
|
6359
|
-
* normalized into `schedules` on read and never written going forward. (Not
|
|
6360
|
-
* tagged `@deprecated`: the normalization paths must read it cast-free.) */
|
|
6361
|
-
schedule: RecordingScheduleSchema.optional(),
|
|
6362
|
-
/** `events`-mode only — which detectors trigger a recording. */
|
|
6363
|
-
triggers: RecordingTriggersSchema.optional(),
|
|
6364
|
-
/** `events`-mode only — seconds retained before / after a trigger. */
|
|
6365
|
-
preBufferSec: number().min(0).optional(),
|
|
6366
|
-
postBufferSec: number().min(0).optional(),
|
|
6367
|
-
/** DEPRECATED authoring input; retained for migration/transition. */
|
|
6368
|
-
rules: array(RecordingRuleSchema).optional(),
|
|
6369
|
-
/**
|
|
6370
|
-
* AUTHORITATIVE mode-per-band recording model (recorder). When present it
|
|
6371
|
-
* is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
|
|
6372
|
-
* `triggers`/`rules` fields above are kept for READ-COMPAT only and are
|
|
6373
|
-
* derived into bands once via `migrateConfigToBands`.
|
|
6374
|
-
*/
|
|
6375
|
-
bands: array(RecordingBandSchema).optional(),
|
|
6376
|
-
retention: RecordingRetentionSchema.optional()
|
|
6377
|
-
});
|
|
6378
|
-
/**
|
|
6379
|
-
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
6380
|
-
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
6381
|
-
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
6382
|
-
* without forming a circular import. The `storage` cap re-exports it
|
|
6383
|
-
* verbatim for back-compat.
|
|
6384
|
-
*
|
|
6385
|
-
* This Zod schema is the **authoritative source** for `StorageLocationType`.
|
|
6386
|
-
* The TS alias in `./storage.ts` re-exports `z.infer<typeof
|
|
6387
|
-
* StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
|
|
6388
|
-
* `IStorageProvider` interface stay in lockstep.
|
|
6389
|
-
*
|
|
6390
|
-
* The type is now an **open string** (not a closed enum) — addons declare
|
|
6391
|
-
* their own location kinds via `StorageLocationDeclaration.id`. The regex
|
|
6392
|
-
* enforces a safe id format: lowercase-start, alphanumeric + hyphens.
|
|
6393
|
-
*/
|
|
6394
|
-
var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
6395
|
-
/**
|
|
6396
|
-
* Persisted record for a storage location instance. Operators can register
|
|
6397
|
-
* multiple instances for multi-cardinality types (e.g. two `backups`
|
|
6398
|
-
* locations with different `providerId`s). Cardinality is now declared per
|
|
6399
|
-
* location via `StorageLocationDeclaration.cardinality` — the static
|
|
6400
|
-
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
6401
|
-
*
|
|
6402
|
-
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
6403
|
-
* The default location for a type uses `id === <type>:default` by
|
|
6404
|
-
* convention (the bare type ref like `'backups'` resolves to it).
|
|
6405
|
-
*
|
|
6406
|
-
* `isSystem: true` marks a location as orchestrator-seeded and
|
|
6407
|
-
* undeletable. The bootstrap-installed defaults (one per type) carry
|
|
6408
|
-
* this flag; operator-added locations don't. Editing the config of
|
|
6409
|
-
* a system location is allowed (path migration, provider swap) but
|
|
6410
|
-
* deleting it is rejected at the cap level.
|
|
6411
|
-
*/
|
|
6412
|
-
var StorageLocationSchema = object({
|
|
6413
|
-
id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
|
|
6414
|
-
type: string(),
|
|
6415
|
-
displayName: string().min(1),
|
|
6416
|
-
providerId: string().min(1),
|
|
6417
|
-
config: record(string(), unknown()),
|
|
6418
|
-
/**
|
|
6419
|
-
* Cluster node this location physically lives on. REQUIRED for node-local
|
|
6420
|
-
* providers (filesystem — the path exists on one node's disk), null/absent
|
|
6421
|
-
* for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
|
|
6422
|
-
* `'hub'` is the hub node. Validated against the provider's `nodeLocal`
|
|
6423
|
-
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
6424
|
-
*/
|
|
6425
|
-
nodeId: string().optional(),
|
|
6426
|
-
isDefault: boolean().default(false),
|
|
6427
|
-
isSystem: boolean().default(false),
|
|
6428
|
-
createdAt: number(),
|
|
6429
|
-
updatedAt: number()
|
|
6430
|
-
});
|
|
6431
|
-
/**
|
|
6432
|
-
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
6433
|
-
* Either:
|
|
6434
|
-
* - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
|
|
6435
|
-
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
6436
|
-
*
|
|
6437
|
-
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
6438
|
-
*/
|
|
6439
|
-
var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
|
|
6440
|
-
/**
|
|
6441
|
-
* `StorageLocationDeclaration` — a single storage-location entry declared by
|
|
6442
|
-
* an addon in its `package.json` under `camstack.storageLocations`.
|
|
6443
|
-
*
|
|
6444
|
-
* Design intent:
|
|
6445
|
-
* - **Addon declares its needs** — each addon describes the logical storage
|
|
6446
|
-
* slots it requires (e.g. `recordings`, `recordingsLow`) without caring
|
|
6447
|
-
* about the physical path.
|
|
6448
|
-
* - **Kernel aggregates** — at boot the kernel collects declarations from all
|
|
6449
|
-
* installed addons, deduplicates by `id`, and exposes the union via the
|
|
6450
|
-
* storage-locations settings surface.
|
|
6451
|
-
* - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
|
|
6452
|
-
* at least one instance named `<id>:default` is present, using
|
|
6453
|
-
* `defaultsTo` to inherit the resolved root from another location when the
|
|
6454
|
-
* declaration is a derivative slot (e.g. `recordingsLow` defaults to
|
|
6455
|
-
* `recordings`).
|
|
6456
|
-
* - **ids are global** — `id` values are shared across the entire deployment;
|
|
6457
|
-
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
6458
|
-
* at kernel aggregation time, not here).
|
|
6459
|
-
*/
|
|
6460
|
-
var StorageLocationDeclarationSchema = object({
|
|
6461
|
-
/**
|
|
6462
|
-
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
6463
|
-
* Must start with a lowercase letter and may contain letters, digits, and
|
|
6464
|
-
* hyphens.
|
|
6465
|
-
*/
|
|
6466
|
-
id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
|
|
6467
|
-
/** Human-readable name shown in the admin UI. */
|
|
6468
|
-
displayName: string().min(1, { message: "displayName must not be empty" }),
|
|
6469
|
-
/** Optional longer explanation of what data this location stores. */
|
|
6470
|
-
description: string().optional(),
|
|
6471
|
-
/**
|
|
6472
|
-
* `single` — exactly one instance of this location is allowed system-wide
|
|
6473
|
-
* (e.g. `logs`, `models`). The operator can edit it but not add more.
|
|
6474
|
-
* `multi` — the operator may register several instances (e.g. a second
|
|
6475
|
-
* `recordings` on a NAS for disk tiering); one is the default at any time.
|
|
6476
|
-
*/
|
|
6477
|
-
cardinality: _enum(["single", "multi"]),
|
|
6478
|
-
/**
|
|
6479
|
-
* When set, the default instance for this location inherits its resolved
|
|
6480
|
-
* root from the named location's default instance. Useful for derivative
|
|
6481
|
-
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
6482
|
-
* configure the primary location.
|
|
6483
|
-
*/
|
|
6484
|
-
defaultsTo: string().optional()
|
|
6485
|
-
});
|
|
6486
|
-
var DecoderStatsSchema = object({
|
|
6487
|
-
inputFps: number(),
|
|
6488
|
-
outputFps: number(),
|
|
6489
|
-
avgDecodeTimeMs: number(),
|
|
6490
|
-
droppedFrames: number()
|
|
6491
|
-
});
|
|
6492
|
-
var DecoderSessionConfigSchema = object({
|
|
6493
|
-
codec: string(),
|
|
6494
|
-
maxFps: number().default(0),
|
|
6495
|
-
outputFormat: _enum([
|
|
6496
|
-
"jpeg",
|
|
6497
|
-
"rgb",
|
|
6498
|
-
"bgr",
|
|
6499
|
-
"yuv420",
|
|
6500
|
-
"gray"
|
|
6501
|
-
]).default("jpeg"),
|
|
6502
|
-
scale: number().default(1),
|
|
6503
|
-
width: number().optional(),
|
|
6504
|
-
height: number().optional(),
|
|
6200
|
+
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
6201
|
+
DeviceType["Camera"] = "camera";
|
|
6202
|
+
DeviceType["Hub"] = "hub";
|
|
6203
|
+
DeviceType["Light"] = "light";
|
|
6204
|
+
DeviceType["Siren"] = "siren";
|
|
6205
|
+
DeviceType["Switch"] = "switch";
|
|
6206
|
+
DeviceType["Sensor"] = "sensor";
|
|
6207
|
+
DeviceType["Thermostat"] = "thermostat";
|
|
6208
|
+
DeviceType["Button"] = "button";
|
|
6209
|
+
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
6210
|
+
* event vocabulary verbatim (no normalization). Installed with the
|
|
6211
|
+
* `event-emitter` cap. Sources: HA `event.*` entities (structured) and
|
|
6212
|
+
* HA bus events (e.g. `zha_event`, generic). */
|
|
6213
|
+
DeviceType["EventEmitter"] = "event-emitter";
|
|
6214
|
+
/** Firmware/software update entity — current vs available version,
|
|
6215
|
+
* updatable flag, update state, and an install action. Installed with
|
|
6216
|
+
* the `update` cap. Sources: Homematic firmware-update channels (and
|
|
6217
|
+
* reusable by other providers, e.g. HA `update.*` entities). */
|
|
6218
|
+
DeviceType["Update"] = "update";
|
|
6219
|
+
DeviceType["Generic"] = "generic";
|
|
6220
|
+
/** Generic notification delivery target (HA `notify.<service>`, future
|
|
6221
|
+
* Telegram / Discord / ntfy / SMTP, …). One device per delivery
|
|
6222
|
+
* endpoint; the `notifier` cap defines the send surface. */
|
|
6223
|
+
DeviceType["Notifier"] = "notifier";
|
|
6224
|
+
/** Pre-recorded action sequence with optional parameters
|
|
6225
|
+
* (HA `script.*`). Runnable via `script-runner` cap. */
|
|
6226
|
+
DeviceType["Script"] = "script";
|
|
6227
|
+
/** Automation rule (HA `automation.*`) — enable/disable + manual
|
|
6228
|
+
* trigger surface exposed via `automation-control` cap. */
|
|
6229
|
+
DeviceType["Automation"] = "automation";
|
|
6230
|
+
/** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
|
|
6231
|
+
DeviceType["Lock"] = "lock";
|
|
6232
|
+
/** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
|
|
6233
|
+
* `valve.*`). `cover` cap with sub-roles for variant. */
|
|
6234
|
+
DeviceType["Cover"] = "cover";
|
|
6235
|
+
/** Pipe / water / gas valve with open/close/stop and optional
|
|
6236
|
+
* position (HA `valve.*`). `valve` cap — a cover-sibling actuator
|
|
6237
|
+
* modelled on the same open/closed lifecycle. */
|
|
6238
|
+
DeviceType["Valve"] = "valve";
|
|
6239
|
+
/** Humidifier / dehumidifier with on/off + target humidity + mode
|
|
6240
|
+
* (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
|
|
6241
|
+
* modelled on the same target / mode lifecycle. */
|
|
6242
|
+
DeviceType["Humidifier"] = "humidifier";
|
|
6243
|
+
/** Water heater / boiler with target temperature + operation mode +
|
|
6244
|
+
* away mode (HA `water_heater.*`). `water-heater` cap — a
|
|
6245
|
+
* climate-family actuator. */
|
|
6246
|
+
DeviceType["WaterHeater"] = "water-heater";
|
|
6247
|
+
/** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
|
|
6248
|
+
DeviceType["Fan"] = "fan";
|
|
6249
|
+
/** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
|
|
6250
|
+
* the camera surface — those use `Camera`. `media-player` cap. */
|
|
6251
|
+
DeviceType["MediaPlayer"] = "media-player";
|
|
6252
|
+
/** Security panel / alarm system (HA `alarm_control_panel.*`).
|
|
6253
|
+
* `alarm-panel` cap. */
|
|
6254
|
+
DeviceType["AlarmPanel"] = "alarm-panel";
|
|
6255
|
+
/** Generic user-settable input (HA `number` / `input_number` / `select`
|
|
6256
|
+
* / `input_select` / `text` / `input_text` / `input_datetime`).
|
|
6257
|
+
* Sub-type via `DeviceRole`: NumericControl / SelectControl /
|
|
6258
|
+
* TextControl / DateTimeControl. */
|
|
6259
|
+
DeviceType["Control"] = "control";
|
|
6260
|
+
/** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
|
|
6261
|
+
* `presence` cap. */
|
|
6262
|
+
DeviceType["Presence"] = "presence";
|
|
6263
|
+
/** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
|
|
6264
|
+
* `weather` cap. */
|
|
6265
|
+
DeviceType["Weather"] = "weather";
|
|
6266
|
+
/** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
|
|
6267
|
+
DeviceType["Vacuum"] = "vacuum";
|
|
6268
|
+
/** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
|
|
6269
|
+
* `lawn-mower-control` cap. */
|
|
6270
|
+
DeviceType["LawnMower"] = "lawn-mower";
|
|
6271
|
+
/** Physical HA device group — parent container for entity-children
|
|
6272
|
+
* adopted from a single HA device entry. Not renderable as a
|
|
6273
|
+
* standalone device; exists only to anchor child entities. */
|
|
6274
|
+
DeviceType["Container"] = "container";
|
|
6275
|
+
/** Single still-image entity (HA `image.*`). Read-only display of an
|
|
6276
|
+
* `entity_picture` signed URL the browser loads directly. `image` cap. */
|
|
6277
|
+
DeviceType["Image"] = "image";
|
|
6278
|
+
return DeviceType;
|
|
6279
|
+
}({});
|
|
6280
|
+
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
6281
|
+
DeviceFeature["BatteryOperated"] = "battery-operated";
|
|
6282
|
+
DeviceFeature["Rebootable"] = "rebootable";
|
|
6505
6283
|
/**
|
|
6506
|
-
*
|
|
6507
|
-
*
|
|
6508
|
-
*
|
|
6509
|
-
* per-camera filtering when diagnosing failures (e.g. node-av
|
|
6510
|
-
* sendPacket errors on a single hung camera).
|
|
6284
|
+
* Device supports an on-demand re-sync of its derived spec with its
|
|
6285
|
+
* upstream source — drives the generic Re-sync button. The owning
|
|
6286
|
+
* provider implements the action via the `device-adoption.resync` cap.
|
|
6511
6287
|
*/
|
|
6512
|
-
|
|
6288
|
+
DeviceFeature["Resyncable"] = "resyncable";
|
|
6289
|
+
DeviceFeature["NativeSnapshot"] = "native-snapshot";
|
|
6290
|
+
DeviceFeature["DoorbellButton"] = "doorbell-button";
|
|
6291
|
+
DeviceFeature["TwoWayAudio"] = "two-way-audio";
|
|
6292
|
+
DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
|
|
6513
6293
|
/**
|
|
6514
|
-
*
|
|
6515
|
-
* `
|
|
6516
|
-
*
|
|
6517
|
-
*
|
|
6294
|
+
* Camera supports the on-firmware autotrack subsystem (subject-
|
|
6295
|
+
* following). Distinct from `PanTiltZoom` because not every PTZ
|
|
6296
|
+
* camera ships autotrack — the admin UI uses this flag to gate
|
|
6297
|
+
* the autotrack toggle / settings card without re-deriving from
|
|
6298
|
+
* the cap registry. Mirrors `ptz-autotrack` cap registration:
|
|
6299
|
+
* driver sets this feature when probe confirms the firmware
|
|
6300
|
+
* surface, and registers the cap in the same code path.
|
|
6518
6301
|
*/
|
|
6519
|
-
|
|
6302
|
+
DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
|
|
6520
6303
|
/**
|
|
6521
|
-
*
|
|
6304
|
+
* Accessory exposes a "trigger on motion" toggle — the parent camera's
|
|
6305
|
+
* motion detection automatically activates this device. Mirrors
|
|
6306
|
+
* `motion-trigger` cap registration: drivers set this feature in the
|
|
6307
|
+
* same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
|
|
6522
6308
|
*
|
|
6523
|
-
*
|
|
6524
|
-
*
|
|
6525
|
-
*
|
|
6526
|
-
* into an OS shared-memory ring and drained as zero-pixel
|
|
6527
|
-
* `FrameHandle`s via `pullHandles`. A session is one mode or the
|
|
6528
|
-
* other — `pullFrames` returns nothing for an `'shm'` session and
|
|
6529
|
-
* `pullHandles` returns nothing for a `'callback'` session.
|
|
6530
|
-
*/
|
|
6531
|
-
frameSink: _enum(["callback", "shm"]).default("callback")
|
|
6532
|
-
});
|
|
6533
|
-
var EncodeProfileSchema = object({
|
|
6534
|
-
video: object({
|
|
6535
|
-
codec: _enum([
|
|
6536
|
-
"h264",
|
|
6537
|
-
"h265",
|
|
6538
|
-
"copy"
|
|
6539
|
-
]),
|
|
6540
|
-
profile: _enum([
|
|
6541
|
-
"baseline",
|
|
6542
|
-
"main",
|
|
6543
|
-
"high"
|
|
6544
|
-
]).optional(),
|
|
6545
|
-
width: number().int().positive().optional(),
|
|
6546
|
-
height: number().int().positive().optional(),
|
|
6547
|
-
fps: number().positive().optional(),
|
|
6548
|
-
bitrateKbps: number().int().positive().optional(),
|
|
6549
|
-
gopFrames: number().int().positive().optional(),
|
|
6550
|
-
bf: number().int().min(0).optional(),
|
|
6551
|
-
preset: _enum([
|
|
6552
|
-
"ultrafast",
|
|
6553
|
-
"superfast",
|
|
6554
|
-
"veryfast",
|
|
6555
|
-
"faster",
|
|
6556
|
-
"fast",
|
|
6557
|
-
"medium"
|
|
6558
|
-
]).optional(),
|
|
6559
|
-
tune: _enum([
|
|
6560
|
-
"zerolatency",
|
|
6561
|
-
"film",
|
|
6562
|
-
"animation"
|
|
6563
|
-
]).optional()
|
|
6564
|
-
}),
|
|
6565
|
-
audio: union([literal("passthrough"), object({
|
|
6566
|
-
codec: _enum([
|
|
6567
|
-
"opus",
|
|
6568
|
-
"aac",
|
|
6569
|
-
"pcmu",
|
|
6570
|
-
"pcma",
|
|
6571
|
-
"copy"
|
|
6572
|
-
]),
|
|
6573
|
-
bitrateKbps: number().int().positive().optional(),
|
|
6574
|
-
sampleRateHz: number().int().positive().optional(),
|
|
6575
|
-
channels: union([literal(1), literal(2)]).optional()
|
|
6576
|
-
})]),
|
|
6577
|
-
/**
|
|
6578
|
-
* ffmpeg input-side args, inserted between the fixed global flags
|
|
6579
|
-
* (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
|
|
6580
|
-
* — the widget surfaces a textarea + suggestion chips for the most-
|
|
6581
|
-
* used demuxer/format options.
|
|
6582
|
-
*/
|
|
6583
|
-
inputArgs: array(string()).optional(),
|
|
6584
|
-
/**
|
|
6585
|
-
* ffmpeg output-side args, inserted between the encode block and
|
|
6586
|
-
* the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
|
|
6587
|
-
* filters, codec-specific overrides. Free-text array.
|
|
6309
|
+
* Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
|
|
6310
|
+
* fast scalar without binding fetch), notifier rules, and `listAll`
|
|
6311
|
+
* filters that want "all devices with on-motion behaviour".
|
|
6588
6312
|
*/
|
|
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
|
-
"Heavy engine (low frequency)": "engine",
|
|
6752
|
-
"Lawn mower": "engine",
|
|
6753
|
-
Chainsaw: "engine",
|
|
6754
|
-
Hammer: "tools",
|
|
6755
|
-
Jackhammer: "tools",
|
|
6756
|
-
Sawing: "tools",
|
|
6757
|
-
"Power tool": "tools",
|
|
6758
|
-
Drill: "tools",
|
|
6759
|
-
Sanding: "tools",
|
|
6760
|
-
Silence: "silence"
|
|
6761
|
-
},
|
|
6762
|
-
preserveOriginal: false
|
|
6763
|
-
};
|
|
6764
|
-
var APPLE_SA_TO_MACRO = {
|
|
6765
|
-
mapping: {
|
|
6766
|
-
speech: "speech",
|
|
6767
|
-
child_speech: "speech",
|
|
6768
|
-
conversation: "speech",
|
|
6769
|
-
whispering: "speech",
|
|
6770
|
-
singing: "speech",
|
|
6771
|
-
humming: "speech",
|
|
6772
|
-
shout: "scream",
|
|
6773
|
-
yell: "scream",
|
|
6774
|
-
screaming: "scream",
|
|
6775
|
-
crying: "crying",
|
|
6776
|
-
baby_crying: "crying",
|
|
6777
|
-
sobbing: "crying",
|
|
6778
|
-
laughter: "laughter",
|
|
6779
|
-
baby_laughter: "laughter",
|
|
6780
|
-
giggling: "laughter",
|
|
6781
|
-
music: "music",
|
|
6782
|
-
guitar: "music",
|
|
6783
|
-
piano: "music",
|
|
6784
|
-
drums: "music",
|
|
6785
|
-
dog_bark: "dog",
|
|
6786
|
-
dog_bow_wow: "dog",
|
|
6787
|
-
dog_growling: "dog",
|
|
6788
|
-
dog_howl: "dog",
|
|
6789
|
-
cat_meow: "cat",
|
|
6790
|
-
cat_purr: "cat",
|
|
6791
|
-
cat_hiss: "cat",
|
|
6792
|
-
bird: "bird",
|
|
6793
|
-
bird_chirp: "bird",
|
|
6794
|
-
bird_squawk: "bird",
|
|
6795
|
-
animal: "animal",
|
|
6796
|
-
horse: "animal",
|
|
6797
|
-
cow_moo: "animal",
|
|
6798
|
-
insect: "animal",
|
|
6799
|
-
alarm: "alarm",
|
|
6800
|
-
smoke_alarm: "alarm",
|
|
6801
|
-
fire_alarm: "alarm",
|
|
6802
|
-
car_alarm: "alarm",
|
|
6803
|
-
siren: "siren",
|
|
6804
|
-
police_siren: "siren",
|
|
6805
|
-
ambulance_siren: "siren",
|
|
6806
|
-
doorbell: "doorbell",
|
|
6807
|
-
door_knock: "doorbell",
|
|
6808
|
-
knocking: "doorbell",
|
|
6809
|
-
glass_breaking: "glass_breaking",
|
|
6810
|
-
glass_shatter: "glass_breaking",
|
|
6811
|
-
gunshot: "gunshot",
|
|
6812
|
-
explosion: "gunshot",
|
|
6813
|
-
fireworks: "gunshot",
|
|
6814
|
-
car: "vehicle",
|
|
6815
|
-
truck: "vehicle",
|
|
6816
|
-
motorcycle: "vehicle",
|
|
6817
|
-
car_horn: "vehicle",
|
|
6818
|
-
vehicle_horn: "vehicle",
|
|
6819
|
-
traffic: "vehicle",
|
|
6820
|
-
fire: "fire",
|
|
6821
|
-
fire_crackle: "fire",
|
|
6822
|
-
water: "water",
|
|
6823
|
-
rain: "water",
|
|
6824
|
-
ocean: "water",
|
|
6825
|
-
splash: "water",
|
|
6826
|
-
wind: "wind",
|
|
6827
|
-
thunder: "wind",
|
|
6828
|
-
thunderstorm: "wind",
|
|
6829
|
-
door: "door",
|
|
6830
|
-
door_slam: "door",
|
|
6831
|
-
sliding_door: "door",
|
|
6832
|
-
footsteps: "footsteps",
|
|
6833
|
-
walking: "footsteps",
|
|
6834
|
-
running: "footsteps",
|
|
6835
|
-
crowd: "crowd",
|
|
6836
|
-
chatter: "crowd",
|
|
6837
|
-
cheering: "crowd",
|
|
6838
|
-
applause: "crowd",
|
|
6839
|
-
telephone_ring: "telephone",
|
|
6840
|
-
ringtone: "telephone",
|
|
6841
|
-
engine: "engine",
|
|
6842
|
-
engine_starting: "engine",
|
|
6843
|
-
lawn_mower: "engine",
|
|
6844
|
-
chainsaw: "engine",
|
|
6845
|
-
hammer: "tools",
|
|
6846
|
-
jackhammer: "tools",
|
|
6847
|
-
drill: "tools",
|
|
6848
|
-
power_tool: "tools",
|
|
6849
|
-
silence: "silence"
|
|
6850
|
-
},
|
|
6851
|
-
preserveOriginal: false
|
|
6852
|
-
};
|
|
6853
|
-
var _macroLookup = /* @__PURE__ */ new Map();
|
|
6854
|
-
for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
6855
|
-
for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
6856
|
-
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
6857
|
-
DeviceType["Camera"] = "camera";
|
|
6858
|
-
DeviceType["Hub"] = "hub";
|
|
6859
|
-
DeviceType["Light"] = "light";
|
|
6860
|
-
DeviceType["Siren"] = "siren";
|
|
6861
|
-
DeviceType["Switch"] = "switch";
|
|
6862
|
-
DeviceType["Sensor"] = "sensor";
|
|
6863
|
-
DeviceType["Thermostat"] = "thermostat";
|
|
6864
|
-
DeviceType["Button"] = "button";
|
|
6865
|
-
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
6866
|
-
* event vocabulary verbatim (no normalization). Installed with the
|
|
6867
|
-
* `event-emitter` cap. Sources: HA `event.*` entities (structured) and
|
|
6868
|
-
* HA bus events (e.g. `zha_event`, generic). */
|
|
6869
|
-
DeviceType["EventEmitter"] = "event-emitter";
|
|
6870
|
-
/** Firmware/software update entity — current vs available version,
|
|
6871
|
-
* updatable flag, update state, and an install action. Installed with
|
|
6872
|
-
* the `update` cap. Sources: Homematic firmware-update channels (and
|
|
6873
|
-
* reusable by other providers, e.g. HA `update.*` entities). */
|
|
6874
|
-
DeviceType["Update"] = "update";
|
|
6875
|
-
DeviceType["Generic"] = "generic";
|
|
6876
|
-
/** Generic notification delivery target (HA `notify.<service>`, future
|
|
6877
|
-
* Telegram / Discord / ntfy / SMTP, …). One device per delivery
|
|
6878
|
-
* endpoint; the `notifier` cap defines the send surface. */
|
|
6879
|
-
DeviceType["Notifier"] = "notifier";
|
|
6880
|
-
/** Pre-recorded action sequence with optional parameters
|
|
6881
|
-
* (HA `script.*`). Runnable via `script-runner` cap. */
|
|
6882
|
-
DeviceType["Script"] = "script";
|
|
6883
|
-
/** Automation rule (HA `automation.*`) — enable/disable + manual
|
|
6884
|
-
* trigger surface exposed via `automation-control` cap. */
|
|
6885
|
-
DeviceType["Automation"] = "automation";
|
|
6886
|
-
/** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
|
|
6887
|
-
DeviceType["Lock"] = "lock";
|
|
6888
|
-
/** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
|
|
6889
|
-
* `valve.*`). `cover` cap with sub-roles for variant. */
|
|
6890
|
-
DeviceType["Cover"] = "cover";
|
|
6891
|
-
/** Pipe / water / gas valve with open/close/stop and optional
|
|
6892
|
-
* position (HA `valve.*`). `valve` cap — a cover-sibling actuator
|
|
6893
|
-
* modelled on the same open/closed lifecycle. */
|
|
6894
|
-
DeviceType["Valve"] = "valve";
|
|
6895
|
-
/** Humidifier / dehumidifier with on/off + target humidity + mode
|
|
6896
|
-
* (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
|
|
6897
|
-
* modelled on the same target / mode lifecycle. */
|
|
6898
|
-
DeviceType["Humidifier"] = "humidifier";
|
|
6899
|
-
/** Water heater / boiler with target temperature + operation mode +
|
|
6900
|
-
* away mode (HA `water_heater.*`). `water-heater` cap — a
|
|
6901
|
-
* climate-family actuator. */
|
|
6902
|
-
DeviceType["WaterHeater"] = "water-heater";
|
|
6903
|
-
/** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
|
|
6904
|
-
DeviceType["Fan"] = "fan";
|
|
6905
|
-
/** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
|
|
6906
|
-
* the camera surface — those use `Camera`. `media-player` cap. */
|
|
6907
|
-
DeviceType["MediaPlayer"] = "media-player";
|
|
6908
|
-
/** Security panel / alarm system (HA `alarm_control_panel.*`).
|
|
6909
|
-
* `alarm-panel` cap. */
|
|
6910
|
-
DeviceType["AlarmPanel"] = "alarm-panel";
|
|
6911
|
-
/** Generic user-settable input (HA `number` / `input_number` / `select`
|
|
6912
|
-
* / `input_select` / `text` / `input_text` / `input_datetime`).
|
|
6913
|
-
* Sub-type via `DeviceRole`: NumericControl / SelectControl /
|
|
6914
|
-
* TextControl / DateTimeControl. */
|
|
6915
|
-
DeviceType["Control"] = "control";
|
|
6916
|
-
/** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
|
|
6917
|
-
* `presence` cap. */
|
|
6918
|
-
DeviceType["Presence"] = "presence";
|
|
6919
|
-
/** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
|
|
6920
|
-
* `weather` cap. */
|
|
6921
|
-
DeviceType["Weather"] = "weather";
|
|
6922
|
-
/** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
|
|
6923
|
-
DeviceType["Vacuum"] = "vacuum";
|
|
6924
|
-
/** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
|
|
6925
|
-
* `lawn-mower-control` cap. */
|
|
6926
|
-
DeviceType["LawnMower"] = "lawn-mower";
|
|
6927
|
-
/** Physical HA device group — parent container for entity-children
|
|
6928
|
-
* adopted from a single HA device entry. Not renderable as a
|
|
6929
|
-
* standalone device; exists only to anchor child entities. */
|
|
6930
|
-
DeviceType["Container"] = "container";
|
|
6931
|
-
/** Single still-image entity (HA `image.*`). Read-only display of an
|
|
6932
|
-
* `entity_picture` signed URL the browser loads directly. `image` cap. */
|
|
6933
|
-
DeviceType["Image"] = "image";
|
|
6934
|
-
return DeviceType;
|
|
6313
|
+
DeviceFeature["MotionTrigger"] = "motion-trigger";
|
|
6314
|
+
/** Light supports rgb-triplet color via `color` cap. */
|
|
6315
|
+
DeviceFeature["LightColorRgb"] = "light-color-rgb";
|
|
6316
|
+
/** Light supports HSV color via `color` cap. */
|
|
6317
|
+
DeviceFeature["LightColorHsv"] = "light-color-hsv";
|
|
6318
|
+
/** Light supports color-temperature (mired) via `color` cap. */
|
|
6319
|
+
DeviceFeature["LightColorMired"] = "light-color-mired";
|
|
6320
|
+
/** Thermostat supports a `heat_cool` dual setpoint (targetLow +
|
|
6321
|
+
* targetHigh). Gates the range slider UI. */
|
|
6322
|
+
DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
|
|
6323
|
+
/** Thermostat exposes target humidity and/or current humidity
|
|
6324
|
+
* readings. Gates the humidity controls. */
|
|
6325
|
+
DeviceFeature["ClimateHumidity"] = "climate-humidity";
|
|
6326
|
+
/** Thermostat exposes a fan-mode selector. */
|
|
6327
|
+
DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
|
|
6328
|
+
/** Thermostat exposes preset modes (eco / away / sleep / vendor). */
|
|
6329
|
+
DeviceFeature["ClimatePreset"] = "climate-preset";
|
|
6330
|
+
/** Cover exposes intermediate position control (0..100). Gates the
|
|
6331
|
+
* position slider UI. */
|
|
6332
|
+
DeviceFeature["CoverPositionable"] = "cover-positionable";
|
|
6333
|
+
/** Cover exposes slat-tilt control. Gates the tilt slider UI. */
|
|
6334
|
+
DeviceFeature["CoverTilt"] = "cover-tilt";
|
|
6335
|
+
/** Valve exposes intermediate position control (0..100). Gates the
|
|
6336
|
+
* position slider / drag surface UI. */
|
|
6337
|
+
DeviceFeature["ValvePositionable"] = "valve-positionable";
|
|
6338
|
+
/** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
|
|
6339
|
+
DeviceFeature["FanSpeed"] = "fan-speed";
|
|
6340
|
+
/** Fan exposes a preset mode selector. */
|
|
6341
|
+
DeviceFeature["FanPreset"] = "fan-preset";
|
|
6342
|
+
/** Fan exposes blade direction (forward/reverse) — typical of
|
|
6343
|
+
* ceiling fans. */
|
|
6344
|
+
DeviceFeature["FanDirection"] = "fan-direction";
|
|
6345
|
+
/** Fan exposes an oscillation toggle. */
|
|
6346
|
+
DeviceFeature["FanOscillating"] = "fan-oscillating";
|
|
6347
|
+
/** Lock requires a PIN code on lock/unlock. Gates the code-entry
|
|
6348
|
+
* field on the UI lock-controls panel. */
|
|
6349
|
+
DeviceFeature["LockPinRequired"] = "lock-pin-required";
|
|
6350
|
+
/** Lock supports a latch-release ("open door") action distinct from
|
|
6351
|
+
* unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
|
|
6352
|
+
* `supported_features`. Gates the Open Door button in the UI. */
|
|
6353
|
+
DeviceFeature["LockOpen"] = "lock-open";
|
|
6354
|
+
/** Media player exposes a seek-to-position surface. */
|
|
6355
|
+
DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
|
|
6356
|
+
/** Media player exposes a volume-level setter. */
|
|
6357
|
+
DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
|
|
6358
|
+
/** Media player exposes a mute toggle distinct from volume=0. */
|
|
6359
|
+
DeviceFeature["MediaPlayerMute"] = "media-player-mute";
|
|
6360
|
+
/** Media player exposes a shuffle toggle. */
|
|
6361
|
+
DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
|
|
6362
|
+
/** Media player exposes a repeat mode (off / all / one). */
|
|
6363
|
+
DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
|
|
6364
|
+
/** Media player exposes a source / input selector. */
|
|
6365
|
+
DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
|
|
6366
|
+
/** Media player exposes a play-arbitrary-media surface (URL / id). */
|
|
6367
|
+
DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
|
|
6368
|
+
/** Media player exposes next-track. */
|
|
6369
|
+
DeviceFeature["MediaPlayerNext"] = "media-player-next";
|
|
6370
|
+
/** Media player exposes previous-track. */
|
|
6371
|
+
DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
|
|
6372
|
+
/** Media player exposes stop distinct from pause. */
|
|
6373
|
+
DeviceFeature["MediaPlayerStop"] = "media-player-stop";
|
|
6374
|
+
/** Alarm panel requires a PIN code on arm/disarm. */
|
|
6375
|
+
DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
|
|
6376
|
+
/** Presence device carries GPS coordinates (lat/lng/accuracy) in
|
|
6377
|
+
* addition to a textual location. */
|
|
6378
|
+
DeviceFeature["PresenceGps"] = "presence-gps";
|
|
6379
|
+
/** Notifier accepts an inline / URL image attachment. */
|
|
6380
|
+
DeviceFeature["NotifierImage"] = "notifier-image";
|
|
6381
|
+
/** Notifier accepts a priority hint (high/normal/low). */
|
|
6382
|
+
DeviceFeature["NotifierPriority"] = "notifier-priority";
|
|
6383
|
+
/** Notifier accepts a free-form `data` payload for platform-specific
|
|
6384
|
+
* fields. */
|
|
6385
|
+
DeviceFeature["NotifierData"] = "notifier-data";
|
|
6386
|
+
/** Notifier supports interactive action buttons / callbacks. */
|
|
6387
|
+
DeviceFeature["NotifierActions"] = "notifier-actions";
|
|
6388
|
+
/** Notifier supports per-call recipient targeting (multi-user). */
|
|
6389
|
+
DeviceFeature["NotifierRecipients"] = "notifier-recipients";
|
|
6390
|
+
/** Script runner accepts a variables map on each run invocation. */
|
|
6391
|
+
DeviceFeature["ScriptVariables"] = "script-variables";
|
|
6392
|
+
/** Automation `trigger` accepts a skipCondition flag — fires the
|
|
6393
|
+
* automation's actions while bypassing its condition block. */
|
|
6394
|
+
DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
|
|
6395
|
+
return DeviceFeature;
|
|
6396
|
+
}({});
|
|
6397
|
+
/**
|
|
6398
|
+
* Semantic role a device plays within its parent. Populated by driver
|
|
6399
|
+
* addons when creating accessory devices (Reolink siren/floodlight/
|
|
6400
|
+
* PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
|
|
6401
|
+
* admin UI to pick icons, labels, and widgets — a `Switch` with
|
|
6402
|
+
* `role: Floodlight` renders as a bulb with a brightness slider,
|
|
6403
|
+
* whereas a `Switch` with `role: Siren` renders as a klaxon.
|
|
6404
|
+
*
|
|
6405
|
+
* Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
|
|
6406
|
+
* sqlite as a nullable TEXT column — old rows keep working unchanged.
|
|
6407
|
+
*/
|
|
6408
|
+
var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
6409
|
+
DeviceRole["Siren"] = "siren";
|
|
6410
|
+
DeviceRole["Floodlight"] = "floodlight";
|
|
6411
|
+
DeviceRole["Spotlight"] = "spotlight";
|
|
6412
|
+
DeviceRole["PirSensor"] = "pir-sensor";
|
|
6413
|
+
DeviceRole["Chime"] = "chime";
|
|
6414
|
+
DeviceRole["Autotrack"] = "autotrack";
|
|
6415
|
+
DeviceRole["Nightvision"] = "nightvision";
|
|
6416
|
+
DeviceRole["PrivacyMask"] = "privacy-mask";
|
|
6417
|
+
DeviceRole["Doorbell"] = "doorbell";
|
|
6418
|
+
/** Virtual HA toggle (input_boolean.*) — distinguishable from a
|
|
6419
|
+
* real Switch device for UI rendering / export adapters. */
|
|
6420
|
+
DeviceRole["BinaryHelper"] = "binary-helper";
|
|
6421
|
+
/** Generic motion / occupancy / moving event source. Distinct from
|
|
6422
|
+
* the camera accessory PirSensor role: that one is a camera child;
|
|
6423
|
+
* this is a standalone HA / 3rd-party motion sensor. */
|
|
6424
|
+
DeviceRole["MotionSensor"] = "motion-sensor";
|
|
6425
|
+
DeviceRole["ContactSensor"] = "contact-sensor";
|
|
6426
|
+
DeviceRole["LeakSensor"] = "leak-sensor";
|
|
6427
|
+
DeviceRole["SmokeSensor"] = "smoke-sensor";
|
|
6428
|
+
DeviceRole["COSensor"] = "co-sensor";
|
|
6429
|
+
DeviceRole["GasSensor"] = "gas-sensor";
|
|
6430
|
+
DeviceRole["TamperSensor"] = "tamper-sensor";
|
|
6431
|
+
DeviceRole["VibrationSensor"] = "vibration-sensor";
|
|
6432
|
+
DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
|
|
6433
|
+
DeviceRole["SoundSensor"] = "sound-sensor";
|
|
6434
|
+
/** Fallback for `binary_sensor` without a known `device_class`. */
|
|
6435
|
+
DeviceRole["BinarySensor"] = "binary-sensor";
|
|
6436
|
+
DeviceRole["TemperatureSensor"] = "temperature-sensor";
|
|
6437
|
+
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
6438
|
+
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
6439
|
+
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
6440
|
+
DeviceRole["PowerSensor"] = "power-sensor";
|
|
6441
|
+
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
6442
|
+
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
6443
|
+
DeviceRole["CurrentSensor"] = "current-sensor";
|
|
6444
|
+
DeviceRole["AirQualitySensor"] = "air-quality-sensor";
|
|
6445
|
+
/** Battery level (numeric % via `sensor` OR low-bool via
|
|
6446
|
+
* `binary_sensor` — the cap distinguishes via the value type). */
|
|
6447
|
+
DeviceRole["BatterySensor"] = "battery-sensor";
|
|
6448
|
+
/** Fallback for `sensor` numeric without a known `device_class`. */
|
|
6449
|
+
DeviceRole["NumericSensor"] = "numeric-sensor";
|
|
6450
|
+
/** String / enum state (HA `sensor` with `state_class: enum` or
|
|
6451
|
+
* `attributes.options`). */
|
|
6452
|
+
DeviceRole["EnumSensor"] = "enum-sensor";
|
|
6453
|
+
/** Date / timestamp state (HA `sensor` with `device_class: timestamp`
|
|
6454
|
+
* or `date`). The slice carries the raw ISO string verbatim (hosted on
|
|
6455
|
+
* the `enum-sensor` cap); the UI renders it locale-formatted. */
|
|
6456
|
+
DeviceRole["DateTimeSensor"] = "datetime-sensor";
|
|
6457
|
+
/** Last-resort fallback when nothing else matches. */
|
|
6458
|
+
DeviceRole["GenericSensor"] = "generic-sensor";
|
|
6459
|
+
DeviceRole["NumericControl"] = "numeric-control";
|
|
6460
|
+
DeviceRole["SelectControl"] = "select-control";
|
|
6461
|
+
DeviceRole["TextControl"] = "text-control";
|
|
6462
|
+
DeviceRole["DateTimeControl"] = "datetime-control";
|
|
6463
|
+
/** Mobile push notifier (HA `notify.mobile_app_*`) — supports
|
|
6464
|
+
* rich features (image, priority, channel routing). */
|
|
6465
|
+
DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
|
|
6466
|
+
/** Chat / messaging service (HA `notify.telegram_*`,
|
|
6467
|
+
* `notify.discord_*`, etc.). */
|
|
6468
|
+
DeviceRole["MessagingNotifier"] = "messaging-notifier";
|
|
6469
|
+
/** Email-based delivery (HA `notify.smtp`, etc.). */
|
|
6470
|
+
DeviceRole["EmailNotifier"] = "email-notifier";
|
|
6471
|
+
/** Fallback when the notifier service name doesn't match a known
|
|
6472
|
+
* pattern. */
|
|
6473
|
+
DeviceRole["GenericNotifier"] = "generic-notifier";
|
|
6474
|
+
return DeviceRole;
|
|
6935
6475
|
}({});
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6476
|
+
/**
|
|
6477
|
+
* Generic types for capability definitions.
|
|
6478
|
+
*
|
|
6479
|
+
* A capability is defined with Zod schemas for methods, events, and settings.
|
|
6480
|
+
* TypeScript types are inferred via z.infer<> — zero duplication.
|
|
6481
|
+
*
|
|
6482
|
+
* Pattern:
|
|
6483
|
+
* 1. Define Zod schemas for data, methods, settings
|
|
6484
|
+
* 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
|
|
6485
|
+
* 3. Export type IProvider = InferProvider<typeof capabilityDef>
|
|
6486
|
+
* 4. Addon implements IProvider
|
|
6487
|
+
* 5. Registry auto-mounts tRPC router from definition.methods
|
|
6488
|
+
*/
|
|
6489
|
+
/**
|
|
6490
|
+
* Output schema shared by the contribution + live methods.
|
|
6491
|
+
*
|
|
6492
|
+
* Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
|
|
6493
|
+
* tabs[]) without importing from `../interfaces/config-ui.js` — a
|
|
6494
|
+
* concrete-but-lenient Zod object keeps tRPC output inference happy
|
|
6495
|
+
* (using `z.unknown()` here collapses unrelated router branches to
|
|
6496
|
+
* `unknown` when the generator re-inlines the huge AppRouter type).
|
|
6497
|
+
*
|
|
6498
|
+
* `.passthrough()` on sections/fields accepts whatever FormBuilder
|
|
6499
|
+
* extensions the caller adds (showWhen, displayScale, …) without
|
|
6500
|
+
* rebuilding every time a new field kind is introduced.
|
|
6501
|
+
*/
|
|
6502
|
+
var ContributionSectionSchema = object({
|
|
6503
|
+
id: string(),
|
|
6504
|
+
title: string(),
|
|
6505
|
+
description: string().optional(),
|
|
6506
|
+
style: _enum(["card", "accordion"]).optional(),
|
|
6507
|
+
defaultCollapsed: boolean().optional(),
|
|
6508
|
+
columns: union([
|
|
6509
|
+
literal(1),
|
|
6510
|
+
literal(2),
|
|
6511
|
+
literal(3),
|
|
6512
|
+
literal(4)
|
|
6513
|
+
]).optional(),
|
|
6514
|
+
tab: string().optional(),
|
|
6515
|
+
location: _enum(["settings", "top-tab"]).optional(),
|
|
6516
|
+
order: number().optional(),
|
|
6517
|
+
fields: array(any())
|
|
6518
|
+
});
|
|
6519
|
+
object({
|
|
6520
|
+
tabs: array(object({
|
|
6521
|
+
id: string(),
|
|
6522
|
+
label: string(),
|
|
6523
|
+
icon: string(),
|
|
6524
|
+
order: number().optional()
|
|
6525
|
+
})).optional(),
|
|
6526
|
+
sections: array(ContributionSectionSchema)
|
|
6527
|
+
}).nullable();
|
|
6528
|
+
object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
6529
|
+
deviceId: number(),
|
|
6530
|
+
patch: record(string(), unknown())
|
|
6531
|
+
}), object({ success: literal(true) });
|
|
6532
|
+
object({ deviceId: number() }), unknown().nullable();
|
|
6533
|
+
/** Shorthand to define a method schema */
|
|
6534
|
+
function method(input, output, options) {
|
|
6535
|
+
return {
|
|
6536
|
+
input,
|
|
6537
|
+
output,
|
|
6538
|
+
kind: options?.kind ?? "query",
|
|
6539
|
+
auth: options?.auth ?? "protected",
|
|
6540
|
+
...options?.access !== void 0 ? { access: options.access } : {},
|
|
6541
|
+
timeoutMs: options?.timeoutMs
|
|
6542
|
+
};
|
|
6543
|
+
}
|
|
6544
|
+
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
6545
|
+
var VersionOutputSchema = object({ version: string() });
|
|
6546
|
+
method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
|
|
6547
|
+
/**
|
|
6548
|
+
* device-ops — device-scoped cap that unifies the per-IDevice operations
|
|
6549
|
+
* previously routed through the `.device-ops` Moleculer bridge service.
|
|
6550
|
+
*
|
|
6551
|
+
* Each worker that hosts live `IDevice` instances auto-registers a native
|
|
6552
|
+
* provider for this cap (per device) backed by its local
|
|
6553
|
+
* `DeviceRegistry`. Hub-side callers reach it transparently through
|
|
6554
|
+
* `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
|
|
6555
|
+
* `deviceId` + `nodeId` and dispatches through the standard cap-router,
|
|
6556
|
+
* so there's no parallel bridge path anymore.
|
|
6557
|
+
*
|
|
6558
|
+
* The surface is intentionally small — every method corresponds to a
|
|
6559
|
+
* single action on the live `IDevice` (or `ICameraDevice` for
|
|
6560
|
+
* `getStreamSources`). Richer orchestration (enable/disable with
|
|
6561
|
+
* integration plumbing, bulk updates) stays in the `device-manager` cap;
|
|
6562
|
+
* `device-ops` is the per-device primitive the device-manager routes to.
|
|
6563
|
+
*/
|
|
6564
|
+
var StreamSourceEntrySchema = object({
|
|
6565
|
+
id: string(),
|
|
6566
|
+
label: string(),
|
|
6567
|
+
protocol: _enum([
|
|
6568
|
+
"rtsp",
|
|
6569
|
+
"rtmp",
|
|
6570
|
+
"annexb",
|
|
6571
|
+
"http-mjpeg",
|
|
6572
|
+
"webrtc",
|
|
6573
|
+
"custom"
|
|
6574
|
+
]),
|
|
6575
|
+
url: string().optional(),
|
|
6576
|
+
resolution: object({
|
|
6577
|
+
width: number(),
|
|
6578
|
+
height: number()
|
|
6579
|
+
}).optional(),
|
|
6580
|
+
fps: number().optional(),
|
|
6581
|
+
bitrate: number().optional(),
|
|
6582
|
+
codec: string().optional(),
|
|
6583
|
+
profileHint: CamProfileSchema.optional(),
|
|
6584
|
+
sdp: string().optional()
|
|
6585
|
+
});
|
|
6586
|
+
var ConfigEntrySchema$1 = object({
|
|
6587
|
+
key: string(),
|
|
6588
|
+
value: unknown()
|
|
6589
|
+
});
|
|
6590
|
+
var RawStateResultSchema = object({
|
|
6591
|
+
/** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
|
|
6592
|
+
source: string(),
|
|
6593
|
+
/** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
|
|
6594
|
+
data: record(string(), unknown())
|
|
6595
|
+
});
|
|
6596
|
+
method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
|
|
6597
|
+
deviceId: number(),
|
|
6598
|
+
values: record(string(), unknown())
|
|
6599
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
6600
|
+
deviceId: number(),
|
|
6601
|
+
action: string().min(1),
|
|
6602
|
+
input: unknown()
|
|
6603
|
+
}), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
|
|
6604
|
+
//#endregion
|
|
6605
|
+
//#region ../types/dist/index.mjs
|
|
6606
|
+
/**
|
|
6607
|
+
* Deep wiring healthcheck — snapshot of active reachability probes across
|
|
6608
|
+
* every declared capability + widget of every installed plugin, on every
|
|
6609
|
+
* node. Produced by the backend `WiringHealthService` and surfaced via
|
|
6610
|
+
* `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
|
|
6611
|
+
*
|
|
6612
|
+
* Unlike `/health` (process liveness), this reflects whether each cap/widget
|
|
6613
|
+
* is actually *reachable* over the real cap-dispatch path. See spec
|
|
6614
|
+
* `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
|
|
6615
|
+
*/
|
|
6616
|
+
/** What kind of target a probe addressed. */
|
|
6617
|
+
var wiringProbeKindSchema = _enum([
|
|
6618
|
+
"singleton",
|
|
6619
|
+
"device",
|
|
6620
|
+
"widget"
|
|
6621
|
+
]);
|
|
6622
|
+
/** Result of probing a single (cap|widget [, device]) target. */
|
|
6623
|
+
var wiringProbeResultSchema = object({
|
|
6624
|
+
capName: string(),
|
|
6625
|
+
kind: wiringProbeKindSchema,
|
|
6626
|
+
deviceId: number().optional(),
|
|
6627
|
+
reachable: boolean(),
|
|
6628
|
+
latencyMs: number(),
|
|
6629
|
+
error: string().optional()
|
|
6630
|
+
});
|
|
6631
|
+
/** Per-addon roll-up of cap + widget probe results. */
|
|
6632
|
+
var wiringAddonHealthSchema = object({
|
|
6633
|
+
addonId: string(),
|
|
6634
|
+
caps: array(wiringProbeResultSchema).readonly(),
|
|
6635
|
+
widgets: array(wiringProbeResultSchema).readonly()
|
|
6636
|
+
});
|
|
6637
|
+
/** Per-node roll-up. */
|
|
6638
|
+
var wiringNodeHealthSchema = object({
|
|
6639
|
+
nodeId: string(),
|
|
6640
|
+
addons: array(wiringAddonHealthSchema).readonly()
|
|
6641
|
+
});
|
|
6642
|
+
object({
|
|
6643
|
+
/** True only when every probed target is reachable. */
|
|
6644
|
+
ok: boolean(),
|
|
6645
|
+
/** True when at least one target is unreachable. */
|
|
6646
|
+
degraded: boolean(),
|
|
6647
|
+
checkedAt: string(),
|
|
6648
|
+
nodes: array(wiringNodeHealthSchema).readonly(),
|
|
6649
|
+
summary: object({
|
|
6650
|
+
total: number(),
|
|
6651
|
+
reachable: number(),
|
|
6652
|
+
unreachable: number()
|
|
6653
|
+
})
|
|
6654
|
+
});
|
|
6655
|
+
var MODEL_FORMATS = [
|
|
6656
|
+
"onnx",
|
|
6657
|
+
"coreml",
|
|
6658
|
+
"openvino",
|
|
6659
|
+
"tflite",
|
|
6660
|
+
"pt"
|
|
6661
|
+
];
|
|
6662
|
+
/**
|
|
6663
|
+
* Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
|
|
6664
|
+
* Named `RecordingWeekday` to avoid collision with the string-union
|
|
6665
|
+
* `Weekday` exported from `interfaces/timezones.ts`.
|
|
6666
|
+
*/
|
|
6667
|
+
var RecordingWeekdaySchema = number().int().min(0).max(6);
|
|
6668
|
+
var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
|
|
6669
|
+
var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
|
|
6670
|
+
kind: literal("timeOfDay"),
|
|
6671
|
+
start: string().regex(HHMM),
|
|
6672
|
+
end: string().regex(HHMM),
|
|
6673
|
+
/** Restrict to these weekdays; omit = every day. */
|
|
6674
|
+
days: array(RecordingWeekdaySchema).optional()
|
|
6675
|
+
})]);
|
|
6676
|
+
var RecordingModeSchema = _enum([
|
|
6677
|
+
"continuous",
|
|
6678
|
+
"onMotion",
|
|
6679
|
+
"onAudioThreshold"
|
|
6680
|
+
]);
|
|
6681
|
+
/**
|
|
6682
|
+
* First-class, authoritative per-camera storage mode — the netta choice the UI
|
|
6683
|
+
* reads directly (never inferred from `rules`):
|
|
6684
|
+
* - `off` — not recording.
|
|
6685
|
+
* - `events` — record only around triggers (motion / audio threshold),
|
|
6686
|
+
* with pre/post-buffer.
|
|
6687
|
+
* - `continuous` — record 24/7 within the schedule.
|
|
6688
|
+
*
|
|
6689
|
+
* `mode` compiles one-way to the internal `rules[]` consumed by the policy
|
|
6690
|
+
* engine (see `compileRules`); `rules[]` is never authored directly anymore.
|
|
6691
|
+
*/
|
|
6692
|
+
var RecordingStorageModeSchema = _enum([
|
|
6693
|
+
"off",
|
|
6694
|
+
"events",
|
|
6695
|
+
"continuous"
|
|
6696
|
+
]);
|
|
6697
|
+
/** Which detectors trigger an `events`-mode recording. */
|
|
6698
|
+
var RecordingTriggersSchema = object({
|
|
6699
|
+
motion: boolean().optional(),
|
|
6700
|
+
audioThresholdDbfs: number().optional()
|
|
6701
|
+
});
|
|
6702
|
+
/**
|
|
6703
|
+
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
6704
|
+
*
|
|
6705
|
+
* Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
|
|
6706
|
+
* only ever `continuous` or `events`; "off" is expressed by the absence of a
|
|
6707
|
+
* covering band, not by a band value.
|
|
6708
|
+
*/
|
|
6709
|
+
var RecordingBandModeSchema = _enum(["continuous", "events"]);
|
|
6710
|
+
/**
|
|
6711
|
+
* Triggers for an `events`-mode band. Identical shape to
|
|
6712
|
+
* `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
|
|
6713
|
+
* two never drift.
|
|
6714
|
+
*/
|
|
6715
|
+
var RecordingBandTriggersSchema = RecordingTriggersSchema;
|
|
6716
|
+
/**
|
|
6717
|
+
* A single mode-per-band window — the canonical recorder band shape, the
|
|
6718
|
+
* single source of truth re-used by `addon-pipeline/recorder`.
|
|
6719
|
+
*
|
|
6720
|
+
* `days` lists the weekdays the band covers (empty = every day, matching the
|
|
6721
|
+
* band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
|
|
6722
|
+
* span wraps past midnight (handled by the band engine).
|
|
6723
|
+
*/
|
|
6724
|
+
var RecordingBandSchema = object({
|
|
6725
|
+
days: array(RecordingWeekdaySchema),
|
|
6726
|
+
start: string().regex(HHMM),
|
|
6727
|
+
end: string().regex(HHMM),
|
|
6728
|
+
mode: RecordingBandModeSchema,
|
|
6729
|
+
triggers: RecordingBandTriggersSchema.optional(),
|
|
6730
|
+
preBufferSec: number().min(0).optional(),
|
|
6731
|
+
postBufferSec: number().min(0).optional()
|
|
6732
|
+
});
|
|
6733
|
+
var RecordingRuleSchema = object({
|
|
6734
|
+
schedule: RecordingScheduleSchema,
|
|
6735
|
+
mode: RecordingModeSchema,
|
|
6736
|
+
/** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
|
|
6737
|
+
preBufferSec: number().min(0).default(0),
|
|
6738
|
+
/** Keep recording until this many seconds after the last trigger. */
|
|
6739
|
+
postBufferSec: number().min(0).default(0),
|
|
6740
|
+
/** Each new trigger restarts the post-buffer window. */
|
|
6741
|
+
resetTimeoutOnNewEvent: boolean().default(true),
|
|
6742
|
+
/** onAudioThreshold only — dBFS level that counts as a trigger. */
|
|
6743
|
+
thresholdDbfs: number().optional()
|
|
6744
|
+
});
|
|
6745
|
+
/**
|
|
6746
|
+
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
6747
|
+
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
6748
|
+
* live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
|
|
6749
|
+
* (when the volume is too full to keep recording) is NOT a per-camera concern —
|
|
6750
|
+
* it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
|
|
6751
|
+
* shared by every camera writing to that volume.
|
|
6752
|
+
*/
|
|
6753
|
+
var RecordingRetentionSchema = object({
|
|
6754
|
+
maxAgeDays: number().min(0).optional(),
|
|
6755
|
+
maxSizeGb: number().min(0).optional()
|
|
6756
|
+
});
|
|
6757
|
+
/**
|
|
6758
|
+
* The full per-camera recording intent — the wire shape of a RecordingTarget.
|
|
6759
|
+
*
|
|
6760
|
+
* `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
|
|
6761
|
+
* are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
|
|
6762
|
+
* only for transition + migration (`migrateRulesToMode`); the policy engine
|
|
6763
|
+
* consumes the compiled output of `compileRules(config)`, never `rules` directly.
|
|
6764
|
+
*/
|
|
6765
|
+
var RecordingConfigSchema = object({
|
|
6766
|
+
enabled: boolean(),
|
|
6767
|
+
/** Authoritative storage mode. Absent on legacy targets → derived once via
|
|
6768
|
+
* `migrateRulesToMode`, then persisted. */
|
|
6769
|
+
mode: RecordingStorageModeSchema.optional(),
|
|
6770
|
+
profiles: array(CamProfileSchema).optional(),
|
|
6771
|
+
segmentSeconds: number().int().positive().optional(),
|
|
6772
|
+
/** Shared recording time-bands for `events` & `continuous` — record only when
|
|
6773
|
+
* the wall-clock falls inside one of these windows. Omit or empty = always.
|
|
6774
|
+
* `continuous` compiles to one rule per band; `events` to band × trigger. */
|
|
6775
|
+
schedules: array(RecordingScheduleSchema).optional(),
|
|
6776
|
+
/** Legacy single-band predecessor of `schedules`. Read-compat only — it is
|
|
6777
|
+
* normalized into `schedules` on read and never written going forward. (Not
|
|
6778
|
+
* tagged `@deprecated`: the normalization paths must read it cast-free.) */
|
|
6779
|
+
schedule: RecordingScheduleSchema.optional(),
|
|
6780
|
+
/** `events`-mode only — which detectors trigger a recording. */
|
|
6781
|
+
triggers: RecordingTriggersSchema.optional(),
|
|
6782
|
+
/** `events`-mode only — seconds retained before / after a trigger. */
|
|
6783
|
+
preBufferSec: number().min(0).optional(),
|
|
6784
|
+
postBufferSec: number().min(0).optional(),
|
|
6785
|
+
/** DEPRECATED authoring input; retained for migration/transition. */
|
|
6786
|
+
rules: array(RecordingRuleSchema).optional(),
|
|
6787
|
+
/**
|
|
6788
|
+
* AUTHORITATIVE mode-per-band recording model (recorder). When present it
|
|
6789
|
+
* is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
|
|
6790
|
+
* `triggers`/`rules` fields above are kept for READ-COMPAT only and are
|
|
6791
|
+
* derived into bands once via `migrateConfigToBands`.
|
|
6792
|
+
*/
|
|
6793
|
+
bands: array(RecordingBandSchema).optional(),
|
|
6794
|
+
retention: RecordingRetentionSchema.optional()
|
|
6795
|
+
});
|
|
6796
|
+
/**
|
|
6797
|
+
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
6798
|
+
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
6799
|
+
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
6800
|
+
* without forming a circular import. The `storage` cap re-exports it
|
|
6801
|
+
* verbatim for back-compat.
|
|
6802
|
+
*
|
|
6803
|
+
* This Zod schema is the **authoritative source** for `StorageLocationType`.
|
|
6804
|
+
* The TS alias in `./storage.ts` re-exports `z.infer<typeof
|
|
6805
|
+
* StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
|
|
6806
|
+
* `IStorageProvider` interface stay in lockstep.
|
|
6807
|
+
*
|
|
6808
|
+
* The type is now an **open string** (not a closed enum) — addons declare
|
|
6809
|
+
* their own location kinds via `StorageLocationDeclaration.id`. The regex
|
|
6810
|
+
* enforces a safe id format: lowercase-start, alphanumeric + hyphens.
|
|
6811
|
+
*/
|
|
6812
|
+
var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
6813
|
+
/**
|
|
6814
|
+
* Persisted record for a storage location instance. Operators can register
|
|
6815
|
+
* multiple instances for multi-cardinality types (e.g. two `backups`
|
|
6816
|
+
* locations with different `providerId`s). Cardinality is now declared per
|
|
6817
|
+
* location via `StorageLocationDeclaration.cardinality` — the static
|
|
6818
|
+
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
6819
|
+
*
|
|
6820
|
+
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
6821
|
+
* The default location for a type uses `id === <type>:default` by
|
|
6822
|
+
* convention (the bare type ref like `'backups'` resolves to it).
|
|
6823
|
+
*
|
|
6824
|
+
* `isSystem: true` marks a location as orchestrator-seeded and
|
|
6825
|
+
* undeletable. The bootstrap-installed defaults (one per type) carry
|
|
6826
|
+
* this flag; operator-added locations don't. Editing the config of
|
|
6827
|
+
* a system location is allowed (path migration, provider swap) but
|
|
6828
|
+
* deleting it is rejected at the cap level.
|
|
6829
|
+
*/
|
|
6830
|
+
var StorageLocationSchema = object({
|
|
6831
|
+
id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
|
|
6832
|
+
type: string(),
|
|
6833
|
+
displayName: string().min(1),
|
|
6834
|
+
providerId: string().min(1),
|
|
6835
|
+
config: record(string(), unknown()),
|
|
6836
|
+
/**
|
|
6837
|
+
* Cluster node this location physically lives on. REQUIRED for node-local
|
|
6838
|
+
* providers (filesystem — the path exists on one node's disk), null/absent
|
|
6839
|
+
* for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
|
|
6840
|
+
* `'hub'` is the hub node. Validated against the provider's `nodeLocal`
|
|
6841
|
+
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
6842
|
+
*/
|
|
6843
|
+
nodeId: string().optional(),
|
|
6844
|
+
isDefault: boolean().default(false),
|
|
6845
|
+
isSystem: boolean().default(false),
|
|
6846
|
+
createdAt: number(),
|
|
6847
|
+
updatedAt: number()
|
|
6848
|
+
});
|
|
6849
|
+
/**
|
|
6850
|
+
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
6851
|
+
* Either:
|
|
6852
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
|
|
6853
|
+
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
6854
|
+
*
|
|
6855
|
+
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
6856
|
+
*/
|
|
6857
|
+
var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
|
|
6858
|
+
/**
|
|
6859
|
+
* `StorageLocationDeclaration` — a single storage-location entry declared by
|
|
6860
|
+
* an addon in its `package.json` under `camstack.storageLocations`.
|
|
6861
|
+
*
|
|
6862
|
+
* Design intent:
|
|
6863
|
+
* - **Addon declares its needs** — each addon describes the logical storage
|
|
6864
|
+
* slots it requires (e.g. `recordings`, `recordingsLow`) without caring
|
|
6865
|
+
* about the physical path.
|
|
6866
|
+
* - **Kernel aggregates** — at boot the kernel collects declarations from all
|
|
6867
|
+
* installed addons, deduplicates by `id`, and exposes the union via the
|
|
6868
|
+
* storage-locations settings surface.
|
|
6869
|
+
* - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
|
|
6870
|
+
* at least one instance named `<id>:default` is present, using
|
|
6871
|
+
* `defaultsTo` to inherit the resolved root from another location when the
|
|
6872
|
+
* declaration is a derivative slot (e.g. `recordingsLow` defaults to
|
|
6873
|
+
* `recordings`).
|
|
6874
|
+
* - **ids are global** — `id` values are shared across the entire deployment;
|
|
6875
|
+
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
6876
|
+
* at kernel aggregation time, not here).
|
|
6877
|
+
*/
|
|
6878
|
+
var StorageLocationDeclarationSchema = object({
|
|
6879
|
+
/**
|
|
6880
|
+
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
6881
|
+
* Must start with a lowercase letter and may contain letters, digits, and
|
|
6882
|
+
* hyphens.
|
|
6883
|
+
*/
|
|
6884
|
+
id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
|
|
6885
|
+
/** Human-readable name shown in the admin UI. */
|
|
6886
|
+
displayName: string().min(1, { message: "displayName must not be empty" }),
|
|
6887
|
+
/** Optional longer explanation of what data this location stores. */
|
|
6888
|
+
description: string().optional(),
|
|
6889
|
+
/**
|
|
6890
|
+
* `single` — exactly one instance of this location is allowed system-wide
|
|
6891
|
+
* (e.g. `logs`, `models`). The operator can edit it but not add more.
|
|
6892
|
+
* `multi` — the operator may register several instances (e.g. a second
|
|
6893
|
+
* `recordings` on a NAS for disk tiering); one is the default at any time.
|
|
6894
|
+
*/
|
|
6895
|
+
cardinality: _enum(["single", "multi"]),
|
|
6896
|
+
/**
|
|
6897
|
+
* When set, the default instance for this location inherits its resolved
|
|
6898
|
+
* root from the named location's default instance. Useful for derivative
|
|
6899
|
+
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
6900
|
+
* configure the primary location.
|
|
6901
|
+
*/
|
|
6902
|
+
defaultsTo: string().optional()
|
|
6903
|
+
});
|
|
6904
|
+
var DecoderStatsSchema = object({
|
|
6905
|
+
inputFps: number(),
|
|
6906
|
+
outputFps: number(),
|
|
6907
|
+
avgDecodeTimeMs: number(),
|
|
6908
|
+
droppedFrames: number()
|
|
6909
|
+
});
|
|
6910
|
+
var DecoderSessionConfigSchema = object({
|
|
6911
|
+
codec: string(),
|
|
6912
|
+
maxFps: number().default(0),
|
|
6913
|
+
outputFormat: _enum([
|
|
6914
|
+
"jpeg",
|
|
6915
|
+
"rgb",
|
|
6916
|
+
"bgr",
|
|
6917
|
+
"yuv420",
|
|
6918
|
+
"gray"
|
|
6919
|
+
]).default("jpeg"),
|
|
6920
|
+
scale: number().default(1),
|
|
6921
|
+
width: number().optional(),
|
|
6922
|
+
height: number().optional(),
|
|
6939
6923
|
/**
|
|
6940
|
-
*
|
|
6941
|
-
*
|
|
6942
|
-
*
|
|
6924
|
+
* Identifier of the camera this decoder session serves. Optional
|
|
6925
|
+
* because the cap is generic (any caller could request decode), but
|
|
6926
|
+
* stream-broker passes it so decoder logs include `deviceId` for
|
|
6927
|
+
* per-camera filtering when diagnosing failures (e.g. node-av
|
|
6928
|
+
* sendPacket errors on a single hung camera).
|
|
6943
6929
|
*/
|
|
6944
|
-
|
|
6945
|
-
DeviceFeature["NativeSnapshot"] = "native-snapshot";
|
|
6946
|
-
DeviceFeature["DoorbellButton"] = "doorbell-button";
|
|
6947
|
-
DeviceFeature["TwoWayAudio"] = "two-way-audio";
|
|
6948
|
-
DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
|
|
6930
|
+
deviceId: number().int().nonnegative().optional(),
|
|
6949
6931
|
/**
|
|
6950
|
-
*
|
|
6951
|
-
*
|
|
6952
|
-
*
|
|
6953
|
-
*
|
|
6954
|
-
* the cap registry. Mirrors `ptz-autotrack` cap registration:
|
|
6955
|
-
* driver sets this feature when probe confirms the firmware
|
|
6956
|
-
* surface, and registers the cap in the same code path.
|
|
6932
|
+
* Free-form tag for log scoping. Stream-broker uses
|
|
6933
|
+
* `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
|
|
6934
|
+
* on every line so `grep tag=broker:5/high` filters one camera
|
|
6935
|
+
* profile cleanly.
|
|
6957
6936
|
*/
|
|
6958
|
-
|
|
6937
|
+
tag: string().optional(),
|
|
6959
6938
|
/**
|
|
6960
|
-
*
|
|
6961
|
-
* motion detection automatically activates this device. Mirrors
|
|
6962
|
-
* `motion-trigger` cap registration: drivers set this feature in the
|
|
6963
|
-
* same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
|
|
6939
|
+
* Where the session delivers decoded frames (Phase 5 / D9):
|
|
6964
6940
|
*
|
|
6965
|
-
*
|
|
6966
|
-
*
|
|
6967
|
-
*
|
|
6941
|
+
* - `'callback'` (default) — the legacy pixel path: decoded frames are
|
|
6942
|
+
* buffered as `DecodedFrame`s and drained via `pullFrames`.
|
|
6943
|
+
* - `'shm'` — the shared-memory frame plane: decoded frames are written
|
|
6944
|
+
* into an OS shared-memory ring and drained as zero-pixel
|
|
6945
|
+
* `FrameHandle`s via `pullHandles`. A session is one mode or the
|
|
6946
|
+
* other — `pullFrames` returns nothing for an `'shm'` session and
|
|
6947
|
+
* `pullHandles` returns nothing for a `'callback'` session.
|
|
6968
6948
|
*/
|
|
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
|
-
|
|
7121
|
-
|
|
7122
|
-
|
|
7123
|
-
|
|
7124
|
-
|
|
7125
|
-
|
|
7126
|
-
|
|
7127
|
-
|
|
7128
|
-
|
|
7129
|
-
|
|
7130
|
-
|
|
7131
|
-
|
|
6949
|
+
frameSink: _enum(["callback", "shm"]).default("callback")
|
|
6950
|
+
});
|
|
6951
|
+
var EncodeProfileSchema = object({
|
|
6952
|
+
video: object({
|
|
6953
|
+
codec: _enum([
|
|
6954
|
+
"h264",
|
|
6955
|
+
"h265",
|
|
6956
|
+
"copy"
|
|
6957
|
+
]),
|
|
6958
|
+
profile: _enum([
|
|
6959
|
+
"baseline",
|
|
6960
|
+
"main",
|
|
6961
|
+
"high"
|
|
6962
|
+
]).optional(),
|
|
6963
|
+
width: number().int().positive().optional(),
|
|
6964
|
+
height: number().int().positive().optional(),
|
|
6965
|
+
fps: number().positive().optional(),
|
|
6966
|
+
bitrateKbps: number().int().positive().optional(),
|
|
6967
|
+
gopFrames: number().int().positive().optional(),
|
|
6968
|
+
bf: number().int().min(0).optional(),
|
|
6969
|
+
preset: _enum([
|
|
6970
|
+
"ultrafast",
|
|
6971
|
+
"superfast",
|
|
6972
|
+
"veryfast",
|
|
6973
|
+
"faster",
|
|
6974
|
+
"fast",
|
|
6975
|
+
"medium"
|
|
6976
|
+
]).optional(),
|
|
6977
|
+
tune: _enum([
|
|
6978
|
+
"zerolatency",
|
|
6979
|
+
"film",
|
|
6980
|
+
"animation"
|
|
6981
|
+
]).optional()
|
|
6982
|
+
}),
|
|
6983
|
+
audio: union([literal("passthrough"), object({
|
|
6984
|
+
codec: _enum([
|
|
6985
|
+
"opus",
|
|
6986
|
+
"aac",
|
|
6987
|
+
"pcmu",
|
|
6988
|
+
"pcma",
|
|
6989
|
+
"copy"
|
|
6990
|
+
]),
|
|
6991
|
+
bitrateKbps: number().int().positive().optional(),
|
|
6992
|
+
sampleRateHz: number().int().positive().optional(),
|
|
6993
|
+
channels: union([literal(1), literal(2)]).optional()
|
|
6994
|
+
})]),
|
|
6995
|
+
/**
|
|
6996
|
+
* ffmpeg input-side args, inserted between the fixed global flags
|
|
6997
|
+
* (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
|
|
6998
|
+
* — the widget surfaces a textarea + suggestion chips for the most-
|
|
6999
|
+
* used demuxer/format options.
|
|
7000
|
+
*/
|
|
7001
|
+
inputArgs: array(string()).optional(),
|
|
7002
|
+
/**
|
|
7003
|
+
* ffmpeg output-side args, inserted between the encode block and
|
|
7004
|
+
* the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
|
|
7005
|
+
* filters, codec-specific overrides. Free-text array.
|
|
7006
|
+
*/
|
|
7007
|
+
outputArgs: array(string()).optional()
|
|
7008
|
+
});
|
|
7009
|
+
var YAMNET_TO_MACRO = {
|
|
7010
|
+
mapping: {
|
|
7011
|
+
Speech: "speech",
|
|
7012
|
+
"Child speech, kid speaking": "speech",
|
|
7013
|
+
Conversation: "speech",
|
|
7014
|
+
"Narration, monologue": "speech",
|
|
7015
|
+
Babbling: "speech",
|
|
7016
|
+
Whispering: "speech",
|
|
7017
|
+
"Speech synthesizer": "speech",
|
|
7018
|
+
Humming: "speech",
|
|
7019
|
+
Rapping: "speech",
|
|
7020
|
+
Singing: "speech",
|
|
7021
|
+
Choir: "speech",
|
|
7022
|
+
"Child singing": "speech",
|
|
7023
|
+
Shout: "scream",
|
|
7024
|
+
Bellow: "scream",
|
|
7025
|
+
Yell: "scream",
|
|
7026
|
+
Screaming: "scream",
|
|
7027
|
+
"Children shouting": "scream",
|
|
7028
|
+
Whoop: "scream",
|
|
7029
|
+
"Crying, sobbing": "crying",
|
|
7030
|
+
"Baby cry, infant cry": "crying",
|
|
7031
|
+
Whimper: "crying",
|
|
7032
|
+
"Wail, moan": "crying",
|
|
7033
|
+
Groan: "crying",
|
|
7034
|
+
Laughter: "laughter",
|
|
7035
|
+
"Baby laughter": "laughter",
|
|
7036
|
+
Giggle: "laughter",
|
|
7037
|
+
Snicker: "laughter",
|
|
7038
|
+
"Belly laugh": "laughter",
|
|
7039
|
+
"Chuckle, chortle": "laughter",
|
|
7040
|
+
Music: "music",
|
|
7041
|
+
"Musical instrument": "music",
|
|
7042
|
+
Guitar: "music",
|
|
7043
|
+
Piano: "music",
|
|
7044
|
+
Drum: "music",
|
|
7045
|
+
"Drum kit": "music",
|
|
7046
|
+
"Violin, fiddle": "music",
|
|
7047
|
+
Flute: "music",
|
|
7048
|
+
Saxophone: "music",
|
|
7049
|
+
Trumpet: "music",
|
|
7050
|
+
Synthesizer: "music",
|
|
7051
|
+
"Pop music": "music",
|
|
7052
|
+
"Rock music": "music",
|
|
7053
|
+
"Hip hop music": "music",
|
|
7054
|
+
"Classical music": "music",
|
|
7055
|
+
Jazz: "music",
|
|
7056
|
+
"Electronic music": "music",
|
|
7057
|
+
"Background music": "music",
|
|
7058
|
+
Dog: "dog",
|
|
7059
|
+
Bark: "dog",
|
|
7060
|
+
Yip: "dog",
|
|
7061
|
+
Howl: "dog",
|
|
7062
|
+
"Bow-wow": "dog",
|
|
7063
|
+
Growling: "dog",
|
|
7064
|
+
"Whimper (dog)": "dog",
|
|
7065
|
+
Cat: "cat",
|
|
7066
|
+
Purr: "cat",
|
|
7067
|
+
Meow: "cat",
|
|
7068
|
+
Hiss: "cat",
|
|
7069
|
+
Caterwaul: "cat",
|
|
7070
|
+
Bird: "bird",
|
|
7071
|
+
"Bird vocalization, bird call, bird song": "bird",
|
|
7072
|
+
"Chirp, tweet": "bird",
|
|
7073
|
+
Squawk: "bird",
|
|
7074
|
+
Crow: "bird",
|
|
7075
|
+
Owl: "bird",
|
|
7076
|
+
"Pigeon, dove": "bird",
|
|
7077
|
+
Animal: "animal",
|
|
7078
|
+
"Domestic animals, pets": "animal",
|
|
7079
|
+
"Livestock, farm animals, working animals": "animal",
|
|
7080
|
+
Horse: "animal",
|
|
7081
|
+
"Cattle, bovinae": "animal",
|
|
7082
|
+
Pig: "animal",
|
|
7083
|
+
Sheep: "animal",
|
|
7084
|
+
Goat: "animal",
|
|
7085
|
+
Frog: "animal",
|
|
7086
|
+
Insect: "animal",
|
|
7087
|
+
Cricket: "animal",
|
|
7088
|
+
Alarm: "alarm",
|
|
7089
|
+
"Alarm clock": "alarm",
|
|
7090
|
+
"Smoke detector, smoke alarm": "alarm",
|
|
7091
|
+
"Fire alarm": "alarm",
|
|
7092
|
+
Buzzer: "alarm",
|
|
7093
|
+
"Civil defense siren": "alarm",
|
|
7094
|
+
"Car alarm": "alarm",
|
|
7095
|
+
Siren: "siren",
|
|
7096
|
+
"Police car (siren)": "siren",
|
|
7097
|
+
"Ambulance (siren)": "siren",
|
|
7098
|
+
"Fire engine, fire truck (siren)": "siren",
|
|
7099
|
+
"Emergency vehicle": "siren",
|
|
7100
|
+
Foghorn: "siren",
|
|
7101
|
+
Doorbell: "doorbell",
|
|
7102
|
+
"Ding-dong": "doorbell",
|
|
7103
|
+
Knock: "doorbell",
|
|
7104
|
+
Tap: "doorbell",
|
|
7105
|
+
Glass: "glass_breaking",
|
|
7106
|
+
Shatter: "glass_breaking",
|
|
7107
|
+
"Chink, clink": "glass_breaking",
|
|
7108
|
+
"Gunshot, gunfire": "gunshot",
|
|
7109
|
+
"Machine gun": "gunshot",
|
|
7110
|
+
Explosion: "gunshot",
|
|
7111
|
+
Fireworks: "gunshot",
|
|
7112
|
+
Firecracker: "gunshot",
|
|
7113
|
+
"Artillery fire": "gunshot",
|
|
7114
|
+
"Cap gun": "gunshot",
|
|
7115
|
+
Boom: "gunshot",
|
|
7116
|
+
Vehicle: "vehicle",
|
|
7117
|
+
Car: "vehicle",
|
|
7118
|
+
Truck: "vehicle",
|
|
7119
|
+
Bus: "vehicle",
|
|
7120
|
+
Motorcycle: "vehicle",
|
|
7121
|
+
"Car passing by": "vehicle",
|
|
7122
|
+
"Vehicle horn, car horn, honking": "vehicle",
|
|
7123
|
+
"Traffic noise, roadway noise": "vehicle",
|
|
7124
|
+
Train: "vehicle",
|
|
7125
|
+
Aircraft: "vehicle",
|
|
7126
|
+
Helicopter: "vehicle",
|
|
7127
|
+
Bicycle: "vehicle",
|
|
7128
|
+
Skateboard: "vehicle",
|
|
7129
|
+
Fire: "fire",
|
|
7130
|
+
Crackle: "fire",
|
|
7131
|
+
Water: "water",
|
|
7132
|
+
Rain: "water",
|
|
7133
|
+
Raindrop: "water",
|
|
7134
|
+
"Rain on surface": "water",
|
|
7135
|
+
Stream: "water",
|
|
7136
|
+
Waterfall: "water",
|
|
7137
|
+
Ocean: "water",
|
|
7138
|
+
"Waves, surf": "water",
|
|
7139
|
+
"Splash, splatter": "water",
|
|
7140
|
+
Wind: "wind",
|
|
7141
|
+
Thunderstorm: "wind",
|
|
7142
|
+
Thunder: "wind",
|
|
7143
|
+
"Wind noise (microphone)": "wind",
|
|
7144
|
+
"Rustling leaves": "wind",
|
|
7145
|
+
Door: "door",
|
|
7146
|
+
"Sliding door": "door",
|
|
7147
|
+
Slam: "door",
|
|
7148
|
+
"Cupboard open or close": "door",
|
|
7149
|
+
"Walk, footsteps": "footsteps",
|
|
7150
|
+
Run: "footsteps",
|
|
7151
|
+
Shuffle: "footsteps",
|
|
7152
|
+
Crowd: "crowd",
|
|
7153
|
+
Chatter: "crowd",
|
|
7154
|
+
Cheering: "crowd",
|
|
7155
|
+
Applause: "crowd",
|
|
7156
|
+
"Children playing": "crowd",
|
|
7157
|
+
"Hubbub, speech noise, speech babble": "crowd",
|
|
7158
|
+
Telephone: "telephone",
|
|
7159
|
+
"Telephone bell ringing": "telephone",
|
|
7160
|
+
Ringtone: "telephone",
|
|
7161
|
+
"Telephone dialing, DTMF": "telephone",
|
|
7162
|
+
"Busy signal": "telephone",
|
|
7163
|
+
Engine: "engine",
|
|
7164
|
+
"Engine starting": "engine",
|
|
7165
|
+
Idling: "engine",
|
|
7166
|
+
"Accelerating, revving, vroom": "engine",
|
|
7167
|
+
"Light engine (high frequency)": "engine",
|
|
7168
|
+
"Medium engine (mid frequency)": "engine",
|
|
7169
|
+
"Heavy engine (low frequency)": "engine",
|
|
7170
|
+
"Lawn mower": "engine",
|
|
7171
|
+
Chainsaw: "engine",
|
|
7172
|
+
Hammer: "tools",
|
|
7173
|
+
Jackhammer: "tools",
|
|
7174
|
+
Sawing: "tools",
|
|
7175
|
+
"Power tool": "tools",
|
|
7176
|
+
Drill: "tools",
|
|
7177
|
+
Sanding: "tools",
|
|
7178
|
+
Silence: "silence"
|
|
7179
|
+
},
|
|
7180
|
+
preserveOriginal: false
|
|
7181
|
+
};
|
|
7182
|
+
var APPLE_SA_TO_MACRO = {
|
|
7183
|
+
mapping: {
|
|
7184
|
+
speech: "speech",
|
|
7185
|
+
child_speech: "speech",
|
|
7186
|
+
conversation: "speech",
|
|
7187
|
+
whispering: "speech",
|
|
7188
|
+
singing: "speech",
|
|
7189
|
+
humming: "speech",
|
|
7190
|
+
shout: "scream",
|
|
7191
|
+
yell: "scream",
|
|
7192
|
+
screaming: "scream",
|
|
7193
|
+
crying: "crying",
|
|
7194
|
+
baby_crying: "crying",
|
|
7195
|
+
sobbing: "crying",
|
|
7196
|
+
laughter: "laughter",
|
|
7197
|
+
baby_laughter: "laughter",
|
|
7198
|
+
giggling: "laughter",
|
|
7199
|
+
music: "music",
|
|
7200
|
+
guitar: "music",
|
|
7201
|
+
piano: "music",
|
|
7202
|
+
drums: "music",
|
|
7203
|
+
dog_bark: "dog",
|
|
7204
|
+
dog_bow_wow: "dog",
|
|
7205
|
+
dog_growling: "dog",
|
|
7206
|
+
dog_howl: "dog",
|
|
7207
|
+
cat_meow: "cat",
|
|
7208
|
+
cat_purr: "cat",
|
|
7209
|
+
cat_hiss: "cat",
|
|
7210
|
+
bird: "bird",
|
|
7211
|
+
bird_chirp: "bird",
|
|
7212
|
+
bird_squawk: "bird",
|
|
7213
|
+
animal: "animal",
|
|
7214
|
+
horse: "animal",
|
|
7215
|
+
cow_moo: "animal",
|
|
7216
|
+
insect: "animal",
|
|
7217
|
+
alarm: "alarm",
|
|
7218
|
+
smoke_alarm: "alarm",
|
|
7219
|
+
fire_alarm: "alarm",
|
|
7220
|
+
car_alarm: "alarm",
|
|
7221
|
+
siren: "siren",
|
|
7222
|
+
police_siren: "siren",
|
|
7223
|
+
ambulance_siren: "siren",
|
|
7224
|
+
doorbell: "doorbell",
|
|
7225
|
+
door_knock: "doorbell",
|
|
7226
|
+
knocking: "doorbell",
|
|
7227
|
+
glass_breaking: "glass_breaking",
|
|
7228
|
+
glass_shatter: "glass_breaking",
|
|
7229
|
+
gunshot: "gunshot",
|
|
7230
|
+
explosion: "gunshot",
|
|
7231
|
+
fireworks: "gunshot",
|
|
7232
|
+
car: "vehicle",
|
|
7233
|
+
truck: "vehicle",
|
|
7234
|
+
motorcycle: "vehicle",
|
|
7235
|
+
car_horn: "vehicle",
|
|
7236
|
+
vehicle_horn: "vehicle",
|
|
7237
|
+
traffic: "vehicle",
|
|
7238
|
+
fire: "fire",
|
|
7239
|
+
fire_crackle: "fire",
|
|
7240
|
+
water: "water",
|
|
7241
|
+
rain: "water",
|
|
7242
|
+
ocean: "water",
|
|
7243
|
+
splash: "water",
|
|
7244
|
+
wind: "wind",
|
|
7245
|
+
thunder: "wind",
|
|
7246
|
+
thunderstorm: "wind",
|
|
7247
|
+
door: "door",
|
|
7248
|
+
door_slam: "door",
|
|
7249
|
+
sliding_door: "door",
|
|
7250
|
+
footsteps: "footsteps",
|
|
7251
|
+
walking: "footsteps",
|
|
7252
|
+
running: "footsteps",
|
|
7253
|
+
crowd: "crowd",
|
|
7254
|
+
chatter: "crowd",
|
|
7255
|
+
cheering: "crowd",
|
|
7256
|
+
applause: "crowd",
|
|
7257
|
+
telephone_ring: "telephone",
|
|
7258
|
+
ringtone: "telephone",
|
|
7259
|
+
engine: "engine",
|
|
7260
|
+
engine_starting: "engine",
|
|
7261
|
+
lawn_mower: "engine",
|
|
7262
|
+
chainsaw: "engine",
|
|
7263
|
+
hammer: "tools",
|
|
7264
|
+
jackhammer: "tools",
|
|
7265
|
+
drill: "tools",
|
|
7266
|
+
power_tool: "tools",
|
|
7267
|
+
silence: "silence"
|
|
7268
|
+
},
|
|
7269
|
+
preserveOriginal: false
|
|
7270
|
+
};
|
|
7271
|
+
var _macroLookup = /* @__PURE__ */ new Map();
|
|
7272
|
+
for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7273
|
+
for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7132
7274
|
/**
|
|
7133
7275
|
* Accessory device helpers — shared across drivers.
|
|
7134
7276
|
*
|
|
@@ -7288,74 +7430,6 @@ object({
|
|
|
7288
7430
|
});
|
|
7289
7431
|
DeviceType.Sensor;
|
|
7290
7432
|
/**
|
|
7291
|
-
* Generic types for capability definitions.
|
|
7292
|
-
*
|
|
7293
|
-
* A capability is defined with Zod schemas for methods, events, and settings.
|
|
7294
|
-
* TypeScript types are inferred via z.infer<> — zero duplication.
|
|
7295
|
-
*
|
|
7296
|
-
* Pattern:
|
|
7297
|
-
* 1. Define Zod schemas for data, methods, settings
|
|
7298
|
-
* 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
|
|
7299
|
-
* 3. Export type IProvider = InferProvider<typeof capabilityDef>
|
|
7300
|
-
* 4. Addon implements IProvider
|
|
7301
|
-
* 5. Registry auto-mounts tRPC router from definition.methods
|
|
7302
|
-
*/
|
|
7303
|
-
/**
|
|
7304
|
-
* Output schema shared by the contribution + live methods.
|
|
7305
|
-
*
|
|
7306
|
-
* Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
|
|
7307
|
-
* tabs[]) without importing from `../interfaces/config-ui.js` — a
|
|
7308
|
-
* concrete-but-lenient Zod object keeps tRPC output inference happy
|
|
7309
|
-
* (using `z.unknown()` here collapses unrelated router branches to
|
|
7310
|
-
* `unknown` when the generator re-inlines the huge AppRouter type).
|
|
7311
|
-
*
|
|
7312
|
-
* `.passthrough()` on sections/fields accepts whatever FormBuilder
|
|
7313
|
-
* extensions the caller adds (showWhen, displayScale, …) without
|
|
7314
|
-
* rebuilding every time a new field kind is introduced.
|
|
7315
|
-
*/
|
|
7316
|
-
var ContributionSectionSchema = object({
|
|
7317
|
-
id: string(),
|
|
7318
|
-
title: string(),
|
|
7319
|
-
description: string().optional(),
|
|
7320
|
-
style: _enum(["card", "accordion"]).optional(),
|
|
7321
|
-
defaultCollapsed: boolean().optional(),
|
|
7322
|
-
columns: union([
|
|
7323
|
-
literal(1),
|
|
7324
|
-
literal(2),
|
|
7325
|
-
literal(3),
|
|
7326
|
-
literal(4)
|
|
7327
|
-
]).optional(),
|
|
7328
|
-
tab: string().optional(),
|
|
7329
|
-
location: _enum(["settings", "top-tab"]).optional(),
|
|
7330
|
-
order: number().optional(),
|
|
7331
|
-
fields: array(any())
|
|
7332
|
-
});
|
|
7333
|
-
object({
|
|
7334
|
-
tabs: array(object({
|
|
7335
|
-
id: string(),
|
|
7336
|
-
label: string(),
|
|
7337
|
-
icon: string(),
|
|
7338
|
-
order: number().optional()
|
|
7339
|
-
})).optional(),
|
|
7340
|
-
sections: array(ContributionSectionSchema)
|
|
7341
|
-
}).nullable();
|
|
7342
|
-
object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
7343
|
-
deviceId: number(),
|
|
7344
|
-
patch: record(string(), unknown())
|
|
7345
|
-
}), object({ success: literal(true) });
|
|
7346
|
-
object({ deviceId: number() }), unknown().nullable();
|
|
7347
|
-
/** Shorthand to define a method schema */
|
|
7348
|
-
function method(input, output, options) {
|
|
7349
|
-
return {
|
|
7350
|
-
input,
|
|
7351
|
-
output,
|
|
7352
|
-
kind: options?.kind ?? "query",
|
|
7353
|
-
auth: options?.auth ?? "protected",
|
|
7354
|
-
...options?.access !== void 0 ? { access: options.access } : {},
|
|
7355
|
-
timeoutMs: options?.timeoutMs
|
|
7356
|
-
};
|
|
7357
|
-
}
|
|
7358
|
-
/**
|
|
7359
7433
|
* Alarm-panel cap. Models HA `alarm_control_panel.*` on
|
|
7360
7434
|
* `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
|
|
7361
7435
|
* across disarmed / armed_(home|away|night|vacation|custom_bypass) /
|
|
@@ -9170,6 +9244,24 @@ var DetectorOutputSchema = object({
|
|
|
9170
9244
|
inferenceMs: number(),
|
|
9171
9245
|
modelId: string()
|
|
9172
9246
|
});
|
|
9247
|
+
var EngineProvisioningSchema = object({
|
|
9248
|
+
runtimeId: _enum([
|
|
9249
|
+
"onnx",
|
|
9250
|
+
"openvino",
|
|
9251
|
+
"coreml"
|
|
9252
|
+
]).nullable(),
|
|
9253
|
+
device: string().nullable(),
|
|
9254
|
+
state: _enum([
|
|
9255
|
+
"idle",
|
|
9256
|
+
"installing",
|
|
9257
|
+
"verifying",
|
|
9258
|
+
"ready",
|
|
9259
|
+
"failed"
|
|
9260
|
+
]),
|
|
9261
|
+
progress: number().optional(),
|
|
9262
|
+
error: string().optional(),
|
|
9263
|
+
nextRetryAt: number().optional()
|
|
9264
|
+
});
|
|
9173
9265
|
var PipelineStepInputSchema = lazy(() => object({
|
|
9174
9266
|
addonId: string(),
|
|
9175
9267
|
modelId: string(),
|
|
@@ -9238,7 +9330,7 @@ var PipelineRunResultBridge = custom();
|
|
|
9238
9330
|
method(_void(), array(PipelineEngineChoiceSchema)), method(_void(), PipelineEngineChoiceSchema), method(PipelineEngineChoiceSchema, array(PipelineDefaultStepSchema)), method(_void(), PipelineEngineChoiceSchema, {
|
|
9239
9331
|
kind: "mutation",
|
|
9240
9332
|
auth: "admin"
|
|
9241
|
-
}), method(_void(), record(string(), object({
|
|
9333
|
+
}), method(object({ nodeId: string() }), EngineProvisioningSchema), method(_void(), record(string(), object({
|
|
9242
9334
|
modelId: string(),
|
|
9243
9335
|
settings: record(string(), unknown()).readonly()
|
|
9244
9336
|
}))), method(object({ steps: record(string(), object({
|
|
@@ -11384,9 +11476,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
11384
11476
|
limit: number().optional(),
|
|
11385
11477
|
tags: record(string(), string()).optional()
|
|
11386
11478
|
}), array(LogEntrySchema).readonly());
|
|
11387
|
-
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
11388
|
-
var VersionOutputSchema = object({ version: string() });
|
|
11389
|
-
method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
|
|
11390
11479
|
/**
|
|
11391
11480
|
* Zod schemas for persisted record types.
|
|
11392
11481
|
*
|
|
@@ -12870,7 +12959,10 @@ var AgentAddonConfigSchema = object({
|
|
|
12870
12959
|
modelId: string(),
|
|
12871
12960
|
settings: record(string(), unknown()).readonly()
|
|
12872
12961
|
});
|
|
12873
|
-
var AgentPipelineSettingsSchema = object({
|
|
12962
|
+
var AgentPipelineSettingsSchema = object({
|
|
12963
|
+
addonDefaults: record(string(), AgentAddonConfigSchema).readonly(),
|
|
12964
|
+
maxCameras: number().int().nonnegative().nullable().default(null)
|
|
12965
|
+
});
|
|
12874
12966
|
var CameraPipelineForAgentSchema = object({
|
|
12875
12967
|
steps: array(PipelineStepInputSchema).readonly(),
|
|
12876
12968
|
audio: object({
|
|
@@ -12972,6 +13064,133 @@ var GlobalMetricsSchema = object({
|
|
|
12972
13064
|
* capability providers.
|
|
12973
13065
|
*/
|
|
12974
13066
|
var CapabilityBindingsSchema = record(string(), string());
|
|
13067
|
+
/** Source block — always present; derives from the stream catalog. */
|
|
13068
|
+
var CameraSourceStatusSchema = object({ streams: array(object({
|
|
13069
|
+
camStreamId: string(),
|
|
13070
|
+
codec: string(),
|
|
13071
|
+
width: number(),
|
|
13072
|
+
height: number(),
|
|
13073
|
+
fps: number(),
|
|
13074
|
+
kind: string()
|
|
13075
|
+
})).readonly() });
|
|
13076
|
+
/** Assignment block — always present (orchestrator-local, no remote call). */
|
|
13077
|
+
var CameraAssignmentStatusSchema = object({
|
|
13078
|
+
detectionNodeId: string().nullable(),
|
|
13079
|
+
decoderNodeId: string().nullable(),
|
|
13080
|
+
audioNodeId: string().nullable(),
|
|
13081
|
+
pinned: object({
|
|
13082
|
+
detection: boolean(),
|
|
13083
|
+
decoder: boolean(),
|
|
13084
|
+
audio: boolean()
|
|
13085
|
+
}),
|
|
13086
|
+
reasons: object({
|
|
13087
|
+
detection: string().optional(),
|
|
13088
|
+
decoder: string().optional(),
|
|
13089
|
+
audio: string().optional()
|
|
13090
|
+
})
|
|
13091
|
+
});
|
|
13092
|
+
/** Broker block — null when the broker stage is unreachable or inactive. */
|
|
13093
|
+
var CameraBrokerStatusSchema = object({
|
|
13094
|
+
profiles: array(object({
|
|
13095
|
+
profile: string(),
|
|
13096
|
+
status: string(),
|
|
13097
|
+
codec: string(),
|
|
13098
|
+
width: number(),
|
|
13099
|
+
height: number(),
|
|
13100
|
+
subscribers: number(),
|
|
13101
|
+
inFps: number(),
|
|
13102
|
+
outFps: number()
|
|
13103
|
+
})).readonly(),
|
|
13104
|
+
webrtcSessions: number(),
|
|
13105
|
+
rtspRestream: boolean()
|
|
13106
|
+
});
|
|
13107
|
+
/** Shared-memory ring statistics within the decoder block. */
|
|
13108
|
+
var CameraDecoderShmSchema = object({
|
|
13109
|
+
framesWritten: number(),
|
|
13110
|
+
getFrameHits: number(),
|
|
13111
|
+
getFrameMisses: number(),
|
|
13112
|
+
budgetMb: number()
|
|
13113
|
+
});
|
|
13114
|
+
/** Decoder block — null when the decoder stage is unreachable or inactive. */
|
|
13115
|
+
var CameraDecoderStatusSchema = object({
|
|
13116
|
+
nodeId: string(),
|
|
13117
|
+
formats: array(string()).readonly(),
|
|
13118
|
+
sessionCount: number(),
|
|
13119
|
+
shm: CameraDecoderShmSchema
|
|
13120
|
+
});
|
|
13121
|
+
/** Motion block — null when motion detection is not active for this device. */
|
|
13122
|
+
var CameraMotionStatusSchema = object({
|
|
13123
|
+
enabled: boolean(),
|
|
13124
|
+
fps: number()
|
|
13125
|
+
});
|
|
13126
|
+
/** Detection provisioning sub-block. */
|
|
13127
|
+
var CameraDetectionProvisioningSchema = object({
|
|
13128
|
+
state: _enum([
|
|
13129
|
+
"idle",
|
|
13130
|
+
"installing",
|
|
13131
|
+
"verifying",
|
|
13132
|
+
"ready",
|
|
13133
|
+
"failed"
|
|
13134
|
+
]),
|
|
13135
|
+
error: string().optional()
|
|
13136
|
+
});
|
|
13137
|
+
/** Detection phase — derived from the runner's engine phase. */
|
|
13138
|
+
var CameraDetectionPhaseSchema = _enum([
|
|
13139
|
+
"idle",
|
|
13140
|
+
"watching",
|
|
13141
|
+
"active"
|
|
13142
|
+
]);
|
|
13143
|
+
/** Detection block — null when no detection node is assigned or reachable. */
|
|
13144
|
+
var CameraDetectionStatusSchema = object({
|
|
13145
|
+
nodeId: string(),
|
|
13146
|
+
engine: object({
|
|
13147
|
+
backend: string(),
|
|
13148
|
+
device: string()
|
|
13149
|
+
}),
|
|
13150
|
+
phase: CameraDetectionPhaseSchema,
|
|
13151
|
+
configuredFps: number(),
|
|
13152
|
+
actualFps: number(),
|
|
13153
|
+
queueDepth: number(),
|
|
13154
|
+
avgInferenceMs: number(),
|
|
13155
|
+
provisioning: CameraDetectionProvisioningSchema
|
|
13156
|
+
});
|
|
13157
|
+
/** Audio block — null when no audio node is assigned or reachable. */
|
|
13158
|
+
var CameraAudioStatusSchema = object({
|
|
13159
|
+
nodeId: string(),
|
|
13160
|
+
enabled: boolean()
|
|
13161
|
+
});
|
|
13162
|
+
/** Recording block — null when no recording cap is active for this device. */
|
|
13163
|
+
var CameraRecordingStatusSchema = object({
|
|
13164
|
+
mode: _enum([
|
|
13165
|
+
"off",
|
|
13166
|
+
"continuous",
|
|
13167
|
+
"events"
|
|
13168
|
+
]),
|
|
13169
|
+
active: boolean(),
|
|
13170
|
+
storageBytes: number()
|
|
13171
|
+
});
|
|
13172
|
+
/**
|
|
13173
|
+
* Aggregated per-camera pipeline status — server-composed, single call.
|
|
13174
|
+
*
|
|
13175
|
+
* The `assignment` and `source` blocks are always present.
|
|
13176
|
+
* Every other block is `null` when the stage is inactive or unreachable
|
|
13177
|
+
* during the bounded parallel fan-out in the orchestrator implementation.
|
|
13178
|
+
*
|
|
13179
|
+
* See spec: `docs/superpowers/specs/2026-06-24-camera-status-aggregator-cap.md`
|
|
13180
|
+
*/
|
|
13181
|
+
var CameraStatusSchema = object({
|
|
13182
|
+
deviceId: number(),
|
|
13183
|
+
assignment: CameraAssignmentStatusSchema,
|
|
13184
|
+
source: CameraSourceStatusSchema,
|
|
13185
|
+
broker: CameraBrokerStatusSchema.nullable(),
|
|
13186
|
+
decoder: CameraDecoderStatusSchema.nullable(),
|
|
13187
|
+
motion: CameraMotionStatusSchema.nullable(),
|
|
13188
|
+
detection: CameraDetectionStatusSchema.nullable(),
|
|
13189
|
+
audio: CameraAudioStatusSchema.nullable(),
|
|
13190
|
+
recording: CameraRecordingStatusSchema.nullable(),
|
|
13191
|
+
/** Unix timestamp (ms) when this snapshot was composed server-side. */
|
|
13192
|
+
fetchedAt: number()
|
|
13193
|
+
});
|
|
12975
13194
|
method(object({
|
|
12976
13195
|
deviceId: number(),
|
|
12977
13196
|
agentNodeId: string()
|
|
@@ -13039,6 +13258,12 @@ method(object({
|
|
|
13039
13258
|
}), {
|
|
13040
13259
|
kind: "mutation",
|
|
13041
13260
|
auth: "admin"
|
|
13261
|
+
}), method(object({
|
|
13262
|
+
agentNodeId: string(),
|
|
13263
|
+
maxCameras: number().int().nonnegative().nullable()
|
|
13264
|
+
}), object({ success: literal(true) }), {
|
|
13265
|
+
kind: "mutation",
|
|
13266
|
+
auth: "admin"
|
|
13042
13267
|
}), method(object({ deviceId: number() }), CameraPipelineSettingsSchema.nullable()), method(object({
|
|
13043
13268
|
deviceId: number(),
|
|
13044
13269
|
addonId: string(),
|
|
@@ -13064,7 +13289,7 @@ method(object({
|
|
|
13064
13289
|
}), method(object({
|
|
13065
13290
|
deviceId: number(),
|
|
13066
13291
|
agentNodeId: string().optional()
|
|
13067
|
-
}), CameraPipelineConfigSchema), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
13292
|
+
}), CameraPipelineConfigSchema), method(object({ deviceId: number() }), CameraStatusSchema), method(object({ deviceIds: array(number()).optional() }), array(CameraStatusSchema).readonly()), method(_void(), array(PipelineTemplateSchema).readonly()), method(object({
|
|
13068
13293
|
name: string(),
|
|
13069
13294
|
description: string().optional(),
|
|
13070
13295
|
config: CameraPipelineConfigSchema
|
|
@@ -13551,7 +13776,7 @@ method(object({
|
|
|
13551
13776
|
}), _void(), {
|
|
13552
13777
|
kind: "mutation",
|
|
13553
13778
|
auth: "admin"
|
|
13554
|
-
}), 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({
|
|
13779
|
+
}), 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({
|
|
13555
13780
|
deviceId: number(),
|
|
13556
13781
|
values: record(string(), unknown())
|
|
13557
13782
|
}), object({ success: literal(true) }), {
|
|
@@ -14233,7 +14458,20 @@ var DiskSpaceInfoSchema = object({
|
|
|
14233
14458
|
var PidResourceStatsSchema = object({
|
|
14234
14459
|
pid: number(),
|
|
14235
14460
|
cpu: number(),
|
|
14236
|
-
memory: number()
|
|
14461
|
+
memory: number(),
|
|
14462
|
+
/**
|
|
14463
|
+
* Private (anonymous) resident bytes — the per-process V8 heap + native
|
|
14464
|
+
* allocations NOT shared with other processes (Linux RssAnon). This is the
|
|
14465
|
+
* "real" per-runner cost; summing it across runners is meaningful, unlike
|
|
14466
|
+
* `memory` (RSS), which double-counts the shared mmap'd framework code.
|
|
14467
|
+
* Undefined where /proc is unavailable (e.g. macOS).
|
|
14468
|
+
*/
|
|
14469
|
+
privateBytes: number().optional(),
|
|
14470
|
+
/**
|
|
14471
|
+
* Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
|
|
14472
|
+
* code shared copy-on-write across runners. Undefined on macOS.
|
|
14473
|
+
*/
|
|
14474
|
+
sharedBytes: number().optional()
|
|
14237
14475
|
});
|
|
14238
14476
|
var AddonInstanceSchema = object({
|
|
14239
14477
|
addonId: string(),
|
|
@@ -14282,6 +14520,17 @@ var KillProcessResultSchema = object({
|
|
|
14282
14520
|
reason: string().optional(),
|
|
14283
14521
|
signal: _enum(["SIGTERM", "SIGKILL"]).optional()
|
|
14284
14522
|
});
|
|
14523
|
+
var DumpHeapSnapshotInputSchema = object({
|
|
14524
|
+
/** The addon whose runner should dump a heap snapshot. */
|
|
14525
|
+
addonId: string() });
|
|
14526
|
+
var DumpHeapSnapshotResultSchema = object({
|
|
14527
|
+
success: boolean(),
|
|
14528
|
+
/** Path of the written .heapsnapshot inside the runner's container/host. */
|
|
14529
|
+
path: string().optional(),
|
|
14530
|
+
/** Process pid that was signalled. */
|
|
14531
|
+
pid: number().optional(),
|
|
14532
|
+
reason: string().optional()
|
|
14533
|
+
});
|
|
14285
14534
|
var SystemMetricsSchema = object({
|
|
14286
14535
|
cpuPercent: number(),
|
|
14287
14536
|
memoryPercent: number(),
|
|
@@ -14295,6 +14544,9 @@ var SystemMetricsSchema = object({
|
|
|
14295
14544
|
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, {
|
|
14296
14545
|
kind: "mutation",
|
|
14297
14546
|
auth: "admin"
|
|
14547
|
+
}), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
|
|
14548
|
+
kind: "mutation",
|
|
14549
|
+
auth: "admin"
|
|
14298
14550
|
});
|
|
14299
14551
|
var PtzPresetSchema = object({
|
|
14300
14552
|
id: string(),
|
|
@@ -14661,63 +14913,6 @@ method(object({
|
|
|
14661
14913
|
auth: "admin"
|
|
14662
14914
|
});
|
|
14663
14915
|
/**
|
|
14664
|
-
* device-ops — device-scoped cap that unifies the per-IDevice operations
|
|
14665
|
-
* previously routed through the `.device-ops` Moleculer bridge service.
|
|
14666
|
-
*
|
|
14667
|
-
* Each worker that hosts live `IDevice` instances auto-registers a native
|
|
14668
|
-
* provider for this cap (per device) backed by its local
|
|
14669
|
-
* `DeviceRegistry`. Hub-side callers reach it transparently through
|
|
14670
|
-
* `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
|
|
14671
|
-
* `deviceId` + `nodeId` and dispatches through the standard cap-router,
|
|
14672
|
-
* so there's no parallel bridge path anymore.
|
|
14673
|
-
*
|
|
14674
|
-
* The surface is intentionally small — every method corresponds to a
|
|
14675
|
-
* single action on the live `IDevice` (or `ICameraDevice` for
|
|
14676
|
-
* `getStreamSources`). Richer orchestration (enable/disable with
|
|
14677
|
-
* integration plumbing, bulk updates) stays in the `device-manager` cap;
|
|
14678
|
-
* `device-ops` is the per-device primitive the device-manager routes to.
|
|
14679
|
-
*/
|
|
14680
|
-
var StreamSourceEntrySchema$1 = object({
|
|
14681
|
-
id: string(),
|
|
14682
|
-
label: string(),
|
|
14683
|
-
protocol: _enum([
|
|
14684
|
-
"rtsp",
|
|
14685
|
-
"rtmp",
|
|
14686
|
-
"annexb",
|
|
14687
|
-
"http-mjpeg",
|
|
14688
|
-
"webrtc",
|
|
14689
|
-
"custom"
|
|
14690
|
-
]),
|
|
14691
|
-
url: string().optional(),
|
|
14692
|
-
resolution: object({
|
|
14693
|
-
width: number(),
|
|
14694
|
-
height: number()
|
|
14695
|
-
}).optional(),
|
|
14696
|
-
fps: number().optional(),
|
|
14697
|
-
bitrate: number().optional(),
|
|
14698
|
-
codec: string().optional(),
|
|
14699
|
-
profileHint: CamProfileSchema.optional(),
|
|
14700
|
-
sdp: string().optional()
|
|
14701
|
-
});
|
|
14702
|
-
var ConfigEntrySchema$1 = object({
|
|
14703
|
-
key: string(),
|
|
14704
|
-
value: unknown()
|
|
14705
|
-
});
|
|
14706
|
-
var RawStateResultSchema = object({
|
|
14707
|
-
/** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
|
|
14708
|
-
source: string(),
|
|
14709
|
-
/** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
|
|
14710
|
-
data: record(string(), unknown())
|
|
14711
|
-
});
|
|
14712
|
-
method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
|
|
14713
|
-
deviceId: number(),
|
|
14714
|
-
values: record(string(), unknown())
|
|
14715
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
14716
|
-
deviceId: number(),
|
|
14717
|
-
action: string().min(1),
|
|
14718
|
-
input: unknown()
|
|
14719
|
-
}), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
|
|
14720
|
-
/**
|
|
14721
14916
|
* camera-credentials — device-scoped cap exposing the camera's network
|
|
14722
14917
|
* + auth surface in a vendor-neutral shape.
|
|
14723
14918
|
*
|
|
@@ -18400,6 +18595,12 @@ Object.freeze({
|
|
|
18400
18595
|
addonId: null,
|
|
18401
18596
|
access: "view"
|
|
18402
18597
|
},
|
|
18598
|
+
"metricsProvider.dumpHeapSnapshot": {
|
|
18599
|
+
capName: "metrics-provider",
|
|
18600
|
+
capScope: "system",
|
|
18601
|
+
addonId: null,
|
|
18602
|
+
access: "create"
|
|
18603
|
+
},
|
|
18403
18604
|
"metricsProvider.getAddonStats": {
|
|
18404
18605
|
capName: "metrics-provider",
|
|
18405
18606
|
capScope: "system",
|
|
@@ -18856,6 +19057,12 @@ Object.freeze({
|
|
|
18856
19057
|
addonId: null,
|
|
18857
19058
|
access: "view"
|
|
18858
19059
|
},
|
|
19060
|
+
"pipelineExecutor.getEngineProvisioning": {
|
|
19061
|
+
capName: "pipeline-executor",
|
|
19062
|
+
capScope: "system",
|
|
19063
|
+
addonId: null,
|
|
19064
|
+
access: "view"
|
|
19065
|
+
},
|
|
18859
19066
|
"pipelineExecutor.getGlobalPipelineConfig": {
|
|
18860
19067
|
capName: "pipeline-executor",
|
|
18861
19068
|
capScope: "system",
|
|
@@ -19060,6 +19267,18 @@ Object.freeze({
|
|
|
19060
19267
|
addonId: null,
|
|
19061
19268
|
access: "view"
|
|
19062
19269
|
},
|
|
19270
|
+
"pipelineOrchestrator.getCameraStatus": {
|
|
19271
|
+
capName: "pipeline-orchestrator",
|
|
19272
|
+
capScope: "system",
|
|
19273
|
+
addonId: null,
|
|
19274
|
+
access: "view"
|
|
19275
|
+
},
|
|
19276
|
+
"pipelineOrchestrator.getCameraStatuses": {
|
|
19277
|
+
capName: "pipeline-orchestrator",
|
|
19278
|
+
capScope: "system",
|
|
19279
|
+
addonId: null,
|
|
19280
|
+
access: "view"
|
|
19281
|
+
},
|
|
19063
19282
|
"pipelineOrchestrator.getCameraStepOverrides": {
|
|
19064
19283
|
capName: "pipeline-orchestrator",
|
|
19065
19284
|
capScope: "system",
|
|
@@ -19144,6 +19363,12 @@ Object.freeze({
|
|
|
19144
19363
|
addonId: null,
|
|
19145
19364
|
access: "create"
|
|
19146
19365
|
},
|
|
19366
|
+
"pipelineOrchestrator.setAgentMaxCameras": {
|
|
19367
|
+
capName: "pipeline-orchestrator",
|
|
19368
|
+
capScope: "system",
|
|
19369
|
+
addonId: null,
|
|
19370
|
+
access: "create"
|
|
19371
|
+
},
|
|
19147
19372
|
"pipelineOrchestrator.setCameraPipelineForAgent": {
|
|
19148
19373
|
capName: "pipeline-orchestrator",
|
|
19149
19374
|
capScope: "system",
|