@mesh-sync/worker-backend-client 1.0.3 → 1.0.5

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/README.md CHANGED
@@ -140,6 +140,99 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
140
140
 
141
141
 
142
142
 
143
+ ### media-batch-download-completed
144
+
145
+ **Description:** Notifies that a batch media download has been completed.
146
+
147
+ **Method:** `client.mediaBatchDownloadCompleted(data)`
148
+
149
+ **Payload Type:** `MediaBatchDownloadCompletedMessage`
150
+
151
+ **Fields:**
152
+
153
+ - `batchId` (string) [✓]: The unique identifier for the batch download operation.
154
+
155
+ - `status` (string) [✓]: The final status of the batch download operation.
156
+
157
+ - `processedFiles` (array) [✗]: List of successfully processed files.
158
+
159
+ - `failedFiles` (array) [✗]: List of files that failed to process.
160
+
161
+ - `processedAt` (string) [✓]: Timestamp when the batch processing completed.
162
+
163
+ - `statistics` (object) [✗]: Statistics about the batch processing.
164
+
165
+
166
+
167
+ ### media-batch-download-request
168
+
169
+ **Description:** Request to download and process a batch of media files from a storage provider. Images are compressed and resized to specified dimensions, converted to WebP format. Text files and documents are processed and stored with metadata. All processed files are uploaded to MinIO S3 storage under the media/{batchId}/ prefix.
170
+
171
+
172
+ **Method:** `client.mediaBatchDownloadRequest(data)`
173
+
174
+ **Payload Type:** `MediaBatchDownloadRequestMessage`
175
+
176
+ **Fields:**
177
+
178
+ - `batchId` (string) [✗]: Unique identifier for this batch of media files. Used for organizing processed files in S3 storage (media/{batchId}/) and correlating with completion responses.
179
+
180
+
181
+ - `storageConnectionId` (string) [✗]: UUID of the StorageConnection entity from which to download the media files. Used to authenticate and access the source storage provider.
182
+
183
+
184
+ - `mediaFiles` (array) [✗]: Array of media files to download and process. Must contain at least one file. Each file includes metadata for identification and processing.
185
+
186
+
187
+ - `compressionSettings` (object) [✗]: Optional compression settings that override deployment environment defaults. If not provided, uses values from MAX_IMAGE_WIDTH, MAX_IMAGE_HEIGHT, IMAGE_QUALITY, and OUTPUT_FORMAT environment variables.
188
+
189
+
190
+
191
+
192
+ ### metamodel-metadata-generation-completed
193
+
194
+ **Description:** Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
195
+
196
+ **Method:** `client.metamodelMetadataGenerationCompleted(data)`
197
+
198
+ **Payload Type:** `MetamodelMetadataGenerationCompletedMessage`
199
+
200
+ **Fields:**
201
+
202
+ - `metamodelId` (string) [✓]: The unique identifier for the metamodel
203
+
204
+ - `metadata` (object) [✓]: AI-generated metadata for the metamodel
205
+
206
+ - `technicalMetadata` (object) [✓]: Aggregated technical analysis from constituent models
207
+
208
+
209
+
210
+ ### metamodel-metadata-generation-request
211
+
212
+ **Description:** Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
213
+
214
+ **Method:** `client.metamodelMetadataGenerationRequest(data)`
215
+
216
+ **Payload Type:** `MetamodelMetadataGenerationRequestMessage`
217
+
218
+ **Fields:**
219
+
220
+ - `metamodelId` (string) [✗]: The unique identifier for the metamodel
221
+
222
+ - `constituentModelIds` (array) [✗]: Array of model IDs that compose this metamodel
223
+
224
+ - `name` (string) [✗]: The name of the metamodel
225
+
226
+ - `ownerId` (string) [✗]: The owner's user ID
227
+
228
+ - `libraryId` (string) [✗]: The library containing this metamodel
229
+
230
+ - `constituentModels` (array) [✗]: Enriched metadata for constituent models (includes storage items)
231
+
232
+ - `webhookUrl` (string) [✗]: Optional webhook URL for async completion notification
233
+
234
+
235
+
143
236
  ### model-discovery-folder-processed-event
144
237
 
145
238
  **Description:** Handles model discovery folder processed events.
@@ -276,7 +369,7 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
276
369
 
