@weavetab/mcp 2.5.0-beta.2 → 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.
Files changed (113) hide show
  1. package/AGENTS.md +1 -1
  2. package/ARCHITECTURE.md +6 -6
  3. package/LICENSE +1 -1
  4. package/README.md +158 -961
  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 +8 -4
  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.js +24 -17
  17. package/dist/cli/updater.d.ts +1 -1
  18. package/dist/cli/updater.js +27 -7
  19. package/dist/config/loader.d.ts +8 -0
  20. package/dist/config/loader.js +41 -2
  21. package/dist/desktop/discovery.d.ts +44 -0
  22. package/dist/desktop/discovery.js +364 -0
  23. package/dist/index.js +95 -15
  24. package/dist/intelligence/marks.d.ts +36 -0
  25. package/dist/intelligence/marks.js +30 -0
  26. package/dist/intelligence/patternCompiler.d.ts +118 -0
  27. package/dist/intelligence/patternCompiler.js +259 -0
  28. package/dist/intelligence/sessionMemory.d.ts +2 -0
  29. package/dist/intelligence/sessionMemory.js +18 -8
  30. package/dist/overlay/injector.js +2 -2
  31. package/dist/plugin/interface.d.ts +76 -2
  32. package/dist/plugin/loader.d.ts +15 -1
  33. package/dist/plugin/loader.js +217 -70
  34. package/dist/plugin/pipeline.d.ts +75 -0
  35. package/dist/plugin/pipeline.js +183 -0
  36. package/dist/plugin/registry.js +3 -2
  37. package/dist/security/secrets.d.ts +1 -0
  38. package/dist/security/secrets.js +13 -0
  39. package/dist/sensors/actionability.js +1 -2
  40. package/dist/sensors/guard.js +4 -10
  41. package/dist/sensors/mutations.js +12 -0
  42. package/dist/sensors/operation_monitor.js +1 -0
  43. package/dist/server.d.ts +1 -1
  44. package/dist/server.js +428 -156
  45. package/dist/state/agent.d.ts +1 -0
  46. package/dist/state/agent.js +3 -0
  47. package/dist/state/delta.d.ts +12 -4
  48. package/dist/state/delta.js +67 -14
  49. package/dist/state/session.d.ts +6 -0
  50. package/dist/state/session.js +27 -0
  51. package/dist/tools/browser_detect.d.ts +16 -3
  52. package/dist/tools/browser_detect.js +50 -5
  53. package/dist/tools/burst.d.ts +17 -8
  54. package/dist/tools/burst.js +236 -77
  55. package/dist/tools/checkpoint.d.ts +38 -0
  56. package/dist/tools/checkpoint.js +271 -0
  57. package/dist/tools/click.d.ts +1 -0
  58. package/dist/tools/click.js +74 -70
  59. package/dist/tools/design_extract.js +1 -1
  60. package/dist/tools/eval.js +1 -1
  61. package/dist/tools/fill.d.ts +20 -1
  62. package/dist/tools/fill.js +199 -40
  63. package/dist/tools/find.d.ts +16 -0
  64. package/dist/tools/find.js +67 -44
  65. package/dist/tools/github/index.d.ts +19 -4
  66. package/dist/tools/github/index.js +40 -4
  67. package/dist/tools/highlight.d.ts +6 -2
  68. package/dist/tools/highlight.js +158 -72
  69. package/dist/tools/inspect.js +1 -1
  70. package/dist/tools/key.js +65 -56
  71. package/dist/tools/navigate.js +29 -34
  72. package/dist/tools/pdf.js +21 -13
  73. package/dist/tools/pointer.d.ts +18 -3
  74. package/dist/tools/pointer.js +89 -1
  75. package/dist/tools/read.d.ts +28 -8
  76. package/dist/tools/read.js +230 -56
  77. package/dist/tools/scrape.js +67 -13
  78. package/dist/tools/screenshot.js +21 -16
  79. package/dist/tools/scroll.js +6 -11
  80. package/dist/tools/select.js +8 -2
  81. package/dist/tools/snapshot.js +3 -34
  82. package/dist/tools/tabs.js +14 -6
  83. package/dist/tools/thought.d.ts +2 -0
  84. package/dist/tools/thought.js +13 -14
  85. package/dist/tools/type.d.ts +2 -0
  86. package/dist/tools/type.js +107 -58
  87. package/dist/tools/type_secret.js +42 -76
  88. package/dist/tools/upload.js +1 -1
  89. package/dist/tools/video_compiler.d.ts +1 -1
  90. package/dist/tools/video_compiler.js +11 -12
  91. package/dist/version.d.ts +5 -0
  92. package/dist/version.js +5 -0
  93. package/docs/DOCUMENTATION.md +21 -32
  94. package/docs/PLUGINS.md +121 -0
  95. package/docs/TOOLS.md +56 -0
  96. package/docs/architecture/blind-injection.md +83 -20
  97. package/docs/architecture/overview.md +49 -49
  98. package/docs/configuration/folders.md +55 -54
  99. package/docs/desktop-automation/electron-apps.md +217 -162
  100. package/docs/get-started/introduction.md +60 -60
  101. package/docs/intelligence/site-profiles.md +151 -0
  102. package/docs/tools/tools.md +631 -293
  103. package/docs/troubleshooting/trouble-loop.md +31 -31
  104. package/ext-dist/background.js +10 -62
  105. package/ext-dist/content.js +333 -920
  106. package/ext-dist/hud/hud.js +9 -9
  107. package/ext-dist/manifest.json +2 -6
  108. package/ext-dist/styles.css +6 -1
  109. package/mcp.json +101 -67
  110. package/package.json +5 -6
  111. package/server.json +3 -3
  112. package/ext-dist/sidepanel/sidepanel.js +0 -25
  113. package/ext-dist/sidepanel.html +0 -547
