@camstack/addon-provider-velux 0.2.35 → 0.2.37

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/addon.js +255 -25
  2. package/dist/addon.mjs +255 -25
  3. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- //#region ../types/dist/event-category-CIa_iT6b.mjs
2
+ //#region ../types/dist/event-category-BZL-fdNj.mjs
3
3
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
4
4
  EventCategory["SystemBoot"] = "system.boot";
5
5
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -436,7 +436,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
436
436
  EventCategory["MetricsNodeResourcesSnapshot"] = "metrics.node-resources-snapshot";
437
437
  /**
438
438
  * Periodic per-node process-tree snapshot (camstack-related pids
439
- * with ghost / managed / root classification). Emitted ~0.2 Hz by
439
+ * with root / managed / system classification). Emitted ~0.2 Hz by
440
440
  * the metrics-provider addon. Drives the Cluster → Processes tab
441
441
  * without polling `metricsProvider.listNodeProcesses`.
442
442
  */
@@ -11228,6 +11228,19 @@ var SettingsRecordSchema = object({
11228
11228
  data: record(string(), unknown())
11229
11229
  });
11230
11230
  /**
11231
+ * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
11232
+ * optional.
11233
+ *
11234
+ * A separate schema rather than loosening the shared one: every other method
11235
+ * on this cap addresses a row BY its id, and making that field optional
11236
+ * everywhere would turn a forgotten key into a silently generated one on
11237
+ * `update` and `delete` as well.
11238
+ */
11239
+ var BulkRecordSchema = object({
11240
+ id: string().optional(),
11241
+ data: record(string(), unknown())
11242
+ });
11243
+ /**
11231
11244
  * Column declaration for a structured (SQL-backed) collection.
11232
11245
  *
11233
11246
  * Logical types — the backend translates each to the matching SQLite
@@ -11284,6 +11297,10 @@ method(object({
11284
11297
  collection: string(),
11285
11298
  record: SettingsRecordSchema
11286
11299
  }), _void(), { kind: "mutation" }), method(object({
11300
+ namespace: string().optional(),
11301
+ collection: string(),
11302
+ records: array(BulkRecordSchema).readonly()
11303
+ }), object({ inserted: number().int() }), { kind: "mutation" }), method(object({
11287
11304
  namespace: string().optional(),
11288
11305
  collection: string(),
11289
11306
  id: string(),
@@ -11392,6 +11409,13 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11392
11409
  }), _void(), {
11393
11410
  kind: "mutation",
11394
11411
  auth: "admin"
11412
+ }), method(object({
11413
+ namespace: string().optional(),
11414
+ collection: string(),
11415
+ records: array(BulkRecordSchema).readonly()
11416
+ }), object({ inserted: number().int() }), {
11417
+ kind: "mutation",
11418
+ auth: "admin"
11395
11419
  }), method(object({
11396
11420
  namespace: string().optional(),
11397
11421
  collection: string(),
@@ -13322,6 +13346,68 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13322
13346
  limit: number().optional(),
13323
13347
  tags: record(string(), string()).optional()
13324
13348
  }), array(LogEntrySchema).readonly());
13349
+ var LoadContributionSchema = object({
13350
+ role: _enum([
13351
+ "decode",
13352
+ "transcode",
13353
+ "recording",
13354
+ "streaming",
13355
+ "detection"
13356
+ ]),
13357
+ /**
13358
+ * The NUMERIC device id — the same value every log line carries as
13359
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13360
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
13361
+ * contributor that cannot name its camera must not emit the entry at all,
13362
+ * because an unnamed per-camera entry is indistinguishable from a shared one
13363
+ * and would quietly turn one camera's cost into everybody's.
13364
+ */
13365
+ deviceId: number().int().positive().nullable(),
13366
+ attribution: _enum([
13367
+ "measured",
13368
+ "accounted",
13369
+ "unattributable"
13370
+ ]),
13371
+ /**
13372
+ * What ONE entry is, in the contributor's own words — `615/high`,
13373
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13374
+ * family and inventing a common one would lose the only information that
13375
+ * makes two entries for the same camera distinguishable.
13376
+ */
13377
+ unit: string(),
13378
+ /**
13379
+ * The OS process this cost lives in, when there is one. Present so a
13380
+ * consumer can (a) tell two generations of the same unit apart across a
13381
+ * restart, and (b) subtract claimed processes from the node's process
13382
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13383
+ * process of its own.
13384
+ */
13385
+ pid: number().int().positive().optional(),
13386
+ /**
13387
+ * When this generation started. The pid's incarnation marker: a consumer
13388
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13389
+ * window when this changes, because the counter restarted from zero in a new
13390
+ * process.
13391
+ */
13392
+ startedAtMs: number().optional(),
13393
+ /**
13394
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13395
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
13396
+ * contribution is asked for.
13397
+ *
13398
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
13399
+ * needs a sampler, and a new per-node sampler is the defect half of
13400
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13401
+ * by whoever already keeps a history; a rate cannot be un-averaged.
13402
+ *
13403
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13404
+ * an entry with no process.
13405
+ */
13406
+ cpuSeconds: number().optional(),
13407
+ /** Resident bytes of this unit's process, same source and same rules. */
13408
+ rssBytes: number().optional()
13409
+ });
13410
+ method(_void(), array(LoadContributionSchema).readonly());
13325
13411
  /**
13326
13412
  * `login-method` — collection cap through which auth addons contribute
13327
13413
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -13525,8 +13611,7 @@ var NodeProcessSchema = object({
13525
13611
  classification: _enum([
13526
13612
  "root",
13527
13613
  "managed",
13528
- "system",
13529
- "ghost"
13614
+ "system"
13530
13615
  ]),
13531
13616
  /** `$process` addon binding when `managed`, else null. */
