@camstack/addon-provider-homeassistant 1.2.51 → 1.2.54
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.
- package/dist/addon.js +1 -1
- package/dist/addon.mjs +1 -1
- package/dist/{dist-DUg1XDEM.mjs → dist-BfdeH6US.mjs} +205 -5
- package/dist/{dist-CM28Yk-6.js → dist-D24orV6m.js} +205 -5
- package/dist/ha-export/ha-export.addon.js +1 -1
- package/dist/ha-export/ha-export.addon.mjs +1 -1
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_dist = require("./dist-
|
|
2
|
+
const require_dist = require("./dist-D24orV6m.js");
|
|
3
3
|
let node_crypto = require("node:crypto");
|
|
4
4
|
let node_zlib = require("node:zlib");
|
|
5
5
|
//#region src/ha-device-source.ts
|
package/dist/addon.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-
|
|
1
|
+
import { $ as presenceCapability, A as controlCapability, At as EventCategory, B as humiditySensorCapability, C as buildAddonRouteProvider, Ct as number, D as colorCapability, Dt as union, E as climateControlCapability, Et as string, F as eventEmitterCapability, G as motionCapability, H as lawnMowerControlCapability, I as fanControlCapability, J as notifierCapability, K as normalizeUnit, L as floodCapability, M as deviceAdoptionCapability, O as connectivityCapability, Ot as unknown, P as enumSensorCapability, Q as prepareNotification, R as gasCapability, S as brokerCapability, St as literal, T as carbonMonoxideCapability, Tt as record, U as lockControlCapability, V as imageCapability, W as mediaPlayerCapability, Y as numericSensorCapability, Z as powerMeterCapability, _ as automationControlCapability, _t as createEvent, at as temperatureSensorCapability, b as binaryCapability, bt as array, ct as valveCapability, d as TargetSchema, dt as weatherCapability, et as pressureSensorCapability, f as accessoriesCapability, ft as errMsg, g as ambientLightSensorCapability, gt as DeviceType, h as alarmPanelCapability, ht as DeviceRole, it as tamperCapability, j as coverCapability, k as contactCapability, kt as url, lt as vibrationCapability, m as airQualitySensorCapability, mt as DeviceFeature, n as BaseDevice, nt as smokeCapability, ot as updateCapability, p as addonRoutesCapability, q as notificationOutputCapability, r as BaseDeviceProvider, rt as switchCapability, s as EnumSensorDateTimeFormatSchema, st as vacuumControlCapability, tt as scriptRunnerCapability, ut as waterHeaterCapability, v as batteryCapability, w as buttonCapability, wt as object, x as brightnessCapability, xt as discriminatedUnion, y as bestLocationMatch, yt as _enum, z as humidifierCapability } from "./dist-BfdeH6US.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
import { brotliCompressSync, deflateSync, gzipSync } from "node:zlib";
|
|
4
4
|
//#region src/ha-device-source.ts
|
|
@@ -13825,6 +13825,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
13825
13825
|
limit: number().optional(),
|
|
13826
13826
|
tags: record(string(), string()).optional()
|
|
13827
13827
|
}), array(LogEntrySchema).readonly());
|
|
13828
|
+
/**
|
|
13829
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13830
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
13831
|
+
*
|
|
13832
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13833
|
+
*
|
|
13834
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13835
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13836
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13837
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13838
|
+
* somebody to forget to edit.
|
|
13839
|
+
*
|
|
13840
|
+
* They are not merged, because their invariants are opposites:
|
|
13841
|
+
*
|
|
13842
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13843
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13844
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13845
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13846
|
+
* and it is exactly what an absent entry cannot say.
|
|
13847
|
+
*
|
|
13848
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13849
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13850
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13851
|
+
* has no process.
|
|
13852
|
+
*
|
|
13853
|
+
* ## Why not a log line, since the counters already exist
|
|
13854
|
+
*
|
|
13855
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13856
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13857
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13858
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13859
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13860
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13861
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13862
|
+
* be READ.
|
|
13863
|
+
*
|
|
13864
|
+
* ## The rate is served with its denominator or not at all
|
|
13865
|
+
*
|
|
13866
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13867
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13868
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13869
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
13870
|
+
* reproduces that mistake on every read.
|
|
13871
|
+
*
|
|
13872
|
+
* ## Shape
|
|
13873
|
+
*
|
|
13874
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13875
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13876
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13877
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13878
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13879
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13880
|
+
* result through `system.getFailureContributions`.
|
|
13881
|
+
*/
|
|
13882
|
+
var FailureReasonCountSchema = object({
|
|
13883
|
+
/**
|
|
13884
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13885
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13886
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
13887
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
13888
|
+
* vocabulary for the same loss would make the row and the counter
|
|
13889
|
+
* un-joinable.
|
|
13890
|
+
*/
|
|
13891
|
+
reason: string(),
|
|
13892
|
+
count: number().int().nonnegative()
|
|
13893
|
+
});
|
|
13894
|
+
var FailureContributionSchema = object({
|
|
13895
|
+
/**
|
|
13896
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13897
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13898
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
13899
|
+
* is a central list that rots invisibly.
|
|
13900
|
+
*/
|
|
13901
|
+
family: string(),
|
|
13902
|
+
/**
|
|
13903
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13904
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13905
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
13906
|
+
* cannot answer the only question anybody asks of this surface.
|
|
13907
|
+
*/
|
|
13908
|
+
deviceId: number().int().positive(),
|
|
13909
|
+
/**
|
|
13910
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
13911
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13912
|
+
* family has a single variant.
|
|
13913
|
+
*/
|
|
13914
|
+
variant: string().optional(),
|
|
13915
|
+
/**
|
|
13916
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13917
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
13918
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13919
|
+
* `LoadContribution.startedAtMs`.
|
|
13920
|
+
*/
|
|
13921
|
+
sinceMs: number(),
|
|
13922
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13923
|
+
atMs: number(),
|
|
13924
|
+
/**
|
|
13925
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13926
|
+
* window. A failure count published without it is the mistake this schema
|
|
13927
|
+
* exists to make impossible.
|
|
13928
|
+
*/
|
|
13929
|
+
attempts: number().int().nonnegative(),
|
|
13930
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13931
|
+
succeeded: number().int().nonnegative(),
|
|
13932
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13933
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
13934
|
+
});
|
|
13935
|
+
method(_void(), array(FailureContributionSchema).readonly());
|
|
13828
13936
|
var LoadContributionSchema = object({
|
|
13829
13937
|
role: _enum([
|
|
13830
13938
|
"decode",
|
|
@@ -14132,6 +14240,50 @@ var NodeProcessSchema = object({
|
|
|
14132
14240
|
/** Wall-clock uptime (seconds). Parsed from `ps etime`. */
|
|
14133
14241
|
uptimeSec: number()
|
|
14134
14242
|
});
|
|
14243
|
+
/**
|
|
14244
|
+
* One retained container-memory reading.
|
|
14245
|
+
*
|
|
14246
|
+
* `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
|
|
14247
|
+
* a second clock: that is what makes "processes sum to X, container says Y"
|
|
14248
|
+
* subtractable per point rather than an eyeballed comparison of two series
|
|
14249
|
+
* sampled at different instants.
|
|
14250
|
+
*
|
|
14251
|
+
* A reduced window keeps the sample with the LARGEST `currentBytes` in each
|
|
14252
|
+
* bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
|
|
14253
|
+
* never coexisted, and a mean would smear away the peak this exists to find.
|
|
14254
|
+
*/
|
|
14255
|
+
var ContainerMemoryPointSchema = object({
|
|
14256
|
+
/** Which hierarchy answered, so a reading is never ambiguous. */
|
|
14257
|
+
source: _enum(["cgroup-v2", "cgroup-v1"]),
|
|
14258
|
+
/** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
|
|
14259
|
+
currentBytes: number(),
|
|
14260
|
+
/** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
|
|
14261
|
+
limitBytes: number().nullable(),
|
|
14262
|
+
/** Anonymous pages: the closest thing to "what the processes allocated". */
|
|
14263
|
+
anonBytes: number().nullable(),
|
|
14264
|
+
/** Page cache. Charged to the cgroup, owned by no process. */
|
|
14265
|
+
fileBytes: number().nullable(),
|
|
14266
|
+
/**
|
|
14267
|
+
* Shared memory — and the field that explained the largest single surprise.
|
|
14268
|
+
* The i915 driver backs GPU buffers with shmem, so an inference pool or a
|
|
14269
|
+
* hardware-decode session holding DRM objects is charged HERE and appears
|
|
14270
|
+
* nowhere in a `ps` scan.
|
|
14271
|
+
*/
|
|
14272
|
+
shmemBytes: number().nullable(),
|
|
14273
|
+
/** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
|
|
14274
|
+
slabBytes: number().nullable(),
|
|
14275
|
+
/**
|
|
14276
|
+
* Shrinkable i915 GEM object bytes, from debugfs.
|
|
14277
|
+
*
|
|
14278
|
+
* **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
|
|
14279
|
+
* component of `currentBytes` and must not be subtracted from it; it says
|
|
14280
|
+
* what put the shmem there, where `shmemBytes` only says how much.
|
|
14281
|
+
*
|
|
14282
|
+
* `null` wherever debugfs is not mounted — which is inside every camstack
|
|
14283
|
+
* container today — and on any node with no Intel GPU.
|
|
14284
|
+
*/
|
|
14285
|
+
gpuShmemBytes: number().nullable()
|
|
14286
|
+
}).extend({ atMs: number() });
|
|
14135
14287
|
var DumpHeapSnapshotInputSchema = object({
|
|
14136
14288
|
/** The addon whose runner should dump a heap snapshot. */
|
|
14137
14289
|
addonId: string() });
|
|
@@ -14195,6 +14347,21 @@ var NodeLoadSeriesSchema = object({
|
|
|
14195
14347
|
/** One entry per function seen in the window, heaviest-first. */
|
|
14196
14348
|
series: array(LoadFunctionSeriesSchema).readonly(),
|
|
14197
14349
|
/**
|
|
14350
|
+
* The CONTAINER's memory over the same window, oldest-first.
|
|
14351
|
+
*
|
|
14352
|
+
* Sits next to `series` rather than in a method of its own because the whole
|
|
14353
|
+
* question is a subtraction: the per-process rows in `series` sum to one
|
|
14354
|
+
* number and this one is another, and an operator who has to issue two calls
|
|
14355
|
+
* to compare them will compare two different instants. Same reader, same
|
|
14356
|
+
* `sinceMs`, same `bucketMs`, same timestamps.
|
|
14357
|
+
*
|
|
14358
|
+
* **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
|
|
14359
|
+
* Mac, a bare-metal host, a container with the hierarchy hidden — reports no
|
|
14360
|
+
* points at all. A zero here would be indistinguishable from a healthy
|
|
14361
|
+
* container and is precisely the lie this field exists to avoid.
|
|
14362
|
+
*/
|
|
14363
|
+
containerMemory: array(ContainerMemoryPointSchema).readonly(),
|
|
14364
|
+
/**
|
|
14198
14365
|
* Width of one returned bucket, in ms. Equals the sampling cadence when no
|
|
14199
14366
|
* reduction was needed — so a caller can always say what one point covers
|
|
14200
14367
|
* without having to know whether it was reduced.
|
|
@@ -18445,6 +18612,20 @@ var TrackSchema = object({
|
|
|
18445
18612
|
* `=== true` and render nothing otherwise — never infer "no rider".
|
|
18446
18613
|
*/
|
|
18447
18614
|
hasRider: boolean().optional(),
|
|
18615
|
+
/**
|
|
18616
|
+
* WHY this track ended without a NATIVE best-shot tile
|
|
18617
|
+
* ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
|
|
18618
|
+
* a composed token line (`no-key-frame capture=keyframe:native-missx4`,
|
|
18619
|
+
* `derive-returned-null tile=standin`, …) written at close and CLEARED by
|
|
18620
|
+
* the late-keyFrame upgrade when a native tile lands after all. The
|
|
18621
|
+
* operator-facing answer to "perché manca l'immagine?" on a track whose
|
|
18622
|
+
* tile is a face/plate stand-in, a raster crop, or an icon.
|
|
18623
|
+
*
|
|
18624
|
+
* **Absent ≠ "missed silently"**: a row written before the column, a hub
|
|
18625
|
+
* that predates the field, and every track whose tile landed native all
|
|
18626
|
+
* omit it. Render nothing when absent.
|
|
18627
|
+
*/
|
|
18628
|
+
previewMissReason: string().optional(),
|
|
18448
18629
|
...TrackFlagFields,
|
|
18449
18630
|
...TrackRetrainFields
|
|
18450
18631
|
});
|
|
@@ -27995,10 +28176,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
|
|
|
27995
28176
|
* recording config. NOTE on events (source of truth, R5/C3): this cap carries
|
|
27996
28177
|
* NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
|
|
27997
28178
|
* events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
|
|
27998
|
-
* rows)
|
|
27999
|
-
*
|
|
28000
|
-
*
|
|
28001
|
-
* (`interfaces/recording-config.ts`).
|
|
28179
|
+
* rows) and are the ONLY event surface — the recorder has none. The in-RAM
|
|
28180
|
+
* playback markers it used to build were deleted on 2026-08-29 because nothing
|
|
28181
|
+
* ever read them. Event<->footage joins are by time, padded with the shared
|
|
28182
|
+
* `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
|
|
28002
28183
|
*/
|
|
28003
28184
|
var RecordingStatusSchema = object({
|
|
28004
28185
|
deviceId: number(),
|
|
@@ -29709,6 +29890,13 @@ var LoggingSettingsPatchSchema = object({
|
|
|
29709
29890
|
* anyone but its owner.
|
|
29710
29891
|
*/
|
|
29711
29892
|
var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
|
|
29893
|
+
/**
|
|
29894
|
+
* One per-camera failure counter, plus WHO reported it.
|
|
29895
|
+
*
|
|
29896
|
+
* Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
|
|
29897
|
+
* the hub as it enumerates providers, never by the contributor.
|
|
29898
|
+
*/
|
|
29899
|
+
var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
|
|
29712
29900
|
var GetLoggingSettingsInputSchema = object({
|
|
29713
29901
|
scopeNodeId: string().optional(),
|
|
29714
29902
|
/**
|
|
@@ -29767,7 +29955,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
|
|
|
29767
29955
|
}), method(_void(), SiteLocationStatusSchema, {
|
|
29768
29956
|
kind: "mutation",
|
|
29769
29957
|
auth: "admin"
|
|
29770
|
-
}), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
|
|
29958
|
+
}), 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, {
|
|
29771
29959
|
kind: "mutation",
|
|
29772
29960
|
auth: "admin"
|
|
29773
29961
|
});
|
|
@@ -33757,6 +33945,12 @@ Object.freeze({
|
|
|
33757
33945
|
addonId: null,
|
|
33758
33946
|
access: "create"
|
|
33759
33947
|
},
|
|
33948
|
+
"failureContribution.list": {
|
|
33949
|
+
capName: "failure-contribution",
|
|
33950
|
+
capScope: "system",
|
|
33951
|
+
addonId: null,
|
|
33952
|
+
access: "view"
|
|
33953
|
+
},
|
|
33760
33954
|
"fanControl.setDirection": {
|
|
33761
33955
|
capName: "fan-control",
|
|
33762
33956
|
capScope: "device",
|
|
@@ -37063,6 +37257,12 @@ Object.freeze({
|
|
|
37063
37257
|
addonId: null,
|
|
37064
37258
|
access: "create"
|
|
37065
37259
|
},
|
|
37260
|
+
"system.getFailureContributions": {
|
|
37261
|
+
capName: "system",
|
|
37262
|
+
capScope: "system",
|
|
37263
|
+
addonId: null,
|
|
37264
|
+
access: "view"
|
|
37265
|
+
},
|
|
37066
37266
|
"system.getLoadContributions": {
|
|
37067
37267
|
capName: "system",
|
|
37068
37268
|
capScope: "system",
|
|
@@ -13825,6 +13825,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
13825
13825
|
limit: number().optional(),
|
|
13826
13826
|
tags: record(string(), string()).optional()
|
|
13827
13827
|
}), array(LogEntrySchema).readonly());
|
|
13828
|
+
/**
|
|
13829
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13830
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
13831
|
+
*
|
|
13832
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13833
|
+
*
|
|
13834
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13835
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13836
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13837
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13838
|
+
* somebody to forget to edit.
|
|
13839
|
+
*
|
|
13840
|
+
* They are not merged, because their invariants are opposites:
|
|
13841
|
+
*
|
|
13842
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13843
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13844
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13845
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13846
|
+
* and it is exactly what an absent entry cannot say.
|
|
13847
|
+
*
|
|
13848
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13849
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13850
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13851
|
+
* has no process.
|
|
13852
|
+
*
|
|
13853
|
+
* ## Why not a log line, since the counters already exist
|
|
13854
|
+
*
|
|
13855
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13856
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13857
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13858
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13859
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13860
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13861
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13862
|
+
* be READ.
|
|
13863
|
+
*
|
|
13864
|
+
* ## The rate is served with its denominator or not at all
|
|
13865
|
+
*
|
|
13866
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13867
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13868
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13869
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
13870
|
+
* reproduces that mistake on every read.
|
|
13871
|
+
*
|
|
13872
|
+
* ## Shape
|
|
13873
|
+
*
|
|
13874
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13875
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13876
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13877
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13878
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13879
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13880
|
+
* result through `system.getFailureContributions`.
|
|
13881
|
+
*/
|
|
13882
|
+
var FailureReasonCountSchema = object({
|
|
13883
|
+
/**
|
|
13884
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13885
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13886
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
13887
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
13888
|
+
* vocabulary for the same loss would make the row and the counter
|
|
13889
|
+
* un-joinable.
|
|
13890
|
+
*/
|
|
13891
|
+
reason: string(),
|
|
13892
|
+
count: number().int().nonnegative()
|
|
13893
|
+
});
|
|
13894
|
+
var FailureContributionSchema = object({
|
|
13895
|
+
/**
|
|
13896
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13897
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13898
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
13899
|
+
* is a central list that rots invisibly.
|
|
13900
|
+
*/
|
|
13901
|
+
family: string(),
|
|
13902
|
+
/**
|
|
13903
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13904
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13905
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
13906
|
+
* cannot answer the only question anybody asks of this surface.
|
|
13907
|
+
*/
|
|
13908
|
+
deviceId: number().int().positive(),
|
|
13909
|
+
/**
|
|
13910
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
13911
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13912
|
+
* family has a single variant.
|
|
13913
|
+
*/
|
|
13914
|
+
variant: string().optional(),
|
|
13915
|
+
/**
|
|
13916
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13917
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
13918
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13919
|
+
* `LoadContribution.startedAtMs`.
|
|
13920
|
+
*/
|
|
13921
|
+
sinceMs: number(),
|
|
13922
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13923
|
+
atMs: number(),
|
|
13924
|
+
/**
|
|
13925
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13926
|
+
* window. A failure count published without it is the mistake this schema
|
|
13927
|
+
* exists to make impossible.
|
|
13928
|
+
*/
|
|
13929
|
+
attempts: number().int().nonnegative(),
|
|
13930
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13931
|
+
succeeded: number().int().nonnegative(),
|
|
13932
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13933
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
13934
|
+
});
|
|
13935
|
+
method(_void(), array(FailureContributionSchema).readonly());
|
|
13828
13936
|
var LoadContributionSchema = object({
|
|
13829
13937
|
role: _enum([
|
|
13830
13938
|
"decode",
|
|
@@ -14132,6 +14240,50 @@ var NodeProcessSchema = object({
|
|
|
14132
14240
|
/** Wall-clock uptime (seconds). Parsed from `ps etime`. */
|
|
14133
14241
|
uptimeSec: number()
|
|
14134
14242
|
});
|
|
14243
|
+
/**
|
|
14244
|
+
* One retained container-memory reading.
|
|
14245
|
+
*
|
|
14246
|
+
* `atMs` is the timestamp of the PROCESS snapshot taken in the same tick, not
|
|
14247
|
+
* a second clock: that is what makes "processes sum to X, container says Y"
|
|
14248
|
+
* subtractable per point rather than an eyeballed comparison of two series
|
|
14249
|
+
* sampled at different instants.
|
|
14250
|
+
*
|
|
14251
|
+
* A reduced window keeps the sample with the LARGEST `currentBytes` in each
|
|
14252
|
+
* bucket, WHOLE. Taking a per-field maximum would synthesise a row whose parts
|
|
14253
|
+
* never coexisted, and a mean would smear away the peak this exists to find.
|
|
14254
|
+
*/
|
|
14255
|
+
var ContainerMemoryPointSchema = object({
|
|
14256
|
+
/** Which hierarchy answered, so a reading is never ambiguous. */
|
|
14257
|
+
source: _enum(["cgroup-v2", "cgroup-v1"]),
|
|
14258
|
+
/** `memory.current` (v2) / `memory.usage_in_bytes` (v1). Always known. */
|
|
14259
|
+
currentBytes: number(),
|
|
14260
|
+
/** The cgroup's ceiling. `null` = NO LIMIT — never a sentinel, never zero. */
|
|
14261
|
+
limitBytes: number().nullable(),
|
|
14262
|
+
/** Anonymous pages: the closest thing to "what the processes allocated". */
|
|
14263
|
+
anonBytes: number().nullable(),
|
|
14264
|
+
/** Page cache. Charged to the cgroup, owned by no process. */
|
|
14265
|
+
fileBytes: number().nullable(),
|
|
14266
|
+
/**
|
|
14267
|
+
* Shared memory — and the field that explained the largest single surprise.
|
|
14268
|
+
* The i915 driver backs GPU buffers with shmem, so an inference pool or a
|
|
14269
|
+
* hardware-decode session holding DRM objects is charged HERE and appears
|
|
14270
|
+
* nowhere in a `ps` scan.
|
|
14271
|
+
*/
|
|
14272
|
+
shmemBytes: number().nullable(),
|
|
14273
|
+
/** Kernel slab charged to this cgroup. `null` on v1, which never publishes it. */
|
|
14274
|
+
slabBytes: number().nullable(),
|
|
14275
|
+
/**
|
|
14276
|
+
* Shrinkable i915 GEM object bytes, from debugfs.
|
|
14277
|
+
*
|
|
14278
|
+
* **Host-wide across every DRM client, NOT cgroup-scoped.** It is not a
|
|
14279
|
+
* component of `currentBytes` and must not be subtracted from it; it says
|
|
14280
|
+
* what put the shmem there, where `shmemBytes` only says how much.
|
|
14281
|
+
*
|
|
14282
|
+
* `null` wherever debugfs is not mounted — which is inside every camstack
|
|
14283
|
+
* container today — and on any node with no Intel GPU.
|
|
14284
|
+
*/
|
|
14285
|
+
gpuShmemBytes: number().nullable()
|
|
14286
|
+
}).extend({ atMs: number() });
|
|
14135
14287
|
var DumpHeapSnapshotInputSchema = object({
|
|
14136
14288
|
/** The addon whose runner should dump a heap snapshot. */
|
|
14137
14289
|
addonId: string() });
|
|
@@ -14195,6 +14347,21 @@ var NodeLoadSeriesSchema = object({
|
|
|
14195
14347
|
/** One entry per function seen in the window, heaviest-first. */
|
|
14196
14348
|
series: array(LoadFunctionSeriesSchema).readonly(),
|
|
14197
14349
|
/**
|
|
14350
|
+
* The CONTAINER's memory over the same window, oldest-first.
|
|
14351
|
+
*
|
|
14352
|
+
* Sits next to `series` rather than in a method of its own because the whole
|
|
14353
|
+
* question is a subtraction: the per-process rows in `series` sum to one
|
|
14354
|
+
* number and this one is another, and an operator who has to issue two calls
|
|
14355
|
+
* to compare them will compare two different instants. Same reader, same
|
|
14356
|
+
* `sinceMs`, same `bucketMs`, same timestamps.
|
|
14357
|
+
*
|
|
14358
|
+
* **EMPTY means ABSENT, never zero.** A node with no cgroup — a developer
|
|
14359
|
+
* Mac, a bare-metal host, a container with the hierarchy hidden — reports no
|
|
14360
|
+
* points at all. A zero here would be indistinguishable from a healthy
|
|
14361
|
+
* container and is precisely the lie this field exists to avoid.
|
|
14362
|
+
*/
|
|
14363
|
+
containerMemory: array(ContainerMemoryPointSchema).readonly(),
|
|
14364
|
+
/**
|
|
14198
14365
|
* Width of one returned bucket, in ms. Equals the sampling cadence when no
|
|
14199
14366
|
* reduction was needed — so a caller can always say what one point covers
|
|
14200
14367
|
* without having to know whether it was reduced.
|
|
@@ -18445,6 +18612,20 @@ var TrackSchema = object({
|
|
|
18445
18612
|
* `=== true` and render nothing otherwise — never infer "no rider".
|
|
18446
18613
|
*/
|
|
18447
18614
|
hasRider: boolean().optional(),
|
|
18615
|
+
/**
|
|
18616
|
+
* WHY this track ended without a NATIVE best-shot tile
|
|
18617
|
+
* ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
|
|
18618
|
+
* a composed token line (`no-key-frame capture=keyframe:native-missx4`,
|
|
18619
|
+
* `derive-returned-null tile=standin`, …) written at close and CLEARED by
|
|
18620
|
+
* the late-keyFrame upgrade when a native tile lands after all. The
|
|
18621
|
+
* operator-facing answer to "perché manca l'immagine?" on a track whose
|
|
18622
|
+
* tile is a face/plate stand-in, a raster crop, or an icon.
|
|
18623
|
+
*
|
|
18624
|
+
* **Absent ≠ "missed silently"**: a row written before the column, a hub
|
|
18625
|
+
* that predates the field, and every track whose tile landed native all
|
|
18626
|
+
* omit it. Render nothing when absent.
|
|
18627
|
+
*/
|
|
18628
|
+
previewMissReason: string().optional(),
|
|
18448
18629
|
...TrackFlagFields,
|
|
18449
18630
|
...TrackRetrainFields
|
|
18450
18631
|
});
|
|
@@ -27995,10 +28176,10 @@ DeviceType.Camera, DeviceType.Sensor, DeviceType.Switch, method(object({ deviceI
|
|
|
27995
28176
|
* recording config. NOTE on events (source of truth, R5/C3): this cap carries
|
|
27996
28177
|
* NO event surface — `getPlaybackManifest` returns playlist URLs only. Timeline
|
|
27997
28178
|
* events (motion/object/audio) come from `pipelineAnalytics` (durable SQLite
|
|
27998
|
-
* rows)
|
|
27999
|
-
*
|
|
28000
|
-
*
|
|
28001
|
-
* (`interfaces/recording-config.ts`).
|
|
28179
|
+
* rows) and are the ONLY event surface — the recorder has none. The in-RAM
|
|
28180
|
+
* playback markers it used to build were deleted on 2026-08-29 because nothing
|
|
28181
|
+
* ever read them. Event<->footage joins are by time, padded with the shared
|
|
28182
|
+
* `EVENT_PAD_MS` (`interfaces/recording-config.ts`).
|
|
28002
28183
|
*/
|
|
28003
28184
|
var RecordingStatusSchema = object({
|
|
28004
28185
|
deviceId: number(),
|
|
@@ -29709,6 +29890,13 @@ var LoggingSettingsPatchSchema = object({
|
|
|
29709
29890
|
* anyone but its owner.
|
|
29710
29891
|
*/
|
|
29711
29892
|
var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
|
|
29893
|
+
/**
|
|
29894
|
+
* One per-camera failure counter, plus WHO reported it.
|
|
29895
|
+
*
|
|
29896
|
+
* Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
|
|
29897
|
+
* the hub as it enumerates providers, never by the contributor.
|
|
29898
|
+
*/
|
|
29899
|
+
var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
|
|
29712
29900
|
var GetLoggingSettingsInputSchema = object({
|
|
29713
29901
|
scopeNodeId: string().optional(),
|
|
29714
29902
|
/**
|
|
@@ -29767,7 +29955,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
|
|
|
29767
29955
|
}), method(_void(), SiteLocationStatusSchema, {
|
|
29768
29956
|
kind: "mutation",
|
|
29769
29957
|
auth: "admin"
|
|
29770
|
-
}), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
|
|
29958
|
+
}), 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, {
|
|
29771
29959
|
kind: "mutation",
|
|
29772
29960
|
auth: "admin"
|
|
29773
29961
|
});
|
|
@@ -33757,6 +33945,12 @@ Object.freeze({
|
|
|
33757
33945
|
addonId: null,
|
|
33758
33946
|
access: "create"
|
|
33759
33947
|
},
|
|
33948
|
+
"failureContribution.list": {
|
|
33949
|
+
capName: "failure-contribution",
|
|
33950
|
+
capScope: "system",
|
|
33951
|
+
addonId: null,
|
|
33952
|
+
access: "view"
|
|
33953
|
+
},
|
|
33760
33954
|
"fanControl.setDirection": {
|
|
33761
33955
|
capName: "fan-control",
|
|
33762
33956
|
capScope: "device",
|
|
@@ -37063,6 +37257,12 @@ Object.freeze({
|
|
|
37063
37257
|
addonId: null,
|
|
37064
37258
|
access: "create"
|
|
37065
37259
|
},
|
|
37260
|
+
"system.getFailureContributions": {
|
|
37261
|
+
capName: "system",
|
|
37262
|
+
capScope: "system",
|
|
37263
|
+
addonId: null,
|
|
37264
|
+
access: "view"
|
|
37265
|
+
},
|
|
37066
37266
|
"system.getLoadContributions": {
|
|
37067
37267
|
capName: "system",
|
|
37068
37268
|
capScope: "system",
|
|
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
|
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
5
|
//#endregion
|
|
6
|
-
const require_dist = require("../dist-
|
|
6
|
+
const require_dist = require("../dist-D24orV6m.js");
|
|
7
7
|
let node_crypto = require("node:crypto");
|
|
8
8
|
//#region src/ha-export/topics.ts
|
|
9
9
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-
|
|
1
|
+
import { At as EventCategory, C as buildAddonRouteProvider, Et as string, N as deviceExportCapability, X as oauthIntegrationCapability, a as COCO_TO_MACRO, c as FanDirectionSchema, i as CAMERA_SWITCH_ORDER, l as HvacModeSchema, o as CameraSwitchIdSchema, p as addonRoutesCapability, pt as BaseAddon, t as AlarmArmModeSchema, u as MediaPlayerRepeatSchema, vt as nodePin } from "../dist-BfdeH6US.mjs";
|
|
2
2
|
import { createHmac, timingSafeEqual } from "node:crypto";
|
|
3
3
|
//#region src/ha-export/topics.ts
|
|
4
4
|
/**
|