@mirrai/mcp-server 0.5.11 → 0.5.14
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse-client.d.ts","sourceRoot":"","sources":["../../src/client/sse-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;
|
|
1
|
+
{"version":3,"file":"sse-client.d.ts","sourceRoot":"","sources":["../../src/client/sse-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAMpD,UAAU,QAAQ;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACb;AAED,qBAAa,SAAS;IACpB,OAAO,CAAC,OAAO,CAAQ;IACvB,OAAO,CAAC,MAAM,CAAQ;gBAEV,MAAM,EAAE,WAAW;IAS/B;;;OAGG;IACG,aAAa,CACjB,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,OAAO,EACb,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAA;QAClB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,QAAQ,KAAK,IAAI,CAAA;KAC/B,GACL,OAAO,CAAC,QAAQ,EAAE,CAAC;IAwGtB;;OAEG;IACG,yBAAyB,CAC7B,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC;QACT,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;QAC3B,KAAK,EAAE,KAAK,CAAC;YAAE,UAAU,EAAE,MAAM,CAAC;YAAC,KAAK,EAAE,MAAM,CAAC;YAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC,CAAA;KAClE,CAAC;IAoDF;;OAEG;IACG,uBAAuB,CAC3B,IAAI,EAAE,OAAO,GACZ,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;YA8Bd,uBAAuB;CAyBtC"}
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
* and accumulates the final result. MCP tools are request-response,
|
|
6
6
|
* so this fully consumes the stream before returning.
|
|
7
7
|
*/
|
|
8
|
+
const DEFAULT_STREAM_TIMEOUT_MS = 300_000;
|
|
9
|
+
const CAROUSEL_GENERATION_TIMEOUT_MS = 610_000;
|
|
10
|
+
const CAROUSEL_REFINE_TIMEOUT_MS = 310_000;
|
|
8
11
|
export class SSEClient {
|
|
9
12
|
baseUrl;
|
|
10
13
|
apiKey;
|
|
@@ -21,7 +24,7 @@ export class SSEClient {
|
|
|
21
24
|
* Returns accumulated events categorized by event type.
|
|
22
25
|
*/
|
|
23
26
|
async consumeStream(path, body, options = {}) {
|
|
24
|
-
const { timeoutMs =
|
|
27
|
+
const { timeoutMs = DEFAULT_STREAM_TIMEOUT_MS } = options;
|
|
25
28
|
const controller = new AbortController();
|
|
26
29
|
const timeout = setTimeout(() => controller.abort(), timeoutMs);
|
|
27
30
|
try {
|
|
@@ -51,16 +54,30 @@ export class SSEClient {
|
|
|
51
54
|
const reader = response.body.getReader();
|
|
52
55
|
const decoder = new TextDecoder();
|
|
53
56
|
let buffer = '';
|
|
57
|
+
let currentEvent = '';
|
|
58
|
+
let currentData = '';
|
|
59
|
+
const flushEvent = () => {
|
|
60
|
+
if (!currentEvent && !currentData) {
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
const event = {
|
|
64
|
+
event: currentEvent || 'message',
|
|
65
|
+
data: currentData,
|
|
66
|
+
};
|
|
67
|
+
events.push(event);
|
|
68
|
+
options.onEvent?.(event);
|
|
69
|
+
currentEvent = '';
|
|
70
|
+
currentData = '';
|
|
71
|
+
};
|
|
54
72
|
while (true) {
|
|
55
73
|
const { done, value } = await reader.read();
|
|
56
74
|
if (done)
|
|
57
75
|
break;
|
|
58
76
|
buffer += decoder.decode(value, { stream: true });
|
|
77
|
+
buffer = buffer.replace(/\r\n/g, '\n');
|
|
59
78
|
// Parse SSE events from buffer
|
|
60
79
|
const lines = buffer.split('\n');
|
|
61
80
|
buffer = lines.pop() || ''; // Keep incomplete line in buffer
|
|
62
|
-
let currentEvent = '';
|
|
63
|
-
let currentData = '';
|
|
64
81
|
for (const line of lines) {
|
|
65
82
|
if (line.startsWith('event:')) {
|
|
66
83
|
currentEvent = line.slice(6).trim();
|
|
@@ -70,19 +87,35 @@ export class SSEClient {
|
|
|
70
87
|
currentData += (currentData ? '\n' : '') + line.slice(5).trim();
|
|
71
88
|
}
|
|
72
89
|
else if (line === '' && (currentEvent || currentData)) {
|
|
73
|
-
|
|
74
|
-
event: currentEvent || 'message',
|
|
75
|
-
data: currentData,
|
|
76
|
-
};
|
|
77
|
-
events.push(event);
|
|
78
|
-
options.onEvent?.(event);
|
|
79
|
-
currentEvent = '';
|
|
80
|
-
currentData = '';
|
|
90
|
+
flushEvent();
|
|
81
91
|
}
|
|
82
92
|
}
|
|
83
93
|
}
|
|
94
|
+
buffer += decoder.decode();
|
|
95
|
+
buffer = buffer.replace(/\r\n/g, '\n');
|
|
96
|
+
if (buffer.length > 0) {
|
|
97
|
+
for (const line of buffer.split('\n')) {
|
|
98
|
+
if (line.startsWith('event:')) {
|
|
99
|
+
currentEvent = line.slice(6).trim();
|
|
100
|
+
}
|
|
101
|
+
else if (line.startsWith('data:')) {
|
|
102
|
+
currentData += (currentData ? '\n' : '') + line.slice(5).trim();
|
|
103
|
+
}
|
|
104
|
+
else if (line === '' && (currentEvent || currentData)) {
|
|
105
|
+
flushEvent();
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
flushEvent();
|
|
84
110
|
return events;
|
|
85
111
|
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
114
|
+
throw new Error(`SSE stream timed out after ${Math.round(timeoutMs / 1000)}s while calling ${path}. ` +
|
|
115
|
+
'The Mirra API may still be processing; retry the tool or fetch the generation by ID if one was returned.');
|
|
116
|
+
}
|
|
117
|
+
throw error;
|
|
118
|
+
}
|
|
86
119
|
finally {
|
|
87
120
|
clearTimeout(timeout);
|
|
88
121
|
}
|
|
@@ -93,7 +126,7 @@ export class SSEClient {
|
|
|
93
126
|
async consumeCarouselGeneration(body) {
|
|
94
127
|
const pages = [];
|
|
95
128
|
let generationId = null;
|
|
96
|
-
const events = await this.consumeStream('/api/v1/carousel-lab/generate-content-stream', body, { timeoutMs:
|
|
129
|
+
const events = await this.consumeStream('/api/v1/carousel-lab/generate-content-stream', body, { timeoutMs: CAROUSEL_GENERATION_TIMEOUT_MS });
|
|
97
130
|
for (const event of events) {
|
|
98
131
|
try {
|
|
99
132
|
const data = JSON.parse(event.data);
|
|
@@ -120,6 +153,21 @@ export class SSEClient {
|
|
|
120
153
|
throw e;
|
|
121
154
|
}
|
|
122
155
|
}
|
|
156
|
+
if (pages.length === 0 && generationId) {
|
|
157
|
+
const generation = await this.fetchCarouselGeneration(generationId);
|
|
158
|
+
if (generation?.generatedPages?.length) {
|
|
159
|
+
return {
|
|
160
|
+
generationId,
|
|
161
|
+
pages: generation.generatedPages
|
|
162
|
+
.filter((page) => page?.pageNumber != null && page?.html)
|
|
163
|
+
.map((page) => ({
|
|
164
|
+
pageNumber: page.pageNumber,
|
|
165
|
+
title: page.title || '',
|
|
166
|
+
html: page.html,
|
|
167
|
+
})),
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
}
|
|
123
171
|
return { generationId, pages };
|
|
124
172
|
}
|
|
125
173
|
/**
|
|
@@ -127,7 +175,7 @@ export class SSEClient {
|
|
|
127
175
|
*/
|
|
128
176
|
async consumeRefinePageStream(body) {
|
|
129
177
|
let html = '';
|
|
130
|
-
const events = await this.consumeStream('/api/v1/carousel-lab/refine-page', body, { timeoutMs:
|
|
178
|
+
const events = await this.consumeStream('/api/v1/carousel-lab/refine-page', body, { timeoutMs: CAROUSEL_REFINE_TIMEOUT_MS });
|
|
131
179
|
for (const event of events) {
|
|
132
180
|
try {
|
|
133
181
|
const data = JSON.parse(event.data);
|
|
@@ -151,5 +199,19 @@ export class SSEClient {
|
|
|
151
199
|
throw new Error('No refined HTML returned');
|
|
152
200
|
return { html };
|
|
153
201
|
}
|
|
202
|
+
async fetchCarouselGeneration(generationId) {
|
|
203
|
+
const response = await fetch(`${this.baseUrl}/api/v1/carousel-lab/generations/${generationId}`, {
|
|
204
|
+
method: 'GET',
|
|
205
|
+
headers: {
|
|
206
|
+
'Authorization': `Bearer ${this.apiKey}`,
|
|
207
|
+
'Accept': 'application/json',
|
|
208
|
+
},
|
|
209
|
+
});
|
|
210
|
+
if (!response.ok) {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
const payload = await response.json();
|
|
214
|
+
return payload.data ?? null;
|
|
215
|
+
}
|
|
154
216
|
}
|
|
155
217
|
//# sourceMappingURL=sse-client.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sse-client.js","sourceRoot":"","sources":["../../src/client/sse-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"sse-client.js","sourceRoot":"","sources":["../../src/client/sse-client.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,MAAM,yBAAyB,GAAG,OAAO,CAAA;AACzC,MAAM,8BAA8B,GAAG,OAAO,CAAA;AAC9C,MAAM,0BAA0B,GAAG,OAAO,CAAA;AAO1C,MAAM,OAAO,SAAS;IACZ,OAAO,CAAQ;IACf,MAAM,CAAQ;IAEtB,YAAY,MAAmB;QAC7B,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;QACnC,IAAI,CAAC,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC;YAChD,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAA;QAC5D,CAAC;QACD,I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AE,CAAC;YACjB,OAAO,IAAI,CAAA;QACb,CAAC;QAED,MAAM,OAAO,GAAG,MAAM,QAAQ,CAAC,IAAI,EAIlC,CAAA;QAED,OAAO,OAAO,CAAC,IAAI,IAAI,IAAI,CAAA;IAC7B,CAAC;CACF"}
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Mirra MCP Server Entry Point
|
|
4
4
|
*
|
|
5
|
-
* Supports stdio
|
|
5
|
+
* Supports stdio transport. Remote SSE transport is not implemented yet.
|
|
6
6
|
*
|
|
7
7
|
* Environment variables:
|
|
8
8
|
* MIRRA_API_KEY - API key for authentication (required)
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Usage:
|
|
12
12
|
* # stdio (for Claude Desktop)
|
|
13
|
-
* npx @
|
|
13
|
+
* npx @mirrai/mcp-server@latest
|
|
14
14
|
*
|
|
15
15
|
* # SSE (for remote clients)
|
|
16
|
-
* npx @
|
|
16
|
+
* npx @mirrai/mcp-server@latest --transport sse --port 3100
|
|
17
17
|
*/
|
|
18
18
|
export {};
|
|
19
19
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Mirra MCP Server Entry Point
|
|
4
4
|
*
|
|
5
|
-
* Supports stdio
|
|
5
|
+
* Supports stdio transport. Remote SSE transport is not implemented yet.
|
|
6
6
|
*
|
|
7
7
|
* Environment variables:
|
|
8
8
|
* MIRRA_API_KEY - API key for authentication (required)
|
|
@@ -10,10 +10,10 @@
|
|
|
10
10
|
*
|
|
11
11
|
* Usage:
|
|
12
12
|
* # stdio (for Claude Desktop)
|
|
13
|
-
* npx @
|
|
13
|
+
* npx @mirrai/mcp-server@latest
|
|
14
14
|
*
|
|
15
15
|
* # SSE (for remote clients)
|
|
16
|
-
* npx @
|
|
16
|
+
* npx @mirrai/mcp-server@latest --transport sse --port 3100
|
|
17
17
|
*/
|
|
18
18
|
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
19
19
|
import { createMirraServer } from './server.js';
|