drive-the-ui

Executes live UI actions on the user's open LangWatch page via CLI commands.

3.5k|362|Updated Sep 9, 2023
One-click install
npx skills add https://github.com/langwatch/langwatch --skill drive-the-ui
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: drive-the-ui
Source: https://github.com/langwatch/langwatch/tree/main/skills/_compiled/native/drive-the-ui
Command: npx skills add https://github.com/langwatch/langwatch --skill drive-the-ui

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

When a user has a LangWatch page open (such as the evaluations workbench), changes made behind their back leave their screen stale and confusing. This Skill lets the agent operate the page directly in the user's browser so edits happen visibly in front of them, with a backend fallback when no browser answers.

Core Features & Use Cases

  • Action discovery: langwatch ui actions lists the action kinds the current page accepts, with JSON schemas and required permissions, so payloads are never guessed.
  • Live action calls: langwatch ui call <kind> executes one typed action and reports executedVia as browser (user saw it happen) or backend (applied to saved state).
  • State reading: langwatch workbench get-state <experiment-slug> reads live workbench state including unsaved prompt drafts and in-memory results.
  • Use Case: While a user watches their evaluations workbench, duplicate a target, update its prompt, add an evaluator, and run the experiment, with each change appearing live on their screen.

Quick Start

Ask the agent to list the available UI actions on the current page and then update the target prompt on your open evaluations workbench so you can watch the change happen live.

Frequently Asked Questions about drive-the-ui

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I run UI actions on the page a user has open?

Run `langwatch ui actions` first to list the action kinds the current page accepts with their payload schemas, then call one with `langwatch ui call <kind> --payload-file <path>`. The action executes in the user's browser and the result returns in the same command.

How do I pass a prompt containing apostrophes to a UI action?

Write the JSON payload to a file and use `--payload-file <path>`, or pipe it via stdin with `-`. Inline `--payload` quoting breaks on apostrophes in prose, causing the command to refuse the payload.

What does executedVia browser versus backend mean?

`browser` means the user's open page applied the action and they watched it happen. `backend` means no page answered, so the platform applied it to the saved state and the user's page is a step behind until it catches up.

Why did my UI action fail with langy_ui_payload_invalid?

The payload did not match the action's JSON schema. Read `meta.issues` in the error response, fix the payload accordingly, and retry once. Run `langwatch ui actions` first to confirm the expected shape.

Can UI actions run outside an active agent turn?

No. UI actions run mid-turn only; outside a turn the call is refused with `langy_ui_turn_inactive`. They also require the LangWatch CLI inside a Langy worker session.

What should I do after a langy_ui_timeout error?

Do not retry blindly, because the page claimed the action and may have half-applied it. Re-read the state with `langwatch workbench get-state <experiment-slug>` first, then decide whether to retry.