@weavetab/mcp 2.5.0-beta.1 → 2.5.0-beta.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.
- package/AGENTS.md +2 -1
- package/ARCHITECTURE.md +6 -6
- package/LICENSE +1 -1
- package/README.md +164 -802
- package/SECURITY.md +33 -22
- package/TROUBLESHOOTING.md +3 -3
- package/dist/cdp/bridge.d.ts +10 -0
- package/dist/cdp/bridge.js +285 -78
- package/dist/cdp/connector.d.ts +7 -3
- package/dist/cdp/connector.js +196 -75
- package/dist/cdp/helpers.d.ts +4 -0
- package/dist/cdp/helpers.js +181 -0
- package/dist/cdp/lock.d.ts +9 -6
- package/dist/cdp/lock.js +72 -59
- package/dist/cdp/omni_broker.d.ts +2 -1
- package/dist/cdp/omni_broker.js +13 -7
- package/dist/cdp/profiles.d.ts +10 -0
- package/dist/cdp/profiles.js +65 -0
- package/dist/cdp/walker.d.ts +25 -1
- package/dist/cdp/walker.js +354 -7
- package/dist/cli/plugin.d.ts +0 -2
- package/dist/cli/plugin.js +51 -696
- package/dist/cli/updater.d.ts +1 -1
- package/dist/cli/updater.js +27 -7
- package/dist/config/loader.d.ts +33 -6
- package/dist/config/loader.js +174 -22
- package/dist/desktop/discovery.d.ts +44 -0
- package/dist/desktop/discovery.js +364 -0
- package/dist/index.js +140 -64
- package/dist/intelligence/marks.d.ts +36 -0
- package/dist/intelligence/marks.js +30 -0
- package/dist/intelligence/patternCompiler.d.ts +118 -0
- package/dist/intelligence/patternCompiler.js +259 -0
- package/dist/intelligence/sessionMemory.d.ts +2 -0
- package/dist/intelligence/sessionMemory.js +18 -8
- package/dist/overlay/ghost.js +2 -2
- package/dist/overlay/injector.js +3 -5
- package/dist/plugin/extension_bridge.d.ts +40 -0
- package/dist/plugin/extension_bridge.js +158 -0
- package/dist/plugin/interface.d.ts +151 -15
- package/dist/plugin/loader.d.ts +19 -1
- package/dist/plugin/loader.js +331 -63
- package/dist/plugin/pipeline.d.ts +75 -0
- package/dist/plugin/pipeline.js +183 -0
- package/dist/plugin/registry.js +12 -1
- package/dist/plugin/storage.d.ts +51 -0
- package/dist/plugin/storage.js +164 -0
- package/dist/security/secrets.d.ts +1 -0
- package/dist/security/secrets.js +13 -0
- package/dist/sensors/actionability.js +1 -2
- package/dist/sensors/guard.js +4 -10
- package/dist/sensors/mutations.js +12 -0
- package/dist/sensors/operation_monitor.js +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.js +600 -236
- package/dist/state/agent.d.ts +1 -0
- package/dist/state/agent.js +3 -0
- package/dist/state/delta.d.ts +12 -4
- package/dist/state/delta.js +67 -14
- package/dist/state/session.d.ts +8 -2
- package/dist/state/session.js +60 -13
- package/dist/tools/browser_detect.d.ts +16 -2
- package/dist/tools/browser_detect.js +54 -6
- package/dist/tools/burst.d.ts +17 -7
- package/dist/tools/burst.js +240 -83
- package/dist/tools/checkpoint.d.ts +38 -0
- package/dist/tools/checkpoint.js +271 -0
- package/dist/tools/click.d.ts +1 -0
- package/dist/tools/click.js +97 -98
- package/dist/tools/clipboard.js +31 -24
- package/dist/tools/design_extract.js +1 -1
- package/dist/tools/eval.js +1 -1
- package/dist/tools/fill.d.ts +20 -1
- package/dist/tools/fill.js +199 -40
- package/dist/tools/find.d.ts +16 -0
- package/dist/tools/find.js +67 -44
- package/dist/tools/github/index.d.ts +19 -4
- package/dist/tools/github/index.js +40 -4
- package/dist/tools/highlight.d.ts +6 -2
- package/dist/tools/highlight.js +158 -72
- package/dist/tools/inspect.js +1 -1
- package/dist/tools/key.js +65 -56
- package/dist/tools/navigate.d.ts +1 -1
- package/dist/tools/navigate.js +57 -44
- package/dist/tools/pdf.js +21 -13
- package/dist/tools/pointer.d.ts +18 -3
- package/dist/tools/pointer.js +89 -1
- package/dist/tools/read.d.ts +28 -8
- package/dist/tools/read.js +230 -56
- package/dist/tools/scrape.js +67 -13
- package/dist/tools/screenshot.js +21 -16
- package/dist/tools/scroll.js +6 -11
- package/dist/tools/select.js +8 -2
- package/dist/tools/snapshot.js +3 -34
- package/dist/tools/tabs.d.ts +10 -10
- package/dist/tools/tabs.js +55 -39
- package/dist/tools/thought.d.ts +2 -0
- package/dist/tools/thought.js +13 -14
- package/dist/tools/type.d.ts +2 -0
- package/dist/tools/type.js +109 -60
- package/dist/tools/type_secret.js +42 -76
- package/dist/tools/upload.js +1 -1
- package/dist/tools/video_compiler.d.ts +1 -1
- package/dist/tools/video_compiler.js +11 -12
- package/dist/version.d.ts +5 -0
- package/dist/version.js +5 -0
- package/docs/DOCUMENTATION.md +82 -36
- package/docs/PLUGINS.md +82 -499
- package/docs/TOOLS.md +51 -99
- package/docs/architecture/blind-injection.md +83 -0
- package/docs/architecture/dual-injection.md +32 -0
- package/docs/architecture/overview.md +49 -0
- package/docs/architecture/security.md +35 -0
- package/docs/architecture/transport.md +37 -0
- package/docs/captcha-stealth/captcha-solver.md +75 -0
- package/docs/captcha-stealth/stealth-physics.md +60 -0
- package/docs/cli/cli-commands.md +44 -0
- package/docs/cli/cli-flags.md +20 -0
- package/docs/cli/cli-introduction.md +20 -0
- package/docs/cli/cli-scripting.md +32 -0
- package/docs/cli/g-ide/ide-antigravity.md +24 -0
- package/docs/cli/g-ide/ide-claude-code.md +24 -0
- package/docs/cli/g-ide/ide-claude-desktop.md +32 -0
- package/docs/cli/g-ide/ide-cursor.md +31 -0
- package/docs/cli/g-ide/ide-generic.md +34 -0
- package/docs/cli/g-ide/ide-opencode.md +24 -0
- package/docs/cli/g-ide/ide-vscode-copilot.md +24 -0
- package/docs/cli/g-ide/ide-windsurf.md +24 -0
- package/docs/configuration/config-locations.md +24 -0
- package/docs/configuration/configuration.md +73 -0
- package/docs/configuration/env-variables.md +19 -0
- package/docs/configuration/folders.md +55 -0
- package/docs/desktop-automation/electron-apps.md +217 -0
- package/docs/get-started/installation.md +47 -0
- package/docs/get-started/introduction.md +60 -0
- package/docs/get-started/quickstart.md +54 -0
- package/docs/get-started/setup-wizard.md +26 -0
- package/docs/intelligence/site-profiles.md +151 -0
- package/docs/skills-ecosystem/skills-overview.md +35 -0
- package/docs/skills-ecosystem/skills-recipes.md +36 -0
- package/docs/tools/tools.md +631 -0
- package/docs/troubleshooting/trouble-browser.md +27 -0
- package/docs/troubleshooting/trouble-config.md +20 -0
- package/docs/troubleshooting/trouble-loop.md +31 -0
- package/ext-dist/background.js +10 -62
- package/ext-dist/content.js +333 -921
- package/ext-dist/hud/hud.js +9 -9
- package/ext-dist/manifest.json +2 -6
- package/ext-dist/styles.css +6 -1
- package/mcp.json +108 -72
- package/package.json +14 -9
- package/server.json +3 -3
- package/docs/DEV_MODE.md +0 -68
- package/docs/dev_plugin.md +0 -310
- package/ext-dist/sidepanel/sidepanel.js +0 -25
- package/ext-dist/sidepanel.html +0 -547
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: "Loop Detection"
|
|
3
|
+
description: "When the agent gets stuck in an action loop."
|
|
4
|
+
product: mcp
|
|
5
|
+
section: troubleshooting
|
|
6
|
+
icon: RotateCcw
|
|
7
|
+
slug: trouble-loop
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
# Loop Detection Diagnostics
|
|
11
|
+
|
|
12
|
+
## Symptoms
|
|
13
|
+
|
|
14
|
+
A tool call returns `stuck_warning: true` or `STUCK_LOOP_WARNING`.
|
|
15
|
+
|
|
16
|
+
## Cause
|
|
17
|
+
|
|
18
|
+
Weavetab tracks a rolling 50-action window in `~/.weavetab-system/sessions/context.json`. If repeated identical actions fail to produce DOM state changes, strikes are accumulated:
|
|
19
|
+
|
|
20
|
+
| Strikes | Severity | System Behavior |
|
|
21
|
+
|---|---|---|
|
|
22
|
+
| < 5 | Normal | Standard execution |
|
|
23
|
+
| 5–9 | Warning | Warning hint injected into agent context |
|
|
24
|
+
| 10+ | Critical | Agent marked as `stuck`; recovery strategy triggered |
|
|
25
|
+
|
|
26
|
+
## Resolution
|
|
27
|
+
|
|
28
|
+
1. Call `browser_map({ force: true })` or `browser_wait({ reset_loop: true })` to clear strikes
|
|
29
|
+
2. Call `browser_map({ delta: true })` to verify if DOM elements actually changed
|
|
30
|
+
3. Call `browser_inspect` to check if target element is hidden or occluded by modals
|
|
31
|
+
4. Use `browser_wait({ for: "stable" })` before triggering inputs
|
package/ext-dist/background.js
CHANGED
|
@@ -1,21 +1,6 @@
|
|
|
1
1
|
const browserAPI = typeof browser !== 'undefined' ? browser : chrome;
|
|
2
2
|
|
|
3
|
-
//
|
|
4
|
-
if (browserAPI.sidePanel) {
|
|
5
|
-
browserAPI.sidePanel
|
|
6
|
-
.setPanelBehavior({ openPanelOnActionClick: true })
|
|
7
|
-
.catch((error) => console.error(error));
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
// ── Browser Startup: auto-open sidepanel ────────────────────────
|
|
11
|
-
// Clear minimized state on browser launch so sidepanel opens automatically
|
|
12
|
-
browserAPI.runtime.onStartup.addListener(function() {
|
|
13
|
-
try { browserAPI.storage.local.remove('wt_panel_minimized'); } catch(e) {}
|
|
14
|
-
});
|
|
15
|
-
// Also clear on install (first launch)
|
|
16
|
-
browserAPI.runtime.onInstalled.addListener(function() {
|
|
17
|
-
try { browserAPI.storage.local.remove('wt_panel_minimized'); } catch(e) {}
|
|
18
|
-
});
|
|
3
|
+
// HUD toggle command handler
|
|
19
4
|
|
|
20
5
|
// HUD toggle command handler
|
|
21
6
|
browserAPI.commands.onCommand.addListener(function(command) {
|
|
@@ -41,24 +26,6 @@ const anchorTabs = new Set();
|
|
|
41
26
|
let currentGroupState = 'idle';
|
|
42
27
|
let activeSessionTabId = null;
|
|
43
28
|
|
|
44
|
-
// ── Sidepanel Open/Close Tracking ────────────────────────────────────────────
|
|
45
|
-
let isSidepanelOpen = false;
|
|
46
|
-
browserAPI.runtime.onConnect.addListener(function(port) {
|
|
47
|
-
if (port.name === 'wt-sidepanel') {
|
|
48
|
-
isSidepanelOpen = true;
|
|
49
|
-
// Notify all controlled tabs so HUD can suppress browser_thought pill
|
|
50
|
-
controlledTabs.forEach(tabId => {
|
|
51
|
-
browserAPI.tabs.sendMessage(tabId, { type: 'WT_SIDEPANEL_STATE', open: true }).catch(() => {});
|
|
52
|
-
});
|
|
53
|
-
port.onDisconnect.addListener(function() {
|
|
54
|
-
isSidepanelOpen = false;
|
|
55
|
-
controlledTabs.forEach(tabId => {
|
|
56
|
-
browserAPI.tabs.sendMessage(tabId, { type: 'WT_SIDEPANEL_STATE', open: false }).catch(() => {});
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
29
|
// State color mapping — always blue, never yellow
|
|
63
30
|
const STATE_COLORS = {
|
|
64
31
|
idle: 'grey',
|
|
@@ -145,33 +112,18 @@ function refreshStateTimeout() {
|
|
|
145
112
|
}
|
|
146
113
|
|
|
147
114
|
// Bridge: relay state from CLI (via CDP executeScript) to content scripts
|
|
148
|
-
// ── Sidepanel broadcast ─────────────────────────────────────────────────────
|
|
149
|
-
// Routes agent-activity messages (tool calls, thoughts, status) to the sidepanel
|
|
150
|
-
// so all visual state lives there, not in in-page overlays.
|
|
151
|
-
function broadcastToSidepanel(msg) {
|
|
152
|
-
browserAPI.runtime.sendMessage(msg).catch(() => {}); // sidepanel listens on runtime
|
|
153
|
-
}
|
|
154
|
-
|
|
155
115
|
browserAPI.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|
156
|
-
// ── Forward tool call events to
|
|
116
|
+
// ── Forward tool call events to active tabs ──
|
|
157
117
|
if (message.type === 'TOOL_CALL_EVENT') {
|
|
158
|
-
|
|
118
|
+
controlledTabs.forEach(tabId => {
|
|
119
|
+
browserAPI.tabs.sendMessage(tabId, message).catch(() => {});
|
|
120
|
+
});
|
|
159
121
|
}
|
|
160
|
-
// ──
|
|
161
|
-
// browser_thought (kind='thought') → sidepanel when open, HUD when closed
|
|
162
|
-
// Scripted pill suppression is handled in the HUD via WT_SIDEPANEL_STATE
|
|
122
|
+
// ── Thought routing: relay to HUD in controlled tabs ──
|
|
163
123
|
if (message.type === 'WT_THOUGHT') {
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
// Tell the HUD iframe in the active tab to suppress the browser_thought pill
|
|
168
|
-
if (sender.tab && sender.tab.id) {
|
|
169
|
-
browserAPI.tabs.sendMessage(sender.tab.id, { type: 'WT_SUPPRESS_THOUGHT_HUD' }).catch(() => {});
|
|
170
|
-
}
|
|
171
|
-
} else {
|
|
172
|
-
// Sidepanel closed — let the HUD handle it normally via the iframe relay
|
|
173
|
-
broadcastToSidepanel({ type: 'WT_THOUGHT', text: message.text, kind: message.kind });
|
|
174
|
-
}
|
|
124
|
+
controlledTabs.forEach(tabId => {
|
|
125
|
+
browserAPI.tabs.sendMessage(tabId, { type: 'WT_THOUGHT', text: message.text, kind: message.kind }).catch(() => {});
|
|
126
|
+
});
|
|
175
127
|
}
|
|
176
128
|
|
|
177
129
|
// ── User messaging ──
|
|
@@ -206,7 +158,6 @@ browserAPI.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|
|
206
158
|
}
|
|
207
159
|
|
|
208
160
|
if (message.type === 'Weavetab_STATE') {
|
|
209
|
-
broadcastToSidepanel(message);
|
|
210
161
|
controlledTabs.forEach(tabId => {
|
|
211
162
|
browserAPI.tabs.sendMessage(tabId, message).catch(() => {});
|
|
212
163
|
});
|
|
@@ -248,9 +199,6 @@ browserAPI.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|
|
248
199
|
browserAPI.tabs.sendMessage(tabId, { type: 'Weavetab_GROUP_STATE', state, isActive: tabId === activeSessionTabId }).catch(() => {});
|
|
249
200
|
});
|
|
250
201
|
|
|
251
|
-
// ── Mirror to sidepanel status dot ──
|
|
252
|
-
broadcastToSidepanel({ type: 'WT_AGENT_STATUS', status: state });
|
|
253
|
-
|
|
254
202
|
sendResponse({ ok: true });
|
|
255
203
|
}
|
|
256
204
|
if (message.type === 'REGISTER_TAB') {
|
|
@@ -289,7 +237,7 @@ browserAPI.runtime.onMessage.addListener((message, sender, sendResponse) => {
|
|
|
289
237
|
sendResponse({ ok: true });
|
|
290
238
|
}
|
|
291
239
|
|
|
292
|
-
// ── User feedback relay:
|
|
240
|
+
// ── User feedback relay: content script → storage queue ───────────────────
|
|
293
241
|
// CDP polls window.__Weavetab.popUserFeedback() or window.__wt_chat_queue which reads from this queue.
|
|
294
242
|
if (message.type === 'USER_FEEDBACK' || message.type === 'WT_USER_NOTE') {
|
|
295
243
|
if (message.text || message.snipe) {
|