@camstack/addon-auth 1.2.35 → 1.2.37

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.
@@ -7582,6 +7582,111 @@ var CameraSwitchGroupSchema = object({
7582
7582
  fetchedAt: number()
7583
7583
  });
7584
7584
  /**
7585
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
7586
+ * an addon declares its channels in.
7587
+ *
7588
+ * ## Two axes, deliberately separated
7589
+ *
7590
+ * - **DECLARATION** — which channels exist. Only the addon knows:
7591
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
7592
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
7593
+ * and rots silently. So a channel is declared where it is consulted, and the
7594
+ * `log-channels` capability enumerates the declarations.
7595
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
7596
+ * thing: the logging settings document on the `system` cap. Two authorities
7597
+ * over the values is the exact defect
7598
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
7599
+ * remove; re-introducing it from the cure side would be grotesque.
7600
+ *
7601
+ * Nothing in this file reads a clock, an env var or a store. The registry is
7602
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
7603
+ * the hot path with a value somebody actually read, and by
7604
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
7605
+ * never reaches here, so it can neither disarm an armed channel nor arm a
7606
+ * disarmed one (D49).
7607
+ *
7608
+ * ## The canonical call shape
7609
+ *
7610
+ * ```ts
7611
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
7612
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
7613
+ * }
7614
+ * ```
7615
+ *
7616
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
7617
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
7618
+ * object literal is never constructed because it lives inside the branch. It
7619
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
7620
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
7621
+ * destination floor (measured at 1.93 ns/call when off).
7622
+ *
7623
+ * ## Why a channel emits at `info`
7624
+ *
7625
+ * `loki-logging.addon.ts` pins the destination default at `info` and
7626
+ * `loki-destination.ts` drops everything below it, so a line emitted at
7627
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
7628
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
7629
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
7630
+ * emits at the channel's declared level, whose schema floor is `info`.
7631
+ */
7632
+ /**
7633
+ * The level a channel writes at once armed.
7634
+ *
7635
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
7636
+ * not leave the process for Loki, and the whole point of arming a channel is
7637
+ * to read it later.
7638
+ */
7639
+ var LogChannelLevelSchema = _enum([
7640
+ "info",
7641
+ "warn",
7642
+ "error"
7643
+ ]);
7644
+ /**
7645
+ * What an addon declares about one channel. No value, no state — a
7646
+ * declaration is inert.
7647
+ */
7648
+ var LogChannelDescriptorSchema = object({
7649
+ /**
7650
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
7651
+ * the addon's short name so an operator reading a channel list can tell who
7652
+ * owns it without a second lookup.
7653
+ */
7654
+ name: string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
7655
+ /** One sentence: what the operator will SEE after arming it. */
7656
+ description: string().min(1),
7657
+ /** The level its lines are emitted at. Never below `info`. */
7658
+ defaultLevel: LogChannelLevelSchema,
7659
+ /**
7660
+ * Whether this channel can be narrowed to a camera.
7661
+ *
7662
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
7663
+ * consulted with the numeric device id, AND every line the channel admits
7664
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
7665
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
7666
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
7667
+ * the body is the only way to filter.
7668
+ *
7669
+ * A channel whose lines carry the device only in `meta` (or not at all) is
7670
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
7671
+ * the operator narrows to one camera, sees nothing, and concludes the code
7672
+ * path was never taken.
7673
+ */
7674
+ perDevice: boolean()
7675
+ });
7676
+ /**
7677
+ * An armed window over one channel, as the document hands it to a mirror.
7678
+ *
7679
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
7680
+ * expires by itself, which is the one failure a boolean cannot avoid.
7681
+ */
7682
+ var LogChannelWindowSchema = object({
7683
+ channel: string().min(1),
7684
+ /** Epoch ms the window closes at. */
7685
+ armedUntilMs: number(),
7686
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
7687
+ deviceIds: array(number().int()).readonly().nullable()
7688
+ });
7689
+ /**
7585
7690
  * Ops-log — the durable, append-only operations audit shared by the
7586
7691
  * recordings and events management surfaces.
7587
7692
  *
@@ -11151,6 +11256,35 @@ var MutationFilterSchema = object({
11151
11256
  whereBetween: record(string(), tuple([unknown(), unknown()])).optional(),
11152
11257
  whereNot: record(string(), unknown()).optional()
11153
11258
  });
11259
+ /**
11260
+ * One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
11261
+ *
11262
+ * `as` names the slot in the result, so the SAME column may be asked twice with
11263
+ * two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
11264
+ * a `Record<column, op>` shape could not express.
11265
+ */
11266
+ var AggregateFieldSchema = object({
11267
+ /** Result key. */
11268
+ as: string().min(1),
11269
+ /** Column to aggregate. Must be a real column of a declared collection. */
11270
+ field: string().min(1),
11271
+ op: _enum([
11272
+ "sum",
11273
+ "min",
11274
+ "max"
11275
+ ])
11276
+ });
11277
+ /**
11278
+ * `COUNT(*)` plus one number per requested field.
11279
+ *
11280
+ * `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
11281
+ * that really is 0 are different facts, and an accounting caller that renders
11282
+ * "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
11283
+ */
11284
+ var AggregateResultSchema = object({
11285
+ count: number().int(),
11286
+ values: record(string(), number().nullable())
11287
+ });
11154
11288
  /** A single stored record: `{ id, data }`. */
