@camstack/addon-provider-onvif 1.2.33 → 1.2.35

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
@@ -2,7 +2,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  //#region \0rolldown/runtime.js
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  //#endregion
5
- //#region ../types/dist/event-category-CIa_iT6b.mjs
5
+ //#region ../types/dist/event-category-BZL-fdNj.mjs
6
6
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
7
7
  EventCategory["SystemBoot"] = "system.boot";
8
8
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -439,7 +439,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
439
439
  EventCategory["MetricsNodeResourcesSnapshot"] = "metrics.node-resources-snapshot";
440
440
  /**
441
441
  * Periodic per-node process-tree snapshot (camstack-related pids
442
- * with ghost / managed / root classification). Emitted ~0.2 Hz by
442
+ * with root / managed / system classification). Emitted ~0.2 Hz by
443
443
  * the metrics-provider addon. Drives the Cluster → Processes tab
444
444
  * without polling `metricsProvider.listNodeProcesses`.
445
445
  */
@@ -11125,6 +11125,19 @@ var SettingsRecordSchema = object({
11125
11125
  data: record(string(), unknown())
11126
11126
  });
11127
11127
  /**
11128
+ * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
11129
+ * optional.
11130
+ *
11131
+ * A separate schema rather than loosening the shared one: every other method
11132
+ * on this cap addresses a row BY its id, and making that field optional
11133
+ * everywhere would turn a forgotten key into a silently generated one on
11134
+ * `update` and `delete` as well.
11135
+ */
11136
+ var BulkRecordSchema = object({
11137
+ id: string().optional(),
11138
+ data: record(string(), unknown())
11139
+ });
11140
+ /**
11128
11141
  * Column declaration for a structured (SQL-backed) collection.
11129
11142
  *
11130
11143
  * Logical types — the backend translates each to the matching SQLite
@@ -11181,6 +11194,10 @@ method(object({
11181
11194
  collection: string(),
11182
11195
  record: SettingsRecordSchema
11183
11196
  }), _void(), { kind: "mutation" }), method(object({
11197
+ namespace: string().optional(),
11198
+ collection: string(),
11199
+ records: array(BulkRecordSchema).readonly()
11200
+ }), object({ inserted: number().int() }), { kind: "mutation" }), method(object({
11184
11201
  namespace: string().optional(),
11185
11202
  collection: string(),
11186
11203
  id: string(),
@@ -11289,6 +11306,13 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11289
11306
  }), _void(), {
11290
11307
  kind: "mutation",
11291
11308
  auth: "admin"
11309
+ }), method(object({
11310
+ namespace: string().optional(),
11311
+ collection: string(),
11312
+ records: array(BulkRecordSchema).readonly()
11313
+ }), object({ inserted: number().int() }), {
11314
+ kind: "mutation",
11315
+ auth: "admin"
11292
11316
  }), method(object({
11293
11317
  namespace: string().optional(),
11294
11318
  collection: string(),
@@ -13112,6 +13136,68 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13112
13136
  limit: number().optional(),
13113
13137
  tags: record(string(), string()).optional()
13114
13138
  }), array(LogEntrySchema).readonly());
13139
+ var LoadContributionSchema = object({
13140
+ role: _enum([
13141
+ "decode",
13142
+ "transcode",
13143
+ "recording",
13144
+ "streaming",
13145
+ "detection"
13146
+ ]),
13147
+ /**
13148
+ * The NUMERIC device id — the same value every log line carries as
13149
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13150
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
13151
+ * contributor that cannot name its camera must not emit the entry at all,
13152
+ * because an unnamed per-camera entry is indistinguishable from a shared one
13153
+ * and would quietly turn one camera's cost into everybody's.
13154
+ */
13155
+ deviceId: number().int().positive().nullable(),
13156
+ attribution: _enum([
13157
+ "measured",
13158
+ "accounted",
13159
+ "unattributable"
13160
+ ]),
13161
+ /**
13162
+ * What ONE entry is, in the contributor's own words — `615/high`,
13163
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13164
+ * family and inventing a common one would lose the only information that
13165
+ * makes two entries for the same camera distinguishable.
13166
+ */
13167
+ unit: string(),
13168
+ /**
13169
+ * The OS process this cost lives in, when there is one. Present so a
13170
+ * consumer can (a) tell two generations of the same unit apart across a
13171
+ * restart, and (b) subtract claimed processes from the node's process
13172
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13173
+ * process of its own.
13174
+ */
13175
+ pid: number().int().positive().optional(),
13176
+ /**
13177
+ * When this generation started. The pid's incarnation marker: a consumer
13178
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13179
+ * window when this changes, because the counter restarted from zero in a new
13180
+ * process.
13181
+ */
13182
+ startedAtMs: number().optional(),
13183
+ /**
13184
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13185
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
13186
+ * contribution is asked for.
13187
+ *
13188
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
13189
+ * needs a sampler, and a new per-node sampler is the defect half of
13190
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13191
+ * by whoever already keeps a history; a rate cannot be un-averaged.
13192
+ *
13193
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13194
+ * an entry with no process.
13195
+ */
13196
+ cpuSeconds: number().optional(),
13197
+ /** Resident bytes of this unit's process, same source and same rules. */
13198
+ rssBytes: number().optional()
13199
+ });
13200
+ method(_void(), array(LoadContributionSchema).readonly());
13115
13201
  /**
13116
13202
  * `login-method` — collection cap through which auth addons contribute
13117
13203
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -13315,8 +13401,7 @@ var NodeProcessSchema = object({
13315
13401
  classification: _enum([
13316
13402
  "root",
13317
13403
  "managed",
13318
- "system",
13319
- "ghost"
13404
+ "system"
13320
13405
  ]),
13321
13406
  /** `$process` addon binding when `managed`, else null. */
