@camstack/addon-pipeline 1.2.152 → 1.2.154
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-DoaR6NDJ.mjs → dist-B3LRtscY.mjs} +364 -207
- package/dist/{dist-BpofTthV.js → dist-CNyaLgDE.js} +364 -207
- package/dist/{lazy-sharp-D6sSNL-G.js → lazy-sharp-BtcZ-K2I.js} +1 -1
- package/dist/{local-frame-registry-Dr8irbU_.mjs → local-frame-registry-C5pZ5QSM.mjs} +1 -1
- package/dist/{local-frame-registry-4MCvZQ2t.js → local-frame-registry-TkoMo5_E.js} +1 -1
- package/dist/motion-wasm/index.js +2 -2
- package/dist/motion-wasm/index.mjs +1 -1
- package/dist/{node-CeSZTDKV.mjs → node-CtIkY7To.mjs} +1 -1
- package/dist/{node-DG_kTYFM.js → node-Ctiow9ZV.js} +1 -1
- package/dist/pipeline-runner/index.js +5 -5
- package/dist/pipeline-runner/index.mjs +4 -4
- package/dist/{process-memory-DJoquJSu.mjs → process-memory-C87TCFw5.mjs} +1 -1
- package/dist/{process-memory-DglWLA3J.js → process-memory-W1prDrmt.js} +1 -1
- package/dist/recorder/index.js +2 -2
- package/dist/recorder/index.mjs +2 -2
- package/dist/{segment-demux-js-Clx6DzLe.mjs → segment-demux-js-BXma5CQd.mjs} +1 -1
- package/dist/{segment-demux-js-DUSMkFTq.js → segment-demux-js-CnRETfAK.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-BntoKYim.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_stream_broker_widgets-oS7jpj-4.mjs} +3 -3
- package/dist/stream-broker/_virtual_mf___mfe_internal__addon_stream_broker_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-CVQG3RZ2.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-Vtqzcp6N.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--5tl1XaO.mjs → hostInit-BMp9L2lF.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-C8bHw-bu.js → worker-protocol-DOFTntiF.js} +1 -1
- package/dist/{worker-protocol-Ar0-GAh5.mjs → worker-protocol-DlDGOO8p.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-C-HJX19g.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
|
@@ -14836,6 +14836,133 @@ method(object({
|
|
|
14836
14836
|
height: number()
|
|
14837
14837
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
14838
14838
|
/**
|
|
14839
|
+
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
14840
|
+
* through, per camera, with the denominator attached. It stores nothing.
|
|
14841
|
+
*
|
|
14842
|
+
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
14843
|
+
*
|
|
14844
|
+
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
14845
|
+
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
14846
|
+
* copied: the contributor reports what it already knows, hub-main adds only
|
|
14847
|
+
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
14848
|
+
* somebody to forget to edit.
|
|
14849
|
+
*
|
|
14850
|
+
* They are not merged, because their invariants are opposites:
|
|
14851
|
+
*
|
|
14852
|
+
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
14853
|
+
* claim a camera cost nothing, which is a measurement nobody made;
|
|
14854
|
+
* - a `failure-contribution` zero is the **most valuable value on the
|
|
14855
|
+
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
14856
|
+
* and it is exactly what an absent entry cannot say.
|
|
14857
|
+
*
|
|
14858
|
+
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
14859
|
+
* that gives `load-contribution` its point: contributions are subtracted from
|
|
14860
|
+
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
14861
|
+
* has no process.
|
|
14862
|
+
*
|
|
14863
|
+
* ## Why not a log line, since the counters already exist
|
|
14864
|
+
*
|
|
14865
|
+
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
14866
|
+
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
14867
|
+
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
14868
|
+
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
14869
|
+
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
14870
|
+
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
14871
|
+
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
14872
|
+
* be READ.
|
|
14873
|
+
*
|
|
14874
|
+
* ## The rate is served with its denominator or not at all
|
|
14875
|
+
*
|
|
14876
|
+
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
14877
|
+
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
14878
|
+
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
14879
|
+
* successes on the same path. A surface that publishes only the numerator
|
|
14880
|
+
* reproduces that mistake on every read.
|
|
14881
|
+
*
|
|
14882
|
+
* ## Shape
|
|
14883
|
+
*
|
|
14884
|
+
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
14885
|
+
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
14886
|
+
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
14887
|
+
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
14888
|
+
* a forked runner's entries reach hub-main over transport that already exists.
|
|
14889
|
+
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
14890
|
+
* result through `system.getFailureContributions`.
|
|
14891
|
+
*/
|
|
14892
|
+
var FailureReasonCountSchema = object({
|
|
14893
|
+
/**
|
|
14894
|
+
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
14895
|
+
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
14896
|
+
* strings that already appear in this repo's logs and, where one exists, the
|
|
14897
|
+
* same string the per-track `previewMissReason` records (D276): a second
|
|
14898
|
+
* vocabulary for the same loss would make the row and the counter
|
|
14899
|
+
* un-joinable.
|
|
14900
|
+
*/
|
|
14901
|
+
reason: string(),
|
|
14902
|
+
count: number().int().nonnegative()
|
|
14903
|
+
});
|
|
14904
|
+
var FailureContributionSchema = object({
|
|
14905
|
+
/**
|
|
14906
|
+
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
14907
|
+
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
14908
|
+
* `unit` free: the families are owned by different addons and a shared enum
|
|
14909
|
+
* is a central list that rots invisibly.
|
|
14910
|
+
*/
|
|
14911
|
+
family: string(),
|
|
14912
|
+
/**
|
|
14913
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
14914
|
+
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
14915
|
+
* cannot name the camera must not emit the entry, because a fleet total
|
|
14916
|
+
* cannot answer the only question anybody asks of this surface.
|
|
14917
|
+
*/
|
|
14918
|
+
deviceId: number().int().positive(),
|
|
14919
|
+
/**
|
|
14920
|
+
* A second dimension inside the family: the model / step id for an inference
|
|
14921
|
+
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
14922
|
+
* family has a single variant.
|
|
14923
|
+
*/
|
|
14924
|
+
variant: string().optional(),
|
|
14925
|
+
/**
|
|
14926
|
+
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
14927
|
+
* differencing two reads must drop the interval when it changes, because the
|
|
14928
|
+
* counter restarted from zero in a respawned runner. Same discipline as
|
|
14929
|
+
* `LoadContribution.startedAtMs`.
|
|
14930
|
+
*/
|
|
14931
|
+
sinceMs: number(),
|
|
14932
|
+
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
14933
|
+
atMs: number(),
|
|
14934
|
+
/**
|
|
14935
|
+
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
14936
|
+
* window. A failure count published without it is the mistake this schema
|
|
14937
|
+
* exists to make impossible.
|
|
14938
|
+
*/
|
|
14939
|
+
attempts: number().int().nonnegative(),
|
|
14940
|
+
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
14941
|
+
succeeded: number().int().nonnegative(),
|
|
14942
|
+
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
14943
|
+
reasons: array(FailureReasonCountSchema).readonly()
|
|
14944
|
+
});
|
|
14945
|
+
var failureContributionCapability = {
|
|
14946
|
+
name: "failure-contribution",
|
|
14947
|
+
scope: "system",
|
|
14948
|
+
mode: "collection",
|
|
14949
|
+
internal: true,
|
|
14950
|
+
methods: {
|
|
14951
|
+
/**
|
|
14952
|
+
* This addon's per-camera failure counters, read live from bounded in-RAM
|
|
14953
|
+
* state it already keeps. Inert: no persistence, no sampling, no timer.
|
|
14954
|
+
*
|
|
14955
|
+
* READING NEVER RESETS. The counters are CUMULATIVE since `sinceMs`, and a
|
|
14956
|
+
* consumer that wants a rate differences two reads. A draining read would
|
|
14957
|
+
* make two operators with the page open each destroy half of the other's
|
|
14958
|
+
* numbers, and `load-contribution` already settled the same question the
|
|
14959
|
+
* same way for `cpuSeconds`.
|
|
14960
|
+
*/
|
|
14961
|
+
list: method(_void(), array(FailureContributionSchema).readonly()) },
|
|
14962
|
+
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
14963
|
+
mount: { kind: "skip" }
|
|
14964
|
+
};
|
|
14965
|
+
/**
|
|
14839
14966
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
14840
14967
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
14841
14968
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -15357,6 +15484,82 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
15357
15484
|
kind: "mutation",
|
|
15358
15485
|
auth: "admin"
|
|
15359
15486
|
});
|
|
15487
|
+
var LoadContributionSchema = object({
|
|
15488
|
+
role: _enum([
|
|
15489
|
+
"decode",
|
|
15490
|
+
"transcode",
|
|
15491
|
+
"recording",
|
|
15492
|
+
"streaming",
|
|
15493
|
+
"detection"
|
|
15494
|
+
]),
|
|
15495
|
+
/**
|
|
15496
|
+
* The NUMERIC device id — the same value every log line carries as
|
|
15497
|
+
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
15498
|
+
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
15499
|
+
* contributor that cannot name its camera must not emit the entry at all,
|
|
15500
|
+
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
15501
|
+
* and would quietly turn one camera's cost into everybody's.
|
|
15502
|
+
*/
|
|
15503
|
+
deviceId: number().int().positive().nullable(),
|
|
15504
|
+
attribution: _enum([
|
|
15505
|
+
"measured",
|
|
15506
|
+
"accounted",
|
|
15507
|
+
"unattributable"
|
|
15508
|
+
]),
|
|
15509
|
+
/**
|
|
15510
|
+
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
15511
|
+
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
15512
|
+
* family and inventing a common one would lose the only information that
|
|
15513
|
+
* makes two entries for the same camera distinguishable.
|
|
15514
|
+
*/
|
|
15515
|
+
unit: string(),
|
|
15516
|
+
/**
|
|
15517
|
+
* The OS process this cost lives in, when there is one. Present so a
|
|
15518
|
+
* consumer can (a) tell two generations of the same unit apart across a
|
|
15519
|
+
* restart, and (b) subtract claimed processes from the node's process
|
|
15520
|
+
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
15521
|
+
* process of its own.
|
|
15522
|
+
*/
|
|
15523
|
+
pid: number().int().positive().optional(),
|
|
15524
|
+
/**
|
|
15525
|
+
* When this generation started. The pid's incarnation marker: a consumer
|
|
15526
|
+
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
15527
|
+
* window when this changes, because the counter restarted from zero in a new
|
|
15528
|
+
* process.
|
|
15529
|
+
*/
|
|
15530
|
+
startedAtMs: number().optional(),
|
|
15531
|
+
/**
|
|
15532
|
+
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
15533
|
+
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
15534
|
+
* contribution is asked for.
|
|
15535
|
+
*
|
|
15536
|
+
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
15537
|
+
* needs a sampler, and a new per-node sampler is the defect half of
|
|
15538
|
+
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
15539
|
+
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
15540
|
+
*
|
|
15541
|
+
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
15542
|
+
* an entry with no process.
|
|
15543
|
+
*/
|
|
15544
|
+
cpuSeconds: number().optional(),
|
|
15545
|
+
/** Resident bytes of this unit's process, same source and same rules. */
|
|
15546
|
+
rssBytes: number().optional()
|
|
15547
|
+
});
|
|
15548
|
+
var loadContributionCapability = {
|
|
15549
|
+
name: "load-contribution",
|
|
15550
|
+
scope: "system",
|
|
15551
|
+
mode: "collection",
|
|
15552
|
+
internal: true,
|
|
15553
|
+
methods: {
|
|
15554
|
+
/**
|
|
15555
|
+
* This addon's own cost entries, computed live from state it already
|
|
15556
|
+
* holds. Inert: no persistence, no sampling, no timer. It is answered on
|
|
15557
|
+
* whatever beat the caller already has.
|
|
15558
|
+
*/
|
|
15559
|
+
list: method(_void(), array(LoadContributionSchema).readonly()) },
|
|
15560
|
+
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
15561
|
+
mount: { kind: "skip" }
|
|
15562
|
+
};
|
|
15360
15563
|
/**
|
|
15361
15564
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
15362
15565
|
* through. It stores nothing.
|
|
@@ -15454,209 +15657,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
15454
15657
|
tags: record(string(), string()).optional()
|
|
15455
15658
|
}), array(LogEntrySchema).readonly());
|
|
15456
15659
|
/**
|
|
15457
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
15458
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
15459
|
-
*
|
|
15460
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
15461
|
-
*
|
|
15462
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
15463
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
15464
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
15465
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
15466
|
-
* somebody to forget to edit.
|
|
15467
|
-
*
|
|
15468
|
-
* They are not merged, because their invariants are opposites:
|
|
15469
|
-
*
|
|
15470
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
15471
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
15472
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
15473
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
15474
|
-
* and it is exactly what an absent entry cannot say.
|
|
15475
|
-
*
|
|
15476
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
15477
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
15478
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
15479
|
-
* has no process.
|
|
15480
|
-
*
|
|
15481
|
-
* ## Why not a log line, since the counters already exist
|
|
15482
|
-
*
|
|
15483
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
15484
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
15485
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
15486
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
15487
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
15488
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
15489
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
15490
|
-
* be READ.
|
|
15491
|
-
*
|
|
15492
|
-
* ## The rate is served with its denominator or not at all
|
|
15493
|
-
*
|
|
15494
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
15495
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
15496
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
15497
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
15498
|
-
* reproduces that mistake on every read.
|
|
15499
|
-
*
|
|
15500
|
-
* ## Shape
|
|
15501
|
-
*
|
|
15502
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
15503
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
15504
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
15505
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
15506
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
15507
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
15508
|
-
* result through `system.getFailureContributions`.
|
|
15509
|
-
*/
|
|
15510
|
-
var FailureReasonCountSchema = object({
|
|
15511
|
-
/**
|
|
15512
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
15513
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
15514
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
15515
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
15516
|
-
* vocabulary for the same loss would make the row and the counter
|
|
15517
|
-
* un-joinable.
|
|
15518
|
-
*/
|
|
15519
|
-
reason: string(),
|
|
15520
|
-
count: number().int().nonnegative()
|
|
15521
|
-
});
|
|
15522
|
-
var FailureContributionSchema = object({
|
|
15523
|
-
/**
|
|
15524
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
15525
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
15526
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
15527
|
-
* is a central list that rots invisibly.
|
|
15528
|
-
*/
|
|
15529
|
-
family: string(),
|
|
15530
|
-
/**
|
|
15531
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
15532
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
15533
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
15534
|
-
* cannot answer the only question anybody asks of this surface.
|
|
15535
|
-
*/
|
|
15536
|
-
deviceId: number().int().positive(),
|
|
15537
|
-
/**
|
|
15538
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
15539
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
15540
|
-
* family has a single variant.
|
|
15541
|
-
*/
|
|
15542
|
-
variant: string().optional(),
|
|
15543
|
-
/**
|
|
15544
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
15545
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
15546
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
15547
|
-
* `LoadContribution.startedAtMs`.
|
|
15548
|
-
*/
|
|
15549
|
-
sinceMs: number(),
|
|
15550
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
15551
|
-
atMs: number(),
|
|
15552
|
-
/**
|
|
15553
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
15554
|
-
* window. A failure count published without it is the mistake this schema
|
|
15555
|
-
* exists to make impossible.
|
|
15556
|
-
*/
|
|
15557
|
-
attempts: number().int().nonnegative(),
|
|
15558
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
15559
|
-
succeeded: number().int().nonnegative(),
|
|
15560
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
15561
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
15562
|
-
});
|
|
15563
|
-
var failureContributionCapability = {
|
|
15564
|
-
name: "failure-contribution",
|
|
15565
|
-
scope: "system",
|
|
15566
|
-
mode: "collection",
|
|
15567
|
-
internal: true,
|
|
15568
|
-
methods: {
|
|
15569
|
-
/**
|
|
15570
|
-
* This addon's per-camera failure counters, read live from bounded in-RAM
|
|
15571
|
-
* state it already keeps. Inert: no persistence, no sampling, no timer.
|
|
15572
|
-
*
|
|
15573
|
-
* READING NEVER RESETS. The counters are CUMULATIVE since `sinceMs`, and a
|
|
15574
|
-
* consumer that wants a rate differences two reads. A draining read would
|
|
15575
|
-
* make two operators with the page open each destroy half of the other's
|
|
15576
|
-
* numbers, and `load-contribution` already settled the same question the
|
|
15577
|
-
* same way for `cpuSeconds`.
|
|
15578
|
-
*/
|
|
15579
|
-
list: method(_void(), array(FailureContributionSchema).readonly()) },
|
|
15580
|
-
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
15581
|
-
mount: { kind: "skip" }
|
|
15582
|
-
};
|
|
15583
|
-
var LoadContributionSchema = object({
|
|
15584
|
-
role: _enum([
|
|
15585
|
-
"decode",
|
|
15586
|
-
"transcode",
|
|
15587
|
-
"recording",
|
|
15588
|
-
"streaming",
|
|
15589
|
-
"detection"
|
|
15590
|
-
]),
|
|
15591
|
-
/**
|
|
15592
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
15593
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
15594
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
15595
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
15596
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
15597
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
15598
|
-
*/
|
|
15599
|
-
deviceId: number().int().positive().nullable(),
|
|
15600
|
-
attribution: _enum([
|
|
15601
|
-
"measured",
|
|
15602
|
-
"accounted",
|
|
15603
|
-
"unattributable"
|
|
15604
|
-
]),
|
|
15605
|
-
/**
|
|
15606
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
15607
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
15608
|
-
* family and inventing a common one would lose the only information that
|
|
15609
|
-
* makes two entries for the same camera distinguishable.
|
|
15610
|
-
*/
|
|
15611
|
-
unit: string(),
|
|
15612
|
-
/**
|
|
15613
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
15614
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
15615
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
15616
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
15617
|
-
* process of its own.
|
|
15618
|
-
*/
|
|
15619
|
-
pid: number().int().positive().optional(),
|
|
15620
|
-
/**
|
|
15621
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
15622
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
15623
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
15624
|
-
* process.
|
|
15625
|
-
*/
|
|
15626
|
-
startedAtMs: number().optional(),
|
|
15627
|
-
/**
|
|
15628
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
15629
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
15630
|
-
* contribution is asked for.
|
|
15631
|
-
*
|
|
15632
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
15633
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
15634
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
15635
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
15636
|
-
*
|
|
15637
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
15638
|
-
* an entry with no process.
|
|
15639
|
-
*/
|
|
15640
|
-
cpuSeconds: number().optional(),
|
|
15641
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
15642
|
-
rssBytes: number().optional()
|
|
15643
|
-
});
|
|
15644
|
-
var loadContributionCapability = {
|
|
15645
|
-
name: "load-contribution",
|
|
15646
|
-
scope: "system",
|
|
15647
|
-
mode: "collection",
|
|
15648
|
-
internal: true,
|
|
15649
|
-
methods: {
|
|
15650
|
-
/**
|
|
15651
|
-
* This addon's own cost entries, computed live from state it already
|
|
15652
|
-
* holds. Inert: no persistence, no sampling, no timer. It is answered on
|
|
15653
|
-
* whatever beat the caller already has.
|
|
15654
|
-
*/
|
|
15655
|
-
list: method(_void(), array(LoadContributionSchema).readonly()) },
|
|
15656
|
-
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
15657
|
-
mount: { kind: "skip" }
|
|
15658
|
-
};
|
|
15659
|
-
/**
|
|
15660
15660
|
* `login-method` — collection cap through which auth addons contribute
|
|
15661
15661
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
15662
15662
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -20843,12 +20843,53 @@ var MediaFileKindEnum = _enum([
|
|
|
20843
20843
|
"keyFrameSmall",
|
|
20844
20844
|
"thumbnailSmall"
|
|
20845
20845
|
]);
|
|
20846
|
+
/**
|
|
20847
|
+
* One media row ON THE WIRE: what it is, how big it is, and WHERE ITS BYTES
|
|
20848
|
+
* ARE — never the bytes themselves.
|
|
20849
|
+
*
|
|
20850
|
+
* ## Why `url` and not `base64`
|
|
20851
|
+
*
|
|
20852
|
+
* Measured on the live hub 2026-08-30: `getTrackMedia {trackId, deviceId}`
|
|
20853
|
+
* with no `kinds` returned 6 rows / **3 597 219 B**, of which `keyFrame` alone
|
|
20854
|
+
* was **2 824 077 B** — one full-resolution frame, base64, so +33 % on the
|
|
20855
|
+
* wire. Forty events is ~144 MB. Every byte of it was read off disk,
|
|
20856
|
+
* base64-encoded, held whole in a unary tRPC envelope, and materialised in
|
|
20857
|
+
* hub-main's heap on the way past — for an `<img>` that would have cached it.
|
|
20858
|
+
*
|
|
20859
|
+
* `url` points at the `event-media` data plane
|
|
20860
|
+
* (`/addon/<addonId>/event-media/<storedKey>`), which serves the same blob
|
|
20861
|
+
* with an ETag and `Cache-Control: immutable`, honours conditional GETs, can
|
|
20862
|
+
* render a `?variant=thumb`, and streams. The hub gate in front of it requires
|
|
20863
|
+
* a bearer or the session cookie (`access: 'authenticated'`), so the bytes are
|
|
20864
|
+
* no less protected than they were inside a `view`-level cap response — see
|
|
20865
|
+
* `data-plane-access.ts` for the rule and the one gap it does not close
|
|
20866
|
+
* (per-device scoping).
|
|
20867
|
+
*
|
|
20868
|
+
* The URL is built from the row's **stored** key, which is not always its
|
|
20869
|
+
* published `kind`: a track's face/plate crop is stored as `crop` under
|
|
20870
|
+
* `('face'|'plate', '<prefix>-<trackId>')` and published as
|
|
20871
|
+
* `faceCrop`/`plateCrop`. `MediaStore.getByKey` knows only the stored key.
|
|
20872
|
+
*
|
|
20873
|
+
* ## `base64` is TRANSITIONAL and is going away
|
|
20874
|
+
*
|
|
20875
|
+
* It is still populated for one reason: the deployed viewer's track-detail
|
|
20876
|
+
* HERO tile reads it (`use-track-media-entry.ts` → `parseMediaFiles`, which
|
|
20877
|
+
* REQUIRES the field), and a row without it parses as a FAILED read — the red
|
|
20878
|
+
* triangle — not as absence. Removing the field before that viewer ships is an
|
|
20879
|
+
* outage, not a cleanup. Once the viewer takes its hero bytes from `url`,
|
|
20880
|
+
* delete this line and the `withBytes` pass-through in
|
|
20881
|
+
* `analytics-query-facade.ts`; nothing else reads it.
|
|
20882
|
+
*/
|
|
20846
20883
|
var MediaFileSchema = object({
|
|
20847
20884
|
key: string(),
|
|
20848
20885
|
kind: MediaFileKindEnum,
|
|
20849
|
-
base64: string(),
|
|
20850
20886
|
sizeBytes: number(),
|
|
20851
20887
|
timestamp: number()
|
|
20888
|
+
}).extend({
|
|
20889
|
+
/** `/addon/<addonId>/event-media/<encoded stored key>`. Always present. */
|
|
20890
|
+
url: string(),
|
|
20891
|
+
/** @deprecated Transitional — see the schema docblock. Use {@link url}. */
|
|
20892
|
+
base64: string()
|
|
20852
20893
|
});
|
|
20853
20894
|
/**
|
|
20854
20895
|
* One media row WITHOUT its bytes.
|
|
@@ -20860,7 +20901,9 @@ var MediaFileSchema = object({
|
|
|
20860
20901
|
* blocks the whole view.
|
|
20861
20902
|
*
|
|
20862
20903
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
20863
|
-
* stored blob and a `?variant=thumb` rendering without fetching either
|
|
20904
|
+
* stored blob and a `?variant=thumb` rendering without fetching either, and
|
|
20905
|
+
* `url` because a client that had to build the plane path itself is a second
|
|
20906
|
+
* copy of a route — the embed, the viewer and the admin UI each grew one.
|
|
20864
20907
|
*/
|
|
20865
20908
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
20866
20909
|
/**
|
|
@@ -21207,6 +21250,50 @@ var EventStoreFootprintSchema = object({
|
|
|
21207
21250
|
totalBytes: number().int(),
|
|
21208
21251
|
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
21209
21252
|
});
|
|
21253
|
+
/** Event-media footprint for one {@link MediaFileKind}. */
|
|
21254
|
+
var EventMediaKindFootprintSchema = object({
|
|
21255
|
+
kind: MediaFileKindEnum,
|
|
21256
|
+
/** Media rows of this kind. */
|
|
21257
|
+
rows: number().int(),
|
|
21258
|
+
/** Bytes on disk held by those rows. */
|
|
21259
|
+
bytes: number().int()
|
|
21260
|
+
});
|
|
21261
|
+
/**
|
|
21262
|
+
* The media footprint broken down by KIND — the axis a deletion decision
|
|
21263
|
+
* actually turns on.
|
|
21264
|
+
*
|
|
21265
|
+
* A byte total says how much there is; it cannot say what is safe to remove.
|
|
21266
|
+
* The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
|
|
21267
|
+
* motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
|
|
21268
|
+
* `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
|
|
21269
|
+
* buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
|
|
21270
|
+
* nothing else, so sizing a deletion means summing per kind.
|
|
21271
|
+
*
|
|
21272
|
+
* ## Why `unaccounted*` exists
|
|
21273
|
+
*
|
|
21274
|
+
* `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
|
|
21275
|
+
* writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
|
|
21276
|
+
* from a SEPARATE unfiltered aggregate over the same rows, never from adding
|
|
21277
|
+
* `kinds` up. A row whose stored `kind` is not in the enum (written by a
|
|
21278
|
+
* retired code path, or by a version that knew a kind this one does not) would
|
|
21279
|
+
* otherwise vanish from the total silently, and an operator would delete
|
|
21280
|
+
* against a denominator smaller than the disk.
|
|
21281
|
+
*
|
|
21282
|
+
* `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
|
|
21283
|
+
* zero; a non-zero value is a real finding and must be shown, not rounded away.
|
|
21284
|
+
*/
|
|
21285
|
+
var EventMediaKindBreakdownSchema = object({
|
|
21286
|
+
/** Every media row in scope, from one unfiltered aggregate. */
|
|
21287
|
+
totalRows: number().int(),
|
|
21288
|
+
/** Every media byte in scope, from that same aggregate. */
|
|
21289
|
+
totalBytes: number().int(),
|
|
21290
|
+
/** Per-kind footprint, ordered by bytes descending. */
|
|
21291
|
+
kinds: array(EventMediaKindFootprintSchema).readonly(),
|
|
21292
|
+
/** `totalRows` minus the summed `kinds` rows — see the schema note. */
|
|
21293
|
+
unaccountedRows: number().int(),
|
|
21294
|
+
/** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
|
|
21295
|
+
unaccountedBytes: number().int()
|
|
21296
|
+
});
|
|
21210
21297
|
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
21211
21298
|
var EventPruneCountsSchema = object({
|
|
21212
21299
|
motion: number().int(),
|
|
@@ -21410,6 +21497,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
21410
21497
|
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
21411
21498
|
kind: "query",
|
|
21412
21499
|
auth: "admin"
|
|
21500
|
+
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
21501
|
+
kind: "query",
|
|
21502
|
+
auth: "admin"
|
|
21413
21503
|
}), method(object({
|
|
21414
21504
|
olderThanMs: number(),
|
|
21415
21505
|
reason: OpsLogReasonSchema.optional()
|
|
@@ -21549,6 +21639,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
21549
21639
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
21550
21640
|
trackId: string(),
|
|
21551
21641
|
deviceId: number()
|
|
21642
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
21643
|
+
eventId: string(),
|
|
21644
|
+
deviceId: number()
|
|
21552
21645
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
21553
21646
|
kind: "mutation",
|
|
21554
21647
|
auth: "admin"
|
|
@@ -23500,6 +23593,20 @@ method(object({
|
|
|
23500
23593
|
error: string().optional()
|
|
23501
23594
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
23502
23595
|
providerId: string(),
|
|
23596
|
+
/**
|
|
23597
|
+
* The location this config is an UNSAVED edit of, when there is one.
|
|
23598
|
+
*
|
|
23599
|
+
* `listLocations` replaces every declared secret with the redaction
|
|
23600
|
+
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
23601
|
+
* credential the operator did not retype — and posting that here
|
|
23602
|
+
* without a way to resolve it makes the provider try to authenticate
|
|
23603
|
+
* as `__camstack_redacted__` and report the operator's own working
|
|
23604
|
+
* password as wrong. Given this id, the orchestrator restores each
|
|
23605
|
+
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
23606
|
+
* before dispatching. Omitted by the "Add location" wizard, where
|
|
23607
|
+
* every value was typed just now and nothing is stored yet.
|
|
23608
|
+
*/
|
|
23609
|
+
locationId: string().optional(),
|
|
23503
23610
|
config: record(string(), unknown())
|
|
23504
23611
|
}), object({
|
|
23505
23612
|
ok: boolean(),
|
|
@@ -26120,10 +26227,24 @@ var FaceClusterSchema = object({
|
|
|
26120
26227
|
size: number().int(),
|
|
26121
26228
|
cohesion: number()
|
|
26122
26229
|
});
|
|
26230
|
+
/**
|
|
26231
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
26232
|
+
* are — never the bytes.
|
|
26233
|
+
*
|
|
26234
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
26235
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
26236
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
26237
|
+
* caller is the admin UI's detail modal, which was building
|
|
26238
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
26239
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
26240
|
+
*
|
|
26241
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
26242
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
26243
|
+
*/
|
|
26123
26244
|
var MediaFileLiteSchema$1 = object({
|
|
26124
26245
|
key: string(),
|
|
26125
26246
|
kind: string(),
|
|
26126
|
-
|
|
26247
|
+
url: string(),
|
|
26127
26248
|
sizeBytes: number(),
|
|
26128
26249
|
timestamp: number()
|
|
26129
26250
|
});
|
|
@@ -28375,10 +28496,24 @@ var PlateInfoSchema = object({
|
|
|
28375
28496
|
*/
|
|
28376
28497
|
cropUrl: string().optional()
|
|
28377
28498
|
});
|
|
28499
|
+
/**
|
|
28500
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
28501
|
+
* are — never the bytes.
|
|
28502
|
+
*
|
|
28503
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
28504
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
28505
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
28506
|
+
* caller is the admin UI's detail modal, which was building
|
|
28507
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
28508
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
28509
|
+
*
|
|
28510
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
28511
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
28512
|
+
*/
|
|
28378
28513
|
var MediaFileLiteSchema = object({
|
|
28379
28514
|
key: string(),
|
|
28380
28515
|
kind: string(),
|
|
28381
|
-
|
|
28516
|
+
url: string(),
|
|
28382
28517
|
sizeBytes: number(),
|
|
28383
28518
|
timestamp: number()
|
|
28384
28519
|
});
|
|
@@ -34624,6 +34759,12 @@ Object.freeze({
|
|
|
34624
34759
|
addonId: null,
|
|
34625
34760
|
access: "view"
|
|
34626
34761
|
},
|
|
34762
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": {
|
|
34763
|
+
capName: "pipeline-analytics",
|
|
34764
|
+
capScope: "device",
|
|
34765
|
+
addonId: null,
|
|
34766
|
+
access: "view"
|
|
34767
|
+
},
|
|
34627
34768
|
"pipelineAnalytics.getEventStoreFootprint": {
|
|
34628
34769
|
capName: "pipeline-analytics",
|
|
34629
34770
|
capScope: "device",
|
|
@@ -34720,6 +34861,12 @@ Object.freeze({
|
|
|
34720
34861
|
addonId: null,
|
|
34721
34862
|
access: "view"
|
|
34722
34863
|
},
|
|
34864
|
+
"pipelineAnalytics.listEventMedia": {
|
|
34865
|
+
capName: "pipeline-analytics",
|
|
34866
|
+
capScope: "device",
|
|
34867
|
+
addonId: null,
|
|
34868
|
+
access: "view"
|
|
34869
|
+
},
|
|
34723
34870
|
"pipelineAnalytics.listGroups": {
|
|
34724
34871
|
capName: "pipeline-analytics",
|
|
34725
34872
|
capScope: "device",
|
|
@@ -38283,6 +38430,11 @@ Object.freeze({
|
|
|
38283
38430
|
form: "single",
|
|
38284
38431
|
optional: false
|
|
38285
38432
|
}],
|
|
38433
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": [{
|
|
38434
|
+
name: "deviceId",
|
|
38435
|
+
form: "single",
|
|
38436
|
+
optional: true
|
|
38437
|
+
}],
|
|
38286
38438
|
"pipelineAnalytics.getGroup": [{
|
|
38287
38439
|
name: "deviceId",
|
|
38288
38440
|
form: "single",
|
|
@@ -38343,6 +38495,11 @@ Object.freeze({
|
|
|
38343
38495
|
form: "array",
|
|
38344
38496
|
optional: false
|
|
38345
38497
|
}],
|
|
38498
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
38499
|
+
name: "deviceId",
|
|
38500
|
+
form: "single",
|
|
38501
|
+
optional: false
|
|
38502
|
+
}],
|
|
38346
38503
|
"pipelineAnalytics.listGroups": [{
|
|
38347
38504
|
name: "deviceIds",
|
|
38348
38505
|
form: "array",
|