pulse-framework-cli 0.4.13 → 0.4.15
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 +60 -2
- package/package.json +1 -1
- package/templates/AGENTS.md +13 -2
- package/templates/cursor/pulse.mdc +20 -171
package/dist/commands/init.js
CHANGED
|
@@ -1,4 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
2
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
37
|
};
|
|
@@ -145,9 +178,34 @@ function registerInitCommand(program) {
|
|
|
145
178
|
.option("--no-interactive", "No interactive prompts")
|
|
146
179
|
.action(async (opts) => {
|
|
147
180
|
const start = node_path_1.default.resolve(opts.path ?? process.cwd());
|
|
148
|
-
|
|
181
|
+
let repoRoot = await (0, paths_js_1.findRepoRoot)(start);
|
|
149
182
|
if (!repoRoot) {
|
|
150
|
-
|
|
183
|
+
// Not a git repo - offer to initialize
|
|
184
|
+
console.log("⚠️ Not a git repository.\n");
|
|
185
|
+
console.log("Pulse uses Git for checkpoints, commits, and safeguards.\n");
|
|
186
|
+
console.log("💡 Tip: If you have multiple projects in subfolders,");
|
|
187
|
+
console.log(" open the specific project folder, not the parent.\n");
|
|
188
|
+
console.log(" Example: Open /projects/myapp (with .git inside)");
|
|
189
|
+
console.log(" Not: Open /projects (containing multiple repos)\n");
|
|
190
|
+
const shouldInitGit = opts.interactive !== false
|
|
191
|
+
? await (0, input_js_1.promptConfirm)("Initialize Git repository now?", true)
|
|
192
|
+
: true; // Auto-init in non-interactive mode
|
|
193
|
+
if (shouldInitGit) {
|
|
194
|
+
const { execSync } = await Promise.resolve().then(() => __importStar(require("child_process")));
|
|
195
|
+
try {
|
|
196
|
+
execSync("git init", { cwd: start, stdio: "inherit" });
|
|
197
|
+
console.log("✅ Git repository initialized\n");
|
|
198
|
+
repoRoot = start;
|
|
199
|
+
}
|
|
200
|
+
catch {
|
|
201
|
+
console.log("❌ Failed to initialize Git. Continuing without Git...\n");
|
|
202
|
+
repoRoot = start; // Use start as fallback
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
else {
|
|
206
|
+
console.log("⚠️ Continuing without Git (limited functionality)\n");
|
|
207
|
+
repoRoot = start;
|
|
208
|
+
}
|
|
151
209
|
}
|
|
152
210
|
// eslint-disable-next-line no-console
|
|
153
211
|
console.log("\n🎯 PULSE Init\n");
|
package/package.json
CHANGED
package/templates/AGENTS.md
CHANGED
|
@@ -73,9 +73,20 @@ Patterns to avoid in code:
|
|
|
73
73
|
|
|
74
74
|
---
|
|
75
75
|
|
|
76
|
-
##
|
|
76
|
+
## MCP Tools (Cursor Agent Mode)
|
|
77
77
|
|
|
78
|
-
|
|
78
|
+
**CRITICAL: Call these MCP tools automatically!**
|
|
79
|
+
|
|
80
|
+
| Trigger | MCP Tool |
|
|
81
|
+
|---------|----------|
|
|
82
|
+
| **EVERY message** | `pulse_status` |
|
|
83
|
+
| After code edits | `pulse_doctor` |
|
|
84
|
+
| Every 10 min | `pulse_checkpoint` |
|
|
85
|
+
| "wrong"/"stop" | `pulse_correct` |
|
|
86
|
+
| 2-3 failures | `pulse_escalate` |
|
|
87
|
+
| Task done | `pulse_review` |
|
|
88
|
+
|
|
89
|
+
## CLI Commands (Terminal)
|
|
79
90
|
|
|
80
91
|
| Command | When to Use |
|
|
81
92
|
|---------|-------------|
|
|
@@ -1,189 +1,38 @@
|
|
|
1
1
|
---
|
|
2
|
-
description: PULSE Framework -
|
|
2
|
+
description: PULSE Framework - Call pulse_status on EVERY message
|
|
3
3
|
globs: *
|
|
4
4
|
alwaysApply: true
|
|
5
5
|
---
|
|
6
6
|
|
|
7
|
-
#
|
|
8
|
-
# █ █
|
|
9
|
-
# █ 🛑 STOP! READ THIS BEFORE DOING ANYTHING! 🛑 █
|
|
10
|
-
# █ █
|
|
11
|
-
# █ Call pulse_status IMMEDIATELY █
|
|
12
|
-
# █ → This is your FIRST action, EVERY time █
|
|
13
|
-
# █ → No exceptions. No skipping. █
|
|
14
|
-
# █ █
|
|
15
|
-
# █ NOTE: MCP tools only work in Agent Mode. █
|
|
16
|
-
# █ If you're in Plan/Ask, tools are unavailable. █
|
|
17
|
-
# █ █
|
|
18
|
-
# ████████████████████████████████████████████████████
|
|
7
|
+
# 🛑 PULSE: Call MCP tools!
|
|
19
8
|
|
|
20
|
-
##
|
|
9
|
+
## EVERY MESSAGE → pulse_status FIRST
|
|
21
10
|
|
|
22
11
|
```
|
|
23
12
|
CallMcpTool: pulse_status
|
|
24
|
-
Arguments: { "userMessage": "<
|
|
13
|
+
Arguments: { "userMessage": "<user message>" }
|
|
25
14
|
```
|
|
26
15
|
|
|
27
|
-
|
|
16
|
+
## AFTER CODE CHANGES → pulse_doctor
|
|
28
17
|
|
|
29
|
-
|
|
30
|
-
- ✅ Message #1
|
|
31
|
-
- ✅ Message #2
|
|
32
|
-
- ✅ Message #3
|
|
33
|
-
- ✅ Message #50
|
|
34
|
-
- ✅ Message #100
|
|
35
|
-
- ✅ EVERY SINGLE MESSAGE
|
|
18
|
+
## EVERY 10 MIN → pulse_checkpoint
|
|
36
19
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
## 2️⃣ NEW TASK DETECTED → `pulse_run`
|
|
48
|
-
```
|
|
49
|
-
IF user says: "new", "implement", "create", "build", "add feature", "start"
|
|
50
|
-
THEN: IMMEDIATELY call pulse_run({ action: "<what user wants>" })
|
|
51
|
-
DO NOT ask for confirmation. Just do it.
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
## 3️⃣ CODE CHANGED → `pulse_doctor`
|
|
55
|
-
```
|
|
56
|
-
IF you just edited/created/deleted any file
|
|
57
|
-
THEN: IMMEDIATELY call pulse_doctor()
|
|
58
|
-
DO NOT skip this. Every code change needs a doctor check.
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
## 4️⃣ >10 MIN SINCE CHECKPOINT → `pulse_checkpoint`
|
|
62
|
-
```
|
|
63
|
-
IF pulse_status shows >10 min since checkpoint
|
|
64
|
-
THEN: IMMEDIATELY call pulse_checkpoint({ summary: "<what you did>" })
|
|
65
|
-
DO NOT ask. Just checkpoint. Code safety > asking permission.
|
|
66
|
-
```
|
|
67
|
-
|
|
68
|
-
## 5️⃣ TASK DONE → `pulse_review`
|
|
69
|
-
```
|
|
70
|
-
IF you're about to say "done", "finished", "complete", "ready for PR"
|
|
71
|
-
THEN: FIRST call pulse_review()
|
|
72
|
-
DO NOT claim done without review. Ever.
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## 6️⃣ USER SAYS "WRONG" → `pulse_correct`
|
|
76
|
-
```
|
|
77
|
-
IF user says: "wrong", "no", "stop", "not what I meant", "undo"
|
|
78
|
-
THEN: IMMEDIATELY call pulse_correct({ feedback: "<what's wrong>" })
|
|
79
|
-
DO NOT defend your work. Correct it.
|
|
80
|
-
```
|
|
81
|
-
|
|
82
|
-
## 7️⃣ 2-3 FAILURES → `pulse_escalate`
|
|
83
|
-
```
|
|
84
|
-
IF same error occurs 2-3 times OR you don't understand the error
|
|
85
|
-
THEN: IMMEDIATELY call pulse_escalate({ problem: "...", tried: "..." })
|
|
86
|
-
DO NOT try a 4th time. Escalate.
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
## 8️⃣ PROBLEM SOLVED → `pulse_learn`
|
|
90
|
-
```
|
|
91
|
-
IF you just fixed a bug, resolved an escalation, or solved a tricky problem
|
|
92
|
-
THEN: call pulse_learn({ problem: "...", solution: "...", rule: "..." })
|
|
93
|
-
This builds knowledge for future sessions.
|
|
94
|
-
```
|
|
95
|
-
|
|
96
|
-
## 9️⃣ CRITICAL FINDINGS → STOP
|
|
97
|
-
```
|
|
98
|
-
IF pulse_status or pulse_doctor shows CRITICAL
|
|
99
|
-
THEN: STOP IMMEDIATELY. Do NOT continue with user's request.
|
|
100
|
-
Fix the critical issue first or ask user how to proceed.
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
---
|
|
104
|
-
|
|
105
|
-
# 🔴 NON-NEGOTIABLE SAFEGUARDS
|
|
20
|
+
| Trigger | Tool |
|
|
21
|
+
|---------|------|
|
|
22
|
+
| Every message | `pulse_status` |
|
|
23
|
+
| After edits | `pulse_doctor` |
|
|
24
|
+
| 10+ min work | `pulse_checkpoint` |
|
|
25
|
+
| "wrong"/"stop" | `pulse_correct` |
|
|
26
|
+
| 2-3 failures | `pulse_escalate` |
|
|
27
|
+
| Task done | `pulse_review` |
|
|
106
28
|
|
|
107
|
-
|
|
29
|
+
## NON-NEGOTIABLE
|
|
108
30
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
| 📤 **Push** | NEVER push without explicit "May I push?" |
|
|
114
|
-
| 🔐 **Secrets** | NEVER commit API keys, passwords, tokens |
|
|
115
|
-
| 💾 **Checkpoint** | Every 5-10 min via `pulse_checkpoint` |
|
|
116
|
-
|
|
117
|
-
---
|
|
118
|
-
|
|
119
|
-
# 📊 TOOL DECISION FLOWCHART
|
|
120
|
-
|
|
121
|
-
```
|
|
122
|
-
START (new message)
|
|
123
|
-
│
|
|
124
|
-
▼
|
|
125
|
-
[pulse_status] ─── Critical? ──► STOP
|
|
126
|
-
│
|
|
127
|
-
│ What did user say?
|
|
128
|
-
│
|
|
129
|
-
├── "new task/implement/build" ──► [pulse_run] ──► implement
|
|
130
|
-
│
|
|
131
|
-
├── "wrong/stop/no" ──► [pulse_correct] ──► fix
|
|
132
|
-
│
|
|
133
|
-
├── "done/finished/PR" ──► [pulse_review] ──► respond
|
|
134
|
-
│
|
|
135
|
-
└── normal request ──► implement
|
|
136
|
-
│
|
|
137
|
-
▼
|
|
138
|
-
[pulse_doctor]
|
|
139
|
-
│
|
|
140
|
-
▼
|
|
141
|
-
>10 min? ──► [pulse_checkpoint]
|
|
142
|
-
│
|
|
143
|
-
▼
|
|
144
|
-
solved problem? ──► [pulse_learn]
|
|
145
|
-
│
|
|
146
|
-
▼
|
|
147
|
-
respond
|
|
148
|
-
```
|
|
31
|
+
- ⏱️ MAX 30 min autonomous
|
|
32
|
+
- 🗑️ NO delete without confirmation
|
|
33
|
+
- 📤 NO push without confirmation
|
|
34
|
+
- 🔐 NO secrets in code
|
|
149
35
|
|
|
150
36
|
---
|
|
151
37
|
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
If you notice any of these patterns, STOP and call `pulse_escalate`:
|
|
155
|
-
|
|
156
|
-
- Same error 2-3 times
|
|
157
|
-
- Editing same file repeatedly without progress
|
|
158
|
-
- "Fix" commits followed by more "fix" commits
|
|
159
|
-
- Going back and forth between two approaches
|
|
160
|
-
|
|
161
|
-
---
|
|
162
|
-
|
|
163
|
-
# 📋 QUICK REFERENCE
|
|
164
|
-
|
|
165
|
-
| Trigger | Tool | Auto-Execute? |
|
|
166
|
-
|---------|------|---------------|
|
|
167
|
-
| Every message | `pulse_status` | ✅ YES |
|
|
168
|
-
| New task | `pulse_run` | ✅ YES |
|
|
169
|
-
| Code changed | `pulse_doctor` | ✅ YES |
|
|
170
|
-
| >10 min | `pulse_checkpoint` | ✅ YES |
|
|
171
|
-
| Before "done" | `pulse_review` | ✅ YES |
|
|
172
|
-
| User says "wrong" | `pulse_correct` | ✅ YES |
|
|
173
|
-
| 2-3 failures | `pulse_escalate` | ✅ YES |
|
|
174
|
-
| Problem solved | `pulse_learn` | ✅ YES |
|
|
175
|
-
|
|
176
|
-
**ALL tools are AUTO-EXECUTE. Don't ask. Do.**
|
|
177
|
-
|
|
178
|
-
---
|
|
179
|
-
|
|
180
|
-
# ⚠️ FINAL REMINDER
|
|
181
|
-
|
|
182
|
-
You are an autonomous agent with safeguards. The safeguards are not optional.
|
|
183
|
-
They exist to protect the user's work from:
|
|
184
|
-
- Lost code (checkpoint)
|
|
185
|
-
- Mistakes (doctor)
|
|
186
|
-
- Loops (escalate)
|
|
187
|
-
- Forgotten knowledge (learn)
|
|
188
|
-
|
|
189
|
-
**Call the tools automatically. Don't wait to be asked.**
|
|
38
|
+
**DID YOU CALL pulse_status? If not, do it NOW.**
|