@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.
- package/AGENTS.md +1 -1
- package/ARCHITECTURE.md +6 -6
- package/LICENSE +1 -1
- package/README.md +158 -961
- package/SECURITY.md +33 -22
- package/TROUBLESHOOTING.md +2 -2
- package/dist/cdp/bridge.js +2 -1
- package/dist/cdp/connector.d.ts +2 -0
- package/dist/cdp/connector.js +8 -4
- package/dist/cdp/helpers.d.ts +4 -0
- package/dist/cdp/helpers.js +181 -0
- package/dist/cdp/omni_broker.d.ts +1 -1
- package/dist/cdp/omni_broker.js +1 -1
- package/dist/cdp/walker.d.ts +25 -1
- package/dist/cdp/walker.js +304 -7
- package/dist/cli/plugin.js +24 -17
- package/dist/cli/updater.d.ts +1 -1
- package/dist/cli/updater.js +27 -7
- package/dist/config/loader.d.ts +8 -0
- package/dist/config/loader.js +41 -2
- package/dist/desktop/discovery.d.ts +44 -0
- package/dist/desktop/discovery.js +364 -0
- package/dist/index.js +95 -15
- 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/injector.js +2 -2
- package/dist/plugin/interface.d.ts +76 -2
- package/dist/plugin/loader.d.ts +15 -1
- package/dist/plugin/loader.js +217 -70
- package/dist/plugin/pipeline.d.ts +75 -0
- package/dist/plugin/pipeline.js +183 -0
- package/dist/plugin/registry.js +3 -2
- 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 +428 -156
- 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 +6 -0
- package/dist/state/session.js +27 -0
- package/dist/tools/browser_detect.d.ts +16 -3
- package/dist/tools/browser_detect.js +50 -5
- package/dist/tools/burst.d.ts +17 -8
- package/dist/tools/burst.js +236 -77
- 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 +74 -70
- 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.js +29 -34
- 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.js +14 -6
- 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 +107 -58
- 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 +21 -32
- package/docs/PLUGINS.md +121 -0
- package/docs/TOOLS.md +56 -0
- package/docs/architecture/blind-injection.md +83 -20
- package/docs/architecture/overview.md +49 -49
- package/docs/configuration/folders.md +55 -54
- package/docs/desktop-automation/electron-apps.md +217 -162
- package/docs/get-started/introduction.md +60 -60
- package/docs/intelligence/site-profiles.md +151 -0
- package/docs/tools/tools.md +631 -293
- package/docs/troubleshooting/trouble-loop.md +31 -31
- package/ext-dist/background.js +10 -62
- package/ext-dist/content.js +333 -920
- 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 +101 -67
- package/package.json +5 -6
- package/server.json +3 -3
- package/ext-dist/sidepanel/sidepanel.js +0 -25
- package/ext-dist/sidepanel.html +0 -547
package/dist/security/secrets.js
CHANGED
|
@@ -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
|
|
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 &&
|
package/dist/sensors/guard.js
CHANGED
|
@@ -148,9 +148,7 @@ export async function detectPageWeight(session) {
|
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
|
|
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:
|
|
162
|
-
|
|
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:
|
|
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";
|