@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.
@@ -29,7 +29,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
29
29
  enumerable: true
30
30
  }) : target, mod));
31
31
  //#endregion
32
- //#region ../types/dist/event-category-CIa_iT6b.mjs
32
+ //#region ../types/dist/event-category-BZL-fdNj.mjs
33
33
  var EventCategory = /* @__PURE__ */ function(EventCategory) {
34
34
  EventCategory["SystemBoot"] = "system.boot";
35
35
  EventCategory["SystemAddonsReady"] = "system.addons-ready";
@@ -466,7 +466,7 @@ var EventCategory = /* @__PURE__ */ function(EventCategory) {
466
466
  EventCategory["MetricsNodeResourcesSnapshot"] = "metrics.node-resources-snapshot";
467
467
  /**
468
468
  * Periodic per-node process-tree snapshot (camstack-related pids
469
- * with ghost / managed / root classification). Emitted ~0.2 Hz by
469
+ * with root / managed / system classification). Emitted ~0.2 Hz by
470
470
  * the metrics-provider addon. Drives the Cluster → Processes tab
471
471
  * without polling `metricsProvider.listNodeProcesses`.
472
472
  */
@@ -11544,6 +11544,19 @@ var SettingsRecordSchema = object({
11544
11544
  data: record(string(), unknown())
11545
11545
  });
11546
11546
  /**
11547
+ * One record of a BULK insert — {@link SettingsRecordSchema} with the id made
11548
+ * optional.
11549
+ *
11550
+ * A separate schema rather than loosening the shared one: every other method
11551
+ * on this cap addresses a row BY its id, and making that field optional
11552
+ * everywhere would turn a forgotten key into a silently generated one on
11553
+ * `update` and `delete` as well.
11554
+ */
11555
+ var BulkRecordSchema = object({
11556
+ id: string().optional(),
11557
+ data: record(string(), unknown())
11558
+ });
11559
+ /**
11547
11560
  * Column declaration for a structured (SQL-backed) collection.
11548
11561
  *
11549
11562
  * Logical types — the backend translates each to the matching SQLite
@@ -11600,6 +11613,10 @@ method(object({
11600
11613
  collection: string(),
11601
11614
  record: SettingsRecordSchema
11602
11615
  }), _void(), { kind: "mutation" }), method(object({
11616
+ namespace: string().optional(),
11617
+ collection: string(),
11618
+ records: array(BulkRecordSchema).readonly()
11619
+ }), object({ inserted: number().int() }), { kind: "mutation" }), method(object({
11603
11620
  namespace: string().optional(),
11604
11621
  collection: string(),
11605
11622
  id: string(),
@@ -11708,6 +11725,13 @@ method(_void(), EngineInfoSchema, { auth: "admin" }), method(object({
11708
11725
  }), _void(), {
11709
11726
  kind: "mutation",
11710
11727
  auth: "admin"
11728
+ }), method(object({
11729
+ namespace: string().optional(),
11730
+ collection: string(),
11731
+ records: array(BulkRecordSchema).readonly()
11732
+ }), object({ inserted: number().int() }), {
11733
+ kind: "mutation",
11734
+ auth: "admin"
11711
11735
  }), method(object({
11712
11736
  namespace: string().optional(),
11713
11737
  collection: string(),
@@ -13600,6 +13624,68 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13600
13624
  limit: number().optional(),
13601
13625
  tags: record(string(), string()).optional()
13602
13626
  }), array(LogEntrySchema).readonly());
13627
+ var LoadContributionSchema = object({
13628
+ role: _enum([
13629
+ "decode",
13630
+ "transcode",
13631
+ "recording",
13632
+ "streaming",
13633
+ "detection"
13634
+ ]),
13635
+ /**
13636
+ * The NUMERIC device id — the same value every log line carries as
13637
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13638
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
13639
+ * contributor that cannot name its camera must not emit the entry at all,
13640
+ * because an unnamed per-camera entry is indistinguishable from a shared one
13641
+ * and would quietly turn one camera's cost into everybody's.
13642
+ */
13643
+ deviceId: number().int().positive().nullable(),
13644
+ attribution: _enum([
13645
+ "measured",
13646
+ "accounted",
13647
+ "unattributable"
13648
+ ]),
13649
+ /**
13650
+ * What ONE entry is, in the contributor's own words — `615/high`,
13651
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13652
+ * family and inventing a common one would lose the only information that
13653
+ * makes two entries for the same camera distinguishable.
13654
+ */
13655
+ unit: string(),
13656
+ /**
13657
+ * The OS process this cost lives in, when there is one. Present so a
13658
+ * consumer can (a) tell two generations of the same unit apart across a
13659
+ * restart, and (b) subtract claimed processes from the node's process
13660
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13661
+ * process of its own.
13662
+ */
13663
+ pid: number().int().positive().optional(),
13664
+ /**
13665
+ * When this generation started. The pid's incarnation marker: a consumer
13666
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13667
+ * window when this changes, because the counter restarted from zero in a new
13668
+ * process.
13669
+ */
13670
+ startedAtMs: number().optional(),
13671
+ /**
13672
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13673
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
13674
+ * contribution is asked for.
13675
+ *
13676
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
13677
+ * needs a sampler, and a new per-node sampler is the defect half of
13678
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13679
+ * by whoever already keeps a history; a rate cannot be un-averaged.
13680
+ *
13681
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13682
+ * an entry with no process.
13683
+ */
13684
+ cpuSeconds: number().optional(),
13685
+ /** Resident bytes of this unit's process, same source and same rules. */
13686
+ rssBytes: number().optional()
13687
+ });
13688
+ method(_void(), array(LoadContributionSchema).readonly());
13603
13689
  /**
13604
13690
  * `login-method` — collection cap through which auth addons contribute
13605
13691
  * their pre-auth login surfaces to the login page. This is the SINGLE,
@@ -13803,8 +13889,7 @@ var NodeProcessSchema = object({
13803
13889
  classification: _enum([
13804
13890
  "root",
13805
13891
  "managed",
13806
- "system",
13807
- "ghost"
13892
+ "system"
13808
13893
  ]),
13809
13894
  /** `$process` addon binding when `managed`, else null. */
