@camstack/addon-tailscale 1.2.38 → 1.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.
@@ -24,7 +24,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
24
24
  enumerable: true
25
25
  }) : target, mod));
26
26
  //#endregion
27
- const require_dist = require("../dist-1cd9nLqr.js");
27
+ const require_dist = require("../dist-DXDI20wF.js");
28
28
  let node_child_process = require("node:child_process");
29
29
  let node_util = require("node:util");
30
30
  let node_fs = require("node:fs");
@@ -1,4 +1,4 @@
1
- import { a as EventCategory, i as BaseAddon, n as networkAccessCapability, r as BOOT_RECOVERY_BACKOFF_MS, t as meshNetworkCapability } from "../dist-Bw48pf94.mjs";
1
+ import { a as EventCategory, i as BaseAddon, n as networkAccessCapability, r as BOOT_RECOVERY_BACKOFF_MS, t as meshNetworkCapability } from "../dist-CNu9kGot.mjs";
2
2
  import { execFile, spawn } from "node:child_process";
3
3
  import { promisify } from "node:util";
4
4
  import * as fs from "node:fs";
@@ -13220,6 +13220,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13220
13220
  limit: number().optional(),
13221
13221
  tags: record(string(), string()).optional()
13222
13222
  }), array(LogEntrySchema).readonly());
