pulse-framework-cli 0.4.4 → 0.4.5
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 +49 -16
- package/package.json +1 -1
package/dist/commands/init.js
CHANGED
|
@@ -200,19 +200,28 @@ function registerInitCommand(program) {
|
|
|
200
200
|
console.log(`ℹ️ Config exists: ${cfgPath}`);
|
|
201
201
|
}
|
|
202
202
|
// ════════════════════════════════════════════════════════════════════════
|
|
203
|
-
// .cursorrules
|
|
203
|
+
// .cursorrules copy (Fallback without MCP)
|
|
204
204
|
// ════════════════════════════════════════════════════════════════════════
|
|
205
205
|
const cursorrulesDst = node_path_1.default.join(repoRoot, ".cursorrules");
|
|
206
206
|
if (!(await fileExists(cursorrulesDst))) {
|
|
207
207
|
const src = node_path_1.default.join(packageRoot(), "templates", ".cursorrules");
|
|
208
|
-
|
|
209
|
-
await
|
|
210
|
-
|
|
211
|
-
|
|
208
|
+
try {
|
|
209
|
+
if (await fileExists(src)) {
|
|
210
|
+
await promises_1.default.copyFile(src, cursorrulesDst);
|
|
211
|
+
// eslint-disable-next-line no-console
|
|
212
|
+
console.log(`✅ .cursorrules created (Fallback rules)`);
|
|
213
|
+
}
|
|
214
|
+
else {
|
|
215
|
+
// eslint-disable-next-line no-console
|
|
216
|
+
console.log(`⚠️ .cursorrules template not found: ${src}`);
|
|
217
|
+
}
|
|
212
218
|
}
|
|
213
|
-
|
|
219
|
+
catch (error) {
|
|
220
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
221
|
+
// eslint-disable-next-line no-console
|
|
222
|
+
console.log(`❌ Failed to create .cursorrules: ${errMsg}`);
|
|
214
223
|
// eslint-disable-next-line no-console
|
|
215
|
-
console.log(
|
|
224
|
+
console.log(` 💡 Check write permissions for: ${repoRoot}`);
|
|
216
225
|
}
|
|
217
226
|
}
|
|
218
227
|
else {
|
|
@@ -535,12 +544,13 @@ async function installAgentsMd(repoRoot) {
|
|
|
535
544
|
console.log(`ℹ️ AGENTS.md already exists`);
|
|
536
545
|
return;
|
|
537
546
|
}
|
|
538
|
-
|
|
539
|
-
await
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
547
|
+
try {
|
|
548
|
+
if (await fileExists(agentsSrc)) {
|
|
549
|
+
await promises_1.default.copyFile(agentsSrc, agentsDst);
|
|
550
|
+
}
|
|
551
|
+
else {
|
|
552
|
+
// Fallback: Minimal inline version
|
|
553
|
+
const content = `# AI Agent Instructions
|
|
544
554
|
|
|
545
555
|
> Universal agent configuration for PULSE Framework.
|
|
546
556
|
|
|
@@ -563,8 +573,31 @@ async function installAgentsMd(repoRoot) {
|
|
|
563
573
|
|
|
564
574
|
*Generated by PULSE Framework*
|
|
565
575
|
`;
|
|
566
|
-
|
|
576
|
+
await promises_1.default.writeFile(agentsDst, content, "utf8");
|
|
577
|
+
}
|
|
578
|
+
// eslint-disable-next-line no-console
|
|
579
|
+
console.log(`✅ AGENTS.md created (universal for all AI editors)`);
|
|
580
|
+
}
|
|
581
|
+
catch (error) {
|
|
582
|
+
const errMsg = error instanceof Error ? error.message : String(error);
|
|
583
|
+
// eslint-disable-next-line no-console
|
|
584
|
+
console.log(`❌ Failed to create AGENTS.md: ${errMsg}`);
|
|
585
|
+
// Provide helpful hints based on error type
|
|
586
|
+
if (errMsg.includes("EACCES") || errMsg.includes("permission")) {
|
|
587
|
+
// eslint-disable-next-line no-console
|
|
588
|
+
console.log(` 💡 Permission denied. Try: sudo pulse init --agents`);
|
|
589
|
+
}
|
|
590
|
+
else if (errMsg.includes("ENOENT")) {
|
|
591
|
+
// eslint-disable-next-line no-console
|
|
592
|
+
console.log(` 💡 Directory not found. Make sure you're in your project root.`);
|
|
593
|
+
}
|
|
594
|
+
else if (errMsg.includes("ENOSPC")) {
|
|
595
|
+
// eslint-disable-next-line no-console
|
|
596
|
+
console.log(` 💡 No space left on disk.`);
|
|
597
|
+
}
|
|
598
|
+
else {
|
|
599
|
+
// eslint-disable-next-line no-console
|
|
600
|
+
console.log(` 💡 Check write permissions for: ${repoRoot}`);
|
|
601
|
+
}
|
|
567
602
|
}
|
|
568
|
-
// eslint-disable-next-line no-console
|
|
569
|
-
console.log(`✅ AGENTS.md created (universal for all AI editors)`);
|
|
570
603
|
}
|
package/package.json
CHANGED