replicas-engine 0.1.245 → 0.1.247
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/index.js +32 -7
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -285,11 +285,19 @@ var SANDBOX_LIFECYCLE = {
|
|
|
285
285
|
AUTO_DELETE_MINUTES: -1,
|
|
286
286
|
SSH_TOKEN_EXPIRATION_MINUTES: 3 * 60
|
|
287
287
|
};
|
|
288
|
+
var SANDBOX_PATHS = {
|
|
289
|
+
HOME_DIR: "/home/user",
|
|
290
|
+
WORKSPACES_DIR: "/home/user/workspaces",
|
|
291
|
+
REPLICAS_DIR: "/home/user/.replicas",
|
|
292
|
+
REPLICAS_FILES_DIR: "/home/user/.replicas/files",
|
|
293
|
+
REPOS_PREPARED_MARKER: "/home/user/.replicas/repos-prepared-for-engine-init",
|
|
294
|
+
REPLICAS_RUNTIME_ENV_FILE: "/home/user/.replicas/runtime-env.sh"
|
|
295
|
+
};
|
|
288
296
|
var WORKSPACE_SIZES = ["small", "large"];
|
|
289
297
|
var INVALID_WORKSPACE_SIZE_ERROR = `Invalid size: must be one of ${WORKSPACE_SIZES.join(", ")}`;
|
|
290
298
|
|
|
291
299
|
// ../shared/src/e2b.ts
|
|
292
|
-
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-05-30-
|
|
300
|
+
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-05-30-v8";
|
|
293
301
|
|
|
294
302
|
// ../shared/src/runtime-env.ts
|
|
295
303
|
function parsePosixEnvFile(content) {
|
|
@@ -2637,7 +2645,7 @@ var codexTokenManager = new CodexTokenManager();
|
|
|
2637
2645
|
|
|
2638
2646
|
// src/git/service.ts
|
|
2639
2647
|
import { readdir, stat } from "fs/promises";
|
|
2640
|
-
import { existsSync as existsSync2 } from "fs";
|
|
2648
|
+
import { existsSync as existsSync2, unlinkSync } from "fs";
|
|
2641
2649
|
import { execFileSync as execFileSync2, spawnSync } from "child_process";
|
|
2642
2650
|
import { join as join5 } from "path";
|
|
2643
2651
|
|
|
@@ -2919,6 +2927,7 @@ var GitService = class {
|
|
|
2919
2927
|
};
|
|
2920
2928
|
}
|
|
2921
2929
|
const repos = await this.listRepositories();
|
|
2930
|
+
const skipNetworkRefresh = this.consumeReposPreparedMarker();
|
|
2922
2931
|
if (repos.length === 0) {
|
|
2923
2932
|
return {
|
|
2924
2933
|
success: true,
|
|
@@ -2943,7 +2952,9 @@ var GitService = class {
|
|
|
2943
2952
|
};
|
|
2944
2953
|
const persistedState = await loadRepoState(repo.name);
|
|
2945
2954
|
const persistedBranch = persistedState?.currentBranch;
|
|
2946
|
-
|
|
2955
|
+
if (!skipNetworkRefresh) {
|
|
2956
|
+
runGitCommand(["fetch", "--all", "--prune", `--filter=${GIT_PARTIAL_CLONE_FILTER}`], repo.path);
|
|
2957
|
+
}
|
|
2947
2958
|
if (persistedBranch && branchExists(persistedBranch, repo.path)) {
|
|
2948
2959
|
const currentBranch = getCurrentBranch(repo.path);
|
|
2949
2960
|
if (currentBranch !== persistedBranch) {
|
|
@@ -2958,9 +2969,11 @@ var GitService = class {
|
|
|
2958
2969
|
continue;
|
|
2959
2970
|
}
|
|
2960
2971
|
runGitCommand(["checkout", repo.defaultBranch], repo.path);
|
|
2961
|
-
|
|
2962
|
-
|
|
2963
|
-
|
|
2972
|
+
if (!skipNetworkRefresh) {
|
|
2973
|
+
try {
|
|
2974
|
+
runGitCommand(["pull", "--rebase", "--autostash"], repo.path);
|
|
2975
|
+
} catch {
|
|
2976
|
+
}
|
|
2964
2977
|
}
|
|
2965
2978
|
const branchName = this.findAvailableBranchName(workspaceName, repo.path);
|
|
2966
2979
|
runGitCommand(["checkout", "-b", branchName], repo.path);
|
|
@@ -2988,6 +3001,18 @@ var GitService = class {
|
|
|
2988
3001
|
error: failed.length > 0 ? `Git init failed for ${failed.length} repo(s)` : void 0
|
|
2989
3002
|
};
|
|
2990
3003
|
}
|
|
3004
|
+
consumeReposPreparedMarker() {
|
|
3005
|
+
const markerPath = SANDBOX_PATHS.REPOS_PREPARED_MARKER;
|
|
3006
|
+
if (!existsSync2(markerPath)) {
|
|
3007
|
+
return false;
|
|
3008
|
+
}
|
|
3009
|
+
try {
|
|
3010
|
+
unlinkSync(markerPath);
|
|
3011
|
+
} catch {
|
|
3012
|
+
return false;
|
|
3013
|
+
}
|
|
3014
|
+
return true;
|
|
3015
|
+
}
|
|
2991
3016
|
getGitDiffStats(repoPath, defaultBranch) {
|
|
2992
3017
|
try {
|
|
2993
3018
|
const diffBase = this.getDiffBase(repoPath, defaultBranch);
|
|
@@ -6114,7 +6139,7 @@ var AspClient = class {
|
|
|
6114
6139
|
// src/managers/codex-asp/app-server-process.ts
|
|
6115
6140
|
var DEFAULT_CODEX_BINARY = "codex";
|
|
6116
6141
|
var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
|
|
6117
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
6142
|
+
var ENGINE_PACKAGE_VERSION = "0.1.247";
|
|
6118
6143
|
var INITIALIZE_METHOD = "initialize";
|
|
6119
6144
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
6120
6145
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|