@camstack/types 1.2.113 → 1.2.115

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1368,6 +1368,378 @@ function logLevelAtMost(level, threshold) {
1368
1368
  return LOG_LEVEL_RANK[level] <= LOG_LEVEL_RANK[threshold];
1369
1369
  }
1370
1370
  //#endregion
1371
+ //#region src/logging/log-channel.ts
1372
+ /**
1373
+ * Per-component log CHANNELS — the gate a hot path consults, and the registry
1374
+ * an addon declares its channels in.
1375
+ *
1376
+ * ## Two axes, deliberately separated
1377
+ *
1378
+ * - **DECLARATION** — which channels exist. Only the addon knows:
1379
+ * `stream-broker` knows webrtc/ICE/RTP, `provider-reolink` knows
1380
+ * baichuan/handshake. A hand-wired central list rots at the first addition,
1381
+ * and rots silently. So a channel is declared where it is consulted, and the
1382
+ * `log-channels` capability enumerates the declarations.
1383
+ * - **VALUE** — at which level, for which scope, until when. That stays ONE
1384
+ * thing: the logging settings document on the `system` cap. Two authorities
1385
+ * over the values is the exact defect
1386
+ * `docs/design/plans/2026-08-26-logging-per-componente.md` was written to
1387
+ * remove; re-introducing it from the cure side would be grotesque.
1388
+ *
1389
+ * Nothing in this file reads a clock, an env var or a store. The registry is
1390
+ * a MIRROR: it is moved only by {@link LogChannelRegistry.apply}, called off
1391
+ * the hot path with a value somebody actually read, and by
1392
+ * {@link LogChannelRegistry.tick}, called on a timer. A store read that fails
1393
+ * never reaches here, so it can neither disarm an armed channel nor arm a
1394
+ * disarmed one (D49).
1395
+ *
1396
+ * ## The canonical call shape
1397
+ *
1398
+ * ```ts
1399
+ * if (CH_RTP.on && CH_RTP.wants(deviceId)) {
1400
+ * CH_RTP.log(logger, 'rtp subscriber added', { tags: { deviceId }, meta: { ssrc } })
1401
+ * }
1402
+ * ```
1403
+ *
1404
+ * `on` is a plain boolean FIELD — never a getter — and it is the FIRST thing
1405
+ * read. Disarmed, a call site costs one load and one branch, and the `extras`
1406
+ * object literal is never constructed because it lives inside the branch. It
1407
+ * is the same shape already proven in production at `stream-broker.ts:1650`,
1408
+ * and the same discipline `LoggingGate.allowsDestination` uses for the
1409
+ * destination floor (measured at 1.93 ns/call when off).
1410
+ *
1411
+ * ## Why a channel emits at `info`
1412
+ *
1413
+ * `loki-logging.addon.ts` pins the destination default at `info` and
1414
+ * `loki-destination.ts` drops everything below it, so a line emitted at
1415
+ * `debug` never reaches Loki and the hub's in-memory ring only holds ~35
1416
+ * minutes. A diagnostic that cannot be read an hour later is worse than no
1417
+ * diagnostic, because it looks done. {@link LogChannelGate.log} therefore
1418
+ * emits at the channel's declared level, whose schema floor is `info`.
1419
+ */
1420
+ /**
1421
+ * The level a channel writes at once armed.
1422
+ *
1423
+ * `debug` is absent ON PURPOSE and not by omission: below `info` the line does
1424
+ * not leave the process for Loki, and the whole point of arming a channel is
1425
+ * to read it later.
1426
+ */
1427
+ var LogChannelLevelSchema = zod.z.enum([
1428
+ "info",
1429
+ "warn",
1430
+ "error"
1431
+ ]);
1432
+ /**
1433
+ * What an addon declares about one channel. No value, no state — a
1434
+ * declaration is inert.
1435
+ */
1436
+ var LogChannelDescriptorSchema = zod.z.object({
1437
+ /**
1438
+ * Dotted `area.thing`, unique across the workspace. `area` is conventionally
1439
+ * the addon's short name so an operator reading a channel list can tell who
1440
+ * owns it without a second lookup.
1441
+ */
1442
+ name: zod.z.string().min(3).regex(/^[a-z0-9-]+(\.[a-z0-9-]+)+$/, "a channel name is dotted lower-kebab, e.g. area.thing"),
1443
+ /** One sentence: what the operator will SEE after arming it. */
1444
+ description: zod.z.string().min(1),
1445
+ /** The level its lines are emitted at. Never below `info`. */
1446
+ defaultLevel: LogChannelLevelSchema,
1447
+ /**
1448
+ * Whether this channel can be narrowed to a camera.
1449
+ *
1450
+ * `true` is a PROMISE with two halves, and both must hold: the gate is
1451
+ * consulted with the numeric device id, AND every line the channel admits
1452
+ * carries `tags: { deviceId }` with that same numeric id. The second half is
1453
+ * what makes `| json | deviceId="617"` work in Loki — `loki-payload.ts`
1454
+ * keeps `deviceId` out of the stream labels for cardinality, so the tag in
1455
+ * the body is the only way to filter.
1456
+ *
1457
+ * A channel whose lines carry the device only in `meta` (or not at all) is
1458
+ * declared `false`. Declaring it `true` anyway would be a lie the UI repeats:
1459
+ * the operator narrows to one camera, sees nothing, and concludes the code
1460
+ * path was never taken.
1461
+ */
1462
+ perDevice: zod.z.boolean()
1463
+ });
1464
+ /**
1465
+ * An armed window over one channel, as the document hands it to a mirror.
1466
+ *
1467
+ * A window is a DEADLINE, never a flag (ADR-0244): a channel somebody forgot
1468
+ * expires by itself, which is the one failure a boolean cannot avoid.
1469
+ */
1470
+ var LogChannelWindowSchema = zod.z.object({
1471
+ channel: zod.z.string().min(1),
1472
+ /** Epoch ms the window closes at. */
1473
+ armedUntilMs: zod.z.number(),
1474
+ /** `null` = every camera. A non-empty list narrows to those numeric ids. */
1475
+ deviceIds: zod.z.array(zod.z.number().int()).readonly().nullable()
1476
+ });
1477
+ /**
1478
+ * The gate a hot path holds.
1479
+ *
1480
+ * Obtain it ONCE — at module scope or in a constructor — and keep the
1481
+ * reference. Looking a channel up by name per line would put a Map lookup on
1482
+ * the path this class exists to keep free.
1483
+ */
1484
+ var LogChannelGate = class {
1485
+ descriptor;
1486
+ /**
1487
+ * HOT PATH GUARD. A plain data FIELD, and it must stay one.
1488
+ *
1489
+ * `log-channel.spec.ts` asserts the property descriptor has no getter and
1490
+ * booby-traps the device set, so turning this into an accessor — or reading
1491
+ * anything before it — fails the spec instead of taxing every line the
1492
+ * process emits.
1493
+ */
1494
+ on = false;
1495
+ /** `null` while armed for every camera. Never read while `on` is false. */
1496
+ devices = null;
1497
+ level;
1498
+ closesAtMs = 0;
1499
+ constructor(descriptor) {
1500
+ this.descriptor = descriptor;
1501
+ this.level = descriptor.defaultLevel;
1502
+ }
1503
+ /** Epoch ms this channel disarms itself at. 0 when disarmed. */
1504
+ get armedUntilMs() {
1505
+ return this.on ? this.closesAtMs : 0;
1506
+ }
1507
+ /**
1508
+ * Does this channel want a line about `deviceId`?
1509
+ *
1510
+ * Call it only behind `gate.on &&`. On its own it is still correct — the
1511
+ * guard is repeated inside — but the point of the prefix is that a disarmed
1512
+ * channel must not pay the call at all.
1513
+ */
1514
+ wants(deviceId) {
1515
+ if (!this.on) return false;
1516
+ return this.devices === null || this.devices.has(deviceId);
1517
+ }
1518
+ /**
1519
+ * Emit one line on this channel, at the channel's declared level.
1520
+ *
1521
+ * The channel name is added as `tags.logChannel` so LogQL can select the
1522
+ * channel without matching on the message text, and whatever `tags` the
1523
+ * caller passed — `deviceId` above all — is preserved.
1524
+ */
1525
+ log(logger, message, extras) {
1526
+ if (!this.on) return;
1527
+ const tags = {
1528
+ ...extras.tags,
1529
+ logChannel: this.descriptor.name
1530
+ };
1531
+ const line = {
1532
+ ...extras,
1533
+ tags
1534
+ };
1535
+ if (this.level === "error") logger.error(message, line);
1536
+ else if (this.level === "warn") logger.warn(message, line);
1537
+ else logger.info(message, line);
1538
+ }
1539
+ /**
1540
+ * Arm (or RE-arm, restarting) this channel. Off the hot path only.
1541
+ *
1542
+ * An empty `deviceIds` list is treated as "every camera" rather than "no
1543
+ * camera": a window that matches nothing is indistinguishable from a
1544
+ * disarmed one, and the operator who asked for it would wait for lines that
1545
+ * can never come.
1546
+ */
1547
+ arm(window) {
1548
+ const ids = window.deviceIds;
1549
+ this.devices = ids === null || ids.length === 0 ? null : new Set(ids);
1550
+ this.closesAtMs = window.armedUntilMs;
1551
+ this.on = true;
1552
+ }
1553
+ /** Disarm. Off the hot path only. */
1554
+ disarm() {
1555
+ this.on = false;
1556
+ this.devices = null;
1557
+ this.closesAtMs = 0;
1558
+ }
1559
+ };
1560
+ /**
1561
+ * Every channel this PROCESS declares, and the mirror of what is armed on it.
1562
+ *
1563
+ * One per process. A forked runner has its own, and it is refreshed through
1564
+ * the `log-channels` capability by the hub that owns the document — the
1565
+ * registry never reaches for a value itself.
1566
+ */
1567
+ var LogChannelRegistry = class {
1568
+ gates = /* @__PURE__ */ new Map();
1569
+ /**
1570
+ * Declare a channel and get its gate.
1571
+ *
1572
+ * A duplicate name throws. Two declarations of one name is a programming
1573
+ * error, not a merge: the operator would arm one and the other would stay
1574
+ * dark, which is the dead-knob shape (D62) with an extra step.
1575
+ */
1576
+ declare(descriptor) {
1577
+ const parsed = LogChannelDescriptorSchema.parse(descriptor);
1578
+ if (this.gates.get(parsed.name) !== void 0) throw new Error(`log channel "${parsed.name}" is already declared in this process — two declarations of one name is a programming error, not a merge`);
1579
+ const gate = new LogChannelGate(parsed);
1580
+ this.gates.set(parsed.name, gate);
1581
+ return gate;
1582
+ }
1583
+ /** The declarations, sorted by name so a list is stable to read and diff. */
1584
+ list() {
1585
+ return [...this.gates.values()].map((gate) => gate.descriptor).sort((a, b) => a.name.localeCompare(b.name));
1586
+ }
1587
+ /** The gate for a declared channel, or `undefined`. */
1588
+ gate(name) {
1589
+ return this.gates.get(name);
1590
+ }
1591
+ /**
1592
+ * Apply the FULL set of armed windows. Off the hot path.
1593
+ *
1594
+ * Full, not incremental, and that is the whole design: the document is the
1595
+ * authority, so a channel the document does not name is disarmed here. An
1596
+ * incremental apply would let a disarm get lost in transit and leave a
1597
+ * channel running that nobody can see is running.
1598
+ *
1599
+ * A window already past its deadline is ignored rather than armed — a
1600
+ * restore that re-armed an expired window would make a forgotten diagnostic
1601
+ * immortal across restarts.
1602
+ *
1603
+ * Returns the names it could not place, so the caller can log them: a
1604
+ * channel named in the document that this process does not declare is
1605
+ * either a typo or an addon that has not booted yet, and both deserve a
1606
+ * line rather than silence.
1607
+ */
1608
+ apply(windows, nowMs) {
1609
+ const wanted = /* @__PURE__ */ new Map();
1610
+ const unknown = [];
1611
+ for (const window of windows) {
1612
+ if (window.armedUntilMs <= nowMs) continue;
1613
+ if (!this.gates.has(window.channel)) {
1614
+ unknown.push(window.channel);
1615
+ continue;
1616
+ }
1617
+ wanted.set(window.channel, window);
1618
+ }
1619
+ for (const [name, gate] of this.gates) {
1620
+ const window = wanted.get(name);
1621
+ if (window === void 0) gate.disarm();
1622
+ else gate.arm(window);
1623
+ }
1624
+ return unknown;
1625
+ }
1626
+ /**
1627
+ * Disarm whatever has run out. Called on a timer, NEVER from a log path — a
1628
+ * diagnostic that adds a `Date.now()` to the path it is measuring measures
1629
+ * itself.
1630
+ *
1631
+ * Returns the names it closed, so the caller can write the one line that
1632
+ * says a window ended and stops "it went quiet" from reading as "the branch
1633
+ * was not taken".
1634
+ */
1635
+ tick(nowMs) {
1636
+ const closed = [];
1637
+ for (const [name, gate] of this.gates) if (gate.on && gate.armedUntilMs <= nowMs) {
1638
+ gate.disarm();
1639
+ closed.push(name);
1640
+ }
1641
+ return closed;
1642
+ }
1643
+ /** The channels armed right now, as the document would describe them. */
1644
+ armed() {
1645
+ const out = [];
1646
+ for (const [name, gate] of this.gates) if (gate.on) out.push({
1647
+ channel: name,
1648
+ armedUntilMs: gate.armedUntilMs,
1649
+ deviceIds: null
1650
+ });
1651
+ return out;
1652
+ }
1653
+ };
1654
+ //#endregion
1655
+ //#region src/logging/log-channel.singleton.ts
1656
+ /**
1657
+ * Process-wide holder for the {@link LogChannelRegistry}.
1658
+ *
1659
+ * Three call sites that never meet need the SAME instance: the hot paths that
1660
+ * declare a gate at module scope, the `log-channels` provider that enumerates
1661
+ * the declarations for the hub, and the same provider applying the windows the
1662
+ * document hands down. A registry built inside any one of them would be
1663
+ * refreshed and collected — the shape of a knob that never does anything.
1664
+ *
1665
+ * Same idiom as `logging-gate.singleton.ts` and
1666
+ * `http-request-census.singleton.ts`.
1667
+ */
1668
+ var instance = null;
1669
+ /** The process-wide log channel registry. Created empty on first use. */
1670
+ function getLogChannelRegistry() {
1671
+ instance ??= new LogChannelRegistry();
1672
+ return instance;
1673
+ }
1674
+ /**
1675
+ * Declare a channel on the process-wide registry and get its gate.
1676
+ *
1677
+ * The one call an addon makes. Keep the returned gate in a module-scope
1678
+ * `const`: looking a channel up by name per line would put a Map lookup on
1679
+ * exactly the path this mechanism exists to keep free.
1680
+ *
1681
+ * `scripts/check-log-channel-gated.ts` reads these call sites. It pairs the
1682
+ * declared name with the binding it is assigned to and refuses to let a
1683
+ * channel ship that no `<binding>.on` anywhere consults — a declared channel
1684
+ * nobody reads is a knob the operator turns with nothing happening, forever,
1685
+ * and without a line. That is D62, and this repo has now shipped it three
1686
+ * times (`audioThresholdDbfs`, the HA entities with no source, the second
1687
+ * per-camera switch that wrote a store nobody read).
1688
+ */
1689
+ function declareLogChannel(descriptor) {
1690
+ return getLogChannelRegistry().declare(descriptor);
1691
+ }
1692
+ /** Test-only: drop the instance so a spec starts from an empty registry. */
1693
+ function __resetLogChannelRegistryForTests() {
1694
+ instance = null;
1695
+ }
1696
+ //#endregion
1697
+ //#region src/logging/log-channel-provider.ts
1698
+ /**
1699
+ * How often expiry is noticed. Coarse on purpose: the cost of a channel
1700
+ * running a few seconds past its deadline is a few extra lines, and the cost
1701
+ * of a tight timer in every addon process is paid forever.
1702
+ */
1703
+ var LOG_CHANNEL_TICK_MS = 5e3;
1704
+ /**
1705
+ * Build the `log-channels` provider for this process.
1706
+ *
1707
+ * `logger` is used ONLY off the hot path — for the arm/expiry lines — so a
1708
+ * channel that is never armed costs this module nothing but a timer.
1709
+ */
1710
+ function createLogChannelsProvider(logger, options = {}) {
1711
+ const registry = getLogChannelRegistry();
1712
+ const now = options.now ?? Date.now;
1713
+ const tickMs = options.tickMs ?? 5e3;
1714
+ const timer = setInterval(() => {
1715
+ const closed = registry.tick(now());
1716
+ for (const name of closed) logger.info("log channel window closed", {
1717
+ tags: { logChannel: name },
1718
+ meta: { channel: name }
1719
+ });
1720
+ }, tickMs);
1721
+ timer.unref?.();
1722
+ return {
1723
+ list: () => registry.list(),
1724
+ apply: (input) => {
1725
+ const unknown = registry.apply(input.windows, now());
1726
+ const armed = registry.armed();
1727
+ logger.info("log channels applied", { meta: {
1728
+ armed: armed.map((window) => window.channel),
1729
+ unknown,
1730
+ declared: registry.list().length
1731
+ } });
1732
+ return {
1733
+ armed: armed.length,
1734
+ unknown
1735
+ };
1736
+ },
1737
+ stop: () => {
1738
+ clearInterval(timer);
1739
+ }
1740
+ };
1741
+ }
1742
+ //#endregion
1371
1743
  //#region src/interfaces/ops-log.ts
