@camstack/addon-provider-amcrest 0.2.34 → 0.2.36
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
|
@@ -7461,6 +7461,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7461
7461
|
fetchedAt: number()
|
|
7462
7462
|
});
|
|
7463
7463
|
/**
|
|
7464
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7465
|
+
* an addon declares its channels in.
|
|
7466
|
+
*
|
|
7467
|
+
* ## Two axes, deliberately separated
|
|
7468
|
+
*
|
|
7469
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7470
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7471
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7472
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7473
|
+
* `log-channels` capability enumerates the declarations.
|
|
7474
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7475
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7476
|
+
* over the values is the exact defect
|
|
7477
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7478
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7479
|
+
*
|
|
7480
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7481
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7482
|
+
* the hot path with a value somebody actually read, and by
|
|
7483
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7484
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7485
|
+
* disarmed one (D49).
|
|
7486
|
+
*
|
|
7487
|
+
* ## The canonical call shape
|
|
7488
|
+
*
|
|
7489
|
+
* ```ts
|
|
7490
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7491
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7492
|
+
* }
|
|
7493
|
+
* ```
|
|
7494
|
+
*
|
|
7495
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7496
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7497
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7498
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7499
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7500
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7501
|
+
*
|
|
7502
|
+
* ## Why a channel emits at `info`
|
|
7503
|
+
*
|
|
7504
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7505
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7506
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7507
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7508
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7509
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7510
|
+
*/
|
|
7511
|
+
/**
|
|
7512
|
+
* The level a channel writes at once armed.
|
|
7513
|
+
*
|
|
7514
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7515
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7516
|
+
* to read it later.
|
|
7517
|
+
*/
|
|
7518
|
+
var LogChannelLevelSchema = _enum([
|
|
7519
|
+
"info",
|
|
7520
|
+
"warn",
|
|
7521
|
+
"error"
|
|
7522
|
+
]);
|
|
7523
|
+
/**
|
|
7524
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7525
|
+
* declaration is inert.
|
|
7526
|
+
*/
|
|
7527
|
+
var LogChannelDescriptorSchema = object({
|
|
7528
|
+
/**
|
|
7529
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7530
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7531
|
+
* owns it without a second lookup.
|
|
7532
|
+
*/
|
|
7533
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7534
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7535
|
+
description: string().min(1),
|
|
7536
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7537
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7538
|
+
/**
|
|
7539
|
+
* Whether this channel can be narrowed to a camera.
|
|
7540
|
+
*
|
|
7541
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7542
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7543
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7544
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7545
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7546
|
+
* the body is the only way to filter.
|
|
7547
|
+
*
|
|
7548
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7549
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7550
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7551
|
+
* path was never taken.
|
|
7552
|
+
*/
|
|
7553
|
+
perDevice: boolean()
|
|
7554
|
+
});
|
|
7555
|
+
/**
|
|
7556
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7557
|
+
*
|
|
7558
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7559
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7560
|
+
*/
|
|
7561
|
+
var LogChannelWindowSchema = object({
|
|
7562
|
+
channel: string().min(1),
|
|
7563
|
+
/** Epoch ms the window closes at. */
|
|
7564
|
+
armedUntilMs: number(),
|
|
7565
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7566
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7567
|
+
});
|
|
7568
|
+
/**
|
|
7464
7569
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7465
7570
|
* recordings and events management surfaces.
|
|
7466
7571
|
*
|
|
@@ -11081,6 +11186,35 @@ var MutationFilterSchema = object({
|
|
|
11081
11186
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11082
11187
|
whereNot: record(string(), unknown()).optional()
|
|
11083
11188
|
});
|
|
11189
|
+
/**
|
|
11190
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11191
|
+
*
|
|
11192
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11193
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11194
|
+
* a `Record<column, op>` shape could not express.
|
|
11195
|
+
*/
|
|
11196
|
+
var AggregateFieldSchema = object({
|
|
11197
|
+
/** Result key. */
|
|
11198
|
+
as: string().min(1),
|
|
11199
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11200
|
+
field: string().min(1),
|
|
11201
|
+
op: _enum([
|
|
11202
|
+
"sum",
|
|
11203
|
+
"min",
|
|
11204
|
+
"max"
|
|
11205
|
+
])
|
|
11206
|
+
});
|
|
11207
|
+
/**
|
|
11208
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11209
|
+
*
|
|
11210
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11211
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11212
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11213
|
+
*/
|
|
11214
|
+
var AggregateResultSchema = object({
|
|
11215
|
+
count: number().int(),
|
|
11216
|
+
values: record(string(), number().nullable())
|
|
11217
|
+
});
|
|
11084
11218
|
/** A single stored record: `{ id, data }`. */
|
|
11085
11219
|
var SettingsRecordSchema = object({
|
|
11086
11220
|
id: string(),
|
|
@@ -11165,6 +11299,11 @@ method(object({
|
|
|
11165
11299
|
collection: string(),
|
|
11166
11300
|
filter: QueryFilterSchema.optional()
|
|
11167
11301
|
}), number()), method(object({
|
|
11302
|
+
namespace: string().optional(),
|
|
11303
|
+
collection: string(),
|
|
11304
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11305
|
+
filter: QueryFilterSchema.optional()
|
|
11306
|
+
}), AggregateResultSchema), method(object({
|
|
11168
11307
|
namespace: string().optional(),
|
|
11169
11308
|
collection: string(),
|
|
11170
11309
|
field: string(),
|
|
@@ -11281,6 +11420,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11281
11420
|
collection: string(),
|
|
11282
11421
|
filter: QueryFilterSchema.optional()
|
|
11283
11422
|
}), number(), { auth: "admin" }), method(object({
|
|
11423
|
+
namespace: string().optional(),
|
|
11424
|
+
collection: string(),
|
|
11425
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11426
|
+
filter: QueryFilterSchema.optional()
|
|
11427
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11284
11428
|
namespace: string().optional(),
|
|
11285
11429
|
collection: string(),
|
|
11286
11430
|
field: string(),
|
|
@@ -12004,24 +12148,6 @@ var deviceProviderCapability = {
|
|
|
12004
12148
|
})
|
|
12005
12149
|
}
|
|
12006
12150
|
};
|
|
12007
|
-
/**
|
|
12008
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12009
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12010
|
-
*
|
|
12011
|
-
* Replaces:
|
|
12012
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12013
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12014
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12015
|
-
*
|
|
12016
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12017
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12018
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12019
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12020
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12021
|
-
*
|
|
12022
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12023
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12024
|
-
*/
|
|
12025
12151
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12026
12152
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12027
12153
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12390,7 +12516,7 @@ method(object({
|
|
|
12390
12516
|
* it answers today and the caller filters as it already does.
|
|
12391
12517
|
*/
|
|
12392
12518
|
deviceIds: array(number()).optional()
|
|
12393
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12519
|
+
}), 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({
|
|
12394
12520
|
mode: LinkedDevicesModeSchema,
|
|
12395
12521
|
devices: array(LinkedDeviceSchema)
|
|
12396
12522
|
})), 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({
|
|
@@ -13114,6 +13240,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13114
13240
|
kind: "mutation",
|
|
13115
13241
|
auth: "admin"
|
|
13116
13242
|
});
|
|
13243
|
+
/**
|
|
13244
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13245
|
+
* through. It stores nothing.
|
|
13246
|
+
*
|
|
13247
|
+
* ## Why a capability at all, and why this shape
|
|
13248
|
+
*
|
|
13249
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13250
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13251
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13252
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13253
|
+
* is assembled from declarations at runtime.
|
|
13254
|
+
*
|
|
13255
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13256
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13257
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13258
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13259
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13260
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13261
|
+
* No new UDS message, no second registry.
|
|
13262
|
+
*
|
|
13263
|
+
* ## What it deliberately does NOT own
|
|
13264
|
+
*
|
|
13265
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13266
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13267
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13268
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13269
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13270
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13271
|
+
* setter for a window and no persistence of any kind.
|
|
13272
|
+
*
|
|
13273
|
+
* ## Why `apply` is here even so
|
|
13274
|
+
*
|
|
13275
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13276
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13277
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13278
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13279
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13280
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13281
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13282
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13283
|
+
*/
|
|
13284
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13285
|
+
var LogChannelApplyResultSchema = object({
|
|
13286
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13287
|
+
armed: number().int().min(0),
|
|
13288
|
+
/**
|
|
13289
|
+
* Names the document armed that this process does not declare. Reported
|
|
13290
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13291
|
+
* not booted, and both deserve a line instead of silence.
|
|
13292
|
+
*/
|
|
13293
|
+
unknown: array(string()).readonly()
|
|
13294
|
+
});
|
|
13295
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13117
13296
|
var LogLevelSchema = _enum([
|
|
13118
13297
|
"debug",
|
|
13119
13298
|
"info",
|
|
@@ -28948,10 +29127,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
28948
29127
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
28949
29128
|
* layer that carries an explicit value wins.
|
|
28950
29129
|
*
|
|
28951
|
-
* `component`
|
|
28952
|
-
*
|
|
28953
|
-
*
|
|
28954
|
-
*
|
|
29130
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
29131
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
29132
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
29133
|
+
* that turning it on would not force every consumer of this document to widen
|
|
29134
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
28955
29135
|
*/
|
|
28956
29136
|
var LoggingScopeKindSchema = _enum([
|
|
28957
29137
|
"cluster",
|
|
@@ -28978,6 +29158,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
28978
29158
|
scope: LoggingScopeKindSchema,
|
|
28979
29159
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
28980
29160
|
nodeId: string().nullable(),
|
|
29161
|
+
/**
|
|
29162
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
29163
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
29164
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
29165
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
29166
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
29167
|
+
*/
|
|
29168
|
+
component: string().nullable(),
|
|
28981
29169
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
28982
29170
|
level: LogLevelSchema$1.nullable()
|
|
28983
29171
|
});
|
|
@@ -29019,6 +29207,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
29019
29207
|
reportEveryMs: number().int().positive().optional()
|
|
29020
29208
|
});
|
|
29021
29209
|
/**
|
|
29210
|
+
* A channel ARMED, as the document reports it.
|
|
29211
|
+
*
|
|
29212
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
29213
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
29214
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
29215
|
+
*/
|
|
29216
|
+
var LogChannelWindowStateSchema = object({
|
|
29217
|
+
channel: string(),
|
|
29218
|
+
armed: boolean(),
|
|
29219
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
29220
|
+
armedUntilMs: number(),
|
|
29221
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
29222
|
+
remainingMs: number(),
|
|
29223
|
+
/**
|
|
29224
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
29225
|
+
*
|
|
29226
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
29227
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
29228
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
29229
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
29230
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
29231
|
+
* not.
|
|
29232
|
+
*/
|
|
29233
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
29234
|
+
});
|
|
29235
|
+
/**
|
|
29236
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
29237
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
29238
|
+
*/
|
|
29239
|
+
var LogChannelWindowPatchSchema = object({
|
|
29240
|
+
channel: string().min(1),
|
|
29241
|
+
armMs: number().int().min(0),
|
|
29242
|
+
/**
|
|
29243
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
29244
|
+
*
|
|
29245
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
29246
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
29247
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
29248
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
29249
|
+
*/
|
|
29250
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
29251
|
+
});
|
|
29252
|
+
/**
|
|
29022
29253
|
* A PATCH, and patches MERGE.
|
|
29023
29254
|
*
|
|
29024
29255
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -29037,7 +29268,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
29037
29268
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
29038
29269
|
* keeps running — a patch is never a full replacement.
|
|
29039
29270
|
*/
|
|
29040
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
29271
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
29272
|
+
/**
|
|
29273
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
29274
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
29275
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
29276
|
+
* the Diagnostics page fight over the same value.
|
|
29277
|
+
*/
|
|
29278
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
29041
29279
|
});
|
|
29042
29280
|
/**
|
|
29043
29281
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -29050,9 +29288,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
29050
29288
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
29051
29289
|
* layer selector needs a name the transport does not already own.
|
|
29052
29290
|
*/
|
|
29053
|
-
var GetLoggingSettingsInputSchema = object({
|
|
29291
|
+
var GetLoggingSettingsInputSchema = object({
|
|
29292
|
+
scopeNodeId: string().optional(),
|
|
29293
|
+
/**
|
|
29294
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
29295
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
29296
|
+
*
|
|
29297
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
29298
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
29299
|
+
* not, and one selector for both would make "which of these two did I just
|
|
29300
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
29301
|
+
*/
|
|
29302
|
+
scopeComponent: string().optional()
|
|
29303
|
+
});
|
|
29054
29304
|
var SetLoggingSettingsInputSchema = object({
|
|
29055
29305
|
scopeNodeId: string().optional(),
|
|
29306
|
+
scopeComponent: string().optional(),
|
|
29056
29307
|
patch: LoggingSettingsPatchSchema
|
|
29057
29308
|
});
|
|
29058
29309
|
/**
|
|
@@ -29067,9 +29318,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
29067
29318
|
var LoggingSettingsStateSchema = object({
|
|
29068
29319
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
29069
29320
|
scopeNodeId: string().nullable(),
|
|
29321
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
29322
|
+
scopeComponent: string().nullable(),
|
|
29070
29323
|
effective: LoggingEffectiveSchema,
|
|
29071
29324
|
explicit: LoggingExplicitSchema,
|
|
29072
29325
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
29326
|
+
/**
|
|
29327
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
29328
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
29329
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
29330
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
29331
|
+
*/
|
|
29332
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
29333
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
29334
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
29073
29335
|
persisted: boolean()
|
|
29074
29336
|
});
|
|
29075
29337
|
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(), {
|
|
@@ -32260,6 +32522,12 @@ Object.freeze({
|
|
|
32260
32522
|
addonId: null,
|
|
32261
32523
|
access: "view"
|
|
32262
32524
|
},
|
|
32525
|
+
"dataStoreProvider.aggregate": {
|
|
32526
|
+
capName: "data-store-provider",
|
|
32527
|
+
capScope: "system",
|
|
32528
|
+
addonId: null,
|
|
32529
|
+
access: "view"
|
|
32530
|
+
},
|
|
32263
32531
|
"dataStoreProvider.count": {
|
|
32264
32532
|
capName: "data-store-provider",
|
|
32265
32533
|
capScope: "system",
|
|
@@ -32674,6 +32942,12 @@ Object.freeze({
|
|
|
32674
32942
|
addonId: null,
|
|
32675
32943
|
access: "view"
|
|
32676
32944
|
},
|
|
32945
|
+
"deviceManager.getChildrenBatch": {
|
|
32946
|
+
capName: "device-manager",
|
|
32947
|
+
capScope: "system",
|
|
32948
|
+
addonId: null,
|
|
32949
|
+
access: "view"
|
|
32950
|
+
},
|
|
32677
32951
|
"deviceManager.getConfigSchema": {
|
|
32678
32952
|
capName: "device-manager",
|
|
32679
32953
|
capScope: "system",
|
|
@@ -33724,6 +33998,18 @@ Object.freeze({
|
|
|
33724
33998
|
addonId: null,
|
|
33725
33999
|
access: "create"
|
|
33726
34000
|
},
|
|
34001
|
+
"logChannels.apply": {
|
|
34002
|
+
capName: "log-channels",
|
|
34003
|
+
capScope: "system",
|
|
34004
|
+
addonId: null,
|
|
34005
|
+
access: "create"
|
|
34006
|
+
},
|
|
34007
|
+
"logChannels.list": {
|
|
34008
|
+
capName: "log-channels",
|
|
34009
|
+
capScope: "system",
|
|
34010
|
+
addonId: null,
|
|
34011
|
+
access: "view"
|
|
34012
|
+
},
|
|
33727
34013
|
"logDestination.query": {
|
|
33728
34014
|
capName: "log-destination",
|
|
33729
34015
|
capScope: "system",
|
|
@@ -35878,6 +36164,12 @@ Object.freeze({
|
|
|
35878
36164
|
addonId: null,
|
|
35879
36165
|
access: "create"
|
|
35880
36166
|
},
|
|
36167
|
+
"settingsStore.aggregate": {
|
|
36168
|
+
capName: "settings-store",
|
|
36169
|
+
capScope: "system",
|
|
36170
|
+
addonId: null,
|
|
36171
|
+
access: "view"
|
|
36172
|
+
},
|
|
35881
36173
|
"settingsStore.count": {
|
|
35882
36174
|
capName: "settings-store",
|
|
35883
36175
|
capScope: "system",
|
|
@@ -37457,6 +37749,11 @@ Object.freeze({
|
|
|
37457
37749
|
form: "single",
|
|
37458
37750
|
optional: false
|
|
37459
37751
|
}],
|
|
37752
|
+
"deviceManager.getChildrenBatch": [{
|
|
37753
|
+
name: "parentDeviceIds",
|
|
37754
|
+
form: "array",
|
|
37755
|
+
optional: false
|
|
37756
|
+
}],
|
|
37460
37757
|
"deviceManager.getConfigSchema": [{
|
|
37461
37758
|
name: "deviceId",
|
|
37462
37759
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -7462,6 +7462,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7462
7462
|
fetchedAt: number()
|
|
7463
7463
|
});
|
|
7464
7464
|
/**
|
|
7465
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7466
|
+
* an addon declares its channels in.
|
|
7467
|
+
*
|
|
7468
|
+
* ## Two axes, deliberately separated
|
|
7469
|
+
*
|
|
7470
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7471
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7472
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7473
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7474
|
+
* `log-channels` capability enumerates the declarations.
|
|
7475
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7476
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7477
|
+
* over the values is the exact defect
|
|
7478
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7479
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7480
|
+
*
|
|
7481
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7482
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7483
|
+
* the hot path with a value somebody actually read, and by
|
|
7484
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7485
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7486
|
+
* disarmed one (D49).
|
|
7487
|
+
*
|
|
7488
|
+
* ## The canonical call shape
|
|
7489
|
+
*
|
|
7490
|
+
* ```ts
|
|
7491
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7492
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7493
|
+
* }
|
|
7494
|
+
* ```
|
|
7495
|
+
*
|
|
7496
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7497
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7498
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7499
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7500
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7501
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7502
|
+
*
|
|
7503
|
+
* ## Why a channel emits at `info`
|
|
7504
|
+
*
|
|
7505
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7506
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7507
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7508
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7509
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7510
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7511
|
+
*/
|
|
7512
|
+
/**
|
|
7513
|
+
* The level a channel writes at once armed.
|
|
7514
|
+
*
|
|
7515
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7516
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7517
|
+
* to read it later.
|
|
7518
|
+
*/
|
|
7519
|
+
var LogChannelLevelSchema = _enum([
|
|
7520
|
+
"info",
|
|
7521
|
+
"warn",
|
|
7522
|
+
"error"
|
|
7523
|
+
]);
|
|
7524
|
+
/**
|
|
7525
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7526
|
+
* declaration is inert.
|
|
7527
|
+
*/
|
|
7528
|
+
var LogChannelDescriptorSchema = object({
|
|
7529
|
+
/**
|
|
7530
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7531
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7532
|
+
* owns it without a second lookup.
|
|
7533
|
+
*/
|
|
7534
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7535
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7536
|
+
description: string().min(1),
|
|
7537
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7538
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7539
|
+
/**
|
|
7540
|
+
* Whether this channel can be narrowed to a camera.
|
|
7541
|
+
*
|
|
7542
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7543
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7544
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7545
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7546
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7547
|
+
* the body is the only way to filter.
|
|
7548
|
+
*
|
|
7549
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7550
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7551
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7552
|
+
* path was never taken.
|
|
7553
|
+
*/
|
|
7554
|
+
perDevice: boolean()
|
|
7555
|
+
});
|
|
7556
|
+
/**
|
|
7557
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7558
|
+
*
|
|
7559
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7560
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7561
|
+
*/
|
|
7562
|
+
var LogChannelWindowSchema = object({
|
|
7563
|
+
channel: string().min(1),
|
|
7564
|
+
/** Epoch ms the window closes at. */
|
|
7565
|
+
armedUntilMs: number(),
|
|
7566
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7567
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7568
|
+
});
|
|
7569
|
+
/**
|
|
7465
7570
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7466
7571
|
* recordings and events management surfaces.
|
|
7467
7572
|
*
|
|
@@ -11082,6 +11187,35 @@ var MutationFilterSchema = object({
|
|
|
11082
11187
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11083
11188
|
whereNot: record(string(), unknown()).optional()
|
|
11084
11189
|
});
|
|
11190
|
+
/**
|
|
11191
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11192
|
+
*
|
|
11193
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11194
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11195
|
+
* a `Record<column, op>` shape could not express.
|
|
11196
|
+
*/
|
|
11197
|
+
var AggregateFieldSchema = object({
|
|
11198
|
+
/** Result key. */
|
|
11199
|
+
as: string().min(1),
|
|
11200
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11201
|
+
field: string().min(1),
|
|
11202
|
+
op: _enum([
|
|
11203
|
+
"sum",
|
|
11204
|
+
"min",
|
|
11205
|
+
"max"
|
|
11206
|
+
])
|
|
11207
|
+
});
|
|
11208
|
+
/**
|
|
11209
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11210
|
+
*
|
|
11211
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11212
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11213
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11214
|
+
*/
|
|
11215
|
+
var AggregateResultSchema = object({
|
|
11216
|
+
count: number().int(),
|
|
11217
|
+
values: record(string(), number().nullable())
|
|
11218
|
+
});
|
|
11085
11219
|
/** A single stored record: `{ id, data }`. */
|
|
11086
11220
|
var SettingsRecordSchema = object({
|
|
11087
11221
|
id: string(),
|
|
@@ -11166,6 +11300,11 @@ method(object({
|
|
|
11166
11300
|
collection: string(),
|
|
11167
11301
|
filter: QueryFilterSchema.optional()
|
|
11168
11302
|
}), number()), method(object({
|
|
11303
|
+
namespace: string().optional(),
|
|
11304
|
+
collection: string(),
|
|
11305
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11306
|
+
filter: QueryFilterSchema.optional()
|
|
11307
|
+
}), AggregateResultSchema), method(object({
|
|
11169
11308
|
namespace: string().optional(),
|
|
11170
11309
|
collection: string(),
|
|
11171
11310
|
field: string(),
|
|
@@ -11282,6 +11421,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11282
11421
|
collection: string(),
|
|
11283
11422
|
filter: QueryFilterSchema.optional()
|
|
11284
11423
|
}), number(), { auth: "admin" }), method(object({
|
|
11424
|
+
namespace: string().optional(),
|
|
11425
|
+
collection: string(),
|
|
11426
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11427
|
+
filter: QueryFilterSchema.optional()
|
|
11428
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11285
11429
|
namespace: string().optional(),
|
|
11286
11430
|
collection: string(),
|
|
11287
11431
|
field: string(),
|
|
@@ -12005,24 +12149,6 @@ var deviceProviderCapability = {
|
|
|
12005
12149
|
})
|
|
12006
12150
|
}
|
|
12007
12151
|
};
|
|
12008
|
-
/**
|
|
12009
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12010
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12011
|
-
*
|
|
12012
|
-
* Replaces:
|
|
12013
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12014
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12015
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12016
|
-
*
|
|
12017
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12018
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12019
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12020
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12021
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12022
|
-
*
|
|
12023
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12024
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12025
|
-
*/
|
|
12026
12152
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12027
12153
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12028
12154
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12391,7 +12517,7 @@ method(object({
|
|
|
12391
12517
|
* it answers today and the caller filters as it already does.
|
|
12392
12518
|
*/
|
|
12393
12519
|
deviceIds: array(number()).optional()
|
|
12394
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12520
|
+
}), 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({
|
|
12395
12521
|
mode: LinkedDevicesModeSchema,
|
|
12396
12522
|
devices: array(LinkedDeviceSchema)
|
|
12397
12523
|
})), 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({
|
|
@@ -13115,6 +13241,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13115
13241
|
kind: "mutation",
|
|
13116
13242
|
auth: "admin"
|
|
13117
13243
|
});
|
|
13244
|
+
/**
|
|
13245
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13246
|
+
* through. It stores nothing.
|
|
13247
|
+
*
|
|
13248
|
+
* ## Why a capability at all, and why this shape
|
|
13249
|
+
*
|
|
13250
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13251
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13252
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13253
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13254
|
+
* is assembled from declarations at runtime.
|
|
13255
|
+
*
|
|
13256
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13257
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13258
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13259
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13260
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13261
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13262
|
+
* No new UDS message, no second registry.
|
|
13263
|
+
*
|
|
13264
|
+
* ## What it deliberately does NOT own
|
|
13265
|
+
*
|
|
13266
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13267
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13268
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13269
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13270
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13271
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13272
|
+
* setter for a window and no persistence of any kind.
|
|
13273
|
+
*
|
|
13274
|
+
* ## Why `apply` is here even so
|
|
13275
|
+
*
|
|
13276
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13277
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13278
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13279
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13280
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13281
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13282
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13283
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13284
|
+
*/
|
|
13285
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13286
|
+
var LogChannelApplyResultSchema = object({
|
|
13287
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13288
|
+
armed: number().int().min(0),
|
|
13289
|
+
/**
|
|
13290
|
+
* Names the document armed that this process does not declare. Reported
|
|
13291
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13292
|
+
* not booted, and both deserve a line instead of silence.
|
|
13293
|
+
*/
|
|
13294
|
+
unknown: array(string()).readonly()
|
|
13295
|
+
});
|
|
13296
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13118
13297
|
var LogLevelSchema = _enum([
|
|
13119
13298
|
"debug",
|
|
13120
13299
|
"info",
|
|
@@ -28949,10 +29128,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
28949
29128
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
28950
29129
|
* layer that carries an explicit value wins.
|
|
28951
29130
|
*
|
|
28952
|
-
* `component`
|
|
28953
|
-
*
|
|
28954
|
-
*
|
|
28955
|
-
*
|
|
29131
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
29132
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
29133
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
29134
|
+
* that turning it on would not force every consumer of this document to widen
|
|
29135
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
28956
29136
|
*/
|
|
28957
29137
|
var LoggingScopeKindSchema = _enum([
|
|
28958
29138
|
"cluster",
|
|
@@ -28979,6 +29159,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
28979
29159
|
scope: LoggingScopeKindSchema,
|
|
28980
29160
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
28981
29161
|
nodeId: string().nullable(),
|
|
29162
|
+
/**
|
|
29163
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
29164
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
29165
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
29166
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
29167
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
29168
|
+
*/
|
|
29169
|
+
component: string().nullable(),
|
|
28982
29170
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
28983
29171
|
level: LogLevelSchema$1.nullable()
|
|
28984
29172
|
});
|
|
@@ -29020,6 +29208,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
29020
29208
|
reportEveryMs: number().int().positive().optional()
|
|
29021
29209
|
});
|
|
29022
29210
|
/**
|
|
29211
|
+
* A channel ARMED, as the document reports it.
|
|
29212
|
+
*
|
|
29213
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
29214
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
29215
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
29216
|
+
*/
|
|
29217
|
+
var LogChannelWindowStateSchema = object({
|
|
29218
|
+
channel: string(),
|
|
29219
|
+
armed: boolean(),
|
|
29220
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
29221
|
+
armedUntilMs: number(),
|
|
29222
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
29223
|
+
remainingMs: number(),
|
|
29224
|
+
/**
|
|
29225
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
29226
|
+
*
|
|
29227
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
29228
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
29229
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
29230
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
29231
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
29232
|
+
* not.
|
|
29233
|
+
*/
|
|
29234
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
29235
|
+
});
|
|
29236
|
+
/**
|
|
29237
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
29238
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
29239
|
+
*/
|
|
29240
|
+
var LogChannelWindowPatchSchema = object({
|
|
29241
|
+
channel: string().min(1),
|
|
29242
|
+
armMs: number().int().min(0),
|
|
29243
|
+
/**
|
|
29244
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
29245
|
+
*
|
|
29246
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
29247
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
29248
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
29249
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
29250
|
+
*/
|
|
29251
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
29252
|
+
});
|
|
29253
|
+
/**
|
|
29023
29254
|
* A PATCH, and patches MERGE.
|
|
29024
29255
|
*
|
|
29025
29256
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -29038,7 +29269,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
29038
29269
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
29039
29270
|
* keeps running — a patch is never a full replacement.
|
|
29040
29271
|
*/
|
|
29041
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
29272
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
29273
|
+
/**
|
|
29274
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
29275
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
29276
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
29277
|
+
* the Diagnostics page fight over the same value.
|
|
29278
|
+
*/
|
|
29279
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
29042
29280
|
});
|
|
29043
29281
|
/**
|
|
29044
29282
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -29051,9 +29289,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
29051
29289
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
29052
29290
|
* layer selector needs a name the transport does not already own.
|
|
29053
29291
|
*/
|
|
29054
|
-
var GetLoggingSettingsInputSchema = object({
|
|
29292
|
+
var GetLoggingSettingsInputSchema = object({
|
|
29293
|
+
scopeNodeId: string().optional(),
|
|
29294
|
+
/**
|
|
29295
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
29296
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
29297
|
+
*
|
|
29298
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
29299
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
29300
|
+
* not, and one selector for both would make "which of these two did I just
|
|
29301
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
29302
|
+
*/
|
|
29303
|
+
scopeComponent: string().optional()
|
|
29304
|
+
});
|
|
29055
29305
|
var SetLoggingSettingsInputSchema = object({
|
|
29056
29306
|
scopeNodeId: string().optional(),
|
|
29307
|
+
scopeComponent: string().optional(),
|
|
29057
29308
|
patch: LoggingSettingsPatchSchema
|
|
29058
29309
|
});
|
|
29059
29310
|
/**
|
|
@@ -29068,9 +29319,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
29068
29319
|
var LoggingSettingsStateSchema = object({
|
|
29069
29320
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
29070
29321
|
scopeNodeId: string().nullable(),
|
|
29322
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
29323
|
+
scopeComponent: string().nullable(),
|
|
29071
29324
|
effective: LoggingEffectiveSchema,
|
|
29072
29325
|
explicit: LoggingExplicitSchema,
|
|
29073
29326
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
29327
|
+
/**
|
|
29328
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
29329
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
29330
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
29331
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
29332
|
+
*/
|
|
29333
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
29334
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
29335
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
29074
29336
|
persisted: boolean()
|
|
29075
29337
|
});
|
|
29076
29338
|
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(), {
|
|
@@ -32261,6 +32523,12 @@ Object.freeze({
|
|
|
32261
32523
|
addonId: null,
|
|
32262
32524
|
access: "view"
|
|
32263
32525
|
},
|
|
32526
|
+
"dataStoreProvider.aggregate": {
|
|
32527
|
+
capName: "data-store-provider",
|
|
32528
|
+
capScope: "system",
|
|
32529
|
+
addonId: null,
|
|
32530
|
+
access: "view"
|
|
32531
|
+
},
|
|
32264
32532
|
"dataStoreProvider.count": {
|
|
32265
32533
|
capName: "data-store-provider",
|
|
32266
32534
|
capScope: "system",
|
|
@@ -32675,6 +32943,12 @@ Object.freeze({
|
|
|
32675
32943
|
addonId: null,
|
|
32676
32944
|
access: "view"
|
|
32677
32945
|
},
|
|
32946
|
+
"deviceManager.getChildrenBatch": {
|
|
32947
|
+
capName: "device-manager",
|
|
32948
|
+
capScope: "system",
|
|
32949
|
+
addonId: null,
|
|
32950
|
+
access: "view"
|
|
32951
|
+
},
|
|
32678
32952
|
"deviceManager.getConfigSchema": {
|
|
32679
32953
|
capName: "device-manager",
|
|
32680
32954
|
capScope: "system",
|
|
@@ -33725,6 +33999,18 @@ Object.freeze({
|
|
|
33725
33999
|
addonId: null,
|
|
33726
34000
|
access: "create"
|
|
33727
34001
|
},
|
|
34002
|
+
"logChannels.apply": {
|
|
34003
|
+
capName: "log-channels",
|
|
34004
|
+
capScope: "system",
|
|
34005
|
+
addonId: null,
|
|
34006
|
+
access: "create"
|
|
34007
|
+
},
|
|
34008
|
+
"logChannels.list": {
|
|
34009
|
+
capName: "log-channels",
|
|
34010
|
+
capScope: "system",
|
|
34011
|
+
addonId: null,
|
|
34012
|
+
access: "view"
|
|
34013
|
+
},
|
|
33728
34014
|
"logDestination.query": {
|
|
33729
34015
|
capName: "log-destination",
|
|
33730
34016
|
capScope: "system",
|
|
@@ -35879,6 +36165,12 @@ Object.freeze({
|
|
|
35879
36165
|
addonId: null,
|
|
35880
36166
|
access: "create"
|
|
35881
36167
|
},
|
|
36168
|
+
"settingsStore.aggregate": {
|
|
36169
|
+
capName: "settings-store",
|
|
36170
|
+
capScope: "system",
|
|
36171
|
+
addonId: null,
|
|
36172
|
+
access: "view"
|
|
36173
|
+
},
|
|
35882
36174
|
"settingsStore.count": {
|
|
35883
36175
|
capName: "settings-store",
|
|
35884
36176
|
capScope: "system",
|
|
@@ -37458,6 +37750,11 @@ Object.freeze({
|
|
|
37458
37750
|
form: "single",
|
|
37459
37751
|
optional: false
|
|
37460
37752
|
}],
|
|
37753
|
+
"deviceManager.getChildrenBatch": [{
|
|
37754
|
+
name: "parentDeviceIds",
|
|
37755
|
+
form: "array",
|
|
37756
|
+
optional: false
|
|
37757
|
+
}],
|
|
37461
37758
|
"deviceManager.getConfigSchema": [{
|
|
37462
37759
|
name: "deviceId",
|
|
37463
37760
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-amcrest",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.36",
|
|
4
4
|
"description": "Amcrest/Dahua camera device provider addon for CamStack — Dahua CGI over HTTP(S) with digest auth (snapshot, RTSP catalog, PTZ, image/day-night config)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|