@camstack/addon-agent-ui 1.2.35 → 1.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 (2) hide show
  1. package/dist/addon.js +256 -26
  2. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import path from "node:path";
2
2
  import { fileURLToPath } from "node:url";
3
- //#region ../types/dist/event-category-CIa_iT6b.mjs
3
+ //#region ../types/dist/event-category-BZL-fdNj.mjs
4
4
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
5
5
  EventCategory["SystemBoot"] = "system.boot";
6
6
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -437,7 +437,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
437
437
  EventCategory["MetricsNodeResourcesSnapshot"] = "metrics.node-resources-snapshot";
438
438
  /**
439
439
  * Periodic per-node process-tree snapshot (camstack-related pids
440
- * with ghost / managed / root classification). Emitted ~0.2 Hz by
440
+ * with root / managed / system classification). Emitted ~0.2 Hz by
441
441
  * the metrics-provider addon. Drives the Cluster → Processes tab
442
442
  * without polling `metricsProvider.listNodeProcesses`.
443
443
  */
@@ -11129,6 +11129,19 @@ var SettingsRecordSchema = object({
11129
11129
  data: record(string(), unknown())
11130
11130
  });
11131
11131
  /**
11132
+ * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
11133
+ * optional.
11134
+ *
11135
+ * A separate schema rather than loosening the shared one: every other method
11136
+ * on this cap addresses a row BY its id, and making that field optional
11137
+ * everywhere would turn a forgotten key into a silently generated one on
11138
+ * `update` and `delete` as well.
11139
+ */
11140
+ var BulkRecordSchema = object({
11141
+ id: string().optional(),
11142
+ data: record(string(), unknown())
11143
+ });
11144
+ /**
11132
11145
  * Column declaration for a structured (SQL-backed) collection.
11133
11146
  *
11134
11147
  * Logical types — the backend translates each to the matching SQLite
@@ -11185,6 +11198,10 @@ method(object({
11185
11198
  collection: string(),
11186
11199
  record: SettingsRecordSchema
11187
11200
  }), _void(), { kind: "mutation" }), method(object({
11201
+ namespace: string().optional(),
11202
+ collection: string(),
11203
+ records: array(BulkRecordSchema).readonly()
11204
+ }), object({ inserted: number().int() }), { kind: "mutation" }), method(object({
11188
11205
  namespace: string().optional(),
11189
11206
  collection: string(),
11190
11207
  id: string(),
@@ -11293,6 +11310,13 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11293
11310
  }), _void(), {
11294
11311
  kind: "mutation",
11295
11312
  auth: "admin"
11313
+ }), method(object({
11314
+ namespace: string().optional(),
11315
+ collection: string(),
11316
+ records: array(BulkRecordSchema).readonly()
11317
+ }), object({ inserted: number().int() }), {
11318
+ kind: "mutation",
11319
+ auth: "admin"
11296
11320
  }), method(object({
11297
11321
  namespace: string().optional(),
11298
11322
  collection: string(),
@@ -13061,6 +13085,68 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13061
13085
  limit: number().optional(),
13062
13086
  tags: record(string(), string()).optional()
13063
13087
  }), array(LogEntrySchema).readonly());
13088
+ var LoadContributionSchema = object({
13089
+ role: _enum([
13090
+ "decode",
13091
+ "transcode",
13092
+ "recording",
13093
+ "streaming",
13094
+ "detection"
13095
+ ]),
13096
+ /**
13097
+ * The NUMERIC device id — the same value every log line carries as
13098
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13099
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
13100
+ * contributor that cannot name its camera must not emit the entry at all,
13101
+ * because an unnamed per-camera entry is indistinguishable from a shared one
13102
+ * and would quietly turn one camera's cost into everybody's.
13103
+ */
13104
+ deviceId: number().int().positive().nullable(),
13105
+ attribution: _enum([
13106
+ "measured",
13107
+ "accounted",
13108
+ "unattributable"
13109
+ ]),
13110
+ /**
13111
+ * What ONE entry is, in the contributor's own words — `615/high`,
13112
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13113
+ * family and inventing a common one would lose the only information that
13114
+ * makes two entries for the same camera distinguishable.
13115
+ */
13116
+ unit: string(),
13117
+ /**
13118
+ * The OS process this cost lives in, when there is one. Present so a
13119
+ * consumer can (a) tell two generations of the same unit apart across a
13120
+ * restart, and (b) subtract claimed processes from the node's process
13121
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13122
+ * process of its own.
13123
+ */
13124
+ pid: number().int().positive().optional(),
13125
+ /**
13126
+ * When this generation started. The pid's incarnation marker: a consumer
13127
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13128
+ * window when this changes, because the counter restarted from zero in a new
13129
+ * process.
13130
+ */
13131
+ startedAtMs: number().optional(),
13132
+ /**
13133
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13134
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
13135
+ * contribution is asked for.
13136
+ *
13137
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
13138
+ * needs a sampler, and a new per-node sampler is the defect half of
13139
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13140
+ * by whoever already keeps a history; a rate cannot be un-averaged.
13141
+ *
13142
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13143
+ * an entry with no process.
13144
+ */
13145
+ cpuSeconds: number().optional(),
13146
+ /** Resident bytes of this unit's process, same source and same rules. */
13147
+ rssBytes: number().optional()
13148
+ });
13149
+ method(_void(), array(LoadContributionSchema).readonly());
13064
13150
  /**
13065
13151
  * `login-method` — collection cap through which auth addons contribute
13066
13152
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -13264,8 +13350,7 @@ var NodeProcessSchema = object({
13264
13350
  classification: _enum([
13265
13351
  "root",
13266
13352
  "managed",
13267
- "system",
13268
- "ghost"
13353
+ "system"
13269
13354
  ]),
13270
13355
  /** `$process` addon binding when `managed`, else null. */