1372
1744
  /**
1373
1745
  * Ops-log — the durable, append-only operations audit shared by the
@@ -7312,6 +7684,35 @@ var MutationFilterSchema = zod.z.object({
7312
7684
  whereBetween: zod.z.record(zod.z.string(), zod.z.tuple([zod.z.unknown(), zod.z.unknown()])).optional(),
7313
7685
  whereNot: zod.z.record(zod.z.string(), zod.z.unknown()).optional()
7314
7686
  });
7687
+ /**
7688
+ * One scalar an {@link settingsStoreCapability.methods.aggregate} call asks for.
7689
+ *
7690
+ * `as` names the slot in the result, so the SAME column may be asked twice with
7691
+ * two operations (`MIN(startMs)` and `MAX(startMs)` in one round trip) — which
7692
+ * a `Record<column, op>` shape could not express.
7693
+ */
7694
+ var AggregateFieldSchema = zod.z.object({
7695
+ /** Result key. */
7696
+ as: zod.z.string().min(1),
7697
+ /** Column to aggregate. Must be a real column of a declared collection. */
7698
+ field: zod.z.string().min(1),
7699
+ op: zod.z.enum([
7700
+ "sum",
7701
+ "min",
7702
+ "max"
7703
+ ])
7704
+ });
7705
+ /**
7706
+ * `COUNT(*)` plus one number per requested field.
7707
+ *
7708
+ * `null` means NO ROW MATCHED, never zero: a `SUM` over an empty set and a sum
7709
+ * that really is 0 are different facts, and an accounting caller that renders
7710
+ * "0 bytes, oldest = 0" for "nothing here" reports a lie about a disk.
7711
+ */
7712
+ var AggregateResultSchema = zod.z.object({
7713
+ count: zod.z.number().int(),
7714
+ values: zod.z.record(zod.z.string(), zod.z.number().nullable())
7715
+ });
7315
7716
  /** A single stored record: `{ id, data }`. */
