web-agent-bridge 3.2.0 → 3.4.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.
Files changed (256) hide show
  1. package/LICENSE +84 -72
  2. package/README.ar.md +1304 -1152
  3. package/README.md +298 -1635
  4. package/bin/agent-runner.js +474 -474
  5. package/bin/cli.js +237 -138
  6. package/bin/wab-init.js +223 -0
  7. package/bin/wab.js +80 -80
  8. package/examples/azure-dns-wab.js +83 -0
  9. package/examples/bidi-agent.js +119 -119
  10. package/examples/cloudflare-wab-dns.js +121 -0
  11. package/examples/cpanel-wab-dns.js +114 -0
  12. package/examples/cross-site-agent.js +91 -91
  13. package/examples/dns-discovery-agent.js +166 -0
  14. package/examples/gcp-dns-wab.js +76 -0
  15. package/examples/governance-agent.js +169 -0
  16. package/examples/mcp-agent.js +94 -94
  17. package/examples/next-app-router/README.md +44 -44
  18. package/examples/plesk-wab-dns.js +103 -0
  19. package/examples/puppeteer-agent.js +108 -108
  20. package/examples/route53-wab-dns.js +144 -0
  21. package/examples/saas-dashboard/README.md +55 -55
  22. package/examples/safe-mode-agent.js +96 -0
  23. package/examples/shopify-hydrogen/README.md +74 -74
  24. package/examples/vision-agent.js +171 -171
  25. package/examples/wab-sign.js +74 -0
  26. package/examples/wab-verify.js +60 -0
  27. package/examples/wordpress-elementor/README.md +77 -77
  28. package/package.json +19 -6
  29. package/public/.well-known/agent-tools.json +180 -180
  30. package/public/.well-known/ai-assets.json +59 -59
  31. package/public/.well-known/security.txt +8 -0
  32. package/public/.well-known/wab.json +28 -0
  33. package/public/activate.html +368 -0
  34. package/public/adoption-metrics.html +188 -0
  35. package/public/agent-workspace.html +349 -349
  36. package/public/ai.html +198 -198
  37. package/public/api.html +413 -412
  38. package/public/azure-dns-integration.html +289 -0
  39. package/public/browser.html +486 -486
  40. package/public/cloudflare-integration.html +380 -0
  41. package/public/commander-dashboard.html +243 -243
  42. package/public/cookies.html +210 -210
  43. package/public/cpanel-integration.html +398 -0
  44. package/public/css/agent-workspace.css +1713 -1713
  45. package/public/css/premium.css +317 -317
  46. package/public/css/styles.css +1263 -1235
  47. package/public/dashboard.html +707 -706
  48. package/public/dns.html +436 -0
  49. package/public/docs.html +588 -587
  50. package/public/feed.xml +89 -89
  51. package/public/gcp-dns-integration.html +318 -0
  52. package/public/growth.html +465 -463
  53. package/public/index.html +1266 -982
  54. package/public/integrations.html +556 -0
  55. package/public/js/activate.js +145 -0
  56. package/public/js/agent-workspace.js +1740 -1740
  57. package/public/js/auth-nav.js +65 -31
  58. package/public/js/auth-redirect.js +12 -12
  59. package/public/js/cookie-consent.js +56 -56
  60. package/public/js/dns.js +438 -0
  61. package/public/js/wab-demo-page.js +721 -721
  62. package/public/js/ws-client.js +74 -74
  63. package/public/llms-full.txt +360 -360
  64. package/public/llms.txt +125 -125
  65. package/public/login.html +85 -85
  66. package/public/mesh-dashboard.html +328 -328
  67. package/public/openapi.json +669 -580
  68. package/public/phone-shield.html +281 -0
  69. package/public/plesk-integration.html +375 -0
  70. package/public/premium-dashboard.html +2489 -2489
  71. package/public/premium.html +793 -793
  72. package/public/privacy.html +297 -297
  73. package/public/provider-onboarding.html +172 -0
  74. package/public/provider-sandbox.html +134 -0
  75. package/public/providers.html +359 -0
  76. package/public/register.html +105 -105
  77. package/public/registrar-integrations.html +141 -0
  78. package/public/robots.txt +99 -87
  79. package/public/route53-integration.html +531 -0
  80. package/public/script/wab-consent.d.ts +36 -36
  81. package/public/script/wab-consent.js +104 -104
  82. package/public/script/wab-schema.js +131 -131
  83. package/public/script/wab.d.ts +108 -108
  84. package/public/script/wab.min.js +580 -580
  85. package/public/security.txt +8 -0
  86. package/public/shieldqr.html +231 -0
  87. package/public/sitemap.xml +6 -0
  88. package/public/terms.html +256 -256
  89. package/public/wab-trust.html +200 -0
  90. package/public/wab-vs-protocols.html +210 -0
  91. package/public/whitepaper.html +449 -0
  92. package/script/ai-agent-bridge.js +1754 -1754
  93. package/sdk/README.md +99 -99
  94. package/sdk/agent-mesh.js +449 -449
  95. package/sdk/auto-discovery.js +288 -0
  96. package/sdk/commander.js +262 -262
  97. package/sdk/governance.js +262 -0
  98. package/sdk/index.d.ts +464 -464
  99. package/sdk/index.js +25 -1
  100. package/sdk/multi-agent.js +318 -318
  101. package/sdk/package.json +2 -2
  102. package/sdk/safe-mode.js +221 -0
  103. package/sdk/safety-shield.js +219 -0
  104. package/sdk/schema-discovery.js +83 -83
  105. package/server/adapters/index.js +520 -520
  106. package/server/config/plans.js +367 -367
  107. package/server/config/secrets.js +102 -102
  108. package/server/control-plane/index.js +301 -301
  109. package/server/data-plane/index.js +354 -354
  110. package/server/index.js +670 -427
  111. package/server/llm/index.js +404 -404
  112. package/server/middleware/adminAuth.js +35 -35
  113. package/server/middleware/auth.js +50 -50
  114. package/server/middleware/featureGate.js +88 -88
  115. package/server/middleware/rateLimits.js +100 -100
  116. package/server/middleware/sensitiveAction.js +157 -0
  117. package/server/migrations/001_add_analytics_indexes.sql +7 -7
  118. package/server/migrations/002_premium_features.sql +418 -418
  119. package/server/migrations/003_ads_integer_cents.sql +33 -33
  120. package/server/migrations/004_agent_os.sql +158 -158
  121. package/server/migrations/005_marketplace_metering.sql +126 -126
  122. package/server/migrations/007_governance.sql +106 -0
  123. package/server/migrations/008_plans.sql +144 -0
  124. package/server/migrations/009_shieldqr.sql +30 -0
  125. package/server/migrations/010_extended_trust.sql +33 -0
  126. package/server/models/adapters/index.js +33 -33
  127. package/server/models/adapters/mysql.js +183 -183
  128. package/server/models/adapters/postgresql.js +172 -172
  129. package/server/models/adapters/sqlite.js +7 -7
  130. package/server/models/db.js +740 -681
  131. package/server/observability/failure-analysis.js +337 -337
  132. package/server/observability/index.js +394 -394
  133. package/server/protocol/capabilities.js +223 -223
  134. package/server/protocol/index.js +243 -243
  135. package/server/protocol/schema.js +584 -584
  136. package/server/registry/certification.js +271 -271
  137. package/server/registry/index.js +326 -326
  138. package/server/routes/admin-plans.js +76 -0
  139. package/server/routes/admin-premium.js +673 -671
  140. package/server/routes/admin-shieldqr.js +90 -0
  141. package/server/routes/admin-trust-monitor.js +83 -0
  142. package/server/routes/admin.js +549 -261
  143. package/server/routes/ads.js +130 -130
  144. package/server/routes/agent-workspace.js +540 -540
  145. package/server/routes/api.js +150 -150
  146. package/server/routes/auth.js +71 -71
  147. package/server/routes/billing.js +57 -45
  148. package/server/routes/commander.js +316 -316
  149. package/server/routes/demo-showcase.js +332 -332
  150. package/server/routes/demo-store.js +154 -0
  151. package/server/routes/discovery.js +2348 -417
  152. package/server/routes/gateway.js +173 -157
  153. package/server/routes/governance.js +208 -0
  154. package/server/routes/license.js +251 -240
  155. package/server/routes/mesh.js +469 -469
  156. package/server/routes/noscript.js +543 -543
  157. package/server/routes/plans.js +33 -0
  158. package/server/routes/premium-v2.js +686 -686
  159. package/server/routes/premium.js +724 -724
  160. package/server/routes/providers.js +650 -0
  161. package/server/routes/runtime.js +2148 -2147
  162. package/server/routes/shieldqr.js +88 -0
  163. package/server/routes/sovereign.js +465 -385
  164. package/server/routes/universal.js +200 -185
  165. package/server/routes/wab-api.js +850 -501
  166. package/server/runtime/container-worker.js +111 -111
  167. package/server/runtime/container.js +448 -448
  168. package/server/runtime/distributed-worker.js +362 -362
  169. package/server/runtime/event-bus.js +210 -210
  170. package/server/runtime/index.js +253 -253
  171. package/server/runtime/queue.js +599 -599
  172. package/server/runtime/replay.js +666 -666
  173. package/server/runtime/sandbox.js +266 -266
  174. package/server/runtime/scheduler.js +534 -534
  175. package/server/runtime/session-engine.js +293 -293
  176. package/server/runtime/state-manager.js +188 -188
  177. package/server/security/cross-site-redactor.js +196 -0
  178. package/server/security/dry-run.js +180 -0
  179. package/server/security/human-gate-rate-limit.js +147 -0
  180. package/server/security/human-gate-transports.js +178 -0
  181. package/server/security/human-gate.js +281 -0
  182. package/server/security/index.js +368 -368
  183. package/server/security/intent-engine.js +245 -0
  184. package/server/security/reward-guard.js +171 -0
  185. package/server/security/rollback-store.js +239 -0
  186. package/server/security/token-scope.js +404 -0
  187. package/server/security/url-policy.js +139 -0
  188. package/server/services/agent-chat.js +506 -506
  189. package/server/services/agent-learning.js +601 -575
  190. package/server/services/agent-memory.js +625 -625
  191. package/server/services/agent-mesh.js +555 -539
  192. package/server/services/agent-symphony.js +717 -717
  193. package/server/services/agent-tasks.js +1807 -1807
  194. package/server/services/api-key-engine.js +292 -261
  195. package/server/services/cluster.js +894 -894
  196. package/server/services/commander.js +738 -738
  197. package/server/services/edge-compute.js +440 -440
  198. package/server/services/email.js +233 -204
  199. package/server/services/governance.js +466 -0
  200. package/server/services/hosted-runtime.js +205 -205
  201. package/server/services/lfd.js +635 -635
  202. package/server/services/local-ai.js +389 -389
  203. package/server/services/marketplace.js +270 -270
  204. package/server/services/metering.js +182 -182
  205. package/server/services/modules/affiliate-intelligence.js +93 -93
  206. package/server/services/modules/agent-firewall.js +90 -90
  207. package/server/services/modules/bounty.js +89 -89
  208. package/server/services/modules/collective-bargaining.js +92 -92
  209. package/server/services/modules/dark-pattern.js +66 -66
  210. package/server/services/modules/gov-intelligence.js +45 -45
  211. package/server/services/modules/neural.js +55 -55
  212. package/server/services/modules/notary.js +49 -49
  213. package/server/services/modules/price-time-machine.js +86 -86
  214. package/server/services/modules/protocol.js +104 -104
  215. package/server/services/negotiation.js +439 -439
  216. package/server/services/plans.js +214 -0
  217. package/server/services/plugins.js +771 -771
  218. package/server/services/premium.js +1 -1
  219. package/server/services/price-intelligence.js +566 -566
  220. package/server/services/price-shield.js +1137 -1137
  221. package/server/services/provider-clients.js +740 -0
  222. package/server/services/reputation.js +465 -465
  223. package/server/services/search-engine.js +357 -357
  224. package/server/services/security.js +513 -513
  225. package/server/services/self-healing.js +843 -843
  226. package/server/services/shieldqr.js +322 -0
  227. package/server/services/sovereign-shield.js +542 -0
  228. package/server/services/ssl-inspector.js +42 -0
  229. package/server/services/ssl-monitor.js +167 -0
  230. package/server/services/stripe.js +205 -192
  231. package/server/services/swarm.js +788 -788
  232. package/server/services/universal-scraper.js +662 -661
  233. package/server/services/verification.js +481 -481
  234. package/server/services/vision.js +1163 -1163
  235. package/server/services/wab-crypto.js +178 -0
  236. package/server/utils/cache.js +125 -125
  237. package/server/utils/migrate.js +81 -81
  238. package/server/utils/safe-fetch.js +228 -0
  239. package/server/utils/secureFields.js +50 -50
  240. package/server/ws.js +161 -161
  241. package/templates/artisan-marketplace.yaml +104 -104
  242. package/templates/book-price-scout.yaml +98 -98
  243. package/templates/electronics-price-tracker.yaml +108 -108
  244. package/templates/flight-deal-hunter.yaml +113 -113
  245. package/templates/freelancer-direct.yaml +116 -116
  246. package/templates/grocery-price-compare.yaml +93 -93
  247. package/templates/hotel-direct-booking.yaml +113 -113
  248. package/templates/local-services.yaml +98 -98
  249. package/templates/olive-oil-tunisia.yaml +88 -88
  250. package/templates/organic-farm-fresh.yaml +101 -101
  251. package/templates/restaurant-direct.yaml +97 -97
  252. package/public/score.html +0 -263
  253. package/server/migrations/006_growth_suite.sql +0 -138
  254. package/server/routes/growth.js +0 -962
  255. package/server/services/fairness-engine.js +0 -409
  256. package/server/services/fairness.js +0 -420
