@t2000/mcp 0.22.2 → 0.22.4
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/bin.js +13 -15
- package/dist/bin.js.map +1 -1
- package/dist/index.js +13 -15
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/bin.js
CHANGED
|
@@ -837,26 +837,24 @@ Common examples:
|
|
|
837
837
|
const result = await mutex.run(
|
|
838
838
|
() => agent.pay({ url, method, body, headers, maxPrice })
|
|
839
839
|
);
|
|
840
|
-
|
|
841
|
-
{ type: "text", text: JSON.stringify(result) }
|
|
842
|
-
];
|
|
840
|
+
let text = JSON.stringify(result);
|
|
843
841
|
try {
|
|
844
842
|
const data = typeof result === "string" ? JSON.parse(result) : result;
|
|
845
843
|
const imageUrls = extractImageUrls(data);
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
content.push({ type: "image", data: buf.toString("base64"), mimeType: mime });
|
|
853
|
-
}
|
|
854
|
-
} catch {
|
|
855
|
-
}
|
|
844
|
+
if (imageUrls.length > 0) {
|
|
845
|
+
const urlList = imageUrls.slice(0, 4).map((u) => `- ${u}`).join("\n");
|
|
846
|
+
text = `Generated images:
|
|
847
|
+
${urlList}
|
|
848
|
+
|
|
849
|
+
${text}`;
|
|
856
850
|
}
|
|
857
851
|
} catch {
|
|
858
852
|
}
|
|
859
|
-
|
|
853
|
+
const MAX_BYTES = 8e5;
|
|
854
|
+
if (text.length > MAX_BYTES) {
|
|
855
|
+
text = text.slice(0, MAX_BYTES) + "\n\n[Response truncated \u2014 exceeded size limit]";
|
|
856
|
+
}
|
|
857
|
+
return { content: [{ type: "text", text }] };
|
|
860
858
|
} catch (err) {
|
|
861
859
|
return errorResult(err);
|
|
862
860
|
}
|
|
@@ -1847,7 +1845,7 @@ async function startMcpServer(opts) {
|
|
|
1847
1845
|
);
|
|
1848
1846
|
process.exit(1);
|
|
1849
1847
|
}
|
|
1850
|
-
const server = new McpServer({ name: "t2000", version: "0.22.
|
|
1848
|
+
const server = new McpServer({ name: "t2000", version: "0.22.4" });
|
|
1851
1849
|
registerReadTools(server, agent);
|
|
1852
1850
|
registerWriteTools(server, agent);
|
|
1853
1851
|
registerSafetyTools(server, agent);
|