@weavetab/mcp 2.5.0-beta.2 → 2.5.0-beta.5

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 (127) hide show
  1. package/AGENTS.md +1 -1
  2. package/ARCHITECTURE.md +6 -6
  3. package/LICENSE +216 -631
  4. package/README.md +153 -1074
  5. package/SECURITY.md +33 -22
  6. package/TROUBLESHOOTING.md +2 -2
  7. package/dist/cdp/bridge.js +2 -1
  8. package/dist/cdp/connector.d.ts +2 -0
  9. package/dist/cdp/connector.js +10 -6
  10. package/dist/cdp/helpers.d.ts +4 -0
  11. package/dist/cdp/helpers.js +181 -0
  12. package/dist/cdp/omni_broker.d.ts +1 -1
  13. package/dist/cdp/omni_broker.js +1 -1
  14. package/dist/cdp/walker.d.ts +25 -1
  15. package/dist/cdp/walker.js +304 -7
  16. package/dist/cli/plugin.d.ts +1 -0
  17. package/dist/cli/plugin.js +81 -18
  18. package/dist/cli/updater.d.ts +1 -1
  19. package/dist/cli/updater.js +27 -7
  20. package/dist/config/loader.d.ts +9 -1
  21. package/dist/config/loader.js +42 -3
  22. package/dist/desktop/discovery.d.ts +44 -0
  23. package/dist/desktop/discovery.js +364 -0
  24. package/dist/index.js +137 -21
  25. package/dist/intelligence/marks.d.ts +36 -0
  26. package/dist/intelligence/marks.js +30 -0
  27. package/dist/intelligence/patternCompiler.d.ts +118 -0
  28. package/dist/intelligence/patternCompiler.js +259 -0
  29. package/dist/intelligence/sessionMemory.d.ts +2 -0
  30. package/dist/intelligence/sessionMemory.js +18 -8
  31. package/dist/overlay/injector.js +2 -2
  32. package/dist/plugin/interface.d.ts +88 -5
  33. package/dist/plugin/loader.d.ts +12 -1
  34. package/dist/plugin/loader.js +280 -70
  35. package/dist/plugin/pipeline.d.ts +75 -0
  36. package/dist/plugin/pipeline.js +183 -0
  37. package/dist/plugin/registry.d.ts +2 -1
  38. package/dist/plugin/registry.js +24 -14
  39. package/dist/security/secrets.d.ts +7 -0
  40. package/dist/security/secrets.js +37 -0
  41. package/dist/sensors/actionability.js +1 -2
  42. package/dist/sensors/guard.js +4 -10
  43. package/dist/sensors/mutations.js +12 -0
  44. package/dist/sensors/operation_monitor.js +1 -0
  45. package/dist/server.d.ts +1 -1
  46. package/dist/server.js +453 -178
  47. package/dist/state/agent.d.ts +1 -0
  48. package/dist/state/agent.js +3 -0
  49. package/dist/state/delta.d.ts +12 -4
  50. package/dist/state/delta.js +67 -14
  51. package/dist/state/session.d.ts +6 -0
  52. package/dist/state/session.js +27 -0
  53. package/dist/tools/browser_detect.d.ts +16 -3
  54. package/dist/tools/browser_detect.js +52 -7
  55. package/dist/tools/burst.d.ts +17 -8
  56. package/dist/tools/burst.js +236 -77
  57. package/dist/tools/captcha.js +1 -1
  58. package/dist/tools/checkpoint.d.ts +38 -0
  59. package/dist/tools/checkpoint.js +271 -0
  60. package/dist/tools/click.d.ts +1 -0
  61. package/dist/tools/click.js +74 -70
  62. package/dist/tools/design_extract.js +1 -1
  63. package/dist/tools/eval.js +1 -1
  64. package/dist/tools/fill.d.ts +20 -1
  65. package/dist/tools/fill.js +199 -40
  66. package/dist/tools/find.d.ts +16 -0
  67. package/dist/tools/find.js +67 -44
  68. package/dist/tools/github/index.d.ts +19 -4
  69. package/dist/tools/github/index.js +40 -4
  70. package/dist/tools/highlight.d.ts +6 -2
  71. package/dist/tools/highlight.js +158 -72
  72. package/dist/tools/inspect.js +1 -1
  73. package/dist/tools/key.js +65 -56
  74. package/dist/tools/navigate.d.ts +1 -1
  75. package/dist/tools/navigate.js +34 -39
  76. package/dist/tools/pdf.js +21 -13
  77. package/dist/tools/pointer.d.ts +18 -3
  78. package/dist/tools/pointer.js +89 -1
  79. package/dist/tools/read.d.ts +28 -8
  80. package/dist/tools/read.js +230 -56
  81. package/dist/tools/scrape.js +67 -13
  82. package/dist/tools/screenshot.js +21 -16
  83. package/dist/tools/scroll.js +6 -11
  84. package/dist/tools/select.js +8 -2
  85. package/dist/tools/snapshot.js +3 -34
  86. package/dist/tools/tabs.js +15 -7
  87. package/dist/tools/thought.d.ts +2 -0
  88. package/dist/tools/thought.js +13 -14
  89. package/dist/tools/type.d.ts +2 -0
  90. package/dist/tools/type.js +107 -58
  91. package/dist/tools/type_secret.js +42 -76
  92. package/dist/tools/upload.js +1 -1
  93. package/dist/tools/video_compiler.d.ts +1 -1
  94. package/dist/tools/video_compiler.js +11 -12
  95. package/dist/version.d.ts +5 -0
  96. package/dist/version.js +5 -0
  97. package/docs/DOCUMENTATION.md +37 -41
  98. package/docs/PLUGINS.md +121 -0
  99. package/docs/TOOLS.md +54 -0
  100. package/docs/architecture/blind-injection.md +83 -20
  101. package/docs/architecture/overview.md +49 -49
  102. package/docs/architecture/security.md +8 -7
  103. package/docs/architecture/transport.md +2 -2
  104. package/docs/cli/cli-commands.md +7 -1
  105. package/docs/cli/cli-flags.md +15 -7
  106. package/docs/cli/cli-scripting.md +6 -3
  107. package/docs/configuration/config-locations.md +3 -4
  108. package/docs/configuration/env-variables.md +4 -4
  109. package/docs/configuration/folders.md +55 -54
  110. package/docs/desktop-automation/electron-apps.md +214 -162
  111. package/docs/get-started/introduction.md +60 -60
  112. package/docs/get-started/setup-wizard.md +7 -6
  113. package/docs/intelligence/site-profiles.md +151 -0
  114. package/docs/tools/tools.md +631 -293
  115. package/docs/troubleshooting/trouble-browser.md +1 -1
  116. package/docs/troubleshooting/trouble-loop.md +31 -31
  117. package/ext-dist/background.js +10 -62
  118. package/ext-dist/content.js +333 -920
  119. package/ext-dist/hud/hud.js +9 -9
  120. package/ext-dist/manifest.json +2 -6
  121. package/ext-dist/styles.css +6 -1
  122. package/icon.png +0 -0
  123. package/mcp.json +87 -71
  124. package/package.json +118 -119
  125. package/server.json +5 -5
  126. package/ext-dist/sidepanel/sidepanel.js +0 -25
  127. package/ext-dist/sidepanel.html +0 -547