7316
7717
  var SettingsRecordSchema = zod.z.object({
7317
7718
  id: zod.z.string(),
@@ -7479,6 +7880,32 @@ var settingsStoreCapability = {
7479
7880
  collection: zod.z.string(),
7480
7881
  filter: QueryFilterSchema.optional()
7481
7882
  }), zod.z.number()),
7883
+ /**
7884
+ * `COUNT(*)` and one `SUM` / `MIN` / `MAX` per requested field, in ONE
7885
+ * statement, over the rows `filter` selects.
7886
+ *
7887
+ * Exists because "how much is there" was being answered by materialising
7888
+ * "what is there". The recorder's storage-pressure sweep asked its in-RAM
7889
+ * footage index for bytes/count/oldest/newest across a set of storage
7890
+ * locations twice a minute, and the only way to answer that from a map is
7891
+ * to visit every row — 7.1 M of them on the live hub, ~15 M row visits a
7892
+ * minute on the main thread, which is also why the whole archive had to
7893
+ * stay resident to be visited. The question is a sum; nothing needs to be
7894
+ * materialised to answer it.
7895
+ *
7896
+ * **The engine REFUSES a field it cannot serve**, exactly as
7897
+ * `query.columns` does and unlike a PREDICATE, which is skipped when
7898
+ * unresolvable. A dropped predicate over-matches and the caller sees extra
7899
+ * rows; a dropped aggregate returns a NUMBER that is wrong and looks
7900
+ * exactly like a real one. That asymmetry is what this repo has already
7901
+ * paid for once in `count`.
7902
+ */
7903
+ aggregate: require_sleep.method(zod.z.object({
7904
+ namespace: zod.z.string().optional(),
7905
+ collection: zod.z.string(),
7906
+ fields: zod.z.array(AggregateFieldSchema).readonly(),
7907
+ filter: QueryFilterSchema.optional()
7908
+ }), AggregateResultSchema),
7482
7909
  /** Grouped counts per ((field-origin)/bucketSize) bucket, filtered. */
