@stfade/pi-read-delegator 1.0.7 → 1.0.9

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 (2) hide show
  1. package/package.json +1 -1
  2. package/reader-manager.js +7 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stfade/pi-read-delegator",
3
- "version": "1.0.7",
3
+ "version": "1.0.9",
4
4
  "description": "Pi extension that delegates all read operations to a Reader subagent, blocking read tools from the main model",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
package/reader-manager.js CHANGED
@@ -100,29 +100,20 @@ async function checkDependencies(prompt) {
100
100
  return false;
101
101
  }
102
102
  // Attempt installation
103
- console.log("[pi-read-delegator] 📦 Installing pi-subagents…");
103
+ const piNpmDir = path.join(os.homedir(), ".pi", "agent", "npm");
104
+ console.log("[pi-read-delegator] 📦 Installing pi-subagents to " + piNpmDir + "…");
104
105
  try {
105
- (0, child_process_1.execSync)("pi install pi-subagents", {
106
+ (0, child_process_1.execSync)(`npm install --prefix "${piNpmDir}" pi-subagents`, {
106
107
  stdio: "pipe",
107
108
  timeout: 60_000,
108
109
  encoding: "utf-8",
109
110
  });
110
- console.log("[pi-read-delegator] ✅ pi-subagents installed via pi.");
111
+ console.log("[pi-read-delegator] ✅ pi-subagents installed via npm.");
111
112
  }
112
113
  catch (firstErr) {
113
- // Fallback to global npm install
114
- try {
115
- (0, child_process_1.execSync)("npm install -g pi-subagents", {
116
- stdio: "pipe",
117
- timeout: 60_000,
118
- encoding: "utf-8",
119
- });
120
- console.log("[pi-read-delegator] ✅ pi-subagents installed via npm.");
121
- }
122
- catch (secondErr) {
123
- console.error("[pi-read-delegator] ❌ Cannot proceed without pi-subagents. Extension disabled.");
124
- return false;
125
- }
114
+ console.error("[pi-read-delegator] ⚠️ npm install failed:", firstErr instanceof Error ? firstErr.message : String(firstErr));
115
+ console.error("[pi-read-delegator] ❌ Cannot proceed without pi-subagents. Extension disabled.");
116
+ return false;
126
117
  }
127
118
  // Verify installation took effect
128
119
  try {