replicas-engine 0.1.748 → 0.1.751
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/{asp-host-FED7CRXG.js → asp-host-GSBR46MV.js} +4 -4
- package/dist/src/{chunk-UDQRDVUD.js → chunk-7BMG23BX.js} +4 -4
- package/dist/src/{chunk-K7NZNYQL.js → chunk-GQTP5TPD.js} +4 -3
- package/dist/src/{chunk-PASXXBP2.js → chunk-JQ4OOC6O.js} +2 -2
- package/dist/src/{chunk-CGCN6HGZ.js → chunk-MNVK5OPD.js} +42 -8
- package/dist/src/{chunk-DJF4SPBS.js → chunk-OVCVFBIB.js} +2 -2
- package/dist/src/{chunk-DCWVMP7E.js → chunk-VZR2BGSF.js} +1 -1
- package/dist/src/command-protection-hook.js +3 -3
- package/dist/src/deepseek-command-protection-plugin.js +4 -4
- package/dist/src/headless-agent.js +2 -2
- package/dist/src/index.js +884 -1268
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/relay-mcp.js +92 -0
- package/package.json +3 -1
- package/dist/src/{mcp-panel-U4U3G7EU.js → mcp-panel-VYAKFUWR.js} +3 -3
|
@@ -3,11 +3,11 @@ import {
|
|
|
3
3
|
getCodexAspHost,
|
|
4
4
|
restartCodexAspHost,
|
|
5
5
|
restartCodexAspHostIfRunning
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-7BMG23BX.js";
|
|
7
|
+
import "./chunk-GQTP5TPD.js";
|
|
8
|
+
import "./chunk-JQ4OOC6O.js";
|
|
9
9
|
import "./chunk-2RB7SIP3.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-MNVK5OPD.js";
|
|
11
11
|
import "./chunk-5KSXSK7Y.js";
|
|
12
12
|
export {
|
|
13
13
|
getCodexAspHost,
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
ENGINE_ENV,
|
|
4
4
|
monolithRequest,
|
|
5
5
|
setAgentCredentialSnapshot
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-GQTP5TPD.js";
|
|
7
7
|
import {
|
|
8
8
|
AppServerProcess,
|
|
9
9
|
buildCodexAgentEnv
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-JQ4OOC6O.js";
|
|
11
11
|
import {
|
|
12
12
|
CODEX_AUTH_ENV_KEYS,
|
|
13
13
|
CODEX_AUTH_ENV_KEYS_BY_METHOD,
|
|
14
14
|
codexAuthEnvFromResponse,
|
|
15
15
|
createErrorResult,
|
|
16
16
|
createSuccessResult
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-MNVK5OPD.js";
|
|
18
18
|
|
|
19
19
|
// src/managers/codex-token-manager.ts
|
|
20
20
|
import { promises as fs } from "fs";
|
|
@@ -230,7 +230,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
230
230
|
const data = await response.json();
|
|
231
231
|
await this.applyCredentialsResponse(data);
|
|
232
232
|
if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
|
|
233
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
233
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-GSBR46MV.js");
|
|
234
234
|
await restartCodexAspHostIfRunning2();
|
|
235
235
|
}
|
|
236
236
|
if (data.scope) {
|
|
@@ -10,9 +10,10 @@ import {
|
|
|
10
10
|
fallbackPlanResponseSchema,
|
|
11
11
|
isRecord,
|
|
12
12
|
isValidAgentProvider,
|
|
13
|
+
isValidRelayBaseProvider,
|
|
13
14
|
parsePosixEnvFile,
|
|
14
15
|
readReplicasRuntimeEnv
|
|
15
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-MNVK5OPD.js";
|
|
16
17
|
|
|
17
18
|
// src/engine-env.ts
|
|
18
19
|
import { readFileSync as readFileSync2 } from "fs";
|
|
@@ -175,14 +176,14 @@ async function monolithRequest(path, init = {}) {
|
|
|
175
176
|
});
|
|
176
177
|
}
|
|
177
178
|
var MonolithService = class {
|
|
178
|
-
async
|
|
179
|
+
async getRelayConfig() {
|
|
179
180
|
try {
|
|
180
181
|
const response = await monolithRequest("/v1/engine/relay-subagent-providers", { method: "GET" });
|
|
181
182
|
if (!response.ok) {
|
|
182
183
|
return null;
|
|
183
184
|
}
|
|
184
185
|
const body = await response.json();
|
|
185
|
-
return isRecord(body) && Array.isArray(body.providers) && body.providers.every((provider) => typeof provider === "string" && isValidAgentProvider(provider)) ? body.providers : null;
|
|
186
|
+
return isRecord(body) && Array.isArray(body.providers) && body.providers.every((provider) => typeof provider === "string" && isValidAgentProvider(provider)) && typeof body.baseProvider === "string" && isValidRelayBaseProvider(body.baseProvider) ? { providers: body.providers, baseProvider: body.baseProvider } : null;
|
|
186
187
|
} catch {
|
|
187
188
|
return null;
|
|
188
189
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import {
|
|
3
3
|
HOOK_EXEC_MAX_BUFFER_BYTES,
|
|
4
4
|
isVersionBelow
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-MNVK5OPD.js";
|
|
6
6
|
|
|
7
7
|
// src/utils/codex-agent-env.ts
|
|
8
8
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -239,7 +239,7 @@ var DEFAULT_CODEX_ARGS = [
|
|
|
239
239
|
var MIN_CODEX_CLI_VERSION = "0.153.3";
|
|
240
240
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
241
241
|
var codexCliVersionEnsured = null;
|
|
242
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
242
|
+
var ENGINE_PACKAGE_VERSION = "0.1.751";
|
|
243
243
|
var INITIALIZE_METHOD = "initialize";
|
|
244
244
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
245
245
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -15,6 +15,14 @@ var AGENT = {
|
|
|
15
15
|
};
|
|
16
16
|
var VALID_AGENT_PROVIDERS = Object.values(AGENT);
|
|
17
17
|
var VALID_RELAY_SUBAGENT_PROVIDERS = VALID_AGENT_PROVIDERS;
|
|
18
|
+
var VALID_RELAY_BASE_PROVIDERS = [
|
|
19
|
+
AGENT.CLAUDE,
|
|
20
|
+
AGENT.CODEX,
|
|
21
|
+
AGENT.DEEPSEEK,
|
|
22
|
+
AGENT.OPENCODE,
|
|
23
|
+
AGENT.PI
|
|
24
|
+
];
|
|
25
|
+
var DEFAULT_RELAY_BASE_PROVIDER = AGENT.CLAUDE;
|
|
18
26
|
var VALID_CODING_AGENT_PROVIDERS = VALID_AGENT_PROVIDERS.filter(
|
|
19
27
|
(provider) => provider !== AGENT.RELAY
|
|
20
28
|
);
|
|
@@ -24,6 +32,9 @@ function isValidAgentProvider(value) {
|
|
|
24
32
|
function isValidCodingAgentProvider(value) {
|
|
25
33
|
return VALID_CODING_AGENT_PROVIDERS.some((provider) => provider === value);
|
|
26
34
|
}
|
|
35
|
+
function isValidRelayBaseProvider(value) {
|
|
36
|
+
return VALID_RELAY_BASE_PROVIDERS.some((provider) => provider === value);
|
|
37
|
+
}
|
|
27
38
|
var VALID_THINKING_LEVELS = ["low", "medium", "high", "xhigh", "max", "ultra", "ultracode"];
|
|
28
39
|
var STANDARD_THINKING_LEVELS = ["low", "medium", "high", "xhigh", "max"];
|
|
29
40
|
var THINKING_LEVELS_BY_AGENT = {
|
|
@@ -278,8 +289,7 @@ var AGENT_MODELS = {
|
|
|
278
289
|
};
|
|
279
290
|
var DEFAULT_STATIC_AGENT_MODELS = {
|
|
280
291
|
claude: AGENT_MODELS.claude,
|
|
281
|
-
codex: AGENT_MODELS.codex
|
|
282
|
-
relay: AGENT_MODELS.relay
|
|
292
|
+
codex: AGENT_MODELS.codex
|
|
283
293
|
};
|
|
284
294
|
var DEFAULT_CURSOR_MODELS = AGENT_MODELS.cursor;
|
|
285
295
|
function getAgentModelOptions(provider, overrides) {
|
|
@@ -697,13 +707,33 @@ var MERGED_MESSAGE_SEPARATOR = "\n\n<!-- replicas:merged -->\n\n";
|
|
|
697
707
|
var ENGINE_HEALTH_WAIT_HEADER = "X-Replicas-Health-Wait";
|
|
698
708
|
var ENGINE_HEALTH_WAIT_QUERY_PARAM = "wait_ms";
|
|
699
709
|
var ENGINE_HEALTH_MAX_WAIT_MS = 2e3;
|
|
710
|
+
function getChatExecutionProvider(chat) {
|
|
711
|
+
return chat.provider === "relay" ? chat.relayBaseProvider ?? DEFAULT_RELAY_BASE_PROVIDER : chat.provider;
|
|
712
|
+
}
|
|
700
713
|
var createChatRequestSchema = z2.object({
|
|
701
714
|
id: z2.string().uuid().optional(),
|
|
702
715
|
createdAt: z2.string().datetime().optional(),
|
|
703
716
|
provider: z2.enum(VALID_AGENT_PROVIDERS),
|
|
717
|
+
relayBaseProvider: z2.enum(VALID_CODING_AGENT_PROVIDERS).optional(),
|
|
704
718
|
title: z2.string().min(1).optional(),
|
|
705
719
|
parentChatId: z2.string().uuid().optional(),
|
|
706
720
|
clientRequestId: z2.string().min(1).max(128).optional()
|
|
721
|
+
}).refine((request) => request.provider === "relay" || request.relayBaseProvider === void 0, {
|
|
722
|
+
message: "relayBaseProvider is only valid for Relay chats"
|
|
723
|
+
});
|
|
724
|
+
var spawnRelaySubagentRequestSchema = z2.object({
|
|
725
|
+
provider: z2.enum(VALID_AGENT_PROVIDERS),
|
|
726
|
+
prompt: z2.string().min(1),
|
|
727
|
+
model: z2.string().min(1).optional(),
|
|
728
|
+
thinkingLevel: z2.enum(VALID_THINKING_LEVELS).optional(),
|
|
729
|
+
title: z2.string().min(1).optional(),
|
|
730
|
+
timeoutMinutes: z2.number().positive().max(1440).optional()
|
|
731
|
+
});
|
|
732
|
+
var messageRelaySubagentRequestSchema = z2.object({
|
|
733
|
+
message: z2.string().min(1),
|
|
734
|
+
model: z2.string().min(1).optional(),
|
|
735
|
+
thinkingLevel: z2.enum(VALID_THINKING_LEVELS).optional(),
|
|
736
|
+
timeoutMinutes: z2.number().positive().max(1440).optional()
|
|
707
737
|
});
|
|
708
738
|
var sendChatMessageRequestSchema = z2.object({
|
|
709
739
|
messageId: z2.string().min(1).optional(),
|
|
@@ -3275,7 +3305,6 @@ var DEFAULT_USER_PREFERENCES = {
|
|
|
3275
3305
|
codex_models: null,
|
|
3276
3306
|
cursor_models: null,
|
|
3277
3307
|
openrouter_models: null,
|
|
3278
|
-
relay_models: null,
|
|
3279
3308
|
close_workspace_on_pr_close: true,
|
|
3280
3309
|
close_workspace_on_pr_merge: true,
|
|
3281
3310
|
default_environment_id: null,
|
|
@@ -4008,7 +4037,6 @@ function parseAcpEvents(events, provider) {
|
|
|
4008
4037
|
}
|
|
4009
4038
|
|
|
4010
4039
|
// ../shared/src/display-message/parsers/fx-parser.ts
|
|
4011
|
-
var getFxTextChunk = getAcpTextChunk;
|
|
4012
4040
|
function parseFxEvents(events) {
|
|
4013
4041
|
return parseAcpEvents(events, "fx");
|
|
4014
4042
|
}
|
|
@@ -7155,6 +7183,7 @@ function normalizeChatTranscriptMetadata(value) {
|
|
|
7155
7183
|
const metadata = {};
|
|
7156
7184
|
const {
|
|
7157
7185
|
provider,
|
|
7186
|
+
relayBaseProvider,
|
|
7158
7187
|
credential,
|
|
7159
7188
|
title,
|
|
7160
7189
|
createdAt,
|
|
@@ -7169,6 +7198,9 @@ function normalizeChatTranscriptMetadata(value) {
|
|
|
7169
7198
|
fork
|
|
7170
7199
|
} = value;
|
|
7171
7200
|
if (typeof provider === "string" && isValidAgentProvider(provider)) metadata.provider = provider;
|
|
7201
|
+
if (typeof relayBaseProvider === "string" && isValidCodingAgentProvider(relayBaseProvider)) {
|
|
7202
|
+
metadata.relayBaseProvider = relayBaseProvider;
|
|
7203
|
+
}
|
|
7172
7204
|
const parsedCredential = agentCredentialSnapshotSchema.safeParse(credential);
|
|
7173
7205
|
if (parsedCredential.success) metadata.credential = parsedCredential.data;
|
|
7174
7206
|
if (typeof title === "string") metadata.title = title;
|
|
@@ -7254,9 +7286,10 @@ export {
|
|
|
7254
7286
|
createErrorResult,
|
|
7255
7287
|
AGENT,
|
|
7256
7288
|
VALID_AGENT_PROVIDERS,
|
|
7257
|
-
|
|
7289
|
+
DEFAULT_RELAY_BASE_PROVIDER,
|
|
7258
7290
|
isValidAgentProvider,
|
|
7259
|
-
|
|
7291
|
+
isValidCodingAgentProvider,
|
|
7292
|
+
isValidRelayBaseProvider,
|
|
7260
7293
|
codexReasoningEffortForThinkingLevel,
|
|
7261
7294
|
getProviderDisplayName,
|
|
7262
7295
|
detectAgentQuotaLimit,
|
|
@@ -7335,7 +7368,10 @@ export {
|
|
|
7335
7368
|
ENGINE_HEALTH_WAIT_HEADER,
|
|
7336
7369
|
ENGINE_HEALTH_WAIT_QUERY_PARAM,
|
|
7337
7370
|
ENGINE_HEALTH_MAX_WAIT_MS,
|
|
7371
|
+
getChatExecutionProvider,
|
|
7338
7372
|
createChatRequestSchema,
|
|
7373
|
+
spawnRelaySubagentRequestSchema,
|
|
7374
|
+
messageRelaySubagentRequestSchema,
|
|
7339
7375
|
sendChatMessageRequestSchema,
|
|
7340
7376
|
isChatMessageSender,
|
|
7341
7377
|
normalizeCodexAspTranscriptStatus,
|
|
@@ -7357,8 +7393,6 @@ export {
|
|
|
7357
7393
|
isTerminalBackgroundTaskStatus,
|
|
7358
7394
|
isGitHubUrl,
|
|
7359
7395
|
decodePathSegments,
|
|
7360
|
-
getDeepseekAssistantMessageText,
|
|
7361
|
-
getFxTextChunk,
|
|
7362
7396
|
extractErrorText,
|
|
7363
7397
|
isTransientErrorText,
|
|
7364
7398
|
extractToolResultText,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
monolithRequest
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-GQTP5TPD.js";
|
|
5
5
|
import {
|
|
6
6
|
extractCommandProtectionCommandText,
|
|
7
7
|
findGitCommitSignals,
|
|
8
8
|
findPrMergeSignals
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-MNVK5OPD.js";
|
|
10
10
|
|
|
11
11
|
// src/services/command-protection-service.ts
|
|
12
12
|
var DEFAULT_COMMAND_PROTECTION_BLOCK_MESSAGE = "Blocked by Replicas command protection.";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
evaluateCommandProtection
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import "./chunk-
|
|
4
|
+
} from "./chunk-OVCVFBIB.js";
|
|
5
|
+
import "./chunk-GQTP5TPD.js";
|
|
6
6
|
import {
|
|
7
7
|
isRecord
|
|
8
8
|
} from "./chunk-2RB7SIP3.js";
|
|
9
|
-
import "./chunk-
|
|
9
|
+
import "./chunk-MNVK5OPD.js";
|
|
10
10
|
import "./chunk-5KSXSK7Y.js";
|
|
11
11
|
|
|
12
12
|
// src/command-protection-hook.ts
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import {
|
|
3
3
|
evaluateCommandProtection
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-OVCVFBIB.js";
|
|
5
5
|
import {
|
|
6
6
|
notifyPostToolUse
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
7
|
+
} from "./chunk-VZR2BGSF.js";
|
|
8
|
+
import "./chunk-GQTP5TPD.js";
|
|
9
9
|
import "./chunk-2RB7SIP3.js";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-MNVK5OPD.js";
|
|
11
11
|
import "./chunk-5KSXSK7Y.js";
|
|
12
12
|
|
|
13
13
|
// src/deepseek-command-protection-plugin.ts
|
|
@@ -6,12 +6,12 @@ import {
|
|
|
6
6
|
import {
|
|
7
7
|
AppServerProcess,
|
|
8
8
|
buildCodexAgentEnv
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-JQ4OOC6O.js";
|
|
10
10
|
import {
|
|
11
11
|
AGENT,
|
|
12
12
|
getMemoryOutputSafetyViolation,
|
|
13
13
|
headlessAgentRequestSchema
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-MNVK5OPD.js";
|
|
15
15
|
import "./chunk-5KSXSK7Y.js";
|
|
16
16
|
|
|
17
17
|
// src/headless-agent.ts
|