@camstack/addon-notifiers 1.2.37 → 1.2.39
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 +322 -25
- package/dist/addon.mjs +322 -25
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7601,6 +7601,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7601
7601
|
fetchedAt: number()
|
|
7602
7602
|
});
|
|
7603
7603
|
/**
|
|
7604
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7605
|
+
* an addon declares its channels in.
|
|
7606
|
+
*
|
|
7607
|
+
* ## Two axes, deliberately separated
|
|
7608
|
+
*
|
|
7609
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7610
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7611
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7612
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7613
|
+
* `log-channels` capability enumerates the declarations.
|
|
7614
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7615
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7616
|
+
* over the values is the exact defect
|
|
7617
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7618
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7619
|
+
*
|
|
7620
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7621
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7622
|
+
* the hot path with a value somebody actually read, and by
|
|
7623
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7624
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7625
|
+
* disarmed one (D49).
|
|
7626
|
+
*
|
|
7627
|
+
* ## The canonical call shape
|
|
7628
|
+
*
|
|
7629
|
+
* ```ts
|
|
7630
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7631
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7632
|
+
* }
|
|
7633
|
+
* ```
|
|
7634
|
+
*
|
|
7635
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7636
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7637
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7638
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7639
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7640
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7641
|
+
*
|
|
7642
|
+
* ## Why a channel emits at `info`
|
|
7643
|
+
*
|
|
7644
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7645
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7646
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7647
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7648
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7649
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7650
|
+
*/
|
|
7651
|
+
/**
|
|
7652
|
+
* The level a channel writes at once armed.
|
|
7653
|
+
*
|
|
7654
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7655
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7656
|
+
* to read it later.
|
|
7657
|
+
*/
|
|
7658
|
+
var LogChannelLevelSchema = _enum([
|
|
7659
|
+
"info",
|
|
7660
|
+
"warn",
|
|
7661
|
+
"error"
|
|
7662
|
+
]);
|
|
7663
|
+
/**
|
|
7664
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7665
|
+
* declaration is inert.
|
|
7666
|
+
*/
|
|
7667
|
+
var LogChannelDescriptorSchema = object({
|
|
7668
|
+
/**
|
|
7669
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7670
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7671
|
+
* owns it without a second lookup.
|
|
7672
|
+
*/
|
|
7673
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7674
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7675
|
+
description: string().min(1),
|
|
7676
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7677
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7678
|
+
/**
|
|
7679
|
+
* Whether this channel can be narrowed to a camera.
|
|
7680
|
+
*
|
|
7681
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7682
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7683
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7684
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7685
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7686
|
+
* the body is the only way to filter.
|
|
7687
|
+
*
|
|
7688
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7689
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7690
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7691
|
+
* path was never taken.
|
|
7692
|
+
*/
|
|
7693
|
+
perDevice: boolean()
|
|
7694
|
+
});
|
|
7695
|
+
/**
|
|
7696
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7697
|
+
*
|
|
7698
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7699
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7700
|
+
*/
|
|
7701
|
+
var LogChannelWindowSchema = object({
|
|
7702
|
+
channel: string().min(1),
|
|
7703
|
+
/** Epoch ms the window closes at. */
|
|
7704
|
+
armedUntilMs: number(),
|
|
7705
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7706
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7707
|
+
});
|
|
7708
|
+
/**
|
|
7604
7709
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7605
7710
|
* recordings and events management surfaces.
|
|
7606
7711
|
*
|
|
@@ -11160,6 +11265,35 @@ var MutationFilterSchema = object({
|
|
|
11160
11265
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11161
11266
|
whereNot: record(string(), unknown()).optional()
|
|
11162
11267
|
});
|
|
11268
|
+
/**
|
|
11269
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11270
|
+
*
|
|
11271
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11272
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11273
|
+
* a `Record<column, op>` shape could not express.
|
|
11274
|
+
*/
|
|
11275
|
+
var AggregateFieldSchema = object({
|
|
11276
|
+
/** Result key. */
|
|
11277
|
+
as: string().min(1),
|
|
11278
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11279
|
+
field: string().min(1),
|
|
11280
|
+
op: _enum([
|
|
11281
|
+
"sum",
|
|
11282
|
+
"min",
|
|
11283
|
+
"max"
|
|
11284
|
+
])
|
|
11285
|
+
});
|
|
11286
|
+
/**
|
|
11287
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11288
|
+
*
|
|
11289
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11290
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11291
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11292
|
+
*/
|
|
11293
|
+
var AggregateResultSchema = object({
|
|
11294
|
+
count: number().int(),
|
|
11295
|
+
values: record(string(), number().nullable())
|
|
11296
|
+
});
|
|
11163
11297
|
/** A single stored record: `{ id, data }`. */
|
|
11164
11298
|
var SettingsRecordSchema = object({
|
|
11165
11299
|
id: string(),
|
|
@@ -11244,6 +11378,11 @@ method(object({
|
|
|
11244
11378
|
collection: string(),
|
|
11245
11379
|
filter: QueryFilterSchema.optional()
|
|
11246
11380
|
}), number()), method(object({
|
|
11381
|
+
namespace: string().optional(),
|
|
11382
|
+
collection: string(),
|
|
11383
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11384
|
+
filter: QueryFilterSchema.optional()
|
|
11385
|
+
}), AggregateResultSchema), method(object({
|
|
11247
11386
|
namespace: string().optional(),
|
|
11248
11387
|
collection: string(),
|
|
11249
11388
|
field: string(),
|
|
@@ -11360,6 +11499,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11360
11499
|
collection: string(),
|
|
11361
11500
|
filter: QueryFilterSchema.optional()
|
|
11362
11501
|
}), number(), { auth: "admin" }), method(object({
|
|
11502
|
+
namespace: string().optional(),
|
|
11503
|
+
collection: string(),
|
|
11504
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11505
|
+
filter: QueryFilterSchema.optional()
|
|
11506
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11363
11507
|
namespace: string().optional(),
|
|
11364
11508
|
collection: string(),
|
|
11365
11509
|
field: string(),
|
|
@@ -11921,24 +12065,6 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
|
|
|
11921
12065
|
kind: "mutation",
|
|
11922
12066
|
auth: "admin"
|
|
11923
12067
|
});
|
|
11924
|
-
/**
|
|
11925
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
11926
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
11927
|
-
*
|
|
11928
|
-
* Replaces:
|
|
11929
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
11930
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
11931
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
11932
|
-
*
|
|
11933
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
11934
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
11935
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
11936
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
11937
|
-
* - No shadow registry or cross-node aggregation required.
|
|
11938
|
-
*
|
|
11939
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
11940
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
11941
|
-
*/
|
|
11942
12068
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
11943
12069
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
11944
12070
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12307,7 +12433,7 @@ method(object({
|
|
|
12307
12433
|
* it answers today and the caller filters as it already does.
|
|
12308
12434
|
*/
|
|
12309
12435
|
deviceIds: array(number()).optional()
|
|
12310
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12436
|
+
}), 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({
|
|
12311
12437
|
mode: LinkedDevicesModeSchema,
|
|
12312
12438
|
devices: array(LinkedDeviceSchema)
|
|
12313
12439
|
})), 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({
|
|
@@ -13031,6 +13157,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13031
13157
|
kind: "mutation",
|
|
13032
13158
|
auth: "admin"
|
|
13033
13159
|
});
|
|
13160
|
+
/**
|
|
13161
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13162
|
+
* through. It stores nothing.
|
|
13163
|
+
*
|
|
13164
|
+
* ## Why a capability at all, and why this shape
|
|
13165
|
+
*
|
|
13166
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13167
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13168
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13169
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13170
|
+
* is assembled from declarations at runtime.
|
|
13171
|
+
*
|
|
13172
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13173
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13174
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13175
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13176
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13177
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13178
|
+
* No new UDS message, no second registry.
|
|
13179
|
+
*
|
|
13180
|
+
* ## What it deliberately does NOT own
|
|
13181
|
+
*
|
|
13182
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13183
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13184
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13185
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13186
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13187
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13188
|
+
* setter for a window and no persistence of any kind.
|
|
13189
|
+
*
|
|
13190
|
+
* ## Why `apply` is here even so
|
|
13191
|
+
*
|
|
13192
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13193
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13194
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13195
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13196
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13197
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13198
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13199
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13200
|
+
*/
|
|
13201
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13202
|
+
var LogChannelApplyResultSchema = object({
|
|
13203
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13204
|
+
armed: number().int().min(0),
|
|
13205
|
+
/**
|
|
13206
|
+
* Names the document armed that this process does not declare. Reported
|
|
13207
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13208
|
+
* not booted, and both deserve a line instead of silence.
|
|
13209
|
+
*/
|
|
13210
|
+
unknown: array(string()).readonly()
|
|
13211
|
+
});
|
|
13212
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13034
13213
|
var LogLevelSchema = _enum([
|
|
13035
13214
|
"debug",
|
|
13036
13215
|
"info",
|
|
@@ -26462,10 +26641,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
26462
26641
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
26463
26642
|
* layer that carries an explicit value wins.
|
|
26464
26643
|
*
|
|
26465
|
-
* `component`
|
|
26466
|
-
*
|
|
26467
|
-
*
|
|
26468
|
-
*
|
|
26644
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
26645
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
26646
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
26647
|
+
* that turning it on would not force every consumer of this document to widen
|
|
26648
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
26469
26649
|
*/
|
|
26470
26650
|
var LoggingScopeKindSchema = _enum([
|
|
26471
26651
|
"cluster",
|
|
@@ -26492,6 +26672,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
26492
26672
|
scope: LoggingScopeKindSchema,
|
|
26493
26673
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
26494
26674
|
nodeId: string().nullable(),
|
|
26675
|
+
/**
|
|
26676
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
26677
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
26678
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
26679
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
26680
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
26681
|
+
*/
|
|
26682
|
+
component: string().nullable(),
|
|
26495
26683
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
26496
26684
|
level: LogLevelSchema$1.nullable()
|
|
26497
26685
|
});
|
|
@@ -26533,6 +26721,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
26533
26721
|
reportEveryMs: number().int().positive().optional()
|
|
26534
26722
|
});
|
|
26535
26723
|
/**
|
|
26724
|
+
* A channel ARMED, as the document reports it.
|
|
26725
|
+
*
|
|
26726
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
26727
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
26728
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
26729
|
+
*/
|
|
26730
|
+
var LogChannelWindowStateSchema = object({
|
|
26731
|
+
channel: string(),
|
|
26732
|
+
armed: boolean(),
|
|
26733
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
26734
|
+
armedUntilMs: number(),
|
|
26735
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
26736
|
+
remainingMs: number(),
|
|
26737
|
+
/**
|
|
26738
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
26739
|
+
*
|
|
26740
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
26741
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
26742
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
26743
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
26744
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
26745
|
+
* not.
|
|
26746
|
+
*/
|
|
26747
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
26748
|
+
});
|
|
26749
|
+
/**
|
|
26750
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
26751
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
26752
|
+
*/
|
|
26753
|
+
var LogChannelWindowPatchSchema = object({
|
|
26754
|
+
channel: string().min(1),
|
|
26755
|
+
armMs: number().int().min(0),
|
|
26756
|
+
/**
|
|
26757
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
26758
|
+
*
|
|
26759
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
26760
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
26761
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
26762
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
26763
|
+
*/
|
|
26764
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
26765
|
+
});
|
|
26766
|
+
/**
|
|
26536
26767
|
* A PATCH, and patches MERGE.
|
|
26537
26768
|
*
|
|
26538
26769
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -26551,7 +26782,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
26551
26782
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
26552
26783
|
* keeps running — a patch is never a full replacement.
|
|
26553
26784
|
*/
|
|
26554
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
26785
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
26786
|
+
/**
|
|
26787
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
26788
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
26789
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
26790
|
+
* the Diagnostics page fight over the same value.
|
|
26791
|
+
*/
|
|
26792
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
26555
26793
|
});
|
|
26556
26794
|
/**
|
|
26557
26795
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -26564,9 +26802,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
26564
26802
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
26565
26803
|
* layer selector needs a name the transport does not already own.
|
|
26566
26804
|
*/
|
|
26567
|
-
var GetLoggingSettingsInputSchema = object({
|
|
26805
|
+
var GetLoggingSettingsInputSchema = object({
|
|
26806
|
+
scopeNodeId: string().optional(),
|
|
26807
|
+
/**
|
|
26808
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
26809
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
26810
|
+
*
|
|
26811
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
26812
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
26813
|
+
* not, and one selector for both would make "which of these two did I just
|
|
26814
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
26815
|
+
*/
|
|
26816
|
+
scopeComponent: string().optional()
|
|
26817
|
+
});
|
|
26568
26818
|
var SetLoggingSettingsInputSchema = object({
|
|
26569
26819
|
scopeNodeId: string().optional(),
|
|
26820
|
+
scopeComponent: string().optional(),
|
|
26570
26821
|
patch: LoggingSettingsPatchSchema
|
|
26571
26822
|
});
|
|
26572
26823
|
/**
|
|
@@ -26581,9 +26832,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
26581
26832
|
var LoggingSettingsStateSchema = object({
|
|
26582
26833
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
26583
26834
|
scopeNodeId: string().nullable(),
|
|
26835
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
26836
|
+
scopeComponent: string().nullable(),
|
|
26584
26837
|
effective: LoggingEffectiveSchema,
|
|
26585
26838
|
explicit: LoggingExplicitSchema,
|
|
26586
26839
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
26840
|
+
/**
|
|
26841
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
26842
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
26843
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
26844
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
26845
|
+
*/
|
|
26846
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
26847
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
26848
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
26587
26849
|
persisted: boolean()
|
|
26588
26850
|
});
|
|
26589
26851
|
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(), {
|
|
@@ -28160,6 +28422,12 @@ Object.freeze({
|
|
|
28160
28422
|
addonId: null,
|
|
28161
28423
|
access: "view"
|
|
28162
28424
|
},
|
|
28425
|
+
"dataStoreProvider.aggregate": {
|
|
28426
|
+
capName: "data-store-provider",
|
|
28427
|
+
capScope: "system",
|
|
28428
|
+
addonId: null,
|
|
28429
|
+
access: "view"
|
|
28430
|
+
},
|
|
28163
28431
|
"dataStoreProvider.count": {
|
|
28164
28432
|
capName: "data-store-provider",
|
|
28165
28433
|
capScope: "system",
|
|
@@ -28574,6 +28842,12 @@ Object.freeze({
|
|
|
28574
28842
|
addonId: null,
|
|
28575
28843
|
access: "view"
|
|
28576
28844
|
},
|
|
28845
|
+
"deviceManager.getChildrenBatch": {
|
|
28846
|
+
capName: "device-manager",
|
|
28847
|
+
capScope: "system",
|
|
28848
|
+
addonId: null,
|
|
28849
|
+
access: "view"
|
|
28850
|
+
},
|
|
28577
28851
|
"deviceManager.getConfigSchema": {
|
|
28578
28852
|
capName: "device-manager",
|
|
28579
28853
|
capScope: "system",
|
|
@@ -29624,6 +29898,18 @@ Object.freeze({
|
|
|
29624
29898
|
addonId: null,
|
|
29625
29899
|
access: "create"
|
|
29626
29900
|
},
|
|
29901
|
+
"logChannels.apply": {
|
|
29902
|
+
capName: "log-channels",
|
|
29903
|
+
capScope: "system",
|
|
29904
|
+
addonId: null,
|
|
29905
|
+
access: "create"
|
|
29906
|
+
},
|
|
29907
|
+
"logChannels.list": {
|
|
29908
|
+
capName: "log-channels",
|
|
29909
|
+
capScope: "system",
|
|
29910
|
+
addonId: null,
|
|
29911
|
+
access: "view"
|
|
29912
|
+
},
|
|
29627
29913
|
"logDestination.query": {
|
|
29628
29914
|
capName: "log-destination",
|
|
29629
29915
|
capScope: "system",
|
|
@@ -31778,6 +32064,12 @@ Object.freeze({
|
|
|
31778
32064
|
addonId: null,
|
|
31779
32065
|
access: "create"
|
|
31780
32066
|
},
|
|
32067
|
+
"settingsStore.aggregate": {
|
|
32068
|
+
capName: "settings-store",
|
|
32069
|
+
capScope: "system",
|
|
32070
|
+
addonId: null,
|
|
32071
|
+
access: "view"
|
|
32072
|
+
},
|
|
31781
32073
|
"settingsStore.count": {
|
|
31782
32074
|
capName: "settings-store",
|
|
31783
32075
|
capScope: "system",
|
|
@@ -33357,6 +33649,11 @@ Object.freeze({
|
|
|
33357
33649
|
form: "single",
|
|
33358
33650
|
optional: false
|
|
33359
33651
|
}],
|
|
33652
|
+
"deviceManager.getChildrenBatch": [{
|
|
33653
|
+
name: "parentDeviceIds",
|
|
33654
|
+
form: "array",
|
|
33655
|
+
optional: false
|
|
33656
|
+
}],
|
|
33360
33657
|
"deviceManager.getConfigSchema": [{
|
|
33361
33658
|
name: "deviceId",
|
|
33362
33659
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -7574,6 +7574,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7574
7574
|
fetchedAt: number()
|
|
7575
7575
|
});
|
|
7576
7576
|
/**
|
|
7577
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7578
|
+
* an addon declares its channels in.
|
|
7579
|
+
*
|
|
7580
|
+
* ## Two axes, deliberately separated
|
|
7581
|
+
*
|
|
7582
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7583
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7584
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7585
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7586
|
+
* `log-channels` capability enumerates the declarations.
|
|
7587
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7588
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7589
|
+
* over the values is the exact defect
|
|
7590
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7591
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7592
|
+
*
|
|
7593
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7594
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7595
|
+
* the hot path with a value somebody actually read, and by
|
|
7596
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7597
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7598
|
+
* disarmed one (D49).
|
|
7599
|
+
*
|
|
7600
|
+
* ## The canonical call shape
|
|
7601
|
+
*
|
|
7602
|
+
* ```ts
|
|
7603
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7604
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7605
|
+
* }
|
|
7606
|
+
* ```
|
|
7607
|
+
*
|
|
7608
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7609
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7610
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7611
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7612
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7613
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7614
|
+
*
|
|
7615
|
+
* ## Why a channel emits at `info`
|
|
7616
|
+
*
|
|
7617
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7618
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7619
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7620
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7621
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7622
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7623
|
+
*/
|
|
7624
|
+
/**
|
|
7625
|
+
* The level a channel writes at once armed.
|
|
7626
|
+
*
|
|
7627
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7628
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7629
|
+
* to read it later.
|
|
7630
|
+
*/
|
|
7631
|
+
var LogChannelLevelSchema = _enum([
|
|
7632
|
+
"info",
|
|
7633
|
+
"warn",
|
|
7634
|
+
"error"
|
|
7635
|
+
]);
|
|
7636
|
+
/**
|
|
7637
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7638
|
+
* declaration is inert.
|
|
7639
|
+
*/
|
|
7640
|
+
var LogChannelDescriptorSchema = object({
|
|
7641
|
+
/**
|
|
7642
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7643
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7644
|
+
* owns it without a second lookup.
|
|
7645
|
+
*/
|
|
7646
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7647
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7648
|
+
description: string().min(1),
|
|
7649
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7650
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7651
|
+
/**
|
|
7652
|
+
* Whether this channel can be narrowed to a camera.
|
|
7653
|
+
*
|
|
7654
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7655
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7656
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7657
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7658
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7659
|
+
* the body is the only way to filter.
|
|
7660
|
+
*
|
|
7661
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7662
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7663
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7664
|
+
* path was never taken.
|
|
7665
|
+
*/
|
|
7666
|
+
perDevice: boolean()
|
|
7667
|
+
});
|
|
7668
|
+
/**
|
|
7669
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7670
|
+
*
|
|
7671
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7672
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7673
|
+
*/
|
|
7674
|
+
var LogChannelWindowSchema = object({
|
|
7675
|
+
channel: string().min(1),
|
|
7676
|
+
/** Epoch ms the window closes at. */
|
|
7677
|
+
armedUntilMs: number(),
|
|
7678
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7679
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7680
|
+
});
|
|
7681
|
+
/**
|
|
7577
7682
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7578
7683
|
* recordings and events management surfaces.
|
|
7579
7684
|
*
|
|
@@ -11133,6 +11238,35 @@ var MutationFilterSchema = object({
|
|
|
11133
11238
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11134
11239
|
whereNot: record(string(), unknown()).optional()
|
|
11135
11240
|
});
|
|
11241
|
+
/**
|
|
11242
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11243
|
+
*
|
|
11244
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11245
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11246
|
+
* a `Record<column, op>` shape could not express.
|
|
11247
|
+
*/
|
|
11248
|
+
var AggregateFieldSchema = object({
|
|
11249
|
+
/** Result key. */
|
|
11250
|
+
as: string().min(1),
|
|
11251
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11252
|
+
field: string().min(1),
|
|
11253
|
+
op: _enum([
|
|
11254
|
+
"sum",
|
|
11255
|
+
"min",
|
|
11256
|
+
"max"
|
|
11257
|
+
])
|
|
11258
|
+
});
|
|
11259
|
+
/**
|
|
11260
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11261
|
+
*
|
|
11262
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11263
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11264
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11265
|
+
*/
|
|
11266
|
+
var AggregateResultSchema = object({
|
|
11267
|
+
count: number().int(),
|
|
11268
|
+
values: record(string(), number().nullable())
|
|
11269
|
+
});
|
|
11136
11270
|
/** A single stored record: `{ id, data }`. */
|
|
11137
11271
|
var SettingsRecordSchema = object({
|
|
11138
11272
|
id: string(),
|
|
@@ -11217,6 +11351,11 @@ method(object({
|
|
|
11217
11351
|
collection: string(),
|
|
11218
11352
|
filter: QueryFilterSchema.optional()
|
|
11219
11353
|
}), number()), method(object({
|
|
11354
|
+
namespace: string().optional(),
|
|
11355
|
+
collection: string(),
|
|
11356
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11357
|
+
filter: QueryFilterSchema.optional()
|
|
11358
|
+
}), AggregateResultSchema), method(object({
|
|
11220
11359
|
namespace: string().optional(),
|
|
11221
11360
|
collection: string(),
|
|
11222
11361
|
field: string(),
|
|
@@ -11333,6 +11472,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11333
11472
|
collection: string(),
|
|
11334
11473
|
filter: QueryFilterSchema.optional()
|
|
11335
11474
|
}), number(), { auth: "admin" }), method(object({
|
|
11475
|
+
namespace: string().optional(),
|
|
11476
|
+
collection: string(),
|
|
11477
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11478
|
+
filter: QueryFilterSchema.optional()
|
|
11479
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11336
11480
|
namespace: string().optional(),
|
|
11337
11481
|
collection: string(),
|
|
11338
11482
|
field: string(),
|
|
@@ -11894,24 +12038,6 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
|
|
|
11894
12038
|
kind: "mutation",
|
|
11895
12039
|
auth: "admin"
|
|
11896
12040
|
});
|
|
11897
|
-
/**
|
|
11898
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
11899
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
11900
|
-
*
|
|
11901
|
-
* Replaces:
|
|
11902
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
11903
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
11904
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
11905
|
-
*
|
|
11906
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
11907
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
11908
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
11909
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
11910
|
-
* - No shadow registry or cross-node aggregation required.
|
|
11911
|
-
*
|
|
11912
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
11913
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
11914
|
-
*/
|
|
11915
12041
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
11916
12042
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
11917
12043
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12280,7 +12406,7 @@ method(object({
|
|
|
12280
12406
|
* it answers today and the caller filters as it already does.
|
|
12281
12407
|
*/
|
|
12282
12408
|
deviceIds: array(number()).optional()
|
|
12283
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12409
|
+
}), 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({
|
|
12284
12410
|
mode: LinkedDevicesModeSchema,
|
|
12285
12411
|
devices: array(LinkedDeviceSchema)
|
|
12286
12412
|
})), 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({
|
|
@@ -13004,6 +13130,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13004
13130
|
kind: "mutation",
|
|
13005
13131
|
auth: "admin"
|
|
13006
13132
|
});
|
|
13133
|
+
/**
|
|
13134
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13135
|
+
* through. It stores nothing.
|
|
13136
|
+
*
|
|
13137
|
+
* ## Why a capability at all, and why this shape
|
|
13138
|
+
*
|
|
13139
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13140
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13141
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13142
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13143
|
+
* is assembled from declarations at runtime.
|
|
13144
|
+
*
|
|
13145
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13146
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13147
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13148
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13149
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13150
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13151
|
+
* No new UDS message, no second registry.
|
|
13152
|
+
*
|
|
13153
|
+
* ## What it deliberately does NOT own
|
|
13154
|
+
*
|
|
13155
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13156
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13157
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13158
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13159
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13160
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13161
|
+
* setter for a window and no persistence of any kind.
|
|
13162
|
+
*
|
|
13163
|
+
* ## Why `apply` is here even so
|
|
13164
|
+
*
|
|
13165
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13166
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13167
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13168
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13169
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13170
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13171
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13172
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13173
|
+
*/
|
|
13174
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13175
|
+
var LogChannelApplyResultSchema = object({
|
|
13176
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13177
|
+
armed: number().int().min(0),
|
|
13178
|
+
/**
|
|
13179
|
+
* Names the document armed that this process does not declare. Reported
|
|
13180
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13181
|
+
* not booted, and both deserve a line instead of silence.
|
|
13182
|
+
*/
|
|
13183
|
+
unknown: array(string()).readonly()
|
|
13184
|
+
});
|
|
13185
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13007
13186
|
var LogLevelSchema = _enum([
|
|
13008
13187
|
"debug",
|
|
13009
13188
|
"info",
|
|
@@ -26435,10 +26614,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
26435
26614
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
26436
26615
|
* layer that carries an explicit value wins.
|
|
26437
26616
|
*
|
|
26438
|
-
* `component`
|
|
26439
|
-
*
|
|
26440
|
-
*
|
|
26441
|
-
*
|
|
26617
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
26618
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
26619
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
26620
|
+
* that turning it on would not force every consumer of this document to widen
|
|
26621
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
26442
26622
|
*/
|
|
26443
26623
|
var LoggingScopeKindSchema = _enum([
|
|
26444
26624
|
"cluster",
|
|
@@ -26465,6 +26645,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
26465
26645
|
scope: LoggingScopeKindSchema,
|
|
26466
26646
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
26467
26647
|
nodeId: string().nullable(),
|
|
26648
|
+
/**
|
|
26649
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
26650
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
26651
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
26652
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
26653
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
26654
|
+
*/
|
|
26655
|
+
component: string().nullable(),
|
|
26468
26656
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
26469
26657
|
level: LogLevelSchema$1.nullable()
|
|
26470
26658
|
});
|
|
@@ -26506,6 +26694,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
26506
26694
|
reportEveryMs: number().int().positive().optional()
|
|
26507
26695
|
});
|
|
26508
26696
|
/**
|
|
26697
|
+
* A channel ARMED, as the document reports it.
|
|
26698
|
+
*
|
|
26699
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
26700
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
26701
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
26702
|
+
*/
|
|
26703
|
+
var LogChannelWindowStateSchema = object({
|
|
26704
|
+
channel: string(),
|
|
26705
|
+
armed: boolean(),
|
|
26706
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
26707
|
+
armedUntilMs: number(),
|
|
26708
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
26709
|
+
remainingMs: number(),
|
|
26710
|
+
/**
|
|
26711
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
26712
|
+
*
|
|
26713
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
26714
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
26715
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
26716
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
26717
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
26718
|
+
* not.
|
|
26719
|
+
*/
|
|
26720
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
26721
|
+
});
|
|
26722
|
+
/**
|
|
26723
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
26724
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
26725
|
+
*/
|
|
26726
|
+
var LogChannelWindowPatchSchema = object({
|
|
26727
|
+
channel: string().min(1),
|
|
26728
|
+
armMs: number().int().min(0),
|
|
26729
|
+
/**
|
|
26730
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
26731
|
+
*
|
|
26732
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
26733
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
26734
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
26735
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
26736
|
+
*/
|
|
26737
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
26738
|
+
});
|
|
26739
|
+
/**
|
|
26509
26740
|
* A PATCH, and patches MERGE.
|
|
26510
26741
|
*
|
|
26511
26742
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -26524,7 +26755,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
26524
26755
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
26525
26756
|
* keeps running — a patch is never a full replacement.
|
|
26526
26757
|
*/
|
|
26527
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
26758
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
26759
|
+
/**
|
|
26760
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
26761
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
26762
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
26763
|
+
* the Diagnostics page fight over the same value.
|
|
26764
|
+
*/
|
|
26765
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
26528
26766
|
});
|
|
26529
26767
|
/**
|
|
26530
26768
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -26537,9 +26775,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
26537
26775
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
26538
26776
|
* layer selector needs a name the transport does not already own.
|
|
26539
26777
|
*/
|
|
26540
|
-
var GetLoggingSettingsInputSchema = object({
|
|
26778
|
+
var GetLoggingSettingsInputSchema = object({
|
|
26779
|
+
scopeNodeId: string().optional(),
|
|
26780
|
+
/**
|
|
26781
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
26782
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
26783
|
+
*
|
|
26784
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
26785
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
26786
|
+
* not, and one selector for both would make "which of these two did I just
|
|
26787
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
26788
|
+
*/
|
|
26789
|
+
scopeComponent: string().optional()
|
|
26790
|
+
});
|
|
26541
26791
|
var SetLoggingSettingsInputSchema = object({
|
|
26542
26792
|
scopeNodeId: string().optional(),
|
|
26793
|
+
scopeComponent: string().optional(),
|
|
26543
26794
|
patch: LoggingSettingsPatchSchema
|
|
26544
26795
|
});
|
|
26545
26796
|
/**
|
|
@@ -26554,9 +26805,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
26554
26805
|
var LoggingSettingsStateSchema = object({
|
|
26555
26806
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
26556
26807
|
scopeNodeId: string().nullable(),
|
|
26808
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
26809
|
+
scopeComponent: string().nullable(),
|
|
26557
26810
|
effective: LoggingEffectiveSchema,
|
|
26558
26811
|
explicit: LoggingExplicitSchema,
|
|
26559
26812
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
26813
|
+
/**
|
|
26814
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
26815
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
26816
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
26817
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
26818
|
+
*/
|
|
26819
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
26820
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
26821
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
26560
26822
|
persisted: boolean()
|
|
26561
26823
|
});
|
|
26562
26824
|
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(), {
|
|
@@ -28133,6 +28395,12 @@ Object.freeze({
|
|
|
28133
28395
|
addonId: null,
|
|
28134
28396
|
access: "view"
|
|
28135
28397
|
},
|
|
28398
|
+
"dataStoreProvider.aggregate": {
|
|
28399
|
+
capName: "data-store-provider",
|
|
28400
|
+
capScope: "system",
|
|
28401
|
+
addonId: null,
|
|
28402
|
+
access: "view"
|
|
28403
|
+
},
|
|
28136
28404
|
"dataStoreProvider.count": {
|
|
28137
28405
|
capName: "data-store-provider",
|
|
28138
28406
|
capScope: "system",
|
|
@@ -28547,6 +28815,12 @@ Object.freeze({
|
|
|
28547
28815
|
addonId: null,
|
|
28548
28816
|
access: "view"
|
|
28549
28817
|
},
|
|
28818
|
+
"deviceManager.getChildrenBatch": {
|
|
28819
|
+
capName: "device-manager",
|
|
28820
|
+
capScope: "system",
|
|
28821
|
+
addonId: null,
|
|
28822
|
+
access: "view"
|
|
28823
|
+
},
|
|
28550
28824
|
"deviceManager.getConfigSchema": {
|
|
28551
28825
|
capName: "device-manager",
|
|
28552
28826
|
capScope: "system",
|
|
@@ -29597,6 +29871,18 @@ Object.freeze({
|
|
|
29597
29871
|
addonId: null,
|
|
29598
29872
|
access: "create"
|
|
29599
29873
|
},
|
|
29874
|
+
"logChannels.apply": {
|
|
29875
|
+
capName: "log-channels",
|
|
29876
|
+
capScope: "system",
|
|
29877
|
+
addonId: null,
|
|
29878
|
+
access: "create"
|
|
29879
|
+
},
|
|
29880
|
+
"logChannels.list": {
|
|
29881
|
+
capName: "log-channels",
|
|
29882
|
+
capScope: "system",
|
|
29883
|
+
addonId: null,
|
|
29884
|
+
access: "view"
|
|
29885
|
+
},
|
|
29600
29886
|
"logDestination.query": {
|
|
29601
29887
|
capName: "log-destination",
|
|
29602
29888
|
capScope: "system",
|
|
@@ -31751,6 +32037,12 @@ Object.freeze({
|
|
|
31751
32037
|
addonId: null,
|
|
31752
32038
|
access: "create"
|
|
31753
32039
|
},
|
|
32040
|
+
"settingsStore.aggregate": {
|
|
32041
|
+
capName: "settings-store",
|
|
32042
|
+
capScope: "system",
|
|
32043
|
+
addonId: null,
|
|
32044
|
+
access: "view"
|
|
32045
|
+
},
|
|
31754
32046
|
"settingsStore.count": {
|
|
31755
32047
|
capName: "settings-store",
|
|
31756
32048
|
capScope: "system",
|
|
@@ -33330,6 +33622,11 @@ Object.freeze({
|
|
|
33330
33622
|
form: "single",
|
|
33331
33623
|
optional: false
|
|
33332
33624
|
}],
|
|
33625
|
+
"deviceManager.getChildrenBatch": [{
|
|
33626
|
+
name: "parentDeviceIds",
|
|
33627
|
+
form: "array",
|
|
33628
|
+
optional: false
|
|
33629
|
+
}],
|
|
33333
33630
|
"deviceManager.getConfigSchema": [{
|
|
33334
33631
|
name: "deviceId",
|
|
33335
33632
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-notifiers",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.39",
|
|
4
4
|
"description": "System notifiers addon for CamStack — a `notification-output` collection provider hosting per-kind notifier adapters (ntfy, pushover, gotify, telegram, discord, webhook, zentik).",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|