@juicesharp/rpiv-pi 0.4.0 → 0.4.2

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 CHANGED
@@ -3,12 +3,12 @@
3
3
  [![npm version](https://img.shields.io/npm/v/@juicesharp/rpiv-pi.svg)](https://www.npmjs.com/package/@juicesharp/rpiv-pi)
4
4
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
5
 
6
- Skill-based development workflow for [Pi](https://github.com/badlogic/pi-mono) — research, design, plan, implement, validate. rpiv-pi extends the Pi coding agent with a pipeline of chained AI skills, named subagents for parallel analysis, and session lifecycle hooks for automatic context injection.
6
+ Skill-based development workflow for [Pi Agent](https://github.com/badlogic/pi-mono) — discover, research, design, plan, implement, and validate. rpiv-pi extends Pi Agent with a pipeline of chained AI skills, named subagents for parallel analysis, and session lifecycle hooks for automatic context injection.
7
7
 
8
8
  ## Prerequisites
9
9
 
10
- - **[Pi CLI](https://github.com/badlogic/pi-mono)** — the `pi` command must be available
11
- - **Node.js** — required by Pi
10
+ - **[Pi Agent](https://github.com/badlogic/pi-mono)** — the `pi` command must be available
11
+ - **Node.js** — required by Pi Agent
12
12
  - **git** *(recommended)* — rpiv-pi works without it, but branch and commit context won't be available to skills
13
13
 
14
14
  ## Quick Start
@@ -19,15 +19,47 @@ Skill-based development workflow for [Pi](https://github.com/badlogic/pi-mono)
19
19
  pi install npm:@juicesharp/rpiv-pi
20
20
  ```
21
21
 
22
- 2. Start a Pi session and install sibling plugins:
22
+ 2. Configure a model provider (pick one):
23
+
24
+ - **Subscription login** — start Pi Agent and run `/login` to authenticate with Anthropic Claude Pro/Max, ChatGPT Plus/Pro, GitHub Copilot, or Gemini.
25
+ - **BYOK (API key)** — edit `~/.pi/agent/models.json` and add a provider entry with `baseUrl`, `api`, `apiKey`, and `models[]`. Example (z.ai GLM coding plan):
26
+
27
+ ```json
28
+ {
29
+ "providers": {
30
+ "zai": {
31
+ "baseUrl": "https://api.z.ai/api/coding/paas/v4",
32
+ "api": "openai-completions",
33
+ "apiKey": "XXXXXXXXX",
34
+ "compat": {
35
+ "supportsDeveloperRole": false,
36
+ "thinkingFormat": "zai"
37
+ },
38
+ "models": [
39
+ {
40
+ "id": "glm-5.1",
41
+ "name": "glm-5.1 [coding plan]",
42
+ "reasoning": true,
43
+ "input": ["text"],
44
+ "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
45
+ "contextWindow": 204800,
46
+ "maxTokens": 131072
47
+ }
48
+ ]
49
+ }
50
+ }
51
+ }
52
+ ```
53
+
54
+ 3. Start a Pi Agent session and install sibling plugins:
23
55
 
24
56
  ```
25
57
  /rpiv-setup
26
58
  ```
27
59
 
28
- 3. Restart your Pi session.
60
+ 4. Restart your Pi Agent session.
29
61
 
30
- 4. *(Optional)* Configure web search:
62
+ 5. *(Optional)* Configure web search:
31
63
 
32
64
  ```
33
65
  /web-search-config
@@ -35,7 +67,7 @@ pi install npm:@juicesharp/rpiv-pi
35
67
 
36
68
  ### First Session
37
69
 
38
- On first session start, rpiv-pi automatically:
70
+ On first Pi Agent session start, rpiv-pi automatically:
39
71
  - Copies agent profiles to `<cwd>/.pi/agents/`
40
72
  - Detects outdated or removed agents on subsequent starts
41
73
  - Scaffolds `thoughts/shared/` directories for pipeline artifacts
@@ -57,7 +89,7 @@ Each skill produces an artifact consumed by the next. Run them in order, or jump
57
89
 
58
90
  ### Skills
59
91
 
60
- Invoke via `/skill:<name>` from inside a Pi session.
92
+ Invoke via `/skill:<name>` from inside a Pi Agent session.
61
93
 
62
94
  #### Research & Design
63
95
 
@@ -137,7 +169,7 @@ rpiv-pi/
137
169
  └── thoughts/shared/ — pipeline artifact store
138
170
  ```
139
171
 
140
- Pi discovers extensions via `"extensions": ["./extensions"]` and skills via `"skills": ["./skills"]` in `package.json`.
172
+ Pi Agent discovers extensions via `"extensions": ["./extensions"]` and skills via `"skills": ["./skills"]` in `package.json`.
141
173
 
142
174
  ## Configuration
143
175
 
@@ -146,22 +178,6 @@ Pi discovers extensions via `"extensions": ["./extensions"]` and skills via `"sk
146
178
  - **Agent concurrency** — `@tintinweb/pi-subagents` defaults to 4 concurrent agents; raise via `/agents → Settings → Max concurrency → 48` if skills stall on wide fan-outs
147
179
  - **Agent profiles** — editable at `<cwd>/.pi/agents/`; sync from bundled defaults with `/rpiv-update-agents` (overwrites rpiv-managed files, preserves your custom agents)
148
180
 
149
- ## Upgrading from 0.3.x
150
-
151
- Tool logic was extracted into sibling plugins in 0.4.0. After upgrading:
152
-
153
- 1. `pi install npm:@juicesharp/rpiv-pi`
154
- 2. Start a Pi session.
155
- 3. Run `/rpiv-setup` to install the four extracted plugins:
156
- - `@juicesharp/rpiv-ask-user-question`
157
- - `@juicesharp/rpiv-todo`
158
- - `@juicesharp/rpiv-advisor`
159
- - `@juicesharp/rpiv-web-tools`
160
- 4. Restart the session.
161
- 5. Re-run `/advisor` and `/web-search-config` — saved configuration at `~/.config/rpiv-pi/` is no longer read; each plugin now reads from its own config path.
162
-
163
- The `BRAVE_SEARCH_API_KEY` environment variable continues to work unchanged.
164
-
165
181
  ## Troubleshooting
166
182
 
167
183
  | Symptom | Cause | Fix |
@@ -25,6 +25,7 @@ import {
25
25
  takeGitContextIfChanged,
26
26
  } from "./git-context.js";
27
27
  import { syncBundledAgents } from "./agents.js";
28
+ import { spawnPiInstall } from "./pi-installer.js";
28
29
  import {
29
30
  hasPiSubagentsInstalled,
30
31
  hasRpivAskUserQuestionInstalled,
@@ -238,7 +239,7 @@ export default function (pi: ExtensionAPI) {
238
239
  for (const { pkg } of missing) {
239
240
  ctx.ui.notify(`Installing ${pkg}…`, "info");
240
241
  try {
241
- const result = await pi.exec("pi", ["install", pkg], { timeout: 120_000 });
242
+ const result = await spawnPiInstall(pkg, 120_000);
242
243
  if (result.code === 0) {
243
244
  succeeded.push(pkg);
244
245
  } else {
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Windows-safe wrapper around `pi install <pkg>`.
3
+ *
4
+ * Pi's own `pi.exec` calls `child_process.spawn(cmd, args, { shell: false })`,
5
+ * which cannot launch `.cmd`/`.bat` shims on Windows — npm installs `pi` as
6
+ * `pi.cmd`, so on Windows the spawn ENOENTs silently and the caller sees only
7
+ * `exit 1`. We side-step it here by invoking via `cmd.exe /c` on Windows.
8
+ */
9
+
10
+ import { spawn } from "node:child_process";
11
+
12
+ export interface PiInstallResult {
13
+ code: number;
14
+ stdout: string;
15
+ stderr: string;
16
+ }
17
+
18
+ export function spawnPiInstall(pkg: string, timeoutMs: number): Promise<PiInstallResult> {
19
+ return new Promise((resolve) => {
20
+ const isWindows = process.platform === "win32";
21
+ const [cmd, args, spawnOpts] = isWindows
22
+ ? (["cmd.exe", ["/c", "pi", "install", pkg], { windowsHide: true }] as const)
23
+ : (["pi", ["install", pkg], {}] as const);
24
+
25
+ let settled = false;
26
+ let stdout = "";
27
+ let stderr = "";
28
+
29
+ const proc = spawn(cmd, args, { ...spawnOpts, stdio: ["ignore", "pipe", "pipe"] });
30
+ proc.stdout?.on("data", (d) => (stdout += d.toString()));
31
+ proc.stderr?.on("data", (d) => (stderr += d.toString()));
32
+
33
+ const settle = (result: PiInstallResult) => {
34
+ if (settled) return;
35
+ settled = true;
36
+ clearTimeout(timer);
37
+ resolve(result);
38
+ };
39
+
40
+ const timer = setTimeout(() => {
41
+ proc.kill("SIGTERM");
42
+ setTimeout(() => {
43
+ if (!proc.killed) proc.kill("SIGKILL");
44
+ }, 5000);
45
+ settle({ code: 124, stdout, stderr: stderr + `\n[timed out after ${timeoutMs}ms]` });
46
+ }, timeoutMs);
47
+
48
+ proc.on("error", (err) => {
49
+ settle({ code: 1, stdout, stderr: stderr + (stderr ? "\n" : "") + err.message });
50
+ });
51
+ proc.on("close", (code) => {
52
+ settle({ code: code ?? 1, stdout, stderr });
53
+ });
54
+ });
55
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@juicesharp/rpiv-pi",
3
- "version": "0.4.0",
4
- "description": "Skill-based development workflow for Pi — research, design, plan, implement, review",
3
+ "version": "0.4.2",
4
+ "description": "Skill-based development workflow for Pi Agent discover, research, design, plan, implement, validate",
5
5
  "keywords": ["pi-package", "pi-extension", "rpiv", "skills", "workflow"],
6
6
  "license": "MIT",
7
7
  "author": "juicesharp",