@imenam/mcp-documentor 1.0.25 → 1.0.27
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/src/gui-worker.js
CHANGED
|
@@ -95,7 +95,8 @@ function setupIpcErrorHandlers() {
|
|
|
95
95
|
logger.error(`Process error: ${err.message}`);
|
|
96
96
|
});
|
|
97
97
|
process.on("disconnect", () => {
|
|
98
|
-
logger.
|
|
98
|
+
logger.warn("IPC disconnected from MCP master (parent closed the channel or process exited). " +
|
|
99
|
+
"GUI worker will exit; EventSource clients will show Disconnected.");
|
|
99
100
|
process.exit(0);
|
|
100
101
|
});
|
|
101
102
|
process.on("message", (msg) => {
|
|
@@ -141,22 +142,53 @@ app.get("/proxy/health", (c) => {
|
|
|
141
142
|
});
|
|
142
143
|
app.get("/api/events", (c) => {
|
|
143
144
|
return streamSSE(c, async (stream) => {
|
|
145
|
+
const clientId = Math.random().toString(36).slice(2, 11);
|
|
146
|
+
const openedAt = Date.now();
|
|
144
147
|
sseControllers.add(stream);
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
+
logger.info(`SSE /api/events: client connected (id=${clientId})`);
|
|
149
|
+
stream.onAbort(() => {
|
|
150
|
+
sseControllers.delete(stream);
|
|
151
|
+
logger.warn(`SSE /api/events: stream aborted (id=${clientId}, durationMs=${Date.now() - openedAt}). ` +
|
|
152
|
+
"Typical causes: user navigated away, proxy closed idle connection, or network drop. " +
|
|
153
|
+
"Browser will retry EventSource and may log client-diagnostics with readyState.");
|
|
154
|
+
});
|
|
155
|
+
const initialSent = safeSend({ type: "GET_INITIAL_STATE", timestamp: new Date().toISOString() });
|
|
156
|
+
if (!initialSent) {
|
|
157
|
+
logger.warn(`SSE /api/events: GET_INITIAL_STATE not sent to master (id=${clientId}). ` +
|
|
158
|
+
`IPC unavailable: process.connected=${process.connected}, process.send=${typeof process.send}. ` +
|
|
159
|
+
"Dashboard will stay Disconnected until IPC to the MCP process works.");
|
|
160
|
+
}
|
|
161
|
+
try {
|
|
162
|
+
await stream.writeSSE({ data: "connected", event: "ping" });
|
|
163
|
+
}
|
|
164
|
+
catch (err) {
|
|
165
|
+
logger.warn(`SSE /api/events: initial writeSSE failed (id=${clientId}): ${err?.message ?? err}`);
|
|
166
|
+
sseControllers.delete(stream);
|
|
167
|
+
return;
|
|
168
|
+
}
|
|
148
169
|
while (true) {
|
|
149
170
|
await stream.sleep(30000);
|
|
150
171
|
try {
|
|
151
172
|
await stream.writeSSE({ data: "ping", event: "ping" });
|
|
152
173
|
}
|
|
153
|
-
catch {
|
|
174
|
+
catch (err) {
|
|
175
|
+
logger.warn(`SSE /api/events: keepalive ping failed (id=${clientId}): ${err?.message ?? err}`);
|
|
154
176
|
sseControllers.delete(stream);
|
|
155
177
|
break;
|
|
156
178
|
}
|
|
157
179
|
}
|
|
158
180
|
});
|
|
159
181
|
});
|
|
182
|
+
app.post("/api/client-diagnostics", async (c) => {
|
|
183
|
+
try {
|
|
184
|
+
const body = await c.req.json();
|
|
185
|
+
logger.warn(`Client diagnostics (SSE/EventSource): ${JSON.stringify(body)}`);
|
|
186
|
+
}
|
|
187
|
+
catch (e) {
|
|
188
|
+
logger.warn(`Client diagnostics: invalid JSON body (${e?.message ?? e})`);
|
|
189
|
+
}
|
|
190
|
+
return c.json({ ok: true });
|
|
191
|
+
});
|
|
160
192
|
app.get("/api/configurations", async (c) => {
|
|
161
193
|
const configRes = await ipcRequest("GET_CONFIG");
|
|
162
194
|
if (configRes.error)
|
package/dist/src/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const APP_VERSION = "1.0.
|
|
1
|
+
export declare const APP_VERSION = "1.0.27";
|
package/dist/src/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Auto-generated version file - do not edit manually
|
|
2
|
-
export const APP_VERSION = '1.0.
|
|
2
|
+
export const APP_VERSION = '1.0.27';
|