replicas-engine 0.1.1006 → 0.1.1008
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-VVFKBVIK.js → asp-host-JPVVE5ZK.js} +5 -5
- package/dist/src/{chunk-JNCJG25E.js → chunk-2QON5DPE.js} +1 -1
- package/dist/src/{chunk-7OGI4N7B.js → chunk-5S6KOQGD.js} +6 -6
- package/dist/src/{chunk-E25NLO2C.js → chunk-6DNBBHFB.js} +1 -1
- package/dist/src/{chunk-BOUFJ6MN.js → chunk-UFWZKCZ2.js} +65 -44
- package/dist/src/{chunk-VAJAXROC.js → chunk-XS7ZRCT2.js} +1 -1
- package/dist/src/{chunk-YHLMQT2K.js → chunk-XTDADQOV.js} +3 -3
- package/dist/src/{chunk-SVJZNG2F.js → chunk-ZWQGNLNE.js} +3 -3
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +3 -3
- package/dist/src/index.js +7 -7
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
|
@@ -5,12 +5,12 @@ import {
|
|
|
5
5
|
getCodexAspHost,
|
|
6
6
|
restartCodexAspHost,
|
|
7
7
|
restartCodexAspHostIfRunning
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
11
|
-
import "./chunk-
|
|
8
|
+
} from "./chunk-5S6KOQGD.js";
|
|
9
|
+
import "./chunk-XS7ZRCT2.js";
|
|
10
|
+
import "./chunk-ZWQGNLNE.js";
|
|
11
|
+
import "./chunk-6DNBBHFB.js";
|
|
12
12
|
import "./chunk-UZSNFLDQ.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-UFWZKCZ2.js";
|
|
14
14
|
import "./chunk-VEQXQN22.js";
|
|
15
15
|
export {
|
|
16
16
|
getCodexAspHost,
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
setAgentCredentialSnapshot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-XS7ZRCT2.js";
|
|
9
9
|
import {
|
|
10
10
|
AppServerProcess,
|
|
11
11
|
buildCodexAgentEnv
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ZWQGNLNE.js";
|
|
13
13
|
import {
|
|
14
14
|
SUBPROCESS_MAX_BUFFER,
|
|
15
15
|
execFileAsync
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-6DNBBHFB.js";
|
|
17
17
|
import {
|
|
18
18
|
isRecord
|
|
19
19
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -28,7 +28,7 @@ import {
|
|
|
28
28
|
listOpenAICompatibleModels,
|
|
29
29
|
readOllamaAuthEnv,
|
|
30
30
|
resolveOpenAICompatibleModelsUrl
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-UFWZKCZ2.js";
|
|
32
32
|
|
|
33
33
|
// src/managers/codex-token-manager.ts
|
|
34
34
|
import { promises as fs } from "fs";
|
|
@@ -264,7 +264,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
264
264
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
265
265
|
await this.applyCredentialsResponse(data);
|
|
266
266
|
setAgentCredentialSnapshot("codex", data);
|
|
267
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
267
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-JPVVE5ZK.js");
|
|
268
268
|
await restartCodexAspHostIfRunning2();
|
|
269
269
|
});
|
|
270
270
|
await this.start(true);
|
|
@@ -285,7 +285,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
285
285
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
286
286
|
await this.applyCredentialsResponse(data);
|
|
287
287
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
288
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
288
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-JPVVE5ZK.js");
|
|
289
289
|
await restartCodexAspHostIfRunning2();
|
|
290
290
|
}
|
|
291
291
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
HOOK_EXEC_MAX_BUFFER_BYTES
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-UFWZKCZ2.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -2061,6 +2061,7 @@ function normalizeBackgroundTaskStatus(status) {
|
|
|
2061
2061
|
// ../shared/src/display-message/constants.ts
|
|
2062
2062
|
var USER_MESSAGE_MATCH_GRACE_PERIOD_MS = 3e4;
|
|
2063
2063
|
var COMPACTION_CONTENT = "Context compacted";
|
|
2064
|
+
var GOAL_TOOL_NAME = "goal";
|
|
2064
2065
|
|
|
2065
2066
|
// ../shared/src/shell-commands.ts
|
|
2066
2067
|
var SHELL_OPAQUE = "\0";
|
|
@@ -6283,6 +6284,17 @@ function createSubagentMessage(messageIndex, timestamp, fields) {
|
|
|
6283
6284
|
function collectNestedEvents(events, toolUseId) {
|
|
6284
6285
|
return events.filter((e) => e.payload.parent_tool_use_id === toolUseId).map(({ timestamp, type, payload }) => ({ timestamp, type, payload }));
|
|
6285
6286
|
}
|
|
6287
|
+
function readToolResult(event) {
|
|
6288
|
+
if (event.type !== "claude-user") return void 0;
|
|
6289
|
+
const toolResult = normalizeContentBlocks(event.payload.message?.content).find((c) => c.type === "tool_result");
|
|
6290
|
+
if (!toolResult?.tool_use_id) return void 0;
|
|
6291
|
+
return {
|
|
6292
|
+
toolResult,
|
|
6293
|
+
toolUseId: toolResult.tool_use_id,
|
|
6294
|
+
output: extractToolResultText(toolResult.content),
|
|
6295
|
+
status: toolResult.is_error ? "failed" : "completed"
|
|
6296
|
+
};
|
|
6297
|
+
}
|
|
6286
6298
|
function coerceClaudeResultPayload(payload) {
|
|
6287
6299
|
return {
|
|
6288
6300
|
is_error: typeof payload.is_error === "boolean" ? payload.is_error : void 0,
|
|
@@ -6450,6 +6462,20 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
6450
6462
|
const messageId = event.payload.message?.id;
|
|
6451
6463
|
const contentBlocks = normalizeContentBlocks(event.payload.message?.content);
|
|
6452
6464
|
const messageKey = messageId || event.timestamp;
|
|
6465
|
+
const localCommand = event.payload.local_command_run;
|
|
6466
|
+
const goalArgs = isRecord(localCommand) && localCommand.command === GOAL_TOOL_NAME && typeof localCommand.args === "string" ? localCommand.args.trim() : "";
|
|
6467
|
+
if (goalArgs) {
|
|
6468
|
+
upsertDisplayMessage(messages, {
|
|
6469
|
+
id: `goal-${messageKey}`,
|
|
6470
|
+
type: "tool_call",
|
|
6471
|
+
server: "claude",
|
|
6472
|
+
tool: GOAL_TOOL_NAME,
|
|
6473
|
+
input: goalArgs === "clear" ? void 0 : { objective: goalArgs },
|
|
6474
|
+
status: "completed",
|
|
6475
|
+
timestamp: event.timestamp
|
|
6476
|
+
});
|
|
6477
|
+
return;
|
|
6478
|
+
}
|
|
6453
6479
|
const streamRefs = messageId ? partialIndexes.get(messageId) : void 0;
|
|
6454
6480
|
if (messageId) {
|
|
6455
6481
|
if (liveStreamId !== null && liveStreamId !== messageId) {
|
|
@@ -6724,52 +6750,47 @@ function parseClaudeEvents(events, parentToolUseId) {
|
|
|
6724
6750
|
messages.push(fileOrCommandMessage(tool.name, tool.id, "filePath" in tool ? { file_path: tool.filePath } : { command: tool.command }, timestamp));
|
|
6725
6751
|
}
|
|
6726
6752
|
filteredEvents.forEach((event) => {
|
|
6727
|
-
|
|
6728
|
-
|
|
6729
|
-
|
|
6730
|
-
|
|
6731
|
-
|
|
6732
|
-
|
|
6733
|
-
|
|
6734
|
-
|
|
6735
|
-
|
|
6736
|
-
|
|
6737
|
-
|
|
6738
|
-
|
|
6739
|
-
|
|
6740
|
-
|
|
6741
|
-
|
|
6742
|
-
|
|
6743
|
-
|
|
6744
|
-
|
|
6745
|
-
|
|
6746
|
-
|
|
6747
|
-
|
|
6748
|
-
|
|
6749
|
-
|
|
6750
|
-
|
|
6751
|
-
|
|
6752
|
-
|
|
6753
|
-
|
|
6754
|
-
|
|
6755
|
-
|
|
6756
|
-
|
|
6757
|
-
|
|
6758
|
-
|
|
6759
|
-
|
|
6760
|
-
|
|
6761
|
-
|
|
6762
|
-
|
|
6763
|
-
const parsed = safeJsonParse(resultContent, {});
|
|
6764
|
-
if (parsed.chatId) {
|
|
6765
|
-
message.chatId = parsed.chatId;
|
|
6766
|
-
}
|
|
6767
|
-
}
|
|
6768
|
-
} else if (message.type === "subagent_followup") {
|
|
6769
|
-
message.output = resultContent;
|
|
6770
|
-
message.status = status;
|
|
6753
|
+
const result = readToolResult(event);
|
|
6754
|
+
if (!result) return;
|
|
6755
|
+
const { toolResult, output: resultContent, status } = result;
|
|
6756
|
+
const toolInfo = toolCallMap.get(result.toolUseId);
|
|
6757
|
+
if (!toolInfo) return;
|
|
6758
|
+
const isError = status === "failed";
|
|
6759
|
+
if (toolInfo.toolName === "TaskCreate" && !isError) {
|
|
6760
|
+
taskAccumulator.processContentBlock(toolResult);
|
|
6761
|
+
}
|
|
6762
|
+
const message = messages[toolInfo.messageIndex];
|
|
6763
|
+
if (!message) return;
|
|
6764
|
+
if (message.type === "command") {
|
|
6765
|
+
message.output = resultContent;
|
|
6766
|
+
message.status = status;
|
|
6767
|
+
const exitCodeMatch = resultContent.match(/exit code:?\s*(\d+)/i);
|
|
6768
|
+
if (exitCodeMatch) {
|
|
6769
|
+
message.exitCode = parseInt(exitCodeMatch[1], 10);
|
|
6770
|
+
} else {
|
|
6771
|
+
message.exitCode = isError ? 1 : 0;
|
|
6772
|
+
}
|
|
6773
|
+
} else if (message.type === "patch") {
|
|
6774
|
+
message.status = status;
|
|
6775
|
+
} else if (message.type === "web_search") {
|
|
6776
|
+
message.status = status;
|
|
6777
|
+
} else if (message.type === "tool_call") {
|
|
6778
|
+
message.output = resultContent;
|
|
6779
|
+
message.status = status;
|
|
6780
|
+
} else if (message.type === "skill") {
|
|
6781
|
+
message.status = status;
|
|
6782
|
+
} else if (message.type === "subagent") {
|
|
6783
|
+
message.output = resultContent;
|
|
6784
|
+
message.status = status;
|
|
6785
|
+
if (!message.chatId && resultContent) {
|
|
6786
|
+
const parsed = safeJsonParse(resultContent, {});
|
|
6787
|
+
if (parsed.chatId) {
|
|
6788
|
+
message.chatId = parsed.chatId;
|
|
6771
6789
|
}
|
|
6772
6790
|
}
|
|
6791
|
+
} else if (message.type === "subagent_followup") {
|
|
6792
|
+
message.output = resultContent;
|
|
6793
|
+
message.status = status;
|
|
6773
6794
|
}
|
|
6774
6795
|
});
|
|
6775
6796
|
for (const message of messages) {
|
|
@@ -3,18 +3,18 @@ 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-XS7ZRCT2.js";
|
|
7
7
|
import {
|
|
8
8
|
SUBPROCESS_MAX_BUFFER,
|
|
9
9
|
execFileAsync
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-6DNBBHFB.js";
|
|
11
11
|
import {
|
|
12
12
|
extractCommandProtectionCommandText,
|
|
13
13
|
findCommandProtectionGitLookups,
|
|
14
14
|
findGitCommitSignals,
|
|
15
15
|
findPrMergeSignals,
|
|
16
16
|
parseCommandProtectionRequest
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-UFWZKCZ2.js";
|
|
18
18
|
|
|
19
19
|
// src/services/command-protection-service.ts
|
|
20
20
|
import { readFile, stat } from "fs/promises";
|
|
@@ -3,10 +3,10 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
execFileAsync
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-6DNBBHFB.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UFWZKCZ2.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/codex-agent-env.ts
|
|
12
12
|
function buildCodexAgentEnv(source = process.env) {
|
|
@@ -240,7 +240,7 @@ function getCodexModelProvider(method) {
|
|
|
240
240
|
if (method === "foundry") return "azure";
|
|
241
241
|
return method === "ollama" || method === "openai-compatible" ? "replicas_openai_compatible" : "openai";
|
|
242
242
|
}
|
|
243
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
243
|
+
var ENGINE_PACKAGE_VERSION = "0.1.1008";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -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-
|
|
7
|
-
import "./chunk-
|
|
8
|
-
import "./chunk-
|
|
6
|
+
} from "./chunk-XTDADQOV.js";
|
|
7
|
+
import "./chunk-XS7ZRCT2.js";
|
|
8
|
+
import "./chunk-6DNBBHFB.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-UFWZKCZ2.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/command-protection-hook.ts
|
|
@@ -7,12 +7,12 @@ import {
|
|
|
7
7
|
import {
|
|
8
8
|
AppServerProcess,
|
|
9
9
|
buildCodexAgentEnv
|
|
10
|
-
} from "./chunk-
|
|
11
|
-
import "./chunk-
|
|
10
|
+
} from "./chunk-ZWQGNLNE.js";
|
|
11
|
+
import "./chunk-6DNBBHFB.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT,
|
|
14
14
|
headlessAgentRequestSchema
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UFWZKCZ2.js";
|
|
16
16
|
import "./chunk-VEQXQN22.js";
|
|
17
17
|
|
|
18
18
|
// src/headless-agent.ts
|
package/dist/src/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
reportCommandProtectionBlock,
|
|
33
33
|
resolveDiffBase,
|
|
34
34
|
runGitCommand
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-XTDADQOV.js";
|
|
36
36
|
import {
|
|
37
37
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
38
38
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -57,7 +57,7 @@ import {
|
|
|
57
57
|
} from "./chunk-P73LGPQO.js";
|
|
58
58
|
import {
|
|
59
59
|
publishedPullRequestUrls
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-2QON5DPE.js";
|
|
61
61
|
import {
|
|
62
62
|
BaseRefreshManager,
|
|
63
63
|
CodexAspAuthMethodChangedError,
|
|
@@ -71,7 +71,7 @@ import {
|
|
|
71
71
|
refreshDelayMs,
|
|
72
72
|
restartCodexAspHost,
|
|
73
73
|
routineRefreshRequest
|
|
74
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-5S6KOQGD.js";
|
|
75
75
|
import {
|
|
76
76
|
ENGINE_ENV,
|
|
77
77
|
monolithRequest,
|
|
@@ -79,16 +79,16 @@ import {
|
|
|
79
79
|
readRuntimeEnvFile,
|
|
80
80
|
reloadEngineEnv,
|
|
81
81
|
setAgentCredentialSnapshot
|
|
82
|
-
} from "./chunk-
|
|
82
|
+
} from "./chunk-XS7ZRCT2.js";
|
|
83
83
|
import {
|
|
84
84
|
AspClient,
|
|
85
85
|
getCodexModelProvider
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-ZWQGNLNE.js";
|
|
87
87
|
import {
|
|
88
88
|
SUBPROCESS_MAX_BUFFER,
|
|
89
89
|
execAsync,
|
|
90
90
|
execFileAsync
|
|
91
|
-
} from "./chunk-
|
|
91
|
+
} from "./chunk-6DNBBHFB.js";
|
|
92
92
|
import {
|
|
93
93
|
isRecord as isRecord2
|
|
94
94
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -316,7 +316,7 @@ import {
|
|
|
316
316
|
workspaceCredentialProviderSchema,
|
|
317
317
|
workspaceTokenRequestSchema,
|
|
318
318
|
workspaceTokenResponseSchema
|
|
319
|
-
} from "./chunk-
|
|
319
|
+
} from "./chunk-UFWZKCZ2.js";
|
|
320
320
|
import {
|
|
321
321
|
cloneMcpConfig,
|
|
322
322
|
ensureCompatibilityImports,
|
|
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from 'node:module';
|
|
|
3
3
|
const require = __createRequire(import.meta.url);
|
|
4
4
|
import {
|
|
5
5
|
publishedPullRequestUrls
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2QON5DPE.js";
|
|
7
7
|
import {
|
|
8
8
|
isRecord
|
|
9
9
|
} from "./chunk-UZSNFLDQ.js";
|
|
10
10
|
import {
|
|
11
11
|
shouldRefreshPullRequests
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-UFWZKCZ2.js";
|
|
13
13
|
import "./chunk-VEQXQN22.js";
|
|
14
14
|
|
|
15
15
|
// src/services/post-tool-pr-notifier.ts
|
package/dist/src/subagent-mcp.js
CHANGED