# What’s wrong with this one? demo: source

> The code that makes the What’s wrong with this one? demo work, walked through snippet by snippet.

The agent has no tools. Everything it knows about the console is a small record the page sends with each message.

## What the page sends

Plain strings, rebuilt whenever the visitor clicks.

```ts file=src/demos/relay/awareness.ts
return {
  page: 'Relay dispatch console, today’s deliveries (demo, sample data)',
  now: `Today ${NOW}`,
  selectedShipment: selected ? shipmentDetail(selected) : NOTHING_SELECTED,
  view: `${label}: ${rows.length} shipment${rows.length === 1 ? '' : 's'} on screen`,
  rowsOnScreen: rows.map(rowLine).join(' | '),
}
```

## Hand it to the agent

No page tools, just the record.

```tsx file=src/demos/relay/index.tsx
const agent = useDemoElement({ handle: AGENT_HANDLE, situationalAwareness: record, onRuntimeEvent, loadSdk, fetchSession })
```

## Tell the agent what it means

The prompt names each key, and what "this one" refers to.

```md file=demos/relay/prompt/policy-rules.md
1. Answer only from the page's situational awareness. Never invent a shipment, scan, time, note or phone number that is not in it.
2. "This one", "it" and "this shipment" mean selectedShipment. If selectedShipment is "none", ask the visitor to click a shipment in the list, in one sentence, and say nothing else about shipments.
```

## An agent with nothing else

No functions, no widgets.

```json file=demos/relay/demo.json
"functions": [],
"widgets": []
```
