@camstack/addon-agent-ui 1.2.39 → 1.2.42

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 +206 -6
  2. package/package.json +1 -1
package/dist/addon.js CHANGED
@@ -13206,6 +13206,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13206
13206
  limit: number().optional(),
13207
13207
  tags: record(string(), string()).optional()
13208
13208
  }), array(LogEntrySchema).readonly());
13209
+ /**
13210
+ * `failure-contribution` — the capability an addon reports its OWN losses
13211
+ * through, per camera, with the denominator attached. It stores nothing.
13212
+ *
13213
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13214
+ *
13215
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13216
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13217
+ * copied: the contributor reports what it already knows, hub-main adds only
13218
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13219
+ * somebody to forget to edit.
13220
+ *
13221
+ * They are not merged, because their invariants are opposites:
13222
+ *
13223
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13224
+ * claim a camera cost nothing, which is a measurement nobody made;
13225
+ * - a `failure-contribution` zero is the **most valuable value on the
13226
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13227
+ * and it is exactly what an absent entry cannot say.
13228
+ *
13229
+ * Putting a loss counter on a cost entry would also break the reconciliation
13230
+ * that gives `load-contribution` its point: contributions are subtracted from
13231
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13232
+ * has no process.
13233
+ *
13234
+ * ## Why not a log line, since the counters already exist
13235
+ *
13236
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13237
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13238
+ * ends in a log line, and a log line is the thing the operator asked to stop
13239
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13240
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13241
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13242
+ * media blackout were both diagnosed. The counters stay; this is where they can
13243
+ * be READ.
13244
+ *
13245
+ * ## The rate is served with its denominator or not at all
13246
+ *
13247
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13248
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13249
+ * than yesterday" and was **flat across twelve hours** once divided by the
13250
+ * successes on the same path. A surface that publishes only the numerator
13251
+ * reproduces that mistake on every read.
13252
+ *
13253
+ * ## Shape
13254
+ *
13255
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13256
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13257
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13258
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13259
+ * a forked runner's entries reach hub-main over transport that already exists.
13260
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13261
+ * result through `system.getFailureContributions`.
13262
+ */
13263
+ var FailureReasonCountSchema = object({
13264
+ /**
13265
+ * Why the attempt did not land, in the contributor's own vocabulary —
13266
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13267
+ * strings that already appear in this repo's logs and, where one exists, the
13268
+ * same string the per-track `previewMissReason` records (D276): a second
13269
+ * vocabulary for the same loss would make the row and the counter
13270
+ * un-joinable.
13271
+ */
13272
+ reason: string(),
13273
+ count: number().int().nonnegative()
13274
+ });
13275
+ var FailureContributionSchema = object({
13276
+ /**
13277
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13278
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13279
+ * `unit` free: the families are owned by different addons and a shared enum
13280
+ * is a central list that rots invisibly.
13281
+ */
13282
+ family: string(),
13283
+ /**
13284
+ * The NUMERIC device id — the same value every log line carries as
13285
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13286
+ * cannot name the camera must not emit the entry, because a fleet total
13287
+ * cannot answer the only question anybody asks of this surface.
13288
+ */
13289
+ deviceId: number().int().positive(),
13290
+ /**
13291
+ * A second dimension inside the family: the model / step id for an inference
13292
+ * timeout, so "which camera AND which model" is one read. Absent when the
13293
+ * family has a single variant.
13294
+ */
13295
+ variant: string().optional(),
13296
+ /**
13297
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13298
+ * differencing two reads must drop the interval when it changes, because the
13299
+ * counter restarted from zero in a respawned runner. Same discipline as
13300
+ * `LoadContribution.startedAtMs`.
13301
+ */
13302
+ sinceMs: number(),
13303
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13304
+ atMs: number(),
13305
+ /**
13306
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13307
+ * window. A failure count published without it is the mistake this schema
13308
+ * exists to make impossible.
13309
+ */
13310
+ attempts: number().int().nonnegative(),
13311
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13312
+ succeeded: number().int().nonnegative(),
13313
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13314
+ reasons: array(FailureReasonCountSchema).readonly()
13315
+ });
13316
+ method(_void(), array(FailureContributionSchema).readonly());
13209
13317
  var LoadContributionSchema = object({
13210
13318
  role: _enum([
13211
13319
  "decode",
@@ -13513,6 +13621,50 @@ var NodeProcessSchema = object({
13513
13621
  /** Wall-clock uptime (seconds). Parsed from `ps etime`. */
13514
13622
  uptimeSec: number()
13515
13623
  });
13624
+ /**
13625
+ * One retained container-memory reading.
13626
+ *
13627
+ * `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
13628
+ * a second clock: that is what makes "processes sum to X, container says Y"
13629
+ * subtractable per point rather than an eyeballed comparison of two series
13630
+ * sampled at different instants.
13631
+ *
13632
+ * A reduced window keeps the sample with the LARGEST `currentBytes` in each
13633
+ * bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
13634
+ * never coexisted, and a mean would smear away the peak this exists to find.
13635
+ */
13636
+ var ContainerMemoryPointSchema = object({
13637
+ /** Which hierarchy answered, so a reading is never ambiguous. */
13638
+ source: _enum(["cgroup-v2", "cgroup-v1"]),
13639
+ /** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
13640
+ currentBytes: number(),
13641
+ /** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
13642
+ limitBytes: number().nullable(),
13643
+ /** Anonymous pages: the closest thing to "what the processes allocated". */
13644
+ anonBytes: number().nullable(),
13645
+ /** Page cache. Charged to the cgroup, owned by no process. */
13646
+ fileBytes: number().nullable(),
13647
+ /**
13648
+ * Shared memory — and the field that explained the largest single surprise.
13649
+ * The i915 driver backs GPU buffers with shmem, so an inference pool or a
13650
+ * hardware-decode session holding DRM objects is charged HERE and appears
13651
+ * nowhere in a `ps` scan.
13652
+ */
13653
+ shmemBytes: number().nullable(),
13654
+ /** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
13655
+ slabBytes: number().nullable(),
13656
+ /**
13657
+ * Shrinkable i915 GEM object bytes, from debugfs.
13658
+ *
13659
+ * **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
13660
+ * component of `currentBytes` and must not be subtracted from it; it says
13661
+ * what put the shmem there, where `shmemBytes` only says how much.
13662
+ *
13663
+ * `null` wherever debugfs is not mounted — which is inside every camstack
13664
+ * container today — and on any node with no Intel GPU.
13665
+ */
13666
+ gpuShmemBytes: number().nullable()
13667
+ }).extend({ atMs: number() });
13516
13668
  var DumpHeapSnapshotInputSchema = object({
13517
13669
  /** The addon whose runner should dump a heap snapshot. */
13518
13670
  addonId: string() });
@@ -13576,6 +13728,21 @@ var NodeLoadSeriesSchema = object({
13576
13728
  /** One entry per function seen in the window, heaviest-first. */
13577
13729
  series: array(LoadFunctionSeriesSchema).readonly(),
13578
13730
  /**
13731
+ * The CONTAINER's memory over the same window, oldest-first.
13732
+ *
13733
+ * Sits next to `series` rather than in a method of its own because the whole
13734
+ * question is a subtraction: the per-process rows in `series` sum to one
13735
+ * number and this one is another, and an operator who has to issue two calls
13736
+ * to compare them will compare two different instants. Same reader, same
13737
+ * `sinceMs`, same `bucketMs`, same timestamps.
13738
+ *
13739
+ * **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
13740
+ * Mac, a bare-metal host, a container with the hierarchy hidden — reports no
13741
+ * points at all. A zero here would be indistinguishable from a healthy
13742
+ * container and is precisely the lie this field exists to avoid.
13743
+ */
13744
+ containerMemory: array(ContainerMemoryPointSchema).readonly(),
13745
+ /**
13579
13746
  * Width of one returned bucket, in ms. Equals the sampling cadence when no
13580
13747
  * reduction was needed — so a caller can always say what one point covers
13581
13748
  * without having to know whether it was reduced.
@@ -17718,6 +17885,20 @@ var TrackSchema = object({
17718
17885
  * `=== true` and render nothing otherwise — never infer "no rider".
17719
17886
  */
17720
17887
  hasRider: boolean().optional(),
17888
+ /**
17889
+ * WHY this track ended without a NATIVE best-shot tile
17890
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
17891
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
17892
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
17893
+ * the late-keyFrame upgrade when a native tile lands after all. The
17894
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
17895
+ * tile is a face/plate stand-in, a raster crop, or an icon.
17896
+ *
17897
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
17898
+ * that predates the field, and every track whose tile landed native all
17899
+ * omit it. Render nothing when absent.
17900
+ */
17901
+ previewMissReason: string().optional(),
17721
17902
  ...TrackFlagFields,
17722
17903
  ...TrackRetrainFields
17723
17904
  });
@@ -25491,10 +25672,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
25491
25672
  * recording config. NOTE on events (source of truth, R5/C3): this cap carries
25492
25673
  * NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
25493
25674
  * events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
25494
- * rows); the recorder's internal EventMap markers are ephemeral in-RAM
25495
- * annotations that are not exposed here and must not be treated as an event
25496
- * feed. Event<->footage joins are by time, padded with the shared `EVENT_PAD_MS`
25497
- * (`interfaces/recording-config.ts`).
25675
+ * rows) and are the ONLY event surface the recorder has none. The in-RAM
25676
+ * playback markers it used to build were deleted on 2026-08-29 because nothing
25677
+ * ever read them. Event<->footage joins are by time, padded with the shared
25678
+ * `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
25498
25679
  */
25499
25680
  var RecordingStatusSchema = object({
25500
25681
  deviceId: number(),
@@ -26944,6 +27125,13 @@ var LoggingSettingsPatchSchema = object({
26944
27125
  * anyone but its owner.
26945
27126
  */
26946
27127
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
27128
+ /**
27129
+ * One per-camera failure counter, plus WHO reported it.
27130
+ *
27131
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
27132
+ * the hub as it enumerates providers, never by the contributor.
27133
+ */
27134
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
26947
27135
  var GetLoggingSettingsInputSchema = object({
26948
27136
  scopeNodeId: string().optional(),
26949
27137
  /**
@@ -27002,7 +27190,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
27002
27190
  }), method(_void(), SiteLocationStatusSchema, {
27003
27191
  kind: "mutation",
27004
27192
  auth: "admin"
27005
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27193
+ }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(_void(), array(ReportedFailureContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27006
27194
  kind: "mutation",
27007
27195
  auth: "admin"
27008
27196
  });
@@ -29584,6 +29772,12 @@ Object.freeze({
29584
29772
  addonId: null,
29585
29773
  access: "create"
29586
29774
  },
29775
+ "failureContribution.list": {
29776
+ capName: "failure-contribution",
29777
+ capScope: "system",
29778
+ addonId: null,
29779
+ access: "view"
29780
+ },
29587
29781
  "fanControl.setDirection": {
29588
29782
  capName: "fan-control",
29589
29783
  capScope: "device",
@@ -32890,6 +33084,12 @@ Object.freeze({
32890
33084
  addonId: null,
32891
33085
  access: "create"
32892
33086
  },
33087
+ "system.getFailureContributions": {
33088
+ capName: "system",
33089
+ capScope: "system",
33090
+ addonId: null,
33091
+ access: "view"
33092
+ },
32893
33093
  "system.getLoadContributions": {
32894
33094
  capName: "system",
32895
33095
  capScope: "system",
@@ -35797,7 +35997,7 @@ var AgentUIAddon = class extends BaseAddon {
35797
35997
  capability: adminUiCapability,
35798
35998
  provider: {
35799
35999
  getStaticDir: async () => ({ staticDir: path.resolve(__dirname) }),
35800
- getVersion: async () => ({ version: "1.2.39" })
36000
+ getVersion: async () => ({ version: "1.2.42" })
35801
36001
  }
35802
36002
  }];
35803
36003
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-agent-ui",
3
- "version": "1.2.39",
3
+ "version": "1.2.42",
4
4
  "description": "Agent UI — lightweight status dashboard served by every agent node",
5
5
  "keywords": [
6
6
  "camstack",