@camstack/addon-pipeline 1.2.151 → 1.2.153
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/audio-analyzer/index.js +2 -2
- package/dist/audio-analyzer/index.mjs +2 -2
- package/dist/detection-pipeline/index.js +5 -5
- package/dist/detection-pipeline/index.mjs +4 -4
- package/dist/{dist-hmG3nfuW.js → dist-DnVnWACi.js} +346 -214
- package/dist/{dist-BjzcUac4.mjs → dist-Dsritt4-.mjs} +346 -214
- package/dist/{lazy-sharp-RLE6klOt.js → lazy-sharp-DZWYKdV2.js} +1 -1
- package/dist/{local-frame-registry-Ct2vQ7Dp.js → local-frame-registry-BpFLRfbw.js} +1 -1
- package/dist/{local-frame-registry-BFaxbRtK.mjs → local-frame-registry-Yf-uIxbS.mjs} +1 -1
- package/dist/motion-wasm/index.js +2 -2
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/{node-BwXwfrvA.js → node-C5xmFvjS.js} +1 -1
- package/dist/{node-U9fJ-bQN.mjs → node-CNGxkfes.mjs} +1 -1
- package/dist/pipeline-runner/index.js +5 -5
- package/dist/pipeline-runner/index.mjs +4 -4
- package/dist/{process-memory-DR9jSxpX.js → process-memory-COT8rA8L.js} +1 -1
- package/dist/{process-memory-4WDUPavu.mjs → process-memory-DX_KCfdx.mjs} +1 -1
- package/dist/recorder/index.js +167 -28
- package/dist/recorder/index.mjs +167 -28
- package/dist/{segment-demux-js-kUN5AQVv.mjs → segment-demux-js-CTFSl-b9.mjs} +1 -1
- package/dist/{segment-demux-js-zqUNh3pj.js → segment-demux-js-Dwg9Jq5_.js} +1 -1
- package/dist/session-decode/decode-worker-child.js +2 -2
- package/dist/session-decode/decode-worker-child.mjs +1 -1
- package/dist/stream-broker/_stub.js +2 -2
- package/dist/stream-broker/{_virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-BOXQSR0X.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-ZucA907q.mjs} +3 -3
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B14Zc1oq.mjs +26 -0
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DO6LkN6o.mjs +26 -0
- package/dist/stream-broker/demux-worker-child.js +1 -1
- package/dist/stream-broker/demux-worker-child.mjs +1 -1
- package/dist/stream-broker/{hostInit-CnUhcNPG.mjs → hostInit-BqUcM0Fh.mjs} +3 -3
- package/dist/stream-broker/index.js +3 -3
- package/dist/stream-broker/index.mjs +3 -3
- package/dist/stream-broker/remoteEntry.js +1 -1
- package/dist/{worker-protocol-DE_jjbFA.js → worker-protocol-BsvaPb-G.js} +1 -1
- package/dist/{worker-protocol-BzlEZ56r.mjs → worker-protocol-CDBQXOIu.mjs} +1 -1
- package/package.json +1 -1
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CyIaTPRY.mjs +0 -26
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-Cyyhy_D8.mjs +0 -26
|
@@ -9315,6 +9315,21 @@ var RelocateJobSchema = object({
|
|
|
9315
9315
|
bytesMoved: number().int(),
|
|
9316
9316
|
/** Total files discovered up front; null while (or when) unknown. */
|
|
9317
9317
|
filesTotal: number().int().nullable(),
|
|
9318
|
+
/**
|
|
9319
|
+
* Rows this run CORRECTED while moving them — a durable mutation the move
|
|
9320
|
+
* made that nobody asked for, so it is reported where the operator reads the
|
|
9321
|
+
* job rather than only in a log line.
|
|
9322
|
+
*
|
|
9323
|
+
* A footage segment records its byte count in its own NAME, and the durable
|
|
9324
|
+
* hour row derives its aggregates from those names. A file that does not
|
|
9325
|
+
* match its name therefore makes the ledger's sums — and with them quota and
|
|
9326
|
+
* pressure eviction — wrong by the difference, and only a rename can fix it.
|
|
9327
|
+
* On 2026-08-30 one such row also stalled a 110 749-file drain permanently.
|
|
9328
|
+
*
|
|
9329
|
+
* Absent on lanes where the question has no meaning: a media blob's size is
|
|
9330
|
+
* in its row, not in its name, so `MediaRelocateEngine` never reconciles one.
|
|
9331
|
+
*/
|
|
9332
|
+
rowsReconciled: number().int().nonnegative().optional(),
|
|
9318
9333
|
startedAt: number(),
|
|
9319
9334
|
finishedAt: number().nullable(),
|
|
9320
9335
|
error: string().nullable()
|
|
@@ -9383,14 +9398,42 @@ var RelocateMediaInputSchema = object({
|
|
|
9383
9398
|
/** Omitted = `move`, the pre-existing behaviour. */
|
|
9384
9399
|
mode: MediaRelocateModeSchema.optional()
|
|
9385
9400
|
});
|
|
9386
|
-
/**
|
|
9387
|
-
*
|
|
9388
|
-
*
|
|
9389
|
-
|
|
9390
|
-
|
|
9391
|
-
|
|
9392
|
-
|
|
9401
|
+
/**
|
|
9402
|
+
* The unstamped population of ONE collection — split, because the gate and the
|
|
9403
|
+
* operator ask two different questions and only one of them has to be cheap.
|
|
9404
|
+
*
|
|
9405
|
+
* `present` is the GATE: "is there at least one row that would be orphaned by a
|
|
9406
|
+
* repoint". It is a single indexed seek to the first matching row, so it stays
|
|
9407
|
+
* answerable on a saturated disk and answers in O(log n) precisely in the state
|
|
9408
|
+
* that matters — after a seal, when the population is empty.
|
|
9409
|
+
*
|
|
9410
|
+
* `rows` is the NUMBER, for the refusal message and the operator's sense of
|
|
9411
|
+
* scale. It is a second, indexed `COUNT(*)`, and `null` means **not
|
|
9412
|
+
* measurable** — never zero. `{ present: true, rows: null }` is a legitimate
|
|
9413
|
+
* and useful answer: "there are some, and this read could not say how many"
|
|
9414
|
+
* still refuses the cutover, which is the whole job.
|
|
9415
|
+
*/
|
|
9416
|
+
var UnstampedRowsSchema = object({
|
|
9417
|
+
present: boolean(),
|
|
9418
|
+
rows: number().int().nonnegative().nullable()
|
|
9393
9419
|
});
|
|
9420
|
+
/**
|
|
9421
|
+
* How many rows still carry NO `locationId` — the population a repoint would
|
|
9422
|
+
* silently re-aim at a disk that does not hold their bytes.
|
|
9423
|
+
*
|
|
9424
|
+
* **`null` = the count could not be taken**, and it is NOT permission to cut
|
|
9425
|
+
* over. The gate opens on a measured absence and on nothing else; an unread
|
|
9426
|
+
* collection and an empty one are different facts, and this repo has already
|
|
9427
|
+
* paid for conflating them (`RelocateResidueSchema`, D295).
|
|
9428
|
+
*/
|
|
9429
|
+
var UnstampedEventMediaCountSchema = object({
|
|
9430
|
+
media: UnstampedRowsSchema,
|
|
9431
|
+
retrainFrames: UnstampedRowsSchema,
|
|
9432
|
+
/** True when EITHER collection holds one. The refusal reads this. */
|
|
9433
|
+
anyPresent: boolean(),
|
|
9434
|
+
/** Sum across both, or `null` when either lane could not be counted. */
|
|
9435
|
+
total: number().int().nonnegative().nullable()
|
|
9436
|
+
}).nullable();
|
|
9394
9437
|
var StorageMigrationMediaMoveInputSchema = RelocateMediaInputSchema.extend({ leaseId: string().min(1) });
|
|
9395
9438
|
/** The independently selectable logical storage classes — every class
|
|
9396
9439
|
* `storage.listLocationDeclarations` reports, so an operator never meets a
|
|
@@ -9501,6 +9544,10 @@ var StorageMigrationMoveProgressSchema = object({
|
|
|
9501
9544
|
/** The archive census — the **M** of "N of M" (D295). `null` = unknowable. */
|
|
9502
9545
|
filesTotal: number().int().nonnegative().nullable(),
|
|
9503
9546
|
bytesMoved: number().int().nonnegative(),
|
|
9547
|
+
/** Rows the mover corrected while moving them — see `RelocateJob`. Absent on
|
|
9548
|
+
* a lane that cannot reconcile. A migration that silently rewrote durable
|
|
9549
|
+
* rows would be the same failure as one that silently skipped them. */
|
|
9550
|
+
rowsReconciled: number().int().nonnegative().optional(),
|
|
9504
9551
|
/** The MOVER's start, not the migration's: a drain restarted after an addon
|
|
9505
9552
|
* crash gets a new mover, and a rate computed from the migration's start
|
|
9506
9553
|
* would silently average in the time nothing was running. */
|
|
@@ -14766,6 +14813,133 @@ method(object({
|
|
|
14766
14813
|
height: number()
|
|
14767
14814
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
14768
14815
|
/**
|
|
14816
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
14817
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
14818
|
+
*
|
|
14819
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
14820
|
+
*
|
|
14821
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
14822
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
14823
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
14824
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
14825
|
+
* somebody to forget to edit.
|
|
14826
|
+
*
|
|
14827
|
+
* They are not merged, because their invariants are opposites:
|
|
14828
|
+
*
|
|
14829
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
14830
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
14831
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
14832
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
14833
|
+
* and it is exactly what an absent entry cannot say.
|
|
14834
|
+
*
|
|
14835
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
14836
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
14837
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
14838
|
+
* has no process.
|
|
14839
|
+
*
|
|
14840
|
+
* ## Why not a log line, since the counters already exist
|
|
14841
|
+
*
|
|
14842
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
14843
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
14844
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
14845
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
14846
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
14847
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
14848
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
14849
|
+
* be READ.
|
|
14850
|
+
*
|
|
14851
|
+
* ## The rate is served with its denominator or not at all
|
|
14852
|
+
*
|
|
14853
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
14854
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
14855
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
14856
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
14857
|
+
* reproduces that mistake on every read.
|
|
14858
|
+
*
|
|
14859
|
+
* ## Shape
|
|
14860
|
+
*
|
|
14861
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
14862
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
14863
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
14864
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
14865
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
14866
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
14867
|
+
* result through `system.getFailureContributions`.
|
|
14868
|
+
*/
|
|
14869
|
+
var FailureReasonCountSchema = object({
|
|
14870
|
+
/**
|
|
14871
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
14872
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
14873
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
14874
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
14875
|
+
* vocabulary for the same loss would make the row and the counter
|
|
14876
|
+
* un-joinable.
|
|
14877
|
+
*/
|
|
14878
|
+
reason: string(),
|
|
14879
|
+
count: number().int().nonnegative()
|
|
14880
|
+
});
|
|
14881
|
+
var FailureContributionSchema = object({
|
|
14882
|
+
/**
|
|
14883
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
14884
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
14885
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
14886
|
+
* is a central list that rots invisibly.
|
|
14887
|
+
*/
|
|
14888
|
+
family: string(),
|
|
14889
|
+
/**
|
|
14890
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
14891
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
14892
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
14893
|
+
* cannot answer the only question anybody asks of this surface.
|
|
14894
|
+
*/
|
|
14895
|
+
deviceId: number().int().positive(),
|
|
14896
|
+
/**
|
|
14897
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
14898
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
14899
|
+
* family has a single variant.
|
|
14900
|
+
*/
|
|
14901
|
+
variant: string().optional(),
|
|
14902
|
+
/**
|
|
14903
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
14904
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
14905
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
14906
|
+
* `LoadContribution.startedAtMs`.
|
|
14907
|
+
*/
|
|
14908
|
+
sinceMs: number(),
|
|
14909
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
14910
|
+
atMs: number(),
|
|
14911
|
+
/**
|
|
14912
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
14913
|
+
* window. A failure count published without it is the mistake this schema
|
|
14914
|
+
* exists to make impossible.
|
|
14915
|
+
*/
|
|
14916
|
+
attempts: number().int().nonnegative(),
|
|
14917
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
14918
|
+
succeeded: number().int().nonnegative(),
|
|
14919
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
14920
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
14921
|
+
});
|
|
14922
|
+
var failureContributionCapability = {
|
|
14923
|
+
name: "failure-contribution",
|
|
14924
|
+
scope: "system",
|
|
14925
|
+
mode: "collection",
|
|
14926
|
+
internal: true,
|
|
14927
|
+
methods: {
|
|
14928
|
+
/**
|
|
14929
|
+
* This addon's per-camera failure counters, read live from bounded in-RAM
|
|
14930
|
+
* state it already keeps. Inert: no persistence, no sampling, no timer.
|
|
14931
|
+
*
|
|
14932
|
+
* READING NEVER RESETS. The counters are CUMULATIVE since `sinceMs`, and a
|
|
14933
|
+
* consumer that wants a rate differences two reads. A draining read would
|
|
14934
|
+
* make two operators with the page open each destroy half of the other's
|
|
14935
|
+
* numbers, and `load-contribution` already settled the same question the
|
|
14936
|
+
* same way for `cpuSeconds`.
|
|
14937
|
+
*/
|
|
14938
|
+
list: method(_void(), array(FailureContributionSchema).readonly()) },
|
|
14939
|
+
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
14940
|
+
mount: { kind: "skip" }
|
|
14941
|
+
};
|
|
14942
|
+
/**
|
|
14769
14943
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
14770
14944
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
14771
14945
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -15287,6 +15461,82 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
15287
15461
|
kind: "mutation",
|
|
15288
15462
|
auth: "admin"
|
|
15289
15463
|
});
|
|
15464
|
+
var LoadContributionSchema = object({
|
|
15465
|
+
role: _enum([
|
|
15466
|
+
"decode",
|
|
15467
|
+
"transcode",
|
|
15468
|
+
"recording",
|
|
15469
|
+
"streaming",
|
|
15470
|
+
"detection"
|
|
15471
|
+
]),
|
|
15472
|
+
/**
|
|
15473
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
15474
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
15475
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
15476
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
15477
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
15478
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
15479
|
+
*/
|
|
15480
|
+
deviceId: number().int().positive().nullable(),
|
|
15481
|
+
attribution: _enum([
|
|
15482
|
+
"measured",
|
|
15483
|
+
"accounted",
|
|
15484
|
+
"unattributable"
|
|
15485
|
+
]),
|
|
15486
|
+
/**
|
|
15487
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
15488
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
15489
|
+
* family and inventing a common one would lose the only information that
|
|
15490
|
+
* makes two entries for the same camera distinguishable.
|
|
15491
|
+
*/
|
|
15492
|
+
unit: string(),
|
|
15493
|
+
/**
|
|
15494
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
15495
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
15496
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
15497
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
15498
|
+
* process of its own.
|
|
15499
|
+
*/
|
|
15500
|
+
pid: number().int().positive().optional(),
|
|
15501
|
+
/**
|
|
15502
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
15503
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
15504
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
15505
|
+
* process.
|
|
15506
|
+
*/
|
|
15507
|
+
startedAtMs: number().optional(),
|
|
15508
|
+
/**
|
|
15509
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
15510
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
15511
|
+
* contribution is asked for.
|
|
15512
|
+
*
|
|
15513
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
15514
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
15515
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
15516
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
15517
|
+
*
|
|
15518
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
15519
|
+
* an entry with no process.
|
|
15520
|
+
*/
|
|
15521
|
+
cpuSeconds: number().optional(),
|
|
15522
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
15523
|
+
rssBytes: number().optional()
|
|
15524
|
+
});
|
|
15525
|
+
var loadContributionCapability = {
|
|
15526
|
+
name: "load-contribution",
|
|
15527
|
+
scope: "system",
|
|
15528
|
+
mode: "collection",
|
|
15529
|
+
internal: true,
|
|
15530
|
+
methods: {
|
|
15531
|
+
/**
|
|
15532
|
+
* This addon's own cost entries, computed live from state it already
|
|
15533
|
+
* holds. Inert: no persistence, no sampling, no timer. It is answered on
|
|
15534
|
+
* whatever beat the caller already has.
|
|
15535
|
+
*/
|
|
15536
|
+
list: method(_void(), array(LoadContributionSchema).readonly()) },
|
|
15537
|
+
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
15538
|
+
mount: { kind: "skip" }
|
|
15539
|
+
};
|
|
15290
15540
|
/**
|
|
15291
15541
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
15292
15542
|
* through. It stores nothing.
|
|
@@ -15384,209 +15634,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
15384
15634
|
tags: record(string(), string()).optional()
|
|
15385
15635
|
}), array(LogEntrySchema).readonly());
|
|
15386
15636
|
/**
|
|
15387
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
15388
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
15389
|
-
*
|
|
15390
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
15391
|
-
*
|
|
15392
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
15393
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
15394
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
15395
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
15396
|
-
* somebody to forget to edit.
|
|
15397
|
-
*
|
|
15398
|
-
* They are not merged, because their invariants are opposites:
|
|
15399
|
-
*
|
|
15400
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
15401
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
15402
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
15403
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
15404
|
-
* and it is exactly what an absent entry cannot say.
|
|
15405
|
-
*
|
|
15406
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
15407
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
15408
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
15409
|
-
* has no process.
|
|
15410
|
-
*
|
|
15411
|
-
* ## Why not a log line, since the counters already exist
|
|
15412
|
-
*
|
|
15413
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
15414
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
15415
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
15416
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
15417
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
15418
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
15419
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
15420
|
-
* be READ.
|
|
15421
|
-
*
|
|
15422
|
-
* ## The rate is served with its denominator or not at all
|
|
15423
|
-
*
|
|
15424
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
15425
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
15426
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
15427
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
15428
|
-
* reproduces that mistake on every read.
|
|
15429
|
-
*
|
|
15430
|
-
* ## Shape
|
|
15431
|
-
*
|
|
15432
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
15433
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
15434
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
15435
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
15436
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
15437
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
15438
|
-
* result through `system.getFailureContributions`.
|
|
15439
|
-
*/
|
|
15440
|
-
var FailureReasonCountSchema = object({
|
|
15441
|
-
/**
|
|
15442
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
15443
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
15444
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
15445
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
15446
|
-
* vocabulary for the same loss would make the row and the counter
|
|
15447
|
-
* un-joinable.
|
|
15448
|
-
*/
|
|
15449
|
-
reason: string(),
|
|
15450
|
-
count: number().int().nonnegative()
|
|
15451
|
-
});
|
|
15452
|
-
var FailureContributionSchema = object({
|
|
15453
|
-
/**
|
|
15454
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
15455
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
15456
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
15457
|
-
* is a central list that rots invisibly.
|
|
15458
|
-
*/
|
|
15459
|
-
family: string(),
|
|
15460
|
-
/**
|
|
15461
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
15462
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
15463
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
15464
|
-
* cannot answer the only question anybody asks of this surface.
|
|
15465
|
-
*/
|
|
15466
|
-
deviceId: number().int().positive(),
|
|
15467
|
-
/**
|
|
15468
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
15469
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
15470
|
-
* family has a single variant.
|
|
15471
|
-
*/
|
|
15472
|
-
variant: string().optional(),
|
|
15473
|
-
/**
|
|
15474
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
15475
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
15476
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
15477
|
-
* `LoadContribution.startedAtMs`.
|
|
15478
|
-
*/
|
|
15479
|
-
sinceMs: number(),
|
|
15480
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
15481
|
-
atMs: number(),
|
|
15482
|
-
/**
|
|
15483
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
15484
|
-
* window. A failure count published without it is the mistake this schema
|
|
15485
|
-
* exists to make impossible.
|
|
15486
|
-
*/
|
|
15487
|
-
attempts: number().int().nonnegative(),
|
|
15488
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
15489
|
-
succeeded: number().int().nonnegative(),
|
|
15490
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
15491
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
15492
|
-
});
|
|
15493
|
-
var failureContributionCapability = {
|
|
15494
|
-
name: "failure-contribution",
|
|
15495
|
-
scope: "system",
|
|
15496
|
-
mode: "collection",
|
|
15497
|
-
internal: true,
|
|
15498
|
-
methods: {
|
|
15499
|
-
/**
|
|
15500
|
-
* This addon's per-camera failure counters, read live from bounded in-RAM
|
|
15501
|
-
* state it already keeps. Inert: no persistence, no sampling, no timer.
|
|
15502
|
-
*
|
|
15503
|
-
* READING NEVER RESETS. The counters are CUMULATIVE since `sinceMs`, and a
|
|
15504
|
-
* consumer that wants a rate differences two reads. A draining read would
|
|
15505
|
-
* make two operators with the page open each destroy half of the other's
|
|
15506
|
-
* numbers, and `load-contribution` already settled the same question the
|
|
15507
|
-
* same way for `cpuSeconds`.
|
|
15508
|
-
*/
|
|
15509
|
-
list: method(_void(), array(FailureContributionSchema).readonly()) },
|
|
15510
|
-
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
15511
|
-
mount: { kind: "skip" }
|
|
15512
|
-
};
|
|
15513
|
-
var LoadContributionSchema = object({
|
|
15514
|
-
role: _enum([
|
|
15515
|
-
"decode",
|
|
15516
|
-
"transcode",
|
|
15517
|
-
"recording",
|
|
15518
|
-
"streaming",
|
|
15519
|
-
"detection"
|
|
15520
|
-
]),
|
|
15521
|
-
/**
|
|
15522
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
15523
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
15524
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
15525
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
15526
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
15527
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
15528
|
-
*/
|
|
15529
|
-
deviceId: number().int().positive().nullable(),
|
|
15530
|
-
attribution: _enum([
|
|
15531
|
-
"measured",
|
|
15532
|
-
"accounted",
|
|
15533
|
-
"unattributable"
|
|
15534
|
-
]),
|
|
15535
|
-
/**
|
|
15536
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
15537
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
15538
|
-
* family and inventing a common one would lose the only information that
|
|
15539
|
-
* makes two entries for the same camera distinguishable.
|
|
15540
|
-
*/
|
|
15541
|
-
unit: string(),
|
|
15542
|
-
/**
|
|
15543
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
15544
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
15545
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
15546
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
15547
|
-
* process of its own.
|
|
15548
|
-
*/
|
|
15549
|
-
pid: number().int().positive().optional(),
|
|
15550
|
-
/**
|
|
15551
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
15552
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
15553
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
15554
|
-
* process.
|
|
15555
|
-
*/
|
|
15556
|
-
startedAtMs: number().optional(),
|
|
15557
|
-
/**
|
|
15558
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
15559
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
15560
|
-
* contribution is asked for.
|
|
15561
|
-
*
|
|
15562
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
15563
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
15564
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
15565
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
15566
|
-
*
|
|
15567
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
15568
|
-
* an entry with no process.
|
|
15569
|
-
*/
|
|
15570
|
-
cpuSeconds: number().optional(),
|
|
15571
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
15572
|
-
rssBytes: number().optional()
|
|
15573
|
-
});
|
|
15574
|
-
var loadContributionCapability = {
|
|
15575
|
-
name: "load-contribution",
|
|
15576
|
-
scope: "system",
|
|
15577
|
-
mode: "collection",
|
|
15578
|
-
internal: true,
|
|
15579
|
-
methods: {
|
|
15580
|
-
/**
|
|
15581
|
-
* This addon's own cost entries, computed live from state it already
|
|
15582
|
-
* holds. Inert: no persistence, no sampling, no timer. It is answered on
|
|
15583
|
-
* whatever beat the caller already has.
|
|
15584
|
-
*/
|
|
15585
|
-
list: method(_void(), array(LoadContributionSchema).readonly()) },
|
|
15586
|
-
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
15587
|
-
mount: { kind: "skip" }
|
|
15588
|
-
};
|
|
15589
|
-
/**
|
|
15590
15637
|
* `login-method` — collection cap through which auth addons contribute
|
|
15591
15638
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
15592
15639
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -20773,12 +20820,53 @@ var MediaFileKindEnum = _enum([
|
|
|
20773
20820
|
"keyFrameSmall",
|
|
20774
20821
|
"thumbnailSmall"
|
|
20775
20822
|
]);
|
|
20823
|
+
/**
|
|
20824
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
20825
|
+
* ARE — never the bytes themselves.
|
|
20826
|
+
*
|
|
20827
|
+
* ## Why `url` and not `base64`
|
|
20828
|
+
*
|
|
20829
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
20830
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
20831
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
20832
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
20833
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
20834
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
20835
|
+
*
|
|
20836
|
+
* `url` points at the `event-media` data plane
|
|
20837
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
20838
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
20839
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
20840
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
20841
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
20842
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
20843
|
+
* (per-device scoping).
|
|
20844
|
+
*
|
|
20845
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
20846
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
20847
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
20848
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
20849
|
+
*
|
|
20850
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
20851
|
+
*
|
|
20852
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
20853
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
20854
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
20855
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
20856
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
20857
|
+
* delete this line and the `withBytes` pass-through in
|
|
20858
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
20859
|
+
*/
|
|
20776
20860
|
var MediaFileSchema = object({
|
|
20777
20861
|
key: string(),
|
|
20778
20862
|
kind: MediaFileKindEnum,
|
|
20779
|
-
base64: string(),
|
|
20780
20863
|
sizeBytes: number(),
|
|
20781
20864
|
timestamp: number()
|
|
20865
|
+
}).extend({
|
|
20866
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
20867
|
+
url: string(),
|
|
20868
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
20869
|
+
base64: string()
|
|
20782
20870
|
});
|
|
20783
20871
|
/**
|
|
20784
20872
|
* One media row WITHOUT its bytes.
|
|
@@ -20790,7 +20878,9 @@ var MediaFileSchema = object({
|
|
|
20790
20878
|
* blocks the whole view.
|
|
20791
20879
|
*
|
|
20792
20880
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
20793
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
20881
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
20882
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
20883
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
20794
20884
|
*/
|
|
20795
20885
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
20796
20886
|
/**
|
|
@@ -21479,6 +21569,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
21479
21569
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
21480
21570
|
trackId: string(),
|
|
21481
21571
|
deviceId: number()
|
|
21572
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
21573
|
+
eventId: string(),
|
|
21574
|
+
deviceId: number()
|
|
21482
21575
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
21483
21576
|
kind: "mutation",
|
|
21484
21577
|
auth: "admin"
|
|
@@ -26050,10 +26143,24 @@ var FaceClusterSchema = object({
|
|
|
26050
26143
|
size: number().int(),
|
|
26051
26144
|
cohesion: number()
|
|
26052
26145
|
});
|
|
26146
|
+
/**
|
|
26147
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
26148
|
+
* are — never the bytes.
|
|
26149
|
+
*
|
|
26150
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
26151
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
26152
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
26153
|
+
* caller is the admin UI's detail modal, which was building
|
|
26154
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
26155
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
26156
|
+
*
|
|
26157
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
26158
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
26159
|
+
*/
|
|
26053
26160
|
var MediaFileLiteSchema$1 = object({
|
|
26054
26161
|
key: string(),
|
|
26055
26162
|
kind: string(),
|
|
26056
|
-
|
|
26163
|
+
url: string(),
|
|
26057
26164
|
sizeBytes: number(),
|
|
26058
26165
|
timestamp: number()
|
|
26059
26166
|
});
|
|
@@ -28305,10 +28412,24 @@ var PlateInfoSchema = object({
|
|
|
28305
28412
|
*/
|
|
28306
28413
|
cropUrl: string().optional()
|
|
28307
28414
|
});
|
|
28415
|
+
/**
|
|
28416
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
28417
|
+
* are — never the bytes.
|
|
28418
|
+
*
|
|
28419
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
28420
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
28421
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
28422
|
+
* caller is the admin UI's detail modal, which was building
|
|
28423
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
28424
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
28425
|
+
*
|
|
28426
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
28427
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
28428
|
+
*/
|
|
28308
28429
|
var MediaFileLiteSchema = object({
|
|
28309
28430
|
key: string(),
|
|
28310
28431
|
kind: string(),
|
|
28311
|
-
|
|
28432
|
+
url: string(),
|
|
28312
28433
|
sizeBytes: number(),
|
|
28313
28434
|
timestamp: number()
|
|
28314
28435
|
});
|
|
@@ -34650,6 +34771,12 @@ Object.freeze({
|
|
|
34650
34771
|
addonId: null,
|
|
34651
34772
|
access: "view"
|
|
34652
34773
|
},
|
|
34774
|
+
"pipelineAnalytics.listEventMedia": {
|
|
34775
|
+
capName: "pipeline-analytics",
|
|
34776
|
+
capScope: "device",
|
|
34777
|
+
addonId: null,
|
|
34778
|
+
access: "view"
|
|
34779
|
+
},
|
|
34653
34780
|
"pipelineAnalytics.listGroups": {
|
|
34654
34781
|
capName: "pipeline-analytics",
|
|
34655
34782
|
capScope: "device",
|
|
@@ -38273,6 +38400,11 @@ Object.freeze({
|
|
|
38273
38400
|
form: "array",
|
|
38274
38401
|
optional: false
|
|
38275
38402
|
}],
|
|
38403
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
38404
|
+
name: "deviceId",
|
|
38405
|
+
form: "single",
|
|
38406
|
+
optional: false
|
|
38407
|
+
}],
|
|
38276
38408
|
"pipelineAnalytics.listGroups": [{
|
|
38277
38409
|
name: "deviceIds",
|
|
38278
38410
|
form: "array",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { M as audioKindId, Z as hfModelUrl, a as COCO_80_LABELS, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS } from "./dist-
|
|
1
|
+
import { M as audioKindId, Z as hfModelUrl, a as COCO_80_LABELS, o as COCO_TO_MACRO, r as AUDIO_MACRO_LABELS } from "./dist-Dsritt4-.mjs";
|
|
2
2
|
import { randomUUID } from "node:crypto";
|
|
3
3
|
//#region src/detection-pipeline/registry/model-catalogs.ts
|
|
4
4
|
var HF_REPO = "camstack/camstack-models";
|