web-agent-bridge 1.1.2 → 2.0.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/LICENSE +21 -21
- package/README.ar.md +446 -446
- package/README.md +780 -844
- package/bin/cli.js +80 -80
- package/bin/wab.js +80 -80
- package/examples/bidi-agent.js +119 -119
- package/examples/mcp-agent.js +94 -94
- package/examples/next-app-router/README.md +44 -0
- package/examples/puppeteer-agent.js +108 -108
- package/examples/saas-dashboard/README.md +55 -0
- package/examples/shopify-hydrogen/README.md +74 -0
- package/examples/vision-agent.js +171 -171
- package/examples/wordpress-elementor/README.md +77 -0
- package/package.json +69 -78
- package/public/.well-known/ai-assets.json +59 -0
- package/public/admin/login.html +84 -84
- package/public/ai.html +196 -0
- package/public/cookies.html +208 -208
- package/public/css/premium.css +317 -0
- package/public/css/styles.css +1235 -1235
- package/public/dashboard.html +704 -704
- package/public/demo.html +259 -0
- package/public/docs.html +585 -585
- package/public/feed.xml +89 -0
- package/public/index.html +495 -332
- package/public/js/auth-nav.js +31 -31
- package/public/js/auth-redirect.js +12 -12
- package/public/js/cookie-consent.js +56 -56
- package/public/js/wab-demo-page.js +721 -0
- package/public/js/ws-client.js +74 -74
- package/public/llms-full.txt +309 -0
- package/public/llms.txt +85 -0
- package/public/login.html +83 -83
- package/public/openapi.json +580 -0
- package/public/premium-dashboard.html +2487 -0
- package/public/premium.html +791 -0
- package/public/privacy.html +295 -295
- package/public/register.html +103 -103
- package/public/robots.txt +87 -0
- package/public/script/wab-consent.d.ts +36 -0
- package/public/script/wab-consent.js +104 -0
- package/public/script/wab-schema.js +131 -0
- package/public/script/wab.d.ts +108 -0
- package/public/script/wab.min.js +234 -0
- package/public/sitemap.xml +93 -0
- package/public/terms.html +254 -254
- package/public/video/tutorial.mp4 +0 -0
- package/script/ai-agent-bridge.js +1558 -1513
- package/sdk/README.md +55 -55
- package/sdk/index.d.ts +118 -0
- package/sdk/index.js +257 -203
- package/sdk/package.json +14 -14
- package/sdk/schema-discovery.js +83 -0
- package/server/config/secrets.js +94 -92
- package/server/index.js +0 -9
- package/server/middleware/adminAuth.js +30 -30
- package/server/middleware/auth.js +41 -41
- package/server/middleware/rateLimits.js +24 -24
- package/server/migrations/001_add_analytics_indexes.sql +7 -7
- package/server/migrations/002_premium_features.sql +418 -0
- package/server/models/adapters/index.js +33 -33
- package/server/models/adapters/mysql.js +183 -183
- package/server/models/adapters/postgresql.js +172 -172
- package/server/models/adapters/sqlite.js +7 -7
- package/server/models/db.js +561 -561
- package/server/routes/admin-premium.js +671 -0
- package/server/routes/admin.js +247 -247
- package/server/routes/api.js +131 -138
- package/server/routes/auth.js +51 -51
- package/server/routes/billing.js +45 -45
- package/server/routes/discovery.js +406 -329
- package/server/routes/license.js +240 -240
- package/server/routes/noscript.js +543 -543
- package/server/routes/premium-v2.js +686 -0
- package/server/routes/premium.js +724 -0
- package/server/routes/wab-api.js +476 -476
- package/server/services/agent-memory.js +625 -0
- package/server/services/email.js +204 -204
- package/server/services/fairness.js +420 -420
- package/server/services/plugins.js +747 -0
- package/server/services/premium.js +1883 -0
- package/server/services/self-healing.js +843 -0
- package/server/services/stripe.js +192 -192
- package/server/services/swarm.js +788 -0
- package/server/services/vision.js +871 -0
- package/server/utils/cache.js +125 -125
- package/server/utils/migrate.js +81 -81
- package/server/utils/secureFields.js +50 -50
- package/server/ws.js +101 -101
- package/docs/DEPLOY.md +0 -118
- package/docs/SPEC.md +0 -1540
- package/wab-mcp-adapter/README.md +0 -136
- package/wab-mcp-adapter/index.js +0 -555
- package/wab-mcp-adapter/package.json +0 -17
package/public/js/auth-nav.js
CHANGED
|
@@ -1,31 +1,31 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shows / hides UI by auth state using data-wab-auth="signed-in" | "guest"
|
|
3
|
-
* Run on DOMContentLoaded — keep dashboard links only for signed-in users.
|
|
4
|
-
*/
|
|
5
|
-
(function () {
|
|
6
|
-
function hasToken() {
|
|
7
|
-
try {
|
|
8
|
-
return !!localStorage.getItem('wab_token');
|
|
9
|
-
} catch (e) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
function apply() {
|
|
15
|
-
var signedIn = hasToken();
|
|
16
|
-
document.querySelectorAll('[data-wab-auth]').forEach(function (el) {
|
|
17
|
-
var mode = el.getAttribute('data-wab-auth');
|
|
18
|
-
if (mode === 'signed-in') {
|
|
19
|
-
el.style.display = signedIn ? '' : 'none';
|
|
20
|
-
} else if (mode === 'guest') {
|
|
21
|
-
el.style.display = signedIn ? 'none' : '';
|
|
22
|
-
}
|
|
23
|
-
});
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
if (document.readyState === 'loading') {
|
|
27
|
-
document.addEventListener('DOMContentLoaded', apply);
|
|
28
|
-
} else {
|
|
29
|
-
apply();
|
|
30
|
-
}
|
|
31
|
-
})();
|
|
1
|
+
/**
|
|
2
|
+
* Shows / hides UI by auth state using data-wab-auth="signed-in" | "guest"
|
|
3
|
+
* Run on DOMContentLoaded — keep dashboard links only for signed-in users.
|
|
4
|
+
*/
|
|
5
|
+
(function () {
|
|
6
|
+
function hasToken() {
|
|
7
|
+
try {
|
|
8
|
+
return !!localStorage.getItem('wab_token');
|
|
9
|
+
} catch (e) {
|
|
10
|
+
return false;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function apply() {
|
|
15
|
+
var signedIn = hasToken();
|
|
16
|
+
document.querySelectorAll('[data-wab-auth]').forEach(function (el) {
|
|
17
|
+
var mode = el.getAttribute('data-wab-auth');
|
|
18
|
+
if (mode === 'signed-in') {
|
|
19
|
+
el.style.display = signedIn ? '' : 'none';
|
|
20
|
+
} else if (mode === 'guest') {
|
|
21
|
+
el.style.display = signedIn ? 'none' : '';
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (document.readyState === 'loading') {
|
|
27
|
+
document.addEventListener('DOMContentLoaded', apply);
|
|
28
|
+
} else {
|
|
29
|
+
apply();
|
|
30
|
+
}
|
|
31
|
+
})();
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Safe redirect target after login/register (?next=/path)
|
|
3
|
-
*/
|
|
4
|
-
(function () {
|
|
5
|
-
window.wabGetPostAuthRedirect = function () {
|
|
6
|
-
try {
|
|
7
|
-
var p = new URLSearchParams(window.location.search).get('next');
|
|
8
|
-
if (p && p.charAt(0) === '/' && p.indexOf('//') !== 0) return p;
|
|
9
|
-
} catch (e) {}
|
|
10
|
-
return '/dashboard';
|
|
11
|
-
};
|
|
12
|
-
})();
|
|
1
|
+
/**
|
|
2
|
+
* Safe redirect target after login/register (?next=/path)
|
|
3
|
+
*/
|
|
4
|
+
(function () {
|
|
5
|
+
window.wabGetPostAuthRedirect = function () {
|
|
6
|
+
try {
|
|
7
|
+
var p = new URLSearchParams(window.location.search).get('next');
|
|
8
|
+
if (p && p.charAt(0) === '/' && p.indexOf('//') !== 0) return p;
|
|
9
|
+
} catch (e) {}
|
|
10
|
+
return '/dashboard';
|
|
11
|
+
};
|
|
12
|
+
})();
|
|
@@ -1,56 +1,56 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* WAB Cookie Consent Banner
|
|
3
|
-
* Compliant with EU ePrivacy Directive & Dutch Telecommunicatiewet Art. 11.7a
|
|
4
|
-
* Auto-injects a cookie consent banner if user hasn't consented yet.
|
|
5
|
-
*/
|
|
6
|
-
(function () {
|
|
7
|
-
if (localStorage.getItem('wab_cookie_consent')) return;
|
|
8
|
-
|
|
9
|
-
var banner = document.createElement('div');
|
|
10
|
-
banner.id = 'wab-cookie-banner';
|
|
11
|
-
banner.setAttribute('role', 'dialog');
|
|
12
|
-
banner.setAttribute('aria-label', 'Cookie consent');
|
|
13
|
-
banner.innerHTML =
|
|
14
|
-
'<div class="wab-cookie-inner">' +
|
|
15
|
-
'<p>We use essential cookies (authentication tokens) to keep you signed in. ' +
|
|
16
|
-
'We do not use tracking or marketing cookies. ' +
|
|
17
|
-
'See our <a href="/cookies">Cookie Policy</a> and <a href="/privacy">Privacy Policy</a>.</p>' +
|
|
18
|
-
'<div class="wab-cookie-actions">' +
|
|
19
|
-
'<button id="wab-cookie-accept" class="wab-cookie-btn wab-cookie-btn-primary">Accept</button>' +
|
|
20
|
-
'<button id="wab-cookie-decline" class="wab-cookie-btn wab-cookie-btn-ghost">Essential Only</button>' +
|
|
21
|
-
'</div>' +
|
|
22
|
-
'</div>';
|
|
23
|
-
|
|
24
|
-
var style = document.createElement('style');
|
|
25
|
-
style.textContent =
|
|
26
|
-
'#wab-cookie-banner{position:fixed;bottom:0;left:0;right:0;z-index:10000;' +
|
|
27
|
-
'background:rgba(10,14,26,0.97);border-top:1px solid rgba(59,130,246,0.2);' +
|
|
28
|
-
'padding:16px 0;font-family:Inter,system-ui,sans-serif;backdrop-filter:blur(12px)}' +
|
|
29
|
-
'.wab-cookie-inner{max-width:960px;margin:0 auto;padding:0 24px;display:flex;' +
|
|
30
|
-
'align-items:center;gap:20px;flex-wrap:wrap}' +
|
|
31
|
-
'.wab-cookie-inner p{flex:1;min-width:280px;color:#94a3b8;font-size:0.875rem;line-height:1.6;margin:0}' +
|
|
32
|
-
'.wab-cookie-inner a{color:#3b82f6;text-decoration:none}' +
|
|
33
|
-
'.wab-cookie-inner a:hover{text-decoration:underline}' +
|
|
34
|
-
'.wab-cookie-actions{display:flex;gap:10px;flex-shrink:0}' +
|
|
35
|
-
'.wab-cookie-btn{padding:8px 20px;border-radius:8px;font-size:0.85rem;font-weight:500;cursor:pointer;' +
|
|
36
|
-
'border:none;transition:all 0.2s}' +
|
|
37
|
-
'.wab-cookie-btn-primary{background:#3b82f6;color:#fff}' +
|
|
38
|
-
'.wab-cookie-btn-primary:hover{background:#2563eb}' +
|
|
39
|
-
'.wab-cookie-btn-ghost{background:transparent;color:#94a3b8;border:1px solid rgba(148,163,184,0.3)}' +
|
|
40
|
-
'.wab-cookie-btn-ghost:hover{color:#e2e8f0;border-color:rgba(148,163,184,0.5)}' +
|
|
41
|
-
'@media(max-width:600px){.wab-cookie-inner{flex-direction:column;text-align:center}' +
|
|
42
|
-
'.wab-cookie-actions{width:100%;justify-content:center}}';
|
|
43
|
-
|
|
44
|
-
document.head.appendChild(style);
|
|
45
|
-
document.body.appendChild(banner);
|
|
46
|
-
|
|
47
|
-
document.getElementById('wab-cookie-accept').addEventListener('click', function () {
|
|
48
|
-
localStorage.setItem('wab_cookie_consent', 'all');
|
|
49
|
-
banner.remove();
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
document.getElementById('wab-cookie-decline').addEventListener('click', function () {
|
|
53
|
-
localStorage.setItem('wab_cookie_consent', 'essential');
|
|
54
|
-
banner.remove();
|
|
55
|
-
});
|
|
56
|
-
})();
|
|
1
|
+
/**
|
|
2
|
+
* WAB Cookie Consent Banner
|
|
3
|
+
* Compliant with EU ePrivacy Directive & Dutch Telecommunicatiewet Art. 11.7a
|
|
4
|
+
* Auto-injects a cookie consent banner if user hasn't consented yet.
|
|
5
|
+
*/
|
|
6
|
+
(function () {
|
|
7
|
+
if (localStorage.getItem('wab_cookie_consent')) return;
|
|
8
|
+
|
|
9
|
+
var banner = document.createElement('div');
|
|
10
|
+
banner.id = 'wab-cookie-banner';
|
|
11
|
+
banner.setAttribute('role', 'dialog');
|
|
12
|
+
banner.setAttribute('aria-label', 'Cookie consent');
|
|
13
|
+
banner.innerHTML =
|
|
14
|
+
'<div class="wab-cookie-inner">' +
|
|
15
|
+
'<p>We use essential cookies (authentication tokens) to keep you signed in. ' +
|
|
16
|
+
'We do not use tracking or marketing cookies. ' +
|
|
17
|
+
'See our <a href="/cookies">Cookie Policy</a> and <a href="/privacy">Privacy Policy</a>.</p>' +
|
|
18
|
+
'<div class="wab-cookie-actions">' +
|
|
19
|
+
'<button id="wab-cookie-accept" class="wab-cookie-btn wab-cookie-btn-primary">Accept</button>' +
|
|
20
|
+
'<button id="wab-cookie-decline" class="wab-cookie-btn wab-cookie-btn-ghost">Essential Only</button>' +
|
|
21
|
+
'</div>' +
|
|
22
|
+
'</div>';
|
|
23
|
+
|
|
24
|
+
var style = document.createElement('style');
|
|
25
|
+
style.textContent =
|
|
26
|
+
'#wab-cookie-banner{position:fixed;bottom:0;left:0;right:0;z-index:10000;' +
|
|
27
|
+
'background:rgba(10,14,26,0.97);border-top:1px solid rgba(59,130,246,0.2);' +
|
|
28
|
+
'padding:16px 0;font-family:Inter,system-ui,sans-serif;backdrop-filter:blur(12px)}' +
|
|
29
|
+
'.wab-cookie-inner{max-width:960px;margin:0 auto;padding:0 24px;display:flex;' +
|
|
30
|
+
'align-items:center;gap:20px;flex-wrap:wrap}' +
|
|
31
|
+
'.wab-cookie-inner p{flex:1;min-width:280px;color:#94a3b8;font-size:0.875rem;line-height:1.6;margin:0}' +
|
|
32
|
+
'.wab-cookie-inner a{color:#3b82f6;text-decoration:none}' +
|
|
33
|
+
'.wab-cookie-inner a:hover{text-decoration:underline}' +
|
|
34
|
+
'.wab-cookie-actions{display:flex;gap:10px;flex-shrink:0}' +
|
|
35
|
+
'.wab-cookie-btn{padding:8px 20px;border-radius:8px;font-size:0.85rem;font-weight:500;cursor:pointer;' +
|
|
36
|
+
'border:none;transition:all 0.2s}' +
|
|
37
|
+
'.wab-cookie-btn-primary{background:#3b82f6;color:#fff}' +
|
|
38
|
+
'.wab-cookie-btn-primary:hover{background:#2563eb}' +
|
|
39
|
+
'.wab-cookie-btn-ghost{background:transparent;color:#94a3b8;border:1px solid rgba(148,163,184,0.3)}' +
|
|
40
|
+
'.wab-cookie-btn-ghost:hover{color:#e2e8f0;border-color:rgba(148,163,184,0.5)}' +
|
|
41
|
+
'@media(max-width:600px){.wab-cookie-inner{flex-direction:column;text-align:center}' +
|
|
42
|
+
'.wab-cookie-actions{width:100%;justify-content:center}}';
|
|
43
|
+
|
|
44
|
+
document.head.appendChild(style);
|
|
45
|
+
document.body.appendChild(banner);
|
|
46
|
+
|
|
47
|
+
document.getElementById('wab-cookie-accept').addEventListener('click', function () {
|
|
48
|
+
localStorage.setItem('wab_cookie_consent', 'all');
|
|
49
|
+
banner.remove();
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
document.getElementById('wab-cookie-decline').addEventListener('click', function () {
|
|
53
|
+
localStorage.setItem('wab_cookie_consent', 'essential');
|
|
54
|
+
banner.remove();
|
|
55
|
+
});
|
|
56
|
+
})();
|