@camstack/system 1.2.159 → 1.2.160

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 (70) 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.d.ts +10 -7
  10. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.js +50 -12
  11. package/dist/builtins/backup-orchestrator/backup-orchestrator.addon.mjs +50 -12
  12. package/dist/builtins/backup-orchestrator/write-targets.d.ts +63 -0
  13. package/dist/builtins/console-logging/index.js +1 -1
  14. package/dist/builtins/console-logging/index.mjs +1 -1
  15. package/dist/builtins/core-blocks/core-blocks.addon.js +1 -1
  16. package/dist/builtins/core-blocks/core-blocks.addon.mjs +1 -1
  17. package/dist/builtins/device-manager/device-bindings-store.d.ts +56 -10
  18. package/dist/builtins/device-manager/device-manager.addon.d.ts +11 -0
  19. package/dist/builtins/device-manager/device-manager.addon.js +216 -81
  20. package/dist/builtins/device-manager/device-manager.addon.mjs +216 -81
  21. package/dist/builtins/device-manager/device-meta-actions.d.ts +9 -3
  22. package/dist/builtins/device-manager/device-meta-store.d.ts +32 -5
  23. package/dist/builtins/device-manager/device-queries.d.ts +7 -3
  24. package/dist/builtins/device-manager/write-lock.d.ts +17 -0
  25. package/dist/builtins/doorbell/virtual-doorbell.addon.js +1 -1
  26. package/dist/builtins/doorbell/virtual-doorbell.addon.mjs +1 -1
  27. package/dist/builtins/hub-forwarder/index.js +1 -1
  28. package/dist/builtins/hub-forwarder/index.mjs +1 -1
  29. package/dist/builtins/liveness-monitor/liveness-monitor.addon.js +1 -1
  30. package/dist/builtins/liveness-monitor/liveness-monitor.addon.mjs +1 -1
  31. package/dist/builtins/local-auth/local-auth.addon.js +1 -1
  32. package/dist/builtins/local-auth/local-auth.addon.mjs +1 -1
  33. package/dist/builtins/local-network/local-network.addon.js +1 -1
  34. package/dist/builtins/local-network/local-network.addon.mjs +1 -1
  35. package/dist/builtins/loki-logging/index.js +1 -1
  36. package/dist/builtins/loki-logging/index.mjs +1 -1
  37. package/dist/builtins/native-metrics/native-metrics.addon.js +1 -1
  38. package/dist/builtins/native-metrics/native-metrics.addon.mjs +1 -1
  39. package/dist/builtins/platform-probe/index.js +1 -1
  40. package/dist/builtins/platform-probe/index.mjs +1 -1
  41. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +1 -1
  42. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +1 -1
  43. package/dist/builtins/snapshot/index.js +1 -1
  44. package/dist/builtins/snapshot/index.mjs +1 -1
  45. package/dist/builtins/sqlite-storage/filesystem-storage.addon.js +1 -1
  46. package/dist/builtins/sqlite-storage/filesystem-storage.addon.mjs +1 -1
  47. package/dist/builtins/sqlite-storage/filter-compiler.d.ts +41 -2
  48. package/dist/builtins/sqlite-storage/sqlite-settings-backend.d.ts +15 -7
  49. package/dist/builtins/sqlite-storage/sqlite-settings.addon.js +0 -0
  50. package/dist/builtins/sqlite-storage/sqlite-settings.addon.mjs +0 -0
  51. package/dist/builtins/storage-orchestrator/storage-migration-coordinator.d.ts +3 -2
  52. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.js +63 -8
  53. package/dist/builtins/storage-orchestrator/storage-orchestrator.addon.mjs +63 -8
  54. package/dist/builtins/storage-orchestrator/storage-orchestrator.service.d.ts +19 -0
  55. package/dist/builtins/system-config/system-config.addon.js +1 -1
  56. package/dist/builtins/system-config/system-config.addon.mjs +1 -1
  57. package/dist/builtins/winston-logging/index.js +1 -1
  58. package/dist/builtins/winston-logging/index.mjs +1 -1
  59. package/dist/{dist-Ck2jkBZk.js → dist-CcvXUhHK.js} +74 -7
  60. package/dist/{dist-DLh4_rn3.mjs → dist-DKs---Vx.mjs} +74 -7
  61. package/dist/index.js +3 -2
  62. package/dist/index.mjs +3 -3
  63. package/dist/kernel/index.d.ts +2 -2
  64. package/dist/kernel/moleculer/cap-usage-registry.d.ts +132 -7
  65. package/dist/kernel/transport/local-child-registry.d.ts +57 -0
  66. package/dist/{manifest-system-deps-tZZYG3RR.mjs → manifest-system-deps-DnoPpLGp.mjs} +271 -77
  67. package/dist/{manifest-system-deps-8boi90D9.js → manifest-system-deps-oJMkWSX-.js} +276 -76
  68. package/dist/{retired-settings-keys-Bi0ZKBjb.mjs → retired-settings-keys-C3eONTvV.mjs} +1 -1
  69. package/dist/{retired-settings-keys-Dp_CyuCW.js → retired-settings-keys-DXZ2xe7C.js} +1 -1
  70. package/package.json +1 -1
