Business flow diagram
用户意图
│
├─ 模糊意图("想喝点什么")─→ getRecommendedDrinks → 推荐卡片
│ │
├─ 明确关键词("拿铁")───→ searchDrinks → 搜索结果卡片 ─┤
│ │
│ 用户点击卡片选择某款饮品 │
│ ↓ │
│ selectDrink → 饮品详情卡片
│ │
│ ┌───────────────┤
│ ↓ ↓
│ 用户在半屏选规格 Agent 使用默认规格
│ ↓ ↓
│ confirmSku ←───────────────┘
│ │
│ ↓
│ 订单确认卡(order-confirm-card)
│ ├─ 有地址:展示完整订单
│ └─ 无地址:展示"添加收货地址"空态
│ ↓
│ 用户点击地址区域 → 半屏填写 → saveAddress
│ ↓
│ 订单确认卡更新(含地址)
│ ↓
│ 用户点击"确认下单" → payOrder → 支付成功卡片
│
└─ 门店查询("最近的店")──→ getStoreStatus → 门店状态卡片(实时刷新)
The Agent cannot skip selectDrink and directly call confirmSku——there must first be a valid drinkId returned by selectDrink. The Agent cannot skip confirmSku and directly call payOrder——there must first be an order in confirmed status. Before payOrder returns success, it is forbidden to announce to the user that "payment was successful."
Atomic interface dependencies
| Interface | Function | Component | Precondition |
|---|---|---|---|
| getRecommendedDrinks | Display featured drinks when the intent is vague | recommended-drinks | — |
| searchDrinks | Search drinks by keyword | recommended-drinks | The user provided a keyword |
| getAllDrinks | The half-screen page loads all data | — | The Agent usually does not call it directly |
| selectDrink | View drink details and specifications | drink-detail-card | drinkId already exists (from recommendation/search) |
| confirmSku | Confirm specifications and generate an order | order-confirm-card | selectDrink has already been called to obtain specification information |
| getAddress | View the default address | address-card | — |
| saveAddress | Save the address and continue the order | order-confirm-card | The user provided the complete three address elements |
| confirmOrder | Display the order confirmation again | order-confirm-card | orderId already exists |
| payOrder | Initiate payment | pay-success-card | Order status=confirmed |
| getStoreStatus | Real-time store status | store-status-card | The user asks about store information |
Business constraints (iron rules across interfaces)
1. Output form
- All interfaces that return successfully (isError=false) and are bound to a componentmust display a card, and it is forbidden to list the detailed data in the card as plain text.
- When replying, the Agent may attach a short guiding phrase (such as "recommended 3 for you, tap the card to choose"), butit is forbidden to expand product names, prices, specifications, etc. in the form of a markdown list。
2. Execution order
payOrderOnly after the call succeeds (isError=false) may it announce "payment successful" to the user.confirmSkumust be called afterselectDrinksucceeds.- Concurrent calls are forbidden
payOrder; the next transaction must be initiated only after the previous one ends.
3. Data source
drinkIdmust come fromgetRecommendedDrinks/searchDrinks/getAllDrinksthe returneditems[].drinkIdoriginal value, fabrication is forbidden.orderIdmust come fromconfirmSku/saveAddress/confirmOrderthe returnedorderIdoriginal value, fabrication is forbidden.- All enumerated specification values must use English enums (such as
ice/hot), and Chinese labels are forbidden.
4. Address handling
confirmSkuRegardless of whether there is an address, directly return the order confirmation card; the empty address state will have its entry displayed by the card component itself.- The Agent does not need to actively call
getAddressto determine whether there is an address——this is handled automatically insideconfirmSku. - When the address is empty, the user taps "Confirm Order",
payOrderwill return isError indicating a missing address.
User intent routing
Direct intent (triggers this SKILL)
- "want something to drink"
- "get a coffee"
- "recommend some drinks"
- "what milk tea is there"
- "help me order a latte"
- "Show me the menu"
- "Large hot americano"
- "Is the nearest store crowded"
Intent routing rules
- User only says vague expressions like "I want a drink / recommendations" →
getRecommendedDrinks - User names a specific product/category →
searchDrinks - User selects a drink by clicking a card →
selectDrink(drinkId is passed in by the card's sendFollowUpMessage) - User asks about stores/queues →
getStoreStatus - User expresses an ambiguous phrase (e.g. "that one") → ask a clarifying question first; guessing is prohibited