@pageai/ralph-loop 1.7.0 → 1.8.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.
@@ -4,22 +4,41 @@
4
4
 
5
5
  This sandbox runs emulated aarch64 Linux. Apply as needed:
6
6
 
7
- - **Node >= 22 (if required):** Install nvm, persist to `/etc/sandbox-persistent.sh` with `unset NPM_CONFIG_PREFIX` before
8
- the nvm source line. Never add bash_completion to that file.
9
-
10
- - **Native binary SIGILL crashes (npm):** `npm install` may produce broken arm64 binaries (esbuild, rollup, tailwindcss oxide, unrs resolver, etc). Fix: `npm pack <pkg>@<same-version>`, extract tarball, copy the binary over the installed one.
11
-
12
- - **If using TanStack Start:** Check that `src/integrations/tanstack-query/root-provider.tsx` has a default export
13
- wrapping children with `QueryClientProvider`. The starter template ships without it, causing a 500 on load.
14
-
15
- - **If using any React-based project:** Install all shadcn/ui components: run npx shadcn@latest add --all in the project root (where components.json exists). Accept all defaults when prompted.
7
+ - **Node >= 22 (if required):** Install nvm, persist to `/etc/sandbox-persistent.sh` with `unset NPM_CONFIG_PREFIX` before the nvm source line. Never add bash_completion to that file.
8
+
9
+ - **Native binary SIGILL crashes (npm):** `npm install` will produce broken arm64 binaries. Follow this exact sequence:
10
+
11
+ 1. Run `npm install --ignore-scripts` (prevents SIGILL during install)
12
+ 2. Fix **all** known native binaries for each package below, run:
13
+ ```
14
+ cd /tmp && npm pack <pkg>@<version> && tar xzf <tarball> && cp package/<binary> <node_modules_path> && rm -rf package
15
+ ```
16
+ Known SIGILL packages (check versions in node_modules):
17
+ - `@esbuild/linux-arm64` → `bin/esbuild`
18
+ - `@rollup/rollup-linux-arm64-gnu` → `rollup.linux-arm64-gnu.node`
19
+ - `@tailwindcss/oxide-linux-arm64-gnu` → `tailwindcss-oxide.linux-arm64-gnu.node`
20
+ - `@unrs/resolver-binding-linux-arm64-gnu` → `resolver.linux-arm64-gnu.node`
21
+ - `lightningcss-linux-arm64-gnu` → `lightningcss.linux-arm64-gnu.node`
22
+ 3. **Verify each binary** before proceeding: `node -e "require('<pkg>')"` (for esbuild, use `node_modules/@esbuild/linux-arm64/bin/esbuild --version` instead since it's a standalone binary, not a requireable module)
23
+ 4. **Scan for corrupted files** — `--ignore-scripts` can produce JS files with null bytes:
24
+ ```
25
+ find node_modules -name '*.js' -size +50k | while read f; do
26
+ if od -c "$f" | grep -q '\\0'; then echo "CORRUPT: $f"; fi
27
+ done
28
+ ```
29
+ Fix: `rm -rf node_modules/<corrupt-pkg> && npm install --ignore-scripts`
30
+ Re-scan until clean. Only then start the dev server.
31
+
32
+ - **If using TanStack Start:** Check that `src/integrations/tanstack-query/root-provider.tsx` has a default export wrapping children with `QueryClientProvider`. The starter template ships without it, causing a 500 on load.
16
33
 
17
34
  ## Main Tasks
18
35
 
19
- Install dependencies, then install Playwright system dependencies: `sudo npx playwright install-deps chromium 2>&1`
36
+ Install dependencies (using the sequence above), then install Playwright system dependencies: `sudo npx playwright install-deps chromium 2>&1`. Allow up to 10 minutes for tasks to complete.
37
+
38
+ Then install the Playwright browser: `npx playwright install chromium`
20
39
 
21
40
  Start the dev server and take a screenshot. Save it to the `.agent/screenshots` directory.
22
41
 
23
42
  ---
24
43
 
25
- After you complete this work, exit with message `Steering complete`.
44
+ After you finish this work, exit with message `Steering complete`.
package/.mcp.json CHANGED
@@ -8,6 +8,7 @@
8
8
  "@playwright/mcp@latest",
9
9
  "--headless",
10
10
  "--no-sandbox",
11
+ "--install",
11
12
  "--executable-path",
12
13
  "/home/agent/.cache/ms-playwright/chromium-1208/chrome-linux/chrome"
13
14
  ],
