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