openclaw-navigator 4.3.8 → 4.3.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/cli.mjs +105 -5
- package/package.json +1 -1
package/cli.mjs
CHANGED
|
@@ -220,10 +220,12 @@ function handleRequest(req, res) {
|
|
|
220
220
|
pendingCommandCount: pendingCommands.length,
|
|
221
221
|
recentEventCount: recentEvents.length,
|
|
222
222
|
},
|
|
223
|
-
tunnel: activeTunnelURL
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
223
|
+
tunnel: activeTunnelURL
|
|
224
|
+
? {
|
|
225
|
+
url: activeTunnelURL,
|
|
226
|
+
uiURL: `${activeTunnelURL}/ui/`,
|
|
227
|
+
}
|
|
228
|
+
: null,
|
|
227
229
|
});
|
|
228
230
|
return;
|
|
229
231
|
}
|
|
@@ -852,8 +854,106 @@ ${BOLD}How it works:${RESET}
|
|
|
852
854
|
|
|
853
855
|
mkdirSync(mcporterDir, { recursive: true });
|
|
854
856
|
writeFileSync(mcporterConfigPath, JSON.stringify(mcporterConfig, null, 2) + "\n", "utf8");
|
|
855
|
-
ok("Registered MCP server with mcporter (
|
|
857
|
+
ok("Registered MCP server with mcporter (16 browser tools available)");
|
|
856
858
|
info(` Config: ${mcporterConfigPath}`);
|
|
859
|
+
|
|
860
|
+
// Step 3: Install the navigator-bridge skill so the OC agent knows about all tools
|
|
861
|
+
// Try multiple known skill locations
|
|
862
|
+
const skillLocations = [
|
|
863
|
+
"/opt/homebrew/lib/node_modules/openclaw/skills/navigator-bridge",
|
|
864
|
+
join(homedir(), ".openclaw/skills/navigator-bridge"),
|
|
865
|
+
];
|
|
866
|
+
// Find the first parent that exists, or use the homebrew path
|
|
867
|
+
let skillDir = skillLocations[0]; // default
|
|
868
|
+
for (const loc of skillLocations) {
|
|
869
|
+
const parent = dirname(loc);
|
|
870
|
+
if (existsSync(parent)) {
|
|
871
|
+
skillDir = loc;
|
|
872
|
+
break;
|
|
873
|
+
}
|
|
874
|
+
}
|
|
875
|
+
const skillPath = join(skillDir, "SKILL.md");
|
|
876
|
+
const BT = "```"; // backtick triple for markdown code blocks
|
|
877
|
+
const skillContent = [
|
|
878
|
+
"---",
|
|
879
|
+
"name: navigator-bridge",
|
|
880
|
+
"description: Control the remote Navigator browser and access the OC Web UI via MCP tools. Navigate to URLs, click elements, fill forms, read page content, execute JavaScript, manage tabs, and open the OC dashboard.",
|
|
881
|
+
'metadata:',
|
|
882
|
+
' { "openclaw": { "emoji": "🌐", "requires": { "bins": ["mcporter"] } } }',
|
|
883
|
+
"---",
|
|
884
|
+
"",
|
|
885
|
+
"# Navigator Bridge (Remote Browser Control + OC Web UI)",
|
|
886
|
+
"",
|
|
887
|
+
"Control the **remote** Navigator browser through MCP tools via mcporter.",
|
|
888
|
+
"",
|
|
889
|
+
"**Important:** This controls the REMOTE Navigator instance connected via pairing code, NOT local Navigator.",
|
|
890
|
+
"",
|
|
891
|
+
"## Quick start",
|
|
892
|
+
"",
|
|
893
|
+
BT + "bash",
|
|
894
|
+
"# Get the OC Web UI URL and open it in Navigator",
|
|
895
|
+
"mcporter call navigator.navigator_get_ui_url",
|
|
896
|
+
"mcporter call navigator.navigator_navigate url=<uiURL from above>",
|
|
897
|
+
"",
|
|
898
|
+
"# Check connection status",
|
|
899
|
+
"mcporter call navigator.navigator_status",
|
|
900
|
+
BT,
|
|
901
|
+
"",
|
|
902
|
+
"## All 16 tools",
|
|
903
|
+
"",
|
|
904
|
+
"| Tool | What it does |",
|
|
905
|
+
"|------|-------------|",
|
|
906
|
+
"| `navigator_status` | Bridge status, connection, tunnel URL |",
|
|
907
|
+
"| `navigator_get_ui_url` | Get the OC Web UI URL (tunnel + /ui/) |",
|
|
908
|
+
"| `navigator_navigate` | Go to a URL |",
|
|
909
|
+
"| `navigator_open_tab` | Open new tab |",
|
|
910
|
+
"| `navigator_close_tab` | Close a tab |",
|
|
911
|
+
"| `navigator_list_tabs` | List all open tabs |",
|
|
912
|
+
"| `navigator_snapshot` | Full browser state snapshot |",
|
|
913
|
+
"| `navigator_get_text` | Read page text content |",
|
|
914
|
+
"| `navigator_get_html` | Get full page HTML |",
|
|
915
|
+
"| `navigator_click` | Click element by CSS selector |",
|
|
916
|
+
"| `navigator_fill` | Fill input field |",
|
|
917
|
+
"| `navigator_submit` | Submit form |",
|
|
918
|
+
"| `navigator_scroll` | Scroll page |",
|
|
919
|
+
"| `navigator_execute_js` | Run arbitrary JavaScript |",
|
|
920
|
+
"| `navigator_query_element` | Inspect DOM element |",
|
|
921
|
+
"| `navigator_wait_ready` | Wait for page load |",
|
|
922
|
+
"",
|
|
923
|
+
"## Usage",
|
|
924
|
+
"",
|
|
925
|
+
BT + "bash",
|
|
926
|
+
"mcporter call navigator.<tool_name> param=value",
|
|
927
|
+
BT,
|
|
928
|
+
"",
|
|
929
|
+
"## Common workflows",
|
|
930
|
+
"",
|
|
931
|
+
"### Open OC dashboard in Navigator",
|
|
932
|
+
BT + "bash",
|
|
933
|
+
"mcporter call navigator.navigator_get_ui_url",
|
|
934
|
+
"mcporter call navigator.navigator_navigate url=<uiURL>",
|
|
935
|
+
"mcporter call navigator.navigator_wait_ready",
|
|
936
|
+
BT,
|
|
937
|
+
"",
|
|
938
|
+
"### Browse and read a website",
|
|
939
|
+
BT + "bash",
|
|
940
|
+
"mcporter call navigator.navigator_navigate url=https://example.com",
|
|
941
|
+
"mcporter call navigator.navigator_wait_ready",
|
|
942
|
+
"mcporter call navigator.navigator_get_text",
|
|
943
|
+
BT,
|
|
944
|
+
"",
|
|
945
|
+
"### Fill and submit a form",
|
|
946
|
+
BT + "bash",
|
|
947
|
+
'mcporter call navigator.navigator_fill selector="#email" value="user@example.com"',
|
|
948
|
+
'mcporter call navigator.navigator_click selector="#submit"',
|
|
949
|
+
"mcporter call navigator.navigator_wait_ready",
|
|
950
|
+
BT,
|
|
951
|
+
"",
|
|
952
|
+
].join("\n");
|
|
953
|
+
mkdirSync(skillDir, { recursive: true });
|
|
954
|
+
writeFileSync(skillPath, skillContent, "utf8");
|
|
955
|
+
ok("Installed navigator-bridge skill for OC agent");
|
|
956
|
+
info(` Skill: ${skillPath}`);
|
|
857
957
|
} catch (err) {
|
|
858
958
|
warn(`mcporter registration failed: ${err.message}`);
|
|
859
959
|
info(" You can manually configure mcporter for Navigator MCP");
|