openclaw-navigator 5.3.3 → 5.3.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.
Files changed (2) hide show
  1. package/cli.mjs +117 -1
  2. package/package.json +1 -1
package/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  /**
4
- * openclaw-navigator v5.3.3
4
+ * openclaw-navigator v5.3.4
5
5
  *
6
6
  * One-command bridge + tunnel for the Navigator browser.
7
7
  * Starts a local bridge, creates a Cloudflare tunnel automatically,
@@ -1915,6 +1915,122 @@ module.exports = {
1915
1915
  info(" You can manually configure mcporter for Navigator MCP");
1916
1916
  }
1917
1917
 
1918
+ // ── Inject Navigator section into OC workspace TOOLS.md ──────────────
1919
+ // OC Core reads ~/.openclaw/workspace/TOOLS.md on every agent run.
1920
+ // This ensures the agent ALWAYS knows about Navigator browser integration.
1921
+ try {
1922
+ const toolsMdLocations = [
1923
+ join(homedir(), ".openclaw/workspace"),
1924
+ "/opt/homebrew/lib/node_modules/openclaw/workspace",
1925
+ ];
1926
+ let toolsDir = null;
1927
+ for (const loc of toolsMdLocations) {
1928
+ if (existsSync(loc)) {
1929
+ toolsDir = loc;
1930
+ break;
1931
+ }
1932
+ }
1933
+ if (toolsDir) {
1934
+ const toolsPath = join(toolsDir, "TOOLS.md");
1935
+ const MARKER_START = "<!-- NAVIGATOR-BRIDGE-START -->";
1936
+ const MARKER_END = "<!-- NAVIGATOR-BRIDGE-END -->";
1937
+ const tunnelHint = activeTunnelURL || "https://<tunnel>.trycloudflare.com";
1938
+ const navigatorSection = [
1939
+ MARKER_START,
1940
+ "",
1941
+ "## Navigator Browser (Remote Control via mcporter)",
1942
+ "",
1943
+ "You can control a **remote** Navigator browser instance through MCP tools.",
1944
+ "The Navigator bridge is connected and running — use `mcporter call navigator.<tool>` to interact.",
1945
+ "",
1946
+ "### Connection",
1947
+ `- Bridge: http://localhost:${port}`,
1948
+ `- Tunnel: ${tunnelHint}`,
1949
+ `- Web UI: ${tunnelHint}/ui/`,
1950
+ "- Protocol: mcporter → bridge HTTP → Navigator command queue → CEF browser",
1951
+ "",
1952
+ "### Key Tools (34 total, all prefixed with `navigator_`)",
1953
+ "",
1954
+ "**Browser Control:**",
1955
+ "- `navigator_status` — Check if Navigator is connected",
1956
+ "- `navigator_navigate url=<url>` — Go to a URL in the OpenClaw tab group",
1957
+ "- `navigator_get_ui_url` — Get the OC Web UI URL (open it with navigator_navigate)",
1958
+ "- `navigator_open_tab url=<url>` — Open a new tab",
1959
+ "- `navigator_list_tabs` — List all open tabs",
1960
+ "- `navigator_get_text` — Read visible page text",
1961
+ "- `navigator_get_html` — Get full page HTML",
1962
+ "- `navigator_click selector=<css>` — Click an element",
1963
+ "- `navigator_fill selector=<css> value=<text>` — Fill an input",
1964
+ "- `navigator_submit` — Submit a form",
1965
+ "- `navigator_execute_js code=<js>` — Run JavaScript",
1966
+ "- `navigator_wait_ready` — Wait for page to fully load",
1967
+ "",
1968
+ "**AI Intelligence:**",
1969
+ "- `navigator_analyze_page` — Detect forms, buttons, inputs, links, tables",
1970
+ "- `navigator_find_element intent=<text>` — Find element by description (e.g. 'login button')",
1971
+ "- `navigator_extract_data selector=<css> type=text|table|json` — Extract data",
1972
+ "- `navigator_smart_fill data='{...}'` — Fill forms by field name matching",
1973
+ "",
1974
+ "**Chat Pane:**",
1975
+ "- `navigator_get_chat_messages` — Read chat messages from the Navigator sidebar",
1976
+ "- `navigator_chat_respond message=<text>` — Send a message to the chat pane",
1977
+ "- `navigator_chat_stream text=<partial>` — Stream text (typing effect)",
1978
+ "",
1979
+ "### Common Workflows",
1980
+ "",
1981
+ "**Open OC Dashboard:**",
1982
+ "```bash",
1983
+ "mcporter call navigator.navigator_get_ui_url",
1984
+ "mcporter call navigator.navigator_navigate url=<uiURL>",
1985
+ "```",
1986
+ "",
1987
+ "**Browse a website and read its content:**",
1988
+ "```bash",
1989
+ "mcporter call navigator.navigator_navigate url=https://example.com",
1990
+ "mcporter call navigator.navigator_wait_ready",
1991
+ "mcporter call navigator.navigator_get_text",
1992
+ "```",
1993
+ "",
1994
+ "**Fill and submit a form:**",
1995
+ "```bash",
1996
+ "mcporter call navigator.navigator_analyze_page # see what's on the page",
1997
+ 'mcporter call navigator.navigator_fill selector="#email" value="user@example.com"',
1998
+ 'mcporter call navigator.navigator_click selector="#submit"',
1999
+ "```",
2000
+ "",
2001
+ "### Important Notes",
2002
+ "- All browser actions happen in a dedicated **OpenClaw** tab group — they never interfere with the user's browsing",
2003
+ "- Always call `navigator_wait_ready` after navigation before reading content",
2004
+ "- Use `navigator_analyze_page` before clicking/filling — it shows you what's on the page",
2005
+ "- The bridge polls Navigator every 5 seconds for command results",
2006
+ "",
2007
+ MARKER_END,
2008
+ ].join("\n");
2009
+
2010
+ // Read existing TOOLS.md and replace or append Navigator section
2011
+ let existing = "";
2012
+ try {
2013
+ existing = readFileSync(toolsPath, "utf8");
2014
+ } catch {
2015
+ /* file may not exist yet */
2016
+ }
2017
+ if (existing.includes(MARKER_START)) {
2018
+ // Replace existing Navigator section
2019
+ const before = existing.substring(0, existing.indexOf(MARKER_START));
2020
+ const after = existing.substring(existing.indexOf(MARKER_END) + MARKER_END.length);
2021
+ writeFileSync(toolsPath, before + navigatorSection + after, "utf8");
2022
+ } else {
2023
+ // Append Navigator section
2024
+ writeFileSync(toolsPath, existing + "\n\n" + navigatorSection + "\n", "utf8");
2025
+ }
2026
+ ok("Updated TOOLS.md with Navigator integration docs");
2027
+ info(` Path: ${toolsPath}`);
2028
+ }
2029
+ } catch (err) {
2030
+ // Non-fatal — TOOLS.md update is best-effort
2031
+ warn(`TOOLS.md update failed: ${err.message}`);
2032
+ }
2033
+
1918
2034
  // ── Install launchd auto-start (macOS only) ──────────────────────────
1919
2035
  // Creates ~/Library/LaunchAgents/com.openclaw.navigator-bridge.plist
1920
2036
  // so the bridge + MCP server starts automatically on login.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openclaw-navigator",
3
- "version": "5.3.3",
3
+ "version": "5.3.4",
4
4
  "description": "One-command bridge + tunnel for the Navigator browser — works on any machine, any OS",
5
5
  "keywords": [
6
6
  "browser",