# WAB Agent Template — Local Restaurant Finder
# Finds restaurants directly without Uber Eats / DoorDash
# Run: npx wab-agent run restaurant-direct.yaml --cuisine "italian" --city "Rome"

name: restaurant-direct
version: 1.0.0
description: Discover and order from local restaurants directly, saving delivery app commissions
author: WAB Community
tags: [food, restaurant, delivery, local, anti-monopoly]

goal: >
  Find WAB-enabled restaurants, browse menus with verified prices,
  negotiate group/regular customer discounts, and order directly.

target_sites:
  discovery_method: wab-registry
  category: restaurants
  region: auto
  fallback_urls: []

parameters:
  - name: cuisine
    type: string
    description: Cuisine type (e.g. italian, japanese, moroccan)
  - name: city
    type: string
    required: true
  - name: delivery
    type: boolean
    default: true
  - name: max_price
    type: number
    default: 50

actions:
  - name: discover
    description: Find restaurants in the area
    wab_action: discover

  - name: get_menu
    description: Get restaurant menu
    wab_action: getMenu
    params:
      cuisine: "{{cuisine}}"
    collect: true

  - name: verify_prices
    description: Cross-check menu prices
    wab_action: verifyPrice
    require_pass: true

  - name: check_reputation
    description: Check restaurant WAB reputation
    wab_action: getReputation

  - name: negotiate
    description: Negotiate regular customer or group order discount
    wab_action: negotiate
    strategy: repeat_customer
    conditions:
      proposed_discount: 10
    fallback_strategy: first_time

  - name: order
    description: Place order directly
    wab_action: placeOrder
    requires: [verify_prices]

fairness_rules:
  prefer_local: true
  prefer_small_business: true
  max_price: "{{max_price}}"
  currency: auto
  min_reputation_score: 30
  avoid_monopolies: true

negotiation:
  enabled: true
  max_rounds: 2
  strategies:
    - repeat_customer
    - first_time
    - bulk_order
  walk_away_threshold: 0
  pitch: "No Uber Eats commission — pass some savings to me"

verification:
  anti_hallucination: true
  cross_check_prices: true
  require_vision_match: false
  max_price_variance: 0.10

output:
  format: table
  include: [restaurant, cuisine, dish, price, rating, reputation, delivery_available]
  sort_by: price
  limit: 15
