@camstack/addon-smtp-nodemailer 1.2.31 → 1.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.
@@ -7489,6 +7489,111 @@ var CameraSwitchGroupSchema = object({
7489
7489
  fetchedAt: number()
7490
7490
  });
7491
7491
  /**
7492
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
7493
+ * an addon declares its channels in.
7494
+ *
7495
+ * ## Two axes, deliberately separated
7496
+ *
7497
+ * - **DECLARATION** — which channels exist. Only the addon knows:
7498
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7499
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
7500
+ * and rots silently. So a channel is declared where it is consulted, and the
7501
+ * `log-channels` capability enumerates the declarations.
7502
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
7503
+ * thing: the logging settings document on the `system` cap. Two authorities
7504
+ * over the values is the exact defect
7505
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7506
+ * remove; re-introducing it from the cure side would be grotesque.
7507
+ *
7508
+ * Nothing in this file reads a clock, an env var or a store. The registry is
7509
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7510
+ * the hot path with a value somebody actually read, and by
7511
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7512
+ * never reaches here, so it can neither disarm an armed channel nor arm a
7513
+ * disarmed one (D49).
7514
+ *
7515
+ * ## The canonical call shape
7516
+ *
7517
+ * ```ts
7518
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7519
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7520
+ * }
7521
+ * ```
7522
+ *
7523
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7524
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
7525
+ * object literal is never constructed because it lives inside the branch. It
7526
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
7527
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
7528
+ * destination floor (measured at 1.93 ns/call when off).
7529
+ *
7530
+ * ## Why a channel emits at `info`
7531
+ *
7532
+ * `loki-logging.addon.ts` pins the destination default at `info` and
7533
+ * `loki-destination.ts` drops everything below it, so a line emitted at
7534
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7535
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
7536
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7537
+ * emits at the channel's declared level, whose schema floor is `info`.
7538
+ */
7539
+ /**
7540
+ * The level a channel writes at once armed.
7541
+ *
7542
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7543
+ * not leave the process for Loki, and the whole point of arming a channel is
7544
+ * to read it later.
7545
+ */
7546
+ var LogChannelLevelSchema = _enum([
7547
+ "info",
7548
+ "warn",
7549
+ "error"
7550
+ ]);
7551
+ /**
7552
+ * What an addon declares about one channel. No value, no state — a
7553
+ * declaration is inert.
7554
+ */
7555
+ var LogChannelDescriptorSchema = object({
7556
+ /**
7557
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7558
+ * the addon's short name so an operator reading a channel list can tell who
7559
+ * owns it without a second lookup.
7560
+ */
7561
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7562
+ /** One sentence: what the operator will SEE after arming it. */
7563
+ description: string().min(1),
7564
+ /** The level its lines are emitted at. Never below `info`. */
7565
+ defaultLevel: LogChannelLevelSchema,
7566
+ /**
7567
+ * Whether this channel can be narrowed to a camera.
7568
+ *
7569
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
7570
+ * consulted with the numeric device id, AND every line the channel admits
7571
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
7572
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7573
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7574
+ * the body is the only way to filter.
7575
+ *
7576
+ * A channel whose lines carry the device only in `meta` (or not at all) is
7577
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7578
+ * the operator narrows to one camera, sees nothing, and concludes the code
7579
+ * path was never taken.
7580
+ */
7581
+ perDevice: boolean()
7582
+ });
7583
+ /**
7584
+ * An armed window over one channel, as the document hands it to a mirror.
7585
+ *
7586
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7587
+ * expires by itself, which is the one failure a boolean cannot avoid.
7588
+ */
7589
+ var LogChannelWindowSchema = object({
7590
+ channel: string().min(1),
7591
+ /** Epoch ms the window closes at. */
7592
+ armedUntilMs: number(),
7593
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7594
+ deviceIds: array(number().int()).readonly().nullable()
7595
+ });
7596
+ /**
7492
7597
  * Ops-log — the durable, append-only operations audit shared by the
7493
7598
  * recordings and events management surfaces.
7494
7599
  *
@@ -11007,6 +11112,35 @@ var MutationFilterSchema = object({
11007
11112
  whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
11008
11113
  whereNot: record(string(), unknown()).optional()
11009
11114
  });
11115
+ /**
11116
+ * One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
11117
+ *
11118
+ * `as` names the slot in the result, so the SAME column may be asked twice with
11119
+ * two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
11120
+ * a `Record<column, op>` shape could not express.
11121
+ */
11122
+ var AggregateFieldSchema = object({
11123
+ /** Result key. */
11124
+ as: string().min(1),
11125
+ /** Column to aggregate. Must be a real column of a declared collection. */
11126
+ field: string().min(1),
11127
+ op: _enum([
11128
+ "sum",
11129
+ "min",
11130
+ "max"
11131
+ ])
11132
+ });
11133
+ /**
11134
+ * `COUNT(*)` plus one number per requested field.
11135
+ *
11136
+ * `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
11137
+ * that really is 0 are different facts, and an accounting caller that renders
11138
+ * "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
11139
+ */
11140
+ var AggregateResultSchema = object({
11141
+ count: number().int(),
11142
+ values: record(string(), number().nullable())
11143
+ });
11010
11144
  /** A single stored record: `{ id, data }`. */
