@arcships/morula-runtime 0.1.0-alpha.6 → 0.1.0-alpha.7
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/index.js +152 -38
- package/dist/morula.js +2 -2
- package/dist/plugin/plugin.json +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -729,7 +729,7 @@ var BUILD_ID, BUILD_CONTEXTS, BUILD_DEFAULT_CONTEXT;
|
|
|
729
729
|
var init_build_env = __esm({
|
|
730
730
|
"../morula-cli-core/dist/build-env.js"() {
|
|
731
731
|
"use strict";
|
|
732
|
-
BUILD_ID = "
|
|
732
|
+
BUILD_ID = "20260917073516.nogit";
|
|
733
733
|
BUILD_CONTEXTS = {
|
|
734
734
|
"local": "http://localhost:8080/api",
|
|
735
735
|
"test": "https://morula.basecastle.com/api",
|
|
@@ -3632,7 +3632,7 @@ init_dist2();
|
|
|
3632
3632
|
init_dist2();
|
|
3633
3633
|
|
|
3634
3634
|
// src/build-env.ts
|
|
3635
|
-
var BUILD_VERSION2 = "0.1.0-alpha.
|
|
3635
|
+
var BUILD_VERSION2 = "0.1.0-alpha.7";
|
|
3636
3636
|
|
|
3637
3637
|
// src/commands/daemon.ts
|
|
3638
3638
|
init_dist();
|
|
@@ -4605,24 +4605,49 @@ function buildGitlabSshRemote(repoFullName, baseUrl) {
|
|
|
4605
4605
|
return `ssh://git@${host}:${url.port}/${repoFullName}.git`;
|
|
4606
4606
|
return `git@${host}:${repoFullName}.git`;
|
|
4607
4607
|
}
|
|
4608
|
-
function
|
|
4608
|
+
function buildDaemonRepoUrl(repoFullName, baseUrl) {
|
|
4609
|
+
if (!baseUrl)
|
|
4610
|
+
return `https://github.com/${repoFullName}.git`;
|
|
4611
|
+
const url = new URL(baseUrl);
|
|
4612
|
+
const path = repoFullName.replace(/^\/+/, "");
|
|
4613
|
+
return `${url.protocol}//${url.host}/${path}.git`;
|
|
4614
|
+
}
|
|
4615
|
+
function ensureRepo(workdir, tenantId, repo, env, remoteUrl, daemonRemoteUrl) {
|
|
4609
4616
|
const repoDir = join11(workdir, tenantId, repo);
|
|
4617
|
+
const fetchUrl = daemonRemoteUrl ?? remoteUrl ?? buildDaemonRepoUrl(repo);
|
|
4610
4618
|
if (existsSync8(join11(repoDir, ".git"))) {
|
|
4611
4619
|
if (remoteUrl)
|
|
4612
4620
|
syncRemoteUrl(repoDir, remoteUrl, env);
|
|
4613
4621
|
try {
|
|
4614
|
-
|
|
4615
|
-
|
|
4622
|
+
if (daemonRemoteUrl) {
|
|
4623
|
+
execFileSync6(
|
|
4624
|
+
"git",
|
|
4625
|
+
["-C", repoDir, "fetch", "--prune", fetchUrl, "+refs/heads/*:refs/remotes/origin/*"],
|
|
4626
|
+
{ env, stdio: "pipe" }
|
|
4627
|
+
);
|
|
4628
|
+
} else {
|
|
4629
|
+
execFileSync6("git", ["-C", repoDir, "fetch", "origin", "--prune"], { env, stdio: "pipe" });
|
|
4630
|
+
}
|
|
4631
|
+
} catch (err) {
|
|
4632
|
+
throw new Error(`REPO_SYNC_FAILED: \u62C9\u53D6\u4ED3\u5E93\u5931\u8D25 ${repo}: ${gitErrorText(err)}`);
|
|
4616
4633
|
}
|
|
4617
4634
|
return repoDir;
|
|
4618
4635
|
}
|
|
4619
4636
|
mkdirSync6(repoDir, { recursive: true });
|
|
4620
|
-
|
|
4621
|
-
env,
|
|
4622
|
-
|
|
4623
|
-
|
|
4637
|
+
try {
|
|
4638
|
+
execFileSync6("git", ["clone", "--filter=blob:none", fetchUrl, repoDir], { env, stdio: "pipe" });
|
|
4639
|
+
} catch (err) {
|
|
4640
|
+
throw new Error(`REPO_SYNC_FAILED: \u514B\u9686\u4ED3\u5E93\u5931\u8D25 ${repo}: ${gitErrorText(err)}`);
|
|
4641
|
+
}
|
|
4642
|
+
if (remoteUrl && remoteUrl !== fetchUrl)
|
|
4643
|
+
syncRemoteUrl(repoDir, remoteUrl, env);
|
|
4624
4644
|
return repoDir;
|
|
4625
4645
|
}
|
|
4646
|
+
function gitErrorText(err) {
|
|
4647
|
+
const e = err;
|
|
4648
|
+
const stderr = e?.stderr ? e.stderr.toString().trim() : "";
|
|
4649
|
+
return stderr || e?.message || String(err);
|
|
4650
|
+
}
|
|
4626
4651
|
function syncRemoteUrl(repoDir, remoteUrl, env) {
|
|
4627
4652
|
try {
|
|
4628
4653
|
const cur = execFileSync6("git", ["-C", repoDir, "remote", "get-url", "origin"], { env, stdio: "pipe" }).toString().trim();
|
|
@@ -6005,31 +6030,58 @@ function ownerOf(repoFullName) {
|
|
|
6005
6030
|
function buildRepoCachePath(workdir, tenantId, repoFullName) {
|
|
6006
6031
|
return join14(workdir, "repos", tenantId, ownerOf(repoFullName), repoFullName);
|
|
6007
6032
|
}
|
|
6008
|
-
function openRepoCache(workdir, tenantId, repoFullName, env,
|
|
6033
|
+
function openRepoCache(workdir, tenantId, repoFullName, env, agentRemoteUrl, daemonRemoteUrl) {
|
|
6009
6034
|
const repoCachePath = buildRepoCachePath(workdir, tenantId, repoFullName);
|
|
6010
|
-
const
|
|
6035
|
+
const currentOrigin = () => {
|
|
6036
|
+
if (!existsSync11(join14(repoCachePath, ".git")))
|
|
6037
|
+
return null;
|
|
6038
|
+
try {
|
|
6039
|
+
return execFileSync7("git", ["-C", repoCachePath, "remote", "get-url", "origin"], { encoding: "utf8", env, stdio: "pipe" }).trim() || null;
|
|
6040
|
+
} catch {
|
|
6041
|
+
return null;
|
|
6042
|
+
}
|
|
6043
|
+
};
|
|
6044
|
+
const fetchUrl = () => daemonRemoteUrl ?? currentOrigin() ?? agentRemoteUrl ?? `https://github.com/${repoFullName}.git`;
|
|
6045
|
+
const originUrl = () => agentRemoteUrl ?? fetchUrl();
|
|
6011
6046
|
return {
|
|
6012
6047
|
repoCachePath,
|
|
6013
6048
|
ensure() {
|
|
6014
6049
|
if (existsSync11(join14(repoCachePath, ".git"))) {
|
|
6015
|
-
|
|
6016
|
-
syncRemoteUrl(repoCachePath, url, env);
|
|
6050
|
+
syncRemoteUrl(repoCachePath, originUrl(), env);
|
|
6017
6051
|
return;
|
|
6018
6052
|
}
|
|
6019
6053
|
mkdirSync8(dirname6(repoCachePath), { recursive: true });
|
|
6020
|
-
|
|
6021
|
-
|
|
6022
|
-
stdio: "pipe"
|
|
6023
|
-
})
|
|
6054
|
+
const cloneUrl = fetchUrl();
|
|
6055
|
+
try {
|
|
6056
|
+
execFileSync7("git", ["clone", "--filter=blob:none", cloneUrl, repoCachePath], { env, stdio: "pipe" });
|
|
6057
|
+
} catch (err) {
|
|
6058
|
+
throw new Error(`REPO_SYNC_FAILED: \u514B\u9686\u4ED3\u5E93\u5931\u8D25 ${repoFullName}: ${gitErrorText2(err)}`);
|
|
6059
|
+
}
|
|
6060
|
+
if (originUrl() !== cloneUrl)
|
|
6061
|
+
syncRemoteUrl(repoCachePath, originUrl(), env);
|
|
6024
6062
|
},
|
|
6025
6063
|
fetch() {
|
|
6026
6064
|
try {
|
|
6027
|
-
|
|
6028
|
-
|
|
6065
|
+
if (daemonRemoteUrl) {
|
|
6066
|
+
execFileSync7(
|
|
6067
|
+
"git",
|
|
6068
|
+
["-C", repoCachePath, "fetch", "--prune", daemonRemoteUrl, "+refs/heads/*:refs/remotes/origin/*"],
|
|
6069
|
+
{ env, stdio: "pipe" }
|
|
6070
|
+
);
|
|
6071
|
+
} else {
|
|
6072
|
+
execFileSync7("git", ["-C", repoCachePath, "fetch", "origin", "--prune"], { env, stdio: "pipe" });
|
|
6073
|
+
}
|
|
6074
|
+
} catch (err) {
|
|
6075
|
+
throw new Error(`REPO_SYNC_FAILED: \u62C9\u53D6\u4ED3\u5E93\u5931\u8D25 ${repoFullName}: ${gitErrorText2(err)}`);
|
|
6029
6076
|
}
|
|
6030
6077
|
}
|
|
6031
6078
|
};
|
|
6032
6079
|
}
|
|
6080
|
+
function gitErrorText2(err) {
|
|
6081
|
+
const e = err;
|
|
6082
|
+
const stderr = e?.stderr ? e.stderr.toString().trim() : "";
|
|
6083
|
+
return stderr || e?.message || String(err);
|
|
6084
|
+
}
|
|
6033
6085
|
|
|
6034
6086
|
// src/daemon/repo-checkout-service.ts
|
|
6035
6087
|
import { createServer as createServer3 } from "node:http";
|
|
@@ -6195,13 +6247,13 @@ function sleepSync2(ms) {
|
|
|
6195
6247
|
function backoffMs(baseMs, random = Math.random) {
|
|
6196
6248
|
return Math.round(baseMs * (0.5 + random() * 0.5));
|
|
6197
6249
|
}
|
|
6198
|
-
function
|
|
6250
|
+
function gitErrorText3(err) {
|
|
6199
6251
|
const e = err;
|
|
6200
6252
|
const stderr = e?.stderr ? e.stderr.toString() : "";
|
|
6201
6253
|
return `${stderr}${stderr ? "\n" : ""}${e?.message ?? String(err)}`;
|
|
6202
6254
|
}
|
|
6203
6255
|
function isIndexLockConflict(err) {
|
|
6204
|
-
const text =
|
|
6256
|
+
const text = gitErrorText3(err);
|
|
6205
6257
|
return /index\.lock/i.test(text) || /另一个 git 进程|another git process/i.test(text);
|
|
6206
6258
|
}
|
|
6207
6259
|
function worktreeIndexLockPath(repoCachePath, worktreePath) {
|
|
@@ -6242,7 +6294,7 @@ function addWorktreeWithRetry(repoCachePath, worktreePath, ref, deps = {}) {
|
|
|
6242
6294
|
throw err;
|
|
6243
6295
|
if (attempt === WORKTREE_ADD_MAX_ATTEMPTS)
|
|
6244
6296
|
break;
|
|
6245
|
-
const lockPath = indexLockPathFromError(
|
|
6297
|
+
const lockPath = indexLockPathFromError(gitErrorText3(err)) ?? worktreeIndexLockPath(repoCachePath, worktreePath);
|
|
6246
6298
|
const released = waitForIndexLockRelease(lockPath, waitMs);
|
|
6247
6299
|
const backoff = backoffMs(WORKTREE_ADD_BACKOFF_MS[attempt - 1]);
|
|
6248
6300
|
console.warn(
|
|
@@ -6251,7 +6303,7 @@ function addWorktreeWithRetry(repoCachePath, worktreePath, ref, deps = {}) {
|
|
|
6251
6303
|
sleepSync2(backoff);
|
|
6252
6304
|
}
|
|
6253
6305
|
}
|
|
6254
|
-
throw new Error(`WORKTREE_ADD_FAILED: worktree add \u8FDE\u7EED ${WORKTREE_ADD_MAX_ATTEMPTS} \u6B21\u5931\u8D25\uFF08${
|
|
6306
|
+
throw new Error(`WORKTREE_ADD_FAILED: worktree add \u8FDE\u7EED ${WORKTREE_ADD_MAX_ATTEMPTS} \u6B21\u5931\u8D25\uFF08${gitErrorText3(lastErr).trim()}\uFF09`);
|
|
6255
6307
|
}
|
|
6256
6308
|
var FOREIGN_RESIDUE_MAX_ENTRIES = 64;
|
|
6257
6309
|
var FOREIGN_RESIDUE_SCAN_LIMIT = 2e3;
|
|
@@ -6313,7 +6365,7 @@ function reportForeignResidue(worktreePath, forensics, cleaned) {
|
|
|
6313
6365
|
console.warn(`[daemon] ${detail}`);
|
|
6314
6366
|
}
|
|
6315
6367
|
function prepareWorktree(input) {
|
|
6316
|
-
const cache = openRepoCache(input.workdir, input.tenantId, input.repoFullName, input.env, input.remoteUrl);
|
|
6368
|
+
const cache = openRepoCache(input.workdir, input.tenantId, input.repoFullName, input.env, input.remoteUrl, input.daemonRemoteUrl);
|
|
6317
6369
|
cache.ensure();
|
|
6318
6370
|
cache.fetch();
|
|
6319
6371
|
const requestedBase = input.baseBranch?.trim();
|
|
@@ -6798,7 +6850,8 @@ var LocalRepoCheckoutService = class {
|
|
|
6798
6850
|
this.opts.tenantId,
|
|
6799
6851
|
repoFullName,
|
|
6800
6852
|
env,
|
|
6801
|
-
baseUrl ? buildGitlabSshRemote(repoFullName, baseUrl) : void 0
|
|
6853
|
+
baseUrl ? buildGitlabSshRemote(repoFullName, baseUrl) : void 0,
|
|
6854
|
+
baseUrl ? buildDaemonRepoUrl(repoFullName, baseUrl) : void 0
|
|
6802
6855
|
);
|
|
6803
6856
|
cache.ensure();
|
|
6804
6857
|
cache.fetch();
|
|
@@ -6806,6 +6859,8 @@ var LocalRepoCheckoutService = class {
|
|
|
6806
6859
|
repoCachePath: cache.repoCachePath,
|
|
6807
6860
|
taskRoot: task.workdir,
|
|
6808
6861
|
repoFullName,
|
|
6862
|
+
baseBranch: serverRes.baseBranch,
|
|
6863
|
+
ref: req.ref,
|
|
6809
6864
|
env
|
|
6810
6865
|
});
|
|
6811
6866
|
const headSha = execFileSync9("git", ["-C", worktreePath, "rev-parse", "HEAD"], { encoding: "utf8", env, stdio: "pipe" }).trim();
|
|
@@ -6859,7 +6914,8 @@ var LocalRepoCheckoutService = class {
|
|
|
6859
6914
|
this.opts.tenantId,
|
|
6860
6915
|
repoFullName,
|
|
6861
6916
|
env,
|
|
6862
|
-
baseUrl ? buildGitlabSshRemote(repoFullName, baseUrl) : void 0
|
|
6917
|
+
baseUrl ? buildGitlabSshRemote(repoFullName, baseUrl) : void 0,
|
|
6918
|
+
baseUrl ? buildDaemonRepoUrl(repoFullName, baseUrl) : void 0
|
|
6863
6919
|
);
|
|
6864
6920
|
cache.ensure();
|
|
6865
6921
|
cache.fetch();
|
|
@@ -6916,26 +6972,78 @@ function resolveRepoTargetDir(taskRoot, base) {
|
|
|
6916
6972
|
}
|
|
6917
6973
|
function materializeReadWorktree(input) {
|
|
6918
6974
|
const worktreePath = resolveRepoTargetDir(input.taskRoot, `${safeRepoDirName(input.repoFullName)}${READ_ONLY_REPO_DIR_SUFFIX}`);
|
|
6975
|
+
const targetRef = resolveReadRef(input.repoCachePath, input.env, input.ref, input.baseBranch);
|
|
6919
6976
|
if (existsSync14(join17(worktreePath, ".git"))) {
|
|
6920
|
-
|
|
6977
|
+
const current = currentBranchName(worktreePath);
|
|
6978
|
+
if (current)
|
|
6979
|
+
throw new Error(`READ_WORKTREE_DIRTY: \u53EA\u8BFB\u68C0\u51FA\u5DF2\u5207\u5230\u5206\u652F ${current}\uFF0C\u62D2\u7EDD\u81EA\u52A8\u66F4\u65B0\uFF08\u8BF7\u6E05\u7406\u8BE5\u76EE\u5F55\u540E\u91CD\u8BD5\uFF09`);
|
|
6980
|
+
if (hasLocalChanges2(worktreePath, input.env))
|
|
6981
|
+
throw new Error("READ_WORKTREE_DIRTY: \u53EA\u8BFB\u68C0\u51FA\u5B58\u5728\u672A\u63D0\u4EA4\u6539\u52A8\uFF0C\u62D2\u7EDD\u81EA\u52A8\u66F4\u65B0\uFF08\u8BF7\u6E05\u7406\u8BE5\u76EE\u5F55\u540E\u91CD\u8BD5\uFF09");
|
|
6982
|
+
execFileSync9("git", ["-C", worktreePath, "checkout", "--detach", targetRef], { env: input.env, stdio: "pipe" });
|
|
6921
6983
|
} else {
|
|
6922
6984
|
mkdirSync10(join17(worktreePath, ".."), { recursive: true });
|
|
6923
|
-
execFileSync9("git", ["-C", input.repoCachePath, "worktree", "add", "--detach", worktreePath,
|
|
6985
|
+
execFileSync9("git", ["-C", input.repoCachePath, "worktree", "add", "--detach", worktreePath, targetRef], {
|
|
6924
6986
|
env: input.env,
|
|
6925
6987
|
stdio: "pipe"
|
|
6926
6988
|
});
|
|
6927
6989
|
}
|
|
6928
6990
|
return worktreePath;
|
|
6929
6991
|
}
|
|
6930
|
-
function
|
|
6931
|
-
|
|
6932
|
-
|
|
6933
|
-
|
|
6992
|
+
function resolveReadRef(repoCachePath, env, requestedRef, baseBranch) {
|
|
6993
|
+
const requested = requestedRef?.trim();
|
|
6994
|
+
if (requested) {
|
|
6995
|
+
const candidates = requested.startsWith("refs/") ? [requested] : [`origin/${requested}`, requested];
|
|
6996
|
+
for (const ref of candidates) {
|
|
6997
|
+
if (refExists(repoCachePath, ref, env))
|
|
6998
|
+
return ref;
|
|
6999
|
+
}
|
|
7000
|
+
throw new Error(`REF_NOT_FOUND: repo cache \u65E0\u53EF\u7528\u5F15\u7528 ${requested}`);
|
|
7001
|
+
}
|
|
7002
|
+
const explicitBase = baseBranch?.trim();
|
|
7003
|
+
if (explicitBase) {
|
|
7004
|
+
const ref = `origin/${explicitBase}`;
|
|
7005
|
+
if (refExists(repoCachePath, ref, env))
|
|
6934
7006
|
return ref;
|
|
7007
|
+
throw new Error(`BASE_REF_NOT_FOUND: repo cache \u65E0\u9ED8\u8BA4\u5206\u652F ${explicitBase}`);
|
|
7008
|
+
}
|
|
7009
|
+
const remoteHead = (() => {
|
|
7010
|
+
try {
|
|
7011
|
+
const out = execFileSync9("git", ["-C", repoCachePath, "symbolic-ref", "refs/remotes/origin/HEAD"], { encoding: "utf8", env, stdio: "pipe" }).trim();
|
|
7012
|
+
return out.replace(/^refs\/remotes\//, "");
|
|
6935
7013
|
} catch {
|
|
7014
|
+
return null;
|
|
6936
7015
|
}
|
|
7016
|
+
})();
|
|
7017
|
+
for (const ref of [remoteHead, "origin/main", "origin/master"]) {
|
|
7018
|
+
if (!ref || !refExists(repoCachePath, ref, env))
|
|
7019
|
+
continue;
|
|
7020
|
+
return ref;
|
|
7021
|
+
}
|
|
7022
|
+
throw new Error("BASE_REF_NOT_FOUND: repo cache \u65E0\u53EF\u7528\u8FDC\u7AEF\u5F15\u7528\uFF08origin/HEAD / origin/main / origin/master\uFF09");
|
|
7023
|
+
}
|
|
7024
|
+
function refExists(repoPath, ref, env) {
|
|
7025
|
+
try {
|
|
7026
|
+
execFileSync9("git", ["-C", repoPath, "rev-parse", "--verify", ref], { env, stdio: "pipe" });
|
|
7027
|
+
return true;
|
|
7028
|
+
} catch {
|
|
7029
|
+
return false;
|
|
7030
|
+
}
|
|
7031
|
+
}
|
|
7032
|
+
function currentBranchName(repoPath) {
|
|
7033
|
+
try {
|
|
7034
|
+
const out = execFileSync9("git", ["-C", repoPath, "branch", "--show-current"], { encoding: "utf8", stdio: "pipe" }).trim();
|
|
7035
|
+
return out || null;
|
|
7036
|
+
} catch {
|
|
7037
|
+
return null;
|
|
7038
|
+
}
|
|
7039
|
+
}
|
|
7040
|
+
function hasLocalChanges2(repoPath, env) {
|
|
7041
|
+
try {
|
|
7042
|
+
const out = execFileSync9("git", ["-C", repoPath, "status", "--porcelain"], { encoding: "utf8", env, stdio: "pipe" }).trim();
|
|
7043
|
+
return out.length > 0;
|
|
7044
|
+
} catch {
|
|
7045
|
+
return true;
|
|
6937
7046
|
}
|
|
6938
|
-
throw new Error("BASE_REF_NOT_FOUND: repo cache \u65E0\u53EF\u7528\u5F15\u7528\uFF08origin/main / origin/master / HEAD\uFF09");
|
|
6939
7047
|
}
|
|
6940
7048
|
function listMaterializedRepoDirs(taskRoot, options = {}) {
|
|
6941
7049
|
const excluded = new Set(options.excludeDirs ?? []);
|
|
@@ -7031,10 +7139,14 @@ function syncGitIdentity(primaryDir, targetDir, env) {
|
|
|
7031
7139
|
}
|
|
7032
7140
|
function materializeAdditionalRepo(input) {
|
|
7033
7141
|
if (existsSync14(join17(input.targetPath, ".git"))) {
|
|
7034
|
-
|
|
7142
|
+
const current = currentBranchName(input.targetPath);
|
|
7143
|
+
if (!current && !hasLocalChanges2(input.targetPath, input.env)) {
|
|
7144
|
+
const targetRef = resolveReadRef(input.repoCachePath, input.env, void 0, input.baseBranch);
|
|
7145
|
+
execFileSync9("git", ["-C", input.targetPath, "checkout", "--detach", targetRef], { env: input.env, stdio: "pipe" });
|
|
7146
|
+
}
|
|
7035
7147
|
return input.targetPath;
|
|
7036
7148
|
}
|
|
7037
|
-
const candidates = input.baseBranch ? [`origin/${input.baseBranch}`, "origin/main", "origin/master"
|
|
7149
|
+
const candidates = input.baseBranch ? [`origin/${input.baseBranch}`, "origin/main", "origin/master"] : ["origin/main", "origin/master"];
|
|
7038
7150
|
let baseRef = null;
|
|
7039
7151
|
for (const ref of candidates) {
|
|
7040
7152
|
try {
|
|
@@ -7045,7 +7157,7 @@ function materializeAdditionalRepo(input) {
|
|
|
7045
7157
|
}
|
|
7046
7158
|
}
|
|
7047
7159
|
if (!baseRef)
|
|
7048
|
-
throw new Error("BASE_REF_NOT_FOUND: repo cache \u65E0\u53EF\u7528\u5F15\u7528\uFF08origin/<base> / origin/main / origin/master
|
|
7160
|
+
throw new Error("BASE_REF_NOT_FOUND: repo cache \u65E0\u53EF\u7528\u8FDC\u7AEF\u5F15\u7528\uFF08origin/<base> / origin/main / origin/master\uFF09");
|
|
7049
7161
|
mkdirSync10(join17(input.targetPath, ".."), { recursive: true });
|
|
7050
7162
|
execFileSync9("git", ["-C", input.repoCachePath, "worktree", "add", "--detach", input.targetPath, baseRef], {
|
|
7051
7163
|
env: input.env,
|
|
@@ -8205,6 +8317,7 @@ var DaemonRunner = class {
|
|
|
8205
8317
|
const wc = detail.workContext;
|
|
8206
8318
|
repoBaseUrl = tokenRes.baseUrl;
|
|
8207
8319
|
const remoteUrl = repoBaseUrl ? buildGitlabSshRemote(wc?.repoFullName ?? repo, repoBaseUrl) : void 0;
|
|
8320
|
+
const daemonRemoteUrl = buildDaemonRepoUrl(wc?.repoFullName ?? repo, repoBaseUrl);
|
|
8208
8321
|
env = { ...env, ...buildRepoEnv(tokenRes.token, repoBaseUrl) };
|
|
8209
8322
|
if (wc?.baseBranch?.trim())
|
|
8210
8323
|
env = { ...env, MORULA_BASE_BRANCH: wc.baseBranch.trim() };
|
|
@@ -8220,7 +8333,8 @@ var DaemonRunner = class {
|
|
|
8220
8333
|
baseBranch: wc.baseBranch || "main",
|
|
8221
8334
|
code: detail.code ?? null,
|
|
8222
8335
|
env,
|
|
8223
|
-
remoteUrl
|
|
8336
|
+
remoteUrl,
|
|
8337
|
+
daemonRemoteUrl
|
|
8224
8338
|
});
|
|
8225
8339
|
repoDir = managed.worktreePath;
|
|
8226
8340
|
worktreePath = managed.worktreePath;
|
|
@@ -8229,7 +8343,7 @@ var DaemonRunner = class {
|
|
|
8229
8343
|
});
|
|
8230
8344
|
this.log(`[daemon] \u4EFB\u52A1 ${taskId} \u5DE5\u4F5C\u533A\u5C31\u7EEA: ${taskRoot}\uFF08\u4ED3\u5E93 ${repoDir}\uFF0Cbranch=${wc.branchName}\uFF09`);
|
|
8231
8345
|
} else {
|
|
8232
|
-
repoDir = ensureRepo(cfg.workdir, this.tenantId, repo, env, remoteUrl);
|
|
8346
|
+
repoDir = ensureRepo(cfg.workdir, this.tenantId, repo, env, remoteUrl, daemonRemoteUrl);
|
|
8233
8347
|
taskRoot = repoDir;
|
|
8234
8348
|
}
|
|
8235
8349
|
ensureGitIdentity(repoDir, detail.executor.executorName);
|
package/dist/morula.js
CHANGED
|
@@ -686,8 +686,8 @@ function page(ok, message) {
|
|
|
686
686
|
}
|
|
687
687
|
|
|
688
688
|
// ../morula-cli-core/dist/build-env.js
|
|
689
|
-
var BUILD_VERSION = "0.1.0-alpha.
|
|
690
|
-
var BUILD_ID = "
|
|
689
|
+
var BUILD_VERSION = "0.1.0-alpha.7";
|
|
690
|
+
var BUILD_ID = "20260917073516.nogit";
|
|
691
691
|
var BUILD_CONTEXTS = {
|
|
692
692
|
"local": "http://localhost:8080/api",
|
|
693
693
|
"test": "https://morula.basecastle.com/api",
|
package/dist/plugin/plugin.json
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arcships/morula-runtime",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.1.0-alpha.
|
|
4
|
+
"version": "0.1.0-alpha.7",
|
|
5
5
|
"description": "Device-level CLI for the Morula local agent runtime (daemon/portal/models/auth) and the Morula business CLI (morula), distributed via npm",
|
|
6
6
|
"bin": {
|
|
7
7
|
"morula-runtime": "./bin/morula-runtime.js",
|