replicas-engine 0.1.715 → 0.1.717
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/{chunk-LQ7KHFS5.js → chunk-7ZCPXUQ3.js} +1 -1
- package/dist/src/{chunk-UF32U5Z4.js → chunk-AIO4PUU7.js} +13 -1
- package/dist/src/{chunk-YXIUPTVT.js → chunk-R2MUWRL5.js} +2 -2
- package/dist/src/{chunk-TQQYZEKY.js → chunk-Z4EWBCBT.js} +1 -1
- package/dist/src/command-protection-hook.js +2 -2
- package/dist/src/deepseek-command-protection-plugin.js +3 -3
- package/dist/src/headless-agent.js +2 -2
- package/dist/src/index.js +16 -4
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/package.json +1 -1
|
@@ -3452,6 +3452,17 @@ function isTransientErrorText(text, options = {}) {
|
|
|
3452
3452
|
return false;
|
|
3453
3453
|
}
|
|
3454
3454
|
|
|
3455
|
+
// ../shared/src/auth-errors.ts
|
|
3456
|
+
var AUTHENTICATION_ERROR_PATTERNS = [
|
|
3457
|
+
/unauthorized/,
|
|
3458
|
+
/authentication error/,
|
|
3459
|
+
/invalid api key/
|
|
3460
|
+
];
|
|
3461
|
+
function isAuthenticationErrorText(text, extraPatterns = []) {
|
|
3462
|
+
const normalized = text.toLowerCase();
|
|
3463
|
+
return AUTHENTICATION_ERROR_PATTERNS.some((pattern) => pattern.test(normalized)) || extraPatterns.some((pattern) => pattern.test(normalized));
|
|
3464
|
+
}
|
|
3465
|
+
|
|
3455
3466
|
// ../shared/src/claude-auth.ts
|
|
3456
3467
|
function isClaudeAuthErrorText(text) {
|
|
3457
3468
|
const lower = text.toLowerCase();
|
|
@@ -3462,7 +3473,7 @@ function isClaudeAuthErrorText(text) {
|
|
|
3462
3473
|
function isCodexAuthError(error) {
|
|
3463
3474
|
const msg = error instanceof Error ? error.message : String(error);
|
|
3464
3475
|
const lower = msg.toLowerCase();
|
|
3465
|
-
return
|
|
3476
|
+
return isAuthenticationErrorText(msg) || lower.includes("authentication") || lower.includes("incorrect api key") || lower.includes("api key") && lower.includes("invalid") || lower.includes("401") || lower.includes('codexerrorinfo="unauthorized"') || lower.includes("codexerrorinfo=unauthorized") || lower.includes("failed to refresh token") || lower.includes("your session has ended");
|
|
3466
3477
|
}
|
|
3467
3478
|
|
|
3468
3479
|
// ../shared/src/version.ts
|
|
@@ -6734,6 +6745,7 @@ export {
|
|
|
6734
6745
|
headlessAgentRequestSchema,
|
|
6735
6746
|
extractErrorText,
|
|
6736
6747
|
isTransientErrorText,
|
|
6748
|
+
isAuthenticationErrorText,
|
|
6737
6749
|
isClaudeAuthErrorText,
|
|
6738
6750
|
isCodexAuthError,
|
|
6739
6751
|
isVersionBelow,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
HOOK_EXEC_MAX_BUFFER_BYTES,
|
|
4
4
|
isVersionBelow
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-AIO4PUU7.js";
|
|
6
6
|
|
|
7
7
|
// src/utils/presigned-upload.ts
|
|
8
8
|
import { createReadStream } from "fs";
|
|
@@ -267,7 +267,7 @@ var DEFAULT_CODEX_ARGS = [
|
|
|
267
267
|
var MIN_CODEX_CLI_VERSION = "0.144.6";
|
|
268
268
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
269
269
|
var codexCliVersionEnsured = null;
|
|
270
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
270
|
+
var ENGINE_PACKAGE_VERSION = "0.1.717";
|
|
271
271
|
var INITIALIZE_METHOD = "initialize";
|
|
272
272
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
273
273
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
evaluateCommandProtection
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Z4EWBCBT.js";
|
|
5
5
|
import {
|
|
6
6
|
isRecord
|
|
7
7
|
} from "./chunk-2RB7SIP3.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-AIO4PUU7.js";
|
|
9
9
|
|
|
10
10
|
// src/command-protection-hook.ts
|
|
11
11
|
var provider = process.argv[2];
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
evaluateCommandProtection
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-Z4EWBCBT.js";
|
|
5
5
|
import {
|
|
6
6
|
notifyPostToolUse
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-7ZCPXUQ3.js";
|
|
8
8
|
import "./chunk-2RB7SIP3.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-AIO4PUU7.js";
|
|
10
10
|
|
|
11
11
|
// src/deepseek-command-protection-plugin.ts
|
|
12
12
|
function replicasCommandProtection(context) {
|
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
buildCodexAgentEnv,
|
|
5
5
|
putPresignedFile,
|
|
6
6
|
recoverCompletedTurn
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-R2MUWRL5.js";
|
|
8
8
|
import {
|
|
9
9
|
AGENT,
|
|
10
10
|
getMemoryOutputSafetyViolation,
|
|
11
11
|
headlessAgentRequestSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-AIO4PUU7.js";
|
|
13
13
|
|
|
14
14
|
// src/headless-agent.ts
|
|
15
15
|
import { createHash } from "crypto";
|
package/dist/src/index.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
monolithService,
|
|
9
9
|
reportCommandProtectionBlock,
|
|
10
10
|
setAgentCredentialSnapshot
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-Z4EWBCBT.js";
|
|
12
12
|
import {
|
|
13
13
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
14
14
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
execFileAsync,
|
|
36
36
|
putPresignedFile,
|
|
37
37
|
recoverCompletedTurn
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-R2MUWRL5.js";
|
|
39
39
|
import {
|
|
40
40
|
isRecord as isRecord2
|
|
41
41
|
} from "./chunk-2RB7SIP3.js";
|
|
@@ -166,6 +166,7 @@ import {
|
|
|
166
166
|
isAgentChatMcpActivityRecord,
|
|
167
167
|
isAgentChatSkillActivityRecord,
|
|
168
168
|
isAgentChatTurnActivityRecord,
|
|
169
|
+
isAuthenticationErrorText,
|
|
169
170
|
isCanvasTextKind,
|
|
170
171
|
isChatMessageSender,
|
|
171
172
|
isClaudeAuthErrorText,
|
|
@@ -213,7 +214,7 @@ import {
|
|
|
213
214
|
shellQuotePosix,
|
|
214
215
|
stripAgentDiagnosticErrors,
|
|
215
216
|
withTimeout
|
|
216
|
-
} from "./chunk-
|
|
217
|
+
} from "./chunk-AIO4PUU7.js";
|
|
217
218
|
|
|
218
219
|
// src/index.ts
|
|
219
220
|
import { serve } from "@hono/node-server";
|
|
@@ -8020,6 +8021,9 @@ var CURSOR_TRANSPORT_ERROR_PATTERNS = [
|
|
|
8020
8021
|
function isCursorTransportError(text) {
|
|
8021
8022
|
return isTransientErrorText(text, { extraPatterns: CURSOR_TRANSPORT_ERROR_PATTERNS });
|
|
8022
8023
|
}
|
|
8024
|
+
function isCursorAuthenticationError(text) {
|
|
8025
|
+
return isAuthenticationErrorText(text, [/error_not_logged_in/]);
|
|
8026
|
+
}
|
|
8023
8027
|
function finiteNumber(value) {
|
|
8024
8028
|
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
8025
8029
|
}
|
|
@@ -8287,7 +8291,15 @@ var CursorManager = class extends CodingAgentManager {
|
|
|
8287
8291
|
detail: failure.text,
|
|
8288
8292
|
transport: failure.transport
|
|
8289
8293
|
});
|
|
8290
|
-
const
|
|
8294
|
+
const credentialScope = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.cursor?.scope;
|
|
8295
|
+
const credentialLabel = credentialScope === "user" ? "personal API key or account" : credentialScope === "org" ? "organization API key or account" : "configured API key or account";
|
|
8296
|
+
const authenticationMessage = isCursorAuthenticationError(failure.text) ? [
|
|
8297
|
+
`Cursor rejected the ${credentialLabel} for this request.`,
|
|
8298
|
+
"Logging out and back in does not replace the Cursor API key stored in Replicas.",
|
|
8299
|
+
"Update it in Settings \u2192 Coding Agents before starting a new workspace.",
|
|
8300
|
+
failure.requestId ? `If a fresh key still fails, contact Cursor support with request ID ${failure.requestId}.` : ""
|
|
8301
|
+
].filter(Boolean).join(" ") : null;
|
|
8302
|
+
const displayMessage = failure.transport ? sawCursorActivity ? "Cursor couldn't reconnect after its automatic retries. Retry the message to continue from the same chat." : run ? "Cursor couldn't connect after its automatic retries. Retry the message or start a new Cursor chat if the problem continues." : "The connection to Cursor failed. Retry the message or start a new Cursor chat if the problem continues." : authenticationMessage ?? failure.text;
|
|
8291
8303
|
if (failure.transport) {
|
|
8292
8304
|
this.activeRun = null;
|
|
8293
8305
|
this.closeAgent();
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
notifyPostToolUse
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-7ZCPXUQ3.js";
|
|
5
5
|
import {
|
|
6
6
|
isRecord
|
|
7
7
|
} from "./chunk-2RB7SIP3.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-AIO4PUU7.js";
|
|
9
9
|
|
|
10
10
|
// src/post-tool-pr-hook.ts
|
|
11
11
|
async function main() {
|