pi-rlm 0.1.0 → 0.1.3
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 +56 -1
- package/bin/pi-rlm.mjs +794 -0
- package/index.ts +2 -1
- package/package.json +8 -1
- package/src/backends.ts +473 -19
- package/src/cli.ts +1027 -0
- package/src/engine.ts +87 -17
- package/src/runs.ts +5 -1
- package/src/schema.ts +6 -1
- package/src/types.ts +1 -0
package/README.md
CHANGED
|
@@ -22,6 +22,51 @@ Or as a package:
|
|
|
22
22
|
pi install npm:pi-rlm
|
|
23
23
|
```
|
|
24
24
|
|
|
25
|
+
## CLI Wrapper
|
|
26
|
+
|
|
27
|
+
This package also ships a lightweight CLI wrapper:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
pi-rlm --task "Analyze architecture of this repo" --mode auto --tools-profile read-only
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Or with a positional task:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
pi-rlm "Find top reliability risks in this codebase" --backend sdk --max-depth 3
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
Local shortcut from this repo:
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
npm run cli -- "Find top reliability risks in this codebase" --backend sdk --max-depth 3
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
JSON output:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
pi-rlm "Summarize repo" --mode solve --json
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Live tree visualization (TTY):
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
pi-rlm "Analyze architecture of this repo" --tools-profile read-only --live
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Use current tmux session windows instead of a separate `pi-rlm-<runId>` session:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
pi-rlm "Analyze architecture of this repo" --backend tmux --tmux-current-session
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
Notes:
|
|
64
|
+
- The wrapper runs a **single synchronous** `op=start` operation.
|
|
65
|
+
- It shells out to the installed `pi` CLI and loads this extension automatically.
|
|
66
|
+
- `--live` renders a real-time tree by reading `events.jsonl` while the run executes.
|
|
67
|
+
- CLI source is authored in TypeScript (`src/cli.ts`) and built with `npm run build:cli` (Node + `tsc`, no Bun runtime required).
|
|
68
|
+
- `npm publish` runs `prepack`, so the built CLI (`bin/pi-rlm.mjs`) is included in the published package.
|
|
69
|
+
|
|
25
70
|
## Tool API
|
|
26
71
|
|
|
27
72
|
The extension registers one tool: `rlm`.
|
|
@@ -33,6 +78,7 @@ rlm({
|
|
|
33
78
|
task: "Implement auth refactor and validate tests",
|
|
34
79
|
backend: "sdk", // sdk | cli | tmux
|
|
35
80
|
mode: "auto", // auto | solve | decompose
|
|
81
|
+
tmuxUseCurrentSession: false,
|
|
36
82
|
maxDepth: 2,
|
|
37
83
|
maxNodes: 24,
|
|
38
84
|
maxBranching: 3,
|
|
@@ -79,7 +125,16 @@ rlm({ op: "cancel", id: "a1b2c3d4" })
|
|
|
79
125
|
|
|
80
126
|
### `backend: "tmux"`
|
|
81
127
|
|
|
82
|
-
|
|
128
|
+
Default behavior:
|
|
129
|
+
- Creates one detached tmux session per RLM run (`pi-rlm-<runId>`)
|
|
130
|
+
- Uses depth-oriented windows (`depth-0`, `depth-1`, ...)
|
|
131
|
+
- Starts subcalls in panes within the matching depth window (tiled layout)
|
|
132
|
+
|
|
133
|
+
Optional behavior:
|
|
134
|
+
- Set `tmuxUseCurrentSession: true` (or CLI flag `--tmux-current-session`) to place panes in the current tmux session
|
|
135
|
+
- Uses windows named `rlm-depth-0`, `rlm-depth-1`, ... in that current session
|
|
136
|
+
|
|
137
|
+
General:
|
|
83
138
|
- Uses fresh `pi` process per subcall
|
|
84
139
|
- Useful when you specifically want tmux-level observability/control
|
|
85
140
|
|