@camstack/addon-provider-homeassistant 1.2.46 → 1.2.47
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/{dist-Dve9pw2J.js → dist-D_G71rhM.js} +322 -25
- package/dist/{dist-DyzpzpTm.mjs → dist-DlrKePv3.mjs} +322 -25
- package/dist/ha-export/ha-export.addon.js +1 -1
- package/dist/ha-export/ha-export.addon.mjs +1 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-D_G71rhM.js");
|
|
3
3
|
let node_crypto = require("node:crypto");
|
|
4
4
|
let node_zlib = require("node:zlib");
|
|
5
5
|
//#region src/ha-device-source.ts
|
package/dist/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-
|
|
1
|
+
import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-DlrKePv3.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
|
|
4
4
|
//#region src/ha-device-source.ts
|
|
@@ -7671,6 +7671,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7671
7671
|
fetchedAt: number()
|
|
7672
7672
|
});
|
|
7673
7673
|
/**
|
|
7674
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7675
|
+
* an addon declares its channels in.
|
|
7676
|
+
*
|
|
7677
|
+
* ## Two axes, deliberately separated
|
|
7678
|
+
*
|
|
7679
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7680
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7681
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7682
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7683
|
+
* `log-channels` capability enumerates the declarations.
|
|
7684
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7685
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7686
|
+
* over the values is the exact defect
|
|
7687
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7688
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7689
|
+
*
|
|
7690
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7691
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7692
|
+
* the hot path with a value somebody actually read, and by
|
|
7693
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7694
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7695
|
+
* disarmed one (D49).
|
|
7696
|
+
*
|
|
7697
|
+
* ## The canonical call shape
|
|
7698
|
+
*
|
|
7699
|
+
* ```ts
|
|
7700
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7701
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7702
|
+
* }
|
|
7703
|
+
* ```
|
|
7704
|
+
*
|
|
7705
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7706
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7707
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7708
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7709
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7710
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7711
|
+
*
|
|
7712
|
+
* ## Why a channel emits at `info`
|
|
7713
|
+
*
|
|
7714
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7715
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7716
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7717
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7718
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7719
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7720
|
+
*/
|
|
7721
|
+
/**
|
|
7722
|
+
* The level a channel writes at once armed.
|
|
7723
|
+
*
|
|
7724
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7725
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7726
|
+
* to read it later.
|
|
7727
|
+
*/
|
|
7728
|
+
var LogChannelLevelSchema = _enum([
|
|
7729
|
+
"info",
|
|
7730
|
+
"warn",
|
|
7731
|
+
"error"
|
|
7732
|
+
]);
|
|
7733
|
+
/**
|
|
7734
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7735
|
+
* declaration is inert.
|
|
7736
|
+
*/
|
|
7737
|
+
var LogChannelDescriptorSchema = object({
|
|
7738
|
+
/**
|
|
7739
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7740
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7741
|
+
* owns it without a second lookup.
|
|
7742
|
+
*/
|
|
7743
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7744
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7745
|
+
description: string().min(1),
|
|
7746
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7747
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7748
|
+
/**
|
|
7749
|
+
* Whether this channel can be narrowed to a camera.
|
|
7750
|
+
*
|
|
7751
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7752
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7753
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7754
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7755
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7756
|
+
* the body is the only way to filter.
|
|
7757
|
+
*
|
|
7758
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7759
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7760
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7761
|
+
* path was never taken.
|
|
7762
|
+
*/
|
|
7763
|
+
perDevice: boolean()
|
|
7764
|
+
});
|
|
7765
|
+
/**
|
|
7766
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7767
|
+
*
|
|
7768
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7769
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7770
|
+
*/
|
|
7771
|
+
var LogChannelWindowSchema = object({
|
|
7772
|
+
channel: string().min(1),
|
|
7773
|
+
/** Epoch ms the window closes at. */
|
|
7774
|
+
armedUntilMs: number(),
|
|
7775
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7776
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7777
|
+
});
|
|
7778
|
+
/**
|
|
7674
7779
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7675
7780
|
* recordings and events management surfaces.
|
|
7676
7781
|
*
|
|
@@ -11359,6 +11464,35 @@ var MutationFilterSchema = object({
|
|
|
11359
11464
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11360
11465
|
whereNot: record(string(), unknown()).optional()
|
|
11361
11466
|
});
|
|
11467
|
+
/**
|
|
11468
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11469
|
+
*
|
|
11470
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11471
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11472
|
+
* a `Record<column, op>` shape could not express.
|
|
11473
|
+
*/
|
|
11474
|
+
var AggregateFieldSchema = object({
|
|
11475
|
+
/** Result key. */
|
|
11476
|
+
as: string().min(1),
|
|
11477
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11478
|
+
field: string().min(1),
|
|
11479
|
+
op: _enum([
|
|
11480
|
+
"sum",
|
|
11481
|
+
"min",
|
|
11482
|
+
"max"
|
|
11483
|
+
])
|
|
11484
|
+
});
|
|
11485
|
+
/**
|
|
11486
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11487
|
+
*
|
|
11488
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11489
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11490
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11491
|
+
*/
|
|
11492
|
+
var AggregateResultSchema = object({
|
|
11493
|
+
count: number().int(),
|
|
11494
|
+
values: record(string(), number().nullable())
|
|
11495
|
+
});
|
|
11362
11496
|
/** A single stored record: `{ id, data }`. */
|
|
11363
11497
|
var SettingsRecordSchema = object({
|
|
11364
11498
|
id: string(),
|
|
@@ -11443,6 +11577,11 @@ method(object({
|
|
|
11443
11577
|
collection: string(),
|
|
11444
11578
|
filter: QueryFilterSchema.optional()
|
|
11445
11579
|
}), number()), method(object({
|
|
11580
|
+
namespace: string().optional(),
|
|
11581
|
+
collection: string(),
|
|
11582
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11583
|
+
filter: QueryFilterSchema.optional()
|
|
11584
|
+
}), AggregateResultSchema), method(object({
|
|
11446
11585
|
namespace: string().optional(),
|
|
11447
11586
|
collection: string(),
|
|
11448
11587
|
field: string(),
|
|
@@ -11559,6 +11698,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11559
11698
|
collection: string(),
|
|
11560
11699
|
filter: QueryFilterSchema.optional()
|
|
11561
11700
|
}), number(), { auth: "admin" }), method(object({
|
|
11701
|
+
namespace: string().optional(),
|
|
11702
|
+
collection: string(),
|
|
11703
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11704
|
+
filter: QueryFilterSchema.optional()
|
|
11705
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11562
11706
|
namespace: string().optional(),
|
|
11563
11707
|
collection: string(),
|
|
11564
11708
|
field: string(),
|
|
@@ -12369,24 +12513,6 @@ var deviceProviderCapability = {
|
|
|
12369
12513
|
})
|
|
12370
12514
|
}
|
|
12371
12515
|
};
|
|
12372
|
-
/**
|
|
12373
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12374
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12375
|
-
*
|
|
12376
|
-
* Replaces:
|
|
12377
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12378
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12379
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12380
|
-
*
|
|
12381
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12382
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12383
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12384
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12385
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12386
|
-
*
|
|
12387
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12388
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12389
|
-
*/
|
|
12390
12516
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12391
12517
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12392
12518
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12755,7 +12881,7 @@ method(object({
|
|
|
12755
12881
|
* it answers today and the caller filters as it already does.
|
|
12756
12882
|
*/
|
|
12757
12883
|
deviceIds: array(number()).optional()
|
|
12758
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12884
|
+
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ parentDeviceIds: array(number()).max(256) }), record(string(), array(DeviceInfoSchema))), method(object({ deviceId: number() }), object({
|
|
12759
12885
|
mode: LinkedDevicesModeSchema,
|
|
12760
12886
|
devices: array(LinkedDeviceSchema)
|
|
12761
12887
|
})), method(object({ deviceIds: array(number()) }), array(LinkedDevicesForDeviceSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
@@ -13479,6 +13605,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13479
13605
|
kind: "mutation",
|
|
13480
13606
|
auth: "admin"
|
|
13481
13607
|
});
|
|
13608
|
+
/**
|
|
13609
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13610
|
+
* through. It stores nothing.
|
|
13611
|
+
*
|
|
13612
|
+
* ## Why a capability at all, and why this shape
|
|
13613
|
+
*
|
|
13614
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13615
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13616
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13617
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13618
|
+
* is assembled from declarations at runtime.
|
|
13619
|
+
*
|
|
13620
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13621
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13622
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13623
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13624
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13625
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13626
|
+
* No new UDS message, no second registry.
|
|
13627
|
+
*
|
|
13628
|
+
* ## What it deliberately does NOT own
|
|
13629
|
+
*
|
|
13630
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13631
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13632
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13633
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13634
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13635
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13636
|
+
* setter for a window and no persistence of any kind.
|
|
13637
|
+
*
|
|
13638
|
+
* ## Why `apply` is here even so
|
|
13639
|
+
*
|
|
13640
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13641
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13642
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13643
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13644
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13645
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13646
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13647
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13648
|
+
*/
|
|
13649
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13650
|
+
var LogChannelApplyResultSchema = object({
|
|
13651
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13652
|
+
armed: number().int().min(0),
|
|
13653
|
+
/**
|
|
13654
|
+
* Names the document armed that this process does not declare. Reported
|
|
13655
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13656
|
+
* not booted, and both deserve a line instead of silence.
|
|
13657
|
+
*/
|
|
13658
|
+
unknown: array(string()).readonly()
|
|
13659
|
+
});
|
|
13660
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13482
13661
|
var LogLevelSchema = _enum([
|
|
13483
13662
|
"debug",
|
|
13484
13663
|
"info",
|
|
@@ -29042,10 +29221,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
29042
29221
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
29043
29222
|
* layer that carries an explicit value wins.
|
|
29044
29223
|
*
|
|
29045
|
-
* `component`
|
|
29046
|
-
*
|
|
29047
|
-
*
|
|
29048
|
-
*
|
|
29224
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
29225
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
29226
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
29227
|
+
* that turning it on would not force every consumer of this document to widen
|
|
29228
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
29049
29229
|
*/
|
|
29050
29230
|
var LoggingScopeKindSchema = _enum([
|
|
29051
29231
|
"cluster",
|
|
@@ -29072,6 +29252,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
29072
29252
|
scope: LoggingScopeKindSchema,
|
|
29073
29253
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
29074
29254
|
nodeId: string().nullable(),
|
|
29255
|
+
/**
|
|
29256
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
29257
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
29258
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
29259
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
29260
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
29261
|
+
*/
|
|
29262
|
+
component: string().nullable(),
|
|
29075
29263
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
29076
29264
|
level: LogLevelSchema$1.nullable()
|
|
29077
29265
|
});
|
|
@@ -29113,6 +29301,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
29113
29301
|
reportEveryMs: number().int().positive().optional()
|
|
29114
29302
|
});
|
|
29115
29303
|
/**
|
|
29304
|
+
* A channel ARMED, as the document reports it.
|
|
29305
|
+
*
|
|
29306
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
29307
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
29308
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
29309
|
+
*/
|
|
29310
|
+
var LogChannelWindowStateSchema = object({
|
|
29311
|
+
channel: string(),
|
|
29312
|
+
armed: boolean(),
|
|
29313
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
29314
|
+
armedUntilMs: number(),
|
|
29315
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
29316
|
+
remainingMs: number(),
|
|
29317
|
+
/**
|
|
29318
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
29319
|
+
*
|
|
29320
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
29321
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
29322
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
29323
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
29324
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
29325
|
+
* not.
|
|
29326
|
+
*/
|
|
29327
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
29328
|
+
});
|
|
29329
|
+
/**
|
|
29330
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
29331
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
29332
|
+
*/
|
|
29333
|
+
var LogChannelWindowPatchSchema = object({
|
|
29334
|
+
channel: string().min(1),
|
|
29335
|
+
armMs: number().int().min(0),
|
|
29336
|
+
/**
|
|
29337
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
29338
|
+
*
|
|
29339
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
29340
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
29341
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
29342
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
29343
|
+
*/
|
|
29344
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
29345
|
+
});
|
|
29346
|
+
/**
|
|
29116
29347
|
* A PATCH, and patches MERGE.
|
|
29117
29348
|
*
|
|
29118
29349
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -29131,7 +29362,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
29131
29362
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
29132
29363
|
* keeps running — a patch is never a full replacement.
|
|
29133
29364
|
*/
|
|
29134
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
29365
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
29366
|
+
/**
|
|
29367
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
29368
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
29369
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
29370
|
+
* the Diagnostics page fight over the same value.
|
|
29371
|
+
*/
|
|
29372
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
29135
29373
|
});
|
|
29136
29374
|
/**
|
|
29137
29375
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -29144,9 +29382,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
29144
29382
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
29145
29383
|
* layer selector needs a name the transport does not already own.
|
|
29146
29384
|
*/
|
|
29147
|
-
var GetLoggingSettingsInputSchema = object({
|
|
29385
|
+
var GetLoggingSettingsInputSchema = object({
|
|
29386
|
+
scopeNodeId: string().optional(),
|
|
29387
|
+
/**
|
|
29388
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
29389
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
29390
|
+
*
|
|
29391
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
29392
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
29393
|
+
* not, and one selector for both would make "which of these two did I just
|
|
29394
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
29395
|
+
*/
|
|
29396
|
+
scopeComponent: string().optional()
|
|
29397
|
+
});
|
|
29148
29398
|
var SetLoggingSettingsInputSchema = object({
|
|
29149
29399
|
scopeNodeId: string().optional(),
|
|
29400
|
+
scopeComponent: string().optional(),
|
|
29150
29401
|
patch: LoggingSettingsPatchSchema
|
|
29151
29402
|
});
|
|
29152
29403
|
/**
|
|
@@ -29161,9 +29412,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
29161
29412
|
var LoggingSettingsStateSchema = object({
|
|
29162
29413
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
29163
29414
|
scopeNodeId: string().nullable(),
|
|
29415
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
29416
|
+
scopeComponent: string().nullable(),
|
|
29164
29417
|
effective: LoggingEffectiveSchema,
|
|
29165
29418
|
explicit: LoggingExplicitSchema,
|
|
29166
29419
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
29420
|
+
/**
|
|
29421
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
29422
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
29423
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
29424
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
29425
|
+
*/
|
|
29426
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
29427
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
29428
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
29167
29429
|
persisted: boolean()
|
|
29168
29430
|
});
|
|
29169
29431
|
method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), method(_void(), FeatureManifestSchema), method(_void(), array(NetworkAddressSchema).readonly()), method(_void(), unknown().nullable(), { auth: "admin" }), method(record(string(), unknown()), _null(), {
|
|
@@ -32148,6 +32410,12 @@ Object.freeze({
|
|
|
32148
32410
|
addonId: null,
|
|
32149
32411
|
access: "view"
|
|
32150
32412
|
},
|
|
32413
|
+
"dataStoreProvider.aggregate": {
|
|
32414
|
+
capName: "data-store-provider",
|
|
32415
|
+
capScope: "system",
|
|
32416
|
+
addonId: null,
|
|
32417
|
+
access: "view"
|
|
32418
|
+
},
|
|
32151
32419
|
"dataStoreProvider.count": {
|
|
32152
32420
|
capName: "data-store-provider",
|
|
32153
32421
|
capScope: "system",
|
|
@@ -32562,6 +32830,12 @@ Object.freeze({
|
|
|
32562
32830
|
addonId: null,
|
|
32563
32831
|
access: "view"
|
|
32564
32832
|
},
|
|
32833
|
+
"deviceManager.getChildrenBatch": {
|
|
32834
|
+
capName: "device-manager",
|
|
32835
|
+
capScope: "system",
|
|
32836
|
+
addonId: null,
|
|
32837
|
+
access: "view"
|
|
32838
|
+
},
|
|
32565
32839
|
"deviceManager.getConfigSchema": {
|
|
32566
32840
|
capName: "device-manager",
|
|
32567
32841
|
capScope: "system",
|
|
@@ -33612,6 +33886,18 @@ Object.freeze({
|
|
|
33612
33886
|
addonId: null,
|
|
33613
33887
|
access: "create"
|
|
33614
33888
|
},
|
|
33889
|
+
"logChannels.apply": {
|
|
33890
|
+
capName: "log-channels",
|
|
33891
|
+
capScope: "system",
|
|
33892
|
+
addonId: null,
|
|
33893
|
+
access: "create"
|
|
33894
|
+
},
|
|
33895
|
+
"logChannels.list": {
|
|
33896
|
+
capName: "log-channels",
|
|
33897
|
+
capScope: "system",
|
|
33898
|
+
addonId: null,
|
|
33899
|
+
access: "view"
|
|
33900
|
+
},
|
|
33615
33901
|
"logDestination.query": {
|
|
33616
33902
|
capName: "log-destination",
|
|
33617
33903
|
capScope: "system",
|
|
@@ -35766,6 +36052,12 @@ Object.freeze({
|
|
|
35766
36052
|
addonId: null,
|
|
35767
36053
|
access: "create"
|
|
35768
36054
|
},
|
|
36055
|
+
"settingsStore.aggregate": {
|
|
36056
|
+
capName: "settings-store",
|
|
36057
|
+
capScope: "system",
|
|
36058
|
+
addonId: null,
|
|
36059
|
+
access: "view"
|
|
36060
|
+
},
|
|
35769
36061
|
"settingsStore.count": {
|
|
35770
36062
|
capName: "settings-store",
|
|
35771
36063
|
capScope: "system",
|
|
@@ -37345,6 +37637,11 @@ Object.freeze({
|
|
|
37345
37637
|
form: "single",
|
|
37346
37638
|
optional: false
|
|
37347
37639
|
}],
|
|
37640
|
+
"deviceManager.getChildrenBatch": [{
|
|
37641
|
+
name: "parentDeviceIds",
|
|
37642
|
+
form: "array",
|
|
37643
|
+
optional: false
|
|
37644
|
+
}],
|
|
37348
37645
|
"deviceManager.getConfigSchema": [{
|
|
37349
37646
|
name: "deviceId",
|
|
37350
37647
|
form: "single",
|
|
@@ -7671,6 +7671,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7671
7671
|
fetchedAt: number()
|
|
7672
7672
|
});
|
|
7673
7673
|
/**
|
|
7674
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7675
|
+
* an addon declares its channels in.
|
|
7676
|
+
*
|
|
7677
|
+
* ## Two axes, deliberately separated
|
|
7678
|
+
*
|
|
7679
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7680
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7681
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7682
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7683
|
+
* `log-channels` capability enumerates the declarations.
|
|
7684
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7685
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7686
|
+
* over the values is the exact defect
|
|
7687
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7688
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7689
|
+
*
|
|
7690
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7691
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7692
|
+
* the hot path with a value somebody actually read, and by
|
|
7693
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7694
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7695
|
+
* disarmed one (D49).
|
|
7696
|
+
*
|
|
7697
|
+
* ## The canonical call shape
|
|
7698
|
+
*
|
|
7699
|
+
* ```ts
|
|
7700
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7701
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7702
|
+
* }
|
|
7703
|
+
* ```
|
|
7704
|
+
*
|
|
7705
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7706
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7707
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7708
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7709
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7710
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7711
|
+
*
|
|
7712
|
+
* ## Why a channel emits at `info`
|
|
7713
|
+
*
|
|
7714
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7715
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7716
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7717
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7718
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7719
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7720
|
+
*/
|
|
7721
|
+
/**
|
|
7722
|
+
* The level a channel writes at once armed.
|
|
7723
|
+
*
|
|
7724
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7725
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7726
|
+
* to read it later.
|
|
7727
|
+
*/
|
|
7728
|
+
var LogChannelLevelSchema = _enum([
|
|
7729
|
+
"info",
|
|
7730
|
+
"warn",
|
|
7731
|
+
"error"
|
|
7732
|
+
]);
|
|
7733
|
+
/**
|
|
7734
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7735
|
+
* declaration is inert.
|
|
7736
|
+
*/
|
|
7737
|
+
var LogChannelDescriptorSchema = object({
|
|
7738
|
+
/**
|
|
7739
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7740
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7741
|
+
* owns it without a second lookup.
|
|
7742
|
+
*/
|
|
7743
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7744
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7745
|
+
description: string().min(1),
|
|
7746
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7747
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7748
|
+
/**
|
|
7749
|
+
* Whether this channel can be narrowed to a camera.
|
|
7750
|
+
*
|
|
7751
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7752
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7753
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7754
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7755
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7756
|
+
* the body is the only way to filter.
|
|
7757
|
+
*
|
|
7758
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7759
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7760
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7761
|
+
* path was never taken.
|
|
7762
|
+
*/
|
|
7763
|
+
perDevice: boolean()
|
|
7764
|
+
});
|
|
7765
|
+
/**
|
|
7766
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7767
|
+
*
|
|
7768
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7769
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7770
|
+
*/
|
|
7771
|
+
var LogChannelWindowSchema = object({
|
|
7772
|
+
channel: string().min(1),
|
|
7773
|
+
/** Epoch ms the window closes at. */
|
|
7774
|
+
armedUntilMs: number(),
|
|
7775
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7776
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7777
|
+
});
|
|
7778
|
+
/**
|
|
7674
7779
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7675
7780
|
* recordings and events management surfaces.
|
|
7676
7781
|
*
|
|
@@ -11359,6 +11464,35 @@ var MutationFilterSchema = object({
|
|
|
11359
11464
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11360
11465
|
whereNot: record(string(), unknown()).optional()
|
|
11361
11466
|
});
|
|
11467
|
+
/**
|
|
11468
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11469
|
+
*
|
|
11470
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11471
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11472
|
+
* a `Record<column, op>` shape could not express.
|
|
11473
|
+
*/
|
|
11474
|
+
var AggregateFieldSchema = object({
|
|
11475
|
+
/** Result key. */
|
|
11476
|
+
as: string().min(1),
|
|
11477
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11478
|
+
field: string().min(1),
|
|
11479
|
+
op: _enum([
|
|
11480
|
+
"sum",
|
|
11481
|
+
"min",
|
|
11482
|
+
"max"
|
|
11483
|
+
])
|
|
11484
|
+
});
|
|
11485
|
+
/**
|
|
11486
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11487
|
+
*
|
|
11488
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11489
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11490
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11491
|
+
*/
|
|
11492
|
+
var AggregateResultSchema = object({
|
|
11493
|
+
count: number().int(),
|
|
11494
|
+
values: record(string(), number().nullable())
|
|
11495
|
+
});
|
|
11362
11496
|
/** A single stored record: `{ id, data }`. */
|
|
11363
11497
|
var SettingsRecordSchema = object({
|
|
11364
11498
|
id: string(),
|
|
@@ -11443,6 +11577,11 @@ method(object({
|
|
|
11443
11577
|
collection: string(),
|
|
11444
11578
|
filter: QueryFilterSchema.optional()
|
|
11445
11579
|
}), number()), method(object({
|
|
11580
|
+
namespace: string().optional(),
|
|
11581
|
+
collection: string(),
|
|
11582
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11583
|
+
filter: QueryFilterSchema.optional()
|
|
11584
|
+
}), AggregateResultSchema), method(object({
|
|
11446
11585
|
namespace: string().optional(),
|
|
11447
11586
|
collection: string(),
|
|
11448
11587
|
field: string(),
|
|
@@ -11559,6 +11698,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11559
11698
|
collection: string(),
|
|
11560
11699
|
filter: QueryFilterSchema.optional()
|
|
11561
11700
|
}), number(), { auth: "admin" }), method(object({
|
|
11701
|
+
namespace: string().optional(),
|
|
11702
|
+
collection: string(),
|
|
11703
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11704
|
+
filter: QueryFilterSchema.optional()
|
|
11705
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11562
11706
|
namespace: string().optional(),
|
|
11563
11707
|
collection: string(),
|
|
11564
11708
|
field: string(),
|
|
@@ -12369,24 +12513,6 @@ var deviceProviderCapability = {
|
|
|
12369
12513
|
})
|
|
12370
12514
|
}
|
|
12371
12515
|
};
|
|
12372
|
-
/**
|
|
12373
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12374
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12375
|
-
*
|
|
12376
|
-
* Replaces:
|
|
12377
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12378
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12379
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12380
|
-
*
|
|
12381
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12382
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12383
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12384
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12385
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12386
|
-
*
|
|
12387
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12388
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12389
|
-
*/
|
|
12390
12516
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12391
12517
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12392
12518
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12755,7 +12881,7 @@ method(object({
|
|
|
12755
12881
|
* it answers today and the caller filters as it already does.
|
|
12756
12882
|
*/
|
|
12757
12883
|
deviceIds: array(number()).optional()
|
|
12758
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12884
|
+
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ parentDeviceIds: array(number()).max(256) }), record(string(), array(DeviceInfoSchema))), method(object({ deviceId: number() }), object({
|
|
12759
12885
|
mode: LinkedDevicesModeSchema,
|
|
12760
12886
|
devices: array(LinkedDeviceSchema)
|
|
12761
12887
|
})), method(object({ deviceIds: array(number()) }), array(LinkedDevicesForDeviceSchema)), method(object({ deviceId: number() }), array(StreamSourceEntrySchema$1)), method(object({ deviceId: number() }), array(ConfigEntrySchema)), method(object({ deviceId: number() }), ConfigUISchemaOutput), method(object({
|
|
@@ -13479,6 +13605,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13479
13605
|
kind: "mutation",
|
|
13480
13606
|
auth: "admin"
|
|
13481
13607
|
});
|
|
13608
|
+
/**
|
|
13609
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13610
|
+
* through. It stores nothing.
|
|
13611
|
+
*
|
|
13612
|
+
* ## Why a capability at all, and why this shape
|
|
13613
|
+
*
|
|
13614
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13615
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13616
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13617
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13618
|
+
* is assembled from declarations at runtime.
|
|
13619
|
+
*
|
|
13620
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13621
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13622
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13623
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13624
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13625
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13626
|
+
* No new UDS message, no second registry.
|
|
13627
|
+
*
|
|
13628
|
+
* ## What it deliberately does NOT own
|
|
13629
|
+
*
|
|
13630
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13631
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13632
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13633
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13634
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13635
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13636
|
+
* setter for a window and no persistence of any kind.
|
|
13637
|
+
*
|
|
13638
|
+
* ## Why `apply` is here even so
|
|
13639
|
+
*
|
|
13640
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13641
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13642
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13643
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13644
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13645
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13646
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13647
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13648
|
+
*/
|
|
13649
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13650
|
+
var LogChannelApplyResultSchema = object({
|
|
13651
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13652
|
+
armed: number().int().min(0),
|
|
13653
|
+
/**
|
|
13654
|
+
* Names the document armed that this process does not declare. Reported
|
|
13655
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13656
|
+
* not booted, and both deserve a line instead of silence.
|
|
13657
|
+
*/
|
|
13658
|
+
unknown: array(string()).readonly()
|
|
13659
|
+
});
|
|
13660
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13482
13661
|
var LogLevelSchema = _enum([
|
|
13483
13662
|
"debug",
|
|
13484
13663
|
"info",
|
|
@@ -29042,10 +29221,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
29042
29221
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
29043
29222
|
* layer that carries an explicit value wins.
|
|
29044
29223
|
*
|
|
29045
|
-
* `component`
|
|
29046
|
-
*
|
|
29047
|
-
*
|
|
29048
|
-
*
|
|
29224
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
29225
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
29226
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
29227
|
+
* that turning it on would not force every consumer of this document to widen
|
|
29228
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
29049
29229
|
*/
|
|
29050
29230
|
var LoggingScopeKindSchema = _enum([
|
|
29051
29231
|
"cluster",
|
|
@@ -29072,6 +29252,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
29072
29252
|
scope: LoggingScopeKindSchema,
|
|
29073
29253
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
29074
29254
|
nodeId: string().nullable(),
|
|
29255
|
+
/**
|
|
29256
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
29257
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
29258
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
29259
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
29260
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
29261
|
+
*/
|
|
29262
|
+
component: string().nullable(),
|
|
29075
29263
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
29076
29264
|
level: LogLevelSchema$1.nullable()
|
|
29077
29265
|
});
|
|
@@ -29113,6 +29301,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
29113
29301
|
reportEveryMs: number().int().positive().optional()
|
|
29114
29302
|
});
|
|
29115
29303
|
/**
|
|
29304
|
+
* A channel ARMED, as the document reports it.
|
|
29305
|
+
*
|
|
29306
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
29307
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
29308
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
29309
|
+
*/
|
|
29310
|
+
var LogChannelWindowStateSchema = object({
|
|
29311
|
+
channel: string(),
|
|
29312
|
+
armed: boolean(),
|
|
29313
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
29314
|
+
armedUntilMs: number(),
|
|
29315
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
29316
|
+
remainingMs: number(),
|
|
29317
|
+
/**
|
|
29318
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
29319
|
+
*
|
|
29320
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
29321
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
29322
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
29323
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
29324
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
29325
|
+
* not.
|
|
29326
|
+
*/
|
|
29327
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
29328
|
+
});
|
|
29329
|
+
/**
|
|
29330
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
29331
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
29332
|
+
*/
|
|
29333
|
+
var LogChannelWindowPatchSchema = object({
|
|
29334
|
+
channel: string().min(1),
|
|
29335
|
+
armMs: number().int().min(0),
|
|
29336
|
+
/**
|
|
29337
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
29338
|
+
*
|
|
29339
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
29340
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
29341
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
29342
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
29343
|
+
*/
|
|
29344
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
29345
|
+
});
|
|
29346
|
+
/**
|
|
29116
29347
|
* A PATCH, and patches MERGE.
|
|
29117
29348
|
*
|
|
29118
29349
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -29131,7 +29362,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
29131
29362
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
29132
29363
|
* keeps running — a patch is never a full replacement.
|
|
29133
29364
|
*/
|
|
29134
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
29365
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
29366
|
+
/**
|
|
29367
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
29368
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
29369
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
29370
|
+
* the Diagnostics page fight over the same value.
|
|
29371
|
+
*/
|
|
29372
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
29135
29373
|
});
|
|
29136
29374
|
/**
|
|
29137
29375
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -29144,9 +29382,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
29144
29382
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
29145
29383
|
* layer selector needs a name the transport does not already own.
|
|
29146
29384
|
*/
|
|
29147
|
-
var GetLoggingSettingsInputSchema = object({
|
|
29385
|
+
var GetLoggingSettingsInputSchema = object({
|
|
29386
|
+
scopeNodeId: string().optional(),
|
|
29387
|
+
/**
|
|
29388
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
29389
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
29390
|
+
*
|
|
29391
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
29392
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
29393
|
+
* not, and one selector for both would make "which of these two did I just
|
|
29394
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
29395
|
+
*/
|
|
29396
|
+
scopeComponent: string().optional()
|
|
29397
|
+
});
|
|
29148
29398
|
var SetLoggingSettingsInputSchema = object({
|
|
29149
29399
|
scopeNodeId: string().optional(),
|
|
29400
|
+
scopeComponent: string().optional(),
|
|
29150
29401
|
patch: LoggingSettingsPatchSchema
|
|
29151
29402
|
});
|
|
29152
29403
|
/**
|
|
@@ -29161,9 +29412,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
29161
29412
|
var LoggingSettingsStateSchema = object({
|
|
29162
29413
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
29163
29414
|
scopeNodeId: string().nullable(),
|
|
29415
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
29416
|
+
scopeComponent: string().nullable(),
|
|
29164
29417
|
effective: LoggingEffectiveSchema,
|
|
29165
29418
|
explicit: LoggingExplicitSchema,
|
|
29166
29419
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
29420
|
+
/**
|
|
29421
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
29422
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
29423
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
29424
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
29425
|
+
*/
|
|
29426
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
29427
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
29428
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
29167
29429
|
persisted: boolean()
|
|
29168
29430
|
});
|
|
29169
29431
|
method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), method(_void(), FeatureManifestSchema), method(_void(), array(NetworkAddressSchema).readonly()), method(_void(), unknown().nullable(), { auth: "admin" }), method(record(string(), unknown()), _null(), {
|
|
@@ -32148,6 +32410,12 @@ Object.freeze({
|
|
|
32148
32410
|
addonId: null,
|
|
32149
32411
|
access: "view"
|
|
32150
32412
|
},
|
|
32413
|
+
"dataStoreProvider.aggregate": {
|
|
32414
|
+
capName: "data-store-provider",
|
|
32415
|
+
capScope: "system",
|
|
32416
|
+
addonId: null,
|
|
32417
|
+
access: "view"
|
|
32418
|
+
},
|
|
32151
32419
|
"dataStoreProvider.count": {
|
|
32152
32420
|
capName: "data-store-provider",
|
|
32153
32421
|
capScope: "system",
|
|
@@ -32562,6 +32830,12 @@ Object.freeze({
|
|
|
32562
32830
|
addonId: null,
|
|
32563
32831
|
access: "view"
|
|
32564
32832
|
},
|
|
32833
|
+
"deviceManager.getChildrenBatch": {
|
|
32834
|
+
capName: "device-manager",
|
|
32835
|
+
capScope: "system",
|
|
32836
|
+
addonId: null,
|
|
32837
|
+
access: "view"
|
|
32838
|
+
},
|
|
32565
32839
|
"deviceManager.getConfigSchema": {
|
|
32566
32840
|
capName: "device-manager",
|
|
32567
32841
|
capScope: "system",
|
|
@@ -33612,6 +33886,18 @@ Object.freeze({
|
|
|
33612
33886
|
addonId: null,
|
|
33613
33887
|
access: "create"
|
|
33614
33888
|
},
|
|
33889
|
+
"logChannels.apply": {
|
|
33890
|
+
capName: "log-channels",
|
|
33891
|
+
capScope: "system",
|
|
33892
|
+
addonId: null,
|
|
33893
|
+
access: "create"
|
|
33894
|
+
},
|
|
33895
|
+
"logChannels.list": {
|
|
33896
|
+
capName: "log-channels",
|
|
33897
|
+
capScope: "system",
|
|
33898
|
+
addonId: null,
|
|
33899
|
+
access: "view"
|
|
33900
|
+
},
|
|
33615
33901
|
"logDestination.query": {
|
|
33616
33902
|
capName: "log-destination",
|
|
33617
33903
|
capScope: "system",
|
|
@@ -35766,6 +36052,12 @@ Object.freeze({
|
|
|
35766
36052
|
addonId: null,
|
|
35767
36053
|
access: "create"
|
|
35768
36054
|
},
|
|
36055
|
+
"settingsStore.aggregate": {
|
|
36056
|
+
capName: "settings-store",
|
|
36057
|
+
capScope: "system",
|
|
36058
|
+
addonId: null,
|
|
36059
|
+
access: "view"
|
|
36060
|
+
},
|
|
35769
36061
|
"settingsStore.count": {
|
|
35770
36062
|
capName: "settings-store",
|
|
35771
36063
|
capScope: "system",
|
|
@@ -37345,6 +37637,11 @@ Object.freeze({
|
|
|
37345
37637
|
form: "single",
|
|
37346
37638
|
optional: false
|
|
37347
37639
|
}],
|
|
37640
|
+
"deviceManager.getChildrenBatch": [{
|
|
37641
|
+
name: "parentDeviceIds",
|
|
37642
|
+
form: "array",
|
|
37643
|
+
optional: false
|
|
37644
|
+
}],
|
|
37348
37645
|
"deviceManager.getConfigSchema": [{
|
|
37349
37646
|
name: "deviceId",
|
|
37350
37647
|
form: "single",
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
//#endregion
|
|
6
|
-
const require_dist = require("../dist-
|
|
6
|
+
const require_dist = require("../dist-D_G71rhM.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
//#region src/ha-export/topics.ts
|
|
9
9
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-
|
|
1
|
+
import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-DlrKePv3.mjs";
|
|
2
2
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
3
3
|
//#region src/ha-export/topics.ts
|
|
4
4
|
/**
|