@blueharford/scrypted-spatial-awareness 0.6.10 → 0.6.12

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/plugin.zip CHANGED
Binary file
@@ -34431,10 +34431,11 @@ class AlertManager {
34431
34431
  return null;
34432
34432
  }
34433
34433
  // Create alert
34434
+ // Note: details.objectLabel may contain LLM-generated description - preserve it if provided
34434
34435
  const fullDetails = {
34435
34436
  ...details,
34436
34437
  objectClass: tracked.className,
34437
- objectLabel: tracked.label,
34438
+ objectLabel: details.objectLabel || tracked.label,
34438
34439
  };
34439
34440
  const alert = (0, alert_1.createAlert)(type, tracked.globalId, fullDetails, rule.severity, rule.id);
34440
34441
  // Store alert
@@ -35137,54 +35138,23 @@ async function mediaObjectToBase64(mediaObject) {
35137
35138
  }
35138
35139
  /**
35139
35140
  * Build image content block for ChatCompletion API
35140
- * Supports OpenAI, Anthropic, and @scrypted/llm formats
35141
+ *
35142
+ * IMPORTANT: @scrypted/llm uses OpenAI-compatible format for ALL providers.
35143
+ * The plugin internally converts this format to the appropriate provider format.
35144
+ * So we ALWAYS use the OpenAI image_url format with data URI.
35145
+ *
35141
35146
  * @param imageData - Image data with base64 and media type
35142
- * @param provider - The LLM provider type
35147
+ * @param provider - The LLM provider type (currently unused, kept for logging)
35143
35148
  */
35144
35149
  function buildImageContent(imageData, provider = 'unknown') {
35145
- if (provider === 'openai') {
35146
- // OpenAI format: uses data URL with image_url wrapper
35147
- return {
35148
- type: 'image_url',
35149
- image_url: {
35150
- url: `data:${imageData.mediaType};base64,${imageData.base64}`,
35151
- detail: 'auto',
35152
- },
35153
- };
35154
- }
35155
- else if (provider === 'anthropic') {
35156
- // Anthropic official format: uses 'data' key
35157
- return {
35158
- type: 'image',
35159
- source: {
35160
- type: 'base64',
35161
- media_type: imageData.mediaType,
35162
- data: imageData.base64,
35163
- },
35164
- };
35165
- }
35166
- else if (provider === 'scrypted') {
35167
- // @scrypted/llm format: uses 'base64' key (per error path .image.source.base64)
35168
- return {
35169
- type: 'image',
35170
- source: {
35171
- type: 'base64',
35172
- media_type: imageData.mediaType,
35173
- base64: imageData.base64,
35174
- },
35175
- };
35176
- }
35177
- else {
35178
- // Unknown provider: try @scrypted/llm format first
35179
- return {
35180
- type: 'image',
35181
- source: {
35182
- type: 'base64',
35183
- media_type: imageData.mediaType,
35184
- base64: imageData.base64,
35185
- },
35186
- };
35187
- }
35150
+ // @scrypted/llm uses OpenAI-compatible format for ALL providers
35151
+ // The plugin handles internal conversion to Anthropic/other formats
35152
+ return {
35153
+ type: 'image_url',
35154
+ image_url: {
35155
+ url: `data:${imageData.mediaType};base64,${imageData.base64}`,
35156
+ },
35157
+ };
35188
35158
  }
35189
35159
  /** Check if an error indicates vision/multimodal content format issue (should try alternate format) */
35190
35160
  function isVisionFormatError(error) {