13223
+ /**
13224
+ * `failure-contribution` — the capability an addon reports its OWN losses
13225
+ * through, per camera, with the denominator attached. It stores nothing.
13226
+ *
13227
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13228
+ *
13229
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13230
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13231
+ * copied: the contributor reports what it already knows, hub-main adds only
13232
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13233
+ * somebody to forget to edit.
13234
+ *
13235
+ * They are not merged, because their invariants are opposites:
13236
+ *
13237
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13238
+ * claim a camera cost nothing, which is a measurement nobody made;
13239
+ * - a `failure-contribution` zero is the **most valuable value on the
13240
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13241
+ * and it is exactly what an absent entry cannot say.
13242
+ *
13243
+ * Putting a loss counter on a cost entry would also break the reconciliation
13244
+ * that gives `load-contribution` its point: contributions are subtracted from
13245
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13246
+ * has no process.
13247
+ *
13248
+ * ## Why not a log line, since the counters already exist
13249
+ *
13250
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13251
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13252
+ * ends in a log line, and a log line is the thing the operator asked to stop
13253
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13254
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13255
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13256
+ * media blackout were both diagnosed. The counters stay; this is where they can
13257
+ * be READ.
13258
+ *
13259
+ * ## The rate is served with its denominator or not at all
13260
+ *
13261
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13262
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13263
+ * than yesterday" and was **flat across twelve hours** once divided by the
13264
+ * successes on the same path. A surface that publishes only the numerator
13265
+ * reproduces that mistake on every read.
13266
+ *
13267
+ * ## Shape
13268
+ *
13269
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13270
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13271
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13272
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13273
+ * a forked runner's entries reach hub-main over transport that already exists.
13274
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13275
+ * result through `system.getFailureContributions`.
13276
+ */
13277
+ var FailureReasonCountSchema = object({
13278
+ /**
13279
+ * Why the attempt did not land, in the contributor's own vocabulary —
13280
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13281
+ * strings that already appear in this repo's logs and, where one exists, the
13282
+ * same string the per-track `previewMissReason` records (D276): a second
13283
+ * vocabulary for the same loss would make the row and the counter
13284
+ * un-joinable.
13285
+ */
13286
+ reason: string(),
13287
+ count: number().int().nonnegative()
13288
+ });
13289
+ var FailureContributionSchema = object({
13290
+ /**
13291
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13292
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13293
+ * `unit` free: the families are owned by different addons and a shared enum
13294
+ * is a central list that rots invisibly.
13295
+ */
13296
+ family: string(),
13297
+ /**
13298
+ * The NUMERIC device id — the same value every log line carries as
13299
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13300
+ * cannot name the camera must not emit the entry, because a fleet total
13301
+ * cannot answer the only question anybody asks of this surface.
13302
+ */
13303
+ deviceId: number().int().positive(),
13304
+ /**
13305
+ * A second dimension inside the family: the model / step id for an inference
13306
+ * timeout, so "which camera AND which model" is one read. Absent when the
13307
+ * family has a single variant.
13308
+ */
13309
+ variant: string().optional(),
13310
+ /**
13311
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13312
+ * differencing two reads must drop the interval when it changes, because the
13313
+ * counter restarted from zero in a respawned runner. Same discipline as
13314
+ * `LoadContribution.startedAtMs`.
13315
+ */
13316
+ sinceMs: number(),
13317
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13318
+ atMs: number(),
13319
+ /**
13320
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13321
+ * window. A failure count published without it is the mistake this schema
13322
+ * exists to make impossible.
13323
+ */
13324
+ attempts: number().int().nonnegative(),
13325
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13326
+ succeeded: number().int().nonnegative(),
13327
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13328
+ reasons: array(FailureReasonCountSchema).readonly()
13329
+ });
13330
+ method(_void(), array(FailureContributionSchema).readonly());
13223
13331
  var LoadContributionSchema = object({
13224
13332
  role: _enum([
13225
13333
  "decode",
@@ -17749,6 +17857,20 @@ var TrackSchema = object({
17749
17857
  * `=== true` and render nothing otherwise — never infer "no rider".
17750
17858
  */
17751
17859
  hasRider: boolean().optional(),
17860
+ /**
17861
+ * WHY this track ended without a NATIVE best-shot tile
17862
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
17863
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
17864
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
17865
+ * the late-keyFrame upgrade when a native tile lands after all. The
17866
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
17867
+ * tile is a face/plate stand-in, a raster crop, or an icon.
17868
+ *
17869
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
17870
+ * that predates the field, and every track whose tile landed native all
17871
+ * omit it. Render nothing when absent.
17872
+ */
17873
+ previewMissReason: string().optional(),
17752
17874
  ...TrackFlagFields,
17753
17875
  ...TrackRetrainFields
17754
17876
  });
@@ -27036,6 +27158,13 @@ var LoggingSettingsPatchSchema = object({
27036
27158
  * anyone but its owner.
27037
27159
  */
27038
27160
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
27161
+ /**
27162
+ * One per-camera failure counter, plus WHO reported it.
27163
+ *
27164
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
27165
+ * the hub as it enumerates providers, never by the contributor.
27166
+ */
27167
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
27039
27168
  var GetLoggingSettingsInputSchema = object({
27040
27169
  scopeNodeId: string().optional(),
27041
27170
  /**
@@ -27094,7 +27223,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
27094
27223
  }), method(_void(), SiteLocationStatusSchema, {
27095
27224
  kind: "mutation",
27096
27225
  auth: "admin"
27097
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27226
+ }), 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, {
27098
27227
  kind: "mutation",
27099
27228
  auth: "admin"
27100
27229
  });
@@ -29676,6 +29805,12 @@ Object.freeze({
29676
29805
  addonId: null,
29677
29806
  access: "create"
29678
29807
  },
29808
+ "failureContribution.list": {
29809
+ capName: "failure-contribution",
29810
+ capScope: "system",
29811
+ addonId: null,
29812
+ access: "view"
29813
+ },
29679
29814
  "fanControl.setDirection": {
29680
29815
  capName: "fan-control",
29681
29816
  capScope: "device",
@@ -32982,6 +33117,12 @@ Object.freeze({
32982
33117
  addonId: null,
32983
33118
  access: "create"
32984
33119
  },
33120
+ "system.getFailureContributions": {
33121
+ capName: "system",
33122
+ capScope: "system",
33123
+ addonId: null,
33124
+ access: "view"
33125
+ },
32985
33126
  "system.getLoadContributions": {
32986
33127
  capName: "system",
32987
33128
  capScope: "system",
@@ -13220,6 +13220,114 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13220
13220
  limit: number().optional(),
13221
13221
  tags: record(string(), string()).optional()
13222
13222
  }), array(LogEntrySchema).readonly());
13223
+ /**
13224
+ * `failure-contribution` — the capability an addon reports its OWN losses
13225
+ * through, per camera, with the denominator attached. It stores nothing.
13226
+ *
13227
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13228
+ *
13229
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13230
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13231
+ * copied: the contributor reports what it already knows, hub-main adds only
13232
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13233
+ * somebody to forget to edit.
13234
+ *
13235
+ * They are not merged, because their invariants are opposites:
13236
+ *
13237
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13238
+ * claim a camera cost nothing, which is a measurement nobody made;
13239
+ * - a `failure-contribution` zero is the **most valuable value on the
13240
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13241
+ * and it is exactly what an absent entry cannot say.
13242
+ *
13243
+ * Putting a loss counter on a cost entry would also break the reconciliation
13244
+ * that gives `load-contribution` its point: contributions are subtracted from
13245
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13246
+ * has no process.
13247
+ *
13248
+ * ## Why not a log line, since the counters already exist
13249
+ *
13250
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13251
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13252
+ * ends in a log line, and a log line is the thing the operator asked to stop
13253
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13254
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13255
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13256
+ * media blackout were both diagnosed. The counters stay; this is where they can
13257
+ * be READ.
13258
+ *
13259
+ * ## The rate is served with its denominator or not at all
13260
+ *
13261
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13262
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13263
+ * than yesterday" and was **flat across twelve hours** once divided by the
13264
+ * successes on the same path. A surface that publishes only the numerator
13265
+ * reproduces that mistake on every read.
13266
+ *
13267
+ * ## Shape
13268
+ *
13269
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13270
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13271
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13272
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13273
+ * a forked runner's entries reach hub-main over transport that already exists.
13274
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13275
+ * result through `system.getFailureContributions`.
13276
+ */
13277
+ var FailureReasonCountSchema = object({
13278
+ /**
13279
+ * Why the attempt did not land, in the contributor's own vocabulary —
13280
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13281
+ * strings that already appear in this repo's logs and, where one exists, the
13282
+ * same string the per-track `previewMissReason` records (D276): a second
13283
+ * vocabulary for the same loss would make the row and the counter
13284
+ * un-joinable.
13285
+ */
13286
+ reason: string(),
13287
+ count: number().int().nonnegative()
13288
+ });
13289
+ var FailureContributionSchema = object({
13290
+ /**
13291
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13292
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13293
+ * `unit` free: the families are owned by different addons and a shared enum
13294
+ * is a central list that rots invisibly.
13295
+ */
13296
+ family: string(),
13297
+ /**
13298
+ * The NUMERIC device id — the same value every log line carries as
13299
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13300
+ * cannot name the camera must not emit the entry, because a fleet total
13301
+ * cannot answer the only question anybody asks of this surface.
13302
+ */
13303
+ deviceId: number().int().positive(),
13304
+ /**
13305
+ * A second dimension inside the family: the model / step id for an inference
13306
+ * timeout, so "which camera AND which model" is one read. Absent when the
13307
+ * family has a single variant.
13308
+ */
13309
+ variant: string().optional(),
13310
+ /**
13311
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13312
+ * differencing two reads must drop the interval when it changes, because the
13313
+ * counter restarted from zero in a respawned runner. Same discipline as
13314
+ * `LoadContribution.startedAtMs`.
13315
+ */
13316
+ sinceMs: number(),
13317
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13318
+ atMs: number(),
13319
+ /**
13320
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13321
+ * window. A failure count published without it is the mistake this schema
13322
+ * exists to make impossible.
13323
+ */
13324
+ attempts: number().int().nonnegative(),
13325
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13326
+ succeeded: number().int().nonnegative(),
13327
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13328
+ reasons: array(FailureReasonCountSchema).readonly()
13329
+ });
13330
+ method(_void(), array(FailureContributionSchema).readonly());
13223
13331
  var LoadContributionSchema = object({
13224
13332
  role: _enum([
13225
13333
  "decode",
@@ -17749,6 +17857,20 @@ var TrackSchema = object({
17749
17857
  * `=== true` and render nothing otherwise — never infer "no rider".
17750
17858
  */
17751
17859
  hasRider: boolean().optional(),
17860
+ /**
17861
+ * WHY this track ended without a NATIVE best-shot tile
17862
+ * ([D276](../decisions/adr-0276-a-stand-in-tile-is-provisional-and-a-close-says-why.md)) —
17863
+ * a composed token line (`no-key-frame capture=keyframe:native-missx4`,
17864
+ * `derive-returned-null tile=standin`, …) written at close and CLEARED by
17865
+ * the late-keyFrame upgrade when a native tile lands after all. The
17866
+ * operator-facing answer to "perché manca l'immagine?" on a track whose
17867
+ * tile is a face/plate stand-in, a raster crop, or an icon.
17868
+ *
17869
+ * **Absent ≠ "missed silently"**: a row written before the column, a hub
17870
+ * that predates the field, and every track whose tile landed native all
17871
+ * omit it. Render nothing when absent.
17872
+ */
17873
+ previewMissReason: string().optional(),
17752
17874
  ...TrackFlagFields,
17753
17875
  ...TrackRetrainFields
17754
17876
  });
@@ -27036,6 +27158,13 @@ var LoggingSettingsPatchSchema = object({
27036
27158
  * anyone but its owner.
27037
27159
  */
27038
27160
  var ReportedLoadContributionSchema = LoadContributionSchema.extend({ addonId: string() });
27161
+ /**
27162
+ * One per-camera failure counter, plus WHO reported it.
27163
+ *
27164
+ * Same rule as {@link ReportedLoadContributionSchema}: `addonId` is stamped by
27165
+ * the hub as it enumerates providers, never by the contributor.
27166
+ */
27167
+ var ReportedFailureContributionSchema = FailureContributionSchema.extend({ addonId: string() });
27039
27168
  var GetLoggingSettingsInputSchema = object({
27040
27169
  scopeNodeId: string().optional(),
27041
27170
  /**
@@ -27094,7 +27223,7 @@ method(_void(), FeatureManifestSchema), method(_void(), HealthStatusSchema), met
27094
27223
  }), method(_void(), SiteLocationStatusSchema, {
27095
27224
  kind: "mutation",
27096
27225
  auth: "admin"
27097
- }), method(_void(), RequestCensusStatusSchema, { auth: "admin" }), method(_void(), array(ReportedLoadContributionSchema).readonly(), { auth: "admin" }), method(GetLoggingSettingsInputSchema, LoggingSettingsStateSchema, { auth: "admin" }), method(SetLoggingSettingsInputSchema, LoggingSettingsStateSchema, {
27226
+ }), 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, {
27098
27227
  kind: "mutation",
27099
27228
  auth: "admin"
27100
27229
  });
@@ -29676,6 +29805,12 @@ Object.freeze({
29676
29805
  addonId: null,
29677
29806
  access: "create"
29678
29807
  },
29808
+ "failureContribution.list": {
29809
+ capName: "failure-contribution",
29810
+ capScope: "system",
29811
+ addonId: null,
29812
+ access: "view"
29813
+ },
29679
29814
  "fanControl.setDirection": {
29680
29815
  capName: "fan-control",
29681
29816
  capScope: "device",
@@ -32982,6 +33117,12 @@ Object.freeze({
32982
33117
  addonId: null,
32983
33118
  access: "create"
32984
33119
  },
33120
+ "system.getFailureContributions": {
33121
+ capName: "system",
33122
+ capScope: "system",
33123
+ addonId: null,
33124
+ access: "view"
33125
+ },
32985
33126
  "system.getLoadContributions": {
32986
33127
  capName: "system",
32987
33128
  capScope: "system",
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
2
2
  __esModule: { value: true },
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
- const require_dist = require("../dist-1cd9nLqr.js");
5
+ const require_dist = require("../dist-DXDI20wF.js");
6
6
  let node_crypto = require("node:crypto");
7
7
  let node_child_process = require("node:child_process");
8
8
  //#region src/ingress/tailscale-cli.ts
@@ -1,4 +1,4 @@
1
- import { a as EventCategory, i as BaseAddon, n as networkAccessCapability } from "../dist-Bw48pf94.mjs";
1
+ import { a as EventCategory, i as BaseAddon, n as networkAccessCapability } from "../dist-CNu9kGot.mjs";
2
2
  import { randomUUID } from "node:crypto";
3
3
  import { execFile } from "node:child_process";
4
4
  import { promisify } from "node:util";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camstack/addon-tailscale",
3
- "version": "1.2.38",
3
+ "version": "1.2.39",
4
4
  "description": "Tailscale bundle for CamStack — joins the host to a tailnet (client) and exposes the hub via Serve/Funnel (ingress). Multi-entry npm package shipping 2 addons under a single bundle.",
5
5
  "keywords": [
6
6
  "camstack",