@camstack/addon-export-hap 1.2.44 → 1.2.45
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/hap-export.addon.js +322 -25
- package/dist/hap-export.addon.mjs +322 -25
- package/package.json +1 -1
package/dist/hap-export.addon.js
CHANGED
|
@@ -8134,6 +8134,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
8134
8134
|
fetchedAt: number()
|
|
8135
8135
|
});
|
|
8136
8136
|
/**
|
|
8137
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8138
|
+
* an addon declares its channels in.
|
|
8139
|
+
*
|
|
8140
|
+
* ## Two axes, deliberately separated
|
|
8141
|
+
*
|
|
8142
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8143
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8144
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8145
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8146
|
+
* `log-channels` capability enumerates the declarations.
|
|
8147
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8148
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8149
|
+
* over the values is the exact defect
|
|
8150
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8151
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
8152
|
+
*
|
|
8153
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8154
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8155
|
+
* the hot path with a value somebody actually read, and by
|
|
8156
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8157
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8158
|
+
* disarmed one (D49).
|
|
8159
|
+
*
|
|
8160
|
+
* ## The canonical call shape
|
|
8161
|
+
*
|
|
8162
|
+
* ```ts
|
|
8163
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8164
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8165
|
+
* }
|
|
8166
|
+
* ```
|
|
8167
|
+
*
|
|
8168
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8169
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8170
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
8171
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8172
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8173
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
8174
|
+
*
|
|
8175
|
+
* ## Why a channel emits at `info`
|
|
8176
|
+
*
|
|
8177
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8178
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8179
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8180
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8181
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8182
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8183
|
+
*/
|
|
8184
|
+
/**
|
|
8185
|
+
* The level a channel writes at once armed.
|
|
8186
|
+
*
|
|
8187
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8188
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8189
|
+
* to read it later.
|
|
8190
|
+
*/
|
|
8191
|
+
var LogChannelLevelSchema = _enum([
|
|
8192
|
+
"info",
|
|
8193
|
+
"warn",
|
|
8194
|
+
"error"
|
|
8195
|
+
]);
|
|
8196
|
+
/**
|
|
8197
|
+
* What an addon declares about one channel. No value, no state — a
|
|
8198
|
+
* declaration is inert.
|
|
8199
|
+
*/
|
|
8200
|
+
var LogChannelDescriptorSchema = object({
|
|
8201
|
+
/**
|
|
8202
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8203
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
8204
|
+
* owns it without a second lookup.
|
|
8205
|
+
*/
|
|
8206
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8207
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
8208
|
+
description: string().min(1),
|
|
8209
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
8210
|
+
defaultLevel: LogChannelLevelSchema,
|
|
8211
|
+
/**
|
|
8212
|
+
* Whether this channel can be narrowed to a camera.
|
|
8213
|
+
*
|
|
8214
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8215
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
8216
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8217
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8218
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8219
|
+
* the body is the only way to filter.
|
|
8220
|
+
*
|
|
8221
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8222
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8223
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8224
|
+
* path was never taken.
|
|
8225
|
+
*/
|
|
8226
|
+
perDevice: boolean()
|
|
8227
|
+
});
|
|
8228
|
+
/**
|
|
8229
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
8230
|
+
*
|
|
8231
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8232
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8233
|
+
*/
|
|
8234
|
+
var LogChannelWindowSchema = object({
|
|
8235
|
+
channel: string().min(1),
|
|
8236
|
+
/** Epoch ms the window closes at. */
|
|
8237
|
+
armedUntilMs: number(),
|
|
8238
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
8239
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
8240
|
+
});
|
|
8241
|
+
/**
|
|
8137
8242
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
8138
8243
|
* recordings and events management surfaces.
|
|
8139
8244
|
*
|
|
@@ -11706,6 +11811,35 @@ var MutationFilterSchema = object({
|
|
|
11706
11811
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11707
11812
|
whereNot: record(string(), unknown()).optional()
|
|
11708
11813
|
});
|
|
11814
|
+
/**
|
|
11815
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11816
|
+
*
|
|
11817
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11818
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11819
|
+
* a `Record<column, op>` shape could not express.
|
|
11820
|
+
*/
|
|
11821
|
+
var AggregateFieldSchema = object({
|
|
11822
|
+
/** Result key. */
|
|
11823
|
+
as: string().min(1),
|
|
11824
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11825
|
+
field: string().min(1),
|
|
11826
|
+
op: _enum([
|
|
11827
|
+
"sum",
|
|
11828
|
+
"min",
|
|
11829
|
+
"max"
|
|
11830
|
+
])
|
|
11831
|
+
});
|
|
11832
|
+
/**
|
|
11833
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11834
|
+
*
|
|
11835
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11836
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11837
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11838
|
+
*/
|
|
11839
|
+
var AggregateResultSchema = object({
|
|
11840
|
+
count: number().int(),
|
|
11841
|
+
values: record(string(), number().nullable())
|
|
11842
|
+
});
|
|
11709
11843
|
/** A single stored record: `{ id, data }`. */
|
|
11710
11844
|
var SettingsRecordSchema = object({
|
|
11711
11845
|
id: string(),
|
|
@@ -11790,6 +11924,11 @@ method(object({
|
|
|
11790
11924
|
collection: string(),
|
|
11791
11925
|
filter: QueryFilterSchema.optional()
|
|
11792
11926
|
}), number()), method(object({
|
|
11927
|
+
namespace: string().optional(),
|
|
11928
|
+
collection: string(),
|
|
11929
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11930
|
+
filter: QueryFilterSchema.optional()
|
|
11931
|
+
}), AggregateResultSchema), method(object({
|
|
11793
11932
|
namespace: string().optional(),
|
|
11794
11933
|
collection: string(),
|
|
11795
11934
|
field: string(),
|
|
@@ -11906,6 +12045,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11906
12045
|
collection: string(),
|
|
11907
12046
|
filter: QueryFilterSchema.optional()
|
|
11908
12047
|
}), number(), { auth: "admin" }), method(object({
|
|
12048
|
+
namespace: string().optional(),
|
|
12049
|
+
collection: string(),
|
|
12050
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
12051
|
+
filter: QueryFilterSchema.optional()
|
|
12052
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11909
12053
|
namespace: string().optional(),
|
|
11910
12054
|
collection: string(),
|
|
11911
12055
|
field: string(),
|
|
@@ -12548,24 +12692,6 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
|
|
|
12548
12692
|
kind: "mutation",
|
|
12549
12693
|
auth: "admin"
|
|
12550
12694
|
});
|
|
12551
|
-
/**
|
|
12552
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12553
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12554
|
-
*
|
|
12555
|
-
* Replaces:
|
|
12556
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12557
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12558
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12559
|
-
*
|
|
12560
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12561
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12562
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12563
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12564
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12565
|
-
*
|
|
12566
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12567
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12568
|
-
*/
|
|
12569
12695
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12570
12696
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12571
12697
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12934,7 +13060,7 @@ method(object({
|
|
|
12934
13060
|
* it answers today and the caller filters as it already does.
|
|
12935
13061
|
*/
|
|
12936
13062
|
deviceIds: array(number()).optional()
|
|
12937
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
13063
|
+
}), 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({
|
|
12938
13064
|
mode: LinkedDevicesModeSchema,
|
|
12939
13065
|
devices: array(LinkedDeviceSchema)
|
|
12940
13066
|
})), 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({
|
|
@@ -13658,6 +13784,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13658
13784
|
kind: "mutation",
|
|
13659
13785
|
auth: "admin"
|
|
13660
13786
|
});
|
|
13787
|
+
/**
|
|
13788
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13789
|
+
* through. It stores nothing.
|
|
13790
|
+
*
|
|
13791
|
+
* ## Why a capability at all, and why this shape
|
|
13792
|
+
*
|
|
13793
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13794
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13795
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13796
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13797
|
+
* is assembled from declarations at runtime.
|
|
13798
|
+
*
|
|
13799
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13800
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13801
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13802
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13803
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13804
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13805
|
+
* No new UDS message, no second registry.
|
|
13806
|
+
*
|
|
13807
|
+
* ## What it deliberately does NOT own
|
|
13808
|
+
*
|
|
13809
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13810
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13811
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13812
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13813
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13814
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13815
|
+
* setter for a window and no persistence of any kind.
|
|
13816
|
+
*
|
|
13817
|
+
* ## Why `apply` is here even so
|
|
13818
|
+
*
|
|
13819
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13820
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13821
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13822
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13823
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13824
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13825
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13826
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13827
|
+
*/
|
|
13828
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13829
|
+
var LogChannelApplyResultSchema = object({
|
|
13830
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13831
|
+
armed: number().int().min(0),
|
|
13832
|
+
/**
|
|
13833
|
+
* Names the document armed that this process does not declare. Reported
|
|
13834
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13835
|
+
* not booted, and both deserve a line instead of silence.
|
|
13836
|
+
*/
|
|
13837
|
+
unknown: array(string()).readonly()
|
|
13838
|
+
});
|
|
13839
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13661
13840
|
var LogLevelSchema = _enum([
|
|
13662
13841
|
"debug",
|
|
13663
13842
|
"info",
|
|
@@ -27132,10 +27311,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
27132
27311
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
27133
27312
|
* layer that carries an explicit value wins.
|
|
27134
27313
|
*
|
|
27135
|
-
* `component`
|
|
27136
|
-
*
|
|
27137
|
-
*
|
|
27138
|
-
*
|
|
27314
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
27315
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
27316
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
27317
|
+
* that turning it on would not force every consumer of this document to widen
|
|
27318
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
27139
27319
|
*/
|
|
27140
27320
|
var LoggingScopeKindSchema = _enum([
|
|
27141
27321
|
"cluster",
|
|
@@ -27162,6 +27342,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
27162
27342
|
scope: LoggingScopeKindSchema,
|
|
27163
27343
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
27164
27344
|
nodeId: string().nullable(),
|
|
27345
|
+
/**
|
|
27346
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
27347
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
27348
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
27349
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
27350
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
27351
|
+
*/
|
|
27352
|
+
component: string().nullable(),
|
|
27165
27353
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
27166
27354
|
level: LogLevelSchema$1.nullable()
|
|
27167
27355
|
});
|
|
@@ -27203,6 +27391,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
27203
27391
|
reportEveryMs: number().int().positive().optional()
|
|
27204
27392
|
});
|
|
27205
27393
|
/**
|
|
27394
|
+
* A channel ARMED, as the document reports it.
|
|
27395
|
+
*
|
|
27396
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
27397
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
27398
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
27399
|
+
*/
|
|
27400
|
+
var LogChannelWindowStateSchema = object({
|
|
27401
|
+
channel: string(),
|
|
27402
|
+
armed: boolean(),
|
|
27403
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
27404
|
+
armedUntilMs: number(),
|
|
27405
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
27406
|
+
remainingMs: number(),
|
|
27407
|
+
/**
|
|
27408
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
27409
|
+
*
|
|
27410
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
27411
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
27412
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
27413
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
27414
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
27415
|
+
* not.
|
|
27416
|
+
*/
|
|
27417
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
27418
|
+
});
|
|
27419
|
+
/**
|
|
27420
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
27421
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
27422
|
+
*/
|
|
27423
|
+
var LogChannelWindowPatchSchema = object({
|
|
27424
|
+
channel: string().min(1),
|
|
27425
|
+
armMs: number().int().min(0),
|
|
27426
|
+
/**
|
|
27427
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
27428
|
+
*
|
|
27429
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
27430
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
27431
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
27432
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
27433
|
+
*/
|
|
27434
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
27435
|
+
});
|
|
27436
|
+
/**
|
|
27206
27437
|
* A PATCH, and patches MERGE.
|
|
27207
27438
|
*
|
|
27208
27439
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -27221,7 +27452,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
27221
27452
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
27222
27453
|
* keeps running — a patch is never a full replacement.
|
|
27223
27454
|
*/
|
|
27224
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
27455
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
27456
|
+
/**
|
|
27457
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
27458
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
27459
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
27460
|
+
* the Diagnostics page fight over the same value.
|
|
27461
|
+
*/
|
|
27462
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
27225
27463
|
});
|
|
27226
27464
|
/**
|
|
27227
27465
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -27234,9 +27472,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
27234
27472
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
27235
27473
|
* layer selector needs a name the transport does not already own.
|
|
27236
27474
|
*/
|
|
27237
|
-
var GetLoggingSettingsInputSchema = object({
|
|
27475
|
+
var GetLoggingSettingsInputSchema = object({
|
|
27476
|
+
scopeNodeId: string().optional(),
|
|
27477
|
+
/**
|
|
27478
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
27479
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
27480
|
+
*
|
|
27481
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
27482
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
27483
|
+
* not, and one selector for both would make "which of these two did I just
|
|
27484
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
27485
|
+
*/
|
|
27486
|
+
scopeComponent: string().optional()
|
|
27487
|
+
});
|
|
27238
27488
|
var SetLoggingSettingsInputSchema = object({
|
|
27239
27489
|
scopeNodeId: string().optional(),
|
|
27490
|
+
scopeComponent: string().optional(),
|
|
27240
27491
|
patch: LoggingSettingsPatchSchema
|
|
27241
27492
|
});
|
|
27242
27493
|
/**
|
|
@@ -27251,9 +27502,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
27251
27502
|
var LoggingSettingsStateSchema = object({
|
|
27252
27503
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
27253
27504
|
scopeNodeId: string().nullable(),
|
|
27505
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
27506
|
+
scopeComponent: string().nullable(),
|
|
27254
27507
|
effective: LoggingEffectiveSchema,
|
|
27255
27508
|
explicit: LoggingExplicitSchema,
|
|
27256
27509
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
27510
|
+
/**
|
|
27511
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
27512
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
27513
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
27514
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
27515
|
+
*/
|
|
27516
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
27517
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
27518
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
27257
27519
|
persisted: boolean()
|
|
27258
27520
|
});
|
|
27259
27521
|
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(), {
|
|
@@ -28846,6 +29108,12 @@ Object.freeze({
|
|
|
28846
29108
|
addonId: null,
|
|
28847
29109
|
access: "view"
|
|
28848
29110
|
},
|
|
29111
|
+
"dataStoreProvider.aggregate": {
|
|
29112
|
+
capName: "data-store-provider",
|
|
29113
|
+
capScope: "system",
|
|
29114
|
+
addonId: null,
|
|
29115
|
+
access: "view"
|
|
29116
|
+
},
|
|
28849
29117
|
"dataStoreProvider.count": {
|
|
28850
29118
|
capName: "data-store-provider",
|
|
28851
29119
|
capScope: "system",
|
|
@@ -29260,6 +29528,12 @@ Object.freeze({
|
|
|
29260
29528
|
addonId: null,
|
|
29261
29529
|
access: "view"
|
|
29262
29530
|
},
|
|
29531
|
+
"deviceManager.getChildrenBatch": {
|
|
29532
|
+
capName: "device-manager",
|
|
29533
|
+
capScope: "system",
|
|
29534
|
+
addonId: null,
|
|
29535
|
+
access: "view"
|
|
29536
|
+
},
|
|
29263
29537
|
"deviceManager.getConfigSchema": {
|
|
29264
29538
|
capName: "device-manager",
|
|
29265
29539
|
capScope: "system",
|
|
@@ -30310,6 +30584,18 @@ Object.freeze({
|
|
|
30310
30584
|
addonId: null,
|
|
30311
30585
|
access: "create"
|
|
30312
30586
|
},
|
|
30587
|
+
"logChannels.apply": {
|
|
30588
|
+
capName: "log-channels",
|
|
30589
|
+
capScope: "system",
|
|
30590
|
+
addonId: null,
|
|
30591
|
+
access: "create"
|
|
30592
|
+
},
|
|
30593
|
+
"logChannels.list": {
|
|
30594
|
+
capName: "log-channels",
|
|
30595
|
+
capScope: "system",
|
|
30596
|
+
addonId: null,
|
|
30597
|
+
access: "view"
|
|
30598
|
+
},
|
|
30313
30599
|
"logDestination.query": {
|
|
30314
30600
|
capName: "log-destination",
|
|
30315
30601
|
capScope: "system",
|
|
@@ -32464,6 +32750,12 @@ Object.freeze({
|
|
|
32464
32750
|
addonId: null,
|
|
32465
32751
|
access: "create"
|
|
32466
32752
|
},
|
|
32753
|
+
"settingsStore.aggregate": {
|
|
32754
|
+
capName: "settings-store",
|
|
32755
|
+
capScope: "system",
|
|
32756
|
+
addonId: null,
|
|
32757
|
+
access: "view"
|
|
32758
|
+
},
|
|
32467
32759
|
"settingsStore.count": {
|
|
32468
32760
|
capName: "settings-store",
|
|
32469
32761
|
capScope: "system",
|
|
@@ -34043,6 +34335,11 @@ Object.freeze({
|
|
|
34043
34335
|
form: "single",
|
|
34044
34336
|
optional: false
|
|
34045
34337
|
}],
|
|
34338
|
+
"deviceManager.getChildrenBatch": [{
|
|
34339
|
+
name: "parentDeviceIds",
|
|
34340
|
+
form: "array",
|
|
34341
|
+
optional: false
|
|
34342
|
+
}],
|
|
34046
34343
|
"deviceManager.getConfigSchema": [{
|
|
34047
34344
|
name: "deviceId",
|
|
34048
34345
|
form: "single",
|
|
@@ -8122,6 +8122,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
8122
8122
|
fetchedAt: number()
|
|
8123
8123
|
});
|
|
8124
8124
|
/**
|
|
8125
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
8126
|
+
* an addon declares its channels in.
|
|
8127
|
+
*
|
|
8128
|
+
* ## Two axes, deliberately separated
|
|
8129
|
+
*
|
|
8130
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
8131
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
8132
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
8133
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
8134
|
+
* `log-channels` capability enumerates the declarations.
|
|
8135
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
8136
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
8137
|
+
* over the values is the exact defect
|
|
8138
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
8139
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
8140
|
+
*
|
|
8141
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
8142
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
8143
|
+
* the hot path with a value somebody actually read, and by
|
|
8144
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
8145
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
8146
|
+
* disarmed one (D49).
|
|
8147
|
+
*
|
|
8148
|
+
* ## The canonical call shape
|
|
8149
|
+
*
|
|
8150
|
+
* ```ts
|
|
8151
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
8152
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
8153
|
+
* }
|
|
8154
|
+
* ```
|
|
8155
|
+
*
|
|
8156
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
8157
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
8158
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
8159
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
8160
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
8161
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
8162
|
+
*
|
|
8163
|
+
* ## Why a channel emits at `info`
|
|
8164
|
+
*
|
|
8165
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
8166
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
8167
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
8168
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
8169
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
8170
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
8171
|
+
*/
|
|
8172
|
+
/**
|
|
8173
|
+
* The level a channel writes at once armed.
|
|
8174
|
+
*
|
|
8175
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
8176
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
8177
|
+
* to read it later.
|
|
8178
|
+
*/
|
|
8179
|
+
var LogChannelLevelSchema = _enum([
|
|
8180
|
+
"info",
|
|
8181
|
+
"warn",
|
|
8182
|
+
"error"
|
|
8183
|
+
]);
|
|
8184
|
+
/**
|
|
8185
|
+
* What an addon declares about one channel. No value, no state — a
|
|
8186
|
+
* declaration is inert.
|
|
8187
|
+
*/
|
|
8188
|
+
var LogChannelDescriptorSchema = object({
|
|
8189
|
+
/**
|
|
8190
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
8191
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
8192
|
+
* owns it without a second lookup.
|
|
8193
|
+
*/
|
|
8194
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
8195
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
8196
|
+
description: string().min(1),
|
|
8197
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
8198
|
+
defaultLevel: LogChannelLevelSchema,
|
|
8199
|
+
/**
|
|
8200
|
+
* Whether this channel can be narrowed to a camera.
|
|
8201
|
+
*
|
|
8202
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
8203
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
8204
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
8205
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
8206
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
8207
|
+
* the body is the only way to filter.
|
|
8208
|
+
*
|
|
8209
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
8210
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
8211
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
8212
|
+
* path was never taken.
|
|
8213
|
+
*/
|
|
8214
|
+
perDevice: boolean()
|
|
8215
|
+
});
|
|
8216
|
+
/**
|
|
8217
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
8218
|
+
*
|
|
8219
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
8220
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
8221
|
+
*/
|
|
8222
|
+
var LogChannelWindowSchema = object({
|
|
8223
|
+
channel: string().min(1),
|
|
8224
|
+
/** Epoch ms the window closes at. */
|
|
8225
|
+
armedUntilMs: number(),
|
|
8226
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
8227
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
8228
|
+
});
|
|
8229
|
+
/**
|
|
8125
8230
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
8126
8231
|
* recordings and events management surfaces.
|
|
8127
8232
|
*
|
|
@@ -11694,6 +11799,35 @@ var MutationFilterSchema = object({
|
|
|
11694
11799
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11695
11800
|
whereNot: record(string(), unknown()).optional()
|
|
11696
11801
|
});
|
|
11802
|
+
/**
|
|
11803
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11804
|
+
*
|
|
11805
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11806
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11807
|
+
* a `Record<column, op>` shape could not express.
|
|
11808
|
+
*/
|
|
11809
|
+
var AggregateFieldSchema = object({
|
|
11810
|
+
/** Result key. */
|
|
11811
|
+
as: string().min(1),
|
|
11812
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11813
|
+
field: string().min(1),
|
|
11814
|
+
op: _enum([
|
|
11815
|
+
"sum",
|
|
11816
|
+
"min",
|
|
11817
|
+
"max"
|
|
11818
|
+
])
|
|
11819
|
+
});
|
|
11820
|
+
/**
|
|
11821
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11822
|
+
*
|
|
11823
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11824
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11825
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11826
|
+
*/
|
|
11827
|
+
var AggregateResultSchema = object({
|
|
11828
|
+
count: number().int(),
|
|
11829
|
+
values: record(string(), number().nullable())
|
|
11830
|
+
});
|
|
11697
11831
|
/** A single stored record: `{ id, data }`. */
|
|
11698
11832
|
var SettingsRecordSchema = object({
|
|
11699
11833
|
id: string(),
|
|
@@ -11778,6 +11912,11 @@ method(object({
|
|
|
11778
11912
|
collection: string(),
|
|
11779
11913
|
filter: QueryFilterSchema.optional()
|
|
11780
11914
|
}), number()), method(object({
|
|
11915
|
+
namespace: string().optional(),
|
|
11916
|
+
collection: string(),
|
|
11917
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11918
|
+
filter: QueryFilterSchema.optional()
|
|
11919
|
+
}), AggregateResultSchema), method(object({
|
|
11781
11920
|
namespace: string().optional(),
|
|
11782
11921
|
collection: string(),
|
|
11783
11922
|
field: string(),
|
|
@@ -11894,6 +12033,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11894
12033
|
collection: string(),
|
|
11895
12034
|
filter: QueryFilterSchema.optional()
|
|
11896
12035
|
}), number(), { auth: "admin" }), method(object({
|
|
12036
|
+
namespace: string().optional(),
|
|
12037
|
+
collection: string(),
|
|
12038
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
12039
|
+
filter: QueryFilterSchema.optional()
|
|
12040
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11897
12041
|
namespace: string().optional(),
|
|
11898
12042
|
collection: string(),
|
|
11899
12043
|
field: string(),
|
|
@@ -12536,24 +12680,6 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
|
|
|
12536
12680
|
kind: "mutation",
|
|
12537
12681
|
auth: "admin"
|
|
12538
12682
|
});
|
|
12539
|
-
/**
|
|
12540
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12541
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12542
|
-
*
|
|
12543
|
-
* Replaces:
|
|
12544
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12545
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12546
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12547
|
-
*
|
|
12548
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12549
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12550
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12551
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12552
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12553
|
-
*
|
|
12554
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12555
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12556
|
-
*/
|
|
12557
12683
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12558
12684
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12559
12685
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12922,7 +13048,7 @@ method(object({
|
|
|
12922
13048
|
* it answers today and the caller filters as it already does.
|
|
12923
13049
|
*/
|
|
12924
13050
|
deviceIds: array(number()).optional()
|
|
12925
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
13051
|
+
}), 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({
|
|
12926
13052
|
mode: LinkedDevicesModeSchema,
|
|
12927
13053
|
devices: array(LinkedDeviceSchema)
|
|
12928
13054
|
})), 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({
|
|
@@ -13646,6 +13772,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13646
13772
|
kind: "mutation",
|
|
13647
13773
|
auth: "admin"
|
|
13648
13774
|
});
|
|
13775
|
+
/**
|
|
13776
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13777
|
+
* through. It stores nothing.
|
|
13778
|
+
*
|
|
13779
|
+
* ## Why a capability at all, and why this shape
|
|
13780
|
+
*
|
|
13781
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13782
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13783
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13784
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13785
|
+
* is assembled from declarations at runtime.
|
|
13786
|
+
*
|
|
13787
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13788
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13789
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13790
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13791
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13792
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13793
|
+
* No new UDS message, no second registry.
|
|
13794
|
+
*
|
|
13795
|
+
* ## What it deliberately does NOT own
|
|
13796
|
+
*
|
|
13797
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13798
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13799
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13800
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13801
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13802
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13803
|
+
* setter for a window and no persistence of any kind.
|
|
13804
|
+
*
|
|
13805
|
+
* ## Why `apply` is here even so
|
|
13806
|
+
*
|
|
13807
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13808
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13809
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13810
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13811
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13812
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13813
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13814
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13815
|
+
*/
|
|
13816
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13817
|
+
var LogChannelApplyResultSchema = object({
|
|
13818
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13819
|
+
armed: number().int().min(0),
|
|
13820
|
+
/**
|
|
13821
|
+
* Names the document armed that this process does not declare. Reported
|
|
13822
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13823
|
+
* not booted, and both deserve a line instead of silence.
|
|
13824
|
+
*/
|
|
13825
|
+
unknown: array(string()).readonly()
|
|
13826
|
+
});
|
|
13827
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13649
13828
|
var LogLevelSchema = _enum([
|
|
13650
13829
|
"debug",
|
|
13651
13830
|
"info",
|
|
@@ -27120,10 +27299,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
27120
27299
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
27121
27300
|
* layer that carries an explicit value wins.
|
|
27122
27301
|
*
|
|
27123
|
-
* `component`
|
|
27124
|
-
*
|
|
27125
|
-
*
|
|
27126
|
-
*
|
|
27302
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
27303
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
27304
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
27305
|
+
* that turning it on would not force every consumer of this document to widen
|
|
27306
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
27127
27307
|
*/
|
|
27128
27308
|
var LoggingScopeKindSchema = _enum([
|
|
27129
27309
|
"cluster",
|
|
@@ -27150,6 +27330,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
27150
27330
|
scope: LoggingScopeKindSchema,
|
|
27151
27331
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
27152
27332
|
nodeId: string().nullable(),
|
|
27333
|
+
/**
|
|
27334
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
27335
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
27336
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
27337
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
27338
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
27339
|
+
*/
|
|
27340
|
+
component: string().nullable(),
|
|
27153
27341
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
27154
27342
|
level: LogLevelSchema$1.nullable()
|
|
27155
27343
|
});
|
|
@@ -27191,6 +27379,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
27191
27379
|
reportEveryMs: number().int().positive().optional()
|
|
27192
27380
|
});
|
|
27193
27381
|
/**
|
|
27382
|
+
* A channel ARMED, as the document reports it.
|
|
27383
|
+
*
|
|
27384
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
27385
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
27386
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
27387
|
+
*/
|
|
27388
|
+
var LogChannelWindowStateSchema = object({
|
|
27389
|
+
channel: string(),
|
|
27390
|
+
armed: boolean(),
|
|
27391
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
27392
|
+
armedUntilMs: number(),
|
|
27393
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
27394
|
+
remainingMs: number(),
|
|
27395
|
+
/**
|
|
27396
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
27397
|
+
*
|
|
27398
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
27399
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
27400
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
27401
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
27402
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
27403
|
+
* not.
|
|
27404
|
+
*/
|
|
27405
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
27406
|
+
});
|
|
27407
|
+
/**
|
|
27408
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
27409
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
27410
|
+
*/
|
|
27411
|
+
var LogChannelWindowPatchSchema = object({
|
|
27412
|
+
channel: string().min(1),
|
|
27413
|
+
armMs: number().int().min(0),
|
|
27414
|
+
/**
|
|
27415
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
27416
|
+
*
|
|
27417
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
27418
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
27419
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
27420
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
27421
|
+
*/
|
|
27422
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
27423
|
+
});
|
|
27424
|
+
/**
|
|
27194
27425
|
* A PATCH, and patches MERGE.
|
|
27195
27426
|
*
|
|
27196
27427
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -27209,7 +27440,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
27209
27440
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
27210
27441
|
* keeps running — a patch is never a full replacement.
|
|
27211
27442
|
*/
|
|
27212
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
27443
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
27444
|
+
/**
|
|
27445
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
27446
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
27447
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
27448
|
+
* the Diagnostics page fight over the same value.
|
|
27449
|
+
*/
|
|
27450
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
27213
27451
|
});
|
|
27214
27452
|
/**
|
|
27215
27453
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -27222,9 +27460,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
27222
27460
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
27223
27461
|
* layer selector needs a name the transport does not already own.
|
|
27224
27462
|
*/
|
|
27225
|
-
var GetLoggingSettingsInputSchema = object({
|
|
27463
|
+
var GetLoggingSettingsInputSchema = object({
|
|
27464
|
+
scopeNodeId: string().optional(),
|
|
27465
|
+
/**
|
|
27466
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
27467
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
27468
|
+
*
|
|
27469
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
27470
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
27471
|
+
* not, and one selector for both would make "which of these two did I just
|
|
27472
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
27473
|
+
*/
|
|
27474
|
+
scopeComponent: string().optional()
|
|
27475
|
+
});
|
|
27226
27476
|
var SetLoggingSettingsInputSchema = object({
|
|
27227
27477
|
scopeNodeId: string().optional(),
|
|
27478
|
+
scopeComponent: string().optional(),
|
|
27228
27479
|
patch: LoggingSettingsPatchSchema
|
|
27229
27480
|
});
|
|
27230
27481
|
/**
|
|
@@ -27239,9 +27490,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
27239
27490
|
var LoggingSettingsStateSchema = object({
|
|
27240
27491
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
27241
27492
|
scopeNodeId: string().nullable(),
|
|
27493
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
27494
|
+
scopeComponent: string().nullable(),
|
|
27242
27495
|
effective: LoggingEffectiveSchema,
|
|
27243
27496
|
explicit: LoggingExplicitSchema,
|
|
27244
27497
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
27498
|
+
/**
|
|
27499
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
27500
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
27501
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
27502
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
27503
|
+
*/
|
|
27504
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
27505
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
27506
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
27245
27507
|
persisted: boolean()
|
|
27246
27508
|
});
|
|
27247
27509
|
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(), {
|
|
@@ -28834,6 +29096,12 @@ Object.freeze({
|
|
|
28834
29096
|
addonId: null,
|
|
28835
29097
|
access: "view"
|
|
28836
29098
|
},
|
|
29099
|
+
"dataStoreProvider.aggregate": {
|
|
29100
|
+
capName: "data-store-provider",
|
|
29101
|
+
capScope: "system",
|
|
29102
|
+
addonId: null,
|
|
29103
|
+
access: "view"
|
|
29104
|
+
},
|
|
28837
29105
|
"dataStoreProvider.count": {
|
|
28838
29106
|
capName: "data-store-provider",
|
|
28839
29107
|
capScope: "system",
|
|
@@ -29248,6 +29516,12 @@ Object.freeze({
|
|
|
29248
29516
|
addonId: null,
|
|
29249
29517
|
access: "view"
|
|
29250
29518
|
},
|
|
29519
|
+
"deviceManager.getChildrenBatch": {
|
|
29520
|
+
capName: "device-manager",
|
|
29521
|
+
capScope: "system",
|
|
29522
|
+
addonId: null,
|
|
29523
|
+
access: "view"
|
|
29524
|
+
},
|
|
29251
29525
|
"deviceManager.getConfigSchema": {
|
|
29252
29526
|
capName: "device-manager",
|
|
29253
29527
|
capScope: "system",
|
|
@@ -30298,6 +30572,18 @@ Object.freeze({
|
|
|
30298
30572
|
addonId: null,
|
|
30299
30573
|
access: "create"
|
|
30300
30574
|
},
|
|
30575
|
+
"logChannels.apply": {
|
|
30576
|
+
capName: "log-channels",
|
|
30577
|
+
capScope: "system",
|
|
30578
|
+
addonId: null,
|
|
30579
|
+
access: "create"
|
|
30580
|
+
},
|
|
30581
|
+
"logChannels.list": {
|
|
30582
|
+
capName: "log-channels",
|
|
30583
|
+
capScope: "system",
|
|
30584
|
+
addonId: null,
|
|
30585
|
+
access: "view"
|
|
30586
|
+
},
|
|
30301
30587
|
"logDestination.query": {
|
|
30302
30588
|
capName: "log-destination",
|
|
30303
30589
|
capScope: "system",
|
|
@@ -32452,6 +32738,12 @@ Object.freeze({
|
|
|
32452
32738
|
addonId: null,
|
|
32453
32739
|
access: "create"
|
|
32454
32740
|
},
|
|
32741
|
+
"settingsStore.aggregate": {
|
|
32742
|
+
capName: "settings-store",
|
|
32743
|
+
capScope: "system",
|
|
32744
|
+
addonId: null,
|
|
32745
|
+
access: "view"
|
|
32746
|
+
},
|
|
32455
32747
|
"settingsStore.count": {
|
|
32456
32748
|
capName: "settings-store",
|
|
32457
32749
|
capScope: "system",
|
|
@@ -34031,6 +34323,11 @@ Object.freeze({
|
|
|
34031
34323
|
form: "single",
|
|
34032
34324
|
optional: false
|
|
34033
34325
|
}],
|
|
34326
|
+
"deviceManager.getChildrenBatch": [{
|
|
34327
|
+
name: "parentDeviceIds",
|
|
34328
|
+
form: "array",
|
|
34329
|
+
optional: false
|
|
34330
|
+
}],
|
|
34034
34331
|
"deviceManager.getConfigSchema": [{
|
|
34035
34332
|
name: "deviceId",
|
|
34036
34333
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-export-hap",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.45",
|
|
4
4
|
"description": "HomeKit (HAP) exporter for CamStack devices. Publishes each exposed device as its own HomeKit accessory: cameras and doorbells with SRTP streaming, HomeKit Secure Video, motion, two-way audio, PTZ and battery; switches, lights, locks and sensors through a capability→service table.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|