@cmmd-center/forge 0.13.144 → 0.13.146
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/bin.cjs +107 -8
- package/dist/bin.mjs +107 -8
- package/dist/client/assets/{CanvasPanel-56JpVM3f.js → CanvasPanel-BeSvnc85.js} +2 -2
- package/dist/client/assets/{DiffPanel-BQ8KUspI.js → DiffPanel-6_O4rsug.js} +2 -2
- package/dist/client/assets/{DiffPanel.logic-BlMI5dIa.js → DiffPanel.logic-CVhXbVzx.js} +2 -2
- package/dist/client/assets/{DiffWorkerPoolProvider-DrfOFfKJ.js → DiffWorkerPoolProvider-BQ0GjZ9H.js} +2 -2
- package/dist/client/assets/{PullRequestCodePanel-D92b-xE1.js → PullRequestCodePanel-CxKU9Weg.js} +2 -2
- package/dist/client/assets/{ThemeEditorPanel-BdgROB68.js → ThemeEditorPanel-BCJuZ6ai.js} +2 -2
- package/dist/client/assets/{Virtualizer-D1PjmzYU.js → Virtualizer-rDfJ0xkK.js} +2 -2
- package/dist/client/assets/{WorkerPoolContext-Zx0HWy6X.js → WorkerPoolContext-BDrWnUvr.js} +44 -44
- package/dist/client/assets/{cmmdAuthRedirect-Cpw3QgrC.js → cmmdAuthRedirect-DRkKjx0G.js} +2 -2
- package/dist/client/assets/{cmmdForgeRuntimeListResource-BqtcOIK2.js → cmmdForgeRuntimeListResource-BcB0BoYr.js} +4 -4
- package/dist/client/assets/{currentForgeWorkspaceStore-CnxIYz5d.js → currentForgeWorkspaceStore-C-N9OJY7.js} +2 -2
- package/dist/client/assets/{dialog-BSwJ44Xn.js → dialog-C0bK23D8.js} +2 -2
- package/dist/client/assets/index-BoqU9iYc.js +301 -0
- package/dist/client/assets/{popover-ZNCjh9sJ.js → popover-ClRgm7hB.js} +2 -2
- package/dist/client/assets/{scroll-area-By2Wg8Aw.js → scroll-area-BHqISEYq.js} +2 -2
- package/dist/client/assets/{sidebarV2CustomSnoozeDialog-B_dtRwFZ.js → sidebarV2CustomSnoozeDialog-lbAJoff_.js} +2 -2
- package/dist/client/assets/src-B_wrKHuq.js +3 -0
- package/dist/client/assets/{switch-opCmyrUy.js → switch-BWQHMJkU.js} +2 -2
- package/dist/client/assets/{themePalette-DchQFoHe.js → themePalette-BWvBK22X.js} +2 -2
- package/dist/client/assets/{toggle-CGX6qKVS.js → toggle-CORC1vE9.js} +2 -2
- package/dist/client/assets/{toggle-group-BRN0oZh2.js → toggle-group-C9nAr6VB.js} +2 -2
- package/dist/client/assets/{tooltip-Bh_PspOm.js → tooltip-CrS-TEbN.js} +2 -2
- package/dist/client/assets/{utils-MX9zGa4a.js → utils-xQJ3ak-X.js} +2 -2
- package/dist/client/index.html +18 -18
- package/dist/forge-build.json +1 -1
- package/package.json +1 -1
- package/dist/client/assets/index-DF-oXznp.js +0 -301
- package/dist/client/assets/src-e9jwz4Nc.js +0 -3
package/dist/bin.cjs
CHANGED
|
@@ -18122,9 +18122,11 @@ const ThreadTurnStartBootstrapCreateThread = require_Schema$1.Struct({
|
|
|
18122
18122
|
createdAt: IsoDateTime
|
|
18123
18123
|
});
|
|
18124
18124
|
const ThreadTurnStartBootstrapPrepareWorktree = require_Schema$1.Struct({
|
|
18125
|
-
|
|
18125
|
+
projectId: require_Schema$1.optional(ProjectId),
|
|
18126
|
+
projectCwd: require_Schema$1.optional(TrimmedNonEmptyString),
|
|
18126
18127
|
baseBranch: require_Schema$1.NullOr(TrimmedNonEmptyString),
|
|
18127
|
-
branch: require_Schema$1.optional(TrimmedNonEmptyString)
|
|
18128
|
+
branch: require_Schema$1.optional(TrimmedNonEmptyString),
|
|
18129
|
+
startFromOrigin: require_Schema$1.optional(require_Schema$1.Boolean)
|
|
18128
18130
|
});
|
|
18129
18131
|
const ThreadTurnStartBootstrap = require_Schema$1.Struct({
|
|
18130
18132
|
createThread: require_Schema$1.optional(ThreadTurnStartBootstrapCreateThread),
|
|
@@ -66431,7 +66433,7 @@ function normalizeNumberish(value) {
|
|
|
66431
66433
|
}
|
|
66432
66434
|
//#endregion
|
|
66433
66435
|
//#region package.json
|
|
66434
|
-
var version$1 = "0.13.
|
|
66436
|
+
var version$1 = "0.13.146";
|
|
66435
66437
|
//#endregion
|
|
66436
66438
|
//#region src/sentry.ts
|
|
66437
66439
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -94617,14 +94619,62 @@ const dispatchBootstrapThreadCreate = (input) => require_Schema$1.gen(function*
|
|
|
94617
94619
|
});
|
|
94618
94620
|
return !threadAlreadyExists;
|
|
94619
94621
|
});
|
|
94622
|
+
/** Reject a removed or unknown project before any Git operation uses its checkout. */
|
|
94623
|
+
const requireBootstrapProject = (input) => {
|
|
94624
|
+
const project = input.readModel.projects.find((candidate) => candidate.id === input.projectId);
|
|
94625
|
+
return project && project.deletedAt === null ? require_Schema$1.succeed(project) : require_Schema$1.fail(/* @__PURE__ */ new Error(`Worktree project '${input.projectId}' does not exist.`));
|
|
94626
|
+
};
|
|
94627
|
+
/** Require the target thread to be live before preparing its worktree. */
|
|
94628
|
+
const requireBootstrapThread = (input) => {
|
|
94629
|
+
const thread = input.readModel.threads.find((candidate) => candidate.id === input.threadId);
|
|
94630
|
+
return thread && thread.deletedAt === null ? require_Schema$1.succeed(thread) : require_Schema$1.fail(/* @__PURE__ */ new Error(`Worktree thread '${input.threadId}' does not exist.`));
|
|
94631
|
+
};
|
|
94632
|
+
/** Resolve a CMMD Work Session's checkout from Forge's persisted project identity. */
|
|
94633
|
+
const resolveAuthoritativeBootstrapProjectCwd = (input) => require_Schema$1.gen(function* () {
|
|
94634
|
+
const projectId = input.bootstrapWorktree.projectId;
|
|
94635
|
+
if (projectId === void 0) return yield* require_Schema$1.fail(/* @__PURE__ */ new Error("Missing project identity."));
|
|
94636
|
+
const project = yield* requireBootstrapProject({
|
|
94637
|
+
readModel: input.readModel,
|
|
94638
|
+
projectId
|
|
94639
|
+
});
|
|
94640
|
+
const thread = yield* requireBootstrapThread({
|
|
94641
|
+
readModel: input.readModel,
|
|
94642
|
+
threadId: input.command.threadId
|
|
94643
|
+
});
|
|
94644
|
+
if (thread.projectId !== projectId) return yield* require_Schema$1.fail(/* @__PURE__ */ new Error(`Worktree project '${projectId}' does not match thread project '${thread.projectId}'.`));
|
|
94645
|
+
const createdThreadProjectId = input.command.bootstrap?.createThread?.projectId;
|
|
94646
|
+
if (createdThreadProjectId && createdThreadProjectId !== projectId) return yield* require_Schema$1.fail(/* @__PURE__ */ new Error(`Worktree project '${projectId}' does not match created thread project '${createdThreadProjectId}'.`));
|
|
94647
|
+
if (input.bootstrapWorktree.branch === void 0) return yield* require_Schema$1.fail(/* @__PURE__ */ new Error("Authoritative worktree preparation requires a branch."));
|
|
94648
|
+
if (input.bootstrapWorktree.startFromOrigin && input.bootstrapWorktree.baseBranch !== "main") return yield* require_Schema$1.fail(/* @__PURE__ */ new Error("Authoritative Work Session worktrees must start from origin/main."));
|
|
94649
|
+
return project.workspaceRoot;
|
|
94650
|
+
});
|
|
94651
|
+
/** Keep legacy path-based commands working while routing identified projects through Forge records. */
|
|
94652
|
+
const resolveBootstrapProjectCwd = (input) => require_Schema$1.gen(function* () {
|
|
94653
|
+
const { bootstrapWorktree } = input;
|
|
94654
|
+
if (bootstrapWorktree.projectId === void 0) {
|
|
94655
|
+
if (!bootstrapWorktree.projectCwd) return yield* require_Schema$1.fail(/* @__PURE__ */ new Error("Worktree preparation requires a project checkout path."));
|
|
94656
|
+
return bootstrapWorktree.projectCwd;
|
|
94657
|
+
}
|
|
94658
|
+
return yield* resolveAuthoritativeBootstrapProjectCwd({
|
|
94659
|
+
readModel: yield* input.orchestrationEngine.getReadModel(),
|
|
94660
|
+
command: input.command,
|
|
94661
|
+
bootstrapWorktree
|
|
94662
|
+
});
|
|
94663
|
+
});
|
|
94620
94664
|
const prepareBootstrapWorktree = (input) => require_Schema$1.gen(function* () {
|
|
94621
94665
|
const bootstrapWorktree = input.command.bootstrap?.prepareWorktree;
|
|
94622
94666
|
if (!bootstrapWorktree) return null;
|
|
94667
|
+
const projectCwd = yield* resolveBootstrapProjectCwd({
|
|
94668
|
+
orchestrationEngine: input.orchestrationEngine,
|
|
94669
|
+
command: input.command,
|
|
94670
|
+
bootstrapWorktree
|
|
94671
|
+
});
|
|
94623
94672
|
const requestedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
94624
94673
|
const baseBranchLabel = bootstrapWorktree.baseBranch ?? "<default>";
|
|
94625
94674
|
const requestedPayload = {
|
|
94626
94675
|
turnRequestedAt: input.command.createdAt,
|
|
94627
|
-
|
|
94676
|
+
...bootstrapWorktree.projectId ? { projectId: bootstrapWorktree.projectId } : {},
|
|
94677
|
+
projectCwd,
|
|
94628
94678
|
baseBranch: bootstrapWorktree.baseBranch,
|
|
94629
94679
|
branch: bootstrapWorktree.branch,
|
|
94630
94680
|
command: `git worktree add -b ${bootstrapWorktree.branch} <generated-path> ${baseBranchLabel}`
|
|
@@ -94639,11 +94689,38 @@ const prepareBootstrapWorktree = (input) => require_Schema$1.gen(function* () {
|
|
|
94639
94689
|
payload: requestedPayload,
|
|
94640
94690
|
tone: "info"
|
|
94641
94691
|
});
|
|
94692
|
+
if (bootstrapWorktree.startFromOrigin) {
|
|
94693
|
+
if (!input.git.fetch) return yield* require_Schema$1.fail(/* @__PURE__ */ new Error("Git fetch is unavailable for origin worktree preparation."));
|
|
94694
|
+
yield* input.git.fetch({
|
|
94695
|
+
cwd: projectCwd,
|
|
94696
|
+
remote: "origin",
|
|
94697
|
+
ref: bootstrapWorktree.baseBranch ?? "main"
|
|
94698
|
+
}).pipe(require_Schema$1.catchCause((cause) => {
|
|
94699
|
+
if (require_Schema$1.hasInterruptsOnly(cause)) return require_Schema$1.failCause(cause);
|
|
94700
|
+
const error = require_Schema$1.squash(cause);
|
|
94701
|
+
const detail = error instanceof Error ? error.message : "Unknown fetch failure.";
|
|
94702
|
+
return appendWorktreeActivity({
|
|
94703
|
+
orchestrationEngine: input.orchestrationEngine,
|
|
94704
|
+
threadId: input.command.threadId,
|
|
94705
|
+
commandId: bootstrapCommandId(input.command, "bootstrap-worktree-failed"),
|
|
94706
|
+
kind: "worktree.failed",
|
|
94707
|
+
summary: "Worktree preparation failed",
|
|
94708
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
94709
|
+
payload: {
|
|
94710
|
+
...requestedPayload,
|
|
94711
|
+
detail,
|
|
94712
|
+
stage: "fetch"
|
|
94713
|
+
},
|
|
94714
|
+
tone: "error"
|
|
94715
|
+
}).pipe(require_Schema$1.andThen(require_Schema$1.failCause(cause)));
|
|
94716
|
+
}));
|
|
94717
|
+
}
|
|
94642
94718
|
const worktree = yield* input.git.createWorktree({
|
|
94643
|
-
cwd:
|
|
94719
|
+
cwd: projectCwd,
|
|
94644
94720
|
branch: bootstrapWorktree.baseBranch,
|
|
94645
94721
|
newBranch: bootstrapWorktree.branch,
|
|
94646
94722
|
path: null,
|
|
94723
|
+
...bootstrapWorktree.startFromOrigin ? { startFromOrigin: true } : {},
|
|
94647
94724
|
onStage: (update) => appendWorktreeActivity({
|
|
94648
94725
|
orchestrationEngine: input.orchestrationEngine,
|
|
94649
94726
|
threadId: input.command.threadId,
|
|
@@ -94735,7 +94812,7 @@ const prepareBootstrapWorktree = (input) => require_Schema$1.gen(function* () {
|
|
|
94735
94812
|
});
|
|
94736
94813
|
return {
|
|
94737
94814
|
worktreePath,
|
|
94738
|
-
projectCwd
|
|
94815
|
+
projectCwd
|
|
94739
94816
|
};
|
|
94740
94817
|
});
|
|
94741
94818
|
const dispatchBootstrapTurnStart$1 = (input, command) => require_Schema$1.gen(function* () {
|
|
@@ -236026,6 +236103,13 @@ function createGitCommandError(operation, cwd, args, detail, cause) {
|
|
|
236026
236103
|
...cause !== void 0 ? { cause } : {}
|
|
236027
236104
|
});
|
|
236028
236105
|
}
|
|
236106
|
+
function isValidGitRef(value) {
|
|
236107
|
+
if (value.length === 0 || value.startsWith("-") || value.endsWith(".") || value.endsWith("/") || value.endsWith(".lock") || value.includes("..") || value.includes("@{") || /[~^:?*[\\]/.test(value) || [...value].some((character) => {
|
|
236108
|
+
const code = character.charCodeAt(0);
|
|
236109
|
+
return code <= 32 || code === 127;
|
|
236110
|
+
})) return false;
|
|
236111
|
+
return value.split("/").every((part) => part.length > 0 && part !== "." && part !== "..");
|
|
236112
|
+
}
|
|
236029
236113
|
function quoteGitCommand(args) {
|
|
236030
236114
|
return `git ${args.join(" ")}`;
|
|
236031
236115
|
}
|
|
@@ -237038,7 +237122,7 @@ const makeGitCore = require_Schema$1.fn("makeGitCore")(function* (options) {
|
|
|
237038
237122
|
}) ?? require_Schema$1.void_;
|
|
237039
237123
|
yield* report("resolve", "running");
|
|
237040
237124
|
const base = input.branch ?? (yield* resolveDefaultBaseBranch(input.cwd));
|
|
237041
|
-
const startPoint = yield* resolveWorktreeStartPoint({
|
|
237125
|
+
const startPoint = input.startFromOrigin ? `origin/${base}` : yield* resolveWorktreeStartPoint({
|
|
237042
237126
|
cwd: input.cwd,
|
|
237043
237127
|
base,
|
|
237044
237128
|
creatingNewBranch: input.newBranch !== void 0
|
|
@@ -237108,6 +237192,20 @@ const makeGitCore = require_Schema$1.fn("makeGitCore")(function* (options) {
|
|
|
237108
237192
|
fallbackErrorMessage: "git fetch pull request branch failed"
|
|
237109
237193
|
});
|
|
237110
237194
|
});
|
|
237195
|
+
const fetch = require_Schema$1.fn("fetch")(function* (input) {
|
|
237196
|
+
if (!isValidGitRef(input.ref)) return yield* require_Schema$1.fail(createGitCommandError("GitCore.fetch", input.cwd, [
|
|
237197
|
+
"fetch",
|
|
237198
|
+
input.remote,
|
|
237199
|
+
input.ref
|
|
237200
|
+
], `Invalid Git ref: ${input.ref}`));
|
|
237201
|
+
yield* runGit("GitCore.fetch", input.cwd, [
|
|
237202
|
+
"fetch",
|
|
237203
|
+
"--quiet",
|
|
237204
|
+
"--no-tags",
|
|
237205
|
+
input.remote,
|
|
237206
|
+
input.ref
|
|
237207
|
+
]);
|
|
237208
|
+
});
|
|
237111
237209
|
const fetchRemoteBranch = require_Schema$1.fn("fetchRemoteBranch")(function* (input) {
|
|
237112
237210
|
yield* runGit("GitCore.fetchRemoteBranch.fetch", input.cwd, [
|
|
237113
237211
|
"fetch",
|
|
@@ -237305,6 +237403,7 @@ const makeGitCore = require_Schema$1.fn("makeGitCore")(function* (options) {
|
|
|
237305
237403
|
listBranches,
|
|
237306
237404
|
createWorktree,
|
|
237307
237405
|
fetchPullRequestBranch,
|
|
237406
|
+
fetch,
|
|
237308
237407
|
ensureRemote,
|
|
237309
237408
|
fetchRemoteBranch,
|
|
237310
237409
|
setBranchUpstream,
|
|
@@ -300774,7 +300873,7 @@ function resolveBuildCommitFromEnv(env) {
|
|
|
300774
300873
|
* environment descriptor down instead of reporting an honest "unknown".
|
|
300775
300874
|
*/
|
|
300776
300875
|
function readBakedBuildCommit() {
|
|
300777
|
-
return "
|
|
300876
|
+
return "13fc600f9068c1aa48fe746802127ae02843b2c9";
|
|
300778
300877
|
}
|
|
300779
300878
|
async function resolveServerBuildCommit(input) {
|
|
300780
300879
|
if (isFullCommitSha(input.baked)) return input.baked;
|
package/dist/bin.mjs
CHANGED
|
@@ -18062,9 +18062,11 @@ const ThreadTurnStartBootstrapCreateThread = Struct({
|
|
|
18062
18062
|
createdAt: IsoDateTime
|
|
18063
18063
|
});
|
|
18064
18064
|
const ThreadTurnStartBootstrapPrepareWorktree = Struct({
|
|
18065
|
-
|
|
18065
|
+
projectId: optional$4(ProjectId),
|
|
18066
|
+
projectCwd: optional$4(TrimmedNonEmptyString),
|
|
18066
18067
|
baseBranch: NullOr(TrimmedNonEmptyString),
|
|
18067
|
-
branch: optional$4(TrimmedNonEmptyString)
|
|
18068
|
+
branch: optional$4(TrimmedNonEmptyString),
|
|
18069
|
+
startFromOrigin: optional$4(Boolean$1)
|
|
18068
18070
|
});
|
|
18069
18071
|
const ThreadTurnStartBootstrap = Struct({
|
|
18070
18072
|
createThread: optional$4(ThreadTurnStartBootstrapCreateThread),
|
|
@@ -66139,7 +66141,7 @@ function normalizeNumberish(value) {
|
|
|
66139
66141
|
}
|
|
66140
66142
|
//#endregion
|
|
66141
66143
|
//#region package.json
|
|
66142
|
-
var version$1 = "0.13.
|
|
66144
|
+
var version$1 = "0.13.146";
|
|
66143
66145
|
//#endregion
|
|
66144
66146
|
//#region src/sentry.ts
|
|
66145
66147
|
const SERVER_APP_NAME = "forge-server";
|
|
@@ -94257,14 +94259,62 @@ const dispatchBootstrapThreadCreate = (input) => gen(function* () {
|
|
|
94257
94259
|
});
|
|
94258
94260
|
return !threadAlreadyExists;
|
|
94259
94261
|
});
|
|
94262
|
+
/** Reject a removed or unknown project before any Git operation uses its checkout. */
|
|
94263
|
+
const requireBootstrapProject = (input) => {
|
|
94264
|
+
const project = input.readModel.projects.find((candidate) => candidate.id === input.projectId);
|
|
94265
|
+
return project && project.deletedAt === null ? succeed(project) : fail(/* @__PURE__ */ new Error(`Worktree project '${input.projectId}' does not exist.`));
|
|
94266
|
+
};
|
|
94267
|
+
/** Require the target thread to be live before preparing its worktree. */
|
|
94268
|
+
const requireBootstrapThread = (input) => {
|
|
94269
|
+
const thread = input.readModel.threads.find((candidate) => candidate.id === input.threadId);
|
|
94270
|
+
return thread && thread.deletedAt === null ? succeed(thread) : fail(/* @__PURE__ */ new Error(`Worktree thread '${input.threadId}' does not exist.`));
|
|
94271
|
+
};
|
|
94272
|
+
/** Resolve a CMMD Work Session's checkout from Forge's persisted project identity. */
|
|
94273
|
+
const resolveAuthoritativeBootstrapProjectCwd = (input) => gen(function* () {
|
|
94274
|
+
const projectId = input.bootstrapWorktree.projectId;
|
|
94275
|
+
if (projectId === void 0) return yield* fail(/* @__PURE__ */ new Error("Missing project identity."));
|
|
94276
|
+
const project = yield* requireBootstrapProject({
|
|
94277
|
+
readModel: input.readModel,
|
|
94278
|
+
projectId
|
|
94279
|
+
});
|
|
94280
|
+
const thread = yield* requireBootstrapThread({
|
|
94281
|
+
readModel: input.readModel,
|
|
94282
|
+
threadId: input.command.threadId
|
|
94283
|
+
});
|
|
94284
|
+
if (thread.projectId !== projectId) return yield* fail(/* @__PURE__ */ new Error(`Worktree project '${projectId}' does not match thread project '${thread.projectId}'.`));
|
|
94285
|
+
const createdThreadProjectId = input.command.bootstrap?.createThread?.projectId;
|
|
94286
|
+
if (createdThreadProjectId && createdThreadProjectId !== projectId) return yield* fail(/* @__PURE__ */ new Error(`Worktree project '${projectId}' does not match created thread project '${createdThreadProjectId}'.`));
|
|
94287
|
+
if (input.bootstrapWorktree.branch === void 0) return yield* fail(/* @__PURE__ */ new Error("Authoritative worktree preparation requires a branch."));
|
|
94288
|
+
if (input.bootstrapWorktree.startFromOrigin && input.bootstrapWorktree.baseBranch !== "main") return yield* fail(/* @__PURE__ */ new Error("Authoritative Work Session worktrees must start from origin/main."));
|
|
94289
|
+
return project.workspaceRoot;
|
|
94290
|
+
});
|
|
94291
|
+
/** Keep legacy path-based commands working while routing identified projects through Forge records. */
|
|
94292
|
+
const resolveBootstrapProjectCwd = (input) => gen(function* () {
|
|
94293
|
+
const { bootstrapWorktree } = input;
|
|
94294
|
+
if (bootstrapWorktree.projectId === void 0) {
|
|
94295
|
+
if (!bootstrapWorktree.projectCwd) return yield* fail(/* @__PURE__ */ new Error("Worktree preparation requires a project checkout path."));
|
|
94296
|
+
return bootstrapWorktree.projectCwd;
|
|
94297
|
+
}
|
|
94298
|
+
return yield* resolveAuthoritativeBootstrapProjectCwd({
|
|
94299
|
+
readModel: yield* input.orchestrationEngine.getReadModel(),
|
|
94300
|
+
command: input.command,
|
|
94301
|
+
bootstrapWorktree
|
|
94302
|
+
});
|
|
94303
|
+
});
|
|
94260
94304
|
const prepareBootstrapWorktree = (input) => gen(function* () {
|
|
94261
94305
|
const bootstrapWorktree = input.command.bootstrap?.prepareWorktree;
|
|
94262
94306
|
if (!bootstrapWorktree) return null;
|
|
94307
|
+
const projectCwd = yield* resolveBootstrapProjectCwd({
|
|
94308
|
+
orchestrationEngine: input.orchestrationEngine,
|
|
94309
|
+
command: input.command,
|
|
94310
|
+
bootstrapWorktree
|
|
94311
|
+
});
|
|
94263
94312
|
const requestedAt = (/* @__PURE__ */ new Date()).toISOString();
|
|
94264
94313
|
const baseBranchLabel = bootstrapWorktree.baseBranch ?? "<default>";
|
|
94265
94314
|
const requestedPayload = {
|
|
94266
94315
|
turnRequestedAt: input.command.createdAt,
|
|
94267
|
-
|
|
94316
|
+
...bootstrapWorktree.projectId ? { projectId: bootstrapWorktree.projectId } : {},
|
|
94317
|
+
projectCwd,
|
|
94268
94318
|
baseBranch: bootstrapWorktree.baseBranch,
|
|
94269
94319
|
branch: bootstrapWorktree.branch,
|
|
94270
94320
|
command: `git worktree add -b ${bootstrapWorktree.branch} <generated-path> ${baseBranchLabel}`
|
|
@@ -94279,11 +94329,38 @@ const prepareBootstrapWorktree = (input) => gen(function* () {
|
|
|
94279
94329
|
payload: requestedPayload,
|
|
94280
94330
|
tone: "info"
|
|
94281
94331
|
});
|
|
94332
|
+
if (bootstrapWorktree.startFromOrigin) {
|
|
94333
|
+
if (!input.git.fetch) return yield* fail(/* @__PURE__ */ new Error("Git fetch is unavailable for origin worktree preparation."));
|
|
94334
|
+
yield* input.git.fetch({
|
|
94335
|
+
cwd: projectCwd,
|
|
94336
|
+
remote: "origin",
|
|
94337
|
+
ref: bootstrapWorktree.baseBranch ?? "main"
|
|
94338
|
+
}).pipe(catchCause((cause) => {
|
|
94339
|
+
if (hasInterruptsOnly(cause)) return failCause$1(cause);
|
|
94340
|
+
const error = squash(cause);
|
|
94341
|
+
const detail = error instanceof Error ? error.message : "Unknown fetch failure.";
|
|
94342
|
+
return appendWorktreeActivity({
|
|
94343
|
+
orchestrationEngine: input.orchestrationEngine,
|
|
94344
|
+
threadId: input.command.threadId,
|
|
94345
|
+
commandId: bootstrapCommandId(input.command, "bootstrap-worktree-failed"),
|
|
94346
|
+
kind: "worktree.failed",
|
|
94347
|
+
summary: "Worktree preparation failed",
|
|
94348
|
+
createdAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
94349
|
+
payload: {
|
|
94350
|
+
...requestedPayload,
|
|
94351
|
+
detail,
|
|
94352
|
+
stage: "fetch"
|
|
94353
|
+
},
|
|
94354
|
+
tone: "error"
|
|
94355
|
+
}).pipe(andThen(failCause$1(cause)));
|
|
94356
|
+
}));
|
|
94357
|
+
}
|
|
94282
94358
|
const worktree = yield* input.git.createWorktree({
|
|
94283
|
-
cwd:
|
|
94359
|
+
cwd: projectCwd,
|
|
94284
94360
|
branch: bootstrapWorktree.baseBranch,
|
|
94285
94361
|
newBranch: bootstrapWorktree.branch,
|
|
94286
94362
|
path: null,
|
|
94363
|
+
...bootstrapWorktree.startFromOrigin ? { startFromOrigin: true } : {},
|
|
94287
94364
|
onStage: (update) => appendWorktreeActivity({
|
|
94288
94365
|
orchestrationEngine: input.orchestrationEngine,
|
|
94289
94366
|
threadId: input.command.threadId,
|
|
@@ -94375,7 +94452,7 @@ const prepareBootstrapWorktree = (input) => gen(function* () {
|
|
|
94375
94452
|
});
|
|
94376
94453
|
return {
|
|
94377
94454
|
worktreePath,
|
|
94378
|
-
projectCwd
|
|
94455
|
+
projectCwd
|
|
94379
94456
|
};
|
|
94380
94457
|
});
|
|
94381
94458
|
const dispatchBootstrapTurnStart$1 = (input, command) => gen(function* () {
|
|
@@ -235562,6 +235639,13 @@ function createGitCommandError(operation, cwd, args, detail, cause) {
|
|
|
235562
235639
|
...cause !== void 0 ? { cause } : {}
|
|
235563
235640
|
});
|
|
235564
235641
|
}
|
|
235642
|
+
function isValidGitRef(value) {
|
|
235643
|
+
if (value.length === 0 || value.startsWith("-") || value.endsWith(".") || value.endsWith("/") || value.endsWith(".lock") || value.includes("..") || value.includes("@{") || /[~^:?*[\\]/.test(value) || [...value].some((character) => {
|
|
235644
|
+
const code = character.charCodeAt(0);
|
|
235645
|
+
return code <= 32 || code === 127;
|
|
235646
|
+
})) return false;
|
|
235647
|
+
return value.split("/").every((part) => part.length > 0 && part !== "." && part !== "..");
|
|
235648
|
+
}
|
|
235565
235649
|
function quoteGitCommand(args) {
|
|
235566
235650
|
return `git ${args.join(" ")}`;
|
|
235567
235651
|
}
|
|
@@ -236570,7 +236654,7 @@ const GitCoreLive = effect(GitCore, fn$1("makeGitCore")(function* (options) {
|
|
|
236570
236654
|
}) ?? void_$1;
|
|
236571
236655
|
yield* report("resolve", "running");
|
|
236572
236656
|
const base = input.branch ?? (yield* resolveDefaultBaseBranch(input.cwd));
|
|
236573
|
-
const startPoint = yield* resolveWorktreeStartPoint({
|
|
236657
|
+
const startPoint = input.startFromOrigin ? `origin/${base}` : yield* resolveWorktreeStartPoint({
|
|
236574
236658
|
cwd: input.cwd,
|
|
236575
236659
|
base,
|
|
236576
236660
|
creatingNewBranch: input.newBranch !== void 0
|
|
@@ -236640,6 +236724,20 @@ const GitCoreLive = effect(GitCore, fn$1("makeGitCore")(function* (options) {
|
|
|
236640
236724
|
fallbackErrorMessage: "git fetch pull request branch failed"
|
|
236641
236725
|
});
|
|
236642
236726
|
});
|
|
236727
|
+
const fetch = fn$1("fetch")(function* (input) {
|
|
236728
|
+
if (!isValidGitRef(input.ref)) return yield* fail(createGitCommandError("GitCore.fetch", input.cwd, [
|
|
236729
|
+
"fetch",
|
|
236730
|
+
input.remote,
|
|
236731
|
+
input.ref
|
|
236732
|
+
], `Invalid Git ref: ${input.ref}`));
|
|
236733
|
+
yield* runGit("GitCore.fetch", input.cwd, [
|
|
236734
|
+
"fetch",
|
|
236735
|
+
"--quiet",
|
|
236736
|
+
"--no-tags",
|
|
236737
|
+
input.remote,
|
|
236738
|
+
input.ref
|
|
236739
|
+
]);
|
|
236740
|
+
});
|
|
236643
236741
|
const fetchRemoteBranch = fn$1("fetchRemoteBranch")(function* (input) {
|
|
236644
236742
|
yield* runGit("GitCore.fetchRemoteBranch.fetch", input.cwd, [
|
|
236645
236743
|
"fetch",
|
|
@@ -236837,6 +236935,7 @@ const GitCoreLive = effect(GitCore, fn$1("makeGitCore")(function* (options) {
|
|
|
236837
236935
|
listBranches,
|
|
236838
236936
|
createWorktree,
|
|
236839
236937
|
fetchPullRequestBranch,
|
|
236938
|
+
fetch,
|
|
236840
236939
|
ensureRemote,
|
|
236841
236940
|
fetchRemoteBranch,
|
|
236842
236941
|
setBranchUpstream,
|
|
@@ -300218,7 +300317,7 @@ function resolveBuildCommitFromEnv(env) {
|
|
|
300218
300317
|
* environment descriptor down instead of reporting an honest "unknown".
|
|
300219
300318
|
*/
|
|
300220
300319
|
function readBakedBuildCommit() {
|
|
300221
|
-
return "
|
|
300320
|
+
return "13fc600f9068c1aa48fe746802127ae02843b2c9";
|
|
300222
300321
|
}
|
|
300223
300322
|
async function resolveServerBuildCommit(input) {
|
|
300224
300323
|
if (isFullCommitSha(input.baked)) return input.baked;
|