@camstack/addon-mqtt-broker 1.2.46 → 1.2.48
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/mqtt-broker.addon.js +331 -174
- package/dist/mqtt-broker.addon.mjs +331 -174
- package/package.json +1 -1
|
@@ -12998,6 +12998,114 @@ method(object({
|
|
|
12998
12998
|
height: number()
|
|
12999
12999
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
13000
13000
|
/**
|
|
13001
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13002
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
13003
|
+
*
|
|
13004
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13005
|
+
*
|
|
13006
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13007
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13008
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13009
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13010
|
+
* somebody to forget to edit.
|
|
13011
|
+
*
|
|
13012
|
+
* They are not merged, because their invariants are opposites:
|
|
13013
|
+
*
|
|
13014
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13015
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13016
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13017
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13018
|
+
* and it is exactly what an absent entry cannot say.
|
|
13019
|
+
*
|
|
13020
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13021
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13022
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13023
|
+
* has no process.
|
|
13024
|
+
*
|
|
13025
|
+
* ## Why not a log line, since the counters already exist
|
|
13026
|
+
*
|
|
13027
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13028
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13029
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13030
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13031
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13032
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13033
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13034
|
+
* be READ.
|
|
13035
|
+
*
|
|
13036
|
+
* ## The rate is served with its denominator or not at all
|
|
13037
|
+
*
|
|
13038
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13039
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13040
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13041
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
13042
|
+
* reproduces that mistake on every read.
|
|
13043
|
+
*
|
|
13044
|
+
* ## Shape
|
|
13045
|
+
*
|
|
13046
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13047
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13048
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13049
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13050
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13051
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13052
|
+
* result through `system.getFailureContributions`.
|
|
13053
|
+
*/
|
|
13054
|
+
var FailureReasonCountSchema = object({
|
|
13055
|
+
/**
|
|
13056
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13057
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13058
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
13059
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
13060
|
+
* vocabulary for the same loss would make the row and the counter
|
|
13061
|
+
* un-joinable.
|
|
13062
|
+
*/
|
|
13063
|
+
reason: string(),
|
|
13064
|
+
count: number().int().nonnegative()
|
|
13065
|
+
});
|
|
13066
|
+
var FailureContributionSchema = object({
|
|
13067
|
+
/**
|
|
13068
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13069
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13070
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
13071
|
+
* is a central list that rots invisibly.
|
|
13072
|
+
*/
|
|
13073
|
+
family: string(),
|
|
13074
|
+
/**
|
|
13075
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13076
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13077
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
13078
|
+
* cannot answer the only question anybody asks of this surface.
|
|
13079
|
+
*/
|
|
13080
|
+
deviceId: number().int().positive(),
|
|
13081
|
+
/**
|
|
13082
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
13083
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13084
|
+
* family has a single variant.
|
|
13085
|
+
*/
|
|
13086
|
+
variant: string().optional(),
|
|
13087
|
+
/**
|
|
13088
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13089
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
13090
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13091
|
+
* `LoadContribution.startedAtMs`.
|
|
13092
|
+
*/
|
|
13093
|
+
sinceMs: number(),
|
|
13094
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13095
|
+
atMs: number(),
|
|
13096
|
+
/**
|
|
13097
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13098
|
+
* window. A failure count published without it is the mistake this schema
|
|
13099
|
+
* exists to make impossible.
|
|
13100
|
+
*/
|
|
13101
|
+
attempts: number().int().nonnegative(),
|
|
13102
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13103
|
+
succeeded: number().int().nonnegative(),
|
|
13104
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13105
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
13106
|
+
});
|
|
13107
|
+
method(_void(), array(FailureContributionSchema).readonly());
|
|
13108
|
+
/**
|
|
13001
13109
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
13002
13110
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
13003
13111
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -13519,6 +13627,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13519
13627
|
kind: "mutation",
|
|
13520
13628
|
auth: "admin"
|
|
13521
13629
|
});
|
|
13630
|
+
var LoadContributionSchema = object({
|
|
13631
|
+
role: _enum([
|
|
13632
|
+
"decode",
|
|
13633
|
+
"transcode",
|
|
13634
|
+
"recording",
|
|
13635
|
+
"streaming",
|
|
13636
|
+
"detection"
|
|
13637
|
+
]),
|
|
13638
|
+
/**
|
|
13639
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13640
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13641
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13642
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
13643
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13644
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
13645
|
+
*/
|
|
13646
|
+
deviceId: number().int().positive().nullable(),
|
|
13647
|
+
attribution: _enum([
|
|
13648
|
+
"measured",
|
|
13649
|
+
"accounted",
|
|
13650
|
+
"unattributable"
|
|
13651
|
+
]),
|
|
13652
|
+
/**
|
|
13653
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13654
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13655
|
+
* family and inventing a common one would lose the only information that
|
|
13656
|
+
* makes two entries for the same camera distinguishable.
|
|
13657
|
+
*/
|
|
13658
|
+
unit: string(),
|
|
13659
|
+
/**
|
|
13660
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
13661
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
13662
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
13663
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13664
|
+
* process of its own.
|
|
13665
|
+
*/
|
|
13666
|
+
pid: number().int().positive().optional(),
|
|
13667
|
+
/**
|
|
13668
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
13669
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13670
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
13671
|
+
* process.
|
|
13672
|
+
*/
|
|
13673
|
+
startedAtMs: number().optional(),
|
|
13674
|
+
/**
|
|
13675
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13676
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13677
|
+
* contribution is asked for.
|
|
13678
|
+
*
|
|
13679
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13680
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13681
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13682
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13683
|
+
*
|
|
13684
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13685
|
+
* an entry with no process.
|
|
13686
|
+
*/
|
|
13687
|
+
cpuSeconds: number().optional(),
|
|
13688
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13689
|
+
rssBytes: number().optional()
|
|
13690
|
+
});
|
|
13691
|
+
method(_void(), array(LoadContributionSchema).readonly());
|
|
13522
13692
|
/**
|
|
13523
13693
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13524
13694
|
* through. It stores nothing.
|
|
@@ -13595,176 +13765,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
13595
13765
|
tags: record(string(), string()).optional()
|
|
13596
13766
|
}), array(LogEntrySchema).readonly());
|
|
13597
13767
|
/**
|
|
13598
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13599
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
13600
|
-
*
|
|
13601
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13602
|
-
*
|
|
13603
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13604
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13605
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13606
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13607
|
-
* somebody to forget to edit.
|
|
13608
|
-
*
|
|
13609
|
-
* They are not merged, because their invariants are opposites:
|
|
13610
|
-
*
|
|
13611
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13612
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13613
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13614
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13615
|
-
* and it is exactly what an absent entry cannot say.
|
|
13616
|
-
*
|
|
13617
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13618
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13619
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13620
|
-
* has no process.
|
|
13621
|
-
*
|
|
13622
|
-
* ## Why not a log line, since the counters already exist
|
|
13623
|
-
*
|
|
13624
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13625
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13626
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13627
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13628
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13629
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13630
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13631
|
-
* be READ.
|
|
13632
|
-
*
|
|
13633
|
-
* ## The rate is served with its denominator or not at all
|
|
13634
|
-
*
|
|
13635
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13636
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13637
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13638
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
13639
|
-
* reproduces that mistake on every read.
|
|
13640
|
-
*
|
|
13641
|
-
* ## Shape
|
|
13642
|
-
*
|
|
13643
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13644
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13645
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13646
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13647
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13648
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13649
|
-
* result through `system.getFailureContributions`.
|
|
13650
|
-
*/
|
|
13651
|
-
var FailureReasonCountSchema = object({
|
|
13652
|
-
/**
|
|
13653
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13654
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13655
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
13656
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
13657
|
-
* vocabulary for the same loss would make the row and the counter
|
|
13658
|
-
* un-joinable.
|
|
13659
|
-
*/
|
|
13660
|
-
reason: string(),
|
|
13661
|
-
count: number().int().nonnegative()
|
|
13662
|
-
});
|
|
13663
|
-
var FailureContributionSchema = object({
|
|
13664
|
-
/**
|
|
13665
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13666
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13667
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
13668
|
-
* is a central list that rots invisibly.
|
|
13669
|
-
*/
|
|
13670
|
-
family: string(),
|
|
13671
|
-
/**
|
|
13672
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13673
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13674
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
13675
|
-
* cannot answer the only question anybody asks of this surface.
|
|
13676
|
-
*/
|
|
13677
|
-
deviceId: number().int().positive(),
|
|
13678
|
-
/**
|
|
13679
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
13680
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13681
|
-
* family has a single variant.
|
|
13682
|
-
*/
|
|
13683
|
-
variant: string().optional(),
|
|
13684
|
-
/**
|
|
13685
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13686
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
13687
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13688
|
-
* `LoadContribution.startedAtMs`.
|
|
13689
|
-
*/
|
|
13690
|
-
sinceMs: number(),
|
|
13691
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13692
|
-
atMs: number(),
|
|
13693
|
-
/**
|
|
13694
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13695
|
-
* window. A failure count published without it is the mistake this schema
|
|
13696
|
-
* exists to make impossible.
|
|
13697
|
-
*/
|
|
13698
|
-
attempts: number().int().nonnegative(),
|
|
13699
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13700
|
-
succeeded: number().int().nonnegative(),
|
|
13701
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13702
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
13703
|
-
});
|
|
13704
|
-
method(_void(), array(FailureContributionSchema).readonly());
|
|
13705
|
-
var LoadContributionSchema = object({
|
|
13706
|
-
role: _enum([
|
|
13707
|
-
"decode",
|
|
13708
|
-
"transcode",
|
|
13709
|
-
"recording",
|
|
13710
|
-
"streaming",
|
|
13711
|
-
"detection"
|
|
13712
|
-
]),
|
|
13713
|
-
/**
|
|
13714
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13715
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13716
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13717
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
13718
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13719
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
13720
|
-
*/
|
|
13721
|
-
deviceId: number().int().positive().nullable(),
|
|
13722
|
-
attribution: _enum([
|
|
13723
|
-
"measured",
|
|
13724
|
-
"accounted",
|
|
13725
|
-
"unattributable"
|
|
13726
|
-
]),
|
|
13727
|
-
/**
|
|
13728
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13729
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13730
|
-
* family and inventing a common one would lose the only information that
|
|
13731
|
-
* makes two entries for the same camera distinguishable.
|
|
13732
|
-
*/
|
|
13733
|
-
unit: string(),
|
|
13734
|
-
/**
|
|
13735
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
13736
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
13737
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
13738
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13739
|
-
* process of its own.
|
|
13740
|
-
*/
|
|
13741
|
-
pid: number().int().positive().optional(),
|
|
13742
|
-
/**
|
|
13743
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
13744
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13745
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
13746
|
-
* process.
|
|
13747
|
-
*/
|
|
13748
|
-
startedAtMs: number().optional(),
|
|
13749
|
-
/**
|
|
13750
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13751
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13752
|
-
* contribution is asked for.
|
|
13753
|
-
*
|
|
13754
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13755
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13756
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13757
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13758
|
-
*
|
|
13759
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13760
|
-
* an entry with no process.
|
|
13761
|
-
*/
|
|
13762
|
-
cpuSeconds: number().optional(),
|
|
13763
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13764
|
-
rssBytes: number().optional()
|
|
13765
|
-
});
|
|
13766
|
-
method(_void(), array(LoadContributionSchema).readonly());
|
|
13767
|
-
/**
|
|
13768
13768
|
* `login-method` — collection cap through which auth addons contribute
|
|
13769
13769
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
13770
13770
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -18443,12 +18443,53 @@ var MediaFileKindEnum = _enum([
|
|
|
18443
18443
|
"keyFrameSmall",
|
|
18444
18444
|
"thumbnailSmall"
|
|
18445
18445
|
]);
|
|
18446
|
+
/**
|
|
18447
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
18448
|
+
* ARE — never the bytes themselves.
|
|
18449
|
+
*
|
|
18450
|
+
* ## Why `url` and not `base64`
|
|
18451
|
+
*
|
|
18452
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
18453
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
18454
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
18455
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
18456
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
18457
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
18458
|
+
*
|
|
18459
|
+
* `url` points at the `event-media` data plane
|
|
18460
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
18461
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
18462
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
18463
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
18464
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
18465
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
18466
|
+
* (per-device scoping).
|
|
18467
|
+
*
|
|
18468
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
18469
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
18470
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
18471
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
18472
|
+
*
|
|
18473
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
18474
|
+
*
|
|
18475
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
18476
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
18477
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
18478
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
18479
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
18480
|
+
* delete this line and the `withBytes` pass-through in
|
|
18481
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
18482
|
+
*/
|
|
18446
18483
|
var MediaFileSchema = object({
|
|
18447
18484
|
key: string(),
|
|
18448
18485
|
kind: MediaFileKindEnum,
|
|
18449
|
-
base64: string(),
|
|
18450
18486
|
sizeBytes: number(),
|
|
18451
18487
|
timestamp: number()
|
|
18488
|
+
}).extend({
|
|
18489
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
18490
|
+
url: string(),
|
|
18491
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
18492
|
+
base64: string()
|
|
18452
18493
|
});
|
|
18453
18494
|
/**
|
|
18454
18495
|
* One media row WITHOUT its bytes.
|
|
@@ -18460,7 +18501,9 @@ var MediaFileSchema = object({
|
|
|
18460
18501
|
* blocks the whole view.
|
|
18461
18502
|
*
|
|
18462
18503
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
18463
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
18504
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
18505
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
18506
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
18464
18507
|
*/
|
|
18465
18508
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
18466
18509
|
/**
|
|
@@ -18807,6 +18850,50 @@ var EventStoreFootprintSchema = object({
|
|
|
18807
18850
|
totalBytes: number().int(),
|
|
18808
18851
|
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
18809
18852
|
});
|
|
18853
|
+
/** Event-media footprint for one {@link MediaFileKind}. */
|
|
18854
|
+
var EventMediaKindFootprintSchema = object({
|
|
18855
|
+
kind: MediaFileKindEnum,
|
|
18856
|
+
/** Media rows of this kind. */
|
|
18857
|
+
rows: number().int(),
|
|
18858
|
+
/** Bytes on disk held by those rows. */
|
|
18859
|
+
bytes: number().int()
|
|
18860
|
+
});
|
|
18861
|
+
/**
|
|
18862
|
+
* The media footprint broken down by KIND — the axis a deletion decision
|
|
18863
|
+
* actually turns on.
|
|
18864
|
+
*
|
|
18865
|
+
* A byte total says how much there is; it cannot say what is safe to remove.
|
|
18866
|
+
* The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
|
|
18867
|
+
* motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
|
|
18868
|
+
* `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
|
|
18869
|
+
* buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
|
|
18870
|
+
* nothing else, so sizing a deletion means summing per kind.
|
|
18871
|
+
*
|
|
18872
|
+
* ## Why `unaccounted*` exists
|
|
18873
|
+
*
|
|
18874
|
+
* `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
|
|
18875
|
+
* writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
|
|
18876
|
+
* from a SEPARATE unfiltered aggregate over the same rows, never from adding
|
|
18877
|
+
* `kinds` up. A row whose stored `kind` is not in the enum (written by a
|
|
18878
|
+
* retired code path, or by a version that knew a kind this one does not) would
|
|
18879
|
+
* otherwise vanish from the total silently, and an operator would delete
|
|
18880
|
+
* against a denominator smaller than the disk.
|
|
18881
|
+
*
|
|
18882
|
+
* `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
|
|
18883
|
+
* zero; a non-zero value is a real finding and must be shown, not rounded away.
|
|
18884
|
+
*/
|
|
18885
|
+
var EventMediaKindBreakdownSchema = object({
|
|
18886
|
+
/** Every media row in scope, from one unfiltered aggregate. */
|
|
18887
|
+
totalRows: number().int(),
|
|
18888
|
+
/** Every media byte in scope, from that same aggregate. */
|
|
18889
|
+
totalBytes: number().int(),
|
|
18890
|
+
/** Per-kind footprint, ordered by bytes descending. */
|
|
18891
|
+
kinds: array(EventMediaKindFootprintSchema).readonly(),
|
|
18892
|
+
/** `totalRows` minus the summed `kinds` rows — see the schema note. */
|
|
18893
|
+
unaccountedRows: number().int(),
|
|
18894
|
+
/** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
|
|
18895
|
+
unaccountedBytes: number().int()
|
|
18896
|
+
});
|
|
18810
18897
|
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
18811
18898
|
var EventPruneCountsSchema = object({
|
|
18812
18899
|
motion: number().int(),
|
|
@@ -19010,6 +19097,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19010
19097
|
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
19011
19098
|
kind: "query",
|
|
19012
19099
|
auth: "admin"
|
|
19100
|
+
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
19101
|
+
kind: "query",
|
|
19102
|
+
auth: "admin"
|
|
19013
19103
|
}), method(object({
|
|
19014
19104
|
olderThanMs: number(),
|
|
19015
19105
|
reason: OpsLogReasonSchema.optional()
|
|
@@ -19149,6 +19239,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19149
19239
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
19150
19240
|
trackId: string(),
|
|
19151
19241
|
deviceId: number()
|
|
19242
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
19243
|
+
eventId: string(),
|
|
19244
|
+
deviceId: number()
|
|
19152
19245
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
19153
19246
|
kind: "mutation",
|
|
19154
19247
|
auth: "admin"
|
|
@@ -20958,6 +21051,20 @@ method(object({
|
|
|
20958
21051
|
error: string().optional()
|
|
20959
21052
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
20960
21053
|
providerId: string(),
|
|
21054
|
+
/**
|
|
21055
|
+
* The location this config is an UNSAVED edit of, when there is one.
|
|
21056
|
+
*
|
|
21057
|
+
* `listLocations` replaces every declared secret with the redaction
|
|
21058
|
+
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
21059
|
+
* credential the operator did not retype — and posting that here
|
|
21060
|
+
* without a way to resolve it makes the provider try to authenticate
|
|
21061
|
+
* as `__camstack_redacted__` and report the operator's own working
|
|
21062
|
+
* password as wrong. Given this id, the orchestrator restores each
|
|
21063
|
+
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
21064
|
+
* before dispatching. Omitted by the "Add location" wizard, where
|
|
21065
|
+
* every value was typed just now and nothing is stored yet.
|
|
21066
|
+
*/
|
|
21067
|
+
locationId: string().optional(),
|
|
20961
21068
|
config: record(string(), unknown())
|
|
20962
21069
|
}), object({
|
|
20963
21070
|
ok: boolean(),
|
|
@@ -23409,10 +23516,24 @@ var FaceClusterSchema = object({
|
|
|
23409
23516
|
size: number().int(),
|
|
23410
23517
|
cohesion: number()
|
|
23411
23518
|
});
|
|
23519
|
+
/**
|
|
23520
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
23521
|
+
* are — never the bytes.
|
|
23522
|
+
*
|
|
23523
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
23524
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
23525
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
23526
|
+
* caller is the admin UI's detail modal, which was building
|
|
23527
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
23528
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
23529
|
+
*
|
|
23530
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
23531
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
23532
|
+
*/
|
|
23412
23533
|
var MediaFileLiteSchema$1 = object({
|
|
23413
23534
|
key: string(),
|
|
23414
23535
|
kind: string(),
|
|
23415
|
-
|
|
23536
|
+
url: string(),
|
|
23416
23537
|
sizeBytes: number(),
|
|
23417
23538
|
timestamp: number()
|
|
23418
23539
|
});
|
|
@@ -25664,10 +25785,24 @@ var PlateInfoSchema = object({
|
|
|
25664
25785
|
*/
|
|
25665
25786
|
cropUrl: string().optional()
|
|
25666
25787
|
});
|
|
25788
|
+
/**
|
|
25789
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
25790
|
+
* are — never the bytes.
|
|
25791
|
+
*
|
|
25792
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
25793
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
25794
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
25795
|
+
* caller is the admin UI's detail modal, which was building
|
|
25796
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
25797
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
25798
|
+
*
|
|
25799
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
25800
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
25801
|
+
*/
|
|
25667
25802
|
var MediaFileLiteSchema = object({
|
|
25668
25803
|
key: string(),
|
|
25669
25804
|
kind: string(),
|
|
25670
|
-
|
|
25805
|
+
url: string(),
|
|
25671
25806
|
sizeBytes: number(),
|
|
25672
25807
|
timestamp: number()
|
|
25673
25808
|
});
|
|
@@ -31584,6 +31719,12 @@ Object.freeze({
|
|
|
31584
31719
|
addonId: null,
|
|
31585
31720
|
access: "view"
|
|
31586
31721
|
},
|
|
31722
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": {
|
|
31723
|
+
capName: "pipeline-analytics",
|
|
31724
|
+
capScope: "device",
|
|
31725
|
+
addonId: null,
|
|
31726
|
+
access: "view"
|
|
31727
|
+
},
|
|
31587
31728
|
"pipelineAnalytics.getEventStoreFootprint": {
|
|
31588
31729
|
capName: "pipeline-analytics",
|
|
31589
31730
|
capScope: "device",
|
|
@@ -31680,6 +31821,12 @@ Object.freeze({
|
|
|
31680
31821
|
addonId: null,
|
|
31681
31822
|
access: "view"
|
|
31682
31823
|
},
|
|
31824
|
+
"pipelineAnalytics.listEventMedia": {
|
|
31825
|
+
capName: "pipeline-analytics",
|
|
31826
|
+
capScope: "device",
|
|
31827
|
+
addonId: null,
|
|
31828
|
+
access: "view"
|
|
31829
|
+
},
|
|
31683
31830
|
"pipelineAnalytics.listGroups": {
|
|
31684
31831
|
capName: "pipeline-analytics",
|
|
31685
31832
|
capScope: "device",
|
|
@@ -35243,6 +35390,11 @@ Object.freeze({
|
|
|
35243
35390
|
form: "single",
|
|
35244
35391
|
optional: false
|
|
35245
35392
|
}],
|
|
35393
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": [{
|
|
35394
|
+
name: "deviceId",
|
|
35395
|
+
form: "single",
|
|
35396
|
+
optional: true
|
|
35397
|
+
}],
|
|
35246
35398
|
"pipelineAnalytics.getGroup": [{
|
|
35247
35399
|
name: "deviceId",
|
|
35248
35400
|
form: "single",
|
|
@@ -35303,6 +35455,11 @@ Object.freeze({
|
|
|
35303
35455
|
form: "array",
|
|
35304
35456
|
optional: false
|
|
35305
35457
|
}],
|
|
35458
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
35459
|
+
name: "deviceId",
|
|
35460
|
+
form: "single",
|
|
35461
|
+
optional: false
|
|
35462
|
+
}],
|
|
35306
35463
|
"pipelineAnalytics.listGroups": [{
|
|
35307
35464
|
name: "deviceIds",
|
|
35308
35465
|
form: "array",
|
|
@@ -12993,6 +12993,114 @@ method(object({
|
|
|
12993
12993
|
height: number()
|
|
12994
12994
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
12995
12995
|
/**
|
|
12996
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
12997
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
12998
|
+
*
|
|
12999
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13000
|
+
*
|
|
13001
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13002
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13003
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13004
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13005
|
+
* somebody to forget to edit.
|
|
13006
|
+
*
|
|
13007
|
+
* They are not merged, because their invariants are opposites:
|
|
13008
|
+
*
|
|
13009
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13010
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13011
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13012
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13013
|
+
* and it is exactly what an absent entry cannot say.
|
|
13014
|
+
*
|
|
13015
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13016
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13017
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13018
|
+
* has no process.
|
|
13019
|
+
*
|
|
13020
|
+
* ## Why not a log line, since the counters already exist
|
|
13021
|
+
*
|
|
13022
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13023
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13024
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13025
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13026
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13027
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13028
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13029
|
+
* be READ.
|
|
13030
|
+
*
|
|
13031
|
+
* ## The rate is served with its denominator or not at all
|
|
13032
|
+
*
|
|
13033
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13034
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13035
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13036
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
13037
|
+
* reproduces that mistake on every read.
|
|
13038
|
+
*
|
|
13039
|
+
* ## Shape
|
|
13040
|
+
*
|
|
13041
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13042
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13043
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13044
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13045
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13046
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13047
|
+
* result through `system.getFailureContributions`.
|
|
13048
|
+
*/
|
|
13049
|
+
var FailureReasonCountSchema = object({
|
|
13050
|
+
/**
|
|
13051
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13052
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13053
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
13054
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
13055
|
+
* vocabulary for the same loss would make the row and the counter
|
|
13056
|
+
* un-joinable.
|
|
13057
|
+
*/
|
|
13058
|
+
reason: string(),
|
|
13059
|
+
count: number().int().nonnegative()
|
|
13060
|
+
});
|
|
13061
|
+
var FailureContributionSchema = object({
|
|
13062
|
+
/**
|
|
13063
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13064
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13065
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
13066
|
+
* is a central list that rots invisibly.
|
|
13067
|
+
*/
|
|
13068
|
+
family: string(),
|
|
13069
|
+
/**
|
|
13070
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13071
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13072
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
13073
|
+
* cannot answer the only question anybody asks of this surface.
|
|
13074
|
+
*/
|
|
13075
|
+
deviceId: number().int().positive(),
|
|
13076
|
+
/**
|
|
13077
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
13078
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13079
|
+
* family has a single variant.
|
|
13080
|
+
*/
|
|
13081
|
+
variant: string().optional(),
|
|
13082
|
+
/**
|
|
13083
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13084
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
13085
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13086
|
+
* `LoadContribution.startedAtMs`.
|
|
13087
|
+
*/
|
|
13088
|
+
sinceMs: number(),
|
|
13089
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13090
|
+
atMs: number(),
|
|
13091
|
+
/**
|
|
13092
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13093
|
+
* window. A failure count published without it is the mistake this schema
|
|
13094
|
+
* exists to make impossible.
|
|
13095
|
+
*/
|
|
13096
|
+
attempts: number().int().nonnegative(),
|
|
13097
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13098
|
+
succeeded: number().int().nonnegative(),
|
|
13099
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13100
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
13101
|
+
});
|
|
13102
|
+
method(_void(), array(FailureContributionSchema).readonly());
|
|
13103
|
+
/**
|
|
12996
13104
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
12997
13105
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
12998
13106
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -13514,6 +13622,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13514
13622
|
kind: "mutation",
|
|
13515
13623
|
auth: "admin"
|
|
13516
13624
|
});
|
|
13625
|
+
var LoadContributionSchema = object({
|
|
13626
|
+
role: _enum([
|
|
13627
|
+
"decode",
|
|
13628
|
+
"transcode",
|
|
13629
|
+
"recording",
|
|
13630
|
+
"streaming",
|
|
13631
|
+
"detection"
|
|
13632
|
+
]),
|
|
13633
|
+
/**
|
|
13634
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13635
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13636
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13637
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
13638
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13639
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
13640
|
+
*/
|
|
13641
|
+
deviceId: number().int().positive().nullable(),
|
|
13642
|
+
attribution: _enum([
|
|
13643
|
+
"measured",
|
|
13644
|
+
"accounted",
|
|
13645
|
+
"unattributable"
|
|
13646
|
+
]),
|
|
13647
|
+
/**
|
|
13648
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13649
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13650
|
+
* family and inventing a common one would lose the only information that
|
|
13651
|
+
* makes two entries for the same camera distinguishable.
|
|
13652
|
+
*/
|
|
13653
|
+
unit: string(),
|
|
13654
|
+
/**
|
|
13655
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
13656
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
13657
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
13658
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13659
|
+
* process of its own.
|
|
13660
|
+
*/
|
|
13661
|
+
pid: number().int().positive().optional(),
|
|
13662
|
+
/**
|
|
13663
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
13664
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13665
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
13666
|
+
* process.
|
|
13667
|
+
*/
|
|
13668
|
+
startedAtMs: number().optional(),
|
|
13669
|
+
/**
|
|
13670
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13671
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13672
|
+
* contribution is asked for.
|
|
13673
|
+
*
|
|
13674
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13675
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13676
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13677
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13678
|
+
*
|
|
13679
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13680
|
+
* an entry with no process.
|
|
13681
|
+
*/
|
|
13682
|
+
cpuSeconds: number().optional(),
|
|
13683
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13684
|
+
rssBytes: number().optional()
|
|
13685
|
+
});
|
|
13686
|
+
method(_void(), array(LoadContributionSchema).readonly());
|
|
13517
13687
|
/**
|
|
13518
13688
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13519
13689
|
* through. It stores nothing.
|
|
@@ -13590,176 +13760,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
13590
13760
|
tags: record(string(), string()).optional()
|
|
13591
13761
|
}), array(LogEntrySchema).readonly());
|
|
13592
13762
|
/**
|
|
13593
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13594
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
13595
|
-
*
|
|
13596
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13597
|
-
*
|
|
13598
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13599
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13600
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13601
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13602
|
-
* somebody to forget to edit.
|
|
13603
|
-
*
|
|
13604
|
-
* They are not merged, because their invariants are opposites:
|
|
13605
|
-
*
|
|
13606
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13607
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13608
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13609
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13610
|
-
* and it is exactly what an absent entry cannot say.
|
|
13611
|
-
*
|
|
13612
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13613
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13614
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13615
|
-
* has no process.
|
|
13616
|
-
*
|
|
13617
|
-
* ## Why not a log line, since the counters already exist
|
|
13618
|
-
*
|
|
13619
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13620
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13621
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13622
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13623
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13624
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13625
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13626
|
-
* be READ.
|
|
13627
|
-
*
|
|
13628
|
-
* ## The rate is served with its denominator or not at all
|
|
13629
|
-
*
|
|
13630
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13631
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13632
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13633
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
13634
|
-
* reproduces that mistake on every read.
|
|
13635
|
-
*
|
|
13636
|
-
* ## Shape
|
|
13637
|
-
*
|
|
13638
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13639
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13640
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13641
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13642
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13643
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13644
|
-
* result through `system.getFailureContributions`.
|
|
13645
|
-
*/
|
|
13646
|
-
var FailureReasonCountSchema = object({
|
|
13647
|
-
/**
|
|
13648
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13649
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13650
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
13651
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
13652
|
-
* vocabulary for the same loss would make the row and the counter
|
|
13653
|
-
* un-joinable.
|
|
13654
|
-
*/
|
|
13655
|
-
reason: string(),
|
|
13656
|
-
count: number().int().nonnegative()
|
|
13657
|
-
});
|
|
13658
|
-
var FailureContributionSchema = object({
|
|
13659
|
-
/**
|
|
13660
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13661
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13662
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
13663
|
-
* is a central list that rots invisibly.
|
|
13664
|
-
*/
|
|
13665
|
-
family: string(),
|
|
13666
|
-
/**
|
|
13667
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13668
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13669
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
13670
|
-
* cannot answer the only question anybody asks of this surface.
|
|
13671
|
-
*/
|
|
13672
|
-
deviceId: number().int().positive(),
|
|
13673
|
-
/**
|
|
13674
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
13675
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13676
|
-
* family has a single variant.
|
|
13677
|
-
*/
|
|
13678
|
-
variant: string().optional(),
|
|
13679
|
-
/**
|
|
13680
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13681
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
13682
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13683
|
-
* `LoadContribution.startedAtMs`.
|
|
13684
|
-
*/
|
|
13685
|
-
sinceMs: number(),
|
|
13686
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13687
|
-
atMs: number(),
|
|
13688
|
-
/**
|
|
13689
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13690
|
-
* window. A failure count published without it is the mistake this schema
|
|
13691
|
-
* exists to make impossible.
|
|
13692
|
-
*/
|
|
13693
|
-
attempts: number().int().nonnegative(),
|
|
13694
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13695
|
-
succeeded: number().int().nonnegative(),
|
|
13696
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13697
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
13698
|
-
});
|
|
13699
|
-
method(_void(), array(FailureContributionSchema).readonly());
|
|
13700
|
-
var LoadContributionSchema = object({
|
|
13701
|
-
role: _enum([
|
|
13702
|
-
"decode",
|
|
13703
|
-
"transcode",
|
|
13704
|
-
"recording",
|
|
13705
|
-
"streaming",
|
|
13706
|
-
"detection"
|
|
13707
|
-
]),
|
|
13708
|
-
/**
|
|
13709
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13710
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13711
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13712
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
13713
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13714
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
13715
|
-
*/
|
|
13716
|
-
deviceId: number().int().positive().nullable(),
|
|
13717
|
-
attribution: _enum([
|
|
13718
|
-
"measured",
|
|
13719
|
-
"accounted",
|
|
13720
|
-
"unattributable"
|
|
13721
|
-
]),
|
|
13722
|
-
/**
|
|
13723
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13724
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13725
|
-
* family and inventing a common one would lose the only information that
|
|
13726
|
-
* makes two entries for the same camera distinguishable.
|
|
13727
|
-
*/
|
|
13728
|
-
unit: string(),
|
|
13729
|
-
/**
|
|
13730
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
13731
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
13732
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
13733
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13734
|
-
* process of its own.
|
|
13735
|
-
*/
|
|
13736
|
-
pid: number().int().positive().optional(),
|
|
13737
|
-
/**
|
|
13738
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
13739
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13740
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
13741
|
-
* process.
|
|
13742
|
-
*/
|
|
13743
|
-
startedAtMs: number().optional(),
|
|
13744
|
-
/**
|
|
13745
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13746
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13747
|
-
* contribution is asked for.
|
|
13748
|
-
*
|
|
13749
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13750
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13751
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13752
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13753
|
-
*
|
|
13754
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13755
|
-
* an entry with no process.
|
|
13756
|
-
*/
|
|
13757
|
-
cpuSeconds: number().optional(),
|
|
13758
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13759
|
-
rssBytes: number().optional()
|
|
13760
|
-
});
|
|
13761
|
-
method(_void(), array(LoadContributionSchema).readonly());
|
|
13762
|
-
/**
|
|
13763
13763
|
* `login-method` — collection cap through which auth addons contribute
|
|
13764
13764
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
13765
13765
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -18438,12 +18438,53 @@ var MediaFileKindEnum = _enum([
|
|
|
18438
18438
|
"keyFrameSmall",
|
|
18439
18439
|
"thumbnailSmall"
|
|
18440
18440
|
]);
|
|
18441
|
+
/**
|
|
18442
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
18443
|
+
* ARE — never the bytes themselves.
|
|
18444
|
+
*
|
|
18445
|
+
* ## Why `url` and not `base64`
|
|
18446
|
+
*
|
|
18447
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
18448
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
18449
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
18450
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
18451
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
18452
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
18453
|
+
*
|
|
18454
|
+
* `url` points at the `event-media` data plane
|
|
18455
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
18456
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
18457
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
18458
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
18459
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
18460
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
18461
|
+
* (per-device scoping).
|
|
18462
|
+
*
|
|
18463
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
18464
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
18465
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
18466
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
18467
|
+
*
|
|
18468
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
18469
|
+
*
|
|
18470
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
18471
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
18472
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
18473
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
18474
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
18475
|
+
* delete this line and the `withBytes` pass-through in
|
|
18476
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
18477
|
+
*/
|
|
18441
18478
|
var MediaFileSchema = object({
|
|
18442
18479
|
key: string(),
|
|
18443
18480
|
kind: MediaFileKindEnum,
|
|
18444
|
-
base64: string(),
|
|
18445
18481
|
sizeBytes: number(),
|
|
18446
18482
|
timestamp: number()
|
|
18483
|
+
}).extend({
|
|
18484
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
18485
|
+
url: string(),
|
|
18486
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
18487
|
+
base64: string()
|
|
18447
18488
|
});
|
|
18448
18489
|
/**
|
|
18449
18490
|
* One media row WITHOUT its bytes.
|
|
@@ -18455,7 +18496,9 @@ var MediaFileSchema = object({
|
|
|
18455
18496
|
* blocks the whole view.
|
|
18456
18497
|
*
|
|
18457
18498
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
18458
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
18499
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
18500
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
18501
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
18459
18502
|
*/
|
|
18460
18503
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
18461
18504
|
/**
|
|
@@ -18802,6 +18845,50 @@ var EventStoreFootprintSchema = object({
|
|
|
18802
18845
|
totalBytes: number().int(),
|
|
18803
18846
|
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
18804
18847
|
});
|
|
18848
|
+
/** Event-media footprint for one {@link MediaFileKind}. */
|
|
18849
|
+
var EventMediaKindFootprintSchema = object({
|
|
18850
|
+
kind: MediaFileKindEnum,
|
|
18851
|
+
/** Media rows of this kind. */
|
|
18852
|
+
rows: number().int(),
|
|
18853
|
+
/** Bytes on disk held by those rows. */
|
|
18854
|
+
bytes: number().int()
|
|
18855
|
+
});
|
|
18856
|
+
/**
|
|
18857
|
+
* The media footprint broken down by KIND — the axis a deletion decision
|
|
18858
|
+
* actually turns on.
|
|
18859
|
+
*
|
|
18860
|
+
* A byte total says how much there is; it cannot say what is safe to remove.
|
|
18861
|
+
* The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
|
|
18862
|
+
* motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
|
|
18863
|
+
* `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
|
|
18864
|
+
* buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
|
|
18865
|
+
* nothing else, so sizing a deletion means summing per kind.
|
|
18866
|
+
*
|
|
18867
|
+
* ## Why `unaccounted*` exists
|
|
18868
|
+
*
|
|
18869
|
+
* `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
|
|
18870
|
+
* writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
|
|
18871
|
+
* from a SEPARATE unfiltered aggregate over the same rows, never from adding
|
|
18872
|
+
* `kinds` up. A row whose stored `kind` is not in the enum (written by a
|
|
18873
|
+
* retired code path, or by a version that knew a kind this one does not) would
|
|
18874
|
+
* otherwise vanish from the total silently, and an operator would delete
|
|
18875
|
+
* against a denominator smaller than the disk.
|
|
18876
|
+
*
|
|
18877
|
+
* `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
|
|
18878
|
+
* zero; a non-zero value is a real finding and must be shown, not rounded away.
|
|
18879
|
+
*/
|
|
18880
|
+
var EventMediaKindBreakdownSchema = object({
|
|
18881
|
+
/** Every media row in scope, from one unfiltered aggregate. */
|
|
18882
|
+
totalRows: number().int(),
|
|
18883
|
+
/** Every media byte in scope, from that same aggregate. */
|
|
18884
|
+
totalBytes: number().int(),
|
|
18885
|
+
/** Per-kind footprint, ordered by bytes descending. */
|
|
18886
|
+
kinds: array(EventMediaKindFootprintSchema).readonly(),
|
|
18887
|
+
/** `totalRows` minus the summed `kinds` rows — see the schema note. */
|
|
18888
|
+
unaccountedRows: number().int(),
|
|
18889
|
+
/** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
|
|
18890
|
+
unaccountedBytes: number().int()
|
|
18891
|
+
});
|
|
18805
18892
|
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
18806
18893
|
var EventPruneCountsSchema = object({
|
|
18807
18894
|
motion: number().int(),
|
|
@@ -19005,6 +19092,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19005
19092
|
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
19006
19093
|
kind: "query",
|
|
19007
19094
|
auth: "admin"
|
|
19095
|
+
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
19096
|
+
kind: "query",
|
|
19097
|
+
auth: "admin"
|
|
19008
19098
|
}), method(object({
|
|
19009
19099
|
olderThanMs: number(),
|
|
19010
19100
|
reason: OpsLogReasonSchema.optional()
|
|
@@ -19144,6 +19234,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19144
19234
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
19145
19235
|
trackId: string(),
|
|
19146
19236
|
deviceId: number()
|
|
19237
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
19238
|
+
eventId: string(),
|
|
19239
|
+
deviceId: number()
|
|
19147
19240
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
19148
19241
|
kind: "mutation",
|
|
19149
19242
|
auth: "admin"
|
|
@@ -20953,6 +21046,20 @@ method(object({
|
|
|
20953
21046
|
error: string().optional()
|
|
20954
21047
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
20955
21048
|
providerId: string(),
|
|
21049
|
+
/**
|
|
21050
|
+
* The location this config is an UNSAVED edit of, when there is one.
|
|
21051
|
+
*
|
|
21052
|
+
* `listLocations` replaces every declared secret with the redaction
|
|
21053
|
+
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
21054
|
+
* credential the operator did not retype — and posting that here
|
|
21055
|
+
* without a way to resolve it makes the provider try to authenticate
|
|
21056
|
+
* as `__camstack_redacted__` and report the operator's own working
|
|
21057
|
+
* password as wrong. Given this id, the orchestrator restores each
|
|
21058
|
+
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
21059
|
+
* before dispatching. Omitted by the "Add location" wizard, where
|
|
21060
|
+
* every value was typed just now and nothing is stored yet.
|
|
21061
|
+
*/
|
|
21062
|
+
locationId: string().optional(),
|
|
20956
21063
|
config: record(string(), unknown())
|
|
20957
21064
|
}), object({
|
|
20958
21065
|
ok: boolean(),
|
|
@@ -23404,10 +23511,24 @@ var FaceClusterSchema = object({
|
|
|
23404
23511
|
size: number().int(),
|
|
23405
23512
|
cohesion: number()
|
|
23406
23513
|
});
|
|
23514
|
+
/**
|
|
23515
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
23516
|
+
* are — never the bytes.
|
|
23517
|
+
*
|
|
23518
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
23519
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
23520
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
23521
|
+
* caller is the admin UI's detail modal, which was building
|
|
23522
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
23523
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
23524
|
+
*
|
|
23525
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
23526
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
23527
|
+
*/
|
|
23407
23528
|
var MediaFileLiteSchema$1 = object({
|
|
23408
23529
|
key: string(),
|
|
23409
23530
|
kind: string(),
|
|
23410
|
-
|
|
23531
|
+
url: string(),
|
|
23411
23532
|
sizeBytes: number(),
|
|
23412
23533
|
timestamp: number()
|
|
23413
23534
|
});
|
|
@@ -25659,10 +25780,24 @@ var PlateInfoSchema = object({
|
|
|
25659
25780
|
*/
|
|
25660
25781
|
cropUrl: string().optional()
|
|
25661
25782
|
});
|
|
25783
|
+
/**
|
|
25784
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
25785
|
+
* are — never the bytes.
|
|
25786
|
+
*
|
|
25787
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
25788
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
25789
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
25790
|
+
* caller is the admin UI's detail modal, which was building
|
|
25791
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
25792
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
25793
|
+
*
|
|
25794
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
25795
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
25796
|
+
*/
|
|
25662
25797
|
var MediaFileLiteSchema = object({
|
|
25663
25798
|
key: string(),
|
|
25664
25799
|
kind: string(),
|
|
25665
|
-
|
|
25800
|
+
url: string(),
|
|
25666
25801
|
sizeBytes: number(),
|
|
25667
25802
|
timestamp: number()
|
|
25668
25803
|
});
|
|
@@ -31579,6 +31714,12 @@ Object.freeze({
|
|
|
31579
31714
|
addonId: null,
|
|
31580
31715
|
access: "view"
|
|
31581
31716
|
},
|
|
31717
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": {
|
|
31718
|
+
capName: "pipeline-analytics",
|
|
31719
|
+
capScope: "device",
|
|
31720
|
+
addonId: null,
|
|
31721
|
+
access: "view"
|
|
31722
|
+
},
|
|
31582
31723
|
"pipelineAnalytics.getEventStoreFootprint": {
|
|
31583
31724
|
capName: "pipeline-analytics",
|
|
31584
31725
|
capScope: "device",
|
|
@@ -31675,6 +31816,12 @@ Object.freeze({
|
|
|
31675
31816
|
addonId: null,
|
|
31676
31817
|
access: "view"
|
|
31677
31818
|
},
|
|
31819
|
+
"pipelineAnalytics.listEventMedia": {
|
|
31820
|
+
capName: "pipeline-analytics",
|
|
31821
|
+
capScope: "device",
|
|
31822
|
+
addonId: null,
|
|
31823
|
+
access: "view"
|
|
31824
|
+
},
|
|
31678
31825
|
"pipelineAnalytics.listGroups": {
|
|
31679
31826
|
capName: "pipeline-analytics",
|
|
31680
31827
|
capScope: "device",
|
|
@@ -35238,6 +35385,11 @@ Object.freeze({
|
|
|
35238
35385
|
form: "single",
|
|
35239
35386
|
optional: false
|
|
35240
35387
|
}],
|
|
35388
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": [{
|
|
35389
|
+
name: "deviceId",
|
|
35390
|
+
form: "single",
|
|
35391
|
+
optional: true
|
|
35392
|
+
}],
|
|
35241
35393
|
"pipelineAnalytics.getGroup": [{
|
|
35242
35394
|
name: "deviceId",
|
|
35243
35395
|
form: "single",
|
|
@@ -35298,6 +35450,11 @@ Object.freeze({
|
|
|
35298
35450
|
form: "array",
|
|
35299
35451
|
optional: false
|
|
35300
35452
|
}],
|
|
35453
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
35454
|
+
name: "deviceId",
|
|
35455
|
+
form: "single",
|
|
35456
|
+
optional: false
|
|
35457
|
+
}],
|
|
35301
35458
|
"pipelineAnalytics.listGroups": [{
|
|
35302
35459
|
name: "deviceIds",
|
|
35303
35460
|
form: "array",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-mqtt-broker",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.48",
|
|
4
4
|
"description": "MQTT broker registry addon for CamStack — manages external broker entries + an optional embedded aedes broker. Consumers spin up their own `mqtt.js` clients via the `mqtt-broker` cap.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|