web-agent-bridge 3.4.0 → 3.8.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/LICENSE +84 -84
- package/README.ar.md +1563 -1304
- package/README.md +137 -298
- package/bin/agent-runner.js +474 -474
- package/bin/cli.js +237 -237
- package/bin/wab-init.js +244 -223
- package/bin/wab.js +80 -80
- package/examples/azure-dns-wab.js +83 -83
- package/examples/bidi-agent.js +119 -119
- package/examples/cloudflare-wab-dns.js +121 -121
- package/examples/cpanel-wab-dns.js +114 -114
- package/examples/cross-site-agent.js +91 -91
- package/examples/dns-discovery-agent.js +166 -166
- package/examples/gcp-dns-wab.js +76 -76
- package/examples/governance-agent.js +169 -169
- package/examples/mcp-agent.js +94 -94
- package/examples/next-app-router/README.md +44 -44
- package/examples/plesk-wab-dns.js +103 -103
- package/examples/puppeteer-agent.js +108 -108
- package/examples/route53-wab-dns.js +144 -144
- package/examples/saas-dashboard/README.md +55 -55
- package/examples/safe-mode-agent.js +96 -96
- package/examples/self-discovery.js +106 -0
- package/examples/shopify-hydrogen/README.md +74 -74
- package/examples/vision-agent.js +171 -171
- package/examples/wab-sign.js +74 -74
- package/examples/wab-verify.js +60 -60
- package/examples/wordpress-elementor/README.md +77 -77
- package/package.json +93 -93
- package/public/.well-known/agent-tools.json +180 -180
- package/public/.well-known/ai-assets.json +59 -59
- package/public/.well-known/security.txt +8 -8
- package/public/.well-known/wab.json +28 -28
- package/public/activate.html +448 -368
- package/public/adopt.html +236 -0
- package/public/adoption-metrics.html +188 -188
- package/public/agent-workspace.html +359 -349
- package/public/ai.html +198 -198
- package/public/api.html +397 -413
- package/public/azure-dns-integration.html +289 -289
- package/public/browser.html +486 -486
- package/public/cloudflare-integration.html +380 -380
- package/public/commander-dashboard.html +243 -243
- package/public/cookies.html +210 -210
- package/public/cpanel-integration.html +398 -398
- package/public/css/agent-workspace.css +1713 -1713
- package/public/css/premium.css +317 -317
- package/public/css/styles.css +1401 -1263
- package/public/dashboard-shieldlink.html +295 -0
- package/public/dashboard.html +711 -707
- package/public/dns.html +436 -436
- package/public/docs.html +588 -588
- package/public/enterprise-mesh.ar.html +80 -0
- package/public/enterprise-mesh.html +81 -0
- package/public/feed.xml +89 -89
- package/public/gcp-dns-integration.html +318 -318
- package/public/governance.ar.html +70 -0
- package/public/governance.html +69 -0
- package/public/growth.html +465 -465
- package/public/index.html +1372 -1266
- package/public/integrations.html +556 -556
- package/public/js/activate.js +449 -145
- package/public/js/agent-workspace.js +1740 -1740
- package/public/js/auth-nav.js +117 -65
- package/public/js/auth-redirect.js +12 -12
- package/public/js/cookie-consent.js +56 -56
- package/public/js/dns.js +438 -438
- package/public/js/wab-demo-page.js +721 -721
- package/public/js/ws-client.js +74 -74
- package/public/l-preview.html +242 -0
- package/public/llms-full.txt +360 -360
- package/public/llms.txt +125 -125
- package/public/login.html +85 -85
- package/public/mesh-dashboard.html +328 -328
- package/public/milestones.html +346 -0
- package/public/one-click.html +779 -0
- package/public/openapi.json +669 -669
- package/public/partners.ar.html +145 -0
- package/public/partners.html +143 -0
- package/public/phone-shield.html +281 -281
- package/public/plesk-integration.html +375 -375
- package/public/premium-dashboard.html +2489 -2489
- package/public/premium.html +793 -793
- package/public/privacy.html +297 -297
- package/public/provider-onboarding.html +172 -172
- package/public/provider-sandbox.html +134 -134
- package/public/providers.html +359 -359
- package/public/refusals.html +172 -0
- package/public/register.html +105 -105
- package/public/registrar-integrations.html +141 -141
- package/public/ring4.html +292 -0
- package/public/robots.txt +99 -99
- package/public/route53-integration.html +531 -531
- package/public/score.html +263 -0
- package/public/script/wab-consent.d.ts +36 -36
- package/public/script/wab-consent.js +104 -104
- package/public/script/wab-schema.js +131 -131
- package/public/script/wab.d.ts +108 -108
- package/public/script/wab.min.js +580 -580
- package/public/security.txt +8 -8
- package/public/shieldlink.html +244 -0
- package/public/shieldqr.html +231 -231
- package/public/sitemap.xml +13 -1
- package/public/terms.html +256 -256
- package/public/trust-graph-api.ar.html +92 -0
- package/public/trust-graph-api.html +91 -0
- package/public/wab-features.html +560 -0
- package/public/wab-trust.html +200 -200
- package/public/wab-truth.html +375 -0
- package/public/wab-vs-protocols.html +210 -210
- package/public/whitepaper.html +449 -449
- package/script/ai-agent-bridge.js +1754 -1754
- package/sdk/README.md +99 -99
- package/sdk/agent-mesh.js +449 -449
- package/sdk/auto-discovery.js +301 -288
- package/sdk/commander.js +262 -262
- package/sdk/governance.js +262 -262
- package/sdk/index.d.ts +464 -464
- package/sdk/index.js +649 -649
- package/sdk/multi-agent.js +318 -318
- package/sdk/safe-mode.js +221 -221
- package/sdk/safety-shield.js +219 -219
- package/sdk/schema-discovery.js +83 -83
- package/server/adapters/index.js +520 -520
- package/server/config/plans.js +412 -367
- package/server/config/secrets.js +102 -102
- package/server/control-plane/index.js +301 -301
- package/server/data-plane/index.js +354 -354
- package/server/index.js +790 -670
- package/server/llm/index.js +404 -404
- package/server/middleware/adminAuth.js +35 -35
- package/server/middleware/api-tier.js +170 -0
- package/server/middleware/auth.js +50 -50
- package/server/middleware/featureGate.js +88 -88
- package/server/middleware/rateLimits.js +100 -100
- package/server/middleware/sensitiveAction.js +157 -157
- package/server/middleware/wab-trust.js +141 -0
- package/server/migrations/001_add_analytics_indexes.sql +7 -7
- package/server/migrations/002_premium_features.sql +418 -418
- package/server/migrations/003_ads_integer_cents.sql +33 -33
- package/server/migrations/004_agent_os.sql +158 -158
- package/server/migrations/005_marketplace_metering.sql +126 -126
- package/server/migrations/006_growth_suite.sql +138 -0
- package/server/migrations/007_governance.sql +106 -106
- package/server/migrations/008_plans.sql +144 -144
- package/server/migrations/009_shieldqr.sql +30 -30
- package/server/migrations/010_extended_trust.sql +33 -33
- package/server/migrations/011_outreach.sql +47 -0
- package/server/migrations/012_shieldlink.sql +116 -0
- package/server/migrations/013_ct_monitor.sql +13 -0
- package/server/migrations/014_wab_advanced_features.sql +128 -0
- package/server/migrations/015_wab_truth_layer.sql +101 -0
- package/server/migrations/016_ring4_external_trust.sql +84 -0
- package/server/migrations/017_ring4_extensions.sql +69 -0
- package/server/migrations/018_commercial_foundations.sql +167 -0
- package/server/migrations/019_unify_tier_constraints.sql +133 -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 +740 -740
- package/server/observability/failure-analysis.js +337 -337
- package/server/observability/index.js +394 -394
- package/server/protocol/capabilities.js +223 -223
- package/server/protocol/index.js +243 -243
- package/server/protocol/schema.js +584 -584
- package/server/registry/certification.js +271 -271
- package/server/registry/index.js +326 -326
- package/server/routes/activate.js +478 -0
- package/server/routes/admin-outreach.js +239 -0
- package/server/routes/admin-plans.js +76 -76
- package/server/routes/admin-premium.js +674 -673
- package/server/routes/admin-shieldlink.js +137 -0
- package/server/routes/admin-shieldqr.js +90 -90
- package/server/routes/admin-trust-monitor.js +139 -83
- package/server/routes/admin.js +550 -549
- package/server/routes/adopt.js +61 -0
- package/server/routes/ads.js +130 -130
- package/server/routes/agent-workspace.js +540 -540
- package/server/routes/api-keys.js +127 -0
- package/server/routes/api.js +150 -150
- package/server/routes/auth.js +71 -71
- package/server/routes/billing.js +57 -57
- package/server/routes/commander.js +316 -316
- package/server/routes/customer-shieldlink.js +133 -0
- package/server/routes/demo-showcase.js +332 -332
- package/server/routes/demo-store.js +154 -154
- package/server/routes/diagnose.js +373 -0
- package/server/routes/discovery.js +2348 -2348
- package/server/routes/enterprise-mesh.js +170 -0
- package/server/routes/gateway.js +173 -173
- package/server/routes/governance-saas.js +203 -0
- package/server/routes/governance.js +208 -208
- package/server/routes/growth.js +1048 -0
- package/server/routes/intent.js +328 -0
- package/server/routes/license.js +251 -251
- package/server/routes/mesh.js +469 -469
- package/server/routes/noscript.js +543 -543
- package/server/routes/partners.js +201 -0
- package/server/routes/plans.js +33 -33
- package/server/routes/premium-v2.js +686 -686
- package/server/routes/premium.js +724 -724
- package/server/routes/providers.js +650 -650
- package/server/routes/reputation.js +411 -0
- package/server/routes/ring4.js +885 -0
- package/server/routes/runtime.js +2148 -2148
- package/server/routes/shieldlink.js +70 -0
- package/server/routes/shieldqr.js +88 -88
- package/server/routes/sovereign.js +465 -465
- package/server/routes/truth-layer.js +670 -0
- package/server/routes/universal.js +200 -200
- package/server/routes/unsubscribe.js +51 -0
- package/server/routes/wab-api.js +850 -850
- package/server/routes/wab-cache.js +282 -0
- package/server/runtime/container-worker.js +111 -111
- package/server/runtime/container.js +448 -448
- package/server/runtime/distributed-worker.js +362 -362
- package/server/runtime/event-bus.js +210 -210
- package/server/runtime/index.js +253 -253
- package/server/runtime/queue.js +599 -599
- package/server/runtime/replay.js +666 -666
- package/server/runtime/sandbox.js +266 -266
- package/server/runtime/scheduler.js +534 -534
- package/server/runtime/session-engine.js +293 -293
- package/server/runtime/state-manager.js +188 -188
- package/server/secrets/wab-signing-key.pem +3 -0
- package/server/secrets/wab-signing-pub.pem +3 -0
- package/server/security/cross-site-redactor.js +196 -196
- package/server/security/dry-run.js +180 -180
- package/server/security/human-gate-rate-limit.js +147 -147
- package/server/security/human-gate-transports.js +178 -178
- package/server/security/human-gate.js +281 -281
- package/server/security/index.js +368 -368
- package/server/security/intent-engine.js +245 -245
- package/server/security/reward-guard.js +171 -171
- package/server/security/rollback-store.js +239 -239
- package/server/security/token-scope.js +404 -404
- package/server/security/url-policy.js +139 -139
- package/server/services/adoption-agent.js +182 -0
- package/server/services/agent-chat.js +506 -506
- package/server/services/agent-learning.js +601 -601
- package/server/services/agent-memory.js +625 -625
- package/server/services/agent-mesh.js +555 -555
- package/server/services/agent-symphony.js +717 -717
- package/server/services/agent-tasks.js +1807 -1807
- package/server/services/api-key-engine.js +292 -292
- package/server/services/cluster.js +894 -894
- package/server/services/commander.js +738 -738
- package/server/services/edge-compute.js +440 -440
- package/server/services/email.js +233 -233
- package/server/services/fairness-engine.js +409 -0
- package/server/services/fairness.js +420 -0
- package/server/services/governance.js +466 -466
- package/server/services/hosted-runtime.js +205 -205
- package/server/services/lfd.js +635 -635
- package/server/services/local-ai.js +389 -389
- package/server/services/marketplace.js +270 -270
- package/server/services/metering.js +182 -182
- package/server/services/modules/affiliate-intelligence.js +93 -93
- package/server/services/modules/agent-firewall.js +90 -90
- package/server/services/modules/bounty.js +89 -89
- package/server/services/modules/collective-bargaining.js +92 -92
- package/server/services/modules/dark-pattern.js +66 -66
- package/server/services/modules/gov-intelligence.js +45 -45
- package/server/services/modules/neural.js +55 -55
- package/server/services/modules/notary.js +49 -49
- package/server/services/modules/price-time-machine.js +86 -86
- package/server/services/modules/protocol.js +104 -104
- package/server/services/negotiation.js +439 -439
- package/server/services/outreach-agent.js +312 -0
- package/server/services/plans.js +214 -214
- package/server/services/plugins.js +771 -771
- package/server/services/price-intelligence.js +566 -566
- package/server/services/price-shield.js +1137 -1137
- package/server/services/provider-clients.js +740 -740
- package/server/services/reputation.js +465 -465
- package/server/services/search-engine.js +357 -357
- package/server/services/security.js +513 -513
- package/server/services/self-healing.js +843 -843
- package/server/services/shieldlink.js +492 -0
- package/server/services/shieldqr.js +322 -322
- package/server/services/sovereign-shield.js +542 -542
- package/server/services/ssl-ct-monitor.js +224 -0
- package/server/services/ssl-inspector.js +42 -42
- package/server/services/ssl-monitor.js +167 -167
- package/server/services/stripe.js +206 -205
- package/server/services/swarm.js +788 -788
- package/server/services/universal-scraper.js +662 -662
- package/server/services/verification.js +481 -481
- package/server/services/vision.js +1163 -1163
- package/server/services/wab-crypto.js +178 -178
- package/server/utils/cache.js +125 -125
- package/server/utils/migrate.js +81 -81
- package/server/utils/safe-fetch.js +228 -228
- package/server/utils/secureFields.js +50 -50
- package/server/ws.js +161 -161
- package/templates/artisan-marketplace.yaml +104 -104
- package/templates/book-price-scout.yaml +98 -98
- package/templates/electronics-price-tracker.yaml +108 -108
- package/templates/flight-deal-hunter.yaml +113 -113
- package/templates/freelancer-direct.yaml +116 -116
- package/templates/grocery-price-compare.yaml +93 -93
- package/templates/hotel-direct-booking.yaml +113 -113
- package/templates/local-services.yaml +98 -98
- package/templates/olive-oil-tunisia.yaml +88 -88
- package/templates/organic-farm-fresh.yaml +101 -101
- package/templates/restaurant-direct.yaml +97 -97
- package/templates/ring4/banking-sovereign.yaml +55 -0
- package/templates/ring4/ecommerce-sovereign.yaml +58 -0
- package/templates/ring4/healthcare-sovereign.yaml +60 -0
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Public Refusal Log — WAB Ring 4</title>
|
|
7
|
+
<meta name="description" content="Transparent, anonymized log of hard constitutional refusals issued by sovereign agents using WAB Ring 4. No PII. Daily-rotating salt.">
|
|
8
|
+
<link rel="canonical" href="https://webagentbridge.com/refusals">
|
|
9
|
+
<style>
|
|
10
|
+
:root { --bg:#0a0e1a; --card:#10172a; --muted:#94a3b8; --accent:#22d3ee; --warn:#f59e0b; --ok:#34d399; --fail:#f87171; }
|
|
11
|
+
*{box-sizing:border-box}
|
|
12
|
+
body { margin:0; font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; background: linear-gradient(180deg,#070b14,#0a0e1a); color:#e2e8f0; line-height:1.55; }
|
|
13
|
+
header { padding: 56px 24px 24px; text-align:center; }
|
|
14
|
+
header h1 { margin:0 0 8px; font-size: clamp(1.8rem, 4vw, 2.6rem); }
|
|
15
|
+
header p { margin:0 auto; max-width: 720px; color: var(--muted); }
|
|
16
|
+
.lang { position:absolute; top:18px; right:24px; background:#1e293b; border:1px solid #334155; color:#e2e8f0; padding:6px 14px; border-radius:999px; cursor:pointer; font-size:0.85rem; }
|
|
17
|
+
main { max-width: 1080px; margin: 0 auto; padding: 24px; }
|
|
18
|
+
.stats { display:grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap:16px; margin: 32px 0; }
|
|
19
|
+
.card { background: var(--card); border:1px solid #1f2937; border-radius: 14px; padding: 20px; }
|
|
20
|
+
.card .n { font-size: 2rem; font-weight: 700; color: var(--accent); }
|
|
21
|
+
.card .l { color: var(--muted); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; margin-top: 4px; }
|
|
22
|
+
h2 { margin-top: 40px; }
|
|
23
|
+
table { width:100%; border-collapse: collapse; margin-top: 12px; background: var(--card); border-radius: 14px; overflow:hidden; border:1px solid #1f2937; }
|
|
24
|
+
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid #1f2937; }
|
|
25
|
+
th { background: #0d1322; color: var(--muted); font-weight: 600; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.05em; }
|
|
26
|
+
tr:last-child td { border-bottom: none; }
|
|
27
|
+
.bar { height: 8px; background: #1f2937; border-radius: 4px; overflow: hidden; }
|
|
28
|
+
.bar > span { display:block; height:100%; background: linear-gradient(90deg, var(--accent), var(--warn)); }
|
|
29
|
+
.meta { color: var(--muted); font-size: 0.9rem; margin-top: 28px; padding: 16px; background:#0d1322; border-left:3px solid var(--accent); border-radius: 8px; }
|
|
30
|
+
.controls { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
|
|
31
|
+
select { background:#1e293b; border:1px solid #334155; color:#e2e8f0; padding:8px 12px; border-radius:8px; }
|
|
32
|
+
footer { text-align:center; padding: 40px 24px; color: var(--muted); font-size: 0.85rem; }
|
|
33
|
+
footer a { color: var(--accent); text-decoration:none; }
|
|
34
|
+
.empty { color: var(--muted); padding: 32px; text-align:center; }
|
|
35
|
+
[dir="rtl"] .lang { right:auto; left:24px; }
|
|
36
|
+
[dir="rtl"] .meta { border-left: none; border-right: 3px solid var(--accent); }
|
|
37
|
+
</style>
|
|
38
|
+
</head>
|
|
39
|
+
<body>
|
|
40
|
+
<button class="lang" id="langBtn" onclick="toggleLang()">العربية</button>
|
|
41
|
+
<header>
|
|
42
|
+
<h1 data-en="Public Refusal Log" data-ar="سجل الرفض العلني">Public Refusal Log</h1>
|
|
43
|
+
<p data-en="Transparent, anonymized record of hard constitutional refusals issued by sovereign agents connected to WAB Ring 4. No PII. No request bodies. Counts only."
|
|
44
|
+
data-ar="سجل شفاف ومجهول الهوية لحالات الرفض الدستوري الصارم التي أصدرتها الوكلاء السيادية المتصلة بـ WAB Ring 4. لا توجد بيانات شخصية. لا توجد محتويات طلبات. أعداد فقط.">
|
|
45
|
+
Transparent, anonymized record of hard constitutional refusals issued by sovereign agents connected to WAB Ring 4. No PII. No request bodies. Counts only.
|
|
46
|
+
</p>
|
|
47
|
+
</header>
|
|
48
|
+
|
|
49
|
+
<main>
|
|
50
|
+
<div class="controls">
|
|
51
|
+
<label data-en="Window:" data-ar="النطاق الزمني:">Window:</label>
|
|
52
|
+
<select id="days" onchange="load()">
|
|
53
|
+
<option value="7" data-en="Last 7 days" data-ar="آخر 7 أيام">Last 7 days</option>
|
|
54
|
+
<option value="30" selected data-en="Last 30 days" data-ar="آخر 30 يوماً">Last 30 days</option>
|
|
55
|
+
<option value="90" data-en="Last 90 days" data-ar="آخر 90 يوماً">Last 90 days</option>
|
|
56
|
+
<option value="365" data-en="Last year" data-ar="آخر سنة">Last year</option>
|
|
57
|
+
</select>
|
|
58
|
+
</div>
|
|
59
|
+
|
|
60
|
+
<div class="stats" id="stats"></div>
|
|
61
|
+
|
|
62
|
+
<h2 data-en="By Constitutional Article" data-ar="حسب المادة الدستورية">By Constitutional Article</h2>
|
|
63
|
+
<table id="byArticle">
|
|
64
|
+
<thead>
|
|
65
|
+
<tr>
|
|
66
|
+
<th data-en="Invariant / Article" data-ar="المبدأ / المادة">Invariant / Article</th>
|
|
67
|
+
<th data-en="Refusals" data-ar="حالات الرفض">Refusals</th>
|
|
68
|
+
<th data-en="Distribution" data-ar="التوزيع">Distribution</th>
|
|
69
|
+
</tr>
|
|
70
|
+
</thead>
|
|
71
|
+
<tbody></tbody>
|
|
72
|
+
</table>
|
|
73
|
+
|
|
74
|
+
<h2 data-en="Daily Trend" data-ar="الاتجاه اليومي">Daily Trend</h2>
|
|
75
|
+
<table id="byDay">
|
|
76
|
+
<thead>
|
|
77
|
+
<tr>
|
|
78
|
+
<th data-en="Date" data-ar="التاريخ">Date</th>
|
|
79
|
+
<th data-en="Refusals" data-ar="عدد الرفض">Refusals</th>
|
|
80
|
+
<th data-en="Bar" data-ar="رسم">Bar</th>
|
|
81
|
+
</tr>
|
|
82
|
+
</thead>
|
|
83
|
+
<tbody></tbody>
|
|
84
|
+
</table>
|
|
85
|
+
|
|
86
|
+
<div class="meta" id="privacyNote"></div>
|
|
87
|
+
</main>
|
|
88
|
+
|
|
89
|
+
<footer>
|
|
90
|
+
<p>
|
|
91
|
+
<a href="/ring4">Ring 4 Handshake</a> ·
|
|
92
|
+
<a href="/milestones">Milestones</a> ·
|
|
93
|
+
<a href="/api/ring4/refusals">JSON API</a> ·
|
|
94
|
+
<a href="/">WAB Home</a>
|
|
95
|
+
</p>
|
|
96
|
+
</footer>
|
|
97
|
+
|
|
98
|
+
<script>
|
|
99
|
+
let LANG = 'en';
|
|
100
|
+
function toggleLang() {
|
|
101
|
+
LANG = LANG === 'en' ? 'ar' : 'en';
|
|
102
|
+
document.documentElement.lang = LANG;
|
|
103
|
+
document.documentElement.dir = LANG === 'ar' ? 'rtl' : 'ltr';
|
|
104
|
+
document.getElementById('langBtn').textContent = LANG === 'en' ? 'العربية' : 'English';
|
|
105
|
+
document.querySelectorAll('[data-en],[data-ar]').forEach(el => {
|
|
106
|
+
const v = el.getAttribute('data-' + LANG);
|
|
107
|
+
if (v !== null) {
|
|
108
|
+
if (el.tagName === 'OPTION') el.textContent = v;
|
|
109
|
+
else if (el.children.length === 0) el.textContent = v;
|
|
110
|
+
else el.firstChild && (el.firstChild.nodeType === 3) && (el.firstChild.nodeValue = v);
|
|
111
|
+
}
|
|
112
|
+
});
|
|
113
|
+
load();
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
async function load() {
|
|
117
|
+
const days = document.getElementById('days').value;
|
|
118
|
+
try {
|
|
119
|
+
const r = await fetch('/api/ring4/refusals?days=' + days);
|
|
120
|
+
const data = await r.json();
|
|
121
|
+
renderStats(data);
|
|
122
|
+
renderArticles(data.by_article || []);
|
|
123
|
+
renderDays(data.by_day || []);
|
|
124
|
+
document.getElementById('privacyNote').textContent = data.privacy || '';
|
|
125
|
+
} catch (e) {
|
|
126
|
+
document.getElementById('stats').innerHTML =
|
|
127
|
+
'<div class="card"><div class="n">—</div><div class="l">' +
|
|
128
|
+
(LANG === 'ar' ? 'تعذر تحميل البيانات' : 'failed to load') + '</div></div>';
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function renderStats(data) {
|
|
133
|
+
const t = (en, ar) => LANG === 'ar' ? ar : en;
|
|
134
|
+
document.getElementById('stats').innerHTML = `
|
|
135
|
+
<div class="card"><div class="n">${data.total_refusals ?? 0}</div><div class="l">${t('Total hard refusals','إجمالي الرفض الصارم')}</div></div>
|
|
136
|
+
<div class="card"><div class="n">${(data.by_article||[]).length}</div><div class="l">${t('Articles invoked','مواد مستدعاة')}</div></div>
|
|
137
|
+
<div class="card"><div class="n">${data.window_days}</div><div class="l">${t('Window (days)','النطاق (أيام)')}</div></div>
|
|
138
|
+
`;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
function renderArticles(rows) {
|
|
142
|
+
const tbody = document.querySelector('#byArticle tbody');
|
|
143
|
+
if (!rows.length) { tbody.innerHTML = `<tr><td colspan="3" class="empty">${LANG==='ar'?'لا توجد بيانات':'no data'}</td></tr>`; return; }
|
|
144
|
+
const max = Math.max(...rows.map(r => r.n));
|
|
145
|
+
tbody.innerHTML = rows.map(r => `
|
|
146
|
+
<tr>
|
|
147
|
+
<td><code>${escapeHtml(r.article)}</code></td>
|
|
148
|
+
<td>${r.n}</td>
|
|
149
|
+
<td><div class="bar"><span style="width:${(r.n / max * 100).toFixed(1)}%"></span></div></td>
|
|
150
|
+
</tr>
|
|
151
|
+
`).join('');
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
function renderDays(rows) {
|
|
155
|
+
const tbody = document.querySelector('#byDay tbody');
|
|
156
|
+
if (!rows.length) { tbody.innerHTML = `<tr><td colspan="3" class="empty">${LANG==='ar'?'لا توجد بيانات':'no data'}</td></tr>`; return; }
|
|
157
|
+
const max = Math.max(...rows.map(r => r.n));
|
|
158
|
+
tbody.innerHTML = rows.map(r => `
|
|
159
|
+
<tr>
|
|
160
|
+
<td>${escapeHtml(r.day)}</td>
|
|
161
|
+
<td>${r.n}</td>
|
|
162
|
+
<td><div class="bar"><span style="width:${(r.n / max * 100).toFixed(1)}%"></span></div></td>
|
|
163
|
+
</tr>
|
|
164
|
+
`).join('');
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
function escapeHtml(s) { return String(s).replace(/[&<>"']/g, c => ({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c])); }
|
|
168
|
+
|
|
169
|
+
load();
|
|
170
|
+
</script>
|
|
171
|
+
</body>
|
|
172
|
+
</html>
|
package/public/register.html
CHANGED
|
@@ -1,105 +1,105 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Create Account — Web Agent Bridge</title>
|
|
7
|
-
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
-
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
|
-
<style>body{background:#0a0e1a;color:#f0f4ff;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;margin:0;min-height:100vh}</style>
|
|
10
|
-
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" as="style" onload="this.onload=null;this.rel='stylesheet'">
|
|
11
|
-
<noscript><link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet"></noscript>
|
|
12
|
-
<link rel="stylesheet" href="/css/styles.css?v=3.0.1">
|
|
13
|
-
<script src="/js/auth-redirect.js?v=3.0.1"></script>
|
|
14
|
-
</head>
|
|
15
|
-
<body>
|
|
16
|
-
<div class="auth-page">
|
|
17
|
-
<div class="auth-card fade-in">
|
|
18
|
-
<div style="text-align:center; margin-bottom:32px;">
|
|
19
|
-
<a href="/" class="navbar-brand" style="justify-content:center;">
|
|
20
|
-
<div class="brand-icon">⚡</div>
|
|
21
|
-
<span>WAB</span>
|
|
22
|
-
</a>
|
|
23
|
-
</div>
|
|
24
|
-
<h1 style="text-align:center;">Create account</h1>
|
|
25
|
-
<p class="subtitle" style="text-align:center;">Get started with Web Agent Bridge</p>
|
|
26
|
-
|
|
27
|
-
<div class="alert alert-error" id="errorAlert"></div>
|
|
28
|
-
<div class="alert alert-success" id="successAlert"></div>
|
|
29
|
-
|
|
30
|
-
<form id="registerForm">
|
|
31
|
-
<div class="form-group">
|
|
32
|
-
<label for="name">Full Name</label>
|
|
33
|
-
<input type="text" id="name" class="form-input" placeholder="John Doe" required>
|
|
34
|
-
</div>
|
|
35
|
-
<div class="form-group">
|
|
36
|
-
<label for="email">Email</label>
|
|
37
|
-
<input type="email" id="email" class="form-input" placeholder="you@example.com" required>
|
|
38
|
-
</div>
|
|
39
|
-
<div class="form-group">
|
|
40
|
-
<label for="company">Company <span style="color:var(--text-muted);">(optional)</span></label>
|
|
41
|
-
<input type="text" id="company" class="form-input" placeholder="Your company">
|
|
42
|
-
</div>
|
|
43
|
-
<div class="form-group">
|
|
44
|
-
<label for="password">Password</label>
|
|
45
|
-
<input type="password" id="password" class="form-input" placeholder="Min 8 characters" required minlength="8">
|
|
46
|
-
</div>
|
|
47
|
-
<div class="form-group" style="display: flex; align-items: flex-start; gap: 8px;">
|
|
48
|
-
<input type="checkbox" id="termsConsent" required style="margin-top: 4px; accent-color: var(--accent-blue);">
|
|
49
|
-
<label for="termsConsent" style="font-size: 0.85rem; color: var(--text-muted); line-height: 1.5;">
|
|
50
|
-
I agree to the <a href="/terms" style="color: var(--accent-blue);">Terms of Service</a> and
|
|
51
|
-
<a href="/privacy" style="color: var(--accent-blue);">Privacy Policy</a>
|
|
52
|
-
</label>
|
|
53
|
-
</div>
|
|
54
|
-
<button type="submit" class="btn btn-primary btn-lg">Create Account</button>
|
|
55
|
-
</form>
|
|
56
|
-
|
|
57
|
-
<div class="auth-footer">
|
|
58
|
-
Already have an account? <a href="/login">Sign in</a>
|
|
59
|
-
</div>
|
|
60
|
-
</div>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
<script>
|
|
64
|
-
if (localStorage.getItem('wab_token')) {
|
|
65
|
-
window.location.replace(typeof wabGetPostAuthRedirect === 'function' ? wabGetPostAuthRedirect() : '/dashboard');
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
document.getElementById('registerForm').addEventListener('submit', async (e) => {
|
|
69
|
-
e.preventDefault();
|
|
70
|
-
const errorEl = document.getElementById('errorAlert');
|
|
71
|
-
const successEl = document.getElementById('successAlert');
|
|
72
|
-
errorEl.style.display = 'none';
|
|
73
|
-
successEl.style.display = 'none';
|
|
74
|
-
|
|
75
|
-
const name = document.getElementById('name').value;
|
|
76
|
-
const email = document.getElementById('email').value;
|
|
77
|
-
const company = document.getElementById('company').value;
|
|
78
|
-
const password = document.getElementById('password').value;
|
|
79
|
-
|
|
80
|
-
try {
|
|
81
|
-
const res = await fetch('/api/auth/register', {
|
|
82
|
-
method: 'POST',
|
|
83
|
-
headers: { 'Content-Type': 'application/json' },
|
|
84
|
-
body: JSON.stringify({ name, email, company, password })
|
|
85
|
-
});
|
|
86
|
-
const data = await res.json();
|
|
87
|
-
|
|
88
|
-
if (!res.ok) {
|
|
89
|
-
errorEl.textContent = data.error || 'Registration failed';
|
|
90
|
-
errorEl.style.display = 'block';
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
localStorage.setItem('wab_token', data.token);
|
|
95
|
-
localStorage.setItem('wab_user', JSON.stringify(data.user));
|
|
96
|
-
window.location.href = typeof wabGetPostAuthRedirect === 'function' ? wabGetPostAuthRedirect() : '/dashboard';
|
|
97
|
-
} catch (err) {
|
|
98
|
-
errorEl.textContent = 'Connection error. Please try again.';
|
|
99
|
-
errorEl.style.display = 'block';
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
</script>
|
|
103
|
-
<script src="/js/cookie-consent.js?v=3.0.1"></script>
|
|
104
|
-
</body>
|
|
105
|
-
</html>
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
+
<title>Create Account — Web Agent Bridge</title>
|
|
7
|
+
<link rel="preconnect" href="https://fonts.googleapis.com">
|
|
8
|
+
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
|
9
|
+
<style>body{background:#0a0e1a;color:#f0f4ff;font-family:Inter,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif;margin:0;min-height:100vh}</style>
|
|
10
|
+
<link rel="preload" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" as="style" onload="this.onload=null;this.rel='stylesheet'">
|
|
11
|
+
<noscript><link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap" rel="stylesheet"></noscript>
|
|
12
|
+
<link rel="stylesheet" href="/css/styles.css?v=3.0.1">
|
|
13
|
+
<script src="/js/auth-redirect.js?v=3.0.1"></script>
|
|
14
|
+
</head>
|
|
15
|
+
<body>
|
|
16
|
+
<div class="auth-page">
|
|
17
|
+
<div class="auth-card fade-in">
|
|
18
|
+
<div style="text-align:center; margin-bottom:32px;">
|
|
19
|
+
<a href="/" class="navbar-brand" style="justify-content:center;">
|
|
20
|
+
<div class="brand-icon">⚡</div>
|
|
21
|
+
<span>WAB</span>
|
|
22
|
+
</a>
|
|
23
|
+
</div>
|
|
24
|
+
<h1 style="text-align:center;">Create account</h1>
|
|
25
|
+
<p class="subtitle" style="text-align:center;">Get started with Web Agent Bridge</p>
|
|
26
|
+
|
|
27
|
+
<div class="alert alert-error" id="errorAlert"></div>
|
|
28
|
+
<div class="alert alert-success" id="successAlert"></div>
|
|
29
|
+
|
|
30
|
+
<form id="registerForm">
|
|
31
|
+
<div class="form-group">
|
|
32
|
+
<label for="name">Full Name</label>
|
|
33
|
+
<input type="text" id="name" class="form-input" placeholder="John Doe" required>
|
|
34
|
+
</div>
|
|
35
|
+
<div class="form-group">
|
|
36
|
+
<label for="email">Email</label>
|
|
37
|
+
<input type="email" id="email" class="form-input" placeholder="you@example.com" required>
|
|
38
|
+
</div>
|
|
39
|
+
<div class="form-group">
|
|
40
|
+
<label for="company">Company <span style="color:var(--text-muted);">(optional)</span></label>
|
|
41
|
+
<input type="text" id="company" class="form-input" placeholder="Your company">
|
|
42
|
+
</div>
|
|
43
|
+
<div class="form-group">
|
|
44
|
+
<label for="password">Password</label>
|
|
45
|
+
<input type="password" id="password" class="form-input" placeholder="Min 8 characters" required minlength="8">
|
|
46
|
+
</div>
|
|
47
|
+
<div class="form-group" style="display: flex; align-items: flex-start; gap: 8px;">
|
|
48
|
+
<input type="checkbox" id="termsConsent" required style="margin-top: 4px; accent-color: var(--accent-blue);">
|
|
49
|
+
<label for="termsConsent" style="font-size: 0.85rem; color: var(--text-muted); line-height: 1.5;">
|
|
50
|
+
I agree to the <a href="/terms" style="color: var(--accent-blue);">Terms of Service</a> and
|
|
51
|
+
<a href="/privacy" style="color: var(--accent-blue);">Privacy Policy</a>
|
|
52
|
+
</label>
|
|
53
|
+
</div>
|
|
54
|
+
<button type="submit" class="btn btn-primary btn-lg">Create Account</button>
|
|
55
|
+
</form>
|
|
56
|
+
|
|
57
|
+
<div class="auth-footer">
|
|
58
|
+
Already have an account? <a href="/login">Sign in</a>
|
|
59
|
+
</div>
|
|
60
|
+
</div>
|
|
61
|
+
</div>
|
|
62
|
+
|
|
63
|
+
<script>
|
|
64
|
+
if (localStorage.getItem('wab_token')) {
|
|
65
|
+
window.location.replace(typeof wabGetPostAuthRedirect === 'function' ? wabGetPostAuthRedirect() : '/dashboard');
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
document.getElementById('registerForm').addEventListener('submit', async (e) => {
|
|
69
|
+
e.preventDefault();
|
|
70
|
+
const errorEl = document.getElementById('errorAlert');
|
|
71
|
+
const successEl = document.getElementById('successAlert');
|
|
72
|
+
errorEl.style.display = 'none';
|
|
73
|
+
successEl.style.display = 'none';
|
|
74
|
+
|
|
75
|
+
const name = document.getElementById('name').value;
|
|
76
|
+
const email = document.getElementById('email').value;
|
|
77
|
+
const company = document.getElementById('company').value;
|
|
78
|
+
const password = document.getElementById('password').value;
|
|
79
|
+
|
|
80
|
+
try {
|
|
81
|
+
const res = await fetch('/api/auth/register', {
|
|
82
|
+
method: 'POST',
|
|
83
|
+
headers: { 'Content-Type': 'application/json' },
|
|
84
|
+
body: JSON.stringify({ name, email, company, password })
|
|
85
|
+
});
|
|
86
|
+
const data = await res.json();
|
|
87
|
+
|
|
88
|
+
if (!res.ok) {
|
|
89
|
+
errorEl.textContent = data.error || 'Registration failed';
|
|
90
|
+
errorEl.style.display = 'block';
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
localStorage.setItem('wab_token', data.token);
|
|
95
|
+
localStorage.setItem('wab_user', JSON.stringify(data.user));
|
|
96
|
+
window.location.href = typeof wabGetPostAuthRedirect === 'function' ? wabGetPostAuthRedirect() : '/dashboard';
|
|
97
|
+
} catch (err) {
|
|
98
|
+
errorEl.textContent = 'Connection error. Please try again.';
|
|
99
|
+
errorEl.style.display = 'block';
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
</script>
|
|
103
|
+
<script src="/js/cookie-consent.js?v=3.0.1"></script>
|
|
104
|
+
</body>
|
|
105
|
+
</html>
|