@camstack/addon-pipeline-orchestrator 1.2.126 → 1.2.128
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/_stub.js +2 -2
- package/dist/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-CXhvoqSz.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_orchestrator_widgets-D6mD53Q1.mjs} +3 -3
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-ChOONdP8.mjs +26 -0
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-CKZAmz0G.mjs +26 -0
- package/dist/{hostInit-TesSFjYU.mjs → hostInit-CAeXD4PM.mjs} +3 -3
- package/dist/index.js +331 -174
- package/dist/index.mjs +331 -174
- package/dist/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CJq8bXZN.mjs +0 -26
- package/dist/_virtual_mf___mfe_internal__addon_pipeline_orchestrator_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Cg19xcCo.mjs +0 -26
package/dist/index.js
CHANGED
|
@@ -13875,6 +13875,114 @@ method(object({
|
|
|
13875
13875
|
height: number()
|
|
13876
13876
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
13877
13877
|
/**
|
|
13878
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
13879
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
13880
|
+
*
|
|
13881
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
13882
|
+
*
|
|
13883
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
13884
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
13885
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
13886
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
13887
|
+
* somebody to forget to edit.
|
|
13888
|
+
*
|
|
13889
|
+
* They are not merged, because their invariants are opposites:
|
|
13890
|
+
*
|
|
13891
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
13892
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
13893
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
13894
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
13895
|
+
* and it is exactly what an absent entry cannot say.
|
|
13896
|
+
*
|
|
13897
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
13898
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
13899
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
13900
|
+
* has no process.
|
|
13901
|
+
*
|
|
13902
|
+
* ## Why not a log line, since the counters already exist
|
|
13903
|
+
*
|
|
13904
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
13905
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
13906
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
13907
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
13908
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
13909
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
13910
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
13911
|
+
* be READ.
|
|
13912
|
+
*
|
|
13913
|
+
* ## The rate is served with its denominator or not at all
|
|
13914
|
+
*
|
|
13915
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
13916
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
13917
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
13918
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
13919
|
+
* reproduces that mistake on every read.
|
|
13920
|
+
*
|
|
13921
|
+
* ## Shape
|
|
13922
|
+
*
|
|
13923
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
13924
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
13925
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
13926
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
13927
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
13928
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
13929
|
+
* result through `system.getFailureContributions`.
|
|
13930
|
+
*/
|
|
13931
|
+
var FailureReasonCountSchema = object({
|
|
13932
|
+
/**
|
|
13933
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
13934
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
13935
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
13936
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
13937
|
+
* vocabulary for the same loss would make the row and the counter
|
|
13938
|
+
* un-joinable.
|
|
13939
|
+
*/
|
|
13940
|
+
reason: string(),
|
|
13941
|
+
count: number().int().nonnegative()
|
|
13942
|
+
});
|
|
13943
|
+
var FailureContributionSchema = object({
|
|
13944
|
+
/**
|
|
13945
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
13946
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
13947
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
13948
|
+
* is a central list that rots invisibly.
|
|
13949
|
+
*/
|
|
13950
|
+
family: string(),
|
|
13951
|
+
/**
|
|
13952
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
13953
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
13954
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
13955
|
+
* cannot answer the only question anybody asks of this surface.
|
|
13956
|
+
*/
|
|
13957
|
+
deviceId: number().int().positive(),
|
|
13958
|
+
/**
|
|
13959
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
13960
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
13961
|
+
* family has a single variant.
|
|
13962
|
+
*/
|
|
13963
|
+
variant: string().optional(),
|
|
13964
|
+
/**
|
|
13965
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
13966
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
13967
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
13968
|
+
* `LoadContribution.startedAtMs`.
|
|
13969
|
+
*/
|
|
13970
|
+
sinceMs: number(),
|
|
13971
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
13972
|
+
atMs: number(),
|
|
13973
|
+
/**
|
|
13974
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
13975
|
+
* window. A failure count published without it is the mistake this schema
|
|
13976
|
+
* exists to make impossible.
|
|
13977
|
+
*/
|
|
13978
|
+
attempts: number().int().nonnegative(),
|
|
13979
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
13980
|
+
succeeded: number().int().nonnegative(),
|
|
13981
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
13982
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
13983
|
+
});
|
|
13984
|
+
method(_void(), array(FailureContributionSchema).readonly());
|
|
13985
|
+
/**
|
|
13878
13986
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
13879
13987
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
13880
13988
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -14396,6 +14504,68 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
14396
14504
|
kind: "mutation",
|
|
14397
14505
|
auth: "admin"
|
|
14398
14506
|
});
|
|
14507
|
+
var LoadContributionSchema = object({
|
|
14508
|
+
role: _enum([
|
|
14509
|
+
"decode",
|
|
14510
|
+
"transcode",
|
|
14511
|
+
"recording",
|
|
14512
|
+
"streaming",
|
|
14513
|
+
"detection"
|
|
14514
|
+
]),
|
|
14515
|
+
/**
|
|
14516
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
14517
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
14518
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
14519
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
14520
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
14521
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
14522
|
+
*/
|
|
14523
|
+
deviceId: number().int().positive().nullable(),
|
|
14524
|
+
attribution: _enum([
|
|
14525
|
+
"measured",
|
|
14526
|
+
"accounted",
|
|
14527
|
+
"unattributable"
|
|
14528
|
+
]),
|
|
14529
|
+
/**
|
|
14530
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
14531
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
14532
|
+
* family and inventing a common one would lose the only information that
|
|
14533
|
+
* makes two entries for the same camera distinguishable.
|
|
14534
|
+
*/
|
|
14535
|
+
unit: string(),
|
|
14536
|
+
/**
|
|
14537
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
14538
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
14539
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
14540
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
14541
|
+
* process of its own.
|
|
14542
|
+
*/
|
|
14543
|
+
pid: number().int().positive().optional(),
|
|
14544
|
+
/**
|
|
14545
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
14546
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
14547
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
14548
|
+
* process.
|
|
14549
|
+
*/
|
|
14550
|
+
startedAtMs: number().optional(),
|
|
14551
|
+
/**
|
|
14552
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
14553
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
14554
|
+
* contribution is asked for.
|
|
14555
|
+
*
|
|
14556
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
14557
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
14558
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
14559
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
14560
|
+
*
|
|
14561
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
14562
|
+
* an entry with no process.
|
|
14563
|
+
*/
|
|
14564
|
+
cpuSeconds: number().optional(),
|
|
14565
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
14566
|
+
rssBytes: number().optional()
|
|
14567
|
+
});
|
|
14568
|
+
method(_void(), array(LoadContributionSchema).readonly());
|
|
14399
14569
|
/**
|
|
14400
14570
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
14401
14571
|
* through. It stores nothing.
|
|
@@ -14472,176 +14642,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
14472
14642
|
tags: record(string(), string()).optional()
|
|
14473
14643
|
}), array(LogEntrySchema).readonly());
|
|
14474
14644
|
/**
|
|
14475
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
14476
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
14477
|
-
*
|
|
14478
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
14479
|
-
*
|
|
14480
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
14481
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
14482
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
14483
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
14484
|
-
* somebody to forget to edit.
|
|
14485
|
-
*
|
|
14486
|
-
* They are not merged, because their invariants are opposites:
|
|
14487
|
-
*
|
|
14488
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
14489
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
14490
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
14491
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
14492
|
-
* and it is exactly what an absent entry cannot say.
|
|
14493
|
-
*
|
|
14494
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
14495
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
14496
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
14497
|
-
* has no process.
|
|
14498
|
-
*
|
|
14499
|
-
* ## Why not a log line, since the counters already exist
|
|
14500
|
-
*
|
|
14501
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
14502
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
14503
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
14504
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
14505
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
14506
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
14507
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
14508
|
-
* be READ.
|
|
14509
|
-
*
|
|
14510
|
-
* ## The rate is served with its denominator or not at all
|
|
14511
|
-
*
|
|
14512
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
14513
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
14514
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
14515
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
14516
|
-
* reproduces that mistake on every read.
|
|
14517
|
-
*
|
|
14518
|
-
* ## Shape
|
|
14519
|
-
*
|
|
14520
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
14521
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
14522
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
14523
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
14524
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
14525
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
14526
|
-
* result through `system.getFailureContributions`.
|
|
14527
|
-
*/
|
|
14528
|
-
var FailureReasonCountSchema = object({
|
|
14529
|
-
/**
|
|
14530
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
14531
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
14532
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
14533
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
14534
|
-
* vocabulary for the same loss would make the row and the counter
|
|
14535
|
-
* un-joinable.
|
|
14536
|
-
*/
|
|
14537
|
-
reason: string(),
|
|
14538
|
-
count: number().int().nonnegative()
|
|
14539
|
-
});
|
|
14540
|
-
var FailureContributionSchema = object({
|
|
14541
|
-
/**
|
|
14542
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
14543
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
14544
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
14545
|
-
* is a central list that rots invisibly.
|
|
14546
|
-
*/
|
|
14547
|
-
family: string(),
|
|
14548
|
-
/**
|
|
14549
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
14550
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
14551
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
14552
|
-
* cannot answer the only question anybody asks of this surface.
|
|
14553
|
-
*/
|
|
14554
|
-
deviceId: number().int().positive(),
|
|
14555
|
-
/**
|
|
14556
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
14557
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
14558
|
-
* family has a single variant.
|
|
14559
|
-
*/
|
|
14560
|
-
variant: string().optional(),
|
|
14561
|
-
/**
|
|
14562
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
14563
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
14564
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
14565
|
-
* `LoadContribution.startedAtMs`.
|
|
14566
|
-
*/
|
|
14567
|
-
sinceMs: number(),
|
|
14568
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
14569
|
-
atMs: number(),
|
|
14570
|
-
/**
|
|
14571
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
14572
|
-
* window. A failure count published without it is the mistake this schema
|
|
14573
|
-
* exists to make impossible.
|
|
14574
|
-
*/
|
|
14575
|
-
attempts: number().int().nonnegative(),
|
|
14576
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
14577
|
-
succeeded: number().int().nonnegative(),
|
|
14578
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
14579
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
14580
|
-
});
|
|
14581
|
-
method(_void(), array(FailureContributionSchema).readonly());
|
|
14582
|
-
var LoadContributionSchema = object({
|
|
14583
|
-
role: _enum([
|
|
14584
|
-
"decode",
|
|
14585
|
-
"transcode",
|
|
14586
|
-
"recording",
|
|
14587
|
-
"streaming",
|
|
14588
|
-
"detection"
|
|
14589
|
-
]),
|
|
14590
|
-
/**
|
|
14591
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
14592
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
14593
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
14594
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
14595
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
14596
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
14597
|
-
*/
|
|
14598
|
-
deviceId: number().int().positive().nullable(),
|
|
14599
|
-
attribution: _enum([
|
|
14600
|
-
"measured",
|
|
14601
|
-
"accounted",
|
|
14602
|
-
"unattributable"
|
|
14603
|
-
]),
|
|
14604
|
-
/**
|
|
14605
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
14606
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
14607
|
-
* family and inventing a common one would lose the only information that
|
|
14608
|
-
* makes two entries for the same camera distinguishable.
|
|
14609
|
-
*/
|
|
14610
|
-
unit: string(),
|
|
14611
|
-
/**
|
|
14612
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
14613
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
14614
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
14615
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
14616
|
-
* process of its own.
|
|
14617
|
-
*/
|
|
14618
|
-
pid: number().int().positive().optional(),
|
|
14619
|
-
/**
|
|
14620
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
14621
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
14622
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
14623
|
-
* process.
|
|
14624
|
-
*/
|
|
14625
|
-
startedAtMs: number().optional(),
|
|
14626
|
-
/**
|
|
14627
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
14628
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
14629
|
-
* contribution is asked for.
|
|
14630
|
-
*
|
|
14631
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
14632
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
14633
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
14634
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
14635
|
-
*
|
|
14636
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
14637
|
-
* an entry with no process.
|
|
14638
|
-
*/
|
|
14639
|
-
cpuSeconds: number().optional(),
|
|
14640
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
14641
|
-
rssBytes: number().optional()
|
|
14642
|
-
});
|
|
14643
|
-
method(_void(), array(LoadContributionSchema).readonly());
|
|
14644
|
-
/**
|
|
14645
14645
|
* `login-method` — collection cap through which auth addons contribute
|
|
14646
14646
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
14647
14647
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -19525,12 +19525,53 @@ var MediaFileKindEnum = _enum([
|
|
|
19525
19525
|
"keyFrameSmall",
|
|
19526
19526
|
"thumbnailSmall"
|
|
19527
19527
|
]);
|
|
19528
|
+
/**
|
|
19529
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
19530
|
+
* ARE — never the bytes themselves.
|
|
19531
|
+
*
|
|
19532
|
+
* ## Why `url` and not `base64`
|
|
19533
|
+
*
|
|
19534
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
19535
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
19536
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
19537
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
19538
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
19539
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
19540
|
+
*
|
|
19541
|
+
* `url` points at the `event-media` data plane
|
|
19542
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
19543
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
19544
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
19545
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
19546
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
19547
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
19548
|
+
* (per-device scoping).
|
|
19549
|
+
*
|
|
19550
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
19551
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
19552
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
19553
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
19554
|
+
*
|
|
19555
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
19556
|
+
*
|
|
19557
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
19558
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
19559
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
19560
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
19561
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
19562
|
+
* delete this line and the `withBytes` pass-through in
|
|
19563
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
19564
|
+
*/
|
|
19528
19565
|
var MediaFileSchema = object({
|
|
19529
19566
|
key: string(),
|
|
19530
19567
|
kind: MediaFileKindEnum,
|
|
19531
|
-
base64: string(),
|
|
19532
19568
|
sizeBytes: number(),
|
|
19533
19569
|
timestamp: number()
|
|
19570
|
+
}).extend({
|
|
19571
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
19572
|
+
url: string(),
|
|
19573
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
19574
|
+
base64: string()
|
|
19534
19575
|
});
|
|
19535
19576
|
/**
|
|
19536
19577
|
* One media row WITHOUT its bytes.
|
|
@@ -19542,7 +19583,9 @@ var MediaFileSchema = object({
|
|
|
19542
19583
|
* blocks the whole view.
|
|
19543
19584
|
*
|
|
19544
19585
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
19545
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
19586
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
19587
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
19588
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
19546
19589
|
*/
|
|
19547
19590
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
19548
19591
|
/**
|
|
@@ -19889,6 +19932,50 @@ var EventStoreFootprintSchema = object({
|
|
|
19889
19932
|
totalBytes: number().int(),
|
|
19890
19933
|
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
19891
19934
|
});
|
|
19935
|
+
/** Event-media footprint for one {@link MediaFileKind}. */
|
|
19936
|
+
var EventMediaKindFootprintSchema = object({
|
|
19937
|
+
kind: MediaFileKindEnum,
|
|
19938
|
+
/** Media rows of this kind. */
|
|
19939
|
+
rows: number().int(),
|
|
19940
|
+
/** Bytes on disk held by those rows. */
|
|
19941
|
+
bytes: number().int()
|
|
19942
|
+
});
|
|
19943
|
+
/**
|
|
19944
|
+
* The media footprint broken down by KIND — the axis a deletion decision
|
|
19945
|
+
* actually turns on.
|
|
19946
|
+
*
|
|
19947
|
+
* A byte total says how much there is; it cannot say what is safe to remove.
|
|
19948
|
+
* The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
|
|
19949
|
+
* motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
|
|
19950
|
+
* `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
|
|
19951
|
+
* buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
|
|
19952
|
+
* nothing else, so sizing a deletion means summing per kind.
|
|
19953
|
+
*
|
|
19954
|
+
* ## Why `unaccounted*` exists
|
|
19955
|
+
*
|
|
19956
|
+
* `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
|
|
19957
|
+
* writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
|
|
19958
|
+
* from a SEPARATE unfiltered aggregate over the same rows, never from adding
|
|
19959
|
+
* `kinds` up. A row whose stored `kind` is not in the enum (written by a
|
|
19960
|
+
* retired code path, or by a version that knew a kind this one does not) would
|
|
19961
|
+
* otherwise vanish from the total silently, and an operator would delete
|
|
19962
|
+
* against a denominator smaller than the disk.
|
|
19963
|
+
*
|
|
19964
|
+
* `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
|
|
19965
|
+
* zero; a non-zero value is a real finding and must be shown, not rounded away.
|
|
19966
|
+
*/
|
|
19967
|
+
var EventMediaKindBreakdownSchema = object({
|
|
19968
|
+
/** Every media row in scope, from one unfiltered aggregate. */
|
|
19969
|
+
totalRows: number().int(),
|
|
19970
|
+
/** Every media byte in scope, from that same aggregate. */
|
|
19971
|
+
totalBytes: number().int(),
|
|
19972
|
+
/** Per-kind footprint, ordered by bytes descending. */
|
|
19973
|
+
kinds: array(EventMediaKindFootprintSchema).readonly(),
|
|
19974
|
+
/** `totalRows` minus the summed `kinds` rows — see the schema note. */
|
|
19975
|
+
unaccountedRows: number().int(),
|
|
19976
|
+
/** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
|
|
19977
|
+
unaccountedBytes: number().int()
|
|
19978
|
+
});
|
|
19892
19979
|
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
19893
19980
|
var EventPruneCountsSchema = object({
|
|
19894
19981
|
motion: number().int(),
|
|
@@ -20092,6 +20179,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
20092
20179
|
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
20093
20180
|
kind: "query",
|
|
20094
20181
|
auth: "admin"
|
|
20182
|
+
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
20183
|
+
kind: "query",
|
|
20184
|
+
auth: "admin"
|
|
20095
20185
|
}), method(object({
|
|
20096
20186
|
olderThanMs: number(),
|
|
20097
20187
|
reason: OpsLogReasonSchema.optional()
|
|
@@ -20231,6 +20321,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
20231
20321
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
20232
20322
|
trackId: string(),
|
|
20233
20323
|
deviceId: number()
|
|
20324
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
20325
|
+
eventId: string(),
|
|
20326
|
+
deviceId: number()
|
|
20234
20327
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
20235
20328
|
kind: "mutation",
|
|
20236
20329
|
auth: "admin"
|
|
@@ -22521,6 +22614,20 @@ method(object({
|
|
|
22521
22614
|
error: string().optional()
|
|
22522
22615
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
22523
22616
|
providerId: string(),
|
|
22617
|
+
/**
|
|
22618
|
+
* The location this config is an UNSAVED edit of, when there is one.
|
|
22619
|
+
*
|
|
22620
|
+
* `listLocations` replaces every declared secret with the redaction
|
|
22621
|
+
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
22622
|
+
* credential the operator did not retype — and posting that here
|
|
22623
|
+
* without a way to resolve it makes the provider try to authenticate
|
|
22624
|
+
* as `__camstack_redacted__` and report the operator's own working
|
|
22625
|
+
* password as wrong. Given this id, the orchestrator restores each
|
|
22626
|
+
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
22627
|
+
* before dispatching. Omitted by the "Add location" wizard, where
|
|
22628
|
+
* every value was typed just now and nothing is stored yet.
|
|
22629
|
+
*/
|
|
22630
|
+
locationId: string().optional(),
|
|
22524
22631
|
config: record(string(), unknown())
|
|
22525
22632
|
}), object({
|
|
22526
22633
|
ok: boolean(),
|
|
@@ -24972,10 +25079,24 @@ var FaceClusterSchema = object({
|
|
|
24972
25079
|
size: number().int(),
|
|
24973
25080
|
cohesion: number()
|
|
24974
25081
|
});
|
|
25082
|
+
/**
|
|
25083
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
25084
|
+
* are — never the bytes.
|
|
25085
|
+
*
|
|
25086
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
25087
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
25088
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
25089
|
+
* caller is the admin UI's detail modal, which was building
|
|
25090
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
25091
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
25092
|
+
*
|
|
25093
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
25094
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
25095
|
+
*/
|
|
24975
25096
|
var MediaFileLiteSchema$1 = object({
|
|
24976
25097
|
key: string(),
|
|
24977
25098
|
kind: string(),
|
|
24978
|
-
|
|
25099
|
+
url: string(),
|
|
24979
25100
|
sizeBytes: number(),
|
|
24980
25101
|
timestamp: number()
|
|
24981
25102
|
});
|
|
@@ -27227,10 +27348,24 @@ var PlateInfoSchema = object({
|
|
|
27227
27348
|
*/
|
|
27228
27349
|
cropUrl: string().optional()
|
|
27229
27350
|
});
|
|
27351
|
+
/**
|
|
27352
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
27353
|
+
* are — never the bytes.
|
|
27354
|
+
*
|
|
27355
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
27356
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
27357
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
27358
|
+
* caller is the admin UI's detail modal, which was building
|
|
27359
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
27360
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
27361
|
+
*
|
|
27362
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
27363
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
27364
|
+
*/
|
|
27230
27365
|
var MediaFileLiteSchema = object({
|
|
27231
27366
|
key: string(),
|
|
27232
27367
|
kind: string(),
|
|
27233
|
-
|
|
27368
|
+
url: string(),
|
|
27234
27369
|
sizeBytes: number(),
|
|
27235
27370
|
timestamp: number()
|
|
27236
27371
|
});
|
|
@@ -33231,6 +33366,12 @@ Object.freeze({
|
|
|
33231
33366
|
addonId: null,
|
|
33232
33367
|
access: "view"
|
|
33233
33368
|
},
|
|
33369
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": {
|
|
33370
|
+
capName: "pipeline-analytics",
|
|
33371
|
+
capScope: "device",
|
|
33372
|
+
addonId: null,
|
|
33373
|
+
access: "view"
|
|
33374
|
+
},
|
|
33234
33375
|
"pipelineAnalytics.getEventStoreFootprint": {
|
|
33235
33376
|
capName: "pipeline-analytics",
|
|
33236
33377
|
capScope: "device",
|
|
@@ -33327,6 +33468,12 @@ Object.freeze({
|
|
|
33327
33468
|
addonId: null,
|
|
33328
33469
|
access: "view"
|
|
33329
33470
|
},
|
|
33471
|
+
"pipelineAnalytics.listEventMedia": {
|
|
33472
|
+
capName: "pipeline-analytics",
|
|
33473
|
+
capScope: "device",
|
|
33474
|
+
addonId: null,
|
|
33475
|
+
access: "view"
|
|
33476
|
+
},
|
|
33330
33477
|
"pipelineAnalytics.listGroups": {
|
|
33331
33478
|
capName: "pipeline-analytics",
|
|
33332
33479
|
capScope: "device",
|
|
@@ -36890,6 +37037,11 @@ Object.freeze({
|
|
|
36890
37037
|
form: "single",
|
|
36891
37038
|
optional: false
|
|
36892
37039
|
}],
|
|
37040
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": [{
|
|
37041
|
+
name: "deviceId",
|
|
37042
|
+
form: "single",
|
|
37043
|
+
optional: true
|
|
37044
|
+
}],
|
|
36893
37045
|
"pipelineAnalytics.getGroup": [{
|
|
36894
37046
|
name: "deviceId",
|
|
36895
37047
|
form: "single",
|
|
@@ -36950,6 +37102,11 @@ Object.freeze({
|
|
|
36950
37102
|
form: "array",
|
|
36951
37103
|
optional: false
|
|
36952
37104
|
}],
|
|
37105
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
37106
|
+
name: "deviceId",
|
|
37107
|
+
form: "single",
|
|
37108
|
+
optional: false
|
|
37109
|
+
}],
|
|
36953
37110
|
"pipelineAnalytics.listGroups": [{
|
|
36954
37111
|
name: "deviceIds",
|
|
36955
37112
|
form: "array",
|