13322
13407
  addonId: string().nullable(),
@@ -13324,22 +13409,39 @@ var NodeProcessSchema = object({
13324
13409
  nodeId: string().nullable(),
13325
13410
  /** Truncated command line. */
13326
13411
  command: string(),
13412
+ /**
13413
+ * `ps pcpu` — CPU averaged over the process's WHOLE LIFETIME, not a rate.
13414
+ * On a runner up for days it barely moves. Fine as a column, useless as a
13415
+ * series: use `cpuMainPercent + cpuGcPercent` for anything time-varying.
13416
+ */
13327
13417
  cpuPercent: number(),
13328
13418
  memoryRssBytes: number(),
13419
+ /**
13420
+ * Instantaneous CPU% of the process's own threads over the last
13421
+ * process-snapshot window, from a `/proc/<pid>/task/*` tick delta.
13422
+ *
13423
+ * `null` = UNKNOWN, never zero: no previous sample yet (first tick after
13424
+ * boot), the pid was recycled, or this node is not Linux.
13425
+ */
13426
+ cpuMainPercent: number().nullable(),
13427
+ /**
13428
+ * Instantaneous CPU% of V8's `V8Worker` platform pool over the same window.
13429
+ *
13430
+ * This is the number that rewrote the 2026-08-27 diagnosis — hub-main 73%,
13431
+ * `stream-broker` 61% (`docs/architecture/load-ledger.md`). A CPU chart that
13432
+ * does not separate it from `cpuMainPercent` shows "busy" where the truth is
13433
+ * "allocating too much".
13434
+ *
13435
+ * Concurrent GC is the dominant tenant of that pool but not the only one
13436
+ * (background compilation runs there too), so it is reported as
13437
+ * "GC / V8 helpers" rather than as pure collection time. `null` has the same
13438
+ * meaning as on `cpuMainPercent`.
13439
+ */
13440
+ cpuGcPercent: number().nullable(),
13441
+ /** Threads seen in the tick scan. `null` under the same conditions. */
13442
+ threadCount: number().nullable(),
13329
13443
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13330
- uptimeSec: number(),
13331
- /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
13332
- orphaned: boolean()
13333
- });
13334
- var KillProcessInputSchema = object({
13335
- pid: number(),
13336
- /** Force = SIGKILL. Default is SIGTERM. */
13337
- force: boolean().optional()
13338
- });
13339
- var KillProcessResultSchema = object({
13340
- success: boolean(),
13341
- reason: string().optional(),
13342
- signal: _enum(["SIGTERM", "SIGKILL"]).optional()
13444
+ uptimeSec: number()
13343
13445
  });