@@ -183,6 +183,25 @@ export declare class StorageOrchestratorService {
183
183
  * `__tests__/storage-orchestrator-persistence.spec.ts`.
184
184
  */
185
185
  attachStore(store: ILocationStore): Promise<void>;
186
+ /**
187
+ * Shout about a persisted row that is BOTH the type default and disabled.
188
+ *
189
+ * `upsertLocation` cannot produce this (`resolveEnabled` force-enables a
190
+ * default) and neither can `setDefaultLocations` — but hydrate writes rows
191
+ * straight into the map without either, so a hand-edited store, a partial
192
+ * migration or a row written by another build can. It matters because every
193
+ * bare-type ref resolves through {@link getDefaultLocation}: on such a row
194
+ * `storage.write({ location: 'eventMedia' })` and the migration coordinator's
195
+ * drain destination both point at a disk the operator turned off. That is the
196
+ * one thing this model must never do silently.
197
+ *
198
+ * Reported, never repaired: flipping an operator's flag back on at boot would
199
+ * be the system overruling the switch instead of obeying it. The coordinator
200
+ * refuses the drain (`storage-migration-coordinator.drain`); the bare-ref read
201
+ * path is deliberately left working, because narrowing a READ is a worse bug
202
+ * than the one this line reports.
203
+ */
204
+ private reportDisabledDefaults;
186
205
  /**
187
206
  * Inject the declaration-driven cardinality source. Called once by the
188
207
  * addon after the kernel aggregates every addon's `storageLocations`
@@ -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-Ck2jkBZk.js");
6
+ const require_dist = require("../../dist-CcvXUhHK.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 { Mt as BaseAddon, Yt as hydrateSchema, jt as errMsg } from "../../dist-DLh4_rn3.mjs";
1
+ import { Mt as BaseAddon, Yt as hydrateSchema, jt as errMsg } from "../../dist-DKs---Vx.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-Ck2jkBZk.js");
6
+ const require_dist = require("../../dist-CcvXUhHK.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 { Mt as BaseAddon, ot as logDestinationCapability } from "../../dist-DLh4_rn3.mjs";
1
+ import { Mt as BaseAddon, ot as logDestinationCapability } from "../../dist-DKs---Vx.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";
@@ -4177,6 +4177,21 @@ var RelocateJobSchema = zod.z.object({
4177
4177
  bytesMoved: zod.z.number().int(),
4178
4178
  /** Total files discovered up front; null while (or when) unknown. */
4179
4179
  filesTotal: zod.z.number().int().nullable(),
4180
+ /**
4181
+ * Rows this run CORRECTED while moving them — a durable mutation the move
4182
+ * made that nobody asked for, so it is reported where the operator reads the
4183
+ * job rather than only in a log line.
4184
+ *
4185
+ * A footage segment records its byte count in its own NAME, and the durable
4186
+ * hour row derives its aggregates from those names. A file that does not
4187
+ * match its name therefore makes the ledger's sums — and with them quota and
4188
+ * pressure eviction — wrong by the difference, and only a rename can fix it.
4189
+ * On 2026-08-30 one such row also stalled a 110 749-file drain permanently.
4190
+ *
4191
+ * Absent on lanes where the question has no meaning: a media blob's size is
4192
+ * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
4193
+ */
4194
+ rowsReconciled: zod.z.number().int().nonnegative().optional(),
4180
4195
  startedAt: zod.z.number(),
4181
4196
  finishedAt: zod.z.number().nullable(),
4182
4197
  error: zod.z.string().nullable()
@@ -4245,14 +4260,42 @@ var RelocateMediaInputSchema = zod.z.object({
4245
4260
  /** Omitted = `move`, the pre-existing behaviour. */
4246
4261
  mode: MediaRelocateModeSchema.optional()
4247
4262
  });
4248
- /** How many rows still carry NO `locationId` — the population a repoint would
4249
- * silently re-aim at a disk that does not hold their bytes. Zero is the only
4250
- * value that permits a non-blocking `eventMedia` cutover. */
4251
- var UnstampedEventMediaCountSchema = zod.z.object({
4252
- media: zod.z.number().int().nonnegative(),
4253
- retrainFrames: zod.z.number().int().nonnegative(),
4254
- total: zod.z.number().int().nonnegative()
4263
+ /**
4264
+ * The unstamped population of ONE collection split, because the gate and the
4265
+ * operator ask two different questions and only one of them has to be cheap.
4266
+ *
4267
+ * `present` is the GATE: "is there at least one row that would be orphaned by a
4268
+ * repoint". It is a single indexed seek to the first matching row, so it stays
4269
+ * answerable on a saturated disk and answers in O(log n) precisely in the state
4270
+ * that matters — after a seal, when the population is empty.
4271
+ *
4272
+ * `rows` is the NUMBER, for the refusal message and the operator's sense of
4273
+ * scale. It is a second, indexed `COUNT(*)`, and `null` means **not
4274
+ * measurable** — never zero. `{ present: true, rows: null }` is a legitimate
4275
+ * and useful answer: "there are some, and this read could not say how many"
4276
+ * still refuses the cutover, which is the whole job.
4277
+ */
4278
+ var UnstampedRowsSchema = zod.z.object({
4279
+ present: zod.z.boolean(),
4280
+ rows: zod.z.number().int().nonnegative().nullable()
4255
4281
  });
4282
+ /**
4283
+ * How many rows still carry NO `locationId` — the population a repoint would
4284
+ * silently re-aim at a disk that does not hold their bytes.
4285
+ *
4286
+ * **`null` = the count could not be taken**, and it is NOT permission to cut
4287
+ * over. The gate opens on a measured absence and on nothing else; an unread
4288
+ * collection and an empty one are different facts, and this repo has already
4289
+ * paid for conflating them (`RelocateResidueSchema`, D295).
4290
+ */
4291
+ var UnstampedEventMediaCountSchema = zod.z.object({
4292
+ media: UnstampedRowsSchema,
4293
+ retrainFrames: UnstampedRowsSchema,
4294
+ /** True when EITHER collection holds one. The refusal reads this. */
4295
+ anyPresent: zod.z.boolean(),
4296
+ /** Sum across both, or `null` when either lane could not be counted. */
4297
+ total: zod.z.number().int().nonnegative().nullable()
4298
+ }).nullable();
4256
4299
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: zod.z.string().min(1) });
4257
4300
  /** The independently selectable logical storage classes — every class
4258
4301
  * `storage.listLocationDeclarations` reports, so an operator never meets a
@@ -4363,6 +4406,10 @@ var StorageMigrationMoveProgressSchema = zod.z.object({
4363
4406
  /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
4364
4407
  filesTotal: zod.z.number().int().nonnegative().nullable(),
4365
4408
  bytesMoved: zod.z.number().int().nonnegative(),
4409
+ /** Rows the mover corrected while moving them — see `RelocateJob`. Absent on
4410
+ * a lane that cannot reconcile. A migration that silently rewrote durable
4411
+ * rows would be the same failure as one that silently skipped them. */
4412
+ rowsReconciled: zod.z.number().int().nonnegative().optional(),
4366
4413
  /** The MOVER's start, not the migration's: a drain restarted after an addon
4367
4414
  * crash gets a new mover, and a rate computed from the migration's start
4368
4415
  * would silently average in the time nothing was running. */
@@ -10811,6 +10858,15 @@ var deviceManagerCapability = {
10811
10858
  * calls are sync. Bindings change rarely (only on wrapper toggle or
10812
10859
  * device add/remove) — clients invalidate via the
10813
10860
  * `capability.binding-changed` event.
10861
+ *
10862
+ * "A single round-trip" describes the CLIENT's side and used not to
10863
+ * describe the server's: until 2026-08-30 the resolver read the persisted
10864
+ * wrapper activations once per device, so answering this cost one
10865
+ * settings-door RPC per device — 1 020 on the live 1 019-device hub, and
10866
+ * it did not return in 240 s against `SystemMirror.init`'s 15 s budget.
10867
+ * The server side is now two reads for the whole fleet. Anything PERIODIC
10868
+ * still belongs on `getBindings` / `getBindingsBatch` (D12); this remains
10869
+ * a warm seed.
10814
10870
  */
10815
10871
  getAllBindings: method(zod.z.object({}), zod.z.array(DeviceBindingsForDeviceSchema)),
10816
10872
  /**
@@ -18229,6 +18285,17 @@ var pipelineAnalyticsCapability = {
18229
18285
  * happens to stamp it. This count is what the migration planner's
18230
18286
  * non-blocking gate reads; `relocateMedia({ mode: 'seal' })` is what drives
18231
18287
  * it to zero.
18288
+ *
18289
+ * TWO indexed statements per collection, not a walk. It used to page the
18290
+ * whole collection at 200 rows per RPC ordered by an unindexed column, so
18291
+ * on the live hub — 1 254 576 rows — it hit the 60 s RPC deadline every
18292
+ * time it was called, and the migration it gates could never start. The
18293
+ * cheap question (`present`: is there at least one) is asked first and
18294
+ * separately from the expensive one (`rows`), because only the first has
18295
+ * to be answerable for the gate to do its job.
18296
+ *
18297
+ * **`null` is "not measurable", never zero** — at either level. An
18298
+ * unreadable collection must not read as a sealed one.
18232
18299
  */
18233
18300
  countUnstampedEventMedia: method(zod.z.object({}), UnstampedEventMediaCountSchema, { auth: "admin" }),
18234
18301
  /**
@@ -4177,6 +4177,21 @@ var RelocateJobSchema = z.object({
4177
4177
  bytesMoved: z.number().int(),
4178
4178
  /** Total files discovered up front; null while (or when) unknown. */
4179
4179
  filesTotal: z.number().int().nullable(),
4180
+ /**
4181
+ * Rows this run CORRECTED while moving them — a durable mutation the move
4182
+ * made that nobody asked for, so it is reported where the operator reads the
4183
+ * job rather than only in a log line.
4184
+ *
4185
+ * A footage segment records its byte count in its own NAME, and the durable
4186
+ * hour row derives its aggregates from those names. A file that does not
4187
+ * match its name therefore makes the ledger's sums — and with them quota and
4188
+ * pressure eviction — wrong by the difference, and only a rename can fix it.
4189
+ * On 2026-08-30 one such row also stalled a 110 749-file drain permanently.
4190
+ *
4191
+ * Absent on lanes where the question has no meaning: a media blob's size is
4192
+ * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
4193
+ */
4194
+ rowsReconciled: z.number().int().nonnegative().optional(),
4180
4195
  startedAt: z.number(),
4181
4196
  finishedAt: z.number().nullable(),
4182
4197
  error: z.string().nullable()
@@ -4245,14 +4260,42 @@ var RelocateMediaInputSchema = z.object({
4245
4260
  /** Omitted = `move`, the pre-existing behaviour. */
4246
4261
  mode: MediaRelocateModeSchema.optional()
4247
4262
  });
4248
- /** How many rows still carry NO `locationId` — the population a repoint would
4249
- * silently re-aim at a disk that does not hold their bytes. Zero is the only
4250
- * value that permits a non-blocking `eventMedia` cutover. */
4251
- var UnstampedEventMediaCountSchema = z.object({
4252
- media: z.number().int().nonnegative(),
4253
- retrainFrames: z.number().int().nonnegative(),
4254
- total: z.number().int().nonnegative()
4263
+ /**
4264
+ * The unstamped population of ONE collection split, because the gate and the
4265
+ * operator ask two different questions and only one of them has to be cheap.
4266
+ *
4267
+ * `present` is the GATE: "is there at least one row that would be orphaned by a
4268
+ * repoint". It is a single indexed seek to the first matching row, so it stays
4269
+ * answerable on a saturated disk and answers in O(log n) precisely in the state
4270
+ * that matters — after a seal, when the population is empty.
4271
+ *
4272
+ * `rows` is the NUMBER, for the refusal message and the operator's sense of
4273
+ * scale. It is a second, indexed `COUNT(*)`, and `null` means **not
4274
+ * measurable** — never zero. `{ present: true, rows: null }` is a legitimate
4275
+ * and useful answer: "there are some, and this read could not say how many"
4276
+ * still refuses the cutover, which is the whole job.
4277
+ */
4278
+ var UnstampedRowsSchema = z.object({
4279
+ present: z.boolean(),
4280
+ rows: z.number().int().nonnegative().nullable()
4255
4281
  });
4282
+ /**
4283
+ * How many rows still carry NO `locationId` — the population a repoint would
4284
+ * silently re-aim at a disk that does not hold their bytes.
4285
+ *
4286
+ * **`null` = the count could not be taken**, and it is NOT permission to cut
4287
+ * over. The gate opens on a measured absence and on nothing else; an unread
4288
+ * collection and an empty one are different facts, and this repo has already
4289
+ * paid for conflating them (`RelocateResidueSchema`, D295).
4290
+ */
4291
+ var UnstampedEventMediaCountSchema = z.object({
4292
+ media: UnstampedRowsSchema,
4293
+ retrainFrames: UnstampedRowsSchema,
4294
+ /** True when EITHER collection holds one. The refusal reads this. */
4295
+ anyPresent: z.boolean(),
4296
+ /** Sum across both, or `null` when either lane could not be counted. */
4297
+ total: z.number().int().nonnegative().nullable()
4298
+ }).nullable();
4256
4299
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: z.string().min(1) });
4257
4300
  /** The independently selectable logical storage classes — every class
4258
4301
  * `storage.listLocationDeclarations` reports, so an operator never meets a
@@ -4363,6 +4406,10 @@ var StorageMigrationMoveProgressSchema = z.object({
4363
4406
  /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
4364
4407
  filesTotal: z.number().int().nonnegative().nullable(),
4365
4408
  bytesMoved: z.number().int().nonnegative(),
4409
+ /** Rows the mover corrected while moving them — see `RelocateJob`. Absent on
4410
+ * a lane that cannot reconcile. A migration that silently rewrote durable
4411
+ * rows would be the same failure as one that silently skipped them. */
4412
+ rowsReconciled: z.number().int().nonnegative().optional(),
4366
4413
  /** The MOVER's start, not the migration's: a drain restarted after an addon
4367
4414
  * crash gets a new mover, and a rate computed from the migration's start
4368
4415
  * would silently average in the time nothing was running. */
@@ -10811,6 +10858,15 @@ var deviceManagerCapability = {
10811
10858
  * calls are sync. Bindings change rarely (only on wrapper toggle or
10812
10859
  * device add/remove) — clients invalidate via the
10813
10860
  * `capability.binding-changed` event.
10861
+ *
10862
+ * "A single round-trip" describes the CLIENT's side and used not to
10863
+ * describe the server's: until 2026-08-30 the resolver read the persisted
10864
+ * wrapper activations once per device, so answering this cost one
10865
+ * settings-door RPC per device — 1 020 on the live 1 019-device hub, and
10866
+ * it did not return in 240 s against `SystemMirror.init`'s 15 s budget.
10867
+ * The server side is now two reads for the whole fleet. Anything PERIODIC
10868
+ * still belongs on `getBindings` / `getBindingsBatch` (D12); this remains
10869
+ * a warm seed.
10814
10870
  */
10815
10871
  getAllBindings: method(z.object({}), z.array(DeviceBindingsForDeviceSchema)),
10816
10872
  /**
@@ -18229,6 +18285,17 @@ var pipelineAnalyticsCapability = {
18229
18285
  * happens to stamp it. This count is what the migration planner's
18230
18286
  * non-blocking gate reads; `relocateMedia({ mode: 'seal' })` is what drives
18231
18287
  * it to zero.
18288
+ *
18289
+ * TWO indexed statements per collection, not a walk. It used to page the
18290
+ * whole collection at 200 rows per RPC ordered by an unindexed column, so
18291
+ * on the live hub — 1 254 576 rows — it hit the 60 s RPC deadline every
18292
+ * time it was called, and the migration it gates could never start. The
18293
+ * cheap question (`present`: is there at least one) is asked first and
18294
+ * separately from the expensive one (`rows`), because only the first has
18295
+ * to be answerable for the gate to do its job.
18296
+ *
18297
+ * **`null` is "not measurable", never zero** — at either level. An
18298
+ * unreadable collection must not read as a sealed one.
18232
18299
  */
18233
18300
  countUnstampedEventMedia: method(z.object({}), UnstampedEventMediaCountSchema, { auth: "admin" }),
18234
18301
  /**
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-Ck2jkBZk.js");
3
+ const require_dist = require("./dist-CcvXUhHK.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");
@@ -26,7 +26,7 @@ require("./builtins/system-config/index.js");
26
26
  const require_builtins_winston_logging_index = require("./builtins/winston-logging/index.js");
27
27
  const require_file_data_plane = require("./file-data-plane-DO8KbxCe.js");
28
28
  const require_tls$1 = require("./tls-BxQlomxd.js");
29
- const require_manifest_system_deps = require("./manifest-system-deps-8boi90D9.js");
29
+ const require_manifest_system_deps = require("./manifest-system-deps-oJMkWSX-.js");
30
30
  const require_resource_monitor = require("./resource-monitor-CdnzxBLP.js");
31
31
  const require_custom_action_registry = require("./custom-action-registry-jY0NOZK8.js");
32
32
  let zod = require("zod");
@@ -95437,6 +95437,7 @@ exports.NativeMetricsAddon = require_builtins_native_metrics_native_metrics_addo
95437
95437
  exports.NativeMetricsProvider = require_builtins_native_metrics_native_metrics_addon.NativeMetricsProvider;
95438
95438
  exports.NetworkQualityTracker = NetworkQualityTracker;
95439
95439
  exports.NotificationService = NotificationService;
95440
+ exports.PARENT_ROUTED_PROVIDER_ADDON_ID = require_manifest_system_deps.PARENT_ROUTED_PROVIDER_ADDON_ID;
95440
95441
  Object.defineProperty(exports, "PYTHON_VERSION", {
95441
95442
  enumerable: true,
95442
95443
  get: function() {
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 isObjectInput, $t as parseJsonUnknown$1, Bt as ReadinessTimeoutError, Ft as DEVICE_STATUS_METHOD, Gt as createEvent, Ht as asJsonObject$1, J as extractNestedAddonId, Jt as expandCapMethods, Kt as emitDownForOwnedCaps, Nt as DATAPLANE_SECRET_HEADER$1, Pt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Q as isCollectionArrayMethod, Qt as parseJsonObject, T as addonSettingsCapability, Ut as asNumber, Wt as asString$1, Z as isArrayOutputSchema, _t as resolveMethodAuth, bt as scopesAllowDeviceCap, ct as looseSchema, dt as objectInputDeclaresAddonId, en as readinessKey, f as LOG_LEVEL_RANK, h as RUNTIME_DEFAULTS, in as EventCategory$1, it as lifecycleJobSchema, jt as errMsg$1, mt as procedureAuthKey, nn as scopeKey, nt as isVoidInput, p as METHOD_ACCESS_MAP, rt as kebabToCamel, st as logLevelAtMost, t as ALL_CAPABILITY_DEFINITIONS, tn as resolveCapMount, yt as scopesAllowAddon, zt as ReadinessRegistry } from "./dist-DLh4_rn3.mjs";
2
+ import { $ as isObjectInput, $t as parseJsonUnknown$1, Bt as ReadinessTimeoutError, Ft as DEVICE_STATUS_METHOD, Gt as createEvent, Ht as asJsonObject$1, J as extractNestedAddonId, Jt as expandCapMethods, Kt as emitDownForOwnedCaps, Nt as DATAPLANE_SECRET_HEADER$1, Pt as DEVICE_SETTINGS_CONTRIBUTION_METHODS, Q as isCollectionArrayMethod, Qt as parseJsonObject, T as addonSettingsCapability, Ut as asNumber, Wt as asString$1, Z as isArrayOutputSchema, _t as resolveMethodAuth, bt as scopesAllowDeviceCap, ct as looseSchema, dt as objectInputDeclaresAddonId, en as readinessKey, f as LOG_LEVEL_RANK, h as RUNTIME_DEFAULTS, in as EventCategory$1, it as lifecycleJobSchema, jt as errMsg$1, mt as procedureAuthKey, nn as scopeKey, nt as isVoidInput, p as METHOD_ACCESS_MAP, rt as kebabToCamel, st as logLevelAtMost, t as ALL_CAPABILITY_DEFINITIONS, tn as resolveCapMount, yt as scopesAllowAddon, zt as ReadinessRegistry } from "./dist-DKs---Vx.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";
@@ -25,7 +25,7 @@ import "./builtins/system-config/index.mjs";
25
25
  import { WinstonDestination, WinstonLoggingAddon } from "./builtins/winston-logging/index.mjs";
26
26
  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";
27
27
  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";
28
- import { $ as encodeFrame, $t as HEAP_SPACE_REPORT_MIN_MB, A as createHubCapForwardService, At as HEAP_WATCH_WARN_RATIO, B as AGENT_CAP_FWD_ACTION, Bt as createDeferredHeapWatchSink, C as brokerCallForCap, Cn as formatEventPlane, Ct as resolveNpmInvocation, D as localProviderLink, Dt as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, E as ipcParentLink, Et as HEAP_RECLAIM_MIN_INTERVAL_MS, F as createUdsLogger, Ft as RSS_BUDGET_RELEASE_RATIO, G as callWithServiceDiscovery, Gt as nextRssBudgetState, H as CapRouteResolver, Ht as createV8Reclaimer, I as createUdsLoggerWithControl, It as RUNNER_HEAP_WATCH_INTERVAL_MS, J as UdsLocalTransportClient, Jt as shouldReclaim, K as readMoleculerFanoutMode, Kt as parseRssBudgetMb, L as LocalChildClient, Lt as RUNNER_RSS_BUDGET_ENV, M as createUdsEventBridge, Mt as HUB_MAIN_RSS_BUDGET_MB, N as createUdsEventBus, Nt as HUB_RSS_BUDGET_ENV, O as HUB_CAP_FWD_ACTION, Ot as HEAP_RECLAIM_TRIGGER_MB, P as udsChildLogToWorkerEntry, Pt as RSS_BUDGET_REANNOUNCE_MIN_MS, Q as FrameDecoder, Qt as DECISIVE_HEAP_SPACES, R as LocalChildRegistry, Rt as ZERO_LOOP_DELAY, S as getCapUsageRegistry, Sn as diffEventPlane, St as resolveAddonClass, T as buildLinkChain, Tt as createAddonDataPlaneFacility, U as CapRouteError, Ut as describeRss, V as AGENT_CAP_FWD_SERVICE, Vt as createLoopDelayMeter, W as classifyCapRoute, Wt as hubMainRssBudget, X as SocketChannel, Xt as startRunnerHeapWatch, Y as UdsLocalTransportServer, Yt as startHeapWatch, Z as localEndpointPath, Zt as strandedMb, _ as AddonDepsManager, _n as socketDirectionBytes, _t as DeviceRegistry, a as createUdsAddonContext, an as readHeapSpaces, at as mountNativeCapService, b as CapUsageRegistry, bn as createEventPlaneMeter, bt as copyBundledNativeModules, c as getOrInitReadinessRegistryForClient, cn as SOCKET_PLANE_TOP_N, ct as validateProviderRegistrations, d as clusterEventTopic, dn as diffSocketPlane, dt as capActionSuffix, en as RUNNER_HEAP_SNAPSHOT_ENV, et as buildNativeCapProxy, f as getBrokerEventBus, fn as formatSocketPlane, ft as capBareAction, g as subscribePassthrough, gn as sampleSocketDirection, gt as serializeTypedArrays, h as setNodeEventInterest, hn as recordSocketFrame, ht as deserializeTypedArrays, i as createAddonContext, in as heapSpaceField, j as createParentUnownedCallHandler, jt as HUB_MAIN_HEAP_WATCH_LABEL, k as HUB_CAP_FWD_SERVICE, kt as HEAP_WATCH_INTERVAL_MS, l as setHubConnected, ln as createSocketPlaneMeter, lt as NATIVE_PROVIDER_SERVICE_INFIX, m as registerEventBusService, mn as createSocketDirectionCounters, mt as parseCapAction, n as installManifestPythonDeps, nn as formatHeapSpaces, nt as createBrokerDeviceManagerApi, o as getWorkerDeviceRegistry, on as selectReportedSpaces, p as getMoleculerEventStats, pn as EMPTY_SOCKET_DIRECTION, pt as capServiceName, q as createLocalTransport, qt as reclaimIntervalMs, r as adaptBrokerToCluster, rn as heapSnapshotAuthorised, s as getOrInitReadinessRegistry, sn as EMPTY_SOCKET_PLANE_BASELINE, st as createAddonService, t as installManifestSystemDeps, tn as emitHeapDiagnosticReport, tt as buildUdsNativeCapProxy, u as EVENT_TOPIC_PREFIX, un as createSocketPlaneReader, ut as capActionName, v as createKernelHwAccel, vn as socketDirectionMessages, vt as CapabilityHandle, w as brokerTransportLink, wt as runNpm, x as __resetCapUsageRegistryForTests, xn as createEventPlaneReader, xt as installManifestNativeDeps, y as resolveHwAccel, yn as EVENT_PLANE_TOP_N, yt as CapabilityUnavailableError, z as UDS_NO_ROUTE_PREFIX, zt as buildHeapSample } from "./manifest-system-deps-tZZYG3RR.mjs";
28
+ import { $ as FrameDecoder, $t as DECISIVE_HEAP_SPACES, A as createUdsEventBus, At as HEAP_WATCH_INTERVAL_MS, B as CapRouteError, Bt as buildHeapSample, C as ipcParentLink, Cn as diffEventPlane, Ct as resolveAddonClass, D as createHubCapForwardService, Dt as HEAP_RECLAIM_MIN_INTERVAL_MS, E as HUB_CAP_FWD_SERVICE, Et as createAddonDataPlaneFacility, F as LocalChildRegistry, Ft as RSS_BUDGET_REANNOUNCE_MIN_MS, G as PARENT_ROUTED_PROVIDER_ADDON_ID, Gt as hubMainRssBudget, H as callWithServiceDiscovery, Ht as createLoopDelayMeter, I as UDS_NO_ROUTE_PREFIX, It as RSS_BUDGET_RELEASE_RATIO, J as createLocalTransport, Jt as reclaimIntervalMs, K as __resetCapUsageRegistryForTests, Kt as nextRssBudgetState, L as AGENT_CAP_FWD_ACTION, Lt as RUNNER_HEAP_WATCH_INTERVAL_MS, M as createUdsLogger, Mt as HUB_MAIN_HEAP_WATCH_LABEL, N as createUdsLoggerWithControl, Nt as HUB_MAIN_RSS_BUDGET_MB, O as createParentUnownedCallHandler, Ot as HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, P as LocalChildClient, Pt as HUB_RSS_BUDGET_ENV, Q as localEndpointPath, Qt as strandedMb, R as AGENT_CAP_FWD_SERVICE, Rt as RUNNER_RSS_BUDGET_ENV, S as buildLinkChain, Sn as createEventPlaneReader, St as installManifestNativeDeps, T as HUB_CAP_FWD_ACTION, Tt as runNpm, U as readMoleculerFanoutMode, Ut as createV8Reclaimer, V as classifyCapRoute, Vt as createDeferredHeapWatchSink, W as CapUsageRegistry, Wt as describeRss, X as UdsLocalTransportServer, Xt as startHeapWatch, Y as UdsLocalTransportClient, Yt as shouldReclaim, Z as SocketChannel, Zt as startRunnerHeapWatch, _ as AddonDepsManager, _n as sampleSocketDirection, _t as serializeTypedArrays, a as createUdsAddonContext, an as heapSpaceField, b as brokerCallForCap, bn as EVENT_PLANE_TOP_N, bt as CapabilityUnavailableError, c as getOrInitReadinessRegistryForClient, cn as EMPTY_SOCKET_PLANE_BASELINE, ct as createAddonService, d as clusterEventTopic, dn as createSocketPlaneReader, dt as capActionName, en as HEAP_SPACE_REPORT_MIN_MB, et as encodeFrame, f as getBrokerEventBus, fn as diffSocketPlane, ft as capActionSuffix, g as subscribePassthrough, gn as recordSocketFrame, gt as deserializeTypedArrays, h as setNodeEventInterest, hn as createSocketDirectionCounters, ht as parseCapAction, i as createAddonContext, in as heapSnapshotAuthorised, j as udsChildLogToWorkerEntry, jt as HEAP_WATCH_WARN_RATIO, k as createUdsEventBridge, kt as HEAP_RECLAIM_TRIGGER_MB, l as setHubConnected, ln as SOCKET_PLANE_TOP_N, lt as validateProviderRegistrations, m as registerEventBusService, mn as EMPTY_SOCKET_DIRECTION, mt as capServiceName, n as installManifestPythonDeps, nn as emitHeapDiagnosticReport, nt as buildUdsNativeCapProxy, o as getWorkerDeviceRegistry, on as readHeapSpaces, ot as mountNativeCapService, p as getMoleculerEventStats, pn as formatSocketPlane, pt as capBareAction, q as getCapUsageRegistry, qt as parseRssBudgetMb, r as adaptBrokerToCluster, rn as formatHeapSpaces, rt as createBrokerDeviceManagerApi, s as getOrInitReadinessRegistry, sn as selectReportedSpaces, t as installManifestSystemDeps, tn as RUNNER_HEAP_SNAPSHOT_ENV, tt as buildNativeCapProxy, u as EVENT_TOPIC_PREFIX, un as createSocketPlaneMeter, ut as NATIVE_PROVIDER_SERVICE_INFIX, v as createKernelHwAccel, vn as socketDirectionBytes, vt as DeviceRegistry, w as localProviderLink, wn as formatEventPlane, wt as resolveNpmInvocation, x as brokerTransportLink, xn as createEventPlaneMeter, xt as copyBundledNativeModules, y as resolveHwAccel, yn as socketDirectionMessages, yt as CapabilityHandle, z as CapRouteResolver, zt as ZERO_LOOP_DELAY } from "./manifest-system-deps-DnoPpLGp.mjs";
29
29
  import { n as getSinglePidStats, t as getPidStats } from "./resource-monitor-BWmQ5i-o.mjs";
30
30
  import { t as CustomActionRegistry } from "./custom-action-registry-F__gp_VX.mjs";
31
31
  import { z } from "zod";
@@ -95335,4 +95335,4 @@ var LifecycleJobEngine = class {
95335
95335
  }
95336
95336
  };
95337
95337
  //#endregion
95338
- export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LokiDestination, LokiLoggingAddon, MAX_LEAF_VALIDITY_DAYS, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_SNAPSHOT_ENV, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createLoopDelayMeter, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatEventPlane, formatHeapSpaces, formatLogLine, formatSocketPlane, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSnapshotAuthorised, heapSpaceField, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, nextRssBudgetState, parseCapAction, parseRangeHeader, parseRssBudgetMb, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readHeapSpaces, readLanHttpState, readMoleculerFanoutMode, readPendingRestart, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, socketDirectionBytes, socketDirectionMessages, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
95338
+ export { AGENT_CAP_FWD_ACTION, AGENT_CAP_FWD_SERVICE, AGENT_READINESS_SERVICE_NAME, ALL_CAPABILITY_DEFINITIONS, AddonApiFactory, AddonDepsManager, AddonEngineManager, AddonHealthMonitor, AddonInstaller, AddonLoader, AddonManifest, AddonRouteRegistry, AlertCenterAddon, ApiKeyManager, AuthManager, CA_COMMON_NAME, CA_VALIDITY_DAYS, CLUSTER_SECRET_MISMATCH_TYPE, CLUSTER_SECRET_REJECTED_EXIT_CODE, CORE_CAP_SERVICE_NAME, CapRouteError, CapRouteResolver, CapUsageRegistry, CapabilityHandle, CapabilityRegistry, CapabilityUnavailableError, ConfigManager, ConfigStore, ConsoleDestination, ConsoleLoggingAddon, CoreBlocksAddon, CustomActionRegistry, DECISIVE_HEAP_SPACES, DEFAULT_DATA_PATH, DEFAULT_LAN_HTTP_PORT, DEFAULT_LOG_LEVEL, DEVICE_SETTINGS_CONTRIBUTION_METHODS, DEVICE_STATUS_METHOD, DataPlaneRegistry, DeviceManagerAddon, DeviceRegistry, DeviceStore, EMPTY_SOCKET_DIRECTION, EMPTY_SOCKET_PLANE_BASELINE, EVENT_PLANE_TOP_N, EVENT_TOPIC_PREFIX, EngineManagerResolver, EventBus, FeatureManager, FilesystemStorageAddon, FilesystemStorageProvider, FrameDecoder, FsStorageBackend, HEALTH_MONITOR_GRACE_PERIOD_MS, HEALTH_MONITOR_RETRY_INTERVALS_MS, HEALTH_MONITOR_TICK_MS, HEAP_RECLAIM_MIN_INTERVAL_MS, HEAP_RECLAIM_STEADY_STATE_INTERVAL_MS, HEAP_RECLAIM_TRIGGER_MB, HEAP_SPACE_REPORT_MIN_MB, HEAP_WATCH_INTERVAL_MS, HEAP_WATCH_WARN_RATIO, HUB_CAP_FWD_ACTION, HUB_CAP_FWD_SERVICE, HUB_MAIN_HEAP_WATCH_LABEL, HUB_MAIN_RSS_BUDGET_MB, HUB_RSS_BUDGET_ENV, HubForwarderAddon, HubForwarderDestination, HubLogForwarder, HubNodeRegistry, INFRA_CAPABILITIES, IntegrationRegistry, JobJournal, LEAF_RENEWAL_WINDOW_DAYS, LifecycleJobEngine, LifecycleStateMachine, LivenessMonitorAddon, LocalAuthAddon, LocalChildClient, LocalChildRegistry, LogManager, LogRingBuffer, LoggingGate, LokiDestination, LokiLoggingAddon, MAX_LEAF_VALIDITY_DAYS, METHOD_ACCESS_MAP, ModelDownloadService, NATIVE_PROVIDER_SERVICE_INFIX, NATIVE_SCAN_DEPTH, NativeMetricsAddon, NativeMetricsProvider, NetworkQualityTracker, NotificationService, PARENT_ROUTED_PROVIDER_ADDON_ID, PYTHON_VERSION, PipelineRunner, PipelineValidator, PythonEnvManager, QUARANTINE_DIRNAME, RESTART_MARKER_FILE, RSS_BUDGET_REANNOUNCE_MIN_MS, RSS_BUDGET_RELEASE_RATIO, RUNNER_HEAP_SNAPSHOT_ENV, RUNNER_HEAP_WATCH_INTERVAL_MS, RUNNER_RSS_BUDGET_ENV, RUNTIME_DEFAULTS, ReadinessRegistry, ReadinessTimeoutError, ReplEngine, RingBuffer, SERVER_AUTH_OID, SOCKET_PLANE_TOP_N, ScopedLogger, ScopedTokenManager, SocketChannel, SqliteSettingsAddon, SqliteSettingsBackend, StagingArea, StorageLocationManager, StorageManager, StorageOrchestratorAddon, StorageOrchestratorService, SystemConfigAddon, SystemEventBus, TRADITIONAL_NATIVE_PACKAGES, ToastService, UDS_NO_ROUTE_PREFIX, UdsLocalTransportClient, UdsLocalTransportServer, UserManager, WinstonDestination, WinstonLoggingAddon, ZERO_LOOP_DELAY, __resetCapUsageRegistryForTests, __resetLoggingGateForTests, adaptBrokerToCluster, addonSettingsCapability, allFamiliesListenHost, applyLanHttp, bindPendingLanHttp, bootstrapSchema, brokerCallForCap, brokerTransportLink, buildBinaryPath, buildCapRouters, buildHeapSample, buildLinkChain, buildNativeCapProxy, buildNodeManifest, buildStorageLocationRegistry, buildUdsNativeCapProxy, builderMountedCapNames, callRegisterNodeWithRetry, callWithServiceDiscovery, canServeDataPlane, capActionName, capActionSuffix, capBareAction, capServiceName, classifyAddonDir, classifyCapRoute, clearPendingRestart, closeLanHttp, clusterEventTopic, clusterSecretMatches, collectCertIdentity, collectModelFiles, contentTypeFor, copyDirRecursive, copyExtraFileDirs, createAddonContext, createAddonDataPlaneFacility, createAddonService, createAuthenticatedFileServer, createBroker, createBrokerDeviceManagerApi, createCoreCapService, createDeferredHeapWatchSink, createDoorSettingsView, createEventPlaneMeter, createEventPlaneReader, createFileDataPlaneHandler, createHubCapForwardService, createHubService, createKernelHwAccel, createLocalTransport, createLoopDelayMeter, createParentUnownedCallHandler, createProcessService, createReadinessService, createReadinessServiceForRegistry, createScopedProcessManager, createSocketDirectionCounters, createSocketPlaneMeter, createSocketPlaneReader, createStreamProbeBrokerService, createUdsAddonContext, createUdsEventBridge, createUdsEventBus, createUdsLogger, createUdsLoggerWithControl, createV8Reclaimer, deleteModelFromDisk, deriveAgentListenPort, describeProviderKindDrift, describeRss, detectWorkspacePackagesDir, diffEventPlane, diffSocketPlane, downloadBinary, downloadFile, downloadModel, emitDownForOwnedCaps, emitHeapDiagnosticReport, encodeFrame, ensureAddonNativePrebuilds, ensureBinary, ensureDir, ensureFfmpeg, ensureLibraryBuilt, ensureModel, ensureNativePrebuilds, ensurePython, ensureTlsCert, evaluateExistingCert, expandCapMethods, fetchJson, findInPath, formatEventPlane, formatHeapSpaces, formatLogLine, formatSocketPlane, getBrokerEventBus, getCapUsageRegistry, getFfmpegDownloadUrl, getLoggingGate, getModelFilePath, getMoleculerEventStats, getOrInitReadinessRegistry, getOrInitReadinessRegistryForClient, getPidStats, getPlatformInfo, getPythonDownloadUrl, getRestartMarkerPath, getSinglePidStats, getWorkerDeviceRegistry, hasDotNode, hashClusterSecret, heapSnapshotAuthorised, heapSpaceField, hubMainRssBudget, installManifestNativeDeps, installManifestPythonDeps, installManifestSystemDeps, installPackageFromNpm, installPythonPackages, installPythonRequirements, ipcParentLink, isAddonDeploySource, isArrayOutputSchema, isClusterSecretMismatchError, isCollectionArrayMethod, isInfraCapability, isModelDownloaded, isSourceNewer, isolatedBuiltinPhase, loadTlsCert, localEndpointPath, localProviderLink, mountNativeCapService, nextRssBudgetState, parseCapAction, parseRangeHeader, parseRssBudgetMb, parseTokenizedUrl, partitionIsolatedBuiltinIds, proxyToUpstream, quarantineAddonResidue, readExtraSans, readHeapSpaces, readLanHttpState, readMoleculerFanoutMode, readPendingRestart, readTlsAccessStatus, readTlsMode, readinessKey, reclaimIntervalMs, recordSocketFrame, registerEventBusService, registerLanHttpHandler, reissueTlsLeaf, resolveFilePath, resolveHwAccel, resolveNpmInvocation, runHubAddonBoot, runNpm, sampleSocketDirection, scheduleSelfRestart, scopeKey, scopesAllowAddon, scopesAllowDeviceCap, selectAddonResidue, selectReportedSpaces, serializeTypedArrays, setHubConnected, setNodeEventInterest, shouldReclaim, socketDirectionBytes, socketDirectionMessages, startHeapWatch, startRunnerHeapWatch, strandedMb, stripCamstackDeps, subscribePassthrough, udsChildLogToWorkerEntry, validateProviderRegistrations, validateUploadedTls, waitUntilReady, writeExtraSans, writePendingRestart, writeTlsMode };
@@ -73,8 +73,8 @@ export { localProviderLink, brokerTransportLink, ipcParentLink, buildLinkChain,
73
73
  export type { LocalProviderResolver, BrokerCapCallOpts } from './moleculer/trpc-links.js';
74
74
  export { createProcessService } from './moleculer/process-service.js';
75
75
  export type { ProcessInfo } from './moleculer/process-service.js';
76
- export { CapUsageRegistry, getCapUsageRegistry, __resetCapUsageRegistryForTests, } from './moleculer/cap-usage-registry.js';
77
- export type { CapUsageCallRecord, CapUsageEdge, CapUsageRegistryOptions, } from './moleculer/cap-usage-registry.js';
76
+ export { CapUsageRegistry, getCapUsageRegistry, PARENT_ROUTED_PROVIDER_ADDON_ID, __resetCapUsageRegistryForTests, } from './moleculer/cap-usage-registry.js';
77
+ export type { CapUsageCallRecord, CapUsageEdge, CapUsageRegistryOptions, CapUsageStats, } from './moleculer/cap-usage-registry.js';
78
78
  export { createScopedProcessManager } from './moleculer/process-context.js';
79
79
  export type { IAddonProcessManager } from '@camstack/types';
80
80
  export { callWithServiceDiscovery } from './moleculer/resilient-cap-call.js';
@@ -1,15 +1,62 @@
1
1
  /**
2
- * In-memory observation of tRPC cap calls between addons.
2
+ * In-memory observation of tRPC cap calls between addons — the store behind
3
+ * `nodes.getCapUsageGraph`.
3
4
  *
4
5
  * Storage: `Map<callerAddonId, Map<providerAddonId, Map<capName, RollingWindow>>>`.
5
6
  * `RollingWindow` is a fixed-size ring of 1-second buckets — default 300
6
- * buckets = 5 minutes retention. Queries narrower than the retention
7
- * window filter buckets at read time.
7
+ * buckets = 5 minutes retention. Queries narrower than the retention window
8
+ * filter buckets at read time.
8
9
  *
9
- * Memory bound: 30 callers × 30 providers × 50 caps × 300 buckets × 16 B ≈ 22 MB
10
- * worst case. Realistic load (~10 active caller→provider→cap triples)
11
- * keeps it under 200 KB.
10
+ * ── The ring ages, and that is not free decoration ─────────────────────────
11
+ * Buckets are indexed `second % retention`, so a bucket written at second S is
12
+ * hit again at S + retention·k forever. Until 2026-08-30 nothing ever zeroed
13
+ * them: the `lastCallAtMs` guard hid it while a triple was fully idle, but ONE
14
+ * fresh call re-armed the entire stale ring. A triple that made 1000 calls and
15
+ * then one call five minutes later reported **1001 calls/min instead of 1**.
16
+ * An over-counted edge is worse than the empty graph this instrument shipped
17
+ * with — silence invites doubt, a confident wrong number sends the next
18
+ * investigation at the wrong addon.
19
+ *
20
+ * The fix is clear-forward: on each record, zero the buckets the ring has
21
+ * ADVANCED over since the previous write, and never read past the last written
22
+ * second. Amortised O(1) — a busy triple clears 0–1 buckets per call, and an
23
+ * idle one clears at most `retention` once, when it wakes.
24
+ *
25
+ * ── Cardinality is bounded, because this map lives on hub-main ─────────────
26
+ * The previous docblock claimed "~22 MB worst case … under 200 KB at ~10 active
27
+ * triples". Both numbers were written for a smaller machine and the second was
28
+ * an assumption, not a bound: the key space is caller × provider × cap, and on
29
+ * the live hub that is 64 addons × 64 runners × ~150 caps. Nothing capped it.
30
+ *
31
+ * Today a ring is one `Uint32Array(retention)` — 1.2 KB of ArrayBuffer at the
32
+ * default — plus the three Map entries that reach it. MEASURED (`heapUsed` +
33
+ * `arrayBuffers`, node 24, `--expose-gc`): **1.7 KB per triple**, so ≈1.0 MB at
34
+ * the realistic hub figure (64 callers × a handful of caps each, ≈600 triples)
35
+ * and **6.3 MB at the {@link DEFAULT_MAX_TRIPLES} ceiling**. `recordCall` costs
36
+ * ≈46 ns (1e6 calls in 46 ms) — at the 39 717 calls/min that started this
37
+ * investigation, ≈30 µs of hub-main per second.
38
+ *
39
+ * Reclamation is what keeps it at the low end: a triple whose ring has entirely
40
+ * aged out is dead data and is dropped on the next admission sweep. The hard
41
+ * cap only exists so that a pathological key space (a caller id derived from
42
+ * something unbounded) cannot take hub-main's heap with it — and when it bites,
43
+ * {@link CapUsageRegistry.getStats} says how often, because an instrument that
44
+ * truncates silently is the defect this whole file exists to fix (D237).
45
+ */
46
+ /**
47
+ * Provider placeholder for a call the PARENT routed rather than short-
48
+ * circuiting to a sibling runner: hub-in-process (`settings-store`,
49
+ * `device-manager`, the `$core-caps` bridge), or a remote node. At the layer
50
+ * that records — the parent's `cap-call-out` handler — the sibling id IS the
51
+ * provider and everything else has not been resolved yet.
52
+ *
53
+ * It is a NAMED unknown, not a dropped observation, for the reason D237 was
54
+ * written: the caller is always known, and "who is hammering `settings-store`"
55
+ * is the question this graph exists to answer. Sibling to
56
+ * `UNRESOLVED_PROVIDER_ADDON_ID` in `trpc-links.ts`, which names the same kind
57
+ * of unknown one layer up.
12
58
  */
59
+ export declare const PARENT_ROUTED_PROVIDER_ADDON_ID = "(unresolved: parent-routed)";
13
60
  export interface CapUsageCallRecord {
14
61
  readonly callerAddonId: string;
15
62
  readonly providerAddonId: string;
@@ -17,6 +64,17 @@ export interface CapUsageCallRecord {
17
64
  readonly methodName: string;
18
65
  readonly atMs: number;
19
66
  }
67
+ /**
68
+ * One observed caller → provider → cap edge.
69
+ *
70
+ * There is deliberately no `methodName`: the ring is keyed by CAPABILITY, so
71
+ * `deviceManager.getAllBindings` (the whole fleet) and
72
+ * `deviceManager.getBindings` (one camera) collapse into the same edge. The
73
+ * method IS recorded on the way in ({@link CapUsageCallRecord.methodName}) and
74
+ * discarded here. Splitting the key by method would multiply cardinality by the
75
+ * per-cap method count — worth doing, but it is a schema change to
76
+ * `nodes.getCapUsageGraph`, not a quiet widening of a map on hub-main.
77
+ */
20
78
  export interface CapUsageEdge {
21
79
  readonly callerAddonId: string;
22
80
  readonly providerAddonId: string;
@@ -27,20 +85,87 @@ export interface CapUsageEdge {
27
85
  export interface CapUsageRegistryOptions {
28
86
  /** Max retention in seconds (ring length). Default 300. */
29
87
  readonly retentionSeconds?: number;
88
+ /**
89
+ * Ceiling on live `(caller, provider, cap)` triples. Default
90
+ * {@link DEFAULT_MAX_TRIPLES}. Reaching it drops NEW triples (counted in
91
+ * {@link CapUsageStats.droppedTriples}); triples already being watched keep
92
+ * counting exactly.
93
+ */
94
+ readonly maxTriples?: number;
95
+ }
96
+ /** What the registry knows about its own coverage. Never a guess. */
97
+ export interface CapUsageStats {
98
+ /** Live `(caller, provider, cap)` triples held right now. */
99
+ readonly triples: number;
100
+ /** Ceiling in force. */
101
+ readonly maxTriples: number;
102
+ /**
103
+ * New triples refused since process start because the ceiling was full.
104
+ * Non-zero means the graph is INCOMPLETE — some caller→cap edge exists and
105
+ * is not shown. Nothing else in this file can be incomplete without saying so.
106
+ */
107
+ readonly droppedTriples: number;
30
108
  }
31
109
  export declare class CapUsageRegistry {
32
110
  private readonly retentionSeconds;
111
+ private readonly maxTriples;
33
112
  private readonly map;
113
+ private triples;
114
+ private droppedTriples;
34
115
  constructor(opts?: CapUsageRegistryOptions);
116
+ /**
117
+ * Record one observed cap call.
118
+ *
119
+ * On the hot path: this runs once per cross-process cap call on hub-main's
120
+ * event loop, which is the cluster's only queue (D181). Three Map lookups, an
121
+ * integer increment, and — only when the wall clock has moved on — a bounded
122
+ * clear. No allocation once a triple exists, and it NEVER throws into the
123
+ * call it observes.
124
+ */
35
125
  recordCall(rec: CapUsageCallRecord): void;
36
126
  getGraph(opts: {
37
127
  windowSeconds: number;
38
128
  nowMs: number;
39
129
  }): readonly CapUsageEdge[];
130
+ /** See {@link CapUsageStats}. Cheap — three counters, no scan. */
131
+ getStats(): CapUsageStats;
40
132
  /** Test / diagnostic helper — drops all recorded calls. */
41
133
  clear(): void;
134
+ /**
135
+ * Sum the buckets covering `(nowSec - windowSeconds, nowSec]`.
136
+ *
137
+ * The scan starts at `lastSec`, never at `nowSec`. `recordCall` clears the
138
+ * buckets the ring has advanced OVER, which by definition stops at the last
139
+ * write: the buckets for the seconds since then still hold whatever the
140
+ * previous pass left in them, and reading `nowSec` down would count it. A
141
+ * triple that went quiet for a couple of minutes and then made one call would
142
+ * report the burst it made five minutes earlier.
143
+ *
144
+ * No lower bound is needed beyond the window itself: every bucket at or below
145
+ * `lastSec - retention` was cleared by the advance that reached `lastSec`, so
146
+ * it reads zero anyway. The loop is bounded by `windowSeconds ≤ retention`.
147
+ */
148
+ private sumWindow;
149
+ /**
150
+ * The ring for this triple, creating it if the ceiling allows. `null` means
151
+ * the observation is dropped — counted, never silent (see
152
+ * {@link CapUsageStats.droppedTriples}).
153
+ */
154
+ private windowFor;
155
+ /**
156
+ * Drop every triple whose whole ring has aged out — its last call is older
157
+ * than the retention window, so it can contribute to no query. O(triples),
158
+ * and only reachable when the ceiling is full, so it is amortised away by the
159
+ * admissions it enables.
160
+ */
161
+ private reclaimExpired;
42
162
  }
43
- /** Hub-side singleton. The first caller seeds it; subsequent calls return the same. */
163
+ /**
164
+ * The registry for THIS process. Deliberately per-process: the reader
165
+ * (`nodes.getCapUsageGraph` → `cap-providers.ts`) runs on hub-main, so only
166
+ * writes made on hub-main are ever visible. See the blind-spot list on
167
+ * `LocalChildRegistryOptions.capUsageObserver` for what that excludes.
168
+ */
44
169
  export declare function getCapUsageRegistry(): CapUsageRegistry;
45
170
  /** Test helper — clears the singleton (kept module-private elsewhere). */
46
171
  export declare function __resetCapUsageRegistryForTests(): void;