@camstack/addon-auth 1.2.49 → 1.2.51

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.
@@ -13085,6 +13085,114 @@ method(object({
13085
13085
  height: number()
13086
13086
  }), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
13087
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
+ /**
13088
13196
  * filesystem-browse — per-node capability for browsing the node's local
13089
13197
  * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
13090
13198
  * are sandboxed to operator-configured allowed roots (D115). Used by the
@@ -13606,6 +13714,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
13606
13714
  kind: "mutation",
13607
13715
  auth: "admin"
13608
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());
13609
13779
  /**
13610
13780
  * `log-channels` — the capability an addon DECLARES its diagnostic channels
13611
13781
  * through. It stores nothing.
@@ -13682,176 +13852,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
13682
13852
  tags: record(string(), string()).optional()
13683
13853
  }), array(LogEntrySchema).readonly());
13684
13854
  /**
13685
- * `failure-contribution` — the capability an addon reports its OWN losses
13686
- * through, per camera, with the denominator attached. It stores nothing.
13687
- *
13688
- * ## The twin of `load-contribution`, and why it is a twin and not a field
13689
- *
13690
- * `load-contribution` answers *what did this camera COST*. This answers *what
13691
- * did this camera LOSE*. The reporting discipline is identical and deliberately
13692
- * copied: the contributor reports what it already knows, hub-main adds only
13693
- * `addonId`, nothing needs global knowledge, and there is no central list for
13694
- * somebody to forget to edit.
13695
- *
13696
- * They are not merged, because their invariants are opposites:
13697
- *
13698
- * - a `load-contribution` measurement is **absent, never zero** — a zero would
13699
- * claim a camera cost nothing, which is a measurement nobody made;
13700
- * - a `failure-contribution` zero is the **most valuable value on the
13701
- * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13702
- * and it is exactly what an absent entry cannot say.
13703
- *
13704
- * Putting a loss counter on a cost entry would also break the reconciliation
13705
- * that gives `load-contribution` its point: contributions are subtracted from
13706
- * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13707
- * has no process.
13708
- *
13709
- * ## Why not a log line, since the counters already exist
13710
- *
13711
- * Several of these paths already counted themselves — `CaptureScheduler`'s
13712
- * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13713
- * ends in a log line, and a log line is the thing the operator asked to stop
13714
- * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13715
- * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13716
- * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13717
- * media blackout were both diagnosed. The counters stay; this is where they can
13718
- * be READ.
13719
- *
13720
- * ## The rate is served with its denominator or not at all
13721
- *
13722
- * Every entry carries `attempts` and `succeeded`. A miss count alone is
13723
- * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13724
- * than yesterday" and was **flat across twelve hours** once divided by the
13725
- * successes on the same path. A surface that publishes only the numerator
13726
- * reproduces that mistake on every read.
13727
- *
13728
- * ## Shape
13729
- *
13730
- * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13731
- * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13732
- * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13733
- * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13734
- * a forked runner's entries reach hub-main over transport that already exists.
13735
- * No new UDS message, no second registry (D3). The operator reads the assembled
13736
- * result through `system.getFailureContributions`.
13737
- */
13738
- var FailureReasonCountSchema = object({
13739
- /**
13740
- * Why the attempt did not land, in the contributor's own vocabulary —
13741
- * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13742
- * strings that already appear in this repo's logs and, where one exists, the
13743
- * same string the per-track `previewMissReason` records (D276): a second
13744
- * vocabulary for the same loss would make the row and the counter
13745
- * un-joinable.
13746
- */
13747
- reason: string(),
13748
- count: number().int().nonnegative()
13749
- });
13750
- var FailureContributionSchema = object({
13751
- /**
13752
- * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13753
- * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13754
- * `unit` free: the families are owned by different addons and a shared enum
13755
- * is a central list that rots invisibly.
13756
- */
13757
- family: string(),
13758
- /**
13759
- * The NUMERIC device id — the same value every log line carries as
13760
- * `tags.deviceId`. Never nullable and never absent: a contributor that
13761
- * cannot name the camera must not emit the entry, because a fleet total
13762
- * cannot answer the only question anybody asks of this surface.
13763
- */
13764
- deviceId: number().int().positive(),
13765
- /**
13766
- * A second dimension inside the family: the model / step id for an inference
13767
- * timeout, so "which camera AND which model" is one read. Absent when the
13768
- * family has a single variant.
13769
- */
13770
- variant: string().optional(),
13771
- /**
13772
- * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13773
- * differencing two reads must drop the interval when it changes, because the
13774
- * counter restarted from zero in a respawned runner. Same discipline as
13775
- * `LoadContribution.startedAtMs`.
13776
- */
13777
- sinceMs: number(),
13778
- /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13779
- atMs: number(),
13780
- /**
13781
- * THE DENOMINATOR — every attempt on this path for this camera in the
13782
- * window. A failure count published without it is the mistake this schema
13783
- * exists to make impossible.
13784
- */
13785
- attempts: number().int().nonnegative(),
13786
- /** Attempts that landed. `attempts - succeeded` is the loss. */
13787
- succeeded: number().int().nonnegative(),
13788
- /** The loss, partitioned. Sums to `attempts - succeeded`. */
13789
- reasons: array(FailureReasonCountSchema).readonly()
13790
- });
13791
- method(_void(), array(FailureContributionSchema).readonly());
13792
- var LoadContributionSchema = object({
13793
- role: _enum([
13794
- "decode",
13795
- "transcode",
13796
- "recording",
13797
- "streaming",
13798
- "detection"
13799
- ]),
13800
- /**
13801
- * The NUMERIC device id — the same value every log line carries as
13802
- * `tags.deviceId`. `null` means this cost genuinely belongs to no single
13803
- * camera (a shared pool), NOT that the contributor forgot to look it up: a
13804
- * contributor that cannot name its camera must not emit the entry at all,
13805
- * because an unnamed per-camera entry is indistinguishable from a shared one
13806
- * and would quietly turn one camera's cost into everybody's.
13807
- */
13808
- deviceId: number().int().positive().nullable(),
13809
- attribution: _enum([
13810
- "measured",
13811
- "accounted",
13812
- "unattributable"
13813
- ]),
13814
- /**
13815
- * What ONE entry is, in the contributor's own words — `615/high`,
13816
- * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
13817
- * family and inventing a common one would lose the only information that
13818
- * makes two entries for the same camera distinguishable.
13819
- */
13820
- unit: string(),
13821
- /**
13822
- * The OS process this cost lives in, when there is one. Present so a
13823
- * consumer can (a) tell two generations of the same unit apart across a
13824
- * restart, and (b) subtract claimed processes from the node's process
13825
- * snapshot to see what NOBODY claimed. Absent for an entry that owns no
13826
- * process of its own.
13827
- */
13828
- pid: number().int().positive().optional(),
13829
- /**
13830
- * When this generation started. The pid's incarnation marker: a consumer
13831
- * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
13832
- * window when this changes, because the counter restarted from zero in a new
13833
- * process.
13834
- */
13835
- startedAtMs: number().optional(),
13836
- /**
13837
- * CUMULATIVE CPU seconds this unit has consumed since it started — user +
13838
- * system, read from the child's own `/proc/<pid>/stat` at the moment the
13839
- * contribution is asked for.
13840
- *
13841
- * Cumulative and not a rate on purpose: a rate needs a window, a window
13842
- * needs a sampler, and a new per-node sampler is the defect half of
13843
- * `docs/architecture/load-ledger.md` documents. A counter can be differenced
13844
- * by whoever already keeps a history; a rate cannot be un-averaged.
13845
- *
13846
- * Absent — never zero — on a node with no `/proc`, on a read failure, and on
13847
- * an entry with no process.
13848
- */
13849
- cpuSeconds: number().optional(),
13850
- /** Resident bytes of this unit's process, same source and same rules. */
13851
- rssBytes: number().optional()
13852
- });
13853
- method(_void(), array(LoadContributionSchema).readonly());
13854
- /**
13855
13855
  * `login-method` — collection cap through which auth addons contribute
13856
13856
  * their pre-auth login surfaces to the login page. This is the SINGLE,
13857
13857
  * generic mechanism that supersedes the dead `auth.listProviders` reader:
@@ -18519,12 +18519,53 @@ var MediaFileKindEnum = _enum([
18519
18519
  "keyFrameSmall",
18520
18520
  "thumbnailSmall"
18521
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
+ */
18522
18559
  var MediaFileSchema = object({
18523
18560
  key: string(),
18524
18561
  kind: MediaFileKindEnum,
18525
- base64: string(),
18526
18562
  sizeBytes: number(),
18527
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()
18528
18569
  });
18529
18570
  /**
18530
18571
  * One media row WITHOUT its bytes.
@@ -18536,7 +18577,9 @@ var MediaFileSchema = object({
18536
18577
  * blocks the whole view.
18537
18578
  *
18538
18579
  * `sizeBytes` is carried because it is what lets a client decide between the
18539
- * 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.
18540
18583
  */
18541
18584
  var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
18542
18585
  /**
@@ -18883,6 +18926,50 @@ var EventStoreFootprintSchema = object({
18883
18926
  totalBytes: number().int(),
18884
18927
  devices: array(EventStoreDeviceFootprintSchema).readonly()
18885
18928
  });
18929
+ /** Event-media footprint for one {@link MediaFileKind}. */
18930
+ var EventMediaKindFootprintSchema = object({
18931
+ kind: MediaFileKindEnum,
18932
+ /** Media rows of this kind. */
18933
+ rows: number().int(),
18934
+ /** Bytes on disk held by those rows. */
18935
+ bytes: number().int()
18936
+ });
18937
+ /**
18938
+ * The media footprint broken down by KIND — the axis a deletion decision
18939
+ * actually turns on.
18940
+ *
18941
+ * A byte total says how much there is; it cannot say what is safe to remove.
18942
+ * The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
18943
+ * motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
18944
+ * `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
18945
+ * buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
18946
+ * nothing else, so sizing a deletion means summing per kind.
18947
+ *
18948
+ * ## Why `unaccounted*` exists
18949
+ *
18950
+ * `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
18951
+ * writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
18952
+ * from a SEPARATE unfiltered aggregate over the same rows, never from adding
18953
+ * `kinds` up. A row whose stored `kind` is not in the enum (written by a
18954
+ * retired code path, or by a version that knew a kind this one does not) would
18955
+ * otherwise vanish from the total silently, and an operator would delete
18956
+ * against a denominator smaller than the disk.
18957
+ *
18958
+ * `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
18959
+ * zero; a non-zero value is a real finding and must be shown, not rounded away.
18960
+ */
18961
+ var EventMediaKindBreakdownSchema = object({
18962
+ /** Every media row in scope, from one unfiltered aggregate. */
18963
+ totalRows: number().int(),
18964
+ /** Every media byte in scope, from that same aggregate. */
18965
+ totalBytes: number().int(),
18966
+ /** Per-kind footprint, ordered by bytes descending. */
18967
+ kinds: array(EventMediaKindFootprintSchema).readonly(),
18968
+ /** `totalRows` minus the summed `kinds` rows — see the schema note. */
18969
+ unaccountedRows: number().int(),
18970
+ /** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
18971
+ unaccountedBytes: number().int()
18972
+ });
18886
18973
  /** Per-kind counts returned by the event-prune / device-delete mutations. */
18887
18974
  var EventPruneCountsSchema = object({
18888
18975
  motion: number().int(),
@@ -19086,6 +19173,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19086
19173
  }), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
19087
19174
  kind: "query",
19088
19175
  auth: "admin"
19176
+ }), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
19177
+ kind: "query",
19178
+ auth: "admin"
19089
19179
  }), method(object({
19090
19180
  olderThanMs: number(),
19091
19181
  reason: OpsLogReasonSchema.optional()
@@ -19225,6 +19315,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
19225
19315
  }), array(MediaFileSchema).readonly()), method(object({
19226
19316
  trackId: string(),
19227
19317
  deviceId: number()
19318
+ }), array(MediaFileInfoSchema).readonly()), method(object({
19319
+ eventId: string(),
19320
+ deviceId: number()
19228
19321
  }), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
19229
19322
  kind: "mutation",
19230
19323
  auth: "admin"
@@ -21034,6 +21127,20 @@ method(object({
21034
21127
  error: string().optional()
21035
21128
  }), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
21036
21129
  providerId: string(),
21130
+ /**
21131
+ * The location this config is an UNSAVED edit of, when there is one.
21132
+ *
21133
+ * `listLocations` replaces every declared secret with the redaction
21134
+ * sentinel, so the edit modal's form state holds the sentinel for any
21135
+ * credential the operator did not retype — and posting that here
21136
+ * without a way to resolve it makes the provider try to authenticate
21137
+ * as `__camstack_redacted__` and report the operator's own working
21138
+ * password as wrong. Given this id, the orchestrator restores each
21139
+ * sentinel from the stored config (same rule as `upsertLocation`)
21140
+ * before dispatching. Omitted by the "Add location" wizard, where
21141
+ * every value was typed just now and nothing is stored yet.
21142
+ */
21143
+ locationId: string().optional(),
21037
21144
  config: record(string(), unknown())
21038
21145
  }), object({
21039
21146
  ok: boolean(),
@@ -23520,10 +23627,24 @@ var FaceClusterSchema = object({
23520
23627
  size: number().int(),
23521
23628
  cohesion: number()
23522
23629
  });
23630
+ /**
23631
+ * One gallery media row: what the crop is, how big it is, and WHERE its bytes
23632
+ * are — never the bytes.
23633
+ *
23634
+ * `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
23635
+ * track/event contract) is still populated because a deployed viewer requires
23636
+ * the field to parse a row at all; this method has no such reader. Its ONE
23637
+ * caller is the admin UI's detail modal, which was building
23638
+ * `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
23639
+ * dialog already rendering its key FRAME from the `event-media` plane.
23640
+ *
23641
+ * `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
23642
+ * media key directly, so this needed no new plane and no new access decision.
23643
+ */
23523
23644
  var MediaFileLiteSchema$1 = object({
23524
23645
  key: string(),
23525
23646
  kind: string(),
23526
- base64: string(),
23647
+ url: string(),
23527
23648
  sizeBytes: number(),
23528
23649
  timestamp: number()
23529
23650
  });
@@ -25775,10 +25896,24 @@ var PlateInfoSchema = object({
25775
25896
  */
25776
25897
  cropUrl: string().optional()
25777
25898
  });
25899
+ /**
25900
+ * One gallery media row: what the crop is, how big it is, and WHERE its bytes
25901
+ * are — never the bytes.
25902
+ *
25903
+ * `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
25904
+ * track/event contract) is still populated because a deployed viewer requires
25905
+ * the field to parse a row at all; this method has no such reader. Its ONE
25906
+ * caller is the admin UI's detail modal, which was building
25907
+ * `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
25908
+ * dialog already rendering its key FRAME from the `event-media` plane.
25909
+ *
25910
+ * `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
25911
+ * media key directly, so this needed no new plane and no new access decision.
25912
+ */
25778
25913
  var MediaFileLiteSchema = object({
25779
25914
  key: string(),
25780
25915
  kind: string(),
25781
- base64: string(),
25916
+ url: string(),
25782
25917
  sizeBytes: number(),
25783
25918
  timestamp: number()
25784
25919
  });
@@ -31695,6 +31830,12 @@ Object.freeze({
31695
31830
  addonId: null,
31696
31831
  access: "view"
31697
31832
  },
31833
+ "pipelineAnalytics.getEventMediaFootprintByKind": {
31834
+ capName: "pipeline-analytics",
31835
+ capScope: "device",
31836
+ addonId: null,
31837
+ access: "view"
31838
+ },
31698
31839
  "pipelineAnalytics.getEventStoreFootprint": {
31699
31840
  capName: "pipeline-analytics",
31700
31841
  capScope: "device",
@@ -31791,6 +31932,12 @@ Object.freeze({
31791
31932
  addonId: null,
31792
31933
  access: "view"
31793
31934
  },
31935
+ "pipelineAnalytics.listEventMedia": {
31936
+ capName: "pipeline-analytics",
31937
+ capScope: "device",
31938
+ addonId: null,
31939
+ access: "view"
31940
+ },
31794
31941
  "pipelineAnalytics.listGroups": {
31795
31942
  capName: "pipeline-analytics",
31796
31943
  capScope: "device",
@@ -35354,6 +35501,11 @@ Object.freeze({
35354
35501
  form: "single",
35355
35502
  optional: false
35356
35503
  }],
35504
+ "pipelineAnalytics.getEventMediaFootprintByKind": [{
35505
+ name: "deviceId",
35506
+ form: "single",
35507
+ optional: true
35508
+ }],
35357
35509
  "pipelineAnalytics.getGroup": [{
35358
35510
  name: "deviceId",
35359
35511
  form: "single",
@@ -35414,6 +35566,11 @@ Object.freeze({
35414
35566
  form: "array",
35415
35567
  optional: false
35416
35568
  }],
35569
+ "pipelineAnalytics.listEventMedia": [{
35570
+ name: "deviceId",
35571
+ form: "single",
35572
+ optional: false
35573
+ }],
35417
35574
  "pipelineAnalytics.listGroups": [{
35418
35575
  name: "deviceIds",
35419
35576
  form: "array",
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  require("../chunk-Cek0wNdY.js");
6
- const require_dist = require("../dist-BVUxSu6R.js");
6
+ const require_dist = require("../dist-DmwiYjhM.js");
7
7
  //#region src/magic-link/auth-magic-link.addon.ts
8
8
  /**
9
9
  * Magic-link authentication addon.
@@ -1,4 +1,4 @@
1
- import { a as loginMethodCapability, c as BaseAddon, i as buildAddonRouteProvider, r as authProviderCapability, s as errMsg, t as addonRoutesCapability } from "../dist-Bw-A_piq.mjs";
1
+ import { a as loginMethodCapability, c as BaseAddon, i as buildAddonRouteProvider, r as authProviderCapability, s as errMsg, t as addonRoutesCapability } from "../dist-CLnjb1Qm.mjs";
2
2
  //#region src/magic-link/auth-magic-link.addon.ts
3
3
  /**
4
4
  * Magic-link authentication addon.
@@ -3,7 +3,7 @@ Object.defineProperties(exports, {
3
3
  [Symbol.toStringTag]: { value: "Module" }
4
4
  });
5
5
  const require_chunk = require("../chunk-Cek0wNdY.js");
6
- const require_dist = require("../dist-BVUxSu6R.js");
6
+ const require_dist = require("../dist-DmwiYjhM.js");
7
7
  let node_crypto = require("node:crypto");
8
8
  node_crypto = require_chunk.__toESM(node_crypto);
9
9
  //#region node_modules/jose/dist/webapi/lib/buffer_utils.js
@@ -1,4 +1,4 @@
1
- import { a as loginMethodCapability, c as BaseAddon, i as buildAddonRouteProvider, r as authProviderCapability, s as errMsg, t as addonRoutesCapability } from "../dist-Bw-A_piq.mjs";
1
+ import { a as loginMethodCapability, c as BaseAddon, i as buildAddonRouteProvider, r as authProviderCapability, s as errMsg, t as addonRoutesCapability } from "../dist-CLnjb1Qm.mjs";
2
2
  import * as crypto$1 from "node:crypto";
3
3
  //#region node_modules/jose/dist/webapi/lib/buffer_utils.js
4
4
  var encoder = new TextEncoder();
@@ -1,6 +1,6 @@
1
1
  import { n as e, r as t, t as n } from "./_virtual_mf___mfe_internal__addon_auth_webauthn_widgets__loadShare__react__loadShare__.js-BIIa6vDX.mjs";
2
2
  import { n as r, t as i } from "./_virtual_mf___mfe_internal__addon_auth_webauthn_widgets__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-CQ-aEQ9b.mjs";
3
- import { t as a } from "./_virtual_mf___mfe_internal__addon_auth_webauthn_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Cyq-cpgK.mjs";
3
+ import { t as a } from "./_virtual_mf___mfe_internal__addon_auth_webauthn_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DDtemWdR.mjs";
4
4
  import { n as o, r as s, t as c } from "./_virtual_mf___mfe_internal__addon_auth_webauthn_widgets__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-BL2etuqg.mjs";
5
5
  //#region ../../node_modules/lucide-react/dist/esm/shared/src/utils.js
6
6
  var l = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), u = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), d = (e) => {