277
370
  ### model-metamodel-detection-found
278
371
 
279
- **Description:** Handles model metamodel detection found.
372
+ **Description:** Handles model metamodel detection found with hierarchical relationships.
280
373
 
281
374
  **Method:** `client.modelMetamodelDetectionFound(data)`
282
375
 
@@ -284,7 +377,7 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
284
377
 
285
378
  **Fields:**
286
379
 
287
- - `suggestions` (array) [✓]: List of metamodel suggestions.
380
+ - `metamodels` (array) [✓]: List of metamodel nodes in hierarchical structure (roots and children).
288
381
 
289
382
 
290
383
 
@@ -312,6 +405,114 @@ await client.sendToQueue(MessageTypes.FILE_DOWNLOAD_REQUEST, {
312
405
 
313
406
 
314
407
 
408
+ ### model-technical-metadata-completed
409
+
410
+ **Description:** Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
411
+
412
+ **Method:** `client.modelTechnicalMetadataCompleted(data)`
413
+
414
+ **Payload Type:** `ModelTechnicalMetadataCompletedMessage`
415
+
416
+ **Fields:**
417
+
418
+ - `originalJobId` (string) [✗]: ID of the original analysis request job
419
+
420
+ - `modelId` (string) [✗]: ID of the analyzed model
421
+
422
+ - `status` (string) [✗]: Analysis completion status
423
+
424
+ - `vertices` (integer) [✗]: Number of vertices in the mesh
425
+
426
+ - `faces` (integer) [✗]: Number of faces/polygons in the mesh
427
+
428
+ - `edges` (integer) [✗]: Number of edges in the mesh
429
+
430
+ - `detailLevel` (string) [✗]: Visual detail level based on polygon density
431
+
432
+ - `boundingBox` (object) [✗]: 3D bounding box dimensions in millimeters
433
+
434
+ - `volumeCubicMm` (number) [✗]: Model volume in cubic millimeters (for material calculation)
435
+
436
+ - `surfaceAreaSqMm` (number) [✗]: Total surface area in square millimeters
437
+
438
+ - `minWallThickness` (number) [✗]: Minimum wall thickness detected in millimeters (critical for printability)
439
+
440
+ - `maxWallThickness` (number) [✗]: Maximum wall thickness detected in millimeters
441
+
442
+ - `manifold` (boolean) [✗]: Is the mesh watertight/manifold? Critical for 3D printing (true = printable)
443
+
444
+ - `nonManifoldEdges` (integer) [✗]: Number of non-manifold edges (repair needed if > 0)
445
+
446
+ - `holes` (integer) [✗]: Number of holes/boundary loops in the mesh (0 = closed mesh)
447
+
448
+ - `flippedNormals` (integer) [✗]: Number of faces with inverted normals (causes rendering/slicing issues)
449
+
450
+ - `selfIntersections` (integer) [✗]: Number of self-intersecting faces (0 = clean geometry)
451
+
452
+ - `qualityScore` (number) [✗]: Overall quality score 0-100 (100 = perfect for printing, <60 needs repair)
453
+
454
+ - `printabilityScore` (number) [✗]: Printability score 0-100 (considers supports, orientation, size constraints)
455
+
456
+ - `requiresSupports` (boolean) [✗]: Does this model require support structures for 3D printing?
457
+
458
+ - `overhangs` (array) [✗]: Detected overhang areas requiring support structures
459
+
460
+ - `estimatedPrintTimeMinutes` (integer) [✗]: Estimated print time in minutes using normal quality settings (0.2mm layers, 20% infill)
461
+
462
+ - `printTimeEstimates` (object) [✗]: Print time estimates for different quality presets
463
+
464
+ - `estimatedMaterialGrams` (number) [✗]: Estimated material usage in grams using 20% infill (assumes PLA density 1.24g/cm³)
465
+
466
+ - `materialEstimates` (object) [✗]: Material usage estimates for different infill percentages
467
+
468
+ - `recommendedOrientation` (object) [✗]: Recommended print orientation for minimal support material and best results
469
+
470
+ - `originalUnit` (string) [✗]: Original file format unit detected from metadata or inferred from scale
471
+
472
+ - `formatVersion` (string) [✗]: File format version (e.g., 'STL Binary', 'OBJ v4', 'PLY 1.0')
473
+
474
+ - `hasColorData` (boolean) [✗]: Does the file contain per-vertex color information?
475
+
476
+ - `hasTextureCoordinates` (boolean) [✗]: Does the file contain UV texture mapping coordinates?
477
+
478
+ - `hasVertexNormals` (boolean) [✗]: Does the file contain per-vertex normal vectors?
479
+
480
+ - `analyzedBy` (string) [✗]: Tool/service that performed the analysis
481
+
482
+ - `analysisVersion` (string) [✗]: Version of the analysis algorithm (for tracking improvements)
483
+
484
+ - `analysisConfidence` (number) [✗]: Confidence level of analysis results (0.0 = uncertain, 1.0 = highly confident)
485
+
486
+ - `analysisWarnings` (array) [✗]: Warnings or issues detected during analysis (structured for programmatic handling)
487
+
488
+ - `analyzedAt` (string) [✗]: ISO 8601 timestamp when analysis was performed (e.g., '2025-11-19T14:35:22Z')
489
+
490
+ - `errorMessage` (string) [✗]: Detailed error message if status is FAILED
491
+
492
+ - `errorCode` (string) [✗]: Machine-readable error code for programmatic error handling
493
+
494
+
495
+
496
+ ### model-technical-metadata-request
497
+
498
+ **Description:** Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
499
+
500
+ **Method:** `client.modelTechnicalMetadataRequest(data)`
501
+
502
+ **Payload Type:** `ModelTechnicalMetadataRequestMessage`
503
+
504
+ **Fields:**
505
+
506
+ - `modelId` (string) [✗]: Unique identifier for the model to analyze
507
+
508
+ - `ownerId` (string) [✗]: User ID who owns the model
509
+
510
+ - `storageLocation` (object) [✗]: Location of the 3D model file
511
+
512
+ - `analysisOptions` (object) [✗]: Optional analysis configuration parameters
513
+
514
+
515
+
315
516
  ### thumbnail-generation-completed
316
517
 
317
518
  **Description:** Handles thumbnail generation completed.
@@ -402,6 +603,19 @@ new WorkerClient(config: WorkerClientConfig)
402
603
  - `fileDownloadRequest(data: FileDownloadRequestMessage): Promise<JobResponse>`
403
604
  - Handles file download requests.
404
605
 
606
+ - `mediaBatchDownloadCompleted(data: MediaBatchDownloadCompletedMessage): Promise<JobResponse>`
607
+ - Notifies that a batch media download has been completed.
608
+
609
+ - `mediaBatchDownloadRequest(data: MediaBatchDownloadRequestMessage): Promise<JobResponse>`
610
+ - Request to download and process a batch of media files from a storage provider. Images are compressed and resized to specified dimensions, converted to WebP format. Text files and documents are processed and stored with metadata. All processed files are uploaded to MinIO S3 storage under the media/{batchId}/ prefix.
611
+
612
+
613
+ - `metamodelMetadataGenerationCompleted(data: MetamodelMetadataGenerationCompletedMessage): Promise<JobResponse>`
614
+ - Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
615
+
616
+ - `metamodelMetadataGenerationRequest(data: MetamodelMetadataGenerationRequestMessage): Promise<JobResponse>`
617
+ - Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
618
+
405
619
  - `modelDiscoveryFolderProcessedEvent(data: ModelDiscoveryFolderProcessedEventMessage): Promise<JobResponse>`
406
620
  - Handles model discovery folder processed events.
407
621
 
@@ -421,11 +635,17 @@ new WorkerClient(config: WorkerClientConfig)
421
635
  - Handles model metadata generation requests.
422
636
 
423
637
  - `modelMetamodelDetectionFound(data: ModelMetamodelDetectionFoundMessage): Promise<JobResponse>`
424
- - Handles model metamodel detection found.
638
+ - Handles model metamodel detection found with hierarchical relationships.
425
639
 
426
640
  - `modelMetamodelDetectionRequest(data: ModelMetamodelDetectionRequestMessage): Promise<JobResponse>`
427
641
  - Handles model metamodel detection requests.
428
642
 
643
+ - `modelTechnicalMetadataCompleted(data: ModelTechnicalMetadataCompletedMessage): Promise<JobResponse>`
644
+ - Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
645
+
646
+ - `modelTechnicalMetadataRequest(data: ModelTechnicalMetadataRequestMessage): Promise<JobResponse>`
647
+ - Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
648
+
429
649
  - `thumbnailGenerationCompleted(data: ThumbnailGenerationCompletedMessage): Promise<JobResponse>`
430
650
  - Handles thumbnail generation completed.
431
651
 
package/dist/client.d.ts CHANGED
@@ -49,6 +49,31 @@ export declare class WorkerClient {
49
49
  * @returns Job response with job ID
50
50
  */
51
51
  fileDownloadRequest(data: types.FileDownloadRequestMessage): Promise<JobResponse>;
52
+ /**
53
+ * Notifies that a batch media download has been completed.
54
+ * @param data - The message payload
55
+ * @returns Job response with job ID
56
+ */
57
+ mediaBatchDownloadCompleted(data: types.MediaBatchDownloadCompletedMessage): Promise<JobResponse>;
58
+ /**
59
+ * Request to download and process a batch of media files from a storage provider. Images are compressed and resized to specified dimensions, converted to WebP format. Text files and documents are processed and stored with metadata. All processed files are uploaded to MinIO S3 storage under the media/{batchId}/ prefix.
60
+
61
+ * @param data - The message payload
62
+ * @returns Job response with job ID
63
+ */
64
+ mediaBatchDownloadRequest(data: types.MediaBatchDownloadRequestMessage): Promise<JobResponse>;
65
+ /**
66
+ * Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
67
+ * @param data - The message payload
68
+ * @returns Job response with job ID
69
+ */
70
+ metamodelMetadataGenerationCompleted(data: types.MetamodelMetadataGenerationCompletedMessage): Promise<JobResponse>;
71
+ /**
72
+ * Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
73
+ * @param data - The message payload
74
+ * @returns Job response with job ID
75
+ */
76
+ metamodelMetadataGenerationRequest(data: types.MetamodelMetadataGenerationRequestMessage): Promise<JobResponse>;
52
77
  /**
53
78
  * Handles model discovery folder processed events.
54
79
  * @param data - The message payload
@@ -86,7 +111,7 @@ export declare class WorkerClient {
86
111
  */
87
112
  modelMetadataGenerationRequest(data: types.ModelMetadataGenerationRequestMessage): Promise<JobResponse>;
88
113
  /**
89
- * Handles model metamodel detection found.
114
+ * Handles model metamodel detection found with hierarchical relationships.
90
115
  * @param data - The message payload
91
116
  * @returns Job response with job ID
92
117
  */
@@ -97,6 +122,18 @@ export declare class WorkerClient {
97
122
  * @returns Job response with job ID
98
123
  */
99
124
  modelMetamodelDetectionRequest(data: types.ModelMetamodelDetectionRequestMessage): Promise<JobResponse>;
125
+ /**
126
+ * Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
127
+ * @param data - The message payload
128
+ * @returns Job response with job ID
129
+ */
130
+ modelTechnicalMetadataCompleted(data: types.ModelTechnicalMetadataCompletedMessage): Promise<JobResponse>;
131
+ /**
132
+ * Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
133
+ * @param data - The message payload
134
+ * @returns Job response with job ID
135
+ */
136
+ modelTechnicalMetadataRequest(data: types.ModelTechnicalMetadataRequestMessage): Promise<JobResponse>;
100
137
  /**
101
138
  * Handles thumbnail generation completed.
102
139
  * @param data - The message payload
package/dist/client.js CHANGED
@@ -76,6 +76,39 @@ export class WorkerClient {
76
76
  async fileDownloadRequest(data) {
77
77
  return this.sendToQueue(types.MessageTypes.FILE_DOWNLOAD_REQUEST, data);
78
78
  }
79
+ /**
80
+ * Notifies that a batch media download has been completed.
81
+ * @param data - The message payload
82
+ * @returns Job response with job ID
83
+ */
84
+ async mediaBatchDownloadCompleted(data) {
85
+ return this.sendToQueue(types.MessageTypes.MEDIA_BATCH_DOWNLOAD_COMPLETED, data);
86
+ }
87
+ /**
88
+ * Request to download and process a batch of media files from a storage provider. Images are compressed and resized to specified dimensions, converted to WebP format. Text files and documents are processed and stored with metadata. All processed files are uploaded to MinIO S3 storage under the media/{batchId}/ prefix.
89
+
90
+ * @param data - The message payload
91
+ * @returns Job response with job ID
92
+ */
93
+ async mediaBatchDownloadRequest(data) {
94
+ return this.sendToQueue(types.MessageTypes.MEDIA_BATCH_DOWNLOAD_REQUEST, data);
95
+ }
96
+ /**
97
+ * Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
98
+ * @param data - The message payload
99
+ * @returns Job response with job ID
100
+ */
101
+ async metamodelMetadataGenerationCompleted(data) {
102
+ return this.sendToQueue(types.MessageTypes.METAMODEL_METADATA_GENERATION_COMPLETED, data);
103
+ }
104
+ /**
105
+ * Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
106
+ * @param data - The message payload
107
+ * @returns Job response with job ID
108
+ */
109
+ async metamodelMetadataGenerationRequest(data) {
110
+ return this.sendToQueue(types.MessageTypes.METAMODEL_METADATA_GENERATION_REQUEST, data);
111
+ }
79
112
  /**
80
113
  * Handles model discovery folder processed events.
81
114
  * @param data - The message payload
@@ -125,7 +158,7 @@ export class WorkerClient {
125
158
  return this.sendToQueue(types.MessageTypes.MODEL_METADATA_GENERATION_REQUEST, data);
126
159
  }
127
160
  /**
128
- * Handles model metamodel detection found.
161
+ * Handles model metamodel detection found with hierarchical relationships.
129
162
  * @param data - The message payload
130
163
  * @returns Job response with job ID
131
164
  */
@@ -140,6 +173,22 @@ export class WorkerClient {
140
173
  async modelMetamodelDetectionRequest(data) {
141
174
  return this.sendToQueue(types.MessageTypes.MODEL_METAMODEL_DETECTION_REQUEST, data);
142
175
  }
176
+ /**
177
+ * Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
178
+ * @param data - The message payload
179
+ * @returns Job response with job ID
180
+ */
181
+ async modelTechnicalMetadataCompleted(data) {
182
+ return this.sendToQueue(types.MessageTypes.MODEL_TECHNICAL_METADATA_COMPLETED, data);
183
+ }
184
+ /**
185
+ * Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
186
+ * @param data - The message payload
187
+ * @returns Job response with job ID
188
+ */
189
+ async modelTechnicalMetadataRequest(data) {
190
+ return this.sendToQueue(types.MessageTypes.MODEL_TECHNICAL_METADATA_REQUEST, data);
191
+ }
143
192
  /**
144
193
  * Handles thumbnail generation completed.
145
194
  * @param data - The message payload
package/dist/types.d.ts CHANGED
@@ -4,6 +4,10 @@
4
4
  export declare const MessageTypes: {
5
5
  readonly FILE_DOWNLOAD_COMPLETED: "file-download-completed";
6
6
  readonly FILE_DOWNLOAD_REQUEST: "file-download-request";
7
+ readonly MEDIA_BATCH_DOWNLOAD_COMPLETED: "media-batch-download-completed";
8
+ readonly MEDIA_BATCH_DOWNLOAD_REQUEST: "media-batch-download-request";
9
+ readonly METAMODEL_METADATA_GENERATION_COMPLETED: "metamodel-metadata-generation-completed";
10
+ readonly METAMODEL_METADATA_GENERATION_REQUEST: "metamodel-metadata-generation-request";
7
11
  readonly MODEL_DISCOVERY_FOLDER_PROCESSED_EVENT: "model-discovery-folder-processed-event";
8
12
  readonly MODEL_DISCOVERY_SCAN_FOUND_EVENT: "model-discovery-scan-found-event";
9
13
  readonly MODEL_DISCOVERY_SCAN_PROGRESS_EVENT: "model-discovery-scan-progress-event";
@@ -12,6 +16,8 @@ export declare const MessageTypes: {
12
16
  readonly MODEL_METADATA_GENERATION_REQUEST: "model-metadata-generation-request";
13
17
  readonly MODEL_METAMODEL_DETECTION_FOUND: "model-metamodel-detection-found";
14
18
  readonly MODEL_METAMODEL_DETECTION_REQUEST: "model-metamodel-detection-request";
19
+ readonly MODEL_TECHNICAL_METADATA_COMPLETED: "model-technical-metadata-completed";
20
+ readonly MODEL_TECHNICAL_METADATA_REQUEST: "model-technical-metadata-request";
15
21
  readonly THUMBNAIL_GENERATION_COMPLETED: "thumbnail-generation-completed";
16
22
  readonly THUMBNAIL_GENERATION_REQUEST: "thumbnail-generation-request";
17
23
  };
@@ -42,6 +48,71 @@ export interface FileDownloadRequestMessage {
42
48
  /** The storage location of the model. */
43
49
  storageLocation?: Record<string, string | number | boolean>;
44
50
  }
51
+ /**
52
+ * Notifies that a batch media download has been completed.
53
+ */
54
+ export interface MediaBatchDownloadCompletedMessage {
55
+ /** The unique identifier for the batch download operation. */
56
+ batchId: string;
57
+ /** The final status of the batch download operation. */
58
+ status: string;
59
+ /** List of successfully processed files. */
60
+ processedFiles?: Array<Record<string, string | number | boolean>>;
61
+ /** List of files that failed to process. */
62
+ failedFiles?: Array<Record<string, string | number | boolean>>;
63
+ /** Timestamp when the batch processing completed. */
64
+ processedAt: string;
65
+ /** Statistics about the batch processing. */
66
+ statistics?: Record<string, string | number | boolean>;
67
+ }
68
+ /**
69
+ * Request to download and process a batch of media files from a storage provider. Images are compressed and resized to specified dimensions, converted to WebP format. Text files and documents are processed and stored with metadata. All processed files are uploaded to MinIO S3 storage under the media/{batchId}/ prefix.
70
+
71
+ */
72
+ export interface MediaBatchDownloadRequestMessage {
73
+ /** Unique identifier for this batch of media files. Used for organizing processed files in S3 storage (media/{batchId}/) and correlating with completion responses.
74
+ */
75
+ batchId?: string;
76
+ /** UUID of the StorageConnection entity from which to download the media files. Used to authenticate and access the source storage provider.
77
+ */
78
+ storageConnectionId?: string;
79
+ /** Array of media files to download and process. Must contain at least one file. Each file includes metadata for identification and processing.
80
+ */
81
+ mediaFiles?: Array<Record<string, string | number | boolean>>;
82
+ /** Optional compression settings that override deployment environment defaults. If not provided, uses values from MAX_IMAGE_WIDTH, MAX_IMAGE_HEIGHT, IMAGE_QUALITY, and OUTPUT_FORMAT environment variables.
83
+ */
84
+ compressionSettings?: Record<string, string | number | boolean>;
85
+ }
86
+ /**
87
+ * Handles metamodel metadata generation completion. Contains AI-generated metadata and aggregated technical analysis.
88
+ */
89
+ export interface MetamodelMetadataGenerationCompletedMessage {
90
+ /** The unique identifier for the metamodel */
91
+ metamodelId: string;
92
+ /** AI-generated metadata for the metamodel */
93
+ metadata: Record<string, string | number | boolean>;
94
+ /** Aggregated technical analysis from constituent models */
95
+ technicalMetadata: Record<string, string | number | boolean>;
96
+ }
97
+ /**
98
+ * Handles metamodel metadata generation requests via Ollama. Aggregates data from constituent models and generates AI-enhanced metadata.
99
+ */
100
+ export interface MetamodelMetadataGenerationRequestMessage {
101
+ /** The unique identifier for the metamodel */
102
+ metamodelId?: string;
103
+ /** Array of model IDs that compose this metamodel */
104
+ constituentModelIds?: Array<Record<string, string | number | boolean>>;
105
+ /** The name of the metamodel */
106
+ name?: string;
107
+ /** The owner's user ID */
108
+ ownerId?: string;
109
+ /** The library containing this metamodel */
110
+ libraryId?: string;
111
+ /** Enriched metadata for constituent models (includes storage items) */
112
+ constituentModels?: Array<Record<string, string | number | boolean>>;
113
+ /** Optional webhook URL for async completion notification */
114
+ webhookUrl?: string;
115
+ }
45
116
  /**
46
117
  * Handles model discovery folder processed events.
47
118
  */
@@ -135,11 +206,11 @@ export interface ModelMetadataGenerationRequestMessage {
135
206
  metamodel?: Record<string, string | number | boolean>;
136
207
  }
137
208
  /**
138
- * Handles model metamodel detection found.
209
+ * Handles model metamodel detection found with hierarchical relationships.
139
210
  */
140
211
  export interface ModelMetamodelDetectionFoundMessage {
141
- /** List of metamodel suggestions. */
142
- suggestions: Array<Record<string, string | number | boolean>>;
212
+ /** List of metamodel nodes in hierarchical structure (roots and children). */
213
+ metamodels: Array<Record<string, string | number | boolean>>;
143
214
  }
144
215
  /**
145
216
  * Handles model metamodel detection requests.
@@ -158,6 +229,100 @@ export interface ModelMetamodelDetectionRequestMessage {
158
229
  /** Statistics about the processed folder. */
159
230
  statistics: Record<string, string | number | boolean>;
160
231
  }
232
+ /**
233
+ * Reports comprehensive results of technical metadata analysis including geometry, quality metrics, and print-readiness assessment
234
+ */
235
+ export interface ModelTechnicalMetadataCompletedMessage {
236
+ /** ID of the original analysis request job */
237
+ originalJobId?: string;
238
+ /** ID of the analyzed model */
239
+ modelId?: string;
240
+ /** Analysis completion status */
241
+ status?: string;
242
+ /** Number of vertices in the mesh */
243
+ vertices?: string | number | boolean;
244
+ /** Number of faces/polygons in the mesh */
245
+ faces?: string | number | boolean;
246
+ /** Number of edges in the mesh */
247
+ edges?: string | number | boolean;
248
+ /** Visual detail level based on polygon density */
249
+ detailLevel?: string;
250
+ /** 3D bounding box dimensions in millimeters */
251
+ boundingBox?: Record<string, string | number | boolean>;
252
+ /** Model volume in cubic millimeters (for material calculation) */
253
+ volumeCubicMm?: number;
254
+ /** Total surface area in square millimeters */
255
+ surfaceAreaSqMm?: number;
256
+ /** Minimum wall thickness detected in millimeters (critical for printability) */
257
+ minWallThickness?: number;
258
+ /** Maximum wall thickness detected in millimeters */
259
+ maxWallThickness?: number;
260
+ /** Is the mesh watertight/manifold? Critical for 3D printing (true = printable) */
261
+ manifold?: boolean;
262
+ /** Number of non-manifold edges (repair needed if > 0) */
263
+ nonManifoldEdges?: string | number | boolean;
264
+ /** Number of holes/boundary loops in the mesh (0 = closed mesh) */
265
+ holes?: string | number | boolean;
266
+ /** Number of faces with inverted normals (causes rendering/slicing issues) */
267
+ flippedNormals?: string | number | boolean;
268
+ /** Number of self-intersecting faces (0 = clean geometry) */
269
+ selfIntersections?: string | number | boolean;
270
+ /** Overall quality score 0-100 (100 = perfect for printing, <60 needs repair) */
271
+ qualityScore?: number;
272
+ /** Printability score 0-100 (considers supports, orientation, size constraints) */
273
+ printabilityScore?: number;
274
+ /** Does this model require support structures for 3D printing? */
275
+ requiresSupports?: boolean;
276
+ /** Detected overhang areas requiring support structures */
277
+ overhangs?: Array<Record<string, string | number | boolean>>;
278
+ /** Estimated print time in minutes using normal quality settings (0.2mm layers, 20% infill) */
279
+ estimatedPrintTimeMinutes?: string | number | boolean;
280
+ /** Print time estimates for different quality presets */
281
+ printTimeEstimates?: Record<string, string | number | boolean>;
282
+ /** Estimated material usage in grams using 20% infill (assumes PLA density 1.24g/cm³) */
283
+ estimatedMaterialGrams?: number;
284
+ /** Material usage estimates for different infill percentages */
285
+ materialEstimates?: Record<string, string | number | boolean>;
286
+ /** Recommended print orientation for minimal support material and best results */
287
+ recommendedOrientation?: Record<string, string | number | boolean>;
288
+ /** Original file format unit detected from metadata or inferred from scale */
289
+ originalUnit?: string;
290
+ /** File format version (e.g., 'STL Binary', 'OBJ v4', 'PLY 1.0') */
291
+ formatVersion?: string;
292
+ /** Does the file contain per-vertex color information? */
293
+ hasColorData?: boolean;
294
+ /** Does the file contain UV texture mapping coordinates? */
295
+ hasTextureCoordinates?: boolean;
296
+ /** Does the file contain per-vertex normal vectors? */
297
+ hasVertexNormals?: boolean;
298
+ /** Tool/service that performed the analysis */
299
+ analyzedBy?: string;
300
+ /** Version of the analysis algorithm (for tracking improvements) */
301
+ analysisVersion?: string;
302
+ /** Confidence level of analysis results (0.0 = uncertain, 1.0 = highly confident) */
303
+ analysisConfidence?: number;
304
+ /** Warnings or issues detected during analysis (structured for programmatic handling) */
305
+ analysisWarnings?: Array<Record<string, string | number | boolean>>;
306
+ /** ISO 8601 timestamp when analysis was performed (e.g., '2025-11-19T14:35:22Z') */
307
+ analyzedAt?: string;
308
+ /** Detailed error message if status is FAILED */
309
+ errorMessage?: string;
310
+ /** Machine-readable error code for programmatic error handling */
311
+ errorCode?: string;
312
+ }
313
+ /**
314
+ * Triggers comprehensive technical analysis of a 3D model file to extract geometry, quality metrics, and print-readiness information
315
+ */
316
+ export interface ModelTechnicalMetadataRequestMessage {
317
+ /** Unique identifier for the model to analyze */
318
+ modelId?: string;
319
+ /** User ID who owns the model */
320
+ ownerId?: string;
321
+ /** Location of the 3D model file */
322
+ storageLocation?: Record<string, string | number | boolean>;
323
+ /** Optional analysis configuration parameters */
324
+ analysisOptions?: Record<string, string | number | boolean>;
325
+ }
161
326
  /**
162
327
  * Handles thumbnail generation completed.
163
328
  */
package/dist/types.js CHANGED
@@ -5,6 +5,10 @@
5
5
  export const MessageTypes = {
6
6
  FILE_DOWNLOAD_COMPLETED: 'file-download-completed',
7
7
  FILE_DOWNLOAD_REQUEST: 'file-download-request',
8
+ MEDIA_BATCH_DOWNLOAD_COMPLETED: 'media-batch-download-completed',
9
+ MEDIA_BATCH_DOWNLOAD_REQUEST: 'media-batch-download-request',
10
+ METAMODEL_METADATA_GENERATION_COMPLETED: 'metamodel-metadata-generation-completed',
11
+ METAMODEL_METADATA_GENERATION_REQUEST: 'metamodel-metadata-generation-request',
8
12
  MODEL_DISCOVERY_FOLDER_PROCESSED_EVENT: 'model-discovery-folder-processed-event',
9
13
  MODEL_DISCOVERY_SCAN_FOUND_EVENT: 'model-discovery-scan-found-event',
10
14
  MODEL_DISCOVERY_SCAN_PROGRESS_EVENT: 'model-discovery-scan-progress-event',
@@ -13,6 +17,8 @@ export const MessageTypes = {
13
17
  MODEL_METADATA_GENERATION_REQUEST: 'model-metadata-generation-request',
14
18
  MODEL_METAMODEL_DETECTION_FOUND: 'model-metamodel-detection-found',
15
19
  MODEL_METAMODEL_DETECTION_REQUEST: 'model-metamodel-detection-request',
20
+ MODEL_TECHNICAL_METADATA_COMPLETED: 'model-technical-metadata-completed',
21
+ MODEL_TECHNICAL_METADATA_REQUEST: 'model-technical-metadata-request',
16
22
  THUMBNAIL_GENERATION_COMPLETED: 'thumbnail-generation-completed',
17
23
  THUMBNAIL_GENERATION_REQUEST: 'thumbnail-generation-request',
18
24
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mesh-sync/worker-backend-client",
3
- "version": "1.0.3",
3
+ "version": "1.0.5",
4
4
  "description": "Auto-generated TypeScript client for worker-backend - provides type-safe methods for enqueueing jobs",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",