11011
11145
  var SettingsRecordSchema = object({
11012
11146
  id: string(),
@@ -11091,6 +11225,11 @@ method(object({
11091
11225
  collection: string(),
11092
11226
  filter: QueryFilterSchema.optional()
11093
11227
  }), number()), method(object({
11228
+ namespace: string().optional(),
11229
+ collection: string(),
11230
+ fields: array(AggregateFieldSchema).readonly(),
11231
+ filter: QueryFilterSchema.optional()
11232
+ }), AggregateResultSchema), method(object({
11094
11233
  namespace: string().optional(),
11095
11234
  collection: string(),
11096
11235
  field: string(),
@@ -11207,6 +11346,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11207
11346
  collection: string(),
11208
11347
  filter: QueryFilterSchema.optional()
11209
11348
  }), number(), { auth: "admin" }), method(object({
11349
+ namespace: string().optional(),
11350
+ collection: string(),
11351
+ fields: array(AggregateFieldSchema).readonly(),
11352
+ filter: QueryFilterSchema.optional()
11353
+ }), AggregateResultSchema, { auth: "admin" }), method(object({
11210
11354
  namespace: string().optional(),
11211
11355
  collection: string(),
11212
11356
  field: string(),
@@ -11768,24 +11912,6 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
11768
11912
  kind: "mutation",
11769
11913
  auth: "admin"
11770
11914
  });
11771
- /**
11772
- * Device Manager capability — hub-side singleton that unifies device persistence,
11773
- * live registry access, and all management operations into a single tRPC surface.
11774
- *
11775
- * Replaces:
11776
- * - `device-persistence` capability (persistence methods absorbed here)
11777
- * - `device-management.router.ts` (deleted in Phase 2)
11778
- * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
11779
- *
11780
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
11781
- * fork into separate processes but never run on remote cluster agents. Therefore:
11782
- * - No nodeId routing needed — this is a pure hub singleton.
11783
- * - The hub's DeviceRegistry is the single source of truth for all live devices.
11784
- * - No shadow registry or cross-node aggregation required.
11785
- *
11786
- * Forked workers register devices back to the hub via `ctx.devices`
11787
- * (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
11788
- */
11789
11915
  /** One child-placement directive on a container's `childLayout`. Structurally
11790
11916
  * identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
11791
11917
  * shape for the same field. The child is identified by its re-sync-stable
@@ -12154,7 +12280,7 @@ method(object({
12154
12280
  * it answers today and the caller filters as it already does.
12155
12281
  */
12156
12282
  deviceIds: array(number()).optional()
12157
- }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12283
+ }), 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({
12158
12284
  mode: LinkedDevicesModeSchema,
12159
12285
  devices: array(LinkedDeviceSchema)
12160
12286
  })), 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({
@@ -12878,6 +13004,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
12878
13004
  kind: "mutation",
12879
13005
  auth: "admin"
12880
13006
  });
13007
+ /**
13008
+ * `log-channels` — the capability an addon DECLARES its diagnostic channels
13009
+ * through. It stores nothing.
13010
+ *
13011
+ * ## Why a capability at all, and why this shape
13012
+ *
13013
+ * Which channels exist is knowledge only the addon has: `stream-broker` knows
13014
+ * webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
13015
+ * maintained by hand rots at the first addition and rots INVISIBLY — nothing
13016
+ * fails, an operator just never sees the channel somebody added. So the list
13017
+ * is assembled from declarations at runtime.
13018
+ *
13019
+ * The shape is copied from `log-destination.cap.ts`, which already does
13020
+ * exactly this job: `mode: 'collection'`, `internal: true`,
13021
+ * `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
13022
+ * `addons.listCapabilityProviders` still enumerates it, and the hub's
13023
+ * `CapabilityRegistry` still holds an RPC proxy per provider so a forked
13024
+ * runner's declarations reach hub-main over the transport that already exists.
13025
+ * No new UDS message, no second registry.
13026
+ *
13027
+ * ## What it deliberately does NOT own
13028
+ *
13029
+ * The VALUES — which channel is armed, for which cameras, until when — live in
13030
+ * ONE place: the logging settings document on the `system` cap
13031
+ * (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
13032
+ * value is the defect the plan behind this work exists to remove, and
13033
+ * `setRequestCensus` was retired (D245) rather than allowed to be a second
13034
+ * one. {@link logChannelsCapability} therefore has no getter for a level, no
13035
+ * setter for a window and no persistence of any kind.
13036
+ *
13037
+ * ## Why `apply` is here even so
13038
+ *
13039
+ * The gate lives in the addon's PROCESS; the document lives in hub-main. Some
13040
+ * seam has to carry the value from the authority to the mirror, and a channel
13041
+ * that cannot be reached is precisely the dead knob this whole slice exists to
13042
+ * make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
13043
+ * `apply` is that seam and nothing more: it writes an in-memory mirror, it
13044
+ * persists nothing, it is never the source of a value, and it is called only
13045
+ * with a set the hub actually read (D49 — a read that fails does not call it
13046
+ * at all, so no channel is silently disarmed by a bad read).
13047
+ */
13048
+ /** What `apply` reports back — enough to log, not enough to be a second state. */
13049
+ var LogChannelApplyResultSchema = object({
13050
+ /** How many declared channels are armed in this process after the call. */
13051
+ armed: number().int().min(0),
13052
+ /**
13053
+ * Names the document armed that this process does not declare. Reported
13054
+ * rather than swallowed: a name here is either a typo or an addon that has
13055
+ * not booted, and both deserve a line instead of silence.
13056
+ */
13057
+ unknown: array(string()).readonly()
13058
+ });
13059
+ method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
12881
13060
  var LogLevelSchema = _enum([
12882
13061
  "debug",
12883
13062
  "info",
@@ -26146,17 +26325,60 @@ var SetSiteLocationInputSchema = object({
26146
26325
  longitude: number().min(-180).max(180)
26147
26326
  }).nullable();
26148
26327
  /**
26149
- * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26328
+ * The TRANSPORT a call arrived on.
26329
+ *
26330
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26331
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26332
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26333
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26334
+ * checkable rather than asserted.
26335
+ *
26336
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26337
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26338
+ * connection; the viewer talks to the hub over `wsLink`
26339
+ * exclusively, so this is the plane the HTTP census could not see.
26340
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26341
+ * never touches a socket and therefore never touched a census.
26342
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26343
+ * that is exactly what its `0` asserts: every plane the hub has can name
26344
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26345
+ * plane nobody instrumented lands here instead of vanishing from the total.
26346
+ */
26347
+ var TransportPlaneSchema = _enum([
26348
+ "http",
26349
+ "ws",
26350
+ "mesh",
26351
+ "unknown"
26352
+ ]);
26353
+ /**
26354
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26355
+ * reads as "not instrumented", which is the one thing this census must never
26356
+ * make an operator wonder about.
26357
+ */
26358
+ var TransportPlaneCountsSchema = object({
26359
+ http: number(),
26360
+ ws: number(),
26361
+ mesh: number(),
26362
+ unknown: number()
26363
+ });
26364
+ /**
26365
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26150
26366
  * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26151
26367
  * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26152
26368
  * already prints - never a token, never an `Authorization` header.
26369
+ *
26370
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26371
+ * and lives for hours, so folding it into a call count makes one long-lived
26372
+ * stream look like a storm.
26153
26373
  */
26154
26374
  var RequestCensusGroupSchema = object({
26375
+ plane: TransportPlaneSchema,
26155
26376
  procedure: string(),
26156
26377
  userAgent: string(),
26157
26378
  ip: string(),
26158
26379
  principal: string(),
26159
26380
  calls: number(),
26381
+ subscriptions: number(),
26160
26382
  perMin: number()
26161
26383
  });
26162
26384
  /**
@@ -26169,6 +26391,14 @@ var RequestCensusGroupSchema = object({
26169
26391
  var RequestCensusProcedureSchema = object({
26170
26392
  procedure: string(),
26171
26393
  calls: number(),
26394
+ /**
26395
+ * The same total, split by transport. THIS is the row that answers the
26396
+ * question the census exists for: one look at `deviceManager.listAll` says
26397
+ * which plane carried the 4 960, without joining two log lines by eye.
26398
+ */
26399
+ planes: TransportPlaneCountsSchema,
26400
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26401
+ subscriptions: number(),
26172
26402
  perMin: number()
26173
26403
  });
