replicas-engine 0.1.461 → 0.1.462

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 -4
  2. package/package.json +1 -1
package/dist/src/index.js CHANGED
@@ -543,7 +543,7 @@ var WORKSPACE_SIZES = ["small", "large"];
543
543
  var INVALID_WORKSPACE_SIZE_ERROR = `Invalid size: must be one of ${WORKSPACE_SIZES.join(", ")}`;
544
544
 
545
545
  // ../shared/src/e2b.ts
546
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-19-v13";
546
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-19-v14";
547
547
 
548
548
  // ../shared/src/runtime-env.ts
549
549
  function shellQuotePosix(value) {
@@ -3281,6 +3281,18 @@ var TaskAccumulator = class {
3281
3281
  }
3282
3282
  };
3283
3283
 
3284
+ // ../shared/src/display-message/parsers/claude-parser.ts
3285
+ function coerceClaudeResultPayload(payload) {
3286
+ return {
3287
+ is_error: typeof payload.is_error === "boolean" ? payload.is_error : void 0,
3288
+ subtype: typeof payload.subtype === "string" ? payload.subtype : void 0,
3289
+ errors: Array.isArray(payload.errors) ? payload.errors.filter((e) => typeof e === "string") : void 0
3290
+ };
3291
+ }
3292
+ function isClaudeResultError(payload) {
3293
+ return Boolean(payload.is_error) || payload.subtype !== "success";
3294
+ }
3295
+
3284
3296
  // ../shared/src/agent-event-utils.ts
3285
3297
  function getUserMessage(event) {
3286
3298
  return event.type === "event_msg" && event.payload.type === "user_message" && typeof event.payload.message === "string" ? event.payload.message : null;
@@ -8605,7 +8617,7 @@ var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
8605
8617
  var MIN_CODEX_CLI_VERSION = "0.144.0";
8606
8618
  var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
8607
8619
  var codexCliVersionEnsured = null;
8608
- var ENGINE_PACKAGE_VERSION = "0.1.461";
8620
+ var ENGINE_PACKAGE_VERSION = "0.1.462";
8609
8621
  var INITIALIZE_METHOD = "initialize";
8610
8622
  var INITIALIZED_NOTIFICATION = "initialized";
8611
8623
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
@@ -13502,7 +13514,8 @@ var ChatService = class {
13502
13514
  acceptedSendResponses: /* @__PURE__ */ new Map(),
13503
13515
  activeMessageId: null,
13504
13516
  hasActiveTurn: false,
13505
- observedBranchesByRepo: /* @__PURE__ */ new Map()
13517
+ observedBranchesByRepo: /* @__PURE__ */ new Map(),
13518
+ lastTurnErrors: null
13506
13519
  };
13507
13520
  }
13508
13521
  touch(chat) {
@@ -13556,6 +13569,10 @@ var ChatService = class {
13556
13569
  }).catch(() => {
13557
13570
  });
13558
13571
  }
13572
+ if (event.type === "claude-result") {
13573
+ const payload = coerceClaudeResultPayload(event.payload);
13574
+ chat.lastTurnErrors = isClaudeResultError(payload) && payload.errors?.length ? payload.errors : null;
13575
+ }
13559
13576
  let eventToPublish = event;
13560
13577
  if (event.type === "event_msg" && event.payload.type === "user_message") {
13561
13578
  if (chat.activeMessageId) {
@@ -13727,6 +13744,8 @@ var ChatService = class {
13727
13744
  const linearSessionId = ENGINE_ENV.LINEAR_SESSION_ID;
13728
13745
  const observedBranches = chat.observedBranchesByRepo;
13729
13746
  chat.observedBranchesByRepo = /* @__PURE__ */ new Map();
13747
+ const errors = chat.persisted.parentChatId === null ? chat.lastTurnErrors : null;
13748
+ chat.lastTurnErrors = null;
13730
13749
  let repoStatuses = [];
13731
13750
  let repoStateComplete = false;
13732
13751
  try {
@@ -13743,7 +13762,11 @@ var ChatService = class {
13743
13762
  });
13744
13763
  }
13745
13764
  try {
13746
- const payload = linearSessionId ? { linearSessionId, repoStatuses } : { repoStatuses };
13765
+ const payload = {
13766
+ ...linearSessionId ? { linearSessionId } : {},
13767
+ repoStatuses,
13768
+ ...errors?.length ? { errors } : {}
13769
+ };
13747
13770
  await monolithService.sendEvent({ type: "agent_turn_complete", payload });
13748
13771
  } catch (error) {
13749
13772
  console.error("[ChatService] Failed to send agent_turn_complete event:", error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.461",
3
+ "version": "0.1.462",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",