@camstack/addon-provider-dreo 0.2.38 → 0.2.39

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
@@ -13520,6 +13520,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13520
13520
  limit: number().optional(),
13521
13521
  tags: record(string(), string()).optional()
13522
13522
  }), array(LogEntrySchema).readonly());
13523
+ /**
13524
+ * `failure-contribution` — the capability an addon reports its OWN losses
13525
+ * through, per camera, with the denominator attached. It stores nothing.
13526
+ *
13527
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13528
+ *
13529
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13530
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13531
+ * copied: the contributor reports what it already knows, hub-main adds only
13532
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13533
+ * somebody to forget to edit.
13534
+ *
13535
+ * They are not merged, because their invariants are opposites:
13536
+ *
13537
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13538
+ * claim a camera cost nothing, which is a measurement nobody made;
13539
+ * - a `failure-contribution` zero is the **most valuable value on the
13540
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13541
+ * and it is exactly what an absent entry cannot say.
13542
+ *
13543
+ * Putting a loss counter on a cost entry would also break the reconciliation
13544
+ * that gives `load-contribution` its point: contributions are subtracted from
13545
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13546
+ * has no process.
13547
+ *
13548
+ * ## Why not a log line, since the counters already exist
13549
+ *
13550
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13551
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13552
+ * ends in a log line, and a log line is the thing the operator asked to stop
13553
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13554
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13555
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13556
+ * media blackout were both diagnosed. The counters stay; this is where they can
13557
+ * be READ.
13558
+ *
13559
+ * ## The rate is served with its denominator or not at all
13560
+ *
13561
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13562
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13563
+ * than yesterday" and was **flat across twelve hours** once divided by the
13564
+ * successes on the same path. A surface that publishes only the numerator
13565
+ * reproduces that mistake on every read.
13566
+ *
13567
+ * ## Shape
13568
+ *
13569
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13570
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13571
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13572
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13573
+ * a forked runner's entries reach hub-main over transport that already exists.
13574
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13575
+ * result through `system.getFailureContributions`.
13576
+ */
13577
+ var FailureReasonCountSchema = object({
13578
+ /**
13579
+ * Why the attempt did not land, in the contributor's own vocabulary —
13580
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13581
+ * strings that already appear in this repo's logs and, where one exists, the
13582
+ * same string the per-track `previewMissReason` records (D276): a second
13583
+ * vocabulary for the same loss would make the row and the counter
13584
+ * un-joinable.
13585
+ */
13586
+ reason: string(),
13587
+ count: number().int().nonnegative()
13588
+ });
13589
+ var FailureContributionSchema = object({
13590
+ /**
13591
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13592
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13593
+ * `unit` free: the families are owned by different addons and a shared enum
13594
+ * is a central list that rots invisibly.
13595
+ */
13596
+ family: string(),
13597
+ /**
13598
+ * The NUMERIC device id — the same value every log line carries as
13599
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13600
+ * cannot name the camera must not emit the entry, because a fleet total
13601
+ * cannot answer the only question anybody asks of this surface.
13602
+ */
13603
+ deviceId: number().int().positive(),
13604
+ /**
13605
+ * A second dimension inside the family: the model / step id for an inference
13606
+ * timeout, so "which camera AND which model" is one read. Absent when the
13607
+ * family has a single variant.
13608
+ */
13609
+ variant: string().optional(),
13610
+ /**
13611
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13612
+ * differencing two reads must drop the interval when it changes, because the
13613
+ * counter restarted from zero in a respawned runner. Same discipline as
13614
+ * `LoadContribution.startedAtMs`.
13615
+ */
13616
+ sinceMs: number(),
13617
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13618
+ atMs: number(),
13619
+ /**
13620
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13621
+ * window. A failure count published without it is the mistake this schema
13622
+ * exists to make impossible.
13623
+ */
13624
+ attempts: number().int().nonnegative(),
13625
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13626
+ succeeded: number().int().nonnegative(),
13627
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13628
+ reasons: array(FailureReasonCountSchema).readonly()
13629
+ });
13630
+ method(_void(), array(FailureContributionSchema).readonly());
13523
13631
  var LoadContributionSchema = object({
13524
13632
  role: _enum([
13525
13633
  "decode",
@@ -18110,6 +18218,20 @@ var TrackSchema = object({
18110
18218
  * `=== true` and render nothing otherwise — never infer "no rider".
18111
18219
  */
18112
18220
  hasRider: boolean().optional(),
18221
+ /**
18222
+ * WHY this track ended without a NATIVE best-shot tile
18223
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18224
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18225
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18226
+ * the late-keyFrame upgrade when a native tile lands after all. The
18227
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18228
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18229
+ *
18230
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18231
+ * that predates the field, and every track whose tile landed native all
18232
+ * omit it. Render nothing when absent.
18233
+ */
18234
+ previewMissReason: string().optional(),
18113
18235
  ...TrackFlagFields,
18114
18236
  ...TrackRetrainFields
18115
18237
  });
@@ -29293,6 +29415,13 @@ var LoggingSettingsPatchSchema = object({
29293
29415
  * anyone but its owner.
29294
29416
  */
29295
29417
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
29418
+ /**
29419
+ * One per-camera failure counter, plus WHO reported it.
29420
+ *
29421
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
29422
+ * the hub as it enumerates providers, never by the contributor.
29423
+ */
29424
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
29296
29425
  var GetLoggingSettingsInputSchema = object({
29297
29426
  scopeNodeId: string().optional(),
29298
29427
  /**
@@ -29351,7 +29480,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29351
29480
  }), method(_void(), SiteLocationStatusSchema, {
29352
29481
  kind: "mutation",
29353
29482
  auth: "admin"
29354
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29483
+ }), 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, {
29355
29484
  kind: "mutation",
29356
29485
  auth: "admin"
29357
29486
  });
@@ -33341,6 +33470,12 @@ Object.freeze({
33341
33470
  addonId: null,
33342
33471
  access: "create"
33343
33472
  },
33473
+ "failureContribution.list": {
33474
+ capName: "failure-contribution",
33475
+ capScope: "system",
33476
+ addonId: null,
33477
+ access: "view"
33478
+ },
33344
33479
  "fanControl.setDirection": {
33345
33480
  capName: "fan-control",
33346
33481
  capScope: "device",
@@ -36647,6 +36782,12 @@ Object.freeze({
36647
36782
  addonId: null,
36648
36783
  access: "create"
36649
36784
  },
36785
+ "system.getFailureContributions": {
36786
+ capName: "system",
36787
+ capScope: "system",
36788
+ addonId: null,
36789
+ access: "view"
36790
+ },
36650
36791
  "system.getLoadContributions": {
36651
36792
  capName: "system",
36652
36793
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -13521,6 +13521,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13521
13521
  limit: number().optional(),
13522
13522
  tags: record(string(), string()).optional()
13523
13523
  }), array(LogEntrySchema).readonly());
13524
+ /**
13525
+ * `failure-contribution` — the capability an addon reports its OWN losses
13526
+ * through, per camera, with the denominator attached. It stores nothing.
13527
+ *
13528
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13529
+ *
13530
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13531
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13532
+ * copied: the contributor reports what it already knows, hub-main adds only
13533
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13534
+ * somebody to forget to edit.
13535
+ *
13536
+ * They are not merged, because their invariants are opposites:
13537
+ *
13538
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13539
+ * claim a camera cost nothing, which is a measurement nobody made;
13540
+ * - a `failure-contribution` zero is the **most valuable value on the
13541
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13542
+ * and it is exactly what an absent entry cannot say.
13543
+ *
13544
+ * Putting a loss counter on a cost entry would also break the reconciliation
13545
+ * that gives `load-contribution` its point: contributions are subtracted from
13546
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13547
+ * has no process.
13548
+ *
13549
+ * ## Why not a log line, since the counters already exist
13550
+ *
13551
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13552
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13553
+ * ends in a log line, and a log line is the thing the operator asked to stop
13554
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13555
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13556
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13557
+ * media blackout were both diagnosed. The counters stay; this is where they can
13558
+ * be READ.
13559
+ *
13560
+ * ## The rate is served with its denominator or not at all
13561
+ *
13562
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13563
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13564
+ * than yesterday" and was **flat across twelve hours** once divided by the
13565
+ * successes on the same path. A surface that publishes only the numerator
13566
+ * reproduces that mistake on every read.
13567
+ *
13568
+ * ## Shape
13569
+ *
13570
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13571
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13572
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13573
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13574
+ * a forked runner's entries reach hub-main over transport that already exists.
13575
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13576
+ * result through `system.getFailureContributions`.
13577
+ */
13578
+ var FailureReasonCountSchema = object({
13579
+ /**
13580
+ * Why the attempt did not land, in the contributor's own vocabulary —
13581
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13582
+ * strings that already appear in this repo's logs and, where one exists, the
13583
+ * same string the per-track `previewMissReason` records (D276): a second
13584
+ * vocabulary for the same loss would make the row and the counter
13585
+ * un-joinable.
13586
+ */
13587
+ reason: string(),
13588
+ count: number().int().nonnegative()
13589
+ });
13590
+ var FailureContributionSchema = object({
13591
+ /**
13592
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13593
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13594
+ * `unit` free: the families are owned by different addons and a shared enum
13595
+ * is a central list that rots invisibly.
13596
+ */
13597
+ family: string(),
13598
+ /**
13599
+ * The NUMERIC device id — the same value every log line carries as
13600
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13601
+ * cannot name the camera must not emit the entry, because a fleet total
13602
+ * cannot answer the only question anybody asks of this surface.
13603
+ */
13604
+ deviceId: number().int().positive(),
13605
+ /**
13606
+ * A second dimension inside the family: the model / step id for an inference
13607
+ * timeout, so "which camera AND which model" is one read. Absent when the
13608
+ * family has a single variant.
13609
+ */
13610
+ variant: string().optional(),
13611
+ /**
13612
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13613
+ * differencing two reads must drop the interval when it changes, because the
13614
+ * counter restarted from zero in a respawned runner. Same discipline as
13615
+ * `LoadContribution.startedAtMs`.
13616
+ */
13617
+ sinceMs: number(),
13618
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13619
+ atMs: number(),
13620
+ /**
13621
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13622
+ * window. A failure count published without it is the mistake this schema
13623
+ * exists to make impossible.
13624
+ */
13625
+ attempts: number().int().nonnegative(),
13626
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13627
+ succeeded: number().int().nonnegative(),
13628
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13629
+ reasons: array(FailureReasonCountSchema).readonly()
13630
+ });
13631
+ method(_void(), array(FailureContributionSchema).readonly());
13524
13632
  var LoadContributionSchema = object({
13525
13633
  role: _enum([
13526
13634
  "decode",
@@ -18111,6 +18219,20 @@ var TrackSchema = object({
18111
18219
  * `=== true` and render nothing otherwise — never infer "no rider".
18112
18220
  */
18113
18221
  hasRider: boolean().optional(),
18222
+ /**
18223
+ * WHY this track ended without a NATIVE best-shot tile
18224
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18225
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18226
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18227
+ * the late-keyFrame upgrade when a native tile lands after all. The
18228
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18229
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18230
+ *
18231
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18232
+ * that predates the field, and every track whose tile landed native all
18233
+ * omit it. Render nothing when absent.
18234
+ */
18235
+ previewMissReason: string().optional(),
18114
18236
  ...TrackFlagFields,
18115
18237
  ...TrackRetrainFields
18116
18238
  });
@@ -29294,6 +29416,13 @@ var LoggingSettingsPatchSchema = object({
29294
29416
  * anyone but its owner.
29295
29417
  */
29296
29418
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
29419
+ /**
29420
+ * One per-camera failure counter, plus WHO reported it.
29421
+ *
29422
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
29423
+ * the hub as it enumerates providers, never by the contributor.
29424
+ */
29425
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
29297
29426
  var GetLoggingSettingsInputSchema = object({
29298
29427
  scopeNodeId: string().optional(),
29299
29428
  /**
@@ -29352,7 +29481,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29352
29481
  }), method(_void(), SiteLocationStatusSchema, {
29353
29482
  kind: "mutation",
29354
29483
  auth: "admin"
29355
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29484
+ }), 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, {
29356
29485
  kind: "mutation",
29357
29486
  auth: "admin"
29358
29487
  });
@@ -33342,6 +33471,12 @@ Object.freeze({
33342
33471
  addonId: null,
33343
33472
  access: "create"
33344
33473
  },
33474
+ "failureContribution.list": {
33475
+ capName: "failure-contribution",
33476
+ capScope: "system",
33477
+ addonId: null,
33478
+ access: "view"
33479
+ },
33345
33480
  "fanControl.setDirection": {
33346
33481
  capName: "fan-control",
33347
33482
  capScope: "device",
@@ -36648,6 +36783,12 @@ Object.freeze({
36648
36783
  addonId: null,
36649
36784
  access: "create"
36650
36785
  },
36786
+ "system.getFailureContributions": {
36787
+ capName: "system",
36788
+ capScope: "system",
36789
+ addonId: null,
36790
+ access: "view"
36791
+ },
36651
36792
  "system.getLoadContributions": {
36652
36793
  capName: "system",
36653
36794
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-dreo",
3
- "version": "0.2.38",
3
+ "version": "0.2.39",
4
4
  "description": "Dreo smart-device (fan / air-circulator / purifier / heater / humidifier) device-provider addon for CamStack — wraps the @apocaliss92/nodedreo Dreo cloud client (REST + WebSocket)",
5
5
  "keywords": [
6
6
  "camstack",