replicas-engine 0.1.1345 → 0.1.1346
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-W7RZCJZ7.js → asp-host-NP3IXOT5.js} +2 -2
- package/dist/src/{chunk-HWY6BIUJ.js → chunk-RHOEVNLT.js} +1 -1
- package/dist/src/{chunk-NFCTHJYW.js → chunk-XBQY5PKW.js} +1 -1
- package/dist/src/{chunk-S7YTEUA6.js → chunk-YPCT6I6X.js} +26 -15
- package/dist/src/headless-agent.js +2 -2
- package/dist/src/index.js +3 -3
- package/package.json +1 -1
|
@@ -8,9 +8,9 @@ import {
|
|
|
8
8
|
listRunningCodexModels,
|
|
9
9
|
restartCodexAspHost,
|
|
10
10
|
restartCodexAspHostIfRunning
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-YPCT6I6X.js";
|
|
12
12
|
import "./chunk-4V6YPA4Z.js";
|
|
13
|
-
import "./chunk-
|
|
13
|
+
import "./chunk-RHOEVNLT.js";
|
|
14
14
|
import "./chunk-K4RSYNHQ.js";
|
|
15
15
|
import "./chunk-UZSNFLDQ.js";
|
|
16
16
|
import "./chunk-MWEZKRAF.js";
|
|
@@ -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.1346";
|
|
244
244
|
var INITIALIZE_METHOD = "initialize";
|
|
245
245
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
246
246
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
import {
|
|
15
15
|
AppServerProcess,
|
|
16
16
|
buildCodexAgentEnv
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-RHOEVNLT.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-NP3IXOT5.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-NP3IXOT5.js");
|
|
345
345
|
await restartCodexAspHostIfRunning2();
|
|
346
346
|
}
|
|
347
347
|
setAgentCredentialSnapshot("codex", data);
|
|
@@ -813,8 +813,12 @@ var GitService = class {
|
|
|
813
813
|
async refreshRepos(observedBranchesByRepo) {
|
|
814
814
|
const discovered = await this.listTrackedRepositories();
|
|
815
815
|
const states = [];
|
|
816
|
+
const prLookupsByGitDir = /* @__PURE__ */ new Map();
|
|
816
817
|
for (const repo of discovered.repos) {
|
|
817
818
|
try {
|
|
819
|
+
const gitDir = await runGitCommand(["rev-parse", "--path-format=absolute", "--git-common-dir"], repo.path).catch(() => repo.path);
|
|
820
|
+
const prLookups = prLookupsByGitDir.get(gitDir) ?? /* @__PURE__ */ new Map();
|
|
821
|
+
prLookupsByGitDir.set(gitDir, prLookups);
|
|
818
822
|
const persistedState = await loadRepoState(repo.name);
|
|
819
823
|
const currentBranch = await getCurrentBranch(repo.path) ?? repo.defaultBranch;
|
|
820
824
|
const startHooksCompleted = persistedState?.startHooksCompleted ?? false;
|
|
@@ -827,7 +831,8 @@ var GitService = class {
|
|
|
827
831
|
currentBranch,
|
|
828
832
|
startHooksCompleted,
|
|
829
833
|
persistedState,
|
|
830
|
-
observed
|
|
834
|
+
observed,
|
|
835
|
+
prLookups
|
|
831
836
|
);
|
|
832
837
|
states.push(state);
|
|
833
838
|
} catch {
|
|
@@ -1023,7 +1028,7 @@ Binary files /dev/null and ${quote(`b/${path2}`)} differ
|
|
|
1023
1028
|
return "";
|
|
1024
1029
|
}
|
|
1025
1030
|
}
|
|
1026
|
-
async getPullRequestUrl(repoName, repoPath, currentBranchArg, persistedRepoStateArg) {
|
|
1031
|
+
async getPullRequestUrl(repoName, repoPath, prLookups, currentBranchArg, persistedRepoStateArg) {
|
|
1027
1032
|
try {
|
|
1028
1033
|
const currentBranch = currentBranchArg ?? await getCurrentBranch(repoPath);
|
|
1029
1034
|
if (!currentBranch) {
|
|
@@ -1035,7 +1040,7 @@ Binary files /dev/null and ${quote(`b/${path2}`)} differ
|
|
|
1035
1040
|
}
|
|
1036
1041
|
const persistedRepoState = persistedRepoStateArg ?? await loadRepoState(repoName);
|
|
1037
1042
|
this.cachedPrByRepo.delete(repoName);
|
|
1038
|
-
const result = await this.
|
|
1043
|
+
const result = await this.lookupPrOnce(prLookups, repoName, repoPath, currentBranch);
|
|
1039
1044
|
if (result.status === "found") {
|
|
1040
1045
|
this.cachedPrByRepo.set(repoName, { prUrl: result.url, currentBranch });
|
|
1041
1046
|
if (persistedRepoState && !persistedRepoState.prUrls.includes(result.url)) {
|
|
@@ -1052,6 +1057,14 @@ Binary files /dev/null and ${quote(`b/${path2}`)} differ
|
|
|
1052
1057
|
return { status: "error" };
|
|
1053
1058
|
}
|
|
1054
1059
|
}
|
|
1060
|
+
lookupPrOnce(prLookups, repoName, repoPath, branch) {
|
|
1061
|
+
let lookup = prLookups.get(branch);
|
|
1062
|
+
if (!lookup) {
|
|
1063
|
+
lookup = this.lookupPrOnRemote(repoName, repoPath, branch);
|
|
1064
|
+
prLookups.set(branch, lookup);
|
|
1065
|
+
}
|
|
1066
|
+
return lookup;
|
|
1067
|
+
}
|
|
1055
1068
|
async lookupPrOnRemote(repoName, repoPath, branch) {
|
|
1056
1069
|
const origin = await this.getOriginInfo(repoPath);
|
|
1057
1070
|
if (origin.provider === "unknown") {
|
|
@@ -1197,20 +1210,18 @@ Binary files /dev/null and ${quote(`b/${path2}`)} differ
|
|
|
1197
1210
|
}
|
|
1198
1211
|
return "main";
|
|
1199
1212
|
}
|
|
1200
|
-
async refreshRepoMetadata(repo, currentBranch, startHooksCompleted, persistedState, observedBranches) {
|
|
1213
|
+
async refreshRepoMetadata(repo, currentBranch, startHooksCompleted, persistedState, observedBranches, prLookups) {
|
|
1201
1214
|
const notFound = { status: "not_found" };
|
|
1202
|
-
const prResult = currentBranch === repo.defaultBranch ? notFound : await this.getPullRequestUrl(repo.name, repo.path, currentBranch, persistedState);
|
|
1215
|
+
const prResult = currentBranch === repo.defaultBranch ? notFound : await this.getPullRequestUrl(repo.name, repo.path, prLookups, currentBranch, persistedState);
|
|
1203
1216
|
let prUrls = persistedState?.prUrls ?? [];
|
|
1204
1217
|
if (prResult.status === "found") {
|
|
1205
1218
|
prUrls = appendUniqueUrl(prUrls, prResult.url);
|
|
1206
1219
|
}
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
prUrls = appendUniqueUrl(prUrls, branchResult.url);
|
|
1213
|
-
}
|
|
1220
|
+
for (const branch of observedBranches) {
|
|
1221
|
+
if (branch === currentBranch || branch === repo.defaultBranch) continue;
|
|
1222
|
+
const branchResult = await this.lookupPrOnce(prLookups, repo.name, repo.path, branch);
|
|
1223
|
+
if (branchResult.status === "found") {
|
|
1224
|
+
prUrls = appendUniqueUrl(prUrls, branchResult.url);
|
|
1214
1225
|
}
|
|
1215
1226
|
}
|
|
1216
1227
|
const state = {
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
recoverCompletedTurn,
|
|
15
15
|
spawnMuseMsp,
|
|
16
16
|
startMuseSession
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-XBQY5PKW.js";
|
|
18
18
|
import {
|
|
19
19
|
AppServerProcess,
|
|
20
20
|
buildCodexAgentEnv
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-RHOEVNLT.js";
|
|
22
22
|
import "./chunk-K4RSYNHQ.js";
|
|
23
23
|
import {
|
|
24
24
|
AGENT,
|
package/dist/src/index.js
CHANGED
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
spawnMuseMsp,
|
|
66
66
|
startMuseSession,
|
|
67
67
|
uuidV7
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-XBQY5PKW.js";
|
|
69
69
|
import {
|
|
70
70
|
publishedPullRequestUrls
|
|
71
71
|
} from "./chunk-FUQSZYDZ.js";
|
|
@@ -143,7 +143,7 @@ import {
|
|
|
143
143
|
timestampFromSeconds,
|
|
144
144
|
upsertCredentialFileLines,
|
|
145
145
|
writeSecureCredentialFile
|
|
146
|
-
} from "./chunk-
|
|
146
|
+
} from "./chunk-YPCT6I6X.js";
|
|
147
147
|
import {
|
|
148
148
|
ENGINE_ENV,
|
|
149
149
|
monolithRequest,
|
|
@@ -156,7 +156,7 @@ import {
|
|
|
156
156
|
} from "./chunk-4V6YPA4Z.js";
|
|
157
157
|
import {
|
|
158
158
|
getCodexModelProvider
|
|
159
|
-
} from "./chunk-
|
|
159
|
+
} from "./chunk-RHOEVNLT.js";
|
|
160
160
|
import {
|
|
161
161
|
SUBPROCESS_MAX_BUFFER,
|
|
162
162
|
execAsync,
|