@debugg-ai/debugg-ai-mcp 1.0.8 → 1.0.9
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/index.js +25 -14
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -131,25 +131,36 @@ server.setRequestHandler(CallToolRequestSchema, async (req) => {
|
|
|
131
131
|
});
|
|
132
132
|
const testOutcome = finalRun?.outcome;
|
|
133
133
|
const testDetails = finalRun?.conversations?.[0]?.messages?.map((message) => message.jsonContent?.currentState?.nextGoal);
|
|
134
|
-
const runGif = finalRun?.runGif;
|
|
134
|
+
// const runGif = finalRun?.runGif;
|
|
135
|
+
// let base64 = "";
|
|
136
|
+
// if (runGif) {
|
|
137
|
+
// const response = await fetch(runGif);
|
|
138
|
+
// const arrayBuffer = await response.arrayBuffer();
|
|
139
|
+
// base64 = Buffer.from(arrayBuffer).toString('base64');
|
|
140
|
+
// }
|
|
141
|
+
// many clients don't support gif yet, so default to jpg
|
|
142
|
+
const finalScreenshot = finalRun?.finalScreenshot;
|
|
135
143
|
let base64 = "";
|
|
136
|
-
if (
|
|
137
|
-
const response = await fetch(
|
|
144
|
+
if (finalScreenshot) {
|
|
145
|
+
const response = await fetch(finalScreenshot);
|
|
138
146
|
const arrayBuffer = await response.arrayBuffer();
|
|
139
147
|
base64 = Buffer.from(arrayBuffer).toString('base64');
|
|
140
148
|
}
|
|
149
|
+
const responseContent = [
|
|
150
|
+
{
|
|
151
|
+
type: "text",
|
|
152
|
+
text: JSON.stringify({ testOutcome, testDetails }, null, 2),
|
|
153
|
+
}
|
|
154
|
+
];
|
|
155
|
+
if (base64) {
|
|
156
|
+
responseContent.push({
|
|
157
|
+
type: "image",
|
|
158
|
+
data: base64,
|
|
159
|
+
mimeType: "image/jpg",
|
|
160
|
+
});
|
|
161
|
+
}
|
|
141
162
|
return {
|
|
142
|
-
content:
|
|
143
|
-
{
|
|
144
|
-
type: "text",
|
|
145
|
-
text: JSON.stringify({ testOutcome, testDetails }, null, 2),
|
|
146
|
-
},
|
|
147
|
-
{
|
|
148
|
-
type: "image",
|
|
149
|
-
data: base64,
|
|
150
|
-
mimeType: "image/gif",
|
|
151
|
-
}
|
|
152
|
-
],
|
|
163
|
+
content: responseContent,
|
|
153
164
|
};
|
|
154
165
|
}
|
|
155
166
|
throw new Error(`Tool not found: ${name}`);
|