pumuki-ast-hooks 5.5.1 → 5.5.2
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pumuki-ast-hooks",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.2",
|
|
4
4
|
"description": "Enterprise-grade AST Intelligence System with multi-platform support (iOS, Android, Backend, Frontend) and Feature-First + DDD + Clean Architecture enforcement. Includes dynamic violations API for intelligent querying.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -964,17 +964,31 @@ async function handleMcpMessage(message) {
|
|
|
964
964
|
}
|
|
965
965
|
}
|
|
966
966
|
|
|
967
|
+
// Flag to track if MCP has been initialized
|
|
968
|
+
let mcpInitialized = false;
|
|
969
|
+
|
|
967
970
|
// Start protocol handler
|
|
968
|
-
protocolHandler.start(
|
|
971
|
+
protocolHandler.start(async (message) => {
|
|
972
|
+
const response = await handleMcpMessage(message);
|
|
973
|
+
|
|
974
|
+
// Start polling loops ONLY after receiving 'initialized' notification from Windsurf
|
|
975
|
+
if (!mcpInitialized && message.includes('"method":"initialized"')) {
|
|
976
|
+
mcpInitialized = true;
|
|
977
|
+
process.stderr.write(`[MCP] Received 'initialized' - starting background loops\n`);
|
|
978
|
+
startPollingLoops();
|
|
979
|
+
}
|
|
980
|
+
|
|
981
|
+
return response;
|
|
982
|
+
});
|
|
969
983
|
|
|
970
984
|
// Log MCP ready
|
|
971
985
|
process.stderr.write(`[MCP] Server ready for ${REPO_ROOT}\n`);
|
|
972
986
|
|
|
973
987
|
/**
|
|
974
|
-
*
|
|
975
|
-
*
|
|
988
|
+
* Start polling loops for background notifications and automations
|
|
989
|
+
* Called ONLY after MCP handshake is complete
|
|
976
990
|
*/
|
|
977
|
-
|
|
991
|
+
function startPollingLoops() {
|
|
978
992
|
setInterval(async () => {
|
|
979
993
|
try {
|
|
980
994
|
const now = Date.now();
|
|
@@ -1135,4 +1149,4 @@ setTimeout(() => {
|
|
|
1135
1149
|
if (process.env.DEBUG) console.error('[MCP] Auto-commit error:', error);
|
|
1136
1150
|
}
|
|
1137
1151
|
}, AUTO_COMMIT_INTERVAL);
|
|
1138
|
-
}
|
|
1152
|
+
}
|
|
@@ -11,6 +11,9 @@ class McpProtocolHandler {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
start(messageHandler) {
|
|
14
|
+
// Log that we're starting
|
|
15
|
+
process.stderr.write('[MCP] Protocol handler starting...\n');
|
|
16
|
+
|
|
14
17
|
this.inputStream.on('data', (chunk) => {
|
|
15
18
|
const buf = Buffer.isBuffer(chunk) ? chunk : Buffer.from(String(chunk), 'utf8');
|
|
16
19
|
void this._handleChunk(buf, messageHandler);
|
|
@@ -25,6 +28,9 @@ class McpProtocolHandler {
|
|
|
25
28
|
if (this.logger) this.logger.error('MCP_STDIN_ERROR', { error: err.message });
|
|
26
29
|
process.exit(1);
|
|
27
30
|
});
|
|
31
|
+
|
|
32
|
+
// Log that we're ready
|
|
33
|
+
process.stderr.write('[MCP] Protocol handler ready\n');
|
|
28
34
|
}
|
|
29
35
|
|
|
30
36
|
async _handleChunk(chunk, messageHandler) {
|