13271
13356
  addonId: string().nullable(),
@@ -13273,22 +13358,39 @@ var NodeProcessSchema = object({
13273
13358
  nodeId: string().nullable(),
13274
13359
  /** Truncated command line. */
13275
13360
  command: string(),
13361
+ /**
13362
+ * `ps pcpu` — CPU averaged over the process's WHOLE LIFETIME, not a rate.
13363
+ * On a runner up for days it barely moves. Fine as a column, useless as a
13364
+ * series: use `cpuMainPercent + cpuGcPercent` for anything time-varying.
13365
+ */
13276
13366
  cpuPercent: number(),
13277
13367
  memoryRssBytes: number(),
13368
+ /**
13369
+ * Instantaneous CPU% of the process's own threads over the last
13370
+ * process-snapshot window, from a `/proc/<pid>/task/*` tick delta.
13371
+ *
13372
+ * `null` = UNKNOWN, never zero: no previous sample yet (first tick after
13373
+ * boot), the pid was recycled, or this node is not Linux.
13374
+ */
13375
+ cpuMainPercent: number().nullable(),
13376
+ /**
13377
+ * Instantaneous CPU% of V8's `V8Worker` platform pool over the same window.
13378
+ *
13379
+ * This is the number that rewrote the 2026-08-27 diagnosis — hub-main 73%,
13380
+ * `stream-broker` 61% (`docs/architecture/load-ledger.md`). A CPU chart that
13381
+ * does not separate it from `cpuMainPercent` shows "busy" where the truth is
13382
+ * "allocating too much".
13383
+ *
13384
+ * Concurrent GC is the dominant tenant of that pool but not the only one
13385
+ * (background compilation runs there too), so it is reported as
13386
+ * "GC / V8 helpers" rather than as pure collection time. `null` has the same
13387
+ * meaning as on `cpuMainPercent`.
13388
+ */
13389
+ cpuGcPercent: number().nullable(),
13390
+ /** Threads seen in the tick scan. `null` under the same conditions. */
13391
+ threadCount: number().nullable(),
13278
13392
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13279
- uptimeSec: number(),
13280
- /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
13281
- orphaned: boolean()
13282
- });
13283
- var KillProcessInputSchema = object({
13284
- pid: number(),
13285
- /** Force = SIGKILL. Default is SIGTERM. */
13286
- force: boolean().optional()
13287
- });
13288
- var KillProcessResultSchema = object({
13289
- success: boolean(),
13290
- reason: string().optional(),
13291
- signal: _enum(["SIGTERM", "SIGKILL"]).optional()
13393
+ uptimeSec: number()
13292
13394
  });
