@pageai/ralph-loop 1.5.0 → 1.7.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/.agent/STEERING.md +22 -3
- package/.mcp.json +4 -1
- package/README.md +2 -2
- package/bin/cli.js +21 -0
- package/bin/lib/git.js +30 -0
- package/bin/lib/shadcn.js +44 -0
- package/package.json +1 -1
package/.agent/STEERING.md
CHANGED
|
@@ -1,6 +1,25 @@
|
|
|
1
1
|
# **Critical Steering Work**
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Ensure the sandbox is running correctly
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
This sandbox runs emulated aarch64 Linux. Apply as needed:
|
|
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.
|
|
16
|
+
|
|
17
|
+
## Main Tasks
|
|
18
|
+
|
|
19
|
+
Install dependencies, then install Playwright system dependencies: `sudo npx playwright install-deps chromium 2>&1`
|
|
20
|
+
|
|
21
|
+
Start the dev server and take a screenshot. Save it to the `.agent/screenshots` directory.
|
|
22
|
+
|
|
23
|
+
---
|
|
24
|
+
|
|
25
|
+
After you complete this work, exit with message `Steering complete`.
|
package/.mcp.json
CHANGED
package/README.md
CHANGED
|
@@ -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
|
|
44
|
+
npx @tanstack/cli create lib --add-ons shadcn,eslint,form,tanstack-query --no-git --no-install
|
|
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`
|
|
@@ -381,7 +381,7 @@ Check the `ralph.sh` script around `# This is the main command loop.` for the ma
|
|
|
381
381
|
|
|
382
382
|
Replace `docker sandbox run claude . --` with the your favorite CLI. Remember to also update the options after the `--`.
|
|
383
383
|
|
|
384
|
-
```
|
|
384
|
+
```bash
|
|
385
385
|
docker sandbox run codex . # for Codex CLI
|
|
386
386
|
docker sandbox run gemini . # for Gemini CLI
|
|
387
387
|
```
|
package/bin/cli.js
CHANGED
|
@@ -11,6 +11,8 @@ const path = require('path');
|
|
|
11
11
|
const { execSync } = require('child_process');
|
|
12
12
|
const display = require('./lib/display');
|
|
13
13
|
const { copyFile, copyDir, mergeDir, exists, ensureDir } = require('./lib/copy');
|
|
14
|
+
const { isGitRepo, initGitRepo } = require('./lib/git');
|
|
15
|
+
const { isShadcnProject, installAllComponents } = require('./lib/shadcn');
|
|
14
16
|
|
|
15
17
|
const PACKAGE_ROOT = path.resolve(__dirname, '..');
|
|
16
18
|
const TARGET_DIR = process.cwd();
|
|
@@ -150,6 +152,15 @@ async function main() {
|
|
|
150
152
|
|
|
151
153
|
display.printLocation(TARGET_DIR);
|
|
152
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
|
+
|
|
153
164
|
// Copy individual files
|
|
154
165
|
display.printStep('📄', 'Core files');
|
|
155
166
|
for (const file of FILES_TO_COPY) {
|
|
@@ -333,6 +344,16 @@ async function main() {
|
|
|
333
344
|
}
|
|
334
345
|
}
|
|
335
346
|
|
|
347
|
+
// Install all shadcn/ui components if project uses shadcn
|
|
348
|
+
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
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
|
|
336
357
|
// Success message
|
|
337
358
|
display.showComplete();
|
|
338
359
|
clack.outro('Happy looping!');
|
package/bin/lib/git.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Git module for Ralph Loop CLI
|
|
3
|
+
* Handles git repository initialization in the target directory
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const path = require('path');
|
|
7
|
+
const { execSync } = require('child_process');
|
|
8
|
+
const { exists } = require('./copy');
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Checks if a directory is inside a git repository
|
|
12
|
+
* @param {string} dir - Directory path to check
|
|
13
|
+
* @returns {boolean}
|
|
14
|
+
*/
|
|
15
|
+
function isGitRepo(dir) {
|
|
16
|
+
return exists(path.join(dir, '.git'));
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Initializes a new git repository in the given directory
|
|
21
|
+
* @param {string} dir - Directory path to initialize
|
|
22
|
+
*/
|
|
23
|
+
function initGitRepo(dir) {
|
|
24
|
+
execSync('git init', { cwd: dir, stdio: 'pipe' });
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
module.exports = {
|
|
28
|
+
isGitRepo,
|
|
29
|
+
initGitRepo,
|
|
30
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* shadcn/ui module for Ralph Loop CLI
|
|
3
|
+
* Detects shadcn config and installs all components
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
const fs = require('fs');
|
|
7
|
+
const path = require('path');
|
|
8
|
+
const { execSync } = require('child_process');
|
|
9
|
+
const { exists } = require('./copy');
|
|
10
|
+
|
|
11
|
+
const SHADCN_SCHEMA = 'https://ui.shadcn.com/schema.json';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Checks if a directory has a shadcn components.json with the expected schema
|
|
15
|
+
* @param {string} dir - Directory path to check
|
|
16
|
+
* @returns {boolean}
|
|
17
|
+
*/
|
|
18
|
+
function isShadcnProject(dir) {
|
|
19
|
+
const configPath = path.join(dir, 'components.json');
|
|
20
|
+
if (!exists(configPath)) return false;
|
|
21
|
+
|
|
22
|
+
try {
|
|
23
|
+
const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
|
|
24
|
+
return config.$schema === SHADCN_SCHEMA;
|
|
25
|
+
} catch {
|
|
26
|
+
return false;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Installs all shadcn/ui components in the given directory
|
|
32
|
+
* @param {string} dir - Directory path to run the install in
|
|
33
|
+
*/
|
|
34
|
+
function installAllComponents(dir) {
|
|
35
|
+
execSync('npx shadcn@latest add --all --yes 2>&1', {
|
|
36
|
+
cwd: dir,
|
|
37
|
+
stdio: 'pipe',
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
module.exports = {
|
|
42
|
+
isShadcnProject,
|
|
43
|
+
installAllComponents,
|
|
44
|
+
};
|