replicas-engine 0.1.449 → 0.1.451
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 -11
- package/package.json +1 -1
package/dist/src/index.js
CHANGED
|
@@ -516,7 +516,7 @@ var WORKSPACE_SIZES = ["small", "large"];
|
|
|
516
516
|
var INVALID_WORKSPACE_SIZE_ERROR = `Invalid size: must be one of ${WORKSPACE_SIZES.join(", ")}`;
|
|
517
517
|
|
|
518
518
|
// ../shared/src/e2b.ts
|
|
519
|
-
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-19-
|
|
519
|
+
var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-19-v3";
|
|
520
520
|
|
|
521
521
|
// ../shared/src/runtime-env.ts
|
|
522
522
|
function shellQuotePosix(value) {
|
|
@@ -8569,7 +8569,7 @@ var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
|
|
|
8569
8569
|
var MIN_CODEX_CLI_VERSION = "0.144.0";
|
|
8570
8570
|
var CODEX_UPGRADE_TIMEOUT_MS = 12e4;
|
|
8571
8571
|
var codexCliVersionEnsured = null;
|
|
8572
|
-
var ENGINE_PACKAGE_VERSION = "0.1.
|
|
8572
|
+
var ENGINE_PACKAGE_VERSION = "0.1.451";
|
|
8573
8573
|
var INITIALIZE_METHOD = "initialize";
|
|
8574
8574
|
var INITIALIZED_NOTIFICATION = "initialized";
|
|
8575
8575
|
var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
|
|
@@ -15217,7 +15217,20 @@ var HeartbeatService = class _HeartbeatService {
|
|
|
15217
15217
|
var heartbeatService = new HeartbeatService();
|
|
15218
15218
|
|
|
15219
15219
|
// src/index.ts
|
|
15220
|
-
|
|
15220
|
+
var startupStartedAt = performance.now();
|
|
15221
|
+
var startupTimings = {};
|
|
15222
|
+
async function timeStartupStep(name, fn) {
|
|
15223
|
+
const startedAt = performance.now();
|
|
15224
|
+
try {
|
|
15225
|
+
return await fn();
|
|
15226
|
+
} finally {
|
|
15227
|
+
startupTimings[name] = {
|
|
15228
|
+
startedAtMs: startedAt - startupStartedAt,
|
|
15229
|
+
durationMs: performance.now() - startedAt
|
|
15230
|
+
};
|
|
15231
|
+
}
|
|
15232
|
+
}
|
|
15233
|
+
await timeStartupStep("engine_logger_initialize", () => engineLogger.initialize());
|
|
15221
15234
|
process.on("uncaughtException", (error) => {
|
|
15222
15235
|
console.error("[FATAL] Uncaught exception:", error);
|
|
15223
15236
|
engineLogger.flush().finally(() => process.exit(1));
|
|
@@ -15235,7 +15248,7 @@ process.on("unhandledRejection", (reason) => {
|
|
|
15235
15248
|
console.error("[FATAL] Unhandled rejection:", reason);
|
|
15236
15249
|
engineLogger.flush().finally(() => process.exit(1));
|
|
15237
15250
|
});
|
|
15238
|
-
await eventService.initialize();
|
|
15251
|
+
await timeStartupStep("event_service_initialize", () => eventService.initialize());
|
|
15239
15252
|
async function checkActiveSSHSessions() {
|
|
15240
15253
|
try {
|
|
15241
15254
|
const { stdout } = await execAsync('who | grep -v "^$" | wc -l', { encoding: "utf-8" });
|
|
@@ -15276,10 +15289,18 @@ var authMiddleware = async (c, next) => {
|
|
|
15276
15289
|
};
|
|
15277
15290
|
var chatService = new ChatService(gitService.getWorkspaceRoot());
|
|
15278
15291
|
app.get("/health", (c) => {
|
|
15292
|
+
const response = {
|
|
15293
|
+
status: engineReady ? "active" : "initializing",
|
|
15294
|
+
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
15295
|
+
startup: {
|
|
15296
|
+
elapsedMs: performance.now() - startupStartedAt,
|
|
15297
|
+
steps: startupTimings
|
|
15298
|
+
}
|
|
15299
|
+
};
|
|
15279
15300
|
if (!engineReady) {
|
|
15280
|
-
return c.json(
|
|
15301
|
+
return c.json(response, 503);
|
|
15281
15302
|
}
|
|
15282
|
-
return c.json(
|
|
15303
|
+
return c.json(response);
|
|
15283
15304
|
});
|
|
15284
15305
|
app.use("*", authMiddleware);
|
|
15285
15306
|
app.get("/status", async (c) => {
|
|
@@ -15443,17 +15464,17 @@ serve(
|
|
|
15443
15464
|
} else {
|
|
15444
15465
|
console.log(`Replicas Engine running on port ${info.port}`);
|
|
15445
15466
|
}
|
|
15446
|
-
const gitResult = await gitService.initializeGitRepository();
|
|
15467
|
+
const gitResult = await timeStartupStep("git_initialize", () => gitService.initializeGitRepository());
|
|
15447
15468
|
if (!gitResult.success && gitResult.error) {
|
|
15448
15469
|
console.warn(`Git initialization warning: ${gitResult.error}`);
|
|
15449
15470
|
}
|
|
15450
15471
|
if (!IS_WARMING_MODE) {
|
|
15451
|
-
await replicasConfigService.initialize();
|
|
15472
|
+
await timeStartupStep("replicas_config_initialize", () => replicasConfigService.initialize());
|
|
15452
15473
|
}
|
|
15453
|
-
await chatService.initialize();
|
|
15454
|
-
await previewService.initialize();
|
|
15474
|
+
await timeStartupStep("chat_initialize", () => chatService.initialize());
|
|
15475
|
+
await timeStartupStep("preview_initialize", () => previewService.initialize());
|
|
15455
15476
|
if (!IS_WARMING_MODE) {
|
|
15456
|
-
await githubTokenManager.start();
|
|
15477
|
+
await timeStartupStep("github_token_initialize", () => githubTokenManager.start());
|
|
15457
15478
|
}
|
|
15458
15479
|
engineReady = true;
|
|
15459
15480
|
void registerDesktopPreview();
|