13293
13395
  var DumpHeapSnapshotInputSchema = object({
13294
13396
  /** The addon whose runner should dump a heap snapshot. */
@@ -13301,6 +13403,104 @@ var DumpHeapSnapshotResultSchema = object({
13301
13403
  pid: number().optional(),
13302
13404
  reason: string().optional()
13303
13405
  });
13406
+ /**
13407
+ * One point of one function's series.
13408
+ *
13409
+ * The unsuffixed fields are the bucket's **MAXIMUM**, and that choice is the
13410
+ * point of the whole surface. The two obvious reductions both lie: a mean per
13411
+ * bucket smears a spike away, and taking every Nth sample skips it outright.
13412
+ * Either would give us a tool built to find peaks that does not show peaks.
13413
+ * `...Min` carries the other end, `samples` says how many raw snapshots folded
13414
+ * into the bucket, and a mean stays derivable where it is wanted.
13415
+ *
13416
+ * An UNREDUCED point is a one-sample bucket: `samples === 1` and each `...Min`
13417
+ * equals its unsuffixed twin. Reduced and unreduced are the same shape, so a
13418
+ * caller cannot tell which it received — which is what "one reader" means.
13419
+ */
13420
+ var LoadPointSchema = object({
13421
+ /** Bucket START, or the snapshot's own timestamp when unreduced. */
13422
+ atMs: number(),
13423
+ /** Raw snapshots in this bucket. Never 0 — AN EMPTY BUCKET IS ABSENT. */
13424
+ samples: number().int(),
13425
+ /**
13426
+ * `null` = UNKNOWN and it PROPAGATES: a bucket is null unless every process
13427
+ * of every snapshot in it reported a thread split. A partial sum is a
13428
+ * smaller number that looks exactly as real as a complete one.
13429
+ */
13430
+ cpuMainPercent: number().nullable(),
13431
+ cpuMainPercentMin: number().nullable(),
13432
+ cpuGcPercent: number().nullable(),
13433
+ cpuGcPercentMin: number().nullable(),
13434
+ /** Lifetime-average CPU%, summed. Always known — and never a rate. */
13435
+ cpuLifetimePercent: number(),
13436
+ cpuLifetimePercentMin: number(),
13437
+ memoryRssBytes: number(),
13438
+ memoryRssBytesMin: number(),
13439
+ processCount: number().int(),
13440
+ processCountMin: number().int()
13441
+ });
13442
+ /** One function's series. `key` is an addonId, `__root__` or `__unattributed__`. */
13443
+ var LoadFunctionSeriesSchema = object({
13444
+ key: string(),
13445
+ kind: _enum([
13446
+ "addon",
13447
+ "root",
13448
+ "unattributed"
13449
+ ]),
13450
+ /** Oldest-first. A missing interval is MISSING — never zero-filled. */
13451
+ points: array(LoadPointSchema).readonly()
13452
+ });
13453
+ var NodeLoadSeriesSchema = object({
13454
+ nodeId: string(),
13455
+ /** One entry per function seen in the window, heaviest-first. */
13456
+ series: array(LoadFunctionSeriesSchema).readonly(),
13457
+ /**
13458
+ * Width of one returned bucket, in ms. Equals the sampling cadence when no
13459
+ * reduction was needed — so a caller can always say what one point covers
13460
+ * without having to know whether it was reduced.
13461
+ */
13462
+ bucketMs: number(),
13463
+ /** Raw snapshots that went into this answer, across both tiers. */
13464
+ retainedSamples: number(),
13465
+ /** Oldest snapshot represented, or `null` when nothing is retained. */
13466
+ oldestAtMs: number().nullable(),
13467
+ /** The fixed sampling cadence in force on the cluster, in ms. */
13468
+ cadenceMs: number(),
13469
+ /**
13470
+ * Did the DURABLE tier contribute? `false` means the answer is the hot ring
13471
+ * alone — an agent (which holds no table), or a store that refused.
13472
+ * Reported because "the last hour" and "the last six hours" are different
13473
+ * questions and an operator must not have to guess which was answered.
13474
+ */
13475
+ durable: boolean()
13476
+ });
13477
+ var GetLoadSeriesInputSchema = object({
13478
+ /**
13479
+ * The node whose series is wanted.
13480
+ *
13481
+ * NOT named `nodeId`: the generated cap router strips a top-level
13482
+ * `nodeId` from every method input and uses it to ROUTE the call to
13483
+ * that node's provider (`generated-cap-routers.ts`). A series target
13484
+ * called `nodeId` would silently become a routing pin and never reach
13485
+ * the provider. The hub holds every node it hears from, so the
13486
+ * ordinary call is unpinned — answered by the hub, for any node.
13487
+ */
13488
+ forNodeId: string(),
13489
+ /**
13490
+ * EXCLUSIVE lower bound. A caller passes the newest `atMs` it already
13491
+ * holds and receives only what it is missing, so seeding a live chart
13492
+ * from this method cannot double a point already drawn.
13493
+ */
13494
+ sinceMs: number().optional(),
13495
+ /**
13496
+ * Most points the caller wants PER FUNCTION. The window is reduced to fit,
13497
+ * preserving min and max per bucket.
13498
+ *
13499
+ * Absent means NO reduction — legitimate for a short window and a trap for a
13500
+ * long one, which is why a chart passes its own pixel width.
13501
+ */
13502
+ maxPoints: number().int().positive().optional()
13503
+ });
13304
13504
  var SystemMetricsSchema = object({
13305
13505
  cpuPercent: number(),
13306
13506
  memoryPercent: number(),
@@ -13311,10 +13511,7 @@ var SystemMetricsSchema = object({
13311
13511
  gpuPercent: number().optional(),
13312
13512
  gpuMemoryPercent: number().optional()
13313
13513
  });
13314
- 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, {
13315
- kind: "mutation",
13316
- auth: "admin"
13317
- }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
13514
+ 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, {
13318
13515
  kind: "mutation",
13319
13516
  auth: "admin"
13320
13517
  });
@@ -26617,6 +26814,15 @@ var LoggingSettingsPatchSchema = object({
26617
26814
  * authority over the whole hierarchy and answers for every layer, so the
26618
26815
  * layer selector needs a name the transport does not already own.
26619
26816
  */
26817
+ /**
26818
+ * One contribution, plus WHO reported it.
26819
+ *
26820
+ * The addon and node are added by the hub as it enumerates providers, never by
26821
+ * the contributor: an addon reporting its own identity could report somebody
26822
+ * else's, and the whole point of this surface is that no claim is made by
26823
+ * anyone but its owner.
26824
+ */
26825
+ var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
26620
26826
  var GetLoggingSettingsInputSchema = object({
26621
26827
  scopeNodeId: string().optional(),
26622
26828
  /**
@@ -26675,7 +26881,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
26675
26881
  }), method(_void(), SiteLocationStatusSchema, {
26676
26882
  kind: "mutation",
26677
26883
  auth: "admin"
26678
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26884
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
26679
26885
  kind: "mutation",
26680
26886
  auth: "admin"
26681
26887
  });
@@ -28291,6 +28497,12 @@ Object.freeze({
28291
28497
  addonId: null,
28292
28498
  access: "create"
28293
28499
  },
28500
+ "dataStoreProvider.insertMany": {
28501
+ capName: "data-store-provider",
28502
+ capScope: "system",
28503
+ addonId: null,
28504
+ access: "create"
28505
+ },
28294
28506
  "dataStoreProvider.isEmpty": {
28295
28507
  capName: "data-store-provider",
28296
28508
  capScope: "system",
@@ -29605,6 +29817,12 @@ Object.freeze({
29605
29817
  addonId: null,
29606
29818
  access: "create"
29607
29819
  },
29820
+ "loadContribution.list": {
29821
+ capName: "load-contribution",
29822
+ capScope: "system",
29823
+ addonId: null,
29824
+ access: "view"
29825
+ },
29608
29826
  "localNetwork.downloadCa": {
29609
29827
  capName: "local-network",
29610
29828
  capScope: "system",
@@ -29905,17 +30123,17 @@ Object.freeze({
29905
30123
  addonId: null,
29906
30124
  access: "view"
29907
30125
  },
29908
- "metricsProvider.getProcessStats": {
30126
+ "metricsProvider.getLoadSeries": {
29909
30127
  capName: "metrics-provider",
29910
30128
  capScope: "system",
29911
30129
  addonId: null,
29912
30130
  access: "view"
29913
30131
  },
29914
- "metricsProvider.killProcess": {
30132
+ "metricsProvider.getProcessStats": {
29915
30133
  capName: "metrics-provider",
29916
30134
  capScope: "system",
29917
30135
  addonId: null,
29918
- access: "create"
30136
+ access: "view"
29919
30137
  },
29920
30138
  "metricsProvider.listAddonInstances": {
29921
30139
  capName: "metrics-provider",
@@ -31927,6 +32145,12 @@ Object.freeze({
31927
32145
  addonId: null,
31928
32146
  access: "create"
31929
32147
  },
32148
+ "settingsStore.insertMany": {
32149
+ capName: "settings-store",
32150
+ capScope: "system",
32151
+ addonId: null,
32152
+ access: "create"
32153
+ },
31930
32154
  "settingsStore.isEmpty": {
31931
32155
  capName: "settings-store",
31932
32156
  capScope: "system",
@@ -32539,6 +32763,12 @@ Object.freeze({
32539
32763
  addonId: null,
32540
32764
  access: "create"
32541
32765
  },
32766
+ "system.getLoadContributions": {
32767
+ capName: "system",
32768
+ capScope: "system",
32769
+ addonId: null,
32770
+ access: "view"
32771
+ },
32542
32772
  "system.getLoggingSettings": {
32543
32773
  capName: "system",
32544
32774
  capScope: "system",
@@ -35440,7 +35670,7 @@ var AgentUIAddon = class extends BaseAddon {
35440
35670
  capability: adminUiCapability,
35441
35671
  provider: {
35442
35672
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
35443
- getVersion: async () => ({ version: "1.2.35" })
35673
+ getVersion: async () => ({ version: "1.2.37" })
35444
35674
  }
35445
35675
  }];
35446
35676
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.2.35",
3
+ "version": "1.2.37",
4
4
  "description": "Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",