chromeflow 0.1.40 → 0.1.41
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/CLAUDE.md +1 -1
- package/dist/index.js +48 -0
- package/dist/tools/capture.js +2 -1
- package/package.json +1 -1
package/CLAUDE.md
CHANGED
|
@@ -24,7 +24,7 @@ Do NOT ask "should I open the browser?" — just do it. The user expects seamles
|
|
|
24
24
|
|
|
25
25
|
2. **Never use `take_screenshot` to read page content.** After `scroll_page`, after
|
|
26
26
|
`click_element`, after navigation — always call `get_page_text`, not `take_screenshot`.
|
|
27
|
-
`get_page_text` returns up to
|
|
27
|
+
`get_page_text` returns up to 10,000 characters; if truncated it tells you the next
|
|
28
28
|
`startIndex` to paginate. Screenshots are only for locating an element's pixel position
|
|
29
29
|
when DOM queries have already failed. Never take more than 1–2 screenshots in a row.
|
|
30
30
|
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,54 @@ async function main() {
|
|
|
38
38
|
registerHighlightTools(server, bridge);
|
|
39
39
|
registerCaptureTools(server, bridge);
|
|
40
40
|
registerFlowTools(server, bridge);
|
|
41
|
+
server.prompt(
|
|
42
|
+
"chromeflow-status",
|
|
43
|
+
"Check if the chromeflow Chrome extension is connected and which tab is active",
|
|
44
|
+
async () => {
|
|
45
|
+
const connected = bridge.isConnected();
|
|
46
|
+
if (!connected) {
|
|
47
|
+
return {
|
|
48
|
+
messages: [{
|
|
49
|
+
role: "user",
|
|
50
|
+
content: {
|
|
51
|
+
type: "text",
|
|
52
|
+
text: "Check chromeflow status. The Chrome extension is NOT connected. Tell the user to reload the chromeflow extension in chrome://extensions."
|
|
53
|
+
}
|
|
54
|
+
}]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
try {
|
|
58
|
+
const response = await bridge.request({ type: "list_tabs" }, 3e3);
|
|
59
|
+
const tabs = response.tabs;
|
|
60
|
+
const active = tabs.find((t) => t.active);
|
|
61
|
+
const tabList = tabs.map((t) => `${t.index}. ${t.active ? "[active] " : ""}${t.title} \u2014 ${t.url}`).join("\n");
|
|
62
|
+
return {
|
|
63
|
+
messages: [{
|
|
64
|
+
role: "user",
|
|
65
|
+
content: {
|
|
66
|
+
type: "text",
|
|
67
|
+
text: `Check chromeflow status.
|
|
68
|
+
|
|
69
|
+
Extension: Connected
|
|
70
|
+
Active tab: ${active?.title ?? "none"} \u2014 ${active?.url ?? ""}
|
|
71
|
+
All tabs:
|
|
72
|
+
${tabList}`
|
|
73
|
+
}
|
|
74
|
+
}]
|
|
75
|
+
};
|
|
76
|
+
} catch {
|
|
77
|
+
return {
|
|
78
|
+
messages: [{
|
|
79
|
+
role: "user",
|
|
80
|
+
content: {
|
|
81
|
+
type: "text",
|
|
82
|
+
text: "Check chromeflow status. Extension is connected but not responding. The user may need to reload it."
|
|
83
|
+
}
|
|
84
|
+
}]
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
);
|
|
41
89
|
const transport = new StdioServerTransport();
|
|
42
90
|
await server.connect(transport);
|
|
43
91
|
console.error("[chromeflow] MCP server running. Waiting for Claude...");
|
package/dist/tools/capture.js
CHANGED
|
@@ -61,7 +61,8 @@ After filling, call wait_for_click only if the user needs to review/confirm; oth
|
|
|
61
61
|
"get_page_text",
|
|
62
62
|
`Get the visible text content of the current page without taking a screenshot.
|
|
63
63
|
Use this instead of take_screenshot whenever you need to read what's on the page \u2014 errors, build status, form labels, confirmation messages, etc.
|
|
64
|
-
Returns up to
|
|
64
|
+
Returns up to 10,000 characters per call (~3k tokens). If the response ends with "... (N more characters)", call again with startIndex to read the next chunk.
|
|
65
|
+
Use the selector parameter to scope extraction to a specific section and avoid pulling unnecessary content.
|
|
65
66
|
Never use take_screenshot just to read page content \u2014 paginate with startIndex instead.`,
|
|
66
67
|
{
|
|
67
68
|
selector: z.string().optional().describe(
|
package/package.json
CHANGED