ghost-bridge 0.5.0 → 0.5.2

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/README.md CHANGED
@@ -27,22 +27,38 @@
27
27
  # Install globally
28
28
  npm install -g ghost-bridge
29
29
 
30
- # Auto-configure MCP (Claude Code, Antigravity, Codex) and prepare the extension directory
30
+ # Auto-configure MCP (Claude Code, Codex, Cursor, Antigravity) and prepare the extension directory
31
31
  ghost-bridge init
32
32
  ```
33
33
 
34
- > **Note on other MCP clients (Cursor, Windsurf, Roo):**
35
- > `ghost-bridge init` attempts to auto-configure supported clients. If your client isn't auto-detected, simply add the following to your client's MCP configuration file (e.g., `mcp.json`):
34
+ > `ghost-bridge init` currently writes:
35
+ > - Claude Code: `~/.claude/settings.json` or legacy `~/.claude.json`
36
+ > - Codex: `~/.codex/config.toml`
37
+ > - Cursor: `~/.cursor/mcp.json`
38
+ > - Antigravity: `~/.gemini/antigravity/mcp.json`
39
+ >
40
+ > **Note on other MCP clients (Windsurf, Roo, others):**
41
+ > `ghost-bridge init` attempts to auto-configure supported clients. If your client isn't auto-detected, add one of the following snippets to the appropriate MCP configuration file:
42
+ >
43
+ > JSON-style MCP configs (`mcp.json`, Claude JSON config, Cursor):
36
44
  > ```json
37
45
  > {
38
46
  > "mcpServers": {
39
47
  > "ghost-bridge": {
40
- > "command": "node",
48
+ > "command": "/absolute/path/to/node",
41
49
  > "args": ["/absolute/path/to/global/node_modules/ghost-bridge/dist/server.js"]
42
50
  > }
43
51
  > }
44
52
  > }
45
53
  > ```
54
+ >
55
+ > Codex TOML config (`~/.codex/config.toml`):
56
+ > ```toml
57
+ > [mcp_servers.ghost-bridge]
58
+ > type = "stdio"
59
+ > command = "/absolute/path/to/node"
60
+ > args = ["/absolute/path/to/global/node_modules/ghost-bridge/dist/server.js"]
61
+ > ```
46
62
 
47
63
  ### 2. Load the Chrome Extension
48
64
 
@@ -59,6 +75,13 @@ ghost-bridge init
59
75
  2. Click **Connect** and wait for the status to turn to ✅ **ON**.
60
76
  3. Open Claude Desktop or your Claude CLI. All tools are now primed and ready!
61
77
 
78
+ **Prompting tips:**
79
+ - You usually do not need to say "please use ghost-bridge". Direct requests like `分析当前页面`、`看看这个网站的 DOM 结构`、`帮我检查这个页面为什么布局错了`、`帮我点击登录按钮并提交表单` should be enough.
80
+ - `inspect_page` is the default entry tool for generic page analysis.
81
+ - For visual/UI issues, the model should prefer `capture_screenshot`.
82
+ - For text/DOM extraction, the model should prefer `get_page_content`.
83
+ - For page actions, the model should start with `get_interactive_snapshot` and then call `dispatch_action`.
84
+
62
85
  ---
63
86
 
64
87
  ## 🛠️ Tool Arsenal
@@ -67,6 +90,7 @@ ghost-bridge init
67
90
 
68
91
  | Tool | Capability |
69
92
  |------|------------|
93
+ | `inspect_page` | Best default entry for page analysis. Returns metadata, structured content, and an interactive-elements overview. |
70
94
  | `get_server_info` | Retrieves server instance status, WebSocket ports, and client roles. |
71
95
  | `get_last_error` | Aggregates recent exceptions, console errors, and failed network requests with mapped locators. |
72
96
  | `get_script_source` | Pulls raw script definitions. Supports URL-fragment filtering, specific line targeting, and beautification. |
@@ -115,7 +139,7 @@ ghost-bridge init
115
139
 
116
140
  | Setting | Default | Description |
117
141
  |---------|---------|-------------|
118
- | **Base Port** | `33333` | WS port. Auto-increments if occupied. |
142
+ | **Base Port** | `33333` | Fixed WS port. If occupied, Ghost Bridge fails fast and asks you to free it or set `GHOST_BRIDGE_PORT`. |
119
143
  | **Token** | *Monthly UUID* | Local WS auth token, auto-rotates on the 1st of every month. |
120
144
  | **Auto Detach** | `false` | Keeps debugger attached to actively buffer invisible exceptions and network calls. |
121
145