replicas-engine 0.1.664 → 0.1.665

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.
@@ -6332,7 +6332,7 @@ var DEFAULT_CODEX_ARGS = [
6332
6332
  var MIN_CODEX_CLI_VERSION = "0.144.6";
6333
6333
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
6334
6334
  var codexCliVersionEnsured = null;
6335
- var ENGINE_PACKAGE_VERSION = "0.1.664";
6335
+ var ENGINE_PACKAGE_VERSION = "0.1.665";
6336
6336
  var INITIALIZE_METHOD = "initialize";
6337
6337
  var INITIALIZED_NOTIFICATION = "initialized";
6338
6338
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -7,7 +7,7 @@ import {
7
7
  headlessAgentRequestSchema,
8
8
  putPresignedFile,
9
9
  recoverCompletedTurn
10
- } from "./chunk-L4RE37PJ.js";
10
+ } from "./chunk-SBJ4HUPK.js";
11
11
 
12
12
  // src/headless-agent.ts
13
13
  import { createHash } from "crypto";
package/dist/src/index.js CHANGED
@@ -186,7 +186,7 @@ import {
186
186
  serializeCanvasContentResponse,
187
187
  shellQuotePosix,
188
188
  stripAgentDiagnosticErrors
189
- } from "./chunk-L4RE37PJ.js";
189
+ } from "./chunk-SBJ4HUPK.js";
190
190
 
191
191
  // src/index.ts
192
192
  import { serve } from "@hono/node-server";
@@ -6482,15 +6482,9 @@ var CodexAspManager = class extends CodingAgentManager {
6482
6482
  this.initializeManager(this.processMessageInternal.bind(this));
6483
6483
  }
6484
6484
  async initialize() {
6485
- if (this.initialSessionId) {
6486
- this.currentThreadId = this.initialSessionId;
6487
- return;
6488
- }
6489
6485
  const replayed = await this.historyFile?.load();
6490
- if (replayed) {
6491
- if (replayed.transcript) {
6492
- this.mergeTranscriptSnapshot(replayed.transcript);
6493
- }
6486
+ if (replayed?.transcript && (!this.initialSessionId || replayed.transcript.threadId === this.initialSessionId)) {
6487
+ this.mergeTranscriptSnapshot(replayed.transcript);
6494
6488
  }
6495
6489
  this.currentThreadId = this.initialSessionId ?? replayed?.transcript?.threadId ?? null;
6496
6490
  }
@@ -6647,16 +6641,22 @@ var CodexAspManager = class extends CodingAgentManager {
6647
6641
  itemsView: "full"
6648
6642
  }
6649
6643
  );
6650
- const transcript = turnsToAspTranscript(
6644
+ const nativeTranscript = turnsToAspTranscript(
6651
6645
  this.currentThreadId,
6652
6646
  (/* @__PURE__ */ new Date()).toISOString(),
6653
6647
  response.data
6654
6648
  );
6655
- if (cursor === void 0) {
6656
- this.codexAspTranscript = transcript;
6657
- this.syncTranscriptSequence(transcript);
6658
- }
6659
- return { transcript, before: response.nextCursor };
6649
+ const mergedTranscript = mergeCodexAspTranscripts(this.codexAspTranscript, nativeTranscript) ?? nativeTranscript;
6650
+ this.codexAspTranscript = mergedTranscript;
6651
+ this.syncTranscriptSequence(mergedTranscript);
6652
+ const turnIds = new Set(response.data.map((turn) => turn.id));
6653
+ return {
6654
+ transcript: {
6655
+ ...mergedTranscript,
6656
+ turns: mergedTranscript.turns.filter((turn) => turnIds.has(turn.id))
6657
+ },
6658
+ before: response.nextCursor
6659
+ };
6660
6660
  }
6661
6661
  getGoal() {
6662
6662
  return this.currentGoal;
@@ -6723,6 +6723,7 @@ var CodexAspManager = class extends CodingAgentManager {
6723
6723
  this.recordCodexHistoryEvent("event_msg", {
6724
6724
  type: "user_message",
6725
6725
  message: request.message,
6726
+ ...request.messageId ? { [USER_MESSAGE_ID_PAYLOAD_KEY]: request.messageId } : {},
6726
6727
  ...images ? { images } : {},
6727
6728
  ...extraPayload
6728
6729
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.664",
3
+ "version": "0.1.665",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",