replicas-engine 0.1.815 → 0.1.817
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-LHDELXWM.js → asp-host-JUVXZCRV.js} +4 -4
- package/dist/src/{chunk-I3CLB5FS.js → chunk-6FLPUBVF.js} +2 -2
- package/dist/src/{chunk-MEPQJE5J.js → chunk-C52ENUG3.js} +1 -1
- package/dist/src/{chunk-UUQYVSQY.js → chunk-EOYBI3PV.js} +2 -2
- package/dist/src/{chunk-WRUZSBSF.js → chunk-FN67CYNX.js} +4 -4
- package/dist/src/chunk-JA23HN6S.js +46 -0
- package/dist/src/{chunk-3XXPWKPE.js → chunk-JAITEGC4.js} +1 -1
- package/dist/src/{chunk-JTAIM2QE.js → chunk-OCQQ6AO3.js} +8 -4
- 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 +274 -275
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/relay-mcp.js +10 -5
- package/package.json +1 -1
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
getCodexAspHost,
|
|
6
6
|
restartCodexAspHost,
|
|
7
7
|
restartCodexAspHostIfRunning
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-FN67CYNX.js";
|
|
9
|
+
import "./chunk-JAITEGC4.js";
|
|
10
|
+
import "./chunk-EOYBI3PV.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-OCQQ6AO3.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
export {
|
|
15
15
|
getCodexAspHost,
|
|
@@ -3,12 +3,12 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
monolithRequest
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-JAITEGC4.js";
|
|
7
7
|
import {
|
|
8
8
|
extractCommandProtectionCommandText,
|
|
9
9
|
findGitCommitSignals,
|
|
10
10
|
findPrMergeSignals
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
12
12
|
|
|
13
13
|
// src/services/command-protection-service.ts
|
|
14
14
|
var DEFAULT_COMMAND_PROTECTION_BLOCK_MESSAGE = "Blocked by Replicas command protection.";
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
findCodeHostPullRequestUrls,
|
|
6
6
|
mayCreatePullRequest
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
8
8
|
|
|
9
9
|
// src/services/post-tool-pr-notifier.ts
|
|
10
10
|
async function notifyPostToolUse(toolName, toolInput, toolResult) {
|
|
@@ -4,7 +4,7 @@ const require = __createRequire(import.meta.url);
|
|
|
4
4
|
import {
|
|
5
5
|
HOOK_EXEC_MAX_BUFFER_BYTES,
|
|
6
6
|
isVersionBelow
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
8
8
|
|
|
9
9
|
// src/utils/codex-agent-env.ts
|
|
10
10
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -241,7 +241,7 @@ var DEFAULT_CODEX_ARGS = [
|
|
|
241
241
|
var MIN_CODEX_CLI_VERSION = "0.153.3";
|
|
242
242
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
243
243
|
var codexCliVersionEnsured = null;
|
|
244
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
244
|
+
var ENGINE_PACKAGE_VERSION = "0.1.817";
|
|
245
245
|
var INITIALIZE_METHOD = "initialize";
|
|
246
246
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
247
247
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -5,18 +5,18 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
setAgentCredentialSnapshot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-JAITEGC4.js";
|
|
9
9
|
import {
|
|
10
10
|
AppServerProcess,
|
|
11
11
|
buildCodexAgentEnv
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-EOYBI3PV.js";
|
|
13
13
|
import {
|
|
14
14
|
CODEX_AUTH_ENV_KEYS,
|
|
15
15
|
CODEX_AUTH_ENV_KEYS_BY_METHOD,
|
|
16
16
|
codexAuthEnvFromResponse,
|
|
17
17
|
createErrorResult,
|
|
18
18
|
createSuccessResult
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
20
20
|
|
|
21
21
|
// src/managers/codex-token-manager.ts
|
|
22
22
|
import { promises as fs } from "fs";
|
|
@@ -232,7 +232,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
232
232
|
const data = await response.json();
|
|
233
233
|
await this.applyCredentialsResponse(data);
|
|
234
234
|
if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
|
|
235
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
235
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-JUVXZCRV.js");
|
|
236
236
|
await restartCodexAspHostIfRunning2();
|
|
237
237
|
}
|
|
238
238
|
if (data.scope) {
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
3
|
+
const require = __createRequire(import.meta.url);
|
|
4
|
+
|
|
5
|
+
// src/managers/relay-mcp-config.ts
|
|
6
|
+
import { existsSync } from "fs";
|
|
7
|
+
import { dirname, join } from "path";
|
|
8
|
+
import { fileURLToPath } from "url";
|
|
9
|
+
import { createRequire } from "module";
|
|
10
|
+
var RELAY_MCP_SERVER_NAME = "subagent_relay";
|
|
11
|
+
var RELAY_MCP_TOOL_NAMES = ["get_providers", "spawn_agent", "message_agent", "delete_agent"];
|
|
12
|
+
var RELAY_MCP_TOOL_TIMEOUT_MS = 24 * 60 * 60 * 1e3 + 6e4;
|
|
13
|
+
function relayMcpProcessConfig(parentChatId) {
|
|
14
|
+
const directory = dirname(fileURLToPath(import.meta.url));
|
|
15
|
+
const builtEntry = join(directory, "relay-mcp.js");
|
|
16
|
+
const sourceEntry = join(directory, "..", "relay-mcp.ts");
|
|
17
|
+
const entry = existsSync(builtEntry) ? builtEntry : sourceEntry;
|
|
18
|
+
return {
|
|
19
|
+
command: process.execPath,
|
|
20
|
+
args: [
|
|
21
|
+
...entry.endsWith(".ts") ? ["--import", createRequire(import.meta.url).resolve("tsx/esm")] : [],
|
|
22
|
+
entry,
|
|
23
|
+
"--parent",
|
|
24
|
+
parentChatId
|
|
25
|
+
]
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
function relayCodexMcpConfig(parentChatId) {
|
|
29
|
+
return {
|
|
30
|
+
...relayMcpProcessConfig(parentChatId),
|
|
31
|
+
env_vars: ["REPLICAS_ENGINE_PORT", "REPLICAS_ENGINE_SECRET"],
|
|
32
|
+
enabled_tools: [...RELAY_MCP_TOOL_NAMES],
|
|
33
|
+
required: true,
|
|
34
|
+
default_tools_approval_mode: "approve",
|
|
35
|
+
startup_timeout_sec: 10,
|
|
36
|
+
tool_timeout_sec: Math.ceil(RELAY_MCP_TOOL_TIMEOUT_MS / 1e3)
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
export {
|
|
41
|
+
RELAY_MCP_SERVER_NAME,
|
|
42
|
+
RELAY_MCP_TOOL_NAMES,
|
|
43
|
+
RELAY_MCP_TOOL_TIMEOUT_MS,
|
|
44
|
+
relayMcpProcessConfig,
|
|
45
|
+
relayCodexMcpConfig
|
|
46
|
+
};
|
|
@@ -817,6 +817,10 @@ var createChatRequestSchema = z3.object({
|
|
|
817
817
|
var spawnRelaySubagentRequestSchema = z3.object({
|
|
818
818
|
provider: z3.enum(VALID_AGENT_PROVIDERS),
|
|
819
819
|
prompt: z3.string().min(1),
|
|
820
|
+
forkTurns: z3.string().regex(/^(all|none|[1-9]\d*)$/).refine(
|
|
821
|
+
(value) => value === "all" || value === "none" || Number.isSafeInteger(Number(value)),
|
|
822
|
+
"Expected all, none, or a positive safe integer string"
|
|
823
|
+
).default("all"),
|
|
820
824
|
model: z3.string().min(1).optional(),
|
|
821
825
|
thinkingLevel: z3.enum(VALID_THINKING_LEVELS).optional(),
|
|
822
826
|
title: z3.string().min(1).optional(),
|
|
@@ -7413,15 +7417,15 @@ function formatChatForkHandoffMessage(handoff) {
|
|
|
7413
7417
|
const reason = describeChatForkReason(handoff.reason, handoff.source.provider);
|
|
7414
7418
|
const why = handoff.trigger === "auto" ? `until ${reason ?? "it stopped"}, so Replicas moved the conversation to you automatically` : "until the user forked it to you";
|
|
7415
7419
|
const body = [
|
|
7416
|
-
`# Continuing a ${sourceName} chat`,
|
|
7420
|
+
handoff.subagent ? "# Delegated task context" : `# Continuing a ${sourceName} chat`,
|
|
7417
7421
|
"",
|
|
7418
|
-
`You are picking up the chat "${handoff.source.title}" in this same workspace. It was running on ${sourceName} ${why}. Everything the previous agent changed is already on disk: the workspace files and git state are authoritative.`,
|
|
7422
|
+
handoff.subagent ? `You are a subagent of the chat "${handoff.source.title}" in this same workspace. The inherited transcript is background for your assigned task below. Follow that task and report your result to the parent; do not take over the parent's entire request. Workspace files and git state are shared and authoritative.` : `You are picking up the chat "${handoff.source.title}" in this same workspace. It was running on ${sourceName} ${why}. Everything the previous agent changed is already on disk: the workspace files and git state are authoritative.`,
|
|
7419
7423
|
"",
|
|
7420
7424
|
"## Transcript",
|
|
7421
7425
|
"",
|
|
7422
7426
|
`- Sanitized transcript: \`${handoff.transcriptPath}\` (read or grep it for anything not in the excerpt below)`,
|
|
7423
|
-
`- Raw event log: \`${handoff.rawHistoryPath}
|
|
7424
|
-
...handoff.sourceTruncated ? [
|
|
7427
|
+
...handoff.rawHistoryPath ? [`- Raw event log: \`${handoff.rawHistoryPath}\``] : [],
|
|
7428
|
+
...handoff.sourceTruncated ? [`- The chat was too large to sanitize in full; the sanitized file holds only its most recent part.${handoff.rawHistoryPath ? " Grep the raw event log for anything older." : ""}`] : [],
|
|
7425
7429
|
"",
|
|
7426
7430
|
"## Recent turns",
|
|
7427
7431
|
"",
|
|
@@ -3,12 +3,12 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
evaluateCommandProtection
|
|
6
|
-
} from "./chunk-
|
|
7
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-6FLPUBVF.js";
|
|
7
|
+
import "./chunk-JAITEGC4.js";
|
|
8
8
|
import {
|
|
9
9
|
isRecord
|
|
10
10
|
} from "./chunk-UZSNFLDQ.js";
|
|
11
|
-
import "./chunk-
|
|
11
|
+
import "./chunk-OCQQ6AO3.js";
|
|
12
12
|
import "./chunk-VEQXQN22.js";
|
|
13
13
|
|
|
14
14
|
// src/command-protection-hook.ts
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
evaluateCommandProtection
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6FLPUBVF.js";
|
|
7
7
|
import {
|
|
8
8
|
notifyPostToolUse
|
|
9
|
-
} from "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-C52ENUG3.js";
|
|
10
|
+
import "./chunk-JAITEGC4.js";
|
|
11
11
|
import "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-OCQQ6AO3.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/deepseek-command-protection-plugin.ts
|
|
@@ -8,12 +8,12 @@ import {
|
|
|
8
8
|
import {
|
|
9
9
|
AppServerProcess,
|
|
10
10
|
buildCodexAgentEnv
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-EOYBI3PV.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT,
|
|
14
14
|
getMemoryOutputSafetyViolation,
|
|
15
15
|
headlessAgentRequestSchema
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-OCQQ6AO3.js";
|
|
17
17
|
import "./chunk-VEQXQN22.js";
|
|
18
18
|
|
|
19
19
|
// src/headless-agent.ts
|