@camstack/addon-pipeline-orchestrator 1.2.125 → 1.2.127

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -8879,6 +8879,21 @@ var RelocateJobSchema = object({
8879
8879
  bytesMoved: number().int(),
8880
8880
  /** Total files discovered up front; null while (or when) unknown. */
8881
8881
  filesTotal: number().int().nullable(),
8882
+ /**
8883
+ * Rows this run CORRECTED while moving them — a durable mutation the move
8884
+ * made that nobody asked for, so it is reported where the operator reads the
8885
+ * job rather than only in a log line.
8886
+ *
8887
+ * A footage segment records its byte count in its own NAME, and the durable
8888
+ * hour row derives its aggregates from those names. A file that does not
8889
+ * match its name therefore makes the ledger's sums — and with them quota and
8890
+ * pressure eviction — wrong by the difference, and only a rename can fix it.
8891
+ * On 2026-08-30 one such row also stalled a 110 749-file drain permanently.
8892
+ *
8893
+ * Absent on lanes where the question has no meaning: a media blob's size is
8894
+ * in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
8895
+ */
8896
+ rowsReconciled: number().int().nonnegative().optional(),
8882
8897
  startedAt: number(),
8883
8898
  finishedAt: number().nullable(),
8884
8899
  error: string().nullable()
@@ -8947,14 +8962,42 @@ var RelocateMediaInputSchema = object({
8947
8962
  /** Omitted = `move`, the pre-existing behaviour. */
8948
8963
  mode: MediaRelocateModeSchema.optional()
8949
8964
  });
8950
- /** How many rows still carry NO `locationId` — the population a repoint would
8951
- * silently re-aim at a disk that does not hold their bytes. Zero is the only
8952
- * value that permits a non-blocking `eventMedia` cutover. */
8953
- var UnstampedEventMediaCountSchema = object({
8954
- media: number().int().nonnegative(),
8955
- retrainFrames: number().int().nonnegative(),
8956
- total: number().int().nonnegative()
8965
+ /**
8966
+ * The unstamped population of ONE collection split, because the gate and the
8967
+ * operator ask two different questions and only one of them has to be cheap.
8968
+ *
8969
+ * `present` is the GATE: "is there at least one row that would be orphaned by a
8970
+ * repoint". It is a single indexed seek to the first matching row, so it stays
8971
+ * answerable on a saturated disk and answers in O(log n) precisely in the state
8972
+ * that matters — after a seal, when the population is empty.
8973
+ *
8974
+ * `rows` is the NUMBER, for the refusal message and the operator's sense of
8975
+ * scale. It is a second, indexed `COUNT(*)`, and `null` means **not
8976
+ * measurable** — never zero. `{ present: true, rows: null }` is a legitimate
8977
+ * and useful answer: "there are some, and this read could not say how many"
8978
+ * still refuses the cutover, which is the whole job.
8979
+ */
8980
+ var UnstampedRowsSchema = object({
8981
+ present: boolean(),
8982
+ rows: number().int().nonnegative().nullable()
8957
8983
  });
8984
+ /**
8985
+ * How many rows still carry NO `locationId` — the population a repoint would
8986
+ * silently re-aim at a disk that does not hold their bytes.
8987
+ *
8988
+ * **`null` = the count could not be taken**, and it is NOT permission to cut
8989
+ * over. The gate opens on a measured absence and on nothing else; an unread
8990
+ * collection and an empty one are different facts, and this repo has already
8991
+ * paid for conflating them (`RelocateResidueSchema`, D295).
8992
+ */
8993
+ var UnstampedEventMediaCountSchema = object({
8994
+ media: UnstampedRowsSchema,
8995
+ retrainFrames: UnstampedRowsSchema,
8996
+ /** True when EITHER collection holds one. The refusal reads this. */
8997
+ anyPresent: boolean(),
8998
+ /** Sum across both, or `null` when either lane could not be counted. */
8999
+ total: number().int().nonnegative().nullable()
9000
+ }).nullable();
8958
9001
  var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
8959
9002
  /** The independently selectable logical storage classes — every class
8960
9003
  * `storage.listLocationDeclarations` reports, so an operator never meets a
@@ -9065,6 +9108,10 @@ var StorageMigrationMoveProgressSchema = object({
9065
9108
  /** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
9066
9109
  filesTotal: number().int().nonnegative().nullable(),
9067
9110
  bytesMoved: number().int().nonnegative(),
9111
+ /** Rows the mover corrected while moving them — see `RelocateJob`. Absent on
9112
+ * a lane that cannot reconcile. A migration that silently rewrote durable
9113
+ * rows would be the same failure as one that silently skipped them. */
9114
+ rowsReconciled: number().int().nonnegative().optional(),
9068
9115
  /** The MOVER's start, not the migration's: a drain restarted after an addon
9069
9116
  * crash gets a new mover, and a rate computed from the migration's start
9070
9117
  * would silently average in the time nothing was running. */
@@ -13828,6 +13875,114 @@ method(object({
13828
13875
  height: number()
13829
13876
  }), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
13830
13877
  /**
13878
+ * `failure-contribution` — the capability an addon reports its OWN losses
13879
+ * through, per camera, with the denominator attached. It stores nothing.
13880
+ *
13881
+ * ## The twin of `load-contribution`, and why it is a twin and not a field
13882
+ *
13883
+ * `load-contribution` answers *what did this camera COST*. This answers *what
13884
+ * did this camera LOSE*. The reporting discipline is identical and deliberately
13885
+ * copied: the contributor reports what it already knows, hub-main adds only
13886
+ * `addonId`, nothing needs global knowledge, and there is no central list for
13887
+ * somebody to forget to edit.
13888
+ *
13889
+ * They are not merged, because their invariants are opposites:
13890
+ *
13891
+ * - a `load-contribution` measurement is **absent, never zero** — a zero would
13892
+ * claim a camera cost nothing, which is a measurement nobody made;
13893
+ * - a `failure-contribution` zero is the **most valuable value on the
13894
+ * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
13895
+ * and it is exactly what an absent entry cannot say.
13896
+ *
13897
+ * Putting a loss counter on a cost entry would also break the reconciliation
13898
+ * that gives `load-contribution` its point: contributions are subtracted from
13899
+ * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
13900
+ * has no process.
13901
+ *
13902
+ * ## Why not a log line, since the counters already exist
13903
+ *
13904
+ * Several of these paths already counted themselves — `CaptureScheduler`'s
13905
+ * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
13906
+ * ends in a log line, and a log line is the thing the operator asked to stop
13907
+ * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
13908
+ * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
13909
+ * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
13910
+ * media blackout were both diagnosed. The counters stay; this is where they can
13911
+ * be READ.
13912
+ *
13913
+ * ## The rate is served with its denominator or not at all
13914
+ *
13915
+ * Every entry carries `attempts` and `succeeded`. A miss count alone is
13916
+ * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
13917
+ * than yesterday" and was **flat across twelve hours** once divided by the
13918
+ * successes on the same path. A surface that publishes only the numerator
13919
+ * reproduces that mistake on every read.
13920
+ *
13921
+ * ## Shape
13922
+ *
13923
+ * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
13924
+ * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
13925
+ * generated hooks, while `addons.listCapabilityProviders` still enumerates it
13926
+ * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
13927
+ * a forked runner's entries reach hub-main over transport that already exists.
13928
+ * No new UDS message, no second registry (D3). The operator reads the assembled
13929
+ * result through `system.getFailureContributions`.
13930
+ */
13931
+ var FailureReasonCountSchema = object({
13932
+ /**
13933
+ * Why the attempt did not land, in the contributor's own vocabulary —
13934
+ * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
13935
+ * strings that already appear in this repo's logs and, where one exists, the
13936
+ * same string the per-track `previewMissReason` records (D276): a second
13937
+ * vocabulary for the same loss would make the row and the counter
13938
+ * un-joinable.
13939
+ */
13940
+ reason: string(),
13941
+ count: number().int().nonnegative()
13942
+ });
13943
+ var FailureContributionSchema = object({
13944
+ /**
13945
+ * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
13946
+ * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
13947
+ * `unit` free: the families are owned by different addons and a shared enum
13948
+ * is a central list that rots invisibly.
13949
+ */
13950
+ family: string(),
13951
+ /**
13952
+ * The NUMERIC device id — the same value every log line carries as
13953
+ * `tags.deviceId`. Never nullable and never absent: a contributor that
13954
+ * cannot name the camera must not emit the entry, because a fleet total
13955
+ * cannot answer the only question anybody asks of this surface.
13956
+ */
13957
+ deviceId: number().int().positive(),
13958
+ /**
13959
+ * A second dimension inside the family: the model / step id for an inference
13960
+ * timeout, so "which camera AND which model" is one read. Absent when the
13961
+ * family has a single variant.
13962
+ */
13963
+ variant: string().optional(),
13964
+ /**
13965
+ * Epoch ms this counter started — the INCARNATION MARKER. A consumer
13966
+ * differencing two reads must drop the interval when it changes, because the
13967
+ * counter restarted from zero in a respawned runner. Same discipline as
13968
+ * `LoadContribution.startedAtMs`.
13969
+ */
13970
+ sinceMs: number(),
13971
+ /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
13972
+ atMs: number(),
13973
+ /**
13974
+ * THE DENOMINATOR — every attempt on this path for this camera in the
13975
+ * window. A failure count published without it is the mistake this schema
13976
+ * exists to make impossible.
13977
+ */
13978
+ attempts: number().int().nonnegative(),
13979
+ /** Attempts that landed. `attempts - succeeded` is the loss. */
13980
+ succeeded: number().int().nonnegative(),
13981
+ /** The loss, partitioned. Sums to `attempts - succeeded`. */
13982
+ reasons: array(FailureReasonCountSchema).readonly()
13983
+ });
13984
+ method(_void(), array(FailureContributionSchema).readonly());
13985
+ /**
13831
13986
  * filesystem-browse — per-node capability for browsing the node's local
13832
13987
  * filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
13833
13988
  * are sandboxed to operator-configured allowed roots (D115). Used by the
@@ -14349,6 +14504,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
14349
14504
  kind: "mutation",
14350
14505
  auth: "admin"
14351
14506
  });
14507
+ var LoadContributionSchema = object({
14508
+ role: _enum([
14509
+ "decode",
14510
+ "transcode",
14511
+ "recording",
14512
+ "streaming",
14513
+ "detection"
14514
+ ]),
14515
+ /**
14516
+ * The NUMERIC device id — the same value every log line carries as
14517
+ * `tags.deviceId`. `null` means this cost genuinely belongs to no single
14518
+ * camera (a shared pool), NOT that the contributor forgot to look it up: a
14519
+ * contributor that cannot name its camera must not emit the entry at all,
14520
+ * because an unnamed per-camera entry is indistinguishable from a shared one
14521
+ * and would quietly turn one camera's cost into everybody's.
14522
+ */
14523
+ deviceId: number().int().positive().nullable(),
14524
+ attribution: _enum([
14525
+ "measured",
14526
+ "accounted",
14527
+ "unattributable"
14528
+ ]),
14529
+ /**
14530
+ * What ONE entry is, in the contributor's own words — `615/high`,
14531
+ * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
14532
+ * family and inventing a common one would lose the only information that
14533
+ * makes two entries for the same camera distinguishable.
14534
+ */
14535
+ unit: string(),
14536
+ /**
14537
+ * The OS process this cost lives in, when there is one. Present so a
14538
+ * consumer can (a) tell two generations of the same unit apart across a
14539
+ * restart, and (b) subtract claimed processes from the node's process
14540
+ * snapshot to see what NOBODY claimed. Absent for an entry that owns no
14541
+ * process of its own.
14542
+ */
14543
+ pid: number().int().positive().optional(),
14544
+ /**
14545
+ * When this generation started. The pid's incarnation marker: a consumer
14546
+ * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
14547
+ * window when this changes, because the counter restarted from zero in a new
14548
+ * process.
14549
+ */
14550
+ startedAtMs: number().optional(),
14551
+ /**
14552
+ * CUMULATIVE CPU seconds this unit has consumed since it started — user +
14553
+ * system, read from the child's own `/proc/<pid>/stat` at the moment the
14554
+ * contribution is asked for.
14555
+ *
14556
+ * Cumulative and not a rate on purpose: a rate needs a window, a window
14557
+ * needs a sampler, and a new per-node sampler is the defect half of
14558
+ * `docs/architecture/load-ledger.md` documents. A counter can be differenced
14559
+ * by whoever already keeps a history; a rate cannot be un-averaged.
14560
+ *
14561
+ * Absent — never zero — on a node with no `/proc`, on a read failure, and on
14562
+ * an entry with no process.
14563
+ */
14564
+ cpuSeconds: number().optional(),
14565
+ /** Resident bytes of this unit's process, same source and same rules. */
14566
+ rssBytes: number().optional()
14567
+ });
14568
+ method(_void(), array(LoadContributionSchema).readonly());
14352
14569
  /**
14353
14570
  * `log-channels` — the capability an addon DECLARES its diagnostic channels
14354
14571
  * through. It stores nothing.
@@ -14425,176 +14642,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
14425
14642
  tags: record(string(), string()).optional()
14426
14643
  }), array(LogEntrySchema).readonly());
14427
14644
  /**
14428
- * `failure-contribution` — the capability an addon reports its OWN losses
14429
- * through, per camera, with the denominator attached. It stores nothing.
14430
- *
14431
- * ## The twin of `load-contribution`, and why it is a twin and not a field
14432
- *
14433
- * `load-contribution` answers *what did this camera COST*. This answers *what
14434
- * did this camera LOSE*. The reporting discipline is identical and deliberately
14435
- * copied: the contributor reports what it already knows, hub-main adds only
14436
- * `addonId`, nothing needs global knowledge, and there is no central list for
14437
- * somebody to forget to edit.
14438
- *
14439
- * They are not merged, because their invariants are opposites:
14440
- *
14441
- * - a `load-contribution` measurement is **absent, never zero** — a zero would
14442
- * claim a camera cost nothing, which is a measurement nobody made;
14443
- * - a `failure-contribution` zero is the **most valuable value on the
14444
- * surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
14445
- * and it is exactly what an absent entry cannot say.
14446
- *
14447
- * Putting a loss counter on a cost entry would also break the reconciliation
14448
- * that gives `load-contribution` its point: contributions are subtracted from
14449
- * `metrics.node-processes-snapshot` to find processes nobody claims. A failure
14450
- * has no process.
14451
- *
14452
- * ## Why not a log line, since the counters already exist
14453
- *
14454
- * Several of these paths already counted themselves — `CaptureScheduler`'s
14455
- * per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
14456
- * ends in a log line, and a log line is the thing the operator asked to stop
14457
- * needing: *"possiamo armare questi errori intanto? Così al prossimo giro
14458
- * ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
14459
- * hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
14460
- * media blackout were both diagnosed. The counters stay; this is where they can
14461
- * be READ.
14462
- *
14463
- * ## The rate is served with its denominator or not at all
14464
- *
14465
- * Every entry carries `attempts` and `succeeded`. A miss count alone is
14466
- * unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
14467
- * than yesterday" and was **flat across twelve hours** once divided by the
14468
- * successes on the same path. A surface that publishes only the numerator
14469
- * reproduces that mistake on every read.
14470
- *
14471
- * ## Shape
14472
- *
14473
- * Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
14474
- * `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
14475
- * generated hooks, while `addons.listCapabilityProviders` still enumerates it
14476
- * and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
14477
- * a forked runner's entries reach hub-main over transport that already exists.
14478
- * No new UDS message, no second registry (D3). The operator reads the assembled
14479
- * result through `system.getFailureContributions`.
14480
- */
14481
- var FailureReasonCountSchema = object({
14482
- /**
14483
- * Why the attempt did not land, in the contributor's own vocabulary —
14484
- * `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
14485
- * strings that already appear in this repo's logs and, where one exists, the
14486
- * same string the per-track `previewMissReason` records (D276): a second
14487
- * vocabulary for the same loss would make the row and the counter
14488
- * un-joinable.
14489
- */
14490
- reason: string(),
14491
- count: number().int().nonnegative()
14492
- });
14493
- var FailureContributionSchema = object({
14494
- /**
14495
- * The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
14496
- * `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
14497
- * `unit` free: the families are owned by different addons and a shared enum
14498
- * is a central list that rots invisibly.
14499
- */
14500
- family: string(),
14501
- /**
14502
- * The NUMERIC device id — the same value every log line carries as
14503
- * `tags.deviceId`. Never nullable and never absent: a contributor that
14504
- * cannot name the camera must not emit the entry, because a fleet total
14505
- * cannot answer the only question anybody asks of this surface.
14506
- */
14507
- deviceId: number().int().positive(),
14508
- /**
14509
- * A second dimension inside the family: the model / step id for an inference
14510
- * timeout, so "which camera AND which model" is one read. Absent when the
14511
- * family has a single variant.
14512
- */
14513
- variant: string().optional(),
14514
- /**
14515
- * Epoch ms this counter started — the INCARNATION MARKER. A consumer
14516
- * differencing two reads must drop the interval when it changes, because the
14517
- * counter restarted from zero in a respawned runner. Same discipline as
14518
- * `LoadContribution.startedAtMs`.
14519
- */
14520
- sinceMs: number(),
14521
- /** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
14522
- atMs: number(),
14523
- /**
14524
- * THE DENOMINATOR — every attempt on this path for this camera in the
14525
- * window. A failure count published without it is the mistake this schema
14526
- * exists to make impossible.
14527
- */
14528
- attempts: number().int().nonnegative(),
14529
- /** Attempts that landed. `attempts - succeeded` is the loss. */
14530
- succeeded: number().int().nonnegative(),
14531
- /** The loss, partitioned. Sums to `attempts - succeeded`. */
14532
- reasons: array(FailureReasonCountSchema).readonly()
14533
- });
14534
- method(_void(), array(FailureContributionSchema).readonly());
14535
- var LoadContributionSchema = object({
14536
- role: _enum([
14537
- "decode",
14538
- "transcode",
14539
- "recording",
14540
- "streaming",
14541
- "detection"
14542
- ]),
14543
- /**
14544
- * The NUMERIC device id — the same value every log line carries as
14545
- * `tags.deviceId`. `null` means this cost genuinely belongs to no single
14546
- * camera (a shared pool), NOT that the contributor forgot to look it up: a
14547
- * contributor that cannot name its camera must not emit the entry at all,
14548
- * because an unnamed per-camera entry is indistinguishable from a shared one
14549
- * and would quietly turn one camera's cost into everybody's.
14550
- */
14551
- deviceId: number().int().positive().nullable(),
14552
- attribution: _enum([
14553
- "measured",
14554
- "accounted",
14555
- "unattributable"
14556
- ]),
14557
- /**
14558
- * What ONE entry is, in the contributor's own words — `615/high`,
14559
- * `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
14560
- * family and inventing a common one would lose the only information that
14561
- * makes two entries for the same camera distinguishable.
14562
- */
14563
- unit: string(),
14564
- /**
14565
- * The OS process this cost lives in, when there is one. Present so a
14566
- * consumer can (a) tell two generations of the same unit apart across a
14567
- * restart, and (b) subtract claimed processes from the node's process
14568
- * snapshot to see what NOBODY claimed. Absent for an entry that owns no
14569
- * process of its own.
14570
- */
14571
- pid: number().int().positive().optional(),
14572
- /**
14573
- * When this generation started. The pid's incarnation marker: a consumer
14574
- * differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
14575
- * window when this changes, because the counter restarted from zero in a new
14576
- * process.
14577
- */
14578
- startedAtMs: number().optional(),
14579
- /**
14580
- * CUMULATIVE CPU seconds this unit has consumed since it started — user +
14581
- * system, read from the child's own `/proc/<pid>/stat` at the moment the
14582
- * contribution is asked for.
14583
- *
14584
- * Cumulative and not a rate on purpose: a rate needs a window, a window
14585
- * needs a sampler, and a new per-node sampler is the defect half of
14586
- * `docs/architecture/load-ledger.md` documents. A counter can be differenced
14587
- * by whoever already keeps a history; a rate cannot be un-averaged.
14588
- *
14589
- * Absent — never zero — on a node with no `/proc`, on a read failure, and on
14590
- * an entry with no process.
14591
- */
14592
- cpuSeconds: number().optional(),
14593
- /** Resident bytes of this unit's process, same source and same rules. */
14594
- rssBytes: number().optional()
14595
- });
14596
- method(_void(), array(LoadContributionSchema).readonly());
14597
- /**
14598
14645
  * `login-method` — collection cap through which auth addons contribute
14599
14646
  * their pre-auth login surfaces to the login page. This is the SINGLE,
14600
14647
  * generic mechanism that supersedes the dead `auth.listProviders` reader:
@@ -19478,12 +19525,53 @@ var MediaFileKindEnum = _enum([
19478
19525
  "keyFrameSmall",
19479
19526
  "thumbnailSmall"
19480
19527
  ]);
19528
+ /**
19529
+ * One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
19530
+ * ARE — never the bytes themselves.
19531
+ *
19532
+ * ## Why `url` and not `base64`
19533
+ *
19534
+ * Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
19535
+ * with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
19536
+ * was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
19537
+ * wire. Forty events is ~144 MB. Every byte of it was read off disk,
19538
+ * base64-encoded, held whole in a unary tRPC envelope, and materialised in
19539
+ * hub-main's heap on the way past — for an `<img>` that would have cached it.
19540
+ *
19541
+ * `url` points at the `event-media` data plane
19542
+ * (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
19543
+ * with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
19544
+ * render a `?variant=thumb`, and streams. The hub gate in front of it requires
19545
+ * a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
19546
+ * no less protected than they were inside a `view`-level cap response — see
19547
+ * `data-plane-access.ts` for the rule and the one gap it does not close
19548
+ * (per-device scoping).
19549
+ *
19550
+ * The URL is built from the row's **stored** key, which is not always its
19551
+ * published `kind`: a track's face/plate crop is stored as `crop` under
19552
+ * `('face'|'plate', '<prefix>-<trackId>')` and published as
19553
+ * `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
19554
+ *
19555
+ * ## `base64` is TRANSITIONAL and is going away
19556
+ *
19557
+ * It is still populated for one reason: the deployed viewer's track-detail
19558
+ * HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
19559
+ * REQUIRES the field), and a row without it parses as a FAILED read — the red
19560
+ * triangle — not as absence. Removing the field before that viewer ships is an
19561
+ * outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
19562
+ * delete this line and the `withBytes` pass-through in
19563
+ * `analytics-query-facade.ts`; nothing else reads it.
19564
+ */
19481
19565
  var MediaFileSchema = object({
19482
19566
  key: string(),
19483
19567
  kind: MediaFileKindEnum,
19484
- base64: string(),
19485
19568
  sizeBytes: number(),
19486
19569
  timestamp: number()
19570
+ }).extend({
19571
+ /** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
19572
+ url: string(),
19573
+ /** @deprecated Transitional — see the schema docblock. Use {@link url}. */
19574
+ base64: string()
19487
19575
  });
19488
19576
  /**
19489
19577
  * One media row WITHOUT its bytes.
@@ -19495,7 +19583,9 @@ var MediaFileSchema = object({
19495
19583
  * blocks the whole view.
19496
19584
  *
19497
19585
  * `sizeBytes` is carried because it is what lets a client decide between the
19498
- * stored blob and a `?variant=thumb` rendering without fetching either.
19586
+ * stored blob and a `?variant=thumb` rendering without fetching either, and
19587
+ * `url` because a client that had to build the plane path itself is a second
19588
+ * copy of a route — the embed, the viewer and the admin UI each grew one.
19499
19589
  */
19500
19590
  var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
19501
19591
  /**
@@ -20184,6 +20274,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
20184
20274
  }), array(MediaFileSchema).readonly()), method(object({
20185
20275
  trackId: string(),
20186
20276
  deviceId: number()
20277
+ }), array(MediaFileInfoSchema).readonly()), method(object({
20278
+ eventId: string(),
20279
+ deviceId: number()
20187
20280
  }), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
20188
20281
  kind: "mutation",
20189
20282
  auth: "admin"
@@ -24925,10 +25018,24 @@ var FaceClusterSchema = object({
24925
25018
  size: number().int(),
24926
25019
  cohesion: number()
24927
25020
  });
25021
+ /**
25022
+ * One gallery media row: what the crop is, how big it is, and WHERE its bytes
25023
+ * are — never the bytes.
25024
+ *
25025
+ * `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
25026
+ * track/event contract) is still populated because a deployed viewer requires
25027
+ * the field to parse a row at all; this method has no such reader. Its ONE
25028
+ * caller is the admin UI's detail modal, which was building
25029
+ * `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
25030
+ * dialog already rendering its key FRAME from the `event-media` plane.
25031
+ *
25032
+ * `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
25033
+ * media key directly, so this needed no new plane and no new access decision.
25034
+ */
24928
25035
  var MediaFileLiteSchema$1 = object({
24929
25036
  key: string(),
24930
25037
  kind: string(),
24931
- base64: string(),
25038
+ url: string(),
24932
25039
  sizeBytes: number(),
24933
25040
  timestamp: number()
24934
25041
  });
@@ -27180,10 +27287,24 @@ var PlateInfoSchema = object({
27180
27287
  */
27181
27288
  cropUrl: string().optional()
27182
27289
  });
27290
+ /**
27291
+ * One gallery media row: what the crop is, how big it is, and WHERE its bytes
27292
+ * are — never the bytes.
27293
+ *
27294
+ * `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
27295
+ * track/event contract) is still populated because a deployed viewer requires
27296
+ * the field to parse a row at all; this method has no such reader. Its ONE
27297
+ * caller is the admin UI's detail modal, which was building
27298
+ * `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
27299
+ * dialog already rendering its key FRAME from the `event-media` plane.
27300
+ *
27301
+ * `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
27302
+ * media key directly, so this needed no new plane and no new access decision.
27303
+ */
27183
27304
  var MediaFileLiteSchema = object({
27184
27305
  key: string(),
27185
27306
  kind: string(),
27186
- base64: string(),
27307
+ url: string(),
27187
27308
  sizeBytes: number(),
27188
27309
  timestamp: number()
27189
27310
  });
@@ -33280,6 +33401,12 @@ Object.freeze({
33280
33401
  addonId: null,
33281
33402
  access: "view"
33282
33403
  },
33404
+ "pipelineAnalytics.listEventMedia": {
33405
+ capName: "pipeline-analytics",
33406
+ capScope: "device",
33407
+ addonId: null,
33408
+ access: "view"
33409
+ },
33283
33410
  "pipelineAnalytics.listGroups": {
33284
33411
  capName: "pipeline-analytics",
33285
33412
  capScope: "device",
@@ -36903,6 +37030,11 @@ Object.freeze({
36903
37030
  form: "array",
36904
37031
  optional: false
36905
37032
  }],
37033
+ "pipelineAnalytics.listEventMedia": [{
37034
+ name: "deviceId",
37035
+ form: "single",
37036
+ optional: false
37037
+ }],
36906
37038
  "pipelineAnalytics.listGroups": [{
36907
37039
  name: "deviceIds",
36908
37040
  form: "array",