# Run the three interactive scenarios

Open the [browser demo](https://delthin.github.io/moon-a2ui/) to use JavaScript without installing a toolchain. To compare it with Native, start the local service and browser preview using the [README instructions](../README.md#try-native-and-javascript-execution), then choose a runtime in the page header.

The scenario implementation is MoonBit in both modes. It creates A2UI messages, receives the renderer's user action, validates business inputs and returns updates. The official Lit renderer handles the visible controls.

## Collect a project name

Choose **信息填写**, replace the project name with `智能客服助手`, then click **确认项目**. The same interface displays `已确认项目：智能客服助手`. Change the name and submit again to see the data binding and response update together.

This flow is useful when an agent needs structured input before creating a support ticket, starting an onboarding task or configuring a workspace. The application can use the resolved action context rather than extracting a value from free-form conversation.

## Compare a deployment budget

Choose **方案选择**, select **托管部署 · ¥199 / 实例**, set **实例数量** to `3`, then click **计算预算**. The result is `托管部署 · 3 个实例，月预算 ¥597`. Switch the runtime and repeat: the backend changes while the input and calculation stay the same.

![Native deployment calculation](images/native-plans.png)

The displayed prices are example estimates. The flow demonstrates a configuration or quotation assistant: choices become structured action values, the application checks them, and the renderer displays the calculated result.

## Advance a task with actual checks

Choose **任务跟踪** and use its action button to advance the task. Each action executes the next check: message round-trip, invalid-component rejection, then cyclic-reference rejection. The interface adds the actual result and reaches `3/3` after the third check.

![JavaScript task results](images/js-tasks.png)

This interaction is useful for diagnostics and guided workflows because the UI reports completed work rather than animating a timer. An application can replace these checks with its own work while keeping the same action-and-update pattern.

## Inspect the messages

Expand **查看 A2UI 消息与状态** to inspect the operations, returned A2UI messages and final state. The runtime label identifies where MoonBit executed. The recent-interaction timing includes browser or HTTP overhead; use the [benchmark command](development.md#reproduce-the-performance-comparison) for a controlled core comparison.

The hosted page offers JavaScript execution. Native is available in the local preview with the service running at `127.0.0.1:4180`. Scenario changes reset the current example; inputs are demonstration data and are not saved as user accounts or projects.