package/README.md CHANGED
@@ -12,7 +12,7 @@ This is an implementation that actually works, containing a hackable script so y
12
12
  - [2️⃣ Step 2: Create a PRD + task list](#2️⃣-step-2-create-a-prd--task-list)
13
13
  - [3️⃣ Step 3: Set up the agent inside Docker sandbox](#3️⃣-step-3-set-up-the-agent-inside-docker-sandbox)
14
14
  - [4️⃣ Step 4: Run Ralph](#4️⃣-step-4-run-ralph)
15
- - [Run the loop](#run-the-loop)
15
+ - [Running the Ralph Loop with custom options](#running-the-ralph-loop-with-custom-options)
16
16
  - [(Optional) Adjusting to your language/framework](#optional-adjusting-to-your-languageframework)
17
17
  - [How It Works](#how-it-works)
18
18
  - [How Is This Different from Other Ralphs?](#how-is-this-different-from-other-ralphs)
@@ -41,7 +41,7 @@ This is an implementation that actually works, containing a hackable script so y
41
41
  I recommend using a CLI to bootstrap your project with the necessary tools and dependencies, e.g.:
42
42
 
43
43
  ```bash
44
- npx @tanstack/cli create lib --add-ons shadcn,eslint,form,tanstack-query --no-git --no-install
44
+ npx @tanstack/cli create lib --add-ons shadcn,eslint,form,tanstack-query --no-git
45
45
  ```
46
46
 
47
47
  > If you must start from a blank slate, which is not recommended, see [Starting from scratch](#starting-from-scratch). You can also go for a more barebone start by running `npx create-vite@latest src --template react-ts`
@@ -115,7 +115,9 @@ And follow the instructions to log in into Claude Code.
115
115
  ./ralph.sh -n 50 # Run Ralph Loop with 50 iterations
116
116
  ```
117
117
 
118
- ## Run the loop
118
+ > ✍️ Note: the first iteration will be spent on ensuring the sandbox environment is set up correctly. Expect 5 minutes to complete.
119
+
120
+ ## Running the Ralph Loop with custom options
119
121
 
120
122
  ```bash
121
123
  # Run the agent loop (default: 10 iterations)
package/bin/cli.js CHANGED
@@ -152,15 +152,6 @@ async function main() {
152
152
 
153
153
  display.printLocation(TARGET_DIR);
154
154
 
155
- // Initialize git repository if not present
156
- if (!isGitRepo(TARGET_DIR)) {
157
- try {
158
- initGitRepo(TARGET_DIR);
159
- } catch {
160
- // Non-critical — continue setup even if git init fails
161
- }
162
- }
163
-
164
155
  // Copy individual files
165
156
  display.printStep('📄', 'Core files');
166
157
  for (const file of FILES_TO_COPY) {
@@ -344,14 +335,32 @@ async function main() {
344
335
  }
345
336
  }
346
337
 
347
- // Install all shadcn/ui components if project uses shadcn
338
+ // Final setup steps (git init, shadcn install)
348
339
  const appDirPath = path.join(TARGET_DIR, appDir);
349
- if (isShadcnProject(appDirPath)) {
350
- try {
351
- installAllComponents(appDirPath);
352
- } catch {
353
- // Non-critical continue setup even if shadcn install fails
340
+ const needsGit = !isGitRepo(TARGET_DIR);
341
+ const needsShadcn = isShadcnProject(appDirPath);
342
+
343
+ if (needsGit || needsShadcn) {
344
+ const s = clack.spinner();
345
+ s.start('Finishing up...');
346
+
347
+ if (needsGit) {
348
+ try {
349
+ initGitRepo(TARGET_DIR);
350
+ } catch {
351
+ // Non-critical — continue setup even if git init fails
352
+ }
353
+ }
354
+
355
+ if (needsShadcn) {
356
+ try {
357
+ installAllComponents(appDirPath);
358
+ } catch {
359
+ // Non-critical — continue setup even if shadcn install fails
360
+ }
354
361
  }
362
+
363
+ s.stop('Done');
355
364
  }
356
365
 
357
366
  // Success message
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pageai/ralph-loop",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -14,6 +14,7 @@ export default defineConfig({
14
14
  use: {
15
15
  baseURL: 'http://localhost:3000',
16
16
  trace: 'on-first-retry',
17
+ viewport: { width: 1366, height: 768 },
17
18
  },
18
19
 
19
20