replicas-engine 0.1.384 → 0.1.385

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 CHANGED
@@ -484,7 +484,7 @@ var WORKSPACE_SIZES = ["small", "large"];
484
484
  var INVALID_WORKSPACE_SIZE_ERROR = `Invalid size: must be one of ${WORKSPACE_SIZES.join(", ")}`;
485
485
 
486
486
  // ../shared/src/e2b.ts
487
- var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-02-v5";
487
+ var E2B_TEMPLATE_NAME = "replicas-sandbox-2026-07-02-v6";
488
488
 
489
489
  // ../shared/src/runtime-env.ts
490
490
  function parsePosixEnvFile(content) {
@@ -4186,7 +4186,7 @@ var GitService = class {
4186
4186
  if (!token) {
4187
4187
  return { status: "not_found" };
4188
4188
  }
4189
- const url = `${remote.instanceUrl}/api/v4/projects/${encodeURIComponent(remote.projectPath)}/merge_requests?state=opened&source_branch=${encodeURIComponent(branch)}`;
4189
+ const url = `${remote.instanceUrl}/api/v4/projects/${encodeURIComponent(remote.projectPath)}/merge_requests?source_branch=${encodeURIComponent(branch)}&order_by=updated_at`;
4190
4190
  try {
4191
4191
  const response = await fetch(url, {
4192
4192
  headers: { Authorization: `Bearer ${token}` },
@@ -4198,7 +4198,8 @@ var GitService = class {
4198
4198
  }
4199
4199
  const data = await response.json();
4200
4200
  if (!Array.isArray(data)) return { status: "not_found" };
4201
- const mergeRequest = data.find((item) => isRecord4(item) && item.source_branch === branch) ?? data[0];
4201
+ const branchMatches = data.filter((item) => isRecord4(item) && item.source_branch === branch);
4202
+ const mergeRequest = branchMatches.find((item) => item.state === "opened") ?? branchMatches[0] ?? data[0];
4202
4203
  if (!isRecord4(mergeRequest)) return { status: "not_found" };
4203
4204
  const webUrl = mergeRequest.web_url;
4204
4205
  if (typeof webUrl === "string" && webUrl.length > 0) return { status: "found", url: webUrl };
@@ -7848,7 +7849,7 @@ var AspClient = class {
7848
7849
  // src/managers/codex-asp/app-server-process.ts
7849
7850
  var DEFAULT_CODEX_BINARY = "codex";
7850
7851
  var DEFAULT_CODEX_ARGS = ["app-server", "--listen", "stdio://"];
7851
- var ENGINE_PACKAGE_VERSION = "0.1.384";
7852
+ var ENGINE_PACKAGE_VERSION = "0.1.385";
7852
7853
  var INITIALIZE_METHOD = "initialize";
7853
7854
  var INITIALIZED_NOTIFICATION = "initialized";
7854
7855
  var ACCOUNT_LOGIN_START_METHOD = "account/login/start";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-engine",
3
- "version": "0.1.384",
3
+ "version": "0.1.385",
4
4
  "description": "Lightweight API server for Replicas workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/src/index.js",