replicas-engine 0.1.646 → 0.1.648

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.
@@ -5645,6 +5645,9 @@ var memoryGenerationManifestSchema = z6.object({
5645
5645
  rolloutSources: z6.record(z6.string(), z6.string()).optional()
5646
5646
  });
5647
5647
 
5648
+ // ../shared/src/chat-transcript-pages.ts
5649
+ var decoder = new TextDecoder("utf-8", { fatal: true });
5650
+
5648
5651
  // ../shared/src/skill-registry.ts
5649
5652
  var SKILL_REGISTRY_MANIFEST_VERSION = 1;
5650
5653
  function isSkillRegistryManifest(value) {
@@ -5919,7 +5922,7 @@ var DEFAULT_CODEX_ARGS = [
5919
5922
  var MIN_CODEX_CLI_VERSION = "0.144.6";
5920
5923
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
5921
5924
  var codexCliVersionEnsured = null;
5922
- var ENGINE_PACKAGE_VERSION = "0.1.646";
5925
+ var ENGINE_PACKAGE_VERSION = "0.1.648";
5923
5926
  var INITIALIZE_METHOD = "initialize";
5924
5927
  var INITIALIZED_NOTIFICATION = "initialized";
5925
5928
  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-VFNHX5RC.js";
10
+ } from "./chunk-UOZJPW3V.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-VFNHX5RC.js";
175
+ } from "./chunk-UOZJPW3V.js";
176
176
 
177
177
  // src/index.ts
178
178
  import { serve } from "@hono/node-server";
@@ -10936,9 +10936,28 @@ var ChatService = class {
10936
10936
  queue: chat.provider.getQueue()
10937
10937
  };
10938
10938
  }
10939
+ // A message removed from the queue will never run a turn, so its pending
10940
+ // bookkeeping must go with it or hasActiveChatTurn stays true forever.
10941
+ forgetPendingMessages(chat, messageIds) {
10942
+ if (messageIds.length === 0) return;
10943
+ const removed = new Set(messageIds);
10944
+ chat.pendingMessageIds = chat.pendingMessageIds.filter((messageId) => !removed.has(messageId));
10945
+ for (const messageId of removed) {
10946
+ chat.acceptedUserEvents.delete(messageId);
10947
+ chat.errorNotificationTargets.delete(messageId);
10948
+ }
10949
+ this.publish({
10950
+ type: "chat.updated",
10951
+ payload: { chat: this.toSummary(chat) }
10952
+ }).catch(() => {
10953
+ });
10954
+ }
10939
10955
  removeFromQueue(chatId, messageId) {
10940
10956
  const chat = this.requireChat(chatId);
10941
10957
  const success = chat.provider.removeFromQueue(messageId);
10958
+ if (success) {
10959
+ this.forgetPendingMessages(chat, [messageId]);
10960
+ }
10942
10961
  return {
10943
10962
  success,
10944
10963
  queue: chat.provider.getQueue()
@@ -10946,7 +10965,11 @@ var ChatService = class {
10946
10965
  }
10947
10966
  clearQueue(chatId) {
10948
10967
  const chat = this.requireChat(chatId);
10968
+ const queuedIds = chat.provider.getQueue().map((message) => message.id);
10949
10969
  const success = chat.provider.clearQueue();
10970
+ if (success) {
10971
+ this.forgetPendingMessages(chat, queuedIds);
10972
+ }
10950
10973
  return {
10951
10974
  success,
10952
10975
  queue: chat.provider.getQueue()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.646",
3
+ "version": "0.1.648",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",