@camstack/addon-post-analysis 1.2.134 → 1.2.136

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.
@@ -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
  */
@@ -11513,6 +11513,19 @@ var SettingsRecordSchema = object({
11513
11513
  data: record(string(), unknown())
11514
11514
  });
11515
11515
  /**
11516
+ * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
11517
+ * optional.
11518
+ *
11519
+ * A separate schema rather than loosening the shared one: every other method
11520
+ * on this cap addresses a row BY its id, and making that field optional
11521
+ * everywhere would turn a forgotten key into a silently generated one on
11522
+ * `update` and `delete` as well.
11523
+ */
11524
+ var BulkRecordSchema = object({
11525
+ id: string().optional(),
11526
+ data: record(string(), unknown())
11527
+ });
11528
+ /**
11516
11529
  * Column declaration for a structured (SQL-backed) collection.
11517
11530
  *
11518
11531
  * Logical types — the backend translates each to the matching SQLite
@@ -11569,6 +11582,10 @@ method(object({
11569
11582
  collection: string(),
11570
11583
  record: SettingsRecordSchema
11571
11584
  }), _void(), { kind: "mutation" }), method(object({
11585
+ namespace: string().optional(),
11586
+ collection: string(),
11587
+ records: array(BulkRecordSchema).readonly()
11588
+ }), object({ inserted: number().int() }), { kind: "mutation" }), method(object({
11572
11589
  namespace: string().optional(),
11573
11590
  collection: string(),
11574
11591
  id: string(),
@@ -11677,6 +11694,13 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11677
11694
  }), _void(), {
11678
11695
  kind: "mutation",
11679
11696
  auth: "admin"
11697
+ }), method(object({
11698
+ namespace: string().optional(),
11699
+ collection: string(),
11700
+ records: array(BulkRecordSchema).readonly()
11701
+ }), object({ inserted: number().int() }), {
11702
+ kind: "mutation",
11703
+ auth: "admin"
11680
11704
  }), method(object({
11681
11705
  namespace: string().optional(),
11682
11706
  collection: string(),
@@ -13569,6 +13593,68 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13569
13593
  limit: number().optional(),
13570
13594
  tags: record(string(), string()).optional()
13571
13595
  }), array(LogEntrySchema).readonly());
13596
+ var LoadContributionSchema = object({
13597
+ role: _enum([
13598
+ "decode",
13599
+ "transcode",
13600
+ "recording",
13601
+ "streaming",
13602
+ "detection"
13603
+ ]),
13604
+ /**
13605
+ * The NUMERIC device id — the same value every log line carries as
13606
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13607
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
13608
+ * contributor that cannot name its camera must not emit the entry at all,
13609
+ * because an unnamed per-camera entry is indistinguishable from a shared one
13610
+ * and would quietly turn one camera's cost into everybody's.
13611
+ */
13612
+ deviceId: number().int().positive().nullable(),
13613
+ attribution: _enum([
13614
+ "measured",
13615
+ "accounted",
13616
+ "unattributable"
13617
+ ]),
13618
+ /**
13619
+ * What ONE entry is, in the contributor's own words — `615/high`,
13620
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13621
+ * family and inventing a common one would lose the only information that
13622
+ * makes two entries for the same camera distinguishable.
13623
+ */
13624
+ unit: string(),
13625
+ /**
13626
+ * The OS process this cost lives in, when there is one. Present so a
13627
+ * consumer can (a) tell two generations of the same unit apart across a
13628
+ * restart, and (b) subtract claimed processes from the node's process
13629
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13630
+ * process of its own.
13631
+ */
13632
+ pid: number().int().positive().optional(),
13633
+ /**
13634
+ * When this generation started. The pid's incarnation marker: a consumer
13635
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13636
+ * window when this changes, because the counter restarted from zero in a new
13637
+ * process.
13638
+ */
13639
+ startedAtMs: number().optional(),
13640
+ /**
13641
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13642
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
13643
+ * contribution is asked for.
13644
+ *
13645
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
13646
+ * needs a sampler, and a new per-node sampler is the defect half of
13647
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13648
+ * by whoever already keeps a history; a rate cannot be un-averaged.
13649
+ *
13650
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13651
+ * an entry with no process.
13652
+ */
13653
+ cpuSeconds: number().optional(),
13654
+ /** Resident bytes of this unit's process, same source and same rules. */
13655
+ rssBytes: number().optional()
13656
+ });
13657
+ method(_void(), array(LoadContributionSchema).readonly());
13572
13658
  /**
13573
13659
  * `login-method` — collection cap through which auth addons contribute
13574
13660
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -13772,8 +13858,7 @@ var NodeProcessSchema = object({
13772
13858
  classification: _enum([
13773
13859
  "root",
13774
13860
  "managed",
13775
- "system",
13776
- "ghost"
13861
+ "system"
13777
13862
  ]),
13778
13863
  /** `$process` addon binding when `managed`, else null. */
