@camstack/addon-import-alexa 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
|
@@ -7626,6 +7626,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7626
7626
|
fetchedAt: number()
|
|
7627
7627
|
});
|
|
7628
7628
|
/**
|
|
7629
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7630
|
+
* an addon declares its channels in.
|
|
7631
|
+
*
|
|
7632
|
+
* ## Two axes, deliberately separated
|
|
7633
|
+
*
|
|
7634
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7635
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7636
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7637
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7638
|
+
* `log-channels` capability enumerates the declarations.
|
|
7639
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7640
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7641
|
+
* over the values is the exact defect
|
|
7642
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7643
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7644
|
+
*
|
|
7645
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7646
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7647
|
+
* the hot path with a value somebody actually read, and by
|
|
7648
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7649
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7650
|
+
* disarmed one (D49).
|
|
7651
|
+
*
|
|
7652
|
+
* ## The canonical call shape
|
|
7653
|
+
*
|
|
7654
|
+
* ```ts
|
|
7655
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7656
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7657
|
+
* }
|
|
7658
|
+
* ```
|
|
7659
|
+
*
|
|
7660
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7661
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7662
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7663
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7664
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7665
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7666
|
+
*
|
|
7667
|
+
* ## Why a channel emits at `info`
|
|
7668
|
+
*
|
|
7669
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7670
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7671
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7672
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7673
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7674
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7675
|
+
*/
|
|
7676
|
+
/**
|
|
7677
|
+
* The level a channel writes at once armed.
|
|
7678
|
+
*
|
|
7679
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7680
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7681
|
+
* to read it later.
|
|
7682
|
+
*/
|
|
7683
|
+
var LogChannelLevelSchema = _enum([
|
|
7684
|
+
"info",
|
|
7685
|
+
"warn",
|
|
7686
|
+
"error"
|
|
7687
|
+
]);
|
|
7688
|
+
/**
|
|
7689
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7690
|
+
* declaration is inert.
|
|
7691
|
+
*/
|
|
7692
|
+
var LogChannelDescriptorSchema = object({
|
|
7693
|
+
/**
|
|
7694
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7695
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7696
|
+
* owns it without a second lookup.
|
|
7697
|
+
*/
|
|
7698
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7699
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7700
|
+
description: string().min(1),
|
|
7701
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7702
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7703
|
+
/**
|
|
7704
|
+
* Whether this channel can be narrowed to a camera.
|
|
7705
|
+
*
|
|
7706
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7707
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7708
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7709
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7710
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7711
|
+
* the body is the only way to filter.
|
|
7712
|
+
*
|
|
7713
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7714
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7715
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7716
|
+
* path was never taken.
|
|
7717
|
+
*/
|
|
7718
|
+
perDevice: boolean()
|
|
7719
|
+
});
|
|
7720
|
+
/**
|
|
7721
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7722
|
+
*
|
|
7723
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7724
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7725
|
+
*/
|
|
7726
|
+
var LogChannelWindowSchema = object({
|
|
7727
|
+
channel: string().min(1),
|
|
7728
|
+
/** Epoch ms the window closes at. */
|
|
7729
|
+
armedUntilMs: number(),
|
|
7730
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7731
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7732
|
+
});
|
|
7733
|
+
/**
|
|
7629
7734
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7630
7735
|
* recordings and events management surfaces.
|
|
7631
7736
|
*
|
|
@@ -11314,6 +11419,35 @@ var MutationFilterSchema = object({
|
|
|
11314
11419
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11315
11420
|
whereNot: record(string(), unknown()).optional()
|
|
11316
11421
|
});
|
|
11422
|
+
/**
|
|
11423
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11424
|
+
*
|
|
11425
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11426
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11427
|
+
* a `Record<column, op>` shape could not express.
|
|
11428
|
+
*/
|
|
11429
|
+
var AggregateFieldSchema = object({
|
|
11430
|
+
/** Result key. */
|
|
11431
|
+
as: string().min(1),
|
|
11432
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11433
|
+
field: string().min(1),
|
|
11434
|
+
op: _enum([
|
|
11435
|
+
"sum",
|
|
11436
|
+
"min",
|
|
11437
|
+
"max"
|
|
11438
|
+
])
|
|
11439
|
+
});
|
|
11440
|
+
/**
|
|
11441
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11442
|
+
*
|
|
11443
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11444
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11445
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11446
|
+
*/
|
|
11447
|
+
var AggregateResultSchema = object({
|
|
11448
|
+
count: number().int(),
|
|
11449
|
+
values: record(string(), number().nullable())
|
|
11450
|
+
});
|
|
11317
11451
|
/** A single stored record: `{ id, data }`. */
|
|
11318
11452
|
var SettingsRecordSchema = object({
|
|
11319
11453
|
id: string(),
|
|
@@ -11398,6 +11532,11 @@ method(object({
|
|
|
11398
11532
|
collection: string(),
|
|
11399
11533
|
filter: QueryFilterSchema.optional()
|
|
11400
11534
|
}), number()), method(object({
|
|
11535
|
+
namespace: string().optional(),
|
|
11536
|
+
collection: string(),
|
|
11537
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11538
|
+
filter: QueryFilterSchema.optional()
|
|
11539
|
+
}), AggregateResultSchema), method(object({
|
|
11401
11540
|
namespace: string().optional(),
|
|
11402
11541
|
collection: string(),
|
|
11403
11542
|
field: string(),
|
|
@@ -11514,6 +11653,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11514
11653
|
collection: string(),
|
|
11515
11654
|
filter: QueryFilterSchema.optional()
|
|
11516
11655
|
}), number(), { auth: "admin" }), method(object({
|
|
11656
|
+
namespace: string().optional(),
|
|
11657
|
+
collection: string(),
|
|
11658
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11659
|
+
filter: QueryFilterSchema.optional()
|
|
11660
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11517
11661
|
namespace: string().optional(),
|
|
11518
11662
|
collection: string(),
|
|
11519
11663
|
field: string(),
|
|
@@ -12254,24 +12398,6 @@ var deviceProviderCapability = {
|
|
|
12254
12398
|
})
|
|
12255
12399
|
}
|
|
12256
12400
|
};
|
|
12257
|
-
/**
|
|
12258
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12259
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12260
|
-
*
|
|
12261
|
-
* Replaces:
|
|
12262
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12263
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12264
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12265
|
-
*
|
|
12266
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12267
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12268
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12269
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12270
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12271
|
-
*
|
|
12272
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12273
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12274
|
-
*/
|
|
12275
12401
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12276
12402
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12277
12403
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12640,7 +12766,7 @@ method(object({
|
|
|
12640
12766
|
* it answers today and the caller filters as it already does.
|
|
12641
12767
|
*/
|
|
12642
12768
|
deviceIds: array(number()).optional()
|
|
12643
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12769
|
+
}), 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({
|
|
12644
12770
|
mode: LinkedDevicesModeSchema,
|
|
12645
12771
|
devices: array(LinkedDeviceSchema)
|
|
12646
12772
|
})), 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({
|
|
@@ -13364,6 +13490,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13364
13490
|
kind: "mutation",
|
|
13365
13491
|
auth: "admin"
|
|
13366
13492
|
});
|
|
13493
|
+
/**
|
|
13494
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13495
|
+
* through. It stores nothing.
|
|
13496
|
+
*
|
|
13497
|
+
* ## Why a capability at all, and why this shape
|
|
13498
|
+
*
|
|
13499
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13500
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13501
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13502
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13503
|
+
* is assembled from declarations at runtime.
|
|
13504
|
+
*
|
|
13505
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13506
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13507
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13508
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13509
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13510
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13511
|
+
* No new UDS message, no second registry.
|
|
13512
|
+
*
|
|
13513
|
+
* ## What it deliberately does NOT own
|
|
13514
|
+
*
|
|
13515
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13516
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13517
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13518
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13519
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13520
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13521
|
+
* setter for a window and no persistence of any kind.
|
|
13522
|
+
*
|
|
13523
|
+
* ## Why `apply` is here even so
|
|
13524
|
+
*
|
|
13525
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13526
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13527
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13528
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13529
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13530
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13531
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13532
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13533
|
+
*/
|
|
13534
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13535
|
+
var LogChannelApplyResultSchema = object({
|
|
13536
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13537
|
+
armed: number().int().min(0),
|
|
13538
|
+
/**
|
|
13539
|
+
* Names the document armed that this process does not declare. Reported
|
|
13540
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13541
|
+
* not booted, and both deserve a line instead of silence.
|
|
13542
|
+
*/
|
|
13543
|
+
unknown: array(string()).readonly()
|
|
13544
|
+
});
|
|
13545
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13367
13546
|
var LogLevelSchema = _enum([
|
|
13368
13547
|
"debug",
|
|
13369
13548
|
"info",
|
|
@@ -28825,10 +29004,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
28825
29004
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
28826
29005
|
* layer that carries an explicit value wins.
|
|
28827
29006
|
*
|
|
28828
|
-
* `component`
|
|
28829
|
-
*
|
|
28830
|
-
*
|
|
28831
|
-
*
|
|
29007
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
29008
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
29009
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
29010
|
+
* that turning it on would not force every consumer of this document to widen
|
|
29011
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
28832
29012
|
*/
|
|
28833
29013
|
var LoggingScopeKindSchema = _enum([
|
|
28834
29014
|
"cluster",
|
|
@@ -28855,6 +29035,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
28855
29035
|
scope: LoggingScopeKindSchema,
|
|
28856
29036
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
28857
29037
|
nodeId: string().nullable(),
|
|
29038
|
+
/**
|
|
29039
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
29040
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
29041
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
29042
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
29043
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
29044
|
+
*/
|
|
29045
|
+
component: string().nullable(),
|
|
28858
29046
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
28859
29047
|
level: LogLevelSchema$1.nullable()
|
|
28860
29048
|
});
|
|
@@ -28896,6 +29084,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
28896
29084
|
reportEveryMs: number().int().positive().optional()
|
|
28897
29085
|
});
|
|
28898
29086
|
/**
|
|
29087
|
+
* A channel ARMED, as the document reports it.
|
|
29088
|
+
*
|
|
29089
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
29090
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
29091
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
29092
|
+
*/
|
|
29093
|
+
var LogChannelWindowStateSchema = object({
|
|
29094
|
+
channel: string(),
|
|
29095
|
+
armed: boolean(),
|
|
29096
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
29097
|
+
armedUntilMs: number(),
|
|
29098
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
29099
|
+
remainingMs: number(),
|
|
29100
|
+
/**
|
|
29101
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
29102
|
+
*
|
|
29103
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
29104
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
29105
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
29106
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
29107
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
29108
|
+
* not.
|
|
29109
|
+
*/
|
|
29110
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
29111
|
+
});
|
|
29112
|
+
/**
|
|
29113
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
29114
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
29115
|
+
*/
|
|
29116
|
+
var LogChannelWindowPatchSchema = object({
|
|
29117
|
+
channel: string().min(1),
|
|
29118
|
+
armMs: number().int().min(0),
|
|
29119
|
+
/**
|
|
29120
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
29121
|
+
*
|
|
29122
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
29123
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
29124
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
29125
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
29126
|
+
*/
|
|
29127
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
29128
|
+
});
|
|
29129
|
+
/**
|
|
28899
29130
|
* A PATCH, and patches MERGE.
|
|
28900
29131
|
*
|
|
28901
29132
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -28914,7 +29145,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28914
29145
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
28915
29146
|
* keeps running — a patch is never a full replacement.
|
|
28916
29147
|
*/
|
|
28917
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
29148
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
29149
|
+
/**
|
|
29150
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
29151
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
29152
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
29153
|
+
* the Diagnostics page fight over the same value.
|
|
29154
|
+
*/
|
|
29155
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
28918
29156
|
});
|
|
28919
29157
|
/**
|
|
28920
29158
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -28927,9 +29165,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28927
29165
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
28928
29166
|
* layer selector needs a name the transport does not already own.
|
|
28929
29167
|
*/
|
|
28930
|
-
var GetLoggingSettingsInputSchema = object({
|
|
29168
|
+
var GetLoggingSettingsInputSchema = object({
|
|
29169
|
+
scopeNodeId: string().optional(),
|
|
29170
|
+
/**
|
|
29171
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
29172
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
29173
|
+
*
|
|
29174
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
29175
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
29176
|
+
* not, and one selector for both would make "which of these two did I just
|
|
29177
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
29178
|
+
*/
|
|
29179
|
+
scopeComponent: string().optional()
|
|
29180
|
+
});
|
|
28931
29181
|
var SetLoggingSettingsInputSchema = object({
|
|
28932
29182
|
scopeNodeId: string().optional(),
|
|
29183
|
+
scopeComponent: string().optional(),
|
|
28933
29184
|
patch: LoggingSettingsPatchSchema
|
|
28934
29185
|
});
|
|
28935
29186
|
/**
|
|
@@ -28944,9 +29195,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
28944
29195
|
var LoggingSettingsStateSchema = object({
|
|
28945
29196
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
28946
29197
|
scopeNodeId: string().nullable(),
|
|
29198
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
29199
|
+
scopeComponent: string().nullable(),
|
|
28947
29200
|
effective: LoggingEffectiveSchema,
|
|
28948
29201
|
explicit: LoggingExplicitSchema,
|
|
28949
29202
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
29203
|
+
/**
|
|
29204
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
29205
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
29206
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
29207
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
29208
|
+
*/
|
|
29209
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
29210
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
29211
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
28950
29212
|
persisted: boolean()
|
|
28951
29213
|
});
|
|
28952
29214
|
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(), {
|
|
@@ -31931,6 +32193,12 @@ Object.freeze({
|
|
|
31931
32193
|
addonId: null,
|
|
31932
32194
|
access: "view"
|
|
31933
32195
|
},
|
|
32196
|
+
"dataStoreProvider.aggregate": {
|
|
32197
|
+
capName: "data-store-provider",
|
|
32198
|
+
capScope: "system",
|
|
32199
|
+
addonId: null,
|
|
32200
|
+
access: "view"
|
|
32201
|
+
},
|
|
31934
32202
|
"dataStoreProvider.count": {
|
|
31935
32203
|
capName: "data-store-provider",
|
|
31936
32204
|
capScope: "system",
|
|
@@ -32345,6 +32613,12 @@ Object.freeze({
|
|
|
32345
32613
|
addonId: null,
|
|
32346
32614
|
access: "view"
|
|
32347
32615
|
},
|
|
32616
|
+
"deviceManager.getChildrenBatch": {
|
|
32617
|
+
capName: "device-manager",
|
|
32618
|
+
capScope: "system",
|
|
32619
|
+
addonId: null,
|
|
32620
|
+
access: "view"
|
|
32621
|
+
},
|
|
32348
32622
|
"deviceManager.getConfigSchema": {
|
|
32349
32623
|
capName: "device-manager",
|
|
32350
32624
|
capScope: "system",
|
|
@@ -33395,6 +33669,18 @@ Object.freeze({
|
|
|
33395
33669
|
addonId: null,
|
|
33396
33670
|
access: "create"
|
|
33397
33671
|
},
|
|
33672
|
+
"logChannels.apply": {
|
|
33673
|
+
capName: "log-channels",
|
|
33674
|
+
capScope: "system",
|
|
33675
|
+
addonId: null,
|
|
33676
|
+
access: "create"
|
|
33677
|
+
},
|
|
33678
|
+
"logChannels.list": {
|
|
33679
|
+
capName: "log-channels",
|
|
33680
|
+
capScope: "system",
|
|
33681
|
+
addonId: null,
|
|
33682
|
+
access: "view"
|
|
33683
|
+
},
|
|
33398
33684
|
"logDestination.query": {
|
|
33399
33685
|
capName: "log-destination",
|
|
33400
33686
|
capScope: "system",
|
|
@@ -35549,6 +35835,12 @@ Object.freeze({
|
|
|
35549
35835
|
addonId: null,
|
|
35550
35836
|
access: "create"
|
|
35551
35837
|
},
|
|
35838
|
+
"settingsStore.aggregate": {
|
|
35839
|
+
capName: "settings-store",
|
|
35840
|
+
capScope: "system",
|
|
35841
|
+
addonId: null,
|
|
35842
|
+
access: "view"
|
|
35843
|
+
},
|
|
35552
35844
|
"settingsStore.count": {
|
|
35553
35845
|
capName: "settings-store",
|
|
35554
35846
|
capScope: "system",
|
|
@@ -37128,6 +37420,11 @@ Object.freeze({
|
|
|
37128
37420
|
form: "single",
|
|
37129
37421
|
optional: false
|
|
37130
37422
|
}],
|
|
37423
|
+
"deviceManager.getChildrenBatch": [{
|
|
37424
|
+
name: "parentDeviceIds",
|
|
37425
|
+
form: "array",
|
|
37426
|
+
optional: false
|
|
37427
|
+
}],
|
|
37131
37428
|
"deviceManager.getConfigSchema": [{
|
|
37132
37429
|
name: "deviceId",
|
|
37133
37430
|
form: "single",
|
package/dist/addon.mjs
CHANGED
|
@@ -7626,6 +7626,111 @@ var CameraSwitchGroupSchema = object({
|
|
|
7626
7626
|
fetchedAt: number()
|
|
7627
7627
|
});
|
|
7628
7628
|
/**
|
|
7629
|
+
* Per-component log CHANNELS — the gate a hot path consults, and the registry
|
|
7630
|
+
* an addon declares its channels in.
|
|
7631
|
+
*
|
|
7632
|
+
* ## Two axes, deliberately separated
|
|
7633
|
+
*
|
|
7634
|
+
* - **DECLARATION** — which channels exist. Only the addon knows:
|
|
7635
|
+
* `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
|
|
7636
|
+
* baichuan/handshake. A hand-wired central list rots at the first addition,
|
|
7637
|
+
* and rots silently. So a channel is declared where it is consulted, and the
|
|
7638
|
+
* `log-channels` capability enumerates the declarations.
|
|
7639
|
+
* - **VALUE** — at which level, for which scope, until when. That stays ONE
|
|
7640
|
+
* thing: the logging settings document on the `system` cap. Two authorities
|
|
7641
|
+
* over the values is the exact defect
|
|
7642
|
+
* `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
|
|
7643
|
+
* remove; re-introducing it from the cure side would be grotesque.
|
|
7644
|
+
*
|
|
7645
|
+
* Nothing in this file reads a clock, an env var or a store. The registry is
|
|
7646
|
+
* a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
|
|
7647
|
+
* the hot path with a value somebody actually read, and by
|
|
7648
|
+
* {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
|
|
7649
|
+
* never reaches here, so it can neither disarm an armed channel nor arm a
|
|
7650
|
+
* disarmed one (D49).
|
|
7651
|
+
*
|
|
7652
|
+
* ## The canonical call shape
|
|
7653
|
+
*
|
|
7654
|
+
* ```ts
|
|
7655
|
+
* if (CH_RTP.on && CH_RTP.wants(deviceId)) {
|
|
7656
|
+
* CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
|
|
7657
|
+
* }
|
|
7658
|
+
* ```
|
|
7659
|
+
*
|
|
7660
|
+
* `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
|
|
7661
|
+
* read. Disarmed, a call site costs one load and one branch, and the `extras`
|
|
7662
|
+
* object literal is never constructed because it lives inside the branch. It
|
|
7663
|
+
* is the same shape already proven in production at `stream-broker.ts:1650`,
|
|
7664
|
+
* and the same discipline `LoggingGate.allowsDestination` uses for the
|
|
7665
|
+
* destination floor (measured at 1.93 ns/call when off).
|
|
7666
|
+
*
|
|
7667
|
+
* ## Why a channel emits at `info`
|
|
7668
|
+
*
|
|
7669
|
+
* `loki-logging.addon.ts` pins the destination default at `info` and
|
|
7670
|
+
* `loki-destination.ts` drops everything below it, so a line emitted at
|
|
7671
|
+
* `debug` never reaches Loki and the hub's in-memory ring only holds ~35
|
|
7672
|
+
* minutes. A diagnostic that cannot be read an hour later is worse than no
|
|
7673
|
+
* diagnostic, because it looks done. {@link LogChannelGate.log} therefore
|
|
7674
|
+
* emits at the channel's declared level, whose schema floor is `info`.
|
|
7675
|
+
*/
|
|
7676
|
+
/**
|
|
7677
|
+
* The level a channel writes at once armed.
|
|
7678
|
+
*
|
|
7679
|
+
* `debug` is absent ON PURPOSE and not by omission: below `info` the line does
|
|
7680
|
+
* not leave the process for Loki, and the whole point of arming a channel is
|
|
7681
|
+
* to read it later.
|
|
7682
|
+
*/
|
|
7683
|
+
var LogChannelLevelSchema = _enum([
|
|
7684
|
+
"info",
|
|
7685
|
+
"warn",
|
|
7686
|
+
"error"
|
|
7687
|
+
]);
|
|
7688
|
+
/**
|
|
7689
|
+
* What an addon declares about one channel. No value, no state — a
|
|
7690
|
+
* declaration is inert.
|
|
7691
|
+
*/
|
|
7692
|
+
var LogChannelDescriptorSchema = object({
|
|
7693
|
+
/**
|
|
7694
|
+
* Dotted `area.thing`, unique across the workspace. `area` is conventionally
|
|
7695
|
+
* the addon's short name so an operator reading a channel list can tell who
|
|
7696
|
+
* owns it without a second lookup.
|
|
7697
|
+
*/
|
|
7698
|
+
name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
|
|
7699
|
+
/** One sentence: what the operator will SEE after arming it. */
|
|
7700
|
+
description: string().min(1),
|
|
7701
|
+
/** The level its lines are emitted at. Never below `info`. */
|
|
7702
|
+
defaultLevel: LogChannelLevelSchema,
|
|
7703
|
+
/**
|
|
7704
|
+
* Whether this channel can be narrowed to a camera.
|
|
7705
|
+
*
|
|
7706
|
+
* `true` is a PROMISE with two halves, and both must hold: the gate is
|
|
7707
|
+
* consulted with the numeric device id, AND every line the channel admits
|
|
7708
|
+
* carries `tags: { deviceId }` with that same numeric id. The second half is
|
|
7709
|
+
* what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
|
|
7710
|
+
* keeps `deviceId` out of the stream labels for cardinality, so the tag in
|
|
7711
|
+
* the body is the only way to filter.
|
|
7712
|
+
*
|
|
7713
|
+
* A channel whose lines carry the device only in `meta` (or not at all) is
|
|
7714
|
+
* declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
|
|
7715
|
+
* the operator narrows to one camera, sees nothing, and concludes the code
|
|
7716
|
+
* path was never taken.
|
|
7717
|
+
*/
|
|
7718
|
+
perDevice: boolean()
|
|
7719
|
+
});
|
|
7720
|
+
/**
|
|
7721
|
+
* An armed window over one channel, as the document hands it to a mirror.
|
|
7722
|
+
*
|
|
7723
|
+
* A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
|
|
7724
|
+
* expires by itself, which is the one failure a boolean cannot avoid.
|
|
7725
|
+
*/
|
|
7726
|
+
var LogChannelWindowSchema = object({
|
|
7727
|
+
channel: string().min(1),
|
|
7728
|
+
/** Epoch ms the window closes at. */
|
|
7729
|
+
armedUntilMs: number(),
|
|
7730
|
+
/** `null` = every camera. A non-empty list narrows to those numeric ids. */
|
|
7731
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
7732
|
+
});
|
|
7733
|
+
/**
|
|
7629
7734
|
* Ops-log — the durable, append-only operations audit shared by the
|
|
7630
7735
|
* recordings and events management surfaces.
|
|
7631
7736
|
*
|
|
@@ -11314,6 +11419,35 @@ var MutationFilterSchema = object({
|
|
|
11314
11419
|
whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
|
|
11315
11420
|
whereNot: record(string(), unknown()).optional()
|
|
11316
11421
|
});
|
|
11422
|
+
/**
|
|
11423
|
+
* One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
|
|
11424
|
+
*
|
|
11425
|
+
* `as` names the slot in the result, so the SAME column may be asked twice with
|
|
11426
|
+
* two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
|
|
11427
|
+
* a `Record<column, op>` shape could not express.
|
|
11428
|
+
*/
|
|
11429
|
+
var AggregateFieldSchema = object({
|
|
11430
|
+
/** Result key. */
|
|
11431
|
+
as: string().min(1),
|
|
11432
|
+
/** Column to aggregate. Must be a real column of a declared collection. */
|
|
11433
|
+
field: string().min(1),
|
|
11434
|
+
op: _enum([
|
|
11435
|
+
"sum",
|
|
11436
|
+
"min",
|
|
11437
|
+
"max"
|
|
11438
|
+
])
|
|
11439
|
+
});
|
|
11440
|
+
/**
|
|
11441
|
+
* `COUNT(*)` plus one number per requested field.
|
|
11442
|
+
*
|
|
11443
|
+
* `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
|
|
11444
|
+
* that really is 0 are different facts, and an accounting caller that renders
|
|
11445
|
+
* "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
|
|
11446
|
+
*/
|
|
11447
|
+
var AggregateResultSchema = object({
|
|
11448
|
+
count: number().int(),
|
|
11449
|
+
values: record(string(), number().nullable())
|
|
11450
|
+
});
|
|
11317
11451
|
/** A single stored record: `{ id, data }`. */
|
|
11318
11452
|
var SettingsRecordSchema = object({
|
|
11319
11453
|
id: string(),
|
|
@@ -11398,6 +11532,11 @@ method(object({
|
|
|
11398
11532
|
collection: string(),
|
|
11399
11533
|
filter: QueryFilterSchema.optional()
|
|
11400
11534
|
}), number()), method(object({
|
|
11535
|
+
namespace: string().optional(),
|
|
11536
|
+
collection: string(),
|
|
11537
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11538
|
+
filter: QueryFilterSchema.optional()
|
|
11539
|
+
}), AggregateResultSchema), method(object({
|
|
11401
11540
|
namespace: string().optional(),
|
|
11402
11541
|
collection: string(),
|
|
11403
11542
|
field: string(),
|
|
@@ -11514,6 +11653,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
|
|
|
11514
11653
|
collection: string(),
|
|
11515
11654
|
filter: QueryFilterSchema.optional()
|
|
11516
11655
|
}), number(), { auth: "admin" }), method(object({
|
|
11656
|
+
namespace: string().optional(),
|
|
11657
|
+
collection: string(),
|
|
11658
|
+
fields: array(AggregateFieldSchema).readonly(),
|
|
11659
|
+
filter: QueryFilterSchema.optional()
|
|
11660
|
+
}), AggregateResultSchema, { auth: "admin" }), method(object({
|
|
11517
11661
|
namespace: string().optional(),
|
|
11518
11662
|
collection: string(),
|
|
11519
11663
|
field: string(),
|
|
@@ -12254,24 +12398,6 @@ var deviceProviderCapability = {
|
|
|
12254
12398
|
})
|
|
12255
12399
|
}
|
|
12256
12400
|
};
|
|
12257
|
-
/**
|
|
12258
|
-
* Device Manager capability — hub-side singleton that unifies device persistence,
|
|
12259
|
-
* live registry access, and all management operations into a single tRPC surface.
|
|
12260
|
-
*
|
|
12261
|
-
* Replaces:
|
|
12262
|
-
* - `device-persistence` capability (persistence methods absorbed here)
|
|
12263
|
-
* - `device-management.router.ts` (deleted in Phase 2)
|
|
12264
|
-
* - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
|
|
12265
|
-
*
|
|
12266
|
-
* All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
|
|
12267
|
-
* fork into separate processes but never run on remote cluster agents. Therefore:
|
|
12268
|
-
* - No nodeId routing needed — this is a pure hub singleton.
|
|
12269
|
-
* - The hub's DeviceRegistry is the single source of truth for all live devices.
|
|
12270
|
-
* - No shadow registry or cross-node aggregation required.
|
|
12271
|
-
*
|
|
12272
|
-
* Forked workers register devices back to the hub via `ctx.devices`
|
|
12273
|
-
* (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
|
|
12274
|
-
*/
|
|
12275
12401
|
/** One child-placement directive on a container's `childLayout`. Structurally
|
|
12276
12402
|
* identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
|
|
12277
12403
|
* shape for the same field. The child is identified by its re-sync-stable
|
|
@@ -12640,7 +12766,7 @@ method(object({
|
|
|
12640
12766
|
* it answers today and the caller filters as it already does.
|
|
12641
12767
|
*/
|
|
12642
12768
|
deviceIds: array(number()).optional()
|
|
12643
|
-
}), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
|
|
12769
|
+
}), 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({
|
|
12644
12770
|
mode: LinkedDevicesModeSchema,
|
|
12645
12771
|
devices: array(LinkedDeviceSchema)
|
|
12646
12772
|
})), 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({
|
|
@@ -13364,6 +13490,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13364
13490
|
kind: "mutation",
|
|
13365
13491
|
auth: "admin"
|
|
13366
13492
|
});
|
|
13493
|
+
/**
|
|
13494
|
+
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13495
|
+
* through. It stores nothing.
|
|
13496
|
+
*
|
|
13497
|
+
* ## Why a capability at all, and why this shape
|
|
13498
|
+
*
|
|
13499
|
+
* Which channels exist is knowledge only the addon has: `stream-broker` knows
|
|
13500
|
+
* webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
|
|
13501
|
+
* maintained by hand rots at the first addition and rots INVISIBLY — nothing
|
|
13502
|
+
* fails, an operator just never sees the channel somebody added. So the list
|
|
13503
|
+
* is assembled from declarations at runtime.
|
|
13504
|
+
*
|
|
13505
|
+
* The shape is copied from `log-destination.cap.ts`, which already does
|
|
13506
|
+
* exactly this job: `mode: 'collection'`, `internal: true`,
|
|
13507
|
+
* `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
|
|
13508
|
+
* `addons.listCapabilityProviders` still enumerates it, and the hub's
|
|
13509
|
+
* `CapabilityRegistry` still holds an RPC proxy per provider so a forked
|
|
13510
|
+
* runner's declarations reach hub-main over the transport that already exists.
|
|
13511
|
+
* No new UDS message, no second registry.
|
|
13512
|
+
*
|
|
13513
|
+
* ## What it deliberately does NOT own
|
|
13514
|
+
*
|
|
13515
|
+
* The VALUES — which channel is armed, for which cameras, until when — live in
|
|
13516
|
+
* ONE place: the logging settings document on the `system` cap
|
|
13517
|
+
* (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
|
|
13518
|
+
* value is the defect the plan behind this work exists to remove, and
|
|
13519
|
+
* `setRequestCensus` was retired (D245) rather than allowed to be a second
|
|
13520
|
+
* one. {@link logChannelsCapability} therefore has no getter for a level, no
|
|
13521
|
+
* setter for a window and no persistence of any kind.
|
|
13522
|
+
*
|
|
13523
|
+
* ## Why `apply` is here even so
|
|
13524
|
+
*
|
|
13525
|
+
* The gate lives in the addon's PROCESS; the document lives in hub-main. Some
|
|
13526
|
+
* seam has to carry the value from the authority to the mirror, and a channel
|
|
13527
|
+
* that cannot be reached is precisely the dead knob this whole slice exists to
|
|
13528
|
+
* make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
|
|
13529
|
+
* `apply` is that seam and nothing more: it writes an in-memory mirror, it
|
|
13530
|
+
* persists nothing, it is never the source of a value, and it is called only
|
|
13531
|
+
* with a set the hub actually read (D49 — a read that fails does not call it
|
|
13532
|
+
* at all, so no channel is silently disarmed by a bad read).
|
|
13533
|
+
*/
|
|
13534
|
+
/** What `apply` reports back — enough to log, not enough to be a second state. */
|
|
13535
|
+
var LogChannelApplyResultSchema = object({
|
|
13536
|
+
/** How many declared channels are armed in this process after the call. */
|
|
13537
|
+
armed: number().int().min(0),
|
|
13538
|
+
/**
|
|
13539
|
+
* Names the document armed that this process does not declare. Reported
|
|
13540
|
+
* rather than swallowed: a name here is either a typo or an addon that has
|
|
13541
|
+
* not booted, and both deserve a line instead of silence.
|
|
13542
|
+
*/
|
|
13543
|
+
unknown: array(string()).readonly()
|
|
13544
|
+
});
|
|
13545
|
+
method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
|
|
13367
13546
|
var LogLevelSchema = _enum([
|
|
13368
13547
|
"debug",
|
|
13369
13548
|
"info",
|
|
@@ -28825,10 +29004,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
|
|
|
28825
29004
|
* The layers of the level hierarchy, general → specific. The most specific
|
|
28826
29005
|
* layer that carries an explicit value wins.
|
|
28827
29006
|
*
|
|
28828
|
-
* `component`
|
|
28829
|
-
*
|
|
28830
|
-
*
|
|
28831
|
-
*
|
|
29007
|
+
* `component` became RESOLVABLE on 2026-08-27: a component is a declared log
|
|
29008
|
+
* CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
|
|
29009
|
+
* `scopeComponent`. It was declared-but-dark in the first slice precisely so
|
|
29010
|
+
* that turning it on would not force every consumer of this document to widen
|
|
29011
|
+
* a `levelSource` enum — which is what has now not happened.
|
|
28832
29012
|
*/
|
|
28833
29013
|
var LoggingScopeKindSchema = _enum([
|
|
28834
29014
|
"cluster",
|
|
@@ -28855,6 +29035,14 @@ var LoggingLevelLayerSchema = object({
|
|
|
28855
29035
|
scope: LoggingScopeKindSchema,
|
|
28856
29036
|
/** The node this layer speaks for; `null` on the cluster layer. */
|
|
28857
29037
|
nodeId: string().nullable(),
|
|
29038
|
+
/**
|
|
29039
|
+
* The declared channel this layer speaks for; `null` on every layer but
|
|
29040
|
+
* `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
|
|
29041
|
+
* by design — the convention this repo settled on is one orchestrator-wide
|
|
29042
|
+
* setting, never per node (D52) — so a component layer that carried a node
|
|
29043
|
+
* would invite a per-node copy of a value that has no per-node meaning.
|
|
29044
|
+
*/
|
|
29045
|
+
component: string().nullable(),
|
|
28858
29046
|
/** Explicitly set here, or `null` when this layer inherits. */
|
|
28859
29047
|
level: LogLevelSchema$1.nullable()
|
|
28860
29048
|
});
|
|
@@ -28896,6 +29084,49 @@ var DiagnosticWindowPatchSchema = object({
|
|
|
28896
29084
|
reportEveryMs: number().int().positive().optional()
|
|
28897
29085
|
});
|
|
28898
29086
|
/**
|
|
29087
|
+
* A channel ARMED, as the document reports it.
|
|
29088
|
+
*
|
|
29089
|
+
* `armMs` is not echoed back: what an operator needs to see is the deadline
|
|
29090
|
+
* and the time left, because a diagnostic left running is itself an incident
|
|
29091
|
+
* and "armed for 10 minutes" said an hour ago is not an answer.
|
|
29092
|
+
*/
|
|
29093
|
+
var LogChannelWindowStateSchema = object({
|
|
29094
|
+
channel: string(),
|
|
29095
|
+
armed: boolean(),
|
|
29096
|
+
/** Epoch ms the window closes at. 0 when disarmed. */
|
|
29097
|
+
armedUntilMs: number(),
|
|
29098
|
+
/** Ms left before it expires on its own. 0 when disarmed. */
|
|
29099
|
+
remainingMs: number(),
|
|
29100
|
+
/**
|
|
29101
|
+
* The cameras it is narrowed to, or `null` for every camera.
|
|
29102
|
+
*
|
|
29103
|
+
* A channel declared `perDevice: false` can only ever report `null` here:
|
|
29104
|
+
* its lines do not carry `tags: { deviceId }`, so narrowing them would
|
|
29105
|
+
* produce a filter that silently matches nothing. The server REFUSES such a
|
|
29106
|
+
* patch rather than quietly widening it — ignoring the request would teach
|
|
29107
|
+
* the operator that per-camera filtering works on that channel when it does
|
|
29108
|
+
* not.
|
|
29109
|
+
*/
|
|
29110
|
+
deviceIds: array(number().int()).readonly().nullable()
|
|
29111
|
+
});
|
|
29112
|
+
/**
|
|
29113
|
+
* `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
|
|
29114
|
+
* for the same reason: a channel is a window with a deadline, never a switch.
|
|
29115
|
+
*/
|
|
29116
|
+
var LogChannelWindowPatchSchema = object({
|
|
29117
|
+
channel: string().min(1),
|
|
29118
|
+
armMs: number().int().min(0),
|
|
29119
|
+
/**
|
|
29120
|
+
* Narrow to these numeric device ids. Absent or `null` = every camera.
|
|
29121
|
+
*
|
|
29122
|
+
* Numeric because the repo's own rule makes it possible: every log line
|
|
29123
|
+
* about a device carries `tags: { deviceId }` with the numeric id. That rule
|
|
29124
|
+
* was paid for with a 22% thumbnail gap and a 3-hour media blackout both
|
|
29125
|
+
* diagnosed by hand, and this is the first thing that collects on it.
|
|
29126
|
+
*/
|
|
29127
|
+
deviceIds: array(number().int()).readonly().nullable().optional()
|
|
29128
|
+
});
|
|
29129
|
+
/**
|
|
28899
29130
|
* A PATCH, and patches MERGE.
|
|
28900
29131
|
*
|
|
28901
29132
|
* A field absent from the patch is left exactly as it was — arming a
|
|
@@ -28914,7 +29145,14 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28914
29145
|
* Only the diagnostics NAMED here change. An armed window that is not listed
|
|
28915
29146
|
* keeps running — a patch is never a full replacement.
|
|
28916
29147
|
*/
|
|
28917
|
-
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
|
|
29148
|
+
diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
|
|
29149
|
+
/**
|
|
29150
|
+
* Only the channels NAMED here change. An armed channel that is not listed
|
|
29151
|
+
* keeps running — same rule as `diagnostics`, because a patch that silently
|
|
29152
|
+
* disarmed the channels it did not mention would make the Levels page and
|
|
29153
|
+
* the Diagnostics page fight over the same value.
|
|
29154
|
+
*/
|
|
29155
|
+
channels: array(LogChannelWindowPatchSchema).readonly().optional()
|
|
28918
29156
|
});
|
|
28919
29157
|
/**
|
|
28920
29158
|
* Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
|
|
@@ -28927,9 +29165,22 @@ var LoggingSettingsPatchSchema = object({
|
|
|
28927
29165
|
* authority over the whole hierarchy and answers for every layer, so the
|
|
28928
29166
|
* layer selector needs a name the transport does not already own.
|
|
28929
29167
|
*/
|
|
28930
|
-
var GetLoggingSettingsInputSchema = object({
|
|
29168
|
+
var GetLoggingSettingsInputSchema = object({
|
|
29169
|
+
scopeNodeId: string().optional(),
|
|
29170
|
+
/**
|
|
29171
|
+
* The declared CHANNEL this document is addressed at, when the caller wants
|
|
29172
|
+
* the `component` layer. Absent = the node/cluster hierarchy only.
|
|
29173
|
+
*
|
|
29174
|
+
* Naming it separately rather than overloading `scopeNodeId` keeps the two
|
|
29175
|
+
* axes from collapsing: a component level is cluster-wide, a node level is
|
|
29176
|
+
* not, and one selector for both would make "which of these two did I just
|
|
29177
|
+
* set" unanswerable — the exact ambiguity `explicit` exists to remove.
|
|
29178
|
+
*/
|
|
29179
|
+
scopeComponent: string().optional()
|
|
29180
|
+
});
|
|
28931
29181
|
var SetLoggingSettingsInputSchema = object({
|
|
28932
29182
|
scopeNodeId: string().optional(),
|
|
29183
|
+
scopeComponent: string().optional(),
|
|
28933
29184
|
patch: LoggingSettingsPatchSchema
|
|
28934
29185
|
});
|
|
28935
29186
|
/**
|
|
@@ -28944,9 +29195,20 @@ var SetLoggingSettingsInputSchema = object({
|
|
|
28944
29195
|
var LoggingSettingsStateSchema = object({
|
|
28945
29196
|
/** The layer this document was read at. `null` = the cluster layer. */
|
|
28946
29197
|
scopeNodeId: string().nullable(),
|
|
29198
|
+
/** The channel this document was read at. `null` = no component layer. */
|
|
29199
|
+
scopeComponent: string().nullable(),
|
|
28947
29200
|
effective: LoggingEffectiveSchema,
|
|
28948
29201
|
explicit: LoggingExplicitSchema,
|
|
28949
29202
|
activeWindows: array(DiagnosticWindowSchema).readonly(),
|
|
29203
|
+
/**
|
|
29204
|
+
* Every channel the cluster's addons DECLARE, gathered from the
|
|
29205
|
+
* `log-channels` providers. Not stored anywhere: assembled per read, so a
|
|
29206
|
+
* channel added by a redeployed addon appears without anybody editing a
|
|
29207
|
+
* list, and a channel whose addon is gone stops being offered.
|
|
29208
|
+
*/
|
|
29209
|
+
channels: array(LogChannelDescriptorSchema).readonly(),
|
|
29210
|
+
/** The channels ARMED right now, each with its deadline. */
|
|
29211
|
+
activeChannels: array(LogChannelWindowStateSchema).readonly(),
|
|
28950
29212
|
persisted: boolean()
|
|
28951
29213
|
});
|
|
28952
29214
|
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(), {
|
|
@@ -31931,6 +32193,12 @@ Object.freeze({
|
|
|
31931
32193
|
addonId: null,
|
|
31932
32194
|
access: "view"
|
|
31933
32195
|
},
|
|
32196
|
+
"dataStoreProvider.aggregate": {
|
|
32197
|
+
capName: "data-store-provider",
|
|
32198
|
+
capScope: "system",
|
|
32199
|
+
addonId: null,
|
|
32200
|
+
access: "view"
|
|
32201
|
+
},
|
|
31934
32202
|
"dataStoreProvider.count": {
|
|
31935
32203
|
capName: "data-store-provider",
|
|
31936
32204
|
capScope: "system",
|
|
@@ -32345,6 +32613,12 @@ Object.freeze({
|
|
|
32345
32613
|
addonId: null,
|
|
32346
32614
|
access: "view"
|
|
32347
32615
|
},
|
|
32616
|
+
"deviceManager.getChildrenBatch": {
|
|
32617
|
+
capName: "device-manager",
|
|
32618
|
+
capScope: "system",
|
|
32619
|
+
addonId: null,
|
|
32620
|
+
access: "view"
|
|
32621
|
+
},
|
|
32348
32622
|
"deviceManager.getConfigSchema": {
|
|
32349
32623
|
capName: "device-manager",
|
|
32350
32624
|
capScope: "system",
|
|
@@ -33395,6 +33669,18 @@ Object.freeze({
|
|
|
33395
33669
|
addonId: null,
|
|
33396
33670
|
access: "create"
|
|
33397
33671
|
},
|
|
33672
|
+
"logChannels.apply": {
|
|
33673
|
+
capName: "log-channels",
|
|
33674
|
+
capScope: "system",
|
|
33675
|
+
addonId: null,
|
|
33676
|
+
access: "create"
|
|
33677
|
+
},
|
|
33678
|
+
"logChannels.list": {
|
|
33679
|
+
capName: "log-channels",
|
|
33680
|
+
capScope: "system",
|
|
33681
|
+
addonId: null,
|
|
33682
|
+
access: "view"
|
|
33683
|
+
},
|
|
33398
33684
|
"logDestination.query": {
|
|
33399
33685
|
capName: "log-destination",
|
|
33400
33686
|
capScope: "system",
|
|
@@ -35549,6 +35835,12 @@ Object.freeze({
|
|
|
35549
35835
|
addonId: null,
|
|
35550
35836
|
access: "create"
|
|
35551
35837
|
},
|
|
35838
|
+
"settingsStore.aggregate": {
|
|
35839
|
+
capName: "settings-store",
|
|
35840
|
+
capScope: "system",
|
|
35841
|
+
addonId: null,
|
|
35842
|
+
access: "view"
|
|
35843
|
+
},
|
|
35552
35844
|
"settingsStore.count": {
|
|
35553
35845
|
capName: "settings-store",
|
|
35554
35846
|
capScope: "system",
|
|
@@ -37128,6 +37420,11 @@ Object.freeze({
|
|
|
37128
37420
|
form: "single",
|
|
37129
37421
|
optional: false
|
|
37130
37422
|
}],
|
|
37423
|
+
"deviceManager.getChildrenBatch": [{
|
|
37424
|
+
name: "parentDeviceIds",
|
|
37425
|
+
form: "array",
|
|
37426
|
+
optional: false
|
|
37427
|
+
}],
|
|
37131
37428
|
"deviceManager.getConfigSchema": [{
|
|
37132
37429
|
name: "deviceId",
|
|
37133
37430
|
form: "single",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-import-alexa",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.33",
|
|
4
4
|
"description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|