pulse-framework-cli 0.4.4 → 0.4.6
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/dist/commands/init.js +53 -22
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -88,8 +88,8 @@ async function ensurePulseMcpInstalled() {
|
|
|
88
88
|
// eslint-disable-next-line no-console
|
|
89
89
|
console.log("\n⚠️ pulse-mcp not found. Attempting to install...\n");
|
|
90
90
|
try {
|
|
91
|
-
//
|
|
92
|
-
(0, node_child_process_1.execSync)("npm
|
|
91
|
+
// Install from npm
|
|
92
|
+
(0, node_child_process_1.execSync)("npm install -g pulse-framework-mcp", {
|
|
93
93
|
encoding: "utf8",
|
|
94
94
|
stdio: "inherit",
|
|
95
95
|
});
|
|
@@ -104,11 +104,9 @@ async function ensurePulseMcpInstalled() {
|
|
|
104
104
|
// eslint-disable-next-line no-console
|
|
105
105
|
console.log(" Please run manually:");
|
|
106
106
|
// eslint-disable-next-line no-console
|
|
107
|
-
console.log(" npm install -g
|
|
107
|
+
console.log(" npm install -g pulse-framework-mcp");
|
|
108
108
|
// eslint-disable-next-line no-console
|
|
109
|
-
console.log("
|
|
110
|
-
// eslint-disable-next-line no-console
|
|
111
|
-
console.log(" npm link -w packages/pulse-mcp\n");
|
|
109
|
+
console.log("");
|
|
112
110
|
throw new Error("pulse-mcp installation failed");
|
|
113
111
|
}
|
|
114
112
|
}
|
|
@@ -200,19 +198,28 @@ function registerInitCommand(program) {
|
|
|
200
198
|
console.log(`ℹ️ Config exists: ${cfgPath}`);
|
|
201
199
|
}
|
|
202
200
|
// ════════════════════════════════════════════════════════════════════════
|
|
203
|
-
// .cursorrules
|
|
201
|
+
// .cursorrules copy (Fallback without MCP)
|
|
204
202
|
// ════════════════════════════════════════════════════════════════════════
|
|
205
203
|
const cursorrulesDst = node_path_1.default.join(repoRoot, ".cursorrules");
|
|
206
204
|
if (!(await fileExists(cursorrulesDst))) {
|
|
207
205
|
const src = node_path_1.default.join(packageRoot(), "templates", ".cursorrules");
|
|
208
|
-
|
|
209
|
-
await
|
|
210
|
-
|
|
211
|
-
|
|
206
|
+
try {
|
|
207
|
+
if (await fileExists(src)) {
|
|
208
|
+
await promises_1.default.copyFile(src, cursorrulesDst);
|
|
209
|
+
// eslint-disable-next-line no-console
|
|
210
|
+
console.log(`✅ .cursorrules created (Fallback rules)`);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
// eslint-disable-next-line no-console
|
|
214
|
+
console.log(`⚠️ .cursorrules template not found: ${src}`);
|
|
215
|
+
}
|
|
212
216
|
}
|
|
213
|
-
|
|
217
|
+
catch (error) {
|
|
218
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
214
219
|
// eslint-disable-next-line no-console
|
|
215
|
-
console.log(
|
|
220
|
+
console.log(`❌ Failed to create .cursorrules: ${errMsg}`);
|
|
221
|
+
// eslint-disable-next-line no-console
|
|
222
|
+
console.log(` 💡 Check write permissions for: ${repoRoot}`);
|
|
216
223
|
}
|
|
217
224
|
}
|
|
218
225
|
else {
|
|
@@ -535,12 +542,13 @@ async function installAgentsMd(repoRoot) {
|
|
|
535
542
|
console.log(`ℹ️ AGENTS.md already exists`);
|
|
536
543
|
return;
|
|
537
544
|
}
|
|
538
|
-
|
|
539
|
-
await
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
545
|
+
try {
|
|
546
|
+
if (await fileExists(agentsSrc)) {
|
|
547
|
+
await promises_1.default.copyFile(agentsSrc, agentsDst);
|
|
548
|
+
}
|
|
549
|
+
else {
|
|
550
|
+
// Fallback: Minimal inline version
|
|
551
|
+
const content = `# AI Agent Instructions
|
|
544
552
|
|
|
545
553
|
> Universal agent configuration for PULSE Framework.
|
|
546
554
|
|
|
@@ -563,8 +571,31 @@ async function installAgentsMd(repoRoot) {
|
|
|
563
571
|
|
|
564
572
|
*Generated by PULSE Framework*
|
|
565
573
|
`;
|
|
566
|
-
|
|
574
|
+
await promises_1.default.writeFile(agentsDst, content, "utf8");
|
|
575
|
+
}
|
|
576
|
+
// eslint-disable-next-line no-console
|
|
577
|
+
console.log(`✅ AGENTS.md created (universal for all AI editors)`);
|
|
578
|
+
}
|
|
579
|
+
catch (error) {
|
|
580
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
581
|
+
// eslint-disable-next-line no-console
|
|
582
|
+
console.log(`❌ Failed to create AGENTS.md: ${errMsg}`);
|
|
583
|
+
// Provide helpful hints based on error type
|
|
584
|
+
if (errMsg.includes("EACCES") || errMsg.includes("permission")) {
|
|
585
|
+
// eslint-disable-next-line no-console
|
|
586
|
+
console.log(` 💡 Permission denied. Try: sudo pulse init --agents`);
|
|
587
|
+
}
|
|
588
|
+
else if (errMsg.includes("ENOENT")) {
|
|
589
|
+
// eslint-disable-next-line no-console
|
|
590
|
+
console.log(` 💡 Directory not found. Make sure you're in your project root.`);
|
|
591
|
+
}
|
|
592
|
+
else if (errMsg.includes("ENOSPC")) {
|
|
593
|
+
// eslint-disable-next-line no-console
|
|
594
|
+
console.log(` 💡 No space left on disk.`);
|
|
595
|
+
}
|
|
596
|
+
else {
|
|
597
|
+
// eslint-disable-next-line no-console
|
|
598
|
+
console.log(` 💡 Check write permissions for: ${repoRoot}`);
|
|
599
|
+
}
|
|
567
600
|
}
|
|
568
|
-
// eslint-disable-next-line no-console
|
|
569
|
-
console.log(`✅ AGENTS.md created (universal for all AI editors)`);
|
|
570
601
|
}
|
package/package.json
CHANGED