13810
13895
  addonId: string().nullable(),
@@ -13812,22 +13897,39 @@ var NodeProcessSchema = object({
13812
13897
  nodeId: string().nullable(),
13813
13898
  /** Truncated command line. */
13814
13899
  command: string(),
13900
+ /**
13901
+ * `ps pcpu` — CPU averaged over the process's WHOLE LIFETIME, not a rate.
13902
+ * On a runner up for days it barely moves. Fine as a column, useless as a
13903
+ * series: use `cpuMainPercent + cpuGcPercent` for anything time-varying.
13904
+ */
13815
13905
  cpuPercent: number(),
13816
13906
  memoryRssBytes: number(),
13907
+ /**
13908
+ * Instantaneous CPU% of the process's own threads over the last
13909
+ * process-snapshot window, from a `/proc/<pid>/task/*` tick delta.
13910
+ *
13911
+ * `null` = UNKNOWN, never zero: no previous sample yet (first tick after
13912
+ * boot), the pid was recycled, or this node is not Linux.
13913
+ */
13914
+ cpuMainPercent: number().nullable(),
13915
+ /**
13916
+ * Instantaneous CPU% of V8's `V8Worker` platform pool over the same window.
13917
+ *
13918
+ * This is the number that rewrote the 2026-08-27 diagnosis — hub-main 73%,
13919
+ * `stream-broker` 61% (`docs/architecture/load-ledger.md`). A CPU chart that
13920
+ * does not separate it from `cpuMainPercent` shows "busy" where the truth is
13921
+ * "allocating too much".
13922
+ *
13923
+ * Concurrent GC is the dominant tenant of that pool but not the only one
13924
+ * (background compilation runs there too), so it is reported as
13925
+ * "GC / V8 helpers" rather than as pure collection time. `null` has the same
13926
+ * meaning as on `cpuMainPercent`.
13927
+ */
13928
+ cpuGcPercent: number().nullable(),
13929
+ /** Threads seen in the tick scan. `null` under the same conditions. */
13930
+ threadCount: number().nullable(),
13817
13931
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13818
- uptimeSec: number(),
13819
- /** True when ancestor walk reaches `ppid=1` (reparented to init/launchd). */
13820
- orphaned: boolean()
13821
- });
13822
- var KillProcessInputSchema = object({
13823
- pid: number(),
13824
- /** Force = SIGKILL. Default is SIGTERM. */
13825
- force: boolean().optional()
13826
- });
13827
- var KillProcessResultSchema = object({
13828
- success: boolean(),
13829
- reason: string().optional(),
13830
- signal: _enum(["SIGTERM", "SIGKILL"]).optional()
13932
+ uptimeSec: number()
13831
13933
  });