13779
13864
  addonId: string().nullable(),
@@ -13781,22 +13866,39 @@ var NodeProcessSchema = object({
13781
13866
  nodeId: string().nullable(),
13782
13867
  /** Truncated command line. */
13783
13868
  command: string(),
13869
+ /**
13870
+ * `ps pcpu` — CPU averaged over the process's WHOLE LIFETIME, not a rate.
13871
+ * On a runner up for days it barely moves. Fine as a column, useless as a
13872
+ * series: use `cpuMainPercent + cpuGcPercent` for anything time-varying.
13873
+ */
13784
13874
  cpuPercent: number(),
13785
13875
  memoryRssBytes: number(),
13876
+ /**
13877
+ * Instantaneous CPU% of the process's own threads over the last
13878
+ * process-snapshot window, from a `/proc/<pid>/task/*` tick delta.
13879
+ *
13880
+ * `null` = UNKNOWN, never zero: no previous sample yet (first tick after
13881
+ * boot), the pid was recycled, or this node is not Linux.
13882
+ */
13883
+ cpuMainPercent: number().nullable(),
13884
+ /**
13885
+ * Instantaneous CPU% of V8's `V8Worker` platform pool over the same window.
13886
+ *
13887
+ * This is the number that rewrote the 2026-08-27 diagnosis — hub-main 73%,
13888
+ * `stream-broker` 61% (`docs/architecture/load-ledger.md`). A CPU chart that
13889
+ * does not separate it from `cpuMainPercent` shows "busy" where the truth is
13890
+ * "allocating too much".
13891
+ *
13892
+ * Concurrent GC is the dominant tenant of that pool but not the only one
13893
+ * (background compilation runs there too), so it is reported as
13894
+ * "GC / V8 helpers" rather than as pure collection time. `null` has the same
13895
+ * meaning as on `cpuMainPercent`.
13896
+ */
13897
+ cpuGcPercent: number().nullable(),
13898
+ /** Threads seen in the tick scan. `null` under the same conditions. */
13899
+ threadCount: number().nullable(),
13786
13900
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13787
- uptimeSec: number(),
13788
- /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
13789
- orphaned: boolean()
13790
- });
13791
- var KillProcessInputSchema = object({
13792
- pid: number(),
13793
- /** Force = SIGKILL. Default is SIGTERM. */
13794
- force: boolean().optional()
13795
- });
13796
- var KillProcessResultSchema = object({
13797
- success: boolean(),
13798
- reason: string().optional(),
13799
- signal: _enum(["SIGTERM", "SIGKILL"]).optional()
13901
+ uptimeSec: number()
13800
13902
  });
