@camstack/types 0.1.8 → 0.1.10
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/__tests__/addon-capability-provider.test.d.ts +2 -0
- package/dist/__tests__/addon-capability-provider.test.d.ts.map +1 -0
- package/dist/__tests__/addon-declaration.test.d.ts +2 -0
- package/dist/__tests__/addon-declaration.test.d.ts.map +1 -0
- package/dist/__tests__/capability.test.d.ts +2 -0
- package/dist/__tests__/capability.test.d.ts.map +1 -0
- package/dist/catalogs/coco-classmap.d.ts +5 -0
- package/dist/catalogs/coco-classmap.d.ts.map +1 -0
- package/dist/catalogs/index.d.ts +2 -0
- package/dist/catalogs/index.d.ts.map +1 -0
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/generated/addon-api.d.ts +4974 -0
- package/dist/generated/addon-api.d.ts.map +1 -0
- package/dist/index.d.ts +82 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +550 -744
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +529 -777
- package/dist/index.mjs.map +1 -1
- package/dist/interfaces/addon-i18n.d.ts +41 -0
- package/dist/interfaces/addon-i18n.d.ts.map +1 -0
- package/dist/interfaces/addon-routes.d.ts +50 -0
- package/dist/interfaces/addon-routes.d.ts.map +1 -0
- package/dist/interfaces/addon.d.ts +294 -0
- package/dist/interfaces/addon.d.ts.map +1 -0
- package/dist/interfaces/advanced-notifier.d.ts +59 -0
- package/dist/interfaces/advanced-notifier.d.ts.map +1 -0
- package/dist/interfaces/agent-protocol.d.ts +189 -0
- package/dist/interfaces/agent-protocol.d.ts.map +1 -0
- package/dist/interfaces/agent.d.ts +87 -0
- package/dist/interfaces/agent.d.ts.map +1 -0
- package/dist/interfaces/analysis-persistence.d.ts +278 -0
- package/dist/interfaces/analysis-persistence.d.ts.map +1 -0
- package/dist/interfaces/analysis.d.ts +27 -0
- package/dist/interfaces/analysis.d.ts.map +1 -0
- package/dist/interfaces/api-shared.d.ts +176 -0
- package/dist/interfaces/api-shared.d.ts.map +1 -0
- package/dist/interfaces/auth-provider.d.ts +39 -0
- package/dist/interfaces/auth-provider.d.ts.map +1 -0
- package/dist/interfaces/auth.d.ts +47 -0
- package/dist/interfaces/auth.d.ts.map +1 -0
- package/dist/interfaces/camera-pipeline.d.ts +121 -0
- package/dist/interfaces/camera-pipeline.d.ts.map +1 -0
- package/dist/interfaces/capability.d.ts +84 -0
- package/dist/interfaces/capability.d.ts.map +1 -0
- package/dist/interfaces/classifier.d.ts +8 -0
- package/dist/interfaces/classifier.d.ts.map +1 -0
- package/dist/interfaces/config-ui.d.ts +152 -0
- package/dist/interfaces/config-ui.d.ts.map +1 -0
- package/dist/interfaces/context.d.ts +44 -0
- package/dist/interfaces/context.d.ts.map +1 -0
- package/dist/interfaces/cropper.d.ts +8 -0
- package/dist/interfaces/cropper.d.ts.map +1 -0
- package/dist/interfaces/decoder.d.ts +27 -0
- package/dist/interfaces/decoder.d.ts.map +1 -0
- package/dist/interfaces/detection-addon.d.ts +15 -0
- package/dist/interfaces/detection-addon.d.ts.map +1 -0
- package/dist/interfaces/detector.d.ts +8 -0
- package/dist/interfaces/detector.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/accessory.d.ts +14 -0
- package/dist/interfaces/device-capabilities/accessory.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/audio-detector.d.ts +12 -0
- package/dist/interfaces/device-capabilities/audio-detector.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/camera.d.ts +22 -0
- package/dist/interfaces/device-capabilities/camera.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/doorbell.d.ts +10 -0
- package/dist/interfaces/device-capabilities/doorbell.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/events.d.ts +47 -0
- package/dist/interfaces/device-capabilities/events.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/index.d.ts +15 -0
- package/dist/interfaces/device-capabilities/index.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/motion-sensor.d.ts +7 -0
- package/dist/interfaces/device-capabilities/motion-sensor.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/native-detection.d.ts +14 -0
- package/dist/interfaces/device-capabilities/native-detection.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/object-detector.d.ts +59 -0
- package/dist/interfaces/device-capabilities/object-detector.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/pan-tilt-zoom.d.ts +29 -0
- package/dist/interfaces/device-capabilities/pan-tilt-zoom.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/recording.d.ts +18 -0
- package/dist/interfaces/device-capabilities/recording.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/siren.d.ts +8 -0
- package/dist/interfaces/device-capabilities/siren.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/status-light.d.ts +7 -0
- package/dist/interfaces/device-capabilities/status-light.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/switch.d.ts +8 -0
- package/dist/interfaces/device-capabilities/switch.d.ts.map +1 -0
- package/dist/interfaces/device-capabilities/two-way-audio.d.ts +8 -0
- package/dist/interfaces/device-capabilities/two-way-audio.d.ts.map +1 -0
- package/dist/interfaces/device-capability.d.ts +14 -0
- package/dist/interfaces/device-capability.d.ts.map +1 -0
- package/dist/interfaces/device-provider.d.ts +43 -0
- package/dist/interfaces/device-provider.d.ts.map +1 -0
- package/dist/interfaces/device.d.ts +40 -0
- package/dist/interfaces/device.d.ts.map +1 -0
- package/dist/interfaces/event-bus.d.ts +244 -0
- package/dist/interfaces/event-bus.d.ts.map +1 -0
- package/dist/interfaces/feature-flags.d.ts +14 -0
- package/dist/interfaces/feature-flags.d.ts.map +1 -0
- package/dist/interfaces/ffmpeg.d.ts +10 -0
- package/dist/interfaces/ffmpeg.d.ts.map +1 -0
- package/dist/interfaces/inference-capabilities.d.ts +101 -0
- package/dist/interfaces/inference-capabilities.d.ts.map +1 -0
- package/dist/interfaces/inference-engine.d.ts +17 -0
- package/dist/interfaces/inference-engine.d.ts.map +1 -0
- package/dist/interfaces/lifecycle.d.ts +19 -0
- package/dist/interfaces/lifecycle.d.ts.map +1 -0
- package/dist/interfaces/logging.d.ts +33 -0
- package/dist/interfaces/logging.d.ts.map +1 -0
- package/dist/interfaces/model-catalog.d.ts +25 -0
- package/dist/interfaces/model-catalog.d.ts.map +1 -0
- package/dist/interfaces/network-quality.d.ts +25 -0
- package/dist/interfaces/network-quality.d.ts.map +1 -0
- package/dist/interfaces/network.d.ts +43 -0
- package/dist/interfaces/network.d.ts.map +1 -0
- package/dist/interfaces/notification.d.ts +53 -0
- package/dist/interfaces/notification.d.ts.map +1 -0
- package/dist/interfaces/pipeline-runner.d.ts +23 -0
- package/dist/interfaces/pipeline-runner.d.ts.map +1 -0
- package/dist/interfaces/pipeline-slot.d.ts +10 -0
- package/dist/interfaces/pipeline-slot.d.ts.map +1 -0
- package/dist/interfaces/platform.d.ts +55 -0
- package/dist/interfaces/platform.d.ts.map +1 -0
- package/dist/interfaces/process.d.ts +41 -0
- package/dist/interfaces/process.d.ts.map +1 -0
- package/dist/interfaces/python-env.d.ts +20 -0
- package/dist/interfaces/python-env.d.ts.map +1 -0
- package/dist/interfaces/refiner.d.ts +8 -0
- package/dist/interfaces/refiner.d.ts.map +1 -0
- package/dist/interfaces/repl.d.ts +26 -0
- package/dist/interfaces/repl.d.ts.map +1 -0
- package/dist/interfaces/repositories.d.ts +20 -0
- package/dist/interfaces/repositories.d.ts.map +1 -0
- package/dist/interfaces/restreamer.d.ts +24 -0
- package/dist/interfaces/restreamer.d.ts.map +1 -0
- package/dist/interfaces/router.d.ts +30 -0
- package/dist/interfaces/router.d.ts.map +1 -0
- package/dist/interfaces/scene-intelligence.d.ts +21 -0
- package/dist/interfaces/scene-intelligence.d.ts.map +1 -0
- package/dist/interfaces/scoped-token.d.ts +22 -0
- package/dist/interfaces/scoped-token.d.ts.map +1 -0
- package/dist/interfaces/server-analysis.d.ts +146 -0
- package/dist/interfaces/server-analysis.d.ts.map +1 -0
- package/dist/interfaces/server-network.d.ts +78 -0
- package/dist/interfaces/server-network.d.ts.map +1 -0
- package/dist/interfaces/storage-backend.d.ts +27 -0
- package/dist/interfaces/storage-backend.d.ts.map +1 -0
- package/dist/interfaces/storage.d.ts +174 -0
- package/dist/interfaces/storage.d.ts.map +1 -0
- package/dist/interfaces/stream-broker.d.ts +92 -0
- package/dist/interfaces/stream-broker.d.ts.map +1 -0
- package/dist/interfaces/streaming.d.ts +29 -0
- package/dist/interfaces/streaming.d.ts.map +1 -0
- package/dist/interfaces/task-handler.d.ts +46 -0
- package/dist/interfaces/task-handler.d.ts.map +1 -0
- package/dist/interfaces/webrtc-provider.d.ts +11 -0
- package/dist/interfaces/webrtc-provider.d.ts.map +1 -0
- package/dist/interfaces/worker-protocol.d.ts +110 -0
- package/dist/interfaces/worker-protocol.d.ts.map +1 -0
- package/dist/schemas/system-settings-schemas.d.ts +27 -0
- package/dist/schemas/system-settings-schemas.d.ts.map +1 -0
- package/dist/types/analytics.d.ts +75 -0
- package/dist/types/analytics.d.ts.map +1 -0
- package/dist/types/benchmark.d.ts +112 -0
- package/dist/types/benchmark.d.ts.map +1 -0
- package/dist/types/camera-detection.d.ts +34 -0
- package/dist/types/camera-detection.d.ts.map +1 -0
- package/dist/types/config.d.ts +37 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/detection.d.ts +93 -0
- package/dist/types/detection.d.ts.map +1 -0
- package/dist/types/device-type.d.ts +10 -0
- package/dist/types/device-type.d.ts.map +1 -0
- package/dist/types/entities.d.ts +35 -0
- package/dist/types/entities.d.ts.map +1 -0
- package/dist/types/events.d.ts +35 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/io.d.ts +25 -0
- package/dist/types/io.d.ts.map +1 -0
- package/dist/types/labels.d.ts +12 -0
- package/dist/types/labels.d.ts.map +1 -0
- package/dist/types/live-state.d.ts +47 -0
- package/dist/types/live-state.d.ts.map +1 -0
- package/dist/types/models.d.ts +79 -0
- package/dist/types/models.d.ts.map +1 -0
- package/dist/types/pipeline-schema.d.ts +78 -0
- package/dist/types/pipeline-schema.d.ts.map +1 -0
- package/dist/types/pipeline.d.ts +42 -0
- package/dist/types/pipeline.d.ts.map +1 -0
- package/dist/types/tracked.d.ts +21 -0
- package/dist/types/tracked.d.ts.map +1 -0
- package/dist/types/zones.d.ts +48 -0
- package/dist/types/zones.d.ts.map +1 -0
- package/dist/utils/cosine-similarity.d.ts +3 -0
- package/dist/utils/cosine-similarity.d.ts.map +1 -0
- package/dist/utils/hf-url.d.ts +2 -0
- package/dist/utils/hf-url.d.ts.map +1 -0
- package/package.json +5 -5
package/dist/index.mjs
CHANGED
|
@@ -1,825 +1,577 @@
|
|
|
1
|
-
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
// src/interfaces/storage-backend.ts
|
|
2
|
+
var DEFAULT_LOCATION_SUBPATHS = {
|
|
3
|
+
"recordings-high": "recordings-high",
|
|
4
|
+
"recordings-low": "recordings-low",
|
|
5
|
+
"recordings-clips": "recordings-clips",
|
|
6
|
+
"event-images": "event-images",
|
|
7
|
+
"models": "models",
|
|
8
|
+
"addons-data": "addons-data",
|
|
9
|
+
"cache": "/tmp/camstack-cache",
|
|
10
|
+
"logs": "logs"
|
|
9
11
|
};
|
|
10
|
-
var __export = (target, all) => {
|
|
11
|
-
for (var name in all)
|
|
12
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
13
|
-
};
|
|
14
|
-
var __copyProps = (to, from, except, desc) => {
|
|
15
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
16
|
-
for (let key of __getOwnPropNames(from))
|
|
17
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
18
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
19
|
-
}
|
|
20
|
-
return to;
|
|
21
|
-
};
|
|
22
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
23
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
24
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
25
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
26
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
27
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
28
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
29
|
-
mod
|
|
30
|
-
));
|
|
31
|
-
|
|
32
|
-
// src/types/io.js
|
|
33
|
-
var require_io = __commonJS({
|
|
34
|
-
"src/types/io.js"(exports) {
|
|
35
|
-
"use strict";
|
|
36
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// src/types/labels.js
|
|
41
|
-
var require_labels = __commonJS({
|
|
42
|
-
"src/types/labels.js"(exports) {
|
|
43
|
-
"use strict";
|
|
44
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
// src/types/detection.js
|
|
49
|
-
var require_detection = __commonJS({
|
|
50
|
-
"src/types/detection.js"(exports) {
|
|
51
|
-
"use strict";
|
|
52
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
// src/types/tracked.js
|
|
57
|
-
var require_tracked = __commonJS({
|
|
58
|
-
"src/types/tracked.js"(exports) {
|
|
59
|
-
"use strict";
|
|
60
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
61
|
-
}
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
// src/types/events.js
|
|
65
|
-
var require_events = __commonJS({
|
|
66
|
-
"src/types/events.js"(exports) {
|
|
67
|
-
"use strict";
|
|
68
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
|
|
72
|
-
// src/types/config.js
|
|
73
|
-
var require_config = __commonJS({
|
|
74
|
-
"src/types/config.js"(exports) {
|
|
75
|
-
"use strict";
|
|
76
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
|
-
}
|
|
78
|
-
});
|
|
79
12
|
|
|
80
|
-
// src/
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
var require_zones = __commonJS({
|
|
90
|
-
"src/types/zones.js"(exports) {
|
|
91
|
-
"use strict";
|
|
92
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
// src/interfaces/addon-i18n.ts
|
|
14
|
+
function resolveTranslation(provider, locale, key) {
|
|
15
|
+
if (provider.getTranslations) {
|
|
16
|
+
const map = provider.getTranslations(locale);
|
|
17
|
+
if (map && key in map) return map[key];
|
|
18
|
+
if (locale !== "en") {
|
|
19
|
+
const fallback = provider.getTranslations("en");
|
|
20
|
+
if (fallback && key in fallback) return fallback[key];
|
|
21
|
+
}
|
|
93
22
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
23
|
+
if (provider.getTranslationBundle) {
|
|
24
|
+
const bundle = provider.getTranslationBundle();
|
|
25
|
+
const map = bundle[locale];
|
|
26
|
+
if (map && key in map) return map[key];
|
|
27
|
+
if (locale !== "en") {
|
|
28
|
+
const fallback = bundle["en"];
|
|
29
|
+
if (fallback && key in fallback) return fallback[key];
|
|
30
|
+
}
|
|
101
31
|
}
|
|
102
|
-
|
|
32
|
+
return key;
|
|
33
|
+
}
|
|
103
34
|
|
|
104
|
-
// src/
|
|
105
|
-
var
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
35
|
+
// src/interfaces/feature-flags.ts
|
|
36
|
+
var DEFAULT_FEATURES = {
|
|
37
|
+
streaming: true,
|
|
38
|
+
notifications: true,
|
|
39
|
+
objectDetection: false,
|
|
40
|
+
remoteAccess: true,
|
|
41
|
+
agentCluster: false,
|
|
42
|
+
smartHome: true,
|
|
43
|
+
recordings: true,
|
|
44
|
+
backup: true,
|
|
45
|
+
repl: true
|
|
46
|
+
};
|
|
111
47
|
|
|
112
|
-
// src/
|
|
113
|
-
var
|
|
114
|
-
|
|
115
|
-
"use strict";
|
|
116
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
117
|
-
}
|
|
118
|
-
});
|
|
48
|
+
// src/interfaces/agent-protocol.ts
|
|
49
|
+
var BINARY_FRAME_HEADER_SIZE = 29;
|
|
50
|
+
var BINARY_FRAME_TYPE = 1;
|
|
119
51
|
|
|
120
|
-
// src/
|
|
121
|
-
var
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
52
|
+
// src/interfaces/server-analysis.ts
|
|
53
|
+
var DETECTION_TYPES = ["person", "vehicle", "animal", "package"];
|
|
54
|
+
var SUB_DETECTION_TYPES = ["face", "plate"];
|
|
55
|
+
var RECOGNITION_TYPES = ["face", "plate", "clip", "custom"];
|
|
56
|
+
function createAnalysisContext(deviceId, frame, rawDetections) {
|
|
57
|
+
return {
|
|
58
|
+
deviceId,
|
|
59
|
+
frame,
|
|
60
|
+
timestamp: frame.timestamp,
|
|
61
|
+
rawDetections,
|
|
62
|
+
trackedDetections: [],
|
|
63
|
+
events: [],
|
|
64
|
+
metadata: {}
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
function enrichContext(ctx, updates) {
|
|
68
|
+
return {
|
|
69
|
+
...ctx,
|
|
70
|
+
trackedDetections: updates.trackedDetections ?? ctx.trackedDetections,
|
|
71
|
+
events: updates.events ?? ctx.events,
|
|
72
|
+
metadata: updates.metadata ? { ...ctx.metadata, ...updates.metadata } : ctx.metadata
|
|
73
|
+
};
|
|
74
|
+
}
|
|
127
75
|
|
|
128
|
-
// src/interfaces/
|
|
129
|
-
var
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
"recordings-high": "recordings-high",
|
|
136
|
-
"recordings-low": "recordings-low",
|
|
137
|
-
"recordings-clips": "recordings-clips",
|
|
138
|
-
"event-images": "event-images",
|
|
139
|
-
"models": "models",
|
|
140
|
-
"addons-data": "addons-data",
|
|
141
|
-
"cache": "/tmp/camstack-cache",
|
|
142
|
-
"logs": "logs"
|
|
143
|
-
};
|
|
144
|
-
}
|
|
145
|
-
});
|
|
76
|
+
// src/interfaces/analysis-persistence.ts
|
|
77
|
+
var DEFAULT_RETENTION = {
|
|
78
|
+
cleanupIntervalMs: 60 * 60 * 1e3,
|
|
79
|
+
detectionEventsDays: 30,
|
|
80
|
+
audioLevelsDays: 7,
|
|
81
|
+
snapshotsDays: 14
|
|
82
|
+
};
|
|
146
83
|
|
|
147
|
-
// src/
|
|
148
|
-
var
|
|
149
|
-
"
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
84
|
+
// src/schemas/system-settings-schemas.ts
|
|
85
|
+
var READ_ONLY_SECTIONS = /* @__PURE__ */ new Set([
|
|
86
|
+
"server"
|
|
87
|
+
]);
|
|
88
|
+
var SETTINGS_TABS = [
|
|
89
|
+
{ id: "server", label: "Server" },
|
|
90
|
+
{ id: "logging", label: "Logs" },
|
|
91
|
+
{ id: "recording", label: "Recording" },
|
|
92
|
+
{ id: "ffmpeg", label: "FFmpeg" },
|
|
93
|
+
{ id: "detection", label: "Detection" },
|
|
94
|
+
{ id: "auth", label: "Auth" },
|
|
95
|
+
{ id: "retention", label: "Retention" }
|
|
96
|
+
];
|
|
97
|
+
var SERVER_SCHEMA = {
|
|
98
|
+
sections: [
|
|
99
|
+
{
|
|
100
|
+
id: "server-info",
|
|
101
|
+
title: "Server",
|
|
102
|
+
description: "Core server connection settings (read-only)",
|
|
103
|
+
columns: 2,
|
|
104
|
+
fields: [
|
|
105
|
+
{
|
|
106
|
+
type: "info",
|
|
107
|
+
key: "server-restart-note",
|
|
108
|
+
label: "Restart required",
|
|
109
|
+
content: "Server settings are read-only. Change them in config.yaml and restart.",
|
|
110
|
+
variant: "warning"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
type: "text",
|
|
114
|
+
key: "port",
|
|
115
|
+
label: "Port",
|
|
116
|
+
disabled: true,
|
|
117
|
+
description: "Listening port"
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
type: "text",
|
|
121
|
+
key: "host",
|
|
122
|
+
label: "Host",
|
|
123
|
+
disabled: true,
|
|
124
|
+
description: "Bind address"
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
type: "text",
|
|
128
|
+
key: "dataPath",
|
|
129
|
+
label: "Data Path",
|
|
130
|
+
disabled: true,
|
|
131
|
+
description: "Root data directory",
|
|
132
|
+
span: 2
|
|
173
133
|
}
|
|
174
|
-
|
|
175
|
-
return key;
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
// src/interfaces/feature-flags.js
|
|
181
|
-
var require_feature_flags = __commonJS({
|
|
182
|
-
"src/interfaces/feature-flags.js"(exports) {
|
|
183
|
-
"use strict";
|
|
184
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
185
|
-
exports.DEFAULT_FEATURES = void 0;
|
|
186
|
-
exports.DEFAULT_FEATURES = {
|
|
187
|
-
streaming: true,
|
|
188
|
-
notifications: true,
|
|
189
|
-
objectDetection: false,
|
|
190
|
-
remoteAccess: true,
|
|
191
|
-
agentCluster: false,
|
|
192
|
-
smartHome: true,
|
|
193
|
-
recordings: true,
|
|
194
|
-
backup: true,
|
|
195
|
-
repl: true
|
|
196
|
-
};
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
// src/interfaces/agent-protocol.js
|
|
201
|
-
var require_agent_protocol = __commonJS({
|
|
202
|
-
"src/interfaces/agent-protocol.js"(exports) {
|
|
203
|
-
"use strict";
|
|
204
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
205
|
-
exports.BINARY_FRAME_TYPE = exports.BINARY_FRAME_HEADER_SIZE = void 0;
|
|
206
|
-
exports.BINARY_FRAME_HEADER_SIZE = 29;
|
|
207
|
-
exports.BINARY_FRAME_TYPE = 1;
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
// src/interfaces/server-analysis.js
|
|
212
|
-
var require_server_analysis = __commonJS({
|
|
213
|
-
"src/interfaces/server-analysis.js"(exports) {
|
|
214
|
-
"use strict";
|
|
215
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
216
|
-
exports.RECOGNITION_TYPES = exports.SUB_DETECTION_TYPES = exports.DETECTION_TYPES = void 0;
|
|
217
|
-
exports.createAnalysisContext = createAnalysisContext;
|
|
218
|
-
exports.enrichContext = enrichContext;
|
|
219
|
-
exports.DETECTION_TYPES = ["person", "vehicle", "animal", "package"];
|
|
220
|
-
exports.SUB_DETECTION_TYPES = ["face", "plate"];
|
|
221
|
-
exports.RECOGNITION_TYPES = ["face", "plate", "clip", "custom"];
|
|
222
|
-
function createAnalysisContext(deviceId, frame, rawDetections) {
|
|
223
|
-
return {
|
|
224
|
-
deviceId,
|
|
225
|
-
frame,
|
|
226
|
-
timestamp: frame.timestamp,
|
|
227
|
-
rawDetections,
|
|
228
|
-
trackedDetections: [],
|
|
229
|
-
events: [],
|
|
230
|
-
metadata: {}
|
|
231
|
-
};
|
|
232
|
-
}
|
|
233
|
-
function enrichContext(ctx, updates) {
|
|
234
|
-
return {
|
|
235
|
-
...ctx,
|
|
236
|
-
trackedDetections: updates.trackedDetections ?? ctx.trackedDetections,
|
|
237
|
-
events: updates.events ?? ctx.events,
|
|
238
|
-
metadata: updates.metadata ? { ...ctx.metadata, ...updates.metadata } : ctx.metadata
|
|
239
|
-
};
|
|
134
|
+
]
|
|
240
135
|
}
|
|
241
|
-
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
snapshotsDays: 14
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
});
|
|
258
|
-
|
|
259
|
-
// src/schemas/system-settings-schemas.js
|
|
260
|
-
var require_system_settings_schemas = __commonJS({
|
|
261
|
-
"src/schemas/system-settings-schemas.js"(exports) {
|
|
262
|
-
"use strict";
|
|
263
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
264
|
-
exports.SYSTEM_SETTINGS_SCHEMAS = exports.SETTINGS_TABS = exports.READ_ONLY_SECTIONS = void 0;
|
|
265
|
-
exports.getSystemSettingsSchema = getSystemSettingsSchema;
|
|
266
|
-
exports.READ_ONLY_SECTIONS = /* @__PURE__ */ new Set([
|
|
267
|
-
"server"
|
|
268
|
-
]);
|
|
269
|
-
exports.SETTINGS_TABS = [
|
|
270
|
-
{ id: "server", label: "Server" },
|
|
271
|
-
{ id: "logging", label: "Logs" },
|
|
272
|
-
{ id: "recording", label: "Recording" },
|
|
273
|
-
{ id: "ffmpeg", label: "FFmpeg" },
|
|
274
|
-
{ id: "detection", label: "Detection" },
|
|
275
|
-
{ id: "auth", label: "Auth" },
|
|
276
|
-
{ id: "retention", label: "Retention" }
|
|
277
|
-
];
|
|
278
|
-
var SERVER_SCHEMA = {
|
|
279
|
-
sections: [
|
|
136
|
+
]
|
|
137
|
+
};
|
|
138
|
+
var STORAGE_SCHEMA = {
|
|
139
|
+
sections: []
|
|
140
|
+
};
|
|
141
|
+
var LOGGING_SCHEMA = {
|
|
142
|
+
sections: [
|
|
143
|
+
{
|
|
144
|
+
id: "logging-settings",
|
|
145
|
+
title: "Logging",
|
|
146
|
+
description: "Global log verbosity. Retention is managed per log-destination addon.",
|
|
147
|
+
columns: 1,
|
|
148
|
+
fields: [
|
|
280
149
|
{
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
{
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
label: "Restart required",
|
|
290
|
-
content: "Server settings are read-only. Change them in config.yaml and restart.",
|
|
291
|
-
variant: "warning"
|
|
292
|
-
},
|
|
293
|
-
{
|
|
294
|
-
type: "text",
|
|
295
|
-
key: "port",
|
|
296
|
-
label: "Port",
|
|
297
|
-
disabled: true,
|
|
298
|
-
description: "Listening port"
|
|
299
|
-
},
|
|
300
|
-
{
|
|
301
|
-
type: "text",
|
|
302
|
-
key: "host",
|
|
303
|
-
label: "Host",
|
|
304
|
-
disabled: true,
|
|
305
|
-
description: "Bind address"
|
|
306
|
-
},
|
|
307
|
-
{
|
|
308
|
-
type: "text",
|
|
309
|
-
key: "dataPath",
|
|
310
|
-
label: "Data Path",
|
|
311
|
-
disabled: true,
|
|
312
|
-
description: "Root data directory",
|
|
313
|
-
span: 2
|
|
314
|
-
}
|
|
150
|
+
type: "select",
|
|
151
|
+
key: "level",
|
|
152
|
+
label: "Log Level",
|
|
153
|
+
options: [
|
|
154
|
+
{ value: "debug", label: "Debug" },
|
|
155
|
+
{ value: "info", label: "Info" },
|
|
156
|
+
{ value: "warn", label: "Warn" },
|
|
157
|
+
{ value: "error", label: "Error" }
|
|
315
158
|
]
|
|
316
159
|
}
|
|
317
160
|
]
|
|
318
|
-
}
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
161
|
+
}
|
|
162
|
+
]
|
|
163
|
+
};
|
|
164
|
+
var RECORDING_SCHEMA = {
|
|
165
|
+
sections: [
|
|
166
|
+
{
|
|
167
|
+
id: "recording-settings",
|
|
168
|
+
title: "Recording",
|
|
169
|
+
description: "Video recording segment and retention defaults",
|
|
170
|
+
columns: 2,
|
|
171
|
+
fields: [
|
|
324
172
|
{
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
173
|
+
type: "number",
|
|
174
|
+
key: "segmentDurationSeconds",
|
|
175
|
+
label: "Segment Duration",
|
|
176
|
+
description: "Length of each recording segment",
|
|
177
|
+
min: 1,
|
|
178
|
+
max: 60,
|
|
179
|
+
step: 1,
|
|
180
|
+
unit: "seconds"
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
type: "number",
|
|
184
|
+
key: "defaultRetentionDays",
|
|
185
|
+
label: "Default Retention",
|
|
186
|
+
description: "Days to keep recordings before auto-delete",
|
|
187
|
+
min: 1,
|
|
188
|
+
max: 365,
|
|
189
|
+
step: 1,
|
|
190
|
+
unit: "days"
|
|
342
191
|
}
|
|
343
192
|
]
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
|
|
193
|
+
}
|
|
194
|
+
]
|
|
195
|
+
};
|
|
196
|
+
var FFMPEG_SCHEMA = {
|
|
197
|
+
sections: [
|
|
198
|
+
{
|
|
199
|
+
id: "ffmpeg-settings",
|
|
200
|
+
title: "FFmpeg",
|
|
201
|
+
description: "FFmpeg binary and hardware acceleration settings",
|
|
202
|
+
columns: 2,
|
|
203
|
+
fields: [
|
|
347
204
|
{
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
},
|
|
363
|
-
{
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
description: "Days to keep recordings before auto-delete",
|
|
368
|
-
min: 1,
|
|
369
|
-
max: 365,
|
|
370
|
-
step: 1,
|
|
371
|
-
unit: "days"
|
|
372
|
-
}
|
|
205
|
+
type: "text",
|
|
206
|
+
key: "binaryPath",
|
|
207
|
+
label: "Binary Path",
|
|
208
|
+
description: "Path to ffmpeg executable",
|
|
209
|
+
placeholder: "ffmpeg",
|
|
210
|
+
span: 2
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
type: "select",
|
|
214
|
+
key: "hwAccel",
|
|
215
|
+
label: "Hardware Acceleration",
|
|
216
|
+
description: "GPU decoding/encoding backend",
|
|
217
|
+
options: [
|
|
218
|
+
{ value: "auto", label: "Auto-detect" },
|
|
219
|
+
{ value: "none", label: "None (CPU only)" },
|
|
220
|
+
{ value: "videotoolbox", label: "VideoToolbox (macOS)" },
|
|
221
|
+
{ value: "vaapi", label: "VA-API (Linux Intel/AMD)" },
|
|
222
|
+
{ value: "qsv", label: "QSV (Intel Quick Sync)" },
|
|
223
|
+
{ value: "cuda", label: "CUDA (NVIDIA)" }
|
|
373
224
|
]
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
type: "number",
|
|
228
|
+
key: "threadCount",
|
|
229
|
+
label: "Thread Count",
|
|
230
|
+
description: "0 = auto (let FFmpeg decide)",
|
|
231
|
+
min: 0,
|
|
232
|
+
max: 16,
|
|
233
|
+
step: 1
|
|
374
234
|
}
|
|
375
235
|
]
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
|
|
236
|
+
}
|
|
237
|
+
]
|
|
238
|
+
};
|
|
239
|
+
var DETECTION_SCHEMA = {
|
|
240
|
+
sections: [
|
|
241
|
+
{
|
|
242
|
+
id: "detection-fps",
|
|
243
|
+
title: "Frame Rates",
|
|
244
|
+
description: "Default analysis frame rates for new cameras",
|
|
245
|
+
columns: 2,
|
|
246
|
+
fields: [
|
|
379
247
|
{
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
options: [
|
|
399
|
-
{ value: "auto", label: "Auto-detect" },
|
|
400
|
-
{ value: "none", label: "None (CPU only)" },
|
|
401
|
-
{ value: "videotoolbox", label: "VideoToolbox (macOS)" },
|
|
402
|
-
{ value: "vaapi", label: "VA-API (Linux Intel/AMD)" },
|
|
403
|
-
{ value: "qsv", label: "QSV (Intel Quick Sync)" },
|
|
404
|
-
{ value: "cuda", label: "CUDA (NVIDIA)" }
|
|
405
|
-
]
|
|
406
|
-
},
|
|
407
|
-
{
|
|
408
|
-
type: "number",
|
|
409
|
-
key: "threadCount",
|
|
410
|
-
label: "Thread Count",
|
|
411
|
-
description: "0 = auto (let FFmpeg decide)",
|
|
412
|
-
min: 0,
|
|
413
|
-
max: 16,
|
|
414
|
-
step: 1
|
|
415
|
-
}
|
|
416
|
-
]
|
|
248
|
+
type: "number",
|
|
249
|
+
key: "defaultMotionFps",
|
|
250
|
+
label: "Motion FPS",
|
|
251
|
+
description: "Frames per second for motion detection",
|
|
252
|
+
min: 1,
|
|
253
|
+
max: 30,
|
|
254
|
+
step: 1,
|
|
255
|
+
unit: "fps"
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
type: "number",
|
|
259
|
+
key: "defaultDetectionFps",
|
|
260
|
+
label: "Detection FPS",
|
|
261
|
+
description: "Frames per second for object detection",
|
|
262
|
+
min: 1,
|
|
263
|
+
max: 30,
|
|
264
|
+
step: 1,
|
|
265
|
+
unit: "fps"
|
|
417
266
|
}
|
|
418
267
|
]
|
|
419
|
-
}
|
|
420
|
-
|
|
421
|
-
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
id: "detection-thresholds",
|
|
271
|
+
title: "Thresholds",
|
|
272
|
+
description: "Default confidence and cooldown for detections",
|
|
273
|
+
columns: 2,
|
|
274
|
+
fields: [
|
|
422
275
|
{
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
label: "Motion FPS",
|
|
432
|
-
description: "Frames per second for motion detection",
|
|
433
|
-
min: 1,
|
|
434
|
-
max: 30,
|
|
435
|
-
step: 1,
|
|
436
|
-
unit: "fps"
|
|
437
|
-
},
|
|
438
|
-
{
|
|
439
|
-
type: "number",
|
|
440
|
-
key: "defaultDetectionFps",
|
|
441
|
-
label: "Detection FPS",
|
|
442
|
-
description: "Frames per second for object detection",
|
|
443
|
-
min: 1,
|
|
444
|
-
max: 30,
|
|
445
|
-
step: 1,
|
|
446
|
-
unit: "fps"
|
|
447
|
-
}
|
|
448
|
-
]
|
|
276
|
+
type: "slider",
|
|
277
|
+
key: "defaultConfidenceThreshold",
|
|
278
|
+
label: "Confidence Threshold",
|
|
279
|
+
description: "Minimum confidence to trigger a detection event",
|
|
280
|
+
min: 0.1,
|
|
281
|
+
max: 1,
|
|
282
|
+
step: 0.05,
|
|
283
|
+
showValue: true
|
|
449
284
|
},
|
|
450
285
|
{
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
286
|
+
type: "number",
|
|
287
|
+
key: "defaultCooldownSeconds",
|
|
288
|
+
label: "Cooldown",
|
|
289
|
+
description: "Seconds between duplicate events",
|
|
290
|
+
min: 0,
|
|
291
|
+
max: 300,
|
|
292
|
+
step: 1,
|
|
293
|
+
unit: "seconds"
|
|
294
|
+
}
|
|
295
|
+
]
|
|
296
|
+
},
|
|
297
|
+
{
|
|
298
|
+
id: "detection-tracker",
|
|
299
|
+
title: "Tracker",
|
|
300
|
+
description: "SORT/IoU tracker parameters",
|
|
301
|
+
columns: 3,
|
|
302
|
+
fields: [
|
|
303
|
+
{
|
|
304
|
+
type: "number",
|
|
305
|
+
key: "trackerMaxAgeFrames",
|
|
306
|
+
label: "Max Age",
|
|
307
|
+
description: "Frames before a lost track is removed",
|
|
308
|
+
min: 1,
|
|
309
|
+
max: 120,
|
|
310
|
+
step: 1,
|
|
311
|
+
unit: "frames"
|
|
477
312
|
},
|
|
478
313
|
{
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
key: "trackerMinHits",
|
|
497
|
-
label: "Min Hits",
|
|
498
|
-
description: "Consecutive detections to confirm a track",
|
|
499
|
-
min: 1,
|
|
500
|
-
max: 20,
|
|
501
|
-
step: 1
|
|
502
|
-
},
|
|
503
|
-
{
|
|
504
|
-
type: "slider",
|
|
505
|
-
key: "trackerIouThreshold",
|
|
506
|
-
label: "IoU Threshold",
|
|
507
|
-
description: "Minimum IoU to associate detection with track",
|
|
508
|
-
min: 0.1,
|
|
509
|
-
max: 0.9,
|
|
510
|
-
step: 0.05,
|
|
511
|
-
showValue: true
|
|
512
|
-
}
|
|
513
|
-
]
|
|
314
|
+
type: "number",
|
|
315
|
+
key: "trackerMinHits",
|
|
316
|
+
label: "Min Hits",
|
|
317
|
+
description: "Consecutive detections to confirm a track",
|
|
318
|
+
min: 1,
|
|
319
|
+
max: 20,
|
|
320
|
+
step: 1
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
type: "slider",
|
|
324
|
+
key: "trackerIouThreshold",
|
|
325
|
+
label: "IoU Threshold",
|
|
326
|
+
description: "Minimum IoU to associate detection with track",
|
|
327
|
+
min: 0.1,
|
|
328
|
+
max: 0.9,
|
|
329
|
+
step: 0.05,
|
|
330
|
+
showValue: true
|
|
514
331
|
}
|
|
515
332
|
]
|
|
516
|
-
}
|
|
517
|
-
|
|
518
|
-
|
|
333
|
+
}
|
|
334
|
+
]
|
|
335
|
+
};
|
|
336
|
+
var AUTH_SCHEMA = {
|
|
337
|
+
sections: [
|
|
338
|
+
{
|
|
339
|
+
id: "auth-settings",
|
|
340
|
+
title: "Authentication",
|
|
341
|
+
description: "Token and session settings",
|
|
342
|
+
columns: 1,
|
|
343
|
+
fields: [
|
|
519
344
|
{
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
{
|
|
526
|
-
type: "text",
|
|
527
|
-
key: "tokenExpiry",
|
|
528
|
-
label: "Token Expiry",
|
|
529
|
-
description: "JWT token lifetime (e.g. 24h, 7d, 1h)",
|
|
530
|
-
placeholder: "24h"
|
|
531
|
-
}
|
|
532
|
-
]
|
|
345
|
+
type: "text",
|
|
346
|
+
key: "tokenExpiry",
|
|
347
|
+
label: "Token Expiry",
|
|
348
|
+
description: "JWT token lifetime (e.g. 24h, 7d, 1h)",
|
|
349
|
+
placeholder: "24h"
|
|
533
350
|
}
|
|
534
351
|
]
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
|
|
352
|
+
}
|
|
353
|
+
]
|
|
354
|
+
};
|
|
355
|
+
var RETENTION_SCHEMA = {
|
|
356
|
+
sections: [
|
|
357
|
+
{
|
|
358
|
+
id: "retention-settings",
|
|
359
|
+
title: "Retention",
|
|
360
|
+
description: "Data retention periods for analytics data",
|
|
361
|
+
columns: 1,
|
|
362
|
+
fields: [
|
|
538
363
|
{
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
label: "Audio Levels Retention",
|
|
558
|
-
min: 1,
|
|
559
|
-
max: 90,
|
|
560
|
-
unit: "days",
|
|
561
|
-
showValue: true,
|
|
562
|
-
span: 1
|
|
563
|
-
}
|
|
564
|
-
]
|
|
364
|
+
type: "slider",
|
|
365
|
+
key: "detectionEventsDays",
|
|
366
|
+
label: "Detection Events Retention",
|
|
367
|
+
min: 1,
|
|
368
|
+
max: 365,
|
|
369
|
+
unit: "days",
|
|
370
|
+
showValue: true,
|
|
371
|
+
span: 1
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
type: "slider",
|
|
375
|
+
key: "audioLevelsDays",
|
|
376
|
+
label: "Audio Levels Retention",
|
|
377
|
+
min: 1,
|
|
378
|
+
max: 90,
|
|
379
|
+
unit: "days",
|
|
380
|
+
showValue: true,
|
|
381
|
+
span: 1
|
|
565
382
|
}
|
|
566
383
|
]
|
|
567
|
-
};
|
|
568
|
-
exports.SYSTEM_SETTINGS_SCHEMAS = {
|
|
569
|
-
server: SERVER_SCHEMA,
|
|
570
|
-
storage: STORAGE_SCHEMA,
|
|
571
|
-
logging: LOGGING_SCHEMA,
|
|
572
|
-
recording: RECORDING_SCHEMA,
|
|
573
|
-
ffmpeg: FFMPEG_SCHEMA,
|
|
574
|
-
detection: DETECTION_SCHEMA,
|
|
575
|
-
auth: AUTH_SCHEMA,
|
|
576
|
-
retention: RETENTION_SCHEMA,
|
|
577
|
-
// These sections have no UI form — managed programmatically or addon-specific
|
|
578
|
-
streaming: { sections: [] },
|
|
579
|
-
backup: { sections: [] },
|
|
580
|
-
features: { sections: [] },
|
|
581
|
-
addons: { sections: [] }
|
|
582
|
-
};
|
|
583
|
-
function getSystemSettingsSchema(section) {
|
|
584
|
-
return exports.SYSTEM_SETTINGS_SCHEMAS[section];
|
|
585
384
|
}
|
|
586
|
-
|
|
587
|
-
}
|
|
385
|
+
]
|
|
386
|
+
};
|
|
387
|
+
var SYSTEM_SETTINGS_SCHEMAS = {
|
|
388
|
+
server: SERVER_SCHEMA,
|
|
389
|
+
storage: STORAGE_SCHEMA,
|
|
390
|
+
logging: LOGGING_SCHEMA,
|
|
391
|
+
recording: RECORDING_SCHEMA,
|
|
392
|
+
ffmpeg: FFMPEG_SCHEMA,
|
|
393
|
+
detection: DETECTION_SCHEMA,
|
|
394
|
+
auth: AUTH_SCHEMA,
|
|
395
|
+
retention: RETENTION_SCHEMA,
|
|
396
|
+
// These sections have no UI form — managed programmatically or addon-specific
|
|
397
|
+
streaming: { sections: [] },
|
|
398
|
+
backup: { sections: [] },
|
|
399
|
+
features: { sections: [] },
|
|
400
|
+
addons: { sections: [] }
|
|
401
|
+
};
|
|
402
|
+
function getSystemSettingsSchema(section) {
|
|
403
|
+
return SYSTEM_SETTINGS_SCHEMAS[section];
|
|
404
|
+
}
|
|
588
405
|
|
|
589
|
-
// src/constants.
|
|
590
|
-
var
|
|
591
|
-
|
|
592
|
-
"use strict";
|
|
593
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
594
|
-
exports.HF_BASE_URL = exports.HF_REPO = void 0;
|
|
595
|
-
exports.HF_REPO = "camstack/camstack-models";
|
|
596
|
-
exports.HF_BASE_URL = `https://huggingface.co/${exports.HF_REPO}/resolve/main`;
|
|
597
|
-
}
|
|
598
|
-
});
|
|
406
|
+
// src/constants.ts
|
|
407
|
+
var HF_REPO = "camstack/camstack-models";
|
|
408
|
+
var HF_BASE_URL = `https://huggingface.co/${HF_REPO}/resolve/main`;
|
|
599
409
|
|
|
600
|
-
// src/utils/hf-url.
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
605
|
-
exports.hfModelUrl = hfModelUrl2;
|
|
606
|
-
function hfModelUrl2(repo, path) {
|
|
607
|
-
return `https://huggingface.co/${repo}/resolve/main/${path}`;
|
|
608
|
-
}
|
|
609
|
-
}
|
|
610
|
-
});
|
|
410
|
+
// src/utils/hf-url.ts
|
|
411
|
+
function hfModelUrl(repo, path) {
|
|
412
|
+
return `https://huggingface.co/${repo}/resolve/main/${path}`;
|
|
413
|
+
}
|
|
611
414
|
|
|
612
|
-
// src/utils/cosine-similarity.
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
let normA = 0;
|
|
623
|
-
let normB = 0;
|
|
624
|
-
for (let i = 0; i < a.length; i++) {
|
|
625
|
-
dotProduct += a[i] * b[i];
|
|
626
|
-
normA += a[i] * a[i];
|
|
627
|
-
normB += b[i] * b[i];
|
|
628
|
-
}
|
|
629
|
-
const denom = Math.sqrt(normA) * Math.sqrt(normB);
|
|
630
|
-
return denom === 0 ? 0 : dotProduct / denom;
|
|
631
|
-
}
|
|
415
|
+
// src/utils/cosine-similarity.ts
|
|
416
|
+
function cosineSimilarity(a, b) {
|
|
417
|
+
if (a.length !== b.length) return 0;
|
|
418
|
+
let dotProduct = 0;
|
|
419
|
+
let normA = 0;
|
|
420
|
+
let normB = 0;
|
|
421
|
+
for (let i = 0; i < a.length; i++) {
|
|
422
|
+
dotProduct += a[i] * b[i];
|
|
423
|
+
normA += a[i] * a[i];
|
|
424
|
+
normB += b[i] * b[i];
|
|
632
425
|
}
|
|
633
|
-
|
|
426
|
+
const denom = Math.sqrt(normA) * Math.sqrt(normB);
|
|
427
|
+
return denom === 0 ? 0 : dotProduct / denom;
|
|
428
|
+
}
|
|
634
429
|
|
|
635
|
-
// src/catalogs/coco-classmap.
|
|
636
|
-
var
|
|
637
|
-
"
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
zebra: "animal",
|
|
748
|
-
giraffe: "animal"
|
|
749
|
-
},
|
|
750
|
-
preserveOriginal: true
|
|
751
|
-
};
|
|
752
|
-
}
|
|
753
|
-
});
|
|
754
|
-
|
|
755
|
-
// src/types/device-type.js
|
|
756
|
-
var require_device_type = __commonJS({
|
|
757
|
-
"src/types/device-type.js"(exports) {
|
|
758
|
-
"use strict";
|
|
759
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
760
|
-
exports.DEVICE_TYPE_INFO = exports.DeviceType = void 0;
|
|
761
|
-
var DeviceType2;
|
|
762
|
-
(function(DeviceType3) {
|
|
763
|
-
DeviceType3["Camera"] = "camera";
|
|
764
|
-
})(DeviceType2 || (exports.DeviceType = DeviceType2 = {}));
|
|
765
|
-
exports.DEVICE_TYPE_INFO = {
|
|
766
|
-
[DeviceType2.Camera]: { type: DeviceType2.Camera, label: "Camera", icon: "camera" }
|
|
767
|
-
};
|
|
768
|
-
}
|
|
769
|
-
});
|
|
430
|
+
// src/catalogs/coco-classmap.ts
|
|
431
|
+
var COCO_80_LABELS = [
|
|
432
|
+
{ id: "person", name: "Person" },
|
|
433
|
+
{ id: "bicycle", name: "Bicycle" },
|
|
434
|
+
{ id: "car", name: "Car" },
|
|
435
|
+
{ id: "motorcycle", name: "Motorcycle" },
|
|
436
|
+
{ id: "airplane", name: "Airplane" },
|
|
437
|
+
{ id: "bus", name: "Bus" },
|
|
438
|
+
{ id: "train", name: "Train" },
|
|
439
|
+
{ id: "truck", name: "Truck" },
|
|
440
|
+
{ id: "boat", name: "Boat" },
|
|
441
|
+
{ id: "traffic light", name: "Traffic Light" },
|
|
442
|
+
{ id: "fire hydrant", name: "Fire Hydrant" },
|
|
443
|
+
{ id: "stop sign", name: "Stop Sign" },
|
|
444
|
+
{ id: "parking meter", name: "Parking Meter" },
|
|
445
|
+
{ id: "bench", name: "Bench" },
|
|
446
|
+
{ id: "bird", name: "Bird" },
|
|
447
|
+
{ id: "cat", name: "Cat" },
|
|
448
|
+
{ id: "dog", name: "Dog" },
|
|
449
|
+
{ id: "horse", name: "Horse" },
|
|
450
|
+
{ id: "sheep", name: "Sheep" },
|
|
451
|
+
{ id: "cow", name: "Cow" },
|
|
452
|
+
{ id: "elephant", name: "Elephant" },
|
|
453
|
+
{ id: "bear", name: "Bear" },
|
|
454
|
+
{ id: "zebra", name: "Zebra" },
|
|
455
|
+
{ id: "giraffe", name: "Giraffe" },
|
|
456
|
+
{ id: "backpack", name: "Backpack" },
|
|
457
|
+
{ id: "umbrella", name: "Umbrella" },
|
|
458
|
+
{ id: "handbag", name: "Handbag" },
|
|
459
|
+
{ id: "tie", name: "Tie" },
|
|
460
|
+
{ id: "suitcase", name: "Suitcase" },
|
|
461
|
+
{ id: "frisbee", name: "Frisbee" },
|
|
462
|
+
{ id: "skis", name: "Skis" },
|
|
463
|
+
{ id: "snowboard", name: "Snowboard" },
|
|
464
|
+
{ id: "sports ball", name: "Sports Ball" },
|
|
465
|
+
{ id: "kite", name: "Kite" },
|
|
466
|
+
{ id: "baseball bat", name: "Baseball Bat" },
|
|
467
|
+
{ id: "baseball glove", name: "Baseball Glove" },
|
|
468
|
+
{ id: "skateboard", name: "Skateboard" },
|
|
469
|
+
{ id: "surfboard", name: "Surfboard" },
|
|
470
|
+
{ id: "tennis racket", name: "Tennis Racket" },
|
|
471
|
+
{ id: "bottle", name: "Bottle" },
|
|
472
|
+
{ id: "wine glass", name: "Wine Glass" },
|
|
473
|
+
{ id: "cup", name: "Cup" },
|
|
474
|
+
{ id: "fork", name: "Fork" },
|
|
475
|
+
{ id: "knife", name: "Knife" },
|
|
476
|
+
{ id: "spoon", name: "Spoon" },
|
|
477
|
+
{ id: "bowl", name: "Bowl" },
|
|
478
|
+
{ id: "banana", name: "Banana" },
|
|
479
|
+
{ id: "apple", name: "Apple" },
|
|
480
|
+
{ id: "sandwich", name: "Sandwich" },
|
|
481
|
+
{ id: "orange", name: "Orange" },
|
|
482
|
+
{ id: "broccoli", name: "Broccoli" },
|
|
483
|
+
{ id: "carrot", name: "Carrot" },
|
|
484
|
+
{ id: "hot dog", name: "Hot Dog" },
|
|
485
|
+
{ id: "pizza", name: "Pizza" },
|
|
486
|
+
{ id: "donut", name: "Donut" },
|
|
487
|
+
{ id: "cake", name: "Cake" },
|
|
488
|
+
{ id: "chair", name: "Chair" },
|
|
489
|
+
{ id: "couch", name: "Couch" },
|
|
490
|
+
{ id: "potted plant", name: "Potted Plant" },
|
|
491
|
+
{ id: "bed", name: "Bed" },
|
|
492
|
+
{ id: "dining table", name: "Dining Table" },
|
|
493
|
+
{ id: "toilet", name: "Toilet" },
|
|
494
|
+
{ id: "tv", name: "TV" },
|
|
495
|
+
{ id: "laptop", name: "Laptop" },
|
|
496
|
+
{ id: "mouse", name: "Mouse" },
|
|
497
|
+
{ id: "remote", name: "Remote" },
|
|
498
|
+
{ id: "keyboard", name: "Keyboard" },
|
|
499
|
+
{ id: "cell phone", name: "Cell Phone" },
|
|
500
|
+
{ id: "microwave", name: "Microwave" },
|
|
501
|
+
{ id: "oven", name: "Oven" },
|
|
502
|
+
{ id: "toaster", name: "Toaster" },
|
|
503
|
+
{ id: "sink", name: "Sink" },
|
|
504
|
+
{ id: "refrigerator", name: "Refrigerator" },
|
|
505
|
+
{ id: "book", name: "Book" },
|
|
506
|
+
{ id: "clock", name: "Clock" },
|
|
507
|
+
{ id: "vase", name: "Vase" },
|
|
508
|
+
{ id: "scissors", name: "Scissors" },
|
|
509
|
+
{ id: "teddy bear", name: "Teddy Bear" },
|
|
510
|
+
{ id: "hair drier", name: "Hair Drier" },
|
|
511
|
+
{ id: "toothbrush", name: "Toothbrush" }
|
|
512
|
+
];
|
|
513
|
+
var MACRO_LABELS = [
|
|
514
|
+
{ id: "person", name: "Person" },
|
|
515
|
+
{ id: "vehicle", name: "Vehicle" },
|
|
516
|
+
{ id: "animal", name: "Animal" }
|
|
517
|
+
];
|
|
518
|
+
var COCO_TO_MACRO = {
|
|
519
|
+
mapping: {
|
|
520
|
+
person: "person",
|
|
521
|
+
bicycle: "vehicle",
|
|
522
|
+
car: "vehicle",
|
|
523
|
+
motorcycle: "vehicle",
|
|
524
|
+
airplane: "vehicle",
|
|
525
|
+
bus: "vehicle",
|
|
526
|
+
train: "vehicle",
|
|
527
|
+
truck: "vehicle",
|
|
528
|
+
boat: "vehicle",
|
|
529
|
+
bird: "animal",
|
|
530
|
+
cat: "animal",
|
|
531
|
+
dog: "animal",
|
|
532
|
+
horse: "animal",
|
|
533
|
+
sheep: "animal",
|
|
534
|
+
cow: "animal",
|
|
535
|
+
elephant: "animal",
|
|
536
|
+
bear: "animal",
|
|
537
|
+
zebra: "animal",
|
|
538
|
+
giraffe: "animal"
|
|
539
|
+
},
|
|
540
|
+
preserveOriginal: true
|
|
541
|
+
};
|
|
770
542
|
|
|
771
|
-
// src/
|
|
772
|
-
var
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
cosineSimilarity: () => import_cosine_similarity.cosineSimilarity,
|
|
780
|
-
hfModelUrl: () => import_hf_url.hfModelUrl,
|
|
781
|
-
resolveTranslation: () => import_addon_i18n.resolveTranslation
|
|
782
|
-
});
|
|
783
|
-
__reExport(src_exports, __toESM(require_io()));
|
|
784
|
-
__reExport(src_exports, __toESM(require_labels()));
|
|
785
|
-
__reExport(src_exports, __toESM(require_detection()));
|
|
786
|
-
__reExport(src_exports, __toESM(require_tracked()));
|
|
787
|
-
__reExport(src_exports, __toESM(require_events()));
|
|
788
|
-
__reExport(src_exports, __toESM(require_config()));
|
|
789
|
-
__reExport(src_exports, __toESM(require_entities()));
|
|
790
|
-
__reExport(src_exports, __toESM(require_zones()));
|
|
791
|
-
__reExport(src_exports, __toESM(require_models()));
|
|
792
|
-
__reExport(src_exports, __toESM(require_pipeline()));
|
|
793
|
-
__reExport(src_exports, __toESM(require_live_state()));
|
|
794
|
-
__reExport(src_exports, __toESM(require_analytics()));
|
|
795
|
-
__reExport(src_exports, __toESM(require_storage_backend()));
|
|
796
|
-
var import_addon_i18n = __toESM(require_addon_i18n());
|
|
797
|
-
__reExport(src_exports, __toESM(require_feature_flags()));
|
|
798
|
-
__reExport(src_exports, __toESM(require_agent_protocol()));
|
|
799
|
-
__reExport(src_exports, __toESM(require_server_analysis()));
|
|
800
|
-
__reExport(src_exports, __toESM(require_analysis_persistence()));
|
|
801
|
-
__reExport(src_exports, __toESM(require_system_settings_schemas()));
|
|
802
|
-
__reExport(src_exports, __toESM(require_constants()));
|
|
803
|
-
var import_hf_url = __toESM(require_hf_url());
|
|
804
|
-
var import_cosine_similarity = __toESM(require_cosine_similarity());
|
|
805
|
-
var import_coco_classmap = __toESM(require_coco_classmap());
|
|
806
|
-
var import_device_type = __toESM(require_device_type());
|
|
807
|
-
var export_COCO_80_LABELS = import_coco_classmap.COCO_80_LABELS;
|
|
808
|
-
var export_COCO_TO_MACRO = import_coco_classmap.COCO_TO_MACRO;
|
|
809
|
-
var export_DEVICE_TYPE_INFO = import_device_type.DEVICE_TYPE_INFO;
|
|
810
|
-
var export_DeviceType = import_device_type.DeviceType;
|
|
811
|
-
var export_MACRO_LABELS = import_coco_classmap.MACRO_LABELS;
|
|
812
|
-
var export_cosineSimilarity = import_cosine_similarity.cosineSimilarity;
|
|
813
|
-
var export_hfModelUrl = import_hf_url.hfModelUrl;
|
|
814
|
-
var export_resolveTranslation = import_addon_i18n.resolveTranslation;
|
|
543
|
+
// src/types/device-type.ts
|
|
544
|
+
var DeviceType = /* @__PURE__ */ ((DeviceType2) => {
|
|
545
|
+
DeviceType2["Camera"] = "camera";
|
|
546
|
+
return DeviceType2;
|
|
547
|
+
})(DeviceType || {});
|
|
548
|
+
var DEVICE_TYPE_INFO = {
|
|
549
|
+
["camera" /* Camera */]: { type: "camera" /* Camera */, label: "Camera", icon: "camera" }
|
|
550
|
+
};
|
|
815
551
|
export {
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
552
|
+
BINARY_FRAME_HEADER_SIZE,
|
|
553
|
+
BINARY_FRAME_TYPE,
|
|
554
|
+
COCO_80_LABELS,
|
|
555
|
+
COCO_TO_MACRO,
|
|
556
|
+
DEFAULT_FEATURES,
|
|
557
|
+
DEFAULT_LOCATION_SUBPATHS,
|
|
558
|
+
DEFAULT_RETENTION,
|
|
559
|
+
DETECTION_TYPES,
|
|
560
|
+
DEVICE_TYPE_INFO,
|
|
561
|
+
DeviceType,
|
|
562
|
+
HF_BASE_URL,
|
|
563
|
+
HF_REPO,
|
|
564
|
+
MACRO_LABELS,
|
|
565
|
+
READ_ONLY_SECTIONS,
|
|
566
|
+
RECOGNITION_TYPES,
|
|
567
|
+
SETTINGS_TABS,
|
|
568
|
+
SUB_DETECTION_TYPES,
|
|
569
|
+
SYSTEM_SETTINGS_SCHEMAS,
|
|
570
|
+
cosineSimilarity,
|
|
571
|
+
createAnalysisContext,
|
|
572
|
+
enrichContext,
|
|
573
|
+
getSystemSettingsSchema,
|
|
574
|
+
hfModelUrl,
|
|
575
|
+
resolveTranslation
|
|
824
576
|
};
|
|
825
577
|
//# sourceMappingURL=index.mjs.map
|