@camstack/addon-auth 1.2.48 → 1.2.50

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.
@@ -8117,6 +8117,21 @@ var RelocateJobSchema = object({
8117
8117
  bytesMoved: number().int(),
8118
8118
  /** Total files discovered up front; null while (or when) unknown. */
8119
8119
  filesTotal: number().int().nullable(),
8120
+ /**
8121
+ * Rows this run CORRECTED while moving them — a durable mutation the move
8122
+ * made that nobody asked for, so it is reported where the operator reads the
8123
+ * job rather than only in a log line.
8124
+ *
8125
+ * A footage segment records its byte count in its own NAME, and the durable
8126
+ * hour row derives its aggregates from those names. A file that does not
8127
+ * match its name therefore makes the ledger's sums — and with them quota and
8128
+ * pressure eviction — wrong by the difference, and only a rename can fix it.
8129
+ * On 2026-08-30 one such row also stalled a 110 749-file drain permanently.
8130
+ *
8131
+ * Absent on lanes where the question has no meaning: a media blob's size is
8132
+ * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8133
+ */
8134
+ rowsReconciled: number().int().nonnegative().optional(),
8120
8135
  startedAt: number(),
8121
8136
  finishedAt: number().nullable(),
8122
8137
  error: string().nullable()
@@ -8185,14 +8200,42 @@ var RelocateMediaInputSchema = object({
8185
8200
  /** Omitted = `move`, the pre-existing behaviour. */
8186
8201
  mode: MediaRelocateModeSchema.optional()
8187
8202
  });
8188
- /** How many rows still carry NO `locationId` — the population a repoint would
8189
- * silently re-aim at a disk that does not hold their bytes. Zero is the only
8190
- * value that permits a non-blocking `eventMedia` cutover. */
8191
- var UnstampedEventMediaCountSchema = object({
8192
- media: number().int().nonnegative(),
8193
- retrainFrames: number().int().nonnegative(),
8194
- total: number().int().nonnegative()
8203
+ /**
8204
+ * The unstamped population of ONE collection — split, because the gate and the
8205
+ * operator ask two different questions and only one of them has to be cheap.
8206
+ *
8207
+ * `present` is the GATE: "is there at least one row that would be orphaned by a
8208
+ * repoint". It is a single indexed seek to the first matching row, so it stays
8209
+ * answerable on a saturated disk and answers in O(log n) precisely in the state
8210
+ * that matters — after a seal, when the population is empty.
8211
+ *
8212
+ * `rows` is the NUMBER, for the refusal message and the operator's sense of
8213
+ * scale. It is a second, indexed `COUNT(*)`, and `null` means **not
8214
+ * measurable** — never zero. `{ present: true, rows: null }` is a legitimate
8215
+ * and useful answer: "there are some, and this read could not say how many"
8216
+ * still refuses the cutover, which is the whole job.
8217
+ */
8218
+ var UnstampedRowsSchema = object({
8219
+ present: boolean(),
8220
+ rows: number().int().nonnegative().nullable()
8195
8221
  });
8222
+ /**
8223
+ * How many rows still carry NO `locationId` — the population a repoint would
8224
+ * silently re-aim at a disk that does not hold their bytes.
8225
+ *
8226
+ * **`null` = the count could not be taken**, and it is NOT permission to cut
8227
+ * over. The gate opens on a measured absence and on nothing else; an unread
8228
+ * collection and an empty one are different facts, and this repo has already
8229
+ * paid for conflating them (`RelocateResidueSchema`, D295).
8230
+ */
8231
+ var UnstampedEventMediaCountSchema = object({
8232
+ media: UnstampedRowsSchema,
8233
+ retrainFrames: UnstampedRowsSchema,
8234
+ /** True when EITHER collection holds one. The refusal reads this. */
8235
+ anyPresent: boolean(),
8236
+ /** Sum across both, or `null` when either lane could not be counted. */
8237
+ total: number().int().nonnegative().nullable()
8238
+ }).nullable();
8196
8239
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8197
8240
  /** The independently selectable logical storage classes — every class
8198
8241
  * `storage.listLocationDeclarations` reports, so an operator never meets a
@@ -8303,6 +8346,10 @@ var StorageMigrationMoveProgressSchema = object({
8303
8346
  /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
8304
8347
  filesTotal: number().int().nonnegative().nullable(),
8305
8348
  bytesMoved: number().int().nonnegative(),
8349
+ /** Rows the mover corrected while moving them — see `RelocateJob`. Absent on
8350
+ * a lane that cannot reconcile. A migration that silently rewrote durable
8351
+ * rows would be the same failure as one that silently skipped them. */
8352
+ rowsReconciled: number().int().nonnegative().optional(),
8306
8353
  /** The MOVER's start, not the migration's: a drain restarted after an addon
8307
8354
  * crash gets a new mover, and a rate computed from the migration's start
8308
8355
  * would silently average in the time nothing was running. */
@@ -13038,6 +13085,114 @@ method(object({
13038
13085
  height: number()
13039
13086
  }), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
13040
13087
  /**
13088
+ * `failure-contribution` — the capability an addon reports its OWN losses
13089
+ * through, per camera, with the denominator attached. It stores nothing.
13090
+ *
13091
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13092
+ *
13093
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13094
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13095
+ * copied: the contributor reports what it already knows, hub-main adds only
13096
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13097
+ * somebody to forget to edit.
13098
+ *
13099
+ * They are not merged, because their invariants are opposites:
13100
+ *
13101
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13102
+ * claim a camera cost nothing, which is a measurement nobody made;
13103
+ * - a `failure-contribution` zero is the **most valuable value on the
13104
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13105
+ * and it is exactly what an absent entry cannot say.
13106
+ *
13107
+ * Putting a loss counter on a cost entry would also break the reconciliation
13108
+ * that gives `load-contribution` its point: contributions are subtracted from
13109
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13110
+ * has no process.
13111
+ *
13112
+ * ## Why not a log line, since the counters already exist
13113
+ *
13114
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13115
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13116
+ * ends in a log line, and a log line is the thing the operator asked to stop
13117
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13118
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13119
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13120
+ * media blackout were both diagnosed. The counters stay; this is where they can
13121
+ * be READ.
13122
+ *
13123
+ * ## The rate is served with its denominator or not at all
13124
+ *
13125
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13126
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13127
+ * than yesterday" and was **flat across twelve hours** once divided by the
13128
+ * successes on the same path. A surface that publishes only the numerator
13129
+ * reproduces that mistake on every read.
13130
+ *
13131
+ * ## Shape
13132
+ *
13133
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13134
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13135
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13136
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13137
+ * a forked runner's entries reach hub-main over transport that already exists.
13138
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13139
+ * result through `system.getFailureContributions`.
13140
+ */
13141
+ var FailureReasonCountSchema = object({
13142
+ /**
13143
+ * Why the attempt did not land, in the contributor's own vocabulary —
13144
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13145
+ * strings that already appear in this repo's logs and, where one exists, the
13146
+ * same string the per-track `previewMissReason` records (D276): a second
13147
+ * vocabulary for the same loss would make the row and the counter
13148
+ * un-joinable.
13149
+ */
13150
+ reason: string(),
13151
+ count: number().int().nonnegative()
13152
+ });
13153
+ var FailureContributionSchema = object({
13154
+ /**
13155
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13156
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13157
+ * `unit` free: the families are owned by different addons and a shared enum
13158
+ * is a central list that rots invisibly.
13159
+ */
13160
+ family: string(),
13161
+ /**
13162
+ * The NUMERIC device id — the same value every log line carries as
13163
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13164
+ * cannot name the camera must not emit the entry, because a fleet total
13165
+ * cannot answer the only question anybody asks of this surface.
13166
+ */
13167
+ deviceId: number().int().positive(),
13168
+ /**
13169
+ * A second dimension inside the family: the model / step id for an inference
13170
+ * timeout, so "which camera AND which model" is one read. Absent when the
13171
+ * family has a single variant.
13172
+ */
13173
+ variant: string().optional(),
13174
+ /**
13175
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13176
+ * differencing two reads must drop the interval when it changes, because the
13177
+ * counter restarted from zero in a respawned runner. Same discipline as
13178
+ * `LoadContribution.startedAtMs`.
13179
+ */
13180
+ sinceMs: number(),
13181
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13182
+ atMs: number(),
13183
+ /**
13184
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13185
+ * window. A failure count published without it is the mistake this schema
13186
+ * exists to make impossible.
13187
+ */
13188
+ attempts: number().int().nonnegative(),
13189
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13190
+ succeeded: number().int().nonnegative(),
13191
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13192
+ reasons: array(FailureReasonCountSchema).readonly()
13193
+ });
13194
+ method(_void(), array(FailureContributionSchema).readonly());
13195
+ /**
13041
13196
  * filesystem-browse — per-node capability for browsing the node's local
13042
13197
  * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
13043
13198
  * are sandboxed to operator-configured allowed roots (D115). Used by the
@@ -13559,6 +13714,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
13559
13714
  kind: "mutation",
13560
13715
  auth: "admin"
13561
13716
  });
13717
+ var LoadContributionSchema = object({
13718
+ role: _enum([
13719
+ "decode",
13720
+ "transcode",
13721
+ "recording",
13722
+ "streaming",
13723
+ "detection"
13724
+ ]),
13725
+ /**
13726
+ * The NUMERIC device id — the same value every log line carries as
13727
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13728
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
13729
+ * contributor that cannot name its camera must not emit the entry at all,
13730
+ * because an unnamed per-camera entry is indistinguishable from a shared one
13731
+ * and would quietly turn one camera's cost into everybody's.
13732
+ */
13733
+ deviceId: number().int().positive().nullable(),
13734
+ attribution: _enum([
13735
+ "measured",
13736
+ "accounted",
13737
+ "unattributable"
13738
+ ]),
13739
+ /**
13740
+ * What ONE entry is, in the contributor's own words — `615/high`,
13741
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13742
+ * family and inventing a common one would lose the only information that
13743
+ * makes two entries for the same camera distinguishable.
13744
+ */
13745
+ unit: string(),
13746
+ /**
13747
+ * The OS process this cost lives in, when there is one. Present so a
13748
+ * consumer can (a) tell two generations of the same unit apart across a
13749
+ * restart, and (b) subtract claimed processes from the node's process
13750
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13751
+ * process of its own.
13752
+ */
13753
+ pid: number().int().positive().optional(),
13754
+ /**
13755
+ * When this generation started. The pid's incarnation marker: a consumer
13756
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13757
+ * window when this changes, because the counter restarted from zero in a new
13758
+ * process.
13759
+ */
13760
+ startedAtMs: number().optional(),
13761
+ /**
13762
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13763
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
13764
+ * contribution is asked for.
13765
+ *
13766
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
13767
+ * needs a sampler, and a new per-node sampler is the defect half of
13768
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13769
+ * by whoever already keeps a history; a rate cannot be un-averaged.
13770
+ *
13771
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13772
+ * an entry with no process.
13773
+ */
13774
+ cpuSeconds: number().optional(),
13775
+ /** Resident bytes of this unit's process, same source and same rules. */
13776
+ rssBytes: number().optional()
13777
+ });
13778
+ method(_void(), array(LoadContributionSchema).readonly());
13562
13779
  /**
13563
13780
  * `log-channels` — the capability an addon DECLARES its diagnostic channels
13564
13781
  * through. It stores nothing.
@@ -13635,176 +13852,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13635
13852
  tags: record(string(), string()).optional()
13636
13853
  }), array(LogEntrySchema).readonly());
13637
13854
  /**
13638
- * `failure-contribution` — the capability an addon reports its OWN losses
13639
- * through, per camera, with the denominator attached. It stores nothing.
13640
- *
13641
- * ## The twin of `load-contribution`, and why it is a twin and not a field
13642
- *
13643
- * `load-contribution` answers *what did this camera COST*. This answers *what
13644
- * did this camera LOSE*. The reporting discipline is identical and deliberately
13645
- * copied: the contributor reports what it already knows, hub-main adds only
13646
- * `addonId`, nothing needs global knowledge, and there is no central list for
13647
- * somebody to forget to edit.
13648
- *
13649
- * They are not merged, because their invariants are opposites:
13650
- *
13651
- * - a `load-contribution` measurement is **absent, never zero** — a zero would
13652
- * claim a camera cost nothing, which is a measurement nobody made;
13653
- * - a `failure-contribution` zero is the **most valuable value on the
13654
- * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13655
- * and it is exactly what an absent entry cannot say.
13656
- *
13657
- * Putting a loss counter on a cost entry would also break the reconciliation
13658
- * that gives `load-contribution` its point: contributions are subtracted from
13659
- * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13660
- * has no process.
13661
- *
13662
- * ## Why not a log line, since the counters already exist
13663
- *
13664
- * Several of these paths already counted themselves — `CaptureScheduler`'s
13665
- * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13666
- * ends in a log line, and a log line is the thing the operator asked to stop
13667
- * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13668
- * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13669
- * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13670
- * media blackout were both diagnosed. The counters stay; this is where they can
13671
- * be READ.
13672
- *
13673
- * ## The rate is served with its denominator or not at all
13674
- *
13675
- * Every entry carries `attempts` and `succeeded`. A miss count alone is
13676
- * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13677
- * than yesterday" and was **flat across twelve hours** once divided by the
13678
- * successes on the same path. A surface that publishes only the numerator
13679
- * reproduces that mistake on every read.
13680
- *
13681
- * ## Shape
13682
- *
13683
- * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13684
- * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13685
- * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13686
- * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13687
- * a forked runner's entries reach hub-main over transport that already exists.
13688
- * No new UDS message, no second registry (D3). The operator reads the assembled
13689
- * result through `system.getFailureContributions`.
13690
- */
13691
- var FailureReasonCountSchema = object({
13692
- /**
13693
- * Why the attempt did not land, in the contributor's own vocabulary —
13694
- * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13695
- * strings that already appear in this repo's logs and, where one exists, the
13696
- * same string the per-track `previewMissReason` records (D276): a second
13697
- * vocabulary for the same loss would make the row and the counter
13698
- * un-joinable.
13699
- */
13700
- reason: string(),
13701
- count: number().int().nonnegative()
13702
- });
13703
- var FailureContributionSchema = object({
13704
- /**
13705
- * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13706
- * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13707
- * `unit` free: the families are owned by different addons and a shared enum
13708
- * is a central list that rots invisibly.
13709
- */
13710
- family: string(),
13711
- /**
13712
- * The NUMERIC device id — the same value every log line carries as
13713
- * `tags.deviceId`. Never nullable and never absent: a contributor that
13714
- * cannot name the camera must not emit the entry, because a fleet total
13715
- * cannot answer the only question anybody asks of this surface.
13716
- */
13717
- deviceId: number().int().positive(),
13718
- /**
13719
- * A second dimension inside the family: the model / step id for an inference
13720
- * timeout, so "which camera AND which model" is one read. Absent when the
13721
- * family has a single variant.
13722
- */
13723
- variant: string().optional(),
13724
- /**
13725
- * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13726
- * differencing two reads must drop the interval when it changes, because the
13727
- * counter restarted from zero in a respawned runner. Same discipline as
13728
- * `LoadContribution.startedAtMs`.
13729
- */
13730
- sinceMs: number(),
13731
- /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13732
- atMs: number(),
13733
- /**
13734
- * THE DENOMINATOR — every attempt on this path for this camera in the
13735
- * window. A failure count published without it is the mistake this schema
13736
- * exists to make impossible.
13737
- */
13738
- attempts: number().int().nonnegative(),
13739
- /** Attempts that landed. `attempts - succeeded` is the loss. */
13740
- succeeded: number().int().nonnegative(),
13741
- /** The loss, partitioned. Sums to `attempts - succeeded`. */
13742
- reasons: array(FailureReasonCountSchema).readonly()
13743
- });
13744
- method(_void(), array(FailureContributionSchema).readonly());
13745
- var LoadContributionSchema = object({
13746
- role: _enum([
13747
- "decode",
13748
- "transcode",
13749
- "recording",
13750
- "streaming",
13751
- "detection"
13752
- ]),
13753
- /**
13754
- * The NUMERIC device id — the same value every log line carries as
13755
- * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13756
- * camera (a shared pool), NOT that the contributor forgot to look it up: a
13757
- * contributor that cannot name its camera must not emit the entry at all,
13758
- * because an unnamed per-camera entry is indistinguishable from a shared one
13759
- * and would quietly turn one camera's cost into everybody's.
13760
- */
13761
- deviceId: number().int().positive().nullable(),
13762
- attribution: _enum([
13763
- "measured",
13764
- "accounted",
13765
- "unattributable"
13766
- ]),
13767
- /**
13768
- * What ONE entry is, in the contributor's own words — `615/high`,
13769
- * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13770
- * family and inventing a common one would lose the only information that
13771
- * makes two entries for the same camera distinguishable.
13772
- */
13773
- unit: string(),
13774
- /**
13775
- * The OS process this cost lives in, when there is one. Present so a
13776
- * consumer can (a) tell two generations of the same unit apart across a
13777
- * restart, and (b) subtract claimed processes from the node's process
13778
- * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13779
- * process of its own.
13780
- */
13781
- pid: number().int().positive().optional(),
13782
- /**
13783
- * When this generation started. The pid's incarnation marker: a consumer
13784
- * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13785
- * window when this changes, because the counter restarted from zero in a new
13786
- * process.
13787
- */
13788
- startedAtMs: number().optional(),
13789
- /**
13790
- * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13791
- * system, read from the child's own `/proc/<pid>/stat` at the moment the
13792
- * contribution is asked for.
13793
- *
13794
- * Cumulative and not a rate on purpose: a rate needs a window, a window
13795
- * needs a sampler, and a new per-node sampler is the defect half of
13796
- * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13797
- * by whoever already keeps a history; a rate cannot be un-averaged.
13798
- *
13799
- * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13800
- * an entry with no process.
13801
- */
13802
- cpuSeconds: number().optional(),
13803
- /** Resident bytes of this unit's process, same source and same rules. */
13804
- rssBytes: number().optional()
13805
- });
13806
- method(_void(), array(LoadContributionSchema).readonly());
13807
- /**
13808
13855
  * `login-method` — collection cap through which auth addons contribute
13809
13856
  * their pre-auth login surfaces to the login page. This is the SINGLE,
13810
13857
  * generic mechanism that supersedes the dead `auth.listProviders` reader:
@@ -18472,12 +18519,53 @@ var MediaFileKindEnum = _enum([
18472
18519
  "keyFrameSmall",
18473
18520
  "thumbnailSmall"
18474
18521
  ]);
18522
+ /**
18523
+ * One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
18524
+ * ARE — never the bytes themselves.
18525
+ *
18526
+ * ## Why `url` and not `base64`
18527
+ *
18528
+ * Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
18529
+ * with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
18530
+ * was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
18531
+ * wire. Forty events is ~144 MB. Every byte of it was read off disk,
18532
+ * base64-encoded, held whole in a unary tRPC envelope, and materialised in
18533
+ * hub-main's heap on the way past — for an `<img>` that would have cached it.
18534
+ *
18535
+ * `url` points at the `event-media` data plane
18536
+ * (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
18537
+ * with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
18538
+ * render a `?variant=thumb`, and streams. The hub gate in front of it requires
18539
+ * a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
18540
+ * no less protected than they were inside a `view`-level cap response — see
18541
+ * `data-plane-access.ts` for the rule and the one gap it does not close
18542
+ * (per-device scoping).
18543
+ *
18544
+ * The URL is built from the row's **stored** key, which is not always its
18545
+ * published `kind`: a track's face/plate crop is stored as `crop` under
18546
+ * `('face'|'plate', '<prefix>-<trackId>')` and published as
18547
+ * `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
18548
+ *
18549
+ * ## `base64` is TRANSITIONAL and is going away
18550
+ *
18551
+ * It is still populated for one reason: the deployed viewer's track-detail
18552
+ * HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
18553
+ * REQUIRES the field), and a row without it parses as a FAILED read — the red
18554
+ * triangle — not as absence. Removing the field before that viewer ships is an
18555
+ * outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
18556
+ * delete this line and the `withBytes` pass-through in
18557
+ * `analytics-query-facade.ts`; nothing else reads it.
18558
+ */
18475
18559
  var MediaFileSchema = object({
18476
18560
  key: string(),
18477
18561
  kind: MediaFileKindEnum,
18478
- base64: string(),
18479
18562
  sizeBytes: number(),
18480
18563
  timestamp: number()
18564
+ }).extend({
18565
+ /** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
18566
+ url: string(),
18567
+ /** @deprecated Transitional — see the schema docblock. Use {@link url}. */
18568
+ base64: string()
18481
18569
  });
18482
18570
  /**
18483
18571
  * One media row WITHOUT its bytes.
@@ -18489,7 +18577,9 @@ var MediaFileSchema = object({
18489
18577
  * blocks the whole view.
18490
18578
  *
18491
18579
  * `sizeBytes` is carried because it is what lets a client decide between the
18492
- * stored blob and a `?variant=thumb` rendering without fetching either.
18580
+ * stored blob and a `?variant=thumb` rendering without fetching either, and
18581
+ * `url` because a client that had to build the plane path itself is a second
18582
+ * copy of a route — the embed, the viewer and the admin UI each grew one.
18493
18583
  */
18494
18584
  var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
18495
18585
  /**
@@ -19178,6 +19268,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19178
19268
  }), array(MediaFileSchema).readonly()), method(object({
19179
19269
  trackId: string(),
19180
19270
  deviceId: number()
19271
+ }), array(MediaFileInfoSchema).readonly()), method(object({
19272
+ eventId: string(),
19273
+ deviceId: number()
19181
19274
  }), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
19182
19275
  kind: "mutation",
19183
19276
  auth: "admin"
@@ -23473,10 +23566,24 @@ var FaceClusterSchema = object({
23473
23566
  size: number().int(),
23474
23567
  cohesion: number()
23475
23568
  });
23569
+ /**
23570
+ * One gallery media row: what the crop is, how big it is, and WHERE its bytes
23571
+ * are — never the bytes.
23572
+ *
23573
+ * `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
23574
+ * track/event contract) is still populated because a deployed viewer requires
23575
+ * the field to parse a row at all; this method has no such reader. Its ONE
23576
+ * caller is the admin UI's detail modal, which was building
23577
+ * `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
23578
+ * dialog already rendering its key FRAME from the `event-media` plane.
23579
+ *
23580
+ * `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
23581
+ * media key directly, so this needed no new plane and no new access decision.
23582
+ */
23476
23583
  var MediaFileLiteSchema$1 = object({
23477
23584
  key: string(),
23478
23585
  kind: string(),
23479
- base64: string(),
23586
+ url: string(),
23480
23587
  sizeBytes: number(),
23481
23588
  timestamp: number()
23482
23589
  });
@@ -25728,10 +25835,24 @@ var PlateInfoSchema = object({
25728
25835
  */
25729
25836
  cropUrl: string().optional()
25730
25837
  });
25838
+ /**
25839
+ * One gallery media row: what the crop is, how big it is, and WHERE its bytes
25840
+ * are — never the bytes.
25841
+ *
25842
+ * `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
25843
+ * track/event contract) is still populated because a deployed viewer requires
25844
+ * the field to parse a row at all; this method has no such reader. Its ONE
25845
+ * caller is the admin UI's detail modal, which was building
25846
+ * `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
25847
+ * dialog already rendering its key FRAME from the `event-media` plane.
25848
+ *
25849
+ * `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
25850
+ * media key directly, so this needed no new plane and no new access decision.
25851
+ */
25731
25852
  var MediaFileLiteSchema = object({
25732
25853
  key: string(),
25733
25854
  kind: string(),
25734
- base64: string(),
25855
+ url: string(),
25735
25856
  sizeBytes: number(),
25736
25857
  timestamp: number()
25737
25858
  });
@@ -31744,6 +31865,12 @@ Object.freeze({
31744
31865
  addonId: null,
31745
31866
  access: "view"
31746
31867
  },
31868
+ "pipelineAnalytics.listEventMedia": {
31869
+ capName: "pipeline-analytics",
31870
+ capScope: "device",
31871
+ addonId: null,
31872
+ access: "view"
31873
+ },
31747
31874
  "pipelineAnalytics.listGroups": {
31748
31875
  capName: "pipeline-analytics",
31749
31876
  capScope: "device",
@@ -35367,6 +35494,11 @@ Object.freeze({
35367
35494
  form: "array",
35368
35495
  optional: false
35369
35496
  }],
35497
+ "pipelineAnalytics.listEventMedia": [{
35498
+ name: "deviceId",
35499
+ form: "single",
35500
+ optional: false
35501
+ }],
35370
35502
  "pipelineAnalytics.listGroups": [{
35371
35503
  name: "deviceIds",
35372
35504
  form: "array",