13801
13903
  var DumpHeapSnapshotInputSchema = object({
13802
13904
  /** The addon whose runner should dump a heap snapshot. */
@@ -13809,6 +13911,104 @@ var DumpHeapSnapshotResultSchema = object({
13809
13911
  pid: number().optional(),
13810
13912
  reason: string().optional()
13811
13913
  });
13914
+ /**
13915
+ * One point of one function's series.
13916
+ *
13917
+ * The unsuffixed fields are the bucket's **MAXIMUM**, and that choice is the
13918
+ * point of the whole surface. The two obvious reductions both lie: a mean per
13919
+ * bucket smears a spike away, and taking every Nth sample skips it outright.
13920
+ * Either would give us a tool built to find peaks that does not show peaks.
13921
+ * `...Min` carries the other end, `samples` says how many raw snapshots folded
13922
+ * into the bucket, and a mean stays derivable where it is wanted.
13923
+ *
13924
+ * An UNREDUCED point is a one-sample bucket: `samples === 1` and each `...Min`
13925
+ * equals its unsuffixed twin. Reduced and unreduced are the same shape, so a
13926
+ * caller cannot tell which it received — which is what "one reader" means.
13927
+ */
13928
+ var LoadPointSchema = object({
13929
+ /** Bucket START, or the snapshot's own timestamp when unreduced. */
13930
+ atMs: number(),
13931
+ /** Raw snapshots in this bucket. Never 0 — AN EMPTY BUCKET IS ABSENT. */
13932
+ samples: number().int(),
13933
+ /**
13934
+ * `null` = UNKNOWN and it PROPAGATES: a bucket is null unless every process
13935
+ * of every snapshot in it reported a thread split. A partial sum is a
13936
+ * smaller number that looks exactly as real as a complete one.
13937
+ */
13938
+ cpuMainPercent: number().nullable(),
13939
+ cpuMainPercentMin: number().nullable(),
13940
+ cpuGcPercent: number().nullable(),
13941
+ cpuGcPercentMin: number().nullable(),
13942
+ /** Lifetime-average CPU%, summed. Always known — and never a rate. */
13943
+ cpuLifetimePercent: number(),
13944
+ cpuLifetimePercentMin: number(),
13945
+ memoryRssBytes: number(),
13946
+ memoryRssBytesMin: number(),
13947
+ processCount: number().int(),
13948
+ processCountMin: number().int()
13949
+ });
13950
+ /** One function's series. `key` is an addonId, `__root__` or `__unattributed__`. */
13951
+ var LoadFunctionSeriesSchema = object({
13952
+ key: string(),
13953
+ kind: _enum([
13954
+ "addon",
13955
+ "root",
13956
+ "unattributed"
13957
+ ]),
13958
+ /** Oldest-first. A missing interval is MISSING — never zero-filled. */
13959
+ points: array(LoadPointSchema).readonly()
13960
+ });
13961
+ var NodeLoadSeriesSchema = object({
13962
+ nodeId: string(),
13963
+ /** One entry per function seen in the window, heaviest-first. */
13964
+ series: array(LoadFunctionSeriesSchema).readonly(),
13965
+ /**
13966
+ * Width of one returned bucket, in ms. Equals the sampling cadence when no
13967
+ * reduction was needed — so a caller can always say what one point covers
13968
+ * without having to know whether it was reduced.
13969
+ */
13970
+ bucketMs: number(),
13971
+ /** Raw snapshots that went into this answer, across both tiers. */
13972
+ retainedSamples: number(),
13973
+ /** Oldest snapshot represented, or `null` when nothing is retained. */
13974
+ oldestAtMs: number().nullable(),
13975
+ /** The fixed sampling cadence in force on the cluster, in ms. */
13976
+ cadenceMs: number(),
13977
+ /**
13978
+ * Did the DURABLE tier contribute? `false` means the answer is the hot ring
13979
+ * alone — an agent (which holds no table), or a store that refused.
13980
+ * Reported because "the last hour" and "the last six hours" are different
13981
+ * questions and an operator must not have to guess which was answered.
13982
+ */
13983
+ durable: boolean()
13984
+ });
13985
+ var GetLoadSeriesInputSchema = object({
13986
+ /**
13987
+ * The node whose series is wanted.
13988
+ *
13989
+ * NOT named `nodeId`: the generated cap router strips a top-level
13990
+ * `nodeId` from every method input and uses it to ROUTE the call to
13991
+ * that node's provider (`generated-cap-routers.ts`). A series target
13992
+ * called `nodeId` would silently become a routing pin and never reach
13993
+ * the provider. The hub holds every node it hears from, so the
13994
+ * ordinary call is unpinned — answered by the hub, for any node.
13995
+ */
13996
+ forNodeId: string(),
13997
+ /**
13998
+ * EXCLUSIVE lower bound. A caller passes the newest `atMs` it already
13999
+ * holds and receives only what it is missing, so seeding a live chart
14000
+ * from this method cannot double a point already drawn.
14001
+ */
14002
+ sinceMs: number().optional(),
14003
+ /**
14004
+ * Most points the caller wants PER FUNCTION. The window is reduced to fit,
14005
+ * preserving min and max per bucket.
14006
+ *
14007
+ * Absent means NO reduction — legitimate for a short window and a trap for a
14008
+ * long one, which is why a chart passes its own pixel width.
14009
+ */
14010
+ maxPoints: number().int().positive().optional()
14011
+ });
13812
14012
  var SystemMetricsSchema = object({
13813
14013
  cpuPercent: number(),
13814
14014
  memoryPercent: number(),
@@ -13819,10 +14019,7 @@ var SystemMetricsSchema = object({
13819
14019
  gpuPercent: number().optional(),
13820
14020
  gpuMemoryPercent: number().optional()
13821
14021
  });
13822
- 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, {
13823
- kind: "mutation",
13824
- auth: "admin"
13825
- }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
14022
+ 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, {
13826
14023
  kind: "mutation",
13827
14024
  auth: "admin"
13828
14025
  });
@@ -30347,6 +30544,15 @@ var LoggingSettingsPatchSchema = object({
30347
30544
  * authority over the whole hierarchy and answers for every layer, so the
30348
30545
  * layer selector needs a name the transport does not already own.
30349
30546
  */
30547
+ /**
30548
+ * One contribution, plus WHO reported it.
30549
+ *
30550
+ * The addon and node are added by the hub as it enumerates providers, never by
30551
+ * the contributor: an addon reporting its own identity could report somebody
30552
+ * else's, and the whole point of this surface is that no claim is made by
30553
+ * anyone but its owner.
30554
+ */
30555
+ var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
30350
30556
  var GetLoggingSettingsInputSchema = object({
30351
30557
  scopeNodeId: string().optional(),
30352
30558
  /**
@@ -30405,7 +30611,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
30405
30611
  }), method(_void(), SiteLocationStatusSchema, {
30406
30612
  kind: "mutation",
30407
30613
  auth: "admin"
30408
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
30614
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
30409
30615
  kind: "mutation",
30410
30616
  auth: "admin"
30411
30617
  });
@@ -33481,6 +33687,12 @@ Object.freeze({
33481
33687
  addonId: null,
33482
33688
  access: "create"
33483
33689
  },
33690
+ "dataStoreProvider.insertMany": {
33691
+ capName: "data-store-provider",
33692
+ capScope: "system",
33693
+ addonId: null,
33694
+ access: "create"
33695
+ },
33484
33696
  "dataStoreProvider.isEmpty": {
33485
33697
  capName: "data-store-provider",
33486
33698
  capScope: "system",
@@ -34795,6 +35007,12 @@ Object.freeze({
34795
35007
  addonId: null,
34796
35008
  access: "create"
34797
35009
  },
35010
+ "loadContribution.list": {
35011
+ capName: "load-contribution",
35012
+ capScope: "system",
35013
+ addonId: null,
35014
+ access: "view"
35015
+ },
34798
35016
  "localNetwork.downloadCa": {
34799
35017
  capName: "local-network",
34800
35018
  capScope: "system",
@@ -35095,17 +35313,17 @@ Object.freeze({
35095
35313
  addonId: null,
35096
35314
  access: "view"
35097
35315
  },
35098
- "metricsProvider.getProcessStats": {
35316
+ "metricsProvider.getLoadSeries": {
35099
35317
  capName: "metrics-provider",
35100
35318
  capScope: "system",
35101
35319
  addonId: null,
35102
35320
  access: "view"
35103
35321
  },
35104
- "metricsProvider.killProcess": {
35322
+ "metricsProvider.getProcessStats": {
35105
35323
  capName: "metrics-provider",
35106
35324
  capScope: "system",
35107
35325
  addonId: null,
35108
- access: "create"
35326
+ access: "view"
35109
35327
  },
35110
35328
  "metricsProvider.listAddonInstances": {
35111
35329
  capName: "metrics-provider",
@@ -37117,6 +37335,12 @@ Object.freeze({
37117
37335
  addonId: null,
37118
37336
  access: "create"
37119
37337
  },
37338
+ "settingsStore.insertMany": {
37339
+ capName: "settings-store",
37340
+ capScope: "system",
37341
+ addonId: null,
37342
+ access: "create"
37343
+ },
37120
37344
  "settingsStore.isEmpty": {
37121
37345
  capName: "settings-store",
37122
37346
  capScope: "system",
@@ -37729,6 +37953,12 @@ Object.freeze({
37729
37953
  addonId: null,
37730
37954
  access: "create"
37731
37955
  },
37956
+ "system.getLoadContributions": {
37957
+ capName: "system",
37958
+ capScope: "system",
37959
+ addonId: null,
37960
+ access: "view"
37961
+ },
37732
37962
  "system.getLoggingSettings": {
37733
37963
  capName: "system",
37734
37964
  capScope: "system",