@camstack/addon-osd-manager 0.1.2 → 0.1.4
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/MaskShapeCanvas-BEVxAjNq.mjs +13806 -0
- package/dist/MotionZonesSettings-DteO0vrm.mjs +309 -0
- package/dist/PrivacyMaskSettings-VeD7Fy0-.mjs +290 -0
- package/dist/_stub.js +16641 -0
- package/dist/_virtual_mf-localSharedImportMap___mfe_internal__addon_osd_manager_page-CL-YG2or.mjs +156 -0
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_sdk__loadShare__.js-plrwWXXt.mjs +25 -0
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-D722amjy.mjs +26 -0
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_tanstack_mf_1_react_mf_2_query__loadShare__.js-DmzTg7Gl.mjs +25 -0
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_trpc_mf_1_client__loadShare__.js-C7omKvJr.mjs +25 -0
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_trpc_mf_1_react_mf_2_query__loadShare__.js-BpP33rwB.mjs +26 -0
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-Bs1t18EM.mjs +70 -0
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DalfdIDw.mjs +26 -0
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_2_dom__loadShare__.js-C0K4h_0e.mjs +25 -0
- package/dist/_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_2_dom_mf_1_client__loadShare__.js-Dhy3m6Ij.mjs +25 -0
- package/dist/addon-osd-manager.css +3 -0
- package/dist/hostInit-BCB8KzuM.mjs +129 -0
- package/dist/index.js +271 -2
- package/dist/index.mjs +271 -2
- package/dist/player-overlays-CwbydND6.mjs +163 -0
- package/dist/remoteEntry.js +2 -0
- package/dist/remoteEntry.ssr.js +33 -0
- package/dist/rolldown-runtime-HEgqtunE.mjs +20 -0
- package/dist/trash-2-Ckik0Rau.mjs +49 -0
- package/dist/virtualExposes-BgZ5Cn7S.mjs +27 -0
- package/dist/virtual_mf-REMOTE_ENTRY_ID___mfe_internal__addon_osd_manager_page__remoteEntry_js-CdG2yVd0.mjs +2857 -0
- package/dist/virtual_mf-exposes-ssr___mfe_internal__addon_osd_manager_page__remoteEntry_js-Bgw9YZ5T.mjs +10 -0
- package/package.json +35 -4
package/dist/index.mjs
CHANGED
|
@@ -21787,6 +21787,22 @@ var TerminalProfileInfoSchema = object({
|
|
|
21787
21787
|
label: string(),
|
|
21788
21788
|
description: string().optional()
|
|
21789
21789
|
});
|
|
21790
|
+
var TerminalOutputEventSchema = discriminatedUnion("kind", [object({
|
|
21791
|
+
seq: number().int().positive(),
|
|
21792
|
+
kind: literal("data"),
|
|
21793
|
+
data: string()
|
|
21794
|
+
}), object({
|
|
21795
|
+
seq: number().int().positive(),
|
|
21796
|
+
kind: literal("exit"),
|
|
21797
|
+
exitCode: number().int(),
|
|
21798
|
+
signal: number().int().optional()
|
|
21799
|
+
})]);
|
|
21800
|
+
var TerminalOutputBatchSchema = object({
|
|
21801
|
+
cursor: number().int().nonnegative(),
|
|
21802
|
+
reset: boolean(),
|
|
21803
|
+
snapshot: string().optional(),
|
|
21804
|
+
events: array(TerminalOutputEventSchema).readonly()
|
|
21805
|
+
});
|
|
21790
21806
|
/**
|
|
21791
21807
|
* terminal-session — singleton system capability for interactive TTY sessions.
|
|
21792
21808
|
*
|
|
@@ -21825,6 +21841,28 @@ var terminalSessionCapability = {
|
|
|
21825
21841
|
kind: "mutation",
|
|
21826
21842
|
auth: "admin"
|
|
21827
21843
|
}),
|
|
21844
|
+
/**
|
|
21845
|
+
* Pull ordered output after a cursor. This capability transport is what
|
|
21846
|
+
* makes remote-agent terminals possible; `reset + snapshot` repairs a
|
|
21847
|
+
* caller that fell behind the bounded replay window.
|
|
21848
|
+
*/
|
|
21849
|
+
pullOutput: method(object({
|
|
21850
|
+
sessionId: string(),
|
|
21851
|
+
afterSeq: number().int().nonnegative(),
|
|
21852
|
+
waitMs: number().int().min(0).max(2e3).default(0)
|
|
21853
|
+
}), TerminalOutputBatchSchema, {
|
|
21854
|
+
kind: "mutation",
|
|
21855
|
+
auth: "admin",
|
|
21856
|
+
timeoutMs: 15e3
|
|
21857
|
+
}),
|
|
21858
|
+
/** Write terminal input through the node-routable capability plane. */
|
|
21859
|
+
writeInput: method(object({
|
|
21860
|
+
sessionId: string(),
|
|
21861
|
+
data: string().max(64 * 1024)
|
|
21862
|
+
}), _void(), {
|
|
21863
|
+
kind: "mutation",
|
|
21864
|
+
auth: "admin"
|
|
21865
|
+
}),
|
|
21828
21866
|
/** Terminate a live session and release its pty. */
|
|
21829
21867
|
close: method(object({ sessionId: string() }), _void(), {
|
|
21830
21868
|
kind: "mutation",
|
|
@@ -24760,6 +24798,7 @@ var FaceInfoSchema = object({
|
|
|
24760
24798
|
var FaceFilterEnum = _enum([
|
|
24761
24799
|
"unassigned",
|
|
24762
24800
|
"recognized",
|
|
24801
|
+
"identified",
|
|
24763
24802
|
"all"
|
|
24764
24803
|
]);
|
|
24765
24804
|
var MediaFileLiteSchema$1 = object({
|
|
@@ -24799,6 +24838,8 @@ var faceGalleryCapability = {
|
|
|
24799
24838
|
auth: "admin"
|
|
24800
24839
|
}),
|
|
24801
24840
|
listRecentFaces: method(object({
|
|
24841
|
+
/** Restrict to one camera. Absent keeps the cluster-wide gallery view. */
|
|
24842
|
+
deviceId: number().int().optional(),
|
|
24802
24843
|
limit: number().int().positive().optional(),
|
|
24803
24844
|
filter: FaceFilterEnum.optional(),
|
|
24804
24845
|
/**
|
|
@@ -27342,6 +27383,10 @@ var OsdSourceSchema = discriminatedUnion("kind", [
|
|
|
27342
27383
|
capName: string().min(1).max(64),
|
|
27343
27384
|
/** Dot path inside the slice, e.g. `detected`, `value`, `mode`. */
|
|
27344
27385
|
valuePath: string().min(1).max(64)
|
|
27386
|
+
}),
|
|
27387
|
+
object({
|
|
27388
|
+
kind: literal("latest-recognition"),
|
|
27389
|
+
recognition: _enum(["person", "plate"])
|
|
27345
27390
|
})
|
|
27346
27391
|
]);
|
|
27347
27392
|
var OsdSlotBindingSchema = object({
|
|
@@ -27480,6 +27525,21 @@ var osdManagerCapability = {
|
|
|
27480
27525
|
auth: "admin"
|
|
27481
27526
|
}),
|
|
27482
27527
|
/**
|
|
27528
|
+
* Replace one camera's binding configuration from another. Writable source
|
|
27529
|
+
* slots are mapped by ordinal onto writable target slots so different
|
|
27530
|
+
* provider slot ids do not make the copied configuration disappear.
|
|
27531
|
+
*/
|
|
27532
|
+
copyDeviceConfiguration: method(object({
|
|
27533
|
+
sourceDeviceId: number().int(),
|
|
27534
|
+
targetDeviceId: number().int()
|
|
27535
|
+
}), object({
|
|
27536
|
+
copied: number().int().nonnegative(),
|
|
27537
|
+
skipped: number().int().nonnegative()
|
|
27538
|
+
}), {
|
|
27539
|
+
kind: "mutation",
|
|
27540
|
+
auth: "admin"
|
|
27541
|
+
}),
|
|
27542
|
+
/**
|
|
27483
27543
|
* Render without writing. `binding` overrides the stored one so an
|
|
27484
27544
|
* editor can preview an unsaved change. Mutation kind only to carry
|
|
27485
27545
|
* the binding object safely; no side effects.
|
|
@@ -33664,6 +33724,12 @@ Object.freeze({
|
|
|
33664
33724
|
addonId: null,
|
|
33665
33725
|
access: "delete"
|
|
33666
33726
|
},
|
|
33727
|
+
"osdManager.copyDeviceConfiguration": {
|
|
33728
|
+
capName: "osd-manager",
|
|
33729
|
+
capScope: "system",
|
|
33730
|
+
addonId: null,
|
|
33731
|
+
access: "create"
|
|
33732
|
+
},
|
|
33667
33733
|
"osdManager.getConditionSupport": {
|
|
33668
33734
|
capName: "osd-manager",
|
|
33669
33735
|
capScope: "system",
|
|
@@ -35704,12 +35770,24 @@ Object.freeze({
|
|
|
35704
35770
|
addonId: null,
|
|
35705
35771
|
access: "create"
|
|
35706
35772
|
},
|
|
35773
|
+
"terminalSession.pullOutput": {
|
|
35774
|
+
capName: "terminal-session",
|
|
35775
|
+
capScope: "system",
|
|
35776
|
+
addonId: null,
|
|
35777
|
+
access: "create"
|
|
35778
|
+
},
|
|
35707
35779
|
"terminalSession.resize": {
|
|
35708
35780
|
capName: "terminal-session",
|
|
35709
35781
|
capScope: "system",
|
|
35710
35782
|
addonId: null,
|
|
35711
35783
|
access: "create"
|
|
35712
35784
|
},
|
|
35785
|
+
"terminalSession.writeInput": {
|
|
35786
|
+
capName: "terminal-session",
|
|
35787
|
+
capScope: "system",
|
|
35788
|
+
addonId: null,
|
|
35789
|
+
access: "create"
|
|
35790
|
+
},
|
|
35713
35791
|
"toast.onToast": {
|
|
35714
35792
|
capName: "toast",
|
|
35715
35793
|
capScope: "system",
|
|
@@ -36535,7 +36613,8 @@ var OsdBindingsStore = class {
|
|
|
36535
36613
|
* Widening it means giving `evaluateGate` the facts to answer it — a
|
|
36536
36614
|
* live detection subject would unlock `classes`, `zones`, `minConfidence`.
|
|
36537
36615
|
*/
|
|
36538
|
-
var OSD_SUPPORTED_CONDITIONS = ["
|
|
36616
|
+
var OSD_SUPPORTED_CONDITIONS = ["deviceState"];
|
|
36617
|
+
var OSD_RUNTIME_CONDITIONS = ["devices", ...OSD_SUPPORTED_CONDITIONS];
|
|
36539
36618
|
var OPEN = { open: true };
|
|
36540
36619
|
/**
|
|
36541
36620
|
* Which condition keys are set on `conditions` but outside the supported
|
|
@@ -36543,7 +36622,7 @@ var OPEN = { open: true };
|
|
|
36543
36622
|
*/
|
|
36544
36623
|
function unsupportedConditionKeys(conditions) {
|
|
36545
36624
|
if (conditions === void 0) return [];
|
|
36546
|
-
const supported = new Set(
|
|
36625
|
+
const supported = new Set(OSD_RUNTIME_CONDITIONS);
|
|
36547
36626
|
const present = [];
|
|
36548
36627
|
for (const [key, value] of Object.entries(conditions)) {
|
|
36549
36628
|
if (value === void 0) continue;
|
|
@@ -36786,6 +36865,10 @@ function resolveSource(binding, cameraDeviceId, facts) {
|
|
|
36786
36865
|
const source = binding.source;
|
|
36787
36866
|
if (source.kind === "static") return { value: { raw: source.text } };
|
|
36788
36867
|
if (source.kind === "clock") return { value: { raw: formatClock(facts.atMs, source.pattern, source.timezone) } };
|
|
36868
|
+
if (source.kind === "latest-recognition") {
|
|
36869
|
+
const value = facts.recognitionByDevice.get(cameraDeviceId)?.[source.recognition];
|
|
36870
|
+
return value === void 0 ? { reason: `no recognized ${source.recognition} has been persisted for device ${cameraDeviceId}` } : { value: { raw: value } };
|
|
36871
|
+
}
|
|
36789
36872
|
const deviceId = source.deviceId ?? cameraDeviceId;
|
|
36790
36873
|
const deviceState = facts.stateByDevice.get(deviceId);
|
|
36791
36874
|
if (deviceState === void 0) return { reason: `no state mirrored for device ${deviceId}` };
|
|
@@ -36909,6 +36992,10 @@ var OsdManager = class {
|
|
|
36909
36992
|
lastWritten = /* @__PURE__ */ new Map();
|
|
36910
36993
|
/** Cameras with at least one binding — the loop's work list. */
|
|
36911
36994
|
boundDevices = /* @__PURE__ */ new Set();
|
|
36995
|
+
recognitions = /* @__PURE__ */ new Map();
|
|
36996
|
+
recognitionHydration = /* @__PURE__ */ new Map();
|
|
36997
|
+
recognitionGeneration = /* @__PURE__ */ new Map();
|
|
36998
|
+
recognitionInvalidatedAt = /* @__PURE__ */ new Map();
|
|
36912
36999
|
timer = null;
|
|
36913
37000
|
constructor(deps) {
|
|
36914
37001
|
this.deps = deps;
|
|
@@ -36936,6 +37023,36 @@ var OsdManager = class {
|
|
|
36936
37023
|
this.lastWritten.clear();
|
|
36937
37024
|
}
|
|
36938
37025
|
/**
|
|
37026
|
+
* Keep recognition overlays event-fresh. The persisted-track hydration below
|
|
37027
|
+
* remains the restart/cold-start authority; lifecycle events only advance it.
|
|
37028
|
+
*/
|
|
37029
|
+
onTrackLifecycle(payload) {
|
|
37030
|
+
let changed = false;
|
|
37031
|
+
if (payload.label !== void 0 && (payload.bestClassName === "person" || payload.classes.includes("person"))) changed = this.mergeRecognition(payload.deviceId, "person", payload.label, payload.lastSeen, payload.firstSeen) || changed;
|
|
37032
|
+
if (payload.plateText !== void 0) changed = this.mergeRecognition(payload.deviceId, "plate", payload.plateText, payload.lastSeen, payload.firstSeen) || changed;
|
|
37033
|
+
if (!changed || !this.boundDevices.has(payload.deviceId)) return;
|
|
37034
|
+
this.renderDeviceInternal(payload.deviceId, null).catch((err) => {
|
|
37035
|
+
this.logger.warn("osd-manager: recognition-triggered render failed", {
|
|
37036
|
+
tags: { deviceId: payload.deviceId },
|
|
37037
|
+
meta: { error: String(err) }
|
|
37038
|
+
});
|
|
37039
|
+
});
|
|
37040
|
+
}
|
|
37041
|
+
/** Gallery rows are authoritative for corrections, assignments and deletion. */
|
|
37042
|
+
onRecognitionGalleryChanged(deviceId) {
|
|
37043
|
+
this.recognitionGeneration.set(deviceId, (this.recognitionGeneration.get(deviceId) ?? 0) + 1);
|
|
37044
|
+
this.recognitionInvalidatedAt.set(deviceId, this.now());
|
|
37045
|
+
this.recognitions.delete(deviceId);
|
|
37046
|
+
this.recognitionHydration.delete(deviceId);
|
|
37047
|
+
if (!this.boundDevices.has(deviceId)) return;
|
|
37048
|
+
this.renderDeviceInternal(deviceId, null).catch((err) => {
|
|
37049
|
+
this.logger.warn("osd-manager: gallery-triggered render failed", {
|
|
37050
|
+
tags: { deviceId },
|
|
37051
|
+
meta: { error: String(err) }
|
|
37052
|
+
});
|
|
37053
|
+
});
|
|
37054
|
+
}
|
|
37055
|
+
/**
|
|
36939
37056
|
* Reconcile the work list against the store rather than trusting an event
|
|
36940
37057
|
* to have arrived (D8). Cheap: one settings read per camera, on the tick
|
|
36941
37058
|
* cadence, not per frame.
|
|
@@ -37029,6 +37146,54 @@ var OsdManager = class {
|
|
|
37029
37146
|
});
|
|
37030
37147
|
return { success: true };
|
|
37031
37148
|
};
|
|
37149
|
+
copyDeviceConfiguration = async ({ sourceDeviceId, targetDeviceId }) => {
|
|
37150
|
+
if (sourceDeviceId === targetDeviceId) throw new Error("osd-manager: source and target camera must be different");
|
|
37151
|
+
const [sourceStatus, targetStatus, sourceBindings] = await Promise.all([
|
|
37152
|
+
this.deps.readOsdStatus(sourceDeviceId),
|
|
37153
|
+
this.deps.readOsdStatus(targetDeviceId),
|
|
37154
|
+
this.readBindings(sourceDeviceId)
|
|
37155
|
+
]);
|
|
37156
|
+
if (sourceStatus === null) throw new Error(`osd-manager: source device ${sourceDeviceId} exposes no overlay slots`);
|
|
37157
|
+
if (targetStatus === null) throw new Error(`osd-manager: target device ${targetDeviceId} exposes no overlay slots`);
|
|
37158
|
+
const sourceSlots = sourceStatus.overlays.filter((slot) => slot.readOnly !== true && sourceBindings[slot.id] !== void 0);
|
|
37159
|
+
if (sourceSlots.length === 0) throw new Error(`osd-manager: source device ${sourceDeviceId} has no configured writable slots`);
|
|
37160
|
+
const targetSlots = targetStatus.overlays.filter((slot) => slot.readOnly !== true);
|
|
37161
|
+
const copiedBindings = {};
|
|
37162
|
+
const copyCount = Math.min(sourceSlots.length, targetSlots.length);
|
|
37163
|
+
for (let index = 0; index < copyCount; index += 1) {
|
|
37164
|
+
const sourceSlot = sourceSlots[index];
|
|
37165
|
+
const targetSlot = targetSlots[index];
|
|
37166
|
+
if (sourceSlot === void 0 || targetSlot === void 0) continue;
|
|
37167
|
+
const binding = sourceBindings[sourceSlot.id];
|
|
37168
|
+
if (binding === void 0) continue;
|
|
37169
|
+
const conditions = binding.conditions;
|
|
37170
|
+
const normalizedConditions = conditions === void 0 ? void 0 : (() => {
|
|
37171
|
+
const { devices: _cameraScope, ...rest } = conditions;
|
|
37172
|
+
return Object.keys(rest).length === 0 ? void 0 : rest;
|
|
37173
|
+
})();
|
|
37174
|
+
copiedBindings[targetSlot.id] = {
|
|
37175
|
+
...binding,
|
|
37176
|
+
conditions: normalizedConditions
|
|
37177
|
+
};
|
|
37178
|
+
}
|
|
37179
|
+
await this.deps.bindings(targetDeviceId).set(copiedBindings);
|
|
37180
|
+
for (const key of [...this.lastWritten.keys()]) if (key.startsWith(`${targetDeviceId}:`)) this.lastWritten.delete(key);
|
|
37181
|
+
if (Object.keys(copiedBindings).length > 0) this.boundDevices.add(targetDeviceId);
|
|
37182
|
+
else this.boundDevices.delete(targetDeviceId);
|
|
37183
|
+
await this.renderDeviceInternal(targetDeviceId, null);
|
|
37184
|
+
this.logger.info("osd-manager: camera configuration copied", {
|
|
37185
|
+
tags: { deviceId: targetDeviceId },
|
|
37186
|
+
meta: {
|
|
37187
|
+
sourceDeviceId,
|
|
37188
|
+
copied: Object.keys(copiedBindings).length,
|
|
37189
|
+
skipped: Math.max(0, sourceSlots.length - targetSlots.length)
|
|
37190
|
+
}
|
|
37191
|
+
});
|
|
37192
|
+
return {
|
|
37193
|
+
copied: Object.keys(copiedBindings).length,
|
|
37194
|
+
skipped: Math.max(0, sourceSlots.length - targetSlots.length)
|
|
37195
|
+
};
|
|
37196
|
+
};
|
|
37032
37197
|
previewSlot = async ({ deviceId, slotId, binding }) => {
|
|
37033
37198
|
if (binding !== void 0) assertSupportedConditions(binding.conditions);
|
|
37034
37199
|
const effective = binding ?? (await this.readBindings(deviceId))[slotId] ?? null;
|
|
@@ -37103,6 +37268,7 @@ var OsdManager = class {
|
|
|
37103
37268
|
*/
|
|
37104
37269
|
async collectFacts(cameraDeviceId, bindings) {
|
|
37105
37270
|
const wanted = new Set([cameraDeviceId]);
|
|
37271
|
+
const needsRecognition = Object.values(bindings).some((binding) => binding.source.kind === "latest-recognition");
|
|
37106
37272
|
for (const binding of Object.values(bindings)) {
|
|
37107
37273
|
if (binding.source.kind === "device-state" && binding.source.deviceId !== void 0) wanted.add(binding.source.deviceId);
|
|
37108
37274
|
const gated = binding.conditions?.deviceState?.deviceId;
|
|
@@ -37121,12 +37287,59 @@ var OsdManager = class {
|
|
|
37121
37287
|
meta: { error: String(err) }
|
|
37122
37288
|
});
|
|
37123
37289
|
}
|
|
37290
|
+
if (needsRecognition) await this.hydrateRecognitions(cameraDeviceId);
|
|
37291
|
+
const recognitionByDevice = /* @__PURE__ */ new Map();
|
|
37292
|
+
const known = this.recognitions.get(cameraDeviceId);
|
|
37293
|
+
if (known !== void 0) recognitionByDevice.set(cameraDeviceId, {
|
|
37294
|
+
...known.person !== void 0 ? { person: known.person.text } : {},
|
|
37295
|
+
...known.plate !== void 0 ? { plate: known.plate.text } : {}
|
|
37296
|
+
});
|
|
37124
37297
|
return {
|
|
37125
37298
|
atMs: this.now(),
|
|
37126
37299
|
stateByDevice,
|
|
37300
|
+
recognitionByDevice,
|
|
37127
37301
|
deviceState: (id) => gateState.get(id)
|
|
37128
37302
|
};
|
|
37129
37303
|
}
|
|
37304
|
+
async hydrateRecognitions(deviceId) {
|
|
37305
|
+
const existing = this.recognitionHydration.get(deviceId);
|
|
37306
|
+
if (existing !== void 0) return existing;
|
|
37307
|
+
const generation = this.recognitionGeneration.get(deviceId) ?? 0;
|
|
37308
|
+
const hydration = (async () => {
|
|
37309
|
+
try {
|
|
37310
|
+
const latest = await this.deps.readLatestRecognitions(deviceId);
|
|
37311
|
+
if ((this.recognitionGeneration.get(deviceId) ?? 0) !== generation) return;
|
|
37312
|
+
if (latest.person !== void 0) this.mergeRecognition(deviceId, "person", latest.person.text, latest.person.atMs);
|
|
37313
|
+
if (latest.plate !== void 0) this.mergeRecognition(deviceId, "plate", latest.plate.text, latest.plate.atMs);
|
|
37314
|
+
} catch (err) {
|
|
37315
|
+
this.logger.warn("osd-manager: recognition history hydration failed", {
|
|
37316
|
+
tags: { deviceId },
|
|
37317
|
+
meta: { error: String(err) }
|
|
37318
|
+
});
|
|
37319
|
+
this.recognitionHydration.delete(deviceId);
|
|
37320
|
+
}
|
|
37321
|
+
})();
|
|
37322
|
+
this.recognitionHydration.set(deviceId, hydration);
|
|
37323
|
+
await hydration;
|
|
37324
|
+
}
|
|
37325
|
+
mergeRecognition(deviceId, kind, text, atMs, trackFirstSeen) {
|
|
37326
|
+
const normalized = text.trim();
|
|
37327
|
+
if (normalized === "") return false;
|
|
37328
|
+
const invalidatedAt = this.recognitionInvalidatedAt.get(deviceId);
|
|
37329
|
+
if (trackFirstSeen !== void 0 && invalidatedAt !== void 0 && trackFirstSeen <= invalidatedAt) return false;
|
|
37330
|
+
const current = this.recognitions.get(deviceId) ?? {};
|
|
37331
|
+
const previous = current[kind];
|
|
37332
|
+
if (previous !== void 0 && previous.atMs > atMs) return false;
|
|
37333
|
+
if (previous?.atMs === atMs && previous.text === normalized) return false;
|
|
37334
|
+
this.recognitions.set(deviceId, {
|
|
37335
|
+
...current,
|
|
37336
|
+
[kind]: {
|
|
37337
|
+
text: normalized,
|
|
37338
|
+
atMs
|
|
37339
|
+
}
|
|
37340
|
+
});
|
|
37341
|
+
return true;
|
|
37342
|
+
}
|
|
37130
37343
|
async readBindings(deviceId) {
|
|
37131
37344
|
try {
|
|
37132
37345
|
return await this.deps.bindings(deviceId).get();
|
|
@@ -37171,7 +37384,24 @@ function cacheKey(deviceId, slotId) {
|
|
|
37171
37384
|
*/
|
|
37172
37385
|
var DEFAULTS = { tickSeconds: DEFAULT_TICK_MS / 1e3 };
|
|
37173
37386
|
var OsdManagerAddon = class extends BaseAddon {
|
|
37387
|
+
id = "osd-manager";
|
|
37174
37388
|
manager = null;
|
|
37389
|
+
/**
|
|
37390
|
+
* Module-Federation page declaration surfaced via the `addon-pages-source`
|
|
37391
|
+
* collection cap. Mirrors the manifest `pages[]` entry — admin-ui's
|
|
37392
|
+
* `<AddonPageLoader>` loads `addon_osd_manager_page/page` from
|
|
37393
|
+
* `/api/addon-pages/osd-manager/remoteEntry.js`. Modeled directly on
|
|
37394
|
+
* `addon-benchmark` / `addon-model-studio` (docs/roadmap.md 4d).
|
|
37395
|
+
*/
|
|
37396
|
+
pages = [{
|
|
37397
|
+
id: "osd-manager",
|
|
37398
|
+
label: "OSD Manager",
|
|
37399
|
+
icon: "monitor",
|
|
37400
|
+
path: "/addon/osd-manager",
|
|
37401
|
+
remoteName: "addon_osd_manager_page",
|
|
37402
|
+
bundle: "remoteEntry.js",
|
|
37403
|
+
section: "detection"
|
|
37404
|
+
}];
|
|
37175
37405
|
constructor() {
|
|
37176
37406
|
super({ ...DEFAULTS });
|
|
37177
37407
|
}
|
|
@@ -37218,13 +37448,52 @@ var OsdManagerAddon = class extends BaseAddon {
|
|
|
37218
37448
|
const bindings = await ctx.api.deviceManager.getBindings.query({ deviceId });
|
|
37219
37449
|
return [...new Set(bindings.entries.map((e) => e.capName))];
|
|
37220
37450
|
},
|
|
37451
|
+
readLatestRecognitions: async (deviceId) => {
|
|
37452
|
+
const [faces, plates] = await Promise.all([ctx.api.faceGallery.listRecentFaces.query({
|
|
37453
|
+
deviceId,
|
|
37454
|
+
limit: 1,
|
|
37455
|
+
filter: "identified",
|
|
37456
|
+
includeCrops: false
|
|
37457
|
+
}), ctx.api.plateGallery.listPlates.query({
|
|
37458
|
+
deviceId,
|
|
37459
|
+
limit: 1
|
|
37460
|
+
})]);
|
|
37461
|
+
const face = faces[0];
|
|
37462
|
+
const plate = plates[0];
|
|
37463
|
+
return {
|
|
37464
|
+
...face?.identityName !== void 0 ? { person: {
|
|
37465
|
+
text: face.identityName,
|
|
37466
|
+
atMs: face.timestamp
|
|
37467
|
+
} } : {},
|
|
37468
|
+
...plate !== void 0 ? { plate: {
|
|
37469
|
+
text: plate.text,
|
|
37470
|
+
atMs: plate.timestamp
|
|
37471
|
+
} } : {}
|
|
37472
|
+
};
|
|
37473
|
+
},
|
|
37221
37474
|
bindings: (deviceId) => store.forDevice(deviceId)
|
|
37222
37475
|
});
|
|
37223
37476
|
this.manager = manager;
|
|
37477
|
+
this.subscribe({ category: EventCategory.PipelineAnalyticsTrackLifecycle }, (event) => {
|
|
37478
|
+
manager.onTrackLifecycle(event.data);
|
|
37479
|
+
});
|
|
37480
|
+
this.subscribe({ category: EventCategory.PipelineAnalyticsFaceGalleryChanged }, (event) => {
|
|
37481
|
+
manager.onRecognitionGalleryChanged(event.data.deviceId);
|
|
37482
|
+
});
|
|
37483
|
+
this.subscribe({ category: EventCategory.PipelineAnalyticsPlateGalleryChanged }, (event) => {
|
|
37484
|
+
manager.onRecognitionGalleryChanged(event.data.deviceId);
|
|
37485
|
+
});
|
|
37224
37486
|
await manager.start(Math.max(1, this.config.tickSeconds) * 1e3);
|
|
37487
|
+
const pagesProvider = {
|
|
37488
|
+
id: this.id,
|
|
37489
|
+
listPages: () => this.pages
|
|
37490
|
+
};
|
|
37225
37491
|
return [{
|
|
37226
37492
|
capability: osdManagerCapability,
|
|
37227
37493
|
provider: manager
|
|
37494
|
+
}, {
|
|
37495
|
+
capability: addonPagesSourceCapability,
|
|
37496
|
+
provider: pagesProvider
|
|
37228
37497
|
}];
|
|
37229
37498
|
}
|
|
37230
37499
|
async onConfigChanged() {
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
import { c as e, g as t, h as n, l as r, n as i, p as a, r as o, t as s, u as c, y as l } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react__loadShare__.js-Bs1t18EM.mjs";
|
|
2
|
+
import { n as u, r as d, t as f } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare__react_mf_1_jsx_mf_2_runtime__loadShare__.js-DalfdIDw.mjs";
|
|
3
|
+
import { g as p } from "./_virtual_mf___mfe_internal__addon_osd_manager_page__loadShare___mf_0_camstack_mf_1_types__loadShare__.js-D722amjy.mjs";
|
|
4
|
+
//#region ../ui-library/src/lib/cap-error.ts
|
|
5
|
+
function m(e) {
|
|
6
|
+
if (typeof e != "object" || !e) return null;
|
|
7
|
+
let t = Reflect.get(e, "data");
|
|
8
|
+
if (typeof t == "object" && t) {
|
|
9
|
+
let e = Reflect.get(t, "capRouteReason");
|
|
10
|
+
if (typeof e == "string") return e;
|
|
11
|
+
}
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
function h(e) {
|
|
15
|
+
let t = m(e);
|
|
16
|
+
return t === null ? (e instanceof Error ? e.message : String(e)).includes("provider not available") : t === "no-provider" || t === "node-offline";
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region ../ui-library/src/lib/responsive.ts
|
|
20
|
+
var g = "text-[10px] text-foreground-subtle";
|
|
21
|
+
//#endregion
|
|
22
|
+
//#region ../ui-library/src/lib/shared-context.ts
|
|
23
|
+
l();
|
|
24
|
+
function _(e, t) {
|
|
25
|
+
if (typeof globalThis > "u") return s(t);
|
|
26
|
+
let n = globalThis.__camstackSharedContexts, r = n ?? /* @__PURE__ */ new Map();
|
|
27
|
+
n || (globalThis.__camstackSharedContexts = r);
|
|
28
|
+
let i = r.get(e);
|
|
29
|
+
if (i) return i;
|
|
30
|
+
let a = s(t);
|
|
31
|
+
return r.set(e, a), a;
|
|
32
|
+
}
|
|
33
|
+
//#endregion
|
|
34
|
+
//#region ../ui-library/node_modules/lucide-react/dist/esm/shared/src/utils/mergeClasses.js
|
|
35
|
+
var v = (...e) => e.filter((e, t, n) => !!e && e.trim() !== "" && n.indexOf(e) === t).join(" ").trim(), y = (e) => e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), b = (e) => e.replace(/^([A-Z])|[\s-_]+(\w)/g, (e, t, n) => n ? n.toUpperCase() : t.toLowerCase()), x = (e) => {
|
|
36
|
+
let t = b(e);
|
|
37
|
+
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
38
|
+
}, S = {
|
|
39
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
40
|
+
width: 24,
|
|
41
|
+
height: 24,
|
|
42
|
+
viewBox: "0 0 24 24",
|
|
43
|
+
fill: "none",
|
|
44
|
+
stroke: "currentColor",
|
|
45
|
+
strokeWidth: 2,
|
|
46
|
+
strokeLinecap: "round",
|
|
47
|
+
strokeLinejoin: "round"
|
|
48
|
+
}, C = (e) => {
|
|
49
|
+
for (let t in e) if (t.startsWith("aria-") || t === "role" || t === "title") return !0;
|
|
50
|
+
return !1;
|
|
51
|
+
};
|
|
52
|
+
//#endregion
|
|
53
|
+
//#region ../ui-library/node_modules/lucide-react/dist/esm/Icon.js
|
|
54
|
+
l();
|
|
55
|
+
var w = o(({ color: e = "currentColor", size: t = 24, strokeWidth: n = 2, absoluteStrokeWidth: r, className: a = "", children: o, iconNode: s, ...c }, l) => i("svg", {
|
|
56
|
+
ref: l,
|
|
57
|
+
...S,
|
|
58
|
+
width: t,
|
|
59
|
+
height: t,
|
|
60
|
+
stroke: e,
|
|
61
|
+
strokeWidth: r ? Number(n) * 24 / Number(t) : n,
|
|
62
|
+
className: v("lucide", a),
|
|
63
|
+
...!o && !C(c) && { "aria-hidden": "true" },
|
|
64
|
+
...c
|
|
65
|
+
}, [...s.map(([e, t]) => i(e, t)), ...Array.isArray(o) ? o : [o]]));
|
|
66
|
+
//#endregion
|
|
67
|
+
//#region ../ui-library/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
68
|
+
l();
|
|
69
|
+
var T = (e, t) => {
|
|
70
|
+
let n = o(({ className: n, ...r }, a) => i(w, {
|
|
71
|
+
ref: a,
|
|
72
|
+
iconNode: t,
|
|
73
|
+
className: v(`lucide-${y(x(e))}`, `lucide-${e}`, n),
|
|
74
|
+
...r
|
|
75
|
+
}));
|
|
76
|
+
return n.displayName = x(e), n;
|
|
77
|
+
}, E = T("chevron-down", [["path", {
|
|
78
|
+
d: "m6 9 6 6 6-6",
|
|
79
|
+
key: "qrunsl"
|
|
80
|
+
}]]), D = T("chevron-right", [["path", {
|
|
81
|
+
d: "m9 18 6-6-6-6",
|
|
82
|
+
key: "mthhwq"
|
|
83
|
+
}]]);
|
|
84
|
+
//#endregion
|
|
85
|
+
//#region ../ui-library/src/contexts/system-context.tsx
|
|
86
|
+
l();
|
|
87
|
+
var O = _("camstack:system", null);
|
|
88
|
+
function k() {
|
|
89
|
+
let e = r(O);
|
|
90
|
+
if (!e) throw Error("useSystem(): no <SystemProvider> in tree");
|
|
91
|
+
return e;
|
|
92
|
+
}
|
|
93
|
+
//#endregion
|
|
94
|
+
//#region ../ui-library/src/hooks/use-device-proxy.ts
|
|
95
|
+
l();
|
|
96
|
+
var A = "capability.binding-changed";
|
|
97
|
+
function j(e, t) {
|
|
98
|
+
let [r, i] = n(null);
|
|
99
|
+
return c(() => {
|
|
100
|
+
if (t === null) {
|
|
101
|
+
i(null);
|
|
102
|
+
return;
|
|
103
|
+
}
|
|
104
|
+
let n = !1, r = async () => {
|
|
105
|
+
try {
|
|
106
|
+
let r = await e.deviceManager.getBindings.query({ deviceId: t });
|
|
107
|
+
n || i(r);
|
|
108
|
+
} catch {
|
|
109
|
+
n || i((e) => e);
|
|
110
|
+
}
|
|
111
|
+
};
|
|
112
|
+
r();
|
|
113
|
+
let a = e.live?.onEvent.subscribe({ category: A }, { onData: (e) => {
|
|
114
|
+
let n = e.data?.source;
|
|
115
|
+
if (!n) {
|
|
116
|
+
r();
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
n.type === "device" && n.id === t && r();
|
|
120
|
+
} });
|
|
121
|
+
return () => {
|
|
122
|
+
n = !0, a?.unsubscribe();
|
|
123
|
+
};
|
|
124
|
+
}, [e, t]), a(() => r ? p(e, r) : null, [e, r]);
|
|
125
|
+
}
|
|
126
|
+
function M(n) {
|
|
127
|
+
let r = e((e) => n ? n.subscribe(() => e()) : () => void 0, [n]), i = e(() => n?.value, [n]);
|
|
128
|
+
return t(r, i, i);
|
|
129
|
+
}
|
|
130
|
+
//#endregion
|
|
131
|
+
//#region ../ui-library/src/composites/widget-panel.tsx
|
|
132
|
+
l();
|
|
133
|
+
function N({ title: e, icon: t, headerRight: r, collapsible: i = !1, defaultOpen: a = !0, bodyClassName: o = "p-3", children: s }) {
|
|
134
|
+
let [c, l] = n(a), p = !i || c, m = /* @__PURE__ */ d(f, { children: [/* @__PURE__ */ d("span", {
|
|
135
|
+
className: "flex items-center gap-2 text-xs font-semibold uppercase tracking-wider text-foreground",
|
|
136
|
+
children: [t, e]
|
|
137
|
+
}), i ? u(c ? E : D, { className: "h-3.5 w-3.5 text-foreground-subtle" }) : r] }), h = `px-4 py-2 flex items-center justify-between ${p ? "border-b border-border" : ""}`;
|
|
138
|
+
return /* @__PURE__ */ d("div", {
|
|
139
|
+
className: "rounded-lg border border-border bg-surface overflow-hidden",
|
|
140
|
+
children: [i ? /* @__PURE__ */ u("button", {
|
|
141
|
+
type: "button",
|
|
142
|
+
onClick: () => l((e) => !e),
|
|
143
|
+
className: `w-full text-left ${h}`,
|
|
144
|
+
children: m
|
|
145
|
+
}) : /* @__PURE__ */ u("div", {
|
|
146
|
+
className: h,
|
|
147
|
+
children: m
|
|
148
|
+
}), p ? /* @__PURE__ */ u("div", {
|
|
149
|
+
className: o,
|
|
150
|
+
children: s
|
|
151
|
+
}) : null]
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
l(), _("camstack:player-overlays-state", null);
|
|
155
|
+
var P = _("camstack:player-overlays-actions", null);
|
|
156
|
+
function F(e) {
|
|
157
|
+
let t = r(P);
|
|
158
|
+
c(() => {
|
|
159
|
+
if (!(!t || !e)) return t.setLayer(e), () => t.removeLayer(e.id);
|
|
160
|
+
}, [t, e]);
|
|
161
|
+
}
|
|
162
|
+
//#endregion
|
|
163
|
+
export { k as a, _ as c, M as i, g as l, N as n, E as o, j as r, T as s, F as t, h as u };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { init as e } from "@module-federation/runtime";
|
|
2
|
+
//#region virtual:mf-REMOTE_ENTRY_SSR_ID:__mfe_internal__addon_osd_manager_page__remoteEntry_js
|
|
3
|
+
var t;
|
|
4
|
+
async function n() {
|
|
5
|
+
return t ??= import("./virtual_mf-exposes-ssr___mfe_internal__addon_osd_manager_page__remoteEntry_js-Bgw9YZ5T.mjs").then((e) => e.default ?? e), t;
|
|
6
|
+
}
|
|
7
|
+
async function r(t = {}, n = []) {
|
|
8
|
+
let r = e({
|
|
9
|
+
name: "addon_osd_manager_page",
|
|
10
|
+
remotes: [],
|
|
11
|
+
shared: {}
|
|
12
|
+
}), i = { from: "addon_osd_manager_page" };
|
|
13
|
+
if (!(n.indexOf(i) >= 0)) {
|
|
14
|
+
n.push(i), r.initShareScopeMap("default", t);
|
|
15
|
+
try {
|
|
16
|
+
await Promise.all(await r.initializeSharing("default", {
|
|
17
|
+
strategy: "version-first",
|
|
18
|
+
from: "build",
|
|
19
|
+
initScope: n
|
|
20
|
+
}));
|
|
21
|
+
} catch (e) {
|
|
22
|
+
console.error("[Module Federation SSR]", e);
|
|
23
|
+
}
|
|
24
|
+
return r;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
async function i(e) {
|
|
28
|
+
let t = await n();
|
|
29
|
+
if (!(e in t)) throw Error(`[Module Federation] Module ${e} does not exist in container.`);
|
|
30
|
+
return t[e]().then((e) => () => e);
|
|
31
|
+
}
|
|
32
|
+
//#endregion
|
|
33
|
+
export { i as get, r as init };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var e = Object.create, t = Object.defineProperty, n = Object.getOwnPropertyDescriptor, r = Object.getOwnPropertyNames, i = Object.getPrototypeOf, a = Object.prototype.hasOwnProperty, o = (e, t) => () => (e && (t = e(e = 0)), t), s = (e, t) => () => (t || (e((t = { exports: {} }).exports, t), e = null), t.exports), c = (e, n) => {
|
|
3
|
+
let r = {};
|
|
4
|
+
for (var i in e) t(r, i, {
|
|
5
|
+
get: e[i],
|
|
6
|
+
enumerable: !0
|
|
7
|
+
});
|
|
8
|
+
return n || t(r, Symbol.toStringTag, { value: "Module" }), r;
|
|
9
|
+
}, l = (e, i, o, s) => {
|
|
10
|
+
if (i && typeof i == "object" || typeof i == "function") for (var c = r(i), l = 0, u = c.length, d; l < u; l++) d = c[l], !a.call(e, d) && d !== o && t(e, d, {
|
|
11
|
+
get: ((e) => i[e]).bind(null, d),
|
|
12
|
+
enumerable: !(s = n(i, d)) || s.enumerable
|
|
13
|
+
});
|
|
14
|
+
return e;
|
|
15
|
+
}, u = (n, r, a) => (a = n == null ? {} : e(i(n)), l(r || !n || !n.__esModule ? t(a, "default", {
|
|
16
|
+
value: n,
|
|
17
|
+
enumerable: !0
|
|
18
|
+
}) : a, n)), d = (e) => a.call(e, "module.exports") ? e["module.exports"] : l(t({}, "__esModule", { value: !0 }), e);
|
|
19
|
+
//#endregion
|
|
20
|
+
export { u as a, d as i, o as n, c as r, s as t };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { s as e } from "./player-overlays-CwbydND6.mjs";
|
|
2
|
+
var t = e("eye-off", [
|
|
3
|
+
["path", {
|
|
4
|
+
d: "M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",
|
|
5
|
+
key: "ct8e1f"
|
|
6
|
+
}],
|
|
7
|
+
["path", {
|
|
8
|
+
d: "M14.084 14.158a3 3 0 0 1-4.242-4.242",
|
|
9
|
+
key: "151rxh"
|
|
10
|
+
}],
|
|
11
|
+
["path", {
|
|
12
|
+
d: "M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",
|
|
13
|
+
key: "13bj9a"
|
|
14
|
+
}],
|
|
15
|
+
["path", {
|
|
16
|
+
d: "m2 2 20 20",
|
|
17
|
+
key: "1ooewy"
|
|
18
|
+
}]
|
|
19
|
+
]), n = e("square", [["rect", {
|
|
20
|
+
width: "18",
|
|
21
|
+
height: "18",
|
|
22
|
+
x: "3",
|
|
23
|
+
y: "3",
|
|
24
|
+
rx: "2",
|
|
25
|
+
key: "afitv7"
|
|
26
|
+
}]]), r = e("trash-2", [
|
|
27
|
+
["path", {
|
|
28
|
+
d: "M10 11v6",
|
|
29
|
+
key: "nco0om"
|
|
30
|
+
}],
|
|
31
|
+
["path", {
|
|
32
|
+
d: "M14 11v6",
|
|
33
|
+
key: "outv1u"
|
|
34
|
+
}],
|
|
35
|
+
["path", {
|
|
36
|
+
d: "M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",
|
|
37
|
+
key: "miytrc"
|
|
38
|
+
}],
|
|
39
|
+
["path", {
|
|
40
|
+
d: "M3 6h18",
|
|
41
|
+
key: "d0wm0j"
|
|
42
|
+
}],
|
|
43
|
+
["path", {
|
|
44
|
+
d: "M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",
|
|
45
|
+
key: "e791ji"
|
|
46
|
+
}]
|
|
47
|
+
]);
|
|
48
|
+
//#endregion
|
|
49
|
+
export { n, t as r, r as t };
|