@camstack/addon-provider-gree 0.2.32 → 0.2.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/addon.js +322 -25
- package/dist/addon.mjs +322 -25
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -7471,6 +7471,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7471
7471
|
fetchedAt: number()
|
|
7472
7472
|
});
|
|
7473
7473
|
/**
|
|
7474
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7475
|
+
* an addon declares its channels in.
|
|
7476
|
+
*
|
|
7477
|
+
* ## Two axes, deliberately separated
|
|
7478
|
+
*
|
|
7479
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7480
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7481
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7482
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7483
|
+
* `log-channels` capability enumerates the declarations.
|
|
7484
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7485
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7486
|
+
* over the values is the exact defect
|
|
7487
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7488
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7489
|
+
*
|
|
7490
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7491
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7492
|
+
* the hot path with a value somebody actually read, and by
|
|
7493
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7494
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7495
|
+
* disarmed one (D49).
|
|
7496
|
+
*
|
|
7497
|
+
* ## The canonical call shape
|
|
7498
|
+
*
|
|
7499
|
+
* ```ts
|
|
7500
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7501
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7502
|
+
* }
|
|
7503
|
+
* ```
|
|
7504
|
+
*
|
|
7505
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7506
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7507
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7508
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7509
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7510
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7511
|
+
*
|
|
7512
|
+
* ## Why a channel emits at `info`
|
|
7513
|
+
*
|
|
7514
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7515
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7516
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7517
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7518
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7519
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7520
|
+
*/
|
|
7521
|
+
/**
|
|
7522
|
+
* The level a channel writes at once armed.
|
|
7523
|
+
*
|
|
7524
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7525
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7526
|
+
* to read it later.
|
|
7527
|
+
*/
|
|
7528
|
+
var LogChannelLevelSchema = _enum([
|
|
7529
|
+
"info",
|
|
7530
|
+
"warn",
|
|
7531
|
+
"error"
|
|
7532
|
+
]);
|
|
7533
|
+
/**
|
|
7534
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7535
|
+
* declaration is inert.
|
|
7536
|
+
*/
|
|
7537
|
+
var LogChannelDescriptorSchema = object({
|
|
7538
|
+
/**
|
|
7539
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7540
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7541
|
+
* owns it without a second lookup.
|
|
7542
|
+
*/
|
|
7543
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7544
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7545
|
+
description: string().min(1),
|
|
7546
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7547
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7548
|
+
/**
|
|
7549
|
+
* Whether this channel can be narrowed to a camera.
|
|
7550
|
+
*
|
|
7551
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7552
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7553
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7554
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7555
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7556
|
+
* the body is the only way to filter.
|
|
7557
|
+
*
|
|
7558
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7559
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7560
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7561
|
+
* path was never taken.
|
|
7562
|
+
*/
|
|
7563
|
+
perDevice: boolean()
|
|
7564
|
+
});
|
|
7565
|
+
/**
|
|
7566
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7567
|
+
*
|
|
7568
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7569
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7570
|
+
*/
|
|
7571
|
+
var LogChannelWindowSchema = object({
|
|
7572
|
+
channel: string().min(1),
|
|
7573
|
+
/** Epoch ms the window closes at. */
|
|
7574
|
+
armedUntilMs: number(),
|
|
7575
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7576
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7577
|
+
});
|
|
7578
|
+
/**
|
|
7474
7579
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7475
7580
|
* recordings and events management surfaces.
|
|
7476
7581
|
*
|
|
@@ -11091,6 +11196,35 @@ var MutationFilterSchema = object({
|
|
|
11091
11196
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11092
11197
|
whereNot: record(string(), unknown()).optional()
|
|
11093
11198
|
});
|
|
11199
|
+
/**
|
|
11200
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11201
|
+
*
|
|
11202
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11203
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11204
|
+
* a `Record<column, op>` shape could not express.
|
|
11205
|
+
*/
|
|
11206
|
+
var AggregateFieldSchema = object({
|
|
11207
|
+
/** Result key. */
|
|
11208
|
+
as: string().min(1),
|
|
11209
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11210
|
+
field: string().min(1),
|
|
11211
|
+
op: _enum([
|
|
11212
|
+
"sum",
|
|
11213
|
+
"min",
|
|
11214
|
+
"max"
|
|
11215
|
+
])
|
|
11216
|
+
});
|
|
11217
|
+
/**
|
|
11218
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11219
|
+
*
|
|
11220
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11221
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11222
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11223
|
+
*/
|
|
11224
|
+
var AggregateResultSchema = object({
|
|
11225
|
+
count: number().int(),
|
|
11226
|
+
values: record(string(), number().nullable())
|
|
11227
|
+
});
|
|
11094
11228
|
/** A single stored record: `{ id, data }`. */
|
|
11095
11229
|
var SettingsRecordSchema = object({
|
|
11096
11230
|
id: string(),
|
|
@@ -11175,6 +11309,11 @@ method(object({
|
|
|
11175
11309
|
collection: string(),
|
|
11176
11310
|
filter: QueryFilterSchema.optional()
|
|
11177
11311
|
}), number()), method(object({
|
|
11312
|
+
namespace: string().optional(),
|
|
11313
|
+
collection: string(),
|
|
11314
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11315
|
+
filter: QueryFilterSchema.optional()
|
|
11316
|
+
}), AggregateResultSchema), method(object({
|
|
11178
11317
|
namespace: string().optional(),
|
|
11179
11318
|
collection: string(),
|
|
11180
11319
|
field: string(),
|
|
@@ -11291,6 +11430,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11291
11430
|
collection: string(),
|
|
11292
11431
|
filter: QueryFilterSchema.optional()
|
|
11293
11432
|
}), number(), { auth: "admin" }), method(object({
|
|
11433
|
+
namespace: string().optional(),
|
|
11434
|
+
collection: string(),
|
|
11435
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11436
|
+
filter: QueryFilterSchema.optional()
|
|
11437
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11294
11438
|
namespace: string().optional(),
|
|
11295
11439
|
collection: string(),
|
|
11296
11440
|
field: string(),
|
|
@@ -12014,24 +12158,6 @@ var deviceProviderCapability = {
|
|
|
12014
12158
|
})
|
|
12015
12159
|
}
|
|
12016
12160
|
};
|
|
12017
|
-
/**
|
|
12018
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12019
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12020
|
-
*
|
|
12021
|
-
* Replaces:
|
|
12022
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12023
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12024
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12025
|
-
*
|
|
12026
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12027
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12028
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12029
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12030
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12031
|
-
*
|
|
12032
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12033
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12034
|
-
*/
|
|
12035
12161
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12036
12162
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12037
12163
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12400,7 +12526,7 @@ method(object({
|
|
|
12400
12526
|
* it answers today and the caller filters as it already does.
|
|
12401
12527
|
*/
|
|
12402
12528
|
deviceIds: array(number()).optional()
|
|
12403
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12529
|
+
}), 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({
|
|
12404
12530
|
mode: LinkedDevicesModeSchema,
|
|
12405
12531
|
devices: array(LinkedDeviceSchema)
|
|
12406
12532
|
})), 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({
|
|
@@ -13124,6 +13250,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13124
13250
|
kind: "mutation",
|
|
13125
13251
|
auth: "admin"
|
|
13126
13252
|
});
|
|
13253
|
+
/**
|
|
13254
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13255
|
+
* through. It stores nothing.
|
|
13256
|
+
*
|
|
13257
|
+
* ## Why a capability at all, and why this shape
|
|
13258
|
+
*
|
|
13259
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13260
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13261
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13262
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13263
|
+
* is assembled from declarations at runtime.
|
|
13264
|
+
*
|
|
13265
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13266
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13267
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13268
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13269
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13270
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13271
|
+
* No new UDS message, no second registry.
|
|
13272
|
+
*
|
|
13273
|
+
* ## What it deliberately does NOT own
|
|
13274
|
+
*
|
|
13275
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13276
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13277
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13278
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13279
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13280
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13281
|
+
* setter for a window and no persistence of any kind.
|
|
13282
|
+
*
|
|
13283
|
+
* ## Why `apply` is here even so
|
|
13284
|
+
*
|
|
13285
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13286
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13287
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13288
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13289
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13290
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13291
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13292
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13293
|
+
*/
|
|
13294
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13295
|
+
var LogChannelApplyResultSchema = object({
|
|
13296
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13297
|
+
armed: number().int().min(0),
|
|
13298
|
+
/**
|
|
13299
|
+
* Names the document armed that this process does not declare. Reported
|
|
13300
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13301
|
+
* not booted, and both deserve a line instead of silence.
|
|
13302
|
+
*/
|
|
13303
|
+
unknown: array(string()).readonly()
|
|
13304
|
+
});
|
|
13305
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13127
13306
|
var LogLevelSchema = _enum([
|
|
13128
13307
|
"debug",
|
|
13129
13308
|
"info",
|
|
@@ -28568,10 +28747,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
28568
28747
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
28569
28748
|
* layer that carries an explicit value wins.
|
|
28570
28749
|
*
|
|
28571
|
-
* `component`
|
|
28572
|
-
*
|
|
28573
|
-
*
|
|
28574
|
-
*
|
|
28750
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
28751
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
28752
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
28753
|
+
* that turning it on would not force every consumer of this document to widen
|
|
28754
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
28575
28755
|
*/
|
|
28576
28756
|
var LoggingScopeKindSchema = _enum([
|
|
28577
28757
|
"cluster",
|
|
@@ -28598,6 +28778,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
28598
28778
|
scope: LoggingScopeKindSchema,
|
|
28599
28779
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
28600
28780
|
nodeId: string().nullable(),
|
|
28781
|
+
/**
|
|
28782
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
28783
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
28784
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
28785
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
28786
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
28787
|
+
*/
|
|
28788
|
+
component: string().nullable(),
|
|
28601
28789
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
28602
28790
|
level: LogLevelSchema$1.nullable()
|
|
28603
28791
|
});
|
|
@@ -28639,6 +28827,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
28639
28827
|
reportEveryMs: number().int().positive().optional()
|
|
28640
28828
|
});
|
|
28641
28829
|
/**
|
|
28830
|
+
* A channel ARMED, as the document reports it.
|
|
28831
|
+
*
|
|
28832
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
28833
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
28834
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
28835
|
+
*/
|
|
28836
|
+
var LogChannelWindowStateSchema = object({
|
|
28837
|
+
channel: string(),
|
|
28838
|
+
armed: boolean(),
|
|
28839
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
28840
|
+
armedUntilMs: number(),
|
|
28841
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
28842
|
+
remainingMs: number(),
|
|
28843
|
+
/**
|
|
28844
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
28845
|
+
*
|
|
28846
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
28847
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
28848
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
28849
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
28850
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
28851
|
+
* not.
|
|
28852
|
+
*/
|
|
28853
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
28854
|
+
});
|
|
28855
|
+
/**
|
|
28856
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
28857
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
28858
|
+
*/
|
|
28859
|
+
var LogChannelWindowPatchSchema = object({
|
|
28860
|
+
channel: string().min(1),
|
|
28861
|
+
armMs: number().int().min(0),
|
|
28862
|
+
/**
|
|
28863
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
28864
|
+
*
|
|
28865
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
28866
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
28867
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
28868
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
28869
|
+
*/
|
|
28870
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
28871
|
+
});
|
|
28872
|
+
/**
|
|
28642
28873
|
* A PATCH, and patches MERGE.
|
|
28643
28874
|
*
|
|
28644
28875
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -28657,7 +28888,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28657
28888
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
28658
28889
|
* keeps running — a patch is never a full replacement.
|
|
28659
28890
|
*/
|
|
28660
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
28891
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
28892
|
+
/**
|
|
28893
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
28894
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
28895
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
28896
|
+
* the Diagnostics page fight over the same value.
|
|
28897
|
+
*/
|
|
28898
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
28661
28899
|
});
|
|
28662
28900
|
/**
|
|
28663
28901
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -28670,9 +28908,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28670
28908
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
28671
28909
|
* layer selector needs a name the transport does not already own.
|
|
28672
28910
|
*/
|
|
28673
|
-
var GetLoggingSettingsInputSchema = object({
|
|
28911
|
+
var GetLoggingSettingsInputSchema = object({
|
|
28912
|
+
scopeNodeId: string().optional(),
|
|
28913
|
+
/**
|
|
28914
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
28915
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
28916
|
+
*
|
|
28917
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
28918
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
28919
|
+
* not, and one selector for both would make "which of these two did I just
|
|
28920
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
28921
|
+
*/
|
|
28922
|
+
scopeComponent: string().optional()
|
|
28923
|
+
});
|
|
28674
28924
|
var SetLoggingSettingsInputSchema = object({
|
|
28675
28925
|
scopeNodeId: string().optional(),
|
|
28926
|
+
scopeComponent: string().optional(),
|
|
28676
28927
|
patch: LoggingSettingsPatchSchema
|
|
28677
28928
|
});
|
|
28678
28929
|
/**
|
|
@@ -28687,9 +28938,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
28687
28938
|
var LoggingSettingsStateSchema = object({
|
|
28688
28939
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
28689
28940
|
scopeNodeId: string().nullable(),
|
|
28941
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
28942
|
+
scopeComponent: string().nullable(),
|
|
28690
28943
|
effective: LoggingEffectiveSchema,
|
|
28691
28944
|
explicit: LoggingExplicitSchema,
|
|
28692
28945
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
28946
|
+
/**
|
|
28947
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
28948
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
28949
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
28950
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
28951
|
+
*/
|
|
28952
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
28953
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
28954
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
28693
28955
|
persisted: boolean()
|
|
28694
28956
|
});
|
|
28695
28957
|
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(), {
|
|
@@ -31674,6 +31936,12 @@ Object.freeze({
|
|
|
31674
31936
|
addonId: null,
|
|
31675
31937
|
access: "view"
|
|
31676
31938
|
},
|
|
31939
|
+
"dataStoreProvider.aggregate": {
|
|
31940
|
+
capName: "data-store-provider",
|
|
31941
|
+
capScope: "system",
|
|
31942
|
+
addonId: null,
|
|
31943
|
+
access: "view"
|
|
31944
|
+
},
|
|
31677
31945
|
"dataStoreProvider.count": {
|
|
31678
31946
|
capName: "data-store-provider",
|
|
31679
31947
|
capScope: "system",
|
|
@@ -32088,6 +32356,12 @@ Object.freeze({
|
|
|
32088
32356
|
addonId: null,
|
|
32089
32357
|
access: "view"
|
|
32090
32358
|
},
|
|
32359
|
+
"deviceManager.getChildrenBatch": {
|
|
32360
|
+
capName: "device-manager",
|
|
32361
|
+
capScope: "system",
|
|
32362
|
+
addonId: null,
|
|
32363
|
+
access: "view"
|
|
32364
|
+
},
|
|
32091
32365
|
"deviceManager.getConfigSchema": {
|
|
32092
32366
|
capName: "device-manager",
|
|
32093
32367
|
capScope: "system",
|
|
@@ -33138,6 +33412,18 @@ Object.freeze({
|
|
|
33138
33412
|
addonId: null,
|
|
33139
33413
|
access: "create"
|
|
33140
33414
|
},
|
|
33415
|
+
"logChannels.apply": {
|
|
33416
|
+
capName: "log-channels",
|
|
33417
|
+
capScope: "system",
|
|
33418
|
+
addonId: null,
|
|
33419
|
+
access: "create"
|
|
33420
|
+
},
|
|
33421
|
+
"logChannels.list": {
|
|
33422
|
+
capName: "log-channels",
|
|
33423
|
+
capScope: "system",
|
|
33424
|
+
addonId: null,
|
|
33425
|
+
access: "view"
|
|
33426
|
+
},
|
|
33141
33427
|
"logDestination.query": {
|
|
33142
33428
|
capName: "log-destination",
|
|
33143
33429
|
capScope: "system",
|
|
@@ -35292,6 +35578,12 @@ Object.freeze({
|
|
|
35292
35578
|
addonId: null,
|
|
35293
35579
|
access: "create"
|
|
35294
35580
|
},
|
|
35581
|
+
"settingsStore.aggregate": {
|
|
35582
|
+
capName: "settings-store",
|
|
35583
|
+
capScope: "system",
|
|
35584
|
+
addonId: null,
|
|
35585
|
+
access: "view"
|
|
35586
|
+
},
|
|
35295
35587
|
"settingsStore.count": {
|
|
35296
35588
|
capName: "settings-store",
|
|
35297
35589
|
capScope: "system",
|
|
@@ -36871,6 +37163,11 @@ Object.freeze({
|
|
|
36871
37163
|
form: "single",
|
|
36872
37164
|
optional: false
|
|
36873
37165
|
}],
|
|
37166
|
+
"deviceManager.getChildrenBatch": [{
|
|
37167
|
+
name: "parentDeviceIds",
|
|
37168
|
+
form: "array",
|
|
37169
|
+
optional: false
|
|
37170
|
+
}],
|
|
36874
37171
|
"deviceManager.getConfigSchema": [{
|
|
36875
37172
|
name: "deviceId",
|
|
36876
37173
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -7470,6 +7470,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7470
7470
|
fetchedAt: number()
|
|
7471
7471
|
});
|
|
7472
7472
|
/**
|
|
7473
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7474
|
+
* an addon declares its channels in.
|
|
7475
|
+
*
|
|
7476
|
+
* ## Two axes, deliberately separated
|
|
7477
|
+
*
|
|
7478
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7479
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7480
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7481
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7482
|
+
* `log-channels` capability enumerates the declarations.
|
|
7483
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7484
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7485
|
+
* over the values is the exact defect
|
|
7486
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7487
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7488
|
+
*
|
|
7489
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7490
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7491
|
+
* the hot path with a value somebody actually read, and by
|
|
7492
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7493
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7494
|
+
* disarmed one (D49).
|
|
7495
|
+
*
|
|
7496
|
+
* ## The canonical call shape
|
|
7497
|
+
*
|
|
7498
|
+
* ```ts
|
|
7499
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7500
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7501
|
+
* }
|
|
7502
|
+
* ```
|
|
7503
|
+
*
|
|
7504
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7505
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7506
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7507
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7508
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7509
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7510
|
+
*
|
|
7511
|
+
* ## Why a channel emits at `info`
|
|
7512
|
+
*
|
|
7513
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7514
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7515
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7516
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7517
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7518
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7519
|
+
*/
|
|
7520
|
+
/**
|
|
7521
|
+
* The level a channel writes at once armed.
|
|
7522
|
+
*
|
|
7523
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7524
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7525
|
+
* to read it later.
|
|
7526
|
+
*/
|
|
7527
|
+
var LogChannelLevelSchema = _enum([
|
|
7528
|
+
"info",
|
|
7529
|
+
"warn",
|
|
7530
|
+
"error"
|
|
7531
|
+
]);
|
|
7532
|
+
/**
|
|
7533
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7534
|
+
* declaration is inert.
|
|
7535
|
+
*/
|
|
7536
|
+
var LogChannelDescriptorSchema = object({
|
|
7537
|
+
/**
|
|
7538
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7539
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7540
|
+
* owns it without a second lookup.
|
|
7541
|
+
*/
|
|
7542
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7543
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7544
|
+
description: string().min(1),
|
|
7545
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7546
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7547
|
+
/**
|
|
7548
|
+
* Whether this channel can be narrowed to a camera.
|
|
7549
|
+
*
|
|
7550
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7551
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7552
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7553
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7554
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7555
|
+
* the body is the only way to filter.
|
|
7556
|
+
*
|
|
7557
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7558
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7559
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7560
|
+
* path was never taken.
|
|
7561
|
+
*/
|
|
7562
|
+
perDevice: boolean()
|
|
7563
|
+
});
|
|
7564
|
+
/**
|
|
7565
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7566
|
+
*
|
|
7567
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7568
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7569
|
+
*/
|
|
7570
|
+
var LogChannelWindowSchema = object({
|
|
7571
|
+
channel: string().min(1),
|
|
7572
|
+
/** Epoch ms the window closes at. */
|
|
7573
|
+
armedUntilMs: number(),
|
|
7574
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7575
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7576
|
+
});
|
|
7577
|
+
/**
|
|
7473
7578
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7474
7579
|
* recordings and events management surfaces.
|
|
7475
7580
|
*
|
|
@@ -11090,6 +11195,35 @@ var MutationFilterSchema = object({
|
|
|
11090
11195
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11091
11196
|
whereNot: record(string(), unknown()).optional()
|
|
11092
11197
|
});
|
|
11198
|
+
/**
|
|
11199
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11200
|
+
*
|
|
11201
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11202
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11203
|
+
* a `Record<column, op>` shape could not express.
|
|
11204
|
+
*/
|
|
11205
|
+
var AggregateFieldSchema = object({
|
|
11206
|
+
/** Result key. */
|
|
11207
|
+
as: string().min(1),
|
|
11208
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11209
|
+
field: string().min(1),
|
|
11210
|
+
op: _enum([
|
|
11211
|
+
"sum",
|
|
11212
|
+
"min",
|
|
11213
|
+
"max"
|
|
11214
|
+
])
|
|
11215
|
+
});
|
|
11216
|
+
/**
|
|
11217
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11218
|
+
*
|
|
11219
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11220
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11221
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11222
|
+
*/
|
|
11223
|
+
var AggregateResultSchema = object({
|
|
11224
|
+
count: number().int(),
|
|
11225
|
+
values: record(string(), number().nullable())
|
|
11226
|
+
});
|
|
11093
11227
|
/** A single stored record: `{ id, data }`. */
|
|
11094
11228
|
var SettingsRecordSchema = object({
|
|
11095
11229
|
id: string(),
|
|
@@ -11174,6 +11308,11 @@ method(object({
|
|
|
11174
11308
|
collection: string(),
|
|
11175
11309
|
filter: QueryFilterSchema.optional()
|
|
11176
11310
|
}), number()), method(object({
|
|
11311
|
+
namespace: string().optional(),
|
|
11312
|
+
collection: string(),
|
|
11313
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11314
|
+
filter: QueryFilterSchema.optional()
|
|
11315
|
+
}), AggregateResultSchema), method(object({
|
|
11177
11316
|
namespace: string().optional(),
|
|
11178
11317
|
collection: string(),
|
|
11179
11318
|
field: string(),
|
|
@@ -11290,6 +11429,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11290
11429
|
collection: string(),
|
|
11291
11430
|
filter: QueryFilterSchema.optional()
|
|
11292
11431
|
}), number(), { auth: "admin" }), method(object({
|
|
11432
|
+
namespace: string().optional(),
|
|
11433
|
+
collection: string(),
|
|
11434
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11435
|
+
filter: QueryFilterSchema.optional()
|
|
11436
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11293
11437
|
namespace: string().optional(),
|
|
11294
11438
|
collection: string(),
|
|
11295
11439
|
field: string(),
|
|
@@ -12013,24 +12157,6 @@ var deviceProviderCapability = {
|
|
|
12013
12157
|
})
|
|
12014
12158
|
}
|
|
12015
12159
|
};
|
|
12016
|
-
/**
|
|
12017
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12018
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12019
|
-
*
|
|
12020
|
-
* Replaces:
|
|
12021
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12022
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12023
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12024
|
-
*
|
|
12025
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12026
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12027
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12028
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12029
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12030
|
-
*
|
|
12031
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12032
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12033
|
-
*/
|
|
12034
12160
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12035
12161
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12036
12162
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12399,7 +12525,7 @@ method(object({
|
|
|
12399
12525
|
* it answers today and the caller filters as it already does.
|
|
12400
12526
|
*/
|
|
12401
12527
|
deviceIds: array(number()).optional()
|
|
12402
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12528
|
+
}), 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({
|
|
12403
12529
|
mode: LinkedDevicesModeSchema,
|
|
12404
12530
|
devices: array(LinkedDeviceSchema)
|
|
12405
12531
|
})), 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({
|
|
@@ -13123,6 +13249,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13123
13249
|
kind: "mutation",
|
|
13124
13250
|
auth: "admin"
|
|
13125
13251
|
});
|
|
13252
|
+
/**
|
|
13253
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13254
|
+
* through. It stores nothing.
|
|
13255
|
+
*
|
|
13256
|
+
* ## Why a capability at all, and why this shape
|
|
13257
|
+
*
|
|
13258
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13259
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13260
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13261
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13262
|
+
* is assembled from declarations at runtime.
|
|
13263
|
+
*
|
|
13264
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13265
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13266
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13267
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13268
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13269
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13270
|
+
* No new UDS message, no second registry.
|
|
13271
|
+
*
|
|
13272
|
+
* ## What it deliberately does NOT own
|
|
13273
|
+
*
|
|
13274
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13275
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13276
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13277
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13278
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13279
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13280
|
+
* setter for a window and no persistence of any kind.
|
|
13281
|
+
*
|
|
13282
|
+
* ## Why `apply` is here even so
|
|
13283
|
+
*
|
|
13284
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13285
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13286
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13287
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13288
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13289
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13290
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13291
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13292
|
+
*/
|
|
13293
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13294
|
+
var LogChannelApplyResultSchema = object({
|
|
13295
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13296
|
+
armed: number().int().min(0),
|
|
13297
|
+
/**
|
|
13298
|
+
* Names the document armed that this process does not declare. Reported
|
|
13299
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13300
|
+
* not booted, and both deserve a line instead of silence.
|
|
13301
|
+
*/
|
|
13302
|
+
unknown: array(string()).readonly()
|
|
13303
|
+
});
|
|
13304
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13126
13305
|
var LogLevelSchema = _enum([
|
|
13127
13306
|
"debug",
|
|
13128
13307
|
"info",
|
|
@@ -28567,10 +28746,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
28567
28746
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
28568
28747
|
* layer that carries an explicit value wins.
|
|
28569
28748
|
*
|
|
28570
|
-
* `component`
|
|
28571
|
-
*
|
|
28572
|
-
*
|
|
28573
|
-
*
|
|
28749
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
28750
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
28751
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
28752
|
+
* that turning it on would not force every consumer of this document to widen
|
|
28753
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
28574
28754
|
*/
|
|
28575
28755
|
var LoggingScopeKindSchema = _enum([
|
|
28576
28756
|
"cluster",
|
|
@@ -28597,6 +28777,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
28597
28777
|
scope: LoggingScopeKindSchema,
|
|
28598
28778
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
28599
28779
|
nodeId: string().nullable(),
|
|
28780
|
+
/**
|
|
28781
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
28782
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
28783
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
28784
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
28785
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
28786
|
+
*/
|
|
28787
|
+
component: string().nullable(),
|
|
28600
28788
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
28601
28789
|
level: LogLevelSchema$1.nullable()
|
|
28602
28790
|
});
|
|
@@ -28638,6 +28826,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
28638
28826
|
reportEveryMs: number().int().positive().optional()
|
|
28639
28827
|
});
|
|
28640
28828
|
/**
|
|
28829
|
+
* A channel ARMED, as the document reports it.
|
|
28830
|
+
*
|
|
28831
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
28832
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
28833
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
28834
|
+
*/
|
|
28835
|
+
var LogChannelWindowStateSchema = object({
|
|
28836
|
+
channel: string(),
|
|
28837
|
+
armed: boolean(),
|
|
28838
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
28839
|
+
armedUntilMs: number(),
|
|
28840
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
28841
|
+
remainingMs: number(),
|
|
28842
|
+
/**
|
|
28843
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
28844
|
+
*
|
|
28845
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
28846
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
28847
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
28848
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
28849
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
28850
|
+
* not.
|
|
28851
|
+
*/
|
|
28852
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
28853
|
+
});
|
|
28854
|
+
/**
|
|
28855
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
28856
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
28857
|
+
*/
|
|
28858
|
+
var LogChannelWindowPatchSchema = object({
|
|
28859
|
+
channel: string().min(1),
|
|
28860
|
+
armMs: number().int().min(0),
|
|
28861
|
+
/**
|
|
28862
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
28863
|
+
*
|
|
28864
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
28865
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
28866
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
28867
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
28868
|
+
*/
|
|
28869
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
28870
|
+
});
|
|
28871
|
+
/**
|
|
28641
28872
|
* A PATCH, and patches MERGE.
|
|
28642
28873
|
*
|
|
28643
28874
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -28656,7 +28887,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28656
28887
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
28657
28888
|
* keeps running — a patch is never a full replacement.
|
|
28658
28889
|
*/
|
|
28659
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
28890
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
28891
|
+
/**
|
|
28892
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
28893
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
28894
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
28895
|
+
* the Diagnostics page fight over the same value.
|
|
28896
|
+
*/
|
|
28897
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
28660
28898
|
});
|
|
28661
28899
|
/**
|
|
28662
28900
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -28669,9 +28907,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28669
28907
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
28670
28908
|
* layer selector needs a name the transport does not already own.
|
|
28671
28909
|
*/
|
|
28672
|
-
var GetLoggingSettingsInputSchema = object({
|
|
28910
|
+
var GetLoggingSettingsInputSchema = object({
|
|
28911
|
+
scopeNodeId: string().optional(),
|
|
28912
|
+
/**
|
|
28913
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
28914
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
28915
|
+
*
|
|
28916
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
28917
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
28918
|
+
* not, and one selector for both would make "which of these two did I just
|
|
28919
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
28920
|
+
*/
|
|
28921
|
+
scopeComponent: string().optional()
|
|
28922
|
+
});
|
|
28673
28923
|
var SetLoggingSettingsInputSchema = object({
|
|
28674
28924
|
scopeNodeId: string().optional(),
|
|
28925
|
+
scopeComponent: string().optional(),
|
|
28675
28926
|
patch: LoggingSettingsPatchSchema
|
|
28676
28927
|
});
|
|
28677
28928
|
/**
|
|
@@ -28686,9 +28937,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
28686
28937
|
var LoggingSettingsStateSchema = object({
|
|
28687
28938
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
28688
28939
|
scopeNodeId: string().nullable(),
|
|
28940
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
28941
|
+
scopeComponent: string().nullable(),
|
|
28689
28942
|
effective: LoggingEffectiveSchema,
|
|
28690
28943
|
explicit: LoggingExplicitSchema,
|
|
28691
28944
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
28945
|
+
/**
|
|
28946
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
28947
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
28948
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
28949
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
28950
|
+
*/
|
|
28951
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
28952
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
28953
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
28692
28954
|
persisted: boolean()
|
|
28693
28955
|
});
|
|
28694
28956
|
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(), {
|
|
@@ -31673,6 +31935,12 @@ Object.freeze({
|
|
|
31673
31935
|
addonId: null,
|
|
31674
31936
|
access: "view"
|
|
31675
31937
|
},
|
|
31938
|
+
"dataStoreProvider.aggregate": {
|
|
31939
|
+
capName: "data-store-provider",
|
|
31940
|
+
capScope: "system",
|
|
31941
|
+
addonId: null,
|
|
31942
|
+
access: "view"
|
|
31943
|
+
},
|
|
31676
31944
|
"dataStoreProvider.count": {
|
|
31677
31945
|
capName: "data-store-provider",
|
|
31678
31946
|
capScope: "system",
|
|
@@ -32087,6 +32355,12 @@ Object.freeze({
|
|
|
32087
32355
|
addonId: null,
|
|
32088
32356
|
access: "view"
|
|
32089
32357
|
},
|
|
32358
|
+
"deviceManager.getChildrenBatch": {
|
|
32359
|
+
capName: "device-manager",
|
|
32360
|
+
capScope: "system",
|
|
32361
|
+
addonId: null,
|
|
32362
|
+
access: "view"
|
|
32363
|
+
},
|
|
32090
32364
|
"deviceManager.getConfigSchema": {
|
|
32091
32365
|
capName: "device-manager",
|
|
32092
32366
|
capScope: "system",
|
|
@@ -33137,6 +33411,18 @@ Object.freeze({
|
|
|
33137
33411
|
addonId: null,
|
|
33138
33412
|
access: "create"
|
|
33139
33413
|
},
|
|
33414
|
+
"logChannels.apply": {
|
|
33415
|
+
capName: "log-channels",
|
|
33416
|
+
capScope: "system",
|
|
33417
|
+
addonId: null,
|
|
33418
|
+
access: "create"
|
|
33419
|
+
},
|
|
33420
|
+
"logChannels.list": {
|
|
33421
|
+
capName: "log-channels",
|
|
33422
|
+
capScope: "system",
|
|
33423
|
+
addonId: null,
|
|
33424
|
+
access: "view"
|
|
33425
|
+
},
|
|
33140
33426
|
"logDestination.query": {
|
|
33141
33427
|
capName: "log-destination",
|
|
33142
33428
|
capScope: "system",
|
|
@@ -35291,6 +35577,12 @@ Object.freeze({
|
|
|
35291
35577
|
addonId: null,
|
|
35292
35578
|
access: "create"
|
|
35293
35579
|
},
|
|
35580
|
+
"settingsStore.aggregate": {
|
|
35581
|
+
capName: "settings-store",
|
|
35582
|
+
capScope: "system",
|
|
35583
|
+
addonId: null,
|
|
35584
|
+
access: "view"
|
|
35585
|
+
},
|
|
35294
35586
|
"settingsStore.count": {
|
|
35295
35587
|
capName: "settings-store",
|
|
35296
35588
|
capScope: "system",
|
|
@@ -36870,6 +37162,11 @@ Object.freeze({
|
|
|
36870
37162
|
form: "single",
|
|
36871
37163
|
optional: false
|
|
36872
37164
|
}],
|
|
37165
|
+
"deviceManager.getChildrenBatch": [{
|
|
37166
|
+
name: "parentDeviceIds",
|
|
37167
|
+
form: "array",
|
|
37168
|
+
optional: false
|
|
37169
|
+
}],
|
|
36873
37170
|
"deviceManager.getConfigSchema": [{
|
|
36874
37171
|
name: "deviceId",
|
|
36875
37172
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-gree",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.33",
|
|
4
4
|
"description": "Gree air-conditioner device-provider addon for CamStack — wraps the @apocaliss92/nodegree local-UDP client (LAN discovery + AES control), exposing climate-control and fan-control",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|