@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
|
@@ -14813,6 +14813,133 @@ method(object({
|
|
|
14813
14813
|
height: number()
|
|
14814
14814
|
}), EmbeddingResultSchema, { auth: "admin" }), method(object({ text: string() }), EmbeddingResultSchema, { auth: "admin" }), method(_void(), EmbeddingInfoSchema, { auth: "admin" });
|
|
14815
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
|
+
/**
|
|
14816
14943
|
* filesystem-browse — per-node capability for browsing the node's local
|
|
14817
14944
|
* filesystem. Reads are unconfined (whole filesystem, from `/` down); WRITES
|
|
14818
14945
|
* are sandboxed to operator-configured allowed roots (D115). Used by the
|
|
@@ -15334,6 +15461,82 @@ method(LlmGenerateBaseInputSchema, LlmGenerateResultSchema, { kind: "mutation" }
|
|
|
15334
15461
|
kind: "mutation",
|
|
15335
15462
|
auth: "admin"
|
|
15336
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
|
+
};
|
|
15337
15540
|
/**
|
|
15338
15541
|
* `log-channels` — the capability an addon DECLARES its diagnostic channels
|
|
15339
15542
|
* through. It stores nothing.
|
|
@@ -15431,209 +15634,6 @@ method(LogEntrySchema, _void(), { kind: "mutation" }), method(object({
|
|
|
15431
15634
|
tags: record(string(), string()).optional()
|
|
15432
15635
|
}), array(LogEntrySchema).readonly());
|
|
15433
15636
|
/**
|
|
15434
|
-
* `failure-contribution` — the capability an addon reports its OWN losses
|
|
15435
|
-
* through, per camera, with the denominator attached. It stores nothing.
|
|
15436
|
-
*
|
|
15437
|
-
* ## The twin of `load-contribution`, and why it is a twin and not a field
|
|
15438
|
-
*
|
|
15439
|
-
* `load-contribution` answers *what did this camera COST*. This answers *what
|
|
15440
|
-
* did this camera LOSE*. The reporting discipline is identical and deliberately
|
|
15441
|
-
* copied: the contributor reports what it already knows, hub-main adds only
|
|
15442
|
-
* `addonId`, nothing needs global knowledge, and there is no central list for
|
|
15443
|
-
* somebody to forget to edit.
|
|
15444
|
-
*
|
|
15445
|
-
* They are not merged, because their invariants are opposites:
|
|
15446
|
-
*
|
|
15447
|
-
* - a `load-contribution` measurement is **absent, never zero** — a zero would
|
|
15448
|
-
* claim a camera cost nothing, which is a measurement nobody made;
|
|
15449
|
-
* - a `failure-contribution` zero is the **most valuable value on the
|
|
15450
|
-
* surface** — `attempts: 400, succeeded: 400` is the proof a fix landed,
|
|
15451
|
-
* and it is exactly what an absent entry cannot say.
|
|
15452
|
-
*
|
|
15453
|
-
* Putting a loss counter on a cost entry would also break the reconciliation
|
|
15454
|
-
* that gives `load-contribution` its point: contributions are subtracted from
|
|
15455
|
-
* `metrics.node-processes-snapshot` to find processes nobody claims. A failure
|
|
15456
|
-
* has no process.
|
|
15457
|
-
*
|
|
15458
|
-
* ## Why not a log line, since the counters already exist
|
|
15459
|
-
*
|
|
15460
|
-
* Several of these paths already counted themselves — `CaptureScheduler`'s
|
|
15461
|
-
* per-device window, `KeyFrameCaptureLog`, `bumpCropMetric`. Every one of them
|
|
15462
|
-
* ends in a log line, and a log line is the thing the operator asked to stop
|
|
15463
|
-
* needing: *"possiamo armare questi errori intanto? Così al prossimo giro
|
|
15464
|
-
* ricontrolliamo tutti questi punti"*. Reading them meant grepping Loki and
|
|
15465
|
-
* hand-correlating timestamps, which is how a 22% thumbnail gap and a 3-hour
|
|
15466
|
-
* media blackout were both diagnosed. The counters stay; this is where they can
|
|
15467
|
-
* be READ.
|
|
15468
|
-
*
|
|
15469
|
-
* ## The rate is served with its denominator or not at all
|
|
15470
|
-
*
|
|
15471
|
-
* Every entry carries `attempts` and `succeeded`. A miss count alone is
|
|
15472
|
-
* unreadable: on 2026-08-28 the enrichment-crop miss count read as "35x worse
|
|
15473
|
-
* than yesterday" and was **flat across twelve hours** once divided by the
|
|
15474
|
-
* successes on the same path. A surface that publishes only the numerator
|
|
15475
|
-
* reproduces that mistake on every read.
|
|
15476
|
-
*
|
|
15477
|
-
* ## Shape
|
|
15478
|
-
*
|
|
15479
|
-
* Copied from `load-contribution.cap.ts` (`mode: 'collection'`,
|
|
15480
|
-
* `internal: true`, `mount: { kind: 'skip' }`): no tRPC route of its own and no
|
|
15481
|
-
* generated hooks, while `addons.listCapabilityProviders` still enumerates it
|
|
15482
|
-
* and the hub's `CapabilityRegistry` still holds an RPC proxy per provider — so
|
|
15483
|
-
* a forked runner's entries reach hub-main over transport that already exists.
|
|
15484
|
-
* No new UDS message, no second registry (D3). The operator reads the assembled
|
|
15485
|
-
* result through `system.getFailureContributions`.
|
|
15486
|
-
*/
|
|
15487
|
-
var FailureReasonCountSchema = object({
|
|
15488
|
-
/**
|
|
15489
|
-
* Why the attempt did not land, in the contributor's own vocabulary —
|
|
15490
|
-
* `worker-lease-gone`, `queue-overflow`, `timeout`, `empty-read`. The same
|
|
15491
|
-
* strings that already appear in this repo's logs and, where one exists, the
|
|
15492
|
-
* same string the per-track `previewMissReason` records (D276): a second
|
|
15493
|
-
* vocabulary for the same loss would make the row and the counter
|
|
15494
|
-
* un-joinable.
|
|
15495
|
-
*/
|
|
15496
|
-
reason: string(),
|
|
15497
|
-
count: number().int().nonnegative()
|
|
15498
|
-
});
|
|
15499
|
-
var FailureContributionSchema = object({
|
|
15500
|
-
/**
|
|
15501
|
-
* The failing path — `enrichment-crop`, `inference`, `plate-ocr`,
|
|
15502
|
-
* `person-over-vehicle`. Free text, for the reason `load-contribution` keeps
|
|
15503
|
-
* `unit` free: the families are owned by different addons and a shared enum
|
|
15504
|
-
* is a central list that rots invisibly.
|
|
15505
|
-
*/
|
|
15506
|
-
family: string(),
|
|
15507
|
-
/**
|
|
15508
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
15509
|
-
* `tags.deviceId`. Never nullable and never absent: a contributor that
|
|
15510
|
-
* cannot name the camera must not emit the entry, because a fleet total
|
|
15511
|
-
* cannot answer the only question anybody asks of this surface.
|
|
15512
|
-
*/
|
|
15513
|
-
deviceId: number().int().positive(),
|
|
15514
|
-
/**
|
|
15515
|
-
* A second dimension inside the family: the model / step id for an inference
|
|
15516
|
-
* timeout, so "which camera AND which model" is one read. Absent when the
|
|
15517
|
-
* family has a single variant.
|
|
15518
|
-
*/
|
|
15519
|
-
variant: string().optional(),
|
|
15520
|
-
/**
|
|
15521
|
-
* Epoch ms this counter started — the INCARNATION MARKER. A consumer
|
|
15522
|
-
* differencing two reads must drop the interval when it changes, because the
|
|
15523
|
-
* counter restarted from zero in a respawned runner. Same discipline as
|
|
15524
|
-
* `LoadContribution.startedAtMs`.
|
|
15525
|
-
*/
|
|
15526
|
-
sinceMs: number(),
|
|
15527
|
-
/** Epoch ms it was read. `atMs - sinceMs` is the interval this covers. */
|
|
15528
|
-
atMs: number(),
|
|
15529
|
-
/**
|
|
15530
|
-
* THE DENOMINATOR — every attempt on this path for this camera in the
|
|
15531
|
-
* window. A failure count published without it is the mistake this schema
|
|
15532
|
-
* exists to make impossible.
|
|
15533
|
-
*/
|
|
15534
|
-
attempts: number().int().nonnegative(),
|
|
15535
|
-
/** Attempts that landed. `attempts - succeeded` is the loss. */
|
|
15536
|
-
succeeded: number().int().nonnegative(),
|
|
15537
|
-
/** The loss, partitioned. Sums to `attempts - succeeded`. */
|
|
15538
|
-
reasons: array(FailureReasonCountSchema).readonly()
|
|
15539
|
-
});
|
|
15540
|
-
var failureContributionCapability = {
|
|
15541
|
-
name: "failure-contribution",
|
|
15542
|
-
scope: "system",
|
|
15543
|
-
mode: "collection",
|
|
15544
|
-
internal: true,
|
|
15545
|
-
methods: {
|
|
15546
|
-
/**
|
|
15547
|
-
* This addon's per-camera failure counters, read live from bounded in-RAM
|
|
15548
|
-
* state it already keeps. Inert: no persistence, no sampling, no timer.
|
|
15549
|
-
*
|
|
15550
|
-
* READING NEVER RESETS. The counters are CUMULATIVE since `sinceMs`, and a
|
|
15551
|
-
* consumer that wants a rate differences two reads. A draining read would
|
|
15552
|
-
* make two operators with the page open each destroy half of the other's
|
|
15553
|
-
* numbers, and `load-contribution` already settled the same question the
|
|
15554
|
-
* same way for `cpuSeconds`.
|
|
15555
|
-
*/
|
|
15556
|
-
list: method(_void(), array(FailureContributionSchema).readonly()) },
|
|
15557
|
-
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
15558
|
-
mount: { kind: "skip" }
|
|
15559
|
-
};
|
|
15560
|
-
var LoadContributionSchema = object({
|
|
15561
|
-
role: _enum([
|
|
15562
|
-
"decode",
|
|
15563
|
-
"transcode",
|
|
15564
|
-
"recording",
|
|
15565
|
-
"streaming",
|
|
15566
|
-
"detection"
|
|
15567
|
-
]),
|
|
15568
|
-
/**
|
|
15569
|
-
* The NUMERIC device id — the same value every log line carries as
|
|
15570
|
-
* `tags.deviceId`. `null` means this cost genuinely belongs to no single
|
|
15571
|
-
* camera (a shared pool), NOT that the contributor forgot to look it up: a
|
|
15572
|
-
* contributor that cannot name its camera must not emit the entry at all,
|
|
15573
|
-
* because an unnamed per-camera entry is indistinguishable from a shared one
|
|
15574
|
-
* and would quietly turn one camera's cost into everybody's.
|
|
15575
|
-
*/
|
|
15576
|
-
deviceId: number().int().positive().nullable(),
|
|
15577
|
-
attribution: _enum([
|
|
15578
|
-
"measured",
|
|
15579
|
-
"accounted",
|
|
15580
|
-
"unattributable"
|
|
15581
|
-
]),
|
|
15582
|
-
/**
|
|
15583
|
-
* What ONE entry is, in the contributor's own words — `615/high`,
|
|
15584
|
-
* `617/native`, `cuda:0 shared pool`. Free text because the unit differs per
|
|
15585
|
-
* family and inventing a common one would lose the only information that
|
|
15586
|
-
* makes two entries for the same camera distinguishable.
|
|
15587
|
-
*/
|
|
15588
|
-
unit: string(),
|
|
15589
|
-
/**
|
|
15590
|
-
* The OS process this cost lives in, when there is one. Present so a
|
|
15591
|
-
* consumer can (a) tell two generations of the same unit apart across a
|
|
15592
|
-
* restart, and (b) subtract claimed processes from the node's process
|
|
15593
|
-
* snapshot to see what NOBODY claimed. Absent for an entry that owns no
|
|
15594
|
-
* process of its own.
|
|
15595
|
-
*/
|
|
15596
|
-
pid: number().int().positive().optional(),
|
|
15597
|
-
/**
|
|
15598
|
-
* When this generation started. The pid's incarnation marker: a consumer
|
|
15599
|
-
* differencing {@link LoadContributionSchema.shape.cpuSeconds} must drop the
|
|
15600
|
-
* window when this changes, because the counter restarted from zero in a new
|
|
15601
|
-
* process.
|
|
15602
|
-
*/
|
|
15603
|
-
startedAtMs: number().optional(),
|
|
15604
|
-
/**
|
|
15605
|
-
* CUMULATIVE CPU seconds this unit has consumed since it started — user +
|
|
15606
|
-
* system, read from the child's own `/proc/<pid>/stat` at the moment the
|
|
15607
|
-
* contribution is asked for.
|
|
15608
|
-
*
|
|
15609
|
-
* Cumulative and not a rate on purpose: a rate needs a window, a window
|
|
15610
|
-
* needs a sampler, and a new per-node sampler is the defect half of
|
|
15611
|
-
* `docs/architecture/load-ledger.md` documents. A counter can be differenced
|
|
15612
|
-
* by whoever already keeps a history; a rate cannot be un-averaged.
|
|
15613
|
-
*
|
|
15614
|
-
* Absent — never zero — on a node with no `/proc`, on a read failure, and on
|
|
15615
|
-
* an entry with no process.
|
|
15616
|
-
*/
|
|
15617
|
-
cpuSeconds: number().optional(),
|
|
15618
|
-
/** Resident bytes of this unit's process, same source and same rules. */
|
|
15619
|
-
rssBytes: number().optional()
|
|
15620
|
-
});
|
|
15621
|
-
var loadContributionCapability = {
|
|
15622
|
-
name: "load-contribution",
|
|
15623
|
-
scope: "system",
|
|
15624
|
-
mode: "collection",
|
|
15625
|
-
internal: true,
|
|
15626
|
-
methods: {
|
|
15627
|
-
/**
|
|
15628
|
-
* This addon's own cost entries, computed live from state it already
|
|
15629
|
-
* holds. Inert: no persistence, no sampling, no timer. It is answered on
|
|
15630
|
-
* whatever beat the caller already has.
|
|
15631
|
-
*/
|
|
15632
|
-
list: method(_void(), array(LoadContributionSchema).readonly()) },
|
|
15633
|
-
/** In-process only — enumerated through `addons.listCapabilityProviders`. */
|
|
15634
|
-
mount: { kind: "skip" }
|
|
15635
|
-
};
|
|
15636
|
-
/**
|
|
15637
15637
|
* `login-method` — collection cap through which auth addons contribute
|
|
15638
15638
|
* their pre-auth login surfaces to the login page. This is the SINGLE,
|
|
15639
15639
|
* generic mechanism that supersedes the dead `auth.listProviders` reader:
|
|
@@ -20820,12 +20820,53 @@ var MediaFileKindEnum = _enum([
|
|
|
20820
20820
|
"keyFrameSmall",
|
|
20821
20821
|
"thumbnailSmall"
|
|
20822
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
|
+
*/
|
|
20823
20860
|
var MediaFileSchema = object({
|
|
20824
20861
|
key: string(),
|
|
20825
20862
|
kind: MediaFileKindEnum,
|
|
20826
|
-
base64: string(),
|
|
20827
20863
|
sizeBytes: number(),
|
|
20828
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()
|
|
20829
20870
|
});
|
|
20830
20871
|
/**
|
|
20831
20872
|
* One media row WITHOUT its bytes.
|
|
@@ -20837,7 +20878,9 @@ var MediaFileSchema = object({
|
|
|
20837
20878
|
* blocks the whole view.
|
|
20838
20879
|
*
|
|
20839
20880
|
* `sizeBytes` is carried because it is what lets a client decide between the
|
|
20840
|
-
* 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.
|
|
20841
20884
|
*/
|
|
20842
20885
|
var MediaFileInfoSchema = MediaFileSchema.omit({ base64: true });
|
|
20843
20886
|
/**
|
|
@@ -21184,6 +21227,50 @@ var EventStoreFootprintSchema = object({
|
|
|
21184
21227
|
totalBytes: number().int(),
|
|
21185
21228
|
devices: array(EventStoreDeviceFootprintSchema).readonly()
|
|
21186
21229
|
});
|
|
21230
|
+
/** Event-media footprint for one {@link MediaFileKind}. */
|
|
21231
|
+
var EventMediaKindFootprintSchema = object({
|
|
21232
|
+
kind: MediaFileKindEnum,
|
|
21233
|
+
/** Media rows of this kind. */
|
|
21234
|
+
rows: number().int(),
|
|
21235
|
+
/** Bytes on disk held by those rows. */
|
|
21236
|
+
bytes: number().int()
|
|
21237
|
+
});
|
|
21238
|
+
/**
|
|
21239
|
+
* The media footprint broken down by KIND — the axis a deletion decision
|
|
21240
|
+
* actually turns on.
|
|
21241
|
+
*
|
|
21242
|
+
* A byte total says how much there is; it cannot say what is safe to remove.
|
|
21243
|
+
* The deletable set (the periodic `snapshot` filmstrip, the surplus per-edge
|
|
21244
|
+
* motion stills) and the keep set (`firstFrame`, rolling `lastFrame`,
|
|
21245
|
+
* `thumbnail`/`thumbnailSmall`, `keyFrame`/`keyFrameSmall`, the face/plate
|
|
21246
|
+
* buffers, gallery media, the CLIP `crop`) are distinguished by `kind` and by
|
|
21247
|
+
* nothing else, so sizing a deletion means summing per kind.
|
|
21248
|
+
*
|
|
21249
|
+
* ## Why `unaccounted*` exists
|
|
21250
|
+
*
|
|
21251
|
+
* `kinds` is enumerated from {@link MediaFileKindEnum} — the closed set the
|
|
21252
|
+
* writers use — and summed one kind at a time. `totalRows` / `totalBytes` come
|
|
21253
|
+
* from a SEPARATE unfiltered aggregate over the same rows, never from adding
|
|
21254
|
+
* `kinds` up. A row whose stored `kind` is not in the enum (written by a
|
|
21255
|
+
* retired code path, or by a version that knew a kind this one does not) would
|
|
21256
|
+
* otherwise vanish from the total silently, and an operator would delete
|
|
21257
|
+
* against a denominator smaller than the disk.
|
|
21258
|
+
*
|
|
21259
|
+
* `unaccountedRows` / `unaccountedBytes` are the difference. They are normally
|
|
21260
|
+
* zero; a non-zero value is a real finding and must be shown, not rounded away.
|
|
21261
|
+
*/
|
|
21262
|
+
var EventMediaKindBreakdownSchema = object({
|
|
21263
|
+
/** Every media row in scope, from one unfiltered aggregate. */
|
|
21264
|
+
totalRows: number().int(),
|
|
21265
|
+
/** Every media byte in scope, from that same aggregate. */
|
|
21266
|
+
totalBytes: number().int(),
|
|
21267
|
+
/** Per-kind footprint, ordered by bytes descending. */
|
|
21268
|
+
kinds: array(EventMediaKindFootprintSchema).readonly(),
|
|
21269
|
+
/** `totalRows` minus the summed `kinds` rows — see the schema note. */
|
|
21270
|
+
unaccountedRows: number().int(),
|
|
21271
|
+
/** `totalBytes` minus the summed `kinds` bytes — see the schema note. */
|
|
21272
|
+
unaccountedBytes: number().int()
|
|
21273
|
+
});
|
|
21187
21274
|
/** Per-kind counts returned by the event-prune / device-delete mutations. */
|
|
21188
21275
|
var EventPruneCountsSchema = object({
|
|
21189
21276
|
motion: number().int(),
|
|
@@ -21387,6 +21474,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
21387
21474
|
}), TrackFlagsSchema, { kind: "mutation" }), method(object({}), EventStoreFootprintSchema, {
|
|
21388
21475
|
kind: "query",
|
|
21389
21476
|
auth: "admin"
|
|
21477
|
+
}), method(object({ deviceId: number().int().optional() }), EventMediaKindBreakdownSchema, {
|
|
21478
|
+
kind: "query",
|
|
21479
|
+
auth: "admin"
|
|
21390
21480
|
}), method(object({
|
|
21391
21481
|
olderThanMs: number(),
|
|
21392
21482
|
reason: OpsLogReasonSchema.optional()
|
|
@@ -21526,6 +21616,9 @@ DeviceType.Camera, method(object({ deviceId: number() }), array(TrackSchema).rea
|
|
|
21526
21616
|
}), array(MediaFileSchema).readonly()), method(object({
|
|
21527
21617
|
trackId: string(),
|
|
21528
21618
|
deviceId: number()
|
|
21619
|
+
}), array(MediaFileInfoSchema).readonly()), method(object({
|
|
21620
|
+
eventId: string(),
|
|
21621
|
+
deviceId: number()
|
|
21529
21622
|
}), array(MediaFileInfoSchema).readonly()), method(SearchObjectEventsInput, array(ScoredObjectEventSchema).readonly()), method(object({}), WipeObjectEmbeddingsResultSchema, {
|
|
21530
21623
|
kind: "mutation",
|
|
21531
21624
|
auth: "admin"
|
|
@@ -23477,6 +23570,20 @@ method(object({
|
|
|
23477
23570
|
error: string().optional()
|
|
23478
23571
|
}), { auth: "admin" }), method(_void(), array(ProviderListEntrySchema).readonly()), method(object({
|
|
23479
23572
|
providerId: string(),
|
|
23573
|
+
/**
|
|
23574
|
+
* The location this config is an UNSAVED edit of, when there is one.
|
|
23575
|
+
*
|
|
23576
|
+
* `listLocations` replaces every declared secret with the redaction
|
|
23577
|
+
* sentinel, so the edit modal's form state holds the sentinel for any
|
|
23578
|
+
* credential the operator did not retype — and posting that here
|
|
23579
|
+
* without a way to resolve it makes the provider try to authenticate
|
|
23580
|
+
* as `__camstack_redacted__` and report the operator's own working
|
|
23581
|
+
* password as wrong. Given this id, the orchestrator restores each
|
|
23582
|
+
* sentinel from the stored config (same rule as `upsertLocation`)
|
|
23583
|
+
* before dispatching. Omitted by the "Add location" wizard, where
|
|
23584
|
+
* every value was typed just now and nothing is stored yet.
|
|
23585
|
+
*/
|
|
23586
|
+
locationId: string().optional(),
|
|
23480
23587
|
config: record(string(), unknown())
|
|
23481
23588
|
}), object({
|
|
23482
23589
|
ok: boolean(),
|
|
@@ -26097,10 +26204,24 @@ var FaceClusterSchema = object({
|
|
|
26097
26204
|
size: number().int(),
|
|
26098
26205
|
cohesion: number()
|
|
26099
26206
|
});
|
|
26207
|
+
/**
|
|
26208
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
26209
|
+
* are — never the bytes.
|
|
26210
|
+
*
|
|
26211
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
26212
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
26213
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
26214
|
+
* caller is the admin UI's detail modal, which was building
|
|
26215
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
26216
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
26217
|
+
*
|
|
26218
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
26219
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
26220
|
+
*/
|
|
26100
26221
|
var MediaFileLiteSchema$1 = object({
|
|
26101
26222
|
key: string(),
|
|
26102
26223
|
kind: string(),
|
|
26103
|
-
|
|
26224
|
+
url: string(),
|
|
26104
26225
|
sizeBytes: number(),
|
|
26105
26226
|
timestamp: number()
|
|
26106
26227
|
});
|
|
@@ -28352,10 +28473,24 @@ var PlateInfoSchema = object({
|
|
|
28352
28473
|
*/
|
|
28353
28474
|
cropUrl: string().optional()
|
|
28354
28475
|
});
|
|
28476
|
+
/**
|
|
28477
|
+
* One gallery media row: what the crop is, how big it is, and WHERE its bytes
|
|
28478
|
+
* are — never the bytes.
|
|
28479
|
+
*
|
|
28480
|
+
* `base64` was deleted here rather than deprecated. `MediaFile.base64` (the
|
|
28481
|
+
* track/event contract) is still populated because a deployed viewer requires
|
|
28482
|
+
* the field to parse a row at all; this method has no such reader. Its ONE
|
|
28483
|
+
* caller is the admin UI's detail modal, which was building
|
|
28484
|
+
* `data:image/jpeg;base64,…` from a row whose `key` sat right beside it, in a
|
|
28485
|
+
* dialog already rendering its key FRAME from the `event-media` plane.
|
|
28486
|
+
*
|
|
28487
|
+
* `url` is `/addon/<addonId>/event-media/<encoded key>`. The plane resolves a
|
|
28488
|
+
* media key directly, so this needed no new plane and no new access decision.
|
|
28489
|
+
*/
|
|
28355
28490
|
var MediaFileLiteSchema = object({
|
|
28356
28491
|
key: string(),
|
|
28357
28492
|
kind: string(),
|
|
28358
|
-
|
|
28493
|
+
url: string(),
|
|
28359
28494
|
sizeBytes: number(),
|
|
28360
28495
|
timestamp: number()
|
|
28361
28496
|
});
|
|
@@ -34601,6 +34736,12 @@ Object.freeze({
|
|
|
34601
34736
|
addonId: null,
|
|
34602
34737
|
access: "view"
|
|
34603
34738
|
},
|
|
34739
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": {
|
|
34740
|
+
capName: "pipeline-analytics",
|
|
34741
|
+
capScope: "device",
|
|
34742
|
+
addonId: null,
|
|
34743
|
+
access: "view"
|
|
34744
|
+
},
|
|
34604
34745
|
"pipelineAnalytics.getEventStoreFootprint": {
|
|
34605
34746
|
capName: "pipeline-analytics",
|
|
34606
34747
|
capScope: "device",
|
|
@@ -34697,6 +34838,12 @@ Object.freeze({
|
|
|
34697
34838
|
addonId: null,
|
|
34698
34839
|
access: "view"
|
|
34699
34840
|
},
|
|
34841
|
+
"pipelineAnalytics.listEventMedia": {
|
|
34842
|
+
capName: "pipeline-analytics",
|
|
34843
|
+
capScope: "device",
|
|
34844
|
+
addonId: null,
|
|
34845
|
+
access: "view"
|
|
34846
|
+
},
|
|
34700
34847
|
"pipelineAnalytics.listGroups": {
|
|
34701
34848
|
capName: "pipeline-analytics",
|
|
34702
34849
|
capScope: "device",
|
|
@@ -38260,6 +38407,11 @@ Object.freeze({
|
|
|
38260
38407
|
form: "single",
|
|
38261
38408
|
optional: false
|
|
38262
38409
|
}],
|
|
38410
|
+
"pipelineAnalytics.getEventMediaFootprintByKind": [{
|
|
38411
|
+
name: "deviceId",
|
|
38412
|
+
form: "single",
|
|
38413
|
+
optional: true
|
|
38414
|
+
}],
|
|
38263
38415
|
"pipelineAnalytics.getGroup": [{
|
|
38264
38416
|
name: "deviceId",
|
|
38265
38417
|
form: "single",
|
|
@@ -38320,6 +38472,11 @@ Object.freeze({
|
|
|
38320
38472
|
form: "array",
|
|
38321
38473
|
optional: false
|
|
38322
38474
|
}],
|
|
38475
|
+
"pipelineAnalytics.listEventMedia": [{
|
|
38476
|
+
name: "deviceId",
|
|
38477
|
+
form: "single",
|
|
38478
|
+
optional: false
|
|
38479
|
+
}],
|
|
38323
38480
|
"pipelineAnalytics.listGroups": [{
|
|
38324
38481
|
name: "deviceIds",
|
|
38325
38482
|
form: "array",
|