@viraatdas/rudder 1.0.73 → 1.1.0
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/README.md +169 -510
- package/dist/auth.d.ts +2 -0
- package/dist/auth.js +22 -1
- package/dist/auth.js.map +1 -1
- package/dist/backends.js +88 -1
- package/dist/backends.js.map +1 -1
- package/dist/board/board.css +1 -0
- package/dist/board/board.js +2 -0
- package/dist/board/daemon.d.ts +21 -0
- package/dist/board/daemon.js +838 -0
- package/dist/board/daemon.js.map +1 -0
- package/dist/brain.d.ts +9 -0
- package/dist/brain.js +36 -9
- package/dist/brain.js.map +1 -1
- package/dist/bus.d.ts +9 -0
- package/dist/bus.js +23 -0
- package/dist/bus.js.map +1 -0
- package/dist/cloud.js +80 -350
- package/dist/cloud.js.map +1 -1
- package/dist/daemon.d.ts +21 -0
- package/dist/daemon.js +141 -0
- package/dist/daemon.js.map +1 -0
- package/dist/git.d.ts +19 -13
- package/dist/git.js +283 -35
- package/dist/git.js.map +1 -1
- package/dist/goal.d.ts +30 -0
- package/dist/goal.js +75 -0
- package/dist/goal.js.map +1 -0
- package/dist/graph.d.ts +56 -0
- package/dist/graph.js +213 -0
- package/dist/graph.js.map +1 -0
- package/dist/index.js +0 -0
- package/dist/jj.d.ts +121 -0
- package/dist/jj.js +524 -0
- package/dist/jj.js.map +1 -0
- package/dist/main.js +191 -17
- package/dist/main.js.map +1 -1
- package/dist/migration.js +8 -1
- package/dist/migration.js.map +1 -1
- package/dist/models.js +21 -36
- package/dist/models.js.map +1 -1
- package/dist/native/rudder-native +0 -0
- package/dist/planner.d.ts +27 -0
- package/dist/planner.js +540 -0
- package/dist/planner.js.map +1 -0
- package/dist/repl.js +6 -2
- package/dist/repl.js.map +1 -1
- package/dist/run-manager.d.ts +10 -0
- package/dist/run-manager.js +225 -54
- package/dist/run-manager.js.map +1 -1
- package/dist/scheduler.d.ts +124 -0
- package/dist/scheduler.js +849 -0
- package/dist/scheduler.js.map +1 -0
- package/dist/state.d.ts +18 -1
- package/dist/state.js +139 -3
- package/dist/state.js.map +1 -1
- package/dist/surfaces.d.ts +23 -0
- package/dist/surfaces.js +196 -0
- package/dist/surfaces.js.map +1 -0
- package/dist/task-summary.d.ts +18 -0
- package/dist/task-summary.js +132 -0
- package/dist/task-summary.js.map +1 -1
- package/dist/tmux-dashboard.js +58 -7
- package/dist/tmux-dashboard.js.map +1 -1
- package/dist/tui.js +112 -17
- package/dist/tui.js.map +1 -1
- package/dist/types.d.ts +214 -1
- package/dist/types.js +1 -1
- package/dist/types.js.map +1 -1
- package/dist/util.d.ts +6 -1
- package/dist/util.js +37 -7
- package/dist/util.js.map +1 -1
- package/package.json +10 -2
package/dist/repl.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repl.js","sourceRoot":"","sources":["../src/repl.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,wBAAwB,CAAC;AAC9C,OAAO,EAAE,KAAK,IAAI,KAAK,EAAE,MAAM,IAAI,MAAM,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AACtC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACvD,OAAO,EACL,WAAW,EACX,eAAe,EACf,QAAQ,EACR,SAAS,EACT,QAAQ,EACR,UAAU,EACV,OAAO,EACP,QAAQ,GACT,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,UAAU,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AASxC,MAAM,CAAC,KAAK,UAAU,mBAAmB,CAAC,QAKzC;IACC,MAAM,MAAM,GAAG,MAAM,UAAU,EAAE,CAAC;IAClC,MAAM,OAAO,GAAG,QAAQ,EAAE,OAAO,IAAI,MAAM,CAAC,eAAe,IAAI,MAAM,CAAC,cAAc,CAAC;IACrF,M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AC;IACtC,CAAC;IACD,OAAO,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;AACrC,CAAC;AAED,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,KAAK,YAAY,KAAK,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,qBAAqB,CAAC,CAAC;AACjF,CAAC"}
|
package/dist/run-manager.d.ts
CHANGED
|
@@ -40,6 +40,13 @@ export declare function continueRun(params: {
|
|
|
40
40
|
interrupt?: boolean;
|
|
41
41
|
silent?: boolean;
|
|
42
42
|
}): Promise<RunRecord>;
|
|
43
|
+
/**
|
|
44
|
+
* The detached `rudder __worker` spawn primitive. Both startRun/continueRun and
|
|
45
|
+
* the scheduler launch workers through this one path so the spawn shape (flags,
|
|
46
|
+
* detached, stdio:"ignore", unref) is defined in exactly one place. Returns the
|
|
47
|
+
* spawned worker pid (or undefined if the platform did not assign one).
|
|
48
|
+
*/
|
|
49
|
+
export declare function spawnWorker(repoRoot: string, runId: string): number | undefined;
|
|
43
50
|
export declare function workerRun(repoRoot: string, runId: string): Promise<void>;
|
|
44
51
|
export declare function writeAgentContext(repoRoot: string): Promise<void>;
|
|
45
52
|
export declare function statusRuns(options?: {
|
|
@@ -63,6 +70,9 @@ export declare function stopRun(runId: string, options?: {
|
|
|
63
70
|
export declare function mergeRun(runId: string, allowDirty?: boolean, options?: {
|
|
64
71
|
silent?: boolean;
|
|
65
72
|
}): Promise<RunRecord>;
|
|
73
|
+
export declare function syncRun(runId?: string, options?: {
|
|
74
|
+
silent?: boolean;
|
|
75
|
+
}): Promise<RunRecord>;
|
|
66
76
|
export declare function deleteRun(runId: string, options?: {
|
|
67
77
|
mergeFirst?: boolean;
|
|
68
78
|
force?: boolean;
|
package/dist/run-manager.js
CHANGED
|
@@ -7,21 +7,20 @@ import { ensureRudderCodexBinary } from "./codex-binary.js";
|
|
|
7
7
|
import { getBackend } from "./backends.js";
|
|
8
8
|
import { nativeAgentCommand } from "./native-agents.js";
|
|
9
9
|
import { buildPlanPrompt, PLAN_MODE_CONTRACT } from "./plan-mode.js";
|
|
10
|
-
import { createRunRecord, agentContextPath, eventsPath, listRuns, loadConfig, loadRunRecord, outputPath, rememberBackendSelection, resolveRun, runDir, saveRunRecord, } from "./state.js";
|
|
10
|
+
import { createRunRecord, agentContextPath, eventsPath, listRuns, loadConfig, loadRunRecord, outputPath, registerProject, rememberBackendSelection, resolveRun, runDir, saveRunRecord, } from "./state.js";
|
|
11
11
|
import { appendEvent, } from "./state.js";
|
|
12
|
-
import { activeRunsForCheckout,
|
|
12
|
+
import { activeRunsForCheckout, currentBranch, findRepoRoot, mergeGitRunIntoCurrentBranch, processAlive, removeGitWorktree, runHasChanges, syncGitRunWorktree, } from "./git.js";
|
|
13
|
+
import { createRunJjWorkspace, currentJjChangeId, ensureColocated, ensureJj, exportToGit, mergeJjRunIntoCurrentWorkspace, removeRunWorkspace as removeJjRunWorkspace, syncRunWorkspace as syncJjRunWorkspace, } from "./jj.js";
|
|
13
14
|
import { commandExists, ensureDir, isTty, MissingToolError, newRunId, nowIso, pathExists, runCommand, shortenHome, } from "./util.js";
|
|
14
15
|
import { createAgentPane, killPane, normalizeTmuxDashboardLayout, paneExitStatus, respawnPane, selectPane } from "./tmux.js";
|
|
15
16
|
import { taskDisplayLabel } from "./task-summary.js";
|
|
16
17
|
const AUTO_STEER_DELAY_MS = 10_000;
|
|
17
18
|
function missingBackendError(backend, healthMessage) {
|
|
18
|
-
|
|
19
|
-
return new MissingToolError(backend);
|
|
20
|
-
}
|
|
21
|
-
return new Error(healthMessage);
|
|
19
|
+
return new MissingToolError(backend, healthMessage);
|
|
22
20
|
}
|
|
23
21
|
export async function startRun(params) {
|
|
24
22
|
const repoRoot = findRepoRoot();
|
|
23
|
+
await registerProject(repoRoot).catch(() => undefined);
|
|
25
24
|
const config = await loadConfig();
|
|
26
25
|
const backend = params.backend ?? config.lastUsedBackend ?? config.defaultBackend;
|
|
27
26
|
if (!commandExists(backend)) {
|
|
@@ -34,17 +33,19 @@ export async function startRun(params) {
|
|
|
34
33
|
? config.backends.codex?.model
|
|
35
34
|
: config.backends.acpx?.model);
|
|
36
35
|
const effort = params.effort ?? effortForBackend(backend, config);
|
|
36
|
+
ensureJj();
|
|
37
|
+
await ensureColocated(repoRoot);
|
|
37
38
|
const active = await activeRunsForCheckout(repoRoot, repoRoot);
|
|
38
39
|
if (params.queue && active.length > 0) {
|
|
39
|
-
throw new Error("Queue mode is not implemented yet; omit --queue to create a
|
|
40
|
+
throw new Error("Queue mode is not implemented yet; omit --queue to create a workspace run.");
|
|
40
41
|
}
|
|
41
42
|
const useWorktree = Boolean(params.worktree || active.length > 0);
|
|
42
|
-
const baseCommit =
|
|
43
|
-
const targetBranch = await
|
|
43
|
+
const baseCommit = await baseRevision(repoRoot);
|
|
44
|
+
const targetBranch = await targetRevision(repoRoot);
|
|
44
45
|
const id = newRunId(params.task);
|
|
45
46
|
const worktreeInfo = useWorktree
|
|
46
|
-
? await
|
|
47
|
-
: { path: repoRoot,
|
|
47
|
+
? await createRunWorkspace({ repoRoot, runId: id, task: params.task })
|
|
48
|
+
: { path: repoRoot, workspaceName: undefined, jjChangeId: undefined };
|
|
48
49
|
const run = await createRunRecord({
|
|
49
50
|
id,
|
|
50
51
|
repoRoot,
|
|
@@ -54,8 +55,10 @@ export async function startRun(params) {
|
|
|
54
55
|
effort,
|
|
55
56
|
targetBranch,
|
|
56
57
|
baseCommit,
|
|
58
|
+
vcs: "jj",
|
|
57
59
|
useWorktree,
|
|
58
|
-
|
|
60
|
+
worktreeWorkspaceName: worktreeInfo.workspaceName,
|
|
61
|
+
worktreeJjChangeId: worktreeInfo.jjChangeId,
|
|
59
62
|
worktreePath: worktreeInfo.path,
|
|
60
63
|
});
|
|
61
64
|
await emit(run, {
|
|
@@ -63,7 +66,7 @@ export async function startRun(params) {
|
|
|
63
66
|
runId: run.id,
|
|
64
67
|
type: "run.created",
|
|
65
68
|
message: useWorktree
|
|
66
|
-
? `Created
|
|
69
|
+
? `Created jj workspace ${shortenHome(worktreeInfo.path)}`
|
|
67
70
|
: "Created run in current checkout",
|
|
68
71
|
});
|
|
69
72
|
await writeAgentContext(repoRoot);
|
|
@@ -74,14 +77,9 @@ export async function startRun(params) {
|
|
|
74
77
|
updateModel: params.model !== undefined,
|
|
75
78
|
updateEffort: params.effort !== undefined,
|
|
76
79
|
});
|
|
77
|
-
const
|
|
78
|
-
cwd: repoRoot,
|
|
79
|
-
detached: true,
|
|
80
|
-
stdio: "ignore",
|
|
81
|
-
});
|
|
82
|
-
worker.unref();
|
|
80
|
+
const pid = spawnWorker(repoRoot, run.id);
|
|
83
81
|
run.process = {
|
|
84
|
-
pid
|
|
82
|
+
pid,
|
|
85
83
|
startedAt: nowIso(),
|
|
86
84
|
};
|
|
87
85
|
run.status = "running";
|
|
@@ -129,10 +127,12 @@ export async function startNativeRun(params) {
|
|
|
129
127
|
? config.backends.claude?.model
|
|
130
128
|
: config.backends.codex?.model);
|
|
131
129
|
const effort = params.effort ?? effortForBackend(backend, config);
|
|
132
|
-
|
|
133
|
-
|
|
130
|
+
ensureJj();
|
|
131
|
+
await ensureColocated(repoRoot);
|
|
132
|
+
const baseCommit = await baseRevision(repoRoot);
|
|
133
|
+
const targetBranch = await targetRevision(repoRoot);
|
|
134
134
|
const id = newRunId(params.task);
|
|
135
|
-
const worktreeInfo = await
|
|
135
|
+
const worktreeInfo = await createRunWorkspace({ repoRoot, runId: id, task: params.task });
|
|
136
136
|
const run = await createRunRecord({
|
|
137
137
|
id,
|
|
138
138
|
repoRoot,
|
|
@@ -142,8 +142,10 @@ export async function startNativeRun(params) {
|
|
|
142
142
|
effort,
|
|
143
143
|
targetBranch,
|
|
144
144
|
baseCommit,
|
|
145
|
+
vcs: "jj",
|
|
145
146
|
useWorktree: true,
|
|
146
|
-
|
|
147
|
+
worktreeWorkspaceName: worktreeInfo.workspaceName,
|
|
148
|
+
worktreeJjChangeId: worktreeInfo.jjChangeId,
|
|
147
149
|
worktreePath: worktreeInfo.path,
|
|
148
150
|
});
|
|
149
151
|
run.session = {
|
|
@@ -157,7 +159,7 @@ export async function startNativeRun(params) {
|
|
|
157
159
|
ts: nowIso(),
|
|
158
160
|
runId: run.id,
|
|
159
161
|
type: "run.created",
|
|
160
|
-
message: `Created
|
|
162
|
+
message: `Created jj workspace ${shortenHome(worktreeInfo.path)}`,
|
|
161
163
|
});
|
|
162
164
|
await writeAgentContext(repoRoot);
|
|
163
165
|
await rememberBackendSelection({
|
|
@@ -256,8 +258,10 @@ export async function startNativePlan(params) {
|
|
|
256
258
|
? config.backends.claude?.model
|
|
257
259
|
: config.backends.codex?.model);
|
|
258
260
|
const effort = params.effort ?? effortForBackend(backend, config);
|
|
259
|
-
|
|
260
|
-
|
|
261
|
+
ensureJj();
|
|
262
|
+
await ensureColocated(repoRoot);
|
|
263
|
+
const baseCommit = await baseRevision(repoRoot);
|
|
264
|
+
const targetBranch = await targetRevision(repoRoot);
|
|
261
265
|
const id = newRunId(params.task);
|
|
262
266
|
const run = await createRunRecord({
|
|
263
267
|
id,
|
|
@@ -269,6 +273,7 @@ export async function startNativePlan(params) {
|
|
|
269
273
|
mode: "plan",
|
|
270
274
|
targetBranch,
|
|
271
275
|
baseCommit,
|
|
276
|
+
vcs: "jj",
|
|
272
277
|
useWorktree: false,
|
|
273
278
|
worktreePath: repoRoot,
|
|
274
279
|
});
|
|
@@ -394,14 +399,9 @@ export async function continueRun(params) {
|
|
|
394
399
|
data: { prompt },
|
|
395
400
|
});
|
|
396
401
|
await writeAgentContext(repoRoot);
|
|
397
|
-
const
|
|
398
|
-
cwd: repoRoot,
|
|
399
|
-
detached: true,
|
|
400
|
-
stdio: "ignore",
|
|
401
|
-
});
|
|
402
|
-
worker.unref();
|
|
402
|
+
const pid = spawnWorker(repoRoot, run.id);
|
|
403
403
|
run.process = {
|
|
404
|
-
pid
|
|
404
|
+
pid,
|
|
405
405
|
startedAt: nowIso(),
|
|
406
406
|
};
|
|
407
407
|
await saveRunRecord(run);
|
|
@@ -410,6 +410,21 @@ export async function continueRun(params) {
|
|
|
410
410
|
}
|
|
411
411
|
return run;
|
|
412
412
|
}
|
|
413
|
+
/**
|
|
414
|
+
* The detached `rudder __worker` spawn primitive. Both startRun/continueRun and
|
|
415
|
+
* the scheduler launch workers through this one path so the spawn shape (flags,
|
|
416
|
+
* detached, stdio:"ignore", unref) is defined in exactly one place. Returns the
|
|
417
|
+
* spawned worker pid (or undefined if the platform did not assign one).
|
|
418
|
+
*/
|
|
419
|
+
export function spawnWorker(repoRoot, runId) {
|
|
420
|
+
const worker = spawn(process.execPath, [process.argv[1] ?? "", "__worker", "--repo", repoRoot, "--run", runId], {
|
|
421
|
+
cwd: repoRoot,
|
|
422
|
+
detached: true,
|
|
423
|
+
stdio: "ignore",
|
|
424
|
+
});
|
|
425
|
+
worker.unref();
|
|
426
|
+
return worker.pid;
|
|
427
|
+
}
|
|
413
428
|
export async function workerRun(repoRoot, runId) {
|
|
414
429
|
const run = await loadRunRecord(repoRoot, runId);
|
|
415
430
|
if (!run) {
|
|
@@ -598,7 +613,7 @@ async function shouldAutoSteer(run, verification) {
|
|
|
598
613
|
if (count > 0) {
|
|
599
614
|
return false;
|
|
600
615
|
}
|
|
601
|
-
return await
|
|
616
|
+
return await runHasChanges(run);
|
|
602
617
|
}
|
|
603
618
|
function buildSteeringPrompt(verification) {
|
|
604
619
|
const missing = verification.missing.length
|
|
@@ -638,7 +653,9 @@ export async function writeAgentContext(repoRoot) {
|
|
|
638
653
|
await writeRudderContextFiles(repoRoot, active, `${lines.join("\n")}\n`);
|
|
639
654
|
}
|
|
640
655
|
function formatAgentContextRun(run) {
|
|
641
|
-
const location = run.worktree.enabled
|
|
656
|
+
const location = run.worktree.enabled
|
|
657
|
+
? `${workspaceKind(run)}=${shortenHome(run.worktree.path)}`
|
|
658
|
+
: "current checkout";
|
|
642
659
|
const prompt = run.currentPrompt && run.currentPrompt !== run.task ? ` current="${run.currentPrompt.slice(0, 140)}"` : "";
|
|
643
660
|
return `- ${run.id}: ${run.status}, ${run.backend}, ${location}, task="${run.task.slice(0, 140)}"${prompt}`;
|
|
644
661
|
}
|
|
@@ -681,6 +698,45 @@ function delay(ms) {
|
|
|
681
698
|
function toNativeBackend(backend) {
|
|
682
699
|
return backend === "codex" ? "codex" : "claude";
|
|
683
700
|
}
|
|
701
|
+
async function createRunWorkspace(params) {
|
|
702
|
+
const workspace = await createRunJjWorkspace(params);
|
|
703
|
+
const jjChangeId = await currentJjChangeId(workspace.path);
|
|
704
|
+
return {
|
|
705
|
+
path: workspace.path,
|
|
706
|
+
workspaceName: workspace.workspaceName,
|
|
707
|
+
jjChangeId: jjChangeId || undefined,
|
|
708
|
+
};
|
|
709
|
+
}
|
|
710
|
+
// Route through the run's recorded vcs. New runs are always jj; legacy git
|
|
711
|
+
// worktree runs (run.vcs === "git") still merge/sync through the git helpers.
|
|
712
|
+
async function mergeRunIntoCurrentBranch(run, allowDirty, strategy) {
|
|
713
|
+
if ((run.vcs ?? "git") === "jj") {
|
|
714
|
+
return await mergeJjRunIntoCurrentWorkspace(run, allowDirty);
|
|
715
|
+
}
|
|
716
|
+
return await mergeGitRunIntoCurrentBranch(run, allowDirty, strategy);
|
|
717
|
+
}
|
|
718
|
+
async function syncRunWorktree(run, baseBranch) {
|
|
719
|
+
if ((run.vcs ?? "git") === "jj") {
|
|
720
|
+
return await syncJjRunWorkspace(run, baseBranch);
|
|
721
|
+
}
|
|
722
|
+
return await syncGitRunWorktree(run, baseBranch);
|
|
723
|
+
}
|
|
724
|
+
async function removeRunWorkspace(run, force = true) {
|
|
725
|
+
if ((run.vcs ?? "git") === "jj") {
|
|
726
|
+
await removeJjRunWorkspace(run);
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
if (!run.worktree.enabled) {
|
|
730
|
+
return;
|
|
731
|
+
}
|
|
732
|
+
await removeGitWorktree(run.repoRoot, run.worktree.path, force);
|
|
733
|
+
}
|
|
734
|
+
async function baseRevision(repoRoot) {
|
|
735
|
+
return (await currentJjChangeId(repoRoot)) || "";
|
|
736
|
+
}
|
|
737
|
+
async function targetRevision(repoRoot) {
|
|
738
|
+
return (await currentJjChangeId(repoRoot)) || (await currentBranch(repoRoot));
|
|
739
|
+
}
|
|
684
740
|
function effortForBackend(backend, config) {
|
|
685
741
|
if (backend === "claude") {
|
|
686
742
|
return config.backends.claude?.effort;
|
|
@@ -693,6 +749,9 @@ function effortForBackend(backend, config) {
|
|
|
693
749
|
function shortRunTask(run) {
|
|
694
750
|
return taskDisplayLabel(run, 34) || "agent";
|
|
695
751
|
}
|
|
752
|
+
function workspaceKind(run) {
|
|
753
|
+
return (run.vcs ?? "git") === "jj" ? "jj-workspace" : "worktree";
|
|
754
|
+
}
|
|
696
755
|
export async function statusRuns(options) {
|
|
697
756
|
const repoRoot = findRepoRoot();
|
|
698
757
|
const runs = await listRuns(repoRoot);
|
|
@@ -719,7 +778,7 @@ export async function listProjectRuns(options) {
|
|
|
719
778
|
return;
|
|
720
779
|
}
|
|
721
780
|
for (const run of runs) {
|
|
722
|
-
const wt = run.worktree.enabled ? `
|
|
781
|
+
const wt = run.worktree.enabled ? ` ${workspaceKind(run)}=${shortenHome(run.worktree.path)}` : "";
|
|
723
782
|
console.log(`${run.id} ${run.status} ${run.backend}${wt} ${run.task}`);
|
|
724
783
|
}
|
|
725
784
|
}
|
|
@@ -814,17 +873,19 @@ export async function mergeRun(runId, allowDirty = false, options) {
|
|
|
814
873
|
if (!run) {
|
|
815
874
|
throw new Error(`Run not found: ${runId}`);
|
|
816
875
|
}
|
|
817
|
-
const
|
|
876
|
+
const config = await loadConfig();
|
|
877
|
+
const merged = await mergeRunIntoCurrentBranch(run, allowDirty, config.mergeStrategy);
|
|
818
878
|
await emit(merged, {
|
|
819
879
|
ts: nowIso(),
|
|
820
880
|
runId,
|
|
821
881
|
type: "merge.result",
|
|
822
|
-
message: merged
|
|
823
|
-
? "Merged successfully"
|
|
824
|
-
: `Merge conflict: ${(merged.merge?.conflictedFiles ?? []).join(", ")}`,
|
|
882
|
+
message: mergeResultMessage(merged),
|
|
825
883
|
data: (merged.merge ?? {}),
|
|
826
884
|
});
|
|
827
885
|
if (merged.merge?.status === "merged") {
|
|
886
|
+
if ((merged.vcs ?? "git") === "jj") {
|
|
887
|
+
await exportToGit(repoRoot);
|
|
888
|
+
}
|
|
828
889
|
await writeAgentContext(repoRoot);
|
|
829
890
|
if (!options?.silent) {
|
|
830
891
|
console.log(`Merged ${runId}`);
|
|
@@ -833,26 +894,89 @@ export async function mergeRun(runId, allowDirty = false, options) {
|
|
|
833
894
|
}
|
|
834
895
|
await writeAgentContext(repoRoot);
|
|
835
896
|
if (!options?.silent) {
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
console.log(
|
|
897
|
+
if (merged.merge?.status === "conflict") {
|
|
898
|
+
const kind = merged.merge.conflictKind === "rebase" ? "Rebase conflict" : "Merge conflict";
|
|
899
|
+
console.log(`${kind} for ${runId}`);
|
|
900
|
+
for (const file of merged.merge?.conflictedFiles ?? []) {
|
|
901
|
+
console.log(` ${file}`);
|
|
902
|
+
}
|
|
903
|
+
if (merged.merge.conflictKind === "rebase") {
|
|
904
|
+
console.log(`Resolve in ${shortenHome(merged.worktree.path)}, run git rebase --continue, then retry rudder merge ${runId}.`);
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
else {
|
|
908
|
+
console.log(`Merge failed for ${runId}: ${merged.merge?.error ?? "unknown error"}`);
|
|
839
909
|
}
|
|
840
910
|
}
|
|
841
911
|
return merged;
|
|
842
912
|
}
|
|
913
|
+
export async function syncRun(runId, options) {
|
|
914
|
+
const repoRoot = findRepoRoot();
|
|
915
|
+
const run = await resolveRun(repoRoot, runId);
|
|
916
|
+
if (!run) {
|
|
917
|
+
throw new Error("No runs found.");
|
|
918
|
+
}
|
|
919
|
+
const hasIsolation = run.worktree.enabled && (run.worktree.workspaceName || run.worktree.branch);
|
|
920
|
+
if (!hasIsolation) {
|
|
921
|
+
throw new Error(`Run ${run.id} has no workspace to sync.`);
|
|
922
|
+
}
|
|
923
|
+
if (isActiveStatus(run.status)) {
|
|
924
|
+
throw new Error(`Run ${run.id} is still active; wait for it to finish before syncing.`);
|
|
925
|
+
}
|
|
926
|
+
if (run.status === "merged") {
|
|
927
|
+
throw new Error(`Run ${run.id} is already merged.`);
|
|
928
|
+
}
|
|
929
|
+
const current = await currentBranch(repoRoot);
|
|
930
|
+
const baseBranch = current === "HEAD" ? run.targetBranch : current;
|
|
931
|
+
const synced = await syncRunWorktree(run, baseBranch);
|
|
932
|
+
await emit(synced, {
|
|
933
|
+
ts: nowIso(),
|
|
934
|
+
runId: synced.id,
|
|
935
|
+
type: "sync.result",
|
|
936
|
+
message: syncResultMessage(synced),
|
|
937
|
+
data: (synced.sync ?? {}),
|
|
938
|
+
});
|
|
939
|
+
await writeAgentContext(repoRoot);
|
|
940
|
+
if (!options?.silent) {
|
|
941
|
+
if (synced.sync?.status === "synced") {
|
|
942
|
+
console.log(`Synced ${synced.id} with ${synced.sync.baseBranch ?? synced.targetBranch}`);
|
|
943
|
+
}
|
|
944
|
+
else if (synced.sync?.status === "conflict") {
|
|
945
|
+
console.log(`Rebase conflict for ${synced.id}`);
|
|
946
|
+
for (const file of synced.sync.conflictedFiles ?? []) {
|
|
947
|
+
console.log(` ${file}`);
|
|
948
|
+
}
|
|
949
|
+
console.log(`Resolve in ${shortenHome(synced.worktree.path)}, run git rebase --continue, then retry rudder sync ${synced.id}.`);
|
|
950
|
+
}
|
|
951
|
+
else {
|
|
952
|
+
console.log(`Sync failed for ${synced.id}: ${synced.sync?.error ?? "unknown error"}`);
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
return synced;
|
|
956
|
+
}
|
|
843
957
|
export async function deleteRun(runId, options) {
|
|
844
958
|
const repoRoot = findRepoRoot();
|
|
845
959
|
const run = await loadRunRecord(repoRoot, runId);
|
|
846
960
|
if (!run) {
|
|
847
961
|
throw new Error(`Run not found: ${runId}`);
|
|
848
962
|
}
|
|
963
|
+
let mergeError;
|
|
849
964
|
if (options?.mergeFirst) {
|
|
850
|
-
|
|
965
|
+
try {
|
|
966
|
+
await mergeRun(runId, false, { silent: true });
|
|
967
|
+
}
|
|
968
|
+
catch (error) {
|
|
969
|
+
mergeError = error;
|
|
970
|
+
}
|
|
851
971
|
}
|
|
852
972
|
const latest = await loadRunRecord(repoRoot, runId) ?? run;
|
|
853
973
|
if (options?.mergeFirst && latest.merge?.status === "conflict") {
|
|
854
974
|
throw new Error(`Merge conflict for ${runId}; resolve it before deleting the run.`);
|
|
855
975
|
}
|
|
976
|
+
if (mergeError && !options?.force) {
|
|
977
|
+
const message = mergeError instanceof Error ? mergeError.message : String(mergeError);
|
|
978
|
+
throw new Error(`Merge failed for ${runId}; run was not deleted. ${message}`);
|
|
979
|
+
}
|
|
856
980
|
if (latest.process?.pid && processAlive(latest.process.pid)) {
|
|
857
981
|
process.kill(latest.process.pid, "SIGTERM");
|
|
858
982
|
}
|
|
@@ -860,7 +984,7 @@ export async function deleteRun(runId, options) {
|
|
|
860
984
|
await killPane(latest.terminal.paneId).catch(() => undefined);
|
|
861
985
|
}
|
|
862
986
|
if (latest.worktree.enabled) {
|
|
863
|
-
await
|
|
987
|
+
await removeRunWorkspace(latest, options?.force ?? true).catch(() => undefined);
|
|
864
988
|
}
|
|
865
989
|
await fsp.rm(runDir(repoRoot, runId), { recursive: true, force: true });
|
|
866
990
|
await writeAgentContext(repoRoot);
|
|
@@ -868,21 +992,66 @@ export async function deleteRun(runId, options) {
|
|
|
868
992
|
console.log(`Deleted ${runId}`);
|
|
869
993
|
}
|
|
870
994
|
}
|
|
995
|
+
function mergeResultMessage(run) {
|
|
996
|
+
if (run.merge?.status === "merged") {
|
|
997
|
+
return run.merge.strategy === "rebase"
|
|
998
|
+
? "Rebased and fast-forward merged successfully"
|
|
999
|
+
: "Merged successfully";
|
|
1000
|
+
}
|
|
1001
|
+
if (run.merge?.status === "conflict") {
|
|
1002
|
+
const files = (run.merge.conflictedFiles ?? []).join(", ") || "unknown files";
|
|
1003
|
+
if (run.merge.conflictKind === "rebase") {
|
|
1004
|
+
return `Rebase conflict before merge: ${files}. Resolve in the worktree, run git rebase --continue, then retry merge.`;
|
|
1005
|
+
}
|
|
1006
|
+
return `Merge conflict: ${files}`;
|
|
1007
|
+
}
|
|
1008
|
+
if (run.merge?.status === "failed") {
|
|
1009
|
+
return `Merge failed: ${run.merge.error ?? "unknown error"}`;
|
|
1010
|
+
}
|
|
1011
|
+
return "Merge did not complete";
|
|
1012
|
+
}
|
|
1013
|
+
function syncResultMessage(run) {
|
|
1014
|
+
if (run.sync?.status === "synced") {
|
|
1015
|
+
return `Synced with ${run.sync.baseBranch ?? run.targetBranch}`;
|
|
1016
|
+
}
|
|
1017
|
+
if (run.sync?.status === "conflict") {
|
|
1018
|
+
const files = (run.sync.conflictedFiles ?? []).join(", ") || "unknown files";
|
|
1019
|
+
return `Rebase conflict while syncing: ${files}. Resolve in the worktree, run git rebase --continue, then retry sync.`;
|
|
1020
|
+
}
|
|
1021
|
+
if (run.sync?.status === "failed") {
|
|
1022
|
+
return `Sync failed: ${run.sync.error ?? "unknown error"}`;
|
|
1023
|
+
}
|
|
1024
|
+
return "Sync did not complete";
|
|
1025
|
+
}
|
|
871
1026
|
export async function cleanupRuns(force = false) {
|
|
872
1027
|
const repoRoot = findRepoRoot();
|
|
873
1028
|
const runs = await listRuns(repoRoot);
|
|
874
1029
|
for (const run of runs) {
|
|
875
|
-
if (!run
|
|
1030
|
+
if (!canCleanupRun(run, force)) {
|
|
876
1031
|
continue;
|
|
877
1032
|
}
|
|
878
|
-
|
|
879
|
-
|
|
1033
|
+
try {
|
|
1034
|
+
await removeRunWorkspace(run, force);
|
|
1035
|
+
console.log(`Removed ${shortenHome(run.worktree.path)}`);
|
|
1036
|
+
}
|
|
1037
|
+
catch {
|
|
1038
|
+
// Best-effort cleanup matches the existing git worktree behavior.
|
|
880
1039
|
}
|
|
881
|
-
await removeWorktree(repoRoot, run.worktree.path, force).catch(() => undefined);
|
|
882
|
-
console.log(`Removed ${shortenHome(run.worktree.path)}`);
|
|
883
1040
|
}
|
|
884
1041
|
await writeAgentContext(repoRoot);
|
|
885
1042
|
}
|
|
1043
|
+
function canCleanupRun(run, force) {
|
|
1044
|
+
if (!run.worktree.enabled) {
|
|
1045
|
+
return false;
|
|
1046
|
+
}
|
|
1047
|
+
if (force) {
|
|
1048
|
+
return true;
|
|
1049
|
+
}
|
|
1050
|
+
if ((run.vcs ?? "git") === "jj") {
|
|
1051
|
+
return run.status === "merged" || run.status === "completed";
|
|
1052
|
+
}
|
|
1053
|
+
return run.status === "merged";
|
|
1054
|
+
}
|
|
886
1055
|
export async function reconcileNativeTerminals(repoRoot) {
|
|
887
1056
|
const runs = await listRuns(repoRoot);
|
|
888
1057
|
let touched = false;
|
|
@@ -1068,9 +1237,11 @@ function renderShellEvent(event, state) {
|
|
|
1068
1237
|
let sawStreamingText = state.sawStreamingText;
|
|
1069
1238
|
let partialOpen = state.partialOpen;
|
|
1070
1239
|
if (event.type === "run.created") {
|
|
1071
|
-
const message = event.message?.startsWith("Created
|
|
1072
|
-
? event.message.replace("Created
|
|
1073
|
-
:
|
|
1240
|
+
const message = event.message?.startsWith("Created jj workspace ")
|
|
1241
|
+
? event.message.replace("Created jj workspace ", "workspace ")
|
|
1242
|
+
: event.message?.startsWith("Created worktree ")
|
|
1243
|
+
? event.message.replace("Created worktree ", "worktree ")
|
|
1244
|
+
: undefined;
|
|
1074
1245
|
return { text: message, sawStreamingText, partialOpen };
|
|
1075
1246
|
}
|
|
1076
1247
|
if (event.type === "planner.spec") {
|