replicas-engine 0.1.716 → 0.1.718
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-UF32U5Z4.js → chunk-4IGJRCPV.js} +25 -4
- package/dist/src/{chunk-TQQYZEKY.js → chunk-GTTGFFX4.js} +1 -1
- package/dist/src/{chunk-LQ7KHFS5.js → chunk-P554JDNI.js} +1 -1
- package/dist/src/{chunk-6KPIG34S.js → chunk-SWDXL3BP.js} +2 -2
- 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 +21 -5
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/package.json +2 -2
|
@@ -318,11 +318,13 @@ function isDefaultChat(chat) {
|
|
|
318
318
|
}
|
|
319
319
|
var CLAUDE_OPUS_1M_MODEL = "opus[1m]";
|
|
320
320
|
var LEGACY_CLAUDE_OPUS_1M_MODEL = "opus-1m";
|
|
321
|
+
var CLAUDE_FABLE_5_1_MODEL = "claude-fable-5-1";
|
|
321
322
|
var CLAUDE_FABLE_5_MODEL = "claude-fable-5";
|
|
322
323
|
var CLAUDE_OPUS_5_MODEL = "claude-opus-5";
|
|
323
324
|
var CLAUDE_OPUS_4_8_MODEL = "claude-opus-4-8";
|
|
324
325
|
var CLAUDE_SONNET_5_MODEL = "claude-sonnet-5";
|
|
325
326
|
var CLAUDE_HAIKU_4_5_MODEL = "claude-haiku-4-5";
|
|
327
|
+
var CLAUDE_FABLE_5_1_BEDROCK_MODEL = "anthropic.claude-fable-5-1";
|
|
326
328
|
var CLAUDE_FABLE_5_BEDROCK_MODEL = "anthropic.claude-fable-5";
|
|
327
329
|
var CLAUDE_OPUS_5_BEDROCK_MODEL = "anthropic.claude-opus-5";
|
|
328
330
|
var CLAUDE_OPUS_4_8_BEDROCK_MODEL = "us.anthropic.claude-opus-4-8";
|
|
@@ -380,7 +382,7 @@ function normalizeClaudeModel(model) {
|
|
|
380
382
|
return DEFAULT_CLAUDE_MODEL;
|
|
381
383
|
}
|
|
382
384
|
if (model === "fable") {
|
|
383
|
-
return
|
|
385
|
+
return CLAUDE_FABLE_5_1_MODEL;
|
|
384
386
|
}
|
|
385
387
|
if (model === "sonnet") {
|
|
386
388
|
return CLAUDE_SONNET_5_MODEL;
|
|
@@ -391,11 +393,13 @@ function normalizeClaudeModel(model) {
|
|
|
391
393
|
return model;
|
|
392
394
|
}
|
|
393
395
|
var CLAUDE_MODEL_CONTEXT_WINDOWS = {
|
|
396
|
+
[CLAUDE_FABLE_5_1_MODEL]: 1e6,
|
|
394
397
|
[CLAUDE_FABLE_5_MODEL]: 1e6,
|
|
395
398
|
[CLAUDE_OPUS_5_MODEL]: 1e6,
|
|
396
399
|
[CLAUDE_OPUS_4_8_MODEL]: 1e6,
|
|
397
400
|
[CLAUDE_SONNET_5_MODEL]: 1e6,
|
|
398
401
|
[CLAUDE_HAIKU_4_5_MODEL]: 2e5,
|
|
402
|
+
[CLAUDE_FABLE_5_1_BEDROCK_MODEL]: 1e6,
|
|
399
403
|
[CLAUDE_FABLE_5_BEDROCK_MODEL]: 1e6,
|
|
400
404
|
[CLAUDE_OPUS_5_BEDROCK_MODEL]: 1e6,
|
|
401
405
|
[CLAUDE_OPUS_4_8_BEDROCK_MODEL]: 1e6,
|
|
@@ -418,6 +422,7 @@ function canUseClaudeFastMode(model) {
|
|
|
418
422
|
}
|
|
419
423
|
var AGENT_MODELS = {
|
|
420
424
|
claude: [
|
|
425
|
+
CLAUDE_FABLE_5_1_MODEL,
|
|
421
426
|
CLAUDE_FABLE_5_MODEL,
|
|
422
427
|
CLAUDE_OPUS_5_MODEL,
|
|
423
428
|
CLAUDE_OPUS_4_8_MODEL,
|
|
@@ -426,6 +431,7 @@ var AGENT_MODELS = {
|
|
|
426
431
|
],
|
|
427
432
|
codex: [DEFAULT_CODEX_MODEL, GPT_5_6_TERRA_MODEL, GPT_5_6_LUNA_MODEL, "gpt-5.5", "gpt-5.4", "gpt-5.4-mini", "gpt-5.2"],
|
|
428
433
|
cursor: [
|
|
434
|
+
CLAUDE_FABLE_5_1_MODEL,
|
|
429
435
|
CLAUDE_FABLE_5_MODEL,
|
|
430
436
|
CLAUDE_OPUS_5_MODEL,
|
|
431
437
|
CLAUDE_OPUS_4_8_MODEL,
|
|
@@ -459,14 +465,15 @@ var AGENT_MODELS = {
|
|
|
459
465
|
kimi: [DEFAULT_KIMI_MODEL],
|
|
460
466
|
opencode: [...OPENROUTER_MODELS, ...ASTER_MODELS],
|
|
461
467
|
pi: [...OPENROUTER_MODELS, ...ASTER_MODELS],
|
|
462
|
-
relay: [CLAUDE_FABLE_5_MODEL, CLAUDE_OPUS_5_MODEL, CLAUDE_OPUS_4_8_MODEL, CLAUDE_SONNET_5_MODEL]
|
|
468
|
+
relay: [CLAUDE_FABLE_5_1_MODEL, CLAUDE_FABLE_5_MODEL, CLAUDE_OPUS_5_MODEL, CLAUDE_OPUS_4_8_MODEL, CLAUDE_SONNET_5_MODEL]
|
|
463
469
|
};
|
|
464
470
|
function getAgentModelOptions(provider, overrides) {
|
|
465
471
|
const override = overrides?.[provider];
|
|
466
472
|
return override?.length ? override : AGENT_MODELS[provider];
|
|
467
473
|
}
|
|
468
474
|
var MODEL_LABELS = {
|
|
469
|
-
fable: "Fable 5",
|
|
475
|
+
fable: "Fable 5.1",
|
|
476
|
+
[CLAUDE_FABLE_5_1_MODEL]: "Fable 5.1",
|
|
470
477
|
[CLAUDE_FABLE_5_MODEL]: "Fable 5",
|
|
471
478
|
sonnet: "Sonnet 5",
|
|
472
479
|
"claude-sonnet-5": "Sonnet 5",
|
|
@@ -3452,6 +3459,17 @@ function isTransientErrorText(text, options = {}) {
|
|
|
3452
3459
|
return false;
|
|
3453
3460
|
}
|
|
3454
3461
|
|
|
3462
|
+
// ../shared/src/auth-errors.ts
|
|
3463
|
+
var AUTHENTICATION_ERROR_PATTERNS = [
|
|
3464
|
+
/unauthorized/,
|
|
3465
|
+
/authentication error/,
|
|
3466
|
+
/invalid api key/
|
|
3467
|
+
];
|
|
3468
|
+
function isAuthenticationErrorText(text, extraPatterns = []) {
|
|
3469
|
+
const normalized = text.toLowerCase();
|
|
3470
|
+
return AUTHENTICATION_ERROR_PATTERNS.some((pattern) => pattern.test(normalized)) || extraPatterns.some((pattern) => pattern.test(normalized));
|
|
3471
|
+
}
|
|
3472
|
+
|
|
3455
3473
|
// ../shared/src/claude-auth.ts
|
|
3456
3474
|
function isClaudeAuthErrorText(text) {
|
|
3457
3475
|
const lower = text.toLowerCase();
|
|
@@ -3462,7 +3480,7 @@ function isClaudeAuthErrorText(text) {
|
|
|
3462
3480
|
function isCodexAuthError(error) {
|
|
3463
3481
|
const msg = error instanceof Error ? error.message : String(error);
|
|
3464
3482
|
const lower = msg.toLowerCase();
|
|
3465
|
-
return
|
|
3483
|
+
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
3484
|
}
|
|
3467
3485
|
|
|
3468
3486
|
// ../shared/src/version.ts
|
|
@@ -6663,11 +6681,13 @@ export {
|
|
|
6663
6681
|
ASTER_MODEL_LABELS,
|
|
6664
6682
|
DEFAULT_CHAT_TITLES,
|
|
6665
6683
|
isDefaultChat,
|
|
6684
|
+
CLAUDE_FABLE_5_1_MODEL,
|
|
6666
6685
|
CLAUDE_FABLE_5_MODEL,
|
|
6667
6686
|
CLAUDE_OPUS_5_MODEL,
|
|
6668
6687
|
CLAUDE_OPUS_4_8_MODEL,
|
|
6669
6688
|
CLAUDE_SONNET_5_MODEL,
|
|
6670
6689
|
CLAUDE_HAIKU_4_5_MODEL,
|
|
6690
|
+
CLAUDE_FABLE_5_1_BEDROCK_MODEL,
|
|
6671
6691
|
CLAUDE_FABLE_5_BEDROCK_MODEL,
|
|
6672
6692
|
CLAUDE_OPUS_5_BEDROCK_MODEL,
|
|
6673
6693
|
CLAUDE_OPUS_4_8_BEDROCK_MODEL,
|
|
@@ -6734,6 +6754,7 @@ export {
|
|
|
6734
6754
|
headlessAgentRequestSchema,
|
|
6735
6755
|
extractErrorText,
|
|
6736
6756
|
isTransientErrorText,
|
|
6757
|
+
isAuthenticationErrorText,
|
|
6737
6758
|
isClaudeAuthErrorText,
|
|
6738
6759
|
isCodexAuthError,
|
|
6739
6760
|
isVersionBelow,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
HOOK_EXEC_MAX_BUFFER_BYTES,
|
|
4
4
|
isVersionBelow
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-4IGJRCPV.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.718";
|
|
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-GTTGFFX4.js";
|
|
5
5
|
import {
|
|
6
6
|
isRecord
|
|
7
7
|
} from "./chunk-2RB7SIP3.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-4IGJRCPV.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-GTTGFFX4.js";
|
|
5
5
|
import {
|
|
6
6
|
notifyPostToolUse
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-P554JDNI.js";
|
|
8
8
|
import "./chunk-2RB7SIP3.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-4IGJRCPV.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-SWDXL3BP.js";
|
|
8
8
|
import {
|
|
9
9
|
AGENT,
|
|
10
10
|
getMemoryOutputSafetyViolation,
|
|
11
11
|
headlessAgentRequestSchema
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4IGJRCPV.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-GTTGFFX4.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-SWDXL3BP.js";
|
|
39
39
|
import {
|
|
40
40
|
isRecord as isRecord2
|
|
41
41
|
} from "./chunk-2RB7SIP3.js";
|
|
@@ -54,6 +54,8 @@ import {
|
|
|
54
54
|
CHAT_INTERRUPTED_EVENT_TYPE,
|
|
55
55
|
CLAUDE_AUTH_ENV_KEYS,
|
|
56
56
|
CLAUDE_AUTH_ENV_KEYS_BY_METHOD,
|
|
57
|
+
CLAUDE_FABLE_5_1_BEDROCK_MODEL,
|
|
58
|
+
CLAUDE_FABLE_5_1_MODEL,
|
|
57
59
|
CLAUDE_FABLE_5_BEDROCK_MODEL,
|
|
58
60
|
CLAUDE_FABLE_5_MODEL,
|
|
59
61
|
CLAUDE_HAIKU_4_5_BEDROCK_MODEL,
|
|
@@ -166,6 +168,7 @@ import {
|
|
|
166
168
|
isAgentChatMcpActivityRecord,
|
|
167
169
|
isAgentChatSkillActivityRecord,
|
|
168
170
|
isAgentChatTurnActivityRecord,
|
|
171
|
+
isAuthenticationErrorText,
|
|
169
172
|
isCanvasTextKind,
|
|
170
173
|
isChatMessageSender,
|
|
171
174
|
isClaudeAuthErrorText,
|
|
@@ -213,7 +216,7 @@ import {
|
|
|
213
216
|
shellQuotePosix,
|
|
214
217
|
stripAgentDiagnosticErrors,
|
|
215
218
|
withTimeout
|
|
216
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-4IGJRCPV.js";
|
|
217
220
|
|
|
218
221
|
// src/index.ts
|
|
219
222
|
import { serve } from "@hono/node-server";
|
|
@@ -4475,6 +4478,8 @@ function toClaudeCodeModel(model) {
|
|
|
4475
4478
|
return model;
|
|
4476
4479
|
}
|
|
4477
4480
|
switch (normalizeClaudeModel(model)) {
|
|
4481
|
+
case CLAUDE_FABLE_5_1_MODEL:
|
|
4482
|
+
return CLAUDE_FABLE_5_1_BEDROCK_MODEL;
|
|
4478
4483
|
case CLAUDE_FABLE_5_MODEL:
|
|
4479
4484
|
return CLAUDE_FABLE_5_BEDROCK_MODEL;
|
|
4480
4485
|
case CLAUDE_OPUS_5_MODEL:
|
|
@@ -8020,6 +8025,9 @@ var CURSOR_TRANSPORT_ERROR_PATTERNS = [
|
|
|
8020
8025
|
function isCursorTransportError(text) {
|
|
8021
8026
|
return isTransientErrorText(text, { extraPatterns: CURSOR_TRANSPORT_ERROR_PATTERNS });
|
|
8022
8027
|
}
|
|
8028
|
+
function isCursorAuthenticationError(text) {
|
|
8029
|
+
return isAuthenticationErrorText(text, [/error_not_logged_in/]);
|
|
8030
|
+
}
|
|
8023
8031
|
function finiteNumber(value) {
|
|
8024
8032
|
return typeof value === "number" && Number.isFinite(value) ? value : 0;
|
|
8025
8033
|
}
|
|
@@ -8287,7 +8295,15 @@ var CursorManager = class extends CodingAgentManager {
|
|
|
8287
8295
|
detail: failure.text,
|
|
8288
8296
|
transport: failure.transport
|
|
8289
8297
|
});
|
|
8290
|
-
const
|
|
8298
|
+
const credentialScope = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.cursor?.scope;
|
|
8299
|
+
const credentialLabel = credentialScope === "user" ? "personal API key or account" : credentialScope === "org" ? "organization API key or account" : "configured API key or account";
|
|
8300
|
+
const authenticationMessage = isCursorAuthenticationError(failure.text) ? [
|
|
8301
|
+
`Cursor rejected the ${credentialLabel} for this request.`,
|
|
8302
|
+
"Logging out and back in does not replace the Cursor API key stored in Replicas.",
|
|
8303
|
+
"Update it in Settings \u2192 Coding Agents before starting a new workspace.",
|
|
8304
|
+
failure.requestId ? `If a fresh key still fails, contact Cursor support with request ID ${failure.requestId}.` : ""
|
|
8305
|
+
].filter(Boolean).join(" ") : null;
|
|
8306
|
+
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
8307
|
if (failure.transport) {
|
|
8292
8308
|
this.activeRun = null;
|
|
8293
8309
|
this.closeAgent();
|
|
@@ -10875,7 +10891,7 @@ function getEnvironmentSection() {
|
|
|
10875
10891
|
`Platform: ${process.platform}`,
|
|
10876
10892
|
getShellInfoLine(),
|
|
10877
10893
|
`OS Version: ${unameSR}`,
|
|
10878
|
-
`The most recent Claude models are the Claude 5 family and Opus 5. Model IDs \u2014 Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.`
|
|
10894
|
+
`The most recent Claude models are the Claude 5 family and Opus 5. Model IDs \u2014 Fable 5.1: 'claude-fable-5-1', Fable 5: 'claude-fable-5', Opus 5: 'claude-opus-5', Sonnet 5: 'claude-sonnet-5', Haiku 4.5: 'claude-haiku-4-5-20251001'. When building AI applications, default to the latest and most capable Claude models.`
|
|
10879
10895
|
];
|
|
10880
10896
|
return [
|
|
10881
10897
|
`# Environment`,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
notifyPostToolUse
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-P554JDNI.js";
|
|
5
5
|
import {
|
|
6
6
|
isRecord
|
|
7
7
|
} from "./chunk-2RB7SIP3.js";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-4IGJRCPV.js";
|
|
9
9
|
|
|
10
10
|
// src/post-tool-pr-hook.ts
|
|
11
11
|
async function main() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "replicas-engine",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.718",
|
|
4
4
|
"description": "Lightweight API server for Replicas workspaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@opencode-ai/sdk": "1.17.9",
|
|
51
51
|
"hono": "^4.10.3",
|
|
52
52
|
"opencode-ai": "1.17.9",
|
|
53
|
-
"undici": "7.
|
|
53
|
+
"undici": "7.29.0",
|
|
54
54
|
"ws": "8.21.0",
|
|
55
55
|
"yaml": "^2.8.2",
|
|
56
56
|
"zod": "^4.0.0"
|