7483
7910
  histogram: require_sleep.method(zod.z.object({
7484
7911
  namespace: zod.z.string().optional(),
@@ -7687,6 +8114,15 @@ var dataStoreProviderCapability = {
7687
8114
  collection: zod.z.string(),
7688
8115
  filter: QueryFilterSchema.optional()
7689
8116
  }), zod.z.number(), { auth: "admin" }),
8117
+ /** `COUNT(*)` plus one SUM/MIN/MAX per field, in one statement. Mirror of
8118
+ * `settings-store.aggregate` — see it for why an unresolvable field is
8119
+ * refused rather than dropped. */
8120
+ aggregate: require_sleep.method(zod.z.object({
8121
+ namespace: zod.z.string().optional(),
8122
+ collection: zod.z.string(),
8123
+ fields: zod.z.array(AggregateFieldSchema).readonly(),
8124
+ filter: QueryFilterSchema.optional()
8125
+ }), AggregateResultSchema, { auth: "admin" }),
7690
8126
  /** Grouped counts per ((field-origin)/bucketSize) bucket, filtered. */
7691
8127
  histogram: require_sleep.method(zod.z.object({
7692
8128
  namespace: zod.z.string().optional(),
@@ -8663,6 +9099,28 @@ var deviceProviderCapability = {
8663
9099
  * Forked workers register devices back to the hub via `ctx.devices`
8664
9100
  * (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
8665
9101
  */
9102
+ /**
9103
+ * Most parents one `getChildrenBatch` may name.
9104
+ *
9105
+ * Every parent in the set becomes one bound `?` in the `parentDeviceId IN (…)`
9106
+ * the store compiles ({@link DeviceRowStore.listByParentMany} →
9107
+ * `filter-compiler.ts`), so the set size IS the SQL variable count. Two bounds
9108
+ * meet here and 256 clears both:
9109
+ *
9110
+ * - `SQLITE_MAX_VARIABLE_NUMBER` is 32 766 on SQLite ≥ 3.32 but **999** on
9111
+ * anything older, and better-sqlite3 links whatever amalgamation it was
9112
+ * built against on the host. A fleet-sized set (1 017 parents today) sits
9113
+ * ON that older limit; 256 stays a factor of four below it, so the batch
9114
+ * can never turn a boot into `too many SQL variables` on a host nobody
9115
+ * checked the build of.
9116
+ * - One call's answer is the children of those parents, and the answer
9117
+ * crosses a process boundary. Capping the ask caps the message.
9118
+ *
9119
+ * A caller with more parents sends ⌈n/256⌉ calls — four for today's fleet,
9120
+ * against 1 024 today. The cap is on the SCHEMA, not only on the caller: an
9121
+ * over-eager caller is refused, not silently truncated to a wrong answer.
9122
+ */
9123
+ var DEVICE_CHILDREN_BATCH_MAX = 256;
8666
9124
  /** One child-placement directive on a container's `childLayout`. Structurally
8667
9125
  * identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
8668
9126
  * shape for the same field. The child is identified by its re-sync-stable
@@ -9174,6 +9632,39 @@ var deviceManagerCapability = {
9174
9632
  /** List children of a parent device (by parent numeric id). */
9175
9633
  getChildren: require_sleep.method(zod.z.object({ parentDeviceId: zod.z.number() }), zod.z.array(DeviceInfoSchema)),
9176
9634
  /**
9635
+ * `getChildren` for a NAMED SET of parents, in one call.
9636
+ *
9637
+ * The accessory reconcile in `device-cap-proxy.ts` asks this question once
9638
+ * per registered device — every `BaseDevice` inherits a
9639
+ * `getAccessoryChildren()` that returns `[]`, so even a leaf accessory
9640
+ * pays a round-trip to learn it has nothing to prune. Measured on the live
9641
+ * hub 2026-08-27 over a 120-second boot window, fleet of 1 017 devices:
9642
+ * `DeviceRowStore.list < DeviceRowStore.listByParent < getChildren` at
9643
+ * **1 024 calls** returning **919 rows in total** — 1 024 RPCs and 1 024
9644
+ * indexed scans to move less than one row each. `listByParentMany`
9645
+ * collapses the scans; this collapses the RPCs.
9646
+ *
9647
+ * Keyed by parent id as a STRING — a JSON object cannot key by number
9648
+ * (same reason as `getDeviceStatusAggregateBatch`). The per-parent value
9649
+ * is exactly what `getChildren` returns for that parent.
9650
+ *
9651
+ * A parent with no children — or one the fleet does not know — is ABSENT
9652
+ * from the record, never an invented empty row: the same contract as
9653
+ * `DeviceRowStore.getMany`/`listByParentMany`. An EMPTY `parentDeviceIds`
9654
+ * reads nothing at all rather than degrading to "every device".
9655
+ *
9656
+ * `parentDeviceIds` is capped at {@link DEVICE_CHILDREN_BATCH_MAX} — see
9657
+ * that constant for why. A caller with more parents than that sends more
9658
+ * than one call; it never sends one pathological one.
9659
+ *
9660
+ * Version skew: this is a NEW method, not a new field on `getChildren`, so
9661
+ * a hub that predates it answers NOT_FOUND rather than silently stripping
9662
+ * an unknown input key and answering a DIFFERENT question. The kernel-side
9663
+ * loader degrades to per-parent `getChildren` on that error — see
9664
+ * `children-batch-loader.ts`.
9665
+ */
9666
+ getChildrenBatch: require_sleep.method(zod.z.object({ parentDeviceIds: zod.z.array(zod.z.number()).max(256) }), zod.z.record(zod.z.string(), zod.z.array(DeviceInfoSchema))),
9667
+ /**
9177
9668
  * Resolve the devices LINKED to a camera — the single policy authority
9178
9669
  * both consumers call (viewer devices panel + pipeline-analytics event
9179
9670
  * kinds/ingest). Device-tree children are ALWAYS included; mode 'auto'
@@ -10355,6 +10846,82 @@ var llmCapability = {
10355
10846
  }
10356
10847
  };
10357
10848
  //#endregion
10849
+ //#region src/capabilities/log-channels.cap.ts
10850
+ /**
10851
+ * `log-channels` — the capability an addon DECLARES its diagnostic channels
10852
+ * through. It stores nothing.
10853
+ *
10854
+ * ## Why a capability at all, and why this shape
10855
+ *
10856
+ * Which channels exist is knowledge only the addon has: `stream-broker` knows
10857
+ * webrtc/ICE/RTP, `provider-reolink` knows baichuan/handshake. A central list
10858
+ * maintained by hand rots at the first addition and rots INVISIBLY — nothing
10859
+ * fails, an operator just never sees the channel somebody added. So the list
10860
+ * is assembled from declarations at runtime.
10861
+ *
10862
+ * The shape is copied from `log-destination.cap.ts`, which already does
10863
+ * exactly this job: `mode: 'collection'`, `internal: true`,
10864
+ * `mount: { kind: 'skip' }` — no tRPC route, no generated hooks — while
10865
+ * `addons.listCapabilityProviders` still enumerates it, and the hub's
10866
+ * `CapabilityRegistry` still holds an RPC proxy per provider so a forked
10867
+ * runner's declarations reach hub-main over the transport that already exists.
10868
+ * No new UDS message, no second registry.
10869
+ *
10870
+ * ## What it deliberately does NOT own
10871
+ *
10872
+ * The VALUES — which channel is armed, for which cameras, until when — live in
10873
+ * ONE place: the logging settings document on the `system` cap
10874
+ * (`getLoggingSettings` / `setLoggingSettings`). Two authorities over the same
10875
+ * value is the defect the plan behind this work exists to remove, and
10876
+ * `setRequestCensus` was retired (D245) rather than allowed to be a second
10877
+ * one. {@link logChannelsCapability} therefore has no getter for a level, no
10878
+ * setter for a window and no persistence of any kind.
10879
+ *
10880
+ * ## Why `apply` is here even so
10881
+ *
10882
+ * The gate lives in the addon's PROCESS; the document lives in hub-main. Some
10883
+ * seam has to carry the value from the authority to the mirror, and a channel
10884
+ * that cannot be reached is precisely the dead knob this whole slice exists to
10885
+ * make impossible (D62 — `audioThresholdDbfs`, the HA entities with no source).
10886
+ * `apply` is that seam and nothing more: it writes an in-memory mirror, it
10887
+ * persists nothing, it is never the source of a value, and it is called only
10888
+ * with a set the hub actually read (D49 — a read that fails does not call it
10889
+ * at all, so no channel is silently disarmed by a bad read).
10890
+ */
10891
+ /** What `apply` reports back — enough to log, not enough to be a second state. */
10892
+ var LogChannelApplyResultSchema = zod.z.object({
10893
+ /** How many declared channels are armed in this process after the call. */
10894
+ armed: zod.z.number().int().min(0),
10895
+ /**
10896
+ * Names the document armed that this process does not declare. Reported
10897
+ * rather than swallowed: a name here is either a typo or an addon that has
10898
+ * not booted, and both deserve a line instead of silence.
10899
+ */
10900
+ unknown: zod.z.array(zod.z.string()).readonly()
10901
+ });
10902
+ var logChannelsCapability = {
10903
+ name: "log-channels",
10904
+ scope: "system",
10905
+ mode: "collection",
10906
+ internal: true,
10907
+ methods: {
10908
+ /** The channels this addon declares. Inert: no value, no state. */
10909
+ list: require_sleep.method(zod.z.void(), zod.z.array(LogChannelDescriptorSchema).readonly()),
10910
+ /**
10911
+ * Refresh this process's mirror from the document's FULL set of armed
10912
+ * windows.
10913
+ *
10914
+ * Full and not incremental on purpose: the document is the authority, so a
10915
+ * channel it does not name is disarmed here. An incremental apply would
10916
+ * let a disarm get lost in transit and leave a channel running that
10917
+ * nobody can see is running.
10918
+ */
10919
+ apply: require_sleep.method(zod.z.object({ windows: zod.z.array(LogChannelWindowSchema).readonly() }), LogChannelApplyResultSchema, { kind: "mutation" })
10920
+ },
10921
+ /** In-process only — enumerated through `addons.listCapabilityProviders`. */
10922
+ mount: { kind: "skip" }
10923
+ };
10924
+ //#endregion
10358
10925
  //#region src/capabilities/log-destination.cap.ts
10359
10926
  var LogLevelSchema = zod.z.enum([
10360
10927
  "debug",
@@ -30446,17 +31013,60 @@ var SetSiteLocationInputSchema = zod.z.object({
30446
31013
  longitude: zod.z.number().min(-180).max(180)
30447
31014
  }).nullable();
30448
31015
  /**
30449
- * One `(procedure, user-agent, ip, principal)` tuple of the HTTP request
31016
+ * The TRANSPORT a call arrived on.
31017
+ *
31018
+ * Every counted call carries exactly one of these, and `unknown` is a PLANE
31019
+ * rather than a gap: a plane that cannot attribute a call declares it here, so
31020
+ * the call lands in a named bucket instead of vanishing. `planes` summing to
31021
+ * `procedureCalls` is what makes "the sum of the planes explains the total"
31022
+ * checkable rather than asserted.
31023
+ *
31024
+ * - `http` — the Fastify tRPC plugin (`/trpc/*`), one context per request.
31025
+ * - `ws` — `applyWSSHandler`, counted per OPERATION rather than per
31026
+ * connection; the viewer talks to the hub over `wsLink`
31027
+ * exclusively, so this is the plane the HTTP census could not see.
31028
+ * - `mesh` — the in-process `$core-caps` bridge (`createCaller`), which
31029
+ * never touches a socket and therefore never touched a census.
31030
+ * - `unknown` — counted, plane undecidable. No hook produces it today, and
31031
+ * that is exactly what its `0` asserts: every plane the hub has can name
31032
+ * itself. It is an output bucket, never a knob — a call that arrives on a
31033
+ * plane nobody instrumented lands here instead of vanishing from the total.
31034
+ */
31035
+ var TransportPlaneSchema = zod.z.enum([
31036
+ "http",
31037
+ "ws",
31038
+ "mesh",
31039
+ "unknown"
31040
+ ]);
31041
+ /**
31042
+ * Calls per plane. Every key is always present, `0` included — an absent plane
31043
+ * reads as "not instrumented", which is the one thing this census must never
31044
+ * make an operator wonder about.
31045
+ */
31046
+ var TransportPlaneCountsSchema = zod.z.object({
31047
+ http: zod.z.number(),
31048
+ ws: zod.z.number(),
31049
+ mesh: zod.z.number(),
31050
+ unknown: zod.z.number()
31051
+ });
31052
+ /**
31053
+ * One `(plane, procedure, user-agent, ip, principal)` tuple of the transport
30450
31054
  * census. `principal` is the DERIVED identity (`apocaliss92 (admin)`,
30451
31055
  * `scoped:1a2b3c4d (scoped-token)`, `anonymous`) that the tRPC error log
30452
31056
  * already prints - never a token, never an `Authorization` header.
31057
+ *
31058
+ * `subscriptions` is counted APART from `calls`: a subscription is opened once
31059
+ * and lives for hours, so folding it into a call count makes one long-lived
31060
+ * stream look like a storm.
30453
31061
  */
30454
31062
  var RequestCensusGroupSchema = zod.z.object({
31063
+ plane: TransportPlaneSchema,
30455
31064
  procedure: zod.z.string(),
30456
31065
  userAgent: zod.z.string(),
30457
31066
  ip: zod.z.string(),
30458
31067
  principal: zod.z.string(),
30459
31068
  calls: zod.z.number(),
31069
+ subscriptions: zod.z.number(),
30460
31070
  perMin: zod.z.number()
30461
31071
  });
30462
31072
  /**
@@ -30469,9 +31079,17 @@ var RequestCensusGroupSchema = zod.z.object({
30469
31079
  var RequestCensusProcedureSchema = zod.z.object({
30470
31080
  procedure: zod.z.string(),
30471
31081
  calls: zod.z.number(),
31082
+ /**
31083
+ * The same total, split by transport. THIS is the row that answers the
31084
+ * question the census exists for: one look at `deviceManager.listAll` says
31085
+ * which plane carried the 4 960, without joining two log lines by eye.
31086
+ */
31087
+ planes: TransportPlaneCountsSchema,
31088
+ /** Subscription STARTS on this procedure. Never folded into `calls`. */
31089
+ subscriptions: zod.z.number(),
30472
31090
  perMin: zod.z.number()
30473
31091
  });
30474
- /** What one armed window measured. Mirrors `HttpRequestCensus.snapshot()`. */
31092
+ /** What one armed window measured. Mirrors `TransportCensus.snapshot()`. */
30475
31093
  var RequestCensusSnapshotSchema = zod.z.object({
30476
31094
  armed: zod.z.boolean(),
30477
31095
  /** How long the current - or just-closed - window collected, in ms. */
@@ -30489,14 +31107,45 @@ var RequestCensusSnapshotSchema = zod.z.object({
30489
31107
  */
30490
31108
  procedureCalls: zod.z.number(),
30491
31109
  /**
31110
+ * `procedureCalls` split by transport. The four keys sum to
31111
+ * `procedureCalls` by construction - {@link RequestCensusSnapshotSchema}'s
31112
+ * `planesExplainTotal` is that identity, checked rather than assumed.
31113
+ */
31114
+ planes: TransportPlaneCountsSchema,
31115
+ /**
31116
+ * True iff `planes` sums to `procedureCalls`. False means a call was counted
31117
+ * on no plane at all - which is a RESULT (a plane is missing from the
31118
+ * instrument), not a failure, and it has to be visible to be read as one.
31119
+ */
31120
+ planesExplainTotal: zod.z.boolean(),
31121
+ /**
30492
31122
  * tRPC WebSocket connections opened during the window. NOT calls - the WS
30493
- * transport resolves one context per connection - but the number that says
30494
- * whether a plane this census cannot see was busy while HTTP was quiet.
31123
+ * adapter resolves one context per connection - kept because a plane's call
31124
+ * count of zero against 37 open connections says something different from a
31125
+ * plane with no connections at all.
30495
31126
  */
30496
31127
  wsConnections: zod.z.number(),
31128
+ /**
31129
+ * Client frames the WS plane looked at. `wsMessages` far above
31130
+ * `planes.ws + subscriptions` means most traffic is not operations
31131
+ * (keepalives, connection params) - which is itself an answer.
31132
+ */
31133
+ wsMessages: zod.z.number(),
31134
+ /**
31135
+ * Subscription STARTS across every plane, excluded from `procedureCalls` on
31136
+ * purpose: one live-events stream opened at boot and held for six hours is
31137
+ * one subscription, and counting it as a call would let a quiet plane
31138
+ * masquerade as the storm.
31139
+ */
31140
+ subscriptions: zod.z.number(),
31141
+ /** `subscription.stop` frames. Starts minus stops is what is still open. */
31142
+ subscriptionStops: zod.z.number(),
30497
31143
  distinctGroups: zod.z.number(),
30498
- /** Calls counted in the totals whose group attribution was shed at the
30499
- * cardinality bound. */
31144
+ /**
31145
+ * Operations counted in the totals whose CALLER attribution was shed at the
31146
+ * cardinality bound. Unrelated to the `unknown` PLANE: these calls know
31147
+ * which transport they arrived on, they just lost their group row.
31148
+ */
30500
31149
  unattributedCalls: zod.z.number(),
30501
31150
  procedures: zod.z.array(RequestCensusProcedureSchema).readonly(),
30502
31151
  groups: zod.z.array(RequestCensusGroupSchema).readonly()
@@ -30528,10 +31177,11 @@ var DiagnosticIdSchema = zod.z.enum(["request-census"]);
30528
31177
  * The layers of the level hierarchy, general → specific. The most specific
30529
31178
  * layer that carries an explicit value wins.
30530
31179
  *
30531
- * `component` is DECLARED and not yet resolvable: the per-component channels
30532
- * are a later slice of the same plan, and a `levelSource` enum that has to
30533
- * grow later would force every consumer of this document to change with it.
30534
- * Nothing returns `component` today.
31180
+ * `component` became RESOLVABLE on 2026-08-27: a component is a declared log
31181
+ * CHANNEL (`stream-broker.webrtc`, `provider-reolink.baichuan`), named by
31182
+ * `scopeComponent`. It was declared-but-dark in the first slice precisely so
31183
+ * that turning it on would not force every consumer of this document to widen
31184
+ * a `levelSource` enum — which is what has now not happened.
30535
31185
  */
30536
31186
  var LoggingScopeKindSchema = zod.z.enum([
30537
31187
  "cluster",
@@ -30558,6 +31208,14 @@ var LoggingLevelLayerSchema = zod.z.object({
30558
31208
  scope: LoggingScopeKindSchema,
30559
31209
  /** The node this layer speaks for; `null` on the cluster layer. */
30560
31210
  nodeId: zod.z.string().nullable(),
31211
+ /**
31212
+ * The declared channel this layer speaks for; `null` on every layer but
31213
+ * `component`. Never folded into `nodeId`: a component level is CLUSTER-WIDE
31214
+ * by design — the convention this repo settled on is one orchestrator-wide
31215
+ * setting, never per node (D52) — so a component layer that carried a node
31216
+ * would invite a per-node copy of a value that has no per-node meaning.
31217
+ */
31218
+ component: zod.z.string().nullable(),
30561
31219
  /** Explicitly set here, or `null` when this layer inherits. */
30562
31220
  level: LogLevelSchema$1.nullable()
30563
31221
  });
@@ -30599,6 +31257,49 @@ var DiagnosticWindowPatchSchema = zod.z.object({
30599
31257
  reportEveryMs: zod.z.number().int().positive().optional()
30600
31258
  });
30601
31259
  /**
31260
+ * A channel ARMED, as the document reports it.
31261
+ *
31262
+ * `armMs` is not echoed back: what an operator needs to see is the deadline
31263
+ * and the time left, because a diagnostic left running is itself an incident
31264
+ * and "armed for 10 minutes" said an hour ago is not an answer.
31265
+ */
31266
+ var LogChannelWindowStateSchema = zod.z.object({
31267
+ channel: zod.z.string(),
31268
+ armed: zod.z.boolean(),
31269
+ /** Epoch ms the window closes at. 0 when disarmed. */
31270
+ armedUntilMs: zod.z.number(),
31271
+ /** Ms left before it expires on its own. 0 when disarmed. */
31272
+ remainingMs: zod.z.number(),
31273
+ /**
31274
+ * The cameras it is narrowed to, or `null` for every camera.
31275
+ *
31276
+ * A channel declared `perDevice: false` can only ever report `null` here:
31277
+ * its lines do not carry `tags: { deviceId }`, so narrowing them would
31278
+ * produce a filter that silently matches nothing. The server REFUSES such a
31279
+ * patch rather than quietly widening it — ignoring the request would teach
31280
+ * the operator that per-camera filtering works on that channel when it does
31281
+ * not.
31282
+ */
31283
+ deviceIds: zod.z.array(zod.z.number().int()).readonly().nullable()
31284
+ });
31285
+ /**
31286
+ * `armMs: 0` DISARMS. Same grammar as {@link DiagnosticWindowPatchSchema}, and
31287
+ * for the same reason: a channel is a window with a deadline, never a switch.
31288
+ */
31289
+ var LogChannelWindowPatchSchema = zod.z.object({
31290
+ channel: zod.z.string().min(1),
31291
+ armMs: zod.z.number().int().min(0),
31292
+ /**
31293
+ * Narrow to these numeric device ids. Absent or `null` = every camera.
31294
+ *
31295
+ * Numeric because the repo's own rule makes it possible: every log line
31296
+ * about a device carries `tags: { deviceId }` with the numeric id. That rule
31297
+ * was paid for with a 22% thumbnail gap and a 3-hour media blackout both
31298
+ * diagnosed by hand, and this is the first thing that collects on it.
31299
+ */
31300
+ deviceIds: zod.z.array(zod.z.number().int()).readonly().nullable().optional()
31301
+ });
31302
+ /**
30602
31303
  * A PATCH, and patches MERGE.
30603
31304
  *
30604
31305
  * A field absent from the patch is left exactly as it was — arming a
@@ -30617,7 +31318,14 @@ var LoggingSettingsPatchSchema = zod.z.object({
30617
31318
  * Only the diagnostics NAMED here change. An armed window that is not listed
30618
31319
  * keeps running — a patch is never a full replacement.
30619
31320
  */
30620
- diagnostics: zod.z.array(DiagnosticWindowPatchSchema).readonly().optional()
31321
+ diagnostics: zod.z.array(DiagnosticWindowPatchSchema).readonly().optional(),
31322
+ /**
31323
+ * Only the channels NAMED here change. An armed channel that is not listed
31324
+ * keeps running — same rule as `diagnostics`, because a patch that silently
31325
+ * disarmed the channels it did not mention would make the Levels page and
31326
+ * the Diagnostics page fight over the same value.
31327
+ */
31328
+ channels: zod.z.array(LogChannelWindowPatchSchema).readonly().optional()
30621
31329
  });
30622
31330
  /**
30623
31331
  * Which LAYER of the hierarchy is addressed. Absent = the cluster layer.
@@ -30630,9 +31338,22 @@ var LoggingSettingsPatchSchema = zod.z.object({
30630
31338
  * authority over the whole hierarchy and answers for every layer, so the
30631
31339
  * layer selector needs a name the transport does not already own.
30632
31340
  */
30633
- var GetLoggingSettingsInputSchema = zod.z.object({ scopeNodeId: zod.z.string().optional() });
31341
+ var GetLoggingSettingsInputSchema = zod.z.object({
31342
+ scopeNodeId: zod.z.string().optional(),
31343
+ /**
31344
+ * The declared CHANNEL this document is addressed at, when the caller wants
31345
+ * the `component` layer. Absent = the node/cluster hierarchy only.
31346
+ *
31347
+ * Naming it separately rather than overloading `scopeNodeId` keeps the two
31348
+ * axes from collapsing: a component level is cluster-wide, a node level is
31349
+ * not, and one selector for both would make "which of these two did I just
31350
+ * set" unanswerable — the exact ambiguity `explicit` exists to remove.
31351
+ */
31352
+ scopeComponent: zod.z.string().optional()
31353
+ });
30634
31354
  var SetLoggingSettingsInputSchema = zod.z.object({
30635
31355
  scopeNodeId: zod.z.string().optional(),
31356
+ scopeComponent: zod.z.string().optional(),
30636
31357
  patch: LoggingSettingsPatchSchema
30637
31358
  });
30638
31359
  /**
@@ -30647,9 +31368,20 @@ var SetLoggingSettingsInputSchema = zod.z.object({
30647
31368
  var LoggingSettingsStateSchema = zod.z.object({
30648
31369
  /** The layer this document was read at. `null` = the cluster layer. */
30649
31370
  scopeNodeId: zod.z.string().nullable(),
31371
+ /** The channel this document was read at. `null` = no component layer. */
31372
+ scopeComponent: zod.z.string().nullable(),
30650
31373
  effective: LoggingEffectiveSchema,
30651
31374
  explicit: LoggingExplicitSchema,
30652
31375
  activeWindows: zod.z.array(DiagnosticWindowSchema).readonly(),
31376
+ /**
31377
+ * Every channel the cluster's addons DECLARE, gathered from the
31378
+ * `log-channels` providers. Not stored anywhere: assembled per read, so a
31379
+ * channel added by a redeployed addon appears without anybody editing a
31380
+ * list, and a channel whose addon is gone stops being offered.
31381
+ */
31382
+ channels: zod.z.array(LogChannelDescriptorSchema).readonly(),
31383
+ /** The channels ARMED right now, each with its deadline. */
31384
+ activeChannels: zod.z.array(LogChannelWindowStateSchema).readonly(),
30653
31385
  persisted: zod.z.boolean()
30654
31386
  });
30655
31387
  var systemCapability = {
@@ -35039,6 +35771,7 @@ var CAPABILITY_NAMES = {
35039
35771
  llmRuntime: "llm-runtime",
35040
35772
  localNetwork: "local-network",
35041
35773
  lockControl: "lock-control",
35774
+ logChannels: "log-channels",
35042
35775
  logDestination: "log-destination",
35043
35776
  loginMethod: "login-method",
35044
35777
  mediaPlayer: "media-player",
@@ -35410,6 +36143,10 @@ var CAPABILITY_ROUTER_KEYS = [
35410
36143
  key: "lockControl",
35411
36144
  name: "lock-control"
35412
36145
  },
36146
+ {
36147
+ key: "logChannels",
36148
+ name: "log-channels"
36149
+ },
35413
36150
  {
35414
36151
  key: "logDestination",
35415
36152
  name: "log-destination"
@@ -35798,6 +36535,7 @@ var ALL_CAPABILITY_DEFINITIONS = [
35798
36535
  llmRuntimeCapability,
35799
36536
  localNetworkCapability,
35800
36537
  lockControlCapability,
36538
+ logChannelsCapability,
35801
36539
  logDestinationCapability,
35802
36540
  loginMethodCapability,
35803
36541
  mediaPlayerCapability,
@@ -36766,6 +37504,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
36766
37504
  addonId: null,
36767
37505
  access: "view"
36768
37506
  },
37507
+ "dataStoreProvider.aggregate": {
37508
+ capName: "data-store-provider",
37509
+ capScope: "system",
37510
+ addonId: null,
37511
+ access: "view"
37512
+ },
36769
37513
  "dataStoreProvider.count": {
36770
37514
  capName: "data-store-provider",
36771
37515
  capScope: "system",
@@ -37180,6 +37924,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
37180
37924
  addonId: null,
37181
37925
  access: "view"
37182
37926
  },
37927
+ "deviceManager.getChildrenBatch": {
37928
+ capName: "device-manager",
37929
+ capScope: "system",
37930
+ addonId: null,
37931
+ access: "view"
37932
+ },
37183
37933
  "deviceManager.getConfigSchema": {
37184
37934
  capName: "device-manager",
37185
37935
  capScope: "system",
@@ -38230,6 +38980,18 @@ var METHOD_ACCESS_MAP = Object.freeze({
38230
38980
  addonId: null,
38231
38981
  access: "create"
38232
38982
  },
38983
+ "logChannels.apply": {
38984
+ capName: "log-channels",
38985
+ capScope: "system",
38986
+ addonId: null,
38987
+ access: "create"
38988
+ },
38989
+ "logChannels.list": {
38990
+ capName: "log-channels",
38991
+ capScope: "system",
38992
+ addonId: null,
38993
+ access: "view"
38994
+ },
38233
38995
  "logDestination.query": {
38234
38996
  capName: "log-destination",
38235
38997
  capScope: "system",
@@ -40384,6 +41146,12 @@ var METHOD_ACCESS_MAP = Object.freeze({
40384
41146
  addonId: null,
40385
41147
  access: "create"
40386
41148
  },
41149
+ "settingsStore.aggregate": {
41150
+ capName: "settings-store",
41151
+ capScope: "system",
41152
+ addonId: null,
41153
+ access: "view"
41154
+ },
40387
41155
  "settingsStore.count": {
40388
41156
  capName: "settings-store",
40389
41157
  capScope: "system",
@@ -41733,6 +42501,7 @@ var KNOWN_CAP_NAMES = [
41733
42501
  "llm-runtime",
41734
42502
  "local-network",
41735
42503
  "lock-control",
42504
+ "log-channels",
41736
42505
  "log-destination",
41737
42506
  "login-method",
41738
42507
  "media-player",
@@ -41891,6 +42660,7 @@ var SYSTEM_CAP_NAMES = [
41891
42660
  "llm",
41892
42661
  "llm-runtime",
41893
42662
  "local-network",
42663
+ "log-channels",
41894
42664
  "log-destination",
41895
42665
  "login-method",
41896
42666
  "mesh-network",
@@ -42220,6 +42990,11 @@ var METHOD_DEVICE_SELECTORS = Object.freeze({
42220
42990
  form: "single",
42221
42991
  optional: false
42222
42992
  }],
42993
+ "deviceManager.getChildrenBatch": [{
42994
+ name: "parentDeviceIds",
42995
+ form: "array",
42996
+ optional: false
42997
+ }],
42223
42998
  "deviceManager.getConfigSchema": [{
42224
42999
  name: "deviceId",
42225
43000
  form: "single",
@@ -43696,6 +44471,7 @@ var SYSTEM_SCOPE_DEVICE_METHODS = [
43696
44471
  "deviceManager.getBindings",
43697
44472
  "deviceManager.getBindingsBatch",
43698
44473
  "deviceManager.getChildren",
44474
+ "deviceManager.getChildrenBatch",
43699
44475
  "deviceManager.getConfigSchema",
43700
44476
  "deviceManager.getDevice",
43701
44477
  "deviceManager.getDeviceAggregate",
@@ -44433,6 +45209,7 @@ function createSystemProxy(api) {
44433
45209
  listPersistedByAddon: (input) => dispatch("deviceManager", "listPersistedByAddon", "query", input),
44434
45210
  listAll: (input) => dispatch("deviceManager", "listAll", "query", input),
44435
45211
  getChildren: (input) => dispatch("deviceManager", "getChildren", "query", input),
45212
+ getChildrenBatch: (input) => dispatch("deviceManager", "getChildrenBatch", "query", input),
44436
45213
  getLinkedDevicesBatch: (input) => dispatch("deviceManager", "getLinkedDevicesBatch", "query", input),
44437
45214
  removeByIntegration: (input) => dispatch("deviceManager", "removeByIntegration", "mutation", input),
44438
45215
  getBindingsBatch: (input) => dispatch("deviceManager", "getBindingsBatch", "query", input),
@@ -44747,6 +45524,7 @@ function createSystemProxy(api) {
44747
45524
  deleteWhere: (input) => dispatch("settingsStore", "deleteWhere", "mutation", input),
44748
45525
  updateWhere: (input) => dispatch("settingsStore", "updateWhere", "mutation", input),
44749
45526
  count: (input) => dispatch("settingsStore", "count", "query", input),
45527
+ aggregate: (input) => dispatch("settingsStore", "aggregate", "query", input),
44750
45528
  histogram: (input) => dispatch("settingsStore", "histogram", "query", input),
44751
45529
  isEmpty: (input) => dispatch("settingsStore", "isEmpty", "query", input),
44752
45530
  declareCollection: (input) => dispatch("settingsStore", "declareCollection", "mutation", input)
@@ -49046,6 +49824,7 @@ exports.DETECTION_MACRO_CLASSES = DETECTION_MACRO_CLASSES;
49046
49824
  exports.DETECTION_PIPELINE_CAP_NAME = DETECTION_PIPELINE_CAP_NAME;
49047
49825
  exports.DEVICE_BACKEND_TO_FORMAT = DEVICE_BACKEND_TO_FORMAT;
49048
49826
  exports.DEVICE_CAP_NAMES = DEVICE_CAP_NAMES;
49827
+ exports.DEVICE_CHILDREN_BATCH_MAX = DEVICE_CHILDREN_BATCH_MAX;
49049
49828
  exports.DEVICE_PROFILES = DEVICE_PROFILES;
49050
49829
  exports.DEVICE_SCOPED_CAPS = require_sleep.DEVICE_SCOPED_CAPS;
49051
49830
  exports.DEVICE_SETTINGS_CONTRIBUTION_METHODS = require_sleep.DEVICE_SETTINGS_CONTRIBUTION_METHODS;
@@ -49196,6 +49975,7 @@ exports.IntercomAbilitySchema = IntercomAbilitySchema;
49196
49975
  exports.IntercomStatusSchema = IntercomStatusSchema;
49197
49976
  exports.KNOWN_CAP_NAMES = KNOWN_CAP_NAMES;
49198
49977
  exports.KeyEventSchema = KeyEventSchema;
49978
+ exports.LOG_CHANNEL_TICK_MS = LOG_CHANNEL_TICK_MS;
49199
49979
  exports.LOG_LEVEL_RANK = LOG_LEVEL_RANK;
49200
49980
  exports.LabelAttributionSchema = LabelAttributionSchema;
49201
49981
  exports.LabelDefinitionSchema = LabelDefinitionSchema;
@@ -49231,6 +50011,14 @@ exports.LocateSegmentResultSchema = LocateSegmentResultSchema;
49231
50011
  exports.LocationStatSchema = LocationStatSchema;
49232
50012
  exports.LockControlStatusSchema = LockControlStatusSchema;
49233
50013
  exports.LockStateSchema = LockStateSchema;
50014
+ exports.LogChannelApplyResultSchema = LogChannelApplyResultSchema;
50015
+ exports.LogChannelDescriptorSchema = LogChannelDescriptorSchema;
50016
+ exports.LogChannelGate = LogChannelGate;
50017
+ exports.LogChannelLevelSchema = LogChannelLevelSchema;
50018
+ exports.LogChannelRegistry = LogChannelRegistry;
50019
+ exports.LogChannelWindowPatchSchema = LogChannelWindowPatchSchema;
50020
+ exports.LogChannelWindowSchema = LogChannelWindowSchema;
50021
+ exports.LogChannelWindowStateSchema = LogChannelWindowStateSchema;
49234
50022
  exports.LogEntrySchema = LogEntrySchema;
49235
50023
  exports.LogLevelSchema = LogLevelSchema;
49236
50024
  exports.LogStreamEntrySchema = LogStreamEntrySchema;
@@ -49723,6 +50511,8 @@ exports.TrackZoneFilterSchema = TrackZoneFilterSchema;
49723
50511
  exports.TrackedDetectionSchema = TrackedDetectionSchema;
49724
50512
  exports.TrainingExportDeviceTotalsSchema = TrainingExportDeviceTotalsSchema;
49725
50513
  exports.TrainingExportSummarySchema = TrainingExportSummarySchema;
50514
+ exports.TransportPlaneCountsSchema = TransportPlaneCountsSchema;
50515
+ exports.TransportPlaneSchema = TransportPlaneSchema;
49726
50516
  exports.TurnServerSchema = TurnServerSchema;
49727
50517
  exports.UNIT_TABLE = UNIT_TABLE;
49728
50518
  exports.UnifiedBrokerInfoSchema = BrokerInfoSchema$1;
@@ -49779,6 +50569,7 @@ exports.ZoneRuleStageEnum = ZoneRuleStageEnum;
49779
50569
  exports.ZoneRulesArraySchema = ZoneRulesArraySchema;
49780
50570
  exports.ZoneSchema = ZoneSchema;
49781
50571
  exports.ZoneScopeBreakdownSchema = ZoneScopeBreakdownSchema;
50572
+ exports.__resetLogChannelRegistryForTests = __resetLogChannelRegistryForTests;
49782
50573
  exports.accessoriesCapability = accessoriesCapability;
49783
50574
  exports.accessoryStableId = accessoryStableId;
49784
50575
  exports.addonPagesCapability = addonPagesCapability;
@@ -49875,6 +50666,7 @@ exports.createEventBusSliceSource = require_sleep.createEventBusSliceSource;
49875
50666
  exports.createExpressionScope = createExpressionScope;
49876
50667
  exports.createHwAccelCache = createHwAccelCache;
49877
50668
  exports.createLazyTrpcSource = require_sleep.createLazyTrpcSource;
50669
+ exports.createLogChannelsProvider = createLogChannelsProvider;
49878
50670
  exports.createMirrorSource = require_sleep.createMirrorSource;
49879
50671
  exports.createRuntimeStateBridge = createRuntimeStateBridge;
49880
50672
  exports.createSliceHandle = require_sleep.createSliceHandle;
@@ -49884,6 +50676,7 @@ exports.customModelRegistryCapability = customModelRegistryCapability;
49884
50676
  exports.dataStoreProviderCapability = dataStoreProviderCapability;
49885
50677
  exports.dayNightCapability = dayNightCapability;
49886
50678
  exports.declarationOwnerNodeId = declarationOwnerNodeId;
50679
+ exports.declareLogChannel = declareLogChannel;
49887
50680
  exports.decodeVectorBase64 = decodeVectorBase64;
49888
50681
  exports.decoderCapability = decoderCapability;
49889
50682
  exports.defaultDeliveryForSection = defaultDeliveryForSection;
@@ -49946,6 +50739,7 @@ exports.generateAutomationBlock = generateAutomationBlock;
49946
50739
  exports.getAudioMacroClassIds = getAudioMacroClassIds;
49947
50740
  exports.getByPath = getByPath;
49948
50741
  exports.getCapsByProviderKind = getCapsByProviderKind;
50742
+ exports.getLogChannelRegistry = getLogChannelRegistry;
49949
50743
  exports.getTaxonomyEntry = getTaxonomyEntry;
49950
50744
  exports.hasMotionTrigger = hasMotionTrigger;
49951
50745
  exports.hfModelUrl = hfModelUrl;
@@ -49999,6 +50793,7 @@ exports.localNetworkCapability = localNetworkCapability;
49999
50793
  exports.locationSimilarity = locationSimilarity;
50000
50794
  exports.lockControlCapability = lockControlCapability;
50001
50795
  exports.logBannerArgs = require_canonical_hash.logBannerArgs;
50796
+ exports.logChannelsCapability = logChannelsCapability;
50002
50797
  exports.logDestinationCapability = logDestinationCapability;
50003
50798
  exports.logLevelAtMost = logLevelAtMost;
50004
50799
  exports.loginMethodCapability = loginMethodCapability;