@camstack/addon-import-alexa 0.2.37 → 0.2.38

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
@@ -13710,6 +13710,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13710
13710
  limit: number().optional(),
13711
13711
  tags: record(string(), string()).optional()
13712
13712
  }), array(LogEntrySchema).readonly());
13713
+ /**
13714
+ * `failure-contribution` — the capability an addon reports its OWN losses
13715
+ * through, per camera, with the denominator attached. It stores nothing.
13716
+ *
13717
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13718
+ *
13719
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13720
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13721
+ * copied: the contributor reports what it already knows, hub-main adds only
13722
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13723
+ * somebody to forget to edit.
13724
+ *
13725
+ * They are not merged, because their invariants are opposites:
13726
+ *
13727
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13728
+ * claim a camera cost nothing, which is a measurement nobody made;
13729
+ * - a `failure-contribution` zero is the **most valuable value on the
13730
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13731
+ * and it is exactly what an absent entry cannot say.
13732
+ *
13733
+ * Putting a loss counter on a cost entry would also break the reconciliation
13734
+ * that gives `load-contribution` its point: contributions are subtracted from
13735
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13736
+ * has no process.
13737
+ *
13738
+ * ## Why not a log line, since the counters already exist
13739
+ *
13740
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13741
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13742
+ * ends in a log line, and a log line is the thing the operator asked to stop
13743
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13744
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13745
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13746
+ * media blackout were both diagnosed. The counters stay; this is where they can
13747
+ * be READ.
13748
+ *
13749
+ * ## The rate is served with its denominator or not at all
13750
+ *
13751
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13752
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13753
+ * than yesterday" and was **flat across twelve hours** once divided by the
13754
+ * successes on the same path. A surface that publishes only the numerator
13755
+ * reproduces that mistake on every read.
13756
+ *
13757
+ * ## Shape
13758
+ *
13759
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13760
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13761
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13762
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13763
+ * a forked runner's entries reach hub-main over transport that already exists.
13764
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13765
+ * result through `system.getFailureContributions`.
13766
+ */
13767
+ var FailureReasonCountSchema = object({
13768
+ /**
13769
+ * Why the attempt did not land, in the contributor's own vocabulary —
13770
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13771
+ * strings that already appear in this repo's logs and, where one exists, the
13772
+ * same string the per-track `previewMissReason` records (D276): a second
13773
+ * vocabulary for the same loss would make the row and the counter
13774
+ * un-joinable.
13775
+ */
13776
+ reason: string(),
13777
+ count: number().int().nonnegative()
13778
+ });
13779
+ var FailureContributionSchema = object({
13780
+ /**
13781
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13782
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13783
+ * `unit` free: the families are owned by different addons and a shared enum
13784
+ * is a central list that rots invisibly.
13785
+ */
13786
+ family: string(),
13787
+ /**
13788
+ * The NUMERIC device id — the same value every log line carries as
13789
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13790
+ * cannot name the camera must not emit the entry, because a fleet total
13791
+ * cannot answer the only question anybody asks of this surface.
13792
+ */
13793
+ deviceId: number().int().positive(),
13794
+ /**
13795
+ * A second dimension inside the family: the model / step id for an inference
13796
+ * timeout, so "which camera AND which model" is one read. Absent when the
13797
+ * family has a single variant.
13798
+ */
13799
+ variant: string().optional(),
13800
+ /**
13801
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13802
+ * differencing two reads must drop the interval when it changes, because the
13803
+ * counter restarted from zero in a respawned runner. Same discipline as
13804
+ * `LoadContribution.startedAtMs`.
13805
+ */
13806
+ sinceMs: number(),
13807
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13808
+ atMs: number(),
13809
+ /**
13810
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13811
+ * window. A failure count published without it is the mistake this schema
13812
+ * exists to make impossible.
13813
+ */
13814
+ attempts: number().int().nonnegative(),
13815
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13816
+ succeeded: number().int().nonnegative(),
13817
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13818
+ reasons: array(FailureReasonCountSchema).readonly()
13819
+ });
13820
+ method(_void(), array(FailureContributionSchema).readonly());
13713
13821
  var LoadContributionSchema = object({
13714
13822
  role: _enum([
13715
13823
  "decode",
@@ -18300,6 +18408,20 @@ var TrackSchema = object({
18300
18408
  * `=== true` and render nothing otherwise — never infer "no rider".
18301
18409
  */
18302
18410
  hasRider: boolean().optional(),
18411
+ /**
18412
+ * WHY this track ended without a NATIVE best-shot tile
18413
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18414
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18415
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18416
+ * the late-keyFrame upgrade when a native tile lands after all. The
18417
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18418
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18419
+ *
18420
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18421
+ * that predates the field, and every track whose tile landed native all
18422
+ * omit it. Render nothing when absent.
18423
+ */
18424
+ previewMissReason: string().optional(),
18303
18425
  ...TrackFlagFields,
18304
18426
  ...TrackRetrainFields
18305
18427
  });
@@ -29492,6 +29614,13 @@ var LoggingSettingsPatchSchema = object({
29492
29614
  * anyone but its owner.
29493
29615
  */
29494
29616
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
29617
+ /**
29618
+ * One per-camera failure counter, plus WHO reported it.
29619
+ *
29620
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
29621
+ * the hub as it enumerates providers, never by the contributor.
29622
+ */
29623
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
29495
29624
  var GetLoggingSettingsInputSchema = object({
29496
29625
  scopeNodeId: string().optional(),
29497
29626
  /**
@@ -29550,7 +29679,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29550
29679
  }), method(_void(), SiteLocationStatusSchema, {
29551
29680
  kind: "mutation",
29552
29681
  auth: "admin"
29553
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29682
+ }), 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, {
29554
29683
  kind: "mutation",
29555
29684
  auth: "admin"
29556
29685
  });
@@ -33540,6 +33669,12 @@ Object.freeze({
33540
33669
  addonId: null,
33541
33670
  access: "create"
33542
33671
  },
33672
+ "failureContribution.list": {
33673
+ capName: "failure-contribution",
33674
+ capScope: "system",
33675
+ addonId: null,
33676
+ access: "view"
33677
+ },
33543
33678
  "fanControl.setDirection": {
33544
33679
  capName: "fan-control",
33545
33680
  capScope: "device",
@@ -36846,6 +36981,12 @@ Object.freeze({
36846
36981
  addonId: null,
36847
36982
  access: "create"
36848
36983
  },
36984
+ "system.getFailureContributions": {
36985
+ capName: "system",
36986
+ capScope: "system",
36987
+ addonId: null,
36988
+ access: "view"
36989
+ },
36849
36990
  "system.getLoadContributions": {
36850
36991
  capName: "system",
36851
36992
  capScope: "system",
package/dist/addon.mjs CHANGED
@@ -13710,6 +13710,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13710
13710
  limit: number().optional(),
13711
13711
  tags: record(string(), string()).optional()
13712
13712
  }), array(LogEntrySchema).readonly());
13713
+ /**
13714
+ * `failure-contribution` — the capability an addon reports its OWN losses
13715
+ * through, per camera, with the denominator attached. It stores nothing.
13716
+ *
13717
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13718
+ *
13719
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13720
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13721
+ * copied: the contributor reports what it already knows, hub-main adds only
13722
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13723
+ * somebody to forget to edit.
13724
+ *
13725
+ * They are not merged, because their invariants are opposites:
13726
+ *
13727
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13728
+ * claim a camera cost nothing, which is a measurement nobody made;
13729
+ * - a `failure-contribution` zero is the **most valuable value on the
13730
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13731
+ * and it is exactly what an absent entry cannot say.
13732
+ *
13733
+ * Putting a loss counter on a cost entry would also break the reconciliation
13734
+ * that gives `load-contribution` its point: contributions are subtracted from
13735
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13736
+ * has no process.
13737
+ *
13738
+ * ## Why not a log line, since the counters already exist
13739
+ *
13740
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13741
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13742
+ * ends in a log line, and a log line is the thing the operator asked to stop
13743
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13744
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13745
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13746
+ * media blackout were both diagnosed. The counters stay; this is where they can
13747
+ * be READ.
13748
+ *
13749
+ * ## The rate is served with its denominator or not at all
13750
+ *
13751
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13752
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13753
+ * than yesterday" and was **flat across twelve hours** once divided by the
13754
+ * successes on the same path. A surface that publishes only the numerator
13755
+ * reproduces that mistake on every read.
13756
+ *
13757
+ * ## Shape
13758
+ *
13759
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13760
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13761
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13762
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13763
+ * a forked runner's entries reach hub-main over transport that already exists.
13764
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13765
+ * result through `system.getFailureContributions`.
13766
+ */
13767
+ var FailureReasonCountSchema = object({
13768
+ /**
13769
+ * Why the attempt did not land, in the contributor's own vocabulary —
13770
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13771
+ * strings that already appear in this repo's logs and, where one exists, the
13772
+ * same string the per-track `previewMissReason` records (D276): a second
13773
+ * vocabulary for the same loss would make the row and the counter
13774
+ * un-joinable.
13775
+ */
13776
+ reason: string(),
13777
+ count: number().int().nonnegative()
13778
+ });
13779
+ var FailureContributionSchema = object({
13780
+ /**
13781
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13782
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13783
+ * `unit` free: the families are owned by different addons and a shared enum
13784
+ * is a central list that rots invisibly.
13785
+ */
13786
+ family: string(),
13787
+ /**
13788
+ * The NUMERIC device id — the same value every log line carries as
13789
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13790
+ * cannot name the camera must not emit the entry, because a fleet total
13791
+ * cannot answer the only question anybody asks of this surface.
13792
+ */
13793
+ deviceId: number().int().positive(),
13794
+ /**
13795
+ * A second dimension inside the family: the model / step id for an inference
13796
+ * timeout, so "which camera AND which model" is one read. Absent when the
13797
+ * family has a single variant.
13798
+ */
13799
+ variant: string().optional(),
13800
+ /**
13801
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13802
+ * differencing two reads must drop the interval when it changes, because the
13803
+ * counter restarted from zero in a respawned runner. Same discipline as
13804
+ * `LoadContribution.startedAtMs`.
13805
+ */
13806
+ sinceMs: number(),
13807
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13808
+ atMs: number(),
13809
+ /**
13810
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13811
+ * window. A failure count published without it is the mistake this schema
13812
+ * exists to make impossible.
13813
+ */
13814
+ attempts: number().int().nonnegative(),
13815
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13816
+ succeeded: number().int().nonnegative(),
13817
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13818
+ reasons: array(FailureReasonCountSchema).readonly()
13819
+ });
13820
+ method(_void(), array(FailureContributionSchema).readonly());
13713
13821
  var LoadContributionSchema = object({
13714
13822
  role: _enum([
13715
13823
  "decode",
@@ -18300,6 +18408,20 @@ var TrackSchema = object({
18300
18408
  * `=== true` and render nothing otherwise — never infer "no rider".
18301
18409
  */
18302
18410
  hasRider: boolean().optional(),
18411
+ /**
18412
+ * WHY this track ended without a NATIVE best-shot tile
18413
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
18414
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
18415
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
18416
+ * the late-keyFrame upgrade when a native tile lands after all. The
18417
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
18418
+ * tile is a face/plate stand-in, a raster crop, or an icon.
18419
+ *
18420
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
18421
+ * that predates the field, and every track whose tile landed native all
18422
+ * omit it. Render nothing when absent.
18423
+ */
18424
+ previewMissReason: string().optional(),
18303
18425
  ...TrackFlagFields,
18304
18426
  ...TrackRetrainFields
18305
18427
  });
@@ -29492,6 +29614,13 @@ var LoggingSettingsPatchSchema = object({
29492
29614
  * anyone but its owner.
29493
29615
  */
29494
29616
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
29617
+ /**
29618
+ * One per-camera failure counter, plus WHO reported it.
29619
+ *
29620
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
29621
+ * the hub as it enumerates providers, never by the contributor.
29622
+ */
29623
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
29495
29624
  var GetLoggingSettingsInputSchema = object({
29496
29625
  scopeNodeId: string().optional(),
29497
29626
  /**
@@ -29550,7 +29679,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
29550
29679
  }), method(_void(), SiteLocationStatusSchema, {
29551
29680
  kind: "mutation",
29552
29681
  auth: "admin"
29553
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
29682
+ }), 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, {
29554
29683
  kind: "mutation",
29555
29684
  auth: "admin"
29556
29685
  });
@@ -33540,6 +33669,12 @@ Object.freeze({
33540
33669
  addonId: null,
33541
33670
  access: "create"
33542
33671
  },
33672
+ "failureContribution.list": {
33673
+ capName: "failure-contribution",
33674
+ capScope: "system",
33675
+ addonId: null,
33676
+ access: "view"
33677
+ },
33543
33678
  "fanControl.setDirection": {
33544
33679
  capName: "fan-control",
33545
33680
  capScope: "device",
@@ -36846,6 +36981,12 @@ Object.freeze({
36846
36981
  addonId: null,
36847
36982
  access: "create"
36848
36983
  },
36984
+ "system.getFailureContributions": {
36985
+ capName: "system",
36986
+ capScope: "system",
36987
+ addonId: null,
36988
+ access: "view"
36989
+ },
36849
36990
  "system.getLoadContributions": {
36850
36991
  capName: "system",
36851
36992
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-import-alexa",
3
- "version": "0.2.37",
3
+ "version": "0.2.38",
4
4
  "description": "Alexa device-import provider for CamStack — imports the smart-home devices in a user's Alexa account via the unofficial alexa-remote2 cookie/token client (the inverse of the Alexa exporter)",
5
5
  "keywords": [
6
6
  "camstack",