@camstack/addon-provider-unifi 0.2.46 → 0.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/addon.js +331 -174
- package/dist/addon.mjs +331 -174
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -13184,6 +13184,114 @@ method(object({
|
|
|
13184
13184
|
height: number()
|
|
13185
13185
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
13186
13186
|
/**
|
|
13187
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13188
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
13189
|
+
*
|
|
13190
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13191
|
+
*
|
|
13192
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13193
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13194
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13195
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13196
|
+
* somebody to forget to edit.
|
|
13197
|
+
*
|
|
13198
|
+
* They are not merged, because their invariants are opposites:
|
|
13199
|
+
*
|
|
13200
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13201
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13202
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13203
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13204
|
+
* and it is exactly what an absent entry cannot say.
|
|
13205
|
+
*
|
|
13206
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13207
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13208
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13209
|
+
* has no process.
|
|
13210
|
+
*
|
|
13211
|
+
* ## Why not a log line, since the counters already exist
|
|
13212
|
+
*
|
|
13213
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13214
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13215
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13216
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13217
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13218
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13219
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13220
|
+
* be READ.
|
|
13221
|
+
*
|
|
13222
|
+
* ## The rate is served with its denominator or not at all
|
|
13223
|
+
*
|
|
13224
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13225
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13226
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13227
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
13228
|
+
* reproduces that mistake on every read.
|
|
13229
|
+
*
|
|
13230
|
+
* ## Shape
|
|
13231
|
+
*
|
|
13232
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13233
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13234
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13235
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13236
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13237
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13238
|
+
* result through `system.getFailureContributions`.
|
|
13239
|
+
*/
|
|
13240
|
+
var FailureReasonCountSchema = object({
|
|
13241
|
+
/**
|
|
13242
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13243
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13244
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
13245
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
13246
|
+
* vocabulary for the same loss would make the row and the counter
|
|
13247
|
+
* un-joinable.
|
|
13248
|
+
*/
|
|
13249
|
+
reason: string(),
|
|
13250
|
+
count: number().int().nonnegative()
|
|
13251
|
+
});
|
|
13252
|
+
var FailureContributionSchema = object({
|
|
13253
|
+
/**
|
|
13254
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13255
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13256
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
13257
|
+
* is a central list that rots invisibly.
|
|
13258
|
+
*/
|
|
13259
|
+
family: string(),
|
|
13260
|
+
/**
|
|
13261
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13262
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13263
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
13264
|
+
* cannot answer the only question anybody asks of this surface.
|
|
13265
|
+
*/
|
|
13266
|
+
deviceId: number().int().positive(),
|
|
13267
|
+
/**
|
|
13268
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
13269
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13270
|
+
* family has a single variant.
|
|
13271
|
+
*/
|
|
13272
|
+
variant: string().optional(),
|
|
13273
|
+
/**
|
|
13274
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13275
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
13276
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13277
|
+
* `LoadContribution.startedAtMs`.
|
|
13278
|
+
*/
|
|
13279
|
+
sinceMs: number(),
|
|
13280
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13281
|
+
atMs: number(),
|
|
13282
|
+
/**
|
|
13283
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13284
|
+
* window. A failure count published without it is the mistake this schema
|
|
13285
|
+
* exists to make impossible.
|
|
13286
|
+
*/
|
|
13287
|
+
attempts: number().int().nonnegative(),
|
|
13288
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13289
|
+
succeeded: number().int().nonnegative(),
|
|
13290
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13291
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
13292
|
+
});
|
|
13293
|
+
method(_void(), array(FailureContributionSchema).readonly());
|
|
13294
|
+
/**
|
|
13187
13295
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
13188
13296
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
13189
13297
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -13705,6 +13813,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13705
13813
|
kind: "mutation",
|
|
13706
13814
|
auth: "admin"
|
|
13707
13815
|
});
|
|
13816
|
+
var LoadContributionSchema = object({
|
|
13817
|
+
role: _enum([
|
|
13818
|
+
"decode",
|
|
13819
|
+
"transcode",
|
|
13820
|
+
"recording",
|
|
13821
|
+
"streaming",
|
|
13822
|
+
"detection"
|
|
13823
|
+
]),
|
|
13824
|
+
/**
|
|
13825
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13826
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13827
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13828
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
13829
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13830
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
13831
|
+
*/
|
|
13832
|
+
deviceId: number().int().positive().nullable(),
|
|
13833
|
+
attribution: _enum([
|
|
13834
|
+
"measured",
|
|
13835
|
+
"accounted",
|
|
13836
|
+
"unattributable"
|
|
13837
|
+
]),
|
|
13838
|
+
/**
|
|
13839
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13840
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13841
|
+
* family and inventing a common one would lose the only information that
|
|
13842
|
+
* makes two entries for the same camera distinguishable.
|
|
13843
|
+
*/
|
|
13844
|
+
unit: string(),
|
|
13845
|
+
/**
|
|
13846
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
13847
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
13848
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
13849
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13850
|
+
* process of its own.
|
|
13851
|
+
*/
|
|
13852
|
+
pid: number().int().positive().optional(),
|
|
13853
|
+
/**
|
|
13854
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
13855
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13856
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
13857
|
+
* process.
|
|
13858
|
+
*/
|
|
13859
|
+
startedAtMs: number().optional(),
|
|
13860
|
+
/**
|
|
13861
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13862
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13863
|
+
* contribution is asked for.
|
|
13864
|
+
*
|
|
13865
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13866
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13867
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13868
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13869
|
+
*
|
|
13870
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13871
|
+
* an entry with no process.
|
|
13872
|
+
*/
|
|
13873
|
+
cpuSeconds: number().optional(),
|
|
13874
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13875
|
+
rssBytes: number().optional()
|
|
13876
|
+
});
|
|
13877
|
+
method(_void(), array(LoadContributionSchema).readonly());
|
|
13708
13878
|
/**
|
|
13709
13879
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13710
13880
|
* through. It stores nothing.
|
|
@@ -13781,176 +13951,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
13781
13951
|
tags: record(string(), string()).optional()
|
|
13782
13952
|
}), array(LogEntrySchema).readonly());
|
|
13783
13953
|
/**
|
|
13784
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13785
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
13786
|
-
*
|
|
13787
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13788
|
-
*
|
|
13789
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13790
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13791
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13792
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13793
|
-
* somebody to forget to edit.
|
|
13794
|
-
*
|
|
13795
|
-
* They are not merged, because their invariants are opposites:
|
|
13796
|
-
*
|
|
13797
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13798
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13799
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13800
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13801
|
-
* and it is exactly what an absent entry cannot say.
|
|
13802
|
-
*
|
|
13803
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13804
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13805
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13806
|
-
* has no process.
|
|
13807
|
-
*
|
|
13808
|
-
* ## Why not a log line, since the counters already exist
|
|
13809
|
-
*
|
|
13810
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13811
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13812
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13813
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13814
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13815
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13816
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13817
|
-
* be READ.
|
|
13818
|
-
*
|
|
13819
|
-
* ## The rate is served with its denominator or not at all
|
|
13820
|
-
*
|
|
13821
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13822
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13823
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13824
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
13825
|
-
* reproduces that mistake on every read.
|
|
13826
|
-
*
|
|
13827
|
-
* ## Shape
|
|
13828
|
-
*
|
|
13829
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13830
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13831
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13832
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13833
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13834
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13835
|
-
* result through `system.getFailureContributions`.
|
|
13836
|
-
*/
|
|
13837
|
-
var FailureReasonCountSchema = object({
|
|
13838
|
-
/**
|
|
13839
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13840
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13841
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
13842
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
13843
|
-
* vocabulary for the same loss would make the row and the counter
|
|
13844
|
-
* un-joinable.
|
|
13845
|
-
*/
|
|
13846
|
-
reason: string(),
|
|
13847
|
-
count: number().int().nonnegative()
|
|
13848
|
-
});
|
|
13849
|
-
var FailureContributionSchema = object({
|
|
13850
|
-
/**
|
|
13851
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13852
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13853
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
13854
|
-
* is a central list that rots invisibly.
|
|
13855
|
-
*/
|
|
13856
|
-
family: string(),
|
|
13857
|
-
/**
|
|
13858
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13859
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13860
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
13861
|
-
* cannot answer the only question anybody asks of this surface.
|
|
13862
|
-
*/
|
|
13863
|
-
deviceId: number().int().positive(),
|
|
13864
|
-
/**
|
|
13865
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
13866
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13867
|
-
* family has a single variant.
|
|
13868
|
-
*/
|
|
13869
|
-
variant: string().optional(),
|
|
13870
|
-
/**
|
|
13871
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13872
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
13873
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13874
|
-
* `LoadContribution.startedAtMs`.
|
|
13875
|
-
*/
|
|
13876
|
-
sinceMs: number(),
|
|
13877
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13878
|
-
atMs: number(),
|
|
13879
|
-
/**
|
|
13880
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13881
|
-
* window. A failure count published without it is the mistake this schema
|
|
13882
|
-
* exists to make impossible.
|
|
13883
|
-
*/
|
|
13884
|
-
attempts: number().int().nonnegative(),
|
|
13885
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13886
|
-
succeeded: number().int().nonnegative(),
|
|
13887
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13888
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
13889
|
-
});
|
|
13890
|
-
method(_void(), array(FailureContributionSchema).readonly());
|
|
13891
|
-
var LoadContributionSchema = object({
|
|
13892
|
-
role: _enum([
|
|
13893
|
-
"decode",
|
|
13894
|
-
"transcode",
|
|
13895
|
-
"recording",
|
|
13896
|
-
"streaming",
|
|
13897
|
-
"detection"
|
|
13898
|
-
]),
|
|
13899
|
-
/**
|
|
13900
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13901
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13902
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13903
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
13904
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13905
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
13906
|
-
*/
|
|
13907
|
-
deviceId: number().int().positive().nullable(),
|
|
13908
|
-
attribution: _enum([
|
|
13909
|
-
"measured",
|
|
13910
|
-
"accounted",
|
|
13911
|
-
"unattributable"
|
|
13912
|
-
]),
|
|
13913
|
-
/**
|
|
13914
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13915
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13916
|
-
* family and inventing a common one would lose the only information that
|
|
13917
|
-
* makes two entries for the same camera distinguishable.
|
|
13918
|
-
*/
|
|
13919
|
-
unit: string(),
|
|
13920
|
-
/**
|
|
13921
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
13922
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
13923
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
13924
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13925
|
-
* process of its own.
|
|
13926
|
-
*/
|
|
13927
|
-
pid: number().int().positive().optional(),
|
|
13928
|
-
/**
|
|
13929
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
13930
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13931
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
13932
|
-
* process.
|
|
13933
|
-
*/
|
|
13934
|
-
startedAtMs: number().optional(),
|
|
13935
|
-
/**
|
|
13936
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13937
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13938
|
-
* contribution is asked for.
|
|
13939
|
-
*
|
|
13940
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13941
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13942
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13943
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13944
|
-
*
|
|
13945
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13946
|
-
* an entry with no process.
|
|
13947
|
-
*/
|
|
13948
|
-
cpuSeconds: number().optional(),
|
|
13949
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13950
|
-
rssBytes: number().optional()
|
|
13951
|
-
});
|
|
13952
|
-
method(_void(), array(LoadContributionSchema).readonly());
|
|
13953
|
-
/**
|
|
13954
13954
|
* `login-method` — collection cap through which auth addons contribute
|
|
13955
13955
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
13956
13956
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -18688,12 +18688,53 @@ var MediaFileKindEnum = _enum([
|
|
|
18688
18688
|
"keyFrameSmall",
|
|
18689
18689
|
"thumbnailSmall"
|
|
18690
18690
|
]);
|
|
18691
|
+
/**
|
|
18692
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
18693
|
+
* ARE — never the bytes themselves.
|
|
18694
|
+
*
|
|
18695
|
+
* ## Why `url` and not `base64`
|
|
18696
|
+
*
|
|
18697
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
18698
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
18699
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
18700
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
18701
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
18702
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
18703
|
+
*
|
|
18704
|
+
* `url` points at the `event-media` data plane
|
|
18705
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
18706
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
18707
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
18708
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
18709
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
18710
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
18711
|
+
* (per-device scoping).
|
|
18712
|
+
*
|
|
18713
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
18714
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
18715
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
18716
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
18717
|
+
*
|
|
18718
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
18719
|
+
*
|
|
18720
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
18721
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
18722
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
18723
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
18724
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
18725
|
+
* delete this line and the `withBytes` pass-through in
|
|
18726
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
18727
|
+
*/
|
|
18691
18728
|
var MediaFileSchema = object({
|
|
18692
18729
|
key: string(),
|
|
18693
18730
|
kind: MediaFileKindEnum,
|
|
18694
|
-
base64: string(),
|
|
18695
18731
|
sizeBytes: number(),
|
|
18696
18732
|
timestamp: number()
|
|
18733
|
+
}).extend({
|
|
18734
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
18735
|
+
url: string(),
|
|
18736
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
18737
|
+
base64: string()
|
|
18697
18738
|
});
|
|
18698
18739
|
/**
|
|
18699
18740
|
* One media row WITHOUT its bytes.
|
|
@@ -18705,7 +18746,9 @@ var MediaFileSchema = object({
|
|
|
18705
18746
|
* blocks the whole view.
|
|
18706
18747
|
*
|
|
18707
18748
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
18708
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
18749
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
18750
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
18751
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
18709
18752
|
*/
|
|
18710
18753
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
18711
18754
|
/**
|
|
@@ -19052,6 +19095,50 @@ var EventStoreFootprintSchema = object({
|
|
|
19052
19095
|
totalBytes: number().int(),
|
|
19053
19096
|
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
19054
19097
|
});
|
|
19098
|
+
/** Event-media footprint for one {@link MediaFileKind}. */
|
|
19099
|
+
var EventMediaKindFootprintSchema = object({
|
|
19100
|
+
kind: MediaFileKindEnum,
|
|
19101
|
+
/** Media rows of this kind. */
|
|
19102
|
+
rows: number().int(),
|
|
19103
|
+
/** Bytes on disk held by those rows. */
|
|
19104
|
+
bytes: number().int()
|
|
19105
|
+
});
|
|
19106
|
+
/**
|
|
19107
|
+
* The media footprint broken down by KIND — the axis a deletion decision
|
|
19108
|
+
* actually turns on.
|
|
19109
|
+
*
|
|
19110
|
+
* A byte total says how much there is; it cannot say what is safe to remove.
|
|
19111
|
+
* The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
|
|
19112
|
+
* motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
|
|
19113
|
+
* `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
|
|
19114
|
+
* buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
|
|
19115
|
+
* nothing else, so sizing a deletion means summing per kind.
|
|
19116
|
+
*
|
|
19117
|
+
* ## Why `unaccounted*` exists
|
|
19118
|
+
*
|
|
19119
|
+
* `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
|
|
19120
|
+
* writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
|
|
19121
|
+
* from a SEPARATE unfiltered aggregate over the same rows, never from adding
|
|
19122
|
+
* `kinds` up. A row whose stored `kind` is not in the enum (written by a
|
|
19123
|
+
* retired code path, or by a version that knew a kind this one does not) would
|
|
19124
|
+
* otherwise vanish from the total silently, and an operator would delete
|
|
19125
|
+
* against a denominator smaller than the disk.
|
|
19126
|
+
*
|
|
19127
|
+
* `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
|
|
19128
|
+
* zero; a non-zero value is a real finding and must be shown, not rounded away.
|
|
19129
|
+
*/
|
|
19130
|
+
var EventMediaKindBreakdownSchema = object({
|
|
19131
|
+
/** Every media row in scope, from one unfiltered aggregate. */
|
|
19132
|
+
totalRows: number().int(),
|
|
19133
|
+
/** Every media byte in scope, from that same aggregate. */
|
|
19134
|
+
totalBytes: number().int(),
|
|
19135
|
+
/** Per-kind footprint, ordered by bytes descending. */
|
|
19136
|
+
kinds: array(EventMediaKindFootprintSchema).readonly(),
|
|
19137
|
+
/** `totalRows` minus the summed `kinds` rows — see the schema note. */
|
|
19138
|
+
unaccountedRows: number().int(),
|
|
19139
|
+
/** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
|
|
19140
|
+
unaccountedBytes: number().int()
|
|
19141
|
+
});
|
|
19055
19142
|
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
19056
19143
|
var EventPruneCountsSchema = object({
|
|
19057
19144
|
motion: number().int(),
|
|
@@ -19255,6 +19342,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19255
19342
|
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
19256
19343
|
kind: "query",
|
|
19257
19344
|
auth: "admin"
|
|
19345
|
+
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
19346
|
+
kind: "query",
|
|
19347
|
+
auth: "admin"
|
|
19258
19348
|
}), method(object({
|
|
19259
19349
|
olderThanMs: number(),
|
|
19260
19350
|
reason: OpsLogReasonSchema.optional()
|
|
@@ -19394,6 +19484,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19394
19484
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
19395
19485
|
trackId: string(),
|
|
19396
19486
|
deviceId: number()
|
|
19487
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
19488
|
+
eventId: string(),
|
|
19489
|
+
deviceId: number()
|
|
19397
19490
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
19398
19491
|
kind: "mutation",
|
|
19399
19492
|
auth: "admin"
|
|
@@ -21203,6 +21296,20 @@ method(object({
|
|
|
21203
21296
|
error: string().optional()
|
|
21204
21297
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
21205
21298
|
providerId: string(),
|
|
21299
|
+
/**
|
|
21300
|
+
* The location this config is an UNSAVED edit of, when there is one.
|
|
21301
|
+
*
|
|
21302
|
+
* `listLocations` replaces every declared secret with the redaction
|
|
21303
|
+
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
21304
|
+
* credential the operator did not retype — and posting that here
|
|
21305
|
+
* without a way to resolve it makes the provider try to authenticate
|
|
21306
|
+
* as `__camstack_redacted__` and report the operator's own working
|
|
21307
|
+
* password as wrong. Given this id, the orchestrator restores each
|
|
21308
|
+
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
21309
|
+
* before dispatching. Omitted by the "Add location" wizard, where
|
|
21310
|
+
* every value was typed just now and nothing is stored yet.
|
|
21311
|
+
*/
|
|
21312
|
+
locationId: string().optional(),
|
|
21206
21313
|
config: record(string(), unknown())
|
|
21207
21314
|
}), object({
|
|
21208
21315
|
ok: boolean(),
|
|
@@ -24401,10 +24508,24 @@ var FaceClusterSchema = object({
|
|
|
24401
24508
|
size: number().int(),
|
|
24402
24509
|
cohesion: number()
|
|
24403
24510
|
});
|
|
24511
|
+
/**
|
|
24512
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
24513
|
+
* are — never the bytes.
|
|
24514
|
+
*
|
|
24515
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
24516
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
24517
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
24518
|
+
* caller is the admin UI's detail modal, which was building
|
|
24519
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
24520
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
24521
|
+
*
|
|
24522
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
24523
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
24524
|
+
*/
|
|
24404
24525
|
var MediaFileLiteSchema$1 = object({
|
|
24405
24526
|
key: string(),
|
|
24406
24527
|
kind: string(),
|
|
24407
|
-
|
|
24528
|
+
url: string(),
|
|
24408
24529
|
sizeBytes: number(),
|
|
24409
24530
|
timestamp: number()
|
|
24410
24531
|
});
|
|
@@ -27426,10 +27547,24 @@ var PlateInfoSchema = object({
|
|
|
27426
27547
|
*/
|
|
27427
27548
|
cropUrl: string().optional()
|
|
27428
27549
|
});
|
|
27550
|
+
/**
|
|
27551
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
27552
|
+
* are — never the bytes.
|
|
27553
|
+
*
|
|
27554
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
27555
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
27556
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
27557
|
+
* caller is the admin UI's detail modal, which was building
|
|
27558
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
27559
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
27560
|
+
*
|
|
27561
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
27562
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
27563
|
+
*/
|
|
27429
27564
|
var MediaFileLiteSchema = object({
|
|
27430
27565
|
key: string(),
|
|
27431
27566
|
kind: string(),
|
|
27432
|
-
|
|
27567
|
+
url: string(),
|
|
27433
27568
|
sizeBytes: number(),
|
|
27434
27569
|
timestamp: number()
|
|
27435
27570
|
});
|
|
@@ -35230,6 +35365,12 @@ Object.freeze({
|
|
|
35230
35365
|
addonId: null,
|
|
35231
35366
|
access: "view"
|
|
35232
35367
|
},
|
|
35368
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": {
|
|
35369
|
+
capName: "pipeline-analytics",
|
|
35370
|
+
capScope: "device",
|
|
35371
|
+
addonId: null,
|
|
35372
|
+
access: "view"
|
|
35373
|
+
},
|
|
35233
35374
|
"pipelineAnalytics.getEventStoreFootprint": {
|
|
35234
35375
|
capName: "pipeline-analytics",
|
|
35235
35376
|
capScope: "device",
|
|
@@ -35326,6 +35467,12 @@ Object.freeze({
|
|
|
35326
35467
|
addonId: null,
|
|
35327
35468
|
access: "view"
|
|
35328
35469
|
},
|
|
35470
|
+
"pipelineAnalytics.listEventMedia": {
|
|
35471
|
+
capName: "pipeline-analytics",
|
|
35472
|
+
capScope: "device",
|
|
35473
|
+
addonId: null,
|
|
35474
|
+
access: "view"
|
|
35475
|
+
},
|
|
35329
35476
|
"pipelineAnalytics.listGroups": {
|
|
35330
35477
|
capName: "pipeline-analytics",
|
|
35331
35478
|
capScope: "device",
|
|
@@ -38889,6 +39036,11 @@ Object.freeze({
|
|
|
38889
39036
|
form: "single",
|
|
38890
39037
|
optional: false
|
|
38891
39038
|
}],
|
|
39039
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": [{
|
|
39040
|
+
name: "deviceId",
|
|
39041
|
+
form: "single",
|
|
39042
|
+
optional: true
|
|
39043
|
+
}],
|
|
38892
39044
|
"pipelineAnalytics.getGroup": [{
|
|
38893
39045
|
name: "deviceId",
|
|
38894
39046
|
form: "single",
|
|
@@ -38949,6 +39101,11 @@ Object.freeze({
|
|
|
38949
39101
|
form: "array",
|
|
38950
39102
|
optional: false
|
|
38951
39103
|
}],
|
|
39104
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
39105
|
+
name: "deviceId",
|
|
39106
|
+
form: "single",
|
|
39107
|
+
optional: false
|
|
39108
|
+
}],
|
|
38952
39109
|
"pipelineAnalytics.listGroups": [{
|
|
38953
39110
|
name: "deviceIds",
|
|
38954
39111
|
form: "array",
|
package/dist/addon.mjs
CHANGED
|
@@ -13183,6 +13183,114 @@ method(object({
|
|
|
13183
13183
|
height: number()
|
|
13184
13184
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
13185
13185
|
/**
|
|
13186
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13187
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
13188
|
+
*
|
|
13189
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13190
|
+
*
|
|
13191
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13192
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13193
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13194
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13195
|
+
* somebody to forget to edit.
|
|
13196
|
+
*
|
|
13197
|
+
* They are not merged, because their invariants are opposites:
|
|
13198
|
+
*
|
|
13199
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13200
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13201
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13202
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13203
|
+
* and it is exactly what an absent entry cannot say.
|
|
13204
|
+
*
|
|
13205
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13206
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13207
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13208
|
+
* has no process.
|
|
13209
|
+
*
|
|
13210
|
+
* ## Why not a log line, since the counters already exist
|
|
13211
|
+
*
|
|
13212
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13213
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13214
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13215
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13216
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13217
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13218
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13219
|
+
* be READ.
|
|
13220
|
+
*
|
|
13221
|
+
* ## The rate is served with its denominator or not at all
|
|
13222
|
+
*
|
|
13223
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13224
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13225
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13226
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
13227
|
+
* reproduces that mistake on every read.
|
|
13228
|
+
*
|
|
13229
|
+
* ## Shape
|
|
13230
|
+
*
|
|
13231
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13232
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13233
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13234
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13235
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13236
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13237
|
+
* result through `system.getFailureContributions`.
|
|
13238
|
+
*/
|
|
13239
|
+
var FailureReasonCountSchema = object({
|
|
13240
|
+
/**
|
|
13241
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13242
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13243
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
13244
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
13245
|
+
* vocabulary for the same loss would make the row and the counter
|
|
13246
|
+
* un-joinable.
|
|
13247
|
+
*/
|
|
13248
|
+
reason: string(),
|
|
13249
|
+
count: number().int().nonnegative()
|
|
13250
|
+
});
|
|
13251
|
+
var FailureContributionSchema = object({
|
|
13252
|
+
/**
|
|
13253
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13254
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13255
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
13256
|
+
* is a central list that rots invisibly.
|
|
13257
|
+
*/
|
|
13258
|
+
family: string(),
|
|
13259
|
+
/**
|
|
13260
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13261
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13262
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
13263
|
+
* cannot answer the only question anybody asks of this surface.
|
|
13264
|
+
*/
|
|
13265
|
+
deviceId: number().int().positive(),
|
|
13266
|
+
/**
|
|
13267
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
13268
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13269
|
+
* family has a single variant.
|
|
13270
|
+
*/
|
|
13271
|
+
variant: string().optional(),
|
|
13272
|
+
/**
|
|
13273
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13274
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
13275
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13276
|
+
* `LoadContribution.startedAtMs`.
|
|
13277
|
+
*/
|
|
13278
|
+
sinceMs: number(),
|
|
13279
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13280
|
+
atMs: number(),
|
|
13281
|
+
/**
|
|
13282
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13283
|
+
* window. A failure count published without it is the mistake this schema
|
|
13284
|
+
* exists to make impossible.
|
|
13285
|
+
*/
|
|
13286
|
+
attempts: number().int().nonnegative(),
|
|
13287
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13288
|
+
succeeded: number().int().nonnegative(),
|
|
13289
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13290
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
13291
|
+
});
|
|
13292
|
+
method(_void(), array(FailureContributionSchema).readonly());
|
|
13293
|
+
/**
|
|
13186
13294
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
13187
13295
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
13188
13296
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -13704,6 +13812,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13704
13812
|
kind: "mutation",
|
|
13705
13813
|
auth: "admin"
|
|
13706
13814
|
});
|
|
13815
|
+
var LoadContributionSchema = object({
|
|
13816
|
+
role: _enum([
|
|
13817
|
+
"decode",
|
|
13818
|
+
"transcode",
|
|
13819
|
+
"recording",
|
|
13820
|
+
"streaming",
|
|
13821
|
+
"detection"
|
|
13822
|
+
]),
|
|
13823
|
+
/**
|
|
13824
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13825
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13826
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13827
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
13828
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13829
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
13830
|
+
*/
|
|
13831
|
+
deviceId: number().int().positive().nullable(),
|
|
13832
|
+
attribution: _enum([
|
|
13833
|
+
"measured",
|
|
13834
|
+
"accounted",
|
|
13835
|
+
"unattributable"
|
|
13836
|
+
]),
|
|
13837
|
+
/**
|
|
13838
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13839
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13840
|
+
* family and inventing a common one would lose the only information that
|
|
13841
|
+
* makes two entries for the same camera distinguishable.
|
|
13842
|
+
*/
|
|
13843
|
+
unit: string(),
|
|
13844
|
+
/**
|
|
13845
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
13846
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
13847
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
13848
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13849
|
+
* process of its own.
|
|
13850
|
+
*/
|
|
13851
|
+
pid: number().int().positive().optional(),
|
|
13852
|
+
/**
|
|
13853
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
13854
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13855
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
13856
|
+
* process.
|
|
13857
|
+
*/
|
|
13858
|
+
startedAtMs: number().optional(),
|
|
13859
|
+
/**
|
|
13860
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13861
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13862
|
+
* contribution is asked for.
|
|
13863
|
+
*
|
|
13864
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13865
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13866
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13867
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13868
|
+
*
|
|
13869
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13870
|
+
* an entry with no process.
|
|
13871
|
+
*/
|
|
13872
|
+
cpuSeconds: number().optional(),
|
|
13873
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13874
|
+
rssBytes: number().optional()
|
|
13875
|
+
});
|
|
13876
|
+
method(_void(), array(LoadContributionSchema).readonly());
|
|
13707
13877
|
/**
|
|
13708
13878
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13709
13879
|
* through. It stores nothing.
|
|
@@ -13780,176 +13950,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
13780
13950
|
tags: record(string(), string()).optional()
|
|
13781
13951
|
}), array(LogEntrySchema).readonly());
|
|
13782
13952
|
/**
|
|
13783
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13784
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
13785
|
-
*
|
|
13786
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13787
|
-
*
|
|
13788
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13789
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13790
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13791
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13792
|
-
* somebody to forget to edit.
|
|
13793
|
-
*
|
|
13794
|
-
* They are not merged, because their invariants are opposites:
|
|
13795
|
-
*
|
|
13796
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13797
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13798
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13799
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13800
|
-
* and it is exactly what an absent entry cannot say.
|
|
13801
|
-
*
|
|
13802
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13803
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13804
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13805
|
-
* has no process.
|
|
13806
|
-
*
|
|
13807
|
-
* ## Why not a log line, since the counters already exist
|
|
13808
|
-
*
|
|
13809
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13810
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13811
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13812
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13813
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13814
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13815
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13816
|
-
* be READ.
|
|
13817
|
-
*
|
|
13818
|
-
* ## The rate is served with its denominator or not at all
|
|
13819
|
-
*
|
|
13820
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13821
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13822
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13823
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
13824
|
-
* reproduces that mistake on every read.
|
|
13825
|
-
*
|
|
13826
|
-
* ## Shape
|
|
13827
|
-
*
|
|
13828
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13829
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13830
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13831
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13832
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13833
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13834
|
-
* result through `system.getFailureContributions`.
|
|
13835
|
-
*/
|
|
13836
|
-
var FailureReasonCountSchema = object({
|
|
13837
|
-
/**
|
|
13838
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13839
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13840
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
13841
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
13842
|
-
* vocabulary for the same loss would make the row and the counter
|
|
13843
|
-
* un-joinable.
|
|
13844
|
-
*/
|
|
13845
|
-
reason: string(),
|
|
13846
|
-
count: number().int().nonnegative()
|
|
13847
|
-
});
|
|
13848
|
-
var FailureContributionSchema = object({
|
|
13849
|
-
/**
|
|
13850
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13851
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13852
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
13853
|
-
* is a central list that rots invisibly.
|
|
13854
|
-
*/
|
|
13855
|
-
family: string(),
|
|
13856
|
-
/**
|
|
13857
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13858
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13859
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
13860
|
-
* cannot answer the only question anybody asks of this surface.
|
|
13861
|
-
*/
|
|
13862
|
-
deviceId: number().int().positive(),
|
|
13863
|
-
/**
|
|
13864
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
13865
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13866
|
-
* family has a single variant.
|
|
13867
|
-
*/
|
|
13868
|
-
variant: string().optional(),
|
|
13869
|
-
/**
|
|
13870
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13871
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
13872
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13873
|
-
* `LoadContribution.startedAtMs`.
|
|
13874
|
-
*/
|
|
13875
|
-
sinceMs: number(),
|
|
13876
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13877
|
-
atMs: number(),
|
|
13878
|
-
/**
|
|
13879
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13880
|
-
* window. A failure count published without it is the mistake this schema
|
|
13881
|
-
* exists to make impossible.
|
|
13882
|
-
*/
|
|
13883
|
-
attempts: number().int().nonnegative(),
|
|
13884
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13885
|
-
succeeded: number().int().nonnegative(),
|
|
13886
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13887
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
13888
|
-
});
|
|
13889
|
-
method(_void(), array(FailureContributionSchema).readonly());
|
|
13890
|
-
var LoadContributionSchema = object({
|
|
13891
|
-
role: _enum([
|
|
13892
|
-
"decode",
|
|
13893
|
-
"transcode",
|
|
13894
|
-
"recording",
|
|
13895
|
-
"streaming",
|
|
13896
|
-
"detection"
|
|
13897
|
-
]),
|
|
13898
|
-
/**
|
|
13899
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13900
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13901
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13902
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
13903
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13904
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
13905
|
-
*/
|
|
13906
|
-
deviceId: number().int().positive().nullable(),
|
|
13907
|
-
attribution: _enum([
|
|
13908
|
-
"measured",
|
|
13909
|
-
"accounted",
|
|
13910
|
-
"unattributable"
|
|
13911
|
-
]),
|
|
13912
|
-
/**
|
|
13913
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13914
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13915
|
-
* family and inventing a common one would lose the only information that
|
|
13916
|
-
* makes two entries for the same camera distinguishable.
|
|
13917
|
-
*/
|
|
13918
|
-
unit: string(),
|
|
13919
|
-
/**
|
|
13920
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
13921
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
13922
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
13923
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13924
|
-
* process of its own.
|
|
13925
|
-
*/
|
|
13926
|
-
pid: number().int().positive().optional(),
|
|
13927
|
-
/**
|
|
13928
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
13929
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13930
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
13931
|
-
* process.
|
|
13932
|
-
*/
|
|
13933
|
-
startedAtMs: number().optional(),
|
|
13934
|
-
/**
|
|
13935
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13936
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13937
|
-
* contribution is asked for.
|
|
13938
|
-
*
|
|
13939
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13940
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13941
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13942
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13943
|
-
*
|
|
13944
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13945
|
-
* an entry with no process.
|
|
13946
|
-
*/
|
|
13947
|
-
cpuSeconds: number().optional(),
|
|
13948
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13949
|
-
rssBytes: number().optional()
|
|
13950
|
-
});
|
|
13951
|
-
method(_void(), array(LoadContributionSchema).readonly());
|
|
13952
|
-
/**
|
|
13953
13953
|
* `login-method` — collection cap through which auth addons contribute
|
|
13954
13954
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
13955
13955
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -18687,12 +18687,53 @@ var MediaFileKindEnum = _enum([
|
|
|
18687
18687
|
"keyFrameSmall",
|
|
18688
18688
|
"thumbnailSmall"
|
|
18689
18689
|
]);
|
|
18690
|
+
/**
|
|
18691
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
18692
|
+
* ARE — never the bytes themselves.
|
|
18693
|
+
*
|
|
18694
|
+
* ## Why `url` and not `base64`
|
|
18695
|
+
*
|
|
18696
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
18697
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
18698
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
18699
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
18700
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
18701
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
18702
|
+
*
|
|
18703
|
+
* `url` points at the `event-media` data plane
|
|
18704
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
18705
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
18706
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
18707
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
18708
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
18709
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
18710
|
+
* (per-device scoping).
|
|
18711
|
+
*
|
|
18712
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
18713
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
18714
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
18715
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
18716
|
+
*
|
|
18717
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
18718
|
+
*
|
|
18719
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
18720
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
18721
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
18722
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
18723
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
18724
|
+
* delete this line and the `withBytes` pass-through in
|
|
18725
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
18726
|
+
*/
|
|
18690
18727
|
var MediaFileSchema = object({
|
|
18691
18728
|
key: string(),
|
|
18692
18729
|
kind: MediaFileKindEnum,
|
|
18693
|
-
base64: string(),
|
|
18694
18730
|
sizeBytes: number(),
|
|
18695
18731
|
timestamp: number()
|
|
18732
|
+
}).extend({
|
|
18733
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
18734
|
+
url: string(),
|
|
18735
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
18736
|
+
base64: string()
|
|
18696
18737
|
});
|
|
18697
18738
|
/**
|
|
18698
18739
|
* One media row WITHOUT its bytes.
|
|
@@ -18704,7 +18745,9 @@ var MediaFileSchema = object({
|
|
|
18704
18745
|
* blocks the whole view.
|
|
18705
18746
|
*
|
|
18706
18747
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
18707
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
18748
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
18749
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
18750
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
18708
18751
|
*/
|
|
18709
18752
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
18710
18753
|
/**
|
|
@@ -19051,6 +19094,50 @@ var EventStoreFootprintSchema = object({
|
|
|
19051
19094
|
totalBytes: number().int(),
|
|
19052
19095
|
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
19053
19096
|
});
|
|
19097
|
+
/** Event-media footprint for one {@link MediaFileKind}. */
|
|
19098
|
+
var EventMediaKindFootprintSchema = object({
|
|
19099
|
+
kind: MediaFileKindEnum,
|
|
19100
|
+
/** Media rows of this kind. */
|
|
19101
|
+
rows: number().int(),
|
|
19102
|
+
/** Bytes on disk held by those rows. */
|
|
19103
|
+
bytes: number().int()
|
|
19104
|
+
});
|
|
19105
|
+
/**
|
|
19106
|
+
* The media footprint broken down by KIND — the axis a deletion decision
|
|
19107
|
+
* actually turns on.
|
|
19108
|
+
*
|
|
19109
|
+
* A byte total says how much there is; it cannot say what is safe to remove.
|
|
19110
|
+
* The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
|
|
19111
|
+
* motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
|
|
19112
|
+
* `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
|
|
19113
|
+
* buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
|
|
19114
|
+
* nothing else, so sizing a deletion means summing per kind.
|
|
19115
|
+
*
|
|
19116
|
+
* ## Why `unaccounted*` exists
|
|
19117
|
+
*
|
|
19118
|
+
* `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
|
|
19119
|
+
* writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
|
|
19120
|
+
* from a SEPARATE unfiltered aggregate over the same rows, never from adding
|
|
19121
|
+
* `kinds` up. A row whose stored `kind` is not in the enum (written by a
|
|
19122
|
+
* retired code path, or by a version that knew a kind this one does not) would
|
|
19123
|
+
* otherwise vanish from the total silently, and an operator would delete
|
|
19124
|
+
* against a denominator smaller than the disk.
|
|
19125
|
+
*
|
|
19126
|
+
* `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
|
|
19127
|
+
* zero; a non-zero value is a real finding and must be shown, not rounded away.
|
|
19128
|
+
*/
|
|
19129
|
+
var EventMediaKindBreakdownSchema = object({
|
|
19130
|
+
/** Every media row in scope, from one unfiltered aggregate. */
|
|
19131
|
+
totalRows: number().int(),
|
|
19132
|
+
/** Every media byte in scope, from that same aggregate. */
|
|
19133
|
+
totalBytes: number().int(),
|
|
19134
|
+
/** Per-kind footprint, ordered by bytes descending. */
|
|
19135
|
+
kinds: array(EventMediaKindFootprintSchema).readonly(),
|
|
19136
|
+
/** `totalRows` minus the summed `kinds` rows — see the schema note. */
|
|
19137
|
+
unaccountedRows: number().int(),
|
|
19138
|
+
/** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
|
|
19139
|
+
unaccountedBytes: number().int()
|
|
19140
|
+
});
|
|
19054
19141
|
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
19055
19142
|
var EventPruneCountsSchema = object({
|
|
19056
19143
|
motion: number().int(),
|
|
@@ -19254,6 +19341,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19254
19341
|
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
19255
19342
|
kind: "query",
|
|
19256
19343
|
auth: "admin"
|
|
19344
|
+
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
19345
|
+
kind: "query",
|
|
19346
|
+
auth: "admin"
|
|
19257
19347
|
}), method(object({
|
|
19258
19348
|
olderThanMs: number(),
|
|
19259
19349
|
reason: OpsLogReasonSchema.optional()
|
|
@@ -19393,6 +19483,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19393
19483
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
19394
19484
|
trackId: string(),
|
|
19395
19485
|
deviceId: number()
|
|
19486
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
19487
|
+
eventId: string(),
|
|
19488
|
+
deviceId: number()
|
|
19396
19489
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
19397
19490
|
kind: "mutation",
|
|
19398
19491
|
auth: "admin"
|
|
@@ -21202,6 +21295,20 @@ method(object({
|
|
|
21202
21295
|
error: string().optional()
|
|
21203
21296
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
21204
21297
|
providerId: string(),
|
|
21298
|
+
/**
|
|
21299
|
+
* The location this config is an UNSAVED edit of, when there is one.
|
|
21300
|
+
*
|
|
21301
|
+
* `listLocations` replaces every declared secret with the redaction
|
|
21302
|
+
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
21303
|
+
* credential the operator did not retype — and posting that here
|
|
21304
|
+
* without a way to resolve it makes the provider try to authenticate
|
|
21305
|
+
* as `__camstack_redacted__` and report the operator's own working
|
|
21306
|
+
* password as wrong. Given this id, the orchestrator restores each
|
|
21307
|
+
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
21308
|
+
* before dispatching. Omitted by the "Add location" wizard, where
|
|
21309
|
+
* every value was typed just now and nothing is stored yet.
|
|
21310
|
+
*/
|
|
21311
|
+
locationId: string().optional(),
|
|
21205
21312
|
config: record(string(), unknown())
|
|
21206
21313
|
}), object({
|
|
21207
21314
|
ok: boolean(),
|
|
@@ -24400,10 +24507,24 @@ var FaceClusterSchema = object({
|
|
|
24400
24507
|
size: number().int(),
|
|
24401
24508
|
cohesion: number()
|
|
24402
24509
|
});
|
|
24510
|
+
/**
|
|
24511
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
24512
|
+
* are — never the bytes.
|
|
24513
|
+
*
|
|
24514
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
24515
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
24516
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
24517
|
+
* caller is the admin UI's detail modal, which was building
|
|
24518
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
24519
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
24520
|
+
*
|
|
24521
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
24522
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
24523
|
+
*/
|
|
24403
24524
|
var MediaFileLiteSchema$1 = object({
|
|
24404
24525
|
key: string(),
|
|
24405
24526
|
kind: string(),
|
|
24406
|
-
|
|
24527
|
+
url: string(),
|
|
24407
24528
|
sizeBytes: number(),
|
|
24408
24529
|
timestamp: number()
|
|
24409
24530
|
});
|
|
@@ -27425,10 +27546,24 @@ var PlateInfoSchema = object({
|
|
|
27425
27546
|
*/
|
|
27426
27547
|
cropUrl: string().optional()
|
|
27427
27548
|
});
|
|
27549
|
+
/**
|
|
27550
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
27551
|
+
* are — never the bytes.
|
|
27552
|
+
*
|
|
27553
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
27554
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
27555
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
27556
|
+
* caller is the admin UI's detail modal, which was building
|
|
27557
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
27558
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
27559
|
+
*
|
|
27560
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
27561
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
27562
|
+
*/
|
|
27428
27563
|
var MediaFileLiteSchema = object({
|
|
27429
27564
|
key: string(),
|
|
27430
27565
|
kind: string(),
|
|
27431
|
-
|
|
27566
|
+
url: string(),
|
|
27432
27567
|
sizeBytes: number(),
|
|
27433
27568
|
timestamp: number()
|
|
27434
27569
|
});
|
|
@@ -35229,6 +35364,12 @@ Object.freeze({
|
|
|
35229
35364
|
addonId: null,
|
|
35230
35365
|
access: "view"
|
|
35231
35366
|
},
|
|
35367
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": {
|
|
35368
|
+
capName: "pipeline-analytics",
|
|
35369
|
+
capScope: "device",
|
|
35370
|
+
addonId: null,
|
|
35371
|
+
access: "view"
|
|
35372
|
+
},
|
|
35232
35373
|
"pipelineAnalytics.getEventStoreFootprint": {
|
|
35233
35374
|
capName: "pipeline-analytics",
|
|
35234
35375
|
capScope: "device",
|
|
@@ -35325,6 +35466,12 @@ Object.freeze({
|
|
|
35325
35466
|
addonId: null,
|
|
35326
35467
|
access: "view"
|
|
35327
35468
|
},
|
|
35469
|
+
"pipelineAnalytics.listEventMedia": {
|
|
35470
|
+
capName: "pipeline-analytics",
|
|
35471
|
+
capScope: "device",
|
|
35472
|
+
addonId: null,
|
|
35473
|
+
access: "view"
|
|
35474
|
+
},
|
|
35328
35475
|
"pipelineAnalytics.listGroups": {
|
|
35329
35476
|
capName: "pipeline-analytics",
|
|
35330
35477
|
capScope: "device",
|
|
@@ -38888,6 +39035,11 @@ Object.freeze({
|
|
|
38888
39035
|
form: "single",
|
|
38889
39036
|
optional: false
|
|
38890
39037
|
}],
|
|
39038
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": [{
|
|
39039
|
+
name: "deviceId",
|
|
39040
|
+
form: "single",
|
|
39041
|
+
optional: true
|
|
39042
|
+
}],
|
|
38891
39043
|
"pipelineAnalytics.getGroup": [{
|
|
38892
39044
|
name: "deviceId",
|
|
38893
39045
|
form: "single",
|
|
@@ -38948,6 +39100,11 @@ Object.freeze({
|
|
|
38948
39100
|
form: "array",
|
|
38949
39101
|
optional: false
|
|
38950
39102
|
}],
|
|
39103
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
39104
|
+
name: "deviceId",
|
|
39105
|
+
form: "single",
|
|
39106
|
+
optional: false
|
|
39107
|
+
}],
|
|
38951
39108
|
"pipelineAnalytics.listGroups": [{
|
|
38952
39109
|
name: "deviceIds",
|
|
38953
39110
|
form: "array",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-unifi",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.48",
|
|
4
4
|
"description": "UniFi Network controller device-provider addon for CamStack — local-controller infra switches/APs (as containers) + network-client presence. NO cameras/Protect.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|