@elizaos/plugin-vision 1.2.1 → 2.0.0-alpha.1

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 (105) hide show
  1. package/build.config.ts +53 -53
  2. package/dist/index.js +6716 -67
  3. package/dist/index.js.map +33 -1
  4. package/dist/workers/florence2-worker.js +112304 -307
  5. package/dist/workers/florence2-worker.js.map +92 -1
  6. package/dist/workers/ocr-worker.js +119718 -339
  7. package/dist/workers/ocr-worker.js.map +137 -1
  8. package/dist/workers/screen-capture-worker.js +350 -418
  9. package/dist/workers/screen-capture-worker.js.map +11 -1
  10. package/package.json +13 -17
  11. package/README.md +0 -270
  12. package/dist/action.d.ts +0 -8
  13. package/dist/action.js +0 -1212
  14. package/dist/action.js.map +0 -1
  15. package/dist/audio-capture-stream.d.ts +0 -42
  16. package/dist/audio-capture-stream.js +0 -516
  17. package/dist/audio-capture-stream.js.map +0 -1
  18. package/dist/audio-capture.d.ts +0 -25
  19. package/dist/audio-capture.js +0 -412
  20. package/dist/audio-capture.js.map +0 -1
  21. package/dist/basic.test.d.ts +0 -1
  22. package/dist/basic.test.js +0 -97
  23. package/dist/basic.test.js.map +0 -1
  24. package/dist/config.d.ts +0 -73
  25. package/dist/config.js +0 -254
  26. package/dist/config.js.map +0 -1
  27. package/dist/entity-tracker.d.ts +0 -32
  28. package/dist/entity-tracker.js +0 -361
  29. package/dist/entity-tracker.js.map +0 -1
  30. package/dist/errors.d.ts +0 -67
  31. package/dist/errors.js +0 -395
  32. package/dist/errors.js.map +0 -1
  33. package/dist/face-recognition.d.ts +0 -31
  34. package/dist/face-recognition.js +0 -332
  35. package/dist/face-recognition.js.map +0 -1
  36. package/dist/florence2-local.d.ts +0 -25
  37. package/dist/florence2-local.js +0 -280
  38. package/dist/florence2-local.js.map +0 -1
  39. package/dist/florence2-model.d.ts +0 -36
  40. package/dist/florence2-model.js +0 -503
  41. package/dist/florence2-model.js.map +0 -1
  42. package/dist/index.d.ts +0 -3
  43. package/dist/ocr-service-real.d.ts +0 -32
  44. package/dist/ocr-service-real.js +0 -396
  45. package/dist/ocr-service-real.js.map +0 -1
  46. package/dist/ocr-service.d.ts +0 -28
  47. package/dist/ocr-service.js +0 -216
  48. package/dist/ocr-service.js.map +0 -1
  49. package/dist/provider.d.ts +0 -2
  50. package/dist/provider.js +0 -285
  51. package/dist/provider.js.map +0 -1
  52. package/dist/screen-capture.d.ts +0 -16
  53. package/dist/screen-capture.js +0 -302
  54. package/dist/screen-capture.js.map +0 -1
  55. package/dist/service.d.ts +0 -73
  56. package/dist/service.js +0 -1662
  57. package/dist/service.js.map +0 -1
  58. package/dist/tests/e2e/index.d.ts +0 -8
  59. package/dist/tests/e2e/index.js +0 -33
  60. package/dist/tests/e2e/index.js.map +0 -1
  61. package/dist/tests/e2e/run-local.d.ts +0 -2
  62. package/dist/tests/e2e/run-local.js +0 -166
  63. package/dist/tests/e2e/run-local.js.map +0 -1
  64. package/dist/tests/e2e/screen-vision.d.ts +0 -11
  65. package/dist/tests/e2e/screen-vision.js +0 -384
  66. package/dist/tests/e2e/screen-vision.js.map +0 -1
  67. package/dist/tests/e2e/vision-autonomy.d.ts +0 -11
  68. package/dist/tests/e2e/vision-autonomy.js +0 -375
  69. package/dist/tests/e2e/vision-autonomy.js.map +0 -1
  70. package/dist/tests/e2e/vision-basic.d.ts +0 -11
  71. package/dist/tests/e2e/vision-basic.js +0 -434
  72. package/dist/tests/e2e/vision-basic.js.map +0 -1
  73. package/dist/tests/e2e/vision-capture-log.d.ts +0 -11
  74. package/dist/tests/e2e/vision-capture-log.js +0 -302
  75. package/dist/tests/e2e/vision-capture-log.js.map +0 -1
  76. package/dist/tests/e2e/vision-runtime.d.ts +0 -11
  77. package/dist/tests/e2e/vision-runtime.js +0 -357
  78. package/dist/tests/e2e/vision-runtime.js.map +0 -1
  79. package/dist/tests/e2e/vision-worker-tests.d.ts +0 -11
  80. package/dist/tests/e2e/vision-worker-tests.js +0 -466
  81. package/dist/tests/e2e/vision-worker-tests.js.map +0 -1
  82. package/dist/tests/test-pattern-generator.d.ts +0 -40
  83. package/dist/tests/test-pattern-generator.js +0 -191
  84. package/dist/tests/test-pattern-generator.js.map +0 -1
  85. package/dist/tests.d.ts +0 -3
  86. package/dist/tests.js +0 -11
  87. package/dist/tests.js.map +0 -1
  88. package/dist/types.d.ts +0 -222
  89. package/dist/types.js +0 -16
  90. package/dist/types.js.map +0 -1
  91. package/dist/vision-models.d.ts +0 -47
  92. package/dist/vision-models.js +0 -501
  93. package/dist/vision-models.js.map +0 -1
  94. package/dist/vision-worker-manager.d.ts +0 -61
  95. package/dist/vision-worker-manager.js +0 -668
  96. package/dist/vision-worker-manager.js.map +0 -1
  97. package/dist/workers/florence2-worker-simple.d.ts +0 -13
  98. package/dist/workers/florence2-worker-simple.js +0 -121
  99. package/dist/workers/florence2-worker-simple.js.map +0 -1
  100. package/dist/workers/florence2-worker.d.ts +0 -1
  101. package/dist/workers/ocr-worker.d.ts +0 -1
  102. package/dist/workers/screen-capture-worker.d.ts +0 -1
  103. package/dist/workers/worker-logger.d.ts +0 -9
  104. package/dist/workers/worker-logger.js +0 -95
  105. package/dist/workers/worker-logger.js.map +0 -1