13832
13934
  var DumpHeapSnapshotInputSchema = object({
13833
13935
  /** The addon whose runner should dump a heap snapshot. */
@@ -13840,6 +13942,104 @@ var DumpHeapSnapshotResultSchema = object({
13840
13942
  pid: number().optional(),
13841
13943
  reason: string().optional()
13842
13944
  });
13945
+ /**
13946
+ * One point of one function's series.
13947
+ *
13948
+ * The unsuffixed fields are the bucket's **MAXIMUM**, and that choice is the
13949
+ * point of the whole surface. The two obvious reductions both lie: a mean per
13950
+ * bucket smears a spike away, and taking every Nth sample skips it outright.
13951
+ * Either would give us a tool built to find peaks that does not show peaks.
13952
+ * `...Min` carries the other end, `samples` says how many raw snapshots folded
13953
+ * into the bucket, and a mean stays derivable where it is wanted.
13954
+ *
13955
+ * An UNREDUCED point is a one-sample bucket: `samples === 1` and each `...Min`
13956
+ * equals its unsuffixed twin. Reduced and unreduced are the same shape, so a
13957
+ * caller cannot tell which it received — which is what "one reader" means.
13958
+ */
13959
+ var LoadPointSchema = object({
13960
+ /** Bucket START, or the snapshot's own timestamp when unreduced. */
13961
+ atMs: number(),
13962
+ /** Raw snapshots in this bucket. Never 0 — AN EMPTY BUCKET IS ABSENT. */
13963
+ samples: number().int(),
13964
+ /**
13965
+ * `null` = UNKNOWN and it PROPAGATES: a bucket is null unless every process
13966
+ * of every snapshot in it reported a thread split. A partial sum is a
13967
+ * smaller number that looks exactly as real as a complete one.
13968
+ */
13969
+ cpuMainPercent: number().nullable(),
13970
+ cpuMainPercentMin: number().nullable(),
13971
+ cpuGcPercent: number().nullable(),
13972
+ cpuGcPercentMin: number().nullable(),
13973
+ /** Lifetime-average CPU%, summed. Always known — and never a rate. */
13974
+ cpuLifetimePercent: number(),
13975
+ cpuLifetimePercentMin: number(),
13976
+ memoryRssBytes: number(),
13977
+ memoryRssBytesMin: number(),
13978
+ processCount: number().int(),
13979
+ processCountMin: number().int()
13980
+ });
13981
+ /** One function's series. `key` is an addonId, `__root__` or `__unattributed__`. */
13982
+ var LoadFunctionSeriesSchema = object({
13983
+ key: string(),
13984
+ kind: _enum([
13985
+ "addon",
13986
+ "root",
13987
+ "unattributed"
13988
+ ]),
13989
+ /** Oldest-first. A missing interval is MISSING — never zero-filled. */
13990
+ points: array(LoadPointSchema).readonly()
13991
+ });
13992
+ var NodeLoadSeriesSchema = object({
13993
+ nodeId: string(),
13994
+ /** One entry per function seen in the window, heaviest-first. */
13995
+ series: array(LoadFunctionSeriesSchema).readonly(),
13996
+ /**
13997
+ * Width of one returned bucket, in ms. Equals the sampling cadence when no
13998
+ * reduction was needed — so a caller can always say what one point covers
13999
+ * without having to know whether it was reduced.
14000
+ */
14001
+ bucketMs: number(),
14002
+ /** Raw snapshots that went into this answer, across both tiers. */
14003
+ retainedSamples: number(),
14004
+ /** Oldest snapshot represented, or `null` when nothing is retained. */
14005
+ oldestAtMs: number().nullable(),
14006
+ /** The fixed sampling cadence in force on the cluster, in ms. */
14007
+ cadenceMs: number(),
14008
+ /**
14009
+ * Did the DURABLE tier contribute? `false` means the answer is the hot ring
14010
+ * alone — an agent (which holds no table), or a store that refused.
14011
+ * Reported because "the last hour" and "the last six hours" are different
14012
+ * questions and an operator must not have to guess which was answered.
14013
+ */
14014
+ durable: boolean()
14015
+ });
14016
+ var GetLoadSeriesInputSchema = object({
14017
+ /**
14018
+ * The node whose series is wanted.
14019
+ *
14020
+ * NOT named `nodeId`: the generated cap router strips a top-level
14021
+ * `nodeId` from every method input and uses it to ROUTE the call to
14022
+ * that node's provider (`generated-cap-routers.ts`). A series target
14023
+ * called `nodeId` would silently become a routing pin and never reach
14024
+ * the provider. The hub holds every node it hears from, so the
14025
+ * ordinary call is unpinned — answered by the hub, for any node.
14026
+ */
14027
+ forNodeId: string(),
14028
+ /**
14029
+ * EXCLUSIVE lower bound. A caller passes the newest `atMs` it already
14030
+ * holds and receives only what it is missing, so seeding a live chart
14031
+ * from this method cannot double a point already drawn.
14032
+ */
14033
+ sinceMs: number().optional(),
14034
+ /**
14035
+ * Most points the caller wants PER FUNCTION. The window is reduced to fit,
14036
+ * preserving min and max per bucket.
14037
+ *
14038
+ * Absent means NO reduction — legitimate for a short window and a trap for a
14039
+ * long one, which is why a chart passes its own pixel width.
14040
+ */
14041
+ maxPoints: number().int().positive().optional()
14042
+ });
13843
14043
  var SystemMetricsSchema = object({
13844
14044
  cpuPercent: number(),
13845
14045
  memoryPercent: number(),
@@ -13850,10 +14050,7 @@ var SystemMetricsSchema = object({
13850
14050
  gpuPercent: number().optional(),
13851
14051
  gpuMemoryPercent: number().optional()
13852
14052
  });
13853
- 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, {
13854
- kind: "mutation",
13855
- auth: "admin"
13856
- }), method(DumpHeapSnapshotInputSchema, DumpHeapSnapshotResultSchema, {
14053
+ 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, {
13857
14054
  kind: "mutation",
13858
14055
  auth: "admin"
13859
14056
  });
@@ -30378,6 +30575,15 @@ var LoggingSettingsPatchSchema = object({
30378
30575
  * authority over the whole hierarchy and answers for every layer, so the
30379
30576
  * layer selector needs a name the transport does not already own.
30380
30577
  */
30578
+ /**
30579
+ * One contribution, plus WHO reported it.
30580
+ *
30581
+ * The addon and node are added by the hub as it enumerates providers, never by
30582
+ * the contributor: an addon reporting its own identity could report somebody
30583
+ * else's, and the whole point of this surface is that no claim is made by
30584
+ * anyone but its owner.
30585
+ */
30586
+ var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
30381
30587
  var GetLoggingSettingsInputSchema = object({
30382
30588
  scopeNodeId: string().optional(),
30383
30589
  /**
@@ -30436,7 +30642,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
30436
30642
  }), method(_void(), SiteLocationStatusSchema, {
30437
30643
  kind: "mutation",
30438
30644
  auth: "admin"
30439
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
30645
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
30440
30646
  kind: "mutation",
30441
30647
  auth: "admin"
30442
30648
  });
@@ -33512,6 +33718,12 @@ Object.freeze({
33512
33718
  addonId: null,
33513
33719
  access: "create"
33514
33720
  },
33721
+ "dataStoreProvider.insertMany": {
33722
+ capName: "data-store-provider",
33723
+ capScope: "system",
33724
+ addonId: null,
33725
+ access: "create"
33726
+ },
33515
33727
  "dataStoreProvider.isEmpty": {
33516
33728
  capName: "data-store-provider",
33517
33729
  capScope: "system",
@@ -34826,6 +35038,12 @@ Object.freeze({
34826
35038
  addonId: null,
34827
35039
  access: "create"
34828
35040
  },
35041
+ "loadContribution.list": {
35042
+ capName: "load-contribution",
35043
+ capScope: "system",
35044
+ addonId: null,
35045
+ access: "view"
35046
+ },
34829
35047
  "localNetwork.downloadCa": {
34830
35048
  capName: "local-network",
34831
35049
  capScope: "system",
@@ -35126,17 +35344,17 @@ Object.freeze({
35126
35344
  addonId: null,
35127
35345
  access: "view"
35128
35346
  },
35129
- "metricsProvider.getProcessStats": {
35347
+ "metricsProvider.getLoadSeries": {
35130
35348
  capName: "metrics-provider",
35131
35349
  capScope: "system",
35132
35350
  addonId: null,
35133
35351
  access: "view"
35134
35352
  },
35135
- "metricsProvider.killProcess": {
35353
+ "metricsProvider.getProcessStats": {
35136
35354
  capName: "metrics-provider",
35137
35355
  capScope: "system",
35138
35356
  addonId: null,
35139
- access: "create"
35357
+ access: "view"
35140
35358
  },
35141
35359
  "metricsProvider.listAddonInstances": {
35142
35360
  capName: "metrics-provider",
@@ -37148,6 +37366,12 @@ Object.freeze({
37148
37366
  addonId: null,
37149
37367
  access: "create"
37150
37368
  },
37369
+ "settingsStore.insertMany": {
37370
+ capName: "settings-store",
37371
+ capScope: "system",
37372
+ addonId: null,
37373
+ access: "create"
37374
+ },
37151
37375
  "settingsStore.isEmpty": {
37152
37376
  capName: "settings-store",
37153
37377
  capScope: "system",
@@ -37760,6 +37984,12 @@ Object.freeze({
37760
37984
  addonId: null,
37761
37985
  access: "create"
37762
37986
  },
37987
+ "system.getLoadContributions": {
37988
+ capName: "system",
37989
+ capScope: "system",
37990
+ addonId: null,
37991
+ access: "view"
37992
+ },
37763
37993
  "system.getLoggingSettings": {
37764
37994
  capName: "system",
37765
37995
  capScope: "system",