@weavetab/mcp 2.5.0-beta.5 → 2.5.1
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 +49 -49
- package/ARCHITECTURE.md +590 -590
- package/README.md +216 -100
- package/SECURITY.md +207 -207
- package/TROUBLESHOOTING.md +373 -365
- package/dist/anticaptcha/detector.js +395 -395
- package/dist/anticaptcha/solver.js +130 -130
- package/dist/cdp/bridge.js +73 -73
- package/dist/cdp/connector.js +46 -22
- package/dist/cdp/extension.js +34 -34
- package/dist/cdp/helpers.js +174 -174
- package/dist/cdp/pruner.js +195 -195
- package/dist/cdp/ref_cache.js +66 -66
- package/dist/cdp/security.js +10 -10
- package/dist/cdp/verify.js +57 -57
- package/dist/cdp/walker.js +563 -525
- package/dist/cli/plugin.js +26 -3
- package/dist/config/loader.d.ts +0 -3
- package/dist/config/loader.js +0 -9
- package/dist/index.js +0 -4
- package/dist/intelligence/intent.js +81 -81
- package/dist/intelligence/sessionMemory.js +2 -2
- package/dist/overlay/ghost.js +22 -22
- package/dist/overlay/injector.js +89 -89
- package/dist/plugin/extension_bridge.js +54 -54
- package/dist/plugin/interface.d.ts +7 -0
- package/dist/plugin/loader.js +3 -4
- package/dist/plugin/schema.d.ts +11 -0
- package/dist/plugin/schema.js +59 -0
- package/dist/security/guard.js +18 -18
- package/dist/sensors/actionability.js +167 -167
- package/dist/sensors/guard.js +29 -29
- package/dist/sensors/network.js +15 -17
- package/dist/server.d.ts +1 -1
- package/dist/server.js +173 -144
- package/dist/state/delta.js +6 -7
- package/dist/tools/automation.js +85 -85
- package/dist/tools/canvas.js +48 -25
- package/dist/tools/checkpoint.js +94 -35
- package/dist/tools/click.js +52 -41
- package/dist/tools/clipboard.js +80 -74
- package/dist/tools/design_extract.js +441 -441
- package/dist/tools/dialog.js +13 -13
- package/dist/tools/emulation.d.ts +2 -0
- package/dist/tools/emulation.js +7 -0
- package/dist/tools/fill.js +344 -347
- package/dist/tools/find.js +78 -52
- package/dist/tools/highlight.js +67 -67
- package/dist/tools/inspect.js +54 -25
- package/dist/tools/key.js +42 -35
- package/dist/tools/navigate.d.ts +1 -1
- package/dist/tools/navigate.js +35 -35
- package/dist/tools/office/parse.js +62 -18
- package/dist/tools/pdf.d.ts +9 -0
- package/dist/tools/pdf.js +7 -4
- package/dist/tools/performance.d.ts +11 -4
- package/dist/tools/performance.js +94 -42
- package/dist/tools/performance_test.d.ts +2 -2
- package/dist/tools/performance_test.js +69 -69
- package/dist/tools/pointer.js +116 -116
- package/dist/tools/read.js +99 -67
- package/dist/tools/recording.js +9 -0
- package/dist/tools/scrape.js +146 -146
- package/dist/tools/screenshot.d.ts +2 -0
- package/dist/tools/screenshot.js +46 -4
- package/dist/tools/scroll.d.ts +3 -1
- package/dist/tools/scroll.js +13 -15
- package/dist/tools/select.d.ts +3 -0
- package/dist/tools/select.js +131 -124
- package/dist/tools/snapshot.js +8 -6
- package/dist/tools/storage.d.ts +5 -1
- package/dist/tools/storage.js +16 -0
- package/dist/tools/tabs.d.ts +7 -5
- package/dist/tools/tabs.js +79 -26
- package/dist/tools/thought.js +8 -8
- package/dist/tools/type.js +274 -274
- package/dist/tools/type_secret.js +23 -23
- package/dist/tools/upload.js +3 -3
- package/dist/tools/video_compiler.js +9 -0
- package/dist/tools/wait.js +35 -35
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/docs/DOCUMENTATION.md +583 -585
- package/docs/PLUGINS.md +139 -121
- package/docs/TOOLS.md +3 -4
- package/docs/architecture/blind-injection.md +83 -83
- package/docs/architecture/overview.md +49 -49
- package/docs/configuration/configuration.md +39 -27
- package/docs/configuration/folders.md +62 -55
- package/docs/desktop-automation/electron-apps.md +225 -214
- package/docs/get-started/installation.md +1 -1
- package/docs/get-started/introduction.md +60 -60
- package/docs/get-started/quickstart.md +2 -2
- package/docs/get-started/setup-wizard.md +1 -1
- package/docs/intelligence/site-profiles.md +151 -151
- package/docs/tools/tools.md +582 -631
- package/docs/troubleshooting/trouble-loop.md +31 -31
- package/ext-dist/background.js +415 -415
- package/ext-dist/content.js +2527 -2527
- package/ext-dist/dashboard.html +583 -583
- package/ext-dist/hud/hud.js +3 -3
- package/ext-dist/hud/index.html +20 -20
- package/ext-dist/manifest.json +73 -73
- package/ext-dist/styles.css +223 -223
- package/mcp.json +796 -805
- package/package.json +8 -8
- package/server.json +23 -23
- package/smithery.yaml +7 -11
- package/dist/cdp/walker.test.d.ts +0 -2
- package/dist/cdp/walker.test.js +0 -172
- package/dist/intelligence/sessionMemory.test.d.ts +0 -2
- package/dist/intelligence/sessionMemory.test.js +0 -62
- package/dist/intelligence/trail.test.d.ts +0 -2
- package/dist/intelligence/trail.test.js +0 -110
- package/dist/state/cache.test.d.ts +0 -2
- package/dist/state/cache.test.js +0 -76
- package/dist/state/delta.test.d.ts +0 -2
- package/dist/state/delta.test.js +0 -279
- package/dist/state/groups.d.ts +0 -15
- package/dist/state/groups.js +0 -80
- package/dist/tools/accessibility.d.ts +0 -14
- package/dist/tools/accessibility.js +0 -32
- package/dist/tools/ask.d.ts +0 -14
- package/dist/tools/ask.js +0 -49
- package/dist/tools/click_and_wait.d.ts +0 -33
- package/dist/tools/click_and_wait.js +0 -149
- package/dist/tools/drag.d.ts +0 -15
- package/dist/tools/drag.js +0 -29
- package/dist/tools/geo.d.ts +0 -19
- package/dist/tools/geo.js +0 -29
- package/dist/tools/github/analyze.d.ts +0 -4
- package/dist/tools/github/analyze.js +0 -113
- package/dist/tools/github/cache.d.ts +0 -21
- package/dist/tools/github/cache.js +0 -28
- package/dist/tools/github/index.d.ts +0 -19
- package/dist/tools/github/index.js +0 -40
- package/dist/tools/github/issues.d.ts +0 -9
- package/dist/tools/github/issues.js +0 -88
- package/dist/tools/github/pr.d.ts +0 -5
- package/dist/tools/github/pr.js +0 -88
- package/dist/tools/github/rateLimiter.d.ts +0 -4
- package/dist/tools/github/rateLimiter.js +0 -46
- package/dist/tools/github/read.d.ts +0 -34
- package/dist/tools/github/read.js +0 -74
- package/dist/tools/github/repoContext.d.ts +0 -20
- package/dist/tools/github/repoContext.js +0 -129
- package/dist/tools/hover.d.ts +0 -19
- package/dist/tools/hover.js +0 -57
- package/dist/tools/integration.test.d.ts +0 -2
- package/dist/tools/integration.test.js +0 -96
- package/dist/tools/macro_compiler.d.ts +0 -7
- package/dist/tools/macro_compiler.js +0 -82
- package/dist/tools/mouse.d.ts +0 -21
- package/dist/tools/mouse.js +0 -62
- package/dist/tools/response.d.ts +0 -129
- package/dist/tools/response.js +0 -5
- package/dist/tools/wait_for.d.ts +0 -23
- package/dist/tools/wait_for.js +0 -30
- package/dist/tools/windows.d.ts +0 -22
- package/dist/tools/windows.js +0 -57
|
@@ -34,7 +34,7 @@ export async function weaveTypeSecret(session, args, config) {
|
|
|
34
34
|
return {
|
|
35
35
|
success: false,
|
|
36
36
|
error_code: "SECRET_NOT_FOUND",
|
|
37
|
-
message: `[!] Secret not found for key: "${args.envKey}". Run:
|
|
37
|
+
message: `[!] Secret not found for key: "${args.envKey}". Run: weavetab secrets set ${args.envKey}`,
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
const domainAllowed = secretStore.checkDomain(args.envKey, currentHostname);
|
|
@@ -46,8 +46,8 @@ export async function weaveTypeSecret(session, args, config) {
|
|
|
46
46
|
message: `[!] Secret "${args.envKey}" is not scoped for domain "${currentHostname}". ` +
|
|
47
47
|
(allowedDomains.length > 0
|
|
48
48
|
? `Allowed: [${allowedDomains.join(", ")}]. ` +
|
|
49
|
-
`To add this domain:
|
|
50
|
-
: `The allowed domain list is empty — add domains with:
|
|
49
|
+
`To add this domain: weavetab secrets set ${args.envKey}`
|
|
50
|
+
: `The allowed domain list is empty — add domains with: weavetab secrets set ${args.envKey}`),
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
53
|
// ── Step 3: Resolve secret value (in-process only from here) ──────────────
|
|
@@ -110,21 +110,21 @@ export async function weaveTypeSecret(session, args, config) {
|
|
|
110
110
|
await sendToExtension(session, { type: 'Weavetab_STATE', hud: { action: `injecting [REDACTED]...` } });
|
|
111
111
|
// ── Step 5: Resolve DOM node, mark as secret, focus ───────────────────────
|
|
112
112
|
const nodeInfo = await session.Runtime.evaluate({
|
|
113
|
-
expression: `(function(sel) {
|
|
114
|
-
const el = document.querySelector(sel) || (window.__Weavetab_shadowQuery ? window.__Weavetab_shadowQuery(sel) : null);
|
|
115
|
-
if (!el) throw new Error('NOT_FOUND');
|
|
116
|
-
|
|
117
|
-
const tag = el.tagName.toLowerCase();
|
|
118
|
-
const isEditable = tag === 'input' || tag === 'textarea' || el.isContentEditable;
|
|
119
|
-
if (!isEditable) throw new Error('NOT_EDITABLE');
|
|
120
|
-
|
|
121
|
-
// Mark as secret so all subsequent read tools redact this element
|
|
122
|
-
el.setAttribute('data-wt-secret', 'true');
|
|
123
|
-
if (typeof el.select === 'function') { el.select(); }
|
|
124
|
-
else if (el.isContentEditable) { el.textContent = ''; el.dispatchEvent(new Event('input',{bubbles:true})); }
|
|
125
|
-
else { el.value = ''; el.dispatchEvent(new Event('input',{bubbles:true})); }
|
|
126
|
-
|
|
127
|
-
return el;
|
|
113
|
+
expression: `(function(sel) {
|
|
114
|
+
const el = document.querySelector(sel) || (window.__Weavetab_shadowQuery ? window.__Weavetab_shadowQuery(sel) : null);
|
|
115
|
+
if (!el) throw new Error('NOT_FOUND');
|
|
116
|
+
|
|
117
|
+
const tag = el.tagName.toLowerCase();
|
|
118
|
+
const isEditable = tag === 'input' || tag === 'textarea' || el.isContentEditable;
|
|
119
|
+
if (!isEditable) throw new Error('NOT_EDITABLE');
|
|
120
|
+
|
|
121
|
+
// Mark as secret so all subsequent read tools redact this element
|
|
122
|
+
el.setAttribute('data-wt-secret', 'true');
|
|
123
|
+
if (typeof el.select === 'function') { el.select(); }
|
|
124
|
+
else if (el.isContentEditable) { el.textContent = ''; el.dispatchEvent(new Event('input',{bubbles:true})); }
|
|
125
|
+
else { el.value = ''; el.dispatchEvent(new Event('input',{bubbles:true})); }
|
|
126
|
+
|
|
127
|
+
return el;
|
|
128
128
|
})(${JSON.stringify(selector)})`,
|
|
129
129
|
returnByValue: false
|
|
130
130
|
});
|
|
@@ -151,11 +151,11 @@ export async function weaveTypeSecret(session, args, config) {
|
|
|
151
151
|
}
|
|
152
152
|
// ── Step 6: Focus element ─────────────────────────────────────────────────
|
|
153
153
|
await session.Runtime.callFunctionOn({
|
|
154
|
-
functionDeclaration: `function() {
|
|
155
|
-
if (this.scrollIntoViewIfNeeded) this.scrollIntoViewIfNeeded();
|
|
156
|
-
else this.scrollIntoView({behavior:'smooth',block:'center'});
|
|
157
|
-
this.focus();
|
|
158
|
-
this.click();
|
|
154
|
+
functionDeclaration: `function() {
|
|
155
|
+
if (this.scrollIntoViewIfNeeded) this.scrollIntoViewIfNeeded();
|
|
156
|
+
else this.scrollIntoView({behavior:'smooth',block:'center'});
|
|
157
|
+
this.focus();
|
|
158
|
+
this.click();
|
|
159
159
|
}`,
|
|
160
160
|
objectId: nodeInfo.result.objectId,
|
|
161
161
|
silent: true
|
package/dist/tools/upload.js
CHANGED
|
@@ -80,9 +80,9 @@ export async function browserUpload(session, options, config) {
|
|
|
80
80
|
let uploaded = false;
|
|
81
81
|
if (finalSelector) {
|
|
82
82
|
const res = await session.Runtime.evaluate({
|
|
83
|
-
expression: `(function(sel) {
|
|
84
|
-
const el = document.querySelector(sel) || (window.__Weavetab_shadowQuery ? window.__Weavetab_shadowQuery(sel) : null);
|
|
85
|
-
return el?.files?.length > 0;
|
|
83
|
+
expression: `(function(sel) {
|
|
84
|
+
const el = document.querySelector(sel) || (window.__Weavetab_shadowQuery ? window.__Weavetab_shadowQuery(sel) : null);
|
|
85
|
+
return el?.files?.length > 0;
|
|
86
86
|
})(${JSON.stringify(finalSelector)})`,
|
|
87
87
|
returnByValue: true
|
|
88
88
|
}).catch(() => null);
|
|
@@ -111,6 +111,15 @@ export async function compileVideo(options) {
|
|
|
111
111
|
}
|
|
112
112
|
// Check if FFmpeg is available for webm / mp4 or fallback
|
|
113
113
|
const ffmpegPresent = isFFmpegAvailable();
|
|
114
|
+
if (!ffmpegPresent) {
|
|
115
|
+
if (format === "webm" || format === "mp4") {
|
|
116
|
+
return {
|
|
117
|
+
success: false,
|
|
118
|
+
error: `Video output requires ffmpeg (https://ffmpeg.org) — ffmpeg not found on PATH. .webp and .gif output are still available (pure Node, no system dependency). The raw frame images were kept in the recording directory.`,
|
|
119
|
+
compilerUsed: "none",
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
}
|
|
114
123
|
if (ffmpegPresent) {
|
|
115
124
|
try {
|
|
116
125
|
const outputFileName = `recording.${format === "webp" || format === "gif" ? format : format}`;
|
package/dist/tools/wait.js
CHANGED
|
@@ -22,21 +22,21 @@ function autoDetectMode(value) {
|
|
|
22
22
|
async function waitForElement(session, selector, timeout) {
|
|
23
23
|
const start = Date.now();
|
|
24
24
|
const res = await session.Runtime.evaluate({
|
|
25
|
-
expression: `(function(sel, timeout) {
|
|
26
|
-
return new Promise((resolve) => {
|
|
27
|
-
// Check immediately first
|
|
28
|
-
const existing = document.querySelector(sel) ||
|
|
29
|
-
(window.__Weavetab_shadowQuery ? window.__Weavetab_shadowQuery(sel) : null);
|
|
30
|
-
if (existing) { return resolve({ found: true, tag: existing.tagName }); }
|
|
31
|
-
|
|
32
|
-
const obs = new MutationObserver(() => {
|
|
33
|
-
const el = document.querySelector(sel) ||
|
|
34
|
-
(window.__Weavetab_shadowQuery ? window.__Weavetab_shadowQuery(sel) : null);
|
|
35
|
-
if (el) { obs.disconnect(); clearTimeout(tid); resolve({ found: true, tag: el.tagName }); }
|
|
36
|
-
});
|
|
37
|
-
obs.observe(document.documentElement, { childList: true, subtree: true, attributes: true });
|
|
38
|
-
const tid = setTimeout(() => { obs.disconnect(); resolve({ found: false }); }, timeout);
|
|
39
|
-
});
|
|
25
|
+
expression: `(function(sel, timeout) {
|
|
26
|
+
return new Promise((resolve) => {
|
|
27
|
+
// Check immediately first
|
|
28
|
+
const existing = document.querySelector(sel) ||
|
|
29
|
+
(window.__Weavetab_shadowQuery ? window.__Weavetab_shadowQuery(sel) : null);
|
|
30
|
+
if (existing) { return resolve({ found: true, tag: existing.tagName }); }
|
|
31
|
+
|
|
32
|
+
const obs = new MutationObserver(() => {
|
|
33
|
+
const el = document.querySelector(sel) ||
|
|
34
|
+
(window.__Weavetab_shadowQuery ? window.__Weavetab_shadowQuery(sel) : null);
|
|
35
|
+
if (el) { obs.disconnect(); clearTimeout(tid); resolve({ found: true, tag: el.tagName }); }
|
|
36
|
+
});
|
|
37
|
+
obs.observe(document.documentElement, { childList: true, subtree: true, attributes: true });
|
|
38
|
+
const tid = setTimeout(() => { obs.disconnect(); resolve({ found: false }); }, timeout);
|
|
39
|
+
});
|
|
40
40
|
})(${JSON.stringify(selector)}, ${timeout})`,
|
|
41
41
|
awaitPromise: true,
|
|
42
42
|
returnByValue: true,
|
|
@@ -49,26 +49,26 @@ async function waitForElement(session, selector, timeout) {
|
|
|
49
49
|
async function waitForText(session, text, timeout) {
|
|
50
50
|
const start = Date.now();
|
|
51
51
|
const res = await session.Runtime.evaluate({
|
|
52
|
-
expression: `(function(needle, timeout) {
|
|
53
|
-
return new Promise((resolve) => {
|
|
54
|
-
const check = () => {
|
|
55
|
-
const body = document.body?.innerText ?? document.body?.textContent ?? '';
|
|
56
|
-
if (body.includes(needle)) return true;
|
|
57
|
-
// Also check visible value attributes
|
|
58
|
-
const inputs = document.querySelectorAll('input, textarea');
|
|
59
|
-
for (const inp of inputs) {
|
|
60
|
-
if ((inp.value || '').includes(needle)) return true;
|
|
61
|
-
}
|
|
62
|
-
return false;
|
|
63
|
-
};
|
|
64
|
-
if (check()) return resolve({ found: true });
|
|
65
|
-
|
|
66
|
-
const obs = new MutationObserver(() => {
|
|
67
|
-
if (check()) { obs.disconnect(); clearTimeout(tid); resolve({ found: true }); }
|
|
68
|
-
});
|
|
69
|
-
obs.observe(document.documentElement, { childList: true, subtree: true, characterData: true });
|
|
70
|
-
const tid = setTimeout(() => { obs.disconnect(); resolve({ found: false }); }, timeout);
|
|
71
|
-
});
|
|
52
|
+
expression: `(function(needle, timeout) {
|
|
53
|
+
return new Promise((resolve) => {
|
|
54
|
+
const check = () => {
|
|
55
|
+
const body = document.body?.innerText ?? document.body?.textContent ?? '';
|
|
56
|
+
if (body.includes(needle)) return true;
|
|
57
|
+
// Also check visible value attributes
|
|
58
|
+
const inputs = document.querySelectorAll('input, textarea');
|
|
59
|
+
for (const inp of inputs) {
|
|
60
|
+
if ((inp.value || '').includes(needle)) return true;
|
|
61
|
+
}
|
|
62
|
+
return false;
|
|
63
|
+
};
|
|
64
|
+
if (check()) return resolve({ found: true });
|
|
65
|
+
|
|
66
|
+
const obs = new MutationObserver(() => {
|
|
67
|
+
if (check()) { obs.disconnect(); clearTimeout(tid); resolve({ found: true }); }
|
|
68
|
+
});
|
|
69
|
+
obs.observe(document.documentElement, { childList: true, subtree: true, characterData: true });
|
|
70
|
+
const tid = setTimeout(() => { obs.disconnect(); resolve({ found: false }); }, timeout);
|
|
71
|
+
});
|
|
72
72
|
})(${JSON.stringify(text)}, ${timeout})`,
|
|
73
73
|
awaitPromise: true,
|
|
74
74
|
returnByValue: true,
|
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED