@camstack/addon-provider-hikvision 1.2.45 → 1.2.46

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
@@ -13649,6 +13649,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13649
13649
  limit: number().optional(),
13650
13650
  tags: record(string(), string()).optional()
13651
13651
  }), array(LogEntrySchema).readonly());
13652
+ /**
13653
+ * `failure-contribution` — the capability an addon reports its OWN losses
13654
+ * through, per camera, with the denominator attached. It stores nothing.
13655
+ *
13656
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13657
+ *
13658
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13659
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13660
+ * copied: the contributor reports what it already knows, hub-main adds only
13661
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13662
+ * somebody to forget to edit.
13663
+ *
13664
+ * They are not merged, because their invariants are opposites:
13665
+ *
13666
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13667
+ * claim a camera cost nothing, which is a measurement nobody made;
13668
+ * - a `failure-contribution` zero is the **most valuable value on the
13669
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13670
+ * and it is exactly what an absent entry cannot say.
13671
+ *
13672
+ * Putting a loss counter on a cost entry would also break the reconciliation
13673
+ * that gives `load-contribution` its point: contributions are subtracted from
13674
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13675
+ * has no process.
13676
+ *
13677
+ * ## Why not a log line, since the counters already exist
13678
+ *
13679
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13680
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13681
+ * ends in a log line, and a log line is the thing the operator asked to stop
13682
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13683
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13684
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13685
+ * media blackout were both diagnosed. The counters stay; this is where they can
13686
+ * be READ.
13687
+ *
13688
+ * ## The rate is served with its denominator or not at all
13689
+ *
13690
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13691
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13692
+ * than yesterday" and was **flat across twelve hours** once divided by the
13693
+ * successes on the same path. A surface that publishes only the numerator
13694
+ * reproduces that mistake on every read.
13695
+ *
13696
+ * ## Shape
13697
+ *
13698
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13699
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13700
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13701
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13702
+ * a forked runner's entries reach hub-main over transport that already exists.
13703
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13704
+ * result through `system.getFailureContributions`.
13705
+ */
13706
+ var FailureReasonCountSchema = object({
13707
+ /**
13708
+ * Why the attempt did not land, in the contributor's own vocabulary —
13709
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13710
+ * strings that already appear in this repo's logs and, where one exists, the
13711
+ * same string the per-track `previewMissReason` records (D276): a second
13712
+ * vocabulary for the same loss would make the row and the counter
13713
+ * un-joinable.
13714
+ */
13715
+ reason: string(),
13716
+ count: number().int().nonnegative()
13717
+ });
13718
+ var FailureContributionSchema = object({
13719
+ /**
13720
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13721
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13722
+ * `unit` free: the families are owned by different addons and a shared enum
13723
+ * is a central list that rots invisibly.
13724
+ */
13725
+ family: string(),
13726
+ /**
13727
+ * The NUMERIC device id — the same value every log line carries as
13728
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13729
+ * cannot name the camera must not emit the entry, because a fleet total
13730
+ * cannot answer the only question anybody asks of this surface.
13731
+ */
13732
+ deviceId: number().int().positive(),
13733
+ /**
13734
+ * A second dimension inside the family: the model / step id for an inference
13735
+ * timeout, so "which camera AND which model" is one read. Absent when the
13736
+ * family has a single variant.
13737
+ */
13738
+ variant: string().optional(),
13739
+ /**
13740
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13741
+ * differencing two reads must drop the interval when it changes, because the
13742
+ * counter restarted from zero in a respawned runner. Same discipline as
13743
+ * `LoadContribution.startedAtMs`.
13744
+ */
13745
+ sinceMs: number(),
13746
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13747
+ atMs: number(),
13748
+ /**
13749
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13750
+ * window. A failure count published without it is the mistake this schema
13751
+ * exists to make impossible.
13752
+ */
13753
+ attempts: number().int().nonnegative(),
13754
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13755
+ succeeded: number().int().nonnegative(),
13756
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13757
+ reasons: array(FailureReasonCountSchema).readonly()
13758
+ });
13759
+ method(_void(), array(FailureContributionSchema).readonly());
13652
13760
  var LoadContributionSchema = object({
13653
13761
  role: _enum([
13654
13762
  "decode",
@@ -18239,6 +18347,20 @@ var TrackSchema = object({
18239
18347
  * `=== true` and render nothing otherwise — never infer "no rider".
18240
18348
  */
18241
18349
  hasRider: boolean().optional(),
18350
+ /**
18351
+ * WHY this track ended without a NATIVE best-shot tile
18352
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18353
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18354
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18355
+ * the late-keyFrame upgrade when a native tile lands after all. The
18356
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18357
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18358
+ *
18359
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18360
+ * that predates the field, and every track whose tile landed native all
18361
+ * omit it. Render nothing when absent.
18362
+ */
18363
+ previewMissReason: string().optional(),
18242
18364
  ...TrackFlagFields,
18243
18365
  ...TrackRetrainFields
18244
18366
  });
@@ -29849,6 +29971,13 @@ var LoggingSettingsPatchSchema = object({
29849
29971
  * anyone but its owner.
29850
29972
  */
29851
29973
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
29974
+ /**
29975
+ * One per-camera failure counter, plus WHO reported it.
29976
+ *
29977
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
29978
+ * the hub as it enumerates providers, never by the contributor.
29979
+ */
29980
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
29852
29981
  var GetLoggingSettingsInputSchema = object({
29853
29982
  scopeNodeId: string().optional(),
29854
29983
  /**
@@ -29907,7 +30036,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29907
30036
  }), method(_void(), SiteLocationStatusSchema, {
29908
30037
  kind: "mutation",
29909
30038
  auth: "admin"
29910
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
30039
+ }), 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, {
29911
30040
  kind: "mutation",
29912
30041
  auth: "admin"
29913
30042
  });
@@ -34130,6 +34259,12 @@ Object.freeze({
34130
34259
  addonId: null,
34131
34260
  access: "create"
34132
34261
  },
34262
+ "failureContribution.list": {
34263
+ capName: "failure-contribution",
34264
+ capScope: "system",
34265
+ addonId: null,
34266
+ access: "view"
34267
+ },
34133
34268
  "fanControl.setDirection": {
34134
34269
  capName: "fan-control",
34135
34270
  capScope: "device",
@@ -37436,6 +37571,12 @@ Object.freeze({
37436
37571
  addonId: null,
37437
37572
  access: "create"
37438
37573
  },
37574
+ "system.getFailureContributions": {
37575
+ capName: "system",
37576
+ capScope: "system",
37577
+ addonId: null,
37578
+ access: "view"
37579
+ },
37439
37580
  "system.getLoadContributions": {
37440
37581
  capName: "system",
37441
37582
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -13650,6 +13650,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13650
13650
  limit: number().optional(),
13651
13651
  tags: record(string(), string()).optional()
13652
13652
  }), array(LogEntrySchema).readonly());
13653
+ /**
13654
+ * `failure-contribution` — the capability an addon reports its OWN losses
13655
+ * through, per camera, with the denominator attached. It stores nothing.
13656
+ *
13657
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13658
+ *
13659
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13660
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13661
+ * copied: the contributor reports what it already knows, hub-main adds only
13662
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13663
+ * somebody to forget to edit.
13664
+ *
13665
+ * They are not merged, because their invariants are opposites:
13666
+ *
13667
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13668
+ * claim a camera cost nothing, which is a measurement nobody made;
13669
+ * - a `failure-contribution` zero is the **most valuable value on the
13670
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13671
+ * and it is exactly what an absent entry cannot say.
13672
+ *
13673
+ * Putting a loss counter on a cost entry would also break the reconciliation
13674
+ * that gives `load-contribution` its point: contributions are subtracted from
13675
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13676
+ * has no process.
13677
+ *
13678
+ * ## Why not a log line, since the counters already exist
13679
+ *
13680
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13681
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13682
+ * ends in a log line, and a log line is the thing the operator asked to stop
13683
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13684
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13685
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13686
+ * media blackout were both diagnosed. The counters stay; this is where they can
13687
+ * be READ.
13688
+ *
13689
+ * ## The rate is served with its denominator or not at all
13690
+ *
13691
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13692
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13693
+ * than yesterday" and was **flat across twelve hours** once divided by the
13694
+ * successes on the same path. A surface that publishes only the numerator
13695
+ * reproduces that mistake on every read.
13696
+ *
13697
+ * ## Shape
13698
+ *
13699
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13700
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13701
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13702
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13703
+ * a forked runner's entries reach hub-main over transport that already exists.
13704
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13705
+ * result through `system.getFailureContributions`.
13706
+ */
13707
+ var FailureReasonCountSchema = object({
13708
+ /**
13709
+ * Why the attempt did not land, in the contributor's own vocabulary —
13710
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13711
+ * strings that already appear in this repo's logs and, where one exists, the
13712
+ * same string the per-track `previewMissReason` records (D276): a second
13713
+ * vocabulary for the same loss would make the row and the counter
13714
+ * un-joinable.
13715
+ */
13716
+ reason: string(),
13717
+ count: number().int().nonnegative()
13718
+ });
13719
+ var FailureContributionSchema = object({
13720
+ /**
13721
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13722
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13723
+ * `unit` free: the families are owned by different addons and a shared enum
13724
+ * is a central list that rots invisibly.
13725
+ */
13726
+ family: string(),
13727
+ /**
13728
+ * The NUMERIC device id — the same value every log line carries as
13729
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13730
+ * cannot name the camera must not emit the entry, because a fleet total
13731
+ * cannot answer the only question anybody asks of this surface.
13732
+ */
13733
+ deviceId: number().int().positive(),
13734
+ /**
13735
+ * A second dimension inside the family: the model / step id for an inference
13736
+ * timeout, so "which camera AND which model" is one read. Absent when the
13737
+ * family has a single variant.
13738
+ */
13739
+ variant: string().optional(),
13740
+ /**
13741
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13742
+ * differencing two reads must drop the interval when it changes, because the
13743
+ * counter restarted from zero in a respawned runner. Same discipline as
13744
+ * `LoadContribution.startedAtMs`.
13745
+ */
13746
+ sinceMs: number(),
13747
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13748
+ atMs: number(),
13749
+ /**
13750
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13751
+ * window. A failure count published without it is the mistake this schema
13752
+ * exists to make impossible.
13753
+ */
13754
+ attempts: number().int().nonnegative(),
13755
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13756
+ succeeded: number().int().nonnegative(),
13757
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13758
+ reasons: array(FailureReasonCountSchema).readonly()
13759
+ });
13760
+ method(_void(), array(FailureContributionSchema).readonly());
13653
13761
  var LoadContributionSchema = object({
13654
13762
  role: _enum([
13655
13763
  "decode",
@@ -18240,6 +18348,20 @@ var TrackSchema = object({
18240
18348
  * `=== true` and render nothing otherwise — never infer "no rider".
18241
18349
  */
18242
18350
  hasRider: boolean().optional(),
18351
+ /**
18352
+ * WHY this track ended without a NATIVE best-shot tile
18353
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18354
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18355
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18356
+ * the late-keyFrame upgrade when a native tile lands after all. The
18357
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18358
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18359
+ *
18360
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18361
+ * that predates the field, and every track whose tile landed native all
18362
+ * omit it. Render nothing when absent.
18363
+ */
18364
+ previewMissReason: string().optional(),
18243
18365
  ...TrackFlagFields,
18244
18366
  ...TrackRetrainFields
18245
18367
  });
@@ -29850,6 +29972,13 @@ var LoggingSettingsPatchSchema = object({
29850
29972
  * anyone but its owner.
29851
29973
  */
29852
29974
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
29975
+ /**
29976
+ * One per-camera failure counter, plus WHO reported it.
29977
+ *
29978
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
29979
+ * the hub as it enumerates providers, never by the contributor.
29980
+ */
29981
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
29853
29982
  var GetLoggingSettingsInputSchema = object({
29854
29983
  scopeNodeId: string().optional(),
29855
29984
  /**
@@ -29908,7 +30037,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29908
30037
  }), method(_void(), SiteLocationStatusSchema, {
29909
30038
  kind: "mutation",
29910
30039
  auth: "admin"
29911
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
30040
+ }), 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, {
29912
30041
  kind: "mutation",
29913
30042
  auth: "admin"
29914
30043
  });
@@ -34131,6 +34260,12 @@ Object.freeze({
34131
34260
  addonId: null,
34132
34261
  access: "create"
34133
34262
  },
34263
+ "failureContribution.list": {
34264
+ capName: "failure-contribution",
34265
+ capScope: "system",
34266
+ addonId: null,
34267
+ access: "view"
34268
+ },
34134
34269
  "fanControl.setDirection": {
34135
34270
  capName: "fan-control",
34136
34271
  capScope: "device",
@@ -37437,6 +37572,12 @@ Object.freeze({
37437
37572
  addonId: null,
37438
37573
  access: "create"
37439
37574
  },
37575
+ "system.getFailureContributions": {
37576
+ capName: "system",
37577
+ capScope: "system",
37578
+ addonId: null,
37579
+ access: "view"
37580
+ },
37440
37581
  "system.getLoadContributions": {
37441
37582
  capName: "system",
37442
37583
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-hikvision",
3
- "version": "1.2.45",
3
+ "version": "1.2.46",
4
4
  "description": "Hikvision camera device provider addon for CamStack — ISAPI over HTTP(S) with digest auth (snapshot, alarm stream, RTSP discovery)",
5
5
  "keywords": [
6
6
  "camstack",