replicas-engine 0.1.192 → 0.1.193

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 (2) hide show
  1. package/dist/src/index.js +27 -1
  2. package/package.json +1 -1
package/dist/src/index.js CHANGED
@@ -392,7 +392,7 @@ function parseReplicasConfigString(content, filename) {
392
392
  }
393
393
 
394
394
  // ../shared/src/engine/environment.ts
395
- var DAYTONA_SNAPSHOT_ID = "20-05-2026-royal-york-v2";
395
+ var DAYTONA_SNAPSHOT_ID = "20-05-2026-royal-york-v3";
396
396
 
397
397
  // ../shared/src/engine/types.ts
398
398
  var DEFAULT_CHAT_TITLES = {
@@ -429,6 +429,9 @@ var MODEL_LABELS = {
429
429
  };
430
430
  var IMAGE_MEDIA_TYPES = ["image/png", "image/jpeg", "image/gif", "image/webp"];
431
431
 
432
+ // ../shared/src/engine/v1.ts
433
+ var MERGED_MESSAGE_SEPARATOR = "\n\n<!-- replicas:merged -->\n\n";
434
+
432
435
  // ../shared/src/routes/workspaces.ts
433
436
  var WORKSPACE_FILE_UPLOAD_MAX_SIZE_BYTES = 20 * 1024 * 1024;
434
437
  var WORKSPACE_FILE_CONTENT_MAX_SIZE_BYTES = 1 * 1024 * 1024;
@@ -2644,6 +2647,15 @@ var MessageQueueService = class {
2644
2647
  * @returns Object indicating whether the message was queued or started processing
2645
2648
  */
2646
2649
  async enqueue(request) {
2650
+ if (this.processing && this.canMergeIntoTail(request)) {
2651
+ const tail = this.queue[this.queue.length - 1];
2652
+ this.mergeInto(tail, request);
2653
+ return {
2654
+ queued: true,
2655
+ messageId: tail.id,
2656
+ position: this.queue.length
2657
+ };
2658
+ }
2647
2659
  const messageId = this.generateMessageId();
2648
2660
  const queuedMessage = {
2649
2661
  id: messageId,
@@ -2667,6 +2679,18 @@ var MessageQueueService = class {
2667
2679
  position: 0
2668
2680
  };
2669
2681
  }
2682
+ canMergeIntoTail(request) {
2683
+ if (!request.merge || !request.type) return false;
2684
+ const tail = this.queue[this.queue.length - 1];
2685
+ if (!tail) return false;
2686
+ return tail.merge === true && tail.type === request.type;
2687
+ }
2688
+ mergeInto(tail, request) {
2689
+ tail.message = `${tail.message}${MERGED_MESSAGE_SEPARATOR}${request.message}`;
2690
+ if (request.images && request.images.length > 0) {
2691
+ tail.images = [...tail.images ?? [], ...request.images];
2692
+ }
2693
+ }
2670
2694
  async startProcessing(queuedMessage) {
2671
2695
  this.processing = true;
2672
2696
  try {
@@ -5754,6 +5778,8 @@ var sendMessageSchema = z2.object({
5754
5778
  })).optional(),
5755
5779
  thinkingLevel: z2.enum(["low", "medium", "high", "max"]).optional(),
5756
5780
  enableInteractiveTools: z2.boolean().optional(),
5781
+ type: z2.string().min(1).optional(),
5782
+ merge: z2.boolean().optional(),
5757
5783
  senderUserId: z2.string().optional(),
5758
5784
  senderEmail: z2.string().optional(),
5759
5785
  senderDisplayName: z2.string().optional()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.192",
3
+ "version": "0.1.193",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",