replicas-engine 0.1.1397 → 0.1.1400
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-V4Z2IWIC.js → asp-host-VO6GUETG.js} +3 -3
- package/dist/src/{chunk-PT2A7PFQ.js → chunk-3BSIPXBJ.js} +2 -2
- package/dist/src/{chunk-ZAWHU4YI.js → chunk-6T63LFKY.js} +1 -1
- package/dist/src/{chunk-7SNCJCAM.js → chunk-7KHNOK6U.js} +1 -1
- package/dist/src/{chunk-MMXN6UVW.js → chunk-CVCDTWVK.js} +1 -1
- package/dist/src/{chunk-QWFVHYTA.js → chunk-PCQI76S6.js} +4 -4
- package/dist/src/command-protection-hook.js +2 -2
- package/dist/src/headless-agent.js +2 -2
- package/dist/src/index.js +13 -9
- package/package.json +1 -1
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
listRunningCodexModels,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
12
|
-
import "./chunk-
|
|
13
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-PCQI76S6.js";
|
|
12
|
+
import "./chunk-3BSIPXBJ.js";
|
|
13
|
+
import "./chunk-6T63LFKY.js";
|
|
14
14
|
import "./chunk-F35HDB4V.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
16
|
import "./chunk-FYNT73JM.js";
|
|
@@ -313,8 +313,8 @@ var MonolithService = class {
|
|
|
313
313
|
getSubagentMcpConfig() {
|
|
314
314
|
return this.getJson("/v1/engine/subagent-mcp", (body) => isRecord(body) && typeof body.enabled === "boolean" && Array.isArray(body.providers) && body.providers.every((provider) => typeof provider === "string" && isValidAgentProvider(provider)) ? { enabled: body.enabled, providers: body.providers } : null, AbortSignal.timeout(1e4));
|
|
315
315
|
}
|
|
316
|
-
getAutoCompactConfig() {
|
|
317
|
-
return this.getJson(
|
|
316
|
+
getAutoCompactConfig(provider) {
|
|
317
|
+
return this.getJson(`/v1/engine/auto-compact?provider=${provider}`, (body) => isRecord(body) && (body.tokens === null || typeof body.tokens === "number") ? { tokens: body.tokens } : null, AbortSignal.timeout(1e4));
|
|
318
318
|
}
|
|
319
319
|
getOpenRouterModels() {
|
|
320
320
|
return this.getJson("/v1/engine/openrouter-models", (body) => isRecord(body) && Array.isArray(body.models) && body.models.every((model) => typeof model === "string") ? body.models : null);
|
|
@@ -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.1400";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -10,11 +10,11 @@ import {
|
|
|
10
10
|
resolveDiffBase,
|
|
11
11
|
runGitCommand,
|
|
12
12
|
setAgentCredentialSnapshot
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-3BSIPXBJ.js";
|
|
14
14
|
import {
|
|
15
15
|
AppServerProcess,
|
|
16
16
|
buildCodexAgentEnv
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-6T63LFKY.js";
|
|
18
18
|
import {
|
|
19
19
|
SUBPROCESS_MAX_BUFFER,
|
|
20
20
|
execFileAsync
|
|
@@ -319,7 +319,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
319
319
|
await this.applyCredentialUpdate(++this.credentialGeneration, async () => {
|
|
320
320
|
await this.applyCredentialsResponse(data);
|
|
321
321
|
setAgentCredentialSnapshot("codex", data);
|
|
322
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
322
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-VO6GUETG.js");
|
|
323
323
|
await restartCodexAspHostIfRunning2();
|
|
324
324
|
});
|
|
325
325
|
await this.start(true);
|
|
@@ -341,7 +341,7 @@ var CodexTokenManager = class extends BaseRefreshManager {
|
|
|
341
341
|
const accountChanged = ENGINE_ENV.REPLICAS_AGENT_CREDENTIALS.codex?.credentialId !== data.credentialId;
|
|
342
342
|
await this.applyCredentialsResponse(data);
|
|
343
343
|
if (restartOnChange && (accountChanged || CODEX_AUTH_ENV_KEYS.some((key, index) => process.env[key] !== previousEnv[index]))) {
|
|
344
|
-
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-
|
|
344
|
+
const { restartCodexAspHostIfRunning: restartCodexAspHostIfRunning2 } = await import("./asp-host-VO6GUETG.js");
|
|
345
345
|
await restartCodexAspHostIfRunning2();
|
|
346
346
|
}
|
|
347
347
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -3,8 +3,8 @@ 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-CVCDTWVK.js";
|
|
7
|
+
import "./chunk-3BSIPXBJ.js";
|
|
8
8
|
import "./chunk-F35HDB4V.js";
|
|
9
9
|
import {
|
|
10
10
|
isRecord
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
recoverCompletedTurn,
|
|
15
15
|
spawnMuseMsp,
|
|
16
16
|
startMuseSession
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7KHNOK6U.js";
|
|
18
18
|
import {
|
|
19
19
|
AppServerProcess,
|
|
20
20
|
buildCodexAgentEnv
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-6T63LFKY.js";
|
|
22
22
|
import "./chunk-F35HDB4V.js";
|
|
23
23
|
import {
|
|
24
24
|
AGENT,
|
package/dist/src/index.js
CHANGED
|
@@ -27,7 +27,7 @@ import {
|
|
|
27
27
|
evaluateCommandProtection,
|
|
28
28
|
extractToolCommand,
|
|
29
29
|
reportCommandProtectionBlock
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-CVCDTWVK.js";
|
|
31
31
|
import {
|
|
32
32
|
ACCOUNT_RATE_LIMITS_UPDATED_METHOD,
|
|
33
33
|
AGENT_MESSAGE_DELTA_METHOD,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
spawnMuseMsp,
|
|
66
66
|
startMuseSession,
|
|
67
67
|
uuidV7
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-7KHNOK6U.js";
|
|
69
69
|
import {
|
|
70
70
|
publishedPullRequestUrls
|
|
71
71
|
} from "./chunk-NM7LRVLC.js";
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
timestampFromSeconds,
|
|
144
144
|
upsertCredentialFileLines,
|
|
145
145
|
writeSecureCredentialFile
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-PCQI76S6.js";
|
|
147
147
|
import {
|
|
148
148
|
ENGINE_ENV,
|
|
149
149
|
monolithRequest,
|
|
@@ -153,10 +153,10 @@ import {
|
|
|
153
153
|
resolveDiffBase,
|
|
154
154
|
setAgentCredentialSnapshot,
|
|
155
155
|
setLinearSessionId
|
|
156
|
-
} from "./chunk-
|
|
156
|
+
} from "./chunk-3BSIPXBJ.js";
|
|
157
157
|
import {
|
|
158
158
|
getCodexModelProvider
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-6T63LFKY.js";
|
|
160
160
|
import {
|
|
161
161
|
SUBPROCESS_MAX_BUFFER,
|
|
162
162
|
execAsync,
|
|
@@ -8671,6 +8671,7 @@ import { serve } from "@hono/node-server";
|
|
|
8671
8671
|
import { Hono as Hono2 } from "hono";
|
|
8672
8672
|
import { randomUUID as randomUUID11 } from "crypto";
|
|
8673
8673
|
import { connect } from "net";
|
|
8674
|
+
import { Agent as Agent2, getGlobalDispatcher, setGlobalDispatcher } from "undici";
|
|
8674
8675
|
import { WebSocketServer } from "ws";
|
|
8675
8676
|
|
|
8676
8677
|
// src/managers/github-token-manager.ts
|
|
@@ -11805,7 +11806,7 @@ var CodingAgentManager = class _CodingAgentManager {
|
|
|
11805
11806
|
authFallback;
|
|
11806
11807
|
subagentMcpChatId;
|
|
11807
11808
|
subagentMcpEnabledForTurn = false;
|
|
11808
|
-
|
|
11809
|
+
autoCompactProvider;
|
|
11809
11810
|
autoCompactTokens = null;
|
|
11810
11811
|
unreadSteers = /* @__PURE__ */ new Map();
|
|
11811
11812
|
// A harness can read a steer before steerRequest returns, so a read is noted here until the steer settles.
|
|
@@ -11831,7 +11832,7 @@ var CodingAgentManager = class _CodingAgentManager {
|
|
|
11831
11832
|
this.onUsageUpdate = options.onUsageUpdate ?? (() => {
|
|
11832
11833
|
});
|
|
11833
11834
|
this.subagentMcpChatId = options.parentChatId === null && options.provider && SUBAGENT_MCP_HARNESSES.includes(options.provider) ? options.chatId : void 0;
|
|
11834
|
-
this.
|
|
11835
|
+
this.autoCompactProvider = options.provider === "claude" || options.provider === "codex" ? options.provider : null;
|
|
11835
11836
|
this.topLevel = options.parentChatId === null;
|
|
11836
11837
|
this.chatId = options.chatId;
|
|
11837
11838
|
this.originChatId = options.originChatId;
|
|
@@ -11972,8 +11973,8 @@ ${request.message}` }, senderKey };
|
|
|
11972
11973
|
if (config) this.subagentMcpEnabledForTurn = await this.subagentMcpForTurn(config.enabled);
|
|
11973
11974
|
}
|
|
11974
11975
|
async refreshAutoCompactTokens() {
|
|
11975
|
-
if (!this.
|
|
11976
|
-
const config = await monolithService.getAutoCompactConfig();
|
|
11976
|
+
if (!this.autoCompactProvider) return;
|
|
11977
|
+
const config = await monolithService.getAutoCompactConfig(this.autoCompactProvider);
|
|
11977
11978
|
if (config) this.autoCompactTokens = config.tokens;
|
|
11978
11979
|
}
|
|
11979
11980
|
/** Harnesses that fix their tool set per session override this to keep a session's original mode. */
|
|
@@ -65040,6 +65041,9 @@ async function activate(requested) {
|
|
|
65040
65041
|
}
|
|
65041
65042
|
lifecycle.claim(workspaceId);
|
|
65042
65043
|
await stopWorkspaceServices();
|
|
65044
|
+
const pausedDispatcher = getGlobalDispatcher();
|
|
65045
|
+
setGlobalDispatcher(new Agent2());
|
|
65046
|
+
void pausedDispatcher.close();
|
|
65043
65047
|
reloadEngineEnv(runtimeEnvFile);
|
|
65044
65048
|
startupStartedAt = performance.now();
|
|
65045
65049
|
backgroundController = new AbortController();
|