@camstack/system 1.2.185 → 1.2.187

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.
Files changed (58) hide show
  1. package/dist/addon-runner.js +1 -1
  2. package/dist/addon-runner.mjs +1 -1
  3. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.js +1 -1
  4. package/dist/builtins/addon-pages-aggregator/addon-pages-aggregator.addon.mjs +1 -1
  5. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.js +1 -1
  6. package/dist/builtins/addon-widgets-aggregator/addon-widgets-aggregator.addon.mjs +1 -1
  7. package/dist/builtins/alerts/alerts.addon.js +1 -1
  8. package/dist/builtins/alerts/alerts.addon.mjs +1 -1
  9. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +1 -1
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +1 -1
  11. package/dist/builtins/console-logging/index.js +1 -1
  12. package/dist/builtins/console-logging/index.mjs +1 -1
  13. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  14. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  15. package/dist/builtins/device-manager/device-linked-devices.d.ts +35 -20
  16. package/dist/builtins/device-manager/device-manager.addon.js +127 -152
  17. package/dist/builtins/device-manager/device-manager.addon.mjs +127 -152
  18. package/dist/builtins/device-manager/device-meta-actions.d.ts +1 -1
  19. package/dist/builtins/device-manager/linked-devices-manual-backfill.d.ts +16 -0
  20. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  21. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  22. package/dist/builtins/hub-forwarder/index.js +1 -1
  23. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  24. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  25. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  26. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  27. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  28. package/dist/builtins/local-network/local-network.addon.js +1 -1
  29. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  30. package/dist/builtins/loki-logging/index.js +1 -1
  31. package/dist/builtins/loki-logging/index.mjs +1 -1
  32. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  33. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  34. package/dist/builtins/platform-probe/index.js +1 -1
  35. package/dist/builtins/platform-probe/index.mjs +1 -1
  36. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  37. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  38. package/dist/builtins/snapshot/index.js +1 -1
  39. package/dist/builtins/snapshot/index.mjs +1 -1
  40. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  41. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  42. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  43. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  44. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +1 -1
  45. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +1 -1
  46. package/dist/builtins/system-config/system-config.addon.js +1 -1
  47. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  48. package/dist/builtins/winston-logging/index.js +1 -1
  49. package/dist/builtins/winston-logging/index.mjs +1 -1
  50. package/dist/{dist-CCMYMmkQ.mjs → dist-C5PkvU4p.mjs} +62 -6
  51. package/dist/{dist-DE3OH-FG.js → dist-DNwhsXWi.js} +62 -6
  52. package/dist/index.js +2 -2
  53. package/dist/index.mjs +2 -2
  54. package/dist/{manifest-system-deps-BmXFnBQZ.mjs → manifest-system-deps-BF-C5NDL.mjs} +2 -55
  55. package/dist/{manifest-system-deps-DMWd5Ygf.js → manifest-system-deps-KBuTXH-y.js} +1 -54
  56. package/dist/{retired-settings-keys-C0uslzAd.mjs → retired-settings-keys-BZU4lIH7.mjs} +1 -1
  57. package/dist/{retired-settings-keys-BgUS9Rr3.js → retired-settings-keys-CUXClAIQ.js} +1 -1
  58. package/package.json +1 -1
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-DE3OH-FG.js");
6
+ const require_dist = require("../../dist-DNwhsXWi.js");
7
7
  //#region src/builtins/system-config/system-config.addon.ts
8
8
  /**
9
9
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -1,4 +1,4 @@
1
- import { Ft as BaseAddon, Pt as errMsg, Qt as hydrateSchema } from "../../dist-CCMYMmkQ.mjs";
1
+ import { Ft as BaseAddon, Pt as errMsg, Qt as hydrateSchema } from "../../dist-C5PkvU4p.mjs";
2
2
  //#region src/builtins/system-config/system-config.addon.ts
3
3
  /**
4
4
  * Built-in `system-config` addon — Phase 4 of the settings redesign.
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../../chunk-Cek0wNdY.js");
6
- const require_dist = require("../../dist-DE3OH-FG.js");
6
+ const require_dist = require("../../dist-DNwhsXWi.js");
7
7
  const require_formatter = require("../../formatter-DqAKDlvN.js");
8
8
  let node_path = require("node:path");
9
9
  node_path = require_chunk.__toESM(node_path);
@@ -1,4 +1,4 @@
1
- import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-CCMYMmkQ.mjs";
1
+ import { Ft as BaseAddon, ct as logDestinationCapability } from "../../dist-C5PkvU4p.mjs";
2
2
  import { t as formatLogLine } from "../../formatter-B7qW8bPJ.mjs";
3
3
  import * as path$1 from "node:path";
4
4
  import path from "node:path";
@@ -10594,6 +10594,24 @@ var deviceProviderCapability = {
10594
10594
  })
10595
10595
  }
10596
10596
  };
10597
+ /**
10598
+ * Device Manager capability — hub-side singleton that unifies device persistence,
10599
+ * live registry access, and all management operations into a single tRPC surface.
10600
+ *
10601
+ * Replaces:
10602
+ * - `device-persistence` capability (persistence methods absorbed here)
10603
+ * - `device-management.router.ts` (deleted in Phase 2)
10604
+ * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
10605
+ *
10606
+ * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
10607
+ * fork into separate processes but never run on remote cluster agents. Therefore:
10608
+ * - No nodeId routing needed — this is a pure hub singleton.
10609
+ * - The hub's DeviceRegistry is the single source of truth for all live devices.
10610
+ * - No shadow registry or cross-node aggregation required.
10611
+ *
10612
+ * Forked workers register devices back to the hub via `ctx.devices`
10613
+ * (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
10614
+ */
10597
10615
  /** One child-placement directive on a container's `childLayout`. Structurally
10598
10616
  * identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
10599
10617
  * shape for the same field. The child is identified by its re-sync-stable
@@ -10692,7 +10710,12 @@ var ConfigEntrySchema = z.object({
10692
10710
  value: z.unknown(),
10693
10711
  description: z.string().optional()
10694
10712
  });
10695
- var LinkedDevicesModeSchema = z.enum(["auto", "manual"]);
10713
+ /**
10714
+ * Only `manual` since D356: the operator picks, nothing links itself. The
10715
+ * field survives on the wire because a viewer already OTA'd parses it —
10716
+ * drop it once no shipped client reads `mode`.
10717
+ */
10718
+ var LinkedDevicesModeSchema = z.enum(["manual"]);
10696
10719
  /** One resolved linked device — the compact projection consumers need. */
