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