@weavetab/mcp 2.5.0-beta.0 → 2.5.0-beta.2
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 -0
- package/LICENSE +2 -2
- package/README.md +208 -43
- package/SECURITY.md +3 -3
- package/TROUBLESHOOTING.md +1 -1
- package/dist/cdp/bridge.d.ts +10 -0
- package/dist/cdp/bridge.js +288 -68
- package/dist/cdp/connector.d.ts +5 -3
- package/dist/cdp/connector.js +188 -74
- package/dist/cdp/extension.js +0 -1
- package/dist/cdp/helpers.js +0 -2
- package/dist/cdp/lock.d.ts +9 -6
- package/dist/cdp/lock.js +72 -59
- package/dist/cdp/omni_broker.d.ts +1 -0
- package/dist/cdp/omni_broker.js +12 -6
- package/dist/cdp/profiles.d.ts +10 -0
- package/dist/cdp/profiles.js +65 -0
- package/dist/cdp/walker.js +50 -0
- package/dist/cli/plugin.d.ts +0 -2
- package/dist/cli/plugin.js +31 -683
- package/dist/cli/updater.js +2 -2
- package/dist/config/loader.d.ts +25 -6
- package/dist/config/loader.js +133 -20
- package/dist/index.js +48 -52
- package/dist/lifecycle/mission_manager.d.ts +0 -1
- package/dist/lifecycle/mission_manager.js +0 -3
- package/dist/overlay/ghost.d.ts +4 -0
- package/dist/overlay/ghost.js +118 -94
- package/dist/overlay/injector.d.ts +1 -1
- package/dist/overlay/injector.js +1 -15
- package/dist/plugin/extension_bridge.d.ts +40 -0
- package/dist/plugin/extension_bridge.js +158 -0
- package/dist/plugin/interface.d.ts +78 -16
- package/dist/plugin/loader.d.ts +4 -0
- package/dist/plugin/loader.js +178 -57
- package/dist/plugin/registry.js +11 -1
- package/dist/plugin/storage.d.ts +51 -0
- package/dist/plugin/storage.js +164 -0
- package/dist/server.js +217 -151
- package/dist/state/session.d.ts +2 -2
- package/dist/state/session.js +33 -13
- package/dist/tools/browser_detect.d.ts +2 -1
- package/dist/tools/browser_detect.js +6 -5
- package/dist/tools/burst.d.ts +1 -0
- package/dist/tools/burst.js +4 -6
- package/dist/tools/click.js +23 -28
- package/dist/tools/clipboard.js +31 -24
- package/dist/tools/navigate.d.ts +1 -1
- package/dist/tools/navigate.js +28 -10
- package/dist/tools/read.js +1 -1
- package/dist/tools/tabs.d.ts +10 -10
- package/dist/tools/tabs.js +47 -39
- package/dist/tools/type.js +2 -2
- package/docs/DOCUMENTATION.md +63 -6
- package/docs/architecture/blind-injection.md +20 -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 +54 -0
- package/docs/desktop-automation/electron-apps.md +162 -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/skills-ecosystem/skills-overview.md +35 -0
- package/docs/skills-ecosystem/skills-recipes.md +36 -0
- package/docs/tools/tools.md +293 -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/content.js +126 -101
- package/mcp.json +8 -15
- package/package.json +11 -5
- package/server.json +3 -3
- package/dist/tools/plan.d.ts +0 -39
- package/dist/tools/plan.js +0 -161
- package/docs/DEV_MODE.md +0 -68
- package/docs/PLUGINS.md +0 -538
- package/docs/TOOLS.md +0 -104
- package/docs/dev_plugin.md +0 -310
package/dist/tools/plan.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import { logAction } from "../audit/logger.js";
|
|
2
|
-
import { sendToExtension } from "../cdp/helpers.js";
|
|
3
|
-
// In-memory comment store (agent-side)
|
|
4
|
-
const planComments = [];
|
|
5
|
-
let activeGoal = "";
|
|
6
|
-
let activeTasks = [];
|
|
7
|
-
// Dormant Guard (Layer 1)
|
|
8
|
-
let dormantTimer = null;
|
|
9
|
-
const DORMANT_TIMEOUT_MS = 45000;
|
|
10
|
-
function resetDormantGuard(session) {
|
|
11
|
-
if (dormantTimer)
|
|
12
|
-
clearTimeout(dormantTimer);
|
|
13
|
-
dormantTimer = setTimeout(async () => {
|
|
14
|
-
try {
|
|
15
|
-
await session.Runtime.evaluate({
|
|
16
|
-
expression: `(function() { if (typeof window.__wt_plan === 'function') window.__wt_plan('hide'); })()`
|
|
17
|
-
});
|
|
18
|
-
}
|
|
19
|
-
catch { /* session may be dead */ }
|
|
20
|
-
}, DORMANT_TIMEOUT_MS);
|
|
21
|
-
}
|
|
22
|
-
/** Poll the page for new user comments on plan tasks */
|
|
23
|
-
async function pollComments(session) {
|
|
24
|
-
try {
|
|
25
|
-
const { result } = await session.Runtime.evaluate({
|
|
26
|
-
expression: `(function() {
|
|
27
|
-
var q = window.__wt_plan_comments || [];
|
|
28
|
-
if (q.length > 0) { window.__wt_plan_comments = []; return JSON.stringify(q); }
|
|
29
|
-
return '[]';
|
|
30
|
-
})()`,
|
|
31
|
-
returnByValue: true,
|
|
32
|
-
});
|
|
33
|
-
if (result?.value && result.value !== '[]') {
|
|
34
|
-
return JSON.parse(result.value);
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
catch { /* non-fatal */ }
|
|
38
|
-
return [];
|
|
39
|
-
}
|
|
40
|
-
export async function weavePlan(session, options, _config) {
|
|
41
|
-
const { action, goal, tasks, taskId, status } = options;
|
|
42
|
-
// Always poll for new user comments from the overlay
|
|
43
|
-
const newComments = await pollComments(session);
|
|
44
|
-
for (const c of newComments) {
|
|
45
|
-
planComments.push(c);
|
|
46
|
-
const task = activeTasks.find(t => t.id === c.taskId);
|
|
47
|
-
if (task) {
|
|
48
|
-
task.comment = c.comment;
|
|
49
|
-
logAction("browser_plan", "comment", `task ${c.taskId}: ${c.comment}`);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
if (action === "create") {
|
|
53
|
-
activeGoal = goal || "";
|
|
54
|
-
activeTasks = tasks || [];
|
|
55
|
-
// Use sendToExtension for reliable delivery to content script
|
|
56
|
-
await sendToExtension(session, {
|
|
57
|
-
type: 'Weavetab_STATE',
|
|
58
|
-
plan: { action: 'create', goal: activeGoal, tasks: activeTasks },
|
|
59
|
-
}).catch(() => { });
|
|
60
|
-
// Also try direct injection as fallback
|
|
61
|
-
await session.Runtime.evaluate({
|
|
62
|
-
expression: `(function() {
|
|
63
|
-
if (typeof window.__wt_plan === 'function') {
|
|
64
|
-
window.__wt_plan('create', ${JSON.stringify(activeGoal)}, ${JSON.stringify(activeTasks)});
|
|
65
|
-
}
|
|
66
|
-
})()`,
|
|
67
|
-
returnByValue: true,
|
|
68
|
-
}).catch(() => { });
|
|
69
|
-
resetDormantGuard(session);
|
|
70
|
-
logAction("browser_plan", "create", `goal: ${activeGoal}, ${activeTasks.length} tasks`);
|
|
71
|
-
return { success: true, plan: { goal: activeGoal, tasks: activeTasks } };
|
|
72
|
-
}
|
|
73
|
-
if (action === "update") {
|
|
74
|
-
if (taskId === undefined || !status) {
|
|
75
|
-
return { success: false, error: "browser_plan update requires taskId and status" };
|
|
76
|
-
}
|
|
77
|
-
const task = activeTasks.find(t => t.id === taskId);
|
|
78
|
-
if (!task) {
|
|
79
|
-
return { success: false, error: `Task ${taskId} not found` };
|
|
80
|
-
}
|
|
81
|
-
task.status = status;
|
|
82
|
-
// Use sendToExtension for reliable delivery
|
|
83
|
-
await sendToExtension(session, {
|
|
84
|
-
type: 'Weavetab_STATE',
|
|
85
|
-
plan: { action: 'update', goal: activeGoal, tasks: activeTasks },
|
|
86
|
-
}).catch(() => { });
|
|
87
|
-
// Also try direct injection as fallback
|
|
88
|
-
await session.Runtime.evaluate({
|
|
89
|
-
expression: `(function() {
|
|
90
|
-
if (typeof window.__wt_plan === 'function') {
|
|
91
|
-
window.__wt_plan('update', ${JSON.stringify(activeGoal)}, ${JSON.stringify(activeTasks)});
|
|
92
|
-
}
|
|
93
|
-
})()`,
|
|
94
|
-
returnByValue: true,
|
|
95
|
-
}).catch(() => { });
|
|
96
|
-
resetDormantGuard(session);
|
|
97
|
-
logAction("browser_plan", "update", `task ${taskId} \u2192 ${status}`);
|
|
98
|
-
return { success: true, plan: { goal: activeGoal, tasks: activeTasks } };
|
|
99
|
-
}
|
|
100
|
-
if (action === "hide") {
|
|
101
|
-
if (dormantTimer) {
|
|
102
|
-
clearTimeout(dormantTimer);
|
|
103
|
-
dormantTimer = null;
|
|
104
|
-
}
|
|
105
|
-
// Use sendToExtension for reliable delivery
|
|
106
|
-
await sendToExtension(session, {
|
|
107
|
-
type: 'Weavetab_STATE',
|
|
108
|
-
plan: { action: 'hide', goal: '', tasks: [] },
|
|
109
|
-
}).catch(() => { });
|
|
110
|
-
// Also try direct injection as fallback
|
|
111
|
-
await session.Runtime.evaluate({
|
|
112
|
-
expression: `(function() {
|
|
113
|
-
if (typeof window.__wt_plan === 'function') window.__wt_plan('hide');
|
|
114
|
-
})()`,
|
|
115
|
-
returnByValue: true,
|
|
116
|
-
}).catch(() => { });
|
|
117
|
-
return { success: true };
|
|
118
|
-
}
|
|
119
|
-
if (action === "comments") {
|
|
120
|
-
return { success: true, comments: planComments.slice(), plan: { goal: activeGoal, tasks: activeTasks } };
|
|
121
|
-
}
|
|
122
|
-
return { success: false, error: `Unknown action: ${action}` };
|
|
123
|
-
}
|
|
124
|
-
export function addPlanComment(taskId, comment) {
|
|
125
|
-
planComments.push({ taskId, comment, time: Date.now() });
|
|
126
|
-
}
|
|
127
|
-
/** Returns current in-memory plan (goal + tasks) — used to re-inject on page navigation */
|
|
128
|
-
export function getActivePlan() {
|
|
129
|
-
if (!activeGoal && activeTasks.length === 0)
|
|
130
|
-
return null;
|
|
131
|
-
return { goal: activeGoal, tasks: activeTasks };
|
|
132
|
-
}
|
|
133
|
-
export function setActivePlan(goal, tasks) {
|
|
134
|
-
activeGoal = goal || "";
|
|
135
|
-
activeTasks = tasks || [];
|
|
136
|
-
}
|
|
137
|
-
/** Re-inject plan into a (possibly fresh) page session — used after navigation / reconnect */
|
|
138
|
-
export async function restoreActivePlanIntoPage(session) {
|
|
139
|
-
if (!activeGoal && activeTasks.length === 0)
|
|
140
|
-
return;
|
|
141
|
-
// Use sendToExtension for reliable delivery
|
|
142
|
-
try {
|
|
143
|
-
await sendToExtension(session, {
|
|
144
|
-
type: 'Weavetab_STATE',
|
|
145
|
-
plan: { action: 'create', goal: activeGoal, tasks: activeTasks },
|
|
146
|
-
});
|
|
147
|
-
}
|
|
148
|
-
catch { /* non-fatal */ }
|
|
149
|
-
// Also try direct injection as fallback
|
|
150
|
-
try {
|
|
151
|
-
await session.Runtime.evaluate({
|
|
152
|
-
expression: `(function() {
|
|
153
|
-
if (typeof window.__wt_plan === 'function') {
|
|
154
|
-
window.__wt_plan('create', ${JSON.stringify(activeGoal)}, ${JSON.stringify(activeTasks)});
|
|
155
|
-
}
|
|
156
|
-
})()`,
|
|
157
|
-
returnByValue: true,
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
catch { /* page may not be ready */ }
|
|
161
|
-
}
|
package/docs/DEV_MODE.md
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# Weavetab Developer Mode (devMode) & Plugin Profiling Guide
|
|
2
|
-
|
|
3
|
-
This guide explains Developer Mode (`devMode`), how tool execution timing (`execution_ms`) works, and how it empowers **`weavetab-plugin` developers** and AI agents to profile performance.
|
|
4
|
-
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
## Enabling Developer Mode
|
|
8
|
-
|
|
9
|
-
Developer Mode can be enabled in two ways:
|
|
10
|
-
|
|
11
|
-
1. **Via Configuration (`~/.weavetab/config.json` or `.weavetab/config.json`)**:
|
|
12
|
-
```json
|
|
13
|
-
{
|
|
14
|
-
"devMode": true
|
|
15
|
-
}
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
2. **Via Environment Variable**:
|
|
19
|
-
```bash
|
|
20
|
-
WEAVETAB_DEV=1 node dist/index.js
|
|
21
|
-
```
|
|
22
|
-
|
|
23
|
-
---
|
|
24
|
-
|
|
25
|
-
## What Does `devMode` Add?
|
|
26
|
-
|
|
27
|
-
When `devMode` is active, Weavetab exposes rich execution metadata, visual debugging tools, and mission logging without altering underlying tool execution behavior.
|
|
28
|
-
|
|
29
|
-
### 1. `execution_ms` & Tool Performance Profiling
|
|
30
|
-
|
|
31
|
-
In `devMode`, every tool response automatically includes an **`execution_ms`** field:
|
|
32
|
-
|
|
33
|
-
```json
|
|
34
|
-
{
|
|
35
|
-
"success": true,
|
|
36
|
-
"execution_ms": 14,
|
|
37
|
-
"result": { ... }
|
|
38
|
-
}
|
|
39
|
-
```
|
|
40
|
-
|
|
41
|
-
* **Purpose**: Measures the exact millisecond duration required to process and complete that specific tool call.
|
|
42
|
-
* **Essential for Plugin Developers**: Allows community developers building custom Weavetab plugins to profile their handlers, measure bottleneck latency, and optimize tool responsiveness.
|
|
43
|
-
* **Agent Context Awareness**: AI agents and users reading tool outputs can monitor tool performance in real time.
|
|
44
|
-
|
|
45
|
-
### 2. Extension Visual Overlays & Tool Calls
|
|
46
|
-
|
|
47
|
-
* **Extension Visuals**: Renders real-time tool execution badges and `toolcalls` counters directly within the extension overlay.
|
|
48
|
-
* **Trajectory & Hitbox Inspection**: Visualizes pointer paths, click target bounding boxes, and action status badges during execution.
|
|
49
|
-
|
|
50
|
-
### 3. Mission Logs (`/logs/`)
|
|
51
|
-
|
|
52
|
-
* For every completed mission, Weavetab generates a structured mission log file inside `/logs/` (`~/.weavetab/logs/`).
|
|
53
|
-
* Contains full step-by-step tool traces, `execution_ms` timing distributions, and action histories for auditing and debugging.
|
|
54
|
-
|
|
55
|
-
---
|
|
56
|
-
|
|
57
|
-
## Plugin Performance Profiling
|
|
58
|
-
|
|
59
|
-
Developer Mode is especially valuable for community developers creating Weavetab plugin packages.
|
|
60
|
-
|
|
61
|
-
* **Profiling Custom Tool Handlers**:
|
|
62
|
-
When developing a plugin, enabling `devMode` (`WEAVETAB_DEV=1`) allows you to inspect the `execution_ms` timer on every custom tool response to benchmark performance and optimize your code before publishing.
|
|
63
|
-
* **Manifest & Permissions**:
|
|
64
|
-
Plugins define their metadata, permissions, and entry points in a `weavetab.json` manifest.
|
|
65
|
-
* **Marketplace Screenshots (`/images/`)**:
|
|
66
|
-
Plugins can include an `/images` directory with screenshots and logos for display on the official Weavetab Marketplace website (`website/`).
|
|
67
|
-
|
|
68
|
-
> 📖 For full details on building, packaging, and publishing plugins, see [docs/PLUGINS.md](PLUGINS.md).
|