@camstack/addon-smtp-nodemailer 1.2.37 → 1.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.
@@ -13224,6 +13224,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13224
13224
  limit: number().optional(),
13225
13225
  tags: record(string(), string()).optional()
13226
13226
  }), array(LogEntrySchema).readonly());
13227
+ /**
13228
+ * `failure-contribution` — the capability an addon reports its OWN losses
13229
+ * through, per camera, with the denominator attached. It stores nothing.
13230
+ *
13231
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13232
+ *
13233
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13234
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13235
+ * copied: the contributor reports what it already knows, hub-main adds only
13236
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13237
+ * somebody to forget to edit.
13238
+ *
13239
+ * They are not merged, because their invariants are opposites:
13240
+ *
13241
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13242
+ * claim a camera cost nothing, which is a measurement nobody made;
13243
+ * - a `failure-contribution` zero is the **most valuable value on the
13244
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13245
+ * and it is exactly what an absent entry cannot say.
13246
+ *
13247
+ * Putting a loss counter on a cost entry would also break the reconciliation
13248
+ * that gives `load-contribution` its point: contributions are subtracted from
13249
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13250
+ * has no process.
13251
+ *
13252
+ * ## Why not a log line, since the counters already exist
13253
+ *
13254
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13255
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13256
+ * ends in a log line, and a log line is the thing the operator asked to stop
13257
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13258
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13259
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13260
+ * media blackout were both diagnosed. The counters stay; this is where they can
13261
+ * be READ.
13262
+ *
13263
+ * ## The rate is served with its denominator or not at all
13264
+ *
13265
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13266
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13267
+ * than yesterday" and was **flat across twelve hours** once divided by the
13268
+ * successes on the same path. A surface that publishes only the numerator
13269
+ * reproduces that mistake on every read.
13270
+ *
13271
+ * ## Shape
13272
+ *
13273
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13274
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13275
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13276
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13277
+ * a forked runner's entries reach hub-main over transport that already exists.
13278
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13279
+ * result through `system.getFailureContributions`.
13280
+ */
13281
+ var FailureReasonCountSchema = object({
13282
+ /**
13283
+ * Why the attempt did not land, in the contributor's own vocabulary —
13284
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13285
+ * strings that already appear in this repo's logs and, where one exists, the
13286
+ * same string the per-track `previewMissReason` records (D276): a second
13287
+ * vocabulary for the same loss would make the row and the counter
13288
+ * un-joinable.
13289
+ */
13290
+ reason: string(),
13291
+ count: number().int().nonnegative()
13292
+ });
13293
+ var FailureContributionSchema = object({
13294
+ /**
13295
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13296
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13297
+ * `unit` free: the families are owned by different addons and a shared enum
13298
+ * is a central list that rots invisibly.
13299
+ */
13300
+ family: string(),
13301
+ /**
13302
+ * The NUMERIC device id — the same value every log line carries as
13303
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13304
+ * cannot name the camera must not emit the entry, because a fleet total
13305
+ * cannot answer the only question anybody asks of this surface.
13306
+ */
13307
+ deviceId: number().int().positive(),
13308
+ /**
13309
+ * A second dimension inside the family: the model / step id for an inference
13310
+ * timeout, so "which camera AND which model" is one read. Absent when the
13311
+ * family has a single variant.
13312
+ */
13313
+ variant: string().optional(),
13314
+ /**
13315
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13316
+ * differencing two reads must drop the interval when it changes, because the
13317
+ * counter restarted from zero in a respawned runner. Same discipline as
13318
+ * `LoadContribution.startedAtMs`.
13319
+ */
13320
+ sinceMs: number(),
13321
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13322
+ atMs: number(),
13323
+ /**
13324
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13325
+ * window. A failure count published without it is the mistake this schema
13326
+ * exists to make impossible.
13327
+ */
13328
+ attempts: number().int().nonnegative(),
13329
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13330
+ succeeded: number().int().nonnegative(),
13331
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13332
+ reasons: array(FailureReasonCountSchema).readonly()
13333
+ });
13334
+ method(_void(), array(FailureContributionSchema).readonly());
13227
13335
  var LoadContributionSchema = object({
13228
13336
  role: _enum([
13229
13337
  "decode",
@@ -17736,6 +17844,20 @@ var TrackSchema = object({
17736
17844
  * `=== true` and render nothing otherwise — never infer "no rider".
17737
17845
  */
17738
17846
  hasRider: boolean().optional(),
17847
+ /**
17848
+ * WHY this track ended without a NATIVE best-shot tile
17849
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
17850
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
17851
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
17852
+ * the late-keyFrame upgrade when a native tile lands after all. The
17853
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
17854
+ * tile is a face/plate stand-in, a raster crop, or an icon.
17855
+ *
17856
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
17857
+ * that predates the field, and every track whose tile landed native all
17858
+ * omit it. Render nothing when absent.
17859
+ */
17860
+ previewMissReason: string().optional(),
17739
17861
  ...TrackFlagFields,
17740
17862
  ...TrackRetrainFields
17741
17863
  });
@@ -26975,6 +27097,13 @@ var LoggingSettingsPatchSchema = object({
26975
27097
  * anyone but its owner.
26976
27098
  */
26977
27099
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
27100
+ /**
27101
+ * One per-camera failure counter, plus WHO reported it.
27102
+ *
27103
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
27104
+ * the hub as it enumerates providers, never by the contributor.
27105
+ */
27106
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
26978
27107
  var GetLoggingSettingsInputSchema = object({
26979
27108
  scopeNodeId: string().optional(),
26980
27109
  /**
@@ -27033,7 +27162,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
27033
27162
  }), method(_void(), SiteLocationStatusSchema, {
27034
27163
  kind: "mutation",
27035
27164
  auth: "admin"
27036
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27165
+ }), 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, {
27037
27166
  kind: "mutation",
27038
27167
  auth: "admin"
27039
27168
  });
@@ -29615,6 +29744,12 @@ Object.freeze({
29615
29744
  addonId: null,
29616
29745
  access: "create"
29617
29746
  },
29747
+ "failureContribution.list": {
29748
+ capName: "failure-contribution",
29749
+ capScope: "system",
29750
+ addonId: null,
29751
+ access: "view"
29752
+ },
29618
29753
  "fanControl.setDirection": {
29619
29754
  capName: "fan-control",
29620
29755
  capScope: "device",
@@ -32921,6 +33056,12 @@ Object.freeze({
32921
33056
  addonId: null,
32922
33057
  access: "create"
32923
33058
  },
33059
+ "system.getFailureContributions": {
33060
+ capName: "system",
33061
+ capScope: "system",
33062
+ addonId: null,
33063
+ access: "view"
33064
+ },
32924
33065
  "system.getLoadContributions": {
32925
33066
  capName: "system",
32926
33067
  capScope: "system",
@@ -13222,6 +13222,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13222
13222
  limit: number().optional(),
13223
13223
  tags: record(string(), string()).optional()
13224
13224
  }), array(LogEntrySchema).readonly());
13225
+ /**
13226
+ * `failure-contribution` — the capability an addon reports its OWN losses
13227
+ * through, per camera, with the denominator attached. It stores nothing.
13228
+ *
13229
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13230
+ *
13231
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13232
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13233
+ * copied: the contributor reports what it already knows, hub-main adds only
13234
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13235
+ * somebody to forget to edit.
13236
+ *
13237
+ * They are not merged, because their invariants are opposites:
13238
+ *
13239
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13240
+ * claim a camera cost nothing, which is a measurement nobody made;
13241
+ * - a `failure-contribution` zero is the **most valuable value on the
13242
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13243
+ * and it is exactly what an absent entry cannot say.
13244
+ *
13245
+ * Putting a loss counter on a cost entry would also break the reconciliation
13246
+ * that gives `load-contribution` its point: contributions are subtracted from
13247
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13248
+ * has no process.
13249
+ *
13250
+ * ## Why not a log line, since the counters already exist
13251
+ *
13252
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13253
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13254
+ * ends in a log line, and a log line is the thing the operator asked to stop
13255
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13256
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13257
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13258
+ * media blackout were both diagnosed. The counters stay; this is where they can
13259
+ * be READ.
13260
+ *
13261
+ * ## The rate is served with its denominator or not at all
13262
+ *
13263
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13264
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13265
+ * than yesterday" and was **flat across twelve hours** once divided by the
13266
+ * successes on the same path. A surface that publishes only the numerator
13267
+ * reproduces that mistake on every read.
13268
+ *
13269
+ * ## Shape
13270
+ *
13271
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13272
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13273
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13274
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13275
+ * a forked runner's entries reach hub-main over transport that already exists.
13276
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13277
+ * result through `system.getFailureContributions`.
13278
+ */
13279
+ var FailureReasonCountSchema = object({
13280
+ /**
13281
+ * Why the attempt did not land, in the contributor's own vocabulary —
13282
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13283
+ * strings that already appear in this repo's logs and, where one exists, the
13284
+ * same string the per-track `previewMissReason` records (D276): a second
13285
+ * vocabulary for the same loss would make the row and the counter
13286
+ * un-joinable.
13287
+ */
13288
+ reason: string(),
13289
+ count: number().int().nonnegative()
13290
+ });
13291
+ var FailureContributionSchema = object({
13292
+ /**
13293
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13294
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13295
+ * `unit` free: the families are owned by different addons and a shared enum
13296
+ * is a central list that rots invisibly.
13297
+ */
13298
+ family: string(),
13299
+ /**
13300
+ * The NUMERIC device id — the same value every log line carries as
13301
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13302
+ * cannot name the camera must not emit the entry, because a fleet total
13303
+ * cannot answer the only question anybody asks of this surface.
13304
+ */
13305
+ deviceId: number().int().positive(),
13306
+ /**
13307
+ * A second dimension inside the family: the model / step id for an inference
13308
+ * timeout, so "which camera AND which model" is one read. Absent when the
13309
+ * family has a single variant.
13310
+ */
13311
+ variant: string().optional(),
13312
+ /**
13313
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13314
+ * differencing two reads must drop the interval when it changes, because the
13315
+ * counter restarted from zero in a respawned runner. Same discipline as
13316
+ * `LoadContribution.startedAtMs`.
13317
+ */
13318
+ sinceMs: number(),
13319
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13320
+ atMs: number(),
13321
+ /**
13322
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13323
+ * window. A failure count published without it is the mistake this schema
13324
+ * exists to make impossible.
13325
+ */
13326
+ attempts: number().int().nonnegative(),
13327
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13328
+ succeeded: number().int().nonnegative(),
13329
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13330
+ reasons: array(FailureReasonCountSchema).readonly()
13331
+ });
13332
+ method(_void(), array(FailureContributionSchema).readonly());
13225
13333
  var LoadContributionSchema = object({
13226
13334
  role: _enum([
13227
13335
  "decode",
@@ -17734,6 +17842,20 @@ var TrackSchema = object({
17734
17842
  * `=== true` and render nothing otherwise — never infer "no rider".
17735
17843
  */
17736
17844
  hasRider: boolean().optional(),
17845
+ /**
17846
+ * WHY this track ended without a NATIVE best-shot tile
17847
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
17848
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
17849
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
17850
+ * the late-keyFrame upgrade when a native tile lands after all. The
17851
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
17852
+ * tile is a face/plate stand-in, a raster crop, or an icon.
17853
+ *
17854
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
17855
+ * that predates the field, and every track whose tile landed native all
17856
+ * omit it. Render nothing when absent.
17857
+ */
17858
+ previewMissReason: string().optional(),
17737
17859
  ...TrackFlagFields,
17738
17860
  ...TrackRetrainFields
17739
17861
  });
@@ -26973,6 +27095,13 @@ var LoggingSettingsPatchSchema = object({
26973
27095
  * anyone but its owner.
26974
27096
  */
26975
27097
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
27098
+ /**
27099
+ * One per-camera failure counter, plus WHO reported it.
27100
+ *
27101
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
27102
+ * the hub as it enumerates providers, never by the contributor.
27103
+ */
27104
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
26976
27105
  var GetLoggingSettingsInputSchema = object({
26977
27106
  scopeNodeId: string().optional(),
26978
27107
  /**
@@ -27031,7 +27160,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
27031
27160
  }), method(_void(), SiteLocationStatusSchema, {
27032
27161
  kind: "mutation",
27033
27162
  auth: "admin"
27034
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27163
+ }), 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, {
27035
27164
  kind: "mutation",
27036
27165
  auth: "admin"
27037
27166
  });
@@ -29613,6 +29742,12 @@ Object.freeze({
29613
29742
  addonId: null,
29614
29743
  access: "create"
29615
29744
  },
29745
+ "failureContribution.list": {
29746
+ capName: "failure-contribution",
29747
+ capScope: "system",
29748
+ addonId: null,
29749
+ access: "view"
29750
+ },
29616
29751
  "fanControl.setDirection": {
29617
29752
  capName: "fan-control",
29618
29753
  capScope: "device",
@@ -32919,6 +33054,12 @@ Object.freeze({
32919
33054
  addonId: null,
32920
33055
  access: "create"
32921
33056
  },
33057
+ "system.getFailureContributions": {
33058
+ capName: "system",
33059
+ capScope: "system",
33060
+ addonId: null,
33061
+ access: "view"
33062
+ },
32922
33063
  "system.getLoadContributions": {
32923
33064
  capName: "system",
32924
33065
  capScope: "system",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-smtp-nodemailer",
3
- "version": "1.2.37",
3
+ "version": "1.2.38",
4
4
  "description": "SMTP email provider addon for CamStack — wraps `nodemailer` and registers a `smtp-provider` cap collection entry. Used by magic-link login + notifier addons.",
5
5
  "keywords": [
6
6
  "camstack",