26174
26404
  /**
@@ -26196,14 +26426,45 @@ var RequestCensusStatusSchema = object({
26196
26426
  */
26197
26427
  procedureCalls: number(),
26198
26428
  /**
26429
+ * `procedureCalls` split by transport. The four keys sum to
26430
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26431
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26432
+ */
26433
+ planes: TransportPlaneCountsSchema,
26434
+ /**
26435
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26436
+ * on no plane at all - which is a RESULT (a plane is missing from the
26437
+ * instrument), not a failure, and it has to be visible to be read as one.
26438
+ */
26439
+ planesExplainTotal: boolean(),
26440
+ /**
26199
26441
  * tRPC WebSocket connections opened during the window. NOT calls - the WS
26200
- * transport resolves one context per connection - but the number that says
26201
- * whether a plane this census cannot see was busy while HTTP was quiet.
26442
+ * adapter resolves one context per connection - kept because a plane's call
26443
+ * count of zero against 37 open connections says something different from a
26444
+ * plane with no connections at all.
26202
26445
  */
26203
26446
  wsConnections: number(),
26447
+ /**
26448
+ * Client frames the WS plane looked at. `wsMessages` far above
26449
+ * `planes.ws + subscriptions` means most traffic is not operations
26450
+ * (keepalives, connection params) - which is itself an answer.
26451
+ */
26452
+ wsMessages: number(),
26453
+ /**
26454
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26455
+ * purpose: one live-events stream opened at boot and held for six hours is
26456
+ * one subscription, and counting it as a call would let a quiet plane
26457
+ * masquerade as the storm.
26458
+ */
26459
+ subscriptions: number(),
26460
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26461
+ subscriptionStops: number(),
26204
26462
  distinctGroups: number(),
26205
- /** Calls counted in the totals whose group attribution was shed at the
26206
- * cardinality bound. */
26463
+ /**
26464
+ * Operations counted in the totals whose CALLER attribution was shed at the
26465
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26466
+ * which transport they arrived on, they just lost their group row.
26467
+ */
26207
26468
  unattributedCalls: number(),
26208
26469
  procedures: array(RequestCensusProcedureSchema).readonly(),
26209
26470
  groups: array(RequestCensusGroupSchema).readonly()
@@ -26226,10 +26487,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
26226
26487
  * The layers of the level hierarchy, general → specific. The most specific
26227
26488
  * layer that carries an explicit value wins.
26228
26489
  *
26229
- * `component` is DECLARED and not yet resolvable: the per-component channels
26230
- * are a later slice of the same plan, and a `levelSource` enum that has to
26231
- * grow later would force every consumer of this document to change with it.
26232
- * Nothing returns `component` today.
26490
+ * `component` became RESOLVABLE on 2026-08-27: a component is a declared log
26491
+ * CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
26492
+ * `scopeComponent`. It was declared-but-dark in the first slice precisely so
26493
+ * that turning it on would not force every consumer of this document to widen
26494
+ * a `levelSource` enum — which is what has now not happened.
26233
26495
  */
26234
26496
  var LoggingScopeKindSchema = _enum([
26235
26497
  "cluster",
@@ -26256,6 +26518,14 @@ var LoggingLevelLayerSchema = object({
26256
26518
  scope: LoggingScopeKindSchema,
26257
26519
  /** The node this layer speaks for; `null` on the cluster layer. */
26258
26520
  nodeId: string().nullable(),
26521
+ /**
26522
+ * The declared channel this layer speaks for; `null` on every layer but
26523
+ * `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
26524
+ * by design — the convention this repo settled on is one orchestrator-wide
26525
+ * setting, never per node (D52) — so a component layer that carried a node
26526
+ * would invite a per-node copy of a value that has no per-node meaning.
26527
+ */
26528
+ component: string().nullable(),
26259
26529
  /** Explicitly set here, or `null` when this layer inherits. */
26260
26530
  level: LogLevelSchema$1.nullable()
26261
26531
  });
@@ -26297,6 +26567,49 @@ var DiagnosticWindowPatchSchema = object({
26297
26567
  reportEveryMs: number().int().positive().optional()
26298
26568
  });
26299
26569
  /**
26570
+ * A channel ARMED, as the document reports it.
26571
+ *
26572
+ * `armMs` is not echoed back: what an operator needs to see is the deadline
26573
+ * and the time left, because a diagnostic left running is itself an incident
26574
+ * and "armed for 10 minutes" said an hour ago is not an answer.
26575
+ */
26576
+ var LogChannelWindowStateSchema = object({
26577
+ channel: string(),
26578
+ armed: boolean(),
26579
+ /** Epoch ms the window closes at. 0 when disarmed. */
26580
+ armedUntilMs: number(),
26581
+ /** Ms left before it expires on its own. 0 when disarmed. */
26582
+ remainingMs: number(),
26583
+ /**
26584
+ * The cameras it is narrowed to, or `null` for every camera.
26585
+ *
26586
+ * A channel declared `perDevice: false` can only ever report `null` here:
26587
+ * its lines do not carry `tags: { deviceId }`, so narrowing them would
26588
+ * produce a filter that silently matches nothing. The server REFUSES such a
26589
+ * patch rather than quietly widening it — ignoring the request would teach
26590
+ * the operator that per-camera filtering works on that channel when it does
26591
+ * not.
26592
+ */
26593
+ deviceIds: array(number().int()).readonly().nullable()
26594
+ });
26595
+ /**
26596
+ * `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
26597
+ * for the same reason: a channel is a window with a deadline, never a switch.
26598
+ */
26599
+ var LogChannelWindowPatchSchema = object({
26600
+ channel: string().min(1),
26601
+ armMs: number().int().min(0),
26602
+ /**
26603
+ * Narrow to these numeric device ids. Absent or `null` = every camera.
26604
+ *
26605
+ * Numeric because the repo's own rule makes it possible: every log line
26606
+ * about a device carries `tags: { deviceId }` with the numeric id. That rule
26607
+ * was paid for with a 22% thumbnail gap and a 3-hour media blackout both
26608
+ * diagnosed by hand, and this is the first thing that collects on it.
26609
+ */
26610
+ deviceIds: array(number().int()).readonly().nullable().optional()
26611
+ });
26612
+ /**
26300
26613
  * A PATCH, and patches MERGE.
26301
26614
  *
26302
26615
  * A field absent from the patch is left exactly as it was — arming a
@@ -26315,7 +26628,14 @@ var LoggingSettingsPatchSchema = object({
26315
26628
  * Only the diagnostics NAMED here change. An armed window that is not listed
26316
26629
  * keeps running — a patch is never a full replacement.
26317
26630
  */
26318
- diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26631
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
26632
+ /**
26633
+ * Only the channels NAMED here change. An armed channel that is not listed
26634
+ * keeps running — same rule as `diagnostics`, because a patch that silently
26635
+ * disarmed the channels it did not mention would make the Levels page and
26636
+ * the Diagnostics page fight over the same value.
26637
+ */
26638
+ channels: array(LogChannelWindowPatchSchema).readonly().optional()
26319
26639
  });
