web-agent-bridge 2.3.1 → 2.5.0
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/README.ar.md +524 -31
- package/README.md +592 -47
- package/bin/agent-runner.js +10 -1
- package/package.json +1 -1
- package/public/agent-workspace.html +347 -0
- package/public/browser.html +484 -0
- package/public/css/agent-workspace.css +1713 -0
- package/public/index.html +94 -0
- package/public/js/agent-workspace.js +1740 -0
- package/sdk/index.d.ts +253 -0
- package/sdk/index.js +360 -1
- package/sdk/package.json +1 -1
- package/server/config/secrets.js +13 -5
- package/server/control-plane/index.js +301 -0
- package/server/data-plane/index.js +354 -0
- package/server/index.js +185 -4
- package/server/llm/index.js +404 -0
- package/server/middleware/adminAuth.js +6 -1
- package/server/middleware/auth.js +11 -2
- package/server/middleware/rateLimits.js +78 -2
- package/server/migrations/003_ads_integer_cents.sql +33 -0
- package/server/models/db.js +126 -25
- package/server/observability/index.js +394 -0
- package/server/protocol/capabilities.js +223 -0
- package/server/protocol/index.js +243 -0
- package/server/protocol/schema.js +584 -0
- package/server/registry/index.js +326 -0
- package/server/routes/admin.js +16 -2
- package/server/routes/ads.js +130 -0
- package/server/routes/agent-workspace.js +378 -0
- package/server/routes/api.js +21 -2
- package/server/routes/auth.js +26 -6
- package/server/routes/runtime.js +725 -0
- package/server/routes/sovereign.js +78 -0
- package/server/routes/universal.js +177 -0
- package/server/routes/wab-api.js +20 -5
- package/server/runtime/event-bus.js +210 -0
- package/server/runtime/index.js +233 -0
- package/server/runtime/sandbox.js +266 -0
- package/server/runtime/scheduler.js +395 -0
- package/server/runtime/state-manager.js +188 -0
- package/server/security/index.js +355 -0
- package/server/services/agent-chat.js +506 -0
- package/server/services/agent-symphony.js +6 -0
- package/server/services/agent-tasks.js +1807 -0
- package/server/services/fairness-engine.js +409 -0
- package/server/services/plugins.js +27 -3
- package/server/services/price-intelligence.js +565 -0
- package/server/services/price-shield.js +1137 -0
- package/server/services/search-engine.js +357 -0
- package/server/services/security.js +513 -0
- package/server/services/universal-scraper.js +661 -0
- package/server/ws.js +61 -1
package/README.md
CHANGED
|
@@ -9,6 +9,8 @@
|
|
|
9
9
|
|
|
10
10
|
> **robots.txt told bots what NOT to do. WAB tells AI agents what they CAN do.**
|
|
11
11
|
|
|
12
|
+
🌐 **Live Website:** [https://webagentbridge.com](https://webagentbridge.com) — Try the Agent Workspace, dashboards, and many more features live.
|
|
13
|
+
|
|
12
14
|
**English** | **[العربية](README.ar.md)**
|
|
13
15
|
|
|
14
16
|
WAB is an open-source middleware layer that bridges AI agents and websites — like **OpenAPI for human-facing pages**. Website owners embed a script that exposes a standardized `window.AICommands` interface. AI agents discover available actions, execute commands, and interact with sites accurately — no DOM parsing, no scraping, no guesswork.
|
|
@@ -56,24 +58,69 @@ WAB is an open-source middleware layer that bridges AI agents and websites — l
|
|
|
56
58
|
- **GDPR/CCPA Consent** — Optional `wab-consent.js` banner with `WABConsent.showBanner()` and `hasConsent()` gate
|
|
57
59
|
- **Admin Dashboard** — User management, tier grants, system analytics
|
|
58
60
|
- **Stripe Integration** — Payment processing with customer portal
|
|
61
|
+
- **Plugin Architecture** — Dynamic plugin system with hook-based execution, per-site installation, priority ordering, ratings, and audit logging
|
|
62
|
+
- **Vision Analysis Service** — Multi-provider screenshot analysis (local Moondream, OpenAI, Anthropic, Ollama) with interactive element detection, bounding box extraction, and AES-256-GCM encrypted API keys
|
|
63
|
+
- **Fairness Engine** — Neutrality layer ensuring AI agents give equal opportunity to small and large sites with fairness-weighted search, commission transparency tracking, and trust signature validation
|
|
64
|
+
- **Agent Memory System** — Persistent behavioral memory with 4 memory types, 5 categories, semantic associations, importance scoring, and TTL-based expiration
|
|
65
|
+
- **Premium Traffic Intelligence** — Advanced bot detection (30+ agent types), behavioral profiling, anomaly/spike detection, security exploit detection (SQLi, XSS), and webhook alerting
|
|
66
|
+
- **E-Mail Service** — SMTP-based transactional emails (welcome, registration, password reset, contact) with branded HTML templates
|
|
67
|
+
- **NoScript Fallback** — 1×1 tracking pixel endpoint for analytics collection when JavaScript is unavailable
|
|
68
|
+
- **WAB-MCP Adapter** — Expose WAB site capabilities as MCP tools for Claude, GPT, Gemini, and other MCP-compatible AI agents
|
|
69
|
+
- **WordPress Plugin** — Native WordPress plugin with settings page, per-page action meta boxes, discovery document generation, and dashboard widget
|
|
70
|
+
- **WAB Browser (Desktop)** — Standalone Electron desktop browser with built-in ad blocker (80+ domains), scam shield, fairness ranking, agent chat, bookmarks, history, and WAB protocol support. *Desktop source is maintained in a separate private build pipeline (`wab-browser/`); the PWA source below is fully open.*
|
|
71
|
+
- **PWA Browser (Mobile)** — Progressive Web App browser for Android/iOS with ad blocking (80+ domains), WAB Search engine, scam detection, fairness ranking, real AI agent chat, and offline-first service worker. Full source at `public/pwa/`.
|
|
72
|
+
- **Schema Discovery SDK** — Server-side extraction of schema.org JSON-LD Product nodes from HTML with automatic WAB action hint generation
|
|
59
73
|
|
|
60
74
|
### v2.0 — Digital Fortress Features
|
|
61
75
|
|
|
62
|
-
- **Real-time Negotiation Engine** — AI agents negotiate prices directly with WAB-enabled sites using multi-round sessions
|
|
63
|
-
- **Anti-Hallucination Shield** — Cross-verification engine comparing DOM vs vision screenshots, market benchmark validation, temporal consistency checks, and Levenshtein text similarity scoring
|
|
64
|
-
- **Decentralized Reputation System** —
|
|
65
|
-
- **Sovereign Dashboard** — Real-time command center with fairness radar, privacy shield, negotiation logs, verification checks, and AI model switcher
|
|
76
|
+
- **Real-time Negotiation Engine** — AI agents negotiate prices directly with WAB-enabled sites using multi-round sessions. 8 condition types (bulk, loyalty, time-based, first-purchase, cart-value, seasonal, membership, referral) and 4 discount types (percentage, fixed, free-shipping, bonus-item). Includes daily usage limits, minimum order values, and full audit trail of all offers
|
|
77
|
+
- **Anti-Hallucination Shield** — Cross-verification engine comparing DOM vs vision screenshots, market benchmark validation, temporal consistency checks, and Levenshtein text similarity scoring. 4 severity levels (minor → fraud) and 5 response actions (warn, halt, confirm-human, auto-correct, block)
|
|
78
|
+
- **Decentralized Reputation System** — HMAC-signed trust attestations from the agent network covering 6 attestation types (purchase, booking, query, form, navigation, verification). 7 trust levels (unknown → blacklisted), temporal decay, Sybil resistance, global leaderboard, and challenge/dispute system
|
|
79
|
+
- **Sovereign Dashboard** — Real-time command center with fairness radar, privacy shield, negotiation logs, verification checks, and AI model switcher. Exposes `/api/sovereign/dashboard/sovereign` aggregate endpoint
|
|
66
80
|
- **Community Agent Hub** — 11 pre-built YAML agent templates (hotel booking, grocery comparison, artisan marketplace, flight deals, etc.) with CLI runner: `npx wab-agent run template.yaml`
|
|
67
|
-
- **AI Brain Swapping** —
|
|
81
|
+
- **AI Brain Swapping** — Local AI runtime that auto-discovers Ollama and llama.cpp endpoints plus custom OpenAI-compatible APIs. Model capability tracking for text/vision, context window management, latency-based routing, and inference logging with token metrics
|
|
68
82
|
- **Cross-Site Agent Orchestration** — One agent manages multiple WAB-enabled sites simultaneously via `WABMultiAgent`. Compare prices across stores, aggregate data, run parallel actions, and find the best deal automatically
|
|
69
83
|
|
|
70
84
|
### v2.3 — Private Agent Mesh (Distributed Mind)
|
|
71
85
|
|
|
72
|
-
- **Inter-Agent Protocol** — Agents communicate through a private mesh with 5 built-in channels (alerts, discoveries, tactics, negotiations, votes).
|
|
73
|
-
- **Local Reinforcement Learning** — Agents learn from every user decision using UCB1 multi-armed bandit action selection, gradient-descent policy updates, and
|
|
74
|
-
- **Symphony Orchestrator** — Four specialized agents (Researcher, Analyst, Negotiator, Guardian) collaborate autonomously through rule-based engines. 5 templates, 6-phase pipeline, Guardian veto for safety, weighted consensus. No external LLM dependency
|
|
86
|
+
- **Inter-Agent Protocol** — Agents communicate through a private mesh with 5 built-in channels (alerts, discoveries, tactics, negotiations, votes). 6 message types with confidence scoring, auto-expiring stale agents via heartbeat, peer verification of shared knowledge. All communication stays local — no external transmission
|
|
87
|
+
- **Local Reinforcement Learning** — Agents learn from every user decision using UCB1 multi-armed bandit action selection, gradient-descent policy updates with sigmoid activation, temporal discounting, and sequential pattern mining. Zero external API calls — all learning is local
|
|
88
|
+
- **Symphony Orchestrator** — Four specialized agents (Researcher, Analyst, Negotiator, Guardian) collaborate autonomously through rule-based engines. 5 templates, 6-phase pipeline (analyze → research → negotiate → guard → synthesize → decide), Guardian veto for safety, weighted consensus. Full phase logging with duration tracking. No external LLM dependency
|
|
75
89
|
- **Agent Mesh Dashboard** — Real-time visualization of your agent mesh: active agents, communication channels, shared knowledge base, symphony compositions, and learning performance metrics
|
|
76
90
|
|
|
91
|
+
### v2.4 — Commander & Edge Intelligence
|
|
92
|
+
|
|
93
|
+
- **Commander Agent System** — Local-first mission orchestration engine that decomposes high-level goals into task DAGs. Agent registry with capabilities tracking, parallel execution engine, learning integration for outcome feedback, and edge coordination for distributed work
|
|
94
|
+
- **Edge Compute System** — Transforms every user device into a sovereign AI node. Hardware profiling (CPU, RAM, GPU), AES-256-GCM encrypted inter-node communication, weighted load balancing, heartbeat-based health monitoring with auto-failover, and swarm formation with capability-based clustering
|
|
95
|
+
- **Swarm Execution Engine** — Launch multiple agents in parallel to solve a single task. Configurable strategies (parallel, sequential, hybrid), result merging with best-score selection, role specialization, fairness-weighted aggregation, and per-agent confidence scoring
|
|
96
|
+
|
|
97
|
+
### v2.5 — Agent Workspace & Multilingual AI
|
|
98
|
+
|
|
99
|
+
- **Agent Workspace** — Premium 4-panel workspace for non-technical users: embedded browser, smart agent chat, real-time negotiation monitor, and results panel. Subscription tiers (Free/Starter/Pro/Enterprise), deal tracking, and admin management. Live at [webagentbridge.com/workspace](https://webagentbridge.com/workspace)
|
|
100
|
+
- **Bilingual UI (AR/EN)** — Full Arabic/English interface with auto-detection from browser language. Toggle instantly between languages. RTL/LTR layout support
|
|
101
|
+
- **Multilingual Agent** — The smart agent understands and responds in any language the user writes in — Arabic, English, French, Spanish, Turkish, and more. No restrictions on input style, dialect, or format
|
|
102
|
+
- **Dynamic Pricing Shield** — Detects price manipulation by websites that change prices based on device type, geolocation, cookies, browsing history, referral source, or repeat visits. The agent probes the same page with 12 distinct identity personas (clean desktop, mobile, Mac premium, EU/MENA/SEA geo, repeat visitor, Google/social/comparison referral, privacy-focused, bot-like) and uses statistical analysis (coefficient of variation, z-score outliers) to expose hidden pricing. Includes manipulation scoring (0–100), actionable tips, historical trend detection, and a strategy builder that recommends the best identity for the lowest price. Full API at `/api/sovereign/price-shield/`
|
|
103
|
+
|
|
104
|
+
### v3.0 — Agent OS (Execution Layer for the Web)
|
|
105
|
+
|
|
106
|
+
WAB v3.0 transforms the project from an advanced automation tool into a **real Agent Operating System** — a complete execution layer for AI agents on the web, comparable to MCP but purpose-built for browser interaction.
|
|
107
|
+
|
|
108
|
+
- **WAB Protocol (WABP) v1.0.0** — Formal protocol with JSON Schema command registry, typed messages, input/output validation, and versioned command definitions. 10 built-in commands (discover, execute, semantic.execute, agent.register, task.submit, task.status, commerce.compare, commerce.negotiate, mesh.send, ai.infer). Every command has declared capabilities, risk levels, and permission requirements
|
|
109
|
+
- **Capability Negotiation** — Dynamic capability grants between agents and sites. Risk-based auto-approval (low-risk auto-granted, high-risk requires policy), rate limiting per capability, expirable grants with usage tracking, and full revocation support
|
|
110
|
+
- **Agent Runtime Engine** — Production-grade task runtime with priority queue scheduler, dependency resolution, retry with exponential backoff, pause/resume/cancel, concurrency limits, and state machine transitions. EventBus with async middleware, namespace wildcards, replay buffer (10K events), and dead letter queue
|
|
111
|
+
- **Execution Sandbox** — Per-task isolation with resource limits (timeout, maxMemory, maxNetworkCalls, maxDomOperations), domain allowlists, blocked selector enforcement, capability checks at execution time, and full audit trail of every operation
|
|
112
|
+
- **State Manager** — Agent state persistence with labeled checkpoints, rollback to any checkpoint, state transitions with validation, merge operations, and TTL-based cleanup
|
|
113
|
+
- **Observability Stack** — Structured JSON logger with child loggers and pluggable sinks, distributed tracer with parent-child spans (OpenTelemetry-compatible), and metrics collector with counters, gauges, histograms (p50/p90/p95/p99 percentiles), and time series for dashboards
|
|
114
|
+
- **Security Model** — AgentIdentity (registration, hashed API key authentication, session management with TTL, IP allowlists, revocation), CommandSigner (HMAC-SHA256 signing/verification with nonce + timestamp, timing-safe comparison), and SiteIsolation (per-site access control, allowed/blocked agents, max concurrency, selector blocking, data classification)
|
|
115
|
+
- **Control Plane** — AgentManager for deployment lifecycle (deploy, assign to sites, health checks, undeploy) and PolicyEngine with typed rules, condition evaluation (equals, contains, pattern, min, max, in), priority-ordered policy binding, and entity-level policy enforcement
|
|
116
|
+
- **Data Plane** — SemanticActionResolver maps `domain.action` notation (e.g., `checkout.addItem`) to concrete implementations per site. Executor routes tasks through tracing + metrics, supports semantic/pipeline/parallel execution modes, with 8 built-in semantic actions for checkout, search, auth, navigation, and content
|
|
117
|
+
- **Multi-Model LLM Abstraction** — Unified interface for OpenAI (chat completions + embeddings), Anthropic (messages API), and Ollama (local models with auto-discovery). LLMManager provides automatic fallback chain through all providers, response caching (5min TTL), cost tracking via token counts, and model listing
|
|
118
|
+
- **Registry & Ecosystem** — CommandRegistry (like npm for WAB commands — register, discover, search by category/tag/capability, usage tracking), SiteRegistry (WAB-enabled sites directory with verification, capability listing, visit tracking), and TemplateRegistry (reusable workflow templates with download counts and ratings)
|
|
119
|
+
- **Unified Runtime API** — All Agent OS layers exposed via RESTful endpoints at `/api/os/*`: protocol discovery, agent identity/auth, task CRUD, semantic execution, deployments, policies, isolation, observability (metrics/traces/logs), registry (commands/sites/templates), LLM operations, command signing, and Server-Sent Events for real-time streaming
|
|
120
|
+
- **WABAgentOS SDK Client** — New `WABAgentOS` class in the SDK provides full TypeScript-typed API for all Agent OS operations: register → authenticate → negotiate capabilities → submit tasks → execute semantically → query observability → subscribe to events
|
|
121
|
+
|
|
122
|
+
> **Many more features** are available on the live website that aren't listed here — dashboards, analytics, admin tools, and more. Visit [webagentbridge.com](https://webagentbridge.com) to explore.
|
|
123
|
+
|
|
77
124
|
---
|
|
78
125
|
|
|
79
126
|
## Quick Start
|
|
@@ -136,51 +183,119 @@ const info = bridge.getPageInfo(); // get page metadata
|
|
|
136
183
|
|
|
137
184
|
```
|
|
138
185
|
web-agent-bridge/
|
|
139
|
-
├── server/
|
|
140
|
-
│ ├── index.js
|
|
186
|
+
├── server/ # Express.js backend
|
|
187
|
+
│ ├── index.js # Server entry point
|
|
188
|
+
│ ├── ws.js # WebSocket server (live analytics)
|
|
141
189
|
│ ├── routes/
|
|
142
|
-
│ │ ├── auth.js
|
|
143
|
-
│ │ ├── api.js
|
|
144
|
-
│ │ ├── license.js
|
|
145
|
-
│ │ ├── admin.js
|
|
146
|
-
│ │ ├──
|
|
147
|
-
│ │
|
|
190
|
+
│ │ ├── auth.js # Authentication (register/login)
|
|
191
|
+
│ │ ├── api.js # Sites, config, analytics API
|
|
192
|
+
│ │ ├── license.js # License verification, token exchange & tracking
|
|
193
|
+
│ │ ├── admin.js # Admin dashboard API
|
|
194
|
+
│ │ ├── admin-premium.js # Admin premium analytics (memory, vision, swarm, plugins)
|
|
195
|
+
│ │ ├── billing.js # Stripe billing integration
|
|
196
|
+
│ │ ├── sovereign.js # v2.0: negotiation, reputation, verification, dashboard
|
|
197
|
+
│ │ ├── mesh.js # v2.3: agent mesh protocol routes
|
|
198
|
+
│ │ ├── commander.js # v2.4: mission orchestration routes
|
|
199
|
+
│ │ ├── premium.js # Premium features
|
|
200
|
+
│ │ ├── premium-v2.js # v2 premium (memory, vision, healing, swarm, plugins)
|
|
201
|
+
│ │ ├── discovery.js # WAB discovery + fairness-weighted search
|
|
202
|
+
│ │ ├── wab-api.js # WAB HTTP transport (alternative to JS/WS)
|
|
203
|
+
│ │ └── noscript.js # NoScript tracking pixel fallback
|
|
148
204
|
│ ├── services/
|
|
149
|
-
│ │ ├── negotiation.js
|
|
150
|
-
│ │ ├── verification.js
|
|
151
|
-
│ │
|
|
205
|
+
│ │ ├── negotiation.js # Real-time negotiation engine
|
|
206
|
+
│ │ ├── verification.js # Anti-hallucination shield
|
|
207
|
+
│ │ ├── reputation.js # Decentralized reputation system
|
|
208
|
+
│ │ ├── agent-mesh.js # Inter-agent protocol (mesh)
|
|
209
|
+
│ │ ├── agent-learning.js # Local reinforcement learning (UCB1)
|
|
210
|
+
│ │ ├── agent-symphony.js # Symphony orchestrator (4 roles, 6 phases)
|
|
211
|
+
│ │ ├── agent-memory.js # Persistent agent memory with associations
|
|
212
|
+
│ │ ├── commander.js # Mission orchestration & task DAGs
|
|
213
|
+
│ │ ├── edge-compute.js # Edge computing / sovereign AI nodes
|
|
214
|
+
│ │ ├── swarm.js # Swarm execution engine
|
|
215
|
+
│ │ ├── fairness.js # Fairness & neutrality engine
|
|
216
|
+
│ │ ├── vision.js # Vision analysis (multi-provider)
|
|
217
|
+
│ │ ├── self-healing.js # Self-healing selector corrections
|
|
218
|
+
│ │ ├── local-ai.js # Local AI model runtime
|
|
219
|
+
│ │ ├── plugins.js # Plugin architecture (hooks, registry)
|
|
220
|
+
│ │ ├── premium.js # Premium traffic intelligence & bot detection
|
|
221
|
+
│ │ ├── email.js # SMTP email service
|
|
222
|
+
│ │ └── stripe.js # Stripe payment integration
|
|
152
223
|
│ ├── middleware/
|
|
153
|
-
│ │
|
|
224
|
+
│ │ ├── auth.js # JWT authentication middleware
|
|
225
|
+
│ │ ├── adminAuth.js # Admin authentication
|
|
226
|
+
│ │ └── rateLimits.js # Multi-layer rate limiting
|
|
154
227
|
│ ├── models/
|
|
155
|
-
│ │
|
|
156
|
-
│
|
|
228
|
+
│ │ ├── db.js # Database operations
|
|
229
|
+
│ │ └── adapters/ # SQLite, PostgreSQL, MySQL adapters
|
|
230
|
+
│ ├── migrations/ # Numbered SQL migrations
|
|
157
231
|
│ └── utils/
|
|
158
|
-
│ ├── cache.js
|
|
159
|
-
│
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
│ ├──
|
|
163
|
-
│ ├──
|
|
164
|
-
│ ├──
|
|
165
|
-
│ ├──
|
|
166
|
-
│ ├──
|
|
167
|
-
│ ├──
|
|
168
|
-
│
|
|
169
|
-
│
|
|
232
|
+
│ ├── cache.js # In-memory TTL cache + analytics queue
|
|
233
|
+
│ ├── migrate.js # Migration runner
|
|
234
|
+
│ └── secureFields.js # Field-level encryption utilities
|
|
235
|
+
├── public/ # Frontend
|
|
236
|
+
│ ├── index.html # Landing page
|
|
237
|
+
│ ├── dashboard.html # Management dashboard
|
|
238
|
+
│ ├── premium-dashboard.html # Premium analytics dashboard
|
|
239
|
+
│ ├── docs.html # Documentation
|
|
240
|
+
│ ├── login.html / register.html # Auth pages
|
|
241
|
+
│ ├── admin/ # Admin panel
|
|
242
|
+
│ ├── pwa/ # Progressive Web App (mobile browser)
|
|
243
|
+
│ │ ├── manifest.json # PWA manifest
|
|
244
|
+
│ │ ├── sw.js # Service worker (offline-first)
|
|
245
|
+
│ │ ├── index.html # Mobile browser UI
|
|
246
|
+
│ │ ├── app.js # Ad blocker, scam shield, fairness
|
|
247
|
+
│ │ ├── app.css # Mobile-optimized dark theme
|
|
248
|
+
│ │ └── icons/ # PWA icons (192x192, 512x512)
|
|
249
|
+
│ ├── script/
|
|
250
|
+
│ │ ├── wab.min.js # Minified WAB client library
|
|
251
|
+
│ │ ├── wab-consent.js # GDPR/CCPA consent banner
|
|
252
|
+
│ │ ├── wab-schema.js # Schema.org discovery
|
|
253
|
+
│ │ ├── wab.d.ts # TypeScript definitions
|
|
254
|
+
│ │ └── wab-consent.d.ts # Consent TypeScript definitions
|
|
255
|
+
│ ├── js/ # Dashboard frontend JS
|
|
256
|
+
│ └── css/ # Stylesheets
|
|
170
257
|
├── script/
|
|
171
|
-
│ └── ai-agent-bridge.js
|
|
172
|
-
├── examples/
|
|
173
|
-
├──
|
|
174
|
-
│ ├──
|
|
175
|
-
│ ├──
|
|
176
|
-
│ ├──
|
|
177
|
-
│
|
|
178
|
-
├──
|
|
258
|
+
│ └── ai-agent-bridge.js # The bridge script (embed in websites)
|
|
259
|
+
├── examples/ # Agent examples
|
|
260
|
+
│ ├── puppeteer-agent.js # Puppeteer + window.AICommands
|
|
261
|
+
│ ├── bidi-agent.js # WebDriver BiDi protocol
|
|
262
|
+
│ ├── vision-agent.js # Vision/NLP intent resolution
|
|
263
|
+
│ ├── mcp-agent.js # MCP adapter usage for Claude/GPT
|
|
264
|
+
│ ├── cross-site-agent.js # Multi-domain orchestration
|
|
265
|
+
│ ├── next-app-router/ # Next.js App Router integration
|
|
266
|
+
│ ├── shopify-hydrogen/ # Shopify Hydrogen storefront
|
|
267
|
+
│ ├── wordpress-elementor/ # WordPress + Elementor setup
|
|
268
|
+
│ └── saas-dashboard/ # SaaS dashboard actions
|
|
269
|
+
├── packages/ # Framework wrappers
|
|
270
|
+
│ ├── react/ # @web-agent-bridge/react
|
|
271
|
+
│ ├── vue/ # @web-agent-bridge/vue
|
|
272
|
+
│ ├── svelte/ # @web-agent-bridge/svelte
|
|
273
|
+
│ └── langchain/ # @web-agent-bridge/langchain
|
|
274
|
+
├── sdk/ # Agent SDK
|
|
275
|
+
│ ├── index.js # WABAgent for Puppeteer/Playwright
|
|
276
|
+
│ └── schema-discovery.js # Server-side schema.org extraction
|
|
277
|
+
├── wab-mcp-adapter/ # MCP adapter for Claude/GPT/Gemini
|
|
278
|
+
│ ├── index.js # MCP tool definitions
|
|
279
|
+
│ └── package.json
|
|
280
|
+
├── wab-browser/ # Electron desktop browser
|
|
281
|
+
│ ├── main.js # Electron main process
|
|
282
|
+
│ ├── preload.js # Bridge preload
|
|
283
|
+
│ └── package.json
|
|
284
|
+
├── web-agent-bridge-wordpress/ # WordPress plugin
|
|
285
|
+
│ ├── web-agent-bridge.php # Plugin entry point
|
|
286
|
+
│ ├── includes/ # PHP classes (API, Actions, Dashboard)
|
|
287
|
+
│ └── assets/ # Plugin CSS/JS
|
|
179
288
|
├── bin/
|
|
180
|
-
│ ├── cli.js
|
|
181
|
-
│ └──
|
|
182
|
-
├── templates/
|
|
183
|
-
├──
|
|
289
|
+
│ ├── cli.js # CLI entry point (wab-agent)
|
|
290
|
+
│ └── wab.js # Agent runner
|
|
291
|
+
├── templates/ # 11 Community Agent Hub YAML templates
|
|
292
|
+
├── docs/
|
|
293
|
+
│ ├── SPEC.md # WAB Protocol Specification
|
|
294
|
+
│ └── DEPLOY.md # Deployment guide
|
|
295
|
+
├── demo-store/ # Demo store for testing
|
|
296
|
+
├── deploy/ # Nginx configs
|
|
297
|
+
├── tests/ # Jest + Supertest test suite
|
|
298
|
+
├── .env # Environment variables
|
|
184
299
|
└── package.json
|
|
185
300
|
```
|
|
186
301
|
|
|
@@ -213,7 +328,7 @@ web-agent-bridge/
|
|
|
213
328
|
| `/api/license/verify` | POST | Verify license key for domain (cached) |
|
|
214
329
|
| `/api/license/token` | POST | Exchange `siteId` (Origin must match domain) or `licenseKey` for session token |
|
|
215
330
|
| `/api/license/session` | POST | Validate session token (domain-locked) |
|
|
216
|
-
| `/api/license/track` | POST | Record analytics (`sessionToken` + Origin
|
|
331
|
+
| `/api/license/track` | POST | Record analytics (`sessionToken` + Origin) |
|
|
217
332
|
|
|
218
333
|
### Sovereign (v2.0)
|
|
219
334
|
| Endpoint | Method | Description |
|
|
@@ -232,6 +347,72 @@ web-agent-bridge/
|
|
|
232
347
|
| `/api/sovereign/verify/page` | POST | Full page verification |
|
|
233
348
|
| `/api/sovereign/dashboard/sovereign` | GET | Dashboard aggregate data |
|
|
234
349
|
|
|
350
|
+
### Agent Mesh (v2.3)
|
|
351
|
+
| Endpoint | Method | Description |
|
|
352
|
+
|---|---|---|
|
|
353
|
+
| `/api/mesh/agents` | POST | Register agent in mesh |
|
|
354
|
+
| `/api/mesh/agents` | GET | List mesh agents |
|
|
355
|
+
| `/api/mesh/channels` | GET | List communication channels |
|
|
356
|
+
| `/api/mesh/messages` | POST | Publish message to channel |
|
|
357
|
+
| `/api/mesh/messages/:channel` | GET | Get messages from channel |
|
|
358
|
+
| `/api/mesh/knowledge` | POST | Share knowledge to mesh |
|
|
359
|
+
| `/api/mesh/knowledge` | GET | Query knowledge base |
|
|
360
|
+
| `/api/mesh/votes` | POST | Start a vote |
|
|
361
|
+
| `/api/mesh/votes/:id/cast` | POST | Cast a vote |
|
|
362
|
+
| `/api/mesh/votes/:id/tally` | GET | Get vote results |
|
|
363
|
+
|
|
364
|
+
### Commander (v2.4)
|
|
365
|
+
| Endpoint | Method | Description |
|
|
366
|
+
|---|---|---|
|
|
367
|
+
| `/api/commander/missions` | POST | Create a new mission |
|
|
368
|
+
| `/api/commander/missions/:id/launch` | POST | Launch mission execution |
|
|
369
|
+
| `/api/commander/missions/:id` | GET | Get mission status |
|
|
370
|
+
| `/api/commander/missions` | GET | List all missions |
|
|
371
|
+
| `/api/commander/agents` | POST | Register an agent |
|
|
372
|
+
| `/api/commander/agents` | GET | List registered agents |
|
|
373
|
+
| `/api/commander/edge/nodes` | POST | Register edge node |
|
|
374
|
+
| `/api/commander/edge/nodes` | GET | List edge nodes |
|
|
375
|
+
| `/api/commander/ai/models` | GET | Discover local AI models |
|
|
376
|
+
| `/api/commander/ai/infer` | POST | Run local AI inference |
|
|
377
|
+
| `/api/commander/stats` | GET | Unified platform statistics |
|
|
378
|
+
|
|
379
|
+
### Premium v2
|
|
380
|
+
| Endpoint | Method | Description |
|
|
381
|
+
|---|---|---|
|
|
382
|
+
| `/api/premium/v2/memory` | POST | Store agent memory |
|
|
383
|
+
| `/api/premium/v2/memory/:agentId` | GET | Recall agent memories |
|
|
384
|
+
| `/api/premium/v2/memory/associate` | POST | Create memory association |
|
|
385
|
+
| `/api/premium/v2/memory/:id` | DELETE | Forget a memory |
|
|
386
|
+
| `/api/premium/v2/memory/consolidate` | POST | Consolidate old memories |
|
|
387
|
+
| `/api/premium/v2/vision/analyze` | POST | Analyze screenshot |
|
|
388
|
+
| `/api/premium/v2/vision/elements` | POST | Extract interactive elements |
|
|
389
|
+
| `/api/premium/v2/healing/corrections` | POST | Register selector correction |
|
|
390
|
+
| `/api/premium/v2/healing/resolve` | POST | Resolve broken selector |
|
|
391
|
+
| `/api/premium/v2/swarm/execute` | POST | Launch swarm task |
|
|
392
|
+
| `/api/premium/v2/swarm/:id` | GET | Get swarm results |
|
|
393
|
+
| `/api/premium/v2/plugins` | GET | List available plugins |
|
|
394
|
+
| `/api/premium/v2/plugins/:id/install` | POST | Install plugin for site |
|
|
395
|
+
| `/api/premium/v2/plugins/:id/hooks` | POST | Execute plugin hook |
|
|
396
|
+
|
|
397
|
+
### Discovery & Fairness
|
|
398
|
+
| Endpoint | Method | Description |
|
|
399
|
+
|---|---|---|
|
|
400
|
+
| `/api/discovery` | GET | WAB discovery document |
|
|
401
|
+
| `/api/discovery/search` | GET | Fairness-weighted site search |
|
|
402
|
+
| `/api/discovery/register` | POST | Register site in WAB directory |
|
|
403
|
+
|
|
404
|
+
### WAB Protocol (HTTP Transport)
|
|
405
|
+
| Endpoint | Method | Description |
|
|
406
|
+
|---|---|---|
|
|
407
|
+
| `/api/wab/session` | POST | Exchange session token |
|
|
408
|
+
| `/api/wab/actions` | GET | Get available actions |
|
|
409
|
+
| `/api/wab/execute` | POST | Execute action via HTTP |
|
|
410
|
+
|
|
411
|
+
### NoScript Fallback
|
|
412
|
+
| Endpoint | Method | Description |
|
|
413
|
+
|---|---|---|
|
|
414
|
+
| `/noscript/pixel.gif` | GET | 1×1 tracking pixel for non-JS environments |
|
|
415
|
+
|
|
235
416
|
---
|
|
236
417
|
|
|
237
418
|
## Bridge Script API
|
|
@@ -603,6 +784,8 @@ Ready-to-run agent examples in the [`examples/`](examples/) directory:
|
|
|
603
784
|
| `puppeteer-agent.js` | Basic agent using Puppeteer + `window.AICommands` |
|
|
604
785
|
| `bidi-agent.js` | Agent using WebDriver BiDi protocol via `window.__wab_bidi` |
|
|
605
786
|
| `vision-agent.js` | Vision/NLP agent — resolves natural language intents to actions using a local keyword-based resolver (no external API) |
|
|
787
|
+
| `mcp-agent.js` | MCP adapter usage for Claude and GPT with tool discovery and execution |
|
|
788
|
+
| `cross-site-agent.js` | Multi-domain orchestration — compare prices across stores, aggregate data, find best deals |
|
|
606
789
|
|
|
607
790
|
## Framework + CMS Examples
|
|
608
791
|
|
|
@@ -971,6 +1154,368 @@ fairness_rules:
|
|
|
971
1154
|
|
|
972
1155
|
---
|
|
973
1156
|
|
|
1157
|
+
## Commander Agent System
|
|
1158
|
+
|
|
1159
|
+
The Commander is a local-first mission orchestration engine that decomposes high-level goals into task DAGs and distributes work across specialized agents:
|
|
1160
|
+
|
|
1161
|
+
```javascript
|
|
1162
|
+
// Create a mission
|
|
1163
|
+
const mission = await fetch('/api/commander/missions', {
|
|
1164
|
+
method: 'POST',
|
|
1165
|
+
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
1166
|
+
body: JSON.stringify({
|
|
1167
|
+
goal: 'Find the cheapest olive oil across 5 stores',
|
|
1168
|
+
strategy: 'parallel',
|
|
1169
|
+
agents: ['researcher-1', 'analyst-1', 'negotiator-1']
|
|
1170
|
+
})
|
|
1171
|
+
}).then(r => r.json());
|
|
1172
|
+
|
|
1173
|
+
// Launch mission
|
|
1174
|
+
await fetch(`/api/commander/missions/${mission.id}/launch`, { method: 'POST', headers: { 'Authorization': 'Bearer ' + token } });
|
|
1175
|
+
|
|
1176
|
+
// Check status
|
|
1177
|
+
const status = await fetch(`/api/commander/missions/${mission.id}`, { headers: { 'Authorization': 'Bearer ' + token } }).then(r => r.json());
|
|
1178
|
+
// → { status: 'completed', tasks: [...], result: { bestPrice: 12.99, store: 'farm-direct' } }
|
|
1179
|
+
```
|
|
1180
|
+
|
|
1181
|
+
### Commander Capabilities
|
|
1182
|
+
| Feature | Description |
|
|
1183
|
+
|---|---|
|
|
1184
|
+
| **Mission Decomposition** | Breaks high-level goals into task DAGs with dependency tracking |
|
|
1185
|
+
| **Agent Registry** | Tracks agent capabilities, availability, and performance history |
|
|
1186
|
+
| **Parallel Execution** | Runs independent tasks concurrently across multiple agents |
|
|
1187
|
+
| **Learning Integration** | Records outcomes for reinforcement learning feedback |
|
|
1188
|
+
| **Edge Coordination** | Distributes compute-heavy tasks to edge nodes |
|
|
1189
|
+
|
|
1190
|
+
---
|
|
1191
|
+
|
|
1192
|
+
## Edge Compute System
|
|
1193
|
+
|
|
1194
|
+
Transform every user device into a sovereign AI node — no central cloud required:
|
|
1195
|
+
|
|
1196
|
+
```javascript
|
|
1197
|
+
// Register a device as an edge node
|
|
1198
|
+
const node = await fetch('/api/commander/edge/nodes', {
|
|
1199
|
+
method: 'POST',
|
|
1200
|
+
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
1201
|
+
body: JSON.stringify({
|
|
1202
|
+
name: 'my-laptop',
|
|
1203
|
+
capabilities: { cpu: 8, ram: 16384, gpu: true },
|
|
1204
|
+
supportedTasks: ['text-inference', 'vision-analysis', 'price-comparison']
|
|
1205
|
+
})
|
|
1206
|
+
}).then(r => r.json());
|
|
1207
|
+
|
|
1208
|
+
// List available edge nodes
|
|
1209
|
+
const nodes = await fetch('/api/commander/edge/nodes', { headers: { 'Authorization': 'Bearer ' + token } }).then(r => r.json());
|
|
1210
|
+
```
|
|
1211
|
+
|
|
1212
|
+
| Feature | Description |
|
|
1213
|
+
|---|---|
|
|
1214
|
+
| **Hardware Profiling** | Detects CPU, RAM, GPU capabilities per node |
|
|
1215
|
+
| **AES-256-GCM Encryption** | All inter-node data is encrypted end-to-end |
|
|
1216
|
+
| **Weighted Load Balancing** | Routes tasks based on hardware + availability scores |
|
|
1217
|
+
| **Heartbeat Health Monitoring** | Auto-failover when nodes become unresponsive |
|
|
1218
|
+
| **Swarm Formation** | Capability-based clustering of nodes for distributed tasks |
|
|
1219
|
+
|
|
1220
|
+
---
|
|
1221
|
+
|
|
1222
|
+
## Swarm Execution Engine
|
|
1223
|
+
|
|
1224
|
+
Launch multiple agents in parallel to solve a single task, then intelligently merge their outputs:
|
|
1225
|
+
|
|
1226
|
+
```javascript
|
|
1227
|
+
// Launch a swarm task
|
|
1228
|
+
const swarm = await fetch('/api/premium/v2/swarm/execute', {
|
|
1229
|
+
method: 'POST',
|
|
1230
|
+
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
1231
|
+
body: JSON.stringify({
|
|
1232
|
+
task: 'Find best laptop deals under $1000',
|
|
1233
|
+
strategy: 'parallel', // parallel | sequential | hybrid
|
|
1234
|
+
agentCount: 4,
|
|
1235
|
+
roles: ['researcher', 'analyst', 'price-checker', 'reviewer'],
|
|
1236
|
+
mergeStrategy: 'best-score' // best-score | fairness-weighted | consensus
|
|
1237
|
+
})
|
|
1238
|
+
}).then(r => r.json());
|
|
1239
|
+
// → { swarmId: '...', agents: 4, status: 'running' }
|
|
1240
|
+
|
|
1241
|
+
// Get merged results
|
|
1242
|
+
const results = await fetch(`/api/premium/v2/swarm/${swarm.swarmId}`, {
|
|
1243
|
+
headers: { 'Authorization': 'Bearer ' + token }
|
|
1244
|
+
}).then(r => r.json());
|
|
1245
|
+
// → { status: 'completed', merged: { bestDeal: {...}, confidence: 0.94 } }
|
|
1246
|
+
```
|
|
1247
|
+
|
|
1248
|
+
---
|
|
1249
|
+
|
|
1250
|
+
## Fairness Engine
|
|
1251
|
+
|
|
1252
|
+
A neutrality layer ensuring AI agents give equal opportunity to small and large sites, preventing monopolistic concentration of agent traffic:
|
|
1253
|
+
|
|
1254
|
+
```javascript
|
|
1255
|
+
// Fairness-weighted search (instead of pure relevance)
|
|
1256
|
+
const results = await fetch('/api/discovery/search?q=olive+oil&fairness=true', {
|
|
1257
|
+
headers: { 'Authorization': 'Bearer ' + token }
|
|
1258
|
+
}).then(r => r.json());
|
|
1259
|
+
// Small farms ranked alongside Amazon — weighted by neutrality score, not just SEO
|
|
1260
|
+
|
|
1261
|
+
// Register site in WAB directory
|
|
1262
|
+
await fetch('/api/discovery/register', {
|
|
1263
|
+
method: 'POST',
|
|
1264
|
+
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
1265
|
+
body: JSON.stringify({
|
|
1266
|
+
domain: 'small-farm.example.com',
|
|
1267
|
+
category: 'food',
|
|
1268
|
+
commissionRate: 0, // Direct — no middleman
|
|
1269
|
+
independentSeller: true
|
|
1270
|
+
})
|
|
1271
|
+
}).then(r => r.json());
|
|
1272
|
+
```
|
|
1273
|
+
|
|
1274
|
+
### How Neutrality Scoring Works
|
|
1275
|
+
| Factor | Weight | Description |
|
|
1276
|
+
|---|---|---|
|
|
1277
|
+
| **Configuration completeness** | 25% | How well the site has configured WAB |
|
|
1278
|
+
| **Trust score** | 25% | Reputation attestations from the agent network |
|
|
1279
|
+
| **Transparency** | 25% | Commission disclosure, pricing clarity |
|
|
1280
|
+
| **Responsiveness** | 25% | API response time, uptime, action success rate |
|
|
1281
|
+
|
|
1282
|
+
Small independent sites with good WAB configuration can outrank large platforms on fairness-weighted searches.
|
|
1283
|
+
|
|
1284
|
+
---
|
|
1285
|
+
|
|
1286
|
+
## Agent Memory System
|
|
1287
|
+
|
|
1288
|
+
Persistent behavioral memory allowing agents to remember user preferences, learn patterns, and build associations:
|
|
1289
|
+
|
|
1290
|
+
```javascript
|
|
1291
|
+
// Store a memory
|
|
1292
|
+
await fetch('/api/premium/v2/memory', {
|
|
1293
|
+
method: 'POST',
|
|
1294
|
+
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
1295
|
+
body: JSON.stringify({
|
|
1296
|
+
agentId: 'agent-1',
|
|
1297
|
+
type: 'preference', // preference | interaction | correction | pattern
|
|
1298
|
+
category: 'purchase', // navigation | purchase | search | form | custom
|
|
1299
|
+
key: 'preferred-brand',
|
|
1300
|
+
value: 'organic-only',
|
|
1301
|
+
importance: 0.9
|
|
1302
|
+
})
|
|
1303
|
+
}).then(r => r.json());
|
|
1304
|
+
|
|
1305
|
+
// Recall memories
|
|
1306
|
+
const memories = await fetch('/api/premium/v2/memory/agent-1?category=purchase&limit=10', {
|
|
1307
|
+
headers: { 'Authorization': 'Bearer ' + token }
|
|
1308
|
+
}).then(r => r.json());
|
|
1309
|
+
|
|
1310
|
+
// Create associations
|
|
1311
|
+
await fetch('/api/premium/v2/memory/associate', {
|
|
1312
|
+
method: 'POST',
|
|
1313
|
+
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
1314
|
+
body: JSON.stringify({
|
|
1315
|
+
sourceId: 'memory-1',
|
|
1316
|
+
targetId: 'memory-2',
|
|
1317
|
+
relationship: 'leads_to' // leads_to | similar_to | replaces | depends_on
|
|
1318
|
+
})
|
|
1319
|
+
}).then(r => r.json());
|
|
1320
|
+
```
|
|
1321
|
+
|
|
1322
|
+
---
|
|
1323
|
+
|
|
1324
|
+
## Vision Analysis Service
|
|
1325
|
+
|
|
1326
|
+
Multi-provider screenshot analysis for interactive element detection and data extraction:
|
|
1327
|
+
|
|
1328
|
+
```javascript
|
|
1329
|
+
// Analyze a screenshot
|
|
1330
|
+
const analysis = await fetch('/api/premium/v2/vision/analyze', {
|
|
1331
|
+
method: 'POST',
|
|
1332
|
+
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
1333
|
+
body: JSON.stringify({
|
|
1334
|
+
screenshot: 'base64-encoded-image...',
|
|
1335
|
+
provider: 'auto', // auto | local | openai | anthropic | ollama
|
|
1336
|
+
extractElements: true
|
|
1337
|
+
})
|
|
1338
|
+
}).then(r => r.json());
|
|
1339
|
+
// → { elements: [{ type: 'button', text: 'Add to Cart', selector: '#add-btn', confidence: 0.95, bbox: [120, 340, 200, 40] }] }
|
|
1340
|
+
|
|
1341
|
+
// Extract interactive elements only
|
|
1342
|
+
const elements = await fetch('/api/premium/v2/vision/elements', {
|
|
1343
|
+
method: 'POST',
|
|
1344
|
+
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
1345
|
+
body: JSON.stringify({ screenshot: 'base64...', types: ['button', 'input', 'link'] })
|
|
1346
|
+
}).then(r => r.json());
|
|
1347
|
+
```
|
|
1348
|
+
|
|
1349
|
+
### Supported Vision Providers
|
|
1350
|
+
| Provider | Local? | Description |
|
|
1351
|
+
|---|---|---|
|
|
1352
|
+
| **Moondream** | ✅ | Lightweight local vision model |
|
|
1353
|
+
| **Ollama** | ✅ | Local models via Ollama (llava, bakllava) |
|
|
1354
|
+
| **OpenAI** | ❌ | GPT-4 Vision |
|
|
1355
|
+
| **Anthropic** | ❌ | Claude Vision |
|
|
1356
|
+
|
|
1357
|
+
---
|
|
1358
|
+
|
|
1359
|
+
## Plugin Architecture
|
|
1360
|
+
|
|
1361
|
+
Dynamic plugin system allowing third-party extensions:
|
|
1362
|
+
|
|
1363
|
+
```javascript
|
|
1364
|
+
// List available plugins
|
|
1365
|
+
const plugins = await fetch('/api/premium/v2/plugins', {
|
|
1366
|
+
headers: { 'Authorization': 'Bearer ' + token }
|
|
1367
|
+
}).then(r => r.json());
|
|
1368
|
+
|
|
1369
|
+
// Install a plugin for your site
|
|
1370
|
+
await fetch('/api/premium/v2/plugins/price-alert/install', {
|
|
1371
|
+
method: 'POST',
|
|
1372
|
+
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
1373
|
+
body: JSON.stringify({ siteId: 'site-uuid', config: { threshold: 10 } })
|
|
1374
|
+
}).then(r => r.json());
|
|
1375
|
+
|
|
1376
|
+
// Execute a plugin hook
|
|
1377
|
+
await fetch('/api/premium/v2/plugins/price-alert/hooks', {
|
|
1378
|
+
method: 'POST',
|
|
1379
|
+
headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': 'application/json' },
|
|
1380
|
+
body: JSON.stringify({ hook: 'onPriceChange', data: { oldPrice: 49.99, newPrice: 39.99 } })
|
|
1381
|
+
}).then(r => r.json());
|
|
1382
|
+
```
|
|
1383
|
+
|
|
1384
|
+
---
|
|
1385
|
+
|
|
1386
|
+
## Premium Traffic Intelligence
|
|
1387
|
+
|
|
1388
|
+
Advanced bot detection and traffic profiling for premium sites:
|
|
1389
|
+
|
|
1390
|
+
| Capability | Description |
|
|
1391
|
+
|---|---|
|
|
1392
|
+
| **30+ Bot Types** | Detects Google, Bing, ChatGPT, Claude, Perplexity, and more |
|
|
1393
|
+
| **Behavioral Profiling** | Classifies agent behavior by signature, platform, and type |
|
|
1394
|
+
| **Anomaly Detection** | Spike detection and pattern analysis for unusual traffic |
|
|
1395
|
+
| **Security Exploit Detection** | Flags SQL injection, XSS patterns, and rate anomalies |
|
|
1396
|
+
| **Webhook Alerting** | Triggers webhooks on suspicious activity |
|
|
1397
|
+
| **Compliance Audit Logging** | Full audit trail for regulatory compliance |
|
|
1398
|
+
|
|
1399
|
+
---
|
|
1400
|
+
|
|
1401
|
+
## WAB-MCP Adapter
|
|
1402
|
+
|
|
1403
|
+
Expose WAB site capabilities as [Model Context Protocol (MCP)](https://modelcontextprotocol.io/) tools for Claude, GPT, Gemini, and other MCP-compatible AI agents:
|
|
1404
|
+
|
|
1405
|
+
```javascript
|
|
1406
|
+
const { WABMCPAdapter } = require('wab-mcp-adapter');
|
|
1407
|
+
|
|
1408
|
+
// Create adapter for a WAB-enabled site
|
|
1409
|
+
const adapter = new WABMCPAdapter({
|
|
1410
|
+
siteUrl: 'https://shop.example.com',
|
|
1411
|
+
transport: 'http' // http | websocket | direct
|
|
1412
|
+
});
|
|
1413
|
+
|
|
1414
|
+
// Get MCP tool definitions
|
|
1415
|
+
const tools = await adapter.getTools();
|
|
1416
|
+
// → [{ name: 'discover', description: '...', inputSchema: {...} }, ...]
|
|
1417
|
+
|
|
1418
|
+
// Execute via MCP
|
|
1419
|
+
const result = await adapter.executeTool('execute_action', {
|
|
1420
|
+
name: 'addToCart',
|
|
1421
|
+
params: { sku: 'ABC123' }
|
|
1422
|
+
});
|
|
1423
|
+
```
|
|
1424
|
+
|
|
1425
|
+
### Built-in MCP Tools
|
|
1426
|
+
| Tool | Description |
|
|
1427
|
+
|---|---|
|
|
1428
|
+
| `discover` | Auto-discover available actions on a WAB site |
|
|
1429
|
+
| `get_actions` | Get list of all actions with parameters |
|
|
1430
|
+
| `execute_action` | Execute a specific action |
|
|
1431
|
+
| `read_content` | Read content from the page |
|
|
1432
|
+
| `get_page_info` | Get page metadata |
|
|
1433
|
+
| `fairness_search` | Search the WAB directory with fairness weighting |
|
|
1434
|
+
| `authenticate` | Authenticate an agent with the site |
|
|
1435
|
+
|
|
1436
|
+
---
|
|
1437
|
+
|
|
1438
|
+
## WAB Browser (Desktop)
|
|
1439
|
+
|
|
1440
|
+
Standalone Electron desktop browser with built-in privacy and fairness features:
|
|
1441
|
+
|
|
1442
|
+
- **Ad Blocker** — 80+ blocked ad domains + URL pattern matching + cosmetic CSS rules
|
|
1443
|
+
- **Scam Shield** — Detects suspicious TLDs and brand-name spoofing in URLs
|
|
1444
|
+
- **Fairness Ranking** — Prioritizes independent sites, flags big-tech concentration
|
|
1445
|
+
- **Agent Chat** — Built-in AI assistant panel for browsing help
|
|
1446
|
+
- **Notifications** — Page analysis with safety and fairness alerts
|
|
1447
|
+
- **Ghost Mode** — Privacy-first browsing with no tracking
|
|
1448
|
+
- **Smart Search** — WAB Search integration for independent search
|
|
1449
|
+
- **Desktop/Mobile Toggle** — Switch user-agent for responsive testing
|
|
1450
|
+
|
|
1451
|
+
```bash
|
|
1452
|
+
# Run the WAB Browser
|
|
1453
|
+
cd wab-browser
|
|
1454
|
+
npm install
|
|
1455
|
+
npx electron .
|
|
1456
|
+
|
|
1457
|
+
# Build installer (Windows NSIS)
|
|
1458
|
+
npm run build:win
|
|
1459
|
+
```
|
|
1460
|
+
|
|
1461
|
+
---
|
|
1462
|
+
|
|
1463
|
+
## PWA Browser (Mobile)
|
|
1464
|
+
|
|
1465
|
+
Progressive Web App browser for Android and iOS — installable from any mobile browser:
|
|
1466
|
+
|
|
1467
|
+
- **Ad Blocker** — 80+ ad domain blacklist + URL pattern matching
|
|
1468
|
+
- **Scam Detection** — Suspicious TLD alerts and brand-name spoofing checks
|
|
1469
|
+
- **Fairness Mode** — Filters big-tech sites to promote independent alternatives
|
|
1470
|
+
- **Offline-First** — Service worker caches shell assets for offline launch
|
|
1471
|
+
- **WAB Search** — Independent search engine with multi-source aggregation, autocomplete, and trending
|
|
1472
|
+
- **AI Agent Chat** — Real AI agent (OpenAI / local Ollama / smart fallback) with conversation memory, web search, and security analysis
|
|
1473
|
+
|
|
1474
|
+
Install at: `https://yourserver.com/pwa/`
|
|
1475
|
+
|
|
1476
|
+
---
|
|
1477
|
+
|
|
1478
|
+
## WordPress Plugin
|
|
1479
|
+
|
|
1480
|
+
Native WordPress plugin for adding WAB support to any WordPress site:
|
|
1481
|
+
|
|
1482
|
+
```bash
|
|
1483
|
+
# Install
|
|
1484
|
+
cp -r web-agent-bridge-wordpress/ /wp-content/plugins/web-agent-bridge/
|
|
1485
|
+
```
|
|
1486
|
+
|
|
1487
|
+
| Feature | Description |
|
|
1488
|
+
|---|---|
|
|
1489
|
+
| **Settings Page** | Configure API base URL, site ID, permissions |
|
|
1490
|
+
| **Per-Page Actions** | Meta box for adding custom WAB actions per page/post |
|
|
1491
|
+
| **Discovery Document** | Auto-generates WAB discovery endpoint |
|
|
1492
|
+
| **Dashboard Widget** | Shows WAB status and agent interaction stats |
|
|
1493
|
+
| **Shortcode** | `[wab_bridge]` shortcode for embedding WAB on specific pages |
|
|
1494
|
+
| **Hooks API** | `wab_before_action` / `wab_after_action` for custom logic |
|
|
1495
|
+
|
|
1496
|
+
See [`web-agent-bridge-wordpress/README.md`](web-agent-bridge-wordpress/README.md) for full documentation.
|
|
1497
|
+
|
|
1498
|
+
---
|
|
1499
|
+
|
|
1500
|
+
## WAB Protocol Specification
|
|
1501
|
+
|
|
1502
|
+
The full normative specification is available at [`docs/SPEC.md`](docs/SPEC.md):
|
|
1503
|
+
|
|
1504
|
+
| Layer | Description |
|
|
1505
|
+
|---|---|
|
|
1506
|
+
| **Protocol Layer** | Discovery document format, command protocol, fairness protocol |
|
|
1507
|
+
| **Runtime Layer** | `window.AICommands` interface, auto-discovery engine, security sandbox |
|
|
1508
|
+
| **Transport Layer** | JavaScript global, WebSocket, HTTP, WebDriver BiDi, MCP |
|
|
1509
|
+
|
|
1510
|
+
### 5-Phase Lifecycle
|
|
1511
|
+
1. **Discover** — Agent finds WAB discovery document (`.well-known/wab.json` or script tag)
|
|
1512
|
+
2. **Authenticate** — Agent exchanges `siteId` for session token
|
|
1513
|
+
3. **Plan** — Agent reads available actions and page metadata
|
|
1514
|
+
4. **Execute** — Agent runs actions through the bridge
|
|
1515
|
+
5. **Confirm** — Results are verified via Anti-Hallucination Shield
|
|
1516
|
+
|
|
1517
|
+
---
|
|
1518
|
+
|
|
974
1519
|
## License
|
|
975
1520
|
|
|
976
1521
|
MIT — Free to use, modify, and distribute.
|