hypra

SEM-005: action has no name

Error: the page doesn't build until this is fixed.

An action's name, like cart.add, is the address the button posts to (/_a/cart.add), the route your server handles, and the tool name AI agents call it by.

Fails

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.") {
  h1 "Shoes"
  action(id: 42) "Add to cart"
}
error[SEM-005]: `action` needs `name`
 --> page.hypra:3:3
  |
3 |   action(id: 42) "Add to cart"
  |   ^^^^^^
  = help: action("cart.add", id: product.id) "Add to cart"
  = docs: https://hypralang.dev/rules/sem-005/

1 error, 0 warnings

Fixed

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.") {
  h1 "Shoes"
  action("cart.add", id: 42) "Add to cart"
}