chromeflow 0.1.52 → 0.1.54
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/tools/browser.js +2 -1
- package/dist/ws-bridge.js +8 -0
- package/package.json +1 -1
package/dist/tools/browser.js
CHANGED
|
@@ -266,7 +266,8 @@ To clear existing content before typing, use execute_script("document.execComman
|
|
|
266
266
|
text: z.string().describe("The text to type into the focused element")
|
|
267
267
|
},
|
|
268
268
|
async ({ text }) => {
|
|
269
|
-
const
|
|
269
|
+
const timeoutMs = Math.max(3e4, text.length * 90 + 15e3);
|
|
270
|
+
const response = await bridge.request({ type: "type_text", text }, timeoutMs);
|
|
270
271
|
const r = response;
|
|
271
272
|
return {
|
|
272
273
|
content: [{ type: "text", text: r.message ?? (r.success ? "Text typed successfully" : "Failed to type text") }]
|
package/dist/ws-bridge.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { WebSocketServer, WebSocket } from "ws";
|
|
2
|
+
import path from "path";
|
|
2
3
|
const WS_PORT_BASE = 7878;
|
|
3
4
|
const WS_PORT_MAX = 7888;
|
|
4
5
|
const REQUEST_TIMEOUT_MS = 3e4;
|
|
@@ -46,6 +47,13 @@ class WsBridge {
|
|
|
46
47
|
}
|
|
47
48
|
if (msg.type === "ready") {
|
|
48
49
|
console.error("[chromeflow] Extension ready");
|
|
50
|
+
const cwd = process.cwd();
|
|
51
|
+
ws.send(JSON.stringify({
|
|
52
|
+
type: "identity",
|
|
53
|
+
cwd,
|
|
54
|
+
label: path.basename(cwd),
|
|
55
|
+
port: this.port
|
|
56
|
+
}));
|
|
49
57
|
return;
|
|
50
58
|
}
|
|
51
59
|
const pending = this.pending.get(msg.requestId);
|
package/package.json
CHANGED