replicas-engine 0.1.460 → 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.
- package/dist/src/index.js +37 -13
- 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-
|
|
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;
|
|
@@ -6774,6 +6786,15 @@ var CodingAgentManager = class {
|
|
|
6774
6786
|
};
|
|
6775
6787
|
|
|
6776
6788
|
// src/utils/agent-env.ts
|
|
6789
|
+
function resolveClaudeAuthMethodForMessage(env = ENGINE_ENV) {
|
|
6790
|
+
const method = env.REPLICAS_CLAUDE_AUTH_METHOD;
|
|
6791
|
+
if (method && method !== "none") {
|
|
6792
|
+
return method;
|
|
6793
|
+
}
|
|
6794
|
+
if (env.CLAUDE_CODE_USE_BEDROCK === "1") return "bedrock";
|
|
6795
|
+
if (env.ANTHROPIC_API_KEY) return "api_key";
|
|
6796
|
+
return "unknown";
|
|
6797
|
+
}
|
|
6777
6798
|
function buildClaudeAgentEnv(overrides) {
|
|
6778
6799
|
const env = { ...process.env };
|
|
6779
6800
|
if (overrides) {
|
|
@@ -7790,7 +7811,7 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
7790
7811
|
);
|
|
7791
7812
|
}
|
|
7792
7813
|
claudeAuthFailureMessage() {
|
|
7793
|
-
switch (
|
|
7814
|
+
switch (resolveClaudeAuthMethodForMessage()) {
|
|
7794
7815
|
case "oauth":
|
|
7795
7816
|
return "Claude Code OAuth authentication failed after refreshing credentials. Reconnect Claude Code in Settings \u2192 Agents and try again.";
|
|
7796
7817
|
case "api_key":
|
|
@@ -7803,14 +7824,6 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
7803
7824
|
return "Claude authentication failed after multiple attempts. Check your Claude, Anthropic API key, or Bedrock credentials in Settings \u2192 Agents and try again.";
|
|
7804
7825
|
}
|
|
7805
7826
|
}
|
|
7806
|
-
resolveClaudeAuthMethodForMessage() {
|
|
7807
|
-
if (ENGINE_ENV.REPLICAS_CLAUDE_AUTH_METHOD === "oauth" || ENGINE_ENV.REPLICAS_CLAUDE_AUTH_METHOD === "api_key" || ENGINE_ENV.REPLICAS_CLAUDE_AUTH_METHOD === "bedrock" || ENGINE_ENV.REPLICAS_CLAUDE_AUTH_METHOD === "foundry") {
|
|
7808
|
-
return ENGINE_ENV.REPLICAS_CLAUDE_AUTH_METHOD;
|
|
7809
|
-
}
|
|
7810
|
-
if (ENGINE_ENV.CLAUDE_CODE_USE_BEDROCK === "1" || ENGINE_ENV.AWS_ACCESS_KEY_ID || ENGINE_ENV.AWS_SECRET_ACCESS_KEY) return "bedrock";
|
|
7811
|
-
if (ENGINE_ENV.ANTHROPIC_API_KEY) return "api_key";
|
|
7812
|
-
return "unknown";
|
|
7813
|
-
}
|
|
7814
7827
|
async emitMidTurnExhaustedEvent(error) {
|
|
7815
7828
|
const detail = error instanceof Error ? error.message : String(error);
|
|
7816
7829
|
await this.emitTerminalErrorResult(
|
|
@@ -8604,7 +8617,7 @@ var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
|
|
|
8604
8617
|
var MIN_CODEX_CLI_VERSION = "0.144.0";
|
|
8605
8618
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
8606
8619
|
var codexCliVersionEnsured = null;
|
|
8607
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
8620
|
+
var ENGINE_PACKAGE_VERSION = "0.1.462";
|
|
8608
8621
|
var INITIALIZE_METHOD = "initialize";
|
|
8609
8622
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
8610
8623
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -13501,7 +13514,8 @@ var ChatService = class {
|
|
|
13501
13514
|
acceptedSendResponses: /* @__PURE__ */ new Map(),
|
|
13502
13515
|
activeMessageId: null,
|
|
13503
13516
|
hasActiveTurn: false,
|
|
13504
|
-
observedBranchesByRepo: /* @__PURE__ */ new Map()
|
|
13517
|
+
observedBranchesByRepo: /* @__PURE__ */ new Map(),
|
|
13518
|
+
lastTurnErrors: null
|
|
13505
13519
|
};
|
|
13506
13520
|
}
|
|
13507
13521
|
touch(chat) {
|
|
@@ -13555,6 +13569,10 @@ var ChatService = class {
|
|
|
13555
13569
|
}).catch(() => {
|
|
13556
13570
|
});
|
|
13557
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
|
+
}
|
|
13558
13576
|
let eventToPublish = event;
|
|
13559
13577
|
if (event.type === "event_msg" && event.payload.type === "user_message") {
|
|
13560
13578
|
if (chat.activeMessageId) {
|
|
@@ -13726,6 +13744,8 @@ var ChatService = class {
|
|
|
13726
13744
|
const linearSessionId = ENGINE_ENV.LINEAR_SESSION_ID;
|
|
13727
13745
|
const observedBranches = chat.observedBranchesByRepo;
|
|
13728
13746
|
chat.observedBranchesByRepo = /* @__PURE__ */ new Map();
|
|
13747
|
+
const errors = chat.persisted.parentChatId === null ? chat.lastTurnErrors : null;
|
|
13748
|
+
chat.lastTurnErrors = null;
|
|
13729
13749
|
let repoStatuses = [];
|
|
13730
13750
|
let repoStateComplete = false;
|
|
13731
13751
|
try {
|
|
@@ -13742,7 +13762,11 @@ var ChatService = class {
|
|
|
13742
13762
|
});
|
|
13743
13763
|
}
|
|
13744
13764
|
try {
|
|
13745
|
-
const payload =
|
|
13765
|
+
const payload = {
|
|
13766
|
+
...linearSessionId ? { linearSessionId } : {},
|
|
13767
|
+
repoStatuses,
|
|
13768
|
+
...errors?.length ? { errors } : {}
|
|
13769
|
+
};
|
|
13746
13770
|
await monolithService.sendEvent({ type: "agent_turn_complete", payload });
|
|
13747
13771
|
} catch (error) {
|
|
13748
13772
|
console.error("[ChatService] Failed to send agent_turn_complete event:", error);
|