@camstack/addon-pipeline 1.0.6 → 1.0.7
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/audio-analyzer/index.js +6 -7
- package/dist/audio-analyzer/index.mjs +2 -2
- package/dist/audio-codec-nodeav/index.js +1 -1
- package/dist/audio-codec-nodeav/index.mjs +1 -1
- package/dist/decoder-nodeav/index.js +1 -1
- package/dist/decoder-nodeav/index.mjs +1 -1
- package/dist/detection-pipeline/index.js +14 -15
- package/dist/detection-pipeline/index.mjs +2 -2
- package/dist/{dist-DsDFrG0I.mjs → dist-CjrjeaDd.mjs} +1681 -1644
- package/dist/{dist-BiUtYscO.js → dist-G45MVm6i.js} +1680 -1643
- package/dist/model-download-service-C7AjBsX9-B0ekM6dF.mjs +301 -0
- package/dist/model-download-service-C7AjBsX9-rXY-VFDk.js +358 -0
- package/dist/motion-wasm/index.js +1 -1
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/pipeline-runner/index.js +1 -1
- package/dist/pipeline-runner/index.mjs +1 -1
- package/dist/recorder/index.js +4 -5
- package/dist/recorder/index.mjs +2 -2
- package/dist/stream-broker/_stub.js +2 -2
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-CbTGCEnd.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-Tbqpu0v3.mjs} +3 -3
- package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-3STWM0yI.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-DCsgcqTa.mjs} +1 -1
- package/dist/stream-broker/{_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Dsz9DmNr.mjs → _virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CHcXI1Wf.mjs} +1 -1
- package/dist/stream-broker/{hostInit-BJ3QDdFs.mjs → hostInit-tIev5Gd9.mjs} +3 -3
- package/dist/stream-broker/index.js +9 -10
- package/dist/stream-broker/index.mjs +3 -3
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/embed-dist/assets/{MaskShapeCanvas-DI4BY7W2-B4oJIlgF.js → MaskShapeCanvas-DI4BY7W2-C0kKwNX_.js} +1 -1
- package/embed-dist/assets/{MotionZonesSettings-C1EEbk2V-CUopGB1R.js → MotionZonesSettings-C1EEbk2V-CYtJc892.js} +1 -1
- package/embed-dist/assets/{PrivacyMaskSettings-APgPLF7p-CyTsHaor.js → PrivacyMaskSettings-APgPLF7p-C2SRtNe6.js} +1 -1
- package/embed-dist/assets/index-B2LRyXWh.js +80 -0
- package/embed-dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/chunk-D6vf50IK.js +0 -28
- package/embed-dist/assets/index-hwJEVIPM.js +0 -80
|
@@ -4627,63 +4627,7 @@ function _instanceof(cls, params = {}) {
|
|
|
4627
4627
|
return inst;
|
|
4628
4628
|
}
|
|
4629
4629
|
//#endregion
|
|
4630
|
-
//#region ../types/dist/
|
|
4631
|
-
/**
|
|
4632
|
-
* Deep wiring healthcheck — snapshot of active reachability probes across
|
|
4633
|
-
* every declared capability + widget of every installed plugin, on every
|
|
4634
|
-
* node. Produced by the backend `WiringHealthService` and surfaced via
|
|
4635
|
-
* `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
|
|
4636
|
-
*
|
|
4637
|
-
* Unlike `/health` (process liveness), this reflects whether each cap/widget
|
|
4638
|
-
* is actually *reachable* over the real cap-dispatch path. See spec
|
|
4639
|
-
* `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
|
|
4640
|
-
*/
|
|
4641
|
-
/** What kind of target a probe addressed. */
|
|
4642
|
-
var wiringProbeKindSchema = _enum([
|
|
4643
|
-
"singleton",
|
|
4644
|
-
"device",
|
|
4645
|
-
"widget"
|
|
4646
|
-
]);
|
|
4647
|
-
/** Result of probing a single (cap|widget [, device]) target. */
|
|
4648
|
-
var wiringProbeResultSchema = object({
|
|
4649
|
-
capName: string(),
|
|
4650
|
-
kind: wiringProbeKindSchema,
|
|
4651
|
-
deviceId: number().optional(),
|
|
4652
|
-
reachable: boolean(),
|
|
4653
|
-
latencyMs: number(),
|
|
4654
|
-
error: string().optional()
|
|
4655
|
-
});
|
|
4656
|
-
/** Per-addon roll-up of cap + widget probe results. */
|
|
4657
|
-
var wiringAddonHealthSchema = object({
|
|
4658
|
-
addonId: string(),
|
|
4659
|
-
caps: array(wiringProbeResultSchema).readonly(),
|
|
4660
|
-
widgets: array(wiringProbeResultSchema).readonly()
|
|
4661
|
-
});
|
|
4662
|
-
/** Per-node roll-up. */
|
|
4663
|
-
var wiringNodeHealthSchema = object({
|
|
4664
|
-
nodeId: string(),
|
|
4665
|
-
addons: array(wiringAddonHealthSchema).readonly()
|
|
4666
|
-
});
|
|
4667
|
-
object({
|
|
4668
|
-
/** True only when every probed target is reachable. */
|
|
4669
|
-
ok: boolean(),
|
|
4670
|
-
/** True when at least one target is unreachable. */
|
|
4671
|
-
degraded: boolean(),
|
|
4672
|
-
checkedAt: string(),
|
|
4673
|
-
nodes: array(wiringNodeHealthSchema).readonly(),
|
|
4674
|
-
summary: object({
|
|
4675
|
-
total: number(),
|
|
4676
|
-
reachable: number(),
|
|
4677
|
-
unreachable: number()
|
|
4678
|
-
})
|
|
4679
|
-
});
|
|
4680
|
-
var MODEL_FORMATS = [
|
|
4681
|
-
"onnx",
|
|
4682
|
-
"coreml",
|
|
4683
|
-
"openvino",
|
|
4684
|
-
"tflite",
|
|
4685
|
-
"pt"
|
|
4686
|
-
];
|
|
4630
|
+
//#region ../types/dist/sleep-D7JeS58T.mjs
|
|
4687
4631
|
var EventCategory = /* @__PURE__ */ function(EventCategory) {
|
|
4688
4632
|
EventCategory["SystemBoot"] = "system.boot";
|
|
4689
4633
|
EventCategory["SystemAddonsReady"] = "system.addons-ready";
|
|
@@ -6070,7 +6014,7 @@ function selectAssignedProfileSlots(slots, deviceId) {
|
|
|
6070
6014
|
* Zod schema for StreamSourceEntry — the canonical stream descriptor
|
|
6071
6015
|
* exposed by ICameraDevice.getStreamSources() and consumed by the broker.
|
|
6072
6016
|
*/
|
|
6073
|
-
var StreamSourceEntrySchema = object({
|
|
6017
|
+
var StreamSourceEntrySchema$1 = object({
|
|
6074
6018
|
id: string(),
|
|
6075
6019
|
label: string(),
|
|
6076
6020
|
protocol: _enum([
|
|
@@ -6293,1462 +6237,1678 @@ var ProfileRtspEntrySchema = object({
|
|
|
6293
6237
|
resolution: CamStreamResolutionSchema.optional()
|
|
6294
6238
|
});
|
|
6295
6239
|
/**
|
|
6296
|
-
*
|
|
6297
|
-
* Named `RecordingWeekday` to avoid collision with the string-union
|
|
6298
|
-
* `Weekday` exported from `interfaces/timezones.ts`.
|
|
6299
|
-
*/
|
|
6300
|
-
var RecordingWeekdaySchema = number().int().min(0).max(6);
|
|
6301
|
-
var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
|
|
6302
|
-
var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
|
|
6303
|
-
kind: literal("timeOfDay"),
|
|
6304
|
-
start: string().regex(HHMM),
|
|
6305
|
-
end: string().regex(HHMM),
|
|
6306
|
-
/** Restrict to these weekdays; omit = every day. */
|
|
6307
|
-
days: array(RecordingWeekdaySchema).optional()
|
|
6308
|
-
})]);
|
|
6309
|
-
var RecordingModeSchema = _enum([
|
|
6310
|
-
"continuous",
|
|
6311
|
-
"onMotion",
|
|
6312
|
-
"onAudioThreshold"
|
|
6313
|
-
]);
|
|
6314
|
-
/**
|
|
6315
|
-
* First-class, authoritative per-camera storage mode — the netta choice the UI
|
|
6316
|
-
* reads directly (never inferred from `rules`):
|
|
6317
|
-
* - `off` — not recording.
|
|
6318
|
-
* - `events` — record only around triggers (motion / audio threshold),
|
|
6319
|
-
* with pre/post-buffer.
|
|
6320
|
-
* - `continuous` — record 24/7 within the schedule.
|
|
6321
|
-
*
|
|
6322
|
-
* `mode` compiles one-way to the internal `rules[]` consumed by the policy
|
|
6323
|
-
* engine (see `compileRules`); `rules[]` is never authored directly anymore.
|
|
6324
|
-
*/
|
|
6325
|
-
var RecordingStorageModeSchema = _enum([
|
|
6326
|
-
"off",
|
|
6327
|
-
"events",
|
|
6328
|
-
"continuous"
|
|
6329
|
-
]);
|
|
6330
|
-
/** Which detectors trigger an `events`-mode recording. */
|
|
6331
|
-
var RecordingTriggersSchema = object({
|
|
6332
|
-
motion: boolean().optional(),
|
|
6333
|
-
audioThresholdDbfs: number().optional()
|
|
6334
|
-
});
|
|
6335
|
-
/**
|
|
6336
|
-
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
6337
|
-
*
|
|
6338
|
-
* Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
|
|
6339
|
-
* only ever `continuous` or `events`; "off" is expressed by the absence of a
|
|
6340
|
-
* covering band, not by a band value.
|
|
6341
|
-
*/
|
|
6342
|
-
var RecordingBandModeSchema = _enum(["continuous", "events"]);
|
|
6343
|
-
/**
|
|
6344
|
-
* Triggers for an `events`-mode band. Identical shape to
|
|
6345
|
-
* `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
|
|
6346
|
-
* two never drift.
|
|
6347
|
-
*/
|
|
6348
|
-
var RecordingBandTriggersSchema = RecordingTriggersSchema;
|
|
6349
|
-
/**
|
|
6350
|
-
* A single mode-per-band window — the canonical recorder band shape, the
|
|
6351
|
-
* single source of truth re-used by `addon-pipeline/recorder`.
|
|
6240
|
+
* Type-safe JSON parsing helpers.
|
|
6352
6241
|
*
|
|
6353
|
-
* `
|
|
6354
|
-
*
|
|
6355
|
-
*
|
|
6356
|
-
|
|
6357
|
-
var RecordingBandSchema = object({
|
|
6358
|
-
days: array(RecordingWeekdaySchema),
|
|
6359
|
-
start: string().regex(HHMM),
|
|
6360
|
-
end: string().regex(HHMM),
|
|
6361
|
-
mode: RecordingBandModeSchema,
|
|
6362
|
-
triggers: RecordingBandTriggersSchema.optional(),
|
|
6363
|
-
preBufferSec: number().min(0).optional(),
|
|
6364
|
-
postBufferSec: number().min(0).optional()
|
|
6365
|
-
});
|
|
6366
|
-
var RecordingRuleSchema = object({
|
|
6367
|
-
schedule: RecordingScheduleSchema,
|
|
6368
|
-
mode: RecordingModeSchema,
|
|
6369
|
-
/** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
|
|
6370
|
-
preBufferSec: number().min(0).default(0),
|
|
6371
|
-
/** Keep recording until this many seconds after the last trigger. */
|
|
6372
|
-
postBufferSec: number().min(0).default(0),
|
|
6373
|
-
/** Each new trigger restarts the post-buffer window. */
|
|
6374
|
-
resetTimeoutOnNewEvent: boolean().default(true),
|
|
6375
|
-
/** onAudioThreshold only — dBFS level that counts as a trigger. */
|
|
6376
|
-
thresholdDbfs: number().optional()
|
|
6377
|
-
});
|
|
6378
|
-
/**
|
|
6379
|
-
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
6380
|
-
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
6381
|
-
* live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
|
|
6382
|
-
* (when the volume is too full to keep recording) is NOT a per-camera concern —
|
|
6383
|
-
* it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
|
|
6384
|
-
* shared by every camera writing to that volume.
|
|
6242
|
+
* `JSON.parse` is typed as `any` in lib.es5.d.ts, which triggers
|
|
6243
|
+
* `no-unsafe-*` ESLint rules and destroys downstream inference. These
|
|
6244
|
+
* wrappers return `unknown` — callers narrow structurally via type
|
|
6245
|
+
* guards, `typeof` checks, or helpers like `asRecord`/`asString`.
|
|
6385
6246
|
*/
|
|
6386
|
-
var RecordingRetentionSchema = object({
|
|
6387
|
-
maxAgeDays: number().min(0).optional(),
|
|
6388
|
-
maxSizeGb: number().min(0).optional()
|
|
6389
|
-
});
|
|
6390
6247
|
/**
|
|
6391
|
-
*
|
|
6248
|
+
* Parse JSON and return it as `unknown` — the only entry point for untrusted JSON.
|
|
6392
6249
|
*
|
|
6393
|
-
*
|
|
6394
|
-
*
|
|
6395
|
-
*
|
|
6396
|
-
*
|
|
6250
|
+
* The optional generic overload `parseJsonUnknown<T>(text)` returns `T` for
|
|
6251
|
+
* call sites that know the shape at parse time (e.g. MQTT payloads with a
|
|
6252
|
+
* known protocol schema). This is a **type-level bridge only** — no runtime
|
|
6253
|
+
* validation is performed. Callers that need runtime validation should parse
|
|
6254
|
+
* as `unknown` and narrow via Zod or structural guards.
|
|
6397
6255
|
*/
|
|
6398
|
-
|
|
6399
|
-
|
|
6400
|
-
/** Authoritative storage mode. Absent on legacy targets → derived once via
|
|
6401
|
-
* `migrateRulesToMode`, then persisted. */
|
|
6402
|
-
mode: RecordingStorageModeSchema.optional(),
|
|
6403
|
-
profiles: array(CamProfileSchema).optional(),
|
|
6404
|
-
segmentSeconds: number().int().positive().optional(),
|
|
6405
|
-
/** Shared recording time-bands for `events` & `continuous` — record only when
|
|
6406
|
-
* the wall-clock falls inside one of these windows. Omit or empty = always.
|
|
6407
|
-
* `continuous` compiles to one rule per band; `events` to band × trigger. */
|
|
6408
|
-
schedules: array(RecordingScheduleSchema).optional(),
|
|
6409
|
-
/** Legacy single-band predecessor of `schedules`. Read-compat only — it is
|
|
6410
|
-
* normalized into `schedules` on read and never written going forward. (Not
|
|
6411
|
-
* tagged `@deprecated`: the normalization paths must read it cast-free.) */
|
|
6412
|
-
schedule: RecordingScheduleSchema.optional(),
|
|
6413
|
-
/** `events`-mode only — which detectors trigger a recording. */
|
|
6414
|
-
triggers: RecordingTriggersSchema.optional(),
|
|
6415
|
-
/** `events`-mode only — seconds retained before / after a trigger. */
|
|
6416
|
-
preBufferSec: number().min(0).optional(),
|
|
6417
|
-
postBufferSec: number().min(0).optional(),
|
|
6418
|
-
/** DEPRECATED authoring input; retained for migration/transition. */
|
|
6419
|
-
rules: array(RecordingRuleSchema).optional(),
|
|
6420
|
-
/**
|
|
6421
|
-
* AUTHORITATIVE mode-per-band recording model (recorder). When present it
|
|
6422
|
-
* is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
|
|
6423
|
-
* `triggers`/`rules` fields above are kept for READ-COMPAT only and are
|
|
6424
|
-
* derived into bands once via `migrateConfigToBands`.
|
|
6425
|
-
*/
|
|
6426
|
-
bands: array(RecordingBandSchema).optional(),
|
|
6427
|
-
retention: RecordingRetentionSchema.optional()
|
|
6428
|
-
});
|
|
6429
|
-
/** All seven weekdays (0 = Sunday … 6 = Saturday), used when a schedule omits a
|
|
6430
|
-
* weekday filter. */
|
|
6431
|
-
var ALL_DAYS = [
|
|
6432
|
-
0,
|
|
6433
|
-
1,
|
|
6434
|
-
2,
|
|
6435
|
-
3,
|
|
6436
|
-
4,
|
|
6437
|
-
5,
|
|
6438
|
-
6
|
|
6439
|
-
];
|
|
6440
|
-
/** Full-day span used to represent an `always` schedule as a band. The `HHMM`
|
|
6441
|
-
* regex maxes out at 23:59, so a 00:00–23:59 same-day span ≈ all-day (the band
|
|
6442
|
-
* engine treats `end > start` as a normal, non-wrapping span). */
|
|
6443
|
-
var ALL_DAY_START = "00:00";
|
|
6444
|
-
var ALL_DAY_END = "23:59";
|
|
6445
|
-
function bandFromSchedule(schedule, mode, config) {
|
|
6446
|
-
const days = schedule.kind === "timeOfDay" && schedule.days ? schedule.days : [...ALL_DAYS];
|
|
6447
|
-
const start = schedule.kind === "timeOfDay" ? schedule.start : ALL_DAY_START;
|
|
6448
|
-
const end = schedule.kind === "timeOfDay" ? schedule.end : ALL_DAY_END;
|
|
6449
|
-
if (mode === "continuous") return {
|
|
6450
|
-
days,
|
|
6451
|
-
start,
|
|
6452
|
-
end,
|
|
6453
|
-
mode
|
|
6454
|
-
};
|
|
6455
|
-
return {
|
|
6456
|
-
days,
|
|
6457
|
-
start,
|
|
6458
|
-
end,
|
|
6459
|
-
mode,
|
|
6460
|
-
...config.triggers ? { triggers: config.triggers } : {},
|
|
6461
|
-
...config.preBufferSec !== void 0 ? { preBufferSec: config.preBufferSec } : {},
|
|
6462
|
-
...config.postBufferSec !== void 0 ? { postBufferSec: config.postBufferSec } : {}
|
|
6463
|
-
};
|
|
6256
|
+
function parseJsonUnknown(text) {
|
|
6257
|
+
return JSON.parse(text);
|
|
6464
6258
|
}
|
|
6465
|
-
/**
|
|
6466
|
-
|
|
6467
|
-
|
|
6468
|
-
|
|
6469
|
-
* - If `config.bands` is present, it is authoritative and returned as-is.
|
|
6470
|
-
* - Otherwise the result is derived from the legacy fields: a disabled config or
|
|
6471
|
-
* `mode: 'off'` yields no bands; every legacy schedule maps to one band whose
|
|
6472
|
-
* mode is `continuous` when `config.mode === 'continuous'`, else `events`
|
|
6473
|
-
* (carrying `triggers`/`preBufferSec`/`postBufferSec`).
|
|
6474
|
-
*/
|
|
6475
|
-
function migrateConfigToBands(config) {
|
|
6476
|
-
if (config.bands) return config.bands;
|
|
6477
|
-
if (!config.enabled || config.mode === "off") return [];
|
|
6478
|
-
const schedules = config.schedules ?? (config.schedule ? [config.schedule] : [{ kind: "always" }]);
|
|
6479
|
-
const bandMode = config.mode === "continuous" ? "continuous" : "events";
|
|
6480
|
-
return schedules.map((schedule) => bandFromSchedule(schedule, bandMode, config));
|
|
6259
|
+
/** Narrow an unknown value to a plain `Record<string, unknown>` or return null. */
|
|
6260
|
+
function asJsonObject(value) {
|
|
6261
|
+
if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
|
|
6262
|
+
return { ...value };
|
|
6481
6263
|
}
|
|
6482
|
-
|
|
6483
|
-
|
|
6484
|
-
|
|
6485
|
-
|
|
6486
|
-
|
|
6487
|
-
|
|
6488
|
-
|
|
6489
|
-
|
|
6490
|
-
|
|
6491
|
-
|
|
6492
|
-
*
|
|
6493
|
-
*
|
|
6494
|
-
*
|
|
6495
|
-
|
|
6496
|
-
|
|
6497
|
-
|
|
6498
|
-
|
|
6499
|
-
|
|
6500
|
-
|
|
6501
|
-
|
|
6502
|
-
|
|
6503
|
-
*
|
|
6504
|
-
* `
|
|
6505
|
-
|
|
6506
|
-
|
|
6507
|
-
*
|
|
6508
|
-
|
|
6509
|
-
|
|
6510
|
-
*
|
|
6511
|
-
|
|
6512
|
-
|
|
6513
|
-
|
|
6514
|
-
|
|
6515
|
-
*/
|
|
6516
|
-
|
|
6517
|
-
|
|
6518
|
-
|
|
6519
|
-
|
|
6520
|
-
|
|
6521
|
-
|
|
6522
|
-
|
|
6523
|
-
*
|
|
6524
|
-
|
|
6525
|
-
|
|
6526
|
-
*
|
|
6527
|
-
*
|
|
6528
|
-
|
|
6529
|
-
|
|
6530
|
-
|
|
6531
|
-
|
|
6532
|
-
|
|
6533
|
-
|
|
6534
|
-
|
|
6535
|
-
|
|
6536
|
-
|
|
6537
|
-
|
|
6538
|
-
*
|
|
6539
|
-
* -
|
|
6540
|
-
*
|
|
6541
|
-
|
|
6542
|
-
|
|
6543
|
-
|
|
6544
|
-
|
|
6545
|
-
|
|
6546
|
-
*
|
|
6547
|
-
|
|
6548
|
-
|
|
6549
|
-
|
|
6550
|
-
|
|
6551
|
-
*
|
|
6552
|
-
|
|
6553
|
-
|
|
6554
|
-
*
|
|
6555
|
-
*
|
|
6556
|
-
|
|
6557
|
-
|
|
6558
|
-
*
|
|
6559
|
-
|
|
6560
|
-
|
|
6561
|
-
|
|
6562
|
-
|
|
6563
|
-
|
|
6564
|
-
|
|
6565
|
-
/**
|
|
6566
|
-
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
6567
|
-
* Must start with a lowercase letter and may contain letters, digits, and
|
|
6568
|
-
* hyphens.
|
|
6569
|
-
*/
|
|
6570
|
-
id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
|
|
6571
|
-
/** Human-readable name shown in the admin UI. */
|
|
6572
|
-
displayName: string().min(1, { message: "displayName must not be empty" }),
|
|
6573
|
-
/** Optional longer explanation of what data this location stores. */
|
|
6574
|
-
description: string().optional(),
|
|
6575
|
-
/**
|
|
6576
|
-
* `single` — exactly one instance of this location is allowed system-wide
|
|
6577
|
-
* (e.g. `logs`, `models`). The operator can edit it but not add more.
|
|
6578
|
-
* `multi` — the operator may register several instances (e.g. a second
|
|
6579
|
-
* `recordings` on a NAS for disk tiering); one is the default at any time.
|
|
6580
|
-
*/
|
|
6581
|
-
cardinality: _enum(["single", "multi"]),
|
|
6582
|
-
/**
|
|
6583
|
-
* When set, the default instance for this location inherits its resolved
|
|
6584
|
-
* root from the named location's default instance. Useful for derivative
|
|
6585
|
-
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
6586
|
-
* configure the primary location.
|
|
6587
|
-
*/
|
|
6588
|
-
defaultsTo: string().optional()
|
|
6589
|
-
});
|
|
6590
|
-
var DecoderStatsSchema = object({
|
|
6591
|
-
inputFps: number(),
|
|
6592
|
-
outputFps: number(),
|
|
6593
|
-
avgDecodeTimeMs: number(),
|
|
6594
|
-
droppedFrames: number()
|
|
6595
|
-
});
|
|
6596
|
-
var DecoderSessionConfigSchema = object({
|
|
6597
|
-
codec: string(),
|
|
6598
|
-
maxFps: number().default(0),
|
|
6599
|
-
outputFormat: _enum([
|
|
6600
|
-
"jpeg",
|
|
6601
|
-
"rgb",
|
|
6602
|
-
"bgr",
|
|
6603
|
-
"yuv420",
|
|
6604
|
-
"gray"
|
|
6605
|
-
]).default("jpeg"),
|
|
6606
|
-
scale: number().default(1),
|
|
6607
|
-
width: number().optional(),
|
|
6608
|
-
height: number().optional(),
|
|
6264
|
+
var DeviceType = /* @__PURE__ */ function(DeviceType) {
|
|
6265
|
+
DeviceType["Camera"] = "camera";
|
|
6266
|
+
DeviceType["Hub"] = "hub";
|
|
6267
|
+
DeviceType["Light"] = "light";
|
|
6268
|
+
DeviceType["Siren"] = "siren";
|
|
6269
|
+
DeviceType["Switch"] = "switch";
|
|
6270
|
+
DeviceType["Sensor"] = "sensor";
|
|
6271
|
+
DeviceType["Thermostat"] = "thermostat";
|
|
6272
|
+
DeviceType["Button"] = "button";
|
|
6273
|
+
/** Generic stateless event emitter — carries a device's EXACT declared
|
|
6274
|
+
* event vocabulary verbatim (no normalization). Installed with the
|
|
6275
|
+
* `event-emitter` cap. Sources: HA `event.*` entities (structured) and
|
|
6276
|
+
* HA bus events (e.g. `zha_event`, generic). */
|
|
6277
|
+
DeviceType["EventEmitter"] = "event-emitter";
|
|
6278
|
+
/** Firmware/software update entity — current vs available version,
|
|
6279
|
+
* updatable flag, update state, and an install action. Installed with
|
|
6280
|
+
* the `update` cap. Sources: Homematic firmware-update channels (and
|
|
6281
|
+
* reusable by other providers, e.g. HA `update.*` entities). */
|
|
6282
|
+
DeviceType["Update"] = "update";
|
|
6283
|
+
DeviceType["Generic"] = "generic";
|
|
6284
|
+
/** Generic notification delivery target (HA `notify.<service>`, future
|
|
6285
|
+
* Telegram / Discord / ntfy / SMTP, …). One device per delivery
|
|
6286
|
+
* endpoint; the `notifier` cap defines the send surface. */
|
|
6287
|
+
DeviceType["Notifier"] = "notifier";
|
|
6288
|
+
/** Pre-recorded action sequence with optional parameters
|
|
6289
|
+
* (HA `script.*`). Runnable via `script-runner` cap. */
|
|
6290
|
+
DeviceType["Script"] = "script";
|
|
6291
|
+
/** Automation rule (HA `automation.*`) — enable/disable + manual
|
|
6292
|
+
* trigger surface exposed via `automation-control` cap. */
|
|
6293
|
+
DeviceType["Automation"] = "automation";
|
|
6294
|
+
/** Door / smart lock device (HA `lock.*`). `lock-control` cap. */
|
|
6295
|
+
DeviceType["Lock"] = "lock";
|
|
6296
|
+
/** Window covering, blinds, garage door, valve, etc. (HA `cover.*`,
|
|
6297
|
+
* `valve.*`). `cover` cap with sub-roles for variant. */
|
|
6298
|
+
DeviceType["Cover"] = "cover";
|
|
6299
|
+
/** Pipe / water / gas valve with open/close/stop and optional
|
|
6300
|
+
* position (HA `valve.*`). `valve` cap — a cover-sibling actuator
|
|
6301
|
+
* modelled on the same open/closed lifecycle. */
|
|
6302
|
+
DeviceType["Valve"] = "valve";
|
|
6303
|
+
/** Humidifier / dehumidifier with on/off + target humidity + mode
|
|
6304
|
+
* (HA `humidifier.*`). `humidifier` cap — a climate-family actuator
|
|
6305
|
+
* modelled on the same target / mode lifecycle. */
|
|
6306
|
+
DeviceType["Humidifier"] = "humidifier";
|
|
6307
|
+
/** Water heater / boiler with target temperature + operation mode +
|
|
6308
|
+
* away mode (HA `water_heater.*`). `water-heater` cap — a
|
|
6309
|
+
* climate-family actuator. */
|
|
6310
|
+
DeviceType["WaterHeater"] = "water-heater";
|
|
6311
|
+
/** Ceiling / standing / exhaust fan (HA `fan.*`). `fan-control` cap. */
|
|
6312
|
+
DeviceType["Fan"] = "fan";
|
|
6313
|
+
/** Audio / video playback endpoint (HA `media_player.*`). Disjoint from
|
|
6314
|
+
* the camera surface — those use `Camera`. `media-player` cap. */
|
|
6315
|
+
DeviceType["MediaPlayer"] = "media-player";
|
|
6316
|
+
/** Security panel / alarm system (HA `alarm_control_panel.*`).
|
|
6317
|
+
* `alarm-panel` cap. */
|
|
6318
|
+
DeviceType["AlarmPanel"] = "alarm-panel";
|
|
6319
|
+
/** Generic user-settable input (HA `number` / `input_number` / `select`
|
|
6320
|
+
* / `input_select` / `text` / `input_text` / `input_datetime`).
|
|
6321
|
+
* Sub-type via `DeviceRole`: NumericControl / SelectControl /
|
|
6322
|
+
* TextControl / DateTimeControl. */
|
|
6323
|
+
DeviceType["Control"] = "control";
|
|
6324
|
+
/** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
|
|
6325
|
+
* `presence` cap. */
|
|
6326
|
+
DeviceType["Presence"] = "presence";
|
|
6327
|
+
/** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
|
|
6328
|
+
* `weather` cap. */
|
|
6329
|
+
DeviceType["Weather"] = "weather";
|
|
6330
|
+
/** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
|
|
6331
|
+
DeviceType["Vacuum"] = "vacuum";
|
|
6332
|
+
/** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
|
|
6333
|
+
* `lawn-mower-control` cap. */
|
|
6334
|
+
DeviceType["LawnMower"] = "lawn-mower";
|
|
6335
|
+
/** Physical HA device group — parent container for entity-children
|
|
6336
|
+
* adopted from a single HA device entry. Not renderable as a
|
|
6337
|
+
* standalone device; exists only to anchor child entities. */
|
|
6338
|
+
DeviceType["Container"] = "container";
|
|
6339
|
+
/** Single still-image entity (HA `image.*`). Read-only display of an
|
|
6340
|
+
* `entity_picture` signed URL the browser loads directly. `image` cap. */
|
|
6341
|
+
DeviceType["Image"] = "image";
|
|
6342
|
+
return DeviceType;
|
|
6343
|
+
}({});
|
|
6344
|
+
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
6345
|
+
DeviceFeature["BatteryOperated"] = "battery-operated";
|
|
6346
|
+
DeviceFeature["Rebootable"] = "rebootable";
|
|
6609
6347
|
/**
|
|
6610
|
-
*
|
|
6611
|
-
*
|
|
6612
|
-
*
|
|
6613
|
-
* per-camera filtering when diagnosing failures (e.g. node-av
|
|
6614
|
-
* sendPacket errors on a single hung camera).
|
|
6348
|
+
* Device supports an on-demand re-sync of its derived spec with its
|
|
6349
|
+
* upstream source — drives the generic Re-sync button. The owning
|
|
6350
|
+
* provider implements the action via the `device-adoption.resync` cap.
|
|
6615
6351
|
*/
|
|
6616
|
-
|
|
6352
|
+
DeviceFeature["Resyncable"] = "resyncable";
|
|
6353
|
+
DeviceFeature["NativeSnapshot"] = "native-snapshot";
|
|
6354
|
+
DeviceFeature["DoorbellButton"] = "doorbell-button";
|
|
6355
|
+
DeviceFeature["TwoWayAudio"] = "two-way-audio";
|
|
6356
|
+
DeviceFeature["PanTiltZoom"] = "pan-tilt-zoom";
|
|
6617
6357
|
/**
|
|
6618
|
-
*
|
|
6619
|
-
* `
|
|
6620
|
-
*
|
|
6621
|
-
*
|
|
6358
|
+
* Camera supports the on-firmware autotrack subsystem (subject-
|
|
6359
|
+
* following). Distinct from `PanTiltZoom` because not every PTZ
|
|
6360
|
+
* camera ships autotrack — the admin UI uses this flag to gate
|
|
6361
|
+
* the autotrack toggle / settings card without re-deriving from
|
|
6362
|
+
* the cap registry. Mirrors `ptz-autotrack` cap registration:
|
|
6363
|
+
* driver sets this feature when probe confirms the firmware
|
|
6364
|
+
* surface, and registers the cap in the same code path.
|
|
6622
6365
|
*/
|
|
6623
|
-
|
|
6366
|
+
DeviceFeature["PtzAutotrack"] = "ptz-autotrack";
|
|
6624
6367
|
/**
|
|
6625
|
-
*
|
|
6368
|
+
* Accessory exposes a "trigger on motion" toggle — the parent camera's
|
|
6369
|
+
* motion detection automatically activates this device. Mirrors
|
|
6370
|
+
* `motion-trigger` cap registration: drivers set this feature in the
|
|
6371
|
+
* same code path that calls `ctx.registerNativeCap(motionTriggerCapability, ...)`.
|
|
6626
6372
|
*
|
|
6627
|
-
*
|
|
6628
|
-
*
|
|
6629
|
-
*
|
|
6630
|
-
* into an OS shared-memory ring and drained as zero-pixel
|
|
6631
|
-
* `FrameHandle`s via `pullHandles`. A session is one mode or the
|
|
6632
|
-
* other — `pullFrames` returns nothing for an `'shm'` session and
|
|
6633
|
-
* `pullHandles` returns nothing for a `'callback'` session.
|
|
6373
|
+
* Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
|
|
6374
|
+
* fast scalar without binding fetch), notifier rules, and `listAll`
|
|
6375
|
+
* filters that want "all devices with on-motion behaviour".
|
|
6634
6376
|
*/
|
|
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
|
-
|
|
6377
|
+
DeviceFeature["MotionTrigger"] = "motion-trigger";
|
|
6378
|
+
/** Light supports rgb-triplet color via `color` cap. */
|
|
6379
|
+
DeviceFeature["LightColorRgb"] = "light-color-rgb";
|
|
6380
|
+
/** Light supports HSV color via `color` cap. */
|
|
6381
|
+
DeviceFeature["LightColorHsv"] = "light-color-hsv";
|
|
6382
|
+
/** Light supports color-temperature (mired) via `color` cap. */
|
|
6383
|
+
DeviceFeature["LightColorMired"] = "light-color-mired";
|
|
6384
|
+
/** Thermostat supports a `heat_cool` dual setpoint (targetLow +
|
|
6385
|
+
* targetHigh). Gates the range slider UI. */
|
|
6386
|
+
DeviceFeature["ClimateDualSetpoint"] = "climate-dual-setpoint";
|
|
6387
|
+
/** Thermostat exposes target humidity and/or current humidity
|
|
6388
|
+
* readings. Gates the humidity controls. */
|
|
6389
|
+
DeviceFeature["ClimateHumidity"] = "climate-humidity";
|
|
6390
|
+
/** Thermostat exposes a fan-mode selector. */
|
|
6391
|
+
DeviceFeature["ClimateFanMode"] = "climate-fan-mode";
|
|
6392
|
+
/** Thermostat exposes preset modes (eco / away / sleep / vendor). */
|
|
6393
|
+
DeviceFeature["ClimatePreset"] = "climate-preset";
|
|
6394
|
+
/** Cover exposes intermediate position control (0..100). Gates the
|
|
6395
|
+
* position slider UI. */
|
|
6396
|
+
DeviceFeature["CoverPositionable"] = "cover-positionable";
|
|
6397
|
+
/** Cover exposes slat-tilt control. Gates the tilt slider UI. */
|
|
6398
|
+
DeviceFeature["CoverTilt"] = "cover-tilt";
|
|
6399
|
+
/** Valve exposes intermediate position control (0..100). Gates the
|
|
6400
|
+
* position slider / drag surface UI. */
|
|
6401
|
+
DeviceFeature["ValvePositionable"] = "valve-positionable";
|
|
6402
|
+
/** Fan exposes a speed-percentage setter. Gates the speed slider UI. */
|
|
6403
|
+
DeviceFeature["FanSpeed"] = "fan-speed";
|
|
6404
|
+
/** Fan exposes a preset mode selector. */
|
|
6405
|
+
DeviceFeature["FanPreset"] = "fan-preset";
|
|
6406
|
+
/** Fan exposes blade direction (forward/reverse) — typical of
|
|
6407
|
+
* ceiling fans. */
|
|
6408
|
+
DeviceFeature["FanDirection"] = "fan-direction";
|
|
6409
|
+
/** Fan exposes an oscillation toggle. */
|
|
6410
|
+
DeviceFeature["FanOscillating"] = "fan-oscillating";
|
|
6411
|
+
/** Lock requires a PIN code on lock/unlock. Gates the code-entry
|
|
6412
|
+
* field on the UI lock-controls panel. */
|
|
6413
|
+
DeviceFeature["LockPinRequired"] = "lock-pin-required";
|
|
6414
|
+
/** Lock supports a latch-release ("open door") action distinct from
|
|
6415
|
+
* unlock. Mirrors HA `LockEntityFeature.OPEN` (bit 1) in
|
|
6416
|
+
* `supported_features`. Gates the Open Door button in the UI. */
|
|
6417
|
+
DeviceFeature["LockOpen"] = "lock-open";
|
|
6418
|
+
/** Media player exposes a seek-to-position surface. */
|
|
6419
|
+
DeviceFeature["MediaPlayerSeek"] = "media-player-seek";
|
|
6420
|
+
/** Media player exposes a volume-level setter. */
|
|
6421
|
+
DeviceFeature["MediaPlayerVolume"] = "media-player-volume";
|
|
6422
|
+
/** Media player exposes a mute toggle distinct from volume=0. */
|
|
6423
|
+
DeviceFeature["MediaPlayerMute"] = "media-player-mute";
|
|
6424
|
+
/** Media player exposes a shuffle toggle. */
|
|
6425
|
+
DeviceFeature["MediaPlayerShuffle"] = "media-player-shuffle";
|
|
6426
|
+
/** Media player exposes a repeat mode (off / all / one). */
|
|
6427
|
+
DeviceFeature["MediaPlayerRepeat"] = "media-player-repeat";
|
|
6428
|
+
/** Media player exposes a source / input selector. */
|
|
6429
|
+
DeviceFeature["MediaPlayerSelectSource"] = "media-player-select-source";
|
|
6430
|
+
/** Media player exposes a play-arbitrary-media surface (URL / id). */
|
|
6431
|
+
DeviceFeature["MediaPlayerPlayMedia"] = "media-player-play-media";
|
|
6432
|
+
/** Media player exposes next-track. */
|
|
6433
|
+
DeviceFeature["MediaPlayerNext"] = "media-player-next";
|
|
6434
|
+
/** Media player exposes previous-track. */
|
|
6435
|
+
DeviceFeature["MediaPlayerPrevious"] = "media-player-previous";
|
|
6436
|
+
/** Media player exposes stop distinct from pause. */
|
|
6437
|
+
DeviceFeature["MediaPlayerStop"] = "media-player-stop";
|
|
6438
|
+
/** Alarm panel requires a PIN code on arm/disarm. */
|
|
6439
|
+
DeviceFeature["AlarmPinRequired"] = "alarm-pin-required";
|
|
6440
|
+
/** Presence device carries GPS coordinates (lat/lng/accuracy) in
|
|
6441
|
+
* addition to a textual location. */
|
|
6442
|
+
DeviceFeature["PresenceGps"] = "presence-gps";
|
|
6443
|
+
/** Notifier accepts an inline / URL image attachment. */
|
|
6444
|
+
DeviceFeature["NotifierImage"] = "notifier-image";
|
|
6445
|
+
/** Notifier accepts a priority hint (high/normal/low). */
|
|
6446
|
+
DeviceFeature["NotifierPriority"] = "notifier-priority";
|
|
6447
|
+
/** Notifier accepts a free-form `data` payload for platform-specific
|
|
6448
|
+
* fields. */
|
|
6449
|
+
DeviceFeature["NotifierData"] = "notifier-data";
|
|
6450
|
+
/** Notifier supports interactive action buttons / callbacks. */
|
|
6451
|
+
DeviceFeature["NotifierActions"] = "notifier-actions";
|
|
6452
|
+
/** Notifier supports per-call recipient targeting (multi-user). */
|
|
6453
|
+
DeviceFeature["NotifierRecipients"] = "notifier-recipients";
|
|
6454
|
+
/** Script runner accepts a variables map on each run invocation. */
|
|
6455
|
+
DeviceFeature["ScriptVariables"] = "script-variables";
|
|
6456
|
+
/** Automation `trigger` accepts a skipCondition flag — fires the
|
|
6457
|
+
* automation's actions while bypassing its condition block. */
|
|
6458
|
+
DeviceFeature["AutomationSkipCondition"] = "automation-skip-condition";
|
|
6459
|
+
return DeviceFeature;
|
|
6460
|
+
}({});
|
|
6696
6461
|
/**
|
|
6697
|
-
*
|
|
6462
|
+
* Semantic role a device plays within its parent. Populated by driver
|
|
6463
|
+
* addons when creating accessory devices (Reolink siren/floodlight/
|
|
6464
|
+
* PIR/chime/autotrack/doorbell, ONVIF relay outputs, …). Used by the
|
|
6465
|
+
* admin UI to pick icons, labels, and widgets — a `Switch` with
|
|
6466
|
+
* `role: Floodlight` renders as a bulb with a brightness slider,
|
|
6467
|
+
* whereas a `Switch` with `role: Siren` renders as a klaxon.
|
|
6698
6468
|
*
|
|
6699
|
-
*
|
|
6700
|
-
*
|
|
6701
|
-
* wrappers return `unknown` — callers narrow structurally via type
|
|
6702
|
-
* guards, `typeof` checks, or helpers like `asRecord`/`asString`.
|
|
6469
|
+
* Undefined for top-level devices (cameras, NVRs, hubs). Persisted in
|
|
6470
|
+
* sqlite as a nullable TEXT column — old rows keep working unchanged.
|
|
6703
6471
|
*/
|
|
6472
|
+
var DeviceRole = /* @__PURE__ */ function(DeviceRole) {
|
|
6473
|
+
DeviceRole["Siren"] = "siren";
|
|
6474
|
+
DeviceRole["Floodlight"] = "floodlight";
|
|
6475
|
+
DeviceRole["Spotlight"] = "spotlight";
|
|
6476
|
+
DeviceRole["PirSensor"] = "pir-sensor";
|
|
6477
|
+
DeviceRole["Chime"] = "chime";
|
|
6478
|
+
DeviceRole["Autotrack"] = "autotrack";
|
|
6479
|
+
DeviceRole["Nightvision"] = "nightvision";
|
|
6480
|
+
DeviceRole["PrivacyMask"] = "privacy-mask";
|
|
6481
|
+
DeviceRole["Doorbell"] = "doorbell";
|
|
6482
|
+
/** Virtual HA toggle (input_boolean.*) — distinguishable from a
|
|
6483
|
+
* real Switch device for UI rendering / export adapters. */
|
|
6484
|
+
DeviceRole["BinaryHelper"] = "binary-helper";
|
|
6485
|
+
/** Generic motion / occupancy / moving event source. Distinct from
|
|
6486
|
+
* the camera accessory PirSensor role: that one is a camera child;
|
|
6487
|
+
* this is a standalone HA / 3rd-party motion sensor. */
|
|
6488
|
+
DeviceRole["MotionSensor"] = "motion-sensor";
|
|
6489
|
+
DeviceRole["ContactSensor"] = "contact-sensor";
|
|
6490
|
+
DeviceRole["LeakSensor"] = "leak-sensor";
|
|
6491
|
+
DeviceRole["SmokeSensor"] = "smoke-sensor";
|
|
6492
|
+
DeviceRole["COSensor"] = "co-sensor";
|
|
6493
|
+
DeviceRole["GasSensor"] = "gas-sensor";
|
|
6494
|
+
DeviceRole["TamperSensor"] = "tamper-sensor";
|
|
6495
|
+
DeviceRole["VibrationSensor"] = "vibration-sensor";
|
|
6496
|
+
DeviceRole["ConnectivitySensor"] = "connectivity-sensor";
|
|
6497
|
+
DeviceRole["SoundSensor"] = "sound-sensor";
|
|
6498
|
+
/** Fallback for `binary_sensor` without a known `device_class`. */
|
|
6499
|
+
DeviceRole["BinarySensor"] = "binary-sensor";
|
|
6500
|
+
DeviceRole["TemperatureSensor"] = "temperature-sensor";
|
|
6501
|
+
DeviceRole["HumiditySensor"] = "humidity-sensor";
|
|
6502
|
+
DeviceRole["AmbientLightSensor"] = "ambient-light-sensor";
|
|
6503
|
+
DeviceRole["PressureSensor"] = "pressure-sensor";
|
|
6504
|
+
DeviceRole["PowerSensor"] = "power-sensor";
|
|
6505
|
+
DeviceRole["EnergySensor"] = "energy-sensor";
|
|
6506
|
+
DeviceRole["VoltageSensor"] = "voltage-sensor";
|
|
6507
|
+
DeviceRole["CurrentSensor"] = "current-sensor";
|
|
6508
|
+
DeviceRole["AirQualitySensor"] = "air-quality-sensor";
|
|
6509
|
+
/** Battery level (numeric % via `sensor` OR low-bool via
|
|
6510
|
+
* `binary_sensor` — the cap distinguishes via the value type). */
|
|
6511
|
+
DeviceRole["BatterySensor"] = "battery-sensor";
|
|
6512
|
+
/** Fallback for `sensor` numeric without a known `device_class`. */
|
|
6513
|
+
DeviceRole["NumericSensor"] = "numeric-sensor";
|
|
6514
|
+
/** String / enum state (HA `sensor` with `state_class: enum` or
|
|
6515
|
+
* `attributes.options`). */
|
|
6516
|
+
DeviceRole["EnumSensor"] = "enum-sensor";
|
|
6517
|
+
/** Date / timestamp state (HA `sensor` with `device_class: timestamp`
|
|
6518
|
+
* or `date`). The slice carries the raw ISO string verbatim (hosted on
|
|
6519
|
+
* the `enum-sensor` cap); the UI renders it locale-formatted. */
|
|
6520
|
+
DeviceRole["DateTimeSensor"] = "datetime-sensor";
|
|
6521
|
+
/** Last-resort fallback when nothing else matches. */
|
|
6522
|
+
DeviceRole["GenericSensor"] = "generic-sensor";
|
|
6523
|
+
DeviceRole["NumericControl"] = "numeric-control";
|
|
6524
|
+
DeviceRole["SelectControl"] = "select-control";
|
|
6525
|
+
DeviceRole["TextControl"] = "text-control";
|
|
6526
|
+
DeviceRole["DateTimeControl"] = "datetime-control";
|
|
6527
|
+
/** Mobile push notifier (HA `notify.mobile_app_*`) — supports
|
|
6528
|
+
* rich features (image, priority, channel routing). */
|
|
6529
|
+
DeviceRole["MobilePushNotifier"] = "mobile-push-notifier";
|
|
6530
|
+
/** Chat / messaging service (HA `notify.telegram_*`,
|
|
6531
|
+
* `notify.discord_*`, etc.). */
|
|
6532
|
+
DeviceRole["MessagingNotifier"] = "messaging-notifier";
|
|
6533
|
+
/** Email-based delivery (HA `notify.smtp`, etc.). */
|
|
6534
|
+
DeviceRole["EmailNotifier"] = "email-notifier";
|
|
6535
|
+
/** Fallback when the notifier service name doesn't match a known
|
|
6536
|
+
* pattern. */
|
|
6537
|
+
DeviceRole["GenericNotifier"] = "generic-notifier";
|
|
6538
|
+
return DeviceRole;
|
|
6539
|
+
}({});
|
|
6704
6540
|
/**
|
|
6705
|
-
*
|
|
6541
|
+
* Generic types for capability definitions.
|
|
6706
6542
|
*
|
|
6707
|
-
*
|
|
6708
|
-
*
|
|
6709
|
-
*
|
|
6710
|
-
*
|
|
6711
|
-
*
|
|
6543
|
+
* A capability is defined with Zod schemas for methods, events, and settings.
|
|
6544
|
+
* TypeScript types are inferred via z.infer<> — zero duplication.
|
|
6545
|
+
*
|
|
6546
|
+
* Pattern:
|
|
6547
|
+
* 1. Define Zod schemas for data, methods, settings
|
|
6548
|
+
* 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
|
|
6549
|
+
* 3. Export type IProvider = InferProvider<typeof capabilityDef>
|
|
6550
|
+
* 4. Addon implements IProvider
|
|
6551
|
+
* 5. Registry auto-mounts tRPC router from definition.methods
|
|
6712
6552
|
*/
|
|
6713
|
-
function parseJsonUnknown(text) {
|
|
6714
|
-
return JSON.parse(text);
|
|
6715
|
-
}
|
|
6716
|
-
/** Narrow an unknown value to a plain `Record<string, unknown>` or return null. */
|
|
6717
|
-
function asJsonObject(value) {
|
|
6718
|
-
if (value === null || typeof value !== "object" || Array.isArray(value)) return null;
|
|
6719
|
-
return { ...value };
|
|
6720
|
-
}
|
|
6721
|
-
function hfModelUrl(repo, path) {
|
|
6722
|
-
return `https://huggingface.co/${repo}/resolve/main/${path}`;
|
|
6723
|
-
}
|
|
6724
6553
|
/**
|
|
6725
|
-
|
|
6726
|
-
*
|
|
6727
|
-
*
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6554
|
+
* Output schema shared by the contribution + live methods.
|
|
6555
|
+
*
|
|
6556
|
+
* Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
|
|
6557
|
+
* tabs[]) without importing from `../interfaces/config-ui.js` — a
|
|
6558
|
+
* concrete-but-lenient Zod object keeps tRPC output inference happy
|
|
6559
|
+
* (using `z.unknown()` here collapses unrelated router branches to
|
|
6560
|
+
* `unknown` when the generator re-inlines the huge AppRouter type).
|
|
6561
|
+
*
|
|
6562
|
+
* `.passthrough()` on sections/fields accepts whatever FormBuilder
|
|
6563
|
+
* extensions the caller adds (showWhen, displayScale, …) without
|
|
6564
|
+
* rebuilding every time a new field kind is introduced.
|
|
6565
|
+
*/
|
|
6566
|
+
var ContributionSectionSchema = object({
|
|
6567
|
+
id: string(),
|
|
6568
|
+
title: string(),
|
|
6569
|
+
description: string().optional(),
|
|
6570
|
+
style: _enum(["card", "accordion"]).optional(),
|
|
6571
|
+
defaultCollapsed: boolean().optional(),
|
|
6572
|
+
columns: union([
|
|
6573
|
+
literal(1),
|
|
6574
|
+
literal(2),
|
|
6575
|
+
literal(3),
|
|
6576
|
+
literal(4)
|
|
6577
|
+
]).optional(),
|
|
6578
|
+
tab: string().optional(),
|
|
6579
|
+
location: _enum(["settings", "top-tab"]).optional(),
|
|
6580
|
+
order: number().optional(),
|
|
6581
|
+
fields: array(any())
|
|
6582
|
+
});
|
|
6583
|
+
object({
|
|
6584
|
+
tabs: array(object({
|
|
6585
|
+
id: string(),
|
|
6586
|
+
label: string(),
|
|
6587
|
+
icon: string(),
|
|
6588
|
+
order: number().optional()
|
|
6589
|
+
})).optional(),
|
|
6590
|
+
sections: array(ContributionSectionSchema)
|
|
6591
|
+
}).nullable();
|
|
6592
|
+
object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
6593
|
+
deviceId: number(),
|
|
6594
|
+
patch: record(string(), unknown())
|
|
6595
|
+
}), object({ success: literal(true) });
|
|
6596
|
+
object({ deviceId: number() }), unknown().nullable();
|
|
6597
|
+
/** Shorthand to define a method schema */
|
|
6598
|
+
function method(input, output, options) {
|
|
6599
|
+
return {
|
|
6600
|
+
input,
|
|
6601
|
+
output,
|
|
6602
|
+
kind: options?.kind ?? "query",
|
|
6603
|
+
auth: options?.auth ?? "protected",
|
|
6604
|
+
...options?.access !== void 0 ? { access: options.access } : {},
|
|
6605
|
+
timeoutMs: options?.timeoutMs
|
|
6606
|
+
};
|
|
6733
6607
|
}
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
|
|
6764
|
-
|
|
6765
|
-
|
|
6766
|
-
|
|
6767
|
-
|
|
6768
|
-
|
|
6769
|
-
|
|
6770
|
-
|
|
6771
|
-
|
|
6772
|
-
|
|
6773
|
-
|
|
6774
|
-
|
|
6775
|
-
|
|
6776
|
-
|
|
6777
|
-
|
|
6778
|
-
|
|
6779
|
-
|
|
6780
|
-
|
|
6781
|
-
|
|
6782
|
-
|
|
6783
|
-
|
|
6784
|
-
|
|
6785
|
-
|
|
6786
|
-
|
|
6787
|
-
|
|
6788
|
-
|
|
6789
|
-
|
|
6790
|
-
|
|
6791
|
-
|
|
6792
|
-
|
|
6793
|
-
|
|
6794
|
-
|
|
6795
|
-
|
|
6796
|
-
|
|
6797
|
-
|
|
6798
|
-
|
|
6799
|
-
|
|
6800
|
-
|
|
6801
|
-
|
|
6802
|
-
|
|
6803
|
-
|
|
6804
|
-
|
|
6805
|
-
|
|
6806
|
-
|
|
6807
|
-
|
|
6808
|
-
|
|
6809
|
-
|
|
6810
|
-
|
|
6811
|
-
|
|
6812
|
-
|
|
6813
|
-
|
|
6814
|
-
|
|
6815
|
-
|
|
6816
|
-
|
|
6817
|
-
|
|
6818
|
-
|
|
6819
|
-
|
|
6820
|
-
|
|
6821
|
-
|
|
6822
|
-
|
|
6823
|
-
|
|
6824
|
-
|
|
6825
|
-
|
|
6826
|
-
|
|
6827
|
-
|
|
6828
|
-
|
|
6829
|
-
|
|
6830
|
-
|
|
6831
|
-
|
|
6832
|
-
|
|
6833
|
-
|
|
6834
|
-
|
|
6835
|
-
|
|
6836
|
-
|
|
6837
|
-
|
|
6838
|
-
|
|
6839
|
-
|
|
6840
|
-
|
|
6841
|
-
|
|
6842
|
-
|
|
6843
|
-
|
|
6844
|
-
|
|
6845
|
-
|
|
6846
|
-
|
|
6847
|
-
|
|
6848
|
-
|
|
6849
|
-
|
|
6850
|
-
|
|
6851
|
-
|
|
6852
|
-
|
|
6853
|
-
|
|
6854
|
-
|
|
6855
|
-
|
|
6856
|
-
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
|
|
6861
|
-
|
|
6862
|
-
|
|
6863
|
-
|
|
6864
|
-
|
|
6865
|
-
|
|
6866
|
-
|
|
6867
|
-
|
|
6868
|
-
|
|
6869
|
-
|
|
6870
|
-
|
|
6871
|
-
|
|
6872
|
-
|
|
6873
|
-
|
|
6874
|
-
|
|
6875
|
-
|
|
6876
|
-
|
|
6877
|
-
|
|
6878
|
-
|
|
6879
|
-
{
|
|
6880
|
-
|
|
6881
|
-
|
|
6882
|
-
|
|
6883
|
-
|
|
6884
|
-
|
|
6885
|
-
|
|
6886
|
-
|
|
6887
|
-
|
|
6888
|
-
|
|
6889
|
-
|
|
6890
|
-
|
|
6891
|
-
|
|
6892
|
-
|
|
6893
|
-
|
|
6894
|
-
|
|
6895
|
-
|
|
6896
|
-
|
|
6897
|
-
|
|
6898
|
-
|
|
6899
|
-
|
|
6900
|
-
|
|
6901
|
-
|
|
6902
|
-
|
|
6903
|
-
|
|
6904
|
-
|
|
6905
|
-
|
|
6906
|
-
|
|
6907
|
-
|
|
6908
|
-
|
|
6909
|
-
|
|
6910
|
-
|
|
6911
|
-
|
|
6912
|
-
|
|
6913
|
-
|
|
6914
|
-
|
|
6915
|
-
|
|
6916
|
-
|
|
6917
|
-
|
|
6918
|
-
|
|
6919
|
-
|
|
6920
|
-
|
|
6921
|
-
|
|
6922
|
-
|
|
6923
|
-
|
|
6924
|
-
|
|
6925
|
-
|
|
6926
|
-
|
|
6927
|
-
|
|
6928
|
-
|
|
6929
|
-
|
|
6930
|
-
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6934
|
-
|
|
6935
|
-
|
|
6936
|
-
|
|
6937
|
-
|
|
6938
|
-
|
|
6939
|
-
|
|
6940
|
-
|
|
6941
|
-
|
|
6942
|
-
|
|
6943
|
-
|
|
6944
|
-
|
|
6945
|
-
|
|
6946
|
-
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6956
|
-
|
|
6957
|
-
|
|
6958
|
-
|
|
6959
|
-
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
|
|
6967
|
-
|
|
6968
|
-
|
|
6969
|
-
|
|
6970
|
-
|
|
6971
|
-
|
|
6972
|
-
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
6976
|
-
|
|
6977
|
-
|
|
6978
|
-
|
|
6979
|
-
|
|
6980
|
-
|
|
6981
|
-
|
|
6982
|
-
|
|
6983
|
-
|
|
6984
|
-
|
|
6985
|
-
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
|
|
6989
|
-
|
|
6990
|
-
|
|
6991
|
-
|
|
6992
|
-
|
|
6993
|
-
|
|
6994
|
-
|
|
6995
|
-
|
|
6996
|
-
|
|
6997
|
-
|
|
6998
|
-
|
|
6999
|
-
|
|
7000
|
-
|
|
7001
|
-
|
|
7002
|
-
|
|
7003
|
-
|
|
7004
|
-
|
|
7005
|
-
|
|
7006
|
-
|
|
7007
|
-
|
|
7008
|
-
|
|
7009
|
-
|
|
7010
|
-
|
|
7011
|
-
|
|
7012
|
-
|
|
7013
|
-
|
|
7014
|
-
|
|
7015
|
-
|
|
7016
|
-
|
|
7017
|
-
|
|
7018
|
-
|
|
7019
|
-
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
|
|
7024
|
-
|
|
7025
|
-
|
|
7026
|
-
|
|
7027
|
-
|
|
7028
|
-
|
|
7029
|
-
|
|
7030
|
-
|
|
7031
|
-
|
|
7032
|
-
|
|
7033
|
-
|
|
7034
|
-
|
|
7035
|
-
|
|
7036
|
-
|
|
7037
|
-
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7043
|
-
|
|
7044
|
-
|
|
7045
|
-
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
motorcycle: "vehicle",
|
|
7062
|
-
airplane: "vehicle",
|
|
7063
|
-
bus: "vehicle",
|
|
7064
|
-
train: "vehicle",
|
|
7065
|
-
truck: "vehicle",
|
|
7066
|
-
boat: "vehicle",
|
|
7067
|
-
bird: "animal",
|
|
7068
|
-
cat: "animal",
|
|
7069
|
-
dog: "animal",
|
|
7070
|
-
horse: "animal",
|
|
7071
|
-
sheep: "animal",
|
|
7072
|
-
cow: "animal",
|
|
7073
|
-
elephant: "animal",
|
|
7074
|
-
bear: "animal",
|
|
7075
|
-
zebra: "animal",
|
|
7076
|
-
giraffe: "animal"
|
|
7077
|
-
},
|
|
7078
|
-
preserveOriginal: false
|
|
7079
|
-
};
|
|
7080
|
-
var AUDIO_MACRO_LABELS = [
|
|
7081
|
-
{
|
|
7082
|
-
id: "speech",
|
|
7083
|
-
name: "Speech",
|
|
7084
|
-
icon: "🗣️"
|
|
7085
|
-
},
|
|
7086
|
-
{
|
|
7087
|
-
id: "scream",
|
|
7088
|
-
name: "Scream / Shout",
|
|
7089
|
-
icon: "😱"
|
|
7090
|
-
},
|
|
7091
|
-
{
|
|
7092
|
-
id: "crying",
|
|
7093
|
-
name: "Crying / Baby",
|
|
7094
|
-
icon: "😢"
|
|
7095
|
-
},
|
|
7096
|
-
{
|
|
7097
|
-
id: "laughter",
|
|
7098
|
-
name: "Laughter",
|
|
7099
|
-
icon: "😂"
|
|
7100
|
-
},
|
|
7101
|
-
{
|
|
7102
|
-
id: "music",
|
|
7103
|
-
name: "Music",
|
|
7104
|
-
icon: "🎵"
|
|
7105
|
-
},
|
|
7106
|
-
{
|
|
7107
|
-
id: "dog",
|
|
7108
|
-
name: "Dog",
|
|
7109
|
-
icon: "🐕"
|
|
7110
|
-
},
|
|
7111
|
-
{
|
|
7112
|
-
id: "cat",
|
|
7113
|
-
name: "Cat",
|
|
7114
|
-
icon: "🐈"
|
|
7115
|
-
},
|
|
7116
|
-
{
|
|
7117
|
-
id: "bird",
|
|
7118
|
-
name: "Bird",
|
|
7119
|
-
icon: "🐦"
|
|
7120
|
-
},
|
|
7121
|
-
{
|
|
7122
|
-
id: "animal",
|
|
7123
|
-
name: "Animal (other)",
|
|
7124
|
-
icon: "🐾"
|
|
7125
|
-
},
|
|
7126
|
-
{
|
|
7127
|
-
id: "alarm",
|
|
7128
|
-
name: "Alarm / Siren",
|
|
7129
|
-
icon: "🚨"
|
|
7130
|
-
},
|
|
7131
|
-
{
|
|
7132
|
-
id: "doorbell",
|
|
7133
|
-
name: "Doorbell / Knock",
|
|
7134
|
-
icon: "🔔"
|
|
7135
|
-
},
|
|
7136
|
-
{
|
|
7137
|
-
id: "glass_breaking",
|
|
7138
|
-
name: "Glass Breaking",
|
|
7139
|
-
icon: "💥"
|
|
7140
|
-
},
|
|
7141
|
-
{
|
|
7142
|
-
id: "gunshot",
|
|
7143
|
-
name: "Gunshot / Explosion",
|
|
7144
|
-
icon: "💣"
|
|
7145
|
-
},
|
|
7146
|
-
{
|
|
7147
|
-
id: "vehicle",
|
|
7148
|
-
name: "Vehicle",
|
|
7149
|
-
icon: "🚗"
|
|
7150
|
-
},
|
|
7151
|
-
{
|
|
7152
|
-
id: "siren",
|
|
7153
|
-
name: "Emergency Siren",
|
|
7154
|
-
icon: "🚑"
|
|
7155
|
-
},
|
|
7156
|
-
{
|
|
7157
|
-
id: "fire",
|
|
7158
|
-
name: "Fire / Smoke",
|
|
7159
|
-
icon: "🔥"
|
|
7160
|
-
},
|
|
7161
|
-
{
|
|
7162
|
-
id: "water",
|
|
7163
|
-
name: "Water",
|
|
7164
|
-
icon: "💧"
|
|
7165
|
-
},
|
|
7166
|
-
{
|
|
7167
|
-
id: "wind",
|
|
7168
|
-
name: "Wind / Weather",
|
|
7169
|
-
icon: "🌬️"
|
|
7170
|
-
},
|
|
7171
|
-
{
|
|
7172
|
-
id: "door",
|
|
7173
|
-
name: "Door",
|
|
7174
|
-
icon: "🚪"
|
|
7175
|
-
},
|
|
7176
|
-
{
|
|
7177
|
-
id: "footsteps",
|
|
7178
|
-
name: "Footsteps",
|
|
7179
|
-
icon: "👣"
|
|
7180
|
-
},
|
|
7181
|
-
{
|
|
7182
|
-
id: "crowd",
|
|
7183
|
-
name: "Crowd / Chatter",
|
|
7184
|
-
icon: "👥"
|
|
7185
|
-
},
|
|
7186
|
-
{
|
|
7187
|
-
id: "telephone",
|
|
7188
|
-
name: "Telephone",
|
|
7189
|
-
icon: "📞"
|
|
7190
|
-
},
|
|
7191
|
-
{
|
|
7192
|
-
id: "engine",
|
|
7193
|
-
name: "Engine / Motor",
|
|
7194
|
-
icon: "⚙️"
|
|
7195
|
-
},
|
|
7196
|
-
{
|
|
7197
|
-
id: "tools",
|
|
7198
|
-
name: "Tools / Construction",
|
|
7199
|
-
icon: "🔨"
|
|
7200
|
-
},
|
|
7201
|
-
{
|
|
7202
|
-
id: "silence",
|
|
7203
|
-
name: "Silence",
|
|
7204
|
-
icon: "🤫"
|
|
7205
|
-
}
|
|
7206
|
-
];
|
|
7207
|
-
var YAMNET_TO_MACRO = {
|
|
7208
|
-
mapping: {
|
|
7209
|
-
Speech: "speech",
|
|
7210
|
-
"Child speech, kid speaking": "speech",
|
|
7211
|
-
Conversation: "speech",
|
|
7212
|
-
"Narration, monologue": "speech",
|
|
7213
|
-
Babbling: "speech",
|
|
7214
|
-
Whispering: "speech",
|
|
7215
|
-
"Speech synthesizer": "speech",
|
|
7216
|
-
Humming: "speech",
|
|
7217
|
-
Rapping: "speech",
|
|
7218
|
-
Singing: "speech",
|
|
7219
|
-
Choir: "speech",
|
|
7220
|
-
"Child singing": "speech",
|
|
7221
|
-
Shout: "scream",
|
|
7222
|
-
Bellow: "scream",
|
|
7223
|
-
Yell: "scream",
|
|
7224
|
-
Screaming: "scream",
|
|
7225
|
-
"Children shouting": "scream",
|
|
7226
|
-
Whoop: "scream",
|
|
7227
|
-
"Crying, sobbing": "crying",
|
|
7228
|
-
"Baby cry, infant cry": "crying",
|
|
7229
|
-
Whimper: "crying",
|
|
7230
|
-
"Wail, moan": "crying",
|
|
7231
|
-
Groan: "crying",
|
|
7232
|
-
Laughter: "laughter",
|
|
7233
|
-
"Baby laughter": "laughter",
|
|
7234
|
-
Giggle: "laughter",
|
|
7235
|
-
Snicker: "laughter",
|
|
7236
|
-
"Belly laugh": "laughter",
|
|
7237
|
-
"Chuckle, chortle": "laughter",
|
|
7238
|
-
Music: "music",
|
|
7239
|
-
"Musical instrument": "music",
|
|
7240
|
-
Guitar: "music",
|
|
7241
|
-
Piano: "music",
|
|
7242
|
-
Drum: "music",
|
|
7243
|
-
"Drum kit": "music",
|
|
7244
|
-
"Violin, fiddle": "music",
|
|
7245
|
-
Flute: "music",
|
|
7246
|
-
Saxophone: "music",
|
|
7247
|
-
Trumpet: "music",
|
|
7248
|
-
Synthesizer: "music",
|
|
7249
|
-
"Pop music": "music",
|
|
7250
|
-
"Rock music": "music",
|
|
7251
|
-
"Hip hop music": "music",
|
|
7252
|
-
"Classical music": "music",
|
|
7253
|
-
Jazz: "music",
|
|
7254
|
-
"Electronic music": "music",
|
|
7255
|
-
"Background music": "music",
|
|
7256
|
-
Dog: "dog",
|
|
7257
|
-
Bark: "dog",
|
|
7258
|
-
Yip: "dog",
|
|
7259
|
-
Howl: "dog",
|
|
7260
|
-
"Bow-wow": "dog",
|
|
7261
|
-
Growling: "dog",
|
|
7262
|
-
"Whimper (dog)": "dog",
|
|
7263
|
-
Cat: "cat",
|
|
7264
|
-
Purr: "cat",
|
|
7265
|
-
Meow: "cat",
|
|
7266
|
-
Hiss: "cat",
|
|
7267
|
-
Caterwaul: "cat",
|
|
7268
|
-
Bird: "bird",
|
|
7269
|
-
"Bird vocalization, bird call, bird song": "bird",
|
|
7270
|
-
"Chirp, tweet": "bird",
|
|
7271
|
-
Squawk: "bird",
|
|
7272
|
-
Crow: "bird",
|
|
7273
|
-
Owl: "bird",
|
|
7274
|
-
"Pigeon, dove": "bird",
|
|
7275
|
-
Animal: "animal",
|
|
7276
|
-
"Domestic animals, pets": "animal",
|
|
7277
|
-
"Livestock, farm animals, working animals": "animal",
|
|
7278
|
-
Horse: "animal",
|
|
7279
|
-
"Cattle, bovinae": "animal",
|
|
7280
|
-
Pig: "animal",
|
|
7281
|
-
Sheep: "animal",
|
|
7282
|
-
Goat: "animal",
|
|
7283
|
-
Frog: "animal",
|
|
7284
|
-
Insect: "animal",
|
|
7285
|
-
Cricket: "animal",
|
|
7286
|
-
Alarm: "alarm",
|
|
7287
|
-
"Alarm clock": "alarm",
|
|
7288
|
-
"Smoke detector, smoke alarm": "alarm",
|
|
7289
|
-
"Fire alarm": "alarm",
|
|
7290
|
-
Buzzer: "alarm",
|
|
7291
|
-
"Civil defense siren": "alarm",
|
|
7292
|
-
"Car alarm": "alarm",
|
|
7293
|
-
Siren: "siren",
|
|
7294
|
-
"Police car (siren)": "siren",
|
|
7295
|
-
"Ambulance (siren)": "siren",
|
|
7296
|
-
"Fire engine, fire truck (siren)": "siren",
|
|
7297
|
-
"Emergency vehicle": "siren",
|
|
7298
|
-
Foghorn: "siren",
|
|
7299
|
-
Doorbell: "doorbell",
|
|
7300
|
-
"Ding-dong": "doorbell",
|
|
7301
|
-
Knock: "doorbell",
|
|
7302
|
-
Tap: "doorbell",
|
|
7303
|
-
Glass: "glass_breaking",
|
|
7304
|
-
Shatter: "glass_breaking",
|
|
7305
|
-
"Chink, clink": "glass_breaking",
|
|
7306
|
-
"Gunshot, gunfire": "gunshot",
|
|
7307
|
-
"Machine gun": "gunshot",
|
|
7308
|
-
Explosion: "gunshot",
|
|
7309
|
-
Fireworks: "gunshot",
|
|
7310
|
-
Firecracker: "gunshot",
|
|
7311
|
-
"Artillery fire": "gunshot",
|
|
7312
|
-
"Cap gun": "gunshot",
|
|
7313
|
-
Boom: "gunshot",
|
|
7314
|
-
Vehicle: "vehicle",
|
|
7315
|
-
Car: "vehicle",
|
|
7316
|
-
Truck: "vehicle",
|
|
7317
|
-
Bus: "vehicle",
|
|
7318
|
-
Motorcycle: "vehicle",
|
|
7319
|
-
"Car passing by": "vehicle",
|
|
7320
|
-
"Vehicle horn, car horn, honking": "vehicle",
|
|
7321
|
-
"Traffic noise, roadway noise": "vehicle",
|
|
7322
|
-
Train: "vehicle",
|
|
7323
|
-
Aircraft: "vehicle",
|
|
7324
|
-
Helicopter: "vehicle",
|
|
7325
|
-
Bicycle: "vehicle",
|
|
7326
|
-
Skateboard: "vehicle",
|
|
7327
|
-
Fire: "fire",
|
|
7328
|
-
Crackle: "fire",
|
|
7329
|
-
Water: "water",
|
|
7330
|
-
Rain: "water",
|
|
7331
|
-
Raindrop: "water",
|
|
7332
|
-
"Rain on surface": "water",
|
|
7333
|
-
Stream: "water",
|
|
7334
|
-
Waterfall: "water",
|
|
7335
|
-
Ocean: "water",
|
|
7336
|
-
"Waves, surf": "water",
|
|
7337
|
-
"Splash, splatter": "water",
|
|
7338
|
-
Wind: "wind",
|
|
7339
|
-
Thunderstorm: "wind",
|
|
7340
|
-
Thunder: "wind",
|
|
7341
|
-
"Wind noise (microphone)": "wind",
|
|
7342
|
-
"Rustling leaves": "wind",
|
|
7343
|
-
Door: "door",
|
|
7344
|
-
"Sliding door": "door",
|
|
7345
|
-
Slam: "door",
|
|
7346
|
-
"Cupboard open or close": "door",
|
|
7347
|
-
"Walk, footsteps": "footsteps",
|
|
7348
|
-
Run: "footsteps",
|
|
7349
|
-
Shuffle: "footsteps",
|
|
7350
|
-
Crowd: "crowd",
|
|
7351
|
-
Chatter: "crowd",
|
|
7352
|
-
Cheering: "crowd",
|
|
7353
|
-
Applause: "crowd",
|
|
7354
|
-
"Children playing": "crowd",
|
|
7355
|
-
"Hubbub, speech noise, speech babble": "crowd",
|
|
7356
|
-
Telephone: "telephone",
|
|
7357
|
-
"Telephone bell ringing": "telephone",
|
|
7358
|
-
Ringtone: "telephone",
|
|
7359
|
-
"Telephone dialing, DTMF": "telephone",
|
|
7360
|
-
"Busy signal": "telephone",
|
|
7361
|
-
Engine: "engine",
|
|
7362
|
-
"Engine starting": "engine",
|
|
7363
|
-
Idling: "engine",
|
|
7364
|
-
"Accelerating, revving, vroom": "engine",
|
|
7365
|
-
"Light engine (high frequency)": "engine",
|
|
7366
|
-
"Medium engine (mid frequency)": "engine",
|
|
7367
|
-
"Heavy engine (low frequency)": "engine",
|
|
7368
|
-
"Lawn mower": "engine",
|
|
7369
|
-
Chainsaw: "engine",
|
|
7370
|
-
Hammer: "tools",
|
|
7371
|
-
Jackhammer: "tools",
|
|
7372
|
-
Sawing: "tools",
|
|
7373
|
-
"Power tool": "tools",
|
|
7374
|
-
Drill: "tools",
|
|
7375
|
-
Sanding: "tools",
|
|
7376
|
-
Silence: "silence"
|
|
7377
|
-
},
|
|
7378
|
-
preserveOriginal: false
|
|
7379
|
-
};
|
|
7380
|
-
var APPLE_SA_TO_MACRO = {
|
|
7381
|
-
mapping: {
|
|
7382
|
-
speech: "speech",
|
|
7383
|
-
child_speech: "speech",
|
|
7384
|
-
conversation: "speech",
|
|
7385
|
-
whispering: "speech",
|
|
7386
|
-
singing: "speech",
|
|
7387
|
-
humming: "speech",
|
|
7388
|
-
shout: "scream",
|
|
7389
|
-
yell: "scream",
|
|
7390
|
-
screaming: "scream",
|
|
7391
|
-
crying: "crying",
|
|
7392
|
-
baby_crying: "crying",
|
|
7393
|
-
sobbing: "crying",
|
|
7394
|
-
laughter: "laughter",
|
|
7395
|
-
baby_laughter: "laughter",
|
|
7396
|
-
giggling: "laughter",
|
|
7397
|
-
music: "music",
|
|
7398
|
-
guitar: "music",
|
|
7399
|
-
piano: "music",
|
|
7400
|
-
drums: "music",
|
|
7401
|
-
dog_bark: "dog",
|
|
7402
|
-
dog_bow_wow: "dog",
|
|
7403
|
-
dog_growling: "dog",
|
|
7404
|
-
dog_howl: "dog",
|
|
7405
|
-
cat_meow: "cat",
|
|
7406
|
-
cat_purr: "cat",
|
|
7407
|
-
cat_hiss: "cat",
|
|
7408
|
-
bird: "bird",
|
|
7409
|
-
bird_chirp: "bird",
|
|
7410
|
-
bird_squawk: "bird",
|
|
7411
|
-
animal: "animal",
|
|
7412
|
-
horse: "animal",
|
|
7413
|
-
cow_moo: "animal",
|
|
7414
|
-
insect: "animal",
|
|
7415
|
-
alarm: "alarm",
|
|
7416
|
-
smoke_alarm: "alarm",
|
|
7417
|
-
fire_alarm: "alarm",
|
|
7418
|
-
car_alarm: "alarm",
|
|
7419
|
-
siren: "siren",
|
|
7420
|
-
police_siren: "siren",
|
|
7421
|
-
ambulance_siren: "siren",
|
|
7422
|
-
doorbell: "doorbell",
|
|
7423
|
-
door_knock: "doorbell",
|
|
7424
|
-
knocking: "doorbell",
|
|
7425
|
-
glass_breaking: "glass_breaking",
|
|
7426
|
-
glass_shatter: "glass_breaking",
|
|
7427
|
-
gunshot: "gunshot",
|
|
7428
|
-
explosion: "gunshot",
|
|
7429
|
-
fireworks: "gunshot",
|
|
7430
|
-
car: "vehicle",
|
|
7431
|
-
truck: "vehicle",
|
|
7432
|
-
motorcycle: "vehicle",
|
|
7433
|
-
car_horn: "vehicle",
|
|
7434
|
-
vehicle_horn: "vehicle",
|
|
7435
|
-
traffic: "vehicle",
|
|
7436
|
-
fire: "fire",
|
|
7437
|
-
fire_crackle: "fire",
|
|
7438
|
-
water: "water",
|
|
7439
|
-
rain: "water",
|
|
7440
|
-
ocean: "water",
|
|
7441
|
-
splash: "water",
|
|
7442
|
-
wind: "wind",
|
|
7443
|
-
thunder: "wind",
|
|
7444
|
-
thunderstorm: "wind",
|
|
7445
|
-
door: "door",
|
|
7446
|
-
door_slam: "door",
|
|
7447
|
-
sliding_door: "door",
|
|
7448
|
-
footsteps: "footsteps",
|
|
7449
|
-
walking: "footsteps",
|
|
7450
|
-
running: "footsteps",
|
|
7451
|
-
crowd: "crowd",
|
|
7452
|
-
chatter: "crowd",
|
|
7453
|
-
cheering: "crowd",
|
|
7454
|
-
applause: "crowd",
|
|
7455
|
-
telephone_ring: "telephone",
|
|
7456
|
-
ringtone: "telephone",
|
|
7457
|
-
engine: "engine",
|
|
7458
|
-
engine_starting: "engine",
|
|
7459
|
-
lawn_mower: "engine",
|
|
7460
|
-
chainsaw: "engine",
|
|
7461
|
-
hammer: "tools",
|
|
7462
|
-
jackhammer: "tools",
|
|
7463
|
-
drill: "tools",
|
|
7464
|
-
power_tool: "tools",
|
|
7465
|
-
silence: "silence"
|
|
7466
|
-
},
|
|
7467
|
-
preserveOriginal: false
|
|
7468
|
-
};
|
|
7469
|
-
var _macroLookup = /* @__PURE__ */ new Map();
|
|
7470
|
-
for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7471
|
-
for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7472
|
-
/** Map a raw audio label (YAMNet or Apple SoundAnalysis) to its macro class. Returns null if unmapped. */
|
|
7473
|
-
function mapAudioLabelToMacro(label) {
|
|
7474
|
-
return _macroLookup.get(label.toLowerCase()) ?? null;
|
|
6608
|
+
/** Shorthand to define an event schema */
|
|
6609
|
+
function event(data) {
|
|
6610
|
+
return { data };
|
|
6611
|
+
}
|
|
6612
|
+
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
6613
|
+
var VersionOutputSchema = object({ version: string() });
|
|
6614
|
+
method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
|
|
6615
|
+
/**
|
|
6616
|
+
* device-ops — device-scoped cap that unifies the per-IDevice operations
|
|
6617
|
+
* previously routed through the `.device-ops` Moleculer bridge service.
|
|
6618
|
+
*
|
|
6619
|
+
* Each worker that hosts live `IDevice` instances auto-registers a native
|
|
6620
|
+
* provider for this cap (per device) backed by its local
|
|
6621
|
+
* `DeviceRegistry`. Hub-side callers reach it transparently through
|
|
6622
|
+
* `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
|
|
6623
|
+
* `deviceId` + `nodeId` and dispatches through the standard cap-router,
|
|
6624
|
+
* so there's no parallel bridge path anymore.
|
|
6625
|
+
*
|
|
6626
|
+
* The surface is intentionally small — every method corresponds to a
|
|
6627
|
+
* single action on the live `IDevice` (or `ICameraDevice` for
|
|
6628
|
+
* `getStreamSources`). Richer orchestration (enable/disable with
|
|
6629
|
+
* integration plumbing, bulk updates) stays in the `device-manager` cap;
|
|
6630
|
+
* `device-ops` is the per-device primitive the device-manager routes to.
|
|
6631
|
+
*/
|
|
6632
|
+
var StreamSourceEntrySchema = object({
|
|
6633
|
+
id: string(),
|
|
6634
|
+
label: string(),
|
|
6635
|
+
protocol: _enum([
|
|
6636
|
+
"rtsp",
|
|
6637
|
+
"rtmp",
|
|
6638
|
+
"annexb",
|
|
6639
|
+
"http-mjpeg",
|
|
6640
|
+
"webrtc",
|
|
6641
|
+
"custom"
|
|
6642
|
+
]),
|
|
6643
|
+
url: string().optional(),
|
|
6644
|
+
resolution: object({
|
|
6645
|
+
width: number(),
|
|
6646
|
+
height: number()
|
|
6647
|
+
}).optional(),
|
|
6648
|
+
fps: number().optional(),
|
|
6649
|
+
bitrate: number().optional(),
|
|
6650
|
+
codec: string().optional(),
|
|
6651
|
+
profileHint: CamProfileSchema.optional(),
|
|
6652
|
+
sdp: string().optional()
|
|
6653
|
+
});
|
|
6654
|
+
var ConfigEntrySchema$1 = object({
|
|
6655
|
+
key: string(),
|
|
6656
|
+
value: unknown()
|
|
6657
|
+
});
|
|
6658
|
+
var RawStateResultSchema = object({
|
|
6659
|
+
/** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
|
|
6660
|
+
source: string(),
|
|
6661
|
+
/** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
|
|
6662
|
+
data: record(string(), unknown())
|
|
6663
|
+
});
|
|
6664
|
+
method(object({ deviceId: number() }), array(StreamSourceEntrySchema)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
|
|
6665
|
+
deviceId: number(),
|
|
6666
|
+
values: record(string(), unknown())
|
|
6667
|
+
}), _void(), { kind: "mutation" }), method(object({
|
|
6668
|
+
deviceId: number(),
|
|
6669
|
+
action: string().min(1),
|
|
6670
|
+
input: unknown()
|
|
6671
|
+
}), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
|
|
6672
|
+
/**
|
|
6673
|
+
* Promise-based timer helpers — used everywhere the codebase needs to
|
|
6674
|
+
* wait, back off, or schedule a retry. Before these helpers landed, each
|
|
6675
|
+
* call site re-implemented `new Promise(r => setTimeout(r, ms))` inline,
|
|
6676
|
+
* with subtle variations (some swallowing cancellation, some not). Two
|
|
6677
|
+
* shapes cover every observed use case:
|
|
6678
|
+
*
|
|
6679
|
+
* - {@link sleep} for a plain, uncancellable wait — the default choice.
|
|
6680
|
+
* - {@link sleepCancellable} for a wait that wakes early when an
|
|
6681
|
+
* abort signal trips, used by long-running pollers whose teardown
|
|
6682
|
+
* must stop a pending backoff promptly.
|
|
6683
|
+
*/
|
|
6684
|
+
/**
|
|
6685
|
+
* Resolve after `ms` milliseconds. Never rejects, never cancels. The
|
|
6686
|
+
* sleep cannot be interrupted; for a wakeable variant use
|
|
6687
|
+
* {@link sleepCancellable}.
|
|
6688
|
+
*
|
|
6689
|
+
* `ms <= 0` resolves on the next microtask via `setTimeout(0)`, which
|
|
6690
|
+
* still gives the event loop a chance to drain — useful for breaking
|
|
6691
|
+
* up tight async loops without changing call-site semantics.
|
|
6692
|
+
*/
|
|
6693
|
+
function sleep(ms) {
|
|
6694
|
+
return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
6695
|
+
}
|
|
6696
|
+
//#endregion
|
|
6697
|
+
//#region ../types/dist/err-msg-IQTHeDzc.mjs
|
|
6698
|
+
/**
|
|
6699
|
+
import { errMsg } from '@camstack/types'
|
|
6700
|
+
* Extract a human-readable message from an unknown error value.
|
|
6701
|
+
* Replaces the ubiquitous `errMsg(err)` pattern.
|
|
6702
|
+
*/
|
|
6703
|
+
function errMsg(err) {
|
|
6704
|
+
if (err instanceof Error) return err.message;
|
|
6705
|
+
if (typeof err === "string") return err;
|
|
6706
|
+
return String(err);
|
|
6707
|
+
}
|
|
6708
|
+
//#endregion
|
|
6709
|
+
//#region ../types/dist/index.mjs
|
|
6710
|
+
/**
|
|
6711
|
+
* Deep wiring healthcheck — snapshot of active reachability probes across
|
|
6712
|
+
* every declared capability + widget of every installed plugin, on every
|
|
6713
|
+
* node. Produced by the backend `WiringHealthService` and surfaced via
|
|
6714
|
+
* `GET /health/wiring`, the tRPC `health.wiring` query, and the boot-gate.
|
|
6715
|
+
*
|
|
6716
|
+
* Unlike `/health` (process liveness), this reflects whether each cap/widget
|
|
6717
|
+
* is actually *reachable* over the real cap-dispatch path. See spec
|
|
6718
|
+
* `docs/superpowers/specs/2026-05-23-deep-healthcheck-design.md`.
|
|
6719
|
+
*/
|
|
6720
|
+
/** What kind of target a probe addressed. */
|
|
6721
|
+
var wiringProbeKindSchema = _enum([
|
|
6722
|
+
"singleton",
|
|
6723
|
+
"device",
|
|
6724
|
+
"widget"
|
|
6725
|
+
]);
|
|
6726
|
+
/** Result of probing a single (cap|widget [, device]) target. */
|
|
6727
|
+
var wiringProbeResultSchema = object({
|
|
6728
|
+
capName: string(),
|
|
6729
|
+
kind: wiringProbeKindSchema,
|
|
6730
|
+
deviceId: number().optional(),
|
|
6731
|
+
reachable: boolean(),
|
|
6732
|
+
latencyMs: number(),
|
|
6733
|
+
error: string().optional()
|
|
6734
|
+
});
|
|
6735
|
+
/** Per-addon roll-up of cap + widget probe results. */
|
|
6736
|
+
var wiringAddonHealthSchema = object({
|
|
6737
|
+
addonId: string(),
|
|
6738
|
+
caps: array(wiringProbeResultSchema).readonly(),
|
|
6739
|
+
widgets: array(wiringProbeResultSchema).readonly()
|
|
6740
|
+
});
|
|
6741
|
+
/** Per-node roll-up. */
|
|
6742
|
+
var wiringNodeHealthSchema = object({
|
|
6743
|
+
nodeId: string(),
|
|
6744
|
+
addons: array(wiringAddonHealthSchema).readonly()
|
|
6745
|
+
});
|
|
6746
|
+
object({
|
|
6747
|
+
/** True only when every probed target is reachable. */
|
|
6748
|
+
ok: boolean(),
|
|
6749
|
+
/** True when at least one target is unreachable. */
|
|
6750
|
+
degraded: boolean(),
|
|
6751
|
+
checkedAt: string(),
|
|
6752
|
+
nodes: array(wiringNodeHealthSchema).readonly(),
|
|
6753
|
+
summary: object({
|
|
6754
|
+
total: number(),
|
|
6755
|
+
reachable: number(),
|
|
6756
|
+
unreachable: number()
|
|
6757
|
+
})
|
|
6758
|
+
});
|
|
6759
|
+
var MODEL_FORMATS = [
|
|
6760
|
+
"onnx",
|
|
6761
|
+
"coreml",
|
|
6762
|
+
"openvino",
|
|
6763
|
+
"tflite",
|
|
6764
|
+
"pt"
|
|
6765
|
+
];
|
|
6766
|
+
/**
|
|
6767
|
+
* Numeric day-of-week: 0 = Sunday … 6 = Saturday (matches `Date.getDay`).
|
|
6768
|
+
* Named `RecordingWeekday` to avoid collision with the string-union
|
|
6769
|
+
* `Weekday` exported from `interfaces/timezones.ts`.
|
|
6770
|
+
*/
|
|
6771
|
+
var RecordingWeekdaySchema = number().int().min(0).max(6);
|
|
6772
|
+
var HHMM = /^([01]\d|2[0-3]):[0-5]\d$/;
|
|
6773
|
+
var RecordingScheduleSchema = discriminatedUnion("kind", [object({ kind: literal("always") }), object({
|
|
6774
|
+
kind: literal("timeOfDay"),
|
|
6775
|
+
start: string().regex(HHMM),
|
|
6776
|
+
end: string().regex(HHMM),
|
|
6777
|
+
/** Restrict to these weekdays; omit = every day. */
|
|
6778
|
+
days: array(RecordingWeekdaySchema).optional()
|
|
6779
|
+
})]);
|
|
6780
|
+
var RecordingModeSchema = _enum([
|
|
6781
|
+
"continuous",
|
|
6782
|
+
"onMotion",
|
|
6783
|
+
"onAudioThreshold"
|
|
6784
|
+
]);
|
|
6785
|
+
/**
|
|
6786
|
+
* First-class, authoritative per-camera storage mode — the netta choice the UI
|
|
6787
|
+
* reads directly (never inferred from `rules`):
|
|
6788
|
+
* - `off` — not recording.
|
|
6789
|
+
* - `events` — record only around triggers (motion / audio threshold),
|
|
6790
|
+
* with pre/post-buffer.
|
|
6791
|
+
* - `continuous` — record 24/7 within the schedule.
|
|
6792
|
+
*
|
|
6793
|
+
* `mode` compiles one-way to the internal `rules[]` consumed by the policy
|
|
6794
|
+
* engine (see `compileRules`); `rules[]` is never authored directly anymore.
|
|
6795
|
+
*/
|
|
6796
|
+
var RecordingStorageModeSchema = _enum([
|
|
6797
|
+
"off",
|
|
6798
|
+
"events",
|
|
6799
|
+
"continuous"
|
|
6800
|
+
]);
|
|
6801
|
+
/** Which detectors trigger an `events`-mode recording. */
|
|
6802
|
+
var RecordingTriggersSchema = object({
|
|
6803
|
+
motion: boolean().optional(),
|
|
6804
|
+
audioThresholdDbfs: number().optional()
|
|
6805
|
+
});
|
|
6806
|
+
/**
|
|
6807
|
+
* Mode of a single recording band — the recorder per-band vocabulary.
|
|
6808
|
+
*
|
|
6809
|
+
* Distinct from `RecordingStorageModeSchema` (which carries `off`): a band is
|
|
6810
|
+
* only ever `continuous` or `events`; "off" is expressed by the absence of a
|
|
6811
|
+
* covering band, not by a band value.
|
|
6812
|
+
*/
|
|
6813
|
+
var RecordingBandModeSchema = _enum(["continuous", "events"]);
|
|
6814
|
+
/**
|
|
6815
|
+
* Triggers for an `events`-mode band. Identical shape to
|
|
6816
|
+
* `RecordingTriggersSchema` — reuse that schema as the band trigger type so the
|
|
6817
|
+
* two never drift.
|
|
6818
|
+
*/
|
|
6819
|
+
var RecordingBandTriggersSchema = RecordingTriggersSchema;
|
|
6820
|
+
/**
|
|
6821
|
+
* A single mode-per-band window — the canonical recorder band shape, the
|
|
6822
|
+
* single source of truth re-used by `addon-pipeline/recorder`.
|
|
6823
|
+
*
|
|
6824
|
+
* `days` lists the weekdays the band covers (empty = every day, matching the
|
|
6825
|
+
* band engine's `applies` rule). `start`/`end` are `HH:MM`; an `end <= start`
|
|
6826
|
+
* span wraps past midnight (handled by the band engine).
|
|
6827
|
+
*/
|
|
6828
|
+
var RecordingBandSchema = object({
|
|
6829
|
+
days: array(RecordingWeekdaySchema),
|
|
6830
|
+
start: string().regex(HHMM),
|
|
6831
|
+
end: string().regex(HHMM),
|
|
6832
|
+
mode: RecordingBandModeSchema,
|
|
6833
|
+
triggers: RecordingBandTriggersSchema.optional(),
|
|
6834
|
+
preBufferSec: number().min(0).optional(),
|
|
6835
|
+
postBufferSec: number().min(0).optional()
|
|
6836
|
+
});
|
|
6837
|
+
var RecordingRuleSchema = object({
|
|
6838
|
+
schedule: RecordingScheduleSchema,
|
|
6839
|
+
mode: RecordingModeSchema,
|
|
6840
|
+
/** Seconds of footage to retain BEFORE a trigger (applied at keep/discard). */
|
|
6841
|
+
preBufferSec: number().min(0).default(0),
|
|
6842
|
+
/** Keep recording until this many seconds after the last trigger. */
|
|
6843
|
+
postBufferSec: number().min(0).default(0),
|
|
6844
|
+
/** Each new trigger restarts the post-buffer window. */
|
|
6845
|
+
resetTimeoutOnNewEvent: boolean().default(true),
|
|
6846
|
+
/** onAudioThreshold only — dBFS level that counts as a trigger. */
|
|
6847
|
+
thresholdDbfs: number().optional()
|
|
6848
|
+
});
|
|
6849
|
+
/**
|
|
6850
|
+
* Per-device retention overrides. Every field is optional; an unset or `0`
|
|
6851
|
+
* value inherits the node-wide recorder default. Only footage-lifetime limits
|
|
6852
|
+
* live per-camera: `maxAgeDays` and `maxSizeGb`. The disk-occupancy threshold
|
|
6853
|
+
* (when the volume is too full to keep recording) is NOT a per-camera concern —
|
|
6854
|
+
* it belongs to the StorageLocation (`StorageLocation.config.minFreePercent`),
|
|
6855
|
+
* shared by every camera writing to that volume.
|
|
6856
|
+
*/
|
|
6857
|
+
var RecordingRetentionSchema = object({
|
|
6858
|
+
maxAgeDays: number().min(0).optional(),
|
|
6859
|
+
maxSizeGb: number().min(0).optional()
|
|
6860
|
+
});
|
|
6861
|
+
/**
|
|
6862
|
+
* The full per-camera recording intent — the wire shape of a RecordingTarget.
|
|
6863
|
+
*
|
|
6864
|
+
* `mode` is the authoritative storage choice; `schedule`/`triggers`/`pre`/`post`
|
|
6865
|
+
* are its mode-specific parameters. `rules` is a DEPRECATED authoring input kept
|
|
6866
|
+
* only for transition + migration (`migrateRulesToMode`); the policy engine
|
|
6867
|
+
* consumes the compiled output of `compileRules(config)`, never `rules` directly.
|
|
6868
|
+
*/
|
|
6869
|
+
var RecordingConfigSchema = object({
|
|
6870
|
+
enabled: boolean(),
|
|
6871
|
+
/** Authoritative storage mode. Absent on legacy targets → derived once via
|
|
6872
|
+
* `migrateRulesToMode`, then persisted. */
|
|
6873
|
+
mode: RecordingStorageModeSchema.optional(),
|
|
6874
|
+
profiles: array(CamProfileSchema).optional(),
|
|
6875
|
+
segmentSeconds: number().int().positive().optional(),
|
|
6876
|
+
/** Shared recording time-bands for `events` & `continuous` — record only when
|
|
6877
|
+
* the wall-clock falls inside one of these windows. Omit or empty = always.
|
|
6878
|
+
* `continuous` compiles to one rule per band; `events` to band × trigger. */
|
|
6879
|
+
schedules: array(RecordingScheduleSchema).optional(),
|
|
6880
|
+
/** Legacy single-band predecessor of `schedules`. Read-compat only — it is
|
|
6881
|
+
* normalized into `schedules` on read and never written going forward. (Not
|
|
6882
|
+
* tagged `@deprecated`: the normalization paths must read it cast-free.) */
|
|
6883
|
+
schedule: RecordingScheduleSchema.optional(),
|
|
6884
|
+
/** `events`-mode only — which detectors trigger a recording. */
|
|
6885
|
+
triggers: RecordingTriggersSchema.optional(),
|
|
6886
|
+
/** `events`-mode only — seconds retained before / after a trigger. */
|
|
6887
|
+
preBufferSec: number().min(0).optional(),
|
|
6888
|
+
postBufferSec: number().min(0).optional(),
|
|
6889
|
+
/** DEPRECATED authoring input; retained for migration/transition. */
|
|
6890
|
+
rules: array(RecordingRuleSchema).optional(),
|
|
6891
|
+
/**
|
|
6892
|
+
* AUTHORITATIVE mode-per-band recording model (recorder). When present it
|
|
6893
|
+
* is the single source of truth; the legacy `mode`/`schedules`/`schedule`/
|
|
6894
|
+
* `triggers`/`rules` fields above are kept for READ-COMPAT only and are
|
|
6895
|
+
* derived into bands once via `migrateConfigToBands`.
|
|
6896
|
+
*/
|
|
6897
|
+
bands: array(RecordingBandSchema).optional(),
|
|
6898
|
+
retention: RecordingRetentionSchema.optional()
|
|
6899
|
+
});
|
|
6900
|
+
/** All seven weekdays (0 = Sunday … 6 = Saturday), used when a schedule omits a
|
|
6901
|
+
* weekday filter. */
|
|
6902
|
+
var ALL_DAYS = [
|
|
6903
|
+
0,
|
|
6904
|
+
1,
|
|
6905
|
+
2,
|
|
6906
|
+
3,
|
|
6907
|
+
4,
|
|
6908
|
+
5,
|
|
6909
|
+
6
|
|
6910
|
+
];
|
|
6911
|
+
/** Full-day span used to represent an `always` schedule as a band. The `HHMM`
|
|
6912
|
+
* regex maxes out at 23:59, so a 00:00–23:59 same-day span ≈ all-day (the band
|
|
6913
|
+
* engine treats `end > start` as a normal, non-wrapping span). */
|
|
6914
|
+
var ALL_DAY_START = "00:00";
|
|
6915
|
+
var ALL_DAY_END = "23:59";
|
|
6916
|
+
function bandFromSchedule(schedule, mode, config) {
|
|
6917
|
+
const days = schedule.kind === "timeOfDay" && schedule.days ? schedule.days : [...ALL_DAYS];
|
|
6918
|
+
const start = schedule.kind === "timeOfDay" ? schedule.start : ALL_DAY_START;
|
|
6919
|
+
const end = schedule.kind === "timeOfDay" ? schedule.end : ALL_DAY_END;
|
|
6920
|
+
if (mode === "continuous") return {
|
|
6921
|
+
days,
|
|
6922
|
+
start,
|
|
6923
|
+
end,
|
|
6924
|
+
mode
|
|
6925
|
+
};
|
|
6926
|
+
return {
|
|
6927
|
+
days,
|
|
6928
|
+
start,
|
|
6929
|
+
end,
|
|
6930
|
+
mode,
|
|
6931
|
+
...config.triggers ? { triggers: config.triggers } : {},
|
|
6932
|
+
...config.preBufferSec !== void 0 ? { preBufferSec: config.preBufferSec } : {},
|
|
6933
|
+
...config.postBufferSec !== void 0 ? { postBufferSec: config.postBufferSec } : {}
|
|
6934
|
+
};
|
|
7475
6935
|
}
|
|
7476
|
-
|
|
7477
|
-
|
|
7478
|
-
|
|
7479
|
-
|
|
7480
|
-
|
|
7481
|
-
|
|
7482
|
-
|
|
7483
|
-
|
|
7484
|
-
|
|
7485
|
-
|
|
7486
|
-
|
|
7487
|
-
|
|
7488
|
-
|
|
7489
|
-
|
|
7490
|
-
|
|
7491
|
-
|
|
7492
|
-
|
|
7493
|
-
|
|
7494
|
-
|
|
7495
|
-
|
|
7496
|
-
|
|
7497
|
-
|
|
7498
|
-
|
|
7499
|
-
|
|
7500
|
-
|
|
7501
|
-
|
|
7502
|
-
|
|
7503
|
-
|
|
7504
|
-
|
|
7505
|
-
|
|
7506
|
-
|
|
7507
|
-
|
|
7508
|
-
|
|
7509
|
-
|
|
7510
|
-
|
|
7511
|
-
|
|
7512
|
-
|
|
7513
|
-
|
|
7514
|
-
|
|
7515
|
-
|
|
7516
|
-
|
|
7517
|
-
|
|
7518
|
-
|
|
7519
|
-
|
|
7520
|
-
|
|
7521
|
-
|
|
7522
|
-
|
|
7523
|
-
|
|
7524
|
-
|
|
7525
|
-
|
|
7526
|
-
|
|
7527
|
-
|
|
7528
|
-
|
|
7529
|
-
|
|
7530
|
-
|
|
7531
|
-
|
|
7532
|
-
|
|
7533
|
-
* Sub-type via `DeviceRole`: NumericControl / SelectControl /
|
|
7534
|
-
* TextControl / DateTimeControl. */
|
|
7535
|
-
DeviceType["Control"] = "control";
|
|
7536
|
-
/** Person / device-tracker presence (HA `person.*`, `device_tracker.*`).
|
|
7537
|
-
* `presence` cap. */
|
|
7538
|
-
DeviceType["Presence"] = "presence";
|
|
7539
|
-
/** Weather provider (HA `weather.*`). Tier-3, low MVP priority.
|
|
7540
|
-
* `weather` cap. */
|
|
7541
|
-
DeviceType["Weather"] = "weather";
|
|
7542
|
-
/** Robot vacuum (HA `vacuum.*`). Tier-3. `vacuum-control` cap. */
|
|
7543
|
-
DeviceType["Vacuum"] = "vacuum";
|
|
7544
|
-
/** Robotic lawn mower (HA `lawn_mower.*`). Tier-3.
|
|
7545
|
-
* `lawn-mower-control` cap. */
|
|
7546
|
-
DeviceType["LawnMower"] = "lawn-mower";
|
|
7547
|
-
/** Physical HA device group — parent container for entity-children
|
|
7548
|
-
* adopted from a single HA device entry. Not renderable as a
|
|
7549
|
-
* standalone device; exists only to anchor child entities. */
|
|
7550
|
-
DeviceType["Container"] = "container";
|
|
7551
|
-
/** Single still-image entity (HA `image.*`). Read-only display of an
|
|
7552
|
-
* `entity_picture` signed URL the browser loads directly. `image` cap. */
|
|
7553
|
-
DeviceType["Image"] = "image";
|
|
7554
|
-
return DeviceType;
|
|
7555
|
-
}({});
|
|
7556
|
-
var DeviceFeature = /* @__PURE__ */ function(DeviceFeature) {
|
|
7557
|
-
DeviceFeature["BatteryOperated"] = "battery-operated";
|
|
7558
|
-
DeviceFeature["Rebootable"] = "rebootable";
|
|
6936
|
+
/**
|
|
6937
|
+
* One-way migration from the legacy recording-config shape to the authoritative
|
|
6938
|
+
* mode-per-band model. Pure (no clock access).
|
|
6939
|
+
*
|
|
6940
|
+
* - If `config.bands` is present, it is authoritative and returned as-is.
|
|
6941
|
+
* - Otherwise the result is derived from the legacy fields: a disabled config or
|
|
6942
|
+
* `mode: 'off'` yields no bands; every legacy schedule maps to one band whose
|
|
6943
|
+
* mode is `continuous` when `config.mode === 'continuous'`, else `events`
|
|
6944
|
+
* (carrying `triggers`/`preBufferSec`/`postBufferSec`).
|
|
6945
|
+
*/
|
|
6946
|
+
function migrateConfigToBands(config) {
|
|
6947
|
+
if (config.bands) return config.bands;
|
|
6948
|
+
if (!config.enabled || config.mode === "off") return [];
|
|
6949
|
+
const schedules = config.schedules ?? (config.schedule ? [config.schedule] : [{ kind: "always" }]);
|
|
6950
|
+
const bandMode = config.mode === "continuous" ? "continuous" : "events";
|
|
6951
|
+
return schedules.map((schedule) => bandFromSchedule(schedule, bandMode, config));
|
|
6952
|
+
}
|
|
6953
|
+
/**
|
|
6954
|
+
* `StorageLocationType` — an addon-declared id that identifies the *kind* of
|
|
6955
|
+
* storage a location serves. Defined here (not in `capabilities/storage.cap.ts`)
|
|
6956
|
+
* so the persisted record schema and the consumer-facing cap can both consume it
|
|
6957
|
+
* without forming a circular import. The `storage` cap re-exports it
|
|
6958
|
+
* verbatim for back-compat.
|
|
6959
|
+
*
|
|
6960
|
+
* This Zod schema is the **authoritative source** for `StorageLocationType`.
|
|
6961
|
+
* The TS alias in `./storage.ts` re-exports `z.infer<typeof
|
|
6962
|
+
* StorageLocationTypeSchema>` so the wire surface (cap) and the legacy
|
|
6963
|
+
* `IStorageProvider` interface stay in lockstep.
|
|
6964
|
+
*
|
|
6965
|
+
* The type is now an **open string** (not a closed enum) — addons declare
|
|
6966
|
+
* their own location kinds via `StorageLocationDeclaration.id`. The regex
|
|
6967
|
+
* enforces a safe id format: lowercase-start, alphanumeric + hyphens.
|
|
6968
|
+
*/
|
|
6969
|
+
var StorageLocationTypeSchema = string().regex(/^[a-z][a-zA-Z0-9-]*$/);
|
|
6970
|
+
/**
|
|
6971
|
+
* Persisted record for a storage location instance. Operators can register
|
|
6972
|
+
* multiple instances for multi-cardinality types (e.g. two `backups`
|
|
6973
|
+
* locations with different `providerId`s). Cardinality is now declared per
|
|
6974
|
+
* location via `StorageLocationDeclaration.cardinality` — the static
|
|
6975
|
+
* `STORAGE_LOCATION_CARDINALITY` map has been removed.
|
|
6976
|
+
*
|
|
6977
|
+
* `id` is a stable namespaced string of the form `<type>:<slug>`.
|
|
6978
|
+
* The default location for a type uses `id === <type>:default` by
|
|
6979
|
+
* convention (the bare type ref like `'backups'` resolves to it).
|
|
6980
|
+
*
|
|
6981
|
+
* `isSystem: true` marks a location as orchestrator-seeded and
|
|
6982
|
+
* undeletable. The bootstrap-installed defaults (one per type) carry
|
|
6983
|
+
* this flag; operator-added locations don't. Editing the config of
|
|
6984
|
+
* a system location is allowed (path migration, provider swap) but
|
|
6985
|
+
* deleting it is rejected at the cap level.
|
|
6986
|
+
*/
|
|
6987
|
+
var StorageLocationSchema = object({
|
|
6988
|
+
id: string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/),
|
|
6989
|
+
type: string(),
|
|
6990
|
+
displayName: string().min(1),
|
|
6991
|
+
providerId: string().min(1),
|
|
6992
|
+
config: record(string(), unknown()),
|
|
7559
6993
|
/**
|
|
7560
|
-
*
|
|
7561
|
-
*
|
|
7562
|
-
*
|
|
6994
|
+
* Cluster node this location physically lives on. REQUIRED for node-local
|
|
6995
|
+
* providers (filesystem — the path exists on one node's disk), null/absent
|
|
6996
|
+
* for node-agnostic providers (S3/SFTP/WebDAV, reachable from any node).
|
|
6997
|
+
* `'hub'` is the hub node. Validated against the provider's `nodeLocal`
|
|
6998
|
+
* flag at upsert time, not here (the schema is provider-agnostic).
|
|
7563
6999
|
*/
|
|
7564
|
-
|
|
7565
|
-
|
|
7566
|
-
|
|
7567
|
-
|
|
7568
|
-
|
|
7000
|
+
nodeId: string().optional(),
|
|
7001
|
+
isDefault: boolean().default(false),
|
|
7002
|
+
isSystem: boolean().default(false),
|
|
7003
|
+
createdAt: number(),
|
|
7004
|
+
updatedAt: number()
|
|
7005
|
+
});
|
|
7006
|
+
/**
|
|
7007
|
+
* Reference accepted by consumer-facing `api.storage.*` calls.
|
|
7008
|
+
* Either:
|
|
7009
|
+
* - a `StorageLocationType` (e.g. `'backups'`) → orchestrator resolves to the default of that type
|
|
7010
|
+
* - a fully-qualified id (e.g. `'backups:nas-01'`) → addresses a specific instance
|
|
7011
|
+
*
|
|
7012
|
+
* The orchestrator's `resolveRef(ref)` handles both cases.
|
|
7013
|
+
*/
|
|
7014
|
+
var StorageLocationRefSchema = union([StorageLocationTypeSchema, string().regex(/^[a-z][a-zA-Z0-9-]*:[a-zA-Z0-9-]+$/)]);
|
|
7015
|
+
/**
|
|
7016
|
+
* `StorageLocationDeclaration` — a single storage-location entry declared by
|
|
7017
|
+
* an addon in its `package.json` under `camstack.storageLocations`.
|
|
7018
|
+
*
|
|
7019
|
+
* Design intent:
|
|
7020
|
+
* - **Addon declares its needs** — each addon describes the logical storage
|
|
7021
|
+
* slots it requires (e.g. `recordings`, `recordingsLow`) without caring
|
|
7022
|
+
* about the physical path.
|
|
7023
|
+
* - **Kernel aggregates** — at boot the kernel collects declarations from all
|
|
7024
|
+
* installed addons, deduplicates by `id`, and exposes the union via the
|
|
7025
|
+
* storage-locations settings surface.
|
|
7026
|
+
* - **Orchestrator seeds** — for every declared `id` the orchestrator ensures
|
|
7027
|
+
* at least one instance named `<id>:default` is present, using
|
|
7028
|
+
* `defaultsTo` to inherit the resolved root from another location when the
|
|
7029
|
+
* declaration is a derivative slot (e.g. `recordingsLow` defaults to
|
|
7030
|
+
* `recordings`).
|
|
7031
|
+
* - **ids are global** — `id` values are shared across the entire deployment;
|
|
7032
|
+
* two addons declaring the same `id` must agree on `cardinality` (validated
|
|
7033
|
+
* at kernel aggregation time, not here).
|
|
7034
|
+
*/
|
|
7035
|
+
var StorageLocationDeclarationSchema = object({
|
|
7569
7036
|
/**
|
|
7570
|
-
*
|
|
7571
|
-
*
|
|
7572
|
-
*
|
|
7573
|
-
* the autotrack toggle / settings card without re-deriving from
|
|
7574
|
-
* the cap registry. Mirrors `ptz-autotrack` cap registration:
|
|
7575
|
-
* driver sets this feature when probe confirms the firmware
|
|
7576
|
-
* surface, and registers the cap in the same code path.
|
|
7037
|
+
* Global location identifier, e.g. `recordings` or `recordingsLow`.
|
|
7038
|
+
* Must start with a lowercase letter and may contain letters, digits, and
|
|
7039
|
+
* hyphens.
|
|
7577
7040
|
*/
|
|
7578
|
-
|
|
7041
|
+
id: string().regex(/^[a-z][a-zA-Z0-9-]*$/, { message: "id must start with a lowercase letter and contain only letters, digits, or hyphens" }),
|
|
7042
|
+
/** Human-readable name shown in the admin UI. */
|
|
7043
|
+
displayName: string().min(1, { message: "displayName must not be empty" }),
|
|
7044
|
+
/** Optional longer explanation of what data this location stores. */
|
|
7045
|
+
description: string().optional(),
|
|
7579
7046
|
/**
|
|
7580
|
-
*
|
|
7581
|
-
*
|
|
7582
|
-
* `
|
|
7583
|
-
*
|
|
7584
|
-
*
|
|
7585
|
-
* Used by admin UI (gate the in-hero `MotionTriggerToggle` against a
|
|
7586
|
-
* fast scalar without binding fetch), notifier rules, and `listAll`
|
|
7587
|
-
* filters that want "all devices with on-motion behaviour".
|
|
7047
|
+
* `single` — exactly one instance of this location is allowed system-wide
|
|
7048
|
+
* (e.g. `logs`, `models`). The operator can edit it but not add more.
|
|
7049
|
+
* `multi` — the operator may register several instances (e.g. a second
|
|
7050
|
+
* `recordings` on a NAS for disk tiering); one is the default at any time.
|
|
7588
7051
|
*/
|
|
7589
|
-
|
|
7590
|
-
/**
|
|
7591
|
-
|
|
7592
|
-
|
|
7593
|
-
|
|
7594
|
-
|
|
7595
|
-
|
|
7596
|
-
|
|
7597
|
-
|
|
7598
|
-
|
|
7599
|
-
|
|
7600
|
-
|
|
7601
|
-
|
|
7602
|
-
|
|
7603
|
-
|
|
7604
|
-
|
|
7605
|
-
|
|
7606
|
-
|
|
7607
|
-
|
|
7608
|
-
|
|
7609
|
-
|
|
7610
|
-
|
|
7611
|
-
|
|
7612
|
-
|
|
7613
|
-
|
|
7614
|
-
|
|
7615
|
-
|
|
7616
|
-
|
|
7617
|
-
|
|
7618
|
-
|
|
7619
|
-
*
|
|
7620
|
-
|
|
7621
|
-
|
|
7622
|
-
|
|
7623
|
-
|
|
7624
|
-
|
|
7625
|
-
|
|
7626
|
-
|
|
7627
|
-
*
|
|
7628
|
-
*
|
|
7629
|
-
|
|
7630
|
-
|
|
7631
|
-
|
|
7632
|
-
/**
|
|
7633
|
-
|
|
7634
|
-
|
|
7635
|
-
|
|
7636
|
-
|
|
7637
|
-
|
|
7638
|
-
|
|
7639
|
-
|
|
7640
|
-
|
|
7641
|
-
|
|
7642
|
-
|
|
7643
|
-
|
|
7644
|
-
|
|
7645
|
-
|
|
7646
|
-
|
|
7647
|
-
|
|
7648
|
-
|
|
7649
|
-
|
|
7650
|
-
|
|
7651
|
-
|
|
7652
|
-
|
|
7653
|
-
|
|
7654
|
-
|
|
7655
|
-
|
|
7656
|
-
|
|
7657
|
-
|
|
7658
|
-
|
|
7659
|
-
|
|
7660
|
-
|
|
7661
|
-
|
|
7662
|
-
|
|
7663
|
-
|
|
7664
|
-
|
|
7665
|
-
|
|
7666
|
-
|
|
7667
|
-
|
|
7668
|
-
|
|
7669
|
-
|
|
7670
|
-
|
|
7671
|
-
|
|
7672
|
-
|
|
7673
|
-
|
|
7674
|
-
|
|
7675
|
-
|
|
7676
|
-
|
|
7677
|
-
|
|
7678
|
-
|
|
7679
|
-
|
|
7680
|
-
|
|
7681
|
-
|
|
7682
|
-
|
|
7683
|
-
|
|
7684
|
-
|
|
7685
|
-
|
|
7686
|
-
|
|
7687
|
-
|
|
7688
|
-
|
|
7689
|
-
|
|
7690
|
-
|
|
7691
|
-
|
|
7692
|
-
|
|
7693
|
-
|
|
7694
|
-
|
|
7695
|
-
|
|
7696
|
-
|
|
7697
|
-
|
|
7698
|
-
*
|
|
7699
|
-
*
|
|
7700
|
-
|
|
7701
|
-
|
|
7702
|
-
|
|
7703
|
-
|
|
7704
|
-
|
|
7705
|
-
|
|
7706
|
-
|
|
7707
|
-
|
|
7708
|
-
|
|
7709
|
-
|
|
7710
|
-
|
|
7711
|
-
|
|
7712
|
-
|
|
7713
|
-
|
|
7714
|
-
|
|
7715
|
-
|
|
7716
|
-
|
|
7717
|
-
|
|
7718
|
-
|
|
7719
|
-
|
|
7720
|
-
|
|
7721
|
-
|
|
7722
|
-
|
|
7723
|
-
|
|
7724
|
-
|
|
7725
|
-
|
|
7726
|
-
|
|
7727
|
-
|
|
7728
|
-
|
|
7729
|
-
|
|
7730
|
-
|
|
7731
|
-
|
|
7732
|
-
|
|
7733
|
-
|
|
7734
|
-
|
|
7735
|
-
|
|
7736
|
-
|
|
7737
|
-
|
|
7738
|
-
|
|
7739
|
-
|
|
7740
|
-
|
|
7741
|
-
|
|
7742
|
-
|
|
7743
|
-
|
|
7744
|
-
|
|
7745
|
-
|
|
7746
|
-
|
|
7747
|
-
|
|
7748
|
-
|
|
7749
|
-
|
|
7750
|
-
|
|
7751
|
-
}
|
|
7052
|
+
cardinality: _enum(["single", "multi"]),
|
|
7053
|
+
/**
|
|
7054
|
+
* When set, the default instance for this location inherits its resolved
|
|
7055
|
+
* root from the named location's default instance. Useful for derivative
|
|
7056
|
+
* slots (e.g. `recordingsLow` → `recordings`) so operators only need to
|
|
7057
|
+
* configure the primary location.
|
|
7058
|
+
*/
|
|
7059
|
+
defaultsTo: string().optional()
|
|
7060
|
+
});
|
|
7061
|
+
var DecoderStatsSchema = object({
|
|
7062
|
+
inputFps: number(),
|
|
7063
|
+
outputFps: number(),
|
|
7064
|
+
avgDecodeTimeMs: number(),
|
|
7065
|
+
droppedFrames: number()
|
|
7066
|
+
});
|
|
7067
|
+
var DecoderSessionConfigSchema = object({
|
|
7068
|
+
codec: string(),
|
|
7069
|
+
maxFps: number().default(0),
|
|
7070
|
+
outputFormat: _enum([
|
|
7071
|
+
"jpeg",
|
|
7072
|
+
"rgb",
|
|
7073
|
+
"bgr",
|
|
7074
|
+
"yuv420",
|
|
7075
|
+
"gray"
|
|
7076
|
+
]).default("jpeg"),
|
|
7077
|
+
scale: number().default(1),
|
|
7078
|
+
width: number().optional(),
|
|
7079
|
+
height: number().optional(),
|
|
7080
|
+
/**
|
|
7081
|
+
* Identifier of the camera this decoder session serves. Optional
|
|
7082
|
+
* because the cap is generic (any caller could request decode), but
|
|
7083
|
+
* stream-broker passes it so decoder logs include `deviceId` for
|
|
7084
|
+
* per-camera filtering when diagnosing failures (e.g. node-av
|
|
7085
|
+
* sendPacket errors on a single hung camera).
|
|
7086
|
+
*/
|
|
7087
|
+
deviceId: number().int().nonnegative().optional(),
|
|
7088
|
+
/**
|
|
7089
|
+
* Free-form tag for log scoping. Stream-broker uses
|
|
7090
|
+
* `broker:<deviceId>/<profile>`. Decoder session logger surfaces it
|
|
7091
|
+
* on every line so `grep tag=broker:5/high` filters one camera
|
|
7092
|
+
* profile cleanly.
|
|
7093
|
+
*/
|
|
7094
|
+
tag: string().optional(),
|
|
7095
|
+
/**
|
|
7096
|
+
* Where the session delivers decoded frames (Phase 5 / D9):
|
|
7097
|
+
*
|
|
7098
|
+
* - `'callback'` (default) — the legacy pixel path: decoded frames are
|
|
7099
|
+
* buffered as `DecodedFrame`s and drained via `pullFrames`.
|
|
7100
|
+
* - `'shm'` — the shared-memory frame plane: decoded frames are written
|
|
7101
|
+
* into an OS shared-memory ring and drained as zero-pixel
|
|
7102
|
+
* `FrameHandle`s via `pullHandles`. A session is one mode or the
|
|
7103
|
+
* other — `pullFrames` returns nothing for an `'shm'` session and
|
|
7104
|
+
* `pullHandles` returns nothing for a `'callback'` session.
|
|
7105
|
+
*/
|
|
7106
|
+
frameSink: _enum(["callback", "shm"]).default("callback")
|
|
7107
|
+
});
|
|
7108
|
+
var EncodeProfileSchema = object({
|
|
7109
|
+
video: object({
|
|
7110
|
+
codec: _enum([
|
|
7111
|
+
"h264",
|
|
7112
|
+
"h265",
|
|
7113
|
+
"copy"
|
|
7114
|
+
]),
|
|
7115
|
+
profile: _enum([
|
|
7116
|
+
"baseline",
|
|
7117
|
+
"main",
|
|
7118
|
+
"high"
|
|
7119
|
+
]).optional(),
|
|
7120
|
+
width: number().int().positive().optional(),
|
|
7121
|
+
height: number().int().positive().optional(),
|
|
7122
|
+
fps: number().positive().optional(),
|
|
7123
|
+
bitrateKbps: number().int().positive().optional(),
|
|
7124
|
+
gopFrames: number().int().positive().optional(),
|
|
7125
|
+
bf: number().int().min(0).optional(),
|
|
7126
|
+
preset: _enum([
|
|
7127
|
+
"ultrafast",
|
|
7128
|
+
"superfast",
|
|
7129
|
+
"veryfast",
|
|
7130
|
+
"faster",
|
|
7131
|
+
"fast",
|
|
7132
|
+
"medium"
|
|
7133
|
+
]).optional(),
|
|
7134
|
+
tune: _enum([
|
|
7135
|
+
"zerolatency",
|
|
7136
|
+
"film",
|
|
7137
|
+
"animation"
|
|
7138
|
+
]).optional()
|
|
7139
|
+
}),
|
|
7140
|
+
audio: union([literal("passthrough"), object({
|
|
7141
|
+
codec: _enum([
|
|
7142
|
+
"opus",
|
|
7143
|
+
"aac",
|
|
7144
|
+
"pcmu",
|
|
7145
|
+
"pcma",
|
|
7146
|
+
"copy"
|
|
7147
|
+
]),
|
|
7148
|
+
bitrateKbps: number().int().positive().optional(),
|
|
7149
|
+
sampleRateHz: number().int().positive().optional(),
|
|
7150
|
+
channels: union([literal(1), literal(2)]).optional()
|
|
7151
|
+
})]),
|
|
7152
|
+
/**
|
|
7153
|
+
* ffmpeg input-side args, inserted between the fixed global flags
|
|
7154
|
+
* (`-hide_banner -loglevel error`) and `-i pipe:0`. Free-text array
|
|
7155
|
+
* — the widget surfaces a textarea + suggestion chips for the most-
|
|
7156
|
+
* used demuxer/format options.
|
|
7157
|
+
*/
|
|
7158
|
+
inputArgs: array(string()).optional(),
|
|
7159
|
+
/**
|
|
7160
|
+
* ffmpeg output-side args, inserted between the encode block and
|
|
7161
|
+
* the final `-f <muxer> pipe:1`. Use for muxer options, bitstream
|
|
7162
|
+
* filters, codec-specific overrides. Free-text array.
|
|
7163
|
+
*/
|
|
7164
|
+
outputArgs: array(string()).optional()
|
|
7165
|
+
});
|
|
7166
|
+
var HF_BASE_URL = `https://huggingface.co/camstack/camstack-models/resolve/main`;
|
|
7167
|
+
function hfModelUrl(repo, path) {
|
|
7168
|
+
return `https://huggingface.co/${repo}/resolve/main/${path}`;
|
|
7169
|
+
}
|
|
7170
|
+
var COCO_80_LABELS = [
|
|
7171
|
+
{
|
|
7172
|
+
id: "person",
|
|
7173
|
+
name: "Person"
|
|
7174
|
+
},
|
|
7175
|
+
{
|
|
7176
|
+
id: "bicycle",
|
|
7177
|
+
name: "Bicycle"
|
|
7178
|
+
},
|
|
7179
|
+
{
|
|
7180
|
+
id: "car",
|
|
7181
|
+
name: "Car"
|
|
7182
|
+
},
|
|
7183
|
+
{
|
|
7184
|
+
id: "motorcycle",
|
|
7185
|
+
name: "Motorcycle"
|
|
7186
|
+
},
|
|
7187
|
+
{
|
|
7188
|
+
id: "airplane",
|
|
7189
|
+
name: "Airplane"
|
|
7190
|
+
},
|
|
7191
|
+
{
|
|
7192
|
+
id: "bus",
|
|
7193
|
+
name: "Bus"
|
|
7194
|
+
},
|
|
7195
|
+
{
|
|
7196
|
+
id: "train",
|
|
7197
|
+
name: "Train"
|
|
7198
|
+
},
|
|
7199
|
+
{
|
|
7200
|
+
id: "truck",
|
|
7201
|
+
name: "Truck"
|
|
7202
|
+
},
|
|
7203
|
+
{
|
|
7204
|
+
id: "boat",
|
|
7205
|
+
name: "Boat"
|
|
7206
|
+
},
|
|
7207
|
+
{
|
|
7208
|
+
id: "traffic light",
|
|
7209
|
+
name: "Traffic Light"
|
|
7210
|
+
},
|
|
7211
|
+
{
|
|
7212
|
+
id: "fire hydrant",
|
|
7213
|
+
name: "Fire Hydrant"
|
|
7214
|
+
},
|
|
7215
|
+
{
|
|
7216
|
+
id: "stop sign",
|
|
7217
|
+
name: "Stop Sign"
|
|
7218
|
+
},
|
|
7219
|
+
{
|
|
7220
|
+
id: "parking meter",
|
|
7221
|
+
name: "Parking Meter"
|
|
7222
|
+
},
|
|
7223
|
+
{
|
|
7224
|
+
id: "bench",
|
|
7225
|
+
name: "Bench"
|
|
7226
|
+
},
|
|
7227
|
+
{
|
|
7228
|
+
id: "bird",
|
|
7229
|
+
name: "Bird"
|
|
7230
|
+
},
|
|
7231
|
+
{
|
|
7232
|
+
id: "cat",
|
|
7233
|
+
name: "Cat"
|
|
7234
|
+
},
|
|
7235
|
+
{
|
|
7236
|
+
id: "dog",
|
|
7237
|
+
name: "Dog"
|
|
7238
|
+
},
|
|
7239
|
+
{
|
|
7240
|
+
id: "horse",
|
|
7241
|
+
name: "Horse"
|
|
7242
|
+
},
|
|
7243
|
+
{
|
|
7244
|
+
id: "sheep",
|
|
7245
|
+
name: "Sheep"
|
|
7246
|
+
},
|
|
7247
|
+
{
|
|
7248
|
+
id: "cow",
|
|
7249
|
+
name: "Cow"
|
|
7250
|
+
},
|
|
7251
|
+
{
|
|
7252
|
+
id: "elephant",
|
|
7253
|
+
name: "Elephant"
|
|
7254
|
+
},
|
|
7255
|
+
{
|
|
7256
|
+
id: "bear",
|
|
7257
|
+
name: "Bear"
|
|
7258
|
+
},
|
|
7259
|
+
{
|
|
7260
|
+
id: "zebra",
|
|
7261
|
+
name: "Zebra"
|
|
7262
|
+
},
|
|
7263
|
+
{
|
|
7264
|
+
id: "giraffe",
|
|
7265
|
+
name: "Giraffe"
|
|
7266
|
+
},
|
|
7267
|
+
{
|
|
7268
|
+
id: "backpack",
|
|
7269
|
+
name: "Backpack"
|
|
7270
|
+
},
|
|
7271
|
+
{
|
|
7272
|
+
id: "umbrella",
|
|
7273
|
+
name: "Umbrella"
|
|
7274
|
+
},
|
|
7275
|
+
{
|
|
7276
|
+
id: "handbag",
|
|
7277
|
+
name: "Handbag"
|
|
7278
|
+
},
|
|
7279
|
+
{
|
|
7280
|
+
id: "tie",
|
|
7281
|
+
name: "Tie"
|
|
7282
|
+
},
|
|
7283
|
+
{
|
|
7284
|
+
id: "suitcase",
|
|
7285
|
+
name: "Suitcase"
|
|
7286
|
+
},
|
|
7287
|
+
{
|
|
7288
|
+
id: "frisbee",
|
|
7289
|
+
name: "Frisbee"
|
|
7290
|
+
},
|
|
7291
|
+
{
|
|
7292
|
+
id: "skis",
|
|
7293
|
+
name: "Skis"
|
|
7294
|
+
},
|
|
7295
|
+
{
|
|
7296
|
+
id: "snowboard",
|
|
7297
|
+
name: "Snowboard"
|
|
7298
|
+
},
|
|
7299
|
+
{
|
|
7300
|
+
id: "sports ball",
|
|
7301
|
+
name: "Sports Ball"
|
|
7302
|
+
},
|
|
7303
|
+
{
|
|
7304
|
+
id: "kite",
|
|
7305
|
+
name: "Kite"
|
|
7306
|
+
},
|
|
7307
|
+
{
|
|
7308
|
+
id: "baseball bat",
|
|
7309
|
+
name: "Baseball Bat"
|
|
7310
|
+
},
|
|
7311
|
+
{
|
|
7312
|
+
id: "baseball glove",
|
|
7313
|
+
name: "Baseball Glove"
|
|
7314
|
+
},
|
|
7315
|
+
{
|
|
7316
|
+
id: "skateboard",
|
|
7317
|
+
name: "Skateboard"
|
|
7318
|
+
},
|
|
7319
|
+
{
|
|
7320
|
+
id: "surfboard",
|
|
7321
|
+
name: "Surfboard"
|
|
7322
|
+
},
|
|
7323
|
+
{
|
|
7324
|
+
id: "tennis racket",
|
|
7325
|
+
name: "Tennis Racket"
|
|
7326
|
+
},
|
|
7327
|
+
{
|
|
7328
|
+
id: "bottle",
|
|
7329
|
+
name: "Bottle"
|
|
7330
|
+
},
|
|
7331
|
+
{
|
|
7332
|
+
id: "wine glass",
|
|
7333
|
+
name: "Wine Glass"
|
|
7334
|
+
},
|
|
7335
|
+
{
|
|
7336
|
+
id: "cup",
|
|
7337
|
+
name: "Cup"
|
|
7338
|
+
},
|
|
7339
|
+
{
|
|
7340
|
+
id: "fork",
|
|
7341
|
+
name: "Fork"
|
|
7342
|
+
},
|
|
7343
|
+
{
|
|
7344
|
+
id: "knife",
|
|
7345
|
+
name: "Knife"
|
|
7346
|
+
},
|
|
7347
|
+
{
|
|
7348
|
+
id: "spoon",
|
|
7349
|
+
name: "Spoon"
|
|
7350
|
+
},
|
|
7351
|
+
{
|
|
7352
|
+
id: "bowl",
|
|
7353
|
+
name: "Bowl"
|
|
7354
|
+
},
|
|
7355
|
+
{
|
|
7356
|
+
id: "banana",
|
|
7357
|
+
name: "Banana"
|
|
7358
|
+
},
|
|
7359
|
+
{
|
|
7360
|
+
id: "apple",
|
|
7361
|
+
name: "Apple"
|
|
7362
|
+
},
|
|
7363
|
+
{
|
|
7364
|
+
id: "sandwich",
|
|
7365
|
+
name: "Sandwich"
|
|
7366
|
+
},
|
|
7367
|
+
{
|
|
7368
|
+
id: "orange",
|
|
7369
|
+
name: "Orange"
|
|
7370
|
+
},
|
|
7371
|
+
{
|
|
7372
|
+
id: "broccoli",
|
|
7373
|
+
name: "Broccoli"
|
|
7374
|
+
},
|
|
7375
|
+
{
|
|
7376
|
+
id: "carrot",
|
|
7377
|
+
name: "Carrot"
|
|
7378
|
+
},
|
|
7379
|
+
{
|
|
7380
|
+
id: "hot dog",
|
|
7381
|
+
name: "Hot Dog"
|
|
7382
|
+
},
|
|
7383
|
+
{
|
|
7384
|
+
id: "pizza",
|
|
7385
|
+
name: "Pizza"
|
|
7386
|
+
},
|
|
7387
|
+
{
|
|
7388
|
+
id: "donut",
|
|
7389
|
+
name: "Donut"
|
|
7390
|
+
},
|
|
7391
|
+
{
|
|
7392
|
+
id: "cake",
|
|
7393
|
+
name: "Cake"
|
|
7394
|
+
},
|
|
7395
|
+
{
|
|
7396
|
+
id: "chair",
|
|
7397
|
+
name: "Chair"
|
|
7398
|
+
},
|
|
7399
|
+
{
|
|
7400
|
+
id: "couch",
|
|
7401
|
+
name: "Couch"
|
|
7402
|
+
},
|
|
7403
|
+
{
|
|
7404
|
+
id: "potted plant",
|
|
7405
|
+
name: "Potted Plant"
|
|
7406
|
+
},
|
|
7407
|
+
{
|
|
7408
|
+
id: "bed",
|
|
7409
|
+
name: "Bed"
|
|
7410
|
+
},
|
|
7411
|
+
{
|
|
7412
|
+
id: "dining table",
|
|
7413
|
+
name: "Dining Table"
|
|
7414
|
+
},
|
|
7415
|
+
{
|
|
7416
|
+
id: "toilet",
|
|
7417
|
+
name: "Toilet"
|
|
7418
|
+
},
|
|
7419
|
+
{
|
|
7420
|
+
id: "tv",
|
|
7421
|
+
name: "TV"
|
|
7422
|
+
},
|
|
7423
|
+
{
|
|
7424
|
+
id: "laptop",
|
|
7425
|
+
name: "Laptop"
|
|
7426
|
+
},
|
|
7427
|
+
{
|
|
7428
|
+
id: "mouse",
|
|
7429
|
+
name: "Mouse"
|
|
7430
|
+
},
|
|
7431
|
+
{
|
|
7432
|
+
id: "remote",
|
|
7433
|
+
name: "Remote"
|
|
7434
|
+
},
|
|
7435
|
+
{
|
|
7436
|
+
id: "keyboard",
|
|
7437
|
+
name: "Keyboard"
|
|
7438
|
+
},
|
|
7439
|
+
{
|
|
7440
|
+
id: "cell phone",
|
|
7441
|
+
name: "Cell Phone"
|
|
7442
|
+
},
|
|
7443
|
+
{
|
|
7444
|
+
id: "microwave",
|
|
7445
|
+
name: "Microwave"
|
|
7446
|
+
},
|
|
7447
|
+
{
|
|
7448
|
+
id: "oven",
|
|
7449
|
+
name: "Oven"
|
|
7450
|
+
},
|
|
7451
|
+
{
|
|
7452
|
+
id: "toaster",
|
|
7453
|
+
name: "Toaster"
|
|
7454
|
+
},
|
|
7455
|
+
{
|
|
7456
|
+
id: "sink",
|
|
7457
|
+
name: "Sink"
|
|
7458
|
+
},
|
|
7459
|
+
{
|
|
7460
|
+
id: "refrigerator",
|
|
7461
|
+
name: "Refrigerator"
|
|
7462
|
+
},
|
|
7463
|
+
{
|
|
7464
|
+
id: "book",
|
|
7465
|
+
name: "Book"
|
|
7466
|
+
},
|
|
7467
|
+
{
|
|
7468
|
+
id: "clock",
|
|
7469
|
+
name: "Clock"
|
|
7470
|
+
},
|
|
7471
|
+
{
|
|
7472
|
+
id: "vase",
|
|
7473
|
+
name: "Vase"
|
|
7474
|
+
},
|
|
7475
|
+
{
|
|
7476
|
+
id: "scissors",
|
|
7477
|
+
name: "Scissors"
|
|
7478
|
+
},
|
|
7479
|
+
{
|
|
7480
|
+
id: "teddy bear",
|
|
7481
|
+
name: "Teddy Bear"
|
|
7482
|
+
},
|
|
7483
|
+
{
|
|
7484
|
+
id: "hair drier",
|
|
7485
|
+
name: "Hair Drier"
|
|
7486
|
+
},
|
|
7487
|
+
{
|
|
7488
|
+
id: "toothbrush",
|
|
7489
|
+
name: "Toothbrush"
|
|
7490
|
+
}
|
|
7491
|
+
];
|
|
7492
|
+
var COCO_TO_MACRO = {
|
|
7493
|
+
mapping: {
|
|
7494
|
+
person: "person",
|
|
7495
|
+
bicycle: "vehicle",
|
|
7496
|
+
car: "vehicle",
|
|
7497
|
+
motorcycle: "vehicle",
|
|
7498
|
+
airplane: "vehicle",
|
|
7499
|
+
bus: "vehicle",
|
|
7500
|
+
train: "vehicle",
|
|
7501
|
+
truck: "vehicle",
|
|
7502
|
+
boat: "vehicle",
|
|
7503
|
+
bird: "animal",
|
|
7504
|
+
cat: "animal",
|
|
7505
|
+
dog: "animal",
|
|
7506
|
+
horse: "animal",
|
|
7507
|
+
sheep: "animal",
|
|
7508
|
+
cow: "animal",
|
|
7509
|
+
elephant: "animal",
|
|
7510
|
+
bear: "animal",
|
|
7511
|
+
zebra: "animal",
|
|
7512
|
+
giraffe: "animal"
|
|
7513
|
+
},
|
|
7514
|
+
preserveOriginal: false
|
|
7515
|
+
};
|
|
7516
|
+
var AUDIO_MACRO_LABELS = [
|
|
7517
|
+
{
|
|
7518
|
+
id: "speech",
|
|
7519
|
+
name: "Speech",
|
|
7520
|
+
icon: "🗣️"
|
|
7521
|
+
},
|
|
7522
|
+
{
|
|
7523
|
+
id: "scream",
|
|
7524
|
+
name: "Scream / Shout",
|
|
7525
|
+
icon: "😱"
|
|
7526
|
+
},
|
|
7527
|
+
{
|
|
7528
|
+
id: "crying",
|
|
7529
|
+
name: "Crying / Baby",
|
|
7530
|
+
icon: "😢"
|
|
7531
|
+
},
|
|
7532
|
+
{
|
|
7533
|
+
id: "laughter",
|
|
7534
|
+
name: "Laughter",
|
|
7535
|
+
icon: "😂"
|
|
7536
|
+
},
|
|
7537
|
+
{
|
|
7538
|
+
id: "music",
|
|
7539
|
+
name: "Music",
|
|
7540
|
+
icon: "🎵"
|
|
7541
|
+
},
|
|
7542
|
+
{
|
|
7543
|
+
id: "dog",
|
|
7544
|
+
name: "Dog",
|
|
7545
|
+
icon: "🐕"
|
|
7546
|
+
},
|
|
7547
|
+
{
|
|
7548
|
+
id: "cat",
|
|
7549
|
+
name: "Cat",
|
|
7550
|
+
icon: "🐈"
|
|
7551
|
+
},
|
|
7552
|
+
{
|
|
7553
|
+
id: "bird",
|
|
7554
|
+
name: "Bird",
|
|
7555
|
+
icon: "🐦"
|
|
7556
|
+
},
|
|
7557
|
+
{
|
|
7558
|
+
id: "animal",
|
|
7559
|
+
name: "Animal (other)",
|
|
7560
|
+
icon: "🐾"
|
|
7561
|
+
},
|
|
7562
|
+
{
|
|
7563
|
+
id: "alarm",
|
|
7564
|
+
name: "Alarm / Siren",
|
|
7565
|
+
icon: "🚨"
|
|
7566
|
+
},
|
|
7567
|
+
{
|
|
7568
|
+
id: "doorbell",
|
|
7569
|
+
name: "Doorbell / Knock",
|
|
7570
|
+
icon: "🔔"
|
|
7571
|
+
},
|
|
7572
|
+
{
|
|
7573
|
+
id: "glass_breaking",
|
|
7574
|
+
name: "Glass Breaking",
|
|
7575
|
+
icon: "💥"
|
|
7576
|
+
},
|
|
7577
|
+
{
|
|
7578
|
+
id: "gunshot",
|
|
7579
|
+
name: "Gunshot / Explosion",
|
|
7580
|
+
icon: "💣"
|
|
7581
|
+
},
|
|
7582
|
+
{
|
|
7583
|
+
id: "vehicle",
|
|
7584
|
+
name: "Vehicle",
|
|
7585
|
+
icon: "🚗"
|
|
7586
|
+
},
|
|
7587
|
+
{
|
|
7588
|
+
id: "siren",
|
|
7589
|
+
name: "Emergency Siren",
|
|
7590
|
+
icon: "🚑"
|
|
7591
|
+
},
|
|
7592
|
+
{
|
|
7593
|
+
id: "fire",
|
|
7594
|
+
name: "Fire / Smoke",
|
|
7595
|
+
icon: "🔥"
|
|
7596
|
+
},
|
|
7597
|
+
{
|
|
7598
|
+
id: "water",
|
|
7599
|
+
name: "Water",
|
|
7600
|
+
icon: "💧"
|
|
7601
|
+
},
|
|
7602
|
+
{
|
|
7603
|
+
id: "wind",
|
|
7604
|
+
name: "Wind / Weather",
|
|
7605
|
+
icon: "🌬️"
|
|
7606
|
+
},
|
|
7607
|
+
{
|
|
7608
|
+
id: "door",
|
|
7609
|
+
name: "Door",
|
|
7610
|
+
icon: "🚪"
|
|
7611
|
+
},
|
|
7612
|
+
{
|
|
7613
|
+
id: "footsteps",
|
|
7614
|
+
name: "Footsteps",
|
|
7615
|
+
icon: "👣"
|
|
7616
|
+
},
|
|
7617
|
+
{
|
|
7618
|
+
id: "crowd",
|
|
7619
|
+
name: "Crowd / Chatter",
|
|
7620
|
+
icon: "👥"
|
|
7621
|
+
},
|
|
7622
|
+
{
|
|
7623
|
+
id: "telephone",
|
|
7624
|
+
name: "Telephone",
|
|
7625
|
+
icon: "📞"
|
|
7626
|
+
},
|
|
7627
|
+
{
|
|
7628
|
+
id: "engine",
|
|
7629
|
+
name: "Engine / Motor",
|
|
7630
|
+
icon: "⚙️"
|
|
7631
|
+
},
|
|
7632
|
+
{
|
|
7633
|
+
id: "tools",
|
|
7634
|
+
name: "Tools / Construction",
|
|
7635
|
+
icon: "🔨"
|
|
7636
|
+
},
|
|
7637
|
+
{
|
|
7638
|
+
id: "silence",
|
|
7639
|
+
name: "Silence",
|
|
7640
|
+
icon: "🤫"
|
|
7641
|
+
}
|
|
7642
|
+
];
|
|
7643
|
+
var YAMNET_TO_MACRO = {
|
|
7644
|
+
mapping: {
|
|
7645
|
+
Speech: "speech",
|
|
7646
|
+
"Child speech, kid speaking": "speech",
|
|
7647
|
+
Conversation: "speech",
|
|
7648
|
+
"Narration, monologue": "speech",
|
|
7649
|
+
Babbling: "speech",
|
|
7650
|
+
Whispering: "speech",
|
|
7651
|
+
"Speech synthesizer": "speech",
|
|
7652
|
+
Humming: "speech",
|
|
7653
|
+
Rapping: "speech",
|
|
7654
|
+
Singing: "speech",
|
|
7655
|
+
Choir: "speech",
|
|
7656
|
+
"Child singing": "speech",
|
|
7657
|
+
Shout: "scream",
|
|
7658
|
+
Bellow: "scream",
|
|
7659
|
+
Yell: "scream",
|
|
7660
|
+
Screaming: "scream",
|
|
7661
|
+
"Children shouting": "scream",
|
|
7662
|
+
Whoop: "scream",
|
|
7663
|
+
"Crying, sobbing": "crying",
|
|
7664
|
+
"Baby cry, infant cry": "crying",
|
|
7665
|
+
Whimper: "crying",
|
|
7666
|
+
"Wail, moan": "crying",
|
|
7667
|
+
Groan: "crying",
|
|
7668
|
+
Laughter: "laughter",
|
|
7669
|
+
"Baby laughter": "laughter",
|
|
7670
|
+
Giggle: "laughter",
|
|
7671
|
+
Snicker: "laughter",
|
|
7672
|
+
"Belly laugh": "laughter",
|
|
7673
|
+
"Chuckle, chortle": "laughter",
|
|
7674
|
+
Music: "music",
|
|
7675
|
+
"Musical instrument": "music",
|
|
7676
|
+
Guitar: "music",
|
|
7677
|
+
Piano: "music",
|
|
7678
|
+
Drum: "music",
|
|
7679
|
+
"Drum kit": "music",
|
|
7680
|
+
"Violin, fiddle": "music",
|
|
7681
|
+
Flute: "music",
|
|
7682
|
+
Saxophone: "music",
|
|
7683
|
+
Trumpet: "music",
|
|
7684
|
+
Synthesizer: "music",
|
|
7685
|
+
"Pop music": "music",
|
|
7686
|
+
"Rock music": "music",
|
|
7687
|
+
"Hip hop music": "music",
|
|
7688
|
+
"Classical music": "music",
|
|
7689
|
+
Jazz: "music",
|
|
7690
|
+
"Electronic music": "music",
|
|
7691
|
+
"Background music": "music",
|
|
7692
|
+
Dog: "dog",
|
|
7693
|
+
Bark: "dog",
|
|
7694
|
+
Yip: "dog",
|
|
7695
|
+
Howl: "dog",
|
|
7696
|
+
"Bow-wow": "dog",
|
|
7697
|
+
Growling: "dog",
|
|
7698
|
+
"Whimper (dog)": "dog",
|
|
7699
|
+
Cat: "cat",
|
|
7700
|
+
Purr: "cat",
|
|
7701
|
+
Meow: "cat",
|
|
7702
|
+
Hiss: "cat",
|
|
7703
|
+
Caterwaul: "cat",
|
|
7704
|
+
Bird: "bird",
|
|
7705
|
+
"Bird vocalization, bird call, bird song": "bird",
|
|
7706
|
+
"Chirp, tweet": "bird",
|
|
7707
|
+
Squawk: "bird",
|
|
7708
|
+
Crow: "bird",
|
|
7709
|
+
Owl: "bird",
|
|
7710
|
+
"Pigeon, dove": "bird",
|
|
7711
|
+
Animal: "animal",
|
|
7712
|
+
"Domestic animals, pets": "animal",
|
|
7713
|
+
"Livestock, farm animals, working animals": "animal",
|
|
7714
|
+
Horse: "animal",
|
|
7715
|
+
"Cattle, bovinae": "animal",
|
|
7716
|
+
Pig: "animal",
|
|
7717
|
+
Sheep: "animal",
|
|
7718
|
+
Goat: "animal",
|
|
7719
|
+
Frog: "animal",
|
|
7720
|
+
Insect: "animal",
|
|
7721
|
+
Cricket: "animal",
|
|
7722
|
+
Alarm: "alarm",
|
|
7723
|
+
"Alarm clock": "alarm",
|
|
7724
|
+
"Smoke detector, smoke alarm": "alarm",
|
|
7725
|
+
"Fire alarm": "alarm",
|
|
7726
|
+
Buzzer: "alarm",
|
|
7727
|
+
"Civil defense siren": "alarm",
|
|
7728
|
+
"Car alarm": "alarm",
|
|
7729
|
+
Siren: "siren",
|
|
7730
|
+
"Police car (siren)": "siren",
|
|
7731
|
+
"Ambulance (siren)": "siren",
|
|
7732
|
+
"Fire engine, fire truck (siren)": "siren",
|
|
7733
|
+
"Emergency vehicle": "siren",
|
|
7734
|
+
Foghorn: "siren",
|
|
7735
|
+
Doorbell: "doorbell",
|
|
7736
|
+
"Ding-dong": "doorbell",
|
|
7737
|
+
Knock: "doorbell",
|
|
7738
|
+
Tap: "doorbell",
|
|
7739
|
+
Glass: "glass_breaking",
|
|
7740
|
+
Shatter: "glass_breaking",
|
|
7741
|
+
"Chink, clink": "glass_breaking",
|
|
7742
|
+
"Gunshot, gunfire": "gunshot",
|
|
7743
|
+
"Machine gun": "gunshot",
|
|
7744
|
+
Explosion: "gunshot",
|
|
7745
|
+
Fireworks: "gunshot",
|
|
7746
|
+
Firecracker: "gunshot",
|
|
7747
|
+
"Artillery fire": "gunshot",
|
|
7748
|
+
"Cap gun": "gunshot",
|
|
7749
|
+
Boom: "gunshot",
|
|
7750
|
+
Vehicle: "vehicle",
|
|
7751
|
+
Car: "vehicle",
|
|
7752
|
+
Truck: "vehicle",
|
|
7753
|
+
Bus: "vehicle",
|
|
7754
|
+
Motorcycle: "vehicle",
|
|
7755
|
+
"Car passing by": "vehicle",
|
|
7756
|
+
"Vehicle horn, car horn, honking": "vehicle",
|
|
7757
|
+
"Traffic noise, roadway noise": "vehicle",
|
|
7758
|
+
Train: "vehicle",
|
|
7759
|
+
Aircraft: "vehicle",
|
|
7760
|
+
Helicopter: "vehicle",
|
|
7761
|
+
Bicycle: "vehicle",
|
|
7762
|
+
Skateboard: "vehicle",
|
|
7763
|
+
Fire: "fire",
|
|
7764
|
+
Crackle: "fire",
|
|
7765
|
+
Water: "water",
|
|
7766
|
+
Rain: "water",
|
|
7767
|
+
Raindrop: "water",
|
|
7768
|
+
"Rain on surface": "water",
|
|
7769
|
+
Stream: "water",
|
|
7770
|
+
Waterfall: "water",
|
|
7771
|
+
Ocean: "water",
|
|
7772
|
+
"Waves, surf": "water",
|
|
7773
|
+
"Splash, splatter": "water",
|
|
7774
|
+
Wind: "wind",
|
|
7775
|
+
Thunderstorm: "wind",
|
|
7776
|
+
Thunder: "wind",
|
|
7777
|
+
"Wind noise (microphone)": "wind",
|
|
7778
|
+
"Rustling leaves": "wind",
|
|
7779
|
+
Door: "door",
|
|
7780
|
+
"Sliding door": "door",
|
|
7781
|
+
Slam: "door",
|
|
7782
|
+
"Cupboard open or close": "door",
|
|
7783
|
+
"Walk, footsteps": "footsteps",
|
|
7784
|
+
Run: "footsteps",
|
|
7785
|
+
Shuffle: "footsteps",
|
|
7786
|
+
Crowd: "crowd",
|
|
7787
|
+
Chatter: "crowd",
|
|
7788
|
+
Cheering: "crowd",
|
|
7789
|
+
Applause: "crowd",
|
|
7790
|
+
"Children playing": "crowd",
|
|
7791
|
+
"Hubbub, speech noise, speech babble": "crowd",
|
|
7792
|
+
Telephone: "telephone",
|
|
7793
|
+
"Telephone bell ringing": "telephone",
|
|
7794
|
+
Ringtone: "telephone",
|
|
7795
|
+
"Telephone dialing, DTMF": "telephone",
|
|
7796
|
+
"Busy signal": "telephone",
|
|
7797
|
+
Engine: "engine",
|
|
7798
|
+
"Engine starting": "engine",
|
|
7799
|
+
Idling: "engine",
|
|
7800
|
+
"Accelerating, revving, vroom": "engine",
|
|
7801
|
+
"Light engine (high frequency)": "engine",
|
|
7802
|
+
"Medium engine (mid frequency)": "engine",
|
|
7803
|
+
"Heavy engine (low frequency)": "engine",
|
|
7804
|
+
"Lawn mower": "engine",
|
|
7805
|
+
Chainsaw: "engine",
|
|
7806
|
+
Hammer: "tools",
|
|
7807
|
+
Jackhammer: "tools",
|
|
7808
|
+
Sawing: "tools",
|
|
7809
|
+
"Power tool": "tools",
|
|
7810
|
+
Drill: "tools",
|
|
7811
|
+
Sanding: "tools",
|
|
7812
|
+
Silence: "silence"
|
|
7813
|
+
},
|
|
7814
|
+
preserveOriginal: false
|
|
7815
|
+
};
|
|
7816
|
+
var APPLE_SA_TO_MACRO = {
|
|
7817
|
+
mapping: {
|
|
7818
|
+
speech: "speech",
|
|
7819
|
+
child_speech: "speech",
|
|
7820
|
+
conversation: "speech",
|
|
7821
|
+
whispering: "speech",
|
|
7822
|
+
singing: "speech",
|
|
7823
|
+
humming: "speech",
|
|
7824
|
+
shout: "scream",
|
|
7825
|
+
yell: "scream",
|
|
7826
|
+
screaming: "scream",
|
|
7827
|
+
crying: "crying",
|
|
7828
|
+
baby_crying: "crying",
|
|
7829
|
+
sobbing: "crying",
|
|
7830
|
+
laughter: "laughter",
|
|
7831
|
+
baby_laughter: "laughter",
|
|
7832
|
+
giggling: "laughter",
|
|
7833
|
+
music: "music",
|
|
7834
|
+
guitar: "music",
|
|
7835
|
+
piano: "music",
|
|
7836
|
+
drums: "music",
|
|
7837
|
+
dog_bark: "dog",
|
|
7838
|
+
dog_bow_wow: "dog",
|
|
7839
|
+
dog_growling: "dog",
|
|
7840
|
+
dog_howl: "dog",
|
|
7841
|
+
cat_meow: "cat",
|
|
7842
|
+
cat_purr: "cat",
|
|
7843
|
+
cat_hiss: "cat",
|
|
7844
|
+
bird: "bird",
|
|
7845
|
+
bird_chirp: "bird",
|
|
7846
|
+
bird_squawk: "bird",
|
|
7847
|
+
animal: "animal",
|
|
7848
|
+
horse: "animal",
|
|
7849
|
+
cow_moo: "animal",
|
|
7850
|
+
insect: "animal",
|
|
7851
|
+
alarm: "alarm",
|
|
7852
|
+
smoke_alarm: "alarm",
|
|
7853
|
+
fire_alarm: "alarm",
|
|
7854
|
+
car_alarm: "alarm",
|
|
7855
|
+
siren: "siren",
|
|
7856
|
+
police_siren: "siren",
|
|
7857
|
+
ambulance_siren: "siren",
|
|
7858
|
+
doorbell: "doorbell",
|
|
7859
|
+
door_knock: "doorbell",
|
|
7860
|
+
knocking: "doorbell",
|
|
7861
|
+
glass_breaking: "glass_breaking",
|
|
7862
|
+
glass_shatter: "glass_breaking",
|
|
7863
|
+
gunshot: "gunshot",
|
|
7864
|
+
explosion: "gunshot",
|
|
7865
|
+
fireworks: "gunshot",
|
|
7866
|
+
car: "vehicle",
|
|
7867
|
+
truck: "vehicle",
|
|
7868
|
+
motorcycle: "vehicle",
|
|
7869
|
+
car_horn: "vehicle",
|
|
7870
|
+
vehicle_horn: "vehicle",
|
|
7871
|
+
traffic: "vehicle",
|
|
7872
|
+
fire: "fire",
|
|
7873
|
+
fire_crackle: "fire",
|
|
7874
|
+
water: "water",
|
|
7875
|
+
rain: "water",
|
|
7876
|
+
ocean: "water",
|
|
7877
|
+
splash: "water",
|
|
7878
|
+
wind: "wind",
|
|
7879
|
+
thunder: "wind",
|
|
7880
|
+
thunderstorm: "wind",
|
|
7881
|
+
door: "door",
|
|
7882
|
+
door_slam: "door",
|
|
7883
|
+
sliding_door: "door",
|
|
7884
|
+
footsteps: "footsteps",
|
|
7885
|
+
walking: "footsteps",
|
|
7886
|
+
running: "footsteps",
|
|
7887
|
+
crowd: "crowd",
|
|
7888
|
+
chatter: "crowd",
|
|
7889
|
+
cheering: "crowd",
|
|
7890
|
+
applause: "crowd",
|
|
7891
|
+
telephone_ring: "telephone",
|
|
7892
|
+
ringtone: "telephone",
|
|
7893
|
+
engine: "engine",
|
|
7894
|
+
engine_starting: "engine",
|
|
7895
|
+
lawn_mower: "engine",
|
|
7896
|
+
chainsaw: "engine",
|
|
7897
|
+
hammer: "tools",
|
|
7898
|
+
jackhammer: "tools",
|
|
7899
|
+
drill: "tools",
|
|
7900
|
+
power_tool: "tools",
|
|
7901
|
+
silence: "silence"
|
|
7902
|
+
},
|
|
7903
|
+
preserveOriginal: false
|
|
7904
|
+
};
|
|
7905
|
+
var _macroLookup = /* @__PURE__ */ new Map();
|
|
7906
|
+
for (const [k, v] of Object.entries(YAMNET_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7907
|
+
for (const [k, v] of Object.entries(APPLE_SA_TO_MACRO.mapping)) _macroLookup.set(k.toLowerCase(), v);
|
|
7908
|
+
/** Map a raw audio label (YAMNet or Apple SoundAnalysis) to its macro class. Returns null if unmapped. */
|
|
7909
|
+
function mapAudioLabelToMacro(label) {
|
|
7910
|
+
return _macroLookup.get(label.toLowerCase()) ?? null;
|
|
7911
|
+
}
|
|
7752
7912
|
/**
|
|
7753
7913
|
* Accessory device helpers — shared across drivers.
|
|
7754
7914
|
*
|
|
@@ -7908,78 +8068,6 @@ object({
|
|
|
7908
8068
|
});
|
|
7909
8069
|
DeviceType.Sensor;
|
|
7910
8070
|
/**
|
|
7911
|
-
* Generic types for capability definitions.
|
|
7912
|
-
*
|
|
7913
|
-
* A capability is defined with Zod schemas for methods, events, and settings.
|
|
7914
|
-
* TypeScript types are inferred via z.infer<> — zero duplication.
|
|
7915
|
-
*
|
|
7916
|
-
* Pattern:
|
|
7917
|
-
* 1. Define Zod schemas for data, methods, settings
|
|
7918
|
-
* 2. Export const capabilityDef = { ... } satisfies CapabilityDefinition
|
|
7919
|
-
* 3. Export type IProvider = InferProvider<typeof capabilityDef>
|
|
7920
|
-
* 4. Addon implements IProvider
|
|
7921
|
-
* 5. Registry auto-mounts tRPC router from definition.methods
|
|
7922
|
-
*/
|
|
7923
|
-
/**
|
|
7924
|
-
* Output schema shared by the contribution + live methods.
|
|
7925
|
-
*
|
|
7926
|
-
* Mirrors the `ConfigUISchemaWithValues` shape (sections[] + optional
|
|
7927
|
-
* tabs[]) without importing from `../interfaces/config-ui.js` — a
|
|
7928
|
-
* concrete-but-lenient Zod object keeps tRPC output inference happy
|
|
7929
|
-
* (using `z.unknown()` here collapses unrelated router branches to
|
|
7930
|
-
* `unknown` when the generator re-inlines the huge AppRouter type).
|
|
7931
|
-
*
|
|
7932
|
-
* `.passthrough()` on sections/fields accepts whatever FormBuilder
|
|
7933
|
-
* extensions the caller adds (showWhen, displayScale, …) without
|
|
7934
|
-
* rebuilding every time a new field kind is introduced.
|
|
7935
|
-
*/
|
|
7936
|
-
var ContributionSectionSchema = object({
|
|
7937
|
-
id: string(),
|
|
7938
|
-
title: string(),
|
|
7939
|
-
description: string().optional(),
|
|
7940
|
-
style: _enum(["card", "accordion"]).optional(),
|
|
7941
|
-
defaultCollapsed: boolean().optional(),
|
|
7942
|
-
columns: union([
|
|
7943
|
-
literal(1),
|
|
7944
|
-
literal(2),
|
|
7945
|
-
literal(3),
|
|
7946
|
-
literal(4)
|
|
7947
|
-
]).optional(),
|
|
7948
|
-
tab: string().optional(),
|
|
7949
|
-
location: _enum(["settings", "top-tab"]).optional(),
|
|
7950
|
-
order: number().optional(),
|
|
7951
|
-
fields: array(any())
|
|
7952
|
-
});
|
|
7953
|
-
object({
|
|
7954
|
-
tabs: array(object({
|
|
7955
|
-
id: string(),
|
|
7956
|
-
label: string(),
|
|
7957
|
-
icon: string(),
|
|
7958
|
-
order: number().optional()
|
|
7959
|
-
})).optional(),
|
|
7960
|
-
sections: array(ContributionSectionSchema)
|
|
7961
|
-
}).nullable();
|
|
7962
|
-
object({ deviceId: number() }), object({ deviceId: number() }), object({
|
|
7963
|
-
deviceId: number(),
|
|
7964
|
-
patch: record(string(), unknown())
|
|
7965
|
-
}), object({ success: literal(true) });
|
|
7966
|
-
object({ deviceId: number() }), unknown().nullable();
|
|
7967
|
-
/** Shorthand to define a method schema */
|
|
7968
|
-
function method(input, output, options) {
|
|
7969
|
-
return {
|
|
7970
|
-
input,
|
|
7971
|
-
output,
|
|
7972
|
-
kind: options?.kind ?? "query",
|
|
7973
|
-
auth: options?.auth ?? "protected",
|
|
7974
|
-
...options?.access !== void 0 ? { access: options.access } : {},
|
|
7975
|
-
timeoutMs: options?.timeoutMs
|
|
7976
|
-
};
|
|
7977
|
-
}
|
|
7978
|
-
/** Shorthand to define an event schema */
|
|
7979
|
-
function event(data) {
|
|
7980
|
-
return { data };
|
|
7981
|
-
}
|
|
7982
|
-
/**
|
|
7983
8071
|
* Alarm-panel cap. Models HA `alarm_control_panel.*` on
|
|
7984
8072
|
* `DeviceType.AlarmPanel`. State follows HA's canonical lifecycle
|
|
7985
8073
|
* across disarmed / armed_(home|away|night|vacation|custom_bypass) /
|
|
@@ -12476,9 +12564,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
12476
12564
|
limit: number().optional(),
|
|
12477
12565
|
tags: record(string(), string()).optional()
|
|
12478
12566
|
}), array(LogEntrySchema).readonly());
|
|
12479
|
-
var StaticDirOutputSchema = object({ staticDir: string() });
|
|
12480
|
-
var VersionOutputSchema = object({ version: string() });
|
|
12481
|
-
method(_void(), StaticDirOutputSchema), method(_void(), VersionOutputSchema);
|
|
12482
12567
|
/**
|
|
12483
12568
|
* Zod schemas for persisted record types.
|
|
12484
12569
|
*
|
|
@@ -15076,7 +15161,7 @@ method(object({
|
|
|
15076
15161
|
}), _void(), {
|
|
15077
15162
|
kind: "mutation",
|
|
15078
15163
|
auth: "admin"
|
|
15079
|
-
}), 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({
|
|
15164
|
+
}), 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({
|
|
15080
15165
|
deviceId: number(),
|
|
15081
15166
|
values: record(string(), unknown())
|
|
15082
15167
|
}), object({ success: literal(true) }), {
|
|
@@ -15789,7 +15874,20 @@ var DiskSpaceInfoSchema = object({
|
|
|
15789
15874
|
var PidResourceStatsSchema = object({
|
|
15790
15875
|
pid: number(),
|
|
15791
15876
|
cpu: number(),
|
|
15792
|
-
memory: number()
|
|
15877
|
+
memory: number(),
|
|
15878
|
+
/**
|
|
15879
|
+
* Private (anonymous) resident bytes — the per-process V8 heap + native
|
|
15880
|
+
* allocations NOT shared with other processes (Linux RssAnon). This is the
|
|
15881
|
+
* "real" per-runner cost; summing it across runners is meaningful, unlike
|
|
15882
|
+
* `memory` (RSS), which double-counts the shared mmap'd framework code.
|
|
15883
|
+
* Undefined where /proc is unavailable (e.g. macOS).
|
|
15884
|
+
*/
|
|
15885
|
+
privateBytes: number().optional(),
|
|
15886
|
+
/**
|
|
15887
|
+
* Shared file-backed resident bytes (Linux RssFile) — mmap'd framework/lib
|
|
15888
|
+
* code shared copy-on-write across runners. Undefined on macOS.
|
|
15889
|
+
*/
|
|
15890
|
+
sharedBytes: number().optional()
|
|
15793
15891
|
});
|
|
15794
15892
|
var AddonInstanceSchema = object({
|
|
15795
15893
|
addonId: string(),
|
|
@@ -15838,6 +15936,17 @@ var KillProcessResultSchema = object({
|
|
|
15838
15936
|
reason: string().optional(),
|
|
15839
15937
|
signal: _enum(["SIGTERM", "SIGKILL"]).optional()
|
|
15840
15938
|
});
|
|
15939
|
+
var DumpHeapSnapshotInputSchema = object({
|
|
15940
|
+
/** The addon whose runner should dump a heap snapshot. */
|
|
15941
|
+
addonId: string() });
|
|
15942
|
+
var DumpHeapSnapshotResultSchema = object({
|
|
15943
|
+
success: boolean(),
|
|
15944
|
+
/** Path of the written .heapsnapshot inside the runner's container/host. */
|
|
15945
|
+
path: string().optional(),
|
|
15946
|
+
/** Process pid that was signalled. */
|
|
15947
|
+
pid: number().optional(),
|
|
15948
|
+
reason: string().optional()
|
|
15949
|
+
});
|
|
15841
15950
|
var SystemMetricsSchema = object({
|
|
15842
15951
|
cpuPercent: number(),
|
|
15843
15952
|
memoryPercent: number(),
|
|
@@ -15851,6 +15960,9 @@ var SystemMetricsSchema = object({
|
|
|
15851
15960
|
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, {
|
|
15852
15961
|
kind: "mutation",
|
|
15853
15962
|
auth: "admin"
|
|
15963
|
+
}), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
|
|
15964
|
+
kind: "mutation",
|
|
15965
|
+
auth: "admin"
|
|
15854
15966
|
});
|
|
15855
15967
|
var PtzPresetSchema = object({
|
|
15856
15968
|
id: string(),
|
|
@@ -16250,63 +16362,6 @@ var recordingCapability = {
|
|
|
16250
16362
|
}
|
|
16251
16363
|
};
|
|
16252
16364
|
/**
|
|
16253
|
-
* device-ops — device-scoped cap that unifies the per-IDevice operations
|
|
16254
|
-
* previously routed through the `.device-ops` Moleculer bridge service.
|
|
16255
|
-
*
|
|
16256
|
-
* Each worker that hosts live `IDevice` instances auto-registers a native
|
|
16257
|
-
* provider for this cap (per device) backed by its local
|
|
16258
|
-
* `DeviceRegistry`. Hub-side callers reach it transparently through
|
|
16259
|
-
* `ctx.fetchDevice(id).deviceOps.*` — the DeviceProxy injects
|
|
16260
|
-
* `deviceId` + `nodeId` and dispatches through the standard cap-router,
|
|
16261
|
-
* so there's no parallel bridge path anymore.
|
|
16262
|
-
*
|
|
16263
|
-
* The surface is intentionally small — every method corresponds to a
|
|
16264
|
-
* single action on the live `IDevice` (or `ICameraDevice` for
|
|
16265
|
-
* `getStreamSources`). Richer orchestration (enable/disable with
|
|
16266
|
-
* integration plumbing, bulk updates) stays in the `device-manager` cap;
|
|
16267
|
-
* `device-ops` is the per-device primitive the device-manager routes to.
|
|
16268
|
-
*/
|
|
16269
|
-
var StreamSourceEntrySchema$1 = object({
|
|
16270
|
-
id: string(),
|
|
16271
|
-
label: string(),
|
|
16272
|
-
protocol: _enum([
|
|
16273
|
-
"rtsp",
|
|
16274
|
-
"rtmp",
|
|
16275
|
-
"annexb",
|
|
16276
|
-
"http-mjpeg",
|
|
16277
|
-
"webrtc",
|
|
16278
|
-
"custom"
|
|
16279
|
-
]),
|
|
16280
|
-
url: string().optional(),
|
|
16281
|
-
resolution: object({
|
|
16282
|
-
width: number(),
|
|
16283
|
-
height: number()
|
|
16284
|
-
}).optional(),
|
|
16285
|
-
fps: number().optional(),
|
|
16286
|
-
bitrate: number().optional(),
|
|
16287
|
-
codec: string().optional(),
|
|
16288
|
-
profileHint: CamProfileSchema.optional(),
|
|
16289
|
-
sdp: string().optional()
|
|
16290
|
-
});
|
|
16291
|
-
var ConfigEntrySchema$1 = object({
|
|
16292
|
-
key: string(),
|
|
16293
|
-
value: unknown()
|
|
16294
|
-
});
|
|
16295
|
-
var RawStateResultSchema = object({
|
|
16296
|
-
/** Originating provider id, e.g. 'homeassistant' | 'reolink' | 'hikvision'. */
|
|
16297
|
-
source: string(),
|
|
16298
|
-
/** Opaque, DISPLAY-SAFE upstream blob (no secrets/PII). */
|
|
16299
|
-
data: record(string(), unknown())
|
|
16300
|
-
});
|
|
16301
|
-
method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema$1)), method(object({
|
|
16302
|
-
deviceId: number(),
|
|
16303
|
-
values: record(string(), unknown())
|
|
16304
|
-
}), _void(), { kind: "mutation" }), method(object({
|
|
16305
|
-
deviceId: number(),
|
|
16306
|
-
action: string().min(1),
|
|
16307
|
-
input: unknown()
|
|
16308
|
-
}), unknown(), { kind: "mutation" }), method(object({ deviceId: number() }), _void(), { kind: "mutation" }), method(object({ deviceId: number() }), unknown().nullable()), method(object({ deviceId: number() }), RawStateResultSchema.nullable(), { auth: "protected" });
|
|
16309
|
-
/**
|
|
16310
16365
|
* camera-credentials — device-scoped cap exposing the camera's network
|
|
16311
16366
|
* + auth surface in a vendor-neutral shape.
|
|
16312
16367
|
*
|
|
@@ -19989,6 +20044,12 @@ Object.freeze({
|
|
|
19989
20044
|
addonId: null,
|
|
19990
20045
|
access: "view"
|
|
19991
20046
|
},
|
|
20047
|
+
"metricsProvider.dumpHeapSnapshot": {
|
|
20048
|
+
capName: "metrics-provider",
|
|
20049
|
+
capScope: "system",
|
|
20050
|
+
addonId: null,
|
|
20051
|
+
access: "create"
|
|
20052
|
+
},
|
|
19992
20053
|
"metricsProvider.getAddonStats": {
|
|
19993
20054
|
capName: "metrics-provider",
|
|
19994
20055
|
capScope: "system",
|
|
@@ -22355,29 +22416,5 @@ var RingBuffer = class {
|
|
|
22355
22416
|
return result;
|
|
22356
22417
|
}
|
|
22357
22418
|
};
|
|
22358
|
-
/**
|
|
22359
|
-
* Promise-based timer helpers — used everywhere the codebase needs to
|
|
22360
|
-
* wait, back off, or schedule a retry. Before these helpers landed, each
|
|
22361
|
-
* call site re-implemented `new Promise(r => setTimeout(r, ms))` inline,
|
|
22362
|
-
* with subtle variations (some swallowing cancellation, some not). Two
|
|
22363
|
-
* shapes cover every observed use case:
|
|
22364
|
-
*
|
|
22365
|
-
* - {@link sleep} for a plain, uncancellable wait — the default choice.
|
|
22366
|
-
* - {@link sleepCancellable} for a wait that wakes early when an
|
|
22367
|
-
* abort signal trips, used by long-running pollers whose teardown
|
|
22368
|
-
* must stop a pending backoff promptly.
|
|
22369
|
-
*/
|
|
22370
|
-
/**
|
|
22371
|
-
* Resolve after `ms` milliseconds. Never rejects, never cancels. The
|
|
22372
|
-
* sleep cannot be interrupted; for a wakeable variant use
|
|
22373
|
-
* {@link sleepCancellable}.
|
|
22374
|
-
*
|
|
22375
|
-
* `ms <= 0` resolves on the next microtask via `setTimeout(0)`, which
|
|
22376
|
-
* still gives the event loop a chance to drain — useful for breaking
|
|
22377
|
-
* up tight async loops without changing call-site semantics.
|
|
22378
|
-
*/
|
|
22379
|
-
function sleep(ms) {
|
|
22380
|
-
return new Promise((resolve) => setTimeout(resolve, Math.max(0, ms)));
|
|
22381
|
-
}
|
|
22382
22419
|
//#endregion
|
|
22383
|
-
export { boolean as $,
|
|
22420
|
+
export { boolean as $, pipelineRunnerCapability as A, EventCategory as B, evaluateZoneRules as C, migrateConfigToBands as D, maskUrlCredentials as E, errMsg as F, makeProfileBrokerId as G, createDurableState as H, BaseAddon as I, parseProfileBrokerId as J, makeSourceBrokerId as K, CAM_PROFILE_ORDER as L, storageEvictableCapability as M, streamBrokerCapability as N, motionDetectionCapability as O, webrtcSessionCapability as P, array as Q, DeviceFeature as R, detectionPipelineCapability as S, mapAudioLabelToMacro as T, createEvent as U, asJsonObject as V, hydrateSchema as W, sleep as X, selectAssignedProfileSlots as Y, _enum as Z, audioCodecCapability as _, COCO_TO_MACRO as a, record as at, decoderCapability as b, EncodeProfileSchema as c, RecordingConfigSchema as d, discriminatedUnion as et, RingBuffer as f, audioAnalyzerCapability as g, audioAnalysisCapability as h, COCO_80_LABELS as i, object as it, recordingCapability as j, pipelineExecutorCapability as k, HF_BASE_URL as l, addonWidgetsSourceCapability as m, AUDIO_BACKEND_CHOICES as n, literal as nt, DEFAULT_AUDIO_ANALYZER_CONFIG as o, string as ot, YAMNET_TO_MACRO as p, parseJsonUnknown as q, AUDIO_MACRO_LABELS as r, number as rt, DEFAULT_DECODER_HWACCEL_CONFIG as s, union as st, APPLE_SA_TO_MACRO as t, lazy as tt, HWACCEL_OPTIONS as u, cameraStreamsCapability as v, hfModelUrl as w, defineCustomActions as x, customAction as y, DeviceType as z };
|