@mcp-browser-kit/server 1.0.9 → 2.0.0
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/main.js +29 -7
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -6513,17 +6513,17 @@ var startTRpcServer = () => {
|
|
|
6513
6513
|
}
|
|
6514
6514
|
});
|
|
6515
6515
|
wss.on("connection", (ws) => {
|
|
6516
|
-
console.log(`\u2795\u2795 Connection (${wss.clients.size})`);
|
|
6517
6516
|
ws.once("close", () => {
|
|
6518
|
-
console.log(`\u2796\u2796 Connection (${wss.clients.size})`);
|
|
6519
6517
|
});
|
|
6520
6518
|
});
|
|
6521
|
-
|
|
6522
|
-
process.on("SIGTERM", () => {
|
|
6523
|
-
console.log("SIGTERM");
|
|
6519
|
+
const shutdown = () => {
|
|
6524
6520
|
handler.broadcastReconnectNotification();
|
|
6525
|
-
wss.close()
|
|
6526
|
-
|
|
6521
|
+
wss.close(() => {
|
|
6522
|
+
process.exit(0);
|
|
6523
|
+
});
|
|
6524
|
+
};
|
|
6525
|
+
process.on("SIGTERM", shutdown);
|
|
6526
|
+
process.on("SIGINT", shutdown);
|
|
6527
6527
|
};
|
|
6528
6528
|
|
|
6529
6529
|
// ../../node_modules/@modelcontextprotocol/sdk/dist/esm/types.js
|
|
@@ -9491,6 +9491,28 @@ server.tool(
|
|
|
9491
9491
|
};
|
|
9492
9492
|
}
|
|
9493
9493
|
);
|
|
9494
|
+
server.tool(
|
|
9495
|
+
"getInnerText",
|
|
9496
|
+
[
|
|
9497
|
+
combinationDescription,
|
|
9498
|
+
"- Use this tool to get the innerText of the current tab.",
|
|
9499
|
+
"- Usually being called after `getTabs` to read or identify element to interact with."
|
|
9500
|
+
].join("\n"),
|
|
9501
|
+
{
|
|
9502
|
+
tabId: z.string().describe("Tab ID to evaluate the code in")
|
|
9503
|
+
},
|
|
9504
|
+
async ({ tabId }) => {
|
|
9505
|
+
const innerText = await rpcClient.defer("getInnerText", tabId);
|
|
9506
|
+
return {
|
|
9507
|
+
content: [
|
|
9508
|
+
{
|
|
9509
|
+
type: "text",
|
|
9510
|
+
text: `InnerText: ${JSON.stringify(innerText)}`
|
|
9511
|
+
}
|
|
9512
|
+
]
|
|
9513
|
+
};
|
|
9514
|
+
}
|
|
9515
|
+
);
|
|
9494
9516
|
server.tool(
|
|
9495
9517
|
"getReadableElements",
|
|
9496
9518
|
[
|