@camstack/addon-provider-reolink 1.2.60 → 1.2.61

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 CHANGED
@@ -13965,6 +13965,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13965
13965
  limit: number().optional(),
13966
13966
  tags: record(string(), string()).optional()
13967
13967
  }), array(LogEntrySchema).readonly());
13968
+ /**
13969
+ * `failure-contribution` — the capability an addon reports its OWN losses
13970
+ * through, per camera, with the denominator attached. It stores nothing.
13971
+ *
13972
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13973
+ *
13974
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13975
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13976
+ * copied: the contributor reports what it already knows, hub-main adds only
13977
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13978
+ * somebody to forget to edit.
13979
+ *
13980
+ * They are not merged, because their invariants are opposites:
13981
+ *
13982
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13983
+ * claim a camera cost nothing, which is a measurement nobody made;
13984
+ * - a `failure-contribution` zero is the **most valuable value on the
13985
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13986
+ * and it is exactly what an absent entry cannot say.
13987
+ *
13988
+ * Putting a loss counter on a cost entry would also break the reconciliation
13989
+ * that gives `load-contribution` its point: contributions are subtracted from
13990
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13991
+ * has no process.
13992
+ *
13993
+ * ## Why not a log line, since the counters already exist
13994
+ *
13995
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13996
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13997
+ * ends in a log line, and a log line is the thing the operator asked to stop
13998
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13999
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
14000
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
14001
+ * media blackout were both diagnosed. The counters stay; this is where they can
14002
+ * be READ.
14003
+ *
14004
+ * ## The rate is served with its denominator or not at all
14005
+ *
14006
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
14007
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
14008
+ * than yesterday" and was **flat across twelve hours** once divided by the
14009
+ * successes on the same path. A surface that publishes only the numerator
14010
+ * reproduces that mistake on every read.
14011
+ *
14012
+ * ## Shape
14013
+ *
14014
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
14015
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
14016
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
14017
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
14018
+ * a forked runner's entries reach hub-main over transport that already exists.
14019
+ * No new UDS message, no second registry (D3). The operator reads the assembled
14020
+ * result through `system.getFailureContributions`.
14021
+ */
14022
+ var FailureReasonCountSchema = object({
14023
+ /**
14024
+ * Why the attempt did not land, in the contributor's own vocabulary —
14025
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
14026
+ * strings that already appear in this repo's logs and, where one exists, the
14027
+ * same string the per-track `previewMissReason` records (D276): a second
14028
+ * vocabulary for the same loss would make the row and the counter
14029
+ * un-joinable.
14030
+ */
14031
+ reason: string(),
14032
+ count: number().int().nonnegative()
14033
+ });
14034
+ var FailureContributionSchema = object({
14035
+ /**
14036
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
14037
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
14038
+ * `unit` free: the families are owned by different addons and a shared enum
14039
+ * is a central list that rots invisibly.
14040
+ */
14041
+ family: string(),
14042
+ /**
14043
+ * The NUMERIC device id — the same value every log line carries as
14044
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
14045
+ * cannot name the camera must not emit the entry, because a fleet total
14046
+ * cannot answer the only question anybody asks of this surface.
14047
+ */
14048
+ deviceId: number().int().positive(),
14049
+ /**
14050
+ * A second dimension inside the family: the model / step id for an inference
14051
+ * timeout, so "which camera AND which model" is one read. Absent when the
14052
+ * family has a single variant.
14053
+ */
14054
+ variant: string().optional(),
14055
+ /**
14056
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
14057
+ * differencing two reads must drop the interval when it changes, because the
14058
+ * counter restarted from zero in a respawned runner. Same discipline as
14059
+ * `LoadContribution.startedAtMs`.
14060
+ */
14061
+ sinceMs: number(),
14062
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
14063
+ atMs: number(),
14064
+ /**
14065
+ * THE DENOMINATOR — every attempt on this path for this camera in the
14066
+ * window. A failure count published without it is the mistake this schema
14067
+ * exists to make impossible.
14068
+ */
14069
+ attempts: number().int().nonnegative(),
14070
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
14071
+ succeeded: number().int().nonnegative(),
14072
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
14073
+ reasons: array(FailureReasonCountSchema).readonly()
14074
+ });
14075
+ method(_void(), array(FailureContributionSchema).readonly());
13968
14076
  var LoadContributionSchema = object({
13969
14077
  role: _enum([
13970
14078
  "decode",
@@ -18555,6 +18663,20 @@ var TrackSchema = object({
18555
18663
  * `=== true` and render nothing otherwise — never infer "no rider".
18556
18664
  */
18557
18665
  hasRider: boolean().optional(),
18666
+ /**
18667
+ * WHY this track ended without a NATIVE best-shot tile
18668
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18669
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18670
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18671
+ * the late-keyFrame upgrade when a native tile lands after all. The
18672
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18673
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18674
+ *
18675
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18676
+ * that predates the field, and every track whose tile landed native all
18677
+ * omit it. Render nothing when absent.
18678
+ */
18679
+ previewMissReason: string().optional(),
18558
18680
  ...TrackFlagFields,
18559
18681
  ...TrackRetrainFields
18560
18682
  });
@@ -30119,6 +30241,13 @@ var LoggingSettingsPatchSchema = object({
30119
30241
  * anyone but its owner.
30120
30242
  */
30121
30243
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
30244
+ /**
30245
+ * One per-camera failure counter, plus WHO reported it.
30246
+ *
30247
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
30248
+ * the hub as it enumerates providers, never by the contributor.
30249
+ */
30250
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
30122
30251
  var GetLoggingSettingsInputSchema = object({
30123
30252
  scopeNodeId: string().optional(),
30124
30253
  /**
@@ -30177,7 +30306,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
30177
30306
  }), method(_void(), SiteLocationStatusSchema, {
30178
30307
  kind: "mutation",
30179
30308
  auth: "admin"
30180
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
30309
+ }), 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, {
30181
30310
  kind: "mutation",
30182
30311
  auth: "admin"
30183
30312
  });
@@ -34334,6 +34463,12 @@ Object.freeze({
34334
34463
  addonId: null,
34335
34464
  access: "create"
34336
34465
  },
34466
+ "failureContribution.list": {
34467
+ capName: "failure-contribution",
34468
+ capScope: "system",
34469
+ addonId: null,
34470
+ access: "view"
34471
+ },
34337
34472
  "fanControl.setDirection": {
34338
34473
  capName: "fan-control",
34339
34474
  capScope: "device",
@@ -37640,6 +37775,12 @@ Object.freeze({
37640
37775
  addonId: null,
37641
37776
  access: "create"
37642
37777
  },
37778
+ "system.getFailureContributions": {
37779
+ capName: "system",
37780
+ capScope: "system",
37781
+ addonId: null,
37782
+ access: "view"
37783
+ },
37643
37784
  "system.getLoadContributions": {
37644
37785
  capName: "system",
37645
37786
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -13960,6 +13960,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13960
13960
  limit: number().optional(),
13961
13961
  tags: record(string(), string()).optional()
13962
13962
  }), array(LogEntrySchema).readonly());
13963
+ /**
13964
+ * `failure-contribution` — the capability an addon reports its OWN losses
13965
+ * through, per camera, with the denominator attached. It stores nothing.
13966
+ *
13967
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13968
+ *
13969
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13970
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13971
+ * copied: the contributor reports what it already knows, hub-main adds only
13972
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13973
+ * somebody to forget to edit.
13974
+ *
13975
+ * They are not merged, because their invariants are opposites:
13976
+ *
13977
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13978
+ * claim a camera cost nothing, which is a measurement nobody made;
13979
+ * - a `failure-contribution` zero is the **most valuable value on the
13980
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13981
+ * and it is exactly what an absent entry cannot say.
13982
+ *
13983
+ * Putting a loss counter on a cost entry would also break the reconciliation
13984
+ * that gives `load-contribution` its point: contributions are subtracted from
13985
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13986
+ * has no process.
13987
+ *
13988
+ * ## Why not a log line, since the counters already exist
13989
+ *
13990
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13991
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13992
+ * ends in a log line, and a log line is the thing the operator asked to stop
13993
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13994
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13995
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13996
+ * media blackout were both diagnosed. The counters stay; this is where they can
13997
+ * be READ.
13998
+ *
13999
+ * ## The rate is served with its denominator or not at all
14000
+ *
14001
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
14002
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
14003
+ * than yesterday" and was **flat across twelve hours** once divided by the
14004
+ * successes on the same path. A surface that publishes only the numerator
14005
+ * reproduces that mistake on every read.
14006
+ *
14007
+ * ## Shape
14008
+ *
14009
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
14010
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
14011
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
14012
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
14013
+ * a forked runner's entries reach hub-main over transport that already exists.
14014
+ * No new UDS message, no second registry (D3). The operator reads the assembled
14015
+ * result through `system.getFailureContributions`.
14016
+ */
14017
+ var FailureReasonCountSchema = object({
14018
+ /**
14019
+ * Why the attempt did not land, in the contributor's own vocabulary —
14020
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
14021
+ * strings that already appear in this repo's logs and, where one exists, the
14022
+ * same string the per-track `previewMissReason` records (D276): a second
14023
+ * vocabulary for the same loss would make the row and the counter
14024
+ * un-joinable.
14025
+ */
14026
+ reason: string(),
14027
+ count: number().int().nonnegative()
14028
+ });
14029
+ var FailureContributionSchema = object({
14030
+ /**
14031
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
14032
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
14033
+ * `unit` free: the families are owned by different addons and a shared enum
14034
+ * is a central list that rots invisibly.
14035
+ */
14036
+ family: string(),
14037
+ /**
14038
+ * The NUMERIC device id — the same value every log line carries as
14039
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
14040
+ * cannot name the camera must not emit the entry, because a fleet total
14041
+ * cannot answer the only question anybody asks of this surface.
14042
+ */
14043
+ deviceId: number().int().positive(),
14044
+ /**
14045
+ * A second dimension inside the family: the model / step id for an inference
14046
+ * timeout, so "which camera AND which model" is one read. Absent when the
14047
+ * family has a single variant.
14048
+ */
14049
+ variant: string().optional(),
14050
+ /**
14051
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
14052
+ * differencing two reads must drop the interval when it changes, because the
14053
+ * counter restarted from zero in a respawned runner. Same discipline as
14054
+ * `LoadContribution.startedAtMs`.
14055
+ */
14056
+ sinceMs: number(),
14057
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
14058
+ atMs: number(),
14059
+ /**
14060
+ * THE DENOMINATOR — every attempt on this path for this camera in the
14061
+ * window. A failure count published without it is the mistake this schema
14062
+ * exists to make impossible.
14063
+ */
14064
+ attempts: number().int().nonnegative(),
14065
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
14066
+ succeeded: number().int().nonnegative(),
14067
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
14068
+ reasons: array(FailureReasonCountSchema).readonly()
14069
+ });
14070
+ method(_void(), array(FailureContributionSchema).readonly());
13963
14071
  var LoadContributionSchema = object({
13964
14072
  role: _enum([
13965
14073
  "decode",
@@ -18550,6 +18658,20 @@ var TrackSchema = object({
18550
18658
  * `=== true` and render nothing otherwise — never infer "no rider".
18551
18659
  */
18552
18660
  hasRider: boolean().optional(),
18661
+ /**
18662
+ * WHY this track ended without a NATIVE best-shot tile
18663
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18664
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18665
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18666
+ * the late-keyFrame upgrade when a native tile lands after all. The
18667
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18668
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18669
+ *
18670
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18671
+ * that predates the field, and every track whose tile landed native all
18672
+ * omit it. Render nothing when absent.
18673
+ */
18674
+ previewMissReason: string().optional(),
18553
18675
  ...TrackFlagFields,
18554
18676
  ...TrackRetrainFields
18555
18677
  });
@@ -30114,6 +30236,13 @@ var LoggingSettingsPatchSchema = object({
30114
30236
  * anyone but its owner.
30115
30237
  */
30116
30238
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
30239
+ /**
30240
+ * One per-camera failure counter, plus WHO reported it.
30241
+ *
30242
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
30243
+ * the hub as it enumerates providers, never by the contributor.
30244
+ */
30245
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
30117
30246
  var GetLoggingSettingsInputSchema = object({
30118
30247
  scopeNodeId: string().optional(),
30119
30248
  /**
@@ -30172,7 +30301,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
30172
30301
  }), method(_void(), SiteLocationStatusSchema, {
30173
30302
  kind: "mutation",
30174
30303
  auth: "admin"
30175
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
30304
+ }), 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, {
30176
30305
  kind: "mutation",
30177
30306
  auth: "admin"
30178
30307
  });
@@ -34329,6 +34458,12 @@ Object.freeze({
34329
34458
  addonId: null,
34330
34459
  access: "create"
34331
34460
  },
34461
+ "failureContribution.list": {
34462
+ capName: "failure-contribution",
34463
+ capScope: "system",
34464
+ addonId: null,
34465
+ access: "view"
34466
+ },
34332
34467
  "fanControl.setDirection": {
34333
34468
  capName: "fan-control",
34334
34469
  capScope: "device",
@@ -37635,6 +37770,12 @@ Object.freeze({
37635
37770
  addonId: null,
37636
37771
  access: "create"
37637
37772
  },
37773
+ "system.getFailureContributions": {
37774
+ capName: "system",
37775
+ capScope: "system",
37776
+ addonId: null,
37777
+ access: "view"
37778
+ },
37638
37779
  "system.getLoadContributions": {
37639
37780
  capName: "system",
37640
37781
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-reolink",
3
- "version": "1.2.60",
3
+ "version": "1.2.61",
4
4
  "description": "Reolink camera device provider addon for CamStack — native Baichuan protocol",
5
5
  "keywords": [
6
6
  "camstack",