13344
13446
  var DumpHeapSnapshotInputSchema = object({
13345
13447
  /** The addon whose runner should dump a heap snapshot. */
@@ -13352,6 +13454,104 @@ var DumpHeapSnapshotResultSchema = object({
13352
13454
  pid: number().optional(),
13353
13455
  reason: string().optional()
13354
13456
  });
13457
+ /**
13458
+ * One point of one function's series.
13459
+ *
13460
+ * The unsuffixed fields are the bucket's **MAXIMUM**, and that choice is the
13461
+ * point of the whole surface. The two obvious reductions both lie: a mean per
13462
+ * bucket smears a spike away, and taking every Nth sample skips it outright.
13463
+ * Either would give us a tool built to find peaks that does not show peaks.
13464
+ * `...Min` carries the other end, `samples` says how many raw snapshots folded
13465
+ * into the bucket, and a mean stays derivable where it is wanted.
13466
+ *
13467
+ * An UNREDUCED point is a one-sample bucket: `samples === 1` and each `...Min`
13468
+ * equals its unsuffixed twin. Reduced and unreduced are the same shape, so a
13469
+ * caller cannot tell which it received — which is what "one reader" means.
13470
+ */
13471
+ var LoadPointSchema = object({
13472
+ /** Bucket START, or the snapshot's own timestamp when unreduced. */
13473
+ atMs: number(),
13474
+ /** Raw snapshots in this bucket. Never 0 — AN EMPTY BUCKET IS ABSENT. */
13475
+ samples: number().int(),
13476
+ /**
13477
+ * `null` = UNKNOWN and it PROPAGATES: a bucket is null unless every process
13478
+ * of every snapshot in it reported a thread split. A partial sum is a
13479
+ * smaller number that looks exactly as real as a complete one.
13480
+ */
13481
+ cpuMainPercent: number().nullable(),
13482
+ cpuMainPercentMin: number().nullable(),
13483
+ cpuGcPercent: number().nullable(),
13484
+ cpuGcPercentMin: number().nullable(),
13485
+ /** Lifetime-average CPU%, summed. Always known — and never a rate. */
13486
+ cpuLifetimePercent: number(),
13487
+ cpuLifetimePercentMin: number(),
13488
+ memoryRssBytes: number(),
13489
+ memoryRssBytesMin: number(),
13490
+ processCount: number().int(),
13491
+ processCountMin: number().int()
13492
+ });
13493
+ /** One function's series. `key` is an addonId, `__root__` or `__unattributed__`. */
13494
+ var LoadFunctionSeriesSchema = object({
13495
+ key: string(),
13496
+ kind: _enum([
13497
+ "addon",
13498
+ "root",
13499
+ "unattributed"
13500
+ ]),
13501
+ /** Oldest-first. A missing interval is MISSING — never zero-filled. */
13502
+ points: array(LoadPointSchema).readonly()
13503
+ });
13504
+ var NodeLoadSeriesSchema = object({
13505
+ nodeId: string(),
13506
+ /** One entry per function seen in the window, heaviest-first. */
13507
+ series: array(LoadFunctionSeriesSchema).readonly(),
13508
+ /**
13509
+ * Width of one returned bucket, in ms. Equals the sampling cadence when no
13510
+ * reduction was needed — so a caller can always say what one point covers
13511
+ * without having to know whether it was reduced.
13512
+ */
13513
+ bucketMs: number(),
13514
+ /** Raw snapshots that went into this answer, across both tiers. */
13515
+ retainedSamples: number(),
13516
+ /** Oldest snapshot represented, or `null` when nothing is retained. */
13517
+ oldestAtMs: number().nullable(),
13518
+ /** The fixed sampling cadence in force on the cluster, in ms. */
13519
+ cadenceMs: number(),
13520
+ /**
13521
+ * Did the DURABLE tier contribute? `false` means the answer is the hot ring
13522
+ * alone — an agent (which holds no table), or a store that refused.
13523
+ * Reported because "the last hour" and "the last six hours" are different
13524
+ * questions and an operator must not have to guess which was answered.
13525
+ */
13526
+ durable: boolean()
13527
+ });
13528
+ var GetLoadSeriesInputSchema = object({
13529
+ /**
13530
+ * The node whose series is wanted.
13531
+ *
13532
+ * NOT named `nodeId`: the generated cap router strips a top-level
13533
+ * `nodeId` from every method input and uses it to ROUTE the call to
13534
+ * that node's provider (`generated-cap-routers.ts`). A series target
13535
+ * called `nodeId` would silently become a routing pin and never reach
13536
+ * the provider. The hub holds every node it hears from, so the
13537
+ * ordinary call is unpinned — answered by the hub, for any node.
13538
+ */
13539
+ forNodeId: string(),
13540
+ /**
13541
+ * EXCLUSIVE lower bound. A caller passes the newest `atMs` it already
13542
+ * holds and receives only what it is missing, so seeding a live chart
13543
+ * from this method cannot double a point already drawn.
13544
+ */
13545
+ sinceMs: number().optional(),
13546
+ /**
13547
+ * Most points the caller wants PER FUNCTION. The window is reduced to fit,
13548
+ * preserving min and max per bucket.
13549
+ *
13550
+ * Absent means NO reduction — legitimate for a short window and a trap for a
13551
+ * long one, which is why a chart passes its own pixel width.
13552
+ */
13553
+ maxPoints: number().int().positive().optional()
13554
+ });
13355
13555
  var SystemMetricsSchema = object({
13356
13556
  cpuPercent: number(),
13357
13557
  memoryPercent: number(),
@@ -13362,10 +13562,7 @@ var SystemMetricsSchema = object({
13362
13562
  gpuPercent: number().optional(),
13363
13563
  gpuMemoryPercent: number().optional()
13364
13564
  });
13365
- 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, {
13366
- kind: "mutation",
13367
- auth: "admin"
13368
- }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
13565
+ 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, {
13369
13566
  kind: "mutation",
13370
13567
  auth: "admin"
13371
13568
  });
@@ -26814,6 +27011,15 @@ var LoggingSettingsPatchSchema = object({
26814
27011
  * authority over the whole hierarchy and answers for every layer, so the
26815
27012
  * layer selector needs a name the transport does not already own.
26816
27013
  */
27014
+ /**
27015
+ * One contribution, plus WHO reported it.
27016
+ *
27017
+ * The addon and node are added by the hub as it enumerates providers, never by
27018
+ * the contributor: an addon reporting its own identity could report somebody
27019
+ * else's, and the whole point of this surface is that no claim is made by
27020
+ * anyone but its owner.
27021
+ */
27022
+ var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
26817
27023
  var GetLoggingSettingsInputSchema = object({
26818
27024
  scopeNodeId: string().optional(),
26819
27025
  /**
@@ -26872,7 +27078,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26872
27078
  }), method(_void(), SiteLocationStatusSchema, {
26873
27079
  kind: "mutation",
26874
27080
  auth: "admin"
26875
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27081
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26876
27082
  kind: "mutation",
26877
27083
  auth: "admin"
26878
27084
  });
@@ -28898,6 +29104,12 @@ Object.freeze({
28898
29104
  addonId: null,
28899
29105
  access: "create"
28900
29106
  },
29107
+ "dataStoreProvider.insertMany": {
29108
+ capName: "data-store-provider",
29109
+ capScope: "system",
29110
+ addonId: null,
29111
+ access: "create"
29112
+ },
28901
29113
  "dataStoreProvider.isEmpty": {
28902
29114
  capName: "data-store-provider",
28903
29115
  capScope: "system",
@@ -30212,6 +30424,12 @@ Object.freeze({
30212
30424
  addonId: null,
30213
30425
  access: "create"
30214
30426
  },
30427
+ "loadContribution.list": {
30428
+ capName: "load-contribution",
30429
+ capScope: "system",
30430
+ addonId: null,
30431
+ access: "view"
30432
+ },
30215
30433
  "localNetwork.downloadCa": {
30216
30434
  capName: "local-network",
30217
30435
  capScope: "system",
@@ -30512,17 +30730,17 @@ Object.freeze({
30512
30730
  addonId: null,
30513
30731
  access: "view"
30514
30732
  },
30515
- "metricsProvider.getProcessStats": {
30733
+ "metricsProvider.getLoadSeries": {
30516
30734
  capName: "metrics-provider",
30517
30735
  capScope: "system",
30518
30736
  addonId: null,
30519
30737
  access: "view"
30520
30738
  },
30521
- "metricsProvider.killProcess": {
30739
+ "metricsProvider.getProcessStats": {
30522
30740
  capName: "metrics-provider",
30523
30741
  capScope: "system",
30524
30742
  addonId: null,
30525
- access: "create"
30743
+ access: "view"
30526
30744
  },
30527
30745
  "metricsProvider.listAddonInstances": {
30528
30746
  capName: "metrics-provider",
@@ -32534,6 +32752,12 @@ Object.freeze({
32534
32752
  addonId: null,
32535
32753
  access: "create"
32536
32754
  },
32755
+ "settingsStore.insertMany": {
32756
+ capName: "settings-store",
32757
+ capScope: "system",
32758
+ addonId: null,
32759
+ access: "create"
32760
+ },
32537
32761
  "settingsStore.isEmpty": {
32538
32762
  capName: "settings-store",
32539
32763
  capScope: "system",
@@ -33146,6 +33370,12 @@ Object.freeze({
33146
33370
  addonId: null,
33147
33371
  access: "create"
33148
33372
  },
33373
+ "system.getLoadContributions": {
33374
+ capName: "system",
33375
+ capScope: "system",
33376
+ addonId: null,
33377
+ access: "view"
33378
+ },
33149
33379
  "system.getLoggingSettings": {
33150
33380
  capName: "system",
33151
33381
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -3,7 +3,7 @@ import { createRequire } from "node:module";
3
3
  var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
4
4
  var __require = /* @__PURE__ */ createRequire(import.meta.url);
5
5
  //#endregion
6
- //#region ../types/dist/event-category-CIa_iT6b.mjs
6
+ //#region ../types/dist/event-category-BZL-fdNj.mjs
7
7
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
8
8
  EventCategory["SystemBoot"] = "system.boot";
9
9
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -440,7 +440,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
440
440
  EventCategory["MetricsNodeResourcesSnapshot"] = "metrics.node-resources-snapshot";
441
441
  /**
442
442
  * Periodic per-node process-tree snapshot (camstack-related pids
443
- * with ghost / managed / root classification). Emitted ~0.2 Hz by
443
+ * with root / managed / system classification). Emitted ~0.2 Hz by
444
444
  * the metrics-provider addon. Drives the Cluster → Processes tab
445
445
  * without polling `metricsProvider.listNodeProcesses`.
446
446
  */
@@ -11126,6 +11126,19 @@ var SettingsRecordSchema = object({
11126
11126
  data: record(string(), unknown())
11127
11127
  });
11128
11128
  /**
11129
+ * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
11130
+ * optional.
11131
+ *
11132
+ * A separate schema rather than loosening the shared one: every other method
11133
+ * on this cap addresses a row BY its id, and making that field optional
11134
+ * everywhere would turn a forgotten key into a silently generated one on
11135
+ * `update` and `delete` as well.
11136
+ */
11137
+ var BulkRecordSchema = object({
11138
+ id: string().optional(),
11139
+ data: record(string(), unknown())
11140
+ });
11141
+ /**
11129
11142
  * Column declaration for a structured (SQL-backed) collection.
11130
11143
  *
11131
11144
  * Logical types — the backend translates each to the matching SQLite
@@ -11182,6 +11195,10 @@ method(object({
11182
11195
  collection: string(),
11183
11196
  record: SettingsRecordSchema
11184
11197
  }), _void(), { kind: "mutation" }), method(object({
11198
+ namespace: string().optional(),
11199
+ collection: string(),
11200
+ records: array(BulkRecordSchema).readonly()
11201
+ }), object({ inserted: number().int() }), { kind: "mutation" }), method(object({
11185
11202
  namespace: string().optional(),
11186
11203
  collection: string(),
11187
11204
  id: string(),
@@ -11290,6 +11307,13 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11290
11307
  }), _void(), {
11291
11308
  kind: "mutation",
11292
11309
  auth: "admin"
11310
+ }), method(object({
11311
+ namespace: string().optional(),
11312
+ collection: string(),
11313
+ records: array(BulkRecordSchema).readonly()
11314
+ }), object({ inserted: number().int() }), {
11315
+ kind: "mutation",
11316
+ auth: "admin"
11293
11317
  }), method(object({
11294
11318
  namespace: string().optional(),
11295
11319
  collection: string(),
@@ -13113,6 +13137,68 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13113
13137
  limit: number().optional(),
13114
13138
  tags: record(string(), string()).optional()
13115
13139
  }), array(LogEntrySchema).readonly());
13140
+ var LoadContributionSchema = object({
13141
+ role: _enum([
13142
+ "decode",
13143
+ "transcode",
13144
+ "recording",
13145
+ "streaming",
13146
+ "detection"
13147
+ ]),
13148
+ /**
13149
+ * The NUMERIC device id — the same value every log line carries as
13150
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13151
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
13152
+ * contributor that cannot name its camera must not emit the entry at all,
13153
+ * because an unnamed per-camera entry is indistinguishable from a shared one
13154
+ * and would quietly turn one camera's cost into everybody's.
13155
+ */
13156
+ deviceId: number().int().positive().nullable(),
13157
+ attribution: _enum([
13158
+ "measured",
13159
+ "accounted",
13160
+ "unattributable"
13161
+ ]),
13162
+ /**
13163
+ * What ONE entry is, in the contributor's own words — `615/high`,
13164
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13165
+ * family and inventing a common one would lose the only information that
13166
+ * makes two entries for the same camera distinguishable.
13167
+ */
13168
+ unit: string(),
13169
+ /**
13170
+ * The OS process this cost lives in, when there is one. Present so a
13171
+ * consumer can (a) tell two generations of the same unit apart across a
13172
+ * restart, and (b) subtract claimed processes from the node's process
13173
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13174
+ * process of its own.
13175
+ */
13176
+ pid: number().int().positive().optional(),
13177
+ /**
13178
+ * When this generation started. The pid's incarnation marker: a consumer
13179
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13180
+ * window when this changes, because the counter restarted from zero in a new
13181
+ * process.
13182
+ */
13183
+ startedAtMs: number().optional(),
13184
+ /**
13185
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13186
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
13187
+ * contribution is asked for.
13188
+ *
13189
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
13190
+ * needs a sampler, and a new per-node sampler is the defect half of
13191
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13192
+ * by whoever already keeps a history; a rate cannot be un-averaged.
13193
+ *
13194
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13195
+ * an entry with no process.
13196
+ */
13197
+ cpuSeconds: number().optional(),
13198
+ /** Resident bytes of this unit's process, same source and same rules. */
13199
+ rssBytes: number().optional()
13200
+ });
13201
+ method(_void(), array(LoadContributionSchema).readonly());
13116
13202
  /**
13117
13203
  * `login-method` — collection cap through which auth addons contribute
13118
13204
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -13316,8 +13402,7 @@ var NodeProcessSchema = object({
13316
13402
  classification: _enum([
13317
13403
  "root",
13318
13404
  "managed",
13319
- "system",
13320
- "ghost"
13405
+ "system"
13321
13406
  ]),
13322
13407
  /** `$process` addon binding when `managed`, else null. */
13323
13408
  addonId: string().nullable(),
@@ -13325,22 +13410,39 @@ var NodeProcessSchema = object({
13325
13410
  nodeId: string().nullable(),
13326
13411
  /** Truncated command line. */
13327
13412
  command: string(),
13413
+ /**
13414
+ * `ps pcpu` — CPU averaged over the process's WHOLE LIFETIME, not a rate.
13415
+ * On a runner up for days it barely moves. Fine as a column, useless as a
13416
+ * series: use `cpuMainPercent + cpuGcPercent` for anything time-varying.
13417
+ */
13328
13418
  cpuPercent: number(),
13329
13419
  memoryRssBytes: number(),
13420
+ /**
13421
+ * Instantaneous CPU% of the process's own threads over the last
13422
+ * process-snapshot window, from a `/proc/<pid>/task/*` tick delta.
13423
+ *
13424
+ * `null` = UNKNOWN, never zero: no previous sample yet (first tick after
13425
+ * boot), the pid was recycled, or this node is not Linux.
13426
+ */
13427
+ cpuMainPercent: number().nullable(),
13428
+ /**
13429
+ * Instantaneous CPU% of V8's `V8Worker` platform pool over the same window.
13430
+ *
13431
+ * This is the number that rewrote the 2026-08-27 diagnosis — hub-main 73%,
13432
+ * `stream-broker` 61% (`docs/architecture/load-ledger.md`). A CPU chart that
13433
+ * does not separate it from `cpuMainPercent` shows "busy" where the truth is
13434
+ * "allocating too much".
13435
+ *
13436
+ * Concurrent GC is the dominant tenant of that pool but not the only one
13437
+ * (background compilation runs there too), so it is reported as
13438
+ * "GC / V8 helpers" rather than as pure collection time. `null` has the same
13439
+ * meaning as on `cpuMainPercent`.
13440
+ */
13441
+ cpuGcPercent: number().nullable(),
13442
+ /** Threads seen in the tick scan. `null` under the same conditions. */
13443
+ threadCount: number().nullable(),
13330
13444
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13331
- uptimeSec: number(),
13332
- /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
13333
- orphaned: boolean()
13334
- });
13335
- var KillProcessInputSchema = object({
13336
- pid: number(),
13337
- /** Force = SIGKILL. Default is SIGTERM. */
13338
- force: boolean().optional()
13339
- });
13340
- var KillProcessResultSchema = object({
13341
- success: boolean(),
13342
- reason: string().optional(),
13343
- signal: _enum(["SIGTERM", "SIGKILL"]).optional()
13445
+ uptimeSec: number()
13344
13446
  });
13345
13447
  var DumpHeapSnapshotInputSchema = object({
13346
13448
  /** The addon whose runner should dump a heap snapshot. */
@@ -13353,6 +13455,104 @@ var DumpHeapSnapshotResultSchema = object({
13353
13455
  pid: number().optional(),
13354
13456
  reason: string().optional()
13355
13457
  });
13458
+ /**
13459
+ * One point of one function's series.
13460
+ *
13461
+ * The unsuffixed fields are the bucket's **MAXIMUM**, and that choice is the
13462
+ * point of the whole surface. The two obvious reductions both lie: a mean per
13463
+ * bucket smears a spike away, and taking every Nth sample skips it outright.
13464
+ * Either would give us a tool built to find peaks that does not show peaks.
13465
+ * `...Min` carries the other end, `samples` says how many raw snapshots folded
13466
+ * into the bucket, and a mean stays derivable where it is wanted.
13467
+ *
13468
+ * An UNREDUCED point is a one-sample bucket: `samples === 1` and each `...Min`
13469
+ * equals its unsuffixed twin. Reduced and unreduced are the same shape, so a
13470
+ * caller cannot tell which it received — which is what "one reader" means.
13471
+ */
13472
+ var LoadPointSchema = object({
13473
+ /** Bucket START, or the snapshot's own timestamp when unreduced. */
13474
+ atMs: number(),
13475
+ /** Raw snapshots in this bucket. Never 0 — AN EMPTY BUCKET IS ABSENT. */
13476
+ samples: number().int(),
13477
+ /**
13478
+ * `null` = UNKNOWN and it PROPAGATES: a bucket is null unless every process
13479
+ * of every snapshot in it reported a thread split. A partial sum is a
13480
+ * smaller number that looks exactly as real as a complete one.
13481
+ */
13482
+ cpuMainPercent: number().nullable(),
13483
+ cpuMainPercentMin: number().nullable(),
13484
+ cpuGcPercent: number().nullable(),
13485
+ cpuGcPercentMin: number().nullable(),
13486
+ /** Lifetime-average CPU%, summed. Always known — and never a rate. */
13487
+ cpuLifetimePercent: number(),
13488
+ cpuLifetimePercentMin: number(),
13489
+ memoryRssBytes: number(),
13490
+ memoryRssBytesMin: number(),
13491
+ processCount: number().int(),
13492
+ processCountMin: number().int()
13493
+ });
13494
+ /** One function's series. `key` is an addonId, `__root__` or `__unattributed__`. */
13495
+ var LoadFunctionSeriesSchema = object({
13496
+ key: string(),
13497
+ kind: _enum([
13498
+ "addon",
13499
+ "root",
13500
+ "unattributed"
13501
+ ]),
13502
+ /** Oldest-first. A missing interval is MISSING — never zero-filled. */
13503
+ points: array(LoadPointSchema).readonly()
13504
+ });
13505
+ var NodeLoadSeriesSchema = object({
13506
+ nodeId: string(),
13507
+ /** One entry per function seen in the window, heaviest-first. */
13508
+ series: array(LoadFunctionSeriesSchema).readonly(),
13509
+ /**
13510
+ * Width of one returned bucket, in ms. Equals the sampling cadence when no
13511
+ * reduction was needed — so a caller can always say what one point covers
13512
+ * without having to know whether it was reduced.
13513
+ */
13514
+ bucketMs: number(),
13515
+ /** Raw snapshots that went into this answer, across both tiers. */
13516
+ retainedSamples: number(),
13517
+ /** Oldest snapshot represented, or `null` when nothing is retained. */
13518
+ oldestAtMs: number().nullable(),
13519
+ /** The fixed sampling cadence in force on the cluster, in ms. */
13520
+ cadenceMs: number(),
13521
+ /**
13522
+ * Did the DURABLE tier contribute? `false` means the answer is the hot ring
13523
+ * alone — an agent (which holds no table), or a store that refused.
13524
+ * Reported because "the last hour" and "the last six hours" are different
13525
+ * questions and an operator must not have to guess which was answered.
13526
+ */
13527
+ durable: boolean()
13528
+ });
13529
+ var GetLoadSeriesInputSchema = object({
13530
+ /**
13531
+ * The node whose series is wanted.
13532
+ *
13533
+ * NOT named `nodeId`: the generated cap router strips a top-level
13534
+ * `nodeId` from every method input and uses it to ROUTE the call to
13535
+ * that node's provider (`generated-cap-routers.ts`). A series target
13536
+ * called `nodeId` would silently become a routing pin and never reach
13537
+ * the provider. The hub holds every node it hears from, so the
13538
+ * ordinary call is unpinned — answered by the hub, for any node.
13539
+ */
13540
+ forNodeId: string(),
13541
+ /**
13542
+ * EXCLUSIVE lower bound. A caller passes the newest `atMs` it already
13543
+ * holds and receives only what it is missing, so seeding a live chart
13544
+ * from this method cannot double a point already drawn.
13545
+ */
13546
+ sinceMs: number().optional(),
13547
+ /**
13548
+ * Most points the caller wants PER FUNCTION. The window is reduced to fit,
13549
+ * preserving min and max per bucket.
13550
+ *
13551
+ * Absent means NO reduction — legitimate for a short window and a trap for a
13552
+ * long one, which is why a chart passes its own pixel width.
13553
+ */
13554
+ maxPoints: number().int().positive().optional()
13555
+ });
13356
13556
  var SystemMetricsSchema = object({
13357
13557
  cpuPercent: number(),
13358
13558
  memoryPercent: number(),
@@ -13363,10 +13563,7 @@ var SystemMetricsSchema = object({
13363
13563
  gpuPercent: number().optional(),
13364
13564
  gpuMemoryPercent: number().optional()
13365
13565
  });
13366
- 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, {
13367
- kind: "mutation",
13368
- auth: "admin"
13369
- }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
13566
+ 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, {
13370
13567
  kind: "mutation",
13371
13568
  auth: "admin"
13372
13569
  });
@@ -26815,6 +27012,15 @@ var LoggingSettingsPatchSchema = object({
26815
27012
  * authority over the whole hierarchy and answers for every layer, so the
26816
27013
  * layer selector needs a name the transport does not already own.
26817
27014
  */
27015
+ /**
27016
+ * One contribution, plus WHO reported it.
27017
+ *
27018
+ * The addon and node are added by the hub as it enumerates providers, never by
27019
+ * the contributor: an addon reporting its own identity could report somebody
27020
+ * else's, and the whole point of this surface is that no claim is made by
27021
+ * anyone but its owner.
27022
+ */
27023
+ var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
26818
27024
  var GetLoggingSettingsInputSchema = object({
26819
27025
  scopeNodeId: string().optional(),
26820
27026
  /**
@@ -26873,7 +27079,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26873
27079
  }), method(_void(), SiteLocationStatusSchema, {
26874
27080
  kind: "mutation",
26875
27081
  auth: "admin"
26876
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27082
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26877
27083
  kind: "mutation",
26878
27084
  auth: "admin"
26879
27085
  });
@@ -28899,6 +29105,12 @@ Object.freeze({
28899
29105
  addonId: null,
28900
29106
  access: "create"
28901
29107
  },
29108
+ "dataStoreProvider.insertMany": {
29109
+ capName: "data-store-provider",
29110
+ capScope: "system",
29111
+ addonId: null,
29112
+ access: "create"
29113
+ },
28902
29114
  "dataStoreProvider.isEmpty": {
28903
29115
  capName: "data-store-provider",
28904
29116
  capScope: "system",
@@ -30213,6 +30425,12 @@ Object.freeze({
30213
30425
  addonId: null,
30214
30426
  access: "create"
30215
30427
  },
30428
+ "loadContribution.list": {
30429
+ capName: "load-contribution",
30430
+ capScope: "system",
30431
+ addonId: null,
30432
+ access: "view"
30433
+ },
30216
30434
  "localNetwork.downloadCa": {
30217
30435
  capName: "local-network",
30218
30436
  capScope: "system",
@@ -30513,17 +30731,17 @@ Object.freeze({
30513
30731
  addonId: null,
30514
30732
  access: "view"
30515
30733
  },
30516
- "metricsProvider.getProcessStats": {
30734
+ "metricsProvider.getLoadSeries": {
30517
30735
  capName: "metrics-provider",
30518
30736
  capScope: "system",
30519
30737
  addonId: null,
30520
30738
  access: "view"
30521
30739
  },
30522
- "metricsProvider.killProcess": {
30740
+ "metricsProvider.getProcessStats": {
30523
30741
  capName: "metrics-provider",
30524
30742
  capScope: "system",
30525
30743
  addonId: null,
30526
- access: "create"
30744
+ access: "view"
30527
30745
  },
30528
30746
  "metricsProvider.listAddonInstances": {
30529
30747
  capName: "metrics-provider",
@@ -32535,6 +32753,12 @@ Object.freeze({
32535
32753
  addonId: null,
32536
32754
  access: "create"
32537
32755
  },
32756
+ "settingsStore.insertMany": {
32757
+ capName: "settings-store",
32758
+ capScope: "system",
32759
+ addonId: null,
32760
+ access: "create"
32761
+ },
32538
32762
  "settingsStore.isEmpty": {
32539
32763
  capName: "settings-store",
32540
32764
  capScope: "system",
@@ -33147,6 +33371,12 @@ Object.freeze({
33147
33371
  addonId: null,
33148
33372
  access: "create"
33149
33373
  },
33374
+ "system.getLoadContributions": {
33375
+ capName: "system",
33376
+ capScope: "system",
33377
+ addonId: null,
33378
+ access: "view"
33379
+ },
33150
33380
  "system.getLoggingSettings": {
33151
33381
  capName: "system",
33152
33382
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-onvif",
3
- "version": "1.2.33",
3
+ "version": "1.2.35",
4
4
  "description": "ONVIF camera device provider addon for CamStack",
5
5
  "keywords": [
6
6
  "camstack",