@@ -24,4 +24,4 @@ slug: trouble-browser
24
24
 
25
25
  **Fixes:**
26
26
  1. Run `weavetab reset` to purge corrupted profiles
27
- 2. Check `CHROME_PATH` environment variable points to a valid Chromium executable
27
+ 2. Run `weavetab config` and set the browser executable path (or `browserPath: "auto"` to detect)
@@ -1,31 +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_reset_loop_counter({ reason: "new_task" })` 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
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
@@ -1,21 +1,6 @@
1
1
  const browserAPI = typeof browser !== 'undefined' ? browser : chrome;
2
2
 
3
- // Allow users to open the side panel by clicking on the action toolbar icon
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 sidepanel ──
116
+ // ── Forward tool call events to active tabs ──
157
117
  if (message.type === 'TOOL_CALL_EVENT') {
158
- broadcastToSidepanel({ type: 'TOOL_CALL_EVENT', payload: message.payload });
118
+ controlledTabs.forEach(tabId => {
119
+ browserAPI.tabs.sendMessage(tabId, message).catch(() => {});
120
+ });
159
121
  }
160
- // ── Smart thought routing ──
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
- if (isSidepanelOpen) {
165
- // Route to sidepanel only — suppress HUD rendering
166
- broadcastToSidepanel({ type: 'WT_THOUGHT', text: message.text, kind: message.kind });
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: sidepanel / content script → storage queue ────────
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) {