11155
11289
  var SettingsRecordSchema = object({
11156
11290
  id: string(),
@@ -11235,6 +11369,11 @@ method(object({
11235
11369
  collection: string(),
11236
11370
  filter: QueryFilterSchema.optional()
11237
11371
  }), number()), method(object({
11372
+ namespace: string().optional(),
11373
+ collection: string(),
11374
+ fields: array(AggregateFieldSchema).readonly(),
11375
+ filter: QueryFilterSchema.optional()
11376
+ }), AggregateResultSchema), method(object({
11238
11377
  namespace: string().optional(),
11239
11378
  collection: string(),
11240
11379
  field: string(),
@@ -11351,6 +11490,11 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11351
11490
  collection: string(),
11352
11491
  filter: QueryFilterSchema.optional()
11353
11492
  }), number(), { auth: "admin" }), method(object({
11493
+ namespace: string().optional(),
11494
+ collection: string(),
11495
+ fields: array(AggregateFieldSchema).readonly(),
11496
+ filter: QueryFilterSchema.optional()
11497
+ }), AggregateResultSchema, { auth: "admin" }), method(object({
11354
11498
  namespace: string().optional(),
11355
11499
  collection: string(),
11356
11500
  field: string(),
@@ -11912,24 +12056,6 @@ method(_void(), _void(), { kind: "mutation" }), method(_void(), _void(), { kind:
11912
12056
  kind: "mutation",
11913
12057
  auth: "admin"
11914
12058
  });
11915
- /**
11916
- * Device Manager capability — hub-side singleton that unifies device persistence,
11917
- * live registry access, and all management operations into a single tRPC surface.
11918
- *
11919
- * Replaces:
11920
- * - `device-persistence` capability (persistence methods absorbed here)
11921
- * - `device-management.router.ts` (deleted in Phase 2)
11922
- * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
11923
- *
11924
- * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
11925
- * fork into separate processes but never run on remote cluster agents. Therefore:
11926
- * - No nodeId routing needed — this is a pure hub singleton.
11927
- * - The hub's DeviceRegistry is the single source of truth for all live devices.
11928
- * - No shadow registry or cross-node aggregation required.
11929
- *
11930
- * Forked workers register devices back to the hub via `ctx.devices`
11931
- * (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
11932
- */
11933
12059
  /** One child-placement directive on a container's `childLayout`. Structurally
11934
12060
  * identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
11935
12061
  * shape for the same field. The child is identified by its re-sync-stable
@@ -12298,7 +12424,7 @@ method(object({
12298
12424
  * it answers today and the caller filters as it already does.
12299
12425
  */
12300
12426
  deviceIds: array(number()).optional()
12301
- }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), DeviceInfoSchema.nullable()), method(object({ parentDeviceId: number() }), array(DeviceInfoSchema)), method(object({ deviceId: number() }), object({
12427
+ }), 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({
12302
12428
  mode: LinkedDevicesModeSchema,
12303
12429
  devices: array(LinkedDeviceSchema)
12304
12430
  })), 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({
@@ -13022,6 +13148,59 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
13022
13148
  kind: "mutation",
13023
13149
  auth: "admin"
13024
13150
  });
13151
+ /**
13152
+ * `log-channels` — the capability an addon DECLARES its diagnostic channels
13153
+ * through. It stores nothing.
13154
+ *
13155
+ * ## Why a capability at all, and why this shape
13156
+ *
13157
+ * Which channels exist is knowledge only the addon has: `stream-broker` knows
13158
+ * webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
13159
+ * maintained by hand rots at the first addition and rots INVISIBLY — nothing
13160
+ * fails, an operator just never sees the channel somebody added. So the list
13161
+ * is assembled from declarations at runtime.
13162
+ *
13163
+ * The shape is copied from `log-destination.cap.ts`, which already does
13164
+ * exactly this job: `mode: 'collection'`, `internal: true`,
13165
+ * `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
13166
+ * `addons.listCapabilityProviders` still enumerates it, and the hub's
13167
+ * `CapabilityRegistry` still holds an RPC proxy per provider so a forked
13168
+ * runner's declarations reach hub-main over the transport that already exists.
13169
+ * No new UDS message, no second registry.
13170
+ *
13171
+ * ## What it deliberately does NOT own
13172
+ *
13173
+ * The VALUES — which channel is armed, for which cameras, until when — live in
13174
+ * ONE place: the logging settings document on the `system` cap
13175
+ * (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
13176
+ * value is the defect the plan behind this work exists to remove, and
13177
+ * `setRequestCensus` was retired (D245) rather than allowed to be a second
13178
+ * one. {@link logChannelsCapability} therefore has no getter for a level, no
13179
+ * setter for a window and no persistence of any kind.
13180
+ *
13181
+ * ## Why `apply` is here even so
13182
+ *
13183
+ * The gate lives in the addon's PROCESS; the document lives in hub-main. Some
13184
+ * seam has to carry the value from the authority to the mirror, and a channel
13185
+ * that cannot be reached is precisely the dead knob this whole slice exists to
13186
+ * make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
13187
+ * `apply` is that seam and nothing more: it writes an in-memory mirror, it
13188
+ * persists nothing, it is never the source of a value, and it is called only
13189
+ * with a set the hub actually read (D49 — a read that fails does not call it
13190
+ * at all, so no channel is silently disarmed by a bad read).
13191
+ */
13192
+ /** What `apply` reports back — enough to log, not enough to be a second state. */
13193
+ var LogChannelApplyResultSchema = object({
13194
+ /** How many declared channels are armed in this process after the call. */
13195
+ armed: number().int().min(0),
13196
+ /**
13197
+ * Names the document armed that this process does not declare. Reported
13198
+ * rather than swallowed: a name here is either a typo or an addon that has
13199
+ * not booted, and both deserve a line instead of silence.
13200
+ */
13201
+ unknown: array(string()).readonly()
13202
+ });
13203
+ method(_void(), array(LogChannelDescriptorSchema).readonly()), method(object({ windows: array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" });
13025
13204
  var LogLevelSchema = _enum([
13026
13205
  "debug",
13027
13206
  "info",
@@ -26320,17 +26499,60 @@ var SetSiteLocationInputSchema = object({
26320
26499
  longitude: number().min(-180).max(180)
26321
26500
  }).nullable();
26322
26501
  /**
26323
- * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
26502
+ * The TRANSPORT a call arrived on.
26503
+ *
26504
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
26505
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
26506
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
26507
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
26508
+ * checkable rather than asserted.
26509
+ *
26510
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
26511
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
26512
+ * connection; the viewer talks to the hub over `wsLink`
26513
+ * exclusively, so this is the plane the HTTP census could not see.
26514
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
26515
+ * never touches a socket and therefore never touched a census.
26516
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
26517
+ * that is exactly what its `0` asserts: every plane the hub has can name
26518
+ * itself. It is an output bucket, never a knob — a call that arrives on a
26519
+ * plane nobody instrumented lands here instead of vanishing from the total.
26520
+ */
26521
+ var TransportPlaneSchema = _enum([
26522
+ "http",
26523
+ "ws",
26524
+ "mesh",
26525
+ "unknown"
26526
+ ]);
26527
+ /**
26528
+ * Calls per plane. Every key is always present, `0` included — an absent plane
26529
+ * reads as "not instrumented", which is the one thing this census must never
26530
+ * make an operator wonder about.
26531
+ */
26532
+ var TransportPlaneCountsSchema = object({
26533
+ http: number(),
26534
+ ws: number(),
26535
+ mesh: number(),
26536
+ unknown: number()
26537
+ });
26538
+ /**
26539
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
26324
26540
  * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
26325
26541
  * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
26326
26542
  * already prints - never a token, never an `Authorization` header.
26543
+ *
26544
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
26545
+ * and lives for hours, so folding it into a call count makes one long-lived
26546
+ * stream look like a storm.
26327
26547
  */
26328
26548
  var RequestCensusGroupSchema = object({
26549
+ plane: TransportPlaneSchema,
26329
26550
  procedure: string(),
26330
26551
  userAgent: string(),
26331
26552
  ip: string(),
26332
26553
  principal: string(),
26333
26554
  calls: number(),
26555
+ subscriptions: number(),
26334
26556
  perMin: number()
26335
26557
  });
26336
26558
  /**
@@ -26343,6 +26565,14 @@ var RequestCensusGroupSchema = object({
26343
26565
  var RequestCensusProcedureSchema = object({
26344
26566
  procedure: string(),
26345
26567
  calls: number(),
26568
+ /**
26569
+ * The same total, split by transport. THIS is the row that answers the
26570
+ * question the census exists for: one look at `deviceManager.listAll` says
26571
+ * which plane carried the 4 960, without joining two log lines by eye.
26572
+ */
26573
+ planes: TransportPlaneCountsSchema,
26574
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
26575
+ subscriptions: number(),
26346
26576
  perMin: number()
26347
26577
  });
26348
26578
  /**
@@ -26370,14 +26600,45 @@ var RequestCensusStatusSchema = object({
26370
26600
  */
26371
26601
  procedureCalls: number(),
26372
26602
  /**
26603
+ * `procedureCalls` split by transport. The four keys sum to
26604
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
26605
+ * `planesExplainTotal` is that identity, checked rather than assumed.
26606
+ */
26607
+ planes: TransportPlaneCountsSchema,
26608
+ /**
26609
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
26610
+ * on no plane at all - which is a RESULT (a plane is missing from the
26611
+ * instrument), not a failure, and it has to be visible to be read as one.
26612
+ */
26613
+ planesExplainTotal: boolean(),
26614
+ /**
26373
26615
  * tRPC WebSocket connections opened during the window. NOT calls - the WS
26374
- * transport resolves one context per connection - but the number that says
26375
- * whether a plane this census cannot see was busy while HTTP was quiet.
26616
+ * adapter resolves one context per connection - kept because a plane's call
26617
+ * count of zero against 37 open connections says something different from a
26618
+ * plane with no connections at all.
26376
26619
  */
26377
26620
  wsConnections: number(),
26621
+ /**
26622
+ * Client frames the WS plane looked at. `wsMessages` far above
26623
+ * `planes.ws + subscriptions` means most traffic is not operations
26624
+ * (keepalives, connection params) - which is itself an answer.
26625
+ */
26626
+ wsMessages: number(),
26627
+ /**
26628
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
26629
+ * purpose: one live-events stream opened at boot and held for six hours is
26630
+ * one subscription, and counting it as a call would let a quiet plane
26631
+ * masquerade as the storm.
26632
+ */
26633
+ subscriptions: number(),
26634
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
26635
+ subscriptionStops: number(),
26378
26636
  distinctGroups: number(),
26379
- /** Calls counted in the totals whose group attribution was shed at the
26380
- * cardinality bound. */
26637
+ /**
26638
+ * Operations counted in the totals whose CALLER attribution was shed at the
26639
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
26640
+ * which transport they arrived on, they just lost their group row.
26641
+ */
26381
26642
  unattributedCalls: number(),
26382
26643
  procedures: array(RequestCensusProcedureSchema).readonly(),
26383
26644
  groups: array(RequestCensusGroupSchema).readonly()
@@ -26400,10 +26661,11 @@ var DiagnosticIdSchema = _enum(["request-census"]);
26400
26661
  * The layers of the level hierarchy, general → specific. The most specific
26401
26662
  * layer that carries an explicit value wins.
26402
26663
  *
26403
- * `component` is DECLARED and not yet resolvable: the per-component channels
26404
- * are a later slice of the same plan, and a `levelSource` enum that has to
26405
- * grow later would force every consumer of this document to change with it.
26406
- * Nothing returns `component` today.
26664
+ * `component` became RESOLVABLE on 2026-08-27: a component is a declared log
26665
+ * CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
26666
+ * `scopeComponent`. It was declared-but-dark in the first slice precisely so
26667
+ * that turning it on would not force every consumer of this document to widen
26668
+ * a `levelSource` enum — which is what has now not happened.
26407
26669
  */
26408
26670
  var LoggingScopeKindSchema = _enum([
26409
26671
  "cluster",
@@ -26430,6 +26692,14 @@ var LoggingLevelLayerSchema = object({
26430
26692
  scope: LoggingScopeKindSchema,
26431
26693
  /** The node this layer speaks for; `null` on the cluster layer. */
26432
26694
  nodeId: string().nullable(),
26695
+ /**
26696
+ * The declared channel this layer speaks for; `null` on every layer but
26697
+ * `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
26698
+ * by design — the convention this repo settled on is one orchestrator-wide
26699
+ * setting, never per node (D52) — so a component layer that carried a node
26700
+ * would invite a per-node copy of a value that has no per-node meaning.
26701
+ */
26702
+ component: string().nullable(),
26433
26703
  /** Explicitly set here, or `null` when this layer inherits. */
26434
26704
  level: LogLevelSchema$1.nullable()
26435
26705
  });
@@ -26471,6 +26741,49 @@ var DiagnosticWindowPatchSchema = object({
26471
26741
  reportEveryMs: number().int().positive().optional()
26472
26742
  });
26473
26743
  /**
26744
+ * A channel ARMED, as the document reports it.
26745
+ *
26746
+ * `armMs` is not echoed back: what an operator needs to see is the deadline
26747
+ * and the time left, because a diagnostic left running is itself an incident
26748
+ * and "armed for 10 minutes" said an hour ago is not an answer.
26749
+ */
26750
+ var LogChannelWindowStateSchema = object({
26751
+ channel: string(),
26752
+ armed: boolean(),
26753
+ /** Epoch ms the window closes at. 0 when disarmed. */
26754
+ armedUntilMs: number(),
26755
+ /** Ms left before it expires on its own. 0 when disarmed. */
26756
+ remainingMs: number(),
26757
+ /**
26758
+ * The cameras it is narrowed to, or `null` for every camera.
26759
+ *
26760
+ * A channel declared `perDevice: false` can only ever report `null` here:
26761
+ * its lines do not carry `tags: { deviceId }`, so narrowing them would
26762
+ * produce a filter that silently matches nothing. The server REFUSES such a
26763
+ * patch rather than quietly widening it — ignoring the request would teach
26764
+ * the operator that per-camera filtering works on that channel when it does
26765
+ * not.
26766
+ */
26767
+ deviceIds: array(number().int()).readonly().nullable()
26768
+ });
26769
+ /**
26770
+ * `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
26771
+ * for the same reason: a channel is a window with a deadline, never a switch.
26772
+ */
26773
+ var LogChannelWindowPatchSchema = object({
26774
+ channel: string().min(1),
26775
+ armMs: number().int().min(0),
26776
+ /**
26777
+ * Narrow to these numeric device ids. Absent or `null` = every camera.
26778
+ *
26779
+ * Numeric because the repo's own rule makes it possible: every log line
26780
+ * about a device carries `tags: { deviceId }` with the numeric id. That rule
26781
+ * was paid for with a 22% thumbnail gap and a 3-hour media blackout both
26782
+ * diagnosed by hand, and this is the first thing that collects on it.
26783
+ */
26784
+ deviceIds: array(number().int()).readonly().nullable().optional()
26785
+ });
26786
+ /**
26474
26787
  * A PATCH, and patches MERGE.
26475
26788
  *
26476
26789
  * A field absent from the patch is left exactly as it was — arming a
@@ -26489,7 +26802,14 @@ var LoggingSettingsPatchSchema = object({
26489
26802
  * Only the diagnostics NAMED here change. An armed window that is not listed
26490
26803
  * keeps running — a patch is never a full replacement.
26491
26804
  */
26492
- diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional()
26805
+ diagnostics: array(DiagnosticWindowPatchSchema).readonly().optional(),
26806
+ /**
26807
+ * Only the channels NAMED here change. An armed channel that is not listed
26808
+ * keeps running — same rule as `diagnostics`, because a patch that silently
26809
+ * disarmed the channels it did not mention would make the Levels page and
26810
+ * the Diagnostics page fight over the same value.
26811
+ */
26812
+ channels: array(LogChannelWindowPatchSchema).readonly().optional()
26493
26813
  });
26494
26814
  /**
26495
26815
  * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
@@ -26502,9 +26822,22 @@ var LoggingSettingsPatchSchema = object({
26502
26822
  * authority over the whole hierarchy and answers for every layer, so the
26503
26823
  * layer selector needs a name the transport does not already own.
26504
26824
  */
26505
- var GetLoggingSettingsInputSchema = object({ scopeNodeId: string().optional() });
26825
+ var GetLoggingSettingsInputSchema = object({
26826
+ scopeNodeId: string().optional(),
26827
+ /**
26828
+ * The declared CHANNEL this document is addressed at, when the caller wants
26829
+ * the `component` layer. Absent = the node/cluster hierarchy only.
26830
+ *
26831
+ * Naming it separately rather than overloading `scopeNodeId` keeps the two
26832
+ * axes from collapsing: a component level is cluster-wide, a node level is
26833
+ * not, and one selector for both would make "which of these two did I just
26834
+ * set" unanswerable — the exact ambiguity `explicit` exists to remove.
26835
+ */
26836
+ scopeComponent: string().optional()
26837
+ });
26506
26838
  var SetLoggingSettingsInputSchema = object({
26507
26839
  scopeNodeId: string().optional(),
26840
+ scopeComponent: string().optional(),
26508
26841
  patch: LoggingSettingsPatchSchema
26509
26842
  });
26510
26843
  /**
@@ -26519,9 +26852,20 @@ var SetLoggingSettingsInputSchema = object({
26519
26852
  var LoggingSettingsStateSchema = object({
26520
26853
  /** The layer this document was read at. `null` = the cluster layer. */
26521
26854
  scopeNodeId: string().nullable(),
26855
+ /** The channel this document was read at. `null` = no component layer. */
26856
+ scopeComponent: string().nullable(),
26522
26857
  effective: LoggingEffectiveSchema,
26523
26858
  explicit: LoggingExplicitSchema,
26524
26859
  activeWindows: array(DiagnosticWindowSchema).readonly(),
26860
+ /**
26861
+ * Every channel the cluster's addons DECLARE, gathered from the
26862
+ * `log-channels` providers. Not stored anywhere: assembled per read, so a
26863
+ * channel added by a redeployed addon appears without anybody editing a
26864
+ * list, and a channel whose addon is gone stops being offered.
26865
+ */
26866
+ channels: array(LogChannelDescriptorSchema).readonly(),
26867
+ /** The channels ARMED right now, each with its deadline. */
26868
+ activeChannels: array(LogChannelWindowStateSchema).readonly(),
26525
26869
  persisted: boolean()
26526
26870
  });
26527
26871
  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(), {
@@ -28098,6 +28442,12 @@ Object.freeze({
28098
28442
  addonId: null,
28099
28443
  access: "view"
28100
28444
  },
28445
+ "dataStoreProvider.aggregate": {
28446
+ capName: "data-store-provider",
28447
+ capScope: "system",
28448
+ addonId: null,
28449
+ access: "view"
28450
+ },
28101
28451
  "dataStoreProvider.count": {
28102
28452
  capName: "data-store-provider",
28103
28453
  capScope: "system",
@@ -28512,6 +28862,12 @@ Object.freeze({
28512
28862
  addonId: null,
28513
28863
  access: "view"
28514
28864
  },
28865
+ "deviceManager.getChildrenBatch": {
28866
+ capName: "device-manager",
28867
+ capScope: "system",
28868
+ addonId: null,
28869
+ access: "view"
28870
+ },
28515
28871
  "deviceManager.getConfigSchema": {
28516
28872
  capName: "device-manager",
28517
28873
  capScope: "system",
@@ -29562,6 +29918,18 @@ Object.freeze({
29562
29918
  addonId: null,
29563
29919
  access: "create"
29564
29920
  },
29921
+ "logChannels.apply": {
29922
+ capName: "log-channels",
29923
+ capScope: "system",
29924
+ addonId: null,
29925
+ access: "create"
29926
+ },
29927
+ "logChannels.list": {
29928
+ capName: "log-channels",
29929
+ capScope: "system",
29930
+ addonId: null,
29931
+ access: "view"
29932
+ },
29565
29933
  "logDestination.query": {
29566
29934
  capName: "log-destination",
29567
29935
  capScope: "system",
@@ -31716,6 +32084,12 @@ Object.freeze({
31716
32084
  addonId: null,
31717
32085
  access: "create"
31718
32086
  },
32087
+ "settingsStore.aggregate": {
32088
+ capName: "settings-store",
32089
+ capScope: "system",
32090
+ addonId: null,
32091
+ access: "view"
32092
+ },
31719
32093
  "settingsStore.count": {
31720
32094
  capName: "settings-store",
31721
32095
  capScope: "system",
@@ -33295,6 +33669,11 @@ Object.freeze({
33295
33669
  form: "single",
33296
33670
  optional: false
33297
33671
  }],
33672
+ "deviceManager.getChildrenBatch": [{
33673
+ name: "parentDeviceIds",
33674
+ form: "array",
33675
+ optional: false
33676
+ }],
33298
33677
  "deviceManager.getConfigSchema": [{
33299
33678
  name: "deviceId",
33300
33679
  form: "single",