@@ -357,6 +357,19 @@ class SessionSecretTrackerImpl {
357
357
  }
358
358
  return redacted;
359
359
  }
360
+ redactAll(text) {
361
+ if (!text || typeof text !== 'string')
362
+ return text;
363
+ let redacted = text;
364
+ for (const set of this.sessionSecrets.values()) {
365
+ for (const secret of set) {
366
+ if (secret && secret.length >= 3) {
367
+ redacted = redacted.split(secret).join('[REDACTED]');
368
+ }
369
+ }
370
+ }
371
+ return redacted;
372
+ }
360
373
  clearSession(sessionId) {
361
374
  this.trackedNodes.delete(sessionId);
362
375
  this.sessionSecrets.delete(sessionId);
@@ -23,7 +23,7 @@
23
23
  */
24
24
  // ── Constants ─────────────────────────────────────────────────────────────────
25
25
  /** Playwright's per-action retry backoff (ms). */
26
- const BACKOFF = [0, 20, 100, 100, 500];
26
+ const BACKOFF = [0, 20, 100];
27
27
  /**
28
28
  * 4-way scroll alignment rotation — escape sticky headers.
29
29
  * undefined = browser default (nearest), then progressively more aggressive.
@@ -121,7 +121,6 @@ function buildPageExpression(selector, scrollOptions, fingerprint, stabilityMs)
121
121
  let stable = false;
122
122
  while (Date.now() < stabilityDeadline) {
123
123
  await new Promise(r => requestAnimationFrame(r));
124
- await new Promise(r => requestAnimationFrame(r)); // two ticks like Playwright
125
124
  const cur = el.getBoundingClientRect();
126
125
  if (
127
126
  Math.abs(cur.x - prevRect.x) < 0.5 &&
@@ -148,9 +148,7 @@ export async function detectPageWeight(session) {
148
148
  };
149
149
  }
150
150
  }
151
- // ─── Navigation wait — used after clicks that trigger navigation ──────────────
152
- export async function awaitNavigation(session, timeout = 6000 // Reduced from 10000ms
153
- ) {
151
+ export async function awaitNavigation(session, timeout = 6000) {
154
152
  // Poll readyState instead of consuming one-shot event
155
153
  await pollUntil(async () => {
156
154
  const { result } = await session.Runtime.evaluate({
@@ -158,11 +156,7 @@ export async function awaitNavigation(session, timeout = 6000 // Reduced from 10
158
156
  returnByValue: true,
159
157
  }).catch(() => ({ result: { value: 'loading' } }));
160
158
  return result?.value === 'complete' || result?.value === 'interactive';
161
- }, { timeout, interval: 50 }).catch(() => {
162
- throw new Error(`Navigation timeout after ${timeout}ms`);
163
- });
164
- // After DOM content fires, detect page weight for post-load stability wait
165
- const weight = await detectPageWeight(session);
166
- const stabilityTimeout = weight.level === "heavy" ? 3000 : weight.level === "medium" ? 2000 : 1000; // Reduced from 5000/3000/2000
167
- await waitForDOMStable(session, 50, stabilityTimeout); // Reduced quiet period from 100ms
159
+ }, { timeout, interval: 30 }).catch(() => { });
160
+ // Quick 40ms settle window for hydration/initial script exec
161
+ await new Promise(r => setTimeout(r, 40));
168
162
  }
@@ -1,3 +1,4 @@
1
+ import { hookPipeline } from "../plugin/pipeline.js";
1
2
  // Heuristics for "significant" changes
2
3
  const SIGNIFICANT_TAGS = new Set(['button', 'a', 'input', 'textarea', 'select', 'h1', 'h2', 'h3', '[role="button"]', '[role="link"]']);
3
4
  const MAX_TEXT_LEN = 150;
@@ -89,5 +90,16 @@ export async function watchMutations(session, durationMs) {
89
90
  // Disabling the DOM agent automatically removes all listeners.
90
91
  await DOM.disable();
91
92
  }
93
+ if (summary.significantChange || summary.newElements.length > 0 || summary.removedElements.length > 0 || summary.attributeChanges.length > 0) {
94
+ const delta = {
95
+ type: "cdp_mutation",
96
+ timestamp: Date.now(),
97
+ added: summary.newElements.map(e => ({ backendNodeId: e.backendNodeId, tag: e.tag, text: e.text, role: e.role })),
98
+ removed: summary.removedElements.map(e => ({ backendNodeId: e.backendNodeId, tag: e.tag })),
99
+ changed: summary.attributeChanges.map(a => ({ backendNodeId: a.backendNodeId, attribute: a.attribute, newValue: a.newValue })),
100
+ significantChange: summary.significantChange,
101
+ };
102
+ hookPipeline.dispatchDOMMutation(delta, session).catch(() => { });
103
+ }
92
104
  return summary;
93
105
  }
@@ -33,6 +33,7 @@ class OperationMonitor {
33
33
  const diagnosticsTimer = setInterval(() => {
34
34
  this.checkOperationHealth(operationId);
35
35
  }, 1000); // Check every 1 second (reduced from 2s for faster detection)
36
+ diagnosticsTimer.unref();
36
37
  this.activeOperations.get(operationId).diagnosticsTimer = diagnosticsTimer;
37
38
  }
38
39
  /**
package/dist/server.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Weavetab — server.ts
3
- * MCP server: 43 browser automation tools with security, rate limiting, and visual overlay.
3
+ * MCP server: 44 browser automation tools with security, rate limiting, and visual overlay.
4
4
  * Weavetab by fy2ne
5
5
  */
6
6
  import type { Config } from "./config/loader.js";