replicas-engine 0.1.981 → 0.1.983
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-PDLAGDUZ.js → asp-host-JKZMG5FE.js} +5 -5
- package/dist/src/{chunk-TPOFXPJT.js → chunk-HCJVU4VT.js} +3 -3
- package/dist/src/{chunk-7ZEHRSCY.js → chunk-I5P65PFM.js} +1 -1
- package/dist/src/{chunk-EL5EPSH6.js → chunk-QPK3QAPC.js} +1 -1
- package/dist/src/{chunk-76WG25A6.js → chunk-S3JTAWKH.js} +1 -1
- package/dist/src/{chunk-RGOCIFXT.js → chunk-U524262Y.js} +3 -3
- package/dist/src/{chunk-6JQ4WT6D.js → chunk-XXTWLY4O.js} +6 -6
- package/dist/src/command-protection-hook.js +4 -4
- package/dist/src/headless-agent.js +3 -3
- package/dist/src/index.js +44 -35
- package/dist/src/post-tool-pr-hook.js +2 -2
- package/dist/src/subagent-mcp.js +1 -1
- package/package.json +1 -1
- /package/dist/src/{chunk-FD6L53OG.js → chunk-UK5P4Q2U.js} +0 -0
|
@@ -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-XXTWLY4O.js";
|
|
9
|
+
import "./chunk-I5P65PFM.js";
|
|
10
|
+
import "./chunk-HCJVU4VT.js";
|
|
11
|
+
import "./chunk-S3JTAWKH.js";
|
|
12
12
|
import "./chunk-UZSNFLDQ.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-UK5P4Q2U.js";
|
|
14
14
|
import "./chunk-VEQXQN22.js";
|
|
15
15
|
export {
|
|
16
16
|
getCodexAspHost,
|
|
@@ -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-S3JTAWKH.js";
|
|
7
7
|
import {
|
|
8
8
|
isVersionBelow
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-UK5P4Q2U.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.983";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -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-UK5P4Q2U.js";
|
|
7
7
|
|
|
8
8
|
// src/utils/exec.ts
|
|
9
9
|
import { exec, execFile } from "child_process";
|
|
@@ -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-I5P65PFM.js";
|
|
7
7
|
import {
|
|
8
8
|
SUBPROCESS_MAX_BUFFER,
|
|
9
9
|
execFileAsync
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-S3JTAWKH.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-UK5P4Q2U.js";
|
|
18
18
|
|
|
19
19
|
// src/services/command-protection-service.ts
|
|
20
20
|
import { readFile, stat } from "fs/promises";
|
|
@@ -5,15 +5,15 @@ import {
|
|
|
5
5
|
ENGINE_ENV,
|
|
6
6
|
monolithRequest,
|
|
7
7
|
setAgentCredentialSnapshot
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-I5P65PFM.js";
|
|
9
9
|
import {
|
|
10
10
|
AppServerProcess,
|
|
11
11
|
buildCodexAgentEnv
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-HCJVU4VT.js";
|
|
13
13
|
import {
|
|
14
14
|
SUBPROCESS_MAX_BUFFER,
|
|
15
15
|
execFileAsync
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-S3JTAWKH.js";
|
|
17
17
|
import {
|
|
18
18
|
isRecord
|
|
19
19
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
listOpenAICompatibleModels,
|
|
28
28
|
readOllamaAuthEnv,
|
|
29
29
|
resolveOpenAICompatibleModelsUrl
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-UK5P4Q2U.js";
|
|
31
31
|
|
|
32
32
|
// src/managers/codex-token-manager.ts
|
|
33
33
|
import { promises as fs } from "fs";
|
|
@@ -260,7 +260,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
260
260
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
261
261
|
await this.applyCredentialsResponse(data);
|
|
262
262
|
setAgentCredentialSnapshot("codex", data);
|
|
263
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
263
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-JKZMG5FE.js");
|
|
264
264
|
await restartCodexAspHostIfRunning2();
|
|
265
265
|
});
|
|
266
266
|
await this.start(true);
|
|
@@ -280,7 +280,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
280
280
|
await this.applyCredentialUpdate(generation, async () => {
|
|
281
281
|
await this.applyCredentialsResponse(data);
|
|
282
282
|
if (restartOnChange && CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index])) {
|
|
283
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
283
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-JKZMG5FE.js");
|
|
284
284
|
await restartCodexAspHostIfRunning2();
|
|
285
285
|
}
|
|
286
286
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -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-U524262Y.js";
|
|
7
|
+
import "./chunk-I5P65PFM.js";
|
|
8
|
+
import "./chunk-S3JTAWKH.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
11
11
|
} from "./chunk-UZSNFLDQ.js";
|
|
12
|
-
import "./chunk-
|
|
12
|
+
import "./chunk-UK5P4Q2U.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-HCJVU4VT.js";
|
|
11
|
+
import "./chunk-S3JTAWKH.js";
|
|
12
12
|
import {
|
|
13
13
|
AGENT,
|
|
14
14
|
headlessAgentRequestSchema
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-UK5P4Q2U.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-U524262Y.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-QPK3QAPC.js";
|
|
61
61
|
import {
|
|
62
62
|
BaseRefreshManager,
|
|
63
63
|
CodexAspAuthMethodChangedError,
|
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
refreshDelayMs,
|
|
73
73
|
restartCodexAspHost,
|
|
74
74
|
routineRefreshExclusions
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-XXTWLY4O.js";
|
|
76
76
|
import {
|
|
77
77
|
ENGINE_ENV,
|
|
78
78
|
monolithRequest,
|
|
@@ -80,16 +80,16 @@ import {
|
|
|
80
80
|
readRuntimeEnvFile,
|
|
81
81
|
reloadEngineEnv,
|
|
82
82
|
setAgentCredentialSnapshot
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-I5P65PFM.js";
|
|
84
84
|
import {
|
|
85
85
|
AspClient,
|
|
86
86
|
getCodexModelProvider
|
|
87
|
-
} from "./chunk-
|
|
87
|
+
} from "./chunk-HCJVU4VT.js";
|
|
88
88
|
import {
|
|
89
89
|
SUBPROCESS_MAX_BUFFER,
|
|
90
90
|
execAsync,
|
|
91
91
|
execFileAsync
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-S3JTAWKH.js";
|
|
93
93
|
import {
|
|
94
94
|
isRecord as isRecord2
|
|
95
95
|
} from "./chunk-UZSNFLDQ.js";
|
|
@@ -316,7 +316,7 @@ import {
|
|
|
316
316
|
workspaceCredentialProviderSchema,
|
|
317
317
|
workspaceTokenRequestSchema,
|
|
318
318
|
workspaceTokenResponseSchema
|
|
319
|
-
} from "./chunk-
|
|
319
|
+
} from "./chunk-UK5P4Q2U.js";
|
|
320
320
|
import {
|
|
321
321
|
cloneMcpConfig,
|
|
322
322
|
ensureCompatibilityImports,
|
|
@@ -13283,6 +13283,12 @@ var ClaudeTransientTurnError = class extends Error {
|
|
|
13283
13283
|
}
|
|
13284
13284
|
midTurn;
|
|
13285
13285
|
};
|
|
13286
|
+
var ClaudeMissingSessionError = class extends Error {
|
|
13287
|
+
constructor(message) {
|
|
13288
|
+
super(message);
|
|
13289
|
+
this.name = "ClaudeMissingSessionError";
|
|
13290
|
+
}
|
|
13291
|
+
};
|
|
13286
13292
|
var ClaudeQuotaError = class extends Error {
|
|
13287
13293
|
constructor(message, kind) {
|
|
13288
13294
|
super(message);
|
|
@@ -13385,8 +13391,10 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13385
13391
|
const userMessage = await this.buildUserMessage(request);
|
|
13386
13392
|
if (this.pendingTurn !== pendingTurn || this.activePromptStream !== promptStream) return false;
|
|
13387
13393
|
pendingTurn.userMessageUuids.add(userMessage.uuid);
|
|
13394
|
+
const steer = { ...userMessage, priority: "next" };
|
|
13395
|
+
pendingTurn.steered.push(steer);
|
|
13388
13396
|
await this.recordEvent(userMessage, request.messageId);
|
|
13389
|
-
promptStream.push(
|
|
13397
|
+
promptStream.push(steer);
|
|
13390
13398
|
return true;
|
|
13391
13399
|
}
|
|
13392
13400
|
async abortAllPendingToolInputs() {
|
|
@@ -13652,7 +13660,9 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13652
13660
|
let authRetries = 0;
|
|
13653
13661
|
let transientRetries = 0;
|
|
13654
13662
|
let midTurnContinues = 0;
|
|
13663
|
+
let missingSessionReset = false;
|
|
13655
13664
|
let currentRequest = request;
|
|
13665
|
+
let carriedSteers = [];
|
|
13656
13666
|
await this.goalClear?.catch(() => {
|
|
13657
13667
|
});
|
|
13658
13668
|
try {
|
|
@@ -13660,8 +13670,10 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13660
13670
|
await this.turnCredentials?.refresh();
|
|
13661
13671
|
while (true) {
|
|
13662
13672
|
const attemptedCredential = this.turnCredentials ? this.turnCredentials.snapshot() : ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.claude;
|
|
13673
|
+
const steered = carriedSteers;
|
|
13674
|
+
carriedSteers = [];
|
|
13663
13675
|
try {
|
|
13664
|
-
await this.executeQuery(currentRequest, { skipUserMessageRecord: attempt > 0 });
|
|
13676
|
+
await this.executeQuery(currentRequest, { skipUserMessageRecord: attempt > 0, steered });
|
|
13665
13677
|
return;
|
|
13666
13678
|
} catch (error) {
|
|
13667
13679
|
lastError = error;
|
|
@@ -13702,6 +13714,16 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13702
13714
|
attempt++;
|
|
13703
13715
|
continue;
|
|
13704
13716
|
}
|
|
13717
|
+
if (error instanceof ClaudeMissingSessionError && !missingSessionReset) {
|
|
13718
|
+
missingSessionReset = true;
|
|
13719
|
+
console.warn(`[ClaudeManager] Session ${this.sessionId} has no transcript; starting a fresh session:`, error.message);
|
|
13720
|
+
this.sessionId = null;
|
|
13721
|
+
carriedSteers = steered;
|
|
13722
|
+
await this.onSaveSessionId(null);
|
|
13723
|
+
await this.tearDownSession();
|
|
13724
|
+
attempt++;
|
|
13725
|
+
continue;
|
|
13726
|
+
}
|
|
13705
13727
|
if (error instanceof ClaudeTransientTurnError && error.midTurn) {
|
|
13706
13728
|
if (midTurnContinues >= MAX_MIDTURN_CONTINUE_RETRIES) {
|
|
13707
13729
|
await this.emitMidTurnExhaustedEvent(error);
|
|
@@ -13884,8 +13906,16 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
13884
13906
|
return;
|
|
13885
13907
|
}
|
|
13886
13908
|
await new Promise((resolve7, reject) => {
|
|
13887
|
-
|
|
13909
|
+
const steered = options.steered ?? [];
|
|
13910
|
+
this.pendingTurn = {
|
|
13911
|
+
resolve: resolve7,
|
|
13912
|
+
reject,
|
|
13913
|
+
sawActivity: false,
|
|
13914
|
+
steered,
|
|
13915
|
+
userMessageUuids: /* @__PURE__ */ new Set([userMessage.uuid, ...steered.flatMap((steer) => steer.uuid ?? [])])
|
|
13916
|
+
};
|
|
13888
13917
|
promptStream.push(goalCommand ? { ...userMessage, message: { role: "user", content: `/goal ${goalObjective ?? "clear"}` } } : userMessage);
|
|
13918
|
+
for (const steer of steered) promptStream.push(steer);
|
|
13889
13919
|
});
|
|
13890
13920
|
}
|
|
13891
13921
|
async buildUserMessage({ message, images }) {
|
|
@@ -14094,36 +14124,15 @@ var ClaudeManager = class _ClaudeManager extends CodingAgentManager {
|
|
|
14094
14124
|
const msg = next.value;
|
|
14095
14125
|
if (!msg) break;
|
|
14096
14126
|
const authErrorMessage = _ClaudeManager.detectAuthErrorInMessage(msg);
|
|
14097
|
-
if (authErrorMessage) {
|
|
14098
|
-
suppressLinearResponseFlush = true;
|
|
14099
|
-
this.failPendingTurn(new ClaudeAuthError(authErrorMessage));
|
|
14100
|
-
try {
|
|
14101
|
-
response.close();
|
|
14102
|
-
} catch (err) {
|
|
14103
|
-
console.warn("[ClaudeManager] query.close() during auth error failed:", err);
|
|
14104
|
-
}
|
|
14105
|
-
return;
|
|
14106
|
-
}
|
|
14107
|
-
const quotaError = _ClaudeManager.detectQuotaErrorInMessage(msg);
|
|
14108
|
-
if (quotaError) {
|
|
14109
|
-
suppressLinearResponseFlush = true;
|
|
14110
|
-
this.failPendingTurn(quotaError);
|
|
14111
|
-
try {
|
|
14112
|
-
response.close();
|
|
14113
|
-
} catch (err) {
|
|
14114
|
-
console.warn("[ClaudeManager] query.close() during quota error failed:", err);
|
|
14115
|
-
}
|
|
14116
|
-
return;
|
|
14117
|
-
}
|
|
14118
14127
|
const transientErrorMessage = _ClaudeManager.detectTransientTurnErrorInMessage(msg);
|
|
14119
|
-
|
|
14128
|
+
const turnError = authErrorMessage ? new ClaudeAuthError(authErrorMessage) : msg.type === "result" && msg.subtype !== "success" && msg.num_turns === 0 && msg.errors.some((err) => err.startsWith("No conversation found with session ID")) ? new ClaudeMissingSessionError(msg.errors.join("\n")) : _ClaudeManager.detectQuotaErrorInMessage(msg) ?? (transientErrorMessage ? new ClaudeTransientTurnError(transientErrorMessage, this.pendingTurn?.sawActivity ?? false) : null);
|
|
14129
|
+
if (turnError) {
|
|
14120
14130
|
suppressLinearResponseFlush = true;
|
|
14121
|
-
|
|
14122
|
-
this.failPendingTurn(new ClaudeTransientTurnError(transientErrorMessage, sawActivity));
|
|
14131
|
+
this.failPendingTurn(turnError);
|
|
14123
14132
|
try {
|
|
14124
14133
|
response.close();
|
|
14125
14134
|
} catch (err) {
|
|
14126
|
-
console.warn(
|
|
14135
|
+
console.warn(`[ClaudeManager] query.close() after ${turnError.name} failed:`, err);
|
|
14127
14136
|
}
|
|
14128
14137
|
return;
|
|
14129
14138
|
}
|
|
@@ -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-QPK3QAPC.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-UK5P4Q2U.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
package/package.json
CHANGED
|
File without changes
|