package/dist/config.js DELETED
@@ -1,254 +0,0 @@
1
- "use strict";
2
- var __assign = (this && this.__assign) || function () {
3
- __assign = Object.assign || function(t) {
4
- for (var s, i = 1, n = arguments.length; i < n; i++) {
5
- s = arguments[i];
6
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
- t[p] = s[p];
8
- }
9
- return t;
10
- };
11
- return __assign.apply(this, arguments);
12
- };
13
- Object.defineProperty(exports, "__esModule", { value: true });
14
- exports.ConfigurationManager = exports.VisionConfigSchema = exports.defaultVisionConfig = void 0;
15
- var zod_1 = require("zod");
16
- var core_1 = require("@elizaos/core");
17
- // Default configuration for backward compatibility
18
- exports.defaultVisionConfig = {
19
- pixelChangeThreshold: 50,
20
- updateInterval: 100,
21
- enablePoseDetection: false,
22
- enableObjectDetection: false,
23
- tfUpdateInterval: 1000,
24
- vlmUpdateInterval: 10000,
25
- tfChangeThreshold: 10,
26
- vlmChangeThreshold: 50,
27
- visionMode: 'CAMERA',
28
- screenCaptureInterval: 2000,
29
- tileSize: 256,
30
- tileProcessingOrder: 'priority',
31
- ocrEnabled: true,
32
- florence2Enabled: true,
33
- };
34
- // Configuration schema using Zod for validation
35
- exports.VisionConfigSchema = zod_1.z.object({
36
- // Camera configuration
37
- cameraName: zod_1.z.string().optional(),
38
- enableCamera: zod_1.z.boolean().default(true),
39
- // Vision processing
40
- pixelChangeThreshold: zod_1.z.number().min(0).max(100).default(50),
41
- updateInterval: zod_1.z.number().min(10).max(10000).default(100),
42
- // Object detection
43
- enableObjectDetection: zod_1.z.boolean().default(false),
44
- objectConfidenceThreshold: zod_1.z.number().min(0).max(1).default(0.5),
45
- // Pose detection
46
- enablePoseDetection: zod_1.z.boolean().default(false),
47
- poseConfidenceThreshold: zod_1.z.number().min(0).max(1).default(0.5),
48
- // Update intervals
49
- tfUpdateInterval: zod_1.z.number().min(100).max(60000).default(1000),
50
- vlmUpdateInterval: zod_1.z.number().min(1000).max(300000).default(10000),
51
- tfChangeThreshold: zod_1.z.number().min(0).max(100).default(10),
52
- vlmChangeThreshold: zod_1.z.number().min(0).max(100).default(50),
53
- // Vision mode
54
- visionMode: zod_1.z.enum(['OFF', 'CAMERA', 'SCREEN', 'BOTH']).default('CAMERA'),
55
- // Screen capture
56
- screenCaptureInterval: zod_1.z.number().min(100).max(60000).default(2000),
57
- tileSize: zod_1.z.number().min(64).max(1024).default(256),
58
- tileProcessingOrder: zod_1.z.enum(['sequential', 'priority', 'random']).default('priority'),
59
- maxConcurrentTiles: zod_1.z.number().min(1).max(10).default(3),
60
- // OCR configuration
61
- ocrEnabled: zod_1.z.boolean().default(true),
62
- ocrLanguage: zod_1.z.string().default('eng'),
63
- ocrConfidenceThreshold: zod_1.z.number().min(0).max(100).default(60),
64
- // Florence-2 configuration
65
- florence2Enabled: zod_1.z.boolean().default(true),
66
- florence2Provider: zod_1.z.enum(['local', 'azure', 'huggingface', 'replicate']).optional(),
67
- florence2Endpoint: zod_1.z.string().url().optional(),
68
- florence2ApiKey: zod_1.z.string().optional(),
69
- florence2Timeout: zod_1.z.number().min(1000).max(300000).default(30000),
70
- // Face recognition
71
- enableFaceRecognition: zod_1.z.boolean().default(false),
72
- faceMatchThreshold: zod_1.z.number().min(0).max(1).default(0.6),
73
- maxFaceProfiles: zod_1.z.number().min(10).max(10000).default(1000),
74
- // Entity tracking
75
- entityTimeout: zod_1.z.number().min(1000).max(300000).default(30000),
76
- maxTrackedEntities: zod_1.z.number().min(10).max(1000).default(100),
77
- // Performance
78
- enableGPUAcceleration: zod_1.z.boolean().default(true),
79
- maxMemoryUsageMB: zod_1.z.number().min(100).max(8000).default(2000),
80
- // Logging
81
- debugMode: zod_1.z.boolean().default(false),
82
- logLevel: zod_1.z.enum(['error', 'warn', 'info', 'debug']).default('info'),
83
- });
84
- var ConfigurationManager = /** @class */ (function () {
85
- function ConfigurationManager(runtime) {
86
- this.runtime = runtime;
87
- this.config = this.loadConfiguration();
88
- }
89
- ConfigurationManager.prototype.loadConfiguration = function () {
90
- // Load from environment variables and runtime settings
91
- var rawConfig = {
92
- // Camera
93
- cameraName: this.getSetting('CAMERA_NAME') || this.getSetting('VISION_CAMERA_NAME'),
94
- enableCamera: this.getBooleanSetting('ENABLE_CAMERA', true),
95
- // Vision processing
96
- pixelChangeThreshold: this.getNumberSetting('PIXEL_CHANGE_THRESHOLD', 50),
97
- updateInterval: this.getNumberSetting('UPDATE_INTERVAL', 100),
98
- // Object detection
99
- enableObjectDetection: this.getBooleanSetting('ENABLE_OBJECT_DETECTION', false),
100
- objectConfidenceThreshold: this.getNumberSetting('OBJECT_CONFIDENCE_THRESHOLD', 0.5),
101
- // Pose detection
102
- enablePoseDetection: this.getBooleanSetting('ENABLE_POSE_DETECTION', false),
103
- poseConfidenceThreshold: this.getNumberSetting('POSE_CONFIDENCE_THRESHOLD', 0.5),
104
- // Update intervals
105
- tfUpdateInterval: this.getNumberSetting('TF_UPDATE_INTERVAL', 1000),
106
- vlmUpdateInterval: this.getNumberSetting('VLM_UPDATE_INTERVAL', 10000),
107
- tfChangeThreshold: this.getNumberSetting('TF_CHANGE_THRESHOLD', 10),
108
- vlmChangeThreshold: this.getNumberSetting('VLM_CHANGE_THRESHOLD', 50),
109
- // Vision mode
110
- visionMode: this.getSetting('VISION_MODE'),
111
- // Screen capture
112
- screenCaptureInterval: this.getNumberSetting('SCREEN_CAPTURE_INTERVAL', 2000),
113
- tileSize: this.getNumberSetting('TILE_SIZE', 256),
114
- tileProcessingOrder: this.getSetting('TILE_PROCESSING_ORDER'),
115
- maxConcurrentTiles: this.getNumberSetting('MAX_CONCURRENT_TILES', 3),
116
- // OCR
117
- ocrEnabled: this.getBooleanSetting('OCR_ENABLED', true),
118
- ocrLanguage: this.getSetting('OCR_LANGUAGE') || 'eng',
119
- ocrConfidenceThreshold: this.getNumberSetting('OCR_CONFIDENCE_THRESHOLD', 60),
120
- // Florence-2
121
- florence2Enabled: this.getBooleanSetting('FLORENCE2_ENABLED', true),
122
- florence2Provider: this.getSetting('FLORENCE2_PROVIDER'),
123
- florence2Endpoint: this.getSetting('FLORENCE2_ENDPOINT'),
124
- florence2ApiKey: this.getSetting('FLORENCE2_API_KEY'),
125
- florence2Timeout: this.getNumberSetting('FLORENCE2_TIMEOUT', 30000),
126
- // Face recognition
127
- enableFaceRecognition: this.getBooleanSetting('ENABLE_FACE_RECOGNITION', false),
128
- faceMatchThreshold: this.getNumberSetting('FACE_MATCH_THRESHOLD', 0.6),
129
- maxFaceProfiles: this.getNumberSetting('MAX_FACE_PROFILES', 1000),
130
- // Entity tracking
131
- entityTimeout: this.getNumberSetting('ENTITY_TIMEOUT', 30000),
132
- maxTrackedEntities: this.getNumberSetting('MAX_TRACKED_ENTITIES', 100),
133
- // Performance
134
- enableGPUAcceleration: this.getBooleanSetting('ENABLE_GPU_ACCELERATION', true),
135
- maxMemoryUsageMB: this.getNumberSetting('MAX_MEMORY_USAGE_MB', 2000),
136
- // Logging
137
- debugMode: this.getBooleanSetting('DEBUG_MODE', false),
138
- logLevel: this.getSetting('LOG_LEVEL') || 'info',
139
- };
140
- // Validate and parse configuration
141
- try {
142
- var parsed = exports.VisionConfigSchema.parse(rawConfig);
143
- core_1.logger.info('[ConfigurationManager] Configuration loaded successfully');
144
- if (parsed.debugMode) {
145
- core_1.logger.debug('[ConfigurationManager] Configuration:', parsed);
146
- }
147
- return parsed;
148
- }
149
- catch (error) {
150
- core_1.logger.error('[ConfigurationManager] Invalid configuration:', error);
151
- if (error instanceof zod_1.z.ZodError) {
152
- core_1.logger.error('[ConfigurationManager] Validation errors:', error.errors);
153
- }
154
- // Return default configuration on error
155
- return exports.VisionConfigSchema.parse({});
156
- }
157
- };
158
- ConfigurationManager.prototype.getSetting = function (key) {
159
- // Try with VISION_ prefix first
160
- var visionKey = "VISION_".concat(key);
161
- var value = this.runtime.getSetting(visionKey) || this.runtime.getSetting(key);
162
- return value || undefined;
163
- };
164
- ConfigurationManager.prototype.getBooleanSetting = function (key, defaultValue) {
165
- var value = this.getSetting(key);
166
- if (value === undefined) {
167
- return defaultValue;
168
- }
169
- return value.toLowerCase() === 'true';
170
- };
171
- ConfigurationManager.prototype.getNumberSetting = function (key, defaultValue) {
172
- var value = this.getSetting(key);
173
- if (value === undefined) {
174
- return defaultValue;
175
- }
176
- var parsed = Number(value);
177
- return isNaN(parsed) ? defaultValue : parsed;
178
- };
179
- // Public API
180
- ConfigurationManager.prototype.get = function () {
181
- return __assign({}, this.config);
182
- };
183
- ConfigurationManager.prototype.update = function (updates) {
184
- try {
185
- var newConfig = __assign(__assign({}, this.config), updates);
186
- var parsed = exports.VisionConfigSchema.parse(newConfig);
187
- this.config = parsed;
188
- core_1.logger.info('[ConfigurationManager] Configuration updated');
189
- }
190
- catch (error) {
191
- core_1.logger.error('[ConfigurationManager] Failed to update configuration:', error);
192
- throw error;
193
- }
194
- };
195
- // Convert to legacy VisionConfig format for backward compatibility
196
- ConfigurationManager.prototype.toLegacyFormat = function () {
197
- return {
198
- cameraName: this.config.cameraName,
199
- pixelChangeThreshold: this.config.pixelChangeThreshold,
200
- updateInterval: this.config.updateInterval,
201
- enableObjectDetection: this.config.enableObjectDetection,
202
- enablePoseDetection: this.config.enablePoseDetection,
203
- tfUpdateInterval: this.config.tfUpdateInterval,
204
- vlmUpdateInterval: this.config.vlmUpdateInterval,
205
- tfChangeThreshold: this.config.tfChangeThreshold,
206
- vlmChangeThreshold: this.config.vlmChangeThreshold,
207
- visionMode: this.config.visionMode,
208
- screenCaptureInterval: this.config.screenCaptureInterval,
209
- tileSize: this.config.tileSize,
210
- tileProcessingOrder: this.config.tileProcessingOrder,
211
- ocrEnabled: this.config.ocrEnabled,
212
- florence2Enabled: this.config.florence2Enabled,
213
- };
214
- };
215
- // Configuration presets
216
- ConfigurationManager.getPreset = function (name) {
217
- var presets = {
218
- 'high-performance': {
219
- updateInterval: 50,
220
- tfUpdateInterval: 500,
221
- vlmUpdateInterval: 5000,
222
- enableGPUAcceleration: true,
223
- maxConcurrentTiles: 5,
224
- },
225
- 'low-resource': {
226
- updateInterval: 200,
227
- tfUpdateInterval: 2000,
228
- vlmUpdateInterval: 20000,
229
- enableObjectDetection: false,
230
- enablePoseDetection: false,
231
- maxMemoryUsageMB: 500,
232
- maxConcurrentTiles: 1,
233
- },
234
- 'security-monitoring': {
235
- enableObjectDetection: true,
236
- enablePoseDetection: true,
237
- enableFaceRecognition: true,
238
- updateInterval: 100,
239
- entityTimeout: 60000,
240
- },
241
- 'screen-reader': {
242
- visionMode: 'SCREEN',
243
- ocrEnabled: true,
244
- florence2Enabled: true,
245
- screenCaptureInterval: 1000,
246
- tileProcessingOrder: 'priority',
247
- },
248
- };
249
- return presets[name] || {};
250
- };
251
- return ConfigurationManager;
252
- }());
253
- exports.ConfigurationManager = ConfigurationManager;
254
- //# sourceMappingURL=config.js.map
@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C;QAEF,OAAO,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC;IAC7B,CAAC;IACH,2BAAC;AAAD,CAAC,AAjMD,IAiMC;AAjMY,oDAAoB","sourcesContent":["import { z } from 'zod';\nimport { logger } from '@elizaos/core';\nimport type { VisionConfig, VisionMode } from './types';\n\n// Default configuration for backward compatibility\nexport const defaultVisionConfig: VisionConfig = {\n pixelChangeThreshold: 50,\n updateInterval: 100,\n enablePoseDetection: false,\n enableObjectDetection: false,\n tfUpdateInterval: 1000,\n vlmUpdateInterval: 10000,\n tfChangeThreshold: 10,\n vlmChangeThreshold: 50,\n visionMode: 'CAMERA' as VisionMode,\n screenCaptureInterval: 2000,\n tileSize: 256,\n tileProcessingOrder: 'priority',\n ocrEnabled: true,\n florence2Enabled: true,\n};\n\n// Configuration schema using Zod for validation\nexport const VisionConfigSchema = z.object({\n // Camera configuration\n cameraName: z.string().optional(),\n enableCamera: z.boolean().default(true),\n\n // Vision processing\n pixelChangeThreshold: z.number().min(0).max(100).default(50),\n updateInterval: z.number().min(10).max(10000).default(100),\n\n // Object detection\n enableObjectDetection: z.boolean().default(false),\n objectConfidenceThreshold: z.number().min(0).max(1).default(0.5),\n\n // Pose detection\n enablePoseDetection: z.boolean().default(false),\n poseConfidenceThreshold: z.number().min(0).max(1).default(0.5),\n\n // Update intervals\n tfUpdateInterval: z.number().min(100).max(60000).default(1000),\n vlmUpdateInterval: z.number().min(1000).max(300000).default(10000),\n tfChangeThreshold: z.number().min(0).max(100).default(10),\n vlmChangeThreshold: z.number().min(0).max(100).default(50),\n\n // Vision mode\n visionMode: z.enum(['OFF', 'CAMERA', 'SCREEN', 'BOTH']).default('CAMERA'),\n\n // Screen capture\n screenCaptureInterval: z.number().min(100).max(60000).default(2000),\n tileSize: z.number().min(64).max(1024).default(256),\n tileProcessingOrder: z.enum(['sequential', 'priority', 'random']).default('priority'),\n maxConcurrentTiles: z.number().min(1).max(10).default(3),\n\n // OCR configuration\n ocrEnabled: z.boolean().default(true),\n ocrLanguage: z.string().default('eng'),\n ocrConfidenceThreshold: z.number().min(0).max(100).default(60),\n\n // Florence-2 configuration\n florence2Enabled: z.boolean().default(true),\n florence2Provider: z.enum(['local', 'azure', 'huggingface', 'replicate']).optional(),\n florence2Endpoint: z.string().url().optional(),\n florence2ApiKey: z.string().optional(),\n florence2Timeout: z.number().min(1000).max(300000).default(30000),\n\n // Face recognition\n enableFaceRecognition: z.boolean().default(false),\n faceMatchThreshold: z.number().min(0).max(1).default(0.6),\n maxFaceProfiles: z.number().min(10).max(10000).default(1000),\n\n // Entity tracking\n entityTimeout: z.number().min(1000).max(300000).default(30000),\n maxTrackedEntities: z.number().min(10).max(1000).default(100),\n\n // Performance\n enableGPUAcceleration: z.boolean().default(true),\n maxMemoryUsageMB: z.number().min(100).max(8000).default(2000),\n\n // Logging\n debugMode: z.boolean().default(false),\n logLevel: z.enum(['error', 'warn', 'info', 'debug']).default('info'),\n});\n\nexport type VisionConfigInput = z.input<typeof VisionConfigSchema>;\nexport type VisionConfigOutput = z.output<typeof VisionConfigSchema>;\n\nexport class ConfigurationManager {\n private config: VisionConfigOutput;\n private runtime: any;\n\n constructor(runtime: any) {\n this.runtime = runtime;\n this.config = this.loadConfiguration();\n }\n\n private loadConfiguration(): VisionConfigOutput {\n // Load from environment variables and runtime settings\n const rawConfig: Partial<VisionConfigInput> = {\n // Camera\n cameraName: this.getSetting('CAMERA_NAME') || this.getSetting('VISION_CAMERA_NAME'),\n enableCamera: this.getBooleanSetting('ENABLE_CAMERA', true),\n\n // Vision processing\n pixelChangeThreshold: this.getNumberSetting('PIXEL_CHANGE_THRESHOLD', 50),\n updateInterval: this.getNumberSetting('UPDATE_INTERVAL', 100),\n\n // Object detection\n enableObjectDetection: this.getBooleanSetting('ENABLE_OBJECT_DETECTION', false),\n objectConfidenceThreshold: this.getNumberSetting('OBJECT_CONFIDENCE_THRESHOLD', 0.5),\n\n // Pose detection\n enablePoseDetection: this.getBooleanSetting('ENABLE_POSE_DETECTION', false),\n poseConfidenceThreshold: this.getNumberSetting('POSE_CONFIDENCE_THRESHOLD', 0.5),\n\n // Update intervals\n tfUpdateInterval: this.getNumberSetting('TF_UPDATE_INTERVAL', 1000),\n vlmUpdateInterval: this.getNumberSetting('VLM_UPDATE_INTERVAL', 10000),\n tfChangeThreshold: this.getNumberSetting('TF_CHANGE_THRESHOLD', 10),\n vlmChangeThreshold: this.getNumberSetting('VLM_CHANGE_THRESHOLD', 50),\n\n // Vision mode\n visionMode: this.getSetting('VISION_MODE') as VisionMode,\n\n // Screen capture\n screenCaptureInterval: this.getNumberSetting('SCREEN_CAPTURE_INTERVAL', 2000),\n tileSize: this.getNumberSetting('TILE_SIZE', 256),\n tileProcessingOrder: this.getSetting('TILE_PROCESSING_ORDER') as any,\n maxConcurrentTiles: this.getNumberSetting('MAX_CONCURRENT_TILES', 3),\n\n // OCR\n ocrEnabled: this.getBooleanSetting('OCR_ENABLED', true),\n ocrLanguage: this.getSetting('OCR_LANGUAGE') || 'eng',\n ocrConfidenceThreshold: this.getNumberSetting('OCR_CONFIDENCE_THRESHOLD', 60),\n\n // Florence-2\n florence2Enabled: this.getBooleanSetting('FLORENCE2_ENABLED', true),\n florence2Provider: this.getSetting('FLORENCE2_PROVIDER') as any,\n florence2Endpoint: this.getSetting('FLORENCE2_ENDPOINT'),\n florence2ApiKey: this.getSetting('FLORENCE2_API_KEY'),\n florence2Timeout: this.getNumberSetting('FLORENCE2_TIMEOUT', 30000),\n\n // Face recognition\n enableFaceRecognition: this.getBooleanSetting('ENABLE_FACE_RECOGNITION', false),\n faceMatchThreshold: this.getNumberSetting('FACE_MATCH_THRESHOLD', 0.6),\n maxFaceProfiles: this.getNumberSetting('MAX_FACE_PROFILES', 1000),\n\n // Entity tracking\n entityTimeout: this.getNumberSetting('ENTITY_TIMEOUT', 30000),\n maxTrackedEntities: this.getNumberSetting('MAX_TRACKED_ENTITIES', 100),\n\n // Performance\n enableGPUAcceleration: this.getBooleanSetting('ENABLE_GPU_ACCELERATION', true),\n maxMemoryUsageMB: this.getNumberSetting('MAX_MEMORY_USAGE_MB', 2000),\n\n // Logging\n debugMode: this.getBooleanSetting('DEBUG_MODE', false),\n logLevel: (this.getSetting('LOG_LEVEL') as any) || 'info',\n };\n\n // Validate and parse configuration\n try {\n const parsed = VisionConfigSchema.parse(rawConfig);\n logger.info('[ConfigurationManager] Configuration loaded successfully');\n\n if (parsed.debugMode) {\n logger.debug('[ConfigurationManager] Configuration:', parsed);\n }\n\n return parsed;\n } catch (error) {\n logger.error('[ConfigurationManager] Invalid configuration:', error);\n if (error instanceof z.ZodError) {\n logger.error('[ConfigurationManager] Validation errors:', error.errors);\n }\n\n // Return default configuration on error\n return VisionConfigSchema.parse({});\n }\n }\n\n private getSetting(key: string): string | undefined {\n // Try with VISION_ prefix first\n const visionKey = `VISION_${key}`;\n const value = this.runtime.getSetting(visionKey) || this.runtime.getSetting(key);\n return value || undefined;\n }\n\n private getBooleanSetting(key: string, defaultValue: boolean): boolean {\n const value = this.getSetting(key);\n if (value === undefined) {\n return defaultValue;\n }\n return value.toLowerCase() === 'true';\n }\n\n private getNumberSetting(key: string, defaultValue: number): number {\n const value = this.getSetting(key);\n if (value === undefined) {\n return defaultValue;\n }\n const parsed = Number(value);\n return isNaN(parsed) ? defaultValue : parsed;\n }\n\n // Public API\n get(): VisionConfigOutput {\n return { ...this.config };\n }\n\n update(updates: Partial<VisionConfigInput>): void {\n try {\n const newConfig = { ...this.config, ...updates };\n const parsed = VisionConfigSchema.parse(newConfig);\n this.config = parsed;\n logger.info('[ConfigurationManager] Configuration updated');\n } catch (error) {\n logger.error('[ConfigurationManager] Failed to update configuration:', error);\n throw error;\n }\n }\n\n // Convert to legacy VisionConfig format for backward compatibility\n toLegacyFormat(): VisionConfig {\n return {\n cameraName: this.config.cameraName,\n pixelChangeThreshold: this.config.pixelChangeThreshold,\n updateInterval: this.config.updateInterval,\n enableObjectDetection: this.config.enableObjectDetection,\n enablePoseDetection: this.config.enablePoseDetection,\n tfUpdateInterval: this.config.tfUpdateInterval,\n vlmUpdateInterval: this.config.vlmUpdateInterval,\n tfChangeThreshold: this.config.tfChangeThreshold,\n vlmChangeThreshold: this.config.vlmChangeThreshold,\n visionMode: this.config.visionMode as VisionMode,\n screenCaptureInterval: this.config.screenCaptureInterval,\n tileSize: this.config.tileSize,\n tileProcessingOrder: this.config.tileProcessingOrder,\n ocrEnabled: this.config.ocrEnabled,\n florence2Enabled: this.config.florence2Enabled,\n };\n }\n\n // Configuration presets\n static getPreset(name: string): Partial<VisionConfigInput> {\n const presets: Record<string, Partial<VisionConfigInput>> = {\n 'high-performance': {\n updateInterval: 50,\n tfUpdateInterval: 500,\n vlmUpdateInterval: 5000,\n enableGPUAcceleration: true,\n maxConcurrentTiles: 5,\n },\n 'low-resource': {\n updateInterval: 200,\n tfUpdateInterval: 2000,\n vlmUpdateInterval: 20000,\n enableObjectDetection: false,\n enablePoseDetection: false,\n maxMemoryUsageMB: 500,\n maxConcurrentTiles: 1,\n },\n 'security-monitoring': {\n enableObjectDetection: true,\n enablePoseDetection: true,\n enableFaceRecognition: true,\n updateInterval: 100,\n entityTimeout: 60000,\n },\n 'screen-reader': {\n visionMode: 'SCREEN',\n ocrEnabled: true,\n florence2Enabled: true,\n screenCaptureInterval: 1000,\n tileProcessingOrder: 'priority',\n },\n };\n\n return presets[name] || {};\n }\n}\n"]}
@@ -1,32 +0,0 @@
1
- import { type IAgentRuntime } from '@elizaos/core';
2
- import type { TrackedEntity, WorldState, DetectedObject, PersonInfo } from './types';
3
- export declare class EntityTracker {
4
- private worldState;
5
- private readonly POSITION_THRESHOLD;
6
- private readonly MISSING_THRESHOLD;
7
- private readonly CLEANUP_THRESHOLD;
8
- constructor(worldId: string);
9
- updateEntities(detectedObjects: DetectedObject[], people: PersonInfo[], faceProfiles?: Map<string, string>, // Maps person ID to face profile ID
10
- runtime?: IAgentRuntime): Promise<TrackedEntity[]>;
11
- private trackPerson;
12
- private trackObject;
13
- private findMatchingEntity;
14
- private calculateDistance;
15
- private updateWorldState;
16
- private syncWithRuntime;
17
- getWorldState(): WorldState;
18
- getActiveEntities(): TrackedEntity[];
19
- getEntity(entityId: string): TrackedEntity | undefined;
20
- getRecentlyLeft(): Array<{
21
- entity: TrackedEntity;
22
- leftAt: number;
23
- }>;
24
- assignNameToEntity(entityId: string, name: string): boolean;
25
- getStatistics(): {
26
- totalEntities: number;
27
- activeEntities: number;
28
- recentlyLeft: number;
29
- people: number;
30
- objects: number;
31
- };
32
- }