Agents

Agent drives the app

The tool calls an AI agent makes: read the running app, click and type in it, check its console and edit its files.

bash · ~/app
editor

The project's files open here.

Changes save as you type. Press Escape, then Tab, to leave the editor.

preview

The page the server serves shows here.

  1. boot
  2. npm install
  3. start
  4. ready

idle

betaClientVM is pre-1.0 (v0.2.0): things can break, and APIs may change between releases. Found a bug? Open an issue.

About this demo

This is what an AI app builder does between a model’s turns. Each chip is one tool call from @clientvm/agent-api, made here in the browser exactly as it would be for a model’s tool_use block, and the terminal shows the call and the result the model would get back.

The preview is the agent’s own: preview_snapshot reads it as a text outline with element refs, preview_click and preview_type drive it, and preview_console returns what the page logged. edit_file changes the project, and the next load shows the change.

How it's built

import { createAgentTools } from '@clientvm/agent-api';

const tools = createAgentTools({ instance: app, previewContainer });
// send tools.definitions to the model; for each tool_use block it returns:
const result = await tools.call('preview_click', { port: 5050, text: 'Add item' });