@@ -1,101 +1,101 @@
1
- # WAB Agent Template — Organic Farm Fresh
2
- # Connects consumers directly with organic farms
3
- # Run: npx wab-agent run organic-farm-fresh.yaml --product "vegetables"
4
-
5
- name: organic-farm-fresh
6
- version: 1.0.0
7
- description: Buy organic produce directly from farms — no supermarket markup
8
- author: WAB Community
9
- tags: [organic, farming, fresh-produce, direct-buy, agriculture]
10
-
11
- goal: >
12
- Find WAB-enabled organic farms and cooperatives, verify organic certification,
13
- compare prices with supermarket equivalents, negotiate farm-direct pricing,
14
- and support sustainable agriculture.
15
-
16
- target_sites:
17
- discovery_method: wab-registry
18
- category: organic-farming
19
- region: auto
20
- fallback_urls: []
21
-
22
- parameters:
23
- - name: product
24
- type: string
25
- required: true
26
- description: "Type of produce (vegetables, fruits, dairy, eggs, honey, herbs)"
27
- - name: organic_only
28
- type: boolean
29
- default: true
30
- - name: max_distance_km
31
- type: number
32
- default: 50
33
-
34
- actions:
35
- - name: discover
36
- description: Find organic farms and cooperatives
37
- wab_action: discover
38
-
39
- - name: browse_produce
40
- description: See available seasonal produce
41
- wab_action: getProducts
42
- params:
43
- category: "{{product}}"
44
- organic: "{{organic_only}}"
45
- collect: true
46
-
47
- - name: verify_certification
48
- description: Verify organic certification claims
49
- wab_action: verifyText
50
- params:
51
- fields: [certification, certifier, valid_until]
52
- require_pass: true
53
-
54
- - name: verify_prices
55
- description: Cross-check prices
56
- wab_action: verifyPrice
57
- require_pass: true
58
-
59
- - name: negotiate
60
- description: Negotiate farm-direct pricing
61
- wab_action: negotiate
62
- strategy: bulk_order
63
- conditions:
64
- proposed_discount: 12
65
- argument: "Buying direct saves packaging and distribution costs"
66
- fallback_strategy: repeat_customer
67
-
68
- - name: order
69
- description: Place order for pickup or delivery
70
- wab_action: placeOrder
71
- requires: [verify_certification, verify_prices]
72
-
73
- fairness_rules:
74
- prefer_local: true
75
- prefer_small_business: true
76
- currency: auto
77
- min_reputation_score: 20
78
- avoid_monopolies: true
79
- support_sustainable: true
80
-
81
- negotiation:
82
- enabled: true
83
- max_rounds: 2
84
- strategies:
85
- - bulk_order
86
- - repeat_customer
87
- - loyalty
88
- walk_away_threshold: 0
89
- respect_farmer_floor: true
90
-
91
- verification:
92
- anti_hallucination: true
93
- cross_check_prices: true
94
- verify_certifications: true
95
- max_price_variance: 0.10
96
-
97
- output:
98
- format: table
99
- include: [farm, product, unit, price, organic_certified, distance_km, reputation, freshness]
100
- sort_by: distance_km
101
- limit: 15
1
+ # WAB Agent Template — Organic Farm Fresh
2
+ # Connects consumers directly with organic farms
3
+ # Run: npx wab-agent run organic-farm-fresh.yaml --product "vegetables"
4
+
5
+ name: organic-farm-fresh
6
+ version: 1.0.0
7
+ description: Buy organic produce directly from farms — no supermarket markup
8
+ author: WAB Community
9
+ tags: [organic, farming, fresh-produce, direct-buy, agriculture]
10
+
11
+ goal: >
12
+ Find WAB-enabled organic farms and cooperatives, verify organic certification,
13
+ compare prices with supermarket equivalents, negotiate farm-direct pricing,
14
+ and support sustainable agriculture.
15
+
16
+ target_sites:
17
+ discovery_method: wab-registry
18
+ category: organic-farming
19
+ region: auto
20
+ fallback_urls: []
21
+
22
+ parameters:
23
+ - name: product
24
+ type: string
25
+ required: true
26
+ description: "Type of produce (vegetables, fruits, dairy, eggs, honey, herbs)"
27
+ - name: organic_only
28
+ type: boolean
29
+ default: true
30
+ - name: max_distance_km
31
+ type: number
32
+ default: 50
33
+
34
+ actions:
35
+ - name: discover
36
+ description: Find organic farms and cooperatives
37
+ wab_action: discover
38
+
39
+ - name: browse_produce
40
+ description: See available seasonal produce
41
+ wab_action: getProducts
42
+ params:
43
+ category: "{{product}}"
44
+ organic: "{{organic_only}}"
45
+ collect: true
46
+
47
+ - name: verify_certification
48
+ description: Verify organic certification claims
49
+ wab_action: verifyText
50
+ params:
51
+ fields: [certification, certifier, valid_until]
52
+ require_pass: true
53
+
54
+ - name: verify_prices
55
+ description: Cross-check prices
56
+ wab_action: verifyPrice
57
+ require_pass: true
58
+
59
+ - name: negotiate
60
+ description: Negotiate farm-direct pricing
61
+ wab_action: negotiate
62
+ strategy: bulk_order
63
+ conditions:
64
+ proposed_discount: 12
65
+ argument: "Buying direct saves packaging and distribution costs"
66
+ fallback_strategy: repeat_customer
67
+
68
+ - name: order
69
+ description: Place order for pickup or delivery
70
+ wab_action: placeOrder
71
+ requires: [verify_certification, verify_prices]
72
+
73
+ fairness_rules:
74
+ prefer_local: true
75
+ prefer_small_business: true
76
+ currency: auto
77
+ min_reputation_score: 20
78
+ avoid_monopolies: true
79
+ support_sustainable: true
80
+
81
+ negotiation:
82
+ enabled: true
83
+ max_rounds: 2
84
+ strategies:
85
+ - bulk_order
86
+ - repeat_customer
87
+ - loyalty
88
+ walk_away_threshold: 0
89
+ respect_farmer_floor: true
90
+
91
+ verification:
92
+ anti_hallucination: true
93
+ cross_check_prices: true
94
+ verify_certifications: true
95
+ max_price_variance: 0.10
96
+
97
+ output:
98
+ format: table
99
+ include: [farm, product, unit, price, organic_certified, distance_km, reputation, freshness]
100
+ sort_by: distance_km
101
+ limit: 15
@@ -1,97 +1,97 @@
1
- # WAB Agent Template — Local Restaurant Finder
2
- # Finds restaurants directly without Uber Eats / DoorDash
3
- # Run: npx wab-agent run restaurant-direct.yaml --cuisine "italian" --city "Rome"
4
-
5
- name: restaurant-direct
6
- version: 1.0.0
7
- description: Discover and order from local restaurants directly, saving delivery app commissions
8
- author: WAB Community
9
- tags: [food, restaurant, delivery, local, anti-monopoly]
10
-
11
- goal: >
12
- Find WAB-enabled restaurants, browse menus with verified prices,
13
- negotiate group/regular customer discounts, and order directly.
14
-
15
- target_sites:
16
- discovery_method: wab-registry
17
- category: restaurants
18
- region: auto
19
- fallback_urls: []
20
-
21
- parameters:
22
- - name: cuisine
23
- type: string
24
- description: Cuisine type (e.g. italian, japanese, moroccan)
25
- - name: city
26
- type: string
27
- required: true
28
- - name: delivery
29
- type: boolean
30
- default: true
31
- - name: max_price
32
- type: number
33
- default: 50
34
-
35
- actions:
36
- - name: discover
37
- description: Find restaurants in the area
38
- wab_action: discover
39
-
40
- - name: get_menu
41
- description: Get restaurant menu
42
- wab_action: getMenu
43
- params:
44
- cuisine: "{{cuisine}}"
45
- collect: true
46
-
47
- - name: verify_prices
48
- description: Cross-check menu prices
49
- wab_action: verifyPrice
50
- require_pass: true
51
-
52
- - name: check_reputation
53
- description: Check restaurant WAB reputation
54
- wab_action: getReputation
55
-
56
- - name: negotiate
57
- description: Negotiate regular customer or group order discount
58
- wab_action: negotiate
59
- strategy: repeat_customer
60
- conditions:
61
- proposed_discount: 10
62
- fallback_strategy: first_time
63
-
64
- - name: order
65
- description: Place order directly
66
- wab_action: placeOrder
67
- requires: [verify_prices]
68
-
69
- fairness_rules:
70
- prefer_local: true
71
- prefer_small_business: true
72
- max_price: "{{max_price}}"
73
- currency: auto
74
- min_reputation_score: 30
75
- avoid_monopolies: true
76
-
77
- negotiation:
78
- enabled: true
79
- max_rounds: 2
80
- strategies:
81
- - repeat_customer
82
- - first_time
83
- - bulk_order
84
- walk_away_threshold: 0
85
- pitch: "No Uber Eats commission — pass some savings to me"
86
-
87
- verification:
88
- anti_hallucination: true
89
- cross_check_prices: true
90
- require_vision_match: false
91
- max_price_variance: 0.10
92
-
93
- output:
94
- format: table
95
- include: [restaurant, cuisine, dish, price, rating, reputation, delivery_available]
96
- sort_by: price
97
- limit: 15
1
+ # WAB Agent Template — Local Restaurant Finder
2
+ # Finds restaurants directly without Uber Eats / DoorDash
3
+ # Run: npx wab-agent run restaurant-direct.yaml --cuisine "italian" --city "Rome"
4
+
5
+ name: restaurant-direct
6
+ version: 1.0.0
7
+ description: Discover and order from local restaurants directly, saving delivery app commissions
8
+ author: WAB Community
9
+ tags: [food, restaurant, delivery, local, anti-monopoly]
10
+
11
+ goal: >
12
+ Find WAB-enabled restaurants, browse menus with verified prices,
13
+ negotiate group/regular customer discounts, and order directly.
14
+
15
+ target_sites:
16
+ discovery_method: wab-registry
17
+ category: restaurants
18
+ region: auto
19
+ fallback_urls: []
20
+
21
+ parameters:
22
+ - name: cuisine
23
+ type: string
24
+ description: Cuisine type (e.g. italian, japanese, moroccan)
25
+ - name: city
26
+ type: string
27
+ required: true
28
+ - name: delivery
29
+ type: boolean
30
+ default: true
31
+ - name: max_price
32
+ type: number
33
+ default: 50
34
+
35
+ actions:
36
+ - name: discover
37
+ description: Find restaurants in the area
38
+ wab_action: discover
39
+
40
+ - name: get_menu
41
+ description: Get restaurant menu
42
+ wab_action: getMenu
43
+ params:
44
+ cuisine: "{{cuisine}}"
45
+ collect: true
46
+
47
+ - name: verify_prices
48
+ description: Cross-check menu prices
49
+ wab_action: verifyPrice
50
+ require_pass: true
51
+
52
+ - name: check_reputation
53
+ description: Check restaurant WAB reputation
54
+ wab_action: getReputation
55
+
56
+ - name: negotiate
57
+ description: Negotiate regular customer or group order discount
58
+ wab_action: negotiate
59
+ strategy: repeat_customer
60
+ conditions:
61
+ proposed_discount: 10
62
+ fallback_strategy: first_time
63
+
64
+ - name: order
65
+ description: Place order directly
66
+ wab_action: placeOrder
67
+ requires: [verify_prices]
68
+
69
+ fairness_rules:
70
+ prefer_local: true
71
+ prefer_small_business: true
72
+ max_price: "{{max_price}}"
73
+ currency: auto
74
+ min_reputation_score: 30
75
+ avoid_monopolies: true
76
+
77
+ negotiation:
78
+ enabled: true
79
+ max_rounds: 2
80
+ strategies:
81
+ - repeat_customer
82
+ - first_time
83
+ - bulk_order
84
+ walk_away_threshold: 0
85
+ pitch: "No Uber Eats commission — pass some savings to me"
86
+
87
+ verification:
88
+ anti_hallucination: true
89
+ cross_check_prices: true
90
+ require_vision_match: false
91
+ max_price_variance: 0.10
92
+
93
+ output:
94
+ format: table
95
+ include: [restaurant, cuisine, dish, price, rating, reputation, delivery_available]
96
+ sort_by: price
97
+ limit: 15
package/public/score.html DELETED
@@ -1,263 +0,0 @@
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>WAB Score — Platform Transparency Rating</title>
7
- <meta name="description" content="Check any platform's WAB Score — the digital world's credit rating for transparency and fairness.">
8
- <link rel="icon" href="/assets/favicon.svg" type="image/svg+xml">
9
- <link href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;900&display=swap" rel="stylesheet">
10
- <link rel="stylesheet" href="/css/styles.css?v=3.0.1">
11
- <style>
12
- .score-hero { padding: 80px 20px 40px; text-align: center; background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%); color: #fff; }
13
- .score-hero h1 { font-size: 42px; margin-bottom: 12px; }
14
- .score-hero p { color: #94a3b8; font-size: 18px; max-width: 600px; margin: 0 auto 32px; }
15
- .search-box { display: flex; max-width: 560px; margin: 0 auto; gap: 8px; }
16
- .search-box input { flex: 1; padding: 14px 20px; border: 2px solid #334155; border-radius: 10px; font-size: 16px; background: #1e293b; color: #fff; outline: none; }
17
- .search-box input::placeholder { color: #64748b; }
18
- .search-box input:focus { border-color: #3b82f6; }
19
- .search-box button { padding: 14px 28px; background: #3b82f6; color: white; border: none; border-radius: 10px; font-weight: 700; font-size: 16px; cursor: pointer; }
20
- .search-box button:hover { background: #2563eb; }
21
- .search-box button:disabled { opacity: 0.6; cursor: wait; }
22
-
23
- .result-container { max-width: 700px; margin: 40px auto; padding: 0 20px; }
24
- .score-card { background: white; border-radius: 16px; padding: 40px; box-shadow: 0 4px 24px rgba(0,0,0,0.08); display: none; }
25
- .score-card.visible { display: block; animation: fadeIn 0.3s ease; }
26
- @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
27
-
28
- .score-header { display: flex; align-items: center; gap: 24px; margin-bottom: 32px; }
29
- .score-circle { width: 100px; height: 100px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; flex-shrink: 0; }
30
- .score-circle .grade { font-size: 32px; font-weight: 900; line-height: 1; }
31
- .score-circle .number { font-size: 13px; opacity: 0.8; }
32
- .score-domain { font-size: 28px; font-weight: 700; color: #0f172a; }
33
- .score-label { font-size: 16px; color: #64748b; margin-top: 4px; }
34
-
35
- .score-bars { margin-bottom: 32px; }
36
- .bar-row { margin-bottom: 16px; }
37
- .bar-label { display: flex; justify-content: space-between; font-size: 14px; margin-bottom: 6px; }
38
- .bar-label span:first-child { font-weight: 600; color: #334155; }
39
- .bar-label span:last-child { color: #64748b; }
40
- .bar-track { height: 10px; background: #f1f5f9; border-radius: 5px; overflow: hidden; }
41
- .bar-fill { height: 100%; border-radius: 5px; transition: width 0.6s ease; }
42
-
43
- .signals-list { border-top: 1px solid #e2e8f0; padding-top: 20px; }
44
- .signals-list h4 { font-size: 14px; color: #64748b; margin-bottom: 12px; text-transform: uppercase; letter-spacing: 1px; }
45
- .signal { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; border-bottom: 1px solid #f1f5f9; }
46
- .signal:last-child { border-bottom: none; }
47
- .signal .name { color: #334155; }
48
- .signal .impact { font-weight: 600; }
49
- .signal .impact.positive { color: #22c55e; }
50
- .signal .impact.negative { color: #ef4444; }
51
-
52
- .badge-embed { margin-top: 24px; padding: 16px; background: #f8fafc; border-radius: 8px; }
53
- .badge-embed h4 { font-size: 14px; color: #64748b; margin-bottom: 8px; }
54
- .badge-embed code { display: block; background: #0f172a; color: #e2e8f0; padding: 12px; border-radius: 6px; font-size: 12px; word-break: break-all; }
55
-
56
- .error-msg { text-align: center; padding: 24px; color: #ef4444; font-weight: 600; display: none; }
57
- .error-msg.visible { display: block; }
58
-
59
- .recent-scores { max-width: 700px; margin: 40px auto; padding: 0 20px 60px; }
60
- .recent-scores h3 { font-size: 20px; color: #0f172a; margin-bottom: 16px; }
61
- .recent-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
62
- .recent-item { display: flex; align-items: center; gap: 12px; background: #fff; padding: 12px 16px; border-radius: 8px; border: 1px solid #e2e8f0; cursor: pointer; transition: border-color 0.2s; }
63
- .recent-item:hover { border-color: #3b82f6; }
64
- .recent-item .mini-grade { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 900; font-size: 14px; color: white; flex-shrink: 0; }
65
- .recent-item .info .domain { font-weight: 600; font-size: 14px; color: #0f172a; }
66
- .recent-item .info .meta { font-size: 12px; color: #64748b; }
67
- </style>
68
- </head>
69
- <body>
70
- <!-- NAVBAR -->
71
- <nav class="navbar">
72
- <div class="container" style="display:flex; align-items:center; justify-content:space-between; height:64px;">
73
- <a href="/" class="navbar-brand"><div class="brand-icon">⚡</div><span>Web Agent Bridge</span></a>
74
- <div style="display:flex; gap:20px; align-items:center;">
75
- <a href="/#features" style="color:var(--text-secondary); text-decoration:none; font-size:14px;">Features</a>
76
- <a href="/docs" style="color:var(--text-secondary); text-decoration:none; font-size:14px;">Docs</a>
77
- <a href="/growth" style="color:var(--text-secondary); text-decoration:none; font-size:14px;">Growth Suite</a>
78
- <a href="/login" class="btn btn-secondary" style="padding:6px 16px; font-size:13px;">Login</a>
79
- </div>
80
- </div>
81
- </nav>
82
-
83
- <!-- HERO -->
84
- <section class="score-hero">
85
- <h1>WAB <span class="gradient-text">Score</span></h1>
86
- <p>The digital world's credit rating. Check any platform's transparency, fairness, and security score.</p>
87
- <form class="search-box" id="scoreForm" onsubmit="return false;">
88
- <input type="text" id="domainInput" placeholder="Enter domain (e.g. amazon.com, shein.com)" autocomplete="off" autofocus>
89
- <button type="submit" id="searchBtn" onclick="checkScore()">Check Score</button>
90
- </form>
91
- </section>
92
-
93
- <!-- RESULT -->
94
- <div class="result-container">
95
- <div class="error-msg" id="errorMsg"></div>
96
- <div class="score-card" id="scoreCard">
97
- <div class="score-header">
98
- <div class="score-circle" id="scoreCircle">
99
- <span class="grade" id="gradeText"></span>
100
- <span class="number" id="scoreNumber"></span>
101
- </div>
102
- <div>
103
- <div class="score-domain" id="domainText"></div>
104
- <div class="score-label" id="gradeLabel"></div>
105
- </div>
106
- </div>
107
-
108
- <div class="score-bars">
109
- <div class="bar-row">
110
- <div class="bar-label"><span>Fairness Score</span><span id="fairnessVal"></span></div>
111
- <div class="bar-track"><div class="bar-fill" id="fairnessBar" style="width:0"></div></div>
112
- </div>
113
- <div class="bar-row">
114
- <div class="bar-label"><span>Security Score</span><span id="securityVal"></span></div>
115
- <div class="bar-track"><div class="bar-fill" id="securityBar" style="width:0"></div></div>
116
- </div>
117
- </div>
118
-
119
- <div class="signals-list" id="signalsList">
120
- <h4>Analysis Signals</h4>
121
- </div>
122
-
123
- <div class="badge-embed">
124
- <h4>Embed This Badge</h4>
125
- <code id="badgeCode"></code>
126
- </div>
127
- </div>
128
- </div>
129
-
130
- <!-- RECENT -->
131
- <div class="recent-scores" id="recentSection" style="display:none;">
132
- <h3>Recently Checked</h3>
133
- <div class="recent-grid" id="recentGrid"></div>
134
- </div>
135
-
136
- <script>
137
- const recentScores = JSON.parse(localStorage.getItem('wab_recent_scores') || '[]');
138
- renderRecent();
139
-
140
- // Allow URL param: /score?domain=amazon.com
141
- const urlParams = new URLSearchParams(window.location.search);
142
- const domainParam = urlParams.get('domain');
143
- if (domainParam) {
144
- document.getElementById('domainInput').value = domainParam;
145
- setTimeout(checkScore, 100);
146
- }
147
-
148
- async function checkScore() {
149
- const input = document.getElementById('domainInput');
150
- const btn = document.getElementById('searchBtn');
151
- const card = document.getElementById('scoreCard');
152
- const error = document.getElementById('errorMsg');
153
-
154
- let domain = input.value.trim().toLowerCase();
155
- if (!domain) return;
156
-
157
- // Clean input
158
- domain = domain.replace(/^https?:\/\//, '').replace(/^www\./, '').replace(/\/.*$/, '');
159
- if (domain.length < 3 || !domain.includes('.')) {
160
- error.textContent = 'Please enter a valid domain (e.g. amazon.com)';
161
- error.classList.add('visible');
162
- card.classList.remove('visible');
163
- return;
164
- }
165
-
166
- btn.disabled = true;
167
- btn.textContent = 'Checking...';
168
- error.classList.remove('visible');
169
- card.classList.remove('visible');
170
-
171
- try {
172
- const res = await fetch('/api/growth/score/' + encodeURIComponent(domain));
173
- const data = await res.json();
174
-
175
- if (!res.ok) throw new Error(data.error || 'Failed to check score');
176
-
177
- // Update URL
178
- history.replaceState(null, '', '/score?domain=' + encodeURIComponent(domain));
179
-
180
- // Render
181
- renderScore(data);
182
- saveRecent(data);
183
- } catch (err) {
184
- error.textContent = err.message;
185
- error.classList.add('visible');
186
- } finally {
187
- btn.disabled = false;
188
- btn.textContent = 'Check Score';
189
- }
190
- }
191
-
192
- function renderScore(data) {
193
- const card = document.getElementById('scoreCard');
194
- const circle = document.getElementById('scoreCircle');
195
- const gradeColors = {
196
- 'A+': '#22c55e', 'A': '#4ade80', 'A-': '#86efac',
197
- 'B+': '#a3e635', 'B': '#facc15', 'B-': '#fbbf24',
198
- 'C+': '#f59e0b', 'C': '#fb923c', 'C-': '#f97316',
199
- 'D': '#ef4444', 'F': '#dc2626'
200
- };
201
- const color = data.grade_color || gradeColors[data.grade] || '#64748b';
202
-
203
- circle.style.background = color;
204
- circle.style.color = '#fff';
205
- document.getElementById('gradeText').textContent = data.grade;
206
- document.getElementById('scoreNumber').textContent = data.score + '/100';
207
- document.getElementById('domainText').textContent = data.domain;
208
- document.getElementById('gradeLabel').textContent = data.grade_label;
209
-
210
- document.getElementById('fairnessVal').textContent = data.fairness_score + '/100';
211
- document.getElementById('fairnessBar').style.width = data.fairness_score + '%';
212
- document.getElementById('fairnessBar').style.background = data.fairness_score >= 70 ? '#22c55e' : data.fairness_score >= 50 ? '#f59e0b' : '#ef4444';
213
-
214
- document.getElementById('securityVal').textContent = data.security_score + '/100';
215
- document.getElementById('securityBar').style.width = data.security_score + '%';
216
- document.getElementById('securityBar').style.background = data.security_score >= 70 ? '#22c55e' : data.security_score >= 50 ? '#f59e0b' : '#ef4444';
217
-
218
- // Signals
219
- const signalsList = document.getElementById('signalsList');
220
- signalsList.innerHTML = '<h4>Analysis Signals</h4>';
221
- if (data.details && data.details.signals) {
222
- data.details.signals.forEach(s => {
223
- const isPositive = s.impact.startsWith('+');
224
- signalsList.innerHTML += '<div class="signal"><span class="name">' + s.signal.replace(/_/g, ' ') + '</span><span class="impact ' + (isPositive ? 'positive' : 'negative') + '">' + s.impact + '</span></div>';
225
- });
226
- }
227
-
228
- // Badge code
229
- document.getElementById('badgeCode').textContent = '<img src="https://webagentbridge.com/api/growth/trust/badge/' + data.domain + '" alt="WAB Score: ' + data.grade + '" />';
230
-
231
- card.classList.add('visible');
232
- }
233
-
234
- function saveRecent(data) {
235
- const existing = recentScores.findIndex(s => s.domain === data.domain);
236
- if (existing >= 0) recentScores.splice(existing, 1);
237
- recentScores.unshift({ domain: data.domain, score: data.score, grade: data.grade, grade_label: data.grade_label, grade_color: data.grade_color });
238
- if (recentScores.length > 12) recentScores.pop();
239
- localStorage.setItem('wab_recent_scores', JSON.stringify(recentScores));
240
- renderRecent();
241
- }
242
-
243
- function renderRecent() {
244
- const section = document.getElementById('recentSection');
245
- const grid = document.getElementById('recentGrid');
246
- if (recentScores.length === 0) { section.style.display = 'none'; return; }
247
- section.style.display = 'block';
248
- grid.innerHTML = recentScores.map(s => {
249
- const gradeColors = { 'A+': '#22c55e', 'A': '#4ade80', 'A-': '#86efac', 'B+': '#a3e635', 'B': '#facc15', 'B-': '#fbbf24', 'C+': '#f59e0b', 'C': '#fb923c', 'C-': '#f97316', 'D': '#ef4444', 'F': '#dc2626' };
250
- const color = s.grade_color || gradeColors[s.grade] || '#64748b';
251
- return '<div class="recent-item" onclick="document.getElementById(\'domainInput\').value=\'' + s.domain + '\';checkScore();">' +
252
- '<div class="mini-grade" style="background:' + color + '">' + s.grade + '</div>' +
253
- '<div class="info"><div class="domain">' + s.domain + '</div><div class="meta">' + s.score + '/100 · ' + s.grade_label + '</div></div>' +
254
- '</div>';
255
- }).join('');
256
- }
257
-
258
- document.getElementById('domainInput').addEventListener('keydown', function(e) {
259
- if (e.key === 'Enter') checkScore();
260
- });
261
- </script>
262
- </body>
263
- </html>