26320
26640
  /**
26321
26641
  * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
@@ -26328,9 +26648,22 @@ var LoggingSettingsPatchSchema = object({
26328
26648
  * authority over the whole hierarchy and answers for every layer, so the
26329
26649
  * layer selector needs a name the transport does not already own.
26330
26650
  */
26331
- var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26651
+ var GetLoggingSettingsInputSchema = object({
26652
+ scopeNodeId: string().optional(),
26653
+ /**
26654
+ * The declared CHANNEL this document is addressed at, when the caller wants
26655
+ * the `component` layer. Absent = the node/cluster hierarchy only.
26656
+ *
26657
+ * Naming it separately rather than overloading `scopeNodeId` keeps the two
26658
+ * axes from collapsing: a component level is cluster-wide, a node level is
26659
+ * not, and one selector for both would make "which of these two did I just
26660
+ * set" unanswerable — the exact ambiguity `explicit` exists to remove.
26661
+ */
26662
+ scopeComponent: string().optional()
26663
+ });
26332
26664
  var SetLoggingSettingsInputSchema = object({
26333
26665
  scopeNodeId: string().optional(),
26666
+ scopeComponent: string().optional(),
26334
26667
  patch: LoggingSettingsPatchSchema
26335
26668
  });
26336
26669
  /**
@@ -26345,9 +26678,20 @@ var SetLoggingSettingsInputSchema = object({
26345
26678
  var LoggingSettingsStateSchema = object({
26346
26679
  /** The layer this document was read at. `null` = the cluster layer. */
26347
26680
  scopeNodeId: string().nullable(),
26681
+ /** The channel this document was read at. `null` = no component layer. */
26682
+ scopeComponent: string().nullable(),
26348
26683
  effective: LoggingEffectiveSchema,
26349
26684
  explicit: LoggingExplicitSchema,
26350
26685
  activeWindows: array(DiagnosticWindowSchema).readonly(),
26686
+ /**
26687
+ * Every channel the cluster's addons DECLARE, gathered from the
26688
+ * `log-channels` providers. Not stored anywhere: assembled per read, so a
26689
+ * channel added by a redeployed addon appears without anybody editing a
26690
+ * list, and a channel whose addon is gone stops being offered.
26691
+ */
26692
+ channels: array(LogChannelDescriptorSchema).readonly(),
26693
+ /** The channels ARMED right now, each with its deadline. */
26694
+ activeChannels: array(LogChannelWindowStateSchema).readonly(),
26351
26695
  persisted: boolean()
26352
26696
  });
