replicas-engine 0.1.641 → 0.1.642

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.
@@ -5875,7 +5875,7 @@ var DEFAULT_CODEX_ARGS = [
5875
5875
  var MIN_CODEX_CLI_VERSION = "0.144.6";
5876
5876
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
5877
5877
  var codexCliVersionEnsured = null;
5878
- var ENGINE_PACKAGE_VERSION = "0.1.641";
5878
+ var ENGINE_PACKAGE_VERSION = "0.1.642";
5879
5879
  var INITIALIZE_METHOD = "initialize";
5880
5880
  var INITIALIZED_NOTIFICATION = "initialized";
5881
5881
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -7,7 +7,7 @@ import {
7
7
  isUnsafeMemoryOutput,
8
8
  putPresignedFile,
9
9
  recoverCompletedTurn
10
- } from "./chunk-CHX75SYC.js";
10
+ } from "./chunk-QUFG5FRL.js";
11
11
 
12
12
  // src/headless-agent.ts
13
13
  import { createHash } from "crypto";
package/dist/src/index.js CHANGED
@@ -172,7 +172,7 @@ import {
172
172
  serializeCanvasContentResponse,
173
173
  shellQuotePosix,
174
174
  stripAgentDiagnosticErrors
175
- } from "./chunk-CHX75SYC.js";
175
+ } from "./chunk-QUFG5FRL.js";
176
176
 
177
177
  // src/index.ts
178
178
  import { serve } from "@hono/node-server";
@@ -11365,8 +11365,13 @@ var ChatService = class {
11365
11365
  return;
11366
11366
  }
11367
11367
  if (!chat.hasActiveTurn) {
11368
- await this.publishAgentTurnCompleteWebhook(chat);
11369
- return;
11368
+ const queuedMessageIds = new Set(chat.provider.getQueue().map((message) => message.id));
11369
+ const completedMessageId = chat.pendingMessageIds.find((messageId) => !queuedMessageIds.has(messageId));
11370
+ if (!completedMessageId) {
11371
+ await this.publishAgentTurnCompleteWebhook(chat);
11372
+ return;
11373
+ }
11374
+ chat.pendingMessageIds = chat.pendingMessageIds.filter((messageId) => messageId !== completedMessageId);
11370
11375
  }
11371
11376
  chat.hasActiveTurn = false;
11372
11377
  chat.activeMessageId = null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.641",
3
+ "version": "0.1.642",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",