13532
13617
  addonId: string().nullable(),
@@ -13534,22 +13619,39 @@ var NodeProcessSchema = object({
13534
13619
  nodeId: string().nullable(),
13535
13620
  /** Truncated command line. */
13536
13621
  command: string(),
13622
+ /**
13623
+ * `ps pcpu` — CPU averaged over the process's WHOLE LIFETIME, not a rate.
13624
+ * On a runner up for days it barely moves. Fine as a column, useless as a
13625
+ * series: use `cpuMainPercent + cpuGcPercent` for anything time-varying.
13626
+ */
13537
13627
  cpuPercent: number(),
13538
13628
  memoryRssBytes: number(),
13629
+ /**
13630
+ * Instantaneous CPU% of the process's own threads over the last
13631
+ * process-snapshot window, from a `/proc/<pid>/task/*` tick delta.
13632
+ *
13633
+ * `null` = UNKNOWN, never zero: no previous sample yet (first tick after
13634
+ * boot), the pid was recycled, or this node is not Linux.
13635
+ */
13636
+ cpuMainPercent: number().nullable(),
13637
+ /**
13638
+ * Instantaneous CPU% of V8's `V8Worker` platform pool over the same window.
13639
+ *
13640
+ * This is the number that rewrote the 2026-08-27 diagnosis — hub-main 73%,
13641
+ * `stream-broker` 61% (`docs/architecture/load-ledger.md`). A CPU chart that
13642
+ * does not separate it from `cpuMainPercent` shows "busy" where the truth is
13643
+ * "allocating too much".
13644
+ *
13645
+ * Concurrent GC is the dominant tenant of that pool but not the only one
13646
+ * (background compilation runs there too), so it is reported as
13647
+ * "GC / V8 helpers" rather than as pure collection time. `null` has the same
13648
+ * meaning as on `cpuMainPercent`.
13649
+ */
13650
+ cpuGcPercent: number().nullable(),
13651
+ /** Threads seen in the tick scan. `null` under the same conditions. */
13652
+ threadCount: number().nullable(),
13539
13653
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13540
- uptimeSec: number(),
13541
- /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
13542
- orphaned: boolean()
13543
- });
13544
- var KillProcessInputSchema = object({
13545
- pid: number(),
13546
- /** Force = SIGKILL. Default is SIGTERM. */
13547
- force: boolean().optional()
13548
- });
13549
- var KillProcessResultSchema = object({
13550
- success: boolean(),
13551
- reason: string().optional(),
13552
- signal: _enum(["SIGTERM", "SIGKILL"]).optional()
13654
+ uptimeSec: number()
13553
13655
  });