26353
26697
  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(), {
@@ -27924,6 +28268,12 @@ Object.freeze({
27924
28268
  addonId: null,
27925
28269
  access: "view"
27926
28270
  },
28271
+ "dataStoreProvider.aggregate": {
28272
+ capName: "data-store-provider",
28273
+ capScope: "system",
28274
+ addonId: null,
28275
+ access: "view"
28276
+ },
27927
28277
  "dataStoreProvider.count": {
27928
28278
  capName: "data-store-provider",
27929
28279
  capScope: "system",
@@ -28338,6 +28688,12 @@ Object.freeze({
28338
28688
  addonId: null,
28339
28689
  access: "view"
28340
28690
  },
28691
+ "deviceManager.getChildrenBatch": {
28692
+ capName: "device-manager",
28693
+ capScope: "system",
28694
+ addonId: null,
28695
+ access: "view"
28696
+ },
28341
28697
  "deviceManager.getConfigSchema": {
28342
28698
  capName: "device-manager",
28343
28699
  capScope: "system",
@@ -29388,6 +29744,18 @@ Object.freeze({
29388
29744
  addonId: null,
29389
29745
  access: "create"
29390
29746
  },
29747
+ "logChannels.apply": {
29748
+ capName: "log-channels",
29749
+ capScope: "system",
29750
+ addonId: null,
29751
+ access: "create"
29752
+ },
29753
+ "logChannels.list": {
29754
+ capName: "log-channels",
29755
+ capScope: "system",
29756
+ addonId: null,
29757
+ access: "view"
29758
+ },
29391
29759
  "logDestination.query": {
29392
29760
  capName: "log-destination",
29393
29761
  capScope: "system",
@@ -31542,6 +31910,12 @@ Object.freeze({
31542
31910
  addonId: null,
31543
31911
  access: "create"
31544
31912
  },
31913
+ "settingsStore.aggregate": {
31914
+ capName: "settings-store",
31915
+ capScope: "system",
31916
+ addonId: null,
31917
+ access: "view"
31918
+ },
31545
31919
  "settingsStore.count": {
31546
31920
  capName: "settings-store",
31547
31921
  capScope: "system",
@@ -33121,6 +33495,11 @@ Object.freeze({
33121
33495
  form: "single",
33122
33496
  optional: false
33123
33497
  }],
33498
+ "deviceManager.getChildrenBatch": [{
33499
+ name: "parentDeviceIds",
33500
+ form: "array",
33501
+ optional: false
33502
+ }],
33124
33503
  "deviceManager.getConfigSchema": [{
33125
33504
  name: "deviceId",
33126
33505
  form: "single",
@@ -7487,6 +7487,111 @@ var CameraSwitchGroupSchema = object({
7487
7487
  fetchedAt: number()
7488
7488
  });
7489
7489
  /**
7490
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
7491
+ * an addon declares its channels in.
7492
+ *
7493
+ * ## Two axes, deliberately separated
7494
+ *
7495
+ * - **DECLARATION** — which channels exist. Only the addon knows:
7496
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7497
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
7498
+ * and rots silently. So a channel is declared where it is consulted, and the
7499
+ * `log-channels` capability enumerates the declarations.
7500
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
7501
+ * thing: the logging settings document on the `system` cap. Two authorities
7502
+ * over the values is the exact defect
7503
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7504
+ * remove; re-introducing it from the cure side would be grotesque.
7505
+ *
7506
+ * Nothing in this file reads a clock, an env var or a store. The registry is
7507
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7508
+ * the hot path with a value somebody actually read, and by
7509
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7510
+ * never reaches here, so it can neither disarm an armed channel nor arm a
7511
+ * disarmed one (D49).
7512
+ *
7513
+ * ## The canonical call shape
7514
+ *
7515
+ * ```ts
7516
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7517
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7518
+ * }
7519
+ * ```
7520
+ *
7521
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7522
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
7523
+ * object literal is never constructed because it lives inside the branch. It
7524
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
7525
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
7526
+ * destination floor (measured at 1.93 ns/call when off).
7527
+ *
7528
+ * ## Why a channel emits at `info`
7529
+ *
7530
+ * `loki-logging.addon.ts` pins the destination default at `info` and
7531
+ * `loki-destination.ts` drops everything below it, so a line emitted at
7532
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7533
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
7534
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7535
+ * emits at the channel's declared level, whose schema floor is `info`.
7536
+ */
7537
+ /**
7538
+ * The level a channel writes at once armed.
7539
+ *
7540
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7541
+ * not leave the process for Loki, and the whole point of arming a channel is
7542
+ * to read it later.
7543
+ */
7544
+ var LogChannelLevelSchema = _enum([
7545
+ "info",
7546
+ "warn",
7547
+ "error"
7548
+ ]);
7549
+ /**
7550
+ * What an addon declares about one channel. No value, no state — a
7551
+ * declaration is inert.
7552
+ */
7553
+ var LogChannelDescriptorSchema = object({
7554
+ /**
7555
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7556
+ * the addon's short name so an operator reading a channel list can tell who
7557
+ * owns it without a second lookup.
7558
+ */
7559
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7560
+ /** One sentence: what the operator will SEE after arming it. */
7561
+ description: string().min(1),
7562
+ /** The level its lines are emitted at. Never below `info`. */
7563
+ defaultLevel: LogChannelLevelSchema,
7564
+ /**
7565
+ * Whether this channel can be narrowed to a camera.
7566
+ *
7567
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
7568
+ * consulted with the numeric device id, AND every line the channel admits
7569
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
7570
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7571
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7572
+ * the body is the only way to filter.
7573
+ *
7574
+ * A channel whose lines carry the device only in `meta` (or not at all) is
7575
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7576
+ * the operator narrows to one camera, sees nothing, and concludes the code
7577
+ * path was never taken.
7578
+ */
7579
+ perDevice: boolean()
7580
+ });
7581
+ /**
7582
+ * An armed window over one channel, as the document hands it to a mirror.
7583
+ *
7584
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7585
+ * expires by itself, which is the one failure a boolean cannot avoid.
7586
+ */
7587
+ var LogChannelWindowSchema = object({
7588
+ channel: string().min(1),
7589
+ /** Epoch ms the window closes at. */
7590
+ armedUntilMs: number(),
7591
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7592
+ deviceIds: array(number().int()).readonly().nullable()
7593
+ });
7594
+ /**
7490
7595
  * Ops-log — the durable, append-only operations audit shared by the
7491
7596
  * recordings and events management surfaces.
7492
7597
  *
@@ -11005,6 +11110,35 @@ var MutationFilterSchema = object({
11005
11110
  whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
11006
11111
  whereNot: record(string(), unknown()).optional()
11007
11112
  });
11113
+ /**
11114
+ * One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
11115
+ *
11116
+ * `as` names the slot in the result, so the SAME column may be asked twice with
11117
+ * two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
11118
+ * a `Record<column, op>` shape could not express.
11119
+ */
11120
+ var AggregateFieldSchema = object({
11121
+ /** Result key. */
11122
+ as: string().min(1),
11123
+ /** Column to aggregate. Must be a real column of a declared collection. */
11124
+ field: string().min(1),
11125
+ op: _enum([
11126
+ "sum",
11127
+ "min",
11128
+ "max"
11129
+ ])
11130
+ });
11131
+ /**
11132
+ * `COUNT(*)` plus one number per requested field.
11133
+ *
11134
+ * `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
11135
+ * that really is 0 are different facts, and an accounting caller that renders
11136
+ * "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
11137
+ */
11138
+ var AggregateResultSchema = object({
11139
+ count: number().int(),
11140
+ values: record(string(), number().nullable())
11141
+ });
11008
11142
  /** A single stored record: `{ id, data }`. */
11009
11143
  var SettingsRecordSchema = object({
11010
11144
  id: string(),
@@ -11089,6 +11223,11 @@ method(object({
11089
11223
  collection: string(),
11090
11224
  filter: QueryFilterSchema.optional()
11091
11225
  }), number()), method(object({
11226
+ namespace: string().optional(),
11227
+ collection: string(),
11228
+ fields: array(AggregateFieldSchema).readonly(),
11229
+ filter: QueryFilterSchema.optional()
11230
+ }), AggregateResultSchema), method(object({
11092
11231
  namespace: string().optional(),
11093
11232
  collection: string(),
11094
11233
  field: string(),
@@ -11205,6 +11344,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11205
11344
  collection: string(),
11206
11345
  filter: QueryFilterSchema.optional()
11207
11346
  }), number(), { auth: "admin" }), method(object({
11347
+ namespace: string().optional(),
11348
+ collection: string(),
11349
+ fields: array(AggregateFieldSchema).readonly(),
11350
+ filter: QueryFilterSchema.optional()
11351
+ }), AggregateResultSchema, { auth: "admin" }), method(object({
11208
11352
  namespace: string().optional(),
11209
11353
  collection: string(),
11210
11354
  field: string(),
@@ -11766,24 +11910,6 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
11766
11910
  kind: "mutation",
11767
11911
  auth: "admin"
11768
11912
  });
11769
- /**
11770
- * Device Manager capability — hub-side singleton that unifies device persistence,
11771
- * live registry access, and all management operations into a single tRPC surface.
11772
- *
11773
- * Replaces:
11774
- * - `device-persistence` capability (persistence methods absorbed here)
11775
- * - `device-management.router.ts` (deleted in Phase 2)
11776
- * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
11777
- *
11778
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
11779
- * fork into separate processes but never run on remote cluster agents. Therefore:
11780
- * - No nodeId routing needed — this is a pure hub singleton.
11781
- * - The hub's DeviceRegistry is the single source of truth for all live devices.
11782
- * - No shadow registry or cross-node aggregation required.
11783
- *
11784
- * Forked workers register devices back to the hub via `ctx.devices`
11785
- * (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
11786
- */
11787
11913
  /** One child-placement directive on a container's `childLayout`. Structurally
11788
11914
  * identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
11789
11915
  * shape for the same field. The child is identified by its re-sync-stable
@@ -12152,7 +12278,7 @@ method(object({
12152
12278
  * it answers today and the caller filters as it already does.
12153
12279
  */
12154
12280
  deviceIds: array(number()).optional()
12155
- }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12281
+ }), 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({
12156
12282
  mode: LinkedDevicesModeSchema,
12157
12283
  devices: array(LinkedDeviceSchema)
12158
12284
  })), 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({
@@ -12876,6 +13002,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
12876
13002
  kind: "mutation",
12877
13003
  auth: "admin"
12878
13004
  });
13005
+ /**
13006
+ * `log-channels` — the capability an addon DECLARES its diagnostic channels
13007
+ * through. It stores nothing.
13008
+ *
13009
+ * ## Why a capability at all, and why this shape
13010
+ *
13011
+ * Which channels exist is knowledge only the addon has: `stream-broker` knows
13012
+ * webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
13013
+ * maintained by hand rots at the first addition and rots INVISIBLY — nothing
13014
+ * fails, an operator just never sees the channel somebody added. So the list
13015
+ * is assembled from declarations at runtime.
13016
+ *
13017
+ * The shape is copied from `log-destination.cap.ts`, which already does
13018
+ * exactly this job: `mode: 'collection'`, `internal: true`,
13019
+ * `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
13020
+ * `addons.listCapabilityProviders` still enumerates it, and the hub's
13021
+ * `CapabilityRegistry` still holds an RPC proxy per provider so a forked
13022
+ * runner's declarations reach hub-main over the transport that already exists.
13023
+ * No new UDS message, no second registry.
13024
+ *
13025
+ * ## What it deliberately does NOT own
13026
+ *
13027
+ * The VALUES — which channel is armed, for which cameras, until when — live in
13028
+ * ONE place: the logging settings document on the `system` cap
13029
+ * (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
13030
+ * value is the defect the plan behind this work exists to remove, and
13031
+ * `setRequestCensus` was retired (D245) rather than allowed to be a second
13032
+ * one. {@link logChannelsCapability} therefore has no getter for a level, no
13033
+ * setter for a window and no persistence of any kind.
13034
+ *
13035
+ * ## Why `apply` is here even so
13036
+ *
13037
+ * The gate lives in the addon's PROCESS; the document lives in hub-main. Some
13038
+ * seam has to carry the value from the authority to the mirror, and a channel
13039
+ * that cannot be reached is precisely the dead knob this whole slice exists to
13040
+ * make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
13041
+ * `apply` is that seam and nothing more: it writes an in-memory mirror, it
13042
+ * persists nothing, it is never the source of a value, and it is called only
13043
+ * with a set the hub actually read (D49 — a read that fails does not call it
13044
+ * at all, so no channel is silently disarmed by a bad read).
13045
+ */
13046
+ /** What `apply` reports back — enough to log, not enough to be a second state. */
13047
+ var LogChannelApplyResultSchema = object({
13048
+ /** How many declared channels are armed in this process after the call. */
13049
+ armed: number().int().min(0),
13050
+ /**
13051
+ * Names the document armed that this process does not declare. Reported
13052
+ * rather than swallowed: a name here is either a typo or an addon that has
13053
+ * not booted, and both deserve a line instead of silence.
13054
+ */
13055
+ unknown: array(string()).readonly()
13056
+ });
13057
+ method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
12879
13058
  var LogLevelSchema = _enum([
12880
13059
  "debug",
12881
13060
  "info",
@@ -26144,17 +26323,60 @@ var SetSiteLocationInputSchema = object({
26144
26323
  longitude: number().min(-180).max(180)
26145
26324
  }).nullable();
26146
26325
  /**
26147
- * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26326
+ * The TRANSPORT a call arrived on.
26327
+ *
26328
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26329
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26330
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26331
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26332
+ * checkable rather than asserted.
26333
+ *
26334
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26335
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26336
+ * connection; the viewer talks to the hub over `wsLink`
26337
+ * exclusively, so this is the plane the HTTP census could not see.
26338
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26339
+ * never touches a socket and therefore never touched a census.
26340
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26341
+ * that is exactly what its `0` asserts: every plane the hub has can name
26342
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26343
+ * plane nobody instrumented lands here instead of vanishing from the total.
26344
+ */
26345
+ var TransportPlaneSchema = _enum([
26346
+ "http",
26347
+ "ws",
26348
+ "mesh",
26349
+ "unknown"
26350
+ ]);
26351
+ /**
26352
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26353
+ * reads as "not instrumented", which is the one thing this census must never
26354
+ * make an operator wonder about.
26355
+ */
26356
+ var TransportPlaneCountsSchema = object({
26357
+ http: number(),
26358
+ ws: number(),
26359
+ mesh: number(),
26360
+ unknown: number()
26361
+ });
26362
+ /**
26363
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26148
26364
  * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26149
26365
  * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26150
26366
  * already prints - never a token, never an `Authorization` header.
26367
+ *
26368
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26369
+ * and lives for hours, so folding it into a call count makes one long-lived
26370
+ * stream look like a storm.
26151
26371
  */
26152
26372
  var RequestCensusGroupSchema = object({
26373
+ plane: TransportPlaneSchema,
26153
26374
  procedure: string(),
26154
26375
  userAgent: string(),
26155
26376
  ip: string(),
26156
26377
  principal: string(),
26157
26378
  calls: number(),
26379
+ subscriptions: number(),
26158
26380
  perMin: number()
26159
26381
  });
26160
26382
  /**
@@ -26167,6 +26389,14 @@ var RequestCensusGroupSchema = object({
26167
26389
  var RequestCensusProcedureSchema = object({
26168
26390
  procedure: string(),
26169
26391
  calls: number(),
26392
+ /**
26393
+ * The same total, split by transport. THIS is the row that answers the
26394
+ * question the census exists for: one look at `deviceManager.listAll` says
26395
+ * which plane carried the 4 960, without joining two log lines by eye.
26396
+ */
26397
+ planes: TransportPlaneCountsSchema,
26398
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26399
+ subscriptions: number(),
26170
26400
  perMin: number()
26171
26401
  });
26172
26402
  /**
@@ -26194,14 +26424,45 @@ var RequestCensusStatusSchema = object({
26194
26424
  */
26195
26425
  procedureCalls: number(),
26196
26426
  /**
26427
+ * `procedureCalls` split by transport. The four keys sum to
26428
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26429
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26430
+ */
26431
+ planes: TransportPlaneCountsSchema,
26432
+ /**
26433
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26434
+ * on no plane at all - which is a RESULT (a plane is missing from the
26435
+ * instrument), not a failure, and it has to be visible to be read as one.
26436
+ */
26437
+ planesExplainTotal: boolean(),
26438
+ /**
26197
26439
  * tRPC WebSocket connections opened during the window. NOT calls - the WS
26198
- * transport resolves one context per connection - but the number that says
26199
- * whether a plane this census cannot see was busy while HTTP was quiet.
26440
+ * adapter resolves one context per connection - kept because a plane's call
26441
+ * count of zero against 37 open connections says something different from a
26442
+ * plane with no connections at all.
26200
26443
  */
26201
26444
  wsConnections: number(),
26445
+ /**
26446
+ * Client frames the WS plane looked at. `wsMessages` far above
26447
+ * `planes.ws + subscriptions` means most traffic is not operations
26448
+ * (keepalives, connection params) - which is itself an answer.
26449
+ */
26450
+ wsMessages: number(),
26451
+ /**
26452
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26453
+ * purpose: one live-events stream opened at boot and held for six hours is
26454
+ * one subscription, and counting it as a call would let a quiet plane
26455
+ * masquerade as the storm.
26456
+ */
26457
+ subscriptions: number(),
26458
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26459
+ subscriptionStops: number(),
26202
26460
  distinctGroups: number(),
26203
- /** Calls counted in the totals whose group attribution was shed at the
26204
- * cardinality bound. */
26461
+ /**
26462
+ * Operations counted in the totals whose CALLER attribution was shed at the
26463
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26464
+ * which transport they arrived on, they just lost their group row.
26465
+ */
26205
26466
  unattributedCalls: number(),
26206
26467
  procedures: array(RequestCensusProcedureSchema).readonly(),
26207
26468
  groups: array(RequestCensusGroupSchema).readonly()
@@ -26224,10 +26485,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
26224
26485
  * The layers of the level hierarchy, general → specific. The most specific
26225
26486
  * layer that carries an explicit value wins.
26226
26487
  *
26227
- * `component` is DECLARED and not yet resolvable: the per-component channels
26228
- * are a later slice of the same plan, and a `levelSource` enum that has to
26229
- * grow later would force every consumer of this document to change with it.
26230
- * Nothing returns `component` today.
26488
+ * `component` became RESOLVABLE on 2026-08-27: a component is a declared log
26489
+ * CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
26490
+ * `scopeComponent`. It was declared-but-dark in the first slice precisely so
26491
+ * that turning it on would not force every consumer of this document to widen
26492
+ * a `levelSource` enum — which is what has now not happened.
26231
26493
  */
26232
26494
  var LoggingScopeKindSchema = _enum([
26233
26495
  "cluster",
@@ -26254,6 +26516,14 @@ var LoggingLevelLayerSchema = object({
26254
26516
  scope: LoggingScopeKindSchema,
26255
26517
  /** The node this layer speaks for; `null` on the cluster layer. */
26256
26518
  nodeId: string().nullable(),
26519
+ /**
26520
+ * The declared channel this layer speaks for; `null` on every layer but
26521
+ * `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
26522
+ * by design — the convention this repo settled on is one orchestrator-wide
26523
+ * setting, never per node (D52) — so a component layer that carried a node
26524
+ * would invite a per-node copy of a value that has no per-node meaning.
26525
+ */
26526
+ component: string().nullable(),
26257
26527
  /** Explicitly set here, or `null` when this layer inherits. */
26258
26528
  level: LogLevelSchema$1.nullable()
26259
26529
  });
@@ -26295,6 +26565,49 @@ var DiagnosticWindowPatchSchema = object({
26295
26565
  reportEveryMs: number().int().positive().optional()
26296
26566
  });
26297
26567
  /**
26568
+ * A channel ARMED, as the document reports it.
26569
+ *
26570
+ * `armMs` is not echoed back: what an operator needs to see is the deadline
26571
+ * and the time left, because a diagnostic left running is itself an incident
26572
+ * and "armed for 10 minutes" said an hour ago is not an answer.
26573
+ */
26574
+ var LogChannelWindowStateSchema = object({
26575
+ channel: string(),
26576
+ armed: boolean(),
26577
+ /** Epoch ms the window closes at. 0 when disarmed. */
26578
+ armedUntilMs: number(),
26579
+ /** Ms left before it expires on its own. 0 when disarmed. */
26580
+ remainingMs: number(),
26581
+ /**
26582
+ * The cameras it is narrowed to, or `null` for every camera.
26583
+ *
26584
+ * A channel declared `perDevice: false` can only ever report `null` here:
26585
+ * its lines do not carry `tags: { deviceId }`, so narrowing them would
26586
+ * produce a filter that silently matches nothing. The server REFUSES such a
26587
+ * patch rather than quietly widening it — ignoring the request would teach
26588
+ * the operator that per-camera filtering works on that channel when it does
26589
+ * not.
26590
+ */
26591
+ deviceIds: array(number().int()).readonly().nullable()
26592
+ });
26593
+ /**
26594
+ * `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
26595
+ * for the same reason: a channel is a window with a deadline, never a switch.
26596
+ */
26597
+ var LogChannelWindowPatchSchema = object({
26598
+ channel: string().min(1),
26599
+ armMs: number().int().min(0),
26600
+ /**
26601
+ * Narrow to these numeric device ids. Absent or `null` = every camera.
26602
+ *
26603
+ * Numeric because the repo's own rule makes it possible: every log line
26604
+ * about a device carries `tags: { deviceId }` with the numeric id. That rule
26605
+ * was paid for with a 22% thumbnail gap and a 3-hour media blackout both
26606
+ * diagnosed by hand, and this is the first thing that collects on it.
26607
+ */
26608
+ deviceIds: array(number().int()).readonly().nullable().optional()
26609
+ });
26610
+ /**
26298
26611
  * A PATCH, and patches MERGE.
26299
26612
  *
26300
26613
  * A field absent from the patch is left exactly as it was — arming a
@@ -26313,7 +26626,14 @@ var LoggingSettingsPatchSchema = object({
26313
26626
  * Only the diagnostics NAMED here change. An armed window that is not listed
26314
26627
  * keeps running — a patch is never a full replacement.
26315
26628
  */
26316
- diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26629
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
26630
+ /**
26631
+ * Only the channels NAMED here change. An armed channel that is not listed
26632
+ * keeps running — same rule as `diagnostics`, because a patch that silently
26633
+ * disarmed the channels it did not mention would make the Levels page and
26634
+ * the Diagnostics page fight over the same value.
26635
+ */
26636
+ channels: array(LogChannelWindowPatchSchema).readonly().optional()
26317
26637
  });
26318
26638
  /**
26319
26639
  * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
@@ -26326,9 +26646,22 @@ var LoggingSettingsPatchSchema = object({
26326
26646
  * authority over the whole hierarchy and answers for every layer, so the
26327
26647
  * layer selector needs a name the transport does not already own.
26328
26648
  */
26329
- var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26649
+ var GetLoggingSettingsInputSchema = object({
26650
+ scopeNodeId: string().optional(),
26651
+ /**
26652
+ * The declared CHANNEL this document is addressed at, when the caller wants
26653
+ * the `component` layer. Absent = the node/cluster hierarchy only.
26654
+ *
26655
+ * Naming it separately rather than overloading `scopeNodeId` keeps the two
26656
+ * axes from collapsing: a component level is cluster-wide, a node level is
26657
+ * not, and one selector for both would make "which of these two did I just
26658
+ * set" unanswerable — the exact ambiguity `explicit` exists to remove.
26659
+ */
26660
+ scopeComponent: string().optional()
26661
+ });
26330
26662
  var SetLoggingSettingsInputSchema = object({
26331
26663
  scopeNodeId: string().optional(),
26664
+ scopeComponent: string().optional(),
26332
26665
  patch: LoggingSettingsPatchSchema
26333
26666
  });
26334
26667
  /**
@@ -26343,9 +26676,20 @@ var SetLoggingSettingsInputSchema = object({
26343
26676
  var LoggingSettingsStateSchema = object({
26344
26677
  /** The layer this document was read at. `null` = the cluster layer. */
26345
26678
  scopeNodeId: string().nullable(),
26679
+ /** The channel this document was read at. `null` = no component layer. */
26680
+ scopeComponent: string().nullable(),
26346
26681
  effective: LoggingEffectiveSchema,
26347
26682
  explicit: LoggingExplicitSchema,
26348
26683
  activeWindows: array(DiagnosticWindowSchema).readonly(),
26684
+ /**
26685
+ * Every channel the cluster's addons DECLARE, gathered from the
26686
+ * `log-channels` providers. Not stored anywhere: assembled per read, so a
26687
+ * channel added by a redeployed addon appears without anybody editing a
26688
+ * list, and a channel whose addon is gone stops being offered.
26689
+ */
26690
+ channels: array(LogChannelDescriptorSchema).readonly(),
26691
+ /** The channels ARMED right now, each with its deadline. */
26692
+ activeChannels: array(LogChannelWindowStateSchema).readonly(),
26349
26693
  persisted: boolean()
26350
26694
  });
26351
26695
  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(), {
@@ -27922,6 +28266,12 @@ Object.freeze({
27922
28266
  addonId: null,
27923
28267
  access: "view"
27924
28268
  },
28269
+ "dataStoreProvider.aggregate": {
28270
+ capName: "data-store-provider",
28271
+ capScope: "system",
28272
+ addonId: null,
28273
+ access: "view"
28274
+ },
27925
28275
  "dataStoreProvider.count": {
27926
28276
  capName: "data-store-provider",
27927
28277
  capScope: "system",
@@ -28336,6 +28686,12 @@ Object.freeze({
28336
28686
  addonId: null,
28337
28687
  access: "view"
28338
28688
  },
28689
+ "deviceManager.getChildrenBatch": {
28690
+ capName: "device-manager",
28691
+ capScope: "system",
28692
+ addonId: null,
28693
+ access: "view"
28694
+ },
28339
28695
  "deviceManager.getConfigSchema": {
28340
28696
  capName: "device-manager",
28341
28697
  capScope: "system",
@@ -29386,6 +29742,18 @@ Object.freeze({
29386
29742
  addonId: null,
29387
29743
  access: "create"
29388
29744
  },
29745
+ "logChannels.apply": {
29746
+ capName: "log-channels",
29747
+ capScope: "system",
29748
+ addonId: null,
29749
+ access: "create"
29750
+ },
29751
+ "logChannels.list": {
29752
+ capName: "log-channels",
29753
+ capScope: "system",
29754
+ addonId: null,
29755
+ access: "view"
29756
+ },
29389
29757
  "logDestination.query": {
29390
29758
  capName: "log-destination",
29391
29759
  capScope: "system",
@@ -31540,6 +31908,12 @@ Object.freeze({
31540
31908
  addonId: null,
31541
31909
  access: "create"
31542
31910
  },
31911
+ "settingsStore.aggregate": {
31912
+ capName: "settings-store",
31913
+ capScope: "system",
31914
+ addonId: null,
31915
+ access: "view"
31916
+ },
31543
31917
  "settingsStore.count": {
31544
31918
  capName: "settings-store",
31545
31919
  capScope: "system",
@@ -33119,6 +33493,11 @@ Object.freeze({
33119
33493
  form: "single",
33120
33494
  optional: false
33121
33495
  }],
33496
+ "deviceManager.getChildrenBatch": [{
33497
+ name: "parentDeviceIds",
33498
+ form: "array",
33499
+ optional: false
33500
+ }],
33122
33501
  "deviceManager.getConfigSchema": [{
33123
33502
  name: "deviceId",
33124
33503
  form: "single",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-smtp-nodemailer",
3
- "version": "1.2.31",
3
+ "version": "1.2.33",
4
4
  "description": "SMTP email provider addon for CamStack — wraps `nodemailer` and registers a `smtp-provider` cap collection entry. Used by magic-link login + notifier addons.",
5
5
  "keywords": [
6
6
  "camstack",