openralph 1.0.12 → 1.0.13

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.
Files changed (3) hide show
  1. package/README.md +13 -2
  2. package/bin/ralph +27 -9
  3. package/package.json +6 -6
package/README.md CHANGED
@@ -97,15 +97,23 @@ ralph init --from plan.md # convert unstructured plan to PRD JSON
97
97
  ### Init Subcommand
98
98
 
99
99
  ```bash
100
- ralph init # create template PRD and prompt
100
+ ralph init # create template PRD, prompt, plugin, and AGENTS.md
101
101
  ralph init --from plan.md # convert markdown plan to PRD JSON
102
102
  ralph init --force # overwrite existing files
103
103
  ```
104
104
 
105
+ The `init` command creates:
106
+ - `prd.json` - PRD plan file (wrapped format with metadata)
107
+ - `progress.txt` - Progress log
108
+ - `.ralph-prompt.md` - Prompt template
109
+ - `.opencode/plugin/ralph-write-guardrail.ts` - Write guardrail plugin
110
+ - `AGENTS.md` - Project configuration for AI agents (never overwritten)
111
+ - `.gitignore` entries - Adds Ralph runtime files to .gitignore
112
+
105
113
  | Option | Description |
106
114
  |--------|-------------|
107
115
  | `--from` | Source plan or notes to convert into PRD JSON |
108
- | `--force` | Overwrite existing files |
116
+ | `--force` | Overwrite existing files (except AGENTS.md) |
109
117
 
110
118
  **Default prompt:**
111
119
  ```
@@ -150,6 +158,8 @@ Ralph supports multiple adapters for running the AI agent:
150
158
  | `.ralph-lock` | Prevents multiple instances |
151
159
  | `.ralph-done` | Agent creates this when all tasks complete |
152
160
  | `.ralph-pause` | Created by `p` key to pause loop |
161
+ | `.opencode/plugin/ralph-write-guardrail.ts` | Protects files from AI modification |
162
+ | `AGENTS.md` | Project configuration for AI agents |
153
163
 
154
164
  **Generated file markers:** Files created by `ralph init` include markers so `ralph --reset` can identify and remove them safely without touching user-created files:
155
165
  - `prd.json`: Wrapped with `{ metadata: { generated: true, ... }, items: [...] }`
@@ -243,6 +253,7 @@ Ralph writes operational learnings here. Future iterations read it.
243
253
  | `:` | Steering mode (send message to agent) |
244
254
  | `t` | Launch terminal with attach command |
245
255
  | `Shift+T` | Toggle tasks panel |
256
+ | `Shift+C` | Toggle completed tasks / Copy attach command |
246
257
  | `o` | Toggle Details/Output view |
247
258
  | `d` | Toggle progress dashboard |
248
259
  | `?` | Show help overlay |
package/bin/ralph CHANGED
@@ -8,6 +8,7 @@ import { fileURLToPath } from "node:url";
8
8
 
9
9
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
10
10
  const require = createRequire(import.meta.url);
11
+ const projectRoot = path.resolve(__dirname, "..");
11
12
 
12
13
  const platformMap = {
13
14
  darwin: "darwin",
@@ -26,18 +27,35 @@ const packageName = `openralph-${platform}-${arch}`;
26
27
  const binaryName = platform === "windows" ? "ralph.exe" : "ralph";
27
28
 
28
29
  let binaryPath;
29
- try {
30
- const packageJsonPath = require.resolve(`${packageName}/package.json`);
31
- const packageDir = path.dirname(packageJsonPath);
32
- binaryPath = path.join(packageDir, "bin", binaryName);
33
- } catch (error) {
34
- const message = error instanceof Error ? error.message : String(error);
35
- console.error(`Failed to resolve ${packageName}: ${message}`);
36
- process.exit(1);
30
+
31
+ // First, check for locally built binary in dist/ directory
32
+ const localBinaryPath = path.join(projectRoot, "dist", packageName, "bin", binaryName);
33
+ if (fs.existsSync(localBinaryPath)) {
34
+ binaryPath = localBinaryPath;
35
+ } else {
36
+ // Fall back to npm package resolution for installed packages
37
+ try {
38
+ const packageJsonPath = require.resolve(`${packageName}/package.json`);
39
+ const packageDir = path.dirname(packageJsonPath);
40
+ binaryPath = path.join(packageDir, "bin", binaryName);
41
+ } catch (error) {
42
+ // No local build and no npm package found
43
+ console.error(`Error: No ralph binary found for ${platform}-${arch}.`);
44
+ console.error("");
45
+ console.error("To fix this, run:");
46
+ console.error(" bun run build:single # Build for current platform");
47
+ console.error("");
48
+ console.error("Or install globally:");
49
+ console.error(" bun install -g openralph");
50
+ process.exit(1);
51
+ }
37
52
  }
38
53
 
39
54
  if (!fs.existsSync(binaryPath)) {
40
- console.error(`Binary not found at ${binaryPath}`);
55
+ console.error(`Error: Binary not found at ${binaryPath}`);
56
+ console.error("");
57
+ console.error("To fix this, run:");
58
+ console.error(" bun run build:single # Rebuild for current platform");
41
59
  process.exit(1);
42
60
  }
43
61
 
package/package.json CHANGED
@@ -1,16 +1,16 @@
1
1
  {
2
2
  "name": "openralph",
3
- "version": "1.0.12",
3
+ "version": "1.0.13",
4
4
  "description": "Ralph Driven Development using OpenCode SDK and OpenTUI",
5
5
  "bin": {
6
6
  "ralph": "./bin/ralph"
7
7
  },
8
8
  "optionalDependencies": {
9
- "openralph-darwin-arm64": "1.0.12",
10
- "openralph-darwin-x64": "1.0.12",
11
- "openralph-linux-arm64": "1.0.12",
12
- "openralph-linux-x64": "1.0.12",
13
- "openralph-windows-x64": "1.0.12"
9
+ "openralph-darwin-arm64": "1.0.13",
10
+ "openralph-darwin-x64": "1.0.13",
11
+ "openralph-linux-arm64": "1.0.13",
12
+ "openralph-linux-x64": "1.0.13",
13
+ "openralph-windows-x64": "1.0.13"
14
14
  },
15
15
  "repository": {
16
16
  "type": "git",