@vibevibes/mcp 0.9.2 → 0.9.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/hooks/stop-hook.js +11 -1
- package/package.json +1 -1
package/hooks/stop-hook.js
CHANGED
|
@@ -186,9 +186,19 @@ async function main() {
|
|
|
186
186
|
const POLL_DEADLINE_MS = 55_000;
|
|
187
187
|
const pollStart = Date.now();
|
|
188
188
|
while (true) {
|
|
189
|
-
// Wall-clock guard — exit
|
|
189
|
+
// Wall-clock guard — block exit to keep agent alive
|
|
190
190
|
const elapsed = Date.now() - pollStart;
|
|
191
191
|
if (elapsed > POLL_DEADLINE_MS) {
|
|
192
|
+
// Re-check agent files — if deleted by disconnect, allow exit
|
|
193
|
+
const currentAgents = loadAgentFiles();
|
|
194
|
+
if (currentAgents.length === 0) {
|
|
195
|
+
process.exit(0);
|
|
196
|
+
}
|
|
197
|
+
// Still connected — block exit
|
|
198
|
+
process.stdout.write(JSON.stringify({
|
|
199
|
+
decision: "block",
|
|
200
|
+
reason: "Still connected to the experience. Waiting for activity.",
|
|
201
|
+
}));
|
|
192
202
|
process.exit(0);
|
|
193
203
|
}
|
|
194
204
|
// Cap poll timeout to remaining time minus buffer, so we don't overshoot the deadline
|