@camstack/addon-provider-unifi 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
|
@@ -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
|
*
|
|
@@ -11088,6 +11193,35 @@ var MutationFilterSchema = object({
|
|
|
11088
11193
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11089
11194
|
whereNot: record(string(), unknown()).optional()
|
|
11090
11195
|
});
|
|
11196
|
+
/**
|
|
11197
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11198
|
+
*
|
|
11199
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11200
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11201
|
+
* a `Record<column, op>` shape could not express.
|
|
11202
|
+
*/
|
|
11203
|
+
var AggregateFieldSchema = object({
|
|
11204
|
+
/** Result key. */
|
|
11205
|
+
as: string().min(1),
|
|
11206
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11207
|
+
field: string().min(1),
|
|
11208
|
+
op: _enum([
|
|
11209
|
+
"sum",
|
|
11210
|
+
"min",
|
|
11211
|
+
"max"
|
|
11212
|
+
])
|
|
11213
|
+
});
|
|
11214
|
+
/**
|
|
11215
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11216
|
+
*
|
|
11217
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11218
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11219
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11220
|
+
*/
|
|
11221
|
+
var AggregateResultSchema = object({
|
|
11222
|
+
count: number().int(),
|
|
11223
|
+
values: record(string(), number().nullable())
|
|
11224
|
+
});
|
|
11091
11225
|
/** A single stored record: `{ id, data }`. */
|
|
11092
11226
|
var SettingsRecordSchema = object({
|
|
11093
11227
|
id: string(),
|
|
@@ -11172,6 +11306,11 @@ method(object({
|
|
|
11172
11306
|
collection: string(),
|
|
11173
11307
|
filter: QueryFilterSchema.optional()
|
|
11174
11308
|
}), number()), method(object({
|
|
11309
|
+
namespace: string().optional(),
|
|
11310
|
+
collection: string(),
|
|
11311
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11312
|
+
filter: QueryFilterSchema.optional()
|
|
11313
|
+
}), AggregateResultSchema), method(object({
|
|
11175
11314
|
namespace: string().optional(),
|
|
11176
11315
|
collection: string(),
|
|
11177
11316
|
field: string(),
|
|
@@ -11288,6 +11427,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11288
11427
|
collection: string(),
|
|
11289
11428
|
filter: QueryFilterSchema.optional()
|
|
11290
11429
|
}), number(), { auth: "admin" }), method(object({
|
|
11430
|
+
namespace: string().optional(),
|
|
11431
|
+
collection: string(),
|
|
11432
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11433
|
+
filter: QueryFilterSchema.optional()
|
|
11434
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11291
11435
|
namespace: string().optional(),
|
|
11292
11436
|
collection: string(),
|
|
11293
11437
|
field: string(),
|
|
@@ -12011,24 +12155,6 @@ var deviceProviderCapability = {
|
|
|
12011
12155
|
})
|
|
12012
12156
|
}
|
|
12013
12157
|
};
|
|
12014
|
-
/**
|
|
12015
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12016
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12017
|
-
*
|
|
12018
|
-
* Replaces:
|
|
12019
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12020
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12021
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12022
|
-
*
|
|
12023
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12024
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12025
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12026
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12027
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12028
|
-
*
|
|
12029
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12030
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12031
|
-
*/
|
|
12032
12158
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12033
12159
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12034
12160
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12397,7 +12523,7 @@ method(object({
|
|
|
12397
12523
|
* it answers today and the caller filters as it already does.
|
|
12398
12524
|
*/
|
|
12399
12525
|
deviceIds: array(number()).optional()
|
|
12400
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12526
|
+
}), 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({
|
|
12401
12527
|
mode: LinkedDevicesModeSchema,
|
|
12402
12528
|
devices: array(LinkedDeviceSchema)
|
|
12403
12529
|
})), 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({
|
|
@@ -13121,6 +13247,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13121
13247
|
kind: "mutation",
|
|
13122
13248
|
auth: "admin"
|
|
13123
13249
|
});
|
|
13250
|
+
/**
|
|
13251
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13252
|
+
* through. It stores nothing.
|
|
13253
|
+
*
|
|
13254
|
+
* ## Why a capability at all, and why this shape
|
|
13255
|
+
*
|
|
13256
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13257
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13258
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13259
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13260
|
+
* is assembled from declarations at runtime.
|
|
13261
|
+
*
|
|
13262
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13263
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13264
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13265
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13266
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13267
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13268
|
+
* No new UDS message, no second registry.
|
|
13269
|
+
*
|
|
13270
|
+
* ## What it deliberately does NOT own
|
|
13271
|
+
*
|
|
13272
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13273
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13274
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13275
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13276
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13277
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13278
|
+
* setter for a window and no persistence of any kind.
|
|
13279
|
+
*
|
|
13280
|
+
* ## Why `apply` is here even so
|
|
13281
|
+
*
|
|
13282
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13283
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13284
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13285
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13286
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13287
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13288
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13289
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13290
|
+
*/
|
|
13291
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13292
|
+
var LogChannelApplyResultSchema = object({
|
|
13293
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13294
|
+
armed: number().int().min(0),
|
|
13295
|
+
/**
|
|
13296
|
+
* Names the document armed that this process does not declare. Reported
|
|
13297
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13298
|
+
* not booted, and both deserve a line instead of silence.
|
|
13299
|
+
*/
|
|
13300
|
+
unknown: array(string()).readonly()
|
|
13301
|
+
});
|
|
13302
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13124
13303
|
var LogLevelSchema = _enum([
|
|
13125
13304
|
"debug",
|
|
13126
13305
|
"info",
|
|
@@ -28582,10 +28761,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
28582
28761
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
28583
28762
|
* layer that carries an explicit value wins.
|
|
28584
28763
|
*
|
|
28585
|
-
* `component`
|
|
28586
|
-
*
|
|
28587
|
-
*
|
|
28588
|
-
*
|
|
28764
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
28765
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
28766
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
28767
|
+
* that turning it on would not force every consumer of this document to widen
|
|
28768
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
28589
28769
|
*/
|
|
28590
28770
|
var LoggingScopeKindSchema = _enum([
|
|
28591
28771
|
"cluster",
|
|
@@ -28612,6 +28792,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
28612
28792
|
scope: LoggingScopeKindSchema,
|
|
28613
28793
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
28614
28794
|
nodeId: string().nullable(),
|
|
28795
|
+
/**
|
|
28796
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
28797
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
28798
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
28799
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
28800
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
28801
|
+
*/
|
|
28802
|
+
component: string().nullable(),
|
|
28615
28803
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
28616
28804
|
level: LogLevelSchema$1.nullable()
|
|
28617
28805
|
});
|
|
@@ -28653,6 +28841,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
28653
28841
|
reportEveryMs: number().int().positive().optional()
|
|
28654
28842
|
});
|
|
28655
28843
|
/**
|
|
28844
|
+
* A channel ARMED, as the document reports it.
|
|
28845
|
+
*
|
|
28846
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
28847
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
28848
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
28849
|
+
*/
|
|
28850
|
+
var LogChannelWindowStateSchema = object({
|
|
28851
|
+
channel: string(),
|
|
28852
|
+
armed: boolean(),
|
|
28853
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
28854
|
+
armedUntilMs: number(),
|
|
28855
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
28856
|
+
remainingMs: number(),
|
|
28857
|
+
/**
|
|
28858
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
28859
|
+
*
|
|
28860
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
28861
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
28862
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
28863
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
28864
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
28865
|
+
* not.
|
|
28866
|
+
*/
|
|
28867
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
28868
|
+
});
|
|
28869
|
+
/**
|
|
28870
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
28871
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
28872
|
+
*/
|
|
28873
|
+
var LogChannelWindowPatchSchema = object({
|
|
28874
|
+
channel: string().min(1),
|
|
28875
|
+
armMs: number().int().min(0),
|
|
28876
|
+
/**
|
|
28877
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
28878
|
+
*
|
|
28879
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
28880
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
28881
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
28882
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
28883
|
+
*/
|
|
28884
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
28885
|
+
});
|
|
28886
|
+
/**
|
|
28656
28887
|
* A PATCH, and patches MERGE.
|
|
28657
28888
|
*
|
|
28658
28889
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -28671,7 +28902,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28671
28902
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
28672
28903
|
* keeps running — a patch is never a full replacement.
|
|
28673
28904
|
*/
|
|
28674
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
28905
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
28906
|
+
/**
|
|
28907
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
28908
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
28909
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
28910
|
+
* the Diagnostics page fight over the same value.
|
|
28911
|
+
*/
|
|
28912
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
28675
28913
|
});
|
|
28676
28914
|
/**
|
|
28677
28915
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -28684,9 +28922,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28684
28922
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
28685
28923
|
* layer selector needs a name the transport does not already own.
|
|
28686
28924
|
*/
|
|
28687
|
-
var GetLoggingSettingsInputSchema = object({
|
|
28925
|
+
var GetLoggingSettingsInputSchema = object({
|
|
28926
|
+
scopeNodeId: string().optional(),
|
|
28927
|
+
/**
|
|
28928
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
28929
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
28930
|
+
*
|
|
28931
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
28932
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
28933
|
+
* not, and one selector for both would make "which of these two did I just
|
|
28934
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
28935
|
+
*/
|
|
28936
|
+
scopeComponent: string().optional()
|
|
28937
|
+
});
|
|
28688
28938
|
var SetLoggingSettingsInputSchema = object({
|
|
28689
28939
|
scopeNodeId: string().optional(),
|
|
28940
|
+
scopeComponent: string().optional(),
|
|
28690
28941
|
patch: LoggingSettingsPatchSchema
|
|
28691
28942
|
});
|
|
28692
28943
|
/**
|
|
@@ -28701,9 +28952,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
28701
28952
|
var LoggingSettingsStateSchema = object({
|
|
28702
28953
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
28703
28954
|
scopeNodeId: string().nullable(),
|
|
28955
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
28956
|
+
scopeComponent: string().nullable(),
|
|
28704
28957
|
effective: LoggingEffectiveSchema,
|
|
28705
28958
|
explicit: LoggingExplicitSchema,
|
|
28706
28959
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
28960
|
+
/**
|
|
28961
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
28962
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
28963
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
28964
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
28965
|
+
*/
|
|
28966
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
28967
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
28968
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
28707
28969
|
persisted: boolean()
|
|
28708
28970
|
});
|
|
28709
28971
|
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(), {
|
|
@@ -31688,6 +31950,12 @@ Object.freeze({
|
|
|
31688
31950
|
addonId: null,
|
|
31689
31951
|
access: "view"
|
|
31690
31952
|
},
|
|
31953
|
+
"dataStoreProvider.aggregate": {
|
|
31954
|
+
capName: "data-store-provider",
|
|
31955
|
+
capScope: "system",
|
|
31956
|
+
addonId: null,
|
|
31957
|
+
access: "view"
|
|
31958
|
+
},
|
|
31691
31959
|
"dataStoreProvider.count": {
|
|
31692
31960
|
capName: "data-store-provider",
|
|
31693
31961
|
capScope: "system",
|
|
@@ -32102,6 +32370,12 @@ Object.freeze({
|
|
|
32102
32370
|
addonId: null,
|
|
32103
32371
|
access: "view"
|
|
32104
32372
|
},
|
|
32373
|
+
"deviceManager.getChildrenBatch": {
|
|
32374
|
+
capName: "device-manager",
|
|
32375
|
+
capScope: "system",
|
|
32376
|
+
addonId: null,
|
|
32377
|
+
access: "view"
|
|
32378
|
+
},
|
|
32105
32379
|
"deviceManager.getConfigSchema": {
|
|
32106
32380
|
capName: "device-manager",
|
|
32107
32381
|
capScope: "system",
|
|
@@ -33152,6 +33426,18 @@ Object.freeze({
|
|
|
33152
33426
|
addonId: null,
|
|
33153
33427
|
access: "create"
|
|
33154
33428
|
},
|
|
33429
|
+
"logChannels.apply": {
|
|
33430
|
+
capName: "log-channels",
|
|
33431
|
+
capScope: "system",
|
|
33432
|
+
addonId: null,
|
|
33433
|
+
access: "create"
|
|
33434
|
+
},
|
|
33435
|
+
"logChannels.list": {
|
|
33436
|
+
capName: "log-channels",
|
|
33437
|
+
capScope: "system",
|
|
33438
|
+
addonId: null,
|
|
33439
|
+
access: "view"
|
|
33440
|
+
},
|
|
33155
33441
|
"logDestination.query": {
|
|
33156
33442
|
capName: "log-destination",
|
|
33157
33443
|
capScope: "system",
|
|
@@ -35306,6 +35592,12 @@ Object.freeze({
|
|
|
35306
35592
|
addonId: null,
|
|
35307
35593
|
access: "create"
|
|
35308
35594
|
},
|
|
35595
|
+
"settingsStore.aggregate": {
|
|
35596
|
+
capName: "settings-store",
|
|
35597
|
+
capScope: "system",
|
|
35598
|
+
addonId: null,
|
|
35599
|
+
access: "view"
|
|
35600
|
+
},
|
|
35309
35601
|
"settingsStore.count": {
|
|
35310
35602
|
capName: "settings-store",
|
|
35311
35603
|
capScope: "system",
|
|
@@ -36885,6 +37177,11 @@ Object.freeze({
|
|
|
36885
37177
|
form: "single",
|
|
36886
37178
|
optional: false
|
|
36887
37179
|
}],
|
|
37180
|
+
"deviceManager.getChildrenBatch": [{
|
|
37181
|
+
name: "parentDeviceIds",
|
|
37182
|
+
form: "array",
|
|
37183
|
+
optional: false
|
|
37184
|
+
}],
|
|
36888
37185
|
"deviceManager.getConfigSchema": [{
|
|
36889
37186
|
name: "deviceId",
|
|
36890
37187
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -7467,6 +7467,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7467
7467
|
fetchedAt: number()
|
|
7468
7468
|
});
|
|
7469
7469
|
/**
|
|
7470
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7471
|
+
* an addon declares its channels in.
|
|
7472
|
+
*
|
|
7473
|
+
* ## Two axes, deliberately separated
|
|
7474
|
+
*
|
|
7475
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7476
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7477
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7478
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7479
|
+
* `log-channels` capability enumerates the declarations.
|
|
7480
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7481
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7482
|
+
* over the values is the exact defect
|
|
7483
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7484
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7485
|
+
*
|
|
7486
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7487
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7488
|
+
* the hot path with a value somebody actually read, and by
|
|
7489
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7490
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7491
|
+
* disarmed one (D49).
|
|
7492
|
+
*
|
|
7493
|
+
* ## The canonical call shape
|
|
7494
|
+
*
|
|
7495
|
+
* ```ts
|
|
7496
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7497
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7498
|
+
* }
|
|
7499
|
+
* ```
|
|
7500
|
+
*
|
|
7501
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7502
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7503
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7504
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7505
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7506
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7507
|
+
*
|
|
7508
|
+
* ## Why a channel emits at `info`
|
|
7509
|
+
*
|
|
7510
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7511
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7512
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7513
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7514
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7515
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7516
|
+
*/
|
|
7517
|
+
/**
|
|
7518
|
+
* The level a channel writes at once armed.
|
|
7519
|
+
*
|
|
7520
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7521
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7522
|
+
* to read it later.
|
|
7523
|
+
*/
|
|
7524
|
+
var LogChannelLevelSchema = _enum([
|
|
7525
|
+
"info",
|
|
7526
|
+
"warn",
|
|
7527
|
+
"error"
|
|
7528
|
+
]);
|
|
7529
|
+
/**
|
|
7530
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7531
|
+
* declaration is inert.
|
|
7532
|
+
*/
|
|
7533
|
+
var LogChannelDescriptorSchema = object({
|
|
7534
|
+
/**
|
|
7535
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7536
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7537
|
+
* owns it without a second lookup.
|
|
7538
|
+
*/
|
|
7539
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7540
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7541
|
+
description: string().min(1),
|
|
7542
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7543
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7544
|
+
/**
|
|
7545
|
+
* Whether this channel can be narrowed to a camera.
|
|
7546
|
+
*
|
|
7547
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7548
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7549
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7550
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7551
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7552
|
+
* the body is the only way to filter.
|
|
7553
|
+
*
|
|
7554
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7555
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7556
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7557
|
+
* path was never taken.
|
|
7558
|
+
*/
|
|
7559
|
+
perDevice: boolean()
|
|
7560
|
+
});
|
|
7561
|
+
/**
|
|
7562
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7563
|
+
*
|
|
7564
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7565
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7566
|
+
*/
|
|
7567
|
+
var LogChannelWindowSchema = object({
|
|
7568
|
+
channel: string().min(1),
|
|
7569
|
+
/** Epoch ms the window closes at. */
|
|
7570
|
+
armedUntilMs: number(),
|
|
7571
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7572
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7573
|
+
});
|
|
7574
|
+
/**
|
|
7470
7575
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7471
7576
|
* recordings and events management surfaces.
|
|
7472
7577
|
*
|
|
@@ -11087,6 +11192,35 @@ var MutationFilterSchema = object({
|
|
|
11087
11192
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11088
11193
|
whereNot: record(string(), unknown()).optional()
|
|
11089
11194
|
});
|
|
11195
|
+
/**
|
|
11196
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11197
|
+
*
|
|
11198
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11199
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11200
|
+
* a `Record<column, op>` shape could not express.
|
|
11201
|
+
*/
|
|
11202
|
+
var AggregateFieldSchema = object({
|
|
11203
|
+
/** Result key. */
|
|
11204
|
+
as: string().min(1),
|
|
11205
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11206
|
+
field: string().min(1),
|
|
11207
|
+
op: _enum([
|
|
11208
|
+
"sum",
|
|
11209
|
+
"min",
|
|
11210
|
+
"max"
|
|
11211
|
+
])
|
|
11212
|
+
});
|
|
11213
|
+
/**
|
|
11214
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11215
|
+
*
|
|
11216
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11217
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11218
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11219
|
+
*/
|
|
11220
|
+
var AggregateResultSchema = object({
|
|
11221
|
+
count: number().int(),
|
|
11222
|
+
values: record(string(), number().nullable())
|
|
11223
|
+
});
|
|
11090
11224
|
/** A single stored record: `{ id, data }`. */
|
|
11091
11225
|
var SettingsRecordSchema = object({
|
|
11092
11226
|
id: string(),
|
|
@@ -11171,6 +11305,11 @@ method(object({
|
|
|
11171
11305
|
collection: string(),
|
|
11172
11306
|
filter: QueryFilterSchema.optional()
|
|
11173
11307
|
}), number()), method(object({
|
|
11308
|
+
namespace: string().optional(),
|
|
11309
|
+
collection: string(),
|
|
11310
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11311
|
+
filter: QueryFilterSchema.optional()
|
|
11312
|
+
}), AggregateResultSchema), method(object({
|
|
11174
11313
|
namespace: string().optional(),
|
|
11175
11314
|
collection: string(),
|
|
11176
11315
|
field: string(),
|
|
@@ -11287,6 +11426,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11287
11426
|
collection: string(),
|
|
11288
11427
|
filter: QueryFilterSchema.optional()
|
|
11289
11428
|
}), number(), { auth: "admin" }), method(object({
|
|
11429
|
+
namespace: string().optional(),
|
|
11430
|
+
collection: string(),
|
|
11431
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11432
|
+
filter: QueryFilterSchema.optional()
|
|
11433
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11290
11434
|
namespace: string().optional(),
|
|
11291
11435
|
collection: string(),
|
|
11292
11436
|
field: string(),
|
|
@@ -12010,24 +12154,6 @@ var deviceProviderCapability = {
|
|
|
12010
12154
|
})
|
|
12011
12155
|
}
|
|
12012
12156
|
};
|
|
12013
|
-
/**
|
|
12014
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12015
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12016
|
-
*
|
|
12017
|
-
* Replaces:
|
|
12018
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12019
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12020
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12021
|
-
*
|
|
12022
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12023
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12024
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12025
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12026
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12027
|
-
*
|
|
12028
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12029
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12030
|
-
*/
|
|
12031
12157
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12032
12158
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12033
12159
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12396,7 +12522,7 @@ method(object({
|
|
|
12396
12522
|
* it answers today and the caller filters as it already does.
|
|
12397
12523
|
*/
|
|
12398
12524
|
deviceIds: array(number()).optional()
|
|
12399
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12525
|
+
}), 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({
|
|
12400
12526
|
mode: LinkedDevicesModeSchema,
|
|
12401
12527
|
devices: array(LinkedDeviceSchema)
|
|
12402
12528
|
})), 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({
|
|
@@ -13120,6 +13246,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13120
13246
|
kind: "mutation",
|
|
13121
13247
|
auth: "admin"
|
|
13122
13248
|
});
|
|
13249
|
+
/**
|
|
13250
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13251
|
+
* through. It stores nothing.
|
|
13252
|
+
*
|
|
13253
|
+
* ## Why a capability at all, and why this shape
|
|
13254
|
+
*
|
|
13255
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13256
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13257
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13258
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13259
|
+
* is assembled from declarations at runtime.
|
|
13260
|
+
*
|
|
13261
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13262
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13263
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13264
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13265
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13266
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13267
|
+
* No new UDS message, no second registry.
|
|
13268
|
+
*
|
|
13269
|
+
* ## What it deliberately does NOT own
|
|
13270
|
+
*
|
|
13271
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13272
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13273
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13274
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13275
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13276
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13277
|
+
* setter for a window and no persistence of any kind.
|
|
13278
|
+
*
|
|
13279
|
+
* ## Why `apply` is here even so
|
|
13280
|
+
*
|
|
13281
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13282
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13283
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13284
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13285
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13286
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13287
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13288
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13289
|
+
*/
|
|
13290
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13291
|
+
var LogChannelApplyResultSchema = object({
|
|
13292
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13293
|
+
armed: number().int().min(0),
|
|
13294
|
+
/**
|
|
13295
|
+
* Names the document armed that this process does not declare. Reported
|
|
13296
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13297
|
+
* not booted, and both deserve a line instead of silence.
|
|
13298
|
+
*/
|
|
13299
|
+
unknown: array(string()).readonly()
|
|
13300
|
+
});
|
|
13301
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13123
13302
|
var LogLevelSchema = _enum([
|
|
13124
13303
|
"debug",
|
|
13125
13304
|
"info",
|
|
@@ -28581,10 +28760,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
28581
28760
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
28582
28761
|
* layer that carries an explicit value wins.
|
|
28583
28762
|
*
|
|
28584
|
-
* `component`
|
|
28585
|
-
*
|
|
28586
|
-
*
|
|
28587
|
-
*
|
|
28763
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
28764
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
28765
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
28766
|
+
* that turning it on would not force every consumer of this document to widen
|
|
28767
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
28588
28768
|
*/
|
|
28589
28769
|
var LoggingScopeKindSchema = _enum([
|
|
28590
28770
|
"cluster",
|
|
@@ -28611,6 +28791,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
28611
28791
|
scope: LoggingScopeKindSchema,
|
|
28612
28792
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
28613
28793
|
nodeId: string().nullable(),
|
|
28794
|
+
/**
|
|
28795
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
28796
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
28797
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
28798
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
28799
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
28800
|
+
*/
|
|
28801
|
+
component: string().nullable(),
|
|
28614
28802
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
28615
28803
|
level: LogLevelSchema$1.nullable()
|
|
28616
28804
|
});
|
|
@@ -28652,6 +28840,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
28652
28840
|
reportEveryMs: number().int().positive().optional()
|
|
28653
28841
|
});
|
|
28654
28842
|
/**
|
|
28843
|
+
* A channel ARMED, as the document reports it.
|
|
28844
|
+
*
|
|
28845
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
28846
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
28847
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
28848
|
+
*/
|
|
28849
|
+
var LogChannelWindowStateSchema = object({
|
|
28850
|
+
channel: string(),
|
|
28851
|
+
armed: boolean(),
|
|
28852
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
28853
|
+
armedUntilMs: number(),
|
|
28854
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
28855
|
+
remainingMs: number(),
|
|
28856
|
+
/**
|
|
28857
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
28858
|
+
*
|
|
28859
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
28860
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
28861
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
28862
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
28863
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
28864
|
+
* not.
|
|
28865
|
+
*/
|
|
28866
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
28867
|
+
});
|
|
28868
|
+
/**
|
|
28869
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
28870
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
28871
|
+
*/
|
|
28872
|
+
var LogChannelWindowPatchSchema = object({
|
|
28873
|
+
channel: string().min(1),
|
|
28874
|
+
armMs: number().int().min(0),
|
|
28875
|
+
/**
|
|
28876
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
28877
|
+
*
|
|
28878
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
28879
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
28880
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
28881
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
28882
|
+
*/
|
|
28883
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
28884
|
+
});
|
|
28885
|
+
/**
|
|
28655
28886
|
* A PATCH, and patches MERGE.
|
|
28656
28887
|
*
|
|
28657
28888
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -28670,7 +28901,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28670
28901
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
28671
28902
|
* keeps running — a patch is never a full replacement.
|
|
28672
28903
|
*/
|
|
28673
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
28904
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
28905
|
+
/**
|
|
28906
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
28907
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
28908
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
28909
|
+
* the Diagnostics page fight over the same value.
|
|
28910
|
+
*/
|
|
28911
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
28674
28912
|
});
|
|
28675
28913
|
/**
|
|
28676
28914
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -28683,9 +28921,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28683
28921
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
28684
28922
|
* layer selector needs a name the transport does not already own.
|
|
28685
28923
|
*/
|
|
28686
|
-
var GetLoggingSettingsInputSchema = object({
|
|
28924
|
+
var GetLoggingSettingsInputSchema = object({
|
|
28925
|
+
scopeNodeId: string().optional(),
|
|
28926
|
+
/**
|
|
28927
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
28928
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
28929
|
+
*
|
|
28930
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
28931
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
28932
|
+
* not, and one selector for both would make "which of these two did I just
|
|
28933
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
28934
|
+
*/
|
|
28935
|
+
scopeComponent: string().optional()
|
|
28936
|
+
});
|
|
28687
28937
|
var SetLoggingSettingsInputSchema = object({
|
|
28688
28938
|
scopeNodeId: string().optional(),
|
|
28939
|
+
scopeComponent: string().optional(),
|
|
28689
28940
|
patch: LoggingSettingsPatchSchema
|
|
28690
28941
|
});
|
|
28691
28942
|
/**
|
|
@@ -28700,9 +28951,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
28700
28951
|
var LoggingSettingsStateSchema = object({
|
|
28701
28952
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
28702
28953
|
scopeNodeId: string().nullable(),
|
|
28954
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
28955
|
+
scopeComponent: string().nullable(),
|
|
28703
28956
|
effective: LoggingEffectiveSchema,
|
|
28704
28957
|
explicit: LoggingExplicitSchema,
|
|
28705
28958
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
28959
|
+
/**
|
|
28960
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
28961
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
28962
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
28963
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
28964
|
+
*/
|
|
28965
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
28966
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
28967
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
28706
28968
|
persisted: boolean()
|
|
28707
28969
|
});
|
|
28708
28970
|
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(), {
|
|
@@ -31687,6 +31949,12 @@ Object.freeze({
|
|
|
31687
31949
|
addonId: null,
|
|
31688
31950
|
access: "view"
|
|
31689
31951
|
},
|
|
31952
|
+
"dataStoreProvider.aggregate": {
|
|
31953
|
+
capName: "data-store-provider",
|
|
31954
|
+
capScope: "system",
|
|
31955
|
+
addonId: null,
|
|
31956
|
+
access: "view"
|
|
31957
|
+
},
|
|
31690
31958
|
"dataStoreProvider.count": {
|
|
31691
31959
|
capName: "data-store-provider",
|
|
31692
31960
|
capScope: "system",
|
|
@@ -32101,6 +32369,12 @@ Object.freeze({
|
|
|
32101
32369
|
addonId: null,
|
|
32102
32370
|
access: "view"
|
|
32103
32371
|
},
|
|
32372
|
+
"deviceManager.getChildrenBatch": {
|
|
32373
|
+
capName: "device-manager",
|
|
32374
|
+
capScope: "system",
|
|
32375
|
+
addonId: null,
|
|
32376
|
+
access: "view"
|
|
32377
|
+
},
|
|
32104
32378
|
"deviceManager.getConfigSchema": {
|
|
32105
32379
|
capName: "device-manager",
|
|
32106
32380
|
capScope: "system",
|
|
@@ -33151,6 +33425,18 @@ Object.freeze({
|
|
|
33151
33425
|
addonId: null,
|
|
33152
33426
|
access: "create"
|
|
33153
33427
|
},
|
|
33428
|
+
"logChannels.apply": {
|
|
33429
|
+
capName: "log-channels",
|
|
33430
|
+
capScope: "system",
|
|
33431
|
+
addonId: null,
|
|
33432
|
+
access: "create"
|
|
33433
|
+
},
|
|
33434
|
+
"logChannels.list": {
|
|
33435
|
+
capName: "log-channels",
|
|
33436
|
+
capScope: "system",
|
|
33437
|
+
addonId: null,
|
|
33438
|
+
access: "view"
|
|
33439
|
+
},
|
|
33154
33440
|
"logDestination.query": {
|
|
33155
33441
|
capName: "log-destination",
|
|
33156
33442
|
capScope: "system",
|
|
@@ -35305,6 +35591,12 @@ Object.freeze({
|
|
|
35305
35591
|
addonId: null,
|
|
35306
35592
|
access: "create"
|
|
35307
35593
|
},
|
|
35594
|
+
"settingsStore.aggregate": {
|
|
35595
|
+
capName: "settings-store",
|
|
35596
|
+
capScope: "system",
|
|
35597
|
+
addonId: null,
|
|
35598
|
+
access: "view"
|
|
35599
|
+
},
|
|
35308
35600
|
"settingsStore.count": {
|
|
35309
35601
|
capName: "settings-store",
|
|
35310
35602
|
capScope: "system",
|
|
@@ -36884,6 +37176,11 @@ Object.freeze({
|
|
|
36884
37176
|
form: "single",
|
|
36885
37177
|
optional: false
|
|
36886
37178
|
}],
|
|
37179
|
+
"deviceManager.getChildrenBatch": [{
|
|
37180
|
+
name: "parentDeviceIds",
|
|
37181
|
+
form: "array",
|
|
37182
|
+
optional: false
|
|
37183
|
+
}],
|
|
36887
37184
|
"deviceManager.getConfigSchema": [{
|
|
36888
37185
|
name: "deviceId",
|
|
36889
37186
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-unifi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.34",
|
|
4
4
|
"description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|