@herbcaudill/ralph 0.4.3 → 0.5.1
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/cli.d.ts.map +1 -1
- package/dist/cli.js +32 -0
- package/dist/cli.js.map +1 -1
- package/dist/components/App.d.ts.map +1 -1
- package/dist/components/App.js +2 -5
- package/dist/components/App.js.map +1 -1
- package/dist/components/EventDisplay.d.ts +9 -1
- package/dist/components/EventDisplay.d.ts.map +1 -1
- package/dist/components/EventDisplay.js +109 -56
- package/dist/components/EventDisplay.js.map +1 -1
- package/dist/components/EventDisplay.replay.test.js +31 -3
- package/dist/components/EventDisplay.replay.test.js.map +1 -1
- package/dist/components/EventDisplay.test.js +107 -11
- package/dist/components/EventDisplay.test.js.map +1 -1
- package/dist/components/Header.d.ts +2 -1
- package/dist/components/Header.d.ts.map +1 -1
- package/dist/components/Header.js +2 -2
- package/dist/components/Header.js.map +1 -1
- package/dist/components/IterationRunner.d.ts +3 -1
- package/dist/components/IterationRunner.d.ts.map +1 -1
- package/dist/components/IterationRunner.js +99 -184
- package/dist/components/IterationRunner.js.map +1 -1
- package/dist/components/ReplayLog.d.ts +3 -1
- package/dist/components/ReplayLog.d.ts.map +1 -1
- package/dist/components/ReplayLog.js +2 -2
- package/dist/components/ReplayLog.js.map +1 -1
- package/dist/index.d.ts +0 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/addTodo.d.ts +10 -0
- package/dist/lib/addTodo.d.ts.map +1 -0
- package/dist/lib/addTodo.js +55 -0
- package/dist/lib/addTodo.js.map +1 -0
- package/package.json +5 -5
- package/templates/prompt.md +1 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,MAAM,GAAI,
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,eAAO,MAAM,MAAM,GAAI,wCAAwC,KAAK,sBAiBnE,CAAA;AAED,KAAK,KAAK,GAAG;IACX,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA"}
|
|
@@ -2,8 +2,8 @@ import React from "react";
|
|
|
2
2
|
import { Box, Text } from "ink";
|
|
3
3
|
import BigText from "ink-big-text";
|
|
4
4
|
import Gradient from "ink-gradient";
|
|
5
|
-
export const Header = ({ claudeVersion, ralphVersion }) => {
|
|
6
|
-
return (React.createElement(Box, { flexDirection: "column", marginBottom: 1, borderStyle: "single",
|
|
5
|
+
export const Header = ({ claudeVersion, ralphVersion, width }) => {
|
|
6
|
+
return (React.createElement(Box, { flexDirection: "column", marginBottom: 1, borderStyle: "single", alignItems: "center", width: width },
|
|
7
7
|
React.createElement(Gradient, { colors: ["#30A6E4", "#EBC635"] },
|
|
8
8
|
React.createElement(BigText, { text: "Ralph", font: "tiny" })),
|
|
9
9
|
React.createElement(Text, { dimColor: true },
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,QAAQ,MAAM,cAAc,CAAA;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,aAAa,EAAE,YAAY,EAAS,EAAE,EAAE;
|
|
1
|
+
{"version":3,"file":"Header.js","sourceRoot":"","sources":["../../src/components/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,KAAK,CAAA;AAC/B,OAAO,OAAO,MAAM,cAAc,CAAA;AAClC,OAAO,QAAQ,MAAM,cAAc,CAAA;AAEnC,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,EAAE,aAAa,EAAE,YAAY,EAAE,KAAK,EAAS,EAAE,EAAE;IACtE,OAAO,CACL,oBAAC,GAAG,IACF,aAAa,EAAC,QAAQ,EACtB,YAAY,EAAE,CAAC,EACf,WAAW,EAAC,QAAQ,EACpB,UAAU,EAAC,QAAQ,EACnB,KAAK,EAAE,KAAK;QAEZ,oBAAC,QAAQ,IAAC,MAAM,EAAE,CAAC,SAAS,EAAE,SAAS,CAAC;YACtC,oBAAC,OAAO,IAAC,IAAI,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,GAAG,CAC3B;QACX,oBAAC,IAAI,IAAC,QAAQ;;YACS,YAAY;;YAAkB,aAAa,CAC3D,CACH,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const IterationRunner: ({ totalIterations }: Props) => React.JSX.Element;
|
|
2
|
+
export declare const IterationRunner: ({ totalIterations, claudeVersion, ralphVersion }: Props) => React.JSX.Element;
|
|
3
3
|
type Props = {
|
|
4
4
|
totalIterations: number;
|
|
5
|
+
claudeVersion: string;
|
|
6
|
+
ralphVersion: string;
|
|
5
7
|
};
|
|
6
8
|
export {};
|
|
7
9
|
//# sourceMappingURL=IterationRunner.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IterationRunner.d.ts","sourceRoot":"","sources":["../../src/components/IterationRunner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"IterationRunner.d.ts","sourceRoot":"","sources":["../../src/components/IterationRunner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAsC,MAAM,OAAO,CAAA;AAuB1D,eAAO,MAAM,eAAe,GAAI,kDAAkD,KAAK,sBAuPtF,CAAA;AAED,KAAK,KAAK,GAAG;IACX,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA"}
|
|
@@ -2,75 +2,30 @@ import React, { useState, useEffect, useRef } from "react";
|
|
|
2
2
|
import { Box, Text, useApp } from "ink";
|
|
3
3
|
import Spinner from "ink-spinner";
|
|
4
4
|
import SelectInput from "ink-select-input";
|
|
5
|
-
import { execSync } from "child_process";
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import { join } from "path";
|
|
5
|
+
import { spawn, execSync } from "child_process";
|
|
6
|
+
import { appendFileSync, writeFileSync, mkdirSync, existsSync } from "fs";
|
|
7
|
+
import { join, dirname } from "path";
|
|
9
8
|
import { EventDisplay } from "./EventDisplay.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
import { popStash } from "../lib/popStash.js";
|
|
13
|
-
import { createWorktree } from "../lib/createWorktree.js";
|
|
14
|
-
import { copyRalphFilesToWorktree } from "../lib/copyRalphFilesToWorktree.js";
|
|
15
|
-
import { mergeWorktreeToMain } from "../lib/mergeWorktreeToMain.js";
|
|
16
|
-
import { cleanupWorktree } from "../lib/cleanupWorktree.js";
|
|
17
|
-
import { installDependencies } from "../lib/installDependencies.js";
|
|
18
|
-
import { registerCleanup, unregisterCleanup } from "../lib/signalHandler.js";
|
|
19
|
-
const repoRoot = process.cwd();
|
|
20
|
-
const ralphDir = join(repoRoot, ".ralph");
|
|
9
|
+
const logFile = join(process.cwd(), ".ralph", "events.log");
|
|
10
|
+
const ralphDir = join(process.cwd(), ".ralph");
|
|
21
11
|
const checkRequiredFiles = () => {
|
|
22
12
|
const requiredFiles = ["prompt.md", "todo.md", "progress.md"];
|
|
23
13
|
const missing = requiredFiles.filter(file => !existsSync(join(ralphDir, file)));
|
|
24
14
|
return { missing, exists: missing.length === 0 };
|
|
25
15
|
};
|
|
26
|
-
export const IterationRunner = ({ totalIterations }) => {
|
|
16
|
+
export const IterationRunner = ({ totalIterations, claudeVersion, ralphVersion }) => {
|
|
27
17
|
const { exit } = useApp();
|
|
28
18
|
const [currentIteration, setCurrentIteration] = useState(1);
|
|
29
19
|
const [events, setEvents] = useState([]);
|
|
20
|
+
const eventsRef = useRef([]);
|
|
21
|
+
const [completedIterations, setCompletedIterations] = useState([]);
|
|
30
22
|
const [output, setOutput] = useState("");
|
|
31
23
|
const [error, setError] = useState();
|
|
32
24
|
const [needsInit, setNeedsInit] = useState(null);
|
|
33
25
|
const [initializing, setInitializing] = useState(false);
|
|
34
26
|
const [isRunning, setIsRunning] = useState(false);
|
|
35
|
-
// Use refs for worktree/stash state to avoid triggering effect re-runs
|
|
36
|
-
const currentWorktreeRef = useRef(null);
|
|
37
|
-
const hasStashedChangesRef = useRef(false);
|
|
38
|
-
const childProcessRef = useRef(null);
|
|
39
27
|
// Only use input handling if stdin supports raw mode
|
|
40
28
|
const stdinSupportsRawMode = process.stdin.isTTY === true;
|
|
41
|
-
// Cleanup function for worktrees and stash
|
|
42
|
-
const cleanup = () => {
|
|
43
|
-
try {
|
|
44
|
-
if (currentWorktreeRef.current) {
|
|
45
|
-
const gitRoot = getGitRoot(repoRoot);
|
|
46
|
-
cleanupWorktree(gitRoot, currentWorktreeRef.current);
|
|
47
|
-
currentWorktreeRef.current = null;
|
|
48
|
-
}
|
|
49
|
-
if (hasStashedChangesRef.current) {
|
|
50
|
-
const gitRoot = getGitRoot(repoRoot);
|
|
51
|
-
popStash(gitRoot);
|
|
52
|
-
hasStashedChangesRef.current = false;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
catch (err) {
|
|
56
|
-
console.error(`Cleanup error: ${err}`);
|
|
57
|
-
}
|
|
58
|
-
};
|
|
59
|
-
// Register cleanup for SIGINT/SIGTERM (Ctrl+C)
|
|
60
|
-
useEffect(() => {
|
|
61
|
-
registerCleanup(async () => {
|
|
62
|
-
const child = childProcessRef.current;
|
|
63
|
-
if (child) {
|
|
64
|
-
child.kill("SIGTERM");
|
|
65
|
-
await child; // Wait for process to actually terminate
|
|
66
|
-
childProcessRef.current = null;
|
|
67
|
-
}
|
|
68
|
-
cleanup();
|
|
69
|
-
});
|
|
70
|
-
return () => {
|
|
71
|
-
unregisterCleanup();
|
|
72
|
-
};
|
|
73
|
-
}, []);
|
|
74
29
|
const handleInitSelection = (item) => {
|
|
75
30
|
if (item.value === "yes") {
|
|
76
31
|
setInitializing(true);
|
|
@@ -97,10 +52,12 @@ export const IterationRunner = ({ totalIterations }) => {
|
|
|
97
52
|
}, 100);
|
|
98
53
|
}
|
|
99
54
|
};
|
|
55
|
+
// Keep ref in sync with events state for access in callbacks
|
|
56
|
+
useEffect(() => {
|
|
57
|
+
eventsRef.current = events;
|
|
58
|
+
}, [events]);
|
|
100
59
|
useEffect(() => {
|
|
101
60
|
if (currentIteration > totalIterations) {
|
|
102
|
-
// Clean up and exit
|
|
103
|
-
cleanup();
|
|
104
61
|
exit();
|
|
105
62
|
return;
|
|
106
63
|
}
|
|
@@ -117,140 +74,102 @@ export const IterationRunner = ({ totalIterations }) => {
|
|
|
117
74
|
}
|
|
118
75
|
return;
|
|
119
76
|
}
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
reject: false, // Don't throw on non-zero exit
|
|
158
|
-
detached: true, // Run in new process group to prevent SIGINT propagation
|
|
159
|
-
});
|
|
160
|
-
childProcessRef.current = child;
|
|
161
|
-
setIsRunning(true);
|
|
162
|
-
let fullOutput = "";
|
|
163
|
-
const worktreeLogFile = join(worktree.path, ".ralph", "events.log");
|
|
164
|
-
// Handle streaming stdout
|
|
165
|
-
child.stdout?.on("data", (data) => {
|
|
166
|
-
const chunk = data.toString();
|
|
167
|
-
for (const line of chunk.split("\n")) {
|
|
168
|
-
if (!line.trim())
|
|
169
|
-
continue;
|
|
170
|
-
try {
|
|
171
|
-
const event = JSON.parse(line);
|
|
172
|
-
appendFileSync(worktreeLogFile, JSON.stringify(event, null, 2) + "\n\n");
|
|
173
|
-
setEvents(prev => [...prev, event]);
|
|
174
|
-
}
|
|
175
|
-
catch {
|
|
176
|
-
// Incomplete JSON line, ignore
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
fullOutput += chunk;
|
|
180
|
-
setOutput(fullOutput);
|
|
181
|
-
});
|
|
182
|
-
// Handle process completion
|
|
183
|
-
child.then(result => {
|
|
184
|
-
childProcessRef.current = null;
|
|
185
|
-
setIsRunning(false);
|
|
186
|
-
const gitRoot = getGitRoot(repoRoot);
|
|
187
|
-
// Handle error exit (but not if terminated by signal during cleanup)
|
|
188
|
-
if (result.exitCode !== 0 && !result.isTerminated) {
|
|
189
|
-
setError(`Claude exited with code ${result.exitCode}${result.signal ? ` (signal: ${result.signal})` : ""}\n\nLast 2000 chars:\n${fullOutput.slice(-2000)}`);
|
|
190
|
-
cleanupWorktree(gitRoot, worktree);
|
|
191
|
-
currentWorktreeRef.current = null;
|
|
192
|
-
setTimeout(() => {
|
|
193
|
-
cleanup();
|
|
194
|
-
exit();
|
|
195
|
-
process.exit(1);
|
|
196
|
-
}, 100);
|
|
197
|
-
return;
|
|
198
|
-
}
|
|
199
|
-
// If terminated during cleanup, don't proceed
|
|
200
|
-
if (result.isTerminated) {
|
|
201
|
-
return;
|
|
202
|
-
}
|
|
203
|
-
// Merge worktree changes back to main
|
|
204
|
-
// Note: .ralph/ files are included in the merge since Claude commits them in the worktree
|
|
205
|
-
try {
|
|
206
|
-
mergeWorktreeToMain(gitRoot, worktree);
|
|
207
|
-
cleanupWorktree(gitRoot, worktree);
|
|
208
|
-
currentWorktreeRef.current = null;
|
|
209
|
-
}
|
|
210
|
-
catch (err) {
|
|
211
|
-
setError(`Failed to merge worktree: ${err}`);
|
|
212
|
-
cleanupWorktree(gitRoot, worktree);
|
|
213
|
-
currentWorktreeRef.current = null;
|
|
214
|
-
setTimeout(() => {
|
|
215
|
-
cleanup();
|
|
216
|
-
exit();
|
|
217
|
-
process.exit(1);
|
|
218
|
-
}, 100);
|
|
219
|
-
return;
|
|
220
|
-
}
|
|
221
|
-
// Check if complete
|
|
222
|
-
if (fullOutput.includes("<promise>COMPLETE</promise>")) {
|
|
223
|
-
cleanup();
|
|
77
|
+
// Ensure .ralph directory exists and clear log file at start of each iteration
|
|
78
|
+
mkdirSync(dirname(logFile), { recursive: true });
|
|
79
|
+
writeFileSync(logFile, "");
|
|
80
|
+
setEvents([]);
|
|
81
|
+
setOutput("");
|
|
82
|
+
const child = spawn("claude", [
|
|
83
|
+
"--permission-mode",
|
|
84
|
+
"bypassPermissions",
|
|
85
|
+
"-p",
|
|
86
|
+
"@.ralph/prompt.md",
|
|
87
|
+
"@.ralph/todo.md",
|
|
88
|
+
"@.ralph/progress.md",
|
|
89
|
+
"--output-format",
|
|
90
|
+
"stream-json",
|
|
91
|
+
"--include-partial-messages",
|
|
92
|
+
"--verbose",
|
|
93
|
+
], {
|
|
94
|
+
stdio: ["inherit", "pipe", "inherit"],
|
|
95
|
+
env: {
|
|
96
|
+
...process.env,
|
|
97
|
+
// Disable LSP plugins to avoid crashes when TypeScript LSP server errors
|
|
98
|
+
ENABLE_LSP_TOOL: "0",
|
|
99
|
+
},
|
|
100
|
+
});
|
|
101
|
+
setIsRunning(true);
|
|
102
|
+
let fullOutput = "";
|
|
103
|
+
let stdoutEnded = false;
|
|
104
|
+
let closeInfo = null;
|
|
105
|
+
let finalResult = "";
|
|
106
|
+
const handleIterationComplete = () => {
|
|
107
|
+
if (!stdoutEnded || !closeInfo)
|
|
108
|
+
return;
|
|
109
|
+
setIsRunning(false);
|
|
110
|
+
const { code, signal } = closeInfo;
|
|
111
|
+
if (code !== 0) {
|
|
112
|
+
setError(`Claude exited with code ${code}${signal ? ` (signal: ${signal})` : ""}\n\nLast 2000 chars:\n${fullOutput.slice(-2000)}`);
|
|
113
|
+
setTimeout(() => {
|
|
224
114
|
exit();
|
|
225
|
-
process.exit(
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
115
|
+
process.exit(1);
|
|
116
|
+
}, 100);
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
// Only check Claude's final result message, not the entire output
|
|
120
|
+
// (which may include file contents that contain the completion string)
|
|
121
|
+
if (finalResult.includes("<promise>COMPLETE</promise>")) {
|
|
122
|
+
exit();
|
|
123
|
+
process.exit(0);
|
|
124
|
+
return;
|
|
125
|
+
}
|
|
126
|
+
// Save current events and move to next iteration
|
|
127
|
+
const currentEvents = eventsRef.current;
|
|
128
|
+
setCompletedIterations(prev => [
|
|
129
|
+
...prev,
|
|
130
|
+
{ iteration: currentIteration, events: currentEvents },
|
|
131
|
+
]);
|
|
132
|
+
setTimeout(() => setCurrentIteration(i => i + 1), 500);
|
|
133
|
+
};
|
|
134
|
+
child.stdout.on("data", data => {
|
|
135
|
+
const chunk = data.toString();
|
|
136
|
+
for (const line of chunk.split("\n")) {
|
|
137
|
+
if (!line.trim())
|
|
138
|
+
continue;
|
|
239
139
|
try {
|
|
240
|
-
const
|
|
241
|
-
|
|
242
|
-
|
|
140
|
+
const event = JSON.parse(line);
|
|
141
|
+
appendFileSync(logFile, JSON.stringify(event, null, 2) + "\n\n");
|
|
142
|
+
setEvents(prev => [...prev, event]);
|
|
143
|
+
// Capture the final result message from result events
|
|
144
|
+
if (event.type === "result" && typeof event.result === "string") {
|
|
145
|
+
finalResult = event.result;
|
|
146
|
+
}
|
|
243
147
|
}
|
|
244
148
|
catch {
|
|
245
|
-
//
|
|
149
|
+
// Incomplete JSON line, ignore
|
|
246
150
|
}
|
|
247
151
|
}
|
|
152
|
+
fullOutput += chunk;
|
|
153
|
+
setOutput(fullOutput);
|
|
154
|
+
});
|
|
155
|
+
child.stdout.on("end", () => {
|
|
156
|
+
stdoutEnded = true;
|
|
157
|
+
handleIterationComplete();
|
|
158
|
+
});
|
|
159
|
+
child.on("close", (code, signal) => {
|
|
160
|
+
closeInfo = { code, signal };
|
|
161
|
+
handleIterationComplete();
|
|
162
|
+
});
|
|
163
|
+
child.on("error", error => {
|
|
164
|
+
setError(`Error running Claude: ${error.message}`);
|
|
248
165
|
setTimeout(() => {
|
|
249
|
-
cleanup();
|
|
250
166
|
exit();
|
|
251
167
|
process.exit(1);
|
|
252
168
|
}, 100);
|
|
253
|
-
}
|
|
169
|
+
});
|
|
170
|
+
return () => {
|
|
171
|
+
child.kill();
|
|
172
|
+
};
|
|
254
173
|
}, [currentIteration, totalIterations, exit]);
|
|
255
174
|
if (needsInit) {
|
|
256
175
|
if (initializing) {
|
|
@@ -280,11 +199,7 @@ export const IterationRunner = ({ totalIterations }) => {
|
|
|
280
199
|
React.createElement(Text, { color: "red" }, error)));
|
|
281
200
|
}
|
|
282
201
|
return (React.createElement(Box, { flexDirection: "column" },
|
|
283
|
-
React.createElement(
|
|
284
|
-
React.createElement(Text, { color: "cyan" },
|
|
285
|
-
"Iteration ",
|
|
286
|
-
currentIteration)),
|
|
287
|
-
React.createElement(EventDisplay, { events: events }),
|
|
202
|
+
React.createElement(EventDisplay, { events: events, iteration: currentIteration, completedIterations: completedIterations, claudeVersion: claudeVersion, ralphVersion: ralphVersion }),
|
|
288
203
|
isRunning && (React.createElement(Box, { marginTop: 1 },
|
|
289
204
|
React.createElement(Text, { color: "cyan" },
|
|
290
205
|
React.createElement(Spinner, { type: "dots" }))))));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IterationRunner.js","sourceRoot":"","sources":["../../src/components/IterationRunner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AACvC,OAAO,OAAO,MAAM,aAAa,CAAA;AACjC,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;
|
|
1
|
+
{"version":3,"file":"IterationRunner.js","sourceRoot":"","sources":["../../src/components/IterationRunner.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,KAAK,CAAA;AACvC,OAAO,OAAO,MAAM,aAAa,CAAA;AACjC,OAAO,WAAW,MAAM,kBAAkB,CAAA;AAC1C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AAC/C,OAAO,EAAE,cAAc,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,IAAI,CAAA;AACzE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,MAAM,CAAA;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAEhD,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,QAAQ,EAAE,YAAY,CA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C,EACD,QAAQ,EAAE,mBAAmB,GAC7B,CACE,CACL;gBACL,CAAC,CAAC,oBAAC,IAAI;;oBACC,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM,iBAAkB;kDACnC,CAEL,CACF,CACP,CAAA;IACH,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ;YACzB,oBAAC,IAAI,IAAC,KAAK,EAAC,KAAK,IAAE,KAAK,CAAQ,CAC5B,CACP,CAAA;IACH,CAAC;IAED,OAAO,CACL,oBAAC,GAAG,IAAC,aAAa,EAAC,QAAQ;QACzB,oBAAC,YAAY,IACX,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,gBAAgB,EAC3B,mBAAmB,EAAE,mBAAmB,EACxC,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,YAAY,GAC1B;QACD,SAAS,IAAI,CACZ,oBAAC,GAAG,IAAC,SAAS,EAAE,CAAC;YACf,oBAAC,IAAI,IAAC,KAAK,EAAC,MAAM;gBAChB,oBAAC,OAAO,IAAC,IAAI,EAAC,MAAM,GAAG,CAClB,CACH,CACP,CACG,CACP,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
export declare const ReplayLog: ({ filePath }: Props) => React.JSX.Element;
|
|
2
|
+
export declare const ReplayLog: ({ filePath, claudeVersion, ralphVersion }: Props) => React.JSX.Element;
|
|
3
3
|
type Props = {
|
|
4
4
|
filePath: string;
|
|
5
|
+
claudeVersion: string;
|
|
6
|
+
ralphVersion: string;
|
|
5
7
|
};
|
|
6
8
|
export {};
|
|
7
9
|
//# sourceMappingURL=ReplayLog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReplayLog.d.ts","sourceRoot":"","sources":["../../src/components/ReplayLog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAKlD,eAAO,MAAM,SAAS,GAAI,
|
|
1
|
+
{"version":3,"file":"ReplayLog.d.ts","sourceRoot":"","sources":["../../src/components/ReplayLog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAA;AAKlD,eAAO,MAAM,SAAS,GAAI,2CAA2C,KAAK,sBA4DzE,CAAA;AAED,KAAK,KAAK,GAAG;IACX,QAAQ,EAAE,MAAM,CAAA;IAChB,aAAa,EAAE,MAAM,CAAA;IACrB,YAAY,EAAE,MAAM,CAAA;CACrB,CAAA"}
|
|
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react";
|
|
|
2
2
|
import { Box, Text, useApp } from "ink";
|
|
3
3
|
import { readFileSync } from "fs";
|
|
4
4
|
import { EventDisplay } from "./EventDisplay.js";
|
|
5
|
-
export const ReplayLog = ({ filePath }) => {
|
|
5
|
+
export const ReplayLog = ({ filePath, claudeVersion, ralphVersion }) => {
|
|
6
6
|
const { exit } = useApp();
|
|
7
7
|
const [events, setEvents] = useState([]);
|
|
8
8
|
const [error, setError] = useState();
|
|
@@ -46,6 +46,6 @@ export const ReplayLog = ({ filePath }) => {
|
|
|
46
46
|
filePath)),
|
|
47
47
|
React.createElement(Box, { marginBottom: 1 },
|
|
48
48
|
React.createElement(Text, { dimColor: true }, "─".repeat(40))),
|
|
49
|
-
React.createElement(EventDisplay, { events: events })));
|
|
49
|
+
React.createElement(EventDisplay, { events: events, iteration: 1, completedIterations: [], claudeVersion: claudeVersion, ralphVersion: ralphVersion })));
|
|
50
50
|
};
|
|
51
51
|
//# sourceMappingURL=ReplayLog.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReplayLog.js","sourceRoot":"","sources":["../../src/components/ReplayLog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAClD,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,MAAM,EAAE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EAAE,MAAM,EACd,SAAS,EAAE,CAAC,EACZ,mBAAmB,EAAE,EAAE,EACvB,aAAa,EAAE,aAAa,EAC5B,YAAY,EAAE,YAAY,GAC1B,CACE,CACP,CAAA;AACH,CAAC,CAAA"}
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,GAAG,YAEf,CAAA"}
|
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,UAAU,CAAA;AAElC,MAAM,CAAC,MAAM,GAAG,GAAG,GAAG,EAAE;IACtB,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAA;AAC7B,CAAC,CAAA;AAED,yBAAyB;AACzB,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,UAAU,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;IACpD,GAAG,EAAE,CAAA;AACP,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adds a todo item to the todo.md file and commits just that line.
|
|
3
|
+
* Inserts the todo into the working directory, stages only that line, and commits.
|
|
4
|
+
*/
|
|
5
|
+
export declare const addTodo: (description: string, cwd?: string) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Inserts a todo item into the content, right after the "To do" header.
|
|
8
|
+
*/
|
|
9
|
+
export declare const insertTodo: (content: string, description: string) => string;
|
|
10
|
+
//# sourceMappingURL=addTodo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addTodo.d.ts","sourceRoot":"","sources":["../../src/lib/addTodo.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,eAAO,MAAM,OAAO,GAAI,aAAa,MAAM,EAAE,MAAK,MAAsB,KAAG,IAqC1E,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,SAAS,MAAM,EAAE,aAAa,MAAM,KAAG,MAmBjE,CAAA"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { execSync } from "child_process";
|
|
2
|
+
import { readFileSync, writeFileSync } from "fs";
|
|
3
|
+
import { join } from "path";
|
|
4
|
+
/**
|
|
5
|
+
* Adds a todo item to the todo.md file and commits just that line.
|
|
6
|
+
* Inserts the todo into the working directory, stages only that line, and commits.
|
|
7
|
+
*/
|
|
8
|
+
export const addTodo = (description, cwd = process.cwd()) => {
|
|
9
|
+
const todoPath = join(cwd, ".ralph", "todo.md");
|
|
10
|
+
// Read current working directory file and insert the new todo
|
|
11
|
+
const content = readFileSync(todoPath, "utf-8");
|
|
12
|
+
const newContent = insertTodo(content, description);
|
|
13
|
+
// Write updated content to working directory
|
|
14
|
+
writeFileSync(todoPath, newContent);
|
|
15
|
+
// Get what's currently in the index for this file (or HEAD if not staged)
|
|
16
|
+
const indexContent = execSync("git show :0:.ralph/todo.md 2>/dev/null || git show HEAD:.ralph/todo.md", {
|
|
17
|
+
cwd,
|
|
18
|
+
encoding: "utf-8",
|
|
19
|
+
});
|
|
20
|
+
// Create a blob with just the todo added to the index version
|
|
21
|
+
const indexWithTodo = insertTodo(indexContent, description);
|
|
22
|
+
const blobHash = execSync("git hash-object -w --stdin", {
|
|
23
|
+
cwd,
|
|
24
|
+
encoding: "utf-8",
|
|
25
|
+
input: indexWithTodo,
|
|
26
|
+
}).trim();
|
|
27
|
+
// Stage just our change by updating the index to this blob
|
|
28
|
+
execSync(`git update-index --cacheinfo 100644,${blobHash},.ralph/todo.md`, {
|
|
29
|
+
cwd,
|
|
30
|
+
stdio: "pipe",
|
|
31
|
+
});
|
|
32
|
+
// Commit just the staged change
|
|
33
|
+
execSync(`git commit -m "todo: ${description}"`, { cwd, stdio: "pipe" });
|
|
34
|
+
console.log(`✅ added`);
|
|
35
|
+
};
|
|
36
|
+
/**
|
|
37
|
+
* Inserts a todo item into the content, right after the "To do" header.
|
|
38
|
+
*/
|
|
39
|
+
export const insertTodo = (content, description) => {
|
|
40
|
+
const lines = content.split("\n");
|
|
41
|
+
const todoHeaderIndex = lines.findIndex(line => /^###?\s*To\s*do/i.test(line));
|
|
42
|
+
if (todoHeaderIndex === -1) {
|
|
43
|
+
// No "To do" section found, add one at the beginning
|
|
44
|
+
return `### To do\n\n- [ ] ${description}\n\n${content}`;
|
|
45
|
+
}
|
|
46
|
+
// Find the first line after the header (skip empty lines)
|
|
47
|
+
let insertIndex = todoHeaderIndex + 1;
|
|
48
|
+
while (insertIndex < lines.length && lines[insertIndex].trim() === "") {
|
|
49
|
+
insertIndex++;
|
|
50
|
+
}
|
|
51
|
+
// Insert the new todo item
|
|
52
|
+
lines.splice(insertIndex, 0, `- [ ] ${description}`);
|
|
53
|
+
return lines.join("\n");
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=addTodo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"addTodo.js","sourceRoot":"","sources":["../../src/lib/addTodo.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAA;AACxC,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,IAAI,CAAA;AAChD,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAE3B;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,WAAmB,EAAE,MAAc,OAAO,CAAC,GAA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AC,CAAA;IAE9E,IAAI,eAAe,KAAK,CAAC,CAAC,EAAE,CAAC;QAC3B,qDAAqD;QACrD,OAAO,sBAAsB,WAAW,OAAO,OAAO,EAAE,CAAA;IAC1D,CAAC;IAED,0DAA0D;IAC1D,IAAI,WAAW,GAAG,eAAe,GAAG,CAAC,CAAA;IACrC,OAAO,WAAW,GAAG,KAAK,CAAC,MAAM,IAAI,KAAK,CAAC,WAAW,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC;QACtE,WAAW,EAAE,CAAA;IACf,CAAC;IAED,2BAA2B;IAC3B,KAAK,CAAC,MAAM,CAAC,WAAW,EAAE,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC,CAAA;IAEpD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AACzB,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@herbcaudill/ralph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "Autonomous AI iteration engine for Claude CLI",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -30,7 +30,6 @@
|
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"chalk": "^5.6.2",
|
|
32
32
|
"commander": "^14.0.2",
|
|
33
|
-
"execa": "^9.6.1",
|
|
34
33
|
"ink": "^6.6.0",
|
|
35
34
|
"ink-big-text": "^2.0.0",
|
|
36
35
|
"ink-gradient": "^3.0.0",
|
|
@@ -42,6 +41,7 @@
|
|
|
42
41
|
"@types/node": "^24.10.1",
|
|
43
42
|
"@types/react": "^19.2.8",
|
|
44
43
|
"@vitest/ui": "^4.0.17",
|
|
44
|
+
"execa": "^9.6.1",
|
|
45
45
|
"ink-testing-library": "^4.0.0",
|
|
46
46
|
"prettier": "^3.5.3",
|
|
47
47
|
"tsx": "^4.21.0",
|
|
@@ -55,9 +55,9 @@
|
|
|
55
55
|
"build": "tsc",
|
|
56
56
|
"dev": "tsc --watch",
|
|
57
57
|
"ralph": "tsx src/index.ts",
|
|
58
|
-
"test": "vitest
|
|
59
|
-
"test:unit": "
|
|
60
|
-
"test:e2e": "
|
|
58
|
+
"test": "vitest",
|
|
59
|
+
"test:unit": "vitest --exclude test/e2e/**",
|
|
60
|
+
"test:e2e": "vitest --config vitest.e2e.config.ts",
|
|
61
61
|
"test:watch": "vitest --watch",
|
|
62
62
|
"test:ui": "vitest --ui",
|
|
63
63
|
"format": "prettier --write ."
|