@camstack/addon-post-analysis 1.2.360 → 1.2.362
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/{clip-model-registry-JWEBSbx2.mjs → clip-model-registry-B69Mktce.mjs} +85 -3
- package/dist/{clip-model-registry-jPIOGw_9.js → clip-model-registry-D8XeJhT4.js} +85 -3
- package/dist/embedding-encoder/index.js +1 -1
- package/dist/embedding-encoder/index.mjs +1 -1
- package/dist/pipeline-analytics/_stub.js +2 -2
- package/dist/pipeline-analytics/{_virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-7nmSDEoH.mjs → _virtual_mf-localSharedImportMap___mfe_internal__addon_pipeline_analytics_widgets-CUQTWug8.mjs} +2 -2
- package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-B3Ko_8Ah.mjs +26 -0
- package/dist/pipeline-analytics/{_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-X_26tehC.mjs → _virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_ui_mf_2_library__loadShare__.js-DOcfQnib.mjs} +1 -1
- package/dist/pipeline-analytics/{hostInit-CIk7fElX.mjs → hostInit-Be7_ixng.mjs} +2 -2
- package/dist/pipeline-analytics/index.js +166 -33
- package/dist/pipeline-analytics/index.mjs +166 -33
- package/dist/pipeline-analytics/remoteEntry.js +1 -1
- package/package.json +1 -1
- package/dist/pipeline-analytics/_virtual_mf___mfe_internal__addon_pipeline_analytics_widgets__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-eO5a6KRc.mjs +0 -26
|
@@ -2,7 +2,7 @@ Object.defineProperties(exports, {
|
|
|
2
2
|
__esModule: { value: true },
|
|
3
3
|
[Symbol.toStringTag]: { value: "Module" }
|
|
4
4
|
});
|
|
5
|
-
const require_clip_model_registry = require("../clip-model-registry-
|
|
5
|
+
const require_clip_model_registry = require("../clip-model-registry-D8XeJhT4.js");
|
|
6
6
|
let node_fs = require("node:fs");
|
|
7
7
|
node_fs = require_clip_model_registry.__toESM(node_fs, 1);
|
|
8
8
|
let node_path = require("node:path");
|
|
@@ -64653,6 +64653,11 @@ var LATE_ABSORBED_WORK_SAMPLE_MS = 6e4;
|
|
|
64653
64653
|
/** Absorbed ids remembered after their survivor closed, so late work for
|
|
64654
64654
|
* them is refused rather than resurrected (oldest forgotten first). */
|
|
64655
64655
|
var MAX_RETIRED_ABSORBED_IDS = 4096;
|
|
64656
|
+
/** Closed track ids remembered (oldest forgotten first) so an async completion
|
|
64657
|
+
* settling AFTER `close` is refused instead of re-creating a resident nothing
|
|
64658
|
+
* would ever close. Track ids are unique per birth; 16384 covers hours of
|
|
64659
|
+
* settling at the busiest observed birth rate. */
|
|
64660
|
+
var MAX_CLOSED_TRACK_IDS = 16384;
|
|
64656
64661
|
var TrackResidentState = class {
|
|
64657
64662
|
hooks;
|
|
64658
64663
|
residents = /* @__PURE__ */ new Map();
|
|
@@ -64694,6 +64699,8 @@ var TrackResidentState = class {
|
|
|
64694
64699
|
bestShotHolder = /* @__PURE__ */ new Map();
|
|
64695
64700
|
/** Absorbed id → survivor id, for survivors that already closed (bounded). */
|
|
64696
64701
|
retired = /* @__PURE__ */ new Map();
|
|
64702
|
+
/** Ids closed by `close` (bounded FIFO). Only `open` — a birth — clears one. */
|
|
64703
|
+
closedIds = /* @__PURE__ */ new Set();
|
|
64697
64704
|
/** Per device: start of the current late-work sample window, and how many
|
|
64698
64705
|
* refusals it has swallowed since the last sampled call. */
|
|
64699
64706
|
lateWorkSample = /* @__PURE__ */ new Map();
|
|
@@ -64707,7 +64714,13 @@ var TrackResidentState = class {
|
|
|
64707
64714
|
/** Idempotently create the track's resident record (deviceId travels with
|
|
64708
64715
|
* it so device teardown can enumerate its tracks). */
|
|
64709
64716
|
open(deviceId, trackId) {
|
|
64710
|
-
this.
|
|
64717
|
+
this.closedIds.delete(trackId);
|
|
64718
|
+
this.ensure(deviceId, trackId, "general", "open");
|
|
64719
|
+
}
|
|
64720
|
+
/** True while the track owns a live resident (its survivor's, when absorbed).
|
|
64721
|
+
* Async completions check this before doing work for a track. */
|
|
64722
|
+
isLive(trackId) {
|
|
64723
|
+
return this.residents.has(this.canonical(trackId));
|
|
64711
64724
|
}
|
|
64712
64725
|
/**
|
|
64713
64726
|
* Get-or-create the resident record (every mutator routes through this so
|
|
@@ -64718,15 +64731,19 @@ var TrackResidentState = class {
|
|
|
64718
64731
|
* An absorbed id whose survivor already closed is refused. `undefined` =
|
|
64719
64732
|
* refused (sampled through `onLateAbsorbedWork`); nothing is created.
|
|
64720
64733
|
*/
|
|
64721
|
-
ensure(deviceId, trackId, kind = "general") {
|
|
64734
|
+
ensure(deviceId, trackId, kind = "general", write = "ensure") {
|
|
64722
64735
|
const retiredInto = this.retired.get(trackId);
|
|
64723
64736
|
if (retiredInto !== void 0) {
|
|
64724
|
-
this.refuseLateWork(deviceId, trackId, retiredInto, "survivor-closed");
|
|
64737
|
+
this.refuseLateWork(deviceId, trackId, retiredInto, "survivor-closed", write);
|
|
64738
|
+
return;
|
|
64739
|
+
}
|
|
64740
|
+
if (this.closedIds.has(trackId)) {
|
|
64741
|
+
this.refuseLateWork(deviceId, trackId, trackId, "track-closed", write);
|
|
64725
64742
|
return;
|
|
64726
64743
|
}
|
|
64727
64744
|
const survivorId = this.aliases.get(trackId);
|
|
64728
64745
|
if (survivorId !== void 0 && kind === "bestShot" && (this.bestShotHolder.get(survivorId) ?? survivorId) !== trackId) {
|
|
64729
|
-
this.refuseLateWork(deviceId, trackId, survivorId, "losing-shot");
|
|
64746
|
+
this.refuseLateWork(deviceId, trackId, survivorId, "losing-shot", write);
|
|
64730
64747
|
return;
|
|
64731
64748
|
}
|
|
64732
64749
|
const id = survivorId ?? trackId;
|
|
@@ -64741,10 +64758,10 @@ var TrackResidentState = class {
|
|
|
64741
64758
|
liveId(deviceId, trackId) {
|
|
64742
64759
|
const retiredInto = this.retired.get(trackId);
|
|
64743
64760
|
if (retiredInto === void 0) return this.canonical(trackId);
|
|
64744
|
-
this.refuseLateWork(deviceId, trackId, retiredInto, "survivor-closed");
|
|
64761
|
+
this.refuseLateWork(deviceId, trackId, retiredInto, "survivor-closed", "liveId");
|
|
64745
64762
|
}
|
|
64746
64763
|
/** Count a refused late write; hand the host one sampled line per window. */
|
|
64747
|
-
refuseLateWork(deviceId, trackId, survivorId, reason) {
|
|
64764
|
+
refuseLateWork(deviceId, trackId, survivorId, reason, write) {
|
|
64748
64765
|
const now = Date.now();
|
|
64749
64766
|
const sample = this.lateWorkSample.get(deviceId);
|
|
64750
64767
|
if (sample !== void 0 && now - sample.at < LATE_ABSORBED_WORK_SAMPLE_MS) {
|
|
@@ -64761,7 +64778,8 @@ var TrackResidentState = class {
|
|
|
64761
64778
|
trackId,
|
|
64762
64779
|
survivorId,
|
|
64763
64780
|
reason,
|
|
64764
|
-
refused
|
|
64781
|
+
refused,
|
|
64782
|
+
write
|
|
64765
64783
|
});
|
|
64766
64784
|
}
|
|
64767
64785
|
/**
|
|
@@ -64781,6 +64799,12 @@ var TrackResidentState = class {
|
|
|
64781
64799
|
mediaId: resident.keyFrameMediaId
|
|
64782
64800
|
});
|
|
64783
64801
|
this.hooks.onClose?.(trackId);
|
|
64802
|
+
this.closedIds.add(trackId);
|
|
64803
|
+
while (this.closedIds.size > MAX_CLOSED_TRACK_IDS) {
|
|
64804
|
+
const oldest = this.closedIds.values().next().value;
|
|
64805
|
+
if (oldest === void 0) break;
|
|
64806
|
+
this.closedIds.delete(oldest);
|
|
64807
|
+
}
|
|
64784
64808
|
const absorbed = this.absorbedBy.get(trackId);
|
|
64785
64809
|
this.bestShotHolder.delete(trackId);
|
|
64786
64810
|
if (absorbed !== void 0) {
|
|
@@ -64848,6 +64872,7 @@ var TrackResidentState = class {
|
|
|
64848
64872
|
this.aliases.clear();
|
|
64849
64873
|
this.bestShotHolder.clear();
|
|
64850
64874
|
this.retired.clear();
|
|
64875
|
+
this.closedIds.clear();
|
|
64851
64876
|
this.lateWorkSample.clear();
|
|
64852
64877
|
}
|
|
64853
64878
|
size() {
|
|
@@ -64930,7 +64955,7 @@ var TrackResidentState = class {
|
|
|
64930
64955
|
...observed,
|
|
64931
64956
|
trackId: id
|
|
64932
64957
|
};
|
|
64933
|
-
this.
|
|
64958
|
+
if (this.ensure(deviceId, id, "general", "observeObjectEmbeddingBest") === void 0) return false;
|
|
64934
64959
|
const modelId = obs.embeddingModelId ?? "";
|
|
64935
64960
|
let selector = this.objectEmbeddingBestSelectors.get(modelId);
|
|
64936
64961
|
if (selector === void 0) {
|
|
@@ -64947,7 +64972,7 @@ var TrackResidentState = class {
|
|
|
64947
64972
|
return this.residents.get(this.canonical(trackId))?.keyFrameMediaId ?? this.deferredKeyFrameKeys.get(trackId)?.mediaId;
|
|
64948
64973
|
}
|
|
64949
64974
|
setKeyFrameMediaId(deviceId, trackId, mediaId) {
|
|
64950
|
-
const resident = this.ensure(deviceId, trackId, "bestShot");
|
|
64975
|
+
const resident = this.ensure(deviceId, trackId, "bestShot", "setKeyFrameMediaId");
|
|
64951
64976
|
if (resident !== void 0) resident.keyFrameMediaId = mediaId;
|
|
64952
64977
|
}
|
|
64953
64978
|
/** Settle the keyFrame-id drop (called once the face recognizer's
|
|
@@ -64963,7 +64988,7 @@ var TrackResidentState = class {
|
|
|
64963
64988
|
return this.residents.get(this.canonical(trackId))?.lastFrameAt;
|
|
64964
64989
|
}
|
|
64965
64990
|
setLastFrameAt(deviceId, trackId, atMs) {
|
|
64966
|
-
const resident = this.ensure(deviceId, trackId);
|
|
64991
|
+
const resident = this.ensure(deviceId, trackId, "general", "setLastFrameAt");
|
|
64967
64992
|
if (resident !== void 0) resident.lastFrameAt = atMs;
|
|
64968
64993
|
}
|
|
64969
64994
|
anyFirstFramePending() {
|
|
@@ -64983,7 +65008,7 @@ var TrackResidentState = class {
|
|
|
64983
65008
|
}
|
|
64984
65009
|
/** A `firstFrame` write landed for this track (see {@link TrackResident.firstFrameLanded}). */
|
|
64985
65010
|
markFirstFrameLanded(deviceId, trackId) {
|
|
64986
|
-
const resident = this.ensure(deviceId, trackId);
|
|
65011
|
+
const resident = this.ensure(deviceId, trackId, "general", "markFirstFrameLanded");
|
|
64987
65012
|
if (resident !== void 0) resident.firstFrameLanded = true;
|
|
64988
65013
|
}
|
|
64989
65014
|
isFirstFrameLanded(trackId) {
|
|
@@ -64993,7 +65018,7 @@ var TrackResidentState = class {
|
|
|
64993
65018
|
return this.residents.get(this.canonical(trackId))?.thumbnailLanded ?? false;
|
|
64994
65019
|
}
|
|
64995
65020
|
markThumbnailLanded(deviceId, trackId) {
|
|
64996
|
-
const resident = this.ensure(deviceId, trackId, "bestShot");
|
|
65021
|
+
const resident = this.ensure(deviceId, trackId, "bestShot", "markThumbnailLanded");
|
|
64997
65022
|
if (resident !== void 0) resident.thumbnailLanded = true;
|
|
64998
65023
|
}
|
|
64999
65024
|
/**
|
|
@@ -65040,14 +65065,14 @@ var TrackResidentState = class {
|
|
|
65040
65065
|
* spend one of the track's three retries.
|
|
65041
65066
|
*/
|
|
65042
65067
|
noteKeyFrameAttempt(deviceId, trackId, atMs, retry) {
|
|
65043
|
-
const resident = this.ensure(deviceId, trackId, "bestShot");
|
|
65068
|
+
const resident = this.ensure(deviceId, trackId, "bestShot", "noteKeyFrameAttempt");
|
|
65044
65069
|
if (resident === void 0) return;
|
|
65045
65070
|
resident.keyFrameLastAttemptAt = atMs;
|
|
65046
65071
|
if (retry) resident.keyFrameRetries += 1;
|
|
65047
65072
|
}
|
|
65048
65073
|
/** A `keyFrame` write landed — sticky, and the end of the retry path. */
|
|
65049
65074
|
markKeyFrameLanded(deviceId, trackId) {
|
|
65050
|
-
const resident = this.ensure(deviceId, trackId, "bestShot");
|
|
65075
|
+
const resident = this.ensure(deviceId, trackId, "bestShot", "markKeyFrameLanded");
|
|
65051
65076
|
if (resident !== void 0) resident.keyFrameLanded = true;
|
|
65052
65077
|
}
|
|
65053
65078
|
lifecycleUpdateMem(trackId) {
|
|
@@ -65100,7 +65125,7 @@ var TrackResidentState = class {
|
|
|
65100
65125
|
/** Retain the FIRST detection-raster crop per track (zero-media fallback);
|
|
65101
65126
|
* a later frame never overwrites an existing one. */
|
|
65102
65127
|
retainRasterFallback(deviceId, trackId, fallback) {
|
|
65103
|
-
const resident = this.ensure(deviceId, trackId);
|
|
65128
|
+
const resident = this.ensure(deviceId, trackId, "general", "retainRasterFallback");
|
|
65104
65129
|
if (resident !== void 0 && resident.rasterFallback === void 0) resident.rasterFallback = fallback;
|
|
65105
65130
|
}
|
|
65106
65131
|
};
|
|
@@ -79918,6 +79943,67 @@ var DeviceSettingsCacheHub = class {
|
|
|
79918
79943
|
}
|
|
79919
79944
|
};
|
|
79920
79945
|
//#endregion
|
|
79946
|
+
//#region src/pipeline-analytics/inherited-device-values.ts
|
|
79947
|
+
/**
|
|
79948
|
+
* What a camera's Analytics form SHOWS for a field this camera never saved.
|
|
79949
|
+
*
|
|
79950
|
+
* The runtime resolves every per-device analytics setting from
|
|
79951
|
+
* `{ ...globalRaw, ...deviceRaw }` (`readDeviceSettings`): the cluster value
|
|
79952
|
+
* stands until the camera writes its own. The form used to hydrate from
|
|
79953
|
+
* `deviceRaw` alone, so a never-saved field rendered the SCHEMA default — a
|
|
79954
|
+
* number the runtime was not using whenever the cluster had set its own. An
|
|
79955
|
+
* operator who read "5" there and saved another field changed nothing, but had
|
|
79956
|
+
* every reason to believe the camera ran at 5.
|
|
79957
|
+
*
|
|
79958
|
+
* Two rules, both pinned by `inherited-device-values.spec.ts`:
|
|
79959
|
+
* - the displayed value is the EFFECTIVE one (`{ ...globalRaw, ...deviceRaw }`),
|
|
79960
|
+
* the same merge the resolvers use;
|
|
79961
|
+
* - a field showing the cluster value says so in its description, and the
|
|
79962
|
+
* form still saves only what the operator edits, so showing an inherited
|
|
79963
|
+
* value never freezes it onto the camera.
|
|
79964
|
+
*/
|
|
79965
|
+
/** Appended to the description of a field whose value comes from the cluster. */
|
|
79966
|
+
var INHERITED_FROM_GLOBAL_NOTE = "Shown value is the cluster-wide setting. Change it here to override it for this camera only.";
|
|
79967
|
+
function hasOwn(bag, key) {
|
|
79968
|
+
return Object.prototype.hasOwnProperty.call(bag, key);
|
|
79969
|
+
}
|
|
79970
|
+
function markInherited(field, globalRaw, deviceRaw) {
|
|
79971
|
+
if (field.type === "group") return {
|
|
79972
|
+
...field,
|
|
79973
|
+
fields: field.fields.map((f) => markInherited(f, globalRaw, deviceRaw))
|
|
79974
|
+
};
|
|
79975
|
+
if (field.type === "sub-tabs") return {
|
|
79976
|
+
...field,
|
|
79977
|
+
tabs: field.tabs.map((tab) => ({
|
|
79978
|
+
...tab,
|
|
79979
|
+
fields: tab.fields.map((f) => markInherited(f, globalRaw, deviceRaw))
|
|
79980
|
+
}))
|
|
79981
|
+
};
|
|
79982
|
+
if (!("value" in field)) return field;
|
|
79983
|
+
if (!hasOwn(globalRaw, field.key) || hasOwn(deviceRaw, field.key)) return field;
|
|
79984
|
+
const description = field.description === void 0 ? INHERITED_FROM_GLOBAL_NOTE : `${field.description} ${INHERITED_FROM_GLOBAL_NOTE}`;
|
|
79985
|
+
return {
|
|
79986
|
+
...field,
|
|
79987
|
+
description
|
|
79988
|
+
};
|
|
79989
|
+
}
|
|
79990
|
+
/**
|
|
79991
|
+
* Hydrate per-camera sections with the effective value of each field.
|
|
79992
|
+
*
|
|
79993
|
+
* @param schema the per-device schema (global schema, already re-tabbed)
|
|
79994
|
+
* @param deviceRaw the camera's own blob — only what it saved
|
|
79995
|
+
* @param globalRaw the cluster store
|
|
79996
|
+
*/
|
|
79997
|
+
function hydrateWithInheritedGlobals(schema, deviceRaw, globalRaw) {
|
|
79998
|
+
return require_clip_model_registry.hydrateSchema(schema, {
|
|
79999
|
+
...globalRaw,
|
|
80000
|
+
...deviceRaw
|
|
80001
|
+
}).sections.map((section) => ({
|
|
80002
|
+
...section,
|
|
80003
|
+
fields: section.fields.map((f) => markInherited(f, globalRaw, deviceRaw))
|
|
80004
|
+
}));
|
|
80005
|
+
}
|
|
80006
|
+
//#endregion
|
|
79921
80007
|
//#region src/pipeline-analytics/device-zone-resolver.ts
|
|
79922
80008
|
/**
|
|
79923
80009
|
* How long a catalogue read from the capability is trusted. Only consulted when
|
|
@@ -104710,6 +104796,10 @@ Object.freeze({
|
|
|
104710
104796
|
"path": "lastContactAt",
|
|
104711
104797
|
"valueType": "number"
|
|
104712
104798
|
},
|
|
104799
|
+
{
|
|
104800
|
+
"path": "lastFullRefreshAt",
|
|
104801
|
+
"valueType": "number"
|
|
104802
|
+
},
|
|
104713
104803
|
{
|
|
104714
104804
|
"path": "binary",
|
|
104715
104805
|
"valueType": "boolean"
|
|
@@ -107480,9 +107570,24 @@ function formatSuggestionThresholdReadout(similarityThreshold) {
|
|
|
107480
107570
|
* misleading. Keyed by section id → set of field keys to drop.
|
|
107481
107571
|
*/
|
|
107482
107572
|
var GLOBAL_ONLY_FIELDS = { "face-recognition": new Set(["enabled", SUGGESTION_THRESHOLD_READOUT_KEY]) };
|
|
107483
|
-
/**
|
|
107484
|
-
*
|
|
107485
|
-
|
|
107573
|
+
/**
|
|
107574
|
+
* Whole sections that are cluster-wide (global page only) and must NOT appear
|
|
107575
|
+
* in a per-device contribution (D62: a per-camera field whose reader only ever
|
|
107576
|
+
* consults the global addon store is a knob that writes a store nobody reads).
|
|
107577
|
+
*
|
|
107578
|
+
* - `cluster-post-processing` — which node runs post-analysis.
|
|
107579
|
+
* - `embedding-index` — rebuild / wipe buttons that act on the whole index.
|
|
107580
|
+
* - `device-alerts` — battery / offline thresholds; read from the global
|
|
107581
|
+
* store into `deviceAlertSettingsMirror`, one value for the installation.
|
|
107582
|
+
* - `prune-windows` — outbox / timelapse / artefact shelf / digest mosaic
|
|
107583
|
+
* windows; `pruneWindows()` resolves them from the global store only.
|
|
107584
|
+
*/
|
|
107585
|
+
var GLOBAL_ONLY_SECTIONS = new Set([
|
|
107586
|
+
"cluster-post-processing",
|
|
107587
|
+
"embedding-index",
|
|
107588
|
+
"device-alerts",
|
|
107589
|
+
"prune-windows"
|
|
107590
|
+
]);
|
|
107486
107591
|
/** Drop global-only sections + global-only fields from per-device sections. */
|
|
107487
107592
|
function stripGlobalOnlyFields(sections) {
|
|
107488
107593
|
return sections.filter((s) => !(s.id && GLOBAL_ONLY_SECTIONS.has(s.id))).map((s) => {
|
|
@@ -110693,6 +110798,8 @@ var NO_PUBLICATION = {
|
|
|
110693
110798
|
url: null,
|
|
110694
110799
|
artifactId: null
|
|
110695
110800
|
};
|
|
110801
|
+
/** How often the resident-vs-live-track heartbeat line is written. */
|
|
110802
|
+
var RESIDENT_HEARTBEAT_INTERVAL_MS = 5 * 6e4;
|
|
110696
110803
|
/**
|
|
110697
110804
|
* A tRPC-shaped router or procedure reached by DYNAMIC name off `ctx.api`.
|
|
110698
110805
|
*
|
|
@@ -111773,12 +111880,13 @@ var PipelineAnalyticsAddon = class PipelineAnalyticsAddon extends require_clip_m
|
|
|
111773
111880
|
this.parkedFrames?.adopt(survivorId, absorbedId, bestShotFrom);
|
|
111774
111881
|
},
|
|
111775
111882
|
onLateAbsorbedWork: (work) => {
|
|
111776
|
-
this.ctx.logger.info("track resident: late work
|
|
111883
|
+
this.ctx.logger.info("track resident: late work after close refused", {
|
|
111777
111884
|
tags: { deviceId: work.deviceId },
|
|
111778
111885
|
meta: {
|
|
111779
111886
|
trackId: work.trackId,
|
|
111780
111887
|
survivorId: work.survivorId,
|
|
111781
111888
|
reason: work.reason,
|
|
111889
|
+
kind: work.write,
|
|
111782
111890
|
refused: work.refused
|
|
111783
111891
|
}
|
|
111784
111892
|
});
|
|
@@ -115242,11 +115350,31 @@ var PipelineAnalyticsAddon = class PipelineAnalyticsAddon extends require_clip_m
|
|
|
115242
115350
|
this.releaseProxy(deviceId);
|
|
115243
115351
|
this.notificationCenter?.onDeviceDeleted(deviceId);
|
|
115244
115352
|
}
|
|
115353
|
+
/** Wall-clock of the last resident heartbeat line. */
|
|
115354
|
+
residentHeartbeatAt = 0;
|
|
115355
|
+
/**
|
|
115356
|
+
* Resident records vs live tracks, once per interval: a resident count that
|
|
115357
|
+
* climbs past the live-track count is the signature of a record nothing
|
|
115358
|
+
* closes (the late-completion ghost fixed 2026-10-14).
|
|
115359
|
+
*/
|
|
115360
|
+
logResidentHeartbeat(now) {
|
|
115361
|
+
if (now - this.residentHeartbeatAt < RESIDENT_HEARTBEAT_INTERVAL_MS) return;
|
|
115362
|
+
this.residentHeartbeatAt = now;
|
|
115363
|
+
let liveTracks = 0;
|
|
115364
|
+
for (const ids of this.lastActiveTrackIds.values()) liveTracks += ids.size;
|
|
115365
|
+
const mem = process.memoryUsage();
|
|
115366
|
+
this.ctx.logger.info("analytics resident heartbeat", { meta: {
|
|
115367
|
+
residents: this.residents.size(),
|
|
115368
|
+
liveTracks,
|
|
115369
|
+
externalNonBufferMb: Math.max(0, Math.round((mem.external - mem.arrayBuffers) / 1048576))
|
|
115370
|
+
} });
|
|
115371
|
+
}
|
|
115245
115372
|
/** Periodic sweeps — TTL promotion + retention/stationary aging. */
|
|
115246
115373
|
startSweepTimers() {
|
|
115247
115374
|
this.ttlSweepTimer = setInterval(() => {
|
|
115248
115375
|
this.sweepExpiredTracks();
|
|
115249
115376
|
this.runPackageStillnessSweep(Date.now());
|
|
115377
|
+
this.logResidentHeartbeat(Date.now());
|
|
115250
115378
|
}, TTL_SWEEP_INTERVAL_MS);
|
|
115251
115379
|
this.faceReembedAutoTimer = setInterval(() => {
|
|
115252
115380
|
this.maybeAutoReembedFaces().then(() => this.faceAlignmentJobs?.maybeAutoRunPhotoPass());
|
|
@@ -116906,17 +117034,21 @@ var PipelineAnalyticsAddon = class PipelineAnalyticsAddon extends require_clip_m
|
|
|
116906
117034
|
}),
|
|
116907
117035
|
holdKeys: heldCaptureKeys,
|
|
116908
117036
|
staleAfterMs: ENRICHMENT_CAPTURE_STALE_MS,
|
|
116909
|
-
exec: () => pinnedFramePromise.then((pinnedFrame) =>
|
|
116910
|
-
|
|
116911
|
-
|
|
116912
|
-
|
|
116913
|
-
|
|
116914
|
-
|
|
116915
|
-
|
|
116916
|
-
|
|
116917
|
-
|
|
116918
|
-
|
|
116919
|
-
|
|
117037
|
+
exec: () => pinnedFramePromise.then((pinnedFrame) => {
|
|
117038
|
+
const liveWanted = /* @__PURE__ */ new Set();
|
|
117039
|
+
for (const id of rasterFallbackWantedTrackIds) if (this.residents.isLive(id)) liveWanted.add(id);
|
|
117040
|
+
return dispatcher.captureForFrame({
|
|
117041
|
+
deviceId,
|
|
117042
|
+
frameHandle,
|
|
117043
|
+
events: eventTargets,
|
|
117044
|
+
trackFrames: firstFrameTargets,
|
|
117045
|
+
snapshots: snapshotTargets,
|
|
117046
|
+
cropPadding: mediaSettings.cropPadding,
|
|
117047
|
+
rasterFallbackWantedTrackIds: liveWanted,
|
|
117048
|
+
rasterFallbackCandidates: rasterFallbackCandidates.filter((c) => this.residents.isLive(c.trackId)),
|
|
117049
|
+
...pinnedFrame !== null ? { pinnedFrame } : {}
|
|
117050
|
+
});
|
|
117051
|
+
}).then((res) => {
|
|
116920
117052
|
for (const rf of res.rasterFallbacks) this.residents.retainRasterFallback(deviceId, rf.trackId, {
|
|
116921
117053
|
jpeg: rf.jpeg,
|
|
116922
117054
|
timestamp: rf.timestamp
|
|
@@ -123806,10 +123938,11 @@ var PipelineAnalyticsAddon = class PipelineAnalyticsAddon extends require_clip_m
|
|
|
123806
123938
|
if (!await this.isCameraDevice(input.deviceId)) return null;
|
|
123807
123939
|
const schema = this.globalSettingsSchema();
|
|
123808
123940
|
const raw = await this.readDeviceBlob(input.deviceId);
|
|
123809
|
-
const
|
|
123941
|
+
const globalRaw = await this.rawGlobalStoreMirror.resolve();
|
|
123942
|
+
const baseSections = schema ? hydrateWithInheritedGlobals({
|
|
123810
123943
|
...schema,
|
|
123811
123944
|
sections: retagRetentionSection(retagDetectionSections(stripGlobalOnlyFields(toAnalyticsDeviceSections(schema.sections))))
|
|
123812
|
-
}, raw)
|
|
123945
|
+
}, raw, globalRaw) : [];
|
|
123813
123946
|
const liveStatsSection = {
|
|
123814
123947
|
id: "live-stats",
|
|
123815
123948
|
title: "Live Stats",
|