@camstack/addon-provider-gree 0.2.45 → 0.2.46
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 +259 -174
- package/dist/addon.mjs +259 -174
- package/package.json +1 -1
package/dist/addon.js
CHANGED
|
@@ -13187,6 +13187,114 @@ method(object({
|
|
|
13187
13187
|
height: number()
|
|
13188
13188
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
13189
13189
|
/**
|
|
13190
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13191
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
13192
|
+
*
|
|
13193
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13194
|
+
*
|
|
13195
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13196
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13197
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13198
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13199
|
+
* somebody to forget to edit.
|
|
13200
|
+
*
|
|
13201
|
+
* They are not merged, because their invariants are opposites:
|
|
13202
|
+
*
|
|
13203
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13204
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13205
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13206
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13207
|
+
* and it is exactly what an absent entry cannot say.
|
|
13208
|
+
*
|
|
13209
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13210
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13211
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13212
|
+
* has no process.
|
|
13213
|
+
*
|
|
13214
|
+
* ## Why not a log line, since the counters already exist
|
|
13215
|
+
*
|
|
13216
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13217
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13218
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13219
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13220
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13221
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13222
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13223
|
+
* be READ.
|
|
13224
|
+
*
|
|
13225
|
+
* ## The rate is served with its denominator or not at all
|
|
13226
|
+
*
|
|
13227
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13228
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13229
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13230
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
13231
|
+
* reproduces that mistake on every read.
|
|
13232
|
+
*
|
|
13233
|
+
* ## Shape
|
|
13234
|
+
*
|
|
13235
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13236
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13237
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13238
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13239
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13240
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13241
|
+
* result through `system.getFailureContributions`.
|
|
13242
|
+
*/
|
|
13243
|
+
var FailureReasonCountSchema = object({
|
|
13244
|
+
/**
|
|
13245
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13246
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13247
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
13248
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
13249
|
+
* vocabulary for the same loss would make the row and the counter
|
|
13250
|
+
* un-joinable.
|
|
13251
|
+
*/
|
|
13252
|
+
reason: string(),
|
|
13253
|
+
count: number().int().nonnegative()
|
|
13254
|
+
});
|
|
13255
|
+
var FailureContributionSchema = object({
|
|
13256
|
+
/**
|
|
13257
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13258
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13259
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
13260
|
+
* is a central list that rots invisibly.
|
|
13261
|
+
*/
|
|
13262
|
+
family: string(),
|
|
13263
|
+
/**
|
|
13264
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13265
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13266
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
13267
|
+
* cannot answer the only question anybody asks of this surface.
|
|
13268
|
+
*/
|
|
13269
|
+
deviceId: number().int().positive(),
|
|
13270
|
+
/**
|
|
13271
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
13272
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13273
|
+
* family has a single variant.
|
|
13274
|
+
*/
|
|
13275
|
+
variant: string().optional(),
|
|
13276
|
+
/**
|
|
13277
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13278
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
13279
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13280
|
+
* `LoadContribution.startedAtMs`.
|
|
13281
|
+
*/
|
|
13282
|
+
sinceMs: number(),
|
|
13283
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13284
|
+
atMs: number(),
|
|
13285
|
+
/**
|
|
13286
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13287
|
+
* window. A failure count published without it is the mistake this schema
|
|
13288
|
+
* exists to make impossible.
|
|
13289
|
+
*/
|
|
13290
|
+
attempts: number().int().nonnegative(),
|
|
13291
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13292
|
+
succeeded: number().int().nonnegative(),
|
|
13293
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13294
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
13295
|
+
});
|
|
13296
|
+
method(_void(), array(FailureContributionSchema).readonly());
|
|
13297
|
+
/**
|
|
13190
13298
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
13191
13299
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
13192
13300
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -13708,6 +13816,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13708
13816
|
kind: "mutation",
|
|
13709
13817
|
auth: "admin"
|
|
13710
13818
|
});
|
|
13819
|
+
var LoadContributionSchema = object({
|
|
13820
|
+
role: _enum([
|
|
13821
|
+
"decode",
|
|
13822
|
+
"transcode",
|
|
13823
|
+
"recording",
|
|
13824
|
+
"streaming",
|
|
13825
|
+
"detection"
|
|
13826
|
+
]),
|
|
13827
|
+
/**
|
|
13828
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13829
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13830
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13831
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
13832
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13833
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
13834
|
+
*/
|
|
13835
|
+
deviceId: number().int().positive().nullable(),
|
|
13836
|
+
attribution: _enum([
|
|
13837
|
+
"measured",
|
|
13838
|
+
"accounted",
|
|
13839
|
+
"unattributable"
|
|
13840
|
+
]),
|
|
13841
|
+
/**
|
|
13842
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13843
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13844
|
+
* family and inventing a common one would lose the only information that
|
|
13845
|
+
* makes two entries for the same camera distinguishable.
|
|
13846
|
+
*/
|
|
13847
|
+
unit: string(),
|
|
13848
|
+
/**
|
|
13849
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
13850
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
13851
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
13852
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13853
|
+
* process of its own.
|
|
13854
|
+
*/
|
|
13855
|
+
pid: number().int().positive().optional(),
|
|
13856
|
+
/**
|
|
13857
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
13858
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13859
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
13860
|
+
* process.
|
|
13861
|
+
*/
|
|
13862
|
+
startedAtMs: number().optional(),
|
|
13863
|
+
/**
|
|
13864
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13865
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13866
|
+
* contribution is asked for.
|
|
13867
|
+
*
|
|
13868
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13869
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13870
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13871
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13872
|
+
*
|
|
13873
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13874
|
+
* an entry with no process.
|
|
13875
|
+
*/
|
|
13876
|
+
cpuSeconds: number().optional(),
|
|
13877
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13878
|
+
rssBytes: number().optional()
|
|
13879
|
+
});
|
|
13880
|
+
method(_void(), array(LoadContributionSchema).readonly());
|
|
13711
13881
|
/**
|
|
13712
13882
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13713
13883
|
* through. It stores nothing.
|
|
@@ -13784,176 +13954,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
13784
13954
|
tags: record(string(), string()).optional()
|
|
13785
13955
|
}), array(LogEntrySchema).readonly());
|
|
13786
13956
|
/**
|
|
13787
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13788
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
13789
|
-
*
|
|
13790
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13791
|
-
*
|
|
13792
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13793
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13794
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13795
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13796
|
-
* somebody to forget to edit.
|
|
13797
|
-
*
|
|
13798
|
-
* They are not merged, because their invariants are opposites:
|
|
13799
|
-
*
|
|
13800
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13801
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13802
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13803
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13804
|
-
* and it is exactly what an absent entry cannot say.
|
|
13805
|
-
*
|
|
13806
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13807
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13808
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13809
|
-
* has no process.
|
|
13810
|
-
*
|
|
13811
|
-
* ## Why not a log line, since the counters already exist
|
|
13812
|
-
*
|
|
13813
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13814
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13815
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13816
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13817
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13818
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13819
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13820
|
-
* be READ.
|
|
13821
|
-
*
|
|
13822
|
-
* ## The rate is served with its denominator or not at all
|
|
13823
|
-
*
|
|
13824
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13825
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13826
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13827
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
13828
|
-
* reproduces that mistake on every read.
|
|
13829
|
-
*
|
|
13830
|
-
* ## Shape
|
|
13831
|
-
*
|
|
13832
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13833
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13834
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13835
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13836
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13837
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13838
|
-
* result through `system.getFailureContributions`.
|
|
13839
|
-
*/
|
|
13840
|
-
var FailureReasonCountSchema = object({
|
|
13841
|
-
/**
|
|
13842
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13843
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13844
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
13845
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
13846
|
-
* vocabulary for the same loss would make the row and the counter
|
|
13847
|
-
* un-joinable.
|
|
13848
|
-
*/
|
|
13849
|
-
reason: string(),
|
|
13850
|
-
count: number().int().nonnegative()
|
|
13851
|
-
});
|
|
13852
|
-
var FailureContributionSchema = object({
|
|
13853
|
-
/**
|
|
13854
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13855
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13856
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
13857
|
-
* is a central list that rots invisibly.
|
|
13858
|
-
*/
|
|
13859
|
-
family: string(),
|
|
13860
|
-
/**
|
|
13861
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13862
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13863
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
13864
|
-
* cannot answer the only question anybody asks of this surface.
|
|
13865
|
-
*/
|
|
13866
|
-
deviceId: number().int().positive(),
|
|
13867
|
-
/**
|
|
13868
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
13869
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13870
|
-
* family has a single variant.
|
|
13871
|
-
*/
|
|
13872
|
-
variant: string().optional(),
|
|
13873
|
-
/**
|
|
13874
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13875
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
13876
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13877
|
-
* `LoadContribution.startedAtMs`.
|
|
13878
|
-
*/
|
|
13879
|
-
sinceMs: number(),
|
|
13880
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13881
|
-
atMs: number(),
|
|
13882
|
-
/**
|
|
13883
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13884
|
-
* window. A failure count published without it is the mistake this schema
|
|
13885
|
-
* exists to make impossible.
|
|
13886
|
-
*/
|
|
13887
|
-
attempts: number().int().nonnegative(),
|
|
13888
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13889
|
-
succeeded: number().int().nonnegative(),
|
|
13890
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13891
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
13892
|
-
});
|
|
13893
|
-
method(_void(), array(FailureContributionSchema).readonly());
|
|
13894
|
-
var LoadContributionSchema = object({
|
|
13895
|
-
role: _enum([
|
|
13896
|
-
"decode",
|
|
13897
|
-
"transcode",
|
|
13898
|
-
"recording",
|
|
13899
|
-
"streaming",
|
|
13900
|
-
"detection"
|
|
13901
|
-
]),
|
|
13902
|
-
/**
|
|
13903
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13904
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13905
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13906
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
13907
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13908
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
13909
|
-
*/
|
|
13910
|
-
deviceId: number().int().positive().nullable(),
|
|
13911
|
-
attribution: _enum([
|
|
13912
|
-
"measured",
|
|
13913
|
-
"accounted",
|
|
13914
|
-
"unattributable"
|
|
13915
|
-
]),
|
|
13916
|
-
/**
|
|
13917
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13918
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13919
|
-
* family and inventing a common one would lose the only information that
|
|
13920
|
-
* makes two entries for the same camera distinguishable.
|
|
13921
|
-
*/
|
|
13922
|
-
unit: string(),
|
|
13923
|
-
/**
|
|
13924
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
13925
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
13926
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
13927
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13928
|
-
* process of its own.
|
|
13929
|
-
*/
|
|
13930
|
-
pid: number().int().positive().optional(),
|
|
13931
|
-
/**
|
|
13932
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
13933
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13934
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
13935
|
-
* process.
|
|
13936
|
-
*/
|
|
13937
|
-
startedAtMs: number().optional(),
|
|
13938
|
-
/**
|
|
13939
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13940
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13941
|
-
* contribution is asked for.
|
|
13942
|
-
*
|
|
13943
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13944
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13945
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13946
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13947
|
-
*
|
|
13948
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13949
|
-
* an entry with no process.
|
|
13950
|
-
*/
|
|
13951
|
-
cpuSeconds: number().optional(),
|
|
13952
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13953
|
-
rssBytes: number().optional()
|
|
13954
|
-
});
|
|
13955
|
-
method(_void(), array(LoadContributionSchema).readonly());
|
|
13956
|
-
/**
|
|
13957
13957
|
* `login-method` — collection cap through which auth addons contribute
|
|
13958
13958
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
13959
13959
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -18691,12 +18691,53 @@ var MediaFileKindEnum = _enum([
|
|
|
18691
18691
|
"keyFrameSmall",
|
|
18692
18692
|
"thumbnailSmall"
|
|
18693
18693
|
]);
|
|
18694
|
+
/**
|
|
18695
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
18696
|
+
* ARE — never the bytes themselves.
|
|
18697
|
+
*
|
|
18698
|
+
* ## Why `url` and not `base64`
|
|
18699
|
+
*
|
|
18700
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
18701
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
18702
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
18703
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
18704
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
18705
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
18706
|
+
*
|
|
18707
|
+
* `url` points at the `event-media` data plane
|
|
18708
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
18709
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
18710
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
18711
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
18712
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
18713
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
18714
|
+
* (per-device scoping).
|
|
18715
|
+
*
|
|
18716
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
18717
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
18718
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
18719
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
18720
|
+
*
|
|
18721
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
18722
|
+
*
|
|
18723
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
18724
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
18725
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
18726
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
18727
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
18728
|
+
* delete this line and the `withBytes` pass-through in
|
|
18729
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
18730
|
+
*/
|
|
18694
18731
|
var MediaFileSchema = object({
|
|
18695
18732
|
key: string(),
|
|
18696
18733
|
kind: MediaFileKindEnum,
|
|
18697
|
-
base64: string(),
|
|
18698
18734
|
sizeBytes: number(),
|
|
18699
18735
|
timestamp: number()
|
|
18736
|
+
}).extend({
|
|
18737
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
18738
|
+
url: string(),
|
|
18739
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
18740
|
+
base64: string()
|
|
18700
18741
|
});
|
|
18701
18742
|
/**
|
|
18702
18743
|
* One media row WITHOUT its bytes.
|
|
@@ -18708,7 +18749,9 @@ var MediaFileSchema = object({
|
|
|
18708
18749
|
* blocks the whole view.
|
|
18709
18750
|
*
|
|
18710
18751
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
18711
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
18752
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
18753
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
18754
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
18712
18755
|
*/
|
|
18713
18756
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
18714
18757
|
/**
|
|
@@ -19397,6 +19440,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19397
19440
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
19398
19441
|
trackId: string(),
|
|
19399
19442
|
deviceId: number()
|
|
19443
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
19444
|
+
eventId: string(),
|
|
19445
|
+
deviceId: number()
|
|
19400
19446
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
19401
19447
|
kind: "mutation",
|
|
19402
19448
|
auth: "admin"
|
|
@@ -24387,10 +24433,24 @@ var FaceClusterSchema = object({
|
|
|
24387
24433
|
size: number().int(),
|
|
24388
24434
|
cohesion: number()
|
|
24389
24435
|
});
|
|
24436
|
+
/**
|
|
24437
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
24438
|
+
* are — never the bytes.
|
|
24439
|
+
*
|
|
24440
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
24441
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
24442
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
24443
|
+
* caller is the admin UI's detail modal, which was building
|
|
24444
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
24445
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
24446
|
+
*
|
|
24447
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
24448
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
24449
|
+
*/
|
|
24390
24450
|
var MediaFileLiteSchema$1 = object({
|
|
24391
24451
|
key: string(),
|
|
24392
24452
|
kind: string(),
|
|
24393
|
-
|
|
24453
|
+
url: string(),
|
|
24394
24454
|
sizeBytes: number(),
|
|
24395
24455
|
timestamp: number()
|
|
24396
24456
|
});
|
|
@@ -27412,10 +27472,24 @@ var PlateInfoSchema = object({
|
|
|
27412
27472
|
*/
|
|
27413
27473
|
cropUrl: string().optional()
|
|
27414
27474
|
});
|
|
27475
|
+
/**
|
|
27476
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
27477
|
+
* are — never the bytes.
|
|
27478
|
+
*
|
|
27479
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
27480
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
27481
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
27482
|
+
* caller is the admin UI's detail modal, which was building
|
|
27483
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
27484
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
27485
|
+
*
|
|
27486
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
27487
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
27488
|
+
*/
|
|
27415
27489
|
var MediaFileLiteSchema = object({
|
|
27416
27490
|
key: string(),
|
|
27417
27491
|
kind: string(),
|
|
27418
|
-
|
|
27492
|
+
url: string(),
|
|
27419
27493
|
sizeBytes: number(),
|
|
27420
27494
|
timestamp: number()
|
|
27421
27495
|
});
|
|
@@ -35312,6 +35386,12 @@ Object.freeze({
|
|
|
35312
35386
|
addonId: null,
|
|
35313
35387
|
access: "view"
|
|
35314
35388
|
},
|
|
35389
|
+
"pipelineAnalytics.listEventMedia": {
|
|
35390
|
+
capName: "pipeline-analytics",
|
|
35391
|
+
capScope: "device",
|
|
35392
|
+
addonId: null,
|
|
35393
|
+
access: "view"
|
|
35394
|
+
},
|
|
35315
35395
|
"pipelineAnalytics.listGroups": {
|
|
35316
35396
|
capName: "pipeline-analytics",
|
|
35317
35397
|
capScope: "device",
|
|
@@ -38935,6 +39015,11 @@ Object.freeze({
|
|
|
38935
39015
|
form: "array",
|
|
38936
39016
|
optional: false
|
|
38937
39017
|
}],
|
|
39018
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
39019
|
+
name: "deviceId",
|
|
39020
|
+
form: "single",
|
|
39021
|
+
optional: false
|
|
39022
|
+
}],
|
|
38938
39023
|
"pipelineAnalytics.listGroups": [{
|
|
38939
39024
|
name: "deviceIds",
|
|
38940
39025
|
form: "array",
|
package/dist/addon.mjs
CHANGED
|
@@ -13186,6 +13186,114 @@ method(object({
|
|
|
13186
13186
|
height: number()
|
|
13187
13187
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
13188
13188
|
/**
|
|
13189
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13190
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
13191
|
+
*
|
|
13192
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13193
|
+
*
|
|
13194
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13195
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13196
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13197
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13198
|
+
* somebody to forget to edit.
|
|
13199
|
+
*
|
|
13200
|
+
* They are not merged, because their invariants are opposites:
|
|
13201
|
+
*
|
|
13202
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13203
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13204
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13205
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13206
|
+
* and it is exactly what an absent entry cannot say.
|
|
13207
|
+
*
|
|
13208
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13209
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13210
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13211
|
+
* has no process.
|
|
13212
|
+
*
|
|
13213
|
+
* ## Why not a log line, since the counters already exist
|
|
13214
|
+
*
|
|
13215
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13216
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13217
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13218
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13219
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13220
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13221
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13222
|
+
* be READ.
|
|
13223
|
+
*
|
|
13224
|
+
* ## The rate is served with its denominator or not at all
|
|
13225
|
+
*
|
|
13226
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13227
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13228
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13229
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
13230
|
+
* reproduces that mistake on every read.
|
|
13231
|
+
*
|
|
13232
|
+
* ## Shape
|
|
13233
|
+
*
|
|
13234
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13235
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13236
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13237
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13238
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13239
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13240
|
+
* result through `system.getFailureContributions`.
|
|
13241
|
+
*/
|
|
13242
|
+
var FailureReasonCountSchema = object({
|
|
13243
|
+
/**
|
|
13244
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13245
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13246
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
13247
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
13248
|
+
* vocabulary for the same loss would make the row and the counter
|
|
13249
|
+
* un-joinable.
|
|
13250
|
+
*/
|
|
13251
|
+
reason: string(),
|
|
13252
|
+
count: number().int().nonnegative()
|
|
13253
|
+
});
|
|
13254
|
+
var FailureContributionSchema = object({
|
|
13255
|
+
/**
|
|
13256
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13257
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13258
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
13259
|
+
* is a central list that rots invisibly.
|
|
13260
|
+
*/
|
|
13261
|
+
family: string(),
|
|
13262
|
+
/**
|
|
13263
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13264
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13265
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
13266
|
+
* cannot answer the only question anybody asks of this surface.
|
|
13267
|
+
*/
|
|
13268
|
+
deviceId: number().int().positive(),
|
|
13269
|
+
/**
|
|
13270
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
13271
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13272
|
+
* family has a single variant.
|
|
13273
|
+
*/
|
|
13274
|
+
variant: string().optional(),
|
|
13275
|
+
/**
|
|
13276
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13277
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
13278
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13279
|
+
* `LoadContribution.startedAtMs`.
|
|
13280
|
+
*/
|
|
13281
|
+
sinceMs: number(),
|
|
13282
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13283
|
+
atMs: number(),
|
|
13284
|
+
/**
|
|
13285
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13286
|
+
* window. A failure count published without it is the mistake this schema
|
|
13287
|
+
* exists to make impossible.
|
|
13288
|
+
*/
|
|
13289
|
+
attempts: number().int().nonnegative(),
|
|
13290
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13291
|
+
succeeded: number().int().nonnegative(),
|
|
13292
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13293
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
13294
|
+
});
|
|
13295
|
+
method(_void(), array(FailureContributionSchema).readonly());
|
|
13296
|
+
/**
|
|
13189
13297
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
13190
13298
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
13191
13299
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -13707,6 +13815,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
13707
13815
|
kind: "mutation",
|
|
13708
13816
|
auth: "admin"
|
|
13709
13817
|
});
|
|
13818
|
+
var LoadContributionSchema = object({
|
|
13819
|
+
role: _enum([
|
|
13820
|
+
"decode",
|
|
13821
|
+
"transcode",
|
|
13822
|
+
"recording",
|
|
13823
|
+
"streaming",
|
|
13824
|
+
"detection"
|
|
13825
|
+
]),
|
|
13826
|
+
/**
|
|
13827
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13828
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13829
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13830
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
13831
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13832
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
13833
|
+
*/
|
|
13834
|
+
deviceId: number().int().positive().nullable(),
|
|
13835
|
+
attribution: _enum([
|
|
13836
|
+
"measured",
|
|
13837
|
+
"accounted",
|
|
13838
|
+
"unattributable"
|
|
13839
|
+
]),
|
|
13840
|
+
/**
|
|
13841
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13842
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13843
|
+
* family and inventing a common one would lose the only information that
|
|
13844
|
+
* makes two entries for the same camera distinguishable.
|
|
13845
|
+
*/
|
|
13846
|
+
unit: string(),
|
|
13847
|
+
/**
|
|
13848
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
13849
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
13850
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
13851
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13852
|
+
* process of its own.
|
|
13853
|
+
*/
|
|
13854
|
+
pid: number().int().positive().optional(),
|
|
13855
|
+
/**
|
|
13856
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
13857
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13858
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
13859
|
+
* process.
|
|
13860
|
+
*/
|
|
13861
|
+
startedAtMs: number().optional(),
|
|
13862
|
+
/**
|
|
13863
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13864
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13865
|
+
* contribution is asked for.
|
|
13866
|
+
*
|
|
13867
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13868
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13869
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13870
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13871
|
+
*
|
|
13872
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13873
|
+
* an entry with no process.
|
|
13874
|
+
*/
|
|
13875
|
+
cpuSeconds: number().optional(),
|
|
13876
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13877
|
+
rssBytes: number().optional()
|
|
13878
|
+
});
|
|
13879
|
+
method(_void(), array(LoadContributionSchema).readonly());
|
|
13710
13880
|
/**
|
|
13711
13881
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
13712
13882
|
* through. It stores nothing.
|
|
@@ -13783,176 +13953,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
13783
13953
|
tags: record(string(), string()).optional()
|
|
13784
13954
|
}), array(LogEntrySchema).readonly());
|
|
13785
13955
|
/**
|
|
13786
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13787
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
13788
|
-
*
|
|
13789
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13790
|
-
*
|
|
13791
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13792
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13793
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13794
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13795
|
-
* somebody to forget to edit.
|
|
13796
|
-
*
|
|
13797
|
-
* They are not merged, because their invariants are opposites:
|
|
13798
|
-
*
|
|
13799
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13800
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13801
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13802
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13803
|
-
* and it is exactly what an absent entry cannot say.
|
|
13804
|
-
*
|
|
13805
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13806
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13807
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13808
|
-
* has no process.
|
|
13809
|
-
*
|
|
13810
|
-
* ## Why not a log line, since the counters already exist
|
|
13811
|
-
*
|
|
13812
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13813
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13814
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13815
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13816
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13817
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13818
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13819
|
-
* be READ.
|
|
13820
|
-
*
|
|
13821
|
-
* ## The rate is served with its denominator or not at all
|
|
13822
|
-
*
|
|
13823
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13824
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13825
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13826
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
13827
|
-
* reproduces that mistake on every read.
|
|
13828
|
-
*
|
|
13829
|
-
* ## Shape
|
|
13830
|
-
*
|
|
13831
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13832
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13833
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13834
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13835
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13836
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13837
|
-
* result through `system.getFailureContributions`.
|
|
13838
|
-
*/
|
|
13839
|
-
var FailureReasonCountSchema = object({
|
|
13840
|
-
/**
|
|
13841
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13842
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13843
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
13844
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
13845
|
-
* vocabulary for the same loss would make the row and the counter
|
|
13846
|
-
* un-joinable.
|
|
13847
|
-
*/
|
|
13848
|
-
reason: string(),
|
|
13849
|
-
count: number().int().nonnegative()
|
|
13850
|
-
});
|
|
13851
|
-
var FailureContributionSchema = object({
|
|
13852
|
-
/**
|
|
13853
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13854
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13855
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
13856
|
-
* is a central list that rots invisibly.
|
|
13857
|
-
*/
|
|
13858
|
-
family: string(),
|
|
13859
|
-
/**
|
|
13860
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13861
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13862
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
13863
|
-
* cannot answer the only question anybody asks of this surface.
|
|
13864
|
-
*/
|
|
13865
|
-
deviceId: number().int().positive(),
|
|
13866
|
-
/**
|
|
13867
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
13868
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13869
|
-
* family has a single variant.
|
|
13870
|
-
*/
|
|
13871
|
-
variant: string().optional(),
|
|
13872
|
-
/**
|
|
13873
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13874
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
13875
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13876
|
-
* `LoadContribution.startedAtMs`.
|
|
13877
|
-
*/
|
|
13878
|
-
sinceMs: number(),
|
|
13879
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13880
|
-
atMs: number(),
|
|
13881
|
-
/**
|
|
13882
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13883
|
-
* window. A failure count published without it is the mistake this schema
|
|
13884
|
-
* exists to make impossible.
|
|
13885
|
-
*/
|
|
13886
|
-
attempts: number().int().nonnegative(),
|
|
13887
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13888
|
-
succeeded: number().int().nonnegative(),
|
|
13889
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13890
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
13891
|
-
});
|
|
13892
|
-
method(_void(), array(FailureContributionSchema).readonly());
|
|
13893
|
-
var LoadContributionSchema = object({
|
|
13894
|
-
role: _enum([
|
|
13895
|
-
"decode",
|
|
13896
|
-
"transcode",
|
|
13897
|
-
"recording",
|
|
13898
|
-
"streaming",
|
|
13899
|
-
"detection"
|
|
13900
|
-
]),
|
|
13901
|
-
/**
|
|
13902
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
13903
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
13904
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
13905
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
13906
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
13907
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
13908
|
-
*/
|
|
13909
|
-
deviceId: number().int().positive().nullable(),
|
|
13910
|
-
attribution: _enum([
|
|
13911
|
-
"measured",
|
|
13912
|
-
"accounted",
|
|
13913
|
-
"unattributable"
|
|
13914
|
-
]),
|
|
13915
|
-
/**
|
|
13916
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
13917
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
13918
|
-
* family and inventing a common one would lose the only information that
|
|
13919
|
-
* makes two entries for the same camera distinguishable.
|
|
13920
|
-
*/
|
|
13921
|
-
unit: string(),
|
|
13922
|
-
/**
|
|
13923
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
13924
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
13925
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
13926
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
13927
|
-
* process of its own.
|
|
13928
|
-
*/
|
|
13929
|
-
pid: number().int().positive().optional(),
|
|
13930
|
-
/**
|
|
13931
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
13932
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
13933
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
13934
|
-
* process.
|
|
13935
|
-
*/
|
|
13936
|
-
startedAtMs: number().optional(),
|
|
13937
|
-
/**
|
|
13938
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
13939
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
13940
|
-
* contribution is asked for.
|
|
13941
|
-
*
|
|
13942
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
13943
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
13944
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
13945
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
13946
|
-
*
|
|
13947
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
13948
|
-
* an entry with no process.
|
|
13949
|
-
*/
|
|
13950
|
-
cpuSeconds: number().optional(),
|
|
13951
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
13952
|
-
rssBytes: number().optional()
|
|
13953
|
-
});
|
|
13954
|
-
method(_void(), array(LoadContributionSchema).readonly());
|
|
13955
|
-
/**
|
|
13956
13956
|
* `login-method` — collection cap through which auth addons contribute
|
|
13957
13957
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
13958
13958
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -18690,12 +18690,53 @@ var MediaFileKindEnum = _enum([
|
|
|
18690
18690
|
"keyFrameSmall",
|
|
18691
18691
|
"thumbnailSmall"
|
|
18692
18692
|
]);
|
|
18693
|
+
/**
|
|
18694
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
18695
|
+
* ARE — never the bytes themselves.
|
|
18696
|
+
*
|
|
18697
|
+
* ## Why `url` and not `base64`
|
|
18698
|
+
*
|
|
18699
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
18700
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
18701
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
18702
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
18703
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
18704
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
18705
|
+
*
|
|
18706
|
+
* `url` points at the `event-media` data plane
|
|
18707
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
18708
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
18709
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
18710
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
18711
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
18712
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
18713
|
+
* (per-device scoping).
|
|
18714
|
+
*
|
|
18715
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
18716
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
18717
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
18718
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
18719
|
+
*
|
|
18720
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
18721
|
+
*
|
|
18722
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
18723
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
18724
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
18725
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
18726
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
18727
|
+
* delete this line and the `withBytes` pass-through in
|
|
18728
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
18729
|
+
*/
|
|
18693
18730
|
var MediaFileSchema = object({
|
|
18694
18731
|
key: string(),
|
|
18695
18732
|
kind: MediaFileKindEnum,
|
|
18696
|
-
base64: string(),
|
|
18697
18733
|
sizeBytes: number(),
|
|
18698
18734
|
timestamp: number()
|
|
18735
|
+
}).extend({
|
|
18736
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
18737
|
+
url: string(),
|
|
18738
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
18739
|
+
base64: string()
|
|
18699
18740
|
});
|
|
18700
18741
|
/**
|
|
18701
18742
|
* One media row WITHOUT its bytes.
|
|
@@ -18707,7 +18748,9 @@ var MediaFileSchema = object({
|
|
|
18707
18748
|
* blocks the whole view.
|
|
18708
18749
|
*
|
|
18709
18750
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
18710
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
18751
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
18752
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
18753
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
18711
18754
|
*/
|
|
18712
18755
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
18713
18756
|
/**
|
|
@@ -19396,6 +19439,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
19396
19439
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
19397
19440
|
trackId: string(),
|
|
19398
19441
|
deviceId: number()
|
|
19442
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
19443
|
+
eventId: string(),
|
|
19444
|
+
deviceId: number()
|
|
19399
19445
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
19400
19446
|
kind: "mutation",
|
|
19401
19447
|
auth: "admin"
|
|
@@ -24386,10 +24432,24 @@ var FaceClusterSchema = object({
|
|
|
24386
24432
|
size: number().int(),
|
|
24387
24433
|
cohesion: number()
|
|
24388
24434
|
});
|
|
24435
|
+
/**
|
|
24436
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
24437
|
+
* are — never the bytes.
|
|
24438
|
+
*
|
|
24439
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
24440
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
24441
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
24442
|
+
* caller is the admin UI's detail modal, which was building
|
|
24443
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
24444
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
24445
|
+
*
|
|
24446
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
24447
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
24448
|
+
*/
|
|
24389
24449
|
var MediaFileLiteSchema$1 = object({
|
|
24390
24450
|
key: string(),
|
|
24391
24451
|
kind: string(),
|
|
24392
|
-
|
|
24452
|
+
url: string(),
|
|
24393
24453
|
sizeBytes: number(),
|
|
24394
24454
|
timestamp: number()
|
|
24395
24455
|
});
|
|
@@ -27411,10 +27471,24 @@ var PlateInfoSchema = object({
|
|
|
27411
27471
|
*/
|
|
27412
27472
|
cropUrl: string().optional()
|
|
27413
27473
|
});
|
|
27474
|
+
/**
|
|
27475
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
27476
|
+
* are — never the bytes.
|
|
27477
|
+
*
|
|
27478
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
27479
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
27480
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
27481
|
+
* caller is the admin UI's detail modal, which was building
|
|
27482
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
27483
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
27484
|
+
*
|
|
27485
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
27486
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
27487
|
+
*/
|
|
27414
27488
|
var MediaFileLiteSchema = object({
|
|
27415
27489
|
key: string(),
|
|
27416
27490
|
kind: string(),
|
|
27417
|
-
|
|
27491
|
+
url: string(),
|
|
27418
27492
|
sizeBytes: number(),
|
|
27419
27493
|
timestamp: number()
|
|
27420
27494
|
});
|
|
@@ -35311,6 +35385,12 @@ Object.freeze({
|
|
|
35311
35385
|
addonId: null,
|
|
35312
35386
|
access: "view"
|
|
35313
35387
|
},
|
|
35388
|
+
"pipelineAnalytics.listEventMedia": {
|
|
35389
|
+
capName: "pipeline-analytics",
|
|
35390
|
+
capScope: "device",
|
|
35391
|
+
addonId: null,
|
|
35392
|
+
access: "view"
|
|
35393
|
+
},
|
|
35314
35394
|
"pipelineAnalytics.listGroups": {
|
|
35315
35395
|
capName: "pipeline-analytics",
|
|
35316
35396
|
capScope: "device",
|
|
@@ -38934,6 +39014,11 @@ Object.freeze({
|
|
|
38934
39014
|
form: "array",
|
|
38935
39015
|
optional: false
|
|
38936
39016
|
}],
|
|
39017
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
39018
|
+
name: "deviceId",
|
|
39019
|
+
form: "single",
|
|
39020
|
+
optional: false
|
|
39021
|
+
}],
|
|
38937
39022
|
"pipelineAnalytics.listGroups": [{
|
|
38938
39023
|
name: "deviceIds",
|
|
38939
39024
|
form: "array",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/addon-provider-gree",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.46",
|
|
4
4
|
"description": "Gree air-conditioner device-provider addon for CamStack — wraps the @apocaliss92/nodegree local-UDP client (LAN discovery + AES control), exposing climate-control and fan-control",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"camstack",
|