@camstack/addon-provider-dreame 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
@@ -63989,6 +63989,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
63989
63989
  limit: number().optional(),
63990
63990
  tags: record(string(), string()).optional()
63991
63991
  }), array(LogEntrySchema).readonly());
63992
+ /**
63993
+ * `failure-contribution` — the capability an addon reports its OWN losses
63994
+ * through, per camera, with the denominator attached. It stores nothing.
63995
+ *
63996
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
63997
+ *
63998
+ * `load-contribution` answers *what did this camera COST*. This answers *what
63999
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
64000
+ * copied: the contributor reports what it already knows, hub-main adds only
64001
+ * `addonId`, nothing needs global knowledge, and there is no central list for
64002
+ * somebody to forget to edit.
64003
+ *
64004
+ * They are not merged, because their invariants are opposites:
64005
+ *
64006
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
64007
+ * claim a camera cost nothing, which is a measurement nobody made;
64008
+ * - a `failure-contribution` zero is the **most valuable value on the
64009
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
64010
+ * and it is exactly what an absent entry cannot say.
64011
+ *
64012
+ * Putting a loss counter on a cost entry would also break the reconciliation
64013
+ * that gives `load-contribution` its point: contributions are subtracted from
64014
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
64015
+ * has no process.
64016
+ *
64017
+ * ## Why not a log line, since the counters already exist
64018
+ *
64019
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
64020
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
64021
+ * ends in a log line, and a log line is the thing the operator asked to stop
64022
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
64023
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
64024
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
64025
+ * media blackout were both diagnosed. The counters stay; this is where they can
64026
+ * be READ.
64027
+ *
64028
+ * ## The rate is served with its denominator or not at all
64029
+ *
64030
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
64031
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
64032
+ * than yesterday" and was **flat across twelve hours** once divided by the
64033
+ * successes on the same path. A surface that publishes only the numerator
64034
+ * reproduces that mistake on every read.
64035
+ *
64036
+ * ## Shape
64037
+ *
64038
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
64039
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
64040
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
64041
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
64042
+ * a forked runner's entries reach hub-main over transport that already exists.
64043
+ * No new UDS message, no second registry (D3). The operator reads the assembled
64044
+ * result through `system.getFailureContributions`.
64045
+ */
64046
+ var FailureReasonCountSchema = object({
64047
+ /**
64048
+ * Why the attempt did not land, in the contributor's own vocabulary —
64049
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
64050
+ * strings that already appear in this repo's logs and, where one exists, the
64051
+ * same string the per-track `previewMissReason` records (D276): a second
64052
+ * vocabulary for the same loss would make the row and the counter
64053
+ * un-joinable.
64054
+ */
64055
+ reason: string(),
64056
+ count: number().int().nonnegative()
64057
+ });
64058
+ var FailureContributionSchema = object({
64059
+ /**
64060
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
64061
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
64062
+ * `unit` free: the families are owned by different addons and a shared enum
64063
+ * is a central list that rots invisibly.
64064
+ */
64065
+ family: string(),
64066
+ /**
64067
+ * The NUMERIC device id — the same value every log line carries as
64068
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
64069
+ * cannot name the camera must not emit the entry, because a fleet total
64070
+ * cannot answer the only question anybody asks of this surface.
64071
+ */
64072
+ deviceId: number().int().positive(),
64073
+ /**
64074
+ * A second dimension inside the family: the model / step id for an inference
64075
+ * timeout, so "which camera AND which model" is one read. Absent when the
64076
+ * family has a single variant.
64077
+ */
64078
+ variant: string().optional(),
64079
+ /**
64080
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
64081
+ * differencing two reads must drop the interval when it changes, because the
64082
+ * counter restarted from zero in a respawned runner. Same discipline as
64083
+ * `LoadContribution.startedAtMs`.
64084
+ */
64085
+ sinceMs: number(),
64086
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
64087
+ atMs: number(),
64088
+ /**
64089
+ * THE DENOMINATOR — every attempt on this path for this camera in the
64090
+ * window. A failure count published without it is the mistake this schema
64091
+ * exists to make impossible.
64092
+ */
64093
+ attempts: number().int().nonnegative(),
64094
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
64095
+ succeeded: number().int().nonnegative(),
64096
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
64097
+ reasons: array(FailureReasonCountSchema).readonly()
64098
+ });
64099
+ method(_void(), array(FailureContributionSchema).readonly());
63992
64100
  var LoadContributionSchema = object({
63993
64101
  role: _enum([
63994
64102
  "decode",
@@ -68579,6 +68687,20 @@ var TrackSchema = object({
68579
68687
  * `=== true` and render nothing otherwise — never infer "no rider".
68580
68688
  */
68581
68689
  hasRider: boolean().optional(),
68690
+ /**
68691
+ * WHY this track ended without a NATIVE best-shot tile
68692
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
68693
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
68694
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
68695
+ * the late-keyFrame upgrade when a native tile lands after all. The
68696
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
68697
+ * tile is a face/plate stand-in, a raster crop, or an icon.
68698
+ *
68699
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
68700
+ * that predates the field, and every track whose tile landed native all
68701
+ * omit it. Render nothing when absent.
68702
+ */
68703
+ previewMissReason: string().optional(),
68582
68704
  ...TrackFlagFields,
68583
68705
  ...TrackRetrainFields
68584
68706
  });
@@ -79779,6 +79901,13 @@ var LoggingSettingsPatchSchema = object({
79779
79901
  * anyone but its owner.
79780
79902
  */
79781
79903
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
79904
+ /**
79905
+ * One per-camera failure counter, plus WHO reported it.
79906
+ *
79907
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
79908
+ * the hub as it enumerates providers, never by the contributor.
79909
+ */
79910
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
79782
79911
  var GetLoggingSettingsInputSchema = object({
79783
79912
  scopeNodeId: string().optional(),
79784
79913
  /**
@@ -79837,7 +79966,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
79837
79966
  }), method(_void(), SiteLocationStatusSchema, {
79838
79967
  kind: "mutation",
79839
79968
  auth: "admin"
79840
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
79969
+ }), 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, {
79841
79970
  kind: "mutation",
79842
79971
  auth: "admin"
79843
79972
  });
@@ -83827,6 +83956,12 @@ Object.freeze({
83827
83956
  addonId: null,
83828
83957
  access: "create"
83829
83958
  },
83959
+ "failureContribution.list": {
83960
+ capName: "failure-contribution",
83961
+ capScope: "system",
83962
+ addonId: null,
83963
+ access: "view"
83964
+ },
83830
83965
  "fanControl.setDirection": {
83831
83966
  capName: "fan-control",
83832
83967
  capScope: "device",
@@ -87133,6 +87268,12 @@ Object.freeze({
87133
87268
  addonId: null,
87134
87269
  access: "create"
87135
87270
  },
87271
+ "system.getFailureContributions": {
87272
+ capName: "system",
87273
+ capScope: "system",
87274
+ addonId: null,
87275
+ access: "view"
87276
+ },
87136
87277
  "system.getLoadContributions": {
87137
87278
  capName: "system",
87138
87279
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -63989,6 +63989,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
63989
63989
  limit: number().optional(),
63990
63990
  tags: record(string(), string()).optional()
63991
63991
  }), array(LogEntrySchema).readonly());
63992
+ /**
63993
+ * `failure-contribution` — the capability an addon reports its OWN losses
63994
+ * through, per camera, with the denominator attached. It stores nothing.
63995
+ *
63996
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
63997
+ *
63998
+ * `load-contribution` answers *what did this camera COST*. This answers *what
63999
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
64000
+ * copied: the contributor reports what it already knows, hub-main adds only
64001
+ * `addonId`, nothing needs global knowledge, and there is no central list for
64002
+ * somebody to forget to edit.
64003
+ *
64004
+ * They are not merged, because their invariants are opposites:
64005
+ *
64006
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
64007
+ * claim a camera cost nothing, which is a measurement nobody made;
64008
+ * - a `failure-contribution` zero is the **most valuable value on the
64009
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
64010
+ * and it is exactly what an absent entry cannot say.
64011
+ *
64012
+ * Putting a loss counter on a cost entry would also break the reconciliation
64013
+ * that gives `load-contribution` its point: contributions are subtracted from
64014
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
64015
+ * has no process.
64016
+ *
64017
+ * ## Why not a log line, since the counters already exist
64018
+ *
64019
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
64020
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
64021
+ * ends in a log line, and a log line is the thing the operator asked to stop
64022
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
64023
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
64024
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
64025
+ * media blackout were both diagnosed. The counters stay; this is where they can
64026
+ * be READ.
64027
+ *
64028
+ * ## The rate is served with its denominator or not at all
64029
+ *
64030
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
64031
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
64032
+ * than yesterday" and was **flat across twelve hours** once divided by the
64033
+ * successes on the same path. A surface that publishes only the numerator
64034
+ * reproduces that mistake on every read.
64035
+ *
64036
+ * ## Shape
64037
+ *
64038
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
64039
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
64040
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
64041
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
64042
+ * a forked runner's entries reach hub-main over transport that already exists.
64043
+ * No new UDS message, no second registry (D3). The operator reads the assembled
64044
+ * result through `system.getFailureContributions`.
64045
+ */
64046
+ var FailureReasonCountSchema = object({
64047
+ /**
64048
+ * Why the attempt did not land, in the contributor's own vocabulary —
64049
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
64050
+ * strings that already appear in this repo's logs and, where one exists, the
64051
+ * same string the per-track `previewMissReason` records (D276): a second
64052
+ * vocabulary for the same loss would make the row and the counter
64053
+ * un-joinable.
64054
+ */
64055
+ reason: string(),
64056
+ count: number().int().nonnegative()
64057
+ });
64058
+ var FailureContributionSchema = object({
64059
+ /**
64060
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
64061
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
64062
+ * `unit` free: the families are owned by different addons and a shared enum
64063
+ * is a central list that rots invisibly.
64064
+ */
64065
+ family: string(),
64066
+ /**
64067
+ * The NUMERIC device id — the same value every log line carries as
64068
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
64069
+ * cannot name the camera must not emit the entry, because a fleet total
64070
+ * cannot answer the only question anybody asks of this surface.
64071
+ */
64072
+ deviceId: number().int().positive(),
64073
+ /**
64074
+ * A second dimension inside the family: the model / step id for an inference
64075
+ * timeout, so "which camera AND which model" is one read. Absent when the
64076
+ * family has a single variant.
64077
+ */
64078
+ variant: string().optional(),
64079
+ /**
64080
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
64081
+ * differencing two reads must drop the interval when it changes, because the
64082
+ * counter restarted from zero in a respawned runner. Same discipline as
64083
+ * `LoadContribution.startedAtMs`.
64084
+ */
64085
+ sinceMs: number(),
64086
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
64087
+ atMs: number(),
64088
+ /**
64089
+ * THE DENOMINATOR — every attempt on this path for this camera in the
64090
+ * window. A failure count published without it is the mistake this schema
64091
+ * exists to make impossible.
64092
+ */
64093
+ attempts: number().int().nonnegative(),
64094
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
64095
+ succeeded: number().int().nonnegative(),
64096
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
64097
+ reasons: array(FailureReasonCountSchema).readonly()
64098
+ });
64099
+ method(_void(), array(FailureContributionSchema).readonly());
63992
64100
  var LoadContributionSchema = object({
63993
64101
  role: _enum([
63994
64102
  "decode",
@@ -68579,6 +68687,20 @@ var TrackSchema = object({
68579
68687
  * `=== true` and render nothing otherwise — never infer "no rider".
68580
68688
  */
68581
68689
  hasRider: boolean().optional(),
68690
+ /**
68691
+ * WHY this track ended without a NATIVE best-shot tile
68692
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
68693
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
68694
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
68695
+ * the late-keyFrame upgrade when a native tile lands after all. The
68696
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
68697
+ * tile is a face/plate stand-in, a raster crop, or an icon.
68698
+ *
68699
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
68700
+ * that predates the field, and every track whose tile landed native all
68701
+ * omit it. Render nothing when absent.
68702
+ */
68703
+ previewMissReason: string().optional(),
68582
68704
  ...TrackFlagFields,
68583
68705
  ...TrackRetrainFields
68584
68706
  });
@@ -79779,6 +79901,13 @@ var LoggingSettingsPatchSchema = object({
79779
79901
  * anyone but its owner.
79780
79902
  */
79781
79903
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
79904
+ /**
79905
+ * One per-camera failure counter, plus WHO reported it.
79906
+ *
79907
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
79908
+ * the hub as it enumerates providers, never by the contributor.
79909
+ */
79910
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
79782
79911
  var GetLoggingSettingsInputSchema = object({
79783
79912
  scopeNodeId: string().optional(),
79784
79913
  /**
@@ -79837,7 +79966,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
79837
79966
  }), method(_void(), SiteLocationStatusSchema, {
79838
79967
  kind: "mutation",
79839
79968
  auth: "admin"
79840
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
79969
+ }), 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, {
79841
79970
  kind: "mutation",
79842
79971
  auth: "admin"
79843
79972
  });
@@ -83827,6 +83956,12 @@ Object.freeze({
83827
83956
  addonId: null,
83828
83957
  access: "create"
83829
83958
  },
83959
+ "failureContribution.list": {
83960
+ capName: "failure-contribution",
83961
+ capScope: "system",
83962
+ addonId: null,
83963
+ access: "view"
83964
+ },
83830
83965
  "fanControl.setDirection": {
83831
83966
  capName: "fan-control",
83832
83967
  capScope: "device",
@@ -87133,6 +87268,12 @@ Object.freeze({
87133
87268
  addonId: null,
87134
87269
  access: "create"
87135
87270
  },
87271
+ "system.getFailureContributions": {
87272
+ capName: "system",
87273
+ capScope: "system",
87274
+ addonId: null,
87275
+ access: "view"
87276
+ },
87136
87277
  "system.getLoadContributions": {
87137
87278
  capName: "system",
87138
87279
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-provider-dreame",
3
- "version": "0.2.38",
3
+ "version": "0.2.39",
4
4
  "description": "Dreame robot-vacuum / lawn-mower device-provider addon for CamStack — wraps the @apocaliss92/nodedreame Dreamehome cloud client",
5
5
  "keywords": [
6
6
  "camstack",