@camstack/addon-decoder-nodeav 1.2.32 → 1.2.33
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/index.js +322 -25
- package/dist/index.mjs +322 -25
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -7468,6 +7468,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7468
7468
|
fetchedAt: number()
|
|
7469
7469
|
});
|
|
7470
7470
|
/**
|
|
7471
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7472
|
+
* an addon declares its channels in.
|
|
7473
|
+
*
|
|
7474
|
+
* ## Two axes, deliberately separated
|
|
7475
|
+
*
|
|
7476
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7477
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7478
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7479
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7480
|
+
* `log-channels` capability enumerates the declarations.
|
|
7481
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7482
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7483
|
+
* over the values is the exact defect
|
|
7484
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7485
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7486
|
+
*
|
|
7487
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7488
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7489
|
+
* the hot path with a value somebody actually read, and by
|
|
7490
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7491
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7492
|
+
* disarmed one (D49).
|
|
7493
|
+
*
|
|
7494
|
+
* ## The canonical call shape
|
|
7495
|
+
*
|
|
7496
|
+
* ```ts
|
|
7497
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7498
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7499
|
+
* }
|
|
7500
|
+
* ```
|
|
7501
|
+
*
|
|
7502
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7503
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7504
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7505
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7506
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7507
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7508
|
+
*
|
|
7509
|
+
* ## Why a channel emits at `info`
|
|
7510
|
+
*
|
|
7511
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7512
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7513
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7514
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7515
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7516
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7517
|
+
*/
|
|
7518
|
+
/**
|
|
7519
|
+
* The level a channel writes at once armed.
|
|
7520
|
+
*
|
|
7521
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7522
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7523
|
+
* to read it later.
|
|
7524
|
+
*/
|
|
7525
|
+
var LogChannelLevelSchema = _enum([
|
|
7526
|
+
"info",
|
|
7527
|
+
"warn",
|
|
7528
|
+
"error"
|
|
7529
|
+
]);
|
|
7530
|
+
/**
|
|
7531
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7532
|
+
* declaration is inert.
|
|
7533
|
+
*/
|
|
7534
|
+
var LogChannelDescriptorSchema = object({
|
|
7535
|
+
/**
|
|
7536
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7537
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7538
|
+
* owns it without a second lookup.
|
|
7539
|
+
*/
|
|
7540
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7541
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7542
|
+
description: string().min(1),
|
|
7543
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7544
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7545
|
+
/**
|
|
7546
|
+
* Whether this channel can be narrowed to a camera.
|
|
7547
|
+
*
|
|
7548
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7549
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7550
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7551
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7552
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7553
|
+
* the body is the only way to filter.
|
|
7554
|
+
*
|
|
7555
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7556
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7557
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7558
|
+
* path was never taken.
|
|
7559
|
+
*/
|
|
7560
|
+
perDevice: boolean()
|
|
7561
|
+
});
|
|
7562
|
+
/**
|
|
7563
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7564
|
+
*
|
|
7565
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7566
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7567
|
+
*/
|
|
7568
|
+
var LogChannelWindowSchema = object({
|
|
7569
|
+
channel: string().min(1),
|
|
7570
|
+
/** Epoch ms the window closes at. */
|
|
7571
|
+
armedUntilMs: number(),
|
|
7572
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7573
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7574
|
+
});
|
|
7575
|
+
/**
|
|
7471
7576
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7472
7577
|
* recordings and events management surfaces.
|
|
7473
7578
|
*
|
|
@@ -11023,6 +11128,35 @@ var MutationFilterSchema = object({
|
|
|
11023
11128
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11024
11129
|
whereNot: record(string(), unknown()).optional()
|
|
11025
11130
|
});
|
|
11131
|
+
/**
|
|
11132
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11133
|
+
*
|
|
11134
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11135
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11136
|
+
* a `Record<column, op>` shape could not express.
|
|
11137
|
+
*/
|
|
11138
|
+
var AggregateFieldSchema = object({
|
|
11139
|
+
/** Result key. */
|
|
11140
|
+
as: string().min(1),
|
|
11141
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11142
|
+
field: string().min(1),
|
|
11143
|
+
op: _enum([
|
|
11144
|
+
"sum",
|
|
11145
|
+
"min",
|
|
11146
|
+
"max"
|
|
11147
|
+
])
|
|
11148
|
+
});
|
|
11149
|
+
/**
|
|
11150
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11151
|
+
*
|
|
11152
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11153
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11154
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11155
|
+
*/
|
|
11156
|
+
var AggregateResultSchema = object({
|
|
11157
|
+
count: number().int(),
|
|
11158
|
+
values: record(string(), number().nullable())
|
|
11159
|
+
});
|
|
11026
11160
|
/** A single stored record: `{ id, data }`. */
|
|
11027
11161
|
var SettingsRecordSchema = object({
|
|
11028
11162
|
id: string(),
|
|
@@ -11107,6 +11241,11 @@ method(object({
|
|
|
11107
11241
|
collection: string(),
|
|
11108
11242
|
filter: QueryFilterSchema.optional()
|
|
11109
11243
|
}), number()), method(object({
|
|
11244
|
+
namespace: string().optional(),
|
|
11245
|
+
collection: string(),
|
|
11246
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11247
|
+
filter: QueryFilterSchema.optional()
|
|
11248
|
+
}), AggregateResultSchema), method(object({
|
|
11110
11249
|
namespace: string().optional(),
|
|
11111
11250
|
collection: string(),
|
|
11112
11251
|
field: string(),
|
|
@@ -11223,6 +11362,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11223
11362
|
collection: string(),
|
|
11224
11363
|
filter: QueryFilterSchema.optional()
|
|
11225
11364
|
}), number(), { auth: "admin" }), method(object({
|
|
11365
|
+
namespace: string().optional(),
|
|
11366
|
+
collection: string(),
|
|
11367
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11368
|
+
filter: QueryFilterSchema.optional()
|
|
11369
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11226
11370
|
namespace: string().optional(),
|
|
11227
11371
|
collection: string(),
|
|
11228
11372
|
field: string(),
|
|
@@ -11877,24 +12021,6 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
|
|
|
11877
12021
|
kind: "mutation",
|
|
11878
12022
|
auth: "admin"
|
|
11879
12023
|
});
|
|
11880
|
-
/**
|
|
11881
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
11882
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
11883
|
-
*
|
|
11884
|
-
* Replaces:
|
|
11885
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
11886
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
11887
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
11888
|
-
*
|
|
11889
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
11890
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
11891
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
11892
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
11893
|
-
* - No shadow registry or cross-node aggregation required.
|
|
11894
|
-
*
|
|
11895
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
11896
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
11897
|
-
*/
|
|
11898
12024
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
11899
12025
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
11900
12026
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12263,7 +12389,7 @@ method(object({
|
|
|
12263
12389
|
* it answers today and the caller filters as it already does.
|
|
12264
12390
|
*/
|
|
12265
12391
|
deviceIds: array(number()).optional()
|
|
12266
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12392
|
+
}), 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({
|
|
12267
12393
|
mode: LinkedDevicesModeSchema,
|
|
12268
12394
|
devices: array(LinkedDeviceSchema)
|
|
12269
12395
|
})), 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({
|
|
@@ -12987,6 +13113,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
12987
13113
|
kind: "mutation",
|
|
12988
13114
|
auth: "admin"
|
|
12989
13115
|
});
|
|
13116
|
+
/**
|
|
13117
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13118
|
+
* through. It stores nothing.
|
|
13119
|
+
*
|
|
13120
|
+
* ## Why a capability at all, and why this shape
|
|
13121
|
+
*
|
|
13122
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13123
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13124
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13125
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13126
|
+
* is assembled from declarations at runtime.
|
|
13127
|
+
*
|
|
13128
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13129
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13130
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13131
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13132
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13133
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13134
|
+
* No new UDS message, no second registry.
|
|
13135
|
+
*
|
|
13136
|
+
* ## What it deliberately does NOT own
|
|
13137
|
+
*
|
|
13138
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13139
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13140
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13141
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13142
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13143
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13144
|
+
* setter for a window and no persistence of any kind.
|
|
13145
|
+
*
|
|
13146
|
+
* ## Why `apply` is here even so
|
|
13147
|
+
*
|
|
13148
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13149
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13150
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13151
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13152
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13153
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13154
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13155
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13156
|
+
*/
|
|
13157
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13158
|
+
var LogChannelApplyResultSchema = object({
|
|
13159
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13160
|
+
armed: number().int().min(0),
|
|
13161
|
+
/**
|
|
13162
|
+
* Names the document armed that this process does not declare. Reported
|
|
13163
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13164
|
+
* not booted, and both deserve a line instead of silence.
|
|
13165
|
+
*/
|
|
13166
|
+
unknown: array(string()).readonly()
|
|
13167
|
+
});
|
|
13168
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
12990
13169
|
var LogLevelSchema = _enum([
|
|
12991
13170
|
"debug",
|
|
12992
13171
|
"info",
|
|
@@ -26404,10 +26583,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
26404
26583
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
26405
26584
|
* layer that carries an explicit value wins.
|
|
26406
26585
|
*
|
|
26407
|
-
* `component`
|
|
26408
|
-
*
|
|
26409
|
-
*
|
|
26410
|
-
*
|
|
26586
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
26587
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
26588
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
26589
|
+
* that turning it on would not force every consumer of this document to widen
|
|
26590
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
26411
26591
|
*/
|
|
26412
26592
|
var LoggingScopeKindSchema = _enum([
|
|
26413
26593
|
"cluster",
|
|
@@ -26434,6 +26614,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
26434
26614
|
scope: LoggingScopeKindSchema,
|
|
26435
26615
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
26436
26616
|
nodeId: string().nullable(),
|
|
26617
|
+
/**
|
|
26618
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
26619
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
26620
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
26621
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
26622
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
26623
|
+
*/
|
|
26624
|
+
component: string().nullable(),
|
|
26437
26625
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
26438
26626
|
level: LogLevelSchema$1.nullable()
|
|
26439
26627
|
});
|
|
@@ -26475,6 +26663,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
26475
26663
|
reportEveryMs: number().int().positive().optional()
|
|
26476
26664
|
});
|
|
26477
26665
|
/**
|
|
26666
|
+
* A channel ARMED, as the document reports it.
|
|
26667
|
+
*
|
|
26668
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
26669
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
26670
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
26671
|
+
*/
|
|
26672
|
+
var LogChannelWindowStateSchema = object({
|
|
26673
|
+
channel: string(),
|
|
26674
|
+
armed: boolean(),
|
|
26675
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
26676
|
+
armedUntilMs: number(),
|
|
26677
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
26678
|
+
remainingMs: number(),
|
|
26679
|
+
/**
|
|
26680
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
26681
|
+
*
|
|
26682
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
26683
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
26684
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
26685
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
26686
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
26687
|
+
* not.
|
|
26688
|
+
*/
|
|
26689
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
26690
|
+
});
|
|
26691
|
+
/**
|
|
26692
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
26693
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
26694
|
+
*/
|
|
26695
|
+
var LogChannelWindowPatchSchema = object({
|
|
26696
|
+
channel: string().min(1),
|
|
26697
|
+
armMs: number().int().min(0),
|
|
26698
|
+
/**
|
|
26699
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
26700
|
+
*
|
|
26701
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
26702
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
26703
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
26704
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
26705
|
+
*/
|
|
26706
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
26707
|
+
});
|
|
26708
|
+
/**
|
|
26478
26709
|
* A PATCH, and patches MERGE.
|
|
26479
26710
|
*
|
|
26480
26711
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -26493,7 +26724,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
26493
26724
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
26494
26725
|
* keeps running — a patch is never a full replacement.
|
|
26495
26726
|
*/
|
|
26496
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
26727
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
26728
|
+
/**
|
|
26729
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
26730
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
26731
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
26732
|
+
* the Diagnostics page fight over the same value.
|
|
26733
|
+
*/
|
|
26734
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
26497
26735
|
});
|
|
26498
26736
|
/**
|
|
26499
26737
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -26506,9 +26744,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
26506
26744
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
26507
26745
|
* layer selector needs a name the transport does not already own.
|
|
26508
26746
|
*/
|
|
26509
|
-
var GetLoggingSettingsInputSchema = object({
|
|
26747
|
+
var GetLoggingSettingsInputSchema = object({
|
|
26748
|
+
scopeNodeId: string().optional(),
|
|
26749
|
+
/**
|
|
26750
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
26751
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
26752
|
+
*
|
|
26753
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
26754
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
26755
|
+
* not, and one selector for both would make "which of these two did I just
|
|
26756
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
26757
|
+
*/
|
|
26758
|
+
scopeComponent: string().optional()
|
|
26759
|
+
});
|
|
26510
26760
|
var SetLoggingSettingsInputSchema = object({
|
|
26511
26761
|
scopeNodeId: string().optional(),
|
|
26762
|
+
scopeComponent: string().optional(),
|
|
26512
26763
|
patch: LoggingSettingsPatchSchema
|
|
26513
26764
|
});
|
|
26514
26765
|
/**
|
|
@@ -26523,9 +26774,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
26523
26774
|
var LoggingSettingsStateSchema = object({
|
|
26524
26775
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
26525
26776
|
scopeNodeId: string().nullable(),
|
|
26777
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
26778
|
+
scopeComponent: string().nullable(),
|
|
26526
26779
|
effective: LoggingEffectiveSchema,
|
|
26527
26780
|
explicit: LoggingExplicitSchema,
|
|
26528
26781
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
26782
|
+
/**
|
|
26783
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
26784
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
26785
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
26786
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
26787
|
+
*/
|
|
26788
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
26789
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
26790
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
26529
26791
|
persisted: boolean()
|
|
26530
26792
|
});
|
|
26531
26793
|
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(), {
|
|
@@ -28102,6 +28364,12 @@ Object.freeze({
|
|
|
28102
28364
|
addonId: null,
|
|
28103
28365
|
access: "view"
|
|
28104
28366
|
},
|
|
28367
|
+
"dataStoreProvider.aggregate": {
|
|
28368
|
+
capName: "data-store-provider",
|
|
28369
|
+
capScope: "system",
|
|
28370
|
+
addonId: null,
|
|
28371
|
+
access: "view"
|
|
28372
|
+
},
|
|
28105
28373
|
"dataStoreProvider.count": {
|
|
28106
28374
|
capName: "data-store-provider",
|
|
28107
28375
|
capScope: "system",
|
|
@@ -28516,6 +28784,12 @@ Object.freeze({
|
|
|
28516
28784
|
addonId: null,
|
|
28517
28785
|
access: "view"
|
|
28518
28786
|
},
|
|
28787
|
+
"deviceManager.getChildrenBatch": {
|
|
28788
|
+
capName: "device-manager",
|
|
28789
|
+
capScope: "system",
|
|
28790
|
+
addonId: null,
|
|
28791
|
+
access: "view"
|
|
28792
|
+
},
|
|
28519
28793
|
"deviceManager.getConfigSchema": {
|
|
28520
28794
|
capName: "device-manager",
|
|
28521
28795
|
capScope: "system",
|
|
@@ -29566,6 +29840,18 @@ Object.freeze({
|
|
|
29566
29840
|
addonId: null,
|
|
29567
29841
|
access: "create"
|
|
29568
29842
|
},
|
|
29843
|
+
"logChannels.apply": {
|
|
29844
|
+
capName: "log-channels",
|
|
29845
|
+
capScope: "system",
|
|
29846
|
+
addonId: null,
|
|
29847
|
+
access: "create"
|
|
29848
|
+
},
|
|
29849
|
+
"logChannels.list": {
|
|
29850
|
+
capName: "log-channels",
|
|
29851
|
+
capScope: "system",
|
|
29852
|
+
addonId: null,
|
|
29853
|
+
access: "view"
|
|
29854
|
+
},
|
|
29569
29855
|
"logDestination.query": {
|
|
29570
29856
|
capName: "log-destination",
|
|
29571
29857
|
capScope: "system",
|
|
@@ -31720,6 +32006,12 @@ Object.freeze({
|
|
|
31720
32006
|
addonId: null,
|
|
31721
32007
|
access: "create"
|
|
31722
32008
|
},
|
|
32009
|
+
"settingsStore.aggregate": {
|
|
32010
|
+
capName: "settings-store",
|
|
32011
|
+
capScope: "system",
|
|
32012
|
+
addonId: null,
|
|
32013
|
+
access: "view"
|
|
32014
|
+
},
|
|
31723
32015
|
"settingsStore.count": {
|
|
31724
32016
|
capName: "settings-store",
|
|
31725
32017
|
capScope: "system",
|
|
@@ -33299,6 +33591,11 @@ Object.freeze({
|
|
|
33299
33591
|
form: "single",
|
|
33300
33592
|
optional: false
|
|
33301
33593
|
}],
|
|
33594
|
+
"deviceManager.getChildrenBatch": [{
|
|
33595
|
+
name: "parentDeviceIds",
|
|
33596
|
+
form: "array",
|
|
33597
|
+
optional: false
|
|
33598
|
+
}],
|
|
33302
33599
|
"deviceManager.getConfigSchema": [{
|
|
33303
33600
|
name: "deviceId",
|
|
33304
33601
|
form: "single",
|
package/dist/index.mjs
CHANGED
|
@@ -7464,6 +7464,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7464
7464
|
fetchedAt: number()
|
|
7465
7465
|
});
|
|
7466
7466
|
/**
|
|
7467
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7468
|
+
* an addon declares its channels in.
|
|
7469
|
+
*
|
|
7470
|
+
* ## Two axes, deliberately separated
|
|
7471
|
+
*
|
|
7472
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7473
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7474
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7475
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7476
|
+
* `log-channels` capability enumerates the declarations.
|
|
7477
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7478
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7479
|
+
* over the values is the exact defect
|
|
7480
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7481
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7482
|
+
*
|
|
7483
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7484
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7485
|
+
* the hot path with a value somebody actually read, and by
|
|
7486
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7487
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7488
|
+
* disarmed one (D49).
|
|
7489
|
+
*
|
|
7490
|
+
* ## The canonical call shape
|
|
7491
|
+
*
|
|
7492
|
+
* ```ts
|
|
7493
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7494
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7495
|
+
* }
|
|
7496
|
+
* ```
|
|
7497
|
+
*
|
|
7498
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7499
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7500
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7501
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7502
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7503
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7504
|
+
*
|
|
7505
|
+
* ## Why a channel emits at `info`
|
|
7506
|
+
*
|
|
7507
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7508
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7509
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7510
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7511
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7512
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7513
|
+
*/
|
|
7514
|
+
/**
|
|
7515
|
+
* The level a channel writes at once armed.
|
|
7516
|
+
*
|
|
7517
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7518
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7519
|
+
* to read it later.
|
|
7520
|
+
*/
|
|
7521
|
+
var LogChannelLevelSchema = _enum([
|
|
7522
|
+
"info",
|
|
7523
|
+
"warn",
|
|
7524
|
+
"error"
|
|
7525
|
+
]);
|
|
7526
|
+
/**
|
|
7527
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7528
|
+
* declaration is inert.
|
|
7529
|
+
*/
|
|
7530
|
+
var LogChannelDescriptorSchema = object({
|
|
7531
|
+
/**
|
|
7532
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7533
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7534
|
+
* owns it without a second lookup.
|
|
7535
|
+
*/
|
|
7536
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7537
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7538
|
+
description: string().min(1),
|
|
7539
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7540
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7541
|
+
/**
|
|
7542
|
+
* Whether this channel can be narrowed to a camera.
|
|
7543
|
+
*
|
|
7544
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7545
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7546
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7547
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7548
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7549
|
+
* the body is the only way to filter.
|
|
7550
|
+
*
|
|
7551
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7552
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7553
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7554
|
+
* path was never taken.
|
|
7555
|
+
*/
|
|
7556
|
+
perDevice: boolean()
|
|
7557
|
+
});
|
|
7558
|
+
/**
|
|
7559
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7560
|
+
*
|
|
7561
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7562
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7563
|
+
*/
|
|
7564
|
+
var LogChannelWindowSchema = object({
|
|
7565
|
+
channel: string().min(1),
|
|
7566
|
+
/** Epoch ms the window closes at. */
|
|
7567
|
+
armedUntilMs: number(),
|
|
7568
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7569
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7570
|
+
});
|
|
7571
|
+
/**
|
|
7467
7572
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7468
7573
|
* recordings and events management surfaces.
|
|
7469
7574
|
*
|
|
@@ -11019,6 +11124,35 @@ var MutationFilterSchema = object({
|
|
|
11019
11124
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11020
11125
|
whereNot: record(string(), unknown()).optional()
|
|
11021
11126
|
});
|
|
11127
|
+
/**
|
|
11128
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11129
|
+
*
|
|
11130
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11131
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11132
|
+
* a `Record<column, op>` shape could not express.
|
|
11133
|
+
*/
|
|
11134
|
+
var AggregateFieldSchema = object({
|
|
11135
|
+
/** Result key. */
|
|
11136
|
+
as: string().min(1),
|
|
11137
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11138
|
+
field: string().min(1),
|
|
11139
|
+
op: _enum([
|
|
11140
|
+
"sum",
|
|
11141
|
+
"min",
|
|
11142
|
+
"max"
|
|
11143
|
+
])
|
|
11144
|
+
});
|
|
11145
|
+
/**
|
|
11146
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11147
|
+
*
|
|
11148
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11149
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11150
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11151
|
+
*/
|
|
11152
|
+
var AggregateResultSchema = object({
|
|
11153
|
+
count: number().int(),
|
|
11154
|
+
values: record(string(), number().nullable())
|
|
11155
|
+
});
|
|
11022
11156
|
/** A single stored record: `{ id, data }`. */
|
|
11023
11157
|
var SettingsRecordSchema = object({
|
|
11024
11158
|
id: string(),
|
|
@@ -11103,6 +11237,11 @@ method(object({
|
|
|
11103
11237
|
collection: string(),
|
|
11104
11238
|
filter: QueryFilterSchema.optional()
|
|
11105
11239
|
}), number()), method(object({
|
|
11240
|
+
namespace: string().optional(),
|
|
11241
|
+
collection: string(),
|
|
11242
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11243
|
+
filter: QueryFilterSchema.optional()
|
|
11244
|
+
}), AggregateResultSchema), method(object({
|
|
11106
11245
|
namespace: string().optional(),
|
|
11107
11246
|
collection: string(),
|
|
11108
11247
|
field: string(),
|
|
@@ -11219,6 +11358,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11219
11358
|
collection: string(),
|
|
11220
11359
|
filter: QueryFilterSchema.optional()
|
|
11221
11360
|
}), number(), { auth: "admin" }), method(object({
|
|
11361
|
+
namespace: string().optional(),
|
|
11362
|
+
collection: string(),
|
|
11363
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11364
|
+
filter: QueryFilterSchema.optional()
|
|
11365
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11222
11366
|
namespace: string().optional(),
|
|
11223
11367
|
collection: string(),
|
|
11224
11368
|
field: string(),
|
|
@@ -11873,24 +12017,6 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
|
|
|
11873
12017
|
kind: "mutation",
|
|
11874
12018
|
auth: "admin"
|
|
11875
12019
|
});
|
|
11876
|
-
/**
|
|
11877
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
11878
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
11879
|
-
*
|
|
11880
|
-
* Replaces:
|
|
11881
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
11882
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
11883
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
11884
|
-
*
|
|
11885
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
11886
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
11887
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
11888
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
11889
|
-
* - No shadow registry or cross-node aggregation required.
|
|
11890
|
-
*
|
|
11891
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
11892
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
11893
|
-
*/
|
|
11894
12020
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
11895
12021
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
11896
12022
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12259,7 +12385,7 @@ method(object({
|
|
|
12259
12385
|
* it answers today and the caller filters as it already does.
|
|
12260
12386
|
*/
|
|
12261
12387
|
deviceIds: array(number()).optional()
|
|
12262
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12388
|
+
}), 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({
|
|
12263
12389
|
mode: LinkedDevicesModeSchema,
|
|
12264
12390
|
devices: array(LinkedDeviceSchema)
|
|
12265
12391
|
})), 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({
|
|
@@ -12983,6 +13109,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
12983
13109
|
kind: "mutation",
|
|
12984
13110
|
auth: "admin"
|
|
12985
13111
|
});
|
|
13112
|
+
/**
|
|
13113
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13114
|
+
* through. It stores nothing.
|
|
13115
|
+
*
|
|
13116
|
+
* ## Why a capability at all, and why this shape
|
|
13117
|
+
*
|
|
13118
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13119
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13120
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13121
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13122
|
+
* is assembled from declarations at runtime.
|
|
13123
|
+
*
|
|
13124
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13125
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13126
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13127
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13128
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13129
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13130
|
+
* No new UDS message, no second registry.
|
|
13131
|
+
*
|
|
13132
|
+
* ## What it deliberately does NOT own
|
|
13133
|
+
*
|
|
13134
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13135
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13136
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13137
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13138
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13139
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13140
|
+
* setter for a window and no persistence of any kind.
|
|
13141
|
+
*
|
|
13142
|
+
* ## Why `apply` is here even so
|
|
13143
|
+
*
|
|
13144
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13145
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13146
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13147
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13148
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13149
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13150
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13151
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13152
|
+
*/
|
|
13153
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13154
|
+
var LogChannelApplyResultSchema = object({
|
|
13155
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13156
|
+
armed: number().int().min(0),
|
|
13157
|
+
/**
|
|
13158
|
+
* Names the document armed that this process does not declare. Reported
|
|
13159
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13160
|
+
* not booted, and both deserve a line instead of silence.
|
|
13161
|
+
*/
|
|
13162
|
+
unknown: array(string()).readonly()
|
|
13163
|
+
});
|
|
13164
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
12986
13165
|
var LogLevelSchema = _enum([
|
|
12987
13166
|
"debug",
|
|
12988
13167
|
"info",
|
|
@@ -26400,10 +26579,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
26400
26579
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
26401
26580
|
* layer that carries an explicit value wins.
|
|
26402
26581
|
*
|
|
26403
|
-
* `component`
|
|
26404
|
-
*
|
|
26405
|
-
*
|
|
26406
|
-
*
|
|
26582
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
26583
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
26584
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
26585
|
+
* that turning it on would not force every consumer of this document to widen
|
|
26586
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
26407
26587
|
*/
|
|
26408
26588
|
var LoggingScopeKindSchema = _enum([
|
|
26409
26589
|
"cluster",
|
|
@@ -26430,6 +26610,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
26430
26610
|
scope: LoggingScopeKindSchema,
|
|
26431
26611
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
26432
26612
|
nodeId: string().nullable(),
|
|
26613
|
+
/**
|
|
26614
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
26615
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
26616
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
26617
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
26618
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
26619
|
+
*/
|
|
26620
|
+
component: string().nullable(),
|
|
26433
26621
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
26434
26622
|
level: LogLevelSchema$1.nullable()
|
|
26435
26623
|
});
|
|
@@ -26471,6 +26659,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
26471
26659
|
reportEveryMs: number().int().positive().optional()
|
|
26472
26660
|
});
|
|
26473
26661
|
/**
|
|
26662
|
+
* A channel ARMED, as the document reports it.
|
|
26663
|
+
*
|
|
26664
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
26665
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
26666
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
26667
|
+
*/
|
|
26668
|
+
var LogChannelWindowStateSchema = object({
|
|
26669
|
+
channel: string(),
|
|
26670
|
+
armed: boolean(),
|
|
26671
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
26672
|
+
armedUntilMs: number(),
|
|
26673
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
26674
|
+
remainingMs: number(),
|
|
26675
|
+
/**
|
|
26676
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
26677
|
+
*
|
|
26678
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
26679
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
26680
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
26681
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
26682
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
26683
|
+
* not.
|
|
26684
|
+
*/
|
|
26685
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
26686
|
+
});
|
|
26687
|
+
/**
|
|
26688
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
26689
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
26690
|
+
*/
|
|
26691
|
+
var LogChannelWindowPatchSchema = object({
|
|
26692
|
+
channel: string().min(1),
|
|
26693
|
+
armMs: number().int().min(0),
|
|
26694
|
+
/**
|
|
26695
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
26696
|
+
*
|
|
26697
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
26698
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
26699
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
26700
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
26701
|
+
*/
|
|
26702
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
26703
|
+
});
|
|
26704
|
+
/**
|
|
26474
26705
|
* A PATCH, and patches MERGE.
|
|
26475
26706
|
*
|
|
26476
26707
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -26489,7 +26720,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
26489
26720
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
26490
26721
|
* keeps running — a patch is never a full replacement.
|
|
26491
26722
|
*/
|
|
26492
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
26723
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
26724
|
+
/**
|
|
26725
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
26726
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
26727
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
26728
|
+
* the Diagnostics page fight over the same value.
|
|
26729
|
+
*/
|
|
26730
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
26493
26731
|
});
|
|
26494
26732
|
/**
|
|
26495
26733
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -26502,9 +26740,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
26502
26740
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
26503
26741
|
* layer selector needs a name the transport does not already own.
|
|
26504
26742
|
*/
|
|
26505
|
-
var GetLoggingSettingsInputSchema = object({
|
|
26743
|
+
var GetLoggingSettingsInputSchema = object({
|
|
26744
|
+
scopeNodeId: string().optional(),
|
|
26745
|
+
/**
|
|
26746
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
26747
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
26748
|
+
*
|
|
26749
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
26750
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
26751
|
+
* not, and one selector for both would make "which of these two did I just
|
|
26752
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
26753
|
+
*/
|
|
26754
|
+
scopeComponent: string().optional()
|
|
26755
|
+
});
|
|
26506
26756
|
var SetLoggingSettingsInputSchema = object({
|
|
26507
26757
|
scopeNodeId: string().optional(),
|
|
26758
|
+
scopeComponent: string().optional(),
|
|
26508
26759
|
patch: LoggingSettingsPatchSchema
|
|
26509
26760
|
});
|
|
26510
26761
|
/**
|
|
@@ -26519,9 +26770,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
26519
26770
|
var LoggingSettingsStateSchema = object({
|
|
26520
26771
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
26521
26772
|
scopeNodeId: string().nullable(),
|
|
26773
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
26774
|
+
scopeComponent: string().nullable(),
|
|
26522
26775
|
effective: LoggingEffectiveSchema,
|
|
26523
26776
|
explicit: LoggingExplicitSchema,
|
|
26524
26777
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
26778
|
+
/**
|
|
26779
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
26780
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
26781
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
26782
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
26783
|
+
*/
|
|
26784
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
26785
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
26786
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
26525
26787
|
persisted: boolean()
|
|
26526
26788
|
});
|
|
26527
26789
|
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(), {
|
|
@@ -28098,6 +28360,12 @@ Object.freeze({
|
|
|
28098
28360
|
addonId: null,
|
|
28099
28361
|
access: "view"
|
|
28100
28362
|
},
|
|
28363
|
+
"dataStoreProvider.aggregate": {
|
|
28364
|
+
capName: "data-store-provider",
|
|
28365
|
+
capScope: "system",
|
|
28366
|
+
addonId: null,
|
|
28367
|
+
access: "view"
|
|
28368
|
+
},
|
|
28101
28369
|
"dataStoreProvider.count": {
|
|
28102
28370
|
capName: "data-store-provider",
|
|
28103
28371
|
capScope: "system",
|
|
@@ -28512,6 +28780,12 @@ Object.freeze({
|
|
|
28512
28780
|
addonId: null,
|
|
28513
28781
|
access: "view"
|
|
28514
28782
|
},
|
|
28783
|
+
"deviceManager.getChildrenBatch": {
|
|
28784
|
+
capName: "device-manager",
|
|
28785
|
+
capScope: "system",
|
|
28786
|
+
addonId: null,
|
|
28787
|
+
access: "view"
|
|
28788
|
+
},
|
|
28515
28789
|
"deviceManager.getConfigSchema": {
|
|
28516
28790
|
capName: "device-manager",
|
|
28517
28791
|
capScope: "system",
|
|
@@ -29562,6 +29836,18 @@ Object.freeze({
|
|
|
29562
29836
|
addonId: null,
|
|
29563
29837
|
access: "create"
|
|
29564
29838
|
},
|
|
29839
|
+
"logChannels.apply": {
|
|
29840
|
+
capName: "log-channels",
|
|
29841
|
+
capScope: "system",
|
|
29842
|
+
addonId: null,
|
|
29843
|
+
access: "create"
|
|
29844
|
+
},
|
|
29845
|
+
"logChannels.list": {
|
|
29846
|
+
capName: "log-channels",
|
|
29847
|
+
capScope: "system",
|
|
29848
|
+
addonId: null,
|
|
29849
|
+
access: "view"
|
|
29850
|
+
},
|
|
29565
29851
|
"logDestination.query": {
|
|
29566
29852
|
capName: "log-destination",
|
|
29567
29853
|
capScope: "system",
|
|
@@ -31716,6 +32002,12 @@ Object.freeze({
|
|
|
31716
32002
|
addonId: null,
|
|
31717
32003
|
access: "create"
|
|
31718
32004
|
},
|
|
32005
|
+
"settingsStore.aggregate": {
|
|
32006
|
+
capName: "settings-store",
|
|
32007
|
+
capScope: "system",
|
|
32008
|
+
addonId: null,
|
|
32009
|
+
access: "view"
|
|
32010
|
+
},
|
|
31719
32011
|
"settingsStore.count": {
|
|
31720
32012
|
capName: "settings-store",
|
|
31721
32013
|
capScope: "system",
|
|
@@ -33295,6 +33587,11 @@ Object.freeze({
|
|
|
33295
33587
|
form: "single",
|
|
33296
33588
|
optional: false
|
|
33297
33589
|
}],
|
|
33590
|
+
"deviceManager.getChildrenBatch": [{
|
|
33591
|
+
name: "parentDeviceIds",
|
|
33592
|
+
form: "array",
|
|
33593
|
+
optional: false
|
|
33594
|
+
}],
|
|
33298
33595
|
"deviceManager.getConfigSchema": [{
|
|
33299
33596
|
name: "deviceId",
|
|
33300
33597
|
form: "single",
|