13554
13656
  var DumpHeapSnapshotInputSchema = object({
13555
13657
  /** The addon whose runner should dump a heap snapshot. */
@@ -13562,6 +13664,104 @@ var DumpHeapSnapshotResultSchema = object({
13562
13664
  pid: number().optional(),
13563
13665
  reason: string().optional()
13564
13666
  });
13667
+ /**
13668
+ * One point of one function's series.
13669
+ *
13670
+ * The unsuffixed fields are the bucket's **MAXIMUM**, and that choice is the
13671
+ * point of the whole surface. The two obvious reductions both lie: a mean per
13672
+ * bucket smears a spike away, and taking every Nth sample skips it outright.
13673
+ * Either would give us a tool built to find peaks that does not show peaks.
13674
+ * `...Min` carries the other end, `samples` says how many raw snapshots folded
13675
+ * into the bucket, and a mean stays derivable where it is wanted.
13676
+ *
13677
+ * An UNREDUCED point is a one-sample bucket: `samples === 1` and each `...Min`
13678
+ * equals its unsuffixed twin. Reduced and unreduced are the same shape, so a
13679
+ * caller cannot tell which it received — which is what "one reader" means.
13680
+ */
13681
+ var LoadPointSchema = object({
13682
+ /** Bucket START, or the snapshot's own timestamp when unreduced. */
13683
+ atMs: number(),
13684
+ /** Raw snapshots in this bucket. Never 0 — AN EMPTY BUCKET IS ABSENT. */
13685
+ samples: number().int(),
13686
+ /**
13687
+ * `null` = UNKNOWN and it PROPAGATES: a bucket is null unless every process
13688
+ * of every snapshot in it reported a thread split. A partial sum is a
13689
+ * smaller number that looks exactly as real as a complete one.
13690
+ */
13691
+ cpuMainPercent: number().nullable(),
13692
+ cpuMainPercentMin: number().nullable(),
13693
+ cpuGcPercent: number().nullable(),
13694
+ cpuGcPercentMin: number().nullable(),
13695
+ /** Lifetime-average CPU%, summed. Always known — and never a rate. */
13696
+ cpuLifetimePercent: number(),
13697
+ cpuLifetimePercentMin: number(),
13698
+ memoryRssBytes: number(),
13699
+ memoryRssBytesMin: number(),
13700
+ processCount: number().int(),
13701
+ processCountMin: number().int()
13702
+ });
13703
+ /** One function's series. `key` is an addonId, `__root__` or `__unattributed__`. */
13704
+ var LoadFunctionSeriesSchema = object({
13705
+ key: string(),
13706
+ kind: _enum([
13707
+ "addon",
13708
+ "root",
13709
+ "unattributed"
13710
+ ]),
13711
+ /** Oldest-first. A missing interval is MISSING — never zero-filled. */
13712
+ points: array(LoadPointSchema).readonly()
13713
+ });
13714
+ var NodeLoadSeriesSchema = object({
13715
+ nodeId: string(),
13716
+ /** One entry per function seen in the window, heaviest-first. */
13717
+ series: array(LoadFunctionSeriesSchema).readonly(),
13718
+ /**
13719
+ * Width of one returned bucket, in ms. Equals the sampling cadence when no
13720
+ * reduction was needed — so a caller can always say what one point covers
13721
+ * without having to know whether it was reduced.
13722
+ */
13723
+ bucketMs: number(),
13724
+ /** Raw snapshots that went into this answer, across both tiers. */
13725
+ retainedSamples: number(),
13726
+ /** Oldest snapshot represented, or `null` when nothing is retained. */
13727
+ oldestAtMs: number().nullable(),
13728
+ /** The fixed sampling cadence in force on the cluster, in ms. */
13729
+ cadenceMs: number(),
13730
+ /**
13731
+ * Did the DURABLE tier contribute? `false` means the answer is the hot ring
13732
+ * alone — an agent (which holds no table), or a store that refused.
13733
+ * Reported because "the last hour" and "the last six hours" are different
13734
+ * questions and an operator must not have to guess which was answered.
13735
+ */
13736
+ durable: boolean()
13737
+ });
13738
+ var GetLoadSeriesInputSchema = object({
13739
+ /**
13740
+ * The node whose series is wanted.
13741
+ *
13742
+ * NOT named `nodeId`: the generated cap router strips a top-level
13743
+ * `nodeId` from every method input and uses it to ROUTE the call to
13744
+ * that node's provider (`generated-cap-routers.ts`). A series target
13745
+ * called `nodeId` would silently become a routing pin and never reach
13746
+ * the provider. The hub holds every node it hears from, so the
13747
+ * ordinary call is unpinned — answered by the hub, for any node.
13748
+ */
13749
+ forNodeId: string(),
13750
+ /**
13751
+ * EXCLUSIVE lower bound. A caller passes the newest `atMs` it already
13752
+ * holds and receives only what it is missing, so seeding a live chart
13753
+ * from this method cannot double a point already drawn.
13754
+ */
13755
+ sinceMs: number().optional(),
13756
+ /**
13757
+ * Most points the caller wants PER FUNCTION. The window is reduced to fit,
13758
+ * preserving min and max per bucket.
13759
+ *
13760
+ * Absent means NO reduction — legitimate for a short window and a trap for a
13761
+ * long one, which is why a chart passes its own pixel width.
13762
+ */
13763
+ maxPoints: number().int().positive().optional()
13764
+ });
13565
13765
  var SystemMetricsSchema = object({
13566
13766
  cpuPercent: number(),
13567
13767
  memoryPercent: number(),
@@ -13572,10 +13772,7 @@ var SystemMetricsSchema = object({
13572
13772
  gpuPercent: number().optional(),
13573
13773
  gpuMemoryPercent: number().optional()
13574
13774
  });
13575
- method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(KillProcessInputSchema, KillProcessResultSchema, {
13576
- kind: "mutation",
13577
- auth: "admin"
13578
- }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
13775
+ method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
13579
13776
  kind: "mutation",
13580
13777
  auth: "admin"
13581
13778
  });
@@ -28905,6 +29102,15 @@ var LoggingSettingsPatchSchema = object({
28905
29102
  * authority over the whole hierarchy and answers for every layer, so the
28906
29103
  * layer selector needs a name the transport does not already own.
28907
29104
  */
29105
+ /**
29106
+ * One contribution, plus WHO reported it.
29107
+ *
29108
+ * The addon and node are added by the hub as it enumerates providers, never by
29109
+ * the contributor: an addon reporting its own identity could report somebody
29110
+ * else's, and the whole point of this surface is that no claim is made by
29111
+ * anyone but its owner.
29112
+ */
29113
+ var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
28908
29114
  var GetLoggingSettingsInputSchema = object({
28909
29115
  scopeNodeId: string().optional(),
28910
29116
  /**
@@ -28963,7 +29169,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28963
29169
  }), method(_void(), SiteLocationStatusSchema, {
28964
29170
  kind: "mutation",
28965
29171
  auth: "admin"
28966
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29172
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28967
29173
  kind: "mutation",
28968
29174
  auth: "admin"
28969
29175
  });
@@ -31987,6 +32193,12 @@ Object.freeze({
31987
32193
  addonId: null,
31988
32194
  access: "create"
31989
32195
  },
32196
+ "dataStoreProvider.insertMany": {
32197
+ capName: "data-store-provider",
32198
+ capScope: "system",
32199
+ addonId: null,
32200
+ access: "create"
32201
+ },
31990
32202
  "dataStoreProvider.isEmpty": {
31991
32203
  capName: "data-store-provider",
31992
32204
  capScope: "system",
@@ -33301,6 +33513,12 @@ Object.freeze({
33301
33513
  addonId: null,
33302
33514
  access: "create"
33303
33515
  },
33516
+ "loadContribution.list": {
33517
+ capName: "load-contribution",
33518
+ capScope: "system",
33519
+ addonId: null,
33520
+ access: "view"
33521
+ },
33304
33522
  "localNetwork.downloadCa": {
33305
33523
  capName: "local-network",
33306
33524
  capScope: "system",
@@ -33601,17 +33819,17 @@ Object.freeze({
33601
33819
  addonId: null,
33602
33820
  access: "view"
33603
33821
  },
33604
- "metricsProvider.getProcessStats": {
33822
+ "metricsProvider.getLoadSeries": {
33605
33823
  capName: "metrics-provider",
33606
33824
  capScope: "system",
33607
33825
  addonId: null,
33608
33826
  access: "view"
33609
33827
  },
33610
- "metricsProvider.killProcess": {
33828
+ "metricsProvider.getProcessStats": {
33611
33829
  capName: "metrics-provider",
33612
33830
  capScope: "system",
33613
33831
  addonId: null,
33614
- access: "create"
33832
+ access: "view"
33615
33833
  },
33616
33834
  "metricsProvider.listAddonInstances": {
33617
33835
  capName: "metrics-provider",
@@ -35623,6 +35841,12 @@ Object.freeze({
35623
35841
  addonId: null,
35624
35842
  access: "create"
35625
35843
  },
35844
+ "settingsStore.insertMany": {
35845
+ capName: "settings-store",
35846
+ capScope: "system",
35847
+ addonId: null,
35848
+ access: "create"
35849
+ },
35626
35850
  "settingsStore.isEmpty": {
35627
35851
  capName: "settings-store",
35628
35852
  capScope: "system",
@@ -36235,6 +36459,12 @@ Object.freeze({
36235
36459
  addonId: null,
36236
36460
  access: "create"
36237
36461
  },
36462
+ "system.getLoadContributions": {
36463
+ capName: "system",
36464
+ capScope: "system",
36465
+ addonId: null,
36466
+ access: "view"
36467
+ },
36238
36468
  "system.getLoggingSettings": {
36239
36469
  capName: "system",
36240
36470
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -1,4 +1,4 @@
1
- //#region ../types/dist/event-category-CIa_iT6b.mjs
1
+ //#region ../types/dist/event-category-BZL-fdNj.mjs
2
2
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
3
3
  EventCategory["SystemBoot"] = "system.boot";
4
4
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -435,7 +435,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
435
435
  EventCategory["MetricsNodeResourcesSnapshot"] = "metrics.node-resources-snapshot";
436
436
  /**
437
437
  * Periodic per-node process-tree snapshot (camstack-related pids
438
- * with ghost / managed / root classification). Emitted ~0.2 Hz by
438
+ * with root / managed / system classification). Emitted ~0.2 Hz by
439
439
  * the metrics-provider addon. Drives the Cluster → Processes tab
440
440
  * without polling `metricsProvider.listNodeProcesses`.
441
441
  */
@@ -11227,6 +11227,19 @@ var SettingsRecordSchema = object({
11227
11227
  data: record(string(), unknown())
11228
11228
  });
11229
11229
  /**
11230
+ * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
11231
+ * optional.
11232
+ *
11233
+ * A separate schema rather than loosening the shared one: every other method
11234
+ * on this cap addresses a row BY its id, and making that field optional
11235
+ * everywhere would turn a forgotten key into a silently generated one on
11236
+ * `update` and `delete` as well.
11237
+ */
11238
+ var BulkRecordSchema = object({
11239
+ id: string().optional(),
11240
+ data: record(string(), unknown())
11241
+ });
11242
+ /**
11230
11243
  * Column declaration for a structured (SQL-backed) collection.
11231
11244
  *
11232
11245
  * Logical types — the backend translates each to the matching SQLite
@@ -11283,6 +11296,10 @@ method(object({
11283
11296
  collection: string(),
11284
11297
  record: SettingsRecordSchema
11285
11298
  }), _void(), { kind: "mutation" }), method(object({
11299
+ namespace: string().optional(),
11300
+ collection: string(),
11301
+ records: array(BulkRecordSchema).readonly()
11302
+ }), object({ inserted: number().int() }), { kind: "mutation" }), method(object({
11286
11303
  namespace: string().optional(),
11287
11304
  collection: string(),
11288
11305
  id: string(),
@@ -11391,6 +11408,13 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11391
11408
  }), _void(), {
11392
11409
  kind: "mutation",
11393
11410
  auth: "admin"
11411
+ }), method(object({
11412
+ namespace: string().optional(),
11413
+ collection: string(),
11414
+ records: array(BulkRecordSchema).readonly()
11415
+ }), object({ inserted: number().int() }), {
11416
+ kind: "mutation",
11417
+ auth: "admin"
11394
11418
  }), method(object({
11395
11419
  namespace: string().optional(),
11396
11420
  collection: string(),
@@ -13321,6 +13345,68 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13321
13345
  limit: number().optional(),
13322
13346
  tags: record(string(), string()).optional()
13323
13347
  }), array(LogEntrySchema).readonly());
13348
+ var LoadContributionSchema = object({
13349
+ role: _enum([
13350
+ "decode",
13351
+ "transcode",
13352
+ "recording",
13353
+ "streaming",
13354
+ "detection"
13355
+ ]),
13356
+ /**
13357
+ * The NUMERIC device id — the same value every log line carries as
13358
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13359
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
13360
+ * contributor that cannot name its camera must not emit the entry at all,
13361
+ * because an unnamed per-camera entry is indistinguishable from a shared one
13362
+ * and would quietly turn one camera's cost into everybody's.
13363
+ */
13364
+ deviceId: number().int().positive().nullable(),
13365
+ attribution: _enum([
13366
+ "measured",
13367
+ "accounted",
13368
+ "unattributable"
13369
+ ]),
13370
+ /**
13371
+ * What ONE entry is, in the contributor's own words — `615/high`,
13372
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13373
+ * family and inventing a common one would lose the only information that
13374
+ * makes two entries for the same camera distinguishable.
13375
+ */
13376
+ unit: string(),
13377
+ /**
13378
+ * The OS process this cost lives in, when there is one. Present so a
13379
+ * consumer can (a) tell two generations of the same unit apart across a
13380
+ * restart, and (b) subtract claimed processes from the node's process
13381
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13382
+ * process of its own.
13383
+ */
13384
+ pid: number().int().positive().optional(),
13385
+ /**
13386
+ * When this generation started. The pid's incarnation marker: a consumer
13387
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13388
+ * window when this changes, because the counter restarted from zero in a new
13389
+ * process.
13390
+ */
13391
+ startedAtMs: number().optional(),
13392
+ /**
13393
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13394
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
13395
+ * contribution is asked for.
13396
+ *
13397
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
13398
+ * needs a sampler, and a new per-node sampler is the defect half of
13399
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13400
+ * by whoever already keeps a history; a rate cannot be un-averaged.
13401
+ *
13402
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13403
+ * an entry with no process.
13404
+ */
13405
+ cpuSeconds: number().optional(),
13406
+ /** Resident bytes of this unit's process, same source and same rules. */
13407
+ rssBytes: number().optional()
13408
+ });
13409
+ method(_void(), array(LoadContributionSchema).readonly());
13324
13410
  /**
13325
13411
  * `login-method` — collection cap through which auth addons contribute
13326
13412
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -13524,8 +13610,7 @@ var NodeProcessSchema = object({
13524
13610
  classification: _enum([
13525
13611
  "root",
13526
13612
  "managed",
13527
- "system",
13528
- "ghost"
13613
+ "system"
13529
13614
  ]),
13530
13615
  /** `$process` addon binding when `managed`, else null. */
13531
13616
  addonId: string().nullable(),
@@ -13533,22 +13618,39 @@ var NodeProcessSchema = object({
13533
13618
  nodeId: string().nullable(),
13534
13619
  /** Truncated command line. */
13535
13620
  command: string(),
13621
+ /**
13622
+ * `ps pcpu` — CPU averaged over the process's WHOLE LIFETIME, not a rate.
13623
+ * On a runner up for days it barely moves. Fine as a column, useless as a
13624
+ * series: use `cpuMainPercent + cpuGcPercent` for anything time-varying.
13625
+ */
13536
13626
  cpuPercent: number(),
13537
13627
  memoryRssBytes: number(),
13628
+ /**
13629
+ * Instantaneous CPU% of the process's own threads over the last
13630
+ * process-snapshot window, from a `/proc/<pid>/task/*` tick delta.
13631
+ *
13632
+ * `null` = UNKNOWN, never zero: no previous sample yet (first tick after
13633
+ * boot), the pid was recycled, or this node is not Linux.
13634
+ */
13635
+ cpuMainPercent: number().nullable(),
13636
+ /**
13637
+ * Instantaneous CPU% of V8's `V8Worker` platform pool over the same window.
13638
+ *
13639
+ * This is the number that rewrote the 2026-08-27 diagnosis — hub-main 73%,
13640
+ * `stream-broker` 61% (`docs/architecture/load-ledger.md`). A CPU chart that
13641
+ * does not separate it from `cpuMainPercent` shows "busy" where the truth is
13642
+ * "allocating too much".
13643
+ *
13644
+ * Concurrent GC is the dominant tenant of that pool but not the only one
13645
+ * (background compilation runs there too), so it is reported as
13646
+ * "GC / V8 helpers" rather than as pure collection time. `null` has the same
13647
+ * meaning as on `cpuMainPercent`.
13648
+ */
13649
+ cpuGcPercent: number().nullable(),
13650
+ /** Threads seen in the tick scan. `null` under the same conditions. */
13651
+ threadCount: number().nullable(),
13538
13652
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13539
- uptimeSec: number(),
13540
- /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
13541
- orphaned: boolean()
13542
- });
13543
- var KillProcessInputSchema = object({
13544
- pid: number(),
13545
- /** Force = SIGKILL. Default is SIGTERM. */
13546
- force: boolean().optional()
13547
- });
13548
- var KillProcessResultSchema = object({
13549
- success: boolean(),
13550
- reason: string().optional(),
13551
- signal: _enum(["SIGTERM", "SIGKILL"]).optional()
13653
+ uptimeSec: number()
13552
13654
  });
13553
13655
  var DumpHeapSnapshotInputSchema = object({
13554
13656
  /** The addon whose runner should dump a heap snapshot. */
@@ -13561,6 +13663,104 @@ var DumpHeapSnapshotResultSchema = object({
13561
13663
  pid: number().optional(),
13562
13664
  reason: string().optional()
13563
13665
  });
13666
+ /**
13667
+ * One point of one function's series.
13668
+ *
13669
+ * The unsuffixed fields are the bucket's **MAXIMUM**, and that choice is the
13670
+ * point of the whole surface. The two obvious reductions both lie: a mean per
13671
+ * bucket smears a spike away, and taking every Nth sample skips it outright.
13672
+ * Either would give us a tool built to find peaks that does not show peaks.
13673
+ * `...Min` carries the other end, `samples` says how many raw snapshots folded
13674
+ * into the bucket, and a mean stays derivable where it is wanted.
13675
+ *
13676
+ * An UNREDUCED point is a one-sample bucket: `samples === 1` and each `...Min`
13677
+ * equals its unsuffixed twin. Reduced and unreduced are the same shape, so a
13678
+ * caller cannot tell which it received — which is what "one reader" means.
13679
+ */
13680
+ var LoadPointSchema = object({
13681
+ /** Bucket START, or the snapshot's own timestamp when unreduced. */
13682
+ atMs: number(),
13683
+ /** Raw snapshots in this bucket. Never 0 — AN EMPTY BUCKET IS ABSENT. */
13684
+ samples: number().int(),
13685
+ /**
13686
+ * `null` = UNKNOWN and it PROPAGATES: a bucket is null unless every process
13687
+ * of every snapshot in it reported a thread split. A partial sum is a
13688
+ * smaller number that looks exactly as real as a complete one.
13689
+ */
13690
+ cpuMainPercent: number().nullable(),
13691
+ cpuMainPercentMin: number().nullable(),
13692
+ cpuGcPercent: number().nullable(),
13693
+ cpuGcPercentMin: number().nullable(),
13694
+ /** Lifetime-average CPU%, summed. Always known — and never a rate. */
13695
+ cpuLifetimePercent: number(),
13696
+ cpuLifetimePercentMin: number(),
13697
+ memoryRssBytes: number(),
13698
+ memoryRssBytesMin: number(),
13699
+ processCount: number().int(),
13700
+ processCountMin: number().int()
13701
+ });
13702
+ /** One function's series. `key` is an addonId, `__root__` or `__unattributed__`. */
13703
+ var LoadFunctionSeriesSchema = object({
13704
+ key: string(),
13705
+ kind: _enum([
13706
+ "addon",
13707
+ "root",
13708
+ "unattributed"
13709
+ ]),
13710
+ /** Oldest-first. A missing interval is MISSING — never zero-filled. */
13711
+ points: array(LoadPointSchema).readonly()
13712
+ });
13713
+ var NodeLoadSeriesSchema = object({
13714
+ nodeId: string(),
13715
+ /** One entry per function seen in the window, heaviest-first. */
13716
+ series: array(LoadFunctionSeriesSchema).readonly(),
13717
+ /**
13718
+ * Width of one returned bucket, in ms. Equals the sampling cadence when no
13719
+ * reduction was needed — so a caller can always say what one point covers
13720
+ * without having to know whether it was reduced.
13721
+ */
13722
+ bucketMs: number(),
13723
+ /** Raw snapshots that went into this answer, across both tiers. */
13724
+ retainedSamples: number(),
13725
+ /** Oldest snapshot represented, or `null` when nothing is retained. */
13726
+ oldestAtMs: number().nullable(),
13727
+ /** The fixed sampling cadence in force on the cluster, in ms. */
13728
+ cadenceMs: number(),
13729
+ /**
13730
+ * Did the DURABLE tier contribute? `false` means the answer is the hot ring
13731
+ * alone — an agent (which holds no table), or a store that refused.
13732
+ * Reported because "the last hour" and "the last six hours" are different
13733
+ * questions and an operator must not have to guess which was answered.
13734
+ */
13735
+ durable: boolean()
13736
+ });
13737
+ var GetLoadSeriesInputSchema = object({
13738
+ /**
13739
+ * The node whose series is wanted.
13740
+ *
13741
+ * NOT named `nodeId`: the generated cap router strips a top-level
13742
+ * `nodeId` from every method input and uses it to ROUTE the call to
13743
+ * that node's provider (`generated-cap-routers.ts`). A series target
13744
+ * called `nodeId` would silently become a routing pin and never reach
13745
+ * the provider. The hub holds every node it hears from, so the
13746
+ * ordinary call is unpinned — answered by the hub, for any node.
13747
+ */
13748
+ forNodeId: string(),
13749
+ /**
13750
+ * EXCLUSIVE lower bound. A caller passes the newest `atMs` it already
13751
+ * holds and receives only what it is missing, so seeding a live chart
13752
+ * from this method cannot double a point already drawn.
13753
+ */
13754
+ sinceMs: number().optional(),
13755
+ /**
13756
+ * Most points the caller wants PER FUNCTION. The window is reduced to fit,
13757
+ * preserving min and max per bucket.
13758
+ *
13759
+ * Absent means NO reduction — legitimate for a short window and a trap for a
13760
+ * long one, which is why a chart passes its own pixel width.
13761
+ */
13762
+ maxPoints: number().int().positive().optional()
13763
+ });
13564
13764
  var SystemMetricsSchema = object({
13565
13765
  cpuPercent: number(),
13566
13766
  memoryPercent: number(),
@@ -13571,10 +13771,7 @@ var SystemMetricsSchema = object({
13571
13771
  gpuPercent: number().optional(),
13572
13772
  gpuMemoryPercent: number().optional()
13573
13773
  });
13574
- method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(KillProcessInputSchema, KillProcessResultSchema, {
13575
- kind: "mutation",
13576
- auth: "admin"
13577
- }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
13774
+ method(_void(), SystemResourceSnapshotSchema), method(_void(), SystemResourceSnapshotSchema.nullable()), method(_void(), SystemMetricsSchema), method(object({ dirPath: string() }), DiskSpaceInfoSchema), method(_void(), MetricsGpuInfoSchema.nullable()), method(_void(), number().nullable()), method(object({ pids: array(number()) }), array(PidResourceStatsSchema)), method(_void(), array(AddonInstanceSchema).readonly()), method(object({ addonId: string() }), PidResourceStatsSchema.nullable()), method(_void(), array(NodeProcessSchema).readonly()), method(GetLoadSeriesInputSchema, NodeLoadSeriesSchema), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
13578
13775
  kind: "mutation",
13579
13776
  auth: "admin"
13580
13777
  });
@@ -28904,6 +29101,15 @@ var LoggingSettingsPatchSchema = object({
28904
29101
  * authority over the whole hierarchy and answers for every layer, so the
28905
29102
  * layer selector needs a name the transport does not already own.
28906
29103
  */
29104
+ /**
29105
+ * One contribution, plus WHO reported it.
29106
+ *
29107
+ * The addon and node are added by the hub as it enumerates providers, never by
29108
+ * the contributor: an addon reporting its own identity could report somebody
29109
+ * else's, and the whole point of this surface is that no claim is made by
29110
+ * anyone but its owner.
29111
+ */
29112
+ var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
28907
29113
  var GetLoggingSettingsInputSchema = object({
28908
29114
  scopeNodeId: string().optional(),
28909
29115
  /**
@@ -28962,7 +29168,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
28962
29168
  }), method(_void(), SiteLocationStatusSchema, {
28963
29169
  kind: "mutation",
28964
29170
  auth: "admin"
28965
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29171
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
28966
29172
  kind: "mutation",
28967
29173
  auth: "admin"
28968
29174
  });
@@ -31986,6 +32192,12 @@ Object.freeze({
31986
32192
  addonId: null,
31987
32193
  access: "create"
31988
32194
  },
32195
+ "dataStoreProvider.insertMany": {
32196
+ capName: "data-store-provider",
32197
+ capScope: "system",
32198
+ addonId: null,
32199
+ access: "create"
32200
+ },
31989
32201
  "dataStoreProvider.isEmpty": {
31990
32202
  capName: "data-store-provider",
31991
32203
  capScope: "system",
@@ -33300,6 +33512,12 @@ Object.freeze({
33300
33512
  addonId: null,
33301
33513
  access: "create"
33302
33514
  },
33515
+ "loadContribution.list": {
33516
+ capName: "load-contribution",
33517
+ capScope: "system",
33518
+ addonId: null,
33519
+ access: "view"
33520
+ },
33303
33521
  "localNetwork.downloadCa": {
33304
33522
  capName: "local-network",
33305
33523
  capScope: "system",
@@ -33600,17 +33818,17 @@ Object.freeze({
33600
33818
  addonId: null,
33601
33819
  access: "view"
33602
33820
  },
33603
- "metricsProvider.getProcessStats": {
33821
+ "metricsProvider.getLoadSeries": {
33604
33822
  capName: "metrics-provider",
33605
33823
  capScope: "system",
33606
33824
  addonId: null,
33607
33825
  access: "view"
33608
33826
  },
33609
- "metricsProvider.killProcess": {
33827
+ "metricsProvider.getProcessStats": {
33610
33828
  capName: "metrics-provider",
33611
33829
  capScope: "system",
33612
33830
  addonId: null,
33613
- access: "create"
33831
+ access: "view"
33614
33832
  },
33615
33833
  "metricsProvider.listAddonInstances": {
33616
33834
  capName: "metrics-provider",
@@ -35622,6 +35840,12 @@ Object.freeze({
35622
35840
  addonId: null,
35623
35841
  access: "create"
35624
35842
  },
35843
+ "settingsStore.insertMany": {
35844
+ capName: "settings-store",
35845
+ capScope: "system",
35846
+ addonId: null,
35847
+ access: "create"
35848
+ },
35625
35849
  "settingsStore.isEmpty": {
35626
35850
  capName: "settings-store",
35627
35851
  capScope: "system",
@@ -36234,6 +36458,12 @@ Object.freeze({
36234
36458
  addonId: null,
36235
36459
  access: "create"
36236
36460
  },
36461
+ "system.getLoadContributions": {
36462
+ capName: "system",
36463
+ capScope: "system",
36464
+ addonId: null,
36465
+ access: "view"
36466
+ },
36237
36467
  "system.getLoggingSettings": {
36238
36468
  capName: "system",
36239
36469
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-velux",
3
- "version": "0.2.35",
3
+ "version": "0.2.37",
4
4
  "description": "Velux KLF-200 device-provider addon for CamStack — local-gateway window + shutter covers (positional, no tilt)",
5
5
  "keywords": [
6
6
  "camstack",