cursor-mcp-feedback 2.0.1 → 2.0.3
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 +9 -3
- package/dist/session-store.js +11 -2
- package/hooks/block-cursor-mcp-feedback.js +4 -0
- package/hooks/session-utils.js +14 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -99,11 +99,17 @@ npm run build
|
|
|
99
99
|
|
|
100
100
|
```bash
|
|
101
101
|
cd floating-app
|
|
102
|
-
|
|
103
|
-
#
|
|
102
|
+
|
|
103
|
+
# Option A: Build DMG for distribution
|
|
104
|
+
./build-dmg.sh # Creates CursorMCPFeedback.dmg (~800KB)
|
|
105
|
+
# DMG contains: .app + Install.command (handles xattr) + /Applications shortcut
|
|
106
|
+
|
|
107
|
+
# Option B: Build .app directly
|
|
108
|
+
./build-app.sh # Creates CursorMCPFeedback.app
|
|
109
|
+
cp -r CursorMCPFeedback.app /Applications/
|
|
104
110
|
```
|
|
105
111
|
|
|
106
|
-
To auto-launch on login, add
|
|
112
|
+
To auto-launch on login, add `CursorMCPFeedback` to System Settings > General > Login Items.
|
|
107
113
|
|
|
108
114
|
### CLI: Queue Pending Messages
|
|
109
115
|
|
package/dist/session-store.js
CHANGED
|
@@ -54,8 +54,17 @@ function cleanupSession(sessionId) {
|
|
|
54
54
|
export function createFreshSession(summary, sessionId) {
|
|
55
55
|
ensureDir();
|
|
56
56
|
cleanExpiredSessions();
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
let conversationId;
|
|
58
|
+
try {
|
|
59
|
+
const callerFile = path.join(os.homedir(), ".cursor-mcp-feedback", "current-feedback-caller.json");
|
|
60
|
+
const caller = JSON.parse(fs.readFileSync(callerFile, "utf8"));
|
|
61
|
+
if (caller.conversation_id && Date.now() - caller.ts < 10000) {
|
|
62
|
+
conversationId = caller.conversation_id;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
catch { /* ignore */ }
|
|
66
|
+
writeSession({ sessionId, summary, createdAt: Date.now(), status: "pending", conversation_id: conversationId });
|
|
67
|
+
logObj("session-store: created:fresh", { sessionId, summaryLen: summary.length, conversationId: conversationId || "unknown" });
|
|
59
68
|
return sessionId;
|
|
60
69
|
}
|
|
61
70
|
export function resolveSession(sessionId, feedback, images, userInput) {
|
|
@@ -85,6 +85,10 @@ process.stdin.on('end', () => {
|
|
|
85
85
|
'Return your results as text in your final response instead.',
|
|
86
86
|
});
|
|
87
87
|
} else {
|
|
88
|
+
if (convId) {
|
|
89
|
+
const callerFile = require('path').join(su.BASE_DIR, 'current-feedback-caller.json');
|
|
90
|
+
su.writeJson(callerFile, { conversation_id: convId, ts: Date.now() });
|
|
91
|
+
}
|
|
88
92
|
su.writeHookOutput({});
|
|
89
93
|
}
|
|
90
94
|
return;
|
package/hooks/session-utils.js
CHANGED
|
@@ -64,7 +64,7 @@ function ensureSession(convId, meta) {
|
|
|
64
64
|
createSession(convId, { ...meta, _lazy: true });
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
const STALE_MS =
|
|
67
|
+
const STALE_MS = 72 * 60 * 60 * 1000; // 72 hours
|
|
68
68
|
|
|
69
69
|
function cleanupStaleSessions() {
|
|
70
70
|
const list = readJson(ACTIVE_FILE, []);
|
|
@@ -118,7 +118,17 @@ function endSession(convId, reason) {
|
|
|
118
118
|
conversation_id: convId,
|
|
119
119
|
reason,
|
|
120
120
|
});
|
|
121
|
-
|
|
121
|
+
markSessionInactive(convId);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function markSessionInactive(convId) {
|
|
125
|
+
const list = readJson(ACTIVE_FILE, []);
|
|
126
|
+
const idx = list.findIndex((s) => s.id === convId);
|
|
127
|
+
if (idx >= 0) {
|
|
128
|
+
list[idx].is_active = false;
|
|
129
|
+
list[idx].ended_at = Date.now();
|
|
130
|
+
writeJson(ACTIVE_FILE, list);
|
|
131
|
+
}
|
|
122
132
|
}
|
|
123
133
|
|
|
124
134
|
function updateActiveList(convId, meta, active) {
|
|
@@ -132,6 +142,7 @@ function updateActiveList(convId, meta, active) {
|
|
|
132
142
|
model: meta?.model || "",
|
|
133
143
|
started_at: meta?.created_at || Date.now(),
|
|
134
144
|
last_activity: Date.now(),
|
|
145
|
+
is_active: true,
|
|
135
146
|
};
|
|
136
147
|
if (idx >= 0) list[idx] = { ...list[idx], ...entry };
|
|
137
148
|
else list.push(entry);
|
|
@@ -245,7 +256,7 @@ module.exports = {
|
|
|
245
256
|
BASE_DIR, SESSIONS_DIR, ACTIVE_FILE, SUBAGENT_FILE, GLOBAL_PENDING,
|
|
246
257
|
ensureDir, sessionDir, readJson, writeJson, appendJsonl,
|
|
247
258
|
createSession, ensureSession, endSession, cleanupStaleSessions, maybeCleanup,
|
|
248
|
-
updateActiveList, touchSessionActivity,
|
|
259
|
+
updateActiveList, markSessionInactive, touchSessionActivity,
|
|
249
260
|
readSessionPending, writeSessionPending, addSessionPending, consumeSessionPending,
|
|
250
261
|
recordSubagent, removeSubagent, isSubagent,
|
|
251
262
|
getMostRecentSession, readGlobalPending, writeGlobalPending,
|
package/package.json
CHANGED