@camstack/addon-provider-dreo 0.2.33 → 0.2.34
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
|
@@ -7504,6 +7504,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7504
7504
|
fetchedAt: number()
|
|
7505
7505
|
});
|
|
7506
7506
|
/**
|
|
7507
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7508
|
+
* an addon declares its channels in.
|
|
7509
|
+
*
|
|
7510
|
+
* ## Two axes, deliberately separated
|
|
7511
|
+
*
|
|
7512
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7513
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7514
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7515
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7516
|
+
* `log-channels` capability enumerates the declarations.
|
|
7517
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7518
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7519
|
+
* over the values is the exact defect
|
|
7520
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7521
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7522
|
+
*
|
|
7523
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7524
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7525
|
+
* the hot path with a value somebody actually read, and by
|
|
7526
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7527
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7528
|
+
* disarmed one (D49).
|
|
7529
|
+
*
|
|
7530
|
+
* ## The canonical call shape
|
|
7531
|
+
*
|
|
7532
|
+
* ```ts
|
|
7533
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7534
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7535
|
+
* }
|
|
7536
|
+
* ```
|
|
7537
|
+
*
|
|
7538
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7539
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7540
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7541
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7542
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7543
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7544
|
+
*
|
|
7545
|
+
* ## Why a channel emits at `info`
|
|
7546
|
+
*
|
|
7547
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7548
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7549
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7550
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7551
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7552
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7553
|
+
*/
|
|
7554
|
+
/**
|
|
7555
|
+
* The level a channel writes at once armed.
|
|
7556
|
+
*
|
|
7557
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7558
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7559
|
+
* to read it later.
|
|
7560
|
+
*/
|
|
7561
|
+
var LogChannelLevelSchema = _enum([
|
|
7562
|
+
"info",
|
|
7563
|
+
"warn",
|
|
7564
|
+
"error"
|
|
7565
|
+
]);
|
|
7566
|
+
/**
|
|
7567
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7568
|
+
* declaration is inert.
|
|
7569
|
+
*/
|
|
7570
|
+
var LogChannelDescriptorSchema = object({
|
|
7571
|
+
/**
|
|
7572
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7573
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7574
|
+
* owns it without a second lookup.
|
|
7575
|
+
*/
|
|
7576
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7577
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7578
|
+
description: string().min(1),
|
|
7579
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7580
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7581
|
+
/**
|
|
7582
|
+
* Whether this channel can be narrowed to a camera.
|
|
7583
|
+
*
|
|
7584
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7585
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7586
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7587
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7588
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7589
|
+
* the body is the only way to filter.
|
|
7590
|
+
*
|
|
7591
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7592
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7593
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7594
|
+
* path was never taken.
|
|
7595
|
+
*/
|
|
7596
|
+
perDevice: boolean()
|
|
7597
|
+
});
|
|
7598
|
+
/**
|
|
7599
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7600
|
+
*
|
|
7601
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7602
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7603
|
+
*/
|
|
7604
|
+
var LogChannelWindowSchema = object({
|
|
7605
|
+
channel: string().min(1),
|
|
7606
|
+
/** Epoch ms the window closes at. */
|
|
7607
|
+
armedUntilMs: number(),
|
|
7608
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7609
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7610
|
+
});
|
|
7611
|
+
/**
|
|
7507
7612
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7508
7613
|
* recordings and events management surfaces.
|
|
7509
7614
|
*
|
|
@@ -11124,6 +11229,35 @@ var MutationFilterSchema = object({
|
|
|
11124
11229
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11125
11230
|
whereNot: record(string(), unknown()).optional()
|
|
11126
11231
|
});
|
|
11232
|
+
/**
|
|
11233
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11234
|
+
*
|
|
11235
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11236
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11237
|
+
* a `Record<column, op>` shape could not express.
|
|
11238
|
+
*/
|
|
11239
|
+
var AggregateFieldSchema = object({
|
|
11240
|
+
/** Result key. */
|
|
11241
|
+
as: string().min(1),
|
|
11242
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11243
|
+
field: string().min(1),
|
|
11244
|
+
op: _enum([
|
|
11245
|
+
"sum",
|
|
11246
|
+
"min",
|
|
11247
|
+
"max"
|
|
11248
|
+
])
|
|
11249
|
+
});
|
|
11250
|
+
/**
|
|
11251
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11252
|
+
*
|
|
11253
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11254
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11255
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11256
|
+
*/
|
|
11257
|
+
var AggregateResultSchema = object({
|
|
11258
|
+
count: number().int(),
|
|
11259
|
+
values: record(string(), number().nullable())
|
|
11260
|
+
});
|
|
11127
11261
|
/** A single stored record: `{ id, data }`. */
|
|
11128
11262
|
var SettingsRecordSchema = object({
|
|
11129
11263
|
id: string(),
|
|
@@ -11208,6 +11342,11 @@ method(object({
|
|
|
11208
11342
|
collection: string(),
|
|
11209
11343
|
filter: QueryFilterSchema.optional()
|
|
11210
11344
|
}), number()), method(object({
|
|
11345
|
+
namespace: string().optional(),
|
|
11346
|
+
collection: string(),
|
|
11347
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11348
|
+
filter: QueryFilterSchema.optional()
|
|
11349
|
+
}), AggregateResultSchema), method(object({
|
|
11211
11350
|
namespace: string().optional(),
|
|
11212
11351
|
collection: string(),
|
|
11213
11352
|
field: string(),
|
|
@@ -11324,6 +11463,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11324
11463
|
collection: string(),
|
|
11325
11464
|
filter: QueryFilterSchema.optional()
|
|
11326
11465
|
}), number(), { auth: "admin" }), method(object({
|
|
11466
|
+
namespace: string().optional(),
|
|
11467
|
+
collection: string(),
|
|
11468
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11469
|
+
filter: QueryFilterSchema.optional()
|
|
11470
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11327
11471
|
namespace: string().optional(),
|
|
11328
11472
|
collection: string(),
|
|
11329
11473
|
field: string(),
|
|
@@ -12064,24 +12208,6 @@ var deviceProviderCapability = {
|
|
|
12064
12208
|
})
|
|
12065
12209
|
}
|
|
12066
12210
|
};
|
|
12067
|
-
/**
|
|
12068
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12069
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12070
|
-
*
|
|
12071
|
-
* Replaces:
|
|
12072
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12073
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12074
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12075
|
-
*
|
|
12076
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12077
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12078
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12079
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12080
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12081
|
-
*
|
|
12082
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12083
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12084
|
-
*/
|
|
12085
12211
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12086
12212
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12087
12213
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12450,7 +12576,7 @@ method(object({
|
|
|
12450
12576
|
* it answers today and the caller filters as it already does.
|
|
12451
12577
|
*/
|
|
12452
12578
|
deviceIds: array(number()).optional()
|
|
12453
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12579
|
+
}), 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({
|
|
12454
12580
|
mode: LinkedDevicesModeSchema,
|
|
12455
12581
|
devices: array(LinkedDeviceSchema)
|
|
12456
12582
|
})), 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({
|
|
@@ -13174,6 +13300,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13174
13300
|
kind: "mutation",
|
|
13175
13301
|
auth: "admin"
|
|
13176
13302
|
});
|
|
13303
|
+
/**
|
|
13304
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13305
|
+
* through. It stores nothing.
|
|
13306
|
+
*
|
|
13307
|
+
* ## Why a capability at all, and why this shape
|
|
13308
|
+
*
|
|
13309
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13310
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13311
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13312
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13313
|
+
* is assembled from declarations at runtime.
|
|
13314
|
+
*
|
|
13315
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13316
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13317
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13318
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13319
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13320
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13321
|
+
* No new UDS message, no second registry.
|
|
13322
|
+
*
|
|
13323
|
+
* ## What it deliberately does NOT own
|
|
13324
|
+
*
|
|
13325
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13326
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13327
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13328
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13329
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13330
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13331
|
+
* setter for a window and no persistence of any kind.
|
|
13332
|
+
*
|
|
13333
|
+
* ## Why `apply` is here even so
|
|
13334
|
+
*
|
|
13335
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13336
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13337
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13338
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13339
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13340
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13341
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13342
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13343
|
+
*/
|
|
13344
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13345
|
+
var LogChannelApplyResultSchema = object({
|
|
13346
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13347
|
+
armed: number().int().min(0),
|
|
13348
|
+
/**
|
|
13349
|
+
* Names the document armed that this process does not declare. Reported
|
|
13350
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13351
|
+
* not booted, and both deserve a line instead of silence.
|
|
13352
|
+
*/
|
|
13353
|
+
unknown: array(string()).readonly()
|
|
13354
|
+
});
|
|
13355
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13177
13356
|
var LogLevelSchema = _enum([
|
|
13178
13357
|
"debug",
|
|
13179
13358
|
"info",
|
|
@@ -28626,10 +28805,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
28626
28805
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
28627
28806
|
* layer that carries an explicit value wins.
|
|
28628
28807
|
*
|
|
28629
|
-
* `component`
|
|
28630
|
-
*
|
|
28631
|
-
*
|
|
28632
|
-
*
|
|
28808
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
28809
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
28810
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
28811
|
+
* that turning it on would not force every consumer of this document to widen
|
|
28812
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
28633
28813
|
*/
|
|
28634
28814
|
var LoggingScopeKindSchema = _enum([
|
|
28635
28815
|
"cluster",
|
|
@@ -28656,6 +28836,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
28656
28836
|
scope: LoggingScopeKindSchema,
|
|
28657
28837
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
28658
28838
|
nodeId: string().nullable(),
|
|
28839
|
+
/**
|
|
28840
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
28841
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
28842
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
28843
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
28844
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
28845
|
+
*/
|
|
28846
|
+
component: string().nullable(),
|
|
28659
28847
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
28660
28848
|
level: LogLevelSchema$1.nullable()
|
|
28661
28849
|
});
|
|
@@ -28697,6 +28885,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
28697
28885
|
reportEveryMs: number().int().positive().optional()
|
|
28698
28886
|
});
|
|
28699
28887
|
/**
|
|
28888
|
+
* A channel ARMED, as the document reports it.
|
|
28889
|
+
*
|
|
28890
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
28891
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
28892
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
28893
|
+
*/
|
|
28894
|
+
var LogChannelWindowStateSchema = object({
|
|
28895
|
+
channel: string(),
|
|
28896
|
+
armed: boolean(),
|
|
28897
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
28898
|
+
armedUntilMs: number(),
|
|
28899
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
28900
|
+
remainingMs: number(),
|
|
28901
|
+
/**
|
|
28902
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
28903
|
+
*
|
|
28904
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
28905
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
28906
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
28907
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
28908
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
28909
|
+
* not.
|
|
28910
|
+
*/
|
|
28911
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
28912
|
+
});
|
|
28913
|
+
/**
|
|
28914
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
28915
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
28916
|
+
*/
|
|
28917
|
+
var LogChannelWindowPatchSchema = object({
|
|
28918
|
+
channel: string().min(1),
|
|
28919
|
+
armMs: number().int().min(0),
|
|
28920
|
+
/**
|
|
28921
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
28922
|
+
*
|
|
28923
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
28924
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
28925
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
28926
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
28927
|
+
*/
|
|
28928
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
28929
|
+
});
|
|
28930
|
+
/**
|
|
28700
28931
|
* A PATCH, and patches MERGE.
|
|
28701
28932
|
*
|
|
28702
28933
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -28715,7 +28946,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28715
28946
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
28716
28947
|
* keeps running — a patch is never a full replacement.
|
|
28717
28948
|
*/
|
|
28718
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
28949
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
28950
|
+
/**
|
|
28951
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
28952
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
28953
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
28954
|
+
* the Diagnostics page fight over the same value.
|
|
28955
|
+
*/
|
|
28956
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
28719
28957
|
});
|
|
28720
28958
|
/**
|
|
28721
28959
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -28728,9 +28966,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28728
28966
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
28729
28967
|
* layer selector needs a name the transport does not already own.
|
|
28730
28968
|
*/
|
|
28731
|
-
var GetLoggingSettingsInputSchema = object({
|
|
28969
|
+
var GetLoggingSettingsInputSchema = object({
|
|
28970
|
+
scopeNodeId: string().optional(),
|
|
28971
|
+
/**
|
|
28972
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
28973
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
28974
|
+
*
|
|
28975
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
28976
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
28977
|
+
* not, and one selector for both would make "which of these two did I just
|
|
28978
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
28979
|
+
*/
|
|
28980
|
+
scopeComponent: string().optional()
|
|
28981
|
+
});
|
|
28732
28982
|
var SetLoggingSettingsInputSchema = object({
|
|
28733
28983
|
scopeNodeId: string().optional(),
|
|
28984
|
+
scopeComponent: string().optional(),
|
|
28734
28985
|
patch: LoggingSettingsPatchSchema
|
|
28735
28986
|
});
|
|
28736
28987
|
/**
|
|
@@ -28745,9 +28996,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
28745
28996
|
var LoggingSettingsStateSchema = object({
|
|
28746
28997
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
28747
28998
|
scopeNodeId: string().nullable(),
|
|
28999
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
29000
|
+
scopeComponent: string().nullable(),
|
|
28748
29001
|
effective: LoggingEffectiveSchema,
|
|
28749
29002
|
explicit: LoggingExplicitSchema,
|
|
28750
29003
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
29004
|
+
/**
|
|
29005
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
29006
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
29007
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
29008
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
29009
|
+
*/
|
|
29010
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
29011
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
29012
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
28751
29013
|
persisted: boolean()
|
|
28752
29014
|
});
|
|
28753
29015
|
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(), {
|
|
@@ -31732,6 +31994,12 @@ Object.freeze({
|
|
|
31732
31994
|
addonId: null,
|
|
31733
31995
|
access: "view"
|
|
31734
31996
|
},
|
|
31997
|
+
"dataStoreProvider.aggregate": {
|
|
31998
|
+
capName: "data-store-provider",
|
|
31999
|
+
capScope: "system",
|
|
32000
|
+
addonId: null,
|
|
32001
|
+
access: "view"
|
|
32002
|
+
},
|
|
31735
32003
|
"dataStoreProvider.count": {
|
|
31736
32004
|
capName: "data-store-provider",
|
|
31737
32005
|
capScope: "system",
|
|
@@ -32146,6 +32414,12 @@ Object.freeze({
|
|
|
32146
32414
|
addonId: null,
|
|
32147
32415
|
access: "view"
|
|
32148
32416
|
},
|
|
32417
|
+
"deviceManager.getChildrenBatch": {
|
|
32418
|
+
capName: "device-manager",
|
|
32419
|
+
capScope: "system",
|
|
32420
|
+
addonId: null,
|
|
32421
|
+
access: "view"
|
|
32422
|
+
},
|
|
32149
32423
|
"deviceManager.getConfigSchema": {
|
|
32150
32424
|
capName: "device-manager",
|
|
32151
32425
|
capScope: "system",
|
|
@@ -33196,6 +33470,18 @@ Object.freeze({
|
|
|
33196
33470
|
addonId: null,
|
|
33197
33471
|
access: "create"
|
|
33198
33472
|
},
|
|
33473
|
+
"logChannels.apply": {
|
|
33474
|
+
capName: "log-channels",
|
|
33475
|
+
capScope: "system",
|
|
33476
|
+
addonId: null,
|
|
33477
|
+
access: "create"
|
|
33478
|
+
},
|
|
33479
|
+
"logChannels.list": {
|
|
33480
|
+
capName: "log-channels",
|
|
33481
|
+
capScope: "system",
|
|
33482
|
+
addonId: null,
|
|
33483
|
+
access: "view"
|
|
33484
|
+
},
|
|
33199
33485
|
"logDestination.query": {
|
|
33200
33486
|
capName: "log-destination",
|
|
33201
33487
|
capScope: "system",
|
|
@@ -35350,6 +35636,12 @@ Object.freeze({
|
|
|
35350
35636
|
addonId: null,
|
|
35351
35637
|
access: "create"
|
|
35352
35638
|
},
|
|
35639
|
+
"settingsStore.aggregate": {
|
|
35640
|
+
capName: "settings-store",
|
|
35641
|
+
capScope: "system",
|
|
35642
|
+
addonId: null,
|
|
35643
|
+
access: "view"
|
|
35644
|
+
},
|
|
35353
35645
|
"settingsStore.count": {
|
|
35354
35646
|
capName: "settings-store",
|
|
35355
35647
|
capScope: "system",
|
|
@@ -36929,6 +37221,11 @@ Object.freeze({
|
|
|
36929
37221
|
form: "single",
|
|
36930
37222
|
optional: false
|
|
36931
37223
|
}],
|
|
37224
|
+
"deviceManager.getChildrenBatch": [{
|
|
37225
|
+
name: "parentDeviceIds",
|
|
37226
|
+
form: "array",
|
|
37227
|
+
optional: false
|
|
37228
|
+
}],
|
|
36932
37229
|
"deviceManager.getConfigSchema": [{
|
|
36933
37230
|
name: "deviceId",
|
|
36934
37231
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -7505,6 +7505,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7505
7505
|
fetchedAt: number()
|
|
7506
7506
|
});
|
|
7507
7507
|
/**
|
|
7508
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7509
|
+
* an addon declares its channels in.
|
|
7510
|
+
*
|
|
7511
|
+
* ## Two axes, deliberately separated
|
|
7512
|
+
*
|
|
7513
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7514
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7515
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7516
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7517
|
+
* `log-channels` capability enumerates the declarations.
|
|
7518
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7519
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7520
|
+
* over the values is the exact defect
|
|
7521
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7522
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7523
|
+
*
|
|
7524
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7525
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7526
|
+
* the hot path with a value somebody actually read, and by
|
|
7527
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7528
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7529
|
+
* disarmed one (D49).
|
|
7530
|
+
*
|
|
7531
|
+
* ## The canonical call shape
|
|
7532
|
+
*
|
|
7533
|
+
* ```ts
|
|
7534
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7535
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7536
|
+
* }
|
|
7537
|
+
* ```
|
|
7538
|
+
*
|
|
7539
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7540
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7541
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7542
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7543
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7544
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7545
|
+
*
|
|
7546
|
+
* ## Why a channel emits at `info`
|
|
7547
|
+
*
|
|
7548
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7549
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7550
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7551
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7552
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7553
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7554
|
+
*/
|
|
7555
|
+
/**
|
|
7556
|
+
* The level a channel writes at once armed.
|
|
7557
|
+
*
|
|
7558
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7559
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7560
|
+
* to read it later.
|
|
7561
|
+
*/
|
|
7562
|
+
var LogChannelLevelSchema = _enum([
|
|
7563
|
+
"info",
|
|
7564
|
+
"warn",
|
|
7565
|
+
"error"
|
|
7566
|
+
]);
|
|
7567
|
+
/**
|
|
7568
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7569
|
+
* declaration is inert.
|
|
7570
|
+
*/
|
|
7571
|
+
var LogChannelDescriptorSchema = object({
|
|
7572
|
+
/**
|
|
7573
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7574
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7575
|
+
* owns it without a second lookup.
|
|
7576
|
+
*/
|
|
7577
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7578
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7579
|
+
description: string().min(1),
|
|
7580
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7581
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7582
|
+
/**
|
|
7583
|
+
* Whether this channel can be narrowed to a camera.
|
|
7584
|
+
*
|
|
7585
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7586
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7587
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7588
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7589
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7590
|
+
* the body is the only way to filter.
|
|
7591
|
+
*
|
|
7592
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7593
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7594
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7595
|
+
* path was never taken.
|
|
7596
|
+
*/
|
|
7597
|
+
perDevice: boolean()
|
|
7598
|
+
});
|
|
7599
|
+
/**
|
|
7600
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7601
|
+
*
|
|
7602
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7603
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7604
|
+
*/
|
|
7605
|
+
var LogChannelWindowSchema = object({
|
|
7606
|
+
channel: string().min(1),
|
|
7607
|
+
/** Epoch ms the window closes at. */
|
|
7608
|
+
armedUntilMs: number(),
|
|
7609
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7610
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7611
|
+
});
|
|
7612
|
+
/**
|
|
7508
7613
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7509
7614
|
* recordings and events management surfaces.
|
|
7510
7615
|
*
|
|
@@ -11125,6 +11230,35 @@ var MutationFilterSchema = object({
|
|
|
11125
11230
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11126
11231
|
whereNot: record(string(), unknown()).optional()
|
|
11127
11232
|
});
|
|
11233
|
+
/**
|
|
11234
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11235
|
+
*
|
|
11236
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11237
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11238
|
+
* a `Record<column, op>` shape could not express.
|
|
11239
|
+
*/
|
|
11240
|
+
var AggregateFieldSchema = object({
|
|
11241
|
+
/** Result key. */
|
|
11242
|
+
as: string().min(1),
|
|
11243
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11244
|
+
field: string().min(1),
|
|
11245
|
+
op: _enum([
|
|
11246
|
+
"sum",
|
|
11247
|
+
"min",
|
|
11248
|
+
"max"
|
|
11249
|
+
])
|
|
11250
|
+
});
|
|
11251
|
+
/**
|
|
11252
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11253
|
+
*
|
|
11254
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11255
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11256
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11257
|
+
*/
|
|
11258
|
+
var AggregateResultSchema = object({
|
|
11259
|
+
count: number().int(),
|
|
11260
|
+
values: record(string(), number().nullable())
|
|
11261
|
+
});
|
|
11128
11262
|
/** A single stored record: `{ id, data }`. */
|
|
11129
11263
|
var SettingsRecordSchema = object({
|
|
11130
11264
|
id: string(),
|
|
@@ -11209,6 +11343,11 @@ method(object({
|
|
|
11209
11343
|
collection: string(),
|
|
11210
11344
|
filter: QueryFilterSchema.optional()
|
|
11211
11345
|
}), number()), method(object({
|
|
11346
|
+
namespace: string().optional(),
|
|
11347
|
+
collection: string(),
|
|
11348
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11349
|
+
filter: QueryFilterSchema.optional()
|
|
11350
|
+
}), AggregateResultSchema), method(object({
|
|
11212
11351
|
namespace: string().optional(),
|
|
11213
11352
|
collection: string(),
|
|
11214
11353
|
field: string(),
|
|
@@ -11325,6 +11464,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11325
11464
|
collection: string(),
|
|
11326
11465
|
filter: QueryFilterSchema.optional()
|
|
11327
11466
|
}), number(), { auth: "admin" }), method(object({
|
|
11467
|
+
namespace: string().optional(),
|
|
11468
|
+
collection: string(),
|
|
11469
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11470
|
+
filter: QueryFilterSchema.optional()
|
|
11471
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11328
11472
|
namespace: string().optional(),
|
|
11329
11473
|
collection: string(),
|
|
11330
11474
|
field: string(),
|
|
@@ -12065,24 +12209,6 @@ var deviceProviderCapability = {
|
|
|
12065
12209
|
})
|
|
12066
12210
|
}
|
|
12067
12211
|
};
|
|
12068
|
-
/**
|
|
12069
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12070
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12071
|
-
*
|
|
12072
|
-
* Replaces:
|
|
12073
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12074
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12075
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12076
|
-
*
|
|
12077
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12078
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12079
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12080
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12081
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12082
|
-
*
|
|
12083
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12084
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12085
|
-
*/
|
|
12086
12212
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12087
12213
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12088
12214
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12451,7 +12577,7 @@ method(object({
|
|
|
12451
12577
|
* it answers today and the caller filters as it already does.
|
|
12452
12578
|
*/
|
|
12453
12579
|
deviceIds: array(number()).optional()
|
|
12454
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12580
|
+
}), 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({
|
|
12455
12581
|
mode: LinkedDevicesModeSchema,
|
|
12456
12582
|
devices: array(LinkedDeviceSchema)
|
|
12457
12583
|
})), 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({
|
|
@@ -13175,6 +13301,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13175
13301
|
kind: "mutation",
|
|
13176
13302
|
auth: "admin"
|
|
13177
13303
|
});
|
|
13304
|
+
/**
|
|
13305
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13306
|
+
* through. It stores nothing.
|
|
13307
|
+
*
|
|
13308
|
+
* ## Why a capability at all, and why this shape
|
|
13309
|
+
*
|
|
13310
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13311
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13312
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13313
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13314
|
+
* is assembled from declarations at runtime.
|
|
13315
|
+
*
|
|
13316
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13317
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13318
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13319
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13320
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13321
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13322
|
+
* No new UDS message, no second registry.
|
|
13323
|
+
*
|
|
13324
|
+
* ## What it deliberately does NOT own
|
|
13325
|
+
*
|
|
13326
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13327
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13328
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13329
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13330
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13331
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13332
|
+
* setter for a window and no persistence of any kind.
|
|
13333
|
+
*
|
|
13334
|
+
* ## Why `apply` is here even so
|
|
13335
|
+
*
|
|
13336
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13337
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13338
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13339
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13340
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13341
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13342
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13343
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13344
|
+
*/
|
|
13345
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13346
|
+
var LogChannelApplyResultSchema = object({
|
|
13347
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13348
|
+
armed: number().int().min(0),
|
|
13349
|
+
/**
|
|
13350
|
+
* Names the document armed that this process does not declare. Reported
|
|
13351
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13352
|
+
* not booted, and both deserve a line instead of silence.
|
|
13353
|
+
*/
|
|
13354
|
+
unknown: array(string()).readonly()
|
|
13355
|
+
});
|
|
13356
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13178
13357
|
var LogLevelSchema = _enum([
|
|
13179
13358
|
"debug",
|
|
13180
13359
|
"info",
|
|
@@ -28627,10 +28806,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
28627
28806
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
28628
28807
|
* layer that carries an explicit value wins.
|
|
28629
28808
|
*
|
|
28630
|
-
* `component`
|
|
28631
|
-
*
|
|
28632
|
-
*
|
|
28633
|
-
*
|
|
28809
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
28810
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
28811
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
28812
|
+
* that turning it on would not force every consumer of this document to widen
|
|
28813
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
28634
28814
|
*/
|
|
28635
28815
|
var LoggingScopeKindSchema = _enum([
|
|
28636
28816
|
"cluster",
|
|
@@ -28657,6 +28837,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
28657
28837
|
scope: LoggingScopeKindSchema,
|
|
28658
28838
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
28659
28839
|
nodeId: string().nullable(),
|
|
28840
|
+
/**
|
|
28841
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
28842
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
28843
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
28844
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
28845
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
28846
|
+
*/
|
|
28847
|
+
component: string().nullable(),
|
|
28660
28848
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
28661
28849
|
level: LogLevelSchema$1.nullable()
|
|
28662
28850
|
});
|
|
@@ -28698,6 +28886,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
28698
28886
|
reportEveryMs: number().int().positive().optional()
|
|
28699
28887
|
});
|
|
28700
28888
|
/**
|
|
28889
|
+
* A channel ARMED, as the document reports it.
|
|
28890
|
+
*
|
|
28891
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
28892
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
28893
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
28894
|
+
*/
|
|
28895
|
+
var LogChannelWindowStateSchema = object({
|
|
28896
|
+
channel: string(),
|
|
28897
|
+
armed: boolean(),
|
|
28898
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
28899
|
+
armedUntilMs: number(),
|
|
28900
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
28901
|
+
remainingMs: number(),
|
|
28902
|
+
/**
|
|
28903
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
28904
|
+
*
|
|
28905
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
28906
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
28907
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
28908
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
28909
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
28910
|
+
* not.
|
|
28911
|
+
*/
|
|
28912
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
28913
|
+
});
|
|
28914
|
+
/**
|
|
28915
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
28916
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
28917
|
+
*/
|
|
28918
|
+
var LogChannelWindowPatchSchema = object({
|
|
28919
|
+
channel: string().min(1),
|
|
28920
|
+
armMs: number().int().min(0),
|
|
28921
|
+
/**
|
|
28922
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
28923
|
+
*
|
|
28924
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
28925
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
28926
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
28927
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
28928
|
+
*/
|
|
28929
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
28930
|
+
});
|
|
28931
|
+
/**
|
|
28701
28932
|
* A PATCH, and patches MERGE.
|
|
28702
28933
|
*
|
|
28703
28934
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -28716,7 +28947,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28716
28947
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
28717
28948
|
* keeps running — a patch is never a full replacement.
|
|
28718
28949
|
*/
|
|
28719
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
28950
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
28951
|
+
/**
|
|
28952
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
28953
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
28954
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
28955
|
+
* the Diagnostics page fight over the same value.
|
|
28956
|
+
*/
|
|
28957
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
28720
28958
|
});
|
|
28721
28959
|
/**
|
|
28722
28960
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -28729,9 +28967,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28729
28967
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
28730
28968
|
* layer selector needs a name the transport does not already own.
|
|
28731
28969
|
*/
|
|
28732
|
-
var GetLoggingSettingsInputSchema = object({
|
|
28970
|
+
var GetLoggingSettingsInputSchema = object({
|
|
28971
|
+
scopeNodeId: string().optional(),
|
|
28972
|
+
/**
|
|
28973
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
28974
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
28975
|
+
*
|
|
28976
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
28977
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
28978
|
+
* not, and one selector for both would make "which of these two did I just
|
|
28979
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
28980
|
+
*/
|
|
28981
|
+
scopeComponent: string().optional()
|
|
28982
|
+
});
|
|
28733
28983
|
var SetLoggingSettingsInputSchema = object({
|
|
28734
28984
|
scopeNodeId: string().optional(),
|
|
28985
|
+
scopeComponent: string().optional(),
|
|
28735
28986
|
patch: LoggingSettingsPatchSchema
|
|
28736
28987
|
});
|
|
28737
28988
|
/**
|
|
@@ -28746,9 +28997,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
28746
28997
|
var LoggingSettingsStateSchema = object({
|
|
28747
28998
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
28748
28999
|
scopeNodeId: string().nullable(),
|
|
29000
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
29001
|
+
scopeComponent: string().nullable(),
|
|
28749
29002
|
effective: LoggingEffectiveSchema,
|
|
28750
29003
|
explicit: LoggingExplicitSchema,
|
|
28751
29004
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
29005
|
+
/**
|
|
29006
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
29007
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
29008
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
29009
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
29010
|
+
*/
|
|
29011
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
29012
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
29013
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
28752
29014
|
persisted: boolean()
|
|
28753
29015
|
});
|
|
28754
29016
|
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(), {
|
|
@@ -31733,6 +31995,12 @@ Object.freeze({
|
|
|
31733
31995
|
addonId: null,
|
|
31734
31996
|
access: "view"
|
|
31735
31997
|
},
|
|
31998
|
+
"dataStoreProvider.aggregate": {
|
|
31999
|
+
capName: "data-store-provider",
|
|
32000
|
+
capScope: "system",
|
|
32001
|
+
addonId: null,
|
|
32002
|
+
access: "view"
|
|
32003
|
+
},
|
|
31736
32004
|
"dataStoreProvider.count": {
|
|
31737
32005
|
capName: "data-store-provider",
|
|
31738
32006
|
capScope: "system",
|
|
@@ -32147,6 +32415,12 @@ Object.freeze({
|
|
|
32147
32415
|
addonId: null,
|
|
32148
32416
|
access: "view"
|
|
32149
32417
|
},
|
|
32418
|
+
"deviceManager.getChildrenBatch": {
|
|
32419
|
+
capName: "device-manager",
|
|
32420
|
+
capScope: "system",
|
|
32421
|
+
addonId: null,
|
|
32422
|
+
access: "view"
|
|
32423
|
+
},
|
|
32150
32424
|
"deviceManager.getConfigSchema": {
|
|
32151
32425
|
capName: "device-manager",
|
|
32152
32426
|
capScope: "system",
|
|
@@ -33197,6 +33471,18 @@ Object.freeze({
|
|
|
33197
33471
|
addonId: null,
|
|
33198
33472
|
access: "create"
|
|
33199
33473
|
},
|
|
33474
|
+
"logChannels.apply": {
|
|
33475
|
+
capName: "log-channels",
|
|
33476
|
+
capScope: "system",
|
|
33477
|
+
addonId: null,
|
|
33478
|
+
access: "create"
|
|
33479
|
+
},
|
|
33480
|
+
"logChannels.list": {
|
|
33481
|
+
capName: "log-channels",
|
|
33482
|
+
capScope: "system",
|
|
33483
|
+
addonId: null,
|
|
33484
|
+
access: "view"
|
|
33485
|
+
},
|
|
33200
33486
|
"logDestination.query": {
|
|
33201
33487
|
capName: "log-destination",
|
|
33202
33488
|
capScope: "system",
|
|
@@ -35351,6 +35637,12 @@ Object.freeze({
|
|
|
35351
35637
|
addonId: null,
|
|
35352
35638
|
access: "create"
|
|
35353
35639
|
},
|
|
35640
|
+
"settingsStore.aggregate": {
|
|
35641
|
+
capName: "settings-store",
|
|
35642
|
+
capScope: "system",
|
|
35643
|
+
addonId: null,
|
|
35644
|
+
access: "view"
|
|
35645
|
+
},
|
|
35354
35646
|
"settingsStore.count": {
|
|
35355
35647
|
capName: "settings-store",
|
|
35356
35648
|
capScope: "system",
|
|
@@ -36930,6 +37222,11 @@ Object.freeze({
|
|
|
36930
37222
|
form: "single",
|
|
36931
37223
|
optional: false
|
|
36932
37224
|
}],
|
|
37225
|
+
"deviceManager.getChildrenBatch": [{
|
|
37226
|
+
name: "parentDeviceIds",
|
|
37227
|
+
form: "array",
|
|
37228
|
+
optional: false
|
|
37229
|
+
}],
|
|
36933
37230
|
"deviceManager.getConfigSchema": [{
|
|
36934
37231
|
name: "deviceId",
|
|
36935
37232
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-dreo",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.34",
|
|
4
4
|
"description": "Dreo smart-device (fan / air-circulator / purifier / heater / humidifier) device-provider addon for CamStack — wraps the @apocaliss92/nodedreo Dreo cloud client (REST + WebSocket)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|