10697
10720
  var LinkedDeviceSchema = z.object({
10698
10721
  deviceId: z.number(),
@@ -17535,6 +17558,9 @@ var RetrainStatusSchema = z.enum([
17535
17558
  *
17536
17559
  * `debug` does NOT pin; it is attention, not durability.
17537
17560
  *
17561
+ * `debugNote` is the operator's own words about WHAT should be checked on this
17562
+ * track, and it lives and dies with `debug` — see {@link MAX_TRACK_DEBUG_NOTE_LEN}.
17563
+ *
17538
17564
  * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
17539
17565
  * A favourited track is skipped by retention the same way `staging` is, but
17540
17566
  * it does not enter `none|staging|trained` and has no staging budget.
@@ -17545,6 +17571,21 @@ var TrackFlagFields = {
17545
17571
  markForTrain: z.boolean().optional(),
17546
17572
  /** Operator marked this track for diagnostic attention. */
17547
17573
  debug: z.boolean().optional(),
17574
+ /**
17575
+ * What the operator wants CHECKED on this track, in their own words.
17576
+ *
17577
+ * The flag alone says "look at this" and nothing about what for; a debug set
17578
+ * reviewed hours later is a list of tracks with no question attached. Bound
17579
+ * to `debug` on the WRITE side — the body clears it when `debug` goes off,
17580
+ * and refuses it on a track whose debug is off — so a note can never outlive
17581
+ * the attention it belongs to.
17582
+ *
17583
+ * `''` is a real value ("marked, nothing to add"); the ABSENT key means
17584
+ * "leave whatever is stored alone", which is what lets a surface turn debug
17585
+ * on without a note (a cancelled prompt) and what lets it edit the note
17586
+ * without touching the flag.
17587
+ */
17588
+ debugNote: z.string().max(500).optional(),
17548
17589
  /** Operator favourited this track. Pins it against pruning. */
17549
17590
  favourited: z.boolean().optional()
17550
17591
  };
@@ -17571,6 +17612,12 @@ var TrackFlagsSchema = z.object({
17571
17612
  trackId: z.string(),
17572
17613
  markForTrain: z.boolean(),
17573
17614
  debug: z.boolean(),
17615
+ /** The note as it STANDS after the write — never absent here (a track with no
17616
+ * note reports `''`), for the same reason the booleans are required: a
17617
+ * surface that has just written must be able to render the note it now owns
17618
+ * without a re-fetch, and an absent key would read as "unchanged" on a
17619
+ * screen that has no previous value to keep. */
17620
+ debugNote: z.string(),
17574
17621
  favourited: z.boolean(),
17575
17622
  /** The lifecycle state the boolean was derived from. Required here (unlike on
17576
17623
  * a track row) because this shape is only ever produced by the write body,
@@ -18872,11 +18919,20 @@ var pipelineAnalyticsCapability = {
18872
18919
  * staging is a deliberate action of the retrain page, which is also the only
18873
18920
  * thing that produces `trained` in the first place.
18874
18921
  *
18875
- * Returns the RESOLVED state of both flags (absent → `false`) plus the
18876
- * `retrainStatus` they were derived from, so a caller can drive its toggle
18877
- * — and render a `trained` badge — without a re-fetch. Rejects an unknown
18878
- * track, a new staging mark on a device already holding its full budget, and
18879
- * any `markForTrain` write against a trained track.
18922
+ * `debugNote` is the operator's sentence about WHAT to check on this track,
18923
+ * and it is bound to `debug`: writing `debug: false` clears it in the same
18924
+ * statement, and a note sent for a track whose debug is off (and is not
18925
+ * being turned on) is DROPPED with a warning rather than stored where
18926
+ * nothing will ever read it. An omitted `debugNote` leaves the stored one
18927
+ * alone — which is what lets a surface turn debug on when the operator
18928
+ * declined to type anything, without that refusal costing them the flag.
18929
+ *
18930
+ * Returns the RESOLVED state of all three flags (absent → `false`) plus the
18931
+ * note (absent → `''`) and the `retrainStatus` they were derived from, so a
18932
+ * caller can drive its toggle — and render a `trained` badge — without a
18933
+ * re-fetch. Rejects an unknown track, a new staging mark on a device already
18934
+ * holding its full budget, and any `markForTrain` write against a trained
18935
+ * track.
18880
18936
  */
18881
18937
  setTrackFlags: method(z.object({
18882
18938
  /** Log/audit scope only — the trackId is globally unique on its own. */
@@ -10594,6 +10594,24 @@ var deviceProviderCapability = {
10594
10594
  })
10595
10595
  }
10596
10596
  };
10597
+ /**
10598
+ * Device Manager capability — hub-side singleton that unifies device persistence,
10599
+ * live registry access, and all management operations into a single tRPC surface.
10600
+ *
10601
+ * Replaces:
10602
+ * - `device-persistence` capability (persistence methods absorbed here)
10603
+ * - `device-management.router.ts` (deleted in Phase 2)
10604
+ * - `device-ops.router.ts` (compat layer — deleted; device-provider ops absorbed here)
10605
+ *
10606
+ * All device provider addons (rtsp, onvif, frigate, …) are hub-local: they may
10607
+ * fork into separate processes but never run on remote cluster agents. Therefore:
10608
+ * - No nodeId routing needed — this is a pure hub singleton.
10609
+ * - The hub's DeviceRegistry is the single source of truth for all live devices.
10610
+ * - No shadow registry or cross-node aggregation required.
10611
+ *
10612
+ * Forked workers register devices back to the hub via `ctx.devices`
10613
+ * (DeviceManagerApi → ctx.api.deviceManager.registerDevice), same as today.
10614
+ */
10597
10615
  /** One child-placement directive on a container's `childLayout`. Structurally
10598
10616
  * identical to `ChildLayoutEntry` in `device-management.ts` — the cap wire
10599
10617
  * shape for the same field. The child is identified by its re-sync-stable
@@ -10692,7 +10710,12 @@ var ConfigEntrySchema = zod.z.object({
10692
10710
  value: zod.z.unknown(),
10693
10711
  description: zod.z.string().optional()
10694
10712
  });
10695
- var LinkedDevicesModeSchema = zod.z.enum(["auto", "manual"]);
10713
+ /**
10714
+ * Only `manual` since D356: the operator picks, nothing links itself. The
10715
+ * field survives on the wire because a viewer already OTA'd parses it —
10716
+ * drop it once no shipped client reads `mode`.
10717
+ */
10718
+ var LinkedDevicesModeSchema = zod.z.enum(["manual"]);
10696
10719
  /** One resolved linked device — the compact projection consumers need. */
10697
10720
  var LinkedDeviceSchema = zod.z.object({
10698
10721
  deviceId: zod.z.number(),
@@ -17535,6 +17558,9 @@ var RetrainStatusSchema = zod.z.enum([
17535
17558
  *
17536
17559
  * `debug` does NOT pin; it is attention, not durability.
17537
17560
  *
17561
+ * `debugNote` is the operator's own words about WHAT should be checked on this
17562
+ * track, and it lives and dies with `debug` — see {@link MAX_TRACK_DEBUG_NOTE_LEN}.
17563
+ *
17538
17564
  * `favourited` IS a BOOLEAN pin (durability bit), not a retrain lifecycle.
17539
17565
  * A favourited track is skipped by retention the same way `staging` is, but
17540
17566
  * it does not enter `none|staging|trained` and has no staging budget.
@@ -17545,6 +17571,21 @@ var TrackFlagFields = {
17545
17571
  markForTrain: zod.z.boolean().optional(),
17546
17572
  /** Operator marked this track for diagnostic attention. */
17547
17573
  debug: zod.z.boolean().optional(),
17574
+ /**
17575
+ * What the operator wants CHECKED on this track, in their own words.
17576
+ *
17577
+ * The flag alone says "look at this" and nothing about what for; a debug set
17578
+ * reviewed hours later is a list of tracks with no question attached. Bound
17579
+ * to `debug` on the WRITE side — the body clears it when `debug` goes off,
17580
+ * and refuses it on a track whose debug is off — so a note can never outlive
17581
+ * the attention it belongs to.
17582
+ *
17583
+ * `''` is a real value ("marked, nothing to add"); the ABSENT key means
17584
+ * "leave whatever is stored alone", which is what lets a surface turn debug
17585
+ * on without a note (a cancelled prompt) and what lets it edit the note
17586
+ * without touching the flag.
17587
+ */
17588
+ debugNote: zod.z.string().max(500).optional(),
17548
17589
  /** Operator favourited this track. Pins it against pruning. */
17549
17590
  favourited: zod.z.boolean().optional()
17550
17591
  };
@@ -17571,6 +17612,12 @@ var TrackFlagsSchema = zod.z.object({
17571
17612
  trackId: zod.z.string(),
17572
17613
  markForTrain: zod.z.boolean(),
17573
17614
  debug: zod.z.boolean(),
17615
+ /** The note as it STANDS after the write — never absent here (a track with no
17616
+ * note reports `''`), for the same reason the booleans are required: a
17617
+ * surface that has just written must be able to render the note it now owns
17618
+ * without a re-fetch, and an absent key would read as "unchanged" on a
17619
+ * screen that has no previous value to keep. */
17620
+ debugNote: zod.z.string(),
17574
17621
  favourited: zod.z.boolean(),
17575
17622
  /** The lifecycle state the boolean was derived from. Required here (unlike on
17576
17623
  * a track row) because this shape is only ever produced by the write body,
@@ -18872,11 +18919,20 @@ var pipelineAnalyticsCapability = {
18872
18919
  * staging is a deliberate action of the retrain page, which is also the only
18873
18920
  * thing that produces `trained` in the first place.
18874
18921
  *
18875
- * Returns the RESOLVED state of both flags (absent → `false`) plus the
18876
- * `retrainStatus` they were derived from, so a caller can drive its toggle
18877
- * — and render a `trained` badge — without a re-fetch. Rejects an unknown
18878
- * track, a new staging mark on a device already holding its full budget, and
18879
- * any `markForTrain` write against a trained track.
18922
+ * `debugNote` is the operator's sentence about WHAT to check on this track,
18923
+ * and it is bound to `debug`: writing `debug: false` clears it in the same
18924
+ * statement, and a note sent for a track whose debug is off (and is not
18925
+ * being turned on) is DROPPED with a warning rather than stored where
18926
+ * nothing will ever read it. An omitted `debugNote` leaves the stored one
18927
+ * alone — which is what lets a surface turn debug on when the operator
18928
+ * declined to type anything, without that refusal costing them the flag.
18929
+ *
18930
+ * Returns the RESOLVED state of all three flags (absent → `false`) plus the
18931
+ * note (absent → `''`) and the `retrainStatus` they were derived from, so a
18932
+ * caller can drive its toggle — and render a `trained` badge — without a
18933
+ * re-fetch. Rejects an unknown track, a new staging mark on a device already
18934
+ * holding its full budget, and any `markForTrain` write against a trained
18935
+ * track.
18880
18936
  */
18881
18937
  setTrackFlags: method(zod.z.object({
18882
18938
  /** Log/audit scope only — the trackId is globally unique on its own. */
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_chunk = require("./chunk-Cek0wNdY.js");
3
- const require_dist = require("./dist-DE3OH-FG.js");
3
+ const require_dist = require("./dist-DNwhsXWi.js");
4
4
  const require_builtins_alerts_alerts_addon = require("./builtins/alerts/alerts.addon.js");
5
5
  require("./builtins/alerts/index.js");
6
6
  const require_formatter = require("./formatter-DqAKDlvN.js");
@@ -27,7 +27,7 @@ require("./builtins/system-config/index.js");
27
27
  const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
28
28
  const require_file_data_plane = require("./file-data-plane-DO8KbxCe.js");
29
29
  const require_tls$1 = require("./tls-BxQlomxd.js");
30
- const require_manifest_system_deps = require("./manifest-system-deps-DMWd5Ygf.js");
30
+ const require_manifest_system_deps = require("./manifest-system-deps-KBuTXH-y.js");
31
31
  const require_resource_monitor = require("./resource-monitor-CdnzxBLP.js");
32
32
  const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
33
33
  let zod = require("zod");
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { a as __toCommonJS, i as __require, n as __esmMin, o as __toESM$1, r as __exportAll, t as __commonJSMin$1 } from "./chunk-CNf5ZN-e.mjs";
2
- import { $ as isArrayOutputSchema, Ct as scopesAllowDeviceCap, D as addonSettingsCapability, Gt as asJsonObject$1, Ht as ReadinessRegistry, It as DATAPLANE_SECRET_HEADER$1, Jt as createEvent, Kt as asNumber, Lt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Pt as errMsg$1, Rt as DEVICE_STATUS_METHOD, St as scopesAllowAddon, Ut as ReadinessTimeoutError, X as extractNestedAddonId, Yt as emitDownForOwnedCaps, Zt as expandCapMethods, an as scopeKey, at as kebabToCamel, bt as resolveMethodAuth, et as isCollectionArrayMethod, g as RUNTIME_DEFAULTS, gt as procedureAuthKey, in as resolveCapMount, it as isVoidInput, lt as logLevelAtMost, m as METHOD_ACCESS_MAP, nn as parseJsonUnknown, ot as lifecycleJobSchema, p as LOG_LEVEL_RANK, pt as objectInputDeclaresAddonId, qt as asString$1, rn as readinessKey, sn as EventCategory$1, t as ALL_CAPABILITY_DEFINITIONS, tn as parseJsonObject, tt as isObjectInput, ut as looseSchema } from "./dist-CCMYMmkQ.mjs";
2
+ import { $ as isArrayOutputSchema, Ct as scopesAllowDeviceCap, D as addonSettingsCapability, Gt as asJsonObject$1, Ht as ReadinessRegistry, It as DATAPLANE_SECRET_HEADER$1, Jt as createEvent, Kt as asNumber, Lt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Pt as errMsg$1, Rt as DEVICE_STATUS_METHOD, St as scopesAllowAddon, Ut as ReadinessTimeoutError, X as extractNestedAddonId, Yt as emitDownForOwnedCaps, Zt as expandCapMethods, an as scopeKey, at as kebabToCamel, bt as resolveMethodAuth, et as isCollectionArrayMethod, g as RUNTIME_DEFAULTS, gt as procedureAuthKey, in as resolveCapMount, it as isVoidInput, lt as logLevelAtMost, m as METHOD_ACCESS_MAP, nn as parseJsonUnknown, ot as lifecycleJobSchema, p as LOG_LEVEL_RANK, pt as objectInputDeclaresAddonId, qt as asString$1, rn as readinessKey, sn as EventCategory$1, t as ALL_CAPABILITY_DEFINITIONS, tn as parseJsonObject, tt as isObjectInput, ut as looseSchema } from "./dist-C5PkvU4p.mjs";
3
3
  import { AlertCenterAddon } from "./builtins/alerts/alerts.addon.mjs";
4
4
  import "./builtins/alerts/index.mjs";
5
5
  import { t as formatLogLine } from "./formatter-B7qW8bPJ.mjs";
@@ -26,7 +26,7 @@ import "./builtins/system-config/index.mjs";
26
26
  import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
27
27
  import { a as parseTokenizedUrl, c as collectModelFiles, d as downloadModel, f as ensureModel, h as isModelDownloaded, i as parseRangeHeader, l as deleteModelFromDisk, m as getModelFilePath, n as contentTypeFor, o as resolveFilePath, p as fetchJson, r as createAuthenticatedFileServer, s as ModelDownloadService, t as createFileDataPlaneHandler, u as downloadFile } from "./file-data-plane-BhKdxJgf.mjs";
28
28
  import { C as registerLanHttpHandler, S as readLanHttpState, _ as DEFAULT_LAN_HTTP_PORT, a as writeTlsMode, b as bindPendingLanHttp, c as loadTlsCert, d as collectCertIdentity, f as CA_VALIDITY_DAYS, g as evaluateExistingCert, h as SERVER_AUTH_OID, i as writeExtraSans, l as reissueTlsLeaf, m as MAX_LEAF_VALIDITY_DAYS, n as readTlsAccessStatus, o as validateUploadedTls, p as LEAF_RENEWAL_WINDOW_DAYS, r as readTlsMode, s as ensureTlsCert, t as readExtraSans, u as CA_COMMON_NAME, v as allFamiliesListenHost, x as closeLanHttp, y as applyLanHttp } from "./tls-DOTmtLCW.mjs";
29
- import { $ as buildUdsNativeCapProxy, $t as formatHeapSpaces, A as createUdsLoggerWithControl, At as HUB_MAIN_RSS_BUDGET_MB, B as readMoleculerFanoutMode, Bt as createV8Reclaimer, C as ipcParentLink, Ct as createAddonDataPlaneFacility, D as createUdsEventBus, Dt as HEAP_WATCH_INTERVAL_MS, E as createUdsEventBridge, Et as HEAP_RECLAIM_TRIGGER_MB, F as AGENT_CAP_FWD_SERVICE, Ft as RUNNER_RSS_BUDGET_ENV, G as createLocalTransport, Gt as reclaimIntervalMs, H as PARENT_ROUTED_PROVIDER_ADDON_ID, Ht as hubMainRssBudget, I as CapRouteResolver, It as ZERO_LOOP_DELAY, J as SocketChannel, Jt as startRunnerHeapWatch, K as UdsLocalTransportClient, Kt as shouldReclaim, L as CapRouteError, Lt as buildHeapSample, M as LocalChildRegistry, Mt as RSS_BUDGET_REANNOUNCE_MIN_MS, N as UDS_NO_ROUTE_PREFIX, Nt as RSS_BUDGET_RELEASE_RATIO, O as udsChildLogToWorkerEntry, Ot as HEAP_WATCH_WARN_RATIO, P as AGENT_CAP_FWD_ACTION, Pt as RUNNER_HEAP_WATCH_INTERVAL_MS, Q as buildNativeCapProxy, Qt as emitHeapDiagnosticReport, R as classifyCapRoute, Rt as createDeferredHeapWatchSink, S as buildLinkChain, St as runNpm, T as createParentUnownedCallHandler, Tt as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, U as __resetCapUsageRegistryForTests, Ut as nextRssBudgetState, V as CapUsageRegistry, Vt as describeRss, W as getCapUsageRegistry, Wt as parseRssBudgetMb, X as FrameDecoder, Xt as DECISIVE_HEAP_SPACES, Y as localEndpointPath, Yt as strandedMb, Z as encodeFrame, Zt as HEAP_SPACE_REPORT_MIN_MB, _ as AddonDepsManager, _n as createEventPlaneReader, _t as CapabilityUnavailableError, a as createUdsAddonContext, an as createSocketPlaneMeter, at as createAddonService, b as brokerCallForCap, bt as resolveAddonClass, c as getOrInitReadinessRegistryForClient, cn as formatSocketPlane, ct as capActionName, d as clusterEventTopic, dn as recordSocketFrame, dt as capServiceName, en as heapSpaceField, et as createBrokerDeviceManagerApi, f as getBrokerEventBus, fn as sampleSocketDirection, ft as parseCapAction, g as subscribePassthrough, gn as createEventPlaneMeter, gt as CapabilityHandle, h as setNodeEventInterest, hn as EVENT_PLANE_TOP_N, ht as DeviceRegistry, i as createAddonContext, in as SOCKET_PLANE_TOP_N, j as LocalChildClient, jt as HUB_RSS_BUDGET_ENV, k as createUdsLogger, kt as HUB_MAIN_HEAP_WATCH_LABEL, l as setHubConnected, ln as EMPTY_SOCKET_DIRECTION, lt as capActionSuffix, m as registerEventBusService, mn as socketDirectionMessages, mt as serializeTypedArrays, n as installManifestPythonDeps, nn as selectReportedSpaces, o as getWorkerDeviceRegistry, on as createSocketPlaneReader, ot as validateProviderRegistrations, p as getMoleculerEventStats, pn as socketDirectionBytes, pt as deserializeTypedArrays, q as UdsLocalTransportServer, qt as startHeapWatch, r as adaptBrokerToCluster, rn as EMPTY_SOCKET_PLANE_BASELINE, rt as mountNativeCapService, s as getOrInitReadinessRegistry, sn as diffSocketPlane, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestSystemDeps, tn as readHeapSpaces, u as EVENT_TOPIC_PREFIX, un as createSocketDirectionCounters, ut as capBareAction, v as createKernelHwAccel, vn as diffEventPlane, vt as copyBundledNativeModules, w as localProviderLink, wt as HEAP_RECLAIM_MIN_INTERVAL_MS, x as brokerTransportLink, xt as resolveNpmInvocation, y as resolveHwAccel, yn as formatEventPlane, yt as installManifestNativeDeps, z as callWithServiceDiscovery, zt as createLoopDelayMeter } from "./manifest-system-deps-BmXFnBQZ.mjs";
29
+ import { $ as buildUdsNativeCapProxy, $t as formatHeapSpaces, A as createUdsLoggerWithControl, At as HUB_MAIN_RSS_BUDGET_MB, B as readMoleculerFanoutMode, Bt as createV8Reclaimer, C as ipcParentLink, Ct as createAddonDataPlaneFacility, D as createUdsEventBus, Dt as HEAP_WATCH_INTERVAL_MS, E as createUdsEventBridge, Et as HEAP_RECLAIM_TRIGGER_MB, F as AGENT_CAP_FWD_SERVICE, Ft as RUNNER_RSS_BUDGET_ENV, G as createLocalTransport, Gt as reclaimIntervalMs, H as PARENT_ROUTED_PROVIDER_ADDON_ID, Ht as hubMainRssBudget, I as CapRouteResolver, It as ZERO_LOOP_DELAY, J as SocketChannel, Jt as startRunnerHeapWatch, K as UdsLocalTransportClient, Kt as shouldReclaim, L as CapRouteError, Lt as buildHeapSample, M as LocalChildRegistry, Mt as RSS_BUDGET_REANNOUNCE_MIN_MS, N as UDS_NO_ROUTE_PREFIX, Nt as RSS_BUDGET_RELEASE_RATIO, O as udsChildLogToWorkerEntry, Ot as HEAP_WATCH_WARN_RATIO, P as AGENT_CAP_FWD_ACTION, Pt as RUNNER_HEAP_WATCH_INTERVAL_MS, Q as buildNativeCapProxy, Qt as emitHeapDiagnosticReport, R as classifyCapRoute, Rt as createDeferredHeapWatchSink, S as buildLinkChain, St as runNpm, T as createParentUnownedCallHandler, Tt as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, U as __resetCapUsageRegistryForTests, Ut as nextRssBudgetState, V as CapUsageRegistry, Vt as describeRss, W as getCapUsageRegistry, Wt as parseRssBudgetMb, X as FrameDecoder, Xt as DECISIVE_HEAP_SPACES, Y as localEndpointPath, Yt as strandedMb, Z as encodeFrame, Zt as HEAP_SPACE_REPORT_MIN_MB, _ as AddonDepsManager, _n as createEventPlaneReader, _t as CapabilityUnavailableError, a as createUdsAddonContext, an as createSocketPlaneMeter, at as createAddonService, b as brokerCallForCap, bt as resolveAddonClass, c as getOrInitReadinessRegistryForClient, cn as formatSocketPlane, ct as capActionName, d as clusterEventTopic, dn as recordSocketFrame, dt as capServiceName, en as heapSpaceField, et as createBrokerDeviceManagerApi, f as getBrokerEventBus, fn as sampleSocketDirection, ft as parseCapAction, g as subscribePassthrough, gn as createEventPlaneMeter, gt as CapabilityHandle, h as setNodeEventInterest, hn as EVENT_PLANE_TOP_N, ht as DeviceRegistry, i as createAddonContext, in as SOCKET_PLANE_TOP_N, j as LocalChildClient, jt as HUB_RSS_BUDGET_ENV, k as createUdsLogger, kt as HUB_MAIN_HEAP_WATCH_LABEL, l as setHubConnected, ln as EMPTY_SOCKET_DIRECTION, lt as capActionSuffix, m as registerEventBusService, mn as socketDirectionMessages, mt as serializeTypedArrays, n as installManifestPythonDeps, nn as selectReportedSpaces, o as getWorkerDeviceRegistry, on as createSocketPlaneReader, ot as validateProviderRegistrations, p as getMoleculerEventStats, pn as socketDirectionBytes, pt as deserializeTypedArrays, q as UdsLocalTransportServer, qt as startHeapWatch, r as adaptBrokerToCluster, rn as EMPTY_SOCKET_PLANE_BASELINE, rt as mountNativeCapService, s as getOrInitReadinessRegistry, sn as diffSocketPlane, st as NATIVE_PROVIDER_SERVICE_INFIX, t as installManifestSystemDeps, tn as readHeapSpaces, u as EVENT_TOPIC_PREFIX, un as createSocketDirectionCounters, ut as capBareAction, v as createKernelHwAccel, vn as diffEventPlane, vt as copyBundledNativeModules, w as localProviderLink, wt as HEAP_RECLAIM_MIN_INTERVAL_MS, x as brokerTransportLink, xt as resolveNpmInvocation, y as resolveHwAccel, yn as formatEventPlane, yt as installManifestNativeDeps, z as callWithServiceDiscovery, zt as createLoopDelayMeter } from "./manifest-system-deps-BF-C5NDL.mjs";
30
30
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-BWmQ5i-o.mjs";
31
31
  import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
32
32
  import { z } from "zod";
@@ -1,4 +1,3 @@
1
- import "./dist-CCMYMmkQ.mjs";
2
1
  import "./hub-cap-forward-BdT320dq.mjs";
3
2
  import * as crypto$1 from "node:crypto";
4
3
  import { randomBytes, randomUUID } from "node:crypto";
@@ -16,7 +15,7 @@ import { createServer } from "node:http";
16
15
  import * as v8 from "node:v8";
17
16
  import { monitorEventLoopDelay } from "node:perf_hooks";
18
17
  import * as vm from "node:vm";
19
- import { BOOT_RECOVERY_BACKOFF_MS, DATAPLANE_SECRET_HEADER, DeviceType, DisposerChain, EventCategory, ReadinessRegistry, asJsonObject, asString, createDeviceProxy, createEventBusSliceSource, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, readNodePin, scopeKey, sleep, withCapInputDefaults } from "@camstack/types/addon";
18
+ import { BOOT_RECOVERY_BACKOFF_MS, DATAPLANE_SECRET_HEADER, DEVICE_CHILDREN_BATCH_MAX, DeviceType, DisposerChain, EventCategory, ReadinessRegistry, asJsonObject, asString, createDeviceProxy, createEventBusSliceSource, deviceOpsCapability, emitReadiness, errMsg, expandCapMethods, readNodePin, scopeKey, sleep, withCapInputDefaults } from "@camstack/types/addon";
20
19
  import { connect, createConnection, createServer as createServer$1 } from "node:net";
21
20
  import { TRPCClientError, createTRPCClient } from "@trpc/client";
22
21
  //#region src/kernel/event-plane-report.ts
@@ -2627,58 +2626,6 @@ async function readModifyWrite(input) {
2627
2626
  //#endregion
2628
2627
  //#region src/kernel/moleculer/children-batch-loader.ts
2629
2628
  /**
2630
- * "Who are my children?" asked by a thousand devices, answered in a handful of
2631
- * calls.
2632
- *
2633
- * ## The number
2634
- *
2635
- * Every `BaseDevice` inherits a `getAccessoryChildren()` that returns `[]`, so
2636
- * the accessory reconcile in `device-cap-proxy.ts` runs its orphan-prune step
2637
- * for EVERY registered device — including the leaf accessories that can never
2638
- * own one. Each pass asked `device-manager.getChildren` for its own id.
2639
- * Measured on the live hub 2026-08-27, 120-second boot window, 1 017 devices:
2640
- * **1 024 calls returning 919 rows in total**. A thousand round-trips, and a
2641
- * thousand indexed scans behind them, to move less than one row each.
2642
- *
2643
- * ## Why a loader and not a caller that loops
2644
- *
2645
- * There is no loop to unroll. Reconcile is per-device by construction: it runs
2646
- * inside `register()`, and again whenever a late feature-probe writes the
2647
- * slice. The repetition is a THOUSAND INDEPENDENT CALLERS, not one caller
2648
- * asking a thousand times — so the collapse has to happen between them.
2649
- *
2650
- * ## Why the batch is self-clocking, with no window to tune
2651
- *
2652
- * At most ONE batch call is in flight. Anything that arrives while it is in
2653
- * flight lands in the next batch, dispatched the moment the current one
2654
- * settles. That makes the batch size adapt to the arrival rate on its own:
2655
- *
2656
- * - Idle: the first caller flushes on the next macrotask. No added wait, and
2657
- * no timer to pick a value for and be wrong about.
2658
- * - Boot: `BaseDeviceProvider.onRestoreDevices` issues every top-level
2659
- * `create()` at once and `runBounded(specs, 12)` spawns accessory children
2660
- * twelve wide, so reconciles arrive in bursts — measured as 2 372 device
2661
- * log lines in one 5-second bucket at boot+16s, against 62 at boot+142s.
2662
- * Every arrival inside one round-trip collapses into the next call.
2663
- * - Worst case: arrivals slower than a round-trip give batches of one, which
2664
- * is exactly today's cost. The loader can never be worse than what it
2665
- * replaces.
2666
- *
2667
- * A fixed debounce window would have to be guessed against that distribution,
2668
- * and would tax the idle case to pay for the busy one.
2669
- *
2670
- * ## Degrading, rather than breaking, against an older hub
2671
- *
2672
- * `getChildrenBatch` is a NEW method: a hub that predates it rejects the call
2673
- * (it does not silently strip the input and answer a different question, which
2674
- * is what adding a `parentDeviceIds` FIELD to `getChildren` would have done).
2675
- * Every waiter in a failed batch is then answered by the per-parent
2676
- * `getChildren` it would have used anyway, so the reconcile is never denied
2677
- * its answer. A rejection that names the method as unknown latches the
2678
- * fallback permanently — re-probing a method the hub will never have, once per
2679
- * batch for a whole boot, is the storm this exists to remove.
2680
- */
2681
- /**
2682
2629
  * Narrow an untyped cap answer to the fields the reconcile reads.
2683
2630
  *
2684
2631
  * `callDeviceManager` is an untyped boundary, and the answer may come from a
@@ -2737,7 +2684,7 @@ function looksLikeUnknownMethod(err) {
2737
2684
  return lowered.includes("not_found") || lowered.includes("no procedure") || lowered.includes("unknown method") || lowered.includes("no such method") || lowered.includes("not available");
2738
2685
  }
2739
2686
  function createChildrenBatchLoader(opts) {
2740
- const maxBatch = Math.max(1, opts.maxBatch ?? 256);
2687
+ const maxBatch = Math.max(1, opts.maxBatch ?? DEVICE_CHILDREN_BATCH_MAX);
2741
2688
  let pending = [];
2742
2689
  let flushScheduled = false;
2743
2690
  let flushing = false;
@@ -1,5 +1,4 @@
1
1
  const require_chunk = require("./chunk-Cek0wNdY.js");
2
- require("./dist-DE3OH-FG.js");
3
2
  require("./hub-cap-forward-DmHNjbB0.js");
4
3
  let node_crypto = require("node:crypto");
5
4
  node_crypto = require_chunk.__toESM(node_crypto);
@@ -2630,58 +2629,6 @@ async function readModifyWrite(input) {
2630
2629
  //#endregion
2631
2630
  //#region src/kernel/moleculer/children-batch-loader.ts
2632
2631
  /**
2633
- * "Who are my children?" asked by a thousand devices, answered in a handful of
2634
- * calls.
2635
- *
2636
- * ## The number
2637
- *
2638
- * Every `BaseDevice` inherits a `getAccessoryChildren()` that returns `[]`, so
2639
- * the accessory reconcile in `device-cap-proxy.ts` runs its orphan-prune step
2640
- * for EVERY registered device — including the leaf accessories that can never
2641
- * own one. Each pass asked `device-manager.getChildren` for its own id.
2642
- * Measured on the live hub 2026-08-27, 120-second boot window, 1 017 devices:
2643
- * **1 024 calls returning 919 rows in total**. A thousand round-trips, and a
2644
- * thousand indexed scans behind them, to move less than one row each.
2645
- *
2646
- * ## Why a loader and not a caller that loops
2647
- *
2648
- * There is no loop to unroll. Reconcile is per-device by construction: it runs
2649
- * inside `register()`, and again whenever a late feature-probe writes the
2650
- * slice. The repetition is a THOUSAND INDEPENDENT CALLERS, not one caller
2651
- * asking a thousand times — so the collapse has to happen between them.
2652
- *
2653
- * ## Why the batch is self-clocking, with no window to tune
2654
- *
2655
- * At most ONE batch call is in flight. Anything that arrives while it is in
2656
- * flight lands in the next batch, dispatched the moment the current one
2657
- * settles. That makes the batch size adapt to the arrival rate on its own:
2658
- *
2659
- * - Idle: the first caller flushes on the next macrotask. No added wait, and
2660
- * no timer to pick a value for and be wrong about.
2661
- * - Boot: `BaseDeviceProvider.onRestoreDevices` issues every top-level
2662
- * `create()` at once and `runBounded(specs, 12)` spawns accessory children
2663
- * twelve wide, so reconciles arrive in bursts — measured as 2 372 device
2664
- * log lines in one 5-second bucket at boot+16s, against 62 at boot+142s.
2665
- * Every arrival inside one round-trip collapses into the next call.
2666
- * - Worst case: arrivals slower than a round-trip give batches of one, which
2667
- * is exactly today's cost. The loader can never be worse than what it
2668
- * replaces.
2669
- *
2670
- * A fixed debounce window would have to be guessed against that distribution,
2671
- * and would tax the idle case to pay for the busy one.
2672
- *
2673
- * ## Degrading, rather than breaking, against an older hub
2674
- *
2675
- * `getChildrenBatch` is a NEW method: a hub that predates it rejects the call
2676
- * (it does not silently strip the input and answer a different question, which
2677
- * is what adding a `parentDeviceIds` FIELD to `getChildren` would have done).
2678
- * Every waiter in a failed batch is then answered by the per-parent
2679
- * `getChildren` it would have used anyway, so the reconcile is never denied
2680
- * its answer. A rejection that names the method as unknown latches the
2681
- * fallback permanently — re-probing a method the hub will never have, once per
2682
- * batch for a whole boot, is the storm this exists to remove.
2683
- */
2684
- /**
2685
2632
  * Narrow an untyped cap answer to the fields the reconcile reads.
2686
2633
  *
2687
2634
  * `callDeviceManager` is an untyped boundary, and the answer may come from a
@@ -2740,7 +2687,7 @@ function looksLikeUnknownMethod(err) {
2740
2687
  return lowered.includes("not_found") || lowered.includes("no procedure") || lowered.includes("unknown method") || lowered.includes("no such method") || lowered.includes("not available");
2741
2688
  }
2742
2689
  function createChildrenBatchLoader(opts) {
2743
- const maxBatch = Math.max(1, opts.maxBatch ?? 256);
2690
+ const maxBatch = Math.max(1, opts.maxBatch ?? _camstack_types_addon.DEVICE_CHILDREN_BATCH_MAX);
2744
2691
  let pending = [];
2745
2692
  let flushScheduled = false;
2746
2693
  let flushing = false;
@@ -1,4 +1,4 @@
1
- import { Gt as asJsonObject } from "./dist-CCMYMmkQ.mjs";
1
+ import { Gt as asJsonObject } from "./dist-C5PkvU4p.mjs";
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
@@ -1,4 +1,4 @@
1
- const require_dist = require("./dist-DE3OH-FG.js");
1
+ const require_dist = require("./dist-DNwhsXWi.js");
2
2
  //#region src/builtins/sqlite-storage/retired-settings-keys.ts
3
3
  /**
4
4
  * Is THIS node the one whose settings store is the cluster's authority?
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/system",
3
- "version": "1.2.185",
3
+ "version": "1.2.187",
4
4
  "description": "Core addon for CamStack — builtins, pipeline, process management, auth, logging, events",
5
5
  "keywords": [
6
6
  "camstack",